@namzu/sdk 59.0.0 → 60.1.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 (370) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/agents/QueryAgent.d.ts.map +1 -1
  3. package/dist/agents/QueryAgent.js +1 -0
  4. package/dist/agents/QueryAgent.js.map +1 -1
  5. package/dist/bridge/a2a/mapper.d.ts.map +1 -1
  6. package/dist/bridge/a2a/mapper.js +16 -0
  7. package/dist/bridge/a2a/mapper.js.map +1 -1
  8. package/dist/bridge/acp/update.d.ts.map +1 -1
  9. package/dist/bridge/acp/update.js +1 -0
  10. package/dist/bridge/acp/update.js.map +1 -1
  11. package/dist/bridge/sse/mapper.d.ts.map +1 -1
  12. package/dist/bridge/sse/mapper.js +12 -0
  13. package/dist/bridge/sse/mapper.js.map +1 -1
  14. package/dist/compaction/context-window.d.ts +53 -0
  15. package/dist/compaction/context-window.d.ts.map +1 -1
  16. package/dist/compaction/context-window.js +141 -2
  17. package/dist/compaction/context-window.js.map +1 -1
  18. package/dist/constants/continuation.d.ts +9 -0
  19. package/dist/constants/continuation.d.ts.map +1 -1
  20. package/dist/constants/continuation.js +9 -0
  21. package/dist/constants/continuation.js.map +1 -1
  22. package/dist/contracts/session/api.d.ts +7 -1
  23. package/dist/contracts/session/api.d.ts.map +1 -1
  24. package/dist/execution/workflow/index.d.ts +3 -1
  25. package/dist/execution/workflow/index.d.ts.map +1 -1
  26. package/dist/execution/workflow/index.js +2 -1
  27. package/dist/execution/workflow/index.js.map +1 -1
  28. package/dist/execution/workflow/journal.d.ts +24 -4
  29. package/dist/execution/workflow/journal.d.ts.map +1 -1
  30. package/dist/execution/workflow/journal.js +131 -9
  31. package/dist/execution/workflow/journal.js.map +1 -1
  32. package/dist/execution/workflow/prelude.d.ts +2 -0
  33. package/dist/execution/workflow/prelude.d.ts.map +1 -1
  34. package/dist/execution/workflow/prelude.js +49 -8
  35. package/dist/execution/workflow/prelude.js.map +1 -1
  36. package/dist/execution/workflow/resume.d.ts +59 -0
  37. package/dist/execution/workflow/resume.d.ts.map +1 -0
  38. package/dist/execution/workflow/resume.js +273 -0
  39. package/dist/execution/workflow/resume.js.map +1 -0
  40. package/dist/execution/workflow/runtime.d.ts.map +1 -1
  41. package/dist/execution/workflow/runtime.js +112 -8
  42. package/dist/execution/workflow/runtime.js.map +1 -1
  43. package/dist/execution/workflow/types.d.ts +105 -1
  44. package/dist/execution/workflow/types.d.ts.map +1 -1
  45. package/dist/index.d.ts +3 -0
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +4 -0
  48. package/dist/index.js.map +1 -1
  49. package/dist/manager/session/turn-recorder.d.ts.map +1 -1
  50. package/dist/manager/session/turn-recorder.js +1 -0
  51. package/dist/manager/session/turn-recorder.js.map +1 -1
  52. package/dist/plugin/compat.d.ts +24 -0
  53. package/dist/plugin/compat.d.ts.map +1 -0
  54. package/dist/plugin/compat.js +149 -0
  55. package/dist/plugin/compat.js.map +1 -0
  56. package/dist/plugin/loader.d.ts +2 -1
  57. package/dist/plugin/loader.d.ts.map +1 -1
  58. package/dist/plugin/loader.js +6 -0
  59. package/dist/plugin/loader.js.map +1 -1
  60. package/dist/pricing/index.d.ts.map +1 -1
  61. package/dist/pricing/index.js +2 -1
  62. package/dist/pricing/index.js.map +1 -1
  63. package/dist/process/kill-tree.d.ts +44 -0
  64. package/dist/process/kill-tree.d.ts.map +1 -1
  65. package/dist/process/kill-tree.js +102 -4
  66. package/dist/process/kill-tree.js.map +1 -1
  67. package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
  68. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  69. package/dist/prompt/coding-agent-doctrine.js +9 -1
  70. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  71. package/dist/provider/collect-chat-completion.d.ts.map +1 -1
  72. package/dist/provider/collect-chat-completion.js +4 -0
  73. package/dist/provider/collect-chat-completion.js.map +1 -1
  74. package/dist/provider/fallback.d.ts.map +1 -1
  75. package/dist/provider/fallback.js +11 -0
  76. package/dist/provider/fallback.js.map +1 -1
  77. package/dist/provider/idle-timeout.d.ts.map +1 -1
  78. package/dist/provider/idle-timeout.js +5 -0
  79. package/dist/provider/idle-timeout.js.map +1 -1
  80. package/dist/provider/mock.d.ts +2 -0
  81. package/dist/provider/mock.d.ts.map +1 -1
  82. package/dist/provider/mock.js +16 -8
  83. package/dist/provider/mock.js.map +1 -1
  84. package/dist/provider/model-window-suffix.d.ts +18 -0
  85. package/dist/provider/model-window-suffix.d.ts.map +1 -0
  86. package/dist/provider/model-window-suffix.js +78 -0
  87. package/dist/provider/model-window-suffix.js.map +1 -0
  88. package/dist/provider/retry.d.ts.map +1 -1
  89. package/dist/provider/retry.js +5 -0
  90. package/dist/provider/retry.js.map +1 -1
  91. package/dist/public-runtime.d.ts +5 -3
  92. package/dist/public-runtime.d.ts.map +1 -1
  93. package/dist/public-runtime.js +5 -4
  94. package/dist/public-runtime.js.map +1 -1
  95. package/dist/public-types.d.ts +1 -0
  96. package/dist/public-types.d.ts.map +1 -1
  97. package/dist/registry/command/kernel-commands.d.ts +1 -4
  98. package/dist/registry/command/kernel-commands.d.ts.map +1 -1
  99. package/dist/registry/command/kernel-commands.js +0 -28
  100. package/dist/registry/command/kernel-commands.js.map +1 -1
  101. package/dist/runtime/jobs/awaited-jobs.d.ts +6 -0
  102. package/dist/runtime/jobs/awaited-jobs.d.ts.map +1 -1
  103. package/dist/runtime/jobs/awaited-jobs.js +11 -0
  104. package/dist/runtime/jobs/awaited-jobs.js.map +1 -1
  105. package/dist/runtime/jobs/host-exit-finalizer.d.ts +20 -0
  106. package/dist/runtime/jobs/host-exit-finalizer.d.ts.map +1 -0
  107. package/dist/runtime/jobs/host-exit-finalizer.js +57 -0
  108. package/dist/runtime/jobs/host-exit-finalizer.js.map +1 -0
  109. package/dist/runtime/jobs/liveness.d.ts +67 -0
  110. package/dist/runtime/jobs/liveness.d.ts.map +1 -0
  111. package/dist/runtime/jobs/liveness.js +94 -0
  112. package/dist/runtime/jobs/liveness.js.map +1 -0
  113. package/dist/runtime/jobs/registry.d.ts +21 -0
  114. package/dist/runtime/jobs/registry.d.ts.map +1 -1
  115. package/dist/runtime/jobs/registry.js +104 -2
  116. package/dist/runtime/jobs/registry.js.map +1 -1
  117. package/dist/runtime/jobs/wake-budget.d.ts +35 -0
  118. package/dist/runtime/jobs/wake-budget.d.ts.map +1 -0
  119. package/dist/runtime/jobs/wake-budget.js +48 -0
  120. package/dist/runtime/jobs/wake-budget.js.map +1 -0
  121. package/dist/runtime/query/detached-calls.d.ts +65 -0
  122. package/dist/runtime/query/detached-calls.d.ts.map +1 -0
  123. package/dist/runtime/query/detached-calls.js +116 -0
  124. package/dist/runtime/query/detached-calls.js.map +1 -0
  125. package/dist/runtime/query/executor.d.ts +4 -1
  126. package/dist/runtime/query/executor.d.ts.map +1 -1
  127. package/dist/runtime/query/executor.js +90 -6
  128. package/dist/runtime/query/executor.js.map +1 -1
  129. package/dist/runtime/query/index.d.ts +34 -0
  130. package/dist/runtime/query/index.d.ts.map +1 -1
  131. package/dist/runtime/query/index.js +32 -5
  132. package/dist/runtime/query/index.js.map +1 -1
  133. package/dist/runtime/query/iteration/effort-clamp.d.ts +13 -0
  134. package/dist/runtime/query/iteration/effort-clamp.d.ts.map +1 -0
  135. package/dist/runtime/query/iteration/effort-clamp.js +42 -0
  136. package/dist/runtime/query/iteration/effort-clamp.js.map +1 -0
  137. package/dist/runtime/query/iteration/index.d.ts +34 -0
  138. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  139. package/dist/runtime/query/iteration/index.js +199 -6
  140. package/dist/runtime/query/iteration/index.js.map +1 -1
  141. package/dist/runtime/query/iteration/outstanding-work.d.ts.map +1 -1
  142. package/dist/runtime/query/iteration/outstanding-work.js +11 -3
  143. package/dist/runtime/query/iteration/outstanding-work.js.map +1 -1
  144. package/dist/runtime/query/iteration/phases/context.d.ts +9 -0
  145. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  146. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  147. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  148. package/dist/runtime/query/iteration/phases/tool-review.js +63 -1
  149. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  150. package/dist/runtime/query/iteration/stream-turn.d.ts.map +1 -1
  151. package/dist/runtime/query/iteration/stream-turn.js +6 -0
  152. package/dist/runtime/query/iteration/stream-turn.js.map +1 -1
  153. package/dist/runtime/query/session-storage.d.ts.map +1 -1
  154. package/dist/runtime/query/session-storage.js +8 -3
  155. package/dist/runtime/query/session-storage.js.map +1 -1
  156. package/dist/runtime/query/steering.d.ts +29 -3
  157. package/dist/runtime/query/steering.d.ts.map +1 -1
  158. package/dist/runtime/query/steering.js +58 -3
  159. package/dist/runtime/query/steering.js.map +1 -1
  160. package/dist/runtime/query/tooling.d.ts +1 -0
  161. package/dist/runtime/query/tooling.d.ts.map +1 -1
  162. package/dist/runtime/query/tooling.js +1 -0
  163. package/dist/runtime/query/tooling.js.map +1 -1
  164. package/dist/runtime/system-events.d.ts +5 -0
  165. package/dist/runtime/system-events.d.ts.map +1 -1
  166. package/dist/runtime/system-events.js +7 -1
  167. package/dist/runtime/system-events.js.map +1 -1
  168. package/dist/sandbox/denial.d.ts +11 -0
  169. package/dist/sandbox/denial.d.ts.map +1 -0
  170. package/dist/sandbox/denial.js +61 -0
  171. package/dist/sandbox/denial.js.map +1 -0
  172. package/dist/sandbox/file-walk-program.d.ts.map +1 -1
  173. package/dist/sandbox/file-walk-program.js +31 -13
  174. package/dist/sandbox/file-walk-program.js.map +1 -1
  175. package/dist/sandbox/file-walk.d.ts +2 -0
  176. package/dist/sandbox/file-walk.d.ts.map +1 -1
  177. package/dist/sandbox/file-walk.js +64 -13
  178. package/dist/sandbox/file-walk.js.map +1 -1
  179. package/dist/sandbox/ignore-matcher.d.ts +30 -0
  180. package/dist/sandbox/ignore-matcher.d.ts.map +1 -0
  181. package/dist/sandbox/ignore-matcher.js +11 -0
  182. package/dist/sandbox/ignore-matcher.js.map +1 -0
  183. package/dist/sandbox/ignore-source.d.ts +26 -0
  184. package/dist/sandbox/ignore-source.d.ts.map +1 -0
  185. package/dist/sandbox/ignore-source.js +221 -0
  186. package/dist/sandbox/ignore-source.js.map +1 -0
  187. package/dist/sandbox/provider/local.d.ts.map +1 -1
  188. package/dist/sandbox/provider/local.js +11 -1
  189. package/dist/sandbox/provider/local.js.map +1 -1
  190. package/dist/scheduler/completion-inbox.d.ts.map +1 -1
  191. package/dist/scheduler/completion-inbox.js +1 -0
  192. package/dist/scheduler/completion-inbox.js.map +1 -1
  193. package/dist/session/log-hash.d.ts.map +1 -1
  194. package/dist/session/log-hash.js +18 -1
  195. package/dist/session/log-hash.js.map +1 -1
  196. package/dist/store/memory/disk.d.ts.map +1 -1
  197. package/dist/store/memory/disk.js +1 -1
  198. package/dist/store/memory/disk.js.map +1 -1
  199. package/dist/store/memory/markdown.d.ts.map +1 -1
  200. package/dist/store/memory/markdown.js +1 -1
  201. package/dist/store/memory/markdown.js.map +1 -1
  202. package/dist/store/memory/operation-lock.d.ts +20 -4
  203. package/dist/store/memory/operation-lock.d.ts.map +1 -1
  204. package/dist/store/memory/operation-lock.js +235 -58
  205. package/dist/store/memory/operation-lock.js.map +1 -1
  206. package/dist/store/session-index/sqlite.d.ts.map +1 -1
  207. package/dist/store/session-index/sqlite.js +169 -16
  208. package/dist/store/session-index/sqlite.js.map +1 -1
  209. package/dist/tools/builtins/bash.d.ts.map +1 -1
  210. package/dist/tools/builtins/bash.js +10 -4
  211. package/dist/tools/builtins/bash.js.map +1 -1
  212. package/dist/tools/builtins/computer-use.d.ts +35 -0
  213. package/dist/tools/builtins/computer-use.d.ts.map +1 -1
  214. package/dist/tools/builtins/computer-use.js +512 -67
  215. package/dist/tools/builtins/computer-use.js.map +1 -1
  216. package/dist/tools/builtins/glob.d.ts +1 -0
  217. package/dist/tools/builtins/glob.d.ts.map +1 -1
  218. package/dist/tools/builtins/glob.js +65 -28
  219. package/dist/tools/builtins/glob.js.map +1 -1
  220. package/dist/tools/builtins/grep.d.ts +2 -0
  221. package/dist/tools/builtins/grep.d.ts.map +1 -1
  222. package/dist/tools/builtins/grep.js +94 -40
  223. package/dist/tools/builtins/grep.js.map +1 -1
  224. package/dist/tools/builtins/job.d.ts +1 -1
  225. package/dist/tools/builtins/job.d.ts.map +1 -1
  226. package/dist/tools/builtins/job.js +34 -7
  227. package/dist/tools/builtins/job.js.map +1 -1
  228. package/dist/tools/builtins/search-support.d.ts +44 -0
  229. package/dist/tools/builtins/search-support.d.ts.map +1 -0
  230. package/dist/tools/builtins/search-support.js +89 -0
  231. package/dist/tools/builtins/search-support.js.map +1 -0
  232. package/dist/tools/builtins/wait-for-job-bounds.d.ts +2 -0
  233. package/dist/tools/builtins/wait-for-job-bounds.d.ts.map +1 -1
  234. package/dist/tools/builtins/wait-for-job-bounds.js +3 -1
  235. package/dist/tools/builtins/wait-for-job-bounds.js.map +1 -1
  236. package/dist/tools/builtins/wait-for-job.d.ts +1 -1
  237. package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
  238. package/dist/tools/builtins/wait-for-job.js +13 -2
  239. package/dist/tools/builtins/wait-for-job.js.map +1 -1
  240. package/dist/tools/command-shell.d.ts.map +1 -1
  241. package/dist/tools/command-shell.js +14 -5
  242. package/dist/tools/command-shell.js.map +1 -1
  243. package/dist/turn/reporter.d.ts.map +1 -1
  244. package/dist/turn/reporter.js +11 -0
  245. package/dist/turn/reporter.js.map +1 -1
  246. package/dist/types/agent/query.d.ts +2 -0
  247. package/dist/types/agent/query.d.ts.map +1 -1
  248. package/dist/types/computer-use/index.d.ts +129 -13
  249. package/dist/types/computer-use/index.d.ts.map +1 -1
  250. package/dist/types/computer-use/index.js.map +1 -1
  251. package/dist/types/message/index.d.ts +1 -1
  252. package/dist/types/message/index.d.ts.map +1 -1
  253. package/dist/types/message/index.js +1 -0
  254. package/dist/types/message/index.js.map +1 -1
  255. package/dist/types/plugin/index.d.ts +24 -0
  256. package/dist/types/plugin/index.d.ts.map +1 -1
  257. package/dist/types/plugin/index.js +4 -0
  258. package/dist/types/plugin/index.js.map +1 -1
  259. package/dist/types/provider/chat.d.ts +19 -0
  260. package/dist/types/provider/chat.d.ts.map +1 -1
  261. package/dist/types/provider/config.d.ts +7 -0
  262. package/dist/types/provider/config.d.ts.map +1 -1
  263. package/dist/types/provider/index.d.ts +1 -1
  264. package/dist/types/provider/index.d.ts.map +1 -1
  265. package/dist/types/provider/interface.d.ts +15 -0
  266. package/dist/types/provider/interface.d.ts.map +1 -1
  267. package/dist/types/provider/stream.d.ts +6 -0
  268. package/dist/types/provider/stream.d.ts.map +1 -1
  269. package/dist/types/sandbox/index.d.ts +38 -1
  270. package/dist/types/sandbox/index.d.ts.map +1 -1
  271. package/dist/types/sandbox/index.js.map +1 -1
  272. package/dist/types/session/events.d.ts +34 -0
  273. package/dist/types/session/events.d.ts.map +1 -1
  274. package/dist/types/session/events.js.map +1 -1
  275. package/dist/types/session/records.d.ts +298 -34
  276. package/dist/types/session/records.d.ts.map +1 -1
  277. package/dist/types/session/records.js +35 -1
  278. package/dist/types/session/records.js.map +1 -1
  279. package/dist/types/session/stop-reason.d.ts +11 -0
  280. package/dist/types/session/stop-reason.d.ts.map +1 -1
  281. package/dist/types/tool/index.d.ts +30 -0
  282. package/dist/types/tool/index.d.ts.map +1 -1
  283. package/dist/types/tool/index.js.map +1 -1
  284. package/dist/types/tool/presentation.d.ts +8 -0
  285. package/dist/types/tool/presentation.d.ts.map +1 -1
  286. package/package.json +1 -1
  287. package/src/agents/QueryAgent.ts +1 -0
  288. package/src/bridge/a2a/mapper.ts +19 -0
  289. package/src/bridge/acp/update.ts +6 -1
  290. package/src/bridge/sse/mapper.ts +13 -0
  291. package/src/compaction/context-window.ts +163 -2
  292. package/src/constants/continuation.ts +13 -0
  293. package/src/contracts/session/api.ts +6 -0
  294. package/src/execution/workflow/index.ts +14 -1
  295. package/src/execution/workflow/journal.ts +161 -11
  296. package/src/execution/workflow/prelude.ts +51 -8
  297. package/src/execution/workflow/resume.ts +313 -0
  298. package/src/execution/workflow/runtime.ts +127 -9
  299. package/src/execution/workflow/types.ts +109 -1
  300. package/src/index.ts +17 -0
  301. package/src/manager/session/turn-recorder.ts +1 -0
  302. package/src/plugin/compat.ts +173 -0
  303. package/src/plugin/loader.ts +7 -1
  304. package/src/pricing/index.ts +2 -1
  305. package/src/process/kill-tree.ts +106 -4
  306. package/src/prompt/coding-agent-doctrine.ts +9 -1
  307. package/src/provider/collect-chat-completion.ts +3 -0
  308. package/src/provider/fallback.ts +17 -0
  309. package/src/provider/idle-timeout.ts +9 -0
  310. package/src/provider/mock.ts +19 -9
  311. package/src/provider/model-window-suffix.ts +85 -0
  312. package/src/provider/retry.ts +9 -0
  313. package/src/public-runtime.ts +21 -2
  314. package/src/public-types.ts +1 -0
  315. package/src/registry/command/kernel-commands.ts +1 -32
  316. package/src/runtime/jobs/awaited-jobs.ts +11 -0
  317. package/src/runtime/jobs/host-exit-finalizer.ts +67 -0
  318. package/src/runtime/jobs/liveness.ts +144 -0
  319. package/src/runtime/jobs/registry.ts +114 -2
  320. package/src/runtime/jobs/wake-budget.ts +55 -0
  321. package/src/runtime/query/detached-calls.ts +135 -0
  322. package/src/runtime/query/executor.ts +92 -10
  323. package/src/runtime/query/index.ts +65 -7
  324. package/src/runtime/query/iteration/effort-clamp.ts +46 -0
  325. package/src/runtime/query/iteration/index.ts +260 -6
  326. package/src/runtime/query/iteration/outstanding-work.ts +12 -3
  327. package/src/runtime/query/iteration/phases/context.ts +9 -0
  328. package/src/runtime/query/iteration/phases/tool-review.ts +73 -8
  329. package/src/runtime/query/iteration/stream-turn.ts +5 -0
  330. package/src/runtime/query/session-storage.ts +8 -3
  331. package/src/runtime/query/steering.ts +77 -6
  332. package/src/runtime/query/tooling.ts +2 -0
  333. package/src/runtime/system-events.ts +12 -1
  334. package/src/sandbox/denial.ts +79 -0
  335. package/src/sandbox/file-walk-program.ts +32 -13
  336. package/src/sandbox/file-walk.ts +75 -12
  337. package/src/sandbox/ignore-matcher.ts +46 -0
  338. package/src/sandbox/ignore-source.ts +220 -0
  339. package/src/sandbox/provider/local.ts +11 -1
  340. package/src/scheduler/completion-inbox.ts +1 -0
  341. package/src/session/log-hash.ts +21 -0
  342. package/src/store/memory/disk.ts +1 -0
  343. package/src/store/memory/markdown.ts +1 -0
  344. package/src/store/memory/operation-lock.ts +288 -57
  345. package/src/store/session-index/sqlite.ts +171 -16
  346. package/src/tools/builtins/bash.ts +11 -4
  347. package/src/tools/builtins/computer-use.ts +593 -68
  348. package/src/tools/builtins/glob.ts +79 -32
  349. package/src/tools/builtins/grep.ts +107 -43
  350. package/src/tools/builtins/job.ts +42 -12
  351. package/src/tools/builtins/search-support.ts +107 -0
  352. package/src/tools/builtins/wait-for-job-bounds.ts +5 -1
  353. package/src/tools/builtins/wait-for-job.ts +14 -2
  354. package/src/tools/command-shell.ts +13 -5
  355. package/src/turn/reporter.ts +12 -0
  356. package/src/types/agent/query.ts +2 -0
  357. package/src/types/computer-use/index.ts +157 -15
  358. package/src/types/message/index.ts +5 -3
  359. package/src/types/plugin/index.ts +8 -0
  360. package/src/types/provider/chat.ts +20 -0
  361. package/src/types/provider/config.ts +7 -0
  362. package/src/types/provider/index.ts +1 -0
  363. package/src/types/provider/interface.ts +20 -0
  364. package/src/types/provider/stream.ts +6 -0
  365. package/src/types/sandbox/index.ts +40 -1
  366. package/src/types/session/events.ts +65 -5
  367. package/src/types/session/records.ts +39 -2
  368. package/src/types/session/stop-reason.ts +11 -0
  369. package/src/types/tool/index.ts +30 -0
  370. package/src/types/tool/presentation.ts +8 -0
