theclawbay 0.3.82 → 0.3.84

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.
@@ -723,6 +723,27 @@ function runInstallPlan(plan) {
723
723
  function modelDisplayName(modelId) {
724
724
  return MODEL_DISPLAY_NAMES[modelId] ?? prettyModelId(modelId);
725
725
  }
726
+ function normalizeClaudeCatalogModelId(modelId) {
727
+ const trimmed = modelId.trim();
728
+ if (!trimmed.startsWith("claude-"))
729
+ return trimmed;
730
+ return trimmed
731
+ .replace(/\./g, "-")
732
+ .replace(/-+/g, "-")
733
+ .replace(/-(20\d{6})$/, "");
734
+ }
735
+ function dedupeClaudeCatalogModelIds(modelIds) {
736
+ const seen = new Set();
737
+ const deduped = [];
738
+ for (const modelId of modelIds) {
739
+ const normalized = normalizeClaudeCatalogModelId(modelId);
740
+ if (!normalized || seen.has(normalized))
741
+ continue;
742
+ seen.add(normalized);
743
+ deduped.push(normalized);
744
+ }
745
+ return deduped;
746
+ }
726
747
  function supportedModelProviderMap() {
727
748
  return new Map((0, supported_models_1.getSupportedModels)().map((model) => [model.id, model.provider]));
728
749
  }
@@ -1764,9 +1785,9 @@ async function fetchBackendModelIds(backendUrl, apiKey) {
1764
1785
  };
1765
1786
  }
1766
1787
  const body = (await response.json());
1767
- const ids = (body.data ?? [])
1788
+ const ids = dedupeClaudeCatalogModelIds((body.data ?? [])
1768
1789
  .map((entry) => (typeof entry.id === "string" ? entry.id.trim() : ""))
1769
- .filter((id) => id.length > 0);
1790
+ .filter((id) => id.length > 0));
1770
1791
  if (!ids.length) {
1771
1792
  return {
1772
1793
  ids: null,
@@ -14,6 +14,13 @@ const paths_1 = require("./config/paths");
14
14
  const BROWSER_SETUP_TIMEOUT_MS = 15 * 60000;
15
15
  const BROWSER_SETUP_POLL_INTERVAL_MS = 2000;
16
16
  const INSTALL_ID_PATH = node_path_1.default.join(paths_1.theclawbayConfigDir, "install-id");
17
+ const DEFAULT_SETUP_SITE_URL = "https://theclawbay.com";
18
+ function setupSiteBaseUrl() {
19
+ const override = process.env.THECLAWBAY_SETUP_SITE_URL?.trim();
20
+ if (override)
21
+ return override;
22
+ return DEFAULT_SETUP_SITE_URL;
23
+ }
17
24
  function preferredBrowserCallbackPort() {
18
25
  const parsed = Number(process.env.THECLAWBAY_CALLBACK_PORT?.trim() || "");
19
26
  if (Number.isFinite(parsed) && parsed > 0 && parsed < 65536) {
@@ -155,7 +162,7 @@ async function createLocalCallbackServer(expectedState) {
155
162
  };
156
163
  }
157
164
  async function exchangeBrowserSetupSession(params) {
158
- const exchangeResponse = await fetch(`${params.backendUrl}/api/setup/device-session/exchange`, {
165
+ const exchangeResponse = await fetch(`${params.setupSiteUrl}/api/setup/device-session/exchange`, {
159
166
  method: "POST",
160
167
  headers: { "Content-Type": "application/json" },
161
168
  body: JSON.stringify({
@@ -268,7 +275,8 @@ async function createBrowserLinkedDeviceSession(params) {
268
275
  let exchangeInFlight = null;
269
276
  try {
270
277
  const installId = await getOrCreateInstallId();
271
- const startResponse = await fetch(`${params.backendUrl}/api/setup/device-session/start`, {
278
+ const setupSiteUrl = setupSiteBaseUrl();
279
+ const startResponse = await fetch(`${setupSiteUrl}/api/setup/device-session/start`, {
272
280
  method: "POST",
273
281
  headers: { "Content-Type": "application/json" },
274
282
  body: JSON.stringify({
@@ -296,7 +304,7 @@ async function createBrowserLinkedDeviceSession(params) {
296
304
  if (exchangeInFlight)
297
305
  return exchangeInFlight;
298
306
  const promise = exchangeBrowserSetupSession({
299
- backendUrl: params.backendUrl,
307
+ setupSiteUrl,
300
308
  sessionId: setupSessionId,
301
309
  state,
302
310
  code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theclawbay",
3
- "version": "0.3.82",
3
+ "version": "0.3.84",
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": {