fascicle 0.9.1 → 0.9.2
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.
- package/CHANGELOG.md +20 -0
- package/README.md +7 -5
- package/dist/{index-CJRUqgsV.d.ts → index-DyjXGal_.d.ts} +200 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2078 -143
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/otel.d.ts +20 -0
- package/dist/otel.js +127 -0
- package/dist/otel.js.map +1 -0
- package/package.json +14 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.9.2 — 2026-07-11
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Native provider transport.** Model calls now flow through a neutral native provider contract instead of routing exclusively through the AI SDK. This release lands native Anthropic (mapping, streaming, capabilities, auth), a native OpenAI-compatible core that backs `openai`, `openrouter`, and `lmstudio`, and native Ollama on its `/api/chat` endpoint. The AI SDK becomes one transport behind the seam rather than the only path, and `provider_options` pass straight through to the native transport.
|
|
8
|
+
- **Open provider registry.** `custom_providers` on `EngineConfig` lets callers register their own providers, and the native provider contract is exported from the package barrel so those providers can be built against a stable type.
|
|
9
|
+
- **Loop knobs.** Per-turn timeout budgets and a `prepare_step` hook give callers control over each step of the tool loop.
|
|
10
|
+
- **OpenTelemetry surface.** A trajectory-to-otel bridge plus AI SDK telemetry passthrough emit spans for runs and model calls, with the agent-layer boundary ADR amended to record the seam.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **Breaking: the `subprocess` provider is renamed to `external`.** Update any `provider: "subprocess"` configuration to `provider: "external"`.
|
|
15
|
+
- The native provider seam is now the default dispatch path; the AI SDK transport is selected behind it rather than assumed.
|
|
16
|
+
|
|
17
|
+
### Internal
|
|
18
|
+
|
|
19
|
+
- Mutation coverage hardened across the native providers (`openai_compatible_native`, `ollama_native`), the otel surface, and `with_providers` in `create_engine`, with the Stryker break gate ratcheted up at the final gate.
|
|
20
|
+
- Transport parity golden tests plus an OpenRouter live smoke lock the native and AI SDK transports to identical observable behavior.
|
|
21
|
+
- The release skill now detects the previous release from the most recent git tag rather than the last `vX.Y.Z` commit message.
|
|
22
|
+
|
|
3
23
|
## v0.9.1 — 2026-07-10
|
|
4
24
|
|
|
5
25
|
### Internal
|
package/README.md
CHANGED
|
@@ -84,6 +84,8 @@ Plus `run`, `run.stream`, and `describe`.
|
|
|
84
84
|
|
|
85
85
|
**AI engine.** `create_engine(config)` returns one `generate` surface across eight providers. Two axes: `model` is an opaque id sent to the provider verbatim (`claude-opus-4-8`, `gpt-4o`, `us.anthropic.claude-sonnet-4-20250514-v1:0`), and `provider` names the transport (`anthropic`, `bedrock`, `openrouter`, `claude_cli`, …) — swap `provider` to move a call between transports. Reasoning effort (`'none'` through `'max'`) is translated per provider. Cost estimation uses a pricing table with per-engine overrides.
|
|
86
86
|
|
|
87
|
+
The engine core is SDK-agnostic: providers plug in behind a neutral single-turn seam, as one of three kinds. Most built-ins wrap Vercel's AI SDK (`ai_sdk`); five providers can instead run `transport: 'native'` (raw HTTP, no AI SDK in the path, no peer to install) — `anthropic` on the Messages API, `openai`/`openrouter`/`lmstudio` on a shared OpenAI Chat Completions core, and `ollama` on its own `/api/chat` endpoint; and `claude_cli` delegates to an external agent. All inherit the same tool loop, retry, cost, and trajectory, and `custom_providers` registers your own adapter of any kind without touching fascicle. See [docs/providers.md](./docs/providers.md).
|
|
88
|
+
|
|
87
89
|
**Adapters injected per run.** Trajectory loggers and checkpoint stores ship under the `fascicle/adapters` subpath:
|
|
88
90
|
|
|
89
91
|
```typescript
|
|
@@ -128,13 +130,13 @@ serve_flow({
|
|
|
128
130
|
|
|
129
131
|
| Provider | Peer dep | Auth |
|
|
130
132
|
| ------------ | ----------------------------- | ------------------- |
|
|
131
|
-
| `anthropic` | `@ai-sdk/anthropic`
|
|
132
|
-
| `openai` | `@ai-sdk/openai`
|
|
133
|
+
| `anthropic` | `@ai-sdk/anthropic`, or none with `transport: 'native'` | API key |
|
|
134
|
+
| `openai` | `@ai-sdk/openai`, or none with `transport: 'native'` | API key |
|
|
133
135
|
| `google` | `@ai-sdk/google` | API key |
|
|
134
|
-
| `openrouter` | `@openrouter/ai-sdk-provider` | API key
|
|
136
|
+
| `openrouter` | `@openrouter/ai-sdk-provider`, or none with `transport: 'native'` | API key |
|
|
135
137
|
| `bedrock` | `@ai-sdk/amazon-bedrock` | `region` + AWS credentials |
|
|
136
|
-
| `ollama` | `ai-sdk-ollama`
|
|
137
|
-
| `lmstudio` | `@ai-sdk/openai-compatible`
|
|
138
|
+
| `ollama` | `ai-sdk-ollama`, or none with `transport: 'native'` | local `base_url` |
|
|
139
|
+
| `lmstudio` | `@ai-sdk/openai-compatible`, or none with `transport: 'native'` | local `base_url` |
|
|
138
140
|
| `claude_cli` | none (spawns `claude`) | OAuth or API key |
|
|
139
141
|
|
|
140
142
|
Full details: [docs/providers.md](./docs/providers.md). The `claude_cli` adapter has its own guide: [docs/cli.md](./docs/cli.md).
|
|
@@ -50,6 +50,68 @@ type ClaudeCliProviderConfig = {
|
|
|
50
50
|
readonly skip_probe?: boolean;
|
|
51
51
|
};
|
|
52
52
|
//#endregion
|
|
53
|
+
//#region src/engine/providers/types.d.ts
|
|
54
|
+
/**
|
|
55
|
+
* Which depth-1 backend a provider factory returns (D3). The provider name
|
|
56
|
+
* stays the same across transports so pricing keys and usage fields carry
|
|
57
|
+
* over; only the wire implementation changes.
|
|
58
|
+
*/
|
|
59
|
+
type ProviderTransport = 'ai_sdk' | 'native';
|
|
60
|
+
type EffortTranslation = {
|
|
61
|
+
provider_options: Record<string, Record<string, unknown>>;
|
|
62
|
+
effort_ignored: boolean;
|
|
63
|
+
};
|
|
64
|
+
type ProviderCapability = 'text' | 'tools' | 'schema' | 'streaming' | 'image_input' | 'reasoning' | 'structured_output';
|
|
65
|
+
type RawProviderUsage = {
|
|
66
|
+
input_tokens?: number;
|
|
67
|
+
output_tokens?: number;
|
|
68
|
+
reasoning_tokens?: number;
|
|
69
|
+
cached_input_tokens?: number;
|
|
70
|
+
cache_write_tokens?: number;
|
|
71
|
+
input_token_details?: {
|
|
72
|
+
cached_tokens?: number;
|
|
73
|
+
cache_creation_input_tokens?: number;
|
|
74
|
+
};
|
|
75
|
+
output_token_details?: {
|
|
76
|
+
reasoning_tokens?: number;
|
|
77
|
+
};
|
|
78
|
+
[k: string]: unknown;
|
|
79
|
+
};
|
|
80
|
+
type AiSdkProviderAdapter = {
|
|
81
|
+
readonly kind: 'ai_sdk';
|
|
82
|
+
readonly name: string;
|
|
83
|
+
readonly build_model: (model_id: string) => Promise<unknown>;
|
|
84
|
+
readonly translate_effort: (effort: EffortLevel) => EffortTranslation;
|
|
85
|
+
readonly normalize_usage: (raw: RawProviderUsage | undefined) => UsageTotals;
|
|
86
|
+
readonly supports: (capability: ProviderCapability) => boolean;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Depth-1 raw-HTTP transport: implements a single turn against a provider's own
|
|
90
|
+
* API with zero `ai` / `@ai-sdk/*` in its module graph. generate.ts wraps
|
|
91
|
+
* invoke_turn in retry + classification + abort, so a native adapter owns only
|
|
92
|
+
* request/response mapping (and streaming via TurnRequest.dispatch_chunk); it
|
|
93
|
+
* MUST NOT implement its own retry. classify_error optionally overrides the
|
|
94
|
+
* shared classifier; dispose is optional (keep-alive agents, connection pools).
|
|
95
|
+
*/
|
|
96
|
+
type NativeProviderAdapter = {
|
|
97
|
+
readonly kind: 'native';
|
|
98
|
+
readonly name: string;
|
|
99
|
+
readonly invoke_turn: (req: TurnRequest) => Promise<TurnResult>;
|
|
100
|
+
readonly supports: (capability: ProviderCapability) => boolean;
|
|
101
|
+
readonly dispose?: () => Promise<void>;
|
|
102
|
+
readonly classify_error?: (err: unknown) => unknown;
|
|
103
|
+
};
|
|
104
|
+
type ExternalAgentAdapter = {
|
|
105
|
+
readonly kind: 'external';
|
|
106
|
+
readonly name: string;
|
|
107
|
+
readonly generate: <t>(opts: GenerateOptions<t>, resolved: ResolvedModel) => Promise<GenerateResult<t>>;
|
|
108
|
+
readonly dispose: () => Promise<void>;
|
|
109
|
+
readonly supports: (capability: ProviderCapability) => boolean;
|
|
110
|
+
};
|
|
111
|
+
type ProviderAdapter = AiSdkProviderAdapter | NativeProviderAdapter | ExternalAgentAdapter;
|
|
112
|
+
type ProviderFactory = (init: ProviderInit) => ProviderAdapter;
|
|
113
|
+
declare function default_normalize_usage(raw: RawProviderUsage | undefined): UsageTotals;
|
|
114
|
+
//#endregion
|
|
53
115
|
//#region src/engine/types.d.ts
|
|
54
116
|
type EffortLevel = 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
55
117
|
type FinishReason = 'stop' | 'tool_calls' | 'length' | 'content_filter' | 'aborted' | 'max_steps';
|
|
@@ -221,6 +283,72 @@ type StreamChunk = {
|
|
|
221
283
|
finish_reason: FinishReason;
|
|
222
284
|
usage: UsageTotals;
|
|
223
285
|
};
|
|
286
|
+
/**
|
|
287
|
+
* Neutral single-turn result shared by every depth-1 transport (`ai_sdk`,
|
|
288
|
+
* `native`). The tool-call loop consumes it through InvokeOnce; a native
|
|
289
|
+
* adapter's invoke_turn produces it directly. Staying provider-agnostic here is
|
|
290
|
+
* what lets salvage, approval, cost, and retry sit in one loop above any
|
|
291
|
+
* transport rather than being reimplemented per provider.
|
|
292
|
+
*/
|
|
293
|
+
type TurnResult = {
|
|
294
|
+
readonly text: string;
|
|
295
|
+
readonly tool_calls: ReadonlyArray<{
|
|
296
|
+
readonly id: string;
|
|
297
|
+
readonly name: string;
|
|
298
|
+
readonly input: unknown;
|
|
299
|
+
}>;
|
|
300
|
+
readonly finish_reason: FinishReason;
|
|
301
|
+
readonly usage: UsageTotals;
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* One turn's resolved request handed to a native adapter's invoke_turn.
|
|
305
|
+
* generate.ts assembles it from GenerateOptions plus engine defaults (resolved
|
|
306
|
+
* system, effort, merged provider_options, sampling params). When `stream` is
|
|
307
|
+
* true `dispatch_chunk` is defined and the adapter MUST emit StreamChunks
|
|
308
|
+
* through it while still returning the fully aggregated TurnResult.
|
|
309
|
+
*/
|
|
310
|
+
type TurnRequest = {
|
|
311
|
+
readonly step_index: number;
|
|
312
|
+
readonly messages: ReadonlyArray<Message>;
|
|
313
|
+
readonly tools: ReadonlyArray<Tool>;
|
|
314
|
+
readonly abort: AbortSignal;
|
|
315
|
+
readonly stream: boolean;
|
|
316
|
+
readonly model_id: string;
|
|
317
|
+
readonly system?: string;
|
|
318
|
+
readonly schema?: z.ZodType;
|
|
319
|
+
readonly effort: EffortLevel;
|
|
320
|
+
readonly provider_options?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
321
|
+
readonly temperature?: number;
|
|
322
|
+
readonly max_tokens?: number;
|
|
323
|
+
readonly top_p?: number;
|
|
324
|
+
readonly dispatch_chunk?: (chunk: StreamChunk) => Promise<void>;
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* Context handed to a prepare_step hook (D6): the turn's index and the
|
|
328
|
+
* would-be request messages (the full accumulated transcript at that point in
|
|
329
|
+
* the loop). Kept minimal by design; per-step model/effort switching is out of
|
|
330
|
+
* scope (Open question N-Q1).
|
|
331
|
+
*/
|
|
332
|
+
type PrepareStepContext = {
|
|
333
|
+
readonly step_index: number;
|
|
334
|
+
readonly messages: ReadonlyArray<Message>;
|
|
335
|
+
};
|
|
336
|
+
/**
|
|
337
|
+
* A prepare_step return: `{ messages }` replaces the request for that turn,
|
|
338
|
+
* `undefined` (or an object without `messages`) is a no-op.
|
|
339
|
+
*/
|
|
340
|
+
type PrepareStepResult = {
|
|
341
|
+
messages?: ReadonlyArray<Message>;
|
|
342
|
+
} | undefined;
|
|
343
|
+
/**
|
|
344
|
+
* Per-turn message hook (D6). run_tool_loop calls it before each turn on every
|
|
345
|
+
* depth-1 transport. Returning replacement messages reshapes ONLY what is sent
|
|
346
|
+
* to the model for that turn (pruning, summarizing, windowing); the canonical
|
|
347
|
+
* transcript the loop appends to is untouched, so salvage, approval,
|
|
348
|
+
* Tool.ends_turn, and schema-repair keep operating on the real history. May be
|
|
349
|
+
* sync or async.
|
|
350
|
+
*/
|
|
351
|
+
type PrepareStepHook = (ctx: PrepareStepContext) => PrepareStepResult | Promise<PrepareStepResult>;
|
|
224
352
|
type GenerateOptions<t = string> = {
|
|
225
353
|
model?: string;
|
|
226
354
|
provider?: string;
|
|
@@ -233,6 +361,14 @@ type GenerateOptions<t = string> = {
|
|
|
233
361
|
max_tokens?: number;
|
|
234
362
|
top_p?: number;
|
|
235
363
|
max_steps?: number;
|
|
364
|
+
/**
|
|
365
|
+
* Per-turn wall-clock budget in milliseconds. When set, the engine composes
|
|
366
|
+
* a timeout signal with `abort` around every depth-1 turn (D5); expiry before
|
|
367
|
+
* any chunk streams throws a retryable timeout, while an expiry after chunks
|
|
368
|
+
* have flowed becomes a non-retryable stream interruption. undefined (the
|
|
369
|
+
* default) leaves turns unbounded. Must be > 0.
|
|
370
|
+
*/
|
|
371
|
+
turn_timeout_ms?: number;
|
|
236
372
|
abort?: AbortSignal;
|
|
237
373
|
trajectory?: TrajectoryLogger;
|
|
238
374
|
on_chunk?: (chunk: StreamChunk) => void | Promise<void>;
|
|
@@ -254,6 +390,15 @@ type GenerateOptions<t = string> = {
|
|
|
254
390
|
*/
|
|
255
391
|
max_tool_calls_per_step?: number;
|
|
256
392
|
on_tool_approval?: ToolApprovalHandler;
|
|
393
|
+
/**
|
|
394
|
+
* Per-turn hook to reshape the messages sent to the model without mutating
|
|
395
|
+
* the canonical transcript (D6). Called before every turn with the step
|
|
396
|
+
* index and the would-be request messages; return `{ messages }` to
|
|
397
|
+
* prune/replace that turn's request or undefined for a no-op. A
|
|
398
|
+
* `step_prepared` trajectory event records every turn it replaced. See
|
|
399
|
+
* PrepareStepHook.
|
|
400
|
+
*/
|
|
401
|
+
prepare_step?: PrepareStepHook;
|
|
257
402
|
provider_options?: Record<string, unknown>;
|
|
258
403
|
};
|
|
259
404
|
type GenerateResult<t = string> = {
|
|
@@ -278,11 +423,13 @@ type ProviderConfigMap = {
|
|
|
278
423
|
anthropic?: {
|
|
279
424
|
api_key: string;
|
|
280
425
|
base_url?: string;
|
|
426
|
+
transport?: ProviderTransport;
|
|
281
427
|
};
|
|
282
428
|
openai?: {
|
|
283
429
|
api_key: string;
|
|
284
430
|
base_url?: string;
|
|
285
431
|
organization?: string;
|
|
432
|
+
transport?: ProviderTransport;
|
|
286
433
|
};
|
|
287
434
|
google?: {
|
|
288
435
|
api_key: string;
|
|
@@ -290,15 +437,18 @@ type ProviderConfigMap = {
|
|
|
290
437
|
};
|
|
291
438
|
ollama?: {
|
|
292
439
|
base_url: string;
|
|
440
|
+
transport?: ProviderTransport;
|
|
293
441
|
};
|
|
294
442
|
lmstudio?: {
|
|
295
443
|
base_url: string;
|
|
444
|
+
transport?: ProviderTransport;
|
|
296
445
|
};
|
|
297
446
|
openrouter?: {
|
|
298
447
|
api_key: string;
|
|
299
448
|
base_url?: string;
|
|
300
449
|
http_referer?: string;
|
|
301
450
|
x_title?: string;
|
|
451
|
+
transport?: ProviderTransport;
|
|
302
452
|
};
|
|
303
453
|
bedrock?: {
|
|
304
454
|
region: string;
|
|
@@ -311,6 +461,23 @@ type ProviderConfigMap = {
|
|
|
311
461
|
claude_cli?: ClaudeCliProviderConfig;
|
|
312
462
|
[custom: string]: ProviderInit | undefined;
|
|
313
463
|
};
|
|
464
|
+
/**
|
|
465
|
+
* Opt-in OpenTelemetry for the `ai_sdk` transport (D7, Layer 2). When `enabled`,
|
|
466
|
+
* the transport constructs an `@ai-sdk/otel` integration strictly below the turn
|
|
467
|
+
* seam and hands it to the SDK's telemetry, so generateText / streamText emit
|
|
468
|
+
* turn-internal spans on the ai_sdk transport only. Native transports ignore it;
|
|
469
|
+
* loop-level, transport-neutral tracing is the `fascicle/otel` bridge's job
|
|
470
|
+
* (Layer 1). `tracer` is an `@opentelemetry/api` Tracer, typed `unknown` here so
|
|
471
|
+
* the engine's public type surface stays free of the optional OTel peer.
|
|
472
|
+
*/
|
|
473
|
+
type AiSdkTelemetrySettings = {
|
|
474
|
+
readonly enabled: boolean;
|
|
475
|
+
readonly function_id?: string;
|
|
476
|
+
readonly record_inputs?: boolean;
|
|
477
|
+
readonly record_outputs?: boolean;
|
|
478
|
+
readonly metadata?: Readonly<Record<string, string | number | boolean>>;
|
|
479
|
+
readonly tracer?: unknown;
|
|
480
|
+
};
|
|
314
481
|
/**
|
|
315
482
|
* Call-level defaults applied by the engine before dispatching to a provider.
|
|
316
483
|
*
|
|
@@ -320,7 +487,7 @@ type ProviderConfigMap = {
|
|
|
320
487
|
* | --------------------------------------------------------------------- | ----------------------------------------- |
|
|
321
488
|
* | `model` | per-call wins; else default; else `sonnet` |
|
|
322
489
|
* | `provider` | per-call wins; else default; else sole configured provider; else `anthropic` |
|
|
323
|
-
* | `system`, `effort`, `max_steps`, `tool_error_policy`, `schema_repair_attempts`, `tool_call_repair_attempts`, `max_tool_calls_per_step` | per-call wins (nullish coalesce) |
|
|
490
|
+
* | `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) |
|
|
324
491
|
* | `retry_policy` | per-call replaces wholesale |
|
|
325
492
|
* | `provider_options` | two-level: per-provider-key shallow merge |
|
|
326
493
|
* | `prompt`, `tools`, `schema`, `abort`, `trajectory`, `on_chunk` | not defaultable; always call-supplied |
|
|
@@ -331,15 +498,31 @@ type EngineDefaults = {
|
|
|
331
498
|
readonly system?: string;
|
|
332
499
|
readonly effort?: EffortLevel;
|
|
333
500
|
readonly max_steps?: number;
|
|
501
|
+
readonly turn_timeout_ms?: number;
|
|
334
502
|
readonly retry_policy?: RetryPolicy;
|
|
335
503
|
readonly tool_error_policy?: 'feed_back' | 'throw';
|
|
336
504
|
readonly schema_repair_attempts?: number;
|
|
337
505
|
readonly tool_call_repair_attempts?: number;
|
|
338
506
|
readonly max_tool_calls_per_step?: number;
|
|
339
507
|
readonly provider_options?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
508
|
+
/**
|
|
509
|
+
* Opt-in OpenTelemetry for the `ai_sdk` transport (D7, Layer 2). Enabling it
|
|
510
|
+
* makes every ai_sdk-transport generate call emit turn-internal spans via
|
|
511
|
+
* `@ai-sdk/otel`; native transports ignore it. See AiSdkTelemetrySettings.
|
|
512
|
+
*/
|
|
513
|
+
readonly ai_sdk_telemetry?: AiSdkTelemetrySettings;
|
|
340
514
|
};
|
|
341
515
|
type EngineConfig = {
|
|
342
516
|
providers: ProviderConfigMap;
|
|
517
|
+
/**
|
|
518
|
+
* Construction-time provider registry extension. Keys are provider names,
|
|
519
|
+
* resolved custom-first against the built-ins; a key that shadows a built-in
|
|
520
|
+
* name throws engine_config_error. A factory may return an adapter of any
|
|
521
|
+
* kind, and receives the same-named entry from `providers` as its init.
|
|
522
|
+
* Registration is construction-time only; there is no runtime
|
|
523
|
+
* (post-construction) registration.
|
|
524
|
+
*/
|
|
525
|
+
custom_providers?: Record<string, ProviderFactory>;
|
|
343
526
|
pricing?: PricingTable;
|
|
344
527
|
default_retry?: RetryPolicy;
|
|
345
528
|
default_effort?: EffortLevel;
|
|
@@ -351,6 +534,20 @@ type Engine = {
|
|
|
351
534
|
register_price: (provider: string, model_id: string, pricing: Pricing) => void;
|
|
352
535
|
resolve_price: (provider: string, model_id: string) => Pricing | undefined;
|
|
353
536
|
list_prices: () => PricingTable;
|
|
537
|
+
/**
|
|
538
|
+
* Derive a NEW engine with additional or overriding providers (D8) — the
|
|
539
|
+
* value-semantic answer to "register a provider after construction", not
|
|
540
|
+
* mutable runtime registration. `providers` shallow-merge by name over this
|
|
541
|
+
* engine's configured providers (a same-named entry overrides), and
|
|
542
|
+
* `custom_providers` likewise over the configured custom registry; every
|
|
543
|
+
* other setting (construction-time pricing, defaults, retry) carries forward
|
|
544
|
+
* unchanged. The merged config is re-validated under the same custom-first
|
|
545
|
+
* resolution and built-in shadow-throws rule, all adapters are constructed
|
|
546
|
+
* fresh, and the derived engine disposes independently. This engine is left
|
|
547
|
+
* untouched: it keeps its own adapters, dispose lifecycle, and any runtime
|
|
548
|
+
* `register_price` mutations.
|
|
549
|
+
*/
|
|
550
|
+
with_providers: (providers: ProviderConfigMap, custom_providers?: Record<string, ProviderFactory>) => Engine;
|
|
354
551
|
dispose: () => Promise<void>;
|
|
355
552
|
};
|
|
356
553
|
//#endregion
|
|
@@ -457,5 +654,5 @@ declare class provider_auth_error extends Error {
|
|
|
457
654
|
});
|
|
458
655
|
}
|
|
459
656
|
//#endregion
|
|
460
|
-
export {
|
|
461
|
-
//# sourceMappingURL=index-
|
|
657
|
+
export { ProviderFactory as $, PricingTable as A, ToolApprovalRequest as B, GenerateOptions as C, PrepareStepHook as D, PrepareStepContext as E, RetryPolicy as F, UsageTotals as G, ToolExecContext as H, StepRecord as I, EffortTranslation as J, UserContentPart as K, StreamChunk as L, ProviderInit as M, ResolvedModel as N, PrepareStepResult as O, RetryFailureKind as P, ProviderCapability as Q, Tool as R, FinishReason as S, Message as T, TurnRequest as U, ToolCallRecord as V, TurnResult as W, NativeProviderAdapter as X, ExternalAgentAdapter as Y, ProviderAdapter as Z, CostBreakdown as _, on_chunk_error as a, EngineConfig as b, provider_error as c, schema_validation_error as d, ProviderTransport as et, tool_approval_denied_error as f, AssistantContentPart as g, AiSdkTelemetrySettings as h, model_required_error as i, ProviderConfigMap as j, Pricing as k, provider_not_configured_error as l, create_engine as m, engine_config_error as n, default_normalize_usage as nt, provider_auth_error as o, tool_error as p, AiSdkProviderAdapter as q, engine_disposed_error as r, provider_capability_error as s, claude_cli_error as t, RawProviderUsage as tt, rate_limit_error as u, EffortLevel as v, GenerateResult as w, EngineDefaults as x, Engine as y, ToolApprovalHandler as z };
|
|
658
|
+
//# sourceMappingURL=index-DyjXGal_.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as fallback, B as describe, C as checkpoint, D as LoopResult, E as LoopGuardResult, F as parallel, G as Step, H as run, I as sequence, J as TrajectoryLogger, K as StepMetadata, L as DescribeOptions, M as pipe, N as map, O as loop, P as branch, R as FlowNode, S as suspend, T as LoopConfig, U as CheckpointStore, V as step, W as RunContext, Y as __json_default_export, _ as suspended_error, a as SpanStartEvent, b as stash, c as span_end_event_schema, d as STEP_KINDS, f as StepKind, g as resume_validation_error, h as describe_cycle_error, i as SpanEndEvent, j as retry, k as timeout, l as span_start_event_schema, m as aborted_error, n as EmitEvent, o as custom_event_schema, p as is_step_kind, q as TrajectoryEvent, r as ParsedTrajectoryEvent, s as emit_event_schema, t as CustomTrajectoryEvent, u as trajectory_event_schema, v as timeout_error, w as compose, x as use, y as scope, z as FlowValue } from "./index-JhJahQNi.js";
|
|
2
|
-
import { A as
|
|
2
|
+
import { $ as ProviderFactory, A as PricingTable, B as ToolApprovalRequest, C as GenerateOptions, D as PrepareStepHook, E as PrepareStepContext, F as RetryPolicy, G as UsageTotals, H as ToolExecContext, I as StepRecord, J as EffortTranslation, K as UserContentPart, L as StreamChunk, M as ProviderInit, N as ResolvedModel, O as PrepareStepResult, P as RetryFailureKind, Q as ProviderCapability, R as Tool, S as FinishReason, T as Message, U as TurnRequest, V as ToolCallRecord, W as TurnResult, X as NativeProviderAdapter, Y as ExternalAgentAdapter, Z as ProviderAdapter, _ as CostBreakdown, a as on_chunk_error, b as EngineConfig, c as provider_error, d as schema_validation_error, et as ProviderTransport, f as tool_approval_denied_error, g as AssistantContentPart, h as AiSdkTelemetrySettings, i as model_required_error, j as ProviderConfigMap, k as Pricing, l as provider_not_configured_error, m as create_engine, n as engine_config_error, nt as default_normalize_usage, o as provider_auth_error, p as tool_error, q as AiSdkProviderAdapter, r as engine_disposed_error, s as provider_capability_error, t as claude_cli_error, tt as RawProviderUsage, u as rate_limit_error, v as EffortLevel, w as GenerateResult, x as EngineDefaults, y as Engine, z as ToolApprovalHandler } from "./index-DyjXGal_.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/composites/adversarial.d.ts
|
|
@@ -348,5 +348,5 @@ declare function start_viewer(options?: StartViewerOptions): Promise<ViewerHandl
|
|
|
348
348
|
*/
|
|
349
349
|
declare function run_viewer_cli(argv: readonly string[]): Promise<void>;
|
|
350
350
|
//#endregion
|
|
351
|
-
export { type AdversarialBuildInput, type AdversarialConfig, type AdversarialCritiqueResult, type AdversarialResult, type AssistantContentPart, type BenchCase, type BenchOptions, type BenchReport, type BenchSummary, type BracketRecord, type Candidate, type CaseResult, type CheckpointStore, type ConsensusConfig, type ConsensusResult, type CostBreakdown, type CustomTrajectoryEvent, type DescribeOptions, type EffortLevel, type EmitEvent, type Engine, type EngineConfig, type EngineDefaults, type EnsembleConfig, type EnsembleResult, type EnsembleStepConfig, type EnsembleStepResult, type FinishReason, type FlowNode, type FlowValue, type GenerateOptions, type GenerateResult, type HistoryEntry, type ImproveBudget, type ImproveConfig, type ImproveResult, type ImproveRoundInput, type Improvement, type Judge, type JudgeArgs, type JudgeLlmConfig, type JudgeWithFn, type LearnConfig, type LearnInput, type LearnResult, type Lesson, type LoopConfig, type LoopGuardResult, type LoopResult, type Message, type ModelCallConfig, type ModelCallInput, type ParsedTrajectoryEvent, type PerCaseDelta, type Pricing, type PricingTable, type ProviderConfigMap, type ProviderInit, type RegressionCompareOptions, type RegressionDelta, type RegressionReport, type ResolvedModel, type RetryFailureKind, type RetryPolicy, type RunContext, STEP_KINDS, type Score, type ScoredCandidate, type SpanEndEvent, type SpanStartEvent, type StartViewerOptions, type Step, type StepKind, type StepMetadata, type StepRecord, type StreamChunk, type Tool, type ToolApprovalHandler, type ToolApprovalRequest, type ToolCallRecord, type ToolExecContext, type TournamentConfig, type TournamentResult, type TrajectoryEvent, type TrajectoryLogger, type TrajectorySource, type UsageTotals, type UserContentPart, type ViewerHandle, aborted_error, adversarial, bench, branch, checkpoint, claude_cli_error, compose, consensus, create_engine, custom_event_schema, describe, describe_cycle_error, emit_event_schema, engine_config_error, engine_disposed_error, ensemble, ensemble_step, fallback, __json_default_export as flow_schema, forward_standard_env, improve, is_step_kind, judge_equals, judge_llm, judge_with, learn, loop, map, model_call, model_required_error, normalize_score, on_chunk_error, parallel, pipe, provider_auth_error, provider_capability_error, provider_error, provider_not_configured_error, rate_limit_error, read_baseline, regression_compare, resume_validation_error, retry, run, run_viewer_cli, schema_validation_error, scope, sequence, span_end_event_schema, span_start_event_schema, start_viewer, stash, step, suspend, suspended_error, timeout, timeout_error, tool_approval_denied_error, tool_error, tournament, trajectory_event_schema, use, write_baseline };
|
|
351
|
+
export { type AdversarialBuildInput, type AdversarialConfig, type AdversarialCritiqueResult, type AdversarialResult, type AiSdkProviderAdapter, type AiSdkTelemetrySettings, type AssistantContentPart, type BenchCase, type BenchOptions, type BenchReport, type BenchSummary, type BracketRecord, type Candidate, type CaseResult, type CheckpointStore, type ConsensusConfig, type ConsensusResult, type CostBreakdown, type CustomTrajectoryEvent, type DescribeOptions, type EffortLevel, type EffortTranslation, type EmitEvent, type Engine, type EngineConfig, type EngineDefaults, type EnsembleConfig, type EnsembleResult, type EnsembleStepConfig, type EnsembleStepResult, type ExternalAgentAdapter, type FinishReason, type FlowNode, type FlowValue, type GenerateOptions, type GenerateResult, type HistoryEntry, type ImproveBudget, type ImproveConfig, type ImproveResult, type ImproveRoundInput, type Improvement, type Judge, type JudgeArgs, type JudgeLlmConfig, type JudgeWithFn, type LearnConfig, type LearnInput, type LearnResult, type Lesson, type LoopConfig, type LoopGuardResult, type LoopResult, type Message, type ModelCallConfig, type ModelCallInput, type NativeProviderAdapter, type ParsedTrajectoryEvent, type PerCaseDelta, type PrepareStepContext, type PrepareStepHook, type PrepareStepResult, type Pricing, type PricingTable, type ProviderAdapter, type ProviderCapability, type ProviderConfigMap, type ProviderFactory, type ProviderInit, type ProviderTransport, type RawProviderUsage, type RegressionCompareOptions, type RegressionDelta, type RegressionReport, type ResolvedModel, type RetryFailureKind, type RetryPolicy, type RunContext, STEP_KINDS, type Score, type ScoredCandidate, type SpanEndEvent, type SpanStartEvent, type StartViewerOptions, type Step, type StepKind, type StepMetadata, type StepRecord, type StreamChunk, type Tool, type ToolApprovalHandler, type ToolApprovalRequest, type ToolCallRecord, type ToolExecContext, type TournamentConfig, type TournamentResult, type TrajectoryEvent, type TrajectoryLogger, type TrajectorySource, type TurnRequest, type TurnResult, type UsageTotals, type UserContentPart, type ViewerHandle, aborted_error, adversarial, bench, branch, checkpoint, claude_cli_error, compose, consensus, create_engine, custom_event_schema, default_normalize_usage, describe, describe_cycle_error, emit_event_schema, engine_config_error, engine_disposed_error, ensemble, ensemble_step, fallback, __json_default_export as flow_schema, forward_standard_env, improve, is_step_kind, judge_equals, judge_llm, judge_with, learn, loop, map, model_call, model_required_error, normalize_score, on_chunk_error, parallel, pipe, provider_auth_error, provider_capability_error, provider_error, provider_not_configured_error, rate_limit_error, read_baseline, regression_compare, resume_validation_error, retry, run, run_viewer_cli, schema_validation_error, scope, sequence, span_end_event_schema, span_start_event_schema, start_viewer, stash, step, suspend, suspended_error, timeout, timeout_error, tool_approval_denied_error, tool_error, tournament, trajectory_event_schema, use, write_baseline };
|
|
352
352
|
//# sourceMappingURL=index.d.ts.map
|