Skip to content

Proposal: Agent Client Protocol (ACP) interface for Maka (maka --acp) #3132

Description

@Astro-Han

Problem

Maka cannot be driven by any ACP-compatible client today. ACP (Agent Client Protocol) is the JSON-RPC 2.0 standard for editor/agent interoperability — Paseo's built-in ACP catalog lists 40+ agents (Cline, Devin, Gemini CLI, Grok, goose, Cursor, Kimi Code, Qwen Code, Hermes, GLM, ...), and Zed, JetBrains, and VS Code ship or support ACP clients. Maka's Runtime Host already owns everything ACP needs (sessions, turns, streaming, interactions, transcripts), but the only non-interactive surface is maka run, a single-turn mode that does not fit ACP's session/streaming/permission model.

Desired outcome

maka --acp — a stdio server exposing the Runtime Host through the Agent Client Protocol. Any ACP-compatible client (Zed, JetBrains, VS Code ACP clients, Paseo, and the broader ACP ecosystem) can create, drive, and resume Maka sessions, while Runtime Host remains the single execution authority. This also unblocks the Paseo integration: Paseo's ACPAgentClient base class already serves five providers, so once maka --acp exists the Paseo-side provider is a thin manifest/registry/icon addition.

Alternatives or workarounds

  • Direct integration with the Runtime Host protocol (Paseo-side): a bespoke client that tracks every Runtime Host protocol change. Rejected as the primary path — ACP is a versioned, backward-compatible standard, so the coupling point stays stable as Maka (v0.1.x, actively changing) evolves.
  • Custom provider via extends: "acp": requires an ACP surface, which is exactly what this proposal adds.

Proposal

AI-assisted: drafted with the assistance of an AI coding agent (pi). Facts verified against the Maka repository, the ACP protocol site, npm, and upstream agent implementations at drafting time; re-verify before relying on them.

Abstract

Maka will expose its agent runtime through the Agent Client Protocol via a new maka --acp stdio server. Any ACP-compatible client can create, drive, and resume Maka sessions, while Runtime Host remains the single execution authority.

