Plugin Contract Reference
March 21, 2026 ยท View on GitHub
This file describes the live public authoring contract exported by @tetsuo-ai/plugin-kit.
Supported Plugin Class
Phase 2 supports exactly one hosted extension class:
plugin_type: "channel_adapter"
No broader plugin class should be inferred from this repo.
Required Module Exports
Plugin modules must export:
manifestvalidateConfigcreateChannelAdapter
ESM named exports are the canonical contract. CommonJS default-object interop is supported when the default export exposes the same fields.
Manifest Contract
The manifest is defined in src/channel-manifest.ts. Important fields include:
plugin_idchannel_nameplugin_typeschema_versionversiondisplay_nameplugin_api_versionhost_api_version
The public serialized ABI is snake_case.
Runtime Interface
The adapter runtime is defined in src/channel-runtime.ts.
Required adapter methods:
initialize(context): Promise<void>start(): Promise<void>stop(): Promise<void>send(message): Promise<void>isHealthy(): boolean
isHealthy() is synchronous. A starter or fixture should not model it as an async method.
Payload Shapes
Inbound message
- identity:
id,channel,sender_id,sender_name - scope/session:
session_id,scope - content:
content - optional metadata:
timestamp,metadata,attachments
Outbound message
- required:
session_id,content - optional:
attachments,is_partial,tts,metadata
Attachments use the shared ChannelInboundAttachment structure.
Compatibility Matrix
The canonical compatibility tuple is published in two stable forms:
@tetsuo-ai/plugin-kit/channel-host-matrix@tetsuo-ai/plugin-kit/channel-host-matrix.json
The matrix schema supports:
supporteddeprecatedunsupported- optional operator notes
Current live support is the single Phase 2 tuple documented in the README.
Certification Flow
certifyChannelAdapterModule(...) validates that:
- required exports exist
- the manifest shape is valid
- compatibility metadata resolves cleanly
- the adapter runtime shape matches the contract
Certification returns structured results. Error classes exist for callers that want explicit exceptions, but the main certification helper is result-oriented.