@opencode-ai/ai 0.0.0-dev-17675 → 0.0.0-dev-17684

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 (58) hide show
  1. package/README.md +16 -4
  2. package/dist/cache-policy.js +3 -5
  3. package/dist/protocols/anthropic-messages.d.ts +25 -28
  4. package/dist/protocols/anthropic-messages.js +3 -3
  5. package/dist/protocols/gemini.d.ts +5 -9
  6. package/dist/protocols/gemini.js +2 -3
  7. package/dist/protocols/open-responses.d.ts +33 -33
  8. package/dist/protocols/open-responses.js +1 -1
  9. package/dist/protocols/openai-chat.d.ts +15 -15
  10. package/dist/protocols/openai-compatible-chat.d.ts +3 -3
  11. package/dist/protocols/openai-compatible-responses.d.ts +4 -4
  12. package/dist/protocols/openai-responses.d.ts +28 -28
  13. package/dist/protocols/openai-responses.js +1 -1
  14. package/dist/protocols/shared.d.ts +8 -14
  15. package/dist/protocols/shared.js +8 -14
  16. package/dist/protocols/utils/bedrock-cache.js +3 -4
  17. package/dist/protocols/utils/cache.js +3 -6
  18. package/dist/protocols/utils/open-responses-options.d.ts +10 -5
  19. package/dist/protocols/utils/open-responses-options.js +5 -3
  20. package/dist/protocols/utils/openai-options.d.ts +6 -4
  21. package/dist/protocols/utils/openai-options.js +3 -3
  22. package/dist/providers/amazon-bedrock-mantle.d.ts +18 -18
  23. package/dist/providers/amazon-bedrock.d.ts +3 -9
  24. package/dist/providers/anthropic-compatible.d.ts +11 -11
  25. package/dist/providers/anthropic.d.ts +12 -12
  26. package/dist/providers/azure.d.ts +15 -15
  27. package/dist/providers/cloudflare.d.ts +11 -11
  28. package/dist/providers/google-vertex-chat.d.ts +5 -5
  29. package/dist/providers/google-vertex-messages.d.ts +11 -11
  30. package/dist/providers/google-vertex-responses.d.ts +6 -6
  31. package/dist/providers/google-vertex-responses.js +1 -1
  32. package/dist/providers/google-vertex.d.ts +5 -7
  33. package/dist/providers/google-vertex.js +1 -1
  34. package/dist/providers/google.d.ts +4 -4
  35. package/dist/providers/open-responses-options.d.ts +1 -4
  36. package/dist/providers/openai-compatible-responses.d.ts +6 -6
  37. package/dist/providers/openai-compatible.d.ts +12 -12
  38. package/dist/providers/openai-options.d.ts +2 -4
  39. package/dist/providers/openai-options.js +3 -3
  40. package/dist/providers/openai.d.ts +19 -19
  41. package/dist/providers/openrouter.d.ts +15 -17
  42. package/dist/providers/openrouter.js +1 -1
  43. package/dist/providers/xai.d.ts +21 -23
  44. package/dist/providers/xai.js +1 -1
  45. package/dist/route/client.d.ts +1 -3
  46. package/dist/route/framing.d.ts +2 -2
  47. package/dist/route/protocol.d.ts +1 -2
  48. package/dist/route/protocol.js +1 -2
  49. package/dist/schema/errors.js +2 -1
  50. package/dist/schema/events.d.ts +5 -3
  51. package/dist/schema/events.js +5 -2
  52. package/dist/schema/ids.d.ts +0 -13
  53. package/dist/schema/ids.js +0 -9
  54. package/dist/schema/messages.d.ts +7 -7
  55. package/dist/schema/messages.js +5 -2
  56. package/dist/schema/options.d.ts +6 -8
  57. package/dist/schema/options.js +6 -18
  58. package/package.json +3 -3
