tree: 5d7df9d72dbfcc84722a332b6df56fe6d3ed9037 [search]
  1. acp-executor/
  2. agent/
  3. api/
  4. assistant/
  5. authority/
  6. composer/
  7. conversations/
  8. engine/
  9. facts/
  10. goal/
  11. insights/
  12. mcp/
  13. model/
  14. native/
  15. ports/
  16. provider-protocol/
  17. providers/
  18. recovery-gateway/
  19. scheduler/
  20. session-import/
  21. session-title/
  22. state/
  23. tool-catalog/
  24. tools/
  25. README.md
  26. README.zh-CN.md
plugins/agent/README.md

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-import/, insights/, acp-executor/System prompts & Recall tools, persistent Goals, cron/interval schedules, auto-titling, session 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 an Agent Role via role.
  • 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.

Retrying a message submission

Use agent.submitMessage to queue a message without steering the active turn. A queued result means the Host accepted the message, not that the agent delivered or answered it. Omitting idempotencyKey or passing null makes each call independent.

To retry after a disconnect, reuse the key in the same session. If the original message is pending or has been delivered, the Host returns duplicate with its message ID and does not enqueue the retry. If the queued message was cancelled before delivery, retrying the key queues a new message with a fresh ID. agent.lookupSubmission requires a key and returns the pending or delivered message ID, or null if there is none.

To withdraw a queued message, call agent.withdrawSubmission with its sessionId and messageId. A cancelled result means the message was cancelled before delivery. A delivered result means it was already delivered and cannot be recalled. An unknown message ID in that session is an error, not a successful cancellation.

These are public Agent service methods, not an ACP-only privilege. The key is shared within the target session; it is not a secret or proof of caller identity. The Host checks method grants and session control and execution authority independently of the key. Custom Host publications with explicit method lists must grant each method they need.

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.

Agent Roles

File-driven, reusable Agent Roles (roles, watchRoles, role, saveRole, deleteRole in api/src/role.rs, exposed via the lean AgentRole tool for Bot and direct Markdown editing in ordinary sessions) live as Markdown files with YAML frontmatter in 4-tier precedence order: <workspace>/.maka/agents/<slug>.md, <workspace>/.agents/agents/<slug>.md, ~/.maka/agents/<slug>.md, and ~/.agents/agents/<slug>.md. A Role optionally declares a native model or external executor backend (omitted inherits the caller/global default), ceiling-clipped permissions (inherit | read_only | workspace_write), workspace mode (same | worktree), associated skills, and a role instruction body. Creating a Direct Chat, Room participant, or delegated subagent freezes an immutable AppliedRole snapshot preserved across fork and checkpoint handoff.

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.