@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,16 +1,22 @@
|
|
|
1
|
-
export { adaptPiAssistantMessage, adaptPiToolExecution, adaptPiUserMessage } from "./components.js";
|
|
2
1
|
export { loadHistoryEditor, type HistoryEditorConstructor } from "./history-editor-loader.js";
|
|
3
|
-
export { PiComponentConformanceError, runPiComponentConformance } from "./conformance.js";
|
|
4
|
-
export type { PiComponentConformanceReport, PiComponentConformanceResult } from "./conformance.js";
|
|
5
2
|
export { createPiShellOperationLoader, createPiShellShareOperationDialog, type PiShellOperationLoaderPort, } from "./share-operation-dialog.js";
|
|
6
|
-
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS,
|
|
3
|
+
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS, createPiShellEditor, } from "./shell-editor-autocomplete.js";
|
|
4
|
+
export { componentFromPort, componentPort, createTuiFacade, createPiKeybindingsHost, ensureTheme, formatSessionTokens, isAutocompleteProvider, isRecord, piShellHyperlink, piShellTruncateToWidth, piShellVisibleWidth, } from "./shell-shared-facade.js";
|
|
5
|
+
export { createPiExtensionUiBridge, } from "./shell-extension-ui.js";
|
|
6
|
+
export { createPiQueuedInputStatus, createPiShellFooter, createPiShellHeader, createPiShellLoadedResources, createPiShellStatus, } from "./shell-footer-status.js";
|
|
7
|
+
export { createPiShellArmin, createPiShellAuthProviderSelector, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellExtensionSelector, createPiShellLoginDialog, createPiShellModelSelector, createPiShellModelsDialog, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellShowImagesSelector, createPiShellSkillsSelector, createPiShellThemeSelector, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, } from "./shell-selectors-dialogs.js";
|
|
8
|
+
export { createPiShellChangelog, createPiShellCollapsedChangelog, createPiShellHotkeys, createPiShellSessionInfo, renderPiShellChangelogLines, renderPiShellCommandMessage, renderPiShellHotkeysLines, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateBanner, renderPiShellReleaseUpdateNotice, renderPiShellStatusText, } from "./shell-presenters-info.js";
|
|
9
|
+
export { createPiShellTranscriptComponent, isPiPromptStyleCompaction, renderPiShellStartupDiagnostic, renderPiShellTranscriptBlock, validatedAssistantMessage, } from "./shell-presenters-transcript.js";
|
|
7
10
|
export { renderPiShellHotkeySections } from "./shell-hotkey-sections.js";
|
|
8
11
|
export type { PiShellHotkeySection } from "./shell-hotkey-sections.js";
|
|
9
|
-
export type { PiExtensionUiBridge, PiExtensionUiBridgeHost,
|
|
10
|
-
export {
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
13
|
-
export type {
|
|
12
|
+
export type { PiExtensionUiBridge, PiExtensionUiBridgeHost, } from "./shell-extension-ui.js";
|
|
13
|
+
export type { PiShellAuthProviderOption, PiShellLoginDialogPort, PiShellModelSelectorOptions, PiShellModelsDialogOptions, PiShellModelsDialogPort, PiShellScopedModelDescriptor, PiShellScopedModelsSelectorOptions, PiShellScopedModelsSelectorPort, PiShellSettingsSelectorOptions, } from "./shell-selectors-dialogs.js";
|
|
14
|
+
export type { PiShellAutocompleteCommand, PiShellClipboardContent, PiShellComponentPort, PiShellEditorBodyGeometry, PiShellEditorOptions, PiShellEditorPointerEvent, PiKeybindingsHost, PiShellEditorPort, PiShellEditorTextRange, PiShellExtensionRendererResolver, PiShellHeaderOptions, PiShellHeaderPort, PiShellImageAssetResolver, PiShellLoadedResourcesPort, PiShellPasteReservation, PiShellQueuedInputPort, PiShellResourceEntry, PiShellResourceSection, PiShellSelectorOption, PiShellSelectorOptions, PiShellStartupNotice, PiShellStatusPlacement, PiShellStatusPort, PiShellTranscriptComponentPort, PiShellViewComponentPort, } from "./shell-shared-facade.js";
|
|
15
|
+
export type { PiShellCommandMessagePresentation, PiShellHotkeysPresentation, PiShellSessionInfoPresentation, } from "./shell-presenters-info.js";
|
|
16
|
+
export type { PiShellSubmittedPromptComposer, } from "./shell-presenters-transcript.js";
|
|
17
|
+
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, derivePiCanvasBackground, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes, loadPiTheme, onPiThemeChange, parsePiAutoThemeSetting, piCanvasBackgroundAnsi, piTheme, resolvePiThemeSetting, setPiAccentColor, setPiPackageBorderProjectionEnabled, stopPiThemeWatcher, } from "./upstream/theme/theme.js";
|
|
18
|
+
export type { PiAccentProjection, PiColorMode, PiTerminalTheme, PiTerminalThemeDetection, PiTerminalThemeDetector, PiThemeBackground, PiThemeResult } from "./upstream/theme/theme.js";
|
|
19
|
+
export { PI_THEME_SOURCE, getPiSelectListTheme, piUiTheme } from "./theme.js";
|
|
14
20
|
export { PI_MODAL_CONTENT_PADDING_X, PiModalFrame, PiModalHeader, addPiModalHeader, adoptPiModalFrame, adoptPiModalHeader, } from "./modal-frame.js";
|
|
15
21
|
export { ModelsDialogComponent } from "./models-dialog.js";
|
|
16
22
|
export type { ModelsDialogCallbacks, ModelsDialogConfig, ModelsDialogFilter, ModelsDialogModel } from "./models-dialog.js";
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
export { adaptPiAssistantMessage, adaptPiToolExecution, adaptPiUserMessage } from "./components.js";
|
|
2
1
|
export { loadHistoryEditor } from "./history-editor-loader.js";
|
|
3
|
-
export { PiComponentConformanceError, runPiComponentConformance } from "./conformance.js";
|
|
4
2
|
export { createPiShellOperationLoader, createPiShellShareOperationDialog, } from "./share-operation-dialog.js";
|
|
5
|
-
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS,
|
|
3
|
+
export { OWNED_BUILTIN_SLASH_COMMANDS, PINNED_PI_BUILTIN_SLASH_COMMANDS, createPiShellEditor, } from "./shell-editor-autocomplete.js";
|
|
4
|
+
export { componentFromPort, componentPort, createTuiFacade, createPiKeybindingsHost, ensureTheme, formatSessionTokens, isAutocompleteProvider, isRecord, piShellHyperlink, piShellTruncateToWidth, piShellVisibleWidth, } from "./shell-shared-facade.js";
|
|
5
|
+
export { createPiExtensionUiBridge, } from "./shell-extension-ui.js";
|
|
6
|
+
export { createPiQueuedInputStatus, createPiShellFooter, createPiShellHeader, createPiShellLoadedResources, createPiShellStatus, } from "./shell-footer-status.js";
|
|
7
|
+
export { createPiShellArmin, createPiShellAuthProviderSelector, createPiShellDialog, createPiShellEarendilAnnouncement, createPiShellExtensionSelector, createPiShellLoginDialog, createPiShellModelSelector, createPiShellModelsDialog, createPiShellReloadBox, createPiShellScopedModelsSelector, createPiShellSelector, createPiShellSessionSelector, createPiShellSettingsSelector, createPiShellShowImagesSelector, createPiShellSkillsSelector, createPiShellThemeSelector, createPiShellTreeSelector, createPiShellTrustSelector, createPiShellUserMessageSelector, } from "./shell-selectors-dialogs.js";
|
|
8
|
+
export { createPiShellChangelog, createPiShellCollapsedChangelog, createPiShellHotkeys, createPiShellSessionInfo, renderPiShellChangelogLines, renderPiShellCommandMessage, renderPiShellHotkeysLines, renderPiShellPackageUpdateNotice, renderPiShellReleaseUpdateBanner, renderPiShellReleaseUpdateNotice, renderPiShellStatusText, } from "./shell-presenters-info.js";
|
|
9
|
+
export { createPiShellTranscriptComponent, isPiPromptStyleCompaction, renderPiShellStartupDiagnostic, renderPiShellTranscriptBlock, validatedAssistantMessage, } from "./shell-presenters-transcript.js";
|
|
6
10
|
export { renderPiShellHotkeySections } from "./shell-hotkey-sections.js";
|
|
7
|
-
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, derivePiCanvasBackground, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes,
|
|
8
|
-
export {
|
|
11
|
+
export { PINNED_PI_LAYOUT, applyConfiguredPiTheme, applyPiTheme, applyPiThemeInstance, currentPiAccentColor, currentPiThemeName, derivePiAccentProjection, derivePiCanvasBackground, detectPiTerminalBackgroundFromEnv, detectPiTerminalBackgroundTheme, detectPiTerminalThemeForAuto, ensurePiTheme, getAvailablePiThemes, loadPiTheme, onPiThemeChange, parsePiAutoThemeSetting, piCanvasBackgroundAnsi, piTheme, resolvePiThemeSetting, setPiAccentColor, setPiPackageBorderProjectionEnabled, stopPiThemeWatcher, } from "./upstream/theme/theme.js";
|
|
12
|
+
export { PI_THEME_SOURCE, getPiSelectListTheme, piUiTheme } from "./theme.js";
|
|
9
13
|
export { PI_MODAL_CONTENT_PADDING_X, PiModalFrame, PiModalHeader, addPiModalHeader, adoptPiModalFrame, adoptPiModalHeader, } from "./modal-frame.js";
|
|
10
14
|
export { ModelsDialogComponent } from "./models-dialog.js";
|
|
11
15
|
export { CountdownTimer } from "./upstream/components/countdown-timer.js";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { PiShellComponentPort } from "./shell-shared-facade.js";
|
|
2
2
|
import type { ThinkingSelectorLevel } from "./upstream/components/thinking-selector.js";
|
|
3
3
|
import type { FilterMode } from "./upstream/components/tree-selector.js";
|
|
4
|
-
|
|
5
|
-
type TreeSelectorModule = typeof import("./upstream/components/tree-selector.js");
|
|
6
|
-
export interface PiShellLazyThinkingSelectorOptions {
|
|
4
|
+
interface PiShellLazyThinkingSelectorOptions {
|
|
7
5
|
readonly currentLevel: ThinkingSelectorLevel;
|
|
8
6
|
readonly availableLevels: readonly ThinkingSelectorLevel[];
|
|
9
7
|
readonly onSelect: (level: ThinkingSelectorLevel) => void;
|
|
@@ -15,7 +13,7 @@ export interface PiShellLazyThinkingSelectorOptions {
|
|
|
15
13
|
readonly cycleBinding: string | readonly string[];
|
|
16
14
|
};
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
interface PiShellLazyTreeSelectorOptions {
|
|
19
17
|
readonly tree: readonly unknown[];
|
|
20
18
|
readonly currentLeafId: string | null;
|
|
21
19
|
readonly terminalHeight: number;
|
|
@@ -31,12 +29,6 @@ export interface PiShellLazySelectorLoader {
|
|
|
31
29
|
createThinking(options: PiShellLazyThinkingSelectorOptions): Promise<PiShellComponentPort>;
|
|
32
30
|
createTree(options: PiShellLazyTreeSelectorOptions): Promise<PiShellComponentPort>;
|
|
33
31
|
}
|
|
34
|
-
export interface PiShellLazySelectorImports {
|
|
35
|
-
readonly thinking: () => Promise<ThinkingSelectorModule>;
|
|
36
|
-
readonly tree: () => Promise<TreeSelectorModule>;
|
|
37
|
-
}
|
|
38
|
-
/** Builds one idempotent selector loader; fulfilled, in-flight, and rejected imports remain shared. */
|
|
39
|
-
export declare function createPiShellLazySelectorLoader(imports?: PiShellLazySelectorImports): PiShellLazySelectorLoader;
|
|
40
32
|
/** Production selector loader, dynamically reached only after the first input-ready frame. */
|
|
41
33
|
export declare const piShellLazySelectors: PiShellLazySelectorLoader;
|
|
42
34
|
export {};
|
|
@@ -4,7 +4,7 @@ const DEFAULT_IMPORTS = {
|
|
|
4
4
|
tree: () => import("./upstream/components/tree-selector.js"),
|
|
5
5
|
};
|
|
6
6
|
/** Builds one idempotent selector loader; fulfilled, in-flight, and rejected imports remain shared. */
|
|
7
|
-
|
|
7
|
+
function createPiShellLazySelectorLoader(imports = DEFAULT_IMPORTS) {
|
|
8
8
|
let thinkingSelectorModule;
|
|
9
9
|
let treeSelectorModule;
|
|
10
10
|
const loadThinkingSelector = () => thinkingSelectorModule ??= imports.thinking();
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import { Container, Input, type Component, type Focusable
|
|
1
|
+
import { Container, Input, type Component, type Focusable } from "@earendil-works/pi-tui";
|
|
2
2
|
export declare const PI_MODAL_CONTENT_PADDING_X = 1;
|
|
3
3
|
/** Paints the standard Pi Input prompt as a live-themed dialog-search marker. */
|
|
4
4
|
export declare function renderPiModalSearchInput(input: Input, width: number): string[];
|
|
5
|
-
/** Keeps Pi Input behavior and geometry while owning only its standard dialog-search presentation. */
|
|
6
|
-
export declare class PiModalSearchInput implements Component, Focusable {
|
|
7
|
-
#private;
|
|
8
|
-
constructor(input: Input);
|
|
9
|
-
get focused(): boolean;
|
|
10
|
-
set focused(value: boolean);
|
|
11
|
-
invalidate(): void;
|
|
12
|
-
render(width: number): string[];
|
|
13
|
-
handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
14
|
-
}
|
|
15
5
|
/** Replaces one explicitly identified direct Input child with the standard search presentation. */
|
|
16
|
-
export declare function adoptPiModalSearchInput(container: Container, input: Component):
|
|
6
|
+
export declare function adoptPiModalSearchInput(container: Container, input: Component): Component & Focusable;
|
|
17
7
|
/** Adds one standard dialog-search presentation while callers retain the Input controller. */
|
|
18
|
-
export declare function addPiModalSearchInput(container: Container, input: Input):
|
|
8
|
+
export declare function addPiModalSearchInput(container: Container, input: Input): Component & Focusable;
|
|
19
9
|
/** Adds the standard navigation/select/close footer before a dependency component's bottom rule. */
|
|
20
10
|
export declare function addPiModalSelectFooter(container: Container): void;
|
|
21
|
-
/** Owned cancellable operation frame with the canonical dialog close guidance. */
|
|
22
|
-
export declare class PiCancellableOperationFrame extends Container {
|
|
23
|
-
#private;
|
|
24
|
-
constructor(tui: TUI, message: string);
|
|
25
|
-
get signal(): AbortSignal;
|
|
26
|
-
handleInput(data: string): void;
|
|
27
|
-
dispose(): void;
|
|
28
|
-
}
|
|
29
11
|
/** The semantic top rule/title pair used while a modal assembles its frame. */
|
|
30
12
|
export declare class PiModalHeader implements Component {
|
|
31
13
|
readonly rule: Component;
|
|
@@ -46,7 +28,7 @@ export declare class PiModalFrame implements Component {
|
|
|
46
28
|
}
|
|
47
29
|
/** Add compact titled-modal chrome while a component assembles its semantic body. */
|
|
48
30
|
export declare function addPiModalHeader(container: Container, rule: Component, title: Component): PiModalHeader;
|
|
49
|
-
|
|
31
|
+
interface PiModalFrameAdoption {
|
|
50
32
|
readonly topIndex: number;
|
|
51
33
|
readonly bottomIndex: number;
|
|
52
34
|
readonly header?: PiModalHeader;
|
|
@@ -65,3 +47,4 @@ export declare function adoptPiModalFrame(container: Container, adoption: PiModa
|
|
|
65
47
|
* never inspected or rewritten. The pinned comparison profile does not call this adapter.
|
|
66
48
|
*/
|
|
67
49
|
export declare function adoptPiModalHeader(container: Container, ruleIndex: number, titleIndex: number): PiModalHeader;
|
|
50
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Container, Input, Spacer, Text, } from "@earendil-works/pi-tui";
|
|
2
2
|
import { DIALOG_CONTENT_PADDING_X, dialogFrameGeometry, insetDialogContent } from "../../../contracts/presentation/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import { DIALOG_CLOSE_SHORTCUT_HINT, paintPiBorder, piTheme, renderPiModalShortcutHints } from "./theme.js";
|
|
3
|
+
import { DIALOG_CLOSE_SHORTCUT_HINT, piTheme, renderPiModalShortcutHints } from "./theme.js";
|
|
5
4
|
export const PI_MODAL_CONTENT_PADDING_X = DIALOG_CONTENT_PADDING_X;
|
|
6
5
|
/** Paints the standard Pi Input prompt as a live-themed dialog-search marker. */
|
|
7
6
|
export function renderPiModalSearchInput(input, width) {
|
|
@@ -14,7 +13,7 @@ export function renderPiModalSearchInput(input, width) {
|
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
15
|
/** Keeps Pi Input behavior and geometry while owning only its standard dialog-search presentation. */
|
|
17
|
-
|
|
16
|
+
class PiModalSearchInput {
|
|
18
17
|
#input;
|
|
19
18
|
constructor(input) {
|
|
20
19
|
this.#input = input;
|
|
@@ -48,25 +47,6 @@ export function addPiModalSelectFooter(container) {
|
|
|
48
47
|
{ key: "↑↓", action: "navigate" }, { key: "enter", action: "select" }, DIALOG_CLOSE_SHORTCUT_HINT,
|
|
49
48
|
]), 0, 0));
|
|
50
49
|
}
|
|
51
|
-
/** Owned cancellable operation frame with the canonical dialog close guidance. */
|
|
52
|
-
export class PiCancellableOperationFrame extends Container {
|
|
53
|
-
#loader;
|
|
54
|
-
constructor(tui, message) {
|
|
55
|
-
super();
|
|
56
|
-
const theme = piTheme();
|
|
57
|
-
this.#loader = new CancellableLoader(tui, text => theme.fg("accent", text), text => theme.fg("muted", text), message);
|
|
58
|
-
this.addChild(new DynamicBorder(paintPiBorder));
|
|
59
|
-
this.addChild(this.#loader);
|
|
60
|
-
this.addChild(new Spacer(1));
|
|
61
|
-
this.addChild(new Text(renderPiModalShortcutHints([DIALOG_CLOSE_SHORTCUT_HINT]), 0, 0));
|
|
62
|
-
this.addChild(new Spacer(1));
|
|
63
|
-
this.addChild(new DynamicBorder(paintPiBorder));
|
|
64
|
-
adoptPiModalFrame(this, { topIndex: 0, bottomIndex: this.children.length - 1 });
|
|
65
|
-
}
|
|
66
|
-
get signal() { return this.#loader.signal; }
|
|
67
|
-
handleInput(data) { this.#loader.handleInput(data); }
|
|
68
|
-
dispose() { this.#loader.dispose(); }
|
|
69
|
-
}
|
|
70
50
|
/** The semantic top rule/title pair used while a modal assembles its frame. */
|
|
71
51
|
export class PiModalHeader {
|
|
72
52
|
rule;
|
|
@@ -7,7 +7,7 @@ import type { PiShellClipboardContent, PiShellEditorTextRange, PiShellPasteReser
|
|
|
7
7
|
* vanilla Pi renders. This keeps owned UX additions out of the synchronized
|
|
8
8
|
* Pi editor port and gives future interactions one registration point.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
interface OwnedEditorUxInterceptor {
|
|
11
11
|
handleInput(data: string, next: (data?: string) => void): void;
|
|
12
12
|
render(width: number, next: () => string[]): string[];
|
|
13
13
|
reset(): void;
|
|
@@ -18,7 +18,7 @@ export interface OwnedEditorUxInterceptor {
|
|
|
18
18
|
pasteClipboard?(): boolean;
|
|
19
19
|
cancelPendingPastes?(): void;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
interface OwnedEditorPointerEvent {
|
|
22
22
|
readonly kind: "press" | "motion" | "release";
|
|
23
23
|
readonly button: number;
|
|
24
24
|
readonly column: number;
|
|
@@ -45,7 +45,7 @@ export declare class OwnedEditorUxInterception {
|
|
|
45
45
|
ownsPointer(): boolean;
|
|
46
46
|
pasteClipboard(): boolean;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
interface PromptSelectionUxOptions {
|
|
49
49
|
readonly copyText: (text: string, cut: boolean) => void;
|
|
50
50
|
readonly readClipboardContent: () => Promise<PiShellClipboardContent | null>;
|
|
51
51
|
readonly beginClipboardPaste?: () => PiShellPasteReservation;
|
|
@@ -77,3 +77,4 @@ export declare function createPromptSelectionInterceptor(editor: Editor, keybind
|
|
|
77
77
|
export declare function editorInsertedText(data: string): string | undefined;
|
|
78
78
|
/** Shares the existing atomic-aware body layout with prompt/menu composition. */
|
|
79
79
|
export declare function editorVisualLineCount(editor: Editor, width: number): number | undefined;
|
|
80
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ImageAttachmentError, MAX_CLIPBOARD_TEXT_BYTES } from "../../../contracts/owned-ui/index.js";
|
|
2
2
|
import { CURSOR_MARKER, decodeKittyPrintable, visibleWidth, } from "@earendil-works/pi-tui";
|
|
3
3
|
import { promptPathWordRanges } from "./path-word-ranges.js";
|
|
4
|
+
import { BracketedPasteFramer, PASTE_START } from "./bracketed-paste.js";
|
|
4
5
|
export class OwnedEditorUxInterception {
|
|
5
6
|
interceptors;
|
|
6
7
|
fallback;
|
|
@@ -68,7 +69,7 @@ class PromptSelectionInterceptor {
|
|
|
68
69
|
#redoStack = [];
|
|
69
70
|
#selectionRevision = 0;
|
|
70
71
|
#pasteState = { generation: 0, preview: undefined };
|
|
71
|
-
#
|
|
72
|
+
#paste;
|
|
72
73
|
#wordDirection;
|
|
73
74
|
#geometry;
|
|
74
75
|
editor;
|
|
@@ -78,11 +79,12 @@ class PromptSelectionInterceptor {
|
|
|
78
79
|
this.editor = editor;
|
|
79
80
|
this.keybindings = keybindings;
|
|
80
81
|
this.options = options;
|
|
82
|
+
this.#paste = new BracketedPasteFramer(options.beginTextPaste === undefined ? undefined : MAX_CLIPBOARD_TEXT_BYTES);
|
|
81
83
|
installAtomicSegmentation(editor, options.atomicRanges, () => this.#wordDirection);
|
|
82
84
|
}
|
|
83
85
|
handleInput(data, next) {
|
|
84
86
|
this.#pasteState.preview = undefined;
|
|
85
|
-
if (this.options.pasteEnabled === false ?
|
|
87
|
+
if (this.options.pasteEnabled === false ? this.#paste.discard(data, value => this.handleInput(value, next)) : this.#handleTerminalPaste(data, next))
|
|
86
88
|
return;
|
|
87
89
|
if (this.keybindings.matches(data, "owned.editor.selectAll")) {
|
|
88
90
|
this.#selectAll();
|
|
@@ -166,24 +168,7 @@ class PromptSelectionInterceptor {
|
|
|
166
168
|
return;
|
|
167
169
|
}
|
|
168
170
|
if (this.keybindings.matches(data, "tui.editor.cursorWordLeft")) {
|
|
169
|
-
|
|
170
|
-
const startedWithAtomicFocus = this.#atomicFocus() !== undefined;
|
|
171
|
-
this.#delegateWord(-1, next);
|
|
172
|
-
let after = this.#cursor();
|
|
173
|
-
const landedAtomic = this.#atomicRangeAt(after);
|
|
174
|
-
if (!startedWithAtomicFocus && landedAtomic?.start === after.col && after.col > 0) {
|
|
175
|
-
const line = editorState(this.editor).lines[after.line] ?? "";
|
|
176
|
-
const previous = [...GRAPHEMES.segment(line.slice(0, after.col))].at(-1);
|
|
177
|
-
if (previous !== undefined && !/^\s+$/u.test(previous.segment)) {
|
|
178
|
-
this.#delegateWord(-1, next);
|
|
179
|
-
after = this.#cursor();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
const line = editorState(this.editor).lines[after.line] ?? "";
|
|
183
|
-
const landedPath = promptPathWordRanges(line).some(range => range.start === after.col);
|
|
184
|
-
if (!samePosition(before, after) && !landedPath)
|
|
185
|
-
this.#moveOntoPreviousSeparator();
|
|
186
|
-
this.#requestRender();
|
|
171
|
+
this.#moveWordLeft(next);
|
|
187
172
|
return;
|
|
188
173
|
}
|
|
189
174
|
const beforeText = this.editor.getText();
|
|
@@ -302,14 +287,15 @@ class PromptSelectionInterceptor {
|
|
|
302
287
|
this.#pointerSelecting = false;
|
|
303
288
|
this.#lastClick = undefined;
|
|
304
289
|
this.#redoStack = [];
|
|
305
|
-
|
|
290
|
+
// Invariant: reset forgets a paste being dropped, but a paste being inserted still completes.
|
|
291
|
+
if (this.options.pasteEnabled === false)
|
|
292
|
+
this.#paste.clear();
|
|
306
293
|
this.#selectionRevision += 1;
|
|
307
294
|
}
|
|
308
295
|
cancelPendingPastes() {
|
|
309
296
|
this.#pasteState.generation += 1;
|
|
310
297
|
this.#pasteState.preview = undefined;
|
|
311
|
-
this.#
|
|
312
|
-
DISABLED_TERMINAL_PASTES.delete(this);
|
|
298
|
+
this.#paste.clear();
|
|
313
299
|
}
|
|
314
300
|
hasSelection() {
|
|
315
301
|
return this.#activeRange() !== undefined;
|
|
@@ -485,61 +471,30 @@ class PromptSelectionInterceptor {
|
|
|
485
471
|
this.#requestRender();
|
|
486
472
|
}
|
|
487
473
|
#handleTerminalPaste(data, next) {
|
|
488
|
-
|
|
489
|
-
|
|
474
|
+
if (!this.#paste.open) {
|
|
475
|
+
const start = data.indexOf(PASTE_START);
|
|
490
476
|
if (start < 0)
|
|
491
477
|
return false;
|
|
492
478
|
if (start > 0) {
|
|
493
479
|
const before = data.slice(0, start);
|
|
494
480
|
this.handleInput(before, (replacement = before) => next(replacement));
|
|
495
481
|
}
|
|
496
|
-
|
|
497
|
-
data = data.slice(start + 6);
|
|
482
|
+
data = data.slice(start);
|
|
498
483
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
const fragment = pending.tail + data;
|
|
502
|
-
const end = fragment.indexOf("\x1b[201~");
|
|
503
|
-
const append = (part) => {
|
|
504
|
-
if (pending.oversized || part.length === 0)
|
|
505
|
-
return;
|
|
506
|
-
if (this.options.beginTextPaste !== undefined) {
|
|
507
|
-
pending.bytes += Buffer.byteLength(part);
|
|
508
|
-
if (pending.bytes > MAX_CLIPBOARD_TEXT_BYTES) {
|
|
509
|
-
pending.oversized = true;
|
|
510
|
-
pending.parts = [];
|
|
511
|
-
pending.piece = "";
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
// Performance: bound fragment metadata even if a terminal supplies one character per input chunk.
|
|
516
|
-
pending.piece += part;
|
|
517
|
-
if (pending.piece.length >= 16_384) {
|
|
518
|
-
pending.parts.push(pending.piece);
|
|
519
|
-
pending.piece = "";
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
if (end < 0) {
|
|
523
|
-
let cut = Math.max(0, fragment.length - 5);
|
|
524
|
-
if (cut > 0 && /[\uD800-\uDBFF]/u.test(fragment[cut - 1]) && /[\uDC00-\uDFFF]/u.test(fragment[cut]))
|
|
525
|
-
cut--;
|
|
526
|
-
append(fragment.slice(0, cut));
|
|
527
|
-
pending.tail = fragment.slice(cut);
|
|
484
|
+
const pasted = this.#paste.feed(data);
|
|
485
|
+
if (pasted === undefined)
|
|
528
486
|
return true;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
this.#terminalPaste = undefined;
|
|
533
|
-
if (pending.oversized) {
|
|
534
|
-
this.options.onPasteInput?.(pending.bytes, "framing");
|
|
487
|
+
const { remaining, bytes } = pasted;
|
|
488
|
+
if (pasted.oversized) {
|
|
489
|
+
this.options.onPasteInput?.(bytes, "framing");
|
|
535
490
|
this.options.onPasteRejected?.(new ImageAttachmentError("paste-size"));
|
|
536
491
|
if (remaining.length > 0)
|
|
537
492
|
this.handleInput(remaining, (replacement = remaining) => next(replacement));
|
|
538
493
|
return true;
|
|
539
494
|
}
|
|
540
|
-
const text =
|
|
495
|
+
const text = pasted.text;
|
|
541
496
|
const deferred = text.length > 0 && this.options.beginTextPaste !== undefined && (this.options.deferTextPaste?.(text) ?? true);
|
|
542
|
-
this.options.onPasteInput?.(
|
|
497
|
+
this.options.onPasteInput?.(bytes, "framing");
|
|
543
498
|
if (text.length > 0)
|
|
544
499
|
this.#redoStack = [];
|
|
545
500
|
if (text.length === 0)
|
|
@@ -547,7 +502,7 @@ class PromptSelectionInterceptor {
|
|
|
547
502
|
else if (deferred)
|
|
548
503
|
this.#pasteFromClipboard(text);
|
|
549
504
|
else {
|
|
550
|
-
this.options.onPasteInput?.(
|
|
505
|
+
this.options.onPasteInput?.(bytes, "inserting");
|
|
551
506
|
const transformed = this.options.transformPastedContent({ kind: "text", text });
|
|
552
507
|
if (transformed === text && this.#orderedSelection() === undefined)
|
|
553
508
|
next(`\x1b[200~${text}\x1b[201~`);
|
|
@@ -559,7 +514,7 @@ class PromptSelectionInterceptor {
|
|
|
559
514
|
this.#redoStack = [];
|
|
560
515
|
this.#requestRender();
|
|
561
516
|
}
|
|
562
|
-
this.options.onPasteInput?.(
|
|
517
|
+
this.options.onPasteInput?.(bytes, "settled");
|
|
563
518
|
}
|
|
564
519
|
if (remaining.length > 0)
|
|
565
520
|
this.handleInput(remaining, (replacement = remaining) => next(replacement));
|
|
@@ -835,14 +790,31 @@ class PromptSelectionInterceptor {
|
|
|
835
790
|
const line = editorState(this.editor).lines[position.line] ?? "";
|
|
836
791
|
return this.options.atomicRanges(line).find(range => position.col >= range.start && position.col < range.end);
|
|
837
792
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
793
|
+
// Compatibility: word-left steps over an atomic chip as one word, stops on a path boundary, and
|
|
794
|
+
// otherwise lands on the separator before the word, as pinned Pi's prompt editor does.
|
|
795
|
+
#moveWordLeft(next) {
|
|
796
|
+
const before = this.#cursor();
|
|
797
|
+
const startedWithAtomicFocus = this.#atomicFocus() !== undefined;
|
|
798
|
+
this.#delegateWord(-1, next);
|
|
799
|
+
let after = this.#cursor();
|
|
800
|
+
const landedAtomic = this.#atomicRangeAt(after);
|
|
801
|
+
if (!startedWithAtomicFocus && landedAtomic?.start === after.col && after.col > 0) {
|
|
802
|
+
const line = editorState(this.editor).lines[after.line] ?? "";
|
|
803
|
+
const previous = [...GRAPHEMES.segment(line.slice(0, after.col))].at(-1);
|
|
804
|
+
if (previous !== undefined && !/^\s+$/u.test(previous.segment)) {
|
|
805
|
+
this.#delegateWord(-1, next);
|
|
806
|
+
after = this.#cursor();
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
const line = editorState(this.editor).lines[after.line] ?? "";
|
|
810
|
+
const landedPath = promptPathWordRanges(line).some(range => range.start === after.col);
|
|
811
|
+
if (!samePosition(before, after) && !landedPath && after.col > 0) {
|
|
812
|
+
// Invariant: move onto the separator before the word, never past the line start.
|
|
813
|
+
const previous = [...GRAPHEMES.segment(line.slice(0, after.col))].at(-1);
|
|
814
|
+
if (previous !== undefined && /^\s+$/u.test(previous.segment))
|
|
815
|
+
this.#moveCursor(-1);
|
|
816
|
+
}
|
|
817
|
+
this.#requestRender();
|
|
846
818
|
}
|
|
847
819
|
#snapshot() {
|
|
848
820
|
return { text: this.editor.getText(), cursor: this.#cursor() };
|
|
@@ -981,72 +953,6 @@ function isEditorSegment(value) {
|
|
|
981
953
|
const input = Reflect.get(value, "input");
|
|
982
954
|
return typeof segment === "string" && typeof index === "number" && typeof input === "string";
|
|
983
955
|
}
|
|
984
|
-
const DISABLED_TERMINAL_PASTES = new WeakMap();
|
|
985
|
-
function discardTerminalPaste(owner, data, forward) {
|
|
986
|
-
const startMarker = "\x1b[200~";
|
|
987
|
-
const endMarker = "\x1b[201~";
|
|
988
|
-
const state = DISABLED_TERMINAL_PASTES.get(owner) ?? { startTail: "", bodyTail: null };
|
|
989
|
-
if (state.bodyTail !== null) {
|
|
990
|
-
const framed = state.bodyTail + data;
|
|
991
|
-
const end = framed.indexOf(endMarker);
|
|
992
|
-
if (end < 0) {
|
|
993
|
-
state.bodyTail = delimiterTail(framed, endMarker);
|
|
994
|
-
DISABLED_TERMINAL_PASTES.set(owner, state);
|
|
995
|
-
return true;
|
|
996
|
-
}
|
|
997
|
-
DISABLED_TERMINAL_PASTES.delete(owner);
|
|
998
|
-
const remaining = framed.slice(end + endMarker.length);
|
|
999
|
-
if (remaining.length > 0)
|
|
1000
|
-
forward(remaining);
|
|
1001
|
-
return true;
|
|
1002
|
-
}
|
|
1003
|
-
const hadStartTail = state.startTail.length > 0;
|
|
1004
|
-
const candidate = state.startTail + data;
|
|
1005
|
-
state.startTail = "";
|
|
1006
|
-
const start = candidate.indexOf(startMarker);
|
|
1007
|
-
if (start >= 0) {
|
|
1008
|
-
if (start > 0)
|
|
1009
|
-
forward(candidate.slice(0, start));
|
|
1010
|
-
const framed = candidate.slice(start + startMarker.length);
|
|
1011
|
-
const end = framed.indexOf(endMarker);
|
|
1012
|
-
if (end < 0) {
|
|
1013
|
-
state.bodyTail = delimiterTail(framed, endMarker);
|
|
1014
|
-
DISABLED_TERMINAL_PASTES.set(owner, state);
|
|
1015
|
-
}
|
|
1016
|
-
else {
|
|
1017
|
-
DISABLED_TERMINAL_PASTES.delete(owner);
|
|
1018
|
-
const remaining = framed.slice(end + endMarker.length);
|
|
1019
|
-
if (remaining.length > 0)
|
|
1020
|
-
forward(remaining);
|
|
1021
|
-
}
|
|
1022
|
-
return true;
|
|
1023
|
-
}
|
|
1024
|
-
const partial = delimiterTail(candidate, startMarker);
|
|
1025
|
-
// Compatibility: standalone Escape still cancels; marker fragments stay pending.
|
|
1026
|
-
if (partial.length > 1) {
|
|
1027
|
-
const before = candidate.slice(0, candidate.length - partial.length);
|
|
1028
|
-
if (before.length > 0)
|
|
1029
|
-
forward(before);
|
|
1030
|
-
state.startTail = partial;
|
|
1031
|
-
DISABLED_TERMINAL_PASTES.set(owner, state);
|
|
1032
|
-
return true;
|
|
1033
|
-
}
|
|
1034
|
-
DISABLED_TERMINAL_PASTES.delete(owner);
|
|
1035
|
-
if (hadStartTail) {
|
|
1036
|
-
forward(candidate);
|
|
1037
|
-
return true;
|
|
1038
|
-
}
|
|
1039
|
-
return false;
|
|
1040
|
-
}
|
|
1041
|
-
function delimiterTail(text, delimiter) {
|
|
1042
|
-
const limit = Math.min(text.length, delimiter.length - 1);
|
|
1043
|
-
for (let length = limit; length > 0; length -= 1) {
|
|
1044
|
-
const suffix = text.slice(text.length - length);
|
|
1045
|
-
if (delimiter.startsWith(suffix))
|
|
1046
|
-
return suffix;
|
|
1047
|
-
}
|
|
1048
|
-
return "";
|
|
1049
|
-
}
|
|
1050
956
|
export function editorInsertedText(data) {
|
|
1051
957
|
if (!data || data.includes("\u001b[200~"))
|
|
1052
958
|
return undefined;
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
readonly innerWidth: number;
|
|
4
|
-
readonly paddingX: number;
|
|
5
|
-
readonly contentWidth: number;
|
|
6
|
-
readonly layoutWidth: number;
|
|
7
|
-
}
|
|
8
|
-
export interface PiShellPromptInputBody {
|
|
9
|
-
readonly rows: readonly string[];
|
|
10
|
-
readonly topRule?: string | undefined;
|
|
11
|
-
readonly bottomRule?: string | undefined;
|
|
12
|
-
readonly after?: readonly string[];
|
|
13
|
-
readonly afterIndent?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface PiShellPromptInputPresentation {
|
|
16
|
-
geometry(width: number, padding?: number): PiShellPromptInputGeometry;
|
|
17
|
-
styleRule(text: string): string;
|
|
18
|
-
render(width: number, body: (innerWidth: number) => PiShellPromptInputBody, ruled?: boolean, padding?: number): string[];
|
|
19
|
-
}
|
|
1
|
+
import type { OwnedUiShellPromptInputPresentation } from "../../../contracts/owned-ui/index.js";
|
|
2
|
+
export type PiShellPromptInputPresentation = OwnedUiShellPromptInputPresentation;
|
|
@@ -151,5 +151,6 @@ export declare const BUILTIN_THEME_RESOURCES: Readonly<{
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
}>;
|
|
154
|
-
|
|
154
|
+
type BuiltinThemeName = keyof typeof BUILTIN_THEME_RESOURCES;
|
|
155
155
|
export declare function isBuiltinThemeName(name: string): name is BuiltinThemeName;
|
|
156
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type OwnedUiShellEditorOptions } from "../../../contracts/owned-ui/index.js";
|
|
2
|
+
import { type PiShellEditorPort } from "./shell-shared-facade.js";
|
|
2
3
|
export declare const PINNED_PI_BUILTIN_SLASH_COMMANDS: ({
|
|
3
4
|
readonly name: "thinking";
|
|
4
5
|
readonly description: "Set thinking level";
|
|
@@ -20,4 +21,4 @@ export declare const OWNED_BUILTIN_SLASH_COMMANDS: ({
|
|
|
20
21
|
name: string;
|
|
21
22
|
description: string;
|
|
22
23
|
})[];
|
|
23
|
-
export declare function createPiShellEditor(options:
|
|
24
|
+
export declare function createPiShellEditor(options: OwnedUiShellEditorOptions): PiShellEditorPort;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { OwnedUiShellKeybindings } from "../../../contracts/owned-ui/index.js";
|
|
1
2
|
import type { OwnedUiSessionViewModel } from "../../../contracts/owned-ui/index.js";
|
|
2
|
-
import { type KeybindingsConfig } from "./upstream/adjacent/core/keybindings.js";
|
|
3
3
|
import { type PiShellViewComponentPort, type PiShellStatusPort, type PiShellProgressStatusPresentation, type PiShellQueuedInputPort, type PiShellHeaderPort, type PiShellResourceEntry, type PiShellLoadedResourcesPort, type PiShellHeaderOptions, type PiShellEditorOptions } from "./shell-shared-facade.js";
|
|
4
4
|
export declare function createPiShellHeader(options?: PiShellHeaderOptions): PiShellHeaderPort;
|
|
5
5
|
export declare function createPiShellLoadedResources(resources: readonly PiShellResourceEntry[], initialExpanded?: boolean): PiShellLoadedResourcesPort;
|
|
6
6
|
export declare function createPiShellStatus(view: OwnedUiSessionViewModel, progressStatus: PiShellProgressStatusPresentation, runtime?: Pick<PiShellEditorOptions, "getColumns" | "getRows" | "requestRender">): PiShellStatusPort;
|
|
7
7
|
export declare function createPiShellFooter(view: OwnedUiSessionViewModel, cwd: string, profile?: "pi" | "a1", showLevel?: () => boolean): PiShellViewComponentPort;
|
|
8
|
-
export declare function createPiQueuedInputStatus(submissions: readonly string[], presentation?: "pinned" | "custom-viewport", getKeybindings?: () =>
|
|
8
|
+
export declare function createPiQueuedInputStatus(submissions: readonly string[], presentation?: "pinned" | "custom-viewport", getKeybindings?: () => OwnedUiShellKeybindings): PiShellQueuedInputPort;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { piKeybindings } from "./shell-shared-facade.js";
|
|
1
2
|
import { rawKeyHint, VERSION } from "../startup-public.js";
|
|
2
3
|
import { Spacer, Text, } from "@earendil-works/pi-tui";
|
|
3
4
|
import { SessionFooter } from "./upstream/components/session-footer.js";
|
|
@@ -263,7 +264,7 @@ function queuedInputText(submissions, presentation, bindings) {
|
|
|
263
264
|
return submissions.map(submission => theme.fg("muted", `Steering: ${submission.replaceAll("\n", " ⏎ ")}`)).join("\n");
|
|
264
265
|
}
|
|
265
266
|
const messages = submissions.map(submission => theme.fg("dim", `Steering: ${submission.replaceAll("\n", " ⏎ ")}`));
|
|
266
|
-
const keys = KeybindingsManager.fromOwnedBindings(bindings).getKeys("app.message.dequeue");
|
|
267
|
+
const keys = KeybindingsManager.fromOwnedBindings(piKeybindings(bindings)).getKeys("app.message.dequeue");
|
|
267
268
|
const label = keys.length === 0 ? "Unbound" : keys.map(displayKeybinding).join("/");
|
|
268
269
|
const dequeueHint = theme.fg("dim", `↳ ${label} to edit all queued messages`);
|
|
269
270
|
// Compatibility: the custom viewport matches Pi's interactive queue presentation while the
|
|
@@ -290,7 +291,7 @@ function compactHeaderText() {
|
|
|
290
291
|
return `${headerWithLogo(instructions)}\n${compactOnboarding}\n\n${onboarding}`;
|
|
291
292
|
}
|
|
292
293
|
function expandedHeaderText(bindings) {
|
|
293
|
-
const keys = bindings === undefined ? undefined : KeybindingsManager.fromOwnedBindings(bindings);
|
|
294
|
+
const keys = bindings === undefined ? undefined : KeybindingsManager.fromOwnedBindings(piKeybindings(bindings));
|
|
294
295
|
const instructions = [
|
|
295
296
|
rawKeyHint("escape", "to interrupt"),
|
|
296
297
|
rawKeyHint("ctrl+c", "to clear"),
|