fascicle 0.13.0 → 0.14.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 (43) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +20 -1
  3. package/dist/acp.d.ts +226 -0
  4. package/dist/acp.js +1886 -0
  5. package/dist/acp.js.map +1 -0
  6. package/dist/adapters.js +1 -2
  7. package/dist/agents.d.ts +1 -1
  8. package/dist/agents.js +1 -1
  9. package/dist/{core-B-M7nAkg.js → core-CDrz0NM1.js} +184 -53
  10. package/dist/core-CDrz0NM1.js.map +1 -0
  11. package/dist/diagram_bin.js +5 -2
  12. package/dist/diagram_bin.js.map +1 -1
  13. package/dist/{engine-BRzVcTBB.js → engine-BDWB2jdn.js} +12 -333
  14. package/dist/engine-BDWB2jdn.js.map +1 -0
  15. package/dist/index.d.ts +485 -623
  16. package/dist/index.js +20 -12
  17. package/dist/index.js.map +1 -1
  18. package/dist/{invoke-CIdhjChw.js → invoke-tjTjZLHj.js} +3 -3
  19. package/dist/{invoke-CIdhjChw.js.map → invoke-tjTjZLHj.js.map} +1 -1
  20. package/dist/json_schema_to_standard-r21kW2LI.js +288 -0
  21. package/dist/json_schema_to_standard-r21kW2LI.js.map +1 -0
  22. package/dist/leading_system-BQe_405V.js +330 -0
  23. package/dist/leading_system-BQe_405V.js.map +1 -0
  24. package/dist/mcp.d.ts +17 -16
  25. package/dist/mcp.js +2 -266
  26. package/dist/mcp.js.map +1 -1
  27. package/dist/search-CqH5hmuF.js +563 -0
  28. package/dist/search-CqH5hmuF.js.map +1 -0
  29. package/dist/search_worker.d.ts +1 -0
  30. package/dist/search_worker.js +19 -0
  31. package/dist/search_worker.js.map +1 -0
  32. package/dist/stdio.js +1 -1
  33. package/dist/testing.d.ts +1 -1
  34. package/dist/testing.js +3 -2
  35. package/dist/testing.js.map +1 -1
  36. package/dist/{types-CZ83Q5nm.d.ts → types-C_Rmcgck.d.ts} +7 -1
  37. package/dist/viewer-app/assets/index-Fnh5HKSU.js +2 -0
  38. package/dist/viewer-app/index.html +1 -1
  39. package/dist/viewer.js +1 -1
  40. package/package.json +30 -19
  41. package/dist/core-B-M7nAkg.js.map +0 -1
  42. package/dist/engine-BRzVcTBB.js.map +0 -1
  43. package/dist/viewer-app/assets/index-DXsB0byD.js +0 -2
