fascicle 0.12.0 → 0.12.3

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 (49) hide show
  1. package/CHANGELOG.md +148 -32
  2. package/README.md +25 -15
  3. package/dist/{adapters-hmnJOOgf.js → adapters-CutexJd3.js} +12 -12
  4. package/dist/adapters-CutexJd3.js.map +1 -0
  5. package/dist/adapters.d.ts +10 -10
  6. package/dist/adapters.js +1 -1
  7. package/dist/agents.d.ts +22 -3
  8. package/dist/agents.js +74 -24
  9. package/dist/agents.js.map +1 -1
  10. package/dist/bin/fascicle-viewer.js +2 -2
  11. package/dist/{core-BkB2l1-e.js → core-DdJEhyQc.js} +314 -501
  12. package/dist/core-DdJEhyQc.js.map +1 -0
  13. package/dist/engine-J4lIxpw5.js +7000 -0
  14. package/dist/engine-J4lIxpw5.js.map +1 -0
  15. package/dist/index.d.ts +237 -178
  16. package/dist/index.js +617 -7771
  17. package/dist/index.js.map +1 -1
  18. package/dist/{invoke-JkzNf7-Y.js → invoke-CH_eJZeS.js} +8 -8
  19. package/dist/{invoke-JkzNf7-Y.js.map → invoke-CH_eJZeS.js.map} +1 -1
  20. package/dist/{leading_system-BVtGMweY.js → leading_system-BUCT-PwD.js} +31 -8
  21. package/dist/leading_system-BUCT-PwD.js.map +1 -0
  22. package/dist/mcp.d.ts +5 -5
  23. package/dist/mcp.js +10 -9
  24. package/dist/mcp.js.map +1 -1
  25. package/dist/otel.d.ts +1 -1
  26. package/dist/otel.js +4 -4
  27. package/dist/otel.js.map +1 -1
  28. package/dist/static/viewer.html +2 -1
  29. package/dist/stdio.d.ts +2 -2
  30. package/dist/stdio.js +2 -2
  31. package/dist/testing.d.ts +66 -15
  32. package/dist/testing.js +200 -34
  33. package/dist/testing.js.map +1 -1
  34. package/dist/trajectory-ByoOQZ6T.d.ts +114 -0
  35. package/dist/trajectory-D1eq9eue.js +81 -0
  36. package/dist/trajectory-D1eq9eue.js.map +1 -0
  37. package/dist/{types-BCtKsxrX.d.ts → types-BK0UW28o.d.ts} +3 -3
  38. package/dist/{types-CVdTBXE_.d.ts → types-DBpU27sQ.d.ts} +20 -3
  39. package/dist/{types-4l54cexm.d.ts → types-DU6cvoA4.d.ts} +9 -5
  40. package/dist/ui.d.ts +2 -2
  41. package/dist/ui.js +1 -1
  42. package/dist/ui.js.map +1 -1
  43. package/dist/viewer.d.ts +117 -0
  44. package/dist/viewer.js +659 -0
  45. package/dist/viewer.js.map +1 -0
  46. package/package.json +26 -12
  47. package/dist/adapters-hmnJOOgf.js.map +0 -1
  48. package/dist/core-BkB2l1-e.js.map +0 -1
  49. package/dist/leading_system-BVtGMweY.js.map +0 -1
package/dist/testing.js CHANGED
@@ -1,6 +1,16 @@
1
+ import { O as aborted_error } from "./core-DdJEhyQc.js";
2
+ import "./engine-J4lIxpw5.js";
3
+ import { y as schema_validation_error } from "./leading_system-BUCT-PwD.js";
1
4
  //#region src/testing/engine_from_generate.ts
2
5
  /**
3
6
  * Build an `Engine` whose only live member is the supplied `generate`.
7
+ *
8
+ * A custom double MUST implement only `generate`: accept `GenerateOptions`
9
+ * and resolve a complete `GenerateResult` (content, tool_calls, steps,
10
+ * usage, finish_reason, model_resolved). Honoring `opts.abort`,
11
+ * `opts.on_chunk`, and `opts.schema` is optional; honor whichever the code
12
+ * under test exercises. It need NOT implement pricing, `with_providers`, or
13
+ * `dispose`: this shell supplies the inert versions.
4
14
  */
