@namzu/sdk 5.1.0 → 6.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 (188) hide show
  1. package/CHANGELOG.md +465 -0
  2. package/dist/agents/__tests__/run-agent-forwarding.test.d.ts +2 -0
  3. package/dist/agents/__tests__/run-agent-forwarding.test.d.ts.map +1 -0
  4. package/dist/agents/__tests__/run-agent-forwarding.test.js +76 -0
  5. package/dist/agents/__tests__/run-agent-forwarding.test.js.map +1 -0
  6. package/dist/agents/__tests__/run-completed-stop-reason.test.d.ts +2 -0
  7. package/dist/agents/__tests__/run-completed-stop-reason.test.d.ts.map +1 -0
  8. package/dist/agents/__tests__/run-completed-stop-reason.test.js +50 -0
  9. package/dist/agents/__tests__/run-completed-stop-reason.test.js.map +1 -0
  10. package/dist/agents/index.d.ts +1 -0
  11. package/dist/agents/index.d.ts.map +1 -1
  12. package/dist/agents/index.js +4 -0
  13. package/dist/agents/index.js.map +1 -1
  14. package/dist/agents/runAgent.d.ts +34 -0
  15. package/dist/agents/runAgent.d.ts.map +1 -1
  16. package/dist/agents/runAgent.js +5 -3
  17. package/dist/agents/runAgent.js.map +1 -1
  18. package/dist/config/runtime.d.ts +30 -30
  19. package/dist/constants/tools/__tests__/dangerous-patterns.test.d.ts +2 -0
  20. package/dist/constants/tools/__tests__/dangerous-patterns.test.d.ts.map +1 -0
  21. package/dist/constants/tools/__tests__/dangerous-patterns.test.js +54 -0
  22. package/dist/constants/tools/__tests__/dangerous-patterns.test.js.map +1 -0
  23. package/dist/constants/tools/index.d.ts.map +1 -1
  24. package/dist/constants/tools/index.js +28 -1
  25. package/dist/constants/tools/index.js.map +1 -1
  26. package/dist/contracts/a2a.d.ts +44 -44
  27. package/dist/directory/__tests__/derive.test.d.ts +2 -0
  28. package/dist/directory/__tests__/derive.test.d.ts.map +1 -0
  29. package/dist/directory/__tests__/derive.test.js +111 -0
  30. package/dist/directory/__tests__/derive.test.js.map +1 -0
  31. package/dist/directory/__tests__/load-diagnostics.test.d.ts +2 -0
  32. package/dist/directory/__tests__/load-diagnostics.test.d.ts.map +1 -0
  33. package/dist/directory/__tests__/load-diagnostics.test.js +106 -0
  34. package/dist/directory/__tests__/load-diagnostics.test.js.map +1 -0
  35. package/dist/directory/__tests__/load-directory.test.d.ts +2 -0
  36. package/dist/directory/__tests__/load-directory.test.d.ts.map +1 -0
  37. package/dist/directory/__tests__/load-directory.test.js +196 -0
  38. package/dist/directory/__tests__/load-directory.test.js.map +1 -0
  39. package/dist/directory/__tests__/subagents.test.d.ts +2 -0
  40. package/dist/directory/__tests__/subagents.test.d.ts.map +1 -0
  41. package/dist/directory/__tests__/subagents.test.js +117 -0
  42. package/dist/directory/__tests__/subagents.test.js.map +1 -0
  43. package/dist/directory/__tests__/supervisor-budget.test.d.ts +2 -0
  44. package/dist/directory/__tests__/supervisor-budget.test.d.ts.map +1 -0
  45. package/dist/directory/__tests__/supervisor-budget.test.js +97 -0
  46. package/dist/directory/__tests__/supervisor-budget.test.js.map +1 -0
  47. package/dist/directory/derive-supervisor.d.ts +58 -0
  48. package/dist/directory/derive-supervisor.d.ts.map +1 -0
  49. package/dist/directory/derive-supervisor.js +88 -0
  50. package/dist/directory/derive-supervisor.js.map +1 -0
  51. package/dist/directory/derive.d.ts +12 -0
  52. package/dist/directory/derive.d.ts.map +1 -0
  53. package/dist/directory/derive.js +58 -0
  54. package/dist/directory/derive.js.map +1 -0
  55. package/dist/directory/index.d.ts +7 -0
  56. package/dist/directory/index.d.ts.map +1 -0
  57. package/dist/directory/index.js +5 -0
  58. package/dist/directory/index.js.map +1 -0
  59. package/dist/directory/load.d.ts +14 -0
  60. package/dist/directory/load.d.ts.map +1 -0
  61. package/dist/directory/load.js +488 -0
  62. package/dist/directory/load.js.map +1 -0
  63. package/dist/directory/scan.d.ts +36 -0
  64. package/dist/directory/scan.d.ts.map +1 -0
  65. package/dist/directory/scan.js +136 -0
  66. package/dist/directory/scan.js.map +1 -0
  67. package/dist/directory/types.d.ts +215 -0
  68. package/dist/directory/types.d.ts.map +1 -0
  69. package/dist/directory/types.js +8 -0
  70. package/dist/directory/types.js.map +1 -0
  71. package/dist/plugin/__tests__/path-containment.test.d.ts +2 -0
  72. package/dist/plugin/__tests__/path-containment.test.d.ts.map +1 -0
  73. package/dist/plugin/__tests__/path-containment.test.js +91 -0
  74. package/dist/plugin/__tests__/path-containment.test.js.map +1 -0
  75. package/dist/plugin/lifecycle.d.ts.map +1 -1
  76. package/dist/plugin/lifecycle.js +3 -3
  77. package/dist/plugin/lifecycle.js.map +1 -1
  78. package/dist/plugin/loader.d.ts.map +1 -1
  79. package/dist/plugin/loader.js +12 -2
  80. package/dist/plugin/loader.js.map +1 -1
  81. package/dist/provider/__tests__/model-version.test.d.ts +2 -0
  82. package/dist/provider/__tests__/model-version.test.d.ts.map +1 -0
  83. package/dist/provider/__tests__/model-version.test.js +80 -0
  84. package/dist/provider/__tests__/model-version.test.js.map +1 -0
  85. package/dist/provider/__tests__/strict-schema.test.d.ts +2 -0
  86. package/dist/provider/__tests__/strict-schema.test.d.ts.map +1 -0
  87. package/dist/provider/__tests__/strict-schema.test.js +157 -0
  88. package/dist/provider/__tests__/strict-schema.test.js.map +1 -0
  89. package/dist/provider/__tests__/vendor-detail.test.d.ts +2 -0
  90. package/dist/provider/__tests__/vendor-detail.test.d.ts.map +1 -0
  91. package/dist/provider/__tests__/vendor-detail.test.js +89 -0
  92. package/dist/provider/__tests__/vendor-detail.test.js.map +1 -0
  93. package/dist/provider/errors.d.ts +38 -5
  94. package/dist/provider/errors.d.ts.map +1 -1
  95. package/dist/provider/errors.js +107 -5
  96. package/dist/provider/errors.js.map +1 -1
  97. package/dist/provider/model-version.d.ts +60 -0
  98. package/dist/provider/model-version.d.ts.map +1 -0
  99. package/dist/provider/model-version.js +64 -0
  100. package/dist/provider/model-version.js.map +1 -0
  101. package/dist/provider/strict-schema.d.ts +49 -0
  102. package/dist/provider/strict-schema.d.ts.map +1 -0
  103. package/dist/provider/strict-schema.js +168 -0
  104. package/dist/provider/strict-schema.js.map +1 -0
  105. package/dist/public-runtime.d.ts +9 -1
  106. package/dist/public-runtime.d.ts.map +1 -1
  107. package/dist/public-runtime.js +27 -1
  108. package/dist/public-runtime.js.map +1 -1
  109. package/dist/public-types.d.ts +2 -0
  110. package/dist/public-types.d.ts.map +1 -1
  111. package/dist/registry/tool/__tests__/dialect.test.d.ts +2 -0
  112. package/dist/registry/tool/__tests__/dialect.test.d.ts.map +1 -0
  113. package/dist/registry/tool/__tests__/dialect.test.js +143 -0
  114. package/dist/registry/tool/__tests__/dialect.test.js.map +1 -0
  115. package/dist/registry/tool/__tests__/strict-registration.test.d.ts +2 -0
  116. package/dist/registry/tool/__tests__/strict-registration.test.d.ts.map +1 -0
  117. package/dist/registry/tool/__tests__/strict-registration.test.js +82 -0
  118. package/dist/registry/tool/__tests__/strict-registration.test.js.map +1 -0
  119. package/dist/registry/tool/dialect.d.ts +50 -0
  120. package/dist/registry/tool/dialect.d.ts.map +1 -0
  121. package/dist/registry/tool/dialect.js +131 -0
  122. package/dist/registry/tool/dialect.js.map +1 -0
  123. package/dist/registry/tool/execute.d.ts.map +1 -1
  124. package/dist/registry/tool/execute.js +16 -0
  125. package/dist/registry/tool/execute.js.map +1 -1
  126. package/dist/registry/toolset/catalog.d.ts.map +1 -1
  127. package/dist/registry/toolset/catalog.js +10 -5
  128. package/dist/registry/toolset/catalog.js.map +1 -1
  129. package/dist/runtime/query/__tests__/stream-recovery.test.js +6 -0
  130. package/dist/runtime/query/__tests__/stream-recovery.test.js.map +1 -1
  131. package/dist/runtime/query/result.d.ts.map +1 -1
  132. package/dist/runtime/query/result.js +11 -0
  133. package/dist/runtime/query/result.js.map +1 -1
  134. package/dist/tools/builtins/__tests__/edit-insert-reachable.test.js +7 -1
  135. package/dist/tools/builtins/__tests__/edit-insert-reachable.test.js.map +1 -1
  136. package/dist/tools/builtins/__tests__/edit.test.js +1 -1
  137. package/dist/tools/builtins/__tests__/edit.test.js.map +1 -1
  138. package/dist/tools/builtins/edit.d.ts.map +1 -1
  139. package/dist/tools/builtins/edit.js +20 -2
  140. package/dist/tools/builtins/edit.js.map +1 -1
  141. package/dist/types/plugin/index.d.ts +4 -4
  142. package/dist/types/provider/error.d.ts +20 -4
  143. package/dist/types/provider/error.d.ts.map +1 -1
  144. package/dist/types/run/events.d.ts +17 -2
  145. package/dist/types/run/events.d.ts.map +1 -1
  146. package/dist/types/run/events.js.map +1 -1
  147. package/dist/types/verification/index.d.ts +6 -6
  148. package/package.json +1 -1
  149. package/src/agents/__tests__/run-agent-forwarding.test.ts +85 -0
  150. package/src/agents/__tests__/run-completed-stop-reason.test.ts +59 -0
  151. package/src/agents/index.ts +8 -0
  152. package/src/agents/runAgent.ts +30 -4
  153. package/src/constants/tools/__tests__/dangerous-patterns.test.ts +62 -0
  154. package/src/constants/tools/index.ts +28 -1
  155. package/src/directory/__tests__/derive.test.ts +135 -0
  156. package/src/directory/__tests__/load-diagnostics.test.ts +126 -0
  157. package/src/directory/__tests__/load-directory.test.ts +243 -0
  158. package/src/directory/__tests__/subagents.test.ts +155 -0
  159. package/src/directory/__tests__/supervisor-budget.test.ts +117 -0
  160. package/src/directory/derive-supervisor.ts +149 -0
  161. package/src/directory/derive.ts +70 -0
  162. package/src/directory/index.ts +27 -0
  163. package/src/directory/load.ts +556 -0
  164. package/src/directory/scan.ts +163 -0
  165. package/src/directory/types.ts +254 -0
  166. package/src/plugin/__tests__/path-containment.test.ts +107 -0
  167. package/src/plugin/lifecycle.ts +3 -3
  168. package/src/plugin/loader.ts +12 -2
  169. package/src/provider/__tests__/model-version.test.ts +93 -0
  170. package/src/provider/__tests__/strict-schema.test.ts +189 -0
  171. package/src/provider/__tests__/vendor-detail.test.ts +107 -0
  172. package/src/provider/errors.ts +106 -5
  173. package/src/provider/model-version.ts +98 -0
  174. package/src/provider/strict-schema.ts +182 -0
  175. package/src/public-runtime.ts +38 -0
  176. package/src/public-types.ts +8 -0
  177. package/src/registry/tool/__tests__/dialect.test.ts +197 -0
  178. package/src/registry/tool/__tests__/strict-registration.test.ts +115 -0
  179. package/src/registry/tool/dialect.ts +136 -0
  180. package/src/registry/tool/execute.ts +16 -0
  181. package/src/registry/toolset/catalog.ts +10 -5
  182. package/src/runtime/query/__tests__/stream-recovery.test.ts +6 -0
  183. package/src/runtime/query/result.ts +11 -0
  184. package/src/tools/builtins/__tests__/edit-insert-reachable.test.ts +8 -2
  185. package/src/tools/builtins/__tests__/edit.test.ts +1 -1
  186. package/src/tools/builtins/edit.ts +20 -2
  187. package/src/types/provider/error.ts +20 -4
  188. package/src/types/run/events.ts +15 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,470 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - f8355de: a failed request now carries the provider's own account of why, scrubbed
