pi-better-harness 0.63.0 → 0.63.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.63.2] - 2026-11-30
4
+
5
+ ### Fixed
6
+
7
+ - Update the shared server, Subagents, and Background Tasks together. Extension updates can complete while a previous server upgrade waits for active work.
8
+
9
+ ## [0.63.1] - 2026-11-30
10
+
11
+ ### Fixed
12
+
13
+ - Install Goal 0.18.4 in both install modes. A plain Goal can inspect and finish its existing checklist while another workflow owns planning.
14
+ - Uninstall removes the components registered in the selected scope, including on older installations that predate the shared Server package.
15
+
3
16
  ## [0.63.0] - 2026-11-30
4
17
 
5
18
  ### Changed
@@ -495,7 +495,9 @@ export default function taskContextExtension(pi: ExtensionAPI): void {
495
495
  if (!currentPlan || !outcome?.goalId) return null;
496
496
  const entries = ctx.sessionManager.getBranch();
497
497
  const goal = reconstructGoalSnapshot(entries);
498
- if (goal?.goalId !== outcome.goalId || goal.status !== "active" || goal.command?.source !== "skill") return null;
498
+ if (goal?.goalId !== outcome.goalId || goal.status !== "active") return null;
499
+ if (!goal.command) return currentPlan;
500
+ if (goal.command.source !== "skill") return null;
499
501
  const owner = currentWorkflowOwner(entries);
500
502
  const binding = goal.workflowBinding === undefined ? currentWorkflowOwner(entries, goal.goalId) : goal.workflowBinding;
501
503
  return owner && binding?.name === owner.name && binding.path === owner.path ? currentPlan : null;
package/lib/cli.mjs CHANGED
@@ -2,7 +2,7 @@ import { spawnSync } from "node:child_process";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { dirname, resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { configureHarnessResources, defaultAgentDir, preflightHarnessInstall } from "./install-settings.mjs";
5
+ import { configureHarnessResources, defaultAgentDir, preflightHarnessInstall, registeredHarnessPackages } from "./install-settings.mjs";
6
6
  import { activeRevision } from "./prompt-revisions.mjs";
7
7
  import { manageInstructions } from "./instructions.mjs";
8
8
  import { webUiDisabledMessage, webUiEnabled } from "./web-ui-flag.mjs";
@@ -24,7 +24,8 @@ export const componentPackages = [
24
24
  ];
25
25
 
26
26
  // Pi saves the install spec. Resolve the server and its clients as a tested set.
27
- const runtimeVersions = {
27
+ const installVersions = {
28
+ "pi-better-goal": dependencies["pi-better-goal"],
28
29
  [HARNESS_PACKAGE]: version,
29
30
  "pi-better-server": dependencies["pi-better-server"],
30
31
  "pi-better-subagents": dependencies["pi-better-subagents"],
@@ -115,8 +116,17 @@ export function run(argv, options = {}) {
115
116
 
116
117
  const piCommand = process.platform === "win32" ? "pi.cmd" : "pi";
117
118
  const piAction = command === "install" ? "install" : "remove";
118
- for (const packageName of [...componentPackages, HARNESS_PACKAGE]) {
119
- const pin = runtimeVersions[packageName];
119
+ let packages = [...componentPackages, HARNESS_PACKAGE];
120
+ if (command === "uninstall") {
121
+ try {
122
+ packages = registeredHarnessPackages(local, packages, options.settings);
123
+ } catch (error) {
124
+ stderr.write(`Could not read the selected Pi registrations: ${error.message}\n`);
125
+ return 1;
126
+ }
127
+ }
128
+ for (const packageName of packages) {
129
+ const pin = installVersions[packageName];
120
130
  const source = command === "install" && pin ? `npm:${packageName}@${pin}` : `npm:${packageName}`;
121
131
  const args = [piAction, source, ...scopeArgs(local)];
122
132
  const result = spawn(piCommand, args, { stdio: "inherit" });
@@ -126,6 +126,11 @@ export function acquire(path) {
126
126
  throw new Error(`Cannot lock Pi settings at ${path}`);
127
127
  }
128
128
 
129
+ export function registeredHarnessPackages(local, names, options = {}) {
130
+ const packages = readSettings(settingsPath(local, options), { allowMissing: true })?.packages ?? [];
131
+ return names.filter(name => packages.some(entry => matchesPackage(entry, name)));
132
+ }
133
+
129
134
  // Read-only validation used before the installer asks Pi to touch settings.
130
135
  // Returns whether the selected scope already has a Harness registration so the
131
136
  // caller knows whether a failed filter write introduced an unfiltered one.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-background-tasks",
3
- "version": "0.21.9",
3
+ "version": "0.21.11",
4
4
  "description": "Pi extension for durable background shell tasks, watchers, logs, and status inspection.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -68,7 +68,7 @@
68
68
  "vitest": "^3.0.0"
69
69
  },
70
70
  "dependencies": {
71
- "pi-better-server": "0.11.0",
71
+ "pi-better-server": "0.11.2",
72
72
  "proper-lockfile": "^4.1.2"
73
73
  }
74
74
  }
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"cc56bc92eab4db783ddbe1a98e926b4ad5436f2f87defe697dd25dd6899844bb"},"sha256":"bd139ea6f47ef7fd686cd6c72412713218f22a11b541316d7d687afda8918265"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"6bad17200b8ed2876cf38e92c561f676aa231af9a2dc2eb7640c12a74f705555"},"sha256":"21f6192ed837dcb987a256b1bbe4ac483771bd172a44751b5cad9d481a0644c8"}
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"887c9d9cf228cca07b5d43f9830d23be0bc7b9a9ff25494b88394a656f91b8ad"},"sha256":"1d3dd02894aab7e86df6a8c105b202e1c36702fd57833c3b6f28c2ffcd7f7b7a"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"1b763aea7d235f37330fb407824dc55abf4e5882d82788b16d101df3fc853cd8"},"sha256":"2811551477a0158283440e8046965208cd595ab5147f9f02dc048a740fcd9a7f"}
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"aad6f7f3c71f9cccf06e90d88ea3aac2613302719528c93c1c32f15402ec4752"},"sha256":"4337edea37a1a85b207ed76d11a4121226c2ea834a0ec2ddec7e7ebbc7a1d190"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"5eb43a19909354c756c87ed2be3a06310cc963b34149c4f9ae4751c4b150d0e7"},"sha256":"4100871ad9f07850c225c67f10d22fb134fd25b39240ad32ddb1d40f049489a0"}
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"603b27d9a1327d51ee82c9ad2df431a81cfeaa90948b9ebf37d7ff993d9760bb"},"sha256":"430af59244b90273c1faa03daf0561bb08166aa249e151a50b6e5523cb61bbea"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"86b37dbed19592daa685ff7143023f1bc14d875226f8a3a2cd2aef173e14457d"},"sha256":"40c9b21c1b05dab18ce10d31a1ff1b65346fe8d0df09d7c952cc4bda7c0666a2"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-goal",
3
- "version": "0.18.3",
3
+ "version": "0.18.4",
4
4
  "description": "Pi extension for goal tracking with background-aware continuation.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -506,8 +506,8 @@ export default function (pi: ExtensionAPI): void {
