@openrouter/sdk 1.5.66 → 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.
@@ -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.66";
53
+ readonly sdkVersion: "1.5.67";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.66 2.950.13 1.0.0 @openrouter/sdk";
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.66",
32
+ sdkVersion: "1.5.67",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.66 2.950.13 1.0.0 @openrouter/sdk",
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; keep the catalog unchanged.
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
  /**
@@ -8,12 +8,17 @@ export type DeferredBm25Search = {
8
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
9
  */
10
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;
11
15
  type: "bm25";
12
16
  };
13
17
  /** @internal */
14
18
  export type DeferredBm25Search$Outbound = {
15
19
  max_results?: number | undefined;
16
20
  siblings?: boolean | undefined;
21
+ spread?: boolean | undefined;
17
22
  type: "bm25";
18
23
  };
19
24
  /** @internal */
@@ -8,6 +8,7 @@ import { remap as remap$ } from "../lib/primitives.js";
8
8
  export const DeferredBm25Search$outboundSchema = z.object({
9
9
  maxResults: z.int().optional(),
10
10
  siblings: z.boolean().optional(),
11
+ spread: z.boolean().optional(),
11
12
  type: z.literal("bm25"),
12
13
  }).transform((v) => {
13
14
  return remap$(v, {
@@ -61,9 +61,13 @@ 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; keep the catalog unchanged.
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
  */
@@ -108,6 +112,7 @@ export declare const DeferredToolsControlScope$outboundSchema: z.ZodType<string,
108
112
  export declare const Validation$outboundSchema: z.ZodEnum<typeof Validation>;
109
113
  /** @internal */
110
114
  export type DeferredToolsControl$Outbound = {
115
+ announce_catalog_changes?: boolean | undefined;
111
116
  cascade_mode?: string | undefined;
112
117
  hint?: string | undefined;
113
118
  interface?: string | undefined;
@@ -60,6 +60,7 @@ 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(),
64
65
  hint: z.string().optional(),
65
66
  interface: Interface$outboundSchema.optional(),
@@ -70,6 +71,7 @@ export const DeferredToolsControl$outboundSchema = z.object({
70
71
  validation: Validation$outboundSchema,
71
72
  }).transform((v) => {
72
73
  return remap$(v, {
74
+ announceCatalogChanges: "announce_catalog_changes",
73
75
  cascadeMode: "cascade_mode",
74
76
  });
75
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; keep the catalog unchanged.
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
  */
@@ -96,6 +100,7 @@ export declare const OutputToolSearchServerToolItem$inboundSchema: z.ZodType<Out
96
100
  export type OutputToolSearchServerToolItem$Outbound = {
97
101
  arguments?: string | undefined;
98
102
  call_id?: string | undefined;
103
+ catalog_changes?: string | undefined;
99
104
  catalog_index?: string | undefined;
100
105
  error?: string | undefined;
101
106
  format?: string | undefined;
@@ -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(),
@@ -69,6 +70,7 @@ export const OutputToolSearchServerToolItem$inboundSchema = z.object({
69
70
  }).transform((v) => {
70
71
  return remap$(v, {
71
72
  "call_id": "callId",
73
+ "catalog_changes": "catalogChanges",
72
74
  "catalog_index": "catalogIndex",
73
75
  "turn_call_ids": "turnCallIds",
74
76
  });
@@ -77,6 +79,7 @@ export const OutputToolSearchServerToolItem$inboundSchema = z.object({
77
79
  export const OutputToolSearchServerToolItem$outboundSchema = z.object({
78
80
  arguments: z.string().optional(),
79
81
  callId: z.string().optional(),
82
+ catalogChanges: z.string().optional(),
80
83
  catalogIndex: z.string().optional(),
81
84
  error: z.string().optional(),
82
85
  format: OutputToolSearchServerToolItemFormat$outboundSchema.optional(),
@@ -91,6 +94,7 @@ export const OutputToolSearchServerToolItem$outboundSchema = z.object({
91
94
  }).transform((v) => {
92
95
  return remap$(v, {
93
96
  callId: "call_id",
97
+ catalogChanges: "catalog_changes",
94
98
  catalogIndex: "catalog_index",
95
99
  turnCallIds: "turn_call_ids",
96
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; keep the catalog unchanged.
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.66",
5
+ "version": "1.5.67",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.5.66",
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
- "access": "public",
25
- "provenance": true
24
+ "provenance": true,
25
+ "access": "public"
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
- "typecheck:transit": "exit 0",
77
76
  "postinstall": "node scripts/check-types.js || true",
78
77
  "prepare": "npm run build",
79
- "test": "vitest --run --project unit",
80
78
  "test:e2e": "vitest --run --project e2e",
81
79
  "test:transit": "exit 0",
80
+ "test:watch": "vitest --watch --project unit",
82
81
  "typecheck": "tsc --noEmit",
82
+ "typecheck:transit": "exit 0",
83
83
  "compile": "tsc && node scripts/unbarrel-imports.js",
84
- "test:watch": "vitest --watch --project unit"
84
+ "test": "vitest --run --project unit"
85
85
  },
86
86
  "peerDependencies": {
87
87