@koreanhole/opencodex 3.2.33 → 3.2.34

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.33",
3
+ "version": "3.2.34",
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",
@@ -209,7 +209,8 @@ export function resolveClineProviderSettingsPath(env: Record<string, string | un
209
209
  if (dataDir) return join(dataDir, "settings", "providers.json");
210
210
  const clineDir = nonEmpty(env.CLINE_DIR);
211
211
  if (clineDir) return join(clineDir, "data", "settings", "providers.json");
212
- return join(homedir(), ".cline", "data", "settings", "providers.json");
212
+ const home = nonEmpty(env.HOME) ?? nonEmpty(env.USERPROFILE) ?? homedir();
213
+ return join(home, ".cline", "data", "settings", "providers.json");
213
214
  }
214
215
 
215
216
  function isLoopbackUrl(value: string): boolean {
@@ -418,6 +419,8 @@ async function linkClineSettings(input: {
418
419
  configDir: string;
419
420
  homeDir: string;
420
421
  providerSettingsPath?: string;
422
+ legacyGlobalStatePath?: string;
423
+ legacySecretsPath?: string;
421
424
  globalSettingsPath: string;
422
425
  mcpSettingsPath: string;
423
426
  }): Promise<void> {
@@ -434,6 +437,15 @@ async function linkClineSettings(input: {
434
437
  await linkClineFile(input.globalSettingsPath, join(target.dir, "global-settings.json"));
435
438
  await linkClineFile(input.mcpSettingsPath, join(target.dir, "cline_mcp_settings.json"));
436
439
  }
440
+ const legacyDirs = [input.dataDir, join(input.homeDir, ".cline", "data")];
441
+ for (const dir of legacyDirs) {
442
+ if (input.legacyGlobalStatePath) {
443
+ await linkClineFile(input.legacyGlobalStatePath, join(dir, "globalState.json"));
444
+ }
445
+ if (input.legacySecretsPath) {
446
+ await linkClineFile(input.legacySecretsPath, join(dir, "secrets.json"));
447
+ }
448
+ }
437
449
  }
438
450
 
439
451
  /** Stage all Cline paths the proxy controls; the vendor provider store remains the auth source. */
@@ -457,7 +469,16 @@ export async function stageClineTurn(options: {
457
469
  const providerSettingsPath = join(homeDir, ".cline", "data", "settings", "providers.json");
458
470
  const catalogPath = join(root, "tool-catalog.json");
459
471
 
460
- const recreatedPaths = [configDir, homeDir, hooksDir, logDir, join(dataDir, "settings"), catalogPath];
472
+ const recreatedPaths = [
473
+ configDir,
474
+ homeDir,
475
+ hooksDir,
476
+ logDir,
477
+ join(dataDir, "settings"),
478
+ join(dataDir, "globalState.json"),
479
+ join(dataDir, "secrets.json"),
480
+ catalogPath,
481
+ ];
461
482
  const perTurnPaths = [...recreatedPaths, join(root, "prompt.txt")];
462
483
  const cleanup = async (): Promise<void> => {
463
484
  const targets = persistent ? perTurnPaths : [root];
@@ -493,6 +514,8 @@ export async function stageClineTurn(options: {
493
514
  configDir,
494
515
  homeDir,
495
516
  ...(copiedProviderStore ? { providerSettingsPath } : {}),
517
+ legacyGlobalStatePath: legacyState.globalStatePath,
518
+ ...(legacyState.secretsPath ? { legacySecretsPath: legacyState.secretsPath } : {}),
496
519
  globalSettingsPath,
497
520
  mcpSettingsPath,
498
521
  });
@@ -552,11 +575,23 @@ export async function mergeClineDisabledTools(
552
575
  }
553
576
 
554
577
  export function buildClineChildEnv(staged: ClineStagedTurn, sourceEnv: NodeJS.ProcessEnv = process.env): Record<string, string> {
555
- const env = baseScopedEnv();
556
- env.HOME = staged.homeDir;
557
- env.USERPROFILE = staged.homeDir;
558
- env.XDG_CONFIG_HOME = join(staged.homeDir, ".config");
559
- env.XDG_CACHE_HOME = join(staged.homeDir, ".cache");
578
+ const env = baseScopedEnv(sourceEnv);
579
+ const realHome = nonEmpty(sourceEnv.HOME) ?? nonEmpty(sourceEnv.USERPROFILE) ?? homedir();
580
+ if (realHome) {
581
+ env.HOME = realHome;
582
+ env.USERPROFILE = realHome;
583
+ }
584
+ for (const key of [
585
+ "XDG_CONFIG_HOME",
586
+ "XDG_CACHE_HOME",
587
+ "XDG_DATA_HOME",
588
+ "XDG_RUNTIME_DIR",
589
+ "DBUS_SESSION_BUS_ADDRESS",
590
+ "GNOME_KEYRING_CONTROL",
591
+ ]) {
592
+ const value = nonEmpty(sourceEnv[key]);
593
+ if (value) env[key] = value;
594
+ }
560
595
  const user = sourceEnv.USER ?? sourceEnv.LOGNAME;
561
596
  if (user) env.USER = user;
562
597
  if (sourceEnv.LOGNAME) env.LOGNAME = sourceEnv.LOGNAME;
@@ -79,7 +79,7 @@ function safeMessage(value: unknown): string {
79
79
  }
80
80
 
81
81
  function classifyError(message: string): { status: number; errorType: string; code: string; retryable: boolean } {
82
- if (/not logged in|please (?:run )?\/?login|sign in|authentication (?:failed|required)|unauthorized|invalid (?:api )?key/i.test(message)) {
82
+ if (/not logged in|please (?:run )?\/?login|sign in|authentication (?:failed|required)|unauthorized|invalid (?:api )?key|interactive auth|auth setup/i.test(message)) {
83
83
  return { status: 401, errorType: "authentication_error", code: "cline_cli_not_logged_in", retryable: false };
84
84
  }
85
85
  if (/rate limit|too many requests|quota|credit|usage limit|daily limit/i.test(message)) {