WIT world: transform-plugin
- Imports:
- interface
inseam:plugin/host@0.1.0
- interface
- Exports:
- interface
inseam:plugin/transform@0.1.0
- interface
Import interface inseam:plugin/host@0.1.0
Section titled “Import interface inseam:plugin/host@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.
Functions
Section titled “Functions”log: func
Section titled “log: func”Diagnostic logging into the node’s tracing output.
Params
Section titled “Params”llm-complete: func
Section titled “llm-complete: func”One metered LLM completion (requires the llm capability). Model
choice and budgeting belong to the host, not the plugin.
Params
Section titled “Params”Return values
Section titled “Return values”llm-describe-image: func
Section titled “llm-describe-image: func”One metered vision call: OCR, captioning (requires llm).
Params
Section titled “Params”Return values
Section titled “Return values”source-bytes: func
Section titled “source-bytes: func”The raw bytes of the claimed source (requires the source-bytes
capability; granted at the root only).
Return values
Section titled “Return values”Export interface inseam:plugin/transform@0.1.0
Section titled “Export interface inseam:plugin/transform@0.1.0”record envelope
Section titled “record envelope”The envelope of the source under transformation.
Record Fields
Section titled “Record Fields”-
Unix-epoch seconds.
record claim-spec
Section titled “record claim-spec”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.
Record Fields
Section titled “Record Fields”-
Mimetype essences (`image/png`) or `type/*` patterns.
-
Claim source roots only, or emitted fragments too.
record fragment
Section titled “record fragment”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.
Record Fields
Section titled “Record Fields”-
Mimetype of the emitted fragment, params allowed (`text/plain;via=ocr`).
-
Relation to the parent: `contains`, `derived-from`, `transcribes`, `links-to`, or `mentions`.
record output
Section titled “record output”Record Fields
Section titled “Record Fields”fragments: list<fragment>
Functions
Section titled “Functions”claims: func
Section titled “claims: func”Return values
Section titled “Return values”apply: func
Section titled “apply: func”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.
Params
Section titled “Params”env:envelopemimetype:stringis-root:booltext: option<string>
Return values
Section titled “Return values”- result<
output,string>