Repository navigation
Proposal: Agent Client Protocol (ACP) interface for Maka (maka --acp) #3132
Description
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
- 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.
- 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.
- A stable coupling point. ACP is versioned and backward-compatible; external clients keep working as the Runtime Host protocol evolves.
- Enables the Paseo integration (see Desired outcome).
- Openness without publishing packages.
@maka/*packages are private; ACP is the standard way for external clients to drive Maka without internal dependencies.
Initial Goals
maka --acpstdio server on the official@agentclientprotocol/sdk(Apache-2.0), following the minimal skeleton used by upstream agents:ndJsonStream+AgentSideConnection+ anAgentimplementation class.- Session lifecycle:
initialize;session/new→session.create(adapter generatessessionId);session/prompt→turn.start;session/cancel→turn.stop;session/list→session.catalog.query;session/close→subscription.close. - Streaming:
subscription.session_delta(text/thinking) →agent_message/agent_thoughtchunks;subscription.session_event(tool_start/tool_result/tool_output_delta) →tool_call/tool_call_update; turn terminal states →end_turn. - Permissions:
InteractionRequestkinds →permission_request;interaction.answer→permission_response. Maka'squestioninteractions have no standard ACP equivalent yet (elicitation is still an RFD); initially ride the_maka/extension namespace. - Session restore:
session/load/session/resume→subscription.open+transcriptpaging; interrupted turns viaturn.resume.query/turn.resume.start. - Configuration:
mode/permissionMode/thinkingLevel/collaborationMode/orchestrationMode→ session config options (ACP v2 direction), withsession/set_modeas the v1-compatible path. _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.- Capability-matrix doc in the style of Kimi's
@moonshot-ai/acp-adapterREADME.
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 (
questioninteractions); 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/updatevsend_turn— Maka's subscription frames are sequence-numbered, preserve order through the mapping); newClientSurfacevalue'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.pyevent-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/new → session.create 等);③ 流式映射(session_delta → agent_message/agent_thought,session_event → tool_call/tool_call_update,终止态 → end_turn);④ 权限映射(InteractionRequest → permission_request,question 交互初期走 _maka/ 扩展);⑤ 会话恢复(session/load/resume → subscription.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)已在仓库内。
Activity
Sun-GLiang commentedon Aug 20, 2026
hanks for the detailed proposal. I’d like to work on this and own the issue through the initial ACP v1 implementation.
Given the scope, I suggest landing it incrementally:
I’ll keep ACP v2 and steering outside the initial scope, as described in the proposal. Are maintainers comfortable with this breakdown and assigning the issue to me?
shaokeyibb commentedon Aug 22, 2026
By the way, once the ACP integrated is implemented, could you add a new feature to support adding any ACP service in a Workspace as a subagent to facilitate the scheduling of these ACP services?
Sun-GLiang commentedon Aug 23, 2026
Thanks for assigning this to me. I’ll start working on the implementation.
Sun-GLiang commentedon Aug 23, 2026
ACP v1 implementation tracker
English
Progress snapshot (2026-09-27)
Current-code baseline
main@86c61d420on 2026-09-26 after PR 7 and PR 8 merged.maka --acpstdio server, official@agentclientprotocol/sdk@1.4.0dependency, protocol-only stdout, explicit unsupported-method errors, and the reusable official-SDK child-process harness.ClientHellono longer has aClientSurface; the privatesurface: 'desktop'field is only a legacy compatibility shim. ACP must not add a newClientSurfacevalue.RuntimeHostConnection,ClientSessionSubscription,RuntimeHostSessionProjector, transcript paging, and reconnect/recovery behavior instead of creating a second Runtime Host client stack.mainfor any follow-up work.Tracking rules
Dependency graph
flowchart LR PR1["PR 1"] --> PR2["PR 2"] PR2 --> PR3["PR 3"] PR3 --> PR4["PR 4"] PR4 --> PR5["PR 5"] PR5 --> PR6["PR 6"] PR5 --> PR7["PR 7"] PR6 --> PR8["PR 8"]Phase 1 — ACP foundation
PR 1 — Add the
maka --acpstdio server foundation@agentclientprotocol/sdkdependency, lockfile changes, and regenerated CLI third-party notices.acpcommand kind before the current generic TUI--flagparsing path, and update CLI help and parser tests.ndJsonStreamandagent(...).connect(...)with the Maka ACP Agent implementation.initializetransport-only; do not connect to Runtime Host until an ACP method requires Host-backed session or runtime state.initializewithout adding aClientSurfacefield or value.maka --acpstarts an ACP v1 stdio transport, completesinitializewithout requiring Runtime Host, rejects an unsupported method explicitly, and shuts down cleanly without changing existing CLI commands.PR 2 — Map ACP session creation and listing
connectRuntimeHostCliConnectionwhen the first Host-backed ACP method is called; share it across the ACP connection and close it exactly once when the ACP stdio connection terminates or Runtime Host bootstrap is aborted. Do not make ACP Session operations depend on the unrelated model connection catalog.session/newtosession.create, generatingsessionIdin the adapter, mappingcwdto ahost_pathworkspace, and always using the Host defaultmodelTarget.mcpServersandadditionalDirectories, reject non-empty values explicitly, and ignore ACP_metawithout defining a private Project ID contract.session/prompt.session/listthrough a reusable single-page Runtime Host catalog reader and a size-bounded, strict opaque ACP cursor bound to the normalizedcwdfilter; surface revision changes as stale-cursor parameter errors and skip unmappable legacy records. Require canonical base64url and exactly the currentrevision,cursor, andcwdfields. Defer cursor versioning until a concrete compatibility need exists.RuntimeHostSessionCatalogRevisionChangedErroron both the first-page and continuation paths instead of exposing a narrower implementation detail to callers.session/closein PR 2; it continues to return-32601, and PR 4 explicitly owns cancel-active-turn → close-subscription → remove-adapter-state semantics.maka --helpso it no longer describes the ACP surface as initialize-only and states the methods available at this stage.cwdfiltering and stale cursors, first-page revision-change normalization, multiple-session isolation, more than 16 creates on one ACP connection without subscription attachment, shutdown races, unsupported inputs, and stable Runtime Host error translation with the official SDK client and a real Runtime Host process. Assert thatsession/newandsession/listnever callsubscription.open.session/closeremains unadvertised.PR 3 — Expose Maka session configuration through ACP v1
configOptionsfrom the committed Runtime HostSessionCatalogProjectionin every successfulsession/newresponse: permission, collaboration, and orchestration are always present; thinking is present only when the selected model declares supported thinking levels.permission_modetopermissionModewith selectableaskandbypass; a pre-existingexploreSession may report it as the current value but ACP cannot select it. Mapcollaboration_modetocollaborationMode(agent,plan) andorchestration_modetoorchestrationMode(default,swarm,graph).thinking_levelfrom the selected model in the Runtime Host connection catalog. Non-reasoning models omit the option; reasoning models advertisedefault(Hostnull) plus exactly the model's declared thinking levels.session/newresults, and route ACP v1session/set_config_optiononly for session IDs in that set; do not use a live subscription as proof of ownership. Reject unknown option IDs, wrong value types, and unsupported values before Host I/O.session.configuration.updatewithexpectedRevisionand a one-fieldSessionConfigurationPatch. Runtime Host merges the patch into the current configuration and commits the complete result, preservingmodelTargetand all unchanged fields.revision_conflict, re-read the projection and retry the complete update, with a hard maximum of three attempts. Share neutral Session lookup/projection and bounded CAS retry with the CLI/TUI session driver while keeping ACP lifecycle checks and structured error mapping at the ACP boundary.session_busyandoperation_conflictinerror.data.codewithout classifying them as malformed JSON-RPC parameters.session/set_modeunsupported and unadvertised. ACPsession/newhas no configuration/mode input, so PR 3 does not represent create-timeSessionStartModeand does not pretend it is mutable.session/newreturns the model-appropriate Host-backed configuration options without attaching a subscription;exploreis not selectable; andsession/set_config_optionchanges exactly one supported value through Runtime Host CAS without overwriting model selection or unrelated configuration. Three consecutive conflicts terminate deterministically, whilesession/set_moderemains explicitly unsupported.b67778abd; required CI passed.PR 4 — Attach live sessions and map prompts, cancellation, close, and ordered core streaming
session/promptsingle-flight attach one Runtime Host subscription and start consuming it beforeturn.start, so no early frame can be missed; later prompts reuse the live attachment.AcpSessionRegistry.#createlifecycle boundary before attachment: after Runtime Host creation succeeds, prefer returning the createdsessionIdwhile omitting optionalconfigOptionsif option projection fails; do not grant mutation ownership before ACP returns that id. If rollback is chosen instead, define durable-Session deletion and cleanup-failure semantics first.config_option_updatewith the full refreshed option projection, including addition or removal ofthinking_level; define ordering againstsession/set_config_optionresponses and suppress updates after close.session/prompttoturn.startonly after attachment succeeds, generating the requiredturnIdand converting supported ACP prompt content to MakaMessageContent. An attachment failure must not start a turn or modify the durable Session.session/canceltoturn.stopusing the authoritativesessionId,turnId, andrunIdfrom the current subscription snapshot.RuntimeHostSessionProjector/session-channel behavior for sequence validation, delta folding, active-stream recovery, and terminal-turn detection.agent_message/agent_thoughtchunks and terminalcomplete/abort/errorevents toend_turn.startOffset, reset, completion, and reconnect recovery.session/close. If a turn is active, cancel it first; then close the subscription and remove all adapter-owned attachment and ownership state. Closing an unattached Session only removes adapter-owned state. Never delete or archive the durable Runtime Host Session.session/closeor ACP connection shutdown. Rely on the Host's per-connection subscription admission instead of mirroring it with client-side counters; report capacity failure beforeturn.start, and make capacity reusable after close.inspect()API; attachment state must be consumed directly by prompt, cancel, streaming, and close behavior.session/new/prompt smoke test (Zed if available), record the actual requiredmcpServerspayload, and resolve whether non-empty client-provided servers remain explicitly unsupported or need a supported mapping.session/close.sessionIdor completes a defined rollback, so option projection cannot leave an unreachable durable Session; a client can then attach on first prompt, drive and cancel a complete turn, and close adapter-owned Session state without deleting the durable Session; offsets, resets, reconnects, and terminal states produce one ordered ACP stream and exactly oneend_turn; externally observed model changes publish orderedconfig_option_updatenotifications with refreshed choices; more than 16 Sessions may be created without attachment, and subscription capacity is released by close.6ce9c72c3; required CI passed.Phase 2 — ACP v1 runtime capabilities
PR 5 — Complete tool execution, interactions and stdio MCP integration
tool_starttotool_call, and output/progress/preview/result events to explicittool_call_updatebehavior. Preserve tool identity, sequence, stream, redaction, status and duration where representable, with bounded presentation state and explicit truncation.StoredMessagetool records;contentOmittedis not an empty result andargsPreviewis not full input. Handle missing starts, duplicate sequences, late previews/results and slow-consumer recovery without duplicate cards or reopening terminal tools.loadTranscript()is not refresh; do not blindly copy the TUI helper that opens an extra subscription and fails at full capacity.end_turn, explicit cancellation (cancelled) and projection/transport failures. Tool completion alone cannot terminate a turn; cancellation, failure and close must not wait forever for missing tool results.InteractionRequestkinds:permission,question,form,sandbox_boundary,client_capability. Reuse pending/resolved snapshots, channel callbacks, core validation and typedinteraction.answer; handle external answers, replay, late replies and Host closure reasons.session/request_permissionand capability-negotiatedelicitation/createwhere they faithfully represent the request. Preserve grant target/scope, turn-limited permission, typed form values and decline/cancel semantics. Any required private representation must have its concrete route and SDK end-to-end consumer in this PR. Unsupported clients receive a defined failure/closure instead of an indefinitely pending interaction; no broader authorization is invented.mcpServersduringsession/new, replacing PR 2–4's temporary nonempty-list rejection. Validate names/command/args/env, map to existing in-memory MCP config with Session cwd, and reuseMcpClientManager,createMcpCapabilityProviderand Host capability invocation/cancellation. Do not persist request commands/env into user MCP settings or add HTTP/SSE/OAuth management.affinity: sessiondo not target a specific Session. Two Sessions on one ACP connection may supply different same-named servers. Registration/replacement/removal must affect only the target; scoped tools must not enter unrelated provider fallback. Preserve existing Desktop/TUI behavior and required protocol compatibility checks. Do not work around this by adding a Host connection per Session.672d82731), β on 2026-09-19 (852a9748d), and γ on 2026-09-22 (420c22186).PR 6 — Load, reattach, resume execution, branch and revise Sessions
session/load(replay history before responding) andsession/resume(reattach without historical replay). Neither implicitly restarts an interrupted turn. Validate cwd and lifecycle inputs, return current configuration, and integrate successful attachment with the existing connection ownership set.onTurnStartedand interaction callbacks so an already-live turn is observable without a new prompt. Maintain one event consumer per turn; a prompt response waits on that same observation rather than opening a second reader. Introduce non-prompt execution status representation with its actual load/resume consumer here, not prospectively in PR 5._maka/turn/resumeworkflow for interrupted execution. Query Host first, start only from a ready plan with source run/high-water identity, and surface parked reasons. Reuse/extract the neutral part of existing TUI resume logic only when both callers consume it; keep lifecycle control in their respective adapters._maka/routes forsession.branch.create,session.revision.createandsession.revision.abandon. Preserve source/target identity and expected source revision; grant a successfully returned target ownership so it can immediately be configured/prompted or loaded. Preserve reachability after Host commit if later projection fails.abandonedversusretained; normal close is not deletion. Do not import TUI-specific local-storage cleanup authority.87217d370; PR 8 is unblocked.745430a3c, the full CLI suite passed 1256 tests (3 skipped), the full Runtime Host suite passed 2127 tests (12 skipped), and the GitHubtestcheck passed. Windows was not rerun at this head; see the PR verification and validation record for earlier Desktop E2E and Zed evidence limits.Phase 3 — Maka extension namespace
PR 7 — Complete artifact and memory access
_maka/request/response routes forartifact.query,artifact.ingest,artifact.delete,memory.queryandmemory.mutate, with existing ownership/error checks and Host typed validation.835112108; the PR 6 prerequisite was already merged.test:distpassed 1278 tests (3 skipped), and GitHubtestpassed. No third-party private-extension UI smoke.PR 8 — Observable and controllable goal/plan execution
_maka/routes forgoal.query,goal.arm,goal.control,plan.query,plan.controlandplan.turn.start, preserving goal/proposal/execution identity, revisions, store versions, budgets and Host outcomes.86c61d420after integrating PR 7's mainline changes.testpassed after merging PR 7. Full Host, Zed and Desktop E2E were not rerun on that merge head.Phase 4 — Documentation and interoperability
_maka/names, Host mappings, lifecycle/error behavior and its verification evidence. Workspace instructions remain Host-owned; usage/context handling is documented without a new dashboard or protocol. PR 1–8 documentation and validation records are delivered.test; PR 8 also recorded a full Runtime Host suite. Desktop Electron E2E and Windows/Linux platform runs were not repeated on the final PR 8 head.Scope boundaries
packages/cli/src/acp/README.md, alongside workspace instructions and usage/context handling.Issue completion criteria
maka --acpexposes create/configure/list/prompt/cancel/load/resume/close over the existing Host client stack; interrupted execution resumes only through an explicit safe workflow (PR 1–6)._maka/routes while Host remains the single execution/state authority. PR 6 delivered branch/revision, PR 7 Artifact/Memory, and PR 8 Goal/Plan.Progress-update convention
简体中文
进度概览(2026-09-27)
当前代码基线
main@86c61d420核对进度。maka --acpstdio server、官方@agentclientprotocol/sdk@1.4.0依赖、纯协议 stdout、未支持方法的明确错误,以及可复用的官方 SDK 子进程测试工具。ClientHello已不再包含ClientSurface;私有的surface: 'desktop'只用于兼容旧 Host。ACP 不应新增ClientSurface值。RuntimeHostConnection、ClientSessionSubscription、RuntimeHostSessionProjector、transcript 分页及重连/恢复逻辑,不建立第二套 Runtime Host client stack。main复核。跟踪规则
依赖关系
flowchart LR PR1["PR 1"] --> PR2["PR 2"] PR2 --> PR3["PR 3"] PR3 --> PR4["PR 4"] PR4 --> PR5["PR 5"] PR5 --> PR6["PR 6"] PR5 --> PR7["PR 7"] PR6 --> PR8["PR 8"]阶段一 — ACP 基础
PR 1 — 增加
maka --acpstdio 服务基础@agentclientprotocol/sdk,更新 lockfile,并重新生成 CLI 第三方依赖声明。--flag解析前增加acpcommand kind,并更新 CLI help 和解析测试。ndJsonStream和agent(...).connect(...)将 stdio 接入 Maka ACP Agent 实现。initialize阶段只建立 transport;在 ACP 方法实际需要 session 或 runtime 状态前不连接 Runtime Host。initialize,不增加ClientSurface字段或值。maka --acp可启动 ACP v1 stdio transport,在不依赖 Runtime Host 的情况下完成initialize,明确拒绝未支持方法并正常退出,且不改变现有 CLI 命令。PR 2 — 映射 ACP Session 创建与列出
connectRuntimeHostCliConnection惰性创建一个仅含连接的 CLI Runtime Host context;同一 ACP connection 共享该 context,并在 ACP stdio connection 结束或 Runtime Host bootstrap 被中止时确保只关闭一次。ACP Session 操作不得依赖无关的模型连接 catalog。session/new映射到session.create,由 adapter 生成sessionId,把cwd映射为host_pathworkspace,并固定使用 Host 默认modelTarget。mcpServers和additionalDirectories,明确拒绝非空值;忽略 ACP_meta,不定义私有 Project ID 契约。session/prompt。session/list使用可复用的 Runtime Host 单页 catalog reader,以及绑定规范化cwd过滤条件、带大小限制且严格的 opaque ACP cursor;revision 变化映射为 stale-cursor 参数错误,并跳过无法映射的 legacy record。cursor 必须使用 canonical base64url,且只允许当前的revision、cursor、cwd三个字段;在出现明确兼容需求前不提前引入 cursor 版本号。RuntimeHostSessionCatalogRevisionChangedError,避免向调用方泄漏更窄的实现细节。session/close,调用继续返回-32601;PR 4 明确负责“取消 active turn → 关闭 subscription → 移除 adapter state”语义。maka --help,不再把 ACP surface 描述成仅支持 initialize,并写明此阶段已支持的方法。cwd过滤与 stale cursor、首页 revision-change 规范化、多 session 隔离、单个 ACP connection 创建超过 16 个但不 attach subscription、关闭竞态、不支持输入和稳定的 Runtime Host 错误转换。明确断言session/new和session/list不调用subscription.open。session/close不被声明。PR 3 — 通过 ACP v1 暴露 Maka Session 配置
session/new成功后,根据 Runtime Host 已提交的SessionCatalogProjection返回顺序固定的 ACP selectconfigOptions:permission、collaboration 和 orchestration 始终存在;只有当前模型声明了 thinking levels 时才返回 thinking。permission_mode映射到permissionMode,仅可选择ask和bypass;已有 Session 可以把explore报告为当前值,但 ACP 不允许选择它。collaboration_mode映射到collaborationMode(agent、plan),orchestration_mode映射到orchestrationMode(default、swarm、graph)。thinking_level根据 Runtime Host connection catalog 中当前选定模型生成。非推理模型不返回该选项;推理模型返回default(对应 Hostnull)以及该模型准确声明的 thinking levels。session/new结果引入轻量 current-connection ownership set,并仅允许该集合中的 session ID 调用 ACP v1session/set_config_option;不得以 live subscription 作为所有权证明。未知 option ID、错误 value 类型和不支持的值必须在 Host I/O 前拒绝。expectedRevision和单字段SessionConfigurationPatch调用session.configuration.update。Runtime Host 将 patch 合并到当前配置并提交完整结果,保留modelTarget与全部未变字段。revision_conflict时重新读取 projection 并重试完整更新,最多严格执行三次。与 CLI/TUI session driver 共享中立的 Session 读取、projection 和有限 CAS 重试,同时把 ACP 生命周期检查与结构化错误映射保留在 ACP 边界。session_busy、operation_conflict等 Host 状态/冲突码保留在error.data.code,不把它们误分类为 JSON-RPC 参数非法。session/set_mode保持不支持且不声明。ACPsession/new没有配置或 mode 输入,因此 PR 3 不表示创建期SessionStartMode,也不把它伪装成可变配置。session/new在不 attach subscription 的情况下返回适合当前模型的 Host-backed 配置;explore不可选择;session/set_config_option通过 Runtime Host CAS 只修改一个受支持值,不覆盖模型选择或无关配置。连续三次冲突后确定性终止,同时session/set_mode继续明确返回不支持。b67778abd合入;required CI 已通过。PR 4 — Attach live Session,并映射 Prompt、取消、关闭与有序基础流式输出
session/prompt以 single-flight 方式打开一个 Runtime Host subscription,并在turn.start前开始消费,确保不遗漏早期 frame;后续 prompt 复用 live attachment。AcpSessionRegistry.#create生命周期边界:Runtime Host 创建成功后,如果 option projection 失败,优先返回已创建的sessionId并省略可选的configOptions;ACP 返回该 id 前不授予 mutation ownership。如果改选 rollback,必须先定义 durable Session 删除和 cleanup failure 语义。config_option_update,包括增加或移除thinking_level;定义它与session/set_config_optionresponse 的顺序,并禁止 close 后继续发送。session/prompt映射到turn.start,生成必需的turnId,并将支持的 ACP prompt 内容转换成 MakaMessageContent。attach 失败不得启动 turn,也不得修改 durable Session。session/cancel使用当前 subscription snapshot 中权威的sessionId、turnId和runId调用turn.stop。RuntimeHostSessionProjector/session-channel 的 sequence 校验、delta folding、active stream 恢复和 terminal turn 判断。agent_message/agent_thought,将 terminalcomplete/abort/error映射成end_turn。startOffset、reset、complete 和重连恢复。session/close。若存在 active turn,先取消;随后关闭 subscription,并移除全部 adapter-owned attachment 与 ownership state。关闭尚未 attach 的 Session 时只移除 adapter-owned state。绝不删除或归档 Runtime Host durable Session。session/close或 ACP connection shutdown。依赖 Host 的 per-connection subscription admission,不在客户端复制计数器;容量不足必须在turn.start前返回,并在 close 后可复用容量。inspect()API;attachment state 必须由 prompt、cancel、streaming 和 close 行为直接消费。session/new/prompt smoke test(可用时优先 Zed),记录实际必填的mcpServerspayload,并决定非空 client-provided server 是继续明确不支持,还是提供受支持映射。session/close后槽位复用。sessionId或完成定义明确的 rollback,option projection 不得遗留不可达 durable Session;随后客户端可在首次 prompt 时 attach,运行并取消完整 turn,并在不删除 durable Session 的情况下关闭 adapter-owned Session state;offset、reset、重连和终止状态形成单一有序 ACP 流且只产生一次end_turn;外部模型变化会按序发送包含最新选项的config_option_update;可创建超过 16 个未 attach 的 Session,且 close 会释放 subscription capacity。6ce9c72c3);required CI 已通过。阶段二 — ACP v1 Runtime 能力
PR 5 — 完整工具执行、交互与 stdio MCP 接入
tool_start→tool_call;output/progress/preview/result 均有明确的tool_call_update行为。在可表达范围内保留工具 identity、sequence、stream、redaction、status 和 duration,展示状态有界且截断可见。StoredMessage工具记录校准累计输出。contentOmitted不代表空结果,argsPreview不代表完整参数。处理缺失 start、重复 seq、迟到 preview/result、慢消费者恢复,不重复建卡或把终态恢复成运行态。loadTranscript()不是刷新;不得直接复制会额外打开 subscription、可能在满容量时失败的 TUI helper。end_turn、显式取消cancelled、投影/传输失败的区别。工具终态不能代替 turn 终态,取消、失败和 close 不得无限等待缺失结果。InteractionRequest:permission、question、form、sandbox_boundary、client_capability。复用 pending/resolved snapshot、channel callback、core 校验和 typedinteraction.answer,处理外部已回答、重放、迟到回答和 Host closure reason。session/request_permission和能力协商后的elicitation/create。保留 grant target/scope、turn 内授权有效期、表单类型及 decline/cancel 语义。确有必要的私有表达必须在本 PR 同时落地具体路由与 SDK 端到端消费。不支持的客户端得到明确失败/关闭路径,不永久 pending,也不扩大授权。session/new支持客户端提供的 stdiomcpServers,替换 PR 2–4 对非空列表的临时拒绝。校验名称、command/args/env,使用 Session cwd 转换为已有内存 MCP config;复用McpClientManager、createMcpCapabilityProvider和 Host capability 调用/取消链。不把请求中的 command/env 写入用户 MCP 设置,不增加 HTTP/SSE/OAuth 管理。affinity: session不能指定目标 Session。同一 ACP connection 的两个 Session 可以提供同名不同实现的服务器;注册、替换、撤销只能影响目标,scoped 工具不能进入无关 provider fallback。保留 Desktop/TUI 行为及必要协议兼容检查,不用每 Session 新增 Host connection 绕过问题。672d82731),β 于 2026-09-19 合并(852a9748d),γ 于 2026-09-22 合并(420c22186)。PR 6 — 加载、重新附着、恢复执行、分支与修订
session/load(历史回放后响应)与session/resume(不回放历史的接管),二者均不隐式重启中断 turn。校验 cwd 和生命周期输入、返回当前配置,并将成功接管接入已有 connection ownership。onTurnStarted和交互 callback,使已存在 live turn 在没有新 prompt 时仍可观察。同一 turn 只设一个事件消费者,prompt response 等待同一观察结果,不另开第二个 reader。非 prompt 执行的状态表达由本 PR 实际 load/resume 流程消费,不在 PR 5 预建。_maka/turn/resume中断执行流程:先 query,仅 ready 时携带 source run/high-water identity start;直接反馈 parked 原因。只有 TUI 与 ACP 都实际使用时才提取现有 TUI resume 的中立逻辑,各自保留生命周期控制。session.branch.create、session.revision.create、session.revision.abandon增加具体_maka/路由。保留 source/target identity 和 expected source revision;成功返回的目标获得 ownership,可立即 configure/prompt 或 load。Host 已提交后发生投影失败仍保留目标可达性。abandoned/retained区别,普通 close 不删除 Session,不引入 TUI 特有的本地 storage cleanup authority。87217d370);PR 8 的前置依赖已解锁。745430a3c的完整 CLI 测试通过 1256 个(跳过 3 个)、完整 Runtime Host 测试通过 2127 个(跳过 12 个),GitHubtest检查通过。该提交未在 Windows 重跑;此前 Desktop E2E 与 Zed 的证据边界见 PR 验证摘要和验证记录。阶段三 — Maka 扩展命名空间
PR 7 — 完整 Artifact 与 Memory 访问
artifact.query、artifact.ingest、artifact.delete、memory.query、memory.mutate增加具体_maka/request/response 路由,沿用 ownership/error 检查和 Host typed 校验。835112108);前置 PR 6 已先行合入。test:dist通过 1278 个(跳过 3 个),GitHubtest通过。未验证第三方私有扩展 UI。PR 8 — 可观察、可控制的 Goal/Plan 执行
goal.query、goal.arm、goal.control、plan.query、plan.control、plan.turn.start增加具体_maka/路由,保留 goal/proposal/execution identity、revision、store version、预算及 Host outcome。86c61d420),并已整合 PR 7 的 mainline 改动。test。合并提交未重跑完整 Host、Zed 和 Desktop E2E。阶段四 — 文档与兼容性
_maka/名称、Host 映射、生命周期/错误语义与验证证据。workspace instructions 仍由 Host 组合;usage/context 处理方式已记录,未新增仪表盘或协议。PR 1–8 的文档与验证记录均已交付。test;PR 8 还记录了完整 Runtime Host 测试。PR 8 最终提交未重跑 Desktop Electron E2E 或 Windows/Linux 平台检查。范围边界
packages/cli/src/acp/README.md记录其契约,以及 workspace instructions 和 usage/context 的处理方式。Issue 完成条件
maka --acp基于已有 Host client stack 提供 create/configure/list/prompt/cancel/load/resume/close;中断执行仅通过显式安全流程恢复(PR 1–6)。_maka/路由可用,Host 保持唯一执行/状态权威。PR 6 交付 branch/revision,PR 7 交付 Artifact/Memory,PR 8 交付 Goal/Plan。进度更新约定
Sun-GLiang commentedon Aug 24, 2026
Thanks for the suggestion! I’ll work on this as a follow-up after completing the current ACP server integration.
feat(cli): add ACP session creation and listing (#3744)
feat(cli): expose ACP session configuration
Astro-Han commentedon Sep 9, 2026
I’d like to track a concrete use case for the follow-up ACP client support here: running Google’s Antigravity agent inside Maka.
A user requested this on X: https://x.com/FuurinFuu/status/2097500015812104528. T3 Code implements it by launching Google’s official Antigravity ACP agent, with Google sign-in and session/event adaptation.
This fits the follow-up discussed above for driving external ACP agents. I suggest using Antigravity as a concrete integration and acceptance case for that work, keeping the current ACP server scope unchanged.
Sun-GLiang commentedon Sep 9, 2026
Thanks! I’ll open a separate tracking issue with a design proposal for ACP client support, using Antigravity as the first integration and acceptance case. The interfaces will target ACP-compatible agents generally, with agent-specific launch and authentication handled by adapters. I’ll link it here so we can discuss the design in parallel while keeping the current ACP server scope and implementation plan unchanged.
feat(cli): add ACP tools, interactions and session-scoped MCP
feat(cli): add ACP tools, interactions and session-scoped MCP
feat(cli): add ACP tools, interactions and session-scoped MCP
feat(cli): add ACP tools, interactions and session-scoped MCP
feat(cli): add ACP tools, interactions and session-scoped MCP
feat(cli): add ACP tools, interactions and session-scoped MCP
feat(acp): expose Artifact and Memory Host operations (#5685)
test(acp): cover copied-session Artifact and Memory flow (#5756)