@1agents/acp-service 0.9.0 → 0.10.0

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 (274) hide show
  1. package/README.md +19 -13
  2. package/dist/bin/a2a.js +6 -2
  3. package/dist/bin/acp-service.js +25 -1
  4. package/dist/bin/process.d.ts +4 -0
  5. package/dist/bin/process.js +57 -0
  6. package/dist/bin/roles.js +21 -18
  7. package/dist/bin/rsi.d.ts +3 -0
  8. package/dist/bin/rsi.js +114 -0
  9. package/dist/bin/ticket.d.ts +13 -0
  10. package/dist/bin/ticket.js +97 -0
  11. package/dist/bin/trail.d.ts +4 -0
  12. package/dist/bin/trail.js +62 -0
  13. package/dist/src/a2a/artifact-content.d.ts +9 -0
  14. package/dist/src/a2a/artifact-content.js +45 -0
  15. package/dist/src/a2a/desktop-notify.d.ts +1 -0
  16. package/dist/src/a2a/desktop-notify.js +12 -0
  17. package/dist/src/a2a/execution-binding.d.ts +9 -0
  18. package/dist/src/a2a/execution-binding.js +19 -0
  19. package/dist/src/a2a/executor.d.ts +7 -2
  20. package/dist/src/a2a/executor.js +127 -60
  21. package/dist/src/a2a/gateway.d.ts +581 -10
  22. package/dist/src/a2a/gateway.js +1018 -95
  23. package/dist/src/a2a/index.d.ts +8 -1
  24. package/dist/src/a2a/index.js +4 -0
  25. package/dist/src/a2a/job-directory.d.ts +6 -0
  26. package/dist/src/a2a/job-directory.js +19 -0
  27. package/dist/src/a2a/preflight.js +16 -1
  28. package/dist/src/a2a/resubmit.d.ts +46 -0
  29. package/dist/src/a2a/resubmit.js +82 -0
  30. package/dist/src/a2a/result-metadata.d.ts +3 -0
  31. package/dist/src/a2a/result-metadata.js +27 -5
  32. package/dist/src/a2a/server.d.ts +10 -0
  33. package/dist/src/a2a/server.js +125 -1
  34. package/dist/src/a2a/session-lifecycle.d.ts +40 -0
  35. package/dist/src/a2a/session-lifecycle.js +54 -0
  36. package/dist/src/a2a/store.d.ts +4 -0
  37. package/dist/src/a2a/store.js +70 -1
  38. package/dist/src/a2a/types.d.ts +46 -6
  39. package/dist/src/a2a/types.js +4 -6
  40. package/dist/src/a2a/workbench-ui.d.ts +28 -0
  41. package/dist/src/a2a/workbench-ui.js +182 -0
  42. package/dist/src/acp-connection.js +27 -3
  43. package/dist/src/bridge.d.ts +1 -0
  44. package/dist/src/bridge.js +191 -39
  45. package/dist/src/capacity-queue.d.ts +35 -0
  46. package/dist/src/capacity-queue.js +139 -2
  47. package/dist/src/capacity.d.ts +25 -0
  48. package/dist/src/capacity.js +48 -9
  49. package/dist/src/dsh.js +1 -1
  50. package/dist/src/execution/agent-files.d.ts +25 -0
  51. package/dist/src/execution/agent-files.js +90 -0
  52. package/dist/src/execution/agent-registry.d.ts +164 -0
  53. package/dist/src/execution/agent-registry.js +275 -0
  54. package/dist/src/execution/human-review.d.ts +2 -0
  55. package/dist/src/execution/human-review.js +3 -1
  56. package/dist/src/execution/ledger.d.ts +52 -0
  57. package/dist/src/execution/ledger.js +83 -5
  58. package/dist/src/execution/ppt-delivery.d.ts +0 -5
  59. package/dist/src/execution/ppt-delivery.js +0 -26
  60. package/dist/src/execution/process-request.d.ts +151 -0
  61. package/dist/src/execution/process-request.js +177 -0
  62. package/dist/src/execution/targets.d.ts +64 -5
  63. package/dist/src/execution/targets.js +58 -7
  64. package/dist/src/execution/ticket-executor.d.ts +25 -0
  65. package/dist/src/execution/ticket-executor.js +27 -0
  66. package/dist/src/execution/ticket.d.ts +326 -0
  67. package/dist/src/execution/ticket.js +301 -0
  68. package/dist/src/execution/workbench-chat.d.ts +25 -0
  69. package/dist/src/execution/workbench-chat.js +54 -0
  70. package/dist/src/execution/workbench.d.ts +32 -1
  71. package/dist/src/execution/workbench.js +113 -22
  72. package/dist/src/roles/index.d.ts +1 -1
  73. package/dist/src/roles/index.js +1 -1
  74. package/dist/src/roles/skills.d.ts +27 -58
  75. package/dist/src/roles/skills.js +89 -404
  76. package/dist/src/rsi/gate.d.ts +25 -0
  77. package/dist/src/rsi/gate.js +59 -0
  78. package/dist/src/rsi/outline-run.d.ts +107 -0
  79. package/dist/src/rsi/outline-run.js +443 -0
  80. package/dist/workbench-ui/app.css +453 -0
  81. package/dist/workbench-ui/app.js +13 -0
  82. package/dist/workbench-ui/chunk-23JHGYT3.js +1 -0
  83. package/dist/workbench-ui/chunk-3H6STGPV.js +1 -0
  84. package/dist/workbench-ui/chunk-3SNBBMGH.js +1 -0
  85. package/dist/workbench-ui/chunk-3XJZ6DIE.js +1 -0
  86. package/dist/workbench-ui/chunk-44KDLLKJ.js +1 -0
  87. package/dist/workbench-ui/chunk-46H7FU5Y.js +7 -0
  88. package/dist/workbench-ui/chunk-4N44QPL7.js +1 -0
  89. package/dist/workbench-ui/chunk-4YN4BS7I.js +1 -0
  90. package/dist/workbench-ui/chunk-53EG4IVQ.js +96 -0
  91. package/dist/workbench-ui/chunk-5FIPUNR4.js +1 -0
  92. package/dist/workbench-ui/chunk-6DWWYA6G.js +2 -0
  93. package/dist/workbench-ui/chunk-6FU3T633.js +99 -0
  94. package/dist/workbench-ui/chunk-6XKIHRA4.js +1 -0
  95. package/dist/workbench-ui/chunk-7GIX43Y5.js +1 -0
  96. package/dist/workbench-ui/chunk-7Q4WBGX6.js +4 -0
  97. package/dist/workbench-ui/chunk-A3BQM7HR.js +1 -0
  98. package/dist/workbench-ui/chunk-AFCFDDOP.js +24 -0
  99. package/dist/workbench-ui/chunk-AG67EUYD.js +89 -0
  100. package/dist/workbench-ui/chunk-AGJHMMTN.js +1 -0
  101. package/dist/workbench-ui/chunk-AO6JUBV6.js +41 -0
  102. package/dist/workbench-ui/chunk-AUSLTP43.js +72 -0
  103. package/dist/workbench-ui/chunk-AVZL46TT.js +1 -0
  104. package/dist/workbench-ui/chunk-AZRIGIV2.js +168 -0
  105. package/dist/workbench-ui/chunk-B2LIVH37.js +1 -0
  106. package/dist/workbench-ui/chunk-B7YX5TR5.js +1 -0
  107. package/dist/workbench-ui/chunk-BCB4X4XX.js +1 -0
  108. package/dist/workbench-ui/chunk-BCRQUL2A.js +88 -0
  109. package/dist/workbench-ui/chunk-BI6UHHQP.js +1 -0
  110. package/dist/workbench-ui/chunk-BLSLQ4AQ.js +120 -0
  111. package/dist/workbench-ui/chunk-C3QSRS6E.js +1 -0
  112. package/dist/workbench-ui/chunk-CK7M2PJ3.js +62 -0
  113. package/dist/workbench-ui/chunk-CM6LZ7TU.js +1 -0
  114. package/dist/workbench-ui/chunk-CP63H27F.js +36 -0
  115. package/dist/workbench-ui/chunk-CPUMMIS2.js +70 -0
  116. package/dist/workbench-ui/chunk-CSEIBI5U.js +2 -0
  117. package/dist/workbench-ui/chunk-CUS65DKZ.js +161 -0
  118. package/dist/workbench-ui/chunk-CVQY7TNC.js +1 -0
  119. package/dist/workbench-ui/chunk-D6S3XBIX.js +106 -0
  120. package/dist/workbench-ui/chunk-E253Y562.js +1 -0
  121. package/dist/workbench-ui/chunk-EADDJUDC.js +1 -0
  122. package/dist/workbench-ui/chunk-EBGJ3YXG.js +206 -0
  123. package/dist/workbench-ui/chunk-EKPVZ3WY.js +8 -0
  124. package/dist/workbench-ui/chunk-EQDCEAFY.js +1 -0
  125. package/dist/workbench-ui/chunk-ES3SSDJY.js +40 -0
  126. package/dist/workbench-ui/chunk-ESFD2H7N.js +231 -0
  127. package/dist/workbench-ui/chunk-FVOHPMS6.js +1 -0
  128. package/dist/workbench-ui/chunk-FXMQAGVT.js +1 -0
  129. package/dist/workbench-ui/chunk-GGTADRXD.js +24 -0
  130. package/dist/workbench-ui/chunk-GHIVPGNQ.js +1 -0
  131. package/dist/workbench-ui/chunk-GLU2YQV2.js +1 -0
  132. package/dist/workbench-ui/chunk-GOCKBYSM.js +1 -0
  133. package/dist/workbench-ui/chunk-H2KMMTJB.js +1 -0
  134. package/dist/workbench-ui/chunk-HGVLDNPP.js +39 -0
  135. package/dist/workbench-ui/chunk-HSAVC5GY.js +1 -0
  136. package/dist/workbench-ui/chunk-HSEAD2JH.js +1 -0
  137. package/dist/workbench-ui/chunk-HSIHOBTY.js +1 -0
  138. package/dist/workbench-ui/chunk-IZXOKUGG.js +67 -0
  139. package/dist/workbench-ui/chunk-JFT2LC2T.js +1 -0
  140. package/dist/workbench-ui/chunk-JHL3ZDYK.js +3 -0
  141. package/dist/workbench-ui/chunk-JMORLCZG.js +257 -0
  142. package/dist/workbench-ui/chunk-JR4SIX7A.js +1 -0
  143. package/dist/workbench-ui/chunk-K23HAGEH.js +30 -0
  144. package/dist/workbench-ui/chunk-K43JDCBH.js +1 -0
  145. package/dist/workbench-ui/chunk-KINKFJY7.js +1 -0
  146. package/dist/workbench-ui/chunk-KKQSA4LI.js +2 -0
  147. package/dist/workbench-ui/chunk-KOUZX3UX.js +1 -0
  148. package/dist/workbench-ui/chunk-KR4DRHW2.js +78 -0
  149. package/dist/workbench-ui/chunk-KT4DJNOR.js +1 -0
  150. package/dist/workbench-ui/chunk-KTPNKRRZ.js +292 -0
  151. package/dist/workbench-ui/chunk-LFHIPGSU.js +7 -0
  152. package/dist/workbench-ui/chunk-LWDL4HZB.js +125 -0
  153. package/dist/workbench-ui/chunk-MVYC3CY4.js +1 -0
  154. package/dist/workbench-ui/chunk-NWUPALCY.js +129 -0
  155. package/dist/workbench-ui/chunk-NY7C662Z.js +1 -0
  156. package/dist/workbench-ui/chunk-O76WTHWP.js +1 -0
  157. package/dist/workbench-ui/chunk-OTF7YHRE.js +162 -0
  158. package/dist/workbench-ui/chunk-P6TKKRKP.js +1 -0
  159. package/dist/workbench-ui/chunk-PFHOOWV3.js +1 -0
  160. package/dist/workbench-ui/chunk-PUQLANIM.js +1 -0
  161. package/dist/workbench-ui/chunk-PZCGBYVO.js +1 -0
  162. package/dist/workbench-ui/chunk-QOHUZGP4.js +1 -0
  163. package/dist/workbench-ui/chunk-QSEG3OFF.js +1 -0
  164. package/dist/workbench-ui/chunk-QYPOXZIA.js +84 -0
  165. package/dist/workbench-ui/chunk-R6SOF3JC.js +1 -0
  166. package/dist/workbench-ui/chunk-RCLOYU5F.js +1 -0
  167. package/dist/workbench-ui/chunk-RSRUP64S.js +1 -0
  168. package/dist/workbench-ui/chunk-RVAIT6JW.js +1 -0
  169. package/dist/workbench-ui/chunk-S2CCN3II.js +1 -0
  170. package/dist/workbench-ui/chunk-S2Q52W46.js +1 -0
  171. package/dist/workbench-ui/chunk-S2W5THJ5.js +1 -0
  172. package/dist/workbench-ui/chunk-S6ZQZNOX.js +1 -0
  173. package/dist/workbench-ui/chunk-S74PLMMS.js +1 -0
  174. package/dist/workbench-ui/chunk-S7C4HKEY.js +1 -0
  175. package/dist/workbench-ui/chunk-SDTB3Q65.js +1 -0
  176. package/dist/workbench-ui/chunk-SLPRGYUV.js +32 -0
  177. package/dist/workbench-ui/chunk-SQE76S5B.js +1 -0
  178. package/dist/workbench-ui/chunk-SSDZPVPW.js +1 -0
  179. package/dist/workbench-ui/chunk-SVI7DGIE.js +1 -0
  180. package/dist/workbench-ui/chunk-T6QKLZ4H.js +62 -0
  181. package/dist/workbench-ui/chunk-TJNRPTFL.js +1 -0
  182. package/dist/workbench-ui/chunk-TP6U4EDH.js +2 -0
  183. package/dist/workbench-ui/chunk-TYAAT3GQ.js +1 -0
  184. package/dist/workbench-ui/chunk-U6OCY4ZH.js +1 -0
  185. package/dist/workbench-ui/chunk-UAN3NLRF.js +1 -0
  186. package/dist/workbench-ui/chunk-UMLU3FIX.js +1 -0
  187. package/dist/workbench-ui/chunk-URIY2OTM.js +1 -0
  188. package/dist/workbench-ui/chunk-V2NUKAA7.js +38 -0
  189. package/dist/workbench-ui/chunk-V4QLL4TE.js +139 -0
  190. package/dist/workbench-ui/chunk-VASHXUK4.js +2 -0
  191. package/dist/workbench-ui/chunk-VJLIWNIU.js +1 -0
  192. package/dist/workbench-ui/chunk-VQNQFBID.js +1 -0
  193. package/dist/workbench-ui/chunk-VSIWU7XA.js +3 -0
  194. package/dist/workbench-ui/chunk-VSJASPUZ.js +321 -0
  195. package/dist/workbench-ui/chunk-VXPNUNUX.js +3 -0
  196. package/dist/workbench-ui/chunk-WBKLDCV6.js +1 -0
  197. package/dist/workbench-ui/chunk-WOKJM3FY.js +1 -0
  198. package/dist/workbench-ui/chunk-X3U3NA3X.js +34 -0
  199. package/dist/workbench-ui/chunk-XBYU7M4J.js +1 -0
  200. package/dist/workbench-ui/chunk-XBZAO4ID.js +10 -0
  201. package/dist/workbench-ui/chunk-XLLPZ2WO.js +1 -0
  202. package/dist/workbench-ui/chunk-YFVL4NJL.js +1 -0
  203. package/dist/workbench-ui/chunk-YRFQENM4.js +1 -0
  204. package/dist/workbench-ui/chunk-YUADQVB2.js +1 -0
  205. package/dist/workbench-ui/chunk-Z3TCAKM5.js +1 -0
  206. package/dist/workbench-ui/chunk-Z6QR6FRE.js +10 -0
  207. package/dist/workbench-ui/chunk-ZJPSORPP.js +3 -0
  208. package/dist/workbench-ui/chunk-ZLGCSTR2.js +15 -0
  209. package/dist/workbench-ui/chunk-ZLR4SG5X.js +1 -0
  210. package/dist/workbench-ui/chunk-ZND3TTGF.js +1 -0
  211. package/dist/workbench-ui/chunk-ZOP3ZYH7.js +2 -0
  212. package/dist/workbench-ui/index.html +14 -0
  213. package/package.json +19 -8
  214. package/skills/acp-service/SKILL.md +4 -2
  215. package/skills/acp-service/references/a2a.md +18 -6
  216. package/skills/acp-service/references/dsh.md +2 -0
  217. package/skills/acp-service/references/roles-and-tasks.md +10 -10
  218. package/skills/rsi-coach/SKILL.md +134 -0
  219. package/vendor/dsh/README.md +10 -6
  220. package/vendor/dsh/a2a-executor.d.ts +56 -2
  221. package/vendor/dsh/a2a-executor.js +163 -17
  222. package/vendor/dsh/a2a.d.ts +12 -2
  223. package/vendor/dsh/a2a.js +9 -2
  224. package/vendor/dsh/adapter.d.ts +52 -3
  225. package/vendor/dsh/adapter.js +297 -30
  226. package/vendor/dsh/client.js +67 -11
  227. package/vendor/dsh/index.js +55 -3
  228. package/vendor/dsh/native-approvals.d.ts +4 -0
  229. package/vendor/dsh/native-approvals.js +44 -0
  230. package/vendor/dsh/preset-route.d.ts +49 -0
  231. package/vendor/dsh/preset-route.js +51 -0
  232. package/vendor/dsh/preset.js +10 -3
  233. package/vendor/dsh/process-admission.d.ts +25 -0
  234. package/vendor/dsh/process-admission.js +87 -0
  235. package/vendor/dsh/process-requests.d.ts +57 -0
  236. package/vendor/dsh/process-requests.js +49 -0
  237. package/vendor/dsh/review-mcp.d.ts +1 -0
  238. package/vendor/dsh/review-mcp.js +56 -0
  239. package/vendor/dsh/review.d.ts +30 -0
  240. package/vendor/dsh/review.js +149 -0
  241. package/vendor/dsh/session-settings.d.ts +34 -0
  242. package/vendor/dsh/session-settings.js +114 -0
  243. package/vendor/dsh/ticket-spec.d.ts +30 -0
  244. package/vendor/dsh/ticket-spec.js +10 -0
  245. package/vendor/dsh/ticket-tools.d.ts +21 -0
  246. package/vendor/dsh/ticket-tools.js +43 -0
  247. package/vendor/dsh/workbench.d.ts +18 -0
  248. package/vendor/dsh/workbench.js +91 -0
  249. package/vendor/runtime/README.md +6 -4
  250. package/vendor/runtime/dist/docs-site/CLI.html +2 -2
  251. package/vendor/runtime/dist/docs-site/VISION.html +2 -2
  252. package/vendor/runtime/dist/docs-site/agents.html +2 -2
  253. package/vendor/runtime/dist/docs-site/compare.html +2 -2
  254. package/vendor/runtime/dist/docs-site/config.html +2 -2
  255. package/vendor/runtime/dist/docs-site/custom-agents.html +2 -2
  256. package/vendor/runtime/dist/docs-site/exit-codes.html +2 -2
  257. package/vendor/runtime/dist/docs-site/flows.html +2 -2
  258. package/vendor/runtime/dist/docs-site/index.html +1 -1
  259. package/vendor/runtime/dist/docs-site/install.html +2 -2
  260. package/vendor/runtime/dist/docs-site/llms.txt +1 -1
  261. package/vendor/runtime/dist/docs-site/output-formats.html +2 -2
  262. package/vendor/runtime/dist/docs-site/permissions.html +2 -2
  263. package/vendor/runtime/dist/docs-site/prompting.html +2 -2
  264. package/vendor/runtime/dist/docs-site/quickstart.html +2 -2
  265. package/vendor/runtime/dist/docs-site/releasing.html +2 -2
  266. package/vendor/runtime/dist/docs-site/runtime-environment.html +2 -2
  267. package/vendor/runtime/dist/docs-site/runtime-process-lifecycle.html +2 -2
  268. package/vendor/runtime/dist/docs-site/safe-errors.html +2 -2
  269. package/vendor/runtime/dist/docs-site/session-control.html +2 -2
  270. package/vendor/runtime/dist/docs-site/session-watch.html +2 -2
  271. package/vendor/runtime/dist/docs-site/sessions.html +2 -2
  272. package/vendor/runtime/dist/docs-site/shared-sessions.html +2 -2
  273. package/vendor/runtime/package.json +6 -4
  274. package/vendor/runtime/skills/acpx/SKILL.md +2 -0
