gentle-pi 4.0.0 → 4.1.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 +122 -8
- package/assets/agents/gentle-ai-explore.md +11 -4
- package/assets/agents/gentle-ai-verify.md +23 -4
- package/assets/agents/gentle-ai-worker.md +6 -6
- package/assets/install-wizard/index.html +47 -0
- package/assets/install-wizard/wizard.css +1279 -0
- package/assets/install-wizard/wizard.js +951 -0
- package/assets/orchestrator-delegation.md +70 -163
- package/assets/orchestrator-memory.md +11 -4
- package/assets/orchestrator-prompts.md +48 -0
- package/assets/orchestrator-tracking.md +53 -0
- package/assets/orchestrator-verification.md +28 -0
- package/assets/orchestrator-writer.md +38 -0
- package/assets/orchestrator.md +29 -25
- package/assets/sounds/LICENSE.md +52 -0
- package/assets/sounds/attention.wav +0 -0
- package/assets/sounds/error.wav +0 -0
- package/assets/sounds/success.wav +0 -0
- package/bin/engram-guard +9 -0
- package/bin/gentle-shell-install.mjs +302 -0
- package/bin/gentle-shell.mjs +703 -22
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +7 -7
- package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/manifest.json +2 -2
- package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/orchestration/pi.md +16 -4
- package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/generated/provider-capabilities.baseline.json +2 -2
- package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/generated/provider-roles.baseline.json +1 -1
- package/docs/bundled-install.md +397 -0
- package/docs/delegated-verification.md +3 -5
- package/docs/gentle-agents-activity.md +513 -0
- package/docs/gentle-shell-uninstall.md +136 -0
- package/docs/gentle-shell.md +81 -31
- package/docs/install-wizard.md +2040 -0
- package/docs/native-authority-architecture.md +1 -1
- package/docs/permission-modes.md +82 -0
- package/docs/prompt-history.md +1 -1
- package/docs/readme-reference.md +267 -40
- package/docs/render-cache-performance.md +28 -0
- package/docs/sound-notifications-proposal.md +191 -0
- package/docs/sound-notifications.md +114 -0
- package/docs/yolo-mode.md +9 -9
- package/extensions/child-context.ts +11 -2
- package/extensions/child-safety.ts +4 -2
- package/extensions/codegraph-tools.ts +18 -5
- package/extensions/gentle-agents.ts +688 -88
- package/extensions/gentle-ai.ts +886 -238
- package/extensions/gentle-herdr-activity.ts +81 -0
- package/extensions/gentle-notifications.ts +104 -0
- package/extensions/gentle-shell.ts +265 -69
- package/extensions/gentle-todo.ts +108 -13
- package/extensions/history/index.ts +11 -6
- package/extensions/pi-pretty.ts +39 -3
- package/extensions/quiet-tools.ts +91 -21
- package/extensions/skill-registry.ts +175 -46
- package/extensions/startup-banner.ts +11 -2
- package/lib/agent-home.ts +10 -1
- package/lib/agent-model-resolution.ts +80 -0
- package/lib/agent-profiles.ts +13 -3
- package/lib/agents-completion-delivery.ts +11 -3
- package/lib/agents-messaging.ts +1 -1
- package/lib/agents-protocol.ts +40 -1
- package/lib/agents-runner.ts +90 -15
- package/lib/auto-permission-classifier.ts +280 -0
- package/lib/auto-permission-runtime.ts +268 -0
- package/lib/background-jobs-tools.ts +202 -0
- package/lib/background-jobs.ts +253 -0
- package/lib/background-monitor.ts +154 -0
- package/lib/bounded-writer-admission.ts +83 -10
- package/lib/builtin-codemode-optout.ts +166 -0
- package/lib/card-content-policy.ts +85 -0
- package/lib/child-package-injection.ts +62 -0
- package/lib/codemode-renderer.ts +14 -4
- package/lib/command-palette-catalog.ts +3 -2
- package/lib/context-threshold.ts +26 -0
- package/lib/gentle-ai-binary.ts +109 -4
- package/lib/gentle-shell-bundled.ts +517 -0
- package/lib/gentle-shell-launcher.ts +74 -23
- package/lib/gentle-shell-startup-flow.ts +54 -0
- package/lib/gentle-shell-startup-update.ts +92 -0
- package/lib/gentle-shell-uninstall.ts +840 -0
- package/lib/gentle-shell-update-panel.ts +231 -0
- package/lib/herdr-activity.ts +183 -0
- package/lib/inprocess-reviewer.ts +3 -0
- package/lib/jobs-sidebar-state.ts +20 -0
- package/lib/jobs-view.ts +161 -0
- package/lib/model-price-ratio.ts +83 -0
- package/lib/nan-provider.ts +33 -11
- package/lib/native-review-cli.ts +194 -73
- package/lib/notification-audio-native.ts +162 -0
- package/lib/notification-audio-windows.ts +399 -0
- package/lib/notification-audio.ts +332 -0
- package/lib/notification-customize.ts +241 -0
- package/lib/notification-events.ts +113 -0
- package/lib/notification-policy.ts +148 -0
- package/lib/notification-pulse-client.ts +367 -0
- package/lib/notification-pulse-protocol.ts +305 -0
- package/lib/notification-pulse-stream.ts +213 -0
- package/lib/notification-pulse-worker.ts +66 -0
- package/lib/notification-scheduler.ts +173 -0
- package/lib/notification-service.ts +202 -0
- package/lib/notification-ui.ts +87 -0
- package/lib/odd-phase.ts +1 -1
- package/lib/orchestrator-alias.ts +20 -0
- package/lib/orchestrator-catalog.ts +79 -0
- package/lib/orchestrator-consultation.ts +61 -0
- package/lib/orchestrator-discovery.ts +49 -0
- package/lib/orchestrator-helper-consent.ts +122 -0
- package/lib/orchestrator-helper.ts +167 -0
- package/lib/orchestrator-message-card.ts +105 -0
- package/lib/orchestrator-presence.ts +115 -14
- package/lib/orchestrator-scope.ts +80 -0
- package/lib/orchestrator-state.ts +107 -0
- package/lib/orchestrator-tool-card.ts +280 -0
- package/lib/orchestrator-work-search.ts +218 -0
- package/lib/orchestrator-work.ts +79 -0
- package/lib/permission-mode-policy.ts +59 -0
- package/lib/review-candidate-view-owner.ts +8 -6
- package/lib/review-candidate-view.ts +3 -2
- package/lib/review-compact-contract.ts +2 -2
- package/lib/review-host-relay.ts +7 -2
- package/lib/review-integration-v2.ts +100 -22
- package/lib/review-publication-gate.ts +1 -1
- package/lib/review-risk-assessment.ts +77 -51
- package/lib/review-sidebar-state.ts +2 -1
- package/lib/review-transaction.ts +72 -3
- package/lib/runtime-metrics-children.ts +1 -1
- package/lib/runtime-metrics-native.ts +3 -2
- package/lib/selection-engine.ts +18 -6
- package/lib/session-change-capture.ts +5 -4
- package/lib/session-changes.ts +27 -22
- package/lib/session-profile-binding.ts +83 -0
- package/lib/session-profile-freeze.ts +266 -0
- package/lib/session-worktree-registry.ts +74 -8
- package/lib/shell-bar.ts +41 -11
- package/lib/shell-changes-view.ts +40 -13
- package/lib/shell-changes.ts +86 -71
- package/lib/shell-sidebar-layout.ts +5 -1
- package/lib/shell-todo.ts +62 -19
- package/lib/shell-usage.ts +4 -3
- package/lib/status-timing-diagnostics.ts +201 -0
- package/lib/telemetry-trigger.ts +3 -1
- package/lib/vim-editor-adapter.ts +7 -3
- package/lib/visual-customization-policy.ts +20 -9
- package/lib/visual-customize-view.ts +171 -20
- package/lib/writer-surfaces.ts +162 -0
- package/lib/yolo-session-policy.ts +198 -121
- package/package.json +1 -1
- package/runtime/child-package-injection.mjs +63 -0
- package/runtime/gentle-ai-binary.mjs +109 -4
- package/runtime/gentle-shell-bundled.mjs +518 -0
- package/runtime/gentle-shell-launcher.mjs +73 -22
- package/runtime/gentle-shell-startup-flow.mjs +55 -0
- package/runtime/gentle-shell-startup-update.mjs +93 -0
- package/runtime/gentle-shell-uninstall.mjs +841 -0
- package/runtime/gentle-shell-update-panel.mjs +232 -0
- package/runtime/native-review-cli.mjs +191 -70
- package/runtime/review-integration-v2.mjs +100 -22
- package/runtime/review-risk-assessment.mjs +77 -51
- package/runtime/status-timing-diagnostics.mjs +202 -0
- package/runtime/telemetry-trigger.mjs +3 -1
- package/scripts/bootstrap.cmd +255 -0
- package/scripts/bootstrap.sh +168 -0
- package/scripts/build-distribution.mjs +157 -0
- package/scripts/build-installer-bundles.mjs +136 -0
- package/scripts/build-runtime-modules.mjs +7 -0
- package/scripts/bundled-install.mjs +1308 -0
- package/scripts/bundled-wizard.mjs +399 -0
- package/scripts/check-types.mjs +4 -6
- package/scripts/gentle-ai-installer.mjs +79 -32
- package/scripts/install-gentle-ai.mjs +48 -1
- package/scripts/install-tui-mode-setting.mjs +10 -1
- package/scripts/install-wizard-preview.mjs +154 -0
- package/scripts/installer-downloads.mjs +648 -0
- package/scripts/installer-preflight.mjs +387 -0
- package/scripts/installer-probes.mjs +564 -0
- package/scripts/installer-runner.mjs +1102 -0
- package/scripts/installer-server.mjs +881 -0
- package/scripts/installer-windows-artifacts.json +15 -0
- package/scripts/installer-windows.mjs +752 -0
- package/scripts/main-channel.mjs +452 -0
- package/scripts/npm-pack-result.mjs +31 -0
- package/scripts/render-cache-performance-worker.mjs +205 -0
- package/scripts/render-cache-performance.mjs +115 -0
- package/scripts/run-test-suite.mjs +22 -8
- package/scripts/test-installer-acceptance.sh +161 -0
- package/scripts/test-packed-runner.mjs +23 -5
- package/scripts/types-baseline.json +2 -92
- package/scripts/verify-package-files.mjs +82 -18
- package/skills/gentle-ai/SKILL.md +12 -11
- package/tests/agent-home.test.ts +56 -3
- package/tests/agent-model-resolution.test.ts +113 -0
- package/tests/agent-profiles.test.ts +12 -0
- package/tests/agent-risk-escalation.test.ts +123 -0
- package/tests/agents-completion-delivery.test.ts +17 -0
- package/tests/agents-protocol.test.ts +57 -0
- package/tests/agents-queries.test.ts +9 -9
- package/tests/agents-runner-process.test.ts +31 -0
- package/tests/agents-runner.test.ts +89 -4
- package/tests/auto-mode-invariants.test.ts +258 -0
- package/tests/auto-mode-sdk.test.ts +57 -0
- package/tests/auto-mode.test.ts +49 -0
- package/tests/auto-permission-classifier.test.ts +283 -0
- package/tests/auto-permission-runtime.test.ts +196 -0
- package/tests/background-cache-warming.test.ts +2 -1
- package/tests/background-jobs.test.ts +227 -0
- package/tests/background-monitor.test.ts +195 -0
- package/tests/background-subagents-default-mode.test.ts +28 -5
- package/tests/bounded-stop-contract.test.ts +85 -0
- package/tests/bounded-writer-admission.test.ts +52 -1
- package/tests/bridge-wake-lifecycle.test.ts +129 -0
- package/tests/bridge-wake-rendering.test.ts +56 -0
- package/tests/build-distribution.test.ts +269 -0
- package/tests/builtin-codemode-optout.test.ts +242 -0
- package/tests/bundled-install.test.ts +1319 -0
- package/tests/bundled-wizard.test.ts +505 -0
- package/tests/card-content-policy.test.ts +68 -0
- package/tests/card-style-policy.test.ts +34 -2
- package/tests/child-codegraph-bootstrap.test.ts +74 -0
- package/tests/child-package-entrypoints.test.ts +65 -0
- package/tests/child-package-injection.test.ts +74 -0
- package/tests/child-safety.test.ts +12 -0
- package/tests/child-web-package.test.ts +224 -0
- package/tests/codegraph-tools.test.ts +35 -0
- package/tests/codemode-rendering.test.ts +107 -2
- package/tests/command-palette.test.ts +5 -5
- package/tests/context-threshold.test.ts +31 -0
- package/tests/delegate-for-reason-contract.test.ts +327 -0
- package/tests/delegated-key-learnings-contract.test.ts +3 -2
- package/tests/devbinary/native-review-parity.devtest.ts +1 -1
- package/tests/devbinary/pi-host-relay.devtest.ts +173 -3
- package/tests/engram-safety.test.ts +288 -0
- package/tests/generic-agent-tools.test.ts +16 -1
- package/tests/gentle-agents.test.ts +1722 -59
- package/tests/gentle-ai-binary-isolation.test.ts +135 -0
- package/tests/gentle-ai-binary.test.ts +19 -2
- package/tests/gentle-ai-child-guards.test.ts +202 -0
- package/tests/gentle-ai-dev-binary-surfacing.test.ts +125 -15
- package/tests/gentle-ai-installer.test.ts +548 -58
- package/tests/gentle-ai-prompt-model-routing.test.ts +123 -0
- package/tests/gentle-ai-renderer.test.ts +6 -6
- package/tests/gentle-ai.test.ts +999 -31
- package/tests/gentle-herdr-activity.test.ts +100 -0
- package/tests/gentle-notifications.test.ts +427 -0
- package/tests/gentle-shell-bin.test.ts +249 -5
- package/tests/gentle-shell-bundled.test.ts +1002 -0
- package/tests/gentle-shell-launcher.test.ts +234 -13
- package/tests/gentle-shell-startup-flow.test.ts +75 -0
- package/tests/gentle-shell-startup-update.test.ts +85 -0
- package/tests/gentle-shell-uninstall.test.ts +978 -0
- package/tests/gentle-shell-update-panel.test.ts +158 -0
- package/tests/gentle-shell.test.ts +541 -96
- package/tests/gentle-todo.test.ts +253 -2
- package/tests/herdr-activity.test.ts +243 -0
- package/tests/history-agent-home.test.ts +81 -0
- package/tests/history-child-guard.test.ts +70 -0
- package/tests/inprocess-reviewer.test.ts +20 -0
- package/tests/install-gentle-ai-failure.test.ts +69 -0
- package/tests/install-tui-mode-setting.test.ts +15 -0
- package/tests/install-wizard.test.ts +1223 -0
- package/tests/installer-bundles.test.ts +122 -0
- package/tests/installer-posix-bootstrap.test.ts +1201 -0
- package/tests/installer-preflight.test.ts +750 -0
- package/tests/installer-probes.test.ts +1106 -0
- package/tests/installer-runner.test.ts +2158 -0
- package/tests/installer-server.test.ts +1567 -0
- package/tests/installer-windows-bootstrap.test.ts +2410 -0
- package/tests/jobs-view.test.ts +160 -0
- package/tests/main-channel-upgrade.test.ts +389 -0
- package/tests/main-channel.test.ts +344 -0
- package/tests/maintainer/provider-relay.maintest.ts +13 -12
- package/tests/model-price-ratio.test.ts +116 -0
- package/tests/model-profiles-preservation.test.ts +153 -0
- package/tests/model-routing-package.test.ts +10 -0
- package/tests/nan-provider-runtime.test.ts +156 -0
- package/tests/nan-provider.test.ts +28 -18
- package/tests/native-binary-gate.test.ts +2 -0
- package/tests/native-review-capability-contract.test.ts +7 -1
- package/tests/native-review-cli.test.ts +236 -1
- package/tests/native-review-consent.test.ts +2 -2
- package/tests/native-review-parity-runtime.test.ts +1 -1
- package/tests/native-review-parity.test.ts +12 -48
- package/tests/native-risk-evidence-parity.test.ts +21 -0
- package/tests/no-self-pause-contract.test.ts +87 -0
- package/tests/notification-audio-native.test.ts +281 -0
- package/tests/notification-audio-windows.test.ts +581 -0
- package/tests/notification-audio.test.ts +548 -0
- package/tests/notification-customize.test.ts +655 -0
- package/tests/notification-events.test.ts +115 -0
- package/tests/notification-policy.test.ts +201 -0
- package/tests/notification-pulse-client.test.ts +356 -0
- package/tests/notification-pulse-protocol.test.ts +213 -0
- package/tests/notification-pulse-stream.test.ts +320 -0
- package/tests/notification-scheduler.test.ts +258 -0
- package/tests/notification-ui.test.ts +157 -0
- package/tests/npm-pack-result.test.ts +41 -0
- package/tests/odd-integration.test.ts +14 -5
- package/tests/odd-routing-canonical-ratchet.test.ts +53 -12
- package/tests/odd-routing-contract.test.ts +80 -23
- package/tests/orchestrator-budget.test.ts +29 -6
- package/tests/orchestrator-catalog.test.ts +146 -0
- package/tests/orchestrator-consultation-sdk.test.ts +614 -0
- package/tests/orchestrator-consultation.test.ts +111 -0
- package/tests/orchestrator-discovery.test.ts +241 -0
- package/tests/orchestrator-helper-consent.test.ts +171 -0
- package/tests/orchestrator-helper.test.ts +297 -0
- package/tests/orchestrator-message-card.test.ts +190 -0
- package/tests/orchestrator-presence.test.ts +23 -0
- package/tests/orchestrator-rdd-ownership.test.ts +6 -5
- package/tests/orchestrator-scope.test.ts +107 -0
- package/tests/orchestrator-state.test.ts +114 -0
- package/tests/orchestrator-status-publication-contract.test.ts +34 -0
- package/tests/orchestrator-tool-card.test.ts +398 -0
- package/tests/orchestrator-work-search.test.ts +318 -0
- package/tests/orchestrator-work.test.ts +147 -0
- package/tests/package-manifest.test.ts +101 -17
- package/tests/packed-runner-owned-path.test.ts +35 -1
- package/tests/parallel-reason-contract.test.ts +21 -0
- package/tests/parallel-writer-admission.test.ts +210 -0
- package/tests/permission-mode-policy.test.ts +194 -0
- package/tests/persona-single-channel.test.ts +4 -12
- package/tests/pi-pretty.test.ts +56 -0
- package/tests/provider-defect-handoff.test.ts +4 -3
- package/tests/quiet-tool-rendering.test.ts +160 -3
- package/tests/rdd-aware-verification-contract.test.ts +29 -41
- package/tests/render-cache-performance.test.ts +48 -0
- package/tests/review-agent-end-preflight.test.ts +62 -10
- package/tests/review-candidate-view.test.ts +101 -12
- package/tests/review-contract-prompt.test.ts +33 -4
- package/tests/review-controller-native-recovery.test.ts +327 -17
- package/tests/review-controller-native-routing.test.ts +255 -1
- package/tests/review-controller-workspace-root.test.ts +43 -2
- package/tests/review-controller.test.ts +2 -2
- package/tests/review-correction-lifecycle.test.ts +2 -1
- package/tests/review-gate.test.ts +7 -4
- package/tests/review-graph-schema.test.ts +2 -2
- package/tests/review-host-relay-routing.test.ts +5 -3
- package/tests/review-host-relay.test.ts +49 -2
- package/tests/review-integration-v2-forward.test.ts +21 -1
- package/tests/review-json-arguments.test.ts +167 -0
- package/tests/review-last-event-closure.test.ts +157 -8
- package/tests/review-ledger-contract.test.ts +5 -4
- package/tests/review-policy-judgment-day.test.ts +1 -1
- package/tests/review-policy-ordinary.test.ts +2 -2
- package/tests/review-relay-transport-agent.test.ts +66 -1
- package/tests/review-risk-assessment.test.ts +109 -33
- package/tests/review-session-standing-permission-controller.test.ts +16 -17
- package/tests/review-session-standing-permission-ipc.test.ts +6 -5
- package/tests/review-test-fixtures.ts +7 -1
- package/tests/review-transaction.test.ts +18 -1
- package/tests/run-test-suite.test.ts +83 -5
- package/tests/runtime-harness.mjs +42 -15
- package/tests/runtime-metrics-extension.test.ts +1 -1
- package/tests/runtime-metrics-native.test.ts +31 -1
- package/tests/selection-engine.test.ts +30 -0
- package/tests/session-change-capture.test.ts +10 -10
- package/tests/session-changes-shell.test.ts +242 -48
- package/tests/session-changes.test.ts +17 -24
- package/tests/session-profile-binding.test.ts +163 -0
- package/tests/session-profile-freeze.test.ts +381 -0
- package/tests/session-subject-routing-contract.test.ts +34 -0
- package/tests/session-worktree-registry.test.ts +57 -2
- package/tests/shell-bar.test.ts +40 -0
- package/tests/shell-changes-view.test.ts +85 -34
- package/tests/shell-changes.test.ts +61 -62
- package/tests/shell-render-cache-runtime.test.ts +69 -0
- package/tests/shell-render-cache.test.ts +129 -0
- package/tests/shell-sidebar-layout.test.ts +27 -2
- package/tests/shell-todo.test.ts +120 -2
- package/tests/shell-usage-view.test.ts +1 -1
- package/tests/shell-usage.test.ts +35 -0
- package/tests/short-check-routing-contract.test.ts +49 -0
- package/tests/skill-registry-watcher.test.ts +119 -0
- package/tests/skill-registry.test.ts +311 -5
- package/tests/startup-banner.test.ts +117 -3
- package/tests/startup-home-repo.test.ts +170 -0
- package/tests/status-timing-diagnostics.test.ts +283 -0
- package/tests/support/orchestrator-modules.ts +19 -0
- package/tests/task-size-routing-contract.test.ts +241 -0
- package/tests/telemetry-trigger.test.ts +27 -1
- package/tests/test-strength-contract.test.ts +124 -0
- package/tests/verify-agent-contract.test.ts +90 -0
- package/tests/verify-first-launch-contract.test.ts +139 -0
- package/tests/verify-package-files.test.ts +56 -0
- package/tests/vim-editor-adapter.test.ts +7 -7
- package/tests/visual-customization-policy.test.ts +32 -3
- package/tests/visual-customize-view.test.ts +288 -10
- package/tests/writer-edit-surface-scope.test.ts +59 -2
- package/tests/writer-surfaces.test.ts +199 -0
- package/tests/yolo-customize.test.ts +18 -3
- package/tests/yolo-mode-runtime.test.ts +37 -10
- package/tests/yolo-mode.test.ts +32 -4
- package/tests/yolo-session-policy.test.ts +1 -1
- /package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/README.md +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/schemas/lens.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/schemas/refuter.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/schemas/targeted-validator.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/vectors/lens.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/vectors/refuter.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.2.0 → v1.3.0}/bundle/vectors/targeted-validator.json +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Generated by scripts/build-runtime-modules.mjs. Do not edit.
|
|
2
|
-
import { join, resolve as resolvePath } from "node:path";
|
|
2
|
+
import { isAbsolute, join, resolve as resolvePath } from "node:path";
|
|
3
|
+
import { CHILD_PACKAGE_INJECTION_ENV, encodeChildPackageInjection, } from "./child-package-injection.mjs";
|
|
3
4
|
|
|
4
5
|
// The gentle-shell launcher: pure, side-effect-free functions over injected
|
|
5
6
|
// env/fs/exec. `bin/gentle-shell.mjs` (T2) wires these into the real process,
|
|
@@ -36,11 +37,12 @@ function isPiSubcommand(token ) {
|
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
|
|
39
|
-
// Home-subcommand parsing is deliberately shallow:
|
|
40
|
-
// subcommand when it is argv[0], and everything after it is handed over
|
|
40
|
+
// Home-, upgrade- and self-uninstall-subcommand parsing is deliberately shallow:
|
|
41
|
+
// each only counts as the subcommand when it is argv[0], and everything after it is handed over
|
|
41
42
|
// untouched as commandArgs — T2 owns interpreting `home link|isolated|<path>`.
|
|
43
|
+
// `self-uninstall` is not `uninstall`, which stays pi's own alias for `remove`.
|
|
42
44
|
export function parseLauncherArgs(argv ) {
|
|
43
|
-
if (argv[0] === "home") {
|
|
45
|
+
if (argv[0] === "home" || argv[0] === "upgrade" || argv[0] === "self-uninstall") {
|
|
44
46
|
return {
|
|
45
47
|
link: false,
|
|
46
48
|
isolated: false,
|
|
@@ -48,7 +50,7 @@ export function parseLauncherArgs(argv ) {
|
|
|
48
50
|
packageRoot: undefined,
|
|
49
51
|
help: false,
|
|
50
52
|
version: false,
|
|
51
|
-
command:
|
|
53
|
+
command: argv[0],
|
|
52
54
|
commandArgs: argv.slice(1),
|
|
53
55
|
passthrough: [],
|
|
54
56
|
piSubcommand: undefined,
|
|
@@ -189,35 +191,36 @@ export function parseLauncherArgs(argv ) {
|
|
|
189
191
|
|
|
190
192
|
|
|
191
193
|
|
|
192
|
-
// Pi Subagents resolves `PI_CODING_AGENT_DIR || ~/.pi/agent`;
|
|
193
|
-
//
|
|
194
|
+
// Pi Subagents resolves `PI_CODING_AGENT_DIR || ~/.pi/agent`; this is the
|
|
195
|
+
// user's own pi home when no Gentle Shell session is involved.
|
|
194
196
|
function linkDir(env , homedir ) {
|
|
195
197
|
return env.PI_CODING_AGENT_DIR || join(homedir, ".pi", "agent");
|
|
196
198
|
}
|
|
197
199
|
|
|
198
200
|
// The isolated home replaces PI_CODING_AGENT_DIR for the whole session, so the
|
|
199
201
|
// user's own Pi home travels in this variable for read-only features such as
|
|
200
|
-
// /gentle:stats
|
|
201
|
-
// a Gentle Shell session sees the outer isolated home as
|
|
202
|
+
// /gentle:stats and for `--link`. An inherited value wins: a gentle-shell
|
|
203
|
+
// launched from inside a Gentle Shell session sees the outer isolated home as
|
|
204
|
+
// PI_CODING_AGENT_DIR, so `--link` must not re-select it (#2015).
|
|
202
205
|
export const USER_PI_HOME_ENV = "GENTLE_SHELL_USER_PI_HOME";
|
|
203
206
|
|
|
204
207
|
export function userPiHome(env , homedir ) {
|
|
205
208
|
return env[USER_PI_HOME_ENV] || linkDir(env, homedir);
|
|
206
209
|
}
|
|
207
210
|
|
|
208
|
-
function isolatedDir(env , homedir ) {
|
|
211
|
+
export function isolatedDir(env , homedir ) {
|
|
209
212
|
return env.GENTLE_SHELL_HOME || join(homedir, ".gentle-shell", "agent");
|
|
210
213
|
}
|
|
211
214
|
|
|
212
215
|
export function resolveHome(input ) {
|
|
213
216
|
const { args, env, homedir, config } = input;
|
|
214
217
|
|
|
215
|
-
if (args.link) return { mode: "link", dir:
|
|
218
|
+
if (args.link) return { mode: "link", dir: userPiHome(env, homedir), source: "flag" };
|
|
216
219
|
if (args.isolated) return { mode: "isolated", dir: isolatedDir(env, homedir), source: "flag" };
|
|
217
220
|
if (args.home !== undefined) return { mode: "path", dir: args.home, source: "flag" };
|
|
218
221
|
|
|
219
222
|
if (config !== undefined) {
|
|
220
|
-
if (config.mode === "link") return { mode: "link", dir:
|
|
223
|
+
if (config.mode === "link") return { mode: "link", dir: userPiHome(env, homedir), source: "config" };
|
|
221
224
|
if (config.mode === "isolated") return { mode: "isolated", dir: isolatedDir(env, homedir), source: "config" };
|
|
222
225
|
return { mode: "path", dir: config.dir, source: "config" };
|
|
223
226
|
}
|
|
@@ -883,6 +886,10 @@ export function discoverLooseExtensionEntries(dir , fs )
|
|
|
883
886
|
|
|
884
887
|
|
|
885
888
|
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
|
|
886
893
|
|
|
887
894
|
|
|
888
895
|
|
|
@@ -920,8 +927,15 @@ export function discoverLooseExtensionEntries(dir , fs )
|
|
|
920
927
|
// - Not takeOver, with a declaration: no injection at all — the target
|
|
921
928
|
// settings already load a gentle-pi the launcher accepts as-is (the
|
|
922
929
|
// `--link` case with a pi-managed install matching this launcher).
|
|
930
|
+
//
|
|
931
|
+
// The two injecting cases also export CHILD_PACKAGE_INJECTION_ENV (#1690) so
|
|
932
|
+
// the subagent runner can give delegated children the same package. It holds
|
|
933
|
+
// only the launcher's own computed -e set; passthrough -e flags (the managed
|
|
934
|
+
// herdr extension, or one the user typed) are not part of it. Every other case
|
|
935
|
+
// removes an inherited value, so a nested launch never leaks a stale signal.
|
|
923
936
|
export function buildPiInvocation(input ) {
|
|
924
937
|
const args = [...input.runtime.args];
|
|
938
|
+
let childInjection ;
|
|
925
939
|
|
|
926
940
|
if (input.piSubcommand !== undefined) {
|
|
927
941
|
// No injection at all: pi must see the bare subcommand as argv[0].
|
|
@@ -946,23 +960,36 @@ export function buildPiInvocation(input ) {
|
|
|
946
960
|
injected.add(input.packageRoot);
|
|
947
961
|
args.push("-e", input.packageRoot);
|
|
948
962
|
}
|
|
949
|
-
|
|
963
|
+
// The argv dedupe above compares raw strings; the signal dedupes again
|
|
964
|
+
// after absolutizing, so a relative and an absolute spelling of the same
|
|
965
|
+
// file appear once, in first-occurrence order.
|
|
966
|
+
const signalPaths = new Set([...injected].map((path) => absoluteExtensionPath(path, input.cwd)));
|
|
967
|
+
childInjection = { noExtensions: true, extensionPaths: [...signalPaths] };
|
|
950
968
|
} else if (input.declaration === undefined) {
|
|
951
969
|
args.push("-e", input.packageRoot);
|
|
970
|
+
childInjection = { noExtensions: false, extensionPaths: [absoluteExtensionPath(input.packageRoot, input.cwd)] };
|
|
952
971
|
}
|
|
953
972
|
|
|
954
973
|
args.push(...input.passthrough);
|
|
955
974
|
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
PI_CODING_AGENT_DIR: input.home.dir,
|
|
962
|
-
GENTLE_PI_AGENT_HOME: input.home.dir,
|
|
963
|
-
[USER_PI_HOME_ENV]: userPiHome(input.baseEnv, input.homedir),
|
|
964
|
-
},
|
|
975
|
+
const env = {
|
|
976
|
+
...input.baseEnv,
|
|
977
|
+
PI_CODING_AGENT_DIR: input.home.dir,
|
|
978
|
+
GENTLE_PI_AGENT_HOME: input.home.dir,
|
|
979
|
+
[USER_PI_HOME_ENV]: userPiHome(input.baseEnv, input.homedir),
|
|
965
980
|
};
|
|
981
|
+
if (childInjection === undefined) delete env[CHILD_PACKAGE_INJECTION_ENV];
|
|
982
|
+
else env[CHILD_PACKAGE_INJECTION_ENV] = encodeChildPackageInjection(childInjection);
|
|
983
|
+
|
|
984
|
+
return { command: input.runtime.command, args, env };
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
// pi resolves a relative -e path against its spawn cwd. Children may run
|
|
988
|
+
// elsewhere, so the signal carries the same file as an absolute path. Loose
|
|
989
|
+
// entries can be relative when the isolated or linked home comes from a
|
|
990
|
+
// relative env value.
|
|
991
|
+
function absoluteExtensionPath(path , cwd ) {
|
|
992
|
+
return isAbsolute(path) ? path : resolvePath(cwd, path);
|
|
966
993
|
}
|
|
967
994
|
|
|
968
995
|
// --- spawn planning ------------------------------------------------------------
|
|
@@ -1149,6 +1176,9 @@ export function helpText() {
|
|
|
1149
1176
|
"Usage: gentle-shell [options] [-- pi-args...]",
|
|
1150
1177
|
" gentle-shell home [link|isolated|<path>]",
|
|
1151
1178
|
" gentle-shell [home selectors] setup [--dry-run]",
|
|
1179
|
+
" gentle-shell upgrade [--channel release|main]",
|
|
1180
|
+
" gentle-shell upgrade --rollback",
|
|
1181
|
+
" gentle-shell self-uninstall [--dry-run] [--yes] [--include-shared]",
|
|
1152
1182
|
"",
|
|
1153
1183
|
"Opens pi with the Gentle Shell package loaded, without touching your",
|
|
1154
1184
|
"vanilla pi installation.",
|
|
@@ -1168,19 +1198,40 @@ export function helpText() {
|
|
|
1168
1198
|
" (runs the package-local gentle-ai 'install --agent pi --scope global').",
|
|
1169
1199
|
" Accepts --dry-run, forwarded to gentle-ai. Accepts a home selector",
|
|
1170
1200
|
" (--link, --isolated, --home <dir>) before it.",
|
|
1201
|
+
" Warns if configured MCP servers remain disabled; never re-enables them.",
|
|
1202
|
+
" upgrade Update Gentle Shell along its channel: the latest release, or the latest",
|
|
1203
|
+
" main commits of Gentle Shell and Gentle AI (built locally; needs Go and",
|
|
1204
|
+
" pnpm). --channel switches the channel first. A bundled install (the web",
|
|
1205
|
+
" installer's own Node, pnpm and Pi) follows the release channel only:",
|
|
1206
|
+
" it installs the new version beside the current one, verifies it, then",
|
|
1207
|
+
" switches; --rollback switches back to the previous kept version.",
|
|
1208
|
+
" self-uninstall Remove Gentle Shell: its own data, the isolated home and the gentle-pi",
|
|
1209
|
+
" package. Shows the plan first and asks before removing (--yes skips",
|
|
1210
|
+
" the question). The shared ~/.pi/gentle-ai configuration is kept unless",
|
|
1211
|
+
" you accept or pass --include-shared; --dry-run only shows the plan.",
|
|
1212
|
+
" Never touches your pi home or custom --home homes.",
|
|
1171
1213
|
"",
|
|
1172
1214
|
"Managing packages:",
|
|
1173
1215
|
" gentle-shell install npm:<pkg> Run pi's own 'install' against the resolved home.",
|
|
1174
1216
|
" gentle-shell remove <source> Run pi's own 'remove' against the resolved home.",
|
|
1175
1217
|
" gentle-shell list Run pi's own 'list' against the resolved home.",
|
|
1176
1218
|
" gentle-shell update [target] Run pi's own 'update' against the resolved home.",
|
|
1219
|
+
" In a bundled install Pi ships pinned: 'update' without a package",
|
|
1220
|
+
" runs 'gentle-shell upgrade' instead of updating Pi.",
|
|
1177
1221
|
" gentle-shell config Run pi's own 'config' against the resolved home.",
|
|
1178
1222
|
" gentle-shell auth <command> Run pi's own 'auth' against the resolved home.",
|
|
1223
|
+
" 'gentle-shell uninstall <source>' is pi's own alias for 'remove'; to remove Gentle",
|
|
1224
|
+
" Shell itself, use 'gentle-shell self-uninstall'.",
|
|
1179
1225
|
" These run pi's own commands, forwarded verbatim, against the --isolated home",
|
|
1180
1226
|
" (or your own pi home with --link). Running 'gentle-shell install npm:gentle-pi'",
|
|
1181
1227
|
" inside the isolated home is unnecessary: gentle-shell already loads the",
|
|
1182
1228
|
" package itself.",
|
|
1183
1229
|
"",
|
|
1230
|
+
"Bundled interactive startup:",
|
|
1231
|
+
" Before opening Pi, checks for a newer release (at most 1.5 seconds).",
|
|
1232
|
+
" Choose Update now to upgrade and reopen, Not now, or Skip this version.",
|
|
1233
|
+
" Offline, unavailable checks, commands and noninteractive runs open normally.",
|
|
1234
|
+
"",
|
|
1184
1235
|
"Environment variables:",
|
|
1185
1236
|
" GENTLE_SHELL_PI Path to the pi executable to run.",
|
|
1186
1237
|
" GENTLE_SHELL_HOME Directory for the isolated home (default: ~/.gentle-shell/agent).",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Generated by scripts/build-runtime-modules.mjs. Do not edit.
|
|
2
|
+
import { realpathSync, readFileSync } from "node:fs";
|
|
3
|
+
import { join, relative, isAbsolute } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
|
|
6
|
+
// Resolve through the switched version, never the old launcher's captured pins.
|
|
7
|
+
export async function resolveStartupRelaunch(input
|
|
8
|
+
|
|
9
|
+
) {
|
|
10
|
+
const { activeVersion, prefixLayout } = await import("../scripts/bundled-install.mjs");
|
|
11
|
+
const layout = prefixLayout(input);
|
|
12
|
+
const id = activeVersion(layout);
|
|
13
|
+
if (!id) throw new Error("No active Gentle Shell after upgrade");
|
|
14
|
+
const versions = realpathSync(layout.versions);
|
|
15
|
+
const version = realpathSync(join(versions, id));
|
|
16
|
+
const inside = (root , file ) => {
|
|
17
|
+
const path = relative(root, file);
|
|
18
|
+
return path !== "" && !path.startsWith("..") && !isAbsolute(path);
|
|
19
|
+
};
|
|
20
|
+
if (!inside(versions, version) || readFileSync(join(version, ".gentle-shell-version"), "utf8") !== `${id}\n`) {
|
|
21
|
+
throw new Error("Invalid active Gentle Shell version");
|
|
22
|
+
}
|
|
23
|
+
const pkg = join(version, "node_modules", "gentle-pi");
|
|
24
|
+
const modulePath = realpathSync(join(pkg, "scripts", "bundled-install.mjs"));
|
|
25
|
+
const entry = realpathSync(join(pkg, "bin", "gentle-shell.mjs"));
|
|
26
|
+
if (!inside(version, modulePath) || !inside(version, entry)) throw new Error("Active launcher escaped its version");
|
|
27
|
+
const release = await import(pathToFileURL(modulePath).href);
|
|
28
|
+
const next = release.prefixLayout(input);
|
|
29
|
+
return { command: next.node, args: [entry, ...input.argv], env: { ...input.env, GENTLE_SHELL_SKIP_STARTUP_UPDATE: "1" } };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Only an explicit update selection may cross the existing upgrade boundary.
|
|
33
|
+
export async function applyStartupChoice(choice , effects
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
) {
|
|
39
|
+
if (choice === "cancel") return 130;
|
|
40
|
+
if (choice === "omit") {
|
|
41
|
+
try { effects.omit(); }
|
|
42
|
+
catch { effects.warn?.("Could not remember the skipped release; continuing without saving."); }
|
|
43
|
+
}
|
|
44
|
+
if (choice !== "update") return undefined;
|
|
45
|
+
if (await effects.upgrade() !== 0) return undefined;
|
|
46
|
+
// A failed relaunch must not fall through to the captured old packageRoot.
|
|
47
|
+
return effects.relaunch();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function omitStartupVersion(read , write , version ) {
|
|
51
|
+
const text = read();
|
|
52
|
+
const config = text === undefined ? {} : JSON.parse(text);
|
|
53
|
+
if (config === null || typeof config !== "object" || Array.isArray(config)) throw new Error("Invalid launcher config");
|
|
54
|
+
write(`${JSON.stringify({ ...config, skippedStartupRelease: version }, null, 2)}\n`);
|
|
55
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// Generated by scripts/build-runtime-modules.mjs. Do not edit.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export function shouldCheckStartupUpdate({ args, env, bundled, inputTTY, outputTTY } ) {
|
|
26
|
+
if (!bundled || !inputTTY || !outputTTY || args.command || args.piSubcommand || args.error || args.help || args.version || args.packageRoot !== undefined) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (env.GENTLE_PI_AGENTS_CHILD || env.PI_OFFLINE || env.GENTLE_SHELL_SKIP_STARTUP_UPDATE) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// An allowlist keeps new command modes from accidentally showing a prompt.
|
|
34
|
+
for (let i = 0; i < args.passthrough.length; i += 1) {
|
|
35
|
+
const token = args.passthrough[i];
|
|
36
|
+
if (token === "--continue" || token === "-c") continue;
|
|
37
|
+
if (token.startsWith("--resume=") && token.length > "--resume=".length) continue;
|
|
38
|
+
if (token === "--resume" || token === "-r") {
|
|
39
|
+
const next = args.passthrough[i + 1];
|
|
40
|
+
if (next !== undefined && !next.startsWith("-")) i += 1;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function stableParts(version ) {
|
|
49
|
+
// No leading zeros, prefixes, whitespace, prereleases or build metadata.
|
|
50
|
+
const match = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.exec(version);
|
|
51
|
+
return match && match[0] === version ? match.slice(1) : undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function isNewer(latest , current ) {
|
|
55
|
+
for (let i = 0; i < 3; i += 1) {
|
|
56
|
+
if (latest[i] === current[i]) continue;
|
|
57
|
+
// Decimal string comparison avoids rounding even for arbitrarily large parts.
|
|
58
|
+
return latest[i].length !== current[i].length
|
|
59
|
+
? latest[i].length > current[i].length
|
|
60
|
+
: latest[i] > current[i];
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function findStartupUpdate({ current, skipped, lookup, timeoutMs = 1500 } ) {
|
|
66
|
+
const currentParts = stableParts(current);
|
|
67
|
+
if (!currentParts) return undefined;
|
|
68
|
+
const controller = new AbortController();
|
|
69
|
+
const deadline = Number.isFinite(timeoutMs) && timeoutMs >= 0 && timeoutMs <= 2_147_483_647 ? timeoutMs : 1500;
|
|
70
|
+
let timer ;
|
|
71
|
+
try {
|
|
72
|
+
const timeout = new Promise ((resolve) => {
|
|
73
|
+
timer = setTimeout(() => {
|
|
74
|
+
resolve(undefined);
|
|
75
|
+
controller.abort();
|
|
76
|
+
}, deadline);
|
|
77
|
+
});
|
|
78
|
+
// The race bounds startup even if the injected lookup ignores cancellation.
|
|
79
|
+
const latest = await Promise.race([lookup(controller.signal), timeout]);
|
|
80
|
+
if (latest === undefined || latest === skipped) return undefined;
|
|
81
|
+
const latestParts = stableParts(latest);
|
|
82
|
+
if (!latestParts || !isNewer(latestParts, currentParts)) return undefined;
|
|
83
|
+
return {
|
|
84
|
+
current,
|
|
85
|
+
latest,
|
|
86
|
+
notesUrl: `https://github.com/Gentleman-Programming/gentle-shell/releases/tag/v${latest}`,
|
|
87
|
+
};
|
|
88
|
+
} catch {
|
|
89
|
+
return undefined;
|
|
90
|
+
} finally {
|
|
91
|
+
clearTimeout(timer);
|
|
92
|
+
}
|
|
93
|
+
}
|