@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1agents/acp-service",
3
- "version": "0.9.0",
4
- "description": "ACP runtime, CLI, HTTP/WebSocket service and DeepSeek Harness ACP/A2A plugins in one package.",
3
+ "version": "0.10.0",
4
+ "description": "agent-workflow ACP runtime, CLI, HTTP/WebSocket service and DeepSeek Harness ACP/A2A plugins in one package. Part of 一芥天地 (DreamMate World).",
5
5
  "keywords": [
6
6
  "dreammate",
7
7
  "acp",
@@ -12,9 +12,13 @@
12
12
  "a2a"
13
13
  ],
14
14
  "license": "MIT",
15
+ "homepage": "https://scottzx.github.io/agent-workflow/",
16
+ "bugs": {
17
+ "url": "https://github.com/scottzx/agent-workflow/issues"
18
+ },
15
19
  "repository": {
16
20
  "type": "git",
17
- "url": "git+https://github.com/scottzx/1acp.git",
21
+ "url": "git+https://github.com/scottzx/agent-workflow.git",
18
22
  "directory": "packages/service"
19
23
  },
20
24
  "publishConfig": {
@@ -90,16 +94,20 @@
90
94
  "@agentclientprotocol/sdk": "1.4.0",
91
95
  "@openclaw/fs-safe": "^0.26.7",
92
96
  "commander": "^15.0.0",
97
+ "dsh-zod": "npm:zod@4.4.3",
93
98
  "skillflag": "^0.2.1",
94
99
  "tsx": "^4.23.15",
95
100
  "ws": "^8.18.0",
96
- "zod": "^4.6.5",
97
- "dsh-zod": "npm:zod@4.4.3"
101
+ "zod": "^4.6.5"
98
102
  },
99
103
  "devDependencies": {
104
+ "@1agents/chat-view": "0.1.0",
105
+ "@1agents/file-preview": "0.1.0",
100
106
  "@scottzx/1acp": "0.16.0",
101
107
  "@types/node": "^22.10.2",
102
108
  "@types/ws": "^8.5.14",
109
+ "esbuild": "0.28.2",
110
+ "preact": "10.29.2",
103
111
  "typescript": "^5.7.2"
104
112
  },
105
113
  "dsh": {
@@ -114,13 +122,16 @@
114
122
  "@deepseek-ai/dsh-client-ui-chat",
115
123
  "@deepseek-ai/dsh-client-ui-tool",
116
124
  "@deepseek-ai/dsh-client-locale",
117
- "@deepseek-ai/dsh-api-remotes"
125
+ "@deepseek-ai/dsh-api-remotes",
126
+ "@deepseek-ai/dsh-client-ui-layout",
127
+ "@deepseek-ai/dsh-client-ui-sidebar",
128
+ "@deepseek-ai/dsh-client-ui-workspace"
118
129
  ]
119
130
  }
120
131
  },
