@openrouter/sdk 1.3.1 → 1.3.3

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.
@@ -20,7 +20,7 @@ import { Result } from "../types/fp.js";
20
20
  *
21
21
  * To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline.
22
22
  *
23
- * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The disconnect is noticed when the intern next writes to the stream, which during a silent tool run can take more than one 30 second heartbeat interval.
23
+ * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent.
24
24
  *
25
25
  * A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event.
26
26
  *
@@ -25,7 +25,7 @@ import { APIPromise } from "../types/async.js";
25
25
  *
26
26
  * To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline.
27
27
  *
28
- * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The disconnect is noticed when the intern next writes to the stream, which during a silent tool run can take more than one 30 second heartbeat interval.
28
+ * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent.
29
29
  *
30
30
  * A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event.
31
31
  *
@@ -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.3.1";
53
+ readonly sdkVersion: "1.3.3";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.3.1 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.3.3 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.3.1",
32
+ sdkVersion: "1.3.3",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.3.1 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.3.3 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,6 +1,6 @@
1
1
  import * as z from "zod/v4";
2
2
  /**
3
- * Settings for a new intern in an explicit workspace.
3
+ * Settings for a new intern.
4
4
  */
5
5
  export type CreateInternRequest = {
6
6
  /**
@@ -24,9 +24,9 @@ export type CreateInternRequest = {
24
24
  */
25
25
  vaultId?: string | undefined;
26
26
  /**
27
- * Workspace that will own the intern. It must match the API key workspace.
27
+ * Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace.
28
28
  */
29
- workspaceId: string;
29
+ workspaceId?: string | undefined;
30
30
  };
31
31
  /** @internal */
32
32
  export type CreateInternRequest$Outbound = {
@@ -35,7 +35,7 @@ export type CreateInternRequest$Outbound = {
35
35
  name: string;
36
36
  provision: boolean;
37
37
  vault_id?: string | undefined;
38
- workspace_id: string;
38
+ workspace_id?: string | undefined;
39
39
  };
40
40
  /** @internal */
41
41
  export declare const CreateInternRequest$outboundSchema: z.ZodType<CreateInternRequest$Outbound, CreateInternRequest>;
@@ -11,7 +11,7 @@ export const CreateInternRequest$outboundSchema = z.object({
11
11
  name: z.string(),
12
12
  provision: z.boolean().default(false),
13
13
  vaultId: z.string().optional(),
14
- workspaceId: z.string(),
14
+ workspaceId: z.string().optional(),
15
15
  }).transform((v) => {
16
16
  return remap$(v, {
17
17
  vaultId: "vault_id",
@@ -8,13 +8,13 @@ export type InternChatAssistantMessage = {
8
8
  /**
9
9
  * Message text as a string or a list of text parts. Assistant history may carry null. Only the last message is read; earlier messages are accepted so ordinary clients can resend history.
10
10
  */
11
- content: InternChatMessageContent | null;
11
+ content?: InternChatMessageContent | null | undefined;
12
12
  role: "assistant";
13
13
  toolCalls?: Array<InternChatEchoedToolCall> | undefined;
14
14
  };
15
15
  /** @internal */
16
16
  export type InternChatAssistantMessage$Outbound = {
17
- content: InternChatMessageContent$Outbound | null;
17
+ content?: InternChatMessageContent$Outbound | null | undefined;
18
18
  role: "assistant";
19
19
  tool_calls?: Array<InternChatEchoedToolCall$Outbound> | undefined;
20
20
  };
@@ -8,7 +8,7 @@ import { InternChatEchoedToolCall$outboundSchema, } from "./internchatechoedtool
8
8
  import { InternChatMessageContent$outboundSchema, } from "./internchatmessagecontent.js";
9
9
  /** @internal */
10
10
  export const InternChatAssistantMessage$outboundSchema = z.object({
11
- content: z.nullable(InternChatMessageContent$outboundSchema),
11
+ content: z.nullable(InternChatMessageContent$outboundSchema).optional(),
12
12
  role: z.literal("assistant"),
13
13
  toolCalls: z.array(InternChatEchoedToolCall$outboundSchema).optional(),
14
14
  }).transform((v) => {
@@ -62,7 +62,7 @@ export declare class Interns extends ClientSDK {
62
62
  *
63
63
  * To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline.
64
64
  *
65
- * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The disconnect is noticed when the intern next writes to the stream, which during a silent tool run can take more than one 30 second heartbeat interval.
65
+ * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent.
66
66
  *
67
67
  * A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event.
68
68
  *
@@ -86,7 +86,7 @@ export class Interns extends ClientSDK {
86
86
  *
87
87
  * To answer, send a second request with the same `session_id`, the assistant message echoing that tool call, and a `tool` message whose `tool_call_id` is the tool call id and whose `content` is the answer. The answer is delivered to the run that asked and the stream continues from where it paused. A question stays open for its interaction deadline (5 minutes by default) and the run is cancelled when that passes. Rejected replies do not extend the deadline.
88
88
  *
89
- * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The disconnect is noticed when the intern next writes to the stream, which during a silent tool run can take more than one 30 second heartbeat interval.
89
+ * Closing the connection after the `[DONE]` that follows `finish_reason: "tool_calls"` keeps the run alive. Disconnecting while a response is still streaming cancels the run. The stream writes a `: keepalive` comment whenever nothing else has been written for 30 seconds, so a disconnect is noticed within that interval even while the intern is silent.
90
90
  *
91
91
  * A run the intern ends while you are still connected, by cancellation or by a deadline, ends the stream with a `finish_reason: "error"` chunk carrying `410` and reason `run_ended`, then the final empty-`choices` chunk and `[DONE]`. That error reports only an ending the intern confirmed. A connection that breaks without that confirmation ends with reason `stream_severed`, and a client that has already disconnected is promised no final event.
92
92
  *
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.3.1",
5
+ "version": "1.3.3",
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.3.1",
3
+ "version": "1.3.3",
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
+ "test:transit": "exit 0",
77
+ "typecheck": "tsc --noEmit",
78
+ "compile": "tsc",
76
79
  "postinstall": "node scripts/check-types.js || true",
80
+ "prepare": "npm run build",
77
81
  "test": "vitest --run --project unit",
78
82
  "test:e2e": "vitest --run --project e2e",
79
83
  "test:watch": "vitest --watch --project unit",
80
- "typecheck": "tsc --noEmit",
81
- "typecheck:transit": "exit 0",
82
- "compile": "tsc",
83
- "prepare": "npm run build",
84
- "test:transit": "exit 0"
84
+ "typecheck:transit": "exit 0"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {