@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
@@ -5,7 +5,24 @@ export { opsRecord, recordFromSessionEvent, } from "./record.js";
5
5
  export { createMemorySessionTelemetrySink, } from "./memory.js";
6
6
  export { createOtlpHttpSessionTelemetrySink, resolveOtlpLogsEndpoint, } from "./otlp-http.js";
7
7
  export { wrapStoreForSessionTelemetry, } from "./wrap-store.js";
8
- export function sessionTelemetryUnavailableMessage(env = process.env) {
8
+ /** Parse a Face `session-telemetry` namespace value (unknown → product or undefined). */
9
+ export function parseSessionTelemetryProduct(raw) {
10
+ if (!raw || typeof raw !== "object" || Array.isArray(raw))
11
+ return undefined;
12
+ const row = raw;
13
+ const modeRaw = typeof row.mode === "string" ? row.mode.trim().toLowerCase() : "";
14
+ const mode = modeRaw === "memory" || modeRaw === "otlp" || modeRaw === "off"
15
+ ? modeRaw
16
+ : "off";
17
+ const endpoint = typeof row.endpoint === "string" && row.endpoint.trim()
18
+ ? row.endpoint.trim()
19
+ : undefined;
20
+ return {
21
+ mode,
22
+ ...(endpoint ? { endpoint } : {}),
23
+ };
24
+ }
25
+ export function sessionTelemetryUnavailableMessage(env = process.env, product) {
9
26
  const flag = String(env.XRK_TELEMETRY ?? "").trim().toLowerCase();
10
27
  if (flag === "0" || flag === "off" || flag === "disabled") {
11
28
  return "Session telemetry disabled (XRK_TELEMETRY=0).";
@@ -17,61 +34,105 @@ export function sessionTelemetryUnavailableMessage(env = process.env) {
17
34
  return ("XRK_TELEMETRY=1 but no OTLP endpoint. Set XRK_TELEMETRY_OTLP_ENDPOINT " +
18
35
  "or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT / OTEL_EXPORTER_OTLP_ENDPOINT.");
19
36
  }
20
- return ("Session telemetry is off. Set XRK_TELEMETRY=memory, or XRK_TELEMETRY=1 " +
21
- "with an OTLP logs endpoint. See docs/session-telemetry.md.");
37
+ if (flag === "" && product) {
38
+ if (product.mode === "off") {
39
+ return "Session telemetry disabled (Settings → session-telemetry mode=off).";
40
+ }
41
+ if (product.mode === "memory") {
42
+ return "Session telemetry memory sink (Settings).";
43
+ }
44
+ return ("Session telemetry OTLP (Settings) but no endpoint. Set endpoint in " +
45
+ "Settings or XRK_TELEMETRY_OTLP_ENDPOINT / OTEL_*.");
46
+ }
47
+ return ("Session telemetry is off. Set Settings → session-telemetry, or " +
48
+ "XRK_TELEMETRY=memory / XRK_TELEMETRY=1 with an OTLP logs endpoint. " +
49
+ "See docs/session-telemetry.md.");
50
+ }
51
+ function otlpHeadersFromEnv(env) {
52
+ const headersRaw = String(env.OTEL_EXPORTER_OTLP_HEADERS ?? "").trim();
53
+ const headers = {};
54
+ if (!headersRaw)
55
+ return headers;
56
+ for (const part of headersRaw.split(",")) {
57
+ const idx = part.indexOf("=");
58
+ if (idx <= 0)
59
+ continue;
60
+ headers[part.slice(0, idx).trim()] = part.slice(idx + 1).trim();
61
+ }
62
+ return headers;
63
+ }
64
+ function buildOtlpSink(endpoint, options, env) {
65
+ const headers = otlpHeadersFromEnv(env);
66
+ return createOtlpHttpSessionTelemetrySink({
67
+ endpoint,
68
+ ...(Object.keys(headers).length ? { headers } : {}),
69
+ ...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
70
+ ...(options.serviceName ? { serviceName: options.serviceName } : {}),
71
+ });
22
72
  }
23
73
  /**
24
74
  * Resolve a session-telemetry sink.
25
75
  * - Injected `sink` wins.
26
- * - `XRK_TELEMETRY=0` → disabled.
27
- * - `XRK_TELEMETRY=memory` → memory sink.
28
- * - `XRK_TELEMETRY=1` / `otlp` + endpoint → OTLP/HTTP logs.
76
+ * - Non-empty `XRK_TELEMETRY` → env path (CI bypass over Settings).
77
+ * - Else Face `product` (`off` / `memory` / `otlp` + endpoint).
29
78
  * - Else if a standard OTEL_* endpoint is set → OTLP (opt-in via endpoint alone).
79
+ * - Else disabled.
30
80
  */
31
81
  export function createDefaultSessionTelemetryAccess(options = {}) {
32
82
  const env = options.env ?? process.env;
33
- const unavailableMessage = sessionTelemetryUnavailableMessage(env);
83
+ const product = options.product;
84
+ const unavailableMessage = sessionTelemetryUnavailableMessage(env, product);
34
85
  if (options.sink) {
35
86
  return { sink: options.sink, unavailableMessage };
36
87
  }
37
88
  const flag = String(env.XRK_TELEMETRY ?? "").trim().toLowerCase();
38
- if (flag === "0" || flag === "off" || flag === "disabled") {
89
+ // CI / shell bypass: any explicit XRK_TELEMETRY wins over Face Settings.
90
+ if (flag !== "") {
91
+ if (flag === "0" || flag === "off" || flag === "disabled") {
92
+ return { unavailableMessage };
93
+ }
94
+ if (flag === "memory") {
95
+ return {
96
+ sink: createMemorySessionTelemetrySink(),
97
+ unavailableMessage,
98
+ };
99
+ }
100
+ const endpoint = resolveOtlpLogsEndpoint(env);
101
+ const wantOtlp = flag === "1" || flag === "otlp" || flag === "otel";
102
+ if (wantOtlp) {
103
+ if (!endpoint)
104
+ return { unavailableMessage };
105
+ return {
106
+ sink: buildOtlpSink(endpoint, options, env),
107
+ unavailableMessage,
108
+ };
109
+ }
39
110
  return { unavailableMessage };
40
111
  }
41
- if (flag === "memory") {
112
+ // Product Settings (Face `session-telemetry`).
113
+ if (product) {
114
+ if (product.mode === "off") {
115
+ return { unavailableMessage };
116
+ }
117
+ if (product.mode === "memory") {
118
+ return {
119
+ sink: createMemorySessionTelemetrySink(),
120
+ unavailableMessage,
121
+ };
122
+ }
123
+ const endpoint = product.endpoint?.trim() || resolveOtlpLogsEndpoint(env) || undefined;
124
+ if (!endpoint)
125
+ return { unavailableMessage };
42
126
  return {
43
- sink: createMemorySessionTelemetrySink(),
127
+ sink: buildOtlpSink(endpoint, options, env),
44
128
  unavailableMessage,
45
129
  };
46
130
  }
131
+ // Legacy: OTEL endpoint alone still opt-in when no Face product was passed.
47
132
  const endpoint = resolveOtlpLogsEndpoint(env);
48
- const wantOtlp = flag === "1" ||
49
- flag === "otlp" ||
50
- flag === "otel" ||
51
- (flag === "" && Boolean(endpoint));
52
- if (wantOtlp) {
53
- if (!endpoint) {
54
- return { unavailableMessage };
55
- }
56
- const headersRaw = String(env.OTEL_EXPORTER_OTLP_HEADERS ?? "").trim();
57
- const headers = {};
58
- if (headersRaw) {
59
- for (const part of headersRaw.split(",")) {
60
- const idx = part.indexOf("=");
61
- if (idx <= 0)
62
- continue;
63
- headers[part.slice(0, idx).trim()] = part.slice(idx + 1).trim();
64
- }
65
- }
133
+ if (endpoint) {
66
134
  return {
67
- sink: createOtlpHttpSessionTelemetrySink({
68
- endpoint,
69
- ...(Object.keys(headers).length ? { headers } : {}),
70
- ...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
71
- ...(options.serviceName
72
- ? { serviceName: options.serviceName }
73
- : {}),
74
- }),
135
+ sink: buildOtlpSink(endpoint, options, env),
75
136
  unavailableMessage,
76
137
  };
77
138
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,kCAAkC,EAClC,uBAAuB,GAExB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,qBAAqB,GAKtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gCAAgC,GAEjC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kCAAkC,EAClC,uBAAuB,GAGxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,4BAA4B,GAE7B,MAAM,iBAAiB,CAAC;AAczB,MAAM,UAAU,kCAAkC,CAChD,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAClE,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QAC1D,OAAO,+CAA+C,CAAC;IACzD,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,gCAAgC,CAAC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AAI,EAAE,IAAI,uBAAuB,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;QACxE,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;QAC7C,OAAO;YACL,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC;YAC3C,kBAAkB;SACnB,CAAC;IACJ,CAAC;IAED,4EAA4E;IAC5E,MAAM,QAAQ,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;YACL,IAAI,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC;YAC3C,kBAAkB;SACnB,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAChC,CAAC"}
@@ -0,0 +1,27 @@
1
+ # `@xrkseek/spill`
2
+
3
+ > **读者**:贡献者 · Host / agent-loop 维护者。
4
+
5
+ 工具结果溢出(spill)的 **locator 契约**、本机存储、与策略层分离。
6
+
7
+ | 层 | 职责 |
8
+ |----|------|
9
+ | `SpillStore` / `LocalSpillStore` | 落盘、返回不透明 `SpillLocator` + `retrievalHint` |
10
+ | `applySpillPolicy` / `formatSpillNotice` | 何时溢出、inline 预览、模型可见 notice |
11
+ | `parseSpillLocator` | 从 pipeline / loop notice 解析路径(概况 Status 打开 spill) |
12
+
13
+ 默认根目录:`{XRK_HOME}/spill`(工具结果在 `tool-outputs/`)。
14
+
15
+ ---
16
+
17
+ > **Audience**: Contributors · Host / agent-loop maintainers.
18
+
19
+ **Locator contract**, local store, and policy layer for oversized tool results — storage ≠ policy.
20
+
21
+ | Layer | Role |
22
+ |-------|------|
23
+ | `SpillStore` / `LocalSpillStore` | Persist bytes; return opaque `SpillLocator` + `retrievalHint` |
24
+ | `applySpillPolicy` / `formatSpillNotice` | When to spill, inline preview, model-facing notice |
25
+ | `parseSpillLocator` | Parse path from pipeline / loop notices (Status “open spill”) |
26
+
27
+ Default root: `{XRK_HOME}/spill` (`tool-outputs/` for tool bodies).
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `@xrkseek/spill` — locator contract, local store, tool-result spill policy.
3
+ *
4
+ * Storage ({@link SpillStore} / {@link LocalSpillStore}) and policy
5
+ * ({@link applySpillPolicy} / notices) are separate packages-of-concern so
6
+ * Host / agent-loop can swap backends without rewriting notice text.
7
+ */
8
+ export { SpillLocator, type SpillOwner, type SpillSource, type SaveTextSpill, type SpillRef, type SpillStore, } from "./types.js";
9
+ export { LocalSpillStore, defaultLocalSpillStore, defaultSpillRoot, encodeSpillSegment, resetDefaultLocalSpillStore, type LocalSpillStoreOptions, } from "./local-store.js";
10
+ export { NO_SPILL_TOOLS, DEFAULT_SPILL_INLINE_BYTES, utf8Bytes, utf8Prefix, utf8Suffix, headTail, formatSpillNotice, parseSpillLocator, alreadySavedPath, fitInlineNotice, applySpillPolicy, type ApplySpillPolicyInput, type ApplySpillPolicyResult, } from "./policy.js";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,KAAK,sBAAsB,GAC5B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `@xrkseek/spill` — locator contract, local store, tool-result spill policy.
3
+ *
4
+ * Storage ({@link SpillStore} / {@link LocalSpillStore}) and policy
5
+ * ({@link applySpillPolicy} / notices) are separate packages-of-concern so
6
+ * Host / agent-loop can swap backends without rewriting notice text.
7
+ */
8
+ export { SpillLocator, } from "./types.js";
9
+ export { LocalSpillStore, defaultLocalSpillStore, defaultSpillRoot, encodeSpillSegment, resetDefaultLocalSpillStore, } from "./local-store.js";
10
+ export { NO_SPILL_TOOLS, DEFAULT_SPILL_INLINE_BYTES, utf8Bytes, utf8Prefix, utf8Suffix, headTail, formatSpillNotice, parseSpillLocator, alreadySavedPath, fitInlineNotice, applySpillPolicy, } from "./policy.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,YAAY,GAMb,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,GAE5B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GAGjB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Host-filesystem spill backend under `{XRK_HOME}/spill`.
3
+ */
4
+ import { type SaveTextSpill, type SpillRef, type SpillStore } from "./types.js";
5
+ export interface LocalSpillStoreOptions {
6
+ readonly env?: NodeJS.ProcessEnv;
7
+ /** Override spill root (tests). Default `{XRK_HOME}/spill`. */
8
+ readonly root?: string;
9
+ /** Subdir under root for tool results. Default `tool-outputs`. */
10
+ readonly toolRelativeDir?: string;
11
+ }
12
+ /** Encode one untrusted string as a single safe path segment. */
13
+ export declare function encodeSpillSegment(raw: string): string;
14
+ export declare function defaultSpillRoot(env?: NodeJS.ProcessEnv): string;
15
+ /** Local filesystem {@link SpillStore}. */
16
+ export declare class LocalSpillStore implements SpillStore {
17
+ private readonly root;
18
+ private readonly toolRelativeDir;
19
+ private readonly env;
20
+ constructor(options?: LocalSpillStoreOptions);
21
+ /** Absolute spill tree root (Host `hostReadableRoots`). */
22
+ get spillRoot(): string;
23
+ saveText(input: SaveTextSpill): Promise<SpillRef>;
24
+ saveTextSync(input: SaveTextSpill): SpillRef;
25
+ }
26
+ /** Process-wide default local store (lazy; rebinds when XRK_HOME changes). */
27
+ export declare function defaultLocalSpillStore(env?: NodeJS.ProcessEnv): LocalSpillStore;
28
+ /** Test hook: drop the shared singleton. */
29
+ export declare function resetDefaultLocalSpillStore(): void;
30
+ //# sourceMappingURL=local-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-store.d.ts","sourceRoot":"","sources":["../src/local-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE7E;AAED,2CAA2C;AAC3C,qBAAa,eAAgB,YAAW,UAAU;IAChD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAoB;gBAE5B,OAAO,GAAE,sBAA2B;IAShD,2DAA2D;IAC3D,IAAI,SAAS,IAAI,MAAM,CAEtB;IAEK,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIvD,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ;CA6B7C;AAKD,8EAA8E;AAC9E,wBAAgB,sBAAsB,CACpC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,eAAe,CAOjB;AAED,4CAA4C;AAC5C,wBAAgB,2BAA2B,IAAI,IAAI,CAGlD"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Host-filesystem spill backend under `{XRK_HOME}/spill`.
3
+ */
4
+ import { mkdirSync, writeFileSync } from "node:fs";
5
+ import path from "node:path";
6
+ import { capSpillText, pruneSpillTree, resolveXrkHome, } from "@xrkseek/xrk-home-paths";
7
+ import { SpillLocator, } from "./types.js";
8
+ const DEFAULT_RETRIEVAL = "Retrieve with read_file or grep on that path.";
9
+ /** Encode one untrusted string as a single safe path segment. */
10
+ export function encodeSpillSegment(raw) {
11
+ if (raw.length === 0)
12
+ return "_";
13
+ return raw.replace(/[^\w.-]+/g, "_").slice(0, 120) || "_";
14
+ }
15
+ export function defaultSpillRoot(env = process.env) {
16
+ return path.join(resolveXrkHome(env), "spill");
17
+ }
18
+ /** Local filesystem {@link SpillStore}. */
19
+ export class LocalSpillStore {
20
+ root;
21
+ toolRelativeDir;
22
+ env;
23
+ constructor(options = {}) {
24
+ this.env = options.env ?? process.env;
25
+ this.root = path.resolve(options.root ?? defaultSpillRoot(this.env));
26
+ this.toolRelativeDir = (options.toolRelativeDir ?? "tool-outputs").replace(/\\/g, "/");
27
+ }
28
+ /** Absolute spill tree root (Host `hostReadableRoots`). */
29
+ get spillRoot() {
30
+ return this.root;
31
+ }
32
+ async saveText(input) {
33
+ return this.saveTextSync(input);
34
+ }
35
+ saveTextSync(input) {
36
+ pruneSpillTree(this.root);
37
+ const dir = input.source.kind === "tool"
38
+ ? path.join(this.root, this.toolRelativeDir)
39
+ : path.join(this.root, encodeSpillSegment(input.owner.sessionId));
40
+ mkdirSync(dir, { recursive: true });
41
+ const base = encodeSpillSegment(input.suggestedName.replace(/\.[^.]+$/, "") || "spill");
42
+ const ext = path.extname(input.suggestedName).replace(/[^\w.]/g, "") || ".txt";
43
+ const name = input.source.kind === "tool"
44
+ ? `${encodeSpillSegment(input.owner.sessionId)}_${encodeSpillSegment(input.source.callId) || "call"}${ext.startsWith(".") ? ext : `.${ext}`}`
45
+ : `${base}_${Date.now().toString(36)}${ext.startsWith(".") ? ext : `.${ext}`}`;
46
+ const file = path.join(dir, name);
47
+ const body = capSpillText(input.content);
48
+ writeFileSync(file, body, "utf8");
49
+ const bytes = Buffer.byteLength(body, "utf8");
50
+ return {
51
+ locator: SpillLocator(file),
52
+ bytes,
53
+ retrievalHint: DEFAULT_RETRIEVAL,
54
+ };
55
+ }
56
+ }
57
+ let shared;
58
+ let sharedHome;
59
+ /** Process-wide default local store (lazy; rebinds when XRK_HOME changes). */
60
+ export function defaultLocalSpillStore(env = process.env) {
61
+ const home = resolveXrkHome(env);
62
+ if (!shared || sharedHome !== home) {
63
+ shared = new LocalSpillStore({ env });
64
+ sharedHome = home;
65
+ }
66
+ return shared;
67
+ }
68
+ /** Test hook: drop the shared singleton. */
69
+ export function resetDefaultLocalSpillStore() {
70
+ shared = undefined;
71
+ sharedHome = undefined;
72
+ }
73
+ //# sourceMappingURL=local-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-store.js","sourceRoot":"","sources":["../src/local-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,cAAc,EACd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AM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO;YACL,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC;YAC3B,KAAK;YACL,aAAa,EAAE,iBAAiB;SACjC,CAAC;IACJ,CAAC;CACF;AAED,IAAI,MAAmC,CAAC;AACxC,IAAI,UAA8B,CAAC;AAEnC,8EAA8E;AAC9E,MAAM,UAAU,sBAAsB,CACpC,MAAyB,OAAO,CAAC,GAAG;IAEpC,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,CAAC,MAAM,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACnC,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACtC,UAAU,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,2BAA2B;IACzC,MAAM,GAAG,SAAS,CAAC;IACnB,UAAU,GAAG,SAAS,CAAC;AACzB,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Tool-result spill policy — decides when/how to spill; storage stays on SpillStore.
3
+ * Learned from dsh `@deepseek-ai/dsh-spill-policy` (notice · skip tools · head/tail).
4
+ */
5
+ import type { SpillLocator, SpillRef, SpillStore } from "./types.js";
6
+ /** Tools that must stay inline (avoid read → spill → read loops). */
7
+ export declare const NO_SPILL_TOOLS: Set<string>;
8
+ /** Default inline ceiling (UTF-8 bytes); Face may override. */
9
+ export declare const DEFAULT_SPILL_INLINE_BYTES = 64000;
10
+ export declare function utf8Bytes(text: string): number;
11
+ /** Prefix of `text` with at most `maxBytes` UTF-8 bytes (no mid-sequence cut). */
12
+ export declare function utf8Prefix(text: string, maxBytes: number): string;
13
+ /** Suffix of `text` with at most `maxBytes` UTF-8 bytes. */
14
+ export declare function utf8Suffix(text: string, maxBytes: number): string;
15
+ /** Head/tail preview: half budget each end, omit the middle. */
16
+ export declare function headTail(text: string, budget: number): string;
17
+ /**
18
+ * Model-facing spill notice (dsh-compatible wording).
19
+ * Keep stable — Host timeline / UI parse the path after `stored at:`.
20
+ */
21
+ export declare function formatSpillNotice(args: {
22
+ readonly omittedBytes: number;
23
+ readonly ref: SpillRef;
24
+ /**
25
+ * When the body was already persisted by pipeline `persist`, skip the
26
+ * “(omitted ~N bytes…)” prefix so markers stay short.
27
+ */
28
+ readonly alreadyPersisted?: boolean;
29
+ }): string;
30
+ /**
31
+ * Parse a spill locator from pipeline / loop notices.
32
+ * Prefer an authoritative `savedPath` from the tool pipeline when present.
33
+ */
34
+ export declare function parseSpillLocator(text: string): SpillLocator | undefined;
35
+ /** @deprecated Prefer {@link parseSpillLocator}. */
36
+ export declare const alreadySavedPath: (text: string) => string | undefined;
37
+ export declare function fitInlineNotice(notice: string, plain: string, maxInline: number): string;
38
+ export interface ApplySpillPolicyInput {
39
+ readonly sessionId: string;
40
+ readonly callId: string;
41
+ readonly toolName: string;
42
+ readonly plainText: string;
43
+ /** UTF-8 inline ceiling; omit → {@link DEFAULT_SPILL_INLINE_BYTES}; `0` → no spill. */
44
+ readonly maxInlineBytes?: number;
45
+ /** Authoritative full-body path from pipeline `outputPaths`. */
46
+ readonly savedPath?: string;
47
+ readonly store: SpillStore;
48
+ }
49
+ export interface ApplySpillPolicyResult {
50
+ readonly content: string;
51
+ readonly spilled: boolean;
52
+ readonly ref?: SpillRef;
53
+ }
54
+ /**
55
+ * Apply spill policy against a {@link SpillStore}.
56
+ * Sync when `store.saveTextSync` exists; otherwise throws (agent-loop needs sync).
57
+ */
58
+ export declare function applySpillPolicy(input: ApplySpillPolicyInput): ApplySpillPolicyResult;
59
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0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,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,qBAAqB,GAC3B,sBAAsB,CAyDxB"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Tool-result spill policy — decides when/how to spill; storage stays on SpillStore.
3
+ * Learned from dsh `@deepseek-ai/dsh-spill-policy` (notice · skip tools · head/tail).
4
+ */
5
+ import { SpillLocator as asSpillLocator } from "./types.js";
6
+ /** Tools that must stay inline (avoid read → spill → read loops). */
7
+ export const NO_SPILL_TOOLS = new Set(["read_file", "read", "read_image"]);
8
+ /** Default inline ceiling (UTF-8 bytes); Face may override. */
9
+ export const DEFAULT_SPILL_INLINE_BYTES = 64_000;
10
+ export function utf8Bytes(text) {
11
+ return Buffer.byteLength(text, "utf8");
12
+ }
13
+ /** Prefix of `text` with at most `maxBytes` UTF-8 bytes (no mid-sequence cut). */
14
+ export function utf8Prefix(text, maxBytes) {
15
+ if (maxBytes <= 0)
16
+ return "";
17
+ if (utf8Bytes(text) <= maxBytes)
18
+ return text;
19
+ let end = Math.min(text.length, maxBytes);
20
+ let out = text.slice(0, end);
21
+ while (end > 0 && utf8Bytes(out) > maxBytes) {
22
+ end -= 1;
23
+ out = text.slice(0, end);
24
+ }
25
+ return out;
26
+ }
27
+ /** Suffix of `text` with at most `maxBytes` UTF-8 bytes. */
28
+ export function utf8Suffix(text, maxBytes) {
29
+ if (maxBytes <= 0)
30
+ return "";
31
+ if (utf8Bytes(text) <= maxBytes)
32
+ return text;
33
+ let start = Math.max(0, text.length - maxBytes);
34
+ let out = text.slice(start);
35
+ while (start < text.length && utf8Bytes(out) > maxBytes) {
36
+ start += 1;
37
+ out = text.slice(start);
38
+ }
39
+ return out;
40
+ }
41
+ /** Head/tail preview: half budget each end, omit the middle. */
42
+ export function headTail(text, budget) {
43
+ if (utf8Bytes(text) <= budget)
44
+ return text;
45
+ const marker = "\n\n[... middle omitted ...]\n\n";
46
+ const markerBytes = utf8Bytes(marker);
47
+ const keep = Math.max(0, budget - markerBytes);
48
+ const headBytes = Math.ceil(keep / 2);
49
+ const tailBytes = Math.floor(keep / 2);
50
+ return `${utf8Prefix(text, headBytes)}${marker}${utf8Suffix(text, tailBytes)}`;
51
+ }
52
+ /**
53
+ * Model-facing spill notice (dsh-compatible wording).
54
+ * Keep stable — Host timeline / UI parse the path after `stored at:`.
55
+ */
56
+ export function formatSpillNotice(args) {
57
+ const loc = String(args.ref.locator);
58
+ const hint = args.ref.retrievalHint.trim() || "Retrieve with read_file or grep on that path.";
59
+ if (args.alreadyPersisted) {
60
+ return `Full formatted result stored at: ${loc}. ${hint}\n\n`;
61
+ }
62
+ return (`(omitted ~${args.omittedBytes} bytes. Full formatted result stored at: ${loc}. ` +
63
+ `${hint})\n\n`);
64
+ }
65
+ /**
66
+ * Parse a spill locator from pipeline / loop notices.
67
+ * Prefer an authoritative `savedPath` from the tool pipeline when present.
68
+ */
69
+ export function parseSpillLocator(text) {
70
+ const pipeline = text.match(/full content saved to (.+?)(?: \.\.\.| \.\.\.$|$)/m);
71
+ const loop = text.match(/Full formatted result stored at: (.+?)\. Retrieve/);
72
+ const loc = (pipeline?.[1] ?? loop?.[1])?.trim();
73
+ return loc ? asSpillLocator(loc) : undefined;
74
+ }
75
+ /** @deprecated Prefer {@link parseSpillLocator}. */
76
+ export const alreadySavedPath = (text) => parseSpillLocator(text);
77
+ export function fitInlineNotice(notice, plain, maxInline) {
78
+ const noticeBytes = utf8Bytes(notice);
79
+ if (noticeBytes >= maxInline)
80
+ return utf8Prefix(notice, maxInline);
81
+ let body = notice + headTail(plain, maxInline - noticeBytes);
82
+ if (utf8Bytes(body) > maxInline)
83
+ body = utf8Prefix(body, maxInline);
84
+ return body;
85
+ }
86
+ /**
87
+ * Apply spill policy against a {@link SpillStore}.
88
+ * Sync when `store.saveTextSync` exists; otherwise throws (agent-loop needs sync).
89
+ */
90
+ export function applySpillPolicy(input) {
91
+ if (NO_SPILL_TOOLS.has(input.toolName)) {
92
+ return { content: input.plainText, spilled: false };
93
+ }
94
+ const maxInline = input.maxInlineBytes === undefined
95
+ ? DEFAULT_SPILL_INLINE_BYTES
96
+ : Math.max(0, Math.floor(input.maxInlineBytes));
97
+ if (maxInline === 0) {
98
+ return { content: input.plainText, spilled: false };
99
+ }
100
+ const total = utf8Bytes(input.plainText);
101
+ if (total <= maxInline) {
102
+ return { content: input.plainText, spilled: false };
103
+ }
104
+ const saved = (input.savedPath?.trim() ? input.savedPath.trim() : undefined) ??
105
+ parseSpillLocator(input.plainText);
106
+ let ref;
107
+ let alreadyPersisted = false;
108
+ if (saved) {
109
+ alreadyPersisted = true;
110
+ ref = {
111
+ locator: asSpillLocator(saved),
112
+ bytes: total,
113
+ retrievalHint: "Retrieve with read_file or grep on that path.",
114
+ };
115
+ }
116
+ else {
117
+ if (typeof input.store.saveTextSync !== "function") {
118
+ throw new Error("SpillStore.saveTextSync is required for synchronous tool-result spill");
119
+ }
120
+ ref = input.store.saveTextSync({
121
+ owner: { sessionId: input.sessionId },
122
+ source: {
123
+ kind: "tool",
124
+ toolName: input.toolName,
125
+ callId: input.callId,
126
+ label: input.toolName,
127
+ },
128
+ suggestedName: `${input.callId}.txt`,
129
+ content: input.plainText,
130
+ });
131
+ }
132
+ const notice = formatSpillNotice({
133
+ omittedBytes: total - maxInline,
134
+ ref,
135
+ alreadyPersisted,
136
+ });
137
+ return {
138
+ content: fitInlineNotice(notice, input.plainText, maxInline),
139
+ spilled: true,
140
+ ref,
141
+ };
142
+ }
143
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5D,qEAAqE;AACrE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAE3E,+DAA+D;AAC/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAEjD,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,QAAgB;IACvD,IAAI,QAAQ,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAC7B,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7C,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC1C,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,GAAG,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,QAAQ,EAAE,CAAC;QAC5C,GAAG,IAAI,CAAC,CAAC;QACT,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,G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;QACV,gBAAgB,GAAG,IAAI,CAAC;QACxB,GAAG,GAAG;YACJ,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC;YAC9B,KAAK,EAAE,KAAK;YACZ,aAAa,EAAE,+CAA+C;SAC/D,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;QACJ,CAAC;QACD,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;YAC7B,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE;YACrC,MAAM,EAAE;gBACN,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,KAAK,EAAE,KAAK,CAAC,QAAQ;aACtB;YACD,aAAa,EAAE,GAAG,KAAK,CAAC,MAAM,MAAM;YACpC,OAAO,EAAE,KAAK,CAAC,SAAS;SACzB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,MAAM,GAAG,iBAAiB,CAAC;QAC/B,YAAY,EAAE,KAAK,GAAG,SAAS;QAC/B,GAAG;QACH,gBAAgB;KACjB,CAAC,CAAC;IACH,OAAO;QACL,OAAO,EAAE,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC;QAC5D,OAAO,EAAE,IAAI;QACb,GAAG;KACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Spill storage seam vocabulary (Cordis-free).
3
+ * Learned from dsh `@deepseek-ai/dsh-spill` types: opaque locator + retrieval hint.
4
+ */
5
+ /** Opaque model-facing handle for one spilled artifact (often a filesystem path). */
6
+ export type SpillLocator = string & {
7
+ readonly __brand: "SpillLocator";
8
+ };
9
+ export declare function SpillLocator(locator: string): SpillLocator;
10
+ /** Session that owns the artifact at save time. */
11
+ export interface SpillOwner {
12
+ readonly sessionId: string;
13
+ }
14
+ /** Producer of a spilled artifact (descriptive only — not access control). */
15
+ export type SpillSource = {
16
+ readonly kind: "tool";
17
+ readonly toolName: string;
18
+ readonly callId: string;
19
+ readonly label: string;
20
+ } | {
21
+ readonly kind: "session-reference";
22
+ readonly sessionId: string;
23
+ readonly label: string;
24
+ };
25
+ /** One request to persist text to a spill artifact. */
26
+ export interface SaveTextSpill {
27
+ readonly owner: SpillOwner;
28
+ readonly source: SpillSource;
29
+ /** Caller-suggested base name (sanitized to one path segment). */
30
+ readonly suggestedName: string;
31
+ /** Full UTF-8 text to persist. */
32
+ readonly content: string;
33
+ }
34
+ /** Saved spill artifact: locator, bytes, and model-facing retrieval guidance. */
35
+ export interface SpillRef {
36
+ readonly locator: SpillLocator;
37
+ readonly bytes: number;
38
+ readonly retrievalHint: string;
39
+ }
40
+ /** Abstract spill storage — persist full text; return opaque locator + hint. */
41
+ export interface SpillStore {
42
+ saveText(input: SaveTextSpill): Promise<SpillRef>;
43
+ /** Sync path for agent-loop (no async turn boundary). */
44
+ saveTextSync?(input: SaveTextSpill): SpillRef;
45
+ }
46
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qFAAqF;AACrF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAAC;AAEzE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAE1D;AAED,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GACnB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,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