@timurproko/a1 0.2.7-dev.1245 → 0.2.7-dev.1252
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 +11 -36
- package/bin/cli.js +2 -17
- package/bin/ui.js +7 -48
- package/dist/app/session-shell/exit-notice.d.ts +2 -2
- package/dist/app/session-shell/exit-notice.js +10 -10
- package/dist/app/session-shell/prompt-submission.d.ts +2 -4
- package/dist/app/session-shell/prompt-submission.js +3 -23
- package/dist/app/session-shell/response-copy-transport.js +1 -2
- package/dist/app/session-shell/session-lifecycle.d.ts +1 -2
- package/dist/app/session-shell/session-lifecycle.js +2 -4
- package/dist/app/session-shell/session-shell-root.d.ts +0 -31
- package/dist/app/session-shell/session-shell-root.js +3 -4
- package/dist/app/session-shell/session-shell.js +6 -47
- package/dist/app/session-shell/session-viewport-controller.js +3 -6
- package/dist/app/session-shell/shell-host.js +2 -18
- package/dist/app/session-shell/transcript-document.d.ts +1 -2
- package/dist/app/session-shell/transcript-document.js +3 -28
- package/dist/app/session-shell/workflow-output.js +1 -1
- package/dist/app/session-shell/workflow-router.d.ts +1 -3
- package/dist/app/session-shell/workflow-router.js +1 -4
- package/dist/cli/dispatch.d.ts +1 -11
- package/dist/cli/dispatch.js +5 -92
- package/dist/cli/session-context.js +5 -7
- package/dist/cli/uninstall.d.ts +1 -5
- package/dist/cli/uninstall.js +6 -35
- package/dist/cli/version-stats.js +4 -7
- package/dist/composition/owned-settings.d.ts +0 -1
- package/dist/composition/owned-settings.js +0 -1
- package/dist/composition/owned-ui.d.ts +2 -24
- package/dist/composition/owned-ui.js +11 -87
- package/dist/composition/release-update-observation.d.ts +4 -4
- package/dist/composition/release-update-observation.js +17 -47
- package/dist/composition/session-backend.d.ts +0 -1
- package/dist/composition/session-runtime-registry.d.ts +3 -3
- package/dist/composition/settings-route-host.d.ts +0 -7
- package/dist/composition/settings-route-host.js +4 -10
- package/dist/composition/startup-route.d.ts +0 -1
- package/dist/composition/startup-route.js +0 -1
- package/dist/contracts/owned-ui/index.d.ts +1 -1
- package/dist/contracts/owned-ui/model.d.ts +0 -3
- package/dist/contracts/owned-ui/session-workflows.d.ts +1 -4
- package/dist/features/launch/development-launch.js +0 -1
- package/dist/features/launch/index.d.ts +1 -1
- package/dist/features/launch/intent.d.ts +1 -3
- package/dist/features/launch/intent.js +2 -4
- package/dist/features/launch/session-context.d.ts +2 -2
- package/dist/features/owned-ui/reference-screen-app.d.ts +0 -2
- package/dist/features/owned-ui/reference-screen-app.js +2 -9
- package/dist/features/owned-ui/settings-app.d.ts +0 -6
- package/dist/features/owned-ui/settings-app.js +5 -36
- package/dist/foundation/launch-context/index.d.ts +0 -12
- package/dist/foundation/launch-context/index.js +0 -26
- package/dist/foundation/lifecycle/claim-gate.d.ts +8 -0
- package/dist/foundation/lifecycle/claim-gate.js +37 -0
- package/dist/foundation/lifecycle/index.d.ts +5 -9
- package/dist/foundation/lifecycle/index.js +3 -4
- package/dist/foundation/lifecycle/model.d.ts +2 -59
- package/dist/foundation/lifecycle/model.js +0 -35
- package/dist/foundation/lifecycle/paths.d.ts +0 -24
- package/dist/foundation/lifecycle/paths.js +0 -40
- package/dist/foundation/lifecycle/process-liveness.d.ts +8 -0
- package/dist/foundation/lifecycle/process-liveness.js +18 -0
- package/dist/foundation/lifecycle/session-claim-lock.d.ts +1 -1
- package/dist/foundation/lifecycle/session-claim-lock.js +2 -2
- package/dist/foundation/lifecycle/session-repository-context.d.ts +6 -6
- package/dist/foundation/lifecycle/session-repository-context.js +2 -3
- package/dist/foundation/release/automatic-update.d.ts +1 -3
- package/dist/foundation/release/automatic-update.js +9 -30
- package/dist/foundation/release/bootstrap.d.ts +2 -25
- package/dist/foundation/release/bootstrap.js +33 -344
- package/dist/foundation/release/cohort-state.d.ts +21 -46
- package/dist/foundation/release/cohort-state.js +30 -62
- package/dist/foundation/release/dependency-certification.d.ts +1 -1
- package/dist/foundation/release/index.d.ts +10 -17
- package/dist/foundation/release/index.js +7 -11
- package/dist/foundation/release/latest-release.d.ts +1 -2
- package/dist/foundation/release/latest-release.js +1 -2
- package/dist/foundation/release/process-liveness.d.ts +2 -0
- package/dist/foundation/release/process-liveness.js +12 -0
- package/dist/foundation/release/release-gc.d.ts +12 -9
- package/dist/foundation/release/release-gc.js +34 -98
- package/dist/foundation/release/release-store.d.ts +2 -2
- package/dist/foundation/release/release-store.js +2 -2
- package/dist/foundation/release/restart-certification.js +1 -1
- package/dist/foundation/release/update-activation.d.ts +2 -9
- package/dist/foundation/release/update-activation.js +28 -43
- package/dist/foundation/release/update-execution-lease.js +1 -1
- package/dist/foundation/release/update-launch.d.ts +0 -2
- package/dist/foundation/release/update-launch.js +0 -7
- package/dist/foundation/release/update-recovery.js +1 -1
- package/dist/foundation/release/update-transaction.d.ts +1 -1
- package/dist/foundation/release/update-transaction.js +5 -2
- package/dist/foundation/release/update.d.ts +2 -10
- package/dist/foundation/release/update.js +23 -200
- package/dist/foundation/session-writer-lock/index.d.ts +14 -6
- package/dist/foundation/session-writer-lock/index.js +48 -103
- package/dist/foundation/startup/startup-runtime.d.ts +1 -1
- package/dist/foundation/terminal-cleanup/exit-notice.d.ts +6 -0
- package/dist/foundation/terminal-cleanup/exit-notice.js +36 -0
- package/dist/foundation/terminal-cleanup/index.d.ts +2 -1
- package/dist/foundation/terminal-cleanup/index.js +2 -1
- package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +0 -5
- package/dist/foundation/terminal-cleanup/terminal-reset.js +0 -5
- package/dist/integrations/pi/components/index.d.ts +1 -1
- package/dist/integrations/pi/components/index.js +1 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +1 -4
- package/dist/integrations/pi/components/shell-footer-status.d.ts +1 -1
- package/dist/integrations/pi/components/shell-footer-status.js +2 -2
- package/dist/integrations/pi/components/shell-hotkey-sections.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +2 -5
- package/dist/integrations/pi/components/shell-presenters-info.js +4 -18
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.js +1 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +0 -2
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +2 -5
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +2 -16
- package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +1 -2
- package/dist/integrations/pi/components/upstream/components/session-footer.js +6 -8
- package/dist/integrations/pi/engine/adapter.d.ts +0 -1
- package/dist/integrations/pi/engine/adapter.js +1 -16
- package/dist/integrations/pi/engine/compaction-progress.js +13 -5
- package/dist/integrations/pi/engine/diagnostics-state.d.ts +0 -1
- package/dist/integrations/pi/engine/diagnostics-state.js +0 -14
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +0 -1
- package/dist/integrations/pi/engine/prompt-suggestions.js +0 -40
- package/dist/integrations/pi/engine/session-runtime.js +0 -2
- package/dist/integrations/pi/engine/workflow-runner.js +1 -1
- package/dist/integrations/pi/tui-runtime/adapter.d.ts +2 -2
- package/dist/integrations/pi/tui-runtime/adapter.js +2 -2
- package/dist/product-identity.d.ts +4 -6
- package/dist/product-identity.js +6 -11
- package/dist/product-identity.json +1 -40
- package/dist/runtime-payload-inventory.json +0 -3
- package/dist/ui/components/index.d.ts +2 -2
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/submitted-prompt.d.ts +3 -13
- package/dist/ui/components/submitted-prompt.js +8 -41
- package/dist/ui/components/transcript-viewport.d.ts +1 -3
- package/dist/ui/components/transcript-viewport.js +1 -4
- package/dist/ui/settings/declarations.d.ts +3 -97
- package/dist/ui/settings/declarations.js +3 -78
- package/dist/ui/settings/migrations.js +18 -2
- package/docs/architecture/boundaries.md +22 -39
- package/docs/architecture/code-documentation.md +2 -2
- package/docs/architecture/internal-naming.md +9 -17
- package/docs/architecture/project-structure.md +30 -29
- package/docs/architecture/resource-and-data-policy.md +16 -31
- package/docs/architecture/toolchain.md +14 -19
- package/docs/architecture/ui-reference-provenance.md +2 -2
- package/docs/ci-release-runbook.md +6 -4
- package/docs/features/launch-profiles.md +11 -17
- package/docs/features/prompt-history.md +10 -11
- package/docs/local-worktree-cleanup.md +32 -1
- package/docs/manual-owned-ui-checkpoint.md +0 -1
- package/docs/openspec-archive-automation.md +11 -3
- package/docs/validation.md +5 -9
- package/docs/worktree-link-recovery.md +6 -6
- package/package.json +7 -19
- package/bin/guardian.js +0 -42
- package/bin/supervisor.js +0 -7
- package/bin/tab-launch-context.d.ts +0 -27
- package/bin/tab-launch-context.js +0 -94
- package/dist/app/session-shell/resident-tab-coordinator.d.ts +0 -38
- package/dist/app/session-shell/resident-tab-coordinator.js +0 -77
- package/dist/cli/tabs-request.d.ts +0 -7
- package/dist/cli/tabs-request.js +0 -1
- package/dist/cli/tabs.d.ts +0 -14
- package/dist/cli/tabs.js +0 -151
- package/dist/composition/resident-tab-bridge.d.ts +0 -41
- package/dist/composition/resident-tab-bridge.js +0 -209
- package/dist/composition/utility-tab.d.ts +0 -28
- package/dist/composition/utility-tab.js +0 -244
- package/dist/features/owned-ui/plus-menu-dialog.d.ts +0 -28
- package/dist/features/owned-ui/plus-menu-dialog.js +0 -89
- package/dist/features/resident-tab/auto-name.d.ts +0 -11
- package/dist/features/resident-tab/auto-name.js +0 -44
- package/dist/features/resident-tab/index.d.ts +0 -5
- package/dist/features/resident-tab/index.js +0 -7
- package/dist/features/resident-tab/shortcut-bindings-file.d.ts +0 -8
- package/dist/features/resident-tab/shortcut-bindings-file.js +0 -40
- package/dist/features/resident-tab/shortcut-declarations.d.ts +0 -13
- package/dist/features/resident-tab/shortcut-declarations.js +0 -26
- package/dist/features/resident-tab/shortcut-projection.d.ts +0 -29
- package/dist/features/resident-tab/shortcut-projection.js +0 -64
- package/dist/features/resident-tab/status-deriver.d.ts +0 -10
- package/dist/features/resident-tab/status-deriver.js +0 -12
- package/dist/foundation/launch-guardian/exit-watcher.d.ts +0 -14
- package/dist/foundation/launch-guardian/exit-watcher.js +0 -103
- package/dist/foundation/launch-guardian/index.d.ts +0 -2
- package/dist/foundation/launch-guardian/index.js +0 -1
- package/dist/foundation/launch-guardian/main.d.ts +0 -39
- package/dist/foundation/launch-guardian/main.js +0 -232
- package/dist/foundation/lifecycle/commands.d.ts +0 -40
- package/dist/foundation/lifecycle/commands.js +0 -1
- package/dist/foundation/lifecycle/launch-instance.d.ts +0 -46
- package/dist/foundation/lifecycle/launch-instance.js +0 -134
- package/dist/foundation/lifecycle/native-claim-gate.d.ts +0 -5
- package/dist/foundation/lifecycle/native-claim-gate.js +0 -41
- package/dist/foundation/lifecycle/supervisor-startup.d.ts +0 -30
- package/dist/foundation/lifecycle/supervisor-startup.js +0 -106
- package/dist/foundation/process-containment/addon-containment.d.ts +0 -20
- package/dist/foundation/process-containment/addon-containment.js +0 -139
- package/dist/foundation/process-containment/addon-process-inspector.d.ts +0 -11
- package/dist/foundation/process-containment/addon-process-inspector.js +0 -36
- package/dist/foundation/process-containment/addon.d.ts +0 -47
- package/dist/foundation/process-containment/addon.js +0 -57
- package/dist/foundation/process-containment/artifact.d.ts +0 -1
- package/dist/foundation/process-containment/artifact.js +0 -35
- package/dist/foundation/process-containment/contracts.d.ts +0 -33
- package/dist/foundation/process-containment/contracts.js +0 -35
- package/dist/foundation/process-containment/index.d.ts +0 -9
- package/dist/foundation/process-containment/index.js +0 -7
- package/dist/foundation/process-containment/linux-process-inspector.d.ts +0 -7
- package/dist/foundation/process-containment/linux-process-inspector.js +0 -27
- package/dist/foundation/process-containment/native-process-inspector.d.ts +0 -4
- package/dist/foundation/process-containment/native-process-inspector.js +0 -21
- package/dist/foundation/protocol/client.d.ts +0 -18
- package/dist/foundation/protocol/client.js +0 -130
- package/dist/foundation/protocol/index.d.ts +0 -3
- package/dist/foundation/protocol/index.js +0 -2
- package/dist/foundation/protocol/messages.d.ts +0 -90
- package/dist/foundation/protocol/messages.js +0 -100
- package/dist/foundation/release/cohort-selection.d.ts +0 -33
- package/dist/foundation/release/cohort-selection.js +0 -67
- package/dist/foundation/release/endpoint-lock.d.ts +0 -2
- package/dist/foundation/release/endpoint-lock.js +0 -37
- package/dist/foundation/release/endpoint-recovery.d.ts +0 -10
- package/dist/foundation/release/endpoint-recovery.js +0 -45
- package/dist/foundation/release/endpoints.d.ts +0 -32
- package/dist/foundation/release/endpoints.js +0 -152
- package/dist/foundation/release/prepared-update-activation.d.ts +0 -3
- package/dist/foundation/release/prepared-update-activation.js +0 -27
- package/dist/foundation/release/process-cleanup.d.ts +0 -14
- package/dist/foundation/release/process-cleanup.js +0 -76
- package/dist/foundation/release/supervisor-identity.d.ts +0 -15
- package/dist/foundation/release/supervisor-identity.js +0 -63
- package/dist/foundation/resident-tabs/boot-identity.d.ts +0 -6
- package/dist/foundation/resident-tabs/boot-identity.js +0 -16
- package/dist/foundation/resident-tabs/bounded-host-command.d.ts +0 -20
- package/dist/foundation/resident-tabs/bounded-host-command.js +0 -62
- package/dist/foundation/resident-tabs/bridge-client.d.ts +0 -73
- package/dist/foundation/resident-tabs/bridge-client.js +0 -327
- package/dist/foundation/resident-tabs/continuity.d.ts +0 -12
- package/dist/foundation/resident-tabs/continuity.js +0 -63
- package/dist/foundation/resident-tabs/doctor.d.ts +0 -28
- package/dist/foundation/resident-tabs/doctor.js +0 -166
- package/dist/foundation/resident-tabs/draft-checkpoint.d.ts +0 -27
- package/dist/foundation/resident-tabs/draft-checkpoint.js +0 -145
- package/dist/foundation/resident-tabs/ensure-terminal-host.d.ts +0 -36
- package/dist/foundation/resident-tabs/ensure-terminal-host.js +0 -151
- package/dist/foundation/resident-tabs/fault-injection.d.ts +0 -8
- package/dist/foundation/resident-tabs/fault-injection.js +0 -26
- package/dist/foundation/resident-tabs/fixture-control.d.ts +0 -7
- package/dist/foundation/resident-tabs/fixture-control.js +0 -35
- package/dist/foundation/resident-tabs/host-entry.d.ts +0 -1
- package/dist/foundation/resident-tabs/host-entry.js +0 -17
- package/dist/foundation/resident-tabs/index.d.ts +0 -15
- package/dist/foundation/resident-tabs/index.js +0 -10
- package/dist/foundation/resident-tabs/maintenance.d.ts +0 -39
- package/dist/foundation/resident-tabs/maintenance.js +0 -75
- package/dist/foundation/resident-tabs/progress-observation-schema.d.ts +0 -34
- package/dist/foundation/resident-tabs/progress-observation-schema.js +0 -1
- package/dist/foundation/resident-tabs/progress-observation.d.ts +0 -4
- package/dist/foundation/resident-tabs/progress-observation.js +0 -150
- package/dist/foundation/resident-tabs/prompt-journal.d.ts +0 -63
- package/dist/foundation/resident-tabs/prompt-journal.js +0 -213
- package/dist/foundation/resident-tabs/protocol.d.ts +0 -12
- package/dist/foundation/resident-tabs/protocol.js +0 -195
- package/dist/foundation/resident-tabs/recovery.d.ts +0 -26
- package/dist/foundation/resident-tabs/recovery.js +0 -205
- package/dist/foundation/resident-tabs/release-holds.d.ts +0 -28
- package/dist/foundation/resident-tabs/release-holds.js +0 -78
- package/dist/foundation/resident-tabs/routes.d.ts +0 -5
- package/dist/foundation/resident-tabs/routes.js +0 -5
- package/dist/foundation/resident-tabs/routing.d.ts +0 -11
- package/dist/foundation/resident-tabs/routing.js +0 -10
- package/dist/foundation/resident-tabs/runtime-control.d.ts +0 -38
- package/dist/foundation/resident-tabs/runtime-control.js +0 -74
- package/dist/foundation/resident-tabs/session-sync.d.ts +0 -14
- package/dist/foundation/resident-tabs/session-sync.js +0 -37
- package/dist/foundation/resident-tabs/settings.d.ts +0 -16
- package/dist/foundation/resident-tabs/settings.js +0 -60
- package/dist/foundation/resident-tabs/terminal-host-artifact.d.ts +0 -14
- package/dist/foundation/resident-tabs/terminal-host-artifact.js +0 -78
- package/dist/foundation/resident-tabs/zip-archive.d.ts +0 -9
- package/dist/foundation/resident-tabs/zip-archive.js +0 -56
- package/dist/foundation/storage/control-store.d.ts +0 -20
- package/dist/foundation/storage/control-store.js +0 -331
- package/dist/foundation/storage/index.d.ts +0 -1
- package/dist/foundation/storage/index.js +0 -1
- package/dist/foundation/supervision/index.d.ts +0 -3
- package/dist/foundation/supervision/index.js +0 -3
- package/dist/foundation/supervision/main.d.ts +0 -1
- package/dist/foundation/supervision/main.js +0 -86
- package/dist/foundation/supervision/paths.d.ts +0 -1
- package/dist/foundation/supervision/paths.js +0 -1
- package/dist/foundation/supervision/server.d.ts +0 -46
- package/dist/foundation/supervision/server.js +0 -606
- package/dist/integrations/pi/engine/offline-settings-port.d.ts +0 -23
- package/dist/integrations/pi/engine/offline-settings-port.js +0 -54
- package/dist/native/darwin-arm64/manifest.json +0 -23
- package/dist/native/darwin-arm64/process-guardian.node +0 -0
- package/dist/native/darwin-arm64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10500
- package/dist/native/darwin-arm64/terminal-host.manifest.json +0 -46
- package/dist/native/darwin-arm64/terminal-host.node +0 -0
- package/dist/native/darwin-x64/manifest.json +0 -23
- package/dist/native/darwin-x64/process-guardian.node +0 -0
- package/dist/native/darwin-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10737
- package/dist/native/darwin-x64/terminal-host.manifest.json +0 -46
- package/dist/native/darwin-x64/terminal-host.node +0 -0
- package/dist/native/linux-x64/manifest.json +0 -23
- package/dist/native/linux-x64/process-guardian.node +0 -0
- package/dist/native/linux-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -11226
- package/dist/native/linux-x64/terminal-host.manifest.json +0 -46
- package/dist/native/linux-x64/terminal-host.node +0 -0
- package/dist/native/win32-x64/manifest.json +0 -23
- package/dist/native/win32-x64/process-guardian.node +0 -0
- package/dist/native/win32-x64/terminal-host-THIRD-PARTY-NOTICES.txt +0 -10757
- package/dist/native/win32-x64/terminal-host.manifest.json +0 -46
- package/dist/native/win32-x64/terminal-host.node +0 -0
- package/docs/architecture/evidence/resident-tabs/linux-x64.md +0 -37
- package/docs/architecture/evidence/resident-tabs/macos-arm64.md +0 -36
- package/docs/architecture/evidence/resident-tabs/macos-x64.md +0 -35
- package/docs/architecture/evidence/resident-tabs/windows-x64.md +0 -36
- package/docs/architecture/evidence/terminal-host-spike/manual-one-pane-terminal-host.md +0 -70
- package/docs/architecture/evidence/terminal-host-spike/manual-two-by-two-basic-terminal-host.md +0 -32
- package/docs/architecture/evidence/terminal-host-spike/milestone-baseline.json +0 -115
- package/docs/architecture/evidence/terminal-host-spike/owned-ui-foundation-prerequisite.json +0 -48
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-provenance.json +0 -125
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-1.json +0 -56
- package/docs/architecture/evidence/terminal-host-spike/terminal-host-task-5-3.json +0 -174
- package/docs/architecture/evidence/terminal-host-spike/terminal-spike-acceptance-record.json +0 -18
- package/docs/architecture/native-fixture-isolation.md +0 -23
- package/docs/architecture/process-guardian-provenance.md +0 -36
- package/docs/architecture/resident-tabs-requirements.md +0 -18
- package/docs/architecture/resident-tabs.md +0 -668
- package/docs/architecture/terminal-host-proof-gate.md +0 -34
- package/docs/architecture/terminal-host-provenance.md +0 -81
- package/docs/architecture/terminal-host-spike-evidence.md +0 -39
- package/docs/launch-recovery.md +0 -23
- package/docs/manual-launch-instance-acceptance.md +0 -43
- package/docs/manual-resident-tabs-acceptance.md +0 -51
package/dist/cli/uninstall.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ProductPaths } from "../foundation/lifecycle/index.js";
|
|
2
1
|
export interface UninstallRequest {
|
|
3
2
|
/** Skips the program-removal question; user data is still kept unless `purge` is set. */
|
|
4
3
|
readonly yes: boolean;
|
|
@@ -17,14 +16,11 @@ export interface UninstallDependencies {
|
|
|
17
16
|
readonly home?: string;
|
|
18
17
|
/** Asks one yes/no question; absent when no terminal can answer. */
|
|
19
18
|
readonly confirm?: (question: string) => Promise<boolean>;
|
|
20
|
-
readonly stopResidentHost?: (releaseRoot: string, paths: ProductPaths, profileRoot: string) => Promise<void>;
|
|
21
|
-
readonly stopSupervisors?: (paths: ProductPaths) => Promise<void>;
|
|
22
19
|
readonly removePackage?: (packageRoot: string, environment: NodeJS.ProcessEnv) => Promise<void>;
|
|
23
20
|
readonly remove?: (path: string) => Promise<void>;
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
26
|
-
* Removes A1 from this machine:
|
|
27
|
-
* release's own maintenance contract, then the global package and every A1-owned state root go.
|
|
23
|
+
* Removes A1 from this machine: the global package goes first, then every A1-owned state root.
|
|
28
24
|
* Sessions and settings live in the profile home and leave only with explicit consent.
|
|
29
25
|
*/
|
|
30
26
|
export declare function runUninstall(request: UninstallRequest, dependencies: UninstallDependencies): Promise<number>;
|
package/dist/cli/uninstall.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import {
|
|
2
|
+
import { rm } from "node:fs/promises";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { dirname, parse, resolve, sep } from "node:path";
|
|
5
5
|
import { resolveLaunchProfilePaths } from "../features/launch/index.js";
|
|
6
6
|
import { resolveProductPaths } from "../foundation/lifecycle/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { runTerminalHostMaintenance } from "../foundation/resident-tabs/index.js";
|
|
7
|
+
import { npmPrefixForGlobalRoot, resolveNpmCli } from "../foundation/release/index.js";
|
|
9
8
|
import { PRODUCT_IDENTITY, PRODUCT_TEXT } from "../product-identity.js";
|
|
10
9
|
/**
|
|
11
|
-
* Removes A1 from this machine:
|
|
12
|
-
* release's own maintenance contract, then the global package and every A1-owned state root go.
|
|
10
|
+
* Removes A1 from this machine: the global package goes first, then every A1-owned state root.
|
|
13
11
|
* Sessions and settings live in the profile home and leave only with explicit consent.
|
|
14
12
|
*/
|
|
15
13
|
export async function runUninstall(request, dependencies) {
|
|
16
14
|
const { output } = dependencies;
|
|
17
15
|
const environment = dependencies.environment ?? process.env;
|
|
18
16
|
const command = PRODUCT_TEXT.commandName;
|
|
19
|
-
if (environment[PRODUCT_IDENTITY.environment.tabId] !== undefined) {
|
|
20
|
-
output.stderr(`${PRODUCT_TEXT.diagnostic(`${command} uninstall stops every tab, including this one. Run it from a terminal outside ${command}.`)}\n`);
|
|
21
|
-
return 1;
|
|
22
|
-
}
|
|
23
17
|
const globalRoot = managedGlobalRoot(dependencies.packageRoot);
|
|
24
18
|
if (globalRoot === null) {
|
|
25
19
|
output.stderr(`${PRODUCT_TEXT.diagnostic(`${command} uninstall removes only an installed ${command}; this one runs from ${dependencies.packageRoot}.`)}\n`);
|
|
@@ -34,18 +28,12 @@ export async function runUninstall(request, dependencies) {
|
|
|
34
28
|
output.stderr(`${PRODUCT_TEXT.diagnostic(`${command} uninstall needs a terminal to confirm. Run ${command} uninstall --yes to remove it.`)}\n`);
|
|
35
29
|
return 2;
|
|
36
30
|
}
|
|
37
|
-
if (!await dependencies.confirm(`Remove ${command} from this machine?
|
|
31
|
+
if (!await dependencies.confirm(`Remove ${command} from this machine? [y/N] `)) {
|
|
38
32
|
output.stdout(`${command} was not removed\n`);
|
|
39
33
|
return 1;
|
|
40
34
|
}
|
|
41
35
|
purge ||= await dependencies.confirm(`Also delete your sessions, settings, and sign-ins in ${profileHome}? [y/N] `);
|
|
42
36
|
}
|
|
43
|
-
const profileRoot = environment[PRODUCT_IDENTITY.environment.profileHome] ?? paths.configDir;
|
|
44
|
-
const stopResidentHost = dependencies.stopResidentHost ?? stopReleaseResidentHost;
|
|
45
|
-
for (const releaseRoot of await installedReleaseRoots(paths.dataDir)) {
|
|
46
|
-
await stopResidentHost(releaseRoot, paths, profileRoot).catch(() => undefined);
|
|
47
|
-
}
|
|
48
|
-
await (dependencies.stopSupervisors ?? stopRecordedSupervisors)(paths).catch(() => undefined);
|
|
49
37
|
try {
|
|
50
38
|
await (dependencies.removePackage ?? removeGlobalPackage)(dependencies.packageRoot, environment);
|
|
51
39
|
}
|
|
@@ -56,8 +44,8 @@ export async function runUninstall(request, dependencies) {
|
|
|
56
44
|
}
|
|
57
45
|
const remove = dependencies.remove ?? (async (path) => await rm(path, { recursive: true, force: true }));
|
|
58
46
|
const home = dependencies.home ?? environment.HOME ?? environment.USERPROFILE ?? homedir();
|
|
59
|
-
const owned = [paths.dataDir, paths.configDir, paths.runtimeDir,
|
|
60
|
-
for (const path of new Set(owned
|
|
47
|
+
const owned = [paths.dataDir, paths.configDir, paths.runtimeDir, ...(purge ? [profileHome] : [])];
|
|
48
|
+
for (const path of new Set(owned)) {
|
|
61
49
|
if (removable(path, home))
|
|
62
50
|
await remove(path);
|
|
63
51
|
}
|
|
@@ -79,23 +67,6 @@ function removable(path, home) {
|
|
|
79
67
|
const target = resolve(path);
|
|
80
68
|
return target !== parse(target).root && target !== resolve(home) && !resolve(home).startsWith(`${target}${sep}`);
|
|
81
69
|
}
|
|
82
|
-
async function installedReleaseRoots(dataDir) {
|
|
83
|
-
const releases = resolve(dataDir, "releases");
|
|
84
|
-
const names = await readdir(releases).catch(() => []);
|
|
85
|
-
return names.map(name => resolve(releases, name));
|
|
86
|
-
}
|
|
87
|
-
async function stopReleaseResidentHost(releaseRoot, paths, profileRoot) {
|
|
88
|
-
// Invariant: each release stops only its own namespace, through its own verified host.
|
|
89
|
-
await runTerminalHostMaintenance({
|
|
90
|
-
action: "host-stop", profileRoot, dataDir: paths.dataDir, runtimeDir: paths.runtimeDir,
|
|
91
|
-
releaseRoots: [releaseRoot], environment: process.env, timeoutMs: 30_000,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
async function stopRecordedSupervisors(paths) {
|
|
95
|
-
for (const endpoint of await listRecordedEndpoints(paths)) {
|
|
96
|
-
await cleanupVerifiedOwner(endpoint.metadata, { allowLiveInstances: true }).catch(() => undefined);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
70
|
async function removeGlobalPackage(packageRoot, environment) {
|
|
100
71
|
const globalRoot = managedGlobalRoot(packageRoot);
|
|
101
72
|
if (globalRoot === null)
|
|
@@ -22,15 +22,12 @@ export async function runVersionStats(options) {
|
|
|
22
22
|
output.stderr(`${PRODUCT_TEXT.diagnostic(`could not read its installed version: ${message(error)}`)}\n`);
|
|
23
23
|
return 1;
|
|
24
24
|
}
|
|
25
|
-
// Rationale:
|
|
26
|
-
//
|
|
27
|
-
// they carry the pull request a preview's manifest records; a missing record is silently omitted.
|
|
25
|
+
// Rationale: both installed channels show the same remote heads without starting a session;
|
|
26
|
+
// only development versions carry preview pull-request attribution, when their manifests record it.
|
|
28
27
|
const remote = await queryDistTags(runner, options.fetcher ?? defaultRegistryFetcher);
|
|
29
28
|
const developmentBuild = prerelease(installed) !== null;
|
|
30
|
-
const headPullRequest =
|
|
31
|
-
const develop =
|
|
32
|
-
? `Develop: ${remote.develop === null ? "unavailable" : withPullRequest(remote.develop, headPullRequest)}\n`
|
|
33
|
-
: "";
|
|
29
|
+
const headPullRequest = remote.develop !== null ? await queryRecordedPullRequest(runner, remote.develop) : null;
|
|
30
|
+
const develop = `Develop: ${remote.develop === null ? "unavailable" : withPullRequest(remote.develop, headPullRequest)}\n`;
|
|
34
31
|
output.stdout(`Current: ${withPullRequest(installed, developmentBuild ? installedPullRequest : null)}\n${develop}Release: ${remote.release ?? "unavailable"}\n`);
|
|
35
32
|
if (remote.error)
|
|
36
33
|
output.stderr(`${PRODUCT_TEXT.diagnostic(`could not resolve npm dist-tags: ${remote.error}`)}\n`);
|
|
@@ -2,7 +2,6 @@ import type { AgentSettingsPort } from "../contracts/agent-engine/index.js";
|
|
|
2
2
|
import { OwnedSettingsManager } from "../ui/settings/manager.js";
|
|
3
3
|
export interface OwnedSettingsManagerFactoryOptions {
|
|
4
4
|
readonly profileId: string;
|
|
5
|
-
readonly hideTabSettings?: boolean;
|
|
6
5
|
readonly agent?: AgentSettingsPort | null;
|
|
7
6
|
readonly agentProvider?: () => AgentSettingsPort | null;
|
|
8
7
|
}
|
|
@@ -14,7 +14,6 @@ export function createOwnedSettingsManager(options) {
|
|
|
14
14
|
legacyConfigDir: productPaths.configDir,
|
|
15
15
|
...(options.agent === undefined ? {} : { agent: options.agent }),
|
|
16
16
|
...(options.agentProvider === undefined ? {} : { agentProvider: options.agentProvider }),
|
|
17
|
-
...(options.hideTabSettings ? { hiddenOwnedSettingIds: ["tabsAutoName", "tabsPosition", "tabBarPlusMenu", "tabBarRightItems"] } : {}),
|
|
18
17
|
hiddenAgentSettingIds: ["fullscreenWheelScrollLines"],
|
|
19
18
|
agentSettingLabelOverrides: { fullscreenCopyOnSelect: "Copy on select" },
|
|
20
19
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvailableRelease, StartupReleaseCheckOptions } from "../foundation/release/latest-release.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProcessIdentity } from "../foundation/lifecycle/model.js";
|
|
3
3
|
import type { SessionSelection } from "../foundation/lifecycle/session-selection.js";
|
|
4
4
|
import { type PiEngineHostOptions } from "../integrations/pi/engine/host.js";
|
|
5
5
|
import type { PiProjectTrustPreflightPrompt } from "../integrations/pi/engine/project-trust-preflight.js";
|
|
@@ -7,10 +7,8 @@ import type { PiSessionForkPrompt } from "../integrations/pi/engine/session-sele
|
|
|
7
7
|
import type { OwnedSettingsManager } from "../ui/settings/manager.js";
|
|
8
8
|
import type { OwnedUiApplicationPort, PresentationTerminalPort } from "../contracts/presentation/index.js";
|
|
9
9
|
import type { ReleaseNoteCatalog } from "../features/owned-ui/release-notes.js";
|
|
10
|
-
import type { TabBridgeClient } from "../foundation/resident-tabs/bridge-client.js";
|
|
11
10
|
import type { ComposedEngineHost } from "./session-backend.js";
|
|
12
11
|
export type { ComposedEngineHost, ComposedSessionBackend } from "./session-backend.js";
|
|
13
|
-
export { bindResidentTabBridge, correlateResidentTabSubmission } from "./resident-tab-bridge.js";
|
|
14
12
|
export interface OwnedUiCompositionOptions {
|
|
15
13
|
readonly cwd?: string;
|
|
16
14
|
readonly terminal?: PresentationTerminalPort;
|
|
@@ -22,10 +20,6 @@ export interface OwnedUiCompositionOptions {
|
|
|
22
20
|
readonly sessionForkPrompt?: PiSessionForkPrompt;
|
|
23
21
|
/** A1 settings profile; comparison paths omit it. */
|
|
24
22
|
readonly profileId?: string;
|
|
25
|
-
/** Hide resident-only tab controls for the explicit direct single-agent launch. */
|
|
26
|
-
readonly hideTabSettings?: boolean;
|
|
27
|
-
/** The explicit solo launch owns a mode-specific resume hint; resident fallback keeps the tabbed form. */
|
|
28
|
-
readonly soloResumeHint?: boolean;
|
|
29
23
|
/** `off` withholds A1-specific surfaces from comparison profiles. */
|
|
30
24
|
readonly ownedSurfaces?: "on" | "off";
|
|
31
25
|
readonly projectTrustPrompt?: PiProjectTrustPreflightPrompt;
|
|
@@ -35,32 +29,16 @@ export interface OwnedUiCompositionOptions {
|
|
|
35
29
|
readonly clipboardDiagnosticsPath?: string;
|
|
36
30
|
/** Deterministic release-note seams for composition tests. */
|
|
37
31
|
readonly packageVersion?: string;
|
|
38
|
-
readonly notificationVersion?: string | undefined;
|
|
39
32
|
readonly releaseNotes?: ReleaseNoteCatalog;
|
|
40
33
|
/** Startup release-availability seam; defaults to the throttled registry check. */
|
|
41
34
|
readonly checkForNewerRelease?: (options: StartupReleaseCheckOptions) => Promise<AvailableRelease | null>;
|
|
42
|
-
readonly inspectProcess?: (pid: number) => Promise<
|
|
43
|
-
readonly tab?: {
|
|
44
|
-
readonly bridge: TabBridgeClient;
|
|
45
|
-
readonly dataDir: string;
|
|
46
|
-
readonly incarnation: number;
|
|
47
|
-
};
|
|
48
|
-
readonly residentFallbackNotice?: string;
|
|
35
|
+
readonly inspectProcess?: (pid: number) => Promise<ProcessIdentity | null>;
|
|
49
36
|
}
|
|
50
37
|
export interface OwnedUiComposition {
|
|
51
38
|
readonly application: OwnedUiApplicationPort;
|
|
52
39
|
/** Present when a profile was supplied, so the caller can resolve settings before start. */
|
|
53
40
|
readonly settings: OwnedSettingsManager | null;
|
|
54
41
|
}
|
|
55
|
-
export declare function residentStartupPresentation(resident: boolean, fallbackNotice?: string): {
|
|
56
|
-
readonly startup?: {
|
|
57
|
-
readonly quiet?: boolean;
|
|
58
|
-
readonly notices?: readonly [{
|
|
59
|
-
readonly kind: "warning";
|
|
60
|
-
readonly message: string;
|
|
61
|
-
}];
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
42
|
export declare function composeOwnedUiApplication(options?: OwnedUiCompositionOptions): Promise<OwnedUiApplicationPort>;
|
|
65
43
|
export declare function composeOwnedUi(options?: OwnedUiCompositionOptions): Promise<OwnedUiComposition>;
|
|
66
44
|
export { watchSharedSettings } from "./owned-settings.js";
|
|
@@ -17,17 +17,9 @@ import { createPiTerminalBridge } from "../integrations/pi/tui-runtime/presentat
|
|
|
17
17
|
import { createOwnedRouteHost } from "./settings-route-host.js";
|
|
18
18
|
import { renderPiShellChangelogLines } from "../integrations/pi/components/shell-presenters-info.js";
|
|
19
19
|
import { nativeHyperlinkStyle } from "../ui/components/spans.js";
|
|
20
|
-
import { ResidentTabRecovery } from "../foundation/resident-tabs/recovery.js";
|
|
21
|
-
import { bindResidentPresentation, createResidentClientIdentity, closeResidentUtilityRoute, correlateResidentTabSubmission, currentBackendSessionFile, residentRouteHostOptions, residentTabKeybindings } from "./resident-tab-bridge.js";
|
|
22
20
|
import { SessionRuntimeRegistry } from "./session-runtime-registry.js";
|
|
23
21
|
import { deferStartupReleaseUpdateObservation, readPackageVersion, StartupReleaseNote } from "./startup-route.js";
|
|
24
22
|
import { createOwnedSettingsManager, watchSharedSettings } from "./owned-settings.js";
|
|
25
|
-
export { bindResidentTabBridge, correlateResidentTabSubmission } from "./resident-tab-bridge.js";
|
|
26
|
-
export function residentStartupPresentation(resident, fallbackNotice) {
|
|
27
|
-
if (resident)
|
|
28
|
-
return { startup: { quiet: true } };
|
|
29
|
-
return fallbackNotice === undefined ? {} : { startup: { notices: [{ kind: "warning", message: fallbackNotice }] } };
|
|
30
|
-
}
|
|
31
23
|
export async function composeOwnedUiApplication(options = {}) {
|
|
32
24
|
return (await composeOwnedUi(options)).application;
|
|
33
25
|
}
|
|
@@ -46,20 +38,8 @@ export async function composeOwnedUi(options = {}) {
|
|
|
46
38
|
: createOwnedSettingsManager({
|
|
47
39
|
profileId: options.profileId,
|
|
48
40
|
agentProvider: () => backend.settingsPort(),
|
|
49
|
-
...(options.hideTabSettings ? { hideTabSettings: true } : {}),
|
|
50
41
|
});
|
|
51
|
-
const
|
|
52
|
-
if (tabBridge !== null)
|
|
53
|
-
await tabBridge.start().catch(() => false);
|
|
54
|
-
const projectTrustPrompt = options.projectTrustPrompt === undefined ? undefined : async (request) => {
|
|
55
|
-
tabBridge?.status("needs-input", false, 1, 0);
|
|
56
|
-
try {
|
|
57
|
-
return await options.projectTrustPrompt(request);
|
|
58
|
-
}
|
|
59
|
-
finally {
|
|
60
|
-
tabBridge?.status("starting");
|
|
61
|
-
}
|
|
62
|
-
};
|
|
42
|
+
const projectTrustPrompt = options.projectTrustPrompt;
|
|
63
43
|
// Invariant: process-wide engine state has one owner. The host installs the HTTP dispatcher, applies
|
|
64
44
|
// the theme singletons, and announces startup notices once; every session is created through it.
|
|
65
45
|
const host = await (options.createEngineHost ?? (async (hostOptions) => createPiEngineHost(hostOptions)))({
|
|
@@ -74,15 +54,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
74
54
|
},
|
|
75
55
|
...(projectTrustPrompt === undefined ? {} : { projectTrustPrompt }),
|
|
76
56
|
});
|
|
77
|
-
const sessionForkPrompt = options.sessionForkPrompt
|
|
78
|
-
tabBridge?.status("needs-input", false, 1, 0);
|
|
79
|
-
try {
|
|
80
|
-
return await options.sessionForkPrompt(request);
|
|
81
|
-
}
|
|
82
|
-
finally {
|
|
83
|
-
tabBridge?.status("starting");
|
|
84
|
-
}
|
|
85
|
-
};
|
|
57
|
+
const sessionForkPrompt = options.sessionForkPrompt;
|
|
86
58
|
try {
|
|
87
59
|
backend = await host.create({
|
|
88
60
|
cwd,
|
|
@@ -96,21 +68,6 @@ export async function composeOwnedUi(options = {}) {
|
|
|
96
68
|
await host.dispose();
|
|
97
69
|
throw error;
|
|
98
70
|
}
|
|
99
|
-
const clientIdentity = createResidentClientIdentity(update => backend.extensions.announceReleaseUpdate(update));
|
|
100
|
-
let recoveryDegraded = false;
|
|
101
|
-
let presentRecoveryDegraded = (_degraded) => { };
|
|
102
|
-
const tabRecovery = options.tab === undefined ? null : new ResidentTabRecovery(options.tab.dataDir, {
|
|
103
|
-
onDegraded: degraded => {
|
|
104
|
-
recoveryDegraded = degraded;
|
|
105
|
-
options.tab.bridge.degraded(degraded);
|
|
106
|
-
presentRecoveryDegraded(degraded);
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
const recoveredTabInput = await tabRecovery?.initialize(currentBackendSessionFile(backend), backend.identity.sessionId);
|
|
110
|
-
if (tabBridge !== null && settings !== null && ownedSurfaces)
|
|
111
|
-
tabBridge.accent(settings.value("accentColor"));
|
|
112
|
-
let removeControllerBoundaryInput = () => { };
|
|
113
|
-
let unsubscribeTabBridge = () => { };
|
|
114
71
|
const releaseNote = await StartupReleaseNote.load({
|
|
115
72
|
ownedSurfaces,
|
|
116
73
|
configDir: productPaths.configDir,
|
|
@@ -123,17 +80,16 @@ export async function composeOwnedUi(options = {}) {
|
|
|
123
80
|
: settings.onChange(current => {
|
|
124
81
|
const accent = current.value("accentColor");
|
|
125
82
|
host.setAccentColor(accent);
|
|
126
|
-
tabBridge?.accent(accent);
|
|
127
83
|
});
|
|
128
|
-
// Rationale:
|
|
129
|
-
//
|
|
84
|
+
// Rationale: separate A1 processes share one settings document; a live scope change saved in
|
|
85
|
+
// one reaches the others only by rereading that document.
|
|
130
86
|
const unwatchSharedSettings = settings === null || !ownedSurfaces
|
|
131
87
|
? () => { }
|
|
132
88
|
: watchSharedSettings(settings);
|
|
133
89
|
const unsubscribeAccent = () => { unwatchSharedSettings(); unsubscribeAccentChange(); };
|
|
134
90
|
// Invariant: the Settings search and agent prompt borrow the same resolved Pi keybindings.
|
|
135
91
|
const keybindingsHost = createPiKeybindingsHost({ profile: ownedSurfaces ? "a1" : "pi", agentDir: backend.identity.agentDir });
|
|
136
|
-
const keybindings =
|
|
92
|
+
const keybindings = keybindingsHost;
|
|
137
93
|
// Rationale: Routes open only after shell construction.
|
|
138
94
|
const references = {
|
|
139
95
|
changelog: async (input) => {
|
|
@@ -150,7 +106,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
150
106
|
session: () => import("./session-info-reference.js").then(m => m.loadSessionInfoReference(backend)),
|
|
151
107
|
};
|
|
152
108
|
const routeHost = settings === null || !ownedSurfaces ? null
|
|
153
|
-
: createOwnedRouteHost(settings, references, settingsRouteOptions(
|
|
109
|
+
: createOwnedRouteHost(settings, references, settingsRouteOptions(keybindings, backend.identity.agentDir, cwd));
|
|
154
110
|
const viewportSettings = settings === null || !ownedSurfaces ? null : {
|
|
155
111
|
snapshot: () => viewportSettingsSnapshot(settings),
|
|
156
112
|
onChange: listener => settings.onChange(() => listener(viewportSettingsSnapshot(settings))),
|
|
@@ -196,25 +152,13 @@ export async function composeOwnedUi(options = {}) {
|
|
|
196
152
|
...(routeHost === null ? {} : { routeHost }),
|
|
197
153
|
...(releaseNote.startupRoute === undefined ? {} : { startupRoute: releaseNote.startupRoute }),
|
|
198
154
|
...(ownedSurfaces ? { sessionLayout: "custom-viewport" } : {}),
|
|
199
|
-
...(tabBridge === null || tabRecovery === null ? {} : { residentTab: {
|
|
200
|
-
requestDetach: () => tabBridge.requestDetach(),
|
|
201
|
-
closeOwnedRoute: route => closeResidentUtilityRoute(tabBridge, route),
|
|
202
|
-
reportStatus: status => tabBridge.status(status),
|
|
203
|
-
admit: input => tabRecovery.admit({ ...input, incarnation: options.tab.incarnation }),
|
|
204
|
-
dispatched: () => tabRecovery.dispatched(),
|
|
205
|
-
correlated: (submissionId, entryId) => correlateResidentTabSubmission(tabRecovery, backend, submissionId, entryId),
|
|
206
|
-
checkpoint: text => tabRecovery.checkpoint(text),
|
|
207
|
-
gracefulStop: sessionFile => tabRecovery.gracefulStop(sessionFile),
|
|
208
|
-
...(recoveredTabInput === undefined ? {} : { recovered: recoveredTabInput }),
|
|
209
|
-
} }),
|
|
210
155
|
},
|
|
211
156
|
presentation: {
|
|
212
157
|
...(options.terminal === undefined ? {} : { terminal: createPiTerminalBridge(options.terminal) }),
|
|
213
|
-
...residentStartupPresentation(tabBridge !== null, options.residentFallbackNotice), soloResumeHint: options.soloResumeHint === true && tabBridge === null,
|
|
214
158
|
...(clipboardDiagnostics === null ? {} : { input: { onEvent: event => clipboardDiagnostics.runtime(event) } }),
|
|
215
159
|
...(viewportSettings === null ? {} : { viewportSettings }),
|
|
216
160
|
...(backgroundSettings === null ? {} : { backgroundSettings }),
|
|
217
|
-
...(settings === null || !ownedSurfaces
|
|
161
|
+
...(settings === null || !ownedSurfaces ? {} : {
|
|
218
162
|
quitOutro: { snapshot: () => quitOutroSettingsSnapshot(settings), interactive: process.stdout.isTTY === true },
|
|
219
163
|
}),
|
|
220
164
|
},
|
|
@@ -235,20 +179,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
235
179
|
// the host and paints once attached.
|
|
236
180
|
terminalHost = createdTerminalHost = new OwnedUiTerminalHost(sessionTerminalHostOptions(presenterOptions));
|
|
237
181
|
presenter = new OwnedUiSessionPresenter(terminalHost, presenterOptions);
|
|
238
|
-
presentRecoveryDegraded = degraded => {
|
|
239
|
-
if (!degraded)
|
|
240
|
-
return;
|
|
241
|
-
presenter.root.appendWorkflowStatus("draft recovery degraded");
|
|
242
|
-
terminalHost.runtime.requestRender();
|
|
243
|
-
};
|
|
244
|
-
if (recoveryDegraded)
|
|
245
|
-
presentRecoveryDegraded(true);
|
|
246
182
|
terminalHost.attach(presenter);
|
|
247
|
-
({ unsubscribeTabBridge, removeControllerBoundaryInput } = await bindResidentPresentation(tabBridge, backend, tabRecovery, {
|
|
248
|
-
autoName: settings?.value("tabsAutoName") ?? true,
|
|
249
|
-
openRoute: route => presenter.openOwnedRoute(route),
|
|
250
|
-
onClientVersion: clientIdentity.observe,
|
|
251
|
-
}, terminalHost.runtime));
|
|
252
183
|
}
|
|
253
184
|
catch (error) {
|
|
254
185
|
await createdTerminalHost?.dispose().catch(() => undefined);
|
|
@@ -267,11 +198,9 @@ export async function composeOwnedUi(options = {}) {
|
|
|
267
198
|
backend,
|
|
268
199
|
configDir: productPaths.configDir,
|
|
269
200
|
mode: settings === null || !ownedSurfaces ? "auto" : settings.value("updateCheck"),
|
|
270
|
-
packageVersion: releaseNote.packageVersion, readPackageVersion,
|
|
201
|
+
packageVersion: releaseNote.packageVersion, readPackageVersion,
|
|
271
202
|
checkForNewerRelease: options.checkForNewerRelease,
|
|
272
|
-
clientVersion: clientIdentity.current,
|
|
273
203
|
});
|
|
274
|
-
clientIdentity.onChange(releaseUpdates.clientChanged);
|
|
275
204
|
const exitNoticePath = process.env[PRODUCT_IDENTITY.environment.exitNoticePath];
|
|
276
205
|
// Security: tools the agent runs must never see, or rewrite, this instance's notice.
|
|
277
206
|
delete process.env[PRODUCT_IDENTITY.environment.exitNoticePath];
|
|
@@ -279,10 +208,10 @@ export async function composeOwnedUi(options = {}) {
|
|
|
279
208
|
const application = {
|
|
280
209
|
get disposed() { return backend.identity.disposed; },
|
|
281
210
|
start: () => {
|
|
282
|
-
// Performance: the
|
|
211
|
+
// Performance: the launcher's exit notice loads beside first paint, never on the startup path.
|
|
283
212
|
if (exitNoticePath)
|
|
284
213
|
exitNotice = import("../app/session-shell/exit-notice.js")
|
|
285
|
-
.then(module => module.armExitNotice(backend, exitNoticePath
|
|
214
|
+
.then(module => module.armExitNotice(backend, exitNoticePath), () => null);
|
|
286
215
|
presenter.start();
|
|
287
216
|
releaseUpdates.start();
|
|
288
217
|
},
|
|
@@ -299,14 +228,11 @@ export async function composeOwnedUi(options = {}) {
|
|
|
299
228
|
finally {
|
|
300
229
|
// Invariant: the shared spares outlive every shell and stop only after the last one is disposed.
|
|
301
230
|
clipboardServices?.dispose();
|
|
302
|
-
removeControllerBoundaryInput();
|
|
303
231
|
unsubscribeAccent();
|
|
304
232
|
await sessionRuntimes.dispose();
|
|
305
233
|
await releaseNote.releaseClaim();
|
|
306
234
|
suggestionDiagnostics?.dispose();
|
|
307
235
|
clipboardDiagnostics?.dispose();
|
|
308
|
-
unsubscribeTabBridge();
|
|
309
|
-
tabBridge?.close();
|
|
310
236
|
// Invariant: the host outlives the application; disposing it cancels host-level probes last.
|
|
311
237
|
await host.dispose();
|
|
312
238
|
}
|
|
@@ -340,9 +266,8 @@ function createPromptHistoryConfiguration(settings, backend, ownedSurfaces) {
|
|
|
340
266
|
};
|
|
341
267
|
}
|
|
342
268
|
export { watchSharedSettings } from "./owned-settings.js";
|
|
343
|
-
function settingsRouteOptions(
|
|
269
|
+
function settingsRouteOptions(keybindings, agentDir, cwd) {
|
|
344
270
|
return {
|
|
345
|
-
...residentRouteHostOptions(tabBridge),
|
|
346
271
|
keybindings,
|
|
347
272
|
agentDir,
|
|
348
273
|
cwd,
|
|
@@ -361,7 +286,6 @@ function quitOutroSettingsSnapshot(settings) {
|
|
|
361
286
|
}
|
|
362
287
|
function viewportSettingsSnapshot(settings) {
|
|
363
288
|
return {
|
|
364
|
-
timeFormat: settings.value("timeFormat"),
|
|
365
289
|
scrollbarAppearance: settings.value("scrollbarAppearance"),
|
|
366
290
|
scrollbarStyle: settings.value("scrollbarStyle"),
|
|
367
291
|
scrollbarSpeed: settings.value("scrollbarSpeed"),
|
|
@@ -6,17 +6,17 @@ export interface StartupReleaseUpdateObservationOptions {
|
|
|
6
6
|
readonly mode: StartupUpdateMode;
|
|
7
7
|
readonly packageVersion: string | null;
|
|
8
8
|
readonly readPackageVersion: () => Promise<string>;
|
|
9
|
-
readonly notificationVersion: string | undefined;
|
|
10
9
|
readonly checkForNewerRelease: ((options: StartupReleaseCheckOptions) => Promise<AvailableRelease | null>) | undefined;
|
|
11
|
-
readonly clientVersion?: () => string | null;
|
|
12
10
|
}
|
|
13
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* `Auto` installs a verified newer release in the background; the only thing the user sees is the
|
|
13
|
+
* installed status once the approved active release is newer than the one running here.
|
|
14
|
+
*/
|
|
14
15
|
declare class ReleaseUpdateObservation {
|
|
15
16
|
#private;
|
|
16
17
|
constructor(input: StartupReleaseUpdateObservationOptions);
|
|
17
18
|
start(): void;
|
|
18
19
|
stop(): void;
|
|
19
|
-
clientChanged(): void;
|
|
20
20
|
}
|
|
21
21
|
export declare function createStartupReleaseUpdateObservation(input: StartupReleaseUpdateObservationOptions): ReleaseUpdateObservation;
|
|
22
22
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* `Auto` installs a verified newer release in the background; the only thing the user sees is the
|
|
3
|
+
* installed status once the approved active release is newer than the one running here.
|
|
4
|
+
*/
|
|
2
5
|
class ReleaseUpdateObservation {
|
|
3
6
|
#input;
|
|
4
7
|
#controller = new AbortController();
|
|
5
8
|
#timer;
|
|
6
|
-
#announced = null;
|
|
7
9
|
#installedAnnounced = false;
|
|
8
10
|
#eligible;
|
|
9
11
|
#cadence = null;
|
|
@@ -13,18 +15,14 @@ class ReleaseUpdateObservation {
|
|
|
13
15
|
#refresh = false;
|
|
14
16
|
#stopActiveReleaseObservation = () => { };
|
|
15
17
|
constructor(input) { this.#input = input; this.#eligible = input.mode === "auto"; }
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
if (key === this.#announced || (status === "installed" && this.#installedAnnounced) || this.#controller.signal.aborted)
|
|
18
|
+
#announceInstalled(version) {
|
|
19
|
+
if (this.#installedAnnounced || this.#controller.signal.aborted)
|
|
19
20
|
return;
|
|
20
|
-
this.#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.#
|
|
24
|
-
|
|
25
|
-
clearTimeout(this.#timer);
|
|
26
|
-
}
|
|
27
|
-
this.#input.backend.extensions.announceReleaseUpdate({ status, version });
|
|
21
|
+
this.#installedAnnounced = true;
|
|
22
|
+
this.#eligible = false;
|
|
23
|
+
if (this.#timer !== undefined)
|
|
24
|
+
clearTimeout(this.#timer);
|
|
25
|
+
this.#input.backend.extensions.announceReleaseUpdate({ status: "installed", version });
|
|
28
26
|
}
|
|
29
27
|
async #startActiveReleaseObservation() {
|
|
30
28
|
const runningVersion = this.#input.packageVersion ?? await this.#input.readPackageVersion();
|
|
@@ -36,7 +34,7 @@ class ReleaseUpdateObservation {
|
|
|
36
34
|
this.#stopActiveReleaseObservation = module.observeNewerActiveRelease({
|
|
37
35
|
runningVersion,
|
|
38
36
|
signal: this.#controller.signal,
|
|
39
|
-
onNewer: version => this.#
|
|
37
|
+
onNewer: version => this.#announceInstalled(version),
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
40
|
async #observe() {
|
|
@@ -46,10 +44,9 @@ class ReleaseUpdateObservation {
|
|
|
46
44
|
this.#nextDelay = this.#cadence;
|
|
47
45
|
const input = this.#input;
|
|
48
46
|
const check = input.checkForNewerRelease ?? releases.checkForNewerRelease;
|
|
49
|
-
const
|
|
50
|
-
const runningVersion = client ?? input.packageVersion ?? await input.readPackageVersion();
|
|
47
|
+
const runningVersion = input.packageVersion ?? await input.readPackageVersion();
|
|
51
48
|
const options = {
|
|
52
|
-
runningVersion
|
|
49
|
+
runningVersion,
|
|
53
50
|
configDir: input.configDir, interactive: process.stdout.isTTY === true, settingMode: input.mode,
|
|
54
51
|
signal: this.#controller.signal, onNextCheckDelay: delay => { this.#nextDelay = delay; },
|
|
55
52
|
};
|
|
@@ -58,31 +55,12 @@ class ReleaseUpdateObservation {
|
|
|
58
55
|
return;
|
|
59
56
|
}
|
|
60
57
|
const release = await check(options);
|
|
61
|
-
if (release === null || this.#controller.signal.aborted)
|
|
62
|
-
return;
|
|
63
|
-
const current = input.clientVersion?.();
|
|
64
|
-
if (current && !releases.isNewerRelease(release.version, current))
|
|
65
|
-
return;
|
|
66
|
-
if (input.mode === "notify") {
|
|
67
|
-
input.backend.extensions.announceReleaseUpdate(release);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (input.mode !== "auto")
|
|
58
|
+
if (release === null || this.#controller.signal.aborted || input.mode !== "auto")
|
|
71
59
|
return;
|
|
72
60
|
const installed = await import("../foundation/release/automatic-update.js")
|
|
73
|
-
.then(module => module.requestAutomaticUpdate({
|
|
74
|
-
release, runningVersion, signal: this.#controller.signal,
|
|
75
|
-
onActivationBlocked: version => {
|
|
76
|
-
const clientVersion = input.clientVersion?.();
|
|
77
|
-
if (version !== null && clientVersion && !releases.isNewerRelease(version, clientVersion))
|
|
78
|
-
return;
|
|
79
|
-
if (version !== null)
|
|
80
|
-
this.#nextDelay = module.AUTOMATIC_UPDATE_ACTIVATION_RETRY_MS;
|
|
81
|
-
this.#announce(version === null ? "blocked-cleared" : "blocked", version ?? release.version);
|
|
82
|
-
},
|
|
83
|
-
}));
|
|
61
|
+
.then(module => module.requestAutomaticUpdate({ release, runningVersion, signal: this.#controller.signal }));
|
|
84
62
|
if (installed !== null)
|
|
85
|
-
this.#
|
|
63
|
+
this.#announceInstalled(installed);
|
|
86
64
|
}
|
|
87
65
|
async #run() {
|
|
88
66
|
if (this.#running) {
|
|
@@ -118,13 +96,5 @@ class ReleaseUpdateObservation {
|
|
|
118
96
|
if (this.#timer !== undefined)
|
|
119
97
|
clearTimeout(this.#timer);
|
|
120
98
|
}
|
|
121
|
-
clientChanged() {
|
|
122
|
-
this.#announced = null;
|
|
123
|
-
if (!this.#started || this.#controller.signal.aborted || this.#installedAnnounced || this.#input.mode === "no")
|
|
124
|
-
return;
|
|
125
|
-
if (this.#timer !== undefined)
|
|
126
|
-
clearTimeout(this.#timer);
|
|
127
|
-
void this.#run();
|
|
128
|
-
}
|
|
129
99
|
}
|
|
130
100
|
export function createStartupReleaseUpdateObservation(input) { return new ReleaseUpdateObservation(input); }
|
|
@@ -9,7 +9,6 @@ import type { PiSessionPresenterBackend } from "../integrations/pi/session-prese
|
|
|
9
9
|
*/
|
|
10
10
|
export interface ComposedSessionBackend extends PiSessionPresenterBackend, OwnedUiPromptSuggestionGeneratorPort {
|
|
11
11
|
settingsPort(): AgentSettingsPort | null;
|
|
12
|
-
generateResidentTabName(instruction: string, maxTokens: number, signal: AbortSignal): Promise<string | null>;
|
|
13
12
|
}
|
|
14
13
|
/** The process-level engine host as composition drives it: sessions, the live accent, and disposal. */
|
|
15
14
|
export interface ComposedEngineHost {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ProcessIdentity } from "../foundation/lifecycle/model.js";
|
|
2
2
|
export interface SessionRuntimeRegistryOptions {
|
|
3
3
|
/** Absent outside claim-owning runtimes. */
|
|
4
4
|
readonly runtimeId: string | undefined;
|
|
5
|
-
/**
|
|
6
|
-
readonly inspectProcess: ((pid: number) => Promise<
|
|
5
|
+
/** Process liveness inspection; absent SDK seams cannot claim. */
|
|
6
|
+
readonly inspectProcess: ((pid: number) => Promise<ProcessIdentity | null>) | undefined;
|
|
7
7
|
readonly refreshMs?: number;
|
|
8
8
|
}
|
|
9
9
|
/** Lifecycle-owned publication and retries for each agent's current session, serialized with disposal. */
|
|
@@ -11,13 +11,6 @@ export interface OwnedReferenceProviders {
|
|
|
11
11
|
}
|
|
12
12
|
/** How the settings route is presented. */
|
|
13
13
|
export interface OwnedRouteHostOptions {
|
|
14
|
-
/**
|
|
15
|
-
* The route whose screen is this resident utility tab. That screen is the tab, so it offers no
|
|
16
|
-
* screen-level close: neither Esc nor one Ctrl+C dismisses it, and it shows no close hint.
|
|
17
|
-
*/
|
|
18
|
-
readonly tabRoute?: string | null;
|
|
19
|
-
/** Opens the tab bar's own Plus Menu dialog; false when no tab bar can show it. */
|
|
20
|
-
readonly configurePlusMenu?: () => boolean;
|
|
21
14
|
readonly keybindings?: PiKeybindingsHost;
|
|
22
15
|
readonly agentDir?: string;
|
|
23
16
|
readonly cwd?: string;
|
|
@@ -17,8 +17,7 @@ export function createOwnedRouteHost(settings, references, options = {}) {
|
|
|
17
17
|
const session = route === "session";
|
|
18
18
|
const title = session ? "Session Info" : changelog ? input ? "What's New" : "Changelog" : HOTKEYS_TITLE;
|
|
19
19
|
const document = session ? references.session() : changelog ? references.changelog(input) : references.hotkeys();
|
|
20
|
-
|
|
21
|
-
return deferredSurface(route, title, () => loadReferenceSurface(settings, route, title, document, pinned, options));
|
|
20
|
+
return deferredSurface(route, title, () => loadReferenceSurface(settings, route, title, document, options));
|
|
22
21
|
},
|
|
23
22
|
};
|
|
24
23
|
}
|
|
@@ -68,22 +67,18 @@ async function loadSettingsSurface(settings, options) {
|
|
|
68
67
|
import("./settings-search-input.js"),
|
|
69
68
|
import("../ui/components/dialog-panel.js"),
|
|
70
69
|
]);
|
|
71
|
-
const pinned = options.tabRoute === SETTINGS_ROUTE;
|
|
72
70
|
const searchInputFactory = createSettingsSearchInputFactory({
|
|
73
71
|
...(options.keybindings === undefined ? {} : { keybindings: options.keybindings }),
|
|
74
72
|
...(options.agentDir === undefined ? {} : { agentDir: options.agentDir }),
|
|
75
73
|
...(options.cwd === undefined ? {} : { cwd: options.cwd }),
|
|
76
74
|
});
|
|
77
|
-
// Invariant: a pinned Settings tab closes as a tab; neither Esc nor one unclaimed Ctrl+C dismisses its screen.
|
|
78
75
|
return hostApp(SETTINGS_APP_ID, SETTINGS_ROUTE, () => new SettingsApp(settings, {
|
|
79
|
-
pinned,
|
|
80
76
|
searchInputFactory,
|
|
81
|
-
configurePlusMenu: options.configurePlusMenu ?? null,
|
|
82
77
|
dialogPanel: text => renderFloatingDialogSurface(text, piTheme().getColorMode()),
|
|
83
78
|
...(options.copyText === undefined ? {} : { copyText: options.copyText }),
|
|
84
|
-
}),
|
|
79
|
+
}), true, true, text => renderFloatingMenuSurface(text, piTheme().getColorMode()));
|
|
85
80
|
}
|
|
86
|
-
async function loadReferenceSurface(settings, route, title, document,
|
|
81
|
+
async function loadReferenceSurface(settings, route, title, document, options) {
|
|
87
82
|
const id = route;
|
|
88
83
|
const [{ ReferenceScreenApp }, content, selection] = await Promise.all([
|
|
89
84
|
import("../features/owned-ui/reference-screen-app.js"),
|
|
@@ -101,9 +96,8 @@ async function loadReferenceSurface(settings, route, title, document, pinned, op
|
|
|
101
96
|
scrollbarStyle: settings.value("scrollbarStyle"),
|
|
102
97
|
scrollbarSpeed: settings.value("scrollbarSpeed"),
|
|
103
98
|
}),
|
|
104
|
-
pinned,
|
|
105
99
|
...(selection === undefined ? {} : { selection }),
|
|
106
|
-
}),
|
|
100
|
+
}), true, selection !== undefined);
|
|
107
101
|
}
|
|
108
102
|
async function hostApp(id, route, create, closeOnInterrupt = true, appInputBeforeInterrupt = false, panel = text => text) {
|
|
109
103
|
const [{ UiAppHost }, { UiAppRegistry }] = await Promise.all([
|