@koreanhole/opencodex 3.2.17 → 3.2.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koreanhole/opencodex",
3
- "version": "3.2.17",
3
+ "version": "3.2.19",
4
4
  "description": "Full opencodex runtime with Cline 2.2.0+ JSON and Gemini CLI headless provider adapters",
5
5
  "type": "module",
6
6
  "main": "./bin/package-main.mjs",
@@ -33,6 +33,7 @@
33
33
  "test:e2e:cline-live": "bun test ./tests/e2e/cline-live.live.ts",
34
34
  "test:e2e:gemini": "bun test ./tests/e2e/gemini-codex.live.ts -t \"full-stack:\"",
35
35
  "test:e2e:gemini-oauth-only": "bun test ./tests/e2e/gemini-oauth-only.test.ts",
36
+ "test:e2e:gemini-oauth-codeassist": "bun test ./tests/e2e/gemini-oauth-codeassist.live.ts",
36
37
  "test:e2e:gemini-auth-selection": "bun test ./tests/e2e/gemini-oauth-only.test.ts -t \"honors vendor-selected API-key\"",
37
38
  "test:e2e:gemini-oauth-keychain": "bun test ./tests/e2e/gemini-oauth-only.test.ts -t \"passes keyring access\"",
38
39
  "test:e2e:gemini-slow": "bun test ./tests/e2e/gemini-codex.live.ts -t \"full-stack: a slow Gemini start\"",
@@ -48,6 +48,7 @@ const FORWARDED_ENV_KEYS = [
48
48
  "GOOGLE_CLOUD_LOCATION",
49
49
  "GOOGLE_APPLICATION_CREDENTIALS",
50
50
  "GOOGLE_GEMINI_BASE_URL",
51
+ "CODE_ASSIST_ENDPOINT",
51
52
  "DBUS_SESSION_BUS_ADDRESS",
52
53
  "XDG_RUNTIME_DIR",
53
54
  "GEMINI_FORCE_ENCRYPTED_FILE_STORAGE",
@@ -93,6 +94,15 @@ function enabled(value: unknown): boolean {
93
94
  return nonEmpty(value)?.toLowerCase() === "true";
94
95
  }
95
96
 
97
+ function isHttpEndpoint(value: string): boolean {
98
+ try {
99
+ const url = new URL(value);
100
+ return url.protocol === "http:" || url.protocol === "https:";
101
+ } catch {
102
+ return false;
103
+ }
104
+ }
105
+
96
106
  function asRecord(value: unknown): Record<string, unknown> | undefined {
97
107
  return value && typeof value === "object" && !Array.isArray(value)
98
108
  ? value as Record<string, unknown>
@@ -177,9 +187,20 @@ export function buildGeminiHeadlessEnv(
177
187
  env.USERPROFILE = realHome;
178
188
  for (const key of FORWARDED_ENV_KEYS) {
179
189
  const value = nonEmpty(sourceEnv[key]);
180
- if (value) env[key] = value;
190
+ if (!value) continue;
191
+ if (key === "CODE_ASSIST_ENDPOINT" && !isHttpEndpoint(value)) continue;
192
+ env[key] = value;
193
+ }
194
+ if (geminiHeadlessAuth(sourceEnv) === "oauth") {
195
+ env.GOOGLE_GENAI_USE_GCA = "true";
196
+ if (env.GEMINI_FORCE_ENCRYPTED_FILE_STORAGE === undefined) {
197
+ env.GEMINI_FORCE_ENCRYPTED_FILE_STORAGE = "true";
198
+ }
199
+ const oauthPath = join(geminiVendorHome(sourceEnv), ".gemini", "oauth_creds.json");
200
+ if (!env.GOOGLE_APPLICATION_CREDENTIALS && existsSync(oauthPath)) {
201
+ env.GOOGLE_APPLICATION_CREDENTIALS = resolve(oauthPath);
202
+ }
181
203
  }
182
- if (geminiHeadlessAuth(sourceEnv) === "oauth") env.GOOGLE_GENAI_USE_GCA = "true";
183
204
  Object.assign(env, {
184
205
  GEMINI_CLI_TRUST_WORKSPACE: "true",
185
206
  GEMINI_CLI_NO_RELAUNCH: "1",