gentle-pi 4.5.1 → 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 +17 -15
- package/assets/agents/gentle-ai-explore.md +1 -0
- package/assets/agents/gentle-ai-verify.md +8 -1
- package/assets/agents/gentle-ai-worker.md +4 -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 +162 -0
- package/assets/orchestrator-delegation-reference.md +7 -7
- package/assets/orchestrator-delegation.md +3 -3
- 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 +14 -8
- package/assets/orchestrator.md +11 -11
- package/bin/gentle-shell.mjs +225 -82
- package/docs/agent-status.md +61 -0
- package/docs/bundled-install.md +7 -5
- package/docs/ci-performance.md +11 -0
- package/docs/delegated-verification.md +35 -7
- package/docs/fast-mode.md +15 -0
- package/docs/gentle-agents-activity.md +22 -0
- package/docs/gentle-shell.md +113 -25
- package/docs/install-wizard.md +2 -2
- package/docs/mcp-status.md +52 -0
- package/docs/permission-modes.md +9 -4
- package/docs/prompt-budget.md +28 -0
- package/docs/readme-reference.md +154 -50
- 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/session-profile-format.md +20 -5
- package/docs/sound-notifications.md +1 -1
- package/docs/star-prompt.md +32 -0
- package/docs/voice.md +6 -3
- package/docs/work-continuity.md +46 -0
- package/docs/yolo-mode.md +5 -5
- package/extensions/ask-user-choice.ts +1 -0
- package/extensions/ask-user-question.ts +2 -0
- package/extensions/child-safety.ts +3 -0
- package/extensions/codegraph-tools.ts +38 -4
- package/extensions/gentle-agent-status.ts +99 -0
- package/extensions/gentle-agents.ts +803 -84
- package/extensions/gentle-ai.ts +2491 -596
- package/extensions/gentle-fast.ts +61 -0
- package/extensions/gentle-guide.ts +174 -0
- package/extensions/gentle-herdr-activity.ts +21 -1
- package/extensions/gentle-herdr-agent.ts +144 -0
- package/extensions/gentle-program-identity.ts +61 -0
- package/extensions/gentle-shell.ts +895 -120
- package/extensions/gentle-star-prompt.ts +334 -0
- package/extensions/gentle-stats.ts +5 -5
- package/extensions/gentle-todo.ts +59 -23
- package/extensions/gentle-tps.ts +48 -0
- package/extensions/history/store.ts +18 -12
- package/extensions/quiet-tools.ts +38 -8
- package/extensions/skill-registry.ts +210 -21
- package/extensions/startup-banner.ts +69 -10
- package/lib/agent-assets.ts +74 -17
- package/lib/agent-profile-pin.ts +3 -3
- package/lib/agent-profiles.ts +161 -3
- package/lib/agent-status.ts +105 -0
- package/lib/agents-config.ts +58 -3
- package/lib/agents-history.ts +24 -5
- package/lib/agents-keys.ts +8 -16
- package/lib/agents-messaging.ts +47 -5
- package/lib/agents-protocol.ts +80 -4
- package/lib/agents-runner.ts +287 -15
- package/lib/agents-view.ts +6 -1
- package/lib/agents-widget.ts +132 -9
- package/lib/auto-permission-runtime.ts +1 -1
- package/lib/bounded-writer-admission.ts +13 -1
- package/lib/bridge-cost.ts +28 -0
- package/lib/card-content-policy.ts +8 -6
- package/lib/codemode-renderer.ts +16 -0
- package/lib/command-palette-catalog.ts +1 -0
- package/lib/command-palette.ts +154 -25
- 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 +64 -0
- package/lib/gentle-ai-binary.ts +1 -1
- package/lib/gentle-design.ts +3 -0
- package/lib/gentle-guide.ts +201 -0
- package/lib/gentle-shell-bundled.ts +6 -19
- package/lib/gentle-shell-launcher.ts +47 -8
- package/lib/herdr-activity.ts +23 -5
- package/lib/herdr-busy.ts +45 -0
- package/lib/herdr-task-summary-policy.ts +85 -0
- package/lib/image-attachments.ts +33 -0
- package/lib/image-disk-cache.ts +137 -0
- package/lib/inprocess-reviewer.ts +282 -132
- package/lib/jobs-sidebar-state.ts +5 -6
- package/lib/jobs-view.ts +198 -11
- package/lib/jobs-widget.ts +16 -52
- package/lib/keymaps-customize.ts +81 -0
- package/lib/keymaps.ts +291 -0
- package/lib/model-fallback-notice.ts +61 -0
- package/lib/model-fallback-policy.ts +141 -0
- package/lib/model-fallback-store.ts +143 -0
- package/lib/model-routing-authority.ts +32 -6
- package/lib/nan-provider.ts +3 -2
- package/lib/native-choice-list.ts +20 -2
- package/lib/native-review-cli.ts +103 -21
- package/lib/notification-customize.ts +48 -51
- package/lib/openai-fast-tier.ts +22 -0
- package/lib/orchestrator-discovery.ts +5 -1
- package/lib/orchestrator-fallback.ts +75 -0
- package/lib/orchestrator-mode-policy.ts +105 -0
- package/lib/pasted-image-paths.ts +113 -0
- package/lib/questionnaire/questionnaire-view.ts +225 -18
- 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 +85 -44
- package/lib/review-candidate-view.ts +10 -7
- 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 +51 -11
- package/lib/review-integration-v2.ts +29 -8
- package/lib/review-relay-phase-timing.ts +45 -0
- package/lib/review-repository.ts +5 -0
- package/lib/review-start-context.ts +17 -0
- package/lib/session-profile-append-controller.ts +21 -6
- package/lib/session-profile-authority.ts +119 -0
- package/lib/session-profile-binding.ts +54 -5
- package/lib/session-profile-freeze.ts +107 -9
- package/lib/session-profile-integration.ts +313 -0
- package/lib/session-profile-persistence.ts +63 -9
- package/lib/shell-bar.ts +269 -72
- package/lib/shell-card.ts +26 -6
- package/lib/shell-changes.ts +2 -0
- package/lib/shell-page.ts +120 -0
- package/lib/shell-panel.ts +163 -0
- package/lib/shell-prompt.ts +53 -1
- package/lib/shell-sidebar-layout.ts +198 -53
- package/lib/shell-sidebar.ts +61 -1
- package/lib/shell-stats.ts +123 -0
- package/lib/shell-todo.ts +79 -1
- package/lib/shell-usage.ts +12 -2
- package/lib/star-prompt.ts +197 -0
- package/lib/verifier-admission.ts +18 -8
- package/lib/verifier-settle-reminder.ts +64 -0
- package/lib/vim-editor-adapter.ts +6 -1
- package/lib/visual-customization-policy.ts +67 -12
- package/lib/visual-customize-view.ts +373 -40
- package/lib/visual-layout-preview.ts +47 -0
- package/lib/visual-profiles.ts +2 -2
- package/lib/windows-session-transport.ts +53 -2
- package/lib/yolo-session-policy.ts +68 -16
- 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 +46 -7
- package/runtime/native-review-cli.mjs +100 -18
- package/runtime/review-integration-v2.mjs +29 -8
- package/runtime/windows-session-transport.ps1 +60 -3
- package/scripts/bootstrap.sh +4 -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 +6 -6
- package/scripts/installer-runner.mjs +27 -12
- package/scripts/installer-server.mjs +8 -7
- package/scripts/pi-update.mjs +113 -3
- 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 +41 -13
- package/scripts/shell-snapshot.mjs +340 -0
- package/scripts/test-packed-runner.mjs +1 -1
- package/scripts/update-agent-body-history.mjs +41 -0
- package/scripts/verify-installer-tap.mjs +45 -0
- package/scripts/verify-package-files.mjs +14 -2
- package/scripts/voice-worker.cjs +32 -6
- package/skills/design/SKILL.md +11 -8
- package/skills/gentle-ai/SKILL.md +4 -4
- 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/tui-design/NOTICE.md +5 -0
- package/skills/tui-design/SKILL.md +56 -0
- package/skills/tui-design/references/commands.md +75 -0
- package/skills/tui-design/references/critique.md +48 -0
- package/skills/tui-design/references/design-doc.md +44 -0
- package/skills/tui-design/references/terminal-craft.md +64 -0
- package/skills/tui-design/references/visual-loop.md +32 -0
- 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-protocol.test.ts +53 -1
- package/tests/agents-runner-drain.test.ts +193 -0
- package/tests/agents-runner.test.ts +345 -4
- package/tests/agents-view.test.ts +27 -0
- package/tests/agents-widget.test.ts +312 -10
- 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-scan-contract.test.ts +39 -0
- package/tests/bounded-stop-contract.test.ts +43 -3
- package/tests/bridge-cost.test.ts +47 -0
- package/tests/bundled-install.test.ts +36 -9
- 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/ci-concurrency.test.ts +11 -0
- package/tests/ci-merge-base-identity.test.ts +114 -0
- package/tests/codegraph-tools.test.ts +80 -5
- package/tests/codemode-rendering.test.ts +22 -2
- package/tests/command-palette.test.ts +300 -3
- package/tests/commit-slice-signal.test.ts +11 -9
- package/tests/delegate-for-reason-contract.test.ts +8 -7
- 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/exploration-budget.test.ts +128 -0
- package/tests/fixtures/agent-assets/gentle-ai-worker.strict-tdd-era.md +122 -0
- package/tests/fixtures/measure-orchestrator-prompt.mjs +2 -1
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +26 -14
- 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 +172 -0
- package/tests/fixtures/session-profile-v1/session-profile-authority.ts +113 -0
- package/tests/fixtures/session-profile-v1/session-profile-binding.ts +83 -0
- package/tests/fixtures/session-profile-v1/session-profile-disk-reader.ts +182 -0
- package/tests/fixtures/session-profile-v1/session-profile-freeze.ts +290 -0
- package/tests/fixtures/session-profile-v1/session-profile-persistence.ts +195 -0
- package/tests/fixtures/session-profile-v1/v1-inputs.ts +16 -0
- package/tests/fixtures/windows-pipe-availability.ps1 +26 -0
- package/tests/fixtures/windows-session-bootstrap.ps1 +6 -2
- 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 +1491 -38
- 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 +151 -0
- package/tests/gentle-ai-installer.test.ts +134 -51
- package/tests/gentle-ai-proxy.test.ts +434 -0
- package/tests/gentle-ai.test.ts +1101 -52
- package/tests/gentle-design.test.ts +21 -0
- package/tests/gentle-fast.test.ts +73 -0
- package/tests/gentle-guide.test.ts +208 -0
- package/tests/gentle-herdr-activity.test.ts +80 -3
- package/tests/gentle-herdr-agent.test.ts +111 -0
- package/tests/gentle-program-identity.test.ts +197 -0
- package/tests/gentle-shell-bin.test.ts +172 -26
- package/tests/gentle-shell-bundled.test.ts +207 -31
- package/tests/gentle-shell-launcher.test.ts +93 -10
- package/tests/gentle-shell.test.ts +1937 -66
- package/tests/gentle-stats.test.ts +15 -2
- package/tests/gentle-todo.test.ts +67 -4
- 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 +132 -0
- package/tests/history-store-private-mode.test.ts +40 -0
- package/tests/image-disk-cache.test.ts +163 -0
- package/tests/image-paste-chips.test.ts +42 -0
- package/tests/independent-recovery-delivery.test.ts +83 -0
- package/tests/inprocess-reviewer.test.ts +298 -4
- package/tests/installer-posix-bootstrap.test.ts +68 -6
- 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/installer-windows-diagnostics.test.ts +4 -5
- package/tests/isolated-config-home.ts +28 -0
- package/tests/jobs-view.test.ts +260 -6
- package/tests/jobs-widget.test.ts +25 -37
- package/tests/keymaps-customize.test.ts +114 -0
- package/tests/keymaps.test.ts +103 -0
- package/tests/maintainer/mcp-status.maintest.ts +88 -0
- package/tests/maintainer/pi-update-source.maintest.ts +116 -0
- package/tests/modal-mouse-boundaries.test.ts +136 -0
- package/tests/model-fallback-notice.test.ts +45 -0
- package/tests/model-fallback-policy.test.ts +83 -0
- package/tests/model-fallback-store.test.ts +111 -0
- package/tests/model-routing-authority.test.ts +178 -2
- package/tests/nan-provider.test.ts +4 -4
- 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 +22 -0
- package/tests/notification-customize.test.ts +58 -34
- package/tests/odd-routing-canonical-ratchet.test.ts +6 -6
- package/tests/odd-routing-contract.test.ts +1 -1
- package/tests/orchestrator-budget.test.ts +7 -2
- package/tests/orchestrator-delegation-mode.test.ts +153 -0
- package/tests/orchestrator-fallback.test.ts +82 -0
- package/tests/orchestrator-mode-policy.test.ts +175 -0
- package/tests/orchestrator-prompt-budget.test.ts +133 -0
- package/tests/orchestrator-rdd-ownership.test.ts +2 -2
- package/tests/package-manifest.test.ts +169 -14
- package/tests/pasted-image-paths.test.ts +118 -0
- package/tests/permission-allowlist.test.ts +202 -0
- package/tests/persona-reply-language.test.ts +20 -1
- package/tests/pi-update-launcher.test.ts +40 -8
- package/tests/pi-update-source.test.ts +162 -0
- package/tests/pnpm-workspace-config.test.ts +58 -0
- package/tests/primary-session-prompt.test.ts +13 -0
- package/tests/profile-fast-tier.test.ts +311 -0
- package/tests/profile-pin.test.ts +29 -2
- package/tests/profile-tier-footer.test.ts +84 -0
- package/tests/profiles-panel-delegation-mode.test.ts +422 -0
- package/tests/questionnaire-view.test.ts +265 -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-owner-sweep.test.ts +93 -0
- package/tests/review-candidate-symlink-scan.test.ts +157 -0
- package/tests/review-candidate-view.test.ts +52 -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 +381 -11
- 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-gate.test.ts +24 -0
- package/tests/review-host-relay-routing.test.ts +258 -4
- package/tests/review-host-relay.test.ts +39 -0
- package/tests/review-inspect-preflight.test.ts +197 -0
- package/tests/review-integration-v2-forward.test.ts +59 -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-repository.test.ts +52 -1
- 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-sidebar-state.test.ts +5 -5
- 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 +183 -6
- package/tests/runtime-harness.mjs +4 -1
- package/tests/sensitive-path-tools.test.ts +250 -0
- package/tests/session-profile-append-controller-pi.test.ts +60 -31
- package/tests/session-profile-append-controller.test.ts +63 -0
- package/tests/session-profile-authority.test.ts +259 -0
- package/tests/session-profile-binding.test.ts +34 -1
- package/tests/session-profile-disk-reader-pi.test.ts +58 -16
- package/tests/session-profile-extension.test.ts +615 -0
- package/tests/session-profile-freeze.test.ts +110 -2
- package/tests/session-profile-integration.test.ts +857 -0
- package/tests/session-profile-persistence.test.ts +57 -0
- package/tests/session-profile-v1-compat.test.ts +255 -0
- package/tests/shell-bar.test.ts +274 -72
- package/tests/shell-card.test.ts +13 -1
- package/tests/shell-page.test.ts +108 -0
- package/tests/shell-panel.test.ts +360 -0
- package/tests/shell-prompt.test.ts +54 -0
- package/tests/shell-render-cache.test.ts +5 -0
- package/tests/shell-sidebar-fullscreen.test.ts +13 -1
- package/tests/shell-sidebar-layout.test.ts +447 -44
- package/tests/shell-sidebar-scroll-benchmark.test.ts +1 -1
- package/tests/shell-stats.test.ts +90 -0
- package/tests/shell-surface-transparent.test.ts +89 -0
- package/tests/shell-todo.test.ts +12 -0
- package/tests/shell-usage.test.ts +14 -0
- package/tests/skill-registry.test.ts +902 -2
- package/tests/star-prompt.test.ts +470 -0
- package/tests/startup-banner.test.ts +209 -2
- 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 +50 -4
- package/tests/verifier-admission.test.ts +49 -0
- package/tests/verifier-settle-reminder.test.ts +281 -0
- package/tests/verify-first-launch-contract.test.ts +134 -8
- package/tests/verify-installer-tap.test.ts +57 -0
- package/tests/vim-editor-adapter.test.ts +2 -2
- package/tests/visual-customization-policy.test.ts +95 -8
- package/tests/visual-customize-view.test.ts +818 -9
- package/tests/visual-layout-preview.test.ts +42 -0
- package/tests/visual-profiles.test.ts +11 -0
- package/tests/voice-worker.test.ts +73 -2
- package/tests/windows-session-bootstrap.test.ts +105 -2
- package/tests/windows-session-transport.test.ts +126 -0
- package/tests/work-continuity-contract.test.ts +114 -0
- package/tests/writer-feature-document-admission.test.ts +92 -0
- package/tests/writer-surfaces.test.ts +12 -10
- package/tests/yolo-customize.test.ts +57 -15
- package/tests/yolo-mode-runtime.test.ts +4 -2
- package/tests/yolo-mode.test.ts +39 -20
- package/tests/yolo-session-policy.test.ts +270 -1
|
@@ -46,6 +46,7 @@ export const blockedReasons = Object.freeze([
|
|
|
46
46
|
/** Every `failedStep` a `failed` outcome can carry (for host guidance; no behavior). */
|
|
47
47
|
export const failedSteps = Object.freeze([
|
|
48
48
|
"prepare-pnpm-home",
|
|
49
|
+
"resolve-pi-version",
|
|
49
50
|
"persist-node",
|
|
50
51
|
"persist-package-managers",
|
|
51
52
|
"persist-npm",
|
|
@@ -101,7 +102,7 @@ const knownActions = Object.freeze({
|
|
|
101
102
|
"record-channel": { kind: "configure", target: "channel" },
|
|
102
103
|
"update-shell-release": { kind: "upgrade", target: "shell" },
|
|
103
104
|
"update-shell-main": { kind: "upgrade", target: "shell" },
|
|
104
|
-
"update-pi": { kind: "upgrade", target: "pi", version:
|
|
105
|
+
"update-pi": { kind: "upgrade", target: "pi", version: "latest" },
|
|
105
106
|
});
|
|
106
107
|
// The clean-stack path: both global packages are missing.
|
|
107
108
|
const requiredActions = ["install-pi", "install-shell", "setup-shell", "verify-readiness"];
|
|
@@ -601,7 +602,7 @@ function noExistingStack(stdout) {
|
|
|
601
602
|
* only Gentle Shell was added), and that runnable Pi (runnablePi) must exist;
|
|
602
603
|
* other projects (such as the persisted npm and pnpm) are ignored.
|
|
603
604
|
*/
|
|
604
|
-
async function verifiedPackageRoot(stdout, pnpmHome, platform, fs, shellVersion = requirements.shell, requirePi = true) {
|
|
605
|
+
async function verifiedPackageRoot(stdout, pnpmHome, platform, fs, shellVersion = requirements.shell, requirePi = true, expectedPi = PI_INSTALL_VERSION) {
|
|
605
606
|
const path = platform === "win32" ? win32 : posix;
|
|
606
607
|
const projects = JSON.parse(stdout);
|
|
607
608
|
if (!Array.isArray(projects)) return null;
|
|
@@ -610,7 +611,7 @@ async function verifiedPackageRoot(stdout, pnpmHome, platform, fs, shellVersion
|
|
|
610
611
|
if (!plainObject(dependencies)) return null;
|
|
611
612
|
const pi = dependencies[PI_PACKAGE];
|
|
612
613
|
const shell = dependencies[SHELL_PACKAGE];
|
|
613
|
-
if ((requirePi && pi?.version !==
|
|
614
|
+
if ((requirePi && (stable(expectedPi) === null || pi?.version !== expectedPi)) || shell?.version !== shellVersion) return null;
|
|
614
615
|
if (typeof shell.path !== "string" || !path.isAbsolute(shell.path)) return null;
|
|
615
616
|
const [root, home] = [await fs.realpath(shell.path), await fs.realpath(pnpmHome)];
|
|
616
617
|
if (!contains(home, root, platform)) return null;
|
|
@@ -906,6 +907,7 @@ export async function runStandardInstall(request, adapters) {
|
|
|
906
907
|
let runsPi = null;
|
|
907
908
|
let persistentNode = null;
|
|
908
909
|
let npmPrefix = null;
|
|
910
|
+
let piVersion = null;
|
|
909
911
|
// One add of only the missing managers (fixed versions only: never a blanket build approval).
|
|
910
912
|
const addOnly = ids.find((id) => ["persist-package-managers", "persist-npm", "persist-pnpm"].includes(id));
|
|
911
913
|
const addManagers = [addOnly, async () => succeeded(await runPnpm(["add", "-g", ...(addNpm ? [`npm@${persistencePins.npm}`] : []),
|
|
@@ -931,7 +933,7 @@ export async function runStandardInstall(request, adapters) {
|
|
|
931
933
|
// from the same owner at the target version, never a downgrade.
|
|
932
934
|
const piSteps = updatingPi ? [
|
|
933
935
|
["update-pi", async () => {
|
|
934
|
-
const spec = `${PI_PACKAGE}@${
|
|
936
|
+
const spec = `${PI_PACKAGE}@${piVersion}`;
|
|
935
937
|
const result = installedPi.owner === "npm"
|
|
936
938
|
? await adapters.run(npmCommand.command, [...npmCommand.prefix, "install", "-g", spec], { env, deadlineMs: deadlines.install })
|
|
937
939
|
: await runPnpm(["add", "-g", spec], deadlines.install);
|
|
@@ -940,7 +942,7 @@ export async function runStandardInstall(request, adapters) {
|
|
|
940
942
|
["verify-updated-pi", async () => {
|
|
941
943
|
const after = await adapters.locatePi();
|
|
942
944
|
if (!after || after.owner !== installedPi.owner || typeof after.root !== "string" || !path.isAbsolute(after.root)) return false;
|
|
943
|
-
if (
|
|
945
|
+
if (after.version !== piVersion) return false;
|
|
944
946
|
// npm replaces the package in place; pnpm 11 moves it to a new global directory.
|
|
945
947
|
return after.owner === "pnpm" || samePath(after.root, installedPi.root, platform);
|
|
946
948
|
}],
|
|
@@ -972,7 +974,7 @@ export async function runStandardInstall(request, adapters) {
|
|
|
972
974
|
] : [];
|
|
973
975
|
// Pi and gentle-pi stay separate pnpm groups, so `pi update` (which replaces Pi's
|
|
974
976
|
// own group) never removes gentle-pi; gentle-pi gets pnpm's peer Pi beside it.
|
|
975
|
-
const install = ["install-global", () => addGlobal([...(shellOnly ? [] : [`${PI_PACKAGE}@${
|
|
977
|
+
const install = ["install-global", () => addGlobal([...(shellOnly ? [] : [`${PI_PACKAGE}@${piVersion}`]),
|
|
976
978
|
`${SHELL_PACKAGE}@${requirements.shell}`, `--allow-build=${SHELL_PACKAGE}`], buildEnv())];
|
|
977
979
|
function mainSteps() {
|
|
978
980
|
const channel = adapters.mainChannel;
|
|
@@ -996,7 +998,7 @@ export async function runStandardInstall(request, adapters) {
|
|
|
996
998
|
const result = await list();
|
|
997
999
|
if (!succeeded(result)) return false;
|
|
998
1000
|
const verified = await verifiedPackageRoot(String(result.stdout ?? ""), globalBin.pnpmHome, platform, adapters.fs,
|
|
999
|
-
mainVersion(requirements.shell, shellCommit), !shellOnly);
|
|
1001
|
+
mainVersion(requirements.shell, shellCommit), !shellOnly, piVersion);
|
|
1000
1002
|
if (verified === null) return false;
|
|
1001
1003
|
({ root: packageRoot, pi: runsPi } = verified);
|
|
1002
1004
|
return true;
|
|
@@ -1016,7 +1018,8 @@ export async function runStandardInstall(request, adapters) {
|
|
|
1016
1018
|
["verify-global-list", async () => {
|
|
1017
1019
|
const result = await list();
|
|
1018
1020
|
if (!succeeded(result)) return false;
|
|
1019
|
-
const verified = await verifiedPackageRoot(String(result.stdout ?? ""), globalBin.pnpmHome, platform, adapters.fs, requirements.shell, !shellOnly
|
|
1021
|
+
const verified = await verifiedPackageRoot(String(result.stdout ?? ""), globalBin.pnpmHome, platform, adapters.fs, requirements.shell, !shellOnly,
|
|
1022
|
+
recovering ? PI_INSTALL_VERSION : piVersion);
|
|
1020
1023
|
if (verified === null) return false;
|
|
1021
1024
|
({ root: packageRoot, pi: runsPi } = verified);
|
|
1022
1025
|
return true;
|
|
@@ -1043,7 +1046,7 @@ export async function runStandardInstall(request, adapters) {
|
|
|
1043
1046
|
const setupStep = steps.find(([name]) => name === "shell-setup");
|
|
1044
1047
|
steps.splice(0, steps.length,
|
|
1045
1048
|
...goSteps,
|
|
1046
|
-
...(ids.includes("install-pi") ? [["install-pi", async () => succeeded(await runPnpm(["add", "-g", `${PI_PACKAGE}@${
|
|
1049
|
+
...(ids.includes("install-pi") ? [["install-pi", async () => succeeded(await runPnpm(["add", "-g", `${PI_PACKAGE}@${piVersion}`], deadlines.install))]] : []),
|
|
1047
1050
|
...piSteps,
|
|
1048
1051
|
["update-shell", withMainDetail(async () => (await adapters.upgradeShell({ channel, packageRoot: installed.root, currentVersion: installed.version,
|
|
1049
1052
|
...(pinnedGo ? { goPath: pinnedGo } : {}) })) === true)],
|
|
@@ -1069,14 +1072,26 @@ export async function runStandardInstall(request, adapters) {
|
|
|
1069
1072
|
if (piOnly) {
|
|
1070
1073
|
// The installer's Pi alone: the same `add -g` as install-pi, then found in pnpm's list.
|
|
1071
1074
|
steps.splice(0, steps.length, ...(updatingPi ? piSteps : [
|
|
1072
|
-
["install-pi", async () => succeeded(await runPnpm(["add", "-g", `${PI_PACKAGE}@${
|
|
1075
|
+
["install-pi", async () => succeeded(await runPnpm(["add", "-g", `${PI_PACKAGE}@${piVersion}`], deadlines.install))],
|
|
1073
1076
|
["verify-installed-pi", async () => {
|
|
1074
1077
|
const after = await adapters.locatePi();
|
|
1075
1078
|
return after?.owner === "pnpm" && typeof after.root === "string" && path.isAbsolute(after.root) &&
|
|
1076
|
-
|
|
1079
|
+
after.version === piVersion;
|
|
1077
1080
|
}],
|
|
1078
1081
|
]));
|
|
1079
1082
|
}
|
|
1083
|
+
if (ids.includes("install-pi") || updatingPi) {
|
|
1084
|
+
// Resolve before any package/runtime installation; never trust registry output
|
|
1085
|
+
// as an argument until it is an exact stable version meeting the minimum.
|
|
1086
|
+
steps.unshift(["resolve-pi-version", async () => {
|
|
1087
|
+
const result = await runPnpm(["view", `${PI_PACKAGE}@latest`, "version"], deadlines.probe);
|
|
1088
|
+
const version = String(result.stdout ?? "").trim();
|
|
1089
|
+
if (!succeeded(result) || result.truncated === true || !atLeast(version, requirements.pi) ||
|
|
1090
|
+
(installedPi && !atLeast(version, installedPi.version))) return false;
|
|
1091
|
+
piVersion = version;
|
|
1092
|
+
return true;
|
|
1093
|
+
}]);
|
|
1094
|
+
}
|
|
1080
1095
|
const persistPath = !globalBin.onPath && (privateHome || (!update && !piOnly));
|
|
1081
1096
|
if (persistPath) {
|
|
1082
1097
|
steps.push(["persist-path", async () => {
|
|
@@ -1096,7 +1111,7 @@ export async function runStandardInstall(request, adapters) {
|
|
|
1096
1111
|
log({ step, status: "done" });
|
|
1097
1112
|
}
|
|
1098
1113
|
// Reported only when Gentle Shell runs a Pi other than the installer's.
|
|
1099
|
-
const prefix = { ...(persistRuntime ? { npmPrefix } : {}), ...(runsPi !== null && runsPi !== PI_INSTALL_VERSION ? { piVersion: runsPi } : {}) };
|
|
1114
|
+
const prefix = { ...(persistRuntime ? { npmPrefix } : {}), ...(runsPi !== null && runsPi !== (piVersion ?? request.plan.tools.pi.version ?? PI_INSTALL_VERSION) ? { piVersion: runsPi } : {}) };
|
|
1100
1115
|
if (persistPath) return { outcome: "terminal-action-required", action: "open-new-terminal", completed, ...prefix };
|
|
1101
1116
|
return { outcome: "ready", completed, ...prefix };
|
|
1102
1117
|
}
|
|
@@ -2,7 +2,7 @@ import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { goAcquisition, requirements } from "./installer-preflight.mjs";
|
|
6
6
|
|
|
7
7
|
// Local wizard host: a dependency-free loopback HTTP server with a fixed route
|
|
8
8
|
// allowlist. The browser never sends commands, paths, plans or environment:
|
|
@@ -71,8 +71,8 @@ export const actionDescriptions = Object.freeze({
|
|
|
71
71
|
"persist-pnpm": "Install pnpm under PNPM_HOME with `pnpm add -g`.",
|
|
72
72
|
"acquire-go": "Download the installer's pinned Go from go.dev and verify it, only to build Gentle AI.",
|
|
73
73
|
"verify-go": "Check that the downloaded Go runs and reports the pinned version.",
|
|
74
|
-
"install-pi": "
|
|
75
|
-
"install-shell": `Install Gentle Shell (gentle-pi) globally with pnpm. pnpm may put
|
|
74
|
+
"install-pi": "Resolve the latest stable Pi and install that exact version globally with pnpm.",
|
|
75
|
+
"install-shell": `Install Gentle Shell (gentle-pi) globally with pnpm. pnpm may put another Pi next to it ` +
|
|
76
76
|
`(at least Pi ${requirements.pi}), and Gentle Shell runs that Pi.`,
|
|
77
77
|
"provision-native": "Provision the package-native Gentle AI binary with the existing installer.",
|
|
78
78
|
"setup-shell": "Run the normal `gentle-shell setup`.",
|
|
@@ -135,6 +135,7 @@ export const guidance = Object.freeze({
|
|
|
135
135
|
"build-gentle-ai-main": `Gentle AI could not be built from its latest \`main\` commit. Check your network connection and that \`go\` runs in a terminal. ${tryAgain}`,
|
|
136
136
|
"install-shell-main": `Gentle Shell could not be installed from its latest \`main\` commit. Check your network connection. ${tryAgain}`,
|
|
137
137
|
"record-channel": "Gentle Shell is installed from `main`, but the channel could not be saved under `~/.pi/gentle-ai`. Check that folder's permissions, then run the installer again.",
|
|
138
|
+
"resolve-pi-version": `The latest stable Pi could not be resolved or did not meet the minimum. No packages were installed. Check your network connection. ${tryAgain}`,
|
|
138
139
|
"install-pi": `Installing Pi with pnpm failed. Your existing Gentle Shell was not changed. Check your network connection. ${tryAgain}`,
|
|
139
140
|
"update-shell": "Updating Gentle Shell failed. Run `gentle-shell upgrade` in a terminal to see the details.",
|
|
140
141
|
"verify-updated-shell": "Gentle Shell did not report the expected version after the update. Run `gentle-shell --version`, then `gentle-shell upgrade` in a terminal.",
|
|
@@ -351,12 +352,12 @@ function actionDescription(action, plan) {
|
|
|
351
352
|
const pi = plan.tools?.pi;
|
|
352
353
|
const stable = (...versions) => versions.every((version) => typeof version === "string" && STABLE.test(version));
|
|
353
354
|
const bare = (version) => version.replace(/^v/, "");
|
|
354
|
-
if (action.id === "update-pi" && ["pnpm", "npm"].includes(pi?.owner) && stable(pi.version, pi.required
|
|
355
|
-
return `Update Pi ${bare(pi.version)} to
|
|
355
|
+
if (action.id === "update-pi" && action.version === "latest" && ["pnpm", "npm"].includes(pi?.owner) && stable(pi.version, pi.required)) {
|
|
356
|
+
return `Update Pi ${bare(pi.version)} to the latest stable version with ${pi.owner}, the package manager that installed it. ` +
|
|
356
357
|
`Gentle Shell needs Pi ${bare(pi.required)} or newer.`;
|
|
357
358
|
}
|
|
358
359
|
if (action.id === "install-pi" && pi?.status === "needs-install" && stable(pi.version)) {
|
|
359
|
-
return `Install Pi
|
|
360
|
+
return `Install the latest stable Pi globally with pnpm for Gentle Shell. The Pi ${bare(pi.version)} already on this computer ` +
|
|
360
361
|
"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.";
|
|
361
362
|
}
|
|
362
363
|
// The pinned Go: its version, the Go found (older, unchecked or missing), and what stays unchanged.
|
|
@@ -558,7 +559,7 @@ function outcomeView(result) {
|
|
|
558
559
|
} else {
|
|
559
560
|
view.guidance = guidance.outcomes[result.outcome];
|
|
560
561
|
// The Pi Gentle Shell runs, when pnpm put one other than the installer's next to it.
|
|
561
|
-
if (typeof result.piVersion === "string" && STABLE.test(result.piVersion)
|
|
562
|
+
if (typeof result.piVersion === "string" && STABLE.test(result.piVersion)) {
|
|
562
563
|
view.guidance += ` Gentle Shell runs Pi ${result.piVersion.replace(/^v/, "")}, which pnpm installed next to it.`;
|
|
563
564
|
}
|
|
564
565
|
if (result.action === "open-new-terminal") view.action = "open-new-terminal";
|
package/scripts/pi-update.mjs
CHANGED
|
@@ -154,6 +154,88 @@ function mainBuildTarball(version, {env, home, path}) {
|
|
|
154
154
|
return path.join(config, 'main', 'packages', `${SHELL}-${version}.tgz`);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
function managerVersionAtLeast(actual, minimum) {
|
|
158
|
+
if (!/^\d+\.\d+\.\d+$/.test(actual)) return false;
|
|
159
|
+
const current = actual.split('.').map(Number), required = minimum.split('.').map(Number);
|
|
160
|
+
for (let i = 0; i < current.length; i++) {
|
|
161
|
+
if (current[i] !== required[i]) return current[i] > required[i];
|
|
162
|
+
}
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async function optionalFile(fs, file) {
|
|
167
|
+
try { return String(await fs.readFile(file, 'utf8')); }
|
|
168
|
+
catch (error) { if (error.code === 'ENOENT' || error.code === 'ENOTDIR') return undefined; throw error; }
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Source updates are deliberately standalone: never infer a workspace owner or
|
|
172
|
+
// replace a global Shell link with a registry package.
|
|
173
|
+
async function sourceOwner({root, linkPath, manifest, selected, adapters, path, key, canonical, platform, cwd, env}) {
|
|
174
|
+
await canonical(path.join(root, '.git'));
|
|
175
|
+
if (key(await canonical(path.join(root, 'package.json'))) !== key(path.join(root, 'package.json'))) throw refusal('source manifest is linked outside the checkout');
|
|
176
|
+
const pin = /^(npm|pnpm)@(\d+\.\d+\.\d+)$/.exec(manifest.packageManager ?? '');
|
|
177
|
+
if (!pin) throw refusal('source checkout needs an exact npm or pnpm packageManager pin');
|
|
178
|
+
const ranges = ['dependencies', 'devDependencies', 'optionalDependencies'].map(field => manifest[field]?.[PI]).filter(value => value !== undefined);
|
|
179
|
+
if (!ranges.length || ranges.some(value => typeof value !== 'string' || !/^[~^<>=*0-9][0-9A-Za-z.*~^<>=|+\s-]*$/.test(value)) || new Set(ranges).size !== 1) throw refusal('source Pi must be a direct registry dependency with one declared range');
|
|
180
|
+
let sourceConfig;
|
|
181
|
+
for (let dir = root; ; dir = path.dirname(dir)) {
|
|
182
|
+
const pkg = dir === root ? manifest : JSON.parse(await optionalFile(adapters.fs, path.join(dir, 'package.json')) ?? '{}');
|
|
183
|
+
const config = await optionalFile(adapters.fs, path.join(dir, 'pnpm-workspace.yaml'));
|
|
184
|
+
if (pkg.workspaces !== undefined || (config !== undefined && (dir !== root || pin[1] !== 'pnpm'))) throw refusal('source workspaces are unsupported; update Pi from the workspace owner');
|
|
185
|
+
if (dir === root) sourceConfig = config;
|
|
186
|
+
if (path.dirname(dir) === dir) break;
|
|
187
|
+
}
|
|
188
|
+
const locks = [];
|
|
189
|
+
for (const name of ['pnpm-lock.yaml', 'package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock', 'bun.lock', 'bun.lockb']) {
|
|
190
|
+
if (await optionalFile(adapters.fs, path.join(root, name)) !== undefined) locks.push(name);
|
|
191
|
+
}
|
|
192
|
+
const lock = pin[1] === 'pnpm' ? 'pnpm-lock.yaml' : 'package-lock.json';
|
|
193
|
+
if (locks.length !== 1 || locks[0] !== lock) throw refusal(`source checkout needs only ${lock}; conflicting or missing lockfiles require manual resolution`);
|
|
194
|
+
if (key(await canonical(path.join(root, lock))) !== key(path.join(root, lock))) throw refusal('source lockfile is linked outside the checkout');
|
|
195
|
+
const peerRoot = await canonical(path.join(root, 'node_modules', PI));
|
|
196
|
+
let packaged = false;
|
|
197
|
+
for (let dir = peerRoot; ; dir = path.dirname(dir)) {
|
|
198
|
+
if (path.basename(dir) === 'node_modules') { packaged = true; break; }
|
|
199
|
+
let source = false;
|
|
200
|
+
try { await adapters.fs.realpath(path.join(dir, '.git')); source = true; }
|
|
201
|
+
catch (error) { if (error.code !== 'ENOENT' && error.code !== 'ENOTDIR') throw error; }
|
|
202
|
+
if (source) throw refusal('source Pi is a linked source checkout; update that checkout separately');
|
|
203
|
+
if (path.dirname(dir) === dir) break;
|
|
204
|
+
}
|
|
205
|
+
if (!packaged) throw refusal('source Pi has an unsupported installed override outside node_modules');
|
|
206
|
+
const peerCli = await canonical(path.join(root, 'node_modules', PI, 'dist/bundle/cli.js'));
|
|
207
|
+
if (key(peerCli) !== key(selected)) throw refusal('source checkout does not supply the selected adjacent Pi');
|
|
208
|
+
const invocation = await invocationFor(pin[1], adapters, platform);
|
|
209
|
+
if (!invocation) throw refusal(`source checkout requires ${pin[0]}`);
|
|
210
|
+
const sourceEnv = pin[1] === 'pnpm' ? {...(env ?? process.env), COREPACK_ENABLE_PROJECT_SPEC:'0', COREPACK_ENABLE_NETWORK:'0'} : undefined;
|
|
211
|
+
const probeOptions = {deadlineMs:30_000, cwd, ...(sourceEnv ? {env:sourceEnv} : {})};
|
|
212
|
+
const version = await adapters.run(invocation.command, [...invocation.prefix, '--version'], probeOptions);
|
|
213
|
+
const actual = typeof version.stdout === 'string' ? version.stdout.trim() : '';
|
|
214
|
+
const compatible = pin[1] === 'pnpm' ? managerVersionAtLeast(actual, pin[2]) : actual === pin[2];
|
|
215
|
+
if (!succeeded(version) || !compatible) throw refusal(`source checkout requires ${pin[0]}${pin[1] === 'pnpm' ? ' or newer' : ''}; the available manager version differs`);
|
|
216
|
+
// Keep the compatible manager just checked; --dir must not acquire the older project pin.
|
|
217
|
+
const sourceOptions = pin[1] === 'pnpm' ? ['--pm-on-fail=ignore'] : [];
|
|
218
|
+
if (sourceConfig !== undefined) {
|
|
219
|
+
const selectors = await adapters.run(invocation.command, [...invocation.prefix, 'config', 'get', 'packages', '--json', '--dir', root, ...sourceOptions], probeOptions);
|
|
220
|
+
let packages;
|
|
221
|
+
try {
|
|
222
|
+
if (typeof selectors.stdout !== 'string') throw new Error('missing selector output');
|
|
223
|
+
const text = selectors.stdout.trim();
|
|
224
|
+
packages = text === '' || text === 'undefined' ? undefined : JSON.parse(text);
|
|
225
|
+
}
|
|
226
|
+
catch { throw refusal('source workspace package selectors could not be verified'); }
|
|
227
|
+
if (!succeeded(selectors) || (packages != null && (!Array.isArray(packages) || packages.length !== 0))) throw refusal('source workspace package selectors are unsupported; update Pi from the workspace owner');
|
|
228
|
+
const listing = await adapters.run(invocation.command, [...invocation.prefix, 'list', '--recursive', '--config.include-workspace-root=true', '--depth', '-1', '--json', '--dir', root, ...sourceOptions], probeOptions);
|
|
229
|
+
let projects;
|
|
230
|
+
try { projects = JSON.parse(listing.stdout); } catch { throw refusal('source workspace projects could not be verified'); }
|
|
231
|
+
if (!succeeded(listing) || !Array.isArray(projects) || projects.length !== 1 || key(await canonical(projects[0]?.path)) !== key(root)) throw refusal('source workspace has other or unknown projects; update Pi from the workspace owner');
|
|
232
|
+
}
|
|
233
|
+
const flags = pin[1] === 'pnpm' ? ['--dir', root, '--lockfile-dir', root, '--recursive=false', '--ignore-pnpmfile', ...(sourceConfig === undefined ? [] : ['--workspace-root'])] : ['--prefix', root, '--workspaces=false', '--no-audit', '--no-fund'];
|
|
234
|
+
return {name:pin[1], ...invocation, package:SHELL, spec:PI, sourceRoot:root, sourceConfig, sourceEnv, linkPath,
|
|
235
|
+
manifest:await adapters.fs.readFile(path.join(root, 'package.json'), 'utf8'),
|
|
236
|
+
args:['update', PI, '--no-save', '--ignore-scripts', '--global=false', ...flags, ...sourceOptions]};
|
|
237
|
+
}
|
|
238
|
+
|
|
157
239
|
export async function resolveUpdateOwner({runtime, packageRoot, platform = process.platform, adapters, cwd, env, home}) {
|
|
158
240
|
const {path, key} = pathsFor(platform);
|
|
159
241
|
const canonical = canonicalWith(adapters, path);
|
|
@@ -168,8 +250,10 @@ export async function resolveUpdateOwner({runtime, packageRoot, platform = proce
|
|
|
168
250
|
const {entries, members} = await listedEntries(groups, {adapters, path, key, canonical});
|
|
169
251
|
for (const {pkg, dependency, groupRoot} of entries) {
|
|
170
252
|
if ((pkg === SHELL) !== adjacent) continue;
|
|
171
|
-
|
|
253
|
+
const linked = dependency.link === true || [dependency.resolved, dependency.version].some(value => typeof value === 'string' && LINKED.test(value));
|
|
172
254
|
const root = await canonical(dependency.path);
|
|
255
|
+
if (pkg === SHELL && key(root) !== key(shellRoot)) continue;
|
|
256
|
+
if (linked && pkg === PI) throw refusal('listed supplier is a source or linked package');
|
|
173
257
|
const manifest = await manifestOf(adapters, path, root);
|
|
174
258
|
if (manifest.name !== pkg) throw refusal('listed package identity differs');
|
|
175
259
|
let cli, spec, artifact = false;
|
|
@@ -184,6 +268,10 @@ export async function resolveUpdateOwner({runtime, packageRoot, platform = proce
|
|
|
184
268
|
const peer = await adjacentPeer({shellRoot: root, groupRoot, adapters, path, key, canonical});
|
|
185
269
|
if (!peer) continue;
|
|
186
270
|
cli = peer.cli;
|
|
271
|
+
if (linked) {
|
|
272
|
+
if (key(cli) === key(selected)) candidates.push(await sourceOwner({root, linkPath:dependency.path, manifest, selected, adapters, path, key, canonical, platform, cwd, env}));
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
187
275
|
// Reinstalling the same Shell version re-resolves its peer; `update`
|
|
188
276
|
// never upgrades Shell itself (that is `gentle-shell upgrade`).
|
|
189
277
|
if (typeof manifest.version !== 'string') throw refusal('listed Shell version is missing');
|
|
@@ -232,8 +320,8 @@ export async function updateSelectedPi(input) {
|
|
|
232
320
|
}
|
|
233
321
|
// Exactly one approved package per command; never create a comma group or
|
|
234
322
|
// reinstall arbitrary dependencies merely because they share a store.
|
|
235
|
-
const args = owner.name === 'pnpm' ? ['add', '-g', owner.spec, ...(owner.package === SHELL ? ['--allow-build=gentle-pi'] : [])] : ['install', '-g', owner.spec, ...(owner.package === PI ? ['--ignore-scripts'] : [])];
|
|
236
|
-
const result = await input.adapters.run(owner.command, [...owner.prefix, ...args], {deadlineMs:20 * 60_000, cwd: input.cwd, stderrTail:4096});
|
|
323
|
+
const args = owner.args ?? (owner.name === 'pnpm' ? ['add', '-g', owner.spec, ...(owner.package === SHELL ? ['--allow-build=gentle-pi'] : [])] : ['install', '-g', owner.spec, ...(owner.package === PI ? ['--ignore-scripts'] : [])]);
|
|
324
|
+
const result = await input.adapters.run(owner.command, [...owner.prefix, ...args], {deadlineMs:20 * 60_000, cwd: owner.sourceRoot ?? input.cwd, stderrTail:4096, ...(owner.sourceEnv ? {env:owner.sourceEnv} : {})});
|
|
237
325
|
if (!succeeded(result)) {
|
|
238
326
|
// One sanitized line of the manager's own error: npm prints it on stderr,
|
|
239
327
|
// pnpm 11 prints ERR_PNPM_* on stdout. Read as one text, stderr last, an
|
|
@@ -242,6 +330,28 @@ export async function updateSelectedPi(input) {
|
|
|
242
330
|
const detail = setupErrorDetail(output, input.home, input.platform);
|
|
243
331
|
throw new Error(`gentle-shell update: ${owner.name} (${[owner.command, ...owner.prefix].join(' ')}) could not install ${owner.spec}${detail ? `\n${detail}` : ''}`);
|
|
244
332
|
}
|
|
333
|
+
if (owner.sourceRoot) {
|
|
334
|
+
const {path, key} = pathsFor(input.platform ?? process.platform);
|
|
335
|
+
const canonical = canonicalWith(input.adapters, path);
|
|
336
|
+
let sameLink = false;
|
|
337
|
+
try { sameLink = key(await canonical(owner.linkPath)) === key(owner.sourceRoot); } catch { /* checked below */ }
|
|
338
|
+
if (!sameLink) throw new Error('gentle-shell update: the Shell link changed during the source update; inspect the installation before retrying.');
|
|
339
|
+
if (await input.adapters.fs.readFile(path.join(owner.sourceRoot, 'package.json'), 'utf8') !== owner.manifest) throw new Error('gentle-shell update: the source manifest changed during the update; inspect the checkout before retrying.');
|
|
340
|
+
if (owner.sourceConfig !== undefined && await input.adapters.fs.readFile(path.join(owner.sourceRoot, 'pnpm-workspace.yaml'), 'utf8') !== owner.sourceConfig) throw new Error('gentle-shell update: the source pnpm configuration changed during the update; inspect the checkout before retrying.');
|
|
341
|
+
let after = null;
|
|
342
|
+
try {
|
|
343
|
+
const peer = await adjacentPeer({shellRoot:owner.sourceRoot, adapters:input.adapters, path, key, canonical});
|
|
344
|
+
const nested = await canonical(path.join(owner.sourceRoot, 'node_modules', PI, 'dist/bundle/cli.js'));
|
|
345
|
+
if (peer && key(peer.cli) === key(nested)) after = peer.manifest.version ?? null;
|
|
346
|
+
} catch { /* Never invent readback after a successful manager invocation. */ }
|
|
347
|
+
const location = `${owner.name} updated ${PI} in ${owner.sourceRoot}`;
|
|
348
|
+
if (after === null) input.out?.(`${location}. The Pi version could not be read back; run 'gentle-shell --version' to check it.`);
|
|
349
|
+
else {
|
|
350
|
+
input.out?.(`${location}; the selected Pi is ${after === input.currentVersion ? 'still' : 'now'} ${after}${after !== input.currentVersion && input.currentVersion !== undefined ? ` (was ${input.currentVersion})` : ''}.`);
|
|
351
|
+
if (after === input.currentVersion && owner.name === 'pnpm') input.out?.('The declared version range and pnpm minimumReleaseAge setting still apply; neither was overridden.');
|
|
352
|
+
}
|
|
353
|
+
return 0;
|
|
354
|
+
}
|
|
245
355
|
const after = await suppliedPiVersion(owner, input);
|
|
246
356
|
const before = input.currentVersion;
|
|
247
357
|
if (after === null) input.out?.(`${owner.name} installed ${owner.spec}. The Pi version it now supplies could not be read back; run 'gentle-shell --version' to check it.`);
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Shared --pi-root contract. The comparison driver and the measurement worker
|
|
2
|
+
// must refuse a bad root with the same curated message, and both must do it
|
|
3
|
+
// before reading, hashing or importing anything from the host.
|
|
4
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
|
|
7
|
+
export const SUPPORTED_PI_VERSION = "1.2.0";
|
|
8
|
+
export const PI_ROOT_LAYOUT = "dist/ plus node_modules/@earendil-works/{pi-tui,pi-ai,pi-agent-core} and node_modules/jiti";
|
|
9
|
+
export const HOST_PACKAGE = "@earendil-works/pi-coding-agent";
|
|
10
|
+
export const TUI_PACKAGE = "@earendil-works/pi-tui";
|
|
11
|
+
export const HOST_ENTRY = "core/extensions/jiti-loader.js";
|
|
12
|
+
export const HOST_DEPENDENCIES = [
|
|
13
|
+
"node_modules/@earendil-works/pi-tui",
|
|
14
|
+
"node_modules/@earendil-works/pi-ai",
|
|
15
|
+
"node_modules/@earendil-works/pi-agent-core",
|
|
16
|
+
"node_modules/jiti",
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
function layoutError(piRoot, detail) {
|
|
20
|
+
return new Error(`--pi-root ${piRoot} is not a Pi install root: ${detail} It must carry ${PI_ROOT_LAYOUT}.`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function hostPackage(piRoot, relative, expectedName) {
|
|
24
|
+
const path = resolve(piRoot, relative);
|
|
25
|
+
let manifest;
|
|
26
|
+
try {
|
|
27
|
+
manifest = JSON.parse(readFileSync(path, "utf8"));
|
|
28
|
+
} catch {
|
|
29
|
+
throw layoutError(piRoot, `${path} is unreadable.`);
|
|
30
|
+
}
|
|
31
|
+
if (manifest === null || typeof manifest !== "object" || typeof manifest.name !== "string" || typeof manifest.version !== "string") {
|
|
32
|
+
throw layoutError(piRoot, `${path} declares no package name and version.`);
|
|
33
|
+
}
|
|
34
|
+
if (manifest.name !== expectedName) {
|
|
35
|
+
throw layoutError(piRoot, `${path} is ${manifest.name}@${manifest.version}, expected ${expectedName}.`);
|
|
36
|
+
}
|
|
37
|
+
return { name: manifest.name, version: manifest.version };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function directoryAt(path) {
|
|
41
|
+
try {
|
|
42
|
+
return statSync(path).isDirectory();
|
|
43
|
+
} catch (error) {
|
|
44
|
+
if (error?.code === "ENOENT" || error?.code === "ENOTDIR") return false;
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function requireHostLayout(piRoot) {
|
|
50
|
+
const dist = resolve(piRoot, "dist");
|
|
51
|
+
if (!directoryAt(dist)) throw layoutError(piRoot, `${dist} is not a directory.`);
|
|
52
|
+
const entry = resolve(dist, HOST_ENTRY);
|
|
53
|
+
if (!existsSync(entry)) throw layoutError(piRoot, `${entry} is missing.`);
|
|
54
|
+
for (const relative of HOST_DEPENDENCIES) {
|
|
55
|
+
const path = resolve(piRoot, relative);
|
|
56
|
+
if (!directoryAt(path)) throw layoutError(piRoot, `${path} is missing or not a directory.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Validates the install root and returns the two audited manifests. */
|
|
61
|
+
export function validatePiRoot(piRoot) {
|
|
62
|
+
const host = hostPackage(piRoot, "package.json", HOST_PACKAGE);
|
|
63
|
+
const hostTui = hostPackage(piRoot, "node_modules/@earendil-works/pi-tui/package.json", TUI_PACKAGE);
|
|
64
|
+
if (host.version !== SUPPORTED_PI_VERSION) {
|
|
65
|
+
throw new Error(`--pi-root ${piRoot} is ${host.name}@${host.version}, but the private frame API is audited only on ${SUPPORTED_PI_VERSION}. Point --pi-root at a Pi ${SUPPORTED_PI_VERSION} install (${PI_ROOT_LAYOUT}).`);
|
|
66
|
+
}
|
|
67
|
+
if (hostTui.version !== host.version) {
|
|
68
|
+
throw new Error(`--pi-root ${piRoot} mixes ${host.name}@${host.version} with ${hostTui.name}@${hostTui.version}; a mixed host cannot be measured. Point --pi-root at a Pi ${SUPPORTED_PI_VERSION} install (${PI_ROOT_LAYOUT}).`);
|
|
69
|
+
}
|
|
70
|
+
requireHostLayout(piRoot);
|
|
71
|
+
return { host, hostTui };
|
|
72
|
+
}
|
|
@@ -4,12 +4,12 @@ import { readFileSync } from "node:fs";
|
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import { performance } from "node:perf_hooks";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
|
+
import { validatePiRoot } from "./render-cache-host.mjs";
|
|
7
8
|
|
|
8
9
|
const config = JSON.parse(process.argv[2]);
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
assert.equal(tuiVersion, piVersion, "host TUI package must match");
|
|
10
|
+
const { host, hostTui } = validatePiRoot(config.piRoot);
|
|
11
|
+
const piVersion = host.version;
|
|
12
|
+
const tuiVersion = hostTui.version;
|
|
13
13
|
const hostImport = (path) => import(pathToFileURL(resolve(config.piRoot, "dist", path)).href);
|
|
14
14
|
const { createJiti } = await hostImport("core/extensions/jiti-loader.js");
|
|
15
15
|
const { VIRTUAL_MODULES } = await hostImport("core/extensions/virtual-modules.js");
|
|
@@ -54,6 +54,7 @@ function fixture(spec, live = false) {
|
|
|
54
54
|
manager.getEntries = () => { counts.entries++; return getEntries(); };
|
|
55
55
|
const model = { id: "synthetic-model", provider: "synthetic", reasoning: true, contextWindow: 200000 };
|
|
56
56
|
const ctx = { model, sessionManager: manager, modelRegistry: { isUsingOAuth: () => false },
|
|
57
|
+
ui: { theme: { name: "performance" }, getAllThemes: () => [] },
|
|
57
58
|
getContextUsage() { counts.projections++; return pi.AgentSession.prototype.getContextUsage.call({ sessionManager: manager, _limitsModel: () => model }); } };
|
|
58
59
|
const api = { getThinkingLevel: () => "high" };
|
|
59
60
|
const footerData = { getGitBranch: () => "performance", getExtensionStatuses: () => new Map(), onBranchChange: () => () => {} };
|
|
@@ -6,6 +6,7 @@ import { closeSync, ftruncateSync, openSync, readFileSync, readdirSync, realpath
|
|
|
6
6
|
import { cpus, loadavg } from "node:os";
|
|
7
7
|
import { basename, dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { validatePiRoot } from "./render-cache-host.mjs";
|
|
9
10
|
|
|
10
11
|
export function percentile(values, fraction) {
|
|
11
12
|
if (!values.length) return null;
|
|
@@ -60,6 +61,9 @@ async function main() {
|
|
|
60
61
|
const split = arg.indexOf("="); return [arg.slice(2, split), arg.slice(split + 1)];
|
|
61
62
|
}));
|
|
62
63
|
for (const key of ["baseline-root", "candidate-root", "pi-root", "output"]) assert.ok(options[key], `--${key} is required`);
|
|
64
|
+
// Refuse a bad host before hashing either worktree: the driver used to reach
|
|
65
|
+
// a bare ENOENT/ENOTDIR from hostFingerprint instead of the layout message.
|
|
66
|
+
validatePiRoot(resolve(options["pi-root"]));
|
|
63
67
|
const roots = { before: resolve(options["baseline-root"]), after: resolve(options["candidate-root"]) };
|
|
64
68
|
const initial = Object.fromEntries(Object.entries(roots).map(([key, root]) => [key, fingerprint(root)]));
|
|
65
69
|
assert.equal(initial.before.head, initial.after.head, "compare worktrees based on the same commit");
|
|
@@ -76,7 +80,8 @@ async function main() {
|
|
|
76
80
|
const report = { schema: "gentle-shell.render-performance/v1", started: new Date().toISOString(), node: process.version,
|
|
77
81
|
cpu: cpus()[0]?.model, loadAtStart: loadavg(), sources: initial, config, runs: [], comparisons: [] };
|
|
78
82
|
const worker = fileURLToPath(new URL("render-cache-performance-worker.mjs", import.meta.url));
|
|
79
|
-
const
|
|
83
|
+
const hostHost = fileURLToPath(new URL("render-cache-host.mjs", import.meta.url));
|
|
84
|
+
const instrumentationHash = () => createHash("sha256").update(readFileSync(fileURLToPath(import.meta.url))).update(readFileSync(worker)).update(readFileSync(hostHost)).digest("hex");
|
|
80
85
|
report.instrumentationSha256 = instrumentationHash();
|
|
81
86
|
report.host = hostFingerprint(config.piRoot);
|
|
82
87
|
const fd = outputDescriptor(options.output, [...Object.values(roots), config.piRoot, ...report.host.map((entry) => entry.root), resolve(dirname(fileURLToPath(import.meta.url)), "..")]);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// POSIX and Windows CI.
|
|
11
11
|
|
|
12
12
|
import { spawn } from "node:child_process";
|
|
13
|
-
import { mkdtempSync, readFileSync, realpathSync, rmSync } from "node:fs";
|
|
13
|
+
import { mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { tmpdir } from "node:os";
|
|
15
15
|
import { join } from "node:path";
|
|
16
16
|
import { fileURLToPath } from "node:url";
|
|
@@ -22,19 +22,47 @@ export const DEFAULT_STAGES = Object.freeze([
|
|
|
22
22
|
]);
|
|
23
23
|
|
|
24
24
|
export async function runStage(stage) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const configHome = stage.name === "unit-tests" ? mkdtempSync(join(tmpdir(), "gentle-pi-unit-config-")) : undefined;
|
|
28
|
-
const env = configHome ? Object.fromEntries(Object.entries(process.env).filter(([key]) => {
|
|
29
|
-
const normalizedKey = key.toUpperCase();
|
|
30
|
-
return !normalizedKey.startsWith("GIT_") && !normalizedKey.startsWith("GENTLE_PI_AGENTS_") && normalizedKey !== "GENTLE_PI_CONFIG_HOME";
|
|
31
|
-
})) : process.env;
|
|
32
|
-
if (configHome) env.GENTLE_PI_CONFIG_HOME = configHome;
|
|
33
|
-
// Unit fixtures also get a private temp dir, removed with the stage, so a
|
|
34
|
-
// fixture that leaves a subagent unfinished cannot leave its TMPDIR behind.
|
|
35
|
-
const unitTmp = configHome ? mkdtempSync(join(tmpdir(), "gentle-pi-unit-tmp-")) : undefined;
|
|
36
|
-
if (unitTmp) env.TMPDIR = unitTmp;
|
|
25
|
+
let configHome;
|
|
26
|
+
let unitTmp;
|
|
37
27
|
try {
|
|
28
|
+
// Unit fixtures must not inherit the terminal's Git overrides, child-session
|
|
29
|
+
// identity, launcher marker, or guardrails. Later stages retain their env.
|
|
30
|
+
configHome = stage.name === "unit-tests" ? mkdtempSync(join(tmpdir(), "gentle-pi-unit-config-")) : undefined;
|
|
31
|
+
const env = configHome ? Object.fromEntries(Object.entries(process.env).filter(([key]) => {
|
|
32
|
+
const normalizedKey = key.toUpperCase();
|
|
33
|
+
return !normalizedKey.startsWith("GIT_") && !normalizedKey.startsWith("GENTLE_PI_AGENTS_") &&
|
|
34
|
+
normalizedKey !== "GENTLE_PI_CONFIG_HOME" && normalizedKey !== "GENTLE_SHELL_CONFIG_HOME";
|
|
35
|
+
})) : process.env;
|
|
36
|
+
if (configHome) env.GENTLE_PI_CONFIG_HOME = configHome;
|
|
37
|
+
// Unix sockets have short path limits; an inherited TMPDIR can already be
|
|
38
|
+
// too long. Use the short system temp root on POSIX and a private directory
|
|
39
|
+
// on every platform, removed even when stage setup or execution fails.
|
|
40
|
+
unitTmp = configHome ? mkdtempSync(join(process.platform === "win32" ? tmpdir() : "/tmp", "gentle-pi-unit-tmp-")) : undefined;
|
|
41
|
+
if (unitTmp) {
|
|
42
|
+
env.TMPDIR = unitTmp;
|
|
43
|
+
// Node's Windows tmpdir() uses TEMP/TMP, not TMPDIR.
|
|
44
|
+
if (process.platform === "win32") {
|
|
45
|
+
for (const key of Object.keys(env)) if (["TEMP", "TMP"].includes(key.toUpperCase())) delete env[key];
|
|
46
|
+
env.TEMP = unitTmp;
|
|
47
|
+
env.TMP = unitTmp;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Stripping GIT_* environment still leaves Git's config files, which it reads
|
|
51
|
+
// by path: a host-level global ignore (e.g. ".agents/" in ~/.gitconfig or the
|
|
52
|
+
// XDG ignore file) made `git add -A` inside fixtures drop an untracked
|
|
53
|
+
// symlink target, so the candidate view materialized a dangling link and the
|
|
54
|
+
// suite saw an ENOENT (gentle-shell#2552). Pin every remaining config source
|
|
55
|
+
// to an empty file for the stage; fixtures that need identity pass -c flags.
|
|
56
|
+
if (configHome) {
|
|
57
|
+
const emptyGitConfig = join(configHome, "empty.gitconfig");
|
|
58
|
+
writeFileSync(emptyGitConfig, "");
|
|
59
|
+
env.GIT_CONFIG_GLOBAL = emptyGitConfig;
|
|
60
|
+
env.GIT_CONFIG_NOSYSTEM = "1";
|
|
61
|
+
// An empty GIT_CONFIG_GLOBAL does not disable Git's default ignore file:
|
|
62
|
+
// it still reads $XDG_CONFIG_HOME/git/ignore, so a host ignore (e.g.
|
|
63
|
+
// ".agents/") would keep dropping fixture files from `git add -A`.
|
|
64
|
+
env.XDG_CONFIG_HOME = configHome;
|
|
65
|
+
}
|
|
38
66
|
return await new Promise((resolve) => {
|
|
39
67
|
const child = spawn(stage.command, { shell: true, stdio: "inherit", env });
|
|
40
68
|
child.on("close", (code) => resolve({ name: stage.name, code: code ?? 1 }));
|