@timurproko/a1 0.1.8-dev.21b95d6 → 0.1.8-dev.226
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/README.md +107 -67
- package/bin/cli.js +28 -10
- package/bin/guardian.js +4 -1
- package/bin/module-identity.js +69 -35
- package/bin/pi-tui.d.ts +6 -0
- package/bin/pi-tui.js +28 -0
- package/bin/release-cleanup.js +8 -0
- package/bin/supervisor.js +1 -1
- package/bin/sync-pi-tui-proxy.js +97 -0
- package/bin/ui.js +25 -6
- package/bin/warmup.js +18 -0
- package/dist/cli/capabilities.d.ts +6 -0
- package/dist/{src/cli → cli}/capabilities.js +1 -1
- package/dist/{src/cli → cli}/dispatch.d.ts +6 -0
- package/dist/cli/dispatch.js +202 -0
- package/dist/{src/cli → cli}/packages.d.ts +10 -2
- package/dist/{src/cli → cli}/packages.js +24 -20
- package/dist/{src/cli → cli}/version-stats.d.ts +6 -0
- package/dist/cli/version-stats.js +112 -0
- package/dist/composition/agent-engine-bridge.d.ts +3 -0
- package/dist/composition/agent-engine-bridge.js +108 -0
- package/dist/composition/index.d.ts +3 -0
- package/dist/composition/index.js +3 -0
- package/dist/composition/owned-ui.d.ts +28 -0
- package/dist/composition/owned-ui.js +64 -0
- package/dist/composition/process.d.ts +16 -0
- package/dist/composition/process.js +45 -0
- package/dist/composition/settings-route-host.d.ts +8 -0
- package/dist/composition/settings-route-host.js +75 -0
- package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.d.ts +2 -2
- package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.js +22 -4
- package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.d.ts +17 -0
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.d.ts +36 -0
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.js +25 -0
- package/dist/{src/features → features}/launch/development-launch.js +11 -3
- package/dist/{src/features → features}/launch/index.d.ts +0 -1
- package/dist/{src/features → features}/launch/index.js +0 -1
- package/dist/{src/features → features}/launch/intent.d.ts +3 -2
- package/dist/features/launch/intent.js +3 -0
- package/dist/{src/features → features}/launch/prepare-launch.d.ts +0 -2
- package/dist/{src/features → features}/launch/prepare-launch.js +2 -9
- package/dist/{src/features → features}/launch/profile-paths.d.ts +1 -2
- package/dist/{src/features → features}/launch/profile-paths.js +2 -8
- package/dist/{src/features → features}/launch/runtime-selection.d.ts +2 -5
- package/dist/{src/features → features}/owned-ui/customization.d.ts +3 -1
- package/dist/{src/features → features}/owned-ui/customization.js +3 -1
- package/dist/{src/features → features}/owned-ui/diagnostics.d.ts +2 -1
- package/dist/{src/features → features}/owned-ui/diagnostics.js +1 -0
- package/dist/{src/features → features}/owned-ui/index.d.ts +1 -0
- package/dist/{src/features → features}/owned-ui/index.js +1 -0
- package/dist/features/owned-ui/project-trust-prompt.d.ts +25 -0
- package/dist/features/owned-ui/project-trust-prompt.js +149 -0
- package/dist/{src/features → features}/owned-ui/run.d.ts +2 -2
- package/dist/{src/features → features}/owned-ui/run.js +2 -0
- package/dist/{src/features → features}/owned-ui/settings-app.d.ts +3 -3
- package/dist/{src/features → features}/owned-ui/settings-app.js +103 -54
- package/dist/{src/features → features}/workspace/capabilities.d.ts +1 -1
- package/dist/{src/features → features}/workspace/reducer.d.ts +2 -1
- package/dist/{src/features → features}/workspace/reducer.js +2 -1
- package/dist/{src/features → features}/workspace/router.d.ts +2 -1
- package/dist/{src/features → features}/workspace/router.js +1 -0
- package/dist/{src/features → features}/workspace/store.d.ts +2 -1
- package/dist/{src/features → features}/workspace/store.js +1 -0
- package/dist/{src/foundation → foundation}/launch-guardian/main.js +10 -2
- package/dist/{src/foundation → foundation}/lifecycle/model.d.ts +1 -1
- package/dist/{src/foundation → foundation}/lifecycle/model.js +1 -1
- package/dist/foundation/lifecycle/paths.d.ts +28 -0
- package/dist/{src/foundation → foundation}/lifecycle/paths.js +21 -0
- package/dist/{src/foundation → foundation}/native-host-protocol/codec.d.ts +2 -0
- package/dist/{src/foundation → foundation}/native-host-protocol/codec.js +2 -0
- package/dist/{src/foundation → foundation}/native-host-protocol/messages.d.ts +1 -1
- package/dist/{src/foundation → foundation}/native-host-protocol/messages.js +1 -1
- package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.d.ts +1 -0
- package/dist/{src/foundation → foundation}/process-containment/linux-process-inspector.js +1 -0
- package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.d.ts +1 -0
- package/dist/{src/foundation → foundation}/process-containment/native-guardian-containment.js +1 -0
- package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.d.ts +1 -0
- package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.js +1 -0
- package/dist/{src/foundation → foundation}/protocol/client.d.ts +1 -0
- package/dist/{src/foundation → foundation}/protocol/client.js +1 -0
- package/dist/{src/foundation → foundation}/protocol/messages.d.ts +1 -0
- package/dist/{src/foundation → foundation}/protocol/messages.js +1 -0
- package/dist/{src/foundation → foundation}/release/bootstrap.d.ts +14 -4
- package/dist/{src/foundation → foundation}/release/bootstrap.js +66 -13
- package/dist/foundation/release/cohort-state.d.ts +156 -0
- package/dist/foundation/release/cohort-state.js +471 -0
- package/dist/foundation/release/dependency-layer.d.ts +78 -0
- package/dist/foundation/release/dependency-layer.js +487 -0
- package/dist/foundation/release/endpoints.d.ts +20 -0
- package/dist/foundation/release/endpoints.js +50 -0
- package/dist/{src/foundation → foundation}/release/index.d.ts +3 -0
- package/dist/{src/foundation → foundation}/release/index.js +3 -0
- package/dist/foundation/release/release-gc.d.ts +71 -0
- package/dist/foundation/release/release-gc.js +734 -0
- package/dist/{src/foundation → foundation}/release/release-store.d.ts +3 -1
- package/dist/{src/foundation → foundation}/release/release-store.js +60 -10
- package/dist/{src/foundation → foundation}/release/release.d.ts +4 -1
- package/dist/{src/foundation → foundation}/release/release.js +10 -3
- package/dist/{src/foundation → foundation}/release/update-transaction.d.ts +1 -0
- package/dist/{src/foundation → foundation}/release/update-transaction.js +1 -0
- package/dist/{src/foundation → foundation}/release/update.d.ts +19 -3
- package/dist/{src/foundation → foundation}/release/update.js +114 -54
- package/dist/foundation/release/warmup.d.ts +3 -0
- package/dist/foundation/release/warmup.js +35 -0
- package/dist/foundation/startup/index.d.ts +1 -0
- package/dist/foundation/startup/index.js +1 -0
- package/dist/foundation/startup/startup-runtime.d.ts +36 -0
- package/dist/foundation/startup/startup-runtime.js +140 -0
- package/dist/{src/foundation → foundation}/storage/control-store.d.ts +2 -1
- package/dist/{src/foundation → foundation}/storage/control-store.js +39 -4
- package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/backpressure.js +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/commands.js +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.d.ts +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/handshake.js +1 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/reconnection.js +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/state.d.ts +2 -1
- package/dist/{src/foundation → foundation}/structured-agent-runtime/state.js +2 -1
- package/dist/foundation/supervision/index.d.ts +3 -0
- package/dist/foundation/supervision/index.js +3 -0
- package/dist/{src/foundation → foundation}/supervision/main.js +11 -5
- package/dist/foundation/supervision/paths.d.ts +1 -0
- package/dist/foundation/supervision/paths.js +1 -0
- package/dist/{src/foundation → foundation}/supervision/server.d.ts +19 -1
- package/dist/{src/foundation → foundation}/supervision/server.js +51 -2
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.d.ts +1 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/conformance.js +3 -2
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +55 -0
- package/dist/integrations/pi/components/owned-editor-ux.js +778 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.d.ts +1 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-components.js +1 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-editor-autocomplete.js +54 -6
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.d.ts +3 -3
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.js +32 -17
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +36 -0
- package/dist/integrations/pi/components/shell-presenters-info.js +78 -0
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +25 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.js +92 -131
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.d.ts +52 -8
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.js +4 -2
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +13 -0
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +27 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.d.ts +10 -2
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.js +36 -3
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.d.ts +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.d.ts +22 -4
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.js +289 -68
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.d.ts +2 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.js +4 -2
- package/dist/integrations/pi/engine/http-dispatcher.d.ts +4 -0
- package/dist/integrations/pi/engine/http-dispatcher.js +25 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.d.ts +3 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.js +3 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.d.ts +2 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.js +1 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.d.ts +1 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.js +2 -2
- package/dist/integrations/pi/engine/project-trust-preflight.d.ts +22 -0
- package/dist/integrations/pi/engine/project-trust-preflight.js +50 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.d.ts +2 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/resource-extension-integration.js +1 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.d.ts +16 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.js +39 -4
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.d.ts +4 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/session-integration.js +19 -4
- package/dist/integrations/pi/engine/settings-effects.d.ts +66 -0
- package/dist/integrations/pi/engine/settings-effects.js +249 -0
- package/dist/integrations/pi/engine/settings-integration.d.ts +43 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/settings-integration.js +102 -108
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.d.ts +3 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflow-controllers.js +1 -0
- package/dist/integrations/pi/session-ui/clipboard-image.d.ts +11 -0
- package/dist/integrations/pi/session-ui/clipboard-image.js +29 -0
- package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/session-ui}/index.d.ts +1 -0
- package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/session-ui}/index.js +1 -0
- package/dist/integrations/pi/session-ui/prompt-chips.d.ts +23 -0
- package/dist/integrations/pi/session-ui/prompt-chips.js +246 -0
- package/dist/integrations/pi/session-ui/route-host.d.ts +5 -0
- package/dist/integrations/pi/session-ui/session-shell-root.d.ts +137 -0
- package/dist/integrations/pi/session-ui/session-shell-root.js +1106 -0
- package/dist/integrations/pi/session-ui/session-shell.d.ts +55 -0
- package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/session-ui}/session-shell.js +415 -775
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +44 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +434 -0
- package/dist/integrations/pi/session-ui/stream-presentation-coalescer.d.ts +29 -0
- package/dist/integrations/pi/session-ui/stream-presentation-coalescer.js +79 -0
- package/dist/integrations/pi/session-ui/system-clipboard.d.ts +20 -0
- package/dist/integrations/pi/session-ui/system-clipboard.js +130 -0
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.d.ts +8 -1
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.js +216 -9
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.d.ts +29 -6
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +63 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +240 -0
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/index.d.ts +2 -0
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/index.js +2 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.d.ts +39 -0
- package/dist/integrations/pi/tui-runtime/input-presentation-coordinator.js +139 -0
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.d.ts +1 -1
- package/dist/native/darwin-arm64/manifest.json +1 -1
- package/dist/native/linux-x64/manifest.json +3 -3
- package/dist/native/linux-x64/process-guardian +0 -0
- package/dist/native/win32-x64/manifest.json +3 -3
- package/dist/native/win32-x64/process-guardian.exe +0 -0
- package/dist/{src/product-identity.d.ts → product-identity.d.ts} +3 -3
- package/dist/{src/product-identity.js → product-identity.js} +7 -5
- package/dist/{src/product-identity.json → product-identity.json} +11 -6
- package/dist/runtime-payload-inventory.json +122328 -0
- package/dist/{src/foundation/ui-apps → ui/apps}/contracts.d.ts +23 -1
- package/dist/{src/foundation/ui-apps → ui/apps}/host.d.ts +1 -1
- package/dist/{src/foundation/ui-apps → ui/apps}/host.js +14 -10
- package/dist/{src/foundation/ui-apps → ui/apps}/registry.d.ts +1 -0
- package/dist/{src/foundation/ui-apps → ui/apps}/registry.js +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.js +5 -3
- package/dist/{src/foundation/ui-components → ui/components}/frame.d.ts +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/frame.js +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/index.d.ts +4 -0
- package/dist/{src/foundation/ui-components → ui/components}/index.js +4 -0
- package/dist/{src/foundation/ui-components → ui/components}/line-input.d.ts +1 -6
- package/dist/{src/foundation/ui-components → ui/components}/line-input.js +4 -9
- package/dist/{src/foundation/ui-components → ui/components}/list-view.d.ts +0 -6
- package/dist/{src/foundation/ui-components → ui/components}/list-view.js +14 -7
- package/dist/{src/foundation/ui-components → ui/components}/mouse.d.ts +10 -0
- package/dist/{src/foundation/ui-components → ui/components}/mouse.js +23 -0
- package/dist/ui/components/progress-status.d.ts +2 -0
- package/dist/ui/components/progress-status.js +4 -0
- package/dist/ui/components/prompt-row.d.ts +14 -0
- package/dist/ui/components/prompt-row.js +20 -0
- package/dist/{src/foundation/ui-components → ui/components}/scrollbar.d.ts +26 -0
- package/dist/{src/foundation/ui-components → ui/components}/scrollbar.js +35 -0
- package/dist/{src/foundation/ui-components → ui/components}/shortcuts.d.ts +1 -0
- package/dist/{src/foundation/ui-components → ui/components}/shortcuts.js +1 -0
- package/dist/ui/components/spans.d.ts +25 -0
- package/dist/ui/components/spans.js +257 -0
- package/dist/ui/components/submitted-prompt.d.ts +23 -0
- package/dist/ui/components/submitted-prompt.js +50 -0
- package/dist/{src/foundation/ui-components → ui/components}/surface.d.ts +0 -5
- package/dist/{src/foundation/ui-components → ui/components}/surface.js +1 -5
- package/dist/ui/components/text-selection.d.ts +62 -0
- package/dist/ui/components/text-selection.js +235 -0
- package/dist/{src/foundation/ui-components → ui/components}/text.d.ts +14 -0
- package/dist/{src/foundation/ui-components → ui/components}/text.js +66 -4
- package/dist/ui/components/transcript-viewport.d.ts +146 -0
- package/dist/ui/components/transcript-viewport.js +629 -0
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.d.ts +8 -1
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.js +33 -5
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.d.ts +1 -1
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/migrations.js +21 -2
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.d.ts +6 -19
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/sections.js +32 -23
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.d.ts +9 -17
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.js +65 -55
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.d.ts +1 -0
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/store.js +2 -1
- package/docs/architecture/boundaries.md +9 -9
- package/docs/architecture/code-documentation.md +77 -0
- package/docs/architecture/project-structure.md +67 -30
- package/docs/architecture/resource-and-data-policy.md +1 -1
- package/docs/architecture/toolchain.md +10 -10
- package/docs/architecture/ui-reference-provenance.md +34 -5
- package/docs/ci-release-runbook.md +186 -79
- package/docs/features/launch-profiles.md +10 -19
- package/docs/manual-launch-instance-acceptance.md +12 -35
- package/docs/manual-owned-ui-checkpoint.md +78 -0
- package/docs/manual-pi-boundary-candidate.md +4 -5
- package/docs/manual-terminal-colour-check.md +4 -3
- package/docs/repository-governance-live-acceptance.md +77 -0
- package/package.json +37 -27
- package/dist/src/cli/capabilities.d.ts +0 -15
- package/dist/src/cli/dispatch.js +0 -177
- package/dist/src/cli/version-stats.js +0 -72
- package/dist/src/composition/index.d.ts +0 -48
- package/dist/src/composition/index.js +0 -258
- package/dist/src/features/launch/intent.js +0 -4
- package/dist/src/features/launch/profiles.d.ts +0 -12
- package/dist/src/features/launch/profiles.js +0 -26
- package/dist/src/foundation/lifecycle/paths.d.ts +0 -10
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +0 -57
- package/dist/src/foundation/pi-engine-adapter/settings-integration.d.ts +0 -55
- package/dist/src/foundation/pi-owned-ui-integration/route-host.d.ts +0 -29
- package/dist/src/foundation/pi-owned-ui-integration/session-shell.d.ts +0 -112
- package/dist/src/foundation/release/cohort-state.d.ts +0 -70
- package/dist/src/foundation/release/cohort-state.js +0 -202
- package/dist/src/foundation/release/release-gc.d.ts +0 -5
- package/dist/src/foundation/release/release-gc.js +0 -16
- package/dist/src/foundation/supervision/index.d.ts +0 -3
- package/dist/src/foundation/supervision/index.js +0 -3
- package/dist/src/foundation/supervision/paths.d.ts +0 -1
- package/dist/src/foundation/supervision/paths.js +0 -1
- package/dist/src/foundation/ui-components/spans.d.ts +0 -7
- package/dist/src/foundation/ui-components/spans.js +0 -59
- package/docs/manual-transparent-checkpoint.md +0 -53
- /package/dist/{src/cli → cli}/index.d.ts +0 -0
- /package/dist/{src/cli → cli}/index.js +0 -0
- /package/dist/{src/cli → cli}/version.d.ts +0 -0
- /package/dist/{src/cli → cli}/version.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/capability-ports.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain-validation.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/domain.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/index.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/model.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/package-ports.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/ports.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/serialization.js +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.d.ts +0 -0
- /package/dist/{src/foundation/agent-engine-contracts → contracts/agent-engine}/validation.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/extension-ui.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/index.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/index.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.js +0 -0
- /package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.d.ts +0 -0
- /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.d.ts +0 -0
- /package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.js +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.d.ts +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/index.js +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.d.ts +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/model.js +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.d.ts +0 -0
- /package/dist/{src/foundation/workspace-contracts → contracts/workspace}/validation.js +0 -0
- /package/dist/{src/features → features}/launch/development-launch.d.ts +0 -0
- /package/dist/{src/features → features}/launch/initialize-profile.d.ts +0 -0
- /package/dist/{src/features → features}/launch/initialize-profile.js +0 -0
- /package/dist/{src/features → features}/launch/runtime-selection.js +0 -0
- /package/dist/{src/features → features}/workspace/capabilities.js +0 -0
- /package/dist/{src/features → features}/workspace/index.d.ts +0 -0
- /package/dist/{src/features → features}/workspace/index.js +0 -0
- /package/dist/{src/features → features}/workspace/presentation.d.ts +0 -0
- /package/dist/{src/features → features}/workspace/presentation.js +0 -0
- /package/dist/{src/features → features}/workspace/reconciliation.d.ts +0 -0
- /package/dist/{src/features → features}/workspace/reconciliation.js +0 -0
- /package/dist/{src/foundation → foundation}/launch-guardian/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/launch-guardian/index.js +0 -0
- /package/dist/{src/foundation → foundation}/launch-guardian/main.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/commands.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/commands.js +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/index.js +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/launch-instance.js +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/evidence.js +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/index.js +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/native-host-protocol/proof-gate.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/artifact.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/artifact.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/contracts.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/contracts.js +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/process-containment/index.js +0 -0
- /package/dist/{src/foundation → foundation}/protocol/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/protocol/index.js +0 -0
- /package/dist/{src/foundation → foundation}/release/cohort-selection.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/cohort-selection.js +0 -0
- /package/dist/{src/foundation → foundation}/release/concurrency.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/concurrency.js +0 -0
- /package/dist/{src/foundation → foundation}/release/process-cleanup.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/process-cleanup.js +0 -0
- /package/dist/{src/foundation → foundation}/release/stable-release.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/release/stable-release.js +0 -0
- /package/dist/{src/foundation → foundation}/storage/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/storage/index.js +0 -0
- /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/structured-agent-runtime/index.js +0 -0
- /package/dist/{src/foundation → foundation}/supervision/main.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/components.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/resources/builtin-themes.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-editor-autocomplete.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-extension-ui.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/theme.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/countdown-timer.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/custom-entry.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/daxnuts.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/earendil-announcement.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/earendil-announcement.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/extension-editor.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/first-time-setup.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/markdown-transform.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/mermaid.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/owned-editor.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/owned-editor.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector-search.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/skill-invocation-message.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/status-indicator.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/tree-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/trust-selector.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/external-editor.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/model-search.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme-controller.js +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.d.ts +0 -0
- /package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/theme/theme.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/pi-settings-metadata.json +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.d.ts +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/public-main-entry.js +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.d.ts +0 -0
- /package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.js +0 -0
- /package/dist/{src/foundation/pi-owned-ui-integration → integrations/pi/session-ui}/route-host.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.d.ts +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/conformance.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.js +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/presentation-adapter.js +0 -0
- /package/dist/{src/foundation/ui-apps → ui/apps}/contracts.js +0 -0
- /package/dist/{src/foundation/ui-apps → ui/apps}/index.d.ts +0 -0
- /package/dist/{src/foundation/ui-apps → ui/apps}/index.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/dialog-panel.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/label.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/label.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/list-block.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/list-block.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/pane.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/pane.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/revision.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/revision.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/status-line.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/status-line.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/stepper.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/stepper.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/theme.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/theme.js +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/value-menu.d.ts +0 -0
- /package/dist/{src/foundation/ui-components → ui/components}/value-menu.js +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/index.js +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.d.ts +0 -0
- /package/dist/{src/foundation/owned-ui-settings → ui/settings}/resolution.js +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { OwnedUiViewportSettings } from "../../../contracts/owned-ui/index.js";
|
|
2
|
+
import { type TranscriptViewportFrame, type TranscriptViewportFrameInput } from "../../../ui/components/index.js";
|
|
3
|
+
import type { PiShellEditorPort } from "../components/index.js";
|
|
4
|
+
export interface SessionViewportControllerOptions {
|
|
5
|
+
readonly enabled: boolean;
|
|
6
|
+
readonly editor: PiShellEditorPort;
|
|
7
|
+
readonly requestRender: (force?: boolean) => void;
|
|
8
|
+
/** Whether mutable editor URL chips need an immediate forced repaint on deletion. */
|
|
9
|
+
readonly hasEditorLinks?: () => boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionViewportInputResult {
|
|
12
|
+
readonly data: string;
|
|
13
|
+
readonly consumed: boolean;
|
|
14
|
+
readonly copyText?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Owns the stateful interaction policy of the bare-A1 session viewport. The
|
|
18
|
+
* shell root supplies semantic rows and dock geometry; this controller owns
|
|
19
|
+
* follow state, selection, pointer latches, timers, and input routing.
|
|
20
|
+
*/
|
|
21
|
+
export declare class SessionViewportController {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(options: SessionViewportControllerOptions);
|
|
24
|
+
get config(): OwnedUiViewportSettings;
|
|
25
|
+
get editorPointerSelecting(): boolean;
|
|
26
|
+
get transcriptPointerSelecting(): boolean;
|
|
27
|
+
get hasSelection(): boolean;
|
|
28
|
+
get selectionRevision(): number;
|
|
29
|
+
get presentationRevision(): number;
|
|
30
|
+
get frame(): TranscriptViewportFrame | null;
|
|
31
|
+
setEditorPointerFrame(frame: {
|
|
32
|
+
readonly rowStart: number;
|
|
33
|
+
readonly rowEnd: number;
|
|
34
|
+
} | undefined): void;
|
|
35
|
+
compose(input: TranscriptViewportFrameInput): TranscriptViewportFrame;
|
|
36
|
+
composeDockOnly(dockRows: readonly string[], width: number, height: number): TranscriptViewportFrame | null;
|
|
37
|
+
/** Returns true when document wrapping may have changed. */
|
|
38
|
+
setConfig(config: OwnedUiViewportSettings): boolean;
|
|
39
|
+
resumeFollowing(): void;
|
|
40
|
+
noteCompletedAssistantMessage(): void;
|
|
41
|
+
reset(): void;
|
|
42
|
+
clearPointerState(): void;
|
|
43
|
+
handlePreInput(data: string, allowWheel?: boolean, now?: number): SessionViewportInputResult;
|
|
44
|
+
}
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { TranscriptViewport, hyperlinkTargetAtColumn, routeMouseInput, scrollForTrackPage, scrollForThumbRow, scrollbarSelectionRows, scrollbarWheelRows, } from "../../../ui/components/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Owns the stateful interaction policy of the bare-A1 session viewport. The
|
|
4
|
+
* shell root supplies semantic rows and dock geometry; this controller owns
|
|
5
|
+
* follow state, selection, pointer latches, timers, and input routing.
|
|
6
|
+
*/
|
|
7
|
+
export class SessionViewportController {
|
|
8
|
+
#enabled;
|
|
9
|
+
#editor;
|
|
10
|
+
#requestRender;
|
|
11
|
+
#hasEditorLinks;
|
|
12
|
+
#viewport = new TranscriptViewport();
|
|
13
|
+
#config = {
|
|
14
|
+
scrollbarAppearance: "auto",
|
|
15
|
+
scrollbarStyle: "thin",
|
|
16
|
+
scrollbarSpeed: "normal",
|
|
17
|
+
};
|
|
18
|
+
#dragGrabOffset = null;
|
|
19
|
+
// Invariant: a left-button sequence begun in dock chrome remains owned by the dock.
|
|
20
|
+
#dockPointerSuppressed = false;
|
|
21
|
+
// Invariant: editor selection remains true only while its left button is held.
|
|
22
|
+
#editorPointerSelecting = false;
|
|
23
|
+
// Invariant: pointer routing uses the most recently composed editor rows.
|
|
24
|
+
#editorPointerFrame;
|
|
25
|
+
#selectionAutoScrollTimer;
|
|
26
|
+
#selectionAutoScrollPointer;
|
|
27
|
+
#pointerPosition;
|
|
28
|
+
#hoveredHyperlinkKey;
|
|
29
|
+
#lastRequestedSelectionRevision = -1;
|
|
30
|
+
#presentationRevision = 0;
|
|
31
|
+
#activityTimer;
|
|
32
|
+
constructor(options) {
|
|
33
|
+
this.#enabled = options.enabled;
|
|
34
|
+
this.#editor = options.editor;
|
|
35
|
+
this.#requestRender = force => {
|
|
36
|
+
this.#presentationRevision += 1;
|
|
37
|
+
options.requestRender(force);
|
|
38
|
+
};
|
|
39
|
+
this.#hasEditorLinks = options.hasEditorLinks ?? (() => false);
|
|
40
|
+
}
|
|
41
|
+
get config() {
|
|
42
|
+
return this.#config;
|
|
43
|
+
}
|
|
44
|
+
get editorPointerSelecting() {
|
|
45
|
+
return this.#editorPointerSelecting;
|
|
46
|
+
}
|
|
47
|
+
get transcriptPointerSelecting() {
|
|
48
|
+
return this.#viewport.selectionActive;
|
|
49
|
+
}
|
|
50
|
+
get hasSelection() {
|
|
51
|
+
return this.#viewport.hasSelection;
|
|
52
|
+
}
|
|
53
|
+
get selectionRevision() {
|
|
54
|
+
return this.#viewport.selectionRevision;
|
|
55
|
+
}
|
|
56
|
+
get presentationRevision() {
|
|
57
|
+
return this.#presentationRevision;
|
|
58
|
+
}
|
|
59
|
+
get frame() {
|
|
60
|
+
return this.#viewport.frame;
|
|
61
|
+
}
|
|
62
|
+
setEditorPointerFrame(frame) {
|
|
63
|
+
this.#editorPointerFrame = frame;
|
|
64
|
+
}
|
|
65
|
+
compose(input) {
|
|
66
|
+
this.#viewport.setConfig(this.#config);
|
|
67
|
+
const selectionRevision = this.#viewport.selectionRevision;
|
|
68
|
+
const frame = this.#viewport.compose(input);
|
|
69
|
+
// Concurrency: if selection changed during composition, this frame truthfully carries
|
|
70
|
+
// the older revision and exactly one ordinary follow-up render publishes the latest.
|
|
71
|
+
if (this.#viewport.selectionRevision !== selectionRevision
|
|
72
|
+
&& this.#lastRequestedSelectionRevision < this.#viewport.selectionRevision) {
|
|
73
|
+
this.#lastRequestedSelectionRevision = this.#viewport.selectionRevision;
|
|
74
|
+
this.#requestRender();
|
|
75
|
+
}
|
|
76
|
+
if (this.#pointerPosition !== undefined && !this.#viewport.selectionActive && !this.#editorPointerSelecting) {
|
|
77
|
+
const next = this.#hyperlinkKeyAt(frame, this.#pointerPosition.column, this.#pointerPosition.row);
|
|
78
|
+
if (this.#hoveredHyperlinkKey !== undefined && next !== this.#hoveredHyperlinkKey) {
|
|
79
|
+
// Platform: Windows Terminal can leave its solid native-hover underline behind
|
|
80
|
+
// when a following viewport moves the link away from a stationary pointer.
|
|
81
|
+
this.#requestRender(true);
|
|
82
|
+
}
|
|
83
|
+
this.#hoveredHyperlinkKey = next;
|
|
84
|
+
}
|
|
85
|
+
return frame;
|
|
86
|
+
}
|
|
87
|
+
composeDockOnly(dockRows, width, height) {
|
|
88
|
+
return this.#viewport.composeDockOnly(dockRows, width, height);
|
|
89
|
+
}
|
|
90
|
+
/** Returns true when document wrapping may have changed. */
|
|
91
|
+
setConfig(config) {
|
|
92
|
+
const appearanceChanged = config.scrollbarAppearance !== this.#config.scrollbarAppearance;
|
|
93
|
+
this.#config = config;
|
|
94
|
+
this.#viewport.setConfig(config);
|
|
95
|
+
this.#requestRender();
|
|
96
|
+
return appearanceChanged;
|
|
97
|
+
}
|
|
98
|
+
resumeFollowing() {
|
|
99
|
+
if (!this.#enabled)
|
|
100
|
+
return;
|
|
101
|
+
this.#stopSelectionAutoScroll();
|
|
102
|
+
const selectionChanged = this.#viewport.clearSelection();
|
|
103
|
+
const scrolled = this.#viewport.scrollToEnd();
|
|
104
|
+
if (scrolled)
|
|
105
|
+
this.#scheduleActivityExpiry();
|
|
106
|
+
if (scrolled || selectionChanged)
|
|
107
|
+
this.#requestRender();
|
|
108
|
+
}
|
|
109
|
+
noteCompletedAssistantMessage() {
|
|
110
|
+
if (!this.#enabled || !this.#viewport.noteNewMessage())
|
|
111
|
+
return;
|
|
112
|
+
this.#requestRender();
|
|
113
|
+
}
|
|
114
|
+
reset() {
|
|
115
|
+
this.#presentationRevision += 1;
|
|
116
|
+
this.#clearActivityTimer();
|
|
117
|
+
this.#stopSelectionAutoScroll();
|
|
118
|
+
this.#editorPointerSelecting = false;
|
|
119
|
+
this.#editorPointerFrame = undefined;
|
|
120
|
+
this.#pointerPosition = undefined;
|
|
121
|
+
this.#hoveredHyperlinkKey = undefined;
|
|
122
|
+
this.#viewport.reset();
|
|
123
|
+
}
|
|
124
|
+
clearPointerState() {
|
|
125
|
+
this.#presentationRevision += 1;
|
|
126
|
+
this.#clearActivityTimer();
|
|
127
|
+
this.#dragGrabOffset = null;
|
|
128
|
+
this.#dockPointerSuppressed = false;
|
|
129
|
+
this.#editorPointerSelecting = false;
|
|
130
|
+
this.#editorPointerFrame = undefined;
|
|
131
|
+
this.#pointerPosition = undefined;
|
|
132
|
+
this.#hoveredHyperlinkKey = undefined;
|
|
133
|
+
this.#stopSelectionAutoScroll();
|
|
134
|
+
this.#viewport.clearSelection();
|
|
135
|
+
this.#viewport.clearTransient();
|
|
136
|
+
}
|
|
137
|
+
handlePreInput(data, allowWheel = true, now = Date.now()) {
|
|
138
|
+
if (!this.#enabled)
|
|
139
|
+
return { data, consumed: false };
|
|
140
|
+
// Compatibility: Pi components share one keybinding manager. Restore bare A1's aliases
|
|
141
|
+
// before the focused vanilla editor handles this input.
|
|
142
|
+
this.#editor.activateKeybindings();
|
|
143
|
+
// Platform: handle the physical paste chord at the pre-input boundary. Windows
|
|
144
|
+
// terminals vary between forwarding Ctrl+V and terminal-owned bracketed paste.
|
|
145
|
+
if (this.#editor.matchesTerminalKey(data, "ctrl+v") && this.#editor.pasteClipboard()) {
|
|
146
|
+
return { data: "", consumed: true };
|
|
147
|
+
}
|
|
148
|
+
// Platform: URL chip deletion must overwrite terminal link cells in the same frame.
|
|
149
|
+
if (EDITOR_LINK_DELETION_INPUTS.has(data) && this.#hasEditorLinks())
|
|
150
|
+
this.#requestRender(true);
|
|
151
|
+
if (this.#viewport.frame === null)
|
|
152
|
+
return { data, consumed: false };
|
|
153
|
+
if (data === "\u0003") {
|
|
154
|
+
if (this.#editor.hasSelection()) {
|
|
155
|
+
if (this.#viewport.clearSelection())
|
|
156
|
+
this.#requestRender();
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
const copyText = this.#viewport.selectedText();
|
|
160
|
+
if (copyText !== null && copyText.length > 0) {
|
|
161
|
+
this.#viewport.clearSelection();
|
|
162
|
+
this.#requestRender();
|
|
163
|
+
return { data: "", consumed: true, copyText };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (allowWheel && this.#editor.matchesTerminalKey(data, "home")) {
|
|
168
|
+
if (this.#viewport.scrollTo(0, now)) {
|
|
169
|
+
this.#scheduleActivityExpiry();
|
|
170
|
+
this.#requestRender();
|
|
171
|
+
}
|
|
172
|
+
return { data: "", consumed: true };
|
|
173
|
+
}
|
|
174
|
+
if (allowWheel && this.#editor.matchesTerminalKey(data, "end")) {
|
|
175
|
+
if (!this.#viewport.followingEnd) {
|
|
176
|
+
this.#viewport.scrollToEnd(now);
|
|
177
|
+
this.#scheduleActivityExpiry();
|
|
178
|
+
this.#requestRender();
|
|
179
|
+
}
|
|
180
|
+
return { data: "", consumed: true };
|
|
181
|
+
}
|
|
182
|
+
if (allowWheel && (SHIFT_UP_INPUTS.has(data) || SHIFT_DOWN_INPUTS.has(data))) {
|
|
183
|
+
const scrolled = SHIFT_UP_INPUTS.has(data)
|
|
184
|
+
? this.#viewport.scrollToPreviousPrompt(now)
|
|
185
|
+
: this.#viewport.scrollToNextPrompt(now);
|
|
186
|
+
if (scrolled) {
|
|
187
|
+
this.#scheduleActivityExpiry();
|
|
188
|
+
this.#requestRender();
|
|
189
|
+
}
|
|
190
|
+
return { data: "", consumed: true };
|
|
191
|
+
}
|
|
192
|
+
if (!data.includes("\u001b[<") && data !== "\u0003" && this.#viewport.clearSelection()) {
|
|
193
|
+
this.#requestRender();
|
|
194
|
+
}
|
|
195
|
+
const frame = this.#viewport.frame;
|
|
196
|
+
let repaint = false;
|
|
197
|
+
let forceRepaint = false;
|
|
198
|
+
let activity = false;
|
|
199
|
+
const routed = routeMouseInput(data, event => {
|
|
200
|
+
const hits = frame.hits;
|
|
201
|
+
const overRail = hits.rail !== null
|
|
202
|
+
&& event.column === hits.rail.column
|
|
203
|
+
&& event.row >= hits.rail.rowStart
|
|
204
|
+
&& event.row < hits.rail.rowStart + hits.rail.trackHeight;
|
|
205
|
+
const overSticky = hits.sticky !== null && event.row === hits.sticky.row && event.column <= hits.sticky.width;
|
|
206
|
+
const overBottom = hits.bottom !== null && event.row === hits.bottom.row
|
|
207
|
+
&& event.column >= hits.bottom.columnStart && event.column <= hits.bottom.columnEnd;
|
|
208
|
+
if (event.kind === "motion") {
|
|
209
|
+
this.#pointerPosition = { column: event.column, row: event.row };
|
|
210
|
+
if (!this.#viewport.selectionActive && !this.#editorPointerSelecting) {
|
|
211
|
+
const nextHyperlink = this.#hyperlinkKeyAt(frame, event.column, event.row);
|
|
212
|
+
if (this.#hoveredHyperlinkKey !== undefined && nextHyperlink !== this.#hoveredHyperlinkKey) {
|
|
213
|
+
// Platform: a forced redraw overwrites Windows Terminal's cached solid hover
|
|
214
|
+
// underline exactly once when the pointer leaves or changes links.
|
|
215
|
+
forceRepaint = true;
|
|
216
|
+
}
|
|
217
|
+
this.#hoveredHyperlinkKey = nextHyperlink;
|
|
218
|
+
}
|
|
219
|
+
this.#viewport.setRailHovered(overRail);
|
|
220
|
+
this.#viewport.setStickyHovered(overSticky);
|
|
221
|
+
this.#viewport.setBottomHovered(overBottom);
|
|
222
|
+
repaint = true;
|
|
223
|
+
if (this.#editor.ownsPointer() && this.#editorPointerFrame !== undefined) {
|
|
224
|
+
this.#editor.handlePointer({
|
|
225
|
+
kind: "motion",
|
|
226
|
+
button: event.button,
|
|
227
|
+
column: event.column,
|
|
228
|
+
row: event.row - this.#editorPointerFrame.rowStart + 1,
|
|
229
|
+
});
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
if (this.#dockPointerSuppressed)
|
|
233
|
+
return true;
|
|
234
|
+
if (this.#viewport.selectionActive) {
|
|
235
|
+
this.#viewport.extendSelection(event.column, event.row, now, false);
|
|
236
|
+
this.#updateSelectionAutoScroll(event.column, event.row, hits.viewportHeight);
|
|
237
|
+
activity = true;
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
if (this.#dragGrabOffset !== null && hits.rail !== null) {
|
|
241
|
+
const target = scrollForThumbRow(hits.rail.geometry, event.row - hits.rail.rowStart - this.#dragGrabOffset);
|
|
242
|
+
this.#viewport.scrollTo(target, now);
|
|
243
|
+
activity = true;
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
return overRail || overSticky || overBottom;
|
|
247
|
+
}
|
|
248
|
+
if (event.kind === "wheel-up" || event.kind === "wheel-down") {
|
|
249
|
+
if (!allowWheel || event.row < 1 || event.row > hits.viewportHeight)
|
|
250
|
+
return false;
|
|
251
|
+
const distance = scrollbarWheelRows(this.#config.scrollbarSpeed);
|
|
252
|
+
this.#viewport.scrollBy(event.kind === "wheel-up" ? -distance : distance, now);
|
|
253
|
+
activity = true;
|
|
254
|
+
repaint = true;
|
|
255
|
+
forceRepaint = true;
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
if (event.kind === "press") {
|
|
259
|
+
const editorFrame = this.#editorPointerFrame;
|
|
260
|
+
if (event.button === 2 && editorFrame !== undefined
|
|
261
|
+
&& event.row >= editorFrame.rowStart && event.row <= editorFrame.rowEnd) {
|
|
262
|
+
this.#stopSelectionAutoScroll();
|
|
263
|
+
if (this.#viewport.clearSelection())
|
|
264
|
+
repaint = true;
|
|
265
|
+
this.#editor.pasteClipboard();
|
|
266
|
+
this.#dockPointerSuppressed = true;
|
|
267
|
+
repaint = true;
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
if (event.button !== 0)
|
|
271
|
+
return false;
|
|
272
|
+
this.#stopSelectionAutoScroll();
|
|
273
|
+
if (this.#viewport.clearSelection())
|
|
274
|
+
repaint = true;
|
|
275
|
+
if (overBottom) {
|
|
276
|
+
this.#viewport.scrollToEnd(now);
|
|
277
|
+
activity = true;
|
|
278
|
+
repaint = true;
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
if (overSticky && hits.sticky !== null) {
|
|
282
|
+
this.#viewport.scrollTo(hits.sticky.target, now);
|
|
283
|
+
activity = true;
|
|
284
|
+
repaint = true;
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
if (overRail && hits.rail !== null) {
|
|
288
|
+
const trackRow = event.row - hits.rail.rowStart;
|
|
289
|
+
const geometry = hits.rail.geometry;
|
|
290
|
+
if (trackRow >= geometry.thumbTop && trackRow < geometry.thumbTop + geometry.thumbHeight) {
|
|
291
|
+
this.#dragGrabOffset = trackRow - geometry.thumbTop;
|
|
292
|
+
this.#viewport.setRailDragging(true);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
this.#viewport.scrollTo(scrollForTrackPage(geometry, trackRow, frame.scrollTop, hits.viewportHeight), now);
|
|
296
|
+
}
|
|
297
|
+
activity = true;
|
|
298
|
+
repaint = true;
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
if (editorFrame !== undefined && event.row >= editorFrame.rowStart && event.row <= editorFrame.rowEnd) {
|
|
302
|
+
const handled = this.#editor.handlePointer({
|
|
303
|
+
kind: "press",
|
|
304
|
+
button: event.button,
|
|
305
|
+
column: event.column,
|
|
306
|
+
row: event.row - editorFrame.rowStart + 1,
|
|
307
|
+
});
|
|
308
|
+
if (!handled)
|
|
309
|
+
this.#dockPointerSuppressed = true;
|
|
310
|
+
this.#editorPointerSelecting = handled;
|
|
311
|
+
repaint = true;
|
|
312
|
+
return true;
|
|
313
|
+
}
|
|
314
|
+
if (event.row > hits.viewportHeight) {
|
|
315
|
+
this.#dockPointerSuppressed = true;
|
|
316
|
+
return true;
|
|
317
|
+
}
|
|
318
|
+
if (event.row >= 1 && event.row <= hits.viewportHeight && event.column <= frame.contentWidth) {
|
|
319
|
+
this.#viewport.pressSelection(event.column, event.row, now);
|
|
320
|
+
repaint = true;
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
if (event.kind === "release") {
|
|
326
|
+
if (this.#editor.ownsPointer() && this.#editorPointerFrame !== undefined) {
|
|
327
|
+
const wasEditorSelecting = this.#editorPointerSelecting;
|
|
328
|
+
this.#editor.handlePointer({
|
|
329
|
+
kind: "release",
|
|
330
|
+
button: event.button,
|
|
331
|
+
column: event.column,
|
|
332
|
+
row: event.row - this.#editorPointerFrame.rowStart + 1,
|
|
333
|
+
});
|
|
334
|
+
this.#editorPointerSelecting = false;
|
|
335
|
+
forceRepaint ||= wasEditorSelecting;
|
|
336
|
+
repaint = true;
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
if (this.#viewport.releaseSelection()) {
|
|
340
|
+
this.#stopSelectionAutoScroll();
|
|
341
|
+
// Platform: restore OSC 8 links only after the held-button selection paint has
|
|
342
|
+
// ended, then overwrite any terminal-cached hover cells immediately.
|
|
343
|
+
forceRepaint = true;
|
|
344
|
+
repaint = true;
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
if (this.#dragGrabOffset !== null) {
|
|
348
|
+
this.#dragGrabOffset = null;
|
|
349
|
+
this.#viewport.setRailDragging(false);
|
|
350
|
+
repaint = true;
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
if (this.#dockPointerSuppressed) {
|
|
354
|
+
this.#dockPointerSuppressed = false;
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return false;
|
|
359
|
+
});
|
|
360
|
+
if (activity)
|
|
361
|
+
this.#scheduleActivityExpiry();
|
|
362
|
+
if (repaint) {
|
|
363
|
+
this.#lastRequestedSelectionRevision = this.#viewport.selectionRevision;
|
|
364
|
+
this.#requestRender(forceRepaint);
|
|
365
|
+
}
|
|
366
|
+
return routed;
|
|
367
|
+
}
|
|
368
|
+
#hyperlinkKeyAt(frame, column, row) {
|
|
369
|
+
if (row < 1 || row > frame.rows.length || column < 1)
|
|
370
|
+
return undefined;
|
|
371
|
+
const target = hyperlinkTargetAtColumn(frame.rows[row - 1] ?? "", column - 1);
|
|
372
|
+
return target === undefined ? undefined : `${row}\u0000${target}`;
|
|
373
|
+
}
|
|
374
|
+
#updateSelectionAutoScroll(column, row, viewportHeight) {
|
|
375
|
+
const beyondEdge = row <= 1 || row > viewportHeight;
|
|
376
|
+
if (!beyondEdge) {
|
|
377
|
+
this.#stopSelectionAutoScroll();
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
this.#selectionAutoScrollPointer = { column, row };
|
|
381
|
+
if (this.#selectionAutoScrollTimer !== undefined)
|
|
382
|
+
return;
|
|
383
|
+
this.#selectionAutoScrollTimer = setTimeout(() => this.#selectionAutoScrollTick(), SELECTION_AUTO_SCROLL_INTERVAL_MS);
|
|
384
|
+
this.#selectionAutoScrollTimer.unref?.();
|
|
385
|
+
}
|
|
386
|
+
#selectionAutoScrollTick() {
|
|
387
|
+
this.#selectionAutoScrollTimer = undefined;
|
|
388
|
+
const pointer = this.#selectionAutoScrollPointer;
|
|
389
|
+
if (pointer === undefined || !this.#viewport.selectionActive) {
|
|
390
|
+
this.#stopSelectionAutoScroll();
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const before = this.#viewport.scrollTop;
|
|
394
|
+
const rowsPerTick = scrollbarSelectionRows(this.#config.scrollbarSpeed);
|
|
395
|
+
for (let row = 0; row < rowsPerTick; row += 1) {
|
|
396
|
+
const previous = this.#viewport.scrollTop;
|
|
397
|
+
this.#viewport.extendSelection(pointer.column, pointer.row);
|
|
398
|
+
if (this.#viewport.scrollTop === previous)
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
if (this.#viewport.scrollTop === before) {
|
|
402
|
+
this.#stopSelectionAutoScroll();
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
this.#lastRequestedSelectionRevision = this.#viewport.selectionRevision;
|
|
406
|
+
this.#requestRender();
|
|
407
|
+
this.#scheduleActivityExpiry();
|
|
408
|
+
this.#selectionAutoScrollTimer = setTimeout(() => this.#selectionAutoScrollTick(), SELECTION_AUTO_SCROLL_INTERVAL_MS);
|
|
409
|
+
this.#selectionAutoScrollTimer.unref?.();
|
|
410
|
+
}
|
|
411
|
+
#stopSelectionAutoScroll() {
|
|
412
|
+
if (this.#selectionAutoScrollTimer !== undefined)
|
|
413
|
+
clearTimeout(this.#selectionAutoScrollTimer);
|
|
414
|
+
this.#selectionAutoScrollTimer = undefined;
|
|
415
|
+
this.#selectionAutoScrollPointer = undefined;
|
|
416
|
+
}
|
|
417
|
+
#clearActivityTimer() {
|
|
418
|
+
if (this.#activityTimer !== undefined)
|
|
419
|
+
clearTimeout(this.#activityTimer);
|
|
420
|
+
this.#activityTimer = undefined;
|
|
421
|
+
}
|
|
422
|
+
#scheduleActivityExpiry() {
|
|
423
|
+
this.#clearActivityTimer();
|
|
424
|
+
this.#activityTimer = setTimeout(() => {
|
|
425
|
+
this.#activityTimer = undefined;
|
|
426
|
+
this.#requestRender();
|
|
427
|
+
}, 925);
|
|
428
|
+
this.#activityTimer.unref?.();
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
const SELECTION_AUTO_SCROLL_INTERVAL_MS = 30;
|
|
432
|
+
const EDITOR_LINK_DELETION_INPUTS = new Set(["\b", "\u007f", "\u001b[3~"]);
|
|
433
|
+
const SHIFT_UP_INPUTS = new Set(["\u001b[1;2A"]);
|
|
434
|
+
const SHIFT_DOWN_INPUTS = new Set(["\u001b[1;2B"]);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 33 ms (30.3 fps): baseline chunks arrive every 5 ms, while this cadence
|
|
3
|
+
* retains immediate first paint/input and explicit final-state flushing.
|
|
4
|
+
*/
|
|
5
|
+
export declare const STREAM_PRESENTATION_INTERVAL_MS = 33;
|
|
6
|
+
export interface StreamPresentationScheduler {
|
|
7
|
+
now(): number;
|
|
8
|
+
setTimeout(callback: () => void, delayMs: number): ReturnType<typeof setTimeout>;
|
|
9
|
+
clearTimeout(timer: ReturnType<typeof setTimeout>): void;
|
|
10
|
+
}
|
|
11
|
+
/** Bounds terminal presentation requests while semantic root state remains current. */
|
|
12
|
+
export declare class StreamPresentationCoalescer {
|
|
13
|
+
#private;
|
|
14
|
+
readonly present: () => void;
|
|
15
|
+
readonly intervalMs: number;
|
|
16
|
+
readonly scheduler: StreamPresentationScheduler;
|
|
17
|
+
constructor(present: () => void, intervalMs?: number, scheduler?: StreamPresentationScheduler);
|
|
18
|
+
get pending(): boolean;
|
|
19
|
+
request(): void;
|
|
20
|
+
/** Cancels a superseded stream frame; the immediate input/overlay/resize path renders current state. */
|
|
21
|
+
preempt(): void;
|
|
22
|
+
/** Records an immediate input/status/overlay frame and cancels an obsolete stream timer. */
|
|
23
|
+
noteImmediatePresentation(): void;
|
|
24
|
+
/** Presents current semantic state immediately regardless of pending stream work. */
|
|
25
|
+
presentImmediate(): void;
|
|
26
|
+
/** Presents the newest semantic state immediately only when a stream frame is pending. */
|
|
27
|
+
flush(): void;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 33 ms (30.3 fps): baseline chunks arrive every 5 ms, while this cadence
|
|
3
|
+
* retains immediate first paint/input and explicit final-state flushing.
|
|
4
|
+
*/
|
|
5
|
+
export const STREAM_PRESENTATION_INTERVAL_MS = 33;
|
|
6
|
+
const SYSTEM_SCHEDULER = {
|
|
7
|
+
now: Date.now,
|
|
8
|
+
setTimeout: (callback, delayMs) => setTimeout(callback, delayMs),
|
|
9
|
+
clearTimeout: timer => clearTimeout(timer),
|
|
10
|
+
};
|
|
11
|
+
/** Bounds terminal presentation requests while semantic root state remains current. */
|
|
12
|
+
export class StreamPresentationCoalescer {
|
|
13
|
+
present;
|
|
14
|
+
intervalMs;
|
|
15
|
+
scheduler;
|
|
16
|
+
#timer;
|
|
17
|
+
#lastPresentationAt = Number.NEGATIVE_INFINITY;
|
|
18
|
+
#disposed = false;
|
|
19
|
+
constructor(present, intervalMs = STREAM_PRESENTATION_INTERVAL_MS, scheduler = SYSTEM_SCHEDULER) {
|
|
20
|
+
this.present = present;
|
|
21
|
+
this.intervalMs = intervalMs;
|
|
22
|
+
this.scheduler = scheduler;
|
|
23
|
+
if (!Number.isSafeInteger(intervalMs) || intervalMs < 1)
|
|
24
|
+
throw new RangeError("stream presentation interval must be positive");
|
|
25
|
+
}
|
|
26
|
+
get pending() { return this.#timer !== undefined; }
|
|
27
|
+
request() {
|
|
28
|
+
if (this.#disposed || this.#timer !== undefined)
|
|
29
|
+
return;
|
|
30
|
+
const elapsed = this.scheduler.now() - this.#lastPresentationAt;
|
|
31
|
+
if (elapsed >= this.intervalMs) {
|
|
32
|
+
this.#presentNow();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.#timer = this.scheduler.setTimeout(() => {
|
|
36
|
+
this.#timer = undefined;
|
|
37
|
+
this.#presentNow();
|
|
38
|
+
}, Math.max(0, this.intervalMs - elapsed));
|
|
39
|
+
}
|
|
40
|
+
/** Cancels a superseded stream frame; the immediate input/overlay/resize path renders current state. */
|
|
41
|
+
preempt() {
|
|
42
|
+
if (this.#timer === undefined)
|
|
43
|
+
return;
|
|
44
|
+
this.scheduler.clearTimeout(this.#timer);
|
|
45
|
+
this.#timer = undefined;
|
|
46
|
+
}
|
|
47
|
+
/** Records an immediate input/status/overlay frame and cancels an obsolete stream timer. */
|
|
48
|
+
noteImmediatePresentation() {
|
|
49
|
+
if (this.#disposed)
|
|
50
|
+
return;
|
|
51
|
+
this.preempt();
|
|
52
|
+
this.#lastPresentationAt = this.scheduler.now();
|
|
53
|
+
}
|
|
54
|
+
/** Presents current semantic state immediately regardless of pending stream work. */
|
|
55
|
+
presentImmediate() {
|
|
56
|
+
if (this.#disposed)
|
|
57
|
+
return;
|
|
58
|
+
this.noteImmediatePresentation();
|
|
59
|
+
this.present();
|
|
60
|
+
}
|
|
61
|
+
/** Presents the newest semantic state immediately only when a stream frame is pending. */
|
|
62
|
+
flush() {
|
|
63
|
+
if (this.#disposed || this.#timer === undefined)
|
|
64
|
+
return;
|
|
65
|
+
this.scheduler.clearTimeout(this.#timer);
|
|
66
|
+
this.#timer = undefined;
|
|
67
|
+
this.#presentNow();
|
|
68
|
+
}
|
|
69
|
+
dispose() {
|
|
70
|
+
this.preempt();
|
|
71
|
+
this.#disposed = true;
|
|
72
|
+
}
|
|
73
|
+
#presentNow() {
|
|
74
|
+
if (this.#disposed)
|
|
75
|
+
return;
|
|
76
|
+
this.#lastPresentationAt = this.scheduler.now();
|
|
77
|
+
this.present();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PiShellClipboardContent } from "../components/index.js";
|
|
2
|
+
export interface SystemClipboardImageReader {
|
|
3
|
+
hasImage(): boolean;
|
|
4
|
+
getImageBinary?(): Promise<readonly number[]>;
|
|
5
|
+
getImageBase64?(): Promise<string>;
|
|
6
|
+
}
|
|
7
|
+
/** Load the native adapter during shell startup so the first paste is warm. */
|
|
8
|
+
export declare function preloadSystemClipboard(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Reads plain text through platform clipboard commands without importing Pi's
|
|
11
|
+
* private clipboard module. Failures are deliberately non-fatal: a denied or
|
|
12
|
+
* unavailable clipboard simply makes the paste action a no-op.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readSystemClipboardContent(): Promise<PiShellClipboardContent | null>;
|
|
15
|
+
export declare function readSystemClipboardImage(reader: SystemClipboardImageReader): Promise<{
|
|
16
|
+
readonly data: string;
|
|
17
|
+
readonly mimeType: string;
|
|
18
|
+
} | null>;
|
|
19
|
+
export declare function readSystemClipboardText(): Promise<string | null>;
|
|
20
|
+
export declare function writeSystemClipboardText(text: string): Promise<void>;
|