Skip to content

WIT interface

Current package:

omnifs:provider@0.4.0
suspended(list<callout>)
returned(provider-return)

Returned steps carry an operation result and effects. They do not carry trailing callouts.

record provider-return {
%result: op-result,
effects: effects,
}

The operation result answers the call. The effects record is the only terminal host-mutation channel.

InterfaceFunctions
Lifecycleinitialize, shutdown
Namespacelookup-child, list-children, read-file, open-file, read-chunk, close-file
Continuationresume, cancel
Notifyon-event

initialize is lifecycle setup. Browse operations live under namespace. Suspended operations resume through continuation.resume. Provider events enter through notify.on-event.

  • fetch
  • git-open-repo
  • fetch-blob
  • open-archive
  • read-blob

Callouts are request/response. A provider cannot emit fire-and-forget host work.

  • canonical
  • fs
  • invalidations
record effects {
canonical: list<canonical-store>,
fs: list<fs-write>,
invalidations: list<invalidation>,
}

canonical stores raw upstream bytes under a logical object id. fs writes files or directories into the view cache. invalidations evict cached objects or listings.

The WIT file metadata shape uses:

  • file-size: exact(u64), non-zero, or unknown,
  • byte-source: inline, canonical, blob, or deferred,
  • read-mode: full or ranged,
  • stability: immutable, mutable, or volatile.

See File attributes for the host policy derived from those declarations.

For exact record fields, use crates/omnifs-wit/wit/provider.wit in the implementation repo.