@openrouter/sdk 1.5.49 → 1.5.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/alignmentresponsesrejected.d.ts +2 -1
- package/esm/models/alignmentresponsesrejected.js +2 -0
- package/esm/models/chatusage.d.ts +5 -0
- package/esm/models/chatusage.js +3 -0
- package/esm/models/compactiontriggeritem.d.ts +22 -0
- package/esm/models/compactiontriggeritem.js +18 -0
- package/esm/models/deferredtoolscontrol.d.ts +7 -6
- package/esm/models/deferredtoolscontrol.js +5 -2
- package/esm/models/deferredtoolsdetails.d.ts +28 -0
- package/esm/models/deferredtoolsdetails.js +24 -0
- package/esm/models/index.d.ts +4 -0
- package/esm/models/index.js +4 -0
- package/esm/models/inputsunion.d.ts +5 -4
- package/esm/models/inputsunion.js +3 -0
- package/esm/models/openresponsesresult.d.ts +5 -0
- package/esm/models/openresponsesresult.js +3 -0
- package/esm/models/operations/listorganizationmembers.d.ts +4 -3
- package/esm/models/operations/listorganizationmembers.js +2 -1
- package/esm/models/outputcompactionitem.d.ts +16 -0
- package/esm/models/outputcompactionitem.js +23 -0
- package/esm/models/outputitemcompaction.d.ts +13 -0
- package/esm/models/outputitemcompaction.js +23 -0
- package/esm/models/outputitems.d.ts +2 -1
- package/esm/models/outputitems.js +2 -0
- package/esm/models/outputtoolsearchservertoolitem.d.ts +44 -0
- package/esm/models/outputtoolsearchservertoolitem.js +34 -0
- package/jsr.json +1 -1
- package/package.json +8 -8
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.5.
|
|
53
|
+
readonly sdkVersion: "1.5.51";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.51 2.950.13 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.5.
|
|
32
|
+
sdkVersion: "1.5.51",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.51 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -4,6 +4,7 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { OutputItemApplyPatchCall } from "./outputitemapplypatchcall.js";
|
|
6
6
|
import { OutputItemCodeInterpreterCall } from "./outputitemcodeinterpretercall.js";
|
|
7
|
+
import { OutputItemCompaction } from "./outputitemcompaction.js";
|
|
7
8
|
import { OutputItemCustomToolCall } from "./outputitemcustomtoolcall.js";
|
|
8
9
|
import { OutputItemFileSearchCall } from "./outputitemfilesearchcall.js";
|
|
9
10
|
import { OutputItemFunctionCall } from "./outputitemfunctioncall.js";
|
|
@@ -11,7 +12,7 @@ import { OutputItemImageGenerationCall } from "./outputitemimagegenerationcall.j
|
|
|
11
12
|
import { OutputItemReasoning } from "./outputitemreasoning.js";
|
|
12
13
|
import { OutputItemWebSearchCall } from "./outputitemwebsearchcall.js";
|
|
13
14
|
import { OutputMessage } from "./outputmessage.js";
|
|
14
|
-
export type AlignmentResponsesRejected = OutputItemApplyPatchCall | OutputItemCodeInterpreterCall | OutputItemCustomToolCall | OutputItemFileSearchCall | OutputItemFunctionCall | OutputItemImageGenerationCall | OutputMessage | OutputItemReasoning | OutputItemWebSearchCall | discriminatedUnionTypes.Unknown<"type">;
|
|
15
|
+
export type AlignmentResponsesRejected = OutputItemApplyPatchCall | OutputItemCodeInterpreterCall | OutputItemCompaction | OutputItemCustomToolCall | OutputItemFileSearchCall | OutputItemFunctionCall | OutputItemImageGenerationCall | OutputMessage | OutputItemReasoning | OutputItemWebSearchCall | discriminatedUnionTypes.Unknown<"type">;
|
|
15
16
|
/** @internal */
|
|
16
17
|
export declare const AlignmentResponsesRejected$inboundSchema: z.ZodType<AlignmentResponsesRejected, unknown>;
|
|
17
18
|
export declare function alignmentResponsesRejectedFromJSON(jsonString: string): SafeParseResult<AlignmentResponsesRejected, SDKValidationError>;
|
|
@@ -6,6 +6,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
6
6
|
import { discriminatedUnion } from "../types/discriminatedUnion.js";
|
|
7
7
|
import { OutputItemApplyPatchCall$inboundSchema, } from "./outputitemapplypatchcall.js";
|
|
8
8
|
import { OutputItemCodeInterpreterCall$inboundSchema, } from "./outputitemcodeinterpretercall.js";
|
|
9
|
+
import { OutputItemCompaction$inboundSchema, } from "./outputitemcompaction.js";
|
|
9
10
|
import { OutputItemCustomToolCall$inboundSchema, } from "./outputitemcustomtoolcall.js";
|
|
10
11
|
import { OutputItemFileSearchCall$inboundSchema, } from "./outputitemfilesearchcall.js";
|
|
11
12
|
import { OutputItemFunctionCall$inboundSchema, } from "./outputitemfunctioncall.js";
|
|
@@ -17,6 +18,7 @@ import { OutputMessage$inboundSchema } from "./outputmessage.js";
|
|
|
17
18
|
export const AlignmentResponsesRejected$inboundSchema = discriminatedUnion("type", {
|
|
18
19
|
apply_patch_call: OutputItemApplyPatchCall$inboundSchema,
|
|
19
20
|
code_interpreter_call: OutputItemCodeInterpreterCall$inboundSchema,
|
|
21
|
+
compaction: OutputItemCompaction$inboundSchema,
|
|
20
22
|
custom_tool_call: OutputItemCustomToolCall$inboundSchema,
|
|
21
23
|
file_search_call: OutputItemFileSearchCall$inboundSchema,
|
|
22
24
|
function_call: OutputItemFunctionCall$inboundSchema,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { CostDetails } from "./costdetails.js";
|
|
4
|
+
import { DeferredToolsDetails } from "./deferredtoolsdetails.js";
|
|
4
5
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
6
|
import { ServerToolUseDetails } from "./servertoolusedetails.js";
|
|
6
7
|
/**
|
|
@@ -65,6 +66,10 @@ export type ChatUsage = {
|
|
|
65
66
|
* Breakdown of upstream inference costs
|
|
66
67
|
*/
|
|
67
68
|
costDetails?: CostDetails | null | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Totals across every upstream model call of a deferred-tools run. The native usage fields report only the final call; cost covers every call.
|
|
71
|
+
*/
|
|
72
|
+
deferredToolsDetails?: DeferredToolsDetails | undefined;
|
|
68
73
|
/**
|
|
69
74
|
* Whether a request was made using a Bring Your Own Key configuration
|
|
70
75
|
*/
|
package/esm/models/chatusage.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { CostDetails$inboundSchema } from "./costdetails.js";
|
|
9
|
+
import { DeferredToolsDetails$inboundSchema, } from "./deferredtoolsdetails.js";
|
|
9
10
|
import { ServerToolUseDetails$inboundSchema, } from "./servertoolusedetails.js";
|
|
10
11
|
/** @internal */
|
|
11
12
|
export const ChatUsageCompletionTokensDetails$inboundSchema = z.object({
|
|
@@ -47,6 +48,7 @@ export const ChatUsage$inboundSchema = z.object({
|
|
|
47
48
|
completion_tokens_details: z.nullable(z.lazy(() => ChatUsageCompletionTokensDetails$inboundSchema)).optional(),
|
|
48
49
|
cost: z.nullable(z.number()).optional(),
|
|
49
50
|
cost_details: z.nullable(CostDetails$inboundSchema).optional(),
|
|
51
|
+
deferred_tools_details: DeferredToolsDetails$inboundSchema.optional(),
|
|
50
52
|
is_byok: z.boolean().optional(),
|
|
51
53
|
prompt_tokens: z.int(),
|
|
52
54
|
prompt_tokens_details: z.nullable(z.lazy(() => ChatUsagePromptTokensDetails$inboundSchema)).optional(),
|
|
@@ -58,6 +60,7 @@ export const ChatUsage$inboundSchema = z.object({
|
|
|
58
60
|
"completion_tokens": "completionTokens",
|
|
59
61
|
"completion_tokens_details": "completionTokensDetails",
|
|
60
62
|
"cost_details": "costDetails",
|
|
63
|
+
"deferred_tools_details": "deferredToolsDetails",
|
|
61
64
|
"is_byok": "isByok",
|
|
62
65
|
"prompt_tokens": "promptTokens",
|
|
63
66
|
"prompt_tokens_details": "promptTokensDetails",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
export declare const CompactionTriggerItemType: {
|
|
4
|
+
readonly CompactionTrigger: "compaction_trigger";
|
|
5
|
+
};
|
|
6
|
+
export type CompactionTriggerItemType = ClosedEnum<typeof CompactionTriggerItemType>;
|
|
7
|
+
/**
|
|
8
|
+
* Asks the model to compact the preceding input into a compaction item
|
|
9
|
+
*/
|
|
10
|
+
export type CompactionTriggerItem = {
|
|
11
|
+
type: CompactionTriggerItemType;
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const CompactionTriggerItemType$outboundSchema: z.ZodEnum<typeof CompactionTriggerItemType>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
export type CompactionTriggerItem$Outbound = {
|
|
17
|
+
type: string;
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const CompactionTriggerItem$outboundSchema: z.ZodType<CompactionTriggerItem$Outbound, CompactionTriggerItem>;
|
|
21
|
+
export declare function compactionTriggerItemToJSON(compactionTriggerItem: CompactionTriggerItem): string;
|
|
22
|
+
//# sourceMappingURL=compactiontriggeritem.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: c37e3c7c4bf6
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
export const CompactionTriggerItemType = {
|
|
7
|
+
CompactionTrigger: "compaction_trigger",
|
|
8
|
+
};
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const CompactionTriggerItemType$outboundSchema = z.enum(CompactionTriggerItemType);
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const CompactionTriggerItem$outboundSchema = z.object({
|
|
13
|
+
type: CompactionTriggerItemType$outboundSchema,
|
|
14
|
+
});
|
|
15
|
+
export function compactionTriggerItemToJSON(compactionTriggerItem) {
|
|
16
|
+
return JSON.stringify(CompactionTriggerItem$outboundSchema.parse(compactionTriggerItem));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=compactiontriggeritem.js.map
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { DeferredToolsSearchStrategy, DeferredToolsSearchStrategy$Outbound } from "./deferredtoolssearchstrategy.js";
|
|
4
4
|
/**
|
|
5
|
-
* Loading profile.
|
|
5
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
6
6
|
*/
|
|
7
7
|
export declare const Profile: {
|
|
8
8
|
readonly Portable: "portable";
|
|
9
|
+
readonly Universal: "universal";
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
|
-
* Loading profile.
|
|
12
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
12
13
|
*/
|
|
13
|
-
export type Profile =
|
|
14
|
+
export type Profile = OpenEnum<typeof Profile>;
|
|
14
15
|
export declare const Protocol: {
|
|
15
16
|
readonly V1: "v1";
|
|
16
17
|
};
|
|
@@ -30,7 +31,7 @@ export type Validation = ClosedEnum<typeof Validation>;
|
|
|
30
31
|
*/
|
|
31
32
|
export type DeferredToolsControl = {
|
|
32
33
|
/**
|
|
33
|
-
* Loading profile.
|
|
34
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
34
35
|
*/
|
|
35
36
|
profile: Profile;
|
|
36
37
|
protocol: Protocol;
|
|
@@ -44,7 +45,7 @@ export type DeferredToolsControl = {
|
|
|
44
45
|
validation: Validation;
|
|
45
46
|
};
|
|
46
47
|
/** @internal */
|
|
47
|
-
export declare const Profile$outboundSchema: z.
|
|
48
|
+
export declare const Profile$outboundSchema: z.ZodType<string, Profile>;
|
|
48
49
|
/** @internal */
|
|
49
50
|
export declare const Protocol$outboundSchema: z.ZodEnum<typeof Protocol>;
|
|
50
51
|
/** @internal */
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* @generated-id: 117738d3058e
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import * as openEnums from "../types/enums.js";
|
|
6
7
|
import { DeferredToolsSearchStrategy$outboundSchema, } from "./deferredtoolssearchstrategy.js";
|
|
7
8
|
/**
|
|
8
|
-
* Loading profile.
|
|
9
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
9
10
|
*/
|
|
10
11
|
export const Profile = {
|
|
11
12
|
Portable: "portable",
|
|
13
|
+
Universal: "universal",
|
|
12
14
|
};
|
|
13
15
|
export const Protocol = {
|
|
14
16
|
V1: "v1",
|
|
@@ -20,7 +22,8 @@ export const Validation = {
|
|
|
20
22
|
Runtime: "runtime",
|
|
21
23
|
};
|
|
22
24
|
/** @internal */
|
|
23
|
-
export const Profile$outboundSchema =
|
|
25
|
+
export const Profile$outboundSchema = openEnums
|
|
26
|
+
.outboundSchema(Profile);
|
|
24
27
|
/** @internal */
|
|
25
28
|
export const Protocol$outboundSchema = z.enum(Protocol);
|
|
26
29
|
/** @internal */
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Totals across every upstream model call of a deferred-tools run. The native usage fields report only the final call; cost covers every call.
|
|
6
|
+
*/
|
|
7
|
+
export type DeferredToolsDetails = {
|
|
8
|
+
/**
|
|
9
|
+
* Completion tokens summed over every upstream call
|
|
10
|
+
*/
|
|
11
|
+
completionTokens: number;
|
|
12
|
+
/**
|
|
13
|
+
* Prompt tokens summed over every upstream call
|
|
14
|
+
*/
|
|
15
|
+
promptTokens: number;
|
|
16
|
+
/**
|
|
17
|
+
* Sum of the above two fields
|
|
18
|
+
*/
|
|
19
|
+
totalTokens: number;
|
|
20
|
+
/**
|
|
21
|
+
* Upstream model calls the run made
|
|
22
|
+
*/
|
|
23
|
+
turns: number;
|
|
24
|
+
};
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare const DeferredToolsDetails$inboundSchema: z.ZodType<DeferredToolsDetails, unknown>;
|
|
27
|
+
export declare function deferredToolsDetailsFromJSON(jsonString: string): SafeParseResult<DeferredToolsDetails, SDKValidationError>;
|
|
28
|
+
//# sourceMappingURL=deferredtoolsdetails.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: be880e934c3b
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const DeferredToolsDetails$inboundSchema = z.object({
|
|
10
|
+
completion_tokens: z.int(),
|
|
11
|
+
prompt_tokens: z.int(),
|
|
12
|
+
total_tokens: z.int(),
|
|
13
|
+
turns: z.int(),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
"completion_tokens": "completionTokens",
|
|
17
|
+
"prompt_tokens": "promptTokens",
|
|
18
|
+
"total_tokens": "totalTokens",
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export function deferredToolsDetailsFromJSON(jsonString) {
|
|
22
|
+
return safeParse(jsonString, (x) => DeferredToolsDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeferredToolsDetails' from JSON`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=deferredtoolsdetails.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -244,6 +244,7 @@ export * from "./codeinterpreterlogsoutput.js";
|
|
|
244
244
|
export * from "./codeinterpreterservertool.js";
|
|
245
245
|
export * from "./codexlocalshelltool.js";
|
|
246
246
|
export * from "./compactionitem.js";
|
|
247
|
+
export * from "./compactiontriggeritem.js";
|
|
247
248
|
export * from "./compoundfilter.js";
|
|
248
249
|
export * from "./computeruseservertool.js";
|
|
249
250
|
export * from "./configurationupdate.js";
|
|
@@ -318,6 +319,7 @@ export * from "./deferredbm25search.js";
|
|
|
318
319
|
export * from "./deferredcustomsearch.js";
|
|
319
320
|
export * from "./deferredregexsearch.js";
|
|
320
321
|
export * from "./deferredtoolscontrol.js";
|
|
322
|
+
export * from "./deferredtoolsdetails.js";
|
|
321
323
|
export * from "./deferredtoolssearchstrategy.js";
|
|
322
324
|
export * from "./deletebyokkeyresponse.js";
|
|
323
325
|
export * from "./deleteguardrailresponse.js";
|
|
@@ -588,6 +590,7 @@ export * from "./outputbashservertoolitem.js";
|
|
|
588
590
|
export * from "./outputbrowseruseservertoolitem.js";
|
|
589
591
|
export * from "./outputcodeinterpretercallitem.js";
|
|
590
592
|
export * from "./outputcodeinterpreterservertoolitem.js";
|
|
593
|
+
export * from "./outputcompactionitem.js";
|
|
591
594
|
export * from "./outputcomputercallitem.js";
|
|
592
595
|
export * from "./outputcustomtoolcallitem.js";
|
|
593
596
|
export * from "./outputdatetimeitem.js";
|
|
@@ -600,6 +603,7 @@ export * from "./outputimagegenerationcallitem.js";
|
|
|
600
603
|
export * from "./outputimagegenerationservertoolitem.js";
|
|
601
604
|
export * from "./outputitemapplypatchcall.js";
|
|
602
605
|
export * from "./outputitemcodeinterpretercall.js";
|
|
606
|
+
export * from "./outputitemcompaction.js";
|
|
603
607
|
export * from "./outputitemcustomtoolcall.js";
|
|
604
608
|
export * from "./outputitemfilesearchcall.js";
|
|
605
609
|
export * from "./outputitemfunctioncall.js";
|
package/esm/models/index.js
CHANGED
|
@@ -248,6 +248,7 @@ export * from "./codeinterpreterlogsoutput.js";
|
|
|
248
248
|
export * from "./codeinterpreterservertool.js";
|
|
249
249
|
export * from "./codexlocalshelltool.js";
|
|
250
250
|
export * from "./compactionitem.js";
|
|
251
|
+
export * from "./compactiontriggeritem.js";
|
|
251
252
|
export * from "./compoundfilter.js";
|
|
252
253
|
export * from "./computeruseservertool.js";
|
|
253
254
|
export * from "./configurationupdate.js";
|
|
@@ -322,6 +323,7 @@ export * from "./deferredbm25search.js";
|
|
|
322
323
|
export * from "./deferredcustomsearch.js";
|
|
323
324
|
export * from "./deferredregexsearch.js";
|
|
324
325
|
export * from "./deferredtoolscontrol.js";
|
|
326
|
+
export * from "./deferredtoolsdetails.js";
|
|
325
327
|
export * from "./deferredtoolssearchstrategy.js";
|
|
326
328
|
export * from "./deletebyokkeyresponse.js";
|
|
327
329
|
export * from "./deleteguardrailresponse.js";
|
|
@@ -592,6 +594,7 @@ export * from "./outputbashservertoolitem.js";
|
|
|
592
594
|
export * from "./outputbrowseruseservertoolitem.js";
|
|
593
595
|
export * from "./outputcodeinterpretercallitem.js";
|
|
594
596
|
export * from "./outputcodeinterpreterservertoolitem.js";
|
|
597
|
+
export * from "./outputcompactionitem.js";
|
|
595
598
|
export * from "./outputcomputercallitem.js";
|
|
596
599
|
export * from "./outputcustomtoolcallitem.js";
|
|
597
600
|
export * from "./outputdatetimeitem.js";
|
|
@@ -604,6 +607,7 @@ export * from "./outputimagegenerationcallitem.js";
|
|
|
604
607
|
export * from "./outputimagegenerationservertoolitem.js";
|
|
605
608
|
export * from "./outputitemapplypatchcall.js";
|
|
606
609
|
export * from "./outputitemcodeinterpretercall.js";
|
|
610
|
+
export * from "./outputitemcompaction.js";
|
|
607
611
|
export * from "./outputitemcustomtoolcall.js";
|
|
608
612
|
export * from "./outputitemfilesearchcall.js";
|
|
609
613
|
export * from "./outputitemfunctioncall.js";
|
|
@@ -5,6 +5,7 @@ import { AgentMessageItem, AgentMessageItem$Outbound } from "./agentmessageitem.
|
|
|
5
5
|
import { ApplyPatchCallItem, ApplyPatchCallItem$Outbound } from "./applypatchcallitem.js";
|
|
6
6
|
import { ApplyPatchCallOutputItem, ApplyPatchCallOutputItem$Outbound } from "./applypatchcalloutputitem.js";
|
|
7
7
|
import { CompactionItem, CompactionItem$Outbound } from "./compactionitem.js";
|
|
8
|
+
import { CompactionTriggerItem, CompactionTriggerItem$Outbound } from "./compactiontriggeritem.js";
|
|
8
9
|
import { ConfigurationUpdateItem, ConfigurationUpdateItem$Outbound } from "./configurationupdateitem.js";
|
|
9
10
|
import { ContextCompactionItem, ContextCompactionItem$Outbound } from "./contextcompactionitem.js";
|
|
10
11
|
import { CustomToolCallItem, CustomToolCallItem$Outbound } from "./customtoolcallitem.js";
|
|
@@ -137,11 +138,11 @@ export type InputsMessage = {
|
|
|
137
138
|
status?: InputsStatusCompleted1 | InputsStatusIncomplete1 | InputsStatusInProgress1 | undefined;
|
|
138
139
|
type?: InputsTypeMessage | undefined;
|
|
139
140
|
};
|
|
140
|
-
export type InputsUnion1 = OutputArmorBlockedItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | FunctionCallItem | ApplyPatchCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ToolSearchOutputItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | ToolSearchCallItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | OutputShellServerToolItem | CompactionItem | ItemReferenceItem | ConfigurationUpdateItem | EasyInputMessage | InputMessageItem | ContextCompactionItem;
|
|
141
|
+
export type InputsUnion1 = OutputArmorBlockedItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | FunctionCallItem | ApplyPatchCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ToolSearchOutputItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | ToolSearchCallItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | OutputShellServerToolItem | CompactionItem | ItemReferenceItem | ConfigurationUpdateItem | EasyInputMessage | InputMessageItem | CompactionTriggerItem | ContextCompactionItem;
|
|
141
142
|
/**
|
|
142
143
|
* Input for a response request - can be a string or array of items
|
|
143
144
|
*/
|
|
144
|
-
export type InputsUnion = string | Array<OutputArmorBlockedItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | FunctionCallItem | ApplyPatchCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ToolSearchOutputItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | ToolSearchCallItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | OutputShellServerToolItem | CompactionItem | ItemReferenceItem | ConfigurationUpdateItem | EasyInputMessage | InputMessageItem | ContextCompactionItem>;
|
|
145
|
+
export type InputsUnion = string | Array<OutputArmorBlockedItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | FunctionCallItem | ApplyPatchCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ToolSearchOutputItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | ToolSearchCallItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | OutputShellServerToolItem | CompactionItem | ItemReferenceItem | ConfigurationUpdateItem | EasyInputMessage | InputMessageItem | CompactionTriggerItem | ContextCompactionItem>;
|
|
145
146
|
/** @internal */
|
|
146
147
|
export declare const InputsStatusInProgress2$outboundSchema: z.ZodEnum<typeof InputsStatusInProgress2>;
|
|
147
148
|
/** @internal */
|
|
@@ -216,12 +217,12 @@ export type InputsMessage$Outbound = {
|
|
|
216
217
|
export declare const InputsMessage$outboundSchema: z.ZodType<InputsMessage$Outbound, InputsMessage>;
|
|
217
218
|
export declare function inputsMessageToJSON(inputsMessage: InputsMessage): string;
|
|
218
219
|
/** @internal */
|
|
219
|
-
export type InputsUnion1$Outbound = OutputArmorBlockedItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | FunctionCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ToolSearchOutputItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsMessage$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | OutputCodeInterpreterCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | ToolSearchCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | OutputShellServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | ConfigurationUpdateItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound;
|
|
220
|
+
export type InputsUnion1$Outbound = OutputArmorBlockedItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | FunctionCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ToolSearchOutputItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsMessage$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | OutputCodeInterpreterCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | ToolSearchCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | OutputShellServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | ConfigurationUpdateItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | CompactionTriggerItem$Outbound | ContextCompactionItem$Outbound;
|
|
220
221
|
/** @internal */
|
|
221
222
|
export declare const InputsUnion1$outboundSchema: z.ZodType<InputsUnion1$Outbound, InputsUnion1>;
|
|
222
223
|
export declare function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string;
|
|
223
224
|
/** @internal */
|
|
224
|
-
export type InputsUnion$Outbound = string | Array<OutputArmorBlockedItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | FunctionCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ToolSearchOutputItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsMessage$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | OutputCodeInterpreterCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | ToolSearchCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | OutputShellServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | ConfigurationUpdateItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound>;
|
|
225
|
+
export type InputsUnion$Outbound = string | Array<OutputArmorBlockedItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | FunctionCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ToolSearchOutputItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsMessage$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | OutputCodeInterpreterCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | ToolSearchCallItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | OutputShellServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | ConfigurationUpdateItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | CompactionTriggerItem$Outbound | ContextCompactionItem$Outbound>;
|
|
225
226
|
/** @internal */
|
|
226
227
|
export declare const InputsUnion$outboundSchema: z.ZodType<InputsUnion$Outbound, InputsUnion>;
|
|
227
228
|
export declare function inputsUnionToJSON(inputsUnion: InputsUnion): string;
|
|
@@ -9,6 +9,7 @@ import { AgentMessageItem$outboundSchema, } from "./agentmessageitem.js";
|
|
|
9
9
|
import { ApplyPatchCallItem$outboundSchema, } from "./applypatchcallitem.js";
|
|
10
10
|
import { ApplyPatchCallOutputItem$outboundSchema, } from "./applypatchcalloutputitem.js";
|
|
11
11
|
import { CompactionItem$outboundSchema, } from "./compactionitem.js";
|
|
12
|
+
import { CompactionTriggerItem$outboundSchema, } from "./compactiontriggeritem.js";
|
|
12
13
|
import { ConfigurationUpdateItem$outboundSchema, } from "./configurationupdateitem.js";
|
|
13
14
|
import { ContextCompactionItem$outboundSchema, } from "./contextcompactionitem.js";
|
|
14
15
|
import { CustomToolCallItem$outboundSchema, } from "./customtoolcallitem.js";
|
|
@@ -259,6 +260,7 @@ export const InputsUnion1$outboundSchema = z.union([
|
|
|
259
260
|
ConfigurationUpdateItem$outboundSchema,
|
|
260
261
|
EasyInputMessage$outboundSchema,
|
|
261
262
|
InputMessageItem$outboundSchema,
|
|
263
|
+
CompactionTriggerItem$outboundSchema,
|
|
262
264
|
ContextCompactionItem$outboundSchema,
|
|
263
265
|
]);
|
|
264
266
|
export function inputsUnion1ToJSON(inputsUnion1) {
|
|
@@ -319,6 +321,7 @@ export const InputsUnion$outboundSchema = z.union([
|
|
|
319
321
|
ConfigurationUpdateItem$outboundSchema,
|
|
320
322
|
EasyInputMessage$outboundSchema,
|
|
321
323
|
InputMessageItem$outboundSchema,
|
|
324
|
+
CompactionTriggerItem$outboundSchema,
|
|
322
325
|
ContextCompactionItem$outboundSchema,
|
|
323
326
|
])),
|
|
324
327
|
]);
|
|
@@ -12,6 +12,7 @@ import { CodeInterpreterServerTool } from "./codeinterpreterservertool.js";
|
|
|
12
12
|
import { CodexLocalShellTool } from "./codexlocalshelltool.js";
|
|
13
13
|
import { ComputerUseServerTool } from "./computeruseservertool.js";
|
|
14
14
|
import { CustomTool } from "./customtool.js";
|
|
15
|
+
import { DeferredToolsDetails } from "./deferredtoolsdetails.js";
|
|
15
16
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
16
17
|
import { FileSearchServerTool } from "./filesearchservertool.js";
|
|
17
18
|
import { ImageGenerationServerTool } from "./imagegenerationservertool.js";
|
|
@@ -122,6 +123,10 @@ export type Usage = {
|
|
|
122
123
|
*/
|
|
123
124
|
cost?: number | null | undefined;
|
|
124
125
|
costDetails?: UsageCostDetails | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Totals across every upstream model call of a deferred-tools run. The native usage fields report only the final call; cost covers every call.
|
|
128
|
+
*/
|
|
129
|
+
deferredToolsDetails?: DeferredToolsDetails | undefined;
|
|
125
130
|
/**
|
|
126
131
|
* Whether a request was made using a Bring Your Own Key configuration
|
|
127
132
|
*/
|
|
@@ -17,6 +17,7 @@ import { CodeInterpreterServerTool$inboundSchema, } from "./codeinterpreterserve
|
|
|
17
17
|
import { CodexLocalShellTool$inboundSchema, } from "./codexlocalshelltool.js";
|
|
18
18
|
import { ComputerUseServerTool$inboundSchema, } from "./computeruseservertool.js";
|
|
19
19
|
import { CustomTool$inboundSchema } from "./customtool.js";
|
|
20
|
+
import { DeferredToolsDetails$inboundSchema, } from "./deferredtoolsdetails.js";
|
|
20
21
|
import { FileSearchServerTool$inboundSchema, } from "./filesearchservertool.js";
|
|
21
22
|
import { ImageGenerationServerTool$inboundSchema, } from "./imagegenerationservertool.js";
|
|
22
23
|
import { IncompleteDetails$inboundSchema, } from "./incompletedetails.js";
|
|
@@ -145,6 +146,7 @@ export const Usage$inboundSchema = z.object({
|
|
|
145
146
|
total_tokens: z.int(),
|
|
146
147
|
cost: z.nullable(z.number()).optional(),
|
|
147
148
|
cost_details: z.lazy(() => UsageCostDetails$inboundSchema).optional(),
|
|
149
|
+
deferred_tools_details: DeferredToolsDetails$inboundSchema.optional(),
|
|
148
150
|
is_byok: z.boolean().optional(),
|
|
149
151
|
server_tool_use_details: z.nullable(ServerToolUseDetails$inboundSchema)
|
|
150
152
|
.optional(),
|
|
@@ -156,6 +158,7 @@ export const Usage$inboundSchema = z.object({
|
|
|
156
158
|
"output_tokens_details": "outputTokensDetails",
|
|
157
159
|
"total_tokens": "totalTokens",
|
|
158
160
|
"cost_details": "costDetails",
|
|
161
|
+
"deferred_tools_details": "deferredToolsDetails",
|
|
159
162
|
"is_byok": "isByok",
|
|
160
163
|
"server_tool_use_details": "serverToolUseDetails",
|
|
161
164
|
});
|
|
@@ -53,14 +53,15 @@ export type ListOrganizationMembersRequest = {
|
|
|
53
53
|
limit?: number | undefined;
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
56
|
-
* Role of the member in the organization
|
|
56
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
57
57
|
*/
|
|
58
58
|
export declare const Role: {
|
|
59
59
|
readonly OrgAdmin: "org:admin";
|
|
60
60
|
readonly OrgMember: "org:member";
|
|
61
|
+
readonly OrgViewer: "org:viewer";
|
|
61
62
|
};
|
|
62
63
|
/**
|
|
63
|
-
* Role of the member in the organization
|
|
64
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
64
65
|
*/
|
|
65
66
|
export type Role = OpenEnum<typeof Role>;
|
|
66
67
|
export type ListOrganizationMembersData = {
|
|
@@ -81,7 +82,7 @@ export type ListOrganizationMembersData = {
|
|
|
81
82
|
*/
|
|
82
83
|
lastName: string | null;
|
|
83
84
|
/**
|
|
84
|
-
* Role of the member in the organization
|
|
85
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
85
86
|
*/
|
|
86
87
|
role: Role;
|
|
87
88
|
};
|
|
@@ -7,11 +7,12 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import * as openEnums from "../../types/enums.js";
|
|
9
9
|
/**
|
|
10
|
-
* Role of the member in the organization
|
|
10
|
+
* Role of the member in the organization. `org:viewer` is coming soon and not yet available. Once launched, it has read-only organization access: it can view organization settings, billing and workspaces but not change them. Workspace roles can still grant write access in specific workspaces.
|
|
11
11
|
*/
|
|
12
12
|
export const Role = {
|
|
13
13
|
OrgAdmin: "org:admin",
|
|
14
14
|
OrgMember: "org:member",
|
|
15
|
+
OrgViewer: "org:viewer",
|
|
15
16
|
};
|
|
16
17
|
/** @internal */
|
|
17
18
|
export const ListOrganizationMembersRequest$outboundSchema = z.object({
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* A compaction output item carrying the encrypted summary of the compacted conversation. Emitted in reply to a `compaction_trigger` input item.
|
|
6
|
+
*/
|
|
7
|
+
export type OutputCompactionItem = {
|
|
8
|
+
createdBy?: string | undefined;
|
|
9
|
+
encryptedContent: string;
|
|
10
|
+
id: string;
|
|
11
|
+
type: "compaction";
|
|
12
|
+
};
|
|
13
|
+
/** @internal */
|
|
14
|
+
export declare const OutputCompactionItem$inboundSchema: z.ZodType<OutputCompactionItem, unknown>;
|
|
15
|
+
export declare function outputCompactionItemFromJSON(jsonString: string): SafeParseResult<OutputCompactionItem, SDKValidationError>;
|
|
16
|
+
//# sourceMappingURL=outputcompactionitem.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: fc7ae48602c5
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const OutputCompactionItem$inboundSchema = z.object({
|
|
10
|
+
created_by: z.string().optional(),
|
|
11
|
+
encrypted_content: z.string(),
|
|
12
|
+
id: z.string(),
|
|
13
|
+
type: z.literal("compaction"),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
"created_by": "createdBy",
|
|
17
|
+
"encrypted_content": "encryptedContent",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export function outputCompactionItemFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => OutputCompactionItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputCompactionItem' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=outputcompactionitem.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type OutputItemCompaction = {
|
|
5
|
+
createdBy?: string | undefined;
|
|
6
|
+
encryptedContent: string;
|
|
7
|
+
id: string;
|
|
8
|
+
type: "compaction";
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export declare const OutputItemCompaction$inboundSchema: z.ZodType<OutputItemCompaction, unknown>;
|
|
12
|
+
export declare function outputItemCompactionFromJSON(jsonString: string): SafeParseResult<OutputItemCompaction, SDKValidationError>;
|
|
13
|
+
//# sourceMappingURL=outputitemcompaction.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 51765cc422ec
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const OutputItemCompaction$inboundSchema = z.object({
|
|
10
|
+
created_by: z.string().optional(),
|
|
11
|
+
encrypted_content: z.string(),
|
|
12
|
+
id: z.string(),
|
|
13
|
+
type: z.literal("compaction"),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
"created_by": "createdBy",
|
|
17
|
+
"encrypted_content": "encryptedContent",
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
export function outputItemCompactionFromJSON(jsonString) {
|
|
21
|
+
return safeParse(jsonString, (x) => OutputItemCompaction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputItemCompaction' from JSON`);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=outputitemcompaction.js.map
|
|
@@ -10,6 +10,7 @@ import { OutputBashServerToolItem } from "./outputbashservertoolitem.js";
|
|
|
10
10
|
import { OutputBrowserUseServerToolItem } from "./outputbrowseruseservertoolitem.js";
|
|
11
11
|
import { OutputCodeInterpreterCallItem } from "./outputcodeinterpretercallitem.js";
|
|
12
12
|
import { OutputCodeInterpreterServerToolItem } from "./outputcodeinterpreterservertoolitem.js";
|
|
13
|
+
import { OutputCompactionItem } from "./outputcompactionitem.js";
|
|
13
14
|
import { OutputComputerCallItem } from "./outputcomputercallitem.js";
|
|
14
15
|
import { OutputCustomToolCallItem } from "./outputcustomtoolcallitem.js";
|
|
15
16
|
import { OutputDatetimeItem } from "./outputdatetimeitem.js";
|
|
@@ -40,7 +41,7 @@ import { OutputWebSearchServerToolItem } from "./outputwebsearchservertoolitem.j
|
|
|
40
41
|
*/
|
|
41
42
|
export type OutputItems = OutputApplyPatchCallItem | (OutputCodeInterpreterCallItem & {
|
|
42
43
|
type: "code_interpreter_call";
|
|
43
|
-
}) | (OutputComputerCallItem & {
|
|
44
|
+
}) | OutputCompactionItem | (OutputComputerCallItem & {
|
|
44
45
|
type: "computer_call";
|
|
45
46
|
}) | OutputCustomToolCallItem | (OutputFileSearchCallItem & {
|
|
46
47
|
type: "file_search_call";
|
|
@@ -13,6 +13,7 @@ import { OutputBashServerToolItem$inboundSchema, } from "./outputbashservertooli
|
|
|
13
13
|
import { OutputBrowserUseServerToolItem$inboundSchema, } from "./outputbrowseruseservertoolitem.js";
|
|
14
14
|
import { OutputCodeInterpreterCallItem$inboundSchema, } from "./outputcodeinterpretercallitem.js";
|
|
15
15
|
import { OutputCodeInterpreterServerToolItem$inboundSchema, } from "./outputcodeinterpreterservertoolitem.js";
|
|
16
|
+
import { OutputCompactionItem$inboundSchema, } from "./outputcompactionitem.js";
|
|
16
17
|
import { OutputComputerCallItem$inboundSchema, } from "./outputcomputercallitem.js";
|
|
17
18
|
import { OutputCustomToolCallItem$inboundSchema, } from "./outputcustomtoolcallitem.js";
|
|
18
19
|
import { OutputDatetimeItem$inboundSchema, } from "./outputdatetimeitem.js";
|
|
@@ -42,6 +43,7 @@ import { OutputWebSearchServerToolItem$inboundSchema, } from "./outputwebsearchs
|
|
|
42
43
|
export const OutputItems$inboundSchema = discriminatedUnion("type", {
|
|
43
44
|
apply_patch_call: OutputApplyPatchCallItem$inboundSchema,
|
|
44
45
|
code_interpreter_call: OutputCodeInterpreterCallItem$inboundSchema.and(z.object({ type: z.literal("code_interpreter_call") })),
|
|
46
|
+
compaction: OutputCompactionItem$inboundSchema,
|
|
45
47
|
computer_call: OutputComputerCallItem$inboundSchema.and(z.object({ type: z.literal("computer_call") })),
|
|
46
48
|
custom_tool_call: OutputCustomToolCallItem$inboundSchema,
|
|
47
49
|
file_search_call: OutputFileSearchCallItem$inboundSchema.and(z.object({ type: z.literal("file_search_call") })),
|
|
@@ -3,6 +3,16 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
5
|
import { FailableToolCallStatus } from "./failabletoolcallstatus.js";
|
|
6
|
+
/**
|
|
7
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
8
|
+
*/
|
|
9
|
+
export declare const OutputToolSearchServerToolItemFormat: {
|
|
10
|
+
readonly Compact: "compact";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
14
|
+
*/
|
|
15
|
+
export type OutputToolSearchServerToolItemFormat = ClosedEnum<typeof OutputToolSearchServerToolItemFormat>;
|
|
6
16
|
export type Match = {
|
|
7
17
|
definition: {
|
|
8
18
|
[k: string]: any;
|
|
@@ -18,17 +28,45 @@ export type OutputToolSearchServerToolItemType = ClosedEnum<typeof OutputToolSea
|
|
|
18
28
|
* An openrouter:tool_search server tool output item
|
|
19
29
|
*/
|
|
20
30
|
export type OutputToolSearchServerToolItem = {
|
|
31
|
+
/**
|
|
32
|
+
* The JSON arguments of the model call, verbatim. Replaying the item reuses them.
|
|
33
|
+
*/
|
|
34
|
+
arguments?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The ID of the model call that ran the search. Replaying the item reuses it.
|
|
37
|
+
*/
|
|
38
|
+
callId?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index.
|
|
41
|
+
*/
|
|
42
|
+
catalogIndex?: string | undefined;
|
|
21
43
|
/**
|
|
22
44
|
* The error message when the tool call failed before producing a result. Set together with `status: 'failed'`; absent on a successful call.
|
|
23
45
|
*/
|
|
24
46
|
error?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
49
|
+
*/
|
|
50
|
+
format?: OutputToolSearchServerToolItemFormat | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The guidance the model got when the search matched no tools.
|
|
53
|
+
*/
|
|
54
|
+
hint?: string | undefined;
|
|
25
55
|
id?: string | undefined;
|
|
26
56
|
matches?: Array<Match> | undefined;
|
|
27
57
|
query?: string | undefined;
|
|
28
58
|
status: FailableToolCallStatus;
|
|
59
|
+
/**
|
|
60
|
+
* The IDs of every tool call in the model response that ran the search, in order. Replaying the item keeps those calls in one turn.
|
|
61
|
+
*/
|
|
62
|
+
turnCallIds?: Array<string> | undefined;
|
|
29
63
|
type: OutputToolSearchServerToolItemType;
|
|
30
64
|
};
|
|
31
65
|
/** @internal */
|
|
66
|
+
export declare const OutputToolSearchServerToolItemFormat$inboundSchema: z.ZodEnum<typeof OutputToolSearchServerToolItemFormat>;
|
|
67
|
+
/** @internal */
|
|
68
|
+
export declare const OutputToolSearchServerToolItemFormat$outboundSchema: z.ZodEnum<typeof OutputToolSearchServerToolItemFormat>;
|
|
69
|
+
/** @internal */
|
|
32
70
|
export declare const Match$inboundSchema: z.ZodType<Match, unknown>;
|
|
33
71
|
/** @internal */
|
|
34
72
|
export type Match$Outbound = {
|
|
@@ -50,11 +88,17 @@ export declare const OutputToolSearchServerToolItemType$outboundSchema: z.ZodEnu
|
|
|
50
88
|
export declare const OutputToolSearchServerToolItem$inboundSchema: z.ZodType<OutputToolSearchServerToolItem, unknown>;
|
|
51
89
|
/** @internal */
|
|
52
90
|
export type OutputToolSearchServerToolItem$Outbound = {
|
|
91
|
+
arguments?: string | undefined;
|
|
92
|
+
call_id?: string | undefined;
|
|
93
|
+
catalog_index?: string | undefined;
|
|
53
94
|
error?: string | undefined;
|
|
95
|
+
format?: string | undefined;
|
|
96
|
+
hint?: string | undefined;
|
|
54
97
|
id?: string | undefined;
|
|
55
98
|
matches?: Array<Match$Outbound> | undefined;
|
|
56
99
|
query?: string | undefined;
|
|
57
100
|
status: string;
|
|
101
|
+
turn_call_ids?: Array<string> | undefined;
|
|
58
102
|
type: string;
|
|
59
103
|
};
|
|
60
104
|
/** @internal */
|
|
@@ -6,10 +6,20 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
8
|
import { FailableToolCallStatus$inboundSchema, FailableToolCallStatus$outboundSchema, } from "./failabletoolcallstatus.js";
|
|
9
|
+
/**
|
|
10
|
+
* How the model saw the matches. `compact` means each tool by name, description, and input shape, plus a call example. Replaying the item renders the same result.
|
|
11
|
+
*/
|
|
12
|
+
export const OutputToolSearchServerToolItemFormat = {
|
|
13
|
+
Compact: "compact",
|
|
14
|
+
};
|
|
9
15
|
export const OutputToolSearchServerToolItemType = {
|
|
10
16
|
OpenrouterToolSearch: "openrouter:tool_search",
|
|
11
17
|
};
|
|
12
18
|
/** @internal */
|
|
19
|
+
export const OutputToolSearchServerToolItemFormat$inboundSchema = z.enum(OutputToolSearchServerToolItemFormat);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const OutputToolSearchServerToolItemFormat$outboundSchema = OutputToolSearchServerToolItemFormat$inboundSchema;
|
|
22
|
+
/** @internal */
|
|
13
23
|
export const Match$inboundSchema = z.object({
|
|
14
24
|
definition: z.record(z.string(), z.any()),
|
|
15
25
|
schema_digest: z.string(),
|
|
@@ -43,21 +53,45 @@ export const OutputToolSearchServerToolItemType$inboundSchema = z.enum(OutputToo
|
|
|
43
53
|
export const OutputToolSearchServerToolItemType$outboundSchema = OutputToolSearchServerToolItemType$inboundSchema;
|
|
44
54
|
/** @internal */
|
|
45
55
|
export const OutputToolSearchServerToolItem$inboundSchema = z.object({
|
|
56
|
+
arguments: z.string().optional(),
|
|
57
|
+
call_id: z.string().optional(),
|
|
58
|
+
catalog_index: z.string().optional(),
|
|
46
59
|
error: z.string().optional(),
|
|
60
|
+
format: OutputToolSearchServerToolItemFormat$inboundSchema.optional(),
|
|
61
|
+
hint: z.string().optional(),
|
|
47
62
|
id: z.string().optional(),
|
|
48
63
|
matches: z.array(z.lazy(() => Match$inboundSchema)).optional(),
|
|
49
64
|
query: z.string().optional(),
|
|
50
65
|
status: FailableToolCallStatus$inboundSchema,
|
|
66
|
+
turn_call_ids: z.array(z.string()).optional(),
|
|
51
67
|
type: OutputToolSearchServerToolItemType$inboundSchema,
|
|
68
|
+
}).transform((v) => {
|
|
69
|
+
return remap$(v, {
|
|
70
|
+
"call_id": "callId",
|
|
71
|
+
"catalog_index": "catalogIndex",
|
|
72
|
+
"turn_call_ids": "turnCallIds",
|
|
73
|
+
});
|
|
52
74
|
});
|
|
53
75
|
/** @internal */
|
|
54
76
|
export const OutputToolSearchServerToolItem$outboundSchema = z.object({
|
|
77
|
+
arguments: z.string().optional(),
|
|
78
|
+
callId: z.string().optional(),
|
|
79
|
+
catalogIndex: z.string().optional(),
|
|
55
80
|
error: z.string().optional(),
|
|
81
|
+
format: OutputToolSearchServerToolItemFormat$outboundSchema.optional(),
|
|
82
|
+
hint: z.string().optional(),
|
|
56
83
|
id: z.string().optional(),
|
|
57
84
|
matches: z.array(z.lazy(() => Match$outboundSchema)).optional(),
|
|
58
85
|
query: z.string().optional(),
|
|
59
86
|
status: FailableToolCallStatus$outboundSchema,
|
|
87
|
+
turnCallIds: z.array(z.string()).optional(),
|
|
60
88
|
type: OutputToolSearchServerToolItemType$outboundSchema,
|
|
89
|
+
}).transform((v) => {
|
|
90
|
+
return remap$(v, {
|
|
91
|
+
callId: "call_id",
|
|
92
|
+
catalogIndex: "catalog_index",
|
|
93
|
+
turnCallIds: "turn_call_ids",
|
|
94
|
+
});
|
|
61
95
|
});
|
|
62
96
|
export function outputToolSearchServerToolItemToJSON(outputToolSearchServerToolItem) {
|
|
63
97
|
return JSON.stringify(OutputToolSearchServerToolItem$outboundSchema.parse(outputToolSearchServerToolItem));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.51",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
76
77
|
"test": "vitest --run --project unit",
|
|
77
|
-
"test:
|
|
78
|
-
"typecheck": "tsc --noEmit",
|
|
78
|
+
"test:transit": "exit 0",
|
|
79
79
|
"typecheck:transit": "exit 0",
|
|
80
|
-
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
81
80
|
"postinstall": "node scripts/check-types.js || true",
|
|
82
81
|
"prepare": "npm run build",
|
|
83
|
-
"test:
|
|
84
|
-
"test:watch": "vitest --watch --project unit"
|
|
82
|
+
"test:e2e": "vitest --run --project e2e",
|
|
83
|
+
"test:watch": "vitest --watch --project unit",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|