@timurproko/a1 0.2.7-dev.1252 → 0.2.7-dev.1255
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/bin/ui.js +3 -3
- package/dist/app/session-shell/clipboard-diagnostics.d.ts +2 -2
- package/dist/app/session-shell/clipboard-image.d.ts +0 -1
- package/dist/app/session-shell/clipboard-image.js +1 -1
- package/dist/app/session-shell/dialog-coordinator.d.ts +6 -5
- package/dist/app/session-shell/dialog-coordinator.js +3 -4
- package/dist/app/session-shell/dock-chrome.d.ts +11 -6
- package/dist/app/session-shell/dock-chrome.js +5 -8
- package/dist/app/session-shell/editor-hyperlink-budget.d.ts +0 -2
- package/dist/app/session-shell/editor-hyperlink-budget.js +1 -1
- package/dist/app/session-shell/exit-notice.d.ts +2 -2
- package/dist/app/session-shell/exit-notice.js +1 -1
- package/dist/app/session-shell/extension-surface.d.ts +8 -7
- package/dist/app/session-shell/helper-pool.d.ts +3 -4
- package/dist/app/session-shell/helper-pool.js +1 -1
- package/dist/app/session-shell/image-preparation-client.d.ts +4 -3
- package/dist/app/session-shell/image-preparation.d.ts +0 -2
- package/dist/app/session-shell/image-preparation.js +2 -2
- package/dist/app/session-shell/image-source.d.ts +2 -3
- package/dist/app/session-shell/image-source.js +2 -2
- package/dist/app/session-shell/input-surface-switch.d.ts +9 -7
- package/dist/app/session-shell/input-surface-switch.js +1 -2
- package/dist/app/session-shell/login-interaction.d.ts +5 -4
- package/dist/app/session-shell/login-interaction.js +2 -3
- package/dist/app/session-shell/paste-executor.d.ts +4 -8
- package/dist/app/session-shell/paste-executor.js +2 -2
- package/dist/app/session-shell/paste-protocol.d.ts +2 -2
- package/dist/app/session-shell/path-chip-presentation.d.ts +0 -5
- package/dist/app/session-shell/path-chip-presentation.js +3 -3
- package/dist/app/session-shell/prompt-chips.d.ts +8 -7
- package/dist/app/session-shell/prompt-history-controller.d.ts +3 -3
- package/dist/app/session-shell/prompt-submission.d.ts +5 -2
- package/dist/app/session-shell/prompt-submission.js +4 -5
- package/dist/app/session-shell/quit-outro-effects.d.ts +3 -3
- package/dist/app/session-shell/quit-outro-effects.js +1 -4
- package/dist/app/session-shell/quit-outro.d.ts +9 -12
- package/dist/app/session-shell/quit-outro.js +11 -11
- package/dist/app/session-shell/response-copy-protocol.d.ts +3 -2
- package/dist/app/session-shell/response-copy-transport.d.ts +2 -14
- package/dist/app/session-shell/response-copy-transport.js +1 -1
- package/dist/app/session-shell/session-lifecycle.d.ts +2 -1
- package/dist/app/session-shell/session-shell-root.d.ts +74 -89
- package/dist/app/session-shell/session-shell-root.js +81 -113
- package/dist/app/session-shell/session-shell.d.ts +13 -16
- package/dist/app/session-shell/session-shell.js +144 -268
- package/dist/app/session-shell/session-viewport-controller.d.ts +7 -6
- package/dist/app/session-shell/session-viewport-controller.js +2 -2
- package/dist/app/session-shell/settings-bindings.d.ts +24 -2
- package/dist/app/session-shell/settings-bindings.js +24 -0
- package/dist/app/session-shell/share-operation.d.ts +3 -3
- package/dist/app/session-shell/share-operation.js +4 -6
- package/dist/app/session-shell/shell-clipboard.d.ts +59 -0
- package/dist/app/session-shell/shell-clipboard.js +119 -0
- package/dist/app/session-shell/shell-editor-factory.d.ts +8 -4
- package/dist/app/session-shell/shell-editor-factory.js +13 -15
- package/dist/app/session-shell/shell-host.d.ts +16 -17
- package/dist/app/session-shell/shell-host.js +18 -19
- package/dist/app/session-shell/shell-layout.d.ts +2 -2
- package/dist/app/session-shell/shell-prompt-suggestions.d.ts +26 -0
- package/dist/app/session-shell/shell-prompt-suggestions.js +48 -0
- package/dist/app/session-shell/suggestion-surface.d.ts +1 -6
- package/dist/app/session-shell/suggestion-surface.js +1 -1
- package/dist/app/session-shell/system-clipboard.d.ts +2 -14
- package/dist/app/session-shell/system-clipboard.js +2 -7
- package/dist/app/session-shell/transcript-document.d.ts +11 -8
- package/dist/app/session-shell/transcript-document.js +13 -14
- package/dist/app/session-shell/viewport-layout.d.ts +2 -2
- package/dist/app/session-shell/workflow-output.d.ts +5 -3
- package/dist/app/session-shell/workflow-output.js +13 -15
- package/dist/cli/package-messages.d.ts +0 -1
- package/dist/cli/package-messages.js +1 -1
- package/dist/cli/session-context.d.ts +1 -1
- package/dist/cli/uninstall.d.ts +3 -2
- package/dist/composition/owned-settings.d.ts +2 -1
- package/dist/composition/owned-settings.js +0 -3
- package/dist/composition/owned-ui.d.ts +1 -1
- package/dist/composition/owned-ui.js +27 -27
- package/dist/composition/reference-selection-options.d.ts +1 -1
- package/dist/composition/reference-selection-options.js +1 -1
- package/dist/composition/session-runtime-registry.d.ts +2 -1
- package/dist/composition/settings-route-host.js +3 -10
- package/dist/composition/settings-search-input.d.ts +2 -1
- package/dist/composition/startup-route.d.ts +2 -2
- package/dist/composition/startup-route.js +2 -2
- package/dist/contracts/owned-ui/extension-ui.d.ts +2 -1
- package/dist/contracts/owned-ui/index.d.ts +1 -0
- package/dist/contracts/owned-ui/session-presenters.d.ts +3 -0
- package/dist/contracts/owned-ui/shell-components.d.ts +543 -0
- package/dist/contracts/owned-ui/shell-components.js +1 -0
- package/dist/contracts/presentation/component.d.ts +17 -0
- package/dist/contracts/presentation/component.js +8 -0
- package/dist/contracts/presentation/index.d.ts +6 -15
- package/dist/contracts/presentation/index.js +2 -0
- package/dist/contracts/presentation/terminal.d.ts +290 -0
- package/dist/contracts/presentation/terminal.js +1 -0
- package/dist/contracts/presentation/theme.d.ts +46 -0
- package/dist/contracts/presentation/theme.js +1 -0
- package/dist/features/launch/development-launch.js +1 -1
- package/dist/features/launch/runtime-selection.d.ts +2 -2
- package/dist/features/launch/runtime-selection.js +2 -2
- package/dist/features/owned-ui/project-trust-prompt.d.ts +2 -2
- package/dist/features/owned-ui/project-trust-prompt.js +1 -1
- package/dist/features/owned-ui/release-note-state.d.ts +2 -1
- package/dist/features/owned-ui/settings-app.js +38 -219
- package/dist/features/owned-ui/settings-edits.d.ts +31 -0
- package/dist/features/owned-ui/settings-edits.js +139 -0
- package/dist/features/owned-ui/settings-scroll-rail.d.ts +29 -0
- package/dist/features/owned-ui/settings-scroll-rail.js +79 -0
- package/dist/features/owned-ui/settings-search-input.d.ts +2 -1
- package/dist/features/prompt-history/service.d.ts +3 -2
- package/dist/foundation/lifecycle/claim-gate.d.ts +2 -1
- package/dist/foundation/release/automatic-update.d.ts +5 -14
- package/dist/foundation/release/automatic-update.js +14 -14
- package/dist/foundation/release/bootstrap.js +4 -4
- package/dist/foundation/release/dependency-certification.d.ts +0 -1
- package/dist/foundation/release/dependency-certification.js +1 -1
- package/dist/foundation/release/early-accent.d.ts +2 -2
- package/dist/foundation/release/early-accent.js +1 -1
- package/dist/foundation/release/index.d.ts +2 -2
- package/dist/foundation/release/index.js +1 -1
- package/dist/foundation/release/latest-release.d.ts +3 -18
- package/dist/foundation/release/latest-release.js +10 -10
- package/dist/foundation/release/ordinary-launch-selection.d.ts +1 -1
- package/dist/foundation/release/ordinary-launch-selection.js +1 -1
- package/dist/foundation/release/release-gc.d.ts +3 -3
- package/dist/foundation/release/release-gc.js +4 -4
- package/dist/foundation/release/{cohort-state.d.ts → release-state.d.ts} +23 -23
- package/dist/foundation/release/{cohort-state.js → release-state.js} +8 -8
- package/dist/foundation/release/update-activation.js +2 -2
- package/dist/foundation/release/update-execution-lease.d.ts +2 -3
- package/dist/foundation/release/update-execution-lease.js +1 -1
- package/dist/foundation/release/update-launch.d.ts +2 -2
- package/dist/foundation/release/update.d.ts +0 -2
- package/dist/foundation/release/update.js +14 -14
- package/dist/foundation/startup/startup-budget.d.ts +5 -5
- package/dist/foundation/startup/startup-budget.js +2 -2
- package/dist/integrations/pi/components/editor-interaction.d.ts +4 -12
- package/dist/integrations/pi/components/index.d.ts +15 -9
- package/dist/integrations/pi/components/index.js +9 -5
- package/dist/integrations/pi/components/lazy-selectors.d.ts +2 -10
- package/dist/integrations/pi/components/lazy-selectors.js +1 -1
- package/dist/integrations/pi/components/modal-frame.d.ts +5 -22
- package/dist/integrations/pi/components/modal-frame.js +3 -23
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +4 -3
- package/dist/integrations/pi/components/prompt-input-port.d.ts +2 -19
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +2 -1
- package/dist/integrations/pi/components/shell-editor-autocomplete.d.ts +3 -2
- package/dist/integrations/pi/components/shell-footer-status.d.ts +2 -2
- package/dist/integrations/pi/components/shell-footer-status.js +3 -2
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +6 -5
- package/dist/integrations/pi/components/shell-presenters-info.js +2 -1
- package/dist/integrations/pi/components/shell-session-info-reference.d.ts +2 -1
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +33 -227
- package/dist/integrations/pi/components/shell-shared-facade.js +8 -1
- package/dist/integrations/pi/components/skills-command.d.ts +1 -9
- package/dist/integrations/pi/components/skills-command.js +5 -5
- package/dist/integrations/pi/components/theme.d.ts +9 -2
- package/dist/integrations/pi/components/theme.js +17 -2
- package/dist/integrations/pi/components/thinking-selector-dialog.d.ts +2 -1
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +2 -2
- package/dist/integrations/pi/engine/adapter.d.ts +3 -5
- package/dist/integrations/pi/engine/adapter.js +3 -12
- package/dist/integrations/pi/engine/changelog.d.ts +2 -2
- package/dist/integrations/pi/engine/changelog.js +3 -3
- package/dist/integrations/pi/engine/compaction-progress.d.ts +2 -3
- package/dist/integrations/pi/engine/compaction-progress.js +1 -1
- package/dist/integrations/pi/engine/conformance.d.ts +2 -1
- package/dist/integrations/pi/engine/default-model-setting.d.ts +0 -2
- package/dist/integrations/pi/engine/default-model-setting.js +1 -2
- package/dist/integrations/pi/engine/event-delivery.d.ts +2 -1
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +2 -1
- package/dist/integrations/pi/engine/host.js +2 -2
- package/dist/integrations/pi/engine/message-values.d.ts +0 -1
- package/dist/integrations/pi/engine/message-values.js +1 -1
- package/dist/integrations/pi/engine/pending-delivery.d.ts +0 -4
- package/dist/integrations/pi/engine/pending-delivery.js +3 -3
- package/dist/integrations/pi/engine/ports.d.ts +7 -1
- package/dist/integrations/pi/engine/ports.js +4 -0
- package/dist/integrations/pi/engine/project-trust-preflight.d.ts +2 -1
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +3 -2
- package/dist/integrations/pi/engine/provider-authentication.d.ts +1 -1
- package/dist/integrations/pi/engine/public-main-entry.d.ts +1 -5
- package/dist/integrations/pi/engine/public-main-entry.js +1 -1
- package/dist/integrations/pi/engine/repository-pr-rest.d.ts +1 -9
- package/dist/integrations/pi/engine/repository-pr-rest.js +2 -2
- package/dist/integrations/pi/engine/repository-pr.d.ts +1 -3
- package/dist/integrations/pi/engine/repository-pr.js +1 -1
- package/dist/integrations/pi/engine/resource-catalog.d.ts +2 -1
- package/dist/integrations/pi/engine/session-integration.d.ts +1 -1
- package/dist/integrations/pi/engine/session-runtime.d.ts +4 -3
- package/dist/integrations/pi/engine/settings-bridge.d.ts +0 -2
- package/dist/integrations/pi/engine/settings-bridge.js +1 -1
- package/dist/integrations/pi/engine/settings-port.d.ts +3 -2
- package/dist/integrations/pi/engine/transcript-projection.d.ts +2 -1
- package/dist/integrations/pi/engine/workflow-contexts.d.ts +1 -1
- package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -1
- package/dist/integrations/pi/engine/workflow-support.d.ts +0 -6
- package/dist/integrations/pi/engine/workflow-support.js +4 -18
- package/dist/integrations/pi/engine/workflows.d.ts +5 -5
- package/dist/integrations/pi/session-presenters/components.d.ts +3 -0
- package/dist/integrations/pi/session-presenters/components.js +75 -0
- package/dist/integrations/pi/session-presenters/index.d.ts +1 -0
- package/dist/integrations/pi/session-presenters/index.js +1 -0
- package/dist/integrations/pi/session-presenters/presentation.d.ts +3 -0
- package/dist/integrations/pi/session-presenters/presentation.js +10 -0
- package/dist/integrations/pi/session-presenters/presenters.d.ts +2 -1
- package/dist/integrations/pi/session-presenters/presenters.js +3 -1
- package/dist/integrations/pi/tui-runtime/adapter.js +21 -30
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +22 -166
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +5 -40
- package/dist/integrations/pi/tui-runtime/index.d.ts +1 -0
- package/dist/integrations/pi/tui-runtime/index.js +1 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +4 -6
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +2 -8
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +3 -9
- package/dist/integrations/pi/tui-runtime/runtime-factory.d.ts +3 -0
- package/dist/integrations/pi/tui-runtime/runtime-factory.js +11 -0
- package/dist/ui/components/index.d.ts +2 -2
- package/dist/ui/components/index.js +1 -1
- package/dist/ui/components/selection-copy.d.ts +0 -1
- package/dist/ui/components/selection-copy.js +0 -12
- package/dist/ui/components/theme.d.ts +4 -19
- package/dist/ui/components/theme.js +6 -0
- package/dist/ui/settings/declarations.d.ts +2 -3
- package/dist/ui/settings/declarations.js +2 -3
- package/dist/ui/settings/early-accent.js +1 -1
- package/dist/ui/settings/index.d.ts +3 -5
- package/dist/ui/settings/index.js +2 -3
- package/dist/ui/settings/manager.d.ts +0 -4
- package/dist/ui/settings/manager.js +6 -62
- package/dist/ui/settings/resolution.d.ts +6 -18
- package/dist/ui/settings/resolution.js +4 -103
- package/dist/ui/settings/sections.d.ts +0 -4
- package/dist/ui/settings/sections.js +1 -1
- package/docs/architecture/boundaries.md +2 -2
- package/docs/architecture/internal-naming.md +2 -0
- package/docs/architecture/project-structure.md +4 -2
- package/docs/validation.md +1 -1
- package/package.json +3 -4
- package/dist/integrations/pi/components/components.d.ts +0 -4
- package/dist/integrations/pi/components/components.js +0 -48
- package/dist/integrations/pi/components/conformance.d.ts +0 -18
- package/dist/integrations/pi/components/conformance.js +0 -70
- package/dist/integrations/pi/components/shell-components.d.ts +0 -7
- package/dist/integrations/pi/components/shell-components.js +0 -7
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +0 -33
- package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -114
- package/dist/ui/settings/migrations.d.ts +0 -19
- package/dist/ui/settings/migrations.js +0 -225
- package/dist/ui/settings/progress-palette.generated.d.ts +0 -139
- package/dist/ui/settings/progress-palette.generated.js +0 -139
- /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.d.ts +0 -0
- /package/dist/{foundation/release → contracts/presentation}/progress-palette.generated.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MaterializedRelease } from "./release-store.js";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const RELEASE_STATE_SCHEMA: string;
|
|
3
3
|
/** How long a release stays on disk after its approval, so processes started from it keep their files. */
|
|
4
4
|
export declare const RELEASE_RETENTION_MS: number;
|
|
5
5
|
export type ReleaseApproval = "candidate" | "approved" | "rejected";
|
|
@@ -66,8 +66,8 @@ export interface ReleaseCleanupState {
|
|
|
66
66
|
readonly diagnostics: readonly ReleaseCleanupDiagnostic[];
|
|
67
67
|
readonly workerRuns: readonly ReleaseCleanupWorkerRun[];
|
|
68
68
|
}
|
|
69
|
-
export interface
|
|
70
|
-
readonly schema: typeof
|
|
69
|
+
export interface ReleaseState {
|
|
70
|
+
readonly schema: typeof RELEASE_STATE_SCHEMA;
|
|
71
71
|
readonly revision: number;
|
|
72
72
|
readonly releases: Readonly<Record<string, ReleaseRecord>>;
|
|
73
73
|
readonly references: ReleaseReferences;
|
|
@@ -93,7 +93,7 @@ export interface OrphanReleaseDisposition {
|
|
|
93
93
|
readonly trashPath?: string | null;
|
|
94
94
|
}
|
|
95
95
|
export interface ReleaseRetentionReconciliation {
|
|
96
|
-
readonly state:
|
|
96
|
+
readonly state: ReleaseState;
|
|
97
97
|
readonly plan: ProtectedReleasePlan;
|
|
98
98
|
readonly detachedReleaseIds: readonly string[];
|
|
99
99
|
}
|
|
@@ -104,33 +104,33 @@ export interface ReleaseRetentionReconciliation {
|
|
|
104
104
|
* Nothing asks which processes are running: a session that outlives the window and two updates
|
|
105
105
|
* can lose its release files, which is the documented trade-off.
|
|
106
106
|
*/
|
|
107
|
-
export declare function planProtectedReleases(state:
|
|
107
|
+
export declare function planProtectedReleases(state: ReleaseState, inputs?: ProtectedReleaseInputs): ProtectedReleasePlan;
|
|
108
108
|
/**
|
|
109
109
|
* Whether a release is young enough to keep. An approved release counts from its approval; a
|
|
110
110
|
* candidate still awaiting certification counts from its materialization so concurrent work is
|
|
111
111
|
* not collected under it. A record without a readable timestamp is treated as old.
|
|
112
112
|
*/
|
|
113
113
|
export declare function withinRetention(release: ReleaseRecord, now: number, retentionMs?: number): boolean;
|
|
114
|
-
/** Serializes validated
|
|
115
|
-
export declare class
|
|
114
|
+
/** Serializes validated release-state revisions under a lock and commits each update atomically. */
|
|
115
|
+
export declare class ReleaseStateStore {
|
|
116
116
|
readonly path: string;
|
|
117
117
|
constructor(dataDir: string);
|
|
118
|
-
read(): Promise<
|
|
119
|
-
update(operation: (current:
|
|
120
|
-
recordCandidate(release: MaterializedRelease): Promise<
|
|
121
|
-
approve(releaseId: string, diagnosticsPath: string): Promise<
|
|
122
|
-
activate(releaseId: string): Promise<
|
|
118
|
+
read(): Promise<ReleaseState>;
|
|
119
|
+
update(operation: (current: ReleaseState) => ReleaseState | Promise<ReleaseState>): Promise<ReleaseState>;
|
|
120
|
+
recordCandidate(release: MaterializedRelease): Promise<ReleaseState>;
|
|
121
|
+
approve(releaseId: string, diagnosticsPath: string): Promise<ReleaseState>;
|
|
122
|
+
activate(releaseId: string): Promise<ReleaseState>;
|
|
123
123
|
/** Atomically advances ordinary launch without allowing an older installation to roll active state back. */
|
|
124
|
-
activateForLaunch(releaseId: string, replaceUnlaunchableActiveId?: string): Promise<
|
|
125
|
-
rollback(): Promise<
|
|
124
|
+
activateForLaunch(releaseId: string, replaceUnlaunchableActiveId?: string): Promise<ReleaseState>;
|
|
125
|
+
rollback(): Promise<ReleaseState>;
|
|
126
126
|
/** Atomically replace legacy retention history and detach every currently collectible record. */
|
|
127
|
-
reconcileRetention(resolveInputs: (current:
|
|
128
|
-
markCleanupTrash(releaseId: string, trashPath: string): Promise<
|
|
129
|
-
recordCleanupFailure(releaseId: string, stage: string, error: unknown): Promise<
|
|
130
|
-
completeCleanup(releaseId: string): Promise<
|
|
131
|
-
recordCleanupWorkerScheduled(runId: string): Promise<
|
|
132
|
-
recordCleanupWorkerStarted(runId: string, pid: number): Promise<
|
|
133
|
-
recordCleanupWorkerProgress(runId: string, summary: ReleaseCleanupWorkerSummary): Promise<
|
|
134
|
-
recordCleanupWorkerFinished(runId: string, status: Exclude<ReleaseCleanupWorkerStatus, "scheduled" | "running">, summary: ReleaseCleanupWorkerSummary, error?: unknown): Promise<
|
|
127
|
+
reconcileRetention(resolveInputs: (current: ReleaseState) => ProtectedReleaseInputs | Promise<ProtectedReleaseInputs>, orphans?: readonly OrphanReleaseDisposition[]): Promise<ReleaseRetentionReconciliation>;
|
|
128
|
+
markCleanupTrash(releaseId: string, trashPath: string): Promise<ReleaseState>;
|
|
129
|
+
recordCleanupFailure(releaseId: string, stage: string, error: unknown): Promise<ReleaseState>;
|
|
130
|
+
completeCleanup(releaseId: string): Promise<ReleaseState>;
|
|
131
|
+
recordCleanupWorkerScheduled(runId: string): Promise<ReleaseState>;
|
|
132
|
+
recordCleanupWorkerStarted(runId: string, pid: number): Promise<ReleaseState>;
|
|
133
|
+
recordCleanupWorkerProgress(runId: string, summary: ReleaseCleanupWorkerSummary): Promise<ReleaseState>;
|
|
134
|
+
recordCleanupWorkerFinished(runId: string, status: Exclude<ReleaseCleanupWorkerStatus, "scheduled" | "running">, summary: ReleaseCleanupWorkerSummary, error?: unknown): Promise<ReleaseState>;
|
|
135
135
|
}
|
|
136
|
-
export declare function emptyState():
|
|
136
|
+
export declare function emptyState(): ReleaseState;
|
|
@@ -3,7 +3,7 @@ import { mkdir, open, readFile, rename, rm, stat } from "node:fs/promises";
|
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
4
|
import { selectOrdinaryLaunchReleaseId } from "./ordinary-launch-selection.js";
|
|
5
5
|
import { PRODUCT_IDENTITY } from "../../product-identity.js";
|
|
6
|
-
export const
|
|
6
|
+
export const RELEASE_STATE_SCHEMA = PRODUCT_IDENTITY.protocol.releaseCohortSchema;
|
|
7
7
|
const RELEASE_ID_PATTERN = /^[0-9A-Za-z.+_-]+-[a-f0-9]{20}$/;
|
|
8
8
|
/** How long a release stays on disk after its approval, so processes started from it keep their files. */
|
|
9
9
|
export const RELEASE_RETENTION_MS = 7 * 24 * 60 * 60 * 1_000;
|
|
@@ -51,8 +51,8 @@ export function withinRetention(release, now, retentionMs = RELEASE_RETENTION_MS
|
|
|
51
51
|
const at = stamp === null ? Number.NaN : Date.parse(stamp);
|
|
52
52
|
return Number.isFinite(at) && now - at < retentionMs;
|
|
53
53
|
}
|
|
54
|
-
/** Serializes validated
|
|
55
|
-
export class
|
|
54
|
+
/** Serializes validated release-state revisions under a lock and commits each update atomically. */
|
|
55
|
+
export class ReleaseStateStore {
|
|
56
56
|
path;
|
|
57
57
|
constructor(dataDir) {
|
|
58
58
|
this.path = resolve(dataDir, "release-state.json");
|
|
@@ -317,7 +317,7 @@ export class CohortStateStore {
|
|
|
317
317
|
}
|
|
318
318
|
export function emptyState() {
|
|
319
319
|
return {
|
|
320
|
-
schema:
|
|
320
|
+
schema: RELEASE_STATE_SCHEMA,
|
|
321
321
|
revision: 0,
|
|
322
322
|
releases: {},
|
|
323
323
|
references: { active: null, pending: null, approved: null, rollback: null, retention: [] },
|
|
@@ -430,11 +430,11 @@ function normalizeState(value) {
|
|
|
430
430
|
};
|
|
431
431
|
}
|
|
432
432
|
function validateState(state) {
|
|
433
|
-
if (!state || state.schema !==
|
|
433
|
+
if (!state || state.schema !== RELEASE_STATE_SCHEMA || !Number.isSafeInteger(state.revision) || state.revision < 0
|
|
434
434
|
|| !state.releases || typeof state.releases !== "object" || !state.references || !Array.isArray(state.references.retention)
|
|
435
435
|
|| !state.cleanup || typeof state.cleanup.pending !== "object" || !Array.isArray(state.cleanup.diagnostics)
|
|
436
436
|
|| !Array.isArray(state.cleanup.workerRuns)) {
|
|
437
|
-
throw new Error("invalid release
|
|
437
|
+
throw new Error("invalid release state");
|
|
438
438
|
}
|
|
439
439
|
for (const run of state.cleanup.workerRuns) {
|
|
440
440
|
if (!run || typeof run.runId !== "string" || run.runId.length === 0
|
|
@@ -469,9 +469,9 @@ function validateReleaseRecord(releaseId, release) {
|
|
|
469
469
|
function validateTransition(current, next) {
|
|
470
470
|
validateState(next);
|
|
471
471
|
if (next.schema !== current.schema)
|
|
472
|
-
throw new Error("release
|
|
472
|
+
throw new Error("release schema cannot change during a state update");
|
|
473
473
|
if (next.revision !== current.revision)
|
|
474
|
-
throw new Error("release
|
|
474
|
+
throw new Error("release revision is controlled by the state store");
|
|
475
475
|
}
|
|
476
476
|
function boundedError(error) {
|
|
477
477
|
return (error instanceof Error ? error.message : String(error)).replace(/[\r\n]+/g, " ").slice(0, 1_000);
|
|
@@ -4,7 +4,7 @@ import { resolve } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { PRODUCT_TEXT } from "../../product-identity.js";
|
|
6
6
|
import { certifyMaterializedRelease } from "./bootstrap.js";
|
|
7
|
-
import {
|
|
7
|
+
import { ReleaseStateStore } from "./release-state.js";
|
|
8
8
|
import { resolveProductPaths } from "../lifecycle/index.js";
|
|
9
9
|
import { materializeRelease } from "./release-store.js";
|
|
10
10
|
import { warmMaterializedRelease } from "./warmup.js";
|
|
@@ -27,7 +27,7 @@ const ACTIVATION_LINE_LIMIT = 64 * 1_024;
|
|
|
27
27
|
* its activation entry, and what an updater runs in-process for a tree older than the contract.
|
|
28
28
|
*/
|
|
29
29
|
export async function activateInstalledRelease(request, callbacks) {
|
|
30
|
-
const stateStore = new
|
|
30
|
+
const stateStore = new ReleaseStateStore(request.dataDir);
|
|
31
31
|
let total = 0;
|
|
32
32
|
let completed = 0;
|
|
33
33
|
const candidate = await materializeRelease(request.packageRoot, request.dataDir, {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { UpdateChannel } from "./types.js";
|
|
2
2
|
import { type UpdateTransaction } from "./update-transaction.js";
|
|
3
|
-
export declare const UPDATE_EXECUTION_LEASE_FILENAME = "update-execution.json";
|
|
4
3
|
declare const LEASE_SCHEMA = 1;
|
|
5
|
-
|
|
4
|
+
type UpdateExecutionMode = "manual" | "automatic";
|
|
6
5
|
export interface UpdateExecutionOwner {
|
|
7
6
|
readonly schema: typeof LEASE_SCHEMA;
|
|
8
7
|
readonly ownerId: string;
|
|
@@ -14,7 +13,7 @@ export interface UpdateExecutionOwner {
|
|
|
14
13
|
readonly mode: UpdateExecutionMode;
|
|
15
14
|
readonly acquiredAt: string;
|
|
16
15
|
}
|
|
17
|
-
|
|
16
|
+
type UpdateExecutionLeaseResult = {
|
|
18
17
|
readonly status: "acquired";
|
|
19
18
|
readonly owner: UpdateExecutionOwner;
|
|
20
19
|
release(): Promise<void>;
|
|
@@ -4,7 +4,7 @@ import { dirname, resolve } from "node:path";
|
|
|
4
4
|
import lockfile from "proper-lockfile";
|
|
5
5
|
import { processIsAlive } from "./process-liveness.js";
|
|
6
6
|
import { UpdateTransactionStore } from "./update-transaction.js";
|
|
7
|
-
|
|
7
|
+
const UPDATE_EXECUTION_LEASE_FILENAME = "update-execution.json";
|
|
8
8
|
const LEASE_SCHEMA = 1;
|
|
9
9
|
const MAX_LEASE_BYTES = 8_192;
|
|
10
10
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReleaseState, ReleaseRecord } from "./release-state.js";
|
|
2
2
|
import type { UpdateTransaction } from "./update-transaction.js";
|
|
3
3
|
/** Keep interactive launches on the last successful release until the update commits success. */
|
|
4
|
-
export declare function selectUpdateLaunchRelease(state:
|
|
4
|
+
export declare function selectUpdateLaunchRelease(state: ReleaseState, transaction: UpdateTransaction | null): ReleaseRecord | null;
|
|
@@ -135,8 +135,6 @@ export declare const UPDATE_ALREADY_RUNNING_EXIT_CODE = 75;
|
|
|
135
135
|
export declare function isPackageLockError(error: unknown): boolean;
|
|
136
136
|
/** What the user reads when the package stayed held for the whole patience window. */
|
|
137
137
|
export declare function lockedPackageDiagnostic(packageRoot: string, waitedMs: number, attempts: number, error: unknown): string;
|
|
138
|
-
/** Bound on the child diagnostics an update keeps: enough for npm's failure reason, never a log. */
|
|
139
|
-
export declare const CHILD_DIAGNOSTIC_LIMIT = 8000;
|
|
140
138
|
export declare function createNpmProcessRunner(platform?: NodeJS.Platform): UpdateProcessRunner;
|
|
141
139
|
export declare function createUpdateLifecycleCoordinator(environment?: NodeJS.ProcessEnv, fileSystem?: UpdateFileSystem, _output?: UpdateOutput, patience?: UpdateUnlockPatience): UpdateLifecycleCoordinator;
|
|
142
140
|
/** Renders the terminal-only update meter; the visual preview shares this exact frame. */
|
|
@@ -5,11 +5,11 @@ import crossSpawn from "cross-spawn";
|
|
|
5
5
|
import { valid as validSemver } from "semver";
|
|
6
6
|
import { PRODUCT_IDENTITY, PRODUCT_TEXT } from "../../product-identity.js";
|
|
7
7
|
import { earlyAccentPalette, earlyTerminalAppearance, earlyTerminalColorMode, resolveEarlyAccentColor } from "./early-accent.js";
|
|
8
|
-
import { SHARED_PROGRESS_ACCENT_ANSI } from "
|
|
8
|
+
import { SHARED_PROGRESS_ACCENT_ANSI } from "../../contracts/presentation/index.js";
|
|
9
9
|
import { createRegistryFetcher, invalidateReleaseCheckCache, isNewerRelease, queryPublishedVersions, releaseChannelOf, } from "./latest-release.js";
|
|
10
10
|
import { certifyMaterializedRelease } from "./bootstrap.js";
|
|
11
11
|
import { resolveProductPaths } from "../lifecycle/index.js";
|
|
12
|
-
import {
|
|
12
|
+
import { ReleaseStateStore } from "./release-state.js";
|
|
13
13
|
import { materializeRelease, readMaterializedRelease } from "./release-store.js";
|
|
14
14
|
import { scheduleReleaseCleanup } from "./release-gc.js";
|
|
15
15
|
import { UPDATE_ACTIVATION_CONTRACT, activateInstalledRelease, delegateActivation, readActivationContracts, } from "./update-activation.js";
|
|
@@ -57,7 +57,7 @@ const defaultOutput = {
|
|
|
57
57
|
stderr(message) { process.stderr.write(message); },
|
|
58
58
|
};
|
|
59
59
|
/** Bound on the child diagnostics an update keeps: enough for npm's failure reason, never a log. */
|
|
60
|
-
|
|
60
|
+
const CHILD_DIAGNOSTIC_LIMIT = 8_000;
|
|
61
61
|
export function createNpmProcessRunner(platform = process.platform) {
|
|
62
62
|
return async (command, arguments_, request) => await new Promise((resolvePromise, rejectPromise) => {
|
|
63
63
|
// Invariant: no child of the updater shares the terminal. The progress bar is the only
|
|
@@ -84,7 +84,7 @@ export function createNpmProcessRunner(platform = process.platform) {
|
|
|
84
84
|
}
|
|
85
85
|
export function createUpdateLifecycleCoordinator(environment = process.env, fileSystem = defaultFileSystem, _output = defaultOutput, patience = {}) {
|
|
86
86
|
const paths = resolveProductPaths(environment);
|
|
87
|
-
const stateStore = new
|
|
87
|
+
const stateStore = new ReleaseStateStore(paths.dataDir);
|
|
88
88
|
return {
|
|
89
89
|
async targetIsActive(targetVersion) {
|
|
90
90
|
const state = await stateStore.read(), activeId = state.references.active;
|
|
@@ -529,17 +529,17 @@ export async function runSelfUpdate(options) {
|
|
|
529
529
|
}
|
|
530
530
|
// Rationale: the bar first appears only after every non-mutating replacement prerequisite passes.
|
|
531
531
|
progress.set(3, 15);
|
|
532
|
-
const
|
|
533
|
-
let
|
|
534
|
-
let priorActiveReleaseId =
|
|
535
|
-
if (options.runner === undefined && (priorActiveReleaseId === null ||
|
|
532
|
+
const releaseStateStore = new ReleaseStateStore(paths.dataDir);
|
|
533
|
+
let currentReleaseState = await releaseStateStore.read();
|
|
534
|
+
let priorActiveReleaseId = currentReleaseState.references.active;
|
|
535
|
+
if (options.runner === undefined && (priorActiveReleaseId === null || currentReleaseState.releases[priorActiveReleaseId]?.approval !== "approved")) {
|
|
536
536
|
// Invariant: protected replacement needs an immutable launch authority that npm cannot rename.
|
|
537
537
|
const recoveryRelease = await materializeRelease(packageRoot, paths.dataDir);
|
|
538
|
-
await
|
|
538
|
+
await releaseStateStore.recordCandidate(recoveryRelease);
|
|
539
539
|
const diagnostics = await certifyMaterializedRelease(recoveryRelease, paths.dataDir);
|
|
540
|
-
await
|
|
541
|
-
await
|
|
542
|
-
|
|
540
|
+
await releaseStateStore.approve(recoveryRelease.releaseId, diagnostics);
|
|
541
|
+
await releaseStateStore.activate(recoveryRelease.releaseId);
|
|
542
|
+
currentReleaseState = await releaseStateStore.read();
|
|
543
543
|
priorActiveReleaseId = recoveryRelease.releaseId;
|
|
544
544
|
}
|
|
545
545
|
transaction = await transactionStore.begin({
|
|
@@ -556,7 +556,7 @@ export async function runSelfUpdate(options) {
|
|
|
556
556
|
if (phaseBefore(transaction.phase, "package-installed")) {
|
|
557
557
|
if (options.packageReplacement || options.runner === undefined) {
|
|
558
558
|
const priorReleaseId = transaction.priorActiveReleaseId ?? priorActiveReleaseId;
|
|
559
|
-
const recordedPrior = priorReleaseId === null ? undefined :
|
|
559
|
+
const recordedPrior = priorReleaseId === null ? undefined : currentReleaseState.releases[priorReleaseId];
|
|
560
560
|
if ((!recordedPrior || recordedPrior.approval !== "approved") && !options.packageReplacement) {
|
|
561
561
|
throw new Error(PRODUCT_TEXT.diagnostic("cannot protect package replacement because no approved prior release is available"));
|
|
562
562
|
}
|
|
@@ -701,7 +701,7 @@ function reportChildDiagnostics(output, result) {
|
|
|
701
701
|
async function rollbackPriorRelease(dataDir, priorReleaseId) {
|
|
702
702
|
if (!priorReleaseId)
|
|
703
703
|
return "no prior release was available for rollback";
|
|
704
|
-
const stateStore = new
|
|
704
|
+
const stateStore = new ReleaseStateStore(dataDir);
|
|
705
705
|
const state = await stateStore.read();
|
|
706
706
|
const prior = state.releases[priorReleaseId];
|
|
707
707
|
if (!prior || prior.approval !== "approved")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StartupTraceEvent } from "./startup-runtime.js";
|
|
2
2
|
export interface StartupPerformanceEvidence {
|
|
3
3
|
readonly profileId: "a1" | "pi";
|
|
4
|
-
readonly launchKind: "post-update" | "
|
|
4
|
+
readonly launchKind: "post-update" | "restart" | "warm";
|
|
5
5
|
readonly events: readonly StartupTraceEvent[];
|
|
6
6
|
readonly moduleGraph?: {
|
|
7
7
|
readonly loadedFiles: number;
|
|
@@ -15,7 +15,7 @@ export interface StartupPerformanceEvidence {
|
|
|
15
15
|
}
|
|
16
16
|
export interface StartupBudgetViolation {
|
|
17
17
|
readonly profileId: "a1" | "pi";
|
|
18
|
-
readonly launchKind: "post-update" | "
|
|
18
|
+
readonly launchKind: "post-update" | "restart" | "warm";
|
|
19
19
|
readonly elapsedMs: number;
|
|
20
20
|
readonly budgetMs: number;
|
|
21
21
|
readonly dominantPhases: readonly {
|
|
@@ -27,13 +27,13 @@ export interface StartupBudgetViolation {
|
|
|
27
27
|
/** Resolve the declared budget for one launch kind so measurement and reporting never restate the numbers. */
|
|
28
28
|
export declare function resolveStartupBudgetMs(launchKind: StartupPerformanceEvidence["launchKind"], budgets?: {
|
|
29
29
|
readonly postUpdateMs: number;
|
|
30
|
-
readonly
|
|
30
|
+
readonly restartMs: number;
|
|
31
31
|
readonly warmMs: number;
|
|
32
32
|
}): number;
|
|
33
33
|
/** Compare measured startup evidence with its budget without deciding whether the channel enforces it. */
|
|
34
34
|
export declare function evaluateStartupPerformanceBudget(evidence: StartupPerformanceEvidence, budgets?: {
|
|
35
35
|
readonly postUpdateMs: number;
|
|
36
|
-
readonly
|
|
36
|
+
readonly restartMs: number;
|
|
37
37
|
readonly warmMs: number;
|
|
38
38
|
}): StartupBudgetViolation | null;
|
|
39
39
|
/** Render one budget violation as the single message used by failures, evidence, and run summaries. */
|
|
@@ -41,6 +41,6 @@ export declare function formatStartupBudgetViolation(violation: StartupBudgetVio
|
|
|
41
41
|
/** Enforce the startup budget in a channel that fails on an overrun. */
|
|
42
42
|
export declare function assertStartupPerformanceBudget(evidence: StartupPerformanceEvidence, budgets?: {
|
|
43
43
|
readonly postUpdateMs: number;
|
|
44
|
-
readonly
|
|
44
|
+
readonly restartMs: number;
|
|
45
45
|
readonly warmMs: number;
|
|
46
46
|
}): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const STARTUP_PERFORMANCE_BUDGETS = { postUpdateMs: 2_000,
|
|
1
|
+
const STARTUP_PERFORMANCE_BUDGETS = { postUpdateMs: 2_000, restartMs: 2_500, warmMs: 2_000 };
|
|
2
2
|
/** Resolve the declared budget for one launch kind so measurement and reporting never restate the numbers. */
|
|
3
3
|
export function resolveStartupBudgetMs(launchKind, budgets = STARTUP_PERFORMANCE_BUDGETS) {
|
|
4
|
-
return launchKind === "warm" ? budgets.warmMs : launchKind === "
|
|
4
|
+
return launchKind === "warm" ? budgets.warmMs : launchKind === "restart" ? budgets.restartMs : budgets.postUpdateMs;
|
|
5
5
|
}
|
|
6
6
|
/** Compare measured startup evidence with its budget without deciding whether the channel enforces it. */
|
|
7
7
|
export function evaluateStartupPerformanceBudget(evidence, budgets = STARTUP_PERFORMANCE_BUDGETS) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { OwnedUiShellEditorRecall } from "../../../contracts/owned-ui/index.js";
|
|
1
2
|
import type { Editor } from "@earendil-works/pi-tui";
|
|
2
|
-
|
|
3
|
+
interface EditorInteractionState {
|
|
3
4
|
lines: string[];
|
|
4
5
|
cursorLine: number;
|
|
5
6
|
cursorCol: number;
|
|
@@ -17,17 +18,7 @@ export interface EditorInteractionPort {
|
|
|
17
18
|
}>;
|
|
18
19
|
setSegmentTransform(transform: (text: string, mode: "word" | "grapheme", segments: Iterable<Intl.SegmentData>) => Iterable<Intl.SegmentData>): void;
|
|
19
20
|
}
|
|
20
|
-
export
|
|
21
|
-
replace(entries: readonly string[]): void;
|
|
22
|
-
position(): {
|
|
23
|
-
readonly index: number;
|
|
24
|
-
readonly total: number;
|
|
25
|
-
};
|
|
26
|
-
observe(listener: () => void): () => void;
|
|
27
|
-
reset(): void;
|
|
28
|
-
/** Exit a recall browse cycle by restoring the unsent draft rather than keeping the recalled entry. */
|
|
29
|
-
restoreDraft?(): void;
|
|
30
|
-
}
|
|
21
|
+
export type EditorRecallPort = OwnedUiShellEditorRecall;
|
|
31
22
|
export interface EditorSurface extends Pick<Editor, Exclude<keyof Editor, "setText" | "render" | "handleInput">> {
|
|
32
23
|
setText(text: string): void;
|
|
33
24
|
render(width: number): string[];
|
|
@@ -38,3 +29,4 @@ export interface EditorSurface extends Pick<Editor, Exclude<keyof Editor, "setTe
|
|
|
38
29
|
export type SelectionEditor = Pick<Editor, "getText" | "getCursor" | "setText" | "insertTextAtCursor" | "invalidate" | "onChange" | "getPaddingX" | "isShowingAutocomplete"> & {
|
|
39
30
|
readonly interaction?: EditorInteractionPort;
|
|
40
31
|
};
|
|
32
|
+
export {};
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
export { adaptPiAssistantMessage, adaptPiToolExecution, adaptPiUserMessage } from "./components.js";
|
|
2
1
|
export { loadHistoryEditor, type HistoryEditorConstructor } from "./history-editor-loader.js";
|
|
3
|
-
export { PiComponentConformanceError, runPiComponentConformance } from "./conformance.js";
|
|
4
|
-
export type { PiComponentConformanceReport, PiComponentConformanceResult } from "./conformance.js";
|
|
5
2
|
export { createPiShellOperationLoader, createPiShellShareOperationDialog, type PiShellOperationLoaderPort, } from "./share-operation-dialog.js";
|
|
6
|
-
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS,
|
|
3
|
+
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS, createPiShellEditor, } from "./shell-editor-autocomplete.js";
|
|
4
|
+
export { componentFromPort, componentPort, createTuiFacade, createPiKeybindingsHost, ensureTheme, formatSessionTokens, isAutocompleteProvider, isRecord, piShellHyperlink, piShellTruncateToWidth, piShellVisibleWidth, } from "./shell-shared-facade.js";
|
|
5
|
+
export { createPiExtensionUiBridge, } from "./shell-extension-ui.js";
|
|
6
|
+
export { createPiQueuedInputStatus, createPiShellFooter, createPiShellHeader, createPiShellLoadedResources, createPiShellStatus, } from "./shell-footer-status.js";
|
|
7
|
+
export { createPiShellArmin, createPiShellAuthProviderSelector, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellExtensionSelector, createPiShellLoginDialog, createPiShellModelSelector, createPiShellModelsDialog, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellShowImagesSelector, createPiShellSkillsSelector, createPiShellThemeSelector, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, } from "./shell-selectors-dialogs.js";
|
|
8
|
+
export { createPiShellChangelog, createPiShellCollapsedChangelog, createPiShellHotkeys, createPiShellSessionInfo, renderPiShellChangelogLines, renderPiShellCommandMessage, renderPiShellHotkeysLines, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateBanner, renderPiShellReleaseUpdateNotice, renderPiShellStatusText, } from "./shell-presenters-info.js";
|
|
9
|
+
export { createPiShellTranscriptComponent, isPiPromptStyleCompaction, renderPiShellStartupDiagnostic, renderPiShellTranscriptBlock, validatedAssistantMessage, } from "./shell-presenters-transcript.js";
|
|
7
10
|
export { renderPiShellHotkeySections } from "./shell-hotkey-sections.js";
|
|
8
11
|
export type { PiShellHotkeySection } from "./shell-hotkey-sections.js";
|
|
9
|
-
export type { PiExtensionUiBridge, PiExtensionUiBridgeHost,
|
|
10
|
-
export {
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
13
|
-
export type {
|
|
12
|
+
export type { PiExtensionUiBridge, PiExtensionUiBridgeHost, } from "./shell-extension-ui.js";
|
|
13
|
+
export type { PiShellAuthProviderOption, PiShellLoginDialogPort, PiShellModelSelectorOptions, PiShellModelsDialogOptions, PiShellModelsDialogPort, PiShellScopedModelDescriptor, PiShellScopedModelsSelectorOptions, PiShellScopedModelsSelectorPort, PiShellSettingsSelectorOptions, } from "./shell-selectors-dialogs.js";
|
|
14
|
+
export type { PiShellAutocompleteCommand, PiShellClipboardContent, PiShellComponentPort, PiShellEditorBodyGeometry, PiShellEditorOptions, PiShellEditorPointerEvent, PiKeybindingsHost, PiShellEditorPort, PiShellEditorTextRange, PiShellExtensionRendererResolver, PiShellHeaderOptions, PiShellHeaderPort, PiShellImageAssetResolver, PiShellLoadedResourcesPort, PiShellPasteReservation, PiShellQueuedInputPort, PiShellResourceEntry, PiShellResourceSection, PiShellSelectorOption, PiShellSelectorOptions, PiShellStartupNotice, PiShellStatusPlacement, PiShellStatusPort, PiShellTranscriptComponentPort, PiShellViewComponentPort, } from "./shell-shared-facade.js";
|
|
15
|
+
export type { PiShellCommandMessagePresentation, PiShellHotkeysPresentation, PiShellSessionInfoPresentation, } from "./shell-presenters-info.js";
|
|
16
|
+
export type { PiShellSubmittedPromptComposer, } from "./shell-presenters-transcript.js";
|
|
17
|
+
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, derivePiCanvasBackground, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes, loadPiTheme, onPiThemeChange, parsePiAutoThemeSetting, piCanvasBackgroundAnsi, piTheme, resolvePiThemeSetting, setPiAccentColor, setPiPackageBorderProjectionEnabled, stopPiThemeWatcher, } from "./upstream/theme/theme.js";
|
|
18
|
+
export type { PiAccentProjection, PiColorMode, PiTerminalTheme, PiTerminalThemeDetection, PiTerminalThemeDetector, PiThemeBackground, PiThemeResult } from "./upstream/theme/theme.js";
|
|
19
|
+
export { PI_THEME_SOURCE, getPiSelectListTheme, piUiTheme } from "./theme.js";
|
|
14
20
|
export { PI_MODAL_CONTENT_PADDING_X, PiModalFrame, PiModalHeader, addPiModalHeader, adoptPiModalFrame, adoptPiModalHeader, } from "./modal-frame.js";
|
|
15
21
|
export { ModelsDialogComponent } from "./models-dialog.js";
|
|
16
22
|
export type { ModelsDialogCallbacks, ModelsDialogConfig, ModelsDialogFilter, ModelsDialogModel } from "./models-dialog.js";
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
export { adaptPiAssistantMessage, adaptPiToolExecution, adaptPiUserMessage } from "./components.js";
|
|
2
1
|
export { loadHistoryEditor } from "./history-editor-loader.js";
|
|
3
|
-
export { PiComponentConformanceError, runPiComponentConformance } from "./conformance.js";
|
|
4
2
|
export { createPiShellOperationLoader, createPiShellShareOperationDialog, } from "./share-operation-dialog.js";
|
|
5
|
-
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS,
|
|
3
|
+
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS, createPiShellEditor, } from "./shell-editor-autocomplete.js";
|
|
4
|
+
export { componentFromPort, componentPort, createTuiFacade, createPiKeybindingsHost, ensureTheme, formatSessionTokens, isAutocompleteProvider, isRecord, piShellHyperlink, piShellTruncateToWidth, piShellVisibleWidth, } from "./shell-shared-facade.js";
|
|
5
|
+
export { createPiExtensionUiBridge, } from "./shell-extension-ui.js";
|
|
6
|
+
export { createPiQueuedInputStatus, createPiShellFooter, createPiShellHeader, createPiShellLoadedResources, createPiShellStatus, } from "./shell-footer-status.js";
|
|
7
|
+
export { createPiShellArmin, createPiShellAuthProviderSelector, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellExtensionSelector, createPiShellLoginDialog, createPiShellModelSelector, createPiShellModelsDialog, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellShowImagesSelector, createPiShellSkillsSelector, createPiShellThemeSelector, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, } from "./shell-selectors-dialogs.js";
|
|
8
|
+
export { createPiShellChangelog, createPiShellCollapsedChangelog, createPiShellHotkeys, createPiShellSessionInfo, renderPiShellChangelogLines, renderPiShellCommandMessage, renderPiShellHotkeysLines, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateBanner, renderPiShellReleaseUpdateNotice, renderPiShellStatusText, } from "./shell-presenters-info.js";
|
|
9
|
+
export { createPiShellTranscriptComponent, isPiPromptStyleCompaction, renderPiShellStartupDiagnostic, renderPiShellTranscriptBlock, validatedAssistantMessage, } from "./shell-presenters-transcript.js";
|
|
6
10
|
export { renderPiShellHotkeySections } from "./shell-hotkey-sections.js";
|
|
7
|
-
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, derivePiCanvasBackground, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes,
|
|
8
|
-
export {
|
|
11
|
+
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, derivePiCanvasBackground, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes, loadPiTheme, onPiThemeChange, parsePiAutoThemeSetting, piCanvasBackgroundAnsi, piTheme, resolvePiThemeSetting, setPiAccentColor, setPiPackageBorderProjectionEnabled, stopPiThemeWatcher, } from "./upstream/theme/theme.js";
|
|
12
|
+
export { PI_THEME_SOURCE, getPiSelectListTheme, piUiTheme } from "./theme.js";
|
|
9
13
|
export { PI_MODAL_CONTENT_PADDING_X, PiModalFrame, PiModalHeader, addPiModalHeader, adoptPiModalFrame, adoptPiModalHeader, } from "./modal-frame.js";
|
|
10
14
|
export { ModelsDialogComponent } from "./models-dialog.js";
|
|
11
15
|
export { CountdownTimer } from "./upstream/components/countdown-timer.js";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { PiShellComponentPort } from "./shell-shared-facade.js";
|
|
2
2
|
import type { ThinkingSelectorLevel } from "./upstream/components/thinking-selector.js";
|
|
3
3
|
import type { FilterMode } from "./upstream/components/tree-selector.js";
|
|
4
|
-
|
|
5
|
-
type TreeSelectorModule = typeof import("./upstream/components/tree-selector.js");
|
|
6
|
-
export interface PiShellLazyThinkingSelectorOptions {
|
|
4
|
+
interface PiShellLazyThinkingSelectorOptions {
|
|
7
5
|
readonly currentLevel: ThinkingSelectorLevel;
|
|
8
6
|
readonly availableLevels: readonly ThinkingSelectorLevel[];
|
|
9
7
|
readonly onSelect: (level: ThinkingSelectorLevel) => void;
|
|
@@ -15,7 +13,7 @@ export interface PiShellLazyThinkingSelectorOptions {
|
|
|
15
13
|
readonly cycleBinding: string | readonly string[];
|
|
16
14
|
};
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
interface PiShellLazyTreeSelectorOptions {
|
|
19
17
|
readonly tree: readonly unknown[];
|
|
20
18
|
readonly currentLeafId: string | null;
|
|
21
19
|
readonly terminalHeight: number;
|
|
@@ -31,12 +29,6 @@ export interface PiShellLazySelectorLoader {
|
|
|
31
29
|
createThinking(options: PiShellLazyThinkingSelectorOptions): Promise<PiShellComponentPort>;
|
|
32
30
|
createTree(options: PiShellLazyTreeSelectorOptions): Promise<PiShellComponentPort>;
|
|
33
31
|
}
|
|
34
|
-
export interface PiShellLazySelectorImports {
|
|
35
|
-
readonly thinking: () => Promise<ThinkingSelectorModule>;
|
|
36
|
-
readonly tree: () => Promise<TreeSelectorModule>;
|
|
37
|
-
}
|
|
38
|
-
/** Builds one idempotent selector loader; fulfilled, in-flight, and rejected imports remain shared. */
|
|
39
|
-
export declare function createPiShellLazySelectorLoader(imports?: PiShellLazySelectorImports): PiShellLazySelectorLoader;
|
|
40
32
|
/** Production selector loader, dynamically reached only after the first input-ready frame. */
|
|
41
33
|
export declare const piShellLazySelectors: PiShellLazySelectorLoader;
|
|
42
34
|
export {};
|
|
@@ -4,7 +4,7 @@ const DEFAULT_IMPORTS = {
|
|
|
4
4
|
tree: () => import("./upstream/components/tree-selector.js"),
|
|
5
5
|
};
|
|
6
6
|
/** Builds one idempotent selector loader; fulfilled, in-flight, and rejected imports remain shared. */
|
|
7
|
-
|
|
7
|
+
function createPiShellLazySelectorLoader(imports = DEFAULT_IMPORTS) {
|
|
8
8
|
let thinkingSelectorModule;
|
|
9
9
|
let treeSelectorModule;
|
|
10
10
|
const loadThinkingSelector = () => thinkingSelectorModule ??= imports.thinking();
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import { Container, Input, type Component, type Focusable
|
|
1
|
+
import { Container, Input, type Component, type Focusable } from "@earendil-works/pi-tui";
|
|
2
2
|
export declare const PI_MODAL_CONTENT_PADDING_X = 1;
|
|
3
3
|
/** Paints the standard Pi Input prompt as a live-themed dialog-search marker. */
|
|
4
4
|
export declare function renderPiModalSearchInput(input: Input, width: number): string[];
|
|
5
|
-
/** Keeps Pi Input behavior and geometry while owning only its standard dialog-search presentation. */
|
|
6
|
-
export declare class PiModalSearchInput implements Component, Focusable {
|
|
7
|
-
#private;
|
|
8
|
-
constructor(input: Input);
|
|
9
|
-
get focused(): boolean;
|
|
10
|
-
set focused(value: boolean);
|
|
11
|
-
invalidate(): void;
|
|
12
|
-
render(width: number): string[];
|
|
13
|
-
handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
14
|
-
}
|
|
15
5
|
/** Replaces one explicitly identified direct Input child with the standard search presentation. */
|
|
16
|
-
export declare function adoptPiModalSearchInput(container: Container, input: Component):
|
|
6
|
+
export declare function adoptPiModalSearchInput(container: Container, input: Component): Component & Focusable;
|
|
17
7
|
/** Adds one standard dialog-search presentation while callers retain the Input controller. */
|
|
18
|
-
export declare function addPiModalSearchInput(container: Container, input: Input):
|
|
8
|
+
export declare function addPiModalSearchInput(container: Container, input: Input): Component & Focusable;
|
|
19
9
|
/** Adds the standard navigation/select/close footer before a dependency component's bottom rule. */
|
|
20
10
|
export declare function addPiModalSelectFooter(container: Container): void;
|
|
21
|
-
/** Owned cancellable operation frame with the canonical dialog close guidance. */
|
|
22
|
-
export declare class PiCancellableOperationFrame extends Container {
|
|
23
|
-
#private;
|
|
24
|
-
constructor(tui: TUI, message: string);
|
|
25
|
-
get signal(): AbortSignal;
|
|
26
|
-
handleInput(data: string): void;
|
|
27
|
-
dispose(): void;
|
|
28
|
-
}
|
|
29
11
|
/** The semantic top rule/title pair used while a modal assembles its frame. */
|
|
30
12
|
export declare class PiModalHeader implements Component {
|
|
31
13
|
readonly rule: Component;
|
|
@@ -46,7 +28,7 @@ export declare class PiModalFrame implements Component {
|
|
|
46
28
|
}
|
|
47
29
|
/** Add compact titled-modal chrome while a component assembles its semantic body. */
|
|
48
30
|
export declare function addPiModalHeader(container: Container, rule: Component, title: Component): PiModalHeader;
|
|
49
|
-
|
|
31
|
+
interface PiModalFrameAdoption {
|
|
50
32
|
readonly topIndex: number;
|
|
51
33
|
readonly bottomIndex: number;
|
|
52
34
|
readonly header?: PiModalHeader;
|
|
@@ -65,3 +47,4 @@ export declare function adoptPiModalFrame(container: Container, adoption: PiModa
|
|
|
65
47
|
* never inspected or rewritten. The pinned comparison profile does not call this adapter.
|
|
66
48
|
*/
|
|
67
49
|
export declare function adoptPiModalHeader(container: Container, ruleIndex: number, titleIndex: number): PiModalHeader;
|
|
50
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Container, Input, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
2
2
|
import { DIALOG_CONTENT_PADDING_X, dialogFrameGeometry, insetDialogContent } from "../../../contracts/presentation/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints } from "./theme.js";
|
|
3
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalShortcutHints } from "./theme.js";
|
|
5
4
|
export const PI_MODAL_CONTENT_PADDING_X = DIALOG_CONTENT_PADDING_X;
|
|
6
5
|
/** Paints the standard Pi Input prompt as a live-themed dialog-search marker. */
|
|
7
6
|
export function renderPiModalSearchInput(input, width) {
|
|
@@ -14,7 +13,7 @@ export function renderPiModalSearchInput(input, width) {
|
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
15
|
/** Keeps Pi Input behavior and geometry while owning only its standard dialog-search presentation. */
|
|
17
|
-
|
|
16
|
+
class PiModalSearchInput {
|
|
18
17
|
#input;
|
|
19
18
|
constructor(input) {
|
|
20
19
|
this.#input = input;
|
|
@@ -48,25 +47,6 @@ export function addPiModalSelectFooter(container) {
|
|
|
48
47
|
{ key: "↑↓", action: "navigate" }, { key: "enter", action: "select" }, DIALOG_CLOSE_SHORTCUT_HINT,
|
|
49
48
|
]), 0, 0));
|
|
50
49
|
}
|
|
51
|
-
/** Owned cancellable operation frame with the canonical dialog close guidance. */
|
|
52
|
-
export class PiCancellableOperationFrame extends Container {
|
|
53
|
-
#loader;
|
|
54
|
-
constructor(tui, message) {
|
|
55
|
-
super();
|
|
56
|
-
const theme = piTheme();
|
|
57
|
-
this.#loader = new CancellableLoader(tui, text => theme.fg("accent", text), text => theme.fg("muted", text), message);
|
|
58
|
-
this.addChild(new DynamicBorder(paintPiBorder));
|
|
59
|
-
this.addChild(this.#loader);
|
|
60
|
-
this.addChild(new Spacer(1));
|
|
61
|
-
this.addChild(new Text(renderPiModalShortcutHints([DIALOG_CLOSE_SHORTCUT_HINT]), 0, 0));
|
|
62
|
-
this.addChild(new Spacer(1));
|
|
63
|
-
this.addChild(new DynamicBorder(paintPiBorder));
|
|
64
|
-
adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1 });
|
|
65
|
-
}
|
|
66
|
-
get signal() { return this.#loader.signal; }
|
|
67
|
-
handleInput(data) { this.#loader.handleInput(data); }
|
|
68
|
-
dispose() { this.#loader.dispose(); }
|
|
69
|
-
}
|
|
70
50
|
/** The semantic top rule/title pair used while a modal assembles its frame. */
|
|
71
51
|
export class PiModalHeader {
|
|
72
52
|
rule;
|
|
@@ -7,7 +7,7 @@ import type { PiShellClipboardContent, PiShellEditorTextRange, PiShellPasteReser
|
|
|
7
7
|
* vanilla Pi renders. This keeps owned UX additions out of the synchronized
|
|
8
8
|
* Pi editor port and gives future interactions one registration point.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
interface OwnedEditorUxInterceptor {
|
|
11
11
|
handleInput(data: string, next: (data?: string) => void): void;
|
|
12
12
|
render(width: number, next: () => string[]): string[];
|
|
13
13
|
reset(): void;
|
|
@@ -18,7 +18,7 @@ export interface OwnedEditorUxInterceptor {
|
|
|
18
18
|
pasteClipboard?(): boolean;
|
|
19
19
|
cancelPendingPastes?(): void;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
interface OwnedEditorPointerEvent {
|
|
22
22
|
readonly kind: "press" | "motion" | "release";
|
|
23
23
|
readonly button: number;
|
|
24
24
|
readonly column: number;
|
|
@@ -45,7 +45,7 @@ export declare class OwnedEditorUxInterception {
|
|
|
45
45
|
ownsPointer(): boolean;
|
|
46
46
|
pasteClipboard(): boolean;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
interface PromptSelectionUxOptions {
|
|
49
49
|
readonly copyText: (text: string, cut: boolean) => void;
|
|
50
50
|
readonly readClipboardContent: () => Promise<PiShellClipboardContent | null>;
|
|
51
51
|
readonly beginClipboardPaste?: () => PiShellPasteReservation;
|
|
@@ -77,3 +77,4 @@ export declare function createPromptSelectionInterceptor(editor: Editor, keybind
|
|
|
77
77
|
export declare function editorInsertedText(data: string): string | undefined;
|
|
78
78
|
/** Shares the existing atomic-aware body layout with prompt/menu composition. */
|
|
79
79
|
export declare function editorVisualLineCount(editor: Editor, width: number): number | undefined;
|
|
80
|
+
export {};
|