package/README.md CHANGED
@@ -237,11 +237,11 @@ Prompt caching is **on by default**. Every `LLMRequest` resolves to `cache: "aut
237
237
 
238
238
  ### Auto placement
239
239
 
240
- `"auto"` places up to four breakpoints — the last tool definition, the first system part, the last system part when distinct, and the final message boundary. These expose successively larger reusable prefixes for tools, the base agent, project instructions, and the active conversation. The rolling final-message boundary is the load-bearing detail in tool loops: it advances on every request so the previous cache entry stays within Anthropic's 20-block lookback.
240
+ `"auto"` places up to four breakpoints — the last tool definition, the first system part, the last system part when distinct, and the final message boundary. These expose successively larger reusable prefixes for tools, the base agent, project instructions, and the active conversation. The rolling final-message boundary advances on every request so recent conversation prefixes remain reusable during tool loops.
241
241
 
242
242
  Tools precede every system and conversation block in the provider prefix, so tool definitions must remain byte-stable and deterministically ordered for downstream breakpoints to remain reusable.
243
243
 
244
- The math justifies the default: Anthropic's 5-minute cache write is 1.25× base, read is 0.1×, so a single reuse within 5 minutes already wins. One-shot completions below the per-model minimum-cacheable-token threshold silently no-op on the wire, so the worst case is harmless.
244
+ Requests below a provider's minimum cacheable size simply do not produce a reusable cache entry.
245
245
 
246
246
  ### Opting out
247
247
 
@@ -285,6 +285,7 @@ LLM.request({
285
285
  | ----------------------- | ------------------------------------------------------------------------- |
286
286
  | Anthropic Messages | emits up to 4 `cache_control` markers (4-breakpoint cap enforced) |
287
287
  | Bedrock Converse | emits up to 4 `cachePoint` blocks (4-breakpoint cap enforced) |
288
+ | OpenRouter | emits up to 4 `cache_control` markers |
288
289
  | OpenAI Chat / Responses | no-op (implicit caching above 1024 tokens) |
289
290
  | Gemini | no-op (implicit caching on 2.5+; explicit `CachedContent` is out-of-band) |
290
291
 
@@ -371,11 +372,23 @@ Request options in order of stability:
371
372
 
372
373
  1. **`generation`** — portable knobs (`maxTokens`, `temperature`, `topP`, `topK`, penalties, seed, stop).
373
374
  2. **`promptCacheKey`** — stable cache affinity lowered by every protocol that supports it.
374
- 3. **`providerOptions: { <provider>: {...} }`** — typed-at-the-facade provider-specific knobs (OpenAI `store`, Anthropic `thinking`, Gemini `thinkingConfig`, OpenRouter routing).
375
+ 3. **`providerOptions: { ... }`** — flat options inferred from the selected model (OpenAI `store`, Anthropic `thinking`, Gemini `thinkingConfig`, OpenRouter routing).
375
376
  4. **`http: { body, headers, query }`** — last-resort serializable overlays merged into the final HTTP request. Reach for this only when a stable typed path doesn't yet exist.
376
377
 
377
378
  Route/provider defaults are overridden by request-level values for each axis.
378
379
 
380
+ The selected model supplies the provider-specific option type, so per-request overrides stay flat while the canonical runtime request remains provider-neutral:
381
+
382
+ ```ts
383
+ LLM.request({
384
+ model,
385
+ prompt,
386
+ providerOptions: {
387
+ reasoningEffort: "low",
388
+ },
389
+ })
390
+ ```
391
+
379
392
  ## Routes
380
393
 
381
394
  Adding a new model or deployment is usually 5-15 lines using `Route.make({ protocol, endpoint, auth, framing, ... })`. The route owns endpoint/auth/framing and the protocol owns body construction plus stream parsing. Transports are reusable IO templates that receive route endpoint/auth at compile time. Capability/catalog metadata lives outside this low-level package; unsupported request shapes fail during protocol lowering. See `AGENTS.md` for the architectural detail.
@@ -387,6 +400,5 @@ This package is built on Effect. Public methods return `Effect` or `Stream`; pro
387
400
  ## See also
388
401
 
389
402
  - `AGENTS.md` — architecture, route construction, contributor guide
390
- - `STATUS.md` — native provider parity status and AI SDK migration gaps
391
403
  - `example/tutorial.ts` — runnable end-to-end walkthrough
392
404
  - `test/provider/*.test.ts` — fixture-first protocol tests; `*.recorded.test.ts` files cover live cassettes
@@ -5,8 +5,8 @@
5
5
  // The default `"auto"` shape places breakpoints at the last tool definition,
6
6
  // the first and last distinct system parts, and the conversation tail. This
7
7
  // exposes reusable tool, base-agent, project, and session prefixes while
8
- // advancing the tail after each tool result keeps the previous cache entry
9
- // within Anthropic's 20-block lookback during long agent turns.
8
+ // advancing the tail after each tool result keeps recent conversation prefixes
9
+ // reusable during long agent runs.
10
10
  //
11
11
  // Manual `cache: CacheHint` placements on individual parts are preserved and
12
12
  // count against the four-breakpoint budget; auto only fills remaining slots.
@@ -20,9 +20,7 @@ const AUTO = {
20
20
  const NONE = {};
21
21
  const BREAKPOINT_CAP = 4;
22
22
  // Resolution rules:
23
- // - undefined → "auto" — caching is on by default. The math favors it:
24
- // Anthropic 5m-cache write is 1.25x base, read is 0.1x,
25
- // so a single reuse within 5 minutes already wins.
23
+ // - undefined → "auto" — caching is on by default.
26
24
  // - "auto" → tools + first/last system + final message boundary.
27
25
  // - "none" → no auto placement; manual `CacheHint`s still flow.
28
26
  // - object form → exactly what the caller asked for.
@@ -1,7 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { Route } from "../route/client.js";
3
3
  import { Protocol } from "../route/protocol.js";
4
- import { type ProviderOptions } from "../schema/index.js";
5
4
  import { Lifecycle } from "./utils/lifecycle.js";
6
5
  import { ToolStream } from "./utils/tool-stream.js";
7
6
  export declare const DEFAULT_BASE_URL = "https://api.anthropic.com/v1";
@@ -25,9 +24,7 @@ export interface OptionsInput {
25
24
  readonly thinking?: ThinkingInput;
26
25
  readonly effort?: string;
27
26
  }
28
- export type ProviderOptionsInput = ProviderOptions & {
29
- readonly anthropic?: OptionsInput;
30
- };
27
+ export type ProviderOptionsInput = OptionsInput;
31
28
  export declare const AnthropicMessagesBody: Schema.Struct<{
32
29
  model: Schema.String;
33
30
  system: Schema.optional<Schema.$Array<Schema.Struct<{
@@ -207,8 +204,8 @@ export declare const AnthropicMessagesBody: Schema.Struct<{
207
204
  export type AnthropicMessagesBody = Schema.Schema.Type<typeof AnthropicMessagesBody>;
208
205
  /**
209
206
  * The Anthropic Messages protocol — request body construction, body schema,
210
- * and the streaming-event state machine. Used by native Anthropic Cloud and
211
- * (once registered) Vertex Anthropic / Bedrock-hosted Anthropic passthrough.
207
+ * and the streaming-event state machine shared by Anthropic-compatible and
208
+ * Vertex-hosted Messages routes.
212
209
  */
213
210
  export declare const protocol: Protocol<{
214
211
  readonly max_tokens: number;
@@ -346,14 +343,6 @@ export declare const protocol: Protocol<{
346
343
  }[];
347
344
  })[];
348
345
  readonly stream: true;
349
- readonly system?: readonly {
350
- readonly type: "text";
351
- readonly text: string;
352
- readonly cache_control?: {
353
- readonly type: "ephemeral";
354
- readonly ttl?: "1h" | "5m" | undefined;
355
- } | undefined;
356
- }[] | undefined;
357
346
  readonly tools?: readonly {
358
347
  readonly description: string;
359
348
  readonly name: string;
@@ -365,6 +354,14 @@ export declare const protocol: Protocol<{
365
354
  readonly ttl?: "1h" | "5m" | undefined;
366
355
  } | undefined;
367
356
  }[] | undefined;
357
+ readonly system?: readonly {
358
+ readonly type: "text";
359
+ readonly text: string;
360
+ readonly cache_control?: {
361
+ readonly type: "ephemeral";
362
+ readonly ttl?: "1h" | "5m" | undefined;
363
+ } | undefined;
364
+ }[] | undefined;
368
365
  readonly temperature?: number | undefined;
369
366
  readonly thinking?: {
370
367
  readonly type: "enabled";
@@ -376,7 +373,7 @@ export declare const protocol: Protocol<{
376
373
  readonly type: "disabled";
377
374
  } | undefined;
378
375
  readonly tool_choice?: {
379
- readonly type: "none" | "auto" | "any";
376
+ readonly type: "auto" | "none" | "any";
380
377
  } | {
381
378
  readonly type: "tool";
382
379
  readonly name: string;
@@ -389,10 +386,6 @@ export declare const protocol: Protocol<{
389
386
  } | undefined;
390
387
  }, string, {
391
388
  readonly type: string;
392
- readonly error?: {
393
- readonly type?: string | undefined;
394
- readonly message?: string | undefined;
395
- } | undefined;
396
389
  readonly message?: {
397
390
  readonly usage?: {
398
391
  readonly [x: string]: unknown;
@@ -410,6 +403,10 @@ export declare const protocol: Protocol<{
410
403
  } | null | undefined;
411
404
  } | undefined;
412
405
  } | undefined;
406
+ readonly error?: {
407
+ readonly type?: string | undefined;
408
+ readonly message?: string | undefined;
409
+ } | undefined;
413
410
  readonly delta?: {
414
411
  readonly type?: string | undefined;
415
412
  readonly text?: string | undefined;
@@ -588,14 +585,6 @@ export declare const route: Route<{
588
585
  }[];
589
586
  })[];
590
587
  readonly stream: true;
591
- readonly system?: readonly {
592
- readonly type: "text";
593
- readonly text: string;
594
- readonly cache_control?: {
595
- readonly type: "ephemeral";
596
- readonly ttl?: "1h" | "5m" | undefined;
597
- } | undefined;
598
- }[] | undefined;
599
588
  readonly tools?: readonly {
600
589
  readonly description: string;
601
590
  readonly name: string;
@@ -607,6 +596,14 @@ export declare const route: Route<{
607
596
  readonly ttl?: "1h" | "5m" | undefined;
608
597
  } | undefined;
609
598
  }[] | undefined;
599
+ readonly system?: readonly {
600
+ readonly type: "text";
601
+ readonly text: string;
602
+ readonly cache_control?: {
603
+ readonly type: "ephemeral";
604
+ readonly ttl?: "1h" | "5m" | undefined;
605
+ } | undefined;
606
+ }[] | undefined;
610
607
  readonly temperature?: number | undefined;
611
608
  readonly thinking?: {
612
609
  readonly type: "enabled";
@@ -618,7 +615,7 @@ export declare const route: Route<{
618
615
  readonly type: "disabled";
619
616
  } | undefined;
620
617
  readonly tool_choice?: {
621
- readonly type: "none" | "auto" | "any";
618
+ readonly type: "auto" | "none" | "any";
622
619
  } | {
623
620
  readonly type: "tool";
624
621
  readonly name: string;
@@ -468,7 +468,7 @@ const lowerMessages = Effect.fn("AnthropicMessages.lowerMessages")(function* (re
468
468
  return messages;
469
469
  });
470
470
  const resolveOptions = Effect.fn("AnthropicMessages.resolveOptions")(function* (request) {
471
- const input = request.providerOptions?.anthropic;
471
+ const input = request.providerOptions;
472
472
  return {
473
473
  thinking: yield* resolveThinking(input?.thinking),
474
474
  effort: typeof input?.effort === "string" ? input.effort : undefined,
@@ -844,8 +844,8 @@ const step = (state, event) => {
844
844
  // =============================================================================
845
845
  /**
846
846
  * The Anthropic Messages protocol — request body construction, body schema,
847
- * and the streaming-event state machine. Used by native Anthropic Cloud and
848
- * (once registered) Vertex Anthropic / Bedrock-hosted Anthropic passthrough.
847
+ * and the streaming-event state machine shared by Anthropic-compatible and
848
+ * Vertex-hosted Messages routes.
849
849
  */
850
850
  export const protocol = Protocol.make({
851
851
  id: ADAPTER,
@@ -1,7 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  import { Route } from "../route/client.js";
3
3
  import { Protocol } from "../route/protocol.js";
4
- import { type ProviderOptions } from "../schema/index.js";
5
4
  import { Lifecycle } from "./utils/lifecycle.js";
6
5
  export declare const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
7
6
  export interface OptionsInput {
@@ -18,9 +17,7 @@ export interface OptionsInput {
18
17
  readonly thinkingLevel?: "minimal" | "low" | "medium" | "high" | (string & {});
19
18
  };
20
19
  }
21
- export type ProviderOptionsInput = ProviderOptions & {
22
- readonly gemini?: OptionsInput;
23
- };
20
+ export type ProviderOptionsInput = OptionsInput;
24
21
  declare const GeminiBody: Schema.Struct<{
25
22
  cachedContent: Schema.optional<Schema.String>;
26
23
  contents: Schema.$Array<Schema.Struct<{
@@ -98,12 +95,11 @@ declare const GeminiBody: Schema.Struct<{
98
95
  export type GeminiBody = Schema.Schema.Type<typeof GeminiBody>;
99
96
  /**
100
97
  * The Gemini protocol — request body construction, body schema, and the
101
- * streaming-event state machine. Used by Google AI Studio Gemini and (once
102
- * registered) Vertex Gemini.
98
+ * streaming-event state machine shared by Google AI Studio and Vertex Gemini.
103
99
  */
104
100
  export declare const protocol: Protocol<{
105
101
  readonly contents: readonly {
106
- readonly role: "user" | "model";
102
+ readonly role: "model" | "user";
107
103
  readonly parts: readonly ({
108
104
  readonly inlineData: {
109
105
  readonly mimeType: string;
@@ -181,7 +177,7 @@ export declare const protocol: Protocol<{
181
177
  }, string, {
182
178
  readonly candidates?: readonly {
183
179
  readonly content?: {
184
- readonly role: "user" | "model";
180
+ readonly role: "model" | "user";
185
181
  readonly parts: readonly ({
186
182
  readonly inlineData: {
187
183
  readonly mimeType: string;
@@ -234,7 +230,7 @@ export declare const protocol: Protocol<{
234
230
  }>;
235
231
  export declare const route: Route<{
236
232
  readonly contents: readonly {
237
- readonly role: "user" | "model";
233
+ readonly role: "model" | "user";
238
234
  readonly parts: readonly ({
239
235
  readonly inlineData: {
240
236
  readonly mimeType: string;
@@ -293,7 +293,7 @@ const lowerMessages = Effect.fn("Gemini.lowerMessages")(function* (request) {
293
293
  return contents;
294
294
  });
295
295
  const resolveOptions = (request) => {
296
- const input = request.providerOptions?.gemini;
296
+ const input = request.providerOptions;
297
297
  const value = input?.thinkingConfig;
298
298
  const thinkingConfig = {
299
299
  thinkingBudget: ProviderShared.isRecord(value) && typeof value.thinkingBudget === "number" ? value.thinkingBudget : undefined,
@@ -491,8 +491,7 @@ const step = (state, event) => {
491
491
  // =============================================================================
492
492
  /**
493
493
  * The Gemini protocol — request body construction, body schema, and the
494
- * streaming-event state machine. Used by Google AI Studio Gemini and (once
495
- * registered) Vertex Gemini.
494
+ * streaming-event state machine shared by Google AI Studio and Vertex Gemini.
496
495
  */
497
496
  export const protocol = Protocol.make({
498
497
  id: ADAPTER,
@@ -191,11 +191,11 @@ export declare const coreFields: {
191
191
  prompt_cache_key: Schema.optional<Schema.String>;
192
192
  include: Schema.optional<Schema.$Array<Schema.declare<OpenResponsesOptions.ResponseIncludable, OpenResponsesOptions.ResponseIncludable>>>;
193
193
  reasoning: Schema.optional<Schema.Struct<{
194
- readonly effort: Schema.optional<Schema.String>;
194
+ readonly effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
195
195
  readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
196
196
  }>>;
197
197
  text: Schema.optional<Schema.Struct<{
198
- readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
198
+ readonly verbosity: Schema.optional<Schema.declare<OpenResponsesOptions.TextVerbosity, OpenResponsesOptions.TextVerbosity>>;
199
199
  }>>;
200
200
  max_output_tokens: Schema.optional<Schema.Number>;
201
201
  max_tool_calls: Schema.optional<Schema.Int>;
@@ -290,11 +290,11 @@ declare const OpenResponsesBody: Schema.Struct<{
290
290
  readonly prompt_cache_key: Schema.optional<Schema.String>;
291
291
  readonly include: Schema.optional<Schema.$Array<Schema.declare<OpenResponsesOptions.ResponseIncludable, OpenResponsesOptions.ResponseIncludable>>>;
292
292
  readonly reasoning: Schema.optional<Schema.Struct<{
293
- readonly effort: Schema.optional<Schema.String>;
293
+ readonly effort: Schema.optional<Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>>;
294
294
  readonly summary: Schema.optional<Schema.Literals<readonly ["auto", "concise", "detailed"]>>;
295
295
  }>>;
296
296
  readonly text: Schema.optional<Schema.Struct<{
297
- readonly verbosity: Schema.optional<Schema.Literals<readonly ["low", "medium", "high"]>>;
297
+ readonly verbosity: Schema.optional<Schema.declare<OpenResponsesOptions.TextVerbosity, OpenResponsesOptions.TextVerbosity>>;
298
298
  }>>;
299
299
  readonly max_output_tokens: Schema.optional<Schema.Number>;
300
300
  readonly max_tool_calls: Schema.optional<Schema.Int>;
@@ -330,18 +330,18 @@ export declare const WebSocketErrorEvent: Schema.StructWithRest<Schema.Struct<{
330
330
  export declare const decodeKnownErrorEvent: (event: Event) => Effect.Effect<{
331
331
  readonly [x: string]: unknown;
332
332
  readonly type: "error";
333
- readonly error?: {
334
- readonly type?: string | null | undefined;
335
- readonly code?: string | null | undefined;
336
- readonly message?: string | null | undefined;
337
- readonly param?: string | null | undefined;
338
- } | null | undefined;
339
333
  readonly status?: number | undefined;
340
334
  readonly code?: string | null | undefined;
341
335
  readonly message?: string | undefined;
342
336
  readonly headers?: {
343
337
  readonly [x: string]: string | number | boolean;
344
338
  } | undefined;
339
+ readonly error?: {
340
+ readonly type?: string | null | undefined;
341
+ readonly code?: string | null | undefined;
342
+ readonly message?: string | null | undefined;
343
+ readonly param?: string | null | undefined;
344
+ } | null | undefined;
345
345
  readonly param?: string | null | undefined;
346
346
  readonly status_code?: number | undefined;
347
347
  }, Schema.SchemaError, never>;
@@ -437,7 +437,7 @@ export declare const lowerTool: (protocolName: string, tool: ToolDefinition, inp
437
437
  };
438
438
  strict: boolean;
439
439
  }, AIError, never>;
440
- export declare const lowerToolChoice: (protocolName: string, toolChoice: NonNullable<LLMRequest["toolChoice"]>) => Effect.Effect<"required" | "none" | "auto" | {
440
+ export declare const lowerToolChoice: (protocolName: string, toolChoice: NonNullable<LLMRequest["toolChoice"]>) => Effect.Effect<"required" | "auto" | "none" | {
441
441
  type: "function";
442
442
  name: string;
443
443
  }, AIError, never>;
@@ -447,10 +447,10 @@ export declare const fromRequestWithExtension: (request: LLMRequest, extension:
447
447
  max_tool_calls?: number | undefined;
448
448
  service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
449
449
  text?: {
450
- verbosity: "low" | "medium" | "high";
450
+ verbosity: OpenResponsesOptions.TextVerbosity;
451
451
  } | undefined;
452
452
  reasoning?: {
453
- effort: string | undefined;
453
+ effort: OpenResponsesOptions.ReasoningEffort | undefined;
454
454
  summary: "auto" | "concise" | "detailed" | undefined;
455
455
  } | undefined;
456
456
  include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
@@ -468,9 +468,9 @@ export declare const fromRequestWithExtension: (request: LLMRequest, extension:
468
468
  };
469
469
  strict: boolean;
470
470
  }[] | undefined;
471
- tool_choice: "required" | "none" | "auto" | {
471
+ tool_choice: "required" | "auto" | "none" | {
472
472
  type: "allowed_tools";
473
- mode: "required" | "none" | "auto";
473
+ mode: "required" | "auto" | "none";
474
474
  tools: {
475
475
  type: "function";
476
476
  name: string;
@@ -549,7 +549,7 @@ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
549
549
  readonly instructions?: string | undefined;
550
550
  readonly reasoning?: {
551
551
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
552
- readonly effort?: string | undefined;
552
+ readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
553
553
  } | undefined;
554
554
  readonly tools?: readonly {
555
555
  readonly type: "function";
@@ -561,15 +561,15 @@ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
561
561
  readonly strict?: boolean | undefined;
562
562
  }[] | undefined;
563
563
  readonly text?: {
564
- readonly verbosity?: "low" | "medium" | "high" | undefined;
564
+ readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
565
565
  } | undefined;
566
566
  readonly temperature?: number | undefined;
567
- readonly tool_choice?: "required" | "none" | "auto" | {
567
+ readonly tool_choice?: "required" | "auto" | "none" | {
568
568
  readonly type: "function";
569
569
  readonly name: string;
570
570
  } | {
571
571
  readonly type: "allowed_tools";
572
- readonly mode: "required" | "none" | "auto";
572
+ readonly mode: "required" | "auto" | "none";
573
573
  readonly tools: readonly {
574
574
  readonly type: "function";
575
575
  readonly name: string;
@@ -843,7 +843,7 @@ export declare const protocol: Protocol<{
843
843
  readonly instructions?: string | undefined;
844
844
  readonly reasoning?: {
845
845
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
846
- readonly effort?: string | undefined;
846
+ readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
847
847
  } | undefined;
848
848
  readonly tools?: readonly {
849
849
  readonly type: "function";
@@ -855,15 +855,15 @@ export declare const protocol: Protocol<{
855
855
  readonly strict?: boolean | undefined;
856
856
  }[] | undefined;
857
857
  readonly text?: {
858
- readonly verbosity?: "low" | "medium" | "high" | undefined;
858
+ readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
859
859
  } | undefined;
860
860
  readonly temperature?: number | undefined;
861
- readonly tool_choice?: "required" | "none" | "auto" | {
861
+ readonly tool_choice?: "required" | "auto" | "none" | {
862
862
  readonly type: "function";
863
863
  readonly name: string;
864
864
  } | {
865
865
  readonly type: "allowed_tools";
866
- readonly mode: "required" | "none" | "auto";
866
+ readonly mode: "required" | "auto" | "none";
867
867
  readonly tools: readonly {
868
868
  readonly type: "function";
869
869
  readonly name: string;
@@ -881,17 +881,17 @@ export declare const protocol: Protocol<{
881
881
  }, string, {
882
882
  readonly [x: string]: unknown;
883
883
  readonly type: string;
884
+ readonly status?: unknown;
885
+ readonly code?: string | null | undefined;
886
+ readonly message?: string | undefined;
887
+ readonly headers?: unknown;
888
+ readonly text?: string | undefined;
884
889
  readonly error?: {
885
890
  readonly type?: string | null | undefined;
886
891
  readonly code?: string | null | undefined;
887
892
  readonly message?: string | null | undefined;
888
893
  readonly param?: string | null | undefined;
889
894
  } | null | undefined;
890
- readonly status?: unknown;
891
- readonly code?: string | null | undefined;
892
- readonly message?: string | undefined;
893
- readonly headers?: unknown;
894
- readonly text?: string | undefined;
895
895
  readonly item?: {
896
896
  readonly [x: string]: unknown;
897
897
  readonly type: string;
@@ -904,13 +904,13 @@ export declare const protocol: Protocol<{
904
904
  readonly delta?: string | undefined;
905
905
  readonly response?: {
906
906
  readonly [x: string]: unknown;
907
+ readonly id?: string | undefined;
907
908
  readonly error?: {
908
909
  readonly type?: string | null | undefined;
909
910
  readonly code?: string | null | undefined;
910
911
  readonly message?: string | null | undefined;
911
912
  readonly param?: string | null | undefined;
912
913
  } | null | undefined;
913
- readonly id?: string | undefined;
914
914
  readonly usage?: {
915
915
  readonly input_tokens?: number | undefined;
916
916
  readonly output_tokens?: number | undefined;
@@ -998,7 +998,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
998
998
  readonly instructions?: string | undefined;
999
999
  readonly reasoning?: {
1000
1000
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
1001
- readonly effort?: string | undefined;
1001
+ readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
1002
1002
  } | undefined;
1003
1003
  readonly tools?: readonly {
1004
1004
  readonly type: "function";
@@ -1010,15 +1010,15 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1010
1010
  readonly strict?: boolean | undefined;
1011
1011
  }[] | undefined;
1012
1012
  readonly text?: {
1013
- readonly verbosity?: "low" | "medium" | "high" | undefined;
1013
+ readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
1014
1014
  } | undefined;
1015
1015
  readonly temperature?: number | undefined;
1016
- readonly tool_choice?: "required" | "none" | "auto" | {
1016
+ readonly tool_choice?: "required" | "auto" | "none" | {
1017
1017
  readonly type: "function";
1018
1018
  readonly name: string;
1019
1019
  } | {
1020
1020
  readonly type: "allowed_tools";
1021
- readonly mode: "required" | "none" | "auto";
1021
+ readonly mode: "required" | "auto" | "none";
1022
1022
  readonly tools: readonly {
1023
1023
  readonly type: "function";
1024
1024
  readonly name: string;
@@ -214,7 +214,7 @@ export const lowerTool = Effect.fn("OpenResponses.lowerTool")(function* (protoco
214
214
  name: tool.name,
215
215
  description: tool.description,
216
216
  parameters: ToolSchemaProjection.responses(inputSchema),
217
- // TODO: Read this from Responses tool options so direct LLM callers can opt into strict schemas.
217
+ // The common tool definition does not currently express Responses strict-schema policy.
218
218
  strict: false,
219
219
  };
220
220
  });
@@ -95,7 +95,7 @@ export declare const bodyFields: {
95
95
  }>>;
96
96
  store: Schema.optional<Schema.Boolean>;
97
97
  prompt_cache_key: Schema.optional<Schema.String>;
98
- reasoning_effort: Schema.optional<Schema.String>;
98
+ reasoning_effort: Schema.optional<Schema.declare<import("./utils/open-responses-options.js").ReasoningEffort, import("./utils/open-responses-options.js").ReasoningEffort>>;
99
99
  max_completion_tokens: Schema.optional<Schema.Number>;
100
100
  max_tokens: Schema.optional<Schema.Number>;
101
101
  temperature: Schema.optional<Schema.Number>;
@@ -189,7 +189,7 @@ declare const OpenAIChatBody: Schema.Struct<{
189
189
  }>>;
190
190
  store: Schema.optional<Schema.Boolean>;
191
191
  prompt_cache_key: Schema.optional<Schema.String>;
192
- reasoning_effort: Schema.optional<Schema.String>;
192
+ reasoning_effort: Schema.optional<Schema.declare<import("./utils/open-responses-options.js").ReasoningEffort, import("./utils/open-responses-options.js").ReasoningEffort>>;
193
193
  max_completion_tokens: Schema.optional<Schema.Number>;
194
194
  max_tokens: Schema.optional<Schema.Number>;
195
195
  temperature: Schema.optional<Schema.Number>;
@@ -263,7 +263,7 @@ interface LoweringOptions {
263
263
  readonly cacheControl?: (cache: CacheHint | undefined) => Schema.Schema.Type<typeof OpenAIChatCacheControl> | undefined;
264
264
  }
265
265
  export declare const fromRequest: (request: LLMRequest, options?: LoweringOptions | undefined) => Effect.Effect<{
266
- reasoning_effort?: string | undefined;
266
+ reasoning_effort?: import("./utils/open-responses-options.js").ReasoningEffort | undefined;
267
267
  prompt_cache_key?: string | undefined;
268
268
  store?: boolean | undefined;
269
269
  temperature: number | undefined;
@@ -347,7 +347,7 @@ export declare const fromRequest: (request: LLMRequest, options?: LoweringOption
347
347
  readonly ttl?: string | undefined;
348
348
  } | undefined;
349
349
  }[] | undefined;
350
- tool_choice: "required" | "none" | "auto" | {
350
+ tool_choice: "required" | "auto" | "none" | {
351
351
  type: "function";
352
352
  function: {
353
353
  name: string;
@@ -358,7 +358,7 @@ export declare const fromRequest: (request: LLMRequest, options?: LoweringOption
358
358
  include_usage: boolean;
359
359
  };
360
360
  } | {
361
- reasoning_effort?: string | undefined;
361
+ reasoning_effort?: import("./utils/open-responses-options.js").ReasoningEffort | undefined;
362
362
  prompt_cache_key?: string | undefined;
363
363
  store?: boolean | undefined;
364
364
  temperature: number | undefined;
@@ -442,7 +442,7 @@ export declare const fromRequest: (request: LLMRequest, options?: LoweringOption
442
442
  readonly ttl?: string | undefined;
443
443
  } | undefined;
444
444
  }[] | undefined;
445
- tool_choice: "required" | "none" | "auto" | {
445
+ tool_choice: "required" | "auto" | "none" | {
446
446
  type: "function";
447
447
  function: {
448
448
  name: string;
@@ -521,7 +521,6 @@ export declare const protocol: Protocol<{
521
521
  } | undefined;
522
522
  })[];
523
523
  readonly stream: true;
524
- readonly stop?: readonly string[] | undefined;
525
524
  readonly max_completion_tokens?: number | undefined;
526
525
  readonly max_tokens?: number | undefined;
527
526
  readonly tools?: readonly {
@@ -538,9 +537,10 @@ export declare const protocol: Protocol<{
538
537
  readonly ttl?: string | undefined;
539
538
  } | undefined;
540
539
  }[] | undefined;
540
+ readonly stop?: readonly string[] | undefined;
541
541
  readonly temperature?: number | undefined;
542
542
  readonly seed?: number | undefined;
543
- readonly tool_choice?: "required" | "none" | "auto" | {
543
+ readonly tool_choice?: "required" | "auto" | "none" | {
544
544
  readonly type: "function";
545
545
  readonly function: {
546
546
  readonly name: string;
@@ -552,7 +552,7 @@ export declare const protocol: Protocol<{
552
552
  readonly include_usage: boolean;
553
553
  } | undefined;
554
554
  readonly prompt_cache_key?: string | undefined;
555
- readonly reasoning_effort?: string | undefined;
555
+ readonly reasoning_effort?: import("./utils/open-responses-options.js").ReasoningEffort | undefined;
556
556
  readonly frequency_penalty?: number | undefined;
557
557
  readonly presence_penalty?: number | undefined;
558
558
  }, string, {
@@ -660,7 +660,6 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
660
660
  } | undefined;
661
661
  })[];
662
662
  readonly stream: true;
663
- readonly stop?: readonly string[] | undefined;
664
663
  readonly max_completion_tokens?: number | undefined;
665
664
  readonly max_tokens?: number | undefined;
666
665
  readonly tools?: readonly {
@@ -677,9 +676,10 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
677
676
  readonly ttl?: string | undefined;
678
677
  } | undefined;
679
678
  }[] | undefined;
679
+ readonly stop?: readonly string[] | undefined;
680
680
  readonly temperature?: number | undefined;
681
681
  readonly seed?: number | undefined;
682
- readonly tool_choice?: "required" | "none" | "auto" | {
682
+ readonly tool_choice?: "required" | "auto" | "none" | {
683
683
  readonly type: "function";
684
684
  readonly function: {
685
685
  readonly name: string;
@@ -691,7 +691,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
691
691
  readonly include_usage: boolean;
692
692
  } | undefined;
693
693
  readonly prompt_cache_key?: string | undefined;
694
- readonly reasoning_effort?: string | undefined;
694
+ readonly reasoning_effort?: import("./utils/open-responses-options.js").ReasoningEffort | undefined;
695
695
  readonly frequency_penalty?: number | undefined;
696
696
  readonly presence_penalty?: number | undefined;
697
697
  }, string>;
@@ -757,7 +757,6 @@ export declare const route: Route<{
757
757
  } | undefined;
758
758
  })[];
759
759
  readonly stream: true;
760
- readonly stop?: readonly string[] | undefined;
761
760
  readonly max_completion_tokens?: number | undefined;
762
761
  readonly max_tokens?: number | undefined;
763
762
  readonly tools?: readonly {
@@ -774,9 +773,10 @@ export declare const route: Route<{
774
773
  readonly ttl?: string | undefined;
775
774
  } | undefined;
776
775
  }[] | undefined;
776
+ readonly stop?: readonly string[] | undefined;
777
777
  readonly temperature?: number | undefined;
778
778
  readonly seed?: number | undefined;
779
- readonly tool_choice?: "required" | "none" | "auto" | {
779
+ readonly tool_choice?: "required" | "auto" | "none" | {
780
780
  readonly type: "function";
781
781
  readonly function: {
782
782
  readonly name: string;
@@ -788,7 +788,7 @@ export declare const route: Route<{
788
788
  readonly include_usage: boolean;
789
789
  } | undefined;
790
790
  readonly prompt_cache_key?: string | undefined;
791
- readonly reasoning_effort?: string | undefined;
791
+ readonly reasoning_effort?: import("./utils/open-responses-options.js").ReasoningEffort | undefined;
792
792
  readonly frequency_penalty?: number | undefined;
793
793
  readonly presence_penalty?: number | undefined;
794
794
  }, HttpTransport.HttpPrepared<string>>;