@harness-mix/cli 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/NOTICE +12 -0
  2. package/README.md +51 -43
  3. package/docs/harness-management.md +1 -1
  4. package/docs/native-acp.md +7 -2
  5. package/docs/task-handoff-design.md +65 -0
  6. package/licenses/codex-styler-Apache-2.0.txt +193 -0
  7. package/licenses/heige-codex-skin-studio-MIT.txt +22 -0
  8. package/output/native-build/desktop-controller.mjs +2 -1
  9. package/output/native-build/renderer-extension.js +651 -9
  10. package/package.json +188 -188
  11. package/scripts/acp-capabilities-probe.cjs +1 -0
  12. package/scripts/build-native.cjs +1 -1
  13. package/scripts/codex-adapter-test.cjs +44 -0
  14. package/scripts/collaboration-recovery-test.cjs +3 -0
  15. package/scripts/e2e-codex.cjs +3 -1
  16. package/scripts/e2e-native-acp.cjs +1 -1
  17. package/scripts/error-kind-test.cjs +107 -0
  18. package/scripts/handoff-checkpoint-test.cjs +38 -0
  19. package/scripts/integrations-test.cjs +5 -2
  20. package/scripts/kiro-cursor-adapters-test.cjs +18 -0
  21. package/scripts/native-acp-depth-test.cjs +1 -1
  22. package/scripts/native-protocol-test.cjs +60 -4
  23. package/scripts/native-ui-smoke.cjs +92 -2
  24. package/scripts/switch-harness-test.cjs +79 -12
  25. package/scripts/tool-concurrency-regression-test.cjs +8 -6
  26. package/src/assets/icons/cline-color.svg +1 -0
  27. package/src/assets/skins/codex-styler/ASSET_LICENSES.md +36 -0
  28. package/src/assets/skins/codex-styler/NOTICE +11 -0
  29. package/src/assets/skins/codex-styler/themes/gilded-grandeur/hero.webp +0 -0
  30. package/src/assets/skins/codex-styler/themes/merry-big-top/hero.webp +0 -0
  31. package/src/assets/skins/codex-styler/themes/nocturne-studio/hero.webp +0 -0
  32. package/src/assets/skins/codex-styler/themes/quiet-garden/hero.webp +0 -0
  33. package/src/assets/skins/heige/ASSET_PROVENANCE.md +56 -0
  34. package/src/assets/skins/heige/NOTICE.md +13 -0
  35. package/src/assets/skins/heige/themes/dalao-dianyan/hero.webp +0 -0
  36. package/src/assets/skins/heige/themes/dalao-dianyan/theme.json +14 -0
  37. package/src/assets/skins/heige/themes/deepspace-dawn/hero.webp +0 -0
  38. package/src/assets/skins/heige/themes/deepspace-dawn/theme.json +14 -0
  39. package/src/assets/skins/heige/themes/deepspace-star/hero.webp +0 -0
  40. package/src/assets/skins/heige/themes/deepspace-star/theme.json +14 -0
  41. package/src/assets/skins/heige/themes/dragonball-nimbus/hero.webp +0 -0
  42. package/src/assets/skins/heige/themes/dragonball-nimbus/theme.json +16 -0
  43. package/src/assets/skins/heige/themes/dragonball-super-saiyan/hero.webp +0 -0
  44. package/src/assets/skins/heige/themes/dragonball-super-saiyan/theme.json +16 -0
  45. package/src/assets/skins/heige/themes/genshin-dawn/hero.webp +0 -0
  46. package/src/assets/skins/heige/themes/genshin-dawn/theme.json +14 -0
  47. package/src/assets/skins/heige/themes/genshin-night/hero.webp +0 -0
  48. package/src/assets/skins/heige/themes/genshin-night/theme.json +14 -0
  49. package/src/assets/skins/heige/themes/miku-488137/hero.webp +0 -0
  50. package/src/assets/skins/heige/themes/miku-488137/logo.webp +0 -0
  51. package/src/assets/skins/heige/themes/miku-488137/polaroid.webp +0 -0
  52. package/src/assets/skins/heige/themes/miku-488137/theme.json +16 -0
  53. package/src/assets/skins/heige/themes/naruto-hokage/hero.webp +0 -0
  54. package/src/assets/skins/heige/themes/naruto-hokage/theme.json +14 -0
  55. package/src/assets/skins/heige/themes/naruto-sasuke/hero.webp +0 -0
  56. package/src/assets/skins/heige/themes/naruto-sasuke/theme.json +14 -0
  57. package/src/assets/skins/heige/themes/wuthering-echo/hero.webp +0 -0
  58. package/src/assets/skins/heige/themes/wuthering-echo/theme.json +14 -0
  59. package/src/assets/skins/heige/themes/wuthering-tide/hero.webp +0 -0
  60. package/src/assets/skins/heige/themes/wuthering-tide/theme.json +14 -0
  61. package/src/main/adapters/cline.js +22 -0
  62. package/src/main/adapters/codex.js +78 -8
  63. package/src/main/adapters/index.js +2 -1
  64. package/src/main/adapters/native-acp-command.js +1 -0
  65. package/src/main/harness-adapter/error-kind.js +82 -0
  66. package/src/main/harness-adapter/event-normalizer.js +7 -1
  67. package/src/main/host/core-session.js +1 -1
  68. package/src/main/host/handoff-access.js +23 -4
  69. package/src/main/host/handoff-checkpoints.js +9 -2
  70. package/src/main/host/handoff-tools.js +3 -0
  71. package/src/main/host/handoff.js +11 -2
  72. package/src/main/host/runtime.js +272 -163
  73. package/src/main/host/session-history.js +54 -15
  74. package/src/main/native/icons.js +3 -2
  75. package/src/main/native/pets.js +234 -0
  76. package/src/main/native/protocol.js +197 -56
  77. package/src/main/protocol-core/projector.js +44 -41
  78. package/src/native-ui/desktop-control/dist/production-controller.d.ts.map +1 -1
  79. package/src/native-ui/desktop-control/dist/production-controller.js +1 -0
  80. package/src/native-ui/desktop-control/dist/production-controller.js.map +1 -1
  81. package/src/native-ui/desktop-control/dist/tsconfig.tsbuildinfo +1 -1
  82. package/src/native-ui/desktop-control/src/production-controller.ts +1 -0
  83. package/src/native-ui/desktop-control/test/production-controller.test.ts +1 -0
  84. package/src/native-ui/renderer-extension/dist/types/agent-selection-state.d.ts +4 -2
  85. package/src/native-ui/renderer-extension/dist/types/agent-selection-state.d.ts.map +1 -1
  86. package/src/native-ui/renderer-extension/dist/types/renderer-agent-icon.d.ts.map +1 -1
  87. package/src/native-ui/renderer-extension/dist/types/renderer-agent-picker.d.ts.map +1 -1
  88. package/src/native-ui/renderer-extension/dist/types/renderer-binding-probe.d.ts.map +1 -1
  89. package/src/native-ui/renderer-extension/dist/types/renderer-harness-mentions.d.ts.map +1 -1
  90. package/src/native-ui/renderer-extension/dist/types/renderer-settings-lifecycle.d.ts.map +1 -1
  91. package/src/native-ui/renderer-extension/dist/types/renderer-sidebar-agent-icons.d.ts.map +1 -1
  92. package/src/native-ui/renderer-extension/dist/types/settings/connections-page.d.ts.map +1 -1
  93. package/src/native-ui/renderer-extension/dist/types/settings/icons.d.ts +1 -1
  94. package/src/native-ui/renderer-extension/dist/types/settings/icons.d.ts.map +1 -1
  95. package/src/native-ui/renderer-extension/dist/types/settings/localization.d.ts.map +1 -1
  96. package/src/native-ui/renderer-extension/dist/types/settings/pages.d.ts +1 -1
  97. package/src/native-ui/renderer-extension/dist/types/settings/pages.d.ts.map +1 -1
  98. package/src/native-ui/renderer-extension/dist/types/settings/shell.d.ts.map +1 -1
  99. package/src/native-ui/renderer-extension/dist/types/settings/skin-market.d.ts +4 -0
  100. package/src/native-ui/renderer-extension/dist/types/settings/skin-market.d.ts.map +1 -0
  101. package/src/native-ui/renderer-extension/dist/types/settings/skin-runtime.d.ts +31 -0
  102. package/src/native-ui/renderer-extension/dist/types/settings/skin-runtime.d.ts.map +1 -0
  103. package/src/native-ui/renderer-extension/dist/types/tsconfig.tsbuildinfo +1 -1
  104. package/src/native-ui/renderer-extension/dist/types/versioned-renderer-adapter.d.ts.map +1 -1
  105. package/src/native-ui/renderer-extension/package.json +1 -1
  106. package/src/native-ui/renderer-extension/src/agent-selection-state.ts +16 -0
  107. package/src/native-ui/renderer-extension/src/assets.d.ts +5 -0
  108. package/src/native-ui/renderer-extension/src/renderer-agent-icon.ts +5 -4
  109. package/src/native-ui/renderer-extension/src/renderer-agent-picker.ts +1 -0
  110. package/src/native-ui/renderer-extension/src/renderer-binding-probe.ts +9 -6
  111. package/src/native-ui/renderer-extension/src/renderer-harness-handoff.ts +2 -2
  112. package/src/native-ui/renderer-extension/src/renderer-harness-mentions.ts +2 -0
  113. package/src/native-ui/renderer-extension/src/renderer-settings-lifecycle.ts +2 -0
  114. package/src/native-ui/renderer-extension/src/renderer-sidebar-agent-icons.ts +1 -0
  115. package/src/native-ui/renderer-extension/src/settings/connections-page.ts +2 -0
  116. package/src/native-ui/renderer-extension/src/settings/icons.ts +6 -0
  117. package/src/native-ui/renderer-extension/src/settings/localization.ts +4 -2
  118. package/src/native-ui/renderer-extension/src/settings/pages.ts +5 -2
  119. package/src/native-ui/renderer-extension/src/settings/shell.ts +3 -2
  120. package/src/native-ui/renderer-extension/src/settings/skin-market.css +213 -0
  121. package/src/native-ui/renderer-extension/src/settings/skin-market.ts +174 -0
  122. package/src/native-ui/renderer-extension/src/settings/skin-runtime.ts +399 -0
  123. package/src/native-ui/renderer-extension/src/versioned-renderer-adapter.ts +2 -1
  124. package/src/native-ui/renderer-extension/test/settings/localization.test.ts +11 -1
  125. package/src/native-ui/renderer-extension/test/settings/shell.test.ts +3 -0
  126. package/src/native-ui/renderer-extension/test/settings/skin-runtime.test.ts +136 -0
  127. package/src/native-ui/shared-contracts/dist/thread-harness-switch.d.ts +7 -0
  128. package/src/native-ui/shared-contracts/dist/thread-harness-switch.d.ts.map +1 -1
  129. package/src/native-ui/shared-contracts/dist/thread-harness-switch.js +3 -0
  130. package/src/native-ui/shared-contracts/dist/thread-harness-switch.js.map +1 -1
  131. package/src/native-ui/shared-contracts/dist/tsconfig.tsbuildinfo +1 -1
  132. package/src/native-ui/shared-contracts/src/thread-harness-switch.ts +3 -0
