theclawbay 0.3.70 → 0.3.71

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.
@@ -26,6 +26,7 @@ const SEED_MARKER_KEY = "_theclawbay_seeded";
26
26
  const SEED_MARKER_VALUE = "theclawbay";
27
27
  const LEGACY_SEED_MARKER_VALUES = new Set([...TRACKED_MODEL_ID_SET, SEED_MARKER_VALUE, true]);
28
28
  const SEEDED_CACHE_FRESHNESS_ISO = "2099-12-31T23:59:59.000Z";
29
+ const MINIMUM_CATALOG_CLIENT_VERSION = "0.124.0";
29
30
  function objectRecordOr(value) {
30
31
  if (typeof value === "object" && value !== null && !Array.isArray(value)) {
31
32
  return value;
@@ -381,6 +382,51 @@ async function inferCodexClientVersionsFromInstalledExtensions() {
381
382
  }
382
383
  return [...versions];
383
384
  }
385
+ function desktopAppCodexBinaryCandidates() {
386
+ const candidates = [];
387
+ const home = node_os_1.default.homedir();
388
+ if (node_os_1.default.platform() === "darwin") {
389
+ for (const appRoot of [
390
+ "/Applications/Codex.app",
391
+ "/Applications/OpenAI Codex.app",
392
+ node_path_1.default.join(home, "Applications", "Codex.app"),
393
+ node_path_1.default.join(home, "Applications", "OpenAI Codex.app"),
394
+ ]) {
395
+ candidates.push(node_path_1.default.join(appRoot, "Contents", "Resources", "codex"), node_path_1.default.join(appRoot, "Contents", "Resources", "app", "resources", "codex"));
396
+ }
397
+ }
398
+ if (node_os_1.default.platform() === "win32" || isWslInteropRuntime()) {
399
+ const installLocations = readWindowsCommandStdout("Get-AppxPackage OpenAI.Codex | ForEach-Object { $_.InstallLocation }");
400
+ if (installLocations) {
401
+ for (const installLocation of installLocations.split("\n")) {
402
+ const hostPath = resolveWindowsPathForHost(installLocation);
403
+ if (!hostPath)
404
+ continue;
405
+ candidates.push(node_path_1.default.join(hostPath, "app", "resources", "codex.exe"));
406
+ }
407
+ }
408
+ }
409
+ return uniqueStrings(candidates);
410
+ }
411
+ async function inferCodexClientVersionsFromInstalledDesktopApps() {
412
+ const versions = new Set();
413
+ for (const candidate of desktopAppCodexBinaryCandidates()) {
414
+ if (!(await pathExists(candidate)))
415
+ continue;
416
+ const parsed = runVersionCommand(candidate, ["--version"]);
417
+ versions.add(parsed ?? MINIMUM_CATALOG_CLIENT_VERSION);
418
+ }
419
+ return [...versions];
420
+ }
421
+ function preferredPickerCacheClientVersion(pickerVersions) {
422
+ const compatible = pickerVersions.some((version) => compareCodexVersions(version, MINIMUM_CATALOG_CLIENT_VERSION) >= 0);
423
+ if (!compatible)
424
+ return null;
425
+ // The shared models_cache.json is accepted by newer picker builds when stamped
426
+ // with the oldest model-catalog version, but older app builds reject a cache
427
+ // stamped with a newer VS Code/CLI version.
428
+ return MINIMUM_CATALOG_CLIENT_VERSION;
429
+ }
384
430
  async function inferCodexClientVersionFromVersionJson(codexHome) {
385
431
  const parsed = await readJsonIfExists(node_path_1.default.join(codexHome, "version.json"));
386
432
  const obj = objectRecordOr(parsed);
@@ -494,7 +540,13 @@ async function inferCodexClientVersion(codexHome) {
494
540
  versions.push(parsed);
495
541
  }
496
542
  }
497
- versions.push(...await inferCodexClientVersionsFromInstalledExtensions());
543
+ const pickerVersions = [
544
+ ...await inferCodexClientVersionsFromInstalledDesktopApps(),
545
+ ...await inferCodexClientVersionsFromInstalledExtensions(),
546
+ ];
547
+ const pickerCacheClientVersion = preferredPickerCacheClientVersion(pickerVersions);
548
+ if (pickerCacheClientVersion)
549
+ return pickerCacheClientVersion;
498
550
  const versionJsonVersion = await inferCodexClientVersionFromVersionJson(codexHome);
499
551
  if (versionJsonVersion)
500
552
  versions.push(versionJsonVersion);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theclawbay",
3
- "version": "0.3.70",
3
+ "version": "0.3.71",
4
4
  "description": "CLI for connecting Codex, Continue, Cline, GSD, OpenClaw, OpenCode, Kilo, Roo Code, Aider, experimental Trae, and experimental Zo to The Claw Bay.",
5
5
  "license": "MIT",
6
6
  "repository": {