Maka plugin SDK

简体中文

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.

SourcePurpose
index.tsHostService, RequestContext, Component and public exports
ui.tsTerminal and desktop scene constructors
generated/runtime.tsRust wire types and native component props
contracts.tsService and component contracts
configurations.tsNative configuration schemas
native.tsNative 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.