package/NOTICE CHANGED
@@ -12,3 +12,15 @@ Source: https://github.com/BytePioneer-AI/codex-host
12
12
  All execution runtimes, protocols, adapters and local launchers are developed and maintained in this repository.
13
13
 
14
14
  Native DeepSeek integration uses @deepseek-ai/dsh 0.1.2-rc.1 (MIT).
15
+
16
+ Bundled optional skin artwork is redistributed from HeiGeAi/heige-codex-skin-studio.
17
+ Source: https://github.com/HeiGeAi/heige-codex-skin-studio
18
+ The upstream MIT license covers software code only. Character artwork, names and
19
+ trademarks remain subject to their respective rights. Upstream provenance and
20
+ redistribution notices are preserved under src/assets/skins/heige/.
21
+
22
+ Four bundled skin backgrounds are redistributed from xuhuanstudio/codex-styler.
23
+ Source: https://github.com/xuhuanstudio/codex-styler
24
+ The original artwork is licensed under Creative Commons Attribution 4.0.
25
+ Upstream attribution and asset license records are preserved under
26
+ src/assets/skins/codex-styler/. The upstream software is Apache-2.0 licensed.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Harness Mix
2
2
 
3
3
  macOS/Linux 已加入源码构建与启动适配;目标系统的完整桌面验收仍需在对应机器执行。安装方式、Linux 桌面前提和支持边界见 [跨平台指南](docs/cross-platform.md)。
