portable-agent-layer 0.86.0 → 0.86.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portable-agent-layer",
3
- "version": "0.86.0",
3
+ "version": "0.86.1",
4
4
  "description": "PAL — Portable Agent Layer: persistent personal context for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli/index.ts CHANGED
@@ -879,7 +879,8 @@ async function update() {
879
879
  clearUpdateCache();
880
880
 
881
881
  log.info("Reinstalling...");
882
- process.exit(await install(resolveTargets([]), []));
882
+ const { reinstallInFreshProcess } = await import("./reinstall");
883
+ process.exit(reinstallInFreshProcess());
883
884
  }
884
885
 
885
886
  function cliDebug(args: string[]) {
@@ -0,0 +1,13 @@
1
+ import { spawnSync } from "node:child_process";
2
+
3
+ /**
4
+ * An update replaces PAL's files under a process that already holds the old
5
+ * modules in Bun's cache, so a new installer importing a new export would bind
6
+ * against the stale module and throw. A fresh process loads everything from disk.
7
+ */
8
+ export function reinstallInFreshProcess(entry: string = process.argv[1]): number {
9
+ const run = spawnSync(process.execPath, [entry, "cli", "install"], {
10
+ stdio: "inherit",
11
+ });
12
+ return run.status ?? 1;
13
+ }