theclawbay 0.3.22 → 0.3.24

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.
@@ -13,22 +13,20 @@ const codex_model_cache_migration_1 = require("../lib/codex-model-cache-migratio
13
13
  const paths_1 = require("../lib/config/paths");
14
14
  const OPENAI_PROVIDER_ID = "openai";
15
15
  const DEFAULT_PROVIDER_ID = "theclawbay";
16
- const LEGACY_PROVIDER_ID = "codex-lb";
17
16
  const WAN_PROVIDER_ID = "theclawbay-wan";
18
17
  const MANAGED_START = "# theclawbay-managed:start";
19
18
  const MANAGED_END = "# theclawbay-managed:end";
20
19
  const SHELL_START = "# theclawbay-shell-managed:start";
21
20
  const SHELL_END = "# theclawbay-shell-managed:end";
22
21
  const ENV_FILE = node_path_1.default.join(node_os_1.default.homedir(), ".config", "theclawbay", "env");
23
- const ENV_KEY_NAME = "CODEX_LB_API_KEY";
22
+ const ENV_KEY_NAME = "THECLAWBAY_API_KEY";
24
23
  const MIGRATION_STATE_FILE = node_path_1.default.join(paths_1.codexDir, "theclawbay.migration.json");
25
24
  const HISTORY_PROVIDER_NEUTRALIZE_SOURCES = new Set([
26
25
  OPENAI_PROVIDER_ID,
27
26
  WAN_PROVIDER_ID,
28
27
  DEFAULT_PROVIDER_ID,
29
- LEGACY_PROVIDER_ID,
30
28
  ]);
31
- const HISTORY_PROVIDER_DB_MIGRATE_SOURCES = [DEFAULT_PROVIDER_ID, WAN_PROVIDER_ID, LEGACY_PROVIDER_ID];
29
+ const HISTORY_PROVIDER_DB_MIGRATE_SOURCES = [DEFAULT_PROVIDER_ID, WAN_PROVIDER_ID];
32
30
  const TRAE_PATCH_MARKER = "theclawbay-trae-patch";
33
31
  const TRAE_BUNDLE_BACKUP_SUFFIX = ".theclawbay-managed-backup";
34
32
  function removeManagedBlock(source, start, end) {
@@ -74,7 +72,7 @@ function removeTopLevelProviderSelection(source) {
74
72
  filtered.push(line);
75
73
  continue;
76
74
  }
77
- if (match[1] === DEFAULT_PROVIDER_ID || match[1] === LEGACY_PROVIDER_ID)
75
+ if (match[1] === DEFAULT_PROVIDER_ID)
78
76
  continue;
79
77
  filtered.push(line);
80
78
  }
@@ -135,7 +133,6 @@ async function cleanupCodexConfig() {
135
133
  let next = existing;
136
134
  next = removeManagedBlock(next, MANAGED_START, MANAGED_END);
137
135
  next = removeProviderTable(next, DEFAULT_PROVIDER_ID);
138
- next = removeProviderTable(next, LEGACY_PROVIDER_ID);
139
136
  next = removeTopLevelProviderSelection(next);
140
137
  return writeIfChanged(configPath, next, existing);
141
138
  }
@@ -181,7 +178,7 @@ async function cleanupOpenClawConfig() {
181
178
  let changed = false;
182
179
  const modelsRoot = objectRecordOr(doc.models, {});
183
180
  const providersRoot = objectRecordOr(modelsRoot.providers, {});
184
- for (const id of [DEFAULT_PROVIDER_ID, LEGACY_PROVIDER_ID]) {
181
+ for (const id of [DEFAULT_PROVIDER_ID]) {
185
182
  if (id in providersRoot) {
186
183
  delete providersRoot[id];
187
184
  changed = true;
@@ -193,8 +190,7 @@ async function cleanupOpenClawConfig() {
193
190
  const defaultsRoot = objectRecordOr(agentsRoot.defaults, {});
194
191
  const modelRoot = objectRecordOr(defaultsRoot.model, {});
195
192
  const primary = modelRoot.primary;
196
- if (typeof primary === "string" &&
197
- (primary.startsWith(`${DEFAULT_PROVIDER_ID}/`) || primary.startsWith(`${LEGACY_PROVIDER_ID}/`))) {
193
+ if (typeof primary === "string" && primary.startsWith(`${DEFAULT_PROVIDER_ID}/`)) {
198
194
  delete modelRoot.primary;
199
195
  changed = true;
200
196
  }
@@ -220,7 +216,7 @@ async function cleanupOpenCodeConfig() {
220
216
  }
221
217
  let changed = false;
222
218
  const providerRoot = objectRecordOr(doc.provider, {});
223
- for (const id of [DEFAULT_PROVIDER_ID, LEGACY_PROVIDER_ID]) {
219
+ for (const id of [DEFAULT_PROVIDER_ID]) {
224
220
  if (id in providerRoot) {
225
221
  delete providerRoot[id];
226
222
  changed = true;
@@ -228,8 +224,7 @@ async function cleanupOpenCodeConfig() {
228
224
  }
229
225
  doc.provider = providerRoot;
230
226
  const model = doc.model;
231
- if (typeof model === "string" &&
232
- (model.startsWith(`${DEFAULT_PROVIDER_ID}/`) || model.startsWith(`${LEGACY_PROVIDER_ID}/`))) {
227
+ if (typeof model === "string" && model.startsWith(`${DEFAULT_PROVIDER_ID}/`)) {
233
228
  delete doc.model;
234
229
  changed = true;
235
230
  }
@@ -252,7 +247,7 @@ async function cleanupKiloConfig() {
252
247
  }
253
248
  let changed = false;
254
249
  const providerRoot = objectRecordOr(doc.provider, {});
255
- for (const id of [DEFAULT_PROVIDER_ID, LEGACY_PROVIDER_ID]) {
250
+ for (const id of [DEFAULT_PROVIDER_ID]) {
256
251
  if (id in providerRoot) {
257
252
  delete providerRoot[id];
258
253
  changed = true;
@@ -260,8 +255,7 @@ async function cleanupKiloConfig() {
260
255
  }
261
256
  doc.provider = providerRoot;
262
257
  const model = doc.model;
263
- if (typeof model === "string" &&
264
- (model.startsWith(`${DEFAULT_PROVIDER_ID}/`) || model.startsWith(`${LEGACY_PROVIDER_ID}/`))) {
258
+ if (typeof model === "string" && model.startsWith(`${DEFAULT_PROVIDER_ID}/`)) {
265
259
  delete doc.model;
266
260
  changed = true;
267
261
  }
@@ -20,7 +20,6 @@ const config_1 = require("../lib/managed/config");
20
20
  const errors_1 = require("../lib/managed/errors");
21
21
  const DEFAULT_BACKEND_URL = "https://theclawbay.com";
22
22
  const DEFAULT_PROVIDER_ID = "theclawbay";
23
- const LEGACY_PROVIDER_ID = "codex-lb";
24
23
  const CLI_HTTP_USER_AGENT = "theclawbay-cli";
25
24
  const DEFAULT_CODEX_MODEL = "gpt-5.4";
26
25
  const DEFAULT_OPENCLAW_MODEL = "gpt-5.4";
@@ -29,37 +28,28 @@ const DEFAULT_TRAE_MODEL = "gpt-5.4";
29
28
  const DEFAULT_MODELS = [
30
29
  "gpt-5.4",
31
30
  "gpt-5.3-codex",
32
- "gpt-5.3-codex-spark",
33
31
  "gpt-5.2-codex",
34
32
  "gpt-5.2",
35
33
  "gpt-5.1-codex-max",
36
34
  "gpt-5.1-codex-mini",
37
- "gpt-5.1-codex",
38
- "gpt-5.1",
39
35
  ];
40
36
  const PREFERRED_MODELS = [
41
37
  "gpt-5.4",
42
- "gpt-5.4-codex",
43
38
  "gpt-5.3-codex",
44
- "gpt-5.3-codex-spark",
45
39
  "gpt-5.2-codex",
40
+ "gpt-5.2",
46
41
  "gpt-5.1-codex-max",
47
42
  "gpt-5.1-codex-mini",
48
- "gpt-5.1-codex",
49
43
  ];
50
44
  const MODEL_DISPLAY_NAMES = {
51
45
  "gpt-5.4": "GPT-5.4",
52
- "gpt-5.4-codex": "GPT-5.4",
53
46
  "gpt-5.3-codex": "GPT-5.3 Codex",
54
- "gpt-5.3-codex-spark": "GPT-5.3 Codex Spark",
55
47
  "gpt-5.2-codex": "GPT-5.2 Codex",
56
48
  "gpt-5.2": "GPT-5.2",
57
49
  "gpt-5.1-codex-max": "GPT-5.1 Codex Max",
58
50
  "gpt-5.1-codex-mini": "GPT-5.1 Codex Mini",
59
- "gpt-5.1-codex": "GPT-5.1 Codex",
60
- "gpt-5.1": "GPT-5.1",
61
51
  };
62
- const ENV_KEY_NAME = "CODEX_LB_API_KEY";
52
+ const ENV_KEY_NAME = "THECLAWBAY_API_KEY";
63
53
  const ENV_FILE = node_path_1.default.join(node_os_1.default.homedir(), ".config", "theclawbay", "env");
64
54
  const MIGRATION_STATE_FILE = node_path_1.default.join(paths_1.codexDir, "theclawbay.migration.json");
65
55
  const MANAGED_START = "# theclawbay-managed:start";
@@ -67,8 +57,8 @@ const MANAGED_END = "# theclawbay-managed:end";
67
57
  const SHELL_START = "# theclawbay-shell-managed:start";
68
58
  const SHELL_END = "# theclawbay-shell-managed:end";
69
59
  const OPENCLAW_PROVIDER_ID = DEFAULT_PROVIDER_ID;
70
- const HISTORY_PROVIDER_NEUTRALIZE_SOURCES = new Set(["openai", "theclawbay-wan", DEFAULT_PROVIDER_ID, LEGACY_PROVIDER_ID]);
71
- const HISTORY_PROVIDER_DB_MIGRATE_SOURCES = ["openai", "theclawbay-wan", LEGACY_PROVIDER_ID];
60
+ const HISTORY_PROVIDER_NEUTRALIZE_SOURCES = new Set(["openai", "theclawbay-wan", DEFAULT_PROVIDER_ID]);
61
+ const HISTORY_PROVIDER_DB_MIGRATE_SOURCES = ["openai", "theclawbay-wan"];
72
62
  const OPTIONAL_SETUP_CLIENT_IDS = ["openclaw", "opencode", "kilo", "trae"];
73
63
  const TRAE_PATCH_MARKER = "theclawbay-trae-patch";
74
64
  const TRAE_BUNDLE_BACKUP_SUFFIX = ".theclawbay-managed-backup";
@@ -428,7 +418,6 @@ async function writeCodexConfig(params) {
428
418
  const proxyRoot = `${trimTrailingSlash(params.backendUrl)}/api/codex-auth/v1/proxy`;
429
419
  let next = existing;
430
420
  next = removeManagedBlock(next, MANAGED_START, MANAGED_END);
431
- next = removeProviderTable(next, LEGACY_PROVIDER_ID);
432
421
  next = removeProviderTable(next, DEFAULT_PROVIDER_ID);
433
422
  next = upsertFirstKeyLine(next, "model_provider", `"${DEFAULT_PROVIDER_ID}"`);
434
423
  next = upsertFirstKeyLine(next, "model", `"${params.model}"`);
@@ -520,9 +509,8 @@ function runOpenClawConfigCommand(args) {
520
509
  function isOpenClawMissingApiKeyEnvError(error) {
521
510
  if (!(error instanceof Error))
522
511
  return false;
523
- return (error.message.includes('Missing env var "CODEX_LB_API_KEY"') &&
524
- (error.message.includes(`models.providers.${LEGACY_PROVIDER_ID}.apiKey`) ||
525
- error.message.includes(`models.providers.${OPENCLAW_PROVIDER_ID}.apiKey`)));
512
+ return (error.message.includes(`Missing env var "${ENV_KEY_NAME}"`) &&
513
+ error.message.includes(`models.providers.${OPENCLAW_PROVIDER_ID}.apiKey`));
526
514
  }
527
515
  function resolveOpenClawPrimaryModel(params) {
528
516
  const hasStableDefault = params.models.some((entry) => entry.id === DEFAULT_OPENCLAW_MODEL);
@@ -559,9 +547,6 @@ async function patchOpenClawConfigFile(params) {
559
547
  const modelsRoot = objectRecordOr(doc.models, {});
560
548
  modelsRoot.mode = "merge";
561
549
  const providersRoot = objectRecordOr(modelsRoot.providers, {});
562
- if (LEGACY_PROVIDER_ID !== OPENCLAW_PROVIDER_ID && LEGACY_PROVIDER_ID in providersRoot) {
563
- delete providersRoot[LEGACY_PROVIDER_ID];
564
- }
565
550
  providersRoot[OPENCLAW_PROVIDER_ID] = provider;
566
551
  modelsRoot.providers = providersRoot;
567
552
  doc.models = modelsRoot;
@@ -616,9 +601,6 @@ async function writeOpenCodeConfig(params) {
616
601
  }
617
602
  }
618
603
  const providerRoot = objectRecordOr(doc.provider, {});
619
- if (LEGACY_PROVIDER_ID !== DEFAULT_PROVIDER_ID && LEGACY_PROVIDER_ID in providerRoot) {
620
- delete providerRoot[LEGACY_PROVIDER_ID];
621
- }
622
604
  providerRoot[DEFAULT_PROVIDER_ID] = {
623
605
  npm: "@ai-sdk/openai-compatible",
624
606
  name: DEFAULT_PROVIDER_ID,
@@ -655,9 +637,6 @@ async function writeKiloConfig(params) {
655
637
  }
656
638
  }
657
639
  const providerRoot = objectRecordOr(doc.provider, {});
658
- if (LEGACY_PROVIDER_ID !== DEFAULT_PROVIDER_ID && LEGACY_PROVIDER_ID in providerRoot) {
659
- delete providerRoot[LEGACY_PROVIDER_ID];
660
- }
661
640
  providerRoot[DEFAULT_PROVIDER_ID] = {
662
641
  npm: "@ai-sdk/openai-compatible",
663
642
  name: DEFAULT_PROVIDER_ID,
@@ -940,7 +919,7 @@ class SetupCommand extends base_command_1.BaseCommand {
940
919
  else {
941
920
  this.log("- Codex login state: no change.");
942
921
  }
943
- this.log("Next: restart terminal/VS Code window only if you rely on CODEX_LB_API_KEY in your own scripts.");
922
+ this.log("Next: restart terminal/VS Code window only if you rely on the The Claw Bay API key in your own scripts.");
944
923
  });
945
924
  }
946
925
  }
@@ -18,11 +18,10 @@ const SEED_MARKER_KEY = "_theclawbay_seeded";
18
18
  const SEED_MARKER_VALUE = "gpt-5.4";
19
19
  const TEMPLATE_MODEL_IDS = [
20
20
  "gpt-5.3-codex",
21
- "gpt-5.3-codex-spark",
22
21
  "gpt-5.2-codex",
22
+ "gpt-5.2",
23
23
  "gpt-5.1-codex-max",
24
24
  "gpt-5.1-codex-mini",
25
- "gpt-5.1-codex",
26
25
  ];
27
26
  const DEFAULT_REASONING_LEVELS = [
28
27
  { effort: "low", description: "Fast responses with lighter reasoning" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theclawbay",
3
- "version": "0.3.22",
3
+ "version": "0.3.24",
4
4
  "description": "CLI for connecting Codex, OpenClaw, OpenCode, Kilo, and experimental Trae to The Claw Bay.",
5
5
  "license": "MIT",
6
6
  "bin": {