@opencode-ai/ai 0.0.0-next-15646 → 0.0.0-next-15648

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 CHANGED
@@ -128,11 +128,13 @@ OpenAI Chat and OpenAI Responses are separate semantic entrypoints:
128
128
  - `@opencode-ai/ai/providers/openai-compatible/responses`
129
129
  - `@opencode-ai/ai/providers/anthropic-compatible`
130
130
  - `@opencode-ai/ai/providers/google-vertex/gemini`
131
+ - `@opencode-ai/ai/providers/google-vertex/chat`
132
+ - `@opencode-ai/ai/providers/google-vertex/responses`
131
133
  - `@opencode-ai/ai/providers/google-vertex/messages`
132
134
 
133
135
  Responses HTTP versus WebSocket is a scoped `transport` setting on the OpenAI Responses entrypoint, not another entrypoint. Azure follows the same Chat/Responses split at `providers/azure/chat` and `providers/azure/responses`. Generic OpenAI-compatible Chat remains at `providers/openai-compatible`; compatible Responses is separate at `providers/openai-compatible/responses`. Generic Anthropic Messages-compatible providers use `providers/anthropic-compatible`, which the named Anthropic provider composes. Google Gemini and Amazon Bedrock expose their single native API through their existing provider paths.
134
136
 
135
- Vertex Gemini and Vertex Messages are separate API entrypoints. Both accept `project`, `location`, and an optional `accessToken`; when no explicit token or auth override is supplied they lazily use Google Application Default Credentials. Vertex Gemini instead selects express mode when `apiKey` or `GOOGLE_VERTEX_API_KEY` is present. `providers/google-vertex` remains the default alias for `providers/google-vertex/gemini`.
137
+ Vertex Gemini, Vertex Chat, Vertex Responses, and Vertex Messages are separate API entrypoints. All accept `project`, `location`, and an optional `accessToken`; when no explicit token or auth override is supplied they lazily use Google Application Default Credentials. Vertex Gemini instead selects express mode when `apiKey` or `GOOGLE_VERTEX_API_KEY` is present. Vertex Chat targets MaaS models through the OpenAI-compatible Chat Completions endpoint, while Vertex Responses targets Grok models and defaults `store` to `false` as required by Vertex. `providers/google-vertex` remains the default alias for `providers/google-vertex/gemini`.
136
138
 
137
139
  Tuned Vertex Gemini deployments use model ids shaped like `endpoints/1234567890` and require OAuth or ADC; Vertex express-mode API keys support publisher models only.
138
140
 
@@ -142,6 +144,18 @@ import { model } from "@opencode-ai/ai/providers/google-vertex/gemini"
142
144
  model("gemini-3.5-flash", { project: "my-project", location: "global" })
143
145
  ```
144
146
 
147
+ ```ts
148
+ import { model } from "@opencode-ai/ai/providers/google-vertex/chat"
149
+
150
+ model("deepseek-ai/deepseek-v3.2-maas", { project: "my-project", location: "global" })
151
+ ```
152
+
153
+ ```ts
154
+ import { model } from "@opencode-ai/ai/providers/google-vertex/responses"
155
+
156
+ model("xai/grok-4.20-reasoning", { project: "my-project", location: "global" })
157
+ ```
158
+
145
159
  ```ts
146
160
  import { model } from "@opencode-ai/ai/providers/google-vertex/messages"
147
161
 
