@hienlh/ppm 0.13.17 → 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,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.13.19] - 2026-04-25
4
+
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
7
+ - **Windows path traversal rejection**: File tree lazy-loading and zip downloads failed on Windows hosts — `assertWithinProject` hardcoded `/` separator instead of `path.sep`
8
+ - **Upload response backslash paths**: Upload endpoint returned `input\file.jpg` on Windows instead of `input/file.jpg`, breaking frontend path matching
9
+
3
10
  ## [0.13.17] - 2026-04-25
4
11
 
5
12
  ### Fixed
@@ -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.17 at build time. Re-run `ppm export skill --install` to refresh. -->
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.17 -->
204
+ <!-- Generated from src/server/routes/ for PPM v0.13.19 -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.13.17",
3
+ "version": "0.13.19",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "author": "hienlh",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import { resolve, basename } from "node:path";
2
+ import { resolve, basename, sep } from "node:path";
3
3
  import { existsSync, statSync } from "node:fs";
4
4
  import archiver from "archiver";
5
5
  import { createDownloadToken } from "../../services/download-token.service.ts";
@@ -24,7 +24,7 @@ downloadRoutes.get("/zip", async (c) => {
24
24
  if (!dirPath) return c.json(err("Missing query parameter: path"), 400);
25
25
 
26
26
  const absPath = resolve(projectPath, dirPath);
27
- if (!absPath.startsWith(projectPath + "/") && absPath !== projectPath) {
27
+ if (!absPath.startsWith(projectPath + sep) && absPath !== projectPath) {
28
28
  return c.json(err("Access denied"), 403);
29
29
  }
30
30
  if (!existsSync(absPath)) return c.json(err("Directory not found"), 404);
@@ -164,7 +164,7 @@ fileRoutes.post("/upload", async (c) => {
164
164
  const absPath = resolve(absTargetDir, safeName);
165
165
  if (!absPath.startsWith(projectPath)) return c.json(err("Access denied"), 403);
166
166
  await Bun.write(absPath, file);
167
- uploaded.push({ name: safeName, path: absPath.slice(projectPath.length + 1), size: file.size });
167
+ uploaded.push({ name: safeName, path: absPath.slice(projectPath.length + 1).split("\\").join("/"), size: file.size });
168
168
  }
169
169
 
170
170
  return c.json(ok({ uploaded }), 201);
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { existsSync, readdirSync, readFileSync } from "node:fs";
9
- import { resolve, relative, join } from "node:path";
9
+ import { resolve, relative, join, sep } from "node:path";
10
10
  import ignore, { type Ignore } from "ignore";
11
11
  import type { FileEntry, FileDirEntry } from "../types/project.ts";
12
12
  import { matchesGlob, resolveFilter } from "./file-filter.service.ts";
@@ -50,7 +50,7 @@ function loadGitignore(projectPath: string): Ignore {
50
50
 
51
51
  function assertWithinProject(relPath: string, projectPath: string): void {
52
52
  const abs = resolve(projectPath, relPath);
53
- if (!abs.startsWith(projectPath + "/") && abs !== projectPath) {
53
+ if (!abs.startsWith(projectPath + sep) && abs !== projectPath) {
54
54
  throw new SecurityError("Path traversal not allowed");
55
55
  }
56
56
  }
@@ -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
- /** Send SIGUSR1 to supervisor to trigger self-replace after upgrade */
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
- process.kill(pid, "SIGUSR1");
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 };