8
+
9
+ `ProviderRequestError` has always declared a `detail` field. The constructor
10
+ never read it, so it existed and carried nothing, and the response body was
11
+ parsed to classify the failure and then dropped.
12
+
13
+ That was deliberate and it was an over-correction. An error body can echo a
14
+ request and a request can carry a credential — but a provider rejecting a
15
+ request also names the exact offending field, and deleting that sentence turns
16
+ a one-line diagnosis into hypothesis elimination against a live API. It did:
17
+ the wire spent a day of production downtime repeating
18
+ `tools.0.custom.input_schema: … must match JSON Schema draft 2020-12` while the
19
+ SDK removed the sentence before anyone could read it.
20
+
21
+ Scrubbing what is credential-shaped and keeping the rest is the trade that was
22
+ actually available. `detail` now carries the provider's message, truncated to
23
+ 400 characters, with API-key prefixes, bearer headers, cloud access-key ids and
24
+ credential-named JSON fields replaced by `[redacted]`. The same text reaches
25
+ `message`, so a log line that prints only the message is enough to act on.
26
+
27
+ It reaches the run too. `ProviderErrorInfo` — the metadata on failed runs and
28
+ `run_failed` events — had no `detail` field, so the sentence stopped at the
29
+ error object and a host rendering `run.lastProviderError` still had to parse
30
+ `error` to learn which parameter was rejected. That is the re-parsing the
31
+ structured field exists to avoid, so `detail` is on it now:
32
+
33
+ ```ts
34
+ if (run.lastProviderError?.kind === "bad_request") {
35
+ console.error(run.lastProviderError.detail);
36
+ }
37
+ ```
38
+
39
+ **Breaking.** The previous contract — "the response body is never interpolated
40
+ into the error message" — was documented, and code may depend on it. Two tests
41
+ in this repository did. If you log `ProviderRequestError.message` somewhere the
42
+ provider's own words must not appear, read `error.kind`, `error.status` and
43
+ `error.providerId` instead and build the string yourself; those are unchanged.
44
+
45
+ What has NOT changed is the `cause` chain: the raw body is still never attached
46
+ as `cause`. A `cause` survives every logger that serializes an error chain,
47
+ which is the channel that would leak the body regardless of what the message
48
+ says.
49
+
50
+ The strict-subset check learned the same lesson in the same release. Its
51
+ deny-list was derived from prose and was wrong in both directions — it refused
52
+ `minLength`/`maxLength`, which the wire accepts, so it would have blocked
53
+ working tools; and it permitted tuples, which the wire rejects, so it vouched
54
+ for a broken one. It is now measured against the live API, and the measurement
55
+ runs as a contract test rather than living in a comment. `minItems` in
56
+ particular is a bound on the _value_, not a rejected keyword: 0 and 1 pass and
57
+ anything above does not, so a required non-empty array is expressible again.
58
+
59
+ ### Minor Changes
60
+
61
+ - f8355de: tool schemas are rendered in the dialect each wire actually parses
62
+
63
+ A tool with a tuple-shaped field took down every request that offered it. The
64
+ kernel renders one canonical JSON Schema in draft-07, where a tuple is
65
+ `items: [a, b]`; one of the wires namzu speaks validates tool input as JSON
66
+ Schema 2020-12, where that spelling is invalid and a tuple must be
67
+ `prefixItems`. Every driver forwarded the rendering verbatim, so the built-in
68
+ `read` tool — whose `readRange` is a Zod tuple — produced a 400 that rejected
69
+ the **whole** request, taking every other tool in the call down with it. The
70
+ turn died before generating a token.
71
+
72
+ The failure had nothing to do with strict tool use, which is why the guard
73
+ added for the previous schema outage never saw it: it fires with strict
74
+ validation unset, and with strict on the dialect error arrives _first_.
75
+
76
+ Which dialect a wire parses is a property of the wire, so the conversion now
77
+ happens at each driver's boundary rather than in the renderer:
78
+
79
+ ```ts
80
+ import { toSchemaDialect, findDraft07Only } from "@namzu/sdk";
81
+
82
+ toSchemaDialect(schema, "2020-12"); // items: [a, b] -> prefixItems: [a, b]
83
+ findDraft07Only(schema); // paths that no 2020-12 parser will accept
84
+ ```
85
+
86
+ `renderToolSchema` is exported now too, so a caller assembling its own tool
87
+ payload gets the same memoized, `$schema`-stripped, deep-frozen rendering the
88
+ kernel puts on the wire — byte-identical across iterations, which matters
89
+ because the tools block sits at position 0 of the prompt-cache prefix.
90
+
91
+ `ToolCatalog` used to convert schemas through its own inline call with the same
92
+ options. Same output, none of the guarantees: no `$schema` stripping, no
93
+ memoization, no freeze. It goes through `renderToolSchema` now.
94
+
95
+ **Breaking, for the three drivers.** Their `@namzu/sdk` peer range was
96
+ `>=1.3.0` and is now `>=6.0.0`. That range was already wrong — the drivers call
97
+ kernel functions added well after 1.3.0 — and it would now let a package
98
+ manager install a combination that throws on every request carrying a tool.
99
+ Upgrade the kernel alongside the driver.
100
+
101
+ The conversion follows the model on multi-vendor wires. Bedrock's Converse API
102
+ carries several vendors through one request shape, and the 2020-12 requirement
103
+ was measured on one of them, so schemas bound for the others are left in the
104
+ dialect they were rendered in. Guessing there would trade a known break for an
105
+ unmeasured one.
106
+
107
+ ## 5.2.0
108
+
109
+ ### Minor Changes
110
+
111
+ - 604a56a: completed is not succeeded — run_completed says why it stopped, and namzu run exits accordingly
112
+
113
+ `run_failed` is emitted from exactly one place in the kernel: the throw path.
114
+ Every other way a run can end badly arrives as `run_completed` — the token
115
+ budget, the timeout, the iteration cap, a cancellation, a rejected plan, a
116
+ refused structured output, and both guardrails.
117
+
118
+ Measured: a `max_iterations` stop reports `status: 'completed'`, and the event
119
+ carried nothing that distinguished it from an answered question.
120
+
121
+ **SDK.** `run_completed` now carries `stopReason`. It is optional and additive,
122
+ so nothing breaks; a consumer that wants to tell "answered" from "ran out of
123
+ budget" no longer has to hold the `Run` alongside the event stream.
124
+
125
+ **CLI — read this before upgrading if you script `namzu run`.** The command
126
+ exited `0` for all of those. The sharp case is the output guardrail: an answer
127
+ that was _refused_ exited `0` with empty text, so
128
+
129
+ ```sh
130
+ namzu run "write the release notes" > notes.md && publish notes.md
131
+ ```
132
+
133
+ published an empty file and reported success. `namzu run` now exits `1` when
134
+ the run did not finish normally, and names the reason on stderr. The text still
135
+ prints — partial output is real output, and a caller who piped it wants what
136
+ there is — but `$?` can now say it is partial.
137
+
138
+ If you have a script that depends on `namzu run` exiting 0 for a truncated run,
139
+ it was depending on not being told. Check `$?` and read the stderr line.
140
+
141
+ Also in the CLI, internally: the `done` agent event's `finishReason?: string`
142
+ had no producer and no reader anywhere in the package, and the name belonged to
143
+ a different concept — a "finish reason" here is `MessageStopReason`, reported
144
+ per model message, not the run-level `StopReason` a caller asks about at the end
145
+ of a turn. Replaced by `stopReason`. The type is not exported from the package
146
+ entry, so this is internal.
147
+
148
+ - f25ebce: a model id's date suffix is no longer read as its minor version
149
+
150
+ Three copies of one regular expression matched Claude model ids — the capability
151
+ table plus two drivers — and all three had the same defect: the minor-version
152
+ group was `(\d+)`, which swallowed the 8-digit date suffix.
153
+
154
+ Measured against the shipped pattern:
155
+
156
+ ```
157
+ claude-sonnet-4-20250514 -> major=4 minor=20250514
158
+ claude-opus-4-1-20250805 -> major=4 minor=1
159
+ ```
160
+
161
+ So a dated id naming no minor version compared as enormously _newer_ than one
162
+ that does, and every capability gate keyed on `minor >= n` inverted for exactly
163
+ those ids. `claude-sonnet-4-20250514` was classified as a 4.7+ model: the driver
164
+ sent it `thinking: {type: 'adaptive'}`, silently discarding a caller's
165
+ `budgetTokens`, and cleared the 4.5 gate that enables strict tool inputs.
166
+
167
+ `parseClaudeModelVersion` and `claudeVersionAtLeast` are now exported from
168
+ `@namzu/sdk` and used by both drivers and the capability table. A real minor
169
+ version is one to three digits; a date is eight, and the group is bounded
170
+ accordingly. An id the parser does not recognise makes `claudeVersionAtLeast`
171
+ return `false` — a capability gate must not open for a name it does not
172
+ understand.
173
+
174
+ The comment above the old parser warned that "a second, subtly different model
175
+ matcher is how two capability decisions drift apart on the same model name."
176
+ There were three.
177
+
178
+ - 5496fb2: the agent-directory loader is part of the SDK
179
+
180
+ It shipped briefly as a separate package. The name was the tell: nothing fit.
181
+ `project` collided with `ProjectId`, the tenancy bucket every run already
182
+ carries, and it described a scope that no longer existed once `channels/` and
183
+ `schedules/` were cut. `agent-dir` was a hyphenated abbreviation, out of family
184
+ with `skills`, `plugin`, `registry`, `sandbox`.
185
+
186
+ A directory reader that needs the kernel to be useful is a function of the
187
+ kernel, not a product beside it. So it is one now:
188
+
189
+ ```ts
190
+ import { loadDirectory, deriveRunOptions, runAgent } from "@namzu/sdk";
191
+
192
+ const { manifest, ok, diagnostics } = await loadDirectory("./agent");
193
+ if (!ok) console.error(diagnostics);
194
+
195
+ const { output } = await runAgent(
196
+ deriveRunOptions(manifest, { provider, prompt: "What is the weather?" })
197
+ );
198
+ ```
199
+
200
+ Nothing about the convention changed — the same `agent.ts`, `instructions.md`,
201
+ `tools/`, `skills/`, `agents/` layout, the same `modules: 'skip'` mode, the same
202
+ diagnostics, the same `deriveSupervisorOptions` for a directory that declares
203
+ delegates. Only the import path and the names.
204
+
205
+ **Nobody has to migrate.** The package was never published — a `@namzu/project`
206
+ install has always 404'd — so there is no consumer to move and no deprecation
207
+ window owed. The rename that would have cost a major after publishing cost
208
+ nothing before it.
209
+
210
+ Renames, if you were following the source: `loadProject` → `loadDirectory`,
211
+ `ProjectManifest` → `DirectoryManifest`, `ProjectConfig` → `DirectoryConfig`,
212
+ `ProjectSlot` → `DirectorySlot`, `ProjectLoadResult` → `DirectoryLoadResult`,
213
+ `ProjectDiagnostic` → `DirectoryDiagnostic`, `LoadProjectOptions` →
214
+ `LoadDirectoryOptions`. `DiagnosticCode` and `DiagnosticSeverity` gained a
215
+ `Directory` prefix as well — bare, in a shared namespace, they read as the
216
+ SDK's own diagnostic vocabulary rather than one loader's.
217
+
218
+ A side effect worth naming: `@namzu/project` was the one package the release
219
+ pipeline could not publish, so every release since `#102` ended red on its
220
+ `E404`. That failure goes with it.
221
+
222
+ - ca64062: runAgent forwards skills and the verification gate
223
+
224
+ `runAgent` built its `drainQuery` call with an `as never` cast. The cast was
225
+ not load-bearing — removing it typechecks clean — but while it was there the
226
+ kernel seam was unchecked in both directions, and two options the kernel
227
+ accepts were never forwarded.
228
+
229
+ **`skills`** is the one with a caller. `@namzu/sdk` reads a whole `skills/`
230
+ directory, puts them on the options, and every one was dropped: the run was
231
+ assembled without them and nothing reported it. If you passed `skills` to
232
+ `runAgent` and wondered why the model behaved as though it had never seen them,
233
+ this is why. No change needed on your side — the field now arrives.
234
+
235
+ **`verificationGate`** is the safety one. The kernel builds a `VerificationGate`
236
+ from it and consults it on every tool call; the front door had no way to supply
237
+ one, so a `runAgent` run was strictly less mediated than a `drainQuery` run. A
238
+ host that hands `runAgent` an agent directory it did not write should now set
239
+ it.
240
+
241
+ Both are optional and default to today's behaviour, so nothing breaks.
242
+
243
+ Three fixes in `@namzu/sdk`, each a check that existed and read the wrong
244
+ thing:
245
+
246
+ - **A tool with no `inputSchema` is refused.** It used to pass `isToolDefinition`
247
+ — which checked only `name` and `execute` — register clean, then die inside
248
+ `toLLMTools()` on `inputSchema._def`, in a `TypeError` naming neither the tool
249
+ file nor the loader. The check is now the four fields `ToolDefinition`
250
+ declares as required, and no more: demanding `defineTool`'s extras would make
251
+ the loader refuse an object the SDK's own published type accepts. A directory
252
+ that previously loaded with `ok: true` and crashed on first use now loads with
253
+ `ok: false` and a `not_a_tool` diagnostic naming the file.
254
+ - **Import failures explain themselves again.** `explainImportFailure` chose its
255
+ hint by matching Node's error code against `err.message`, and Node does not
256
+ put the code in the message — probed: `ERR_MODULE_NOT_FOUND` arrives as
257
+ "Cannot find module …". Every hint in the function was unreachable. It reads
258
+ `err.code` now, and a Node too old for type stripping gets a hint of its own.
259
+ - **`metadata` values are checked.** Typed `Record<string, string>` and admitted
260
+ on `typeof === 'object'` alone, which an array also satisfies and which says
261
+ nothing about the values, so `{ count: 1 }` and `["a"]` both reached a
262
+ consumer that had been promised strings.
263
+
264
+ - 61ca851: a tool whose schema cannot carry the guarantee it asks for is refused at registration
265
+
266
+ The previous release fixed the `edit` tool's schema and added a check in the
267
+ Anthropic driver. That caught the bug, but in the wrong place: per request, in
268
+ one of the **two** drivers that mark tools strict, and only once something
269
+ actually ran.
270
+
271
+ `ToolRegistry` already refused `enforceModelInput` without a
272
+ `modelInputSchema`, and the comment above that check states the principle
273
+ exactly — _"Refusing at registration puts the error where the author can fix it
274
+ rather than at the first request."_ The rule was written down; the new check was
275
+ somewhere else.
276
+
277
+ It is now beside its sibling. One asks whether a model schema **exists**; the
278
+ other asks whether it can **carry the guarantee the tool just requested**. A
279
+ tool that asks for constrained generation and supplies a schema the constrained
280
+ dialect cannot express is wrong at the moment it is declared, whichever model it
281
+ later meets — so it never registers, and can never reach a request.
282
+
283
+ ```
284
+ Tool "edit" is marked for strict input validation, but its model-facing schema
285
+ uses 1 construct(s) the strict subset does not accept…
286
+ edit.properties.insertLine.oneOf — use `anyOf` — for disjoint branches the two are equivalent
287
+ ```
288
+
289
+ This is the only path that matters in practice: the kernel builds its tool list
290
+ with `ToolRegistry.toLLMTools()`, so every tool reaching a driver through the
291
+ normal loop passed the gate.
292
+
293
+ **A tool that never asked for the guarantee is untouched.** Without
294
+ `enforceModelInput` nothing is marked strict, the schema is sent as ordinary
295
+ JSON Schema, and `oneOf` is perfectly legal there. Refusing it would break
296
+ working setups for no reason.
297
+
298
+ `@namzu/http` also marks tools strict and had no check at all — the same bug
299
+ was reachable through it. It now has the driver-level check the Anthropic driver
300
+ already carried. Both remain as a second boundary for a host that hand-builds
301
+ `ChatCompletionParams` and calls a provider directly, bypassing the registry.
302
+
303
+ **If you author a tool with `enforceModelInput: true`,** a schema using `oneOf`,
304
+ `not`, `if`/`then`/`else`, numeric or length bounds, `patternProperties`, or an
305
+ `additionalProperties` other than `false` now throws at registration instead of
306
+ failing the first request that carries it. The message names the path and the
307
+ replacement.
308
+
309
+ - f25ebce: the edit tool's schema could not be sent under strict validation
310
+
311
+ Strict tool input is not "JSON Schema, enforced" — it is a **subset** of JSON
312
+ Schema, and a keyword outside that subset is not degraded. The vendor rejects
313
+ the whole request, so one unexpressible field in one tool takes every other
314
+ tool down with it and the turn dies before producing a token.
315
+
316
+ The `edit` tool declared its integer-or-`"end"` field with `oneOf`, which is
317
+ outside the subset while the equivalent `anyOf` is inside it. Measured against
318
+ the live API:
319
+
320
+ | body | result |
321
+ | ------------------------- | ------------------------------------------------ |
322
+ | `strict: true` + `oneOf` | **400** — `Schema type 'oneOf' is not supported` |
323
+ | `strict: false` + `oneOf` | accepted |
324
+ | `strict: true` + `anyOf` | accepted |
325
+
326
+ The middle row is why nothing caught it. Neither half is wrong on its own — the
327
+ schema is valid JSON Schema, and marking the tool strict is correct policy — so
328
+ no test of either one failed. Only the pairing did, and the pairing had no
329
+ owner. Every agent using the built-in `edit` tool on a model at or above the
330
+ strict gate lost its first tool-carrying turn to a 400.
331
+
332
+ `oneOf` is now `anyOf` (equivalent here — the branches are disjoint), and
333
+ `minimum` is gone from the model-facing schema for the same reason: numeric
334
+ bounds are outside the subset too. The bound is not lost, the execution schema
335
+ still enforces it.
336
+
337
+ **The general fix is the second half.** `assertStrictSchema` and
338
+ `findStrictSchemaViolations` are exported from `@namzu/sdk`, and the driver now
339
+ checks every schema it is about to mark strict — refusing with the exact path
340
+ and the remedy rather than letting the request go and getting back an error
341
+ that names the keyword but not where it lives:
342
+
343
+ ```
344
+ Tool "edit" is marked for strict input validation, but its model-facing schema
345
+ uses 1 construct(s) the strict subset does not accept…
346
+ edit.properties.insertLine.oneOf — use `anyOf` — for disjoint branches the two are equivalent
347
+ ```
348
+
349
+ A test sweeps every built-in tool that asks for strict validation, so the next
350
+ one is caught in the suite rather than in production.
351
+
352
+ - f25ebce: a directory-derived supervisor now has a token budget, a wall clock, and its skills
353
+
354
+ `BaseAgentConfig` declares `tokenBudget` and `timeoutMs` as **required**.
355
+ `deriveSupervisorOptions` supplied them only when `agent.ts` happened to name
356
+ them — the uncommon case — and an `as SupervisorAgentConfig` made that compile.
357
+ The returned object was therefore typed `tokenBudget: number` while holding
358
+ `undefined`.
359
+
360
+ That is not a type-level nicety. `buildLimitConfig` defaults only
361
+ `maxIterations`, so an undefined budget and timeout disable **both** hard stops:
362
+ a supervisor derived from a directory ran with no token cap and no wall clock.
363
+ And the child-spawn guard computes a delegate's allocation from the parent
364
+ budget, so `undefined` became `NaN` — and `NaN <= 0` is `false`, meaning the
365
+ refusal that exists to stop an unfunded child let it through with a `NaN`
366
+ budget.
367
+
368
+ Both now default to the same numbers `runAgent` uses, which are exported as
369
+ `DEFAULT_TOKEN_BUDGET`, `DEFAULT_TIMEOUT_MS` and `DEFAULT_MAX_ITERATIONS` so the
370
+ two front doors cannot drift. Anything `agent.ts` declares still wins, and
371
+ `overrides` still wins over that.
372
+
373
+ The cast is now `satisfies`, so the next missing required field is a compile
374
+ error rather than a run with its limits quietly switched off.
375
+
376
+ Same file, same cast: `skills` were loaded from the project's `skills/`
377
+ directory, put on the manifest, and then left out of the config the supervisor
378
+ actually ran with. `SupervisorAgentConfig` accepts them and the kernel drives
379
+ them; they are now supplied.
380
+
381
+ - c6b8aa8: An agent directory can declare delegates, and `deriveSupervisorOptions` turns them into
382
+ a `SupervisorAgent` configuration.
383
+
384
+ `SupervisorAgent` needs an `agentIds` roster and a manager that can spawn them.
385
+ Nothing led from a directory to either, so a multi-agent system could be
386
+ described on disk and not run.
387
+
388
+ A directory under `agents/` is read by the same loader that read the root — a
389
+ delegate has the same shape as its parent, so this is recursion rather than a
390
+ new concept.
391
+
392
+ ```
393
+ agent/
394
+ ├── instructions.md
395
+ └── agents/
396
+ ├── researcher/ ← its own agent.ts, instructions.md, tools/
397
+ └── writer/
398
+ ```
399
+
400
+ `deriveSupervisorOptions` supplies the roster and leaves the manager to the
401
+ host, the same contract `deriveRunOptions` follows: it converts, it does not
402
+ run. Delegates come back as plans rather than registered agents, because
403
+ registration mutates the host's manager and a function that quietly mutates an
404
+ object it was handed for reference is the surprise this package avoids.
405
+
406
+ A delegate may name its own model and inherits the coordinator's only when it
407
+ does not — a cheap model for a narrow job is the common case, and inheriting
408
+ unconditionally would bill every specialist at the coordinator's rate.
409
+
410
+ **One level only.** A delegate may not declare delegates of its own. How deep a
411
+ system fans out is a topology decision that belongs to whoever composes it, and
412
+ answering it by default is how a directory layout ends up deciding a system's
413
+ shape. It also removes the cycle: `agents/a/agents/b/agents/a` cannot be built
414
+ if the second level is never read.
415
+
416
+ A delegate that fails to load is reported in the parent's diagnostics, prefixed
417
+ with its path, and is not offered in the roster. A caller reading one list
418
+ should not have to walk the tree to find out the run will be short a specialist.
419
+
420
+ ### Patch Changes
421
+
422
+ - f25ebce: the fork-bomb entry in the dangerous-command list could not match a fork bomb
423
+
424
+ `DANGEROUS_PATTERNS` is what the `deny_dangerous_patterns` verification rule
425
+ consults, and what `namzu run`'s own docstring means when it promises that in a
426
+ non-interactive run "the safety gate still hard-denies catastrophic commands".
427
+
428
+ The fork-bomb entry was written `/:(){ :\|:& };:/`. In a regular expression
429
+ `()` is an empty capture group, not two literal parentheses — so that pattern
430
+ described the string `:{ :|:& };:`, which is not valid shell and which nobody
431
+ would ever type. Probed: it returned `false` for `:(){ :|:& };:` and for every
432
+ other spelling of it.
433
+
434
+ The replacement matches on **self-reference** rather than on one literal
435
+ spelling — a fork bomb is a function whose own name appears on both sides of a
436
+ pipe, is backgrounded, and is then invoked. So `bomb(){ bomb|bomb& }; bomb` is
437
+ denied along with the `:` form, while `watch(){ tail -f log | grep E & }` — a
438
+ function that merely contains a pipe and a background job — is not.
439
+
440
+ No test named a fork bomb before this change, which is how it survived. There
441
+ are now sixteen.
442
+
443
+ - c8672ed: The plugin subsystem contains its paths. It had none, and it is the part of
444
+ this SDK that loads third-party code.
445
+
446
+ **A manifest could name any file on disk.** `PluginLifecycleManager` built its
447
+ import path with `join(plugin.rootDir, toolPath)`, and `toolPath` comes out of
448
+ the plugin's own manifest — a file the plugin author writes. A manifest reading
449
+ `"tools": ["../../../../somewhere/evil.js"]` left the plugin directory entirely
450
+ and was imported, which is to say executed, in-process. The same held for
451
+ `hooks`. Both now resolve through `resolveWithinReal`, so a path that escapes
452
+ the plugin root is refused before anything is imported.
453
+
454
+ **Discovery followed symlinks.** `discoverPlugins` used `stat`, which reports
455
+ on a link's _target_, so a symlinked entry pointing anywhere on disk was
456
+ admitted as a plugin directory and its manifest read from there — the directory
457
+ listed was not the directory loaded (CWE-59). It now uses `lstat` and refuses a
458
+ link with a warning naming the path.
459
+
460
+ Found by comparing the plugin loader against `@namzu/sdk`'s scanner, which
461
+ was written this week with both protections. The subsystem that had them was
462
+ the one loading code the repo's own reviewers wrote; the one without them was
463
+ the one loading code from a home directory those reviewers never see.
464
+
465
+ If you ship a plugin whose manifest points outside its own directory, it now
466
+ fails at enable with a message naming the path. Move the file inside the plugin.
467
+
3
468
  ## 5.1.0