@@ -0,0 +1,2 @@
1
+ export { model } from "../google-vertex-chat";
2
+ export type { Settings } from "../google-vertex-chat";
@@ -0,0 +1 @@
1
+ export { model } from "../google-vertex-chat";
@@ -0,0 +1,2 @@
1
+ export { model } from "../google-vertex-responses";
2
+ export type { Settings } from "../google-vertex-responses";
@@ -0,0 +1 @@
1
+ export { model } from "../google-vertex-responses";
@@ -0,0 +1,95 @@
1
+ import type { ProviderPackage } from "../provider-package";
2
+ import type { RouteDefaultsInput } from "../route/client";
3
+ import { type ModelID, type ProviderOptions } from "../schema";
4
+ import { GoogleVertexShared } from "./google-vertex-shared";
5
+ export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
6
+ export type Config = RouteDefaultsInput & GoogleVertexShared.OAuthOptions & {
7
+ readonly baseURL?: string;
8
+ readonly location?: string;
9
+ readonly project?: string;
10
+ };
11
+ export interface Settings extends ProviderPackage.Settings {
12
+ readonly accessToken?: string;
13
+ readonly apiKey?: never;
14
+ readonly baseURL?: string;
15
+ readonly location?: string;
16
+ readonly project?: string;
17
+ readonly providerOptions?: ProviderOptions;
18
+ }
19
+ export declare const routes: import("../route").Route<{
20
+ readonly model: string;
21
+ readonly messages: readonly ({
22
+ readonly role: "system";
23
+ readonly content: string;
24
+ } | {
25
+ readonly role: "user";
26
+ readonly content: string | readonly ({
27
+ readonly type: "text";
28
+ readonly text: string;
29
+ } | {
30
+ readonly type: "image_url";
31
+ readonly image_url: {
32
+ readonly url: string;
33
+ };
34
+ })[];
35
+ } | {
36
+ readonly role: "assistant";
37
+ readonly content: string | null;
38
+ readonly tool_calls?: readonly {
39
+ readonly id: string;
40
+ readonly type: "function";
41
+ readonly function: {
42
+ readonly name: string;
43
+ readonly arguments: string;
44
+ };
45
+ }[] | undefined;
46
+ readonly reasoning_content?: string | undefined;
47
+ } | {
48
+ readonly role: "tool";
49
+ readonly tool_call_id: string;
50
+ readonly content: string;
51
+ })[];
52
+ readonly stream: true;
53
+ readonly tools?: readonly {
54
+ readonly type: "function";
55
+ readonly function: {
56
+ readonly name: string;
57
+ readonly description: string;
58
+ readonly parameters: {
59
+ readonly [x: string]: unknown;
60
+ };
61
+ };
62
+ }[] | undefined;
63
+ readonly tool_choice?: "required" | "none" | "auto" | {
64
+ readonly type: "function";
65
+ readonly function: {
66
+ readonly name: string;
67
+ };
68
+ } | undefined;
69
+ readonly stream_options?: {
70
+ readonly include_usage: boolean;
71
+ } | undefined;
72
+ readonly store?: boolean | undefined;
73
+ readonly reasoning_effort?: string | undefined;
74
+ readonly max_tokens?: number | undefined;
75
+ readonly temperature?: number | undefined;
76
+ readonly top_p?: number | undefined;
77
+ readonly frequency_penalty?: number | undefined;
78
+ readonly presence_penalty?: number | undefined;
79
+ readonly seed?: number | undefined;
80
+ readonly stop?: readonly string[] | undefined;
81
+ }, import("../route/transport/http").HttpPrepared<string>>[];
82
+ export declare const configure: (input?: Config) => {
83
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
84
+ model: (modelID: string | ModelID) => import("..").Model;
85
+ configure: (input?: Config) => /*elided*/ any;
86
+ };
87
+ export declare const provider: {
88
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
89
+ configure: (input?: Config) => {
90
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
91
+ model: (modelID: string | ModelID) => import("..").Model;
92
+ configure: /*elided*/ any;
93
+ };
94
+ };
95
+ export declare const model: ProviderPackage.Definition<Settings>["model"];
@@ -0,0 +1,50 @@
1
+ import { OpenAICompatibleChat } from "../protocols/openai-compatible-chat";
2
+ import { ProviderID } from "../schema";
3
+ import { GoogleVertexShared } from "./google-vertex-shared";
4
+ export const id = ProviderID.make("google-vertex");
5
+ const route = OpenAICompatibleChat.route.with({
6
+ id: "google-vertex-chat",
7
+ provider: id,
8
+ });
9
+ export const routes = [route];
10
+ const configuredRoute = (input) => {
11
+ if ("apiKey" in input && input.apiKey !== undefined)
12
+ throw new Error("Google Vertex Chat does not support API keys");
13
+ const { accessToken: _accessToken, auth: _auth, baseURL, location: inputLocation, project: inputProject, ...rest } = input;
14
+ const location = GoogleVertexShared.location(inputLocation, "global");
15
+ const project = GoogleVertexShared.project(inputProject);
16
+ return route.with({
17
+ ...rest,
18
+ endpoint: {
19
+ baseURL: baseURL ??
20
+ `https://aiplatform.googleapis.com/v1/projects/${GoogleVertexShared.requireProject(project)}/locations/${location}/endpoints/openapi`,
21
+ },
22
+ auth: GoogleVertexShared.oauth(input, project),
23
+ });
24
+ };
25
+ export const configure = (input = {}) => {
26
+ const route = configuredRoute(input);
27
+ return {
28
+ id,
29
+ model: (modelID) => route.model({ id: modelID }),
30
+ configure,
31
+ };
32
+ };
33
+ export const provider = {
34
+ id,
35
+ configure,
36
+ };
37
+ export const model = (modelID, settings) => {
38
+ if (settings.apiKey !== undefined)
39
+ throw new Error("Google Vertex Chat does not support API keys");
40
+ return configure({
41
+ accessToken: settings.accessToken,
42
+ baseURL: settings.baseURL,
43
+ headers: settings.headers === undefined ? undefined : { ...settings.headers },
44
+ http: settings.body === undefined ? undefined : { body: { ...settings.body } },
45
+ limits: settings.limits,
46
+ location: settings.location,
47
+ project: settings.project,
48
+ providerOptions: settings.providerOptions,
49
+ }).model(modelID);
50
+ };
@@ -0,0 +1,109 @@
1
+ import type { ProviderPackage } from "../provider-package";
2
+ import type { RouteDefaultsInput } from "../route/client";
3
+ import { type ModelID, type ProviderOptions } from "../schema";
4
+ import { GoogleVertexShared } from "./google-vertex-shared";
5
+ export declare const id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
6
+ export type Config = RouteDefaultsInput & GoogleVertexShared.OAuthOptions & {
7
+ readonly baseURL?: string;
8
+ readonly location?: string;
9
+ readonly project?: string;
10
+ };
11
+ export interface Settings extends ProviderPackage.Settings {
12
+ readonly accessToken?: string;
13
+ readonly apiKey?: never;
14
+ readonly baseURL?: string;
15
+ readonly location?: string;
16
+ readonly project?: string;
17
+ readonly providerOptions?: ProviderOptions;
18
+ }
19
+ export declare const routes: import("../route").Route<{
20
+ readonly stream: true;
21
+ readonly model: string;
22
+ readonly input: readonly ({
23
+ readonly role: "system";
24
+ readonly content: string;
25
+ } | {
26
+ readonly role: "user";
27
+ readonly content: readonly ({
28
+ readonly type: "input_text";
29
+ readonly text: string;
30
+ } | {
31
+ readonly type: "input_image";
32
+ readonly image_url: string;
33
+ })[];
34
+ } | {
35
+ readonly role: "assistant";
36
+ readonly content: readonly {
37
+ readonly type: "output_text";
38
+ readonly text: string;
39
+ }[];
40
+ } | {
41
+ readonly type: "reasoning";
42
+ readonly summary: readonly {
43
+ readonly type: "summary_text";
44
+ readonly text: string;
45
+ }[];
46
+ readonly id?: string | undefined;
47
+ readonly encrypted_content?: string | null | undefined;
48
+ } | {
49
+ readonly type: "item_reference";
50
+ readonly id: string;
51
+ } | {
52
+ readonly type: "function_call";
53
+ readonly call_id: string;
54
+ readonly name: string;
55
+ readonly arguments: string;
56
+ } | {
57
+ readonly type: "function_call_output";
58
+ readonly call_id: string;
59
+ readonly output: string | readonly ({
60
+ readonly type: "input_text";
61
+ readonly text: string;
62
+ } | {
63
+ readonly type: "input_image";
64
+ readonly image_url: string;
65
+ })[];
66
+ })[];
67
+ readonly instructions?: string | undefined;
68
+ readonly tools?: readonly {
69
+ readonly type: "function";
70
+ readonly name: string;
71
+ readonly description: string;
72
+ readonly parameters: {
73
+ readonly [x: string]: unknown;
74
+ };
75
+ readonly strict?: boolean | undefined;
76
+ }[] | undefined;
77
+ readonly tool_choice?: "required" | "none" | "auto" | {
78
+ readonly type: "function";
79
+ readonly name: string;
80
+ } | undefined;
81
+ readonly store?: boolean | undefined;
82
+ readonly service_tier?: "auto" | "default" | "flex" | "priority" | undefined;
83
+ readonly prompt_cache_key?: string | undefined;
84
+ readonly include?: readonly ("file_search_call.results" | "web_search_call.results" | "web_search_call.action.sources" | "message.input_image.image_url" | "computer_call_output.output.image_url" | "code_interpreter_call.outputs" | "reasoning.encrypted_content" | "message.output_text.logprobs")[] | undefined;
85
+ readonly reasoning?: {
86
+ readonly effort?: string | undefined;
87
+ readonly summary?: "auto" | undefined;
88
+ } | undefined;
89
+ readonly text?: {
90
+ readonly verbosity?: "low" | "medium" | "high" | undefined;
91
+ } | undefined;
92
+ readonly max_output_tokens?: number | undefined;
93
+ readonly temperature?: number | undefined;
94
+ readonly top_p?: number | undefined;
95
+ }, import("../route/transport/http").HttpPrepared<string>>[];
96
+ export declare const configure: (input?: Config) => {
97
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
98
+ model: (modelID: string | ModelID) => import("..").Model;
99
+ configure: (input?: Config) => /*elided*/ any;
100
+ };
101
+ export declare const provider: {
102
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
103
+ configure: (input?: Config) => {
104
+ id: string & import("effect/Brand").Brand<"LLM.ProviderID">;
105
+ model: (modelID: string | ModelID) => import("..").Model;
106
+ configure: /*elided*/ any;
107
+ };
108
+ };
109
+ export declare const model: ProviderPackage.Definition<Settings>["model"];
@@ -0,0 +1,50 @@
1
+ import { OpenAICompatibleResponses } from "../protocols/openai-compatible-responses";
2
+ import { ProviderID } from "../schema";
3
+ import { GoogleVertexShared } from "./google-vertex-shared";
4
+ export const id = ProviderID.make("google-vertex");
5
+ const route = OpenAICompatibleResponses.route.with({
6
+ id: "google-vertex-responses",
7
+ provider: id,
8
+ });
9
+ export const routes = [route];
10
+ const configuredRoute = (input) => {
11
+ if ("apiKey" in input && input.apiKey !== undefined)
12
+ throw new Error("Google Vertex Responses does not support API keys");
13
+ const { accessToken: _accessToken, auth: _auth, baseURL, location: inputLocation, project: inputProject, ...rest } = input;
14
+ const location = GoogleVertexShared.location(inputLocation, "global");
15
+ const project = GoogleVertexShared.project(inputProject);
16
+ return route.with({
17
+ ...rest,
18
+ endpoint: {
19
+ baseURL: baseURL ??
20
+ `https://aiplatform.googleapis.com/v1/projects/${GoogleVertexShared.requireProject(project)}/locations/${location}/endpoints/openapi`,
21
+ },
22
+ auth: GoogleVertexShared.oauth(input, project),
23
+ });
24
+ };
25
+ export const configure = (input = {}) => {
26
+ const route = configuredRoute(input);
27
+ return {
28
+ id,
29
+ model: (modelID) => route.model({ id: modelID }),
30
+ configure,
31
+ };
32
+ };
33
+ export const provider = {
34
+ id,
35
+ configure,
36
+ };
37
+ export const model = (modelID, settings) => {
38
+ if (settings.apiKey !== undefined)
39
+ throw new Error("Google Vertex Responses does not support API keys");
40
+ return configure({
41
+ accessToken: settings.accessToken,
42
+ baseURL: settings.baseURL,
43
+ headers: settings.headers === undefined ? undefined : { ...settings.headers },
44
+ http: settings.body === undefined ? undefined : { body: { ...settings.body } },
45
+ limits: settings.limits,
46
+ location: settings.location,
47
+ project: settings.project,
48
+ providerOptions: settings.providerOptions,
49
+ }).model(modelID);
50
+ };
@@ -7,7 +7,9 @@ export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare";
7
7
  export * as GitHubCopilot from "./github-copilot";
