@opencode/ai 0.0.0-dev-20753 → 0.0.0-dev-20758
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.
|
@@ -17,6 +17,9 @@ export declare const project: (value?: string) => string | undefined;
|
|
|
17
17
|
export declare const location: (value: string | undefined, fallback: string) => string;
|
|
18
18
|
export declare const host: (location: string) => string;
|
|
19
19
|
export declare const requireProject: (value: string | undefined) => string;
|
|
20
|
-
export declare const apiKey: (input: ApiKeyOptions
|
|
20
|
+
export declare const apiKey: (input: ApiKeyOptions & {
|
|
21
|
+
readonly project?: string;
|
|
22
|
+
readonly location?: string;
|
|
23
|
+
}) => string | undefined;
|
|
21
24
|
export declare const oauth: (input: OAuthOptions, project?: string) => Auth.Definition;
|
|
22
25
|
export * as GoogleVertexShared from "./google-vertex-shared.js";
|
|
@@ -37,7 +37,13 @@ export const apiKey = (input) => {
|
|
|
37
37
|
});
|
|
38
38
|
if (input.accessToken !== undefined || input.auth !== undefined)
|
|
39
39
|
return undefined;
|
|
40
|
-
|
|
40
|
+
if (input.apiKey !== undefined)
|
|
41
|
+
return input.apiKey;
|
|
42
|
+
// Same precedence as Google's Gen AI SDK: an explicit project or location selects Google credentials,
|
|
43
|
+
// so an ambient API key cannot replace them.
|
|
44
|
+
if (input.project !== undefined || input.location !== undefined)
|
|
45
|
+
return undefined;
|
|
46
|
+
return process.env.GOOGLE_VERTEX_API_KEY;
|
|
41
47
|
};
|
|
42
48
|
const adc = (project) => {
|
|
43
49
|
let client;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20758",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
36
36
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
37
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
37
|
+
"@opencode/http-recorder": "0.0.0-dev-20758",
|
|
38
38
|
"@tsconfig/bun": "1.0.9",
|
|
39
39
|
"@types/bun": "1.4.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
45
45
|
"@smithy/eventstream-codec": "4.2.14",
|
|
46
46
|
"@smithy/util-utf8": "4.2.2",
|
|
47
|
-
"@opencode/schema": "0.0.0-dev-
|
|
47
|
+
"@opencode/schema": "0.0.0-dev-20758",
|
|
48
48
|
"aws4fetch": "1.0.20",
|
|
49
49
|
"effect": "4.0.0-rc.112",
|
|
50
50
|
"google-auth-library": "10.5.0"
|