@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,561 @@
1
1
  # Changelog
2
2
 
3
+ ## 31.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - bebad69: Refuse host background jobs when a run is sandboxed.
8
+
9
+ `bash` previously sent foreground commands through `Sandbox.exec`, but sent the same command directly to a host-spawning `BackgroundJobRegistry` when `run_in_background: true`. A caller that supplied both `sandboxProvider` and `backgroundJobs` therefore exposed both capabilities to every tool, and one input boolean moved work outside the configured boundary.
10
+
11
+ Sandboxed tool contexts no longer receive the host background-job reference. `bash run_in_background` reports that the two capabilities cannot be composed, while foreground `bash` continues through the sandbox and unsandboxed runs can continue to use the registry.
12
+
13
+ **What breaks:** a run configured with both `sandboxProvider` and `backgroundJobs` can no longer start a background job. Omit `sandboxProvider` only when host execution is the intended policy, run the command in the foreground to keep the sandbox boundary, or provide a future persistent-process backend that owns confinement as well as lifetime.
14
+
15
+ - f3bf47b: Require every `PluginLifecycleManager` host to provide project and user
16
+ `scopeRoots`. Plugin installation now canonicalizes a candidate against that
17
+ declared filesystem authority, refuses symlinked or non-regular plugin
18
+ manifests, and keeps executable admission and lifecycle ownership private to
19
+ the manager instead of trusting mutable `PluginRegistry` records.
20
+
21
+ Hosts constructing the SDK manager must pass
22
+ `scopeRoots: { project: trustedWorkingDirectory, user: userHomeDirectory }`.
23
+ Move plugins under the matching root instead of relying on a symlink or an
24
+ out-of-scope registry record. The CLI applies those roots automatically and no
25
+ longer loads project or user plugins through links that leave the admitted
26
+ scope.
27
+
28
+ - 27667cc: Provider requests now limit accumulated inline user attachments and rich tool-result images/documents to 24 MiB by default. Over-budget requests replace the oldest payloads with model-visible markers without modifying `Run.messages`, durable history, checkpoints, or tool call/result identity. This changes the previous unbounded default; set `maxRequestRichContentBytes: 0` on the run or agent config to retain it. The effective value is persisted in run metadata, and `DEFAULT_MAX_REQUEST_RICH_CONTENT_BYTES` exposes the shipped default.
29
+ - fd5fcea: Bound sandbox lifecycle ownership across run cancellation and teardown.
30
+
31
+ Sandbox creation now receives run cancellation and the run's remaining wall-clock timeout, cannot publish a handle after either boundary wins, and releases any handle that arrives late. A setup that ignores its signal therefore settles the run with `stopReason: 'timeout'` instead of pinning it forever. Teardown receives a fresh signal and waits for 30 seconds by default without allowing an implementation that ignores cancellation to pin the run. Set `sandboxTeardownTimeoutMs: 0` on SDK runs or agents to retain the former unbounded teardown wait. Custom providers should honor `SandboxCreateConfig.signal` and `SandboxDestroyOptions.signal`; remote allocation protocols still need a client-owned reconciliation key or fleet reaper for a resource committed behind a lost response.
32
+
33
+ The CLI exposes the same compatibility control as `sandbox.teardownTimeoutMs` and carries it to live turns, delegated child agents, and durable resumes. Children and resumed runs now use the session's sandbox provider instead of silently executing through the host boundary; set `sandbox.enabled: false` only when host execution is intentional.
34
+
35
+ - f528acd: Make every disk-backed message-feedback update a real compare-and-set commit across concurrent processes, not only the first write.
36
+
37
+ `DiskMessageFeedbackStore` now publishes complete immutable owner-version files through exclusive hard links, lists committed values even when the best-effort legacy projection is absent or behind, reads previous single-file records forward, refuses damaged or mixed-version projection/head states, validates runtime id prefixes before callbacks, and confines run/message keys to injective filesystem segments. Distinct message ids whose previous lossy filenames collide no longer overwrite one projection.
38
+
39
+ **What breaks:** the disk feedback store now requires hard-link support and refuses unsupported filesystems instead of falling back to a racy update. Stop every process using an older SDK before opening a shared feedback root with this version; mixed-version rolling writers are unsupported. Calls that bypassed the branded types with a run or message id lacking its required prefix now reject before message validation or persistence.
40
+
41
+ - 0a7bd58: Make topic-state and objective revisions real compare-and-set commits across concurrent calls and processes.
42
+
43
+ The in-memory stores now keep each read/check/write in one JavaScript turn. The disk stores publish complete, immutable revision files through exclusive hard links, preserve the former single-file record as a forward-readable compatibility projection, reject damaged or mixed-version projection/head states, and encode opaque ids so they cannot escape the configured root. Cross-tenant mutations now reject with `TenantIsolationError` instead of treating a hidden record as absent, and objective `maxRounds` must be a positive safe integer.
44
+
45
+ **What breaks:** disk-backed topic stores now require hard-link support and refuse unsupported filesystems instead of degrading to a racy read-check-replace write. Stop every process using an older SDK before opening a shared store root with this version; mixed-version rolling writers are unsupported because the old implementation cannot see immutable revision commits. Callers that passed fractional, infinite, `NaN`, or unsafe `maxRounds` values must pass a positive safe integer, and callers performing cross-tenant mutations must handle `TenantIsolationError`.
46
+
47
+ - ce8cd61: Make registered connector methods the authoritative execution contract.
48
+
49
+ `ConnectorManager` now requires the registered definition and concrete
50
+ connector to expose the same unique method names, captures that definition at
51
+ instance admission, and refuses unknown methods or invalid input before
52
+ connector I/O. Input schemas use asynchronous parsing and their canonical
53
+ transformed value is passed to the connector exactly once. Successful outputs
54
+ are asynchronously validated and transformed when `outputSchema` is present;
55
+ an invalid or unprovable output is quarantined instead of reaching a caller,
56
+ tool result, MCP response, or later model request.
57
+
58
+ **What breaks:** connectors can no longer execute undeclared methods, consume
59
+ raw pre-transform input through `ConnectorManager`, return schema-invalid data
60
+ as success, or change a live instance's method surface by replacing its
61
+ registry entry. Align the concrete connector and registered definition before
62
+ creating an instance. Third-party `BaseConnector` subclasses that call
63
+ `validateInput` inside `execute` must change that call to
64
+ `await this.validateInput(method, input, options)` so a managed canonical value
65
+ is not parsed twice; standalone calls remain validated.
66
+
67
+ Per-method tools now keep their model-facing method schema separate from their
68
+ pass-through runtime decoder, and MCP projections carry connector output
69
+ schemas, including non-object JSON Schema values. `MCPToolDefinition.outputSchema`
70
+ therefore widens from object-only `MCPJsonSchema` to `MCPValueJsonSchema`.
71
+
72
+ - 2d16ca2: Isolate every live agent-client protocol session by identity, working
73
+ directory, cancellation and exact provider history.
74
+
75
+ **What breaks in the SDK:** one ACP session now permits only one unsettled
76
+ prompt, and session working directories must be absolute. Hosts that submitted
77
+ overlapping prompts under one id must wait, cancel, or use distinct sessions;
78
+ hosts that passed a relative `cwd` must resolve it first. Session creation and
79
+ loading also share one collision-refusing namespace, so loading or generating
80
+ an already open id no longer replaces its live record.
81
+
82
+ Gateways may return the settled conversation beside the stop reason so the next
83
+ prompt receives exact replay state. The CLI drives that seam with one runtime
84
+ session per wire id, activates trusted target config only at the first prompt,
85
+ routes events and permissions to the owning id, and closes late or connection-
86
+ owned sessions on teardown. Cancelling during lazy runtime construction now
87
+ settles the wire prompt immediately while retaining ownership of, and later
88
+ closing, any session candidate that arrives after cancellation.
89
+
90
+ - a3a632f: Stop delegated `SupervisorAgent` runs from publishing `ask_user_question`, including a host tool registered under the same name. Existing hosts that let child supervisors prompt an operator must route that decision through the root supervisor instead. Delegated runs still inherit `resumeHandler` for REVIEW-tier tool authorization; the change does not auto-approve child tool calls.
91
+
92
+ Make `AgentManager` authoritative for child `depth` and `parentRunId` after config builders and per-spawn overrides. Builders that deliberately replaced those lineage fields can no longer do so; derive child behavior from the manager-stamped lineage instead.
93
+
94
+ - 99ff79e: Stop exposing an unconfined host pseudo-terminal as a local sandbox capability.
95
+
96
+ `LocalSandboxProvider` previously implemented `Sandbox.openTerminal` by starting a host PTY in `rootDir`. That changed only the working directory: it bypassed the provider's selected isolation tier, accepted host process configuration, and was not owned or awaited by `Sandbox.destroy()`.
97
+
98
+ Local sandboxes no longer expose `openTerminal`. Supplying the legacy `LocalSandboxProviderOptions.ptyLoader` injection now fails with the boundary reason instead of accepting configuration the provider cannot honour. The option and the optional `Sandbox.openTerminal` member remain deprecated for a release window; the contract now requires an implementing backend to confine the complete terminal process tree and to kill and await it during `destroy()`.
99
+
100
+ **What breaks:** code that opened a terminal from `LocalSandboxProvider` must stop doing so. Use `loadPty` and `openTerminalWith` directly only when intentional host execution and externally owned teardown are correct, or provide a terminal backend that owns both confinement and the complete session lifetime. The generic helpers no longer claim to create a sandbox.
101
+
102
+ - 15f8ee4: Bound provider stream silence, including query-owned advisory calls and
103
+ RouterAgent routing decisions, compaction verifiers and model-graded eval
104
+ judges, to five minutes by default and abort the stalled provider transport,
105
+ with network-classified retry and fallback recovery where those policies
106
+ apply. This changes the previous default, under which a provider iterator could
107
+ remain silent forever. Set `streamIdleTimeoutMs: 0` on the run, agent, manual
108
+ compaction, verifier, or judge config to keep the old unbounded behavior, or set
109
+ a positive millisecond value to choose a different bound.
110
+
111
+ Queries whose caller signal is already aborted now settle as cancelled before
112
+ starting provider, provider-metadata, or tool work. A later cancellation also
113
+ settles while an optional context-window resolver remains pending, even when
114
+ that resolver ignores its signal. With no caller cancellation, `timeoutMs`
115
+ bounds the optional metadata lookup, aborts its private transport signal, and
116
+ falls back to the static context-window table instead of blocking the run.
117
+
118
+ The OpenRouter context-window lookup now forwards cancellation to its model-list
119
+ transport. Only fulfilled listings are cached, so cancelling one concurrent
120
+ query cannot abort another query's shared metadata request or force that query
121
+ onto the static context-window table.
122
+
123
+ `runExperiment({ timeoutMs })` now applies one validated wall-clock deadline to
124
+ both case execution and scoring. Scorers receive its optional cancellation
125
+ signal; a non-cooperative scorer is detached, and `judgeScorer` forwards the
126
+ signal to its bounded provider transport. Values outside the positive platform
127
+ timer range are refused before a case starts; omit the field for the prior
128
+ unbounded case behavior.
129
+
130
+ Compaction verification inside a query now carries the run cancellation cause
131
+ to its provider transport without placing a second idle timer around retry and
132
+ fallback. Public `buildVerifiedSummary`, `compactNow`, and `compactRegion`
133
+ calls bound raw provider silence themselves and accept optional `signal` and
134
+ `streamIdleTimeoutMs`; malformed values and pre-cancelled manual work are
135
+ refused before provider work or a no-op result.
136
+
137
+ HTTP embedding batches now have a 30-second whole-request default, including
138
+ response-body reads, where the previous default could wait forever. Set
139
+ `requestTimeoutMs: 0` on `HttpEmbeddingProvider` to keep the former unbounded
140
+ behavior. Invalid timeout values and non-positive or fractional `batchSize`
141
+ or `dimensions` values are refused at construction instead of silently
142
+ disabling the bound or entering a non-progressing batch loop. Successful HTTP
143
+ responses must contain exactly one unique, in-range result per input and finite
144
+ vectors of the configured dimension; malformed or incomplete batches are
145
+ refused atomically instead of reaching ingestion with missing embeddings.
146
+
147
+ Public RAG operations accept optional cancellation context. The shipped
148
+ `knowledge_search` tool forwards its run-owned signal through
149
+ `KnowledgeBase`, retrieval or ingestion, and the embedding provider. The HTTP
150
+ provider preserves the caller's exact cancellation reason while aborting only
151
+ its private fetch transport. Custom embedding providers receive the signal as
152
+ a cooperative request; callers still own their wait boundary if a custom
153
+ implementation ignores it. Default retrieval and ingestion recheck authority
154
+ after that custom call settles, so a late result cannot start a vector search
155
+ or persist chunks after cancellation. `VectorStore.search` and `upsert` now
156
+ receive the same optional operation context. The default pipelines also race
157
+ those store promises against cancellation, so a non-cooperative custom store
158
+ cannot leave the public query or ingestion call pending forever.
159
+
160
+ A2A agent-card discovery now has a 30-second whole fetch-and-body default and
161
+ accepts an optional caller signal and `timeoutMs`; set `timeoutMs: 0` to retain
162
+ the former unbounded behavior. `A2ADelegate.timeoutMs` now starts before
163
+ `message/send` and bounds the whole delegation instead of polling only. A
164
+ pre-cancelled dispatch starts no remote work, pending fetch and body promises
165
+ cannot hold `waitForTask`, and caller cancellation preserves its exact cause on
166
+ the private transport. Poll and delegation timers are validated at
167
+ construction. Once a safe task id exists, cancellation or timeout sends one
168
+ independently bounded `tasks/cancel`; during initial task creation the client
169
+ keeps a short cleanup grace and explicitly reports an unknown remote outcome if
170
+ the peer never returns an addressable id. Poll replies are bound to that initial
171
+ id, and transport or protocol failures after it is known make the same bounded
172
+ cleanup attempt before the original failure is returned. An `input-required`
173
+ task is also bounded-cancelled before the delegate reports that it cannot
174
+ supply the requested input.
175
+
176
+ Connector execution now carries optional operation authority through the
177
+ manager, every connector-tool adapter, real query runs, tenant/environment
178
+ facades, health checks, and `MCPConnectorBridge.callTool`. Custom connectors
179
+ receive the signal; if they ignore it, the manager settles with an honest
180
+ unknown remote outcome and rejects a late success that does not identify a
181
+ received response. A tenant call cancelled before admission no longer spends a
182
+ rate-limit slot.
183
+
184
+ `HttpConnector` and `WebhookConnector` now apply one validated 30-second
185
+ fetch-and-body deadline and a streaming 2 MiB response limit by default. Set
186
+ positive `timeoutMs` and `maxResponseBytes` values to choose different bounds.
187
+ Cancellation, deadline, or response-size failure aborts only the private
188
+ transport/body reader and preserves the caller's exact cause. Result metadata
189
+ distinguishes `not_started`, `unknown`, and `response_received`, includes retry
190
+ safety, and keeps a received status visible when its body is unavailable.
191
+
192
+ Dynamic HTTP paths and webhook URL overrides must remain on the configured
193
+ origin. Model-authored routing headers are refused, redirects are not followed,
194
+ and 3xx responses are no longer reported as success. Configure a separate
195
+ connector instance for each authorized origin; callers that previously used a
196
+ cross-origin webhook override must migrate to that instance.
197
+
198
+ `GuardedFetchProvider` now applies one validated 30-second deadline across DNS
199
+ resolution, every manually admitted redirect fetch, and the final response
200
+ body, while preserving a caller's exact cancellation cause on a private
201
+ transport signal. Its 2 MiB default response cap is enforced from streamed
202
+ bytes rather than after `response.text()` allocates the whole body; overflow
203
+ cancels the reader and returns a valid UTF-8 prefix. Redirect bodies are
204
+ cancelled when abandoned, and a spent redirect budget causes no DNS lookup for
205
+ the next target. Set positive `timeoutMs` and `maxBytes` values or a
206
+ non-negative integer `maxRedirects` to choose other bounds. Custom
207
+ `GuardedFetchConfig.resolve` functions may now accept the operation signal as
208
+ a second argument. IPv4-mapped IPv6 literals are canonicalized back to their
209
+ IPv4 address before range checks, closing the hexadecimal mapped loopback and
210
+ link-local bypass; the full IPv6 link-local and multicast ranges are also
211
+ refused.
212
+
213
+ MCP request methods now accept optional cancellation authority, and generated
214
+ MCP tool and prompt adapters forward the run-owned tool signal. A pre-aborted
215
+ request starts no transport work; a pending request preserves the caller's
216
+ exact cause, aborts a private transport, removes its correlated pending id, and
217
+ makes a one-second best-effort `notifications/cancelled` attempt. The
218
+ notification does not prove that an already-started remote side effect stopped.
219
+ Paged list calls recheck the same signal before each page.
220
+
221
+ `MCPClient.requestTimeoutMs` and HTTP MCP transport `timeoutMs` values must now
222
+ be positive platform-range integers. A shorter transport deadline remains a
223
+ request-timeout terminal and emits the same correlated cancellation. HTTP
224
+ fetches and response-body reads share operation authority; disconnect owns
225
+ active requests and cancellation cleanup. Reconnects fence late POST responses
226
+ and SSE batches from prior generations, clear Streamable session state, and
227
+ accept session ids only from successful `initialize` responses. Per-send
228
+ failure no longer marks a Streamable client connection-wide errored or rejects
229
+ unrelated concurrent calls. `MCPTransport.send` now accepts optional
230
+ `MCPTransportSendOptions`; custom transports should refuse pre-aborted work and
231
+ stop their per-send I/O when its signal fires.
232
+
233
+ Provider model listings and credential probes now accept optional cancellation
234
+ signals. Retry, fallback, stream-idle and instrumentation decorators preserve
235
+ that authority, and every bundled CLI driver forwards it to the underlying
236
+ transport where supported or refuses a result that arrived after cancellation.
237
+ Existing zero-argument provider implementations remain valid.
238
+
239
+ The interactive provider picker now cancels model discovery, credential checks
240
+ and subscription sign-in when the operator backs out, supersedes the work, or
241
+ leaves the screen. Late results cannot reopen an old model step, accept a
242
+ credential, re-probe the application, or persist a subscription credential
243
+ after cancellation. Model listing and credential probing both settle after a
244
+ three-second bound even when a custom provider ignores its signal.
245
+
246
+ Between-turn and durable-resume subscription refreshes now settle on caller
247
+ cancellation and apply one 30-second bound across the token request and response
248
+ body. Refreshes in one session are serialized and re-read their source at the
249
+ head of the queue, preventing a later stale caller from downgrading a token
250
+ published by an earlier one. Namzu's credential file uses an exact conditional
251
+ replacement under a cross-process, atomically published lock; an external
252
+ rotation or logout wins, and an uncertain publication refuses instead of using
253
+ an uncommitted refresh. Borrowed macOS Keychain credentials are read-only: a
254
+ changed or removed entry wins, and a successful refresh of an unchanged entry
255
+ remains session-local.
256
+
257
+ - 317360a: `WriteFileTool` now refuses an existing file whose complete body differs from the exact body captured by the run's `FileReadTracker`, instead of silently replacing that newer body. Read the file again and recompute the full replacement before retrying. Hosts that implement only the older boolean read tracker retain their previous behavior; the guard is an admission-time preflight and does not claim cross-process compare-and-swap publication.
258
+ - 192d90e: Make connector credentials tenant- and connector-authorized instead of
259
+ globally authorized by credential id. Custom `CredentialVault`
260
+ implementations must add atomic `retrieveForScope(tenantId, connectorId, id)`
261
+ and `revokeForTenant(tenantId, id)` operations; keep `retrieve(id)` and
262
+ `revoke(id)` only for callers that intentionally hold host-wide vault
263
+ authority. `TenantConnectorManager.revokeCredential` now requires `tenantId`,
264
+ and credential plus connector-instance identity fields are readonly snapshots.
265
+
266
+ `ConnectorDefinition.supportedAuth` is now enforced. Align a concrete
267
+ connector's declaration with its registered definition, include `none` when an
268
+ unauthenticated connection is valid, and declare every scheme it can consume.
269
+ Unsupported explicit credentials are refused before instance publication and
270
+ late credentials are rechecked before connection. Existing live instances keep
271
+ the auth policy captured at creation instead of following later registry
272
+ replacement.
273
+
274
+ - 1792bcb: `argument_pattern` reads a command line as the commands it runs, not as one string
275
+
276
+ An anchored pattern was tested against the argument's whole value, so a rule
277
+ matching `^git push` saw `git push origin main` and did not see
278
+ `true; git push origin main`. A rule that fails to match reaches the permission
279
+ mode, and a run with no terminal resolves that to `auto` — so an operator's
280
+ prohibition was bypassed by typing four characters in front of it, in exactly
281
+ the unattended case the prohibition exists for. The `bash` tool's own
282
+ description tells the model to use `&&` / `;` chaining, so the evading form is
283
+ the documented one rather than an exotic input.
284
+
285
+ The rule now decomposes the value into its commands — chain operators, subshell
286
+ grouping and a nested `sh -c` payload, with quoting respected — and the two
287
+ decisions read that decomposition differently:
288
+
289
+ - `deny` matches when **any** command on the line matches.
290
+ - `allow` matches only when **every** command on the line matches, and never
291
+ when the line runs something the decomposition cannot see (`$(…)`, backticks,
292
+ `<(…)`, `eval`).
293
+
294
+ **What breaks.** An `allow` rule stops approving a chain that carries a command
295
+ it does not name: `git status && rm -rf ~` was approved by a rule written for
296
+ `^git status` and is now left undecided, falling through to the permission mode.
297
+ A `deny` rule refuses more than it used to, which is the change it exists for.
298
+ To keep a compound line approved, write a pattern that matches every command on
299
+ it, or approve the tool by name.
300
+
301
+ A value with no chain operator, no nested shell and nothing opaque is matched
302
+ exactly as before, byte for byte, so rules about a path, a URL or a number are
303
+ unaffected.
304
+
305
+ `ToolDefinition` and `defineTool` gain an optional `commandArgument`, naming the
306
+ argument that holds a command line — `bash` declares `command`. A host
307
+ compiling operator permissions has a tool name and needs an argument to attach a
308
+ pattern to, and every other way of learning that is a list elsewhere that
309
+ drifts. `builtinCommandArguments()` and `commandArgumentOf()` read it back.
310
+
311
+ - 095c936: Use Topic terminology across the public lifecycle authority and its rejection shapes.
312
+
313
+ **What breaks:** `TopicManager`, `InMemoryTopicStore`, `AgentManager`, and the handoff helpers now reject with `TopicArchivedError`, `TopicNotEmptyError`, and `StaleTopicError`. Their `error.name`, message, JSON serialization, and structured details use Topic vocabulary; replace `details.threadId` with `details.topicId` and branch on the new classes exported from `@namzu/sdk`.
314
+
315
+ Inject the lifecycle authority through the canonical `topicManager` dependency key. The deprecated `threadManager` key remains accepted for a migration window, but supplying two different manager instances is now refused instead of choosing one implicitly.
316
+
317
+ - bf26200: Make a run's surviving messages readable and bind their publication to the durable event log.
318
+
319
+ `RunStore.readMessages()` is now required and returns an explicit `RunMessageSnapshot`: `available` includes the messages and the event sequence they were published through, `unavailable` means no snapshot was published, and `legacy-unverified` preserves access to older raw arrays without claiming which log head they represent. The built-in disk and memory stores implement the same contract, and `readRunMessagesIn(runDir)` reads a disk snapshot without creating a run directory.
320
+
321
+ `RunQuery.fullTranscript()` can now read the surviving snapshot from its bound store when the caller omits the message argument. It combines that verified snapshot with durable `compaction_shed` records and refuses with `RunTranscriptUnavailableError` when publication was interrupted, the snapshot is legacy-unverified, or a resumed run has advanced beyond the snapshot boundary. A missing file is never reported as an empty conversation.
322
+
323
+ **What breaks:** custom `RunStore` implementations must add `readMessages()` and change `writeMessages(run)` to `writeMessages(run, throughEventSeq)`. Return `unavailable` until a write has actually published the snapshot; do not use an available empty list for missing data. Code that reads the built-in `messages.json` directly must migrate from the former raw array to the versioned `{ format, throughEventSeq, messages }` envelope, or call `readRunMessagesIn`. Older raw-array files remain readable as `legacy-unverified` but cannot support a complete-transcript claim.
324
+
325
+ ### Minor Changes
326
+
327
+ - 777b444: Bind stored image and document resolution to the run's caller signal. A pre-cancelled run now starts no attachment-store or provider work, and a store that ignores cancellation can no longer hold the run open or publish bytes after authority is withdrawn. Cancelled runs retain the unresolved attachment references in their durable messages. Canonical resumes also retain the selected checkpoint's history and usage without rereading that checkpoint after cancellation.
328
+
329
+ Custom `AttachmentStore` implementations may accept the new optional `AttachmentOperationOptions` argument on `get` and should use its signal to stop owned I/O. Existing one-argument implementations remain compatible.
330
+
331
+ `resumeRun` now refuses contradictory run, session, topic, project, tenant, or explicit parent attribution before provider work instead of allowing checkpoint history to cross those boundaries. Its selected checkpoint also supplies the trace parent for a cancelled cross-process resume without a second checkpoint read.
332
+
333
+ - 780a471: Expand `ReasoningEffort` with `none`, `minimal`, and `ultra`, while making the vocabulary explicitly model-specific rather than a universal capability claim. The OpenAI Chat Completions driver now carries a requested effort to `reasoning_effort`, refuses levels outside each recognized model family's published set before transport, and exposes `openAIReasoningEffortLevels()` with an honest `undefined` result for unknown compatible-endpoint model ids.
334
+ - 74705e2: Add `/compact`, which shrinks a conversation when you ask rather than when a threshold decides.
335
+
336
+ The machinery already existed — `compactNow` is exported from `@namzu/sdk` and its comment says it is "compaction a host can ASK for" — and no host asked. A long session could only be compacted by crossing a token threshold mid-turn, which is the moment you least want a model call, or by clearing it and losing everything.
337
+
338
+ `/compact` summarises the older half and keeps the recent turns. What it does with the transcript is the part worth knowing: the transcript is **trimmed** to the surviving turns rather than rebuilt from the returned messages. The two are not the same list — the transcript also holds tool rows, per-tool glyphs and collapsed bodies the model never saw, and rebuilding would produce a correct conversation while erasing how the surviving turns looked. Tool rows belonging to a kept turn stay with it, because an answer on screen with no visible cause is worse than a longer transcript.
339
+
340
+ A conversation too short to shed anything says so instead of reporting a compaction that did not happen, and the summary is attached to the row as collapsible detail — it is what the model reads from here on, so it has to be inspectable.
341
+
342
+ `CompactNowInput` and `CompactionResult` are now exported from `@namzu/sdk`. `compactNow` was on the public surface and its parameter and return types were not, so the first host to call it had to inline the shapes.
343
+
344
+ - 45e8f56: Deprecate `ConnectorDefinition.triggers`, `ConnectorTrigger`, and
345
+ `ConnectorEvent`. The SDK has never subscribed to these declarations, emitted
346
+ their event shape, or started a run from them. Existing hosts may continue to
347
+ read trigger metadata back from `ConnectorRegistry` during this migration
348
+ release.
349
+
350
+ Move inbound subscription metadata and the event envelope into the host that
351
+ owns delivery before the next SDK major. That host must continue to own
352
+ de-duplication, claim recovery, trust, and run admission; registering a trigger
353
+ with Namzu does not activate an inbound event path.
354
+
355
+ - 3c61c94: Make manual compaction the conversation history used after the command, not only a transcript notice.
356
+
357
+ The CLI now sends the compaction summary on the next turn and restores the same compacted history through `/resume`. It waits for pending turn writes before atomically replacing the durable conversation projection, refuses to compact an active turn, and pauses input while the snapshot is owned. Expanded file mentions and image attachments also remain in later model requests instead of being rebuilt from their lossy transcript rows. `/clear` continues to clear only the visible transcript.
358
+
359
+ The SDK adds optional `SessionStore.replaceMessages` support to its memory and disk stores. The disk implementation keeps the physical message log append-only by writing one replacement record, then projects later reads from it. `isCompactionMessage` is now exported for hosts that restore summary rows in their own views.
360
+
361
+ - 924df56: `edit` can carry several replacements for one file, committed together
362
+
363
+ A change that spans four places in a file is one change, and sending it as four
364
+ calls makes it four. Each call is a fresh chance to stop halfway, and the file
365
+ left after the third succeeded and the fourth did not is in a state nobody wrote
366
+ and nobody is looking at — a rename applied at two of its five call sites
367
+ compiles nowhere and reads like a bug in the code rather than an unfinished
368
+ edit.
369
+
370
+ `edits` takes a list of `{old_string, new_string}` for one `path`:
371
+
372
+ ```json
373
+ {
374
+ "path": "src/user.ts",
375
+ "edits": [
376
+ { "old_string": "function getUser(", "new_string": "function loadUser(" },
377
+ { "old_string": "getUser(id)", "new_string": "loadUser(id)" }
378
+ ]
379
+ }
380
+ ```
381
+
382
+ Every entry is applied in memory, in order, against the content the entries
383
+ before it left — so a later one can target text an earlier one produced. The
384
+ file is written once, at the end, through the same atomic writer. If any entry
385
+ does not apply — not found, ambiguous, or a no-op — nothing is written at all
386
+ and the error names the entry by index, because by the time a later one fails
387
+ the string it wanted may have been consumed by an earlier one, and "not found"
388
+ alone sends the model to re-check the wrong hunk.
389
+
390
+ A call carrying both an `edits` list and a top-level `old_string` is refused
391
+ rather than resolved. That is two intentions in one object, and any precedence
392
+ would be a guess about which was meant, silently dropping an edit somebody
393
+ believes was made.
394
+
395
+ The guarantee is per file: `edits` names one `path`. Atomicity across several
396
+ files is not something this tool can enforce, so it is not offered.
397
+
398
+ Two fields became optional in the input type — the top-level `replace_all` and
399
+ each entry's — because `execute` takes the schema's output type and a defaulted
400
+ field is required of every hand-built call, including batch calls where the
401
+ top-level flag means nothing. The default is applied during normalization, so
402
+ behaviour is unchanged. `new_string` also left the model schema's `required`
403
+ list, the same trade `old_string` made when line insertion was added: which
404
+ fields a shape needs is decided by refinements that name what is missing.
405
+
406
+ - 94d3306: Add the chain-aware `reasoningEffortLevelsFor(model, thinking)` provider capability while retaining `effortLevelsFor` as a deprecated compatibility member. The four capability states now distinguish a driver with no menu, an unknown model, an explicitly unsupported model, and an exact selectable set; fallback chains expose only levels every reachable member accepts.
407
+
408
+ The TUI adds session-scoped `/effort [level|default]`, sends the selection to later main-query turns, and resets it atomically when a provider/model replacement succeeds. Failed or cancelled replacements preserve the current selection.
409
+
410
+ OpenAI publishes exact known-model menus and keeps unknown compatible-endpoint models unknown. DeepSeek explicitly publishes no supported levels. Anthropic now refuses unsupported effort levels before transport instead of silently dropping them; callers upgrading Anthropic must choose a level returned by `reasoningEffortLevelsFor()` or omit `effort` to retain the provider default.
411
+
412
+ - 45d7014: Export `isWorkingMemoryMessage` so hosts can preserve the kernel's state-bearing artifact ledger across fresh runs without copying its private sentinel or persisting the per-run system prompt floor.
413
+ - 99127d8: Expose unsupported document inputs through the public `capability_warning` run event before provider settlement. Consumers handling that event must accept the new `documents` capability value.
414
+
415
+ Render provider capability warnings in the interactive transcript, and pause already-queued follow-ups after a failed or abnormally stopped human turn until the operator submits a continuation or successfully changes provider/model.
416
+
417
+ - 7a45aa4: Add a Linux sandbox tier that actually confines the filesystem.
418
+
419
+ Until now the strongest tier a Linux host could get was `linux-namespace`, and `isolation.ts` has always said what that is worth: `{ filesystem: false, network: true, process: true }`. It unshares a mount namespace and never remounts, so the child still sees — and can write to — the whole host filesystem. `read`, `edit` and the code-navigation tools are path-contained by a shared helper, but a model-issued shell command is not, and no OS boundary stood behind it.
420
+
421
+ `linux-bwrap` is the tier that remounts. It builds a fresh mount table holding the sandbox root read-write, the system paths a binary needs read-only, a private `/proc`, `/dev` and `/tmp`, and nothing else. A host path is not unreadable, it is **absent** — `ENOENT`, not `EACCES` — which is the difference between a boundary and a permission bit. `--unshare-all` supplies the network and process controls in the same call, so all three rows of the tier's isolation report come from one spawn.
422
+
423
+ Detection prefers it and probes it the way the existing tier is probed: by running the real confinement, not by asking the binary its version. A host with `bwrap` present but unprivileged user namespaces disabled falls through to the weaker tier rather than claiming a control it cannot deliver — the rule `assertIsolation` already enforces.
424
+
425
+ The interpreter's own prefix is bound read-only, because a Node installed outside the distribution's packages is otherwise not there at all, and the failure reads as a broken command rather than as the sandbox working.
426
+
427
+ `SANDBOX_ENVIRONMENTS` is now exported: the tier list was spelled out by hand in a doctor test, which broke on the first tier added after it was written.
428
+
429
+ Nothing changes on macOS, where `macos-seatbelt` already reported `filesystem: true`, or on hosts without `bwrap`.
430
+
431
+ - 79faa99: Add a host-owned live project-instruction context to the SDK. Queries and all
432
+ agent front doors can rebuild a retained snapshot before the first provider
433
+ request, observe completed top-level and nested registry executions, and
434
+ durably replace that snapshot after a complete tool batch without creating a
435
+ human continuation. Callbacks receive the run cancellation signal and accepted
436
+ message prefix; each returned snapshot is committed before the next observation
437
+ begins, so cancellation retains accepted policy state while rejecting an
438
+ unfinished suffix. Project-instruction messages carry bounded canonical
439
+ project-relative `AGENTS.md` provenance and survive compaction.
440
+
441
+ BREAKING: the CLI now represents repository instructions as scoped, retained
442
+ conversation context instead of a frozen system-prompt block. Hosts that inspect
443
+ raw provider messages or persisted session history must handle the
444
+ `project-instructions` user-message source. This lets nested instructions take
445
+ effect during the session and lets reconstruction re-read current disk content
446
+ instead of replaying stale policy prose.
447
+
448
+ - 8de3582: Allow `PluginLifecycleManager.install()` to admit manifest-declared skills when the manager owns a `SkillRegistry`, so the supported `install → enable` lifecycle reaches the model without hosts fabricating registry records. `loadPluginManifest()` now accepts an optional, fail-closed `PluginEnablementCapabilities` argument for hosts that call the loader directly.
449
+ - 487ed4e: Repair provider-invalid tool history chronologically before the first model
450
+ call. Abandoned calls receive an explicit unknown-outcome error result while
451
+ checkpoint calls still owned by approval or crash recovery retain their exact
452
+ assistant state and execute only through that authority path. The SDK adds the
453
+ public `repairToolMessageHistory` projection and `message_history_repaired`
454
+ `RunEvent`; CLI transcripts surface the measured repair without exposing tool
455
+ content.
456
+ - c933952: Return exact verifier token usage from `compactNow` and `compactRegion`. Every non-null `CompactionResult` now includes `usage`; an all-zero record means the pass made no verifier request. Hosts that account for provider work should include this record in their own ledger.
457
+
458
+ After `/compact`, remove the old context-fill gauge only after the replacement conversation has been durably published. A pending or failed replacement keeps the old transcript and measurement; a successful replacement remains unmeasured until the next model request reports the new context size.
459
+
460
+ - fd280c0: Make the first structured-memory search after process startup see records that
461
+ were already persisted on disk.
462
+
463
+ `buildMemoryTools(store)` is a new store-authoritative composition whose
464
+ `search_memory` tool awaits the store's asynchronous `list()` boundary. This is
465
+ the default for lazy and disk-backed stores. The existing
466
+ `buildMemoryTools(store, index)` form remains index-authoritative and performs
467
+ no store read, preserving custom pre-populated or independently managed search
468
+ indexes.
469
+
470
+ The CLI now uses the store-authoritative form for both its main and delegated
471
+ agent registries, so a fresh session can recall prior run memories without an
472
+ unrelated read or write first warming the in-memory index.
473
+
474
+ - ee4fd1d: Persist provider-native reasoning state with the exact provider, model, and fallback-chain member that produced it. Same-route sessions now replay native reasoning after restart, `/resume`, and `/fork`; a model, provider, or member switch keeps portable assistant/tool history without sending foreign native reasoning metadata.
475
+
476
+ `@namzu/sdk` adds `ProviderRoute`, `AssistantMessageSource`, optional assistant source/replay fields, and the provider request/stream/response plumbing. Fallback and forced-final turns now attribute provenance and cost to the member that actually answered.
477
+
478
+ `@namzu/cli` preserves and validates the additive assistant source shape in stateless and durable history.
479
+
480
+ **What breaks in the drivers:** hand-built assistant reasoning and histories written by earlier versions do not carry a validated route-bound replay envelope, so they are no longer emitted as native `reasoning_content` or signed thinking. Their portable assistant text and tool exchanges remain available, but an upstream that requires native metadata for an old tool continuation may refuse that request; compact or start a fresh conversation before continuing such legacy history. Preserve the complete assistant message returned by new runs, including `source.replayState`. Direct callers of the exported DeepSeek `toDeepSeekMessages` converter must also pass the target `ProviderRoute` as its second argument.
481
+
482
+ - 143b8d9: Add session-owned durable completion goals, direct `/goal` operator control,
483
+ and race-fenced automatic continuation.
484
+
485
+ SDK consumers can persist, inspect, and transition a `SessionGoal` through
486
+ tenant-authorized in-memory or disk stores with exact revision checks. CLI
487
+ operators can create, inspect, edit, pause, resume, and clear the goal belonging
488
+ to the active durable conversation without sending those commands to the model.
489
+
490
+ The SDK also exposes atomic admitted-round accounting, finite caps,
491
+ process-local activation, host provenance for goal-sourced user messages, and
492
+ run-scoped goal tools. The CLI drives those primitives only at a durable idle
493
+ boundary, keeps human prompts ahead across admission races, withholds goal tools
494
+ from ordinary and child runs, disarms on abnormal or non-durable settlement,
495
+ and preserves automatic-turn attribution through resume and verified export.
496
+
497
+ - bb8cb05: Export the 45 types that exported signatures already named.
498
+
499
+ Each is the parameter or the result of a function that was already public, and none of them was reachable. A consumer could call `createLogger` and had no name for its options or its return; could call `compactRegion`, `runBidi`, the handoff helpers, the replay helpers, and had to inline every shape or reach for `any`. The package's vocabulary stopped at the function name.
500
+
501
+ Additive: the original 28 function-signature types plus constructor contracts including `AgentManagerDeps`, `TopicManagerDeps`, `ProjectManagerDeps`, `DiskTopicStateStoreConfig`, `DiskMessageFeedbackStoreConfig`, `MessageExistenceCheck`, `EnvCredentialProviderOptions`, `FileLockManagerConfig`, `GitWorktreeDriverConfig`, `CapacityDimension`, `HandoffLockRejectedReason`, `SessionSummaryMaterializerDeps`, `ArchivalManagerDeps`, `ArchiveBackendRef`, `DiskArchiveBackendConfig`, `SlidingWindowManagerConfig`, and `SubprocessComputerUseHostOptions`.
502
+
503
+ Nothing changes for existing code.
504
+
505
+ A CI step keeps it that way. `check-signature-types-exported.mjs` resolves exported function signatures and public class constructors, then fails when a type they name is declared in the package and not exported. The constructor branch has its own self-check so removing it cannot turn the gate silently green.
506
+
507
+ - c6ebb31: Add `/export [path]` to write a no-clobber Markdown conversation from durable CLI turn bindings and event-head-verified SDK run evidence. Legacy conversations and unresolved fork prefixes refuse instead of producing a partial file.
508
+
509
+ Add `ReadRunEventsOptions.integrity`. The default `tolerant` mode retains the existing damaged-line skip behavior; `strict` refuses torn, malformed, or discontinuously numbered event logs for callers that need a completeness proof.
510
+
511
+ ### Patch Changes
512
+
513
+ - 0e678a8: Keep host-triggered compaction state intact when a conversation starts a fresh run.
514
+
515
+ `compactNow` and `compactRegion` now extract real structured state from the messages they replace instead of producing an empty summary when model verification is disabled. Their summaries are retained because no run-scoped state manager exists between queries to reproduce them.
516
+
517
+ Fresh `query()` calls restore compacted-context summaries and working-memory artifact ledgers after rebuilding the current system prompt, while continuing to discard arbitrary historical system messages. An inherited compaction summary remains pinned through later automatic compaction, including context-overflow retries and the final persisted run-message snapshot.
518
+
519
+ - 753b037: Make disk-backed memory reads and mutations fail closed on incomplete,
520
+ malformed, unsafe, or uncommitted durable state.
521
+
522
+ Indexed content is now validated before it is returned or updated. Missing
523
+ content, invalid JSON, newer schemas, mismatched IDs, invalid field shapes,
524
+ unsafe filename IDs, and content directories resolving outside the memory
525
+ root refuse the operation instead of becoming a false not-found or success.
526
+
527
+ Disk-memory operations sharing one canonical index path are serialized within
528
+ the SDK process and reload the authoritative index before acting. Concurrent
529
+ CLI parent/delegate saves no longer lose all but the last record, warmed
530
+ readers observe sibling writes, and create/update/delete publish live state
531
+ only after their required durable operations succeed. Cross-process writers
532
+ still require a single owner or storage-level conditional publication.
533
+
534
+ - ade6c85: Allow host-triggered whole-history compaction to establish a retained summary floor for user/assistant-only conversations. Compaction now preserves every retained message together with the user boundary and complete tool exchange needed for a provider-valid turn, and manual whole-history and region passes decline before provider work when those survivors leave nothing to shed.
535
+ - 5581dde: Probe local sandbox wrappers through the same direct child-process and stdout boundary used for execution, then pin the verified canonical absolute wrapper path. Hosts where a wrapper is reachable only through a shell now fall back honestly, and per-run `PATH` overrides can no longer replace a verified isolation wrapper.
536
+ - fd6683b: Preserve the non-secret Windows core environment when `LocalSandboxProvider` launches a child. Windows environment names now merge case-insensitively, so session and per-call overrides replace ambient variants deterministically, while POSIX sandbox and MCP inheritance policies remain unchanged.
537
+ - 43620d9: Publish `token_usage_updated` immediately after every automatic context edit, before the next provider request. The event keeps cumulative usage and cost intact while reporting the estimated post-compaction context and window provenance. An insufficient stale-tool-result clear is now staged until summary verification succeeds, so cancellation or verification failure cannot leave half of a compaction visible.
538
+ - 63e8148: Refuse an unreadable or structurally invalid persistent-memory index instead
539
+ of treating it as an empty store.
540
+
541
+ `DiskMemoryStore` now validates every persisted index entry before publishing
542
+ it into the live projection. Invalid JSON, newer schema data, unrecognized or
543
+ duplicate memory IDs, wrong field types, unknown statuses and invalid
544
+ timestamps leave the original index byte-identical and make the operation
545
+ fail. Once the durable file is repaired, the same store instance may retry.
546
+
547
+ The CLI's memory tools inherit the fail-closed boundary, so `save_memory`
548
+ cannot overwrite an index the current SDK could not safely understand.
549
+
550
+ - c8753a7: Propagate run cancellation through every plugin hook and preserve cancellation
551
+ when it occurs before the iteration loop. Hook code now receives a signal that
552
+ combines the run lifetime with its hook deadline, and a hook that ignores that
553
+ signal can no longer keep the run waiting.
554
+
555
+ Make CLI session shutdown cancel and settle in-flight sends, manual compaction,
556
+ and durable resumes before external tool servers are closed. Calls made after
557
+ session close now refuse before starting provider work.
558
+
3
559
  ## 30.2.0
