@opencode/ai 0.0.0-dev-21920 → 0.0.0-dev-21922
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 +22 -2
- package/dist/cache-policy.d.ts +4 -0
- package/dist/cache-policy.js +20 -6
- package/dist/protocols/alibaba-chat.d.ts +4 -0
- package/dist/protocols/alibaba-messages.d.ts +19 -19
- package/dist/protocols/anthropic-messages.d.ts +59 -59
- package/dist/protocols/anthropic-messages.js +3 -5
- package/dist/protocols/bedrock-converse.d.ts +12 -12
- package/dist/protocols/meta-messages.d.ts +19 -19
- package/dist/protocols/meta-messages.js +2 -1
- package/dist/protocols/openai-chat.d.ts +585 -1
- package/dist/protocols/openai-chat.js +7 -2
- package/dist/protocols/openai-compatible-chat.d.ts +4 -0
- package/dist/protocols/openai-responses.d.ts +24 -0
- package/dist/protocols/openai-responses.js +5 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
- package/dist/protocols/utils/bedrock-cache.js +7 -6
- package/dist/protocols/utils/cache.d.ts +14 -3
- package/dist/protocols/utils/cache.js +11 -4
- package/dist/protocols/venice-chat.d.ts +3 -0
- package/dist/protocols/venice-chat.js +1 -1
- package/dist/protocols/zai-chat.d.ts +4 -0
- package/dist/protocols/zai-messages.d.ts +19 -19
- package/dist/providers/alibaba.d.ts +23 -19
- package/dist/providers/amazon-bedrock-mantle.d.ts +23 -19
- package/dist/providers/amazon-bedrock.d.ts +4 -4
- package/dist/providers/anthropic-compatible.d.ts +19 -19
- package/dist/providers/anthropic.d.ts +19 -19
- package/dist/providers/azure.d.ts +12 -0
- package/dist/providers/baseten.d.ts +8 -0
- package/dist/providers/cerebras.d.ts +8 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +54 -38
- package/dist/providers/cloudflare-workers-ai.d.ts +8 -0
- package/dist/providers/cohere.d.ts +8 -0
- package/dist/providers/deepinfra.d.ts +8 -0
- package/dist/providers/deepseek.d.ts +8 -0
- package/dist/providers/digitalocean.d.ts +12 -0
- package/dist/providers/fireworks.d.ts +8 -0
- package/dist/providers/google-vertex-chat.d.ts +4 -0
- package/dist/providers/google-vertex-messages.d.ts +19 -19
- package/dist/providers/groq.d.ts +8 -0
- package/dist/providers/meta.d.ts +23 -19
- package/dist/providers/minimax.d.ts +23 -19
- package/dist/providers/moonshot.d.ts +23 -19
- package/dist/providers/openai-compatible.d.ts +4 -0
- package/dist/providers/openai.d.ts +8 -0
- package/dist/providers/openrouter.d.ts +16 -0
- package/dist/providers/togetherai.d.ts +8 -0
- package/dist/providers/venice.d.ts +3 -0
- package/dist/providers/xai.d.ts +4 -0
- package/dist/providers/zai-coding-plan.d.ts +23 -19
- package/dist/providers/zai.d.ts +4 -0
- package/dist/schema/messages.d.ts +2 -2
- package/dist/schema/options.d.ts +5 -3
- package/dist/schema/options.js +8 -3
- package/package.json +3 -3
|
@@ -17,7 +17,7 @@ export declare const protocol: Protocol<{
|
|
|
17
17
|
readonly text: string;
|
|
18
18
|
readonly cache_control?: {
|
|
19
19
|
readonly type: "ephemeral";
|
|
20
|
-
readonly ttl?:
|
|
20
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
21
21
|
} | undefined;
|
|
22
22
|
}[] | undefined;
|
|
23
23
|
readonly messages: readonly ({
|
|
@@ -27,7 +27,7 @@ export declare const protocol: Protocol<{
|
|
|
27
27
|
readonly text: string;
|
|
28
28
|
readonly cache_control?: {
|
|
29
29
|
readonly type: "ephemeral";
|
|
30
|
-
readonly ttl?:
|
|
30
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
31
31
|
} | undefined;
|
|
32
32
|
} | {
|
|
33
33
|
readonly type: "image";
|
|
@@ -44,7 +44,7 @@ export declare const protocol: Protocol<{
|
|
|
44
44
|
};
|
|
45
45
|
readonly cache_control?: {
|
|
46
46
|
readonly type: "ephemeral";
|
|
47
|
-
readonly ttl?:
|
|
47
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
48
48
|
} | undefined;
|
|
49
49
|
readonly transformations?: {
|
|
50
50
|
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
@@ -64,7 +64,7 @@ export declare const protocol: Protocol<{
|
|
|
64
64
|
};
|
|
65
65
|
readonly cache_control?: {
|
|
66
66
|
readonly type: "ephemeral";
|
|
67
|
-
readonly ttl?:
|
|
67
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
68
68
|
} | undefined;
|
|
69
69
|
} | {
|
|
70
70
|
readonly type: "document";
|
|
@@ -85,7 +85,7 @@ export declare const protocol: Protocol<{
|
|
|
85
85
|
};
|
|
86
86
|
readonly cache_control?: {
|
|
87
87
|
readonly type: "ephemeral";
|
|
88
|
-
readonly ttl?:
|
|
88
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
89
89
|
} | undefined;
|
|
90
90
|
readonly title?: string | undefined;
|
|
91
91
|
readonly context?: string | undefined;
|
|
@@ -100,7 +100,7 @@ export declare const protocol: Protocol<{
|
|
|
100
100
|
readonly text: string;
|
|
101
101
|
readonly cache_control?: {
|
|
102
102
|
readonly type: "ephemeral";
|
|
103
|
-
readonly ttl?:
|
|
103
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
104
104
|
} | undefined;
|
|
105
105
|
} | {
|
|
106
106
|
readonly type: "image";
|
|
@@ -117,7 +117,7 @@ export declare const protocol: Protocol<{
|
|
|
117
117
|
};
|
|
118
118
|
readonly cache_control?: {
|
|
119
119
|
readonly type: "ephemeral";
|
|
120
|
-
readonly ttl?:
|
|
120
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
121
121
|
} | undefined;
|
|
122
122
|
readonly transformations?: {
|
|
123
123
|
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
@@ -137,7 +137,7 @@ export declare const protocol: Protocol<{
|
|
|
137
137
|
};
|
|
138
138
|
readonly cache_control?: {
|
|
139
139
|
readonly type: "ephemeral";
|
|
140
|
-
readonly ttl?:
|
|
140
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
141
141
|
} | undefined;
|
|
142
142
|
} | {
|
|
143
143
|
readonly type: "document";
|
|
@@ -158,7 +158,7 @@ export declare const protocol: Protocol<{
|
|
|
158
158
|
};
|
|
159
159
|
readonly cache_control?: {
|
|
160
160
|
readonly type: "ephemeral";
|
|
161
|
-
readonly ttl?:
|
|
161
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
162
162
|
} | undefined;
|
|
163
163
|
readonly title?: string | undefined;
|
|
164
164
|
readonly context?: string | undefined;
|
|
@@ -169,7 +169,7 @@ export declare const protocol: Protocol<{
|
|
|
169
169
|
readonly is_error?: boolean | undefined;
|
|
170
170
|
readonly cache_control?: {
|
|
171
171
|
readonly type: "ephemeral";
|
|
172
|
-
readonly ttl?:
|
|
172
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
173
173
|
} | undefined;
|
|
174
174
|
})[];
|
|
175
175
|
} | {
|
|
@@ -182,7 +182,7 @@ export declare const protocol: Protocol<{
|
|
|
182
182
|
readonly text: string;
|
|
183
183
|
readonly cache_control?: {
|
|
184
184
|
readonly type: "ephemeral";
|
|
185
|
-
readonly ttl?:
|
|
185
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
186
186
|
} | undefined;
|
|
187
187
|
} | {
|
|
188
188
|
readonly type: "thinking";
|
|
@@ -190,14 +190,14 @@ export declare const protocol: Protocol<{
|
|
|
190
190
|
readonly signature: string;
|
|
191
191
|
readonly cache_control?: {
|
|
192
192
|
readonly type: "ephemeral";
|
|
193
|
-
readonly ttl?:
|
|
193
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
194
194
|
} | undefined;
|
|
195
195
|
} | {
|
|
196
196
|
readonly type: "redacted_thinking";
|
|
197
197
|
readonly data: string;
|
|
198
198
|
readonly cache_control?: {
|
|
199
199
|
readonly type: "ephemeral";
|
|
200
|
-
readonly ttl?:
|
|
200
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
201
201
|
} | undefined;
|
|
202
202
|
} | {
|
|
203
203
|
readonly type: "tool_use";
|
|
@@ -206,7 +206,7 @@ export declare const protocol: Protocol<{
|
|
|
206
206
|
readonly input: unknown;
|
|
207
207
|
readonly cache_control?: {
|
|
208
208
|
readonly type: "ephemeral";
|
|
209
|
-
readonly ttl?:
|
|
209
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
210
210
|
} | undefined;
|
|
211
211
|
} | {
|
|
212
212
|
readonly type: "server_tool_use";
|
|
@@ -215,7 +215,7 @@ export declare const protocol: Protocol<{
|
|
|
215
215
|
readonly input: unknown;
|
|
216
216
|
readonly cache_control?: {
|
|
217
217
|
readonly type: "ephemeral";
|
|
218
|
-
readonly ttl?:
|
|
218
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
219
219
|
} | undefined;
|
|
220
220
|
} | {
|
|
221
221
|
readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
|
|
@@ -223,7 +223,7 @@ export declare const protocol: Protocol<{
|
|
|
223
223
|
readonly content: unknown;
|
|
224
224
|
readonly cache_control?: {
|
|
225
225
|
readonly type: "ephemeral";
|
|
226
|
-
readonly ttl?:
|
|
226
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
227
227
|
} | undefined;
|
|
228
228
|
})[];
|
|
229
229
|
} | {
|
|
@@ -233,7 +233,7 @@ export declare const protocol: Protocol<{
|
|
|
233
233
|
readonly text: string;
|
|
234
234
|
readonly cache_control?: {
|
|
235
235
|
readonly type: "ephemeral";
|
|
236
|
-
readonly ttl?:
|
|
236
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
237
237
|
} | undefined;
|
|
238
238
|
}[];
|
|
239
239
|
readonly output_config?: {
|
|
@@ -281,7 +281,7 @@ export declare const protocol: Protocol<{
|
|
|
281
281
|
} | undefined;
|
|
282
282
|
readonly cache_control?: {
|
|
283
283
|
readonly type: "ephemeral";
|
|
284
|
-
readonly ttl?:
|
|
284
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
285
285
|
} | undefined;
|
|
286
286
|
readonly container?: string | {
|
|
287
287
|
readonly id?: string | null | undefined;
|
|
@@ -313,7 +313,7 @@ export declare const protocol: Protocol<{
|
|
|
313
313
|
};
|
|
314
314
|
readonly cache_control?: {
|
|
315
315
|
readonly type: "ephemeral";
|
|
316
|
-
readonly ttl?:
|
|
316
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
317
317
|
} | undefined;
|
|
318
318
|
})[] | undefined;
|
|
319
319
|
}, string, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { Protocol } from "../route/protocol.js";
|
|
3
|
+
import { CacheTTL } from "../schema/index.js";
|
|
3
4
|
import { AnthropicMessages } from "./anthropic-messages.js";
|
|
4
5
|
import { MetaResponses } from "./meta-responses.js";
|
|
5
6
|
import { JsonObject, optionalArray, ProviderShared } from "./shared.js";
|
|
@@ -10,7 +11,7 @@ const WebSearch = Schema.Struct({
|
|
|
10
11
|
});
|
|
11
12
|
const MetaCacheControl = Schema.Struct({
|
|
12
13
|
type: Schema.tag("ephemeral"),
|
|
13
|
-
ttl: Schema.optional(
|
|
14
|
+
ttl: Schema.optional(CacheTTL),
|
|
14
15
|
});
|
|
15
16
|
const FunctionTool = Schema.Struct({
|
|
16
17
|
name: Schema.String,
|