@opencode/ai 2.0.31 → 2.1.0
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/dist/ai-client.d.ts +2 -2
- package/dist/experimental/evaluation-client.d.ts +1 -1
- package/dist/experimental/evaluation.d.ts +20 -20
- package/dist/experimental/realtime.d.ts +47 -0
- package/dist/experimental/realtime.js +99 -0
- package/dist/experimental/system-one.d.ts +1 -1
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.js +1 -0
- package/dist/image-client.d.ts +8 -8
- package/dist/image.d.ts +593 -437
- package/dist/llm.d.ts +51 -51
- package/dist/media-client.d.ts +1 -1
- package/dist/media.d.ts +4 -4
- package/dist/promise.d.ts +199 -198
- package/dist/protocols/alibaba-chat.d.ts +81 -82
- package/dist/protocols/alibaba-chat.js +0 -1
- package/dist/protocols/alibaba-messages.d.ts +99 -99
- package/dist/protocols/alibaba-responses.d.ts +120 -120
- package/dist/protocols/anthropic-messages.d.ts +187 -187
- package/dist/protocols/anthropic-messages.js +3 -2
- package/dist/protocols/assemblyai-transcription.d.ts +1 -1
- package/dist/protocols/bedrock-converse.d.ts +75 -79
- package/dist/protocols/bfl-images.d.ts +1 -1
- package/dist/protocols/cartesia-speech.d.ts +17 -17
- package/dist/protocols/cohere-chat.d.ts +26 -23
- package/dist/protocols/cohere-chat.js +22 -1
- package/dist/protocols/deepgram-speech.d.ts +17 -17
- package/dist/protocols/deepgram-transcription.d.ts +1 -1
- package/dist/protocols/elevenlabs-speech.d.ts +17 -17
- package/dist/protocols/elevenlabs-transcription.d.ts +1 -1
- package/dist/protocols/fal-images.d.ts +1 -1
- package/dist/protocols/fal-video.d.ts +1 -1
- package/dist/protocols/gemini.d.ts +55 -55
- package/dist/protocols/gemini.js +11 -1
- package/dist/protocols/google-images.d.ts +1 -1
- package/dist/protocols/google-interactions.d.ts +64 -62
- package/dist/protocols/google-interactions.js +19 -1
- package/dist/protocols/google-speech.d.ts +17 -17
- package/dist/protocols/google-transcription.d.ts +47 -47
- package/dist/protocols/google-video.d.ts +1 -1
- package/dist/protocols/meta-messages.d.ts +121 -121
- package/dist/protocols/meta-responses.d.ts +201 -201
- package/dist/protocols/mistral-chat.d.ts +45 -45
- package/dist/protocols/open-responses-channel.d.ts +1 -1
- package/dist/protocols/open-responses.d.ts +584 -450
- package/dist/protocols/open-responses.js +27 -35
- package/dist/protocols/openai-chat.d.ts +248 -248
- package/dist/protocols/openai-chat.js +11 -42
- package/dist/protocols/openai-compatible-chat.d.ts +32 -32
- package/dist/protocols/openai-compatible-responses.d.ts +88 -88
- package/dist/protocols/openai-images.d.ts +17 -17
- package/dist/protocols/openai-responses.d.ts +567 -567
- package/dist/protocols/openai-responses.js +1 -1
- package/dist/protocols/openai-speech.d.ts +17 -17
- package/dist/protocols/openai-transcription.d.ts +47 -47
- package/dist/protocols/replicate-images.d.ts +1 -1
- package/dist/protocols/runway-video.d.ts +1 -1
- package/dist/protocols/shared.d.ts +12 -1
- package/dist/protocols/shared.js +17 -1
- package/dist/protocols/stability-images.d.ts +2 -2
- package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
- package/dist/protocols/utils/bedrock-media.d.ts +4 -4
- package/dist/protocols/utils/openai-options.d.ts +1 -1
- package/dist/protocols/utils/speech-stream.d.ts +1 -1
- package/dist/protocols/utils/tool-schema.d.ts +10 -5
- package/dist/protocols/utils/tool-stream.d.ts +152 -152
- package/dist/protocols/venice-chat.d.ts +109 -110
- package/dist/protocols/venice-chat.js +0 -1
- package/dist/protocols/xai-images.d.ts +1 -1
- package/dist/protocols/xai-responses.d.ts +79 -79
- package/dist/protocols/xai-video.d.ts +1 -1
- package/dist/protocols/zai-chat.d.ts +77 -78
- package/dist/protocols/zai-chat.js +0 -1
- package/dist/protocols/zai-images.d.ts +1 -1
- package/dist/protocols/zai-messages.d.ts +97 -97
- package/dist/providers/alibaba.d.ts +222 -283
- package/dist/providers/amazon-bedrock-mantle.d.ts +291 -298
- package/dist/providers/amazon-bedrock.d.ts +22 -28
- package/dist/providers/anthropic-compatible.d.ts +86 -90
- package/dist/providers/anthropic.d.ts +86 -90
- package/dist/providers/assemblyai.d.ts +2 -6
- package/dist/providers/azure.d.ts +228 -238
- package/dist/providers/baseten.d.ts +66 -70
- package/dist/providers/black-forest-labs.d.ts +2 -6
- package/dist/providers/cartesia.d.ts +2 -6
- package/dist/providers/cerebras.d.ts +66 -70
- package/dist/providers/cerebras.js +0 -1
- package/dist/providers/cloudflare-ai-gateway.d.ts +352 -356
- package/dist/providers/cloudflare-workers-ai.d.ts +66 -70
- package/dist/providers/cohere.d.ts +122 -132
- package/dist/providers/cohere.js +0 -2
- package/dist/providers/deepgram.d.ts +2 -7
- package/dist/providers/deepinfra.d.ts +66 -70
- package/dist/providers/deepinfra.js +0 -1
- package/dist/providers/deepseek.d.ts +66 -70
- package/dist/providers/deepseek.js +1 -1
- package/dist/providers/digitalocean.d.ts +137 -141
- package/dist/providers/elevenlabs.d.ts +2 -7
- package/dist/providers/fal.d.ts +2 -7
- package/dist/providers/fireworks.d.ts +66 -70
- package/dist/providers/google-vertex-chat.d.ts +34 -38
- package/dist/providers/google-vertex-interactions.d.ts +31 -41
- package/dist/providers/google-vertex-messages.d.ts +81 -85
- package/dist/providers/google-vertex-mistral.d.ts +23 -27
- package/dist/providers/google-vertex-responses.d.ts +90 -94
- package/dist/providers/google-vertex.d.ts +26 -30
- package/dist/providers/google.d.ts +94 -109
- package/dist/providers/groq.d.ts +111 -115
- package/dist/providers/groq.js +0 -1
- package/dist/providers/meta.d.ts +309 -317
- package/dist/providers/meta.js +1 -1
- package/dist/providers/minimax.d.ts +296 -303
- package/dist/providers/minimax.js +1 -1
- package/dist/providers/mistral.d.ts +22 -26
- package/dist/providers/moonshot.d.ts +296 -303
- package/dist/providers/moonshot.js +0 -1
- package/dist/providers/openai-compatible-responses.d.ts +90 -94
- package/dist/providers/openai-compatible.d.ts +34 -38
- package/dist/providers/openai.d.ts +93 -108
- package/dist/providers/opencode.d.ts +2 -8
- package/dist/providers/openrouter.d.ts +137 -144
- package/dist/providers/replicate.d.ts +2 -6
- package/dist/providers/runway.d.ts +2 -6
- package/dist/providers/stability.d.ts +2 -7
- package/dist/providers/togetherai.d.ts +66 -70
- package/dist/providers/togetherai.js +1 -1
- package/dist/providers/typesafe-ai.d.ts +2 -8
- package/dist/providers/venice.d.ts +58 -63
- package/dist/providers/vercel-ai-gateway.d.ts +2 -12
- package/dist/providers/xai.d.ts +38 -50
- package/dist/providers/zai-coding-plan.d.ts +206 -213
- package/dist/providers/zai.d.ts +40 -46
- package/dist/route/client.d.ts +51 -51
- package/dist/route/media-protocol.d.ts +1 -1
- package/dist/route/transport/http.d.ts +1 -1
- package/dist/route/transport/websocket.d.ts +8 -8
- package/dist/schema/errors.d.ts +19 -19
- package/dist/schema/events.d.ts +3090 -3288
- package/dist/schema/messages.d.ts +8 -7
- package/dist/schema/options.d.ts +2 -1
- package/dist/schema/options.js +2 -1
- package/dist/speech-client.d.ts +8 -8
- package/dist/speech.d.ts +434 -398
- package/dist/testing.d.ts +338 -338
- package/dist/tool-runtime.d.ts +1 -1
- package/dist/transcription-client.d.ts +23 -23
- package/dist/transcription.d.ts +562 -646
- package/dist/utils/sanitize.d.ts +4 -0
- package/dist/utils/sanitize.js +23 -6
- package/dist/video-client.d.ts +8 -8
- package/dist/video.d.ts +416 -372
- package/package.json +6 -6
|
@@ -11,13 +11,14 @@ declare const systemPartSchema: Schema.Struct<{
|
|
|
11
11
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
12
12
|
}>;
|
|
13
13
|
export type SystemPart = Schema.Schema.Type<typeof systemPartSchema>;
|
|
14
|
+
declare const makeSystemPart: (text: string) => SystemPart;
|
|
14
15
|
export declare const SystemPart: Schema.Struct<{
|
|
15
16
|
readonly type: Schema.Literal<"text">;
|
|
16
17
|
readonly text: Schema.String;
|
|
17
18
|
readonly cache: Schema.optional<typeof CacheHint>;
|
|
18
19
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
19
20
|
}> & {
|
|
20
|
-
make:
|
|
21
|
+
make: typeof makeSystemPart;
|
|
21
22
|
content: (input?: string | SystemPart | ReadonlyArray<SystemPart>) => any[];
|
|
22
23
|
};
|
|
23
24
|
export declare const TextPart: Schema.Struct<{
|
|
@@ -248,8 +249,8 @@ declare const compactionPartSchema: Schema.refine<{
|
|
|
248
249
|
readonly type: "compaction";
|
|
249
250
|
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
250
251
|
readonly id?: string | undefined;
|
|
251
|
-
readonly text?: string | null | undefined;
|
|
252
252
|
readonly encrypted?: string | undefined;
|
|
253
|
+
readonly text?: string | null | undefined;
|
|
253
254
|
} & CompactionContent, Schema.Struct<{
|
|
254
255
|
readonly type: Schema.Literal<"compaction">;
|
|
255
256
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -263,8 +264,8 @@ export declare const CompactionPart: Schema.refine<{
|
|
|
263
264
|
readonly type: "compaction";
|
|
264
265
|
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
265
266
|
readonly id?: string | undefined;
|
|
266
|
-
readonly text?: string | null | undefined;
|
|
267
267
|
readonly encrypted?: string | undefined;
|
|
268
|
+
readonly text?: string | null | undefined;
|
|
268
269
|
} & CompactionContent, Schema.Struct<{
|
|
269
270
|
readonly type: Schema.Literal<"compaction">;
|
|
270
271
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -406,8 +407,8 @@ export declare const ContentPart: Schema.toTaggedUnion<"type", readonly [Schema.
|
|
|
406
407
|
readonly type: "compaction";
|
|
407
408
|
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
408
409
|
readonly id?: string | undefined;
|
|
409
|
-
readonly text?: string | null | undefined;
|
|
410
410
|
readonly encrypted?: string | undefined;
|
|
411
|
+
readonly text?: string | null | undefined;
|
|
411
412
|
} & CompactionContent, Schema.Struct<{
|
|
412
413
|
readonly type: Schema.Literal<"compaction">;
|
|
413
414
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -550,8 +551,8 @@ declare const Message_base: Schema.Class<Message, Schema.Struct<{
|
|
|
550
551
|
readonly type: "compaction";
|
|
551
552
|
readonly provider: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
552
553
|
readonly id?: string | undefined;
|
|
553
|
-
readonly text?: string | null | undefined;
|
|
554
554
|
readonly encrypted?: string | undefined;
|
|
555
|
+
readonly text?: string | null | undefined;
|
|
555
556
|
} & CompactionContent, Schema.Struct<{
|
|
556
557
|
readonly type: Schema.Literal<"compaction">;
|
|
557
558
|
readonly provider: Schema.brand<Schema.String, "AI.ProviderID">;
|
|
@@ -673,7 +674,7 @@ declare const requestSchema: Schema.Struct<{
|
|
|
673
674
|
readonly cache: Schema.optional<typeof CacheHint>;
|
|
674
675
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
675
676
|
}> & {
|
|
676
|
-
make:
|
|
677
|
+
make: typeof makeSystemPart;
|
|
677
678
|
content: (input?: string | SystemPart | ReadonlyArray<SystemPart>) => any[];
|
|
678
679
|
}>;
|
|
679
680
|
readonly messages: Schema.$Array<typeof Message>;
|
|
@@ -710,7 +711,7 @@ declare const LLMRequest_base: Schema.Class<LLMRequest<LanguageModel<{
|
|
|
710
711
|
readonly cache: Schema.optional<typeof CacheHint>;
|
|
711
712
|
readonly metadata: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
712
713
|
}> & {
|
|
713
|
-
make:
|
|
714
|
+
make: typeof makeSystemPart;
|
|
714
715
|
content: (input?: string | SystemPart | ReadonlyArray<SystemPart>) => any[];
|
|
715
716
|
}>;
|
|
716
717
|
readonly messages: Schema.$Array<typeof Message>;
|
package/dist/schema/options.d.ts
CHANGED
|
@@ -110,7 +110,8 @@ declare const LanguageModelCompatibility_base: Schema.Class<LanguageModelCompati
|
|
|
110
110
|
readonly requireFinishReason: Schema.optional<Schema.Boolean>;
|
|
111
111
|
readonly requireAssistantAfterTool: Schema.optional<Schema.Boolean>;
|
|
112
112
|
readonly supportsStore: Schema.optional<Schema.Boolean>;
|
|
113
|
-
|
|
113
|
+
/** Request usage in the stream with `stream_options.include_usage`. Defaults to true. */
|
|
114
|
+
readonly streamUsage: Schema.optional<Schema.Boolean>;
|
|
114
115
|
readonly supportsStrictMode: Schema.optional<Schema.Boolean>;
|
|
115
116
|
readonly supportsPromptCacheKey: Schema.optional<Schema.Boolean>;
|
|
116
117
|
/** Prompt-cache marker syntax the endpoint accepts. Overrides the route default; both send `cache_control`, and `alibaba` skips tool definitions. */
|
package/dist/schema/options.js
CHANGED
|
@@ -145,7 +145,8 @@ export class LanguageModelCompatibility extends Schema.Class("LLM.LanguageModelC
|
|
|
145
145
|
requireFinishReason: Schema.optional(Schema.Boolean),
|
|
146
146
|
requireAssistantAfterTool: Schema.optional(Schema.Boolean),
|
|
147
147
|
supportsStore: Schema.optional(Schema.Boolean),
|
|
148
|
-
|
|
148
|
+
/** Request usage in the stream with `stream_options.include_usage`. Defaults to true. */
|
|
149
|
+
streamUsage: Schema.optional(Schema.Boolean),
|
|
149
150
|
supportsStrictMode: Schema.optional(Schema.Boolean),
|
|
150
151
|
// Accepts `prompt_cache_key` in the request body. Chat omits the key unless
|
|
151
152
|
// this is true; other protocols omit it only when this is false.
|
package/dist/speech-client.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type Service = SpeechClientService;
|
|
|
10
10
|
export declare const SpeechClient: {
|
|
11
11
|
readonly layer: import("effect/Layer").Layer<SpeechClientService, never, import("./route/executor-service.js").RequestExecutorService>;
|
|
12
12
|
readonly generate: (request: SpeechRequestFor, options?: import("./generation.js").AwaitOptions) => import("effect/Effect").Effect<SpeechResponse, import("./index.js").AIError, SpeechClientService>;
|
|
13
|
-
readonly stream: (request: SpeechRequestFor, options?: import("./generation.js").AwaitOptions) => import("effect/Stream").Stream<
|
|
13
|
+
readonly stream: (request: SpeechRequestFor, options?: import("./generation.js").AwaitOptions) => import("effect/Stream").Stream<{
|
|
14
14
|
readonly type: "audio-delta";
|
|
15
15
|
readonly chunk: Uint8Array<ArrayBufferLike>;
|
|
16
16
|
} | {
|
|
@@ -23,11 +23,6 @@ export declare const SpeechClient: {
|
|
|
23
23
|
} | {
|
|
24
24
|
readonly type: "finish";
|
|
25
25
|
readonly audio: import("./media.js").Asset;
|
|
26
|
-
readonly providerMetadata?: {
|
|
27
|
-
readonly [x: string]: {
|
|
28
|
-
readonly [x: string]: unknown;
|
|
29
|
-
};
|
|
30
|
-
} | undefined;
|
|
31
26
|
readonly usage?: {
|
|
32
27
|
readonly type: "tokens";
|
|
33
28
|
readonly input?: number | undefined;
|
|
@@ -50,7 +45,7 @@ export declare const SpeechClient: {
|
|
|
50
45
|
readonly seconds: number;
|
|
51
46
|
} | undefined;
|
|
52
47
|
readonly notices?: readonly {
|
|
53
|
-
readonly type: "
|
|
48
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
54
49
|
readonly message: string;
|
|
55
50
|
readonly providerMetadata?: {
|
|
56
51
|
readonly [x: string]: {
|
|
@@ -58,7 +53,12 @@ export declare const SpeechClient: {
|
|
|
58
53
|
};
|
|
59
54
|
} | undefined;
|
|
60
55
|
}[] | undefined;
|
|
61
|
-
|
|
56
|
+
readonly providerMetadata?: {
|
|
57
|
+
readonly [x: string]: {
|
|
58
|
+
readonly [x: string]: unknown;
|
|
59
|
+
};
|
|
60
|
+
} | undefined;
|
|
61
|
+
} | import("./generation.js").Observation, import("./index.js").AIError, SpeechClientService>;
|
|
62
62
|
readonly start: (request: SpeechRequestFor) => import("effect/Effect").Effect<import("./generation.js").Generation<SpeechResponse>, import("./index.js").AIError, SpeechClientService>;
|
|
63
63
|
readonly resume: (model: import("./speech.js").SpeechModel<import("./media-model.js").MediaModel.Options>, token: unknown) => import("effect/Effect").Effect<import("./generation.js").Generation<SpeechResponse>, import("./index.js").AIError, SpeechClientService>;
|
|
64
64
|
readonly Service: typeof SpeechClientService;
|