@openrouter/sdk 1.2.37 → 1.2.39
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/functioncallitem.d.ts +24 -0
- package/esm/models/functioncallitem.js +19 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/inputsunion.d.ts +5 -4
- package/esm/models/inputsunion.js +3 -0
- package/esm/models/openairesponsefunctiontoolcall.d.ts +17 -0
- package/esm/models/openairesponsefunctiontoolcall.js +12 -1
- package/esm/models/outputbashservertoolitem.d.ts +4 -4
- package/esm/models/outputbashservertoolitem.js +4 -4
- package/esm/models/outputfilesservertoolitem.d.ts +10 -0
- package/esm/models/outputfilesservertoolitem.js +6 -0
- package/esm/models/outputfunctioncallitem.d.ts +27 -0
- package/esm/models/outputfunctioncallitem.js +31 -1
- package/esm/models/outputitems.d.ts +3 -0
- package/esm/models/outputitems.js +2 -0
- package/esm/models/outputshellcallitem.d.ts +4 -0
- package/esm/models/outputshellcallitem.js +1 -0
- package/esm/models/outputshellcalloutputitem.d.ts +2 -27
- package/esm/models/outputshellcalloutputitem.js +2 -42
- package/esm/models/outputshellservertoolitem.d.ts +66 -0
- package/esm/models/outputshellservertoolitem.js +81 -0
- package/esm/models/outputsubagentservertoolitem.d.ts +5 -0
- package/esm/models/outputsubagentservertoolitem.js +4 -0
- package/esm/models/shellcallitem.d.ts +5 -0
- package/esm/models/shellcallitem.js +1 -0
- package/esm/models/shellcalloutputcontent.d.ts +74 -0
- package/esm/models/shellcalloutputcontent.js +109 -0
- package/esm/models/shellcalloutputitem.d.ts +3 -20
- package/esm/models/shellcalloutputitem.js +2 -19
- package/esm/models/subagentreasoning.d.ts +1 -1
- package/esm/models/subagentservertoolconfig.d.ts +11 -1
- package/esm/models/subagentservertoolconfig.js +4 -0
- package/jsr.json +1 -1
- package/package.json +7 -7
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "1.2.
|
|
52
|
+
readonly sdkVersion: "1.2.39";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.39 2.914.0 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "1.2.
|
|
29
|
+
sdkVersion: "1.2.39",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.2.39 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { ToolCallStatus } from "./toolcallstatus.js";
|
|
4
|
+
export type FunctionCallItemSubagentItem = {
|
|
5
|
+
type: string;
|
|
6
|
+
additionalProperties?: {
|
|
7
|
+
[k: string]: any;
|
|
8
|
+
} | undefined;
|
|
9
|
+
};
|
|
4
10
|
export declare const FunctionCallItemType: {
|
|
5
11
|
readonly FunctionCall: "function_call";
|
|
6
12
|
};
|
|
@@ -18,9 +24,25 @@ export type FunctionCallItem = {
|
|
|
18
24
|
*/
|
|
19
25
|
namespace?: string | undefined;
|
|
20
26
|
status?: ToolCallStatus | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.
|
|
29
|
+
*/
|
|
30
|
+
subagentId?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.
|
|
33
|
+
*/
|
|
34
|
+
subagentItems?: Array<FunctionCallItemSubagentItem> | undefined;
|
|
21
35
|
type: FunctionCallItemType;
|
|
22
36
|
};
|
|
23
37
|
/** @internal */
|
|
38
|
+
export type FunctionCallItemSubagentItem$Outbound = {
|
|
39
|
+
type: string;
|
|
40
|
+
[additionalProperties: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const FunctionCallItemSubagentItem$outboundSchema: z.ZodType<FunctionCallItemSubagentItem$Outbound, FunctionCallItemSubagentItem>;
|
|
44
|
+
export declare function functionCallItemSubagentItemToJSON(functionCallItemSubagentItem: FunctionCallItemSubagentItem): string;
|
|
45
|
+
/** @internal */
|
|
24
46
|
export declare const FunctionCallItemType$outboundSchema: z.ZodEnum<typeof FunctionCallItemType>;
|
|
25
47
|
/** @internal */
|
|
26
48
|
export type FunctionCallItem$Outbound = {
|
|
@@ -30,6 +52,8 @@ export type FunctionCallItem$Outbound = {
|
|
|
30
52
|
name: string;
|
|
31
53
|
namespace?: string | undefined;
|
|
32
54
|
status?: string | undefined;
|
|
55
|
+
subagent_id?: string | undefined;
|
|
56
|
+
subagent_items?: Array<FunctionCallItemSubagentItem$Outbound> | undefined;
|
|
33
57
|
type: string;
|
|
34
58
|
};
|
|
35
59
|
/** @internal */
|
|
@@ -9,6 +9,21 @@ export const FunctionCallItemType = {
|
|
|
9
9
|
FunctionCall: "function_call",
|
|
10
10
|
};
|
|
11
11
|
/** @internal */
|
|
12
|
+
export const FunctionCallItemSubagentItem$outboundSchema = z.object({
|
|
13
|
+
type: z.string(),
|
|
14
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return {
|
|
17
|
+
...v.additionalProperties,
|
|
18
|
+
...remap$(v, {
|
|
19
|
+
additionalProperties: null,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
export function functionCallItemSubagentItemToJSON(functionCallItemSubagentItem) {
|
|
24
|
+
return JSON.stringify(FunctionCallItemSubagentItem$outboundSchema.parse(functionCallItemSubagentItem));
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
12
27
|
export const FunctionCallItemType$outboundSchema = z.enum(FunctionCallItemType);
|
|
13
28
|
/** @internal */
|
|
14
29
|
export const FunctionCallItem$outboundSchema = z.object({
|
|
@@ -18,10 +33,14 @@ export const FunctionCallItem$outboundSchema = z.object({
|
|
|
18
33
|
name: z.string(),
|
|
19
34
|
namespace: z.string().optional(),
|
|
20
35
|
status: ToolCallStatus$outboundSchema.optional(),
|
|
36
|
+
subagentId: z.string().optional(),
|
|
37
|
+
subagentItems: z.array(z.lazy(() => FunctionCallItemSubagentItem$outboundSchema)).optional(),
|
|
21
38
|
type: FunctionCallItemType$outboundSchema,
|
|
22
39
|
}).transform((v) => {
|
|
23
40
|
return remap$(v, {
|
|
24
41
|
callId: "call_id",
|
|
42
|
+
subagentId: "subagent_id",
|
|
43
|
+
subagentItems: "subagent_items",
|
|
25
44
|
});
|
|
26
45
|
});
|
|
27
46
|
export function functionCallItemToJSON(functionCallItem) {
|
package/esm/models/index.d.ts
CHANGED
|
@@ -413,6 +413,7 @@ export * from "./outputreasoningitem.js";
|
|
|
413
413
|
export * from "./outputsearchmodelsservertoolitem.js";
|
|
414
414
|
export * from "./outputshellcallitem.js";
|
|
415
415
|
export * from "./outputshellcalloutputitem.js";
|
|
416
|
+
export * from "./outputshellservertoolitem.js";
|
|
416
417
|
export * from "./outputsubagentservertoolitem.js";
|
|
417
418
|
export * from "./outputtexteditorservertoolitem.js";
|
|
418
419
|
export * from "./outputtoolsearchservertoolitem.js";
|
|
@@ -504,6 +505,7 @@ export * from "./sessioncostitem.js";
|
|
|
504
505
|
export * from "./sessioncostmeta.js";
|
|
505
506
|
export * from "./sessioncostresponse.js";
|
|
506
507
|
export * from "./shellcallitem.js";
|
|
508
|
+
export * from "./shellcalloutputcontent.js";
|
|
507
509
|
export * from "./shellcalloutputitem.js";
|
|
508
510
|
export * from "./shellcallstatus.js";
|
|
509
511
|
export * from "./shellservertool.js";
|
package/esm/models/index.js
CHANGED
|
@@ -417,6 +417,7 @@ export * from "./outputreasoningitem.js";
|
|
|
417
417
|
export * from "./outputsearchmodelsservertoolitem.js";
|
|
418
418
|
export * from "./outputshellcallitem.js";
|
|
419
419
|
export * from "./outputshellcalloutputitem.js";
|
|
420
|
+
export * from "./outputshellservertoolitem.js";
|
|
420
421
|
export * from "./outputsubagentservertoolitem.js";
|
|
421
422
|
export * from "./outputtexteditorservertoolitem.js";
|
|
422
423
|
export * from "./outputtoolsearchservertoolitem.js";
|
|
@@ -508,6 +509,7 @@ export * from "./sessioncostitem.js";
|
|
|
508
509
|
export * from "./sessioncostmeta.js";
|
|
509
510
|
export * from "./sessioncostresponse.js";
|
|
510
511
|
export * from "./shellcallitem.js";
|
|
512
|
+
export * from "./shellcalloutputcontent.js";
|
|
511
513
|
export * from "./shellcalloutputitem.js";
|
|
512
514
|
export * from "./shellcallstatus.js";
|
|
513
515
|
export * from "./shellservertool.js";
|
|
@@ -39,6 +39,7 @@ import { OutputImageGenerationServerToolItem, OutputImageGenerationServerToolIte
|
|
|
39
39
|
import { OutputMcpServerToolItem, OutputMcpServerToolItem$Outbound } from "./outputmcpservertoolitem.js";
|
|
40
40
|
import { OutputMemoryServerToolItem, OutputMemoryServerToolItem$Outbound } from "./outputmemoryservertoolitem.js";
|
|
41
41
|
import { OutputSearchModelsServerToolItem, OutputSearchModelsServerToolItem$Outbound } from "./outputsearchmodelsservertoolitem.js";
|
|
42
|
+
import { OutputShellServerToolItem, OutputShellServerToolItem$Outbound } from "./outputshellservertoolitem.js";
|
|
42
43
|
import { OutputSubagentServerToolItem, OutputSubagentServerToolItem$Outbound } from "./outputsubagentservertoolitem.js";
|
|
43
44
|
import { OutputTextEditorServerToolItem, OutputTextEditorServerToolItem$Outbound } from "./outputtexteditorservertoolitem.js";
|
|
44
45
|
import { OutputToolSearchServerToolItem, OutputToolSearchServerToolItem$Outbound } from "./outputtoolsearchservertoolitem.js";
|
|
@@ -134,11 +135,11 @@ export type InputsMessage = {
|
|
|
134
135
|
status?: InputsStatusCompleted1 | InputsStatusIncomplete1 | InputsStatusInProgress1 | undefined;
|
|
135
136
|
type?: InputsTypeMessage | undefined;
|
|
136
137
|
};
|
|
137
|
-
export type InputsUnion1 = FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem;
|
|
138
|
+
export type InputsUnion1 = FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | OutputShellServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem;
|
|
138
139
|
/**
|
|
139
140
|
* Input for a response request - can be a string or array of items
|
|
140
141
|
*/
|
|
141
|
-
export type InputsUnion = string | Array<FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem>;
|
|
142
|
+
export type InputsUnion = string | Array<FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsMessage | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | OutputCodeInterpreterCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | OutputShellServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem>;
|
|
142
143
|
/** @internal */
|
|
143
144
|
export declare const InputsStatusInProgress2$outboundSchema: z.ZodEnum<typeof InputsStatusInProgress2>;
|
|
144
145
|
/** @internal */
|
|
@@ -213,12 +214,12 @@ export type InputsMessage$Outbound = {
|
|
|
213
214
|
export declare const InputsMessage$outboundSchema: z.ZodType<InputsMessage$Outbound, InputsMessage>;
|
|
214
215
|
export declare function inputsMessageToJSON(inputsMessage: InputsMessage): string;
|
|
215
216
|
/** @internal */
|
|
216
|
-
export type InputsUnion1$Outbound = FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$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 | 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 | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound;
|
|
217
|
+
export type InputsUnion1$Outbound = FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$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 | 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 | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound;
|
|
217
218
|
/** @internal */
|
|
218
219
|
export declare const InputsUnion1$outboundSchema: z.ZodType<InputsUnion1$Outbound, InputsUnion1>;
|
|
219
220
|
export declare function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string;
|
|
220
221
|
/** @internal */
|
|
221
|
-
export type InputsUnion$Outbound = string | Array<FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$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 | 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 | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound>;
|
|
222
|
+
export type InputsUnion$Outbound = string | Array<FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$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 | 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 | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound>;
|
|
222
223
|
/** @internal */
|
|
223
224
|
export declare const InputsUnion$outboundSchema: z.ZodType<InputsUnion$Outbound, InputsUnion>;
|
|
224
225
|
export declare function inputsUnionToJSON(inputsUnion: InputsUnion): string;
|
|
@@ -43,6 +43,7 @@ import { OutputImageGenerationServerToolItem$outboundSchema, } from "./outputima
|
|
|
43
43
|
import { OutputMcpServerToolItem$outboundSchema, } from "./outputmcpservertoolitem.js";
|
|
44
44
|
import { OutputMemoryServerToolItem$outboundSchema, } from "./outputmemoryservertoolitem.js";
|
|
45
45
|
import { OutputSearchModelsServerToolItem$outboundSchema, } from "./outputsearchmodelsservertoolitem.js";
|
|
46
|
+
import { OutputShellServerToolItem$outboundSchema, } from "./outputshellservertoolitem.js";
|
|
46
47
|
import { OutputSubagentServerToolItem$outboundSchema, } from "./outputsubagentservertoolitem.js";
|
|
47
48
|
import { OutputTextEditorServerToolItem$outboundSchema, } from "./outputtexteditorservertoolitem.js";
|
|
48
49
|
import { OutputToolSearchServerToolItem$outboundSchema, } from "./outputtoolsearchservertoolitem.js";
|
|
@@ -249,6 +250,7 @@ export const InputsUnion1$outboundSchema = z.union([
|
|
|
249
250
|
OutputAdvisorServerToolItem$outboundSchema,
|
|
250
251
|
OutputSubagentServerToolItem$outboundSchema,
|
|
251
252
|
OutputFilesServerToolItem$outboundSchema,
|
|
253
|
+
OutputShellServerToolItem$outboundSchema,
|
|
252
254
|
CompactionItem$outboundSchema,
|
|
253
255
|
ItemReferenceItem$outboundSchema,
|
|
254
256
|
EasyInputMessage$outboundSchema,
|
|
@@ -306,6 +308,7 @@ export const InputsUnion$outboundSchema = z.union([
|
|
|
306
308
|
OutputAdvisorServerToolItem$outboundSchema,
|
|
307
309
|
OutputSubagentServerToolItem$outboundSchema,
|
|
308
310
|
OutputFilesServerToolItem$outboundSchema,
|
|
311
|
+
OutputShellServerToolItem$outboundSchema,
|
|
309
312
|
CompactionItem$outboundSchema,
|
|
310
313
|
ItemReferenceItem$outboundSchema,
|
|
311
314
|
EasyInputMessage$outboundSchema,
|
|
@@ -3,6 +3,12 @@ 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 { ToolCallStatus } from "./toolcallstatus.js";
|
|
6
|
+
export type OpenAIResponseFunctionToolCallSubagentItem = {
|
|
7
|
+
type: string;
|
|
8
|
+
additionalProperties?: {
|
|
9
|
+
[k: string]: any;
|
|
10
|
+
} | undefined;
|
|
11
|
+
};
|
|
6
12
|
export declare const OpenAIResponseFunctionToolCallType: {
|
|
7
13
|
readonly FunctionCall: "function_call";
|
|
8
14
|
};
|
|
@@ -17,9 +23,20 @@ export type OpenAIResponseFunctionToolCall = {
|
|
|
17
23
|
*/
|
|
18
24
|
namespace?: string | undefined;
|
|
19
25
|
status?: ToolCallStatus | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.
|
|
28
|
+
*/
|
|
29
|
+
subagentId?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.
|
|
32
|
+
*/
|
|
33
|
+
subagentItems?: Array<OpenAIResponseFunctionToolCallSubagentItem> | undefined;
|
|
20
34
|
type: OpenAIResponseFunctionToolCallType;
|
|
21
35
|
};
|
|
22
36
|
/** @internal */
|
|
37
|
+
export declare const OpenAIResponseFunctionToolCallSubagentItem$inboundSchema: z.ZodType<OpenAIResponseFunctionToolCallSubagentItem, unknown>;
|
|
38
|
+
export declare function openAIResponseFunctionToolCallSubagentItemFromJSON(jsonString: string): SafeParseResult<OpenAIResponseFunctionToolCallSubagentItem, SDKValidationError>;
|
|
39
|
+
/** @internal */
|
|
23
40
|
export declare const OpenAIResponseFunctionToolCallType$inboundSchema: z.ZodEnum<typeof OpenAIResponseFunctionToolCallType>;
|
|
24
41
|
/** @internal */
|
|
25
42
|
export declare const OpenAIResponseFunctionToolCall$inboundSchema: z.ZodType<OpenAIResponseFunctionToolCall, unknown>;
|
|
@@ -4,12 +4,19 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js";
|
|
8
8
|
import { ToolCallStatus$inboundSchema, } from "./toolcallstatus.js";
|
|
9
9
|
export const OpenAIResponseFunctionToolCallType = {
|
|
10
10
|
FunctionCall: "function_call",
|
|
11
11
|
};
|
|
12
12
|
/** @internal */
|
|
13
|
+
export const OpenAIResponseFunctionToolCallSubagentItem$inboundSchema = collectExtraKeys$(z.object({
|
|
14
|
+
type: z.string(),
|
|
15
|
+
}).catchall(z.any()), "additionalProperties", true);
|
|
16
|
+
export function openAIResponseFunctionToolCallSubagentItemFromJSON(jsonString) {
|
|
17
|
+
return safeParse(jsonString, (x) => OpenAIResponseFunctionToolCallSubagentItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIResponseFunctionToolCallSubagentItem' from JSON`);
|
|
18
|
+
}
|
|
19
|
+
/** @internal */
|
|
13
20
|
export const OpenAIResponseFunctionToolCallType$inboundSchema = z.enum(OpenAIResponseFunctionToolCallType);
|
|
14
21
|
/** @internal */
|
|
15
22
|
export const OpenAIResponseFunctionToolCall$inboundSchema = z.object({
|
|
@@ -19,10 +26,14 @@ export const OpenAIResponseFunctionToolCall$inboundSchema = z.object({
|
|
|
19
26
|
name: z.string(),
|
|
20
27
|
namespace: z.string().optional(),
|
|
21
28
|
status: ToolCallStatus$inboundSchema.optional(),
|
|
29
|
+
subagent_id: z.string().optional(),
|
|
30
|
+
subagent_items: z.array(z.lazy(() => OpenAIResponseFunctionToolCallSubagentItem$inboundSchema)).optional(),
|
|
22
31
|
type: OpenAIResponseFunctionToolCallType$inboundSchema,
|
|
23
32
|
}).transform((v) => {
|
|
24
33
|
return remap$(v, {
|
|
25
34
|
"call_id": "callId",
|
|
35
|
+
"subagent_id": "subagentId",
|
|
36
|
+
"subagent_items": "subagentItems",
|
|
26
37
|
});
|
|
27
38
|
});
|
|
28
39
|
export function openAIResponseFunctionToolCallFromJSON(jsonString) {
|
|
@@ -14,11 +14,11 @@ export type OutputBashServerToolItem = {
|
|
|
14
14
|
/**
|
|
15
15
|
* The raw tool-call arguments string as emitted by the model.
|
|
16
16
|
*/
|
|
17
|
-
arguments?: string | undefined;
|
|
17
|
+
arguments?: string | null | undefined;
|
|
18
18
|
/**
|
|
19
19
|
* The model-generated tool call id from the originating turn.
|
|
20
20
|
*/
|
|
21
|
-
callId?: string | undefined;
|
|
21
|
+
callId?: string | null | undefined;
|
|
22
22
|
command?: string | undefined;
|
|
23
23
|
exitCode?: number | undefined;
|
|
24
24
|
id?: string | undefined;
|
|
@@ -35,8 +35,8 @@ export declare const OutputBashServerToolItemType$outboundSchema: z.ZodEnum<type
|
|
|
35
35
|
export declare const OutputBashServerToolItem$inboundSchema: z.ZodType<OutputBashServerToolItem, unknown>;
|
|
36
36
|
/** @internal */
|
|
37
37
|
export type OutputBashServerToolItem$Outbound = {
|
|
38
|
-
arguments?: string | undefined;
|
|
39
|
-
call_id?: string | undefined;
|
|
38
|
+
arguments?: string | null | undefined;
|
|
39
|
+
call_id?: string | null | undefined;
|
|
40
40
|
command?: string | undefined;
|
|
41
41
|
exitCode?: number | undefined;
|
|
42
42
|
id?: string | undefined;
|
|
@@ -15,8 +15,8 @@ export const OutputBashServerToolItemType$inboundSchema = z.enum(OutputBashServe
|
|
|
15
15
|
export const OutputBashServerToolItemType$outboundSchema = OutputBashServerToolItemType$inboundSchema;
|
|
16
16
|
/** @internal */
|
|
17
17
|
export const OutputBashServerToolItem$inboundSchema = z.object({
|
|
18
|
-
arguments: z.string().optional(),
|
|
19
|
-
call_id: z.string().optional(),
|
|
18
|
+
arguments: z.nullable(z.string()).optional(),
|
|
19
|
+
call_id: z.nullable(z.string()).optional(),
|
|
20
20
|
command: z.string().optional(),
|
|
21
21
|
exitCode: z.int().optional(),
|
|
22
22
|
id: z.string().optional(),
|
|
@@ -31,8 +31,8 @@ export const OutputBashServerToolItem$inboundSchema = z.object({
|
|
|
31
31
|
});
|
|
32
32
|
/** @internal */
|
|
33
33
|
export const OutputBashServerToolItem$outboundSchema = z.object({
|
|
34
|
-
arguments: z.string().optional(),
|
|
35
|
-
callId: z.string().optional(),
|
|
34
|
+
arguments: z.nullable(z.string()).optional(),
|
|
35
|
+
callId: z.nullable(z.string()).optional(),
|
|
36
36
|
command: z.string().optional(),
|
|
37
37
|
exitCode: z.int().optional(),
|
|
38
38
|
id: z.string().optional(),
|
|
@@ -11,6 +11,14 @@ export type OutputFilesServerToolItemType = ClosedEnum<typeof OutputFilesServerT
|
|
|
11
11
|
* An openrouter:files server tool output item
|
|
12
12
|
*/
|
|
13
13
|
export type OutputFilesServerToolItem = {
|
|
14
|
+
/**
|
|
15
|
+
* The raw tool-call arguments string as emitted by the model.
|
|
16
|
+
*/
|
|
17
|
+
arguments?: string | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The model-generated tool call id from the originating turn.
|
|
20
|
+
*/
|
|
21
|
+
callId?: string | null | undefined;
|
|
14
22
|
/**
|
|
15
23
|
* Error message when the file operation failed.
|
|
16
24
|
*/
|
|
@@ -43,6 +51,8 @@ export declare const OutputFilesServerToolItemType$outboundSchema: z.ZodEnum<typ
|
|
|
43
51
|
export declare const OutputFilesServerToolItem$inboundSchema: z.ZodType<OutputFilesServerToolItem, unknown>;
|
|
44
52
|
/** @internal */
|
|
45
53
|
export type OutputFilesServerToolItem$Outbound = {
|
|
54
|
+
arguments?: string | null | undefined;
|
|
55
|
+
call_id?: string | null | undefined;
|
|
46
56
|
error?: string | undefined;
|
|
47
57
|
file_id?: string | undefined;
|
|
48
58
|
filename?: string | undefined;
|
|
@@ -15,6 +15,8 @@ export const OutputFilesServerToolItemType$inboundSchema = z.enum(OutputFilesSer
|
|
|
15
15
|
export const OutputFilesServerToolItemType$outboundSchema = OutputFilesServerToolItemType$inboundSchema;
|
|
16
16
|
/** @internal */
|
|
17
17
|
export const OutputFilesServerToolItem$inboundSchema = z.object({
|
|
18
|
+
arguments: z.nullable(z.string()).optional(),
|
|
19
|
+
call_id: z.nullable(z.string()).optional(),
|
|
18
20
|
error: z.string().optional(),
|
|
19
21
|
file_id: z.string().optional(),
|
|
20
22
|
filename: z.string().optional(),
|
|
@@ -25,11 +27,14 @@ export const OutputFilesServerToolItem$inboundSchema = z.object({
|
|
|
25
27
|
type: OutputFilesServerToolItemType$inboundSchema,
|
|
26
28
|
}).transform((v) => {
|
|
27
29
|
return remap$(v, {
|
|
30
|
+
"call_id": "callId",
|
|
28
31
|
"file_id": "fileId",
|
|
29
32
|
});
|
|
30
33
|
});
|
|
31
34
|
/** @internal */
|
|
32
35
|
export const OutputFilesServerToolItem$outboundSchema = z.object({
|
|
36
|
+
arguments: z.nullable(z.string()).optional(),
|
|
37
|
+
callId: z.nullable(z.string()).optional(),
|
|
33
38
|
error: z.string().optional(),
|
|
34
39
|
fileId: z.string().optional(),
|
|
35
40
|
filename: z.string().optional(),
|
|
@@ -40,6 +45,7 @@ export const OutputFilesServerToolItem$outboundSchema = z.object({
|
|
|
40
45
|
type: OutputFilesServerToolItemType$outboundSchema,
|
|
41
46
|
}).transform((v) => {
|
|
42
47
|
return remap$(v, {
|
|
48
|
+
callId: "call_id",
|
|
43
49
|
fileId: "file_id",
|
|
44
50
|
});
|
|
45
51
|
});
|
|
@@ -19,6 +19,12 @@ export declare const OutputFunctionCallItemType: {
|
|
|
19
19
|
readonly FunctionCall: "function_call";
|
|
20
20
|
};
|
|
21
21
|
export type OutputFunctionCallItemType = ClosedEnum<typeof OutputFunctionCallItemType>;
|
|
22
|
+
export type OutputFunctionCallItemSubagentItem = {
|
|
23
|
+
type: string;
|
|
24
|
+
additionalProperties?: {
|
|
25
|
+
[k: string]: any;
|
|
26
|
+
} | undefined;
|
|
27
|
+
};
|
|
22
28
|
export type OutputFunctionCallItem = {
|
|
23
29
|
arguments: string;
|
|
24
30
|
callId: string;
|
|
@@ -30,6 +36,14 @@ export type OutputFunctionCallItem = {
|
|
|
30
36
|
namespace?: string | undefined;
|
|
31
37
|
status?: OutputFunctionCallItemStatusCompleted | OutputFunctionCallItemStatusIncomplete | OutputFunctionCallItemStatusInProgress | undefined;
|
|
32
38
|
type: OutputFunctionCallItemType;
|
|
39
|
+
/**
|
|
40
|
+
* EXPERIMENTAL — subject to change without notice. String id that matches the `call_id` of the `openrouter:subagent` server tool call that spawned the subagent. Present on every `function_call` item the subagent projects; absent on ordinary function calls.
|
|
41
|
+
*/
|
|
42
|
+
subagentId?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* EXPERIMENTAL — subject to change without notice. The subagent's output items produced on this turn. Treat this as an opaque object; you must replay it in the request so that the subagent can continue execution of the tool with the same context. If a subagent created multiple parallel tool calls, only the first tool call will have this field. The other tool calls will only have `subagent_id`. Present only if the tool call originates from a subagent spawned by the `openrouter:subagent` server tool.
|
|
45
|
+
*/
|
|
46
|
+
subagentItems?: Array<OutputFunctionCallItemSubagentItem> | undefined;
|
|
33
47
|
};
|
|
34
48
|
/** @internal */
|
|
35
49
|
export declare const OutputFunctionCallItemStatusInProgress$inboundSchema: z.ZodEnum<typeof OutputFunctionCallItemStatusInProgress>;
|
|
@@ -56,6 +70,17 @@ export declare const OutputFunctionCallItemType$inboundSchema: z.ZodEnum<typeof
|
|
|
56
70
|
/** @internal */
|
|
57
71
|
export declare const OutputFunctionCallItemType$outboundSchema: z.ZodEnum<typeof OutputFunctionCallItemType>;
|
|
58
72
|
/** @internal */
|
|
73
|
+
export declare const OutputFunctionCallItemSubagentItem$inboundSchema: z.ZodType<OutputFunctionCallItemSubagentItem, unknown>;
|
|
74
|
+
/** @internal */
|
|
75
|
+
export type OutputFunctionCallItemSubagentItem$Outbound = {
|
|
76
|
+
type: string;
|
|
77
|
+
[additionalProperties: string]: unknown;
|
|
78
|
+
};
|
|
79
|
+
/** @internal */
|
|
80
|
+
export declare const OutputFunctionCallItemSubagentItem$outboundSchema: z.ZodType<OutputFunctionCallItemSubagentItem$Outbound, OutputFunctionCallItemSubagentItem>;
|
|
81
|
+
export declare function outputFunctionCallItemSubagentItemToJSON(outputFunctionCallItemSubagentItem: OutputFunctionCallItemSubagentItem): string;
|
|
82
|
+
export declare function outputFunctionCallItemSubagentItemFromJSON(jsonString: string): SafeParseResult<OutputFunctionCallItemSubagentItem, SDKValidationError>;
|
|
83
|
+
/** @internal */
|
|
59
84
|
export declare const OutputFunctionCallItem$inboundSchema: z.ZodType<OutputFunctionCallItem, unknown>;
|
|
60
85
|
/** @internal */
|
|
61
86
|
export type OutputFunctionCallItem$Outbound = {
|
|
@@ -66,6 +91,8 @@ export type OutputFunctionCallItem$Outbound = {
|
|
|
66
91
|
namespace?: string | undefined;
|
|
67
92
|
status?: string | string | string | undefined;
|
|
68
93
|
type: string;
|
|
94
|
+
subagent_id?: string | undefined;
|
|
95
|
+
subagent_items?: Array<OutputFunctionCallItemSubagentItem$Outbound> | undefined;
|
|
69
96
|
};
|
|
70
97
|
/** @internal */
|
|
71
98
|
export declare const OutputFunctionCallItem$outboundSchema: z.ZodType<OutputFunctionCallItem$Outbound, OutputFunctionCallItem>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { collectExtraKeys as collectExtraKeys$, safeParse, } from "../lib/schemas.js";
|
|
8
8
|
export const OutputFunctionCallItemStatusInProgress = {
|
|
9
9
|
InProgress: "in_progress",
|
|
10
10
|
};
|
|
@@ -52,6 +52,28 @@ export const OutputFunctionCallItemType$inboundSchema = z.enum(OutputFunctionCal
|
|
|
52
52
|
/** @internal */
|
|
53
53
|
export const OutputFunctionCallItemType$outboundSchema = OutputFunctionCallItemType$inboundSchema;
|
|
54
54
|
/** @internal */
|
|
55
|
+
export const OutputFunctionCallItemSubagentItem$inboundSchema = collectExtraKeys$(z.object({
|
|
56
|
+
type: z.string(),
|
|
57
|
+
}).catchall(z.any()), "additionalProperties", true);
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const OutputFunctionCallItemSubagentItem$outboundSchema = z.object({
|
|
60
|
+
type: z.string(),
|
|
61
|
+
additionalProperties: z.record(z.string(), z.any()).optional(),
|
|
62
|
+
}).transform((v) => {
|
|
63
|
+
return {
|
|
64
|
+
...v.additionalProperties,
|
|
65
|
+
...remap$(v, {
|
|
66
|
+
additionalProperties: null,
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
export function outputFunctionCallItemSubagentItemToJSON(outputFunctionCallItemSubagentItem) {
|
|
71
|
+
return JSON.stringify(OutputFunctionCallItemSubagentItem$outboundSchema.parse(outputFunctionCallItemSubagentItem));
|
|
72
|
+
}
|
|
73
|
+
export function outputFunctionCallItemSubagentItemFromJSON(jsonString) {
|
|
74
|
+
return safeParse(jsonString, (x) => OutputFunctionCallItemSubagentItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OutputFunctionCallItemSubagentItem' from JSON`);
|
|
75
|
+
}
|
|
76
|
+
/** @internal */
|
|
55
77
|
export const OutputFunctionCallItem$inboundSchema = z.object({
|
|
56
78
|
arguments: z.string(),
|
|
57
79
|
call_id: z.string(),
|
|
@@ -64,9 +86,13 @@ export const OutputFunctionCallItem$inboundSchema = z.object({
|
|
|
64
86
|
OutputFunctionCallItemStatusInProgress$inboundSchema,
|
|
65
87
|
]).optional(),
|
|
66
88
|
type: OutputFunctionCallItemType$inboundSchema,
|
|
89
|
+
subagent_id: z.string().optional(),
|
|
90
|
+
subagent_items: z.array(z.lazy(() => OutputFunctionCallItemSubagentItem$inboundSchema)).optional(),
|
|
67
91
|
}).transform((v) => {
|
|
68
92
|
return remap$(v, {
|
|
69
93
|
"call_id": "callId",
|
|
94
|
+
"subagent_id": "subagentId",
|
|
95
|
+
"subagent_items": "subagentItems",
|
|
70
96
|
});
|
|
71
97
|
});
|
|
72
98
|
/** @internal */
|
|
@@ -82,9 +108,13 @@ export const OutputFunctionCallItem$outboundSchema = z.object({
|
|
|
82
108
|
OutputFunctionCallItemStatusInProgress$outboundSchema,
|
|
83
109
|
]).optional(),
|
|
84
110
|
type: OutputFunctionCallItemType$outboundSchema,
|
|
111
|
+
subagentId: z.string().optional(),
|
|
112
|
+
subagentItems: z.array(z.lazy(() => OutputFunctionCallItemSubagentItem$outboundSchema)).optional(),
|
|
85
113
|
}).transform((v) => {
|
|
86
114
|
return remap$(v, {
|
|
87
115
|
callId: "call_id",
|
|
116
|
+
subagentId: "subagent_id",
|
|
117
|
+
subagentItems: "subagent_items",
|
|
88
118
|
});
|
|
89
119
|
});
|
|
90
120
|
export function outputFunctionCallItemToJSON(outputFunctionCallItem) {
|
|
@@ -26,6 +26,7 @@ import { OutputReasoningItem } from "./outputreasoningitem.js";
|
|
|
26
26
|
import { OutputSearchModelsServerToolItem } from "./outputsearchmodelsservertoolitem.js";
|
|
27
27
|
import { OutputShellCallItem } from "./outputshellcallitem.js";
|
|
28
28
|
import { OutputShellCallOutputItem } from "./outputshellcalloutputitem.js";
|
|
29
|
+
import { OutputShellServerToolItem } from "./outputshellservertoolitem.js";
|
|
29
30
|
import { OutputSubagentServerToolItem } from "./outputsubagentservertoolitem.js";
|
|
30
31
|
import { OutputTextEditorServerToolItem } from "./outputtexteditorservertoolitem.js";
|
|
31
32
|
import { OutputToolSearchServerToolItem } from "./outputtoolsearchservertoolitem.js";
|
|
@@ -73,6 +74,8 @@ export type OutputItems = OutputApplyPatchCallItem | (OutputCodeInterpreterCallI
|
|
|
73
74
|
type: "openrouter:mcp";
|
|
74
75
|
}) | (OutputMemoryServerToolItem & {
|
|
75
76
|
type: "openrouter:memory";
|
|
77
|
+
}) | (OutputShellServerToolItem & {
|
|
78
|
+
type: "openrouter:shell";
|
|
76
79
|
}) | (OutputSubagentServerToolItem & {
|
|
77
80
|
type: "openrouter:subagent";
|
|
78
81
|
}) | (OutputTextEditorServerToolItem & {
|
|
@@ -29,6 +29,7 @@ import { OutputReasoningItem$inboundSchema, } from "./outputreasoningitem.js";
|
|
|
29
29
|
import { OutputSearchModelsServerToolItem$inboundSchema, } from "./outputsearchmodelsservertoolitem.js";
|
|
30
30
|
import { OutputShellCallItem$inboundSchema, } from "./outputshellcallitem.js";
|
|
31
31
|
import { OutputShellCallOutputItem$inboundSchema, } from "./outputshellcalloutputitem.js";
|
|
32
|
+
import { OutputShellServerToolItem$inboundSchema, } from "./outputshellservertoolitem.js";
|
|
32
33
|
import { OutputSubagentServerToolItem$inboundSchema, } from "./outputsubagentservertoolitem.js";
|
|
33
34
|
import { OutputTextEditorServerToolItem$inboundSchema, } from "./outputtexteditorservertoolitem.js";
|
|
34
35
|
import { OutputToolSearchServerToolItem$inboundSchema, } from "./outputtoolsearchservertoolitem.js";
|
|
@@ -61,6 +62,7 @@ export const OutputItems$inboundSchema = discriminatedUnion("type", {
|
|
|
61
62
|
["openrouter:image_generation"]: OutputImageGenerationServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
62
63
|
["openrouter:mcp"]: OutputMcpServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:mcp") })),
|
|
63
64
|
["openrouter:memory"]: OutputMemoryServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:memory") })),
|
|
65
|
+
["openrouter:shell"]: OutputShellServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:shell") })),
|
|
64
66
|
["openrouter:subagent"]: OutputSubagentServerToolItem$inboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
65
67
|
["openrouter:text_editor"]: OutputTextEditorServerToolItem$inboundSchema
|
|
66
68
|
.and(z.object({ type: z.literal("openrouter:text_editor") })),
|
|
@@ -12,6 +12,10 @@ export type OutputShellCallItemAction = {
|
|
|
12
12
|
*/
|
|
13
13
|
export type OutputShellCallItem = {
|
|
14
14
|
action?: OutputShellCallItemAction | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The raw tool-call arguments string as emitted by the model. Echo back unchanged when replaying history; used verbatim to preserve provider prompt-cache prefixes.
|
|
17
|
+
*/
|
|
18
|
+
arguments?: string | null | undefined;
|
|
15
19
|
callId: string;
|
|
16
20
|
id: string;
|
|
17
21
|
/**
|
|
@@ -23,6 +23,7 @@ export function outputShellCallItemActionFromJSON(jsonString) {
|
|
|
23
23
|
/** @internal */
|
|
24
24
|
export const OutputShellCallItem$inboundSchema = z.object({
|
|
25
25
|
action: z.lazy(() => OutputShellCallItemAction$inboundSchema).optional(),
|
|
26
|
+
arguments: z.nullable(z.string()).optional(),
|
|
26
27
|
call_id: z.string(),
|
|
27
28
|
id: z.string(),
|
|
28
29
|
status: ShellCallStatus$inboundSchema,
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
-
import * as discriminatedUnionTypes from "../types/discriminatedUnion.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { ShellCallOutputContent } from "./shellcalloutputcontent.js";
|
|
5
5
|
import { ShellCallStatus } from "./shellcallstatus.js";
|
|
6
|
-
export type OutcomeTimeout = {
|
|
7
|
-
type: "timeout";
|
|
8
|
-
};
|
|
9
|
-
export type OutcomeExit = {
|
|
10
|
-
exitCode: number;
|
|
11
|
-
type: "exit";
|
|
12
|
-
};
|
|
13
|
-
export type Outcome = OutcomeExit | OutcomeTimeout | discriminatedUnionTypes.Unknown<"type">;
|
|
14
|
-
export type OutputShellCallOutputItemOutput = {
|
|
15
|
-
outcome: OutcomeExit | OutcomeTimeout | discriminatedUnionTypes.Unknown<"type">;
|
|
16
|
-
stderr: string;
|
|
17
|
-
stdout: string;
|
|
18
|
-
};
|
|
19
6
|
/**
|
|
20
7
|
* A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome.
|
|
21
8
|
*/
|
|
@@ -23,7 +10,7 @@ export type OutputShellCallOutputItem = {
|
|
|
23
10
|
callId: string;
|
|
24
11
|
id: string;
|
|
25
12
|
maxOutputLength?: number | null | undefined;
|
|
26
|
-
output: Array<
|
|
13
|
+
output: Array<ShellCallOutputContent>;
|
|
27
14
|
/**
|
|
28
15
|
* Status of a shell call or its output.
|
|
29
16
|
*/
|
|
@@ -31,18 +18,6 @@ export type OutputShellCallOutputItem = {
|
|
|
31
18
|
type: "shell_call_output";
|
|
32
19
|
};
|
|
33
20
|
/** @internal */
|
|
34
|
-
export declare const OutcomeTimeout$inboundSchema: z.ZodType<OutcomeTimeout, unknown>;
|
|
35
|
-
export declare function outcomeTimeoutFromJSON(jsonString: string): SafeParseResult<OutcomeTimeout, SDKValidationError>;
|
|
36
|
-
/** @internal */
|
|
37
|
-
export declare const OutcomeExit$inboundSchema: z.ZodType<OutcomeExit, unknown>;
|
|
38
|
-
export declare function outcomeExitFromJSON(jsonString: string): SafeParseResult<OutcomeExit, SDKValidationError>;
|
|
39
|
-
/** @internal */
|
|
40
|
-
export declare const Outcome$inboundSchema: z.ZodType<Outcome, unknown>;
|
|
41
|
-
export declare function outcomeFromJSON(jsonString: string): SafeParseResult<Outcome, SDKValidationError>;
|
|
42
|
-
/** @internal */
|
|
43
|
-
export declare const OutputShellCallOutputItemOutput$inboundSchema: z.ZodType<OutputShellCallOutputItemOutput, unknown>;
|
|
44
|
-
export declare function outputShellCallOutputItemOutputFromJSON(jsonString: string): SafeParseResult<OutputShellCallOutputItemOutput, SDKValidationError>;
|
|
45
|
-
/** @internal */
|
|
46
21
|
export declare const OutputShellCallOutputItem$inboundSchema: z.ZodType<OutputShellCallOutputItem, unknown>;
|
|
47
22
|
export declare function outputShellCallOutputItemFromJSON(jsonString: string): SafeParseResult<OutputShellCallOutputItem, SDKValidationError>;
|
|
48
23
|
//# sourceMappingURL=outputshellcalloutputitem.d.ts.map
|