@hienlh/ppm 0.13.18 → 0.13.19
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/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.13.
|
|
3
|
+
## [0.13.19] - 2026-04-25
|
|
4
4
|
|
|
5
5
|
### Fixed
|
|
6
|
+
- **Windows upgrade no auto-restart**: `ppm upgrade` on Windows upgraded files but didn't restart the server — SIGUSR1 doesn't exist on Windows. Now writes command file that supervisor polls every 1s
|
|
6
7
|
- **Windows path traversal rejection**: File tree lazy-loading and zip downloads failed on Windows hosts — `assertWithinProject` hardcoded `/` separator instead of `path.sep`
|
|
7
8
|
- **Upload response backslash paths**: Upload endpoint returned `input\file.jpg` on Windows instead of `input/file.jpg`, breaking frontend path matching
|
|
8
9
|
|
|
@@ -71,4 +71,4 @@ This skill covers the `ppm` CLI, its HTTP API, and its config DB. It does **not*
|
|
|
71
71
|
- Third-party extensions (inspect via `ppm ext list`).
|
|
72
72
|
- The Claude Agent SDK internals (separate skill).
|
|
73
73
|
|
|
74
|
-
<!-- Generated for PPM v0.13.
|
|
74
|
+
<!-- Generated for PPM v0.13.19 at build time. Re-run `ppm export skill --install` to refresh. -->
|
|
@@ -201,4 +201,4 @@ _Base URL: `http://localhost:8080` (default; override via `ppm config set port <
|
|
|
201
201
|
- `ws://<host>/ws/terminal` — PTY terminal multiplexer
|
|
202
202
|
- `ws://<host>/ws/extensions` — extension host channel
|
|
203
203
|
|
|
204
|
-
<!-- Generated from src/server/routes/ for PPM v0.13.
|
|
204
|
+
<!-- Generated from src/server/routes/ for PPM v0.13.19 -->
|
package/package.json
CHANGED
|
@@ -940,6 +940,16 @@ export async function runSupervisor(opts: {
|
|
|
940
940
|
else if (cmd.action === "resume") {
|
|
941
941
|
if (getState() === "stopped" || getState() === "paused") triggerResume();
|
|
942
942
|
}
|
|
943
|
+
else if (cmd.action === "upgrade") {
|
|
944
|
+
log("INFO", "Windows command: upgrade, starting self-replace");
|
|
945
|
+
selfReplace().then((result) => {
|
|
946
|
+
if (!result.success) {
|
|
947
|
+
log("ERROR", `Self-replace failed: ${result.error}, restarting children`);
|
|
948
|
+
spawnServer(serverArgs, logFd);
|
|
949
|
+
if (opts.share && !tunnelChild && !tunnelUrl) spawnTunnel(opts.port);
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
}
|
|
943
953
|
}, 1000);
|
|
944
954
|
}
|
|
945
955
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* detects install method, runs install command.
|
|
4
4
|
*/
|
|
5
5
|
import { resolve } from "node:path";
|
|
6
|
-
import { readFileSync } from "node:fs";
|
|
6
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { VERSION } from "../version.ts";
|
|
8
8
|
import { isCompiledBinary } from "./autostart-generator.ts";
|
|
9
9
|
import { getPpmDir } from "./ppm-dir.ts";
|
|
@@ -99,14 +99,21 @@ export async function applyUpgrade(): Promise<{
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
/**
|
|
102
|
+
/** Signal supervisor to trigger self-replace after upgrade.
|
|
103
|
+
* Unix: SIGUSR1. Windows: command file (supervisor polls every 1s). */
|
|
103
104
|
export function signalSupervisorUpgrade(): { sent: boolean; error?: string } {
|
|
104
105
|
try {
|
|
105
106
|
const data = JSON.parse(readFileSync(resolve(getPpmDir(), "status.json"), "utf-8"));
|
|
106
107
|
const pid = data.supervisorPid;
|
|
107
108
|
if (!pid) return { sent: false, error: "No supervisor PID" };
|
|
108
109
|
process.kill(pid, 0); // check alive
|
|
109
|
-
|
|
110
|
+
|
|
111
|
+
if (process.platform === "win32") {
|
|
112
|
+
const cmdFile = resolve(getPpmDir(), ".supervisor-cmd");
|
|
113
|
+
writeFileSync(cmdFile, JSON.stringify({ action: "upgrade" }));
|
|
114
|
+
} else {
|
|
115
|
+
process.kill(pid, "SIGUSR1");
|
|
116
|
+
}
|
|
110
117
|
return { sent: true };
|
|
111
118
|
} catch (e) {
|
|
112
119
|
return { sent: false, error: (e as Error).message };
|