@openrouter/sdk 1.5.65 → 1.5.67
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/chatrequest.d.ts +1 -1
- package/esm/models/deferredbm25search.d.ts +10 -0
- package/esm/models/deferredbm25search.js +2 -0
- package/esm/models/deferredregexsearch.d.ts +5 -0
- package/esm/models/deferredregexsearch.js +1 -0
- package/esm/models/deferredtoolscontrol.d.ts +11 -1
- package/esm/models/deferredtoolscontrol.js +3 -0
- package/esm/models/messagesrequest.d.ts +1 -1
- package/esm/models/outputtoolsearchservertoolitem.d.ts +14 -0
- package/esm/models/outputtoolsearchservertoolitem.js +6 -0
- package/esm/models/responsesrequest.d.ts +1 -1
- package/jsr.json +1 -1
- package/package.json +7 -7
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.67";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.67 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.67",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.67 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -123,7 +123,7 @@ export type ChatRequest = {
|
|
|
123
123
|
*/
|
|
124
124
|
debug?: ChatDebugOptions | undefined;
|
|
125
125
|
/**
|
|
126
|
-
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation
|
|
126
|
+
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation. The portable profile needs the catalog unchanged across a continuation; the universal profile accepts a changed catalog and, with `announce_catalog_changes`, tells the model about it.
|
|
127
127
|
*/
|
|
128
128
|
deferredTools?: DeferredToolsControl | undefined;
|
|
129
129
|
/**
|
|
@@ -4,11 +4,21 @@ 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;
|
|
11
|
+
/**
|
|
12
|
+
* Universal profile only, for keyword searches the router answers through the `tool_search` wrapper. When true, a result spreads across sources: of the 3 x limit best-scoring candidates, those scoring at least 60% of the best match take at most 2 slots per source (MCP server, namespace or shared `<server>_` prefix; a tool with no source is never capped), and the remaining slots fill in score order, so a catalog with several systems for one job (web search, page extraction) shows one of each instead of the top system's siblings. Absent or false: results are the best matches in score order.
|
|
13
|
+
*/
|
|
14
|
+
spread?: boolean | undefined;
|
|
7
15
|
type: "bm25";
|
|
8
16
|
};
|
|
9
17
|
/** @internal */
|
|
10
18
|
export type DeferredBm25Search$Outbound = {
|
|
11
19
|
max_results?: number | undefined;
|
|
20
|
+
siblings?: boolean | undefined;
|
|
21
|
+
spread?: boolean | undefined;
|
|
12
22
|
type: "bm25";
|
|
13
23
|
};
|
|
14
24
|
/** @internal */
|
|
@@ -7,6 +7,8 @@ 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(),
|
|
11
|
+
spread: z.boolean().optional(),
|
|
10
12
|
type: z.literal("bm25"),
|
|
11
13
|
}).transform((v) => {
|
|
12
14
|
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, {
|
|
@@ -61,13 +61,21 @@ export declare const Validation: {
|
|
|
61
61
|
*/
|
|
62
62
|
export type Validation = ClosedEnum<typeof Validation>;
|
|
63
63
|
/**
|
|
64
|
-
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation
|
|
64
|
+
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation. The portable profile needs the catalog unchanged across a continuation; the universal profile accepts a changed catalog and, with `announce_catalog_changes`, tells the model about it.
|
|
65
65
|
*/
|
|
66
66
|
export type DeferredToolsControl = {
|
|
67
|
+
/**
|
|
68
|
+
* Universal profile only. When true, a catalog whose deferred tools changed between two of the model's own turns (a client that connects MCP servers while the model works) is re-announced before the next model turn, with the sources added, changed and removed since the previous index, or that no deferred tools remain. Applies when the router lists the catalog itself; a client whose own tool search was adopted lists its deferred tools itself and is not re-announced. The announcement shares the result budget of the turn and is skipped when it does not fit. Absent or false: the catalog index is announced on a user turn only.
|
|
69
|
+
*/
|
|
70
|
+
announceCatalogChanges?: boolean | undefined;
|
|
67
71
|
/**
|
|
68
72
|
* 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
73
|
*/
|
|
70
74
|
cascadeMode?: CascadeMode | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* 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.
|
|
77
|
+
*/
|
|
78
|
+
hint?: string | undefined;
|
|
71
79
|
/**
|
|
72
80
|
* 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.
|
|
73
81
|
*/
|
|
@@ -104,7 +112,9 @@ export declare const DeferredToolsControlScope$outboundSchema: z.ZodType<string,
|
|
|
104
112
|
export declare const Validation$outboundSchema: z.ZodEnum<typeof Validation>;
|
|
105
113
|
/** @internal */
|
|
106
114
|
export type DeferredToolsControl$Outbound = {
|
|
115
|
+
announce_catalog_changes?: boolean | undefined;
|
|
107
116
|
cascade_mode?: string | undefined;
|
|
117
|
+
hint?: string | undefined;
|
|
108
118
|
interface?: string | undefined;
|
|
109
119
|
profile: string;
|
|
110
120
|
protocol: string;
|
|
@@ -60,7 +60,9 @@ export const DeferredToolsControlScope$outboundSchema = openEnums.outboundSchema
|
|
|
60
60
|
export const Validation$outboundSchema = z.enum(Validation);
|
|
61
61
|
/** @internal */
|
|
62
62
|
export const DeferredToolsControl$outboundSchema = z.object({
|
|
63
|
+
announceCatalogChanges: z.boolean().optional(),
|
|
63
64
|
cascadeMode: CascadeMode$outboundSchema.optional(),
|
|
65
|
+
hint: z.string().optional(),
|
|
64
66
|
interface: Interface$outboundSchema.optional(),
|
|
65
67
|
profile: Profile$outboundSchema,
|
|
66
68
|
protocol: Protocol$outboundSchema,
|
|
@@ -69,6 +71,7 @@ export const DeferredToolsControl$outboundSchema = z.object({
|
|
|
69
71
|
validation: Validation$outboundSchema,
|
|
70
72
|
}).transform((v) => {
|
|
71
73
|
return remap$(v, {
|
|
74
|
+
announceCatalogChanges: "announce_catalog_changes",
|
|
72
75
|
cascadeMode: "cascade_mode",
|
|
73
76
|
});
|
|
74
77
|
});
|
|
@@ -273,7 +273,7 @@ export type MessagesRequest = {
|
|
|
273
273
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
274
274
|
contextManagement?: ContextManagement | null | undefined;
|
|
275
275
|
/**
|
|
276
|
-
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation
|
|
276
|
+
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation. The portable profile needs the catalog unchanged across a continuation; the universal profile accepts a changed catalog and, with `announce_catalog_changes`, tells the model about it.
|
|
277
277
|
*/
|
|
278
278
|
deferredTools?: DeferredToolsControl | undefined;
|
|
279
279
|
/**
|
|
@@ -36,6 +36,10 @@ export type OutputToolSearchServerToolItem = {
|
|
|
36
36
|
* The ID of the model call that ran the search. Replaying the item reuses it.
|
|
37
37
|
*/
|
|
38
38
|
callId?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* What the announced index added and removed since the previous one, when the request opted into `announce_catalog_changes` and the catalog changed between model turns. Replaying the item shows the same lines.
|
|
41
|
+
*/
|
|
42
|
+
catalogChanges?: string | undefined;
|
|
39
43
|
/**
|
|
40
44
|
* The deferred-tool index the router showed the model with a pre-search, listing tool sources and names. Replaying the item shows the same index.
|
|
41
45
|
*/
|
|
@@ -55,6 +59,12 @@ export type OutputToolSearchServerToolItem = {
|
|
|
55
59
|
id?: string | undefined;
|
|
56
60
|
matches?: Array<Match> | undefined;
|
|
57
61
|
query?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* 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.
|
|
64
|
+
*/
|
|
65
|
+
sources?: {
|
|
66
|
+
[k: string]: Array<string>;
|
|
67
|
+
} | undefined;
|
|
58
68
|
status: FailableToolCallStatus;
|
|
59
69
|
/**
|
|
60
70
|
* 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.
|
|
@@ -90,6 +100,7 @@ export declare const OutputToolSearchServerToolItem$inboundSchema: z.ZodType<Out
|
|
|
90
100
|
export type OutputToolSearchServerToolItem$Outbound = {
|
|
91
101
|
arguments?: string | undefined;
|
|
92
102
|
call_id?: string | undefined;
|
|
103
|
+
catalog_changes?: string | undefined;
|
|
93
104
|
catalog_index?: string | undefined;
|
|
94
105
|
error?: string | undefined;
|
|
95
106
|
format?: string | undefined;
|
|
@@ -97,6 +108,9 @@ export type OutputToolSearchServerToolItem$Outbound = {
|
|
|
97
108
|
id?: string | undefined;
|
|
98
109
|
matches?: Array<Match$Outbound> | undefined;
|
|
99
110
|
query?: string | undefined;
|
|
111
|
+
sources?: {
|
|
112
|
+
[k: string]: Array<string>;
|
|
113
|
+
} | undefined;
|
|
100
114
|
status: string;
|
|
101
115
|
turn_call_ids?: Array<string> | undefined;
|
|
102
116
|
type: string;
|
|
@@ -55,6 +55,7 @@ export const OutputToolSearchServerToolItemType$outboundSchema = OutputToolSearc
|
|
|
55
55
|
export const OutputToolSearchServerToolItem$inboundSchema = z.object({
|
|
56
56
|
arguments: z.string().optional(),
|
|
57
57
|
call_id: z.string().optional(),
|
|
58
|
+
catalog_changes: z.string().optional(),
|
|
58
59
|
catalog_index: z.string().optional(),
|
|
59
60
|
error: z.string().optional(),
|
|
60
61
|
format: OutputToolSearchServerToolItemFormat$inboundSchema.optional(),
|
|
@@ -62,12 +63,14 @@ export const OutputToolSearchServerToolItem$inboundSchema = z.object({
|
|
|
62
63
|
id: z.string().optional(),
|
|
63
64
|
matches: z.array(z.lazy(() => Match$inboundSchema)).optional(),
|
|
64
65
|
query: z.string().optional(),
|
|
66
|
+
sources: z.record(z.string(), z.array(z.string())).optional(),
|
|
65
67
|
status: FailableToolCallStatus$inboundSchema,
|
|
66
68
|
turn_call_ids: z.array(z.string()).optional(),
|
|
67
69
|
type: OutputToolSearchServerToolItemType$inboundSchema,
|
|
68
70
|
}).transform((v) => {
|
|
69
71
|
return remap$(v, {
|
|
70
72
|
"call_id": "callId",
|
|
73
|
+
"catalog_changes": "catalogChanges",
|
|
71
74
|
"catalog_index": "catalogIndex",
|
|
72
75
|
"turn_call_ids": "turnCallIds",
|
|
73
76
|
});
|
|
@@ -76,6 +79,7 @@ export const OutputToolSearchServerToolItem$inboundSchema = z.object({
|
|
|
76
79
|
export const OutputToolSearchServerToolItem$outboundSchema = z.object({
|
|
77
80
|
arguments: z.string().optional(),
|
|
78
81
|
callId: z.string().optional(),
|
|
82
|
+
catalogChanges: z.string().optional(),
|
|
79
83
|
catalogIndex: z.string().optional(),
|
|
80
84
|
error: z.string().optional(),
|
|
81
85
|
format: OutputToolSearchServerToolItemFormat$outboundSchema.optional(),
|
|
@@ -83,12 +87,14 @@ export const OutputToolSearchServerToolItem$outboundSchema = z.object({
|
|
|
83
87
|
id: z.string().optional(),
|
|
84
88
|
matches: z.array(z.lazy(() => Match$outboundSchema)).optional(),
|
|
85
89
|
query: z.string().optional(),
|
|
90
|
+
sources: z.record(z.string(), z.array(z.string())).optional(),
|
|
86
91
|
status: FailableToolCallStatus$outboundSchema,
|
|
87
92
|
turnCallIds: z.array(z.string()).optional(),
|
|
88
93
|
type: OutputToolSearchServerToolItemType$outboundSchema,
|
|
89
94
|
}).transform((v) => {
|
|
90
95
|
return remap$(v, {
|
|
91
96
|
callId: "call_id",
|
|
97
|
+
catalogChanges: "catalog_changes",
|
|
92
98
|
catalogIndex: "catalog_index",
|
|
93
99
|
turnCallIds: "turn_call_ids",
|
|
94
100
|
});
|
|
@@ -212,7 +212,7 @@ export type ResponsesRequest = {
|
|
|
212
212
|
*/
|
|
213
213
|
debug?: ChatDebugOptions | undefined;
|
|
214
214
|
/**
|
|
215
|
-
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation
|
|
215
|
+
* Opt-in versioned router-level deferred-tool protocol. Replay assistant reasoning unchanged on continuation. The portable profile needs the catalog unchanged across a continuation; the universal profile accepts a changed catalog and, with `announce_catalog_changes`, tells the model about it.
|
|
216
216
|
*/
|
|
217
217
|
deferredTools?: DeferredToolsControl | undefined;
|
|
218
218
|
frequencyPenalty?: number | null | undefined;
|
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.67",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
-
"test:transit": "exit 0",
|
|
78
|
-
"typecheck:transit": "exit 0",
|
|
79
77
|
"prepare": "npm run build",
|
|
80
|
-
"test": "vitest --run --project unit",
|
|
81
78
|
"test:e2e": "vitest --run --project e2e",
|
|
79
|
+
"test:transit": "exit 0",
|
|
82
80
|
"test:watch": "vitest --watch --project unit",
|
|
83
81
|
"typecheck": "tsc --noEmit",
|
|
84
|
-
"
|
|
82
|
+
"typecheck:transit": "exit 0",
|
|
83
|
+
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
84
|
+
"test": "vitest --run --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|