Skip to content

Commit 9c5941b

Browse files
committed
fix: add legacy daemon-cli shim for updates
1 parent 41d2993 commit 9c5941b

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Docs: https://docs.openclaw.ai
44

5+
## 2026.2.2-3
6+
7+
### Fixes
8+
9+
- Update: ship legacy daemon-cli shim for pre-tsdown update imports (fixes daemon restart after npm update).
10+
511
## 2026.2.2-2
612

713
### Fixes

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openclaw",
3-
"version": "2026.2.2-2",
3+
"version": "2026.2.2-3",
44
"description": "WhatsApp gateway CLI (Baileys web) with Pi RPC agent",
55
"keywords": [],
66
"license": "MIT",
@@ -32,7 +32,7 @@
3232
"android:install": "cd apps/android && ./gradlew :app:installDebug",
3333
"android:run": "cd apps/android && ./gradlew :app:installDebug && adb shell am start -n ai.openclaw.android/.MainActivity",
3434
"android:test": "cd apps/android && ./gradlew :app:testDebugUnitTest",
35-
"build": "pnpm canvas:a2ui:bundle && tsdown && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/write-build-info.ts",
35+
"build": "pnpm canvas:a2ui:bundle && tsdown && node --import tsx scripts/canvas-a2ui-copy.ts && node --import tsx scripts/copy-hook-metadata.ts && node --import tsx scripts/write-build-info.ts && node --import tsx scripts/write-cli-compat.ts",
3636
"canvas:a2ui:bundle": "bash scripts/bundle-a2ui.sh",
3737
"check": "pnpm tsgo && pnpm lint && pnpm format",
3838
"check:loc": "node --import tsx scripts/check-ts-max-loc.ts --max 500",

scripts/write-cli-compat.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import fs from "node:fs";
2+
import path from "node:path";
3+
import { fileURLToPath } from "node:url";
4+
5+
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
6+
const distDir = path.join(rootDir, "dist");
7+
const cliDir = path.join(distDir, "cli");
8+
9+
const candidates = fs
10+
.readdirSync(distDir)
11+
.filter((entry) => entry.startsWith("daemon-cli-") && entry.endsWith(".js"));
12+
13+
if (candidates.length === 0) {
14+
throw new Error("No daemon-cli bundle found in dist; cannot write legacy CLI shim.");
15+
}
16+
17+
const target = candidates.toSorted()[0];
18+
const relPath = `../${target}`;
19+
20+
const contents =
21+
"// Legacy shim for pre-tsdown update-cli imports.\n" +
22+
`export { registerDaemonCli, runDaemonInstall, runDaemonRestart, runDaemonStart, runDaemonStatus, runDaemonStop, runDaemonUninstall } from "${relPath}";\n`;
23+
24+
fs.mkdirSync(cliDir, { recursive: true });
25+
fs.writeFileSync(path.join(cliDir, "daemon-cli.js"), contents);

0 commit comments

Comments
 (0)