@openrouter/sdk 0.13.39 → 0.13.40
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/agentmessageitem.d.ts +99 -0
- package/esm/models/agentmessageitem.js +101 -0
- package/esm/models/compactionitem.d.ts +4 -0
- package/esm/models/compactionitem.js +8 -3
- package/esm/models/contextcompactionitem.d.ts +30 -0
- package/esm/models/contextcompactionitem.js +30 -0
- package/esm/models/index.d.ts +2 -0
- package/esm/models/index.js +2 -0
- package/esm/models/inputsunion.d.ts +6 -4
- package/esm/models/inputsunion.js +6 -0
- package/jsr.json +1 -1
- package/package.json +4 -4
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: "0.13.
|
|
52
|
+
readonly sdkVersion: "0.13.40";
|
|
53
53
|
readonly genVersion: "2.884.4";
|
|
54
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.13.
|
|
54
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.13.40 2.884.4 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: "0.13.
|
|
29
|
+
sdkVersion: "0.13.40",
|
|
30
30
|
genVersion: "2.884.4",
|
|
31
|
-
userAgent: "speakeasy-sdk/typescript 0.13.
|
|
31
|
+
userAgent: "speakeasy-sdk/typescript 0.13.40 2.884.4 1.0.0 @openrouter/sdk",
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { InputText, InputText$Outbound } from "./inputtext.js";
|
|
4
|
+
export type Agent = {
|
|
5
|
+
agentName: string;
|
|
6
|
+
additionalProperties?: {
|
|
7
|
+
[k: string]: any | null;
|
|
8
|
+
} | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type ContentEncryptedContent = {
|
|
11
|
+
encryptedContent: string;
|
|
12
|
+
type: "encrypted_content";
|
|
13
|
+
additionalProperties?: {
|
|
14
|
+
[k: string]: any | null;
|
|
15
|
+
} | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare const AgentMessageItemDetail: {
|
|
18
|
+
readonly Auto: "auto";
|
|
19
|
+
readonly High: "high";
|
|
20
|
+
readonly Low: "low";
|
|
21
|
+
readonly Original: "original";
|
|
22
|
+
};
|
|
23
|
+
export type AgentMessageItemDetail = OpenEnum<typeof AgentMessageItemDetail>;
|
|
24
|
+
/**
|
|
25
|
+
* Image input content item
|
|
26
|
+
*/
|
|
27
|
+
export type AgentMessageItemContentInputImage = {
|
|
28
|
+
detail: AgentMessageItemDetail;
|
|
29
|
+
imageUrl?: string | null | undefined;
|
|
30
|
+
type: "input_image";
|
|
31
|
+
};
|
|
32
|
+
export type AgentMessageItemContentUnion = InputText | AgentMessageItemContentInputImage | ContentEncryptedContent;
|
|
33
|
+
export declare const TypeAgentMessage: {
|
|
34
|
+
readonly AgentMessage: "agent_message";
|
|
35
|
+
};
|
|
36
|
+
export type TypeAgentMessage = ClosedEnum<typeof TypeAgentMessage>;
|
|
37
|
+
/**
|
|
38
|
+
* A message routed between agents in a multi-agent session
|
|
39
|
+
*/
|
|
40
|
+
export type AgentMessageItem = {
|
|
41
|
+
agent?: Agent | null | undefined;
|
|
42
|
+
author: string;
|
|
43
|
+
content: Array<InputText | AgentMessageItemContentInputImage | ContentEncryptedContent>;
|
|
44
|
+
id?: string | null | undefined;
|
|
45
|
+
recipient: string;
|
|
46
|
+
type: TypeAgentMessage;
|
|
47
|
+
additionalProperties?: {
|
|
48
|
+
[k: string]: any | null;
|
|
49
|
+
} | undefined;
|
|
50
|
+
};
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type Agent$Outbound = {
|
|
53
|
+
agent_name: string;
|
|
54
|
+
[additionalProperties: string]: unknown;
|
|
55
|
+
};
|
|
56
|
+
/** @internal */
|
|
57
|
+
export declare const Agent$outboundSchema: z.ZodType<Agent$Outbound, Agent>;
|
|
58
|
+
export declare function agentToJSON(agent: Agent): string;
|
|
59
|
+
/** @internal */
|
|
60
|
+
export type ContentEncryptedContent$Outbound = {
|
|
61
|
+
encrypted_content: string;
|
|
62
|
+
type: "encrypted_content";
|
|
63
|
+
[additionalProperties: string]: unknown;
|
|
64
|
+
};
|
|
65
|
+
/** @internal */
|
|
66
|
+
export declare const ContentEncryptedContent$outboundSchema: z.ZodType<ContentEncryptedContent$Outbound, ContentEncryptedContent>;
|
|
67
|
+
export declare function contentEncryptedContentToJSON(contentEncryptedContent: ContentEncryptedContent): string;
|
|
68
|
+
/** @internal */
|
|
69
|
+
export declare const AgentMessageItemDetail$outboundSchema: z.ZodType<string, AgentMessageItemDetail>;
|
|
70
|
+
/** @internal */
|
|
71
|
+
export type AgentMessageItemContentInputImage$Outbound = {
|
|
72
|
+
detail: string;
|
|
73
|
+
image_url?: string | null | undefined;
|
|
74
|
+
type: "input_image";
|
|
75
|
+
};
|
|
76
|
+
/** @internal */
|
|
77
|
+
export declare const AgentMessageItemContentInputImage$outboundSchema: z.ZodType<AgentMessageItemContentInputImage$Outbound, AgentMessageItemContentInputImage>;
|
|
78
|
+
export declare function agentMessageItemContentInputImageToJSON(agentMessageItemContentInputImage: AgentMessageItemContentInputImage): string;
|
|
79
|
+
/** @internal */
|
|
80
|
+
export type AgentMessageItemContentUnion$Outbound = InputText$Outbound | AgentMessageItemContentInputImage$Outbound | ContentEncryptedContent$Outbound;
|
|
81
|
+
/** @internal */
|
|
82
|
+
export declare const AgentMessageItemContentUnion$outboundSchema: z.ZodType<AgentMessageItemContentUnion$Outbound, AgentMessageItemContentUnion>;
|
|
83
|
+
export declare function agentMessageItemContentUnionToJSON(agentMessageItemContentUnion: AgentMessageItemContentUnion): string;
|
|
84
|
+
/** @internal */
|
|
85
|
+
export declare const TypeAgentMessage$outboundSchema: z.ZodEnum<typeof TypeAgentMessage>;
|
|
86
|
+
/** @internal */
|
|
87
|
+
export type AgentMessageItem$Outbound = {
|
|
88
|
+
agent?: Agent$Outbound | null | undefined;
|
|
89
|
+
author: string;
|
|
90
|
+
content: Array<InputText$Outbound | AgentMessageItemContentInputImage$Outbound | ContentEncryptedContent$Outbound>;
|
|
91
|
+
id?: string | null | undefined;
|
|
92
|
+
recipient: string;
|
|
93
|
+
type: string;
|
|
94
|
+
[additionalProperties: string]: unknown;
|
|
95
|
+
};
|
|
96
|
+
/** @internal */
|
|
97
|
+
export declare const AgentMessageItem$outboundSchema: z.ZodType<AgentMessageItem$Outbound, AgentMessageItem>;
|
|
98
|
+
export declare function agentMessageItemToJSON(agentMessageItem: AgentMessageItem): string;
|
|
99
|
+
//# sourceMappingURL=agentmessageitem.d.ts.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: fc9151085f62
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../types/enums.js";
|
|
8
|
+
import { InputText$outboundSchema, } from "./inputtext.js";
|
|
9
|
+
export const AgentMessageItemDetail = {
|
|
10
|
+
Auto: "auto",
|
|
11
|
+
High: "high",
|
|
12
|
+
Low: "low",
|
|
13
|
+
Original: "original",
|
|
14
|
+
};
|
|
15
|
+
export const TypeAgentMessage = {
|
|
16
|
+
AgentMessage: "agent_message",
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Agent$outboundSchema = z.object({
|
|
20
|
+
agentName: z.string(),
|
|
21
|
+
additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return {
|
|
24
|
+
...v.additionalProperties,
|
|
25
|
+
...remap$(v, {
|
|
26
|
+
agentName: "agent_name",
|
|
27
|
+
additionalProperties: null,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
export function agentToJSON(agent) {
|
|
32
|
+
return JSON.stringify(Agent$outboundSchema.parse(agent));
|
|
33
|
+
}
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const ContentEncryptedContent$outboundSchema = z.object({
|
|
36
|
+
encryptedContent: z.string(),
|
|
37
|
+
type: z.literal("encrypted_content"),
|
|
38
|
+
additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
39
|
+
}).transform((v) => {
|
|
40
|
+
return {
|
|
41
|
+
...v.additionalProperties,
|
|
42
|
+
...remap$(v, {
|
|
43
|
+
encryptedContent: "encrypted_content",
|
|
44
|
+
additionalProperties: null,
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
export function contentEncryptedContentToJSON(contentEncryptedContent) {
|
|
49
|
+
return JSON.stringify(ContentEncryptedContent$outboundSchema.parse(contentEncryptedContent));
|
|
50
|
+
}
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const AgentMessageItemDetail$outboundSchema = openEnums.outboundSchema(AgentMessageItemDetail);
|
|
53
|
+
/** @internal */
|
|
54
|
+
export const AgentMessageItemContentInputImage$outboundSchema = z.object({
|
|
55
|
+
detail: AgentMessageItemDetail$outboundSchema,
|
|
56
|
+
imageUrl: z.nullable(z.string()).optional(),
|
|
57
|
+
type: z.literal("input_image"),
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
imageUrl: "image_url",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export function agentMessageItemContentInputImageToJSON(agentMessageItemContentInputImage) {
|
|
64
|
+
return JSON.stringify(AgentMessageItemContentInputImage$outboundSchema.parse(agentMessageItemContentInputImage));
|
|
65
|
+
}
|
|
66
|
+
/** @internal */
|
|
67
|
+
export const AgentMessageItemContentUnion$outboundSchema = z.union([
|
|
68
|
+
InputText$outboundSchema,
|
|
69
|
+
z.lazy(() => AgentMessageItemContentInputImage$outboundSchema),
|
|
70
|
+
z.lazy(() => ContentEncryptedContent$outboundSchema),
|
|
71
|
+
]);
|
|
72
|
+
export function agentMessageItemContentUnionToJSON(agentMessageItemContentUnion) {
|
|
73
|
+
return JSON.stringify(AgentMessageItemContentUnion$outboundSchema.parse(agentMessageItemContentUnion));
|
|
74
|
+
}
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const TypeAgentMessage$outboundSchema = z.enum(TypeAgentMessage);
|
|
77
|
+
/** @internal */
|
|
78
|
+
export const AgentMessageItem$outboundSchema = z.object({
|
|
79
|
+
agent: z.nullable(z.lazy(() => Agent$outboundSchema)).optional(),
|
|
80
|
+
author: z.string(),
|
|
81
|
+
content: z.array(z.union([
|
|
82
|
+
InputText$outboundSchema,
|
|
83
|
+
z.lazy(() => AgentMessageItemContentInputImage$outboundSchema),
|
|
84
|
+
z.lazy(() => ContentEncryptedContent$outboundSchema),
|
|
85
|
+
])),
|
|
86
|
+
id: z.nullable(z.string()).optional(),
|
|
87
|
+
recipient: z.string(),
|
|
88
|
+
type: TypeAgentMessage$outboundSchema,
|
|
89
|
+
additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
90
|
+
}).transform((v) => {
|
|
91
|
+
return {
|
|
92
|
+
...v.additionalProperties,
|
|
93
|
+
...remap$(v, {
|
|
94
|
+
additionalProperties: null,
|
|
95
|
+
}),
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
export function agentMessageItemToJSON(agentMessageItem) {
|
|
99
|
+
return JSON.stringify(AgentMessageItem$outboundSchema.parse(agentMessageItem));
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=agentmessageitem.js.map
|
|
@@ -11,6 +11,9 @@ export type CompactionItem = {
|
|
|
11
11
|
encryptedContent: string;
|
|
12
12
|
id?: string | null | undefined;
|
|
13
13
|
type: CompactionItemType;
|
|
14
|
+
additionalProperties?: {
|
|
15
|
+
[k: string]: any | null;
|
|
16
|
+
} | undefined;
|
|
14
17
|
};
|
|
15
18
|
/** @internal */
|
|
16
19
|
export declare const CompactionItemType$outboundSchema: z.ZodEnum<typeof CompactionItemType>;
|
|
@@ -19,6 +22,7 @@ export type CompactionItem$Outbound = {
|
|
|
19
22
|
encrypted_content: string;
|
|
20
23
|
id?: string | null | undefined;
|
|
21
24
|
type: string;
|
|
25
|
+
[additionalProperties: string]: unknown;
|
|
22
26
|
};
|
|
23
27
|
/** @internal */
|
|
24
28
|
export declare const CompactionItem$outboundSchema: z.ZodType<CompactionItem$Outbound, CompactionItem>;
|
|
@@ -14,10 +14,15 @@ export const CompactionItem$outboundSchema = z.object({
|
|
|
14
14
|
encryptedContent: z.string(),
|
|
15
15
|
id: z.nullable(z.string()).optional(),
|
|
16
16
|
type: CompactionItemType$outboundSchema,
|
|
17
|
+
additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
17
18
|
}).transform((v) => {
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
return {
|
|
20
|
+
...v.additionalProperties,
|
|
21
|
+
...remap$(v, {
|
|
22
|
+
encryptedContent: "encrypted_content",
|
|
23
|
+
additionalProperties: null,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
21
26
|
});
|
|
22
27
|
export function compactionItemToJSON(compactionItem) {
|
|
23
28
|
return JSON.stringify(CompactionItem$outboundSchema.parse(compactionItem));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
export declare const ContextCompactionItemType: {
|
|
4
|
+
readonly ContextCompaction: "context_compaction";
|
|
5
|
+
};
|
|
6
|
+
export type ContextCompactionItemType = ClosedEnum<typeof ContextCompactionItemType>;
|
|
7
|
+
/**
|
|
8
|
+
* A context compaction marker with an optional encrypted summary
|
|
9
|
+
*/
|
|
10
|
+
export type ContextCompactionItem = {
|
|
11
|
+
encryptedContent?: string | null | undefined;
|
|
12
|
+
id?: string | null | undefined;
|
|
13
|
+
type: ContextCompactionItemType;
|
|
14
|
+
additionalProperties?: {
|
|
15
|
+
[k: string]: any | null;
|
|
16
|
+
} | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const ContextCompactionItemType$outboundSchema: z.ZodEnum<typeof ContextCompactionItemType>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export type ContextCompactionItem$Outbound = {
|
|
22
|
+
encrypted_content?: string | null | undefined;
|
|
23
|
+
id?: string | null | undefined;
|
|
24
|
+
type: string;
|
|
25
|
+
[additionalProperties: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare const ContextCompactionItem$outboundSchema: z.ZodType<ContextCompactionItem$Outbound, ContextCompactionItem>;
|
|
29
|
+
export declare function contextCompactionItemToJSON(contextCompactionItem: ContextCompactionItem): string;
|
|
30
|
+
//# sourceMappingURL=contextcompactionitem.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8f97e5138d46
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
export const ContextCompactionItemType = {
|
|
8
|
+
ContextCompaction: "context_compaction",
|
|
9
|
+
};
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const ContextCompactionItemType$outboundSchema = z.enum(ContextCompactionItemType);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const ContextCompactionItem$outboundSchema = z.object({
|
|
14
|
+
encryptedContent: z.nullable(z.string()).optional(),
|
|
15
|
+
id: z.nullable(z.string()).optional(),
|
|
16
|
+
type: ContextCompactionItemType$outboundSchema,
|
|
17
|
+
additionalProperties: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
18
|
+
}).transform((v) => {
|
|
19
|
+
return {
|
|
20
|
+
...v.additionalProperties,
|
|
21
|
+
...remap$(v, {
|
|
22
|
+
encryptedContent: "encrypted_content",
|
|
23
|
+
additionalProperties: null,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
export function contextCompactionItemToJSON(contextCompactionItem) {
|
|
28
|
+
return JSON.stringify(ContextCompactionItem$outboundSchema.parse(contextCompactionItem));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=contextcompactionitem.js.map
|
package/esm/models/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./advisornestedtool.js";
|
|
|
6
6
|
export * from "./advisorreasoning.js";
|
|
7
7
|
export * from "./advisorservertoolconfig.js";
|
|
8
8
|
export * from "./advisorservertoolopenrouter.js";
|
|
9
|
+
export * from "./agentmessageitem.js";
|
|
9
10
|
export * from "./annotationaddedevent.js";
|
|
10
11
|
export * from "./anthropicadvisormessageusageiteration.js";
|
|
11
12
|
export * from "./anthropicallowedcallers.js";
|
|
@@ -147,6 +148,7 @@ export * from "./contentpartinputaudio.js";
|
|
|
147
148
|
export * from "./contentpartinputfile.js";
|
|
148
149
|
export * from "./contentpartinputvideo.js";
|
|
149
150
|
export * from "./contentpartvideo.js";
|
|
151
|
+
export * from "./contextcompactionitem.js";
|
|
150
152
|
export * from "./contextcompressionengine.js";
|
|
151
153
|
export * from "./contextcompressionplugin.js";
|
|
152
154
|
export * from "./costdetails.js";
|
package/esm/models/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./advisornestedtool.js";
|
|
|
10
10
|
export * from "./advisorreasoning.js";
|
|
11
11
|
export * from "./advisorservertoolconfig.js";
|
|
12
12
|
export * from "./advisorservertoolopenrouter.js";
|
|
13
|
+
export * from "./agentmessageitem.js";
|
|
13
14
|
export * from "./annotationaddedevent.js";
|
|
14
15
|
export * from "./anthropicadvisormessageusageiteration.js";
|
|
15
16
|
export * from "./anthropicallowedcallers.js";
|
|
@@ -151,6 +152,7 @@ export * from "./contentpartinputaudio.js";
|
|
|
151
152
|
export * from "./contentpartinputfile.js";
|
|
152
153
|
export * from "./contentpartinputvideo.js";
|
|
153
154
|
export * from "./contentpartvideo.js";
|
|
155
|
+
export * from "./contextcompactionitem.js";
|
|
154
156
|
export * from "./contextcompressionengine.js";
|
|
155
157
|
export * from "./contextcompressionplugin.js";
|
|
156
158
|
export * from "./costdetails.js";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { ClosedEnum } from "../types/enums.js";
|
|
3
3
|
import { AdditionalToolsItem, AdditionalToolsItem$Outbound } from "./additionaltoolsitem.js";
|
|
4
|
+
import { AgentMessageItem, AgentMessageItem$Outbound } from "./agentmessageitem.js";
|
|
4
5
|
import { ApplyPatchCallItem, ApplyPatchCallItem$Outbound } from "./applypatchcallitem.js";
|
|
5
6
|
import { ApplyPatchCallOutputItem, ApplyPatchCallOutputItem$Outbound } from "./applypatchcalloutputitem.js";
|
|
6
7
|
import { CompactionItem, CompactionItem$Outbound } from "./compactionitem.js";
|
|
8
|
+
import { ContextCompactionItem, ContextCompactionItem$Outbound } from "./contextcompactionitem.js";
|
|
7
9
|
import { CustomToolCallItem, CustomToolCallItem$Outbound } from "./customtoolcallitem.js";
|
|
8
10
|
import { CustomToolCallOutputItem, CustomToolCallOutputItem$Outbound } from "./customtoolcalloutputitem.js";
|
|
9
11
|
import { EasyInputMessage, EasyInputMessage$Outbound } from "./easyinputmessage.js";
|
|
@@ -132,11 +134,11 @@ export type InputsMessage = {
|
|
|
132
134
|
status?: InputsStatusCompleted1 | InputsStatusIncomplete1 | InputsStatusInProgress1 | undefined;
|
|
133
135
|
type: InputsTypeMessage;
|
|
134
136
|
};
|
|
135
|
-
export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem;
|
|
137
|
+
export type InputsUnion1 = OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem;
|
|
136
138
|
/**
|
|
137
139
|
* Input for a response request - can be a string or array of items
|
|
138
140
|
*/
|
|
139
|
-
export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem>;
|
|
141
|
+
export type InputsUnion = string | Array<OutputCodeInterpreterCallItem | FunctionCallItem | LocalShellCallItem | McpApprovalRequestItem | McpCallItem | ApplyPatchCallItem | InputsMessage | OutputFunctionCallItem | OutputCustomToolCallItem | OutputFileSearchCallItem | OutputComputerCallItem | OutputDatetimeItem | McpListToolsItem | CustomToolCallItem | AgentMessageItem | ReasoningItem | FunctionCallOutputItem | ApplyPatchCallOutputItem | InputsReasoning | OutputWebSearchCallItem | OutputImageGenerationCallItem | LocalShellCallOutputItem | ShellCallItem | ShellCallOutputItem | McpApprovalResponseItem | CustomToolCallOutputItem | AdditionalToolsItem | OutputWebSearchServerToolItem | OutputCodeInterpreterServerToolItem | OutputFileSearchServerToolItem | OutputImageGenerationServerToolItem | OutputBrowserUseServerToolItem | OutputBashServerToolItem | OutputTextEditorServerToolItem | OutputApplyPatchServerToolItem | OutputWebFetchServerToolItem | OutputToolSearchServerToolItem | OutputMemoryServerToolItem | OutputMcpServerToolItem | OutputSearchModelsServerToolItem | OutputFusionServerToolItem | OutputAdvisorServerToolItem | OutputSubagentServerToolItem | OutputFilesServerToolItem | CompactionItem | ItemReferenceItem | EasyInputMessage | InputMessageItem | ContextCompactionItem>;
|
|
140
142
|
/** @internal */
|
|
141
143
|
export declare const InputsStatusInProgress2$outboundSchema: z.ZodEnum<typeof InputsStatusInProgress2>;
|
|
142
144
|
/** @internal */
|
|
@@ -211,12 +213,12 @@ export type InputsMessage$Outbound = {
|
|
|
211
213
|
export declare const InputsMessage$outboundSchema: z.ZodType<InputsMessage$Outbound, InputsMessage>;
|
|
212
214
|
export declare function inputsMessageToJSON(inputsMessage: InputsMessage): string;
|
|
213
215
|
/** @internal */
|
|
214
|
-
export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound;
|
|
216
|
+
export type InputsUnion1$Outbound = OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound;
|
|
215
217
|
/** @internal */
|
|
216
218
|
export declare const InputsUnion1$outboundSchema: z.ZodType<InputsUnion1$Outbound, InputsUnion1>;
|
|
217
219
|
export declare function inputsUnion1ToJSON(inputsUnion1: InputsUnion1): string;
|
|
218
220
|
/** @internal */
|
|
219
|
-
export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound>;
|
|
221
|
+
export type InputsUnion$Outbound = string | Array<OutputCodeInterpreterCallItem$Outbound | FunctionCallItem$Outbound | LocalShellCallItem$Outbound | McpApprovalRequestItem$Outbound | McpCallItem$Outbound | ApplyPatchCallItem$Outbound | InputsMessage$Outbound | OutputFunctionCallItem$Outbound | OutputCustomToolCallItem$Outbound | OutputFileSearchCallItem$Outbound | OutputComputerCallItem$Outbound | OutputDatetimeItem$Outbound | McpListToolsItem$Outbound | CustomToolCallItem$Outbound | AgentMessageItem$Outbound | ReasoningItem$Outbound | FunctionCallOutputItem$Outbound | ApplyPatchCallOutputItem$Outbound | InputsReasoning$Outbound | OutputWebSearchCallItem$Outbound | OutputImageGenerationCallItem$Outbound | LocalShellCallOutputItem$Outbound | ShellCallItem$Outbound | ShellCallOutputItem$Outbound | McpApprovalResponseItem$Outbound | CustomToolCallOutputItem$Outbound | AdditionalToolsItem$Outbound | OutputWebSearchServerToolItem$Outbound | OutputCodeInterpreterServerToolItem$Outbound | OutputFileSearchServerToolItem$Outbound | OutputImageGenerationServerToolItem$Outbound | OutputBrowserUseServerToolItem$Outbound | OutputBashServerToolItem$Outbound | OutputTextEditorServerToolItem$Outbound | OutputApplyPatchServerToolItem$Outbound | OutputWebFetchServerToolItem$Outbound | OutputToolSearchServerToolItem$Outbound | OutputMemoryServerToolItem$Outbound | OutputMcpServerToolItem$Outbound | OutputSearchModelsServerToolItem$Outbound | OutputFusionServerToolItem$Outbound | OutputAdvisorServerToolItem$Outbound | OutputSubagentServerToolItem$Outbound | OutputFilesServerToolItem$Outbound | CompactionItem$Outbound | ItemReferenceItem$Outbound | EasyInputMessage$Outbound | InputMessageItem$Outbound | ContextCompactionItem$Outbound>;
|
|
220
222
|
/** @internal */
|
|
221
223
|
export declare const InputsUnion$outboundSchema: z.ZodType<InputsUnion$Outbound, InputsUnion>;
|
|
222
224
|
export declare function inputsUnionToJSON(inputsUnion: InputsUnion): string;
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { AdditionalToolsItem$outboundSchema, } from "./additionaltoolsitem.js";
|
|
8
|
+
import { AgentMessageItem$outboundSchema, } from "./agentmessageitem.js";
|
|
8
9
|
import { ApplyPatchCallItem$outboundSchema, } from "./applypatchcallitem.js";
|
|
9
10
|
import { ApplyPatchCallOutputItem$outboundSchema, } from "./applypatchcalloutputitem.js";
|
|
10
11
|
import { CompactionItem$outboundSchema, } from "./compactionitem.js";
|
|
12
|
+
import { ContextCompactionItem$outboundSchema, } from "./contextcompactionitem.js";
|
|
11
13
|
import { CustomToolCallItem$outboundSchema, } from "./customtoolcallitem.js";
|
|
12
14
|
import { CustomToolCallOutputItem$outboundSchema, } from "./customtoolcalloutputitem.js";
|
|
13
15
|
import { EasyInputMessage$outboundSchema, } from "./easyinputmessage.js";
|
|
@@ -221,6 +223,7 @@ export const InputsUnion1$outboundSchema = z.union([
|
|
|
221
223
|
OutputDatetimeItem$outboundSchema,
|
|
222
224
|
McpListToolsItem$outboundSchema,
|
|
223
225
|
CustomToolCallItem$outboundSchema,
|
|
226
|
+
AgentMessageItem$outboundSchema,
|
|
224
227
|
ReasoningItem$outboundSchema,
|
|
225
228
|
FunctionCallOutputItem$outboundSchema,
|
|
226
229
|
ApplyPatchCallOutputItem$outboundSchema,
|
|
@@ -254,6 +257,7 @@ export const InputsUnion1$outboundSchema = z.union([
|
|
|
254
257
|
ItemReferenceItem$outboundSchema,
|
|
255
258
|
EasyInputMessage$outboundSchema,
|
|
256
259
|
InputMessageItem$outboundSchema,
|
|
260
|
+
ContextCompactionItem$outboundSchema,
|
|
257
261
|
]);
|
|
258
262
|
export function inputsUnion1ToJSON(inputsUnion1) {
|
|
259
263
|
return JSON.stringify(InputsUnion1$outboundSchema.parse(inputsUnion1));
|
|
@@ -276,6 +280,7 @@ export const InputsUnion$outboundSchema = z.union([
|
|
|
276
280
|
OutputDatetimeItem$outboundSchema,
|
|
277
281
|
McpListToolsItem$outboundSchema,
|
|
278
282
|
CustomToolCallItem$outboundSchema,
|
|
283
|
+
AgentMessageItem$outboundSchema,
|
|
279
284
|
ReasoningItem$outboundSchema,
|
|
280
285
|
FunctionCallOutputItem$outboundSchema,
|
|
281
286
|
ApplyPatchCallOutputItem$outboundSchema,
|
|
@@ -309,6 +314,7 @@ export const InputsUnion$outboundSchema = z.union([
|
|
|
309
314
|
ItemReferenceItem$outboundSchema,
|
|
310
315
|
EasyInputMessage$outboundSchema,
|
|
311
316
|
InputMessageItem$outboundSchema,
|
|
317
|
+
ContextCompactionItem$outboundSchema,
|
|
312
318
|
])),
|
|
313
319
|
]);
|
|
314
320
|
export function inputsUnionToJSON(inputsUnion) {
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.40",
|
|
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
78
|
"test": "vitest --run --project unit",
|
|
79
|
+
"test:e2e": "vitest --run --project e2e",
|
|
80
80
|
"test:transit": "exit 0",
|
|
81
|
-
"test:watch": "vitest --watch --project unit",
|
|
82
81
|
"typecheck": "tsc --noEmit",
|
|
83
82
|
"typecheck:transit": "exit 0",
|
|
84
|
-
"
|
|
83
|
+
"compile": "tsc",
|
|
84
|
+
"test:watch": "vitest --watch --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|