@xrkseek/harness 0.4.0-rc.4 → 0.4.1

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 (625) hide show
  1. package/dist/index.d.ts +3 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -2
  4. package/dist/index.js.map +1 -1
  5. package/node_modules/@xrkseek/checkpoint/README.md +88 -0
  6. package/node_modules/@xrkseek/checkpoint/dist/index.d.ts +5 -0
  7. package/node_modules/@xrkseek/checkpoint/dist/index.d.ts.map +1 -0
  8. package/node_modules/@xrkseek/checkpoint/dist/index.js +5 -0
  9. package/node_modules/@xrkseek/checkpoint/dist/index.js.map +1 -0
  10. package/node_modules/@xrkseek/checkpoint/dist/json-file.d.ts +5 -0
  11. package/node_modules/@xrkseek/checkpoint/dist/json-file.d.ts.map +1 -0
  12. package/node_modules/@xrkseek/checkpoint/dist/json-file.js +29 -0
  13. package/node_modules/@xrkseek/checkpoint/dist/json-file.js.map +1 -0
  14. package/node_modules/@xrkseek/checkpoint/dist/process-git.d.ts +8 -0
  15. package/node_modules/@xrkseek/checkpoint/dist/process-git.d.ts.map +1 -0
  16. package/node_modules/@xrkseek/checkpoint/dist/process-git.js +40 -0
  17. package/node_modules/@xrkseek/checkpoint/dist/process-git.js.map +1 -0
  18. package/node_modules/@xrkseek/checkpoint/dist/store.d.ts +101 -0
  19. package/node_modules/@xrkseek/checkpoint/dist/store.d.ts.map +1 -0
  20. package/node_modules/@xrkseek/checkpoint/dist/store.js +312 -0
  21. package/node_modules/@xrkseek/checkpoint/dist/store.js.map +1 -0
  22. package/node_modules/@xrkseek/checkpoint/dist/types.d.ts +65 -0
  23. package/node_modules/@xrkseek/checkpoint/dist/types.d.ts.map +1 -0
  24. package/node_modules/@xrkseek/checkpoint/dist/types.js +18 -0
  25. package/node_modules/@xrkseek/checkpoint/dist/types.js.map +1 -0
  26. package/node_modules/@xrkseek/checkpoint/package.json +23 -0
  27. package/node_modules/@xrkseek/code-runtime/README.md +11 -4
  28. package/node_modules/@xrkseek/code-runtime/dist/index.d.ts +43 -3
  29. package/node_modules/@xrkseek/code-runtime/dist/index.d.ts.map +1 -1
  30. package/node_modules/@xrkseek/code-runtime/dist/index.js +209 -7
  31. package/node_modules/@xrkseek/code-runtime/dist/index.js.map +1 -1
  32. package/node_modules/@xrkseek/context-fragments/README.md +28 -0
  33. package/node_modules/@xrkseek/context-fragments/dist/index.d.ts +104 -0
  34. package/node_modules/@xrkseek/context-fragments/dist/index.d.ts.map +1 -0
  35. package/node_modules/@xrkseek/context-fragments/dist/index.js +192 -0
  36. package/node_modules/@xrkseek/context-fragments/dist/index.js.map +1 -0
  37. package/node_modules/@xrkseek/context-fragments/package.json +27 -0
  38. package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts +1 -1
  39. package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
  40. package/node_modules/@xrkseek/core-agent-loop/dist/index.js +7 -4
  41. package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
  42. package/node_modules/@xrkseek/core-agent-loop/dist/invariant.d.ts +11 -0
  43. package/node_modules/@xrkseek/core-agent-loop/dist/invariant.d.ts.map +1 -0
  44. package/node_modules/@xrkseek/core-agent-loop/dist/invariant.js +21 -0
  45. package/node_modules/@xrkseek/core-agent-loop/dist/invariant.js.map +1 -0
  46. package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.d.ts +7 -5
  47. package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.d.ts.map +1 -1
  48. package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.js +24 -109
  49. package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.js.map +1 -1
  50. package/node_modules/@xrkseek/core-agent-loop/package.json +7 -0
  51. package/node_modules/@xrkseek/core-session/README.md +3 -1
  52. package/node_modules/@xrkseek/core-session/dist/invariant.d.ts +18 -0
  53. package/node_modules/@xrkseek/core-session/dist/invariant.d.ts.map +1 -0
  54. package/node_modules/@xrkseek/core-session/dist/invariant.js +114 -0
  55. package/node_modules/@xrkseek/core-session/dist/invariant.js.map +1 -0
  56. package/node_modules/@xrkseek/core-session/dist/session-interchange.d.ts +2 -1
  57. package/node_modules/@xrkseek/core-session/dist/session-interchange.d.ts.map +1 -1
  58. package/node_modules/@xrkseek/core-session/dist/session-interchange.js +6 -1
  59. package/node_modules/@xrkseek/core-session/dist/session-interchange.js.map +1 -1
  60. package/node_modules/@xrkseek/core-session/dist/sqlite-store.d.ts.map +1 -1
  61. package/node_modules/@xrkseek/core-session/dist/sqlite-store.js +37 -23
  62. package/node_modules/@xrkseek/core-session/dist/sqlite-store.js.map +1 -1
  63. package/node_modules/@xrkseek/core-session/package.json +33 -26
  64. package/node_modules/@xrkseek/core-system-prompt/README.md +7 -7
  65. package/node_modules/@xrkseek/core-system-prompt/dist/index.d.ts +1 -1
  66. package/node_modules/@xrkseek/core-system-prompt/dist/index.d.ts.map +1 -1
  67. package/node_modules/@xrkseek/core-system-prompt/dist/index.js +1 -1
  68. package/node_modules/@xrkseek/core-system-prompt/dist/index.js.map +1 -1
  69. package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.d.ts +55 -3
  70. package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.d.ts.map +1 -1
  71. package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.js +107 -11
  72. package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.js.map +1 -1
  73. package/node_modules/@xrkseek/core-tools/dist/guards.d.ts +9 -1
  74. package/node_modules/@xrkseek/core-tools/dist/guards.d.ts.map +1 -1
  75. package/node_modules/@xrkseek/core-tools/dist/guards.js +53 -9
  76. package/node_modules/@xrkseek/core-tools/dist/guards.js.map +1 -1
  77. package/node_modules/@xrkseek/core-tools/dist/index.d.ts +2 -1
  78. package/node_modules/@xrkseek/core-tools/dist/index.d.ts.map +1 -1
  79. package/node_modules/@xrkseek/core-tools/dist/index.js +2 -1
  80. package/node_modules/@xrkseek/core-tools/dist/index.js.map +1 -1
  81. package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.d.ts +5 -0
  82. package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.d.ts.map +1 -0
  83. package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.js +12 -0
  84. package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.js.map +1 -0
  85. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.d.ts.map +1 -1
  86. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js +6 -2
  87. package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js.map +1 -1
  88. package/node_modules/@xrkseek/exec-computer-use/README.md +1 -1
  89. package/node_modules/@xrkseek/exec-computer-use/dist/format.d.ts.map +1 -1
  90. package/node_modules/@xrkseek/exec-computer-use/dist/format.js +7 -5
  91. package/node_modules/@xrkseek/exec-computer-use/dist/format.js.map +1 -1
  92. package/node_modules/@xrkseek/exec-computer-use/dist/index.d.ts +14 -3
  93. package/node_modules/@xrkseek/exec-computer-use/dist/index.d.ts.map +1 -1
  94. package/node_modules/@xrkseek/exec-computer-use/dist/index.js +22 -8
  95. package/node_modules/@xrkseek/exec-computer-use/dist/index.js.map +1 -1
  96. package/node_modules/@xrkseek/exec-computer-use/dist/keys.d.ts +10 -0
  97. package/node_modules/@xrkseek/exec-computer-use/dist/keys.d.ts.map +1 -0
  98. package/node_modules/@xrkseek/exec-computer-use/dist/keys.js +89 -0
  99. package/node_modules/@xrkseek/exec-computer-use/dist/keys.js.map +1 -0
  100. package/node_modules/@xrkseek/exec-computer-use/dist/tools.d.ts +3 -1
  101. package/node_modules/@xrkseek/exec-computer-use/dist/tools.d.ts.map +1 -1
  102. package/node_modules/@xrkseek/exec-computer-use/dist/tools.js +12 -8
  103. package/node_modules/@xrkseek/exec-computer-use/dist/tools.js.map +1 -1
  104. package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.d.ts.map +1 -1
  105. package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.js +138 -2
  106. package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.js.map +1 -1
  107. package/node_modules/@xrkseek/exec-fs/README.md +12 -9
  108. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-apply.d.ts +32 -0
  109. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-apply.d.ts.map +1 -0
  110. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-apply.js +203 -0
  111. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-apply.js.map +1 -0
  112. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-parser.d.ts +52 -0
  113. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-parser.d.ts.map +1 -0
  114. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-parser.js +260 -0
  115. package/node_modules/@xrkseek/exec-fs/dist/apply-patch-parser.js.map +1 -0
  116. package/node_modules/@xrkseek/exec-fs/dist/apply-patch.d.ts +27 -0
  117. package/node_modules/@xrkseek/exec-fs/dist/apply-patch.d.ts.map +1 -0
  118. package/node_modules/@xrkseek/exec-fs/dist/apply-patch.js +69 -0
  119. package/node_modules/@xrkseek/exec-fs/dist/apply-patch.js.map +1 -0
  120. package/node_modules/@xrkseek/exec-fs/dist/index.d.ts +6 -1
  121. package/node_modules/@xrkseek/exec-fs/dist/index.d.ts.map +1 -1
  122. package/node_modules/@xrkseek/exec-fs/dist/index.js +72 -3
  123. package/node_modules/@xrkseek/exec-fs/dist/index.js.map +1 -1
  124. package/node_modules/@xrkseek/exec-fs/dist/present.d.ts +4 -0
  125. package/node_modules/@xrkseek/exec-fs/dist/present.d.ts.map +1 -1
  126. package/node_modules/@xrkseek/exec-fs/dist/present.js +25 -0
  127. package/node_modules/@xrkseek/exec-fs/dist/present.js.map +1 -1
  128. package/node_modules/@xrkseek/exec-fs/dist/routing-prompt.d.ts +1 -1
  129. package/node_modules/@xrkseek/exec-fs/dist/routing-prompt.d.ts.map +1 -1
  130. package/node_modules/@xrkseek/exec-fs/dist/routing-prompt.js +10 -6
  131. package/node_modules/@xrkseek/exec-fs/dist/routing-prompt.js.map +1 -1
  132. package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts +15 -2
  133. package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts.map +1 -1
  134. package/node_modules/@xrkseek/exec-image-gen/dist/index.js +14 -7
  135. package/node_modules/@xrkseek/exec-image-gen/dist/index.js.map +1 -1
  136. package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts +6 -1
  137. package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts.map +1 -1
  138. package/node_modules/@xrkseek/exec-image-gen/dist/tools.js +14 -8
  139. package/node_modules/@xrkseek/exec-image-gen/dist/tools.js.map +1 -1
  140. package/node_modules/@xrkseek/exec-memory/README.md +5 -3
  141. package/node_modules/@xrkseek/exec-memory/dist/http.d.ts +42 -0
  142. package/node_modules/@xrkseek/exec-memory/dist/http.d.ts.map +1 -0
  143. package/node_modules/@xrkseek/exec-memory/dist/http.js +232 -0
  144. package/node_modules/@xrkseek/exec-memory/dist/http.js.map +1 -0
  145. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts +5 -2
  146. package/node_modules/@xrkseek/exec-memory/dist/index.d.ts.map +1 -1
  147. package/node_modules/@xrkseek/exec-memory/dist/index.js +3 -1
  148. package/node_modules/@xrkseek/exec-memory/dist/index.js.map +1 -1
  149. package/node_modules/@xrkseek/exec-memory/dist/provider.d.ts +19 -0
  150. package/node_modules/@xrkseek/exec-memory/dist/provider.d.ts.map +1 -0
  151. package/node_modules/@xrkseek/exec-memory/dist/provider.js +8 -0
  152. package/node_modules/@xrkseek/exec-memory/dist/provider.js.map +1 -0
  153. package/node_modules/@xrkseek/exec-memory/dist/resolve.d.ts +25 -0
  154. package/node_modules/@xrkseek/exec-memory/dist/resolve.d.ts.map +1 -0
  155. package/node_modules/@xrkseek/exec-memory/dist/resolve.js +46 -0
  156. package/node_modules/@xrkseek/exec-memory/dist/resolve.js.map +1 -0
  157. package/node_modules/@xrkseek/exec-memory/dist/store.d.ts +8 -4
  158. package/node_modules/@xrkseek/exec-memory/dist/store.d.ts.map +1 -1
  159. package/node_modules/@xrkseek/exec-memory/dist/store.js +6 -0
  160. package/node_modules/@xrkseek/exec-memory/dist/store.js.map +1 -1
  161. package/node_modules/@xrkseek/exec-memory/dist/tools.d.ts.map +1 -1
  162. package/node_modules/@xrkseek/exec-memory/dist/tools.js +12 -9
  163. package/node_modules/@xrkseek/exec-memory/dist/tools.js.map +1 -1
  164. package/node_modules/@xrkseek/exec-memory/dist/write-path.d.ts +17 -6
  165. package/node_modules/@xrkseek/exec-memory/dist/write-path.d.ts.map +1 -1
  166. package/node_modules/@xrkseek/exec-memory/dist/write-path.js +81 -20
  167. package/node_modules/@xrkseek/exec-memory/dist/write-path.js.map +1 -1
  168. package/node_modules/@xrkseek/exec-memory/package.json +1 -0
  169. package/node_modules/@xrkseek/exec-sandbox/dist/doctor.d.ts +24 -0
  170. package/node_modules/@xrkseek/exec-sandbox/dist/doctor.d.ts.map +1 -0
  171. package/node_modules/@xrkseek/exec-sandbox/dist/doctor.js +118 -0
  172. package/node_modules/@xrkseek/exec-sandbox/dist/doctor.js.map +1 -0
  173. package/node_modules/@xrkseek/exec-sandbox/dist/hardline.d.ts +24 -0
  174. package/node_modules/@xrkseek/exec-sandbox/dist/hardline.d.ts.map +1 -0
  175. package/node_modules/@xrkseek/exec-sandbox/dist/hardline.js +93 -0
  176. package/node_modules/@xrkseek/exec-sandbox/dist/hardline.js.map +1 -0
  177. package/node_modules/@xrkseek/exec-sandbox/dist/index.d.ts +3 -1
  178. package/node_modules/@xrkseek/exec-sandbox/dist/index.d.ts.map +1 -1
  179. package/node_modules/@xrkseek/exec-sandbox/dist/index.js +3 -1
  180. package/node_modules/@xrkseek/exec-sandbox/dist/index.js.map +1 -1
  181. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.d.ts +17 -0
  182. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.d.ts.map +1 -1
  183. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.js +47 -5
  184. package/node_modules/@xrkseek/exec-sandbox/dist/resolve.js.map +1 -1
  185. package/node_modules/@xrkseek/exec-sandbox/dist/service.d.ts.map +1 -1
  186. package/node_modules/@xrkseek/exec-sandbox/dist/service.js +2 -5
  187. package/node_modules/@xrkseek/exec-sandbox/dist/service.js.map +1 -1
  188. package/node_modules/@xrkseek/exec-ssh/README.md +16 -16
  189. package/node_modules/@xrkseek/exec-ssh/dist/config.d.ts +10 -0
  190. package/node_modules/@xrkseek/exec-ssh/dist/config.d.ts.map +1 -1
  191. package/node_modules/@xrkseek/exec-ssh/dist/config.js +50 -0
  192. package/node_modules/@xrkseek/exec-ssh/dist/config.js.map +1 -1
  193. package/node_modules/@xrkseek/exec-ssh/dist/fs.d.ts +1 -1
  194. package/node_modules/@xrkseek/exec-ssh/dist/fs.d.ts.map +1 -1
  195. package/node_modules/@xrkseek/exec-ssh/dist/fs.js +18 -1
  196. package/node_modules/@xrkseek/exec-ssh/dist/fs.js.map +1 -1
  197. package/node_modules/@xrkseek/exec-ssh/dist/index.d.ts +1 -1
  198. package/node_modules/@xrkseek/exec-ssh/dist/index.d.ts.map +1 -1
  199. package/node_modules/@xrkseek/exec-ssh/dist/index.js +1 -1
  200. package/node_modules/@xrkseek/exec-ssh/dist/index.js.map +1 -1
  201. package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts +15 -2
  202. package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts.map +1 -1
  203. package/node_modules/@xrkseek/exec-video-gen/dist/index.js +14 -9
  204. package/node_modules/@xrkseek/exec-video-gen/dist/index.js.map +1 -1
  205. package/node_modules/@xrkseek/exec-video-gen/dist/tools.d.ts +6 -1
  206. package/node_modules/@xrkseek/exec-video-gen/dist/tools.d.ts.map +1 -1
  207. package/node_modules/@xrkseek/exec-video-gen/dist/tools.js +14 -10
  208. package/node_modules/@xrkseek/exec-video-gen/dist/tools.js.map +1 -1
  209. package/node_modules/@xrkseek/exec-voice/README.md +25 -25
  210. package/node_modules/@xrkseek/exec-voice/dist/index.d.ts +16 -3
  211. package/node_modules/@xrkseek/exec-voice/dist/index.d.ts.map +1 -1
  212. package/node_modules/@xrkseek/exec-voice/dist/index.js +14 -8
  213. package/node_modules/@xrkseek/exec-voice/dist/index.js.map +1 -1
  214. package/node_modules/@xrkseek/exec-voice/dist/readiness.d.ts +26 -0
  215. package/node_modules/@xrkseek/exec-voice/dist/readiness.d.ts.map +1 -0
  216. package/node_modules/@xrkseek/exec-voice/dist/readiness.js +69 -0
  217. package/node_modules/@xrkseek/exec-voice/dist/readiness.js.map +1 -0
  218. package/node_modules/@xrkseek/exec-voice/dist/tools.d.ts +4 -1
  219. package/node_modules/@xrkseek/exec-voice/dist/tools.d.ts.map +1 -1
  220. package/node_modules/@xrkseek/exec-voice/dist/tools.js +3 -14
  221. package/node_modules/@xrkseek/exec-voice/dist/tools.js.map +1 -1
  222. package/node_modules/@xrkseek/exec-web/README.md +11 -11
  223. package/node_modules/@xrkseek/exec-web/dist/browser-cdp.d.ts +22 -0
  224. package/node_modules/@xrkseek/exec-web/dist/browser-cdp.d.ts.map +1 -1
  225. package/node_modules/@xrkseek/exec-web/dist/browser-cdp.js +32 -1
  226. package/node_modules/@xrkseek/exec-web/dist/browser-cdp.js.map +1 -1
  227. package/node_modules/@xrkseek/exec-web/dist/browser-runtime-registry.d.ts +21 -0
  228. package/node_modules/@xrkseek/exec-web/dist/browser-runtime-registry.d.ts.map +1 -0
  229. package/node_modules/@xrkseek/exec-web/dist/browser-runtime-registry.js +52 -0
  230. package/node_modules/@xrkseek/exec-web/dist/browser-runtime-registry.js.map +1 -0
  231. package/node_modules/@xrkseek/exec-web/dist/browser-session.d.ts +2 -0
  232. package/node_modules/@xrkseek/exec-web/dist/browser-session.d.ts.map +1 -1
  233. package/node_modules/@xrkseek/exec-web/dist/browser-session.js +3 -0
  234. package/node_modules/@xrkseek/exec-web/dist/browser-session.js.map +1 -1
  235. package/node_modules/@xrkseek/exec-web/dist/browser-tools.d.ts +9 -0
  236. package/node_modules/@xrkseek/exec-web/dist/browser-tools.d.ts.map +1 -1
  237. package/node_modules/@xrkseek/exec-web/dist/browser-tools.js +34 -15
  238. package/node_modules/@xrkseek/exec-web/dist/browser-tools.js.map +1 -1
  239. package/node_modules/@xrkseek/exec-web/dist/fetch-http.d.ts +7 -0
  240. package/node_modules/@xrkseek/exec-web/dist/fetch-http.d.ts.map +1 -1
  241. package/node_modules/@xrkseek/exec-web/dist/fetch-http.js +8 -2
  242. package/node_modules/@xrkseek/exec-web/dist/fetch-http.js.map +1 -1
  243. package/node_modules/@xrkseek/exec-web/dist/format.d.ts.map +1 -1
  244. package/node_modules/@xrkseek/exec-web/dist/format.js +4 -3
  245. package/node_modules/@xrkseek/exec-web/dist/format.js.map +1 -1
  246. package/node_modules/@xrkseek/exec-web/dist/index.d.ts +4 -2
  247. package/node_modules/@xrkseek/exec-web/dist/index.d.ts.map +1 -1
  248. package/node_modules/@xrkseek/exec-web/dist/index.js +8 -3
  249. package/node_modules/@xrkseek/exec-web/dist/index.js.map +1 -1
  250. package/node_modules/@xrkseek/exec-web/dist/outbound-allowlist.d.ts +46 -0
  251. package/node_modules/@xrkseek/exec-web/dist/outbound-allowlist.d.ts.map +1 -0
  252. package/node_modules/@xrkseek/exec-web/dist/outbound-allowlist.js +144 -0
  253. package/node_modules/@xrkseek/exec-web/dist/outbound-allowlist.js.map +1 -0
  254. package/node_modules/@xrkseek/exec-web/dist/url-policy.d.ts +6 -1
  255. package/node_modules/@xrkseek/exec-web/dist/url-policy.d.ts.map +1 -1
  256. package/node_modules/@xrkseek/exec-web/dist/url-policy.js +5 -2
  257. package/node_modules/@xrkseek/exec-web/dist/url-policy.js.map +1 -1
  258. package/node_modules/@xrkseek/im-gateway-contract/README.md +50 -0
  259. package/node_modules/@xrkseek/im-gateway-contract/dist/index.d.ts +77 -0
  260. package/node_modules/@xrkseek/im-gateway-contract/dist/index.d.ts.map +1 -0
  261. package/node_modules/@xrkseek/im-gateway-contract/dist/index.js +120 -0
  262. package/node_modules/@xrkseek/im-gateway-contract/dist/index.js.map +1 -0
  263. package/node_modules/@xrkseek/im-gateway-contract/examples/mock-sidecar.mjs +124 -0
  264. package/node_modules/@xrkseek/im-gateway-contract/package.json +25 -0
  265. package/node_modules/@xrkseek/mcp/dist/index.d.ts +1 -0
  266. package/node_modules/@xrkseek/mcp/dist/index.d.ts.map +1 -1
  267. package/node_modules/@xrkseek/mcp/dist/index.js +1 -0
  268. package/node_modules/@xrkseek/mcp/dist/index.js.map +1 -1
  269. package/node_modules/@xrkseek/mcp/dist/oauth-product.d.ts +31 -0
  270. package/node_modules/@xrkseek/mcp/dist/oauth-product.d.ts.map +1 -0
  271. package/node_modules/@xrkseek/mcp/dist/oauth-product.js +72 -0
  272. package/node_modules/@xrkseek/mcp/dist/oauth-product.js.map +1 -0
  273. package/node_modules/@xrkseek/policy/README.md +18 -15
  274. package/node_modules/@xrkseek/policy/dist/index.d.ts +1 -0
  275. package/node_modules/@xrkseek/policy/dist/index.d.ts.map +1 -1
  276. package/node_modules/@xrkseek/policy/dist/index.js +1 -0
  277. package/node_modules/@xrkseek/policy/dist/index.js.map +1 -1
  278. package/node_modules/@xrkseek/policy/dist/permission-pre.d.ts.map +1 -1
  279. package/node_modules/@xrkseek/policy/dist/permission-pre.js +1 -0
  280. package/node_modules/@xrkseek/policy/dist/permission-pre.js.map +1 -1
  281. package/node_modules/@xrkseek/policy/dist/security-guidance.d.ts +50 -0
  282. package/node_modules/@xrkseek/policy/dist/security-guidance.d.ts.map +1 -0
  283. package/node_modules/@xrkseek/policy/dist/security-guidance.js +262 -0
  284. package/node_modules/@xrkseek/policy/dist/security-guidance.js.map +1 -0
  285. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +81 -7
  286. package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
  287. package/node_modules/@xrkseek/preset-harness/dist/preset.js +307 -63
  288. package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
  289. package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
  290. package/node_modules/@xrkseek/preset-harness/package.json +53 -52
  291. package/node_modules/@xrkseek/preset-minimal/dist/preset.d.ts.map +1 -1
  292. package/node_modules/@xrkseek/preset-minimal/dist/preset.js +7 -2
  293. package/node_modules/@xrkseek/preset-minimal/dist/preset.js.map +1 -1
  294. package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
  295. package/node_modules/@xrkseek/preset-server/dist/preset.d.ts.map +1 -1
  296. package/node_modules/@xrkseek/preset-server/dist/preset.js +19 -1
  297. package/node_modules/@xrkseek/preset-server/dist/preset.js.map +1 -1
  298. package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
  299. package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts.map +1 -1
  300. package/node_modules/@xrkseek/protocol/dist/json-schema.js +3 -0
  301. package/node_modules/@xrkseek/protocol/dist/json-schema.js.map +1 -1
  302. package/node_modules/@xrkseek/protocol/dist/session-events.d.ts +18 -0
  303. package/node_modules/@xrkseek/protocol/dist/session-events.d.ts.map +1 -1
  304. package/node_modules/@xrkseek/protocol/dist/session-events.js.map +1 -1
  305. package/node_modules/@xrkseek/protocol/dist/validate.d.ts.map +1 -1
  306. package/node_modules/@xrkseek/protocol/dist/validate.js +30 -0
  307. package/node_modules/@xrkseek/protocol/dist/validate.js.map +1 -1
  308. package/node_modules/@xrkseek/runtime-invariants/README.md +28 -0
  309. package/node_modules/@xrkseek/runtime-invariants/dist/index.d.ts +94 -0
  310. package/node_modules/@xrkseek/runtime-invariants/dist/index.d.ts.map +1 -0
  311. package/node_modules/@xrkseek/runtime-invariants/dist/index.js +163 -0
  312. package/node_modules/@xrkseek/runtime-invariants/dist/index.js.map +1 -0
  313. package/node_modules/@xrkseek/runtime-invariants/package.json +27 -0
  314. package/node_modules/@xrkseek/secrets/README.md +28 -0
  315. package/node_modules/@xrkseek/secrets/dist/index.d.ts +11 -0
  316. package/node_modules/@xrkseek/secrets/dist/index.d.ts.map +1 -0
  317. package/node_modules/@xrkseek/secrets/dist/index.js +23 -0
  318. package/node_modules/@xrkseek/secrets/dist/index.js.map +1 -0
  319. package/node_modules/@xrkseek/secrets/dist/keyring.d.ts +10 -0
  320. package/node_modules/@xrkseek/secrets/dist/keyring.d.ts.map +1 -0
  321. package/node_modules/@xrkseek/secrets/dist/keyring.js +77 -0
  322. package/node_modules/@xrkseek/secrets/dist/keyring.js.map +1 -0
  323. package/node_modules/@xrkseek/secrets/dist/memory.d.ts +4 -0
  324. package/node_modules/@xrkseek/secrets/dist/memory.d.ts.map +1 -0
  325. package/node_modules/@xrkseek/secrets/dist/memory.js +21 -0
  326. package/node_modules/@xrkseek/secrets/dist/memory.js.map +1 -0
  327. package/node_modules/@xrkseek/secrets/dist/redact.d.ts +23 -0
  328. package/node_modules/@xrkseek/secrets/dist/redact.d.ts.map +1 -0
  329. package/node_modules/@xrkseek/secrets/dist/redact.js +38 -0
  330. package/node_modules/@xrkseek/secrets/dist/redact.js.map +1 -0
  331. package/node_modules/@xrkseek/secrets/dist/resolve.d.ts +10 -0
  332. package/node_modules/@xrkseek/secrets/dist/resolve.d.ts.map +1 -0
  333. package/node_modules/@xrkseek/secrets/dist/resolve.js +24 -0
  334. package/node_modules/@xrkseek/secrets/dist/resolve.js.map +1 -0
  335. package/node_modules/@xrkseek/secrets/dist/types.d.ts +27 -0
  336. package/node_modules/@xrkseek/secrets/dist/types.d.ts.map +1 -0
  337. package/node_modules/@xrkseek/secrets/dist/types.js +15 -0
  338. package/node_modules/@xrkseek/secrets/dist/types.js.map +1 -0
  339. package/node_modules/@xrkseek/secrets/package.json +29 -0
  340. package/node_modules/@xrkseek/server-config/dist/index.d.ts +6 -0
  341. package/node_modules/@xrkseek/server-config/dist/index.d.ts.map +1 -1
  342. package/node_modules/@xrkseek/server-config/dist/index.js +12 -0
  343. package/node_modules/@xrkseek/server-config/dist/index.js.map +1 -1
  344. package/node_modules/@xrkseek/server-cron/README.md +1 -1
  345. package/node_modules/@xrkseek/server-cron/dist/index.d.ts +10 -1
  346. package/node_modules/@xrkseek/server-cron/dist/index.d.ts.map +1 -1
  347. package/node_modules/@xrkseek/server-cron/dist/index.js +9 -2
  348. package/node_modules/@xrkseek/server-cron/dist/index.js.map +1 -1
  349. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts.map +1 -1
  350. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js +6 -2
  351. package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js.map +1 -1
  352. package/node_modules/@xrkseek/server-face/dist/agent-team-output.d.ts +34 -0
  353. package/node_modules/@xrkseek/server-face/dist/agent-team-output.d.ts.map +1 -0
  354. package/node_modules/@xrkseek/server-face/dist/agent-team-output.js +140 -0
  355. package/node_modules/@xrkseek/server-face/dist/agent-team-output.js.map +1 -0
  356. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.d.ts +13 -0
  357. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.d.ts.map +1 -0
  358. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js +67 -0
  359. package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js.map +1 -0
  360. package/node_modules/@xrkseek/server-face/dist/agent-team-tasks.d.ts +79 -0
  361. package/node_modules/@xrkseek/server-face/dist/agent-team-tasks.d.ts.map +1 -0
  362. package/node_modules/@xrkseek/server-face/dist/agent-team-tasks.js +230 -0
  363. package/node_modules/@xrkseek/server-face/dist/agent-team-tasks.js.map +1 -0
  364. package/node_modules/@xrkseek/server-face/dist/approval-category.d.ts +25 -0
  365. package/node_modules/@xrkseek/server-face/dist/approval-category.d.ts.map +1 -0
  366. package/node_modules/@xrkseek/server-face/dist/approval-category.js +108 -0
  367. package/node_modules/@xrkseek/server-face/dist/approval-category.js.map +1 -0
  368. package/node_modules/@xrkseek/server-face/dist/approvals.d.ts +17 -0
  369. package/node_modules/@xrkseek/server-face/dist/approvals.d.ts.map +1 -1
  370. package/node_modules/@xrkseek/server-face/dist/approvals.js +50 -0
  371. package/node_modules/@xrkseek/server-face/dist/approvals.js.map +1 -1
  372. package/node_modules/@xrkseek/server-face/dist/context.d.ts +22 -0
  373. package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
  374. package/node_modules/@xrkseek/server-face/dist/cost-meter-store.d.ts.map +1 -1
  375. package/node_modules/@xrkseek/server-face/dist/cost-meter-store.js +22 -0
  376. package/node_modules/@xrkseek/server-face/dist/cost-meter-store.js.map +1 -1
  377. package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
  378. package/node_modules/@xrkseek/server-face/dist/dispatch.js +14 -2
  379. package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
  380. package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.d.ts +87 -2
  381. package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.d.ts.map +1 -1
  382. package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.js +456 -32
  383. package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.js.map +1 -1
  384. package/node_modules/@xrkseek/server-face/dist/goal-round-driver.d.ts +48 -0
  385. package/node_modules/@xrkseek/server-face/dist/goal-round-driver.d.ts.map +1 -0
  386. package/node_modules/@xrkseek/server-face/dist/goal-round-driver.js +69 -0
  387. package/node_modules/@xrkseek/server-face/dist/goal-round-driver.js.map +1 -0
  388. package/node_modules/@xrkseek/server-face/dist/goal-store.d.ts +6 -1
  389. package/node_modules/@xrkseek/server-face/dist/goal-store.d.ts.map +1 -1
  390. package/node_modules/@xrkseek/server-face/dist/goal-store.js +45 -9
  391. package/node_modules/@xrkseek/server-face/dist/goal-store.js.map +1 -1
  392. package/node_modules/@xrkseek/server-face/dist/goal-tools.d.ts +13 -0
  393. package/node_modules/@xrkseek/server-face/dist/goal-tools.d.ts.map +1 -0
  394. package/node_modules/@xrkseek/server-face/dist/goal-tools.js +131 -0
  395. package/node_modules/@xrkseek/server-face/dist/goal-tools.js.map +1 -0
  396. package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.d.ts +10 -0
  397. package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.d.ts.map +1 -0
  398. package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.js +156 -0
  399. package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.js.map +1 -0
  400. package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts +7 -0
  401. package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
  402. package/node_modules/@xrkseek/server-face/dist/handlers/session.js +88 -2
  403. package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
  404. package/node_modules/@xrkseek/server-face/dist/handlers/subagent.d.ts.map +1 -1
  405. package/node_modules/@xrkseek/server-face/dist/handlers/subagent.js +62 -3
  406. package/node_modules/@xrkseek/server-face/dist/handlers/subagent.js.map +1 -1
  407. package/node_modules/@xrkseek/server-face/dist/index.d.ts +19 -5
  408. package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
  409. package/node_modules/@xrkseek/server-face/dist/index.js +18 -4
  410. package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
  411. package/node_modules/@xrkseek/server-face/dist/managed-worktree.d.ts +115 -0
  412. package/node_modules/@xrkseek/server-face/dist/managed-worktree.d.ts.map +1 -0
  413. package/node_modules/@xrkseek/server-face/dist/managed-worktree.js +330 -0
  414. package/node_modules/@xrkseek/server-face/dist/managed-worktree.js.map +1 -0
  415. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.d.ts +33 -0
  416. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.d.ts.map +1 -0
  417. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js +352 -0
  418. package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js.map +1 -0
  419. package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts +1 -1
  420. package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts.map +1 -1
  421. package/node_modules/@xrkseek/server-face/dist/projections/index.js.map +1 -1
  422. package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.d.ts +15 -1
  423. package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.d.ts.map +1 -1
  424. package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js +26 -2
  425. package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js.map +1 -1
  426. package/node_modules/@xrkseek/server-face/dist/propose-skill.d.ts +20 -0
  427. package/node_modules/@xrkseek/server-face/dist/propose-skill.d.ts.map +1 -0
  428. package/node_modules/@xrkseek/server-face/dist/propose-skill.js +65 -0
  429. package/node_modules/@xrkseek/server-face/dist/propose-skill.js.map +1 -0
  430. package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts +33 -0
  431. package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts.map +1 -0
  432. package/node_modules/@xrkseek/server-face/dist/ralph-tool.js +366 -0
  433. package/node_modules/@xrkseek/server-face/dist/ralph-tool.js.map +1 -0
  434. package/node_modules/@xrkseek/server-face/dist/reference-discovery.d.ts.map +1 -1
  435. package/node_modules/@xrkseek/server-face/dist/reference-discovery.js +1 -0
  436. package/node_modules/@xrkseek/server-face/dist/reference-discovery.js.map +1 -1
  437. package/node_modules/@xrkseek/server-face/dist/rollout-trace.d.ts +58 -0
  438. package/node_modules/@xrkseek/server-face/dist/rollout-trace.d.ts.map +1 -0
  439. package/node_modules/@xrkseek/server-face/dist/rollout-trace.js +194 -0
  440. package/node_modules/@xrkseek/server-face/dist/rollout-trace.js.map +1 -0
  441. package/node_modules/@xrkseek/server-face/dist/runtime.d.ts +7 -0
  442. package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
  443. package/node_modules/@xrkseek/server-face/dist/runtime.js +93 -4
  444. package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
  445. package/node_modules/@xrkseek/server-face/dist/session-export.d.ts.map +1 -1
  446. package/node_modules/@xrkseek/server-face/dist/session-export.js +74 -0
  447. package/node_modules/@xrkseek/server-face/dist/session-export.js.map +1 -1
  448. package/node_modules/@xrkseek/server-face/dist/session-query-tools.d.ts +23 -0
  449. package/node_modules/@xrkseek/server-face/dist/session-query-tools.d.ts.map +1 -0
  450. package/node_modules/@xrkseek/server-face/dist/session-query-tools.js +275 -0
  451. package/node_modules/@xrkseek/server-face/dist/session-query-tools.js.map +1 -0
  452. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +209 -0
  453. package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -0
  454. package/node_modules/@xrkseek/server-face/dist/session-status.js +559 -0
  455. package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -0
  456. package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts +2 -0
  457. package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
  458. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +67 -0
  459. package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
  460. package/node_modules/@xrkseek/server-face/dist/settings-document.d.ts +5 -0
  461. package/node_modules/@xrkseek/server-face/dist/settings-document.d.ts.map +1 -1
  462. package/node_modules/@xrkseek/server-face/dist/settings-document.js +69 -0
  463. package/node_modules/@xrkseek/server-face/dist/settings-document.js.map +1 -1
  464. package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
  465. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +220 -1
  466. package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
  467. package/node_modules/@xrkseek/server-face/dist/slash.d.ts.map +1 -1
  468. package/node_modules/@xrkseek/server-face/dist/slash.js +70 -16
  469. package/node_modules/@xrkseek/server-face/dist/slash.js.map +1 -1
  470. package/node_modules/@xrkseek/server-face/dist/subagent-registry.d.ts +4 -0
  471. package/node_modules/@xrkseek/server-face/dist/subagent-registry.d.ts.map +1 -1
  472. package/node_modules/@xrkseek/server-face/dist/subagent-registry.js +4 -0
  473. package/node_modules/@xrkseek/server-face/dist/subagent-registry.js.map +1 -1
  474. package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts +14 -1
  475. package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
  476. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +614 -62
  477. package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
  478. package/node_modules/@xrkseek/server-face/dist/subagent-worktree.d.ts.map +1 -1
  479. package/node_modules/@xrkseek/server-face/dist/subagent-worktree.js +7 -2
  480. package/node_modules/@xrkseek/server-face/dist/subagent-worktree.js.map +1 -1
  481. package/node_modules/@xrkseek/server-face/dist/types.d.ts +4 -0
  482. package/node_modules/@xrkseek/server-face/dist/types.d.ts.map +1 -1
  483. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.d.ts.map +1 -1
  484. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js +11 -0
  485. package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js.map +1 -1
  486. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts +40 -0
  487. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts.map +1 -0
  488. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js +154 -0
  489. package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js.map +1 -0
  490. package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts +1 -0
  491. package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts.map +1 -1
  492. package/node_modules/@xrkseek/server-face/dist/workspace-face.js +25 -0
  493. package/node_modules/@xrkseek/server-face/dist/workspace-face.js.map +1 -1
  494. package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts +11 -0
  495. package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts.map +1 -1
  496. package/node_modules/@xrkseek/server-face/dist/workspace-registry.js +14 -4
  497. package/node_modules/@xrkseek/server-face/dist/workspace-registry.js.map +1 -1
  498. package/node_modules/@xrkseek/server-face/package.json +3 -0
  499. package/node_modules/@xrkseek/server-host/dist/index.d.ts +61 -0
  500. package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
  501. package/node_modules/@xrkseek/server-host/dist/index.js +376 -10
  502. package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
  503. package/node_modules/@xrkseek/server-host/dist/invariants-fail-fast.d.ts +16 -0
  504. package/node_modules/@xrkseek/server-host/dist/invariants-fail-fast.d.ts.map +1 -0
  505. package/node_modules/@xrkseek/server-host/dist/invariants-fail-fast.js +24 -0
  506. package/node_modules/@xrkseek/server-host/dist/invariants-fail-fast.js.map +1 -0
  507. package/node_modules/@xrkseek/server-host/dist/standing-tools.d.ts.map +1 -1
  508. package/node_modules/@xrkseek/server-host/dist/standing-tools.js +4 -1
  509. package/node_modules/@xrkseek/server-host/dist/standing-tools.js.map +1 -1
  510. package/node_modules/@xrkseek/server-host/package.json +10 -0
  511. package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.d.ts.map +1 -1
  512. package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js +10 -4
  513. package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js.map +1 -1
  514. package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts +17 -0
  515. package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts.map +1 -1
  516. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.d.ts +8 -0
  517. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.d.ts.map +1 -1
  518. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.js +20 -5
  519. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.js.map +1 -1
  520. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.js +1 -1
  521. package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.js.map +1 -1
  522. package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js +2 -2
  523. package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js.map +1 -1
  524. package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-gateway-sidecar.d.ts +5 -17
  525. package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-gateway-sidecar.d.ts.map +1 -1
  526. package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-gateway-sidecar.js +50 -49
  527. package/node_modules/@xrkseek/server-http/dist/dsh-compat/im-gateway-sidecar.js.map +1 -1
  528. package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.d.ts +14 -4
  529. package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.d.ts.map +1 -1
  530. package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.js +30 -14
  531. package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.js.map +1 -1
  532. package/node_modules/@xrkseek/server-http/dist/dsh-compat/noema.d.ts +3 -0
  533. package/node_modules/@xrkseek/server-http/dist/dsh-compat/noema.d.ts.map +1 -1
  534. package/node_modules/@xrkseek/server-http/dist/dsh-compat/noema.js +5 -5
  535. package/node_modules/@xrkseek/server-http/dist/dsh-compat/noema.js.map +1 -1
  536. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.d.ts +5 -0
  537. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.d.ts.map +1 -1
  538. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js +1 -0
  539. package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js.map +1 -1
  540. package/node_modules/@xrkseek/server-http/package.json +1 -0
  541. package/node_modules/@xrkseek/server-loader/dist/index.d.ts +1 -1
  542. package/node_modules/@xrkseek/server-loader/dist/index.d.ts.map +1 -1
  543. package/node_modules/@xrkseek/server-loader/dist/index.js +1 -1
  544. package/node_modules/@xrkseek/server-loader/dist/index.js.map +1 -1
  545. package/node_modules/@xrkseek/server-loader/dist/shell-hooks.d.ts +75 -3
  546. package/node_modules/@xrkseek/server-loader/dist/shell-hooks.d.ts.map +1 -1
  547. package/node_modules/@xrkseek/server-loader/dist/shell-hooks.js +415 -46
  548. package/node_modules/@xrkseek/server-loader/dist/shell-hooks.js.map +1 -1
  549. package/node_modules/@xrkseek/session-format/README.md +20 -0
  550. package/node_modules/@xrkseek/session-format/dist/catalog.d.ts +27 -0
  551. package/node_modules/@xrkseek/session-format/dist/catalog.d.ts.map +1 -0
  552. package/node_modules/@xrkseek/session-format/dist/catalog.js +36 -0
  553. package/node_modules/@xrkseek/session-format/dist/catalog.js.map +1 -0
  554. package/node_modules/@xrkseek/session-format/dist/chain.d.ts +38 -0
  555. package/node_modules/@xrkseek/session-format/dist/chain.d.ts.map +1 -0
  556. package/node_modules/@xrkseek/session-format/dist/chain.js +86 -0
  557. package/node_modules/@xrkseek/session-format/dist/chain.js.map +1 -0
  558. package/node_modules/@xrkseek/session-format/dist/detect.d.ts +29 -0
  559. package/node_modules/@xrkseek/session-format/dist/detect.d.ts.map +1 -0
  560. package/node_modules/@xrkseek/session-format/dist/detect.js +68 -0
  561. package/node_modules/@xrkseek/session-format/dist/detect.js.map +1 -0
  562. package/node_modules/@xrkseek/session-format/dist/index.d.ts +12 -0
  563. package/node_modules/@xrkseek/session-format/dist/index.d.ts.map +1 -0
  564. package/node_modules/@xrkseek/session-format/dist/index.js +12 -0
  565. package/node_modules/@xrkseek/session-format/dist/index.js.map +1 -0
  566. package/node_modules/@xrkseek/session-format/dist/interchange-version.d.ts +6 -0
  567. package/node_modules/@xrkseek/session-format/dist/interchange-version.d.ts.map +1 -0
  568. package/node_modules/@xrkseek/session-format/dist/interchange-version.js +6 -0
  569. package/node_modules/@xrkseek/session-format/dist/interchange-version.js.map +1 -0
  570. package/node_modules/@xrkseek/session-format/dist/sqlite-schema.d.ts +31 -0
  571. package/node_modules/@xrkseek/session-format/dist/sqlite-schema.d.ts.map +1 -0
  572. package/node_modules/@xrkseek/session-format/dist/sqlite-schema.js +52 -0
  573. package/node_modules/@xrkseek/session-format/dist/sqlite-schema.js.map +1 -0
  574. package/node_modules/@xrkseek/session-format/package.json +24 -0
  575. package/node_modules/@xrkseek/session-telemetry/dist/index.d.ts +18 -4
  576. package/node_modules/@xrkseek/session-telemetry/dist/index.d.ts.map +1 -1
  577. package/node_modules/@xrkseek/session-telemetry/dist/index.js +97 -36
  578. package/node_modules/@xrkseek/session-telemetry/dist/index.js.map +1 -1
  579. package/node_modules/@xrkseek/spill/README.md +27 -0
  580. package/node_modules/@xrkseek/spill/dist/index.d.ts +11 -0
  581. package/node_modules/@xrkseek/spill/dist/index.d.ts.map +1 -0
  582. package/node_modules/@xrkseek/spill/dist/index.js +11 -0
  583. package/node_modules/@xrkseek/spill/dist/index.js.map +1 -0
  584. package/node_modules/@xrkseek/spill/dist/local-store.d.ts +30 -0
  585. package/node_modules/@xrkseek/spill/dist/local-store.d.ts.map +1 -0
  586. package/node_modules/@xrkseek/spill/dist/local-store.js +73 -0
  587. package/node_modules/@xrkseek/spill/dist/local-store.js.map +1 -0
  588. package/node_modules/@xrkseek/spill/dist/policy.d.ts +59 -0
  589. package/node_modules/@xrkseek/spill/dist/policy.d.ts.map +1 -0
  590. package/node_modules/@xrkseek/spill/dist/policy.js +143 -0
  591. package/node_modules/@xrkseek/spill/dist/policy.js.map +1 -0
  592. package/node_modules/@xrkseek/spill/dist/types.d.ts +46 -0
  593. package/node_modules/@xrkseek/spill/dist/types.d.ts.map +1 -0
  594. package/node_modules/@xrkseek/spill/dist/types.js +8 -0
  595. package/node_modules/@xrkseek/spill/dist/types.js.map +1 -0
  596. package/node_modules/@xrkseek/spill/package.json +27 -0
  597. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.d.ts.map +1 -1
  598. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js +2 -0
  599. package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js.map +1 -1
  600. package/node_modules/@xrkseek/workspace/dist/index.d.ts +1 -0
  601. package/node_modules/@xrkseek/workspace/dist/index.d.ts.map +1 -1
  602. package/node_modules/@xrkseek/workspace/dist/index.js +1 -0
  603. package/node_modules/@xrkseek/workspace/dist/index.js.map +1 -1
  604. package/node_modules/@xrkseek/workspace/dist/skill-propose.d.ts +71 -0
  605. package/node_modules/@xrkseek/workspace/dist/skill-propose.d.ts.map +1 -0
  606. package/node_modules/@xrkseek/workspace/dist/skill-propose.js +259 -0
  607. package/node_modules/@xrkseek/workspace/dist/skill-propose.js.map +1 -0
  608. package/node_modules/@xrkseek/xrk-file-reference-local/README.md +46 -45
  609. package/node_modules/@xrkseek/xrk-file-reference-local/README.zh.md +46 -45
  610. package/node_modules/@xrkseek/xrk-file-reference-local/dist/gitignore.d.ts +37 -0
  611. package/node_modules/@xrkseek/xrk-file-reference-local/dist/gitignore.d.ts.map +1 -0
  612. package/node_modules/@xrkseek/xrk-file-reference-local/dist/gitignore.js +91 -0
  613. package/node_modules/@xrkseek/xrk-file-reference-local/dist/gitignore.js.map +1 -0
  614. package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.d.ts +7 -0
  615. package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.d.ts.map +1 -1
  616. package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.js +46 -4
  617. package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.js.map +1 -1
  618. package/node_modules/@xrkseek/xrk-file-reference-local/package.json +30 -29
  619. package/node_modules/ignore/LICENSE-MIT +21 -0
  620. package/node_modules/ignore/README.md +452 -0
  621. package/node_modules/ignore/index.d.ts +81 -0
  622. package/node_modules/ignore/index.js +793 -0
  623. package/node_modules/ignore/legacy.js +690 -0
  624. package/node_modules/ignore/package.json +87 -0
  625. package/package.json +17 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * One-shot external agent runtimes for the subagent tool.