121
132
  "scripts": {
122
- "build": "node ../../scripts/embed-runtime.mjs && tsc -p tsconfig.build.json",
123
- "typecheck": "tsc -p tsconfig.json --noEmit",
133
+ "build": "node ../../scripts/embed-runtime.mjs && tsc -p tsconfig.build.json && node workbench-ui/build.mjs",
134
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p workbench-ui/tsconfig.json",
124
135
  "test": "npm run build && npm run test:only",
125
136
  "start": "tsx bin/acp-service.ts",
126
137
  "test:only": "node --import tsx --test test/*.test.ts"
@@ -5,6 +5,8 @@ description: 使用 @1agents/acp-service 管理 ACP 会话与 DSH 插件,通
5
5
 
6
6
  # ACP Service
7
7
 
8
+ 本技能属于 **agent-workflow**(一芥天地 / DreamMate World,一芥智能)。npm 包名仍是 `@1agents/acp-service`,命令名仍是 `acp-service`。
9
+
8
10
  `@1agents/acp-service` 将 Agent runtime、CLI、ACP 服务、DSH 插件和 A2A 实现打进同一个 npm 包。原生 Agent 的可执行文件、登录凭据和模型配置由执行主机提供。
9
11
 
10
12
  ## 选择调用入口
@@ -53,7 +55,7 @@ acp-service --skill install acp-service --agent codex --scope repo
53
55
 
54
56
  ## 异步调用纪律
55
57
 
56
- 常驻角色可由宿主按能力网络加载并锁定技能版本。任务使用宿主回执中的角色/技能锁与缓存入口,不在主会话另行检索、下载或复验;同一任务续派沿用原锁。更新与缓存管理在派单前的独立部署阶段完成,详见项目 `.1agents/README.md`;`acp-service roles sync --help` 可查看显式缓存入口。
58
+ 常驻角色的技能放在其工作目录的 `.agents/skills/`(Claude Code 经 `.claude/skills` 软链读取),由 DSH、Codex 或 Claude Code 在会话开始时自行加载;宿主只在第一条消息前加角色说明和技能指南路径。不再有技能锁,续派读目录当前内容。技能的复制与更新在派单前的独立阶段用 `acp-service roles sync` 完成,详见项目 `.1agents/README.md`。
57
59
 
58
60
  开发、部署与回归先独立完成。所有任务提交并保存回执后必须立即结束本轮;只有实际通知唤醒后才单次读取回执、记录结论、ack 并答复。禁止主会话主动轮询 get/list/inbox、sleep/wait 等完成、读取子会话日志/进程,或重复文件/hash/图像/事实验收。用户明确要求单次查询/取消时只执行该动作;受理未知不自动重派。此纪律限定主会话调用,不关闭后台网关的状态核对能力。
59
61
 
@@ -90,7 +92,7 @@ acp-service --skill install acp-service --agent codex --scope repo
90
92
  | `agentPreset` | 选择 DSH Agent 的组成;gateway 可省略并使用远端 A2A 默认值 |
91
93
  | 标准 DSH 模型 | `standard` 使用该 DSH 部署的默认 provider/model,不固定为某一厂商 |
92
94
  | ACP Agent 模型/模式 | 由原生 Agent 提供,通过其公布的配置选项或模式切换 |
93
- | A2A `modelId` / `modeId` | 当前 spawn 和 `metadata.1agents` **没有这些参数**;不能凭空传入或把模型名称写进 prompt 当作配置 |
95
+ | A2A `modelId` / `modeId` | spawn 和 `metadata.1agents` 没有这些参数。模型名称写进 prompt 不会改 ACP 配置。试跑时在 DSH 的 ACP 设置里被该 Agent 接受的值,按工作区和 Agent 记在插件里,之后该 Agent 的新建会话会自动回放 |
94
96
 
95
97
  例如某部署默认配置为 `minimax-cn / MiniMax-M3` 时,`standard` 会调用它。应读取 DSH 模型目录/配置,并用会话实际请求记录中的 provider/model 核对;Agent 自述身份不足以证明模型路由。
96
98
 
@@ -59,6 +59,8 @@ acp-service a2a gateway --config /absolute/private/gateway.json
59
59
  curl http://127.0.0.1:36814/health
60
60
  ```
61
61
 
62
+ CLI 启动时若配置没有 `capacityDirectory`,`/health` 读取本机 ACP 容量目录,并给出 `taskSlot` 与 `processSlot`。`processSlot.headWaitMs` 是进程名额 FIFO 队首已等的毫秒数。直接调用库且未传该目录时,健康检查不读取家目录里的容量账。
63
+
62
64
  Unix 上 CLI 校验配置权限。gateway 工具端口固定监听 `127.0.0.1`,默认 `36814`;省略 `--no-report` 会向本机 DreamMate node 注册 `a2a-gateway`。不用 DreamMate 时加 `--no-report`,通过 CLI 使用。凭据仅保存在配置中,不传入任务参数。
63
65
 
64
66
  callback 可选;不配置也会由后台 GetTask 查询补齐状态。需要 push 时增加:
@@ -83,10 +85,12 @@ DreamMate 调用参数为 `service_id: "a2a-gateway"`、`method: 方法名`、`p
83
85
  | 方法 | 参数与用途 |
84
86
  | --- | --- |
85
87
  | `remote_agent_preflight` | `remote, originSessionId, cwd`;可选任务目录、必需输入和运行时依赖,仅检查、不创建会话 |
86
- | `remote_agent_spawn` | 必填 `remote, originSessionId, cwd, prompt`;可选 `agentPreset, title, notificationTarget, preflight, resultContract, clientRequestId, roleId, roleLockPath`;新建远端任务/上下文/DSH 会话 |
87
- | `remote_agent_get` | `remote, originSessionId, taskId`;当前状态、结果;离线返回缓存与 stale |
88
- | `remote_agent_message` | 上述任务定位字段加 `prompt`;可选 `clientRequestId, preflight, resultContract, roleId, roleLockPath`;复用远端会话,创建新 taskId;已有角色/锁不能更换 |
89
- | `remote_agent_cancel` | 任务定位字段;取消这项任务自己的执行 |
88
+ | `remote_agent_spawn` | 必填 `remote, originSessionId, cwd, prompt`;可选 `agentPreset, title, notificationTarget, preflight, resultContract, clientRequestId, roleId, lifecycle, provider, model`;新建远端任务/上下文/DSH 会话。省略 `lifecycle` 为 one-shot(2026-10-31 起)。`provider`、`model` 见下文「standard 选模型」 |
89
+ | `remote_agent_get` | `remote, originSessionId, taskId`;当前状态、结果;离线返回缓存与 stale。进程名额排队时仍是 submitted,并带 `capacity`、`taskSlot` 和 `processSlot`。指定过模型的 `standard` 任务带实际使用的 `provider`、`model` |
90
+ | `remote_agent_message` | 上述任务定位字段加 `prompt`;可选 `clientRequestId, preflight, resultContract, roleId, autoResume, lifecycle, provider, model`;复用远端会话,创建新 taskId;已有角色不能更换。已关闭会话默认接回,get 返回 `resumed: true`。`historyReplayed` 只说明宿主有没有把历史重新推给它的客户端(`session/load` 推,导入会话的 `session/resume` 不推),两者都是同一种接回。`autoResume: false` 不向远端发送,返回 `SESSION_CLOSED` |
91
+ | `remote_agent_cancel` | 任务定位字段;只取消这项任务自己的执行,不能释放已经完成的会话进程 |
92
+ | `remote_agent_close` | `remote, originSessionId`,以及 `taskId`、`contextId`、`sessionId` 三选一;可选 `force`。普通关闭 ACP 进程,保留会话记录和绑定,不删除。进行中返回 `SESSION_BUSY`;`force: true` 先取消再关闭。宿主没有关闭能力时返回 `UNSUPPORTED`,且不把任务记成已关闭。`standard` 不发送 `session/close`。可选 `mode: "delete"` 还删除 ACP 会话记录,之后 message 返回 `SESSION_DELETED`;仅在网关 `sessionLifecycle.allowDelete: true` 时接受,否则返回 `DELETE_DISABLED`。不删 DSH 会话历史 |
93
+ | `remote_agent_sessions` | 无业务参数。按 `prewarm`、`job`、`user-opened` 和未标注列进程租约,并给出两本账。只读,不关闭,也不给已经在跑且没有来源的进程补标签 |
90
94
  | `remote_agent_list` | `originSessionId`;列出该主会话派发的任务 |
91
95
  | `remote_agent_inbox` | `originSessionId`;读取未确认的完成/需要输入通知 |
92
96
  | `remote_agent_ack` | `originSessionId, noticeId`;确认已处理,重复确认安全 |
@@ -119,7 +123,13 @@ acp-service a2a invoke remote_agent_ack <<'JSON'
119
123
  JSON
120
124
  ```
121
125
 
122
- 每次 spawn 都创建新会话,即使 cwd 相同。message 复用原 context/cwd/preset,创建新任务;可排队,但不是对当前轮的原生 interrupt/steer。`remote_agent_*` 没有 `modelId`、`modeId` 或显式恢复任意 DSH session ID 的参数。投递到已存在的主会话使用下面新增的 `session_*` 工具,两类 API 的任务 ID 和会话 ID 不可混用。
126
+ 每次 spawn 都创建新会话,即使 cwd 相同。这次新会话会回放该工作区、该 Agent 在 ACP 设置里已经接受的模式和配置;Grok Build 与 Codex 的记录各自保存。message 复用原 context/cwd/preset 和原会话上的设置,创建新任务;可排队,但不是对当前轮的原生 interrupt/steer。未传 `lifecycle` 时 message 沿用原会话策略。`remote_agent_*` 没有 `modelId`、`modeId` 或显式恢复任意 DSH session ID 的参数。
127
+
128
+ **standard 选模型。** `provider` 和 `model` 只用于 `standard` 等 DSH 原生预设,必须一起传,例如 `"provider": "deepseek", "model": "<目录里的模型 id>"`。DSH 新建会话后、第一条 prompt 前,按 `modelCatalog()` 核对,再调用 `selectModel`。目录里没有时任务失败,`resultMetadata.validation.code` 为 `MODEL_UNAVAILABLE`,不退回默认模型,也不发 prompt。省略时用 DSH 当时的默认模型,get 不带这两个字段。message 不传时沿用该会话已选的模型,传了就在本轮前切换。`oneagents-acp-*` 预设传这两个字段会被拒绝(宿主侧为 `MODEL_SELECTION_UNSUPPORTED`),它们的模型由 Agent 自己公布,经 `session/set_config_option` 切换。get 与 `resultMetadata` 写出实际使用的 `provider`、`model`。不要把模型名写进 prompt,那不会改会话模型。注意:DSH 的 `selectModel` 同时把这次选择存成 DSH 的默认模型,之后不指定模型的新会话(包括 DSH 界面里新开的)会用它。投递到已存在的主会话使用下面新增的 `session_*` 工具,两类 API 的任务 ID 和会话 ID 不可混用。
129
+
130
+ `lifecycle` 省略或 `mode: "one-shot"` 时,任务完成、失败或取消后由网关普通关闭进程,之后 message 经 `session/load` 接回;2026-10-31 之前保存、没有 lifecycle 的旧任务仍按 persistent。`closeAfter: "ack"` 要等这条通知被 ack。`INPUT_REQUIRED` 不关闭。one-shot 在 runtime 里仍调用 `ensureSession({ mode: "persistent" })`,关闭只 release,不 delete,也不改 runtime 模式。`remote_agent_get` 在进程名额排队时仍是 submitted,并带 `capacity.position` 与 `capacity.waitedMs`;60 秒握手时限从出队之后才开始计。本技能不保证模型在进程关闭后仍记得上文。
131
+
132
+ persistent 要显式传 `lifecycle: { "mode": "persistent" }`。这类 `oneagents-acp-*` 会话在最后一轮结束、远端 `status` 确认已附着且没有进行中的回合,并且空闲超过时限后,由网关普通关闭,原因 `idle-ttl`,之后 message 仍可接回。时限缺省取网关配置 `sessionLifecycle.persistentIdleTtlSeconds`(600 秒),`lifecycle.idleTtlSeconds` 覆盖它,`0` 不回收。进行中、`INPUT_REQUIRED`、状态查不到的不关。`INPUT_REQUIRED` 超过 `sessionLifecycle.inputRequiredAlertSeconds`(7200 秒)只告警,不关进程。`/health` 的 `sessions` 给出 busy、告警、按原因的关闭数、接回次数 `resumes`、关闭失败数和 `processReleasePending`。
123
133
 
124
134
  ## 原会话排队投递(本次新增)
125
135
 
@@ -185,7 +195,7 @@ notice 继续保留在 inbox;主 Agent 真正处理结果后才调用 `remote_
185
195
 
186
196
  响应在 `result.task`,包含 `id`、`contextId` 和已有的 `metadata.1agents.sessionId/cwd/agentPreset`。`returnImmediately: true` 返回受理任务;配置网络角色的冷下载和会话准备可在受理后进行,首回执可能尚无 sessionId。普通无角色任务保持会话准备后返回的时序;省略则默认等待终态或需要输入状态。
187
197
 
188
- `metadata.1agents` 的调用输入支持 `cwd/workspace/agentPreset/preflight/resultContract/roleId/roleLockPath`。cwd 和 workspace 不可同时传,cwd 为远端现有绝对目录,workspace 为配置别名;省略位置与预设按远端默认值处理。roleId 必须在宿主可信映射中;roleLockPath 仅接受宿主缓存 locks 目录内已存在、身份与字节校验通过的父锁,不能通过任务参数覆盖 profile、网络或缓存根。
198
+ `metadata.1agents` 的调用输入支持 `cwd/workspace/agentPreset/preflight/resultContract/roleId`。cwd 和 workspace 不可同时传,cwd 为远端现有绝对目录,workspace 为配置别名;省略位置与预设按远端默认值处理。roleId 必须在宿主可信映射中,角色技能从会话 cwd 的 `.agents/skills` 读取。
189
199
 
190
200
  同一会话的新任务在 `message.contextId` 传已保存 context ID;保存的 cwd/preset 不能改变。已完成 task 不可重新打开。原 task 为 input-required 时可传 `message.taskId`,配合新的 `messageId` 继续;活跃 task 上的 follow-up 被拒绝。
191
201
 
@@ -246,6 +256,8 @@ gateway 将状态、任务归属和通知原子落盘;通知有稳定 `noticeI
246
256
 
247
257
  spawn/message 可传 `resultContract: {jobId, parentTaskId?, parentSessionId?, originSessionId?, artifactManifestPath?}`。身份不由模型填入:get/list 的 `resultMetadata` 来自执行宿主,包含真实 task/context/session/request ID、cwd/preset、起止时间、outcome、预检和验证后的产物。lineage 明确标为调用方声明。manifest 路径及所列文件均须在已通过预检的 jobDirectory 内,严格格式:
248
258
 
259
+ **默认产物位置**:调用方没有声明 `jobDirectory` 和 `artifactManifestPath` 时,网关为每个任务指定 `<cwd>/.1agents/jobs/<jobId>/`(执行宿主在预检时创建,不跟随符号链接),清单为该目录下的 `manifest-<attemptId>.json`,并把位置与格式附在提示词末尾。默认清单是可选的:没有清单就没有产物,清单损坏只记入 `validation`,不会让已完成的任务失败。执行宿主不支持(旧版本或预检失败)时,网关回退为不带默认位置派发。调用方自己声明的清单仍按严格模式校验。
260
+
249
261
  ```json
250
262
  {"artifacts":[{"path":"/tmp/actual-job/final.pptx","url":"http://actual-host/artifacts/job/final.pptx","mediaType":"application/vnd.openxmlformats-officedocument.presentationml.presentation"}]}
251
263
  ```
@@ -35,6 +35,8 @@ ACP 会话的 prompt 直接交给原生 Agent。原生 Agent 拥有其模型、
35
35
 
36
36
  ACP 会话里的 `/model`、模式与“ACP 设置”使用 Agent 公布的选项:模型/思考强度走 `session/set_config_option`,模式走 `session/set_mode`。缺失的选项不会自动生成;执行中拒绝修改配置。
37
37
 
38
+ ACP 设置里被 Agent 接受的值,按工作区绝对路径和 Agent 名称记在插件状态目录的 `agent-session-settings.json`。Grok Build 与 Codex 各自保存自己的 mode id 和配置 id。之后同一工作区、同一 Agent 的新建会话会在首条 prompt 前回放:模型在前,其余选项对照每次返回的新目录,模式最后。目录缺少当初的 id 或值时,在 prompt 前失败。已有会话保持原设置。没有试跑记录时,新会话仍只套用 `sessionPolicies.initialModeId`。调用参数不增加这些字段。
39
+
38
40
  普通 DSH 会话仍选择 DSH provider/model。检查实际模型时,以模型目录和会话请求记录为准;例如部署默认 MiniMax 时标准预设会使用它,换部署不能假定仍是 MiniMax。
39
41
 
40
42
  需要工具审批、问题回答时,使用 DSH 的现有交互 UI。浏览器刷新不取消 Host 请求;停止 DSH 当前轮会发送 ACP 取消。当前插件接入支持文本 prompt,不能承诺 DSH 附件也已转发给外部 Agent。
@@ -1,12 +1,12 @@
1
1
  # 角色管理、固定角色调用与临时任务
2
2
 
3
- 这是统一 API 技能的任务路由。`resident-agent` 若已安装,用于创建和维护专职角色;本技能负责实际接口调用。领域方法仍由角色引用的技能负责。创建角色是管理阶段,日常调用不重复创建、部署或预热角色。
3
+ 这是统一 API 技能的任务路由。`resident-agent` 若已安装,用于创建和维护专职角色;本技能负责实际接口调用。领域方法仍由角色引用的技能负责。创建角色是管理阶段,日常调用不重复创建或部署角色。
4
4
 
5
5
  ## 三种工作
6
6
 
7
7
  | 请求 | 操作 | 所需信息 |
8
8
  | --- | --- | --- |
9
- | 创建固定角色 | 配置角色与宿主,再登记 resident_agent 目标 | 职责、网络技能源、缓存、预设、工作根目录及交付约定 |
9
+ | 创建固定角色 | 配置角色与宿主,再登记 resident_agent 目标 | 职责、技能分发目录、预设、工作根目录及交付约定 |
10
10
  | 调用固定角色 | `execution_submit` 到已有 resident_agent target | targetId、完整任务要求;cwd/preset/role 由目标固定 |
11
11
  | 一次性临时任务 | `execution_submit` 到已有 agent_host target | targetId、执行端 cwd、preset、完整任务要求;无需创建角色 |
12
12
 
@@ -31,9 +31,9 @@
31
31
 
32
32
  ## 创建与更新角色(管理阶段)
33
33
 
34
- 1. 复用当前网关、宿主及认证配置,明确职责、工具权限、读写目录、输入和交付。技能通过能力网络检索,精确记录来源及名称/标识;发现结果不等于实际加载。
35
- 2. 创建薄 `ROLE.md` 与网络技能 profile。profile 原生字段为 `id/version/instructionsPath/network/skills/entrySkill`;skills 每项包含 `key/name`,可用 `sourceId/skillId` 消除歧义,并可声明 `nodeUrl/assetsManifest`。不要把登记清单误当原生 profile,也不要把领域脚本和模板写入 persona。源码示例见工程 `.1agents/roles/ppt-beautifier`;项目运行数据统一放在 `./.1agents/`。
36
- 3. 在执行宿主 `a2a.roleSkills` 配置可信的 `cacheRoot`、`profiles: {逻辑roleId:绝对profile路径}`;可选 `presetRoles` 仅为专用 preset 自动绑定。通用 preset 不隐式改成某领域角色。DSH/Codex 共用宿主加载入口;运行依赖和工具仍由宿主管理。
34
+ 1. 复用当前网关、宿主及认证配置,明确职责、工具权限、读写目录、输入和交付。技能名即工作目录 `.agents/skills/<name>` 的目录名;能力网络或分发目录只是来源,发现结果不等于已放进工作目录。
35
+ 2. 创建薄 `ROLE.md` 与角色 profile。profile 字段为 `id/version/instructionsPath/skills/entrySkill`;skills 每项包含 `key/name`,`name` 即 `.agents/skills/<name>` 目录名,profile 不允许其他字段。不要把登记清单误当原生 profile,也不要把领域脚本和模板写入 persona。源码示例见工程 `.1agents/roles/ppt-beautifier`;项目运行数据统一放在 `./.1agents/`。
36
+ 3. 在执行宿主 `a2a.roleSkills` 配置可信的 `profiles: {逻辑roleId:绝对profile路径}`;可选 `presetRoles` 仅为专用 preset 自动绑定。通用 preset 不隐式改成某领域角色。DSH/Codex 共用宿主加载入口;运行依赖和工具仍由宿主管理。
37
37
  4. 有专用预设时安装/更新该预设;也可使用已可用的通用预设配合目标绑定的 roleId。凭据只在受保护宿主/网关配置。需要重载共享宿主时先确认没有运行中会话。
38
38
  5. 复用已登记 connection,通过可信本机管理入口登记或更新 resident_agent target。最小登记参数如下,值均需替换为真实部署值:
39
39
 
@@ -47,18 +47,18 @@
47
47
  "cwd": "/absolute/existing/role-workspace",
48
48
  "agentPreset": "installed-preset",
49
49
  "roleId": "host-configured-role-id",
50
- "skillPolicy": "network_pinned"
50
+ "loadRole": true
51
51
  }
52
52
  }
53
53
  ```
54
54
 
55
55
  `execution_target_update` 参数是 `targetId/expectedConfigVersion?/patch`;`patch.binding` 按整体替换,保留未改的 cwd/preset/role/目录限制。目标管理方法只开放可信本机管理入口,不能当远端公开任务 API。
56
56
 
57
- 6. 在管理阶段预热并校验完整技能包、资源及资产,核验宿主配置;只有用户授权实际试单时才测试模型执行和通知闭环。HTTP 200、目标已登记或 preset 可见仅证明对应管理步骤。
57
+ 6. 在管理阶段用 `acp-service roles sync` 把技能(含资源)放进工作目录,或用 `roles check` 核验,并核验宿主配置;只有用户授权实际试单时才测试模型执行和通知闭环。HTTP 200、目标已登记或 preset 可见仅证明对应管理步骤。
58
58
 
59
- 目录约定:角色定义为 `.1agents/roles/<role>`,技能缓存与锁为 `.1agents/cache/roles`,本地技能源为 `.1agents/skills`,角色 bundle/工作目录/产物/状态为 `.1agents/runtime/<role>`,项目网关账本与通知为 `.1agents/state/a2a-gateway`;私密配置在 `.1agents/config`,不提交 Git。
59
+ 目录约定:角色定义为 `.1agents/roles/<role>`,角色技能在其工作目录的 `.agents/skills`(`.claude/skills` 软链过去),角色 bundle/工作目录/产物/状态为 `.1agents/runtime/<role>`,项目网关账本与通知为 `.1agents/state/a2a-gateway`;私密配置在 `.1agents/config`,不提交 Git。
60
60
 
61
- 工程统一更新入口:`node scripts/update-role-skills.mjs --config .1agents/config/role-skills.local.json`。部署环境也可用 `acp-service roles sync --profile PROFILE --cache-root CACHE [--lock EXISTING]` 管理缓存。新任务解析当前版本;同任务续派、返工与恢复使用原锁。更新不会安装二进制依赖或隐式派模型任务。
61
+ 技能放进角色的工作目录:`acp-service roles sync --profile PROFILE --cwd 工作目录 --source 分发目录` 把 profile 点名的技能(含大文件资源)从分发目录复制到 `工作目录/.agents/skills/`,并把 `工作目录/.claude/skills` 软链到它;`roles check` 只核验与补链。DSH、Codex 在会话开始时读 `.agents/skills`,Claude Code 读 `.claude/skills`。技能不再经能力网络下载、不再锁定版本,新旧任务和续派都读目录当前内容;漂移由验收规则兜底。Skill Manager 只作分发源数据。
62
62
 
63
63
  ## 调用固定角色
64
64
 
@@ -106,7 +106,7 @@ preset 必须在执行宿主真实可用;要用普通 DSH 时显式选 `standa
106
106
  | 通知后或用户明确要求的单次读取 | `execution_get {originSessionId,jobId}`;保留历史 attempt,查询不唤醒主会话 |
107
107
  | 同任务继续/返工 | `execution_continue {originSessionId,jobId,input,clientRequestId?}`;保留原 job,增加执行轮次 |
108
108
  | 关闭任务并取消子任务 | `execution_cancel {originSessionId,jobId,cascade?}`;PPT 交付默认级联,通用任务需显式 cascade=true;未决取消不能冒记全部停止 |
109
- | 记录业务接受/退回 | `execution_review {originSessionId,jobId,attemptId,resultRevision,resultDigest,reviewStatus,note?}`;reviewStatus 为 pending/accepted/changes_requested,值来自真实当前回执 |
109
+ | 记录业务接受/退回 | `execution_review {originSessionId,jobId,attemptId,resultRevision,resultDigest,reviewStatus,decidedBy,note?}`;reviewStatus 为 pending/accepted/changes_requested,值来自真实当前回执;decidedBy 必填,人写 `{kind:"person"}`,教练写 `{kind:"coach",agent,sessionId}`,`acp-service a2a invoke` 会按运行环境自动填写 |
110
110
 
111
111
  通用 A2A 结果完成后由账本自动生成轮次内 `resultRevision` 与 `resultDigest`;从 `execution_get` 或 `remote_agent_get` 取真实值,不用技能 revision、请求中的父子关联版本或手工编号替代。digest 覆盖结果正文、回执引用、链接及宿主返回的文件大小/SHA256 清单;没有清单时不代表已验证文件字节。重复读取/重启保持版本稳定,结果变化追加新版本,`execution_get/list` 的 `resultHistory` 和 `attempts[].resultHistory` 留存版本快照。只接受当前已完成且结果可用的轮次及版本;新结果不继承旧验收。升级从缓存回执补齐旧任务缺失版本,不重派、不自动验收;需补登时核对本地既有结论与同一回执的身份、正文和产物清单后另调 `execution_review`。
112
112
 
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: rsi-coach
3
+ description: 作为教练智能体训练一个领域角色(执行者 + 质检),用 acp-service rsi run 跑任务、读程序检查和质检意见、把反复出现的问题沉淀成技能、工具和程序检查。用户提到训练智能体、教练、RSI、执行者和质检、打回重做、角色目录(.1agents/roles)、ROLE.md / QA.md / checklist、把意见写成程序检查、复现或回炉时使用,即使没说“教练”两个字。
4
+ ---
5
+
6
+ # RSI 教练
7
+
8
+ 你是教练。执行者负责把任务做出来,质检(QA)负责把质量审出来,你负责节奏:派任务、读结果、决定何时打回、何时停下交给人,并把经验沉淀进角色目录。你不替执行者写产出,不替质检下结论,不上线,也不改锁定项。
9
+
10
+ 目标是**在过程中尽量代码化**:把自然语言里反复出现的要求,逐步变成程序能守住的检查、脚本和 schema,让自然语言编程变成可控的程序。每迭代一轮,留给模型判断的部分就少一些。
11
+
12
+ ## 三个阶段
13
+
14
+ **开发**:执行者和质检各按自己的目标做事,你把控节奏,指导两者创建技能、工具和验收条件。每改一次角色目录就提交一次,一次提交是一个角色版本。
15
+
16
+ **测试**:在干净上下文里(新会话、只带角色目录里沉淀的东西)复现。原题复现证明东西记下来了;变体题(换一个项目)证明学会的是做法。复现不了,说明还有东西留在对话里,回到开发。进入测试要先过门禁(见下文“开发 → 测试的门禁”)。
17
+
18
+ **发布**:通用性和专业可控达到相对均衡就发布,由人决定。发布后允许用户拒绝结果;被拒绝的结果和理由是数据,攒起来回炉。
19
+
20
+ ## 角色目录
21
+
22
+ ```
23
+ .1agents/roles/<role-id>/
24
+ ├── profile.json # 角色 id
25
+ ├── ROLE.md # 执行者的做法(可训练)
26
+ ├── QA.md # 质检的评分标准和复审规则(可训练)
27
+ ├── checklist.json # 检查项清单,locked: true 的项你不能改
28
+ ├── checks/ # 程序检查,例如 check_outline.py(锁定)
29
+ └── cases/<case-id>/ # 用例:固定提交的仓库、受众、功能清单(人维护);kind 为 original(原题)或 variant(变体题)
30
+ ```
31
+
32
+ ## 跑一轮
33
+
34
+ ```sh
35
+ acp-service rsi run --role .1agents/roles/<role-id> --case <case-id> \
36
+ --project <本地仓库> --workspace .1agents/runtime/rsi --qa
37
+ ```
38
+
39
+ 流程:执行者产出 → 程序检查(不过就打回执行者原会话)→ 质检审稿(同一任务只开一个质检会话,复审接着原会话,先核对上一轮意见)→ 需要修改就打回执行者 → 再检查、再复审。默认程序打回 1 次、质检修改最多 3 轮(`--max-bounces`、`--qa-max-revisions`)。同一条质检意见连续两次复审都没改到位,或总分连续两轮没有提高,就提前停下:再改也不会更好。
40
+
41
+ 所有打回都走任务单,不靠对话里贴意见。任务单挂在执行者的任务上,存在网关的执行台账里,每次变化都是一条 `ticket.*` 台账事件,记着操作者和轮次:
42
+
43
+ - 程序检查没过的项、质检的意见,都写成带编号的条目(如 `P1-P2`、`Q1-3`),每条记着谁提的、谁处理、谁确认。
44
+ - 执行者用 DSH 工具 `ticket_show`、`ticket_mark`、`ticket_submit` 把条目标成 `done` 或 `disputed` 并写说明,再提交。操作者由调用的方法认定,执行者的会话只能操作自己任务的任务单。它不能核实自己的修改,也不能关单;违规的请求网关直接拒绝。
45
+ - 程序项由宿主重跑检查核实;质检意见由质检在复审的 `previous` 里按编号核实(`fixed`、`partly`、`not_fixed`、`withdrawn`),宿主合并进任务单,没改到位的会被重新打开。质检没有写任务单的方法,`issues` 只写新问题。
46
+ - 质检通过就关单,否则记下停止原因。
47
+
48
+ 你和人用命令行看任务单、处理提议(`--job` 是 run.json 里执行者的 jobId):
49
+
50
+ ```sh
51
+ acp-service ticket show --job <jobId>
52
+ acp-service ticket events --job <jobId>
53
+ acp-service ticket proposal --job <jobId> --id <提议编号> accept|reject|done --note "理由"
54
+ ```
55
+
56
+ 查一个任务的完整留痕(谁发起、派给谁、谁批了什么、产物摘要、谁看过,含质检子任务):
57
+
58
+ ```sh
59
+ acp-service trail --job <jobId>
60
+ ```
61
+
62
+ 结果在工作目录:`run.json`(每轮的检查结果和质检记录,以及停止原因 `stopReason` 和角色版本)、`ticket.json`(网关写出的任务单只读导出)、`reviews/outline-rN.json`(每轮被审的版本)、`reviews/review-rN.json`(质检的分数、意见、`previous` 核对和 `proposals`)。每次运行还会在 `<workspace>/<role-id>/ledger.jsonl` 追加一行,门禁就读这本账。
63
+
64
+ 停止原因:`passed` 通过;`max_bounces` 程序打回用完;`max_revisions` 质检修改轮数用完;`stalled` 改不动了;`needs_human` 改不动了且质检提了锁定项提议;`not_completed`、`review_failed` 执行者或质检没跑完。
65
+
66
+ ## 读结果、做沉淀
67
+
68
+ 每轮跑完,按这个顺序看:
69
+
70
+ 1. **程序检查失败项**:执行者为什么没自查出来?通常是 ROLE.md 没写清规则,补进 ROLE.md。
71
+ 2. **质检的改进提议**(任务单的 `proposals`):质检审稿时按类别提出该怎么改角色,逐条处理,处理完用 `acp-service ticket proposal` 标成采纳、不采纳或已完成,并写理由。
72
+ - **`check`,确定性的、能写成程序的**:写成新的程序检查,加进 checks/ 和 checklist.json,再在 ROLE.md 里告诉执行者、在 QA.md 里告诉质检“这项程序已经查了”。这是最有价值的沉淀。checks/ 和已锁定的项要由人确认后改。
73
+ - **`role`,做法上的**(开头要场景加结果、技术细节放附录):写进 ROLE.md。
74
+ - **`qa`,评判标准上的**(质检打分忽松忽紧、复审加码):写进 QA.md。
75
+ - **`locked`,卡在锁定项上的**(大纲模板、schema、程序检查、用例):交给人。
76
+ 3. **质检意见和 `previous` 核对**:没写成提议、但在多次运行里反复出现的意见,同样按上面三类处理。`not_fixed` 或 `partly` 反复出现,说明执行者理解不了这类意见,换一种写法放进 ROLE.md。执行者标 `disputed` 而质检 `withdrawn` 的,看是不是规则本身写得不清楚。
77
+ 4. **执行者编造**:质检抓到“仓库里没有这个能力”时,在 ROLE.md 里强调出处要求;能程序化的(出处文件不存在)已由检查守住。
78
+
79
+ ### 把意见写成程序检查:P8–P14 的例子
80
+
81
+ 产品介绍大纲角色的 P8–P14 就是这样来的:实跑里质检指出的确定性问题,写成了程序。P8–P11 来自两次实跑里质检的手工意见;P12–P14 来自之后几次运行的意见和 `check` 提议。
82
+
83
+ | 检查 | 规则 | 刻意不拦的情况 |
84
+ | --- | --- | --- |
85
+ | P8 | 每页要点不超过 5 条 | — |
86
+ | P9 | 受众看得到的文字里没有“待补”“TODO”“占位”这类占位符 | 项目自己写明的“待确认”这类限制 |
87
+ | P10 | 同一条要点不在多页逐字重复(去掉空白和标点后至少 12 个字相同) | 换了说法的重复,仍交给质检 |
88
+ | P11 | 发布文件名(zip、dmg 等)里写死的版本号,必须和项目所有版本记录一致(package.json,以及 RELEASE_NOTES.md 或 CHANGELOG.md 的第一个标题);记录之间本身不一致时,不能写死版本号 | “Node.js 22.18.0”这类运行环境版本 |
89
+ | P12 | 全稿最后一页用 `closing` 版式,且只有这一页用 | — |
90
+ | P13 | 标题里数本页条目(“四个动作”“三步”)时,数字和本页要点条数一致 | 序数(“第一步”)和描述对象的数量(“六个演示场景”) |
91
+ | P14 | 不同页的两条要点引用同一组出处文件时,不能有连续 8 个以上相同的汉字 | 英文词、命令和链接;换了说法但用词不同的重复,仍交给质检 |
92
+
93
+ 写新检查时照这几条做:
94
+
95
+ - **规则对准实际问题,不图省事。** P11 没有只对照 package.json,因为 xingjian-showroom 自己的记录就不一致(package.json 0.2.0,RELEASE_NOTES.md v0.1.1),质检指出的正是这个。
96
+ - **写明不该拦什么。** 误报会把对的内容打回去,比漏报更伤;判断不了的留给质检。
97
+ - **用已有运行的产出回放验证。** 拿 `reviews/outline-rN.json` 跑新检查,确认质检当时指出的问题被拦下、已改好的版本能通过。P8–P11 在两次实跑的 4 份大纲上就是这样验证的;P13、P14 在之前运行的 10 份大纲上回放,P14 的阈值(8 个字)就是按“只拦真重复”定下来的。
98
+ - **加测试**:逐条故意违反、确认能拦住,再确认不会误报。
99
+ - **同步三处**:checklist.json 加条目(锁定),ROLE.md 告诉执行者,QA.md 告诉质检不必再查。打回提示写“全部检查通过”,不写死检查编号。
100
+
101
+ 写成程序之后,这类问题会先被程序打回,到不了质检那里,质检就能专注在质量上。
102
+
103
+ 改完用 git 提交角色目录,一次提交就是一个版本,提交说明写清这次沉淀了什么、来自哪次运行。
104
+
105
+ ## 开发 → 测试的门禁
106
+
107
+ ```sh
108
+ acp-service rsi gate --role .1agents/roles/<role-id> --workspace .1agents/runtime/rsi
109
+ ```
110
+
111
+ 门禁读账本,只看当前已提交的角色版本。放行要满足:
112
+
113
+ - 角色目录没有未提交的改动;
114
+ - 在原题上连续 2 次开发运行都通过(`--required` 可调);
115
+ - 每次的初稿都一次通过程序检查;
116
+ - 没有剩下没核实的“必须改”;
117
+ - 这几次运行里质检没有再提 `check` 或 `locked` 提议(还有能写成程序的、或卡在锁定项上的,就还没练完)。
118
+
119
+ 角色目录一改就是新版本,计数从零开始。所以先把一批沉淀改完、提交,再在这个版本上连跑;不要边跑边改。
120
+
121
+ 放行后用 `--phase test` 跑测试:它要求角色目录已提交、带 `--qa`、门禁已放行。原题和每道变体题都跑一遍,`rsi gate` 会列出每个用例在当前版本上的测试结果。变体题的功能清单要先由人确认,没确认的用例跑不起来。
122
+
123
+ ## 什么时候停下交给人
124
+
125
+ - 停止原因是 `needs_human`,或质检多轮仍判“需要修改”且剩下的是取舍问题而不是错误。
126
+ - 要改锁定项、checks/、cases/,或要改 preset 和工具权限;质检的 `locked` 提议也在这一类。
127
+ - 执行者请求装依赖、提权、写工作目录以外的文件。不要放行,记录下来:反复出现说明工具不够,由人调整环境(例如给出装好依赖的解释器路径)。
128
+ - 要发布,或要把用户拒绝的结果回炉。
129
+
130
+ ## 注意
131
+
132
+ - 质检分数是模型自评,没有经人校准;看同一会话前后两轮的趋势,不看绝对值。
133
+ - 每次运行都会在工作台留下真实任务,跑之前想清楚要验证什么。
134
+ - 不要为了让结果好看去删用例或放宽检查;这类改动交给人。
@@ -2,9 +2,9 @@
2
2
 
3
3
  Use persistent native Codex, Claude Code, Grok Build and other locally discovered ACP Agent sessions inside DeepSeek Harness. Choose native models and settings, use advertised commands, and answer tool permissions in DSH. The plugin is embedded with the runtime and service in the single public **`@1agents/acp-service`** package. This directory is its private source module.
4
4
 
5
- The CI API baseline is **DSH 0.1.7-rc.2**, commit `21638c56315ae6a2b552d6091945d3144c9af32e`. Additional installed-package and interactive checks used an isolated profile on a locally modified DSH build labeled `0.2.0-rc.1`; see the [verification record](https://github.com/scottzx/1acp/blob/main/docs/marketplaces/verification-2026-10-09.md) for the exact scope. Other DSH releases require checking their plugin and preset APIs.
5
+ The CI API baseline is **DSH 0.1.7-rc.2**, commit `21638c56315ae6a2b552d6091945d3144c9af32e`. Additional installed-package and interactive checks used an isolated profile on a locally modified DSH build labeled `0.2.0-rc.1`; see the [verification record](https://github.com/scottzx/agent-workflow/blob/main/docs/marketplaces/verification-2026-10-09.md) for the exact scope. Other DSH releases require checking their plugin and preset APIs.
6
6
 
7
- The same host supports opt-in A2A 1.0 delegation, disabled by default: remote text messages create or restore DSH sessions, return task IDs, and continue execution independently of HTTP clients. Configure `a2a` on the existing plugin row, set the host's `DSH_A2A_TOKEN`, and choose its public origin, default cwd and preset. Query and subscribe through the official A2A interfaces; allowed webhook origins enable completion callbacks. Waking a caller's main Agent requires its receiving host adapter. See the [service README's DSH A2A section](https://github.com/scottzx/1acp/blob/main/packages/service/README.md#dsh-a2a) for configuration, metadata and recovery behavior. The shared server is exported as `@1agents/acp-service/a2a` and remains independent of DSH imports.
7
+ The same host supports opt-in A2A 1.0 delegation, disabled by default: remote text messages create or restore DSH sessions, return task IDs, and continue execution independently of HTTP clients. Configure `a2a` on the existing plugin row, set the host's `DSH_A2A_TOKEN`, and choose its public origin, default cwd and preset. Query and subscribe through the official A2A interfaces; allowed webhook origins enable completion callbacks. Waking a caller's main Agent requires its receiving host adapter. See the [service README's DSH A2A section](https://github.com/scottzx/agent-workflow/blob/main/packages/service/README.md#dsh-a2a) for configuration, metadata and recovery behavior. The shared server is exported as `@1agents/acp-service/a2a` and remains independent of DSH imports.
8
8
 
9
9
  ## Install and start a session
10
10
 
@@ -20,10 +20,10 @@ If pnpm pauses or fails with an ignored transitive `esbuild` build script, follo
20
20
 
21
21
  Restart DSH after updating packages, confirm **`@1agents/acp-service`** is enabled on its Plugins page, and choose a discovered **ACP · Agent** preset for a new session. Select an existing workspace, then send a text prompt. Replace `web` with your profile name, such as `desktop`; from a DSH source checkout, use `pnpm dsh` in place of `dsh`.
22
22
 
23
- For a pinned fallback, install the identical npm artifact from [GitHub Release 0.6.0](https://github.com/scottzx/1acp/releases/tag/acp-service-v0.6.0):
23
+ For a pinned fallback, install the identical npm artifact from [GitHub Release 0.6.0](https://github.com/scottzx/agent-workflow/releases/tag/acp-service-v0.6.0).
24
24
 
25
25
  ```sh
26
- dsh plugin --profile web add https://github.com/scottzx/1acp/releases/download/acp-service-v0.6.0/1agents-acp-service-0.6.0.tgz
26
+ 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
27
27
  ```
28
28
 
29
29
  The package declares `dsh.bundle.patch` and its browser entry, so installation selects the bundle automatically.
@@ -34,7 +34,7 @@ The plugin starts its bundled ACP service on `127.0.0.1:36812` when no service i
34
34
  npx --yes @1agents/acp-service@^0.7.0 serve --host 127.0.0.1 --port 36812 --no-report
35
35
  ```
36
36
 
37
- Installing the package alone starts no process; activating the plugin starts the service. For local development, install the built checkout with `pnpm dsh plugin --profile web add /absolute/path/1acp/packages/service`.
37
+ Installing the package alone starts no process; activating the plugin starts the service. For local development, install the built checkout with `pnpm dsh plugin --profile web add /absolute/path/agent-workflow/packages/service`.
38
38
 
39
39
  ACP routes are not listed as ordinary DSH models, and the adapter rejects requests from ordinary presets, including previously saved ACP routes. Before the first turn, switching the Agent preset replaces the discovery connection and its native commands. Once a turn starts, the session keeps its remote Agent and workspace; start a new session to change Agent. Native Agent binaries and authentication belong to acp-service.
40
40
 
@@ -73,6 +73,8 @@ Provider mapping is `claude → claude`, `codex → codex`, `grok → grok-build
73
73
 
74
74
  Opening an ACP session initializes or restores its remote session without sending a prompt. The plugin consumes `available_commands_update`, `config_option_update`, and mode updates. Advertised slash commands with names accepted by DSH (`[a-z][a-z0-9_-]*`) are registered in that session and forwarded verbatim through `session/prompt`, including their arguments. `/model` opens the model options advertised by the remote Agent. Choosing a model or reasoning setting uses `session/set_config_option`; choosing a mode uses `session/set_mode`. Unsupported options are not invented. Configuration changes are rejected while a turn runs.
75
75
 
76
+ A successful choice in **ACP 设置** is remembered for that absolute workspace and that ACP agent. Grok Build and Codex keep separate records, each with the mode id and config-option ids that agent accepted. The file is `agent-session-settings.json` in `stateDirectory`, beside session bindings. A later new session replays only its own record before the first prompt: model options first, then the other options against each catalog returned by `session/set_config_option`, then the mode through `session/set_mode`. A missing id or value fails before the prompt and closes the new remote session. When the record includes a mode, that mode is used. An agent with no record still receives only `initialModeId`. A record with options and no mode still applies `initialModeId`. Continuing, loading, or importing an existing session keeps the settings already on that session. `initialModeId` and untouched session defaults are not written into the file. Choosing the same option again replaces that id. `execution_submit` does not carry these values.
77
+
76
78
  The bundle disables the stock `ui-model-selection` row and supplies a session-aware model selector using DSH's existing UI slot and command contribution APIs. Ordinary sessions still select their DSH provider/model and reasoning effort; ACP sessions select only native Agent options. The Agent's additional options appear under **ACP 设置**. An idle ACP connection is retained so metadata updates and controls share the same session owner. The visible browser refreshes its capability snapshot every five seconds.
77
79
 
78
80
  The bundle registers `oneagents-acp-*` presets with DSH's preset registry. Older filesystem presets remain untouched; DSH 0.1.7 uses registry declarations instead of scanning those files. ACP bindings are stored separately under `$DSH_HOME/plugins/1agents-acp/sessions`.
@@ -81,6 +83,8 @@ The bundle registers `oneagents-acp-*` presets with DSH's preset registry. Older
81
83
 
82
84
  ACP one-shot tool permissions use DSH's approval UI and policy. Grok questions and plan approval use its question UI. Persistent grants are not synthesized. Read operations follow acp-service's `approve-reads` policy; operations requiring permission are presented to the user.
83
85
 
86
+ When `a2a.workbench` is configured, DSH's own tool approvals inside an A2A task (for example a `danger-full-access` escalation from `tool-bash` under the `standard` preset) become `permission` process requests on the gateway workbench. The workbench is the only place to answer them, because DSH's approval UI keeps its prompt for the request's whole lifetime and could not withdraw it after a workbench answer. Approve grants that one call, reject denies it, and an expired or closed request cancels it. If the workbench cannot be reached, DSH's approval UI answers as before. Sessions outside A2A tasks, and ACP presets (which open their own request), are unaffected.
87
+
84
88
  Transport reconnects load the same service session and replay the current managed turn. Stable request IDs prevent duplicate execution, and update sequence numbers suppress duplicate output. A browser refresh leaves the Host request running. Stopping a DSH turn sends ACP cancellation. Provider errors fail the turn without automatic resubmission.
85
89
 
86
90
  The owned ACP Adapter sanitizes provider failures before the official DSH host normalizes them. Category, provider code, retryability, outcome uncertainty, origin and request identity are persisted in the plugin's `oneagents_acp_diagnostics` domain, using official `storageDomain` and JSON storage plugins. The plugin owns their lifetime so cancellation and A2A drain before storage closes. DSH source, native `LlmFailure` and Session event schemas stay unchanged; its ordinary logs can retain only code and message. Complete diagnostics appear under A2A `metadata['1agents'].error`, with the A2A caller's operation identity. Host error properties and arbitrary in-band metadata cannot supply missing diagnostics.
@@ -97,7 +101,7 @@ This plugin supports **text prompts**. Attachments and specialized external-tool
97
101
 
98
102
  The bundle's `oneagents-acp` row accepts `serviceUrl`, `serviceMode`, `serviceStartupTimeoutMs`, `serviceShutdownTimeoutMs`, `agents`, `stateDirectory`, `diagnosticsDirectory`, `reconnectAttempts` and `reconnectDelayMs`. Change it through the profile's `cordis.patch.yml`, not the DSH repository. Use a new session after changing endpoint or workspace. When `agents` is omitted, plugin startup fetches `GET /agents` from acp-service and registers presets for entries with `chat_ready: true`, using their service-provided names. Discovery runs on the service host. Restart the plugin after installing or removing a harness. An explicit `agents` list bypasses discovery and preserves manual registry selection; `[]` registers no presets. Service startup, connection errors and invalid inventory responses fail plugin initialization instead of selecting fallback agents.
99
103
 
100
- Explicitly authorized unattended work can declare `sessionPolicies`, with an exact absolute `cwd`, ACP registry `agent`, `permissionMode` (`approve-reads`, `approve-all`, or `deny-all`) and optional `initialModeId`. A policy matches only that workspace and Agent; wildcards and duplicate scopes are rejected. New sessions select the advertised native mode before sending any prompt; an unavailable mode fails without prompting. Existing sessions keep their native mode. For example, an authorized Codex video workspace can use `permissionMode: "approve-all"` and `initialModeId: "agent-full-access"` without changing the host's global model or other workspaces. Remove the declaration when the authorized batch ends; existing native sessions retain their own stored mode.
104
+ Explicitly authorized unattended work can declare `sessionPolicies`, with an exact absolute `cwd`, ACP registry `agent`, and optional `initialModeId`. A policy matches only that workspace and Agent; wildcards and duplicate scopes are rejected. New sessions select the advertised native mode before sending any prompt; an unavailable mode fails without prompting. A stored ACP 设置 record for the same workspace and Agent is applied on that new session, and its mode replaces `initialModeId`. Existing sessions keep their native mode and any ACP settings already selected or imported. `permissionMode` (`approve-reads`, `approve-all`, `deny-all`) may still appear in older configs and is ignored: the bridge does not apply that three-state shield. Mode and reasoning effort come from ACP 设置 (`session/set_mode`, `session/set_config_option`) or from the native session an import resumes. For example, an authorized Codex video workspace can use `initialModeId: "agent-full-access"` without changing the host's global model or other workspaces. Remove the declaration when the authorized batch ends; existing native sessions retain their own stored mode.
101
105
 
102
106
  Diagnostic storage defaults to `stateDirectory/diagnostics`; `diagnosticsDirectory` selects a separate explicit location. Keep this directory with the A2A state when moving a host. Its version is independent of DSH Session formats. The plugin privately mounts official storage components; it does not require a shared host storage-domain configuration. Only one plugin instance may write the directory at a time.
103
107
 
@@ -1,13 +1,56 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
- import { type A2ABackend, type A2APreflightInput, type A2APrepareInput, type A2ARunResult, type A2ATarget } from '@1agents/acp-service/a2a';
2
+ import type { SessionId } from '@deepseek-ai/dsh-session';
3
+ import { type A2ABackend, type A2AExecutionRef, type A2APreflightInput, type A2APrepareInput, type A2ARunResult, type A2ATarget } from '@1agents/acp-service/a2a';
3
4
  import type { Diagnostics } from './diagnostics.js';
5
+ export interface SessionControl {
6
+ release(sessionId: string): Promise<{
7
+ processReleased: true | 'pending';
8
+ acp?: boolean;
9
+ }>;
10
+ delete?(sessionId: string): Promise<{
11
+ processReleased: true | 'pending';
12
+ acp?: boolean;
13
+ }>;
14
+ status(sessionId: string): Promise<{
15
+ attached: boolean;
16
+ activeTurn: boolean;
17
+ lastUsedAt?: string;
18
+ }>;
19
+ }
20
+ type SessionInspection = {
21
+ meta: {
22
+ id: string;
23
+ cwd?: string;
24
+ agentPreset?: string;
25
+ };
26
+ } | null;
27
+ /**
28
+ * Read a Session's identity without resuming it; null when it does not exist.
29
+ * Current DSH dropped sessionController.inspect, so this observes the stored header through sessionQuery instead.
30
+ */
31
+ export declare function inspectSession(ctx: Context, sessionId: SessionId): Promise<SessionInspection>;
4
32
  /** Uses public session-controller and inbox events to account for one A2A prompt's exact DSH turn. */
5
33
  export declare class DshA2ABackend implements A2ABackend {
6
34
  private readonly ctx;
7
35
  private readonly diagnostics?;
36
+ private readonly sessions?;
8
37
  private readonly executions;
9
38
  /** @param ctx DSH plugin context that owns session-controller and execution event registrations. */
10
- constructor(ctx: Context, diagnostics?: Diagnostics | undefined);
39
+ constructor(ctx: Context, diagnostics?: Diagnostics | undefined, sessions?: SessionControl | undefined);
40
+ close(target: A2ATarget): Promise<{
41
+ processReleased: true | 'pending';
42
+ acp?: boolean;
43
+ }>;
44
+ /** Non-ACP presets only drop the A2A binding; DSH session history is never deleted. */
45
+ delete(target: A2ATarget): Promise<{
46
+ processReleased: true | 'pending';
47
+ acp?: boolean;
48
+ }>;
49
+ status(target: A2ATarget): Promise<{
50
+ attached: boolean;
51
+ activeTurn: boolean;
52
+ lastUsedAt?: string;
53
+ }>;
11
54
  /** Restart reconciliation reads the plugin domain and never dispatches another prompt. */
12
55
  recover(target: A2ATarget, options: {
13
56
  requestId: string;
@@ -20,6 +63,10 @@ export declare class DshA2ABackend implements A2ABackend {
20
63
  prepare(input: A2APrepareInput, options?: {
21
64
  signal: AbortSignal;
22
65
  }): Promise<A2ATarget>;
66
+ /** Standard presets only. The catalog must list the exact model; a miss never falls back to the host default. */
67
+ private requireModel;
68
+ /** Install the requested model before the first prompt and return what DSH resolved. Omitted fields leave the session unchanged. */
69
+ private selectModel;
23
70
  /** Admit one identified queued prompt and wait only for its own turn, independent of the HTTP connection.
24
71
  * @param target Previously prepared DSH session.
25
72
  * @param prompt Plain-text A2A message content.
@@ -30,7 +77,14 @@ export declare class DshA2ABackend implements A2ABackend {
30
77
  requestId: string;
31
78
  signal: AbortSignal;
32
79
  beforeStart?: (signal?: AbortSignal) => Promise<void>;
80
+ onCapacity?: (pending: {
81
+ code: 'CAPACITY_PENDING';
82
+ position: number;
83
+ waitedMs: number;
84
+ } | undefined) => void;
85
+ execution?: A2AExecutionRef;
33
86
  }): Promise<A2ARunResult>;
34
87
  private execute;
35
88
  private agent;
36
89
  }
90
+ export {};