@namzu/sdk 30.2.0 → 31.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (712) hide show
  1. package/CHANGELOG.md +556 -0
  2. package/README.md +43 -2
  3. package/dist/advisory/executor.d.ts +2 -1
  4. package/dist/advisory/executor.d.ts.map +1 -1
  5. package/dist/advisory/executor.js +4 -1
  6. package/dist/advisory/executor.js.map +1 -1
  7. package/dist/agents/ReactiveAgent.d.ts.map +1 -1
  8. package/dist/agents/ReactiveAgent.js +12 -0
  9. package/dist/agents/ReactiveAgent.js.map +1 -1
  10. package/dist/agents/RouterAgent.d.ts.map +1 -1
  11. package/dist/agents/RouterAgent.js +21 -3
  12. package/dist/agents/RouterAgent.js.map +1 -1
  13. package/dist/agents/SupervisorAgent.d.ts.map +1 -1
  14. package/dist/agents/SupervisorAgent.js +34 -11
  15. package/dist/agents/SupervisorAgent.js.map +1 -1
  16. package/dist/agents/runAgent.d.ts +12 -0
  17. package/dist/agents/runAgent.d.ts.map +1 -1
  18. package/dist/agents/runAgent.js +26 -2
  19. package/dist/agents/runAgent.js.map +1 -1
  20. package/dist/authorization/command-line.d.ts +81 -0
  21. package/dist/authorization/command-line.d.ts.map +1 -0
  22. package/dist/authorization/command-line.js +347 -0
  23. package/dist/authorization/command-line.js.map +1 -0
  24. package/dist/authorization/rules.d.ts.map +1 -1
  25. package/dist/authorization/rules.js +22 -1
  26. package/dist/authorization/rules.js.map +1 -1
  27. package/dist/bridge/a2a/client.d.ts +23 -5
  28. package/dist/bridge/a2a/client.d.ts.map +1 -1
  29. package/dist/bridge/a2a/client.js +320 -73
  30. package/dist/bridge/a2a/client.js.map +1 -1
  31. package/dist/bridge/a2a/mapper.d.ts.map +1 -1
  32. package/dist/bridge/a2a/mapper.js +4 -0
  33. package/dist/bridge/a2a/mapper.js.map +1 -1
  34. package/dist/bridge/acp/server.d.ts +13 -1
  35. package/dist/bridge/acp/server.d.ts.map +1 -1
  36. package/dist/bridge/acp/server.js +150 -44
  37. package/dist/bridge/acp/server.js.map +1 -1
  38. package/dist/bridge/mcp/connector/adapter.d.ts +3 -2
  39. package/dist/bridge/mcp/connector/adapter.d.ts.map +1 -1
  40. package/dist/bridge/mcp/connector/adapter.js +17 -21
  41. package/dist/bridge/mcp/connector/adapter.js.map +1 -1
  42. package/dist/bridge/sse/mapper.d.ts.map +1 -1
  43. package/dist/bridge/sse/mapper.js +3 -0
  44. package/dist/bridge/sse/mapper.js.map +1 -1
  45. package/dist/compaction/dangling.d.ts +29 -2
  46. package/dist/compaction/dangling.d.ts.map +1 -1
  47. package/dist/compaction/dangling.js +172 -35
  48. package/dist/compaction/dangling.js.map +1 -1
  49. package/dist/compaction/index.d.ts +3 -2
  50. package/dist/compaction/index.d.ts.map +1 -1
  51. package/dist/compaction/index.js +1 -1
  52. package/dist/compaction/index.js.map +1 -1
  53. package/dist/compaction/manual.d.ts +11 -1
  54. package/dist/compaction/manual.d.ts.map +1 -1
  55. package/dist/compaction/manual.js +89 -14
  56. package/dist/compaction/manual.js.map +1 -1
  57. package/dist/compaction/plan.d.ts +19 -6
  58. package/dist/compaction/plan.d.ts.map +1 -1
  59. package/dist/compaction/plan.js +18 -4
  60. package/dist/compaction/plan.js.map +1 -1
  61. package/dist/compaction/retention.d.ts +10 -7
  62. package/dist/compaction/retention.d.ts.map +1 -1
  63. package/dist/compaction/retention.js +26 -8
  64. package/dist/compaction/retention.js.map +1 -1
  65. package/dist/compaction/summary.d.ts +4 -4
  66. package/dist/compaction/summary.js +4 -4
  67. package/dist/compaction/verifier.d.ts +19 -1
  68. package/dist/compaction/verifier.d.ts.map +1 -1
  69. package/dist/compaction/verifier.js +20 -1
  70. package/dist/compaction/verifier.js.map +1 -1
  71. package/dist/config/runtime.d.ts +6 -6
  72. package/dist/connector/BaseConnector.d.ts +6 -4
  73. package/dist/connector/BaseConnector.d.ts.map +1 -1
  74. package/dist/connector/BaseConnector.js +8 -2
  75. package/dist/connector/BaseConnector.js.map +1 -1
  76. package/dist/connector/builtins/http.d.ts +16 -4
  77. package/dist/connector/builtins/http.d.ts.map +1 -1
  78. package/dist/connector/builtins/http.js +177 -44
  79. package/dist/connector/builtins/http.js.map +1 -1
  80. package/dist/connector/builtins/webhook.d.ts +15 -4
  81. package/dist/connector/builtins/webhook.d.ts.map +1 -1
  82. package/dist/connector/builtins/webhook.js +165 -45
  83. package/dist/connector/builtins/webhook.js.map +1 -1
  84. package/dist/connector/execution-contract.d.ts +11 -0
  85. package/dist/connector/execution-contract.d.ts.map +1 -0
  86. package/dist/connector/execution-contract.js +14 -0
  87. package/dist/connector/execution-contract.js.map +1 -0
  88. package/dist/connector/http-operation.d.ts +48 -0
  89. package/dist/connector/http-operation.d.ts.map +1 -0
  90. package/dist/connector/http-operation.js +205 -0
  91. package/dist/connector/http-operation.js.map +1 -0
  92. package/dist/connector/mcp/adapter.d.ts.map +1 -1
  93. package/dist/connector/mcp/adapter.js +8 -3
  94. package/dist/connector/mcp/adapter.js.map +1 -1
  95. package/dist/connector/mcp/client.d.ts +14 -8
  96. package/dist/connector/mcp/client.d.ts.map +1 -1
  97. package/dist/connector/mcp/client.js +160 -44
  98. package/dist/connector/mcp/client.js.map +1 -1
  99. package/dist/connector/mcp/http-sse.d.ts +8 -2
  100. package/dist/connector/mcp/http-sse.d.ts.map +1 -1
  101. package/dist/connector/mcp/http-sse.js +70 -17
  102. package/dist/connector/mcp/http-sse.js.map +1 -1
  103. package/dist/connector/mcp/prompt-adapter.d.ts.map +1 -1
  104. package/dist/connector/mcp/prompt-adapter.js +9 -2
  105. package/dist/connector/mcp/prompt-adapter.js.map +1 -1
  106. package/dist/connector/mcp/stdio.d.ts +2 -2
  107. package/dist/connector/mcp/stdio.d.ts.map +1 -1
  108. package/dist/connector/mcp/stdio.js +14 -50
  109. package/dist/connector/mcp/stdio.js.map +1 -1
  110. package/dist/connector/mcp/streamable-http.d.ts +7 -2
  111. package/dist/connector/mcp/streamable-http.d.ts.map +1 -1
  112. package/dist/connector/mcp/streamable-http.js +66 -18
  113. package/dist/connector/mcp/streamable-http.js.map +1 -1
  114. package/dist/connector/tools/adapter.d.ts +2 -2
  115. package/dist/connector/tools/adapter.d.ts.map +1 -1
  116. package/dist/connector/tools/adapter.js +23 -14
  117. package/dist/connector/tools/adapter.js.map +1 -1
  118. package/dist/connector/tools/definitions.d.ts.map +1 -1
  119. package/dist/connector/tools/definitions.js +5 -2
  120. package/dist/connector/tools/definitions.js.map +1 -1
  121. package/dist/connector/tools/result.d.ts +4 -0
  122. package/dist/connector/tools/result.d.ts.map +1 -0
  123. package/dist/connector/tools/result.js +20 -0
  124. package/dist/connector/tools/result.js.map +1 -0
  125. package/dist/connector/web/guarded-fetch.d.ts +4 -2
  126. package/dist/connector/web/guarded-fetch.d.ts.map +1 -1
  127. package/dist/connector/web/guarded-fetch.js +157 -43
  128. package/dist/connector/web/guarded-fetch.js.map +1 -1
  129. package/dist/constants/sandbox/index.d.ts +3 -2
  130. package/dist/constants/sandbox/index.d.ts.map +1 -1
  131. package/dist/constants/sandbox/index.js +3 -2
  132. package/dist/constants/sandbox/index.js.map +1 -1
  133. package/dist/contracts/api.d.ts +2 -0
  134. package/dist/contracts/api.d.ts.map +1 -1
  135. package/dist/contracts/schemas.d.ts +38 -12
  136. package/dist/contracts/schemas.d.ts.map +1 -1
  137. package/dist/contracts/schemas.js +7 -0
  138. package/dist/contracts/schemas.js.map +1 -1
  139. package/dist/directory/derive-supervisor.d.ts.map +1 -1
  140. package/dist/directory/derive-supervisor.js +8 -0
  141. package/dist/directory/derive-supervisor.js.map +1 -1
  142. package/dist/directory/derive.d.ts.map +1 -1
  143. package/dist/directory/derive.js +8 -0
  144. package/dist/directory/derive.js.map +1 -1
  145. package/dist/directory/load.d.ts.map +1 -1
  146. package/dist/directory/load.js +2 -0
  147. package/dist/directory/load.js.map +1 -1
  148. package/dist/directory/types.d.ts +4 -0
  149. package/dist/directory/types.d.ts.map +1 -1
  150. package/dist/eval/experiment.d.ts +10 -10
  151. package/dist/eval/experiment.d.ts.map +1 -1
  152. package/dist/eval/experiment.js +121 -91
  153. package/dist/eval/experiment.js.map +1 -1
  154. package/dist/eval/judge.d.ts +6 -0
  155. package/dist/eval/judge.d.ts.map +1 -1
  156. package/dist/eval/judge.js +7 -2
  157. package/dist/eval/judge.js.map +1 -1
  158. package/dist/eval/types.d.ts +7 -1
  159. package/dist/eval/types.d.ts.map +1 -1
  160. package/dist/manager/agent/lifecycle.d.ts +12 -10
  161. package/dist/manager/agent/lifecycle.d.ts.map +1 -1
  162. package/dist/manager/agent/lifecycle.js +16 -3
  163. package/dist/manager/agent/lifecycle.js.map +1 -1
  164. package/dist/manager/connector/environment.d.ts +2 -2
  165. package/dist/manager/connector/environment.d.ts.map +1 -1
  166. package/dist/manager/connector/environment.js +2 -2
  167. package/dist/manager/connector/environment.js.map +1 -1
  168. package/dist/manager/connector/lifecycle.d.ts +10 -2
  169. package/dist/manager/connector/lifecycle.d.ts.map +1 -1
  170. package/dist/manager/connector/lifecycle.js +273 -24
  171. package/dist/manager/connector/lifecycle.js.map +1 -1
  172. package/dist/manager/connector/tenant.d.ts +5 -4
  173. package/dist/manager/connector/tenant.d.ts.map +1 -1
  174. package/dist/manager/connector/tenant.js +47 -22
  175. package/dist/manager/connector/tenant.js.map +1 -1
  176. package/dist/manager/goal/activation.d.ts +23 -0
  177. package/dist/manager/goal/activation.d.ts.map +1 -0
  178. package/dist/manager/goal/activation.js +41 -0
  179. package/dist/manager/goal/activation.js.map +1 -0
  180. package/dist/manager/index.d.ts +3 -2
  181. package/dist/manager/index.d.ts.map +1 -1
  182. package/dist/manager/index.js.map +1 -1
  183. package/dist/manager/run/persistence.d.ts +2 -0
  184. package/dist/manager/run/persistence.d.ts.map +1 -1
  185. package/dist/manager/run/persistence.js +5 -1
  186. package/dist/manager/run/persistence.js.map +1 -1
  187. package/dist/manager/topic/dependency.d.ts +24 -0
  188. package/dist/manager/topic/dependency.d.ts.map +1 -0
  189. package/dist/manager/topic/dependency.js +13 -0
  190. package/dist/manager/topic/dependency.js.map +1 -0
  191. package/dist/manager/topic/lifecycle.d.ts +9 -21
  192. package/dist/manager/topic/lifecycle.d.ts.map +1 -1
  193. package/dist/manager/topic/lifecycle.js +17 -29
  194. package/dist/manager/topic/lifecycle.js.map +1 -1
  195. package/dist/plugin/index.d.ts +1 -0
  196. package/dist/plugin/index.d.ts.map +1 -1
  197. package/dist/plugin/index.js.map +1 -1
  198. package/dist/plugin/lifecycle.d.ts +15 -0
  199. package/dist/plugin/lifecycle.d.ts.map +1 -1
  200. package/dist/plugin/lifecycle.js +144 -38
  201. package/dist/plugin/lifecycle.js.map +1 -1
  202. package/dist/plugin/loader.d.ts +3 -3
  203. package/dist/plugin/loader.d.ts.map +1 -1
  204. package/dist/plugin/loader.js +58 -12
  205. package/dist/plugin/loader.js.map +1 -1
  206. package/dist/provider/collect-chat-completion.d.ts.map +1 -1
  207. package/dist/provider/collect-chat-completion.js +4 -0
  208. package/dist/provider/collect-chat-completion.js.map +1 -1
  209. package/dist/provider/fallback.d.ts +3 -1
  210. package/dist/provider/fallback.d.ts.map +1 -1
  211. package/dist/provider/fallback.js +62 -10
  212. package/dist/provider/fallback.js.map +1 -1
  213. package/dist/provider/idle-timeout.d.ts +4 -0
  214. package/dist/provider/idle-timeout.d.ts.map +1 -1
  215. package/dist/provider/idle-timeout.js +131 -15
  216. package/dist/provider/idle-timeout.js.map +1 -1
  217. package/dist/provider/index.d.ts +2 -0
  218. package/dist/provider/index.d.ts.map +1 -1
  219. package/dist/provider/index.js +1 -0
  220. package/dist/provider/index.js.map +1 -1
  221. package/dist/provider/instrumentation.d.ts.map +1 -1
  222. package/dist/provider/instrumentation.js +1 -0
  223. package/dist/provider/instrumentation.js.map +1 -1
  224. package/dist/provider/retry.d.ts.map +1 -1
  225. package/dist/provider/retry.js +13 -1
  226. package/dist/provider/retry.js.map +1 -1
  227. package/dist/public-runtime.d.ts +57 -24
  228. package/dist/public-runtime.d.ts.map +1 -1
  229. package/dist/public-runtime.js +42 -35
  230. package/dist/public-runtime.js.map +1 -1
  231. package/dist/public-tools.d.ts +1 -0
  232. package/dist/public-tools.d.ts.map +1 -1
  233. package/dist/public-tools.js +5 -0
  234. package/dist/public-tools.js.map +1 -1
  235. package/dist/public-types.d.ts +33 -12
  236. package/dist/public-types.d.ts.map +1 -1
  237. package/dist/rag/embedding.d.ts +8 -3
  238. package/dist/rag/embedding.d.ts.map +1 -1
  239. package/dist/rag/embedding.js +120 -9
  240. package/dist/rag/embedding.js.map +1 -1
  241. package/dist/rag/index.d.ts +1 -1
  242. package/dist/rag/index.d.ts.map +1 -1
  243. package/dist/rag/index.js +1 -1
  244. package/dist/rag/index.js.map +1 -1
  245. package/dist/rag/ingestion.d.ts +2 -2
  246. package/dist/rag/ingestion.d.ts.map +1 -1
  247. package/dist/rag/ingestion.js +15 -3
  248. package/dist/rag/ingestion.js.map +1 -1
  249. package/dist/rag/knowledge-base.d.ts +3 -3
  250. package/dist/rag/knowledge-base.d.ts.map +1 -1
  251. package/dist/rag/knowledge-base.js +8 -4
  252. package/dist/rag/knowledge-base.js.map +1 -1
  253. package/dist/rag/operation.d.ts +10 -0
  254. package/dist/rag/operation.d.ts.map +1 -0
  255. package/dist/rag/operation.js +26 -0
  256. package/dist/rag/operation.js.map +1 -0
  257. package/dist/rag/rag-tool.d.ts.map +1 -1
  258. package/dist/rag/rag-tool.js +6 -3
  259. package/dist/rag/rag-tool.js.map +1 -1
  260. package/dist/rag/retriever.d.ts +2 -2
  261. package/dist/rag/retriever.d.ts.map +1 -1
  262. package/dist/rag/retriever.js +31 -15
  263. package/dist/rag/retriever.js.map +1 -1
  264. package/dist/rag/vector-store.d.ts +3 -3
  265. package/dist/rag/vector-store.d.ts.map +1 -1
  266. package/dist/rag/vector-store.js +4 -2
  267. package/dist/rag/vector-store.js.map +1 -1
  268. package/dist/registry/command/kernel-commands.d.ts +16 -4
  269. package/dist/registry/command/kernel-commands.d.ts.map +1 -1
  270. package/dist/registry/command/kernel-commands.js +171 -0
  271. package/dist/registry/command/kernel-commands.js.map +1 -1
  272. package/dist/run/reporter.d.ts.map +1 -1
  273. package/dist/run/reporter.js +9 -0
  274. package/dist/run/reporter.js.map +1 -1
  275. package/dist/run-query/index.d.ts +15 -1
  276. package/dist/run-query/index.d.ts.map +1 -1
  277. package/dist/run-query/index.js +69 -15
  278. package/dist/run-query/index.js.map +1 -1
  279. package/dist/runtime/query/context.d.ts.map +1 -1
  280. package/dist/runtime/query/context.js +10 -3
  281. package/dist/runtime/query/context.js.map +1 -1
  282. package/dist/runtime/query/executor.d.ts +3 -0
  283. package/dist/runtime/query/executor.d.ts.map +1 -1
  284. package/dist/runtime/query/executor.js +80 -18
  285. package/dist/runtime/query/executor.js.map +1 -1
  286. package/dist/runtime/query/guard.d.ts +9 -0
  287. package/dist/runtime/query/guard.d.ts.map +1 -1
  288. package/dist/runtime/query/guard.js +11 -0
  289. package/dist/runtime/query/guard.js.map +1 -1
  290. package/dist/runtime/query/index.d.ts +30 -1
  291. package/dist/runtime/query/index.d.ts.map +1 -1
  292. package/dist/runtime/query/index.js +548 -95
  293. package/dist/runtime/query/index.js.map +1 -1
  294. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  295. package/dist/runtime/query/iteration/index.js +74 -14
  296. package/dist/runtime/query/iteration/index.js.map +1 -1
  297. package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
  298. package/dist/runtime/query/iteration/phases/compaction.js +94 -53
  299. package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
  300. package/dist/runtime/query/iteration/phases/context.d.ts +3 -0
  301. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  302. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  303. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  304. package/dist/runtime/query/iteration/phases/tool-review.js +21 -0
  305. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  306. package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
  307. package/dist/runtime/query/iteration/stream-turn.js +4 -0
  308. package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
  309. package/dist/runtime/query/project-instructions.d.ts +69 -0
  310. package/dist/runtime/query/project-instructions.d.ts.map +1 -0
  311. package/dist/runtime/query/project-instructions.js +137 -0
  312. package/dist/runtime/query/project-instructions.js.map +1 -0
  313. package/dist/runtime/query/request-rich-content.d.ts +22 -0
  314. package/dist/runtime/query/request-rich-content.d.ts.map +1 -0
  315. package/dist/runtime/query/request-rich-content.js +122 -0
  316. package/dist/runtime/query/request-rich-content.js.map +1 -0
  317. package/dist/runtime/query/result.d.ts.map +1 -1
  318. package/dist/runtime/query/result.js +12 -1
  319. package/dist/runtime/query/result.js.map +1 -1
  320. package/dist/runtime/query/resume-pending.d.ts.map +1 -1
  321. package/dist/runtime/query/resume-pending.js +19 -20
  322. package/dist/runtime/query/resume-pending.js.map +1 -1
  323. package/dist/runtime/query/resume-run.d.ts.map +1 -1
  324. package/dist/runtime/query/resume-run.js +54 -8
  325. package/dist/runtime/query/resume-run.js.map +1 -1
  326. package/dist/runtime/query/run-state.d.ts +5 -0
  327. package/dist/runtime/query/run-state.d.ts.map +1 -1
  328. package/dist/runtime/query/run-state.js +6 -1
  329. package/dist/runtime/query/run-state.js.map +1 -1
  330. package/dist/runtime/query/sandbox-lifecycle.d.ts +54 -0
  331. package/dist/runtime/query/sandbox-lifecycle.d.ts.map +1 -0
  332. package/dist/runtime/query/sandbox-lifecycle.js +167 -0
  333. package/dist/runtime/query/sandbox-lifecycle.js.map +1 -0
  334. package/dist/sandbox/isolation.d.ts.map +1 -1
  335. package/dist/sandbox/isolation.js +9 -0
  336. package/dist/sandbox/isolation.js.map +1 -1
  337. package/dist/sandbox/provider/local.d.ts +56 -6
  338. package/dist/sandbox/provider/local.d.ts.map +1 -1
  339. package/dist/sandbox/provider/local.js +181 -76
  340. package/dist/sandbox/provider/local.js.map +1 -1
  341. package/dist/sandbox/terminal.d.ts +13 -5
  342. package/dist/sandbox/terminal.d.ts.map +1 -1
  343. package/dist/sandbox/terminal.js +11 -3
  344. package/dist/sandbox/terminal.js.map +1 -1
  345. package/dist/session/errors.d.ts +28 -29
  346. package/dist/session/errors.d.ts.map +1 -1
  347. package/dist/session/errors.js +28 -29
  348. package/dist/session/errors.js.map +1 -1
  349. package/dist/session/handoff/broadcast.d.ts +5 -8
  350. package/dist/session/handoff/broadcast.d.ts.map +1 -1
  351. package/dist/session/handoff/broadcast.js +16 -6
  352. package/dist/session/handoff/broadcast.js.map +1 -1
  353. package/dist/session/handoff/single.d.ts +5 -8
  354. package/dist/session/handoff/single.d.ts.map +1 -1
  355. package/dist/session/handoff/single.js +7 -4
  356. package/dist/session/handoff/single.js.map +1 -1
  357. package/dist/store/attachment/index.d.ts +11 -3
  358. package/dist/store/attachment/index.d.ts.map +1 -1
  359. package/dist/store/attachment/index.js +49 -4
  360. package/dist/store/attachment/index.js.map +1 -1
  361. package/dist/store/feedback/conformance.d.ts.map +1 -1
  362. package/dist/store/feedback/conformance.js +32 -0
  363. package/dist/store/feedback/conformance.js.map +1 -1
  364. package/dist/store/feedback/disk.d.ts +8 -6
  365. package/dist/store/feedback/disk.d.ts.map +1 -1
  366. package/dist/store/feedback/disk.js +111 -76
  367. package/dist/store/feedback/disk.js.map +1 -1
  368. package/dist/store/goal/index.d.ts +111 -0
  369. package/dist/store/goal/index.d.ts.map +1 -0
  370. package/dist/store/goal/index.js +436 -0
  371. package/dist/store/goal/index.js.map +1 -0
  372. package/dist/store/index.d.ts +1 -1
  373. package/dist/store/index.d.ts.map +1 -1
  374. package/dist/store/index.js +1 -1
  375. package/dist/store/index.js.map +1 -1
  376. package/dist/store/kv/revision-record-store.d.ts +70 -0
  377. package/dist/store/kv/revision-record-store.d.ts.map +1 -0
  378. package/dist/store/kv/revision-record-store.js +290 -0
  379. package/dist/store/kv/revision-record-store.js.map +1 -0
  380. package/dist/store/memory/disk.d.ts +9 -7
  381. package/dist/store/memory/disk.d.ts.map +1 -1
  382. package/dist/store/memory/disk.js +256 -98
  383. package/dist/store/memory/disk.js.map +1 -1
  384. package/dist/store/run/disk.d.ts +10 -2
  385. package/dist/store/run/disk.d.ts.map +1 -1
  386. package/dist/store/run/disk.js +70 -4
  387. package/dist/store/run/disk.js.map +1 -1
  388. package/dist/store/run/memory.d.ts +4 -2
  389. package/dist/store/run/memory.d.ts.map +1 -1
  390. package/dist/store/run/memory.js +15 -1
  391. package/dist/store/run/memory.js.map +1 -1
  392. package/dist/store/session/disk.d.ts +9 -0
  393. package/dist/store/session/disk.d.ts.map +1 -1
  394. package/dist/store/session/disk.js +57 -5
  395. package/dist/store/session/disk.js.map +1 -1
  396. package/dist/store/session/memory.d.ts +1 -0
  397. package/dist/store/session/memory.d.ts.map +1 -1
  398. package/dist/store/session/memory.js +14 -0
  399. package/dist/store/session/memory.js.map +1 -1
  400. package/dist/store/topic/memory.d.ts +1 -2
  401. package/dist/store/topic/memory.d.ts.map +1 -1
  402. package/dist/store/topic/memory.js +4 -5
  403. package/dist/store/topic/memory.js.map +1 -1
  404. package/dist/store/topic/objective.d.ts +8 -4
  405. package/dist/store/topic/objective.d.ts.map +1 -1
  406. package/dist/store/topic/objective.js +185 -100
  407. package/dist/store/topic/objective.js.map +1 -1
  408. package/dist/store/topic/state.d.ts +1 -2
  409. package/dist/store/topic/state.d.ts.map +1 -1
  410. package/dist/store/topic/state.js +50 -62
  411. package/dist/store/topic/state.js.map +1 -1
  412. package/dist/tools/builtins/bash.d.ts.map +1 -1
  413. package/dist/tools/builtins/bash.js +20 -0
  414. package/dist/tools/builtins/bash.js.map +1 -1
  415. package/dist/tools/builtins/computer-use.d.ts +9 -1
  416. package/dist/tools/builtins/computer-use.d.ts.map +1 -1
  417. package/dist/tools/builtins/computer-use.js.map +1 -1
  418. package/dist/tools/builtins/content-fingerprint.d.ts +8 -7
  419. package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
  420. package/dist/tools/builtins/content-fingerprint.js +9 -10
  421. package/dist/tools/builtins/content-fingerprint.js.map +1 -1
  422. package/dist/tools/builtins/edit.d.ts +6 -1
  423. package/dist/tools/builtins/edit.d.ts.map +1 -1
  424. package/dist/tools/builtins/edit.js +166 -27
  425. package/dist/tools/builtins/edit.js.map +1 -1
  426. package/dist/tools/builtins/write-file.d.ts.map +1 -1
  427. package/dist/tools/builtins/write-file.js +45 -19
  428. package/dist/tools/builtins/write-file.js.map +1 -1
  429. package/dist/tools/command-arguments.d.ts +43 -0
  430. package/dist/tools/command-arguments.d.ts.map +1 -0
  431. package/dist/tools/command-arguments.js +52 -0
  432. package/dist/tools/command-arguments.js.map +1 -0
  433. package/dist/tools/coordinator/index.d.ts +2 -0
  434. package/dist/tools/coordinator/index.d.ts.map +1 -1
  435. package/dist/tools/coordinator/index.js +3 -1
  436. package/dist/tools/coordinator/index.js.map +1 -1
  437. package/dist/tools/defineTool.d.ts +10 -0
  438. package/dist/tools/defineTool.d.ts.map +1 -1
  439. package/dist/tools/defineTool.js +1 -0
  440. package/dist/tools/defineTool.js.map +1 -1
  441. package/dist/tools/env-scrub.d.ts +7 -5
  442. package/dist/tools/env-scrub.d.ts.map +1 -1
  443. package/dist/tools/env-scrub.js +7 -5
  444. package/dist/tools/env-scrub.js.map +1 -1
  445. package/dist/tools/goal/index.d.ts +20 -0
  446. package/dist/tools/goal/index.d.ts.map +1 -0
  447. package/dist/tools/goal/index.js +104 -0
  448. package/dist/tools/goal/index.js.map +1 -0
  449. package/dist/tools/memory/index.d.ts +16 -0
  450. package/dist/tools/memory/index.d.ts.map +1 -1
  451. package/dist/tools/memory/index.js +6 -2
  452. package/dist/tools/memory/index.js.map +1 -1
  453. package/dist/tools/memory/search.d.ts +4 -1
  454. package/dist/tools/memory/search.d.ts.map +1 -1
  455. package/dist/tools/memory/search.js +10 -2
  456. package/dist/tools/memory/search.js.map +1 -1
  457. package/dist/types/agent/base.d.ts +11 -3
  458. package/dist/types/agent/base.d.ts.map +1 -1
  459. package/dist/types/agent/factory.d.ts +2 -0
  460. package/dist/types/agent/factory.d.ts.map +1 -1
  461. package/dist/types/agent/reactive.d.ts +2 -0
  462. package/dist/types/agent/reactive.d.ts.map +1 -1
  463. package/dist/types/agent/supervisor.d.ts +6 -0
  464. package/dist/types/agent/supervisor.d.ts.map +1 -1
  465. package/dist/types/agent/task.d.ts +6 -2
  466. package/dist/types/agent/task.d.ts.map +1 -1
  467. package/dist/types/connector/core.d.ts +13 -8
  468. package/dist/types/connector/core.d.ts.map +1 -1
  469. package/dist/types/connector/definition.d.ts +37 -18
  470. package/dist/types/connector/definition.d.ts.map +1 -1
  471. package/dist/types/connector/http.d.ts +6 -0
  472. package/dist/types/connector/http.d.ts.map +1 -1
  473. package/dist/types/connector/mcp.d.ts +24 -6
  474. package/dist/types/connector/mcp.d.ts.map +1 -1
  475. package/dist/types/connector/tenant.d.ts +17 -7
  476. package/dist/types/connector/tenant.d.ts.map +1 -1
  477. package/dist/types/connector/webhook.d.ts +6 -0
  478. package/dist/types/connector/webhook.d.ts.map +1 -1
  479. package/dist/types/goal/index.d.ts +46 -0
  480. package/dist/types/goal/index.d.ts.map +1 -0
  481. package/dist/types/goal/index.js +2 -0
  482. package/dist/types/goal/index.js.map +1 -0
  483. package/dist/types/ids/index.d.ts +2 -0
  484. package/dist/types/ids/index.d.ts.map +1 -1
  485. package/dist/types/ids/index.js.map +1 -1
  486. package/dist/types/message/index.d.ts +75 -10
  487. package/dist/types/message/index.d.ts.map +1 -1
  488. package/dist/types/message/index.js +49 -3
  489. package/dist/types/message/index.js.map +1 -1
  490. package/dist/types/plugin/index.d.ts +7 -5
  491. package/dist/types/plugin/index.d.ts.map +1 -1
  492. package/dist/types/plugin/index.js.map +1 -1
  493. package/dist/types/provider/chat.d.ts +27 -4
  494. package/dist/types/provider/chat.d.ts.map +1 -1
  495. package/dist/types/provider/interface.d.ts +18 -7
  496. package/dist/types/provider/interface.d.ts.map +1 -1
  497. package/dist/types/provider/stream.d.ts +6 -0
  498. package/dist/types/provider/stream.d.ts.map +1 -1
  499. package/dist/types/rag/embedding.d.ts +15 -2
  500. package/dist/types/rag/embedding.d.ts.map +1 -1
  501. package/dist/types/rag/ingestion.d.ts +2 -2
  502. package/dist/types/rag/ingestion.d.ts.map +1 -1
  503. package/dist/types/rag/knowledge-base.d.ts +3 -3
  504. package/dist/types/rag/knowledge-base.d.ts.map +1 -1
  505. package/dist/types/rag/retrieval.d.ts +2 -2
  506. package/dist/types/rag/retrieval.d.ts.map +1 -1
  507. package/dist/types/rag/scope.d.ts +4 -0
  508. package/dist/types/rag/scope.d.ts.map +1 -1
  509. package/dist/types/rag/vector.d.ts +5 -2
  510. package/dist/types/rag/vector.d.ts.map +1 -1
  511. package/dist/types/run/config.d.ts +20 -0
  512. package/dist/types/run/config.d.ts.map +1 -1
  513. package/dist/types/run/events.d.ts +25 -1
  514. package/dist/types/run/events.d.ts.map +1 -1
  515. package/dist/types/run/events.js.map +1 -1
  516. package/dist/types/run/metadata.d.ts +2 -0
  517. package/dist/types/run/metadata.d.ts.map +1 -1
  518. package/dist/types/run/step.d.ts +2 -6
  519. package/dist/types/run/step.d.ts.map +1 -1
  520. package/dist/types/run/step.js.map +1 -1
  521. package/dist/types/run/store.d.ts +55 -2
  522. package/dist/types/run/store.d.ts.map +1 -1
  523. package/dist/types/sandbox/index.d.ts +47 -6
  524. package/dist/types/sandbox/index.d.ts.map +1 -1
  525. package/dist/types/sandbox/index.js +23 -10
  526. package/dist/types/sandbox/index.js.map +1 -1
  527. package/dist/types/session/store.d.ts +13 -0
  528. package/dist/types/session/store.d.ts.map +1 -1
  529. package/dist/types/tool/index.d.ts +33 -11
  530. package/dist/types/tool/index.d.ts.map +1 -1
  531. package/dist/types/tool/index.js.map +1 -1
  532. package/dist/types/topic/entity.d.ts +3 -4
  533. package/dist/types/topic/entity.d.ts.map +1 -1
  534. package/dist/types/topic/store.d.ts +3 -3
  535. package/dist/utils/id.d.ts +3 -1
  536. package/dist/utils/id.d.ts.map +1 -1
  537. package/dist/utils/id.js +4 -0
  538. package/dist/utils/id.js.map +1 -1
  539. package/dist/utils/process-environment.d.ts +26 -0
  540. package/dist/utils/process-environment.d.ts.map +1 -0
  541. package/dist/utils/process-environment.js +78 -0
  542. package/dist/utils/process-environment.js.map +1 -0
  543. package/dist/vault/InMemoryCredentialVault.d.ts +2 -0
  544. package/dist/vault/InMemoryCredentialVault.d.ts.map +1 -1
  545. package/dist/vault/InMemoryCredentialVault.js +24 -4
  546. package/dist/vault/InMemoryCredentialVault.js.map +1 -1
  547. package/dist/vault/instrumentation.d.ts.map +1 -1
  548. package/dist/vault/instrumentation.js +15 -0
  549. package/dist/vault/instrumentation.js.map +1 -1
  550. package/package.json +1 -1
  551. package/src/advisory/executor.ts +4 -1
  552. package/src/agents/ReactiveAgent.ts +12 -0
  553. package/src/agents/RouterAgent.ts +25 -3
  554. package/src/agents/SupervisorAgent.ts +33 -11
  555. package/src/agents/runAgent.ts +38 -2
  556. package/src/authorization/command-line.ts +390 -0
  557. package/src/authorization/rules.ts +22 -1
  558. package/src/bridge/a2a/client.ts +384 -97
  559. package/src/bridge/a2a/mapper.ts +5 -0
  560. package/src/bridge/acp/server.ts +184 -42
  561. package/src/bridge/mcp/connector/adapter.ts +28 -20
  562. package/src/bridge/sse/mapper.ts +3 -0
  563. package/src/compaction/dangling.ts +203 -38
  564. package/src/compaction/index.ts +9 -2
  565. package/src/compaction/manual.ts +125 -18
  566. package/src/compaction/plan.ts +42 -11
  567. package/src/compaction/retention.ts +23 -8
  568. package/src/compaction/summary.ts +4 -4
  569. package/src/compaction/verifier.ts +66 -0
  570. package/src/connector/BaseConnector.ts +19 -4
  571. package/src/connector/builtins/http.ts +236 -46
  572. package/src/connector/builtins/webhook.ts +207 -47
  573. package/src/connector/execution-contract.ts +27 -0
  574. package/src/connector/http-operation.ts +238 -0
  575. package/src/connector/mcp/adapter.ts +8 -3
  576. package/src/connector/mcp/client.ts +207 -58
  577. package/src/connector/mcp/http-sse.ts +91 -23
  578. package/src/connector/mcp/prompt-adapter.ts +8 -2
  579. package/src/connector/mcp/stdio.ts +21 -46
  580. package/src/connector/mcp/streamable-http.ts +86 -22
  581. package/src/connector/tools/adapter.ts +23 -14
  582. package/src/connector/tools/definitions.ts +5 -2
  583. package/src/connector/tools/result.ts +21 -0
  584. package/src/connector/web/guarded-fetch.ts +188 -48
  585. package/src/constants/sandbox/index.ts +3 -2
  586. package/src/contracts/api.ts +2 -0
  587. package/src/contracts/schemas.ts +7 -0
  588. package/src/directory/derive-supervisor.ts +8 -0
  589. package/src/directory/derive.ts +8 -0
  590. package/src/directory/load.ts +2 -0
  591. package/src/directory/types.ts +4 -0
  592. package/src/eval/experiment.ts +160 -111
  593. package/src/eval/judge.ts +13 -2
  594. package/src/eval/types.ts +7 -1
  595. package/src/manager/agent/lifecycle.ts +28 -12
  596. package/src/manager/connector/environment.ts +3 -1
  597. package/src/manager/connector/lifecycle.ts +364 -24
  598. package/src/manager/connector/tenant.ts +56 -23
  599. package/src/manager/goal/activation.ts +52 -0
  600. package/src/manager/index.ts +10 -2
  601. package/src/manager/run/persistence.ts +6 -1
  602. package/src/manager/topic/dependency.ts +39 -0
  603. package/src/manager/topic/lifecycle.ts +19 -31
  604. package/src/plugin/index.ts +1 -0
  605. package/src/plugin/lifecycle.ts +180 -39
  606. package/src/plugin/loader.ts +70 -13
  607. package/src/provider/collect-chat-completion.ts +3 -0
  608. package/src/provider/fallback.ts +79 -11
  609. package/src/provider/idle-timeout.ts +143 -17
  610. package/src/provider/index.ts +2 -0
  611. package/src/provider/instrumentation.ts +1 -0
  612. package/src/provider/retry.ts +16 -1
  613. package/src/public-runtime.ts +190 -32
  614. package/src/public-tools.ts +5 -0
  615. package/src/public-types.ts +85 -11
  616. package/src/rag/embedding.ts +147 -19
  617. package/src/rag/index.ts +1 -1
  618. package/src/rag/ingestion.ts +16 -2
  619. package/src/rag/knowledge-base.ts +13 -4
  620. package/src/rag/operation.ts +28 -0
  621. package/src/rag/rag-tool.ts +6 -3
  622. package/src/rag/retriever.ts +62 -11
  623. package/src/rag/vector-store.ts +8 -2
  624. package/src/registry/command/kernel-commands.ts +223 -4
  625. package/src/run/reporter.ts +10 -0
  626. package/src/run-query/index.ts +84 -15
  627. package/src/runtime/query/context.ts +13 -3
  628. package/src/runtime/query/executor.ts +90 -17
  629. package/src/runtime/query/guard.ts +12 -0
  630. package/src/runtime/query/index.ts +652 -103
  631. package/src/runtime/query/iteration/index.ts +89 -13
  632. package/src/runtime/query/iteration/phases/compaction.ts +120 -55
  633. package/src/runtime/query/iteration/phases/context.ts +4 -0
  634. package/src/runtime/query/iteration/phases/tool-review.ts +28 -0
  635. package/src/runtime/query/iteration/stream-turn.ts +3 -0
  636. package/src/runtime/query/project-instructions.ts +212 -0
  637. package/src/runtime/query/request-rich-content.ts +153 -0
  638. package/src/runtime/query/result.ts +12 -1
  639. package/src/runtime/query/resume-pending.ts +20 -18
  640. package/src/runtime/query/resume-run.ts +52 -8
  641. package/src/runtime/query/run-state.ts +11 -1
  642. package/src/runtime/query/sandbox-lifecycle.ts +210 -0
  643. package/src/sandbox/isolation.ts +9 -0
  644. package/src/sandbox/provider/local.ts +255 -90
  645. package/src/sandbox/terminal.ts +13 -5
  646. package/src/session/errors.ts +68 -42
  647. package/src/session/handoff/broadcast.ts +20 -14
  648. package/src/session/handoff/single.ts +14 -13
  649. package/src/store/attachment/index.ts +65 -3
  650. package/src/store/feedback/conformance.ts +39 -0
  651. package/src/store/feedback/disk.ts +128 -82
  652. package/src/store/goal/index.ts +594 -0
  653. package/src/store/index.ts +1 -1
  654. package/src/store/kv/revision-record-store.ts +346 -0
  655. package/src/store/memory/disk.ts +288 -113
  656. package/src/store/run/disk.ts +96 -5
  657. package/src/store/run/memory.ts +22 -2
  658. package/src/store/session/disk.ts +93 -6
  659. package/src/store/session/memory.ts +22 -0
  660. package/src/store/topic/memory.ts +4 -5
  661. package/src/store/topic/objective.ts +215 -100
  662. package/src/store/topic/state.ts +100 -63
  663. package/src/tools/builtins/bash.ts +21 -0
  664. package/src/tools/builtins/computer-use.ts +9 -1
  665. package/src/tools/builtins/content-fingerprint.ts +9 -12
  666. package/src/tools/builtins/edit.ts +190 -27
  667. package/src/tools/builtins/write-file.ts +55 -19
  668. package/src/tools/command-arguments.ts +54 -0
  669. package/src/tools/coordinator/index.ts +4 -1
  670. package/src/tools/defineTool.ts +11 -0
  671. package/src/tools/env-scrub.ts +7 -5
  672. package/src/tools/goal/index.ts +129 -0
  673. package/src/tools/memory/index.ts +26 -3
  674. package/src/tools/memory/search.ts +20 -3
  675. package/src/types/agent/base.ts +12 -3
  676. package/src/types/agent/factory.ts +2 -0
  677. package/src/types/agent/reactive.ts +2 -0
  678. package/src/types/agent/supervisor.ts +6 -0
  679. package/src/types/agent/task.ts +6 -2
  680. package/src/types/connector/core.ts +13 -8
  681. package/src/types/connector/definition.ts +54 -20
  682. package/src/types/connector/http.ts +7 -0
  683. package/src/types/connector/mcp.ts +27 -6
  684. package/src/types/connector/tenant.ts +21 -7
  685. package/src/types/connector/webhook.ts +7 -0
  686. package/src/types/goal/index.ts +50 -0
  687. package/src/types/ids/index.ts +2 -0
  688. package/src/types/message/index.ts +143 -9
  689. package/src/types/plugin/index.ts +7 -5
  690. package/src/types/provider/chat.ts +35 -4
  691. package/src/types/provider/interface.ts +22 -7
  692. package/src/types/provider/stream.ts +6 -0
  693. package/src/types/rag/embedding.ts +16 -2
  694. package/src/types/rag/ingestion.ts +2 -1
  695. package/src/types/rag/knowledge-base.ts +7 -3
  696. package/src/types/rag/retrieval.ts +2 -1
  697. package/src/types/rag/scope.ts +5 -0
  698. package/src/types/rag/vector.ts +5 -2
  699. package/src/types/run/config.ts +20 -0
  700. package/src/types/run/events.ts +28 -3
  701. package/src/types/run/metadata.ts +2 -0
  702. package/src/types/run/step.ts +2 -7
  703. package/src/types/run/store.ts +60 -2
  704. package/src/types/sandbox/index.ts +57 -14
  705. package/src/types/session/store.ts +18 -0
  706. package/src/types/tool/index.ts +33 -11
  707. package/src/types/topic/entity.ts +3 -4
  708. package/src/types/topic/store.ts +3 -3
  709. package/src/utils/id.ts +6 -0
  710. package/src/utils/process-environment.ts +101 -0
  711. package/src/vault/InMemoryCredentialVault.ts +29 -4
  712. package/src/vault/instrumentation.ts +24 -0