4
-
4
+
5
5
  <p align="center">
6
6
  <img src="src/assets/brand-harness-mix.png" width="92" alt="Harness Mix logo">
7
7
  </p>
@@ -11,8 +11,8 @@ macOS/Linux 已加入源码构建与启动适配;目标系统的完整桌面
11
11
  </p>
12
12
 
13
13
  <p align="center"><strong>Codex 原生 UI,连接多个原生 Coding Harness,并让任务在它们之间无缝接力。</strong></p>
14
-
15
- <p align="center">
14
+
15
+ <p align="center">
16
16
  <a href="LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/badge/license-Apache--2.0-blue.svg"></a>
17
17
  <img alt="UI" src="https://img.shields.io/badge/UI-Codex%20Desktop-412991.svg">
18
18
  <img alt="Windows" src="https://img.shields.io/badge/platform-Windows-0078D4.svg">
@@ -20,7 +20,7 @@ macOS/Linux 已加入源码构建与启动适配;目标系统的完整桌面
20
20
  <img alt="Linux" src="https://img.shields.io/badge/platform-Linux-FCC624.svg">
21
21
  </p>
22
22
 
23
- <p align="center"><strong>当前注册的 Harness(16 个)</strong></p>
23
+ <p align="center"><strong>当前注册的 Harness(17 个)</strong></p>
24
24
 
25
25
  <table align="center">
26
26
  <tbody>
@@ -48,12 +48,15 @@ macOS/Linux 已加入源码构建与启动适配;目标系统的完整桌面
48
48
  <td align="center"><img src="src/assets/icons/zcode-color.svg" width="28" height="28" alt="ZCode"><br><sub>ZCode</sub></td>
49
49
  <td align="center"><img src="src/assets/icons/trae-color.svg" width="28" height="28" alt="Trae"><br><sub>Trae</sub></td>
50
50
  </tr>
51
+ <tr>
52
+ <td align="center"><img src="src/assets/icons/cline-color.svg" width="28" height="28" alt="Cline"><br><sub>Cline</sub></td>
53
+ </tr>
51
54
  </tbody>
