clawmux 0.3.7 → 0.3.8
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/cli.cjs +30 -1
- package/dist/index.cjs +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -85,7 +85,7 @@ var import_node_child_process = require("node:child_process");
|
|
|
85
85
|
var import_node_os = require("node:os");
|
|
86
86
|
|
|
87
87
|
// src/proxy/router.ts
|
|
88
|
-
var VERSION = process.env.npm_package_version ?? "0.3.
|
|
88
|
+
var VERSION = process.env.npm_package_version ?? "0.3.8";
|
|
89
89
|
function jsonResponse(body, status = 200) {
|
|
90
90
|
return new Response(JSON.stringify(body), {
|
|
91
91
|
status,
|
|
@@ -4409,6 +4409,34 @@ async function update() {
|
|
|
4409
4409
|
process.exit(1);
|
|
4410
4410
|
}
|
|
4411
4411
|
}
|
|
4412
|
+
async function fixAgentModelsJson(homeDir, providerKey, correctBaseUrl) {
|
|
4413
|
+
const agentsDir = import_node_path5.join(homeDir, ".openclaw", "agents");
|
|
4414
|
+
let agentDirs;
|
|
4415
|
+
try {
|
|
4416
|
+
const entries = await import("node:fs/promises").then((m) => m.readdir(agentsDir, { withFileTypes: true }));
|
|
4417
|
+
agentDirs = entries.filter((d) => d.isDirectory()).map((d) => d.name);
|
|
4418
|
+
} catch {
|
|
4419
|
+
return;
|
|
4420
|
+
}
|
|
4421
|
+
for (const agentId of agentDirs) {
|
|
4422
|
+
const modelsPath = import_node_path5.join(agentsDir, agentId, "agent", "models.json");
|
|
4423
|
+
try {
|
|
4424
|
+
const raw = await import_promises6.readFile(modelsPath, "utf-8");
|
|
4425
|
+
const data = JSON.parse(raw);
|
|
4426
|
+
const agentProviders = data["providers"];
|
|
4427
|
+
if (!agentProviders?.[providerKey])
|
|
4428
|
+
continue;
|
|
4429
|
+
const entry = agentProviders[providerKey];
|
|
4430
|
+
const current = String(entry["baseUrl"] ?? "");
|
|
4431
|
+
if (current === correctBaseUrl)
|
|
4432
|
+
continue;
|
|
4433
|
+
entry["baseUrl"] = correctBaseUrl;
|
|
4434
|
+
await import_promises6.writeFile(modelsPath, JSON.stringify(data, null, 2) + `
|
|
4435
|
+
`);
|
|
4436
|
+
console.log(` fixed agent ${agentId} ${providerKey} baseUrl: ${current} → ${correctBaseUrl}`);
|
|
4437
|
+
} catch {}
|
|
4438
|
+
}
|
|
4439
|
+
}
|
|
4412
4440
|
async function init() {
|
|
4413
4441
|
const args = process.argv.slice(2);
|
|
4414
4442
|
const noService = args.includes("--no-service");
|
|
@@ -4484,6 +4512,7 @@ async function init() {
|
|
|
4484
4512
|
`);
|
|
4485
4513
|
console.log(` added ${PROVIDER_KEY} provider to openclaw.json (api=${providerApi})`);
|
|
4486
4514
|
}
|
|
4515
|
+
await fixAgentModelsJson(homeDir, PROVIDER_KEY, "http://localhost:3456");
|
|
4487
4516
|
const port = process.env.CLAWMUX_PORT ?? "3456";
|
|
4488
4517
|
if (!noService) {
|
|
4489
4518
|
console.log("");
|
package/dist/index.cjs
CHANGED
|
@@ -108,7 +108,7 @@ __export(exports_src, {
|
|
|
108
108
|
module.exports = __toCommonJS(exports_src);
|
|
109
109
|
|
|
110
110
|
// src/proxy/router.ts
|
|
111
|
-
var VERSION = process.env.npm_package_version ?? "0.3.
|
|
111
|
+
var VERSION = process.env.npm_package_version ?? "0.3.8";
|
|
112
112
|
function jsonResponse(body, status = 200) {
|
|
113
113
|
return new Response(JSON.stringify(body), {
|
|
114
114
|
status,
|