theclawbay 0.2.12 → 0.2.13

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/README.md CHANGED
@@ -32,7 +32,7 @@ theclawbay setup --api-key <apiKey>
32
32
  ```
33
33
 
34
34
  This auto-detects installed clients and writes direct WAN API-key config so users can run directly.
35
- It configures Codex with `model_provider = "codex-lb"` and a managed bearer token, auto-selects the highest backend-advertised model, and preserves conversation visibility by neutralizing legacy local session provider tags so chats remain visible across provider modes.
35
+ It configures Codex with `model_provider = "theclawbay"` and a managed bearer token, auto-selects the highest backend-advertised model, and preserves conversation visibility by neutralizing legacy local session provider tags so chats remain visible across provider modes.
36
36
 
37
37
  It also configures OpenClaw/OpenCode automatically when those CLIs are installed.
38
38
  OpenClaw/OpenCode provider configs are written with a literal API key (no env var dependency).
@@ -237,9 +237,9 @@ class ProxyCommand extends base_command_1.BaseCommand {
237
237
  });
238
238
  this.log("OpenClaw setup:");
239
239
  this.log("Run these once:");
240
- this.log('openclaw config set agents.defaults.model.primary "codex-lb/gpt-5.3-codex"');
240
+ this.log('openclaw config set agents.defaults.model.primary "theclawbay/gpt-5.3-codex"');
241
241
  this.log('openclaw config set models.mode "merge"');
242
- this.log(`openclaw config set models.providers.codex-lb '${openClawProviderJson}' --json`);
242
+ this.log(`openclaw config set models.providers.theclawbay '${openClawProviderJson}' --json`);
243
243
  this.log("");
244
244
  }
245
245
  if (targets.opencode) {
@@ -247,9 +247,9 @@ class ProxyCommand extends base_command_1.BaseCommand {
247
247
  this.log("Set in ~/.config/opencode/opencode.json:");
248
248
  this.log(JSON.stringify({
249
249
  provider: {
250
- "codex-lb": {
250
+ theclawbay: {
251
251
  npm: "@ai-sdk/openai-compatible",
252
- name: "codex-lb",
252
+ name: "theclawbay",
253
253
  options: {
254
254
  baseURL: `${localBase}/v1`,
255
255
  apiKey: "theclawbay-local",
@@ -259,7 +259,7 @@ class ProxyCommand extends base_command_1.BaseCommand {
259
259
  },
260
260
  },
261
261
  },
262
- model: "codex-lb/gpt-5.3-codex",
262
+ model: "theclawbay/gpt-5.3-codex",
263
263
  }, null, 2));
264
264
  this.log("");
265
265
  }
@@ -14,7 +14,8 @@ const api_key_1 = require("../lib/managed/api-key");
14
14
  const config_1 = require("../lib/managed/config");
15
15
  const errors_1 = require("../lib/managed/errors");
16
16
  const DEFAULT_BACKEND_URL = "https://theclawbay.com";
17
- const DEFAULT_PROVIDER_ID = "codex-lb";
17
+ const DEFAULT_PROVIDER_ID = "theclawbay";
18
+ const LEGACY_PROVIDER_ID = "codex-lb";
18
19
  const DEFAULT_CODEX_MODEL = "gpt-5.2-codex";
19
20
  const DEFAULT_OPENCLAW_MODEL = "gpt-5.3-codex";
20
21
  const DEFAULT_MODELS = ["gpt-5.3-codex", "gpt-5.3-codex-spark", "gpt-5.2-codex", "gpt-5.1-codex"];
@@ -41,8 +42,8 @@ const MANAGED_START = "# theclawbay-managed:start";
41
42
  const MANAGED_END = "# theclawbay-managed:end";
42
43
  const SHELL_START = "# theclawbay-shell-managed:start";
43
44
  const SHELL_END = "# theclawbay-shell-managed:end";
44
- const OPENCLAW_PROVIDER_ID = "codex-lb";
45
- const HISTORY_PROVIDER_NEUTRALIZE_SOURCES = new Set(["openai", "theclawbay-wan", "codex-lb"]);
45
+ const OPENCLAW_PROVIDER_ID = DEFAULT_PROVIDER_ID;
46
+ const HISTORY_PROVIDER_NEUTRALIZE_SOURCES = new Set(["openai", "theclawbay-wan", DEFAULT_PROVIDER_ID, LEGACY_PROVIDER_ID]);
46
47
  function trimTrailingSlash(value) {
47
48
  return value.replace(/\/+$/g, "");
48
49
  }
@@ -398,6 +399,7 @@ async function writeCodexConfig(params) {
398
399
  const proxyRoot = `${trimTrailingSlash(params.backendUrl)}/api/codex-auth/v1/proxy`;
399
400
  let next = existing;
400
401
  next = removeManagedBlock(next, MANAGED_START, MANAGED_END);
402
+ next = removeProviderTable(next, LEGACY_PROVIDER_ID);
401
403
  next = removeProviderTable(next, DEFAULT_PROVIDER_ID);
402
404
  next = upsertFirstKeyLine(next, "model_provider", `"${DEFAULT_PROVIDER_ID}"`);
403
405
  next = upsertFirstKeyLine(next, "model", `"${params.model}"`);
@@ -490,7 +492,8 @@ function isOpenClawMissingApiKeyEnvError(error) {
490
492
  if (!(error instanceof Error))
491
493
  return false;
492
494
  return (error.message.includes('Missing env var "CODEX_LB_API_KEY"') &&
493
- error.message.includes("models.providers.codex-lb.apiKey"));
495
+ (error.message.includes(`models.providers.${LEGACY_PROVIDER_ID}.apiKey`) ||
496
+ error.message.includes(`models.providers.${OPENCLAW_PROVIDER_ID}.apiKey`)));
494
497
  }
495
498
  function resolveOpenClawPrimaryModel(params) {
496
499
  const hasStableDefault = params.models.some((entry) => entry.id === DEFAULT_OPENCLAW_MODEL);
@@ -527,6 +530,9 @@ async function patchOpenClawConfigFile(params) {
527
530
  const modelsRoot = objectRecordOr(doc.models, {});
528
531
  modelsRoot.mode = "merge";
529
532
  const providersRoot = objectRecordOr(modelsRoot.providers, {});
533
+ if (LEGACY_PROVIDER_ID !== OPENCLAW_PROVIDER_ID && LEGACY_PROVIDER_ID in providersRoot) {
534
+ delete providersRoot[LEGACY_PROVIDER_ID];
535
+ }
530
536
  providersRoot[OPENCLAW_PROVIDER_ID] = provider;
531
537
  modelsRoot.providers = providersRoot;
532
538
  doc.models = modelsRoot;
@@ -613,6 +619,9 @@ async function writeOpenCodeConfig(params) {
613
619
  }
614
620
  }
615
621
  const providerRoot = objectRecordOr(doc.provider, {});
622
+ if (LEGACY_PROVIDER_ID !== DEFAULT_PROVIDER_ID && LEGACY_PROVIDER_ID in providerRoot) {
623
+ delete providerRoot[LEGACY_PROVIDER_ID];
624
+ }
616
625
  providerRoot[DEFAULT_PROVIDER_ID] = {
617
626
  npm: "@ai-sdk/openai-compatible",
618
627
  name: DEFAULT_PROVIDER_ID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theclawbay",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "The Claw Bay CLI: one-time API-key setup for direct Codex access, with optional relay fallback.",
5
5
  "license": "MIT",
6
6
  "bin": {