52
55
  </table>
53
56
 
54
57
  <p align="center"><sub>图标与 Harness 能力均来自项目自身的注册表;只有本机已安装且握手成功的 Harness 才会进入真实运行。</sub></p>
55
58
 
56
- Harness Mix 是接入官方 Codex Desktop 原生界面的本地内核。它通过本地编译的 CLI Shim 对接桌面的 app-server 协议,把包括 Antigravity、Codex、Pi、Oh My Pi、Claude Code、DeepSeek Harness、OpenCode、Grok、OpenClaw、Hermes、Qoder、CodeBuddy、Kiro CLI、Cursor CLI、ZCode 和 Trae 在内的原生 Coding Harness 接入同一套 UI。Host Runtime 与 Protocol Core 管理任务映射、协作和事件投影;模型调用、工具执行、原生会话与凭据仍由各 Harness 自己管理。
59
+ Harness Mix 是接入官方 Codex Desktop 原生界面的本地内核。它通过本地编译的 CLI Shim 对接桌面的 app-server 协议,把包括 Antigravity、Codex、Pi、Oh My Pi、Claude Code、DeepSeek Harness、OpenCode、Grok、OpenClaw、Hermes、Qoder、CodeBuddy、Kiro CLI、Cursor CLI、ZCode、TraeCline 在内的原生 Coding Harness 接入同一套 UI。Host Runtime 与 Protocol Core 管理任务映射、协作和事件投影;模型调用、工具执行、原生会话与凭据仍由各 Harness 自己管理。
57
60
 
58
61
  ## 界面预览
59
62
 
@@ -78,12 +81,13 @@ flowchart TD
78
81
  Host["Host Runtime<br/>(会话映射 · 检查点 · 协作编排 · 消息排队)"]
79
82
  end
80
83
 
81
- subgraph Engines["🤖 原生 Coding Harnesses(16 个已接入)"]
84
+ subgraph Engines["🤖 原生 Coding Harnesses(17 个已接入)"]
82
85
  H1["Antigravity / Codex"]
83
86
  H2["Claude Code / Pi / OMP"]
84
87
  H3["DeepSeek / Grok / OpenCode"]
85
88
  H4["CodeBuddy / Kiro / Cursor"]
86
89
  H5["Hermes / Qoder / ZCode / Trae / OpenClaw"]
90
+ H6["Cline"]
87
91
  end
88
92
 
89
93
  UI --> Shim --> Host --> Engines
@@ -92,12 +96,14 @@ flowchart TD
92
96
  | 功能模块 | 核心能力 | 交互入口与特点 |
93
97
  | :--- | :--- | :--- |
94
98
  | **🔄 跨 Harness 任务接力** | 4 种接力模式(继续执行 / 执行计划 / 独立审查 / 重新分析)平滑交接 | 输入框接力角标 / `/switch`;持久化脱敏检查点与证据追溯 |
99
+ | **📚 历史会话导入与引用** | 一键导入 Pi / Claude / Codex / CodeBuddy 原生历史并可中断续跑;`#` 引用任意旧会话注入脱敏上下文 | 引用仅预取最近一页;MCP 只读工具 `get_session_info` / `list_session_messages` 供 Harness 按需翻页与读取分支 / 模型 / 用量元数据 |
95
100
  | **🤝 多 Agent 协同编排** | 输入 `#` 唤起目标 Harness,胶囊标签直观管理,主控强约束派发 | 输入框 `#` 菜单;支持循环审查验证、子任务级联取消与超时熔断 |
96
- | **🧩 原生 Skills 管理** | 全量覆盖 16 个 Harness 原生技能目录,会话启动自动预建根目录 | 设置 → Skills;支持单个 `SKILL.md` 或完整文件夹直接拖拽安装 |
101
+ | **🧩 原生 Skills 管理** | 全量覆盖 17 个 Harness 原生技能目录,会话启动自动预建根目录 | 设置 → Skills;支持单个 `SKILL.md` 或完整文件夹直接拖拽安装 |
97
102
  | **🛠️ 原生 MCP 扩展** | 支持本地 stdio 与远程 Streamable HTTP / SSE 协议 | 设置 → MCP;支持自定义 Header 传递,按 Harness 独立生效 |
98
103
  | **📋 原生消息队列** | 完整接入 Codex 会话排队机制(增删改查、排序、插队抢占与自动排空) | 原生 Composer 队列;当前回合完成后自动顺序调度执行排队消息 |
99
104
  | **✅ 可配置验证门禁** | 任务级 off / advisory / required 策略,内置一致性检查与自定义验证命令 | 命令面板 `/gate`、`/verify`;强制模式保护隔离分支合并与推送 |
100
105
  | **💾 会话存储治理** | schema v3 分片惰性加载、无损紧凑存储、迁移备份与体积诊断 | 冷启动只读任务索引;打开任务时才恢复对应 Core checkpoint |