@@ -0,0 +1,330 @@
1
+ import "./core-CDrz0NM1.js";
2
+ //#region src/engine/errors.ts
3
+ var rate_limit_error = class extends Error {
4
+ kind = "rate_limit_error";
5
+ retry_after_ms;
6
+ attempts;
7
+ status;
8
+ constructor(message, metadata = {}) {
9
+ super(message);
10
+ this.name = "rate_limit_error";
11
+ this.retry_after_ms = metadata.retry_after_ms;
12
+ this.attempts = metadata.attempts ?? 0;
13
+ this.status = metadata.status;
14
+ }
15
+ };
16
+ var provider_error = class extends Error {
17
+ kind = "provider_error";
18
+ status;
19
+ body;
20
+ cause_kind;
21
+ constructor(message, metadata = {}) {
22
+ super(message);
23
+ this.name = "provider_error";
24
+ this.status = metadata.status;
25
+ this.body = metadata.body;
26
+ this.cause_kind = metadata.cause_kind;
27
+ }
28
+ };
29
+ /**
30
+ * Turn-timeout expiry. Thrown by the engine-owned retry_turn wrapper when a
31
+ * single invoke_turn exceeds `turn_timeout_ms` before any chunk streamed.
32
+ * Its `kind` is the RetryFailureKind wire value `'timeout'` (not the class
33
+ * name) on purpose: that is the discriminant classify_retryable /
34
+ * classify_provider_error already key on, so the shared classifier treats an
35
+ * expiry as retryable without any timeout-specific branch. A mid-stream
36
+ * expiry never reaches here; retry_turn converts it to a non-retryable
37
+ * stream interruption first.
38
+ */
39
+ var turn_timeout_error = class extends Error {
40
+ kind = "timeout";
41
+ timeout_ms;
42
+ step_index;
43
+ constructor(timeout_ms, step_index) {
44
+ super(`turn exceeded turn_timeout_ms budget of ${timeout_ms}ms`);
45
+ this.name = "turn_timeout_error";
46
+ this.timeout_ms = timeout_ms;
47
+ this.step_index = step_index;
48
+ }
49
+ };
50
+ var schema_validation_error = class extends Error {
51
+ kind = "schema_validation_error";
52
+ schema_issues;
53
+ raw_text;
54
+ constructor(message, schema_issues, raw_text) {
55
+ super(message);
56
+ this.name = "schema_validation_error";
57
+ this.schema_issues = schema_issues;
58
+ this.raw_text = raw_text;
59
+ }
60
+ };
61
+ var tool_error = class extends Error {
62
+ kind = "tool_error";
63
+ tool_name;
64
+ tool_call_id;
65
+ cause;
66
+ constructor(message, metadata) {
67
+ super(message);
68
+ this.name = "tool_error";
69
+ this.tool_name = metadata.tool_name;
70
+ this.tool_call_id = metadata.tool_call_id;
71
+ this.cause = metadata.cause;
72
+ }
73
+ };
74
+ var tool_approval_denied_error = class extends Error {
75
+ kind = "tool_approval_denied_error";
76
+ tool_name;
77
+ step_index;
78
+ tool_call_id;
79
+ constructor(message, metadata) {
80
+ super(message);
81
+ this.name = "tool_approval_denied_error";
82
+ this.tool_name = metadata.tool_name;
83
+ this.step_index = metadata.step_index;
84
+ this.tool_call_id = metadata.tool_call_id;
85
+ }
86
+ };
87
+ var model_required_error = class extends Error {
88
+ kind = "model_required_error";
89
+ constructor(message = "no model specified: pass `model` to generate() or set `defaults.model` on the engine") {
90
+ super(message);
91
+ this.name = "model_required_error";
92
+ }
93
+ };
94
+ /**
95
+ * A generate call named a provider the engine has no adapter for. Carries the
96
+ * configured names, and the message repeats them, so a typo is visible from
97
+ * the message alone rather than needing the engine config alongside it.
98
+ */
99
+ var provider_not_configured_error = class extends Error {
100
+ kind = "provider_not_configured_error";
101
+ provider;
102
+ configured;
103
+ constructor(provider, configured = []) {
104
+ const state = configured.length > 0 ? configured.join(", ") : "none";
105
+ super(`provider '${provider}' is not configured on this engine: pass it to create_engine({ providers }) (configured: ${state})`);
106
+ this.name = "provider_not_configured_error";
107
+ this.provider = provider;
108
+ this.configured = configured;
109
+ }
110
+ };
111
+ /**
112
+ * No provider could be resolved for a generate call: several providers are
113
+ * configured, the call named none, and no `defaults.provider` is set. Carries
114
+ * the configured provider names so the message tells the caller exactly what
115
+ * the engine can route to.
116
+ */
117
+ var provider_required_error = class extends Error {
118
+ kind = "provider_required_error";
119
+ configured;
120
+ constructor(configured) {
121
+ super(`no provider specified: pass \`provider\` to generate() or set \`defaults.provider\` (configured: ${configured.join(", ")})`);
122
+ this.name = "provider_required_error";
123
+ this.configured = configured;
124
+ }
125
+ };
126
+ var engine_config_error = class extends Error {
127
+ kind = "engine_config_error";
128
+ provider;
129
+ constructor(message, provider) {
130
+ super(message);
131
+ this.name = "engine_config_error";
132
+ this.provider = provider;
133
+ }
134
+ };
135
+ var on_chunk_error = class extends Error {
136
+ kind = "on_chunk_error";
137
+ cause;
138
+ constructor(message, cause) {
139
+ super(message);
140
+ this.name = "on_chunk_error";
141
+ this.cause = cause;
142
+ }
143
+ };
144
+ var provider_capability_error = class extends Error {
145
+ kind = "provider_capability_error";
146
+ provider;
147
+ capability;
148
+ constructor(provider, capability, detail) {
149
+ const suffix = detail !== void 0 ? `: ${detail}` : "";
150
+ super(`provider '${provider}' does not support '${capability}'${suffix}`);
151
+ this.name = "provider_capability_error";
152
+ this.provider = provider;
153
+ this.capability = capability;
154
+ }
155
+ };
156
+ var engine_disposed_error = class extends Error {
157
+ kind = "engine_disposed_error";
158
+ constructor(message = "engine has been disposed: build a new one with create_engine()") {
159
+ super(message);
160
+ this.name = "engine_disposed_error";
161
+ }
162
+ };
163
+ var claude_cli_error = class extends Error {
164
+ kind = "claude_cli_error";
165
+ reason;
166
+ status;
167
+ stderr_snippet;
168
+ constructor(reason, message, metadata = {}) {
169
+ super(message);
170
+ this.name = "claude_cli_error";
171
+ this.reason = reason;
172
+ this.status = metadata.status;
173
+ this.stderr_snippet = metadata.stderr_snippet;
174
+ }
175
+ };
176
+ var provider_auth_error = class extends Error {
177
+ kind = "provider_auth_error";
178
+ provider;
179
+ refresh_command;
180
+ constructor(provider, message, metadata = {}) {
181
+ super(message);
182
+ this.name = "provider_auth_error";
183
+ this.provider = provider;
184
+ this.refresh_command = metadata.refresh_command;
185
+ }
186
+ };
187
+ /**
188
+ * A generate call that set a schema finished for a reason other than 'stop'
189
+ * (content_filter, length, max_steps, tool_calls), so no schema-validated
190
+ * value exists and validation was never attempted. Carries the raw model text
191
+ * and the last provider-reported payload, so a guardrail trace or other
192
+ * block detail stays reachable from the catch. Distinct from
193
+ * schema_validation_error, which covers a response that completed normally
194
+ * and then failed validation after its repair attempts ran out.
195
+ */
196
+ var incomplete_generation_error = class extends Error {
197
+ kind = "incomplete_generation_error";
198
+ finish_reason;
199
+ raw_text;
200
+ provider_reported;
201
+ constructor(finish_reason, raw_text, provider_reported) {
202
+ super(`generation finished with '${finish_reason}' before a schema-validated response was produced`);
203
+ this.name = "incomplete_generation_error";
204
+ this.finish_reason = finish_reason;
205
+ this.raw_text = raw_text;
206
+ this.provider_reported = provider_reported;
207
+ }
208
+ };
209
+ //#endregion
210
+ //#region src/engine/providers/types.ts
211
+ /**
212
+ * Read the `transport` selector off a provider init. Defaults to 'ai_sdk';
213
+ * anything but the two known backends throws at construction so a typo
214
+ * fails loud instead of silently running the default.
215
+ */
216
+ function resolve_transport(init, provider) {
217
+ const raw = init["transport"];
218
+ if (raw === void 0 || raw === "ai_sdk") return "ai_sdk";
219
+ if (raw === "native") return "native";
220
+ throw new engine_config_error(`${provider} provider: transport must be 'ai_sdk' or 'native', got ${JSON.stringify(raw)}`, provider);
221
+ }
222
+ /**
223
+ * Map raw provider usage to UsageTotals, the mapper most adapters share.
224
+ *
225
+ * Missing usage zeroes the totals. Optional fields (reasoning and cache
226
+ * tokens) are set only when the raw payload carries them, reading the
227
+ * flattened field first and the AI SDK's *_details container second.
228
+ */
229
+ function default_normalize_usage(raw) {
230
+ if (raw === void 0) return {
231
+ input_tokens: 0,
232
+ output_tokens: 0
233
+ };
234
+ const totals = {
235
+ input_tokens: typeof raw.input_tokens === "number" ? raw.input_tokens : 0,
236
+ output_tokens: typeof raw.output_tokens === "number" ? raw.output_tokens : 0
237
+ };
238
+ if (typeof raw.reasoning_tokens === "number") totals.reasoning_tokens = raw.reasoning_tokens;
239
+ else if (typeof raw.output_token_details?.reasoning_tokens === "number") totals.reasoning_tokens = raw.output_token_details.reasoning_tokens;
240
+ if (typeof raw.cached_input_tokens === "number") totals.cached_input_tokens = raw.cached_input_tokens;
241
+ else if (typeof raw.input_token_details?.cached_tokens === "number") totals.cached_input_tokens = raw.input_token_details.cached_tokens;
242
+ if (typeof raw.cache_write_tokens === "number") totals.cache_write_tokens = raw.cache_write_tokens;
243
+ else if (typeof raw.input_token_details?.cache_creation_input_tokens === "number") totals.cache_write_tokens = raw.input_token_details.cache_creation_input_tokens;
244
+ return totals;
245
+ }
246
+ /**
247
+ * Usage mapper for local backends (Ollama, LM Studio) whose servers never
248
+ * report cache or reasoning tokens: default-normalize, then strip those
249
+ * fields so a stray *_details container cannot invent them.
250
+ */
251
+ function normalize_local_usage(raw) {
252
+ const base = default_normalize_usage(raw);
253
+ delete base.cached_input_tokens;
254
+ delete base.cache_write_tokens;
255
+ delete base.reasoning_tokens;
256
+ return base;
257
+ }
258
+ /**
259
+ * Build the standard missing-peer error: names the package and the install
260
+ * command so a missing peer is diagnosable from the message alone. Shared so
261
+ * every optional-peer failure reads identically, whether the failing
262
+ * `import()` names the peer directly (load_optional_peer below) or a local
263
+ * module that reaches the peer through its own static import (the ai_sdk
264
+ * turn seam in generate.ts, whose dynamic import must stay written in
265
+ * generate.ts for its relative specifier to resolve correctly).
266
+ */
267
+ function missing_peer_error(peer_name, cause) {
268
+ const message = `missing peer dependency '${peer_name}'. Install it with your package manager, e.g., \`pnpm add ${peer_name}\` or \`npm install ${peer_name}\`. Cause: ${cause instanceof Error ? cause.message : JSON.stringify(cause)}`;
269
+ return new Error(message, { cause });
270
+ }
271
+ /**
272
+ * Dynamically import an optional peer dependency, rethrowing an import
273
+ * failure via missing_peer_error so a missing peer is diagnosable from the
274
+ * message alone.
275
+ */
276
+ async function load_optional_peer(specifier) {
277
+ let mod;
278
+ try {
279
+ mod = await import(specifier);
280
+ } catch (err) {
281
+ throw missing_peer_error(specifier, err);
282
+ }
283
+ return mod;
284
+ }
285
+ //#endregion
286
+ //#region src/engine/leading_system.ts
287
+ /**
288
+ * Collapse a leading run of system messages into a single joined string,
289
+ * returning the remaining messages.
290
+ *
291
+ * Both message paths hoist a leading system run out of their list the same way:
292
+ * the engine-Message side (generate.ts split_leading_system_messages) hands the
293
+ * run to a native adapter's TurnRequest.system, and the AI SDK side
294
+ * (providers/ai_sdk/invoke.ts split_leading_system) hands it to the SDK's
295
+ * top-level `instructions` option. Same guard, same '\n\n' join, and the same
296
+ * "return the list untouched when hoisting would leave `messages` empty" rule,
297
+ * since provider APIs reject an empty messages array. They differ only in the
298
+ * element type and how a system message's text is read, so each caller supplies
299
+ * `system_text`; the traversal and its guards live here once.
300
+ */
301
+ function split_leading_system_run(messages, system_text) {
302
+ let run_end = 0;
303
+ const system_parts = [];
304
+ while (run_end < messages.length) {
305
+ const m = messages[run_end];
306
+ if (!is_leading_system(m)) break;
307
+ system_parts.push(system_text(m));
308
+ run_end += 1;
309
+ }
310
+ const rest = messages.slice(run_end);
311
+ if (system_parts.length === 0 || rest.length === 0) return { messages: [...messages] };
312
+ return {
313
+ system: system_parts.join("\n\n"),
314
+ messages: rest
315
+ };
316
+ }
317
+ /**
318
+ * Narrow a possibly undefined message to the system member of its union.
319
+ *
320
+ * A cast-free type guard so `split_leading_system_run` can hand the narrowed
321
+ * message straight to `system_text` without a `T`-eroding assertion; the
322
+ * optional chain covers the out-of-bounds `undefined` the index access yields.
323
+ */
324
+ function is_leading_system(m) {
325
+ return m?.role === "system";
326
+ }
327
+ //#endregion
328
+ export { turn_timeout_error as S, provider_required_error as _, normalize_local_usage as a, tool_approval_denied_error as b, engine_config_error as c, model_required_error as d, on_chunk_error as f, provider_not_configured_error as g, provider_error as h, missing_peer_error as i, engine_disposed_error as l, provider_capability_error as m, default_normalize_usage as n, resolve_transport as o, provider_auth_error as p, load_optional_peer as r, claude_cli_error as s, split_leading_system_run as t, incomplete_generation_error as u, rate_limit_error as v, tool_error as x, schema_validation_error as y };
329
+
330
+ //# sourceMappingURL=leading_system-BQe_405V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leading_system-BQe_405V.js","names":[],"sources":["../src/engine/errors.ts","../src/engine/providers/types.ts","../src/engine/leading_system.ts"],"sourcesContent":["/**\n * Typed errors for the AI engine layer.\n *\n * This is the only source file in the engine module permitted to use the\n * `class` keyword. `Error` is a built-in and `instanceof` branching is how\n * the retry helper and composition-layer composers distinguish failure modes.\n * Every other engine file stays class-free.\n *\n * `aborted_error` is defined in the core module and re-exported here so that\n * `instanceof aborted_error` is true regardless of which layer surfaced it.\n * This is the one value-level import from core permitted in engine source;\n * see the ignores in `rules/no-core-value-import-in-engine.yml`.\n *\n * Every class declares an optional `path`: the chain of step ids the error\n * crossed while bubbling through the core runner's dispatch. The runner\n * attaches it via Reflect.set (`prepend_path` in core's runner.ts), so the\n * `declare` modifier types what arrives without emitting a field;\n * construction never sets it.\n */\n\nimport type { SchemaIssue } from '#schema'\nimport type { FinishReason } from './types.js'\n\nexport { aborted_error } from '#core'\n\nexport class rate_limit_error extends Error {\n readonly kind = 'rate_limit_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly retry_after_ms: number | undefined;\n readonly attempts: number;\n readonly status: number | undefined;\n constructor(\n message: string,\n metadata: { retry_after_ms?: number; attempts?: number; status?: number } = {},\n ) {\n super(message)\n this.name = 'rate_limit_error'\n this.retry_after_ms = metadata.retry_after_ms\n this.attempts = metadata.attempts ?? 0\n this.status = metadata.status\n }\n}\n\nexport class provider_error extends Error {\n readonly kind = 'provider_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly status: number | undefined;\n readonly body: string | undefined;\n readonly cause_kind: 'provider_5xx' | 'network' | 'unknown' | undefined;\n constructor(\n message: string,\n metadata: {\n status?: number\n body?: string\n cause_kind?: 'provider_5xx' | 'network' | 'unknown'\n } = {},\n ) {\n super(message)\n this.name = 'provider_error'\n this.status = metadata.status\n this.body = metadata.body\n this.cause_kind = metadata.cause_kind\n }\n}\n\n/**\n * Turn-timeout expiry. Thrown by the engine-owned retry_turn wrapper when a\n * single invoke_turn exceeds `turn_timeout_ms` before any chunk streamed.\n * Its `kind` is the RetryFailureKind wire value `'timeout'` (not the class\n * name) on purpose: that is the discriminant classify_retryable /\n * classify_provider_error already key on, so the shared classifier treats an\n * expiry as retryable without any timeout-specific branch. A mid-stream\n * expiry never reaches here; retry_turn converts it to a non-retryable\n * stream interruption first.\n */\nexport class turn_timeout_error extends Error {\n readonly kind = 'timeout' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly timeout_ms: number;\n readonly step_index: number | undefined;\n constructor(timeout_ms: number, step_index?: number) {\n super(`turn exceeded turn_timeout_ms budget of ${timeout_ms}ms`)\n this.name = 'turn_timeout_error'\n this.timeout_ms = timeout_ms\n this.step_index = step_index\n }\n}\n\nexport class schema_validation_error extends Error {\n readonly kind = 'schema_validation_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly schema_issues: ReadonlyArray<SchemaIssue>;\n readonly raw_text: string;\n constructor(message: string, schema_issues: ReadonlyArray<SchemaIssue>, raw_text: string) {\n super(message)\n this.name = 'schema_validation_error'\n this.schema_issues = schema_issues\n this.raw_text = raw_text\n }\n}\n\nexport class tool_error extends Error {\n readonly kind = 'tool_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly tool_name: string;\n readonly tool_call_id: string;\n override readonly cause: unknown;\n constructor(\n message: string,\n metadata: { tool_name: string; tool_call_id: string; cause: unknown },\n ) {\n super(message)\n this.name = 'tool_error'\n this.tool_name = metadata.tool_name\n this.tool_call_id = metadata.tool_call_id\n this.cause = metadata.cause\n }\n}\n\nexport class tool_approval_denied_error extends Error {\n readonly kind = 'tool_approval_denied_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly tool_name: string;\n readonly step_index: number;\n readonly tool_call_id: string;\n constructor(\n message: string,\n metadata: { tool_name: string; step_index: number; tool_call_id: string },\n ) {\n super(message)\n this.name = 'tool_approval_denied_error'\n this.tool_name = metadata.tool_name\n this.step_index = metadata.step_index\n this.tool_call_id = metadata.tool_call_id\n }\n}\n\nexport class model_required_error extends Error {\n readonly kind = 'model_required_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n constructor(\n message = 'no model specified: pass `model` to generate() or set `defaults.model` on the engine',\n ) {\n super(message)\n this.name = 'model_required_error'\n }\n}\n\n/**\n * A generate call named a provider the engine has no adapter for. Carries the\n * configured names, and the message repeats them, so a typo is visible from\n * the message alone rather than needing the engine config alongside it.\n */\nexport class provider_not_configured_error extends Error {\n readonly kind = 'provider_not_configured_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly provider: string;\n readonly configured: ReadonlyArray<string>;\n constructor(provider: string, configured: ReadonlyArray<string> = []) {\n const state = configured.length > 0 ? configured.join(', ') : 'none'\n super(\n `provider '${provider}' is not configured on this engine: pass it to create_engine({ providers }) (configured: ${state})`,\n )\n this.name = 'provider_not_configured_error'\n this.provider = provider\n this.configured = configured\n }\n}\n\n/**\n * No provider could be resolved for a generate call: several providers are\n * configured, the call named none, and no `defaults.provider` is set. Carries\n * the configured provider names so the message tells the caller exactly what\n * the engine can route to.\n */\nexport class provider_required_error extends Error {\n readonly kind = 'provider_required_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly configured: ReadonlyArray<string>;\n constructor(configured: ReadonlyArray<string>) {\n super(\n `no provider specified: pass \\`provider\\` to generate() or set \\`defaults.provider\\` (configured: ${configured.join(', ')})`,\n )\n this.name = 'provider_required_error'\n this.configured = configured\n }\n}\n\nexport class engine_config_error extends Error {\n readonly kind = 'engine_config_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly provider: string | undefined;\n constructor(message: string, provider?: string) {\n super(message)\n this.name = 'engine_config_error'\n this.provider = provider\n }\n}\n\nexport class on_chunk_error extends Error {\n readonly kind = 'on_chunk_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n override readonly cause: unknown;\n constructor(message: string, cause: unknown) {\n super(message)\n this.name = 'on_chunk_error'\n this.cause = cause\n }\n}\n\nexport class provider_capability_error extends Error {\n readonly kind = 'provider_capability_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly provider: string;\n readonly capability: string;\n constructor(provider: string, capability: string, detail?: string) {\n const suffix = detail !== undefined ? `: ${detail}` : ''\n super(`provider '${provider}' does not support '${capability}'${suffix}`)\n this.name = 'provider_capability_error'\n this.provider = provider\n this.capability = capability\n }\n}\n\nexport class engine_disposed_error extends Error {\n readonly kind = 'engine_disposed_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n constructor(message = 'engine has been disposed: build a new one with create_engine()') {\n super(message)\n this.name = 'engine_disposed_error'\n }\n}\n\nexport type ClaudeCliErrorReason =\n | 'binary_not_found'\n | 'auth_missing'\n | 'auth_expired'\n | 'api_key_missing'\n | 'startup_timeout'\n | 'stall_timeout'\n | 'no_result_event'\n | 'result_error'\n | 'subprocess_exit'\n | 'sandbox_unavailable'\n | 'engine_disposed'\n | 'parse_error'\n\nexport class claude_cli_error extends Error {\n readonly kind = 'claude_cli_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly reason: ClaudeCliErrorReason;\n readonly status: number | undefined;\n readonly stderr_snippet: string | undefined;\n constructor(\n reason: ClaudeCliErrorReason,\n message: string,\n metadata: { status?: number; stderr_snippet?: string } = {},\n ) {\n super(message)\n this.name = 'claude_cli_error'\n this.reason = reason\n this.status = metadata.status\n this.stderr_snippet = metadata.stderr_snippet\n }\n}\n\nexport class provider_auth_error extends Error {\n readonly kind = 'provider_auth_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly provider: string;\n readonly refresh_command: string | undefined;\n constructor(\n provider: string,\n message: string,\n metadata: { refresh_command?: string } = {},\n ) {\n super(message)\n this.name = 'provider_auth_error'\n this.provider = provider\n this.refresh_command = metadata.refresh_command\n }\n}\n\n/**\n * A generate call that set a schema finished for a reason other than 'stop'\n * (content_filter, length, max_steps, tool_calls), so no schema-validated\n * value exists and validation was never attempted. Carries the raw model text\n * and the last provider-reported payload, so a guardrail trace or other\n * block detail stays reachable from the catch. Distinct from\n * schema_validation_error, which covers a response that completed normally\n * and then failed validation after its repair attempts ran out.\n */\nexport class incomplete_generation_error extends Error {\n readonly kind = 'incomplete_generation_error' as const;\n declare readonly path?: ReadonlyArray<string>;\n readonly finish_reason: FinishReason;\n readonly raw_text: string;\n readonly provider_reported: Record<string, unknown> | undefined;\n constructor(\n finish_reason: FinishReason,\n raw_text: string,\n provider_reported?: Record<string, unknown>,\n ) {\n super(\n `generation finished with '${finish_reason}' before a schema-validated response was produced`,\n )\n this.name = 'incomplete_generation_error'\n this.finish_reason = finish_reason\n this.raw_text = raw_text\n this.provider_reported = provider_reported\n }\n}\n","/**\n * Shared provider-adapter shape.\n *\n * Each file under src/engine/providers/ exports a factory that accepts a\n * ProviderInit shape and returns a ProviderAdapter. Factories are\n * synchronous; build_model is async so SDK loading is deferred until a model\n * is actually needed. Missing peer dependencies surface as engine_config_error\n * on first build_model call with a clear message naming the missing peer.\n *\n * Only the ai_sdk transport module (providers/ai_sdk/invoke.ts) may import\n * from `ai` or invoke generateText/streamText. ai_sdk adapters build the\n * provider model and translate parameters; they do not orchestrate the call.\n */\n\nimport type {\n ResolvedModel,\n EffortLevel,\n GenerateOptions,\n GenerateResult,\n ProviderInit,\n TurnRequest,\n TurnResult,\n UsageTotals,\n} from '../types.js'\nimport { engine_config_error } from '../errors.js'\n\n/**\n * Which backend a provider factory returns: 'ai_sdk' wraps the Vercel AI SDK\n * provider package, 'native' talks to the provider's HTTP API directly. The\n * provider name stays the same across transports so pricing keys and usage\n * fields carry over; only the wire implementation changes.\n */\nexport type ProviderTransport = 'ai_sdk' | 'native'\n\n/**\n * Read the `transport` selector off a provider init. Defaults to 'ai_sdk';\n * anything but the two known backends throws at construction so a typo\n * fails loud instead of silently running the default.\n */\nexport function resolve_transport(\n init: ProviderInit,\n provider: string,\n): ProviderTransport {\n const raw = init['transport']\n if (raw === undefined || raw === 'ai_sdk') return 'ai_sdk'\n if (raw === 'native') return 'native'\n throw new engine_config_error(\n `${provider} provider: transport must be 'ai_sdk' or 'native', got ${JSON.stringify(raw)}`,\n provider,\n )\n}\n\nexport type EffortTranslation = {\n // Outer keys are provider names, inner records hold per-provider settings,\n // matching the two-level shape merge_provider_options expects.\n provider_options: Record<string, Record<string, unknown>>\n effort_ignored: boolean\n}\n\nexport type ProviderCapability =\n | 'text'\n | 'tools'\n | 'schema'\n | 'streaming'\n | 'image_input'\n | 'reasoning'\n // Provider performs native constrained decoding (the AI SDK responseFormat /\n // Output.object path), as opposed to the prompt-for-JSON-then-extract path.\n // Distinct from 'schema': every provider can satisfy a schema via repair, but\n // only some constrain the decode to it.\n | 'structured_output'\n\nexport type RawProviderUsage = {\n input_tokens?: number\n output_tokens?: number\n reasoning_tokens?: number\n cached_input_tokens?: number\n cache_write_tokens?: number\n // Vercel AI SDK v6 also surfaces details via *Details containers; adapters\n // accept the flattened shape above for testability.\n input_token_details?: {\n cached_tokens?: number\n cache_creation_input_tokens?: number\n }\n output_token_details?: {\n reasoning_tokens?: number\n }\n [k: string]: unknown\n}\n\nexport type AiSdkProviderAdapter = {\n readonly kind: 'ai_sdk'\n readonly name: string\n readonly build_model: (model_id: string) => Promise<unknown>\n readonly translate_effort: (effort: EffortLevel) => EffortTranslation\n readonly normalize_usage: (raw: RawProviderUsage | undefined) => UsageTotals\n readonly supports: (capability: ProviderCapability) => boolean\n}\n\n/**\n * Raw-HTTP transport: implements a single turn against a provider's own\n * API with zero `ai` / `@ai-sdk/*` in its module graph. generate.ts wraps\n * invoke_turn in retry + classification + abort, so a native adapter owns only\n * request/response mapping (and streaming via TurnRequest.dispatch_chunk); it\n * MUST NOT implement its own retry. classify_error optionally overrides the\n * shared classifier; dispose is optional (keep-alive agents, connection pools).\n */\nexport type NativeProviderAdapter = {\n readonly kind: 'native'\n readonly name: string\n readonly invoke_turn: (req: TurnRequest) => Promise<TurnResult>\n readonly supports: (capability: ProviderCapability) => boolean\n readonly dispose?: () => Promise<void>\n readonly classify_error?: (err: unknown) => unknown\n}\n\nexport type ExternalAgentAdapter = {\n readonly kind: 'external'\n readonly name: string\n readonly generate: <t>(\n opts: GenerateOptions<t>,\n resolved: ResolvedModel,\n ) => Promise<GenerateResult<t>>\n readonly dispose: () => Promise<void>\n readonly supports: (capability: ProviderCapability) => boolean\n}\n\nexport type ProviderAdapter =\n | AiSdkProviderAdapter\n | NativeProviderAdapter\n | ExternalAgentAdapter\n\nexport type ProviderFactory = (init: ProviderInit) => ProviderAdapter\n\n/**\n * Map raw provider usage to UsageTotals, the mapper most adapters share.\n *\n * Missing usage zeroes the totals. Optional fields (reasoning and cache\n * tokens) are set only when the raw payload carries them, reading the\n * flattened field first and the AI SDK's *_details container second.\n */\nexport function default_normalize_usage(\n raw: RawProviderUsage | undefined,\n): UsageTotals {\n if (raw === undefined) return { input_tokens: 0, output_tokens: 0 }\n const input_tokens = typeof raw.input_tokens === 'number' ? raw.input_tokens : 0\n const output_tokens = typeof raw.output_tokens === 'number' ? raw.output_tokens : 0\n const totals: UsageTotals = { input_tokens, output_tokens }\n if (typeof raw.reasoning_tokens === 'number') totals.reasoning_tokens = raw.reasoning_tokens\n else if (typeof raw.output_token_details?.reasoning_tokens === 'number') {\n totals.reasoning_tokens = raw.output_token_details.reasoning_tokens\n }\n if (typeof raw.cached_input_tokens === 'number') totals.cached_input_tokens = raw.cached_input_tokens\n else if (typeof raw.input_token_details?.cached_tokens === 'number') {\n totals.cached_input_tokens = raw.input_token_details.cached_tokens\n }\n if (typeof raw.cache_write_tokens === 'number') totals.cache_write_tokens = raw.cache_write_tokens\n else if (typeof raw.input_token_details?.cache_creation_input_tokens === 'number') {\n totals.cache_write_tokens = raw.input_token_details.cache_creation_input_tokens\n }\n return totals\n}\n\n/**\n * Usage mapper for local backends (Ollama, LM Studio) whose servers never\n * report cache or reasoning tokens: default-normalize, then strip those\n * fields so a stray *_details container cannot invent them.\n */\nexport function normalize_local_usage(raw: RawProviderUsage | undefined): UsageTotals {\n const base = default_normalize_usage(raw)\n delete base.cached_input_tokens\n delete base.cache_write_tokens\n delete base.reasoning_tokens\n return base\n}\n\n/**\n * Build the standard missing-peer error: names the package and the install\n * command so a missing peer is diagnosable from the message alone. Shared so\n * every optional-peer failure reads identically, whether the failing\n * `import()` names the peer directly (load_optional_peer below) or a local\n * module that reaches the peer through its own static import (the ai_sdk\n * turn seam in generate.ts, whose dynamic import must stay written in\n * generate.ts for its relative specifier to resolve correctly).\n */\nexport function missing_peer_error(peer_name: string, cause: unknown): Error {\n const detail = cause instanceof Error ? cause.message : JSON.stringify(cause)\n const message =\n `missing peer dependency '${peer_name}'. Install it with your package manager, e.g., \\`pnpm add ${peer_name}\\` or \\`npm install ${peer_name}\\`. Cause: ${detail}`\n return new Error(message, { cause })\n}\n\n/**\n * Dynamically import an optional peer dependency, rethrowing an import\n * failure via missing_peer_error so a missing peer is diagnosable from the\n * message alone.\n */\nexport async function load_optional_peer<t>(\n specifier: string,\n): Promise<t> {\n let mod: unknown\n try {\n mod = await import(specifier)\n } catch (err: unknown) {\n throw missing_peer_error(specifier, err)\n }\n // eslint-disable-next-line typescript-eslint/no-unsafe-type-assertion\n return mod as t\n}\n","/**\n * Collapse a leading run of system messages into a single joined string,\n * returning the remaining messages.\n *\n * Both message paths hoist a leading system run out of their list the same way:\n * the engine-Message side (generate.ts split_leading_system_messages) hands the\n * run to a native adapter's TurnRequest.system, and the AI SDK side\n * (providers/ai_sdk/invoke.ts split_leading_system) hands it to the SDK's\n * top-level `instructions` option. Same guard, same '\\n\\n' join, and the same\n * \"return the list untouched when hoisting would leave `messages` empty\" rule,\n * since provider APIs reject an empty messages array. They differ only in the\n * element type and how a system message's text is read, so each caller supplies\n * `system_text`; the traversal and its guards live here once.\n */\nexport function split_leading_system_run<T extends { readonly role: string }>(\n messages: ReadonlyArray<T>,\n system_text: (message: Extract<T, { role: 'system' }>) => string,\n): { system?: string; messages: T[] } {\n let run_end = 0\n const system_parts: string[] = []\n while (run_end < messages.length) {\n const m = messages[run_end]\n if (!is_leading_system(m)) break\n system_parts.push(system_text(m))\n run_end += 1\n }\n const rest = messages.slice(run_end)\n if (system_parts.length === 0 || rest.length === 0) {\n return { messages: [...messages] }\n }\n return { system: system_parts.join('\\n\\n'), messages: rest }\n}\n\n/**\n * Narrow a possibly undefined message to the system member of its union.\n *\n * A cast-free type guard so `split_leading_system_run` can hand the narrowed\n * message straight to `system_text` without a `T`-eroding assertion; the\n * optional chain covers the out-of-bounds `undefined` the index access yields.\n */\nfunction is_leading_system<T extends { readonly role: string }>(\n m: T | undefined,\n): m is Extract<T, { role: 'system' }> {\n // Stryker disable next-line OptionalChaining: within the loop guard run_end < messages.length, m is always an in-bounds (defined) message, so m.role and m?.role read identically.\n return m?.role === 'system'\n}\n"],"mappings":";;AAyBA,IAAa,mBAAb,cAAsC,MAAM;CAC1C,OAAgB;CAEhB;CACA;CACA;CACA,YACE,SACA,WAA4E,CAAC,GAC7E;EACA,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,iBAAiB,SAAS;EAC/B,KAAK,WAAW,SAAS,YAAY;EACrC,KAAK,SAAS,SAAS;CACzB;AACF;AAEA,IAAa,iBAAb,cAAoC,MAAM;CACxC,OAAgB;CAEhB;CACA;CACA;CACA,YACE,SACA,WAII,CAAC,GACL;EACA,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,SAAS,SAAS;EACvB,KAAK,OAAO,SAAS;EACrB,KAAK,aAAa,SAAS;CAC7B;AACF;;;;;;;;;;;AAYA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,OAAgB;CAEhB;CACA;CACA,YAAY,YAAoB,YAAqB;EACnD,MAAM,2CAA2C,WAAW,GAAG;EAC/D,KAAK,OAAO;EACZ,KAAK,aAAa;EAClB,KAAK,aAAa;CACpB;AACF;AAEA,IAAa,0BAAb,cAA6C,MAAM;CACjD,OAAgB;CAEhB;CACA;CACA,YAAY,SAAiB,eAA2C,UA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AW,GAAG;CACzC;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;AClMA,SAAgB,yBACd,UACA,aACoC;CACpC,IAAI,UAAU;CACd,MAAM,eAAyB,CAAC;CAChC,OAAO,UAAU,SAAS,QAAQ;EAChC,MAAM,IAAI,SAAS;EACnB,IAAI,CAAC,kBAAkB,CAAC,GAAG;EAC3B,aAAa,KAAK,YAAY,CAAC,CAAC;EAChC,WAAW;CACb;CACA,MAAM,OAAO,SAAS,MAAM,OAAO;CACnC,IAAI,aAAa,WAAW,KAAK,KAAK,WAAW,GAC/C,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAE;CAEnC,OAAO;EAAE,QAAQ,aAAa,KAAK,MAAM;EAAG,UAAU;CAAK;AAC7D;;;;;;;;AASA,SAAS,kBACP,GACqC;CAErC,OAAO,GAAG,SAAS;AACrB"}
package/dist/mcp.d.ts CHANGED
@@ -1,9 +1,23 @@
1
1
  import { c as Step, h as TrajectoryLogger } from "./types-CPqLZOEr.js";