@@ -28,7 +28,7 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
28
28
  }
29
29
  function phase(title) {
30
30
  var t = clean(title, 120);
31
- if (!t) throw new TypeError('phase() needs a non-empty title.');
31
+ if (!t) throw misuse('phase() needs a non-empty title.');
32
32
  cursor = t;
33
33
  emit({ k: 'phase', title: t });
34
34
  }
@@ -53,13 +53,26 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
53
53
  return e;
54
54
  }
55
55
  function isBudgetError(e) { return !!e && e.name === 'WorkflowBudgetExceededError'; }
56
+ function misuse(message) {
57
+ var e = new TypeError(message);
58
+ e.workflowMisuse = true;
59
+ return e;
60
+ }
61
+ function isMisuse(e) { return !!e && e.workflowMisuse === true; }
62
+ var optionNames = ['label', 'phase', 'schema', 'agentType', 'model', 'effort'];
56
63
  async function agent(prompt, opts) {
57
64
  if (typeof prompt !== 'string' || prompt.length === 0) {
58
- throw new TypeError('agent(prompt, options?): the prompt must be a non-empty string, got ' + kind(prompt));
65
+ throw misuse('agent(prompt, options?): the prompt must be a non-empty string, got ' + kind(prompt));
59
66
  }
60
67
  var o = opts == null ? {} : opts;
61
68
  if (typeof o !== 'object' || Array.isArray(o)) {
62
- throw new TypeError('agent(prompt, options?): options must be an object, got ' + kind(o));
69
+ throw misuse('agent(prompt, options?): options must be an object, got ' + kind(o));
70
+ }
71
+ var unknown = Object.keys(o).filter(function (k) { return optionNames.indexOf(k) < 0; });
72
+ if (unknown.length > 0) {
73
+ // Ignored, as it always was, but no longer silently: a saved script that
74
+ // misspells an option keeps running and the line says why it had no effect.
75
+ log('agent(prompt, options?): ignoring unknown option "' + unknown[0] + '"; the options are ' + optionNames.join(', ') + '.');
63
76
  }
64
77
  if (overBudget()) throw budgetError();
65
78
  var request = { prompt: prompt, cursor: cursor };
@@ -69,23 +82,32 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
69
82
  if (o.agentType != null) request.agentType = clean(o.agentType, 120);
70
83
  if (o.model != null) request.model = clean(o.model, 120);
71
84
  if (o.effort != null) request.effort = clean(o.effort, 32);
72
- var reply = await rawCall('agent', request);
85
+ var reply;
86
+ try {
87
+ reply = await rawCall('agent', request);
88
+ } catch (e) {
89
+ // The host rejects a malformed request with an "agent(): ..." message;
90
+ // that is the script's mistake, not a failed child.
91
+ if (e && typeof e.message === 'string' && e.message.indexOf('agent(): ') === 0) throw misuse(e.message);
92
+ throw e;
93
+ }
73
94
  spent.tokensUsed = reply.t;
74
95
  return reply.v;
75
96
  }
