@maka-agent/plugin-sdkTypeScript contracts and authoring helpers for Maka Host services and shared NSH workbench UI plugins. Bundle guest code before shipping it to the runtime.
| Module | Contents |
|---|---|
src/index.ts | HostService, RequestContext, and top-level SDK exports |
src/workbench.ts | NSH UI plugin activate(context), contribution descriptors, UiContext, and UiRuntime |
src/workbench-views.ts | Shared view contracts for navigation, conversations, previews, and settings |
src/composer-view.ts | Replaceable composer view contract and resident session controller interface |
src/workspace-view.ts | Workspace file/diff preview contracts and action handles |
src/generated/runtime.ts | Generated Rust wire types and deployment schemas |
src/generated/methods.ts | Typed Host RPC method inputs and outputs |
src/contracts.ts | JSON Schema catalog exported from tools/schema |
context.services[importName][index] invokes declared Host imports under the UI instance's captured identity, while context.operations tracks and recovers its two-phase mutation receipts. Trusted UI code can also access context.host directly.{ kind: 'view', contract } with defineUiViewContract<Input>(id) and mount providers via runtime.renderView(target, contract, input, options?).run({ sessionId, argument? }) and optional enabled(context), declared with title, shortcut, trigger, and takesArgument metadata.prepareReload() returns serializable JSON before a VM reload; the replacement activation with the same (instance, packageId) receives it in context.restored while keeping its live Host client and pending operation receipts.After changing Rust wire types (schemars), regenerate and verify the SDK from maka-schema without building V8 or maka-cli:
npm --workspace @maka-agent/plugin-sdk run schema:generate npm --workspace @maka-agent/plugin-sdk run schema:check
See plugins and the maka-plugin-authoring skill for runnable examples.