8
8
  export * as Google from "./google";
9
9
  export * as GoogleVertex from "./google-vertex";
10
+ export * as GoogleVertexChat from "./google-vertex-chat";
10
11
  export * as GoogleVertexMessages from "./google-vertex-messages";
12
+ export * as GoogleVertexResponses from "./google-vertex-responses";
11
13
  export * as OpenAI from "./openai";
12
14
  export * as OpenAICompatible from "./openai-compatible";
13
15
  export * as OpenAICompatibleResponses from "./openai-compatible-responses";
@@ -7,7 +7,9 @@ export { CloudflareAIGateway, CloudflareWorkersAI } from "./cloudflare";
7
7
  export * as GitHubCopilot from "./github-copilot";
8
8
  export * as Google from "./google";
9
9
  export * as GoogleVertex from "./google-vertex";
10
+ export * as GoogleVertexChat from "./google-vertex-chat";
10
11
  export * as GoogleVertexMessages from "./google-vertex-messages";
12
+ export * as GoogleVertexResponses from "./google-vertex-responses";
11
13
  export * as OpenAI from "./openai";
12
14
  export * as OpenAICompatible from "./openai-compatible";
13
15
  export * as OpenAICompatibleResponses from "./openai-compatible-responses";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-next-15646",
3
+ "version": "0.0.0-next-15648",
4
4
  "name": "@opencode-ai/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@clack/prompts": "1.0.0-alpha.1",
28
28
  "@effect/platform-node": "4.0.0-beta.83",
29
- "@opencode-ai/http-recorder": "0.0.0-next-15646",
29
+ "@opencode-ai/http-recorder": "0.0.0-next-15648",
30
30
  "@tsconfig/bun": "1.0.9",
31
31
  "@types/bun": "1.3.13",
32
32
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@smithy/eventstream-codec": "4.2.14",
37
37
  "@smithy/util-utf8": "4.2.2",
38
- "@opencode-ai/schema": "0.0.0-next-15646",
38
+ "@opencode-ai/schema": "0.0.0-next-15648",
39
39
  "aws4fetch": "1.0.20",
40
40
  "effect": "4.0.0-beta.83",
41
41
  "google-auth-library": "10.5.0"