@timurproko/a1 0.1.8-dev.3b54f21 → 0.1.8-dev.402
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 +159 -65
- package/bin/cli.js +28 -10
- package/bin/guardian.js +12 -6
- 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 +62 -21
- package/bin/update-recovery.js +274 -0
- 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 +35 -0
- package/dist/composition/owned-ui.js +118 -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/contracts/owned-ui/image-attachments.d.ts +36 -0
- package/dist/contracts/owned-ui/image-attachments.js +67 -0
- package/dist/contracts/owned-ui/index.d.ts +8 -0
- package/dist/contracts/owned-ui/index.js +8 -0
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/model.d.ts +123 -0
- package/dist/contracts/owned-ui/prompt-history.d.ts +55 -0
- package/dist/contracts/owned-ui/prompt-history.js +23 -0
- package/dist/contracts/owned-ui/prompt-suggestions.d.ts +3 -0
- package/dist/contracts/owned-ui/prompt-suggestions.js +44 -0
- package/dist/contracts/owned-ui/suggestion-diagnostics.d.ts +22 -0
- package/dist/contracts/owned-ui/suggestion-diagnostics.js +9 -0
- package/dist/contracts/owned-ui/transcript-lifecycle.d.ts +5 -0
- package/dist/contracts/owned-ui/transcript-lifecycle.js +33 -0
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.d.ts +5 -1
- package/dist/{src/foundation/owned-ui-contracts → contracts/owned-ui}/validation.js +129 -4
- package/dist/{src/foundation/presentation-contracts → contracts/presentation}/index.d.ts +8 -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 +3 -2
- package/dist/{src/features → features}/launch/profile-paths.js +13 -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/features/owned-ui/run.js +32 -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 +105 -56
- package/dist/features/prompt-history/image-sidecar.d.ts +32 -0
- package/dist/features/prompt-history/image-sidecar.js +130 -0
- package/dist/features/prompt-history/index.d.ts +4 -0
- package/dist/features/prompt-history/index.js +3 -0
- package/dist/features/prompt-history/paths.d.ts +5 -0
- package/dist/features/prompt-history/paths.js +17 -0
- package/dist/features/prompt-history/service.d.ts +54 -0
- package/dist/features/prompt-history/service.js +425 -0
- package/dist/features/prompt-history/store.d.ts +16 -0
- package/dist/features/prompt-history/store.js +223 -0
- package/dist/features/prompt-history/worker.d.ts +9 -0
- package/dist/features/prompt-history/worker.js +45 -0
- package/dist/features/prompt-suggestions/diagnostics.d.ts +18 -0
- package/dist/features/prompt-suggestions/diagnostics.js +82 -0
- package/dist/features/prompt-suggestions/index.d.ts +1 -0
- package/dist/features/prompt-suggestions/index.js +1 -0
- 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/foundation/launch-context/index.d.ts +59 -0
- package/dist/foundation/launch-context/index.js +136 -0
- package/dist/{src/foundation → foundation}/launch-guardian/main.d.ts +2 -0
- package/dist/{src/foundation → foundation}/launch-guardian/main.js +23 -8
- 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/foundation/release/bootstrap.d.ts +55 -0
- package/dist/{src/foundation → foundation}/release/bootstrap.js +219 -46
- package/dist/foundation/release/cohort-state.d.ts +157 -0
- package/dist/foundation/release/cohort-state.js +472 -0
- package/dist/foundation/release/dependency-certification-retention.d.ts +7 -0
- package/dist/foundation/release/dependency-certification-retention.js +88 -0
- package/dist/foundation/release/dependency-certification.d.ts +24 -0
- package/dist/foundation/release/dependency-certification.js +266 -0
- package/dist/foundation/release/dependency-layer.d.ts +81 -0
- package/dist/foundation/release/dependency-layer.js +466 -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 +6 -0
- package/dist/{src/foundation → foundation}/release/index.js +6 -0
- package/dist/foundation/release/release-gc.d.ts +71 -0
- package/dist/foundation/release/release-gc.js +764 -0
- package/dist/{src/foundation → foundation}/release/release-store.d.ts +9 -3
- package/dist/{src/foundation → foundation}/release/release-store.js +74 -14
- package/dist/{src/foundation → foundation}/release/release.d.ts +6 -1
- package/dist/{src/foundation → foundation}/release/release.js +15 -4
- package/dist/foundation/release/restart-certification.d.ts +68 -0
- package/dist/foundation/release/restart-certification.js +227 -0
- package/dist/foundation/release/update-launch.d.ts +6 -0
- package/dist/foundation/release/update-launch.js +17 -0
- package/dist/foundation/release/update-recovery.d.ts +76 -0
- package/dist/foundation/release/update-recovery.js +356 -0
- package/dist/{src/foundation → foundation}/release/update-transaction.d.ts +11 -0
- package/dist/{src/foundation → foundation}/release/update-transaction.js +13 -1
- package/dist/{src/foundation → foundation}/release/update.d.ts +40 -4
- package/dist/{src/foundation → foundation}/release/update.js +196 -78
- package/dist/foundation/release/warmup.d.ts +3 -0
- package/dist/foundation/release/warmup.js +47 -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 +142 -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 +84 -0
- package/dist/foundation/supervision/paths.d.ts +1 -0
- package/dist/foundation/supervision/paths.js +1 -0
- package/dist/foundation/supervision/server.d.ts +51 -0
- package/dist/{src/foundation → foundation}/supervision/server.js +142 -20
- package/dist/foundation/terminal-cleanup/fatal-exit.d.ts +12 -0
- package/dist/foundation/terminal-cleanup/fatal-exit.js +85 -0
- package/dist/foundation/terminal-cleanup/index.d.ts +2 -0
- package/dist/foundation/terminal-cleanup/index.js +2 -0
- package/dist/foundation/terminal-cleanup/terminal-reset.d.ts +4 -0
- package/dist/foundation/terminal-cleanup/terminal-reset.js +40 -0
- 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/editor-interaction.d.ts +38 -0
- package/dist/integrations/pi/components/history-editor-loader.d.ts +5 -0
- package/dist/integrations/pi/components/history-editor-loader.js +5 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.d.ts +2 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/index.js +2 -1
- package/dist/integrations/pi/components/owned-editor-ux.d.ts +74 -0
- package/dist/integrations/pi/components/owned-editor-ux.js +1093 -0
- package/dist/integrations/pi/components/path-word-ranges.d.ts +2 -0
- package/dist/integrations/pi/components/path-word-ranges.js +37 -0
- package/dist/integrations/pi/components/prompt-input-port.d.ts +18 -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/integrations/pi/components/shell-editor-autocomplete.js +297 -0
- 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 +4 -4
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-footer-status.js +58 -23
- package/dist/integrations/pi/components/shell-presenters-info.d.ts +43 -0
- package/dist/integrations/pi/components/shell-presenters-info.js +114 -0
- package/dist/integrations/pi/components/shell-presenters-transcript.d.ts +29 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-presenters-transcript.js +174 -170
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.d.ts +8 -4
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-selectors-dialogs.js +10 -6
- package/dist/integrations/pi/components/shell-shared-facade.d.ts +213 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/shell-shared-facade.js +5 -2
- package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +15 -0
- package/dist/integrations/pi/components/submitted-prompt-adapter.js +43 -0
- package/dist/integrations/pi/components/tool-image-presentation.d.ts +21 -0
- package/dist/integrations/pi/components/tool-image-presentation.js +86 -0
- package/dist/integrations/pi/components/tool-result-adapter.d.ts +6 -0
- package/dist/integrations/pi/components/tool-result-adapter.js +27 -0
- package/dist/integrations/pi/components/transcript-image-resolver.d.ts +7 -0
- package/dist/integrations/pi/components/transcript-image-resolver.js +19 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.d.ts +11 -2
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/adjacent/core/keybindings.js +41 -3
- package/dist/integrations/pi/components/upstream/assets/earendil-image.json +12 -0
- package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +42 -0
- package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +40 -0
- package/dist/integrations/pi/components/upstream/components/owned-editor.js +166 -0
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.d.ts +1 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/scoped-models-selector.js +3 -1
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.d.ts +3 -2
- package/dist/{src/foundation/pi-component-adapter → integrations/pi/components}/upstream/components/session-footer.js +12 -7
- package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +61 -0
- package/dist/integrations/pi/components/upstream/components/tool-execution.js +344 -0
- package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +280 -0
- package/dist/integrations/pi/components/upstream/history/editor-core.js +2062 -0
- package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +32 -0
- package/dist/integrations/pi/components/upstream/history/kill-ring.js +48 -0
- package/dist/integrations/pi/components/upstream/history/printable-key.d.ts +1 -0
- package/dist/integrations/pi/components/upstream/history/printable-key.js +40 -0
- package/dist/integrations/pi/components/upstream/history/text-helpers.d.ts +14 -0
- package/dist/integrations/pi/components/upstream/history/text-helpers.js +28 -0
- package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +22 -0
- package/dist/integrations/pi/components/upstream/history/undo-stack.js +36 -0
- package/dist/integrations/pi/components/upstream/history/word-navigation.d.ts +24 -0
- package/dist/integrations/pi/components/upstream/history/word-navigation.js +100 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.d.ts +74 -6
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/adapter.js +1340 -228
- package/dist/integrations/pi/engine/changelog.d.ts +2 -0
- package/dist/integrations/pi/engine/changelog.js +63 -0
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.d.ts +4 -2
- package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/conformance.js +15 -5
- 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/pending-delivery.d.ts +30 -0
- package/dist/integrations/pi/engine/pending-delivery.js +158 -0
- 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/integrations/pi/engine/resources/changelog.json +12 -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 +56 -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/integrations/pi/engine/tool-rendering.d.ts +13 -0
- package/dist/integrations/pi/engine/tool-rendering.js +145 -0
- package/dist/integrations/pi/engine/transcript-image-assets.d.ts +11 -0
- package/dist/integrations/pi/engine/transcript-image-assets.js +86 -0
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.d.ts +21 -0
- package/dist/integrations/pi/engine/windows-filesystem-hygiene.js +55 -0
- 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 +19 -2
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.d.ts +16 -0
- package/dist/integrations/pi/session-ui/clipboard-diagnostics.js +65 -0
- package/dist/integrations/pi/session-ui/clipboard-image.d.ts +11 -0
- package/dist/integrations/pi/session-ui/clipboard-image.js +38 -0
- package/dist/integrations/pi/session-ui/editor-hyperlink-budget.d.ts +9 -0
- package/dist/integrations/pi/session-ui/editor-hyperlink-budget.js +23 -0
- package/dist/integrations/pi/session-ui/image-preparation-client.d.ts +20 -0
- package/dist/integrations/pi/session-ui/image-preparation-client.js +145 -0
- package/dist/integrations/pi/session-ui/image-preparation.d.ts +18 -0
- package/dist/integrations/pi/session-ui/image-preparation.js +126 -0
- package/dist/integrations/pi/session-ui/image-source.d.ts +13 -0
- package/dist/integrations/pi/session-ui/image-source.js +171 -0
- package/dist/integrations/pi/session-ui/image-worker.d.ts +17 -0
- package/dist/integrations/pi/session-ui/image-worker.js +23 -0
- package/dist/integrations/pi/session-ui/index.d.ts +5 -0
- package/dist/integrations/pi/session-ui/index.js +5 -0
- package/dist/integrations/pi/session-ui/paste-executor.d.ts +10 -0
- package/dist/integrations/pi/session-ui/paste-executor.js +232 -0
- package/dist/integrations/pi/session-ui/paste-helper.d.ts +1 -0
- package/dist/integrations/pi/session-ui/paste-helper.js +173 -0
- package/dist/integrations/pi/session-ui/paste-preparation-client.d.ts +16 -0
- package/dist/integrations/pi/session-ui/paste-preparation-client.js +159 -0
- package/dist/integrations/pi/session-ui/paste-protocol.d.ts +78 -0
- package/dist/integrations/pi/session-ui/paste-protocol.js +18 -0
- package/dist/integrations/pi/session-ui/paste-text-preparation.d.ts +20 -0
- package/dist/integrations/pi/session-ui/paste-text-preparation.js +134 -0
- package/dist/integrations/pi/session-ui/paste-text-worker.d.ts +1 -0
- package/dist/integrations/pi/session-ui/paste-text-worker.js +12 -0
- package/dist/integrations/pi/session-ui/path-chip-presentation.d.ts +7 -0
- package/dist/integrations/pi/session-ui/path-chip-presentation.js +24 -0
- package/dist/integrations/pi/session-ui/prompt-chips.d.ts +72 -0
- package/dist/integrations/pi/session-ui/prompt-chips.js +503 -0
- package/dist/integrations/pi/session-ui/prompt-history-controller.d.ts +36 -0
- package/dist/integrations/pi/session-ui/prompt-history-controller.js +170 -0
- package/dist/integrations/pi/session-ui/prompt-suggestion-controller.d.ts +35 -0
- package/dist/integrations/pi/session-ui/prompt-suggestion-controller.js +207 -0
- package/dist/integrations/pi/session-ui/response-copy-coordinator.d.ts +27 -0
- package/dist/integrations/pi/session-ui/response-copy-coordinator.js +189 -0
- package/dist/integrations/pi/session-ui/response-copy-helper.d.ts +1 -0
- package/dist/integrations/pi/session-ui/response-copy-helper.js +122 -0
- package/dist/integrations/pi/session-ui/response-copy-protocol.d.ts +56 -0
- package/dist/integrations/pi/session-ui/response-copy-protocol.js +5 -0
- package/dist/integrations/pi/session-ui/response-copy-transport.d.ts +31 -0
- package/dist/integrations/pi/session-ui/response-copy-transport.js +187 -0
- package/dist/integrations/pi/session-ui/route-host.d.ts +5 -0
- package/dist/integrations/pi/session-ui/route-host.js +1 -0
- package/dist/integrations/pi/session-ui/session-shell-root.d.ts +221 -0
- package/dist/integrations/pi/session-ui/session-shell-root.js +1305 -0
- package/dist/integrations/pi/session-ui/session-shell.d.ts +55 -0
- package/dist/integrations/pi/session-ui/session-shell.js +1792 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.d.ts +56 -0
- package/dist/integrations/pi/session-ui/session-viewport-controller.js +569 -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 +156 -0
- package/dist/integrations/pi/session-ui/text-paste.d.ts +5 -0
- package/dist/integrations/pi/session-ui/text-paste.js +16 -0
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.d.ts +10 -1
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/adapter.js +255 -11
- package/dist/{src/foundation/pi-tui-runtime-adapter → integrations/pi/tui-runtime}/contracts.d.ts +32 -6
- package/dist/integrations/pi/tui-runtime/contracts.js +1 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +81 -0
- package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +424 -0
- package/dist/integrations/pi/tui-runtime/index.d.ts +7 -0
- package/dist/integrations/pi/tui-runtime/index.js +7 -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/integrations/pi/tui-runtime/mouse-report-input.d.ts +13 -0
- package/dist/integrations/pi/tui-runtime/mouse-report-input.js +59 -0
- package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +32 -0
- package/dist/integrations/pi/tui-runtime/overlay-geometry.js +159 -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} +4 -4
- package/dist/{src/product-identity.js → product-identity.js} +7 -38
- package/dist/{src/product-identity.json → product-identity.json} +13 -27
- package/dist/runtime-payload-inventory.json +122333 -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 +7 -0
- package/dist/{src/foundation/ui-components → ui/components}/index.js +7 -0
- package/dist/{src/foundation/ui-components → ui/components}/line-input.d.ts +2 -8
- package/dist/{src/foundation/ui-components → ui/components}/line-input.js +7 -28
- 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 +24 -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-input.d.ts +32 -0
- package/dist/ui/components/prompt-input.js +54 -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/ui/components/selection-copy.d.ts +24 -0
- package/dist/ui/components/selection-copy.js +39 -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 +28 -0
- package/dist/ui/components/spans.js +266 -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 +210 -0
- package/dist/{src/foundation/ui-components → ui/components}/text.d.ts +14 -0
- package/dist/{src/foundation/ui-components → ui/components}/text.js +67 -5
- package/dist/ui/components/transcript-viewport.d.ts +173 -0
- package/dist/ui/components/transcript-viewport.js +753 -0
- package/dist/ui/components/visible-hyperlinks.d.ts +26 -0
- package/dist/ui/components/visible-hyperlinks.js +97 -0
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/declarations.d.ts +8 -1
- package/dist/ui/settings/declarations.js +94 -0
- 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 +28 -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 +41 -22
- package/dist/{src/foundation/owned-ui-settings → ui/settings}/session.d.ts +9 -17
- package/dist/ui/settings/session.js +164 -0
- 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 +14 -10
- package/docs/architecture/code-documentation.md +77 -0
- package/docs/architecture/history-editor-provenance.md +100 -0
- package/docs/architecture/internal-naming.md +91 -0
- package/docs/architecture/process-guardian-provenance.md +3 -1
- package/docs/architecture/project-structure.md +69 -30
- package/docs/architecture/prompt-suggestions.md +68 -0
- package/docs/architecture/resource-and-data-policy.md +28 -2
- package/docs/architecture/response-copy-delivery.md +83 -0
- package/docs/architecture/tool-image-presentation.md +62 -0
- package/docs/architecture/toolchain.md +24 -10
- package/docs/architecture/ui-reference-provenance.md +59 -5
- package/docs/ci-release-runbook.md +236 -79
- package/docs/features/launch-profiles.md +24 -17
- package/docs/features/modal-content-interaction.md +37 -0
- package/docs/features/prompt-history.md +149 -0
- package/docs/manual-code-streaming-cleanup.md +88 -0
- 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/openspec-archive-automation.md +124 -0
- package/docs/repository-governance-live-acceptance.md +77 -0
- package/package.json +45 -28
- package/dist/src/cli/capabilities.d.ts +0 -15
- package/dist/src/cli/dispatch.js +0 -142
- 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/features/owned-ui/run.js +0 -15
- package/dist/src/foundation/lifecycle/paths.d.ts +0 -10
- package/dist/src/foundation/owned-ui-contracts/index.d.ts +0 -3
- package/dist/src/foundation/owned-ui-contracts/index.js +0 -3
- package/dist/src/foundation/owned-ui-settings/declarations.js +0 -39
- package/dist/src/foundation/owned-ui-settings/session.js +0 -145
- package/dist/src/foundation/pi-component-adapter/shell-editor-autocomplete.js +0 -162
- package/dist/src/foundation/pi-component-adapter/shell-presenters-transcript.d.ts +0 -57
- package/dist/src/foundation/pi-component-adapter/shell-shared-facade.d.ts +0 -116
- package/dist/src/foundation/pi-component-adapter/upstream/components/earendil-announcement.js +0 -19
- package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.d.ts +0 -18
- package/dist/src/foundation/pi-component-adapter/upstream/components/owned-editor.js +0 -55
- package/dist/src/foundation/pi-engine-adapter/settings-integration.d.ts +0 -55
- package/dist/src/foundation/pi-owned-ui-integration/index.d.ts +0 -2
- package/dist/src/foundation/pi-owned-ui-integration/index.js +0 -2
- 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/pi-owned-ui-integration/session-shell.js +0 -1518
- package/dist/src/foundation/pi-tui-runtime-adapter/index.d.ts +0 -4
- package/dist/src/foundation/pi-tui-runtime-adapter/index.js +0 -4
- package/dist/src/foundation/release/bootstrap.d.ts +0 -29
- 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/supervision/server.d.ts +0 -22
- 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}/model.js +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-owned-ui-integration/route-host.js → integrations/pi/components/editor-interaction.js} +0 -0
- /package/dist/{src/foundation/pi-tui-runtime-adapter/contracts.js → integrations/pi/components/prompt-input-port.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/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/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-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}/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,63 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { posix } from "node:path";
|
|
4
|
+
const REPOSITORY = "https://github.com/earendil-works/pi";
|
|
5
|
+
export async function readPinnedCommandChangelog(sinceVersion) {
|
|
6
|
+
const path = new URL("./resources/changelog.json", import.meta.url);
|
|
7
|
+
if (!existsSync(path))
|
|
8
|
+
return sinceVersion === undefined ? "No changelog entries found." : "";
|
|
9
|
+
try {
|
|
10
|
+
const resource = JSON.parse(await readFile(path, "utf8"));
|
|
11
|
+
if (!resource || typeof resource !== "object" || !("data" in resource) || typeof resource.data !== "string")
|
|
12
|
+
throw new TypeError("Invalid owned changelog resource");
|
|
13
|
+
const markdown = resource.data;
|
|
14
|
+
return formatPinnedCommandChangelog(markdown, sinceVersion);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
// Compatibility: Pi's data-file parser reports a warning and supplies an empty changelog.
|
|
18
|
+
console.error(`Warning: Could not parse changelog: ${error}`);
|
|
19
|
+
return sinceVersion === undefined ? "No changelog entries found." : "";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function formatPinnedCommandChangelog(content, sinceVersion) {
|
|
23
|
+
// Provenance: behavior follows Pi 0.84.2 utils/changelog.ts at 914cf1472e715297caa30db4b9535d534a9eb718.
|
|
24
|
+
// Runtime reads only the owned data resource; maintenance tooling verifies its pinned provenance.
|
|
25
|
+
let releases = content.split(/(?=^## )/m).flatMap((section) => {
|
|
26
|
+
const version = /^##\s+\[?(\d+)\.(\d+)\.(\d+)\]?/.exec(section);
|
|
27
|
+
return version ? [{ version: version.slice(1).map(Number), markdown: section.trim() }] : [];
|
|
28
|
+
});
|
|
29
|
+
if (sinceVersion !== undefined) {
|
|
30
|
+
const previous = sinceVersion.split(".").map(value => Number(value) || 0);
|
|
31
|
+
releases = releases.filter(release => {
|
|
32
|
+
for (let index = 0; index < 3; index++) {
|
|
33
|
+
const difference = release.version[index] - (previous[index] ?? 0);
|
|
34
|
+
if (difference !== 0)
|
|
35
|
+
return difference > 0;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
releases.reverse();
|
|
42
|
+
if (releases.length === 0)
|
|
43
|
+
return sinceVersion === undefined ? "No changelog entries found." : "";
|
|
44
|
+
return releases.map(release => release.markdown.replace(/(!?\[[^\]\n]+\]\()([^\s)]+)((?:\s+[^)]*)?\))/g, (_match, prefix, target, suffix) => `${prefix}${releaseLink(target, `v${release.version.join(".")}`)}${suffix}`)).join("\n\n");
|
|
45
|
+
}
|
|
46
|
+
function releaseLink(target, tag) {
|
|
47
|
+
const canonical = target
|
|
48
|
+
.replace(/^https:\/\/github\.com\/(?:badlogic|earendil-works)\/pi-mono(?=\/|$)/, REPOSITORY)
|
|
49
|
+
.replace(/^(https:\/\/github\.com\/earendil-works\/pi\/(?:blob|tree)\/)(?:main|master)\//, `$1${tag}/`);
|
|
50
|
+
if (/^(?:#|\/\/|[a-z][a-z0-9+.-]*:)/i.test(canonical))
|
|
51
|
+
return canonical;
|
|
52
|
+
const boundary = canonical.search(/[?#]/);
|
|
53
|
+
const path = boundary === -1 ? canonical : canonical.slice(0, boundary);
|
|
54
|
+
const suffix = boundary === -1 ? "" : canonical.slice(boundary);
|
|
55
|
+
if (!path)
|
|
56
|
+
return canonical;
|
|
57
|
+
const normalized = path.replaceAll("\\", "/");
|
|
58
|
+
const repositoryPath = posix.normalize(normalized.startsWith("/") ? normalized.replace(/^\/+/, "") : posix.join("packages/coding-agent", normalized));
|
|
59
|
+
if (repositoryPath === "." || repositoryPath === ".." || repositoryPath.startsWith("../"))
|
|
60
|
+
return canonical;
|
|
61
|
+
const route = path.endsWith("/") || !posix.basename(repositoryPath).includes(".") ? "tree" : "blob";
|
|
62
|
+
return `${REPOSITORY}/${route}/${tag}/${encodeURI(repositoryPath)}${suffix}`;
|
|
63
|
+
}
|
|
@@ -7,12 +7,13 @@ export declare const REQUIRED_PI_CAPABILITY_OPERATIONS: Readonly<{
|
|
|
7
7
|
readonly "public-exports": readonly ["services.create", "session.create", "runtime.create"];
|
|
8
8
|
readonly "session-lifecycle": readonly ["session.new", "session.resume", "session.rebind", "session.dispose"];
|
|
9
9
|
readonly "commands-events": readonly ["prompt", "steer", "followUp", "abort", "compact", "setModel", "setThinkingLevel", "subscribe", "dispose"];
|
|
10
|
-
readonly "models-authentication": readonly ["models.list", "models.refresh", "auth.status", "auth.login", "auth.logout", "auth.cancel"];
|
|
10
|
+
readonly "models-authentication": readonly ["models.list", "models.refresh", "models.completeSimple", "auth.status", "auth.login", "auth.logout", "auth.cancel"];
|
|
11
11
|
readonly settings: readonly ["settings.read", "settings.write", "settings.flush"];
|
|
12
|
-
readonly "resources-extensions": readonly ["resources.discover", "extensions.bind", "extensions.reload", "renderers.invoke"];
|
|
12
|
+
readonly "resources-extensions": readonly ["resources.discover", "extensions.inline", "extensions.bind", "extensions.reload", "renderers.invoke"];
|
|
13
13
|
readonly workflows: readonly ["workflow.route", "workflow.validate", "workflow.diagnostics"];
|
|
14
14
|
readonly disposal: readonly ["subscription.dispose", "session.dispose", "services.cleanup"];
|
|
15
15
|
}>;
|
|
16
|
+
/** Identifies one required Pi capability operation that differs from the accepted integration contract. */
|
|
16
17
|
export declare class PiCapabilityCompatibilityError extends Error {
|
|
17
18
|
readonly packageVersion: string;
|
|
18
19
|
readonly capability: string;
|
|
@@ -29,6 +30,7 @@ export interface PiUpgradeConformanceReport {
|
|
|
29
30
|
readonly commandSurface: readonly string[];
|
|
30
31
|
readonly capabilities: readonly PiCapabilityConformanceResult[];
|
|
31
32
|
}
|
|
33
|
+
/** Identifies the public Pi SDK stage that failed during upgrade conformance. */
|
|
32
34
|
export declare class PiUpgradeConformanceError extends Error {
|
|
33
35
|
readonly stage: "exports" | "services" | "session";
|
|
34
36
|
constructor(stage: "exports" | "services" | "session", cause: unknown);
|
|
@@ -2,18 +2,20 @@ import { mkdtemp, rm } from "node:fs/promises";
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, ModelRuntime, SessionManager, VERSION, } from "@earendil-works/pi-coding-agent";
|
|
5
|
-
import { OWNED_UI_CONTRACT_VERSION } from "
|
|
6
|
-
import { PRODUCT_IDENTITY } from "
|
|
5
|
+
import { OWNED_UI_CONTRACT_VERSION } from "../../../contracts/owned-ui/index.js";
|
|
6
|
+
import { PRODUCT_IDENTITY } from "../../../product-identity.js";
|
|
7
|
+
import { createWindowsNulCleanupExtension } from "./windows-filesystem-hygiene.js";
|
|
7
8
|
export const REQUIRED_PI_CAPABILITY_OPERATIONS = Object.freeze({
|
|
8
9
|
"public-exports": ["services.create", "session.create", "runtime.create"],
|
|
9
10
|
"session-lifecycle": ["session.new", "session.resume", "session.rebind", "session.dispose"],
|
|
10
11
|
"commands-events": ["prompt", "steer", "followUp", "abort", "compact", "setModel", "setThinkingLevel", "subscribe", "dispose"],
|
|
11
|
-
"models-authentication": ["models.list", "models.refresh", "auth.status", "auth.login", "auth.logout", "auth.cancel"],
|
|
12
|
+
"models-authentication": ["models.list", "models.refresh", "models.completeSimple", "auth.status", "auth.login", "auth.logout", "auth.cancel"],
|
|
12
13
|
settings: ["settings.read", "settings.write", "settings.flush"],
|
|
13
|
-
"resources-extensions": ["resources.discover", "extensions.bind", "extensions.reload", "renderers.invoke"],
|
|
14
|
+
"resources-extensions": ["resources.discover", "extensions.inline", "extensions.bind", "extensions.reload", "renderers.invoke"],
|
|
14
15
|
workflows: ["workflow.route", "workflow.validate", "workflow.diagnostics"],
|
|
15
16
|
disposal: ["subscription.dispose", "session.dispose", "services.cleanup"],
|
|
16
17
|
});
|
|
18
|
+
/** Identifies one required Pi capability operation that differs from the accepted integration contract. */
|
|
17
19
|
export class PiCapabilityCompatibilityError extends Error {
|
|
18
20
|
packageVersion;
|
|
19
21
|
capability;
|
|
@@ -26,6 +28,7 @@ export class PiCapabilityCompatibilityError extends Error {
|
|
|
26
28
|
this.name = "PiCapabilityCompatibilityError";
|
|
27
29
|
}
|
|
28
30
|
}
|
|
31
|
+
/** Identifies the public Pi SDK stage that failed during upgrade conformance. */
|
|
29
32
|
export class PiUpgradeConformanceError extends Error {
|
|
30
33
|
stage;
|
|
31
34
|
constructor(stage, cause) {
|
|
@@ -57,11 +60,18 @@ export async function runPiUpgradeConformance() {
|
|
|
57
60
|
refreshOnCreate: false,
|
|
58
61
|
allowModelNetwork: false,
|
|
59
62
|
});
|
|
63
|
+
const cleanupExtension = createWindowsNulCleanupExtension({ platform: "win32" });
|
|
64
|
+
if (cleanupExtension === null)
|
|
65
|
+
throw new Error("Windows NUL cleanup extension is unavailable");
|
|
60
66
|
services = await createAgentSessionServices({
|
|
61
67
|
cwd: root,
|
|
62
68
|
agentDir: join(root, "agent"),
|
|
63
69
|
modelRuntime,
|
|
70
|
+
resourceLoaderOptions: { extensionFactories: [cleanupExtension] },
|
|
64
71
|
});
|
|
72
|
+
if (!services.resourceLoader.getExtensions().extensions.some(extension => extension.path === "<inline:windows-nul-file-cleanup>")) {
|
|
73
|
+
throw new Error("named inline extension factory was not loaded");
|
|
74
|
+
}
|
|
65
75
|
}
|
|
66
76
|
catch (error) {
|
|
67
77
|
throw new PiUpgradeConformanceError("services", error);
|
|
@@ -76,7 +86,7 @@ export async function runPiUpgradeConformance() {
|
|
|
76
86
|
const session = created.session;
|
|
77
87
|
sessionId = session.sessionId;
|
|
78
88
|
requireMethods(session, "session commands", ["prompt", "steer", "followUp", "abort", "compact", "setModel", "setThinkingLevel", "subscribe", "dispose"]);
|
|
79
|
-
requireMethods(services.modelRuntime, "models/authentication", ["getModels", "getModel", "checkAuth", "login", "logout", "refresh"]);
|
|
89
|
+
requireMethods(services.modelRuntime, "models/authentication", ["getModels", "getModel", "completeSimple", "checkAuth", "login", "logout", "refresh"]);
|
|
80
90
|
requireMethods(services.settingsManager, "settings", ["getGlobalSettings", "getProjectSettings", "flush"]);
|
|
81
91
|
requireMethods(services.resourceLoader, "resources/extensions", ["getExtensions", "getSkills", "getPrompts", "getThemes", "reload"]);
|
|
82
92
|
const unsubscribe = session.subscribe(() => undefined);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Apply the profile's HTTP timeout to npm undici and its fetch globals. */
|
|
2
|
+
export declare function configureOwnedHttpDispatcher(timeoutMs: number): void;
|
|
3
|
+
/** Test and diagnostics seam; reports configured semantics, not the max-int implementation detail. */
|
|
4
|
+
export declare function configuredOwnedHttpIdleTimeoutMs(): number | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Provenance: mechanically adapted from Pi commit 914cf14
|
|
2
|
+
// packages/coding-agent/src/core/http-dispatcher.ts (MIT).
|
|
3
|
+
// Local modifications: expose only A1's owned timeout seam and retain no private Pi imports.
|
|
4
|
+
import { EnvHttpProxyAgent, install, setGlobalDispatcher } from "undici";
|
|
5
|
+
const MAX_DISABLED_TIMEOUT_MS = 2_147_483_647;
|
|
6
|
+
let configuredTimeoutMs = null;
|
|
7
|
+
/** Apply the profile's HTTP timeout to npm undici and its fetch globals. */
|
|
8
|
+
export function configureOwnedHttpDispatcher(timeoutMs) {
|
|
9
|
+
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 0)
|
|
10
|
+
throw new TypeError("HTTP idle timeout is invalid");
|
|
11
|
+
const effectiveTimeoutMs = timeoutMs === 0 ? MAX_DISABLED_TIMEOUT_MS : timeoutMs;
|
|
12
|
+
const dispatcher = new EnvHttpProxyAgent({
|
|
13
|
+
allowH2: false,
|
|
14
|
+
bodyTimeout: effectiveTimeoutMs,
|
|
15
|
+
headersTimeout: effectiveTimeoutMs,
|
|
16
|
+
connect: { autoSelectFamilyAttemptTimeout: 2_000 },
|
|
17
|
+
});
|
|
18
|
+
setGlobalDispatcher(dispatcher);
|
|
19
|
+
install?.();
|
|
20
|
+
configuredTimeoutMs = timeoutMs;
|
|
21
|
+
}
|
|
22
|
+
/** Test and diagnostics seam; reports configured semantics, not the max-int implementation detail. */
|
|
23
|
+
export function configuredOwnedHttpIdleTimeoutMs() {
|
|
24
|
+
return configuredTimeoutMs;
|
|
25
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export * from "./adapter.js";
|
|
2
2
|
export * from "./conformance.js";
|
|
3
3
|
export * from "./runtime-integration.js";
|
|
4
|
+
export * from "./session-selection.js";
|
|
4
5
|
export * from "./session-integration.js";
|
|
5
6
|
export * from "./model-auth-integration.js";
|
|
6
7
|
export * from "./settings-integration.js";
|
|
8
|
+
export * from "./settings-effects.js";
|
|
9
|
+
export * from "./project-trust-preflight.js";
|
|
10
|
+
export * from "./http-dispatcher.js";
|
|
7
11
|
export * from "./package-integration.js";
|
|
8
12
|
export * from "./resource-extension-integration.js";
|
|
9
13
|
export * from "./workflow-controllers.js";
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export * from "./adapter.js";
|
|
2
2
|
export * from "./conformance.js";
|
|
3
3
|
export * from "./runtime-integration.js";
|
|
4
|
+
export * from "./session-selection.js";
|
|
4
5
|
export * from "./session-integration.js";
|
|
5
6
|
export * from "./model-auth-integration.js";
|
|
6
7
|
export * from "./settings-integration.js";
|
|
8
|
+
export * from "./settings-effects.js";
|
|
9
|
+
export * from "./project-trust-preflight.js";
|
|
10
|
+
export * from "./http-dispatcher.js";
|
|
7
11
|
export * from "./package-integration.js";
|
|
8
12
|
export * from "./resource-extension-integration.js";
|
|
9
13
|
export * from "./workflow-controllers.js";
|
package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/model-auth-integration.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { AgentAuthenticationPort, AgentModelDescriptor, AgentModelPort } from "
|
|
2
|
+
import type { AgentAuthenticationPort, AgentModelDescriptor, AgentModelPort } from "../../../contracts/agent-engine/index.js";
|
|
3
3
|
export type PiDocumentedModelRuntime = Pick<ModelRuntime, "getAvailableSnapshot" | "getModel" | "getProvider" | "hasConfiguredAuth" | "refresh" | "logout">;
|
|
4
4
|
export interface PiModelAuthenticationOptions {
|
|
5
5
|
readonly runtime: PiDocumentedModelRuntime;
|
|
@@ -9,6 +9,7 @@ export interface PiModelAuthenticationOptions {
|
|
|
9
9
|
readonly timeoutMs?: number;
|
|
10
10
|
readonly scopedModelIds?: () => readonly string[] | undefined;
|
|
11
11
|
}
|
|
12
|
+
/** Adapts the pinned model runtime to neutral model selection and authentication operations. */
|
|
12
13
|
export declare class PiModelAuthenticationIntegration implements AgentModelPort, AgentAuthenticationPort {
|
|
13
14
|
#private;
|
|
14
15
|
private readonly options;
|
package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentPackagesPort, type AgentPackagesPortInput } from "
|
|
1
|
+
import { type AgentPackagesPort, type AgentPackagesPortInput } from "../../../contracts/agent-engine/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Pinned Pi's package manager already takes the profile root as an argument, so
|
|
4
4
|
* this binds it to the root A1 chose rather than to whatever the configuration-root
|
package/dist/{src/foundation/pi-engine-adapter → integrations/pi/engine}/package-integration.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { DefaultPackageManager, ModelRuntime, SettingsManager } from "@earendil-works/pi-coding-agent";
|
|
3
|
-
import { agentPackageOutcome, } from "
|
|
3
|
+
import { agentPackageOutcome, } from "../../../contracts/agent-engine/index.js";
|
|
4
4
|
const MODEL_REFRESH_TIMEOUT_MS = 15_000;
|
|
5
5
|
/**
|
|
6
6
|
* Pinned Pi's package manager already takes the profile root as an argument, so
|
|
@@ -15,21 +15,33 @@ const MODEL_REFRESH_TIMEOUT_MS = 15_000;
|
|
|
15
15
|
*/
|
|
16
16
|
export function createPiPackagesPort(input) {
|
|
17
17
|
const { profileRoot, cwd } = input;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
return;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
// Compatibility: model-only refresh bypasses package settings and their diagnostics, as Pi does.
|
|
19
|
+
let packageManager;
|
|
20
|
+
const manager = () => {
|
|
21
|
+
if (packageManager)
|
|
22
|
+
return packageManager;
|
|
23
|
+
const settingsManager = SettingsManager.create(cwd, profileRoot, { projectTrusted: false });
|
|
24
|
+
for (const { scope, error } of settingsManager.drainErrors()) {
|
|
25
|
+
input.onDiagnostic?.({
|
|
26
|
+
message: `Warning (package command, ${scope} settings): ${error.message}`,
|
|
27
|
+
...(error.stack ? { detail: error.stack } : {}),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
packageManager = new DefaultPackageManager({ cwd, agentDir: profileRoot, settingsManager });
|
|
31
|
+
packageManager.setProgressCallback(event => {
|
|
32
|
+
if (event.type !== "start")
|
|
33
|
+
return;
|
|
34
|
+
input.onProgress?.({ operation: operationFor(event.action), message: String(event.message) });
|
|
35
|
+
});
|
|
36
|
+
return packageManager;
|
|
37
|
+
};
|
|
38
|
+
const configured = () => manager().listConfiguredPackages()
|
|
26
39
|
.filter(entry => entry.scope === "user")
|
|
27
40
|
.map(entry => Object.freeze({
|
|
28
41
|
source: entry.source,
|
|
29
42
|
installedPath: entry.installedPath ?? null,
|
|
30
43
|
filtered: entry.filtered,
|
|
31
44
|
}));
|
|
32
|
-
const isConfigured = (source) => configured().some(entry => entry.source === source || entry.source.startsWith(`${source}@`));
|
|
33
45
|
return Object.freeze({
|
|
34
46
|
capabilities: Object.freeze({ install: true, remove: true, update: true, refreshModels: true }),
|
|
35
47
|
profileRoot,
|
|
@@ -38,13 +50,13 @@ export function createPiPackagesPort(input) {
|
|
|
38
50
|
},
|
|
39
51
|
async install(source) {
|
|
40
52
|
return await attempt("install", source, async () => {
|
|
41
|
-
await
|
|
53
|
+
await manager().installAndPersist(source);
|
|
42
54
|
return agentPackageOutcome("install", "completed", null, source, configured());
|
|
43
55
|
});
|
|
44
56
|
},
|
|
45
57
|
async remove(source) {
|
|
46
58
|
return await attempt("remove", source, async () => {
|
|
47
|
-
const removed = await
|
|
59
|
+
const removed = await manager().removeAndPersist(source);
|
|
48
60
|
if (!removed)
|
|
49
61
|
return agentPackageOutcome("remove", "not-found", null, source);
|
|
50
62
|
return agentPackageOutcome("remove", "completed", null, source, configured());
|
|
@@ -52,11 +64,8 @@ export function createPiPackagesPort(input) {
|
|
|
52
64
|
},
|
|
53
65
|
async update(source) {
|
|
54
66
|
return await attempt("update", source ?? null, async () => {
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
if (source !== undefined && !isConfigured(source))
|
|
58
|
-
return agentPackageOutcome("update", "not-found", null, source);
|
|
59
|
-
await packageManager.update(source);
|
|
67
|
+
// Compatibility: Pi owns source identity and its contextual no-match suggestions.
|
|
68
|
+
await manager().update(source);
|
|
60
69
|
return agentPackageOutcome("update", "completed", null, source ?? null, configured());
|
|
61
70
|
});
|
|
62
71
|
},
|
|
@@ -73,7 +82,9 @@ async function attempt(operation, source, run) {
|
|
|
73
82
|
return await run();
|
|
74
83
|
}
|
|
75
84
|
catch (error) {
|
|
76
|
-
|
|
85
|
+
const detail = error instanceof Error ? error.message : operation === "refresh-models"
|
|
86
|
+
? "Unknown model catalog refresh error" : "Unknown package command error";
|
|
87
|
+
return agentPackageOutcome(operation, "failed", detail, source);
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
90
|
async function refreshModelCatalogs(profileRoot) {
|
|
@@ -88,9 +99,10 @@ async function refreshModelCatalogs(profileRoot) {
|
|
|
88
99
|
});
|
|
89
100
|
const result = await modelRuntime.refresh({ allowNetwork: true, force: true, signal: controller.signal });
|
|
90
101
|
if (result.aborted)
|
|
91
|
-
throw new Error(
|
|
102
|
+
throw new Error("Model catalog refresh timed out.");
|
|
92
103
|
if (result.errors.size > 0) {
|
|
93
|
-
|
|
104
|
+
const details = Array.from(result.errors, ([provider, error]) => `${provider}: ${error.message}`).join("; ");
|
|
105
|
+
throw new Error(`Could not refresh model catalogs: ${details}`);
|
|
94
106
|
}
|
|
95
107
|
}
|
|
96
108
|
finally {
|
|
@@ -104,9 +116,3 @@ function operationFor(action) {
|
|
|
104
116
|
return "remove";
|
|
105
117
|
return "update";
|
|
106
118
|
}
|
|
107
|
-
function describe(error) {
|
|
108
|
-
const message = (error instanceof Error ? error.message : String(error)).replace(/\s+/g, " ").trim();
|
|
109
|
-
if (message.length === 0)
|
|
110
|
-
return "unknown package failure";
|
|
111
|
-
return message.length > 600 ? `${message.slice(0, 597)}...` : message;
|
|
112
|
-
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { OwnedUiEvent } from "../../../contracts/owned-ui/index.js";
|
|
2
|
+
export declare const MAX_PENDING_EVENTS = 1024;
|
|
3
|
+
export declare const MAX_PENDING_EVENT_BYTES: number;
|
|
4
|
+
/** Actual shell semantics: only live complete block state has no independent side effect. */
|
|
5
|
+
export declare function replaceableEventKey(event: OwnedUiEvent): string | null;
|
|
6
|
+
/** Intrusive FIFO + segment index: replacement unlinks in O(1), never changes source ordering. */
|
|
7
|
+
export declare class PendingEngineDelivery {
|
|
8
|
+
#private;
|
|
9
|
+
private readonly retain?;
|
|
10
|
+
constructor(retain?: ((event: OwnedUiEvent) => () => void) | undefined);
|
|
11
|
+
get size(): number;
|
|
12
|
+
diagnostics(): {
|
|
13
|
+
pending: number;
|
|
14
|
+
bytes: number;
|
|
15
|
+
protected: number;
|
|
16
|
+
superseded: number;
|
|
17
|
+
peakNodes: number;
|
|
18
|
+
peakBytes: number;
|
|
19
|
+
};
|
|
20
|
+
/** False means not admitted. The caller must enter its reserved recovery protocol, never evict. */
|
|
21
|
+
push(event: OwnedUiEvent, generation: number, reconcile?: () => OwnedUiEvent): boolean;
|
|
22
|
+
/** Session replacement invalidates old view state without resolving its lazy block references. */
|
|
23
|
+
discardObsolete(generation: number): number;
|
|
24
|
+
shift(): {
|
|
25
|
+
event: OwnedUiEvent;
|
|
26
|
+
generation: number;
|
|
27
|
+
release?: (() => void) | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
seal(): boolean;
|
|
30
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export const MAX_PENDING_EVENTS = 1024;
|
|
2
|
+
export const MAX_PENDING_EVENT_BYTES = 8 * 1024 * 1024;
|
|
3
|
+
/** Actual shell semantics: only live complete block state has no independent side effect. */
|
|
4
|
+
export function replaceableEventKey(event) {
|
|
5
|
+
switch (event.type) {
|
|
6
|
+
case "transcript-block": return event.block.status === "live" && !(typeof event.block.payload === "object" && event.block.payload !== null && "isError" in event.block.payload && event.block.payload.isError === true) ? event.block.id : null;
|
|
7
|
+
case "session-view": // Invariant: may clear compaction work, replace editor/session state, or preempt presentation.
|
|
8
|
+
case "status": // Invariant: retry/compaction transitions invalidate suggestion work.
|
|
9
|
+
case "editor-state":
|
|
10
|
+
case "terminal-surface":
|
|
11
|
+
case "session-lifecycle":
|
|
12
|
+
case "agent-run-started":
|
|
13
|
+
case "agent-run-settled":
|
|
14
|
+
case "assistant-message-completed":
|
|
15
|
+
case "command-outcome":
|
|
16
|
+
case "diagnostic":
|
|
17
|
+
case "dialog":
|
|
18
|
+
case "overlay":
|
|
19
|
+
case "customization": return null;
|
|
20
|
+
default: {
|
|
21
|
+
const exhaustive = event;
|
|
22
|
+
return exhaustive;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** Intrusive FIFO + segment index: replacement unlinks in O(1), never changes source ordering. */
|
|
27
|
+
export class PendingEngineDelivery {
|
|
28
|
+
retain;
|
|
29
|
+
#replaceable = new Map();
|
|
30
|
+
#head;
|
|
31
|
+
#tail;
|
|
32
|
+
#size = 0;
|
|
33
|
+
#bytes = 0;
|
|
34
|
+
#protected = 0;
|
|
35
|
+
#generation = -1;
|
|
36
|
+
#superseded = 0;
|
|
37
|
+
#peakNodes = 0;
|
|
38
|
+
#peakBytes = 0;
|
|
39
|
+
constructor(retain) {
|
|
40
|
+
this.retain = retain;
|
|
41
|
+
}
|
|
42
|
+
get size() { return this.#size; }
|
|
43
|
+
diagnostics() {
|
|
44
|
+
return { pending: this.#size, bytes: this.#bytes, protected: this.#protected,
|
|
45
|
+
superseded: this.#superseded, peakNodes: this.#peakNodes, peakBytes: this.#peakBytes };
|
|
46
|
+
}
|
|
47
|
+
/** False means not admitted. The caller must enter its reserved recovery protocol, never evict. */
|
|
48
|
+
push(event, generation, reconcile) {
|
|
49
|
+
const key = replaceableEventKey(event);
|
|
50
|
+
if (generation !== this.#generation || key === null) {
|
|
51
|
+
if (!this.seal())
|
|
52
|
+
return false;
|
|
53
|
+
this.#generation = generation;
|
|
54
|
+
}
|
|
55
|
+
const prior = key === null ? undefined : this.#replaceable.get(key);
|
|
56
|
+
let bytes = retainedEventBytes(event);
|
|
57
|
+
const marker = key !== null && bytes > 64 * 1024 && reconcile !== undefined;
|
|
58
|
+
if (marker)
|
|
59
|
+
bytes = 128;
|
|
60
|
+
if (this.#size - (prior === undefined ? 0 : 1) >= MAX_PENDING_EVENTS
|
|
61
|
+
|| this.#bytes - (prior?.bytes ?? 0) + bytes > MAX_PENDING_EVENT_BYTES)
|
|
62
|
+
return false;
|
|
63
|
+
const node = { key, generation, bytes, ...(marker ? { resolve: reconcile } : { event, release: this.retain?.(event) }) };
|
|
64
|
+
if (prior !== undefined) {
|
|
65
|
+
this.#unlink(prior);
|
|
66
|
+
this.#superseded = Math.min(Number.MAX_SAFE_INTEGER, this.#superseded + 1);
|
|
67
|
+
}
|
|
68
|
+
node.previous = this.#tail;
|
|
69
|
+
if (this.#tail !== undefined)
|
|
70
|
+
this.#tail.next = node;
|
|
71
|
+
else
|
|
72
|
+
this.#head = node;
|
|
73
|
+
this.#tail = node;
|
|
74
|
+
this.#size++;
|
|
75
|
+
this.#bytes += bytes;
|
|
76
|
+
if (key === null)
|
|
77
|
+
this.#protected++;
|
|
78
|
+
else
|
|
79
|
+
this.#replaceable.set(key, node);
|
|
80
|
+
this.#peakNodes = Math.max(this.#peakNodes, this.#size);
|
|
81
|
+
this.#peakBytes = Math.max(this.#peakBytes, this.#bytes);
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
/** Session replacement invalidates old view state without resolving its lazy block references. */
|
|
85
|
+
discardObsolete(generation) {
|
|
86
|
+
let discarded = 0;
|
|
87
|
+
let node = this.#head;
|
|
88
|
+
while (node !== undefined) {
|
|
89
|
+
const next = node.next;
|
|
90
|
+
if (node.generation !== generation && node.event?.type !== "command-outcome") {
|
|
91
|
+
this.#unlink(node);
|
|
92
|
+
discarded++;
|
|
93
|
+
}
|
|
94
|
+
node = next;
|
|
95
|
+
}
|
|
96
|
+
this.#replaceable.clear();
|
|
97
|
+
this.#generation = generation;
|
|
98
|
+
return discarded;
|
|
99
|
+
}
|
|
100
|
+
shift() {
|
|
101
|
+
const node = this.#head;
|
|
102
|
+
if (node === undefined)
|
|
103
|
+
return undefined;
|
|
104
|
+
const event = node.event ?? node.resolve();
|
|
105
|
+
const release = node.release ?? this.retain?.(event);
|
|
106
|
+
this.#unlink(node, false);
|
|
107
|
+
// Invariant: a consumed snapshot retains its assets through synchronous listener delivery, including reentrant production.
|
|
108
|
+
return { event, generation: node.generation, ...(release === undefined ? {} : { release }) };
|
|
109
|
+
}
|
|
110
|
+
// Invariant: a barrier freezes lazy authoritative markers before a later segment can change them.
|
|
111
|
+
seal() {
|
|
112
|
+
for (const node of this.#replaceable.values()) {
|
|
113
|
+
if (node.resolve === undefined)
|
|
114
|
+
continue;
|
|
115
|
+
const event = node.resolve();
|
|
116
|
+
const bytes = retainedEventBytes(event);
|
|
117
|
+
if (this.#bytes - node.bytes + bytes > MAX_PENDING_EVENT_BYTES)
|
|
118
|
+
return false;
|
|
119
|
+
this.#bytes += bytes - node.bytes;
|
|
120
|
+
node.bytes = bytes;
|
|
121
|
+
node.event = event;
|
|
122
|
+
node.resolve = undefined;
|
|
123
|
+
node.release = this.retain?.(event);
|
|
124
|
+
this.#peakBytes = Math.max(this.#peakBytes, this.#bytes);
|
|
125
|
+
}
|
|
126
|
+
this.#replaceable.clear();
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
#unlink(node, release = true) {
|
|
130
|
+
if (release)
|
|
131
|
+
node.release?.();
|
|
132
|
+
if (node.previous !== undefined)
|
|
133
|
+
node.previous.next = node.next;
|
|
134
|
+
else
|
|
135
|
+
this.#head = node.next;
|
|
136
|
+
if (node.next !== undefined)
|
|
137
|
+
node.next.previous = node.previous;
|
|
138
|
+
else
|
|
139
|
+
this.#tail = node.previous;
|
|
140
|
+
this.#size--;
|
|
141
|
+
this.#bytes -= node.bytes;
|
|
142
|
+
if (node.key === null)
|
|
143
|
+
this.#protected--;
|
|
144
|
+
else if (this.#replaceable.get(node.key) === node)
|
|
145
|
+
this.#replaceable.delete(node.key);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/** Conservative UTF-16 payload bound. String length is O(1); never encode accumulated text per chunk. */
|
|
149
|
+
function retainedEventBytes(value) {
|
|
150
|
+
if (typeof value === "string")
|
|
151
|
+
return 16 + value.length * 2;
|
|
152
|
+
if (value === null || typeof value !== "object")
|
|
153
|
+
return 8;
|
|
154
|
+
let bytes = 32;
|
|
155
|
+
for (const [key, item] of Object.entries(value))
|
|
156
|
+
bytes += 16 + key.length * 2 + retainedEventBytes(item);
|
|
157
|
+
return bytes;
|
|
158
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface PiProjectTrustPreflightRequest {
|
|
2
|
+
readonly cwd: string;
|
|
3
|
+
readonly defaultDecision: "ask" | "always" | "never";
|
|
4
|
+
}
|
|
5
|
+
export type PiProjectTrustPreflightPrompt = (request: PiProjectTrustPreflightRequest) => Promise<boolean | null>;
|
|
6
|
+
export interface PiProjectTrustPreflightResult {
|
|
7
|
+
readonly trusted: boolean;
|
|
8
|
+
readonly source: "no-project-resources" | "saved" | "default" | "interactive" | "fail-closed";
|
|
9
|
+
readonly diagnostic: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface ResolvePiProjectTrustPreflightOptions {
|
|
12
|
+
readonly cwd: string;
|
|
13
|
+
readonly agentDir: string;
|
|
14
|
+
readonly prompt?: PiProjectTrustPreflightPrompt;
|
|
15
|
+
readonly hasProjectResources?: (cwd: string) => boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Resolves trust from global state only. It never constructs a project-trusted
|
|
19
|
+
* settings manager or resource loader; callers may do that only after this
|
|
20
|
+
* result exists.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolvePiProjectTrustPreflight(options: ResolvePiProjectTrustPreflightOptions): Promise<PiProjectTrustPreflightResult>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { hasTrustRequiringProjectResources, ProjectTrustStore, SettingsManager, } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves trust from global state only. It never constructs a project-trusted
|
|
4
|
+
* settings manager or resource loader; callers may do that only after this
|
|
5
|
+
* result exists.
|
|
6
|
+
*/
|
|
7
|
+
export async function resolvePiProjectTrustPreflight(options) {
|
|
8
|
+
const hasProjectResources = options.hasProjectResources ?? hasTrustRequiringProjectResources;
|
|
9
|
+
if (!hasProjectResources(options.cwd)) {
|
|
10
|
+
return { trusted: true, source: "no-project-resources", diagnostic: null };
|
|
11
|
+
}
|
|
12
|
+
const trustStore = new ProjectTrustStore(options.agentDir);
|
|
13
|
+
const saved = trustStore.get(options.cwd);
|
|
14
|
+
if (saved !== null)
|
|
15
|
+
return { trusted: saved, source: "saved", diagnostic: null };
|
|
16
|
+
// Security: projectTrusted:false is the boundary: this read may see global
|
|
17
|
+
// settings but cannot consume project settings or construct project resources.
|
|
18
|
+
const globalSettings = SettingsManager.create(options.cwd, options.agentDir, { projectTrusted: false });
|
|
19
|
+
const fallback = globalSettings.getDefaultProjectTrust();
|
|
20
|
+
if (fallback === "always")
|
|
21
|
+
return { trusted: true, source: "default", diagnostic: null };
|
|
22
|
+
if (fallback === "never")
|
|
23
|
+
return { trusted: false, source: "default", diagnostic: null };
|
|
24
|
+
if (options.prompt === undefined) {
|
|
25
|
+
return {
|
|
26
|
+
trusted: false,
|
|
27
|
+
source: "fail-closed",
|
|
28
|
+
diagnostic: `Project resources in ${options.cwd} were withheld because trust requires interaction`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const decision = await options.prompt({ cwd: options.cwd, defaultDecision: fallback });
|
|
33
|
+
if (decision === null) {
|
|
34
|
+
return {
|
|
35
|
+
trusted: false,
|
|
36
|
+
source: "fail-closed",
|
|
37
|
+
diagnostic: `Project resources in ${options.cwd} were withheld because trust selection was cancelled`,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
trustStore.set(options.cwd, decision);
|
|
41
|
+
return { trusted: decision, source: "interactive", diagnostic: null };
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
return {
|
|
45
|
+
trusted: false,
|
|
46
|
+
source: "fail-closed",
|
|
47
|
+
diagnostic: `Project resources in ${options.cwd} were withheld because trust resolution failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AgentSession } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { AgentExtensionBinding, AgentExtensionFailure, AgentExtensionPort, AgentResourceDescriptor, AgentResourcesPort, AgentSessionMetadata } from "
|
|
2
|
+
import type { AgentExtensionBinding, AgentExtensionFailure, AgentExtensionPort, AgentResourceDescriptor, AgentResourcesPort, AgentSessionMetadata } from "../../../contracts/agent-engine/index.js";
|
|
3
3
|
export interface PiResourceExtensionOptions {
|
|
4
4
|
readonly session: AgentSession;
|
|
5
5
|
readonly bindUi: () => Promise<void>;
|
|
6
6
|
readonly unbindUi: () => Promise<void>;
|
|
7
7
|
}
|
|
8
|
+
/** Adapts Pi resource discovery and extension binding while containing extension failures at the port. */
|
|
8
9
|
export declare class PiResourceExtensionIntegration implements AgentResourcesPort, AgentExtensionPort {
|
|
9
10
|
#private;
|
|
10
11
|
private readonly options;
|