theclawbay 0.3.68 → 0.3.69
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/dist/commands/setup.js
CHANGED
|
@@ -28,7 +28,9 @@ const DEFAULT_PROVIDER_ID = "theclawbay";
|
|
|
28
28
|
const CLI_HTTP_USER_AGENT = "theclawbay-cli";
|
|
29
29
|
const SUPPORTED_MODEL_IDS = (0, supported_models_1.getSupportedModelIds)();
|
|
30
30
|
const MODEL_DISPLAY_NAMES = (0, supported_models_1.getSupportedModelDisplayNames)();
|
|
31
|
-
const DEFAULT_CODEX_MODEL =
|
|
31
|
+
const DEFAULT_CODEX_MODEL = (["gpt-5.5", "gpt-5.4"].find((modelId) => SUPPORTED_MODEL_IDS.includes(modelId)) ??
|
|
32
|
+
SUPPORTED_MODEL_IDS[0] ??
|
|
33
|
+
"gpt-5.4");
|
|
32
34
|
const DEFAULT_CONTINUE_MODEL = DEFAULT_CODEX_MODEL;
|
|
33
35
|
const DEFAULT_CLINE_MODEL = DEFAULT_CODEX_MODEL;
|
|
34
36
|
const DEFAULT_OPENCLAW_MODEL = DEFAULT_CODEX_MODEL;
|
|
@@ -40,6 +40,16 @@ function readWindowsCommandStdout(command) {
|
|
|
40
40
|
const output = result.stdout.replace(/\r/g, "").trim();
|
|
41
41
|
return output || null;
|
|
42
42
|
}
|
|
43
|
+
function desktopClientsLikelyRunning() {
|
|
44
|
+
if (node_os_1.default.platform() === "win32" || isWslInteropRuntime()) {
|
|
45
|
+
const running = readWindowsCommandStdout("Get-Process Code,Codex -ErrorAction SilentlyContinue | Select-Object -ExpandProperty ProcessName");
|
|
46
|
+
return Boolean(running);
|
|
47
|
+
}
|
|
48
|
+
const result = (0, node_child_process_1.spawnSync)("sh", ["-lc", "pgrep -if '(^|/)(code|codex)$' >/dev/null"], {
|
|
49
|
+
stdio: "ignore",
|
|
50
|
+
});
|
|
51
|
+
return result.status === 0;
|
|
52
|
+
}
|
|
43
53
|
function resolveWindowsPathForHost(input) {
|
|
44
54
|
if (!input)
|
|
45
55
|
return null;
|
|
@@ -333,31 +343,18 @@ function buildStatsigPatchScript() {
|
|
|
333
343
|
" finally:",
|
|
334
344
|
" db.close()",
|
|
335
345
|
" print(json.dumps(result))",
|
|
336
|
-
].join("
|
|
346
|
+
].join("\n");
|
|
337
347
|
}
|
|
338
|
-
|
|
339
|
-
const
|
|
340
|
-
if (dbDirs.length === 0)
|
|
341
|
-
return { patched: 0, warnings: [] };
|
|
342
|
-
const python = await ensureLocalPythonWithLevelDbSupport();
|
|
343
|
-
if (!python) {
|
|
344
|
-
return {
|
|
345
|
-
patched: 0,
|
|
346
|
-
warnings: [
|
|
347
|
-
"Could not install the local desktop model-picker helper, so Codex app model labels may stay stale until the next supported cache refresh.",
|
|
348
|
-
],
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
const run = (0, node_child_process_1.spawnSync)(python.command, [...python.args, "-c", buildStatsigPatchScript(), JSON.stringify(DESKTOP_MODEL_IDS), ...dbDirs], {
|
|
348
|
+
function patchStatsigCache(python, dbDir) {
|
|
349
|
+
const run = (0, node_child_process_1.spawnSync)(python.command, [...python.args, "-c", buildStatsigPatchScript(), JSON.stringify(DESKTOP_MODEL_IDS), dbDir], {
|
|
352
350
|
encoding: "utf8",
|
|
353
351
|
stdio: ["ignore", "pipe", "pipe"],
|
|
354
352
|
});
|
|
355
353
|
if (run.status !== 0) {
|
|
354
|
+
const detail = (run.stderr || run.stdout || "").trim();
|
|
356
355
|
return {
|
|
357
356
|
patched: 0,
|
|
358
|
-
|
|
359
|
-
"Could not refresh the desktop model-picker cache. Close Codex app / VS Code and rerun setup if the picker still shows Custom.",
|
|
360
|
-
],
|
|
357
|
+
warning: detail ? `${dbDir}: ${detail}` : `${dbDir}: desktop cache helper exited with status ${run.status}`,
|
|
361
358
|
};
|
|
362
359
|
}
|
|
363
360
|
let patched = 0;
|
|
@@ -368,7 +365,7 @@ async function patchDesktopStatsigCaches() {
|
|
|
368
365
|
const parsed = JSON.parse(line);
|
|
369
366
|
patched += typeof parsed.patched === "number" ? parsed.patched : 0;
|
|
370
367
|
if (typeof parsed.error === "string" && parsed.error.trim()) {
|
|
371
|
-
const dbLabel = typeof parsed.db === "string" ? parsed.db :
|
|
368
|
+
const dbLabel = typeof parsed.db === "string" ? parsed.db : dbDir;
|
|
372
369
|
warnings.push(`${dbLabel}: ${parsed.error.trim()}`);
|
|
373
370
|
}
|
|
374
371
|
}
|
|
@@ -376,7 +373,45 @@ async function patchDesktopStatsigCaches() {
|
|
|
376
373
|
continue;
|
|
377
374
|
}
|
|
378
375
|
}
|
|
379
|
-
return { patched, warnings };
|
|
376
|
+
return { patched, warning: warnings.length > 0 ? warnings.join(" ") : undefined };
|
|
377
|
+
}
|
|
378
|
+
async function patchDesktopStatsigCaches() {
|
|
379
|
+
const dbDirs = await desktopStatsigLevelDbCandidates();
|
|
380
|
+
if (dbDirs.length === 0)
|
|
381
|
+
return { patched: 0, warnings: [] };
|
|
382
|
+
const python = await ensureLocalPythonWithLevelDbSupport();
|
|
383
|
+
if (!python) {
|
|
384
|
+
return {
|
|
385
|
+
patched: 0,
|
|
386
|
+
warnings: [
|
|
387
|
+
"Could not install the local desktop model-picker helper, so Codex app model labels may stay stale until the next supported cache refresh.",
|
|
388
|
+
],
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
let patched = 0;
|
|
392
|
+
const warnings = [];
|
|
393
|
+
for (const dbDir of dbDirs) {
|
|
394
|
+
const result = patchStatsigCache(python, dbDir);
|
|
395
|
+
patched += result.patched;
|
|
396
|
+
if (result.warning)
|
|
397
|
+
warnings.push(result.warning);
|
|
398
|
+
}
|
|
399
|
+
if (patched === 0 && warnings.length > 0) {
|
|
400
|
+
const prefix = desktopClientsLikelyRunning()
|
|
401
|
+
? "Could not refresh the desktop model-picker cache because VS Code or Codex app is still running."
|
|
402
|
+
: "Could not refresh the desktop model-picker cache.";
|
|
403
|
+
return {
|
|
404
|
+
patched,
|
|
405
|
+
warnings: [`${prefix} ${warnings.join(" ")}`],
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
if (patched > 0 && warnings.length > 0) {
|
|
409
|
+
const filteredWarnings = warnings.filter((warning) => !/does not exist|No such file/i.test(warning));
|
|
410
|
+
if (filteredWarnings.length > 0) {
|
|
411
|
+
return { patched, warnings: filteredWarnings };
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return { patched, warnings: [] };
|
|
380
415
|
}
|
|
381
416
|
async function ensureCodexDesktopModelPickerSupport() {
|
|
382
417
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theclawbay",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.69",
|
|
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": {
|