@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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { OwnedUiCommandResult, OwnedUiSessionBackend, OwnedUiShellSkillSummary, OwnedUiWorkflowRequest } from "../../contracts/owned-ui/index.js";
|
|
2
|
+
import type { SessionDialogCoordinator } from "./dialog-coordinator.js";
|
|
3
|
+
import type { OwnedUiPresenterTerminal } from "./shell-host.js";
|
|
4
|
+
import type { OwnedUiSessionShellOptions, OwnedUiSessionShellRoot } from "./session-shell-root.js";
|
|
5
|
+
import type { WorkflowSelectors } from "./workflow-router.js";
|
|
6
|
+
/** What the selectors need from the session; typed ports, never the presenter. */
|
|
7
|
+
export interface SessionSelectorPorts {
|
|
8
|
+
readonly root: Pick<OwnedUiSessionShellRoot, "setInputSurface" | "setFooterLevel" | "workflow" | "editor">;
|
|
9
|
+
readonly terminal: OwnedUiPresenterTerminal;
|
|
10
|
+
readonly dialogs: SessionDialogCoordinator;
|
|
11
|
+
readonly presenters: OwnedUiSessionShellOptions["presenters"];
|
|
12
|
+
readonly backend: Pick<OwnedUiSessionBackend, "catalog" | "settings">;
|
|
13
|
+
readonly customViewport: boolean;
|
|
14
|
+
disposed(): boolean;
|
|
15
|
+
runWorkflow(request: OwnedUiWorkflowRequest): Promise<OwnedUiCommandResult>;
|
|
16
|
+
sendSlashPrompt(text: string, typed: string): Promise<OwnedUiCommandResult>;
|
|
17
|
+
reportError(): void;
|
|
18
|
+
input(title: string, placeholder: string, options?: {
|
|
19
|
+
readonly retainSurfaceOnSettle?: boolean;
|
|
20
|
+
}): Promise<string | undefined>;
|
|
21
|
+
shutdown(): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Opens the session's selectors and dialogs in the input dock and runs each choice as a workflow.
|
|
25
|
+
* Invariant: the workflow router reaches dialogs only through this collaborator, never through the presenter.
|
|
26
|
+
*/
|
|
27
|
+
export declare class SessionSelectors implements WorkflowSelectors {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(ports: SessionSelectorPorts);
|
|
30
|
+
showThinkingSelector(): Promise<void>;
|
|
31
|
+
/** The Skills dialog: a replacement input like the model selector, applying the chosen skill through the prompt path. */
|
|
32
|
+
showSkillsSelector(skills: readonly OwnedUiShellSkillSummary[]): void;
|
|
33
|
+
showModelSelector(initialSearchInput?: string): void;
|
|
34
|
+
showForkSelector(): void;
|
|
35
|
+
showLogoutSelector(): Promise<void>;
|
|
36
|
+
showLoginMethodSelector(providerReference: string): void;
|
|
37
|
+
showTreeSelector(initialSelectedId?: string): Promise<void>;
|
|
38
|
+
showLoginAuthTypeSelector(): void;
|
|
39
|
+
showLoginProviderSelector(authType?: "oauth" | "api_key", initialSearchInput?: string): void;
|
|
40
|
+
showSessionSelector(): Promise<void>;
|
|
41
|
+
showSettingsSelector(): void;
|
|
42
|
+
showTrustSelector(): void;
|
|
43
|
+
showScopedModelsSelector(): void;
|
|
44
|
+
/** The bare-A1 unified Models dialog: switch on Enter, scope on Space, persist on Ctrl+S, all through the engine. */
|
|
45
|
+
showModelsDialog(initialQuery?: string): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opens the session's selectors and dialogs in the input dock and runs each choice as a workflow.
|
|
3
|
+
* Invariant: the workflow router reaches dialogs only through this collaborator, never through the presenter.
|
|
4
|
+
*/
|
|
5
|
+
export class SessionSelectors {
|
|
6
|
+
#ports;
|
|
7
|
+
#root;
|
|
8
|
+
#terminal;
|
|
9
|
+
#dialogs;
|
|
10
|
+
#presenters;
|
|
11
|
+
#backend;
|
|
12
|
+
#customViewport;
|
|
13
|
+
// Invariant: the host's optional members follow the layout, so it is built only once the layout is known.
|
|
14
|
+
#dialogHost;
|
|
15
|
+
constructor(ports) {
|
|
16
|
+
this.#ports = ports;
|
|
17
|
+
this.#root = ports.root;
|
|
18
|
+
this.#terminal = ports.terminal;
|
|
19
|
+
this.#dialogs = ports.dialogs;
|
|
20
|
+
this.#presenters = ports.presenters;
|
|
21
|
+
this.#backend = ports.backend;
|
|
22
|
+
this.#customViewport = ports.customViewport;
|
|
23
|
+
this.#dialogHost = this.#createDialogHost();
|
|
24
|
+
}
|
|
25
|
+
// Rationale: presenters see the shell only as a dialog host; selectors open in the input dock and run choices as workflows.
|
|
26
|
+
#createDialogHost() {
|
|
27
|
+
const isDisposed = () => this.#ports.disposed();
|
|
28
|
+
return {
|
|
29
|
+
get disposed() { return isDisposed(); },
|
|
30
|
+
setInputSurface: surface => this.#root.setInputSurface(surface),
|
|
31
|
+
requestRender: () => this.#terminal.requestRender(),
|
|
32
|
+
viewport: () => this.#terminal.viewport(),
|
|
33
|
+
appendWorkflowStatus: text => this.#root.workflow.appendStatus(text),
|
|
34
|
+
appendWorkflowResult: result => this.#root.workflow.appendResult(result),
|
|
35
|
+
runWorkflow: request => this.#ports.runWorkflow(request),
|
|
36
|
+
// Invariant: the custom bare-A1 surface holds frames while optional selectors load and is permanently
|
|
37
|
+
// fullscreen; the pinned comparison profiles render immediately and keep Pi's TUI mode switch.
|
|
38
|
+
...(this.#customViewport
|
|
39
|
+
? { beginPresentationHold: () => this.#terminal.beginPresentationHold() }
|
|
40
|
+
: { switchTuiMode: mode => this.#terminal.switchMode(mode) }),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async showThinkingSelector() {
|
|
44
|
+
const snapshot = this.#backend.settings.snapshot();
|
|
45
|
+
const close = () => {
|
|
46
|
+
this.#root.setFooterLevel(true);
|
|
47
|
+
this.#root.setInputSurface(null);
|
|
48
|
+
this.#terminal.requestRender();
|
|
49
|
+
};
|
|
50
|
+
const select = (level) => {
|
|
51
|
+
close();
|
|
52
|
+
void this.#ports.runWorkflow({ command: "thinking", argument: "", selection: level });
|
|
53
|
+
};
|
|
54
|
+
const releasePresentation = this.#customViewport ? this.#terminal.beginPresentationHold() : undefined;
|
|
55
|
+
try {
|
|
56
|
+
const selectors = await this.#presenters.components.dialogs.lazySelectors();
|
|
57
|
+
const component = await selectors.createThinking({
|
|
58
|
+
currentLevel: snapshot.thinkingLevel,
|
|
59
|
+
availableLevels: snapshot.availableThinkingLevels,
|
|
60
|
+
onSelect: select,
|
|
61
|
+
onCancel: close,
|
|
62
|
+
onSelectAsDefault: level => this.#backend.settings.setDefaultThinkingLevel(level),
|
|
63
|
+
defaultLevel: snapshot.defaultThinkingLevel,
|
|
64
|
+
...(this.#backend.settings.productMode === "bare" ? {
|
|
65
|
+
presentation: {
|
|
66
|
+
profile: "bare",
|
|
67
|
+
cycleBinding: this.#root.editor.keybindingConfig()["app.thinking.cycle"] ?? [],
|
|
68
|
+
},
|
|
69
|
+
} : {}),
|
|
70
|
+
});
|
|
71
|
+
if (this.#ports.disposed())
|
|
72
|
+
return;
|
|
73
|
+
this.#root.setFooterLevel(false);
|
|
74
|
+
this.#present(component);
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
releasePresentation?.();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** The Skills dialog: a replacement input like the model selector, applying the chosen skill through the prompt path. */
|
|
81
|
+
showSkillsSelector(skills) {
|
|
82
|
+
const close = this.#dialogs.closeInputSurface;
|
|
83
|
+
const component = this.#presenters.components.dialogs.skillsSelector({
|
|
84
|
+
skills,
|
|
85
|
+
onSelect: name => {
|
|
86
|
+
close();
|
|
87
|
+
void this.#ports.sendSlashPrompt(this.#presenters.components.skills.prompt(name), this.#presenters.components.skills.prompt(name)).catch(() => this.#ports.reportError());
|
|
88
|
+
},
|
|
89
|
+
onCancel: close,
|
|
90
|
+
});
|
|
91
|
+
this.#present(component);
|
|
92
|
+
}
|
|
93
|
+
showModelSelector(initialSearchInput) {
|
|
94
|
+
this.#presenters.openModelSelector(this.#dialogHost, initialSearchInput);
|
|
95
|
+
}
|
|
96
|
+
showForkSelector() {
|
|
97
|
+
const options = this.#backend.catalog.pinnedForkOptions();
|
|
98
|
+
if (options.length === 0) {
|
|
99
|
+
this.#root.workflow.appendResult({ command: "fork", outcome: "completed", message: "No messages to fork from", messageKind: "status" });
|
|
100
|
+
this.#terminal.requestRender();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const close = this.#dialogs.closeInputSurface;
|
|
104
|
+
const component = this.#presenters.components.dialogs.userMessageSelector(options, selection => {
|
|
105
|
+
close();
|
|
106
|
+
void this.#ports.runWorkflow({ command: "fork", argument: "", selection });
|
|
107
|
+
}, close);
|
|
108
|
+
this.#present(component);
|
|
109
|
+
}
|
|
110
|
+
async showLogoutSelector() {
|
|
111
|
+
let options;
|
|
112
|
+
try {
|
|
113
|
+
options = await this.#backend.catalog.pinnedLogoutOptions();
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
this.#root.workflow.appendResult({
|
|
117
|
+
command: "logout",
|
|
118
|
+
outcome: "failed",
|
|
119
|
+
message: `Could not read stored credentials: ${error instanceof Error ? error.message : String(error)}`,
|
|
120
|
+
});
|
|
121
|
+
this.#terminal.requestRender();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (options.length === 0) {
|
|
125
|
+
this.#root.workflow.appendStatus("No stored credentials to remove. /logout only removes credentials saved by /login; environment variables and models.json config are unchanged.");
|
|
126
|
+
this.#terminal.requestRender();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const close = this.#dialogs.closeInputSurface;
|
|
130
|
+
const component = this.#presenters.components.dialogs.authProviderSelector("logout", options, selection => {
|
|
131
|
+
close();
|
|
132
|
+
void this.#ports.runWorkflow({ command: "logout", argument: "", selection });
|
|
133
|
+
}, close);
|
|
134
|
+
this.#present(component);
|
|
135
|
+
}
|
|
136
|
+
showLoginMethodSelector(providerReference) {
|
|
137
|
+
const method = this.#backend.catalog.pinnedLoginMethodOptions(providerReference);
|
|
138
|
+
if (method.options.length === 0) {
|
|
139
|
+
this.showLoginProviderSelector(undefined, providerReference);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (method.options.length === 1) {
|
|
143
|
+
const selection = method.options[0]?.id;
|
|
144
|
+
if (selection)
|
|
145
|
+
void this.#ports.runWorkflow({ command: "login", argument: "", selection });
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const close = this.#dialogs.closeInputSurface;
|
|
149
|
+
const labels = method.options.map(option => option.label);
|
|
150
|
+
const component = this.#presenters.components.dialogs.extensionSelector(method.title, labels, label => {
|
|
151
|
+
const selection = method.options.find(option => option.label === label)?.id;
|
|
152
|
+
if (!selection)
|
|
153
|
+
return;
|
|
154
|
+
close();
|
|
155
|
+
void this.#ports.runWorkflow({ command: "login", argument: "", selection });
|
|
156
|
+
}, close);
|
|
157
|
+
this.#present(component);
|
|
158
|
+
}
|
|
159
|
+
showTreeSelector(initialSelectedId) {
|
|
160
|
+
return this.#presenters.openTreeSelector(this.#dialogHost, (entryId, skipSummaryPrompt) => {
|
|
161
|
+
void this.#completeTreeSelection(entryId, skipSummaryPrompt);
|
|
162
|
+
}, initialSelectedId);
|
|
163
|
+
}
|
|
164
|
+
showLoginAuthTypeSelector() {
|
|
165
|
+
const close = this.#dialogs.closeInputSurface;
|
|
166
|
+
const labels = ["Sign in with an account", "Sign in with an API key"];
|
|
167
|
+
const component = this.#presenters.components.dialogs.extensionSelector("Select authentication method:", labels, label => {
|
|
168
|
+
close();
|
|
169
|
+
this.showLoginProviderSelector(label === labels[0] ? "oauth" : "api_key");
|
|
170
|
+
}, close);
|
|
171
|
+
this.#present(component);
|
|
172
|
+
}
|
|
173
|
+
showLoginProviderSelector(authType, initialSearchInput) {
|
|
174
|
+
const options = this.#backend.catalog.pinnedLoginOptions(authType);
|
|
175
|
+
if (options.length === 0) {
|
|
176
|
+
this.#root.workflow.appendStatus(authType === "oauth" ? "No account providers available." : authType === "api_key" ? "No API key providers available." : "No login providers available.");
|
|
177
|
+
this.#terminal.requestRender();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const close = this.#dialogs.closeInputSurface;
|
|
181
|
+
const component = this.#presenters.components.dialogs.authProviderSelector("login", options, id => {
|
|
182
|
+
close();
|
|
183
|
+
void this.#ports.runWorkflow({ command: "login", argument: "", selection: id });
|
|
184
|
+
}, () => {
|
|
185
|
+
close();
|
|
186
|
+
if (authType !== undefined)
|
|
187
|
+
this.showLoginAuthTypeSelector();
|
|
188
|
+
}, initialSearchInput);
|
|
189
|
+
this.#present(component);
|
|
190
|
+
}
|
|
191
|
+
showSessionSelector() {
|
|
192
|
+
return this.#presenters.openSessionSelector(this.#dialogHost, () => { void this.#ports.shutdown(); });
|
|
193
|
+
}
|
|
194
|
+
showSettingsSelector() {
|
|
195
|
+
this.#presenters.openSettingsSelector(this.#dialogHost);
|
|
196
|
+
}
|
|
197
|
+
showTrustSelector() {
|
|
198
|
+
const context = this.#backend.catalog.pinnedProjectTrustContext();
|
|
199
|
+
const close = this.#dialogs.closeInputSurface;
|
|
200
|
+
const component = this.#presenters.components.dialogs.trustSelector({
|
|
201
|
+
...context,
|
|
202
|
+
onSelect: selection => {
|
|
203
|
+
try {
|
|
204
|
+
this.#backend.catalog.persistProjectTrust(selection.updates);
|
|
205
|
+
close();
|
|
206
|
+
this.#root.workflow.appendStatus(`Saved trust decision: ${selection.trusted ? "trusted" : "untrusted"}. Restart pi for this to take effect.`);
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
close();
|
|
210
|
+
this.#root.workflow.appendResult({ command: "trust", outcome: "failed", message: error instanceof Error ? error.message : String(error) });
|
|
211
|
+
}
|
|
212
|
+
this.#terminal.requestRender();
|
|
213
|
+
},
|
|
214
|
+
onCancel: close,
|
|
215
|
+
});
|
|
216
|
+
this.#present(component);
|
|
217
|
+
}
|
|
218
|
+
showScopedModelsSelector() {
|
|
219
|
+
this.#presenters.openScopedModelsSelector(this.#dialogHost);
|
|
220
|
+
}
|
|
221
|
+
/** The bare-A1 unified Models dialog: switch on Enter, scope on Space, persist on Ctrl+S, all through the engine. */
|
|
222
|
+
showModelsDialog(initialQuery) {
|
|
223
|
+
this.#presenters.openModelsDialog(this.#dialogHost, initialQuery);
|
|
224
|
+
}
|
|
225
|
+
#treeSummary() {
|
|
226
|
+
return new Promise(resolve => {
|
|
227
|
+
this.#root.setInputSurface(this.#presenters.components.dialogs.extensionSelector("Summarize Branch?", ["No summary", "Summarize", "Summarize with custom prompt"], resolve, () => resolve(undefined)), true, "opaque");
|
|
228
|
+
this.#terminal.requestRender();
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
async #completeTreeSelection(entryId, skipSummaryPrompt) {
|
|
232
|
+
let summarize = false;
|
|
233
|
+
let customInstructions;
|
|
234
|
+
if (!skipSummaryPrompt) {
|
|
235
|
+
while (true) {
|
|
236
|
+
const choice = await this.#treeSummary();
|
|
237
|
+
if (choice === undefined) {
|
|
238
|
+
await this.showTreeSelector(entryId);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
summarize = choice !== "No summary";
|
|
242
|
+
if (choice === "Summarize with custom prompt") {
|
|
243
|
+
customInstructions = await this.#ports.input("Custom Summarization Instructions", "", { retainSurfaceOnSettle: true });
|
|
244
|
+
if (customInstructions === undefined)
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.#root.setInputSurface(null);
|
|
251
|
+
this.#terminal.requestRender();
|
|
252
|
+
const result = await this.#ports.runWorkflow({
|
|
253
|
+
command: "tree",
|
|
254
|
+
argument: "",
|
|
255
|
+
selection: entryId,
|
|
256
|
+
treeSummary: {
|
|
257
|
+
summarize,
|
|
258
|
+
...(customInstructions === undefined ? {} : { customInstructions }),
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
if (result.diagnostic === "Branch summarization cancelled")
|
|
262
|
+
await this.showTreeSelector(entryId);
|
|
263
|
+
}
|
|
264
|
+
// Invariant: a selector replaces the editor in the input dock and paints in the same frame.
|
|
265
|
+
#present(component) {
|
|
266
|
+
this.#root.setInputSurface(component);
|
|
267
|
+
this.#terminal.requestRender();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { OwnedUiShellComponents, OwnedUiShellHotkeysPresentation, OwnedUiShellClipboardContent, OwnedUiShellComponentPort, OwnedUiShellEditorPort, OwnedUiShellHeaderOptions, OwnedUiShellHeaderPort, OwnedUiShellHistoryEditor, OwnedUiShellImageAssetResolver, OwnedUiShellKeybindingsHost, OwnedUiShellLoadedResourcesPort } from "../../contracts/owned-ui/index.js";
|
|
2
|
+
import type { TerminalComponentPort, TerminalInputCoordinationScheduler, TerminalInputDiagnosticsEvent, TerminalInputSurfaceKind, TerminalLayoutNode, TerminalPort } from "../../contracts/presentation/index.js";
|
|
3
|
+
import type { ShellPresentationPorts, ThemeSource } from "../../contracts/presentation/index.js";
|
|
4
|
+
import type { OwnedUiBackgroundSettingsPort, OwnedUiPromptSuggestionGeneratorPort, OwnedUiSessionBackend, OwnedUiSessionPresenters, OwnedUiSessionViewModel, OwnedUiTranscriptRendererPort, OwnedUiViewportSettings, OwnedUiViewportSettingsPort, OwnedUiQuitOutroSettingsPort, SuggestionDecision, SuggestionDiagnosticObserver } from "../../contracts/owned-ui/index.js";
|
|
4
5
|
import type { UiRouteHost, UiRouteInput } from "../../ui/apps/contracts.js";
|
|
5
6
|
import type { TranscriptViewportFrame, TranscriptViewportFrameDescriptor } from "../../ui/components/transcript-viewport.js";
|
|
6
|
-
import type
|
|
7
|
-
import type { PiShellHotkeysPresentation } from "../../integrations/pi/components/shell-presenters-info.js";
|
|
8
|
-
import { type PiShellClipboardContent, type PiShellComponentPort, type PiKeybindingsHost, type PiShellEditorPort, type PiShellHeaderOptions, type PiShellHeaderPort, type PiShellImageAssetResolver, type PiShellLoadedResourcesPort, type PiShellResourceEntry, type PiShellTranscriptComponentPort } from "../../integrations/pi/components/shell-shared-facade.js";
|
|
9
|
-
import { type PiTuiInputCoordinationScheduler, type PiTuiInputSurfaceKind } from "../../integrations/pi/tui-runtime/input-presentation-coordinator.js";
|
|
10
|
-
import type { PiTuiComponentPort, PiTuiInputDiagnosticsEvent, PiTuiLayoutNode, PiTuiTerminalPort } from "../../integrations/pi/tui-runtime/contracts.js";
|
|
11
|
-
import { type PreparedPrompt } from "./prompt-chips.js";
|
|
7
|
+
import { PromptChipStore, type PreparedPrompt } from "./prompt-chips.js";
|
|
12
8
|
import type { PastePreparationClientOptions } from "./paste-preparation-client.js";
|
|
13
9
|
import type { OwnedUiClipboardServices } from "./clipboard-services.js";
|
|
14
|
-
import {
|
|
10
|
+
import type { OwnedUiClipboardPort } from "./shell-clipboard.js";
|
|
11
|
+
import { SessionViewportController, type SessionViewportInputResult } from "./session-viewport-controller.js";
|
|
15
12
|
import type { ResponseCopyExecutor } from "./response-copy-transport.js";
|
|
16
13
|
import type { ResponseCopyEvent } from "./response-copy-protocol.js";
|
|
17
14
|
import type { PasteEvent, PasteSource } from "./paste-protocol.js";
|
|
15
|
+
import { DockChrome } from "./dock-chrome.js";
|
|
16
|
+
import { WorkflowOutput } from "./workflow-output.js";
|
|
17
|
+
import { TranscriptDocument } from "./transcript-document.js";
|
|
18
18
|
import type { StreamPresentationScheduler } from "./stream-presentation-coalescer.js";
|
|
19
|
-
|
|
20
|
-
type OwnedUiStartupOptions =
|
|
21
|
-
export interface OwnedUiClipboardPort {
|
|
22
|
-
readText(signal?: AbortSignal): Promise<string | null>;
|
|
23
|
-
readImage?(signal?: AbortSignal): Promise<{
|
|
24
|
-
readonly data: string;
|
|
25
|
-
readonly mimeType: string;
|
|
26
|
-
} | null>;
|
|
27
|
-
writeText?(text: string, signal?: AbortSignal): Promise<void>;
|
|
28
|
-
}
|
|
19
|
+
type OwnedUiTerminalPort = TerminalPort;
|
|
20
|
+
type OwnedUiStartupOptions = OwnedUiShellHeaderOptions;
|
|
29
21
|
/** The engine session the shell presents and the composition's decisions about it. */
|
|
30
22
|
export interface OwnedUiShellEngineOptions {
|
|
31
23
|
readonly backend: OwnedUiSessionBackend;
|
|
@@ -78,8 +70,8 @@ export interface OwnedUiShellPresentationOptions {
|
|
|
78
70
|
readonly seed?: number;
|
|
79
71
|
};
|
|
80
72
|
readonly input?: {
|
|
81
|
-
readonly scheduler?:
|
|
82
|
-
readonly onEvent?: (event:
|
|
73
|
+
readonly scheduler?: TerminalInputCoordinationScheduler;
|
|
74
|
+
readonly onEvent?: (event: TerminalInputDiagnosticsEvent) => void;
|
|
83
75
|
readonly now?: () => number;
|
|
84
76
|
/** Evidence-only baseline seam; production leaves coordination enabled. */
|
|
85
77
|
readonly coordination?: boolean;
|
|
@@ -98,7 +90,7 @@ export interface OwnedUiShellHistoryOptions {
|
|
|
98
90
|
readonly forScope?: (scope: "unique" | "shared", sessionId: string | null) => Pick<OwnedUiShellHistoryOptions, "store" | "imageSidecar"> | null;
|
|
99
91
|
readonly onScopeChange?: (listener: (scope: "unique" | "shared") => void) => () => void;
|
|
100
92
|
readonly limit: number;
|
|
101
|
-
readonly editor:
|
|
93
|
+
readonly editor: OwnedUiShellHistoryEditor;
|
|
102
94
|
/** Optional per-profile filesystem sidecar for image chip payloads. When present, submit
|
|
103
95
|
* writes each referenced attachment and recall reads them back to rehydrate live chips.
|
|
104
96
|
* When absent, image chips silently strip on recall, matching the missing-sidecar path. */
|
|
@@ -124,8 +116,6 @@ export interface OwnedUiShellDiagnosticOptions {
|
|
|
124
116
|
readonly paste?: (event: PasteEvent) => void;
|
|
125
117
|
/** Test seams for isolated paste preparation: an in-process starter, or the forked helper's entry. */
|
|
126
118
|
readonly pastePreparation?: Omit<PastePreparationClientOptions, "onEvent" | "spareIdleMs">;
|
|
127
|
-
/** Test seam for pending and failed optional selector-module preparation. */
|
|
128
|
-
readonly lazySelectors?: PiShellLazySelectorLoader;
|
|
129
119
|
}
|
|
130
120
|
/** Live prompt-image admission policy supplied only by the bare-A1 profile. */
|
|
131
121
|
export interface OwnedUiShellPromptImagesOptions {
|
|
@@ -141,13 +131,13 @@ export interface OwnedUiShellSkillsOptions {
|
|
|
141
131
|
export interface OwnedUiShellSharedServices {
|
|
142
132
|
readonly clipboard?: OwnedUiClipboardServices;
|
|
143
133
|
/** Must match the shell's layout: the owned-input profile for the custom viewport, Pi's otherwise. */
|
|
144
|
-
readonly keybindings?:
|
|
134
|
+
readonly keybindings?: OwnedUiShellKeybindingsHost;
|
|
145
135
|
}
|
|
146
136
|
/** What composes an owned session shell, grouped by the collaborator that provides each part. */
|
|
147
137
|
export interface OwnedUiSessionShellOptions {
|
|
148
138
|
readonly engine: OwnedUiShellEngineOptions;
|
|
149
|
-
/** Resolves selectors
|
|
150
|
-
readonly presenters: OwnedUiSessionPresenters;
|
|
139
|
+
/** Resolves selectors, engine-backed transcript renderers, and the vendor presentation ports. */
|
|
140
|
+
readonly presenters: OwnedUiSessionPresenters & ShellPresentationPorts;
|
|
151
141
|
readonly presentation?: OwnedUiShellPresentationOptions;
|
|
152
142
|
readonly history?: OwnedUiShellHistoryOptions;
|
|
153
143
|
readonly suggestions?: OwnedUiShellSuggestionOptions;
|
|
@@ -158,84 +148,73 @@ export interface OwnedUiSessionShellOptions {
|
|
|
158
148
|
readonly diagnostics?: OwnedUiShellDiagnosticOptions;
|
|
159
149
|
readonly shared?: OwnedUiShellSharedServices;
|
|
160
150
|
}
|
|
151
|
+
/** What the render root needs from its presenter: terminal size and render requests, the theme, and input callbacks. */
|
|
152
|
+
interface OwnedUiSessionShellRootHandlers {
|
|
153
|
+
readonly presentation: ShellPresentationPorts;
|
|
154
|
+
readonly components: OwnedUiShellComponents;
|
|
155
|
+
readonly getColumns: () => number;
|
|
156
|
+
readonly getRows: () => number;
|
|
157
|
+
readonly requestRender: (force?: boolean) => void;
|
|
158
|
+
readonly onViewportFrame?: (frame: TranscriptViewportFrame) => void;
|
|
159
|
+
readonly requestHyperlinkCleanup?: (rows?: readonly number[]) => void;
|
|
160
|
+
readonly enableDockInputReuse?: boolean;
|
|
161
|
+
readonly persistentHistory?: boolean;
|
|
162
|
+
readonly historyEditor?: OwnedUiShellHistoryEditor;
|
|
163
|
+
readonly onSubmit: (text: string) => void;
|
|
164
|
+
readonly onPasteRejected?: (error: unknown) => void;
|
|
165
|
+
readonly onInterrupt: () => void;
|
|
166
|
+
readonly onClear?: () => void;
|
|
167
|
+
readonly onExit: () => void;
|
|
168
|
+
readonly onModelSelect: () => void;
|
|
169
|
+
readonly onModelCycle?: (direction: "forward" | "backward") => void;
|
|
170
|
+
readonly onThinkingCycle: () => void;
|
|
171
|
+
readonly onThinkingToggle?: () => void;
|
|
172
|
+
readonly onMessageCopy?: () => void;
|
|
173
|
+
readonly onFollowUp?: () => void;
|
|
174
|
+
readonly onDequeue?: () => void;
|
|
175
|
+
readonly onEditorChange?: (text: string) => void;
|
|
176
|
+
readonly onPromptSuggestionAccepted?: (text: string) => void;
|
|
177
|
+
readonly onInputSurfaceChanged?: () => void;
|
|
178
|
+
readonly onPromptSuggestionEligibilityChanged?: () => void;
|
|
179
|
+
readonly onCopyText?: (text: string, cut: boolean) => void;
|
|
180
|
+
readonly readClipboardContent?: (signal?: AbortSignal) => Promise<OwnedUiShellClipboardContent | null>;
|
|
181
|
+
readonly captureClipboardPaste?: () => PasteSource;
|
|
182
|
+
readonly pasteDiagnostics?: (event: PasteEvent) => void;
|
|
183
|
+
readonly pastePreparation?: Omit<PastePreparationClientOptions, "onEvent">;
|
|
184
|
+
readonly keybindings?: OwnedUiShellKeybindingsHost;
|
|
185
|
+
readonly promptImageLimit?: () => number;
|
|
186
|
+
readonly skillsPresentation?: () => "collapse" | "expand";
|
|
187
|
+
}
|
|
161
188
|
/** Composes session state into the owned transcript, viewport, editor, and dock. */
|
|
162
|
-
export declare class OwnedUiSessionShellRoot implements
|
|
189
|
+
export declare class OwnedUiSessionShellRoot implements TerminalComponentPort {
|
|
163
190
|
#private;
|
|
164
|
-
readonly editor:
|
|
165
|
-
readonly header:
|
|
166
|
-
readonly resources:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
readonly onSubmit: (text: string) => void;
|
|
177
|
-
readonly onPasteRejected?: (error: unknown) => void;
|
|
178
|
-
readonly onInterrupt: () => void;
|
|
179
|
-
readonly onClear?: () => void;
|
|
180
|
-
readonly onExit: () => void;
|
|
181
|
-
readonly onModelSelect: () => void;
|
|
182
|
-
readonly onModelCycle?: (direction: "forward" | "backward") => void;
|
|
183
|
-
readonly onThinkingCycle: () => void;
|
|
184
|
-
readonly onThinkingToggle?: () => void;
|
|
185
|
-
readonly onMessageCopy?: () => void;
|
|
186
|
-
readonly onFollowUp?: () => void;
|
|
187
|
-
readonly onDequeue?: () => void;
|
|
188
|
-
readonly onEditorChange?: (text: string) => void;
|
|
189
|
-
readonly onPromptSuggestionAccepted?: (text: string) => void;
|
|
190
|
-
readonly onInputSurfaceChanged?: () => void;
|
|
191
|
-
readonly onPromptSuggestionEligibilityChanged?: () => void;
|
|
192
|
-
readonly onCopyText?: (text: string, cut: boolean) => void;
|
|
193
|
-
readonly readClipboardContent?: (signal?: AbortSignal) => Promise<PiShellClipboardContent | null>;
|
|
194
|
-
readonly captureClipboardPaste?: () => PasteSource;
|
|
195
|
-
readonly pasteDiagnostics?: (event: PasteEvent) => void;
|
|
196
|
-
readonly pastePreparation?: Omit<PastePreparationClientOptions, "onEvent">;
|
|
197
|
-
readonly keybindings?: PiKeybindingsHost;
|
|
198
|
-
readonly promptImageLimit?: () => number;
|
|
199
|
-
readonly skillsPresentation?: () => "collapse" | "expand";
|
|
200
|
-
}, startup?: PiShellHeaderOptions, agentDir?: string, extensionRenderers?: OwnedUiTranscriptRendererPort, sessionLayout?: "pinned" | "custom-viewport", imageAssets?: PiShellImageAssetResolver);
|
|
191
|
+
readonly editor: OwnedUiShellEditorPort;
|
|
192
|
+
readonly header: OwnedUiShellHeaderPort;
|
|
193
|
+
readonly resources: OwnedUiShellLoadedResourcesPort;
|
|
194
|
+
/** The transcript's semantic rows, caches, and engine-backed block renderers. */
|
|
195
|
+
readonly transcript: TranscriptDocument;
|
|
196
|
+
readonly promptChips: PromptChipStore;
|
|
197
|
+
readonly viewport: SessionViewportController;
|
|
198
|
+
/** Workflow results, messages, and status lines appended to the transcript. */
|
|
199
|
+
readonly workflow: WorkflowOutput;
|
|
200
|
+
/** The dock's notices, copy acknowledgement, and release banner. */
|
|
201
|
+
readonly chrome: DockChrome;
|
|
202
|
+
constructor(view: OwnedUiSessionViewModel, cwd: string, handlers: OwnedUiSessionShellRootHandlers, startup?: OwnedUiShellHeaderOptions, agentDir?: string, extensionRenderers?: OwnedUiTranscriptRendererPort, sessionLayout?: "pinned" | "custom-viewport", imageAssets?: OwnedUiShellImageAssetResolver);
|
|
201
203
|
setEditorPaddingX(padding: number): void;
|
|
202
204
|
setAutocompleteMaxVisible(maxVisible: number): void;
|
|
203
205
|
setOutputPad(padding: 0 | 1): void;
|
|
204
206
|
setHideThinkingBlock(hidden: boolean): void;
|
|
205
207
|
setMermaidRenderingMode(mode: "off" | "final" | "streaming"): void;
|
|
206
208
|
setImagePresentation(showImages: boolean, imageWidthCells: number): void;
|
|
207
|
-
prepareHistoryText(text: string): string;
|
|
208
|
-
omitUnsentPromptImages(text: string): string;
|
|
209
|
-
rehydrateHistoryText(text: string, resolveImage: (id: string) => import("../../contracts/owned-ui/index.js").PromptHistoryImageSidecarAttachment | null): string;
|
|
210
|
-
imageChipAttachmentsFromEditor(text: string): {
|
|
211
|
-
readonly id: string;
|
|
212
|
-
readonly tag: string;
|
|
213
|
-
readonly image: {
|
|
214
|
-
readonly type: "image";
|
|
215
|
-
readonly data: string;
|
|
216
|
-
readonly mimeType: string;
|
|
217
|
-
};
|
|
218
|
-
}[];
|
|
219
|
-
preparePromptSubmission(text: string): PreparedPrompt;
|
|
220
209
|
reconcilePromptImageLimitNotice(text?: string): boolean;
|
|
221
|
-
hasPendingPastes(text: string): boolean;
|
|
222
210
|
waitForPromptPastes(text: string, signal: AbortSignal): Promise<PreparedPrompt>;
|
|
223
211
|
resetPendingPastes(): void;
|
|
224
|
-
/** Forks the spare paste helper so the first paste of the session takes a live child. */
|
|
225
|
-
warmPastePreparation(): void;
|
|
226
212
|
disposePendingPastes(): Promise<void>;
|
|
227
213
|
promptSuggestionPrepareBlockReason(): SuggestionDecision;
|
|
228
|
-
canPreparePromptSuggestion(): boolean;
|
|
229
214
|
promptSuggestionPresentationBlockReason(): SuggestionDecision;
|
|
230
215
|
canPresentPromptSuggestion(): boolean;
|
|
231
216
|
setPromptSuggestion(text: string | null): void;
|
|
232
217
|
update(view: OwnedUiSessionViewModel): void;
|
|
233
|
-
/**
|
|
234
|
-
* Applies one block: its component is created or updated in place and the order grows
|
|
235
|
-
* only when the block is new. A streamed chunk costs one component update rather than a
|
|
236
|
-
* walk of the whole transcript.
|
|
237
|
-
*/
|
|
238
|
-
applyTranscriptBlock(block: OwnedUiSessionViewModel["transcript"][number]): void;
|
|
239
218
|
render(width: number): readonly string[];
|
|
240
219
|
viewportFrameDescriptor(): TranscriptViewportFrameDescriptor | null;
|
|
241
220
|
/** Read-only, payload-free evidence; observing a pending frame must never render or repair it. */
|
|
@@ -267,59 +246,43 @@ export declare class OwnedUiSessionShellRoot implements PiTuiComponentPort {
|
|
|
267
246
|
viewportTransientTailRowCount(): number;
|
|
268
247
|
hasActiveSelection(): boolean;
|
|
269
248
|
setViewportConfig(config: OwnedUiViewportSettings): void;
|
|
270
|
-
setFullscreenCopyOnSelect(enabled: boolean): void;
|
|
271
|
-
showCopyAcknowledgement(message: string): void;
|
|
272
|
-
resumeViewportFollowing(): void;
|
|
273
|
-
noteCompletedAssistantMessage(): void;
|
|
274
|
-
/** A new session binding owns new mounts even when it reuses semantic invocation ids. */
|
|
275
|
-
resetTranscript(): void;
|
|
276
|
-
resetViewport(): void;
|
|
277
|
-
clearViewportPointerState(): void;
|
|
278
|
-
setViewportOverlaySurfaces(surfaces: readonly PiTuiPointerSurface[] | null): void;
|
|
279
249
|
viewportInputGeometryReady(width: number, height: number): boolean;
|
|
280
250
|
handleViewportPreInput(data: string, allowWheel?: boolean, now?: number, editorActive?: boolean): SessionViewportInputResult;
|
|
281
|
-
dismissNotice(): void;
|
|
282
251
|
/** The pinned-profile layout regions of this session; the terminal host arranges them with `pinnedLayoutRoot`. */
|
|
283
252
|
layoutParts(): PinnedLayoutParts;
|
|
284
|
-
transcriptComponent(id: string): PiShellTranscriptComponentPort | undefined;
|
|
285
|
-
exitTranscript(width: number): string;
|
|
286
|
-
appendWorkflowStatus(message: string): void;
|
|
287
|
-
appendWorkflowMessage(message: OwnedUiWorkflowMessage, errorCode?: ImageAttachmentError["code"]): void;
|
|
288
|
-
appendWorkflowResult(result: OwnedUiWorkflowResult, errorCode?: ImageAttachmentError["code"]): void;
|
|
289
253
|
toggleThinkingVisibility(): void;
|
|
290
254
|
get toolsExpanded(): boolean;
|
|
291
255
|
setToolsExpanded(expanded: boolean): void;
|
|
292
|
-
setExtensionWidget(key: string, component:
|
|
293
|
-
setExtensionHeader(component:
|
|
294
|
-
setExtensionFooter(component:
|
|
256
|
+
setExtensionWidget(key: string, component: OwnedUiShellComponentPort | null, placement: "aboveEditor" | "belowEditor"): void;
|
|
257
|
+
setExtensionHeader(component: OwnedUiShellComponentPort | null): void;
|
|
258
|
+
setExtensionFooter(component: OwnedUiShellComponentPort | null): void;
|
|
295
259
|
setExtensionStatus(key: string, text: string | undefined): void;
|
|
296
260
|
setExtensionWorking(message: string | undefined, visible?: boolean): void;
|
|
297
261
|
beginImageSubmissionStatus(): () => void;
|
|
298
|
-
hotkeysPresentation():
|
|
262
|
+
hotkeysPresentation(): OwnedUiShellHotkeysPresentation;
|
|
299
263
|
resetWorkflowPresentation(): void;
|
|
300
264
|
resetExtensionUi(): void;
|
|
301
265
|
addExtensionNotification(message: string, type: "info" | "warning" | "error"): void;
|
|
302
266
|
extensionFooterData(): unknown;
|
|
303
267
|
usesDefaultInputSurface(): boolean;
|
|
304
|
-
inputCoordinationSurface():
|
|
268
|
+
inputCoordinationSurface(): TerminalInputSurfaceKind;
|
|
305
269
|
viewportCompositionEvidence(): {
|
|
306
270
|
readonly full: number;
|
|
307
271
|
readonly dockOnly: number;
|
|
308
272
|
};
|
|
309
273
|
transcriptRenderCount(): number;
|
|
310
274
|
setFooterLevel(visible: boolean): void;
|
|
311
|
-
setInputSurface(component:
|
|
275
|
+
setInputSurface(component: OwnedUiShellComponentPort | null, disposePrevious?: boolean, coordination?: Exclude<TerminalInputSurfaceKind, "editor">): void;
|
|
312
276
|
handleInput(data: string): void;
|
|
313
277
|
invalidate(): void;
|
|
314
278
|
setFocused(focused: boolean): void;
|
|
315
279
|
dispose(): void;
|
|
316
280
|
}
|
|
317
281
|
export type PinnedLayoutPart = "document" | "queued" | "aboveWidgets" | "status" | "editor" | "belowWidgets" | "footer";
|
|
318
|
-
export type PinnedLayoutParts = Readonly<Record<PinnedLayoutPart,
|
|
282
|
+
export type PinnedLayoutParts = Readonly<Record<PinnedLayoutPart, TerminalComponentPort>>;
|
|
319
283
|
/**
|
|
320
284
|
* The pinned-profile screen: a followed transcript scroll above the dock. The runtime mounts one such layout,
|
|
321
285
|
* so its single `transcript` scroll view is shared by whichever session the parts currently resolve to.
|
|
322
286
|
*/
|
|
323
|
-
export declare function pinnedLayoutRoot(parts: PinnedLayoutParts):
|
|
324
|
-
export declare function shellResourceEntries(backend: OwnedUiSessionBackend): readonly PiShellResourceEntry[];
|
|
287
|
+
export declare function pinnedLayoutRoot(parts: PinnedLayoutParts, theme: ThemeSource): TerminalLayoutNode;
|
|
325
288
|
export {};
|