@code-yeongyu/senpi 2026.9.11 → 2026.9.12-3
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/CHANGELOG.md +83 -0
- package/README.md +1 -1
- package/dist/bun/cli.d.ts +2 -1
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +5 -8
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/runtime-setup.d.ts +2 -0
- package/dist/bun/runtime-setup.d.ts.map +1 -0
- package/dist/bun/runtime-setup.js +9 -0
- package/dist/bun/runtime-setup.js.map +1 -0
- package/dist/bun/sandbox-env-setup.d.ts +2 -0
- package/dist/bun/sandbox-env-setup.d.ts.map +1 -0
- package/dist/bun/sandbox-env-setup.js +4 -0
- package/dist/bun/sandbox-env-setup.js.map +1 -0
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +2 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +12 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +1 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -2
- package/dist/client/index.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +18 -6
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +54 -17
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +153 -157
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +6 -4
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction-settings-access.d.ts +18 -2
- package/dist/core/compaction-settings-access.d.ts.map +1 -1
- package/dist/core/compaction-settings-access.js +35 -4
- package/dist/core/compaction-settings-access.js.map +1 -1
- package/dist/core/compaction-settings-resolver.d.ts +2 -2
- package/dist/core/compaction-settings-resolver.d.ts.map +1 -1
- package/dist/core/compaction-settings-resolver.js +6 -3
- package/dist/core/compaction-settings-resolver.js.map +1 -1
- package/dist/core/cursor-history-admission.d.ts +50 -0
- package/dist/core/cursor-history-admission.d.ts.map +1 -0
- package/dist/core/cursor-history-admission.js +130 -0
- package/dist/core/cursor-history-admission.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/extension.js +11 -0
- package/dist/core/extensions/builtin/ask-user/extension.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +2 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +7 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +4 -2
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/keybindings.d.ts +10 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +8 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-registry.d.ts +5 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +8 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +2 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +1 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +5 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/retry-fallback/settings.d.ts +2 -0
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/session-manager.d.ts +5 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +68 -19
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-write-reservation.d.ts +9 -0
- package/dist/core/session-write-reservation.d.ts.map +1 -1
- package/dist/core/session-write-reservation.js +33 -0
- package/dist/core/session-write-reservation.js.map +1 -1
- package/dist/core/settings-manager.d.ts +12 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +18 -6
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-public-types.d.ts +1 -1
- package/dist/core/settings-public-types.d.ts.map +1 -1
- package/dist/core/settings-public-types.js.map +1 -1
- package/dist/core/skills.d.ts +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -2
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +8 -9
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +3 -142
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +1 -12
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -168
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +2 -53
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -58
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +2 -47
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +1 -4
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -141
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts +12 -0
- package/dist/core/tools/renderers/bash.d.ts.map +1 -0
- package/dist/core/tools/renderers/bash.js +156 -0
- package/dist/core/tools/renderers/bash.js.map +1 -0
- package/dist/core/tools/renderers/edit.d.ts +23 -0
- package/dist/core/tools/renderers/edit.d.ts.map +1 -0
- package/dist/core/tools/renderers/edit.js +172 -0
- package/dist/core/tools/renderers/edit.js.map +1 -0
- package/dist/core/tools/renderers/find.d.ts +10 -0
- package/dist/core/tools/renderers/find.d.ts.map +1 -0
- package/dist/core/tools/renderers/find.js +64 -0
- package/dist/core/tools/renderers/find.js.map +1 -0
- package/dist/core/tools/renderers/grep.d.ts +10 -0
- package/dist/core/tools/renderers/grep.d.ts.map +1 -0
- package/dist/core/tools/renderers/grep.js +69 -0
- package/dist/core/tools/renderers/grep.js.map +1 -0
- package/dist/core/tools/renderers/index.d.ts +28 -0
- package/dist/core/tools/renderers/index.d.ts.map +1 -0
- package/dist/core/tools/renderers/index.js +47 -0
- package/dist/core/tools/renderers/index.js.map +1 -0
- package/dist/core/tools/renderers/ls.d.ts +10 -0
- package/dist/core/tools/renderers/ls.d.ts.map +1 -0
- package/dist/core/tools/renderers/ls.js +58 -0
- package/dist/core/tools/renderers/ls.js.map +1 -0
- package/dist/core/tools/renderers/read.d.ts +19 -0
- package/dist/core/tools/renderers/read.d.ts.map +1 -0
- package/dist/core/tools/renderers/read.js +149 -0
- package/dist/core/tools/renderers/read.js.map +1 -0
- package/dist/core/tools/renderers/write.d.ts +10 -0
- package/dist/core/tools/renderers/write.d.ts.map +1 -0
- package/dist/core/tools/renderers/write.js +162 -0
- package/dist/core/tools/renderers/write.js.map +1 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +4 -153
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +2 -2
- package/dist/migrations.js.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.d.ts +3 -1
- package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
- package/dist/modes/app-server/threads/turns.js +1 -1
- package/dist/modes/app-server/threads/turns.js.map +1 -1
- package/dist/modes/app-server/turn-adapter.js +4 -2
- package/dist/modes/app-server/turn-adapter.js.map +1 -1
- package/dist/modes/interactive/chat-viewport.d.ts +22 -0
- package/dist/modes/interactive/chat-viewport.d.ts.map +1 -0
- package/dist/modes/interactive/chat-viewport.js +29 -0
- package/dist/modes/interactive/chat-viewport.js.map +1 -0
- package/dist/modes/interactive/components/ask-user-answer-key.d.ts +14 -0
- package/dist/modes/interactive/components/ask-user-answer-key.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-user-answer-key.js +65 -0
- package/dist/modes/interactive/components/ask-user-answer-key.js.map +1 -0
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts +17 -12
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.js +47 -23
- package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +7 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +26 -2
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/assistant-render-descriptors.d.ts +4 -0
- package/dist/modes/interactive/components/assistant-render-descriptors.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-render-descriptors.js +8 -5
- package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +10 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +37 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +8 -8
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +4 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +14 -2
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +4 -4
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution-renderer.d.ts +4 -1
- package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution-renderer.js +23 -10
- package/dist/modes/interactive/components/tool-execution-renderer.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution-types.d.ts +18 -2
- package/dist/modes/interactive/components/tool-execution-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution-types.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +3 -3
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +5 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +10 -15
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +178 -138
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +2 -1
- package/dist/modes/interactive/theme/grok-day.json +2 -1
- package/dist/modes/interactive/theme/grok-night.json +2 -1
- package/dist/modes/interactive/theme/light.json +2 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.js +5 -0
- package/dist/modes/interactive/theme/theme-controller.js.map +1 -1
- package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
- package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme-json.js +130 -0
- package/dist/modes/interactive/theme/theme-json.js.map +1 -0
- package/dist/modes/interactive/theme/theme-schema.json +6 -2
- package/dist/modes/interactive/theme/theme.d.ts +10 -5
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +14 -117
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.d.ts +5 -0
- package/dist/modes/interactive/tips/catalog/input-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.js +5 -0
- package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
- package/dist/modes/interactive/tui-renderer.d.ts +21 -0
- package/dist/modes/interactive/tui-renderer.d.ts.map +1 -0
- package/dist/modes/interactive/tui-renderer.js +67 -0
- package/dist/modes/interactive/tui-renderer.js.map +1 -0
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +8 -2
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +11 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +1 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-path-reservations.d.ts +30 -0
- package/dist/modes/rpc/session-path-reservations.d.ts.map +1 -0
- package/dist/modes/rpc/session-path-reservations.js +58 -0
- package/dist/modes/rpc/session-path-reservations.js.map +1 -0
- package/dist/modes/rpc/session-registry.d.ts +3 -1
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-worker-client.d.ts +10 -8
- package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-client.js +14 -23
- package/dist/modes/rpc/session-worker-client.js.map +1 -1
- package/dist/modes/rpc/session-worker-credit.d.ts +17 -0
- package/dist/modes/rpc/session-worker-credit.d.ts.map +1 -0
- package/dist/modes/rpc/session-worker-credit.js +39 -0
- package/dist/modes/rpc/session-worker-credit.js.map +1 -0
- package/dist/modes/rpc/session-worker-protocol.d.ts +10 -0
- package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.js +2 -0
- package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
- package/dist/modes/rpc/session-worker-signals.d.ts +7 -0
- package/dist/modes/rpc/session-worker-signals.d.ts.map +1 -0
- package/dist/modes/rpc/session-worker-signals.js +19 -0
- package/dist/modes/rpc/session-worker-signals.js.map +1 -0
- package/dist/modes/rpc/session-worker.js +12 -16
- package/dist/modes/rpc/session-worker.js.map +1 -1
- package/dist/modes/rpc/worker-session-registry.d.ts +12 -0
- package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/worker-session-registry.js +51 -24
- package/dist/modes/rpc/worker-session-registry.js.map +1 -1
- package/dist/senpi +3 -0
- package/dist/utils/clipboard-command.d.ts +7 -0
- package/dist/utils/clipboard-command.d.ts.map +1 -0
- package/dist/utils/clipboard-command.js +45 -0
- package/dist/utils/clipboard-command.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +52 -69
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +49 -126
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/exif-orientation.js +2 -3
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/tools-manager.d.ts +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +41 -19
- package/dist/utils/tools-manager.js.map +1 -1
- package/docs/compaction.md +39 -13
- package/docs/containerization.md +45 -0
- package/docs/development.md +19 -0
- package/docs/docs.json +4 -0
- package/docs/environment-variables.md +2 -0
- package/docs/extensions.md +21 -10
- package/docs/keybindings.md +7 -2
- package/docs/models.md +1 -1
- package/docs/providers.md +1 -1
- package/docs/rpc.md +16 -8
- package/docs/sdk.md +7 -0
- package/docs/session-format.md +52 -38
- package/docs/settings.md +40 -4
- package/docs/skills.md +1 -1
- package/docs/termux.md +0 -1
- package/docs/themes.md +8 -6
- package/docs/tui.md +22 -3
- package/examples/README.md +3 -0
- package/examples/extensions/dynamic-resources/dynamic.json +2 -0
- package/examples/plugins/pi-example-plugin/README.md +38 -0
- package/examples/plugins/pi-example-plugin/package.json +10 -0
- package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
- package/examples/plugins/pi-example-plugin/src/session.ts +23 -0
- package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +3 -3
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +5 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/hasOwn.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/util/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/hasOwn.d.ts +4 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/hasOwn.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/util/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/LICENSE +201 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/README.md +62 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +158 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/constants.js +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +16 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +84 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromStatic.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getNewSsoOidcToken.js +11 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/getSsoOidcClient.js +10 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/index.js +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/nodeProvider.js +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenExpiry.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/validateTokenKey.js +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/writeSSOTokenToFile.js +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/constants.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +18 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromSso.d.ts +12 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/fromStatic.d.ts +9 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getNewSsoOidcToken.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/getSsoOidcClient.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/nodeProvider.d.ts +18 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/constants.d.ts +3 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +8 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromSso.d.ts +10 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromStatic.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getNewSsoOidcToken.d.ts +9 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/getSsoOidcClient.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +7 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/nodeProvider.d.ts +3 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenExpiry.d.ts +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/validateTokenKey.d.ts +1 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/writeSSOTokenToFile.d.ts +2 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenExpiry.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/validateTokenKey.d.ts +4 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-types/writeSSOTokenToFile.d.ts +5 -0
- package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +69 -0
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/package.json +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +36 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +5 -5
- package/node_modules/@earendil-works/chord/README.md +205 -0
- package/node_modules/@earendil-works/chord/dist/api.d.ts +15 -0
- package/node_modules/@earendil-works/chord/dist/api.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/api.js +72 -0
- package/node_modules/@earendil-works/chord/dist/api.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts +6 -0
- package/node_modules/@earendil-works/chord/dist/bundler.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/bundler.js +3 -0
- package/node_modules/@earendil-works/chord/dist/bundler.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts +24 -0
- package/node_modules/@earendil-works/chord/dist/context/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/context/index.js +97 -0
- package/node_modules/@earendil-works/chord/dist/context/index.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts +119 -0
- package/node_modules/@earendil-works/chord/dist/delta/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/delta/index.js +1209 -0
- package/node_modules/@earendil-works/chord/dist/delta/index.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts +12 -0
- package/node_modules/@earendil-works/chord/dist/facets/host.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/facets/host.js +762 -0
- package/node_modules/@earendil-works/chord/dist/facets/host.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts +3 -0
- package/node_modules/@earendil-works/chord/dist/facets/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/facets/loader.js +5 -0
- package/node_modules/@earendil-works/chord/dist/facets/loader.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/index.d.ts +11 -0
- package/node_modules/@earendil-works/chord/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/index.js +10 -0
- package/node_modules/@earendil-works/chord/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/json.d.ts +4 -0
- package/node_modules/@earendil-works/chord/dist/json.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/json.js +57 -0
- package/node_modules/@earendil-works/chord/dist/json.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts +30 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js +377 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle-loader.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts +26 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle.js +183 -0
- package/node_modules/@earendil-works/chord/dist/node/bundle.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts +36 -0
- package/node_modules/@earendil-works/chord/dist/node/manifest.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/manifest.js +6 -0
- package/node_modules/@earendil-works/chord/dist/node/manifest.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts +15 -0
- package/node_modules/@earendil-works/chord/dist/node/package.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node/package.js +199 -0
- package/node_modules/@earendil-works/chord/dist/node/package.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node.d.ts +5 -0
- package/node_modules/@earendil-works/chord/dist/node.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/node.js +3 -0
- package/node_modules/@earendil-works/chord/dist/node.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts +11 -0
- package/node_modules/@earendil-works/chord/dist/services/consumer.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/consumer.js +535 -0
- package/node_modules/@earendil-works/chord/dist/services/consumer.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts +8 -0
- package/node_modules/@earendil-works/chord/dist/services/errors.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/errors.js +21 -0
- package/node_modules/@earendil-works/chord/dist/services/errors.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts +15 -0
- package/node_modules/@earendil-works/chord/dist/services/handle.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/handle.js +99 -0
- package/node_modules/@earendil-works/chord/dist/services/handle.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts +25 -0
- package/node_modules/@earendil-works/chord/dist/services/instances.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/instances.js +137 -0
- package/node_modules/@earendil-works/chord/dist/services/instances.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts +5 -0
- package/node_modules/@earendil-works/chord/dist/services/loopback.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/loopback.js +15 -0
- package/node_modules/@earendil-works/chord/dist/services/loopback.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts +37 -0
- package/node_modules/@earendil-works/chord/dist/services/provider.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/provider.js +472 -0
- package/node_modules/@earendil-works/chord/dist/services/provider.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts +15 -0
- package/node_modules/@earendil-works/chord/dist/services/state-codec.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js +115 -0
- package/node_modules/@earendil-works/chord/dist/services/state-codec.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts +11 -0
- package/node_modules/@earendil-works/chord/dist/services/state-internals.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js +10 -0
- package/node_modules/@earendil-works/chord/dist/services/state-internals.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts +23 -0
- package/node_modules/@earendil-works/chord/dist/services/state.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/state.js +124 -0
- package/node_modules/@earendil-works/chord/dist/services/state.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts +60 -0
- package/node_modules/@earendil-works/chord/dist/services/wire.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/services/wire.js +173 -0
- package/node_modules/@earendil-works/chord/dist/services/wire.js.map +1 -0
- package/node_modules/@earendil-works/chord/dist/types.d.ts +203 -0
- package/node_modules/@earendil-works/chord/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/chord/dist/types.js +2 -0
- package/node_modules/@earendil-works/chord/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/chord/package.json +73 -0
- package/node_modules/@earendil-works/pi-agent-core/README.md +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +639 -384
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +5 -250
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts +12 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +33 -27
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts +30 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +53 -64
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts +9 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js +35 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/config.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts +9 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js +13 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/context.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts +25 -28
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +368 -125
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts +20 -38
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js +233 -55
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts +42 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js +82 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/assistant.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts +22 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js +48 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/effect-gate.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts +67 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js +121 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution/tools.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts +38 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js +404 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/hooks.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts +2 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts +3 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +17 -17
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts +93 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js +39 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts +28 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js +173 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/boundary.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js +133 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/checkpoint.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts +15 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js +179 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/deferred.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js +205 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/generation.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts +5 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js +140 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/reconcile.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js +85 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/recovery.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts +23 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js +394 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/response.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js +34 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/retry.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts +32 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js +929 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/structural.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts +7 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js +49 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/terminal.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts +14 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js +244 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tool-placement.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js +449 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive/tools.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts +6 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js +93 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/drive.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts +59 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js +302 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/harness.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts +118 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js +1559 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/lane.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts +15 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js +66 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/progress.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts +5 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js +240 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/reducer.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts +24 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js +117 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/restore.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts +21 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js +72 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/transcript.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts +105 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js +50 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/runtime/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts +53 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js +57 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/commit.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts +6 -19
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js +31 -53
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts +21 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js +55 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork-policy.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts +16 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js +79 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/fork.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts +39 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js +269 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/in-memory-storage-state.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts +9 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js +7 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts +19 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js +34 -219
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/codec.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts +38 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js +266 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/fork.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/index.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts +14 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js +86 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/io.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts +44 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js +454 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/legacy-v3.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts +27 -24
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js +276 -151
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts +39 -41
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js +175 -196
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts +23 -22
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts +44 -40
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js +333 -115
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts +8 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js +22 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/mutation-line.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +78 -51
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +327 -207
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts +12 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js +24 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/datasets.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts +42 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js +127 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/session-repo.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts +25 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js +114 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/benchmark/storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts +23 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js +809 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/session-repo.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js +600 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance/storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts +26 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js +103 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/gating-storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts +9 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js +8 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts +11 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js +19 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/instrumented-storage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts +20 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js +40 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/storage-decorator.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts +5 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts +425 -265
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js +7 -7
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts +95 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js +81 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/values.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts +3 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +29 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +64 -43
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js +45 -26
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts +4 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js +66 -93
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/bash.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js +17 -13
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/edit.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js +5 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/file-mutation-queue.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts +3 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js +5 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/path-utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts +2 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js +4 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/read.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js +12 -8
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/tools/write.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +128 -45
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts +24 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js +79 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/adaptive-publisher.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts +31 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js +217 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/output-capture.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts +19 -5
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +65 -192
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js +33 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/usage.js.map +1 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts +4 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js +3 -6
- package/node_modules/@earendil-works/pi-agent-core/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts +24 -16
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +2 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +27 -6
- package/node_modules/@earendil-works/pi-ai/README.md +39 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +8 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts +77 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js +72 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-ai-binding.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js +96 -51
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts +389 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js +132 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts +34 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js +41 -8
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts +18 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js +77 -35
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts +9 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js +30 -38
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js +69 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js +61 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts +6 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js +6 -4
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts +13 -5
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js +76 -21
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/mistral-conversations.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +6 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js +4 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +13 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js +7 -2
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts +32 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js +62 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +5 -2
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/openai-responses-compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/azure-openai-responses.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/deepseek.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/github-copilot.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan-individual.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/qwen-token-plan.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js +18 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +5 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-headers.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js +5 -4
- package/node_modules/@earendil-works/pi-ai/dist/providers/opencode.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +16 -6
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts +77 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js +427 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/assistant-message-frame.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js +93 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +25 -5
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts +10 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry-profile/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts +13 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +18 -7
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js +36 -31
- package/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +6 -6
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/README.md +53 -4
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts +21 -1
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js +199 -42
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts +3 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js +28 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/box.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts +6 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +98 -18
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts +12 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js +40 -6
- package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/latex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/latex.js +7 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/latex.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts +3 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js +20 -8
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts +12 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js +19 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/mouse-region.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts +6 -3
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js +6 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts +4 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js +48 -2
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts +5 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js +54 -5
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +3 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js +3 -0
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts +3 -1
- package/node_modules/@earendil-works/pi-tui/dist/layout.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/layout.js +32 -9
- package/node_modules/@earendil-works/pi-tui/dist/layout.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +2 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +3 -44
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts +18 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.js +42 -0
- package/node_modules/@earendil-works/pi-tui/dist/native-platform.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js +2 -20
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts +31 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js +335 -41
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts +83 -5
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js +118 -4
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +2 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +9 -0
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/native/clipboard.h +170 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/README.md +8 -6
- package/node_modules/@earendil-works/pi-tui/native/darwin/build.sh +12 -5
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/{darwin-modifiers.node → darwin-platform.node} +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/{darwin-modifiers.node → darwin-platform.node} +0 -0
- package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-platform.m +93 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/README.md +23 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/build.sh +65 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/src/clipboard-worker.h +70 -0
- package/node_modules/@earendil-works/pi-tui/native/linux/src/linux-platform-x11.c +274 -0
- package/node_modules/@earendil-works/pi-tui/native/napi.h +89 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/README.md +18 -7
- package/node_modules/@earendil-works/pi-tui/native/win32/build.mjs +7 -4
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-platform.c +241 -0
- package/node_modules/@earendil-works/pi-tui/package.json +10 -3
- package/node_modules/@google/genai/dist/genai.d.ts +1799 -289
- package/node_modules/@google/genai/dist/index.cjs +319 -299
- package/node_modules/@google/genai/dist/index.mjs +319 -299
- package/node_modules/@google/genai/dist/index.mjs.map +1 -1
- package/node_modules/@google/genai/dist/node/index.cjs +320 -300
- package/node_modules/@google/genai/dist/node/index.mjs +320 -300
- package/node_modules/@google/genai/dist/node/index.mjs.map +1 -1
- package/node_modules/@google/genai/dist/node/node.d.ts +1799 -289
- package/node_modules/@google/genai/dist/tokenizer/node.cjs +49 -2
- package/node_modules/@google/genai/dist/tokenizer/node.d.ts +43 -3
- package/node_modules/@google/genai/dist/tokenizer/node.mjs +49 -2
- package/node_modules/@google/genai/dist/tokenizer/node.mjs.map +1 -1
- package/node_modules/@google/genai/dist/vertex_internal/index.cjs +39 -3
- package/node_modules/@google/genai/dist/vertex_internal/index.cjs.map +1 -1
- package/node_modules/@google/genai/dist/vertex_internal/index.d.ts +51 -9
- package/node_modules/@google/genai/dist/vertex_internal/index.js +39 -3
- package/node_modules/@google/genai/dist/vertex_internal/index.js.map +1 -1
- package/node_modules/@google/genai/dist/web/index.mjs +319 -299
- package/node_modules/@google/genai/dist/web/index.mjs.map +1 -1
- package/node_modules/@google/genai/dist/web/web.d.ts +1799 -289
- package/node_modules/@google/genai/package.json +1 -1
- package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -4
- package/node_modules/@smithy/node-http-handler/dist-es/http2/ClientHttp2SessionRef.js +1 -0
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +2 -3
- package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +8 -1
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/LICENSE +201 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/README.md +115 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-cjs/index.js +96 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort-handler.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/abort.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpApiKeyAuth.js +5 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthScheme.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpAuthSchemeProvider.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/HttpSigner.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/IdentityProviderConfig.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/auth.js +5 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/auth/index.js +2 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/blob/blob-payload-input-types.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/checksum.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/client.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/command.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/config.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/index.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/manager.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/connection/pool.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/crypto.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/downlevel-ts3.4/transform/type-transform.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/encode.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoint.js +5 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointParameterInstructions.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/EndpointRuleObject.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/ErrorRuleObject.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/RuleSetObject.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/TreeRuleObject.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/index.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/endpoints/shared.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/eventStream.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/checksum.js +38 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultClientConfiguration.js +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/defaultExtensionConfiguration.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/index.js +2 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/extensions/retry.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/externals-check/browser-externals-check.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/feature-ids.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http/httpHandlerInitialization.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/http.js +5 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/apiKeyIdentity.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/awsCredentialIdentity.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/identity.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/index.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/identity/tokenIdentity.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/index.js +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/logger.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/metrics.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/middleware.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/pagination.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/profile.js +6 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/response.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/retry.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema-deprecated.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/schema.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/sentinels.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/static-schemas.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/schema/traits.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/serde.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/shapes.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/signature.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/stream.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-common-types.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-input-types.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/streaming-payload/streaming-blob-payload-output-types.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transfer.js +6 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-method-transforms.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/client-payload-blob-type-narrow.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/exact.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/mutable.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/no-undefined.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/transform/type-transform.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/uri.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/util.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-es/waiter.js +1 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort-handler.d.ts +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/abort.d.ts +48 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpApiKeyAuth.d.ts +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthScheme.d.ts +49 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpAuthSchemeProvider.d.ts +20 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/HttpSigner.d.ts +41 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/IdentityProviderConfig.d.ts +14 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/auth.d.ts +59 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/auth/index.d.ts +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +37 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/checksum.d.ts +61 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/client.d.ts +57 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/command.d.ts +28 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/config.d.ts +15 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/index.d.ts +3 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/manager.d.ts +34 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/connection/pool.d.ts +32 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/crypto.d.ts +58 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/downlevel-ts3.4/transform/type-transform.d.ts +24 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/encode.d.ts +31 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoint.d.ts +77 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointParameterInstructions.d.ts +41 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/EndpointRuleObject.d.ts +27 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/ErrorRuleObject.d.ts +10 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/RuleSetObject.d.ts +28 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/TreeRuleObject.d.ts +16 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/index.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/endpoints/shared.d.ts +55 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/eventStream.d.ts +137 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/checksum.d.ts +58 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultClientConfiguration.d.ts +32 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/defaultExtensionConfiguration.d.ts +9 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/index.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/extensions/retry.d.ts +18 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/externals-check/browser-externals-check.d.ts +35 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/feature-ids.d.ts +16 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +142 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/http.d.ts +110 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/apiKeyIdentity.d.ts +14 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/awsCredentialIdentity.d.ts +31 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/identity.d.ts +15 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/index.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/identity/tokenIdentity.d.ts +14 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/index.d.ts +52 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/logger.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/metrics.d.ts +93 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/middleware.d.ts +541 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/pagination.d.ts +33 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/profile.d.ts +30 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/response.d.ts +40 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/retry.d.ts +162 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema-deprecated.d.ts +143 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/schema.d.ts +236 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/static-schemas.d.ts +99 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/serde.d.ts +114 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/shapes.d.ts +79 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/signature.d.ts +172 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/stream.d.ts +22 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +28 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +54 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +41 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transfer.d.ts +42 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +26 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +73 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/exact.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +68 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/transform/type-transform.d.ts +39 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort-handler.d.ts +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/abort.d.ts +45 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpApiKeyAuth.d.ts +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthScheme.d.ts +49 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpAuthSchemeProvider.d.ts +20 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/HttpSigner.d.ts +41 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/IdentityProviderConfig.d.ts +14 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/auth.d.ts +59 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/auth/index.d.ts +7 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +37 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/checksum.d.ts +61 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/client.d.ts +57 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +28 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/config.d.ts +15 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/index.d.ts +3 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/manager.d.ts +34 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/connection/pool.d.ts +32 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/crypto.d.ts +58 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/downlevel-ts3.4/transform/type-transform.d.ts +40 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/encode.d.ts +31 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +77 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointParameterInstructions.d.ts +41 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/EndpointRuleObject.d.ts +27 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/ErrorRuleObject.d.ts +10 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/RuleSetObject.d.ts +28 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/TreeRuleObject.d.ts +16 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/index.d.ts +5 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/endpoints/shared.d.ts +55 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/eventStream.d.ts +137 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/checksum.d.ts +58 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultClientConfiguration.d.ts +32 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/defaultExtensionConfiguration.d.ts +9 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/index.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/extensions/retry.d.ts +18 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/externals-check/browser-externals-check.d.ts +35 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/feature-ids.d.ts +16 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +142 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/http.d.ts +110 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/apiKeyIdentity.d.ts +14 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/awsCredentialIdentity.d.ts +31 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/identity.d.ts +15 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/index.d.ts +4 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/identity/tokenIdentity.d.ts +14 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +52 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/logger.d.ts +13 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/metrics.d.ts +93 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +541 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/pagination.d.ts +33 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/profile.d.ts +30 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/response.d.ts +40 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/retry.d.ts +162 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema-deprecated.d.ts +149 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +251 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/static-schemas.d.ts +118 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +114 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/shapes.d.ts +79 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/signature.d.ts +172 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/stream.d.ts +22 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +28 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +54 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +41 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transfer.d.ts +42 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +26 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +77 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/exact.d.ts +14 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +88 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/transform/type-transform.d.ts +40 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/uri.d.ts +17 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/util.d.ts +192 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/ts3.4/waiter.d.ts +35 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/uri.d.ts +17 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/util.d.ts +176 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/dist-types/waiter.d.ts +35 -0
- package/node_modules/@smithy/node-http-handler/node_modules/@smithy/types/package.json +50 -0
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/esbuild/LICENSE.md +21 -0
- package/node_modules/esbuild/README.md +3 -0
- package/node_modules/esbuild/bin/esbuild +223 -0
- package/node_modules/esbuild/install.js +300 -0
- package/node_modules/esbuild/lib/main.d.ts +720 -0
- package/node_modules/esbuild/lib/main.js +2536 -0
- package/node_modules/esbuild/package.json +47 -0
- package/node_modules/ignore/README.md +52 -0
- package/node_modules/ignore/index.js +785 -129
- package/node_modules/ignore/legacy.js +660 -98
- package/node_modules/ignore/package.json +10 -4
- package/node_modules/marked/README.md +1 -0
- package/node_modules/marked/lib/marked.d.ts +7 -0
- package/node_modules/marked/lib/marked.esm.js +30 -30
- package/node_modules/marked/lib/marked.esm.js.map +3 -3
- package/node_modules/marked/lib/marked.umd.js +30 -30
- package/node_modules/marked/lib/marked.umd.js.map +3 -3
- package/node_modules/marked/man/marked.1 +1 -1
- package/node_modules/marked/package.json +2 -2
- package/node_modules/typebox/build/compile/validator.d.mts +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
- package/node_modules/typebox/build/format/iri.mjs +5 -1
- package/node_modules/typebox/build/guard/emit.mjs +2 -4
- package/node_modules/typebox/build/guard/guard.mjs +6 -18
- package/node_modules/typebox/build/guard/string.mjs +16 -24
- package/node_modules/typebox/build/schema/compile.d.mts +3 -2
- package/node_modules/typebox/build/schema/compile.mjs +8 -8
- package/node_modules/typebox/build/schema/engine/_context.d.mts +1 -6
- package/node_modules/typebox/build/schema/engine/_context.mjs +9 -14
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +6 -2
- package/node_modules/typebox/build/schema/engine/_stack.mjs +135 -32
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/allOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/if.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +1 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/errors.d.mts +2 -2
- package/node_modules/typebox/build/schema/errors.mjs +7 -13
- package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
- package/node_modules/typebox/build/schema/intern/intern.d.mts +14 -0
- package/node_modules/typebox/build/schema/intern/intern.mjs +259 -0
- package/node_modules/typebox/build/schema/parse.d.mts +1 -0
- package/node_modules/typebox/build/schema/parse.mjs +10 -5
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +34 -3
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +198 -73
- package/node_modules/typebox/build/schema/schema.d.mts +1 -0
- package/node_modules/typebox/build/schema/schema.mjs +1 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
- package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +9 -5
- package/node_modules/undici/docs/docs/api/Client.md +4 -0
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +3 -2
- package/node_modules/undici/docs/docs/api/EventSource.md +4 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +7 -3
- package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +7 -1
- package/node_modules/undici/lib/cache/memory-cache-store.js +2 -2
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/dispatcher/agent.js +7 -2
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +7 -4
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +43 -3
- package/node_modules/undici/lib/dispatcher/client.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +13 -1
- package/node_modules/undici/lib/dispatcher/dispatcher.js +15 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +10 -3
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -1
- package/node_modules/undici/lib/dispatcher/retry-agent.js +3 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +1 -1
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +91 -21
- package/node_modules/undici/lib/handler/cache-handler.js +29 -5
- package/node_modules/undici/lib/handler/decorator-handler.js +7 -1
- package/node_modules/undici/lib/handler/deduplication-handler.js +12 -6
- package/node_modules/undici/lib/handler/redirect-handler.js +21 -4
- package/node_modules/undici/lib/handler/retry-handler.js +148 -30
- package/node_modules/undici/lib/interceptor/cache.js +65 -12
- package/node_modules/undici/lib/interceptor/decompress.js +115 -13
- package/node_modules/undici/lib/interceptor/deduplicate.js +5 -4
- package/node_modules/undici/lib/interceptor/dns.js +7 -0
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/mock/mock-agent.js +13 -1
- package/node_modules/undici/lib/mock/mock-utils.js +11 -10
- package/node_modules/undici/lib/util/cache.js +45 -3
- package/node_modules/undici/lib/web/cookies/parse.js +150 -147
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +28 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +13 -3
- package/node_modules/undici/lib/web/fetch/index.js +6 -0
- package/node_modules/undici/lib/web/fetch/request.js +2 -3
- package/node_modules/undici/lib/web/fetch/util.js +6 -1
- package/node_modules/undici/lib/web/webidl/index.js +3 -3
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/client.d.ts +10 -0
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/node_modules/undici/types/mock-agent.d.ts +11 -10
- package/node_modules/undici/types/socks5-proxy-agent.d.ts +2 -0
- package/package.json +70 -49
- package/vendor/pi-client/client.d.ts +20 -15
- package/vendor/pi-client/client.d.ts.map +1 -1
- package/vendor/pi-client/client.js +248 -245
- package/vendor/pi-client/client.js.map +1 -1
- package/vendor/pi-client/connection.d.ts +4 -3
- package/vendor/pi-client/connection.d.ts.map +1 -1
- package/vendor/pi-client/connection.js +13 -9
- package/vendor/pi-client/connection.js.map +1 -1
- package/vendor/pi-client/errors.d.ts +6 -15
- package/vendor/pi-client/errors.d.ts.map +1 -1
- package/vendor/pi-client/errors.js +10 -25
- package/vendor/pi-client/errors.js.map +1 -1
- package/vendor/pi-client/index.d.ts +3 -4
- package/vendor/pi-client/index.d.ts.map +1 -1
- package/vendor/pi-client/index.js +2 -2
- package/vendor/pi-client/index.js.map +1 -1
- package/vendor/pi-client/types.d.ts +14 -8
- package/vendor/pi-client/types.d.ts.map +1 -1
- package/vendor/pi-client/types.js.map +1 -1
- package/vendor/pi-client/unix.d.ts +14 -1
- package/vendor/pi-client/unix.d.ts.map +1 -1
- package/vendor/pi-client/unix.js +138 -8
- package/vendor/pi-client/unix.js.map +1 -1
- package/vendor/pi-protocol/codec.d.ts +2 -4
- package/vendor/pi-protocol/codec.d.ts.map +1 -1
- package/vendor/pi-protocol/codec.js +7 -34
- package/vendor/pi-protocol/codec.js.map +1 -1
- package/vendor/pi-protocol/framing.d.ts +0 -2
- package/vendor/pi-protocol/framing.d.ts.map +1 -1
- package/vendor/pi-protocol/framing.js +0 -15
- package/vendor/pi-protocol/framing.js.map +1 -1
- package/vendor/pi-protocol/index.d.ts +1 -1
- package/vendor/pi-protocol/index.d.ts.map +1 -1
- package/vendor/pi-protocol/index.js +1 -1
- package/vendor/pi-protocol/index.js.map +1 -1
- package/vendor/pi-protocol/protocol.d.ts +167 -0
- package/vendor/pi-protocol/protocol.d.ts.map +1 -0
- package/vendor/pi-protocol/protocol.js +85 -0
- package/vendor/pi-protocol/protocol.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts +0 -2
- package/dist/bun/register-bedrock.d.ts.map +0 -1
- package/dist/bun/register-bedrock.js +0 -4
- package/dist/bun/register-bedrock.js.map +0 -1
- package/dist/cli/experimental/auth.d.ts +0 -16
- package/dist/cli/experimental/auth.d.ts.map +0 -1
- package/dist/cli/experimental/auth.js +0 -13
- package/dist/cli/experimental/auth.js.map +0 -1
- package/dist/cli/experimental/cli.d.ts +0 -6
- package/dist/cli/experimental/cli.d.ts.map +0 -1
- package/dist/cli/experimental/cli.js +0 -5
- package/dist/cli/experimental/cli.js.map +0 -1
- package/dist/cli/experimental/command-options.d.ts +0 -17
- package/dist/cli/experimental/command-options.d.ts.map +0 -1
- package/dist/cli/experimental/command-options.js +0 -35
- package/dist/cli/experimental/command-options.js.map +0 -1
- package/dist/cli/experimental/command.d.ts +0 -63
- package/dist/cli/experimental/command.d.ts.map +0 -1
- package/dist/cli/experimental/command.js +0 -127
- package/dist/cli/experimental/command.js.map +0 -1
- package/dist/cli/experimental/commands/client.d.ts +0 -13
- package/dist/cli/experimental/commands/client.d.ts.map +0 -1
- package/dist/cli/experimental/commands/client.js +0 -25
- package/dist/cli/experimental/commands/client.js.map +0 -1
- package/dist/cli/experimental/commands/pi.d.ts +0 -15
- package/dist/cli/experimental/commands/pi.d.ts.map +0 -1
- package/dist/cli/experimental/commands/pi.js +0 -28
- package/dist/cli/experimental/commands/pi.js.map +0 -1
- package/dist/cli/experimental/commands/server.d.ts +0 -13
- package/dist/cli/experimental/commands/server.d.ts.map +0 -1
- package/dist/cli/experimental/commands/server.js +0 -25
- package/dist/cli/experimental/commands/server.js.map +0 -1
- package/dist/cli/experimental/transport-address.d.ts +0 -10
- package/dist/cli/experimental/transport-address.d.ts.map +0 -1
- package/dist/cli/experimental/transport-address.js +0 -38
- package/dist/cli/experimental/transport-address.js.map +0 -1
- package/dist/client/remote-session.d.ts +0 -53
- package/dist/client/remote-session.d.ts.map +0 -1
- package/dist/client/remote-session.js +0 -340
- package/dist/client/remote-session.js.map +0 -1
- package/dist/client/transcript.d.ts +0 -12
- package/dist/client/transcript.d.ts.map +0 -1
- package/dist/client/transcript.js +0 -98
- package/dist/client/transcript.js.map +0 -1
- package/dist/server/create-harness.d.ts +0 -26
- package/dist/server/create-harness.d.ts.map +0 -1
- package/dist/server/create-harness.js +0 -106
- package/dist/server/create-harness.js.map +0 -1
- package/dist/utils/clipboard-native.d.ts +0 -11
- package/dist/utils/clipboard-native.d.ts.map +0 -1
- package/dist/utils/clipboard-native.js +0 -20
- package/dist/utils/clipboard-native.js.map +0 -1
- package/docs/AGENTS.md +0 -67
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts +0 -100
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js +0 -420
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts +0 -9
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js +0 -18
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts +0 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js +0 -2
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts +0 -65
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js +0 -320
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts +0 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js +0 -762
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts +0 -29
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js +0 -103
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts +0 -69
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js +0 -159
- package/node_modules/@earendil-works/pi-ai/dist/api/cloudflare-gateway-binding.js.map +0 -1
- package/node_modules/@earendil-works/pi-tui/native/darwin/src/darwin-modifiers.c +0 -70
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/pi-tui/native/win32/src/win32-console-mode.c +0 -119
- package/node_modules/@mariozechner/clipboard/.yarnrc.yml +0 -1
- package/node_modules/@mariozechner/clipboard/Cargo.toml +0 -45
- package/node_modules/@mariozechner/clipboard/README.md +0 -60
- package/node_modules/@mariozechner/clipboard/build.rs +0 -5
- package/node_modules/@mariozechner/clipboard/exp.ts +0 -12
- package/node_modules/@mariozechner/clipboard/index.d.ts +0 -37
- package/node_modules/@mariozechner/clipboard/index.js +0 -606
- package/node_modules/@mariozechner/clipboard/package.json +0 -45
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/common.rs +0 -307
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/mod.rs +0 -93
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/ios.rs +0 -313
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/macos.rs +0 -471
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/mod.rs +0 -252
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/wayland.rs +0 -431
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/win.rs +0 -712
- package/node_modules/@mariozechner/clipboard/src/clipboard_rs/platform/x11.rs +0 -916
- package/node_modules/@mariozechner/clipboard/src/lib.rs +0 -194
- package/vendor/pi-client/session-handle.d.ts +0 -54
- package/vendor/pi-client/session-handle.d.ts.map +0 -1
- package/vendor/pi-client/session-handle.js +0 -50
- package/vendor/pi-client/session-handle.js.map +0 -1
- package/vendor/pi-client/state.d.ts +0 -22
- package/vendor/pi-client/state.d.ts.map +0 -1
- package/vendor/pi-client/state.js +0 -145
- package/vendor/pi-client/state.js.map +0 -1
- package/vendor/pi-protocol/schemas.d.ts +0 -13739
- package/vendor/pi-protocol/schemas.d.ts.map +0 -1
- package/vendor/pi-protocol/schemas.js +0 -386
- package/vendor/pi-protocol/schemas.js.map +0 -1
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAqB,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GACvB,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,IA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AED,kCAAkC;AAClC,MAAM,UAAU,WAAW;IAC1B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,SAAS;IACxB,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,aAAa;IAC5B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,cAAc;IAC7B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CAAC;AACxC,CAAC;AAED,iCAAiC;AACjC,MAAM,UAAU,eAAe;IAC9B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,QAAQ,YAAY,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { accessSync, constants, existsSync, readFileSync, realpathSync } from \"fs\";\nimport { homedir } from \"os\";\nimport { basename, dirname, join, resolve, sep, win32 } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { createBunLauncherRepairCommand } from \"./bun-global-launcher.ts\";\nimport { type BrandProfile, brandProfile, envValue } from \"./core/brand.ts\";\nimport { findNearestParentConfigDir } from \"./nearest-parent-config.ts\";\nimport { spawnProcessSync } from \"./utils/child-process.ts\";\nimport { normalizePath } from \"./utils/paths.ts\";\nimport { stripBom } from \"./utils/text.ts\";\n\n// =============================================================================\n// Package Detection\n// =============================================================================\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Detect if we're running as a Bun compiled binary.\n * Bun binaries have import.meta.url containing \"$bunfs\", \"~BUN\", or \"%7EBUN\" (Bun's virtual filesystem path)\n */\nexport const isBunBinary =\n\timport.meta.url.includes(\"$bunfs\") || import.meta.url.includes(\"~BUN\") || import.meta.url.includes(\"%7EBUN\");\n\n/** Detect if Bun is the runtime (compiled binary or bun run) */\nexport const isBunRuntime = !!process.versions.bun;\n\n// =============================================================================\n// Install Method Detection\n// =============================================================================\n\nexport type InstallMethod = \"bun-binary\" | \"npm\" | \"pnpm\" | \"yarn\" | \"bun\" | \"unknown\";\n\ninterface SelfUpdateCommandStep {\n\tcommand: string;\n\targs: string[];\n\tdisplay: string;\n}\n\nexport interface SelfUpdateCommand extends SelfUpdateCommandStep {\n\tsteps?: SelfUpdateCommandStep[];\n}\n\nexport type SelfUpdatePackageTarget = string | { packageName: string; installSpec?: string };\n\nfunction normalizeSelfUpdatePackageTarget(target: SelfUpdatePackageTarget): {\n\tpackageName: string;\n\tinstallSpec: string;\n} {\n\tif (typeof target === \"string\") {\n\t\treturn { packageName: target, installSpec: target };\n\t}\n\treturn { packageName: target.packageName, installSpec: target.installSpec ?? target.packageName };\n}\n\nfunction makeSelfUpdateCommand(\n\tinstallStep: SelfUpdateCommandStep,\n\tuninstallStep?: SelfUpdateCommandStep,\n\tpostInstallStep?: SelfUpdateCommandStep,\n): SelfUpdateCommand {\n\tconst steps = [\n\t\t...(uninstallStep ? [uninstallStep] : []),\n\t\tinstallStep,\n\t\t...(postInstallStep ? [postInstallStep] : []),\n\t];\n\tif (steps.length === 1) return installStep;\n\treturn {\n\t\t...installStep,\n\t\tdisplay: steps.map((step) => step.display).join(\" && \"),\n\t\tsteps,\n\t};\n}\n\nfunction makeSelfUpdateCommandStep(command: string, args: string[]): SelfUpdateCommandStep {\n\treturn {\n\t\tcommand,\n\t\targs,\n\t\tdisplay: [command, ...args].map((arg) => (/\\s/.test(arg) ? `\"${arg}\"` : arg)).join(\" \"),\n\t};\n}\n\nexport function detectInstallMethod(): InstallMethod {\n\tif (isBunBinary) {\n\t\treturn \"bun-binary\";\n\t}\n\n\tconst resolvedPath = `${__dirname}\\0${process.execPath || \"\"}`.toLowerCase().replace(/\\\\/g, \"/\");\n\n\tif (resolvedPath.includes(\"/pnpm/\") || resolvedPath.includes(\"/.pnpm/\")) {\n\t\treturn \"pnpm\";\n\t}\n\tif (resolvedPath.includes(\"/yarn/\") || resolvedPath.includes(\"/.yarn/\")) {\n\t\treturn \"yarn\";\n\t}\n\tif (isBunRuntime || resolvedPath.includes(\"/install/global/node_modules/\")) {\n\t\treturn \"bun\";\n\t}\n\tif (resolvedPath.includes(\"/npm/\") || resolvedPath.includes(\"/node_modules/\")) {\n\t\treturn \"npm\";\n\t}\n\n\treturn \"unknown\";\n}\n\nfunction getInferredNpmInstall(): { root: string; prefix: string } | undefined {\n\tconst packageDir = getPackageDir();\n\tconst path = process.platform === \"win32\" || packageDir.includes(\"\\\\\") ? win32 : { basename, dirname };\n\tconst parent = path.dirname(packageDir);\n\tlet root: string | undefined;\n\tif (path.basename(parent).startsWith(\"@\") && path.basename(path.dirname(parent)) === \"node_modules\") {\n\t\troot = path.dirname(parent);\n\t} else if (path.basename(parent) === \"node_modules\") {\n\t\troot = parent;\n\t}\n\tif (!root) return undefined;\n\tconst rootParent = path.dirname(root);\n\tif (path.basename(rootParent) === \"lib\") return { root, prefix: path.dirname(rootParent) };\n\t// Windows global npm prefixes use `<prefix>\\\\node_modules`, which is\n\t// indistinguishable from local project installs by path shape alone. Do not\n\t// infer unsupported Windows custom prefixes without `npm root -g` evidence.\n\treturn undefined;\n}\n\nfunction getSelfUpdateCommandForMethod(\n\tmethod: InstallMethod,\n\tinstalledPackageName: string,\n\tupdatePackageTarget: SelfUpdatePackageTarget = installedPackageName,\n\tnpmCommand?: string[],\n): SelfUpdateCommand | undefined {\n\tconst target = normalizeSelfUpdatePackageTarget(updatePackageTarget);\n\tswitch (method) {\n\t\tcase \"bun-binary\":\n\t\t\treturn undefined;\n\t\tcase \"pnpm\": {\n\t\t\tconst match = readCommandOutput(\"pnpm\", [\"root\", \"-g\"])\n\t\t\t\t? undefined\n\t\t\t\t: /^(.*[\\\\/]global[\\\\/][^\\\\/]+)[\\\\/]\\.pnpm[\\\\/]/.exec(getPackageDir());\n\t\t\tconst binDirArgs = match\n\t\t\t\t? [`--config.global-bin-dir=${process.env.PNPM_HOME || dirname(dirname(match[1]))}`]\n\t\t\t\t: [];\n\t\t\treturn makeSelfUpdateCommand(\n\t\t\t\tmakeSelfUpdateCommandStep(\"pnpm\", [\n\t\t\t\t\t\"install\",\n\t\t\t\t\t\"-g\",\n\t\t\t\t\t\"--ignore-scripts\",\n\t\t\t\t\t\"--config.minimumReleaseAge=0\",\n\t\t\t\t\t...binDirArgs,\n\t\t\t\t\ttarget.installSpec,\n\t\t\t\t]),\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(\"pnpm\", [\"remove\", \"-g\", ...binDirArgs, installedPackageName]),\n\t\t\t);\n\t\t}\n\t\tcase \"yarn\":\n\t\t\treturn makeSelfUpdateCommand(\n\t\t\t\tmakeSelfUpdateCommandStep(\"yarn\", [\"global\", \"add\", \"--ignore-scripts\", target.installSpec]),\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(\"yarn\", [\"global\", \"remove\", installedPackageName]),\n\t\t\t);\n\t\tcase \"bun\": {\n\t\t\tconst binDir = readCommandOutput(\"bun\", [\"pm\", \"bin\", \"-g\"]);\n\t\t\tif (!binDir) return undefined;\n\t\t\treturn makeSelfUpdateCommand(\n\t\t\t\tmakeSelfUpdateCommandStep(\"bun\", [\n\t\t\t\t\t\"install\",\n\t\t\t\t\t\"-g\",\n\t\t\t\t\t\"--ignore-scripts\",\n\t\t\t\t\t\"--minimum-release-age=0\",\n\t\t\t\t\ttarget.installSpec,\n\t\t\t\t]),\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(\"bun\", [\"uninstall\", \"-g\", installedPackageName]),\n\t\t\t\tprocess.platform === \"win32\"\n\t\t\t\t\t? undefined\n\t\t\t\t\t: createBunLauncherRepairCommand(binDir, target.packageName, APP_NAME),\n\t\t\t);\n\t\t}\n\t\tcase \"npm\": {\n\t\t\tconst [command = \"npm\", ...npmArgs] = npmCommand ?? [];\n\t\t\tconst inferred = npmCommand?.length ? undefined : getInferredNpmInstall();\n\t\t\tconst prefixArgs = [...npmArgs, ...(inferred ? [\"--prefix\", inferred.prefix] : [])];\n\t\t\tconst installStep = makeSelfUpdateCommandStep(command, [\n\t\t\t\t...prefixArgs,\n\t\t\t\t\"install\",\n\t\t\t\t\"-g\",\n\t\t\t\t\"--ignore-scripts\",\n\t\t\t\t\"--min-release-age=0\",\n\t\t\t\ttarget.installSpec,\n\t\t\t]);\n\t\t\tconst uninstallStep =\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(command, [...prefixArgs, \"uninstall\", \"-g\", installedPackageName]);\n\t\t\treturn makeSelfUpdateCommand(installStep, uninstallStep);\n\t\t}\n\t\tcase \"unknown\":\n\t\t\treturn undefined;\n\t}\n}\n\nfunction readCommandOutput(\n\tcommand: string,\n\targs: string[],\n\toptions: { requireSuccess?: boolean } = {},\n): string | undefined {\n\tconst result = spawnProcessSync(command, args, {\n\t\tencoding: \"utf-8\",\n\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t});\n\tif (result.status === 0) return result.stdout.trim() || undefined;\n\tif (options.requireSuccess) {\n\t\tconst reason = result.error?.message || result.stderr.trim() || `exit code ${result.status ?? \"unknown\"}`;\n\t\tthrow new Error(`Failed to run ${[command, ...args].join(\" \")}: ${reason}`);\n\t}\n\treturn undefined;\n}\n\nfunction getGlobalPackageRoots(method: InstallMethod, _packageName: string, npmCommand?: string[]): string[] {\n\tswitch (method) {\n\t\tcase \"npm\": {\n\t\t\tconst configured = !!npmCommand?.length;\n\t\t\tconst [command = \"npm\", ...npmArgs] = npmCommand ?? [];\n\t\t\tif (configured && command === \"bun\") {\n\t\t\t\tconst bunBin = readCommandOutput(command, [...npmArgs, \"pm\", \"bin\", \"-g\"], {\n\t\t\t\t\trequireSuccess: true,\n\t\t\t\t});\n\t\t\t\tconst roots = [join(homedir(), \".bun\", \"install\", \"global\", \"node_modules\")];\n\t\t\t\tif (bunBin) {\n\t\t\t\t\troots.push(join(dirname(bunBin), \"install\", \"global\", \"node_modules\"));\n\t\t\t\t}\n\t\t\t\treturn roots;\n\t\t\t}\n\t\t\tconst root = readCommandOutput(command, [...npmArgs, \"root\", \"-g\"], {\n\t\t\t\trequireSuccess: configured,\n\t\t\t});\n\t\t\tconst inferred = configured ? undefined : getInferredNpmInstall();\n\t\t\treturn [root, inferred?.root].filter((x): x is string => !!x);\n\t\t}\n\t\tcase \"pnpm\": {\n\t\t\tconst root = readCommandOutput(\"pnpm\", [\"root\", \"-g\"]);\n\t\t\tif (root) return [root, dirname(root)];\n\t\t\tconst match = /^(.*[\\\\/]global[\\\\/][^\\\\/]+)[\\\\/]\\.pnpm[\\\\/]/.exec(getPackageDir());\n\t\t\treturn match ? [match[1]] : [];\n\t\t}\n\t\tcase \"yarn\": {\n\t\t\tconst dir = readCommandOutput(\"yarn\", [\"global\", \"dir\"]);\n\t\t\treturn dir ? [dir, join(dir, \"node_modules\")] : [];\n\t\t}\n\t\tcase \"bun\": {\n\t\t\tconst bunBin = readCommandOutput(\"bun\", [\"pm\", \"bin\", \"-g\"]);\n\t\t\tconst roots = [join(homedir(), \".bun\", \"install\", \"global\", \"node_modules\")];\n\t\t\tif (bunBin) {\n\t\t\t\troots.push(join(dirname(bunBin), \"install\", \"global\", \"node_modules\"));\n\t\t\t}\n\t\t\treturn roots;\n\t\t}\n\t\tcase \"bun-binary\":\n\t\tcase \"unknown\":\n\t\t\treturn [];\n\t}\n}\n\nfunction normalizeExistingPathForComparison(path: string, resolveSymlinks: boolean): string | undefined {\n\tconst resolvedPath = resolve(path);\n\tif (!existsSync(resolvedPath)) {\n\t\treturn undefined;\n\t}\n\tlet normalizedPath = resolvedPath;\n\tif (resolveSymlinks) {\n\t\ttry {\n\t\t\tnormalizedPath = realpathSync(resolvedPath);\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\tif (process.platform === \"win32\") {\n\t\tnormalizedPath = normalizedPath.toLowerCase();\n\t}\n\treturn normalizedPath;\n}\n\nfunction getPathComparisonCandidates(path: string): string[] {\n\treturn Array.from(\n\t\tnew Set(\n\t\t\t[normalizeExistingPathForComparison(path, false), normalizeExistingPathForComparison(path, true)].filter(\n\t\t\t\t(candidate): candidate is string => !!candidate,\n\t\t\t),\n\t\t),\n\t);\n}\n\nfunction getEntrypointPackageDir(): string | undefined {\n\tconst entrypoint = process.argv[1];\n\tif (!entrypoint) return undefined;\n\tlet dir = dirname(entrypoint);\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\"))) {\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn undefined;\n}\n\nfunction isSelfUpdatePathWritable(): boolean {\n\tconst packageDir = getPackageDir();\n\ttry {\n\t\taccessSync(packageDir, constants.W_OK);\n\t\taccessSync(dirname(packageDir), constants.W_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isManagedByGlobalPackageManager(method: InstallMethod, packageName: string, npmCommand?: string[]): boolean {\n\tconst packageDirs = [getPackageDir(), getEntrypointPackageDir()].filter((dir): dir is string => !!dir);\n\tconst packageDirCandidates = packageDirs.flatMap((dir) => getPathComparisonCandidates(dir));\n\treturn getGlobalPackageRoots(method, packageName, npmCommand).some((root) => {\n\t\treturn getPathComparisonCandidates(root).some((normalizedRoot) => {\n\t\t\tconst rootPrefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\t\treturn packageDirCandidates.some((packageDir) => packageDir.startsWith(rootPrefix));\n\t\t});\n\t});\n}\n\nexport function getSelfUpdateCommand(\n\tpackageName: string,\n\tnpmCommand?: string[],\n\tupdatePackageTarget: SelfUpdatePackageTarget = packageName,\n): SelfUpdateCommand | undefined {\n\tconst method = detectInstallMethod();\n\tconst command = getSelfUpdateCommandForMethod(method, packageName, updatePackageTarget, npmCommand);\n\tif (!command || !isManagedByGlobalPackageManager(method, packageName, npmCommand) || !isSelfUpdatePathWritable()) {\n\t\treturn undefined;\n\t}\n\treturn command;\n}\n\nexport function getSelfUpdateUnavailableInstruction(\n\tpackageName: string,\n\tnpmCommand?: string[],\n\tupdatePackageTarget: SelfUpdatePackageTarget = packageName,\n): string {\n\tconst method = detectInstallMethod();\n\tconst target = normalizeSelfUpdatePackageTarget(updatePackageTarget);\n\tif (method === \"bun-binary\") {\n\t\treturn `Download from: https://github.com/code-yeongyu/senpi/releases/latest`;\n\t}\n\tconst command = getSelfUpdateCommandForMethod(method, packageName, target, npmCommand);\n\tif (command) {\n\t\tif (isManagedByGlobalPackageManager(method, packageName, npmCommand) && !isSelfUpdatePathWritable()) {\n\t\t\treturn `This installation is managed by a global ${method} install, but the install path is not writable. Update it yourself with: ${command.display}`;\n\t\t}\n\t\treturn `This installation is not managed by a global ${method} install. Update it with the package manager, wrapper, or source checkout that provides it.`;\n\t}\n\treturn `Update ${target.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`;\n}\n\nexport function getUpdateInstruction(packageName: string): string {\n\tconst method = detectInstallMethod();\n\tconst command = getSelfUpdateCommandForMethod(method, packageName);\n\tif (command) {\n\t\treturn `Run: ${command.display}`;\n\t}\n\treturn getSelfUpdateUnavailableInstruction(packageName);\n}\n\n// =============================================================================\n// Package Asset Paths (shipped with executable)\n// =============================================================================\n\n/**\n * Get the base directory for resolving package assets (themes, package.json, README.md, CHANGELOG.md).\n * - For Bun binary: returns the directory containing the executable\n * - For Node.js and tsx: returns the package root containing package.json\n * - Ignores Bun binary metadata copied into dist/ when the package root is available\n */\nexport function findNodePackageDir(startDir: string): string {\n\tlet dir = startDir;\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\"))) {\n\t\t\tconst parent = dirname(dir);\n\t\t\t// build:binary places Bun's metadata inside dist/. Node still needs the\n\t\t\t// package root so its dist-relative asset paths do not become dist/dist/.\n\t\t\tif (basename(dir) === \"dist\" && existsSync(join(parent, \"package.json\"))) {\n\t\t\t\treturn parent;\n\t\t\t}\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn startDir;\n}\n\nexport function getPackageDir(): string {\n\t// Allow override via environment variable (useful for Nix/Guix where store paths tokenize poorly)\n\tconst envDir = envValue(\"PACKAGE_DIR\");\n\tif (envDir) {\n\t\treturn normalizePath(envDir);\n\t}\n\n\tif (isBunBinary) {\n\t\t// Bun binary: process.execPath points to the compiled executable\n\t\treturn dirname(process.execPath);\n\t}\n\treturn findNodePackageDir(__dirname);\n}\n\n/** One asset directory shipped with the package, in both the Bun-binary and Node layouts. */\ninterface ShippedAsset {\n\t/** Directory name next to a compiled Bun binary. */\n\treadonly binaryDir: string;\n\t/** Path segments under the package's src/ or dist/ root. */\n\treadonly sourceSegments: readonly string[];\n\t/** A file the directory must contain; a root without it does not ship this asset. */\n\treadonly probe: string;\n}\n\nconst THEMES_ASSET: ShippedAsset = {\n\tbinaryDir: \"theme\",\n\tsourceSegments: [\"modes\", \"interactive\", \"theme\"],\n\tprobe: \"dark.json\",\n};\n\nconst EXPORT_TEMPLATE_ASSET: ShippedAsset = {\n\tbinaryDir: \"export-html\",\n\tsourceSegments: [\"core\", \"export-html\"],\n\tprobe: \"template.html\",\n};\n\nconst INTERACTIVE_ASSETS: ShippedAsset = {\n\tbinaryDir: \"assets\",\n\tsourceSegments: [\"modes\", \"interactive\", \"assets\"],\n\tprobe: \"clankolas.png\",\n};\n\nfunction assetDirIn(root: string, asset: ShippedAsset): string {\n\tif (isBunBinary) {\n\t\treturn join(root, asset.binaryDir);\n\t}\n\tconst srcOrDist = existsSync(join(root, \"src\")) ? \"src\" : \"dist\";\n\treturn join(root, srcOrDist, ...asset.sourceSegments);\n}\n\n/**\n * Resolve a shipped asset directory, preferring PACKAGE_DIR but never trusting it blindly.\n *\n * PACKAGE_DIR relocates the package root (Nix/Guix store paths), and a Bun binary that embeds this\n * CLI pins it to the binary's own root. When such a root is inherited by a Node install of the CLI,\n * the Node layout resolves under it to a directory that cannot exist and startup dies on ENOENT\n * (an omo binary keeps its themes in a flat theme/, so the inherited root has no dist/ tree at all).\n * Fall back to the running install whenever the preferred root does not actually ship the asset. When\n * neither ships it the install is genuinely broken, and the running install's own path is returned so\n * the resulting error names the tree that was supposed to carry the asset rather than a foreign root.\n */\nfunction resolveShippedAssetDir(asset: ShippedAsset): string {\n\tconst preferred = assetDirIn(getPackageDir(), asset);\n\tif (existsSync(join(preferred, asset.probe))) {\n\t\treturn preferred;\n\t}\n\treturn assetDirIn(isBunBinary ? dirname(process.execPath) : findNodePackageDir(__dirname), asset);\n}\n\n/**\n * Get path to built-in themes directory (shipped with package)\n * - For Bun binary: theme/ next to executable\n * - For Node.js (dist/): dist/modes/interactive/theme/\n * - For tsx (src/): src/modes/interactive/theme/\n */\nexport function getThemesDir(): string {\n\treturn resolveShippedAssetDir(THEMES_ASSET);\n}\n\n/**\n * Get path to HTML export template directory (shipped with package)\n * - For Bun binary: export-html/ next to executable\n * - For Node.js (dist/): dist/core/export-html/\n * - For tsx (src/): src/core/export-html/\n */\nexport function getExportTemplateDir(): string {\n\treturn resolveShippedAssetDir(EXPORT_TEMPLATE_ASSET);\n}\n\n/** Get path to package.json */\nexport function getPackageJsonPath(): string {\n\treturn join(getPackageDir(), \"package.json\");\n}\n\n/** Get path to README.md */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n\n/** Get path to docs directory */\nexport function getDocsPath(): string {\n\treturn resolve(join(getPackageDir(), \"docs\"));\n}\n\n/** Get path to examples directory */\nexport function getExamplesPath(): string {\n\treturn resolve(join(getPackageDir(), \"examples\"));\n}\n\n/** Get path to CHANGELOG.md */\nexport function getChangelogPath(): string {\n\treturn resolve(join(getPackageDir(), \"CHANGELOG.md\"));\n}\n\n/**\n * Get path to built-in interactive assets directory.\n * - For Bun binary: assets/ next to executable\n * - For Node.js (dist/): dist/modes/interactive/assets/\n * - For tsx (src/): src/modes/interactive/assets/\n */\nexport function getInteractiveAssetsDir(): string {\n\treturn resolveShippedAssetDir(INTERACTIVE_ASSETS);\n}\n\n/** Get path to a bundled interactive asset */\nexport function getBundledInteractiveAssetPath(name: string): string {\n\treturn join(getInteractiveAssetsDir(), name);\n}\n\n// =============================================================================\n// App Config (from package.json piConfig)\n// =============================================================================\n\ninterface PackageJson {\n\tname?: string;\n\tversion?: string;\n\tpiConfig?: {\n\t\tname?: string;\n\t\tconfigDir?: string;\n\t};\n}\n\nlet pkg: PackageJson = {};\ntry {\n\tpkg = JSON.parse(stripBom(readFileSync(getPackageJsonPath(), \"utf-8\"))) as PackageJson;\n} catch (e: unknown) {\n\tconst err = e as NodeJS.ErrnoException;\n\tif (err.code !== \"ENOENT\") throw e;\n}\n\nconst piConfigName: string | undefined = pkg.piConfig?.name;\n\n/**\n * A distribution repackaging this engine injects its brand once. The profile is consumed\n * here - which also scrubs the variable - so every process spawned later inherits a clean\n * environment and keeps the engine's own identity.\n */\nexport const BRAND: BrandProfile | undefined = brandProfile();\n\nexport const PACKAGE_NAME: string = pkg.name || \"@earendil-works/pi-coding-agent\";\nexport const APP_NAME: string = BRAND?.name || piConfigName || \"pi\";\n/** Command-line name; brands whose binary differs from their display name set this. */\nexport const APP_COMMAND: string = BRAND?.command ?? APP_NAME;\nexport const APP_TITLE: string = BRAND?.name || (piConfigName ? APP_NAME : \"π\");\nexport const CONFIG_DIR_NAME: string = BRAND?.configDir || pkg.piConfig?.configDir || \".pi\";\n/** True when the brand stores agent state directly under the config dir, with no `agent` segment. */\nexport const CONFIG_FLAT_LAYOUT: boolean = BRAND?.flatLayout === true;\nexport const VERSION: string = pkg.version || \"0.0.0\";\n/** Version shown to users; VERSION stays the engine version used for update comparisons. */\nexport const DISPLAY_VERSION: string = BRAND?.displayVersion || VERSION;\n\n// e.g., PI_CODING_AGENT_DIR or TAU_CODING_AGENT_DIR\n/** Primary environment prefix for this product; legacy prefixes stay readable. */\nexport const ENV_PREFIX: string = BRAND?.envPrefix || APP_NAME.toUpperCase();\nexport const ENV_AGENT_DIR = `${ENV_PREFIX}_CODING_AGENT_DIR`;\nexport const ENV_SESSION_DIR = `${ENV_PREFIX}_CODING_AGENT_SESSION_DIR`;\n\nexport function expandTildePath(path: string): string {\n\treturn normalizePath(path);\n}\n\nconst DEFAULT_SHARE_VIEWER_URL = \"https://pi.dev/session/\";\n\n/** Get the share viewer URL for a gist ID. */\nexport function getShareViewerUrl(gistId: string): string {\n\tconst baseUrl = envValue(\"SHARE_VIEWER_URL\") || DEFAULT_SHARE_VIEWER_URL;\n\treturn `${baseUrl}#${gistId}`;\n}\n\n// =============================================================================\n// User Config Paths (~/.senpi/agent/*)\n// =============================================================================\n\n/** Marker file that identifies a flat-layout config directory. */\nexport const FLAT_LAYOUT_SENTINEL = \"settings.json\";\n\n/**\n * Resolve the agent config directory from an explicit environment.\n *\n * A flat-layout brand keeps its state directly under the config directory, so it looks for\n * the settings file as proof rather than for an `agent` subdirectory - the config directory\n * name may also be used by unrelated project tooling.\n */\nexport function resolveAgentDir(cwd: string, homeDir: string, envDir?: string): string {\n\tif (envDir) {\n\t\treturn normalizePath(envDir, { homeDir });\n\t}\n\tif (CONFIG_FLAT_LAYOUT) {\n\t\tconst flatProjectDir = findNearestParentConfigDir(cwd, homeDir, CONFIG_DIR_NAME, undefined, FLAT_LAYOUT_SENTINEL);\n\t\treturn flatProjectDir ?? join(homeDir, CONFIG_DIR_NAME);\n\t}\n\tconst projectConfigDir = findNearestParentConfigDir(cwd, homeDir, CONFIG_DIR_NAME, \"agent\");\n\treturn projectConfigDir ? join(projectConfigDir, \"agent\") : join(homeDir, CONFIG_DIR_NAME, \"agent\");\n}\n\n/** Get the agent config directory (e.g., ~/.senpi/agent/) */\nexport function getAgentDir(): string {\n\treturn resolveAgentDir(process.cwd(), homedir(), envValue(\"CODING_AGENT_DIR\"));\n}\n\n/**\n * Short, display-only spelling of the agent directory for help text and tips, e.g.\n * `~/.omo` for a flat brand or `~/.senpi/agent` for the engine layout.\n */\nexport function agentDirLabel(): string {\n\treturn CONFIG_FLAT_LAYOUT ? `~/${CONFIG_DIR_NAME}` : `~/${CONFIG_DIR_NAME}/agent`;\n}\n\n/** Get path to user's custom themes directory */\nexport function getCustomThemesDir(): string {\n\treturn join(getAgentDir(), \"themes\");\n}\n\n/** Get path to models.json */\nexport function getModelsPath(): string {\n\treturn join(getAgentDir(), \"models.json\");\n}\n\n/** Get path to auth.json */\nexport function getAuthPath(): string {\n\treturn join(getAgentDir(), \"auth.json\");\n}\n\n/** Get path to settings.json */\nexport function getSettingsPath(): string {\n\treturn join(getAgentDir(), \"settings.json\");\n}\n\n/** Get path to tools directory */\nexport function getToolsDir(): string {\n\treturn join(getAgentDir(), \"tools\");\n}\n\n/** Get path to managed binaries directory (fd, rg) */\nexport function getBinDir(): string {\n\treturn join(getAgentDir(), \"bin\");\n}\n\n/** Get path to prompt templates directory */\nexport function getPromptsDir(): string {\n\treturn join(getAgentDir(), \"prompts\");\n}\n\n/** Get path to sessions directory */\nexport function getSessionsDir(): string {\n\treturn join(getAgentDir(), \"sessions\");\n}\n\n/** Get path to debug log file */\nexport function getDebugLogPath(): string {\n\treturn join(getAgentDir(), `${APP_NAME}-debug.log`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,8BA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","sourcesContent":["import { accessSync, constants, existsSync, readFileSync, realpathSync } from \"fs\";\nimport { homedir } from \"os\";\nimport { basename, dirname, join, resolve, sep, win32 } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { createBunLauncherRepairCommand } from \"./bun-global-launcher.ts\";\nimport { type BrandProfile, brandProfile, envValue } from \"./core/brand.ts\";\nimport { findNearestParentConfigDir } from \"./nearest-parent-config.ts\";\nimport { spawnProcessSync } from \"./utils/child-process.ts\";\nimport { normalizePath } from \"./utils/paths.ts\";\nimport { stripBom } from \"./utils/text.ts\";\n\n// =============================================================================\n// Package Detection\n// =============================================================================\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Detect if we're running as a Bun compiled binary.\n * Bun binaries have import.meta.url containing \"$bunfs\", \"~BUN\", or \"%7EBUN\" (Bun's virtual filesystem path)\n */\nexport const isBunBinary =\n\timport.meta.url.includes(\"$bunfs\") || import.meta.url.includes(\"~BUN\") || import.meta.url.includes(\"%7EBUN\");\n\n/** Detect if Bun is the runtime (compiled binary or bun run) */\nexport const isBunRuntime = !!process.versions.bun;\n\n/** Detect the esbuild-bundled Node.js distribution. */\ndeclare const PI_BUNDLED_NODE: boolean;\nexport const isBundledNode = typeof PI_BUNDLED_NODE !== \"undefined\" && PI_BUNDLED_NODE;\n\n// =============================================================================\n// Install Method Detection\n// =============================================================================\n\nexport type InstallMethod = \"bun-binary\" | \"npm\" | \"pnpm\" | \"yarn\" | \"bun\" | \"unknown\";\n\ninterface SelfUpdateCommandStep {\n\tcommand: string;\n\targs: string[];\n\tdisplay: string;\n}\n\nexport interface SelfUpdateCommand extends SelfUpdateCommandStep {\n\tsteps?: SelfUpdateCommandStep[];\n}\n\nexport type SelfUpdatePackageTarget = string | { packageName: string; installSpec?: string };\n\nfunction normalizeSelfUpdatePackageTarget(target: SelfUpdatePackageTarget): {\n\tpackageName: string;\n\tinstallSpec: string;\n} {\n\tif (typeof target === \"string\") {\n\t\treturn { packageName: target, installSpec: target };\n\t}\n\treturn { packageName: target.packageName, installSpec: target.installSpec ?? target.packageName };\n}\n\nfunction makeSelfUpdateCommand(\n\tinstallStep: SelfUpdateCommandStep,\n\tuninstallStep?: SelfUpdateCommandStep,\n\tpostInstallStep?: SelfUpdateCommandStep,\n): SelfUpdateCommand {\n\tconst steps = [\n\t\t...(uninstallStep ? [uninstallStep] : []),\n\t\tinstallStep,\n\t\t...(postInstallStep ? [postInstallStep] : []),\n\t];\n\tif (steps.length === 1) return installStep;\n\treturn {\n\t\t...installStep,\n\t\tdisplay: steps.map((step) => step.display).join(\" && \"),\n\t\tsteps,\n\t};\n}\n\nfunction makeSelfUpdateCommandStep(command: string, args: string[]): SelfUpdateCommandStep {\n\treturn {\n\t\tcommand,\n\t\targs,\n\t\tdisplay: [command, ...args].map((arg) => (/\\s/.test(arg) ? `\"${arg}\"` : arg)).join(\" \"),\n\t};\n}\n\nexport function detectInstallMethod(): InstallMethod {\n\tif (isBunBinary) {\n\t\treturn \"bun-binary\";\n\t}\n\n\tconst resolvedPath = `${__dirname}\\0${process.execPath || \"\"}`.toLowerCase().replace(/\\\\/g, \"/\");\n\n\tif (resolvedPath.includes(\"/pnpm/\") || resolvedPath.includes(\"/.pnpm/\")) {\n\t\treturn \"pnpm\";\n\t}\n\tif (resolvedPath.includes(\"/yarn/\") || resolvedPath.includes(\"/.yarn/\")) {\n\t\treturn \"yarn\";\n\t}\n\tif (isBunRuntime || resolvedPath.includes(\"/install/global/node_modules/\")) {\n\t\treturn \"bun\";\n\t}\n\tif (resolvedPath.includes(\"/npm/\") || resolvedPath.includes(\"/node_modules/\")) {\n\t\treturn \"npm\";\n\t}\n\n\treturn \"unknown\";\n}\n\nfunction getInferredNpmInstall(): { root: string; prefix: string } | undefined {\n\tconst packageDir = getPackageDir();\n\tconst path = process.platform === \"win32\" || packageDir.includes(\"\\\\\") ? win32 : { basename, dirname };\n\tconst parent = path.dirname(packageDir);\n\tlet root: string | undefined;\n\tif (path.basename(parent).startsWith(\"@\") && path.basename(path.dirname(parent)) === \"node_modules\") {\n\t\troot = path.dirname(parent);\n\t} else if (path.basename(parent) === \"node_modules\") {\n\t\troot = parent;\n\t}\n\tif (!root) return undefined;\n\tconst rootParent = path.dirname(root);\n\tif (path.basename(rootParent) === \"lib\") return { root, prefix: path.dirname(rootParent) };\n\t// Windows global npm prefixes use `<prefix>\\\\node_modules`, which is\n\t// indistinguishable from local project installs by path shape alone. Do not\n\t// infer unsupported Windows custom prefixes without `npm root -g` evidence.\n\treturn undefined;\n}\n\nfunction getSelfUpdateCommandForMethod(\n\tmethod: InstallMethod,\n\tinstalledPackageName: string,\n\tupdatePackageTarget: SelfUpdatePackageTarget = installedPackageName,\n\tnpmCommand?: string[],\n): SelfUpdateCommand | undefined {\n\tconst target = normalizeSelfUpdatePackageTarget(updatePackageTarget);\n\tswitch (method) {\n\t\tcase \"bun-binary\":\n\t\t\treturn undefined;\n\t\tcase \"pnpm\": {\n\t\t\tconst match = readCommandOutput(\"pnpm\", [\"root\", \"-g\"])\n\t\t\t\t? undefined\n\t\t\t\t: /^(.*[\\\\/]global[\\\\/][^\\\\/]+)[\\\\/]\\.pnpm[\\\\/]/.exec(getPackageDir());\n\t\t\tconst binDirArgs = match\n\t\t\t\t? [`--config.global-bin-dir=${process.env.PNPM_HOME || dirname(dirname(match[1]))}`]\n\t\t\t\t: [];\n\t\t\treturn makeSelfUpdateCommand(\n\t\t\t\tmakeSelfUpdateCommandStep(\"pnpm\", [\n\t\t\t\t\t\"install\",\n\t\t\t\t\t\"-g\",\n\t\t\t\t\t\"--ignore-scripts\",\n\t\t\t\t\t\"--config.minimumReleaseAge=0\",\n\t\t\t\t\t...binDirArgs,\n\t\t\t\t\ttarget.installSpec,\n\t\t\t\t]),\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(\"pnpm\", [\"remove\", \"-g\", ...binDirArgs, installedPackageName]),\n\t\t\t);\n\t\t}\n\t\tcase \"yarn\":\n\t\t\treturn makeSelfUpdateCommand(\n\t\t\t\tmakeSelfUpdateCommandStep(\"yarn\", [\"global\", \"add\", \"--ignore-scripts\", target.installSpec]),\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(\"yarn\", [\"global\", \"remove\", installedPackageName]),\n\t\t\t);\n\t\tcase \"bun\": {\n\t\t\tconst binDir = readCommandOutput(\"bun\", [\"pm\", \"bin\", \"-g\"]);\n\t\t\tif (!binDir) return undefined;\n\t\t\treturn makeSelfUpdateCommand(\n\t\t\t\tmakeSelfUpdateCommandStep(\"bun\", [\n\t\t\t\t\t\"install\",\n\t\t\t\t\t\"-g\",\n\t\t\t\t\t\"--ignore-scripts\",\n\t\t\t\t\t\"--minimum-release-age=0\",\n\t\t\t\t\ttarget.installSpec,\n\t\t\t\t]),\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(\"bun\", [\"uninstall\", \"-g\", installedPackageName]),\n\t\t\t\tprocess.platform === \"win32\"\n\t\t\t\t\t? undefined\n\t\t\t\t\t: createBunLauncherRepairCommand(binDir, target.packageName, APP_NAME),\n\t\t\t);\n\t\t}\n\t\tcase \"npm\": {\n\t\t\tconst [command = \"npm\", ...npmArgs] = npmCommand ?? [];\n\t\t\tconst inferred = npmCommand?.length ? undefined : getInferredNpmInstall();\n\t\t\tconst prefixArgs = [...npmArgs, ...(inferred ? [\"--prefix\", inferred.prefix] : [])];\n\t\t\tconst installStep = makeSelfUpdateCommandStep(command, [\n\t\t\t\t...prefixArgs,\n\t\t\t\t\"install\",\n\t\t\t\t\"-g\",\n\t\t\t\t\"--ignore-scripts\",\n\t\t\t\t\"--min-release-age=0\",\n\t\t\t\ttarget.installSpec,\n\t\t\t]);\n\t\t\tconst uninstallStep =\n\t\t\t\ttarget.packageName === installedPackageName\n\t\t\t\t\t? undefined\n\t\t\t\t\t: makeSelfUpdateCommandStep(command, [...prefixArgs, \"uninstall\", \"-g\", installedPackageName]);\n\t\t\treturn makeSelfUpdateCommand(installStep, uninstallStep);\n\t\t}\n\t\tcase \"unknown\":\n\t\t\treturn undefined;\n\t}\n}\n\nfunction readCommandOutput(\n\tcommand: string,\n\targs: string[],\n\toptions: { requireSuccess?: boolean } = {},\n): string | undefined {\n\tconst result = spawnProcessSync(command, args, {\n\t\tencoding: \"utf-8\",\n\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t});\n\tif (result.status === 0) return result.stdout.trim() || undefined;\n\tif (options.requireSuccess) {\n\t\tconst reason = result.error?.message || result.stderr.trim() || `exit code ${result.status ?? \"unknown\"}`;\n\t\tthrow new Error(`Failed to run ${[command, ...args].join(\" \")}: ${reason}`);\n\t}\n\treturn undefined;\n}\n\nfunction getGlobalPackageRoots(method: InstallMethod, _packageName: string, npmCommand?: string[]): string[] {\n\tswitch (method) {\n\t\tcase \"npm\": {\n\t\t\tconst configured = !!npmCommand?.length;\n\t\t\tconst [command = \"npm\", ...npmArgs] = npmCommand ?? [];\n\t\t\tif (configured && command === \"bun\") {\n\t\t\t\tconst bunBin = readCommandOutput(command, [...npmArgs, \"pm\", \"bin\", \"-g\"], {\n\t\t\t\t\trequireSuccess: true,\n\t\t\t\t});\n\t\t\t\tconst roots = [join(homedir(), \".bun\", \"install\", \"global\", \"node_modules\")];\n\t\t\t\tif (bunBin) {\n\t\t\t\t\troots.push(join(dirname(bunBin), \"install\", \"global\", \"node_modules\"));\n\t\t\t\t}\n\t\t\t\treturn roots;\n\t\t\t}\n\t\t\tconst root = readCommandOutput(command, [...npmArgs, \"root\", \"-g\"], {\n\t\t\t\trequireSuccess: configured,\n\t\t\t});\n\t\t\tconst inferred = configured ? undefined : getInferredNpmInstall();\n\t\t\treturn [root, inferred?.root].filter((x): x is string => !!x);\n\t\t}\n\t\tcase \"pnpm\": {\n\t\t\tconst root = readCommandOutput(\"pnpm\", [\"root\", \"-g\"]);\n\t\t\tif (root) return [root, dirname(root)];\n\t\t\tconst match = /^(.*[\\\\/]global[\\\\/][^\\\\/]+)[\\\\/]\\.pnpm[\\\\/]/.exec(getPackageDir());\n\t\t\treturn match ? [match[1]] : [];\n\t\t}\n\t\tcase \"yarn\": {\n\t\t\tconst dir = readCommandOutput(\"yarn\", [\"global\", \"dir\"]);\n\t\t\treturn dir ? [dir, join(dir, \"node_modules\")] : [];\n\t\t}\n\t\tcase \"bun\": {\n\t\t\tconst bunBin = readCommandOutput(\"bun\", [\"pm\", \"bin\", \"-g\"]);\n\t\t\tconst roots = [join(homedir(), \".bun\", \"install\", \"global\", \"node_modules\")];\n\t\t\tif (bunBin) {\n\t\t\t\troots.push(join(dirname(bunBin), \"install\", \"global\", \"node_modules\"));\n\t\t\t}\n\t\t\treturn roots;\n\t\t}\n\t\tcase \"bun-binary\":\n\t\tcase \"unknown\":\n\t\t\treturn [];\n\t}\n}\n\nfunction normalizeExistingPathForComparison(path: string, resolveSymlinks: boolean): string | undefined {\n\tconst resolvedPath = resolve(path);\n\tif (!existsSync(resolvedPath)) {\n\t\treturn undefined;\n\t}\n\tlet normalizedPath = resolvedPath;\n\tif (resolveSymlinks) {\n\t\ttry {\n\t\t\tnormalizedPath = realpathSync(resolvedPath);\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\tif (process.platform === \"win32\") {\n\t\tnormalizedPath = normalizedPath.toLowerCase();\n\t}\n\treturn normalizedPath;\n}\n\nfunction getPathComparisonCandidates(path: string): string[] {\n\treturn Array.from(\n\t\tnew Set(\n\t\t\t[normalizeExistingPathForComparison(path, false), normalizeExistingPathForComparison(path, true)].filter(\n\t\t\t\t(candidate): candidate is string => !!candidate,\n\t\t\t),\n\t\t),\n\t);\n}\n\nfunction getEntrypointPackageDir(): string | undefined {\n\tconst entrypoint = process.argv[1];\n\tif (!entrypoint) return undefined;\n\tlet dir = dirname(entrypoint);\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\"))) {\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn undefined;\n}\n\nfunction isSelfUpdatePathWritable(): boolean {\n\tconst packageDir = getPackageDir();\n\ttry {\n\t\taccessSync(packageDir, constants.W_OK);\n\t\taccessSync(dirname(packageDir), constants.W_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction isManagedByGlobalPackageManager(method: InstallMethod, packageName: string, npmCommand?: string[]): boolean {\n\tconst packageDirs = [getPackageDir(), getEntrypointPackageDir()].filter((dir): dir is string => !!dir);\n\tconst packageDirCandidates = packageDirs.flatMap((dir) => getPathComparisonCandidates(dir));\n\treturn getGlobalPackageRoots(method, packageName, npmCommand).some((root) => {\n\t\treturn getPathComparisonCandidates(root).some((normalizedRoot) => {\n\t\t\tconst rootPrefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\t\treturn packageDirCandidates.some((packageDir) => packageDir.startsWith(rootPrefix));\n\t\t});\n\t});\n}\n\nexport function getSelfUpdateCommand(\n\tpackageName: string,\n\tnpmCommand?: string[],\n\tupdatePackageTarget: SelfUpdatePackageTarget = packageName,\n): SelfUpdateCommand | undefined {\n\tconst method = detectInstallMethod();\n\tconst command = getSelfUpdateCommandForMethod(method, packageName, updatePackageTarget, npmCommand);\n\tif (!command || !isManagedByGlobalPackageManager(method, packageName, npmCommand) || !isSelfUpdatePathWritable()) {\n\t\treturn undefined;\n\t}\n\treturn command;\n}\n\nexport function getSelfUpdateUnavailableInstruction(\n\tpackageName: string,\n\tnpmCommand?: string[],\n\tupdatePackageTarget: SelfUpdatePackageTarget = packageName,\n): string {\n\tconst method = detectInstallMethod();\n\tconst target = normalizeSelfUpdatePackageTarget(updatePackageTarget);\n\tif (method === \"bun-binary\") {\n\t\treturn `Download from: https://github.com/code-yeongyu/senpi/releases/latest`;\n\t}\n\tconst command = getSelfUpdateCommandForMethod(method, packageName, target, npmCommand);\n\tif (command) {\n\t\tif (isManagedByGlobalPackageManager(method, packageName, npmCommand) && !isSelfUpdatePathWritable()) {\n\t\t\treturn `This installation is managed by a global ${method} install, but the install path is not writable. Update it yourself with: ${command.display}`;\n\t\t}\n\t\treturn `This installation is not managed by a global ${method} install. Update it with the package manager, wrapper, or source checkout that provides it.`;\n\t}\n\treturn `Update ${target.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`;\n}\n\nexport function getUpdateInstruction(packageName: string): string {\n\tconst method = detectInstallMethod();\n\tconst command = getSelfUpdateCommandForMethod(method, packageName);\n\tif (command) {\n\t\treturn `Run: ${command.display}`;\n\t}\n\treturn getSelfUpdateUnavailableInstruction(packageName);\n}\n\n// =============================================================================\n// Package Asset Paths (shipped with executable)\n// =============================================================================\n\n/**\n * Get the base directory for resolving package assets (themes, package.json, README.md, CHANGELOG.md).\n * - For Bun binary: returns the directory containing the executable\n * - For Node.js and tsx: returns the package root containing package.json\n * - Ignores Bun binary metadata copied into dist/ when the package root is available\n */\nexport function findNodePackageDir(startDir: string): string {\n\tlet dir = startDir;\n\twhile (dir !== dirname(dir)) {\n\t\tif (existsSync(join(dir, \"package.json\"))) {\n\t\t\tconst parent = dirname(dir);\n\t\t\t// build:binary places Bun's metadata inside dist/. Node still needs the\n\t\t\t// package root so its dist-relative asset paths do not become dist/dist/.\n\t\t\tif (basename(dir) === \"dist\" && existsSync(join(parent, \"package.json\"))) {\n\t\t\t\treturn parent;\n\t\t\t}\n\t\t\treturn dir;\n\t\t}\n\t\tdir = dirname(dir);\n\t}\n\treturn startDir;\n}\n\nexport function getPackageDir(): string {\n\t// Allow override via environment variable (useful for Nix/Guix where store paths tokenize poorly)\n\tconst envDir = envValue(\"PACKAGE_DIR\");\n\tif (envDir) {\n\t\treturn normalizePath(envDir);\n\t}\n\n\tif (isBunBinary) {\n\t\t// Bun binary: process.execPath points to the compiled executable\n\t\treturn dirname(process.execPath);\n\t}\n\treturn findNodePackageDir(__dirname);\n}\n\n/** One asset directory shipped with the package, in both the Bun-binary and Node layouts. */\ninterface ShippedAsset {\n\t/** Directory name next to a compiled Bun binary. */\n\treadonly binaryDir: string;\n\t/** Path segments under the package's src/ or dist/ root. */\n\treadonly sourceSegments: readonly string[];\n\t/** A file the directory must contain; a root without it does not ship this asset. */\n\treadonly probe: string;\n}\n\nconst THEMES_ASSET: ShippedAsset = {\n\tbinaryDir: \"theme\",\n\tsourceSegments: [\"modes\", \"interactive\", \"theme\"],\n\tprobe: \"dark.json\",\n};\n\nconst EXPORT_TEMPLATE_ASSET: ShippedAsset = {\n\tbinaryDir: \"export-html\",\n\tsourceSegments: [\"core\", \"export-html\"],\n\tprobe: \"template.html\",\n};\n\nconst INTERACTIVE_ASSETS: ShippedAsset = {\n\tbinaryDir: \"assets\",\n\tsourceSegments: [\"modes\", \"interactive\", \"assets\"],\n\tprobe: \"clankolas.png\",\n};\n\nfunction assetDirIn(root: string, asset: ShippedAsset): string {\n\tif (isBunBinary) {\n\t\treturn join(root, asset.binaryDir);\n\t}\n\tconst srcOrDist = existsSync(join(root, \"src\")) ? \"src\" : \"dist\";\n\treturn join(root, srcOrDist, ...asset.sourceSegments);\n}\n\n/**\n * Resolve a shipped asset directory, preferring PACKAGE_DIR but never trusting it blindly.\n *\n * PACKAGE_DIR relocates the package root (Nix/Guix store paths), and a Bun binary that embeds this\n * CLI pins it to the binary's own root. When such a root is inherited by a Node install of the CLI,\n * the Node layout resolves under it to a directory that cannot exist and startup dies on ENOENT\n * (an omo binary keeps its themes in a flat theme/, so the inherited root has no dist/ tree at all).\n * Fall back to the running install whenever the preferred root does not actually ship the asset. When\n * neither ships it the install is genuinely broken, and the running install's own path is returned so\n * the resulting error names the tree that was supposed to carry the asset rather than a foreign root.\n */\nfunction resolveShippedAssetDir(asset: ShippedAsset): string {\n\tconst preferred = assetDirIn(getPackageDir(), asset);\n\tif (existsSync(join(preferred, asset.probe))) {\n\t\treturn preferred;\n\t}\n\treturn assetDirIn(isBunBinary ? dirname(process.execPath) : findNodePackageDir(__dirname), asset);\n}\n\n/**\n * Get path to built-in themes directory (shipped with package)\n * - For Bun binary: theme/ next to executable\n * - For Node.js (dist/): dist/modes/interactive/theme/\n * - For tsx (src/): src/modes/interactive/theme/\n */\nexport function getThemesDir(): string {\n\treturn resolveShippedAssetDir(THEMES_ASSET);\n}\n\n/**\n * Get path to HTML export template directory (shipped with package)\n * - For Bun binary: export-html/ next to executable\n * - For Node.js (dist/): dist/core/export-html/\n * - For tsx (src/): src/core/export-html/\n */\nexport function getExportTemplateDir(): string {\n\treturn resolveShippedAssetDir(EXPORT_TEMPLATE_ASSET);\n}\n\n/** Get path to package.json */\nexport function getPackageJsonPath(): string {\n\treturn join(getPackageDir(), \"package.json\");\n}\n\n/** Get path to README.md */\nexport function getReadmePath(): string {\n\treturn resolve(join(getPackageDir(), \"README.md\"));\n}\n\n/** Get path to docs directory */\nexport function getDocsPath(): string {\n\treturn resolve(join(getPackageDir(), \"docs\"));\n}\n\n/** Get path to examples directory */\nexport function getExamplesPath(): string {\n\treturn resolve(join(getPackageDir(), \"examples\"));\n}\n\n/** Get path to CHANGELOG.md */\nexport function getChangelogPath(): string {\n\treturn resolve(join(getPackageDir(), \"CHANGELOG.md\"));\n}\n\n/**\n * Get path to built-in interactive assets directory.\n * - For Bun binary: assets/ next to executable\n * - For Node.js (dist/): dist/modes/interactive/assets/\n * - For tsx (src/): src/modes/interactive/assets/\n */\nexport function getInteractiveAssetsDir(): string {\n\treturn resolveShippedAssetDir(INTERACTIVE_ASSETS);\n}\n\n/** Get path to a bundled interactive asset */\nexport function getBundledInteractiveAssetPath(name: string): string {\n\treturn join(getInteractiveAssetsDir(), name);\n}\n\n// =============================================================================\n// App Config (from package.json piConfig)\n// =============================================================================\n\ninterface PackageJson {\n\tname?: string;\n\tversion?: string;\n\tpiConfig?: {\n\t\tname?: string;\n\t\tconfigDir?: string;\n\t};\n}\n\nlet pkg: PackageJson = {};\ntry {\n\tpkg = JSON.parse(stripBom(readFileSync(getPackageJsonPath(), \"utf-8\"))) as PackageJson;\n} catch (e: unknown) {\n\tconst err = e as NodeJS.ErrnoException;\n\tif (err.code !== \"ENOENT\") throw e;\n}\n\nconst piConfigName: string | undefined = pkg.piConfig?.name;\n\n/**\n * A distribution repackaging this engine injects its brand once. The profile is consumed\n * here - which also scrubs the variable - so every process spawned later inherits a clean\n * environment and keeps the engine's own identity.\n */\nexport const BRAND: BrandProfile | undefined = brandProfile();\n\nexport const PACKAGE_NAME: string = pkg.name || \"@earendil-works/pi-coding-agent\";\nexport const APP_NAME: string = BRAND?.name || piConfigName || \"pi\";\n/** Command-line name; brands whose binary differs from their display name set this. */\nexport const APP_COMMAND: string = BRAND?.command ?? APP_NAME;\nexport const APP_TITLE: string = BRAND?.name || (piConfigName ? APP_NAME : \"π\");\nexport const CONFIG_DIR_NAME: string = BRAND?.configDir || pkg.piConfig?.configDir || \".pi\";\n/** True when the brand stores agent state directly under the config dir, with no `agent` segment. */\nexport const CONFIG_FLAT_LAYOUT: boolean = BRAND?.flatLayout === true;\nexport const VERSION: string = pkg.version || \"0.0.0\";\n/** Version shown to users; VERSION stays the engine version used for update comparisons. */\nexport const DISPLAY_VERSION: string = BRAND?.displayVersion || VERSION;\n\n// e.g., PI_CODING_AGENT_DIR or TAU_CODING_AGENT_DIR\n/** Primary environment prefix for this product; legacy prefixes stay readable. */\nexport const ENV_PREFIX: string = BRAND?.envPrefix || APP_NAME.toUpperCase();\nexport const ENV_AGENT_DIR = `${ENV_PREFIX}_CODING_AGENT_DIR`;\nexport const ENV_SESSION_DIR = `${ENV_PREFIX}_CODING_AGENT_SESSION_DIR`;\n\nexport function expandTildePath(path: string): string {\n\treturn normalizePath(path);\n}\n\nconst DEFAULT_SHARE_VIEWER_URL = \"https://pi.dev/session/\";\n\n/** Get the share viewer URL for a gist ID. */\nexport function getShareViewerUrl(gistId: string): string {\n\tconst baseUrl = envValue(\"SHARE_VIEWER_URL\") || DEFAULT_SHARE_VIEWER_URL;\n\treturn `${baseUrl}#${gistId}`;\n}\n\n// =============================================================================\n// User Config Paths (~/.senpi/agent/*)\n// =============================================================================\n\n/** Marker file that identifies a flat-layout config directory. */\nexport const FLAT_LAYOUT_SENTINEL = \"settings.json\";\n\n/**\n * Resolve the agent config directory from an explicit environment.\n *\n * A flat-layout brand keeps its state directly under the config directory, so it looks for\n * the settings file as proof rather than for an `agent` subdirectory - the config directory\n * name may also be used by unrelated project tooling.\n */\nexport function resolveAgentDir(cwd: string, homeDir: string, envDir?: string): string {\n\tif (envDir) {\n\t\treturn normalizePath(envDir, { homeDir });\n\t}\n\tif (CONFIG_FLAT_LAYOUT) {\n\t\tconst flatProjectDir = findNearestParentConfigDir(cwd, homeDir, CONFIG_DIR_NAME, undefined, FLAT_LAYOUT_SENTINEL);\n\t\treturn flatProjectDir ?? join(homeDir, CONFIG_DIR_NAME);\n\t}\n\tconst projectConfigDir = findNearestParentConfigDir(cwd, homeDir, CONFIG_DIR_NAME, \"agent\");\n\treturn projectConfigDir ? join(projectConfigDir, \"agent\") : join(homeDir, CONFIG_DIR_NAME, \"agent\");\n}\n\n/** Get the agent config directory (e.g., ~/.senpi/agent/) */\nexport function getAgentDir(): string {\n\treturn resolveAgentDir(process.cwd(), homedir(), envValue(\"CODING_AGENT_DIR\"));\n}\n\n/**\n * Short, display-only spelling of the agent directory for help text and tips, e.g.\n * `~/.omo` for a flat brand or `~/.senpi/agent` for the engine layout.\n */\nexport function agentDirLabel(): string {\n\treturn CONFIG_FLAT_LAYOUT ? `~/${CONFIG_DIR_NAME}` : `~/${CONFIG_DIR_NAME}/agent`;\n}\n\n/** Get path to user's custom themes directory */\nexport function getCustomThemesDir(): string {\n\treturn join(getAgentDir(), \"themes\");\n}\n\n/** Get path to models.json */\nexport function getModelsPath(): string {\n\treturn join(getAgentDir(), \"models.json\");\n}\n\n/** Get path to auth.json */\nexport function getAuthPath(): string {\n\treturn join(getAgentDir(), \"auth.json\");\n}\n\n/** Get path to settings.json */\nexport function getSettingsPath(): string {\n\treturn join(getAgentDir(), \"settings.json\");\n}\n\n/** Get path to tools directory */\nexport function getToolsDir(): string {\n\treturn join(getAgentDir(), \"tools\");\n}\n\n/** Get path to managed binaries directory (fd, rg) */\nexport function getBinDir(): string {\n\treturn join(getAgentDir(), \"bin\");\n}\n\n/** Get path to prompt templates directory */\nexport function getPromptsDir(): string {\n\treturn join(getAgentDir(), \"prompts\");\n}\n\n/** Get path to sessions directory */\nexport function getSessionsDir(): string {\n\treturn join(getAgentDir(), \"sessions\");\n}\n\n/** Get path to debug log file */\nexport function getDebugLogPath(): string {\n\treturn join(getAgentDir(), `${APP_NAME}-debug.log`);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-session-runtime.d.ts","sourceRoot":"","sources":["../../src/core/agent-session-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACvG,OAAO,KAAK,EACX,mBAAmB,EACnB,sBAAsB,EAEtB,iBAAiB,EACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;;;GAKG;AACH,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAChF,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,WAAW,EAAE,6BAA6B,EAAE,CAAC;CAC7C;AAED,iEAAiE;AACjE,MAAM,WAAW,yBAAyB;IACzC,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B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AAE,SAAS,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CA0FxD;IAED;;;;;;OAMG;IACG,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CA6C9F;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAO7B;CACD;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC9C,aAAa,EAAE,gCAAgC,EAC/C,OAAO,EAAE;IACR,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,aAAa,CAAC,EAAE,QAAQ,CAAC,yBAAyB,CAAC,CAAC;CACpD,GACC,OAAO,CAAC,mBAAmB,CAAC,CAW9B;AAED,OAAO,EACN,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,qCAAqC,EAC1C,KAAK,iCAAiC,EACtC,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { copyFileSync, existsSync, mkdirSync } from "node:fs";
|
|
2
|
-
import { basename, join, resolve } from "node:path";
|
|
1
|
+
import { constants, copyFileSync, existsSync, mkdirSync } from "node:fs";
|
|
2
|
+
import { basename, join, parse, resolve } from "node:path";
|
|
3
3
|
import { resolvePath } from "../utils/paths.js";
|
|
4
4
|
import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
5
5
|
import { assertSessionCwdExists } from "./session-cwd.js";
|
|
6
6
|
import { SessionManager } from "./session-manager.js";
|
|
7
|
-
import { reserveSessionWrite } from "./session-write-reservation.js";
|
|
7
|
+
import { reserveSessionWrite, unregisterSessionWriter } from "./session-write-reservation.js";
|
|
8
8
|
/**
|
|
9
9
|
* Thrown when /import references a JSONL file path that does not exist.
|
|
10
10
|
*/
|
|
@@ -116,7 +116,11 @@ export class AgentSessionRuntime {
|
|
|
116
116
|
targetSessionFile,
|
|
117
117
|
});
|
|
118
118
|
this.beforeSessionInvalidate?.();
|
|
119
|
+
const replaced = this.session.sessionManager;
|
|
119
120
|
this.session.dispose();
|
|
121
|
+
// Nothing writes to the replaced manager once its session is disposed, so the
|
|
122
|
+
// shared host may hand its session file to another worker.
|
|
123
|
+
unregisterSessionWriter(replaced);
|
|
120
124
|
}
|
|
121
125
|
async reportRemovedExtensions() {
|
|
122
126
|
const pending = this._removedOnReplacement;
|
|
@@ -291,15 +295,23 @@ export class AgentSessionRuntime {
|
|
|
291
295
|
if (!existsSync(sessionDir)) {
|
|
292
296
|
mkdirSync(sessionDir, { recursive: true });
|
|
293
297
|
}
|
|
294
|
-
|
|
298
|
+
let destinationPath = join(sessionDir, basename(resolvedPath));
|
|
299
|
+
const sourceAlreadyStored = resolve(destinationPath) === resolvedPath;
|
|
300
|
+
if (!sourceAlreadyStored) {
|
|
301
|
+
const { name, ext } = parse(destinationPath);
|
|
302
|
+
let suffix = 1;
|
|
303
|
+
while (existsSync(destinationPath)) {
|
|
304
|
+
destinationPath = join(sessionDir, `${name}-${suffix++}${ext}`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
295
307
|
const beforeResult = await this.emitBeforeSwitch("resume", destinationPath);
|
|
296
308
|
if (beforeResult.cancelled) {
|
|
297
309
|
return beforeResult;
|
|
298
310
|
}
|
|
299
311
|
const previousSessionFile = this.session.sessionFile;
|
|
300
312
|
reserveSessionWrite(destinationPath);
|
|
301
|
-
if (
|
|
302
|
-
copyFileSync(resolvedPath, destinationPath);
|
|
313
|
+
if (!sourceAlreadyStored) {
|
|
314
|
+
copyFileSync(resolvedPath, destinationPath, constants.COPYFILE_EXCL);
|
|
303
315
|
}
|
|
304
316
|
const sessionManager = SessionManager.open(destinationPath, sessionDir, cwdOverride);
|
|
305
317
|
assertSessionCwdExists(sessionManager, this.cwd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-session-runtime.js","sourceRoot":"","sources":["../../src/core/agent-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAqCrE;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAGxD,YAAY,QAAgB;QAC3B,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AAED,SAAS,sBAAsB,CAAC,OAAwD;IACvF,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,OAAO,OAAO;SACZ,MAAM,CAAC,CAAC,IAAI,EAA0C,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;SAC/G,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;SACxB,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,OAAO,mBAAmB;IAe/B,YACC,QAAs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C;IAC5C,OAAO,IAAI,mBAAmB,CAC7B,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,aAAa,EACb,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,oBAAoB,EAC3B,OAAO,CAAC,aAAa,CACrB,CAAC;AACH,CAAC;AAED,OAAO,EAKN,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC","sourcesContent":["import { copyFileSync, existsSync, mkdirSync } from \"node:fs\";\nimport { basename, join, resolve } from \"node:path\";\nimport { resolvePath } from \"../utils/paths.ts\";\nimport type { AgentSession } from \"./agent-session.ts\";\nimport type { AgentSessionRuntimeDiagnostic, AgentSessionServices } from \"./agent-session-services.ts\";\nimport type {\n\tProjectTrustContext,\n\tReplacedSessionContext,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n} from \"./extensions/index.ts\";\nimport { type ExtensionRunner, emitSessionShutdownEvent } from \"./extensions/runner.ts\";\nimport type { CreateAgentSessionResult } from \"./sdk.ts\";\nimport { assertSessionCwdExists } from \"./session-cwd.ts\";\nimport { SessionManager } from \"./session-manager.ts\";\nimport { reserveSessionWrite } from \"./session-write-reservation.ts\";\n\n/**\n * Result returned by runtime creation.\n *\n * The caller gets the created session, its cwd-bound services, and all\n * diagnostics collected during setup.\n */\nexport interface CreateAgentSessionRuntimeResult extends CreateAgentSessionResult {\n\tservices: AgentSessionServices;\n\tdiagnostics: AgentSessionRuntimeDiagnostic[];\n}\n\n/** Immutable flags selected when a runtime is first launched. */\nexport interface AgentSessionLaunchProfile {\n\tcwd: string;\n\tpermissionPreset?: string;\n\tcreationModel?: { provider: string; modelId: string };\n\tinitialThinkingLevel?: string;\n}\n\n/**\n * Creates a full runtime for a target cwd and session manager.\n *\n * The factory closes over process-global fixed inputs, recreates cwd-bound\n * services for the effective cwd, resolves session options against those\n * services, and finally creates the AgentSession.\n */\nexport type CreateAgentSessionRuntimeFactory = (options: {\n\tcwd: string;\n\tagentDir: string;\n\tsessionManager: SessionManager;\n\tsessionStartEvent?: SessionStartEvent;\n\tprojectTrustContext?: ProjectTrustContext;\n\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n}) => Promise<CreateAgentSessionRuntimeResult>;\n\n/**\n * Thrown when /import references a JSONL file path that does not exist.\n */\nexport class SessionImportFileNotFoundError extends Error {\n\treadonly filePath: string;\n\n\tconstructor(filePath: string) {\n\t\tsuper(`File not found: ${filePath}`);\n\t\tthis.name = \"SessionImportFileNotFoundError\";\n\t\tthis.filePath = filePath;\n\t}\n}\n\nfunction extractUserMessageText(content: string | Array<{ type: string; text?: string }>): string {\n\tif (typeof content === \"string\") {\n\t\treturn content;\n\t}\n\n\treturn content\n\t\t.filter((part): part is { type: \"text\"; text: string } => part.type === \"text\" && typeof part.text === \"string\")\n\t\t.map((part) => part.text)\n\t\t.join(\"\");\n}\n\n/**\n * Owns the current AgentSession plus its cwd-bound services.\n *\n * Session replacement methods tear down the current runtime first, then create\n * and apply the next runtime. If creation fails, the error is propagated to the\n * caller. The caller is responsible for user-facing error handling.\n */\nexport class AgentSessionRuntime {\n\tprivate rebindSession?: (session: AgentSession) => Promise<void>;\n\tprivate beforeSessionInvalidate?: () => void;\n\tprivate _session: AgentSession;\n\tprivate _services: AgentSessionServices;\n\tprivate readonly createRuntime: CreateAgentSessionRuntimeFactory;\n\tprivate _diagnostics: AgentSessionRuntimeDiagnostic[];\n\tprivate _modelFallbackMessage?: string;\n\tprivate readonly _launchProfile?: Readonly<AgentSessionLaunchProfile>;\n\tprivate _removedOnReplacement?: {\n\t\toldRunner: ExtensionRunner;\n\t\toldIdentities: Array<{ path: string; resolvedPath: string }>;\n\t\treason: SessionShutdownEvent[\"reason\"];\n\t};\n\n\tconstructor(\n\t\t_session: AgentSession,\n\t\t_services: AgentSessionServices,\n\t\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\t\t_diagnostics: AgentSessionRuntimeDiagnostic[] = [],\n\t\t_modelFallbackMessage?: string,\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>,\n\t) {\n\t\tthis._session = _session;\n\t\tthis._services = _services;\n\t\tthis.createRuntime = createRuntime;\n\t\tthis._diagnostics = _diagnostics;\n\t\tthis._modelFallbackMessage = _modelFallbackMessage;\n\t\tthis._launchProfile = launchProfile;\n\t}\n\n\tget services(): AgentSessionServices {\n\t\treturn this._services;\n\t}\n\n\tget session(): AgentSession {\n\t\treturn this._session;\n\t}\n\n\tget cwd(): string {\n\t\treturn this._services.cwd;\n\t}\n\n\tget diagnostics(): readonly AgentSessionRuntimeDiagnostic[] {\n\t\treturn this._diagnostics;\n\t}\n\n\tget modelFallbackMessage(): string | undefined {\n\t\treturn this._modelFallbackMessage;\n\t}\n\n\tget launchProfile(): Readonly<AgentSessionLaunchProfile> | undefined {\n\t\treturn this._launchProfile;\n\t}\n\n\tsetRebindSession(rebindSession?: (session: AgentSession) => Promise<void>): void {\n\t\tthis.rebindSession = rebindSession;\n\t}\n\n\t/**\n\t * Set a synchronous callback that runs after `session_shutdown` handlers finish\n\t * but before the current session is invalidated.\n\t *\n\t * This is for host-owned UI teardown that must not yield to the event loop,\n\t * such as detaching extension-provided TUI components before the old extension\n\t * context becomes stale.\n\t */\n\tsetBeforeSessionInvalidate(beforeSessionInvalidate?: () => void): void {\n\t\tthis.beforeSessionInvalidate = beforeSessionInvalidate;\n\t}\n\n\tprivate async emitBeforeSwitch(\n\t\treason: \"new\" | \"resume\",\n\t\ttargetSessionFile?: string,\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_switch\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_switch\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async emitBeforeFork(\n\t\tentryId: string,\n\t\toptions: { position: \"before\" | \"at\" },\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_fork\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_fork\",\n\t\t\tentryId,\n\t\t\t...options,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async teardownCurrent(reason: SessionShutdownEvent[\"reason\"], targetSessionFile?: string): Promise<void> {\n\t\t// Settle the active response before replacement so the outgoing turn and\n\t\t// any completed tool results are persisted to the old session.\n\t\tawait this.session.abort();\n\t\tconst oldRunner = this.session.extensionRunner;\n\t\t// Test hosts and partial runner implementations may lack identity introspection;\n\t\t// skip removal reporting there rather than break the replacement itself.\n\t\tif (typeof oldRunner.getExtensionIdentities === \"function\") {\n\t\t\tthis._removedOnReplacement = {\n\t\t\t\toldRunner,\n\t\t\t\toldIdentities: oldRunner.getExtensionIdentities(),\n\t\t\t\treason,\n\t\t\t};\n\t\t}\n\t\tawait emitSessionShutdownEvent(oldRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tthis.session.dispose();\n\t}\n\n\tprivate async reportRemovedExtensions(): Promise<void> {\n\t\tconst pending = this._removedOnReplacement;\n\t\tthis._removedOnReplacement = undefined;\n\t\tif (!pending) return;\n\t\tconst newRunner = this.session.extensionRunner;\n\t\tif (typeof newRunner.getExtensionIdentities !== \"function\") return;\n\t\tconst newResolvedPaths = new Set(newRunner.getExtensionIdentities().map((extension) => extension.resolvedPath));\n\t\tconst removed = pending.oldIdentities.filter((extension) => !newResolvedPaths.has(extension.resolvedPath));\n\t\tif (removed.length === 0) return;\n\t\tawait pending.oldRunner.emit({ type: \"session_extensions_removed\", reason: pending.reason, removed });\n\t}\n\n\tprivate async apply(result: CreateAgentSessionRuntimeResult): Promise<void> {\n\t\tthis._session = result.session;\n\t\tthis._services = result.services;\n\t\tthis._diagnostics = result.diagnostics;\n\t\tthis._modelFallbackMessage = result.modelFallbackMessage;\n\t\tawait this.reportRemovedExtensions();\n\t}\n\n\tprivate async finishSessionReplacement(withSession?: (ctx: ReplacedSessionContext) => Promise<void>): Promise<void> {\n\t\tif (this.rebindSession) {\n\t\t\tawait this.rebindSession(this.session);\n\t\t}\n\t\tif (withSession) {\n\t\t\tawait withSession(this.session.createReplacedSessionContext());\n\t\t}\n\t}\n\n\tasync switchSession(\n\t\tsessionPath: string,\n\t\toptions?: {\n\t\t\tcwdOverride?: string;\n\t\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t\t\tprojectTrustContextFactory?: (cwd: string) => ProjectTrustContext;\n\t\t},\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", sessionPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionManager = SessionManager.open(sessionPath, undefined, options?.cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tprojectTrustContext: options?.projectTrustContextFactory?.(sessionManager.getCwd()),\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync newSession(options?: {\n\t\tparentSession?: string;\n\t\tsetup?: (sessionManager: SessionManager) => Promise<void>;\n\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t}): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"new\");\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tconst sessionManager = this.session.sessionManager.isPersisted()\n\t\t\t? SessionManager.create(this.cwd, sessionDir)\n\t\t\t: SessionManager.inMemory(this.cwd);\n\t\tif (options?.parentSession) {\n\t\t\tsessionManager.newSession({ parentSession: options.parentSession });\n\t\t}\n\n\t\tawait this.teardownCurrent(\"new\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"new\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tif (options?.setup) {\n\t\t\tawait options.setup(this.session.sessionManager);\n\t\t\tthis.session.agent.state.messages = this.session.sessionManager.buildSessionContext().messages;\n\t\t}\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync fork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\"; withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean; selectedText?: string }> {\n\t\tconst position = options?.position ?? \"before\";\n\t\tconst beforeResult = await this.emitBeforeFork(entryId, { position });\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn { cancelled: true };\n\t\t}\n\t\tlet targetLeafId: string | null;\n\t\tlet selectedText: string | undefined;\n\n\t\tconst selectedEntry = this.session.sessionManager.getEntry(entryId);\n\t\tif (!selectedEntry) {\n\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t}\n\n\t\tif (position === \"at\") {\n\t\t\ttargetLeafId = selectedEntry.id;\n\t\t} else {\n\t\t\tif (selectedEntry.type !== \"message\" || selectedEntry.message.role !== \"user\") {\n\t\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t\t}\n\t\t\ttargetLeafId = selectedEntry.parentId;\n\t\t\tselectedText = extractUserMessageText(selectedEntry.message.content);\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tif (this.session.sessionManager.isPersisted()) {\n\t\t\tconst currentSessionFile = this.session.sessionFile;\n\t\t\tif (!currentSessionFile) {\n\t\t\t\tthrow new Error(\"Persisted session is missing a session file\");\n\t\t\t}\n\t\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\t\tif (!targetLeafId) {\n\t\t\t\tconst sessionManager = SessionManager.create(this.cwd, sessionDir);\n\t\t\t\tsessionManager.newSession({ parentSession: currentSessionFile });\n\t\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\t\tawait this.apply(\n\t\t\t\t\tawait this.createRuntime({\n\t\t\t\t\t\tcwd: this.cwd,\n\t\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\t\treturn { cancelled: false, selectedText };\n\t\t\t}\n\n\t\t\tif (!existsSync(currentSessionFile)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"This session has not been saved yet. Wait for the first assistant response before cloning or forking it.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst sessionManager = SessionManager.open(currentSessionFile, sessionDir);\n\t\t\tconst forkedSessionPath = sessionManager.createBranchedSession(targetLeafId);\n\t\t\tif (!forkedSessionPath) {\n\t\t\t\tthrow new Error(\"Failed to create forked session\");\n\t\t\t}\n\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\tawait this.apply(\n\t\t\t\tawait this.createRuntime({\n\t\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\treturn { cancelled: false, selectedText };\n\t\t}\n\n\t\tconst sessionManager = this.session.sessionManager;\n\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\tif (!targetLeafId) {\n\t\t\tsessionManager.newSession({ parentSession: previousSessionFile });\n\t\t} else {\n\t\t\tsessionManager.createBranchedSession(targetLeafId);\n\t\t}\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false, selectedText };\n\t}\n\n\t/**\n\t * Import a session JSONL file and switch runtime state to the imported session.\n\t *\n\t * @returns `{ cancelled: true }` when cancelled by `session_before_switch`, otherwise `{ cancelled: false }`.\n\t * @throws {SessionImportFileNotFoundError} When the input path does not exist.\n\t * @throws {MissingSessionCwdError} When the imported session cwd cannot be resolved and no override is provided.\n\t */\n\tasync importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{ cancelled: boolean }> {\n\t\tconst resolvedPath = resolvePath(inputPath);\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tthrow new SessionImportFileNotFoundError(resolvedPath);\n\t\t}\n\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tif (!existsSync(sessionDir)) {\n\t\t\tmkdirSync(sessionDir, { recursive: true });\n\t\t}\n\n\t\tconst destinationPath = join(sessionDir, basename(resolvedPath));\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", destinationPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\treserveSessionWrite(destinationPath);\n\t\tif (resolve(destinationPath) !== resolvedPath) {\n\t\t\tcopyFileSync(resolvedPath, destinationPath);\n\t\t}\n\n\t\tconst sessionManager = SessionManager.open(destinationPath, sessionDir, cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement();\n\t\treturn { cancelled: false };\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tawait emitSessionShutdownEvent(this.session.extensionRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason: \"quit\",\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tthis.session.dispose();\n\t}\n}\n\n/**\n * Create the initial runtime from a runtime factory and initial session target.\n *\n * The same factory is stored on the returned AgentSessionRuntime and reused for\n * later /new, /resume, /fork, and import flows.\n */\nexport async function createAgentSessionRuntime(\n\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\toptions: {\n\t\tcwd: string;\n\t\tagentDir: string;\n\t\tsessionManager: SessionManager;\n\t\tsessionStartEvent?: SessionStartEvent;\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n\t},\n): Promise<AgentSessionRuntime> {\n\tassertSessionCwdExists(options.sessionManager, options.cwd);\n\tconst result = await createRuntime(options);\n\treturn new AgentSessionRuntime(\n\t\tresult.session,\n\t\tresult.services,\n\t\tcreateRuntime,\n\t\tresult.diagnostics,\n\t\tresult.modelFallbackMessage,\n\t\toptions.launchProfile,\n\t);\n}\n\nexport {\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionServicesOptions,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionServices,\n} from \"./agent-session-services.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"agent-session-runtime.js","sourceRoot":"","sources":["../../src/core/agent-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD,OAAO,EAAwB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAqC9F;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAGxD,YAAY,QAAgB;QAC3B,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,CAAC;CACD;AAED,SAAS,sBAAsB,CAAC,OAAwD;IACvF,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,OAAO,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aAAa,CAAC;YACxB,GAAG,EAAE,cAAc,CAAC,MAAM,EAAE;YAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ;YAChC,cAAc;YACd,iBAAiB,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,EAAE;YACnF,aAAa,EAAE,IAAI,CAAC,cAAc;SAClC,CAAC,CACF,CAAC;QACF,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;QACtC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAC5D,IAAI,EAAE,kBAAkB;YACxB,MAAM,EAAE,MAAM;SACd,CAAC,CAAC;QACH,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;CACD;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC9C,aAA+C,EAC/C,OAMC;IAED,sBAAsB,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAI,mBAAmB,CAC7B,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,aAAa,EACb,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,oBAAoB,EAC3B,OAAO,CAAC,aAAa,CACrB,CAAC;AACH,CAAC;AAED,OAAO,EAKN,8BAA8B,EAC9B,0BAA0B,GAC1B,MAAM,6BAA6B,CAAC","sourcesContent":["import { constants, copyFileSync, existsSync, mkdirSync } from \"node:fs\";\nimport { basename, join, parse, resolve } from \"node:path\";\nimport { resolvePath } from \"../utils/paths.ts\";\nimport type { AgentSession } from \"./agent-session.ts\";\nimport type { AgentSessionRuntimeDiagnostic, AgentSessionServices } from \"./agent-session-services.ts\";\nimport type {\n\tProjectTrustContext,\n\tReplacedSessionContext,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n} from \"./extensions/index.ts\";\nimport { type ExtensionRunner, emitSessionShutdownEvent } from \"./extensions/runner.ts\";\nimport type { CreateAgentSessionResult } from \"./sdk.ts\";\nimport { assertSessionCwdExists } from \"./session-cwd.ts\";\nimport { SessionManager } from \"./session-manager.ts\";\nimport { reserveSessionWrite, unregisterSessionWriter } from \"./session-write-reservation.ts\";\n\n/**\n * Result returned by runtime creation.\n *\n * The caller gets the created session, its cwd-bound services, and all\n * diagnostics collected during setup.\n */\nexport interface CreateAgentSessionRuntimeResult extends CreateAgentSessionResult {\n\tservices: AgentSessionServices;\n\tdiagnostics: AgentSessionRuntimeDiagnostic[];\n}\n\n/** Immutable flags selected when a runtime is first launched. */\nexport interface AgentSessionLaunchProfile {\n\tcwd: string;\n\tpermissionPreset?: string;\n\tcreationModel?: { provider: string; modelId: string };\n\tinitialThinkingLevel?: string;\n}\n\n/**\n * Creates a full runtime for a target cwd and session manager.\n *\n * The factory closes over process-global fixed inputs, recreates cwd-bound\n * services for the effective cwd, resolves session options against those\n * services, and finally creates the AgentSession.\n */\nexport type CreateAgentSessionRuntimeFactory = (options: {\n\tcwd: string;\n\tagentDir: string;\n\tsessionManager: SessionManager;\n\tsessionStartEvent?: SessionStartEvent;\n\tprojectTrustContext?: ProjectTrustContext;\n\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n}) => Promise<CreateAgentSessionRuntimeResult>;\n\n/**\n * Thrown when /import references a JSONL file path that does not exist.\n */\nexport class SessionImportFileNotFoundError extends Error {\n\treadonly filePath: string;\n\n\tconstructor(filePath: string) {\n\t\tsuper(`File not found: ${filePath}`);\n\t\tthis.name = \"SessionImportFileNotFoundError\";\n\t\tthis.filePath = filePath;\n\t}\n}\n\nfunction extractUserMessageText(content: string | Array<{ type: string; text?: string }>): string {\n\tif (typeof content === \"string\") {\n\t\treturn content;\n\t}\n\n\treturn content\n\t\t.filter((part): part is { type: \"text\"; text: string } => part.type === \"text\" && typeof part.text === \"string\")\n\t\t.map((part) => part.text)\n\t\t.join(\"\");\n}\n\n/**\n * Owns the current AgentSession plus its cwd-bound services.\n *\n * Session replacement methods tear down the current runtime first, then create\n * and apply the next runtime. If creation fails, the error is propagated to the\n * caller. The caller is responsible for user-facing error handling.\n */\nexport class AgentSessionRuntime {\n\tprivate rebindSession?: (session: AgentSession) => Promise<void>;\n\tprivate beforeSessionInvalidate?: () => void;\n\tprivate _session: AgentSession;\n\tprivate _services: AgentSessionServices;\n\tprivate readonly createRuntime: CreateAgentSessionRuntimeFactory;\n\tprivate _diagnostics: AgentSessionRuntimeDiagnostic[];\n\tprivate _modelFallbackMessage?: string;\n\tprivate readonly _launchProfile?: Readonly<AgentSessionLaunchProfile>;\n\tprivate _removedOnReplacement?: {\n\t\toldRunner: ExtensionRunner;\n\t\toldIdentities: Array<{ path: string; resolvedPath: string }>;\n\t\treason: SessionShutdownEvent[\"reason\"];\n\t};\n\n\tconstructor(\n\t\t_session: AgentSession,\n\t\t_services: AgentSessionServices,\n\t\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\t\t_diagnostics: AgentSessionRuntimeDiagnostic[] = [],\n\t\t_modelFallbackMessage?: string,\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>,\n\t) {\n\t\tthis._session = _session;\n\t\tthis._services = _services;\n\t\tthis.createRuntime = createRuntime;\n\t\tthis._diagnostics = _diagnostics;\n\t\tthis._modelFallbackMessage = _modelFallbackMessage;\n\t\tthis._launchProfile = launchProfile;\n\t}\n\n\tget services(): AgentSessionServices {\n\t\treturn this._services;\n\t}\n\n\tget session(): AgentSession {\n\t\treturn this._session;\n\t}\n\n\tget cwd(): string {\n\t\treturn this._services.cwd;\n\t}\n\n\tget diagnostics(): readonly AgentSessionRuntimeDiagnostic[] {\n\t\treturn this._diagnostics;\n\t}\n\n\tget modelFallbackMessage(): string | undefined {\n\t\treturn this._modelFallbackMessage;\n\t}\n\n\tget launchProfile(): Readonly<AgentSessionLaunchProfile> | undefined {\n\t\treturn this._launchProfile;\n\t}\n\n\tsetRebindSession(rebindSession?: (session: AgentSession) => Promise<void>): void {\n\t\tthis.rebindSession = rebindSession;\n\t}\n\n\t/**\n\t * Set a synchronous callback that runs after `session_shutdown` handlers finish\n\t * but before the current session is invalidated.\n\t *\n\t * This is for host-owned UI teardown that must not yield to the event loop,\n\t * such as detaching extension-provided TUI components before the old extension\n\t * context becomes stale.\n\t */\n\tsetBeforeSessionInvalidate(beforeSessionInvalidate?: () => void): void {\n\t\tthis.beforeSessionInvalidate = beforeSessionInvalidate;\n\t}\n\n\tprivate async emitBeforeSwitch(\n\t\treason: \"new\" | \"resume\",\n\t\ttargetSessionFile?: string,\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_switch\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_switch\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async emitBeforeFork(\n\t\tentryId: string,\n\t\toptions: { position: \"before\" | \"at\" },\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst runner = this.session.extensionRunner;\n\t\tif (!runner.hasHandlers(\"session_before_fork\")) {\n\t\t\treturn { cancelled: false };\n\t\t}\n\n\t\tconst result = await runner.emit({\n\t\t\ttype: \"session_before_fork\",\n\t\t\tentryId,\n\t\t\t...options,\n\t\t});\n\t\treturn { cancelled: result?.cancel === true };\n\t}\n\n\tprivate async teardownCurrent(reason: SessionShutdownEvent[\"reason\"], targetSessionFile?: string): Promise<void> {\n\t\t// Settle the active response before replacement so the outgoing turn and\n\t\t// any completed tool results are persisted to the old session.\n\t\tawait this.session.abort();\n\t\tconst oldRunner = this.session.extensionRunner;\n\t\t// Test hosts and partial runner implementations may lack identity introspection;\n\t\t// skip removal reporting there rather than break the replacement itself.\n\t\tif (typeof oldRunner.getExtensionIdentities === \"function\") {\n\t\t\tthis._removedOnReplacement = {\n\t\t\t\toldRunner,\n\t\t\t\toldIdentities: oldRunner.getExtensionIdentities(),\n\t\t\t\treason,\n\t\t\t};\n\t\t}\n\t\tawait emitSessionShutdownEvent(oldRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason,\n\t\t\ttargetSessionFile,\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tconst replaced = this.session.sessionManager;\n\t\tthis.session.dispose();\n\t\t// Nothing writes to the replaced manager once its session is disposed, so the\n\t\t// shared host may hand its session file to another worker.\n\t\tunregisterSessionWriter(replaced);\n\t}\n\n\tprivate async reportRemovedExtensions(): Promise<void> {\n\t\tconst pending = this._removedOnReplacement;\n\t\tthis._removedOnReplacement = undefined;\n\t\tif (!pending) return;\n\t\tconst newRunner = this.session.extensionRunner;\n\t\tif (typeof newRunner.getExtensionIdentities !== \"function\") return;\n\t\tconst newResolvedPaths = new Set(newRunner.getExtensionIdentities().map((extension) => extension.resolvedPath));\n\t\tconst removed = pending.oldIdentities.filter((extension) => !newResolvedPaths.has(extension.resolvedPath));\n\t\tif (removed.length === 0) return;\n\t\tawait pending.oldRunner.emit({ type: \"session_extensions_removed\", reason: pending.reason, removed });\n\t}\n\n\tprivate async apply(result: CreateAgentSessionRuntimeResult): Promise<void> {\n\t\tthis._session = result.session;\n\t\tthis._services = result.services;\n\t\tthis._diagnostics = result.diagnostics;\n\t\tthis._modelFallbackMessage = result.modelFallbackMessage;\n\t\tawait this.reportRemovedExtensions();\n\t}\n\n\tprivate async finishSessionReplacement(withSession?: (ctx: ReplacedSessionContext) => Promise<void>): Promise<void> {\n\t\tif (this.rebindSession) {\n\t\t\tawait this.rebindSession(this.session);\n\t\t}\n\t\tif (withSession) {\n\t\t\tawait withSession(this.session.createReplacedSessionContext());\n\t\t}\n\t}\n\n\tasync switchSession(\n\t\tsessionPath: string,\n\t\toptions?: {\n\t\t\tcwdOverride?: string;\n\t\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t\t\tprojectTrustContextFactory?: (cwd: string) => ProjectTrustContext;\n\t\t},\n\t): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", sessionPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionManager = SessionManager.open(sessionPath, undefined, options?.cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tprojectTrustContext: options?.projectTrustContextFactory?.(sessionManager.getCwd()),\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync newSession(options?: {\n\t\tparentSession?: string;\n\t\tsetup?: (sessionManager: SessionManager) => Promise<void>;\n\t\twithSession?: (ctx: ReplacedSessionContext) => Promise<void>;\n\t}): Promise<{ cancelled: boolean }> {\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"new\");\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tconst sessionManager = this.session.sessionManager.isPersisted()\n\t\t\t? SessionManager.create(this.cwd, sessionDir)\n\t\t\t: SessionManager.inMemory(this.cwd);\n\t\tif (options?.parentSession) {\n\t\t\tsessionManager.newSession({ parentSession: options.parentSession });\n\t\t}\n\n\t\tawait this.teardownCurrent(\"new\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"new\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tif (options?.setup) {\n\t\t\tawait options.setup(this.session.sessionManager);\n\t\t\tthis.session.agent.state.messages = this.session.sessionManager.buildSessionContext().messages;\n\t\t}\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false };\n\t}\n\n\tasync fork(\n\t\tentryId: string,\n\t\toptions?: { position?: \"before\" | \"at\"; withSession?: (ctx: ReplacedSessionContext) => Promise<void> },\n\t): Promise<{ cancelled: boolean; selectedText?: string }> {\n\t\tconst position = options?.position ?? \"before\";\n\t\tconst beforeResult = await this.emitBeforeFork(entryId, { position });\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn { cancelled: true };\n\t\t}\n\t\tlet targetLeafId: string | null;\n\t\tlet selectedText: string | undefined;\n\n\t\tconst selectedEntry = this.session.sessionManager.getEntry(entryId);\n\t\tif (!selectedEntry) {\n\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t}\n\n\t\tif (position === \"at\") {\n\t\t\ttargetLeafId = selectedEntry.id;\n\t\t} else {\n\t\t\tif (selectedEntry.type !== \"message\" || selectedEntry.message.role !== \"user\") {\n\t\t\t\tthrow new Error(\"Invalid entry ID for forking\");\n\t\t\t}\n\t\t\ttargetLeafId = selectedEntry.parentId;\n\t\t\tselectedText = extractUserMessageText(selectedEntry.message.content);\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\tif (this.session.sessionManager.isPersisted()) {\n\t\t\tconst currentSessionFile = this.session.sessionFile;\n\t\t\tif (!currentSessionFile) {\n\t\t\t\tthrow new Error(\"Persisted session is missing a session file\");\n\t\t\t}\n\t\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\t\tif (!targetLeafId) {\n\t\t\t\tconst sessionManager = SessionManager.create(this.cwd, sessionDir);\n\t\t\t\tsessionManager.newSession({ parentSession: currentSessionFile });\n\t\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\t\tawait this.apply(\n\t\t\t\t\tawait this.createRuntime({\n\t\t\t\t\t\tcwd: this.cwd,\n\t\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\t\tsessionManager,\n\t\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\t\treturn { cancelled: false, selectedText };\n\t\t\t}\n\n\t\t\tif (!existsSync(currentSessionFile)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"This session has not been saved yet. Wait for the first assistant response before cloning or forking it.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst sessionManager = SessionManager.open(currentSessionFile, sessionDir);\n\t\t\tconst forkedSessionPath = sessionManager.createBranchedSession(targetLeafId);\n\t\t\tif (!forkedSessionPath) {\n\t\t\t\tthrow new Error(\"Failed to create forked session\");\n\t\t\t}\n\t\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\t\tawait this.apply(\n\t\t\t\tawait this.createRuntime({\n\t\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\t\tsessionManager,\n\t\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\t\treturn { cancelled: false, selectedText };\n\t\t}\n\n\t\tconst sessionManager = this.session.sessionManager;\n\t\tawait this.teardownCurrent(\"fork\", sessionManager.getSessionFile());\n\t\tif (!targetLeafId) {\n\t\t\tsessionManager.newSession({ parentSession: previousSessionFile });\n\t\t} else {\n\t\t\tsessionManager.createBranchedSession(targetLeafId);\n\t\t}\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: this.cwd,\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"fork\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement(options?.withSession);\n\t\treturn { cancelled: false, selectedText };\n\t}\n\n\t/**\n\t * Import a session JSONL file and switch runtime state to the imported session.\n\t *\n\t * @returns `{ cancelled: true }` when cancelled by `session_before_switch`, otherwise `{ cancelled: false }`.\n\t * @throws {SessionImportFileNotFoundError} When the input path does not exist.\n\t * @throws {MissingSessionCwdError} When the imported session cwd cannot be resolved and no override is provided.\n\t */\n\tasync importFromJsonl(inputPath: string, cwdOverride?: string): Promise<{ cancelled: boolean }> {\n\t\tconst resolvedPath = resolvePath(inputPath);\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tthrow new SessionImportFileNotFoundError(resolvedPath);\n\t\t}\n\n\t\tconst sessionDir = this.session.sessionManager.getSessionDir();\n\t\tif (!existsSync(sessionDir)) {\n\t\t\tmkdirSync(sessionDir, { recursive: true });\n\t\t}\n\n\t\tlet destinationPath = join(sessionDir, basename(resolvedPath));\n\t\tconst sourceAlreadyStored = resolve(destinationPath) === resolvedPath;\n\t\tif (!sourceAlreadyStored) {\n\t\t\tconst { name, ext } = parse(destinationPath);\n\t\t\tlet suffix = 1;\n\t\t\twhile (existsSync(destinationPath)) {\n\t\t\t\tdestinationPath = join(sessionDir, `${name}-${suffix++}${ext}`);\n\t\t\t}\n\t\t}\n\t\tconst beforeResult = await this.emitBeforeSwitch(\"resume\", destinationPath);\n\t\tif (beforeResult.cancelled) {\n\t\t\treturn beforeResult;\n\t\t}\n\n\t\tconst previousSessionFile = this.session.sessionFile;\n\t\treserveSessionWrite(destinationPath);\n\t\tif (!sourceAlreadyStored) {\n\t\t\tcopyFileSync(resolvedPath, destinationPath, constants.COPYFILE_EXCL);\n\t\t}\n\n\t\tconst sessionManager = SessionManager.open(destinationPath, sessionDir, cwdOverride);\n\t\tassertSessionCwdExists(sessionManager, this.cwd);\n\t\tawait this.teardownCurrent(\"resume\", sessionManager.getSessionFile());\n\t\tawait this.apply(\n\t\t\tawait this.createRuntime({\n\t\t\t\tcwd: sessionManager.getCwd(),\n\t\t\t\tagentDir: this.services.agentDir,\n\t\t\t\tsessionManager,\n\t\t\t\tsessionStartEvent: { type: \"session_start\", reason: \"resume\", previousSessionFile },\n\t\t\t\tlaunchProfile: this._launchProfile,\n\t\t\t}),\n\t\t);\n\t\tawait this.finishSessionReplacement();\n\t\treturn { cancelled: false };\n\t}\n\n\tasync dispose(): Promise<void> {\n\t\tawait emitSessionShutdownEvent(this.session.extensionRunner, {\n\t\t\ttype: \"session_shutdown\",\n\t\t\treason: \"quit\",\n\t\t});\n\t\tthis.beforeSessionInvalidate?.();\n\t\tthis.session.dispose();\n\t}\n}\n\n/**\n * Create the initial runtime from a runtime factory and initial session target.\n *\n * The same factory is stored on the returned AgentSessionRuntime and reused for\n * later /new, /resume, /fork, and import flows.\n */\nexport async function createAgentSessionRuntime(\n\tcreateRuntime: CreateAgentSessionRuntimeFactory,\n\toptions: {\n\t\tcwd: string;\n\t\tagentDir: string;\n\t\tsessionManager: SessionManager;\n\t\tsessionStartEvent?: SessionStartEvent;\n\t\tlaunchProfile?: Readonly<AgentSessionLaunchProfile>;\n\t},\n): Promise<AgentSessionRuntime> {\n\tassertSessionCwdExists(options.sessionManager, options.cwd);\n\tconst result = await createRuntime(options);\n\treturn new AgentSessionRuntime(\n\t\tresult.session,\n\t\tresult.services,\n\t\tcreateRuntime,\n\t\tresult.diagnostics,\n\t\tresult.modelFallbackMessage,\n\t\toptions.launchProfile,\n\t);\n}\n\nexport {\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionServicesOptions,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionServices,\n} from \"./agent-session-services.ts\";\n"]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import type { Agent, AgentEvent, AgentMessage, AgentState, AgentTool, AgentToolCall, AgentToolResult, ThinkingLevel } from "@earendil-works/pi-agent-core";
|
|
16
16
|
import { type ThinkingSelection } from "@earendil-works/pi-ai";
|
|
17
|
-
import type { Api, ImageContent,
|
|
17
|
+
import type { Api, ImageContent, Model, TextContent } from "@earendil-works/pi-ai/compat";
|
|
18
18
|
import { type AgentAbortSource } from "./agent-abort-provenance.ts";
|
|
19
19
|
import { type DeferredTurnClaim } from "./agent-settled-delivery.ts";
|
|
20
20
|
import { type BashResult } from "./bash-executor.ts";
|
|
@@ -376,6 +376,16 @@ export type ClearedQueue = {
|
|
|
376
376
|
/** Global enqueue order, independent of native delivery priority. */
|
|
377
377
|
readonly ordered: readonly QueuedInput[];
|
|
378
378
|
};
|
|
379
|
+
/** Options accepted by the queued-input entry points `steer()` and `followUp()`. */
|
|
380
|
+
export interface QueuedInputOptions {
|
|
381
|
+
/**
|
|
382
|
+
* Recovery-ordered enqueue position. A reconnecting client replays its pending
|
|
383
|
+
* messages with their original order so the queue is rebuilt as the user typed it.
|
|
384
|
+
*/
|
|
385
|
+
enqueueOrder?: number;
|
|
386
|
+
/** Input provenance reported to `input` extension handlers; defaults to "interactive". */
|
|
387
|
+
source?: InputSource;
|
|
388
|
+
}
|
|
379
389
|
export interface PromptOptions {
|
|
380
390
|
/** Whether to dispatch extension commands and expand skill commands and prompt templates (default: true) */
|
|
381
391
|
expandPromptTemplates?: boolean;
|
|
@@ -429,13 +439,11 @@ export interface SessionStats {
|
|
|
429
439
|
}
|
|
430
440
|
/** Caps explicit skill expansion so one prompt cannot consume unbounded context. */
|
|
431
441
|
export declare const MAX_SKILL_EXPANSIONS_PER_PROMPT = 5;
|
|
432
|
-
/**
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
changed: boolean;
|
|
438
|
-
};
|
|
442
|
+
/**
|
|
443
|
+
* Cursor admission lives in its own module; the names stay exported here so
|
|
444
|
+
* existing importers keep resolving them.
|
|
445
|
+
*/
|
|
446
|
+
export { CURSOR_TOOL_RESULT_MAX_CHARS, truncateToolResultBodies } from "./cursor-history-admission.ts";
|
|
439
447
|
export declare function providerRetryWatchdogAbortMessage(retryTimeoutMs: number | undefined, streamStartTimeoutMs: number | undefined): string;
|
|
440
448
|
export declare class AgentSession {
|
|
441
449
|
readonly agent: Agent;
|
|
@@ -627,6 +635,13 @@ export declare class AgentSession {
|
|
|
627
635
|
waitForEventQueue?: boolean;
|
|
628
636
|
}): Promise<import("./extensions/types.ts").ToolCallEventResult | undefined>;
|
|
629
637
|
private _emitAfterToolCallHooks;
|
|
638
|
+
/**
|
|
639
|
+
* Cursor states a model's real context ceiling on every conversation
|
|
640
|
+
* checkpoint. Once observed, it replaces the catalog guess on the live model
|
|
641
|
+
* so context usage, compaction thresholds and admission all size against the
|
|
642
|
+
* window the server will actually enforce.
|
|
643
|
+
*/
|
|
644
|
+
private _applyObservedCursorContextWindow;
|
|
630
645
|
private _installAgentNextTurnRefresh;
|
|
631
646
|
/** Emit an event to all listeners */
|
|
632
647
|
private _emitEntryAppended;
|
|
@@ -905,6 +920,18 @@ export declare class AgentSession {
|
|
|
905
920
|
private _normalizePromptSnippet;
|
|
906
921
|
private _normalizePromptGuidelines;
|
|
907
922
|
private _rebuildSystemPrompt;
|
|
923
|
+
/**
|
|
924
|
+
* Run `input` extension handlers for queued (steer / follow-up) input.
|
|
925
|
+
*
|
|
926
|
+
* Queued input reaches the model exactly like a prompt does, so it passes the same
|
|
927
|
+
* extension surface: a handler may consume it or rewrite it. The input keeps the
|
|
928
|
+
* session-scoped `inputId` identity, so the `input_disposition` event a handler
|
|
929
|
+
* observes correlates with the input it saw.
|
|
930
|
+
*
|
|
931
|
+
* @returns the (possibly transformed) input, or `undefined` when a handler consumed it.
|
|
932
|
+
*/
|
|
933
|
+
private _runInputHandlers;
|
|
934
|
+
private _emitInputDisposition;
|
|
908
935
|
/**
|
|
909
936
|
* Send a prompt to the agent.
|
|
910
937
|
* - Handles extension commands (registered via pi.registerCommand) immediately, even during streaming
|
|
@@ -925,27 +952,32 @@ export declare class AgentSession {
|
|
|
925
952
|
* the desktop's explicit `$skill:name` token so ordinary dollar prose stays literal.
|
|
926
953
|
*/
|
|
927
954
|
private _expandSkillCommand;
|
|
955
|
+
/**
|
|
956
|
+
* Shared queueing path for `steer()` and `followUp()`: extension-command guard,
|
|
957
|
+
* `input` handlers, skill/template expansion, then the recovery-ordered enqueue.
|
|
958
|
+
*/
|
|
959
|
+
private _queueUserInput;
|
|
928
960
|
/**
|
|
929
961
|
* Queue a steering message while the agent is running.
|
|
930
962
|
* Delivered after the current assistant turn finishes executing its tool calls,
|
|
931
963
|
* before the next LLM call.
|
|
932
|
-
*
|
|
964
|
+
* Runs `input` extension handlers, then expands skill commands and prompt templates.
|
|
965
|
+
* Errors on extension commands.
|
|
933
966
|
* @param images Optional image attachments to include with the message
|
|
967
|
+
* @param options Recovery enqueue order and input source; source defaults to interactive
|
|
934
968
|
* @throws Error if text is an extension command
|
|
935
969
|
*/
|
|
936
|
-
steer(text: string, images?: ImageContent[],
|
|
937
|
-
enqueueOrder?: number;
|
|
938
|
-
}): Promise<void>;
|
|
970
|
+
steer(text: string, images?: ImageContent[], options?: QueuedInputOptions): Promise<void>;
|
|
939
971
|
/**
|
|
940
972
|
* Queue a follow-up message to be processed after the agent finishes.
|
|
941
973
|
* Delivered only when agent has no more tool calls or steering messages.
|
|
942
|
-
*
|
|
974
|
+
* Runs `input` extension handlers, then expands skill commands and prompt templates.
|
|
975
|
+
* Errors on extension commands.
|
|
943
976
|
* @param images Optional image attachments to include with the message
|
|
977
|
+
* @param options Recovery enqueue order and input source; source defaults to interactive
|
|
944
978
|
* @throws Error if text is an extension command
|
|
945
979
|
*/
|
|
946
|
-
followUp(text: string, images?: ImageContent[],
|
|
947
|
-
enqueueOrder?: number;
|
|
948
|
-
}): Promise<void>;
|
|
980
|
+
followUp(text: string, images?: ImageContent[], options?: QueuedInputOptions): Promise<void>;
|
|
949
981
|
private _startSessionTitleGeneration;
|
|
950
982
|
private _generateSessionTitle;
|
|
951
983
|
private abortSessionTitleGeneration;
|
|
@@ -1253,6 +1285,12 @@ export declare class AgentSession {
|
|
|
1253
1285
|
* for every other session on the machine (#1422).
|
|
1254
1286
|
*/
|
|
1255
1287
|
setAutoCompactionEnabled(enabled: boolean): void;
|
|
1288
|
+
/**
|
|
1289
|
+
* Compaction settings for a model, defaulting to the session model so per-model
|
|
1290
|
+
* token budgets (`compaction.modelOverrides`) apply to every compaction read here.
|
|
1291
|
+
* Callers that captured a model before an await pass it explicitly, so a model
|
|
1292
|
+
* switch during that await cannot change the budget the operation started with.
|
|
1293
|
+
*/
|
|
1256
1294
|
private _getCompactionSettings;
|
|
1257
1295
|
private _emitSessionSettingsChanged;
|
|
1258
1296
|
/** Whether auto-compaction is enabled for this session */
|
|
@@ -1478,5 +1516,4 @@ export declare class AgentSession {
|
|
|
1478
1516
|
*/
|
|
1479
1517
|
get extensionRunner(): ExtensionRunner;
|
|
1480
1518
|
}
|
|
1481
|
-
export {};
|
|
1482
1519
|
//# sourceMappingURL=agent-session.d.ts.map
|