2
+ * One-shot and continuable external agent runtimes for the subagent tool.
3
3
  * In-process delegation stays the default; these kinds spawn a child process.
4
4
  */
5
5
  import { spawn } from "node:child_process";
@@ -20,21 +20,29 @@ function splitCommand(raw) {
20
20
  }
21
21
  return { command, args: parts.slice(1) };
22
22
  }
23
- export function resolveExternalAgentLaunch(kind, env, prompt) {
23
+ export function resolveExternalAgentLaunch(kind, env, prompt, product) {
24
24
  if (kind === "acp") {
25
- const raw = String(env.XRK_ACP_AGENT ?? "").trim();
25
+ const envRaw = String(env.XRK_ACP_AGENT ?? "").trim();
26
+ const raw = envRaw ||
27
+ (typeof product?.acpAgent === "string" ? product.acpAgent.trim() : "");
26
28
  if (!raw) {
27
- throw new ExternalAgentError("ACP runtime requires XRK_ACP_AGENT (command to spawn, e.g. xrkh acp)", "EXTERNAL_AGENT_CONFIG");
29
+ throw new ExternalAgentError("ACP runtime requires Settings external-agent.acpAgent or XRK_ACP_AGENT (e.g. xrkh acp)", "EXTERNAL_AGENT_CONFIG");
28
30
  }
29
31
  const spec = splitCommand(raw);
30
32
  return { ...spec, protocol: "acp" };
31
33
  }
32
34
  if (kind === "app-server") {
33
- const raw = String(env.XRK_CODEX_APP_SERVER ?? "codex app-server").trim();
35
+ const envRaw = String(env.XRK_CODEX_APP_SERVER ?? "").trim();
36
+ const productRaw = typeof product?.codexAppServer === "string"
37
+ ? product.codexAppServer.trim()
38
+ : "";
39
+ const raw = envRaw || productRaw || "codex app-server";
34
40
  const spec = splitCommand(raw);
35
41
  return { ...spec, protocol: "app-server" };
36
42
  }
37
- const raw = String(env.XRK_CLAUDE_CODE ?? "claude").trim();
43
+ const envRaw = String(env.XRK_CLAUDE_CODE ?? "").trim();
44
+ const productRaw = typeof product?.claudeCode === "string" ? product.claudeCode.trim() : "";
45
+ const raw = envRaw || productRaw || "claude";
38
46
  const spec = splitCommand(raw);
39
47
  return {
40
48
  command: spec.command,
@@ -42,14 +50,34 @@ export function resolveExternalAgentLaunch(kind, env, prompt) {
42
50
  protocol: "print",
43
51
  };
44
52
  }
53
+ /** Normalize Face `external-agent` section into launch product fields. */
54
+ export function parseExternalAgentProduct(raw) {
55
+ if (raw === null || raw === undefined)
56
+ return undefined;
57
+ if (typeof raw !== "object" || Array.isArray(raw))
58
+ return undefined;
59
+ const o = raw;
60
+ const acpAgent = typeof o.acpAgent === "string" ? o.acpAgent.trim() : "";
61
+ const codexAppServer = typeof o.codexAppServer === "string" ? o.codexAppServer.trim() : "";
62
+ const claudeCode = typeof o.claudeCode === "string" ? o.claudeCode.trim() : "";
63
+ if (!acpAgent && !codexAppServer && !claudeCode)
64
+ return undefined;
65
+ return {
66
+ ...(acpAgent ? { acpAgent } : {}),
67
+ ...(codexAppServer ? { codexAppServer } : {}),
68
+ ...(claudeCode ? { claudeCode } : {}),
69
+ };
70
+ }
45
71
  function writeLine(child, frame) {
46
72
  child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", ...frame })}\n`);
47
73
  }
48
- async function speakJsonRpc(child, run) {
74
+ /** Keep stdin open for multi-turn ACP / app-server sessions. */
75
+ function openJsonRpcIo(child) {
49
76
  let nextId = 1;
50
77
  const pending = new Map();
51
78
  const notes = [];
52
79
  const rl = createInterface({ input: child.stdout, crlfDelay: Infinity });
80
+ let closed = false;
53
81
  rl.on("line", (line) => {
54
82
  const trimmed = line.trim();
55
83
  if (!trimmed)
@@ -84,34 +112,51 @@ async function speakJsonRpc(child, run) {
84
112
  for (const fn of notes)
85
113
  fn(msg);
86
114
  });
87
- const request = (method, params) => {
88
- const id = nextId++;
89
- const promise = new Promise((resolve, reject) => {
90
- pending.set(id, { resolve, reject });
91
- });
92
- writeLine(child, { id, method, params });
93
- return promise;
94
- };
95
- const notify = (method, params) => {
96
- writeLine(child, { method, ...(params !== undefined ? { params } : {}) });
115
+ return {
116
+ request(method, params) {
117
+ if (closed) {
118
+ return Promise.reject(new ExternalAgentError("external rpc closed"));
119
+ }
120
+ const id = nextId++;
121
+ const promise = new Promise((resolve, reject) => {
122
+ pending.set(id, { resolve, reject });
123
+ });
124
+ writeLine(child, { id, method, params });
125
+ return promise;
126
+ },
127
+ notify(method, params) {
128
+ if (closed)
129
+ return;
130
+ writeLine(child, { method, ...(params !== undefined ? { params } : {}) });
131
+ },
132
+ onNotification(fn) {
133
+ notes.push(fn);
134
+ },
135
+ close() {
136
+ if (closed)
137
+ return;
138
+ closed = true;
139
+ rl.close();
140
+ for (const waiter of pending.values()) {
141
+ waiter.reject(new ExternalAgentError("external rpc closed"));
142
+ }
143
+ pending.clear();
144
+ try {
145
+ child.stdin.end();
146
+ }
147
+ catch {
148
+ /* ignore */
149
+ }
150
+ },
97
151
  };
152
+ }
153
+ async function speakJsonRpc(child, run) {
154
+ const io = openJsonRpcIo(child);
98
155
  try {
99
- return await run({
100
- request,
101
- notify,
102
- onNotification: (fn) => {
103
- notes.push(fn);
104
- },
105
- });
156
+ return await run(io);
106
157
  }
107
158
  finally {
108
- rl.close();
109
- try {
110
- child.stdin.end();
111
- }
112
- catch {
113
- /* ignore */
114
- }
159
+ io.close();
115
160
  }
116
161
  }
117
162
  async function runAcp(child, cwd, prompt) {
@@ -228,7 +273,7 @@ function collectPrint(child) {
228
273
  */
229
274
  export async function runExternalAgentTurn(options) {
230
275
  const env = options.env ?? process.env;
231
- const launch = resolveExternalAgentLaunch(options.kind, env, options.prompt);
276
+ const launch = resolveExternalAgentLaunch(options.kind, env, options.prompt, options.product);
232
277
  const spawnImpl = options.spawnImpl ?? spawn;
233
278
  let child;
234
279
  try {
@@ -284,4 +329,383 @@ export function parseExternalAgentKind(raw) {
284
329
  }
285
330
  return undefined;
286
331
  }
332
+ export function supportsExternalContinuable(kind) {
333
+ return kind === "acp" || kind === "app-server";
334
+ }
335
+ export async function openExternalAgentLiveSession(options) {
336
+ const env = options.env ?? process.env;
337
+ const launch = resolveExternalAgentLaunch(options.kind, env,
338
+ /* prompt unused for rpc protocols */ "", options.product);
339
+ if (launch.protocol === "print") {
340
+ throw new ExternalAgentError("claude-code print protocol cannot stay continuable", "EXTERNAL_AGENT_CONFIG");
341
+ }
342
+ const spawnImpl = options.spawnImpl ?? spawn;
343
+ let child;
344
+ try {
345
+ child = spawnImpl(launch.command, launch.args, {
346
+ cwd: options.cwd,
347
+ env: { ...env },
348
+ stdio: ["pipe", "pipe", "pipe"],
349
+ windowsHide: true,
350
+ });
351
+ }
352
+ catch (err) {
353
+ throw new ExternalAgentError(err instanceof Error ? err.message : String(err), "EXTERNAL_AGENT_SPAWN");
354
+ }
355
+ child.on("error", () => {
356
+ /* surfaced on close / request fail */
357
+ });
358
+ const io = openJsonRpcIo(child);
359
+ let disposed = false;
360
+ let busy = false;
361
+ let last = "";
362
+ let currentTurnId;
363
+ let interruptResolve;
364
+ const killChild = () => {
365
+ if (child.exitCode === null && !child.killed) {
366
+ try {
367
+ child.kill();
368
+ }
369
+ catch {
370
+ /* ignore */
371
+ }
372
+ }
373
+ };
374
+ const dispose = () => {
375
+ if (disposed)
376
+ return;
377
+ disposed = true;
378
+ interruptResolve?.();
379
+ interruptResolve = undefined;
380
+ io.close();
381
+ killChild();
382
+ };
383
+ child.on("close", () => {
384
+ disposed = true;
385
+ interruptResolve?.();
386
+ interruptResolve = undefined;
387
+ });
388
+ if (options.kind === "acp") {
389
+ const chunks = [];
390
+ io.onNotification((msg) => {
391
+ if (msg.method !== "session/update")
392
+ return;
393
+ const params = msg.params;
394
+ const text = params?.update?.content?.text;
395
+ if (text)
396
+ chunks.push(text);
397
+ });
398
+ await io.request("initialize", {
399
+ protocolVersion: 1,
400
+ clientInfo: { name: "xrk-harness", version: "0.0.0" },
401
+ });
402
+ const created = (await io.request("session/new", { cwd: options.cwd }));
403
+ if (!created?.sessionId) {
404
+ dispose();
405
+ throw new ExternalAgentError("ACP session/new missing sessionId");
406
+ }
407
+ const remoteId = created.sessionId;
408
+ return {
409
+ kind: "acp",
410
+ remoteId,
411
+ isBusy: () => busy,
412
+ lastText: () => (last ? last : undefined),
413
+ async prompt(text, signal) {
414
+ if (disposed) {
415
+ throw new ExternalAgentError("ACP session disposed");
416
+ }
417
+ if (busy) {
418
+ throw new ExternalAgentError("ACP session busy");
419
+ }
420
+ busy = true;
421
+ chunks.length = 0;
422
+ const onAbort = () => {
423
+ killChild();
424
+ };
425
+ signal?.addEventListener("abort", onAbort, { once: true });
426
+ try {
427
+ await io.request("session/prompt", {
428
+ sessionId: remoteId,
429
+ prompt: [{ type: "text", text }],
430
+ });
431
+ const out = chunks.join("").trim();
432
+ if (!out) {
433
+ throw new ExternalAgentError("ACP prompt returned no text");
434
+ }
435
+ last = out;
436
+ return out;
437
+ }
438
+ finally {
439
+ signal?.removeEventListener("abort", onAbort);
440
+ busy = false;
441
+ }
442
+ },
443
+ async interrupt() {
444
+ // ACP has no portable cancel; tear down the process.
445
+ dispose();
446
+ },
447
+ dispose,
448
+ };
449
+ }
450
+ // app-server
451
+ const messages = [];
452
+ let resolveDone;
453
+ io.onNotification((msg) => {
454
+ if (msg.method === "item/completed") {
455
+ const params = msg.params;
456
+ const item = params?.item;
457
+ if (item?.type === "agentMessage" && typeof item.text === "string") {
458
+ if (item.phase === "final_answer" || item.phase == null) {
459
+ messages.push(item.text);
460
+ }
461
+ }
462
+ }
463
+ if (msg.method === "turn/completed") {
464
+ const params = msg.params;
465
+ const status = params?.turn?.status;
466
+ resolveDone?.(status !== undefined ? { status } : {});
467
+ resolveDone = undefined;
468
+ currentTurnId = undefined;
469
+ }
470
+ });
471
+ await io.request("initialize", {
472
+ clientInfo: { name: "xrk-harness", version: "0.0.0" },
473
+ capabilities: { experimentalApi: false },
474
+ });
475
+ io.notify("initialized", {});
476
+ const thread = (await io.request("thread/start", {
477
+ cwd: options.cwd,
478
+ ephemeral: false,
479
+ approvalPolicy: "never",
480
+ sandbox: "workspace-write",
481
+ }));
482
+ const threadId = thread?.thread?.id;
483
+ if (!threadId) {
484
+ dispose();
485
+ throw new ExternalAgentError("app-server thread/start missing thread.id");
486
+ }
487
+ return {
488
+ kind: "app-server",
489
+ remoteId: threadId,
490
+ isBusy: () => busy,
491
+ lastText: () => (last ? last : undefined),
492
+ async prompt(text, signal) {
493
+ if (disposed) {
494
+ throw new ExternalAgentError("app-server session disposed");
495
+ }
496
+ if (busy) {
497
+ throw new ExternalAgentError("app-server session busy");
498
+ }
499
+ busy = true;
500
+ messages.length = 0;
501
+ const done = new Promise((resolve) => {
502
+ resolveDone = resolve;
503
+ });
504
+ const onAbort = () => {
505
+ void io
506
+ .request("turn/interrupt", {
507
+ threadId,
508
+ ...(currentTurnId ? { turnId: currentTurnId } : {}),
509
+ })
510
+ .catch(() => killChild());
511
+ };
512
+ signal?.addEventListener("abort", onAbort, { once: true });
513
+ try {
514
+ const started = (await io.request("turn/start", {
515
+ threadId,
516
+ input: [{ type: "text", text, text_elements: [] }],
517
+ }));
518
+ currentTurnId = started?.turn?.id;
519
+ const terminal = await done;
520
+ if (terminal.status && terminal.status !== "completed") {
521
+ throw new ExternalAgentError(`app-server turn ended with status ${terminal.status}`);
522
+ }
523
+ const out = messages.join("\n").trim();
524
+ if (!out) {
525
+ throw new ExternalAgentError("app-server turn completed without text");
526
+ }
527
+ last = out;
528
+ return out;
529
+ }
530
+ finally {
531
+ signal?.removeEventListener("abort", onAbort);
532
+ busy = false;
533
+ currentTurnId = undefined;
534
+ resolveDone = undefined;
535
+ }
536
+ },
537
+ async interrupt() {
538
+ if (!busy)
539
+ return;
540
+ try {
541
+ await io.request("turn/interrupt", {
542
+ threadId,
543
+ ...(currentTurnId ? { turnId: currentTurnId } : {}),
544
+ });
545
+ }
546
+ catch {
547
+ killChild();
548
+ }
549
+ },
550
+ dispose,
551
+ };
552
+ }
553
+ /** Face child session id → live ACP / app-server handle. */
554
+ export class ExternalAgentSessionRegistry {
555
+ map = new Map();
556
+ has(faceSessionId) {
557
+ return this.map.has(faceSessionId);
558
+ }
559
+ get(faceSessionId) {
560
+ return this.map.get(faceSessionId);
561
+ }
562
+ isBusy(faceSessionId) {
563
+ return this.map.get(faceSessionId)?.isBusy() === true;
564
+ }
565
+ kind(faceSessionId) {
566
+ return this.map.get(faceSessionId)?.kind;
567
+ }
568
+ attach(faceSessionId, session) {
569
+ const prev = this.map.get(faceSessionId);
570
+ if (prev && prev !== session)
571
+ prev.dispose();
572
+ this.map.set(faceSessionId, session);
573
+ }
574
+ detach(faceSessionId) {
575
+ const hit = this.map.get(faceSessionId);
576
+ if (!hit)
577
+ return;
578
+ this.map.delete(faceSessionId);
579
+ hit.dispose();
580
+ }
581
+ disposeAll() {
582
+ for (const id of [...this.map.keys()])
583
+ this.detach(id);
584
+ }
585
+ }
586
+ /** True when Face drain or an external live session is mid-turn. */
587
+ export function isChildSessionActive(runtime, sessionId) {
588
+ return (runtime.drain.isActive(sessionId) ||
589
+ runtime.externalAgents.isBusy(sessionId));
590
+ }
591
+ function recordExternalTurn(store, sessionId, userText, assistantText) {
592
+ const ts = Date.now();
593
+ const turnId = `ext-${ts}`;
594
+ store.append(sessionId, { type: "turn/start", ts, turnId });
595
+ store.append(sessionId, {
596
+ type: "user/message",
597
+ ts: ts + 1,
598
+ turnId,
599
+ content: userText,
600
+ });
601
+ store.append(sessionId, {
602
+ type: "assistant/message",
603
+ ts: ts + 2,
604
+ turnId,
605
+ stepId: "1",
606
+ content: assistantText,
607
+ });
608
+ store.append(sessionId, {
609
+ type: "turn/end",
610
+ ts: ts + 3,
611
+ turnId,
612
+ reason: { kind: "completed" },
613
+ });
614
+ }
615
+ /**
616
+ * Open ACP / app-server live session, attach to Face child id, run first prompt.
617
+ * Background: kicks the turn and returns; completion steers parent via drain hooks.
618
+ */
619
+ export async function startExternalContinuable(options) {
620
+ if (!supportsExternalContinuable(options.kind)) {
621
+ throw new ExternalAgentError(`runtime ${options.kind} does not support continuable sessions`, "EXTERNAL_AGENT_CONFIG");
622
+ }
623
+ const live = await openExternalAgentLiveSession({
624
+ kind: options.kind,
625
+ cwd: options.cwd,
626
+ ...(options.env ? { env: options.env } : {}),
627
+ ...(options.product ? { product: options.product } : {}),
628
+ ...(options.spawnImpl ? { spawnImpl: options.spawnImpl } : {}),
629
+ });
630
+ options.runtime.externalAgents.attach(options.faceSessionId, live);
631
+ const runTurn = async () => {
632
+ options.runtime.onSessionDrainStatus(options.faceSessionId, true);
633
+ try {
634
+ const text = await live.prompt(options.prompt, options.signal);
635
+ recordExternalTurn(options.runtime.store, options.faceSessionId, options.prompt, text);
636
+ return text;
637
+ }
638
+ finally {
639
+ options.runtime.onSessionDrainStatus(options.faceSessionId, false);
640
+ }
641
+ };
642
+ if (options.background) {
643
+ void runTurn().catch(() => {
644
+ /* parent sees failure via empty history / wait_agent; process may still live */
645
+ });
646
+ return { kind: options.kind };
647
+ }
648
+ const text = await runTurn();
649
+ return { text, kind: options.kind };
650
+ }
651
+ /**
652
+ * Follow-up prompt on an attached external live session (send_message / followup_task).
653
+ */
654
+ export async function promptExternalContinuable(runtime, faceSessionId, message, opts) {
655
+ const live = runtime.externalAgents.get(faceSessionId);
656
+ if (!live) {
657
+ throw new ExternalAgentError(`no external live session for ${faceSessionId}`, "EXTERNAL_AGENT_MISSING");
658
+ }
659
+ if (live.isBusy()) {
660
+ if (!opts?.steer) {
661
+ throw new ExternalAgentError(`${faceSessionId} is busy; use wait_agent or delivery=steer`, "EXTERNAL_AGENT_BUSY");
662
+ }
663
+ // Soft-steer: wait for the in-flight turn (ACP has no portable cancel).
664
+ // Hard cancel remains interrupt_agent → dispose.
665
+ const deadline = Date.now() + 5 * 60 * 1000;
666
+ while (live.isBusy() && Date.now() < deadline) {
667
+ if (opts.signal?.aborted) {
668
+ throw new DOMException("aborted", "AbortError");
669
+ }
670
+ await new Promise((r) => setTimeout(r, 40));
671
+ }
672
+ if (live.isBusy()) {
673
+ throw new ExternalAgentError(`${faceSessionId} still busy after steer wait`, "EXTERNAL_AGENT_BUSY");
674
+ }
675
+ }
676
+ runtime.onSessionDrainStatus(faceSessionId, true);
677
+ try {
678
+ const text = await live.prompt(message, opts?.signal);
679
+ recordExternalTurn(runtime.store, faceSessionId, message, text);
680
+ return text;
681
+ }
682
+ finally {
683
+ runtime.onSessionDrainStatus(faceSessionId, false);
684
+ }
685
+ }
686
+ export async function interruptExternalContinuable(runtime, faceSessionId, opts) {
687
+ const live = runtime.externalAgents.get(faceSessionId);
688
+ if (!live)
689
+ return;
690
+ runtime.suppressOwnedSubagentCompletion(faceSessionId);
691
+ await live.interrupt();
692
+ if (opts?.dispose !== false) {
693
+ runtime.externalAgents.detach(faceSessionId);
694
+ }
695
+ }
696
+ export function contentPartsToText(content) {
697
+ if (typeof content === "string")
698
+ return content.trim();
699
+ if (!Array.isArray(content))
700
+ return "";
701
+ const parts = [];
702
+ for (const part of content) {
703
+ if (!part || typeof part !== "object")
704
+ continue;
705
+ const p = part;
706
+ if (p.type === "text" && typeof p.text === "string")
707
+ parts.push(p.text);
708
+ }
709
+ return parts.join("\n").trim();
710
+ }
287
711
  //# sourceMappingURL=external-agent-runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-agent-runtime.js","sourceRoot":"","sources":["../src/external-agent-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAuC,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAehD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAAS;IAEtB,YAAY,OAAe,EAAE,IAAI,GAAG,gBAAgB;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,IAAI,CAAC,OAAO,EAAE,CA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4B,CAChD,OAA0B,EAC1B,aAAqB,EACrB,IAAqC;IAErC,MAAM,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACvD,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,OAAO,CAAC,+BAA+B,CAAC,aAAa,CAAC,CAAC;IACvD,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;IACvB,IAAI,IAAI,EAAE,OAAO,KAAK,KAAK,EAAE,CAAC;QAC5B,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IACjD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC;IACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,SAAS;QAChD,MAAM,CAAC,GAAG,IAAyC,CAAC;QACpD,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Same-session goal round driver helpers (dsh goal-round-driver semantics,
3
+ * without Cordis). FaceGoalStore owns state; this module owns the retained
4
+ * continuation prompt and turn/end scheduling decisions.
5
+ */
6
+ /** Minimal goal fields the driver needs. */
7
+ export interface GoalRoundSnapshot {
8
+ readonly objective: string;
9
+ readonly phase: "active" | "paused" | "blocked" | "complete";
10
+ readonly activation: "armed" | "disarmed";
11
+ readonly maxGoalRounds: number;
12
+ readonly roundsStarted: number;
13
+ }
14
+ export type GoalTurnEndDecision = {
15
+ readonly kind: "noop";
16
+ } | {
17
+ readonly kind: "wake-pending";
18
+ } | {
19
+ readonly kind: "continue";
20
+ readonly round: number;
21
+ readonly prompt: string;
22
+ } | {
23
+ readonly kind: "block";
24
+ readonly code: string;
25
+ readonly message: string;
26
+ } | {
27
+ readonly kind: "disarm";
28
+ readonly code: string;
29
+ readonly message: string;
30
+ };
31
+ /**
32
+ * Render the retained `<goal_round>` user prompt for one automatic round.
33
+ * Round is 1-based and must equal `roundsStarted + 1` at admission time.
34
+ */
35
+ export declare function renderGoalRoundPrompt(goal: Pick<GoalRoundSnapshot, "objective" | "maxGoalRounds">, round: number): string;
36
+ /** First-round / resume prompt (still tags `<goal_round>` for model consistency). */
37
+ export declare function renderGoalStartPrompt(goal: Pick<GoalRoundSnapshot, "objective" | "maxGoalRounds">, round: number, lead: "start" | "resume"): string;
38
+ /**
39
+ * Decide what happens after `turn/end` for an armed active goal.
40
+ * @param hasPendingAdmits - session already has queued admits (wake only).
41
+ * @param turnReasonKind - `turn/end.reason.kind` when present.
42
+ */
43
+ export declare function decideGoalTurnEnd(input: {
44
+ readonly goal: GoalRoundSnapshot;
45
+ readonly hasPendingAdmits: boolean;
46
+ readonly turnReasonKind?: string;
47
+ }): GoalTurnEndDecision;
48
+ //# sourceMappingURL=goal-round-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goal-round-driver.d.ts","sourceRoot":"","sources":["../src/goal-round-driver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;IA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