@openrouter/sdk 1.2.129 → 1.2.130
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/outputbashservertoolitem.d.ts +7 -2
- package/esm/models/outputbashservertoolitem.js +5 -3
- package/esm/models/outputshellcalloutputitem.d.ts +5 -1
- package/esm/models/outputshellcalloutputitem.js +1 -0
- package/esm/models/outputshellservertoolitem.d.ts +7 -2
- package/esm/models/outputshellservertoolitem.js +5 -3
- package/esm/models/shellcalloutputitem.d.ts +5 -0
- package/esm/models/shellcalloutputitem.js +1 -0
- 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.2.
|
|
53
|
+
readonly sdkVersion: "1.2.130";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.130 2.914.0 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.2.
|
|
32
|
+
sdkVersion: "1.2.130",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.130 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -2,7 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
import {
|
|
5
|
+
import { FailableToolCallStatus } from "./failabletoolcallstatus.js";
|
|
6
6
|
export declare const OutputBashServerToolItemTypeContainerFileCitation: {
|
|
7
7
|
readonly ContainerFileCitation: "container_file_citation";
|
|
8
8
|
};
|
|
@@ -36,13 +36,17 @@ export type OutputBashServerToolItem = {
|
|
|
36
36
|
* The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.
|
|
37
37
|
*/
|
|
38
38
|
containerId?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The error message when the sandbox call failed before producing a result (for example, the per-user container limit was reached). Set together with `status: 'failed'`; absent on a successful call. A non-zero `exitCode` is a command failure, not a tool failure.
|
|
41
|
+
*/
|
|
42
|
+
error?: string | undefined;
|
|
39
43
|
exitCode?: number | undefined;
|
|
40
44
|
/**
|
|
41
45
|
* Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.
|
|
42
46
|
*/
|
|
43
47
|
files?: Array<OutputBashServerToolItemFile> | undefined;
|
|
44
48
|
id?: string | undefined;
|
|
45
|
-
status:
|
|
49
|
+
status: FailableToolCallStatus;
|
|
46
50
|
stderr?: string | undefined;
|
|
47
51
|
stdout?: string | undefined;
|
|
48
52
|
type: OutputBashServerToolItemTypeOpenrouterBash;
|
|
@@ -78,6 +82,7 @@ export type OutputBashServerToolItem$Outbound = {
|
|
|
78
82
|
call_id?: string | null | undefined;
|
|
79
83
|
command?: string | undefined;
|
|
80
84
|
container_id?: string | undefined;
|
|
85
|
+
error?: string | undefined;
|
|
81
86
|
exitCode?: number | undefined;
|
|
82
87
|
files?: Array<OutputBashServerToolItemFile$Outbound> | undefined;
|
|
83
88
|
id?: string | undefined;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import { FailableToolCallStatus$inboundSchema, FailableToolCallStatus$outboundSchema, } from "./failabletoolcallstatus.js";
|
|
9
9
|
export const OutputBashServerToolItemTypeContainerFileCitation = {
|
|
10
10
|
ContainerFileCitation: "container_file_citation",
|
|
11
11
|
};
|
|
@@ -64,11 +64,12 @@ export const OutputBashServerToolItem$inboundSchema = z.object({
|
|
|
64
64
|
call_id: z.nullable(z.string()).optional(),
|
|
65
65
|
command: z.string().optional(),
|
|
66
66
|
container_id: z.string().optional(),
|
|
67
|
+
error: z.string().optional(),
|
|
67
68
|
exitCode: z.int().optional(),
|
|
68
69
|
files: z.array(z.lazy(() => OutputBashServerToolItemFile$inboundSchema))
|
|
69
70
|
.optional(),
|
|
70
71
|
id: z.string().optional(),
|
|
71
|
-
status:
|
|
72
|
+
status: FailableToolCallStatus$inboundSchema,
|
|
72
73
|
stderr: z.string().optional(),
|
|
73
74
|
stdout: z.string().optional(),
|
|
74
75
|
type: OutputBashServerToolItemTypeOpenrouterBash$inboundSchema,
|
|
@@ -84,11 +85,12 @@ export const OutputBashServerToolItem$outboundSchema = z.object({
|
|
|
84
85
|
callId: z.nullable(z.string()).optional(),
|
|
85
86
|
command: z.string().optional(),
|
|
86
87
|
containerId: z.string().optional(),
|
|
88
|
+
error: z.string().optional(),
|
|
87
89
|
exitCode: z.int().optional(),
|
|
88
90
|
files: z.array(z.lazy(() => OutputBashServerToolItemFile$outboundSchema))
|
|
89
91
|
.optional(),
|
|
90
92
|
id: z.string().optional(),
|
|
91
|
-
status:
|
|
93
|
+
status: FailableToolCallStatus$outboundSchema,
|
|
92
94
|
stderr: z.string().optional(),
|
|
93
95
|
stdout: z.string().optional(),
|
|
94
96
|
type: OutputBashServerToolItemTypeOpenrouterBash$outboundSchema,
|
|
@@ -17,7 +17,7 @@ export type OutputShellCallOutputItemFile = {
|
|
|
17
17
|
type: OutputShellCallOutputItemTypeContainerFileCitation;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
|
-
* A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome.
|
|
20
|
+
* A native `shell_call_output` item matching OpenAI's Responses API shape. Carries per-command stdout, stderr, and the exit/timeout outcome. A sandbox failure terminates the item as `incomplete` with `error` set.
|
|
21
21
|
*/
|
|
22
22
|
export type OutputShellCallOutputItem = {
|
|
23
23
|
callId: string;
|
|
@@ -25,6 +25,10 @@ export type OutputShellCallOutputItem = {
|
|
|
25
25
|
* The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.
|
|
26
26
|
*/
|
|
27
27
|
containerId?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The error message when the sandbox call failed before producing a result (for example, the per-user container limit was reached). Set together with `status: 'incomplete'` and an empty `output`; absent on a successful call.
|
|
30
|
+
*/
|
|
31
|
+
error?: string | undefined;
|
|
28
32
|
/**
|
|
29
33
|
* Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.
|
|
30
34
|
*/
|
|
@@ -35,6 +35,7 @@ export function outputShellCallOutputItemFileFromJSON(jsonString) {
|
|
|
35
35
|
export const OutputShellCallOutputItem$inboundSchema = z.object({
|
|
36
36
|
call_id: z.string(),
|
|
37
37
|
container_id: z.string().optional(),
|
|
38
|
+
error: z.string().optional(),
|
|
38
39
|
files: z.array(z.lazy(() => OutputShellCallOutputItemFile$inboundSchema))
|
|
39
40
|
.optional(),
|
|
40
41
|
id: z.string(),
|
|
@@ -2,8 +2,8 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { FailableToolCallStatus } from "./failabletoolcallstatus.js";
|
|
5
6
|
import { ShellCallOutputContent, ShellCallOutputContent$Outbound } from "./shellcalloutputcontent.js";
|
|
6
|
-
import { ToolCallStatus } from "./toolcallstatus.js";
|
|
7
7
|
export type OutputShellServerToolItemAction = {
|
|
8
8
|
commands: Array<string>;
|
|
9
9
|
maxOutputLength?: number | null | undefined;
|
|
@@ -42,13 +42,17 @@ export type OutputShellServerToolItem = {
|
|
|
42
42
|
* The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.
|
|
43
43
|
*/
|
|
44
44
|
containerId?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The error message when the sandbox call failed before producing a result (for example, the per-user container limit was reached). Set together with `status: 'failed'`; absent on a successful call. `output` is omitted when `error` is set.
|
|
47
|
+
*/
|
|
48
|
+
error?: string | undefined;
|
|
45
49
|
/**
|
|
46
50
|
* Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.
|
|
47
51
|
*/
|
|
48
52
|
files?: Array<OutputShellServerToolItemFile> | undefined;
|
|
49
53
|
id?: string | undefined;
|
|
50
54
|
output?: Array<ShellCallOutputContent> | undefined;
|
|
51
|
-
status:
|
|
55
|
+
status: FailableToolCallStatus;
|
|
52
56
|
type: OutputShellServerToolItemTypeOpenrouterShell;
|
|
53
57
|
};
|
|
54
58
|
/** @internal */
|
|
@@ -94,6 +98,7 @@ export type OutputShellServerToolItem$Outbound = {
|
|
|
94
98
|
arguments?: string | null | undefined;
|
|
95
99
|
call_id?: string | null | undefined;
|
|
96
100
|
container_id?: string | undefined;
|
|
101
|
+
error?: string | undefined;
|
|
97
102
|
files?: Array<OutputShellServerToolItemFile$Outbound> | undefined;
|
|
98
103
|
id?: string | undefined;
|
|
99
104
|
output?: Array<ShellCallOutputContent$Outbound> | undefined;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { FailableToolCallStatus$inboundSchema, FailableToolCallStatus$outboundSchema, } from "./failabletoolcallstatus.js";
|
|
8
9
|
import { ShellCallOutputContent$inboundSchema, ShellCallOutputContent$outboundSchema, } from "./shellcalloutputcontent.js";
|
|
9
|
-
import { ToolCallStatus$inboundSchema, ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
|
|
10
10
|
export const OutputShellServerToolItemTypeContainerFileCitation = {
|
|
11
11
|
ContainerFileCitation: "container_file_citation",
|
|
12
12
|
};
|
|
@@ -94,11 +94,12 @@ export const OutputShellServerToolItem$inboundSchema = z.object({
|
|
|
94
94
|
arguments: z.nullable(z.string()).optional(),
|
|
95
95
|
call_id: z.nullable(z.string()).optional(),
|
|
96
96
|
container_id: z.string().optional(),
|
|
97
|
+
error: z.string().optional(),
|
|
97
98
|
files: z.array(z.lazy(() => OutputShellServerToolItemFile$inboundSchema))
|
|
98
99
|
.optional(),
|
|
99
100
|
id: z.string().optional(),
|
|
100
101
|
output: z.array(ShellCallOutputContent$inboundSchema).optional(),
|
|
101
|
-
status:
|
|
102
|
+
status: FailableToolCallStatus$inboundSchema,
|
|
102
103
|
type: OutputShellServerToolItemTypeOpenrouterShell$inboundSchema,
|
|
103
104
|
}).transform((v) => {
|
|
104
105
|
return remap$(v, {
|
|
@@ -113,11 +114,12 @@ export const OutputShellServerToolItem$outboundSchema = z.object({
|
|
|
113
114
|
arguments: z.nullable(z.string()).optional(),
|
|
114
115
|
callId: z.nullable(z.string()).optional(),
|
|
115
116
|
containerId: z.string().optional(),
|
|
117
|
+
error: z.string().optional(),
|
|
116
118
|
files: z.array(z.lazy(() => OutputShellServerToolItemFile$outboundSchema))
|
|
117
119
|
.optional(),
|
|
118
120
|
id: z.string().optional(),
|
|
119
121
|
output: z.array(ShellCallOutputContent$outboundSchema).optional(),
|
|
120
|
-
status:
|
|
122
|
+
status: FailableToolCallStatus$outboundSchema,
|
|
121
123
|
type: OutputShellServerToolItemTypeOpenrouterShell$outboundSchema,
|
|
122
124
|
}).transform((v) => {
|
|
123
125
|
return remap$(v, {
|
|
@@ -27,6 +27,10 @@ export type ShellCallOutputItem = {
|
|
|
27
27
|
* The canonical container id the command ran under — the `{container_id}` for the Container Files API, reusable as a `container_reference` in later requests. Present on every sandbox-executed call, even when no files changed.
|
|
28
28
|
*/
|
|
29
29
|
containerId?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The error message when the sandbox call failed before producing a result, as echoed from a failed `shell_call_output` emission.
|
|
32
|
+
*/
|
|
33
|
+
error?: string | undefined;
|
|
30
34
|
/**
|
|
31
35
|
* Citations for the files the sandbox command created or modified, most-recently-touched first (at most 10). Retrieve them via the Container Files API.
|
|
32
36
|
*/
|
|
@@ -57,6 +61,7 @@ export declare const ShellCallOutputItemTypeShellCallOutput$outboundSchema: z.Zo
|
|
|
57
61
|
export type ShellCallOutputItem$Outbound = {
|
|
58
62
|
call_id: string;
|
|
59
63
|
container_id?: string | undefined;
|
|
64
|
+
error?: string | undefined;
|
|
60
65
|
files?: Array<ShellCallOutputItemFile$Outbound> | undefined;
|
|
61
66
|
id?: string | null | undefined;
|
|
62
67
|
max_output_length?: number | null | undefined;
|
|
@@ -39,6 +39,7 @@ export const ShellCallOutputItemTypeShellCallOutput$outboundSchema = z.enum(Shel
|
|
|
39
39
|
export const ShellCallOutputItem$outboundSchema = z.object({
|
|
40
40
|
callId: z.string(),
|
|
41
41
|
containerId: z.string().optional(),
|
|
42
|
+
error: z.string().optional(),
|
|
42
43
|
files: z.array(z.lazy(() => ShellCallOutputItemFile$outboundSchema))
|
|
43
44
|
.optional(),
|
|
44
45
|
id: z.nullable(z.string()).optional(),
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.130",
|
|
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",
|
|
@@ -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",
|
|
76
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
77
78
|
"prepare": "npm run build",
|
|
78
|
-
"test": "vitest --run --project unit",
|
|
79
|
-
"test:e2e": "vitest --run --project e2e",
|
|
80
|
-
"typecheck": "tsc --noEmit",
|
|
81
79
|
"test:transit": "exit 0",
|
|
82
80
|
"test:watch": "vitest --watch --project unit",
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
83
82
|
"typecheck:transit": "exit 0",
|
|
84
|
-
"
|
|
83
|
+
"test": "vitest --run --project unit",
|
|
84
|
+
"test:e2e": "vitest --run --project e2e"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|