@openrouter/sdk 1.5.64 → 1.5.66
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/codeinterpreterservertool.d.ts +1 -1
- package/esm/models/deferredbm25search.d.ts +5 -0
- package/esm/models/deferredbm25search.js +1 -0
- package/esm/models/deferredregexsearch.d.ts +5 -0
- package/esm/models/deferredregexsearch.js +1 -0
- package/esm/models/deferredtoolscontrol.d.ts +27 -3
- package/esm/models/deferredtoolscontrol.js +18 -1
- package/esm/models/filesearchservertool.d.ts +1 -1
- package/esm/models/outputtoolsearchservertoolitem.d.ts +9 -0
- package/esm/models/outputtoolsearchservertoolitem.js +2 -0
- package/jsr.json +1 -1
- package/package.json +4 -4
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.66";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.66 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.66",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.66 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -24,7 +24,7 @@ export declare const TypeCodeInterpreter: {
|
|
|
24
24
|
};
|
|
25
25
|
export type TypeCodeInterpreter = ClosedEnum<typeof TypeCodeInterpreter>;
|
|
26
26
|
/**
|
|
27
|
-
* Code interpreter tool configuration
|
|
27
|
+
* Code interpreter tool configuration. An existing container id or `container.file_ids` requires BYOK (your own OpenAI key); requests on OpenRouter credits must use `auto` with no `file_ids`.
|
|
28
28
|
*/
|
|
29
29
|
export type CodeInterpreterServerTool = {
|
|
30
30
|
container: ContainerAuto | string;
|
|
@@ -4,11 +4,16 @@ import * as z from "zod/v4";
|
|
|
4
4
|
*/
|
|
5
5
|
export type DeferredBm25Search = {
|
|
6
6
|
maxResults?: number | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Universal profile only, for searches the router answers through the `tool_search` wrapper; code-mode `search()` and a client-owned tool search list the matched tools alone. When true, each result also names up to 16 other deferred tools of every source a match came from, so a model that found one tool of an MCP server learns its neighbours without another search. Absent or false: results list the matched tools alone.
|
|
9
|
+
*/
|
|
10
|
+
siblings?: boolean | undefined;
|
|
7
11
|
type: "bm25";
|
|
8
12
|
};
|
|
9
13
|
/** @internal */
|
|
10
14
|
export type DeferredBm25Search$Outbound = {
|
|
11
15
|
max_results?: number | undefined;
|
|
16
|
+
siblings?: boolean | undefined;
|
|
12
17
|
type: "bm25";
|
|
13
18
|
};
|
|
14
19
|
/** @internal */
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
/** @internal */
|
|
8
8
|
export const DeferredBm25Search$outboundSchema = z.object({
|
|
9
9
|
maxResults: z.int().optional(),
|
|
10
|
+
siblings: z.boolean().optional(),
|
|
10
11
|
type: z.literal("bm25"),
|
|
11
12
|
}).transform((v) => {
|
|
12
13
|
return remap$(v, {
|
|
@@ -4,11 +4,16 @@ import * as z from "zod/v4";
|
|
|
4
4
|
*/
|
|
5
5
|
export type DeferredRegexSearch = {
|
|
6
6
|
maxResults?: number | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Universal profile only, for searches the router answers through the `tool_search` wrapper; code-mode `search()` and a client-owned tool search list the matched tools alone. When true, each result also names up to 16 other deferred tools of every source a match came from, so a model that found one tool of an MCP server learns its neighbours without another search. Absent or false: results list the matched tools alone.
|
|
9
|
+
*/
|
|
10
|
+
siblings?: boolean | undefined;
|
|
7
11
|
type: "regex";
|
|
8
12
|
};
|
|
9
13
|
/** @internal */
|
|
10
14
|
export type DeferredRegexSearch$Outbound = {
|
|
11
15
|
max_results?: number | undefined;
|
|
16
|
+
siblings?: boolean | undefined;
|
|
12
17
|
type: "regex";
|
|
13
18
|
};
|
|
14
19
|
/** @internal */
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
/** @internal */
|
|
8
8
|
export const DeferredRegexSearch$outboundSchema = z.object({
|
|
9
9
|
maxResults: z.int().optional(),
|
|
10
|
+
siblings: z.boolean().optional(),
|
|
10
11
|
type: z.literal("regex"),
|
|
11
12
|
}).transform((v) => {
|
|
12
13
|
return remap$(v, {
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { DeferredToolsSearchStrategy, DeferredToolsSearchStrategy$Outbound } from "./deferredtoolssearchstrategy.js";
|
|
4
|
+
/**
|
|
5
|
+
* How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CascadeMode: {
|
|
8
|
+
readonly Keywords: "keywords";
|
|
9
|
+
readonly Native: "native";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental.
|
|
13
|
+
*/
|
|
14
|
+
export type CascadeMode = OpenEnum<typeof CascadeMode>;
|
|
4
15
|
/**
|
|
5
16
|
* How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.
|
|
6
17
|
*/
|
|
@@ -28,14 +39,15 @@ export declare const Protocol: {
|
|
|
28
39
|
};
|
|
29
40
|
export type Protocol = ClosedEnum<typeof Protocol>;
|
|
30
41
|
/**
|
|
31
|
-
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
42
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental.
|
|
32
43
|
*/
|
|
33
44
|
export declare const DeferredToolsControlScope: {
|
|
34
45
|
readonly All: "all";
|
|
35
46
|
readonly Mcp: "mcp";
|
|
47
|
+
readonly Client: "client";
|
|
36
48
|
};
|
|
37
49
|
/**
|
|
38
|
-
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
50
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental.
|
|
39
51
|
*/
|
|
40
52
|
export type DeferredToolsControlScope = OpenEnum<typeof DeferredToolsControlScope>;
|
|
41
53
|
/**
|
|
@@ -52,6 +64,14 @@ export type Validation = ClosedEnum<typeof Validation>;
|
|
|
52
64
|
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation; keep the catalog unchanged.
|
|
53
65
|
*/
|
|
54
66
|
export type DeferredToolsControl = {
|
|
67
|
+
/**
|
|
68
|
+
* How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental.
|
|
69
|
+
*/
|
|
70
|
+
cascadeMode?: CascadeMode | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Universal profile only. Caller text announced to the model with the deferred catalog before its first turn, for example which sources the task needs. Repeated only when it changes. Trimmed before the length bounds apply. Recorded in the `catalog_index` discovery record of the response, so it is replayed with the conversation.
|
|
73
|
+
*/
|
|
74
|
+
hint?: string | undefined;
|
|
55
75
|
/**
|
|
56
76
|
* How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.
|
|
57
77
|
*/
|
|
@@ -62,7 +82,7 @@ export type DeferredToolsControl = {
|
|
|
62
82
|
profile: Profile;
|
|
63
83
|
protocol: Protocol;
|
|
64
84
|
/**
|
|
65
|
-
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
85
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental.
|
|
66
86
|
*/
|
|
67
87
|
scope?: DeferredToolsControlScope | undefined;
|
|
68
88
|
/**
|
|
@@ -75,6 +95,8 @@ export type DeferredToolsControl = {
|
|
|
75
95
|
validation: Validation;
|
|
76
96
|
};
|
|
77
97
|
/** @internal */
|
|
98
|
+
export declare const CascadeMode$outboundSchema: z.ZodType<string, CascadeMode>;
|
|
99
|
+
/** @internal */
|
|
78
100
|
export declare const Interface$outboundSchema: z.ZodType<string, Interface>;
|
|
79
101
|
/** @internal */
|
|
80
102
|
export declare const Profile$outboundSchema: z.ZodType<string, Profile>;
|
|
@@ -86,6 +108,8 @@ export declare const DeferredToolsControlScope$outboundSchema: z.ZodType<string,
|
|
|
86
108
|
export declare const Validation$outboundSchema: z.ZodEnum<typeof Validation>;
|
|
87
109
|
/** @internal */
|
|
88
110
|
export type DeferredToolsControl$Outbound = {
|
|
111
|
+
cascade_mode?: string | undefined;
|
|
112
|
+
hint?: string | undefined;
|
|
89
113
|
interface?: string | undefined;
|
|
90
114
|
profile: string;
|
|
91
115
|
protocol: string;
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
* @generated-id: 117738d3058e
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import * as openEnums from "../types/enums.js";
|
|
7
8
|
import { DeferredToolsSearchStrategy$outboundSchema, } from "./deferredtoolssearchstrategy.js";
|
|
9
|
+
/**
|
|
10
|
+
* How a universal `tool_search` query reaches the client's own tool search. Absent or `keywords`: a `select:` query becomes the words of the selected names and the limit is always filled. `native`: a `select:` query passes through verbatim when the client search documents `select:`, and the limit field is sent only when the model gave one, unless the client search requires it, in which case its documented default is sent. Experimental.
|
|
11
|
+
*/
|
|
12
|
+
export const CascadeMode = {
|
|
13
|
+
Keywords: "keywords",
|
|
14
|
+
Native: "native",
|
|
15
|
+
};
|
|
8
16
|
/**
|
|
9
17
|
* How the universal profile exposes the hidden catalog to the provider. Absent or `wrappers`: the `tool_search` and `tool_exec` tools. `code_mode`: one `tool_code` tool that runs a short JavaScript program in which `search()` and `call()` reach the catalog, so several searches and calls complete in one tool result. Experimental.
|
|
10
18
|
*/
|
|
@@ -23,11 +31,12 @@ export const Protocol = {
|
|
|
23
31
|
V1: "v1",
|
|
24
32
|
};
|
|
25
33
|
/**
|
|
26
|
-
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. Experimental.
|
|
34
|
+
* Which tools the universal profile defers. Absent or `all`: every wrappable tool outside the coding-harness core set. `mcp`: only MCP server tools (`mcp__*` names and Responses namespaces outside `functions`); the harness keeps its own built-in tools direct. `client`: only the tools the client itself marked `defer_loading`, so a harness with its own tool search keeps its other direct tools direct; an adopted client tool search is still replaced by the router wrappers, and a client-deferred tool the router cannot wrap stays direct. Experimental.
|
|
27
35
|
*/
|
|
28
36
|
export const DeferredToolsControlScope = {
|
|
29
37
|
All: "all",
|
|
30
38
|
Mcp: "mcp",
|
|
39
|
+
Client: "client",
|
|
31
40
|
};
|
|
32
41
|
/**
|
|
33
42
|
* Where tool-call arguments are checked against the original schema. Only `runtime` (in OpenRouter) is available in this release.
|
|
@@ -36,6 +45,8 @@ export const Validation = {
|
|
|
36
45
|
Runtime: "runtime",
|
|
37
46
|
};
|
|
38
47
|
/** @internal */
|
|
48
|
+
export const CascadeMode$outboundSchema = openEnums.outboundSchema(CascadeMode);
|
|
49
|
+
/** @internal */
|
|
39
50
|
export const Interface$outboundSchema = openEnums
|
|
40
51
|
.outboundSchema(Interface);
|
|
41
52
|
/** @internal */
|
|
@@ -49,12 +60,18 @@ export const DeferredToolsControlScope$outboundSchema = openEnums.outboundSchema
|
|
|
49
60
|
export const Validation$outboundSchema = z.enum(Validation);
|
|
50
61
|
/** @internal */
|
|
51
62
|
export const DeferredToolsControl$outboundSchema = z.object({
|
|
63
|
+
cascadeMode: CascadeMode$outboundSchema.optional(),
|
|
64
|
+
hint: z.string().optional(),
|
|
52
65
|
interface: Interface$outboundSchema.optional(),
|
|
53
66
|
profile: Profile$outboundSchema,
|
|
54
67
|
protocol: Protocol$outboundSchema,
|
|
55
68
|
scope: DeferredToolsControlScope$outboundSchema.optional(),
|
|
56
69
|
search: DeferredToolsSearchStrategy$outboundSchema,
|
|
57
70
|
validation: Validation$outboundSchema,
|
|
71
|
+
}).transform((v) => {
|
|
72
|
+
return remap$(v, {
|
|
73
|
+
cascadeMode: "cascade_mode",
|
|
74
|
+
});
|
|
58
75
|
});
|
|
59
76
|
export function deferredToolsControlToJSON(deferredToolsControl) {
|
|
60
77
|
return JSON.stringify(DeferredToolsControl$outboundSchema.parse(deferredToolsControl));
|
|
@@ -34,7 +34,7 @@ export declare const TypeFileSearch: {
|
|
|
34
34
|
};
|
|
35
35
|
export type TypeFileSearch = ClosedEnum<typeof TypeFileSearch>;
|
|
36
36
|
/**
|
|
37
|
-
* File search tool configuration
|
|
37
|
+
* File search tool configuration. `vector_store_ids` names OpenAI vector stores, so it requires BYOK (your own OpenAI key); requests on OpenRouter credits get a 400.
|
|
38
38
|
*/
|
|
39
39
|
export type FileSearchServerTool = {
|
|
40
40
|
filters?: Filters | CompoundFilter | null | undefined;
|
|
@@ -55,6 +55,12 @@ export type OutputToolSearchServerToolItem = {
|
|
|
55
55
|
id?: string | undefined;
|
|
56
56
|
matches?: Array<Match> | undefined;
|
|
57
57
|
query?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* The other deferred tools of each source a match came from, by name, when the search listed siblings. Replaying the item shows the same names.
|
|
60
|
+
*/
|
|
61
|
+
sources?: {
|
|
62
|
+
[k: string]: Array<string>;
|
|
63
|
+
} | undefined;
|
|
58
64
|
status: FailableToolCallStatus;
|
|
59
65
|
/**
|
|
60
66
|
* 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.
|
|
@@ -97,6 +103,9 @@ export type OutputToolSearchServerToolItem$Outbound = {
|
|
|
97
103
|
id?: string | undefined;
|
|
98
104
|
matches?: Array<Match$Outbound> | undefined;
|
|
99
105
|
query?: string | undefined;
|
|
106
|
+
sources?: {
|
|
107
|
+
[k: string]: Array<string>;
|
|
108
|
+
} | undefined;
|
|
100
109
|
status: string;
|
|
101
110
|
turn_call_ids?: Array<string> | undefined;
|
|
102
111
|
type: string;
|
|
@@ -62,6 +62,7 @@ export const OutputToolSearchServerToolItem$inboundSchema = z.object({
|
|
|
62
62
|
id: z.string().optional(),
|
|
63
63
|
matches: z.array(z.lazy(() => Match$inboundSchema)).optional(),
|
|
64
64
|
query: z.string().optional(),
|
|
65
|
+
sources: z.record(z.string(), z.array(z.string())).optional(),
|
|
65
66
|
status: FailableToolCallStatus$inboundSchema,
|
|
66
67
|
turn_call_ids: z.array(z.string()).optional(),
|
|
67
68
|
type: OutputToolSearchServerToolItemType$inboundSchema,
|
|
@@ -83,6 +84,7 @@ export const OutputToolSearchServerToolItem$outboundSchema = z.object({
|
|
|
83
84
|
id: z.string().optional(),
|
|
84
85
|
matches: z.array(z.lazy(() => Match$outboundSchema)).optional(),
|
|
85
86
|
query: z.string().optional(),
|
|
87
|
+
sources: z.record(z.string(), z.array(z.string())).optional(),
|
|
86
88
|
status: FailableToolCallStatus$outboundSchema,
|
|
87
89
|
turnCallIds: z.array(z.string()).optional(),
|
|
88
90
|
type: OutputToolSearchServerToolItemType$outboundSchema,
|
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.66",
|
|
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 && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"test:watch": "vitest --watch --project unit",
|
|
77
76
|
"typecheck:transit": "exit 0",
|
|
77
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
78
78
|
"prepare": "npm run build",
|
|
79
79
|
"test": "vitest --run --project unit",
|
|
80
80
|
"test:e2e": "vitest --run --project e2e",
|
|
81
|
+
"test:transit": "exit 0",
|
|
81
82
|
"typecheck": "tsc --noEmit",
|
|
82
83
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
83
|
-
"
|
|
84
|
-
"test:transit": "exit 0"
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|