@openrouter/sdk 1.2.70 → 1.2.72
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/imagegenerationrequest.d.ts +5 -0
- package/esm/models/imagegenerationrequest.js +1 -0
- package/esm/models/shellcalloutputitem.d.ts +40 -4
- package/esm/models/shellcalloutputitem.js +31 -3
- package/jsr.json +1 -1
- package/package.json +6 -6
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.72";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.72 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.72",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.72 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -144,6 +144,10 @@ export type ImageGenerationRequest = {
|
|
|
144
144
|
* If true, partial images are streamed as SSE events as they become available. Only supported by providers with native streaming (currently OpenAI). Non-streaming providers ignore this flag and return a buffered response.
|
|
145
145
|
*/
|
|
146
146
|
stream?: boolean | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* A stable identifier for your end-users. Used to help detect and prevent abuse. Never sent to providers verbatim: for providers whose data policy requires user IDs, it is folded into a hashed, per-account upstream user identifier.
|
|
149
|
+
*/
|
|
150
|
+
user?: string | undefined;
|
|
147
151
|
};
|
|
148
152
|
/** @internal */
|
|
149
153
|
export declare const ImageGenerationRequestAspectRatio$outboundSchema: z.ZodType<string, ImageGenerationRequestAspectRatio>;
|
|
@@ -171,6 +175,7 @@ export type ImageGenerationRequest$Outbound = {
|
|
|
171
175
|
seed?: number | undefined;
|
|
172
176
|
size?: string | undefined;
|
|
173
177
|
stream?: boolean | undefined;
|
|
178
|
+
user?: string | undefined;
|
|
174
179
|
};
|
|
175
180
|
/** @internal */
|
|
176
181
|
export declare const ImageGenerationRequest$outboundSchema: z.ZodType<ImageGenerationRequest$Outbound, ImageGenerationRequest>;
|
|
@@ -95,6 +95,7 @@ export const ImageGenerationRequest$outboundSchema = z.object({
|
|
|
95
95
|
seed: z.int().optional(),
|
|
96
96
|
size: z.string().optional(),
|
|
97
97
|
stream: z.boolean().optional(),
|
|
98
|
+
user: z.string().optional(),
|
|
98
99
|
}).transform((v) => {
|
|
99
100
|
return remap$(v, {
|
|
100
101
|
aspectRatio: "aspect_ratio",
|
|
@@ -2,26 +2,62 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { ShellCallOutputContent, ShellCallOutputContent$Outbound } from "./shellcalloutputcontent.js";
|
|
4
4
|
import { ToolCallStatus } from "./toolcallstatus.js";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const ShellCallOutputItemTypeContainerFileCitation: {
|
|
6
|
+
readonly ContainerFileCitation: "container_file_citation";
|
|
7
|
+
};
|
|
8
|
+
export type ShellCallOutputItemTypeContainerFileCitation = ClosedEnum<typeof ShellCallOutputItemTypeContainerFileCitation>;
|
|
9
|
+
export type ShellCallOutputItemFile = {
|
|
10
|
+
containerId: string;
|
|
11
|
+
endIndex: number;
|
|
12
|
+
fileId: string;
|
|
13
|
+
filename: string;
|
|
14
|
+
startIndex: number;
|
|
15
|
+
type: ShellCallOutputItemTypeContainerFileCitation;
|
|
16
|
+
};
|
|
17
|
+
export declare const ShellCallOutputItemTypeShellCallOutput: {
|
|
6
18
|
readonly ShellCallOutput: "shell_call_output";
|
|
7
19
|
};
|
|
8
|
-
export type
|
|
20
|
+
export type ShellCallOutputItemTypeShellCallOutput = ClosedEnum<typeof ShellCallOutputItemTypeShellCallOutput>;
|
|
9
21
|
/**
|
|
10
22
|
* Output from a shell command execution (newer variant)
|
|
11
23
|
*/
|
|
12
24
|
export type ShellCallOutputItem = {
|
|
13
25
|
callId: string;
|
|
26
|
+
/**
|
|
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
|
+
*/
|
|
29
|
+
containerId?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* 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
|
+
*/
|
|
33
|
+
files?: Array<ShellCallOutputItemFile> | undefined;
|
|
14
34
|
id?: string | null | undefined;
|
|
15
35
|
maxOutputLength?: number | null | undefined;
|
|
16
36
|
output: Array<ShellCallOutputContent>;
|
|
17
37
|
status?: ToolCallStatus | null | undefined;
|
|
18
|
-
type:
|
|
38
|
+
type: ShellCallOutputItemTypeShellCallOutput;
|
|
19
39
|
};
|
|
20
40
|
/** @internal */
|
|
21
|
-
export declare const
|
|
41
|
+
export declare const ShellCallOutputItemTypeContainerFileCitation$outboundSchema: z.ZodEnum<typeof ShellCallOutputItemTypeContainerFileCitation>;
|
|
42
|
+
/** @internal */
|
|
43
|
+
export type ShellCallOutputItemFile$Outbound = {
|
|
44
|
+
container_id: string;
|
|
45
|
+
end_index: number;
|
|
46
|
+
file_id: string;
|
|
47
|
+
filename: string;
|
|
48
|
+
start_index: number;
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
/** @internal */
|
|
52
|
+
export declare const ShellCallOutputItemFile$outboundSchema: z.ZodType<ShellCallOutputItemFile$Outbound, ShellCallOutputItemFile>;
|
|
53
|
+
export declare function shellCallOutputItemFileToJSON(shellCallOutputItemFile: ShellCallOutputItemFile): string;
|
|
54
|
+
/** @internal */
|
|
55
|
+
export declare const ShellCallOutputItemTypeShellCallOutput$outboundSchema: z.ZodEnum<typeof ShellCallOutputItemTypeShellCallOutput>;
|
|
22
56
|
/** @internal */
|
|
23
57
|
export type ShellCallOutputItem$Outbound = {
|
|
24
58
|
call_id: string;
|
|
59
|
+
container_id?: string | undefined;
|
|
60
|
+
files?: Array<ShellCallOutputItemFile$Outbound> | undefined;
|
|
25
61
|
id?: string | null | undefined;
|
|
26
62
|
max_output_length?: number | null | undefined;
|
|
27
63
|
output: Array<ShellCallOutputContent$Outbound>;
|
|
@@ -6,22 +6,50 @@ import * as z from "zod/v4";
|
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { ShellCallOutputContent$outboundSchema, } from "./shellcalloutputcontent.js";
|
|
8
8
|
import { ToolCallStatus$outboundSchema, } from "./toolcallstatus.js";
|
|
9
|
-
export const
|
|
9
|
+
export const ShellCallOutputItemTypeContainerFileCitation = {
|
|
10
|
+
ContainerFileCitation: "container_file_citation",
|
|
11
|
+
};
|
|
12
|
+
export const ShellCallOutputItemTypeShellCallOutput = {
|
|
10
13
|
ShellCallOutput: "shell_call_output",
|
|
11
14
|
};
|
|
12
15
|
/** @internal */
|
|
13
|
-
export const
|
|
16
|
+
export const ShellCallOutputItemTypeContainerFileCitation$outboundSchema = z.enum(ShellCallOutputItemTypeContainerFileCitation);
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ShellCallOutputItemFile$outboundSchema = z.object({
|
|
19
|
+
containerId: z.string(),
|
|
20
|
+
endIndex: z.int(),
|
|
21
|
+
fileId: z.string(),
|
|
22
|
+
filename: z.string(),
|
|
23
|
+
startIndex: z.int(),
|
|
24
|
+
type: ShellCallOutputItemTypeContainerFileCitation$outboundSchema,
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
containerId: "container_id",
|
|
28
|
+
endIndex: "end_index",
|
|
29
|
+
fileId: "file_id",
|
|
30
|
+
startIndex: "start_index",
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
export function shellCallOutputItemFileToJSON(shellCallOutputItemFile) {
|
|
34
|
+
return JSON.stringify(ShellCallOutputItemFile$outboundSchema.parse(shellCallOutputItemFile));
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const ShellCallOutputItemTypeShellCallOutput$outboundSchema = z.enum(ShellCallOutputItemTypeShellCallOutput);
|
|
14
38
|
/** @internal */
|
|
15
39
|
export const ShellCallOutputItem$outboundSchema = z.object({
|
|
16
40
|
callId: z.string(),
|
|
41
|
+
containerId: z.string().optional(),
|
|
42
|
+
files: z.array(z.lazy(() => ShellCallOutputItemFile$outboundSchema))
|
|
43
|
+
.optional(),
|
|
17
44
|
id: z.nullable(z.string()).optional(),
|
|
18
45
|
maxOutputLength: z.nullable(z.int()).optional(),
|
|
19
46
|
output: z.array(ShellCallOutputContent$outboundSchema),
|
|
20
47
|
status: z.nullable(ToolCallStatus$outboundSchema).optional(),
|
|
21
|
-
type:
|
|
48
|
+
type: ShellCallOutputItemTypeShellCallOutput$outboundSchema,
|
|
22
49
|
}).transform((v) => {
|
|
23
50
|
return remap$(v, {
|
|
24
51
|
callId: "call_id",
|
|
52
|
+
containerId: "container_id",
|
|
25
53
|
maxOutputLength: "max_output_length",
|
|
26
54
|
});
|
|
27
55
|
});
|
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.72",
|
|
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
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
77
|
-
"test:watch": "vitest --watch --project unit",
|
|
78
|
-
"typecheck": "tsc --noEmit",
|
|
79
76
|
"compile": "tsc",
|
|
80
77
|
"prepare": "npm run build",
|
|
81
|
-
"test": "vitest --run --project unit",
|
|
82
78
|
"test:e2e": "vitest --run --project e2e",
|
|
83
79
|
"test:transit": "exit 0",
|
|
84
|
-
"
|
|
80
|
+
"test:watch": "vitest --watch --project unit",
|
|
81
|
+
"typecheck:transit": "exit 0",
|
|
82
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
83
|
+
"test": "vitest --run --project unit",
|
|
84
|
+
"typecheck": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|