76
97
  async function parallel(thunks) {
77
98
  if (!Array.isArray(thunks)) {
78
- throw new TypeError('parallel(thunks): the argument must be an array of functions, got ' + kind(thunks));
99
+ throw misuse('parallel(thunks): the argument must be an array of functions, got ' + kind(thunks));
79
100
  }
80
101
  for (var p = 0; p < thunks.length; p++) {
81
102
  if (typeof thunks[p] !== 'function') {
82
- throw new TypeError('parallel(thunks): item ' + (p + 1) + ' must be a function (wrap the work as () => agent(...)), got ' + kind(thunks[p]));
103
+ throw misuse('parallel(thunks): item ' + (p + 1) + ' must be a function (wrap the work as () => agent(...)), got ' + kind(thunks[p]));
83
104
  }
84
105
  }
85
106
  var dropped = 0;
86
107
  var results = await Promise.all(thunks.map(function (t, n) {
87
108
  return Promise.resolve().then(t).catch(function (e) {
88
109
  if (isBudgetError(e)) { dropped++; return null; }
110
+ if (isMisuse(e)) throw e;
89
111
  log('Step ' + (n + 1) + ' stopped: ' + clean(e && e.message ? e.message : e, 300));
90
112
  return null;
91
113
  });
@@ -95,12 +117,12 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
95
117
  }
96
118
  async function pipeline(items) {
97
119
  if (!Array.isArray(items)) {
98
- throw new TypeError('pipeline(items, ...stages): the first argument must be an array, got ' + kind(items));
120
+ throw misuse('pipeline(items, ...stages): the first argument must be an array, got ' + kind(items));
99
121
  }
100
122
  var stages = Array.prototype.slice.call(arguments, 1);
101
123
  for (var s = 0; s < stages.length; s++) {
102
124
  if (typeof stages[s] !== 'function') {
103
- throw new TypeError('pipeline(items, ...stages): stage ' + (s + 1) + ' must be a function, got ' + kind(stages[s]));
125
+ throw misuse('pipeline(items, ...stages): stage ' + (s + 1) + ' must be a function, got ' + kind(stages[s]));
104
126
  }
105
127
  }
106
128
  if (items.length > 0 && overBudget()) throw budgetError();
@@ -112,6 +134,7 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
112
134
  value = await stages[i](value, item, index);
113
135
  } catch (e) {
114
136
  if (isBudgetError(e)) { dropped++; return null; }
137
+ if (isMisuse(e)) throw e;
115
138
  log('Item ' + (index + 1) + ' stopped at step ' + (i + 1) + ': ' + clean(e && e.message ? e.message : e, 300));
116
139
  return null;
117
140
  }
@@ -141,6 +164,24 @@ const PRELUDE_SOURCE = String.raw `(function (config) {
141
164
  install('log', log);
142
165
  install('budget', budget);
143
166
  install('args', config.args);
167
+ if (config.deterministic) {
168
+ var RealDate = Date;
169
+ var clockMessage = 'Date.now() / new Date() are unavailable in workflow scripts (breaks resume). Stamp results after the workflow returns, or pass timestamps through args.';
170
+ var randomMessage = 'Math.random() is unavailable in workflow scripts (breaks resume). For N independent samples, include the index in the agent label or prompt.';
171
+ var ShimDate = function Date(a, b, c, d, e, f, g) {
172
+ if (!new.target || arguments.length === 0) throw new Error(clockMessage);
173
+ return Reflect.construct(RealDate, Array.prototype.slice.call(arguments), new.target === ShimDate ? RealDate : new.target);
174
+ };
175
+ Object.defineProperty(ShimDate, 'prototype', { value: RealDate.prototype, writable: false, configurable: false });
176
+ Object.defineProperty(ShimDate, 'now', { value: function now() { throw new Error(clockMessage); }, writable: false, configurable: false });
177
+ Object.defineProperty(ShimDate, 'parse', { value: RealDate.parse, writable: false, configurable: false });
178
+ Object.defineProperty(ShimDate, 'UTC', { value: RealDate.UTC, writable: false, configurable: false });
179
+ Object.defineProperty(RealDate.prototype, 'constructor', { value: ShimDate, writable: false, configurable: false });
180
+ Object.defineProperty(globalThis, 'Date', { value: ShimDate, writable: false, configurable: false, enumerable: false });
181
+ Object.defineProperty(Math, 'random', { value: function random() { throw new Error(randomMessage); }, writable: false, configurable: false });
182
+ try { delete globalThis.eval; } catch (ignored) {}
183
+ Object.freeze(RealDate);
184
+ }
144
185
  })`;
145
186
  /**
146
187
  * Lines the prelude occupies in the interpreter source, plus the newline that
@@ -1 +1 @@
1
- {"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../../src/execution/workflow/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgI9B,CAAA;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAGhC;IACA,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAA;AAC/C,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,YAAY,CAAC,MAG5B;IACA,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SACpC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;SAClC,IAAI,CAAC,SAAS,CAAC;SACf,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;SAClC,IAAI,CAAC,SAAS,CAAC,CAAA;IACjB,OAAO,GAAG,cAAc,IAAI,OAAO,IAAI,CAAA;AACxC,CAAC"}
1
+ {"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../../src/execution/workflow/prelude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyK9B,CAAA;AAEH;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAIhC;IACA,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAA;AAC/C,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,YAAY,CAAC,MAI5B;IACA,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SACpC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;SAClC,IAAI,CAAC,SAAS,CAAC;SACf,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;SAClC,IAAI,CAAC,SAAS,CAAC,CAAA;IACjB,OAAO,GAAG,cAAc,IAAI,OAAO,IAAI,CAAA;AACxC,CAAC"}
@@ -0,0 +1,59 @@
1
+ import type { CheckedWorkflowJournal, WorkflowJournalRecord, WorkflowResumeState } from './types.js';
2
+ /** What of an `agent()` call decides its result. `label`, `phase` and progress callbacks do not. */
3
+ export interface WorkflowCallIdentity {
4
+ readonly schema?: unknown;
5
+ readonly model?: string;
6
+ readonly effort?: string;
7
+ readonly agentType?: string;
8
+ }
9
+ /**
10
+ * The key a call is saved and looked up under: the prompt, the options that
11
+ * change what the agent does (schema, model, effort, agent type) and how many
12
+ * identical calls came before it in the same pass. Each part is length-prefixed
13
+ * so one cannot be read as part of another.
14
+ */
15
+ export declare function workflowCallKey(prompt: string, call: WorkflowCallIdentity, ordinal: number): string;
16
+ /**
17
+ * What makes two calls the same call: the prompt and the options that change
18
+ * the agent, in a form where key order and `undefined` do not matter. The
19
+ * runtime counts repeats of this text to give identical calls distinct slots,
20
+ * and the key hashes the same text, so the two can never disagree.
21
+ */
22
+ export declare function workflowCallContent(prompt: string, call: WorkflowCallIdentity): string;
23
+ /** The hash the first line of a run's journal chains from. It binds the file to its run id. */
24
+ export declare function workflowJournalSeed(runId: string): string;
25
+ /** The hash a line contributes to the next one: its exact bytes, newline included. */
26
+ export declare function workflowJournalLineHash(line: string): string;
27
+ /** The line `record` is written as. With a key, a `mac` over the rest of the line is added last. */
28
+ export declare function formatWorkflowJournalLine(record: WorkflowJournalRecord, seq: number, prev: string, key?: string | Uint8Array): string;
29
+ /**
30
+ * Reads a journal's text and keeps only the records that can be trusted.
31
+ *
32
+ * Every line carries `seq` (counting trusted lines from 1) and `prev` (the hash
33
+ * of the line before; the first chains from a seed bound to the run id). A
34
+ * line that does not chain, a line that does not parse, and anything after
35
+ * one is dropped until a `run_started` of a resumed pass picks the chain up
36
+ * again at the last trusted line. A last line without its newline that is not
37
+ * whole JSON is a torn write and is ignored; one that is whole JSON is read
38
+ * like any other line. The file is never rewritten.
39
+ *
40
+ * The chain alone cannot notice an edit to the final line (nothing chains from
41
+ * it yet). With `key`, every line must also carry a `mac` made with that
42
+ * secret, which closes that gap against anyone who does not hold the key.
43
+ */
44
+ export declare function readWorkflowJournalChecked(text: string, runId: string, options?: {
45
+ readonly key?: string | Uint8Array;
46
+ }): CheckedWorkflowJournal;
47
+ /**
48
+ * Folds a checked journal into what a resumed pass needs.
49
+ *
50
+ * The last saved result for a key wins. An agent that was asked for again
51
+ * after a result was saved gives that result up until it finishes again. A
52
+ * failed or skipped outcome removes the result and marks the key failed; an
53
+ * outcome the run recorded as interrupted (stopped, not failed) leaves the key
54
+ * as seen but unfinished. Lines marked `cached` repeat an earlier result and
55
+ * are skipped, and so is any agent record from a pass older than the latest
56
+ * `run_started`, which a slow agent of an earlier pass can still write.
57
+ */
58
+ export declare function loadWorkflowResume(checked: CheckedWorkflowJournal): WorkflowResumeState;
59
+ //# sourceMappingURL=resume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow/resume.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,sBAAsB,EAEtB,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,YAAY,CAAA;AAsBnB,oGAAoG;AACpG,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,MAAM,GACb,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAQtF;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,sFAAsF;AACtF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,oGAAoG;AACpG,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,qBAAqB,EAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,GACvB,MAAM,CAKR;AAqBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CAAO,GAClD,sBAAsB,CAgFxB;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,mBAAmB,CAsFvF"}
@@ -0,0 +1,273 @@
1
+ import { createHash, createHmac, timingSafeEqual } from 'node:crypto';
2
+ /** The key version. A change to how keys are made bumps it, so old keys simply never match. */
3
+ const KEY_VERSION = 'k1';
4
+ function sha256Hex(text) {
5
+ return createHash('sha256').update(text).digest('hex');
6
+ }
7
+ /** JSON with every object's keys sorted and `__proto__` dropped, so equal values give equal text. */
8
+ function canonicalJson(value) {
9
+ if (Array.isArray(value))
10
+ return `[${value.map((item) => canonicalJson(item)).join(',')}]`;
11
+ if (typeof value === 'object' && value !== null) {
12
+ const record = value;
13
+ const keys = Object.keys(record)
14
+ .filter((key) => key !== '__proto__' && record[key] !== undefined)
15
+ .sort();
16
+ return `{${keys.map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(',')}}`;
17
+ }
18
+ return JSON.stringify(value) ?? 'null';
19
+ }
20
+ /**
21
+ * The key a call is saved and looked up under: the prompt, the options that
22
+ * change what the agent does (schema, model, effort, agent type) and how many
23
+ * identical calls came before it in the same pass. Each part is length-prefixed
24
+ * so one cannot be read as part of another.
25
+ */
26
+ export function workflowCallKey(prompt, call, ordinal) {
27
+ return `${KEY_VERSION}:${sha256Hex(`${workflowCallContent(prompt, call)}${ordinal}`)}`;
28
+ }
29
+ /**
30
+ * What makes two calls the same call: the prompt and the options that change
31
+ * the agent, in a form where key order and `undefined` do not matter. The
32
+ * runtime counts repeats of this text to give identical calls distinct slots,
33
+ * and the key hashes the same text, so the two can never disagree.
34
+ */
35
+ export function workflowCallContent(prompt, call) {
36
+ const options = canonicalJson({
37
+ schema: call.schema,
38
+ model: call.model,
39
+ effort: call.effort,
40
+ agentType: call.agentType,
41
+ });
42
+ return `${prompt.length}:${prompt}${options.length}:${options}`;
43
+ }
44
+ /** The hash the first line of a run's journal chains from. It binds the file to its run id. */
45
+ export function workflowJournalSeed(runId) {
46
+ return sha256Hex(`namzu-workflow-journal\0${runId}`);
47
+ }
48
+ /** The hash a line contributes to the next one: its exact bytes, newline included. */
49
+ export function workflowJournalLineHash(line) {
50
+ return sha256Hex(`${line}\n`);
51
+ }
52
+ /** The line `record` is written as. With a key, a `mac` over the rest of the line is added last. */
53
+ export function formatWorkflowJournalLine(record, seq, prev, key) {
54
+ const body = { seq, prev, ...record };
55
+ if (key === undefined)
56
+ return JSON.stringify(body);
57
+ const mac = createHmac('sha256', key).update(JSON.stringify(body)).digest('hex');
58
+ return JSON.stringify({ ...body, mac });
59
+ }
60
+ function macMatches(record, key) {
61
+ const { mac, ...rest } = record;
62
+ if (typeof mac !== 'string')
63
+ return false;
64
+ const expected = createHmac('sha256', key).update(JSON.stringify(rest)).digest();
65
+ const actual = Buffer.from(mac, 'hex');
66
+ return actual.length === expected.length && timingSafeEqual(actual, expected);
67
+ }
68
+ function parseLine(line) {
69
+ try {
70
+ const value = JSON.parse(line);
71
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
72
+ ? value
73
+ : undefined;
74
+ }
75
+ catch {
76
+ return undefined;
77
+ }
78
+ }
79
+ /**
80
+ * Reads a journal's text and keeps only the records that can be trusted.
81
+ *
82
+ * Every line carries `seq` (counting trusted lines from 1) and `prev` (the hash
83
+ * of the line before; the first chains from a seed bound to the run id). A
84
+ * line that does not chain, a line that does not parse, and anything after
85
+ * one is dropped until a `run_started` of a resumed pass picks the chain up
86
+ * again at the last trusted line. A last line without its newline that is not
87
+ * whole JSON is a torn write and is ignored; one that is whole JSON is read
88
+ * like any other line. The file is never rewritten.
89
+ *
90
+ * The chain alone cannot notice an edit to the final line (nothing chains from
91
+ * it yet). With `key`, every line must also carry a `mac` made with that
92
+ * secret, which closes that gap against anyone who does not hold the key.
93
+ */
94
+ export function readWorkflowJournalChecked(text, runId, options = {}) {
95
+ const endsWithNewline = text === '' || text.endsWith('\n');
96
+ const pieces = text.split('\n');
97
+ const fragment = endsWithNewline ? undefined : pieces.pop();
98
+ if (endsWithNewline)
99
+ pieces.pop();
100
+ // A last line without its newline that is whole JSON was only missing the newline: it is
101
+ // judged like any other line (the writer adds the newline before the next record, so the
102
+ // hash it contributes is the one of the line with its newline). Anything else is a torn write.
103
+ const wholeFragment = fragment !== undefined && fragment !== '' && parseLine(fragment) !== undefined;
104
+ if (wholeFragment)
105
+ pieces.push(fragment);
106
+ const tornTail = fragment !== undefined && fragment !== '' && !wholeFragment;
107
+ const parsed = pieces.map((line) => parseLine(line));
108
+ const firstRecord = parsed.find((record) => record !== undefined);
109
+ if (firstRecord !== undefined && typeof firstRecord.seq !== 'number') {
110
+ return {
111
+ records: [],
112
+ legacy: true,
113
+ tornTail,
114
+ lastSeq: 0,
115
+ lastHash: workflowJournalSeed(runId),
116
+ endsWithNewline,
117
+ untrusted: parsed.filter((record) => record !== undefined),
118
+ };
119
+ }
120
+ const records = [];
121
+ let lastSeq = 0;
122
+ let lastHash = workflowJournalSeed(runId);
123
+ let gapStart;
124
+ let gapLines = 0;
125
+ let gapParsed = false;
126
+ let brokenAt;
127
+ const closeGap = () => {
128
+ if (gapStart !== undefined && (gapLines > 1 || gapParsed))
129
+ brokenAt ??= gapStart;
130
+ gapStart = undefined;
131
+ gapLines = 0;
132
+ gapParsed = false;
133
+ };
134
+ for (let i = 0; i < pieces.length; i++) {
135
+ const line = pieces[i];
136
+ const record = parsed[i];
137
+ const chains = record !== undefined &&
138
+ record.seq === lastSeq + 1 &&
139
+ record.prev === lastHash &&
140
+ (options.key === undefined || macMatches(record, options.key));
141
+ const first = records.length === 0;
142
+ const acceptable = chains &&
143
+ (first
144
+ ? record.type === 'run_started' && record.runId === runId
145
+ : gapStart === undefined || record.type === 'run_started');
146
+ if (acceptable) {
147
+ closeGap();
148
+ records.push(record);
149
+ lastSeq = record.seq;
150
+ lastHash = workflowJournalLineHash(line);
151
+ continue;
152
+ }
153
+ if (gapStart === undefined)
154
+ gapStart = i + 1;
155
+ gapLines++;
156
+ if (record !== undefined)
157
+ gapParsed = true;
158
+ }
159
+ // A gap that runs to the end is a change, except a single line that does not parse
160
+ // (what a torn write leaves once the next pass closed it with a newline).
161
+ closeGap();
162
+ return {
163
+ records,
164
+ legacy: false,
165
+ tornTail,
166
+ ...(brokenAt !== undefined ? { brokenAt } : {}),
167
+ lastSeq,
168
+ lastHash,
169
+ endsWithNewline,
170
+ untrusted: [],
171
+ };
172
+ }
173
+ function hasResult(record) {
174
+ return Object.hasOwn(record, 'result') && record.result !== undefined && record.result !== null;
175
+ }
176
+ /**
177
+ * Folds a checked journal into what a resumed pass needs.
178
+ *
179
+ * The last saved result for a key wins. An agent that was asked for again
180
+ * after a result was saved gives that result up until it finishes again. A
181
+ * failed or skipped outcome removes the result and marks the key failed; an
182
+ * outcome the run recorded as interrupted (stopped, not failed) leaves the key
183
+ * as seen but unfinished. Lines marked `cached` repeat an earlier result and
184
+ * are skipped, and so is any agent record from a pass older than the latest
185
+ * `run_started`, which a slow agent of an earlier pass can still write.
186
+ */
187
+ export function loadWorkflowResume(checked) {
188
+ const results = new Map();
189
+ const seen = new Set();
190
+ const failed = new Set();
191
+ const demoted = new Set();
192
+ const problems = [];
193
+ const keysByIndex = new Map();
194
+ let currentPass = 0;
195
+ let scriptSha256;
196
+ let previousFinish = 'unfinished';
197
+ for (const record of checked.records) {
198
+ if (record.type === 'run_started') {
199
+ currentPass = record.resume?.pass ?? 1;
200
+ scriptSha256 = record.scriptSha256;
201
+ previousFinish = 'unfinished';
202
+ keysByIndex.clear();
203
+ continue;
204
+ }
205
+ if (record.type === 'run_finished') {
206
+ previousFinish = record.status;
207
+ continue;
208
+ }
209
+ if (record.type !== 'agent_request' && record.type !== 'agent_outcome')
210
+ continue;
211
+ const pass = record.pass ?? 1;
212
+ if (pass < currentPass || record.cached === true)
213
+ continue;
214
+ if (record.type === 'agent_request') {
215
+ if (record.key === undefined)
216
+ continue;
217
+ keysByIndex.set(`${pass}:${record.index}`, record.key);
218
+ seen.add(record.key);
219
+ if (results.delete(record.key))
220
+ demoted.add(record.key);
221
+ continue;
222
+ }
223
+ const key = record.key ?? keysByIndex.get(`${pass}:${record.index}`);
224
+ if (key === undefined)
225
+ continue;
226
+ seen.add(key);
227
+ if (record.state === 'done' && hasResult(record)) {
228
+ results.set(key, {
229
+ value: record.result,
230
+ pass,
231
+ index: record.index,
232
+ ...(record.childSessionId !== undefined ? { childSessionId: record.childSessionId } : {}),
233
+ });
234
+ failed.delete(key);
235
+ demoted.delete(key);
236
+ }
237
+ else if (record.state === 'done' && record.unsaved === true) {
238
+ results.delete(key);
239
+ demoted.add(key);
240
+ }
241
+ else if (record.interrupted === true) {
242
+ // Stopped, not failed: the agent runs again and the cache stays open.
243
+ results.delete(key);
244
+ }
245
+ else {
246
+ results.delete(key);
247
+ demoted.delete(key);
248
+ failed.add(key);
249
+ }
250
+ }
251
+ if (checked.legacy) {
252
+ problems.push('This run was saved before resuming was possible, so its agents cannot be reused.');
253
+ }
254
+ if (checked.brokenAt !== undefined) {
255
+ problems.push(`The journal was changed or cut short at line ${checked.brokenAt}. Results after that point are not trusted and those agents will run again.`);
256
+ }
257
+ const started = checked.records.some((record) => record.type === 'run_started');
258
+ if (!checked.legacy && !started)
259
+ problems.push('The journal has no usable record of the run.');
260
+ return {
261
+ pass: currentPass + 1,
262
+ results,
263
+ seen,
264
+ failed,
265
+ demoted,
266
+ ...(scriptSha256 !== undefined ? { scriptSha256 } : {}),
267
+ previousFinish,
268
+ problems,
269
+ resumable: !checked.legacy && started,
270
+ ...(checked.brokenAt !== undefined ? { brokenAt: checked.brokenAt } : {}),
271
+ };
272
+ }
273
+ //# sourceMappingURL=resume.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../src/execution/workflow/resume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAUrE,+FAA+F;AAC/F,MAAM,WAAW,GAAG,IAAI,CAAA;AAExB,SAAS,SAAS,CAAC,IAAY;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACvD,CAAC;AAED,qGAAqG;AACrG,SAAS,aAAa,CAAC,KAAc;IACpC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE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O,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAA;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,WAAW,EAAkB,MAAM,0BAA0B,CAAA;AAQtF,OAAO,KAAK,EAQX,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EAEjB,MAAM,YAAY,CAAA;AAEnB,uCAAuC;AACvC,eAAO,MAAM,kBAAkB,UAAU,CAAA;AAoBzC,sHAAsH;AACtH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGvE;AASD,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,cAAmB,GAAG,sBAAsB,CAmCzF;AA+GD,MAAM,WAAW,sBAAsB;IACtC,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAA;IAClC,oCAAoC;IACpC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAC3B,qGAAqG;IACrG,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAC/B;AAkCD;;;;;;;;;;GAUG;AACH,qBAAa,eAAe;IAGf,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;gBAEL,OAAO,GAAE,sBAA2B;IAI3D,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA6gBlE"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/execution/workflow/runtime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,WAAW,EAAkB,MAAM,0BAA0B,CA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