Skip to content

WIT world: transform-plugin

  • Imports:
    • interface inseam:plugin/host@0.1.0
  • Exports:
    • interface inseam:plugin/transform@0.1.0

Host capabilities, granted per the plugin’s manifest. Calling a function the manifest did not request (or whose budget is spent) returns an error string; a well-behaved transform degrades to emitting less.


Diagnostic logging into the node’s tracing output.

  • message: string

One metered LLM completion (requires the llm capability). Model choice and budgeting belong to the host, not the plugin.

  • system: string
  • user: string
  • result<string, string>

One metered vision call: OCR, captioning (requires llm).

  • prompt: string
  • mimetype: string
  • image: list<u8>
  • result<string, string>

The raw bytes of the claimed source (requires the source-bytes capability; granted at the root only).

  • result<list<u8>, string>

Export interface inseam:plugin/transform@0.1.0

Section titled “Export interface inseam:plugin/transform@0.1.0”

The envelope of the source under transformation.

  • source-type: string

  • content-type: string

  • hint: option<string>

  • modified: option<s64>

    Unix-epoch seconds.

  • raw-bytes: u64

What this transform claims. The bridge intersects these with the manifest’s declared claims — the effective claim set is declared AND exported, so a component cannot quietly widen its reach past what its manifest promised.

  • mimetypes: list<string>

    Mimetype essences (`image/png`) or `type/*` patterns.

  • roots-only: bool

    Claim source roots only, or emitted fragments too.

One emitted fragment. WIT has no recursive types, so the sprout tree is flattened: parent indexes an EARLIER fragment in the same list, and none hangs the fragment off the claimed fragment itself.

  • parent: option<u32>

  • mimetype: string

    Mimetype of the emitted fragment, params allowed (`text/plain;via=ocr`).

  • relation: string

    Relation to the parent: `contains`, `derived-from`, `transcribes`, `links-to`, or `mentions`.

  • text: option<string>


Transform one claimed fragment. Infallible by contract on the seam: an error here is logged and treated as an empty output — indexing is enrichment, and a broken transform must not gate the source.

  • env: envelope
  • mimetype: string
  • is-root: bool
  • text: option<string>