theclawbay 0.3.84 → 0.3.87
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 +27 -6
- package/package.json +1 -1
package/dist/commands/setup.js
CHANGED
|
@@ -2580,7 +2580,9 @@ function powerShellProfilePaths() {
|
|
|
2580
2580
|
const addDocumentsProfiles = (documentsDir) => {
|
|
2581
2581
|
if (!documentsDir)
|
|
2582
2582
|
return;
|
|
2583
|
+
candidates.add(node_path_1.default.join(documentsDir, "PowerShell", "profile.ps1"));
|
|
2583
2584
|
candidates.add(node_path_1.default.join(documentsDir, "PowerShell", "Microsoft.PowerShell_profile.ps1"));
|
|
2585
|
+
candidates.add(node_path_1.default.join(documentsDir, "WindowsPowerShell", "profile.ps1"));
|
|
2584
2586
|
candidates.add(node_path_1.default.join(documentsDir, "WindowsPowerShell", "Microsoft.PowerShell_profile.ps1"));
|
|
2585
2587
|
};
|
|
2586
2588
|
if (node_os_1.default.platform() === "win32") {
|
|
@@ -3225,6 +3227,14 @@ function buildOpenCodeModelsObject(models) {
|
|
|
3225
3227
|
}
|
|
3226
3228
|
return result;
|
|
3227
3229
|
}
|
|
3230
|
+
function buildClaudeModelSelections(modelIds) {
|
|
3231
|
+
return uniqueStrings(modelIds)
|
|
3232
|
+
.filter(Boolean)
|
|
3233
|
+
.map((modelId) => ({
|
|
3234
|
+
id: modelId,
|
|
3235
|
+
name: prettyModelId(modelId),
|
|
3236
|
+
}));
|
|
3237
|
+
}
|
|
3228
3238
|
function normalizeOpenCodeRestoreSnapshot(snapshot, fallbackConfigPath) {
|
|
3229
3239
|
if (typeof snapshot !== "object" || snapshot === null || Array.isArray(snapshot))
|
|
3230
3240
|
return null;
|
|
@@ -3353,13 +3363,17 @@ function resolveKiloConfigTargets() {
|
|
|
3353
3363
|
node_path_1.default.join(xdgConfigHomeDir(), "kilo");
|
|
3354
3364
|
return uniqueStrings([node_path_1.default.join(primaryDir, "opencode.json")]);
|
|
3355
3365
|
}
|
|
3356
|
-
function isManagedOpenCodeProvider(provider) {
|
|
3366
|
+
function isManagedOpenCodeProvider(provider, backendUrl) {
|
|
3357
3367
|
const options = objectRecordOr(provider.options, {});
|
|
3358
|
-
|
|
3368
|
+
if (isTheClawBayOpenAiCompatibleBaseUrl(options.baseURL))
|
|
3369
|
+
return true;
|
|
3370
|
+
return typeof options.baseURL === "string" && trimTrailingSlash(options.baseURL) === openAiCompatibleProxyUrl(backendUrl);
|
|
3359
3371
|
}
|
|
3360
|
-
function isManagedOpenCodeAnthropicProvider(provider) {
|
|
3372
|
+
function isManagedOpenCodeAnthropicProvider(provider, backendUrl) {
|
|
3361
3373
|
const options = objectRecordOr(provider.options, {});
|
|
3362
|
-
|
|
3374
|
+
if (isTheClawBayAnthropicCompatibleBaseUrl(options.baseURL))
|
|
3375
|
+
return true;
|
|
3376
|
+
return typeof options.baseURL === "string" && trimTrailingSlash(options.baseURL) === anthropicCompatibleProxyV1Url(backendUrl);
|
|
3363
3377
|
}
|
|
3364
3378
|
function isManagedOpenCodeModel(value, supportedModelIds) {
|
|
3365
3379
|
if (typeof value !== "string")
|
|
@@ -3413,7 +3427,7 @@ async function writeOpenCodeFamilyConfig(params) {
|
|
|
3413
3427
|
const providerRoot = objectRecordOr(doc.provider, {});
|
|
3414
3428
|
const openAiProvider = objectRecordOr(providerRoot[OPENAI_PROVIDER_ID], {});
|
|
3415
3429
|
const anthropicProvider = objectRecordOr(providerRoot[ANTHROPIC_PROVIDER_ID], {});
|
|
3416
|
-
const alreadyManaged = isManagedOpenCodeProvider(openAiProvider) && isManagedOpenCodeModel(doc.model, supportedModelIds);
|
|
3430
|
+
const alreadyManaged = isManagedOpenCodeProvider(openAiProvider, params.backendUrl) && isManagedOpenCodeModel(doc.model, supportedModelIds);
|
|
3417
3431
|
if (!alreadyManaged && !restoreHasTarget(configPath)) {
|
|
3418
3432
|
restoreState.targets.push({
|
|
3419
3433
|
configPath,
|
|
@@ -3448,17 +3462,23 @@ async function writeOpenCodeFamilyConfig(params) {
|
|
|
3448
3462
|
}
|
|
3449
3463
|
providerRoot[OPENAI_PROVIDER_ID] = managedOpenAiProvider;
|
|
3450
3464
|
if ((params.claudeModels?.length ?? 0) > 0) {
|
|
3465
|
+
const claudeSelections = buildClaudeModelSelections(params.claudeModels ?? []);
|
|
3451
3466
|
const managedAnthropicProvider = objectRecordOr(providerRoot[ANTHROPIC_PROVIDER_ID], {});
|
|
3452
3467
|
const anthropicOptions = objectRecordOr(managedAnthropicProvider.options, {});
|
|
3453
3468
|
anthropicOptions.baseURL = anthropicCompatibleProxyV1Url(params.backendUrl);
|
|
3454
3469
|
anthropicOptions.apiKey = params.apiKey;
|
|
3470
|
+
anthropicOptions.setCacheKey = true;
|
|
3455
3471
|
managedAnthropicProvider.options = anthropicOptions;
|
|
3456
|
-
managedAnthropicProvider.
|
|
3472
|
+
managedAnthropicProvider.models = buildOpenCodeModelsObject(claudeSelections);
|
|
3473
|
+
managedAnthropicProvider.whitelist = claudeSelections.map((entry) => entry.id);
|
|
3457
3474
|
if ("blacklist" in managedAnthropicProvider) {
|
|
3458
3475
|
delete managedAnthropicProvider.blacklist;
|
|
3459
3476
|
}
|
|
3460
3477
|
providerRoot[ANTHROPIC_PROVIDER_ID] = managedAnthropicProvider;
|
|
3461
3478
|
}
|
|
3479
|
+
else if (isManagedOpenCodeAnthropicProvider(anthropicProvider, params.backendUrl)) {
|
|
3480
|
+
delete providerRoot[ANTHROPIC_PROVIDER_ID];
|
|
3481
|
+
}
|
|
3462
3482
|
if (DEFAULT_PROVIDER_ID in providerRoot) {
|
|
3463
3483
|
delete providerRoot[DEFAULT_PROVIDER_ID];
|
|
3464
3484
|
}
|
|
@@ -3994,6 +4014,7 @@ class SetupCommand extends base_command_1.BaseCommand {
|
|
|
3994
4014
|
backendUrl,
|
|
3995
4015
|
model: resolved?.model ?? DEFAULT_CODEX_MODEL,
|
|
3996
4016
|
models: resolved?.models ?? [{ id: DEFAULT_CODEX_MODEL, name: modelDisplayName(DEFAULT_CODEX_MODEL) }],
|
|
4017
|
+
claudeModels: claudeAccess?.enabled ? (claudeAccess.selectedModels ?? claudeAccess.models) : [],
|
|
3997
4018
|
apiKey: authCredential,
|
|
3998
4019
|
});
|
|
3999
4020
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theclawbay",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.87",
|
|
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": {
|