@namzu/sdk 58.1.1 → 60.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 (312) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/account/binding.d.ts +20 -0
  3. package/dist/account/binding.d.ts.map +1 -0
  4. package/dist/account/binding.js +27 -0
  5. package/dist/account/binding.js.map +1 -0
  6. package/dist/account/index.d.ts +9 -0
  7. package/dist/account/index.d.ts.map +1 -0
  8. package/dist/account/index.js +5 -0
  9. package/dist/account/index.js.map +1 -0
  10. package/dist/account/lock.d.ts +33 -0
  11. package/dist/account/lock.d.ts.map +1 -0
  12. package/dist/account/lock.js +170 -0
  13. package/dist/account/lock.js.map +1 -0
  14. package/dist/account/registry.d.ts +21 -0
  15. package/dist/account/registry.d.ts.map +1 -0
  16. package/dist/account/registry.js +340 -0
  17. package/dist/account/registry.js.map +1 -0
  18. package/dist/account/types.d.ts +124 -0
  19. package/dist/account/types.d.ts.map +1 -0
  20. package/dist/account/types.js +35 -0
  21. package/dist/account/types.js.map +1 -0
  22. package/dist/compaction/context-window.d.ts +53 -0
  23. package/dist/compaction/context-window.d.ts.map +1 -1
  24. package/dist/compaction/context-window.js +141 -2
  25. package/dist/compaction/context-window.js.map +1 -1
  26. package/dist/execution/workflow/index.d.ts +3 -1
  27. package/dist/execution/workflow/index.d.ts.map +1 -1
  28. package/dist/execution/workflow/index.js +2 -1
  29. package/dist/execution/workflow/index.js.map +1 -1
  30. package/dist/execution/workflow/journal.d.ts +24 -4
  31. package/dist/execution/workflow/journal.d.ts.map +1 -1
  32. package/dist/execution/workflow/journal.js +131 -9
  33. package/dist/execution/workflow/journal.js.map +1 -1
  34. package/dist/execution/workflow/prelude.d.ts +2 -0
  35. package/dist/execution/workflow/prelude.d.ts.map +1 -1
  36. package/dist/execution/workflow/prelude.js +49 -8
  37. package/dist/execution/workflow/prelude.js.map +1 -1
  38. package/dist/execution/workflow/resume.d.ts +59 -0
  39. package/dist/execution/workflow/resume.d.ts.map +1 -0
  40. package/dist/execution/workflow/resume.js +273 -0
  41. package/dist/execution/workflow/resume.js.map +1 -0
  42. package/dist/execution/workflow/runtime.d.ts.map +1 -1
  43. package/dist/execution/workflow/runtime.js +112 -8
  44. package/dist/execution/workflow/runtime.js.map +1 -1
  45. package/dist/execution/workflow/types.d.ts +105 -1
  46. package/dist/execution/workflow/types.d.ts.map +1 -1
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +4 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/pals/communication/ingress-schema.d.ts +38 -38
  52. package/dist/peers/record.d.ts +98 -0
  53. package/dist/peers/record.d.ts.map +1 -1
  54. package/dist/peers/record.js +17 -0
  55. package/dist/peers/record.js.map +1 -1
  56. package/dist/peers/registry.d.ts.map +1 -1
  57. package/dist/peers/registry.js +2 -2
  58. package/dist/peers/registry.js.map +1 -1
  59. package/dist/plugin/compat.d.ts +24 -0
  60. package/dist/plugin/compat.d.ts.map +1 -0
  61. package/dist/plugin/compat.js +149 -0
  62. package/dist/plugin/compat.js.map +1 -0
  63. package/dist/plugin/loader.d.ts +2 -1
  64. package/dist/plugin/loader.d.ts.map +1 -1
  65. package/dist/plugin/loader.js +6 -0
  66. package/dist/plugin/loader.js.map +1 -1
  67. package/dist/pricing/index.d.ts.map +1 -1
  68. package/dist/pricing/index.js +2 -1
  69. package/dist/pricing/index.js.map +1 -1
  70. package/dist/process/kill-tree.d.ts +44 -0
  71. package/dist/process/kill-tree.d.ts.map +1 -1
  72. package/dist/process/kill-tree.js +102 -4
  73. package/dist/process/kill-tree.js.map +1 -1
  74. package/dist/prompt/coding-agent-doctrine.d.ts +1 -1
  75. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  76. package/dist/prompt/coding-agent-doctrine.js +9 -1
  77. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  78. package/dist/provider/errors.d.ts.map +1 -1
  79. package/dist/provider/errors.js +25 -2
  80. package/dist/provider/errors.js.map +1 -1
  81. package/dist/provider/model-window-suffix.d.ts +18 -0
  82. package/dist/provider/model-window-suffix.d.ts.map +1 -0
  83. package/dist/provider/model-window-suffix.js +77 -0
  84. package/dist/provider/model-window-suffix.js.map +1 -0
  85. package/dist/provider/token-budget.d.ts.map +1 -1
  86. package/dist/provider/token-budget.js +9 -1
  87. package/dist/provider/token-budget.js.map +1 -1
  88. package/dist/public-runtime.d.ts +6 -3
  89. package/dist/public-runtime.d.ts.map +1 -1
  90. package/dist/public-runtime.js +6 -4
  91. package/dist/public-runtime.js.map +1 -1
  92. package/dist/public-types.d.ts +3 -0
  93. package/dist/public-types.d.ts.map +1 -1
  94. package/dist/registry/command/kernel-commands.d.ts +1 -4
  95. package/dist/registry/command/kernel-commands.d.ts.map +1 -1
  96. package/dist/registry/command/kernel-commands.js +0 -28
  97. package/dist/registry/command/kernel-commands.js.map +1 -1
  98. package/dist/runtime/jobs/awaited-jobs.d.ts +6 -0
  99. package/dist/runtime/jobs/awaited-jobs.d.ts.map +1 -1
  100. package/dist/runtime/jobs/awaited-jobs.js +11 -0
  101. package/dist/runtime/jobs/awaited-jobs.js.map +1 -1
  102. package/dist/runtime/jobs/host-exit-finalizer.d.ts +20 -0
  103. package/dist/runtime/jobs/host-exit-finalizer.d.ts.map +1 -0
  104. package/dist/runtime/jobs/host-exit-finalizer.js +57 -0
  105. package/dist/runtime/jobs/host-exit-finalizer.js.map +1 -0
  106. package/dist/runtime/jobs/liveness.d.ts +67 -0
  107. package/dist/runtime/jobs/liveness.d.ts.map +1 -0
  108. package/dist/runtime/jobs/liveness.js +94 -0
  109. package/dist/runtime/jobs/liveness.js.map +1 -0
  110. package/dist/runtime/jobs/registry.d.ts +21 -0
  111. package/dist/runtime/jobs/registry.d.ts.map +1 -1
  112. package/dist/runtime/jobs/registry.js +104 -2
  113. package/dist/runtime/jobs/registry.js.map +1 -1
  114. package/dist/runtime/jobs/wake-budget.d.ts +35 -0
  115. package/dist/runtime/jobs/wake-budget.d.ts.map +1 -0
  116. package/dist/runtime/jobs/wake-budget.js +48 -0
  117. package/dist/runtime/jobs/wake-budget.js.map +1 -0
  118. package/dist/runtime/query/detached-calls.d.ts +65 -0
  119. package/dist/runtime/query/detached-calls.d.ts.map +1 -0
  120. package/dist/runtime/query/detached-calls.js +116 -0
  121. package/dist/runtime/query/detached-calls.js.map +1 -0
  122. package/dist/runtime/query/executor.d.ts +11 -3
  123. package/dist/runtime/query/executor.d.ts.map +1 -1
  124. package/dist/runtime/query/executor.js +100 -8
  125. package/dist/runtime/query/executor.js.map +1 -1
  126. package/dist/runtime/query/index.d.ts +20 -0
  127. package/dist/runtime/query/index.d.ts.map +1 -1
  128. package/dist/runtime/query/index.js +31 -5
  129. package/dist/runtime/query/index.js.map +1 -1
  130. package/dist/runtime/query/iteration/outstanding-work.d.ts.map +1 -1
  131. package/dist/runtime/query/iteration/outstanding-work.js +11 -3
  132. package/dist/runtime/query/iteration/outstanding-work.js.map +1 -1
  133. package/dist/runtime/query/iteration/phases/context.d.ts +7 -0
  134. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  135. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  136. package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
  137. package/dist/runtime/query/iteration/phases/tool-review.js +63 -1
  138. package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
  139. package/dist/runtime/query/session-storage.d.ts.map +1 -1
  140. package/dist/runtime/query/session-storage.js +8 -3
  141. package/dist/runtime/query/session-storage.js.map +1 -1
  142. package/dist/runtime/query/steering.d.ts +29 -3
  143. package/dist/runtime/query/steering.d.ts.map +1 -1
  144. package/dist/runtime/query/steering.js +58 -3
  145. package/dist/runtime/query/steering.js.map +1 -1
  146. package/dist/runtime/query/tooling.d.ts +1 -0
  147. package/dist/runtime/query/tooling.d.ts.map +1 -1
  148. package/dist/runtime/query/tooling.js +1 -0
  149. package/dist/runtime/query/tooling.js.map +1 -1
  150. package/dist/runtime/system-events.d.ts +5 -0
  151. package/dist/runtime/system-events.d.ts.map +1 -1
  152. package/dist/runtime/system-events.js +7 -1
  153. package/dist/runtime/system-events.js.map +1 -1
  154. package/dist/sandbox/denial.d.ts +11 -0
  155. package/dist/sandbox/denial.d.ts.map +1 -0
  156. package/dist/sandbox/denial.js +61 -0
  157. package/dist/sandbox/denial.js.map +1 -0
  158. package/dist/sandbox/file-walk-program.d.ts.map +1 -1
  159. package/dist/sandbox/file-walk-program.js +31 -13
  160. package/dist/sandbox/file-walk-program.js.map +1 -1
  161. package/dist/sandbox/file-walk.d.ts +2 -0
  162. package/dist/sandbox/file-walk.d.ts.map +1 -1
  163. package/dist/sandbox/file-walk.js +64 -13
  164. package/dist/sandbox/file-walk.js.map +1 -1
  165. package/dist/sandbox/ignore-matcher.d.ts +30 -0
  166. package/dist/sandbox/ignore-matcher.d.ts.map +1 -0
  167. package/dist/sandbox/ignore-matcher.js +11 -0
  168. package/dist/sandbox/ignore-matcher.js.map +1 -0
  169. package/dist/sandbox/ignore-source.d.ts +26 -0
  170. package/dist/sandbox/ignore-source.d.ts.map +1 -0
  171. package/dist/sandbox/ignore-source.js +221 -0
  172. package/dist/sandbox/ignore-source.js.map +1 -0
  173. package/dist/sandbox/provider/local.d.ts.map +1 -1
  174. package/dist/sandbox/provider/local.js +11 -1
  175. package/dist/sandbox/provider/local.js.map +1 -1
  176. package/dist/scheduler/completion-inbox.d.ts.map +1 -1
  177. package/dist/scheduler/completion-inbox.js +1 -0
  178. package/dist/scheduler/completion-inbox.js.map +1 -1
  179. package/dist/session/log-hash.d.ts.map +1 -1
  180. package/dist/session/log-hash.js +18 -1
  181. package/dist/session/log-hash.js.map +1 -1
  182. package/dist/store/session-index/sqlite.d.ts.map +1 -1
  183. package/dist/store/session-index/sqlite.js +169 -16
  184. package/dist/store/session-index/sqlite.js.map +1 -1
  185. package/dist/tools/builtins/bash.d.ts.map +1 -1
  186. package/dist/tools/builtins/bash.js +10 -4
  187. package/dist/tools/builtins/bash.js.map +1 -1
  188. package/dist/tools/builtins/computer-use.d.ts +35 -0
  189. package/dist/tools/builtins/computer-use.d.ts.map +1 -1
  190. package/dist/tools/builtins/computer-use.js +512 -67
  191. package/dist/tools/builtins/computer-use.js.map +1 -1
  192. package/dist/tools/builtins/glob.d.ts +1 -0
  193. package/dist/tools/builtins/glob.d.ts.map +1 -1
  194. package/dist/tools/builtins/glob.js +65 -28
  195. package/dist/tools/builtins/glob.js.map +1 -1
  196. package/dist/tools/builtins/grep.d.ts +2 -0
  197. package/dist/tools/builtins/grep.d.ts.map +1 -1
  198. package/dist/tools/builtins/grep.js +94 -40
  199. package/dist/tools/builtins/grep.js.map +1 -1
  200. package/dist/tools/builtins/job.d.ts +1 -1
  201. package/dist/tools/builtins/job.d.ts.map +1 -1
  202. package/dist/tools/builtins/job.js +34 -7
  203. package/dist/tools/builtins/job.js.map +1 -1
  204. package/dist/tools/builtins/search-support.d.ts +44 -0
  205. package/dist/tools/builtins/search-support.d.ts.map +1 -0
  206. package/dist/tools/builtins/search-support.js +89 -0
  207. package/dist/tools/builtins/search-support.js.map +1 -0
  208. package/dist/tools/builtins/wait-for-job-bounds.d.ts +2 -0
  209. package/dist/tools/builtins/wait-for-job-bounds.d.ts.map +1 -1
  210. package/dist/tools/builtins/wait-for-job-bounds.js +3 -1
  211. package/dist/tools/builtins/wait-for-job-bounds.js.map +1 -1
  212. package/dist/tools/builtins/wait-for-job.d.ts +1 -1
  213. package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
  214. package/dist/tools/builtins/wait-for-job.js +13 -2
  215. package/dist/tools/builtins/wait-for-job.js.map +1 -1
  216. package/dist/tools/command-shell.d.ts.map +1 -1
  217. package/dist/tools/command-shell.js +14 -5
  218. package/dist/tools/command-shell.js.map +1 -1
  219. package/dist/types/computer-use/index.d.ts +129 -13
  220. package/dist/types/computer-use/index.d.ts.map +1 -1
  221. package/dist/types/computer-use/index.js.map +1 -1
  222. package/dist/types/errors/catalog.d.ts.map +1 -1
  223. package/dist/types/errors/catalog.js +6 -0
  224. package/dist/types/errors/catalog.js.map +1 -1
  225. package/dist/types/plugin/index.d.ts +24 -0
  226. package/dist/types/plugin/index.d.ts.map +1 -1
  227. package/dist/types/plugin/index.js +4 -0
  228. package/dist/types/plugin/index.js.map +1 -1
  229. package/dist/types/provider/errors.d.ts +7 -0
  230. package/dist/types/provider/errors.d.ts.map +1 -1
  231. package/dist/types/provider/errors.js +27 -3
  232. package/dist/types/provider/errors.js.map +1 -1
  233. package/dist/types/sandbox/index.d.ts +38 -1
  234. package/dist/types/sandbox/index.d.ts.map +1 -1
  235. package/dist/types/sandbox/index.js.map +1 -1
  236. package/dist/types/session/records.d.ts +479 -1
  237. package/dist/types/session/records.d.ts.map +1 -1
  238. package/dist/types/session/records.js +45 -1
  239. package/dist/types/session/records.js.map +1 -1
  240. package/dist/types/tool/index.d.ts +30 -0
  241. package/dist/types/tool/index.d.ts.map +1 -1
  242. package/dist/types/tool/index.js.map +1 -1
  243. package/dist/types/tool/presentation.d.ts +8 -0
  244. package/dist/types/tool/presentation.d.ts.map +1 -1
  245. package/package.json +1 -1
  246. package/src/account/binding.ts +43 -0
  247. package/src/account/index.ts +32 -0
  248. package/src/account/lock.ts +184 -0
  249. package/src/account/registry.ts +413 -0
  250. package/src/account/types.ts +137 -0
  251. package/src/compaction/context-window.ts +163 -2
  252. package/src/execution/workflow/index.ts +14 -1
  253. package/src/execution/workflow/journal.ts +161 -11
  254. package/src/execution/workflow/prelude.ts +51 -8
  255. package/src/execution/workflow/resume.ts +313 -0
  256. package/src/execution/workflow/runtime.ts +127 -9
  257. package/src/execution/workflow/types.ts +109 -1
  258. package/src/index.ts +17 -0
  259. package/src/peers/record.ts +18 -0
  260. package/src/peers/registry.ts +2 -2
  261. package/src/plugin/compat.ts +173 -0
  262. package/src/plugin/loader.ts +7 -1
  263. package/src/pricing/index.ts +2 -1
  264. package/src/process/kill-tree.ts +106 -4
  265. package/src/prompt/coding-agent-doctrine.ts +9 -1
  266. package/src/provider/errors.ts +27 -1
  267. package/src/provider/model-window-suffix.ts +84 -0
  268. package/src/provider/token-budget.ts +9 -3
  269. package/src/public-runtime.ts +38 -2
  270. package/src/public-types.ts +16 -0
  271. package/src/registry/command/kernel-commands.ts +1 -32
  272. package/src/runtime/jobs/awaited-jobs.ts +11 -0
  273. package/src/runtime/jobs/host-exit-finalizer.ts +67 -0
  274. package/src/runtime/jobs/liveness.ts +144 -0
  275. package/src/runtime/jobs/registry.ts +114 -2
  276. package/src/runtime/jobs/wake-budget.ts +55 -0
  277. package/src/runtime/query/detached-calls.ts +135 -0
  278. package/src/runtime/query/executor.ts +102 -12
  279. package/src/runtime/query/index.ts +50 -7
  280. package/src/runtime/query/iteration/outstanding-work.ts +12 -3
  281. package/src/runtime/query/iteration/phases/context.ts +7 -0
  282. package/src/runtime/query/iteration/phases/tool-review.ts +73 -8
  283. package/src/runtime/query/session-storage.ts +8 -3
  284. package/src/runtime/query/steering.ts +77 -6
  285. package/src/runtime/query/tooling.ts +2 -0
  286. package/src/runtime/system-events.ts +12 -1
  287. package/src/sandbox/denial.ts +79 -0
  288. package/src/sandbox/file-walk-program.ts +32 -13
  289. package/src/sandbox/file-walk.ts +75 -12
  290. package/src/sandbox/ignore-matcher.ts +46 -0
  291. package/src/sandbox/ignore-source.ts +220 -0
  292. package/src/sandbox/provider/local.ts +11 -1
  293. package/src/scheduler/completion-inbox.ts +1 -0
  294. package/src/session/log-hash.ts +21 -0
  295. package/src/store/session-index/sqlite.ts +171 -16
  296. package/src/tools/builtins/bash.ts +11 -4
  297. package/src/tools/builtins/computer-use.ts +593 -68
  298. package/src/tools/builtins/glob.ts +79 -32
  299. package/src/tools/builtins/grep.ts +107 -43
  300. package/src/tools/builtins/job.ts +42 -12
  301. package/src/tools/builtins/search-support.ts +107 -0
  302. package/src/tools/builtins/wait-for-job-bounds.ts +5 -1
  303. package/src/tools/builtins/wait-for-job.ts +14 -2
  304. package/src/tools/command-shell.ts +13 -5
  305. package/src/types/computer-use/index.ts +157 -15
  306. package/src/types/errors/catalog.ts +6 -0
  307. package/src/types/plugin/index.ts +8 -0
  308. package/src/types/provider/errors.ts +40 -3
  309. package/src/types/sandbox/index.ts +40 -1
  310. package/src/types/session/records.ts +52 -2
  311. package/src/types/tool/index.ts +30 -0
  312. package/src/types/tool/presentation.ts +8 -0
