clawmux 0.2.0 → 0.2.2
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 +15 -11
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -317,7 +317,7 @@ function getLogDir() {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
// src/cli.ts
|
|
320
|
-
var VERSION2 = process.env.npm_package_version ?? "0.
|
|
320
|
+
var VERSION2 = process.env.npm_package_version ?? "0.2.2";
|
|
321
321
|
var SERVICE_NAME = "clawmux";
|
|
322
322
|
var HELP = `Usage: clawmux <command>
|
|
323
323
|
|
|
@@ -348,11 +348,23 @@ async function fileExistsLocal(path) {
|
|
|
348
348
|
return false;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
+
function detectPackageManager() {
|
|
352
|
+
try {
|
|
353
|
+
import_node_child_process.execSync("which bun", { stdio: "pipe" });
|
|
354
|
+
return "bunx";
|
|
355
|
+
} catch {
|
|
356
|
+
return "npx";
|
|
357
|
+
}
|
|
358
|
+
}
|
|
351
359
|
function resolveClawmuxBin() {
|
|
352
360
|
try {
|
|
353
|
-
|
|
361
|
+
const bin = import_node_child_process.execSync("which clawmux", { encoding: "utf-8" }).trim();
|
|
362
|
+
if (bin.includes("/tmp/") || bin.includes("bunx-") || bin.includes("npx-")) {
|
|
363
|
+
return detectPackageManager() === "bunx" ? "bunx clawmux" : "npx clawmux";
|
|
364
|
+
}
|
|
365
|
+
return bin;
|
|
354
366
|
} catch {
|
|
355
|
-
return "npx clawmux";
|
|
367
|
+
return detectPackageManager() === "bunx" ? "bunx clawmux" : "npx clawmux";
|
|
356
368
|
}
|
|
357
369
|
}
|
|
358
370
|
function getHomeDir() {
|
|
@@ -534,14 +546,6 @@ async function checkForUpdate() {
|
|
|
534
546
|
}
|
|
535
547
|
} catch (_) {}
|
|
536
548
|
}
|
|
537
|
-
function detectPackageManager() {
|
|
538
|
-
try {
|
|
539
|
-
import_node_child_process.execSync("which bun", { stdio: "pipe" });
|
|
540
|
-
return "bunx";
|
|
541
|
-
} catch {
|
|
542
|
-
return "npx";
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
549
|
async function update() {
|
|
546
550
|
const pm = detectPackageManager();
|
|
547
551
|
console.log(`[clawmux] Checking for updates...`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawmux",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Smart model routing + context compression proxy for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"start:node": "node --import tsx src/index.ts",
|
|
23
23
|
"test": "bun test",
|
|
24
24
|
"typecheck": "tsc --noEmit",
|
|
25
|
-
"build": "bun build src/cli.ts --outfile dist/cli.cjs --target node --format cjs --external @huggingface/transformers && bun build src/index.ts --outfile dist/index.cjs --target node --format cjs --external @huggingface/transformers",
|
|
25
|
+
"build": "bun build src/cli.ts --outfile dist/cli.cjs --target node --format cjs --external @huggingface/transformers && bun build src/index.ts --outfile dist/index.cjs --target node --format cjs --external @huggingface/transformers && node -e \"const fs=require('fs');const v=require('./package.json').version;for(const f of['dist/cli.cjs','dist/index.cjs']){fs.writeFileSync(f,fs.readFileSync(f,'utf-8').replace('__CLAWMUX_VERSION__',v))}\"",
|
|
26
26
|
"build:check": "node dist/cli.cjs version",
|
|
27
27
|
"prepublishOnly": "npm run typecheck && npm run build && npm run build:check"
|
|
28
28
|
},
|