2
2
  import { r as ToolSchema } from "./types-BK0UW28o.js";
3
- import { E as Tool } from "./types-CZ83Q5nm.js";
3
+ import { E as Tool } from "./types-C_Rmcgck.js";
4
4
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
5
5
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
6
  import { z } from "zod";
7
+ //#region src/schema/json_schema_to_standard.d.ts
8
+ /**
9
+ * Builds a `ToolSchema` over a JSON Schema, such as an MCP server's advertised
10
+ * tool input.
11
+ *
12
+ * The schema is snapshotted once, deeply, and both faces of the returned object
13
+ * read that snapshot. A malformed or hostile schema degrades to the empty
14
+ * schema during the snapshot rather than propagating an error, since an
15
+ * arbitrary remote server's advertisement must never crash tool discovery, and
16
+ * it leaves both faces describing the same thing: accept anything, emit
17
+ * nothing.
18
+ */
19
+ export declare function json_schema_to_standard(schema: unknown): ToolSchema;
20
+ //#endregion
7
21
  //#region src/mcp/client.d.ts
8
22
  type McpStdioConfig = {
9
23
  transport: 'stdio';
@@ -78,19 +92,6 @@ type ServeFlowOptions<i, o> = {
78
92
  */
79
93
  export declare function serve_flow<i, o>(options: ServeFlowOptions<i, o>): void;
80
94
  //#endregion
81
- //#region src/mcp/schema_bridge.d.ts
82
- /**
83
- * Builds a `ToolSchema` over an MCP server's advertised JSON Schema.
84
- *
85
- * The advertised schema is snapshotted once, deeply, and both faces of the
86
- * returned object read that snapshot. A malformed or hostile schema degrades to
87
- * the empty schema during the snapshot rather than propagating an error, since
88
- * an arbitrary remote server's advertisement must never crash tool discovery,
89
- * and it leaves both faces describing the same thing: accept anything, emit
90
- * nothing.
91
- */
92
- export declare function json_schema_to_standard(schema: unknown): ToolSchema;
93
- //#endregion
94
95
  //#region src/mcp/errors.d.ts
95
96
  /**
96
97
  * Typed errors for the MCP adapter.
@@ -100,11 +101,11 @@ export declare function json_schema_to_standard(schema: unknown): ToolSchema;
100
101
  * missing optional peer from a tool-level failure surfaced over the wire.
101
102
  */
102
103
  export declare class mcp_sdk_missing_error extends Error {
103
- readonly kind: "mcp_sdk_missing_error";
104
+ readonly kind: 'mcp_sdk_missing_error';
104
105
  constructor(message?: string);
105
106
  }
106
107
  export declare class mcp_error extends Error {
107
- readonly kind: "mcp_error";
108
+ readonly kind: 'mcp_error';
108
109
  readonly tool_name: string | undefined;
109
110
  constructor(message: string, metadata?: {
110
111
  tool_name?: string;