@@ -0,0 +1,65 @@
1
+ import type { ToolCallOutcome } from './executor.js';
2
+ /**
3
+ * Tool calls that were still running when the operator wrote.
4
+ *
5
+ * A model cannot answer while a `tool_use` block has no `tool_result`, and a
6
+ * long call used to hold the operator's question until it finished: the person
7
+ * asked how things stand and heard nothing for as long as the call took. When
8
+ * the operator writes while a call has been running for a while, the batch
9
+ * answers the unfinished calls with a placeholder result, the model reads the
10
+ * message at once, and the call carries on untouched. Its real result reaches
11
+ * the model later as a message of its own that names the call.
12
+ *
13
+ * This holds the bookkeeping for one turn: which calls were handed back this
14
+ * way, and the outcomes that have arrived since.
15
+ */
16
+ /** How long a call must have been running before an operator message detaches it. */
17
+ export declare const DETACH_AFTER_MS = 2000;
18
+ /**
19
+ * What a model reads as the result of a call that is still running.
20
+ *
21
+ * It says the call goes on, what not to do about it, and what to tell the
22
+ * person; the model never sees these words as anything the tool printed.
23
+ */
24
+ export declare function stillRunningResult(toolName: string, started?: boolean): string;
25
+ /** What a model reads when a call it was told was still running has finished. */
26
+ export declare function formatLateResults(outcomes: readonly ToolCallOutcome[]): string;
27
+ export declare class DetachedCalls {
28
+ readonly waitForOperator?: ((signal: AbortSignal) => Promise<void>) | undefined;
29
+ private readonly open;
30
+ private arrived;
31
+ private readonly waiters;
32
+ /**
33
+ * `waitForOperator` resolves when the operator wrote and at no other wake: a
34
+ * child's notice or a peer's mail must not hand a call back, because the
35
+ * model would then get a turn with no question to answer.
36
+ */
37
+ constructor(waitForOperator?: ((signal: AbortSignal) => Promise<void>) | undefined);
38
+ /** A call was answered with the placeholder and is still running. */
39
+ begin(toolCallId: string, toolName: string): void;
40
+ /** The real outcome of a detached call. Ignored for a call that was never detached. */
41
+ settle(outcome: ToolCallOutcome): void;
42
+ /** True while a call is still running or its outcome has not been read. */
43
+ get hasWork(): boolean;
44
+ /** Calls still running. */
45
+ get running(): number;
46
+ /** The outcomes that have arrived since the last read, in arrival order. */
47
+ take(): readonly ToolCallOutcome[];
48
+ /**
49
+ * Resolves when an outcome is waiting, when nothing is running, after
50
+ * `graceMs`, or rejects when `signal` aborts. Resolving early is never
51
+ * delivery: the caller reads with {@link take}.
52
+ */
53
+ waitForArrival(graceMs: number, signal: AbortSignal): Promise<void>;
54
+ private wake;
55
+ }
56
+ /**
57
+ * What one batch needs to hand its unfinished calls back. `requested` settles
58
+ * once the operator has written and the batch has run for {@link DETACH_AFTER_MS};
59
+ * `calls` receives each call that was handed back and, later, its outcome.
60
+ */
61
+ export interface BatchDetach {
62
+ readonly requested: Promise<void>;
63
+ readonly calls: DetachedCalls;
64
+ }
65
+ //# sourceMappingURL=detached-calls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detached-calls.d.ts","sourceRoot":"","sources":["../../../src/runtime/query/detached-calls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD;;;;;;;;;;;;;GAaG;AAEH,qFAAqF;AACrF,eAAO,MAAM,eAAe,OAAQ,CAAA;AAEpC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,MAAM,CAc3E;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAM9E;AAED,qBAAa,aAAa;IAUb,QAAQ,CAAC,eAAe,CAAC,GAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC;IAT7E,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4B;IACjD,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAEhD;;;;OAIG;gBACkB,eAAe,CAAC,GAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,aAAA;IAE7E,qEAAqE;IACrE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIjD,uFAAuF;IACvF,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAMtC,2EAA2E;IAC3E,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,2BAA2B;IAC3B,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,4EAA4E;IAC5E,IAAI,IAAI,SAAS,eAAe,EAAE;IAMlC;;;;OAIG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBnE,OAAO,CAAC,IAAI;CAGZ;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAC7B"}
@@ -0,0 +1,116 @@
1
+ import { frameNotice } from '../../types/message/notice-frame.js';
2
+ /**
3
+ * Tool calls that were still running when the operator wrote.
4
+ *
5
+ * A model cannot answer while a `tool_use` block has no `tool_result`, and a
6
+ * long call used to hold the operator's question until it finished: the person
7
+ * asked how things stand and heard nothing for as long as the call took. When
8
+ * the operator writes while a call has been running for a while, the batch
9
+ * answers the unfinished calls with a placeholder result, the model reads the
10
+ * message at once, and the call carries on untouched. Its real result reaches
11
+ * the model later as a message of its own that names the call.
12
+ *
13
+ * This holds the bookkeeping for one turn: which calls were handed back this
14
+ * way, and the outcomes that have arrived since.
15
+ */
16
+ /** How long a call must have been running before an operator message detaches it. */
17
+ export const DETACH_AFTER_MS = 2_000;
18
+ /**
19
+ * What a model reads as the result of a call that is still running.
20
+ *
21
+ * It says the call goes on, what not to do about it, and what to tell the
22
+ * person; the model never sees these words as anything the tool printed.
23
+ */
24
+ export function stillRunningResult(toolName, started = true) {
25
+ if (!started) {
26
+ return [
27
+ `[Waiting to start] The ${toolName} call has not started: it is queued behind an earlier call in this batch. The operator wrote a message while the batch ran, and that message follows so you can answer it now.`,
28
+ 'The call will start by itself when the earlier one ends, and its result will arrive in a later message that names this call id.',
29
+ 'Repeating the call would run the work twice, and waiting or polling for it would delay your answer, so do neither. If they ask, say it has not started yet.',
30
+ ].join('\n');
31
+ }
32
+ return [
33
+ `[Still running] The ${toolName} call has not finished. The operator wrote a message while it ran, and that message follows so you can answer it now.`,
34
+ 'The call was not interrupted. Its result will arrive on its own, in a later message that names this call id.',
35
+ 'Repeating the call would run the work twice, and waiting or polling for it would delay your answer, so do neither.',
36
+ 'You cannot stop it from here, so do not say you cancelled or dropped it. On the operator’s screen it still shows as in progress; if they ask, say it is still running.',
37
+ ].join('\n');
38
+ }
39
+ /** What a model reads when a call it was told was still running has finished. */
40
+ export function formatLateResults(outcomes) {
41
+ const parts = outcomes.map((outcome) => `The ${outcome.toolName} call with id ${outcome.toolCallId}, which you were told was still running, has finished${outcome.isError ? ' with an error' : ''}. This is what it returned:\n${outcome.output}`);
42
+ return frameNotice('job', '[Tool call finished]', parts.join('\n\n'));
43
+ }
44
+ export class DetachedCalls {
45
+ waitForOperator;
46
+ open = new Map();
47
+ arrived = [];
48
+ waiters = new Set();
49
+ /**
50
+ * `waitForOperator` resolves when the operator wrote and at no other wake: a
51
+ * child's notice or a peer's mail must not hand a call back, because the
52
+ * model would then get a turn with no question to answer.
53
+ */
54
+ constructor(waitForOperator) {
55
+ this.waitForOperator = waitForOperator;
56
+ }
57
+ /** A call was answered with the placeholder and is still running. */
58
+ begin(toolCallId, toolName) {
59
+ this.open.set(toolCallId, toolName);
60
+ }
61
+ /** The real outcome of a detached call. Ignored for a call that was never detached. */
62
+ settle(outcome) {
63
+ if (!this.open.delete(outcome.toolCallId))
64
+ return;
65
+ this.arrived.push(outcome);
66
+ this.wake();
67
+ }
68
+ /** True while a call is still running or its outcome has not been read. */
69
+ get hasWork() {
70
+ return this.open.size > 0 || this.arrived.length > 0;
71
+ }
72
+ /** Calls still running. */
73
+ get running() {
74
+ return this.open.size;
75
+ }
76
+ /** The outcomes that have arrived since the last read, in arrival order. */
77
+ take() {
78
+ const taken = this.arrived;
79
+ this.arrived = [];
80
+ return taken;
81
+ }
82
+ /**
83
+ * Resolves when an outcome is waiting, when nothing is running, after
84
+ * `graceMs`, or rejects when `signal` aborts. Resolving early is never
85
+ * delivery: the caller reads with {@link take}.
86
+ */
87
+ waitForArrival(graceMs, signal) {
88
+ if (this.arrived.length > 0 || this.open.size === 0)
89
+ return Promise.resolve();
90
+ if (signal.aborted)
91
+ return Promise.reject(signal.reason);
92
+ return new Promise((resolve, reject) => {
93
+ const done = () => {
94
+ clearTimeout(timer);
95
+ this.waiters.delete(wake);
96
+ signal.removeEventListener('abort', abort);
97
+ };
98
+ const wake = () => {
99
+ done();
100
+ resolve();
101
+ };
102
+ const abort = () => {
103
+ done();
104
+ reject(signal.reason);
105
+ };
106
+ const timer = setTimeout(wake, Math.max(0, graceMs));
107
+ this.waiters.add(wake);
108
+ signal.addEventListener('abort', abort, { once: true });
109
+ });
110
+ }
111
+ wake() {
112
+ for (const wake of [...this.waiters])
113
+ wake();
114
+ }
115
+ }
116
+ //# sourceMappingURL=detached-calls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detached-calls.js","sourceRoot":"","sources":["../../../src/runtime/query/detached-calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AAGjE;;;;;;;;;;;;;GAaG;AAEH,qFAAqF;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAA;AAEpC;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,OAAO,GAAG,IAAI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M,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;YACtB,CAAC,CAAA;YACD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAA;YACpD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACtB,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QACxD,CAAC,CAAC,CAAA;IACH,CAAC;IAEO,IAAI;QACX,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;YAAE,IAAI,EAAE,CAAA;IAC7C,CAAC;CACD"}
@@ -24,6 +24,7 @@ import type { RepairToolCall } from '../../types/tool/repair.js';
24
24
  import { type BackoffPolicy } from '../../utils/backoff.js';
