@openrouter/sdk 0.13.38 → 0.13.40
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/additionaltoolsitem.d.ts +117 -0
- package/esm/models/additionaltoolsitem.js +152 -0
- package/esm/models/agentmessageitem.d.ts +99 -0
- package/esm/models/agentmessageitem.js +101 -0
- package/esm/models/applypatchservertool.d.ts +11 -2
- package/esm/models/applypatchservertool.js +9 -2
- package/esm/models/applypatchservertoolopenrouter.d.ts +9 -2
- package/esm/models/applypatchservertoolopenrouter.js +6 -1
- package/esm/models/codeinterpreterservertool.d.ts +10 -2
- package/esm/models/codeinterpreterservertool.js +9 -2
- package/esm/models/codexlocalshelltool.d.ts +11 -2
- package/esm/models/codexlocalshelltool.js +9 -2
- package/esm/models/compactionitem.d.ts +4 -0
- package/esm/models/compactionitem.js +8 -3
- package/esm/models/computeruseservertool.d.ts +11 -3
- package/esm/models/computeruseservertool.js +9 -2
- package/esm/models/contextcompactionitem.d.ts +30 -0
- package/esm/models/contextcompactionitem.js +30 -0
- package/esm/models/customtool.d.ts +11 -3
- package/esm/models/customtool.js +9 -2
- package/esm/models/filesearchservertool.d.ts +11 -3
- package/esm/models/filesearchservertool.js +10 -2
- package/esm/models/imagegenerationservertool.d.ts +11 -3
- package/esm/models/imagegenerationservertool.js +9 -2
- package/esm/models/index.d.ts +3 -0
- package/esm/models/index.js +3 -0
- package/esm/models/inputsunion.d.ts +7 -4
- package/esm/models/inputsunion.js +9 -0
- package/esm/models/legacywebsearchservertool.d.ts +11 -2
- package/esm/models/legacywebsearchservertool.js +9 -2
- package/esm/models/mcpservertool.d.ts +10 -2
- package/esm/models/mcpservertool.js +9 -2
- package/esm/models/openresponsesresult.d.ts +54 -2
- package/esm/models/openresponsesresult.js +26 -26
- package/esm/models/preview20250311websearchservertool.d.ts +11 -2
- package/esm/models/preview20250311websearchservertool.js +9 -2
- package/esm/models/previewwebsearchservertool.d.ts +11 -2
- package/esm/models/previewwebsearchservertool.js +9 -2
- package/esm/models/responsesrequest.d.ts +140 -12
- package/esm/models/responsesrequest.js +32 -32
- package/esm/models/shellservertool.d.ts +11 -2
- package/esm/models/shellservertool.js +9 -2
- package/esm/models/shellservertoolopenrouter.d.ts +9 -2
- package/esm/models/shellservertoolopenrouter.js +6 -1
- package/esm/models/websearchservertool.d.ts +11 -2
- package/esm/models/websearchservertool.js +9 -2
- package/esm/models/websearchservertoolopenrouter.d.ts +9 -2
- package/esm/models/websearchservertoolopenrouter.js +6 -1
- package/jsr.json +1 -1
- package/package.json +6 -6
|
@@ -92,19 +92,19 @@ export function responsesRequestToolFunctionToJSON(responsesRequestToolFunction)
|
|
|
92
92
|
/** @internal */
|
|
93
93
|
export const ResponsesRequestToolUnion$outboundSchema = z.union([
|
|
94
94
|
z.lazy(() => ResponsesRequestToolFunction$outboundSchema),
|
|
95
|
-
PreviewWebSearchServerTool$outboundSchema,
|
|
96
|
-
Preview20250311WebSearchServerTool$outboundSchema,
|
|
97
|
-
LegacyWebSearchServerTool$outboundSchema,
|
|
98
|
-
WebSearchServerTool$outboundSchema,
|
|
99
|
-
FileSearchServerTool$outboundSchema,
|
|
100
|
-
ComputerUseServerTool$outboundSchema,
|
|
101
|
-
CodeInterpreterServerTool$outboundSchema,
|
|
102
|
-
McpServerTool$outboundSchema,
|
|
103
|
-
ImageGenerationServerTool$outboundSchema,
|
|
104
|
-
CodexLocalShellTool$outboundSchema,
|
|
105
|
-
ShellServerTool$outboundSchema,
|
|
106
|
-
ApplyPatchServerTool$outboundSchema,
|
|
107
|
-
CustomTool$outboundSchema,
|
|
95
|
+
PreviewWebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search_preview") })),
|
|
96
|
+
Preview20250311WebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search_preview_2025_03_11") })),
|
|
97
|
+
LegacyWebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search") })),
|
|
98
|
+
WebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search_2025_08_26") })),
|
|
99
|
+
FileSearchServerTool$outboundSchema.and(z.object({ type: z.literal("file_search") })),
|
|
100
|
+
ComputerUseServerTool$outboundSchema.and(z.object({ type: z.literal("computer_use_preview") })),
|
|
101
|
+
CodeInterpreterServerTool$outboundSchema.and(z.object({ type: z.literal("code_interpreter") })),
|
|
102
|
+
McpServerTool$outboundSchema.and(z.object({ type: z.literal("mcp") })),
|
|
103
|
+
ImageGenerationServerTool$outboundSchema.and(z.object({ type: z.literal("image_generation") })),
|
|
104
|
+
CodexLocalShellTool$outboundSchema.and(z.object({ type: z.literal("local_shell") })),
|
|
105
|
+
ShellServerTool$outboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
106
|
+
ApplyPatchServerTool$outboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
107
|
+
CustomTool$outboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
108
108
|
AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
|
|
109
109
|
SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
110
110
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
@@ -113,10 +113,10 @@ export const ResponsesRequestToolUnion$outboundSchema = z.union([
|
|
|
113
113
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
114
114
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
115
115
|
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
116
|
-
WebSearchServerToolOpenRouter$outboundSchema,
|
|
117
|
-
ApplyPatchServerToolOpenRouter$outboundSchema,
|
|
116
|
+
WebSearchServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:web_search") })),
|
|
117
|
+
ApplyPatchServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:apply_patch") })),
|
|
118
118
|
BashServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:bash") })),
|
|
119
|
-
ShellServerToolOpenRouter$outboundSchema,
|
|
119
|
+
ShellServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:shell") })),
|
|
120
120
|
]);
|
|
121
121
|
export function responsesRequestToolUnionToJSON(responsesRequestToolUnion) {
|
|
122
122
|
return JSON.stringify(ResponsesRequestToolUnion$outboundSchema.parse(responsesRequestToolUnion));
|
|
@@ -168,19 +168,19 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
168
168
|
toolChoice: OpenAIResponsesToolChoiceUnion$outboundSchema.optional(),
|
|
169
169
|
tools: z.array(z.union([
|
|
170
170
|
z.lazy(() => ResponsesRequestToolFunction$outboundSchema),
|
|
171
|
-
PreviewWebSearchServerTool$outboundSchema,
|
|
172
|
-
Preview20250311WebSearchServerTool$outboundSchema,
|
|
173
|
-
LegacyWebSearchServerTool$outboundSchema,
|
|
174
|
-
WebSearchServerTool$outboundSchema,
|
|
175
|
-
FileSearchServerTool$outboundSchema,
|
|
176
|
-
ComputerUseServerTool$outboundSchema,
|
|
177
|
-
CodeInterpreterServerTool$outboundSchema,
|
|
178
|
-
McpServerTool$outboundSchema,
|
|
179
|
-
ImageGenerationServerTool$outboundSchema,
|
|
180
|
-
CodexLocalShellTool$outboundSchema,
|
|
181
|
-
ShellServerTool$outboundSchema,
|
|
182
|
-
ApplyPatchServerTool$outboundSchema,
|
|
183
|
-
CustomTool$outboundSchema,
|
|
171
|
+
PreviewWebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search_preview") })),
|
|
172
|
+
Preview20250311WebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search_preview_2025_03_11") })),
|
|
173
|
+
LegacyWebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search") })),
|
|
174
|
+
WebSearchServerTool$outboundSchema.and(z.object({ type: z.literal("web_search_2025_08_26") })),
|
|
175
|
+
FileSearchServerTool$outboundSchema.and(z.object({ type: z.literal("file_search") })),
|
|
176
|
+
ComputerUseServerTool$outboundSchema.and(z.object({ type: z.literal("computer_use_preview") })),
|
|
177
|
+
CodeInterpreterServerTool$outboundSchema.and(z.object({ type: z.literal("code_interpreter") })),
|
|
178
|
+
McpServerTool$outboundSchema.and(z.object({ type: z.literal("mcp") })),
|
|
179
|
+
ImageGenerationServerTool$outboundSchema.and(z.object({ type: z.literal("image_generation") })),
|
|
180
|
+
CodexLocalShellTool$outboundSchema.and(z.object({ type: z.literal("local_shell") })),
|
|
181
|
+
ShellServerTool$outboundSchema.and(z.object({ type: z.literal("shell") })),
|
|
182
|
+
ApplyPatchServerTool$outboundSchema.and(z.object({ type: z.literal("apply_patch") })),
|
|
183
|
+
CustomTool$outboundSchema.and(z.object({ type: z.literal("custom") })),
|
|
184
184
|
AdvisorServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:advisor") })),
|
|
185
185
|
SubagentServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:subagent") })),
|
|
186
186
|
DatetimeServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:datetime") })),
|
|
@@ -189,10 +189,10 @@ export const ResponsesRequest$outboundSchema = z.object({
|
|
|
189
189
|
ImageGenerationServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:image_generation") })),
|
|
190
190
|
ChatSearchModelsServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:experimental__search_models") })),
|
|
191
191
|
WebFetchServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:web_fetch") })),
|
|
192
|
-
WebSearchServerToolOpenRouter$outboundSchema,
|
|
193
|
-
ApplyPatchServerToolOpenRouter$outboundSchema,
|
|
192
|
+
WebSearchServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:web_search") })),
|
|
193
|
+
ApplyPatchServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:apply_patch") })),
|
|
194
194
|
BashServerTool$outboundSchema.and(z.object({ type: z.literal("openrouter:bash") })),
|
|
195
|
-
ShellServerToolOpenRouter$outboundSchema,
|
|
195
|
+
ShellServerToolOpenRouter$outboundSchema.and(z.object({ type: z.literal("openrouter:shell") })),
|
|
196
196
|
])).optional(),
|
|
197
197
|
topK: z.int().optional(),
|
|
198
198
|
topLogprobs: z.nullable(z.int()).optional(),
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const ShellServerToolType: {
|
|
6
|
+
readonly Shell: "shell";
|
|
7
|
+
};
|
|
8
|
+
export type ShellServerToolType = ClosedEnum<typeof ShellServerToolType>;
|
|
4
9
|
/**
|
|
5
10
|
* Shell tool configuration
|
|
6
11
|
*/
|
|
7
12
|
export type ShellServerTool = {
|
|
8
|
-
type:
|
|
13
|
+
type: ShellServerToolType;
|
|
9
14
|
};
|
|
10
15
|
/** @internal */
|
|
16
|
+
export declare const ShellServerToolType$inboundSchema: z.ZodEnum<typeof ShellServerToolType>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const ShellServerToolType$outboundSchema: z.ZodEnum<typeof ShellServerToolType>;
|
|
19
|
+
/** @internal */
|
|
11
20
|
export declare const ShellServerTool$inboundSchema: z.ZodType<ShellServerTool, unknown>;
|
|
12
21
|
/** @internal */
|
|
13
22
|
export type ShellServerTool$Outbound = {
|
|
14
|
-
type:
|
|
23
|
+
type: string;
|
|
15
24
|
};
|
|
16
25
|
/** @internal */
|
|
17
26
|
export declare const ShellServerTool$outboundSchema: z.ZodType<ShellServerTool$Outbound, ShellServerTool>;
|
|
@@ -4,13 +4,20 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
export const ShellServerToolType = {
|
|
8
|
+
Shell: "shell",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ShellServerToolType$inboundSchema = z.enum(ShellServerToolType);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const ShellServerToolType$outboundSchema = ShellServerToolType$inboundSchema;
|
|
7
14
|
/** @internal */
|
|
8
15
|
export const ShellServerTool$inboundSchema = z.object({
|
|
9
|
-
type:
|
|
16
|
+
type: ShellServerToolType$inboundSchema,
|
|
10
17
|
});
|
|
11
18
|
/** @internal */
|
|
12
19
|
export const ShellServerTool$outboundSchema = z.object({
|
|
13
|
-
type:
|
|
20
|
+
type: ShellServerToolType$outboundSchema,
|
|
14
21
|
});
|
|
15
22
|
export function shellServerToolToJSON(shellServerTool) {
|
|
16
23
|
return JSON.stringify(ShellServerTool$outboundSchema.parse(shellServerTool));
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { ShellServerToolConfig, ShellServerToolConfig$Outbound } from "./shellservertoolconfig.js";
|
|
4
|
+
export declare const ShellServerToolOpenRouterType: {
|
|
5
|
+
readonly OpenrouterShell: "openrouter:shell";
|
|
6
|
+
};
|
|
7
|
+
export type ShellServerToolOpenRouterType = ClosedEnum<typeof ShellServerToolOpenRouterType>;
|
|
3
8
|
/**
|
|
4
9
|
* OpenRouter built-in server tool: runs shell commands server-side in a sandboxed container (a sandbox-backed clone of OpenAI's hosted shell tool)
|
|
5
10
|
*/
|
|
@@ -8,12 +13,14 @@ export type ShellServerToolOpenRouter = {
|
|
|
8
13
|
* Configuration for the openrouter:shell server tool
|
|
9
14
|
*/
|
|
10
15
|
parameters?: ShellServerToolConfig | undefined;
|
|
11
|
-
type:
|
|
16
|
+
type: ShellServerToolOpenRouterType;
|
|
12
17
|
};
|
|
13
18
|
/** @internal */
|
|
19
|
+
export declare const ShellServerToolOpenRouterType$outboundSchema: z.ZodEnum<typeof ShellServerToolOpenRouterType>;
|
|
20
|
+
/** @internal */
|
|
14
21
|
export type ShellServerToolOpenRouter$Outbound = {
|
|
15
22
|
parameters?: ShellServerToolConfig$Outbound | undefined;
|
|
16
|
-
type:
|
|
23
|
+
type: string;
|
|
17
24
|
};
|
|
18
25
|
/** @internal */
|
|
19
26
|
export declare const ShellServerToolOpenRouter$outboundSchema: z.ZodType<ShellServerToolOpenRouter$Outbound, ShellServerToolOpenRouter>;
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { ShellServerToolConfig$outboundSchema, } from "./shellservertoolconfig.js";
|
|
7
|
+
export const ShellServerToolOpenRouterType = {
|
|
8
|
+
OpenrouterShell: "openrouter:shell",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ShellServerToolOpenRouterType$outboundSchema = z.enum(ShellServerToolOpenRouterType);
|
|
7
12
|
/** @internal */
|
|
8
13
|
export const ShellServerToolOpenRouter$outboundSchema = z.object({
|
|
9
14
|
parameters: ShellServerToolConfig$outboundSchema.optional(),
|
|
10
|
-
type:
|
|
15
|
+
type: ShellServerToolOpenRouterType$outboundSchema,
|
|
11
16
|
});
|
|
12
17
|
export function shellServerToolOpenRouterToJSON(shellServerToolOpenRouter) {
|
|
13
18
|
return JSON.stringify(ShellServerToolOpenRouter$outboundSchema.parse(shellServerToolOpenRouter));
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
5
|
import { SearchContextSizeEnum } from "./searchcontextsizeenum.js";
|
|
5
6
|
import { WebSearchDomainFilter, WebSearchDomainFilter$Outbound } from "./websearchdomainfilter.js";
|
|
6
7
|
import { WebSearchEngineEnum } from "./websearchengineenum.js";
|
|
7
8
|
import { WebSearchUserLocation, WebSearchUserLocation$Outbound } from "./websearchuserlocation.js";
|
|
9
|
+
export declare const WebSearchServerToolType: {
|
|
10
|
+
readonly WebSearch20250826: "web_search_2025_08_26";
|
|
11
|
+
};
|
|
12
|
+
export type WebSearchServerToolType = ClosedEnum<typeof WebSearchServerToolType>;
|
|
8
13
|
/**
|
|
9
14
|
* Web search tool configuration (2025-08-26 version)
|
|
10
15
|
*/
|
|
@@ -22,13 +27,17 @@ export type WebSearchServerTool = {
|
|
|
22
27
|
* Size of the search context for web search tools
|
|
23
28
|
*/
|
|
24
29
|
searchContextSize?: SearchContextSizeEnum | undefined;
|
|
25
|
-
type:
|
|
30
|
+
type: WebSearchServerToolType;
|
|
26
31
|
/**
|
|
27
32
|
* User location information for web search
|
|
28
33
|
*/
|
|
29
34
|
userLocation?: WebSearchUserLocation | null | undefined;
|
|
30
35
|
};
|
|
31
36
|
/** @internal */
|
|
37
|
+
export declare const WebSearchServerToolType$inboundSchema: z.ZodEnum<typeof WebSearchServerToolType>;
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const WebSearchServerToolType$outboundSchema: z.ZodEnum<typeof WebSearchServerToolType>;
|
|
40
|
+
/** @internal */
|
|
32
41
|
export declare const WebSearchServerTool$inboundSchema: z.ZodType<WebSearchServerTool, unknown>;
|
|
33
42
|
/** @internal */
|
|
34
43
|
export type WebSearchServerTool$Outbound = {
|
|
@@ -36,7 +45,7 @@ export type WebSearchServerTool$Outbound = {
|
|
|
36
45
|
filters?: WebSearchDomainFilter$Outbound | null | undefined;
|
|
37
46
|
max_results?: number | undefined;
|
|
38
47
|
search_context_size?: string | undefined;
|
|
39
|
-
type:
|
|
48
|
+
type: string;
|
|
40
49
|
user_location?: WebSearchUserLocation$Outbound | null | undefined;
|
|
41
50
|
};
|
|
42
51
|
/** @internal */
|
|
@@ -9,13 +9,20 @@ import { SearchContextSizeEnum$inboundSchema, SearchContextSizeEnum$outboundSche
|
|
|
9
9
|
import { WebSearchDomainFilter$inboundSchema, WebSearchDomainFilter$outboundSchema, } from "./websearchdomainfilter.js";
|
|
10
10
|
import { WebSearchEngineEnum$inboundSchema, WebSearchEngineEnum$outboundSchema, } from "./websearchengineenum.js";
|
|
11
11
|
import { WebSearchUserLocation$inboundSchema, WebSearchUserLocation$outboundSchema, } from "./websearchuserlocation.js";
|
|
12
|
+
export const WebSearchServerToolType = {
|
|
13
|
+
WebSearch20250826: "web_search_2025_08_26",
|
|
14
|
+
};
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const WebSearchServerToolType$inboundSchema = z.enum(WebSearchServerToolType);
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const WebSearchServerToolType$outboundSchema = WebSearchServerToolType$inboundSchema;
|
|
12
19
|
/** @internal */
|
|
13
20
|
export const WebSearchServerTool$inboundSchema = z.object({
|
|
14
21
|
engine: WebSearchEngineEnum$inboundSchema.optional(),
|
|
15
22
|
filters: z.nullable(WebSearchDomainFilter$inboundSchema).optional(),
|
|
16
23
|
max_results: z.int().optional(),
|
|
17
24
|
search_context_size: SearchContextSizeEnum$inboundSchema.optional(),
|
|
18
|
-
type:
|
|
25
|
+
type: WebSearchServerToolType$inboundSchema,
|
|
19
26
|
user_location: z.nullable(WebSearchUserLocation$inboundSchema).optional(),
|
|
20
27
|
}).transform((v) => {
|
|
21
28
|
return remap$(v, {
|
|
@@ -30,7 +37,7 @@ export const WebSearchServerTool$outboundSchema = z.object({
|
|
|
30
37
|
filters: z.nullable(WebSearchDomainFilter$outboundSchema).optional(),
|
|
31
38
|
maxResults: z.int().optional(),
|
|
32
39
|
searchContextSize: SearchContextSizeEnum$outboundSchema.optional(),
|
|
33
|
-
type:
|
|
40
|
+
type: WebSearchServerToolType$outboundSchema,
|
|
34
41
|
userLocation: z.nullable(WebSearchUserLocation$outboundSchema).optional(),
|
|
35
42
|
}).transform((v) => {
|
|
36
43
|
return remap$(v, {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
2
3
|
import { WebSearchServerToolConfig, WebSearchServerToolConfig$Outbound } from "./websearchservertoolconfig.js";
|
|
4
|
+
export declare const WebSearchServerToolOpenRouterType: {
|
|
5
|
+
readonly OpenrouterWebSearch: "openrouter:web_search";
|
|
6
|
+
};
|
|
7
|
+
export type WebSearchServerToolOpenRouterType = ClosedEnum<typeof WebSearchServerToolOpenRouterType>;
|
|
3
8
|
/**
|
|
4
9
|
* OpenRouter built-in server tool: searches the web for current information
|
|
5
10
|
*/
|
|
@@ -8,12 +13,14 @@ export type WebSearchServerToolOpenRouter = {
|
|
|
8
13
|
* Configuration for the openrouter:web_search server tool
|
|
9
14
|
*/
|
|
10
15
|
parameters?: WebSearchServerToolConfig | undefined;
|
|
11
|
-
type:
|
|
16
|
+
type: WebSearchServerToolOpenRouterType;
|
|
12
17
|
};
|
|
13
18
|
/** @internal */
|
|
19
|
+
export declare const WebSearchServerToolOpenRouterType$outboundSchema: z.ZodEnum<typeof WebSearchServerToolOpenRouterType>;
|
|
20
|
+
/** @internal */
|
|
14
21
|
export type WebSearchServerToolOpenRouter$Outbound = {
|
|
15
22
|
parameters?: WebSearchServerToolConfig$Outbound | undefined;
|
|
16
|
-
type:
|
|
23
|
+
type: string;
|
|
17
24
|
};
|
|
18
25
|
/** @internal */
|
|
19
26
|
export declare const WebSearchServerToolOpenRouter$outboundSchema: z.ZodType<WebSearchServerToolOpenRouter$Outbound, WebSearchServerToolOpenRouter>;
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { WebSearchServerToolConfig$outboundSchema, } from "./websearchservertoolconfig.js";
|
|
7
|
+
export const WebSearchServerToolOpenRouterType = {
|
|
8
|
+
OpenrouterWebSearch: "openrouter:web_search",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const WebSearchServerToolOpenRouterType$outboundSchema = z.enum(WebSearchServerToolOpenRouterType);
|
|
7
12
|
/** @internal */
|
|
8
13
|
export const WebSearchServerToolOpenRouter$outboundSchema = z.object({
|
|
9
14
|
parameters: WebSearchServerToolConfig$outboundSchema.optional(),
|
|
10
|
-
type:
|
|
15
|
+
type: WebSearchServerToolOpenRouterType$outboundSchema,
|
|
11
16
|
});
|
|
12
17
|
export function webSearchServerToolOpenRouterToJSON(webSearchServerToolOpenRouter) {
|
|
13
18
|
return JSON.stringify(WebSearchServerToolOpenRouter$outboundSchema.parse(webSearchServerToolOpenRouter));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.40",
|
|
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": [
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
+
"prepare": "npm run build",
|
|
78
|
+
"test": "vitest --run --project unit",
|
|
79
|
+
"test:e2e": "vitest --run --project e2e",
|
|
76
80
|
"test:transit": "exit 0",
|
|
77
|
-
"test:watch": "vitest --watch --project unit",
|
|
78
81
|
"typecheck": "tsc --noEmit",
|
|
79
82
|
"typecheck:transit": "exit 0",
|
|
80
|
-
"prepare": "npm run build",
|
|
81
|
-
"test:e2e": "vitest --run --project e2e",
|
|
82
83
|
"compile": "tsc",
|
|
83
|
-
"
|
|
84
|
-
"test": "vitest --run --project unit"
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|