gentle-pi 4.6.0 → 4.7.0
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/README.md +10 -11
- package/assets/agents/gentle-ai-explore.md +1 -0
- package/assets/agents/gentle-ai-verify.md +5 -2
- package/assets/agents/gentle-ai-worker.md +3 -0
- package/assets/agents/jd-fix-agent.md +1 -0
- package/assets/agents/jd-judge-a.md +1 -0
- package/assets/agents/jd-judge-b.md +1 -0
- package/assets/design-canvas/canvas.css +13 -1
- package/assets/design-canvas/canvas.js +11 -2
- package/assets/install-wizard/wizard.js +1 -0
- package/assets/migrations/agent-body-history.json +16 -1
- package/assets/orchestrator-delegation-reference.md +4 -4
- package/assets/orchestrator-delegation.md +1 -1
- package/assets/orchestrator-full-delegation-card.md +65 -0
- package/assets/orchestrator-full-delegation.md +34 -0
- package/assets/orchestrator-memory.md +3 -3
- package/assets/orchestrator-prompts.md +1 -1
- package/assets/orchestrator-skills.md +1 -1
- package/assets/orchestrator-verification.md +7 -5
- package/assets/orchestrator.md +3 -3
- package/bin/gentle-shell.mjs +164 -56
- package/docs/agent-status.md +61 -0
- package/docs/bundled-install.md +7 -5
- package/docs/delegated-verification.md +29 -7
- package/docs/gentle-agents-activity.md +14 -0
- package/docs/gentle-shell.md +54 -16
- package/docs/install-wizard.md +1 -1
- package/docs/permission-modes.md +9 -4
- package/docs/readme-reference.md +75 -30
- package/docs/render-cache-performance.md +11 -1
- package/docs/review-coordinator.md +33 -0
- package/docs/review-request-context.md +19 -0
- package/docs/review-windows-acl.md +18 -0
- package/docs/voice.md +6 -3
- package/docs/yolo-mode.md +5 -5
- package/extensions/ask-user-choice.ts +1 -0
- package/extensions/ask-user-question.ts +1 -0
- package/extensions/child-safety.ts +3 -0
- package/extensions/gentle-agent-status.ts +99 -0
- package/extensions/gentle-agents.ts +326 -34
- package/extensions/gentle-ai.ts +1496 -454
- package/extensions/gentle-shell.ts +293 -63
- package/extensions/gentle-todo.ts +18 -2
- package/extensions/gentle-tps.ts +48 -0
- package/extensions/quiet-tools.ts +38 -8
- package/extensions/skill-registry.ts +175 -18
- package/extensions/startup-banner.ts +30 -3
- package/lib/agent-profile-pin.ts +3 -3
- package/lib/agent-profiles.ts +160 -2
- package/lib/agent-status.ts +105 -0
- package/lib/agents-config.ts +46 -0
- package/lib/agents-history.ts +24 -5
- package/lib/agents-messaging.ts +47 -5
- package/lib/agents-runner.ts +183 -12
- package/lib/auto-permission-runtime.ts +1 -1
- package/lib/bounded-writer-admission.ts +13 -1
- package/lib/card-content-policy.ts +8 -6
- package/lib/command-palette.ts +133 -17
- package/lib/context-backstop.ts +14 -5
- package/lib/destructive-command-guard.ts +48 -4
- package/lib/execution-surface-guard.ts +20 -0
- package/lib/exploration-budget.ts +4 -2
- package/lib/gentle-ai-binary.ts +1 -1
- package/lib/gentle-design.ts +3 -0
- package/lib/gentle-shell-bundled.ts +6 -19
- package/lib/gentle-shell-launcher.ts +43 -8
- package/lib/herdr-activity.ts +14 -2
- package/lib/herdr-busy.ts +45 -0
- package/lib/image-attachments.ts +33 -0
- package/lib/image-disk-cache.ts +137 -0
- package/lib/inprocess-reviewer.ts +270 -140
- package/lib/jobs-view.ts +198 -11
- package/lib/model-routing-authority.ts +22 -4
- package/lib/native-choice-list.ts +20 -2
- package/lib/native-review-cli.ts +96 -19
- package/lib/orchestrator-mode-policy.ts +105 -0
- package/lib/questionnaire/questionnaire-view.ts +105 -12
- package/lib/rdd-mode-control.ts +32 -0
- package/lib/reply-language-anchor.ts +104 -0
- package/lib/review-blocker.ts +92 -0
- package/lib/review-candidate-symlink-scan.ts +136 -0
- package/lib/review-candidate-view-owner.ts +81 -44
- package/lib/review-continuation-registry.ts +99 -0
- package/lib/review-coordinator.ts +163 -0
- package/lib/review-failure-facts.ts +49 -0
- package/lib/review-host-relay.ts +46 -10
- package/lib/review-integration-v2.ts +7 -1
- package/lib/review-relay-phase-timing.ts +45 -0
- package/lib/review-start-context.ts +17 -0
- package/lib/session-profile-freeze.ts +4 -2
- package/lib/shell-bar.ts +140 -58
- package/lib/shell-changes.ts +2 -0
- package/lib/shell-panel.ts +17 -3
- package/lib/shell-sidebar-layout.ts +112 -40
- package/lib/shell-sidebar.ts +7 -0
- package/lib/shell-todo.ts +10 -3
- package/lib/verifier-admission.ts +1 -1
- package/lib/visual-customization-policy.ts +36 -16
- package/lib/visual-customize-view.ts +216 -21
- package/lib/visual-layout-preview.ts +9 -5
- package/lib/visual-profiles.ts +2 -2
- package/lib/windows-session-transport.ts +53 -2
- package/lib/yolo-session-policy.ts +40 -15
- package/package.json +2 -1
- package/runtime/gentle-ai-binary.mjs +1 -1
- package/runtime/gentle-shell-bundled.mjs +6 -19
- package/runtime/gentle-shell-launcher.mjs +42 -7
- package/runtime/native-review-cli.mjs +93 -16
- package/runtime/review-integration-v2.mjs +7 -1
- package/scripts/build-full-delegation-card.mjs +175 -0
- package/scripts/bundled-install.mjs +38 -8
- package/scripts/download-progress.mjs +68 -0
- package/scripts/gentle-ai-installer.mjs +41 -18
- package/scripts/gentle-ai-proxy.mjs +294 -0
- package/scripts/install-gentle-ai.mjs +14 -1
- package/scripts/installer-preflight.mjs +5 -5
- package/scripts/installer-runner.mjs +27 -12
- package/scripts/installer-server.mjs +8 -7
- package/scripts/render-cache-host.mjs +72 -0
- package/scripts/render-cache-performance-worker.mjs +5 -4
- package/scripts/render-cache-performance.mjs +6 -1
- package/scripts/run-test-suite.mjs +40 -28
- package/scripts/verify-package-files.mjs +12 -2
- package/scripts/voice-worker.cjs +32 -6
- package/skills/design/SKILL.md +11 -8
- package/skills/gentle-ai/SKILL.md +2 -2
- package/skills/gentle-ui-design/SKILL.md +46 -0
- package/skills/gentle-ui-design/references/adaptive-interfaces.md +46 -0
- package/skills/gentle-ui-design/references/browse-and-compare.md +62 -0
- package/skills/gentle-ui-design/references/composition-and-feedback.md +56 -0
- package/skills/gentle-ui-design/references/task-and-content.md +60 -0
- package/skills/skill-registry/SKILL.md +4 -2
- package/skills/work-unit-commits/SKILL.md +6 -7
- package/tests/agent-home.test.ts +28 -9
- package/tests/agent-profiles-workflow.test.ts +163 -0
- package/tests/agent-risk-escalation.test.ts +1 -1
- package/tests/agent-status.test.ts +143 -0
- package/tests/agents-config.test.ts +96 -0
- package/tests/agents-history.test.ts +31 -0
- package/tests/agents-jobs-frames.test.ts +93 -0
- package/tests/agents-prompt-lifecycle-runtime.test.ts +376 -0
- package/tests/agents-runner-drain.test.ts +193 -0
- package/tests/agents-runner.test.ts +178 -2
- package/tests/append-system-prompt-route.test.ts +4 -1
- package/tests/ask-user-choice.test.ts +4 -3
- package/tests/ask-user-question.test.ts +97 -0
- package/tests/auto-permission-runtime.test.ts +1 -1
- package/tests/autonomous-guard.test.ts +346 -10
- package/tests/bounded-stop-contract.test.ts +43 -3
- package/tests/bridge-cost.test.ts +19 -4
- package/tests/bundled-install.test.ts +30 -5
- package/tests/card-content-policy.test.ts +3 -3
- package/tests/chained-pr-skill.test.ts +8 -6
- package/tests/child-safety.test.ts +11 -0
- package/tests/codegraph-tools.test.ts +11 -5
- package/tests/command-palette.test.ts +284 -1
- package/tests/delegate-for-reason-contract.test.ts +3 -3
- package/tests/design-canvas-assets.test.ts +185 -2
- package/tests/destructive-command-guard.test.ts +52 -0
- package/tests/download-progress.test.ts +71 -0
- package/tests/execution-surface-guard.test.ts +55 -0
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +9 -5
- package/tests/fixtures/proxy-tls/proxy.crt +19 -0
- package/tests/fixtures/proxy-tls/proxy.key +28 -0
- package/tests/fixtures/session-profile-v1/gentle-ai-reviewer.ts +89 -0
- package/tests/fixtures/session-profile-v1/replay.ts +53 -6
- package/tests/full-delegation-closure.test.ts +131 -0
- package/tests/full-delegation-notices.test.ts +76 -0
- package/tests/generic-agent-tools.test.ts +3 -3
- package/tests/gentle-agent-status.test.ts +74 -0
- package/tests/gentle-agents-child-jobs.test.ts +237 -0
- package/tests/gentle-agents.test.ts +1070 -12
- package/tests/gentle-ai-binary.test.ts +3 -1
- package/tests/gentle-ai-elapsed-store.test.ts +19 -0
- package/tests/gentle-ai-exploration-budget.test.ts +18 -2
- package/tests/gentle-ai-installer.test.ts +134 -51
- package/tests/gentle-ai-proxy.test.ts +434 -0
- package/tests/gentle-ai.test.ts +113 -38
- package/tests/gentle-design.test.ts +21 -0
- package/tests/gentle-herdr-activity.test.ts +9 -6
- package/tests/gentle-shell-bin.test.ts +123 -0
- package/tests/gentle-shell-bundled.test.ts +207 -31
- package/tests/gentle-shell-launcher.test.ts +77 -10
- package/tests/gentle-shell.test.ts +899 -59
- package/tests/gentle-todo.test.ts +19 -2
- package/tests/gentle-tps.test.ts +123 -0
- package/tests/gentle-ui-design-skill.test.ts +59 -0
- package/tests/herdr-busy.test.ts +59 -0
- package/tests/herdr-task-summary-policy.test.ts +8 -4
- package/tests/image-disk-cache.test.ts +163 -0
- package/tests/independent-recovery-delivery.test.ts +83 -0
- package/tests/inprocess-reviewer.test.ts +176 -4
- package/tests/installer-posix-bootstrap.test.ts +1 -1
- package/tests/installer-preflight.test.ts +5 -4
- package/tests/installer-runner.test.ts +79 -44
- package/tests/installer-server.test.ts +14 -11
- package/tests/jobs-view.test.ts +260 -6
- package/tests/modal-mouse-boundaries.test.ts +136 -0
- package/tests/model-routing-authority.test.ts +178 -2
- package/tests/native-choice-list.test.ts +77 -2
- package/tests/native-review-capability-contract.test.ts +7 -1
- package/tests/native-review-cli.test.ts +269 -1
- package/tests/no-self-pause-contract.test.ts +4 -1
- package/tests/odd-routing-canonical-ratchet.test.ts +3 -3
- package/tests/orchestrator-budget.test.ts +7 -2
- package/tests/orchestrator-delegation-mode.test.ts +153 -0
- package/tests/orchestrator-mode-policy.test.ts +175 -0
- package/tests/orchestrator-prompt-budget.test.ts +3 -1
- package/tests/orchestrator-rdd-ownership.test.ts +2 -2
- package/tests/package-manifest.test.ts +11 -9
- package/tests/permission-allowlist.test.ts +202 -0
- package/tests/pi-update-launcher.test.ts +8 -0
- package/tests/pnpm-workspace-config.test.ts +58 -0
- package/tests/primary-session-prompt.test.ts +13 -0
- package/tests/profile-pin.test.ts +29 -2
- package/tests/profile-tier-footer.test.ts +5 -0
- package/tests/profiles-panel-delegation-mode.test.ts +422 -0
- package/tests/questionnaire-view.test.ts +115 -0
- package/tests/quiet-bash-runtime.test.ts +1 -1
- package/tests/quiet-tool-rendering.test.ts +48 -0
- package/tests/rdd-aware-verification-contract.test.ts +16 -11
- package/tests/rdd-customize.test.ts +287 -0
- package/tests/rdd-mode-cache.test.ts +450 -0
- package/tests/rdd-mode-control.test.ts +407 -0
- package/tests/rdd-mode-scope-regression.test.ts +137 -0
- package/tests/rdd-off-independent-regression.test.ts +69 -0
- package/tests/rdd-status-line.test.ts +18 -0
- package/tests/render-cache-performance.test.ts +171 -2
- package/tests/reply-language-anchor.test.ts +173 -0
- package/tests/review-agent-end-preflight.test.ts +1 -1
- package/tests/review-blocker.test.ts +193 -0
- package/tests/review-candidate-owner-retry.test.ts +1 -1
- package/tests/review-candidate-symlink-scan.test.ts +157 -0
- package/tests/review-candidate-view.test.ts +1 -1
- package/tests/review-candidate-windows-boundary.test.ts +131 -0
- package/tests/review-candidate-windows-probe.test.ts +63 -0
- package/tests/review-committed-restart-ack.test.ts +129 -0
- package/tests/review-continuation-registry.test.ts +76 -0
- package/tests/review-controller-native-routing.test.ts +261 -5
- package/tests/review-controller-workspace-root.test.ts +230 -3
- package/tests/review-controller.test.ts +96 -11
- package/tests/review-coordinator-runtime.test.ts +117 -0
- package/tests/review-coordinator.test.ts +195 -0
- package/tests/review-failure-facts.test.ts +87 -0
- package/tests/review-host-relay-routing.test.ts +258 -4
- package/tests/review-host-relay.test.ts +39 -0
- package/tests/review-integration-v2.test.ts +46 -3
- package/tests/review-json-arguments.test.ts +65 -10
- package/tests/review-last-event-closure.test.ts +68 -0
- package/tests/review-loadout-rdd-off-sdk.test.ts +65 -31
- package/tests/review-owner-identity.test.ts +60 -24
- package/tests/review-relay-phase-timing.test.ts +128 -0
- package/tests/review-relay-transport-agent.test.ts +12 -2
- package/tests/review-reviewer-evidence.test.ts +183 -0
- package/tests/review-risk-assessment.test.ts +74 -3
- package/tests/review-session-standing-permission-controller.test.ts +21 -1
- package/tests/review-start-context.test.ts +19 -0
- package/tests/review-tool-prose-budget.test.ts +121 -0
- package/tests/run-test-suite.test.ts +122 -1
- package/tests/runtime-harness.mjs +4 -1
- package/tests/sensitive-path-tools.test.ts +181 -5
- package/tests/session-profile-append-controller-pi.test.ts +60 -31
- package/tests/session-profile-binding.test.ts +19 -1
- package/tests/session-profile-disk-reader-pi.test.ts +58 -16
- package/tests/session-profile-v1-compat.test.ts +35 -1
- package/tests/shell-bar.test.ts +186 -42
- package/tests/shell-panel.test.ts +50 -22
- package/tests/shell-sidebar-fullscreen.test.ts +5 -5
- package/tests/shell-sidebar-layout.test.ts +294 -23
- package/tests/shell-sidebar-scroll-benchmark.test.ts +1 -1
- package/tests/shell-surface-transparent.test.ts +89 -0
- package/tests/shell-todo.test.ts +12 -0
- package/tests/skill-registry.test.ts +838 -5
- package/tests/startup-banner.test.ts +152 -1
- package/tests/startup-home-repo.test.ts +2 -0
- package/tests/support/review-coordinator-runtime.ts +69 -0
- package/tests/task-size-routing-contract.test.ts +5 -3
- package/tests/verifier-admission.test.ts +49 -0
- package/tests/verify-first-launch-contract.test.ts +78 -3
- package/tests/visual-customization-policy.test.ts +39 -6
- package/tests/visual-customize-view.test.ts +573 -9
- package/tests/visual-layout-preview.test.ts +15 -1
- package/tests/visual-profiles.test.ts +11 -0
- package/tests/voice-worker.test.ts +73 -2
- package/tests/windows-session-transport.test.ts +126 -0
- package/tests/work-continuity-contract.test.ts +28 -0
- package/tests/writer-feature-document-admission.test.ts +92 -0
- package/tests/yolo-customize.test.ts +27 -4
- package/tests/yolo-mode.test.ts +23 -18
- package/tests/yolo-session-policy.test.ts +270 -1
|
@@ -147,6 +147,7 @@ function listing(pi = PI_INSTALL_VERSION, shell = requirements.shell, path = PAC
|
|
|
147
147
|
|
|
148
148
|
// The same response key may hold a sequence: the first list -g precedes installation.
|
|
149
149
|
const LIST = "list -g --depth 0 --json";
|
|
150
|
+
const PI_VIEW = `view ${PI_PACKAGE_NAME}@latest version`;
|
|
150
151
|
const emptyList = { code: 0, stdout: "[]" };
|
|
151
152
|
|
|
152
153
|
function harness({ env = {}, results = {}, files = [] as string[], integrity = { ok: true } as object, layout = posixLayout,
|
|
@@ -161,6 +162,7 @@ function harness({ env = {}, results = {}, files = [] as string[], integrity = {
|
|
|
161
162
|
"--version": { code: 0, stdout: "11.19.0\n" },
|
|
162
163
|
"config get prefix": { code: 0, stdout: "/opt/node\n" },
|
|
163
164
|
"bin -g": { code: 0, stdout: `${layout.bin}\n` },
|
|
165
|
+
[PI_VIEW]: { code: 0, stdout: `${PI_INSTALL_VERSION}\n` },
|
|
164
166
|
add: { code: 0 },
|
|
165
167
|
[LIST]: [emptyList, { code: 0, stdout: listing(PI_INSTALL_VERSION, requirements.shell, layout.root) }],
|
|
166
168
|
"gentle-shell setup": { code: 0 },
|
|
@@ -306,7 +308,7 @@ test("Windows with a missing or older Go acquires the pinned Go after consent an
|
|
|
306
308
|
assert.deepEqual(h.acquisitions, [], "nothing is downloaded before consent");
|
|
307
309
|
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
308
310
|
assert.equal(result.outcome, "ready");
|
|
309
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "acquire-go", "verify-go",
|
|
311
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version", "acquire-go", "verify-go",
|
|
310
312
|
"install-global", "verify-global-list", "verify-shell-bin", "verify-gentle-ai", "shell-setup"]);
|
|
311
313
|
assert.deepEqual(h.acquisitions, [1]);
|
|
312
314
|
const verify = h.calls.find((call) => call.command === W_PINNED_GO);
|
|
@@ -325,7 +327,7 @@ test("a failed or unverified Go acquisition stops before anything is installed",
|
|
|
325
327
|
const failed = withGo(harness({ layout: windowsLayout }), new Error("Go verified acquisition failed"));
|
|
326
328
|
const result = await runStandardInstall({ plan: plan("win32", { go: absent }), consent: true }, failed.adapters);
|
|
327
329
|
assert.deepEqual([result.outcome, result.failedStep], ["failed", "acquire-go"]);
|
|
328
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack"]);
|
|
330
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version"]);
|
|
329
331
|
assert.equal(failed.calls.some((call) => call.args[1] === "add"), false);
|
|
330
332
|
// Without an acquisition adapter the step fails the same way.
|
|
331
333
|
const missing = harness({ layout: windowsLayout });
|
|
@@ -601,7 +603,7 @@ test("Windows hands a native pnpm.exe off as the command itself; nothing else is
|
|
|
601
603
|
const h = harness({ layout: windowsLayout, env: { GENTLE_INSTALL_PNPM_NODE: "", GENTLE_INSTALL_PNPM_ENTRY: "", GENTLE_INSTALL_PNPM_COMMAND: exe } });
|
|
602
604
|
const result = await runStandardInstall({ plan: plan("win32"), consent: true }, h.adapters);
|
|
603
605
|
assert.equal(result.outcome, "ready");
|
|
604
|
-
assert.deepEqual(h.calls.filter((call) => call.command === exe).map((call) => call.args.join(" ")), ["bin -g", LIST, INSTALL, LIST]);
|
|
606
|
+
assert.deepEqual(h.calls.filter((call) => call.command === exe).map((call) => call.args.join(" ")), ["bin -g", LIST, PI_VIEW, INSTALL, LIST]);
|
|
605
607
|
});
|
|
606
608
|
|
|
607
609
|
test("Windows without the direct pnpm handoff is blocked rather than spawning a .cmd shim", async () => {
|
|
@@ -660,7 +662,7 @@ test("POSIX accepts the first npm on PATH that works, whatever installed it, by
|
|
|
660
662
|
}
|
|
661
663
|
// npm's own CLI is never run with the installer's Node: a shim has none to find.
|
|
662
664
|
assert.equal(h.calls.some((call) => call.command === NODE && /npm-cli\.js$/.test(call.args[0] ?? "")), false);
|
|
663
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, INSTALL, LIST]);
|
|
665
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, INSTALL, LIST]);
|
|
664
666
|
}
|
|
665
667
|
});
|
|
666
668
|
|
|
@@ -676,13 +678,13 @@ test("verified clean install runs one exact add -g with a package-scoped build a
|
|
|
676
678
|
const h = harness();
|
|
677
679
|
const result = await runStandardInstall({ plan: plan(), consent: true }, h.adapters);
|
|
678
680
|
assert.equal(result.outcome, "ready");
|
|
679
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, INSTALL, LIST]);
|
|
681
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, INSTALL, LIST]);
|
|
680
682
|
const adds = h.calls.filter((call) => call.args[1] === "add");
|
|
681
683
|
assert.equal(adds.length, 1);
|
|
682
684
|
assert.equal(adds[0].args.some((arg) => /dangerously|allow-build=\*|--allow-build$|approve-builds/.test(arg)), false);
|
|
683
685
|
assert.equal(adds[0].command, NODE);
|
|
684
686
|
assert.deepEqual(h.calls.at(-1)?.args, [SHELL_ENTRY, "setup"]);
|
|
685
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "install-global",
|
|
687
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version", "install-global",
|
|
686
688
|
"verify-global-list", "verify-shell-bin", "verify-gentle-ai", "shell-setup"]);
|
|
687
689
|
assert.deepEqual(h.integrityCalls, [{ packageRoot: PACKAGE_ROOT, platform: "linux", env: h.adapters.env, home: HOME }]);
|
|
688
690
|
assert.equal(JSON.stringify(h.logs).includes("11.19.0"), false);
|
|
@@ -716,8 +718,8 @@ test("install nonzero, signal or deadline fails and reports completed steps", as
|
|
|
716
718
|
const result = await runStandardInstall({ plan: plan(), consent: true }, h.adapters);
|
|
717
719
|
assert.equal(result.outcome, "failed");
|
|
718
720
|
assert.equal(result.failedStep, "install-global");
|
|
719
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack"]);
|
|
720
|
-
assert.equal(h.pnpmCalls().length,
|
|
721
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version"]);
|
|
722
|
+
assert.equal(h.pnpmCalls().length, 4);
|
|
721
723
|
}
|
|
722
724
|
});
|
|
723
725
|
|
|
@@ -964,7 +966,7 @@ function persistedListing(root = PACKAGE_ROOT, home = PNPM_HOME) {
|
|
|
964
966
|
]);
|
|
965
967
|
}
|
|
966
968
|
const persistedList = { [LIST]: [emptyList, { code: 0, stdout: persistedListing() }] };
|
|
967
|
-
const PERSISTED_STEPS = ["check-global-bin", "check-existing-stack", "persist-node", "persist-package-managers",
|
|
969
|
+
const PERSISTED_STEPS = ["check-global-bin", "check-existing-stack", "resolve-pi-version", "persist-node", "persist-package-managers",
|
|
968
970
|
"verify-persistent-runtime", "check-npm", "configure-npm-prefix"];
|
|
969
971
|
|
|
970
972
|
test("persistence pins are fixed: Node 24.21.0 with its bundled npm 11.19.0 and the pnpm acquisition pin", () => {
|
|
@@ -976,7 +978,7 @@ test("bootstrap-only Node persists node, npm and pnpm under PNPM_HOME before the
|
|
|
976
978
|
const result = await runStandardInstall({ plan: persistPlan(), consent: true }, h.adapters);
|
|
977
979
|
assert.equal(result.outcome, "ready");
|
|
978
980
|
assert.equal(result.npmPrefix, "configured");
|
|
979
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, RUNTIME_SET, PM_ADD, "store path", INSTALL, LIST]);
|
|
981
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, RUNTIME_SET, PM_ADD, "store path", INSTALL, LIST]);
|
|
980
982
|
assert.deepEqual(result.completed, [...PERSISTED_STEPS, "install-global", "verify-global-list", "verify-shell-bin",
|
|
981
983
|
"verify-gentle-ai", "shell-setup"]);
|
|
982
984
|
for (const call of h.calls.filter((c) => c.args[1] === "add" || c.args[1] === "runtime")) {
|
|
@@ -1015,7 +1017,7 @@ test("an older Node and incompatible pnpm left alongside: the pinned copies run
|
|
|
1015
1017
|
const h = harness({ results: persistedList });
|
|
1016
1018
|
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
1017
1019
|
assert.equal(result.outcome, "ready");
|
|
1018
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, RUNTIME_SET, PM_ADD, "store path", INSTALL, LIST]);
|
|
1020
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, RUNTIME_SET, PM_ADD, "store path", INSTALL, LIST]);
|
|
1019
1021
|
// pnpm always runs through the installer's own copy, never a pnpm found on PATH.
|
|
1020
1022
|
for (const call of h.calls.filter((c) => c.args[0] === ENTRY)) assert.equal(call.command, NODE);
|
|
1021
1023
|
assert.equal(h.calls.some((call) => /\/pnpm$/.test(call.command)), false);
|
|
@@ -1029,13 +1031,13 @@ test("the full persistence group runs exactly when Node is bootstrap-only", asyn
|
|
|
1029
1031
|
const result = await runStandardInstall({ plan: plan("linux", { node: { ...tool("24.18.0"), persistent: false, npm: true }, pnpm }),
|
|
1030
1032
|
consent: true }, h.adapters);
|
|
1031
1033
|
assert.equal(result.outcome, "ready");
|
|
1032
|
-
assert.deepEqual(h.pnpmCalls().slice(2,
|
|
1034
|
+
assert.deepEqual(h.pnpmCalls().slice(2, 5), [PI_VIEW, RUNTIME_SET, add]);
|
|
1033
1035
|
}
|
|
1034
1036
|
const h = harness();
|
|
1035
1037
|
const result = await runStandardInstall({ plan: plan("linux", { node: { ...tool("24.18.0"), persistent: true, npm: true } }), consent: true }, h.adapters);
|
|
1036
1038
|
assert.equal(result.outcome, "ready");
|
|
1037
1039
|
assert.equal(result.npmPrefix, undefined);
|
|
1038
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, INSTALL, LIST]);
|
|
1040
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, INSTALL, LIST]);
|
|
1039
1041
|
assert.equal(h.calls.some((call) => call.args[0] === PM_NPM_CLI || call.command === PERSISTENT_NODE), false);
|
|
1040
1042
|
});
|
|
1041
1043
|
|
|
@@ -1047,16 +1049,16 @@ test("bootstrap-only Node next to a persistent newer pnpm 11 adds only npm: that
|
|
|
1047
1049
|
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
1048
1050
|
assert.equal(result.outcome, "ready");
|
|
1049
1051
|
assert.equal(result.npmPrefix, "configured");
|
|
1050
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, RUNTIME_SET, NPM_ADD, "store path", INSTALL, LIST]);
|
|
1051
|
-
assert.deepEqual(result.completed, ["check-global-bin", "check-existing-stack", "persist-node", "persist-npm", "verify-persistent-runtime",
|
|
1052
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, RUNTIME_SET, NPM_ADD, "store path", INSTALL, LIST]);
|
|
1053
|
+
assert.deepEqual(result.completed, ["check-global-bin", "check-existing-stack", "resolve-pi-version", "persist-node", "persist-npm", "verify-persistent-runtime",
|
|
1052
1054
|
"check-npm", "configure-npm-prefix", ...AFTER_STACK]);
|
|
1053
1055
|
assert.equal(h.pnpmCalls().some((call) => call.includes("pnpm@")), false);
|
|
1054
1056
|
// A failed npm add stops before the stack install, after the runtime.
|
|
1055
1057
|
const failing = harness({ results: { ...persistedList, "add-npm": { code: 1 } } });
|
|
1056
1058
|
const failed = await runStandardInstall({ plan: fixed, consent: true }, failing.adapters);
|
|
1057
1059
|
assert.equal(failed.failedStep, "persist-npm");
|
|
1058
|
-
assert.deepEqual(failed.completed, ["check-global-bin", "check-existing-stack", "persist-node"]);
|
|
1059
|
-
assert.deepEqual(failing.pnpmCalls(), ["bin -g", LIST, RUNTIME_SET, NPM_ADD]);
|
|
1060
|
+
assert.deepEqual(failed.completed, ["check-global-bin", "check-existing-stack", "resolve-pi-version", "persist-node"]);
|
|
1061
|
+
assert.deepEqual(failing.pnpmCalls(), ["bin -g", LIST, PI_VIEW, RUNTIME_SET, NPM_ADD]);
|
|
1060
1062
|
});
|
|
1061
1063
|
|
|
1062
1064
|
test("a failed persistence step stops before the stack install and reports completed steps", async () => {
|
|
@@ -1072,7 +1074,7 @@ test("a failed persistence step stops before the stack install and reports compl
|
|
|
1072
1074
|
assert.equal(result.outcome, "failed");
|
|
1073
1075
|
assert.equal(result.failedStep, failedStep);
|
|
1074
1076
|
assert.deepEqual(result.completed, PERSISTED_STEPS.slice(0, PERSISTED_STEPS.indexOf(failedStep)));
|
|
1075
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, ...mutations]);
|
|
1077
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, ...mutations]);
|
|
1076
1078
|
}
|
|
1077
1079
|
// pnpm reports success but node or npm is not in $PNPM_HOME/bin.
|
|
1078
1080
|
for (const creates of [{ "add-pm": [`${BIN}/npm`, PM_NPM_CLI] }, { [RUNTIME_SET]: [PERSISTENT_NODE] }]) {
|
|
@@ -1111,7 +1113,7 @@ test("an existing pnpm-global npm shim first on PATH satisfies check-npm without
|
|
|
1111
1113
|
const h = harness({ files });
|
|
1112
1114
|
const result = await runStandardInstall({ plan: plan(), consent: true }, h.adapters);
|
|
1113
1115
|
assert.equal(result.outcome, "ready");
|
|
1114
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, INSTALL, LIST]);
|
|
1116
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, INSTALL, LIST]);
|
|
1115
1117
|
assert.deepEqual(h.calls[0].args, [PM_NPM_CLI, "--version"]);
|
|
1116
1118
|
const wrong = harness({ files, texts: { [`${PM_NPM_DIR}/package.json`]: JSON.stringify({ name: "npm", version: "11.20.0" }) },
|
|
1117
1119
|
results: { "pm-npm --version": { code: 0, stdout: "11.20.0\n" } } });
|
|
@@ -1249,16 +1251,16 @@ const AFTER_STACK = ["install-global", "verify-global-list", "verify-shell-bin",
|
|
|
1249
1251
|
|
|
1250
1252
|
test("persistent Node adds only the missing npm and/or pnpm with exact fixed argv", async () => {
|
|
1251
1253
|
const cases: [boolean, boolean, string, string[]][] = [
|
|
1252
|
-
[false, true, NPM_ADD, ["check-global-bin", "check-existing-stack", "persist-npm", "check-npm"]],
|
|
1253
|
-
[true, false, PNPM_ADD, ["check-npm", "check-global-bin", "check-existing-stack", "persist-pnpm", "verify-persistent-pnpm"]],
|
|
1254
|
-
[false, false, PM_ADD, ["check-global-bin", "check-existing-stack", "persist-package-managers", "check-npm", "verify-persistent-pnpm"]],
|
|
1254
|
+
[false, true, NPM_ADD, ["check-global-bin", "check-existing-stack", "resolve-pi-version", "persist-npm", "check-npm"]],
|
|
1255
|
+
[true, false, PNPM_ADD, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version", "persist-pnpm", "verify-persistent-pnpm"]],
|
|
1256
|
+
[false, false, PM_ADD, ["check-global-bin", "check-existing-stack", "resolve-pi-version", "persist-package-managers", "check-npm", "verify-persistent-pnpm"]],
|
|
1255
1257
|
];
|
|
1256
1258
|
for (const [npm, pnpmPersistent, add, steps] of cases) {
|
|
1257
1259
|
const fixed = plan("linux", { node: persistentNode(npm), pnpm: pnpmTool(pnpmPersistent) });
|
|
1258
1260
|
const h = harness({ results: persistedList });
|
|
1259
1261
|
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
1260
1262
|
assert.equal(result.outcome, "ready", add);
|
|
1261
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, add, INSTALL, LIST]);
|
|
1263
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, add, INSTALL, LIST]);
|
|
1262
1264
|
assert.deepEqual(result.completed, [...steps, ...AFTER_STACK]);
|
|
1263
1265
|
assert.equal(result.npmPrefix, undefined);
|
|
1264
1266
|
// No runtime and no prefix change: check-npm only reads the user's npm.
|
|
@@ -1269,7 +1271,7 @@ test("persistent Node adds only the missing npm and/or pnpm with exact fixed arg
|
|
|
1269
1271
|
}
|
|
1270
1272
|
const none = harness();
|
|
1271
1273
|
const reused = await runStandardInstall({ plan: plan("linux", { node: persistentNode(true), pnpm: pnpmTool(true) }), consent: true }, none.adapters);
|
|
1272
|
-
assert.deepEqual(none.pnpmCalls(), ["bin -g", LIST, INSTALL, LIST]);
|
|
1274
|
+
assert.deepEqual(none.pnpmCalls(), ["bin -g", LIST, PI_VIEW, INSTALL, LIST]);
|
|
1273
1275
|
assert.equal(reused.outcome, "ready");
|
|
1274
1276
|
});
|
|
1275
1277
|
|
|
@@ -1386,6 +1388,14 @@ test("setup recovery off PATH persists PATH, needs a new terminal, and reports f
|
|
|
1386
1388
|
assert.equal(unverified.calls.some((call) => call.args[0] === SHELL_ENTRY), false);
|
|
1387
1389
|
});
|
|
1388
1390
|
|
|
1391
|
+
test("setup recovery still refuses a stack whose Pi is not the verified recovery pin", async () => {
|
|
1392
|
+
const fixed = recoveryPlan("linux", { pi: tool("1.9.0") });
|
|
1393
|
+
const h = harness({ results: { [LIST]: { code: 0, stdout: listing("1.9.0") } } });
|
|
1394
|
+
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
1395
|
+
assert.deepEqual([result.outcome, result.reason], ["blocked", "existing-stack-unverified"]);
|
|
1396
|
+
assert.equal(h.calls.some((call) => call.args.includes("add") || call.args.includes("setup")), false);
|
|
1397
|
+
});
|
|
1398
|
+
|
|
1389
1399
|
test("setup recovery blocks when the installed stack changed between plan and run", async () => {
|
|
1390
1400
|
const stack = JSON.parse(listing());
|
|
1391
1401
|
const changed = [
|
|
@@ -1500,9 +1510,9 @@ test("the main plan builds Gentle AI and installs the main Shell after the verif
|
|
|
1500
1510
|
const h = mainHarness();
|
|
1501
1511
|
const result = await runStandardInstall({ plan: mainPlan(), consent: true }, h.adapters);
|
|
1502
1512
|
assert.equal(result.outcome, "ready");
|
|
1503
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "install-global",
|
|
1513
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version", "install-global",
|
|
1504
1514
|
"verify-global-list", "verify-shell-bin", "verify-gentle-ai", "build-gentle-ai-main", "install-shell-main", "record-channel", "shell-setup"]);
|
|
1505
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, INSTALL, LIST, MAIN_ADD, LIST]);
|
|
1515
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, INSTALL, LIST, MAIN_ADD, LIST]);
|
|
1506
1516
|
const ctx = { env: h.adapters.env, home: HOME };
|
|
1507
1517
|
assert.deepEqual(h.main.calls, [
|
|
1508
1518
|
["resolveCommit", { repository: "Gentleman-Programming/gentle-ai" }],
|
|
@@ -1545,7 +1555,7 @@ test("a main plan with a missing or older Go builds Gentle AI with the pinned Go
|
|
|
1545
1555
|
version: goVersion() } }));
|
|
1546
1556
|
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
1547
1557
|
assert.equal(result.outcome, "ready");
|
|
1548
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "acquire-go", "verify-go", "install-global",
|
|
1558
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version", "acquire-go", "verify-go", "install-global",
|
|
1549
1559
|
"verify-global-list", "verify-shell-bin", "verify-gentle-ai", "build-gentle-ai-main", "install-shell-main", "record-channel", "shell-setup"]);
|
|
1550
1560
|
const build = h.main.calls.find(([name]) => name === "buildGentleAi")?.[1] as { goPath: string };
|
|
1551
1561
|
assert.equal(build.goPath, PINNED_GO);
|
|
@@ -1560,7 +1570,7 @@ test("a failed pinned Go download stops before the runtime is persisted, so noth
|
|
|
1560
1570
|
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
1561
1571
|
assert.equal(result.outcome, "failed");
|
|
1562
1572
|
assert.equal(result.failedStep, "acquire-go");
|
|
1563
|
-
assert.deepEqual(result.completed, ["check-global-bin", "check-existing-stack"]);
|
|
1573
|
+
assert.deepEqual(result.completed, ["check-global-bin", "check-existing-stack", "resolve-pi-version"]);
|
|
1564
1574
|
assert.equal(h.pnpmCalls().includes(RUNTIME_SET), false, "Node is not persisted");
|
|
1565
1575
|
assert.equal("detail" in result, false, "a download failure carries no detail");
|
|
1566
1576
|
});
|
|
@@ -1809,7 +1819,7 @@ test("a missing Pi is installed before the existing Gentle Shell is updated", as
|
|
|
1809
1819
|
gentleAi: { available: null }, setup: { available: null } });
|
|
1810
1820
|
const result = await runStandardInstall({ plan, consent: true }, h.adapters);
|
|
1811
1821
|
assert.equal(result.outcome, "ready");
|
|
1812
|
-
assert.deepEqual(result.completed.slice(3,
|
|
1822
|
+
assert.deepEqual(result.completed.slice(3, 6), ["resolve-pi-version", "install-pi", "update-shell"]);
|
|
1813
1823
|
assert.ok(h.pnpmCalls().includes(`add -g ${PI_PACKAGE_NAME}@${PI_INSTALL_VERSION}`));
|
|
1814
1824
|
});
|
|
1815
1825
|
|
|
@@ -1870,15 +1880,40 @@ function locatingPi<T extends { adapters: object }>(h: T, located: Array<object
|
|
|
1870
1880
|
return { ...h, adapters: { ...h.adapters, locatePi: async () => located[Math.min(locates++, located.length - 1)] } };
|
|
1871
1881
|
}
|
|
1872
1882
|
const npmResults = { "root -g": { code: 0, stdout: `${NPM_ROOT}\n` }, [NPM_PI_UPDATE]: { code: 0 } };
|
|
1883
|
+
test("global installer resolves latest stable Pi and installs its exact version", async () => {
|
|
1884
|
+
const h = harness({ results: { [PI_VIEW]: { code: 0, stdout: "1.9.0\n" }, [LIST]: [emptyList, { code: 0, stdout: listing("1.9.0") }] } });
|
|
1885
|
+
const result = await runStandardInstall({ plan: plan(), consent: true }, h.adapters);
|
|
1886
|
+
assert.equal(result.outcome, "ready");
|
|
1887
|
+
assert.equal(h.calls.filter((call) => call.args.includes("view")).length, 1);
|
|
1888
|
+
assert.ok(h.pnpmCalls().includes(`add -g ${PI_PACKAGE_NAME}@1.9.0 gentle-pi@${requirements.shell} --allow-build=gentle-pi`));
|
|
1889
|
+
});
|
|
1890
|
+
|
|
1891
|
+
test("global installer updates an older owned Pi to the exact resolved stable version", async () => {
|
|
1892
|
+
const shell = { available: true, version: requirements.shell, usable: true, global: true, owner: "npm" };
|
|
1893
|
+
const fixed = existingPlan({ pi: olderPi("pnpm"), shell, gentleAi: { available: null }, setup: { available: null } });
|
|
1894
|
+
const h = locatingPi(harness({ results: { [PI_VIEW]: { code: 0, stdout: "1.9.0\n" } } }), [piBefore, { ...piAfter, version: "1.9.0" }]);
|
|
1895
|
+
const result = await runStandardInstall({ plan: fixed, consent: true }, h.adapters);
|
|
1896
|
+
assert.equal(result.outcome, "ready");
|
|
1897
|
+
assert.ok(h.pnpmCalls().includes(`add -g ${PI_PACKAGE_NAME}@1.9.0`));
|
|
1898
|
+
assert.equal(h.calls.some((call) => call.args.includes(`gentle-pi@${requirements.shell}`)), false);
|
|
1899
|
+
});
|
|
1900
|
+
|
|
1901
|
+
test("global installer refuses invalid latest Pi before any installation", async () => {
|
|
1902
|
+
const h = harness({ results: { [PI_VIEW]: { code: 0, stdout: "1.9.0-beta.1\n" } } });
|
|
1903
|
+
const result = await runStandardInstall({ plan: plan(), consent: true }, h.adapters);
|
|
1904
|
+
assert.deepEqual([result.outcome, result.failedStep], ["failed", "resolve-pi-version"]);
|
|
1905
|
+
assert.equal(h.calls.some((call) => call.args.includes("add") || call.args.includes("install")), false);
|
|
1906
|
+
assert.equal(h.integrityCalls.length, 0);
|
|
1907
|
+
});
|
|
1873
1908
|
|
|
1874
1909
|
test("an older pnpm Pi is updated with pnpm and verified before only Gentle Shell is added", async () => {
|
|
1875
1910
|
const h = locatingPi(harness({ results: { [LIST]: [piOnlyList("0.87.1"), { code: 0, stdout: listing(PI_INSTALL_VERSION) }] } }),
|
|
1876
1911
|
[piBefore, piAfter]);
|
|
1877
1912
|
const result = await runStandardInstall({ plan: existingPlan({ pi: olderPi("pnpm") }), consent: true }, h.adapters);
|
|
1878
1913
|
assert.equal(result.outcome, "ready");
|
|
1879
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-shell", "check-installed-pi", "update-pi",
|
|
1914
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-shell", "check-installed-pi", "resolve-pi-version", "update-pi",
|
|
1880
1915
|
"verify-updated-pi", "install-global", "verify-global-list", "verify-shell-bin", "verify-gentle-ai", "shell-setup"]);
|
|
1881
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_UPDATE, SHELL_ONLY_ADD, LIST]);
|
|
1916
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, PI_UPDATE, SHELL_ONLY_ADD, LIST]);
|
|
1882
1917
|
});
|
|
1883
1918
|
|
|
1884
1919
|
test("an older npm Pi is updated with npm in its own global root, never with pnpm", async () => {
|
|
@@ -1886,12 +1921,12 @@ test("an older npm Pi is updated with npm in its own global root, never with pnp
|
|
|
1886
1921
|
realpaths: { [NPM_ROOT]: NPM_ROOT } }), [npmPiBefore, npmPiAfter]);
|
|
1887
1922
|
const result = await runStandardInstall({ plan: existingPlan({ pi: olderPi("npm") }), consent: true }, h.adapters);
|
|
1888
1923
|
assert.equal(result.outcome, "ready");
|
|
1889
|
-
assert.deepEqual(result.completed.slice(3,
|
|
1924
|
+
assert.deepEqual(result.completed.slice(3, 7), ["check-installed-pi", "resolve-pi-version", "update-pi", "verify-updated-pi"]);
|
|
1890
1925
|
const npmCalls = h.calls.filter((call) => call.command === USER_NPM);
|
|
1891
1926
|
// check-npm first reads that same npm in the child env; the update then runs it in the user's env.
|
|
1892
1927
|
assert.deepEqual(npmCalls.map((call) => call.args.join(" ")), ["--version", "config get prefix", "root -g", NPM_PI_UPDATE]);
|
|
1893
1928
|
for (const call of npmCalls.slice(2)) assert.deepEqual(call.env, h.adapters.env);
|
|
1894
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, SHELL_ONLY_ADD, LIST]);
|
|
1929
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, SHELL_ONLY_ADD, LIST]);
|
|
1895
1930
|
});
|
|
1896
1931
|
|
|
1897
1932
|
test("Windows: an older npm Pi is updated through what Node.js's npm.cmd runs, never through cmd.exe", async () => {
|
|
@@ -1924,13 +1959,13 @@ test("a failed or unverified Pi update stops before any Gentle Shell change", as
|
|
|
1924
1959
|
const failed = locatingPi(harness({ results: { [LIST]: piOnlyList("0.87.1"), add: { code: 1 } } }), [piBefore, piAfter]);
|
|
1925
1960
|
const result = await runStandardInstall({ plan, consent: true }, failed.adapters);
|
|
1926
1961
|
assert.deepEqual([result.outcome, result.failedStep], ["failed", "update-pi"]);
|
|
1927
|
-
assert.deepEqual(failed.pnpmCalls(), ["bin -g", LIST, PI_UPDATE]);
|
|
1962
|
+
assert.deepEqual(failed.pnpmCalls(), ["bin -g", LIST, PI_VIEW, PI_UPDATE]);
|
|
1928
1963
|
// Still old, another owner, listed twice (null) or a pre-release afterwards: never a single reusable Pi.
|
|
1929
1964
|
for (const after of [piBefore, { ...piAfter, owner: "npm" }, null, { ...piAfter, version: `${PI_INSTALL_VERSION}-rc.1` }]) {
|
|
1930
1965
|
const h = locatingPi(harness({ results: { [LIST]: piOnlyList("0.87.1") } }), [piBefore, after]);
|
|
1931
1966
|
const outcome = await runStandardInstall({ plan, consent: true }, h.adapters);
|
|
1932
1967
|
assert.deepEqual([outcome.outcome, outcome.failedStep], ["failed", "verify-updated-pi"], JSON.stringify(after));
|
|
1933
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_UPDATE]);
|
|
1968
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, PI_UPDATE]);
|
|
1934
1969
|
}
|
|
1935
1970
|
// npm must leave the update in the same global root.
|
|
1936
1971
|
const moved = locatingPi(harness({ results: { ...npmResults, [LIST]: emptyList }, realpaths: { [NPM_ROOT]: NPM_ROOT } }),
|
|
@@ -1982,9 +2017,9 @@ test("an older Pi is updated before an existing Gentle Shell is updated; its fai
|
|
|
1982
2017
|
const h = locatingPi(updateHarness(), [piBefore, piAfter]);
|
|
1983
2018
|
const result = await runStandardInstall({ plan, consent: true }, h.adapters);
|
|
1984
2019
|
assert.equal(result.outcome, "ready");
|
|
1985
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-installed-shell", "check-installed-pi", "update-pi",
|
|
2020
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-installed-shell", "check-installed-pi", "resolve-pi-version", "update-pi",
|
|
1986
2021
|
"verify-updated-pi", "update-shell", "verify-updated-shell", "verify-gentle-ai", "shell-setup"]);
|
|
1987
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", PI_UPDATE]);
|
|
2022
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", PI_VIEW, PI_UPDATE]);
|
|
1988
2023
|
const failed = locatingPi(updateHarness({ results: { add: { code: 1 } } }), [piBefore, piAfter]);
|
|
1989
2024
|
const outcome = await runStandardInstall({ plan, consent: true }, failed.adapters);
|
|
1990
2025
|
assert.deepEqual([outcome.outcome, outcome.failedStep], ["failed", "update-pi"]);
|
|
@@ -1999,8 +2034,8 @@ test("with a current Gentle Shell, only the older Pi is updated: no setup, PATH
|
|
|
1999
2034
|
[npmPiBefore, npmPiAfter]);
|
|
2000
2035
|
const result = await runStandardInstall({ plan, consent: true }, h.adapters);
|
|
2001
2036
|
assert.equal(result.outcome, "ready");
|
|
2002
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-installed-pi", "update-pi", "verify-updated-pi"]);
|
|
2003
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g"]);
|
|
2037
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-installed-pi", "resolve-pi-version", "update-pi", "verify-updated-pi"]);
|
|
2038
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", PI_VIEW]);
|
|
2004
2039
|
assert.equal(h.integrityCalls.length, 0);
|
|
2005
2040
|
// Windows: a pnpm-owned Pi is updated through the pnpm handoff without Go.
|
|
2006
2041
|
const windows = planPreflight({ platform: "win32", arch: "x64", node: tool("24.18.0"), pnpm: { ...tool("11.1.1"), compatible: true },
|
|
@@ -2009,7 +2044,7 @@ test("with a current Gentle Shell, only the older Pi is updated: no setup, PATH
|
|
|
2009
2044
|
const w = locatingPi(harness({ layout: windowsLayout }), [{ ...piBefore, root: `${W_PNPM_HOME}\\global\\v11\\abc` }, { ...piAfter, root: `${W_PNPM_HOME}\\global\\v11\\def` }]);
|
|
2010
2045
|
const wResult = await runStandardInstall({ plan: windows, consent: true }, w.adapters);
|
|
2011
2046
|
assert.equal(wResult.outcome, "ready");
|
|
2012
|
-
assert.deepEqual(w.pnpmCalls(), ["bin -g", PI_UPDATE]);
|
|
2047
|
+
assert.deepEqual(w.pnpmCalls(), ["bin -g", PI_VIEW, PI_UPDATE]);
|
|
2013
2048
|
});
|
|
2014
2049
|
|
|
2015
2050
|
// --- An older Pi that neither pnpm nor npm owns: the installer's Pi is installed alongside ----------
|
|
@@ -2026,9 +2061,9 @@ test("an older Pi that neither pnpm nor npm owns gets the installer's Pi alongsi
|
|
|
2026
2061
|
const h = harness();
|
|
2027
2062
|
const result = await runStandardInstall({ plan, consent: true }, h.adapters);
|
|
2028
2063
|
assert.equal(result.outcome, "ready");
|
|
2029
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "install-global", "verify-global-list",
|
|
2064
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-stack", "resolve-pi-version", "install-global", "verify-global-list",
|
|
2030
2065
|
"verify-shell-bin", "verify-gentle-ai", "shell-setup"]);
|
|
2031
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, INSTALL, LIST]);
|
|
2066
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, INSTALL, LIST]);
|
|
2032
2067
|
assert.equal(touchesExternalPi(h.calls), false);
|
|
2033
2068
|
});
|
|
2034
2069
|
|
|
@@ -2039,8 +2074,8 @@ test("with a current Gentle Shell, only the installer's Pi is added next to the
|
|
|
2039
2074
|
const h = locatingPi(harness({ env: { PATH: "/opt/node/bin:/usr/bin" }, results: { [LIST]: emptyList } }), [piAfter]);
|
|
2040
2075
|
const result = await runStandardInstall({ plan, consent: true }, h.adapters);
|
|
2041
2076
|
assert.equal(result.outcome, "ready");
|
|
2042
|
-
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-pi", "install-pi", "verify-installed-pi"]);
|
|
2043
|
-
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_UPDATE]);
|
|
2077
|
+
assert.deepEqual(result.completed, ["check-npm", "check-global-bin", "check-existing-pi", "resolve-pi-version", "install-pi", "verify-installed-pi"]);
|
|
2078
|
+
assert.deepEqual(h.pnpmCalls(), ["bin -g", LIST, PI_VIEW, PI_UPDATE]);
|
|
2044
2079
|
assert.equal(touchesExternalPi(h.calls), false);
|
|
2045
2080
|
// pnpm already lists a Pi: never reinstalled.
|
|
2046
2081
|
const listed = locatingPi(harness({ results: { [LIST]: piOnlyList(PI_INSTALL_VERSION) } }), [piAfter]);
|
|
@@ -306,8 +306,8 @@ test("/api/plan names the found and required version of an older Gentle Shell an
|
|
|
306
306
|
const view = await plan(port, await login());
|
|
307
307
|
assert.deepEqual(view.blockers.map((blocker: { code: string; tool: string }) => [blocker.code, blocker.tool]), [["incompatible-tool", "shell"]]);
|
|
308
308
|
assert.equal(view.blockers[0].guidance,
|
|
309
|
-
"Gentle Shell 3.4.0 is installed globally with pnpm, but this installer needs 4.
|
|
310
|
-
"Update it with `pnpm add -g gentle-pi@4.
|
|
309
|
+
"Gentle Shell 3.4.0 is installed globally with pnpm, but this installer needs 4.7.0 or newer. Nothing was replaced. " +
|
|
310
|
+
"Update it with `pnpm add -g gentle-pi@4.7.0`, or remove it with `pnpm remove -g gentle-pi`, then select Check again.");
|
|
311
311
|
assert.deepEqual(view.actions, []);
|
|
312
312
|
} finally {
|
|
313
313
|
await host.close("test");
|
|
@@ -320,7 +320,7 @@ test("/api/plan installs the installer's Pi alongside an older Pi that neither p
|
|
|
320
320
|
const view = await plan(port, await login());
|
|
321
321
|
assert.deepEqual(view.blockers, []);
|
|
322
322
|
const install = view.actions.find((action: { id: string }) => action.id === "install-pi");
|
|
323
|
-
assert.equal(install.description,
|
|
323
|
+
assert.equal(install.description, "Install the latest stable Pi globally with pnpm for Gentle Shell. The Pi 0.99.0 already on this computer " +
|
|
324
324
|
"was not installed with pnpm or npm, so it is left unchanged. Gentle Shell uses the installer's Pi; the `pi` command in a terminal may still run the older one.");
|
|
325
325
|
assert.deepEqual(runs, []);
|
|
326
326
|
} finally {
|
|
@@ -328,14 +328,14 @@ test("/api/plan installs the installer's Pi alongside an older Pi that neither p
|
|
|
328
328
|
}
|
|
329
329
|
});
|
|
330
330
|
|
|
331
|
-
test("/api/plan shows an older Pi's update with its found
|
|
331
|
+
test("/api/plan shows an older Pi's update to latest stable with its found version and package manager, before consent", async () => {
|
|
332
332
|
for (const owner of ["pnpm", "npm"]) {
|
|
333
333
|
const { host, port, login, runs } = await start({ collect: async () => collected({ pi: { available: true, version: "0.87.1", usable: true, owner } }) });
|
|
334
334
|
try {
|
|
335
335
|
const view = await plan(port, await login());
|
|
336
336
|
assert.deepEqual(view.blockers, []);
|
|
337
337
|
const update = view.actions.find((action: { id: string }) => action.id === "update-pi");
|
|
338
|
-
assert.equal(update.description, `Update Pi 0.87.1 to
|
|
338
|
+
assert.equal(update.description, `Update Pi 0.87.1 to the latest stable version with ${owner}, the package manager that installed it. ` +
|
|
339
339
|
`Gentle Shell needs Pi ${requirements.pi} or newer.`);
|
|
340
340
|
assert.ok(view.actions.findIndex((action: { id: string }) => action.id === "update-pi") <
|
|
341
341
|
view.actions.findIndex((action: { id: string }) => action.id === "install-shell"));
|
|
@@ -474,27 +474,30 @@ test("/api/plan explains a Pi whose version cannot be read", async () => {
|
|
|
474
474
|
}
|
|
475
475
|
});
|
|
476
476
|
|
|
477
|
-
test("/api/plan says
|
|
478
|
-
// A newer Pi
|
|
479
|
-
const { host, port, login } = await start({ collect: async () => collected({ pi: { available: true, version: "1.
|
|
477
|
+
test("/api/plan keeps a compatible Pi and says pnpm may put another next to Gentle Shell, at least the minimum", async () => {
|
|
478
|
+
// A newer compatible Pi is kept as it is; pnpm may install a different peer beside Shell.
|
|
479
|
+
const { host, port, login, runs } = await start({ collect: async () => collected({ pi: { available: true, version: "1.8.0", usable: true } }) });
|
|
480
480
|
try {
|
|
481
481
|
const view = await plan(port, await login());
|
|
482
482
|
assert.deepEqual(view.blockers, []);
|
|
483
483
|
assert.equal(view.actions.find((action: { id: string }) => action.id === "install-shell").description,
|
|
484
|
-
|
|
484
|
+
"Install Gentle Shell (gentle-pi) globally with pnpm. pnpm may put another Pi next to it " +
|
|
485
485
|
`(at least Pi ${requirements.pi}), and Gentle Shell runs that Pi.`);
|
|
486
|
+
assert.equal(view.actions.some((action: { id: string }) => action.id === "install-pi" || action.id === "update-pi"), false);
|
|
487
|
+
assert.deepEqual(runs, []);
|
|
486
488
|
} finally {
|
|
487
489
|
await host.close("test");
|
|
488
490
|
}
|
|
489
491
|
});
|
|
490
492
|
|
|
491
|
-
test("the outcome says which Pi Gentle Shell runs
|
|
493
|
+
test("the outcome says which Pi Gentle Shell runs whenever a valid version is reported", async () => {
|
|
492
494
|
const cases: [object, string][] = [
|
|
493
495
|
[{ outcome: "ready", completed: [], piVersion: "1.1.0" }, `${guidance.outcomes.ready} Gentle Shell runs Pi 1.1.0, which pnpm installed next to it.`],
|
|
494
496
|
[{ outcome: "terminal-action-required", action: "open-new-terminal", completed: [], piVersion: "1.1.0" },
|
|
495
497
|
`${guidance.outcomes["terminal-action-required"]} Gentle Shell runs Pi 1.1.0, which pnpm installed next to it.`],
|
|
496
498
|
[{ outcome: "ready", completed: [] }, guidance.outcomes.ready],
|
|
497
|
-
[{ outcome: "ready", completed: [], piVersion: PI_INSTALL_VERSION },
|
|
499
|
+
[{ outcome: "ready", completed: [], piVersion: PI_INSTALL_VERSION },
|
|
500
|
+
`${guidance.outcomes.ready} Gentle Shell runs Pi ${PI_INSTALL_VERSION}, which pnpm installed next to it.`],
|
|
498
501
|
[{ outcome: "ready", completed: [], piVersion: "1.1.0 <script>" }, guidance.outcomes.ready],
|
|
499
502
|
];
|
|
500
503
|
for (const [result, expected] of cases) {
|