506
506
  escapeAbortSuppression.turn === turnGeneration &&
507
507
  escapeAbortSuppression.execution === executionGeneration;
508
508
 
509
- /** Why a paused goal cannot become active again, or null when it can. */
510
- const resumeBlocker = (goal: GoalSnapshot, ctx: ExtensionContext): string | null => {
509
+ /** Resolve and verify the saved coordinator once before recording it on resume. */
510
+ const resolveResumeOwner = (goal: GoalSnapshot, ctx: ExtensionContext): ReturnType<typeof currentWorkflowOwner> | string => {
511
511
  if (!goal.command && skillCommandName(goal.objective)) {
512
512
  return "Invoke the skill directly; this legacy slash-command goal cannot resume as plain text.";
513
513
  }
@@ -516,7 +516,11 @@ export default function (pi: ExtensionAPI): void {
516
516
  }
517
517
  if (goal.command?.source === "skill") {
518
518
  try {
519
- goalWorkflowOwner(goal);
519
+ const restored = goalWorkflowOwner(goal);
520
+ if (!restoredWorkflowMatches(goal, ctx.sessionManager.getBranch(), restored)) {
521
+ return "Reinvoke the original workflow to continue its Todo.";
522
+ }
523
+ return restored;
520
524
  } catch (error) {
521
525
  return `Cannot resume: ${error instanceof Error ? error.message : String(error)} Reinvoke /${goal.command.name}.`;
522
526
  }
@@ -560,14 +564,11 @@ export default function (pi: ExtensionAPI): void {
560
564
  if (source === "tool" && currentContinuationState(ctx, current.goalId)?.blocked) {
561
565
  return { ok: false, message: "Only /goal resume or alt+g can reopen a no-progress hold." };
562
566
  }
563
- const blocker = resumeBlocker(current, ctx);
564
- if (blocker) {
565
- return { ok: false, message: blocker };
566
- }
567
+ const owner = resolveResumeOwner(current, ctx);
568
+ if (typeof owner === "string") return { ok: false, message: owner };
567
569
  const goal = held ? current : goalWithStatus(current, "active");
568
570
  // Resuming a skill-bound goal is explicit re-entry into its workflow: rebind the owner the
569
571
  // goal was created with (released by a handback) before the continuation runs.
570
- const owner = goalWorkflowOwner(current);
571
572
  const activeOwner = getWorkflow(ctx);
572
573
  if (owner && (activeOwner?.name !== owner.name || activeOwner.path !== owner.path)) recordWorkflow(owner);
573
574
  setGoal(goal, ctx, source);
@@ -1038,19 +1039,13 @@ export default function (pi: ExtensionAPI): void {
1038
1039
  if (invalid) return invalid;
1039
1040
  const owner = getWorkflow(ctx);
1040
1041
  if (!previous && owner && !workflowAvailable(owner)) return `Restore /skill:${owner.name} before continuing its Todo.`;
1041
- if (previous) {
1042
- const blocker = resumeBlocker(previous, ctx);
1043
- if (blocker) return blocker;
1044
- }
1042
+ const restoredOwner = previous ? resolveResumeOwner(previous, ctx) : null;
1043
+ if (typeof restoredOwner === "string") return restoredOwner;
1045
1044
  if (objective.startsWith("/") && (!previous?.command || previous.objective.trim() !== objective)) {
1046
1045
  return "Reinvoke the original command to continue this Goal.";
1047
1046
  }
1048
1047
  const command = previous ? previous.command : owner ? resolveGoalCommand(pi, `/skill:${owner.name}`) : null;
1049
1048
  const goal = createGoalSnapshot(objective, null, undefined, command ?? undefined);
1050
- const restoredOwner = previous?.command ? goalWorkflowOwner(goal) : null;
1051
- if (previous?.command?.source === "skill" && !restoredWorkflowMatches(previous, ctx.sessionManager.getBranch(), restoredOwner)) {
1052
- return "Reinvoke the original workflow to continue its Todo.";
1053
- }
1054
1049
  if (handoffOwner && restoredOwner?.name !== handoffOwner) return "Reinvoke the original workflow to continue its Todo.";
1055
1050
  if (command?.source === "skill") {
1056
1051
  const binding = previous ? restoredOwner : owner;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-subagents",
3
- "version": "0.41.2",
3
+ "version": "0.41.4",
4
4
  "description": "Pi extension for detached, sandboxed subagent runs that keep the foreground session free.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -81,7 +81,7 @@
81
81
  "@earendil-works/pi-tui": "*"
82
82
  },
83
83
  "dependencies": {
84
- "pi-better-server": "0.11.0",
84
+ "pi-better-server": "0.11.2",
85
85
  "proper-lockfile": "^4.1.2",
86
86
  "shell-quote": "1.12.0",
87
87
  "smol-toml": "1.9.0",
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"cc56bc92eab4db783ddbe1a98e926b4ad5436f2f87defe697dd25dd6899844bb"},"sha256":"bd139ea6f47ef7fd686cd6c72412713218f22a11b541316d7d687afda8918265"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"6bad17200b8ed2876cf38e92c561f676aa231af9a2dc2eb7640c12a74f705555"},"sha256":"21f6192ed837dcb987a256b1bbe4ac483771bd172a44751b5cad9d481a0644c8"}
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"887c9d9cf228cca07b5d43f9830d23be0bc7b9a9ff25494b88394a656f91b8ad"},"sha256":"1d3dd02894aab7e86df6a8c105b202e1c36702fd57833c3b6f28c2ffcd7f7b7a"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"darwin-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"1b763aea7d235f37330fb407824dc55abf4e5882d82788b16d101df3fc853cd8"},"sha256":"2811551477a0158283440e8046965208cd595ab5147f9f02dc048a740fcd9a7f"}
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"aad6f7f3c71f9cccf06e90d88ea3aac2613302719528c93c1c32f15402ec4752"},"sha256":"4337edea37a1a85b207ed76d11a4121226c2ea834a0ec2ddec7e7ebbc7a1d190"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-arm64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"5eb43a19909354c756c87ed2be3a06310cc963b34149c4f9ae4751c4b150d0e7"},"sha256":"4100871ad9f07850c225c67f10d22fb134fd25b39240ad32ddb1d40f049489a0"}
@@ -1 +1 @@
1
- {"build":{"format":1,"sourceDigest":"67dd97a7bfc3aa83443b093c576f7e0d71f1f8938e66616056e5711691ec8b13","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.0","contentId":"603b27d9a1327d51ee82c9ad2df431a81cfeaa90948b9ebf37d7ff993d9760bb"},"sha256":"430af59244b90273c1faa03daf0561bb08166aa249e151a50b6e5523cb61bbea"}
1
+ {"build":{"format":1,"sourceDigest":"b5753b157494c783972913c54f17c2a83511dee6d4d6c66298f5de45b4db833e","piSdkVersion":"1.7.0","nodeVersion":"24.14.1","platform":"linux-x64","dependencyLockDigest":"97fbfa01a6e5a49f4f29f5c2048549391417c545cbdd52ec799629aa867d8653","protocolVersion":1,"serverVersion":"0.11.2","contentId":"86b37dbed19592daa685ff7143023f1bc14d875226f8a3a2cd2aef173e14457d"},"sha256":"40c9b21c1b05dab18ce10d31a1ff1b65346fe8d0df09d7c952cc4bda7c0666a2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-harness",
3
- "version": "0.63.0",
3
+ "version": "0.63.2",
4
4
  "description": "Pi extension bundle for a write sandbox, subagents, background tasks, SSH, Goals, and Todo lists.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -74,12 +74,12 @@
74
74
  "@xterm/xterm": "6.0.0",
75
75
  "marked": "18.0.5",
76
76
  "openai": "6.26.0",
77
- "pi-better-background-tasks": "0.21.9",
78
- "pi-better-goal": "0.18.3",
77
+ "pi-better-background-tasks": "0.21.11",
78
+ "pi-better-goal": "0.18.4",
79
79
  "pi-better-sandbox": "0.15.2",
80
- "pi-better-server": "0.11.0",
80
+ "pi-better-server": "0.11.2",
81
81
  "pi-better-ssh": "0.1.7",
82
- "pi-better-subagents": "0.41.2",
82
+ "pi-better-subagents": "0.41.4",
83
83
  "proper-lockfile": "^4.1.2",
84
84
  "shell-quote": "1.12.0",
85
85
  "smol-toml": "1.9.0",