@opencode-ai/ai 0.0.0-dev-17636 → 0.0.0-dev-17642

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.
@@ -171,6 +171,7 @@ export declare const coreFields: {
171
171
  readonly name: Schema.String;
172
172
  }>]>>;
173
173
  store: Schema.optional<Schema.Boolean>;
174
+ truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
174
175
  service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
175
176
  prompt_cache_key: Schema.optional<Schema.String>;
176
177
  include: Schema.optional<Schema.$Array<Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>>>;
@@ -260,6 +261,7 @@ declare const OpenResponsesBody: Schema.Struct<{
260
261
  readonly name: Schema.String;
261
262
  }>]>>;
262
263
  readonly store: Schema.optional<Schema.Boolean>;
264
+ readonly truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
263
265
  readonly service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
264
266
  readonly prompt_cache_key: Schema.optional<Schema.String>;
265
267
  readonly include: Schema.optional<Schema.$Array<Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>>>;
@@ -414,6 +416,7 @@ export declare const lowerToolChoice: (protocolName: string, toolChoice: NonNull
414
416
  name: string;
415
417
  }, AIError, never>;
416
418
  export declare const fromRequestWithExtension: (request: LLMRequest, extension: Extension) => Effect.Effect<{
419
+ truncation?: "auto" | "disabled" | undefined;
417
420
  service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
418
421
  text?: {
419
422
  verbosity: "low" | "medium" | "high";
@@ -533,6 +536,7 @@ export declare const fromRequest: (request: LLMRequest) => Effect.Effect<{
533
536
  readonly top_p?: number | undefined;
534
537
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
535
538
  readonly store?: boolean | undefined;
539
+ readonly truncation?: "auto" | "disabled" | undefined;
536
540
  readonly prompt_cache_key?: string | undefined;
537
541
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
538
542
  readonly max_output_tokens?: number | undefined;
@@ -817,6 +821,7 @@ export declare const protocol: Protocol<{
817
821
  readonly top_p?: number | undefined;
818
822
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
819
823
  readonly store?: boolean | undefined;
824
+ readonly truncation?: "auto" | "disabled" | undefined;
820
825
  readonly prompt_cache_key?: string | undefined;
821
826
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
822
827
  readonly max_output_tokens?: number | undefined;
@@ -962,6 +967,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
962
967
  readonly top_p?: number | undefined;
963
968
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
964
969
  readonly store?: boolean | undefined;
970
+ readonly truncation?: "auto" | "disabled" | undefined;
965
971
  readonly prompt_cache_key?: string | undefined;
966
972
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
967
973
  readonly max_output_tokens?: number | undefined;
@@ -106,6 +106,7 @@ export const coreFields = {
106
106
  tools: optionalArray(Tool),
107
107
  tool_choice: Schema.optional(ToolChoice),
108
108
  store: Schema.optional(Schema.Boolean),
109
+ truncation: Schema.optional(OpenResponsesOptions.TruncationSchema),
109
110
  service_tier: Schema.optional(OpenResponsesOptions.ServiceTierSchema),
110
111
  prompt_cache_key: Schema.optional(Schema.String),
111
112
  include: optionalArray(OpenResponsesOptions.ResponseIncludableSchema),
@@ -418,6 +419,7 @@ const lowerOptions = (request) => {
418
419
  : {}),
419
420
  ...(options.textVerbosity ? { text: { verbosity: options.textVerbosity } } : {}),
420
421
  ...(options.serviceTier ? { service_tier: options.serviceTier } : {}),
422
+ ...(options.truncation ? { truncation: options.truncation } : {}),
421
423
  };
422
424
  };
423
425
  export const fromRequestWithExtension = Effect.fn("OpenResponses.fromRequestWithExtension")(function* (request, extension) {
@@ -92,6 +92,7 @@ export declare const route: Route<{
92
92
  readonly top_p?: number | undefined;
93
93
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
94
94
  readonly store?: boolean | undefined;
95
+ readonly truncation?: "auto" | "disabled" | undefined;
95
96
  readonly prompt_cache_key?: string | undefined;
96
97
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
97
98
  readonly max_output_tokens?: number | undefined;
@@ -99,6 +99,7 @@ declare const OpenAIResponsesBody: Schema.Struct<{
99
99
  readonly model: Schema.String;
100
100
  readonly instructions: Schema.optional<Schema.String>;
101
101
  readonly store: Schema.optional<Schema.Boolean>;
102
+ readonly truncation: Schema.optional<Schema.Literals<readonly ["auto", "disabled"]>>;
102
103
  readonly service_tier: Schema.optional<Schema.Literals<readonly ["auto", "default", "flex", "priority"]>>;
103
104
  readonly prompt_cache_key: Schema.optional<Schema.String>;
104
105
  readonly include: Schema.optional<Schema.$Array<Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>>>;
@@ -220,6 +221,7 @@ export declare const protocol: Protocol<{
220
221
  readonly top_p?: number | undefined;
221
222
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
222
223
  readonly store?: boolean | undefined;
224
+ readonly truncation?: "auto" | "disabled" | undefined;
223
225
  readonly prompt_cache_key?: string | undefined;
224
226
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
225
227
  readonly max_output_tokens?: number | undefined;
@@ -384,6 +386,7 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
384
386
  readonly top_p?: number | undefined;
385
387
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
386
388
  readonly store?: boolean | undefined;
389
+ readonly truncation?: "auto" | "disabled" | undefined;
387
390
  readonly prompt_cache_key?: string | undefined;
388
391
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
389
392
  readonly max_output_tokens?: number | undefined;
@@ -494,6 +497,7 @@ export declare const transport: import("../route/transport/index.js").Transport<
494
497
  readonly top_p?: number | undefined;
495
498
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
496
499
  readonly store?: boolean | undefined;
500
+ readonly truncation?: "auto" | "disabled" | undefined;
497
501
  readonly prompt_cache_key?: string | undefined;
498
502
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
499
503
  readonly max_output_tokens?: number | undefined;
@@ -604,6 +608,7 @@ export declare const route: Route<{
604
608
  readonly top_p?: number | undefined;
605
609
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
606
610
  readonly store?: boolean | undefined;
611
+ readonly truncation?: "auto" | "disabled" | undefined;
607
612
  readonly prompt_cache_key?: string | undefined;
608
613
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
609
614
  readonly max_output_tokens?: number | undefined;
@@ -4,10 +4,13 @@ export declare const ResponseIncludables: readonly ["file_search_call.results",
4
4
  export type ResponseIncludable = (typeof ResponseIncludables)[number];
5
5
  export declare const ServiceTiers: readonly ["auto", "default", "flex", "priority"];
6
6
  export type ServiceTier = (typeof ServiceTiers)[number];
7
+ export declare const Truncations: readonly ["auto", "disabled"];
8
+ export type Truncation = (typeof Truncations)[number];
7
9
  export declare const ReasoningEffort: Schema.String;
8
10
  export declare const TextVerbositySchema: Schema.Literals<readonly ["low", "medium", "high"]>;
9
11
  export declare const ResponseIncludableSchema: Schema.Literals<readonly ["file_search_call.results", "web_search_call.results", "web_search_call.action.sources", "message.input_image.image_url", "computer_call_output.output.image_url", "code_interpreter_call.outputs", "reasoning.encrypted_content", "message.output_text.logprobs"]>;
10
12
  export declare const ServiceTierSchema: Schema.Literals<readonly ["auto", "default", "flex", "priority"]>;
13
+ export declare const TruncationSchema: Schema.Literals<readonly ["auto", "disabled"]>;
11
14
  export interface Resolved {
12
15
  readonly instructions?: string;
13
16
  readonly store?: boolean;
@@ -16,6 +19,7 @@ export interface Resolved {
16
19
  readonly include?: ReadonlyArray<ResponseIncludable>;
17
20
  readonly textVerbosity?: Schema.Schema.Type<typeof TextVerbosity>;
18
21
  readonly serviceTier?: ServiceTier;
22
+ readonly truncation?: Truncation;
19
23
  }
20
24
  export declare const resolve: (request: LLMRequest) => Resolved;
21
25
  export * as OpenResponsesOptions from "./open-responses-options.js";
@@ -11,15 +11,19 @@ export const ResponseIncludables = [
11
11
  "message.output_text.logprobs",
12
12
  ];
13
13
  export const ServiceTiers = ["auto", "default", "flex", "priority"];
14
+ export const Truncations = ["auto", "disabled"];
14
15
  const TEXT_VERBOSITY = new Set(["low", "medium", "high"]);
15
16
  const INCLUDABLES = new Set(ResponseIncludables);
16
17
  const SERVICE_TIERS = new Set(ServiceTiers);
18
+ const TRUNCATIONS = new Set(Truncations);
17
19
  const isTextVerbosity = (value) => typeof value === "string" && TEXT_VERBOSITY.has(value);
18
20
  const isServiceTier = (value) => typeof value === "string" && SERVICE_TIERS.has(value);
21
+ const isTruncation = (value) => typeof value === "string" && TRUNCATIONS.has(value);
19
22
  export const ReasoningEffort = Schema.String;
20
23
  export const TextVerbositySchema = TextVerbosity;
21
24
  export const ResponseIncludableSchema = Schema.Literals(ResponseIncludables);
22
25
  export const ServiceTierSchema = Schema.Literals(ServiceTiers);
26
+ export const TruncationSchema = Schema.Literals(Truncations);
23
27
  export const resolve = (request) => {
24
28
  const input = request.providerOptions?.[request.model.route.providerMetadataKey ?? "openresponses"];
25
29
  const include = Array.isArray(input?.include)
@@ -36,6 +40,7 @@ export const resolve = (request) => {
36
40
  include: include.length > 0 ? include : undefined,
37
41
  textVerbosity: isTextVerbosity(input?.textVerbosity) ? input.textVerbosity : undefined,
38
42
  serviceTier: isServiceTier(input?.serviceTier) ? input.serviceTier : undefined,
43
+ truncation: isTruncation(input?.truncation) ? input.truncation : undefined,
39
44
  };
40
45
  };
41
46
  export * as OpenResponsesOptions from "./open-responses-options.js";
@@ -221,6 +221,7 @@ export declare const routes: (RouteDef<{
221
221
  readonly top_p?: number | undefined;
222
222
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
223
223
  readonly store?: boolean | undefined;
224
+ readonly truncation?: "auto" | "disabled" | undefined;
224
225
  readonly prompt_cache_key?: string | undefined;
225
226
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
226
227
  readonly max_output_tokens?: number | undefined;
@@ -224,6 +224,7 @@ export declare const routes: (RouteDef<{
224
224
  readonly top_p?: number | undefined;
225
225
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
226
226
  readonly store?: boolean | undefined;
227
+ readonly truncation?: "auto" | "disabled" | undefined;
227
228
  readonly prompt_cache_key?: string | undefined;
228
229
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
229
230
  readonly max_output_tokens?: number | undefined;
@@ -105,6 +105,7 @@ export declare const routes: import("../route/client.js").Route<{
105
105
  readonly top_p?: number | undefined;
106
106
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
107
107
  readonly store?: boolean | undefined;
108
+ readonly truncation?: "auto" | "disabled" | undefined;
108
109
  readonly prompt_cache_key?: string | undefined;
109
110
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
110
111
  readonly max_output_tokens?: number | undefined;
@@ -1,4 +1,4 @@
1
- import type { ResponseIncludable, ServiceTier } from "../protocols/utils/open-responses-options.js";
1
+ import type { ResponseIncludable, ServiceTier, Truncation } from "../protocols/utils/open-responses-options.js";
2
2
  import type { ProviderOptions, ReasoningEffort, TextVerbosity } from "../schema/index.js";
3
3
  export interface OpenResponsesOptionsInput {
4
4
  readonly [key: string]: unknown;
@@ -9,6 +9,7 @@ export interface OpenResponsesOptionsInput {
9
9
  readonly include?: ReadonlyArray<ResponseIncludable>;
10
10
  readonly textVerbosity?: TextVerbosity;
11
11
  readonly serviceTier?: ServiceTier;
12
+ readonly truncation?: Truncation;
12
13
  }
13
14
  export type OpenResponsesProviderOptionsInput = ProviderOptions & {
14
15
  readonly openresponses?: OpenResponsesOptionsInput;
@@ -103,6 +103,7 @@ export declare const routes: import("../route/client.js").Route<{
103
103
  readonly top_p?: number | undefined;
104
104
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
105
105
  readonly store?: boolean | undefined;
106
+ readonly truncation?: "auto" | "disabled" | undefined;
106
107
  readonly prompt_cache_key?: string | undefined;
107
108
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
108
109
  readonly max_output_tokens?: number | undefined;
@@ -209,6 +209,7 @@ export declare const routes: (Route<{
209
209
  readonly top_p?: number | undefined;
210
210
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
211
211
  readonly store?: boolean | undefined;
212
+ readonly truncation?: "auto" | "disabled" | undefined;
212
213
  readonly prompt_cache_key?: string | undefined;
213
214
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
214
215
  readonly max_output_tokens?: number | undefined;
@@ -219,6 +219,7 @@ export declare const routes: (Route<{
219
219
  readonly top_p?: number | undefined;
220
220
  readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
221
221
  readonly store?: boolean | undefined;
222
+ readonly truncation?: "auto" | "disabled" | undefined;
222
223
  readonly prompt_cache_key?: string | undefined;
223
224
  readonly service_tier?: "default" | "auto" | "flex" | "priority" | undefined;
224
225
  readonly max_output_tokens?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-dev-17636",
3
+ "version": "0.0.0-dev-17642",
4
4
  "name": "@opencode-ai/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@clack/prompts": "1.0.0-alpha.1",
32
32
  "@effect/platform-node": "4.0.0-beta.107",
33
- "@opencode-ai/http-recorder": "0.0.0-dev-17636",
33
+ "@opencode-ai/http-recorder": "0.0.0-dev-17642",
34
34
  "@tsconfig/bun": "1.0.9",
35
35
  "@types/bun": "1.3.13",
36
36
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -39,7 +39,7 @@
39
39
  "dependencies": {
40
40
  "@smithy/eventstream-codec": "4.2.14",
41
41
  "@smithy/util-utf8": "4.2.2",
42
- "@opencode-ai/schema": "0.0.0-dev-17636",
42
+ "@opencode-ai/schema": "0.0.0-dev-17642",
43
43
  "aws4fetch": "1.0.20",
44
44
  "effect": "4.0.0-beta.107",
45
45
  "google-auth-library": "10.5.0"