package/README.md CHANGED
@@ -14,21 +14,21 @@ Restart DSH and check that **`@1agents/acp-service`** is enabled on the Plugins
14
14
 
15
15
  If pnpm reports an ignored transitive `esbuild` build script, follow the package manager's prompt or set that individual package's approval in the profile, then repeat the install. Approve or deny the script according to your policy, and check the bundle's enabled state after a partial install.
16
16
 
17
- The pinned [GitHub Release tarball](https://github.com/scottzx/1acp/releases/tag/acp-service-v0.6.0) contains the same published npm artifact:
17
+ The pinned [GitHub Release tarball](https://github.com/scottzx/agent-workflow/releases/tag/acp-service-v0.6.0) contains the same published npm artifact.
18
18
 
19
19
  ```sh
20
- dsh plugin --profile web add https://github.com/scottzx/1acp/releases/download/acp-service-v0.6.0/1agents-acp-service-0.6.0.tgz
20
+ dsh plugin --profile web add https://github.com/scottzx/agent-workflow/releases/download/acp-service-v0.6.0/1agents-acp-service-0.6.0.tgz
21
21
  ```
22
22
 
23
- `@1agents/session-reader` is optional: install it separately to browse and continue existing Claude, Codex and Grok histories. For presets, native controls, configuration and migration, see the [DSH user guide](https://github.com/scottzx/1acp/blob/main/packages/dsh-plugin/README.md).
23
+ `@1agents/session-reader` is optional: install it separately to browse and continue existing Claude, Codex and Grok histories. For presets, native controls, configuration and migration, see the [DSH user guide](https://github.com/scottzx/agent-workflow/blob/main/packages/dsh-plugin/README.md).
24
24
 
25
- The CI baseline is **DSH 0.1.7-rc.2**, commit `21638c56315ae6a2b552d6091945d3144c9af32e`. Additional isolated-profile verification used a locally modified DSH tree labeled `0.2.0-rc.1`. The [verification record](https://github.com/scottzx/1acp/blob/main/docs/marketplaces/verification-2026-10-09.md) describes the installed-package, Loader, browser and lifecycle checks and their limits.
25
+ The CI baseline is **DSH 0.1.7-rc.2**, commit `21638c56315ae6a2b552d6091945d3144c9af32e`. Additional isolated-profile verification used a locally modified DSH tree labeled `0.2.0-rc.1`. The [verification record](https://github.com/scottzx/agent-workflow/blob/main/docs/marketplaces/verification-2026-10-09.md) describes the installed-package, Loader, browser and lifecycle checks and their limits.
26
26
 
27
27
  ### Screenshots
28
28
 
29
- ![Discovered ACP Agent presets in DSH](https://raw.githubusercontent.com/scottzx/1acp/main/packages/service/assets/dsh-agent-presets.png)
29
+ ![Discovered ACP Agent presets in DSH](https://raw.githubusercontent.com/scottzx/agent-workflow/main/packages/service/assets/dsh-agent-presets.png)
30
30
 
31
- ![Native Codex model and ACP controls](https://raw.githubusercontent.com/scottzx/1acp/main/packages/service/assets/dsh-codex-controls.png)
31
+ ![Native Codex model and ACP controls](https://raw.githubusercontent.com/scottzx/agent-workflow/main/packages/service/assets/dsh-codex-controls.png)
32
32
 
33
33
  These unmodified screenshots show discovery and native capability loading in that fresh isolated local profile. No model prompt was sent for the UI check. Controls depend on the selected Agent, adapter and account.
34
34
 
@@ -58,7 +58,7 @@ The existing embedded `acpx` runtime skill remains available. The skill and its
58
58
 
59
59
  ## Service development and API
60
60
 
61
- Version 0.6.0 includes the 1ACP runtime, CLI, service, DSH plugin, browser controls, skills and licenses. The runtime and service retain their respective ACP SDK versions.
61
+ Version 0.6.0 includes the agent-workflow runtime, CLI, service, DSH plugin, browser controls, skills and licenses. The runtime and service retain their respective ACP SDK versions.
62
62
 
63
63
  The runtime's per-session launch argv and transient credentials APIs support Provider Profiles. Public runtime APIs and flow authoring are available as `@1agents/acp-service/runtime` and `@1agents/acp-service/flows`. The `acp-service` command forwards runtime commands alongside its `serve` command.
64
64
 
@@ -97,7 +97,7 @@ HTTP endpoints:
97
97
 
98
98
  DSH reads the package's bundle patch and browser metadata; the CLI uses its `bin` entry. There is no installation-time mode switch, and both uses can coexist. The package root retains the service API and exposes Cordis metadata plus a lazy `apply`; merely importing it starts no plugin or process. `/service` is the service API, while `/dsh`, `/dsh/preset` and `/dsh/imports` provide the typed plugin interfaces. DSH host dependencies are supplied by DSH rather than installed with the CLI.
99
99
 
100
- The plugin starts or reuses a local service when activated. See [DSH plugin usage](https://github.com/scottzx/1acp/blob/main/packages/dsh-plugin/README.md) for presets, browser controls, configuration and lifecycle. Before migrating, stop DSH and remove `@1agents/dsh-acp`, then add the unified package; keep session bindings and preserve custom row configuration. Plugin and preset IDs are unchanged.
100
+ The plugin starts or reuses a local service when activated. See [DSH plugin usage](https://github.com/scottzx/agent-workflow/blob/main/packages/dsh-plugin/README.md) for presets, browser controls, configuration and lifecycle. Before migrating, stop DSH and remove `@1agents/dsh-acp`, then add the unified package; keep session bindings and preserve custom row configuration. Plugin and preset IDs are unchanged.
101
101
 
102
102
  ## DSH A2A
103
103
 
@@ -280,7 +280,7 @@ npm run typecheck
280
280
  npm test
281
281
  ```
282
282
 
283
- Tests use the official ACP SDK over real WebSockets, cover session lifecycle and permission reconnects, and drive the installed 1acp runtime through a deterministic external stdio Agent. They require no model API key. Existing real-provider smoke tests in the 1agents backend remain opt-in.
283
+ Tests use the official ACP SDK over real WebSockets, cover session lifecycle and permission reconnects, and drive the installed agent-workflow runtime (`@scottzx/1acp`) through a deterministic external stdio Agent. They require no model API key. Existing real-provider smoke tests in the 1agents backend remain opt-in.
284
284
 
285
285
  ## Local harness discovery
286
286
 
@@ -295,8 +295,8 @@ The service launcher uses the same local command resolution, including absolute
295
295
  The optional automation listener supports Activepieces scheduled tasks:
296
296
  authenticated occurrence submission, overlap prevention, durable task
297
297
  correlation and completion-processing claims. See the repository's
298
- [integration guide](https://github.com/scottzx/1acp/blob/main/docs/activepieces-automation.md) and
299
- [configuration examples](https://github.com/scottzx/1acp/tree/main/examples/activepieces).
298
+ [integration guide](https://github.com/scottzx/agent-workflow/blob/main/docs/activepieces-automation.md) and
299
+ [configuration examples](https://github.com/scottzx/agent-workflow/tree/main/examples/activepieces).
300
300
 
301
301
  The same package includes `acp-service a2a gateway --config /absolute/gateway.json` and exports `RemoteAgentGateway` / `serveA2AGateway` from `@1agents/acp-service/a2a`. The gateway calls the standard A2A 1.0 SendMessage, GetTask and CancelTask APIs. Its seven `remote_agent_*` methods register with the local DreamMate node; an existing `dreammate_invoke` client can use them without another MCP server. This source change also adds four optional `session_*` delivery methods described below; installed older versions must be updated before using them.
302
302
 
@@ -355,7 +355,7 @@ Host transport IDs are derived deterministically as `sha256([originSessionId, me
355
355
 
356
356
  New A2A notices snapshot their delivery route. An already bound origin uses session delivery, ahead of the legacy webhook, with message ID `a2a-notice:<noticeId>`. The queued notice identifies the task and tells the parent to retrieve its full result through `remote_agent_get` or `remote_agent_inbox`. Unbound origins keep the existing webhook/inbox path; adding a binding later does not migrate old notices. `accepted` means accepted into the host queue, not model execution or business completion. Notices stay in the inbox until `remote_agent_ack`; acknowledgement records `processedAt` on the corresponding delivery and prevents a pending notice from being sent later. There is no automatic business acknowledgement.
357
357
 
358
- Codex hosts support `executable`, `remote`, `cwd`, `timeoutMs`, and `remoteAuthTokenEnv`; DSH hosts support an origin `url`, protected `headers`, and `timeoutMs`. Keep real DSH Cookie/Authorization values and remote credentials in the private gateway configuration or designated environment, never tool arguments, message text, receipts, or logs. Host authentication is distinct from the remote A2A bearer token. Ordinary MCP access alone still does not supply a binding or configure the host. See the [session delivery guide](https://github.com/scottzx/1acp/blob/main/docs/session-delivery.md) for configuration and recovery.
358
+ Codex hosts support `executable`, `remote`, `cwd`, `timeoutMs`, and `remoteAuthTokenEnv`; DSH hosts support an origin `url`, protected `headers`, and `timeoutMs`. Keep real DSH Cookie/Authorization values and remote credentials in the private gateway configuration or designated environment, never tool arguments, message text, receipts, or logs. Host authentication is distinct from the remote A2A bearer token. Ordinary MCP access alone still does not supply a binding or configure the host. See the [session delivery guide](https://github.com/scottzx/agent-workflow/blob/main/docs/session-delivery.md) for configuration and recovery.
359
359
 
360
360
 
361
361
  ## 0.8.0 — DreamMate dependency transition
@@ -377,7 +377,13 @@ A2A 网关增加版本化执行目标目录和任务台账。父任务与子任
377
377
  - `execution_get/list/events` 查询来源范围内的状态、结果、父子引用和事件;`execution_continue` 显式创建新执行轮次,保留原后端上下文。
378
378
  - `remote_agent_*` 保留原参数、Task 和通知/ack,返回附加 jobId/attemptId;旧 Task 各迁移为独立任务,不按 context 合并。
379
379
  - 可选 `binding.driver=ppt_delivery` 使用独立领域模块推进项目脚本、制作、确定性校验、独立事实/逐页视觉复核及有限返工。父任务等待时仍为 working;它不把阶段调度加入通用台账。
380
- - `execution_inbox/ack` 处理领域交付通知,`execution_review` 独立记录绑定具体轮次、结果版本与 digest 的业务接受。角色通知使用独立 `execution-notice:` 标识,不伪造远端 A2A Task。
380
+ - `execution_inbox/ack` 处理领域交付通知,`execution_review` 独立记录绑定具体轮次、结果版本与 digest 的业务接受,`decidedBy` 必填;工作台的“已阅”按钮以人的身份记为 `accepted`。角色通知使用独立 `execution-notice:` 标识,不伪造远端 A2A Task。
381
+ - `ticket_*` 是执行者任务上的任务单,存在台账里,每次改动追加一条 `ticket.*` 事件(`execution_events` 可读)。宿主用 `ticket_open/checks/review/revise/close`,人或教练用 `ticket_proposal`,执行者用 `ticket_show/ticket_mark/ticket_submit` 按正在执行的轮次操作;越权调用直接被拒绝。执行者有三条路,走同一套逻辑,事件里的 `via` 记下走的哪条:DSH 原生工具(`dsh`);DSH 给 ACP 智能体(Grok、Codex)的会话级 MCP 服务 `oneagents-review`(`mcp`);在执行者自己终端里跑的 `acp-service ticket pending|mark|submit --job ID`(`cli`,只给 jobId,按该任务当前这一轮执行)。人和教练的命令行:`acp-service ticket show|events|proposal --job ID`。角色的 `profile.json` 可以写 `training.layers`(`prompt` 必有,另可选 `skills`、`tools`、`model`)和 `training.presets`;训练 `tools` 或 `skills` 的角色不能用 ACP 预设跑 `rsi run`。
382
+ - `execution_process_requests` / `execution_process_answer` 读取和回答任务上的过程请求(执行者超出预设的工具审批、计划),和工作台页面是同一条记录;`decidedBy` 记下是人还是教练(教练写明智能体会话),`note` 写理由。命令行:`acp-service process list|answer --job ID`,在教练智能体的终端里(Claude Code)运行就记成教练。`rsi run` 等待执行者时发现待处理的过程请求,会立刻在日志里写出编号、请求内容和教练回答用的命令。
383
+ - 留痕:任务和每一轮记下 `initiatedBy`(人或教练,`acp-service` 命令按运行环境自动填写,`originSessionId` 仍是访问范围);过程请求的开单、回答和过期写入 `process.*` 事件。`acp-service trail --job <id>` 一次列出发起者、各轮配置、审批、结果摘要、验收和子任务。
384
+ - `execution_unwatch` 记下发起方不再等待任务当前这一轮(等待超时,或发起方自己出错),执行轮次本身不变。工作台把这样的任务显示为“发起方已停止等待”,列在异常里,详情页有“重新查询”按钮,向执行宿主再查一次;任务其实已经结束的,就按结束后的状态显示。`rsi run` 查询状态失败时记一行日志并继续轮询,到这一轮的时限才停止等待,停止时(以及运行中途出错时)会调用它。
385
+ - `execution_continue` 只在任务当前没有轮次在跑时接受(等待输入的轮次除外);还在跑时拒绝,因为排在后面的新轮次会让运行中那一轮的审批进不了工作台,两轮互相等。任务单已停止的任务被继续时,任务单重新打开。`execution_rewatch` 撤销 `execution_unwatch` 的记录,工作台详情页对执行失败的任务提供“继续”按钮,走同一个方法,只接受页面发起的请求;PPT 交付、报告和子任务有自己的恢复方式,不显示。`ticket_reopen` 把 stopped 的任务单放回停止前的状态。
386
+ - `acp-service rsi run --resume <运行目录>` 让中途停下的运行接着跑(执行者或质检任务没等到结束,或宿主出错;按规则停止的不行,角色改过也不行):任务还在跑就重新等,失败了就让执行者接着做,已结束就接上后面的检查和质检。任务单停止期间没能标记的那一轮不计打回次数。台账同一运行目录以最后一行为准。
381
387
 
382
388
  通用 A2A 结果完成后,账本自动生成执行轮次内的 `resultRevision`(`result-1`、`result-2`…)和 `resultDigest`,由 `execution_get` 与 `remote_agent_get` 返回。digest 是规范化 JSON 的 SHA256,覆盖结果正文、结构化回执引用、产物链接和宿主返回的文件大小/SHA256 清单 `resultArtifacts`,不包含查询时间。没有文件清单时只绑定已返回的结果与链接,不能据此声称校验了文件字节。PPT 交付保留其领域生成的版本与 digest。
383
389
 
package/dist/bin/a2a.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import fs from 'node:fs';
2
+ import { resolveCapacityDirectory } from '../src/capacity.js';
2
3
  import { serveA2AGateway } from '../src/a2a/gateway.js';
3
4
  export async function runA2ACli(args) {
4
5
  const flag = (name) => {
@@ -17,7 +18,7 @@ export async function runA2ACli(args) {
17
18
  invoke reads a JSON parameters object from stdin. Credentials stay in the
18
19
  gateway config file (chmod 600), outside tool arguments. Remote cwd is absolute.
19
20
  Methods: remote_agent_preflight, remote_agent_spawn, remote_agent_get, remote_agent_message,
20
- remote_agent_cancel, remote_agent_list, remote_agent_inbox, remote_agent_ack,
21
+ remote_agent_cancel, remote_agent_close, remote_agent_sessions, remote_agent_list, remote_agent_inbox, remote_agent_ack,
21
22
  session_bind, session_send, session_delivery_get, session_delivery_resolve,
22
23
  execution_project_scan, execution_project_list,
23
24
  execution_discovery_config_get, execution_discovery_config_update
@@ -35,6 +36,8 @@ execution targets or starting tasks. Optional interval mode runs in the gateway.
35
36
  if (process.platform !== 'win32' && (stat.mode & 0o077))
36
37
  throw new Error('Gateway config contains credentials; set chmod 600');
37
38
  const config = JSON.parse(fs.readFileSync(file, 'utf8'));
39
+ if (!config.capacityDirectory)
40
+ config.capacityDirectory = resolveCapacityDirectory();
38
41
  const host = await serveA2AGateway(config, { report: !args.includes('--no-report') });
39
42
  const registration = host.registration?.ok ?? false;
40
43
  const reason = host.registration && !host.registration.ok ? ` reason=${host.registration?.reason ?? 'unknown reason'}` : '';
@@ -48,7 +51,8 @@ execution targets or starting tasks. Optional interval mode runs in the gateway.
48
51
  }
49
52
  if (args[0] === 'invoke' && args[1] && !args[1].startsWith('--')) {
50
53
  const url = new URL('/invoke', flag('--url') ?? 'http://127.0.0.1:36814');
51
- const params = JSON.parse(fs.readFileSync(0, 'utf8'));
54
+ const { stampActor } = await import('./ticket.js');
55
+ const params = stampActor(args[1], JSON.parse(fs.readFileSync(0, 'utf8')));
52
56
  const response = await fetch(url, { method: 'POST', redirect: 'error', signal: AbortSignal.timeout(15_000),
53
57
  headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ method: args[1], params }) });
54
58
  const data = await response.json();
@@ -53,9 +53,13 @@ function printUnifiedHelp(binName) {
53
53
  .replace(/^Usage:\s+acpx/m, `Usage: ${binName}`)
54
54
  .replace(/Headless CLI client for the Agent Client Protocol/, 'Headless CLI client & DreamMate Network runtime service for the Agent Client Protocol (ACP)');
55
55
  const serverCommands = `Commands:
56
- roles sync --profile <file> Resolve current network skills into a versioned task lock
56
+ roles sync|check --profile <file> --cwd <dir> [--source <dir>] Copy role skills into <dir>/.agents/skills, link .claude/skills
57
57
  a2a gateway --config <file> Start persistent remote-agent tools and completion inbox
58
58
  a2a invoke <method> Invoke local remote-agent tools (JSON params on stdin)
59
+ rsi run --role <dir> --case <id> ... Run a role case: executor, program checks, send failures back
60
+ ticket show|events|proposal --job <id> Read a job's task ticket and its events, or settle a proposal
61
+ process list|answer --job <id> Read a job's process requests, or answer one as the coach or a person
62
+ trail --job <id> One task's record: who asked, what ran, who approved, what came out, who read it
59
63
  serve [options] Start DreamMate Network ACP runtime daemon (HTTP + WS)`;
60
64
  help = help.replace(/^Commands:/m, serverCommands);
61
65
  const serverOptions = `Options:
@@ -137,6 +141,26 @@ async function main() {
137
141
  await runA2ACli(rawArgs.slice(1));
138
142
  return;
139
143
  }
144
+ if (rawArgs[0] === 'ticket') {
145
+ const { runTicketCli } = await import('./ticket.js');
146
+ await runTicketCli(rawArgs.slice(1));
147
+ return;
148
+ }
149
+ if (rawArgs[0] === 'process') {
150
+ const { runProcessCli } = await import('./process.js');
151
+ await runProcessCli(rawArgs.slice(1));
152
+ return;
153
+ }
154
+ if (rawArgs[0] === 'trail') {
155
+ const { runTrailCli } = await import('./trail.js');
156
+ await runTrailCli(rawArgs.slice(1));
157
+ return;
158
+ }
159
+ if (rawArgs[0] === 'rsi') {
160
+ const { runRsiCli } = await import('./rsi.js');
161
+ await runRsiCli(rawArgs.slice(1));
162
+ return;
163
+ }
140
164
  const isServe = rawArgs[0] === 'serve' || rawArgs[0] === 'run';
141
165
  const hasServerExplicitFlag = rawArgs[0] === '--port' ||
142
166
  rawArgs[0] === '-p' ||
@@ -0,0 +1,4 @@
1
+ import type { WorkbenchProcessRequest } from '../src/execution/workbench.js';
2
+ /** One line per request: what was asked, its state, and the answer with who gave it and why. */
3
+ export declare function describeRequest(request: WorkbenchProcessRequest): string;
4
+ export declare function runProcessCli(argv: string[]): Promise<void>;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The coach's view of an executor's process requests (tool approvals, questions, plans) and its answer to them, the
3
+ * same record the workbench page answers. Who decided is read from the environment, as for ticket proposals.
4
+ */
5
+ import { randomUUID } from 'node:crypto';
6
+ import { parseArgs } from 'node:util';
7
+ import { gatewayInvoke } from './rsi.js';
8
+ import { settler } from './ticket.js';
9
+ const USAGE = `Usage: acp-service process list --job ID [--origin ID] [--url URL]
10
+ acp-service process answer --job ID --id REQUEST approve|reject [--note TEXT] [--stop] [--origin ID] [--url URL]
11
+
12
+ An executor's request beyond its preset (a tool approval, a question or a plan) waits on its job until
13
+ someone answers it, here or on the workbench page. Answered from a coach agent's shell (Claude Code), the
14
+ answer is recorded as the coach and its session; otherwise as a person. --note gives the reason, and
15
+ --stop rejects and cancels the task. Questions are answered on the workbench page.
16
+
17
+ Options:
18
+ --origin ID originSessionId the job was submitted under (default rsi-cli)
19
+ --url URL gateway (default http://127.0.0.1:36814)`;
20
+ const outcomes = { approve: 'approved', reject: 'rejected' };
21
+ /** One line per request: what was asked, its state, and the answer with who gave it and why. */
22
+ export function describeRequest(request) {
23
+ const asked = request.kind === 'permission' ? `工具 ${request.toolTitle}` : request.kind === 'plan' ? '计划审批'
24
+ : `提问 ${request.questions?.map(question => question.question).join(';')}`;
25
+ const answer = request.answer;
26
+ const by = answer?.decidedBy?.kind === 'coach' ? `教练 ${answer.decidedBy.agent ?? ''} ${answer.decidedBy.sessionId ?? ''}`.trim() : answer ? '人' : '';
27
+ return `${request.requestId} [${request.status}] ${asked}${answer ? ` ——${answer.outcome}(${by})${answer.note ? `:${answer.note}` : ''}` : ''}`;
28
+ }
29
+ export async function runProcessCli(argv) {
30
+ if (!argv.length || argv.includes('--help') || argv.includes('-h')) {
31
+ console.log(USAGE);
32
+ return;
33
+ }
34
+ if (argv[0] !== 'list' && argv[0] !== 'answer')
35
+ throw new Error('Unknown process command; use process --help');
36
+ const { values, positionals } = parseArgs({ args: argv.slice(1), strict: true, allowPositionals: true, options: {
37
+ job: { type: 'string' }, id: { type: 'string' }, note: { type: 'string' }, stop: { type: 'boolean', default: false },
38
+ origin: { type: 'string', default: 'rsi-cli' }, url: { type: 'string', default: 'http://127.0.0.1:36814' },
39
+ } });
40
+ if (!values.job)
41
+ throw new Error('--job is required');
42
+ const invoke = gatewayInvoke(values.url), scope = { originSessionId: values.origin, jobId: values.job };
43
+ if (argv[0] === 'list') {
44
+ const { requests } = await invoke('execution_process_requests', scope);
45
+ for (const request of requests)
46
+ console.log(describeRequest(request));
47
+ if (!requests.length)
48
+ console.log('这个任务没有过程请求');
49
+ return;
50
+ }
51
+ const outcome = outcomes[positionals[0]];
52
+ if (!values.id || !outcome || positionals.length !== 1)
53
+ throw new Error('Use: process answer --job ID --id REQUEST approve|reject [--note TEXT] [--stop]');
54
+ const answered = await invoke('execution_process_answer', { ...scope, requestId: values.id, clientRequestId: `cli:${randomUUID()}`, outcome,
55
+ ...(values.note ? { note: values.note } : {}), ...(values.stop ? { stopTask: true } : {}), decidedBy: settler() });
56
+ console.log(describeRequest(answered));
57
+ }
package/dist/bin/roles.js CHANGED
@@ -1,24 +1,27 @@
1
- /** Explicit cache administration; task execution uses the same resolver in its host. */
2
- import { randomUUID } from 'node:crypto';
3
- import { join, resolve } from 'node:path';
1
+ /** Explicit role administration: copy a role's skills into a working directory, or check what is there. No model is invoked. */
2
+ import { resolve } from 'node:path';
4
3
  import { parseArgs } from 'node:util';
5
- import { resolveRoleSkills } from '../src/roles/index.js';
4
+ import { loadRoleSkills, syncRoleSkills } from '../src/roles/index.js';
6
5
  export async function runRolesCli(argv) {
7
6
  if (!argv.length || argv.includes('--help') || argv.includes('-h')) {
8
- console.log('Usage: acp-service roles sync --profile FILE [--cache-root DIRECTORY] [--lock FILE]\n\nDefault cache: CWD/.1agents/cache/roles. A new lock resolves current revisions; an existing lock is verified and reused offline. No model is invoked.');
7
+ console.log(`Usage: acp-service roles sync --profile FILE --cwd DIRECTORY --source DIRECTORY
8
+ acp-service roles check --profile FILE --cwd DIRECTORY
9
+
10
+ sync copies the skills the profile names from SOURCE/<name> into DIRECTORY/.agents/skills (assets included), then links
11
+ DIRECTORY/.claude/skills to it for Claude Code. check only verifies and links. DSH and Codex read .agents/skills and Claude Code
12
+ reads .claude/skills when a session starts; nothing is downloaded or pinned.`);
9
13
  return;
10
14
  }
11
- if (argv[0] !== 'sync')
12
- throw new Error('Unknown roles command; use roles sync --help');
13
- const { values } = parseArgs({ args: argv.slice(1), options: {
14
- profile: { type: 'string' }, 'cache-root': { type: 'string' }, lock: { type: 'string' },
15
- }, strict: true });
16
- if (!values.profile)
17
- throw new Error('--profile is required');
18
- const cacheRoot = resolve(values['cache-root'] ?? '.1agents/cache/roles');
19
- const lockPath = resolve(values.lock ?? join(cacheRoot, 'locks', `manual-${randomUUID()}.json`));
20
- const lock = await resolveRoleSkills({ profilePath: resolve(values.profile), cacheRoot, lockPath });
21
- console.log(JSON.stringify({ roleId: lock.roleId, roleVersion: lock.roleVersion, lockPath,
22
- roleDirectory: lock.roleDirectory, entryGuidePath: lock.entryGuidePath,
23
- skills: lock.skills.map(({ key, skillId, sourceId, revision, directory }) => ({ key, skillId, sourceId, revision, directory })) }, null, 2));
15
+ const command = argv[0];
16
+ if (command !== 'sync' && command !== 'check')
17
+ throw new Error('Unknown roles command; use roles --help');
18
+ const { values } = parseArgs({ args: argv.slice(1), options: { profile: { type: 'string' }, cwd: { type: 'string' }, source: { type: 'string' } }, strict: true });
19
+ if (!values.profile || !values.cwd)
20
+ throw new Error('--profile and --cwd are required');
21
+ if (command === 'sync' && !values.source)
22
+ throw new Error('--source is required');
23
+ const profilePath = resolve(values.profile), cwd = resolve(values.cwd);
24
+ const loaded = command === 'sync' ? await syncRoleSkills({ profilePath, cwd, source: resolve(values.source) }) : await loadRoleSkills({ profilePath, cwd });
25
+ console.log(JSON.stringify({ roleId: loaded.roleId, roleVersion: loaded.roleVersion, cwd, entryGuidePath: loaded.entryGuidePath,
26
+ skills: loaded.skills.map(({ key, name, directory }) => ({ key, name, directory })) }, null, 2));
24
27
  }
@@ -0,0 +1,3 @@
1
+ /** Calls methods on the local gateway's /invoke route. */
2
+ export declare function gatewayInvoke(url: string): (method: string, params: Record<string, unknown>) => Promise<Record<string, unknown>>;
3
+ export declare function runRsiCli(argv: string[]): Promise<void>;
@@ -0,0 +1,114 @@
1
+ /** Coach-facing runs of a role's cases through the local A2A gateway. Publishing and acceptance stay on the workbench page. */
2
+ import { resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { parseArgs } from 'node:util';
5
+ import { checkGate } from '../src/rsi/gate.js';
6
+ import { runOutlineCase } from '../src/rsi/outline-run.js';
7
+ import { stampActor } from './ticket.js';
8
+ const USAGE = `Usage: acp-service rsi run --role DIR --case ID --project REPO [options]
9
+ acp-service rsi gate --role DIR [--workspace DIR] [--required N] [--url URL]
10
+
11
+ Runs one case of a product-intro outline role: exports the pinned commit, dispatches the
12
+ executor, runs the role's program checks and sends failures back to the same session.
13
+ With --qa, a QA agent then reviews each outline that passes the checks in its own session
14
+ against the role's QA.md, and its issues go back to the executor. Each run is appended to
15
+ the role's ledger.jsonl in the workspace. The task ticket lives on the executor's job in the gateway;
16
+ the run directory's ticket.json is a read-only export (see acp-service ticket --help).
17
+
18
+ A run that stopped partway (the task timed out or failed, QA did not finish, the host failed) goes on
19
+ with --resume and its run directory, with the same options; --project is then not needed. The ticket
20
+ reopens where it stood, a task still running is waited on again, and a failed one is told to go on.
21
+
22
+ rsi gate reads the ledger and says whether the committed role version may leave development:
23
+ N development runs in a row passed (default 2), each first draft passed the program checks,
24
+ QA left no must-fix issue, and every proposal to codify a check or change a locked item has
25
+ been settled on the ticket (acp-service ticket proposal). Runs whose executor or QA task did
26
+ not finish are not counted.
27
+
28
+ Options:
29
+ --target ID agent_host target on the gateway (default legacy:ppt-beautifier)
30
+ --preset ID DSH agent preset for the executor (default standard)
31
+ --origin ID originSessionId for the tasks (default rsi-cli)
32
+ --workspace DIR where run directories go (default .1agents/runtime/rsi)
33
+ --url URL gateway (default http://127.0.0.1:36814)
34
+ --max-bounces N times a failed check goes back (default 1)
35
+ --timeout-minutes N how long to wait on each task, an executor round or a QA review (default 60)
36
+ --python PATH interpreter with jsonschema for the checks (default python3)
37
+ --qa add the QA agent review after the program checks
38
+ --qa-preset ID DSH agent preset for the QA agent (default: the executor's)
39
+ --qa-max-revisions N times QA issues go back to the executor (default 3)
40
+ --phase dev|test test needs a committed role directory, --qa and an open gate (default dev)
41
+ --resume DIR go on with the run recorded in this run directory`;
42
+ /** Calls methods on the local gateway's /invoke route. */
43
+ export function gatewayInvoke(url) {
44
+ const endpoint = new URL('/invoke', url);
45
+ return async (method, params) => {
46
+ const response = await fetch(endpoint, { method: 'POST', redirect: 'error', signal: AbortSignal.timeout(60_000),
47
+ headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ method, params: stampActor(method, params) }) });
48
+ const data = await response.json();
49
+ if (!response.ok)
50
+ throw new Error(`${method} failed: ${String(data.error ?? response.status)}`);
51
+ return data;
52
+ };
53
+ }
54
+ export async function runRsiCli(argv) {
55
+ if (!argv.length || argv.includes('--help') || argv.includes('-h')) {
56
+ console.log(USAGE);
57
+ return;
58
+ }
59
+ if (argv[0] === 'gate')
60
+ return runGate(argv.slice(1));
61
+ if (argv[0] !== 'run')
62
+ throw new Error('Unknown rsi command; use rsi --help');
63
+ const { values } = parseArgs({ args: argv.slice(1), strict: true, options: {
64
+ role: { type: 'string' }, case: { type: 'string' }, project: { type: 'string' },
65
+ target: { type: 'string', default: 'legacy:ppt-beautifier' }, preset: { type: 'string', default: 'standard' },
66
+ origin: { type: 'string', default: 'rsi-cli' }, workspace: { type: 'string', default: '.1agents/runtime/rsi' },
67
+ url: { type: 'string', default: 'http://127.0.0.1:36814' }, 'max-bounces': { type: 'string', default: '1' },
68
+ 'timeout-minutes': { type: 'string', default: '60' }, python: { type: 'string', default: 'python3' },
69
+ qa: { type: 'boolean', default: false }, 'qa-preset': { type: 'string' }, 'qa-max-revisions': { type: 'string', default: '3' },
70
+ phase: { type: 'string', default: 'dev' }, resume: { type: 'string' },
71
+ } });
72
+ if (!values.role || !values.case || (!values.project && !values.resume))
73
+ throw new Error('--role, --case and --project are required (--project not with --resume)');
74
+ if (values.phase !== 'dev' && values.phase !== 'test')
75
+ throw new Error('--phase is dev or test');
76
+ if (values.phase === 'test') {
77
+ const gate = await checkGate({ roleDirectory: resolve(values.role), workspace: resolve(values.workspace), invoke: gatewayInvoke(values.url) });
78
+ if (!gate.ready)
79
+ throw new Error(`The role has not left development yet:\n- ${gate.reasons.join('\n- ')}`);
80
+ }
81
+ const invoke = gatewayInvoke(values.url);
82
+ const report = await runOutlineCase({ roleDirectory: resolve(values.role), caseId: values.case, projectPath: resolve(values.project ?? '.'),
83
+ ...(values.resume ? { resume: resolve(values.resume) } : {}),
84
+ workspace: resolve(values.workspace), phase: values.phase, targetId: values.target, agentPreset: values.preset, originSessionId: values.origin,
85
+ maxBounces: Number(values['max-bounces']), timeoutMs: Number(values['timeout-minutes']) * 60_000, python: values.python,
86
+ ...(values.qa ? { qa: { ...(values['qa-preset'] ? { agentPreset: values['qa-preset'] } : {}), maxRevisions: Number(values['qa-max-revisions']) } } : {}),
87
+ cli: { command: `${process.execPath} ${fileURLToPath(new URL('./acp-service.js', import.meta.url))}`, url: values.url },
88
+ invoke, log: line => console.log(line) });
89
+ console.log(`${report.passed ? '通过' : '未通过'}(${report.stopReason}):${report.rounds.length} 轮,大纲 ${report.outlinePath},记录 ${report.workDirectory}/run.json`);
90
+ if (!report.passed)
91
+ process.exitCode = 1;
92
+ }
93
+ async function runGate(argv) {
94
+ const { values } = parseArgs({ args: argv, strict: true, options: {
95
+ role: { type: 'string' }, workspace: { type: 'string', default: '.1agents/runtime/rsi' }, required: { type: 'string', default: '2' },
96
+ url: { type: 'string', default: 'http://127.0.0.1:36814' },
97
+ } });
98
+ if (!values.role)
99
+ throw new Error('--role is required');
100
+ const gate = await checkGate({ roleDirectory: resolve(values.role), workspace: resolve(values.workspace), required: Number(values.required),
101
+ invoke: gatewayInvoke(values.url) });
102
+ console.log(`角色 ${gate.roleId},版本 ${gate.role.commit?.slice(0, 8) ?? '未提交'}${gate.role.commit && gate.role.dirty ? '(有未提交的改动)' : ''}`);
103
+ for (const run of gate.devRuns) {
104
+ const totals = run.scores.map(scores => Object.values(scores).reduce((sum, score) => sum + score, 0)).join('→');
105
+ console.log(` 开发 ${run.startedAt} ${run.caseId}:${run.passed ? '通过' : '未通过'}(${run.stopReason}),打回 ${run.bounces},修改 ${run.revisions},总分 ${totals || '无'}`);
106
+ }
107
+ if (gate.unfinished.length)
108
+ console.log(` 另有 ${gate.unfinished.length} 次运行没跑完(${gate.unfinished.map(run => `${run.startedAt} ${run.stopReason}`).join('、')}),不计入`);
109
+ console.log(gate.ready ? '可以进入测试。' : `还不能进入测试:\n- ${gate.reasons.join('\n- ')}`);
110
+ for (const kase of gate.testCases)
111
+ console.log(` 测试 ${kase.caseId}(${kase.kind === 'original' ? '原题' : '变体题'}):${{ passed: '通过', failed: '未通过', not_run: '未跑' }[kase.result]}`);
112
+ if (!gate.ready)
113
+ process.exitCode = 1;
114
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Who settles a proposal, read from the environment the command runs in rather than from a flag: a coach agent's
3
+ * harness marks its own shell with the session it runs in (Claude Code sets CLAUDECODE and CLAUDE_CODE_SESSION_ID);
4
+ * anyone else is a person. Like the executor's tools, this does not defend against a caller faking that environment.
5
+ */
6
+ export declare function settler(env?: NodeJS.ProcessEnv): {
7
+ kind: 'person' | 'coach';
8
+ agent?: string;
9
+ sessionId?: string;
10
+ };
11
+ /** Names the caller on the calls that start work or record a verdict, unless it already named itself. */
12
+ export declare function stampActor(method: string, params: Record<string, unknown>, env?: NodeJS.ProcessEnv): Record<string, unknown>;
13
+ export declare function runTicketCli(argv: string[]): Promise<void>;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * People's and the coach's view of a task ticket on the gateway and their one change, settling a proposal; and the
3
+ * executor's three operations for an agent that has a shell but neither the DSH tools nor the MCP server.
4
+ */
5
+ import { parseArgs } from 'node:util';
6
+ import { runExecutorTicket } from '../src/execution/ticket-executor.js';
7
+ import { gatewayInvoke } from './rsi.js';
8
+ const USAGE = `Usage: acp-service ticket show --job ID [--origin ID] [--url URL]
9
+ acp-service ticket events --job ID [--origin ID] [--url URL]
10
+ acp-service ticket proposal --job ID --id R1-2 accept|reject|done [--note TEXT] [--origin ID] [--url URL]
11
+
12
+ The executor, from its own shell while its round is running:
13
+ acp-service ticket pending --job ID [--url URL]
14
+ acp-service ticket mark --job ID --id Q1-3 --state done|disputed --note TEXT [--url URL]
15
+ acp-service ticket submit --job ID [--url URL]
16
+
17
+ The task ticket lives on the executor's job in the gateway's execution ledger; every change is a
18
+ ticket.* event. The job ID is the executor's jobId in the run's run.json. The executor's commands
19
+ act for the job's current round, the same operations as its ticket_show, ticket_mark and
20
+ ticket_submit tools, and are recorded as coming from the CLI.
21
+
22
+ Options:
23
+ --origin ID originSessionId the job was submitted under (default rsi-cli)
24
+ --url URL gateway (default http://127.0.0.1:36814)`;
25
+ const states = { accept: 'accepted', reject: 'rejected', done: 'done' };
26
+ /**
27
+ * Who settles a proposal, read from the environment the command runs in rather than from a flag: a coach agent's
28
+ * harness marks its own shell with the session it runs in (Claude Code sets CLAUDECODE and CLAUDE_CODE_SESSION_ID);
29
+ * anyone else is a person. Like the executor's tools, this does not defend against a caller faking that environment.
30
+ */
31
+ export function settler(env = process.env) {
32
+ if (env.CLAUDECODE === '1' && env.CLAUDE_CODE_SESSION_ID)
33
+ return { kind: 'coach', agent: 'claude-code', sessionId: env.CLAUDE_CODE_SESSION_ID };
34
+ return { kind: 'person' };
35
+ }
36
+ /** Names the caller on the calls that start work or record a verdict, unless it already named itself. */
37
+ export function stampActor(method, params, env = process.env) {
38
+ if (['execution_submit', 'execution_continue', 'remote_agent_spawn', 'remote_agent_message'].includes(method) && !params.initiatedBy)
39
+ return { ...params, initiatedBy: settler(env) };
40
+ if (method === 'execution_review' && !params.decidedBy)
41
+ return { ...params, decidedBy: settler(env) };
42
+ return params;
43
+ }
44
+ export async function runTicketCli(argv) {
45
+ if (!argv.length || argv.includes('--help') || argv.includes('-h')) {
46
+ console.log(USAGE);
47
+ return;
48
+ }
49
+ if (!['show', 'events', 'proposal', 'pending', 'mark', 'submit'].includes(argv[0]))
50
+ throw new Error('Unknown ticket command; use ticket --help');
51
+ const { values, positionals } = parseArgs({ args: argv.slice(1), strict: true, allowPositionals: true, options: {
52
+ job: { type: 'string' }, id: { type: 'string' }, note: { type: 'string' }, state: { type: 'string' },
53
+ origin: { type: 'string', default: 'rsi-cli' }, url: { type: 'string', default: 'http://127.0.0.1:36814' },
54
+ } });
55
+ if (!values.job)
56
+ throw new Error('--job is required');
57
+ const invoke = gatewayInvoke(values.url), scope = { originSessionId: values.origin, jobId: values.job };
58
+ if (argv[0] === 'pending' || argv[0] === 'mark' || argv[0] === 'submit') {
59
+ if (argv[0] === 'mark' && (!values.id || !values.state || values.note === undefined))
60
+ throw new Error('Use: ticket mark --job ID --id Q1-3 --state done|disputed --note TEXT');
61
+ const result = await runExecutorTicket(invoke, { jobId: values.job }, 'cli', argv[0] === 'pending' ? 'ticket_show' : `ticket_${argv[0]}`, { id: values.id, state: values.state, note: values.note });
62
+ console.log(result.text);
63
+ if (result.refused)
64
+ process.exitCode = 1;
65
+ return;
66
+ }
67
+ if (argv[0] === 'show')
68
+ return print(await invoke('ticket_get', scope));
69
+ if (argv[0] === 'events') {
70
+ for (let after = 0;;) {
71
+ const page = await invoke('execution_events', { ...scope, afterSequence: after, limit: 500 });
72
+ for (const event of page.events.filter(item => item.type.startsWith('ticket.'))) {
73
+ const { actor, round, itemId, proposalId, state, note } = event.data ?? {};
74
+ console.log([event.sequence, event.observedAt, event.type, actor, `第 ${String(round)} 轮`, itemId ?? proposalId, state, note].filter(part => part !== undefined).join(' '));
75
+ }
76
+ if (!page.hasMore || !page.events.length)
77
+ return;
78
+ after = page.events.at(-1).sequence;
79
+ }
80
+ }
81
+ const state = states[positionals[0]];
82
+ if (!values.id || !state || positionals.length !== 1)
83
+ throw new Error('Use: ticket proposal --job ID --id R1-2 accept|reject|done [--note TEXT]');
84
+ print(await invoke('ticket_proposal', { ...scope, proposalId: values.id, state, ...(values.note ? { note: values.note } : {}), by: settler() }));
85
+ }
86
+ function print(ticket) {
87
+ console.log(`任务单 ${ticket.roleId} / ${ticket.caseId}:${ticket.status}${ticket.stopReason ? `(${ticket.stopReason})` : ''},第 ${ticket.round} 轮`);
88
+ for (const item of ticket.items) {
89
+ console.log(` ${item.id} [${item.severity === 'must' ? '必须改' : '建议改'}] ${item.state} ${item.where}:${item.problem}`);
90
+ for (const entry of item.log)
91
+ console.log(` 第 ${entry.round} 轮 ${entry.by} ${entry.action}${entry.note ? `:${entry.note}` : ''}`);
92
+ }
93
+ for (const proposal of ticket.proposals) {
94
+ const by = proposal.by ? `(${proposal.by.kind === 'coach' ? `教练 ${proposal.by.agent ?? ''} ${proposal.by.sessionId ?? ''}`.trim() : '人'})` : '';
95
+ console.log(` ${proposal.id} 提议(${proposal.kind})${proposal.state}${by}:${proposal.text}${proposal.note ? ` ——${proposal.note}` : ''}`);
96
+ }
97
+ }
@@ -0,0 +1,4 @@
1
+ import type { LedgerEvent, LedgerJobView } from '../src/execution/ledger.js';
2
+ import type { WorkbenchProcessRequest } from '../src/execution/workbench.js';
3
+ export declare function describeTrail(job: LedgerJobView, requests: WorkbenchProcessRequest[], events: LedgerEvent[]): string;
4
+ export declare function runTrailCli(argv: string[]): Promise<void>;
@@ -0,0 +1,62 @@
1
+ /** One task's record from one query: who asked, what ran, who approved what, what came out, who read it. */
2
+ import { parseArgs } from 'node:util';
3
+ import { gatewayInvoke } from './rsi.js';
4
+ const USAGE = `Usage: acp-service trail --job ID [--origin ID] [--url URL]
5
+
6
+ Prints the record of one task. --origin is the session that started it (default rsi-cli);
7
+ --url is the gateway (default http://127.0.0.1:36814).`;
8
+ const actor = (by) => !by ? '未记录' : by.kind === 'person' ? '人' : `教练 ${[by.agent, by.sessionId].filter(Boolean).join(' ')}`;
9
+ export function describeTrail(job, requests, events) {
10
+ const lines = [`${job.title ?? job.jobId}(${job.executionStatus})`, `任务:${job.jobId}`,
11
+ `发起:${actor(job.initiatedBy)}(来源 ${job.originSessionId})`];
12
+ if (job.parentJobRef)
13
+ lines.push(`上级任务:${job.parentJobRef.jobId}${job.purpose ? `(${job.purpose})` : ''}`);
14
+ lines.push('', `执行(${job.attempts.length} 轮):`);
15
+ for (const attempt of job.attempts) {
16
+ const { remote, agentPreset, cwd } = attempt.targetSnapshot;
17
+ lines.push(`- ${attempt.attemptId} ${attempt.executionStatus},${[attempt.targetId, remote, agentPreset, cwd].filter(Boolean).join(' · ')},发起:${actor(attempt.initiatedBy)}`);
18
+ if (attempt.result?.resultRevision)
19
+ lines.push(` 结果 ${attempt.result.resultRevision},摘要 ${attempt.result.resultDigest ?? '无'}`);
20
+ }
21
+ lines.push('', `过程审批(${requests.length} 条):`);
22
+ for (const { requestId, kind, toolTitle, status, answer } of requests) {
23
+ lines.push(`- ${requestId} ${toolTitle ?? kind}:${answer ? `${answer.outcome},${actor(answer.decidedBy)}${answer.note ? `:${answer.note}` : ''}` : status}`);
24
+ }
25
+ lines.push('', `验收(${job.acceptanceHistory.length} 条):`);
26
+ for (const item of job.acceptanceHistory) {
27
+ lines.push(`- ${item.recordedAt} ${item.reviewStatus},${actor(item.decidedBy)},结果 ${item.resultRevision}${item.note ? `:${item.note}` : ''}`);
28
+ }
29
+ if (job.children.length) {
30
+ lines.push('', `子任务(${job.children.length} 个):`);
31
+ for (const child of job.children)
32
+ lines.push(`- ${child.jobId} ${child.executionStatus}${child.purpose ? `(${child.purpose})` : ''} ${child.title ?? ''}`.trimEnd());
33
+ }
34
+ lines.push('', `事件(${events.length} 条):`);
35
+ for (const event of events)
36
+ lines.push(`- ${event.observedAt} ${event.type}`);
37
+ return lines.join('\n');
38
+ }
39
+ export async function runTrailCli(argv) {
40
+ if (argv.includes('--help') || argv.includes('-h')) {
41
+ console.log(USAGE);
42
+ return;
43
+ }
44
+ const { values } = parseArgs({ args: argv, strict: true, options: {
45
+ job: { type: 'string' }, origin: { type: 'string', default: 'rsi-cli' }, url: { type: 'string', default: 'http://127.0.0.1:36814' },
46
+ } });
47
+ if (!values.job)
48
+ throw new Error('--job is required');
49
+ const invoke = gatewayInvoke(values.url), scope = { originSessionId: values.origin, jobId: values.job };
50
+ const job = await invoke('execution_get', scope);
51
+ // A gateway without a workbench has no process requests to read.
52
+ const { requests = [] } = await invoke('execution_process_requests', scope).catch(() => ({}));
53
+ const events = [];
54
+ for (let afterSequence;;) {
55
+ const page = await invoke('execution_events', { ...scope, limit: 500, ...(afterSequence === undefined ? {} : { afterSequence }) });
56
+ events.push(...page.events);
57
+ if (!page.hasMore)
58
+ break;
59
+ afterSequence = page.nextSequence;
60
+ }
61
+ console.log(describeTrail(job, requests, events));
62
+ }
@@ -0,0 +1,9 @@
1
+ import type { A2AVerifiedArtifact } from './result-metadata.js';
2
+ export declare const ARTIFACT_CONTENT_LIMIT: number;
3
+ export declare class ArtifactContentError extends Error {
4
+ readonly status: 404 | 409 | 413;
5
+ readonly code: string;
6
+ constructor(status: 404 | 409 | 413, code: string);
7
+ }
8
+ /** The bytes must still match the receipt: a file edited or swapped after verification is refused, not served. */
9
+ export declare function readVerifiedArtifact(artifacts: A2AVerifiedArtifact[], path: string, sha256: string): Promise<Buffer>;