Plugins

简体中文

Each leaf package.ts under plugins/ declares a deployable plugin (application.host, application.ui, or application.composition) along with its configuration schema, service imports, and exports. Cargo crates provide the underlying Rust implementations: one complex plugin may span multiple crates, while related plugin entries can share a single native crate.

DirectoryScope
agent/Conversations, Rooms, model protocols, durable execution engine, Code Mode, MCP client, Goals, and scheduling
workspace/Sandboxed file tools (Read, Write, Edit, ApplyPatch, Glob, List), background shells/PTYs, Web fetch/search, Computer Use bindings, and Decisions API
settings/Model provider connections, credentials, usage accounting, and user preferences
skills/Local, remote, and bundled SKILL.md discovery, paged reads, and installation
interactions/Structured user questions (AskUserQuestion) and permission escalation prompts
application/Runtime plugin installation, deployment inspection, and live composition editing
shared/Shared TypeScript contract helpers

Host and UI plugin model

  • Host entries (usePackage: "host") — Run either a registered native Rust factory or a bundled JavaScript HostService on the background V8 runtime, receiving only the explicit capabilities bound in the deployment.
  • UI entries (usePackage: "ui") — Run inside the shared NSH workbench VM across both terminal and desktop shells. activate(context) returns { exports, prepareReload? } to contribute roots, typed view slots (UiRuntime.renderView), commands, panels, settings pages, or custom tool cards. context.services and context.operations bind directly to the instance's declared Host imports and two-phase operation receipts.
  • Compositions (usePackage: "composition" / base.package) — Bundle reusable instance graphs. Default Maka installations pin a root baseline composition (base.package) and layer user overrides (configurationFields, remove) plus standalone instances without shifting existing state identities; see product bundle.

Building and wiring a plugin

Build an individual plugin package from the repository root:

node scripts/plugins/build.mjs --plugin plugins/workspace/workspace-web --output /tmp/maka-web-bundle
maka application inspect-package --package /tmp/maka-web-bundle/packages/workspace-web

To ship a plugin in the default Maka distribution, add its directory to products/maka/bundle/package-inputs.json, wire its instances and bindings in products/maka/bundle/src/composition.ts, and (for new Rust services) register its factory in products/maka/native/src/lib.rs.

For standalone third-party plugin authoring, see @maka-agent/plugin-sdk and the bundled maka-plugin-authoring skill.