@openrouter/sdk 1.0.0 → 1.0.1
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/README.md +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/fusionservertoolconfig.d.ts +1 -1
- package/esm/models/outputbashservertoolitem.d.ts +10 -0
- package/esm/models/outputbashservertoolitem.js +13 -0
- package/esm/models/outputsubagentservertoolitem.d.ts +10 -0
- package/esm/models/outputsubagentservertoolitem.js +6 -0
- package/esm/models/subagentservertoolconfig.d.ts +6 -1
- package/esm/models/subagentservertoolconfig.js +1 -0
- package/esm/models/subagentservertoolopenrouter.d.ts +1 -1
- package/jsr.json +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -190,7 +190,7 @@ run();
|
|
|
190
190
|
|
|
191
191
|
You can setup your SDK to emit debug logs for SDK requests and responses.
|
|
192
192
|
|
|
193
|
-
You can pass a logger that matches
|
|
193
|
+
You can pass a logger that matches `console`'s interface as an SDK option.
|
|
194
194
|
|
|
195
195
|
> [!WARNING]
|
|
196
196
|
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -49,8 +49,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
49
49
|
export declare const SDK_METADATA: {
|
|
50
50
|
readonly language: "typescript";
|
|
51
51
|
readonly openapiDocVersion: "1.0.0";
|
|
52
|
-
readonly sdkVersion: "1.0.
|
|
52
|
+
readonly sdkVersion: "1.0.1";
|
|
53
53
|
readonly genVersion: "2.914.0";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.0.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.0.1 2.914.0 1.0.0 @openrouter/sdk";
|
|
55
55
|
};
|
|
56
56
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export function serverURLFromOptions(options) {
|
|
|
26
26
|
export const SDK_METADATA = {
|
|
27
27
|
language: "typescript",
|
|
28
28
|
openapiDocVersion: "1.0.0",
|
|
29
|
-
sdkVersion: "1.0.
|
|
29
|
+
sdkVersion: "1.0.1",
|
|
30
30
|
genVersion: "2.914.0",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 1.0.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 1.0.1 2.914.0 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -55,7 +55,7 @@ export type FusionServerToolConfig = {
|
|
|
55
55
|
*/
|
|
56
56
|
cacheControl?: AnthropicCacheControlDirective | undefined;
|
|
57
57
|
/**
|
|
58
|
-
* Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to
|
|
58
|
+
* Maximum number of output tokens (including reasoning tokens) each panelist and the judge model may produce per inner call. Controls the total output budget so reasoning-heavy models like GPT-5.5 do not exhaust their token allowance before producing visible text. When omitted, panelists default to 32000 and the judge to 20000.
|
|
59
59
|
*/
|
|
60
60
|
maxCompletionTokens?: number | undefined;
|
|
61
61
|
/**
|
|
@@ -11,6 +11,14 @@ export type OutputBashServerToolItemType = ClosedEnum<typeof OutputBashServerToo
|
|
|
11
11
|
* An openrouter:bash server tool output item
|
|
12
12
|
*/
|
|
13
13
|
export type OutputBashServerToolItem = {
|
|
14
|
+
/**
|
|
15
|
+
* The raw tool-call arguments string as emitted by the model.
|
|
16
|
+
*/
|
|
17
|
+
arguments?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The model-generated tool call id from the originating turn.
|
|
20
|
+
*/
|
|
21
|
+
callId?: string | undefined;
|
|
14
22
|
command?: string | undefined;
|
|
15
23
|
exitCode?: number | undefined;
|
|
16
24
|
id?: string | undefined;
|
|
@@ -27,6 +35,8 @@ export declare const OutputBashServerToolItemType$outboundSchema: z.ZodEnum<type
|
|
|
27
35
|
export declare const OutputBashServerToolItem$inboundSchema: z.ZodType<OutputBashServerToolItem, unknown>;
|
|
28
36
|
/** @internal */
|
|
29
37
|
export type OutputBashServerToolItem$Outbound = {
|
|
38
|
+
arguments?: string | undefined;
|
|
39
|
+
call_id?: string | undefined;
|
|
30
40
|
command?: string | undefined;
|
|
31
41
|
exitCode?: number | undefined;
|
|
32
42
|
id?: string | undefined;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @generated-id: 8eeee25f4818
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../lib/schemas.js";
|
|
7
8
|
import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
|
|
8
9
|
export const OutputBashServerToolItemType = {
|
|
@@ -14,6 +15,8 @@ export const OutputBashServerToolItemType$inboundSchema = z.enum(OutputBashServe
|
|
|
14
15
|
export const OutputBashServerToolItemType$outboundSchema = OutputBashServerToolItemType$inboundSchema;
|
|
15
16
|
/** @internal */
|
|
16
17
|
export const OutputBashServerToolItem$inboundSchema = z.object({
|
|
18
|
+
arguments: z.string().optional(),
|
|
19
|
+
call_id: z.string().optional(),
|
|
17
20
|
command: z.string().optional(),
|
|
18
21
|
exitCode: z.int().optional(),
|
|
19
22
|
id: z.string().optional(),
|
|
@@ -21,9 +24,15 @@ export const OutputBashServerToolItem$inboundSchema = z.object({
|
|
|
21
24
|
stderr: z.string().optional(),
|
|
22
25
|
stdout: z.string().optional(),
|
|
23
26
|
type: OutputBashServerToolItemType$inboundSchema,
|
|
27
|
+
}).transform((v) => {
|
|
28
|
+
return remap$(v, {
|
|
29
|
+
"call_id": "callId",
|
|
30
|
+
});
|
|
24
31
|
});
|
|
25
32
|
/** @internal */
|
|
26
33
|
export const OutputBashServerToolItem$outboundSchema = z.object({
|
|
34
|
+
arguments: z.string().optional(),
|
|
35
|
+
callId: z.string().optional(),
|
|
27
36
|
command: z.string().optional(),
|
|
28
37
|
exitCode: z.int().optional(),
|
|
29
38
|
id: z.string().optional(),
|
|
@@ -31,6 +40,10 @@ export const OutputBashServerToolItem$outboundSchema = z.object({
|
|
|
31
40
|
stderr: z.string().optional(),
|
|
32
41
|
stdout: z.string().optional(),
|
|
33
42
|
type: OutputBashServerToolItemType$outboundSchema,
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
callId: "call_id",
|
|
46
|
+
});
|
|
34
47
|
});
|
|
35
48
|
export function outputBashServerToolItemToJSON(outputBashServerToolItem) {
|
|
36
49
|
return JSON.stringify(OutputBashServerToolItem$outboundSchema.parse(outputBashServerToolItem));
|
|
@@ -16,10 +16,18 @@ export type OutputSubagentServerToolItem = {
|
|
|
16
16
|
*/
|
|
17
17
|
error?: string | undefined;
|
|
18
18
|
id?: string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Provider-safe function name of the specific subagent instance that produced this item (e.g. `openrouter_subagent__1`). Present only on items from non-default instances — the second and later subagent entries in the request `tools` array. The first (default) instance omits it, even when multiple subagents are configured. When a replayed item echoes this field back, the transcript rehydrates the call under that instance's tool. This identity is positional: it is derived from the index of the subagent entry in the request `tools` array, so keep the order of subagent entries stable across requests in a conversation.
|
|
21
|
+
*/
|
|
22
|
+
instanceName?: string | undefined;
|
|
19
23
|
/**
|
|
20
24
|
* Slug of the worker model that executed the task.
|
|
21
25
|
*/
|
|
22
26
|
model?: string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Configured name of the subagent that executed the task (the `name` on its tool entry). Present only for named subagents; omitted for an unnamed (default) subagent.
|
|
29
|
+
*/
|
|
30
|
+
name?: string | undefined;
|
|
23
31
|
/**
|
|
24
32
|
* The worker model's result (the outcome text returned to the delegating model).
|
|
25
33
|
*/
|
|
@@ -45,7 +53,9 @@ export declare const OutputSubagentServerToolItem$inboundSchema: z.ZodType<Outpu
|
|
|
45
53
|
export type OutputSubagentServerToolItem$Outbound = {
|
|
46
54
|
error?: string | undefined;
|
|
47
55
|
id?: string | undefined;
|
|
56
|
+
instance_name?: string | undefined;
|
|
48
57
|
model?: string | undefined;
|
|
58
|
+
name?: string | undefined;
|
|
49
59
|
outcome?: string | undefined;
|
|
50
60
|
status: string;
|
|
51
61
|
task_description?: string | undefined;
|
|
@@ -17,7 +17,9 @@ export const OutputSubagentServerToolItemType$outboundSchema = OutputSubagentSer
|
|
|
17
17
|
export const OutputSubagentServerToolItem$inboundSchema = z.object({
|
|
18
18
|
error: z.string().optional(),
|
|
19
19
|
id: z.string().optional(),
|
|
20
|
+
instance_name: z.string().optional(),
|
|
20
21
|
model: z.string().optional(),
|
|
22
|
+
name: z.string().optional(),
|
|
21
23
|
outcome: z.string().optional(),
|
|
22
24
|
status: ToolCallStatus$inboundSchema,
|
|
23
25
|
task_description: z.string().optional(),
|
|
@@ -25,6 +27,7 @@ export const OutputSubagentServerToolItem$inboundSchema = z.object({
|
|
|
25
27
|
type: OutputSubagentServerToolItemType$inboundSchema,
|
|
26
28
|
}).transform((v) => {
|
|
27
29
|
return remap$(v, {
|
|
30
|
+
"instance_name": "instanceName",
|
|
28
31
|
"task_description": "taskDescription",
|
|
29
32
|
"task_name": "taskName",
|
|
30
33
|
});
|
|
@@ -33,7 +36,9 @@ export const OutputSubagentServerToolItem$inboundSchema = z.object({
|
|
|
33
36
|
export const OutputSubagentServerToolItem$outboundSchema = z.object({
|
|
34
37
|
error: z.string().optional(),
|
|
35
38
|
id: z.string().optional(),
|
|
39
|
+
instanceName: z.string().optional(),
|
|
36
40
|
model: z.string().optional(),
|
|
41
|
+
name: z.string().optional(),
|
|
37
42
|
outcome: z.string().optional(),
|
|
38
43
|
status: ToolCallStatus$outboundSchema,
|
|
39
44
|
taskDescription: z.string().optional(),
|
|
@@ -41,6 +46,7 @@ export const OutputSubagentServerToolItem$outboundSchema = z.object({
|
|
|
41
46
|
type: OutputSubagentServerToolItemType$outboundSchema,
|
|
42
47
|
}).transform((v) => {
|
|
43
48
|
return remap$(v, {
|
|
49
|
+
instanceName: "instance_name",
|
|
44
50
|
taskDescription: "task_description",
|
|
45
51
|
taskName: "task_name",
|
|
46
52
|
});
|
|
@@ -2,7 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { SubagentNestedTool, SubagentNestedTool$Outbound } from "./subagentnestedtool.js";
|
|
3
3
|
import { SubagentReasoning, SubagentReasoning$Outbound } from "./subagentreasoning.js";
|
|
4
4
|
/**
|
|
5
|
-
* Configuration for
|
|
5
|
+
* Configuration for one openrouter:subagent server tool entry.
|
|
6
6
|
*/
|
|
7
7
|
export type SubagentServerToolConfig = {
|
|
8
8
|
/**
|
|
@@ -21,6 +21,10 @@ export type SubagentServerToolConfig = {
|
|
|
21
21
|
* Slug of the model that executes delegated tasks (any OpenRouter model). Typically a smaller, cheaper, faster model than the one delegating. When omitted, the model from the outer API request is used. The subagent tool itself cannot be the subagent model.
|
|
22
22
|
*/
|
|
23
23
|
model?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Optional name for this subagent. The model sees one tool per named subagent (and one default for an unnamed entry). Names must be unique across subagent entries. Letters, digits, spaces, underscores, and dashes; trimmed; 1–64 chars.
|
|
26
|
+
*/
|
|
27
|
+
name?: string | undefined;
|
|
24
28
|
/**
|
|
25
29
|
* Reasoning configuration forwarded to the subagent call. Use this to control reasoning effort and token budget for models that support extended thinking.
|
|
26
30
|
*/
|
|
@@ -40,6 +44,7 @@ export type SubagentServerToolConfig$Outbound = {
|
|
|
40
44
|
max_completion_tokens?: number | undefined;
|
|
41
45
|
max_tool_calls?: number | undefined;
|
|
42
46
|
model?: string | undefined;
|
|
47
|
+
name?: string | undefined;
|
|
43
48
|
reasoning?: SubagentReasoning$Outbound | undefined;
|
|
44
49
|
temperature?: number | undefined;
|
|
45
50
|
tools?: Array<SubagentNestedTool$Outbound> | undefined;
|
|
@@ -12,6 +12,7 @@ export const SubagentServerToolConfig$outboundSchema = z.object({
|
|
|
12
12
|
maxCompletionTokens: z.int().optional(),
|
|
13
13
|
maxToolCalls: z.int().optional(),
|
|
14
14
|
model: z.string().optional(),
|
|
15
|
+
name: z.string().optional(),
|
|
15
16
|
reasoning: SubagentReasoning$outboundSchema.optional(),
|
|
16
17
|
temperature: z.number().optional(),
|
|
17
18
|
tools: z.array(SubagentNestedTool$outboundSchema).optional(),
|
|
@@ -10,7 +10,7 @@ export type SubagentServerToolOpenRouterType = ClosedEnum<typeof SubagentServerT
|
|
|
10
10
|
*/
|
|
11
11
|
export type SubagentServerToolOpenRouter = {
|
|
12
12
|
/**
|
|
13
|
-
* Configuration for
|
|
13
|
+
* Configuration for one openrouter:subagent server tool entry.
|
|
14
14
|
*/
|
|
15
15
|
parameters?: SubagentServerToolConfig | undefined;
|
|
16
16
|
type: SubagentServerToolOpenRouterType;
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
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
|
-
"compile": "tsc",
|
|
77
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
77
|
"prepare": "npm run build",
|
|
79
|
-
"test": "vitest --run --project unit",
|
|
80
78
|
"test:transit": "exit 0",
|
|
81
|
-
"test:e2e": "vitest --run --project e2e",
|
|
82
79
|
"test:watch": "vitest --watch --project unit",
|
|
83
80
|
"typecheck": "tsc --noEmit",
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
81
|
+
"typecheck:transit": "exit 0",
|
|
82
|
+
"compile": "tsc",
|
|
83
|
+
"test": "vitest --run --project unit",
|
|
84
|
+
"test:e2e": "vitest --run --project e2e"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|