5
15
  function engine_from_generate(generate) {
6
16
  return {
@@ -15,12 +25,175 @@ function engine_from_generate(generate) {
15
25
  };
16
26
  }
17
27
  //#endregion
18
- //#region src/testing/make_stub_engine.ts
28
+ //#region src/testing/make_capture_engine.ts
29
+ const DEFAULT_RESULT = {
30
+ content: "ok",
31
+ tool_calls: [],
32
+ steps: [],
33
+ usage: {
34
+ input_tokens: 1,
35
+ output_tokens: 1
36
+ },
37
+ finish_reason: "stop",
38
+ model_resolved: {
39
+ provider: "stub",
40
+ model_id: "capture"
41
+ }
42
+ };
43
+ /**
44
+ * Build an `Engine` that records each call's `GenerateOptions` into the
45
+ * returned `calls` array and answers with the canned result.
46
+ */
47
+ function make_capture_engine(options = {}) {
48
+ const calls = [];
49
+ const result = options.result ?? DEFAULT_RESULT;
50
+ return {
51
+ engine: engine_from_generate(async (opts) => {
52
+ const loose = opts;
53
+ calls.push(loose);
54
+ if (options.on_generate) await options.on_generate(loose);
55
+ return result;
56
+ }),
57
+ calls
58
+ };
59
+ }
60
+ //#endregion
61
+ //#region src/testing/canned.ts
62
+ /**
63
+ * Shared plumbing for the canned engine doubles.
64
+ *
65
+ * make_stub_engine and make_script_engine answer calls from fixtures rather
66
+ * than a provider, but the surrounding contract stays the engine's: a call
67
+ * under an already-aborted signal throws `aborted_error`, a streaming caller
68
+ * sees chunks before the result resolves, and content that fails the
69
+ * caller's schema surfaces as `schema_validation_error` carrying the issues.
70
+ * Keeping that contract here keeps every double interchangeable with a real
71
+ * engine at the seams tests exercise.
72
+ */
19
73
  const DEFAULT_USAGE = {
20
74
  input_tokens: 40,
21
75
  output_tokens: 20
22
76
  };
23
77
  /**
78
+ * Mirror the engine's entry guard: a generate call under an already-aborted
79
+ * signal never reaches a provider, so a double must refuse it the same way
80
+ * for cancellation tests to be trustworthy.
81
+ */
82
+ function throw_if_aborted(abort) {
83
+ if (abort?.aborted === true) throw new aborted_error("aborted", { reason: abort.reason });
84
+ }
85
+ /**
86
+ * Render canned content as the text a provider would have put on the wire:
87
+ * strings pass through, everything else is serialized as JSON (which is what
88
+ * a schema-bearing call would have streamed).
89
+ */
90
+ function render_text(content) {
91
+ if (typeof content === "string") return content;
92
+ return JSON.stringify(content) ?? "";
93
+ }
94
+ /**
95
+ * Emit the minimal chunk sequence a streaming caller expects: the whole
96
+ * content as one text chunk, then the finish marker. Enough for model_chunk
97
+ * trajectory events and stream-consuming UIs to fire without a network.
98
+ */
99
+ async function emit_chunks(on_chunk, content, finish_reason, usage) {
100
+ if (on_chunk === void 0) return;
101
+ await on_chunk({
102
+ kind: "text",
103
+ text: render_text(content),
104
+ step_index: 0
105
+ });
106
+ await on_chunk({
107
+ kind: "finish",
108
+ finish_reason,
109
+ usage
110
+ });
111
+ }
112
+ /**
113
+ * Render issues as one `path: message` line per issue, dotted the same way
114
+ * the engine's own repair prompts and error messages format them.
115
+ */
116
+ function format_issues(issues) {
117
+ return issues.map((issue) => issue.path === void 0 || issue.path.length === 0 ? issue.message : `${issue.path.map(String).join(".")}: ${issue.message}`).join("; ");
118
+ }
119
+ /**
120
+ * Validate canned content through the caller's schema, throwing the engine's
121
+ * own `schema_validation_error` on failure so `instanceof` handling in the
122
+ * code under test sees exactly what a real engine throws when its repair
123
+ * attempts run out. Absent a schema, the content passes through untouched.
124
+ */
125
+ async function validate_canned(schema, content, described) {
126
+ if (schema === void 0) return content;
127
+ const checked = await schema["~standard"].validate(content);
128
+ if (checked.issues !== void 0) {
129
+ const issues = checked.issues.map((issue) => issue.path === void 0 ? { message: issue.message } : {
130
+ message: issue.message,
131
+ path: issue.path.map((segment) => typeof segment === "object" ? segment.key : segment)
132
+ });
133
+ throw new schema_validation_error(`${described} failed the caller's schema: ${format_issues(issues)}`, issues, render_text(content));
134
+ }
135
+ return checked.value;
136
+ }
137
+ //#endregion
138
+ //#region src/testing/make_script_engine.ts
139
+ const SCRIPT_KEYS = /* @__PURE__ */ new Set([
140
+ "content",
141
+ "tool_calls",
142
+ "finish_reason",
143
+ "usage",
144
+ "throw"
145
+ ]);
146
+ /**
147
+ * Decide whether a queue entry is a ScriptResponse or plain content. Only a
148
+ * non-null, non-array object whose keys all belong to the ScriptResponse
149
+ * shape is scripted, so an arbitrary content fixture with its own keys
150
+ * passes through untouched rather than being half-read as a script entry.
151
+ */
152
+ function is_script_response(entry) {
153
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return false;
154
+ const keys = Object.keys(entry);
155
+ return keys.length > 0 && keys.every((key) => SCRIPT_KEYS.has(key));
156
+ }
157
+ /**
158
+ * Build an `Engine` that answers generate calls strictly in call order from
159
+ * `responses`, throwing once the queue is exhausted.
160
+ *
161
+ * `options` mirrors make_stub_engine's: `usage` is the default usage for
162
+ * entries that do not set their own (default `{ input_tokens: 40,
163
+ * output_tokens: 20 }`) and `model_id` sets `model_resolved.model_id`
164
+ * (default `'script'`). The provider always reports as `'stub'`.
165
+ */
166
+ function make_script_engine(responses, options = {}) {
167
+ const default_usage = options.usage ?? DEFAULT_USAGE;
168
+ const model_id = options.model_id ?? "script";
169
+ let call_count = 0;
170
+ return engine_from_generate(async (opts) => {
171
+ throw_if_aborted(opts.abort);
172
+ call_count += 1;
173
+ const index = call_count - 1;
174
+ if (index >= responses.length) throw new Error(`make_script_engine: script exhausted: ${responses.length} response(s) scripted, call ${call_count} received`);
175
+ const entry = responses[index];
176
+ const scripted = is_script_response(entry) ? entry : { content: entry };
177
+ if (scripted.throw !== void 0) throw scripted.throw;
178
+ const usage = scripted.usage ?? default_usage;
179
+ const finish_reason = scripted.finish_reason ?? "stop";
180
+ await emit_chunks(opts.on_chunk, scripted.content, finish_reason, usage);
181
+ return {
182
+ content: await validate_canned(opts.schema, scripted.content, `make_script_engine: scripted response ${index}`),
183
+ tool_calls: scripted.tool_calls === void 0 ? [] : [...scripted.tool_calls],
184
+ steps: [],
185
+ usage,
186
+ finish_reason,
187
+ model_resolved: {
188
+ provider: "stub",
189
+ model_id
190
+ }
191
+ };
192
+ });
193
+ }
194
+ //#endregion
195
+ //#region src/testing/make_stub_engine.ts
196
+ /**
24
197
  * Build an `Engine` that answers every generate call from `canned`,
25
198
  * routed by system-prompt prefix.
26
199
  *
@@ -32,14 +205,19 @@ const DEFAULT_USAGE = {
32
205
  function make_stub_engine(canned, options = {}) {
33
206
  const usage = options.usage ?? DEFAULT_USAGE;
34
207
  const model_id = options.model_id ?? "stub";
208
+ const match_counts = /* @__PURE__ */ new Map();
35
209
  return engine_from_generate(async (opts) => {
210
+ throw_if_aborted(opts.abort);
36
211
  const system = opts.system ?? "";
37
212
  const match = canned.find((c) => system.startsWith(c.prefix));
38
213
  if (match === void 0) throw new Error(`make_stub_engine: no canned response for system: ${system || "(none)"}`);
39
- const checked = await opts.schema?.["~standard"].validate(match.content);
40
- if (checked?.issues !== void 0) throw new Error(`make_stub_engine: canned response for prefix '${match.prefix}' failed the caller's schema`);
214
+ const call_index = match_counts.get(match) ?? 0;
215
+ match_counts.set(match, call_index + 1);
216
+ const loose = opts;
217
+ const produced = typeof match.content === "function" ? await match.content(loose, call_index) : match.content;
218
+ await emit_chunks(opts.on_chunk, produced, "stop", usage);
41
219
  return {
42
- content: checked === void 0 ? match.content : checked.value,
220
+ content: await validate_canned(opts.schema, produced, `make_stub_engine: canned response for prefix '${match.prefix}'`),
43
221
  tool_calls: [],
44
222
  steps: [],
45
223
  usage,
@@ -52,39 +230,27 @@ function make_stub_engine(canned, options = {}) {
52
230
  });
53
231
  }
54
232
  //#endregion
55
- //#region src/testing/make_capture_engine.ts
56
- const DEFAULT_RESULT = {
57
- content: "ok",
58
- tool_calls: [],
59
- steps: [],
60
- usage: {
61
- input_tokens: 1,
62
- output_tokens: 1
63
- },
64
- finish_reason: "stop",
65
- model_resolved: {
66
- provider: "stub",
67
- model_id: "capture"
68
- }
69
- };
233
+ //#region src/testing/text_of.ts
70
234
  /**
71
- * Build an `Engine` that records each call's `GenerateOptions` into the
72
- * returned `calls` array and answers with the canned result.
235
+ * Flatten the prompt's user-facing text into one string: a string prompt
236
+ * verbatim, otherwise every user turn's text (string content, or the `text`
237
+ * parts of a content-part array) joined with newlines. Total: absent or
238
+ * non-text content yields ''.
73
239
  */
74
- function make_capture_engine(options = {}) {
75
- const calls = [];
76
- const result = options.result ?? DEFAULT_RESULT;
77
- return {
78
- engine: engine_from_generate(async (opts) => {
79
- const loose = opts;
80
- calls.push(loose);
81
- if (options.on_generate) await options.on_generate(loose);
82
- return result;
83
- }),
84
- calls
85
- };
240
+ function text_of(opts) {
241
+ if (typeof opts.prompt === "string") return opts.prompt;
242
+ const texts = [];
243
+ for (const message of opts.prompt) {
244
+ if (message.role !== "user") continue;
245
+ if (typeof message.content === "string") {
246
+ texts.push(message.content);
247
+ continue;
248
+ }
249
+ for (const part of message.content) if (part.type === "text") texts.push(part.text);
250
+ }
251
+ return texts.join("\n");
86
252
  }
87
253
  //#endregion
88
- export { make_capture_engine, make_stub_engine };
254
+ export { engine_from_generate, make_capture_engine, make_script_engine, make_stub_engine, text_of };
89
255
 
90
256
  //# sourceMappingURL=testing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","names":[],"sources":["../src/testing/engine_from_generate.ts","../src/testing/make_stub_engine.ts","../src/testing/make_capture_engine.ts"],"sourcesContent":["/**\n * Wrap a canned `generate` function in a complete `Engine`.\n *\n * The remaining members are inert: pricing calls are no-ops that resolve\n * nothing, `dispose` resolves immediately, and `with_providers` throws\n * because a canned engine has no provider registry to derive from. Both\n * testing factories share this shell so a test double differs from a real\n * engine only in how `generate` answers.\n */\n\nimport type { Engine } from '#engine'\n\n/**\n * Build an `Engine` whose only live member is the supplied `generate`.\n */\nexport function engine_from_generate(generate: Engine['generate']): Engine {\n return {\n generate,\n register_price: () => {},\n resolve_price: () => undefined,\n list_prices: () => ({}),\n with_providers: () => {\n throw new Error('testing engines do not support with_providers')\n },\n dispose: async () => {},\n }\n}\n","/**\n * make_stub_engine: a canned, network-free `Engine` for tests and demos.\n *\n * Each generate call is routed by the system prompt's stable first line:\n * the first canned response whose `prefix` the system prompt starts with\n * answers the call, and an unmatched system throws, so a flow that grows a\n * new model boundary fails loudly instead of silently reusing a fixture.\n * A response with the empty-string prefix matches every call, which is the\n * single-model-boundary case.\n *\n * Canned content is validated through the caller's own schema\n * (`opts.schema['~standard'].validate`), so fixtures cannot drift from the\n * contracts they stand in for: a schema change breaks the test that ships\n * stale data.\n */\n\nimport type { Engine, GenerateOptions, GenerateResult, UsageTotals } from '#engine'\nimport { engine_from_generate } from './engine_from_generate.js'\n\nexport type StubResponse = {\n readonly prefix: string\n readonly content: unknown\n}\n\nexport type StubEngineOptions = {\n readonly usage?: UsageTotals\n readonly model_id?: string\n}\n\nconst DEFAULT_USAGE: UsageTotals = { input_tokens: 40, output_tokens: 20 }\n\n/**\n * Build an `Engine` that answers every generate call from `canned`,\n * routed by system-prompt prefix.\n *\n * `options.usage` sets the usage totals reported on every result (default\n * `{ input_tokens: 40, output_tokens: 20 }`, so cost lines render non-zero\n * numbers); `options.model_id` sets `model_resolved.model_id` (default\n * `'stub'`). The provider always reports as `'stub'`.\n */\nexport function make_stub_engine(\n canned: ReadonlyArray<StubResponse>,\n options: StubEngineOptions = {},\n): Engine {\n const usage = options.usage ?? DEFAULT_USAGE\n const model_id = options.model_id ?? 'stub'\n\n return engine_from_generate(\n async <t = string>(opts: GenerateOptions<t>): Promise<GenerateResult<t>> => {\n const system = opts.system ?? ''\n const match = canned.find((c) => system.startsWith(c.prefix))\n if (match === undefined) {\n throw new Error(`make_stub_engine: no canned response for system: ${system || '(none)'}`)\n }\n const checked = await opts.schema?.['~standard'].validate(match.content)\n if (checked?.issues !== undefined) {\n throw new Error(\n `make_stub_engine: canned response for prefix '${match.prefix}' failed the caller's schema`,\n )\n }\n const content = checked === undefined ? match.content : checked.value\n return {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n content: content as t,\n tool_calls: [],\n steps: [],\n usage,\n finish_reason: 'stop',\n model_resolved: { provider: 'stub', model_id },\n }\n },\n )\n}\n","/**\n * make_capture_engine: an `Engine` that records every generate call.\n *\n * Returns the engine together with the live `calls` array, which receives\n * the `GenerateOptions` of each call in order. Every call resolves with the\n * same canned result (`options.result`, or a minimal `'ok'` result), so the\n * double is for asserting what reached the engine, not for scripting\n * multi-role conversations: that is `make_stub_engine`'s job.\n *\n * `options.on_generate` runs after the call is recorded and is awaited\n * before the result resolves, which is the hook for driving streaming\n * chunks, spans, or aborts against the captured options.\n */\n\nimport type { Engine, GenerateOptions, GenerateResult } from '#engine'\nimport { engine_from_generate } from './engine_from_generate.js'\n\nexport type CaptureEngineOptions = {\n readonly result?: GenerateResult<unknown>\n readonly on_generate?: (opts: GenerateOptions) => Promise<void> | void\n}\n\nexport type CaptureEngine = {\n readonly engine: Engine\n readonly calls: GenerateOptions[]\n}\n\nconst DEFAULT_RESULT: GenerateResult<unknown> = {\n content: 'ok',\n tool_calls: [],\n steps: [],\n usage: { input_tokens: 1, output_tokens: 1 },\n finish_reason: 'stop',\n model_resolved: { provider: 'stub', model_id: 'capture' },\n}\n\n/**\n * Build an `Engine` that records each call's `GenerateOptions` into the\n * returned `calls` array and answers with the canned result.\n */\nexport function make_capture_engine(options: CaptureEngineOptions = {}): CaptureEngine {\n const calls: GenerateOptions[] = []\n const result = options.result ?? DEFAULT_RESULT\n\n const engine = engine_from_generate(\n async <t = string>(opts: GenerateOptions<t>): Promise<GenerateResult<t>> => {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const loose = opts as GenerateOptions\n calls.push(loose)\n if (options.on_generate) await options.on_generate(loose)\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return result as GenerateResult<t>\n },\n )\n return { engine, calls }\n}\n"],"mappings":";;;;AAeA,SAAgB,qBAAqB,UAAsC;CACzE,OAAO;EACL;EACA,sBAAsB,CAAC;EACvB,qBAAqB,KAAA;EACrB,oBAAoB,CAAC;EACrB,sBAAsB;GACpB,MAAM,IAAI,MAAM,+CAA+C;EACjE;EACA,SAAS,YAAY,CAAC;CACxB;AACF;;;ACGA,MAAM,gBAA6B;CAAE,cAAc;CAAI,eAAe;AAAG;;;;;;;;;;AAWzE,SAAgB,iBACd,QACA,UAA6B,CAAC,GACtB;CACR,MAAM,QAAQ,QAAQ,SAAS;CAC/B,MAAM,WAAW,QAAQ,YAAY;CAErC,OAAO,qBACL,OAAmB,SAAyD;EAC1E,MAAM,SAAS,KAAK,UAAU;EAC9B,MAAM,QAAQ,OAAO,MAAM,MAAM,OAAO,WAAW,EAAE,MAAM,CAAC;EAC5D,IAAI,UAAU,KAAA,GACZ,MAAM,IAAI,MAAM,oDAAoD,UAAU,UAAU;EAE1F,MAAM,UAAU,MAAM,KAAK,SAAS,YAAY,CAAC,SAAS,MAAM,OAAO;EACvE,IAAI,SAAS,WAAW,KAAA,GACtB,MAAM,IAAI,MACR,iDAAiD,MAAM,OAAO,6BAChE;EAGF,OAAO;GAEL,SAHc,YAAY,KAAA,IAAY,MAAM,UAAU,QAAQ;GAI9D,YAAY,CAAC;GACb,OAAO,CAAC;GACR;GACA,eAAe;GACf,gBAAgB;IAAE,UAAU;IAAQ;GAAS;EAC/C;CACF,CACF;AACF;;;AC7CA,MAAM,iBAA0C;CAC9C,SAAS;CACT,YAAY,CAAC;CACb,OAAO,CAAC;CACR,OAAO;EAAE,cAAc;EAAG,eAAe;CAAE;CAC3C,eAAe;CACf,gBAAgB;EAAE,UAAU;EAAQ,UAAU;CAAU;AAC1D;;;;;AAMA,SAAgB,oBAAoB,UAAgC,CAAC,GAAkB;CACrF,MAAM,QAA2B,CAAC;CAClC,MAAM,SAAS,QAAQ,UAAU;CAYjC,OAAO;EAAE,QAVM,qBACb,OAAmB,SAAyD;GAE1E,MAAM,QAAQ;GACd,MAAM,KAAK,KAAK;GAChB,IAAI,QAAQ,aAAa,MAAM,QAAQ,YAAY,KAAK;GAExD,OAAO;EACT,CAEY;EAAG;CAAM;AACzB"}
1
+ {"version":3,"file":"testing.js","names":[],"sources":["../src/testing/engine_from_generate.ts","../src/testing/make_capture_engine.ts","../src/testing/canned.ts","../src/testing/make_script_engine.ts","../src/testing/make_stub_engine.ts","../src/testing/text_of.ts"],"sourcesContent":["/**\n * Wrap a canned `generate` function in a complete `Engine`.\n *\n * The remaining members are inert: pricing calls are no-ops that resolve\n * nothing, `dispose` resolves immediately, and `with_providers` throws\n * because a canned engine has no provider registry to derive from. Both\n * testing factories share this shell so a test double differs from a real\n * engine only in how `generate` answers.\n */\n\nimport type { Engine } from '#engine'\n\n/**\n * Build an `Engine` whose only live member is the supplied `generate`.\n *\n * A custom double MUST implement only `generate`: accept `GenerateOptions`\n * and resolve a complete `GenerateResult` (content, tool_calls, steps,\n * usage, finish_reason, model_resolved). Honoring `opts.abort`,\n * `opts.on_chunk`, and `opts.schema` is optional; honor whichever the code\n * under test exercises. It need NOT implement pricing, `with_providers`, or\n * `dispose`: this shell supplies the inert versions.\n */\nexport function engine_from_generate(generate: Engine['generate']): Engine {\n return {\n generate,\n register_price: () => {},\n resolve_price: () => undefined,\n list_prices: () => ({}),\n with_providers: () => {\n throw new Error('testing engines do not support with_providers')\n },\n dispose: async () => {},\n }\n}\n","/**\n * make_capture_engine: an `Engine` that records every generate call.\n *\n * Returns the engine together with the live `calls` array, which receives\n * the `GenerateOptions` of each call in order. Every call resolves with the\n * same canned result (`options.result`, or a minimal `'ok'` result), so the\n * double is for asserting what reached the engine, not for scripting\n * multi-role conversations: that is `make_stub_engine`'s job.\n *\n * `options.on_generate` runs after the call is recorded and is awaited\n * before the result resolves, which is the hook for driving streaming\n * chunks, spans, or aborts against the captured options.\n */\n\nimport type { Engine, GenerateOptions, GenerateResult } from '#engine'\nimport { engine_from_generate } from './engine_from_generate.js'\n\nexport type CaptureEngineOptions = {\n readonly result?: GenerateResult<unknown>\n readonly on_generate?: (opts: GenerateOptions) => Promise<void> | void\n}\n\nexport type CaptureEngine = {\n readonly engine: Engine\n readonly calls: GenerateOptions[]\n}\n\nconst DEFAULT_RESULT: GenerateResult<unknown> = {\n content: 'ok',\n tool_calls: [],\n steps: [],\n usage: { input_tokens: 1, output_tokens: 1 },\n finish_reason: 'stop',\n model_resolved: { provider: 'stub', model_id: 'capture' },\n}\n\n/**\n * Build an `Engine` that records each call's `GenerateOptions` into the\n * returned `calls` array and answers with the canned result.\n */\nexport function make_capture_engine(options: CaptureEngineOptions = {}): CaptureEngine {\n const calls: GenerateOptions[] = []\n const result = options.result ?? DEFAULT_RESULT\n\n const engine = engine_from_generate(\n async <t = string>(opts: GenerateOptions<t>): Promise<GenerateResult<t>> => {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const loose = opts as GenerateOptions\n calls.push(loose)\n if (options.on_generate) await options.on_generate(loose)\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return result as GenerateResult<t>\n },\n )\n return { engine, calls }\n}\n","/**\n * Shared plumbing for the canned engine doubles.\n *\n * make_stub_engine and make_script_engine answer calls from fixtures rather\n * than a provider, but the surrounding contract stays the engine's: a call\n * under an already-aborted signal throws `aborted_error`, a streaming caller\n * sees chunks before the result resolves, and content that fails the\n * caller's schema surfaces as `schema_validation_error` carrying the issues.\n * Keeping that contract here keeps every double interchangeable with a real\n * engine at the seams tests exercise.\n */\n\nimport { aborted_error, schema_validation_error } from '#engine'\nimport type { FinishReason, GenerateOptions, UsageTotals } from '#engine'\n\nexport const DEFAULT_USAGE: UsageTotals = { input_tokens: 40, output_tokens: 20 }\n\n/**\n * Mirror the engine's entry guard: a generate call under an already-aborted\n * signal never reaches a provider, so a double must refuse it the same way\n * for cancellation tests to be trustworthy.\n */\nexport function throw_if_aborted(abort: AbortSignal | undefined): void {\n if (abort?.aborted === true) {\n throw new aborted_error('aborted', { reason: abort.reason })\n }\n}\n\n/**\n * Render canned content as the text a provider would have put on the wire:\n * strings pass through, everything else is serialized as JSON (which is what\n * a schema-bearing call would have streamed).\n */\nfunction render_text(content: unknown): string {\n if (typeof content === 'string') return content\n return JSON.stringify(content) ?? ''\n}\n\n/**\n * Emit the minimal chunk sequence a streaming caller expects: the whole\n * content as one text chunk, then the finish marker. Enough for model_chunk\n * trajectory events and stream-consuming UIs to fire without a network.\n */\nexport async function emit_chunks(\n on_chunk: GenerateOptions['on_chunk'],\n content: unknown,\n finish_reason: FinishReason,\n usage: UsageTotals,\n): Promise<void> {\n if (on_chunk === undefined) return\n await on_chunk({ kind: 'text', text: render_text(content), step_index: 0 })\n await on_chunk({ kind: 'finish', finish_reason, usage })\n}\n\ntype CannedIssue = {\n readonly message: string\n readonly path?: ReadonlyArray<PropertyKey>\n}\n\n/**\n * Render issues as one `path: message` line per issue, dotted the same way\n * the engine's own repair prompts and error messages format them.\n */\nfunction format_issues(issues: ReadonlyArray<CannedIssue>): string {\n return issues\n .map((issue) =>\n issue.path === undefined || issue.path.length === 0\n ? issue.message\n : `${issue.path.map(String).join('.')}: ${issue.message}`,\n )\n .join('; ')\n}\n\n/**\n * Validate canned content through the caller's schema, throwing the engine's\n * own `schema_validation_error` on failure so `instanceof` handling in the\n * code under test sees exactly what a real engine throws when its repair\n * attempts run out. Absent a schema, the content passes through untouched.\n */\nexport async function validate_canned(\n schema: GenerateOptions<unknown>['schema'],\n content: unknown,\n described: string,\n): Promise<unknown> {\n if (schema === undefined) return content\n const checked = await schema['~standard'].validate(content)\n if (checked.issues !== undefined) {\n // The spec allows a path segment to be a bare key or a `{ key }` wrapper;\n // normalize to bare keys so schema_issues reads one shape, as the real\n // engine's validator does.\n const issues: CannedIssue[] = checked.issues.map((issue) =>\n issue.path === undefined\n ? { message: issue.message }\n : {\n message: issue.message,\n path: issue.path.map((segment) =>\n typeof segment === 'object' ? segment.key : segment,\n ),\n },\n )\n throw new schema_validation_error(\n `${described} failed the caller's schema: ${format_issues(issues)}`,\n issues,\n render_text(content),\n )\n }\n return checked.value\n}\n","/**\n * make_script_engine: a queue of canned responses consumed in call order.\n *\n * Where make_stub_engine routes by system-prompt prefix and cannot tell\n * call 3 from call 1, a script cares only about order: the first generate\n * call gets the first entry, the second the next, and a call past the end\n * throws naming how many responses were scripted versus received, so a flow\n * that makes an unexpected extra model call fails loudly. That makes it the\n * double for loops that must converge, retry paths, and flows whose calls a\n * prefix cannot distinguish (a markdown-only define_agent sends no system\n * prompt at all, so every call looks alike to a stub).\n *\n * An entry is plain content, or a `ScriptResponse` object when the call\n * should carry tool calls, report a different finish reason or usage, or\n * throw a scripted error (a rate_limit_error, a provider_error) instead of\n * answering. Only an object whose keys ALL belong to the ScriptResponse\n * shape is treated as scripted; any other value, `{ verdict: 'ship' }`\n * included, becomes content as-is. Wrap literal content that collides with\n * the shape in `{ content }`.\n *\n * Scripted content is validated through the caller's schema, and the abort\n * and on_chunk contracts match make_stub_engine's; see ./canned.ts.\n */\n\nimport type {\n Engine,\n FinishReason,\n GenerateOptions,\n GenerateResult,\n ToolCallRecord,\n UsageTotals,\n} from '#engine'\nimport { DEFAULT_USAGE, emit_chunks, throw_if_aborted, validate_canned } from './canned.js'\nimport { engine_from_generate } from './engine_from_generate.js'\n\nexport type ScriptResponse = {\n readonly content?: unknown\n readonly tool_calls?: ReadonlyArray<ToolCallRecord>\n readonly finish_reason?: FinishReason\n readonly usage?: UsageTotals\n /** An error to throw for this call instead of answering. */\n readonly throw?: Error\n}\n\nexport type ScriptEngineOptions = {\n readonly usage?: UsageTotals\n readonly model_id?: string\n}\n\nconst SCRIPT_KEYS = new Set(['content', 'tool_calls', 'finish_reason', 'usage', 'throw'])\n\n/**\n * Decide whether a queue entry is a ScriptResponse or plain content. Only a\n * non-null, non-array object whose keys all belong to the ScriptResponse\n * shape is scripted, so an arbitrary content fixture with its own keys\n * passes through untouched rather than being half-read as a script entry.\n */\nfunction is_script_response(entry: unknown): entry is ScriptResponse {\n if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return false\n const keys = Object.keys(entry)\n return keys.length > 0 && keys.every((key) => SCRIPT_KEYS.has(key))\n}\n\n/**\n * Build an `Engine` that answers generate calls strictly in call order from\n * `responses`, throwing once the queue is exhausted.\n *\n * `options` mirrors make_stub_engine's: `usage` is the default usage for\n * entries that do not set their own (default `{ input_tokens: 40,\n * output_tokens: 20 }`) and `model_id` sets `model_resolved.model_id`\n * (default `'script'`). The provider always reports as `'stub'`.\n */\nexport function make_script_engine(\n responses: ReadonlyArray<unknown>,\n options: ScriptEngineOptions = {},\n): Engine {\n const default_usage = options.usage ?? DEFAULT_USAGE\n const model_id = options.model_id ?? 'script'\n let call_count = 0\n\n return engine_from_generate(\n async <t = string>(opts: GenerateOptions<t>): Promise<GenerateResult<t>> => {\n throw_if_aborted(opts.abort)\n call_count += 1\n const index = call_count - 1\n if (index >= responses.length) {\n throw new Error(\n `make_script_engine: script exhausted: ${responses.length} response(s) scripted, call ${call_count} received`,\n )\n }\n const entry = responses[index]\n const scripted: ScriptResponse = is_script_response(entry) ? entry : { content: entry }\n if (scripted.throw !== undefined) throw scripted.throw\n const usage = scripted.usage ?? default_usage\n const finish_reason = scripted.finish_reason ?? 'stop'\n // Chunks carry the raw scripted content, before validation, mirroring a\n // real stream where text flows and only then gets validated.\n await emit_chunks(opts.on_chunk, scripted.content, finish_reason, usage)\n const content = await validate_canned(\n opts.schema,\n scripted.content,\n `make_script_engine: scripted response ${index}`,\n )\n return {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n content: content as t,\n tool_calls: scripted.tool_calls === undefined ? [] : [...scripted.tool_calls],\n steps: [],\n usage,\n finish_reason,\n model_resolved: { provider: 'stub', model_id },\n }\n },\n )\n}\n","/**\n * make_stub_engine: a canned, network-free `Engine` for tests and demos.\n *\n * Each generate call is routed by the system prompt's stable first line:\n * the first canned response whose `prefix` the system prompt starts with\n * answers the call, and an unmatched system throws, so a flow that grows a\n * new model boundary fails loudly instead of silently reusing a fixture.\n * A response with the empty-string prefix matches every call, which is the\n * single-model-boundary case.\n *\n * A response's `content` may be a function of `(opts, call_index)` for\n * routes a flow hits more than once (a converging loop, a judged retry):\n * `call_index` counts how many times that route has matched before,\n * starting at 0, so each pass can answer differently.\n *\n * Canned content is validated through the caller's own schema\n * (`opts.schema['~standard'].validate`), so fixtures cannot drift from the\n * contracts they stand in for. A failure throws the engine's own\n * `schema_validation_error` carrying the issues and the canned content as\n * `raw_text`, exactly what a real engine throws when repair attempts run\n * out, so `instanceof` handling in the code under test stays testable.\n *\n * The engine's streaming and cancellation contract holds too: an\n * already-aborted `opts.abort` throws `aborted_error`, and a provided\n * `opts.on_chunk` receives the canned content as a text chunk plus a finish\n * chunk before the result resolves.\n */\n\nimport type { Engine, GenerateOptions, GenerateResult, UsageTotals } from '#engine'\nimport { DEFAULT_USAGE, emit_chunks, throw_if_aborted, validate_canned } from './canned.js'\nimport { engine_from_generate } from './engine_from_generate.js'\n\n/**\n * The function form of canned content: called with the routed call's options\n * and how many times this prefix route has matched before (starting 0). May\n * be async; the returned value is validated and answered like static content.\n */\nexport type StubContentFn = (opts: GenerateOptions, call_index: number) => unknown\n\nexport type StubResponse = {\n readonly prefix: string\n /** Static content, or a `StubContentFn` invoked per matched call. */\n readonly content: unknown\n}\n\nexport type StubEngineOptions = {\n readonly usage?: UsageTotals\n readonly model_id?: string\n}\n\n/**\n * Build an `Engine` that answers every generate call from `canned`,\n * routed by system-prompt prefix.\n *\n * `options.usage` sets the usage totals reported on every result (default\n * `{ input_tokens: 40, output_tokens: 20 }`, so cost lines render non-zero\n * numbers); `options.model_id` sets `model_resolved.model_id` (default\n * `'stub'`). The provider always reports as `'stub'`.\n */\nexport function make_stub_engine(\n canned: ReadonlyArray<StubResponse>,\n options: StubEngineOptions = {},\n): Engine {\n const usage = options.usage ?? DEFAULT_USAGE\n const model_id = options.model_id ?? 'stub'\n const match_counts = new Map<StubResponse, number>()\n\n return engine_from_generate(\n async <t = string>(opts: GenerateOptions<t>): Promise<GenerateResult<t>> => {\n throw_if_aborted(opts.abort)\n const system = opts.system ?? ''\n const match = canned.find((c) => system.startsWith(c.prefix))\n if (match === undefined) {\n throw new Error(`make_stub_engine: no canned response for system: ${system || '(none)'}`)\n }\n const call_index = match_counts.get(match) ?? 0\n match_counts.set(match, call_index + 1)\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n const loose = opts as GenerateOptions\n const produced =\n typeof match.content === 'function'\n ? // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n await (match.content as StubContentFn)(loose, call_index)\n : match.content\n // Chunks carry the raw canned content, before validation, mirroring a\n // real stream where text flows and only then gets validated.\n await emit_chunks(opts.on_chunk, produced, 'stop', usage)\n const content = await validate_canned(\n opts.schema,\n produced,\n `make_stub_engine: canned response for prefix '${match.prefix}'`,\n )\n return {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n content: content as t,\n tool_calls: [],\n steps: [],\n usage,\n finish_reason: 'stop',\n model_resolved: { provider: 'stub', model_id },\n }\n },\n )\n}\n","/**\n * text_of: the user-visible prompt text of a captured GenerateOptions.\n *\n * Capture assertions care about what the model was asked, not how the prompt\n * was encoded. A prompt is a bare string or a Message[] whose user turns\n * carry either a string or typed content parts; navigating\n * `calls[0].prompt[0].content[0].text` by hand couples every assertion to\n * one encoding. System and assistant text are excluded on purpose: assert\n * those through `opts.system` and the raw messages.\n */\n\nimport type { GenerateOptions } from '#engine'\n\n/**\n * Flatten the prompt's user-facing text into one string: a string prompt\n * verbatim, otherwise every user turn's text (string content, or the `text`\n * parts of a content-part array) joined with newlines. Total: absent or\n * non-text content yields ''.\n */\nexport function text_of<t = unknown>(opts: GenerateOptions<t>): string {\n if (typeof opts.prompt === 'string') return opts.prompt\n const texts: string[] = []\n for (const message of opts.prompt) {\n if (message.role !== 'user') continue\n if (typeof message.content === 'string') {\n texts.push(message.content)\n continue\n }\n for (const part of message.content) {\n if (part.type === 'text') texts.push(part.text)\n }\n }\n return texts.join('\\n')\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,SAAgB,qBAAqB,UAAsC;CACzE,OAAO;EACL;EACA,sBAAsB,CAAC;EACvB,qBAAqB,KAAA;EACrB,oBAAoB,CAAC;EACrB,sBAAsB;GACpB,MAAM,IAAI,MAAM,+CAA+C;EACjE;EACA,SAAS,YAAY,CAAC;CACxB;AACF;;;ACNA,MAAM,iBAA0C;CAC9C,SAAS;CACT,YAAY,CAAC;CACb,OAAO,CAAC;CACR,OAAO;EAAE,cAAc;EAAG,eAAe;CAAE;CAC3C,eAAe;CACf,gBAAgB;EAAE,UAAU;EAAQ,UAAU;CAAU;AAC1D;;;;;AAMA,SAAgB,oBAAoB,UAAgC,CAAC,GAAkB;CACrF,MAAM,QAA2B,CAAC;CAClC,MAAM,SAAS,QAAQ,UAAU;CAYjC,OAAO;EAAE,QAVM,qBACb,OAAmB,SAAyD;GAE1E,MAAM,QAAQ;GACd,MAAM,KAAK,KAAK;GAChB,IAAI,QAAQ,aAAa,MAAM,QAAQ,YAAY,KAAK;GAExD,OAAO;EACT,CAEY;EAAG;CAAM;AACzB;;;;;;;;;;;;;;ACxCA,MAAa,gBAA6B;CAAE,cAAc;CAAI,eAAe;AAAG;;;;;;AAOhF,SAAgB,iBAAiB,OAAsC;CACrE,IAAI,OAAO,YAAY,MACrB,MAAM,IAAI,cAAc,WAAW,EAAE,QAAQ,MAAM,OAAO,CAAC;AAE/D;;;;;;AAOA,SAAS,YAAY,SAA0B;CAC7C,IAAI,OAAO,YAAY,UAAU,OAAO;CACxC,OAAO,KAAK,UAAU,OAAO,KAAK;AACpC;;;;;;AAOA,eAAsB,YACpB,UACA,SACA,eACA,OACe;CACf,IAAI,aAAa,KAAA,GAAW;CAC5B,MAAM,SAAS;EAAE,MAAM;EAAQ,MAAM,YAAY,OAAO;EAAG,YAAY;CAAE,CAAC;CAC1E,MAAM,SAAS;EAAE,MAAM;EAAU;EAAe;CAAM,CAAC;AACzD;;;;;AAWA,SAAS,cAAc,QAA4C;CACjE,OAAO,OACJ,KAAK,UACJ,MAAM,SAAS,KAAA,KAAa,MAAM,KAAK,WAAW,IAC9C,MAAM,UACN,GAAG,MAAM,KAAK,IAAI,MAAM,CAAC,CAAC,KAAK,GAAG,EAAE,IAAI,MAAM,SACpD,CAAC,CACA,KAAK,IAAI;AACd;;;;;;;AAQA,eAAsB,gBACpB,QACA,SACA,WACkB;CAClB,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,UAAU,MAAM,OAAO,YAAY,CAAC,SAAS,OAAO;CAC1D,IAAI,QAAQ,WAAW,KAAA,GAAW;EAIhC,MAAM,SAAwB,QAAQ,OAAO,KAAK,UAChD,MAAM,SAAS,KAAA,IACX,EAAE,SAAS,MAAM,QAAQ,IACzB;GACE,SAAS,MAAM;GACf,MAAM,MAAM,KAAK,KAAK,YACpB,OAAO,YAAY,WAAW,QAAQ,MAAM,OAC9C;EACF,CACN;EACA,MAAM,IAAI,wBACR,GAAG,UAAU,+BAA+B,cAAc,MAAM,KAChE,QACA,YAAY,OAAO,CACrB;CACF;CACA,OAAO,QAAQ;AACjB;;;AC1DA,MAAM,8BAAc,IAAI,IAAI;CAAC;CAAW;CAAc;CAAiB;CAAS;AAAO,CAAC;;;;;;;AAQxF,SAAS,mBAAmB,OAAyC;CACnE,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG,OAAO;CAChF,MAAM,OAAO,OAAO,KAAK,KAAK;CAC9B,OAAO,KAAK,SAAS,KAAK,KAAK,OAAO,QAAQ,YAAY,IAAI,GAAG,CAAC;AACpE;;;;;;;;;;AAWA,SAAgB,mBACd,WACA,UAA+B,CAAC,GACxB;CACR,MAAM,gBAAgB,QAAQ,SAAS;CACvC,MAAM,WAAW,QAAQ,YAAY;CACrC,IAAI,aAAa;CAEjB,OAAO,qBACL,OAAmB,SAAyD;EAC1E,iBAAiB,KAAK,KAAK;EAC3B,cAAc;EACd,MAAM,QAAQ,aAAa;EAC3B,IAAI,SAAS,UAAU,QACrB,MAAM,IAAI,MACR,yCAAyC,UAAU,OAAO,8BAA8B,WAAW,UACrG;EAEF,MAAM,QAAQ,UAAU;EACxB,MAAM,WAA2B,mBAAmB,KAAK,IAAI,QAAQ,EAAE,SAAS,MAAM;EACtF,IAAI,SAAS,UAAU,KAAA,GAAW,MAAM,SAAS;EACjD,MAAM,QAAQ,SAAS,SAAS;EAChC,MAAM,gBAAgB,SAAS,iBAAiB;EAGhD,MAAM,YAAY,KAAK,UAAU,SAAS,SAAS,eAAe,KAAK;EAMvE,OAAO;GAEL,SAAS,MAPW,gBACpB,KAAK,QACL,SAAS,SACT,yCAAyC,OAC3C;GAIE,YAAY,SAAS,eAAe,KAAA,IAAY,CAAC,IAAI,CAAC,GAAG,SAAS,UAAU;GAC5E,OAAO,CAAC;GACR;GACA;GACA,gBAAgB;IAAE,UAAU;IAAQ;GAAS;EAC/C;CACF,CACF;AACF;;;;;;;;;;;;ACvDA,SAAgB,iBACd,QACA,UAA6B,CAAC,GACtB;CACR,MAAM,QAAQ,QAAQ,SAAS;CAC/B,MAAM,WAAW,QAAQ,YAAY;CACrC,MAAM,+BAAe,IAAI,IAA0B;CAEnD,OAAO,qBACL,OAAmB,SAAyD;EAC1E,iBAAiB,KAAK,KAAK;EAC3B,MAAM,SAAS,KAAK,UAAU;EAC9B,MAAM,QAAQ,OAAO,MAAM,MAAM,OAAO,WAAW,EAAE,MAAM,CAAC;EAC5D,IAAI,UAAU,KAAA,GACZ,MAAM,IAAI,MAAM,oDAAoD,UAAU,UAAU;EAE1F,MAAM,aAAa,aAAa,IAAI,KAAK,KAAK;EAC9C,aAAa,IAAI,OAAO,aAAa,CAAC;EAEtC,MAAM,QAAQ;EACd,MAAM,WACJ,OAAO,MAAM,YAAY,aAErB,MAAO,MAAM,QAA0B,OAAO,UAAU,IACxD,MAAM;EAGZ,MAAM,YAAY,KAAK,UAAU,UAAU,QAAQ,KAAK;EAMxD,OAAO;GAEL,SAAS,MAPW,gBACpB,KAAK,QACL,UACA,iDAAiD,MAAM,OAAO,EAChE;GAIE,YAAY,CAAC;GACb,OAAO,CAAC;GACR;GACA,eAAe;GACf,gBAAgB;IAAE,UAAU;IAAQ;GAAS;EAC/C;CACF,CACF;AACF;;;;;;;;;ACpFA,SAAgB,QAAqB,MAAkC;CACrE,IAAI,OAAO,KAAK,WAAW,UAAU,OAAO,KAAK;CACjD,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,WAAW,KAAK,QAAQ;EACjC,IAAI,QAAQ,SAAS,QAAQ;EAC7B,IAAI,OAAO,QAAQ,YAAY,UAAU;GACvC,MAAM,KAAK,QAAQ,OAAO;GAC1B;EACF;EACA,KAAK,MAAM,QAAQ,QAAQ,SACzB,IAAI,KAAK,SAAS,QAAQ,MAAM,KAAK,KAAK,IAAI;CAElD;CACA,OAAO,MAAM,KAAK,IAAI;AACxB"}
@@ -0,0 +1,114 @@
1
+ //#region src/core/trajectory.d.ts
2
+ /**
3
+ * Wire-format guards for trajectory events.
4
+ *
5
+ * `TrajectoryEvent` (in `types.ts`) is the loose internal type — any code that
6
+ * calls `trajectory.record(event)` or `start_span(name, meta)` produces values
7
+ * conforming to it. This file defines the *narrower* shapes that the studio
8
+ * (and any other downstream consumer) can recognize in the wire stream:
9
+ *
10
+ * span_start: composer span open
11
+ * span_end: composer span close
12
+ * emit: user-emitted event from inside a step (ctx.emit)
13
+ * run_end: terminal run event carrying the run's status, so a consumer
14
+ * distinguishes done / failed / aborted / suspended without
15
+ * inferring from silence
16
+ * checkpoint: checkpoint store lookup outcome (hit / miss / read_error)
17
+ * <other>: anything else, recognized by `is_custom_trajectory_event`,
18
+ * which only requires a string `kind`
19
+ *
20
+ * `parse_trajectory_event` is the wire gate, and it is deliberately permissive:
21
+ * a value is a trajectory event iff it is a non-array object carrying a string
22
+ * `kind`. The well-known guards layered on top are *recognizers*, not gates — a
23
+ * `{ kind: 'span_start' }` line missing its `span_id` is still a valid event on
24
+ * the wire, just not a `SpanStartEvent`. Anything stricter would have a viewer
25
+ * drop lines a newer producer emits, which is the opposite of what a
26
+ * forward-compatible wire format is for. `is_custom_trajectory_event` therefore
27
+ * answers `true` for well-known kinds too: it is the fallback shape, not a
28
+ * fifth disjoint case.
29
+ *
30
+ * Extra fields (`run_id`, `id`, provider-specific metadata) are neither
31
+ * required nor stripped: a successful parse hands the value straight back, so a
32
+ * parse / re-serialize round trip is lossless.
33
+ */
34
+ type SpanStartEvent = {
35
+ readonly kind: 'span_start';
36
+ readonly span_id: string;
37
+ readonly name: string;
38
+ } & {
39
+ readonly [key: string]: unknown;
40
+ };
41
+ type SpanEndEvent = {
42
+ readonly kind: 'span_end';
43
+ readonly span_id: string;
44
+ } & {
45
+ readonly [key: string]: unknown;
46
+ };
47
+ type EmitEvent = {
48
+ readonly kind: 'emit';
49
+ } & {
50
+ readonly [key: string]: unknown;
51
+ };
52
+ type RunEndStatus = 'done' | 'failed' | 'aborted' | 'suspended';
53
+ type RunEndEvent = {
54
+ readonly kind: 'run_end';
55
+ readonly status: RunEndStatus;
56
+ } & {
57
+ readonly [key: string]: unknown;
58
+ };
59
+ type CheckpointStatus = 'hit' | 'miss' | 'read_error';
60
+ type CheckpointEvent = {
61
+ readonly kind: 'checkpoint';
62
+ readonly status: CheckpointStatus;
63
+ readonly key: string;
64
+ } & {
65
+ readonly [key: string]: unknown;
66
+ };
67
+ type CustomTrajectoryEvent = {
68
+ readonly kind: string;
69
+ } & {
70
+ readonly [key: string]: unknown;
71
+ };
72
+ type ParsedTrajectoryEvent = SpanStartEvent | SpanEndEvent | EmitEvent | RunEndEvent | CheckpointEvent | CustomTrajectoryEvent;
73
+ type TrajectoryParseResult = {
74
+ readonly success: true;
75
+ readonly data: ParsedTrajectoryEvent;
76
+ } | {
77
+ readonly success: false;
78
+ readonly error: Error;
79
+ };
80
+ /**
81
+ * The wire gate: a non-array object carrying a string `kind`.
82
+ *
83
+ * True for every well-known kind as well, since `custom` is the fallback shape
84
+ * rather than a disjoint case.
85
+ */
86
+ declare function is_custom_trajectory_event(value: unknown): value is CustomTrajectoryEvent;
87
+ /** A composer span open: both `span_id` and `name` must be present as strings. */
88
+ declare function is_span_start_event(value: unknown): value is SpanStartEvent;
89
+ /** A composer span close: `span_id` must be present as a string, `name` need not be. */
90
+ declare function is_span_end_event(value: unknown): value is SpanEndEvent;
91
+ /** A `ctx.emit` event: the kind alone identifies it, the payload is the caller's. */
92
+ declare function is_emit_event(value: unknown): value is EmitEvent;
93
+ /**
94
+ * A terminal run event: `status` must be one of the known run outcomes, so the
95
+ * narrowed type's `status` union is truthful. An unknown future status still
96
+ * passes the wire gate as a custom event.
97
+ */
98
+ declare function is_run_end_event(value: unknown): value is RunEndEvent;
99
+ /**
100
+ * A checkpoint lookup event: `status` must be a known lookup outcome and `key`
101
+ * the store key that was consulted, for the same truthful-narrowing reason as
102
+ * `is_run_end_event`.
103
+ */
104
+ declare function is_checkpoint_event(value: unknown): value is CheckpointEvent;
105
+ /**
106
+ * Parse one wire value into a trajectory event, `safeParse`-shaped.
107
+ *
108
+ * On success `data` is the value itself, not a copy, so nothing on the line is
109
+ * dropped or reordered on the way through.
110
+ */
111
+ declare function parse_trajectory_event(value: unknown): TrajectoryParseResult;
112
+ //#endregion
113
+ export { parse_trajectory_event as _, ParsedTrajectoryEvent as a, SpanEndEvent as c, is_checkpoint_event as d, is_custom_trajectory_event as f, is_span_start_event as g, is_span_end_event as h, EmitEvent as i, SpanStartEvent as l, is_run_end_event as m, CheckpointStatus as n, RunEndEvent as o, is_emit_event as p, CustomTrajectoryEvent as r, RunEndStatus as s, CheckpointEvent as t, TrajectoryParseResult as u };
114
+ //# sourceMappingURL=trajectory-ByoOQZ6T.d.ts.map
@@ -0,0 +1,81 @@
1
+ //#region src/core/trajectory.ts
2
+ /**
3
+ * The wire gate: a non-array object carrying a string `kind`.
4
+ *
5
+ * True for every well-known kind as well, since `custom` is the fallback shape
6
+ * rather than a disjoint case.
7
+ */
8
+ function is_custom_trajectory_event(value) {
9
+ if (typeof value !== "object" || value === null) return false;
10
+ if (Array.isArray(value)) return false;
11
+ return typeof value.kind === "string";
12
+ }
13
+ /** A composer span open: both `span_id` and `name` must be present as strings. */
14
+ function is_span_start_event(value) {
15
+ if (!is_custom_trajectory_event(value)) return false;
16
+ if (value.kind !== "span_start") return false;
17
+ return typeof value["span_id"] === "string" && typeof value["name"] === "string";
18
+ }
19
+ /** A composer span close: `span_id` must be present as a string, `name` need not be. */
20
+ function is_span_end_event(value) {
21
+ if (!is_custom_trajectory_event(value)) return false;
22
+ return value.kind === "span_end" && typeof value["span_id"] === "string";
23
+ }
24
+ /** A `ctx.emit` event: the kind alone identifies it, the payload is the caller's. */
25
+ function is_emit_event(value) {
26
+ return is_custom_trajectory_event(value) && value.kind === "emit";
27
+ }
28
+ const RUN_END_STATUSES = /* @__PURE__ */ new Set([
29
+ "done",
30
+ "failed",
31
+ "aborted",
32
+ "suspended"
33
+ ]);
34
+ /**
35
+ * A terminal run event: `status` must be one of the known run outcomes, so the
36
+ * narrowed type's `status` union is truthful. An unknown future status still
37
+ * passes the wire gate as a custom event.
38
+ */
39
+ function is_run_end_event(value) {
40
+ if (!is_custom_trajectory_event(value)) return false;
41
+ if (value.kind !== "run_end") return false;
42
+ const status = value["status"];
43
+ return typeof status === "string" && RUN_END_STATUSES.has(status);
44
+ }
45
+ const CHECKPOINT_STATUSES = /* @__PURE__ */ new Set([
46
+ "hit",
47
+ "miss",
48
+ "read_error"
49
+ ]);
50
+ /**
51
+ * A checkpoint lookup event: `status` must be a known lookup outcome and `key`
52
+ * the store key that was consulted, for the same truthful-narrowing reason as
53
+ * `is_run_end_event`.
54
+ */
55
+ function is_checkpoint_event(value) {
56
+ if (!is_custom_trajectory_event(value)) return false;
57
+ if (value.kind !== "checkpoint") return false;
58
+ const status = value["status"];
59
+ if (typeof status !== "string" || !CHECKPOINT_STATUSES.has(status)) return false;
60
+ return typeof value["key"] === "string";
61
+ }
62
+ /**
63
+ * Parse one wire value into a trajectory event, `safeParse`-shaped.
64
+ *
65
+ * On success `data` is the value itself, not a copy, so nothing on the line is
66
+ * dropped or reordered on the way through.
67
+ */
68
+ function parse_trajectory_event(value) {
69
+ if (!is_custom_trajectory_event(value)) return {
70
+ success: false,
71
+ error: /* @__PURE__ */ new Error("not a trajectory event: expected an object with a string 'kind'")
72
+ };
73
+ return {
74
+ success: true,
75
+ data: value
76
+ };
77
+ }
78
+ //#endregion
79
+ export { is_span_end_event as a, is_run_end_event as i, is_custom_trajectory_event as n, is_span_start_event as o, is_emit_event as r, parse_trajectory_event as s, is_checkpoint_event as t };
80
+
81
+ //# sourceMappingURL=trajectory-D1eq9eue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trajectory-D1eq9eue.js","names":[],"sources":["../src/core/trajectory.ts"],"sourcesContent":["/**\n * Wire-format guards for trajectory events.\n *\n * `TrajectoryEvent` (in `types.ts`) is the loose internal type — any code that\n * calls `trajectory.record(event)` or `start_span(name, meta)` produces values\n * conforming to it. This file defines the *narrower* shapes that the studio\n * (and any other downstream consumer) can recognize in the wire stream:\n *\n * span_start: composer span open\n * span_end: composer span close\n * emit: user-emitted event from inside a step (ctx.emit)\n * run_end: terminal run event carrying the run's status, so a consumer\n * distinguishes done / failed / aborted / suspended without\n * inferring from silence\n * checkpoint: checkpoint store lookup outcome (hit / miss / read_error)\n * <other>: anything else, recognized by `is_custom_trajectory_event`,\n * which only requires a string `kind`\n *\n * `parse_trajectory_event` is the wire gate, and it is deliberately permissive:\n * a value is a trajectory event iff it is a non-array object carrying a string\n * `kind`. The well-known guards layered on top are *recognizers*, not gates — a\n * `{ kind: 'span_start' }` line missing its `span_id` is still a valid event on\n * the wire, just not a `SpanStartEvent`. Anything stricter would have a viewer\n * drop lines a newer producer emits, which is the opposite of what a\n * forward-compatible wire format is for. `is_custom_trajectory_event` therefore\n * answers `true` for well-known kinds too: it is the fallback shape, not a\n * fifth disjoint case.\n *\n * Extra fields (`run_id`, `id`, provider-specific metadata) are neither\n * required nor stripped: a successful parse hands the value straight back, so a\n * parse / re-serialize round trip is lossless.\n */\n\nexport type SpanStartEvent = {\n readonly kind: 'span_start'\n readonly span_id: string\n readonly name: string\n} & { readonly [key: string]: unknown }\n\nexport type SpanEndEvent = {\n readonly kind: 'span_end'\n readonly span_id: string\n} & { readonly [key: string]: unknown }\n\nexport type EmitEvent = {\n readonly kind: 'emit'\n} & { readonly [key: string]: unknown }\n\nexport type RunEndStatus = 'done' | 'failed' | 'aborted' | 'suspended'\n\nexport type RunEndEvent = {\n readonly kind: 'run_end'\n readonly status: RunEndStatus\n} & { readonly [key: string]: unknown }\n\nexport type CheckpointStatus = 'hit' | 'miss' | 'read_error'\n\nexport type CheckpointEvent = {\n readonly kind: 'checkpoint'\n readonly status: CheckpointStatus\n readonly key: string\n} & { readonly [key: string]: unknown }\n\nexport type CustomTrajectoryEvent = {\n readonly kind: string\n} & { readonly [key: string]: unknown }\n\nexport type ParsedTrajectoryEvent =\n | SpanStartEvent\n | SpanEndEvent\n | EmitEvent\n | RunEndEvent\n | CheckpointEvent\n | CustomTrajectoryEvent\n\nexport type TrajectoryParseResult =\n | { readonly success: true; readonly data: ParsedTrajectoryEvent }\n | { readonly success: false; readonly error: Error }\n\n/**\n * The wire gate: a non-array object carrying a string `kind`.\n *\n * True for every well-known kind as well, since `custom` is the fallback shape\n * rather than a disjoint case.\n */\nexport function is_custom_trajectory_event(value: unknown): value is CustomTrajectoryEvent {\n if (typeof value !== 'object' || value === null) return false\n if (Array.isArray(value)) return false\n return typeof (value as { kind?: unknown }).kind === 'string'\n}\n\n/** A composer span open: both `span_id` and `name` must be present as strings. */\nexport function is_span_start_event(value: unknown): value is SpanStartEvent {\n if (!is_custom_trajectory_event(value)) return false\n if (value.kind !== 'span_start') return false\n return typeof value['span_id'] === 'string' && typeof value['name'] === 'string'\n}\n\n/** A composer span close: `span_id` must be present as a string, `name` need not be. */\nexport function is_span_end_event(value: unknown): value is SpanEndEvent {\n if (!is_custom_trajectory_event(value)) return false\n return value.kind === 'span_end' && typeof value['span_id'] === 'string'\n}\n\n/** A `ctx.emit` event: the kind alone identifies it, the payload is the caller's. */\nexport function is_emit_event(value: unknown): value is EmitEvent {\n return is_custom_trajectory_event(value) && value.kind === 'emit'\n}\n\nconst RUN_END_STATUSES: ReadonlySet<string> = new Set(['done', 'failed', 'aborted', 'suspended'])\n\n/**\n * A terminal run event: `status` must be one of the known run outcomes, so the\n * narrowed type's `status` union is truthful. An unknown future status still\n * passes the wire gate as a custom event.\n */\nexport function is_run_end_event(value: unknown): value is RunEndEvent {\n if (!is_custom_trajectory_event(value)) return false\n if (value.kind !== 'run_end') return false\n const status = value['status']\n return typeof status === 'string' && RUN_END_STATUSES.has(status)\n}\n\nconst CHECKPOINT_STATUSES: ReadonlySet<string> = new Set(['hit', 'miss', 'read_error'])\n\n/**\n * A checkpoint lookup event: `status` must be a known lookup outcome and `key`\n * the store key that was consulted, for the same truthful-narrowing reason as\n * `is_run_end_event`.\n */\nexport function is_checkpoint_event(value: unknown): value is CheckpointEvent {\n if (!is_custom_trajectory_event(value)) return false\n if (value.kind !== 'checkpoint') return false\n const status = value['status']\n if (typeof status !== 'string' || !CHECKPOINT_STATUSES.has(status)) return false\n return typeof value['key'] === 'string'\n}\n\n/**\n * Parse one wire value into a trajectory event, `safeParse`-shaped.\n *\n * On success `data` is the value itself, not a copy, so nothing on the line is\n * dropped or reordered on the way through.\n */\nexport function parse_trajectory_event(value: unknown): TrajectoryParseResult {\n if (!is_custom_trajectory_event(value)) {\n return {\n success: false,\n error: new Error(\"not a trajectory event: expected an object with a string 'kind'\"),\n }\n }\n return { success: true, data: value }\n}\n"],"mappings":";;;;;;;AAqFA,SAAgB,2BAA2B,OAAgD;CACzF,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO;CACjC,OAAO,OAAQ,MAA6B,SAAS;AACvD;;AAGA,SAAgB,oBAAoB,OAAyC;CAC3E,IAAI,CAAC,2BAA2B,KAAK,GAAG,OAAO;CAC/C,IAAI,MAAM,SAAS,cAAc,OAAO;CACxC,OAAO,OAAO,MAAM,eAAe,YAAY,OAAO,MAAM,YAAY;AAC1E;;AAGA,SAAgB,kBAAkB,OAAuC;CACvE,IAAI,CAAC,2BAA2B,KAAK,GAAG,OAAO;CAC/C,OAAO,MAAM,SAAS,cAAc,OAAO,MAAM,eAAe;AAClE;;AAGA,SAAgB,cAAc,OAAoC;CAChE,OAAO,2BAA2B,KAAK,KAAK,MAAM,SAAS;AAC7D;AAEA,MAAM,mCAAwC,IAAI,IAAI;CAAC;CAAQ;CAAU;CAAW;AAAW,CAAC;;;;;;AAOhG,SAAgB,iBAAiB,OAAsC;CACrE,IAAI,CAAC,2BAA2B,KAAK,GAAG,OAAO;CAC/C,IAAI,MAAM,SAAS,WAAW,OAAO;CACrC,MAAM,SAAS,MAAM;CACrB,OAAO,OAAO,WAAW,YAAY,iBAAiB,IAAI,MAAM;AAClE;AAEA,MAAM,sCAA2C,IAAI,IAAI;CAAC;CAAO;CAAQ;AAAY,CAAC;;;;;;AAOtF,SAAgB,oBAAoB,OAA0C;CAC5E,IAAI,CAAC,2BAA2B,KAAK,GAAG,OAAO;CAC/C,IAAI,MAAM,SAAS,cAAc,OAAO;CACxC,MAAM,SAAS,MAAM;CACrB,IAAI,OAAO,WAAW,YAAY,CAAC,oBAAoB,IAAI,MAAM,GAAG,OAAO;CAC3E,OAAO,OAAO,MAAM,WAAW;AACjC;;;;;;;AAQA,SAAgB,uBAAuB,OAAuC;CAC5E,IAAI,CAAC,2BAA2B,KAAK,GACnC,OAAO;EACL,SAAS;EACT,uBAAO,IAAI,MAAM,iEAAiE;CACpF;CAEF,OAAO;EAAE,SAAS;EAAM,MAAM;CAAM;AACtC"}
@@ -117,10 +117,10 @@ declare namespace StandardJSONSchemaV1 {
117
117
  //#endregion
118
118
  //#region src/schema/types.d.ts
119
119
  /**
120
- * Any Standard Schema implementation, used where fascicle only ever validates.
120
+ * Any Standard Schema implementation, used where Fascicle only ever validates.
121
121
  *
122
122
  * `t` is the validated output type, which is what callers care about; the input
123
- * side stays `unknown` because fascicle validates values arriving from a model,
123
+ * side stays `unknown` because Fascicle validates values arriving from a model,
124
124
  * a resume payload, or stdin, none of which are typed at the boundary.
125
125
  */
126
126
  type AnySchema<t = unknown> = StandardSchemaV1<unknown, t>;
@@ -146,4 +146,4 @@ type SchemaIssue = {
146
146
  };
147
147
  //#endregion
148
148
  export { SchemaIssue as n, ToolSchema as r, AnySchema as t };
149
- //# sourceMappingURL=types-BCtKsxrX.d.ts.map
149
+ //# sourceMappingURL=types-BK0UW28o.d.ts.map
@@ -42,8 +42,13 @@ type RunContext = {
42
42
  readonly streaming: boolean;
43
43
  };
44
44
  type StepFn<i, o> = (input: i, ctx: RunContext) => Promise<o> | o;
45
+ /**
46
+ * Descriptive metadata for a step. `name` is the display channel: it labels
47
+ * trajectory spans and `describe` output, and changing it is always safe
48
+ * because nothing keys off it. The step's `id` stays the identity channel.
49
+ */
45
50
  type StepMetadata = {
46
- readonly display_name?: string;
51
+ readonly name?: string;
47
52
  readonly description?: string;
48
53
  readonly port_labels?: Readonly<{
49
54
  readonly in?: string;
@@ -67,6 +72,18 @@ type Step<i, o> = {
67
72
  * it accepts is the runner's job, not the type system's.
68
73
  */
69
74
  type AnyStep = Step<never, unknown>;
75
+ /**
76
+ * Extract a Step's input type. The fallback is `never`, not `unknown`, so a
77
+ * non-step can never satisfy an input-position check by accident; sequence's
78
+ * joint checking depends on that. This is the canonical extractor the
79
+ * composers' internal type machinery builds on.
80
+ */
81
+ type StepInput<s> = s extends Step<infer i, unknown> ? i : never;
82
+ /**
83
+ * Extract a Step's output type. Falls back to `unknown` so type-erased
84
+ * plumbing over `AnyStep` degrades to the safe top type instead of lying.
85
+ */
86
+ type StepOutput<s> = s extends Step<never, infer o> ? o : unknown;
70
87
  //#endregion
71
- export { StepFn as a, TrajectoryLogger as c, Step as i, CheckpointStore as n, StepMetadata as o, RunContext as r, TrajectoryEvent as s, AnyStep as t };
72
- //# sourceMappingURL=types-CVdTBXE_.d.ts.map
88
+ export { Step as a, StepMetadata as c, TrajectoryLogger as d, RunContext as i, StepOutput as l, CheckpointStore as n, StepFn as o, CleanupFn as r, StepInput as s, AnyStep as t, TrajectoryEvent as u };
89
+ //# sourceMappingURL=types-DBpU27sQ.d.ts.map
@@ -1,5 +1,5 @@
1
- import { c as TrajectoryLogger } from "./types-CVdTBXE_.js";
2
- import { r as ToolSchema } from "./types-BCtKsxrX.js";
1
+ import { d as TrajectoryLogger } from "./types-DBpU27sQ.js";
2
+ import { r as ToolSchema } from "./types-BK0UW28o.js";
3
3
 
4
4
  //#region src/engine/providers/claude_cli/types.d.ts
5
5
  /**
@@ -531,9 +531,10 @@ type AiSdkTelemetrySettings = {
531
531
  *
532
532
  * | Field | Rule |
533
533
  * | --------------------------------------------------------------------- | ----------------------------------------- |
534
- * | `model` | per-call wins; else default; else `sonnet` |
535
- * | `provider` | per-call wins; else default; else sole configured provider; else `anthropic` |
534
+ * | `model` | per-call wins; else default; else model_required_error is thrown |
535
+ * | `provider` | per-call wins; else default; else sole configured provider; else provider_required_error is thrown |
536
536
  * | `system`, `effort`, `max_steps`, `turn_timeout_ms`, `tool_error_policy`, `schema_repair_attempts`, `tool_call_repair_attempts`, `max_tool_calls_per_step` | per-call wins (nullish coalesce) |
537
+ * | `temperature`, `max_tokens`, `top_p` | per-call wins (nullish coalesce) |
537
538
  * | `retry_policy` | per-call replaces wholesale |
538
539
  * | `provider_options` | two-level: per-provider-key shallow merge |
539
540
  * | `prompt`, `tools`, `schema`, `abort`, `trajectory`, `on_chunk` | not defaultable; always call-supplied |
@@ -543,6 +544,9 @@ type EngineDefaults = {
543
544
  readonly provider?: string;
544
545
  readonly system?: string;
545
546
  readonly effort?: EffortLevel;
547
+ readonly temperature?: number;
548
+ readonly max_tokens?: number;
549
+ readonly top_p?: number;
546
550
  readonly max_steps?: number;
547
551
  readonly turn_timeout_ms?: number;
548
552
  readonly retry_policy?: RetryPolicy;
@@ -598,4 +602,4 @@ type Engine = {
598
602
  };
599
603
  //#endregion
600
604
  export { TurnResult as A, ProviderTransport as B, StreamChunk as C, ToolCallRecord as D, ToolApprovalRequest as E, ExternalAgentAdapter as F, default_normalize_usage as H, NativeProviderAdapter as I, ProviderAdapter as L, UserContentPart as M, AiSdkProviderAdapter as N, ToolExecContext as O, EffortTranslation as P, ProviderCapability as R, StepRecord as S, ToolApprovalHandler as T, RawProviderUsage as V, ProviderConfigMap as _, Engine as a, RetryFailureKind as b, FinishReason as c, Message as d, PrepareStepContext as f, PricingTable as g, Pricing as h, EffortLevel as i, UsageTotals as j, TurnRequest as k, GenerateOptions as l, PrepareStepResult as m, AssistantContentPart as n, EngineConfig as o, PrepareStepHook as p, CostBreakdown as r, EngineDefaults as s, AiSdkTelemetrySettings as t, GenerateResult as u, ProviderInit as v, Tool as w, RetryPolicy as x, ResolvedModel as y, ProviderFactory as z };
601
- //# sourceMappingURL=types-4l54cexm.d.ts.map
605
+ //# sourceMappingURL=types-DU6cvoA4.d.ts.map