Rationale

  1. ACP is the de facto integration standard. 40+ agents in Paseo's catalog, Zed/JetBrains/VS Code support. Implementing the protocol once reaches the entire ACP ecosystem.
  2. Runtime Host already covers every capability ACP needs. Sessions, turns, streaming (assistant deltas, tool events), interactions, and transcript paging all exist. ACP is a translation layer — the marginal cost is the mapping, not the machinery.
  3. A stable coupling point. ACP is versioned and backward-compatible; external clients keep working as the Runtime Host protocol evolves.
  4. Enables the Paseo integration (see Desired outcome).
  5. Openness without publishing packages. @maka/* packages are private; ACP is the standard way for external clients to drive Maka without internal dependencies.

Initial Goals

  1. maka --acp stdio server on the official @agentclientprotocol/sdk (Apache-2.0), following the minimal skeleton used by upstream agents: ndJsonStream + AgentSideConnection + an Agent implementation class.
  2. Session lifecycle: initialize; session/newsession.create (adapter generates sessionId); session/promptturn.start; session/cancelturn.stop; session/listsession.catalog.query; session/closesubscription.close.
  3. Streaming: subscription.session_delta (text/thinking) → agent_message/agent_thought chunks; subscription.session_event (tool_start/tool_result/tool_output_delta) → tool_call/tool_call_update; turn terminal states → end_turn.
  4. Permissions: InteractionRequest kinds → permission_request; interaction.answerpermission_response. Maka's question interactions have no standard ACP equivalent yet (elicitation is still an RFD); initially ride the _maka/ extension namespace.
  5. Session restore: session/load/session/resumesubscription.open + transcript paging; interrupted turns via turn.resume.query/turn.resume.start.
  6. Configuration: mode/permissionMode/thinkingLevel/collaborationMode/orchestrationMode → session config options (ACP v2 direction), with session/set_mode as the v1-compatible path.
  7. _maka/… extension namespace (the ACP-reserved single-underscore prefix, as used by Qwen's _qwen/…) for deeper Maka capabilities ACP cannot express: branch, revision, artifact, memory, goal, plan.
  8. Capability-matrix doc in the style of Kimi's @moonshot-ai/acp-adapter README.

Current Status

Maka is actively developed (Apache-2.0, v0.1.x) with four shipping surfaces — Desktop, TUI, CLI, Eval. The proposal targets ACP v1 (what Paseo and the mainstream ecosystem speaks). ACP v2 is a draft consolidation release (session modes removed in favor of config options, unified capability naming, whole-message upserts, permission title/subject, session/resume replay cursors) and is not yet SDK-ready; v1 remains supported after v2 ships. The mapping is designed with v2's migration direction in mind.

Known Risks

  • Maintenance commitment: the adapter is a translation layer but must track protocol/SDK/client evolution. Keep it thin, mirror event mapping in a dedicated module with tests (as Mistral Vibe does with session_updates.py).
  • Protocol maturity: ACP v2 is a draft; no standard system prompt (RFD refactor(runtime): split context-budget into domain leaves #1237 merged but not in SDK 1.3.0 — workspace instructions need a workaround); no standard elicitation (question interactions); no standard usage/context tracking (usage pricing via _maka/ extension); no steering (v1 and v2 both lack mid-turn input injection — out of scope initially).
  • Implementation: message ordering (session/update vs end_turn — Maka's subscription frames are sequence-numbered, preserve order through the mapping); new ClientSurface value 'acp' needed; SDK trails protocol RFDs.

Reference implementations consulted

  • Amp (amp-acp) — minimal skeleton
  • Cline (apps/cli/src/acp/) — AgentSideConnection + event subscription
  • Gemini CLI (packages/cli/src/acp/) — modular dispatcher/session/auth
  • Kimi (@moonshot-ai/acp-adapter) — harness abstraction + runAcpServer
  • Qwen Code — _qwen/… extension namespace, ACP-over-HTTP transport
  • OpenClaw (acpx) — ACP backend over a platform-owned runtime
  • Mistral Vibe — session_updates.py event-mapping module

External Dependencies

@agentclientprotocol/sdk — Apache-2.0, license-compatible with Maka (Apache-2.0). Current version 1.3.0. Internal deps (@maka/runtime-host, @maka/core) already in-repo.


中文对照 (Chinese Translation)

本提案由 AI 辅助起草(pi),事实性内容已按起草时的 Maka 仓库、ACP 协议官网、npm 与上游 agent 实现核实,使用前请复核。

问题。 目前任何 ACP 兼容客户端都无法驱动 Maka。ACP(Agent Client Protocol)是编辑器与 agent 互操作的 JSON-RPC 2.0 标准——Paseo 内置 ACP catalog 收录 40+ 个 agent(Cline、Devin、Gemini CLI、Grok、goose、Cursor、Kimi Code、Qwen Code、Hermes、GLM 等),Zed、JetBrains、VS Code 均支持 ACP 客户端。Maka 的 Runtime Host 已拥有 ACP 所需的全部能力(会话、turn、流式、交互、transcript),但唯一的非交互入口是 maka run——单轮模式,不符合 ACP 的会话/流式/权限模型。

期望结果。 新增 maka --acp——通过 Agent Client Protocol 暴露 Runtime Host 的 stdio 服务。任何 ACP 兼容客户端(Zed、JetBrains、VS Code ACP 客户端、Paseo 及更广泛 ACP 生态)都能创建、驱动、续接 Maka 会话,Runtime Host 保持唯一执行权威。这也为 Paseo 集成铺路:Paseo 的 ACPAgentClient 基类已服务 5 个 provider,maka --acp 就绪后 Paseo 侧只是薄追加。

备选方案。

  • Paseo 侧直接对接 Runtime Host 协议:定制客户端需跟随每次协议变更。不选为主路径——ACP 是有版本、向后兼容的标准,Maka(v0.1.x 活跃演进)变化时耦合点保持稳定。
  • extends: "acp" 自定义 provider:需要 ACP 接口,正是本提案要加的。

提案摘要。 Maka 通过新增 maka --acp stdio 服务以 ACP 暴露其 agent 运行时,任何 ACP 兼容客户端可创建、驱动、续接 Maka 会话,Runtime Host 保持唯一执行权威。

理由。 ① ACP 是事实标准(Paseo 40+ agent catalog、Zed/JetBrains/VS Code 支持),一次实现触达整个生态;② Runtime Host 已覆盖 ACP 所需全部能力,ACP 只是翻译层,边际成本在映射而非机制;③ 耦合点选在稳定协议上;④ 为 Paseo 集成铺路;⑤ 不发布内部包也能开放。

初始目标。 ① 基于官方 @agentclientprotocol/sdk(Apache-2.0)的 maka --acp stdio 服务(ndJsonStream + AgentSideConnection + Agent 实现类);② 会话生命周期映射(session/newsession.create 等);③ 流式映射(session_deltaagent_message/agent_thoughtsession_eventtool_call/tool_call_update,终止态 → end_turn);④ 权限映射(InteractionRequestpermission_requestquestion 交互初期走 _maka/ 扩展);⑤ 会话恢复(session/load/resumesubscription.open + transcript);⑥ 配置映射(config options 为 v2 方向,v1 用 set_mode);⑦ _maka/… 扩展命名空间承载 branch/revision/artifact/memory/goal/plan;⑧ 能力矩阵文档。

现状。 Maka 活跃开发(Apache-2.0、v0.1.x),有 Desktop/TUI/CLI/Eval 四个界面。提案瞄准 ACP v1(Paseo 与主流生态当前版本);ACP v2 是 draft 整合发布(移除 session modes、统一能力命名、whole-message upsert、权限 title/subject、resume replay 游标),SDK 未就绪,v2 发布后 v1 仍受支持,映射按 v2 迁移方向设计。

已知风险。 维护承诺(适配器轻薄、事件映射独立成模块配测试);协议成熟度(v2 draft、无标准 system prompt——SDK 1.3.0 尚未实现、无标准 elicitation、无标准用量追踪、无 steering);实现(消息排序——Maka 订阅帧带 sequence 需保持顺序、新增 ClientSurface'acp'、SDK 滞后于 RFD)。

参考实现。 Amp(最小骨架)、Cline(AgentSideConnection + 事件订阅)、Gemini CLI(模块化 dispatcher/session/auth)、Kimi(@moonshot-ai/acp-adapter harness 抽象)、Qwen Code(_qwen/… 扩展命名空间、ACP-over-HTTP)、OpenClaw(acpx 平台拥有运行时之上的 ACP 后端)、Mistral Vibe(session_updates.py 事件映射模块)。

外部依赖。 @agentclientprotocol/sdk — Apache-2.0,与 Maka license 兼容。当前版本 1.3.0。内部依赖(@maka/runtime-host@maka/core)已在仓库内。

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions