@opencode/ai 2.0.21 → 2.0.23

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 (113) hide show
  1. package/README.md +61 -1
  2. package/dist/cache-policy.js +10 -2
  3. package/dist/llm.d.ts +4 -0
  4. package/dist/promise.d.ts +8 -0
  5. package/dist/protocols/alibaba-chat.d.ts +7 -3
  6. package/dist/protocols/alibaba-chat.js +2 -1
  7. package/dist/protocols/alibaba-responses.d.ts +16 -12
  8. package/dist/protocols/alibaba-responses.js +3 -5
  9. package/dist/protocols/anthropic-messages.js +58 -51
  10. package/dist/protocols/bedrock-converse.js +33 -4
  11. package/dist/protocols/cartesia-speech.js +3 -3
  12. package/dist/protocols/cohere-chat.d.ts +178 -0
  13. package/dist/protocols/cohere-chat.js +299 -0
  14. package/dist/protocols/elevenlabs-speech.js +3 -3
  15. package/dist/protocols/gemini.d.ts +2 -2
  16. package/dist/protocols/gemini.js +3 -3
  17. package/dist/protocols/google-interactions.d.ts +236 -0
  18. package/dist/protocols/google-interactions.js +478 -0
  19. package/dist/protocols/google-speech.js +1 -1
  20. package/dist/protocols/google-transcription.js +1 -1
  21. package/dist/protocols/index.d.ts +2 -0
  22. package/dist/protocols/index.js +2 -0
  23. package/dist/protocols/meta-responses.d.ts +31 -58
  24. package/dist/protocols/meta-responses.js +8 -27
  25. package/dist/protocols/mistral-chat.d.ts +24 -9
  26. package/dist/protocols/mistral-chat.js +22 -10
  27. package/dist/protocols/open-responses.d.ts +410 -91
  28. package/dist/protocols/open-responses.js +25 -15
  29. package/dist/protocols/openai-chat.d.ts +409 -5
  30. package/dist/protocols/openai-chat.js +27 -26
  31. package/dist/protocols/openai-compatible-chat.d.ts +1 -1
  32. package/dist/protocols/openai-compatible-responses.d.ts +16 -4
  33. package/dist/protocols/openai-images.js +2 -2
  34. package/dist/protocols/openai-responses.d.ts +87 -223
  35. package/dist/protocols/openai-responses.js +10 -16
  36. package/dist/protocols/openai-speech.js +1 -1
  37. package/dist/protocols/openai-transcription.js +1 -1
  38. package/dist/protocols/shared.js +2 -2
  39. package/dist/protocols/stability-images.js +1 -1
  40. package/dist/protocols/utils/bedrock-media.js +2 -2
  41. package/dist/protocols/utils/cache.d.ts +5 -0
  42. package/dist/protocols/utils/cache.js +9 -1
  43. package/dist/protocols/utils/responses-checkpoint.js +2 -2
  44. package/dist/protocols/utils/responses-hosted-tools.js +1 -1
  45. package/dist/protocols/utils/tool-stream.d.ts +12 -0
  46. package/dist/protocols/utils/tool-stream.js +15 -7
  47. package/dist/protocols/venice-chat.d.ts +280 -0
  48. package/dist/protocols/venice-chat.js +283 -0
  49. package/dist/protocols/xai-responses.d.ts +18 -21
  50. package/dist/protocols/xai-responses.js +2 -8
  51. package/dist/protocols/zai-chat.d.ts +7 -3
  52. package/dist/protocols/zai-chat.js +6 -3
  53. package/dist/provider-error.js +27 -7
  54. package/dist/providers/alibaba.d.ts +17 -13
  55. package/dist/providers/amazon-bedrock/mantle/messages.d.ts +2 -0
  56. package/dist/providers/amazon-bedrock/mantle/messages.js +1 -0
  57. package/dist/providers/amazon-bedrock-mantle.d.ts +301 -9
  58. package/dist/providers/amazon-bedrock-mantle.js +28 -3
  59. package/dist/providers/azure.d.ts +13 -61
  60. package/dist/providers/baseten.d.ts +2 -2
  61. package/dist/providers/cerebras.d.ts +2 -2
  62. package/dist/providers/cloudflare-ai-gateway.d.ts +14 -62
  63. package/dist/providers/cloudflare-workers-ai.d.ts +2 -2
  64. package/dist/providers/cohere/chat.d.ts +4 -0
  65. package/dist/providers/cohere/chat.js +8 -0
  66. package/dist/providers/cohere.d.ts +395 -0
  67. package/dist/providers/cohere.js +48 -0
  68. package/dist/providers/deepinfra.d.ts +2 -2
  69. package/dist/providers/deepseek.d.ts +2 -2
  70. package/dist/providers/digitalocean.d.ts +469 -0
  71. package/dist/providers/digitalocean.js +53 -0
  72. package/dist/providers/fireworks.d.ts +2 -2
  73. package/dist/providers/google/interactions.d.ts +7 -0
  74. package/dist/providers/google/interactions.js +8 -0
  75. package/dist/providers/google-vertex-chat.d.ts +1 -1
  76. package/dist/providers/google-vertex-messages.js +1 -1
  77. package/dist/providers/google-vertex-responses.d.ts +16 -4
  78. package/dist/providers/google-vertex.d.ts +1 -1
  79. package/dist/providers/google.d.ts +95 -4
  80. package/dist/providers/google.js +8 -1
  81. package/dist/providers/groq.d.ts +8 -4
  82. package/dist/providers/groq.js +1 -1
  83. package/dist/providers/index.d.ts +3 -0
  84. package/dist/providers/index.js +3 -0
  85. package/dist/providers/meta.d.ts +15 -28
  86. package/dist/providers/minimax.d.ts +17 -5
  87. package/dist/providers/mistral.d.ts +10 -4
  88. package/dist/providers/moonshot.d.ts +17 -5
  89. package/dist/providers/openai-compatible-responses.d.ts +16 -4
  90. package/dist/providers/openai-compatible.d.ts +1 -1
  91. package/dist/providers/openai-options.d.ts +1 -1
  92. package/dist/providers/openai.d.ts +7 -31
  93. package/dist/providers/openrouter.d.ts +9 -5
  94. package/dist/providers/openrouter.js +1 -13
  95. package/dist/providers/togetherai.d.ts +2 -2
  96. package/dist/providers/venice.d.ts +183 -0
  97. package/dist/providers/venice.js +38 -0
  98. package/dist/providers/xai.d.ts +1 -1
  99. package/dist/providers/zai-coding-plan.d.ts +17 -5
  100. package/dist/providers/zai.d.ts +1 -1
  101. package/dist/route/client.d.ts +4 -0
  102. package/dist/route/client.js +2 -5
  103. package/dist/route/executor.js +13 -6
  104. package/dist/route/framing.js +23 -23
  105. package/dist/route/transport/http.d.ts +2 -1
  106. package/dist/route/transport/http.js +28 -6
  107. package/dist/schema/events.d.ts +176 -0
  108. package/dist/schema/events.js +4 -0
  109. package/dist/schema/options.d.ts +11 -0
  110. package/dist/schema/options.js +15 -2
  111. package/dist/testing.d.ts +32 -0
  112. package/dist/tool-history.js +17 -3
  113. package/package.json +3 -3
@@ -95,11 +95,21 @@ export declare const ConfigurationUpdate: Schema.Struct<{
95
95
  readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
96
96
  }>;
97
97
  }>;
98
- type ConfigurationUpdate = Schema.Schema.Type<typeof ConfigurationUpdate>;
98
+ export type ConfigurationUpdate = Schema.Schema.Type<typeof ConfigurationUpdate>;
99
+ export declare const HostedToolReplay: Schema.StructWithRest<Schema.Struct<{
100
+ readonly type: Schema.String;
101
+ readonly id: Schema.String;
102
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
103
+ export type HostedToolReplayItem = Schema.Schema.Type<typeof HostedToolReplay>;
99
104
  export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
100
105
  readonly type: Schema.Literal<"compaction">;
101
106
  readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
102
107
  readonly encrypted_content: Schema.String;
108
+ }>, Schema.Struct<{
109
+ readonly type: Schema.Literal<"configuration_update">;
110
+ readonly reasoning: Schema.Struct<{
111
+ readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
112
+ }>;
103
113
  }>, Schema.Struct<{
104
114
  readonly type: Schema.tag<"message">;
105
115
  readonly role: Schema.tag<"system">;
@@ -199,23 +209,10 @@ export declare const InputItem: Schema.Union<readonly [Schema.Struct<{
199
209
  readonly arguments: Schema.optional<Schema.String>;
200
210
  readonly output: Schema.optional<Schema.NullOr<Schema.String>>;
201
211
  readonly error: Schema.optional<Schema.Unknown>;
202
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>]>;
203
- type OpenResponsesInputItem = Schema.Schema.Type<typeof InputItem>;
204
- export type HostedToolReplayItem = {
205
- readonly type: string;
206
- readonly id: string;
207
- readonly [key: string]: unknown;
208
- };
209
- type LoweredInputItem = OpenResponsesInputItem | HostedToolReplayItem | ConfigurationUpdate | {
210
- readonly type: "message";
211
- readonly id?: string;
212
- readonly role: "assistant";
213
- readonly content: ReadonlyArray<{
214
- readonly type: "output_text";
215
- readonly text: string;
216
- }>;
217
- readonly phase?: MessagePhase | null;
218
- };
212
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>, Schema.StructWithRest<Schema.Struct<{
213
+ readonly type: Schema.String;
214
+ readonly id: Schema.String;
215
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>;
219
216
  export declare const Tool: Schema.Struct<{
220
217
  readonly type: Schema.tag<"function">;
221
218
  readonly name: Schema.String;
@@ -223,6 +220,10 @@ export declare const Tool: Schema.Struct<{
223
220
  readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
224
221
  readonly strict: Schema.optional<Schema.Boolean>;
225
222
  }>;
223
+ export declare const HostedTool: Schema.StructWithRest<Schema.Struct<{
224
+ readonly type: Schema.String;
225
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
226
+ export type HostedTool = Schema.Schema.Type<typeof HostedTool>;
226
227
  export declare const ToolChoice: Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
227
228
  readonly type: Schema.tag<"function">;
228
229
  readonly name: Schema.String;
@@ -240,6 +241,11 @@ export declare const coreFields: {
240
241
  readonly type: Schema.Literal<"compaction">;
241
242
  readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
242
243
  readonly encrypted_content: Schema.String;
244
+ }>, Schema.Struct<{
245
+ readonly type: Schema.Literal<"configuration_update">;
246
+ readonly reasoning: Schema.Struct<{
247
+ readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
248
+ }>;
243
249
  }>, Schema.Struct<{
244
250
  readonly type: Schema.tag<"message">;
245
251
  readonly role: Schema.tag<"system">;
@@ -339,15 +345,20 @@ export declare const coreFields: {
339
345
  readonly arguments: Schema.optional<Schema.String>;
340
346
  readonly output: Schema.optional<Schema.NullOr<Schema.String>>;
341
347
  readonly error: Schema.optional<Schema.Unknown>;
342
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>]>>;
348
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>, Schema.StructWithRest<Schema.Struct<{
349
+ readonly type: Schema.String;
350
+ readonly id: Schema.String;
351
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
343
352
  instructions: Schema.optional<Schema.String>;
344
- tools: Schema.optional<Schema.$Array<Schema.Struct<{
353
+ tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
345
354
  readonly type: Schema.tag<"function">;
346
355
  readonly name: Schema.String;
347
356
  readonly description: Schema.String;
348
357
  readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
349
358
  readonly strict: Schema.optional<Schema.Boolean>;
350
- }>>>;
359
+ }>, Schema.StructWithRest<Schema.Struct<{
360
+ readonly type: Schema.String;
361
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>>;
351
362
  tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
352
363
  readonly type: Schema.tag<"function">;
353
364
  readonly name: Schema.String;
@@ -385,13 +396,18 @@ export declare const coreFields: {
385
396
  presence_penalty: Schema.optional<Schema.Number>;
386
397
  frequency_penalty: Schema.optional<Schema.Number>;
387
398
  };
388
- declare const OpenResponsesBody: Schema.Struct<{
399
+ export declare const OpenResponsesBody: Schema.Struct<{
389
400
  readonly stream: Schema.Literal<true>;
390
401
  readonly model: Schema.String;
391
402
  readonly input: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
392
403
  readonly type: Schema.Literal<"compaction">;
393
404
  readonly id: Schema.optional<Schema.NullOr<Schema.String>>;
394
405
  readonly encrypted_content: Schema.String;
406
+ }>, Schema.Struct<{
407
+ readonly type: Schema.Literal<"configuration_update">;
408
+ readonly reasoning: Schema.Struct<{
409
+ readonly effort: Schema.declare<OpenResponsesOptions.ReasoningEffort, OpenResponsesOptions.ReasoningEffort>;
410
+ }>;
395
411
  }>, Schema.Struct<{
396
412
  readonly type: Schema.tag<"message">;
397
413
  readonly role: Schema.tag<"system">;
@@ -491,15 +507,20 @@ declare const OpenResponsesBody: Schema.Struct<{
491
507
  readonly arguments: Schema.optional<Schema.String>;
492
508
  readonly output: Schema.optional<Schema.NullOr<Schema.String>>;
493
509
  readonly error: Schema.optional<Schema.Unknown>;
494
- }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>]>>;
510
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>, Schema.StructWithRest<Schema.Struct<{
511
+ readonly type: Schema.String;
512
+ readonly id: Schema.String;
513
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>;
495
514
  readonly instructions: Schema.optional<Schema.String>;
496
- readonly tools: Schema.optional<Schema.$Array<Schema.Struct<{
515
+ readonly tools: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
497
516
  readonly type: Schema.tag<"function">;
498
517
  readonly name: Schema.String;
499
518
  readonly description: Schema.String;
500
519
  readonly parameters: Schema.$Record<Schema.String, Schema.Unknown>;
501
520
  readonly strict: Schema.optional<Schema.Boolean>;
502
- }>>>;
521
+ }>, Schema.StructWithRest<Schema.Struct<{
522
+ readonly type: Schema.String;
523
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>]>>>;
503
524
  readonly tool_choice: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly ["auto", "none", "required"]>, Schema.Struct<{
504
525
  readonly type: Schema.tag<"function">;
505
526
  readonly name: Schema.String;
@@ -643,8 +664,8 @@ export declare const decodeChannelEvent: (frame: string) => Effect.Effect<{
643
664
  readonly name?: string | undefined;
644
665
  readonly namespace?: string | undefined;
645
666
  readonly arguments?: string | undefined;
646
- readonly encrypted_content?: string | null | undefined;
647
667
  readonly call_id?: string | undefined;
668
+ readonly encrypted_content?: string | null | undefined;
648
669
  }[] | undefined;
649
670
  readonly error?: unknown;
650
671
  readonly usage?: {
@@ -671,8 +692,8 @@ export declare const decodeChannelEvent: (frame: string) => Effect.Effect<{
671
692
  readonly name?: string | undefined;
672
693
  readonly namespace?: string | undefined;
673
694
  readonly arguments?: string | undefined;
674
- readonly encrypted_content?: string | null | undefined;
675
695
  readonly call_id?: string | undefined;
696
+ readonly encrypted_content?: string | null | undefined;
676
697
  } | null | undefined;
677
698
  readonly delta?: string | undefined;
678
699
  readonly arguments?: string | undefined;
@@ -684,9 +705,7 @@ export declare const decodeChannelEvent: (frame: string) => Effect.Effect<{
684
705
  export interface ProviderAdapter {
685
706
  readonly id: string;
686
707
  readonly name: string;
687
- readonly nativeTool?: (native: NonNullable<ToolDefinition["native"]>) => Effect.Effect<{
688
- readonly type: string;
689
- }, AIError>;
708
+ readonly nativeTool?: (native: NonNullable<ToolDefinition["native"]>) => Effect.Effect<HostedTool, AIError>;
690
709
  readonly lowerMedia?: (input: {
691
710
  readonly part: MediaPart;
692
711
  readonly media: Media.Inline | undefined;
@@ -725,9 +744,18 @@ export declare const lowerTool: (protocolName: string, tool: ToolDefinition) =>
725
744
  };
726
745
  strict: boolean;
727
746
  }, AIError, never>;
728
- export declare const lowerTools: (tools: ReadonlyArray<ToolDefinition>, adapter: ProviderAdapter) => Effect.Effect<{
747
+ export declare const lowerTools: (tools: ReadonlyArray<ToolDefinition>, adapter: ProviderAdapter) => Effect.Effect<({
748
+ readonly [x: string]: unknown;
729
749
  readonly type: string;
730
- }[], AIError, never>;
750
+ } | {
751
+ readonly type: "function";
752
+ readonly description: string;
753
+ readonly name: string;
754
+ readonly parameters: {
755
+ readonly [x: string]: unknown;
756
+ };
757
+ readonly strict?: boolean | undefined;
758
+ })[], AIError, never>;
731
759
  export declare const lowerToolChoice: (protocolName: string, toolChoice: NonNullable<LLMRequest["toolChoice"]>) => Effect.Effect<"required" | "auto" | "none" | {
732
760
  type: "function";
733
761
  name: string;
@@ -737,7 +765,129 @@ export declare const lowerConversation: (request: LLMRequest<import("../schema/o
737
765
  }, import("../route.js").CompactionOperations | undefined>>, adapter: ProviderAdapter) => Effect.Effect<{
738
766
  instructions?: string | undefined;
739
767
  model: string & import("effect/Brand").Brand<"AI.ModelID">;
740
- input: LoweredInputItem[];
768
+ input: ({
769
+ readonly [x: string]: unknown;
770
+ readonly id: string;
771
+ readonly type: "web_search_call";
772
+ readonly status?: string | undefined;
773
+ readonly action?: {
774
+ readonly [x: string]: unknown;
775
+ } | null | undefined;
776
+ } | {
777
+ readonly [x: string]: unknown;
778
+ readonly id: string;
779
+ readonly type: "file_search_call";
780
+ readonly status?: string | undefined;
781
+ readonly queries?: readonly string[] | undefined;
782
+ readonly results?: readonly {
783
+ readonly [x: string]: unknown;
784
+ }[] | null | undefined;
785
+ } | {
786
+ readonly [x: string]: unknown;
787
+ readonly id: string;
788
+ readonly type: "code_interpreter_call";
789
+ readonly status?: string | undefined;
790
+ readonly code?: string | null | undefined;
791
+ readonly container_id?: string | null | undefined;
792
+ readonly outputs?: readonly {
793
+ readonly [x: string]: unknown;
794
+ }[] | null | undefined;
795
+ } | {
796
+ readonly [x: string]: unknown;
797
+ readonly id: string;
798
+ readonly type: "mcp_call";
799
+ readonly status?: string | undefined;
800
+ readonly name?: string | undefined;
801
+ readonly output?: string | null | undefined;
802
+ readonly error?: unknown;
803
+ readonly arguments?: string | undefined;
804
+ readonly server_label?: string | undefined;
805
+ } | {
806
+ readonly type: "configuration_update";
807
+ readonly reasoning: {
808
+ readonly effort: OpenResponsesOptions.ReasoningEffort;
809
+ };
810
+ } | {
811
+ readonly [x: string]: unknown;
812
+ readonly type: string;
813
+ readonly id: string;
814
+ } | {
815
+ readonly type: "reasoning";
816
+ readonly summary: readonly {
817
+ readonly type: "summary_text";
818
+ readonly text: string;
819
+ }[];
820
+ readonly id?: string | undefined;
821
+ readonly encrypted_content?: string | null | undefined;
822
+ } | {
823
+ readonly type: "compaction";
824
+ readonly encrypted_content: string;
825
+ readonly id?: string | null | undefined;
826
+ } | {
827
+ readonly type: "message";
828
+ readonly role: "system";
829
+ readonly content: string;
830
+ } | {
831
+ readonly type: "message";
832
+ readonly role: "developer";
833
+ readonly content: string;
834
+ } | {
835
+ readonly type: "message";
836
+ readonly content: readonly ({
837
+ readonly type: "input_image";
838
+ readonly image_url: string;
839
+ readonly detail?: string | undefined;
840
+ } | {
841
+ readonly type: "input_file";
842
+ readonly filename: string;
843
+ readonly detail?: string | undefined;
844
+ readonly file_data?: string | undefined;
845
+ readonly file_url?: string | undefined;
846
+ } | {
847
+ readonly type: "input_text";
848
+ readonly text: string;
849
+ })[];
850
+ readonly role: "user";
851
+ readonly id?: string | undefined;
852
+ readonly status?: string | undefined;
853
+ } | {
854
+ readonly type: "message";
855
+ readonly content: readonly {
856
+ readonly type: "output_text";
857
+ readonly text: string;
858
+ }[];
859
+ readonly role: "assistant";
860
+ readonly id?: string | undefined;
861
+ readonly status?: string | undefined;
862
+ readonly phase?: "commentary" | "final_answer" | null | undefined;
863
+ } | {
864
+ readonly type: "function_call";
865
+ readonly name: string;
866
+ readonly arguments: string;
867
+ readonly call_id: string;
868
+ readonly id?: string | undefined;
869
+ readonly namespace?: string | undefined;
870
+ } | {
871
+ readonly type: "function_call_output";
872
+ readonly call_id: string;
873
+ readonly output: string | readonly ({
874
+ readonly type: "input_image";
875
+ readonly image_url: string;
876
+ readonly detail?: string | undefined;
877
+ } | {
878
+ readonly type: "input_file";
879
+ readonly filename: string;
880
+ readonly detail?: string | undefined;
881
+ readonly file_data?: string | undefined;
882
+ readonly file_url?: string | undefined;
883
+ } | {
884
+ readonly type: "input_text";
885
+ readonly text: string;
886
+ } | {
887
+ readonly type: "input_video";
888
+ readonly video_url: string;
889
+ })[];
890
+ })[];
741
891
  }, AIError, never>;
742
892
  export declare const lowerGeneration: (request: LLMRequest, options?: OpenResponsesOptions.Resolved) => {
743
893
  truncation?: "auto" | "disabled" | undefined;
@@ -781,9 +931,18 @@ export declare const allowedToolChoice: (request: LLMRequest) => {
781
931
  export declare const fromRequestWithAdapter: (request: LLMRequest<import("../schema/options.js").LanguageModel<{
782
932
  readonly [x: string]: unknown;
783
933
  }, import("../route.js").CompactionOperations | undefined>>, adapter: ProviderAdapter) => Effect.Effect<{
784
- tools: {
934
+ tools: ({
935
+ readonly [x: string]: unknown;
785
936
  readonly type: string;
786
- }[] | undefined;
937
+ } | {
938
+ readonly type: "function";
939
+ readonly description: string;
940
+ readonly name: string;
941
+ readonly parameters: {
942
+ readonly [x: string]: unknown;
943
+ };
944
+ readonly strict?: boolean | undefined;
945
+ })[] | undefined;
787
946
  tool_choice: "required" | "auto" | "none" | {
788
947
  type: "allowed_tools";
789
948
  mode: "required" | "auto" | "none";
@@ -825,12 +984,7 @@ export declare const fromRequestWithAdapter: (request: LLMRequest<import("../sch
825
984
  frequency_penalty: number | undefined;
826
985
  instructions?: string | undefined;
827
986
  model: string & import("effect/Brand").Brand<"AI.ModelID">;
828
- input: LoweredInputItem[];
829
- }, AIError, never>;
830
- export declare const fromRequest: (request: LLMRequest<import("../schema/options.js").LanguageModel<{
831
- readonly [x: string]: unknown;
832
- }, import("../route.js").CompactionOperations | undefined>>) => Effect.Effect<{
833
- readonly input: readonly ({
987
+ input: ({
834
988
  readonly [x: string]: unknown;
835
989
  readonly id: string;
836
990
  readonly type: "web_search_call";
@@ -867,6 +1021,15 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
867
1021
  readonly error?: unknown;
868
1022
  readonly arguments?: string | undefined;
869
1023
  readonly server_label?: string | undefined;
1024
+ } | {
1025
+ readonly type: "configuration_update";
1026
+ readonly reasoning: {
1027
+ readonly effort: OpenResponsesOptions.ReasoningEffort;
1028
+ };
1029
+ } | {
1030
+ readonly [x: string]: unknown;
1031
+ readonly type: string;
1032
+ readonly id: string;
870
1033
  } | {
871
1034
  readonly type: "reasoning";
872
1035
  readonly summary: readonly {
@@ -944,17 +1107,12 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
944
1107
  readonly video_url: string;
945
1108
  })[];
946
1109
  })[];
947
- readonly model: string;
948
- readonly stream: true;
949
- readonly metadata?: {
950
- readonly [x: string]: string;
951
- } | undefined;
952
- readonly instructions?: string | undefined;
953
- readonly reasoning?: {
954
- readonly summary?: "auto" | "concise" | "detailed" | undefined;
955
- readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
956
- } | undefined;
957
- readonly tools?: readonly {
1110
+ }, AIError, never>;
1111
+ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
1112
+ tools: ({
1113
+ readonly [x: string]: unknown;
1114
+ readonly type: string;
1115
+ } | {
958
1116
  readonly type: "function";
959
1117
  readonly description: string;
960
1118
  readonly name: string;
@@ -962,38 +1120,171 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
962
1120
  readonly [x: string]: unknown;
963
1121
  };
964
1122
  readonly strict?: boolean | undefined;
965
- }[] | undefined;
966
- readonly text?: {
967
- readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
968
- } | undefined;
969
- readonly temperature?: number | undefined;
970
- readonly service_tier?: OpenResponsesOptions.ServiceTier | undefined;
971
- readonly tool_choice?: "required" | "auto" | "none" | {
972
- readonly type: "function";
973
- readonly name: string;
974
- } | {
975
- readonly type: "allowed_tools";
976
- readonly mode: "required" | "auto" | "none";
977
- readonly tools: readonly {
978
- readonly type: "function";
979
- readonly name: string;
1123
+ })[] | undefined;
1124
+ tool_choice: "required" | "auto" | "none" | {
1125
+ type: "allowed_tools";
1126
+ mode: "required" | "auto" | "none";
1127
+ tools: {
1128
+ type: "function";
1129
+ name: string;
980
1130
  }[];
1131
+ } | {
1132
+ type: "function";
1133
+ name: string;
981
1134
  } | undefined;
982
- readonly top_p?: number | undefined;
983
- readonly frequency_penalty?: number | undefined;
984
- readonly presence_penalty?: number | undefined;
985
- readonly prompt_cache_key?: string | undefined;
986
- readonly parallel_tool_calls?: boolean | undefined;
987
- readonly store?: boolean | undefined;
988
- readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
989
- readonly truncation?: "auto" | "disabled" | undefined;
990
- readonly stream_options?: {
991
- readonly include_obfuscation?: boolean | undefined;
1135
+ truncation?: "auto" | "disabled" | undefined;
1136
+ parallel_tool_calls?: boolean | undefined;
1137
+ max_tool_calls?: number | undefined;
1138
+ service_tier?: OpenResponsesOptions.ServiceTier | undefined;
1139
+ text?: {
1140
+ verbosity: OpenResponsesOptions.TextVerbosity;
992
1141
  } | undefined;
993
- readonly safety_identifier?: string | undefined;
994
- readonly top_logprobs?: number | undefined;
995
- readonly max_output_tokens?: number | undefined;
996
- readonly max_tool_calls?: number | undefined;
1142
+ reasoning?: {
1143
+ effort: OpenResponsesOptions.ReasoningEffort | undefined;
1144
+ summary: "auto" | "concise" | "detailed" | undefined;
1145
+ } | undefined;
1146
+ include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
1147
+ prompt_cache_key?: string | undefined;
1148
+ top_logprobs?: number | undefined;
1149
+ stream_options?: {
1150
+ include_obfuscation: boolean;
1151
+ } | undefined;
1152
+ safety_identifier?: string | undefined;
1153
+ metadata?: {
1154
+ readonly [x: string]: string;
1155
+ } | undefined;
1156
+ store?: boolean | undefined;
1157
+ stream: true;
1158
+ max_output_tokens: number | undefined;
1159
+ temperature: number | undefined;
1160
+ top_p: number | undefined;
1161
+ presence_penalty: number | undefined;
1162
+ frequency_penalty: number | undefined;
1163
+ instructions?: string | undefined;
1164
+ model: string & import("effect/Brand").Brand<"AI.ModelID">;
1165
+ input: ({
1166
+ readonly [x: string]: unknown;
1167
+ readonly id: string;
1168
+ readonly type: "web_search_call";
1169
+ readonly status?: string | undefined;
1170
+ readonly action?: {
1171
+ readonly [x: string]: unknown;
1172
+ } | null | undefined;
1173
+ } | {
1174
+ readonly [x: string]: unknown;
1175
+ readonly id: string;
1176
+ readonly type: "file_search_call";
1177
+ readonly status?: string | undefined;
1178
+ readonly queries?: readonly string[] | undefined;
1179
+ readonly results?: readonly {
1180
+ readonly [x: string]: unknown;
1181
+ }[] | null | undefined;
1182
+ } | {
1183
+ readonly [x: string]: unknown;
1184
+ readonly id: string;
1185
+ readonly type: "code_interpreter_call";
1186
+ readonly status?: string | undefined;
1187
+ readonly code?: string | null | undefined;
1188
+ readonly container_id?: string | null | undefined;
1189
+ readonly outputs?: readonly {
1190
+ readonly [x: string]: unknown;
1191
+ }[] | null | undefined;
1192
+ } | {
1193
+ readonly [x: string]: unknown;
1194
+ readonly id: string;
1195
+ readonly type: "mcp_call";
1196
+ readonly status?: string | undefined;
1197
+ readonly name?: string | undefined;
1198
+ readonly output?: string | null | undefined;
1199
+ readonly error?: unknown;
1200
+ readonly arguments?: string | undefined;
1201
+ readonly server_label?: string | undefined;
1202
+ } | {
1203
+ readonly type: "configuration_update";
1204
+ readonly reasoning: {
1205
+ readonly effort: OpenResponsesOptions.ReasoningEffort;
1206
+ };
1207
+ } | {
1208
+ readonly [x: string]: unknown;
1209
+ readonly type: string;
1210
+ readonly id: string;
1211
+ } | {
1212
+ readonly type: "reasoning";
1213
+ readonly summary: readonly {
1214
+ readonly type: "summary_text";
1215
+ readonly text: string;
1216
+ }[];
1217
+ readonly id?: string | undefined;
1218
+ readonly encrypted_content?: string | null | undefined;
1219
+ } | {
1220
+ readonly type: "compaction";
1221
+ readonly encrypted_content: string;
1222
+ readonly id?: string | null | undefined;
1223
+ } | {
1224
+ readonly type: "message";
1225
+ readonly role: "system";
1226
+ readonly content: string;
1227
+ } | {
1228
+ readonly type: "message";
1229
+ readonly role: "developer";
1230
+ readonly content: string;
1231
+ } | {
1232
+ readonly type: "message";
1233
+ readonly content: readonly ({
1234
+ readonly type: "input_image";
1235
+ readonly image_url: string;
1236
+ readonly detail?: string | undefined;
1237
+ } | {
1238
+ readonly type: "input_file";
1239
+ readonly filename: string;
1240
+ readonly detail?: string | undefined;
1241
+ readonly file_data?: string | undefined;
1242
+ readonly file_url?: string | undefined;
1243
+ } | {
1244
+ readonly type: "input_text";
1245
+ readonly text: string;
1246
+ })[];
1247
+ readonly role: "user";
1248
+ readonly id?: string | undefined;
1249
+ readonly status?: string | undefined;
1250
+ } | {
1251
+ readonly type: "message";
1252
+ readonly content: readonly {
1253
+ readonly type: "output_text";
1254
+ readonly text: string;
1255
+ }[];
1256
+ readonly role: "assistant";
1257
+ readonly id?: string | undefined;
1258
+ readonly status?: string | undefined;
1259
+ readonly phase?: "commentary" | "final_answer" | null | undefined;
1260
+ } | {
1261
+ readonly type: "function_call";
1262
+ readonly name: string;
1263
+ readonly arguments: string;
1264
+ readonly call_id: string;
1265
+ readonly id?: string | undefined;
1266
+ readonly namespace?: string | undefined;
1267
+ } | {
1268
+ readonly type: "function_call_output";
1269
+ readonly call_id: string;
1270
+ readonly output: string | readonly ({
1271
+ readonly type: "input_image";
1272
+ readonly image_url: string;
1273
+ readonly detail?: string | undefined;
1274
+ } | {
1275
+ readonly type: "input_file";
1276
+ readonly filename: string;
1277
+ readonly detail?: string | undefined;
1278
+ readonly file_data?: string | undefined;
1279
+ readonly file_url?: string | undefined;
1280
+ } | {
1281
+ readonly type: "input_text";
1282
+ readonly text: string;
1283
+ } | {
1284
+ readonly type: "input_video";
1285
+ readonly video_url: string;
1286
+ })[];
1287
+ })[];
997
1288
  }, AIError, never>;
998
1289
  export declare const mapUsage: (usage: OpenResponsesUsage | null | undefined, providerMetadataKey: string) => Usage | undefined;
999
1290
  export declare const metadataKey: (model: LLMRequest["model"]) => string;
@@ -1191,6 +1482,8 @@ export declare const step: (state: ParserState, event: NormalizedEvent) => AIErr
1191
1482
  readonly reason: {
1192
1483
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1193
1484
  readonly raw?: string | undefined;
1485
+ readonly category?: string | undefined;
1486
+ readonly explanation?: string | undefined;
1194
1487
  };
1195
1488
  readonly index: number;
1196
1489
  readonly providerMetadata?: {
@@ -1204,6 +1497,8 @@ export declare const step: (state: ParserState, event: NormalizedEvent) => AIErr
1204
1497
  readonly reason: {
1205
1498
  readonly normalized: "length" | "stop" | "tool-calls" | "content-filter" | "error" | "unknown";
1206
1499
  readonly raw?: string | undefined;
1500
+ readonly category?: string | undefined;
1501
+ readonly explanation?: string | undefined;
1207
1502
  };
1208
1503
  readonly providerMetadata?: {
1209
1504
  readonly [x: string]: {
@@ -1264,6 +1559,15 @@ export declare const protocol: Protocol<{
1264
1559
  readonly error?: unknown;
1265
1560
  readonly arguments?: string | undefined;
1266
1561
  readonly server_label?: string | undefined;
1562
+ } | {
1563
+ readonly type: "configuration_update";
1564
+ readonly reasoning: {
1565
+ readonly effort: OpenResponsesOptions.ReasoningEffort;
1566
+ };
1567
+ } | {
1568
+ readonly [x: string]: unknown;
1569
+ readonly type: string;
1570
+ readonly id: string;
1267
1571
  } | {
1268
1572
  readonly type: "reasoning";
1269
1573
  readonly summary: readonly {
@@ -1351,7 +1655,10 @@ export declare const protocol: Protocol<{
1351
1655
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
1352
1656
  readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
1353
1657
  } | undefined;
1354
- readonly tools?: readonly {
1658
+ readonly tools?: readonly ({
1659
+ readonly [x: string]: unknown;
1660
+ readonly type: string;
1661
+ } | {
1355
1662
  readonly type: "function";
1356
1663
  readonly description: string;
1357
1664
  readonly name: string;
@@ -1359,7 +1666,7 @@ export declare const protocol: Protocol<{
1359
1666
  readonly [x: string]: unknown;
1360
1667
  };
1361
1668
  readonly strict?: boolean | undefined;
1362
- }[] | undefined;
1669
+ })[] | undefined;
1363
1670
  readonly text?: {
1364
1671
  readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
1365
1672
  } | undefined;
@@ -1379,9 +1686,10 @@ export declare const protocol: Protocol<{
1379
1686
  readonly top_p?: number | undefined;
1380
1687
  readonly frequency_penalty?: number | undefined;
1381
1688
  readonly presence_penalty?: number | undefined;
1689
+ readonly store?: boolean | undefined;
1690
+ readonly max_output_tokens?: number | undefined;
1382
1691
  readonly prompt_cache_key?: string | undefined;
1383
1692
  readonly parallel_tool_calls?: boolean | undefined;
1384
- readonly store?: boolean | undefined;
1385
1693
  readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
1386
1694
  readonly truncation?: "auto" | "disabled" | undefined;
1387
1695
  readonly stream_options?: {
@@ -1389,7 +1697,6 @@ export declare const protocol: Protocol<{
1389
1697
  } | undefined;
1390
1698
  readonly safety_identifier?: string | undefined;
1391
1699
  readonly top_logprobs?: number | undefined;
1392
- readonly max_output_tokens?: number | undefined;
1393
1700
  readonly max_tool_calls?: number | undefined;
1394
1701
  }, string, {
1395
1702
  readonly [x: string]: unknown;
@@ -1409,8 +1716,8 @@ export declare const protocol: Protocol<{
1409
1716
  readonly name?: string | undefined;
1410
1717
  readonly namespace?: string | undefined;
1411
1718
  readonly arguments?: string | undefined;
1412
- readonly encrypted_content?: string | null | undefined;
1413
1719
  readonly call_id?: string | undefined;
1720
+ readonly encrypted_content?: string | null | undefined;
1414
1721
  }[] | undefined;
1415
1722
  readonly error?: unknown;
1416
1723
  readonly usage?: {
@@ -1437,8 +1744,8 @@ export declare const protocol: Protocol<{
1437
1744
  readonly name?: string | undefined;
1438
1745
  readonly namespace?: string | undefined;
1439
1746
  readonly arguments?: string | undefined;
1440
- readonly encrypted_content?: string | null | undefined;
1441
1747
  readonly call_id?: string | undefined;
1748
+ readonly encrypted_content?: string | null | undefined;
1442
1749
  } | null | undefined;
1443
1750
  readonly delta?: string | undefined;
1444
1751
  readonly arguments?: string | undefined;
@@ -1485,6 +1792,15 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1485
1792
  readonly error?: unknown;
1486
1793
  readonly arguments?: string | undefined;
1487
1794
  readonly server_label?: string | undefined;
1795
+ } | {
1796
+ readonly type: "configuration_update";
1797
+ readonly reasoning: {
1798
+ readonly effort: OpenResponsesOptions.ReasoningEffort;
1799
+ };
1800
+ } | {
1801
+ readonly [x: string]: unknown;
1802
+ readonly type: string;
1803
+ readonly id: string;
1488
1804
  } | {
1489
1805
  readonly type: "reasoning";
1490
1806
  readonly summary: readonly {
@@ -1572,7 +1888,10 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1572
1888
  readonly summary?: "auto" | "concise" | "detailed" | undefined;
1573
1889
  readonly effort?: OpenResponsesOptions.ReasoningEffort | undefined;
1574
1890
  } | undefined;
1575
- readonly tools?: readonly {
1891
+ readonly tools?: readonly ({
1892
+ readonly [x: string]: unknown;
1893
+ readonly type: string;
1894
+ } | {
1576
1895
  readonly type: "function";
1577
1896
  readonly description: string;
1578
1897
  readonly name: string;
@@ -1580,7 +1899,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1580
1899
  readonly [x: string]: unknown;
1581
1900
  };
1582
1901
  readonly strict?: boolean | undefined;
1583
- }[] | undefined;
1902
+ })[] | undefined;
1584
1903
  readonly text?: {
1585
1904
  readonly verbosity?: OpenResponsesOptions.TextVerbosity | undefined;
1586
1905
  } | undefined;
@@ -1600,9 +1919,10 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1600
1919
  readonly top_p?: number | undefined;
1601
1920
  readonly frequency_penalty?: number | undefined;
1602
1921
  readonly presence_penalty?: number | undefined;
1922
+ readonly store?: boolean | undefined;
1923
+ readonly max_output_tokens?: number | undefined;
1603
1924
  readonly prompt_cache_key?: string | undefined;
1604
1925
  readonly parallel_tool_calls?: boolean | undefined;
1605
- readonly store?: boolean | undefined;
1606
1926
  readonly include?: readonly OpenResponsesOptions.ResponseIncludable[] | undefined;
1607
1927
  readonly truncation?: "auto" | "disabled" | undefined;
1608
1928
  readonly stream_options?: {
@@ -1610,7 +1930,6 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
1610
1930
  } | undefined;
1611
1931
  readonly safety_identifier?: string | undefined;
1612
1932
  readonly top_logprobs?: number | undefined;
1613
- readonly max_output_tokens?: number | undefined;
1614
1933
  readonly max_tool_calls?: number | undefined;
1615
1934
  }, string>;
1616
1935
  export * as OpenResponses from "./open-responses.js";