1.0 KiB
1.0 KiB
@toolctrl/plugin-sdk
Phase 06 Task #21 foundation — TypeScript SDK plugin authors import against.
Scope (foundation)
- Type definitions:
HostApi,PluginContext,HookHandler - Example plugin scaffold under
examples/hello-world/(TypeScript source + manifest)
How plugin authors use this
-
pnpm add -D @toolctrl/plugin-sdk -
Implement a hook handler:
import type { HookHandler } from "@toolctrl/plugin-sdk"; export const handler: HookHandler<{ name: string }, { greeting: string }> = (input, ctx) => { ctx.log.info({ name: input.name }, "hello"); return { greeting: `Hello, ${input.name}!` }; }; -
Build to WASM with
wasm-pack, AssemblyScript, or similar (operator-side CLI tooling is deferred, seedocs/improvement-plan/06-plugin-system/wasm-sandbox.md). -
Sign the resulting
.wasmand ship to operator alongside theplugin.tomlmanifest.
Deferred
- AssemblyScript/Rust toolchain bindings → Phase 06 Task #23 docs follow-up
- Plugin build/sign/publish CLI → backlog