@timurproko/a1 0.2.7-dev.1252 → 0.2.7-dev.1264
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 +13 -14
- 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/resource-labels.d.ts +2 -0
- package/dist/app/session-shell/resource-labels.js +158 -0
- 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-prompt-history.d.ts +29 -0
- package/dist/app/session-shell/session-prompt-history.js +80 -0
- package/dist/app/session-shell/session-selectors.d.ts +46 -0
- package/dist/app/session-shell/session-selectors.js +269 -0
- package/dist/app/session-shell/session-shell-root.d.ts +76 -113
- package/dist/app/session-shell/session-shell-root.js +103 -329
- package/dist/app/session-shell/session-shell.d.ts +14 -37
- package/dist/app/session-shell/session-shell.js +177 -612
- package/dist/app/session-shell/session-viewport-controller.d.ts +9 -16
- package/dist/app/session-shell/session-viewport-controller.js +42 -320
- package/dist/app/session-shell/settings-bindings.d.ts +25 -3
- package/dist/app/session-shell/settings-bindings.js +26 -2
- 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/viewport-pointer.d.ts +83 -0
- package/dist/app/session-shell/viewport-pointer.js +361 -0
- 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 +77 -73
- 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 +2 -1
- package/dist/contracts/owned-ui/index.js +1 -1
- 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/validation.d.ts +1 -11
- package/dist/contracts/owned-ui/validation.js +8 -104
- 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 +284 -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 +49 -425
- 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-model-dialog.d.ts +41 -0
- package/dist/features/owned-ui/settings-model-dialog.js +194 -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 +15 -22
- 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/dependency-layer.js +3 -3
- 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 +11 -11
- package/dist/foundation/release/managed-path.d.ts +10 -0
- package/dist/foundation/release/managed-path.js +26 -0
- 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 +10 -12
- 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/restart-certification.js +3 -4
- package/dist/foundation/release/update-activation.js +3 -3
- package/dist/foundation/release/update-execution-lease.d.ts +2 -3
- package/dist/foundation/release/update-execution-lease.js +2 -8
- package/dist/foundation/release/update-installer.d.ts +45 -0
- package/dist/foundation/release/update-installer.js +57 -0
- package/dist/foundation/release/update-launch.d.ts +2 -2
- package/dist/foundation/release/update-recovery.js +2 -9
- package/dist/foundation/release/update.d.ts +4 -25
- package/dist/foundation/release/update.js +164 -183
- package/dist/foundation/startup/startup-budget.d.ts +5 -5
- package/dist/foundation/startup/startup-budget.js +2 -2
- package/dist/integrations/pi/components/bracketed-paste.d.ts +33 -0
- package/dist/integrations/pi/components/bracketed-paste.js +123 -0
- 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/owned-editor-ux.js +46 -140
- 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 +4 -13
- package/dist/integrations/pi/engine/adapter.js +9 -61
- 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 +3 -3
- 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-metadata.d.ts +49 -0
- package/dist/integrations/pi/engine/repository-metadata.js +189 -0
- 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 +7 -12
- package/dist/integrations/pi/engine/session-runtime.js +21 -178
- 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/view-state.d.ts +21 -2
- package/dist/integrations/pi/engine/view-state.js +129 -1
- package/dist/integrations/pi/engine/workflow-contexts.d.ts +1 -1
- package/dist/integrations/pi/engine/workflow-runner.d.ts +1 -2
- package/dist/integrations/pi/engine/workflow-runner.js +254 -365
- package/dist/integrations/pi/engine/workflow-share.d.ts +9 -0
- package/dist/integrations/pi/engine/workflow-share.js +168 -0
- package/dist/integrations/pi/engine/workflow-support.d.ts +0 -20
- package/dist/integrations/pi/engine/workflow-support.js +4 -65
- 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.d.ts +9 -19
- package/dist/integrations/pi/tui-runtime/adapter.js +56 -174
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +9 -44
- package/dist/integrations/pi/tui-runtime/index.d.ts +1 -1
- 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 +4 -10
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +3 -9
- package/dist/integrations/pi/tui-runtime/presentation-adapter.d.ts +2 -2
- 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/components/transcript-viewport-frame.d.ts +120 -0
- package/dist/ui/components/transcript-viewport-frame.js +314 -0
- package/dist/ui/components/transcript-viewport-types.d.ts +147 -0
- package/dist/ui/components/transcript-viewport-types.js +1 -0
- package/dist/ui/components/transcript-viewport.d.ts +2 -147
- package/dist/ui/components/transcript-viewport.js +87 -315
- 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/integrations/pi/engine/diagnostics-state.d.ts +0 -9
- package/dist/integrations/pi/engine/diagnostics-state.js +0 -34
- package/dist/integrations/pi/engine/usage-view.d.ts +0 -4
- package/dist/integrations/pi/engine/usage-view.js +0 -56
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +0 -166
- 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/{integrations/pi/tui-runtime/contracts.js → contracts/owned-ui/shell-components.js} +0 -0
- /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,15 +1,16 @@
|
|
|
1
|
+
import type { OwnedUiShellComponents, OwnedUiShellHotkeysPresentation } from "../../contracts/owned-ui/index.js";
|
|
1
2
|
import type { ImageAttachmentError, OwnedUiWorkflowMessage, OwnedUiWorkflowResult } from "../../contracts/owned-ui/index.js";
|
|
2
|
-
import { type PiShellHotkeysPresentation } from "../../integrations/pi/components/shell-presenters-info.js";
|
|
3
3
|
import type { DockChrome } from "./dock-chrome.js";
|
|
4
4
|
import type { TranscriptDocument } from "./transcript-document.js";
|
|
5
|
-
|
|
5
|
+
interface WorkflowOutputPorts {
|
|
6
6
|
readonly customViewport: boolean;
|
|
7
|
+
readonly components: Pick<OwnedUiShellComponents, "info" | "text">;
|
|
7
8
|
readonly document: Pick<TranscriptDocument, "lastId" | "anchorOf" | "invalidate" | "appendAnchored" | "removeAnchored">;
|
|
8
9
|
readonly dock: Pick<DockChrome, "setNotice" | "dismissNotice">;
|
|
9
10
|
/** How many semantic transcript blocks precede new output; workflow output anchors after them. */
|
|
10
11
|
transcriptLength(): number;
|
|
11
12
|
outputPad(): 0 | 1;
|
|
12
|
-
hotkeysPresentation():
|
|
13
|
+
hotkeysPresentation(): OwnedUiShellHotkeysPresentation;
|
|
13
14
|
readonly componentRuntime: {
|
|
14
15
|
getColumns(): number;
|
|
15
16
|
getRows(): number;
|
|
@@ -31,3 +32,4 @@ export declare class WorkflowOutput {
|
|
|
31
32
|
/** Drops every anchored output and the status-replacement chain. */
|
|
32
33
|
reset(): void;
|
|
33
34
|
}
|
|
35
|
+
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { createPiShellArmin, createPiShellEarendilAnnouncement, } from "../../integrations/pi/components/shell-selectors-dialogs.js";
|
|
2
|
-
import { createPiShellChangelog, createPiShellHotkeys, createPiShellSessionInfo, renderPiShellCommandMessage, renderPiShellStatusText, } from "../../integrations/pi/components/shell-presenters-info.js";
|
|
3
|
-
import { piShellHyperlink } from "../../integrations/pi/components/shell-shared-facade.js";
|
|
4
1
|
/**
|
|
5
2
|
* Presents workflow results: bare A1 answers in the dock notice, the pinned profile appends
|
|
6
3
|
* transcript-anchored output, and consecutive status lines at the same anchor replace each other.
|
|
@@ -33,7 +30,7 @@ export class WorkflowOutput {
|
|
|
33
30
|
}
|
|
34
31
|
const id = this.#appendAnchored(width => [
|
|
35
32
|
"",
|
|
36
|
-
...
|
|
33
|
+
...this.#ports.components.info.statusText(this.#statusMessages.get(id) ?? message, width),
|
|
37
34
|
]);
|
|
38
35
|
this.#statusMessages.set(id, message);
|
|
39
36
|
this.#lastStatusId = id;
|
|
@@ -53,7 +50,7 @@ export class WorkflowOutput {
|
|
|
53
50
|
}
|
|
54
51
|
this.#lastStatusId = undefined;
|
|
55
52
|
const presentation = { kind: message.kind, message: message.message };
|
|
56
|
-
this.#appendAnchored(width =>
|
|
53
|
+
this.#appendAnchored(width => this.#ports.components.info.commandMessage(presentation, width, this.#ports.outputPad()));
|
|
57
54
|
}
|
|
58
55
|
appendResult(result, errorCode) {
|
|
59
56
|
if (result.messages !== undefined) {
|
|
@@ -86,16 +83,17 @@ export class WorkflowOutput {
|
|
|
86
83
|
if (result.outcome === "completed" && (result.command === "new" || result.command === "name" || result.command === "debug")) {
|
|
87
84
|
this.#lastStatusId = undefined;
|
|
88
85
|
const presentation = { kind: result.command, message: result.message, ...(result.detail === undefined ? {} : { detail: result.detail }) };
|
|
89
|
-
this.#appendAnchored(width =>
|
|
86
|
+
this.#appendAnchored(width => this.#ports.components.info.commandMessage(presentation, width, this.#ports.outputPad()));
|
|
90
87
|
return;
|
|
91
88
|
}
|
|
92
89
|
if (result.outcome === "completed" && this.#appendAnnouncement(result.command))
|
|
93
90
|
return;
|
|
94
91
|
// Rationale: the pinned engine links both share URLs; the workflow result carries the plain URLs.
|
|
92
|
+
const link = (url) => this.#ports.components.text.hyperlink(url);
|
|
95
93
|
const message = result.command !== "share" ? result.message
|
|
96
|
-
: result.detail ? `${linkShareUrl(result.message)}\nGist: ${
|
|
94
|
+
: result.detail ? `${linkShareUrl(result.message, link)}\nGist: ${link(result.detail)}`
|
|
97
95
|
// Protocol: Radius shares carry only the artifact URL.
|
|
98
|
-
: linkShareUrl(result.message);
|
|
96
|
+
: linkShareUrl(result.message, link);
|
|
99
97
|
this.appendStatus(message);
|
|
100
98
|
}
|
|
101
99
|
/** Drops every anchored output and the status-replacement chain. */
|
|
@@ -108,20 +106,20 @@ export class WorkflowOutput {
|
|
|
108
106
|
#appendPresentation(result) {
|
|
109
107
|
if (result.command === "session" && result.presentation?.kind === "session-info") {
|
|
110
108
|
this.#lastStatusId = undefined;
|
|
111
|
-
const sessionInfo =
|
|
109
|
+
const sessionInfo = this.#ports.components.info.sessionInfo(result.presentation);
|
|
112
110
|
this.#appendAnchored(width => sessionInfo.render(width), () => sessionInfo.dispose?.());
|
|
113
111
|
return true;
|
|
114
112
|
}
|
|
115
113
|
if (result.command === "hotkeys") {
|
|
116
114
|
this.#lastStatusId = undefined;
|
|
117
115
|
const presentation = this.#ports.hotkeysPresentation();
|
|
118
|
-
const hotkeys =
|
|
116
|
+
const hotkeys = this.#ports.components.info.hotkeys(presentation.bindings, presentation.getShortcuts, presentation.profile);
|
|
119
117
|
this.#appendAnchored(width => hotkeys.render(width), () => hotkeys.dispose?.());
|
|
120
118
|
return true;
|
|
121
119
|
}
|
|
122
120
|
if (result.command === "changelog") {
|
|
123
121
|
this.#lastStatusId = undefined;
|
|
124
|
-
const changelog =
|
|
122
|
+
const changelog = this.#ports.components.info.changelog(result.detail ?? "No changelog entries found.");
|
|
125
123
|
this.#appendAnchored(width => changelog.render(width), () => changelog.dispose?.());
|
|
126
124
|
return true;
|
|
127
125
|
}
|
|
@@ -131,13 +129,13 @@ export class WorkflowOutput {
|
|
|
131
129
|
#appendAnnouncement(command) {
|
|
132
130
|
if (command === "arminsayshi") {
|
|
133
131
|
this.#lastStatusId = undefined;
|
|
134
|
-
const armin =
|
|
132
|
+
const armin = this.#ports.components.info.armin(this.#ports.componentRuntime);
|
|
135
133
|
this.#appendAnchored(width => ["", ...armin.render(width)], () => armin.dispose?.());
|
|
136
134
|
return true;
|
|
137
135
|
}
|
|
138
136
|
if (command === "dementedelves") {
|
|
139
137
|
this.#lastStatusId = undefined;
|
|
140
|
-
const announcement =
|
|
138
|
+
const announcement = this.#ports.components.info.earendilAnnouncement();
|
|
141
139
|
this.#appendAnchored(width => ["", ...announcement.render(width)], () => announcement.dispose?.());
|
|
142
140
|
return true;
|
|
143
141
|
}
|
|
@@ -168,7 +166,7 @@ export class WorkflowOutput {
|
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
168
|
/** "Share URL: <url>" with the URL made clickable; other share wordings pass through unchanged. */
|
|
171
|
-
function linkShareUrl(message) {
|
|
169
|
+
function linkShareUrl(message, link) {
|
|
172
170
|
const match = /^Share URL: (\S+)$/.exec(message);
|
|
173
|
-
return match === null ? message : `Share URL: ${
|
|
171
|
+
return match === null ? message : `Share URL: ${link(match[1])}`;
|
|
174
172
|
}
|
|
@@ -19,7 +19,6 @@ export type PackageSyntaxDiagnostic = {
|
|
|
19
19
|
readonly message: string;
|
|
20
20
|
};
|
|
21
21
|
type MessageStyle = Pick<typeof chalk, "red" | "dim" | "bold">;
|
|
22
|
-
export declare function packageCommandUsage(verb: PackageCliVerb, namespace?: PackageCommandNamespace): string;
|
|
23
22
|
/** Diagnostic facts stay unstyled until the terminal boundary decides color support. */
|
|
24
23
|
export declare function renderPackageSyntax(diagnostic: PackageSyntaxDiagnostic, namespace?: PackageCommandNamespace, style?: MessageStyle): string;
|
|
25
24
|
/** Pi's help layout, with unsupported options and examples deliberately absent. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// at 914cf1472e715297caa30db4b9535d534a9eb718 (MIT); grammar is restricted to A1's supported subset.
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
import { PRODUCT_TEXT } from "../product-identity.js";
|
|
5
|
-
|
|
5
|
+
function packageCommandUsage(verb, namespace = "pi") {
|
|
6
6
|
const command = namespace === "direct"
|
|
7
7
|
? `${PRODUCT_TEXT.commandName} ${verb}`
|
|
8
8
|
: `${PRODUCT_TEXT.commandName} pi ${verb}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type SessionContextRequest } from "../features/launch/index.js";
|
|
2
2
|
export type { SessionContextRequest } from "../features/launch/index.js";
|
|
3
|
-
|
|
3
|
+
interface SessionContextCommandOptions {
|
|
4
4
|
readonly environment?: NodeJS.ProcessEnv;
|
|
5
5
|
readonly inspectProcess?: (pid: number) => Promise<{
|
|
6
6
|
readonly pid: number;
|
package/dist/cli/uninstall.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
interface UninstallRequest {
|
|
2
2
|
/** Skips the program-removal question; user data is still kept unless `purge` is set. */
|
|
3
3
|
readonly yes: boolean;
|
|
4
4
|
/** Also removes sessions, settings, sign-ins, and prompt history. */
|
|
5
5
|
readonly purge: boolean;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
interface UninstallOutput {
|
|
8
8
|
readonly stdout: (message: string) => void;
|
|
9
9
|
readonly stderr: (message: string) => void;
|
|
10
10
|
}
|
|
@@ -24,3 +24,4 @@ export interface UninstallDependencies {
|
|
|
24
24
|
* Sessions and settings live in the profile home and leave only with explicit consent.
|
|
25
25
|
*/
|
|
26
26
|
export declare function runUninstall(request: UninstallRequest, dependencies: UninstallDependencies): Promise<number>;
|
|
27
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentSettingsPort } from "../contracts/agent-engine/index.js";
|
|
2
2
|
import { OwnedSettingsManager } from "../ui/settings/manager.js";
|
|
3
|
-
|
|
3
|
+
interface OwnedSettingsManagerFactoryOptions {
|
|
4
4
|
readonly profileId: string;
|
|
5
5
|
readonly agent?: AgentSettingsPort | null;
|
|
6
6
|
readonly agentProvider?: () => AgentSettingsPort | null;
|
|
@@ -9,3 +9,4 @@ export interface OwnedSettingsManagerFactoryOptions {
|
|
|
9
9
|
export declare function createOwnedSettingsManager(options: OwnedSettingsManagerFactoryOptions): OwnedSettingsManager;
|
|
10
10
|
/** Rereads the shared settings document whenever its stat changes; returns the stop. */
|
|
11
11
|
export declare function watchSharedSettings(settings: Pick<OwnedSettingsManager, "file" | "refresh">): () => void;
|
|
12
|
+
export {};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { statSync } from "node:fs";
|
|
2
2
|
import { resolveLaunchProfilePaths } from "../features/launch/profile-paths.js";
|
|
3
|
-
import { resolveProductPaths } from "../foundation/lifecycle/paths.js";
|
|
4
3
|
import { PRODUCT_IDENTITY } from "../product-identity.js";
|
|
5
4
|
import { OwnedSettingsManager } from "../ui/settings/manager.js";
|
|
6
5
|
/** Builds the profile-global settings manager shared by the Agent and slim utility compositions. */
|
|
7
6
|
export function createOwnedSettingsManager(options) {
|
|
8
7
|
const profilePaths = resolveLaunchProfilePaths();
|
|
9
|
-
const productPaths = resolveProductPaths();
|
|
10
8
|
return new OwnedSettingsManager({
|
|
11
9
|
profileDir: profilePaths.agentProfile,
|
|
12
10
|
profileId: options.profileId,
|
|
13
11
|
namespace: PRODUCT_IDENTITY.commandName,
|
|
14
|
-
legacyConfigDir: productPaths.configDir,
|
|
15
12
|
...(options.agent === undefined ? {} : { agent: options.agent }),
|
|
16
13
|
...(options.agentProvider === undefined ? {} : { agentProvider: options.agentProvider }),
|
|
17
14
|
hiddenAgentSettingIds: ["fullscreenWheelScrollLines"],
|
|
@@ -21,7 +21,7 @@ export interface OwnedUiCompositionOptions {
|
|
|
21
21
|
/** A1 settings profile; comparison paths omit it. */
|
|
22
22
|
readonly profileId?: string;
|
|
23
23
|
/** `off` withholds A1-specific surfaces from comparison profiles. */
|
|
24
|
-
readonly
|
|
24
|
+
readonly productMode?: "bare" | "comparison";
|
|
25
25
|
readonly projectTrustPrompt?: PiProjectTrustPreflightPrompt;
|
|
26
26
|
/** Explicit local diagnostic destination; ignored by comparison/settings-free compositions. */
|
|
27
27
|
readonly suggestionDiagnosticsPath?: string;
|
|
@@ -25,9 +25,9 @@ export async function composeOwnedUiApplication(options = {}) {
|
|
|
25
25
|
}
|
|
26
26
|
export async function composeOwnedUi(options = {}) {
|
|
27
27
|
const cwd = options.cwd ?? process.cwd();
|
|
28
|
-
const
|
|
28
|
+
const productMode = options.productMode ?? "bare", bare = productMode === "bare";
|
|
29
29
|
const sessionRuntimes = new SessionRuntimeRegistry({
|
|
30
|
-
runtimeId:
|
|
30
|
+
runtimeId: bare ? process.env[PRODUCT_IDENTITY.environment.sessionRuntimeId] : undefined,
|
|
31
31
|
inspectProcess: options.inspectProcess,
|
|
32
32
|
});
|
|
33
33
|
const productPaths = resolveProductPaths();
|
|
@@ -39,17 +39,19 @@ export async function composeOwnedUi(options = {}) {
|
|
|
39
39
|
profileId: options.profileId,
|
|
40
40
|
agentProvider: () => backend.settingsPort(),
|
|
41
41
|
});
|
|
42
|
+
// Invariant: bare A1 owns the settings-driven ports; the comparison profile receives none of them.
|
|
43
|
+
const bareSettings = bare ? settings : null;
|
|
42
44
|
const projectTrustPrompt = options.projectTrustPrompt;
|
|
43
45
|
// Invariant: process-wide engine state has one owner. The host installs the HTTP dispatcher, applies
|
|
44
46
|
// the theme singletons, and announces startup notices once; every session is created through it.
|
|
45
47
|
const host = await (options.createEngineHost ?? (async (hostOptions) => createPiEngineHost(hostOptions)))({
|
|
46
|
-
productMode
|
|
48
|
+
productMode,
|
|
47
49
|
availableThemes: () => getAvailablePiThemes().map(theme => theme.name),
|
|
48
|
-
announceStartupChangelog: !
|
|
50
|
+
announceStartupChangelog: !bare,
|
|
49
51
|
theme: {
|
|
50
|
-
base:
|
|
51
|
-
accentColor:
|
|
52
|
-
packageBorderProjection:
|
|
52
|
+
base: bare ? "dark" : "engine-configured",
|
|
53
|
+
accentColor: bareSettings?.value("accentColor") ?? "purple",
|
|
54
|
+
packageBorderProjection: bare,
|
|
53
55
|
apply: { base: applyConfiguredPiTheme, accentColor: setPiAccentColor, packageBorderProjection: setPiPackageBorderProjectionEnabled },
|
|
54
56
|
},
|
|
55
57
|
...(projectTrustPrompt === undefined ? {} : { projectTrustPrompt }),
|
|
@@ -58,7 +60,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
58
60
|
try {
|
|
59
61
|
backend = await host.create({
|
|
60
62
|
cwd,
|
|
61
|
-
...(
|
|
63
|
+
...(bare ? { repositoryContextReader: sessionRuntimes.readerFor(undefined) } : {}),
|
|
62
64
|
...(options.sessionPath === undefined ? {} : { sessionPath: options.sessionPath }),
|
|
63
65
|
...(options.sessionSelection === undefined ? {} : { sessionSelection: options.sessionSelection }),
|
|
64
66
|
...(sessionForkPrompt === undefined ? {} : { sessionForkPrompt }),
|
|
@@ -69,27 +71,26 @@ export async function composeOwnedUi(options = {}) {
|
|
|
69
71
|
throw error;
|
|
70
72
|
}
|
|
71
73
|
const releaseNote = await StartupReleaseNote.load({
|
|
72
|
-
|
|
74
|
+
productMode,
|
|
73
75
|
configDir: productPaths.configDir,
|
|
74
76
|
...(options.releaseNotes === undefined ? {} : { releaseNotes: options.releaseNotes }),
|
|
75
77
|
...(options.packageVersion === undefined ? {} : { packageVersion: options.packageVersion }),
|
|
76
78
|
...(options.profileId === undefined ? {} : { profileId: options.profileId }),
|
|
77
79
|
});
|
|
78
|
-
const unsubscribeAccentChange =
|
|
80
|
+
const unsubscribeAccentChange = bareSettings === null
|
|
79
81
|
? () => { }
|
|
80
|
-
:
|
|
82
|
+
: bareSettings.onChange(current => {
|
|
81
83
|
const accent = current.value("accentColor");
|
|
82
84
|
host.setAccentColor(accent);
|
|
83
85
|
});
|
|
84
86
|
// Rationale: separate A1 processes share one settings document; a live scope change saved in
|
|
85
87
|
// one reaches the others only by rereading that document.
|
|
86
|
-
const unwatchSharedSettings =
|
|
88
|
+
const unwatchSharedSettings = bareSettings === null
|
|
87
89
|
? () => { }
|
|
88
|
-
: watchSharedSettings(
|
|
90
|
+
: watchSharedSettings(bareSettings);
|
|
89
91
|
const unsubscribeAccent = () => { unwatchSharedSettings(); unsubscribeAccentChange(); };
|
|
90
92
|
// Invariant: the Settings search and agent prompt borrow the same resolved Pi keybindings.
|
|
91
|
-
const keybindingsHost = createPiKeybindingsHost({ profile:
|
|
92
|
-
const keybindings = keybindingsHost;
|
|
93
|
+
const keybindingsHost = createPiKeybindingsHost({ profile: bare ? "a1" : "pi", agentDir: backend.identity.agentDir });
|
|
93
94
|
// Rationale: Routes open only after shell construction.
|
|
94
95
|
const references = {
|
|
95
96
|
changelog: async (input) => {
|
|
@@ -105,41 +106,29 @@ export async function composeOwnedUi(options = {}) {
|
|
|
105
106
|
},
|
|
106
107
|
session: () => import("./session-info-reference.js").then(m => m.loadSessionInfoReference(backend)),
|
|
107
108
|
};
|
|
108
|
-
const routeHost =
|
|
109
|
-
: createOwnedRouteHost(
|
|
110
|
-
const viewportSettings = settings === null || !ownedSurfaces ? null : {
|
|
111
|
-
snapshot: () => viewportSettingsSnapshot(settings),
|
|
112
|
-
onChange: listener => settings.onChange(() => listener(viewportSettingsSnapshot(settings))),
|
|
113
|
-
};
|
|
114
|
-
const backgroundSettings = settings === null || !ownedSurfaces ? null : {
|
|
115
|
-
snapshot: () => settings.value("backgroundStyle"),
|
|
116
|
-
// Rationale: one manager notification also recomputes an accent-derived canvas after accentColor changes.
|
|
117
|
-
onChange: listener => settings.onChange(current => listener(current.value("backgroundStyle"))),
|
|
118
|
-
};
|
|
109
|
+
const routeHost = bareSettings === null ? null
|
|
110
|
+
: createOwnedRouteHost(bareSettings, references, settingsRouteOptions(keybindingsHost, backend.identity.agentDir, cwd));
|
|
119
111
|
const diagnosticDestination = options.suggestionDiagnosticsPath ?? process.env[PRODUCT_IDENTITY.environment.suggestionDiagnostics];
|
|
120
|
-
const suggestionDiagnostics =
|
|
112
|
+
const suggestionDiagnostics = bareSettings !== null && diagnosticDestination?.trim()
|
|
121
113
|
? await import("../features/prompt-suggestions/diagnostics.js").then(module => new module.SuggestionDiagnosticCapture({ enabled: true, destination: diagnosticDestination })) : null;
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
generator: backend,
|
|
125
|
-
enabled: () => settings.value("promptSuggestions"),
|
|
126
|
-
onChange: (listener) => settings.onChange(() => listener(settings.value("promptSuggestions"))),
|
|
127
|
-
};
|
|
128
|
-
const promptImages = settings === null || !ownedSurfaces ? null : {
|
|
129
|
-
limit: () => settings.value("promptImageLimit"),
|
|
130
|
-
onChange: (listener) => settings.onChange(listener),
|
|
131
|
-
};
|
|
132
|
-
const skills = settings === null || !ownedSurfaces ? null : {
|
|
133
|
-
presentation: () => settings.value("skillsPresentation"),
|
|
134
|
-
// Rationale: one listener covers both the A1 presentation choice and the engine skill-command toggle.
|
|
135
|
-
onChange: (listener) => settings.onChange(() => listener()),
|
|
136
|
-
};
|
|
137
|
-
const promptHistory = createPromptHistoryConfiguration(settings, backend, ownedSurfaces);
|
|
114
|
+
const barePorts = bareSettings === null ? null : bareShellPorts(bareSettings, backend, suggestionDiagnostics);
|
|
115
|
+
const promptHistory = createPromptHistoryConfiguration(settings, backend, bare);
|
|
138
116
|
const clipboardDestination = options.clipboardDiagnosticsPath ?? process.env[PRODUCT_IDENTITY.environment.clipboardDiagnostics];
|
|
139
|
-
const clipboardDiagnostics =
|
|
117
|
+
const clipboardDiagnostics = bareSettings !== null && clipboardDestination?.trim()
|
|
140
118
|
? new ClipboardDiagnosticCapture(clipboardDestination) : null;
|
|
141
119
|
// Invariant: process-wide services are created once here and borrowed by every session shell.
|
|
142
|
-
const clipboardServices =
|
|
120
|
+
const clipboardServices = bare ? createOwnedUiClipboardServices() : null;
|
|
121
|
+
// Invariant: one release order for a failed construction and for dispose. The shared spares outlive every
|
|
122
|
+
// shell and stop only after the last one is disposed; the host outlives the application and is released last.
|
|
123
|
+
const releaseShared = async () => {
|
|
124
|
+
clipboardServices?.dispose();
|
|
125
|
+
unsubscribeAccent();
|
|
126
|
+
await sessionRuntimes.dispose();
|
|
127
|
+
await releaseNote.releaseClaim();
|
|
128
|
+
suggestionDiagnostics?.dispose();
|
|
129
|
+
clipboardDiagnostics?.dispose();
|
|
130
|
+
await host.dispose();
|
|
131
|
+
};
|
|
143
132
|
let createdTerminalHost;
|
|
144
133
|
let terminalHost;
|
|
145
134
|
let presenter;
|
|
@@ -151,25 +140,19 @@ export async function composeOwnedUi(options = {}) {
|
|
|
151
140
|
cwd: backend.identity.cwd,
|
|
152
141
|
...(routeHost === null ? {} : { routeHost }),
|
|
153
142
|
...(releaseNote.startupRoute === undefined ? {} : { startupRoute: releaseNote.startupRoute }),
|
|
154
|
-
...(
|
|
143
|
+
...(bare ? { sessionLayout: "custom-viewport" } : {}),
|
|
155
144
|
},
|
|
156
145
|
presentation: {
|
|
157
146
|
...(options.terminal === undefined ? {} : { terminal: createPiTerminalBridge(options.terminal) }),
|
|
158
147
|
...(clipboardDiagnostics === null ? {} : { input: { onEvent: event => clipboardDiagnostics.runtime(event) } }),
|
|
159
|
-
...
|
|
160
|
-
...(backgroundSettings === null ? {} : { backgroundSettings }),
|
|
161
|
-
...(settings === null || !ownedSurfaces ? {} : {
|
|
162
|
-
quitOutro: { snapshot: () => quitOutroSettingsSnapshot(settings), interactive: process.stdout.isTTY === true },
|
|
163
|
-
}),
|
|
148
|
+
...barePorts?.presentation,
|
|
164
149
|
},
|
|
165
150
|
...(clipboardDiagnostics === null ? {} : { diagnostics: {
|
|
166
151
|
responseCopy: { onEvent: event => clipboardDiagnostics.copy(event) },
|
|
167
152
|
paste: event => clipboardDiagnostics.paste(event),
|
|
168
153
|
} }),
|
|
169
|
-
...(
|
|
170
|
-
...(
|
|
171
|
-
...(skills === null ? {} : { skills }),
|
|
172
|
-
shared: { keybindings, ...(clipboardServices === null ? {} : { clipboard: clipboardServices }) },
|
|
154
|
+
...(barePorts === null ? {} : { suggestions: barePorts.suggestions, promptImages: barePorts.promptImages, skills: barePorts.skills }),
|
|
155
|
+
shared: { keybindings: keybindingsHost, ...(clipboardServices === null ? {} : { clipboard: clipboardServices }) },
|
|
173
156
|
...(promptHistory === null ? {} : { history: {
|
|
174
157
|
...promptHistory,
|
|
175
158
|
editor: await import("../integrations/pi/components/history-editor-loader.js").then(module => module.loadHistoryEditor()),
|
|
@@ -183,12 +166,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
183
166
|
}
|
|
184
167
|
catch (error) {
|
|
185
168
|
await createdTerminalHost?.dispose().catch(() => undefined);
|
|
186
|
-
|
|
187
|
-
await releaseNote.releaseClaim();
|
|
188
|
-
clipboardDiagnostics?.dispose();
|
|
189
|
-
suggestionDiagnostics?.dispose();
|
|
190
|
-
clipboardServices?.dispose();
|
|
191
|
-
await host.dispose();
|
|
169
|
+
await releaseShared();
|
|
192
170
|
throw error;
|
|
193
171
|
}
|
|
194
172
|
// Rationale: pinned Pi's version check is unreachable because the owned shell never runs its
|
|
@@ -197,7 +175,7 @@ export async function composeOwnedUi(options = {}) {
|
|
|
197
175
|
const releaseUpdates = deferStartupReleaseUpdateObservation({
|
|
198
176
|
backend,
|
|
199
177
|
configDir: productPaths.configDir,
|
|
200
|
-
mode:
|
|
178
|
+
mode: bareSettings === null ? "auto" : bareSettings.value("updateCheck"),
|
|
201
179
|
packageVersion: releaseNote.packageVersion, readPackageVersion,
|
|
202
180
|
checkForNewerRelease: options.checkForNewerRelease,
|
|
203
181
|
});
|
|
@@ -226,24 +204,50 @@ export async function composeOwnedUi(options = {}) {
|
|
|
226
204
|
await releaseNote.settleAcknowledgement();
|
|
227
205
|
}
|
|
228
206
|
finally {
|
|
229
|
-
|
|
230
|
-
clipboardServices?.dispose();
|
|
231
|
-
unsubscribeAccent();
|
|
232
|
-
await sessionRuntimes.dispose();
|
|
233
|
-
await releaseNote.releaseClaim();
|
|
234
|
-
suggestionDiagnostics?.dispose();
|
|
235
|
-
clipboardDiagnostics?.dispose();
|
|
236
|
-
// Invariant: the host outlives the application; disposing it cancels host-level probes last.
|
|
237
|
-
await host.dispose();
|
|
207
|
+
await releaseShared();
|
|
238
208
|
}
|
|
239
209
|
},
|
|
240
210
|
};
|
|
241
211
|
return { application, settings };
|
|
242
212
|
}
|
|
243
|
-
|
|
213
|
+
/** The settings-driven ports only bare A1 receives: viewport, background, quit outro, suggestions, image limit, and skills. */
|
|
214
|
+
function bareShellPorts(settings, generator, diagnostics) {
|
|
215
|
+
const viewportSettings = {
|
|
216
|
+
snapshot: () => viewportSettingsSnapshot(settings),
|
|
217
|
+
onChange: listener => settings.onChange(() => listener(viewportSettingsSnapshot(settings))),
|
|
218
|
+
};
|
|
219
|
+
const backgroundSettings = {
|
|
220
|
+
snapshot: () => settings.value("backgroundStyle"),
|
|
221
|
+
// Rationale: one manager notification also recomputes an accent-derived canvas after accentColor changes.
|
|
222
|
+
onChange: listener => settings.onChange(current => listener(current.value("backgroundStyle"))),
|
|
223
|
+
};
|
|
224
|
+
return {
|
|
225
|
+
presentation: {
|
|
226
|
+
viewportSettings,
|
|
227
|
+
backgroundSettings,
|
|
228
|
+
quitOutro: { snapshot: () => quitOutroSettingsSnapshot(settings), interactive: process.stdout.isTTY === true },
|
|
229
|
+
},
|
|
230
|
+
suggestions: {
|
|
231
|
+
...(diagnostics === null || diagnostics === undefined ? {} : { diagnostics }),
|
|
232
|
+
generator,
|
|
233
|
+
enabled: () => settings.value("promptSuggestions"),
|
|
234
|
+
onChange: (listener) => settings.onChange(() => listener(settings.value("promptSuggestions"))),
|
|
235
|
+
},
|
|
236
|
+
promptImages: {
|
|
237
|
+
limit: () => settings.value("promptImageLimit"),
|
|
238
|
+
onChange: (listener) => settings.onChange(listener),
|
|
239
|
+
},
|
|
240
|
+
skills: {
|
|
241
|
+
presentation: () => settings.value("skillsPresentation"),
|
|
242
|
+
// Rationale: one listener covers both the A1 presentation choice and the engine skill-command toggle.
|
|
243
|
+
onChange: (listener) => settings.onChange(() => listener()),
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function createPromptHistoryConfiguration(settings, backend, bare) {
|
|
244
248
|
const limit = settings?.value("promptHistoryMaxItems") ?? 100;
|
|
245
249
|
const scope = settings?.value("promptHistoryScope") ?? "unique";
|
|
246
|
-
const enabled = settings !== null &&
|
|
250
|
+
const enabled = settings !== null && bare && settings.value("promptHistoryEnabled");
|
|
247
251
|
const sessionId = enabled ? backend.identity.currentHistorySessionId() : null;
|
|
248
252
|
if (settings === null || !enabled || (scope === "unique" && sessionId === null))
|
|
249
253
|
return null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ReferenceDocumentSelectionOptions } from "../features/owned-ui/reference-document-selection.js";
|
|
2
|
-
/** Builds the Changelog selection clipboard policy without loading Pi's engine
|
|
2
|
+
/** Builds the Changelog selection clipboard policy without loading Pi's engine. */
|
|
3
3
|
export declare function createReferenceSelectionOptions(settingsFile: string, copyText: ((text: string) => boolean | void) | undefined): ReferenceDocumentSelectionOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
|
-
/** Builds the Changelog selection clipboard policy without loading Pi's engine
|
|
2
|
+
/** Builds the Changelog selection clipboard policy without loading Pi's engine. */
|
|
3
3
|
export function createReferenceSelectionOptions(settingsFile, copyText) {
|
|
4
4
|
return {
|
|
5
5
|
copyOnSelect: () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ProcessIdentity } from "../foundation/lifecycle/model.js";
|
|
2
|
-
|
|
2
|
+
interface SessionRuntimeRegistryOptions {
|
|
3
3
|
/** Absent outside claim-owning runtimes. */
|
|
4
4
|
readonly runtimeId: string | undefined;
|
|
5
5
|
/** Process liveness inspection; absent SDK seams cannot claim. */
|
|
@@ -15,3 +15,4 @@ export declare class SessionRuntimeRegistry {
|
|
|
15
15
|
/** Drain publication before releasing claims; never republish after disposal. */
|
|
16
16
|
dispose(): Promise<void>;
|
|
17
17
|
}
|
|
18
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CHANGELOG_ROUTE, HOTKEYS_ROUTE, HOTKEYS_TITLE } from "../features/owned-ui/reference-routes.js";
|
|
2
2
|
import { SETTINGS_APP_ID, SETTINGS_ROUTE } from "../features/owned-ui/settings-route.js";
|
|
3
|
-
import { piTheme
|
|
3
|
+
import { piTheme } from "../integrations/pi/components/upstream/theme/theme.js";
|
|
4
|
+
import { piUiTheme } from "../integrations/pi/components/theme.js";
|
|
4
5
|
import { faint } from "../ui/components/text.js";
|
|
5
6
|
/** Declares settings and lazy document routes. */
|
|
6
7
|
export function createOwnedRouteHost(settings, references, options = {}) {
|
|
@@ -145,13 +146,5 @@ async function hostApp(id, route, create, closeOnInterrupt = true, appInputBefor
|
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
148
|
function pinnedTheme(panel) {
|
|
148
|
-
return {
|
|
149
|
-
fg: (token, text) => piTheme().fg(token, text),
|
|
150
|
-
bold: (text) => piTheme().bold(text),
|
|
151
|
-
plain: (text) => text,
|
|
152
|
-
accentPreview: (color, text) => renderPiAccentPreview(color, text),
|
|
153
|
-
disabled: (text) => faint(piTheme().fg("dim", text)),
|
|
154
|
-
highlight: (text) => piTheme().bg("selectedBg", text),
|
|
155
|
-
panel,
|
|
156
|
-
};
|
|
149
|
+
return piUiTheme({ panel, disabled: text => faint(piTheme().fg("dim", text)) });
|
|
157
150
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { SettingsSearchInputFactory } from "../features/owned-ui/settings-search-input.js";
|
|
2
2
|
import { type PiKeybindingsHost } from "../integrations/pi/components/shell-shared-facade.js";
|
|
3
|
-
|
|
3
|
+
interface SettingsSearchInputFactoryOptions {
|
|
4
4
|
readonly keybindings?: PiKeybindingsHost;
|
|
5
5
|
readonly agentDir?: string;
|
|
6
6
|
readonly cwd?: string;
|
|
7
7
|
}
|
|
8
8
|
/** Builds Settings search from the same configurable owned editor used by the agent prompt. */
|
|
9
9
|
export declare function createSettingsSearchInputFactory(options?: SettingsSearchInputFactoryOptions): SettingsSearchInputFactory;
|
|
10
|
+
export {};
|
|
@@ -2,8 +2,8 @@ import type { OwnedUiShellEngineOptions } from "../app/session-shell/index.js";
|
|
|
2
2
|
import type { ReleaseNoteCatalog } from "../features/owned-ui/release-notes.js";
|
|
3
3
|
import type { StartupReleaseUpdateObservationOptions } from "./release-update-observation.js";
|
|
4
4
|
type StartupRoute = NonNullable<OwnedUiShellEngineOptions["startupRoute"]>;
|
|
5
|
-
|
|
6
|
-
readonly
|
|
5
|
+
interface StartupReleaseNoteOptions {
|
|
6
|
+
readonly productMode: "bare" | "comparison";
|
|
7
7
|
/** Deterministic catalog and version seams for composition tests. */
|
|
8
8
|
readonly releaseNotes?: ReleaseNoteCatalog;
|
|
9
9
|
readonly packageVersion?: string;
|
|
@@ -40,7 +40,7 @@ export class StartupReleaseNote {
|
|
|
40
40
|
static async load(options) {
|
|
41
41
|
let catalog = null;
|
|
42
42
|
let failure;
|
|
43
|
-
if (options.
|
|
43
|
+
if (options.productMode === "bare") {
|
|
44
44
|
try {
|
|
45
45
|
catalog = options.releaseNotes
|
|
46
46
|
?? await import("../features/owned-ui/release-notes.js").then(module => module.readPackagedReleaseNotes());
|
|
@@ -49,7 +49,7 @@ export class StartupReleaseNote {
|
|
|
49
49
|
failure = error;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const packageVersion = options.
|
|
52
|
+
const packageVersion = options.productMode === "bare" ? options.packageVersion ?? await readPackageVersion() : null;
|
|
53
53
|
const current = packageVersion === null ? null : catalog?.current(packageVersion) ?? null;
|
|
54
54
|
const profileId = options.profileId;
|
|
55
55
|
const claim = current === null || profileId === undefined
|
|
@@ -183,7 +183,7 @@ export interface OwnedUiExtensionOverlayHandle {
|
|
|
183
183
|
/** The most recently rendered terminal-relative rectangle of a visible overlay. */
|
|
184
184
|
getBounds(): OwnedUiExtensionOverlayBounds | undefined;
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
interface OwnedUiExtensionOverlayBounds {
|
|
187
187
|
readonly row: number;
|
|
188
188
|
readonly col: number;
|
|
189
189
|
readonly width: number;
|
|
@@ -308,3 +308,4 @@ export interface OwnedUiExtensionRendererPort {
|
|
|
308
308
|
}, theme: OwnedUiExtensionThemePort, context: OwnedUiExtensionToolRenderContext): OwnedUiExtensionComponent;
|
|
309
309
|
}
|
|
310
310
|
export declare function assertOwnedUiExtensionUiPort(value: unknown): asserts value is OwnedUiExtensionUiPort;
|
|
311
|
+
export {};
|
|
@@ -17,4 +17,5 @@ export { SUGGESTION_ATTEMPT_TRIGGERS, SUGGESTION_DECISION_REASONS, SUGGESTION_DI
|
|
|
17
17
|
export type { SuggestionAttemptTrigger, SuggestionDecision, SuggestionDecisionReason, SuggestionDiagnosticEvent, SuggestionDiagnosticObserver, SuggestionDiagnosticRecord, } from "./suggestion-diagnostics.js";
|
|
18
18
|
export { PROMPT_HISTORY_EDITOR_REPLACEMENT, PROMPT_HISTORY_MAX_ENTRY_BYTES, PROMPT_HISTORY_MAX_PENDING, PROMPT_HISTORY_MAX_TEXT_BYTES, assertPromptHistorySubmission, } from "./prompt-history.js";
|
|
19
19
|
export type { PromptHistoryFailure, PromptHistoryImageSidecarAttachment, PromptHistoryImageSidecarPort, PromptHistoryImageSidecarRecord, PromptHistoryKind, PromptHistoryPort, PromptHistoryResult, PromptHistorySnapshot, PromptHistorySubmission, } from "./prompt-history.js";
|
|
20
|
-
export { assertOwnedUiCommand,
|
|
20
|
+
export { assertOwnedUiCommand, assertOwnedUiPromptSuggestionRequest, assertOwnedUiPromptSuggestionResult, assertOwnedUiSnapshot, } from "./validation.js";
|
|
21
|
+
export type { OwnedUiShellAuthProviderOption, OwnedUiShellAutocompleteCommand, OwnedUiShellClipboardContent, OwnedUiShellCommandMessage, OwnedUiShellComponentPort, OwnedUiShellComponents, OwnedUiShellEditorBodyGeometry, OwnedUiShellEditorOptions, OwnedUiShellEditorPointerEvent, OwnedUiShellEditorPort, OwnedUiShellEditorRecall, OwnedUiShellEditorTextRange, OwnedUiShellExtensionRendererResolver, OwnedUiShellExtensionUiBridge, OwnedUiShellExtensionUiBridgeHost, OwnedUiShellHeaderOptions, OwnedUiShellHeaderPort, OwnedUiShellHistoryEditor, OwnedUiShellHotkeysPresentation, OwnedUiShellImageAssetResolver, OwnedUiShellKeybindings, OwnedUiShellKeybindingsHost, OwnedUiShellLazySelectorLoader, OwnedUiShellLoadedResourcesPort, OwnedUiShellLoginDialogPort, OwnedUiShellMermaidRenderingMode, OwnedUiShellOperationLoaderPort, OwnedUiShellPasteReservation, OwnedUiShellProgramStatus, OwnedUiShellProgramStatusBlocked, OwnedUiShellProgramStatusReporter, OwnedUiShellProgressPresentationMode, OwnedUiShellProgressStatusPresentation, OwnedUiShellPromptInputBody, OwnedUiShellPromptInputGeometry, OwnedUiShellPromptInputPresentation, OwnedUiShellQueuedInputPort, OwnedUiShellReleaseUpdate, OwnedUiShellReleaseUpdateBanner, OwnedUiShellResourceEntry, OwnedUiShellResourceSection, OwnedUiShellRuntime, OwnedUiShellSelectorOption, OwnedUiShellSelectorOptions, OwnedUiShellSkillSummary, OwnedUiShellStartupNotice, OwnedUiShellStatusPlacement, OwnedUiShellStatusPort, OwnedUiShellSubmittedPromptComposer, OwnedUiShellThinkingLevel, OwnedUiShellThinkingSelectorOptions, OwnedUiShellTranscriptComponentPort, OwnedUiShellTreeFilterMode, OwnedUiShellTreeSelectorOptions, OwnedUiShellTrustDecision, OwnedUiShellTrustOption, OwnedUiShellTrustSelectorOptions, OwnedUiShellTrustUpdate, OwnedUiShellViewComponentPort, } from "./shell-components.js";
|
|
@@ -7,4 +7,4 @@ export { CONTEXTUAL_PROMPT_SUGGESTION_INSTRUCTION, normalizePromptSuggestionCand
|
|
|
7
7
|
export { canonicalPromptChipMatches, protectPromptChipWrapping, replaceCanonicalPromptChips } from "./prompt-chips.js";
|
|
8
8
|
export { SUGGESTION_ATTEMPT_TRIGGERS, SUGGESTION_DECISION_REASONS, SUGGESTION_DIAGNOSTIC_EVENTS } from "./suggestion-diagnostics.js";
|
|
9
9
|
export { PROMPT_HISTORY_EDITOR_REPLACEMENT, PROMPT_HISTORY_MAX_ENTRY_BYTES, PROMPT_HISTORY_MAX_PENDING, PROMPT_HISTORY_MAX_TEXT_BYTES, assertPromptHistorySubmission, } from "./prompt-history.js";
|
|
10
|
-
export { assertOwnedUiCommand,
|
|
10
|
+
export { assertOwnedUiCommand, assertOwnedUiPromptSuggestionRequest, assertOwnedUiPromptSuggestionResult, assertOwnedUiSnapshot, } from "./validation.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { OwnedUiShellComponents } from "./shell-components.js";
|
|
1
2
|
/**
|
|
2
3
|
* Presenters for the selectors and transcript renderers whose inputs are engine objects. The shell opens them
|
|
3
4
|
* through this port and never holds those objects; the Pi session presenters owner implements it.
|
|
@@ -71,6 +72,8 @@ export interface OwnedUiTranscriptRendererPort {
|
|
|
71
72
|
getShortcuts(bindings: Readonly<Record<string, string | readonly string[] | undefined>>): readonly OwnedUiShortcutDescription[];
|
|
72
73
|
}
|
|
73
74
|
export interface OwnedUiSessionPresenters {
|
|
75
|
+
/** The vendor components and text helpers the shell renders with. */
|
|
76
|
+
readonly components: OwnedUiShellComponents;
|
|
74
77
|
transcriptRenderers(): OwnedUiTranscriptRendererPort;
|
|
75
78
|
openModelSelector(host: OwnedUiDialogHost, initialSearchInput?: string): void;
|
|
76
79
|
openSessionSelector(host: OwnedUiDialogHost, onExit: () => void): Promise<void>;
|