TypeScript contracts and helpers for Maka Host services and native UI components. Import from @maka-agent/plugin-sdk; bundle guest code before giving it to the runtime.
| Source | Purpose |
|---|---|
| index.ts | HostService, RequestContext, Component and public exports |
| ui.ts | Terminal and desktop scene constructors |
| generated/runtime.ts | Rust wire types and native component props |
| contracts.ts | Service and component contracts |
| configurations.ts | Native configuration schemas |
| native.ts | Native implementation definitions for package declarations |
Rust declarations are the source for generated files. After changing them, run from the repository root:
npm --workspace @maka-agent/plugin-sdk run schema:generate npm --workspace @maka-agent/plugin-sdk run schema:check npm --workspace @maka-agent/plugin-sdk run typecheck
Generation uses maka-schema and does not build the product or V8. The runtime also exports its catalog through maka application schema.
Components have synchronous callbacks that propose a frame and actions. Terminal and desktop use their own scene types. Native controls own editor buffers, selection and IME; capture resources through their declared contracts. Host services receive request-scoped imports and attachments, without ambient Node APIs.
Guest realms provide TextEncoder, TextDecoder, atob, URL and URLSearchParams for pure text and byte conversion. Decode Base64 to bytes with Uint8Array.from(atob(value), c => c.charCodeAt(0)); these APIs grant no filesystem or network access.
TypeScript checks authoring mistakes. The runtime separately validates values, contract compatibility, resource slots and permissions. See the plugin guide and runnable starter.