theclawbay 0.3.80 → 0.3.81

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.
@@ -1306,6 +1306,7 @@ async function promptForSetupClients(clients) {
1306
1306
  }
1307
1307
  };
1308
1308
  (0, node_readline_1.emitKeypressEvents)(stdin);
1309
+ stdin.resume();
1309
1310
  if (stdin.isTTY)
1310
1311
  stdin.setRawMode(true);
1311
1312
  stdout.write("\x1b[?25l");
@@ -1358,6 +1359,7 @@ async function promptForCodexConversationMigration() {
1358
1359
  }
1359
1360
  finally {
1360
1361
  rl.close();
1362
+ process.stdin.resume();
1361
1363
  }
1362
1364
  }
1363
1365
  async function resolveCodexConversationMigrationSelection(params) {
@@ -1387,6 +1389,7 @@ async function resolveDeviceLabel(params) {
1387
1389
  }
1388
1390
  finally {
1389
1391
  rl.close();
1392
+ process.stdin.resume();
1390
1393
  }
1391
1394
  }
1392
1395
  async function promptForGroupedModelSelection(params) {
@@ -1548,6 +1551,7 @@ async function promptForGroupedModelSelection(params) {
1548
1551
  resolvePromise = resolve;
1549
1552
  });
1550
1553
  (0, node_readline_1.emitKeypressEvents)(stdin);
1554
+ stdin.resume();
1551
1555
  if (stdin.isTTY)
1552
1556
  stdin.setRawMode(true);
1553
1557
  stdout.write("\x1b[?25l");
@@ -1630,6 +1634,7 @@ async function promptForPrimaryModel(models, defaultModel) {
1630
1634
  resolvePromise = resolve;
1631
1635
  });
1632
1636
  (0, node_readline_1.emitKeypressEvents)(stdin);
1637
+ stdin.resume();
1633
1638
  if (stdin.isTTY)
1634
1639
  stdin.setRawMode(true);
1635
1640
  stdout.write("\x1b[?25l");
@@ -2018,7 +2023,7 @@ function isOpenAiCompatibleSetupModelId(modelId) {
2018
2023
  const trimmed = modelId.trim();
2019
2024
  if (!trimmed)
2020
2025
  return false;
2021
- return !trimmed.startsWith("claude-");
2026
+ return !trimmed.startsWith("claude-") && SUPPORTED_MODEL_IDS.includes(trimmed);
2022
2027
  }
2023
2028
  function formatDotEnvValue(value) {
2024
2029
  return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
@@ -2101,7 +2106,7 @@ async function writeHermesConfig(params) {
2101
2106
  }
2102
2107
  async function resolveModels(backendUrl, apiKey) {
2103
2108
  const { ids, failure } = await fetchBackendModelIds(backendUrl, apiKey);
2104
- const filteredIds = (ids ?? []).filter(isOpenAiCompatibleSetupModelId);
2109
+ const filteredIds = uniqueStrings((ids ?? []).filter(isOpenAiCompatibleSetupModelId));
2105
2110
  const available = new Set(filteredIds);
2106
2111
  let selected = DEFAULT_CODEX_MODEL;
2107
2112
  let note;
@@ -2128,10 +2133,14 @@ async function resolveModels(backendUrl, apiKey) {
2128
2133
  unique.push(modelId);
2129
2134
  };
2130
2135
  pushUnique(selected);
2131
- for (const modelId of DEFAULT_MODELS)
2132
- pushUnique(modelId);
2133
- for (const modelId of filteredIds)
2134
- pushUnique(modelId);
2136
+ if (filteredIds.length > 0) {
2137
+ for (const modelId of filteredIds)
2138
+ pushUnique(modelId);
2139
+ }
2140
+ else {
2141
+ for (const modelId of DEFAULT_MODELS)
2142
+ pushUnique(modelId);
2143
+ }
2135
2144
  return {
2136
2145
  model: selected,
2137
2146
  models: unique.map((modelId) => ({ id: modelId, name: modelDisplayName(modelId) || prettyModelId(modelId) })),
@@ -3803,6 +3812,7 @@ class SetupCommand extends base_command_1.BaseCommand {
3803
3812
  this.log(` - ${modelId}${marker}`);
3804
3813
  }
3805
3814
  }
3815
+ return;
3806
3816
  }
3807
3817
  const claudeSelected = selectedSetupClients.has("claude");
3808
3818
  const claudeEnvEnabled = claudeSelected && claudeAccess.enabled;
@@ -30,6 +30,21 @@ function shellRcTargets() {
30
30
  kind: "file",
31
31
  }));
32
32
  }
33
+ function codexTargets() {
34
+ return [
35
+ ["codex-config", "Codex config", node_path_1.default.join(paths_1.codexDir, "config.toml"), "file"],
36
+ ["codex-auth", "Codex auth state", node_path_1.default.join(paths_1.codexDir, "auth.json"), "file"],
37
+ ["codex-credentials", "Codex credentials", node_path_1.default.join(paths_1.codexDir, ".credentials.json"), "file"],
38
+ ["codex-accounts", "Codex accounts directory", node_path_1.default.join(paths_1.codexDir, "accounts"), "directory"],
39
+ ["codex-managed", "Codex The Claw Bay managed state", node_path_1.default.join(paths_1.codexDir, "theclawbay.managed.json"), "file"],
40
+ ["codex-model-cache", "Codex model cache", node_path_1.default.join(paths_1.codexDir, "models_cache.json"), "file"],
41
+ ].map(([id, label, targetPath, kind]) => ({
42
+ id,
43
+ label,
44
+ targetPath,
45
+ kind: kind,
46
+ }));
47
+ }
33
48
  function editorSettingsTargets() {
34
49
  const home = node_os_1.default.homedir();
35
50
  const targets = [];
@@ -59,12 +74,6 @@ function backupTargets() {
59
74
  targetPath: paths_1.theclawbayConfigDir,
60
75
  kind: "directory",
61
76
  },
62
- {
63
- id: "codex-home",
64
- label: "Codex home directory",
65
- targetPath: paths_1.codexDir,
66
- kind: "directory",
67
- },
68
77
  {
69
78
  id: "continue-home",
70
79
  label: "Continue config directory",
@@ -127,7 +136,7 @@ function backupTargets() {
127
136
  },
128
137
  ];
129
138
  const deduped = new Map();
130
- for (const target of [...targets, ...shellRcTargets(), ...editorSettingsTargets()]) {
139
+ for (const target of [...targets, ...codexTargets(), ...shellRcTargets(), ...editorSettingsTargets()]) {
131
140
  deduped.set(target.targetPath, target);
132
141
  }
133
142
  return [...deduped.values()];
@@ -174,7 +183,13 @@ function formatBackupTimestamp(isoString) {
174
183
  }
175
184
  async function createBackup(reason) {
176
185
  const now = new Date();
177
- const id = backupIdFromDate(now);
186
+ const baseId = backupIdFromDate(now);
187
+ let id = baseId;
188
+ let suffix = 2;
189
+ while (await pathExists(node_path_1.default.join(paths_1.theclawbayBackupDir, id))) {
190
+ id = `${baseId}-${suffix}`;
191
+ suffix += 1;
192
+ }
178
193
  const backupDirectory = node_path_1.default.join(paths_1.theclawbayBackupDir, id);
179
194
  const snapshotRoot = node_path_1.default.join(backupDirectory, "files");
180
195
  await ensureCleanDirectory(snapshotRoot);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theclawbay",
3
- "version": "0.3.80",
3
+ "version": "0.3.81",
4
4
  "description": "CLI for connecting Codex, Hermes Agent, Gemini-compatible apps, 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": {