Agent Plugins

简体中文

plugins/agent/ implements Maka's conversation engine, model protocols, collaboration Rooms, tool orchestration, and external agent integrations. Crates follow a strict one-way dependency order so persisted state, deterministic reconciliation, and live OS capabilities cannot tangle:

LayerCratesRole
Pure data & contractsfacts/, api/, ports/Canonical persisted fact types, public RPC/tool schemas (schemars), and abstract execution traits
Storage & foldingstate/SQLite migrations on RootStore, atomic fact commits, history snapshots, FTS/Recall indexes, and deterministic state projections
Execution loopengine/, tools/, tool-catalog/Durable obligation-frontier reconciler, context compaction, and V8/Python Code Mode cells
Model & MCP protocolsprovider-protocol/, model/, providers/, mcp/Pure-Rust OpenAI Responses, Chat Completions, Anthropic Messages, OAuth/API-key providers, and rmcp stdio/Streamable-HTTP clients
Auxiliary featuresassistant/, goal/, scheduler/, session-title/, session-recap/, session-import/, insights/, acp-executor/System prompts & Recall tools, persistent Goals, cron/interval schedules, auto-titling, session recaps/imports, analytics, and ACP subprocess executors
Live Host ownerauthority/, native/Activation custody, workspace permission intersection, RPC handlers, Session* tools, and built-in external CLI drivers

Sessions, Rooms, and collaboration tools

Workbench clients consume granular RPC methods on maka-agent-api (observe, history, watch, create, send, fork, etc.), while agents interact with conversations and Rooms through seven human-symmetric tools plus Read:

  • Read("maka://session/<id>") — Renders a clean Markdown digest of any readable Agent conversation or Room (pinned to a consistent through watermark across pages), linking full tool outputs at maka://session/<id>/tool-results/<event-id>.
  • SessionList / SessionRead — Search conversations or inspect metadata, active/latest RunId status, blockers, pending questions, queued messages, and paged transcripts in one call.
  • SessionCreate — Creates an Agent conversation or shared Room (kind: "room"), optionally branching via forkFrom, allocating a managed Git worktree, or applying a subagent presetId.
  • SessionSend — Posts to a Room (with atomic @mentions and replyTo) or sends/steers a message to an Agent session. Agent-to-worker sends default to onComplete: "notify_caller", waking the caller with an inline <worker_result> summary when the worker finishes.
  • SessionRespond / SessionStop / SessionManage — Answer worker questions/approvals, stop active runs, edit queued messages, continue terminal runs, or update/archive/restore/remove sessions.

Memory records

User-controlled memory endpoints (memories, memory, memoryHistory, changeMemory, memorySource, and memoryEvidence in api/src/contract/memory.rs) manage personal and project-scoped memory records on the State Root. Edits use revision CAS; suppressing a record hides matching content from ordinary reads and history while retaining the underlying audit record. Model reads require live execution authority plus both memory.enabled and memory.agentReadEnabled in settings preferences (disabling model reads leaves user management available). Assertions can bind verified conversation spans via changeMemory.add_evidence, and create.incognito marks an immutable memory-privacy boundary inherited by derived sessions.

Proactive discovery

The Bot can propose a discovery plan when Bot and scheduling are enabled. New plans default to read-only. The user approves the workspace, model and tool selection. The Host derives each tool's category from its bound service or built-in role. A fresh worker receives the approved names within its current tool ceiling. A one-time follow-up inherits that selection. Widening it requires user approval.

One investigation occupies the shared slot through cleanup and report handoff. The worker calls DiscoveryComplete to settle quietly or hand findings to the Bot. The Bot decides whether to notify the user. The scheduler keeps plans, receipts, and shared investigation memory in its existing store. Recovery follows the original Run and receipt. Quoted user feedback can refer directly to the investigation record.

See the product guide, schedule contract, and Host tests.

Subagent presets

Reusable subagent roles (presets, preset, createPreset, updatePreset, deletePreset in api/src/preset.rs, exposed to agents as SubagentPreset* tools) store a name, selection description, system instruction, model target, and thinking level inside the Host's Agent scope. Mutations require expectedRevision and commit through the Host operation journal. Pass a preset ID to SessionCreate.presetId to spawn a worker prebound to that role.

MCP servers

maka-agent-mcp connects to stdio and Streamable HTTP MCP servers via rmcp, surfacing their tools across direct calls, tool_search, and JavaScript/Python Code Mode under the same approval and receipt pipeline. Configure global or per-project servers in Settings → MCP servers (or .maka/mcp.json / .agents/mcp.json in the project or home directory); ACP clients can also attach ephemeral session-scoped MCP servers on session load.

Configured MCP servers are trusted extensions: stdio servers execute as the Host OS user outside workspace file sandboxes, receiving a minimal environment plus explicitly configured secrets.

External CLI executors

Enabling claude, codex, or antigravity under agent.external.runtimes lets sessions run installed native CLIs directly in the project workspace (Claude Code over an interactive PTY, Codex via its managed app-server, and Antigravity over ACP) while keeping Maka's durable session history, Host MCP bridge, editable message queue, and live steering:

  • Native prompts & instruction sync — External CLIs keep their own native system prompts. Maka delivers <maka_system_instructions> once per digest change without overriding native prompts or re-injecting unchanged instructions across background wake-up turns.
  • Honest settlement — Each task runs under TaskOwner custody. Process exit, silence, or EOF alone never marks a turn successful without protocol-level completion evidence, and unconfirmed interruptions never trigger blind prompt replay.