@@ -52,7 +52,8 @@ export interface LLMProvider {
52
52
  */
53
53
  chatStream(params: ChatCompletionParams): AsyncIterable<StreamChunk>
54
54
 
55
- listModels?(): Promise<ModelInfo[]>
55
+ /** Optional cancellation belongs to the surface asking for this menu. */
56
+ listModels?(signal?: AbortSignal): Promise<ModelInfo[]>
56
57
 
57
58
  /**
58
59
  * Establish whether this credential actually works. Resolves if it does,
@@ -87,7 +88,7 @@ export interface LLMProvider {
87
88
  * as a bad key would tell an operator on broken wifi to go and rotate a
88
89
  * credential that is fine.
89
90
  */
90
- probeCredential?(): Promise<void>
91
+ probeCredential?(signal?: AbortSignal): Promise<void>
91
92
 
92
93
  /**
93
94
  * Is this driver able to serve traffic? A summary bit; `doctorCheck` is
@@ -132,11 +133,12 @@ export interface LLMProvider {
132
133
  * the start rather than a quieter one. Building that choice needs the
133
134
  * answer BEFORE the request exists.
134
135
  *
135
- * There are three states and they mean different things:
136
+ * There are four states and they mean different things:
136
137
  *
137
- * - **method absent** — this driver has no effort concept at all. Setting
138
- * `effort` on a run using it is refused, not ignored, so a caller should
139
- * offer no control rather than a disabled one.
138
+ * - **method absent** — this driver cannot enumerate effort for any model.
139
+ * - **`undefined`** the driver understands effort, but cannot establish
140
+ * the levels for this model id. Compatible endpoints with private model
141
+ * names are the common case. A caller must not fabricate a picker.
140
142
  * - **empty array** — the driver implements effort and THIS model has no
141
143
  * levels. A real answer, not a missing one.
142
144
  * - **non-empty** — offer exactly these, and nothing else.
@@ -156,6 +158,18 @@ export interface LLMProvider {
156
158
  * stale on the next model release and goes stale SILENTLY — surfacing as
157
159
  * a vendor rejection rather than a failing build.
158
160
  */
161
+ reasoningEffortLevelsFor?(
162
+ model: string,
163
+ thinking?: import('./chat.js').ThinkingConfig,
164
+ ): readonly import('./chat.js').ReasoningEffort[] | undefined
165
+
166
+ /**
167
+ * Legacy effort menu which cannot distinguish an unknown model from a model
168
+ * with no effort support.
169
+ *
170
+ * @deprecated Implement and consume {@link LLMProvider.reasoningEffortLevelsFor}
171
+ * instead. Kept for one compatibility window; decorators still preserve it.
172
+ */
159
173
  effortLevelsFor?(
160
174
  model: string,
161
175
  thinking?: import('./chat.js').ThinkingConfig,
@@ -173,7 +187,8 @@ export interface LLMProvider {
173
187
  * parses a real per-model `context_length` off the vendor listing and
174
188
  * throws it away, because there was no member to return it through.
175
189
  *
176
- * Three states, exactly like {@link LLMProvider.effortLevelsFor}: the
190
+ * Three states, like the non-empty half of
191
+ * {@link LLMProvider.reasoningEffortLevelsFor}: the
177
192
  * member ABSENT means this driver cannot answer at all; a resolved
178
193
  * `undefined` means it asked and does not know; a number is the answer.
179
194
  * The three are different facts and collapsing any two of them turns
@@ -2,6 +2,12 @@ import type { TokenUsage } from '../common/index.js'
2
2
 
3
3
  export interface StreamChunk {
4
4
  id: string
5
+ /**
6
+ * Adapter-private lossless-JSON state for replaying the completed native
7
+ * assistant response. Emitted only once the state is complete; aggregators
8
+ * retain the last defined value and the query stores it in message source.
9
+ */
10
+ replayState?: unknown
5
11
  delta: {
6
12
  content?: string
7
13
  toolCalls?: Array<{
@@ -1,15 +1,24 @@
1
+ import type { RAGOperationOptions } from './scope.js'
2
+
1
3
  export interface EmbeddingProvider {
2
4
  readonly id: string
3
5
  readonly model: string
4
6
  readonly dimensions: number
5
7
 
6
- embed(texts: string[]): Promise<number[][]>
7
- embedQuery(query: string): Promise<number[]>
8
+ /**
9
+ * Implementations should stop owned I/O when `options.signal` aborts.
10
+ * A caller still bounds its own wait: a custom provider may be
11
+ * non-cooperative, just as any other host-supplied implementation may be.
12
+ */
13
+ embed(texts: string[], options?: RAGOperationOptions): Promise<number[][]>
14
+ embedQuery(query: string, options?: RAGOperationOptions): Promise<number[]>
8
15
  }
9
16
 
10
17
  export interface EmbeddingConfig {
11
18
  model: string
19
+ /** Expected positive vector width. HTTP responses with another width are refused. */
12
20
  dimensions?: number
21
+ /** Positive number of inputs sent in one operation. */
13
22
  batchSize?: number
14
23
  }
15
24
 
@@ -25,4 +34,9 @@ export interface HttpEmbeddingConfig extends EmbeddingConfig {
25
34
  apiKey: string
26
35
  /** Root of an embeddings API; `/embeddings` is appended. */
27
36
  baseUrl: string
37
+ /**
38
+ * Whole-request bound for each HTTP batch, including response-body reads.
39
+ * Defaults to 30 seconds. Set `0` to preserve the former unbounded behavior.
40
+ */
41
+ requestTimeoutMs?: number
28
42
  }
@@ -1,5 +1,5 @@
1
1
  import type { DocumentId, KnowledgeBaseId } from '../ids/index.js'
2
- import type { DocumentMetadata, TenantScope } from './scope.js'
2
+ import type { DocumentMetadata, RAGOperationOptions, TenantScope } from './scope.js'
3
3
 
4
4
  export interface IngestionResult {
5
5
  documentId: DocumentId
@@ -14,6 +14,7 @@ export interface IngestionPipeline {
14
14
  metadata: DocumentMetadata,
15
15
  scope: TenantScope,
16
16
  knowledgeBaseId: KnowledgeBaseId,
17
+ options?: RAGOperationOptions,
17
18
  ): Promise<IngestionResult>
18
19
 
19
20
  remove(documentId: DocumentId): Promise<void>
@@ -3,7 +3,7 @@ import type { ChunkingConfig } from './chunking.js'
3
3
  import type { EmbeddingConfig } from './embedding.js'
4
4
  import type { IngestionResult } from './ingestion.js'
5
5
  import type { RetrievalConfig, RetrievalQuery, RetrievalResult } from './retrieval.js'
6
- import type { DocumentMetadata } from './scope.js'
6
+ import type { DocumentMetadata, RAGOperationOptions } from './scope.js'
7
7
 
8
8
  export interface KnowledgeBaseConfig {
9
9
  id?: KnowledgeBaseId
@@ -20,8 +20,12 @@ export interface KnowledgeBase {
20
20
  readonly id: KnowledgeBaseId
21
21
  readonly config: KnowledgeBaseConfig
22
22
 
23
- ingest(content: string, metadata?: DocumentMetadata): Promise<IngestionResult>
23
+ ingest(
24
+ content: string,
25
+ metadata?: DocumentMetadata,
26
+ options?: RAGOperationOptions,
27
+ ): Promise<IngestionResult>
24
28
  remove(documentId: DocumentId): Promise<void>
25
- query(query: RetrievalQuery): Promise<RetrievalResult>
29
+ query(query: RetrievalQuery, options?: RAGOperationOptions): Promise<RetrievalResult>
26
30
  clear(): Promise<void>
27
31
  }
@@ -1,6 +1,6 @@
1
1
  import type { KnowledgeBaseId } from '../ids/index.js'
2
2
  import type { ProjectId } from '../session/ids.js'
3
- import type { TenantScope } from './scope.js'
3
+ import type { RAGOperationOptions, TenantScope } from './scope.js'
4
4
  import type { VectorSearchResult } from './vector.js'
5
5
 
6
6
  export type RetrievalMode = 'vector' | 'keyword' | 'hybrid'
@@ -48,5 +48,6 @@ export interface Retriever {
48
48
  query: RetrievalQuery,
49
49
  scope: TenantScope,
50
50
  knowledgeBaseId?: KnowledgeBaseId,
51
+ options?: RAGOperationOptions,
51
52
  ): Promise<RetrievalResult>
52
53
  }
@@ -5,6 +5,11 @@ export interface TenantScope {
5
5
  namespace?: string
6
6
  }
7
7
 
8
+ /** Cancellation shared by one public RAG operation and its downstream I/O. */
9
+ export interface RAGOperationOptions {
10
+ readonly signal?: AbortSignal
11
+ }
12
+
8
13
  export interface DocumentMetadata {
9
14
  source?: string
10
15
  title?: string
@@ -1,4 +1,5 @@
1
1
  import type { ChunkId, DocumentId, KnowledgeBaseId, TenantId } from '../ids/index.js'
2
+ import type { RAGOperationOptions } from './scope.js'
2
3
  import type { Chunk } from './storage.js'
3
4
 
4
5
  export interface VectorSearchResult {
@@ -27,8 +28,10 @@ export interface VectorStoreQuery {
27
28
  }
28
29
 
29
30
  export interface VectorStore {
30
- upsert(chunks: Chunk[]): Promise<void>
31
- search(query: VectorStoreQuery): Promise<VectorSearchResult[]>
31
+ /** Persist chunks, stopping owned I/O when the operation is cancelled. */
32
+ upsert(chunks: Chunk[], options?: RAGOperationOptions): Promise<void>
33
+ /** Search chunks, stopping owned I/O when the operation is cancelled. */
34
+ search(query: VectorStoreQuery, options?: RAGOperationOptions): Promise<VectorSearchResult[]>
32
35
  delete(chunkIds: ChunkId[]): Promise<void>
33
36
  deleteByDocument(documentId: DocumentId): Promise<void>
34
37
  deleteByKnowledgeBase(knowledgeBaseId: KnowledgeBaseId, tenantId: TenantId): Promise<void>
@@ -8,6 +8,26 @@ import type { CheckpointStore } from './checkpoint-store.js'
8
8
  export interface AgentRunConfig {
9
9
  model: string
10
10
  timeoutMs: number
11
+ /**
12
+ * Maximum silence between provider stream chunks, in milliseconds.
13
+ *
14
+ * Defaults to five minutes at the `query()` boundary. This is distinct
15
+ * from `timeoutMs`, which is checked between agent iterations and cannot
16
+ * settle a provider iterator whose pending `next()` never returns. Set
17
+ * `0` to retain unbounded stream silence. Positive values must be integer
18
+ * milliseconds accepted by the platform timer.
19
+ */
20
+ streamIdleTimeoutMs?: number
21
+ /**
22
+ * Maximum accumulated inline image/document payload on one provider request.
23
+ *
24
+ * Defaults to 24 MiB. The budget is shared by user attachments and rich
25
+ * tool-result blocks. When history exceeds it, the provider-bound projection
26
+ * replaces the oldest values with model-visible omission markers; the run's
27
+ * canonical messages and durable evidence remain unchanged. Set `0` to keep
28
+ * the prior unbounded behaviour.
29
+ */
30
+ maxRequestRichContentBytes?: number
11
31
  maxResponseTokens?: number
12
32
 
13
33
  /**
@@ -581,15 +581,33 @@ type CoreRunEvent =
581
581
  // run when the request asks for something the provider DRIVER declared
582
582
  // it cannot do — tools registered against a no-tools driver (tool
583
583
  // surfaces stripped so the model is never told about uncallable
584
- // tools), or image attachments against a no-vision driver (attachments
585
- // dropped). Hosts surface these so degradation is visible, not silent.
584
+ // tools), image attachments against a no-vision driver, or document
585
+ // attachments against a no-documents driver. Hosts surface these so
586
+ // degradation is visible, not silent.
586
587
  | {
587
588
  type: 'capability_warning'
588
589
  runId: RunId
589
- capability: 'tools' | 'vision'
590
+ capability: 'tools' | 'vision' | 'documents'
590
591
  providerId: string
591
592
  message: string
592
593
  }
594
+ /**
595
+ * Provider-invalid tool history was repaired before the first model call.
596
+ *
597
+ * Counts, not content: a host can surface and audit the rewrite without
598
+ * copying tool output or conversation secrets into its event channel.
599
+ * `fresh-history` names caller-supplied history. `abandoned-checkpoint`
600
+ * excludes any incomplete turn still owned by a durable pending/recovered
601
+ * resume plan; that turn is completed by its authority path instead.
602
+ */
603
+ | {
604
+ type: 'message_history_repaired'
605
+ runId: RunId
606
+ source: 'fresh-history' | 'abandoned-checkpoint'
607
+ duplicateToolResultsRemoved: number
608
+ orphanedToolResultsRemoved: number
609
+ syntheticToolResultsInserted: number
610
+ }
593
611
  | {
594
612
  type: 'token_usage_updated'
595
613
  runId: RunId
@@ -623,6 +641,13 @@ type CoreRunEvent =
623
641
  * Absent when the run has no compaction configuration, because
624
642
  * nothing then resolves a window and inventing one would be the
625
643
  * guess this exists to replace.
644
+ *
645
+ * This is a state snapshot, not merely a receipt for a model call.
646
+ * It is also emitted immediately after an automatic context edit:
647
+ * cumulative `usage`/`cost` may be unchanged (or may include a
648
+ * verifier call) while `contextTokens` falls to its post-edit
649
+ * estimate. Hosts therefore need not wait for another provider
650
+ * response to learn that compaction made room.
626
651
  */
627
652
  contextTokens?: number
628
653
  contextMeasuredBy?: 'provider' | 'estimate'
@@ -42,6 +42,8 @@ export interface RunConfigSnapshot {
42
42
  model: string
43
43
  tokenBudget: number
44
44
  timeoutMs: number
45
+ streamIdleTimeoutMs?: number
46
+ maxRequestRichContentBytes?: number
45
47
  maxIterations?: number
46
48
  temperature?: number
47
49
  maxResponseTokens?: number
@@ -1,6 +1,6 @@
1
1
  import type { CostInfo, TokenUsage } from '../common/index.js'
2
2
  import type { MessageId } from '../ids/index.js'
3
- import type { ToolCall } from '../message/index.js'
3
+ import type { ProviderRoute, ToolCall } from '../message/index.js'
4
4
  import type { ProviderErrorCode } from '../provider/errors.js'
5
5
 
6
6
  /**
@@ -125,12 +125,7 @@ export interface StepResult {
125
125
  * the same provider twice — two models, or two credentials, on one driver.
126
126
  * `providerId` alone could not tell those apart.
127
127
  */
128
- export interface StepProvenance {
129
- readonly providerId: string
130
- readonly model: string
131
- /** 0 is the head, i.e. the provider the run was configured with. */
132
- readonly chainIndex: number
133
- }
128
+ export interface StepProvenance extends ProviderRoute {}
134
129
 
135
130
  /**
136
131
  * Why a step ended in `finishReason: 'error'`.
@@ -27,10 +27,40 @@
27
27
  * re-keyed per call, it happens once, deliberately, as its own change.
28
28
  */
29
29
 
30
+ import type { Message } from '../message/index.js'
30
31
  import type { AuditEvent } from './audit.js'
31
32
  import type { Run } from './entity.js'
32
33
  import type { PersistedRunEvent, RunEvent } from './events.js'
33
34
 
35
+ /**
36
+ * The run's surviving message history, and whether it can be placed against
37
+ * the durable event log without guessing.
38
+ *
39
+ * `available` is stronger than "some bytes were found": `throughEventSeq`
40
+ * names the exact event-log head the snapshot was published after. A caller
41
+ * can therefore refuse a stale snapshot left by an earlier pause or a crash
42
+ * during final persistence instead of presenting it as the whole run.
43
+ *
44
+ * `legacy-unverified` preserves read access to the raw message arrays written
45
+ * before snapshots carried that boundary. Those messages are real, but no
46
+ * stored fact proves which event-log head they represent, so they must not be
47
+ * used to claim a complete transcript.
48
+ */
49
+ export type RunMessageSnapshot =
50
+ | {
51
+ readonly kind: 'available'
52
+ readonly throughEventSeq: number
53
+ readonly messages: readonly Message[]
54
+ }
55
+ | {
56
+ readonly kind: 'legacy-unverified'
57
+ readonly messages: readonly Message[]
58
+ }
59
+ | {
60
+ readonly kind: 'unavailable'
61
+ readonly reason: 'not-persisted'
62
+ }
63
+
34
64
  /** What a caller asks the log for. See {@link RunStore.readEvents}. */
35
65
  export interface ReadRunEventsOptions {
36
66
  /**
@@ -41,6 +71,17 @@ export interface ReadRunEventsOptions {
41
71
  * delivered twice. Absent means the whole log.
42
72
  */
43
73
  readonly sinceSeq?: number
74
+ /**
75
+ * Refuse a disk transcript with a torn, malformed, or discontinuously
76
+ * numbered record instead of skipping past it.
77
+ *
78
+ * The default stays `tolerant`: an incident viewer is usually better served
79
+ * by every intact event around one damaged line. A caller making a
80
+ * completeness claim — an export, a replay proof, an archive — chooses
81
+ * `strict`, because one skipped line makes that claim false even when the
82
+ * rest of the log remains useful.
83
+ */
84
+ readonly integrity?: 'tolerant' | 'strict'
44
85
  }
45
86
 
46
87
  /**
@@ -72,8 +113,25 @@ export interface RunStore {
72
113
  /** Persist the run record: status, metadata, usage, timings. */
73
114
  writeRunMeta(run: Run): Promise<void>
74
115
 
75
- /** Persist the run's full message history. */
76
- writeMessages(run: Run): Promise<void>
116
+ /**
117
+ * Publish the run's surviving message history through a durable event.
118
+ *
119
+ * The boundary is required. Messages are written after the terminal or
120
+ * pause event, and a resumed run reuses the same run id; without the
121
+ * boundary an older, valid file is indistinguishable from the current
122
+ * run's final snapshot.
123
+ */
124
+ writeMessages(run: Run, throughEventSeq: number): Promise<void>
125
+
126
+ /**
127
+ * Read the published message snapshot back.
128
+ *
129
+ * Missing data is `unavailable`, never an available empty list. An empty
130
+ * list is a real snapshot only after {@link RunStore.writeMessages}
131
+ * explicitly published it. This distinction closes the crash window where
132
+ * the run's terminal event and metadata landed but its messages did not.
133
+ */
134
+ readMessages(): Promise<RunMessageSnapshot>
77
135
 
78
136
  /**
79
137
  * Append one event to the run's durable event log.
@@ -31,7 +31,25 @@ export function assertSandboxStatus(status: SandboxStatus): void {
31
31
  // Sandbox environment — detected platform capability
32
32
  // ---------------------------------------------------------------------------
33
33
 
34
- export type SandboxEnvironment = 'linux-namespace' | 'macos-seatbelt' | 'basic'
34
+ export type SandboxEnvironment = 'linux-bwrap' | 'linux-namespace' | 'macos-seatbelt' | 'basic'
35
+
36
+ /**
37
+ * Every tier, in the order a detector prefers them: strongest first.
38
+ *
39
+ * Exported because the alternative is what was there — a hand-written
40
+ * alternation in a doctor test that had to be edited by whoever added a tier,
41
+ * and was not, so the first new tier in a year failed a test that was
42
+ * describing the tier list rather than checking anything about it.
43
+ *
44
+ * `assertSandboxEnvironment` reads this too, so the union, the runtime list and
45
+ * the exhaustive check cannot drift apart.
46
+ */
47
+ export const SANDBOX_ENVIRONMENTS: readonly SandboxEnvironment[] = [
48
+ 'linux-bwrap',
49
+ 'macos-seatbelt',
50
+ 'linux-namespace',
51
+ 'basic',
52
+ ]
35
53
 
36
54
  /**
37
55
  * A security control a sandbox tier either provides or does not.
@@ -60,16 +78,11 @@ export const SANDBOX_ISOLATION_CONTROLS: readonly SandboxIsolationControl[] = [
60
78
  export type SandboxIsolationReport = Readonly<Record<SandboxIsolationControl, boolean>>
61
79
 
62
80
  export function assertSandboxEnvironment(env: SandboxEnvironment): void {
63
- switch (env) {
64
- case 'linux-namespace':
65
- case 'macos-seatbelt':
66
- case 'basic':
67
- return
68
- default: {
69
- const _exhaustive: never = env
70
- throw new Error(`Unknown SandboxEnvironment: ${_exhaustive}`)
71
- }
72
- }
81
+ // Membership, not a switch. A `case` per tier is a second list to keep in
82
+ // step with the union, and the switch's `never` arm only catches a tier
83
+ // ADDED to the union — never one added here and forgotten there.
84
+ if (SANDBOX_ENVIRONMENTS.includes(env)) return
85
+ throw new Error(`Unknown SandboxEnvironment: ${env}`)
73
86
  }
74
87
 
75
88
  // ---------------------------------------------------------------------------
@@ -207,7 +220,8 @@ export interface Sandbox {
207
220
  setNetworkPolicy?(policy: SandboxNetworkPolicy): Promise<void>
208
221
 
209
222
  /**
210
- * Open a real pseudo-terminal inside this sandbox.
223
+ * Open a real pseudo-terminal whose complete process tree is confined to
224
+ * and owned by this sandbox.
211
225
  *
212
226
  * Optional, and a backend that cannot provide one must **throw** rather
213
227
  * than hand back a pipe — the same rule {@link Sandbox.setNetworkPolicy}
@@ -217,7 +231,14 @@ export interface Sandbox {
217
231
  * exits immediately, the progress bar prints ten thousand lines, and
218
232
  * nothing says why.
219
233
  *
220
- * See `sandbox/terminal.ts` for why the backing binding is optional.
234
+ * A backend that implements this method MUST make {@link destroy} kill and
235
+ * await every terminal it returned. Merely starting a host pseudo-terminal
236
+ * with `rootDir` as its working directory does not satisfy either the
237
+ * confinement or the ownership contract.
238
+ *
239
+ * @deprecated No built-in backend currently satisfies both guarantees.
240
+ * Use a separately owned terminal backend; this member will be removed in
241
+ * a future major release after the repository's deprecation window.
221
242
  */
222
243
  openTerminal?(options: OpenTerminalOptions): Promise<TerminalSession>
223
244
  writeFile(path: string, content: string | Buffer): Promise<void>
@@ -242,7 +263,20 @@ export interface Sandbox {
242
263
  * MAY throw for other I/O failures.
243
264
  */
244
265
  listFiles(rootPath: string): Promise<readonly SandboxFileEntry[]>
245
- destroy(): Promise<void>
266
+ /**
267
+ * Release every resource owned by this sandbox.
268
+ *
269
+ * The signal belongs to a fresh teardown operation, not to the run that is
270
+ * already ending. Implementations should stop their teardown transport and
271
+ * settle promptly when it aborts. Hosts may still impose an independent
272
+ * wait bound because a third-party implementation can ignore the signal.
273
+ */
274
+ destroy(options?: SandboxDestroyOptions): Promise<void>
275
+ }
276
+
277
+ /** Authority for a teardown operation owned independently of the ending run. */
278
+ export interface SandboxDestroyOptions {
279
+ readonly signal?: AbortSignal
246
280
  }
247
281
 
248
282
  // ---------------------------------------------------------------------------
@@ -418,6 +452,15 @@ export interface ResolvedContainerSandboxLayout {
418
452
  // ---------------------------------------------------------------------------
419
453
 
420
454
  export interface SandboxCreateConfig {
455
+ /**
456
+ * Withdraws authority to publish the allocation to the run.
457
+ *
458
+ * Providers should stop their transport and reconcile any resource they can
459
+ * identify. This signal is not, by itself, proof that a remote allocation
460
+ * was rolled back: a service that commits before returning its identifier
461
+ * still needs a client-owned reconciliation key or an external reaper.
462
+ */
463
+ readonly signal?: AbortSignal
421
464
  readonly workingDirectory?: string
422
465
  readonly env?: Record<string, string>
423
466
  readonly timeoutMs?: number
@@ -321,6 +321,24 @@ export interface SessionStore {
321
321
  */
322
322
  appendMessage(sessionId: SessionId, message: Message, tenantId: TenantId): Promise<MessageId>
323
323
 
324
+ /**
325
+ * Replace the conversation view with a compacted history. OPTIONAL.
326
+ *
327
+ * This is not deletion of the underlying log. A durable implementation may
328
+ * append one replacement record and project every later read from it, which
329
+ * keeps the write atomic while preserving the earlier records for recovery.
330
+ *
331
+ * Optional because existing hosts implement this interface, and manual
332
+ * compaction is a host capability rather than a requirement every store must
333
+ * gain. A caller that offers durable compaction checks for it and refuses to
334
+ * claim persistence when the store cannot perform the replacement.
335
+ */
336
+ replaceMessages?(
337
+ sessionId: SessionId,
338
+ messages: readonly Message[],
339
+ tenantId: TenantId,
340
+ ): Promise<void>
341
+
324
342
  /**
325
343
  * Load the full message history for a session in insertion order.
326
344
  * Returns an empty array when the session has no messages.
@@ -18,16 +18,6 @@ export interface ToolRegistryRef {
18
18
  getAvailability(name: string): ToolAvailability
19
19
  }
20
20
 
21
- /**
22
- * The slice of the background job registry a tool is given.
23
- *
24
- * A structural reference rather than the class, for the reason
25
- * `ToolRegistryRef` exists: this type file is imported by everything, and
26
- * naming the implementation here would drag a `node:child_process` module
27
- * into every consumer's type graph. `owner` is not on this surface at all —
28
- * the executor binds it to the run, so a tool cannot start a job that
29
- * outlives, or is billed to, somebody else's run.
30
- */
31
21
  /**
32
22
  * The slice of the skills registry a tool is given.
33
23
  *
@@ -67,6 +57,16 @@ export interface SkillRegistryRef {
67
57
  names(): readonly string[]
68
58
  }
69
59
 
60
+ /**
61
+ * The slice of the background job registry a tool is given.
62
+ *
63
+ * A structural reference rather than the class, for the reason
64
+ * `ToolRegistryRef` exists: this type file is imported by everything, and
65
+ * naming the implementation here would drag a `node:child_process` module
66
+ * into every consumer's type graph. `owner` is not on this surface at all —
67
+ * the executor binds it to the run, so a tool cannot start a job that
68
+ * outlives, or is billed to, somebody else's run.
69
+ */
70
70
  export interface BackgroundJobRegistryRef {
71
71
  start(params: { command: string; workingDirectory: string }): { id: string; status: string }
72
72
  get(id: string): { id: string; status: string; exitCode?: number }
@@ -207,7 +207,9 @@ export interface ToolContext {
207
207
  * `linux-namespace` tier the wrapping `sh` is PID 1 of a fresh PID
208
208
  * namespace, so a backgrounded grandchild dies the moment that shell
209
209
  * exits, on the successful path. It returns in milliseconds looking like
210
- * it worked, with the work already dead.
210
+ * it worked, with the work already dead. It is also absent from sandboxed
211
+ * query-built contexts: the shipped registry owns host processes and
212
+ * cannot preserve a sandbox boundary.
211
213
  */
212
214
  backgroundJobs?: BackgroundJobRegistryRef
213
215
 
@@ -415,6 +417,26 @@ export interface ToolDefinition<TInput = unknown> extends ToolPresentation<TInpu
415
417
  * request.
416
418
  */
417
419
  outputSchema?: Record<string, unknown>
420
+ /**
421
+ * The argument that holds a shell command line, when one does.
422
+ *
423
+ * Declared on the tool because only the tool knows. An operator writing
424
+ * `bash = { "git status*" = "allow" }` means the `command` argument, and
425
+ * every other way of learning that is a list somewhere else that drifts:
426
+ * a host compiling permissions has the tool's NAME and no reason to know
427
+ * which of its arguments is the interesting one.
428
+ *
429
+ * What it buys is the difference between a permission about text and a
430
+ * permission about commands. A rule routed through this argument reads
431
+ * `git status && rm -rf ~` as the two commands it is, so an `allow`
432
+ * written for `git status*` declines it instead of approving it on the
433
+ * strength of the first few words. See `decomposeCommandLine`.
434
+ *
435
+ * Omit it on every tool that takes no command line. A tool that runs
436
+ * something but takes an argument list rather than a line — no shell, no
437
+ * chaining — has nothing to decompose and must not claim otherwise.
438
+ */
439
+ commandArgument?: string
418
440
  execute(input: TInput, context: ToolContext): Promise<ToolResult>
419
441
  tier?: string
420
442
  permissions?: ToolPermission[]
@@ -67,10 +67,9 @@ export type TopicStatus = 'open' | 'archived'
67
67
  * the kernel.
68
68
  * - `ownerVersion` is the CAS counter for mutations — `updateTopic` and
69
69
  * archival transitions require a matching version and reject
70
- * {@link import('../../session/errors.js').StaleThreadError} on mismatch
71
- * (error class name is unchanged this release — see NZ-TOPIC-01 risks).
72
- * Mirrors the {@link import('./entity.js').Session} handoff CAS pattern
73
- * (§6.1).
70
+ * {@link import('../../session/errors.js').StaleTopicError} on mismatch
71
+ * with `details.topicId`. Mirrors the
72
+ * {@link import('./entity.js').Session} handoff CAS pattern (§6.1).
74
73
  * - No fan-in `deriveStatus()` helper — status is owner-managed, not
75
74
  * Run-derived. This is the Topic-vs-Session contract boundary.
76
75
  */
@@ -69,9 +69,9 @@ export interface TopicStore {
69
69
  /**
70
70
  * Persist a mutation to a Topic record. CAS on `ownerVersion`: if the
71
71
  * supplied `topic.ownerVersion` does not match the persisted version,
72
- * rejects with {@link import('../../session/errors.js').StaleThreadError}
73
- * (class name unchanged this release). On success the write commits with
74
- * `ownerVersion + 1` and a refreshed `updatedAt`.
72
+ * rejects with {@link import('../../session/errors.js').StaleTopicError}
73
+ * using `details.topicId`. On success the write commits with `ownerVersion
74
+ * + 1` and a refreshed `updatedAt`.
75
75
  *
76
76
  * Archival transition (`status: 'open' → 'archived'`) shares this path;
77
77
  * the caller is responsible for verifying that no non-terminal Sessions