4
560
 
5
561
  ### Minor Changes
package/README.md CHANGED
@@ -6,7 +6,7 @@ description: >-
6
6
  with an identity, a budget, a permission boundary and a durable record.
7
7
  Renders no UI, hosts no service, and has no preferred model vendor.
8
8
  tags: [readme, package, sdk, agent-kernel]
9
- timestamp: 2026-08-17T00:00:00Z
9
+ timestamp: 2026-08-21T00:00:00Z
10
10
  status: active
11
11
  diataxis: reference
12
12
  -->
@@ -118,11 +118,52 @@ unchanged.
118
118
  |---|---|
119
119
  | **Boundary** | tool calls run confined; a permission gate decides before, not after |
120
120
  | **Budget** | tokens, money, wall clock and iterations, enforced rather than hoped for |
121
- | **Identity** | tenant → project → thread → session → run, on every record and span |
121
+ | **Identity** | tenant → project → topic → session → run, on every record and span |
122
122
  | **Durability** | checkpoints a run resumes from, and a record that outlives the process |
123
123
  | **Compaction** | a conversation about to overflow is shrunk without being corrupted |
124
124
  | **Observability** | OpenTelemetry spans and metrics, and a log pipeline you own the sink for |
125
125
 
126
+ Before a provider receives carried history, the kernel validates tool-call
127
+ chronology. Orphaned and displaced results are removed, abandoned calls receive
128
+ an explicit unknown-outcome error result, and duplicate call ids fail closed.
129
+ Durable approval or crash-resume authority is resolved first so an owned call
130
+ is completed exactly once. Hosts receive `message_history_repaired` with source
131
+ and counts before the model call; conversation and tool content stay out of the
132
+ event.
133
+
134
+ Stored image and document references are materialized under the run's caller
135
+ signal before provider work starts. A pre-cancelled run performs no attachment
136
+ store I/O; cancellation also settles the run when a custom or remote store
137
+ ignores the signal, while retaining the unresolved references in its durable
138
+ message record. `AttachmentStore.get` receives an optional
139
+ `AttachmentOperationOptions` so implementations can stop their own I/O. The
140
+ caller keeps ownership of its controller, and a late store result is never
141
+ published into a cancelled run. `resumeRun` carries its already-selected
142
+ checkpoint snapshot into the same boundary, so cancellation neither rereads a
143
+ non-cooperative checkpoint backend nor replaces prior history, usage, or a new
144
+ queued reference with an incomplete snapshot. The selected checkpoint also
145
+ carries its durable trace parent into the cancelled run, preserving one
146
+ cross-process timeline without a second checkpoint read.
147
+
148
+ Hosts that discover scoped repository policy can supply a
149
+ `ProjectInstructionContext` to `query`, `runAgent`, `ReactiveAgent`, or
150
+ `SupervisorAgent`. Its first-request snapshot is structurally tagged and
151
+ retained; completed registry calls, including nested dispatch, can publish a
152
+ replacement immediately after the complete tool-result batch. Each callback
153
+ receives the run signal and the exact accepted message prefix; each returned
154
+ snapshot is committed before the next observation starts, so cancellation can
155
+ discard an unfinished suffix without losing accepted policy state. This
156
+ channel does not create a human continuation, so a terminal tool or stop
157
+ predicate cannot strand the update. Canonical project-relative `AGENTS.md`
158
+ provenance survives compaction and lets a reconstructed host re-read disk
159
+ authority rather than trusting persisted policy text.
160
+
161
+ `TopicManager` is the lifecycle authority for the durable subject above a
162
+ session. Supply it to agent and handoff dependencies as `topicManager`; spawn
163
+ and handoff then share the same archived-topic gate. Hosts can distinguish
164
+ `TopicArchivedError`, `TopicNotEmptyError`, and `StaleTopicError` directly from
165
+ the package root, and each carries `details.topicId`.
166
+
126
167
  ## Documentation
127
168
 
128
169
  - [The kernel in depth](https://github.com/cogitave/namzu/blob/main/docs/sdk/architecture.md) — every subsystem, the design principles, the event protocol