@timurproko/a1 0.1.8-dev.472 → 0.1.8-dev.508
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/cli.js +4 -5
- package/bin/guardian.js +5 -1
- package/bin/module-identity.js +53 -98
- package/bin/module-resolver.js +138 -0
- package/bin/pinned-pi-public.js +25 -6
- package/bin/ui.js +7 -2
- package/bin/update-recovery.js +76 -7
- package/bin/warmup.js +3 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-diagnostics.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-image.js +1 -1
- package/dist/app/session-shell/helper-pool.d.ts +33 -0
- package/dist/app/session-shell/helper-pool.js +98 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation-client.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation-client.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-source.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-worker.js +1 -1
- package/dist/app/session-shell/index.d.ts +7 -0
- package/dist/app/session-shell/index.js +4 -0
- package/dist/app/session-shell/paste-executor.d.ts +18 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-executor.js +50 -29
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-helper.js +1 -1
- package/dist/app/session-shell/paste-preparation-client.d.ts +31 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-preparation-client.js +19 -8
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-protocol.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-protocol.js +1 -1
- package/dist/app/session-shell/paste-text-preparation.d.ts +6 -0
- package/dist/{integrations/pi/session-ui/paste-text-preparation.d.ts → app/session-shell/paste-types.d.ts} +1 -4
- package/dist/{integrations/pi/session-ui → app/session-shell}/path-chip-presentation.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-chips.d.ts +5 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-chips.js +6 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-history-controller.d.ts +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-history-controller.js +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-suggestion-controller.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-suggestion-controller.js +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-coordinator.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-coordinator.js +3 -5
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-helper.js +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-protocol.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-transport.d.ts +10 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-transport.js +45 -19
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell-root.d.ts +75 -53
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell-root.js +30 -20
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell.d.ts +9 -8
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell.js +108 -67
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-viewport-controller.d.ts +5 -5
- package/dist/{integrations/pi/session-ui → app/session-shell}/session-viewport-controller.js +5 -5
- package/dist/{integrations/pi/session-ui → app/session-shell}/system-clipboard.d.ts +1 -1
- package/dist/{integrations/pi/session-ui → app/session-shell}/system-clipboard.js +1 -1
- package/dist/cli/index.d.ts +8 -5
- package/dist/cli/index.js +4 -5
- package/dist/composition/index.d.ts +0 -1
- package/dist/composition/index.js +0 -1
- package/dist/composition/owned-ui.d.ts +2 -2
- package/dist/composition/owned-ui.js +35 -36
- package/dist/composition/settings-route-host.d.ts +2 -2
- package/dist/contracts/agent-engine/domain.d.ts +6 -1
- package/dist/contracts/agent-engine/index.d.ts +11 -8
- package/dist/contracts/agent-engine/index.js +6 -8
- package/dist/contracts/owned-ui/extension-ui.d.ts +8 -0
- package/dist/contracts/owned-ui/index.d.ts +12 -8
- package/dist/contracts/owned-ui/index.js +8 -8
- package/dist/features/launch/index.d.ts +12 -6
- package/dist/features/launch/index.js +6 -6
- package/dist/features/launch/intent.d.ts +5 -5
- package/dist/features/launch/intent.js +2 -2
- package/dist/features/owned-ui/index.d.ts +6 -6
- package/dist/features/owned-ui/index.js +4 -6
- package/dist/features/owned-ui/run.d.ts +2 -2
- package/dist/features/owned-ui/settings-app.d.ts +2 -2
- package/dist/features/owned-ui/settings-app.js +18 -5
- package/dist/features/prompt-history/service.d.ts +1 -1
- package/dist/features/prompt-history/service.js +1 -1
- package/dist/features/prompt-history/store.js +3 -7
- package/dist/features/prompt-suggestions/diagnostics.js +1 -1
- package/dist/features/prompt-suggestions/index.d.ts +2 -1
- package/dist/features/prompt-suggestions/index.js +1 -1
- package/dist/foundation/launch-guardian/index.d.ts +2 -1
- package/dist/foundation/launch-guardian/index.js +1 -1
- package/dist/foundation/lifecycle/index.d.ts +11 -6
- package/dist/foundation/lifecycle/index.js +5 -6
- package/dist/foundation/process-containment/index.d.ts +8 -6
- package/dist/foundation/process-containment/index.js +6 -6
- package/dist/foundation/process-containment/native-guardian-containment.js +3 -3
- package/dist/foundation/protocol/index.d.ts +3 -2
- package/dist/foundation/protocol/index.js +2 -2
- package/dist/foundation/release/bootstrap.d.ts +0 -4
- package/dist/foundation/release/bootstrap.js +1 -82
- package/dist/foundation/release/dependency-layer.d.ts +2 -5
- package/dist/foundation/release/endpoints.d.ts +4 -0
- package/dist/foundation/release/endpoints.js +86 -2
- package/dist/foundation/release/index.d.ts +30 -16
- package/dist/foundation/release/index.js +16 -16
- package/dist/foundation/release/release.d.ts +1 -1
- package/dist/foundation/release/types.d.ts +11 -0
- package/dist/foundation/release/types.js +1 -0
- package/dist/foundation/release/update-transaction.d.ts +1 -1
- package/dist/foundation/release/update.d.ts +2 -1
- package/dist/foundation/release/update.js +3 -18
- package/dist/foundation/startup/index.d.ts +4 -2
- package/dist/foundation/startup/index.js +2 -2
- package/dist/foundation/startup/startup-descriptor.js +2 -2
- package/dist/foundation/storage/control-store.d.ts +1 -45
- package/dist/foundation/storage/control-store.js +54 -277
- package/dist/foundation/storage/index.d.ts +1 -1
- package/dist/foundation/storage/index.js +1 -1
- package/dist/foundation/supervision/index.d.ts +2 -2
- package/dist/foundation/supervision/index.js +2 -2
- package/dist/foundation/supervision/server.d.ts +5 -10
- package/dist/foundation/supervision/server.js +7 -7
- package/dist/foundation/terminal-cleanup/index.d.ts +3 -2
- package/dist/foundation/terminal-cleanup/index.js +2 -2
- package/dist/integrations/pi/components/editor-interaction.d.ts +1 -1
- package/dist/integrations/pi/components/history-editor-loader.d.ts +1 -1
- package/dist/integrations/pi/components/index.d.ts +20 -13
- package/dist/integrations/pi/components/index.js +12 -13
- package/dist/integrations/pi/components/owned-editor-ux.js +5 -8
- package/dist/integrations/pi/components/resources/builtin-themes.d.ts +7 -5
- package/dist/integrations/pi/components/resources/builtin-themes.js +7 -5
- package/dist/integrations/pi/components/shell-editor-autocomplete.js +1 -1
- package/dist/integrations/pi/components/shell-extension-ui.js +2 -1
- package/dist/integrations/pi/components/shell-footer-status.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +1 -1
- package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
- package/dist/integrations/pi/components/shell-presenters-transcript.js +1 -1
- package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +9 -3
- package/dist/integrations/pi/components/shell-selectors-dialogs.js +9 -6
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +3 -1
- package/dist/integrations/pi/components/shell-shared-facade.js +4 -2
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +1 -1
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +1 -1
- package/dist/integrations/pi/components/tool-image-presentation.d.ts +1 -1
- package/dist/integrations/pi/components/tool-image-presentation.js +4 -7
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +36 -22
- package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +43 -7
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
- package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +6 -3
- package/dist/integrations/pi/components/upstream/components/daxnuts.d.ts +8 -1
- package/dist/integrations/pi/components/upstream/components/daxnuts.js +7 -3
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +10 -4
- package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +7 -4
- package/dist/integrations/pi/components/upstream/components/extension-editor.js +7 -4
- package/dist/integrations/pi/components/upstream/components/mermaid.js +8 -4
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +9 -5
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +10 -6
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +8 -4
- package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +27 -25
- package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/session-footer.js +8 -10
- package/dist/integrations/pi/components/upstream/components/session-selector-search.js +6 -4
- package/dist/integrations/pi/components/upstream/components/session-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/session-selector.js +8 -4
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +7 -5
- package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +8 -6
- package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +9 -4
- package/dist/integrations/pi/components/upstream/components/status-indicator.js +15 -5
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +8 -2
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +58 -37
- package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +7 -4
- package/dist/integrations/pi/components/upstream/components/tree-selector.js +7 -4
- package/dist/integrations/pi/components/upstream/components/trust-selector.d.ts +1 -1
- package/dist/integrations/pi/components/upstream/components/trust-selector.js +10 -5
- package/dist/integrations/pi/components/upstream/external-editor.js +8 -4
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +13 -4
- package/dist/integrations/pi/components/upstream/history/editor-core.js +112 -30
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +6 -3
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +6 -3
- package/dist/integrations/pi/components/upstream/history/printable-key.js +7 -4
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +6 -3
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +6 -3
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +6 -3
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +6 -3
- package/dist/integrations/pi/components/upstream/model-search.d.ts +5 -2
- package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +8 -0
- package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -3
- package/dist/integrations/pi/components/upstream/theme/theme.d.ts +2 -2
- package/dist/integrations/pi/components/upstream/theme/theme.js +17 -6
- package/dist/integrations/pi/engine/adapter.d.ts +39 -138
- package/dist/integrations/pi/engine/adapter.js +338 -3226
- package/dist/integrations/pi/engine/command-dispatch.d.ts +41 -0
- package/dist/integrations/pi/engine/command-dispatch.js +125 -0
- package/dist/integrations/pi/engine/event-delivery.d.ts +100 -0
- package/dist/integrations/pi/engine/event-delivery.js +184 -0
- package/dist/integrations/pi/engine/extension-ui-binding.d.ts +35 -0
- package/dist/integrations/pi/engine/extension-ui-binding.js +81 -0
- package/dist/integrations/pi/engine/index.d.ts +18 -14
- package/dist/integrations/pi/engine/index.js +10 -14
- package/dist/integrations/pi/engine/message-values.d.ts +29 -0
- package/dist/integrations/pi/engine/message-values.js +168 -0
- package/dist/integrations/pi/engine/pending-delivery.d.ts +2 -2
- package/dist/integrations/pi/engine/pending-delivery.js +2 -4
- package/dist/integrations/pi/engine/pi-settings-metadata.json +382 -371
- package/dist/integrations/pi/engine/prompt-suggestions.d.ts +30 -0
- package/dist/integrations/pi/engine/prompt-suggestions.js +102 -0
- package/dist/integrations/pi/engine/provider-authentication.d.ts +34 -0
- package/dist/integrations/pi/engine/provider-authentication.js +209 -0
- package/dist/integrations/pi/engine/resource-catalog.d.ts +49 -0
- package/dist/integrations/pi/engine/resource-catalog.js +289 -0
- package/dist/integrations/pi/engine/resources/changelog.json +4 -4
- package/dist/integrations/pi/engine/session-events.d.ts +48 -0
- package/dist/integrations/pi/engine/session-events.js +223 -0
- package/dist/integrations/pi/engine/session-integration.js +2 -4
- package/dist/integrations/pi/engine/session-runtime.d.ts +84 -0
- package/dist/integrations/pi/engine/session-runtime.js +249 -0
- package/dist/integrations/pi/engine/{settings-effects.d.ts → settings-bridge.d.ts} +57 -2
- package/dist/integrations/pi/engine/settings-bridge.js +514 -0
- package/dist/integrations/pi/engine/settings-metadata.d.ts +31 -0
- package/dist/integrations/pi/engine/settings-metadata.js +67 -0
- package/dist/integrations/pi/engine/settings-port.d.ts +42 -0
- package/dist/integrations/pi/engine/settings-port.js +353 -0
- package/dist/integrations/pi/engine/transcript-projection.d.ts +39 -0
- package/dist/integrations/pi/engine/transcript-projection.js +405 -0
- package/dist/integrations/pi/engine/usage-view.d.ts +4 -0
- package/dist/integrations/pi/engine/usage-view.js +56 -0
- package/dist/integrations/pi/engine/workflow-contexts.d.ts +59 -0
- package/dist/integrations/pi/engine/workflow-contexts.js +316 -0
- package/dist/integrations/pi/engine/workflow-runner.d.ts +60 -0
- package/dist/integrations/pi/engine/workflow-runner.js +509 -0
- package/dist/integrations/pi/engine/workflow-support.d.ts +33 -0
- package/dist/integrations/pi/engine/workflow-support.js +352 -0
- package/dist/integrations/pi/engine/workflows.d.ts +63 -2
- package/dist/integrations/pi/engine/workflows.js +5 -2
- package/dist/integrations/pi/startup-public.js +576 -554
- package/dist/integrations/pi/startup-public.manifest.json +1730 -984
- package/dist/integrations/pi/tui-runtime/adapter.js +10 -13
- package/dist/integrations/pi/tui-runtime/contracts.d.ts +11 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +4 -7
- package/dist/integrations/pi/tui-runtime/index.d.ts +8 -6
- package/dist/integrations/pi/tui-runtime/index.js +4 -6
- package/dist/integrations/pi/tui-runtime/mouse-report-input.js +2 -4
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +2 -2
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +4 -5
- package/dist/integrations/pi/tui-runtime/presentation-adapter.js +1 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +1 -1
- package/dist/native/win32-x64/manifest.json +2 -2
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/runtime-payload-inventory.json +51320 -46509
- package/dist/ui/apps/index.d.ts +5 -3
- package/dist/ui/apps/index.js +3 -3
- package/dist/ui/components/index.d.ts +47 -25
- package/dist/ui/components/index.js +25 -25
- package/dist/ui/components/prompt-input.js +1 -4
- package/dist/ui/settings/declarations.d.ts +119 -0
- package/dist/ui/settings/declarations.js +20 -11
- package/dist/ui/settings/index.d.ts +10 -6
- package/dist/ui/settings/index.js +5 -6
- package/dist/ui/settings/manager.d.ts +54 -0
- package/dist/ui/settings/{session.js → manager.js} +101 -9
- package/dist/ui/settings/sections.d.ts +2 -7
- package/docs/architecture/boundaries.md +4 -4
- package/docs/architecture/history-editor-provenance.md +1 -1
- package/docs/architecture/project-structure.md +6 -6
- package/docs/architecture/prompt-suggestions.md +1 -1
- package/docs/architecture/terminal-host-proof-gate.md +1 -1
- package/docs/architecture/terminal-host-spike-evidence.md +1 -1
- package/docs/architecture/toolchain.md +8 -0
- package/docs/architecture/ui-reference-provenance.md +4 -4
- package/docs/ci-release-runbook.md +7 -1
- package/docs/features/modal-content-interaction.md +2 -2
- package/docs/local-worktree-cleanup.md +4 -2
- package/docs/validation.md +6 -4
- package/package.json +7 -11
- package/bin/pi-tui.d.ts +0 -6
- package/bin/pi-tui.js +0 -28
- package/bin/sync-pi-tui-proxy.js +0 -97
- package/dist/cli/version.d.ts +0 -2
- package/dist/cli/version.js +0 -23
- package/dist/composition/agent-engine-bridge.d.ts +0 -3
- package/dist/composition/agent-engine-bridge.js +0 -108
- package/dist/composition/process.d.ts +0 -16
- package/dist/composition/process.js +0 -45
- package/dist/contracts/workspace/index.d.ts +0 -2
- package/dist/contracts/workspace/index.js +0 -2
- package/dist/contracts/workspace/model.d.ts +0 -248
- package/dist/contracts/workspace/model.js +0 -2
- package/dist/contracts/workspace/validation.d.ts +0 -13
- package/dist/contracts/workspace/validation.js +0 -335
- package/dist/features/owned-ui/customization.d.ts +0 -40
- package/dist/features/owned-ui/customization.js +0 -110
- package/dist/features/owned-ui/diagnostics.d.ts +0 -34
- package/dist/features/owned-ui/diagnostics.js +0 -95
- package/dist/features/workspace/capabilities.d.ts +0 -31
- package/dist/features/workspace/capabilities.js +0 -75
- package/dist/features/workspace/index.d.ts +0 -6
- package/dist/features/workspace/index.js +0 -6
- package/dist/features/workspace/presentation.d.ts +0 -30
- package/dist/features/workspace/presentation.js +0 -70
- package/dist/features/workspace/reconciliation.d.ts +0 -15
- package/dist/features/workspace/reconciliation.js +0 -82
- package/dist/features/workspace/reducer.d.ts +0 -43
- package/dist/features/workspace/reducer.js +0 -214
- package/dist/features/workspace/router.d.ts +0 -32
- package/dist/features/workspace/router.js +0 -125
- package/dist/features/workspace/store.d.ts +0 -18
- package/dist/features/workspace/store.js +0 -55
- package/dist/foundation/native-host-protocol/codec.d.ts +0 -13
- package/dist/foundation/native-host-protocol/codec.js +0 -58
- package/dist/foundation/native-host-protocol/evidence.d.ts +0 -67
- package/dist/foundation/native-host-protocol/evidence.js +0 -141
- package/dist/foundation/native-host-protocol/index.d.ts +0 -4
- package/dist/foundation/native-host-protocol/index.js +0 -4
- package/dist/foundation/native-host-protocol/messages.d.ts +0 -56
- package/dist/foundation/native-host-protocol/messages.js +0 -149
- package/dist/foundation/native-host-protocol/proof-gate.d.ts +0 -13
- package/dist/foundation/native-host-protocol/proof-gate.js +0 -33
- package/dist/foundation/structured-agent-runtime/backpressure.d.ts +0 -47
- package/dist/foundation/structured-agent-runtime/backpressure.js +0 -119
- package/dist/foundation/structured-agent-runtime/commands.d.ts +0 -53
- package/dist/foundation/structured-agent-runtime/commands.js +0 -165
- package/dist/foundation/structured-agent-runtime/handshake.d.ts +0 -41
- package/dist/foundation/structured-agent-runtime/handshake.js +0 -151
- package/dist/foundation/structured-agent-runtime/index.d.ts +0 -5
- package/dist/foundation/structured-agent-runtime/index.js +0 -5
- package/dist/foundation/structured-agent-runtime/reconnection.d.ts +0 -38
- package/dist/foundation/structured-agent-runtime/reconnection.js +0 -130
- package/dist/foundation/structured-agent-runtime/state.d.ts +0 -57
- package/dist/foundation/structured-agent-runtime/state.js +0 -119
- package/dist/integrations/pi/components/upstream/components/custom-entry.d.ts +0 -17
- package/dist/integrations/pi/components/upstream/components/custom-entry.js +0 -51
- package/dist/integrations/pi/components/upstream/components/first-time-setup.d.ts +0 -24
- package/dist/integrations/pi/components/upstream/components/first-time-setup.js +0 -105
- package/dist/integrations/pi/components/upstream/components/markdown-transform.d.ts +0 -2
- package/dist/integrations/pi/components/upstream/components/markdown-transform.js +0 -18
- package/dist/integrations/pi/engine/model-auth-integration.d.ts +0 -31
- package/dist/integrations/pi/engine/model-auth-integration.js +0 -62
- package/dist/integrations/pi/engine/resource-extension-integration.d.ts +0 -32
- package/dist/integrations/pi/engine/resource-extension-integration.js +0 -81
- package/dist/integrations/pi/engine/settings-effects.js +0 -249
- package/dist/integrations/pi/engine/settings-integration.d.ts +0 -43
- package/dist/integrations/pi/engine/settings-integration.js +0 -227
- package/dist/integrations/pi/engine/workflow-controllers.d.ts +0 -21
- package/dist/integrations/pi/engine/workflow-controllers.js +0 -49
- package/dist/integrations/pi/session-ui/index.d.ts +0 -5
- package/dist/integrations/pi/session-ui/index.js +0 -5
- package/dist/integrations/pi/session-ui/paste-executor.d.ts +0 -10
- package/dist/integrations/pi/session-ui/paste-preparation-client.d.ts +0 -16
- package/dist/integrations/pi/session-ui/route-host.d.ts +0 -5
- package/dist/integrations/pi/tui-runtime/conformance.d.ts +0 -18
- package/dist/integrations/pi/tui-runtime/conformance.js +0 -145
- package/dist/ui/components/prompt-row.d.ts +0 -14
- package/dist/ui/components/prompt-row.js +0 -20
- package/dist/ui/settings/session.d.ts +0 -36
- package/dist/ui/settings/store.d.ts +0 -29
- package/dist/ui/settings/store.js +0 -91
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-diagnostics.js +2 -2
- package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-image.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/editor-hyperlink-budget.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/editor-hyperlink-budget.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-source.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/image-worker.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-helper.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-preparation.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-worker.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-worker.js +0 -0
- package/dist/{integrations/pi/session-ui/response-copy-helper.d.ts → app/session-shell/paste-types.js} +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/path-chip-presentation.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro-effects.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro-effects.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro.d.ts +0 -0
- package/dist/{integrations/pi/session-ui/route-host.js → app/session-shell/response-copy-helper.d.ts} +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-protocol.js +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/stream-presentation-coalescer.d.ts +0 -0
- package/dist/{integrations/pi/session-ui → app/session-shell}/stream-presentation-coalescer.js +3 -3
- /package/dist/{integrations/pi/session-ui → app/session-shell}/text-paste.d.ts +0 -0
- /package/dist/{integrations/pi/session-ui → app/session-shell}/text-paste.js +0 -0
|
@@ -1,24 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* commit 914cf1472e715297caa30db4b9535d534a9eb718:
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
4
3
|
* packages/coding-agent/src/modes/interactive/components/tool-execution.ts.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Modifications: Retain pinned shell and actual public tool-definition renderers. Replace private
|
|
5
|
+
* index-keyed image conversion with current-source ownership, serial conversion, visible fallback, and
|
|
6
|
+
* disposal; guard reentrant invalidation. Remap private types, definition factories, theme, and
|
|
7
|
+
* generic text helpers to public or locally attributed equivalents. See
|
|
8
|
+
* docs/architecture/tool-image-presentation.md.
|
|
9
|
+
* Deviations: current-tool-image-conversion-ownership.
|
|
9
10
|
*/
|
|
10
11
|
import { stripVTControlCharacters } from "node:util";
|
|
11
|
-
import { Box, Container, getCapabilities, getImageDimensions, imageFallback, Spacer, Text } from "
|
|
12
|
+
import { Box, Container, getCapabilities, getImageDimensions, imageFallback, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
|
|
12
13
|
import { createReadToolDefinition, createBashToolDefinition, createEditToolDefinition, createWriteToolDefinition, createGrepToolDefinition, createFindToolDefinition, createLsToolDefinition, keyHint, } from "../../../startup-public.js";
|
|
13
14
|
import { piTheme } from "../theme/theme.js";
|
|
14
15
|
import { ToolImagePresentation } from "../../tool-image-presentation.js";
|
|
16
|
+
/** The caller-side merge 0.85.1 performs before handing a definition to the component: built-in renderers fill the gaps. */
|
|
17
|
+
export function mergeBuiltInRenderers(definition, builtIn) {
|
|
18
|
+
if (definition === undefined)
|
|
19
|
+
return builtIn;
|
|
20
|
+
if (builtIn === undefined)
|
|
21
|
+
return definition;
|
|
22
|
+
const merged = { ...definition };
|
|
23
|
+
if (definition.renderCall === undefined && builtIn.renderCall !== undefined)
|
|
24
|
+
merged.renderCall = builtIn.renderCall;
|
|
25
|
+
if (definition.renderResult === undefined && builtIn.renderResult !== undefined)
|
|
26
|
+
merged.renderResult = builtIn.renderResult;
|
|
27
|
+
return merged;
|
|
28
|
+
}
|
|
15
29
|
const definitions = { read: createReadToolDefinition, bash: createBashToolDefinition, edit: createEditToolDefinition,
|
|
16
30
|
write: createWriteToolDefinition, grep: createGrepToolDefinition, find: createFindToolDefinition, ls: createLsToolDefinition };
|
|
17
31
|
const FALLBACK_PREVIEW_LINES = 10;
|
|
18
32
|
export class ToolExecutionComponent extends Container {
|
|
19
33
|
contentBox;
|
|
20
34
|
contentText;
|
|
35
|
+
contentTextRegion;
|
|
21
36
|
selfRenderContainer;
|
|
37
|
+
selfRenderHeight = 0;
|
|
22
38
|
callRendererComponent;
|
|
23
39
|
resultRendererComponent;
|
|
24
40
|
rendererState = {};
|
|
@@ -47,9 +63,11 @@ export class ToolExecutionComponent extends Container {
|
|
|
47
63
|
this.toolName = toolName;
|
|
48
64
|
this.toolCallId = toolCallId;
|
|
49
65
|
this.args = args;
|
|
50
|
-
this.toolDefinition = toolDefinition;
|
|
51
66
|
this.builtInToolDefinition = Object.hasOwn(definitions, toolName)
|
|
52
67
|
? definitions[toolName](cwd) : undefined;
|
|
68
|
+
// Rationale: 0.85.1 moved the built-in renderer fallback to the caller; A1 keeps it here so every caller of
|
|
69
|
+
// the owned component gets the built-in edit/read/bash renderers without reaching into the tool registry.
|
|
70
|
+
this.toolDefinition = mergeBuiltInRenderers(toolDefinition, this.builtInToolDefinition);
|
|
53
71
|
this.showImages = options.showImages ?? true;
|
|
54
72
|
this.imageWidthCells = options.imageWidthCells ?? 60;
|
|
55
73
|
this.ui = ui;
|
|
@@ -66,44 +84,27 @@ export class ToolExecutionComponent extends Container {
|
|
|
66
84
|
// contentText is reserved for generic fallback rendering when no tool definition exists.
|
|
67
85
|
this.contentBox = new Box(1, 1, (text) => piTheme().bg("toolPendingBg", text));
|
|
68
86
|
this.contentText = new Text("", 1, 1, (text) => piTheme().bg("toolPendingBg", text));
|
|
87
|
+
this.contentTextRegion = this.createResultRegion(this.contentText);
|
|
69
88
|
this.selfRenderContainer = new Container();
|
|
70
89
|
if (this.hasRendererDefinition()) {
|
|
71
90
|
this.addChild(this.getRenderShell() === "self" ? this.selfRenderContainer : this.contentBox);
|
|
72
91
|
}
|
|
73
92
|
else {
|
|
74
|
-
this.addChild(this.
|
|
93
|
+
this.addChild(this.contentTextRegion);
|
|
75
94
|
}
|
|
76
95
|
this.updateDisplay();
|
|
77
96
|
}
|
|
78
97
|
getCallRenderer() {
|
|
79
|
-
|
|
80
|
-
return this.toolDefinition?.renderCall;
|
|
81
|
-
}
|
|
82
|
-
if (!this.toolDefinition) {
|
|
83
|
-
return this.builtInToolDefinition.renderCall;
|
|
84
|
-
}
|
|
85
|
-
return this.toolDefinition.renderCall ?? this.builtInToolDefinition.renderCall;
|
|
98
|
+
return this.toolDefinition?.renderCall;
|
|
86
99
|
}
|
|
87
100
|
getResultRenderer() {
|
|
88
|
-
|
|
89
|
-
return this.toolDefinition?.renderResult;
|
|
90
|
-
}
|
|
91
|
-
if (!this.toolDefinition) {
|
|
92
|
-
return this.builtInToolDefinition.renderResult;
|
|
93
|
-
}
|
|
94
|
-
return this.toolDefinition.renderResult ?? this.builtInToolDefinition.renderResult;
|
|
101
|
+
return this.toolDefinition?.renderResult;
|
|
95
102
|
}
|
|
96
103
|
hasRendererDefinition() {
|
|
97
|
-
return this.
|
|
104
|
+
return this.toolDefinition !== undefined;
|
|
98
105
|
}
|
|
99
106
|
getRenderShell() {
|
|
100
|
-
|
|
101
|
-
return this.toolDefinition?.renderShell ?? "default";
|
|
102
|
-
}
|
|
103
|
-
if (!this.toolDefinition) {
|
|
104
|
-
return this.builtInToolDefinition.renderShell ?? "default";
|
|
105
|
-
}
|
|
106
|
-
return this.toolDefinition.renderShell ?? this.builtInToolDefinition.renderShell ?? "default";
|
|
107
|
+
return this.toolDefinition?.renderShell ?? "default";
|
|
107
108
|
}
|
|
108
109
|
getRenderContext(lastComponent) {
|
|
109
110
|
return {
|
|
@@ -145,6 +146,14 @@ export class ToolExecutionComponent extends Container {
|
|
|
145
146
|
}
|
|
146
147
|
return new Text(text, 0, 0);
|
|
147
148
|
}
|
|
149
|
+
createResultRegion(component) {
|
|
150
|
+
return new MouseRegion(component, (event) => {
|
|
151
|
+
if (!this.result || event.type !== "click" || event.button !== "left")
|
|
152
|
+
return undefined;
|
|
153
|
+
this.setExpanded(!this.expanded);
|
|
154
|
+
return { handled: true };
|
|
155
|
+
});
|
|
156
|
+
}
|
|
148
157
|
updateArgs(args) {
|
|
149
158
|
this.args = args;
|
|
150
159
|
this.updateDisplay();
|
|
@@ -198,6 +207,7 @@ export class ToolExecutionComponent extends Container {
|
|
|
198
207
|
}
|
|
199
208
|
if (this.hasRendererDefinition() && this.getRenderShell() === "self") {
|
|
200
209
|
const contentLines = this.selfRenderContainer.render(width);
|
|
210
|
+
this.selfRenderHeight = contentLines.length;
|
|
201
211
|
if (contentLines.length === 0 && this.imageComponents.length === 0) {
|
|
202
212
|
return [];
|
|
203
213
|
}
|
|
@@ -220,6 +230,17 @@ export class ToolExecutionComponent extends Container {
|
|
|
220
230
|
}
|
|
221
231
|
return super.render(width);
|
|
222
232
|
}
|
|
233
|
+
handleMouse(event) {
|
|
234
|
+
if (!this.hasRendererDefinition() || this.getRenderShell() !== "self")
|
|
235
|
+
return super.handleMouse(event);
|
|
236
|
+
if (event.y <= 0 || event.y > this.selfRenderHeight)
|
|
237
|
+
return undefined;
|
|
238
|
+
return this.selfRenderContainer.handleMouse({
|
|
239
|
+
...event,
|
|
240
|
+
y: event.y - 1,
|
|
241
|
+
height: this.selfRenderHeight,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
223
244
|
updateDisplay() {
|
|
224
245
|
if (this.disposed || this.updatingDisplay)
|
|
225
246
|
return;
|
|
@@ -248,19 +269,19 @@ export class ToolExecutionComponent extends Container {
|
|
|
248
269
|
renderContainer.clear();
|
|
249
270
|
const callRenderer = this.getCallRenderer();
|
|
250
271
|
if (!callRenderer) {
|
|
251
|
-
renderContainer.addChild(this.createCallFallback());
|
|
272
|
+
renderContainer.addChild(this.createResultRegion(this.createCallFallback()));
|
|
252
273
|
hasContent = true;
|
|
253
274
|
}
|
|
254
275
|
else {
|
|
255
276
|
try {
|
|
256
277
|
const component = callRenderer(this.args, theme, this.getRenderContext(this.callRendererComponent));
|
|
257
278
|
this.callRendererComponent = component;
|
|
258
|
-
renderContainer.addChild(component);
|
|
279
|
+
renderContainer.addChild(this.createResultRegion(component));
|
|
259
280
|
hasContent = true;
|
|
260
281
|
}
|
|
261
282
|
catch {
|
|
262
283
|
this.callRendererComponent = undefined;
|
|
263
|
-
renderContainer.addChild(this.createCallFallback());
|
|
284
|
+
renderContainer.addChild(this.createResultRegion(this.createCallFallback()));
|
|
264
285
|
hasContent = true;
|
|
265
286
|
}
|
|
266
287
|
}
|
|
@@ -269,7 +290,7 @@ export class ToolExecutionComponent extends Container {
|
|
|
269
290
|
if (!resultRenderer) {
|
|
270
291
|
const component = this.createResultFallback();
|
|
271
292
|
if (component) {
|
|
272
|
-
renderContainer.addChild(component);
|
|
293
|
+
renderContainer.addChild(this.createResultRegion(component));
|
|
273
294
|
hasContent = true;
|
|
274
295
|
}
|
|
275
296
|
}
|
|
@@ -277,14 +298,14 @@ export class ToolExecutionComponent extends Container {
|
|
|
277
298
|
try {
|
|
278
299
|
const component = resultRenderer({ content: this.result.content, details: this.result.details }, { expanded: this.expanded, isPartial: this.isPartial }, theme, this.getRenderContext(this.resultRendererComponent));
|
|
279
300
|
this.resultRendererComponent = component;
|
|
280
|
-
renderContainer.addChild(component);
|
|
301
|
+
renderContainer.addChild(this.createResultRegion(component));
|
|
281
302
|
hasContent = true;
|
|
282
303
|
}
|
|
283
304
|
catch {
|
|
284
305
|
this.resultRendererComponent = undefined;
|
|
285
306
|
const component = this.createResultFallback();
|
|
286
307
|
if (component) {
|
|
287
|
-
renderContainer.addChild(component);
|
|
308
|
+
renderContainer.addChild(this.createResultRegion(component));
|
|
288
309
|
hasContent = true;
|
|
289
310
|
}
|
|
290
311
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* packages/coding-agent/src/modes/interactive/components/tree-selector.ts
|
|
4
|
-
*
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
|
|
4
|
+
* Modifications: Source-synchronized tree selector port: preserve filtering, folding, labels, copying,
|
|
5
|
+
* tree navigation, key hints, focus, and viewport behavior while remapping public types/components
|
|
6
|
+
* plus owned keybindings/theme helpers required to avoid the pinned package nested pi-tui singleton.
|
|
7
|
+
* Deviations: none.
|
|
5
8
|
*/
|
|
6
|
-
import { type Component, Container, type Focusable } from "
|
|
9
|
+
import { type Component, Container, type Focusable } from "@earendil-works/pi-tui";
|
|
7
10
|
import { type SessionTreeNode } from "@earendil-works/pi-coding-agent";
|
|
8
11
|
/** Filter mode for tree display */
|
|
9
12
|
export type FilterMode = "default" | "no-tools" | "user-only" | "labeled-only" | "all";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* packages/coding-agent/src/modes/interactive/components/tree-selector.ts
|
|
4
|
-
*
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/components/tree-selector.ts.
|
|
4
|
+
* Modifications: Source-synchronized tree selector port: preserve filtering, folding, labels, copying,
|
|
5
|
+
* tree navigation, key hints, focus, and viewport behavior while remapping public types/components
|
|
6
|
+
* plus owned keybindings/theme helpers required to avoid the pinned package nested pi-tui singleton.
|
|
7
|
+
* Deviations: none.
|
|
5
8
|
*/
|
|
6
|
-
import { Container, Input, Spacer, sliceByColumn, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "
|
|
9
|
+
import { Container, Input, Spacer, sliceByColumn, Text, truncateToWidth, visibleWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui";
|
|
7
10
|
import { DynamicBorder } from "../../../startup-public.js";
|
|
8
11
|
import { KeybindingsManager } from "../adjacent/core/keybindings.js";
|
|
9
12
|
import { piTheme } from "../theme/theme.js";
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/components/trust-selector.ts.
|
|
4
|
+
* Modifications: Mechanical source-synchronized trust selector port with injected public
|
|
5
|
+
* ProjectTrustStore-derived options and remapped owned theme imports.
|
|
6
|
+
* Deviations: none.
|
|
7
|
+
*/
|
|
4
8
|
import { DynamicBorder, keyHint, rawKeyHint } from "../../../startup-public.js";
|
|
5
|
-
import { Container, getKeybindings, Spacer, Text } from "
|
|
9
|
+
import { Container, getKeybindings, Spacer, Text } from "@earendil-works/pi-tui";
|
|
6
10
|
import { piTheme } from "../theme/theme.js";
|
|
7
11
|
function formatDecision(trustPath, decision) {
|
|
8
12
|
if (decision === null)
|
|
@@ -70,7 +74,8 @@ export class TrustSelectorComponent extends Container {
|
|
|
70
74
|
const current = option.savedPath !== undefined && savedDecision?.decision === option.trusted && savedDecision.path === option.savedPath;
|
|
71
75
|
const prefix = selected ? piTheme().fg("accent", "→ ") : " ";
|
|
72
76
|
const label = selected ? piTheme().fg("accent", option.label) : piTheme().fg("text", option.label);
|
|
73
|
-
|
|
77
|
+
const currentMarker = current ? piTheme().fg("accent", "✓ ") : " ";
|
|
78
|
+
this.listContainer.addChild(new Text(`${prefix}${currentMarker}${label}`, 1, 0));
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* packages/coding-agent/src/modes/interactive/external-editor.ts
|
|
4
|
-
*
|
|
2
|
+
* Provenance: @earendil-works/pi-coding-agent 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/coding-agent/src/modes/interactive/external-editor.ts.
|
|
4
|
+
* Modifications: Mechanical port: retain temporary prompt file, asynchronous inherited-stdio editor
|
|
5
|
+
* process, completion readback, and best-effort cleanup behind the owned extension-editor component.
|
|
6
|
+
* Deviations: none.
|
|
5
7
|
*/
|
|
6
8
|
import { spawn } from "node:child_process";
|
|
7
9
|
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -26,7 +28,9 @@ export async function editInExternalEditor(options) {
|
|
|
26
28
|
});
|
|
27
29
|
if (exitCode !== 0)
|
|
28
30
|
return { status: "failed" };
|
|
29
|
-
|
|
31
|
+
// Rationale: upstream strips the BOM through a private util the package does not export; the check lives here.
|
|
32
|
+
const edited = readFileSync(filePath, "utf-8");
|
|
33
|
+
return { status: "complete", content: (edited.startsWith("") ? edited.slice(1) : edited).replace(/\n$/, "") };
|
|
30
34
|
}
|
|
31
35
|
finally {
|
|
32
36
|
try {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/components/editor.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state with the user-approved numeric-only
|
|
6
|
+
* history label. Public terminal runtime/exports remain shared and unchanged. See
|
|
7
|
+
* docs/architecture/history-editor-provenance.md.
|
|
8
|
+
* Deviations: compact-history-counter-label, persistent-history-owned-editor-boundary.
|
|
5
9
|
*/
|
|
6
|
-
import { type AutocompleteProvider, type Component, type Focusable, type TUI, type SelectListTheme } from "
|
|
10
|
+
import { type AutocompleteProvider, type Component, type Focusable, type TUI, type TuiMouseEvent, type TuiMouseEventResult, type SelectListTheme } from "@earendil-works/pi-tui";
|
|
7
11
|
import type { EditorInteractionPort, EditorRecallPort } from "../../editor-interaction.js";
|
|
8
12
|
/**
|
|
9
13
|
* Represents a chunk of text for word-wrap layout.
|
|
@@ -46,6 +50,8 @@ export declare class HistoryEditorCore implements Component, Focusable {
|
|
|
46
50
|
private theme;
|
|
47
51
|
private paddingX;
|
|
48
52
|
private lastWidth;
|
|
53
|
+
private renderedVisibleLineCount;
|
|
54
|
+
private renderedAutocompleteHeight;
|
|
49
55
|
private scrollOffset;
|
|
50
56
|
borderColor: (str: string) => string;
|
|
51
57
|
private autocompleteProvider?;
|
|
@@ -118,7 +124,10 @@ export declare class HistoryEditorCore implements Component, Focusable {
|
|
|
118
124
|
/** Internal setText that doesn't reset history state - used by navigateHistory */
|
|
119
125
|
private setTextInternal;
|
|
120
126
|
invalidate(): void;
|
|
127
|
+
protected renderTopBorder(width: number, hiddenLineCount: number): string;
|
|
128
|
+
protected renderBottomBorder(width: number, hiddenLineCount: number): string;
|
|
121
129
|
render(width: number): string[];
|
|
130
|
+
handleMouse(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
122
131
|
handleInput(data: string): void;
|
|
123
132
|
private layoutText;
|
|
124
133
|
getText(): string;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/components/editor.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state with the user-approved numeric-only
|
|
6
|
+
* history label. Public terminal runtime/exports remain shared and unchanged. See
|
|
7
|
+
* docs/architecture/history-editor-provenance.md.
|
|
8
|
+
* Deviations: compact-history-counter-label, persistent-history-owned-editor-boundary.
|
|
5
9
|
*/
|
|
6
|
-
import { getKeybindings, matchesKey, CURSOR_MARKER, sliceByColumn, truncateToWidth, visibleWidth, SelectList } from "
|
|
10
|
+
import { getKeybindings, matchesKey, CURSOR_MARKER, sliceByColumn, truncateToWidth, visibleWidth, SelectList } from "@earendil-works/pi-tui";
|
|
7
11
|
import { decodePrintableKey } from "./printable-key.js";
|
|
8
12
|
import { KillRing } from "./kill-ring.js";
|
|
9
13
|
import { UndoStack } from "./undo-stack.js";
|
|
@@ -183,6 +187,12 @@ function buildDebouncePattern(triggerCharacters) {
|
|
|
183
187
|
}
|
|
184
188
|
function createScrollBorder(direction, hiddenLineCount, width) {
|
|
185
189
|
const availableWidth = Math.max(0, width);
|
|
190
|
+
const label = ` ${direction} ${hiddenLineCount} more `;
|
|
191
|
+
const labelWidth = visibleWidth(label);
|
|
192
|
+
if (labelWidth + 2 <= availableWidth) {
|
|
193
|
+
const leftWidth = Math.floor((availableWidth - labelWidth) / 2);
|
|
194
|
+
return "─".repeat(leftWidth) + label + "─".repeat(availableWidth - leftWidth - labelWidth);
|
|
195
|
+
}
|
|
186
196
|
const indicator = `─── ${direction} ${hiddenLineCount} more `;
|
|
187
197
|
const remaining = availableWidth - visibleWidth(indicator);
|
|
188
198
|
if (remaining >= 0)
|
|
@@ -222,8 +232,10 @@ export class HistoryEditorCore {
|
|
|
222
232
|
tui;
|
|
223
233
|
theme;
|
|
224
234
|
paddingX = 0;
|
|
225
|
-
// Store last render
|
|
235
|
+
// Store last render geometry for cursor navigation and mouse hit-testing.
|
|
226
236
|
lastWidth = 80;
|
|
237
|
+
renderedVisibleLineCount = 1;
|
|
238
|
+
renderedAutocompleteHeight = 0;
|
|
227
239
|
// Vertical scrolling support
|
|
228
240
|
scrollOffset = 0;
|
|
229
241
|
// Border color (can be changed dynamically)
|
|
@@ -463,6 +475,21 @@ export class HistoryEditorCore {
|
|
|
463
475
|
invalidate() {
|
|
464
476
|
// No cached state to invalidate currently
|
|
465
477
|
}
|
|
478
|
+
renderTopBorder(width, hiddenLineCount) {
|
|
479
|
+
if (this.persistentHistory && this.historyIndex >= 0) {
|
|
480
|
+
const overflow = hiddenLineCount > 0 ? ` · ↑ ${hiddenLineCount} more` : "";
|
|
481
|
+
const label = `─── ${this.history.length - this.historyIndex}/${this.history.length}${overflow} `;
|
|
482
|
+
const shown = truncateToWidth(label, width);
|
|
483
|
+
const remaining = Math.max(0, width - visibleWidth(shown));
|
|
484
|
+
return this.borderColor(shown.slice(0, 4)) + this.styleHistoryLabel(shown.slice(4)) + this.borderColor("─".repeat(remaining));
|
|
485
|
+
}
|
|
486
|
+
const border = hiddenLineCount > 0 ? createScrollBorder("↑", hiddenLineCount, width) : "─".repeat(width);
|
|
487
|
+
return this.borderColor(border);
|
|
488
|
+
}
|
|
489
|
+
renderBottomBorder(width, hiddenLineCount) {
|
|
490
|
+
const border = hiddenLineCount > 0 ? createScrollBorder("↓", hiddenLineCount, width) : "─".repeat(width);
|
|
491
|
+
return this.borderColor(border);
|
|
492
|
+
}
|
|
466
493
|
render(width) {
|
|
467
494
|
const maxPadding = Math.max(0, Math.floor((width - 1) / 2));
|
|
468
495
|
const paddingX = Math.min(this.paddingX, maxPadding);
|
|
@@ -472,7 +499,6 @@ export class HistoryEditorCore {
|
|
|
472
499
|
const layoutWidth = Math.max(1, contentWidth - (paddingX ? 0 : 1));
|
|
473
500
|
// Store for cursor navigation (must match wrapping width)
|
|
474
501
|
this.lastWidth = layoutWidth;
|
|
475
|
-
const horizontal = this.borderColor("─");
|
|
476
502
|
// Layout the text
|
|
477
503
|
const layoutLines = this.layoutText(layoutWidth);
|
|
478
504
|
// Calculate max visible lines: 30% of terminal height, minimum 5 lines
|
|
@@ -494,26 +520,12 @@ export class HistoryEditorCore {
|
|
|
494
520
|
this.scrollOffset = Math.max(0, Math.min(this.scrollOffset, maxScrollOffset));
|
|
495
521
|
// Get visible lines slice
|
|
496
522
|
const visibleLines = layoutLines.slice(this.scrollOffset, this.scrollOffset + maxVisibleLines);
|
|
523
|
+
this.renderedVisibleLineCount = visibleLines.length;
|
|
497
524
|
const result = [];
|
|
498
525
|
const leftPadding = " ".repeat(paddingX);
|
|
499
526
|
const rightPadding = leftPadding;
|
|
500
527
|
// Render top border (with scroll indicator if scrolled down)
|
|
501
|
-
|
|
502
|
-
const overflow = this.scrollOffset > 0 ? ` · ↑ ${this.scrollOffset} more` : "";
|
|
503
|
-
const label = `─── ${this.history.length - this.historyIndex}/${this.history.length}${overflow} `;
|
|
504
|
-
const shown = truncateToWidth(label, width);
|
|
505
|
-
const remaining = Math.max(0, width - visibleWidth(shown));
|
|
506
|
-
result.push(this.borderColor(shown.slice(0, 4))
|
|
507
|
-
+ this.styleHistoryLabel(shown.slice(4))
|
|
508
|
-
+ this.borderColor("─".repeat(remaining)));
|
|
509
|
-
}
|
|
510
|
-
else if (this.scrollOffset > 0) {
|
|
511
|
-
const border = createScrollBorder("↑", this.scrollOffset, width);
|
|
512
|
-
result.push(this.borderColor(border));
|
|
513
|
-
}
|
|
514
|
-
else {
|
|
515
|
-
result.push(horizontal.repeat(width));
|
|
516
|
-
}
|
|
528
|
+
result.push(this.renderTopBorder(width, this.scrollOffset));
|
|
517
529
|
// Render each visible layout line
|
|
518
530
|
// Emit hardware cursor marker when focused so TUI can position the
|
|
519
531
|
// hardware cursor for IME candidate-window placement even while
|
|
@@ -558,16 +570,12 @@ export class HistoryEditorCore {
|
|
|
558
570
|
}
|
|
559
571
|
// Render bottom border (with scroll indicator if more content below)
|
|
560
572
|
const linesBelow = layoutLines.length - (this.scrollOffset + visibleLines.length);
|
|
561
|
-
|
|
562
|
-
const border = createScrollBorder("↓", linesBelow, width);
|
|
563
|
-
result.push(this.borderColor(border));
|
|
564
|
-
}
|
|
565
|
-
else {
|
|
566
|
-
result.push(horizontal.repeat(width));
|
|
567
|
-
}
|
|
573
|
+
result.push(this.renderBottomBorder(width, linesBelow));
|
|
568
574
|
// Add autocomplete list if active
|
|
575
|
+
this.renderedAutocompleteHeight = 0;
|
|
569
576
|
if (this.autocompleteState && this.autocompleteList) {
|
|
570
577
|
const autocompleteResult = this.autocompleteList.render(contentWidth);
|
|
578
|
+
this.renderedAutocompleteHeight = autocompleteResult.length;
|
|
571
579
|
for (const line of autocompleteResult) {
|
|
572
580
|
const lineWidth = visibleWidth(line);
|
|
573
581
|
const linePadding = " ".repeat(Math.max(0, contentWidth - lineWidth));
|
|
@@ -576,6 +584,67 @@ export class HistoryEditorCore {
|
|
|
576
584
|
}
|
|
577
585
|
return result;
|
|
578
586
|
}
|
|
587
|
+
handleMouse(event) {
|
|
588
|
+
const autocompleteStartRow = this.renderedVisibleLineCount + 2;
|
|
589
|
+
if (this.autocompleteState &&
|
|
590
|
+
this.autocompleteList &&
|
|
591
|
+
event.y >= autocompleteStartRow &&
|
|
592
|
+
event.y < autocompleteStartRow + this.renderedAutocompleteHeight) {
|
|
593
|
+
const maxPadding = Math.max(0, Math.floor((event.width - 1) / 2));
|
|
594
|
+
const paddingX = Math.min(this.paddingX, maxPadding);
|
|
595
|
+
const contentWidth = Math.max(1, event.width - paddingX * 2);
|
|
596
|
+
const result = this.autocompleteList.handleMouse?.({
|
|
597
|
+
...event,
|
|
598
|
+
x: event.x - paddingX,
|
|
599
|
+
y: event.y - autocompleteStartRow,
|
|
600
|
+
width: contentWidth,
|
|
601
|
+
height: this.renderedAutocompleteHeight,
|
|
602
|
+
});
|
|
603
|
+
return result ? { ...result, focus: true } : undefined;
|
|
604
|
+
}
|
|
605
|
+
// Leave press/drag/release unhandled so the renderer's screen-level text
|
|
606
|
+
// selection can run over the editor rows (drag to select, release to copy).
|
|
607
|
+
// The renderer synthesizes a click when press and release land on the same
|
|
608
|
+
// cell without movement, which is the gesture that positions the cursor.
|
|
609
|
+
if (event.type !== "click" || event.button !== "left")
|
|
610
|
+
return undefined;
|
|
611
|
+
if (event.y <= 0 || event.y > this.renderedVisibleLineCount)
|
|
612
|
+
return { handled: true, focus: true };
|
|
613
|
+
const visualLines = this.buildVisualLineMap(this.lastWidth);
|
|
614
|
+
const visualLineIndex = this.scrollOffset + event.y - 1;
|
|
615
|
+
const visualLine = visualLines[visualLineIndex];
|
|
616
|
+
if (!visualLine)
|
|
617
|
+
return { handled: true, focus: true };
|
|
618
|
+
const logicalLine = this.state.lines[visualLine.logicalLine] ?? "";
|
|
619
|
+
const chunkEnd = visualLine.startCol + visualLine.length;
|
|
620
|
+
const chunk = logicalLine.slice(visualLine.startCol, chunkEnd);
|
|
621
|
+
const maxPadding = Math.max(0, Math.floor((event.width - 1) / 2));
|
|
622
|
+
const paddingX = Math.min(this.paddingX, maxPadding);
|
|
623
|
+
const targetColumn = Math.max(0, event.x - paddingX);
|
|
624
|
+
let visibleColumn = 0;
|
|
625
|
+
let targetIndex = chunk.length;
|
|
626
|
+
let lastGraphemeIndex = 0;
|
|
627
|
+
for (const grapheme of this.segment(chunk, "grapheme")) {
|
|
628
|
+
const nextColumn = visibleColumn + visibleWidth(grapheme.segment);
|
|
629
|
+
lastGraphemeIndex = grapheme.index;
|
|
630
|
+
if (targetColumn < nextColumn) {
|
|
631
|
+
targetIndex = grapheme.index;
|
|
632
|
+
break;
|
|
633
|
+
}
|
|
634
|
+
visibleColumn = nextColumn;
|
|
635
|
+
}
|
|
636
|
+
const isLastSegment = visualLineIndex === visualLines.length - 1 ||
|
|
637
|
+
visualLines[visualLineIndex + 1]?.logicalLine !== visualLine.logicalLine;
|
|
638
|
+
if (!isLastSegment && targetIndex === chunk.length && chunk.length > 0)
|
|
639
|
+
targetIndex = lastGraphemeIndex;
|
|
640
|
+
this.state.cursorLine = visualLine.logicalLine;
|
|
641
|
+
this.setCursorCol(visualLine.startCol + targetIndex);
|
|
642
|
+
this.lastAction = null;
|
|
643
|
+
this.exitHistoryBrowsing();
|
|
644
|
+
if (this.autocompleteState)
|
|
645
|
+
this.updateAutocomplete();
|
|
646
|
+
return { handled: true, focus: true };
|
|
647
|
+
}
|
|
579
648
|
handleInput(data) {
|
|
580
649
|
const kb = getKeybindings();
|
|
581
650
|
// Handle character jump mode (awaiting next character to jump to)
|
|
@@ -1906,7 +1975,20 @@ export class HistoryEditorCore {
|
|
|
1906
1975
|
}
|
|
1907
1976
|
createAutocompleteList(prefix, items) {
|
|
1908
1977
|
const layout = prefix.startsWith("/") ? SLASH_COMMAND_SELECT_LIST_LAYOUT : undefined;
|
|
1909
|
-
|
|
1978
|
+
const list = new SelectList(items, this.autocompleteMaxVisible, this.theme.selectList, layout);
|
|
1979
|
+
list.onSelect = (selected) => {
|
|
1980
|
+
if (!this.autocompleteProvider)
|
|
1981
|
+
return;
|
|
1982
|
+
this.pushUndoSnapshot();
|
|
1983
|
+
this.lastAction = null;
|
|
1984
|
+
const result = this.autocompleteProvider.applyCompletion(this.state.lines, this.state.cursorLine, this.state.cursorCol, selected, this.autocompletePrefix);
|
|
1985
|
+
this.state.lines = result.lines;
|
|
1986
|
+
this.state.cursorLine = result.cursorLine;
|
|
1987
|
+
this.setCursorCol(result.cursorCol);
|
|
1988
|
+
this.cancelAutocomplete();
|
|
1989
|
+
this.onChange?.(this.getText());
|
|
1990
|
+
};
|
|
1991
|
+
return list;
|
|
1910
1992
|
}
|
|
1911
1993
|
tryTriggerAutocomplete(explicitTab = false) {
|
|
1912
1994
|
this.requestAutocomplete({ force: false, explicitTab });
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/kill-ring.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
|
|
6
|
+
* remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
|
|
7
|
+
* Deviations: persistent-history-owned-editor-boundary.
|
|
5
8
|
*/
|
|
6
9
|
/**
|
|
7
10
|
* Ring buffer for Emacs-style kill/yank operations.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/kill-ring.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
|
|
6
|
+
* remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
|
|
7
|
+
* Deviations: persistent-history-owned-editor-boundary.
|
|
5
8
|
*/
|
|
6
9
|
/**
|
|
7
10
|
* Ring buffer for Emacs-style kill/yank operations.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/keys.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
|
|
6
|
+
* remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
|
|
7
|
+
* Deviations: persistent-history-owned-editor-boundary.
|
|
5
8
|
*/
|
|
6
|
-
import { decodeKittyPrintable } from "
|
|
9
|
+
import { decodeKittyPrintable } from "@earendil-works/pi-tui";
|
|
7
10
|
const MODIFIERS = {
|
|
8
11
|
shift: 1,
|
|
9
12
|
alt: 2,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/utils.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
|
|
6
|
+
* remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
|
|
7
|
+
* Deviations: persistent-history-owned-editor-boundary.
|
|
5
8
|
*/
|
|
6
9
|
// segmenters (shared instance)
|
|
7
10
|
const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" });
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/undo-stack.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
|
|
6
|
+
* remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
|
|
7
|
+
* Deviations: persistent-history-owned-editor-boundary.
|
|
5
8
|
*/
|
|
6
9
|
/**
|
|
7
10
|
* Generic undo stack with clone-on-push semantics.
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* Modifications:
|
|
2
|
+
* Provenance: @earendil-works/pi-tui 0.85.1 (MIT), commit d981de1229ef899957bbe968bc8dcda02a21f477,
|
|
3
|
+
* packages/tui/src/undo-stack.ts.
|
|
4
|
+
* Modifications: Owned editor core or minimal editor-local helper subset; public imports, strict
|
|
5
|
+
* types, typed persistent-history hooks, and semantic border state. Public terminal runtime/exports
|
|
6
|
+
* remain shared and unchanged. See docs/architecture/history-editor-provenance.md.
|
|
7
|
+
* Deviations: persistent-history-owned-editor-boundary.
|
|
5
8
|
*/
|
|
6
9
|
/**
|
|
7
10
|
* Generic undo stack with clone-on-push semantics.
|