106
+ | **🩹 失败分类与恢复** | 失败回合归类为连接 / 登录 / 额度 / 被拒 / 服务异常五类,分类来自原生结构化错误(Codex `codexErrorInfo` 透传)、状态码或消息特征,无法归类时诚实标注 unknown | 错误状态随任务投影;Renderer 可查 `codexhost/harness/turn-error` 获取分类与动作(重试 / 去登录 / 新建会话),login 按钮按 Harness 真实登录能力出现 |
101
107
  | **🌐 ChatGPT 侧边栏桥接** | 安全脱敏提取当前会话上下文并一键生成结构化草稿 | Web 快捷聊天面板;直通注入 ChatGPT,实现跨工具无缝协作 |
102
108
  | **👤 账户与用量隔离** | Codex 多账户隔离与即时切换;实时追踪 Token / Credits 用量 | 原生侧边栏与设置面板;各 Harness 凭据、模型与审批原生自理 |
103
109
 
@@ -127,6 +133,7 @@ flowchart TD
127
133
  | **Qoder** | `qoder --acp` | ✅ | ➖ | ✅ | ➖ | ✅ / ➖ | ✅ | ✅ | ✅ |
128
134
  | **ZCode** | 兼容 ACP 桥接程序 | ✅ | ➖ | ✅ | ➖ | ✅ / ➖ | ➖ | ✅ | ✅ |
129
135
  | **Trae** | 兼容 ACP 桥接程序 | ✅ | ➖ | ✅ | ➖ | ✅ / ➖ | ➖ | ✅ | ✅ |
136
+ | **Cline** | `cline --acp` | ✅ | ✅ | ✅ | ➖ | ✅ / ➖ | ✅ | ✅ | ✅ |
130
137
 
131
138
  <sub>注:✅ 为原生支持并已打通;➖ 为上游协议当前未开放或未声明;只有本机已安装且握手成功的 Harness 才会进入真实运行。详见 [原生 ACP 深度适配](docs/native-acp.md) 与 [Harness 管理说明](docs/harness-management.md)。</sub>
132
139
 
@@ -145,7 +152,7 @@ flowchart TD
145
152
  - **严谨编排约束**:自动为主控 Coordinator 注入硬约束,严禁越界派发给未指定的 Harness;完善级联取消与子任务超时熔断机制。
146
153
 
147
154
  ### 🧩 原生 Skills 与 MCP 管理
148
- - **16 平台免配置预建**:打开会话时自动预建全部 16 个 Harness 声明的原生 Skills 根目录,新安装 Harness 也能即开即用。
155
+ - **17 平台免配置预建**:打开会话时自动预建全部 17 个 Harness 声明的原生 Skills 根目录,新安装 Harness 也能即开即用。
149
156
  - **拖拽安装**:在「设置 → Skills」中可将单个 `SKILL.md` 或完整技能文件夹直接拖拽安装,自带安全路径校验。
150
157
  - **作用域与安全停用**:支持 Global(全局)与 Project(项目级)无缝切换;停用时安全移入保留目录,绝不损坏用户源文件。
151
158
  - **远程 MCP 支持**:支持配置带自定义 Headers 的 Streamable HTTP / SSE 远程服务。
