CommandCodeAI / CommandCodeAI/command-code

Feature: publish a versioned ACP/host protocol for IDE and orchestration integrations

未关闭
#669 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
没有语言数据
星标
4k
派生
350
PR 合并指标
30 天内没有已合并 PR

描述

Goal

I am preparing a Command Code integration for T3 Code and would prefer a supported public boundary rather than terminal parsing, project settings, or experimental Mods.

The existing headless NDJSON mode is already a strong one-way event/result stream. The missing piece for first-class IDE/orchestrator integrations is a bidirectional local host protocol: permissions, structured user input, cancellation, durable sessions, model discovery, capability negotiation, and attachment support.

Proposal

Publish a long-lived local stdio mode, for example:

command-code acp

It would implement ACP v1 over JSON-RPC and advertise a capability-gated commandcode.profile/v1 for Command Code-specific behavior.

The public contract should include:

  • protocol-version and capability handshake;
  • create/resume/fork/rollback/cancel session lifecycle with opaque stable IDs;
  • ordered session/turn/tool/subagent events with correlation IDs and sequence numbers;
  • request/response permissions before every gated side effect, including MCP tools;
  • structured ask_user_question responses;
  • JSON model discovery, model selection, modes, typed safe errors, and image attachments;
  • a published schema/types package, plus black-box conformance fixtures.

Permission bridge: reuse the existing engine

The request is not to create a parallel security model.

The public host boundary should abstract the existing “ask” prompt behind a native PermissionDecisionProvider / PermissionPromptBridge, with two implementations:

  • the existing TUI prompt;
  • an ACP/host implementation.

The required decision flow is:

  1. local hard-deny and safety rules remain authoritative;
  2. locally pre-approved actions proceed normally;
  3. only an unresolved ask is emitted to the host as a correlated permission request;
  4. the host returns one of the offered decisions (allow once, scoped session allow when supported, deny, cancel);
  5. timeout, disconnect, malformed response, stale/duplicate request ID, or cancellation denies the pending action.

In other words, host mode should behave like the existing fail-closed dont-ask policy plus an external, structured channel for the unresolved ask outcome. It must not write project settings or let a host override local deny rules.

This ask-routing must be native machinery: the current Mod API can add tools, hooks, and observers, but does not document interception of the underlying permission decision itself.

Security expectations

  • A lost connection, timeout, malformed response, stale request ID, or cancellation must deny the pending action and emit one terminal result.
  • Existing local deny rules remain authoritative.
  • A session-level approval is in-memory and scoped; it must not write project settings.
  • The protocol is local stdio only: no network listener and no credentials from an external orchestrator client.

This would let T3, IDEs, CI systems, and other clients integrate against a versioned contract while preserving the interactive TUI, Hooks, and Mods as separate local extension surfaces.

I can help validate the protocol with an independent T3 adapter and conformance suite when the source is available.

Would the team prefer:

  1. ACP v1 + a Command Code capability profile;
  2. a Command Code-specific stdio protocol with equivalent guarantees; or
  3. both, sharing one public schema layer?

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先检查现有的 headless NDJSON 入口点和当前的 TUI 权限提示,然后将它们与拟议的 command-code acp 入口点以及 PermissionDecisionProvider/PermissionPromptBridge 进行比较。完成意味着团队已选定协议方向,并定义了版本化握手、会话、权限、错误、模式和一致性要求;issue 中不指定任何实现文件或测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
cli
领域
api, cli, security
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。