@namzu/sdk 27.1.0 → 28.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 (1430) hide show
  1. package/CHANGELOG.md +1664 -0
  2. package/README.md +45 -42
  3. package/dist/advisory/executor.d.ts.map +1 -1
  4. package/dist/advisory/executor.js +14 -12
  5. package/dist/advisory/executor.js.map +1 -1
  6. package/dist/advisory/registry.d.ts +2 -2
  7. package/dist/advisory/registry.d.ts.map +1 -1
  8. package/dist/advisory/registry.js +2 -2
  9. package/dist/advisory/registry.js.map +1 -1
  10. package/dist/agents/AbstractAgent.d.ts +44 -2
  11. package/dist/agents/AbstractAgent.d.ts.map +1 -1
  12. package/dist/agents/AbstractAgent.js +62 -13
  13. package/dist/agents/AbstractAgent.js.map +1 -1
  14. package/dist/agents/PipelineAgent.d.ts +29 -1
  15. package/dist/agents/PipelineAgent.d.ts.map +1 -1
  16. package/dist/agents/PipelineAgent.js +33 -4
  17. package/dist/agents/PipelineAgent.js.map +1 -1
  18. package/dist/agents/ReactiveAgent.d.ts +2 -1
  19. package/dist/agents/ReactiveAgent.d.ts.map +1 -1
  20. package/dist/agents/ReactiveAgent.js +15 -5
  21. package/dist/agents/ReactiveAgent.js.map +1 -1
  22. package/dist/agents/RouterAgent.d.ts +2 -1
  23. package/dist/agents/RouterAgent.d.ts.map +1 -1
  24. package/dist/agents/RouterAgent.js +21 -13
  25. package/dist/agents/RouterAgent.js.map +1 -1
  26. package/dist/agents/SupervisorAgent.d.ts +3 -2
  27. package/dist/agents/SupervisorAgent.d.ts.map +1 -1
  28. package/dist/agents/SupervisorAgent.js +29 -14
  29. package/dist/agents/SupervisorAgent.js.map +1 -1
  30. package/dist/agents/handle.d.ts +85 -0
  31. package/dist/agents/handle.d.ts.map +1 -0
  32. package/dist/agents/handle.js +79 -0
  33. package/dist/agents/handle.js.map +1 -0
  34. package/dist/agents/runAgent.d.ts +10 -5
  35. package/dist/agents/runAgent.d.ts.map +1 -1
  36. package/dist/agents/runAgent.js +3 -2
  37. package/dist/agents/runAgent.js.map +1 -1
  38. package/dist/{verification → authorization}/gate.d.ts +4 -4
  39. package/dist/authorization/gate.d.ts.map +1 -0
  40. package/dist/{verification → authorization}/gate.js +31 -24
  41. package/dist/authorization/gate.js.map +1 -0
  42. package/dist/authorization/index.d.ts +6 -0
  43. package/dist/authorization/index.d.ts.map +1 -0
  44. package/dist/authorization/index.js +14 -0
  45. package/dist/authorization/index.js.map +1 -0
  46. package/dist/authorization/permission-presets.d.ts +119 -0
  47. package/dist/authorization/permission-presets.d.ts.map +1 -0
  48. package/dist/authorization/permission-presets.js +137 -0
  49. package/dist/authorization/permission-presets.js.map +1 -0
  50. package/dist/{verification → authorization}/presets.d.ts +3 -3
  51. package/dist/authorization/presets.d.ts.map +1 -0
  52. package/dist/{verification → authorization}/presets.js +12 -0
  53. package/dist/authorization/presets.js.map +1 -0
  54. package/dist/authorization/rules.d.ts +4 -0
  55. package/dist/authorization/rules.d.ts.map +1 -0
  56. package/dist/{verification → authorization}/rules.js +14 -1
  57. package/dist/authorization/rules.js.map +1 -0
  58. package/dist/bridge/a2a/client.d.ts +107 -0
  59. package/dist/bridge/a2a/client.d.ts.map +1 -0
  60. package/dist/bridge/a2a/client.js +275 -0
  61. package/dist/bridge/a2a/client.js.map +1 -0
  62. package/dist/bridge/a2a/mapper.d.ts.map +1 -1
  63. package/dist/bridge/a2a/mapper.js +16 -0
  64. package/dist/bridge/a2a/mapper.js.map +1 -1
  65. package/dist/bridge/acp/filesystem.d.ts +33 -0
  66. package/dist/bridge/acp/filesystem.d.ts.map +1 -0
  67. package/dist/bridge/acp/filesystem.js +30 -0
  68. package/dist/bridge/acp/filesystem.js.map +1 -0
  69. package/dist/bridge/acp/index.d.ts +8 -0
  70. package/dist/bridge/acp/index.d.ts.map +1 -0
  71. package/dist/bridge/acp/index.js +5 -0
  72. package/dist/bridge/acp/index.js.map +1 -0
  73. package/dist/bridge/acp/permission.d.ts +51 -0
  74. package/dist/bridge/acp/permission.d.ts.map +1 -0
  75. package/dist/bridge/acp/permission.js +37 -0
  76. package/dist/bridge/acp/permission.js.map +1 -0
  77. package/dist/bridge/acp/server.d.ts +163 -0
  78. package/dist/bridge/acp/server.d.ts.map +1 -0
  79. package/dist/bridge/acp/server.js +312 -0
  80. package/dist/bridge/acp/server.js.map +1 -0
  81. package/dist/bridge/acp/update.d.ts +13 -0
  82. package/dist/bridge/acp/update.d.ts.map +1 -0
  83. package/dist/bridge/acp/update.js +94 -0
  84. package/dist/bridge/acp/update.js.map +1 -0
  85. package/dist/bridge/mcp/connector/adapter.d.ts +2 -0
  86. package/dist/bridge/mcp/connector/adapter.d.ts.map +1 -1
  87. package/dist/bridge/mcp/connector/adapter.js +7 -3
  88. package/dist/bridge/mcp/connector/adapter.js.map +1 -1
  89. package/dist/bridge/sse/mapper.d.ts.map +1 -1
  90. package/dist/bridge/sse/mapper.js +27 -0
  91. package/dist/bridge/sse/mapper.js.map +1 -1
  92. package/dist/bus/breaker.d.ts.map +1 -1
  93. package/dist/bus/breaker.js +15 -10
  94. package/dist/bus/breaker.js.map +1 -1
  95. package/dist/bus/index.d.ts.map +1 -1
  96. package/dist/bus/index.js +10 -8
  97. package/dist/bus/index.js.map +1 -1
  98. package/dist/bus/lock.d.ts.map +1 -1
  99. package/dist/bus/lock.js +36 -19
  100. package/dist/bus/lock.js.map +1 -1
  101. package/dist/bus/ownership.d.ts.map +1 -1
  102. package/dist/bus/ownership.js +17 -9
  103. package/dist/bus/ownership.js.map +1 -1
  104. package/dist/compaction/context-window.d.ts +18 -2
  105. package/dist/compaction/context-window.d.ts.map +1 -1
  106. package/dist/compaction/context-window.js +15 -1
  107. package/dist/compaction/context-window.js.map +1 -1
  108. package/dist/compaction/index.d.ts +3 -0
  109. package/dist/compaction/index.d.ts.map +1 -1
  110. package/dist/compaction/index.js +4 -0
  111. package/dist/compaction/index.js.map +1 -1
  112. package/dist/compaction/manual.d.ts +58 -0
  113. package/dist/compaction/manual.d.ts.map +1 -0
  114. package/dist/compaction/manual.js +104 -0
  115. package/dist/compaction/manual.js.map +1 -0
  116. package/dist/compaction/plan.d.ts +92 -0
  117. package/dist/compaction/plan.d.ts.map +1 -0
  118. package/dist/compaction/plan.js +149 -0
  119. package/dist/compaction/plan.js.map +1 -0
  120. package/dist/compaction/summary.d.ts +23 -0
  121. package/dist/compaction/summary.d.ts.map +1 -0
  122. package/dist/compaction/summary.js +27 -0
  123. package/dist/compaction/summary.js.map +1 -0
  124. package/dist/compaction/verifier.js +2 -2
  125. package/dist/compaction/verifier.js.map +1 -1
  126. package/dist/config/registry.d.ts +104 -0
  127. package/dist/config/registry.d.ts.map +1 -0
  128. package/dist/config/registry.js +105 -0
  129. package/dist/config/registry.js.map +1 -0
  130. package/dist/config/runtime.d.ts +99 -28
  131. package/dist/config/runtime.d.ts.map +1 -1
  132. package/dist/config/runtime.js +27 -0
  133. package/dist/config/runtime.js.map +1 -1
  134. package/dist/connector/BaseConnector.d.ts +1 -1
  135. package/dist/connector/BaseConnector.d.ts.map +1 -1
  136. package/dist/connector/BaseConnector.js +8 -3
  137. package/dist/connector/BaseConnector.js.map +1 -1
  138. package/dist/connector/builtins/http.d.ts +1 -1
  139. package/dist/connector/builtins/http.d.ts.map +1 -1
  140. package/dist/connector/builtins/http.js +11 -2
  141. package/dist/connector/builtins/http.js.map +1 -1
  142. package/dist/connector/builtins/webhook.d.ts +1 -1
  143. package/dist/connector/builtins/webhook.d.ts.map +1 -1
  144. package/dist/connector/builtins/webhook.js +5 -2
  145. package/dist/connector/builtins/webhook.js.map +1 -1
  146. package/dist/connector/index.d.ts +4 -15
  147. package/dist/connector/index.d.ts.map +1 -1
  148. package/dist/connector/index.js +12 -12
  149. package/dist/connector/index.js.map +1 -1
  150. package/dist/connector/mcp/client.d.ts.map +1 -1
  151. package/dist/connector/mcp/client.js +31 -20
  152. package/dist/connector/mcp/client.js.map +1 -1
  153. package/dist/connector/mcp/discovery.d.ts.map +1 -1
  154. package/dist/connector/mcp/discovery.js +31 -20
  155. package/dist/connector/mcp/discovery.js.map +1 -1
  156. package/dist/connector/mcp/http-sse.d.ts +2 -1
  157. package/dist/connector/mcp/http-sse.d.ts.map +1 -1
  158. package/dist/connector/mcp/http-sse.js +9 -6
  159. package/dist/connector/mcp/http-sse.js.map +1 -1
  160. package/dist/connector/mcp/index.d.ts +2 -3
  161. package/dist/connector/mcp/index.d.ts.map +1 -1
  162. package/dist/connector/mcp/index.js +5 -4
  163. package/dist/connector/mcp/index.js.map +1 -1
  164. package/dist/connector/mcp/reconnect.d.ts +123 -0
  165. package/dist/connector/mcp/reconnect.d.ts.map +1 -0
  166. package/dist/connector/mcp/reconnect.js +121 -0
  167. package/dist/connector/mcp/reconnect.js.map +1 -0
  168. package/dist/connector/mcp/server/index.d.ts +28 -0
  169. package/dist/connector/mcp/server/index.d.ts.map +1 -0
  170. package/dist/connector/mcp/server/index.js +27 -0
  171. package/dist/connector/mcp/server/index.js.map +1 -0
  172. package/dist/connector/mcp/{server-stdio.d.ts → server/server-stdio.d.ts} +3 -2
  173. package/dist/connector/mcp/server/server-stdio.d.ts.map +1 -0
  174. package/dist/connector/mcp/{server-stdio.js → server/server-stdio.js} +4 -3
  175. package/dist/connector/mcp/server/server-stdio.js.map +1 -0
  176. package/dist/connector/mcp/{server.d.ts → server/server.d.ts} +5 -4
  177. package/dist/connector/mcp/server/server.d.ts.map +1 -0
  178. package/dist/connector/mcp/{server.js → server/server.js} +14 -9
  179. package/dist/connector/mcp/server/server.js.map +1 -0
  180. package/dist/connector/mcp/stdio.d.ts +2 -1
  181. package/dist/connector/mcp/stdio.d.ts.map +1 -1
  182. package/dist/connector/mcp/stdio.js +15 -7
  183. package/dist/connector/mcp/stdio.js.map +1 -1
  184. package/dist/connector/mcp/streamable-http.d.ts +2 -1
  185. package/dist/connector/mcp/streamable-http.d.ts.map +1 -1
  186. package/dist/connector/mcp/streamable-http.js +5 -4
  187. package/dist/connector/mcp/streamable-http.js.map +1 -1
  188. package/dist/{bridge/tools/connector → connector/tools}/adapter.d.ts +4 -4
  189. package/dist/connector/tools/adapter.d.ts.map +1 -0
  190. package/dist/{bridge/tools/connector → connector/tools}/adapter.js +1 -1
  191. package/dist/connector/tools/adapter.js.map +1 -0
  192. package/dist/{bridge/tools/connector → connector/tools}/definitions.d.ts +2 -2
  193. package/dist/connector/tools/definitions.d.ts.map +1 -0
  194. package/dist/{bridge/tools/connector → connector/tools}/definitions.js +2 -2
  195. package/dist/connector/tools/definitions.js.map +1 -0
  196. package/dist/connector/tools/index.d.ts.map +1 -0
  197. package/dist/connector/tools/index.js.map +1 -0
  198. package/dist/{bridge/tools/connector → connector/tools}/router.d.ts +4 -2
  199. package/dist/connector/tools/router.d.ts.map +1 -0
  200. package/dist/{bridge/tools/connector → connector/tools}/router.js +14 -7
  201. package/dist/connector/tools/router.js.map +1 -0
  202. package/dist/connector/web/guarded-fetch.d.ts +60 -0
  203. package/dist/connector/web/guarded-fetch.d.ts.map +1 -0
  204. package/dist/connector/web/guarded-fetch.js +233 -0
  205. package/dist/connector/web/guarded-fetch.js.map +1 -0
  206. package/dist/connector/web/index.d.ts +5 -0
  207. package/dist/connector/web/index.d.ts.map +1 -0
  208. package/dist/connector/web/index.js +7 -0
  209. package/dist/connector/web/index.js.map +1 -0
  210. package/dist/connector/web/types.d.ts +87 -0
  211. package/dist/connector/web/types.d.ts.map +1 -0
  212. package/dist/connector/web/types.js +25 -0
  213. package/dist/connector/web/types.js.map +1 -0
  214. package/dist/constants/acp/index.d.ts +97 -0
  215. package/dist/constants/acp/index.d.ts.map +1 -0
  216. package/dist/constants/acp/index.js +96 -0
  217. package/dist/constants/acp/index.js.map +1 -0
  218. package/dist/constants/authorization/index.d.ts.map +1 -0
  219. package/dist/constants/authorization/index.js.map +1 -0
  220. package/dist/constants/credential-env-keys.d.ts +36 -0
  221. package/dist/constants/credential-env-keys.d.ts.map +1 -0
  222. package/dist/constants/credential-env-keys.js +62 -0
  223. package/dist/constants/credential-env-keys.js.map +1 -0
  224. package/dist/constants/index.d.ts +3 -1
  225. package/dist/constants/index.d.ts.map +1 -1
  226. package/dist/constants/index.js +3 -1
  227. package/dist/constants/index.js.map +1 -1
  228. package/dist/constants/secret-patterns.d.ts +78 -0
  229. package/dist/constants/secret-patterns.d.ts.map +1 -0
  230. package/dist/constants/secret-patterns.js +99 -0
  231. package/dist/constants/secret-patterns.js.map +1 -0
  232. package/dist/constants/telemetry/index.d.ts +42 -0
  233. package/dist/constants/telemetry/index.d.ts.map +1 -1
  234. package/dist/constants/telemetry/index.js +87 -0
  235. package/dist/constants/telemetry/index.js.map +1 -1
  236. package/dist/contracts/a2a.d.ts +54 -54
  237. package/dist/contracts/api.d.ts +12 -1
  238. package/dist/contracts/api.d.ts.map +1 -1
  239. package/dist/contracts/schemas.d.ts +12 -12
  240. package/dist/deprecated-aliases.d.ts +80 -0
  241. package/dist/deprecated-aliases.d.ts.map +1 -0
  242. package/dist/deprecated-aliases.js +60 -0
  243. package/dist/deprecated-aliases.js.map +1 -0
  244. package/dist/eval/judge.js +2 -2
  245. package/dist/eval/judge.js.map +1 -1
  246. package/dist/execution/base.d.ts +1 -1
  247. package/dist/execution/base.d.ts.map +1 -1
  248. package/dist/execution/base.js +18 -7
  249. package/dist/execution/base.js.map +1 -1
  250. package/dist/execution/code-runtime/types.d.ts +114 -0
  251. package/dist/execution/code-runtime/types.d.ts.map +1 -0
  252. package/dist/execution/code-runtime/types.js +40 -0
  253. package/dist/execution/code-runtime/types.js.map +1 -0
  254. package/dist/execution/code-runtime/worker.d.ts +6 -0
  255. package/dist/execution/code-runtime/worker.d.ts.map +1 -0
  256. package/dist/execution/code-runtime/worker.js +248 -0
  257. package/dist/execution/code-runtime/worker.js.map +1 -0
  258. package/dist/{connector/execution → execution}/factory.d.ts +3 -3
  259. package/dist/execution/factory.d.ts.map +1 -0
  260. package/dist/{connector/execution → execution}/factory.js +1 -1
  261. package/dist/execution/factory.js.map +1 -0
  262. package/dist/{connector/execution → execution}/hybrid.d.ts +5 -3
  263. package/dist/execution/hybrid.d.ts.map +1 -0
  264. package/dist/{connector/execution → execution}/hybrid.js +10 -4
  265. package/dist/execution/hybrid.js.map +1 -0
  266. package/dist/execution/index.d.ts +23 -0
  267. package/dist/execution/index.d.ts.map +1 -1
  268. package/dist/execution/index.js +21 -0
  269. package/dist/execution/index.js.map +1 -1
  270. package/dist/execution/local.d.ts +2 -0
  271. package/dist/execution/local.d.ts.map +1 -1
  272. package/dist/execution/local.js +2 -2
  273. package/dist/execution/local.js.map +1 -1
  274. package/dist/{connector/execution → execution}/remote.d.ts +4 -2
  275. package/dist/execution/remote.d.ts.map +1 -0
  276. package/dist/{connector/execution → execution}/remote.js +12 -5
  277. package/dist/execution/remote.js.map +1 -0
  278. package/dist/index.d.ts +2 -0
  279. package/dist/index.d.ts.map +1 -1
  280. package/dist/index.js +4 -0
  281. package/dist/index.js.map +1 -1
  282. package/dist/invariants/index.d.ts +111 -0
  283. package/dist/invariants/index.d.ts.map +1 -0
  284. package/dist/invariants/index.js +138 -0
  285. package/dist/invariants/index.js.map +1 -0
  286. package/dist/manager/agent/lifecycle.d.ts +29 -7
  287. package/dist/manager/agent/lifecycle.d.ts.map +1 -1
  288. package/dist/manager/agent/lifecycle.js +140 -50
  289. package/dist/manager/agent/lifecycle.js.map +1 -1
  290. package/dist/manager/connector/environment.d.ts +2 -0
  291. package/dist/manager/connector/environment.d.ts.map +1 -1
  292. package/dist/manager/connector/environment.js +20 -9
  293. package/dist/manager/connector/environment.js.map +1 -1
  294. package/dist/manager/connector/lifecycle.d.ts +10 -0
  295. package/dist/manager/connector/lifecycle.d.ts.map +1 -1
  296. package/dist/manager/connector/lifecycle.js +21 -11
  297. package/dist/manager/connector/lifecycle.js.map +1 -1
  298. package/dist/manager/connector/tenant.d.ts +9 -0
  299. package/dist/manager/connector/tenant.d.ts.map +1 -1
  300. package/dist/manager/connector/tenant.js +24 -10
  301. package/dist/manager/connector/tenant.js.map +1 -1
  302. package/dist/manager/index.d.ts +6 -2
  303. package/dist/manager/index.d.ts.map +1 -1
  304. package/dist/manager/index.js +7 -1
  305. package/dist/manager/index.js.map +1 -1
  306. package/dist/manager/project/lifecycle.d.ts +1 -1
  307. package/dist/manager/project/lifecycle.js +1 -1
  308. package/dist/manager/run/emergency.d.ts.map +1 -1
  309. package/dist/manager/run/emergency.js +9 -7
  310. package/dist/manager/run/emergency.js.map +1 -1
  311. package/dist/manager/run/persistence.d.ts +46 -4
  312. package/dist/manager/run/persistence.d.ts.map +1 -1
  313. package/dist/manager/run/persistence.js +102 -7
  314. package/dist/manager/run/persistence.js.map +1 -1
  315. package/dist/manager/topic/lifecycle.d.ts +123 -0
  316. package/dist/manager/topic/lifecycle.d.ts.map +1 -0
  317. package/dist/manager/{thread → topic}/lifecycle.js +79 -61
  318. package/dist/manager/topic/lifecycle.js.map +1 -0
  319. package/dist/manager/topic/objective.d.ts +77 -0
  320. package/dist/manager/topic/objective.d.ts.map +1 -0
  321. package/dist/manager/topic/objective.js +133 -0
  322. package/dist/manager/topic/objective.js.map +1 -0
  323. package/dist/model-router/task-router.d.ts.map +1 -0
  324. package/dist/model-router/task-router.js.map +1 -0
  325. package/dist/persona/assembler.d.ts +1 -1
  326. package/dist/persona/assembler.d.ts.map +1 -1
  327. package/dist/persona/assembler.js +14 -2
  328. package/dist/persona/assembler.js.map +1 -1
  329. package/dist/plugin/lifecycle.d.ts +24 -0
  330. package/dist/plugin/lifecycle.d.ts.map +1 -1
  331. package/dist/plugin/lifecycle.js +112 -20
  332. package/dist/plugin/lifecycle.js.map +1 -1
  333. package/dist/plugin/loader.d.ts +17 -2
  334. package/dist/plugin/loader.d.ts.map +1 -1
  335. package/dist/plugin/loader.js +46 -26
  336. package/dist/plugin/loader.js.map +1 -1
  337. package/dist/probe/index.d.ts +1 -0
  338. package/dist/probe/index.d.ts.map +1 -1
  339. package/dist/probe/registry.d.ts +34 -1
  340. package/dist/probe/registry.d.ts.map +1 -1
  341. package/dist/probe/registry.js +5 -4
  342. package/dist/probe/registry.js.map +1 -1
  343. package/dist/process/kill-tree.d.ts +40 -0
  344. package/dist/process/kill-tree.d.ts.map +1 -0
  345. package/dist/process/kill-tree.js +54 -0
  346. package/dist/process/kill-tree.js.map +1 -0
  347. package/dist/prompt/contributions.d.ts +138 -0
  348. package/dist/prompt/contributions.d.ts.map +1 -0
  349. package/dist/prompt/contributions.js +78 -0
  350. package/dist/prompt/contributions.js.map +1 -0
  351. package/dist/prompt/index.d.ts +3 -0
  352. package/dist/prompt/index.d.ts.map +1 -0
  353. package/dist/prompt/index.js +6 -0
  354. package/dist/prompt/index.js.map +1 -0
  355. package/dist/provider/attribution.d.ts +45 -0
  356. package/dist/provider/attribution.d.ts.map +1 -0
  357. package/dist/provider/attribution.js +23 -0
  358. package/dist/provider/attribution.js.map +1 -0
  359. package/dist/provider/{collect.d.ts → collect-chat-completion.d.ts} +3 -3
  360. package/dist/provider/collect-chat-completion.d.ts.map +1 -0
  361. package/dist/provider/{collect.js → collect-chat-completion.js} +3 -3
  362. package/dist/provider/collect-chat-completion.js.map +1 -0
  363. package/dist/provider/conformance.d.ts +93 -0
  364. package/dist/provider/conformance.d.ts.map +1 -0
  365. package/dist/provider/conformance.js +124 -0
  366. package/dist/provider/conformance.js.map +1 -0
  367. package/dist/provider/errors.d.ts +29 -0
  368. package/dist/provider/errors.d.ts.map +1 -1
  369. package/dist/provider/errors.js +27 -10
  370. package/dist/provider/errors.js.map +1 -1
  371. package/dist/provider/fallback.d.ts +1 -1
  372. package/dist/provider/fallback.d.ts.map +1 -1
  373. package/dist/provider/fallback.js +27 -9
  374. package/dist/provider/fallback.js.map +1 -1
  375. package/dist/provider/idle-timeout.d.ts +47 -0
  376. package/dist/provider/idle-timeout.d.ts.map +1 -0
  377. package/dist/provider/idle-timeout.js +61 -0
  378. package/dist/provider/idle-timeout.js.map +1 -0
  379. package/dist/provider/instrumentation.d.ts +3 -2
  380. package/dist/provider/instrumentation.d.ts.map +1 -1
  381. package/dist/provider/instrumentation.js.map +1 -1
  382. package/dist/provider/retry.d.ts.map +1 -1
  383. package/dist/provider/retry.js +58 -21
  384. package/dist/provider/retry.js.map +1 -1
  385. package/dist/public-runtime.d.ts +77 -14
  386. package/dist/public-runtime.d.ts.map +1 -1
  387. package/dist/public-runtime.js +168 -16
  388. package/dist/public-runtime.js.map +1 -1
  389. package/dist/public-tools.d.ts +8 -1
  390. package/dist/public-tools.d.ts.map +1 -1
  391. package/dist/public-tools.js +29 -1
  392. package/dist/public-tools.js.map +1 -1
  393. package/dist/public-types.d.ts +21 -4
  394. package/dist/public-types.d.ts.map +1 -1
  395. package/dist/rag/rag-tool.d.ts.map +1 -1
  396. package/dist/rag/rag-tool.js +4 -1
  397. package/dist/rag/rag-tool.js.map +1 -1
  398. package/dist/read-model/index.d.ts +5 -0
  399. package/dist/read-model/index.d.ts.map +1 -0
  400. package/dist/read-model/index.js +7 -0
  401. package/dist/read-model/index.js.map +1 -0
  402. package/dist/read-model/registry.d.ts +112 -0
  403. package/dist/read-model/registry.d.ts.map +1 -0
  404. package/dist/read-model/registry.js +105 -0
  405. package/dist/read-model/registry.js.map +1 -0
  406. package/dist/read-model/run-status.d.ts +43 -0
  407. package/dist/read-model/run-status.d.ts.map +1 -0
  408. package/dist/read-model/run-status.js +89 -0
  409. package/dist/read-model/run-status.js.map +1 -0
  410. package/dist/registry/{Registry.d.ts → BaseRegistry.d.ts} +2 -2
  411. package/dist/registry/BaseRegistry.d.ts.map +1 -0
  412. package/dist/registry/{Registry.js → BaseRegistry.js} +2 -2
  413. package/dist/registry/BaseRegistry.js.map +1 -0
  414. package/dist/registry/ManagedRegistry.d.ts +2 -2
  415. package/dist/registry/ManagedRegistry.d.ts.map +1 -1
  416. package/dist/registry/ManagedRegistry.js +26 -9
  417. package/dist/registry/ManagedRegistry.js.map +1 -1
  418. package/dist/registry/command/index-exports.d.ts +3 -0
  419. package/dist/registry/command/index-exports.d.ts.map +1 -0
  420. package/dist/registry/command/index-exports.js +5 -0
  421. package/dist/registry/command/index-exports.js.map +1 -0
  422. package/dist/registry/command/index.d.ts +53 -0
  423. package/dist/registry/command/index.d.ts.map +1 -0
  424. package/dist/registry/command/index.js +87 -0
  425. package/dist/registry/command/index.js.map +1 -0
  426. package/dist/registry/command/kernel-commands.d.ts +32 -0
  427. package/dist/registry/command/kernel-commands.d.ts.map +1 -0
  428. package/dist/registry/command/kernel-commands.js +78 -0
  429. package/dist/registry/command/kernel-commands.js.map +1 -0
  430. package/dist/registry/connector/scoped.d.ts +2 -1
  431. package/dist/registry/connector/scoped.d.ts.map +1 -1
  432. package/dist/registry/connector/scoped.js +6 -5
  433. package/dist/registry/connector/scoped.js.map +1 -1
  434. package/dist/registry/index.d.ts +4 -1
  435. package/dist/registry/index.d.ts.map +1 -1
  436. package/dist/registry/index.js +5 -1
  437. package/dist/registry/index.js.map +1 -1
  438. package/dist/registry/tool/execute.d.ts.map +1 -1
  439. package/dist/registry/tool/execute.js +15 -12
  440. package/dist/registry/tool/execute.js.map +1 -1
  441. package/dist/registry/tool/presentation.d.ts +32 -0
  442. package/dist/registry/tool/presentation.d.ts.map +1 -0
  443. package/dist/registry/tool/presentation.js +92 -0
  444. package/dist/registry/tool/presentation.js.map +1 -0
  445. package/dist/registry/tool/screen.d.ts.map +1 -1
  446. package/dist/registry/tool/screen.js +12 -11
  447. package/dist/registry/tool/screen.js.map +1 -1
  448. package/dist/run/drain.d.ts +13 -3
  449. package/dist/run/drain.d.ts.map +1 -1
  450. package/dist/run/drain.js +10 -0
  451. package/dist/run/drain.js.map +1 -1
  452. package/dist/run/reporter.d.ts.map +1 -1
  453. package/dist/run/reporter.js +203 -149
  454. package/dist/run/reporter.js.map +1 -1
  455. package/dist/run-query/index.d.ts +74 -0
  456. package/dist/run-query/index.d.ts.map +1 -0
  457. package/dist/run-query/index.js +73 -0
  458. package/dist/run-query/index.js.map +1 -0
  459. package/dist/runtime/bidi/session.d.ts.map +1 -1
  460. package/dist/runtime/bidi/session.js +7 -2
  461. package/dist/runtime/bidi/session.js.map +1 -1
  462. package/dist/runtime/decision/fallback.d.ts.map +1 -1
  463. package/dist/runtime/decision/fallback.js +6 -3
  464. package/dist/runtime/decision/fallback.js.map +1 -1
  465. package/dist/runtime/decision/parser.d.ts.map +1 -1
  466. package/dist/runtime/decision/parser.js +10 -9
  467. package/dist/runtime/decision/parser.js.map +1 -1
  468. package/dist/runtime/jobs/registry.d.ts +147 -0
  469. package/dist/runtime/jobs/registry.d.ts.map +1 -0
  470. package/dist/runtime/jobs/registry.js +242 -0
  471. package/dist/runtime/jobs/registry.js.map +1 -0
  472. package/dist/runtime/query/approval-policy.d.ts +22 -0
  473. package/dist/runtime/query/approval-policy.d.ts.map +1 -0
  474. package/dist/runtime/query/approval-policy.js +61 -0
  475. package/dist/runtime/query/approval-policy.js.map +1 -0
  476. package/dist/runtime/query/checkpoint.d.ts +3 -3
  477. package/dist/runtime/query/checkpoint.d.ts.map +1 -1
  478. package/dist/runtime/query/checkpoint.js +2 -2
  479. package/dist/runtime/query/checkpoint.js.map +1 -1
  480. package/dist/runtime/query/context.d.ts +85 -15
  481. package/dist/runtime/query/context.d.ts.map +1 -1
  482. package/dist/runtime/query/context.js +57 -14
  483. package/dist/runtime/query/context.js.map +1 -1
  484. package/dist/runtime/query/events.d.ts +5 -4
  485. package/dist/runtime/query/events.d.ts.map +1 -1
  486. package/dist/runtime/query/events.js +9 -6
  487. package/dist/runtime/query/events.js.map +1 -1
  488. package/dist/runtime/query/executor.d.ts +113 -4
  489. package/dist/runtime/query/executor.d.ts.map +1 -1
  490. package/dist/runtime/query/executor.js +228 -62
  491. package/dist/runtime/query/executor.js.map +1 -1
  492. package/dist/runtime/query/guardrail-presets.d.ts.map +1 -1
  493. package/dist/runtime/query/guardrail-presets.js +11 -14
  494. package/dist/runtime/query/guardrail-presets.js.map +1 -1
  495. package/dist/runtime/query/guardrails.d.ts.map +1 -1
  496. package/dist/runtime/query/guardrails.js +16 -12
  497. package/dist/runtime/query/guardrails.js.map +1 -1
  498. package/dist/runtime/query/index.d.ts +140 -16
  499. package/dist/runtime/query/index.d.ts.map +1 -1
  500. package/dist/runtime/query/index.js +379 -76
  501. package/dist/runtime/query/index.js.map +1 -1
  502. package/dist/runtime/query/iteration/index.d.ts +32 -0
  503. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  504. package/dist/runtime/query/iteration/index.js +256 -88
  505. package/dist/runtime/query/iteration/index.js.map +1 -1
  506. package/dist/runtime/query/iteration/phases/advisory.d.ts.map +1 -1
  507. package/dist/runtime/query/iteration/phases/advisory.js +17 -16
  508. package/dist/runtime/query/iteration/phases/advisory.js.map +1 -1
  509. package/dist/runtime/query/iteration/phases/compaction.d.ts +1 -8
  510. package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
  511. package/dist/runtime/query/iteration/phases/compaction.js +202 -178
  512. package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
  513. package/dist/runtime/query/iteration/phases/context.d.ts +52 -6
  514. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  515. package/dist/runtime/query/iteration/phases/context.js +26 -17
  516. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  517. package/dist/runtime/query/iteration/phases/tool-review.d.ts +2 -2
  518. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  519. package/dist/runtime/query/iteration/phases/tool-review.js +27 -7
  520. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  521. package/dist/runtime/query/iteration/phases/working-memory.d.ts.map +1 -1
  522. package/dist/runtime/query/iteration/phases/working-memory.js +3 -2
  523. package/dist/runtime/query/iteration/phases/working-memory.js.map +1 -1
  524. package/dist/runtime/query/iteration/stream-turn.js +14 -14
  525. package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
  526. package/dist/runtime/query/{context-cache.d.ts → prompt-cache.d.ts} +6 -4
  527. package/dist/runtime/query/prompt-cache.d.ts.map +1 -0
  528. package/dist/runtime/query/{context-cache.js → prompt-cache.js} +20 -2
  529. package/dist/runtime/query/prompt-cache.js.map +1 -0
  530. package/dist/runtime/query/prompt.d.ts +50 -0
  531. package/dist/runtime/query/prompt.d.ts.map +1 -1
  532. package/dist/runtime/query/prompt.js +83 -4
  533. package/dist/runtime/query/prompt.js.map +1 -1
  534. package/dist/runtime/query/repeat-call.d.ts +42 -0
  535. package/dist/runtime/query/repeat-call.d.ts.map +1 -0
  536. package/dist/runtime/query/repeat-call.js +107 -0
  537. package/dist/runtime/query/repeat-call.js.map +1 -0
  538. package/dist/runtime/query/replay/mutate.js +8 -1
  539. package/dist/runtime/query/replay/mutate.js.map +1 -1
  540. package/dist/runtime/query/result.d.ts +7 -0
  541. package/dist/runtime/query/result.d.ts.map +1 -1
  542. package/dist/runtime/query/result.js +38 -10
  543. package/dist/runtime/query/result.js.map +1 -1
  544. package/dist/runtime/query/resume-pending.d.ts.map +1 -1
  545. package/dist/runtime/query/resume-pending.js +19 -17
  546. package/dist/runtime/query/resume-pending.js.map +1 -1
  547. package/dist/runtime/query/resume-run.d.ts +2 -2
  548. package/dist/runtime/query/resume-run.d.ts.map +1 -1
  549. package/dist/runtime/query/run-state.d.ts +3 -3
  550. package/dist/runtime/query/run-state.d.ts.map +1 -1
  551. package/dist/runtime/query/run-state.js +2 -2
  552. package/dist/runtime/query/run-state.js.map +1 -1
  553. package/dist/runtime/query/tool-grants.d.ts +7 -0
  554. package/dist/runtime/query/tool-grants.d.ts.map +1 -1
  555. package/dist/runtime/query/tool-grants.js +1 -1
  556. package/dist/runtime/query/tool-grants.js.map +1 -1
  557. package/dist/runtime/query/tool-output-budget.js +34 -3
  558. package/dist/runtime/query/tool-output-budget.js.map +1 -1
  559. package/dist/runtime/query/tool-pause.d.ts.map +1 -1
  560. package/dist/runtime/query/tool-pause.js +2 -1
  561. package/dist/runtime/query/tool-pause.js.map +1 -1
  562. package/dist/runtime/query/tooling.d.ts +10 -2
  563. package/dist/runtime/query/tooling.d.ts.map +1 -1
  564. package/dist/runtime/query/tooling.js +3 -0
  565. package/dist/runtime/query/tooling.js.map +1 -1
  566. package/dist/sandbox/provider/local.d.ts +10 -0
  567. package/dist/sandbox/provider/local.d.ts.map +1 -1
  568. package/dist/sandbox/provider/local.js +77 -23
  569. package/dist/sandbox/provider/local.js.map +1 -1
  570. package/dist/sandbox/terminal.d.ts +130 -0
  571. package/dist/sandbox/terminal.d.ts.map +1 -0
  572. package/dist/sandbox/terminal.js +119 -0
  573. package/dist/sandbox/terminal.js.map +1 -0
  574. package/dist/{gateway → scheduler}/completion-inbox.d.ts +12 -5
  575. package/dist/scheduler/completion-inbox.d.ts.map +1 -0
  576. package/dist/{gateway → scheduler}/completion-inbox.js +19 -7
  577. package/dist/scheduler/completion-inbox.js.map +1 -0
  578. package/dist/scheduler/delegating.d.ts +90 -0
  579. package/dist/scheduler/delegating.d.ts.map +1 -0
  580. package/dist/scheduler/delegating.js +230 -0
  581. package/dist/scheduler/delegating.js.map +1 -0
  582. package/dist/{gateway → scheduler}/local.d.ts +10 -2
  583. package/dist/scheduler/local.d.ts.map +1 -0
  584. package/dist/{gateway → scheduler}/local.js +20 -11
  585. package/dist/scheduler/local.js.map +1 -0
  586. package/dist/session/actor-scope.d.ts +52 -0
  587. package/dist/session/actor-scope.d.ts.map +1 -0
  588. package/dist/session/actor-scope.js +112 -0
  589. package/dist/session/actor-scope.js.map +1 -0
  590. package/dist/session/errors.d.ts +31 -8
  591. package/dist/session/errors.d.ts.map +1 -1
  592. package/dist/session/errors.js +21 -1
  593. package/dist/session/errors.js.map +1 -1
  594. package/dist/session/handoff/assignment.d.ts +5 -5
  595. package/dist/session/handoff/assignment.d.ts.map +1 -1
  596. package/dist/session/handoff/broadcast.d.ts +2 -2
  597. package/dist/session/handoff/broadcast.d.ts.map +1 -1
  598. package/dist/session/handoff/broadcast.js +7 -7
  599. package/dist/session/handoff/broadcast.js.map +1 -1
  600. package/dist/session/handoff/single.d.ts +4 -4
  601. package/dist/session/handoff/single.d.ts.map +1 -1
  602. package/dist/session/handoff/single.js +4 -4
  603. package/dist/session/handoff/single.js.map +1 -1
  604. package/dist/session/migration/filesystem.d.ts +28 -0
  605. package/dist/session/migration/filesystem.d.ts.map +1 -1
  606. package/dist/session/migration/filesystem.js +44 -2
  607. package/dist/session/migration/filesystem.js.map +1 -1
  608. package/dist/session/migration/id-prefix.d.ts +50 -19
  609. package/dist/session/migration/id-prefix.d.ts.map +1 -1
  610. package/dist/session/migration/id-prefix.js +54 -22
  611. package/dist/session/migration/id-prefix.js.map +1 -1
  612. package/dist/session/migration/index.d.ts +6 -2
  613. package/dist/session/migration/index.d.ts.map +1 -1
  614. package/dist/session/migration/index.js +6 -2
  615. package/dist/session/migration/index.js.map +1 -1
  616. package/dist/session/migration/marker.d.ts.map +1 -1
  617. package/dist/session/migration/marker.js +21 -4
  618. package/dist/session/migration/marker.js.map +1 -1
  619. package/dist/session/retention/archive.d.ts.map +1 -1
  620. package/dist/session/retention/archive.js +25 -11
  621. package/dist/session/retention/archive.js.map +1 -1
  622. package/dist/session/workspace/git-worktree.d.ts.map +1 -1
  623. package/dist/session/workspace/git-worktree.js +17 -8
  624. package/dist/session/workspace/git-worktree.js.map +1 -1
  625. package/dist/skills/loader.d.ts +4 -2
  626. package/dist/skills/loader.d.ts.map +1 -1
  627. package/dist/skills/loader.js +36 -9
  628. package/dist/skills/loader.js.map +1 -1
  629. package/dist/skills/registry.d.ts +59 -1
  630. package/dist/skills/registry.d.ts.map +1 -1
  631. package/dist/skills/registry.js +154 -20
  632. package/dist/skills/registry.js.map +1 -1
  633. package/dist/store/attachment/index.d.ts +111 -0
  634. package/dist/store/attachment/index.d.ts.map +1 -0
  635. package/dist/store/attachment/index.js +94 -0
  636. package/dist/store/attachment/index.js.map +1 -0
  637. package/dist/store/config/index.d.ts +43 -0
  638. package/dist/store/config/index.d.ts.map +1 -0
  639. package/dist/store/config/index.js +51 -0
  640. package/dist/store/config/index.js.map +1 -0
  641. package/dist/store/feedback/conformance.d.ts +44 -0
  642. package/dist/store/feedback/conformance.d.ts.map +1 -0
  643. package/dist/store/feedback/conformance.js +127 -0
  644. package/dist/store/feedback/conformance.js.map +1 -0
  645. package/dist/store/feedback/disk.d.ts +46 -0
  646. package/dist/store/feedback/disk.d.ts.map +1 -0
  647. package/dist/store/feedback/disk.js +141 -0
  648. package/dist/store/feedback/disk.js.map +1 -0
  649. package/dist/store/feedback/index.d.ts +9 -0
  650. package/dist/store/feedback/index.d.ts.map +1 -0
  651. package/dist/store/feedback/index.js +5 -0
  652. package/dist/store/feedback/index.js.map +1 -0
  653. package/dist/store/feedback/memory.d.ts +33 -0
  654. package/dist/store/feedback/memory.d.ts.map +1 -0
  655. package/dist/store/feedback/memory.js +0 -0
  656. package/dist/store/feedback/memory.js.map +1 -0
  657. package/dist/store/feedback/types.d.ts +95 -0
  658. package/dist/store/feedback/types.d.ts.map +1 -0
  659. package/dist/store/feedback/types.js +27 -0
  660. package/dist/store/feedback/types.js.map +1 -0
  661. package/dist/store/index.d.ts +1 -0
  662. package/dist/store/index.d.ts.map +1 -1
  663. package/dist/store/index.js +4 -0
  664. package/dist/store/index.js.map +1 -1
  665. package/dist/store/kv/record-store.d.ts +54 -0
  666. package/dist/store/kv/record-store.d.ts.map +1 -0
  667. package/dist/store/kv/record-store.js +94 -0
  668. package/dist/store/kv/record-store.js.map +1 -0
  669. package/dist/store/memory/disk.d.ts +2 -0
  670. package/dist/store/memory/disk.d.ts.map +1 -1
  671. package/dist/store/memory/disk.js +36 -30
  672. package/dist/store/memory/disk.js.map +1 -1
  673. package/dist/store/run/checkpoint-disk.d.ts +4 -4
  674. package/dist/store/run/checkpoint-disk.d.ts.map +1 -1
  675. package/dist/store/run/checkpoint-disk.js +22 -1
  676. package/dist/store/run/checkpoint-disk.js.map +1 -1
  677. package/dist/store/run/checkpoint-memory.d.ts +4 -4
  678. package/dist/store/run/checkpoint-memory.d.ts.map +1 -1
  679. package/dist/store/run/checkpoint-memory.js.map +1 -1
  680. package/dist/store/run/claim-disk.d.ts +5 -5
  681. package/dist/store/run/claim-disk.d.ts.map +1 -1
  682. package/dist/store/run/claim-disk.js +20 -0
  683. package/dist/store/run/claim-disk.js.map +1 -1
  684. package/dist/store/run/conformance.d.ts.map +1 -1
  685. package/dist/store/run/conformance.js +10 -9
  686. package/dist/store/run/conformance.js.map +1 -1
  687. package/dist/store/run/disk.d.ts +3 -1
  688. package/dist/store/run/disk.d.ts.map +1 -1
  689. package/dist/store/run/disk.js +73 -4
  690. package/dist/store/run/disk.js.map +1 -1
  691. package/dist/store/run/listing.d.ts +4 -4
  692. package/dist/store/run/listing.d.ts.map +1 -1
  693. package/dist/store/run/listing.js.map +1 -1
  694. package/dist/store/run/memory.d.ts +5 -0
  695. package/dist/store/run/memory.d.ts.map +1 -1
  696. package/dist/store/run/memory.js +20 -1
  697. package/dist/store/run/memory.js.map +1 -1
  698. package/dist/store/session/canonical-path.d.ts +32 -0
  699. package/dist/store/session/canonical-path.d.ts.map +1 -0
  700. package/dist/store/session/canonical-path.js +46 -0
  701. package/dist/store/session/canonical-path.js.map +1 -0
  702. package/dist/store/session/disk.d.ts +46 -2
  703. package/dist/store/session/disk.d.ts.map +1 -1
  704. package/dist/store/session/disk.js +191 -205
  705. package/dist/store/session/disk.js.map +1 -1
  706. package/dist/store/session/memory.d.ts +10 -2
  707. package/dist/store/session/memory.d.ts.map +1 -1
  708. package/dist/store/session/memory.js +36 -4
  709. package/dist/store/session/memory.js.map +1 -1
  710. package/dist/store/task/disk.d.ts.map +1 -1
  711. package/dist/store/task/disk.js +76 -68
  712. package/dist/store/task/disk.js.map +1 -1
  713. package/dist/store/topic/index.d.ts +6 -0
  714. package/dist/store/topic/index.d.ts.map +1 -0
  715. package/dist/store/topic/index.js +20 -0
  716. package/dist/store/topic/index.js.map +1 -0
  717. package/dist/store/topic/memory.d.ts +30 -0
  718. package/dist/store/topic/memory.d.ts.map +1 -0
  719. package/dist/store/topic/memory.js +97 -0
  720. package/dist/store/topic/memory.js.map +1 -0
  721. package/dist/store/topic/objective.d.ts +104 -0
  722. package/dist/store/topic/objective.d.ts.map +1 -0
  723. package/dist/store/topic/objective.js +195 -0
  724. package/dist/store/topic/objective.js.map +1 -0
  725. package/dist/store/topic/state.d.ts +60 -0
  726. package/dist/store/topic/state.d.ts.map +1 -0
  727. package/dist/store/topic/state.js +128 -0
  728. package/dist/store/topic/state.js.map +1 -0
  729. package/dist/streaming/coalesce.d.ts +19 -6
  730. package/dist/streaming/coalesce.d.ts.map +1 -1
  731. package/dist/streaming/coalesce.js +13 -4
  732. package/dist/streaming/coalesce.js.map +1 -1
  733. package/dist/telemetry/runtime-accessors.d.ts +27 -1
  734. package/dist/telemetry/runtime-accessors.d.ts.map +1 -1
  735. package/dist/telemetry/runtime-accessors.js +45 -1
  736. package/dist/telemetry/runtime-accessors.js.map +1 -1
  737. package/dist/test-support/ids.d.ts +68 -0
  738. package/dist/test-support/ids.d.ts.map +1 -0
  739. package/dist/test-support/ids.js +70 -0
  740. package/dist/test-support/ids.js.map +1 -0
  741. package/dist/testing.d.ts +24 -0
  742. package/dist/testing.d.ts.map +1 -0
  743. package/dist/testing.js +22 -0
  744. package/dist/testing.js.map +1 -0
  745. package/dist/tools/builtins/bash.d.ts +1 -0
  746. package/dist/tools/builtins/bash.d.ts.map +1 -1
  747. package/dist/tools/builtins/bash.js +77 -3
  748. package/dist/tools/builtins/bash.js.map +1 -1
  749. package/dist/tools/builtins/computer-use.d.ts +8 -8
  750. package/dist/tools/builtins/edit.d.ts +1 -1
  751. package/dist/tools/builtins/edit.d.ts.map +1 -1
  752. package/dist/tools/builtins/edit.js +34 -0
  753. package/dist/tools/builtins/edit.js.map +1 -1
  754. package/dist/tools/builtins/index.d.ts +6 -0
  755. package/dist/tools/builtins/index.d.ts.map +1 -1
  756. package/dist/tools/builtins/index.js +24 -1
  757. package/dist/tools/builtins/index.js.map +1 -1
  758. package/dist/tools/builtins/job.d.ts +6 -0
  759. package/dist/tools/builtins/job.d.ts.map +1 -0
  760. package/dist/tools/builtins/job.js +114 -0
  761. package/dist/tools/builtins/job.js.map +1 -0
  762. package/dist/tools/builtins/lsp.d.ts +21 -0
  763. package/dist/tools/builtins/lsp.d.ts.map +1 -0
  764. package/dist/tools/builtins/lsp.js +186 -0
  765. package/dist/tools/builtins/lsp.js.map +1 -0
  766. package/dist/tools/builtins/run-code.d.ts +13 -0
  767. package/dist/tools/builtins/run-code.d.ts.map +1 -0
  768. package/dist/tools/builtins/run-code.js +126 -0
  769. package/dist/tools/builtins/run-code.js.map +1 -0
  770. package/dist/tools/builtins/skill.d.ts +14 -0
  771. package/dist/tools/builtins/skill.d.ts.map +1 -0
  772. package/dist/tools/builtins/skill.js +120 -0
  773. package/dist/tools/builtins/skill.js.map +1 -0
  774. package/dist/tools/builtins/web-guidance.d.ts +31 -0
  775. package/dist/tools/builtins/web-guidance.d.ts.map +1 -0
  776. package/dist/tools/builtins/web-guidance.js +42 -0
  777. package/dist/tools/builtins/web-guidance.js.map +1 -0
  778. package/dist/tools/builtins/web.d.ts +10 -0
  779. package/dist/tools/builtins/web.d.ts.map +1 -0
  780. package/dist/tools/builtins/web.js +137 -0
  781. package/dist/tools/builtins/web.js.map +1 -0
  782. package/dist/tools/builtins/write-file.d.ts.map +1 -1
  783. package/dist/tools/builtins/write-file.js +35 -0
  784. package/dist/tools/builtins/write-file.js.map +1 -1
  785. package/dist/tools/coordinator/agent.d.ts +2 -2
  786. package/dist/tools/coordinator/agent.d.ts.map +1 -1
  787. package/dist/tools/coordinator/index.d.ts +13 -4
  788. package/dist/tools/coordinator/index.d.ts.map +1 -1
  789. package/dist/tools/coordinator/index.js +125 -38
  790. package/dist/tools/coordinator/index.js.map +1 -1
  791. package/dist/tools/coordinator/outcome.d.ts +2 -2
  792. package/dist/tools/coordinator/outcome.d.ts.map +1 -1
  793. package/dist/tools/coordinator/outcome.js +1 -1
  794. package/dist/tools/coordinator/wait-with-idle-bound.d.ts +3 -3
  795. package/dist/tools/coordinator/wait-with-idle-bound.d.ts.map +1 -1
  796. package/dist/tools/coordinator/wait-with-idle-bound.js.map +1 -1
  797. package/dist/tools/defineTool.d.ts +12 -0
  798. package/dist/tools/defineTool.d.ts.map +1 -1
  799. package/dist/tools/defineTool.js +2 -0
  800. package/dist/tools/defineTool.js.map +1 -1
  801. package/dist/tools/env-scrub.d.ts +66 -0
  802. package/dist/tools/env-scrub.d.ts.map +1 -0
  803. package/dist/tools/env-scrub.js +68 -0
  804. package/dist/tools/env-scrub.js.map +1 -0
  805. package/dist/tools/memory/read.d.ts.map +1 -1
  806. package/dist/tools/memory/read.js +5 -1
  807. package/dist/tools/memory/read.js.map +1 -1
  808. package/dist/tools/task/create.d.ts.map +1 -1
  809. package/dist/tools/task/create.js +2 -1
  810. package/dist/tools/task/create.js.map +1 -1
  811. package/dist/tools/task/update.d.ts.map +1 -1
  812. package/dist/tools/task/update.js +7 -3
  813. package/dist/tools/task/update.js.map +1 -1
  814. package/dist/types/acp/index.d.ts +161 -0
  815. package/dist/types/acp/index.d.ts.map +1 -0
  816. package/dist/types/acp/index.js +2 -0
  817. package/dist/types/acp/index.js.map +1 -0
  818. package/dist/types/agent/base.d.ts +62 -5
  819. package/dist/types/agent/base.d.ts.map +1 -1
  820. package/dist/types/agent/delegate.d.ts +102 -0
  821. package/dist/types/agent/delegate.d.ts.map +1 -0
  822. package/dist/types/agent/delegate.js +2 -0
  823. package/dist/types/agent/delegate.js.map +1 -0
  824. package/dist/types/agent/index.d.ts +1 -1
  825. package/dist/types/agent/index.d.ts.map +1 -1
  826. package/dist/types/agent/index.js +1 -1
  827. package/dist/types/agent/index.js.map +1 -1
  828. package/dist/types/agent/manager.d.ts +7 -1
  829. package/dist/types/agent/manager.d.ts.map +1 -1
  830. package/dist/types/agent/reactive.d.ts +24 -3
  831. package/dist/types/agent/reactive.d.ts.map +1 -1
  832. package/dist/types/agent/{gateway.d.ts → scheduler.d.ts} +41 -5
  833. package/dist/types/agent/scheduler.d.ts.map +1 -0
  834. package/dist/types/agent/scheduler.js +2 -0
  835. package/dist/types/agent/scheduler.js.map +1 -0
  836. package/dist/types/agent/supervisor.d.ts +23 -5
  837. package/dist/types/agent/supervisor.d.ts.map +1 -1
  838. package/dist/types/agent/task.d.ts +31 -9
  839. package/dist/types/agent/task.d.ts.map +1 -1
  840. package/dist/types/agent/working-memory.d.ts +1 -1
  841. package/dist/types/authorization/index.d.ts +634 -0
  842. package/dist/types/authorization/index.d.ts.map +1 -0
  843. package/dist/types/authorization/index.js +103 -0
  844. package/dist/types/authorization/index.js.map +1 -0
  845. package/dist/types/bus/index.d.ts +24 -1
  846. package/dist/types/bus/index.d.ts.map +1 -1
  847. package/dist/types/code-navigation/index.d.ts +112 -0
  848. package/dist/types/code-navigation/index.d.ts.map +1 -0
  849. package/dist/types/code-navigation/index.js +17 -0
  850. package/dist/types/code-navigation/index.js.map +1 -0
  851. package/dist/types/command/index.d.ts +74 -0
  852. package/dist/types/command/index.d.ts.map +1 -0
  853. package/dist/types/command/index.js +18 -0
  854. package/dist/types/command/index.js.map +1 -0
  855. package/dist/types/common/index.d.ts +19 -2
  856. package/dist/types/common/index.d.ts.map +1 -1
  857. package/dist/types/common/index.js.map +1 -1
  858. package/dist/types/connector/mcp.d.ts +8 -0
  859. package/dist/types/connector/mcp.d.ts.map +1 -1
  860. package/dist/types/guardrail/index.d.ts +1 -1
  861. package/dist/types/hitl/policy.d.ts +79 -0
  862. package/dist/types/hitl/policy.d.ts.map +1 -0
  863. package/dist/types/hitl/policy.js +2 -0
  864. package/dist/types/hitl/policy.js.map +1 -0
  865. package/dist/types/ids/brand.d.ts +55 -0
  866. package/dist/types/ids/brand.d.ts.map +1 -0
  867. package/dist/types/ids/brand.js +45 -0
  868. package/dist/types/ids/brand.js.map +1 -0
  869. package/dist/types/ids/index.d.ts +98 -39
  870. package/dist/types/ids/index.d.ts.map +1 -1
  871. package/dist/types/ids/index.js +5 -1
  872. package/dist/types/ids/index.js.map +1 -1
  873. package/dist/types/message/index.d.ts +24 -1
  874. package/dist/types/message/index.d.ts.map +1 -1
  875. package/dist/types/message/index.js.map +1 -1
  876. package/dist/types/plugin/index.d.ts +2 -2
  877. package/dist/types/project/entity.d.ts +22 -2
  878. package/dist/types/project/entity.d.ts.map +1 -1
  879. package/dist/types/provider/interface.d.ts +43 -2
  880. package/dist/types/provider/interface.d.ts.map +1 -1
  881. package/dist/types/provider/model.d.ts +16 -2
  882. package/dist/types/provider/model.d.ts.map +1 -1
  883. package/dist/types/run/audit.d.ts +150 -0
  884. package/dist/types/run/audit.d.ts.map +1 -0
  885. package/dist/types/run/audit.js +39 -0
  886. package/dist/types/run/audit.js.map +1 -0
  887. package/dist/types/run/cancel-cause.d.ts +49 -0
  888. package/dist/types/run/cancel-cause.d.ts.map +1 -0
  889. package/dist/types/run/cancel-cause.js +39 -0
  890. package/dist/types/run/cancel-cause.js.map +1 -0
  891. package/dist/types/run/checkpoint-store.d.ts +29 -11
  892. package/dist/types/run/checkpoint-store.d.ts.map +1 -1
  893. package/dist/types/run/config.d.ts +24 -4
  894. package/dist/types/run/config.d.ts.map +1 -1
  895. package/dist/types/run/derive-status.d.ts +3 -3
  896. package/dist/types/run/derive-status.d.ts.map +1 -1
  897. package/dist/types/run/derive-status.js +1 -1
  898. package/dist/types/run/entity.d.ts +2 -3
  899. package/dist/types/run/entity.d.ts.map +1 -1
  900. package/dist/types/run/event-cursor.d.ts +3 -3
  901. package/dist/types/run/event-cursor.d.ts.map +1 -1
  902. package/dist/types/run/events.d.ts +159 -4
  903. package/dist/types/run/events.d.ts.map +1 -1
  904. package/dist/types/run/events.js.map +1 -1
  905. package/dist/types/run/index.d.ts +2 -0
  906. package/dist/types/run/index.d.ts.map +1 -1
  907. package/dist/types/run/index.js +2 -0
  908. package/dist/types/run/index.js.map +1 -1
  909. package/dist/types/run/metadata.d.ts +2 -2
  910. package/dist/types/run/metadata.d.ts.map +1 -1
  911. package/dist/types/run/prepare-step.d.ts +29 -0
  912. package/dist/types/run/prepare-step.d.ts.map +1 -1
  913. package/dist/types/run/state.d.ts +33 -10
  914. package/dist/types/run/state.d.ts.map +1 -1
  915. package/dist/types/run/state.js +60 -3
  916. package/dist/types/run/state.js.map +1 -1
  917. package/dist/types/run/stop-reason.d.ts +9 -0
  918. package/dist/types/run/stop-reason.d.ts.map +1 -1
  919. package/dist/types/run/store.d.ts +38 -0
  920. package/dist/types/run/store.d.ts.map +1 -1
  921. package/dist/types/sandbox/index.d.ts +38 -0
  922. package/dist/types/sandbox/index.d.ts.map +1 -1
  923. package/dist/types/sandbox/index.js +21 -0
  924. package/dist/types/sandbox/index.js.map +1 -1
  925. package/dist/types/session/actor.d.ts +2 -2
  926. package/dist/types/session/actor.d.ts.map +1 -1
  927. package/dist/types/session/entity.d.ts +9 -7
  928. package/dist/types/session/entity.d.ts.map +1 -1
  929. package/dist/types/session/ids.d.ts +3 -1
  930. package/dist/types/session/ids.d.ts.map +1 -1
  931. package/dist/types/session/index.d.ts +4 -2
  932. package/dist/types/session/index.d.ts.map +1 -1
  933. package/dist/types/session/store.d.ts +51 -22
  934. package/dist/types/session/store.d.ts.map +1 -1
  935. package/dist/types/session/sub-session.d.ts +55 -5
  936. package/dist/types/session/sub-session.d.ts.map +1 -1
  937. package/dist/types/skills/index.d.ts +41 -0
  938. package/dist/types/skills/index.d.ts.map +1 -1
  939. package/dist/types/skills/index.js +17 -1
  940. package/dist/types/skills/index.js.map +1 -1
  941. package/dist/types/tool/index.d.ts +175 -1
  942. package/dist/types/tool/index.d.ts.map +1 -1
  943. package/dist/types/tool/index.js.map +1 -1
  944. package/dist/types/tool/presentation.d.ts +53 -0
  945. package/dist/types/tool/presentation.d.ts.map +1 -0
  946. package/dist/types/tool/presentation.js +2 -0
  947. package/dist/types/tool/presentation.js.map +1 -0
  948. package/dist/types/{thread → topic}/entity.d.ts +34 -26
  949. package/dist/types/topic/entity.d.ts.map +1 -0
  950. package/dist/types/{thread → topic}/entity.js.map +1 -1
  951. package/dist/types/topic/index.d.ts +5 -0
  952. package/dist/types/topic/index.d.ts.map +1 -0
  953. package/dist/types/topic/index.js +11 -0
  954. package/dist/types/topic/index.js.map +1 -0
  955. package/dist/types/topic/objective.d.ts +86 -0
  956. package/dist/types/topic/objective.d.ts.map +1 -0
  957. package/dist/types/topic/objective.js +10 -0
  958. package/dist/types/topic/objective.js.map +1 -0
  959. package/dist/types/topic/state.d.ts +56 -0
  960. package/dist/types/topic/state.d.ts.map +1 -0
  961. package/dist/types/topic/state.js +10 -0
  962. package/dist/types/topic/state.js.map +1 -0
  963. package/dist/types/topic/store.d.ts +95 -0
  964. package/dist/types/topic/store.d.ts.map +1 -0
  965. package/dist/types/topic/store.js +29 -0
  966. package/dist/types/topic/store.js.map +1 -0
  967. package/dist/types/workspace/ref.d.ts +7 -0
  968. package/dist/types/workspace/ref.d.ts.map +1 -1
  969. package/dist/utils/abort.d.ts.map +1 -1
  970. package/dist/utils/abort.js +13 -1
  971. package/dist/utils/abort.js.map +1 -1
  972. package/dist/utils/hash.d.ts +10 -0
  973. package/dist/utils/hash.d.ts.map +1 -1
  974. package/dist/utils/hash.js +15 -0
  975. package/dist/utils/hash.js.map +1 -1
  976. package/dist/utils/id.d.ts +90 -2
  977. package/dist/utils/id.d.ts.map +1 -1
  978. package/dist/utils/id.js +113 -5
  979. package/dist/utils/id.js.map +1 -1
  980. package/dist/utils/log/attributes.d.ts +17 -0
  981. package/dist/utils/log/attributes.d.ts.map +1 -0
  982. package/dist/utils/log/attributes.js +2 -0
  983. package/dist/utils/log/attributes.js.map +1 -0
  984. package/dist/utils/log/caps.d.ts +27 -0
  985. package/dist/utils/log/caps.d.ts.map +1 -0
  986. package/dist/utils/log/caps.js +107 -0
  987. package/dist/utils/log/caps.js.map +1 -0
  988. package/dist/utils/log/create-logger.d.ts +28 -0
  989. package/dist/utils/log/create-logger.d.ts.map +1 -0
  990. package/dist/utils/log/create-logger.js +168 -0
  991. package/dist/utils/log/create-logger.js.map +1 -0
  992. package/dist/utils/log/exception.d.ts +11 -0
  993. package/dist/utils/log/exception.d.ts.map +1 -0
  994. package/dist/utils/log/exception.js +108 -0
  995. package/dist/utils/log/exception.js.map +1 -0
  996. package/dist/utils/log/index.d.ts +7 -0
  997. package/dist/utils/log/index.d.ts.map +1 -0
  998. package/dist/utils/log/index.js +15 -0
  999. package/dist/utils/log/index.js.map +1 -0
  1000. package/dist/utils/log/process-sink.d.ts +28 -0
  1001. package/dist/utils/log/process-sink.d.ts.map +1 -0
  1002. package/dist/utils/log/process-sink.js +56 -0
  1003. package/dist/utils/log/process-sink.js.map +1 -0
  1004. package/dist/utils/log/redact.d.ts +3 -0
  1005. package/dist/utils/log/redact.d.ts.map +1 -0
  1006. package/dist/utils/log/redact.js +71 -0
  1007. package/dist/utils/log/redact.js.map +1 -0
  1008. package/dist/utils/log/sinks.d.ts +43 -0
  1009. package/dist/utils/log/sinks.d.ts.map +1 -0
  1010. package/dist/utils/log/sinks.js +184 -0
  1011. package/dist/utils/log/sinks.js.map +1 -0
  1012. package/dist/utils/log/templates.d.ts +63 -0
  1013. package/dist/utils/log/templates.d.ts.map +1 -0
  1014. package/dist/utils/log/templates.js +119 -0
  1015. package/dist/utils/log/templates.js.map +1 -0
  1016. package/dist/utils/log/types.d.ts +183 -0
  1017. package/dist/utils/log/types.d.ts.map +1 -0
  1018. package/dist/utils/log/types.js +55 -0
  1019. package/dist/utils/log/types.js.map +1 -0
  1020. package/dist/utils/logger.d.ts +44 -0
  1021. package/dist/utils/logger.d.ts.map +1 -1
  1022. package/dist/utils/logger.js +102 -2
  1023. package/dist/utils/logger.js.map +1 -1
  1024. package/dist/utils/renamed-field.d.ts +19 -0
  1025. package/dist/utils/renamed-field.d.ts.map +1 -0
  1026. package/dist/utils/renamed-field.js +29 -0
  1027. package/dist/utils/renamed-field.js.map +1 -0
  1028. package/dist/vault/CredentialProvider.d.ts +89 -0
  1029. package/dist/vault/CredentialProvider.d.ts.map +1 -0
  1030. package/dist/vault/CredentialProvider.js +64 -0
  1031. package/dist/vault/CredentialProvider.js.map +1 -0
  1032. package/dist/vault/InMemoryCredentialVault.d.ts +2 -1
  1033. package/dist/vault/InMemoryCredentialVault.d.ts.map +1 -1
  1034. package/dist/vault/InMemoryCredentialVault.js +15 -5
  1035. package/dist/vault/InMemoryCredentialVault.js.map +1 -1
  1036. package/dist/vault/index.d.ts +3 -0
  1037. package/dist/vault/index.d.ts.map +1 -1
  1038. package/dist/vault/index.js +5 -0
  1039. package/dist/vault/index.js.map +1 -1
  1040. package/dist/vault/instrumentation.d.ts +18 -2
  1041. package/dist/vault/instrumentation.d.ts.map +1 -1
  1042. package/dist/vault/instrumentation.js +47 -0
  1043. package/dist/vault/instrumentation.js.map +1 -1
  1044. package/package.json +4 -4
  1045. package/src/advisory/executor.ts +14 -12
  1046. package/src/advisory/registry.ts +2 -2
  1047. package/src/agents/AGENTS.md +91 -0
  1048. package/src/agents/AbstractAgent.ts +67 -14
  1049. package/src/agents/PipelineAgent.ts +46 -12
  1050. package/src/agents/ReactiveAgent.ts +27 -13
  1051. package/src/agents/RouterAgent.ts +33 -21
  1052. package/src/agents/SupervisorAgent.ts +51 -26
  1053. package/src/agents/handle.ts +149 -0
  1054. package/src/agents/runAgent.ts +14 -7
  1055. package/src/{verification → authorization}/gate.ts +39 -32
  1056. package/src/authorization/index.ts +26 -0
  1057. package/src/authorization/permission-presets.ts +215 -0
  1058. package/src/{verification → authorization}/presets.ts +15 -3
  1059. package/src/{verification → authorization}/rules.ts +16 -3
  1060. package/src/bridge/a2a/client.ts +369 -0
  1061. package/src/bridge/a2a/mapper.ts +17 -0
  1062. package/src/bridge/acp/filesystem.ts +63 -0
  1063. package/src/bridge/acp/index.ts +11 -0
  1064. package/src/bridge/acp/permission.ts +71 -0
  1065. package/src/bridge/acp/server.ts +500 -0
  1066. package/src/bridge/acp/update.ts +109 -0
  1067. package/src/bridge/mcp/connector/adapter.ts +8 -4
  1068. package/src/bridge/sse/mapper.ts +30 -0
  1069. package/src/bus/breaker.ts +15 -10
  1070. package/src/bus/index.ts +10 -8
  1071. package/src/bus/lock.ts +36 -19
  1072. package/src/bus/ownership.ts +17 -9
  1073. package/src/compaction/context-window.ts +23 -1
  1074. package/src/compaction/index.ts +6 -0
  1075. package/src/compaction/manual.ts +177 -0
  1076. package/src/compaction/plan.ts +226 -0
  1077. package/src/compaction/summary.ts +31 -0
  1078. package/src/compaction/verifier.ts +2 -2
  1079. package/src/config/registry.ts +208 -0
  1080. package/src/config/runtime.ts +27 -0
  1081. package/src/connector/BaseConnector.ts +8 -3
  1082. package/src/connector/builtins/http.ts +12 -2
  1083. package/src/connector/builtins/webhook.ts +6 -2
  1084. package/src/connector/index.ts +45 -29
  1085. package/src/connector/mcp/client.ts +32 -20
  1086. package/src/connector/mcp/discovery.ts +31 -20
  1087. package/src/connector/mcp/http-sse.ts +12 -6
  1088. package/src/connector/mcp/index.ts +8 -7
  1089. package/src/connector/mcp/reconnect.ts +194 -0
  1090. package/src/connector/mcp/server/index.ts +32 -0
  1091. package/src/connector/mcp/{server-stdio.ts → server/server-stdio.ts} +5 -4
  1092. package/src/connector/mcp/{server.ts → server/server.ts} +17 -11
  1093. package/src/connector/mcp/stdio.ts +18 -9
  1094. package/src/connector/mcp/streamable-http.ts +8 -4
  1095. package/src/{bridge/tools/connector → connector/tools}/adapter.ts +5 -5
  1096. package/src/{bridge/tools/connector → connector/tools}/definitions.ts +4 -4
  1097. package/src/{bridge/tools/connector → connector/tools}/router.ts +17 -9
  1098. package/src/connector/web/guarded-fetch.ts +288 -0
  1099. package/src/connector/web/index.ts +17 -0
  1100. package/src/connector/web/types.ts +99 -0
  1101. package/src/constants/acp/index.ts +104 -0
  1102. package/src/constants/credential-env-keys.ts +63 -0
  1103. package/src/constants/index.ts +3 -1
  1104. package/src/constants/secret-patterns.ts +102 -0
  1105. package/src/constants/telemetry/index.ts +98 -0
  1106. package/src/contracts/api.ts +11 -0
  1107. package/src/deprecated-aliases.ts +86 -0
  1108. package/src/eval/judge.ts +2 -2
  1109. package/src/execution/base.ts +18 -7
  1110. package/src/execution/code-runtime/types.ts +116 -0
  1111. package/src/execution/code-runtime/worker.ts +266 -0
  1112. package/src/{connector/execution → execution}/factory.ts +3 -3
  1113. package/src/{connector/execution → execution}/hybrid.ts +13 -7
  1114. package/src/execution/index.ts +24 -0
  1115. package/src/execution/local.ts +4 -2
  1116. package/src/{connector/execution → execution}/remote.ts +15 -8
  1117. package/src/index.ts +17 -0
  1118. package/src/invariants/index.ts +201 -0
  1119. package/src/manager/agent/lifecycle.ts +172 -58
  1120. package/src/manager/connector/environment.ts +22 -11
  1121. package/src/manager/connector/lifecycle.ts +30 -11
  1122. package/src/manager/connector/tenant.ts +33 -14
  1123. package/src/manager/index.ts +16 -2
  1124. package/src/manager/project/lifecycle.ts +1 -1
  1125. package/src/manager/run/emergency.ts +9 -7
  1126. package/src/manager/run/persistence.ts +110 -8
  1127. package/src/manager/topic/lifecycle.ts +235 -0
  1128. package/src/manager/topic/objective.ts +203 -0
  1129. package/src/persona/assembler.ts +14 -3
  1130. package/src/plugin/lifecycle.ts +156 -20
  1131. package/src/plugin/loader.ts +67 -16
  1132. package/src/probe/index.ts +1 -0
  1133. package/src/probe/registry.ts +41 -5
  1134. package/src/process/kill-tree.ts +52 -0
  1135. package/src/prompt/contributions.ts +173 -0
  1136. package/src/prompt/index.ts +15 -0
  1137. package/src/provider/attribution.ts +57 -0
  1138. package/src/provider/{collect.ts → collect-chat-completion.ts} +4 -2
  1139. package/src/provider/conformance.ts +189 -0
  1140. package/src/provider/errors.ts +27 -12
  1141. package/src/provider/fallback.ts +32 -10
  1142. package/src/provider/idle-timeout.ts +112 -0
  1143. package/src/provider/instrumentation.ts +4 -2
  1144. package/src/provider/retry.ts +63 -21
  1145. package/src/public-runtime.ts +373 -14
  1146. package/src/public-tools.ts +41 -1
  1147. package/src/public-types.ts +101 -4
  1148. package/src/rag/rag-tool.ts +4 -2
  1149. package/src/read-model/index.ts +14 -0
  1150. package/src/read-model/registry.ts +152 -0
  1151. package/src/read-model/run-status.ts +127 -0
  1152. package/src/registry/{Registry.ts → BaseRegistry.ts} +1 -1
  1153. package/src/registry/ManagedRegistry.ts +26 -9
  1154. package/src/registry/command/index-exports.ts +4 -0
  1155. package/src/registry/command/index.ts +105 -0
  1156. package/src/registry/command/kernel-commands.ts +110 -0
  1157. package/src/registry/connector/scoped.ts +6 -5
  1158. package/src/registry/index.ts +7 -1
  1159. package/src/registry/tool/execute.ts +15 -12
  1160. package/src/registry/tool/presentation.ts +116 -0
  1161. package/src/registry/tool/screen.ts +12 -11
  1162. package/src/run/drain.ts +13 -3
  1163. package/src/run/reporter.ts +208 -153
  1164. package/src/run-query/index.ts +108 -0
  1165. package/src/runtime/bidi/session.ts +7 -2
  1166. package/src/runtime/decision/fallback.ts +6 -3
  1167. package/src/runtime/decision/parser.ts +10 -9
  1168. package/src/runtime/jobs/registry.ts +346 -0
  1169. package/src/runtime/query/approval-policy.ts +78 -0
  1170. package/src/runtime/query/checkpoint.ts +6 -6
  1171. package/src/runtime/query/context.ts +120 -30
  1172. package/src/runtime/query/events.ts +19 -11
  1173. package/src/runtime/query/executor.ts +287 -66
  1174. package/src/runtime/query/guardrail-presets.ts +11 -14
  1175. package/src/runtime/query/guardrails.ts +16 -12
  1176. package/src/runtime/query/index.ts +579 -96
  1177. package/src/runtime/query/iteration/index.ts +269 -87
  1178. package/src/runtime/query/iteration/phases/advisory.ts +17 -16
  1179. package/src/runtime/query/iteration/phases/compaction.ts +235 -187
  1180. package/src/runtime/query/iteration/phases/context.ts +82 -21
  1181. package/src/runtime/query/iteration/phases/tool-review.ts +28 -9
  1182. package/src/runtime/query/iteration/phases/working-memory.ts +3 -2
  1183. package/src/runtime/query/iteration/stream-turn.ts +14 -14
  1184. package/src/runtime/query/{context-cache.ts → prompt-cache.ts} +23 -3
  1185. package/src/runtime/query/prompt.ts +104 -4
  1186. package/src/runtime/query/repeat-call.ts +130 -0
  1187. package/src/runtime/query/replay/mutate.ts +6 -0
  1188. package/src/runtime/query/result.ts +47 -10
  1189. package/src/runtime/query/resume-pending.ts +19 -17
  1190. package/src/runtime/query/resume-run.ts +2 -2
  1191. package/src/runtime/query/run-state.ts +5 -5
  1192. package/src/runtime/query/tool-grants.ts +1 -1
  1193. package/src/runtime/query/tool-output-budget.ts +36 -3
  1194. package/src/runtime/query/tool-pause.ts +2 -1
  1195. package/src/runtime/query/tooling.ts +17 -2
  1196. package/src/sandbox/provider/local.ts +94 -21
  1197. package/src/sandbox/terminal.ts +197 -0
  1198. package/src/{gateway → scheduler}/completion-inbox.ts +20 -10
  1199. package/src/scheduler/delegating.ts +297 -0
  1200. package/src/{gateway → scheduler}/local.ts +24 -15
  1201. package/src/session/actor-scope.ts +121 -0
  1202. package/src/session/errors.ts +30 -8
  1203. package/src/session/handoff/assignment.ts +5 -5
  1204. package/src/session/handoff/broadcast.ts +9 -9
  1205. package/src/session/handoff/single.ts +8 -8
  1206. package/src/session/migration/filesystem.ts +46 -2
  1207. package/src/session/migration/id-prefix.ts +60 -22
  1208. package/src/session/migration/index.ts +5 -0
  1209. package/src/session/migration/marker.ts +19 -4
  1210. package/src/session/retention/archive.ts +32 -12
  1211. package/src/session/workspace/git-worktree.ts +17 -8
  1212. package/src/skills/loader.ts +39 -9
  1213. package/src/skills/registry.ts +177 -20
  1214. package/src/store/attachment/index.ts +182 -0
  1215. package/src/store/config/index.ts +74 -0
  1216. package/src/store/feedback/conformance.ts +193 -0
  1217. package/src/store/feedback/disk.ts +184 -0
  1218. package/src/store/feedback/index.ts +13 -0
  1219. package/src/store/feedback/memory.ts +0 -0
  1220. package/src/store/feedback/types.ts +107 -0
  1221. package/src/store/index.ts +5 -0
  1222. package/src/store/kv/record-store.ts +91 -0
  1223. package/src/store/memory/disk.ts +35 -32
  1224. package/src/store/run/checkpoint-disk.ts +27 -6
  1225. package/src/store/run/checkpoint-memory.ts +8 -8
  1226. package/src/store/run/claim-disk.ts +58 -13
  1227. package/src/store/run/conformance.ts +11 -10
  1228. package/src/store/run/disk.ts +77 -5
  1229. package/src/store/run/listing.ts +6 -6
  1230. package/src/store/run/memory.ts +24 -1
  1231. package/src/store/session/canonical-path.ts +45 -0
  1232. package/src/store/session/disk.ts +216 -191
  1233. package/src/store/session/memory.ts +43 -5
  1234. package/src/store/task/disk.ts +77 -67
  1235. package/src/store/topic/index.ts +33 -0
  1236. package/src/store/topic/memory.ts +111 -0
  1237. package/src/store/topic/objective.ts +290 -0
  1238. package/src/store/topic/state.ts +204 -0
  1239. package/src/streaming/coalesce.ts +19 -5
  1240. package/src/telemetry/runtime-accessors.ts +45 -1
  1241. package/src/test-support/ids.ts +117 -0
  1242. package/src/testing.ts +40 -0
  1243. package/src/tools/builtins/bash.ts +82 -3
  1244. package/src/tools/builtins/edit.ts +36 -0
  1245. package/src/tools/builtins/index.ts +29 -1
  1246. package/src/tools/builtins/job.ts +133 -0
  1247. package/src/tools/builtins/lsp.ts +214 -0
  1248. package/src/tools/builtins/run-code.ts +154 -0
  1249. package/src/tools/builtins/skill.ts +134 -0
  1250. package/src/tools/builtins/web-guidance.ts +46 -0
  1251. package/src/tools/builtins/web.ts +156 -0
  1252. package/src/tools/builtins/write-file.ts +37 -1
  1253. package/src/tools/coordinator/agent.ts +2 -2
  1254. package/src/tools/coordinator/index.ts +144 -40
  1255. package/src/tools/coordinator/outcome.ts +2 -2
  1256. package/src/tools/coordinator/wait-with-idle-bound.ts +3 -3
  1257. package/src/tools/defineTool.ts +14 -0
  1258. package/src/tools/env-scrub.ts +91 -0
  1259. package/src/tools/memory/read.ts +5 -2
  1260. package/src/tools/task/create.ts +2 -1
  1261. package/src/tools/task/update.ts +7 -4
  1262. package/src/types/acp/index.ts +163 -0
  1263. package/src/types/agent/base.ts +67 -5
  1264. package/src/types/agent/delegate.ts +110 -0
  1265. package/src/types/agent/index.ts +1 -1
  1266. package/src/types/agent/manager.ts +7 -1
  1267. package/src/types/agent/reactive.ts +27 -3
  1268. package/src/types/agent/{gateway.ts → scheduler.ts} +41 -4
  1269. package/src/types/agent/supervisor.ts +26 -5
  1270. package/src/types/agent/task.ts +31 -9
  1271. package/src/types/agent/working-memory.ts +1 -1
  1272. package/src/types/{verification → authorization}/index.ts +79 -10
  1273. package/src/types/bus/index.ts +30 -1
  1274. package/src/types/code-navigation/index.ts +99 -0
  1275. package/src/types/command/index.ts +68 -0
  1276. package/src/types/common/index.ts +26 -2
  1277. package/src/types/connector/mcp.ts +8 -0
  1278. package/src/types/guardrail/index.ts +1 -1
  1279. package/src/types/hitl/policy.ts +83 -0
  1280. package/src/types/ids/brand.ts +58 -0
  1281. package/src/types/ids/index.ts +109 -42
  1282. package/src/types/message/index.ts +25 -1
  1283. package/src/types/project/entity.ts +22 -2
  1284. package/src/types/provider/interface.ts +45 -2
  1285. package/src/types/provider/model.ts +16 -2
  1286. package/src/types/run/audit.ts +164 -0
  1287. package/src/types/run/cancel-cause.ts +60 -0
  1288. package/src/types/run/checkpoint-store.ts +31 -11
  1289. package/src/types/run/config.ts +25 -4
  1290. package/src/types/run/derive-status.ts +3 -3
  1291. package/src/types/run/entity.ts +2 -4
  1292. package/src/types/run/event-cursor.ts +3 -3
  1293. package/src/types/run/events.ts +165 -6
  1294. package/src/types/run/index.ts +2 -0
  1295. package/src/types/run/metadata.ts +2 -2
  1296. package/src/types/run/prepare-step.ts +33 -0
  1297. package/src/types/run/state.ts +78 -11
  1298. package/src/types/run/stop-reason.ts +9 -0
  1299. package/src/types/run/store.ts +40 -0
  1300. package/src/types/sandbox/index.ts +37 -0
  1301. package/src/types/session/actor.ts +10 -2
  1302. package/src/types/session/entity.ts +9 -7
  1303. package/src/types/session/ids.ts +2 -0
  1304. package/src/types/session/index.ts +2 -0
  1305. package/src/types/session/store.ts +53 -22
  1306. package/src/types/session/sub-session.ts +50 -9
  1307. package/src/types/skills/index.ts +50 -0
  1308. package/src/types/tool/index.ts +156 -1
  1309. package/src/types/tool/presentation.ts +48 -0
  1310. package/src/types/{thread → topic}/entity.ts +34 -26
  1311. package/src/types/topic/index.ts +23 -0
  1312. package/src/types/topic/objective.ts +93 -0
  1313. package/src/types/topic/state.ts +60 -0
  1314. package/src/types/topic/store.ts +101 -0
  1315. package/src/types/workspace/ref.ts +7 -0
  1316. package/src/utils/abort.ts +16 -1
  1317. package/src/utils/hash.ts +16 -0
  1318. package/src/utils/id.ts +172 -12
  1319. package/src/utils/log/attributes.ts +47 -0
  1320. package/src/utils/log/caps.ts +118 -0
  1321. package/src/utils/log/create-logger.ts +198 -0
  1322. package/src/utils/log/exception.ts +124 -0
  1323. package/src/utils/log/index.ts +24 -0
  1324. package/src/utils/log/process-sink.ts +76 -0
  1325. package/src/utils/log/redact.ts +77 -0
  1326. package/src/utils/log/sinks.ts +205 -0
  1327. package/src/utils/log/templates.ts +161 -0
  1328. package/src/utils/log/types.ts +195 -0
  1329. package/src/utils/logger.ts +121 -2
  1330. package/src/utils/renamed-field.ts +35 -0
  1331. package/src/vault/CredentialProvider.ts +147 -0
  1332. package/src/vault/InMemoryCredentialVault.ts +16 -5
  1333. package/src/vault/index.ts +16 -0
  1334. package/src/vault/instrumentation.ts +63 -2
  1335. package/dist/bridge/tools/connector/adapter.d.ts.map +0 -1
  1336. package/dist/bridge/tools/connector/adapter.js.map +0 -1
  1337. package/dist/bridge/tools/connector/definitions.d.ts.map +0 -1
  1338. package/dist/bridge/tools/connector/definitions.js.map +0 -1
  1339. package/dist/bridge/tools/connector/index.d.ts.map +0 -1
  1340. package/dist/bridge/tools/connector/index.js.map +0 -1
  1341. package/dist/bridge/tools/connector/router.d.ts.map +0 -1
  1342. package/dist/bridge/tools/connector/router.js.map +0 -1
  1343. package/dist/connector/execution/factory.d.ts.map +0 -1
  1344. package/dist/connector/execution/factory.js.map +0 -1
  1345. package/dist/connector/execution/hybrid.d.ts.map +0 -1
  1346. package/dist/connector/execution/hybrid.js.map +0 -1
  1347. package/dist/connector/execution/index.d.ts +0 -6
  1348. package/dist/connector/execution/index.d.ts.map +0 -1
  1349. package/dist/connector/execution/index.js +0 -4
  1350. package/dist/connector/execution/index.js.map +0 -1
  1351. package/dist/connector/execution/remote.d.ts.map +0 -1
  1352. package/dist/connector/execution/remote.js.map +0 -1
  1353. package/dist/connector/mcp/server-stdio.d.ts.map +0 -1
  1354. package/dist/connector/mcp/server-stdio.js.map +0 -1
  1355. package/dist/connector/mcp/server.d.ts.map +0 -1
  1356. package/dist/connector/mcp/server.js.map +0 -1
  1357. package/dist/constants/verification/index.d.ts.map +0 -1
  1358. package/dist/constants/verification/index.js.map +0 -1
  1359. package/dist/gateway/completion-inbox.d.ts.map +0 -1
  1360. package/dist/gateway/completion-inbox.js.map +0 -1
  1361. package/dist/gateway/local.d.ts.map +0 -1
  1362. package/dist/gateway/local.js.map +0 -1
  1363. package/dist/manager/thread/lifecycle.d.ts +0 -105
  1364. package/dist/manager/thread/lifecycle.d.ts.map +0 -1
  1365. package/dist/manager/thread/lifecycle.js.map +0 -1
  1366. package/dist/provider/collect.d.ts.map +0 -1
  1367. package/dist/provider/collect.js.map +0 -1
  1368. package/dist/registry/Registry.d.ts.map +0 -1
  1369. package/dist/registry/Registry.js.map +0 -1
  1370. package/dist/router/task-router.d.ts.map +0 -1
  1371. package/dist/router/task-router.js.map +0 -1
  1372. package/dist/runtime/query/context-cache.d.ts.map +0 -1
  1373. package/dist/runtime/query/context-cache.js.map +0 -1
  1374. package/dist/store/thread/disk.d.ts +0 -41
  1375. package/dist/store/thread/disk.d.ts.map +0 -1
  1376. package/dist/store/thread/disk.js +0 -238
  1377. package/dist/store/thread/disk.js.map +0 -1
  1378. package/dist/store/thread/index.d.ts +0 -4
  1379. package/dist/store/thread/index.d.ts.map +0 -1
  1380. package/dist/store/thread/index.js +0 -6
  1381. package/dist/store/thread/index.js.map +0 -1
  1382. package/dist/store/thread/memory.d.ts +0 -23
  1383. package/dist/store/thread/memory.d.ts.map +0 -1
  1384. package/dist/store/thread/memory.js +0 -90
  1385. package/dist/store/thread/memory.js.map +0 -1
  1386. package/dist/types/agent/gateway.d.ts.map +0 -1
  1387. package/dist/types/agent/gateway.js +0 -2
  1388. package/dist/types/agent/gateway.js.map +0 -1
  1389. package/dist/types/thread/entity.d.ts.map +0 -1
  1390. package/dist/types/thread/index.d.ts +0 -3
  1391. package/dist/types/thread/index.d.ts.map +0 -1
  1392. package/dist/types/thread/index.js +0 -5
  1393. package/dist/types/thread/index.js.map +0 -1
  1394. package/dist/types/thread/store.d.ts +0 -86
  1395. package/dist/types/thread/store.d.ts.map +0 -1
  1396. package/dist/types/thread/store.js +0 -22
  1397. package/dist/types/thread/store.js.map +0 -1
  1398. package/dist/types/verification/index.d.ts +0 -317
  1399. package/dist/types/verification/index.d.ts.map +0 -1
  1400. package/dist/types/verification/index.js +0 -53
  1401. package/dist/types/verification/index.js.map +0 -1
  1402. package/dist/verification/gate.d.ts.map +0 -1
  1403. package/dist/verification/gate.js.map +0 -1
  1404. package/dist/verification/index.d.ts +0 -4
  1405. package/dist/verification/index.d.ts.map +0 -1
  1406. package/dist/verification/index.js +0 -4
  1407. package/dist/verification/index.js.map +0 -1
  1408. package/dist/verification/presets.d.ts.map +0 -1
  1409. package/dist/verification/presets.js.map +0 -1
  1410. package/dist/verification/rules.d.ts +0 -4
  1411. package/dist/verification/rules.d.ts.map +0 -1
  1412. package/dist/verification/rules.js.map +0 -1
  1413. package/src/connector/execution/index.ts +0 -5
  1414. package/src/manager/thread/lifecycle.ts +0 -217
  1415. package/src/store/thread/disk.ts +0 -272
  1416. package/src/store/thread/index.ts +0 -7
  1417. package/src/store/thread/memory.ts +0 -104
  1418. package/src/types/thread/index.ts +0 -6
  1419. package/src/types/thread/store.ts +0 -92
  1420. package/src/verification/index.ts +0 -3
  1421. /package/dist/{bridge/tools/connector → connector/tools}/index.d.ts +0 -0
  1422. /package/dist/{bridge/tools/connector → connector/tools}/index.js +0 -0
  1423. /package/dist/constants/{verification → authorization}/index.d.ts +0 -0
  1424. /package/dist/constants/{verification → authorization}/index.js +0 -0
  1425. /package/dist/{router → model-router}/task-router.d.ts +0 -0
  1426. /package/dist/{router → model-router}/task-router.js +0 -0
  1427. /package/dist/types/{thread → topic}/entity.js +0 -0
  1428. /package/src/{bridge/tools/connector → connector/tools}/index.ts +0 -0
  1429. /package/src/constants/{verification → authorization}/index.ts +0 -0
  1430. /package/src/{router → model-router}/task-router.ts +0 -0
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Reaching the web, as a seam rather than as a bundled vendor.
3
+ *
4
+ * Two providers, and they are separated on purpose. **Fetching a URL is a
5
+ * capability this kernel can implement**: the rules are about the network
6
+ * and the same everywhere, so a wrong answer is a defect rather than a
7
+ * preference. **Searching is not.** Every search backend has its own
8
+ * account, its own terms, its own result shape and its own opinion about
9
+ * what a result even is, and picking one here would make that choice for
10
+ * every consumer while adding a dependency nobody asked for.
11
+ *
12
+ * So `WebFetchProvider` ships with a guarded implementation and
13
+ * `WebSearchProvider` ships with none. A host that wants search brings one.
14
+ * That asymmetry is the design, not an omission — see
15
+ * `GuardedFetchProvider` for what "guarded" is doing the work of.
16
+ */
17
+
18
+ export interface WebFetchRequest {
19
+ readonly url: string
20
+ /** Extra headers. The provider may refuse or strip some; see the guard. */
21
+ readonly headers?: Readonly<Record<string, string>>
22
+ readonly signal?: AbortSignal
23
+ }
24
+
25
+ export interface WebFetchResult {
26
+ readonly url: string
27
+ readonly status: number
28
+ readonly contentType?: string
29
+ readonly body: string
30
+ /**
31
+ * Whether the body was cut off at the size cap.
32
+ *
33
+ * Reported, never silent. A truncated page that reads as complete is a
34
+ * model concluding something from a document whose second half it never
35
+ * saw — the same rule the tool-output cap and the background job buffer
36
+ * already follow.
37
+ */
38
+ readonly truncated: boolean
39
+ /** Every URL in the redirect chain, in order, including the final one. */
40
+ readonly redirects: readonly string[]
41
+ }
42
+
43
+ /** Why a fetch was refused before it left the process. */
44
+ export type WebFetchRefusalReason =
45
+ | 'scheme'
46
+ | 'private-address'
47
+ | 'redirect-limit'
48
+ | 'redirect-target'
49
+ | 'blocked-host'
50
+
51
+ export class WebFetchRefusedError extends Error {
52
+ readonly details: { url: string; reason: WebFetchRefusalReason }
53
+
54
+ constructor(message: string, details: { url: string; reason: WebFetchRefusalReason }) {
55
+ super(message)
56
+ this.name = 'WebFetchRefusedError'
57
+ this.details = details
58
+ }
59
+ }
60
+
61
+ export interface WebFetchProvider {
62
+ fetch(request: WebFetchRequest): Promise<WebFetchResult>
63
+ }
64
+
65
+ export interface WebSearchRequest {
66
+ readonly query: string
67
+ readonly limit?: number
68
+ readonly signal?: AbortSignal
69
+ }
70
+
71
+ export interface WebSearchHit {
72
+ readonly title: string
73
+ readonly url: string
74
+ /**
75
+ * The backend's own excerpt, when it has one.
76
+ *
77
+ * Not synthesised here. A snippet this kernel wrote would be a claim
78
+ * about a page nobody fetched, and a model citing it would be citing us.
79
+ */
80
+ readonly snippet?: string
81
+ }
82
+
83
+ export interface WebSearchResult {
84
+ readonly query: string
85
+ readonly hits: readonly WebSearchHit[]
86
+ }
87
+
88
+ /**
89
+ * Search, which this kernel does NOT implement.
90
+ *
91
+ * Declared so the tool surface and the wiring can exist without a vendor,
92
+ * and so a host's backend has a shape to satisfy rather than a convention
93
+ * to guess at. There is deliberately no default: a search provider means an
94
+ * account, terms of service, and a result shape, and choosing one here
95
+ * would choose it for every consumer.
96
+ */
97
+ export interface WebSearchProvider {
98
+ search(request: WebSearchRequest): Promise<WebSearchResult>
99
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * The agent-client protocol's version and method set, pinned.
3
+ *
4
+ * A table rather than string literals scattered through the server, because
5
+ * the two things that go wrong with a wire protocol are a method spelled
6
+ * differently in one place and a method implemented but never advertised.
7
+ * Both are invisible at compile time and both present to a client as "that
8
+ * agent does not support this".
9
+ *
10
+ * `bridge/acp/server.ts` authors its handler map independently and a test
11
+ * compares the two SETS in both directions: a handler with no entry here
12
+ * fails, and an entry here with no handler fails. That is the only
13
+ * arrangement where the comparison can fail — deriving the handlers from
14
+ * this table would make the test a tautology, which is the shape
15
+ * `a-check-that-cannot-fail` names.
16
+ *
17
+ * Zero imports, deliberately: this is read by the types module, the server,
18
+ * and the CLI command, and a constant table that pulls in a dependency
19
+ * becomes a cycle the moment one of those three moves.
20
+ */
21
+
22
+ /**
23
+ * The protocol revision this bridge speaks.
24
+ *
25
+ * A number, matching the wire field, and pinned rather than negotiated
26
+ * downward. A client asking for a version this does not implement is told
27
+ * what it does implement; guessing that an older client can be served by a
28
+ * newer agent is how a protocol bridge produces a session that half works.
29
+ */
30
+ export const ACP_PROTOCOL_VERSION = 1
31
+
32
+ /** Methods a client calls on this agent. */
33
+ export const ACP_METHODS = {
34
+ INITIALIZE: 'initialize',
35
+ SESSION_NEW: 'session/new',
36
+ SESSION_PROMPT: 'session/prompt',
37
+ SESSION_CANCEL: 'session/cancel',
38
+ SESSION_LOAD: 'session/load',
39
+ } as const
40
+
41
+ export type AcpMethod = (typeof ACP_METHODS)[keyof typeof ACP_METHODS]
42
+
43
+ /**
44
+ * Notifications this agent sends the client.
45
+ *
46
+ * Separate from `ACP_METHODS` because the drift test is about what a client
47
+ * may CALL. Mixing the two directions into one table would make that test
48
+ * demand a handler for a message this side only ever sends.
49
+ */
50
+ export const ACP_CLIENT_NOTIFICATIONS = {
51
+ SESSION_UPDATE: 'session/update',
52
+ } as const
53
+
54
+ /**
55
+ * REQUESTS this agent makes of the client, which it answers.
56
+ *
57
+ * Distinct from a notification: each carries an id and this side waits for
58
+ * the response. That direction is what makes a permission prompt possible at
59
+ * all — the agent has a question and cannot proceed until the human behind
60
+ * the client answers it.
61
+ */
62
+ export const ACP_CLIENT_REQUESTS = {
63
+ REQUEST_PERMISSION: 'session/request_permission',
64
+ FS_READ: 'fs/read_text_file',
65
+ FS_WRITE: 'fs/write_text_file',
66
+ } as const
67
+
68
+ /**
69
+ * JSON-RPC error codes this bridge answers with.
70
+ *
71
+ * `METHOD_NOT_FOUND` is the one with a behavioural requirement attached: an
72
+ * unknown method is answered and the connection STAYS OPEN. A bridge that
73
+ * closed on an unrecognised call would make a client's feature probe fatal.
74
+ */
75
+ export const ACP_ERROR_CODES = {
76
+ PARSE_ERROR: -32700,
77
+ INVALID_REQUEST: -32600,
78
+ METHOD_NOT_FOUND: -32601,
79
+ INVALID_PARAMS: -32602,
80
+ INTERNAL_ERROR: -32603,
81
+ } as const
82
+
83
+ /**
84
+ * The capability a client must declare before a session is created.
85
+ *
86
+ * Approval routing is a later change, so a session that could not ask a
87
+ * human anything must not be created at all: it would run with every tool
88
+ * auto-approved, which is not a degraded version of asking — it is the
89
+ * opposite of it. The refusal names this string so a client author knows
90
+ * what to send.
91
+ */
92
+ export const ACP_PERMISSION_CAPABILITY = 'permission'
93
+
94
+ /**
95
+ * The capability that lets the EDITOR's buffers be the source of truth.
96
+ *
97
+ * Optional, unlike `permission`. A client that does not declare it gets an
98
+ * agent reading and writing the disk, which is correct and is what every
99
+ * non-editor peer wants. A client that DOES declare it is telling this
100
+ * agent that the file on disk may be stale — the user has unsaved changes —
101
+ * and that reading disk anyway would show the model a version of the file
102
+ * nobody is looking at.
103
+ */
104
+ export const ACP_FILESYSTEM_CAPABILITY = 'fs'
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Credential-bearing environment variable KEY NAMES, in one place.
3
+ *
4
+ * A leaf with no imports, beside `secret-patterns.ts` and holding the
5
+ * complement of it: that file matches credential VALUES, this one matches
6
+ * the names variables carry them under. Neither re-declares the other's,
7
+ * because a value pattern and a key name answer different questions and a
8
+ * table that tried to do both would be wrong at whichever end it was not
9
+ * written for.
10
+ *
11
+ * Two readers, and that is the point of moving it here. The host-bash
12
+ * environment scrub uses it to decide what a shell command must not
13
+ * inherit, and `EnvCredentialProvider` uses it to decide what counts as a
14
+ * credential it can resolve. Those were about to become two tables — the
15
+ * CLI's provider registry already keeps a third, of `envVars` per provider
16
+ * — and a name in one and not another means a variable the CLI reads a
17
+ * credential from and the scrub happily hands to a shell.
18
+ */
19
+
20
+ /**
21
+ * Key-name patterns that mark an inherited variable as credential-shaped.
22
+ *
23
+ * Matched case-insensitively against the whole key. Deliberately broad: a
24
+ * false positive costs a command one variable it can be handed back
25
+ * explicitly, while a false negative costs a leaked secret that cannot be
26
+ * recalled from a transcript.
27
+ */
28
+ export const CREDENTIAL_KEY_PATTERNS: readonly RegExp[] = [
29
+ /KEY/i,
30
+ /SECRET/i,
31
+ /TOKEN/i,
32
+ /PASSWORD/i,
33
+ /PASSWD/i,
34
+ /CREDENTIAL/i,
35
+ /(^|_)AUTH(_|$)/i,
36
+ /PRIVATE/i,
37
+ /SESSION_ID/i,
38
+ /COOKIE/i,
39
+ /SIGNATURE/i,
40
+ /(^|_)PAT(_|$)/i,
41
+ ]
42
+
43
+ /**
44
+ * Keys that are credential-bearing but whose names match none of the patterns
45
+ * above. Kept as an explicit list so each entry is a decision somebody can
46
+ * read, rather than a pattern nobody can evaluate.
47
+ */
48
+ export const CREDENTIAL_KEY_EXACT: ReadonlySet<string> = new Set([
49
+ 'AWS_SESSION_TOKEN',
50
+ 'AWS_SECURITY_TOKEN',
51
+ 'GOOGLE_APPLICATION_CREDENTIALS',
52
+ 'NPM_CONFIG__AUTH',
53
+ 'GH_ENTERPRISE_TOKEN',
54
+ 'DOCKER_AUTH_CONFIG',
55
+ 'KUBECONFIG',
56
+ 'NETRC',
57
+ ])
58
+
59
+ /** True when an inherited variable's name marks it as credential-shaped. */
60
+ export function isCredentialEnvKey(key: string): boolean {
61
+ if (CREDENTIAL_KEY_EXACT.has(key.toUpperCase())) return true
62
+ return CREDENTIAL_KEY_PATTERNS.some((pattern) => pattern.test(key))
63
+ }
@@ -1,3 +1,4 @@
1
+ export * from './acp/index.js'
1
2
  export * from './a2a/index.js'
2
3
  export * from './advisory/index.js'
3
4
  export * from './compaction/index.js'
@@ -10,7 +11,8 @@ export * from './agent/index.js'
10
11
  export * from './continuation.js'
11
12
  export * from './limits.js'
12
13
  export * from './bus/index.js'
13
- export * from './verification/index.js'
14
+ export * from './authorization/index.js'
14
15
  export * from './emergency.js'
15
16
  export * from './plugin/index.js'
16
17
  export * from './sandbox/index.js'
18
+ export * from './secret-patterns.js'
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Credential shapes redacted before they leave this tree, in one place.
3
+ *
4
+ * Two tables evolved independently and disagreed:
5
+ *
6
+ * - `runtime/query/guardrail-presets.ts` carried eight vendor-prefix-anchored
7
+ * patterns, private and unexported, deliberately narrow — a loose
8
+ * "looks like a secret" regex over model output produces false positives
9
+ * on ordinary code, and a redactor that fires on the wrong thing gets
10
+ * switched off, at which point it protects nothing.
11
+ * - `provider/errors.ts` carried a broader, field-name-aware set (a
12
+ * generic key-prefix pattern, a bearer-header pattern, and a JSON
13
+ * field-name scrubber that catches a secret by the key it sits under
14
+ * regardless of value shape) because the narrow approach had already
15
+ * proven insufficient there: a vendor error body echoes the request,
16
+ * and a request can carry a credential shape the narrow table never
17
+ * anticipated.
18
+ *
19
+ * Both live here now, as two exported sets rather than one, because the
20
+ * cost of a false positive is not the same at the two call sites:
21
+ *
22
+ * - `OUTPUT_SECRET_PATTERNS` (the original narrow eight) is what
23
+ * `secretRedactionGuardrail` matches against MODEL OUTPUT. A false
24
+ * positive there rewrites the answer the caller asked for, so it stays
25
+ * narrow on purpose.
26
+ * - `LOG_SECRET_PATTERNS` (the union of both tables) is for text that is
27
+ * being logged or carried in an error's `detail`, never returned as the
28
+ * answer itself. A false positive there redacts one word out of a
29
+ * diagnostic line nobody was going to copy-paste as a credential, which
30
+ * is a cost worth paying for the wider net.
31
+ *
32
+ * `SecretPattern` label strings are never returned to the caller verbatim —
33
+ * consumers replace a match with `[REDACTED:<label>]`, not the matched
34
+ * text, so a `label` here should never itself carry anything secret.
35
+ *
36
+ * Zero imports. This is a leaf module on purpose: `utils/logger.ts` is
37
+ * imported by most of `runtime/query/`, so pulling this table back out of
38
+ * `runtime/query` would have made it a same-package import cycle, and a
39
+ * cycle on a security-relevant table fails as a TDZ error or a
40
+ * partially-initialised module — quietly, in the worst possible place.
41
+ * Keeping this file leaf-only is what lets `runtime/query/guardrail-presets.ts`
42
+ * and `provider/errors.ts` both import from it without one importing the
43
+ * other.
44
+ */
45
+
46
+ export type SecretPattern = readonly [label: string, pattern: RegExp]
47
+
48
+ /**
49
+ * The narrow, prefix-anchored set. Unchanged from the table this replaces —
50
+ * same labels, same regexes, same order — because moving it was the whole
51
+ * point of this module and widening it was not: `secretRedactionGuardrail`
52
+ * still needs a redactor precise enough that it never gets switched off.
53
+ */
54
+ export const OUTPUT_SECRET_PATTERNS: readonly SecretPattern[] = [
55
+ ['aws-access-key', /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g],
56
+ ['github-token', /\bgh[pousr]_[A-Za-z0-9]{36,}\b/g],
57
+ ['openai-key', /\bsk-(?:proj-)?[A-Za-z0-9_-]{20,}\b/g],
58
+ ['anthropic-key', /\bsk-ant-[A-Za-z0-9_-]{20,}\b/g],
59
+ ['slack-token', /\bxox[abprs]-[A-Za-z0-9-]{10,}\b/g],
60
+ ['google-api-key', /\bAIza[0-9A-Za-z_-]{35}\b/g],
61
+ ['private-key-block', /-----BEGIN (?:RSA |EC |OPENSSH |PGP )?PRIVATE KEY-----/g],
62
+ ['jwt', /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g],
63
+ ]
64
+
65
+ /**
66
+ * The union: every pattern above, plus everything `provider/errors.ts`
67
+ * carried that the narrow set did not cover — a generic key-prefix catch,
68
+ * a bearer-header pattern, and a JSON field-name scrubber.
69
+ *
70
+ * Two adjustments over a plain concatenation, both required so that
71
+ * deleting any ONE entry changes behaviour for exactly the shape that
72
+ * entry names, which is what the test suite for this module pins:
73
+ *
74
+ * - `github-token` uses the wider `{20,}` threshold `provider/errors.ts`
75
+ * used, not the guardrail's `{36,}` — the union takes the broader of
76
+ * two disagreeing thresholds for the same vendor, never the narrower.
77
+ * - The two broad `sk-`-family entries each carry a negative lookahead
78
+ * excluding the `sk-ant-` and `sk-proj-` shapes, which a plain
79
+ * `sk-`/`pk-`/`rk-` prefix scan would otherwise ALSO match. Without the
80
+ * lookaheads, deleting the narrower entry for one of those shapes leaves a
81
+ * value of that shape still caught — by the broad entries, in array order —
82
+ * so the redaction succeeds while the label names the wrong issuer.
83
+ *
84
+ * A mislabelled redaction is not a cosmetic problem: the label is what an
85
+ * operator greps for when rotating one credential and not another. That is
86
+ * also why the mutation check deletes each entry in turn and asserts only
87
+ * its own sample breaks.
88
+ */
89
+ export const LOG_SECRET_PATTERNS: readonly SecretPattern[] = [
90
+ ['aws-access-key', /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g],
91
+ ['github-token', /\bgh[pousr]_[A-Za-z0-9]{20,}\b/g],
92
+ ['anthropic-key', /\bsk-ant-[A-Za-z0-9_-]{20,}\b/g],
93
+ ['openai-key', /\bsk-(?!ant-)(?:proj-)?[A-Za-z0-9_-]{20,}\b/g],
94
+ ['slack-token', /\bxox[abprs]-[A-Za-z0-9-]{10,}\b/g],
95
+ ['google-api-key', /\bAIza[0-9A-Za-z_-]{35}\b/g],
96
+ ['private-key-block', /-----BEGIN (?:RSA |EC |OPENSSH |PGP )?PRIVATE KEY-----/g],
97
+ ['jwt', /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g],
98
+ ['npm-token', /\bnpm_[A-Za-z0-9]{20,}\b/g],
99
+ ['bearer-token', /\bBearer\s+[A-Za-z0-9._~+/-]{12,}=*/gi],
100
+ ['generic-key', /\b(?:sk[-_](?!ant-|proj-)|pk[-_]|rk[-_])[A-Za-z0-9_-]{12,}\b/g],
101
+ ['json-secret-field', /"(?:api[_-]?key|authorization|token|secret|password)"\s*:\s*"[^"]*"/gi],
102
+ ]
@@ -54,4 +54,102 @@ export const NAMZU = {
54
54
  CACHE_READ_TOKENS: 'namzu.cache.read_tokens',
55
55
  CACHE_WRITE_TOKENS: 'namzu.cache.write_tokens',
56
56
  CACHE_DISCOUNT: 'namzu.cache.discount',
57
+
58
+ // Correlation attributes for the run's own logger — see
59
+ // RunContextFactory.buildLogger (runtime/query/context.ts). RUN_ID above
60
+ // already covered the run itself; these are the layers above it
61
+ // (Tenant -> Project -> Thread -> Session -> Run, Convention #17) that
62
+ // used to reach the run's logger as four bare, un-namespaced keys.
63
+ SESSION_ID: 'namzu.session.id',
64
+ THREAD_ID: 'namzu.thread.id',
65
+ PROJECT_ID: 'namzu.project.id',
66
+ TENANT_ID: 'namzu.tenant.id',
67
+ // Set only when a run was started by another run (the sub-agent gateway
68
+ // path) — see query()'s params.parentRunId in runtime/query/index.ts.
69
+ // Previously reached the RunContext's own fields but never the logger.
70
+ RUN_PARENT_ID: 'namzu.run.parent_id',
71
+
72
+ // AbstractAgent's per-instance identity (agents/AbstractAgent.ts). The id
73
+ // half reuses GENAI.AGENT_ID — an agent's id is the same concept whether
74
+ // it is read off a span or a log record, and GENAI.AGENT_ID already
75
+ // exists and is already bound at the run's own correlated logger and
76
+ // root span. TYPE has no GENAI analogue, so it is new.
77
+ AGENT_TYPE: 'namzu.agent.type',
78
+
79
+ // ManagedRegistry's per-subclass distinction (registry/ManagedRegistry.ts).
80
+ // scope.name is fixed to 'registry' for every ManagedRegistry subclass —
81
+ // they all log through this one file — so the per-instance name that
82
+ // `component: config.componentName` used to carry moves here instead.
83
+ // `ManagedRegistryConfig.componentName`'s FIELD NAME is unchanged.
84
+ REGISTRY_NAME: 'namzu.registry.name',
85
+
86
+ // InMemoryCredentialVault (vault/InMemoryCredentialVault.ts) — closes a
87
+ // PRE-EXISTING violation of "no attribute string literal at a call
88
+ // site": both keys already existed as raw string literals there before
89
+ // this change. Values are unchanged.
90
+ CREDENTIAL_ID: 'namzu.credential.id',
91
+ CREDENTIAL_LABEL: 'namzu.credential.label',
92
+
93
+ // MCPClient (connector/mcp/client.ts). SERVER_ID is the OPERATOR's own
94
+ // configured identifier for the connector instance being dialed;
95
+ // SERVER_NAME is the REMOTE server's own self-reported name from its
96
+ // initialize response — kept separate on purpose, since the remote's
97
+ // self-report is attacker-influenced data (see
98
+ // connector/mcp/__tests__/a-server-cannot-forge-a-second-log-line.test.ts).
99
+ // SERVER_NAME closes the same kind of pre-existing literal violation as
100
+ // the two CREDENTIAL_* keys above.
101
+ SERVER_ID: 'namzu.connector.server.id',
102
+ SERVER_NAME: 'namzu.connector.server.name',
103
+
104
+ // The MCP server this process HOSTS (connector/mcp/server/server.ts), not
105
+ // one it dials. Deliberately not SERVER_ID above: that key is the client
106
+ // side's identifier for a remote, and a record carrying both concepts
107
+ // under one name is the collision the namespace rule exists to stop. The
108
+ // value is an `MCPServerId` minted here, so unlike SERVER_NAME it is not
109
+ // attacker-influenced.
110
+ MCP_SERVER_ID: 'namzu.mcp.server.id',
111
+
112
+ // The concrete subclass behind a base class that logs on its children's
113
+ // behalf — the same shape as REGISTRY_NAME above, and for the same
114
+ // reason: `scope.name` is the MODULE (`connector/base`, `execution/base`)
115
+ // because that is the file the record is emitted from, so the subclass
116
+ // identity every one of those records used to carry as `component:
117
+ // this.constructor.name` needs somewhere to go that is not the scope.
118
+ CONNECTOR_TYPE: 'namzu.connector.type',
119
+ EXECUTION_TYPE: 'namzu.execution.type',
120
+
121
+ // LocalSandbox (sandbox/provider/local.ts). The file hosts two logging
122
+ // classes — the sandbox and its provider — and both scope to
123
+ // `sandbox/provider/local`, so this id is what separates one sandbox's
124
+ // records from the provider's and from each other's.
125
+ SANDBOX_ID: 'namzu.sandbox.id',
57
126
  } as const
127
+
128
+ /**
129
+ * The boot narrative's closed event-name vocabulary — every `eventName` the
130
+ * SDK itself emits between process start and `namzu.boot.ready`. A call
131
+ * site spells `BOOT_EVENT_NAMES.X`, not the literal string, so a typo
132
+ * becomes a missing property at compile time rather than a name that
133
+ * silently never matches a host's filter.
134
+ *
135
+ * `BootEventName` is DERIVED from this record rather than declared beside
136
+ * it, so the two cannot drift — there is only one place a member is added.
137
+ * `LogRecord.eventName` itself stays `string`, not this union: widening it
138
+ * to a fixed union would make the field unusable for a future emitter
139
+ * naming events from a different vocabulary.
140
+ */
141
+ export const BOOT_EVENT_NAMES = {
142
+ BOOT_START: 'namzu.boot.start',
143
+ CONFIG_RESOLVED: 'namzu.config.resolved',
144
+ SANDBOX_RESOLVED: 'namzu.sandbox.resolved',
145
+ PROVIDER_RESOLVED: 'namzu.provider.resolved',
146
+ CAPABILITY_DETECTED: 'namzu.capability.detected',
147
+ CAPABILITY_BROKEN: 'namzu.capability.broken',
148
+ TELEMETRY_STATUS: 'namzu.telemetry.status',
149
+ MIGRATION_COMPLETED: 'namzu.migration.completed',
150
+ DISCOVERY_COMPLETED: 'namzu.discovery.completed',
151
+ BOOT_REFUSED: 'namzu.boot.refused',
152
+ BOOT_READY: 'namzu.boot.ready',
153
+ } as const
154
+
155
+ export type BootEventName = (typeof BOOT_EVENT_NAMES)[keyof typeof BOOT_EVENT_NAMES]
@@ -149,12 +149,23 @@ export type StreamEventType =
149
149
  | 'run.resuming'
150
150
  | 'iteration.started'
151
151
  | 'iteration.completed'
152
+ /**
153
+ * Who answers when this run asks a human, changed mid-run.
154
+ *
155
+ * Wire-visible for the same reason `compaction.completed` is: an
156
+ * operator watching a live run needs to see supervision loosen, not
157
+ * infer it from approvals that stopped arriving. Names only — the wire
158
+ * cannot carry a handler.
159
+ */
160
+ | 'approval_policy.changed'
152
161
  /**
153
162
  * A compaction pass replaced a span of history with a summary. Wire-
154
163
  * visible because the operation is destructive: a client rendering the
155
164
  * transcript needs to know its middle was dropped, not infer it.
156
165
  */
157
166
  | 'compaction.completed'
167
+ /** Oversized tool results were emptied instead of the history summarized. */
168
+ | 'compaction.tool_results_cleared'
158
169
  | 'compaction.failed'
159
170
  /** A guardrail refused or corrected the run. */
160
171
  | 'guardrail.triggered'
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Old spellings of renamed exports, kept alive for one deprecation window.
3
+ *
4
+ * SemVer's guidance, and this repo's rule, is that a removal is preceded by
5
+ * at least one minor release carrying the deprecation — so a consumer has a
6
+ * version where their code still compiles and warns. These are that version.
7
+ * Nothing in this tree imports from here; every in-tree call site moved to
8
+ * the new name in the same commit that added it, because an alias that the
9
+ * kernel itself still uses is not a deprecation, it is a second name.
10
+ *
11
+ * **Why each pair is written as a `const` plus a `type` rather than
12
+ * `export { New as Old }`.** The re-export form cannot carry a JSDoc tag on
13
+ * the alias: the tag lands on the original declaration or nowhere, so
14
+ * `Registry` would ship with no `@deprecated` marker at all. Nothing would
15
+ * fail — a consumer's editor simply would not strike it through, and the
16
+ * public-surface gate's `deprecated` view would not list it, which is the
17
+ * one place a reviewer looks to confirm a window is actually open. Declaring
18
+ * the pair explicitly puts the tag on a declaration of our own, and the two
19
+ * declarations merge across the value and type namespaces so a name used as
20
+ * both — every class here — keeps working in both positions.
21
+ *
22
+ * So: do not "simplify" these to `export { X as Y }`. It compiles, it passes
23
+ * the tests, and it silently empties the deprecated view.
24
+ */
25
+
26
+ import { AuthorizationGate } from './authorization/gate.js'
27
+ import { collectChatCompletion } from './provider/collect-chat-completion.js'
28
+ import { BaseRegistry } from './registry/BaseRegistry.js'
29
+ import { PromptCache, type PromptCacheConfig } from './runtime/query/prompt-cache.js'
30
+ import { LocalTaskScheduler } from './scheduler/local.js'
31
+
32
+ /**
33
+ * @deprecated Renamed to {@link collectChatCompletion}. Removed in the next
34
+ * major. The old name said nothing about what it collects; it drains a
35
+ * `StreamChunk` iterable into a `ChatCompletionResponse`.
36
+ */
37
+ export const collect = collectChatCompletion
38
+
39
+ /**
40
+ * @deprecated Renamed to {@link BaseRegistry}. Removed in the next major.
41
+ * The bare name read as the general-purpose registry while sitting beside
42
+ * seven domain-qualified siblings in the same barrel; it is the base class.
43
+ */
44
+ export const Registry = BaseRegistry
45
+ /**
46
+ * @deprecated Renamed to {@link BaseRegistry}. Removed in the next major.
47
+ */
48
+ export type Registry<TDefinition> = BaseRegistry<TDefinition>
49
+
50
+ /**
51
+ * @deprecated Renamed to {@link PromptCache}. Removed in the next major. The
52
+ * cluster named one input two ways a single call apart —
53
+ * `new ContextCache(ContextCacheConfig)` then `.getSystemPrompt(PromptCacheInput)`.
54
+ */
55
+ export const ContextCache = PromptCache
56
+ /**
57
+ * @deprecated Renamed to {@link PromptCache}. Removed in the next major.
58
+ */
59
+ export type ContextCache = PromptCache
60
+
61
+ /**
62
+ * @deprecated Renamed to {@link PromptCacheConfig}. Removed in the next major.
63
+ */
64
+ export type ContextCacheConfig = PromptCacheConfig
65
+
66
+ /**
67
+ * @deprecated Renamed to {@link LocalTaskScheduler}. Removed in the next
68
+ * major. It schedules in-process agent tasks; it is not a facade over
69
+ * anything external, which is what "gateway" told a reader to expect.
70
+ */
71
+ export const LocalTaskGateway = LocalTaskScheduler
72
+ /**
73
+ * @deprecated Renamed to {@link LocalTaskScheduler}. Removed in the next major.
74
+ */
75
+ export type LocalTaskGateway = LocalTaskScheduler
76
+
77
+ /**
78
+ * @deprecated Renamed to {@link AuthorizationGate}. Removed in the next
79
+ * major. It decides whether a tool call is permitted before the call runs;
80
+ * it does not verify anything after the fact.
81
+ */
82
+ export const VerificationGate = AuthorizationGate
83
+ /**
84
+ * @deprecated Renamed to {@link AuthorizationGate}. Removed in the next major.
85
+ */
86
+ export type VerificationGate = AuthorizationGate
package/src/eval/judge.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { collect } from '../provider/collect.js'
1
+ import { collectChatCompletion } from '../provider/collect-chat-completion.js'
2
2
  import type { LLMProvider } from '../types/provider/interface.js'
3
3
  import type { EvalCase, EvalRun, Score, Scorer } from './types.js'
4
4
 
@@ -210,7 +210,7 @@ export function judgeScorer(config: JudgeScorerConfig): Scorer {
210
210
  return {
211
211
  name: config.name ?? 'judge',
212
212
  async score(run: EvalRun, evalCase: EvalCase): Promise<Score> {
213
- const response = await collect(
213
+ const response = await collectChatCompletion(
214
214
  config.provider.chatStream({
215
215
  model: config.model,
216
216
  messages: [{ role: 'user', content: buildPrompt(config, run, evalCase, scale) }],
@@ -1,6 +1,8 @@
1
+ import { NAMZU } from '../constants/telemetry/index.js'
1
2
  import type { ExecutionContextLifecycle, ExecutionEnvironment } from '../types/execution/index.js'
2
3
  import { toErrorMessage } from '../utils/error.js'
3
- import { type Logger, getRootLogger } from '../utils/logger.js'
4
+ import { SCOPE_ATTRIBUTE } from '../utils/log/types.js'
5
+ import { type Logger, resolveLogger } from '../utils/logger.js'
4
6
 
5
7
  export interface BaseExecutionEvent {
6
8
  type: string
@@ -18,8 +20,11 @@ export abstract class BaseExecutionContext implements ExecutionContextLifecycle
18
20
  protected ready = false
19
21
  private listeners: ExecutionEventListener[] = []
20
22
 
21
- constructor() {
22
- this.log = getRootLogger().child({ component: this.constructor.name })
23
+ constructor(log?: Logger) {
24
+ this.log = resolveLogger(log).child({
25
+ [SCOPE_ATTRIBUTE]: 'execution/base',
26
+ [NAMZU.EXECUTION_TYPE]: this.constructor.name,
27
+ })
23
28
  }
24
29
 
25
30
  async initialize(): Promise<void> {
@@ -28,11 +33,17 @@ export abstract class BaseExecutionContext implements ExecutionContextLifecycle
28
33
  this.ready = true
29
34
  this.emit({ type: 'context_initialized', contextId: this.id, environment: this.environment })
30
35
  this.emit({ type: 'context_ready', contextId: this.id })
31
- this.log.info(`Execution context initialized: ${this.id} (${this.environment})`)
36
+ this.log.info('Execution context initialized', {
37
+ 'namzu.execution.context_id': this.id,
38
+ 'namzu.execution.environment': this.environment,
39
+ })
32
40
  } catch (err) {
33
41
  const message = toErrorMessage(err)
34
42
  this.emit({ type: 'context_error', contextId: this.id, error: message })
35
- this.log.error(`Execution context initialization failed: ${this.id}`, { error: message })
43
+ this.log.error('Execution context initialization failed', {
44
+ 'namzu.execution.context_id': this.id,
45
+ 'exception.message': message,
46
+ })
36
47
  throw err
37
48
  }
38
49
  }
@@ -47,7 +58,7 @@ export abstract class BaseExecutionContext implements ExecutionContextLifecycle
47
58
  } finally {
48
59
  this.ready = false
49
60
  this.emit({ type: 'context_teardown', contextId: this.id })
50
- this.log.info(`Execution context torn down: ${this.id}`)
61
+ this.log.info('Execution context torn down', { 'namzu.execution.context_id': this.id })
51
62
  }
52
63
  }
53
64
 
@@ -66,7 +77,7 @@ export abstract class BaseExecutionContext implements ExecutionContextLifecycle
66
77
  listener(event)
67
78
  } catch (err) {
68
79
  this.log.error('Execution context event listener error', {
69
- error: toErrorMessage(err),
80
+ 'exception.message': toErrorMessage(err),
70
81
  })
71
82
  }
72
83
  }