@@ -175,16 +182,16 @@ npm update --global @harness-mix/cli
175
182
  ```
176
183
 
177
184
  首次运行会重启已打开的 Codex Desktop。npm 包只分发 Harness Mix 本身;各 Harness 的 CLI、登录状态、模型额度和权限仍需按下表在本机单独安装和配置。
178
-
179
- ### 运行方式
180
-
181
- 原生模式(默认):本地编译的 Shim 与 Renderer 扩展接入官方 Codex Desktop,模型选择会路由到对应 Harness。首次启动会重启已打开的 Codex Desktop:
182
- ```powershell
183
- npm start
184
- ```
185
-
186
- 常用原生依赖:
187
-
185
+
186
+ ### 运行方式
187
+
188
+ 原生模式(默认):本地编译的 Shim 与 Renderer 扩展接入官方 Codex Desktop,模型选择会路由到对应 Harness。首次启动会重启已打开的 Codex Desktop:
189
+ ```powershell
190
+ npm start
191
+ ```
192
+
193
+ 常用原生依赖:
194
+
188
195
  - Codex:安装 `@openai/codex`,确保 `codex` 命令可用。
189
196
  - Pi:确保 `pi.cmd` 可用。
190
197
  - Claude Code:SDK 已由 npm 依赖安装,认证仍由 Claude Code 环境管理。
@@ -192,31 +199,32 @@ npm start
192
199
  - CodeBuddy:安装官方 `codebuddy` CLI 并完成登录;旧 WorkBuddy 安装也可通过兼容别名继续使用。
193
200
  - Kiro CLI:安装 `kiro-cli`,启用 `acp` 子命令并完成 CLI 登录。
194
201
  - Cursor CLI:安装 `cursor-agent` 并完成 CLI 登录。
202
+ - Cline:安装 `cline`(`npm i -g cline`)并通过 `cline auth` 完成登录;Harness Mix 以官方 `cline --acp` 接入。
195
203
  - Qoder:安装 `qodercli`(或 `qoder`)并完成 CLI 登录;ACP 入口由本机版本决定。
196
204
  - ZCode / Trae:只有在拥有已验证的 ACP 兼容桥接程序时才配置 `HARNESS_MIX_ZCODE_ACP_EXECUTABLE` / `HARNESS_MIX_TRAE_EXECUTABLE`,项目不会猜测官方入口。
197
-
198
- 原生接入方式、数据目录和验证说明见 [原生 Codex 接入](docs/native-codex.md)。
199
-
200
- ## 验证
201
-
202
- ```powershell
203
- npm run check
204
- npm run test:core-all
205
- npm run e2e:native
206
- npm run smoke:native-ui
207
- ```
208
-
209
- 涉及原生 Adapter 时,再执行对应的真实链路:
210
-
211
- ```powershell
212
- npm run e2e:pi
213
- npm run e2e:dsh
214
- npm run e2e:claude
215
- npm run e2e:codex
216
- ```
217
-
218
- 部分 E2E 会启动真实 Harness,可能需要本机安装、登录或模型额度。测试生成物写入 `output/`,不应提交到仓库。
219
-
205
+
206
+ 原生接入方式、数据目录和验证说明见 [原生 Codex 接入](docs/native-codex.md)。
207
+
208
+ ## 验证
209
+
210
+ ```powershell
211
+ npm run check
212
+ npm run test:core-all
213
+ npm run e2e:native
214
+ npm run smoke:native-ui
215
+ ```
216
+
217
+ 涉及原生 Adapter 时,再执行对应的真实链路:
218
+
219
+ ```powershell
220
+ npm run e2e:pi
221
+ npm run e2e:dsh
222
+ npm run e2e:claude
223
+ npm run e2e:codex
224
+ ```
225
+
226
+ 部分 E2E 会启动真实 Harness,可能需要本机安装、登录或模型额度。测试生成物写入 `output/`,不应提交到仓库。
227
+
220
228
  ## License
221
-
222
- Harness Mix 基于 [Apache License 2.0](LICENSE) 发布。第三方组件仍适用各自的许可证;归属信息见 [NOTICE](NOTICE)。
229
+
230
+ Harness Mix 基于 [Apache License 2.0](LICENSE) 发布。第三方组件仍适用各自的许可证;归属信息见 [NOTICE](NOTICE)。
@@ -49,7 +49,7 @@ Pi / DSH 显示「已配置」而非「已登录」,目录存在不能证明
49
49
 
50
50
  Harness Mix 不改写各 Harness 已有的 MCP 配置文件。启用的托管配置在新建、恢复、Fork 或回退后的下一次原生会话打开时,通过各 Harness 的原生会话配置接口传入。正在运行的会话不会热改配置。Claude Code 与 OpenCode 可返回原生连接状态和工具名称;其他已接入 Harness 会区分「已配置」「已传入会话」和「连接状态未报告」,不会把保存成功当成已连接。
51
51
 
52
- Skills 从每个 Harness 已声明的原生目录发现:全部 16 个 Harness 都登记了全局/项目根目录,所以设置页不再出现「暂未配置原生技能目录」。根目录来自各 Harness 官方文档与已安装程序自身的扫描代码,例如 Codex 的 `~/.agents/skills` 与兼容保留的 `$CODEX_HOME/skills`、Kiro 专用的 `.kiro/skills`、Trae IDE 的 `.trae/skills` 与 TraeCode CLI 的 `.traecli/skills`、Hermes 的 `~/.hermes/skills`。打开原生会话时会先创建缺失的根目录,已安装但从未运行过的 Harness 也能立即发现技能;某个目录创建失败只会提示并跳过,不会阻止会话打开。可以把单个 Markdown 文件直接拖入并作为 `SKILL.md` 安装,也可以拖入或选择根目录含 `SKILL.md` 的完整技能文件夹。拖入内容经过同一套限制:拒绝路径逃逸、同名覆盖、超过 10 MB 或 500 个文件的技能。原有本机绝对目录安装协议仍兼容。停用会把整个技能目录移动到相邻的 Harness Mix 保留目录,恢复时原样移回;不删除技能内容。共享 `.agents/skills` 的修改会影响读取同一目录的 Harness。
52
+ Skills 从每个 Harness 已声明的原生目录发现:全部 17 个 Harness 都登记了全局/项目根目录,所以设置页不再出现「暂未配置原生技能目录」。根目录来自各 Harness 官方文档与已安装程序自身的扫描代码,例如 Codex 的 `~/.agents/skills` 与兼容保留的 `$CODEX_HOME/skills`、Kiro 专用的 `.kiro/skills`、Trae IDE 的 `.trae/skills` 与 TraeCode CLI 的 `.traecli/skills`、Hermes 的 `~/.hermes/skills`、Cline 的 `~/.cline/skills` 与项目 `.cline/skills`。打开原生会话时会先创建缺失的根目录,已安装但从未运行过的 Harness 也能立即发现技能;某个目录创建失败只会提示并跳过,不会阻止会话打开。可以把单个 Markdown 文件直接拖入并作为 `SKILL.md` 安装,也可以拖入或选择根目录含 `SKILL.md` 的完整技能文件夹。拖入内容经过同一套限制:拒绝路径逃逸、同名覆盖、超过 10 MB 或 500 个文件的技能。原有本机绝对目录安装协议仍兼容。停用会把整个技能目录移动到相邻的 Harness Mix 保留目录,恢复时原样移回;不删除技能内容。共享 `.agents/skills` 的修改会影响读取同一目录的 Harness。
53
53
 
54
54
  当前 MCP 会话注入支持 Claude Code、Codex(协作入口)、OpenCode、Grok、Antigravity,以及使用通用 ACP 接入的 CodeBuddy、Kiro、Cursor、Qoder 和 Hermes。DSH 配置托管 MCP 后会使用其官方 ACP profile 打开该会话;未配置时仍走 Web Remote。Pi/OMP 的 MCP 扩展机制不是通用原生 MCP 声明,当前只保留已有协作工具注入;设置页会明确显示不支持。每个 Harness 都登记了原生技能根目录,只有链接到其他位置的目录(junction/symlink)保持只读。
55
55
 
@@ -1,6 +1,6 @@
1
1
  # CodeBuddy、Kiro CLI、Cursor CLI 与其他原生 ACP 接入
2
2
 
3
- CodeBuddy、Kiro CLI、Cursor CLI 和 Qoder 使用原生 ACP stdio,并在 `native-acp.js`、
3
+ CodeBuddy、Kiro CLI、Cursor CLI、QoderCline 使用原生 ACP stdio,并在 `native-acp.js`、
4
4
  `acp-interactions.js` 中处理厂商差异。ZCode、Trae 也复用此引擎,但当前只有显式
5
5
  ACP 程序配置入口,尚未验证可用桥接程序,不能称为已完成官方原生接入。
6
6
  不替换原生账号、不代理模型供应商、不自动批准工具请求。
@@ -15,6 +15,7 @@ ACP 程序配置入口,尚未验证可用桥接程序,不能称为已完成
15
15
  | `qoder` | `qodercli --acp` / `qoder --acp` | `HARNESS_MIX_QODER_EXECUTABLE` | [Qoder 官方 ACP 文档](https://docs.qoder.com/cli/acp) |
16
16
  | `zcode` | 显式指定 ACP 桥接程序,无附加参数 | `HARNESS_MIX_ZCODE_ACP_EXECUTABLE` | [ZCode](https://zcode.z.ai/);本机原生 CLI 仅确认 app-server |
17
17
  | `trae` | 显式指定兼容 ACP 程序,无附加参数 | `HARNESS_MIX_TRAE_EXECUTABLE` | [官方 trae-agent](https://github.com/bytedance/trae-agent);未确认 ACP 支持 |
18
+ | `cline` | `cline --acp` | `HARNESS_MIX_CLINE_EXECUTABLE` | [Cline CLI](https://docs.cline.bot/usage/cli-overview);官方文档与源码均确认 ACP |
18
19
 
19
20
  Qoder 在 Windows 上识别 npm 包并直接启动官方 JavaScript bundle。ZCode 的
20
21
  `app-server --stdio` 使用厂商协议,不能直接填入 ACP 程序路径。旧的 `zcode acp`、
@@ -69,8 +70,12 @@ Cursor 在 Windows 上识别官方版本目录并直接运行其 Node bundle。
69
70
  OpenClaw 的当前模型明确拒绝图片,属于模型能力限制而非 Host 丢图。
70
71
  - 精确消息回退、CodeBuddy/Cursor fork、账号配额查询不声明支持。
71
72
  - Kiro autopilot 不伪装为 Host 权限级别;未知扩展请求明确报不支持。
73
+ - Cline 官方 ACP(apps/cli/src/acp)已核对:握手声明 loadSession 与图片输入,
74
+ session/new 返回 plan/act 模式与模型目录,审批走标准 session/request_permission。
75
+ 其事件投影没有 plan 条目、diff 内容块、usage_update 或 thinking 档位配置,
76
+ 对应能力一律不声明;提问以审批选项形式出现,不伪造独立提问通道。
72
77
  - 部分 CLI 不提供原生 Diff 或用量,缺失时不从当前文件/估算值补造。
73
- - CodeBuddy/Kiro/Cursor/Qoder/ZCode/Trae 的 ACP 会话可接收每会话 MCP 定义,
78
+ - CodeBuddy/Kiro/Cursor/Qoder/Cline/ZCode/Trae 的 ACP 会话可接收每会话 MCP 定义,
74
79
  但只有本机安装且握手成功的程序才会开放入口;ZCode、Trae 仍需显式兼容 ACP
75
80
  桥接器,不能把其 app-server 或普通 CLI 当成 ACP。
76
81
  - DSH 协作主任务走官方 `dsh --profile acp`,由同一 ACP 引擎接收 session-scoped
@@ -0,0 +1,65 @@
1
+ # 跨 Harness 任务接力设计
2
+
3
+ ## 目标
4
+
5
+ 同一个 Host Thread 可以更换底层原生 Harness,同时保持工作目录、Host 对话、Review 记录和各 Harness 自己的原生 Session。接力不复制凭据、不代理权限决策;目标 Harness 必须自行验证工作区事实。
6
+
7
+ ## 核心不变量
8
+
9
+ 1. 目标 Harness 的原生 Session 连接成功前,不向用户报告切换成功。
10
+ 2. 一个 Thread 同时只能存在一个待投递检查点,避免 A → B 尚未投递时又切到 C,导致来源血缘被覆盖。
11
+ 3. 检查点是不可变、脱敏且带摘要哈希的;生命周期状态单独更新。
12
+ 4. 首轮投递成功后才清除 `pendingHandoff`;失败时保留,以便安全重试或显式取消。
13
+ 5. 自动回滚和显式取消都只恢复 Harness 路由与原生 Session,不回滚共享工作区里的文件。
14
+
15
+ ## 状态机
16
+
17
+ ```text
18
+ checkpoint-created
19
+ |
20
+ v
21
+ connecting -------> rolled-back
22
+ |
23
+ v
24
+ ready ----------> cancelled
25
+ |
26
+ v
27
+ delivering -------> failed --(retry)--> delivering
28
+ |
29
+ v
30
+ active
31
+ ```
32
+
33
+ - `connecting`:已保存源 Session 引用,正在打开目标 Harness。
34
+ - `ready`:目标 Session 已连接,等待用户下一条真实消息。
35
+ - `delivering`:正在发送一次性接力信封和用户消息。
36
+ - `active`:目标 Harness 已接受首轮消息,接力完成。
37
+ - `failed`:发送失败;检查点和待投递状态保留。
38
+ - `rolled-back`:目标连接失败,Host 已自动恢复源 Harness。
39
+ - `cancelled`:用户在首轮投递前执行 `/switch cancel`。
40
+
41
+ ## 切换事务
42
+
43
+ 1. 从当前 Thread 创建脱敏检查点。
44
+ 2. 保存源 Harness 的 `nativeSessionId`、Session 文件、模型和原生选项。
45
+ 3. 持久化 `pendingHandoff`,阶段设为 `connecting`。
46
+ 4. 打开目标 Harness 的原生 Session。
47
+ 5. 成功后进入 `ready`;失败则关闭目标、恢复源引用并重新打开源 Session。
48
+ 6. 下一条真实消息把检查点摘要作为不可见信封发送;成功进入 `active`,失败进入 `failed`。
49
+
50
+ ## 接力模式语义
51
+
52
+ - `continue`:从核验后的状态和未完成工作继续。
53
+ - `execute-plan`:读取检查点计划,逐项核对工作区后执行。
54
+ - `review`:先独立审查,不主动修改文件。
55
+ - `reanalyze`:独立重新分析,旧结论仅作证据。
56
+
57
+ 模式会转成明确的首轮行为约束,而不只作为检查点元数据传递。
58
+
59
+ ## 原生 UI 与协议
60
+
61
+ 切换 RPC 返回检查点、源/目标 Harness 和阶段;Thread 投影中的 `pendingHarnessSwitch` 同样包含这些字段。现有原生命令菜单在待投递期间隐藏新的 `/switch` 候选,并提供 `/switch cancel`。不新增独立的协作面板。
62
+
63
+ ## 验证范围
64
+
65
+ 脚本回归覆盖正常切换、原生 Session 恢复、二次切换拦截、显式取消、目标连接失败回滚、发送失败保留检查点、持久化与四种模式约束。真实 Harness 的认证与 Desktop 重启流程仍需单独进行端到端验收。
@@ -0,0 +1,193 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ Copyright 2026 Codex Styler contributors
181
+
182
+ Licensed under the Apache License, Version 2.0 (the "License");
183
+ you may not use this file except in compliance with the License.
184
+ You may obtain a copy of the License at
185
+
186
+ http://www.apache.org/licenses/LICENSE-2.0
187
+
188
+ Unless required by applicable law or agreed to in writing, software
189
+ distributed under the License is distributed on an "AS IS" BASIS,
190
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
191
+ See the License for the specific language governing permissions and
192
+ limitations under the License.
193
+
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HeiGeAi (Blake Xu)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -1365,7 +1365,8 @@ ${rendererSource}`,
1365
1365
  "cursor-cli",
1366
1366
  "codex-harness",
1367
1367
  "zcode",
1368
- "trae"
1368
+ "trae",
1369
+ "cline"
1369
1370
  ],
1370
1371
  timeoutMs: PRODUCTION_INSTALL_TIMEOUT_MS
1371
1372
  },