@openrouter/sdk 1.5.67 → 1.5.69
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/deferredbm25search.d.ts +5 -0
- package/esm/models/deferredbm25search.js +2 -0
- package/esm/models/deferredregexsearch.d.ts +5 -0
- package/esm/models/deferredregexsearch.js +2 -0
- package/esm/models/deferredtoolscontrol.d.ts +8 -3
- package/esm/models/deferredtoolscontrol.js +3 -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.69";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.69 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.69",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.69 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -4,6 +4,10 @@ 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. When true, a search that matches nothing also names the deferred sources this search covers (namespaces, MCP servers, and shared `<server>_` prefixes; up to 40 names or 2,000 characters, with a count of any omitted) and tells the model that a source the search does not cover is unreachable through it in this request, so it can make a client tool call the task already needs (or a read-only one) and search again on a later turn instead of concluding the integration is missing. A hit gets the same guidance after its matches when, as a heuristic on the model's own words, the query's leading word has 3 to 64 characters, no query word names a searchable source, and no deferred tool's name or indexed description (its own and its namespace's) carries the leading word (`jira create issue` answered with another tracker's issue tools). Direct tools, including a client's built-in tools, are already in the tool list and are not named. Absent or false: a miss suggests other keywords and the closest names only.
|
|
9
|
+
*/
|
|
10
|
+
missSources?: boolean | undefined;
|
|
7
11
|
/**
|
|
8
12
|
* 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
13
|
*/
|
|
@@ -17,6 +21,7 @@ export type DeferredBm25Search = {
|
|
|
17
21
|
/** @internal */
|
|
18
22
|
export type DeferredBm25Search$Outbound = {
|
|
19
23
|
max_results?: number | undefined;
|
|
24
|
+
miss_sources?: boolean | undefined;
|
|
20
25
|
siblings?: boolean | undefined;
|
|
21
26
|
spread?: boolean | undefined;
|
|
22
27
|
type: "bm25";
|
|
@@ -7,12 +7,14 @@ 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
|
+
missSources: z.boolean().optional(),
|
|
10
11
|
siblings: z.boolean().optional(),
|
|
11
12
|
spread: z.boolean().optional(),
|
|
12
13
|
type: z.literal("bm25"),
|
|
13
14
|
}).transform((v) => {
|
|
14
15
|
return remap$(v, {
|
|
15
16
|
maxResults: "max_results",
|
|
17
|
+
missSources: "miss_sources",
|
|
16
18
|
});
|
|
17
19
|
});
|
|
18
20
|
export function deferredBm25SearchToJSON(deferredBm25Search) {
|
|
@@ -4,6 +4,10 @@ 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. When true, a search that matches nothing also names the deferred sources this search covers (namespaces, MCP servers, and shared `<server>_` prefixes; up to 40 names or 2,000 characters, with a count of any omitted) and tells the model that a source the search does not cover is unreachable through it in this request, so it can make a client tool call the task already needs (or a read-only one) and search again on a later turn instead of concluding the integration is missing. A hit gets the same guidance after its matches when, as a heuristic on the model's own words, the query's leading word has 3 to 64 characters, no query word names a searchable source, and no deferred tool's name or indexed description (its own and its namespace's) carries the leading word (`jira create issue` answered with another tracker's issue tools). Direct tools, including a client's built-in tools, are already in the tool list and are not named. Absent or false: a miss suggests other keywords and the closest names only.
|
|
9
|
+
*/
|
|
10
|
+
missSources?: boolean | undefined;
|
|
7
11
|
/**
|
|
8
12
|
* 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
13
|
*/
|
|
@@ -13,6 +17,7 @@ export type DeferredRegexSearch = {
|
|
|
13
17
|
/** @internal */
|
|
14
18
|
export type DeferredRegexSearch$Outbound = {
|
|
15
19
|
max_results?: number | undefined;
|
|
20
|
+
miss_sources?: boolean | undefined;
|
|
16
21
|
siblings?: boolean | undefined;
|
|
17
22
|
type: "regex";
|
|
18
23
|
};
|
|
@@ -7,11 +7,13 @@ 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
|
+
missSources: z.boolean().optional(),
|
|
10
11
|
siblings: z.boolean().optional(),
|
|
11
12
|
type: z.literal("regex"),
|
|
12
13
|
}).transform((v) => {
|
|
13
14
|
return remap$(v, {
|
|
14
15
|
maxResults: "max_results",
|
|
16
|
+
missSources: "miss_sources",
|
|
15
17
|
});
|
|
16
18
|
});
|
|
17
19
|
export function deferredRegexSearchToJSON(deferredRegexSearch) {
|
|
@@ -24,14 +24,14 @@ export declare const Interface: {
|
|
|
24
24
|
*/
|
|
25
25
|
export type Interface = OpenEnum<typeof Interface>;
|
|
26
26
|
/**
|
|
27
|
-
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
27
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes (unless `min_deferred_tools` inlines a small catalog), and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
28
28
|
*/
|
|
29
29
|
export declare const Profile: {
|
|
30
30
|
readonly Portable: "portable";
|
|
31
31
|
readonly Universal: "universal";
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
34
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes (unless `min_deferred_tools` inlines a small catalog), and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
35
35
|
*/
|
|
36
36
|
export type Profile = OpenEnum<typeof Profile>;
|
|
37
37
|
export declare const Protocol: {
|
|
@@ -81,7 +81,11 @@ export type DeferredToolsControl = {
|
|
|
81
81
|
*/
|
|
82
82
|
interface?: Interface | undefined;
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Universal profile only. When fewer tools than this would be deferred, the universal profile defers none of them and sends the client tools unchanged, so a harness with a handful of non-core tools and no MCP servers pays no search turn for them. Counted after the interface exclusions; ignored with a custom search, whose client decides what it loads. Absent: every wrappable tool in scope is deferred.
|
|
85
|
+
*/
|
|
86
|
+
minDeferredTools?: number | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes (unless `min_deferred_tools` inlines a small catalog), and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
85
89
|
*/
|
|
86
90
|
profile: Profile;
|
|
87
91
|
protocol: Protocol;
|
|
@@ -116,6 +120,7 @@ export type DeferredToolsControl$Outbound = {
|
|
|
116
120
|
cascade_mode?: string | undefined;
|
|
117
121
|
hint?: string | undefined;
|
|
118
122
|
interface?: string | undefined;
|
|
123
|
+
min_deferred_tools?: number | undefined;
|
|
119
124
|
profile: string;
|
|
120
125
|
protocol: string;
|
|
121
126
|
scope?: string | undefined;
|
|
@@ -21,7 +21,7 @@ export const Interface = {
|
|
|
21
21
|
CodeMode: "code_mode",
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes, and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
24
|
+
* Loading profile. `portable` serves the `defer_loading` tools with router-built search and call wrappers on any model and keeps the catalog fixed. `universal` defers every wrappable tool behind the same wrappers so the provider-facing tool list never changes (unless `min_deferred_tools` inlines a small catalog), and rebuilds the catalog from each request so tools can be added or removed mid-conversation.
|
|
25
25
|
*/
|
|
26
26
|
export const Profile = {
|
|
27
27
|
Portable: "portable",
|
|
@@ -64,6 +64,7 @@ export const DeferredToolsControl$outboundSchema = z.object({
|
|
|
64
64
|
cascadeMode: CascadeMode$outboundSchema.optional(),
|
|
65
65
|
hint: z.string().optional(),
|
|
66
66
|
interface: Interface$outboundSchema.optional(),
|
|
67
|
+
minDeferredTools: z.int().optional(),
|
|
67
68
|
profile: Profile$outboundSchema,
|
|
68
69
|
protocol: Protocol$outboundSchema,
|
|
69
70
|
scope: DeferredToolsControlScope$outboundSchema.optional(),
|
|
@@ -73,6 +74,7 @@ export const DeferredToolsControl$outboundSchema = z.object({
|
|
|
73
74
|
return remap$(v, {
|
|
74
75
|
announceCatalogChanges: "announce_catalog_changes",
|
|
75
76
|
cascadeMode: "cascade_mode",
|
|
77
|
+
minDeferredTools: "min_deferred_tools",
|
|
76
78
|
});
|
|
77
79
|
});
|
|
78
80
|
export function deferredToolsControlToJSON(deferredToolsControl) {
|
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.69",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
76
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
78
|
"prepare": "npm run build",
|
|
78
|
-
"test
|
|
79
|
-
"test:transit": "exit 0",
|
|
79
|
+
"test": "vitest --run --project unit",
|
|
80
80
|
"test:watch": "vitest --watch --project unit",
|
|
81
81
|
"typecheck": "tsc --noEmit",
|
|
82
82
|
"typecheck:transit": "exit 0",
|
|
83
|
-
"
|
|
84
|
-
"test": "
|
|
83
|
+
"test:e2e": "vitest --run --project e2e",
|
|
84
|
+
"test:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|