4
469
 
5
470
  ### Minor Changes
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=run-agent-forwarding.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-agent-forwarding.test.d.ts","sourceRoot":"","sources":["../../../src/agents/__tests__/run-agent-forwarding.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,76 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { z } from 'zod';
3
+ import { MockLLMProvider, registerMock } from '../../provider/index.js';
4
+ import { ToolRegistry } from '../../registry/index.js';
5
+ import { runAgent } from '../runAgent.js';
6
+ /**
7
+ * The `drainQuery` call in `runAgent` was written `as never`.
8
+ *
9
+ * That cast was not load-bearing — removing it typechecks clean — but while it
10
+ * was there the kernel seam was unchecked in both directions: a field the
11
+ * kernel accepts and this door forgot to forward produced no error, and neither
12
+ * did a field spelled wrong. Two were already missing when it was removed.
13
+ *
14
+ * `skills` is the one with a caller in this repo. `@namzu/project` reads a
15
+ * whole `skills/` directory, put them on the options, and every one was dropped
16
+ * on the floor — the run was assembled without them and said nothing. These
17
+ * pin the forwarding rather than the cast, because the cast can come back and
18
+ * a test that only asserted its absence would not notice.
19
+ */
20
+ registerMock();
21
+ describe('runAgent forwards what the kernel takes', () => {
22
+ it('puts skills in front of the model', async () => {
23
+ const provider = new MockLLMProvider({ turns: [{ text: 'ok' }] });
24
+ await runAgent({
25
+ provider,
26
+ model: 'mock-model',
27
+ prompt: 'plan something',
28
+ skills: [
29
+ {
30
+ metadata: { name: 'plan-a-trip', description: 'Plan a trip end to end' },
31
+ body: 'Ask for dates first.',
32
+ dirPath: '/tmp/skills/plan-a-trip',
33
+ },
34
+ ],
35
+ });
36
+ // Serialized rather than reached into: the prompt builder decides where a
37
+ // skill lands, and pinning that path here would make this test fail on a
38
+ // refactor that kept the behaviour. What matters is that it arrived.
39
+ expect(JSON.stringify(provider.requests[0])).toContain('plan-a-trip');
40
+ });
41
+ it('forwards the verification gate, so a denied tool does not run', async () => {
42
+ // The first version of this test asserted `run.status === 'completed'`
43
+ // with the gate set. It passed with the forwarding deleted — a run with
44
+ // no gate completes too — so it proved nothing. A gate is only observable
45
+ // through a call it stops, which means the assertion has to be about
46
+ // whether the tool body ran.
47
+ let ran = false;
48
+ const tools = new ToolRegistry();
49
+ tools.register({
50
+ name: 'delete_everything',
51
+ description: 'Deletes everything.',
52
+ inputSchema: z.object({}),
53
+ execute: async () => {
54
+ ran = true;
55
+ return { success: true, output: 'deleted' };
56
+ },
57
+ });
58
+ await runAgent({
59
+ provider: new MockLLMProvider({
60
+ turns: [{ toolCalls: [{ name: 'delete_everything', args: {} }] }, { text: 'done' }],
61
+ }),
62
+ model: 'mock-model',
63
+ prompt: 'clean up',
64
+ tools,
65
+ verificationGate: {
66
+ enabled: true,
67
+ rules: [{ type: 'deny_by_name', toolNames: ['delete_everything'] }],
68
+ allowReadOnlyTools: false,
69
+ denyDangerousPatterns: false,
70
+ logDecisions: false,
71
+ },
72
+ });
73
+ expect(ran).toBe(false);
74
+ });
75
+ });
76
+ //# sourceMappingURL=run-agent-forwarding.test.js.map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0EAA0E;QAC1E,qEAAqE;QACrE,6BAA6B;QAC7B,IAAI,GAAG,GAAG,KAAK,CAAA;QAEf,MAAM,KAAK,GAAG,IAAI,YAAY,EAAE,CAAA;QAChC,KAAK,CAAC,QAAQ,CAAC;YACd,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,KAAK,IAAI,EAAE;gBACnB,GAAG,GAAG,IAAI,CAAA;gBACV,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;YAC5C,CAAC;SACD,CAAC,CAAA;QAEF,MAAM,QAAQ,CAAC;YACd,QAAQ,EAAE,IAAI,eAAe,CAAC;gBAC7B,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;aACnF,CAAC;YACF,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,UAAU;YAClB,KAAK;YACL,gBAAgB,EAAE;gBACjB,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBACnE,kBAAkB,EAAE,KAAK;gBACzB,qBAAqB,EAAE,KAAK;gBAC5B,YAAY,EAAE,KAAK;aACnB;SACD,CAAC,CAAA;QAEF,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACxB,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=run-completed-stop-reason.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-completed-stop-reason.test.d.ts","sourceRoot":"","sources":["../../../src/agents/__tests__/run-completed-stop-reason.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { MockLLMProvider, registerMock } from '../../provider/index.js';
3
+ import { runAgent } from '../runAgent.js';
4
+ /**
5
+ * `completed` is not `succeeded`.
6
+ *
7
+ * `run_failed` is emitted from exactly one place — the throw path in
8
+ * `result.ts` — so every other way a run can end badly arrives as
9
+ * `run_completed`: the token budget, the timeout, the iteration cap, a
10
+ * cancellation, and a blocking output guardrail. A consumer reading that event
11
+ * as success reported one for a run whose answer was refused, and the CLI did:
12
+ * it mapped `run_completed` to a bare `done` and exited 0.
13
+ *
14
+ * Measured before the fix: a `max_iterations` stop reports
15
+ * `status: 'completed'`, and the event carried nothing to distinguish it.
16
+ */
17
+ registerMock();
18
+ async function eventsOf(options) {
19
+ const events = [];
20
+ await runAgent({ ...options, listener: (e) => void events.push(e) });
21
+ return events;
22
+ }
23
+ function completion(events) {
24
+ return events.find((e) => e.type === 'run_completed');
25
+ }
26
+ describe('run_completed says why the run stopped', () => {
27
+ it('reports end_turn when the model finished its answer', async () => {
28
+ const events = await eventsOf({
29
+ provider: new MockLLMProvider({ turns: [{ text: 'done' }] }),
30
+ model: 'mock-model',
31
+ prompt: 'x',
32
+ });
33
+ expect(completion(events)?.stopReason).toBe('end_turn');
34
+ });
35
+ it('reports max_iterations when the loop was cut short', async () => {
36
+ const events = await eventsOf({
37
+ provider: new MockLLMProvider({ turns: [{ toolCalls: [{ name: 'absent', args: {} }] }] }),
38
+ model: 'mock-model',
39
+ prompt: 'x',
40
+ maxIterations: 1,
41
+ });
42
+ const done = completion(events);
43
+ // The event that a consumer treats as "the run ended" — and the field
44
+ // that stops it being read as "the run succeeded".
45
+ expect(done).toBeDefined();
46
+ expect(done?.stopReason).toBe('max_iterations');
47
+ expect(events.some((e) => e.type === 'run_failed')).toBe(false);
48
+ });
49
+ });
50
+ //# sourceMappingURL=run-completed-stop-reason.test.js.map
@@ -0,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AE,KAAK,IAAI,EAAE;QACnE,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC;YAC7B,QAAQ,EAAE,IAAI,eAAe,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YACzF,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,GAAG;YACX,aAAa,EAAE,CAAC;SAChB,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAA;QAC/B,sEAAsE;QACtE,mDAAmD;QACnD,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAA;QAC1B,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC/C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAChE,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -8,5 +8,6 @@ export type { DefineAgentOptions } from './defineAgent.js';
8
8
  export { InvocationLock, ConcurrentInvocationError } from './lock.js';
