@timurproko/a1 0.1.8-dev.235df0e → 0.1.8-dev.260
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 +8 -3
- 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 +2 -2
- package/bin/sync-pi-tui-proxy.js +97 -0
- package/bin/ui.js +47 -20
- package/bin/warmup.js +27 -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 +15 -1
- package/dist/cli/dispatch.js +261 -0
- package/dist/cli/package-messages.d.ts +26 -0
- package/dist/cli/package-messages.js +71 -0
- package/dist/{src/cli → cli}/packages.d.ts +11 -2
- package/dist/{src/cli → cli}/packages.js +24 -27
- 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 +31 -0
- package/dist/composition/owned-ui.js +66 -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/agent-engine-contracts → contracts/agent-engine}/package-ports.d.ts +6 -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/features/launch/intent.d.ts +10 -0
- package/dist/features/launch/intent.js +8 -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 +2 -0
- package/dist/{src/features → features}/owned-ui/index.js +2 -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/features/owned-ui/session-fork-prompt.d.ts +8 -0
- package/dist/features/owned-ui/session-fork-prompt.js +34 -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.d.ts +2 -0
- package/dist/{src/foundation → foundation}/launch-guardian/main.js +18 -5
- package/dist/{src/foundation → foundation}/lifecycle/index.d.ts +2 -0
- package/dist/{src/foundation → foundation}/lifecycle/index.js +2 -0
- 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 +30 -0
- package/dist/{src/foundation → foundation}/lifecycle/paths.js +29 -1
- package/dist/foundation/lifecycle/session-selection.d.ts +9 -0
- package/dist/foundation/lifecycle/session-selection.js +39 -0
- package/dist/foundation/lifecycle/supervisor-startup.d.ts +30 -0
- package/dist/foundation/lifecycle/supervisor-startup.js +106 -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/foundation/process-containment/darwin-process-inspector.d.ts +5 -0
- package/dist/foundation/process-containment/darwin-process-inspector.js +7 -0
- package/dist/{src/foundation → foundation}/process-containment/index.d.ts +1 -0
- package/dist/{src/foundation → foundation}/process-containment/index.js +1 -0
- 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 +3 -1
- package/dist/{src/foundation → foundation}/process-containment/windows-process-inspector.js +5 -2
- 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 +25 -6
- package/dist/{src/foundation → foundation}/release/bootstrap.js +124 -34
- 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 +82 -0
- package/dist/foundation/release/dependency-layer.js +497 -0
- package/dist/foundation/release/endpoints.d.ts +20 -0
- package/dist/foundation/release/endpoints.js +50 -0
- package/dist/foundation/release/immutable-platform.d.ts +6 -0
- package/dist/foundation/release/immutable-platform.js +13 -0
- package/dist/{src/foundation → foundation}/release/index.d.ts +4 -0
- package/dist/{src/foundation → foundation}/release/index.js +4 -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 +7 -3
- package/dist/{src/foundation → foundation}/release/release-store.js +65 -13
- package/dist/{src/foundation → foundation}/release/release.d.ts +4 -1
- package/dist/{src/foundation → foundation}/release/release.js +10 -3
- package/dist/foundation/release/restart-certification.d.ts +67 -0
- package/dist/foundation/release/restart-certification.js +211 -0
- 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 +116 -56
- 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/foundation/supervision/main.d.ts +1 -0
- package/dist/foundation/supervision/main.js +80 -0
- 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 +65 -3
- 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/{src/foundation/pi-component-adapter → integrations/pi/components}/index.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.js +1 -1
- 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 +49 -18
- 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 +5 -2
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.js +2 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.d.ts +57 -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 +28 -4
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.js +714 -127
- 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 +4 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/index.js +4 -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 +32 -26
- 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 +19 -1
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/runtime-integration.js +47 -5
- 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/session-selection.d.ts +28 -0
- package/dist/integrations/pi/engine/session-selection.js +90 -0
- 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/{src/foundation/pi-engine-adapter → integrations/pi/engine}/workflows.d.ts +18 -1
- 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 +141 -0
- package/dist/integrations/pi/session-ui/session-shell-root.js +1158 -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 +479 -719
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +45 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +463 -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 +74 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +380 -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 +4 -4
- package/dist/native/darwin-arm64/process-guardian +0 -0
- 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 +5 -0
- package/dist/{src/foundation/ui-components → ui/components}/index.js +5 -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 +208 -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 +152 -0
- package/dist/ui/components/transcript-viewport.js +631 -0
- package/dist/ui/components/visible-hyperlinks.d.ts +19 -0
- package/dist/ui/components/visible-hyperlinks.js +64 -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/process-guardian-provenance.md +3 -1
- 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 +36 -5
- package/docs/ci-release-runbook.md +186 -79
- package/docs/features/launch-profiles.md +24 -17
- package/docs/manual-ghost-link-baseline.md +89 -0
- 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.d.ts +0 -7
- 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 -106
- 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/main.d.ts +0 -1
- package/dist/src/foundation/supervision/main.js +0 -41
- 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.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}/lifecycle/commands.d.ts +0 -0
- /package/dist/{src/foundation → foundation}/lifecycle/commands.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}/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/pi-component-adapter → integrations/pi/components}/components.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}/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.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
|
@@ -1,146 +1,106 @@
|
|
|
1
1
|
import { AssistantMessageComponent, BashExecutionComponent, CompactionSummaryMessageComponent, CustomMessageComponent, DynamicBorder, getMarkdownTheme, parseSkillBlock, ToolExecutionComponent, UserMessageComponent, } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import { SkillInvocationMessageComponent
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { SkillInvocationMessageComponent } from "./upstream/components/skill-invocation-message.js";
|
|
3
|
+
import { createMermaidMarkdownTransformer } from "./upstream/components/mermaid.js";
|
|
4
|
+
import { Container, Image, Spacer, Text, } from "#pi-tui";
|
|
5
|
+
import { PRODUCT_TEXT } from "../../../product-identity.js";
|
|
6
|
+
import { createPiSubmittedPromptComponent, } from "./submitted-prompt-adapter.js";
|
|
6
7
|
import { PINNED_PI_LAYOUT, piTheme, } from "./theme.js";
|
|
7
|
-
import { componentPort, createTuiFacade, ensureTheme,
|
|
8
|
-
export function
|
|
9
|
-
ensureTheme();
|
|
10
|
-
return new Text(piTheme().fg("dim", message), PINNED_PI_LAYOUT.outputPad, 0).render(width);
|
|
11
|
-
}
|
|
12
|
-
export function createPiShellSessionInfo(presentation) {
|
|
13
|
-
ensureTheme();
|
|
14
|
-
const { stats, sessionName, cacheWaste, usageBreakdown } = presentation;
|
|
15
|
-
let info = `${piTheme().bold("Session Info")}\n\n`;
|
|
16
|
-
if (sessionName)
|
|
17
|
-
info += `${piTheme().fg("dim", "Name:")} ${sessionName}\n`;
|
|
18
|
-
info += `${piTheme().fg("dim", "File:")} ${stats.sessionFile ?? "In-memory"}\n`;
|
|
19
|
-
info += `${piTheme().fg("dim", "ID:")} ${stats.sessionId}\n\n`;
|
|
20
|
-
info += `${piTheme().bold("Messages")}\n`;
|
|
21
|
-
info += `${piTheme().fg("dim", "Total:")} ${stats.totalMessages}\n`;
|
|
22
|
-
info += `${piTheme().fg("dim", "User:")} ${stats.userMessages}\n`;
|
|
23
|
-
info += `${piTheme().fg("dim", "Assistant:")} ${stats.assistantMessages}\n`;
|
|
24
|
-
info += `${piTheme().fg("dim", "Tools:")} ${stats.toolCalls} calls, ${stats.toolResults} results\n\n`;
|
|
25
|
-
info += `${piTheme().bold("Tokens")}\n`;
|
|
26
|
-
const { input, cacheRead, cacheWrite } = stats.tokens;
|
|
27
|
-
const promptTokens = input + cacheRead + cacheWrite;
|
|
28
|
-
info += `${piTheme().fg("dim", "Input:")} ${promptTokens.toLocaleString()}\n`;
|
|
29
|
-
if (promptTokens > 0 && (cacheRead > 0 || cacheWrite > 0)) {
|
|
30
|
-
const hitRate = piTheme().fg("dim", `(${((cacheRead / promptTokens) * 100).toFixed(1)}%)`);
|
|
31
|
-
info += ` ${piTheme().fg("dim", "Cached:")} ${cacheRead.toLocaleString()} ${hitRate}\n`;
|
|
32
|
-
const written = cacheWrite > 0 ? ` ${piTheme().fg("dim", `(${cacheWrite.toLocaleString()} written to cache)`)}` : "";
|
|
33
|
-
info += ` ${piTheme().fg("dim", "Uncached:")} ${(input + cacheWrite).toLocaleString()}${written}\n`;
|
|
34
|
-
}
|
|
35
|
-
info += `${piTheme().fg("dim", "Output:")} ${stats.tokens.output.toLocaleString()}\n`;
|
|
36
|
-
info += `${piTheme().fg("dim", "Total:")} ${stats.tokens.total.toLocaleString()}\n`;
|
|
37
|
-
if (stats.cost > 0 || cacheWaste.missedTokens > 0) {
|
|
38
|
-
info += `\n${piTheme().bold("Cost")}\n`;
|
|
39
|
-
info += `${piTheme().fg("dim", "Total:")} $${stats.cost.toFixed(3)}`;
|
|
40
|
-
if (usageBreakdown.length > 1) {
|
|
41
|
-
for (const entry of usageBreakdown) {
|
|
42
|
-
info += `\n ${piTheme().fg("dim", `${entry.key}:`)} $${entry.cost.toFixed(3)} ${piTheme().fg("dim", `(${formatSessionTokens(entry.tokens)} tokens)`)}`;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
if (cacheWaste.missedTokens > 0) {
|
|
46
|
-
const missLabel = cacheWaste.missCount === 1 ? "1 miss" : `${cacheWaste.missCount} misses`;
|
|
47
|
-
const detail = `${cacheWaste.missedTokens.toLocaleString()} tokens, ${missLabel}`;
|
|
48
|
-
info += cacheWaste.missedCost >= 0.0001
|
|
49
|
-
? `\n${piTheme().fg("dim", "Cache Re-billed:")} $${cacheWaste.missedCost.toFixed(3)} ${piTheme().fg("dim", `(${detail})`)}`
|
|
50
|
-
: `\n${piTheme().fg("dim", "Cache Re-billed:")} ${detail}`;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const container = new Container();
|
|
54
|
-
container.addChild(new Spacer(1));
|
|
55
|
-
container.addChild(new Text(info, 1, 0));
|
|
56
|
-
return componentPort(container);
|
|
57
|
-
}
|
|
58
|
-
export function createPiShellChangelog(markdown) {
|
|
59
|
-
ensureTheme();
|
|
60
|
-
const container = new Container();
|
|
61
|
-
container.addChild(new Spacer(1));
|
|
62
|
-
container.addChild(new DynamicBorder());
|
|
63
|
-
container.addChild(new Text(piTheme().bold(piTheme().fg("accent", "What's New")), 1, 0));
|
|
64
|
-
container.addChild(new Spacer(1));
|
|
65
|
-
container.addChild(new Markdown(markdown.trim() || "No changelog entries found.", 1, 1, getMarkdownTheme()));
|
|
66
|
-
container.addChild(new DynamicBorder());
|
|
67
|
-
return componentPort(container);
|
|
68
|
-
}
|
|
69
|
-
export function createPiShellHotkeys() {
|
|
70
|
-
ensureTheme();
|
|
71
|
-
const keys = new KeybindingsManager();
|
|
72
|
-
const display = (action) => keys.getKeys(action)
|
|
73
|
-
.map(key => key.split("+").map(part => part.charAt(0).toUpperCase() + part.slice(1)).join("+"))
|
|
74
|
-
.join("/");
|
|
75
|
-
const row = (actions, description) => `| ${actions.map(action => `\`${display(action)}\``).join(" / ")} | ${description} |`;
|
|
76
|
-
const markdown = [
|
|
77
|
-
"**Navigation**", "| Key | Action |", "|-----|--------|",
|
|
78
|
-
row(["tui.editor.cursorUp", "tui.editor.cursorDown", "tui.editor.cursorLeft", "tui.editor.cursorRight"], "Move cursor / browse history"),
|
|
79
|
-
row(["tui.editor.cursorWordLeft", "tui.editor.cursorWordRight"], "Move by word"),
|
|
80
|
-
row(["tui.editor.cursorLineStart"], "Start of line"), row(["tui.editor.cursorLineEnd"], "End of line"),
|
|
81
|
-
row(["tui.editor.jumpForward"], "Jump forward to character"), row(["tui.editor.jumpBackward"], "Jump backward to character"),
|
|
82
|
-
row(["tui.editor.pageUp", "tui.editor.pageDown"], "Scroll by page"), "",
|
|
83
|
-
"**Editing**", "| Key | Action |", "|-----|--------|",
|
|
84
|
-
row(["tui.input.submit"], "Send message"),
|
|
85
|
-
row(["tui.input.newLine"], `New line${process.platform === "win32" ? " (Ctrl+Enter on Windows Terminal)" : ""}`),
|
|
86
|
-
row(["tui.editor.deleteWordBackward"], "Delete word backwards"), row(["tui.editor.deleteWordForward"], "Delete word forwards"),
|
|
87
|
-
row(["tui.editor.deleteToLineStart"], "Delete to start of line"), row(["tui.editor.deleteToLineEnd"], "Delete to end of line"),
|
|
88
|
-
row(["tui.editor.yank"], "Paste the most-recently-deleted text"), row(["tui.editor.yankPop"], "Cycle through the deleted text after pasting"),
|
|
89
|
-
row(["tui.editor.undo"], "Undo"), "", "**Other**", "| Key | Action |", "|-----|--------|",
|
|
90
|
-
row(["tui.input.tab"], "Path completion / accept autocomplete"), row(["app.interrupt"], "Cancel autocomplete / abort streaming"),
|
|
91
|
-
row(["app.clear"], "Clear editor (first) / exit (second)"), row(["app.exit"], "Exit (when editor is empty)"),
|
|
92
|
-
row(["app.suspend"], "Suspend to background"), row(["app.thinking.cycle"], "Cycle thinking level"),
|
|
93
|
-
row(["app.model.cycleForward", "app.model.cycleBackward"], "Cycle models"), row(["app.model.select"], "Open model selector"),
|
|
94
|
-
row(["app.tools.expand"], "Toggle tool output expansion"), row(["app.thinking.toggle"], "Toggle thinking block visibility"),
|
|
95
|
-
row(["app.editor.external"], "Edit message in external editor"), row(["app.message.copy"], "Copy last assistant message"),
|
|
96
|
-
row(["app.message.followUp"], "Queue follow-up message"), row(["app.message.dequeue"], "Restore queued messages"),
|
|
97
|
-
row(["app.clipboard.pasteImage"], "Paste image or text from clipboard"),
|
|
98
|
-
"| `/` | Slash commands |", "| `!` | Run bash command |", "| `!!` | Run bash command (excluded from context) |",
|
|
99
|
-
].join("\n");
|
|
100
|
-
const container = new Container();
|
|
101
|
-
container.addChild(new Spacer(1));
|
|
102
|
-
container.addChild(new DynamicBorder());
|
|
103
|
-
container.addChild(new Text(piTheme().bold(piTheme().fg("accent", "Keyboard Shortcuts")), 1, 0));
|
|
104
|
-
container.addChild(new Spacer(1));
|
|
105
|
-
container.addChild(new Markdown(markdown, 1, 1, getMarkdownTheme()));
|
|
106
|
-
container.addChild(new DynamicBorder());
|
|
107
|
-
return componentPort(container);
|
|
108
|
-
}
|
|
109
|
-
export function createPiShellTranscriptComponent(initial, cwd, extensions) {
|
|
8
|
+
import { componentPort, createTuiFacade, ensureTheme, isRecord, } from "./shell-shared-facade.js";
|
|
9
|
+
export function createPiShellTranscriptComponent(initial, cwd, extensions, submittedPrompt, initialOutputPad = PINNED_PI_LAYOUT.outputPad, initialHideThinkingBlock = false, initialMermaidRenderingMode = "off", initialShowImages = true, initialImageWidthCells = 80, imageAssets) {
|
|
110
10
|
ensureTheme();
|
|
111
11
|
let block = initial;
|
|
112
12
|
let expanded = false;
|
|
113
|
-
let
|
|
13
|
+
let outputPad = initialOutputPad;
|
|
14
|
+
let hideThinkingBlock = initialHideThinkingBlock;
|
|
15
|
+
let mermaidRenderingMode = initialMermaidRenderingMode;
|
|
16
|
+
let showImages = initialShowImages;
|
|
17
|
+
let imageWidthCells = initialImageWidthCells;
|
|
18
|
+
const rebuild = () => withTranscriptImages(transcriptComponent(block, cwd, expanded, extensions, submittedPrompt, outputPad, hideThinkingBlock, mermaidRenderingMode, showImages, imageWidthCells), block, imageAssets, showImages, imageWidthCells);
|
|
19
|
+
let component = rebuild();
|
|
114
20
|
return {
|
|
115
21
|
get id() { return block.id; },
|
|
116
22
|
get revision() { return block.revision; },
|
|
117
|
-
render: width => component.
|
|
23
|
+
render: width => renderWithOutputPad(component, block.kind, width, outputPad),
|
|
118
24
|
invalidate: () => component.invalidate(),
|
|
119
25
|
update(next) {
|
|
120
26
|
if (next.id !== block.id)
|
|
121
27
|
throw new TypeError("Pi transcript component identity cannot change");
|
|
122
28
|
const previous = block;
|
|
123
29
|
block = next;
|
|
124
|
-
if (!updateTranscriptComponent(component, previous, next, expanded))
|
|
125
|
-
component =
|
|
126
|
-
}
|
|
30
|
+
if (!updateTranscriptComponent(component, previous, next, expanded))
|
|
31
|
+
component = rebuild();
|
|
127
32
|
},
|
|
128
33
|
setExpanded(next) {
|
|
129
34
|
if (expanded === next)
|
|
130
35
|
return;
|
|
131
36
|
expanded = next;
|
|
132
|
-
if ("setExpanded" in component && typeof component.setExpanded === "function")
|
|
37
|
+
if ("setExpanded" in component && typeof component.setExpanded === "function")
|
|
133
38
|
component.setExpanded(expanded);
|
|
39
|
+
else
|
|
40
|
+
component = rebuild();
|
|
41
|
+
},
|
|
42
|
+
setOutputPad(padding) {
|
|
43
|
+
if (outputPad === padding)
|
|
44
|
+
return;
|
|
45
|
+
outputPad = padding;
|
|
46
|
+
component = rebuild();
|
|
47
|
+
},
|
|
48
|
+
setHideThinkingBlock(hidden) {
|
|
49
|
+
if (hideThinkingBlock === hidden)
|
|
50
|
+
return;
|
|
51
|
+
hideThinkingBlock = hidden;
|
|
52
|
+
component = rebuild();
|
|
53
|
+
},
|
|
54
|
+
setMermaidRenderingMode(mode) {
|
|
55
|
+
if (mermaidRenderingMode === mode)
|
|
56
|
+
return;
|
|
57
|
+
mermaidRenderingMode = mode;
|
|
58
|
+
component = rebuild();
|
|
59
|
+
},
|
|
60
|
+
setImagePresentation(show, width) {
|
|
61
|
+
showImages = show;
|
|
62
|
+
imageWidthCells = width;
|
|
63
|
+
if (component instanceof ToolExecutionComponent) {
|
|
64
|
+
component.setShowImages(show);
|
|
65
|
+
component.setImageWidthCells(width);
|
|
134
66
|
}
|
|
135
|
-
else
|
|
136
|
-
component =
|
|
137
|
-
}
|
|
67
|
+
else
|
|
68
|
+
component = rebuild();
|
|
138
69
|
},
|
|
139
70
|
};
|
|
140
71
|
}
|
|
72
|
+
function withTranscriptImages(component, block, assets, showImages, imageWidthCells) {
|
|
73
|
+
const references = block.imageReferences ?? [];
|
|
74
|
+
if (references.length === 0)
|
|
75
|
+
return component;
|
|
76
|
+
const container = new Container();
|
|
77
|
+
container.addChild(component);
|
|
78
|
+
for (const reference of references) {
|
|
79
|
+
container.addChild(new Spacer(1));
|
|
80
|
+
const asset = assets?.resolve(reference.assetId) ?? null;
|
|
81
|
+
if (!showImages) {
|
|
82
|
+
container.addChild(new Text(piTheme().fg("muted", `[Image hidden: ${reference.mimeType}, ${reference.byteLength} bytes]`), 1, 0));
|
|
83
|
+
}
|
|
84
|
+
else if (asset === null) {
|
|
85
|
+
container.addChild(new Text(piTheme().fg("warning", `[Image unavailable: ${reference.mimeType}]`), 1, 0));
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
container.addChild(new Image(asset.data, asset.mimeType, {
|
|
89
|
+
fallbackColor: text => piTheme().fg("muted", text),
|
|
90
|
+
}, { maxWidthCells: imageWidthCells, filename: reference.assetId }));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return container;
|
|
94
|
+
}
|
|
95
|
+
function renderWithOutputPad(component, kind, width, outputPad) {
|
|
96
|
+
const rows = component.render(width);
|
|
97
|
+
if (outputPad !== 0 || (kind !== "tool-call" && kind !== "tool-result" && kind !== "bash"))
|
|
98
|
+
return rows;
|
|
99
|
+
return rows.map(row => row.startsWith(" ") ? row.slice(1) : row);
|
|
100
|
+
}
|
|
141
101
|
export function renderPiShellTranscriptBlock(block, width, cwd) {
|
|
142
102
|
ensureTheme();
|
|
143
|
-
return transcriptComponent(block, cwd, true).render(width);
|
|
103
|
+
return transcriptComponent(block, cwd, true, undefined, undefined, PINNED_PI_LAYOUT.outputPad, false, "off", true, 80).render(width);
|
|
144
104
|
}
|
|
145
105
|
/**
|
|
146
106
|
* Pinned Pi's CLI prints startup diagnostics with `reportDiagnostics` before
|
|
@@ -175,12 +135,12 @@ export function renderPiShellPackageUpdateNotice(packages, width) {
|
|
|
175
135
|
container.addChild(new DynamicBorder(text => theme.fg("warning", text)));
|
|
176
136
|
return container.render(width);
|
|
177
137
|
}
|
|
178
|
-
function transcriptComponent(block, cwd, expanded, extensions) {
|
|
138
|
+
function transcriptComponent(block, cwd, expanded, extensions, submittedPrompt, outputPad, hideThinkingBlock, mermaidRenderingMode, showImages, imageWidthCells) {
|
|
179
139
|
switch (block.kind) {
|
|
180
140
|
case "user": {
|
|
181
141
|
const skill = parseSkillBlock(block.text);
|
|
182
142
|
if (!skill)
|
|
183
|
-
return new UserMessageComponent(block.text);
|
|
143
|
+
return submittedPrompt ? createPiSubmittedPromptComponent(block, submittedPrompt) : new UserMessageComponent(block.text);
|
|
184
144
|
const invocation = new SkillInvocationMessageComponent(skill, getMarkdownTheme());
|
|
185
145
|
invocation.setExpanded(expanded);
|
|
186
146
|
if (!skill.userMessage)
|
|
@@ -193,10 +153,10 @@ function transcriptComponent(block, cwd, expanded, extensions) {
|
|
|
193
153
|
}
|
|
194
154
|
case "assistant":
|
|
195
155
|
case "thinking":
|
|
196
|
-
return assistantComponent(block);
|
|
156
|
+
return assistantComponent(block, outputPad, hideThinkingBlock, mermaidRenderingMode);
|
|
197
157
|
case "tool-call":
|
|
198
158
|
case "tool-result": {
|
|
199
|
-
const component = toolComponent(block, cwd, extensions);
|
|
159
|
+
const component = toolComponent(block, cwd, extensions, showImages, imageWidthCells);
|
|
200
160
|
component.setExpanded(expanded);
|
|
201
161
|
return component;
|
|
202
162
|
}
|
|
@@ -211,13 +171,13 @@ function transcriptComponent(block, cwd, expanded, extensions) {
|
|
|
211
171
|
return component;
|
|
212
172
|
}
|
|
213
173
|
case "retry":
|
|
214
|
-
return new Text(piTheme().fg("warning", `Retry: ${block.text}`),
|
|
174
|
+
return new Text(piTheme().fg("warning", `Retry: ${block.text}`), outputPad, 0);
|
|
215
175
|
case "error":
|
|
216
|
-
return new Text(piTheme().fg("error", `Error: ${block.text}`),
|
|
176
|
+
return new Text(piTheme().fg("error", `Error: ${block.text}`), outputPad, 0);
|
|
217
177
|
case "system":
|
|
218
|
-
return new Text(piTheme().fg("dim", block.text),
|
|
178
|
+
return new Text(piTheme().fg("dim", block.text), outputPad, 0);
|
|
219
179
|
case "custom":
|
|
220
|
-
return customMessageComponent(block, expanded, extensions);
|
|
180
|
+
return customMessageComponent(block, expanded, extensions, outputPad);
|
|
221
181
|
case "bash":
|
|
222
182
|
return bashExecutionComponent(block, cwd, expanded);
|
|
223
183
|
}
|
|
@@ -266,8 +226,9 @@ function updateTranscriptComponent(component, previous, next, expanded) {
|
|
|
266
226
|
}
|
|
267
227
|
return false;
|
|
268
228
|
}
|
|
269
|
-
function assistantComponent(block) {
|
|
270
|
-
const
|
|
229
|
+
function assistantComponent(block, outputPad, hideThinkingBlock, mermaidRenderingMode) {
|
|
230
|
+
const transformer = createMermaidMarkdownTransformer({ getMode: () => mermaidRenderingMode, theme: piTheme() });
|
|
231
|
+
const component = new AssistantMessageComponent(undefined, hideThinkingBlock, getMarkdownTheme(), undefined, outputPad, [transformer]);
|
|
271
232
|
component.updateContent(validatedAssistantMessage(block), block.status === "live");
|
|
272
233
|
return component;
|
|
273
234
|
}
|
|
@@ -335,12 +296,12 @@ function validatedMessageRenderer(value) {
|
|
|
335
296
|
function isPiMessageRenderer(value) {
|
|
336
297
|
return typeof value === "function";
|
|
337
298
|
}
|
|
338
|
-
function toolComponent(block, cwd, extensions) {
|
|
299
|
+
function toolComponent(block, cwd, extensions, showImages, imageWidthCells) {
|
|
339
300
|
const payload = blockPayload(block);
|
|
340
301
|
const toolCallId = stringPayload(payload, "toolCallId") ?? block.id;
|
|
341
302
|
const toolName = stringPayload(payload, "toolName") ?? block.title ?? "tool";
|
|
342
303
|
const argumentsPayload = toolArguments(payload);
|
|
343
|
-
const component = new ToolExecutionComponent(toolName, toolCallId, argumentsPayload,
|
|
304
|
+
const component = new ToolExecutionComponent(toolName, toolCallId, argumentsPayload, { showImages, imageWidthCells }, validatedToolDefinition(extensions?.getToolDefinition(toolName)), createTuiFacade({ getColumns: () => 80, getRows: () => 24, requestRender() { }, onSubmit() { } }), cwd);
|
|
344
305
|
if (block.status === "live")
|
|
345
306
|
component.markExecutionStarted();
|
|
346
307
|
if (block.status === "finalized" || payload.argsComplete === true)
|
|
@@ -356,7 +317,7 @@ function toolComponent(block, cwd, extensions) {
|
|
|
356
317
|
}
|
|
357
318
|
return component;
|
|
358
319
|
}
|
|
359
|
-
function customMessageComponent(block, expanded, extensions) {
|
|
320
|
+
function customMessageComponent(block, expanded, extensions, outputPad) {
|
|
360
321
|
const payload = blockPayload(block);
|
|
361
322
|
const message = {
|
|
362
323
|
role: "custom",
|
|
@@ -367,7 +328,7 @@ function customMessageComponent(block, expanded, extensions) {
|
|
|
367
328
|
timestamp: numericPayload(block, "timestamp") || 0,
|
|
368
329
|
};
|
|
369
330
|
const renderer = validatedMessageRenderer(extensions?.getMessageRenderer(message.customType));
|
|
370
|
-
const component = new CustomMessageComponent(message, renderer, getMarkdownTheme(),
|
|
331
|
+
const component = new CustomMessageComponent(message, renderer, getMarkdownTheme(), outputPad);
|
|
371
332
|
component.setExpanded(expanded);
|
|
372
333
|
return component;
|
|
373
334
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModelSelectorComponent, type SessionInfo, type SettingsCallbacks, type SettingsConfig } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { OwnedUiDialog } from "
|
|
2
|
+
import type { OwnedUiDialog } from "../../../contracts/owned-ui/index.js";
|
|
3
3
|
import { type TrustDecision, type TrustOption, type TrustUpdate } from "./upstream/components/trust-selector.js";
|
|
4
4
|
import { type PiShellComponentPort, type PiShellEditorOptions, type PiShellSelectorOption, type PiShellSelectorOptions } from "./shell-shared-facade.js";
|
|
5
5
|
export declare function createPiShellSelector(options: PiShellSelectorOptions): PiShellComponentPort;
|
|
@@ -91,7 +91,10 @@ export declare function createPiShellLoginDialog(runtime: Pick<PiShellEditorOpti
|
|
|
91
91
|
export declare function createPiShellArmin(runtime: Pick<PiShellEditorOptions, "getColumns" | "getRows" | "requestRender">): PiShellComponentPort;
|
|
92
92
|
export declare function createPiShellDaxnuts(runtime: Pick<PiShellEditorOptions, "getColumns" | "getRows" | "requestRender">): PiShellComponentPort;
|
|
93
93
|
export declare function createPiShellEarendilAnnouncement(): PiShellComponentPort;
|
|
94
|
-
export
|
|
94
|
+
export interface PiShellOperationLoaderPort extends PiShellComponentPort {
|
|
95
|
+
readonly signal: AbortSignal;
|
|
96
|
+
}
|
|
97
|
+
export declare function createPiShellOperationLoader(runtime: Pick<PiShellEditorOptions, "getColumns" | "getRows" | "requestRender">, message: string): PiShellOperationLoaderPort;
|
|
95
98
|
export declare function createPiShellReloadBox(): PiShellComponentPort;
|
|
96
99
|
export interface PiShellAuthProviderOption extends PiShellSelectorOption {
|
|
97
100
|
readonly providerId: string;
|
|
@@ -148,7 +148,8 @@ export function createPiShellEarendilAnnouncement() {
|
|
|
148
148
|
}
|
|
149
149
|
export function createPiShellOperationLoader(runtime, message) {
|
|
150
150
|
ensureTheme();
|
|
151
|
-
|
|
151
|
+
const loader = new BorderedLoader(createTuiFacade(runtime), piTheme(), message, { cancellable: true });
|
|
152
|
+
return { ...componentPort(loader), signal: loader.signal };
|
|
152
153
|
}
|
|
153
154
|
export function createPiShellReloadBox() {
|
|
154
155
|
ensureTheme();
|
|
@@ -1,13 +1,34 @@
|
|
|
1
|
-
import { type AutocompleteProvider, type Component, type TUI } from "#pi-tui";
|
|
2
|
-
import type { OwnedUiSessionViewModel, OwnedUiThinkingLevel, OwnedUiTranscriptBlock } from "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { visibleWidth, type AutocompleteProvider, type Component, type TUI } from "#pi-tui";
|
|
2
|
+
import type { OwnedUiImageAttachment, OwnedUiSessionViewModel, OwnedUiThinkingLevel, OwnedUiTranscriptBlock } from "../../../contracts/owned-ui/index.js";
|
|
3
|
+
import type { PresentationComponentPort } from "../../../contracts/presentation/index.js";
|
|
4
|
+
/** Terminal-cell width authority used by Pi-rendered component rows. */
|
|
5
|
+
export declare const piShellVisibleWidth: typeof visibleWidth;
|
|
6
|
+
export interface PiShellComponentPort extends PresentationComponentPort {
|
|
7
|
+
}
|
|
8
|
+
export type PiShellClipboardContent = {
|
|
9
|
+
readonly kind: "text";
|
|
10
|
+
readonly text: string;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: "image";
|
|
13
|
+
readonly data: string;
|
|
14
|
+
readonly mimeType: string;
|
|
15
|
+
};
|
|
16
|
+
export interface PiShellEditorTextRange {
|
|
17
|
+
readonly start: number;
|
|
18
|
+
readonly end: number;
|
|
19
|
+
}
|
|
20
|
+
export interface PiShellEditorPointerEvent {
|
|
21
|
+
readonly kind: "press" | "motion" | "release";
|
|
22
|
+
readonly button: number;
|
|
23
|
+
readonly column: number;
|
|
24
|
+
/** One-based row relative to the top of the editor component. */
|
|
25
|
+
readonly row: number;
|
|
9
26
|
}
|
|
10
27
|
export interface PiShellEditorPort extends PiShellComponentPort {
|
|
28
|
+
/** Restores this editor's profile after another Pi component changed the global manager. */
|
|
29
|
+
activateKeybindings(): void;
|
|
30
|
+
/** Uses Pi's terminal decoder rather than assuming one terminal escape spelling. */
|
|
31
|
+
matchesTerminalKey(data: string, key: "home" | "end" | "ctrl+v"): boolean;
|
|
11
32
|
getText(): string;
|
|
12
33
|
setText(text: string): void;
|
|
13
34
|
insertText(text: string): void;
|
|
@@ -16,8 +37,14 @@ export interface PiShellEditorPort extends PiShellComponentPort {
|
|
|
16
37
|
setSubmitHandler(handler: (text: string) => void): void;
|
|
17
38
|
setInterruptHandler(handler: () => void): void;
|
|
18
39
|
setAutocompleteCommands(commands: readonly PiShellAutocompleteCommand[]): void;
|
|
40
|
+
setPaddingX(padding: number): void;
|
|
41
|
+
setAutocompleteMaxVisible(maxVisible: number): void;
|
|
19
42
|
addAutocompleteProvider(factory: unknown): void;
|
|
20
43
|
setThinkingLevel(level: OwnedUiThinkingLevel): void;
|
|
44
|
+
hasSelection(): boolean;
|
|
45
|
+
ownsPointer(): boolean;
|
|
46
|
+
handlePointer(event: PiShellEditorPointerEvent): boolean;
|
|
47
|
+
pasteClipboard(): boolean;
|
|
21
48
|
}
|
|
22
49
|
export interface PiShellAutocompleteCommand {
|
|
23
50
|
readonly name: string;
|
|
@@ -28,8 +55,14 @@ export interface PiShellAutocompleteCommand {
|
|
|
28
55
|
export interface PiShellViewComponentPort extends PiShellComponentPort {
|
|
29
56
|
update(view: OwnedUiSessionViewModel): void;
|
|
30
57
|
}
|
|
58
|
+
export type PiShellStatusPlacement = "live" | "dock" | "hidden";
|
|
31
59
|
export interface PiShellStatusPort extends PiShellViewComponentPort {
|
|
32
60
|
setWorkingOverride(message: string | undefined): void;
|
|
61
|
+
setOutputPad(padding: 0 | 1): void;
|
|
62
|
+
/** Semantic row placement; callers must not inspect rendered text. */
|
|
63
|
+
placement(): PiShellStatusPlacement;
|
|
64
|
+
renderDock(width: number): readonly string[];
|
|
65
|
+
renderLive(width: number): readonly string[];
|
|
33
66
|
}
|
|
34
67
|
export interface PiShellQueuedInputPort extends PiShellComponentPort {
|
|
35
68
|
update(submissions: readonly string[]): void;
|
|
@@ -48,6 +81,9 @@ export interface PiShellResourceEntry {
|
|
|
48
81
|
export interface PiShellLoadedResourcesPort extends PiShellComponentPort {
|
|
49
82
|
setExpanded(expanded: boolean): void;
|
|
50
83
|
}
|
|
84
|
+
export interface PiShellImageAssetResolver {
|
|
85
|
+
resolve(assetId: string): OwnedUiImageAttachment | null;
|
|
86
|
+
}
|
|
51
87
|
export interface PiShellExtensionRendererResolver {
|
|
52
88
|
getMessageRenderer(customType: string): unknown;
|
|
53
89
|
getToolDefinition(toolName: string): unknown;
|
|
@@ -57,6 +93,10 @@ export interface PiShellTranscriptComponentPort extends PiShellComponentPort {
|
|
|
57
93
|
readonly revision: number;
|
|
58
94
|
update(block: OwnedUiTranscriptBlock): void;
|
|
59
95
|
setExpanded(expanded: boolean): void;
|
|
96
|
+
setOutputPad(padding: 0 | 1): void;
|
|
97
|
+
setHideThinkingBlock(hidden: boolean): void;
|
|
98
|
+
setMermaidRenderingMode(mode: "off" | "final" | "streaming"): void;
|
|
99
|
+
setImagePresentation(showImages: boolean, imageWidthCells: number): void;
|
|
60
100
|
}
|
|
61
101
|
export interface PiShellStartupNotice {
|
|
62
102
|
readonly kind: "info" | "warning" | "error";
|
|
@@ -69,6 +109,8 @@ export interface PiShellHeaderOptions {
|
|
|
69
109
|
readonly resources?: readonly PiShellResourceEntry[];
|
|
70
110
|
}
|
|
71
111
|
export interface PiShellEditorOptions {
|
|
112
|
+
/** Bare A1 adds ergonomic aliases while comparison profiles retain Pi defaults. */
|
|
113
|
+
readonly keybindingProfile?: "pi" | "a1";
|
|
72
114
|
readonly getColumns: () => number;
|
|
73
115
|
readonly getRows: () => number;
|
|
74
116
|
readonly requestRender: () => void;
|
|
@@ -89,6 +131,13 @@ export interface PiShellEditorOptions {
|
|
|
89
131
|
readonly onMessageCopy?: (() => void) | undefined;
|
|
90
132
|
readonly onFollowUp?: (() => void) | undefined;
|
|
91
133
|
readonly onDequeue?: (() => void) | undefined;
|
|
134
|
+
readonly onCopyText?: (text: string) => void;
|
|
135
|
+
readonly readClipboardContent?: () => Promise<PiShellClipboardContent | null>;
|
|
136
|
+
readonly transformPastedContent?: (content: PiShellClipboardContent) => string;
|
|
137
|
+
readonly editorAtomicRanges?: (line: string) => readonly PiShellEditorTextRange[];
|
|
138
|
+
readonly expandCopiedEditorText?: (text: string) => string;
|
|
139
|
+
readonly paintEditorSelection?: (line: string, from: number, to: number, atomic: boolean) => string;
|
|
140
|
+
readonly decorateEditorRow?: (row: string, width: number) => string;
|
|
92
141
|
readonly cwd?: string;
|
|
93
142
|
readonly agentDir?: string;
|
|
94
143
|
readonly autocompleteCommands?: readonly PiShellAutocompleteCommand[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { setKeybindings, } from "#pi-tui";
|
|
1
|
+
import { setKeybindings, visibleWidth, } from "#pi-tui";
|
|
2
2
|
import { KeybindingsManager, } from "./upstream/adjacent/core/keybindings.js";
|
|
3
3
|
import { ensurePiTheme, } from "./theme.js";
|
|
4
|
-
|
|
4
|
+
/** Terminal-cell width authority used by Pi-rendered component rows. */
|
|
5
|
+
export const piShellVisibleWidth = visibleWidth;
|
|
6
|
+
// Provenance: pinned from packages/coding-agent/src/core/slash-commands.ts at 914cf14.
|
|
5
7
|
export function createTuiFacade(options) {
|
|
6
8
|
const children = [];
|
|
7
9
|
const terminal = {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Component } from "#pi-tui";
|
|
2
|
+
import type { OwnedUiTranscriptBlock } from "../../../contracts/owned-ui/index.js";
|
|
3
|
+
export interface PiShellSubmittedPromptComposer {
|
|
4
|
+
readonly layout: (width: number, source?: Date | number | null) => {
|
|
5
|
+
readonly contentWidth: number;
|
|
6
|
+
};
|
|
7
|
+
readonly compose: (contentRows: readonly string[], width: number, source?: Date | number | null, style?: {
|
|
8
|
+
readonly prefix?: (text: string) => string;
|
|
9
|
+
readonly timestamp?: (text: string) => string;
|
|
10
|
+
}) => readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** Pi owns Markdown and theme adaptation; the injected composer owns neutral row geometry. */
|
|
13
|
+
export declare function createPiSubmittedPromptComponent(block: OwnedUiTranscriptBlock, composer: PiShellSubmittedPromptComposer): Component;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Box, Markdown } from "#pi-tui";
|
|
3
|
+
import { piTheme } from "./theme.js";
|
|
4
|
+
/** Pi owns Markdown and theme adaptation; the injected composer owns neutral row geometry. */
|
|
5
|
+
export function createPiSubmittedPromptComponent(block, composer) {
|
|
6
|
+
const timestamp = numericTimestamp(block);
|
|
7
|
+
const markdown = new Markdown(block.text, 0, 0, getMarkdownTheme(), { color: content => piTheme().fg("userMessageText", content) }, { preserveOrderedListMarkers: true, preserveBackslashEscapes: true });
|
|
8
|
+
const content = {
|
|
9
|
+
render(width) {
|
|
10
|
+
const layout = composer.layout(width, timestamp);
|
|
11
|
+
return [...composer.compose(markdown.render(layout.contentWidth), width, timestamp, {
|
|
12
|
+
prefix: text => piTheme().fg("muted", text),
|
|
13
|
+
timestamp: text => piTheme().fg("dim", text),
|
|
14
|
+
})];
|
|
15
|
+
},
|
|
16
|
+
invalidate: () => markdown.invalidate(),
|
|
17
|
+
};
|
|
18
|
+
const box = new Box(0, 0, line => piTheme().bg("userMessageBg", line));
|
|
19
|
+
box.addChild(content);
|
|
20
|
+
return box;
|
|
21
|
+
}
|
|
22
|
+
function numericTimestamp(block) {
|
|
23
|
+
if (typeof block.payload !== "object" || block.payload === null)
|
|
24
|
+
return null;
|
|
25
|
+
const value = block.payload.timestamp;
|
|
26
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
27
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Source-synchronized from Pi 0.84.2 packages/coding-agent/src/core/keybindings.ts. */
|
|
2
|
-
import { type Keybinding, type KeybindingsConfig, type KeyId, KeybindingsManager as TuiKeybindingsManager } from "#pi-tui";
|
|
2
|
+
import { type Keybinding, type KeybindingDefinitions, type KeybindingsConfig, type KeyId, KeybindingsManager as TuiKeybindingsManager } from "#pi-tui";
|
|
3
3
|
export interface AppKeybindings {
|
|
4
4
|
"app.interrupt": true;
|
|
5
5
|
"app.clear": true;
|
|
@@ -43,6 +43,12 @@ export interface AppKeybindings {
|
|
|
43
43
|
"app.tree.filter.all": true;
|
|
44
44
|
"app.tree.filter.cycleForward": true;
|
|
45
45
|
"app.tree.filter.cycleBackward": true;
|
|
46
|
+
"owned.editor.selectAll": true;
|
|
47
|
+
"owned.editor.cut": true;
|
|
48
|
+
"owned.editor.paste": true;
|
|
49
|
+
"owned.editor.redo": true;
|
|
50
|
+
"owned.editor.extendLeft": true;
|
|
51
|
+
"owned.editor.extendRight": true;
|
|
46
52
|
}
|
|
47
53
|
export type AppKeybinding = keyof AppKeybindings;
|
|
48
54
|
declare module "#pi-tui" {
|
|
@@ -413,8 +419,10 @@ export declare function migrateKeybindingsConfig(rawConfig: Record<string, unkno
|
|
|
413
419
|
};
|
|
414
420
|
export declare class KeybindingsManager extends TuiKeybindingsManager {
|
|
415
421
|
private configPath;
|
|
416
|
-
constructor(userBindings?: KeybindingsConfig, configPath?: string);
|
|
422
|
+
constructor(userBindings?: KeybindingsConfig, configPath?: string, definitions?: KeybindingDefinitions);
|
|
417
423
|
static create(agentDir?: string): KeybindingsManager;
|
|
424
|
+
static createForOwnedInput(agentDir?: string): KeybindingsManager;
|
|
425
|
+
private static createWithDefinitions;
|
|
418
426
|
reload(): void;
|
|
419
427
|
getEffectiveConfig(): KeybindingsConfig;
|
|
420
428
|
private static loadFromFile;
|
|
@@ -147,6 +147,33 @@ export const KEYBINDINGS = {
|
|
|
147
147
|
description: "Tree filter: cycle backward",
|
|
148
148
|
},
|
|
149
149
|
};
|
|
150
|
+
/** Pi actions with bare-A1 aliases; the comparison profile keeps KEYBINDINGS unchanged. */
|
|
151
|
+
const OWNED_INPUT_KEYBINDINGS = {
|
|
152
|
+
...KEYBINDINGS,
|
|
153
|
+
"tui.editor.deleteWordBackward": {
|
|
154
|
+
...KEYBINDINGS["tui.editor.deleteWordBackward"],
|
|
155
|
+
defaultKeys: [...KEYBINDINGS["tui.editor.deleteWordBackward"].defaultKeys, "ctrl+backspace"],
|
|
156
|
+
},
|
|
157
|
+
"tui.editor.deleteWordForward": {
|
|
158
|
+
...KEYBINDINGS["tui.editor.deleteWordForward"],
|
|
159
|
+
defaultKeys: [...KEYBINDINGS["tui.editor.deleteWordForward"].defaultKeys, "ctrl+delete"],
|
|
160
|
+
},
|
|
161
|
+
"tui.editor.undo": {
|
|
162
|
+
...KEYBINDINGS["tui.editor.undo"],
|
|
163
|
+
defaultKeys: [KEYBINDINGS["tui.editor.undo"].defaultKeys, "ctrl+z"],
|
|
164
|
+
},
|
|
165
|
+
// Ctrl+Z edits the prompt in bare A1 instead of suspending the process.
|
|
166
|
+
"app.suspend": { ...KEYBINDINGS["app.suspend"], defaultKeys: [] },
|
|
167
|
+
// Owned prompt-selection actions are intercepted before vanilla Pi editor
|
|
168
|
+
// actions. Keeping them in the keybinding manager makes the UX declarative,
|
|
169
|
+
// configurable, and independent of terminal escape-sequence spellings.
|
|
170
|
+
"owned.editor.selectAll": { defaultKeys: "ctrl+a", description: "Select all prompt text" },
|
|
171
|
+
"owned.editor.cut": { defaultKeys: "ctrl+x", description: "Cut selected prompt text" },
|
|
172
|
+
"owned.editor.paste": { defaultKeys: "ctrl+v", description: "Paste clipboard text" },
|
|
173
|
+
"owned.editor.redo": { defaultKeys: "ctrl+y", description: "Redo prompt edit" },
|
|
174
|
+
"owned.editor.extendLeft": { defaultKeys: "shift+left", description: "Extend prompt selection left" },
|
|
175
|
+
"owned.editor.extendRight": { defaultKeys: "shift+right", description: "Extend prompt selection right" },
|
|
176
|
+
};
|
|
150
177
|
const KEYBINDING_NAME_MIGRATIONS = {
|
|
151
178
|
cursorUp: "tui.editor.cursorUp",
|
|
152
179
|
cursorDown: "tui.editor.cursorDown",
|
|
@@ -270,14 +297,20 @@ function loadRawConfig(path) {
|
|
|
270
297
|
}
|
|
271
298
|
export class KeybindingsManager extends TuiKeybindingsManager {
|
|
272
299
|
configPath;
|
|
273
|
-
constructor(userBindings = {}, configPath) {
|
|
274
|
-
super(
|
|
300
|
+
constructor(userBindings = {}, configPath, definitions = KEYBINDINGS) {
|
|
301
|
+
super(definitions, userBindings);
|
|
275
302
|
this.configPath = configPath;
|
|
276
303
|
}
|
|
277
304
|
static create(agentDir = getAgentDir()) {
|
|
305
|
+
return KeybindingsManager.createWithDefinitions(agentDir, KEYBINDINGS);
|
|
306
|
+
}
|
|
307
|
+
static createForOwnedInput(agentDir = getAgentDir()) {
|
|
308
|
+
return KeybindingsManager.createWithDefinitions(agentDir, OWNED_INPUT_KEYBINDINGS);
|
|
309
|
+
}
|
|
310
|
+
static createWithDefinitions(agentDir, definitions) {
|
|
278
311
|
const configPath = join(agentDir, "keybindings.json");
|
|
279
312
|
const userBindings = KeybindingsManager.loadFromFile(configPath);
|
|
280
|
-
return new KeybindingsManager(userBindings, configPath);
|
|
313
|
+
return new KeybindingsManager(userBindings, configPath, definitions);
|
|
281
314
|
}
|
|
282
315
|
reload() {
|
|
283
316
|
if (!this.configPath)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component } from "#pi-tui";
|
|
2
|
-
import type { OwnedUiSessionViewModel } from "
|
|
2
|
+
import type { OwnedUiSessionViewModel } from "../../../../../contracts/owned-ui/index.js";
|
|
3
3
|
export declare class SessionFooter implements Component {
|
|
4
4
|
private readonly getView;
|
|
5
5
|
private readonly cwd;
|