25
25
  import type { Logger } from '../../utils/logger.js';
26
26
  import { type BackgroundJobRegistry } from '../jobs/registry.js';
27
+ import { type BatchDetach } from './detached-calls.js';
27
28
  import { type FileEvidence } from './file-evidence-context.js';
28
29
  import type { ToolResultObservation } from './project-instructions.js';
29
30
  export type { EmitEvent } from './events.js';
@@ -181,6 +182,8 @@ export interface ToolExecutorConfig {
181
182
  * recorder gets no hold rather than a marking call that goes nowhere.
182
183
  */
183
184
  onJobAwaited?: (id: string) => void;
185
+ /** Where a tool result that handed the model a job's exit says so; see `ToolContext.backgroundJobs.markCollected`. */
186
+ onJobCollected?: (id: string) => void;
184
187
  /** The longest a monitor may live in this turn; see `QueryParams.monitorTimeoutCapMs`. */
185
188
  monitorTimeoutCapMs?: number;
186
189
  /**
@@ -637,7 +640,7 @@ export declare class ToolExecutor {
637
640
  /** Re-prepare only calls whose raw input a reviewer actually changed. */
638
641
  reprepareBatchForReview(response: ChatCompletionResponse, previous: PreparedToolBatch, changedCallIds: ReadonlySet<string>): Promise<PreparedToolBatch>;
639
642
  private publishPreparedBatch;
640
- executeBatch(response: ChatCompletionResponse, denials?: ToolCallDenials, prior?: PriorToolResults, preparedBatch?: PreparedToolBatch, declines?: ToolCallDeclines, review?: ReviewedExecution): Promise<ToolExecutionBatch>;
643
+ executeBatch(response: ChatCompletionResponse, denials?: ToolCallDenials, prior?: PriorToolResults, preparedBatch?: PreparedToolBatch, declines?: ToolCallDeclines, review?: ReviewedExecution, detach?: BatchDetach): Promise<ToolExecutionBatch>;
641
644
  private runBatch;
642
645
  /**
643
646
  * Walk the calls of a batch in the model's order, asking about each as it
@@ -721,11 +724,16 @@ export declare class ToolExecutor {
721
724
  takeHalt(): string | undefined;
722
725
  private prepareNestedCall;
723
726
  /**
724
- * One execution attempt, with a throw materialized as an error result.
727
+ * One execution attempt, with a throw materialized as an error result —
728
+ * except `ToolResultHalted`, which this deliberately lets through.
725
729
  *
726
730
  * an unhandled throw from `tools.execute(...)` used to
727
731
  * propagate up to `result.ts` as `turn_failed` without emitting a
728
- * terminal `tool_completed`, leaving UI cards stuck in `executing`.
732
+ * terminal `tool_completed`, leaving UI cards stuck in `executing`. That
733
+ * is still right for a tool that merely broke. It is wrong for a screen
734
+ * that said `halt`: `screen.ts` throws `ToolResultHalted` instead of
735
+ * returning it so a catch this generic cannot flatten it into a failed
736
+ * `ToolResult` the model reads and works around.
729
737
  *
730
738
  * The return is the full `ToolResult`, not a narrowed literal: the
731
739
  * narrow version silently DROPPED `content`, so a tool returning an
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/runtime/query/executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,oCAAoC,CAAA;AAE1F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAGtE,OAAO,KAAK,EAAE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C;;;;OAIG;IACH,OAAO,CAAC,aAAa;IA8DrB,OAAO,CAAC,aAAa;CAmBrB"}
@@ -8,6 +8,7 @@ import { GENAI, NAMZU } from '../../constants/telemetry/index.js';
8
8
  import { buildProbeContext } from '../../probe/context.js';
9
9
  import { ProbeVetoError } from '../../probe/errors.js';
10
10
  import { probe as defaultProbeRegistry } from '../../probe/registry.js';
11
+ import { ToolResultHalted } from '../../registry/tool/screen.js';
11
12
  import { effectiveBashWorkingDirectory, pinBashWorkingDirectory, } from '../../tools/builtins/bash-cwd.js';
12
13
  import { BashTool } from '../../tools/builtins/bash.js';
13
14
  import { fingerprintContent } from '../../tools/builtins/content-fingerprint.js';
@@ -25,6 +26,7 @@ import { generateToolCallId } from '../../utils/id.js';
25
26
  import { compressShellOutput } from '../../utils/shell-compress.js';
26
27
  import { parseStructuredResultJson } from '../../utils/structured-result-json.js';
27
28
  import { bindOwner } from '../jobs/registry.js';
29
+ import { stillRunningResult } from './detached-calls.js';
28
30
  import { formatFailedToolOutput, hookNote, isUnregistered, prepareDirectCall, runPreToolHook, unknownToolMessage, } from './executor/tool-call-admission.js';
29
31
  import { describeVisibleFileEvidence, visibleFileEvidence, } from './file-evidence-context.js';
30
32
  import { seedObservationLedger } from './file-evidence-seed.js';
@@ -843,7 +845,7 @@ export class ToolExecutor {
843
845
  this.preparedBatches.add(batch);
844
846
  return batch;
845
847
  }
846
- async executeBatch(response, denials, prior, preparedBatch, declines, review) {
848
+ async executeBatch(response, denials, prior, preparedBatch, declines, review, detach) {
847
849
  const toolCalls = response.message.toolCalls;
848
850
  if (!toolCalls) {
849
851
  return { messages: [], results: [], observations: [] };
@@ -867,9 +869,9 @@ export class ToolExecutor {
867
869
  for (const call of toolCalls)
868
870
  if (!refused.has(call.id))
869
871
  refused.set(call.id, refusal);
870
- return await this.runBatch(toolCalls, refused, prior, owned, declines, review);
872
+ return await this.runBatch(toolCalls, refused, prior, owned, declines, review, detach);
871
873
  }
872
- return await this.runBatch(toolCalls, denials, prior, owned, declines, review);
874
+ return await this.runBatch(toolCalls, denials, prior, owned, declines, review, detach);
873
875
  }
874
876
  finally {
875
877
  // Cleared so a later single execution outside a batch resolves
@@ -877,7 +879,7 @@ export class ToolExecutor {
877
879
  this.batchMode = undefined;
878
880
  }
879
881
  }
880
- async runBatch(toolCalls, denials, prior, preparedBatch, declines, review) {
882
+ async runBatch(toolCalls, denials, prior, preparedBatch, declines, review, detach) {
881
883
  this.log.debug('Executing tool batch', {
882
884
  [NAMZU.TURN_ID]: this.config.turnId,
883
885
  'namzu.runtime.tool_count': toolCalls.length,
@@ -911,6 +913,18 @@ export class ToolExecutor {
911
913
  // (which let the last writer clobber the rest). Results are written by
912
914
  // index to preserve the original tool-call order.
913
915
  const results = new Array(toolCalls.length);
916
+ // Calls handed back to the model as still running (see `detach`), and the
917
+ // ones among them whose real outcome has been reported.
918
+ const handedBack = new Set();
919
+ const reported = new Set();
920
+ // Calls that have begun; one queued behind a serial or barrier call has not.
921
+ const started = new Set();
922
+ const reportLate = (outcome) => {
923
+ if (reported.has(outcome.toolCallId))
924
+ return;
925
+ reported.add(outcome.toolCallId);
926
+ detach?.calls.settle(outcome);
927
+ };
914
928
  const parallel = [];
915
929
  let serial = Promise.resolve();
916
930
  let barrier;
@@ -1027,7 +1041,28 @@ export class ToolExecutor {
1027
1041
  }
1028
1042
  const run = async () => {
1029
1043
  try {
1030
- results[i] = await this.executeSingle(toolCall, ctx, recordObservation, () => progress.close(), preparedCall);
1044
+ let outcome;
1045
+ started.add(toolCall.id);
1046
+ try {
1047
+ outcome = await this.executeSingle(toolCall, ctx, recordObservation, () => progress.close(), preparedCall);
1048
+ }
1049
+ catch (error) {
1050
+ // A call already answered with the placeholder has no batch
1051
+ // left to fail; its failure is its outcome.
1052
+ if (!handedBack.has(toolCall.id))
1053
+ throw error;
1054
+ reportLate({
1055
+ toolCallId: toolCall.id,
1056
+ toolName: toolCall.function.name,
1057
+ output: `Error: Tool "${toolCall.function.name}" did not complete — ${error instanceof Error ? error.message : String(error)}`,
1058
+ isError: true,
1059
+ });
1060
+ return;
1061
+ }
1062
+ if (handedBack.has(toolCall.id))
1063
+ reportLate(outcome);
1064
+ else
1065
+ results[i] = outcome;
1031
1066
  }
1032
1067
  finally {
1033
1068
  await progress.close();
@@ -1066,7 +1101,50 @@ export class ToolExecutor {
1066
1101
  });
1067
1102
  if (review)
1068
1103
  await this.walkReviewed(reviewUnits, results, review);
1069
- await Promise.all([...parallel, serial]);
1104
+ const completion = Promise.all([...parallel, serial]);
1105
+ if (detach && !review) {
1106
+ const first = await Promise.race([
1107
+ completion.then(() => 'finished'),
1108
+ detach.requested.then(() => 'requested'),
1109
+ ]);
1110
+ if (first === 'requested' && toolCalls.some((_, i) => results[i] === undefined)) {
1111
+ // The operator wrote while calls were still running. Answer each
1112
+ // unfinished call with the placeholder so the model can read the
1113
+ // message now; the calls keep running and report themselves.
1114
+ toolCalls.forEach((toolCall, i) => {
1115
+ if (results[i])
1116
+ return;
1117
+ handedBack.add(toolCall.id);
1118
+ detach.calls.begin(toolCall.id, toolCall.function.name);
1119
+ results[i] = {
1120
+ toolCallId: toolCall.id,
1121
+ toolName: toolCall.function.name,
1122
+ output: stillRunningResult(toolCall.function.name, started.has(toolCall.id)),
1123
+ isError: false,
1124
+ };
1125
+ });
1126
+ const settleRest = () => {
1127
+ for (const id of handedBack) {
1128
+ if (reported.has(id))
1129
+ continue;
1130
+ const name = toolCalls.find((call) => call.id === id)?.function.name ?? 'tool';
1131
+ reportLate({
1132
+ toolCallId: id,
1133
+ toolName: name,
1134
+ output: `Error: Tool "${name}" did not complete — the batch failed before it produced a result.`,
1135
+ isError: true,
1136
+ });
1137
+ }
1138
+ };
1139
+ completion.then(settleRest, settleRest);
1140
+ }
1141
+ else {
1142
+ await completion;
1143
+ }
1144
+ }
1145
+ else {
1146
+ await completion;
1147
+ }
1070
1148
  // Whatever failed above left a hole in `results`; fill every one, so
1071
1149
  // the invariant holds by construction rather than by everything having
1072
1150
  // gone well.
@@ -1542,6 +1620,12 @@ export class ToolExecutor {
1542
1620
  ...(this.config.additionalDirectories?.length
1543
1621
  ? { additionalDirectories: this.config.additionalDirectories }
1544
1622
  : {}),
1623
+ ...(this.config.authorizationGate
1624
+ ? {
1625
+ readDenied: (absolutePath) => this.evaluatePreparedAuthorization('read', { path: absolutePath })?.decision ===
1626
+ 'deny',
1627
+ }
1628
+ : {}),
1545
1629
  ...(this.outputDirectory()
1546
1630
  ? { retainedOutputDirectory: this.outputDirectory() }
1547
1631
  : {}),
@@ -1624,6 +1708,7 @@ export class ToolExecutor {
1624
1708
  }
1625
1709
  : {}),
1626
1710
  ...(this.config.onJobAwaited ? { onAwaited: this.config.onJobAwaited } : {}),
1711
+ ...(this.config.onJobCollected ? { onCollected: this.config.onJobCollected } : {}),
1627
1712
  ...(this.config.monitorTimeoutCapMs !== undefined
1628
1713
  ? { monitorTimeoutCapMs: this.config.monitorTimeoutCapMs }
1629
1714
  : {}),
@@ -2380,11 +2465,16 @@ export class ToolExecutor {
2380
2465
  };
2381
2466
  }
2382
2467
  /**
2383
- * One execution attempt, with a throw materialized as an error result.
2468
+ * One execution attempt, with a throw materialized as an error result —
2469
+ * except `ToolResultHalted`, which this deliberately lets through.
2384
2470
  *
2385
2471
  * an unhandled throw from `tools.execute(...)` used to
2386
2472
  * propagate up to `result.ts` as `turn_failed` without emitting a
2387
- * terminal `tool_completed`, leaving UI cards stuck in `executing`.
2473
+ * terminal `tool_completed`, leaving UI cards stuck in `executing`. That
2474
+ * is still right for a tool that merely broke. It is wrong for a screen
2475
+ * that said `halt`: `screen.ts` throws `ToolResultHalted` instead of
2476
+ * returning it so a catch this generic cannot flatten it into a failed
2477
+ * `ToolResult` the model reads and works around.
2388
2478
  *
2389
2479
  * The return is the full `ToolResult`, not a narrowed literal: the
2390
2480
  * narrow version silently DROPPED `content`, so a tool returning an
@@ -2396,6 +2486,8 @@ export class ToolExecutor {
2396
2486
  return await this.executeWithDeadline(toolName, input, toolContext, prepared);
2397
2487
  }
2398
2488
  catch (err) {
2489
+ if (err instanceof ToolResultHalted)
2490
+ throw err;
2399
2491
  const message = toErrorMessage(err);
2400
2492
  this.log.warn('Tool execution threw', {
2401
2493
  [NAMZU.TURN_ID]: this.config.turnId,