9
9
  export type { Disposable } from './lock.js';
10
10
  export { runAgent } from './runAgent.js';
11
+ export { DEFAULT_MAX_ITERATIONS, DEFAULT_TIMEOUT_MS, DEFAULT_TOKEN_BUDGET, } from './runAgent.js';
11
12
  export type { AgentIdentity, RunAgentOptions, RunAgentResult } from './runAgent.js';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAA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M,eAAe,CAAA"}
@@ -6,4 +6,8 @@ export { SupervisorAgent } from './SupervisorAgent.js';
6
6
  export { defineAgent } from './defineAgent.js';
7
7
  export { InvocationLock, ConcurrentInvocationError } from './lock.js';
8
8
  export { runAgent } from './runAgent.js';
9
+ // The budgets the front door applies when a caller names none. Exported so a
10
+ // deriver that builds a config by hand lands on the SAME numbers rather than
11
+ // inventing its own or, as `@namzu/project` did, supplying none at all.
12
+ export { DEFAULT_MAX_ITERATIONS, DEFAULT_TIMEOUT_MS, DEFAULT_TOKEN_BUDGET, } from './runAgent.js';
9
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAA;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,6EAA6E;AAC7E,6EAA6E;AAC7E,wEAAwE;AACxE,OAAO,EACN,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GACpB,MAAM,eAAe,CAAA"}