orient-cli 0.3.0 → 0.3.2
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/dist/integrations/notebooklm/notebooklm-extension.js +3 -8
- package/dist/integrations/notebooklm/notebooklm-extension.js.map +1 -1
- package/dist/integrations/playwright/playwright-extension.js +4 -14
- package/dist/integrations/playwright/playwright-extension.js.map +1 -1
- package/dist/integrations/web-search/bridge.js +12 -23
- package/dist/integrations/web-search/bridge.js.map +1 -1
- package/dist/integrations/web-search/web-search-extension.js +0 -3
- package/dist/integrations/web-search/web-search-extension.js.map +1 -1
- package/dist/orient/orient-extension.js +6 -14
- package/dist/orient/orient-extension.js.map +1 -1
- package/package.json +3 -10
- package/scripts/postinstall.mjs +40 -1
- package/vendor/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/bun/cli.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/args.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/args.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/config-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/file-processor.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +18 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/initial-message.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/list-models.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli/session-picker.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/cli.d.ts.map +1 -0
- package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli.js +0 -0
- package/vendor/@orient-cli/coding-agent/dist/cli.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/config.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/config.js +251 -0
- package/vendor/@orient-cli/coding-agent/dist/config.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +231 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.d.ts +617 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.js +2477 -0
- package/vendor/@orient-cli/coding-agent/dist/core/agent-session.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +136 -0
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.js +418 -0
- package/vendor/@orient-cli/coding-agent/dist/core/auth-storage.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/bash-executor.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/event-bus.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/exec.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/exec.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/index.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.js +695 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/types.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.js +313 -0
- package/vendor/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.d.ts +293 -0
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.js +247 -0
- package/vendor/@orient-cli/coding-agent/dist/core/keybindings.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/messages.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/messages.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/model-registry.js +612 -0
- package/vendor/@orient-cli/coding-agent/dist/core/model-registry.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/model-resolver.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/output-guard.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/package-manager.js +1823 -0
- package/vendor/@orient-cli/coding-agent/dist/core/package-manager.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.js +681 -0
- package/vendor/@orient-cli/coding-agent/dist/core/resource-loader.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/sdk.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.js +37 -0
- package/vendor/@orient-cli/coding-agent/dist/core/session-cwd.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/session-manager.js +1101 -0
- package/vendor/@orient-cli/coding-agent/dist/core/session-manager.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.js +699 -0
- package/vendor/@orient-cli/coding-agent/dist/core/settings-manager.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/skills.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/skills.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/source-info.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/system-prompt.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/timings.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/timings.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.js +355 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/bash.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/edit.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/find.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/grep.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/index.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/ls.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/read.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/write.js +215 -0
- package/vendor/@orient-cli/coding-agent/dist/core/tools/write.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/main.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/main.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/migrations.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/migrations.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +102 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +170 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +48 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +42 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +43 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +470 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +28 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +63 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +74 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +20 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +106 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +55 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +71 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +199 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +139 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +263 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +92 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +271 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +823 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +299 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +38 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +45 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +48 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +50 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +261 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +1070 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +110 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +359 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +4081 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +973 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/print-mode.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +401 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/package-manager-cli.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/changelog.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/child-process.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/clipboard.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/git.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/git.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/image-convert.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/image-resize.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/mime.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/paths.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/photon.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/shell.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/sleep.js.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
- package/vendor/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +1 -0
- package/node_modules/@orient-cli/agent-core/README.md +0 -456
- package/node_modules/@orient-cli/ai/README.md +0 -1315
- package/node_modules/@orient-cli/coding-agent/README.md +0 -618
- package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/args.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +0 -18
- package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/cli.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/config.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/config.js +0 -229
- package/node_modules/@orient-cli/coding-agent/dist/config.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +0 -236
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts +0 -585
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js +0 -2497
- package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +0 -132
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js +0 -422
- package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/exec.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.css +0 -1001
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.html +0 -55
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.js +0 -1690
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/highlight.min.js +0 -1213
- package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/marked.min.js +0 -6
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js +0 -701
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js +0 -314
- package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts +0 -293
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js +0 -248
- package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/messages.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js +0 -612
- package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js +0 -1829
- package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js +0 -720
- package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js +0 -38
- package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js +0 -1105
- package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js +0 -708
- package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/skills.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/timings.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js +0 -352
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js +0 -216
- package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/main.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/main.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/migrations.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +0 -107
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +0 -175
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +0 -51
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +0 -44
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +0 -45
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +0 -479
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +0 -33
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +0 -70
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +0 -79
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +0 -21
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +0 -111
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +0 -61
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +0 -78
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +0 -201
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +0 -145
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +0 -275
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +0 -97
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +0 -275
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +0 -848
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +0 -301
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +0 -39
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +0 -47
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +0 -50
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +0 -51
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +0 -274
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +0 -1084
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +0 -113
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +0 -345
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +0 -4106
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/dark.json +0 -85
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/light.json +0 -84
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -335
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +0 -979
- package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +0 -402
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/git.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +0 -1
- package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +0 -1
- package/node_modules/@orient-cli/tui/README.md +0 -767
- package/node_modules/mime-db/HISTORY.md +0 -541
- package/node_modules/mime-db/LICENSE +0 -23
- package/node_modules/mime-db/README.md +0 -109
- package/node_modules/mime-db/db.json +0 -9342
- package/node_modules/mime-db/index.js +0 -12
- package/node_modules/mime-db/package.json +0 -56
- package/node_modules/mime-types/HISTORY.md +0 -428
- package/node_modules/mime-types/LICENSE +0 -23
- package/node_modules/mime-types/README.md +0 -126
- package/node_modules/mime-types/index.js +0 -211
- package/node_modules/mime-types/mimeScore.js +0 -57
- package/node_modules/mime-types/package.json +0 -49
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent-loop.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/agent.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/proxy.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/dist/types.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/agent-core/package.json +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/api-registry.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/bedrock-provider.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/cli.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/env-api-keys.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/index.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.generated.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/models.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/oauth.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/amazon-bedrock.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/anthropic.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/azure-openai-responses.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/faux.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/github-copilot-headers.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-gemini-cli.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-shared.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google-vertex.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/google.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/mistral.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-codex-responses.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-completions.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses-shared.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/openai-responses.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/register-builtins.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/simple-options.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/providers/transform-messages.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/stream.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/types.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/types.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/types.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/types.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/event-stream.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/hash.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/json-parse.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/anthropic.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/github-copilot.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-antigravity.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/oauth-page.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/openai-codex.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/pkce.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/oauth/types.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/overflow.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/sanitize-unicode.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/typebox-helpers.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/dist/utils/validation.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/ai/package.json +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/cli.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/cli.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/register-bedrock.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/bun/register-bedrock.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/args.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/args.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/config-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/config-selector.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/file-processor.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/file-processor.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/initial-message.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/list-models.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/list-models.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/session-picker.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli/session-picker.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/cli.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/config.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/agent-session-services.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/bash-executor.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/bash-executor.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/compaction.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/compaction/utils.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/defaults.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/defaults.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/defaults.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/diagnostics.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/diagnostics.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/diagnostics.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/event-bus.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/event-bus.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/exec.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/exec.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/loader.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/types.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/types.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/extensions/wrapper.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/messages.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/messages.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/model-registry.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/model-resolver.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/model-resolver.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/output-guard.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/output-guard.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/package-manager.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/prompt-templates.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/resolve-config-value.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/resource-loader.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/sdk.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/sdk.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/session-cwd.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/session-manager.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/settings-manager.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/skills.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/skills.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/slash-commands.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/slash-commands.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/slash-commands.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/source-info.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/source-info.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/system-prompt.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/system-prompt.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/timings.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/timings.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/bash.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit-diff.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/edit.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/find.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/find.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/grep.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/grep.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/ls.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/ls.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/path-utils.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/read.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/read.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/render-utils.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/truncate.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/core/tools/write.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/main.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/main.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/migrations.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/migrations.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/print-mode.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/print-mode.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/package-manager-cli.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/package-manager-cli.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/changelog.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/changelog.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/child-process.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/child-process.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-image.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard-native.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/clipboard.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/exif-orientation.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/frontmatter.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/git.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/git.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-convert.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-convert.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-resize.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/image-resize.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/mime.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/mime.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/paths.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/paths.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/photon.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/photon.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/shell.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/shell.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/sleep.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/sleep.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/dist/utils/tools-manager.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/coding-agent/package.json +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/autocomplete.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/box.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/cancellable-loader.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/editor.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/image.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/input.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/loader.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/markdown.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/select-list.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/settings-list.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/spacer.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/text.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/components/truncated-text.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/editor-component.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/fuzzy.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/index.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/index.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/index.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/index.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keybindings.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/keys.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/kill-ring.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/stdin-buffer.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal-image.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/terminal.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/tui.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/undo-stack.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.d.ts +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.d.ts.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.js +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/dist/utils.js.map +0 -0
- /package/{node_modules → vendor}/@orient-cli/tui/package.json +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../../src/core/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAKtD,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,wBAAwB,CAAC;AAMtF,QAAA,MAAM,WAAW;;;EAGf,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,8BAA8B;IAC9B,SAAS,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,mCAAmC;IACnC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAOD,MAAM,WAAW,gBAAgB;IAChC,oEAAoE;IACpE,UAAU,CAAC,EAAE,eAAe,CAAC;CAC7B;AA6ID,wBAAgB,yBAAyB,CACxC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,gBAAgB,GACxB,cAAc,CAAC,OAAO,WAAW,EAAE,SAAS,CAAC,CA6F/C;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC,OAAO,WAAW,CAAC,CAEtG;AAED,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB;;;mBAA2C,CAAC;AAC5E,eAAO,MAAM,SAAS;;;QAAiC,CAAC","sourcesContent":["import type { AgentTool } from \"@orient-cli/agent-core\";\nimport { Container, Text } from \"@orient-cli/tui\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { mkdir as fsMkdir, writeFile as fsWriteFile } from \"fs/promises\";\nimport { dirname } from \"path\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.js\";\nimport { getLanguageFromPath, highlightCode } from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.js\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.js\";\nimport { resolveToCwd } from \"./path-utils.js\";\nimport { invalidArgText, normalizeDisplayText, replaceTabs, shortenPath, str } from \"./render-utils.js\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.js\";\n\nconst writeSchema = Type.Object({\n\tpath: Type.String({ description: \"Path to the file to write (relative or absolute)\" }),\n\tcontent: Type.String({ description: \"Content to write to the file\" }),\n});\n\nexport type WriteToolInput = Static<typeof writeSchema>;\n\n/**\n * Pluggable operations for the write tool.\n * Override these to delegate file writing to remote systems (for example SSH).\n */\nexport interface WriteOperations {\n\t/** Write content to a file */\n\twriteFile: (absolutePath: string, content: string) => Promise<void>;\n\t/** Create directory recursively */\n\tmkdir: (dir: string) => Promise<void>;\n}\n\nconst defaultWriteOperations: WriteOperations = {\n\twriteFile: (path, content) => fsWriteFile(path, content, \"utf-8\"),\n\tmkdir: (dir) => fsMkdir(dir, { recursive: true }).then(() => {}),\n};\n\nexport interface WriteToolOptions {\n\t/** Custom operations for file writing. Default: local filesystem */\n\toperations?: WriteOperations;\n}\n\ntype WriteHighlightCache = {\n\trawPath: string | null;\n\tlang: string;\n\trawContent: string;\n\tnormalizedLines: string[];\n\thighlightedLines: string[];\n};\n\nclass WriteCallRenderComponent extends Text {\n\tcache?: WriteHighlightCache;\n\n\tconstructor() {\n\t\tsuper(\"\", 0, 0);\n\t}\n}\n\nconst WRITE_PARTIAL_FULL_HIGHLIGHT_LINES = 50;\n\nfunction highlightSingleLine(line: string, lang: string): string {\n\tconst highlighted = highlightCode(line, lang);\n\treturn highlighted[0] ?? \"\";\n}\n\nfunction refreshWriteHighlightPrefix(cache: WriteHighlightCache): void {\n\tconst prefixCount = Math.min(WRITE_PARTIAL_FULL_HIGHLIGHT_LINES, cache.normalizedLines.length);\n\tif (prefixCount === 0) return;\n\tconst prefixSource = cache.normalizedLines.slice(0, prefixCount).join(\"\\n\");\n\tconst prefixHighlighted = highlightCode(prefixSource, cache.lang);\n\tfor (let i = 0; i < prefixCount; i++) {\n\t\tcache.highlightedLines[i] =\n\t\t\tprefixHighlighted[i] ?? highlightSingleLine(cache.normalizedLines[i] ?? \"\", cache.lang);\n\t}\n}\n\nfunction rebuildWriteHighlightCacheFull(rawPath: string | null, fileContent: string): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tconst displayContent = normalizeDisplayText(fileContent);\n\tconst normalized = replaceTabs(displayContent);\n\treturn {\n\t\trawPath,\n\t\tlang,\n\t\trawContent: fileContent,\n\t\tnormalizedLines: normalized.split(\"\\n\"),\n\t\thighlightedLines: highlightCode(normalized, lang),\n\t};\n}\n\nfunction updateWriteHighlightCacheIncremental(\n\tcache: WriteHighlightCache | undefined,\n\trawPath: string | null,\n\tfileContent: string,\n): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tif (!cache) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (cache.lang !== lang || cache.rawPath !== rawPath) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (!fileContent.startsWith(cache.rawContent)) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (fileContent.length === cache.rawContent.length) return cache;\n\n\tconst deltaRaw = fileContent.slice(cache.rawContent.length);\n\tconst deltaDisplay = normalizeDisplayText(deltaRaw);\n\tconst deltaNormalized = replaceTabs(deltaDisplay);\n\tcache.rawContent = fileContent;\n\tif (cache.normalizedLines.length === 0) {\n\t\tcache.normalizedLines.push(\"\");\n\t\tcache.highlightedLines.push(\"\");\n\t}\n\n\tconst segments = deltaNormalized.split(\"\\n\");\n\tconst lastIndex = cache.normalizedLines.length - 1;\n\tcache.normalizedLines[lastIndex] += segments[0];\n\tcache.highlightedLines[lastIndex] = highlightSingleLine(cache.normalizedLines[lastIndex], cache.lang);\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tcache.normalizedLines.push(segments[i]);\n\t\tcache.highlightedLines.push(highlightSingleLine(segments[i], cache.lang));\n\t}\n\trefreshWriteHighlightPrefix(cache);\n\treturn cache;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction formatWriteCall(\n\targs: { path?: string; file_path?: string; content?: string } | undefined,\n\toptions: ToolRenderResultOptions,\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.js\").theme,\n\tcache: WriteHighlightCache | undefined,\n): string {\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tconst fileContent = str(args?.content);\n\tconst path = rawPath !== null ? shortenPath(rawPath) : null;\n\tconst invalidArg = invalidArgText(theme);\n\tlet text = `${theme.fg(\"toolTitle\", theme.bold(\"write\"))} ${path === null ? invalidArg : path ? theme.fg(\"accent\", path) : theme.fg(\"toolOutput\", \"...\")}`;\n\n\tif (fileContent === null) {\n\t\ttext += `\\n\\n${theme.fg(\"error\", \"[invalid content arg - expected string]\")}`;\n\t} else if (fileContent) {\n\t\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\t\tconst renderedLines = lang\n\t\t\t? (cache?.highlightedLines ?? highlightCode(replaceTabs(normalizeDisplayText(fileContent)), lang))\n\t\t\t: normalizeDisplayText(fileContent).split(\"\\n\");\n\t\tconst lines = trimTrailingEmptyLines(renderedLines);\n\t\tconst totalLines = lines.length;\n\t\tconst maxLines = options.expanded ? lines.length : 10;\n\t\tconst displayLines = lines.slice(0, maxLines);\n\t\tconst remaining = lines.length - maxLines;\n\t\ttext += `\\n\\n${displayLines.map((line) => (lang ? line : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines, ${totalLines} total,`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t}\n\t}\n\n\treturn text;\n}\n\nfunction formatWriteResult(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError?: boolean },\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.js\").theme,\n): string | undefined {\n\tif (!result.isError) {\n\t\treturn undefined;\n\t}\n\tconst output = result.content\n\t\t.filter((c) => c.type === \"text\")\n\t\t.map((c) => c.text || \"\")\n\t\t.join(\"\\n\");\n\tif (!output) {\n\t\treturn undefined;\n\t}\n\treturn `\\n${theme.fg(\"error\", output)}`;\n}\n\nexport function createWriteToolDefinition(\n\tcwd: string,\n\toptions?: WriteToolOptions,\n): ToolDefinition<typeof writeSchema, undefined> {\n\tconst ops = options?.operations ?? defaultWriteOperations;\n\treturn {\n\t\tname: \"write\",\n\t\tlabel: \"write\",\n\t\tdescription:\n\t\t\t\"Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.\",\n\t\tpromptSnippet: \"Create or overwrite files\",\n\t\tpromptGuidelines: [\"Use write only for new files or complete rewrites.\"],\n\t\tparameters: writeSchema,\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ path, content }: { path: string; content: string },\n\t\t\tsignal?: AbortSignal,\n\t\t\t_onUpdate?,\n\t\t\t_ctx?,\n\t\t) {\n\t\t\tconst absolutePath = resolveToCwd(path, cwd);\n\t\t\tconst dir = dirname(absolutePath);\n\t\t\treturn withFileMutationQueue(\n\t\t\t\tabsolutePath,\n\t\t\t\t() =>\n\t\t\t\t\tnew Promise<{ content: Array<{ type: \"text\"; text: string }>; details: undefined }>(\n\t\t\t\t\t\t(resolve, reject) => {\n\t\t\t\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet aborted = false;\n\t\t\t\t\t\t\tconst onAbort = () => {\n\t\t\t\t\t\t\t\taborted = true;\n\t\t\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t// Create parent directories if needed.\n\t\t\t\t\t\t\t\t\tawait ops.mkdir(dir);\n\t\t\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\t\t\t// Write the file contents.\n\t\t\t\t\t\t\t\t\tawait ops.writeFile(absolutePath, content);\n\t\t\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t\t\t\t\t{ type: \"text\", text: `Successfully wrote ${content.length} bytes to ${path}` },\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tdetails: undefined,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} catch (error: any) {\n\t\t\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\t\t\tif (!aborted) reject(error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})();\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t);\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst renderArgs = args as { path?: string; file_path?: string; content?: string } | undefined;\n\t\t\tconst rawPath = str(renderArgs?.file_path ?? renderArgs?.path);\n\t\t\tconst fileContent = str(renderArgs?.content);\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as WriteCallRenderComponent | undefined) ?? new WriteCallRenderComponent();\n\t\t\tif (fileContent !== null) {\n\t\t\t\tcomponent.cache = context.argsComplete\n\t\t\t\t\t? rebuildWriteHighlightCacheFull(rawPath, fileContent)\n\t\t\t\t\t: updateWriteHighlightCacheIncremental(component.cache, rawPath, fileContent);\n\t\t\t} else {\n\t\t\t\tcomponent.cache = undefined;\n\t\t\t}\n\t\t\tcomponent.setText(\n\t\t\t\tformatWriteCall(\n\t\t\t\t\trenderArgs,\n\t\t\t\t\t{ expanded: context.expanded, isPartial: context.isPartial },\n\t\t\t\t\ttheme,\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn component;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatWriteResult({ ...result, isError: context.isError }, theme);\n\t\t\tif (!output) {\n\t\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\t\tcomponent.clear();\n\t\t\t\treturn component;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(output);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema> {\n\treturn wrapToolDefinition(createWriteToolDefinition(cwd, options));\n}\n\n/** Default write tool using process.cwd() for backwards compatibility. */\nexport const writeToolDefinition = createWriteToolDefinition(process.cwd());\nexport const writeTool = createWriteTool(process.cwd());\n"]}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { Container, Text } from "@orient-cli/tui";
|
|
2
|
-
import { Type } from "@sinclair/typebox";
|
|
3
|
-
import { mkdir as fsMkdir, writeFile as fsWriteFile } from "fs/promises";
|
|
4
|
-
import { dirname } from "path";
|
|
5
|
-
import { keyHint } from "../../modes/interactive/components/keybinding-hints.js";
|
|
6
|
-
import { getLanguageFromPath, highlightCode } from "../../modes/interactive/theme/theme.js";
|
|
7
|
-
import { withFileMutationQueue } from "./file-mutation-queue.js";
|
|
8
|
-
import { resolveToCwd } from "./path-utils.js";
|
|
9
|
-
import { invalidArgText, normalizeDisplayText, replaceTabs, shortenPath, str } from "./render-utils.js";
|
|
10
|
-
import { wrapToolDefinition } from "./tool-definition-wrapper.js";
|
|
11
|
-
const writeSchema = Type.Object({
|
|
12
|
-
path: Type.String({ description: "Path to the file to write (relative or absolute)" }),
|
|
13
|
-
content: Type.String({ description: "Content to write to the file" }),
|
|
14
|
-
});
|
|
15
|
-
const defaultWriteOperations = {
|
|
16
|
-
writeFile: (path, content) => fsWriteFile(path, content, "utf-8"),
|
|
17
|
-
mkdir: (dir) => fsMkdir(dir, { recursive: true }).then(() => { }),
|
|
18
|
-
};
|
|
19
|
-
class WriteCallRenderComponent extends Text {
|
|
20
|
-
cache;
|
|
21
|
-
constructor() {
|
|
22
|
-
super("", 0, 0);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
const WRITE_PARTIAL_FULL_HIGHLIGHT_LINES = 50;
|
|
26
|
-
function highlightSingleLine(line, lang) {
|
|
27
|
-
const highlighted = highlightCode(line, lang);
|
|
28
|
-
return highlighted[0] ?? "";
|
|
29
|
-
}
|
|
30
|
-
function refreshWriteHighlightPrefix(cache) {
|
|
31
|
-
const prefixCount = Math.min(WRITE_PARTIAL_FULL_HIGHLIGHT_LINES, cache.normalizedLines.length);
|
|
32
|
-
if (prefixCount === 0)
|
|
33
|
-
return;
|
|
34
|
-
const prefixSource = cache.normalizedLines.slice(0, prefixCount).join("\n");
|
|
35
|
-
const prefixHighlighted = highlightCode(prefixSource, cache.lang);
|
|
36
|
-
for (let i = 0; i < prefixCount; i++) {
|
|
37
|
-
cache.highlightedLines[i] =
|
|
38
|
-
prefixHighlighted[i] ?? highlightSingleLine(cache.normalizedLines[i] ?? "", cache.lang);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function rebuildWriteHighlightCacheFull(rawPath, fileContent) {
|
|
42
|
-
const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
|
|
43
|
-
if (!lang)
|
|
44
|
-
return undefined;
|
|
45
|
-
const displayContent = normalizeDisplayText(fileContent);
|
|
46
|
-
const normalized = replaceTabs(displayContent);
|
|
47
|
-
return {
|
|
48
|
-
rawPath,
|
|
49
|
-
lang,
|
|
50
|
-
rawContent: fileContent,
|
|
51
|
-
normalizedLines: normalized.split("\n"),
|
|
52
|
-
highlightedLines: highlightCode(normalized, lang),
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function updateWriteHighlightCacheIncremental(cache, rawPath, fileContent) {
|
|
56
|
-
const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
|
|
57
|
-
if (!lang)
|
|
58
|
-
return undefined;
|
|
59
|
-
if (!cache)
|
|
60
|
-
return rebuildWriteHighlightCacheFull(rawPath, fileContent);
|
|
61
|
-
if (cache.lang !== lang || cache.rawPath !== rawPath)
|
|
62
|
-
return rebuildWriteHighlightCacheFull(rawPath, fileContent);
|
|
63
|
-
if (!fileContent.startsWith(cache.rawContent))
|
|
64
|
-
return rebuildWriteHighlightCacheFull(rawPath, fileContent);
|
|
65
|
-
if (fileContent.length === cache.rawContent.length)
|
|
66
|
-
return cache;
|
|
67
|
-
const deltaRaw = fileContent.slice(cache.rawContent.length);
|
|
68
|
-
const deltaDisplay = normalizeDisplayText(deltaRaw);
|
|
69
|
-
const deltaNormalized = replaceTabs(deltaDisplay);
|
|
70
|
-
cache.rawContent = fileContent;
|
|
71
|
-
if (cache.normalizedLines.length === 0) {
|
|
72
|
-
cache.normalizedLines.push("");
|
|
73
|
-
cache.highlightedLines.push("");
|
|
74
|
-
}
|
|
75
|
-
const segments = deltaNormalized.split("\n");
|
|
76
|
-
const lastIndex = cache.normalizedLines.length - 1;
|
|
77
|
-
cache.normalizedLines[lastIndex] += segments[0];
|
|
78
|
-
cache.highlightedLines[lastIndex] = highlightSingleLine(cache.normalizedLines[lastIndex], cache.lang);
|
|
79
|
-
for (let i = 1; i < segments.length; i++) {
|
|
80
|
-
cache.normalizedLines.push(segments[i]);
|
|
81
|
-
cache.highlightedLines.push(highlightSingleLine(segments[i], cache.lang));
|
|
82
|
-
}
|
|
83
|
-
refreshWriteHighlightPrefix(cache);
|
|
84
|
-
return cache;
|
|
85
|
-
}
|
|
86
|
-
function trimTrailingEmptyLines(lines) {
|
|
87
|
-
let end = lines.length;
|
|
88
|
-
while (end > 0 && lines[end - 1] === "") {
|
|
89
|
-
end--;
|
|
90
|
-
}
|
|
91
|
-
return lines.slice(0, end);
|
|
92
|
-
}
|
|
93
|
-
function formatWriteCall(args, options, theme, cache) {
|
|
94
|
-
const rawPath = str(args?.file_path ?? args?.path);
|
|
95
|
-
const fileContent = str(args?.content);
|
|
96
|
-
const path = rawPath !== null ? shortenPath(rawPath) : null;
|
|
97
|
-
const invalidArg = invalidArgText(theme);
|
|
98
|
-
let text = `${theme.fg("toolTitle", theme.bold("write"))} ${path === null ? invalidArg : path ? theme.fg("accent", path) : theme.fg("toolOutput", "...")}`;
|
|
99
|
-
if (fileContent === null) {
|
|
100
|
-
text += `\n\n${theme.fg("error", "[invalid content arg - expected string]")}`;
|
|
101
|
-
}
|
|
102
|
-
else if (fileContent) {
|
|
103
|
-
const lang = rawPath ? getLanguageFromPath(rawPath) : undefined;
|
|
104
|
-
const renderedLines = lang
|
|
105
|
-
? (cache?.highlightedLines ?? highlightCode(replaceTabs(normalizeDisplayText(fileContent)), lang))
|
|
106
|
-
: normalizeDisplayText(fileContent).split("\n");
|
|
107
|
-
const lines = trimTrailingEmptyLines(renderedLines);
|
|
108
|
-
const totalLines = lines.length;
|
|
109
|
-
const maxLines = options.expanded ? lines.length : 10;
|
|
110
|
-
const displayLines = lines.slice(0, maxLines);
|
|
111
|
-
const remaining = lines.length - maxLines;
|
|
112
|
-
text += `\n\n${displayLines.map((line) => (lang ? line : theme.fg("toolOutput", replaceTabs(line)))).join("\n")}`;
|
|
113
|
-
if (remaining > 0) {
|
|
114
|
-
text += `${theme.fg("muted", `\n... (${remaining} more lines, ${totalLines} total,`)} ${keyHint("app.tools.expand", "to expand")})`;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return text;
|
|
118
|
-
}
|
|
119
|
-
function formatWriteResult(result, theme) {
|
|
120
|
-
if (!result.isError) {
|
|
121
|
-
return undefined;
|
|
122
|
-
}
|
|
123
|
-
const output = result.content
|
|
124
|
-
.filter((c) => c.type === "text")
|
|
125
|
-
.map((c) => c.text || "")
|
|
126
|
-
.join("\n");
|
|
127
|
-
if (!output) {
|
|
128
|
-
return undefined;
|
|
129
|
-
}
|
|
130
|
-
return `\n${theme.fg("error", output)}`;
|
|
131
|
-
}
|
|
132
|
-
export function createWriteToolDefinition(cwd, options) {
|
|
133
|
-
const ops = options?.operations ?? defaultWriteOperations;
|
|
134
|
-
return {
|
|
135
|
-
name: "write",
|
|
136
|
-
label: "write",
|
|
137
|
-
description: "Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.",
|
|
138
|
-
promptSnippet: "Create or overwrite files",
|
|
139
|
-
promptGuidelines: ["Use write only for new files or complete rewrites."],
|
|
140
|
-
parameters: writeSchema,
|
|
141
|
-
async execute(_toolCallId, { path, content }, signal, _onUpdate, _ctx) {
|
|
142
|
-
const absolutePath = resolveToCwd(path, cwd);
|
|
143
|
-
const dir = dirname(absolutePath);
|
|
144
|
-
return withFileMutationQueue(absolutePath, () => new Promise((resolve, reject) => {
|
|
145
|
-
if (signal?.aborted) {
|
|
146
|
-
reject(new Error("Operation aborted"));
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
let aborted = false;
|
|
150
|
-
const onAbort = () => {
|
|
151
|
-
aborted = true;
|
|
152
|
-
reject(new Error("Operation aborted"));
|
|
153
|
-
};
|
|
154
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
155
|
-
(async () => {
|
|
156
|
-
try {
|
|
157
|
-
// Create parent directories if needed.
|
|
158
|
-
await ops.mkdir(dir);
|
|
159
|
-
if (aborted)
|
|
160
|
-
return;
|
|
161
|
-
// Write the file contents.
|
|
162
|
-
await ops.writeFile(absolutePath, content);
|
|
163
|
-
if (aborted)
|
|
164
|
-
return;
|
|
165
|
-
signal?.removeEventListener("abort", onAbort);
|
|
166
|
-
resolve({
|
|
167
|
-
content: [
|
|
168
|
-
{ type: "text", text: `Successfully wrote ${content.length} bytes to ${path}` },
|
|
169
|
-
],
|
|
170
|
-
details: undefined,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
catch (error) {
|
|
174
|
-
signal?.removeEventListener("abort", onAbort);
|
|
175
|
-
if (!aborted)
|
|
176
|
-
reject(error);
|
|
177
|
-
}
|
|
178
|
-
})();
|
|
179
|
-
}));
|
|
180
|
-
},
|
|
181
|
-
renderCall(args, theme, context) {
|
|
182
|
-
const renderArgs = args;
|
|
183
|
-
const rawPath = str(renderArgs?.file_path ?? renderArgs?.path);
|
|
184
|
-
const fileContent = str(renderArgs?.content);
|
|
185
|
-
const component = context.lastComponent ?? new WriteCallRenderComponent();
|
|
186
|
-
if (fileContent !== null) {
|
|
187
|
-
component.cache = context.argsComplete
|
|
188
|
-
? rebuildWriteHighlightCacheFull(rawPath, fileContent)
|
|
189
|
-
: updateWriteHighlightCacheIncremental(component.cache, rawPath, fileContent);
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
component.cache = undefined;
|
|
193
|
-
}
|
|
194
|
-
component.setText(formatWriteCall(renderArgs, { expanded: context.expanded, isPartial: context.isPartial }, theme, component.cache));
|
|
195
|
-
return component;
|
|
196
|
-
},
|
|
197
|
-
renderResult(result, _options, theme, context) {
|
|
198
|
-
const output = formatWriteResult({ ...result, isError: context.isError }, theme);
|
|
199
|
-
if (!output) {
|
|
200
|
-
const component = context.lastComponent ?? new Container();
|
|
201
|
-
component.clear();
|
|
202
|
-
return component;
|
|
203
|
-
}
|
|
204
|
-
const text = context.lastComponent ?? new Text("", 0, 0);
|
|
205
|
-
text.setText(output);
|
|
206
|
-
return text;
|
|
207
|
-
},
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
export function createWriteTool(cwd, options) {
|
|
211
|
-
return wrapToolDefinition(createWriteToolDefinition(cwd, options));
|
|
212
|
-
}
|
|
213
|
-
/** Default write tool using process.cwd() for backwards compatibility. */
|
|
214
|
-
export const writeToolDefinition = createWriteToolDefinition(process.cwd());
|
|
215
|
-
export const writeTool = createWriteTool(process.cwd());
|
|
216
|
-
//# sourceMappingURL=write.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../../src/core/tools/write.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,SAAS,IAAI,WAAW,EA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D,SAAS,CAAC,OAAO,CAChB,eAAe,CACd,UAAU,EACV,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,EAC5D,KAAK,EACL,SAAS,CAAC,KAAK,CACf,CACD,CAAC;YACF,OAAO,SAAS,CAAC;QAAA,CACjB;QACD,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE;YAC9C,MAAM,MAAM,GAAG,iBAAiB,CAAC,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;YACjF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACb,MAAM,SAAS,GAAI,OAAO,CAAC,aAAuC,IAAI,IAAI,SAAS,EAAE,CAAC;gBACtF,SAAS,CAAC,KAAK,EAAE,CAAC;gBAClB,OAAO,SAAS,CAAC;YAClB,CAAC;YACD,MAAM,IAAI,GAAI,OAAO,CAAC,aAAkC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC/E,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACrB,OAAO,IAAI,CAAC;QAAA,CACZ;KACD,CAAC;AAAA,CACF;AAED,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,OAA0B,EAAiC;IACvG,OAAO,kBAAkB,CAAC,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;AAAA,CACnE;AAED,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC","sourcesContent":["import type { AgentTool } from \"@orient-cli/agent-core\";\nimport { Container, Text } from \"@orient-cli/tui\";\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { mkdir as fsMkdir, writeFile as fsWriteFile } from \"fs/promises\";\nimport { dirname } from \"path\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.js\";\nimport { getLanguageFromPath, highlightCode } from \"../../modes/interactive/theme/theme.js\";\nimport type { ToolDefinition, ToolRenderResultOptions } from \"../extensions/types.js\";\nimport { withFileMutationQueue } from \"./file-mutation-queue.js\";\nimport { resolveToCwd } from \"./path-utils.js\";\nimport { invalidArgText, normalizeDisplayText, replaceTabs, shortenPath, str } from \"./render-utils.js\";\nimport { wrapToolDefinition } from \"./tool-definition-wrapper.js\";\n\nconst writeSchema = Type.Object({\n\tpath: Type.String({ description: \"Path to the file to write (relative or absolute)\" }),\n\tcontent: Type.String({ description: \"Content to write to the file\" }),\n});\n\nexport type WriteToolInput = Static<typeof writeSchema>;\n\n/**\n * Pluggable operations for the write tool.\n * Override these to delegate file writing to remote systems (for example SSH).\n */\nexport interface WriteOperations {\n\t/** Write content to a file */\n\twriteFile: (absolutePath: string, content: string) => Promise<void>;\n\t/** Create directory recursively */\n\tmkdir: (dir: string) => Promise<void>;\n}\n\nconst defaultWriteOperations: WriteOperations = {\n\twriteFile: (path, content) => fsWriteFile(path, content, \"utf-8\"),\n\tmkdir: (dir) => fsMkdir(dir, { recursive: true }).then(() => {}),\n};\n\nexport interface WriteToolOptions {\n\t/** Custom operations for file writing. Default: local filesystem */\n\toperations?: WriteOperations;\n}\n\ntype WriteHighlightCache = {\n\trawPath: string | null;\n\tlang: string;\n\trawContent: string;\n\tnormalizedLines: string[];\n\thighlightedLines: string[];\n};\n\nclass WriteCallRenderComponent extends Text {\n\tcache?: WriteHighlightCache;\n\n\tconstructor() {\n\t\tsuper(\"\", 0, 0);\n\t}\n}\n\nconst WRITE_PARTIAL_FULL_HIGHLIGHT_LINES = 50;\n\nfunction highlightSingleLine(line: string, lang: string): string {\n\tconst highlighted = highlightCode(line, lang);\n\treturn highlighted[0] ?? \"\";\n}\n\nfunction refreshWriteHighlightPrefix(cache: WriteHighlightCache): void {\n\tconst prefixCount = Math.min(WRITE_PARTIAL_FULL_HIGHLIGHT_LINES, cache.normalizedLines.length);\n\tif (prefixCount === 0) return;\n\tconst prefixSource = cache.normalizedLines.slice(0, prefixCount).join(\"\\n\");\n\tconst prefixHighlighted = highlightCode(prefixSource, cache.lang);\n\tfor (let i = 0; i < prefixCount; i++) {\n\t\tcache.highlightedLines[i] =\n\t\t\tprefixHighlighted[i] ?? highlightSingleLine(cache.normalizedLines[i] ?? \"\", cache.lang);\n\t}\n}\n\nfunction rebuildWriteHighlightCacheFull(rawPath: string | null, fileContent: string): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tconst displayContent = normalizeDisplayText(fileContent);\n\tconst normalized = replaceTabs(displayContent);\n\treturn {\n\t\trawPath,\n\t\tlang,\n\t\trawContent: fileContent,\n\t\tnormalizedLines: normalized.split(\"\\n\"),\n\t\thighlightedLines: highlightCode(normalized, lang),\n\t};\n}\n\nfunction updateWriteHighlightCacheIncremental(\n\tcache: WriteHighlightCache | undefined,\n\trawPath: string | null,\n\tfileContent: string,\n): WriteHighlightCache | undefined {\n\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\tif (!lang) return undefined;\n\tif (!cache) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (cache.lang !== lang || cache.rawPath !== rawPath) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (!fileContent.startsWith(cache.rawContent)) return rebuildWriteHighlightCacheFull(rawPath, fileContent);\n\tif (fileContent.length === cache.rawContent.length) return cache;\n\n\tconst deltaRaw = fileContent.slice(cache.rawContent.length);\n\tconst deltaDisplay = normalizeDisplayText(deltaRaw);\n\tconst deltaNormalized = replaceTabs(deltaDisplay);\n\tcache.rawContent = fileContent;\n\tif (cache.normalizedLines.length === 0) {\n\t\tcache.normalizedLines.push(\"\");\n\t\tcache.highlightedLines.push(\"\");\n\t}\n\n\tconst segments = deltaNormalized.split(\"\\n\");\n\tconst lastIndex = cache.normalizedLines.length - 1;\n\tcache.normalizedLines[lastIndex] += segments[0];\n\tcache.highlightedLines[lastIndex] = highlightSingleLine(cache.normalizedLines[lastIndex], cache.lang);\n\tfor (let i = 1; i < segments.length; i++) {\n\t\tcache.normalizedLines.push(segments[i]);\n\t\tcache.highlightedLines.push(highlightSingleLine(segments[i], cache.lang));\n\t}\n\trefreshWriteHighlightPrefix(cache);\n\treturn cache;\n}\n\nfunction trimTrailingEmptyLines(lines: string[]): string[] {\n\tlet end = lines.length;\n\twhile (end > 0 && lines[end - 1] === \"\") {\n\t\tend--;\n\t}\n\treturn lines.slice(0, end);\n}\n\nfunction formatWriteCall(\n\targs: { path?: string; file_path?: string; content?: string } | undefined,\n\toptions: ToolRenderResultOptions,\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.js\").theme,\n\tcache: WriteHighlightCache | undefined,\n): string {\n\tconst rawPath = str(args?.file_path ?? args?.path);\n\tconst fileContent = str(args?.content);\n\tconst path = rawPath !== null ? shortenPath(rawPath) : null;\n\tconst invalidArg = invalidArgText(theme);\n\tlet text = `${theme.fg(\"toolTitle\", theme.bold(\"write\"))} ${path === null ? invalidArg : path ? theme.fg(\"accent\", path) : theme.fg(\"toolOutput\", \"...\")}`;\n\n\tif (fileContent === null) {\n\t\ttext += `\\n\\n${theme.fg(\"error\", \"[invalid content arg - expected string]\")}`;\n\t} else if (fileContent) {\n\t\tconst lang = rawPath ? getLanguageFromPath(rawPath) : undefined;\n\t\tconst renderedLines = lang\n\t\t\t? (cache?.highlightedLines ?? highlightCode(replaceTabs(normalizeDisplayText(fileContent)), lang))\n\t\t\t: normalizeDisplayText(fileContent).split(\"\\n\");\n\t\tconst lines = trimTrailingEmptyLines(renderedLines);\n\t\tconst totalLines = lines.length;\n\t\tconst maxLines = options.expanded ? lines.length : 10;\n\t\tconst displayLines = lines.slice(0, maxLines);\n\t\tconst remaining = lines.length - maxLines;\n\t\ttext += `\\n\\n${displayLines.map((line) => (lang ? line : theme.fg(\"toolOutput\", replaceTabs(line)))).join(\"\\n\")}`;\n\t\tif (remaining > 0) {\n\t\t\ttext += `${theme.fg(\"muted\", `\\n... (${remaining} more lines, ${totalLines} total,`)} ${keyHint(\"app.tools.expand\", \"to expand\")})`;\n\t\t}\n\t}\n\n\treturn text;\n}\n\nfunction formatWriteResult(\n\tresult: { content: Array<{ type: string; text?: string; data?: string; mimeType?: string }>; isError?: boolean },\n\ttheme: typeof import(\"../../modes/interactive/theme/theme.js\").theme,\n): string | undefined {\n\tif (!result.isError) {\n\t\treturn undefined;\n\t}\n\tconst output = result.content\n\t\t.filter((c) => c.type === \"text\")\n\t\t.map((c) => c.text || \"\")\n\t\t.join(\"\\n\");\n\tif (!output) {\n\t\treturn undefined;\n\t}\n\treturn `\\n${theme.fg(\"error\", output)}`;\n}\n\nexport function createWriteToolDefinition(\n\tcwd: string,\n\toptions?: WriteToolOptions,\n): ToolDefinition<typeof writeSchema, undefined> {\n\tconst ops = options?.operations ?? defaultWriteOperations;\n\treturn {\n\t\tname: \"write\",\n\t\tlabel: \"write\",\n\t\tdescription:\n\t\t\t\"Write content to a file. Creates the file if it doesn't exist, overwrites if it does. Automatically creates parent directories.\",\n\t\tpromptSnippet: \"Create or overwrite files\",\n\t\tpromptGuidelines: [\"Use write only for new files or complete rewrites.\"],\n\t\tparameters: writeSchema,\n\t\tasync execute(\n\t\t\t_toolCallId,\n\t\t\t{ path, content }: { path: string; content: string },\n\t\t\tsignal?: AbortSignal,\n\t\t\t_onUpdate?,\n\t\t\t_ctx?,\n\t\t) {\n\t\t\tconst absolutePath = resolveToCwd(path, cwd);\n\t\t\tconst dir = dirname(absolutePath);\n\t\t\treturn withFileMutationQueue(\n\t\t\t\tabsolutePath,\n\t\t\t\t() =>\n\t\t\t\t\tnew Promise<{ content: Array<{ type: \"text\"; text: string }>; details: undefined }>(\n\t\t\t\t\t\t(resolve, reject) => {\n\t\t\t\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet aborted = false;\n\t\t\t\t\t\t\tconst onAbort = () => {\n\t\t\t\t\t\t\t\taborted = true;\n\t\t\t\t\t\t\t\treject(new Error(\"Operation aborted\"));\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsignal?.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t// Create parent directories if needed.\n\t\t\t\t\t\t\t\t\tawait ops.mkdir(dir);\n\t\t\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\t\t\t// Write the file contents.\n\t\t\t\t\t\t\t\t\tawait ops.writeFile(absolutePath, content);\n\t\t\t\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\t\t\tresolve({\n\t\t\t\t\t\t\t\t\t\tcontent: [\n\t\t\t\t\t\t\t\t\t\t\t{ type: \"text\", text: `Successfully wrote ${content.length} bytes to ${path}` },\n\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\tdetails: undefined,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t} catch (error: any) {\n\t\t\t\t\t\t\t\t\tsignal?.removeEventListener(\"abort\", onAbort);\n\t\t\t\t\t\t\t\t\tif (!aborted) reject(error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})();\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t);\n\t\t},\n\t\trenderCall(args, theme, context) {\n\t\t\tconst renderArgs = args as { path?: string; file_path?: string; content?: string } | undefined;\n\t\t\tconst rawPath = str(renderArgs?.file_path ?? renderArgs?.path);\n\t\t\tconst fileContent = str(renderArgs?.content);\n\t\t\tconst component =\n\t\t\t\t(context.lastComponent as WriteCallRenderComponent | undefined) ?? new WriteCallRenderComponent();\n\t\t\tif (fileContent !== null) {\n\t\t\t\tcomponent.cache = context.argsComplete\n\t\t\t\t\t? rebuildWriteHighlightCacheFull(rawPath, fileContent)\n\t\t\t\t\t: updateWriteHighlightCacheIncremental(component.cache, rawPath, fileContent);\n\t\t\t} else {\n\t\t\t\tcomponent.cache = undefined;\n\t\t\t}\n\t\t\tcomponent.setText(\n\t\t\t\tformatWriteCall(\n\t\t\t\t\trenderArgs,\n\t\t\t\t\t{ expanded: context.expanded, isPartial: context.isPartial },\n\t\t\t\t\ttheme,\n\t\t\t\t\tcomponent.cache,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn component;\n\t\t},\n\t\trenderResult(result, _options, theme, context) {\n\t\t\tconst output = formatWriteResult({ ...result, isError: context.isError }, theme);\n\t\t\tif (!output) {\n\t\t\t\tconst component = (context.lastComponent as Container | undefined) ?? new Container();\n\t\t\t\tcomponent.clear();\n\t\t\t\treturn component;\n\t\t\t}\n\t\t\tconst text = (context.lastComponent as Text | undefined) ?? new Text(\"\", 0, 0);\n\t\t\ttext.setText(output);\n\t\t\treturn text;\n\t\t},\n\t};\n}\n\nexport function createWriteTool(cwd: string, options?: WriteToolOptions): AgentTool<typeof writeSchema> {\n\treturn wrapToolDefinition(createWriteToolDefinition(cwd, options));\n}\n\n/** Default write tool using process.cwd() for backwards compatibility. */\nexport const writeToolDefinition = createWriteToolDefinition(process.cwd());\nexport const writeTool = createWriteTool(process.cwd());\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB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B,EACtB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,UAAU,EACV,UAAU,EACV,wBAAwB,EACxB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,KAAK,oBAAoB,GACzB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,EACL,KAAK,UAAU,GACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.js\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.js\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.js\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.js\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.js\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.js\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.js\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.js\";\nexport { convertToLlm } from \"./core/messages.js\";\nexport { ModelRegistry } from \"./core/model-registry.js\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.js\";\nexport { DefaultPackageManager } from \"./core/package-manager.js\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.js\";\nexport { DefaultResourceLoader } from \"./core/resource-loader.js\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n\t// Pre-built tools (use process.cwd())\n\treadOnlyTools,\n} from \"./core/sdk.js\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildSessionContext,\n\ttype CompactionEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.js\";\nexport {\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n} from \"./core/settings-manager.js\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.js\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.js\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tbashTool,\n\tbashToolDefinition,\n\tcodingTools,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\teditTool,\n\teditToolDefinition,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tfindTool,\n\tfindToolDefinition,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\tgrepTool,\n\tgrepToolDefinition,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\tlsTool,\n\tlsToolDefinition,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\treadTool,\n\treadToolDefinition,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n\twriteTool,\n\twriteToolDefinition,\n} from \"./core/tools/index.js\";\n// Main entry point\nexport { main } from \"./main.js\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype PrintModeOptions,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.js\";\n// UI components for extensions\nexport {\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.js\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.js\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.js\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.js\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.js\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA+ZH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,iBAoTxC","sourcesContent":["/**\n * Main entry point for the coding agent CLI.\n *\n * This file handles CLI argument parsing and translates them into\n * createAgentSession() options. The SDK does the heavy lifting.\n */\n\nimport { resolve } from \"node:path\";\nimport { createInterface } from \"node:readline\";\nimport { type ImageContent, modelsAreEqual, supportsXhigh } from \"@orient-cli/ai\";\nimport { ProcessTerminal, setKeybindings, TUI } from \"@orient-cli/tui\";\nimport chalk from \"chalk\";\nimport { type Args, type Mode, parseArgs, printHelp } from \"./cli/args.js\";\nimport { processFileArguments } from \"./cli/file-processor.js\";\nimport { buildInitialMessage } from \"./cli/initial-message.js\";\nimport { listModels } from \"./cli/list-models.js\";\nimport { selectSession } from \"./cli/session-picker.js\";\nimport { getAgentDir, getModelsPath, VERSION } from \"./config.js\";\nimport { type CreateAgentSessionRuntimeFactory, createAgentSessionRuntime } from \"./core/agent-session-runtime.js\";\nimport {\n\ttype AgentSessionRuntimeDiagnostic,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionServices,\n} from \"./core/agent-session-services.js\";\nimport { AuthStorage } from \"./core/auth-storage.js\";\nimport { exportFromFile } from \"./core/export-html/index.js\";\nimport { KeybindingsManager } from \"./core/keybindings.js\";\nimport type { ModelRegistry } from \"./core/model-registry.js\";\nimport { resolveCliModel, resolveModelScope, type ScopedModel } from \"./core/model-resolver.js\";\nimport { restoreStdout, takeOverStdout } from \"./core/output-guard.js\";\nimport type { CreateAgentSessionOptions } from \"./core/sdk.js\";\nimport {\n\tformatMissingSessionCwdPrompt,\n\tgetMissingSessionCwdIssue,\n\tMissingSessionCwdError,\n\ttype SessionCwdIssue,\n} from \"./core/session-cwd.js\";\nimport { SessionManager } from \"./core/session-manager.js\";\nimport { SettingsManager } from \"./core/settings-manager.js\";\nimport { printTimings, resetTimings, time } from \"./core/timings.js\";\nimport { allTools } from \"./core/tools/index.js\";\nimport { runMigrations, showDeprecationWarnings } from \"./migrations.js\";\nimport { InteractiveMode, runPrintMode, runRpcMode } from \"./modes/index.js\";\nimport { ExtensionSelectorComponent } from \"./modes/interactive/components/extension-selector.js\";\nimport { initTheme, stopThemeWatcher } from \"./modes/interactive/theme/theme.js\";\nimport { handleConfigCommand, handlePackageCommand } from \"./package-manager-cli.js\";\nimport { isLocalPath } from \"./utils/paths.js\";\n\n/**\n * Read all content from piped stdin.\n * Returns undefined if stdin is a TTY (interactive terminal).\n */\nasync function readPipedStdin(): Promise<string | undefined> {\n\t// If stdin is a TTY, we're running interactively - don't read stdin\n\tif (process.stdin.isTTY) {\n\t\treturn undefined;\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tlet data = \"\";\n\t\tprocess.stdin.setEncoding(\"utf8\");\n\t\tprocess.stdin.on(\"data\", (chunk) => {\n\t\t\tdata += chunk;\n\t\t});\n\t\tprocess.stdin.on(\"end\", () => {\n\t\t\tresolve(data.trim() || undefined);\n\t\t});\n\t\tprocess.stdin.resume();\n\t});\n}\n\nfunction collectSettingsDiagnostics(\n\tsettingsManager: SettingsManager,\n\tcontext: string,\n): AgentSessionRuntimeDiagnostic[] {\n\treturn settingsManager.drainErrors().map(({ scope, error }) => ({\n\t\ttype: \"warning\",\n\t\tmessage: `(${context}, ${scope} settings) ${error.message}`,\n\t}));\n}\n\nfunction reportDiagnostics(diagnostics: readonly AgentSessionRuntimeDiagnostic[]): void {\n\tfor (const diagnostic of diagnostics) {\n\t\tconst color = diagnostic.type === \"error\" ? chalk.red : diagnostic.type === \"warning\" ? chalk.yellow : chalk.dim;\n\t\tconst prefix = diagnostic.type === \"error\" ? \"Error: \" : diagnostic.type === \"warning\" ? \"Warning: \" : \"\";\n\t\tconsole.error(color(`${prefix}${diagnostic.message}`));\n\t}\n}\n\nfunction isTruthyEnvFlag(value: string | undefined): boolean {\n\tif (!value) return false;\n\treturn value === \"1\" || value.toLowerCase() === \"true\" || value.toLowerCase() === \"yes\";\n}\n\ntype AppMode = \"interactive\" | \"print\" | \"json\" | \"rpc\";\n\nfunction resolveAppMode(parsed: Args, stdinIsTTY: boolean): AppMode {\n\tif (parsed.mode === \"rpc\") {\n\t\treturn \"rpc\";\n\t}\n\tif (parsed.mode === \"json\") {\n\t\treturn \"json\";\n\t}\n\tif (parsed.print || !stdinIsTTY) {\n\t\treturn \"print\";\n\t}\n\treturn \"interactive\";\n}\n\nfunction toPrintOutputMode(appMode: AppMode): Exclude<Mode, \"rpc\"> {\n\treturn appMode === \"json\" ? \"json\" : \"text\";\n}\n\nasync function prepareInitialMessage(\n\tparsed: Args,\n\tautoResizeImages: boolean,\n\tstdinContent?: string,\n): Promise<{\n\tinitialMessage?: string;\n\tinitialImages?: ImageContent[];\n}> {\n\tif (parsed.fileArgs.length === 0) {\n\t\treturn buildInitialMessage({ parsed, stdinContent });\n\t}\n\n\tconst { text, images } = await processFileArguments(parsed.fileArgs, { autoResizeImages });\n\treturn buildInitialMessage({\n\t\tparsed,\n\t\tfileText: text,\n\t\tfileImages: images,\n\t\tstdinContent,\n\t});\n}\n\n/** Result from resolving a session argument */\ntype ResolvedSession =\n\t| { type: \"path\"; path: string } // Direct file path\n\t| { type: \"local\"; path: string } // Found in current project\n\t| { type: \"global\"; path: string; cwd: string } // Found in different project\n\t| { type: \"not_found\"; arg: string }; // Not found anywhere\n\n/**\n * Resolve a session argument to a file path.\n * If it looks like a path, use as-is. Otherwise try to match as session ID prefix.\n */\nasync function resolveSessionPath(sessionArg: string, cwd: string, sessionDir?: string): Promise<ResolvedSession> {\n\t// If it looks like a file path, use as-is\n\tif (sessionArg.includes(\"/\") || sessionArg.includes(\"\\\\\") || sessionArg.endsWith(\".jsonl\")) {\n\t\treturn { type: \"path\", path: sessionArg };\n\t}\n\n\t// Try to match as session ID in current project first\n\tconst localSessions = await SessionManager.list(cwd, sessionDir);\n\tconst localMatches = localSessions.filter((s) => s.id.startsWith(sessionArg));\n\n\tif (localMatches.length >= 1) {\n\t\treturn { type: \"local\", path: localMatches[0].path };\n\t}\n\n\t// Try global search across all projects\n\tconst allSessions = await SessionManager.listAll();\n\tconst globalMatches = allSessions.filter((s) => s.id.startsWith(sessionArg));\n\n\tif (globalMatches.length >= 1) {\n\t\tconst match = globalMatches[0];\n\t\treturn { type: \"global\", path: match.path, cwd: match.cwd };\n\t}\n\n\t// Not found anywhere\n\treturn { type: \"not_found\", arg: sessionArg };\n}\n\n/** Prompt user for yes/no confirmation */\nasync function promptConfirm(message: string): Promise<boolean> {\n\treturn new Promise((resolve) => {\n\t\tconst rl = createInterface({\n\t\t\tinput: process.stdin,\n\t\t\toutput: process.stdout,\n\t\t});\n\t\trl.question(`${message} [y/N] `, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer.toLowerCase() === \"y\" || answer.toLowerCase() === \"yes\");\n\t\t});\n\t});\n}\n\nfunction validateForkFlags(parsed: Args): void {\n\tif (!parsed.fork) return;\n\n\tconst conflictingFlags = [\n\t\tparsed.session ? \"--session\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t\tparsed.noSession ? \"--no-session\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\n\tif (conflictingFlags.length > 0) {\n\t\tconsole.error(chalk.red(`Error: --fork cannot be combined with ${conflictingFlags.join(\", \")}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nfunction forkSessionOrExit(sourcePath: string, cwd: string, sessionDir?: string): SessionManager {\n\ttry {\n\t\treturn SessionManager.forkFrom(sourcePath, cwd, sessionDir);\n\t} catch (error: unknown) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nasync function createSessionManager(\n\tparsed: Args,\n\tcwd: string,\n\tsessionDir: string | undefined,\n\tsettingsManager: SettingsManager,\n): Promise<SessionManager> {\n\tif (parsed.noSession) {\n\t\treturn SessionManager.inMemory();\n\t}\n\n\tif (parsed.fork) {\n\t\tconst resolved = await resolveSessionPath(parsed.fork, cwd, sessionDir);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"path\":\n\t\t\tcase \"local\":\n\t\t\tcase \"global\":\n\t\t\t\treturn forkSessionOrExit(resolved.path, cwd, sessionDir);\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`No session found matching '${resolved.arg}'`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.session) {\n\t\tconst resolved = await resolveSessionPath(parsed.session, cwd, sessionDir);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"path\":\n\t\t\tcase \"local\":\n\t\t\t\treturn SessionManager.open(resolved.path, sessionDir);\n\n\t\t\tcase \"global\": {\n\t\t\t\tconsole.log(chalk.yellow(`Session found in different project: ${resolved.cwd}`));\n\t\t\t\tconst shouldFork = await promptConfirm(\"Fork this session into current directory?\");\n\t\t\t\tif (!shouldFork) {\n\t\t\t\t\tconsole.log(chalk.dim(\"Aborted.\"));\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t}\n\t\t\t\treturn forkSessionOrExit(resolved.path, cwd, sessionDir);\n\t\t\t}\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`No session found matching '${resolved.arg}'`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.resume) {\n\t\tinitTheme(settingsManager.getTheme(), true);\n\t\ttry {\n\t\t\tconst selectedPath = await selectSession(\n\t\t\t\t(onProgress) => SessionManager.list(cwd, sessionDir, onProgress),\n\t\t\t\tSessionManager.listAll,\n\t\t\t);\n\t\t\tif (!selectedPath) {\n\t\t\t\tconsole.log(chalk.dim(\"No session selected\"));\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t\treturn SessionManager.open(selectedPath, sessionDir);\n\t\t} finally {\n\t\t\tstopThemeWatcher();\n\t\t}\n\t}\n\n\tif (parsed.continue) {\n\t\treturn SessionManager.continueRecent(cwd, sessionDir);\n\t}\n\n\treturn SessionManager.create(cwd, sessionDir);\n}\n\nfunction buildSessionOptions(\n\tparsed: Args,\n\tscopedModels: ScopedModel[],\n\thasExistingSession: boolean,\n\tmodelRegistry: ModelRegistry,\n\tsettingsManager: SettingsManager,\n): {\n\toptions: CreateAgentSessionOptions;\n\tcliThinkingFromModel: boolean;\n\tdiagnostics: AgentSessionRuntimeDiagnostic[];\n} {\n\tconst options: CreateAgentSessionOptions = {};\n\tconst diagnostics: AgentSessionRuntimeDiagnostic[] = [];\n\tlet cliThinkingFromModel = false;\n\n\t// Model from CLI\n\t// - supports --provider <name> --model <pattern>\n\t// - supports --model <provider>/<pattern>\n\tif (parsed.model) {\n\t\tconst resolved = resolveCliModel({\n\t\t\tcliProvider: parsed.provider,\n\t\t\tcliModel: parsed.model,\n\t\t\tmodelRegistry,\n\t\t});\n\t\tif (resolved.warning) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: resolved.warning });\n\t\t}\n\t\tif (resolved.error) {\n\t\t\tdiagnostics.push({ type: \"error\", message: resolved.error });\n\t\t}\n\t\tif (resolved.model) {\n\t\t\toptions.model = resolved.model;\n\t\t\t// Allow \"--model <pattern>:<thinking>\" as a shorthand.\n\t\t\t// Explicit --thinking still takes precedence (applied later).\n\t\t\tif (!parsed.thinking && resolved.thinkingLevel) {\n\t\t\t\toptions.thinkingLevel = resolved.thinkingLevel;\n\t\t\t\tcliThinkingFromModel = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!options.model && scopedModels.length > 0 && !hasExistingSession) {\n\t\t// Check if saved default is in scoped models - use it if so, otherwise first scoped model\n\t\tconst savedProvider = settingsManager.getDefaultProvider();\n\t\tconst savedModelId = settingsManager.getDefaultModel();\n\t\tconst savedModel = savedProvider && savedModelId ? modelRegistry.find(savedProvider, savedModelId) : undefined;\n\t\tconst savedInScope = savedModel ? scopedModels.find((sm) => modelsAreEqual(sm.model, savedModel)) : undefined;\n\n\t\tif (savedInScope) {\n\t\t\toptions.model = savedInScope.model;\n\t\t\t// Use thinking level from scoped model config if explicitly set\n\t\t\tif (!parsed.thinking && savedInScope.thinkingLevel) {\n\t\t\t\toptions.thinkingLevel = savedInScope.thinkingLevel;\n\t\t\t}\n\t\t} else {\n\t\t\toptions.model = scopedModels[0].model;\n\t\t\t// Use thinking level from first scoped model if explicitly set\n\t\t\tif (!parsed.thinking && scopedModels[0].thinkingLevel) {\n\t\t\t\toptions.thinkingLevel = scopedModels[0].thinkingLevel;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Thinking level from CLI (takes precedence over scoped model thinking levels set above)\n\tif (parsed.thinking) {\n\t\toptions.thinkingLevel = parsed.thinking;\n\t}\n\n\t// Scoped models for Ctrl+P cycling\n\t// Keep thinking level undefined when not explicitly set in the model pattern.\n\t// Undefined means \"inherit current session thinking level\" during cycling.\n\tif (scopedModels.length > 0) {\n\t\toptions.scopedModels = scopedModels.map((sm) => ({\n\t\t\tmodel: sm.model,\n\t\t\tthinkingLevel: sm.thinkingLevel,\n\t\t}));\n\t}\n\n\t// API key from CLI - set in authStorage\n\t// (handled by caller before createAgentSession)\n\n\t// Tools\n\tif (parsed.noTools) {\n\t\t// --no-tools: start with no built-in tools\n\t\t// --tools can still add specific ones back\n\t\tif (parsed.tools && parsed.tools.length > 0) {\n\t\t\toptions.tools = parsed.tools.map((name) => allTools[name]);\n\t\t} else {\n\t\t\toptions.tools = [];\n\t\t}\n\t} else if (parsed.tools) {\n\t\toptions.tools = parsed.tools.map((name) => allTools[name]);\n\t}\n\n\treturn { options, cliThinkingFromModel, diagnostics };\n}\n\nfunction resolveCliPaths(cwd: string, paths: string[] | undefined): string[] | undefined {\n\treturn paths?.map((value) => (isLocalPath(value) ? resolve(cwd, value) : value));\n}\n\nasync function promptForMissingSessionCwd(\n\tissue: SessionCwdIssue,\n\tsettingsManager: SettingsManager,\n): Promise<string | undefined> {\n\tinitTheme(settingsManager.getTheme());\n\tsetKeybindings(KeybindingsManager.create());\n\n\treturn new Promise((resolve) => {\n\t\tconst ui = new TUI(new ProcessTerminal(), settingsManager.getShowHardwareCursor());\n\t\tui.setClearOnShrink(settingsManager.getClearOnShrink());\n\n\t\tlet settled = false;\n\t\tconst finish = (result: string | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst selector = new ExtensionSelectorComponent(\n\t\t\tformatMissingSessionCwdPrompt(issue),\n\t\t\t[\"Continue\", \"Cancel\"],\n\t\t\t(option) => finish(option === \"Continue\" ? issue.fallbackCwd : undefined),\n\t\t\t() => finish(undefined),\n\t\t\t{ tui: ui },\n\t\t);\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector);\n\t\tui.start();\n\t});\n}\n\nexport async function main(args: string[]) {\n\tresetTimings();\n\tconst offlineMode = args.includes(\"--offline\") || isTruthyEnvFlag(process.env.PI_OFFLINE);\n\tif (offlineMode) {\n\t\tprocess.env.PI_OFFLINE = \"1\";\n\t\tprocess.env.PI_SKIP_VERSION_CHECK = \"1\";\n\t}\n\n\tif (await handlePackageCommand(args)) {\n\t\treturn;\n\t}\n\n\tif (await handleConfigCommand(args)) {\n\t\treturn;\n\t}\n\n\tconst parsed = parseArgs(args);\n\tif (parsed.diagnostics.length > 0) {\n\t\tfor (const d of parsed.diagnostics) {\n\t\t\tconst color = d.type === \"error\" ? chalk.red : chalk.yellow;\n\t\t\tconsole.error(color(`${d.type === \"error\" ? \"Error\" : \"Warning\"}: ${d.message}`));\n\t\t}\n\t\tif (parsed.diagnostics.some((d) => d.type === \"error\")) {\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\ttime(\"parseArgs\");\n\tlet appMode = resolveAppMode(parsed, process.stdin.isTTY);\n\tconst shouldTakeOverStdout = appMode !== \"interactive\";\n\tif (shouldTakeOverStdout) {\n\t\ttakeOverStdout();\n\t}\n\n\tif (parsed.version) {\n\t\tconsole.log(VERSION);\n\t\tprocess.exit(0);\n\t}\n\n\tif (parsed.export) {\n\t\tlet result: string;\n\t\ttry {\n\t\t\tconst outputPath = parsed.messages.length > 0 ? parsed.messages[0] : undefined;\n\t\t\tresult = await exportFromFile(parsed.export, outputPath);\n\t\t} catch (error: unknown) {\n\t\t\tconst message = error instanceof Error ? error.message : \"Failed to export session\";\n\t\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tconsole.log(`Exported to: ${result}`);\n\t\tprocess.exit(0);\n\t}\n\n\tif (parsed.mode === \"rpc\" && parsed.fileArgs.length > 0) {\n\t\tconsole.error(chalk.red(\"Error: @file arguments are not supported in RPC mode\"));\n\t\tprocess.exit(1);\n\t}\n\n\tvalidateForkFlags(parsed);\n\n\t// Run migrations (pass cwd for project-local migrations)\n\tconst { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(process.cwd());\n\ttime(\"runMigrations\");\n\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst startupSettingsManager = SettingsManager.create(cwd, agentDir);\n\treportDiagnostics(collectSettingsDiagnostics(startupSettingsManager, \"startup session lookup\"));\n\n\t// Decide the final runtime cwd before creating cwd-bound runtime services.\n\t// --session and --resume may select a session from another project, so project-local\n\t// settings, resources, provider registrations, and models must be resolved only after\n\t// the target session cwd is known. The startup-cwd settings manager is used only for\n\t// sessionDir lookup during session selection.\n\tconst sessionDir = parsed.sessionDir ?? startupSettingsManager.getSessionDir();\n\tlet sessionManager = await createSessionManager(parsed, cwd, sessionDir, startupSettingsManager);\n\tconst missingSessionCwdIssue = getMissingSessionCwdIssue(sessionManager, cwd);\n\tif (missingSessionCwdIssue) {\n\t\tif (appMode === \"interactive\") {\n\t\t\tconst selectedCwd = await promptForMissingSessionCwd(missingSessionCwdIssue, startupSettingsManager);\n\t\t\tif (!selectedCwd) {\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t\tsessionManager = SessionManager.open(missingSessionCwdIssue.sessionFile!, sessionDir, selectedCwd);\n\t\t} else {\n\t\t\tconsole.error(chalk.red(new MissingSessionCwdError(missingSessionCwdIssue).message));\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\ttime(\"createSessionManager\");\n\n\tconst resolvedExtensionPaths = resolveCliPaths(cwd, parsed.extensions);\n\tconst resolvedSkillPaths = resolveCliPaths(cwd, parsed.skills);\n\tconst resolvedPromptTemplatePaths = resolveCliPaths(cwd, parsed.promptTemplates);\n\tconst resolvedThemePaths = resolveCliPaths(cwd, parsed.themes);\n\tconst authStorage = AuthStorage.create();\n\tconst createRuntime: CreateAgentSessionRuntimeFactory = async ({\n\t\tcwd,\n\t\tagentDir,\n\t\tsessionManager,\n\t\tsessionStartEvent,\n\t}) => {\n\t\tconst services = await createAgentSessionServices({\n\t\t\tcwd,\n\t\t\tagentDir,\n\t\t\tauthStorage,\n\t\t\textensionFlagValues: parsed.unknownFlags,\n\t\t\tresourceLoaderOptions: {\n\t\t\t\tadditionalExtensionPaths: resolvedExtensionPaths,\n\t\t\t\tadditionalSkillPaths: resolvedSkillPaths,\n\t\t\t\tadditionalPromptTemplatePaths: resolvedPromptTemplatePaths,\n\t\t\t\tadditionalThemePaths: resolvedThemePaths,\n\t\t\t\tnoExtensions: parsed.noExtensions,\n\t\t\t\tnoSkills: parsed.noSkills,\n\t\t\t\tnoPromptTemplates: parsed.noPromptTemplates,\n\t\t\t\tnoThemes: parsed.noThemes,\n\t\t\t\tsystemPrompt: parsed.systemPrompt,\n\t\t\t\tappendSystemPrompt: parsed.appendSystemPrompt,\n\t\t\t},\n\t\t});\n\t\tconst { settingsManager, modelRegistry, resourceLoader } = services;\n\t\tconst diagnostics: AgentSessionRuntimeDiagnostic[] = [\n\t\t\t...services.diagnostics,\n\t\t\t...collectSettingsDiagnostics(settingsManager, \"runtime creation\"),\n\t\t\t...resourceLoader.getExtensions().errors.map(({ path, error }) => ({\n\t\t\t\ttype: \"error\" as const,\n\t\t\t\tmessage: `Failed to load extension \"${path}\": ${error}`,\n\t\t\t})),\n\t\t];\n\n\t\tconst modelPatterns = parsed.models ?? settingsManager.getEnabledModels();\n\t\tconst scopedModels =\n\t\t\tmodelPatterns && modelPatterns.length > 0 ? await resolveModelScope(modelPatterns, modelRegistry) : [];\n\t\tconst {\n\t\t\toptions: sessionOptions,\n\t\t\tcliThinkingFromModel,\n\t\t\tdiagnostics: sessionOptionDiagnostics,\n\t\t} = buildSessionOptions(\n\t\t\tparsed,\n\t\t\tscopedModels,\n\t\t\tsessionManager.buildSessionContext().messages.length > 0,\n\t\t\tmodelRegistry,\n\t\t\tsettingsManager,\n\t\t);\n\t\tdiagnostics.push(...sessionOptionDiagnostics);\n\n\t\tif (parsed.apiKey) {\n\t\t\tif (!sessionOptions.model) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tmessage: \"--api-key requires a model to be specified via --model, --provider/--model, or --models\",\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tauthStorage.setRuntimeApiKey(sessionOptions.model.provider, parsed.apiKey);\n\t\t\t}\n\t\t}\n\n\t\tconst created = await createAgentSessionFromServices({\n\t\t\tservices,\n\t\t\tsessionManager,\n\t\t\tsessionStartEvent,\n\t\t\tmodel: sessionOptions.model,\n\t\t\tthinkingLevel: sessionOptions.thinkingLevel,\n\t\t\tscopedModels: sessionOptions.scopedModels,\n\t\t\ttools: sessionOptions.tools,\n\t\t\tcustomTools: sessionOptions.customTools,\n\t\t});\n\t\tconst cliThinkingOverride = parsed.thinking !== undefined || cliThinkingFromModel;\n\t\tif (created.session.model && cliThinkingOverride) {\n\t\t\tlet effectiveThinking = created.session.thinkingLevel;\n\t\t\tif (!created.session.model.reasoning) {\n\t\t\t\teffectiveThinking = \"off\";\n\t\t\t} else if (effectiveThinking === \"xhigh\" && !supportsXhigh(created.session.model)) {\n\t\t\t\teffectiveThinking = \"high\";\n\t\t\t}\n\t\t\tif (effectiveThinking !== created.session.thinkingLevel) {\n\t\t\t\tcreated.session.setThinkingLevel(effectiveThinking);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\t...created,\n\t\t\tservices,\n\t\t\tdiagnostics,\n\t\t};\n\t};\n\ttime(\"createRuntime\");\n\tconst runtime = await createAgentSessionRuntime(createRuntime, {\n\t\tcwd: sessionManager.getCwd(),\n\t\tagentDir,\n\t\tsessionManager,\n\t});\n\tconst { services, session, modelFallbackMessage } = runtime;\n\tconst { settingsManager, modelRegistry, resourceLoader } = services;\n\n\tif (parsed.help) {\n\t\tconst extensionFlags = resourceLoader\n\t\t\t.getExtensions()\n\t\t\t.extensions.flatMap((extension) => Array.from(extension.flags.values()));\n\t\tprintHelp(extensionFlags);\n\t\tprocess.exit(0);\n\t}\n\n\tif (parsed.listModels !== undefined) {\n\t\tconst searchPattern = typeof parsed.listModels === \"string\" ? parsed.listModels : undefined;\n\t\tawait listModels(modelRegistry, searchPattern);\n\t\tprocess.exit(0);\n\t}\n\n\t// Read piped stdin content (if any) - skip for RPC mode which uses stdin for JSON-RPC\n\tlet stdinContent: string | undefined;\n\tif (appMode !== \"rpc\") {\n\t\tstdinContent = await readPipedStdin();\n\t\tif (stdinContent !== undefined && appMode === \"interactive\") {\n\t\t\tappMode = \"print\";\n\t\t}\n\t}\n\ttime(\"readPipedStdin\");\n\n\tconst { initialMessage, initialImages } = await prepareInitialMessage(\n\t\tparsed,\n\t\tsettingsManager.getImageAutoResize(),\n\t\tstdinContent,\n\t);\n\ttime(\"prepareInitialMessage\");\n\tinitTheme(settingsManager.getTheme(), appMode === \"interactive\");\n\ttime(\"initTheme\");\n\n\t// Show deprecation warnings in interactive mode\n\tif (appMode === \"interactive\" && deprecationWarnings.length > 0) {\n\t\tawait showDeprecationWarnings(deprecationWarnings);\n\t}\n\n\tconst scopedModels = [...session.scopedModels];\n\ttime(\"resolveModelScope\");\n\treportDiagnostics(runtime.diagnostics);\n\tif (runtime.diagnostics.some((diagnostic) => diagnostic.type === \"error\")) {\n\t\tprocess.exit(1);\n\t}\n\ttime(\"createAgentSession\");\n\n\tif (appMode !== \"interactive\" && !session.model) {\n\t\tconsole.error(chalk.red(\"No models available.\"));\n\t\tconsole.error(chalk.yellow(\"\\nSet an API key environment variable:\"));\n\t\tconsole.error(\" ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, etc.\");\n\t\tconsole.error(chalk.yellow(`\\nOr create ${getModelsPath()}`));\n\t\tprocess.exit(1);\n\t}\n\n\tconst startupBenchmark = isTruthyEnvFlag(process.env.PI_STARTUP_BENCHMARK);\n\tif (startupBenchmark && appMode !== \"interactive\") {\n\t\tconsole.error(chalk.red(\"Error: PI_STARTUP_BENCHMARK only supports interactive mode\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (appMode === \"rpc\") {\n\t\tprintTimings();\n\t\tawait runRpcMode(runtime);\n\t} else if (appMode === \"interactive\") {\n\t\tif (scopedModels.length > 0 && (parsed.verbose || !settingsManager.getQuietStartup())) {\n\t\t\tconst modelList = scopedModels\n\t\t\t\t.map((sm) => {\n\t\t\t\t\tconst thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : \"\";\n\t\t\t\t\treturn `${sm.model.id}${thinkingStr}`;\n\t\t\t\t})\n\t\t\t\t.join(\", \");\n\t\t\tconsole.log(chalk.dim(`Model scope: ${modelList} ${chalk.gray(\"(Ctrl+P to cycle)\")}`));\n\t\t}\n\n\t\tconst interactiveMode = new InteractiveMode(runtime, {\n\t\t\tmigratedProviders,\n\t\t\tmodelFallbackMessage,\n\t\t\tinitialMessage,\n\t\t\tinitialImages,\n\t\t\tinitialMessages: parsed.messages,\n\t\t\tverbose: parsed.verbose,\n\t\t});\n\t\tif (startupBenchmark) {\n\t\t\tawait interactiveMode.init();\n\t\t\ttime(\"interactiveMode.init\");\n\t\t\tprintTimings();\n\t\t\tinteractiveMode.stop();\n\t\t\tstopThemeWatcher();\n\t\t\tif (process.stdout.writableLength > 0) {\n\t\t\t\tawait new Promise<void>((resolve) => process.stdout.once(\"drain\", resolve));\n\t\t\t}\n\t\t\tif (process.stderr.writableLength > 0) {\n\t\t\t\tawait new Promise<void>((resolve) => process.stderr.once(\"drain\", resolve));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tprintTimings();\n\t\tawait interactiveMode.run();\n\t} else {\n\t\tprintTimings();\n\t\tconst exitCode = await runPrintMode(runtime, {\n\t\t\tmode: toPrintOutputMode(appMode),\n\t\t\tmessages: parsed.messages,\n\t\t\tinitialMessage,\n\t\t\tinitialImages,\n\t\t});\n\t\tstopThemeWatcher();\n\t\trestoreStdout();\n\t\tif (exitCode !== 0) {\n\t\t\tprocess.exitCode = exitCode;\n\t\t}\n\t\treturn;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CA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I,CAAC,sBAAsB,CAAC,CAAC;YAC7B,YAAY,EAAE,CAAC;YACf,eAAe,CAAC,IAAI,EAAE,CAAC;YACvB,gBAAgB,EAAE,CAAC;YACnB,IAAI,OAAO,CAAC,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC;gBACvC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;YAC7E,CAAC;YACD,IAAI,OAAO,CAAC,MAAM,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC;gBACvC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO;QACR,CAAC;QAED,YAAY,EAAE,CAAC;QACf,MAAM,eAAe,CAAC,GAAG,EAAE,CAAC;IAC7B,CAAC;SAAM,CAAC;QACP,YAAY,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,EAAE;YAC5C,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC;YAChC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,cAAc;YACd,aAAa;SACb,CAAC,CAAC;QACH,gBAAgB,EAAE,CAAC;QACnB,aAAa,EAAE,CAAC;QAChB,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACpB,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC7B,CAAC;QACD,OAAO;IACR,CAAC;AAAA,CACD","sourcesContent":["/**\n * Main entry point for the coding agent CLI.\n *\n * This file handles CLI argument parsing and translates them into\n * createAgentSession() options. The SDK does the heavy lifting.\n */\n\nimport { resolve } from \"node:path\";\nimport { createInterface } from \"node:readline\";\nimport { type ImageContent, modelsAreEqual, supportsXhigh } from \"@orient-cli/ai\";\nimport { ProcessTerminal, setKeybindings, TUI } from \"@orient-cli/tui\";\nimport chalk from \"chalk\";\nimport { type Args, type Mode, parseArgs, printHelp } from \"./cli/args.js\";\nimport { processFileArguments } from \"./cli/file-processor.js\";\nimport { buildInitialMessage } from \"./cli/initial-message.js\";\nimport { listModels } from \"./cli/list-models.js\";\nimport { selectSession } from \"./cli/session-picker.js\";\nimport { getAgentDir, getModelsPath, VERSION } from \"./config.js\";\nimport { type CreateAgentSessionRuntimeFactory, createAgentSessionRuntime } from \"./core/agent-session-runtime.js\";\nimport {\n\ttype AgentSessionRuntimeDiagnostic,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionServices,\n} from \"./core/agent-session-services.js\";\nimport { AuthStorage } from \"./core/auth-storage.js\";\nimport { exportFromFile } from \"./core/export-html/index.js\";\nimport { KeybindingsManager } from \"./core/keybindings.js\";\nimport type { ModelRegistry } from \"./core/model-registry.js\";\nimport { resolveCliModel, resolveModelScope, type ScopedModel } from \"./core/model-resolver.js\";\nimport { restoreStdout, takeOverStdout } from \"./core/output-guard.js\";\nimport type { CreateAgentSessionOptions } from \"./core/sdk.js\";\nimport {\n\tformatMissingSessionCwdPrompt,\n\tgetMissingSessionCwdIssue,\n\tMissingSessionCwdError,\n\ttype SessionCwdIssue,\n} from \"./core/session-cwd.js\";\nimport { SessionManager } from \"./core/session-manager.js\";\nimport { SettingsManager } from \"./core/settings-manager.js\";\nimport { printTimings, resetTimings, time } from \"./core/timings.js\";\nimport { allTools } from \"./core/tools/index.js\";\nimport { runMigrations, showDeprecationWarnings } from \"./migrations.js\";\nimport { InteractiveMode, runPrintMode, runRpcMode } from \"./modes/index.js\";\nimport { ExtensionSelectorComponent } from \"./modes/interactive/components/extension-selector.js\";\nimport { initTheme, stopThemeWatcher } from \"./modes/interactive/theme/theme.js\";\nimport { handleConfigCommand, handlePackageCommand } from \"./package-manager-cli.js\";\nimport { isLocalPath } from \"./utils/paths.js\";\n\n/**\n * Read all content from piped stdin.\n * Returns undefined if stdin is a TTY (interactive terminal).\n */\nasync function readPipedStdin(): Promise<string | undefined> {\n\t// If stdin is a TTY, we're running interactively - don't read stdin\n\tif (process.stdin.isTTY) {\n\t\treturn undefined;\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tlet data = \"\";\n\t\tprocess.stdin.setEncoding(\"utf8\");\n\t\tprocess.stdin.on(\"data\", (chunk) => {\n\t\t\tdata += chunk;\n\t\t});\n\t\tprocess.stdin.on(\"end\", () => {\n\t\t\tresolve(data.trim() || undefined);\n\t\t});\n\t\tprocess.stdin.resume();\n\t});\n}\n\nfunction collectSettingsDiagnostics(\n\tsettingsManager: SettingsManager,\n\tcontext: string,\n): AgentSessionRuntimeDiagnostic[] {\n\treturn settingsManager.drainErrors().map(({ scope, error }) => ({\n\t\ttype: \"warning\",\n\t\tmessage: `(${context}, ${scope} settings) ${error.message}`,\n\t}));\n}\n\nfunction reportDiagnostics(diagnostics: readonly AgentSessionRuntimeDiagnostic[]): void {\n\tfor (const diagnostic of diagnostics) {\n\t\tconst color = diagnostic.type === \"error\" ? chalk.red : diagnostic.type === \"warning\" ? chalk.yellow : chalk.dim;\n\t\tconst prefix = diagnostic.type === \"error\" ? \"Error: \" : diagnostic.type === \"warning\" ? \"Warning: \" : \"\";\n\t\tconsole.error(color(`${prefix}${diagnostic.message}`));\n\t}\n}\n\nfunction isTruthyEnvFlag(value: string | undefined): boolean {\n\tif (!value) return false;\n\treturn value === \"1\" || value.toLowerCase() === \"true\" || value.toLowerCase() === \"yes\";\n}\n\ntype AppMode = \"interactive\" | \"print\" | \"json\" | \"rpc\";\n\nfunction resolveAppMode(parsed: Args, stdinIsTTY: boolean): AppMode {\n\tif (parsed.mode === \"rpc\") {\n\t\treturn \"rpc\";\n\t}\n\tif (parsed.mode === \"json\") {\n\t\treturn \"json\";\n\t}\n\tif (parsed.print || !stdinIsTTY) {\n\t\treturn \"print\";\n\t}\n\treturn \"interactive\";\n}\n\nfunction toPrintOutputMode(appMode: AppMode): Exclude<Mode, \"rpc\"> {\n\treturn appMode === \"json\" ? \"json\" : \"text\";\n}\n\nasync function prepareInitialMessage(\n\tparsed: Args,\n\tautoResizeImages: boolean,\n\tstdinContent?: string,\n): Promise<{\n\tinitialMessage?: string;\n\tinitialImages?: ImageContent[];\n}> {\n\tif (parsed.fileArgs.length === 0) {\n\t\treturn buildInitialMessage({ parsed, stdinContent });\n\t}\n\n\tconst { text, images } = await processFileArguments(parsed.fileArgs, { autoResizeImages });\n\treturn buildInitialMessage({\n\t\tparsed,\n\t\tfileText: text,\n\t\tfileImages: images,\n\t\tstdinContent,\n\t});\n}\n\n/** Result from resolving a session argument */\ntype ResolvedSession =\n\t| { type: \"path\"; path: string } // Direct file path\n\t| { type: \"local\"; path: string } // Found in current project\n\t| { type: \"global\"; path: string; cwd: string } // Found in different project\n\t| { type: \"not_found\"; arg: string }; // Not found anywhere\n\n/**\n * Resolve a session argument to a file path.\n * If it looks like a path, use as-is. Otherwise try to match as session ID prefix.\n */\nasync function resolveSessionPath(sessionArg: string, cwd: string, sessionDir?: string): Promise<ResolvedSession> {\n\t// If it looks like a file path, use as-is\n\tif (sessionArg.includes(\"/\") || sessionArg.includes(\"\\\\\") || sessionArg.endsWith(\".jsonl\")) {\n\t\treturn { type: \"path\", path: sessionArg };\n\t}\n\n\t// Try to match as session ID in current project first\n\tconst localSessions = await SessionManager.list(cwd, sessionDir);\n\tconst localMatches = localSessions.filter((s) => s.id.startsWith(sessionArg));\n\n\tif (localMatches.length >= 1) {\n\t\treturn { type: \"local\", path: localMatches[0].path };\n\t}\n\n\t// Try global search across all projects\n\tconst allSessions = await SessionManager.listAll();\n\tconst globalMatches = allSessions.filter((s) => s.id.startsWith(sessionArg));\n\n\tif (globalMatches.length >= 1) {\n\t\tconst match = globalMatches[0];\n\t\treturn { type: \"global\", path: match.path, cwd: match.cwd };\n\t}\n\n\t// Not found anywhere\n\treturn { type: \"not_found\", arg: sessionArg };\n}\n\n/** Prompt user for yes/no confirmation */\nasync function promptConfirm(message: string): Promise<boolean> {\n\treturn new Promise((resolve) => {\n\t\tconst rl = createInterface({\n\t\t\tinput: process.stdin,\n\t\t\toutput: process.stdout,\n\t\t});\n\t\trl.question(`${message} [y/N] `, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer.toLowerCase() === \"y\" || answer.toLowerCase() === \"yes\");\n\t\t});\n\t});\n}\n\nfunction validateForkFlags(parsed: Args): void {\n\tif (!parsed.fork) return;\n\n\tconst conflictingFlags = [\n\t\tparsed.session ? \"--session\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t\tparsed.noSession ? \"--no-session\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\n\tif (conflictingFlags.length > 0) {\n\t\tconsole.error(chalk.red(`Error: --fork cannot be combined with ${conflictingFlags.join(\", \")}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nfunction forkSessionOrExit(sourcePath: string, cwd: string, sessionDir?: string): SessionManager {\n\ttry {\n\t\treturn SessionManager.forkFrom(sourcePath, cwd, sessionDir);\n\t} catch (error: unknown) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nasync function createSessionManager(\n\tparsed: Args,\n\tcwd: string,\n\tsessionDir: string | undefined,\n\tsettingsManager: SettingsManager,\n): Promise<SessionManager> {\n\tif (parsed.noSession) {\n\t\treturn SessionManager.inMemory();\n\t}\n\n\tif (parsed.fork) {\n\t\tconst resolved = await resolveSessionPath(parsed.fork, cwd, sessionDir);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"path\":\n\t\t\tcase \"local\":\n\t\t\tcase \"global\":\n\t\t\t\treturn forkSessionOrExit(resolved.path, cwd, sessionDir);\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`No session found matching '${resolved.arg}'`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.session) {\n\t\tconst resolved = await resolveSessionPath(parsed.session, cwd, sessionDir);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"path\":\n\t\t\tcase \"local\":\n\t\t\t\treturn SessionManager.open(resolved.path, sessionDir);\n\n\t\t\tcase \"global\": {\n\t\t\t\tconsole.log(chalk.yellow(`Session found in different project: ${resolved.cwd}`));\n\t\t\t\tconst shouldFork = await promptConfirm(\"Fork this session into current directory?\");\n\t\t\t\tif (!shouldFork) {\n\t\t\t\t\tconsole.log(chalk.dim(\"Aborted.\"));\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t}\n\t\t\t\treturn forkSessionOrExit(resolved.path, cwd, sessionDir);\n\t\t\t}\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`No session found matching '${resolved.arg}'`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.resume) {\n\t\tinitTheme(settingsManager.getTheme(), true);\n\t\ttry {\n\t\t\tconst selectedPath = await selectSession(\n\t\t\t\t(onProgress) => SessionManager.list(cwd, sessionDir, onProgress),\n\t\t\t\tSessionManager.listAll,\n\t\t\t);\n\t\t\tif (!selectedPath) {\n\t\t\t\tconsole.log(chalk.dim(\"No session selected\"));\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t\treturn SessionManager.open(selectedPath, sessionDir);\n\t\t} finally {\n\t\t\tstopThemeWatcher();\n\t\t}\n\t}\n\n\tif (parsed.continue) {\n\t\treturn SessionManager.continueRecent(cwd, sessionDir);\n\t}\n\n\treturn SessionManager.create(cwd, sessionDir);\n}\n\nfunction buildSessionOptions(\n\tparsed: Args,\n\tscopedModels: ScopedModel[],\n\thasExistingSession: boolean,\n\tmodelRegistry: ModelRegistry,\n\tsettingsManager: SettingsManager,\n): {\n\toptions: CreateAgentSessionOptions;\n\tcliThinkingFromModel: boolean;\n\tdiagnostics: AgentSessionRuntimeDiagnostic[];\n} {\n\tconst options: CreateAgentSessionOptions = {};\n\tconst diagnostics: AgentSessionRuntimeDiagnostic[] = [];\n\tlet cliThinkingFromModel = false;\n\n\t// Model from CLI\n\t// - supports --provider <name> --model <pattern>\n\t// - supports --model <provider>/<pattern>\n\tif (parsed.model) {\n\t\tconst resolved = resolveCliModel({\n\t\t\tcliProvider: parsed.provider,\n\t\t\tcliModel: parsed.model,\n\t\t\tmodelRegistry,\n\t\t});\n\t\tif (resolved.warning) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: resolved.warning });\n\t\t}\n\t\tif (resolved.error) {\n\t\t\tdiagnostics.push({ type: \"error\", message: resolved.error });\n\t\t}\n\t\tif (resolved.model) {\n\t\t\toptions.model = resolved.model;\n\t\t\t// Allow \"--model <pattern>:<thinking>\" as a shorthand.\n\t\t\t// Explicit --thinking still takes precedence (applied later).\n\t\t\tif (!parsed.thinking && resolved.thinkingLevel) {\n\t\t\t\toptions.thinkingLevel = resolved.thinkingLevel;\n\t\t\t\tcliThinkingFromModel = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (!options.model && scopedModels.length > 0 && !hasExistingSession) {\n\t\t// Check if saved default is in scoped models - use it if so, otherwise first scoped model\n\t\tconst savedProvider = settingsManager.getDefaultProvider();\n\t\tconst savedModelId = settingsManager.getDefaultModel();\n\t\tconst savedModel = savedProvider && savedModelId ? modelRegistry.find(savedProvider, savedModelId) : undefined;\n\t\tconst savedInScope = savedModel ? scopedModels.find((sm) => modelsAreEqual(sm.model, savedModel)) : undefined;\n\n\t\tif (savedInScope) {\n\t\t\toptions.model = savedInScope.model;\n\t\t\t// Use thinking level from scoped model config if explicitly set\n\t\t\tif (!parsed.thinking && savedInScope.thinkingLevel) {\n\t\t\t\toptions.thinkingLevel = savedInScope.thinkingLevel;\n\t\t\t}\n\t\t} else {\n\t\t\toptions.model = scopedModels[0].model;\n\t\t\t// Use thinking level from first scoped model if explicitly set\n\t\t\tif (!parsed.thinking && scopedModels[0].thinkingLevel) {\n\t\t\t\toptions.thinkingLevel = scopedModels[0].thinkingLevel;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Thinking level from CLI (takes precedence over scoped model thinking levels set above)\n\tif (parsed.thinking) {\n\t\toptions.thinkingLevel = parsed.thinking;\n\t}\n\n\t// Scoped models for Ctrl+P cycling\n\t// Keep thinking level undefined when not explicitly set in the model pattern.\n\t// Undefined means \"inherit current session thinking level\" during cycling.\n\tif (scopedModels.length > 0) {\n\t\toptions.scopedModels = scopedModels.map((sm) => ({\n\t\t\tmodel: sm.model,\n\t\t\tthinkingLevel: sm.thinkingLevel,\n\t\t}));\n\t}\n\n\t// API key from CLI - set in authStorage\n\t// (handled by caller before createAgentSession)\n\n\t// Tools\n\tif (parsed.noTools) {\n\t\t// --no-tools: start with no built-in tools\n\t\t// --tools can still add specific ones back\n\t\tif (parsed.tools && parsed.tools.length > 0) {\n\t\t\toptions.tools = parsed.tools.map((name) => allTools[name]);\n\t\t} else {\n\t\t\toptions.tools = [];\n\t\t}\n\t} else if (parsed.tools) {\n\t\toptions.tools = parsed.tools.map((name) => allTools[name]);\n\t}\n\n\treturn { options, cliThinkingFromModel, diagnostics };\n}\n\nfunction resolveCliPaths(cwd: string, paths: string[] | undefined): string[] | undefined {\n\treturn paths?.map((value) => (isLocalPath(value) ? resolve(cwd, value) : value));\n}\n\nasync function promptForMissingSessionCwd(\n\tissue: SessionCwdIssue,\n\tsettingsManager: SettingsManager,\n): Promise<string | undefined> {\n\tinitTheme(settingsManager.getTheme());\n\tsetKeybindings(KeybindingsManager.create());\n\n\treturn new Promise((resolve) => {\n\t\tconst ui = new TUI(new ProcessTerminal(), settingsManager.getShowHardwareCursor());\n\t\tui.setClearOnShrink(settingsManager.getClearOnShrink());\n\n\t\tlet settled = false;\n\t\tconst finish = (result: string | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst selector = new ExtensionSelectorComponent(\n\t\t\tformatMissingSessionCwdPrompt(issue),\n\t\t\t[\"Continue\", \"Cancel\"],\n\t\t\t(option) => finish(option === \"Continue\" ? issue.fallbackCwd : undefined),\n\t\t\t() => finish(undefined),\n\t\t\t{ tui: ui },\n\t\t);\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector);\n\t\tui.start();\n\t});\n}\n\nexport async function main(args: string[]) {\n\tresetTimings();\n\tconst offlineMode = args.includes(\"--offline\") || isTruthyEnvFlag(process.env.PI_OFFLINE);\n\tif (offlineMode) {\n\t\tprocess.env.PI_OFFLINE = \"1\";\n\t\tprocess.env.PI_SKIP_VERSION_CHECK = \"1\";\n\t}\n\n\tif (await handlePackageCommand(args)) {\n\t\treturn;\n\t}\n\n\tif (await handleConfigCommand(args)) {\n\t\treturn;\n\t}\n\n\tconst parsed = parseArgs(args);\n\tif (parsed.diagnostics.length > 0) {\n\t\tfor (const d of parsed.diagnostics) {\n\t\t\tconst color = d.type === \"error\" ? chalk.red : chalk.yellow;\n\t\t\tconsole.error(color(`${d.type === \"error\" ? \"Error\" : \"Warning\"}: ${d.message}`));\n\t\t}\n\t\tif (parsed.diagnostics.some((d) => d.type === \"error\")) {\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\ttime(\"parseArgs\");\n\tlet appMode = resolveAppMode(parsed, process.stdin.isTTY);\n\tconst shouldTakeOverStdout = appMode !== \"interactive\";\n\tif (shouldTakeOverStdout) {\n\t\ttakeOverStdout();\n\t}\n\n\tif (parsed.version) {\n\t\tconsole.log(VERSION);\n\t\tprocess.exit(0);\n\t}\n\n\tif (parsed.export) {\n\t\tlet result: string;\n\t\ttry {\n\t\t\tconst outputPath = parsed.messages.length > 0 ? parsed.messages[0] : undefined;\n\t\t\tresult = await exportFromFile(parsed.export, outputPath);\n\t\t} catch (error: unknown) {\n\t\t\tconst message = error instanceof Error ? error.message : \"Failed to export session\";\n\t\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tconsole.log(`Exported to: ${result}`);\n\t\tprocess.exit(0);\n\t}\n\n\tif (parsed.mode === \"rpc\" && parsed.fileArgs.length > 0) {\n\t\tconsole.error(chalk.red(\"Error: @file arguments are not supported in RPC mode\"));\n\t\tprocess.exit(1);\n\t}\n\n\tvalidateForkFlags(parsed);\n\n\t// Run migrations (pass cwd for project-local migrations)\n\tconst { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(process.cwd());\n\ttime(\"runMigrations\");\n\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst startupSettingsManager = SettingsManager.create(cwd, agentDir);\n\treportDiagnostics(collectSettingsDiagnostics(startupSettingsManager, \"startup session lookup\"));\n\n\t// Decide the final runtime cwd before creating cwd-bound runtime services.\n\t// --session and --resume may select a session from another project, so project-local\n\t// settings, resources, provider registrations, and models must be resolved only after\n\t// the target session cwd is known. The startup-cwd settings manager is used only for\n\t// sessionDir lookup during session selection.\n\tconst sessionDir = parsed.sessionDir ?? startupSettingsManager.getSessionDir();\n\tlet sessionManager = await createSessionManager(parsed, cwd, sessionDir, startupSettingsManager);\n\tconst missingSessionCwdIssue = getMissingSessionCwdIssue(sessionManager, cwd);\n\tif (missingSessionCwdIssue) {\n\t\tif (appMode === \"interactive\") {\n\t\t\tconst selectedCwd = await promptForMissingSessionCwd(missingSessionCwdIssue, startupSettingsManager);\n\t\t\tif (!selectedCwd) {\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t\tsessionManager = SessionManager.open(missingSessionCwdIssue.sessionFile!, sessionDir, selectedCwd);\n\t\t} else {\n\t\t\tconsole.error(chalk.red(new MissingSessionCwdError(missingSessionCwdIssue).message));\n\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\ttime(\"createSessionManager\");\n\n\tconst resolvedExtensionPaths = resolveCliPaths(cwd, parsed.extensions);\n\tconst resolvedSkillPaths = resolveCliPaths(cwd, parsed.skills);\n\tconst resolvedPromptTemplatePaths = resolveCliPaths(cwd, parsed.promptTemplates);\n\tconst resolvedThemePaths = resolveCliPaths(cwd, parsed.themes);\n\tconst authStorage = AuthStorage.create();\n\tconst createRuntime: CreateAgentSessionRuntimeFactory = async ({\n\t\tcwd,\n\t\tagentDir,\n\t\tsessionManager,\n\t\tsessionStartEvent,\n\t}) => {\n\t\tconst services = await createAgentSessionServices({\n\t\t\tcwd,\n\t\t\tagentDir,\n\t\t\tauthStorage,\n\t\t\textensionFlagValues: parsed.unknownFlags,\n\t\t\tresourceLoaderOptions: {\n\t\t\t\tadditionalExtensionPaths: resolvedExtensionPaths,\n\t\t\t\tadditionalSkillPaths: resolvedSkillPaths,\n\t\t\t\tadditionalPromptTemplatePaths: resolvedPromptTemplatePaths,\n\t\t\t\tadditionalThemePaths: resolvedThemePaths,\n\t\t\t\tnoExtensions: parsed.noExtensions,\n\t\t\t\tnoSkills: parsed.noSkills,\n\t\t\t\tnoPromptTemplates: parsed.noPromptTemplates,\n\t\t\t\tnoThemes: parsed.noThemes,\n\t\t\t\tsystemPrompt: parsed.systemPrompt,\n\t\t\t\tappendSystemPrompt: parsed.appendSystemPrompt,\n\t\t\t},\n\t\t});\n\t\tconst { settingsManager, modelRegistry, resourceLoader } = services;\n\t\tconst diagnostics: AgentSessionRuntimeDiagnostic[] = [\n\t\t\t...services.diagnostics,\n\t\t\t...collectSettingsDiagnostics(settingsManager, \"runtime creation\"),\n\t\t\t...resourceLoader.getExtensions().errors.map(({ path, error }) => ({\n\t\t\t\ttype: \"error\" as const,\n\t\t\t\tmessage: `Failed to load extension \"${path}\": ${error}`,\n\t\t\t})),\n\t\t];\n\n\t\tconst modelPatterns = parsed.models ?? settingsManager.getEnabledModels();\n\t\tconst scopedModels =\n\t\t\tmodelPatterns && modelPatterns.length > 0 ? await resolveModelScope(modelPatterns, modelRegistry) : [];\n\t\tconst {\n\t\t\toptions: sessionOptions,\n\t\t\tcliThinkingFromModel,\n\t\t\tdiagnostics: sessionOptionDiagnostics,\n\t\t} = buildSessionOptions(\n\t\t\tparsed,\n\t\t\tscopedModels,\n\t\t\tsessionManager.buildSessionContext().messages.length > 0,\n\t\t\tmodelRegistry,\n\t\t\tsettingsManager,\n\t\t);\n\t\tdiagnostics.push(...sessionOptionDiagnostics);\n\n\t\tif (parsed.apiKey) {\n\t\t\tif (!sessionOptions.model) {\n\t\t\t\tdiagnostics.push({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\tmessage: \"--api-key requires a model to be specified via --model, --provider/--model, or --models\",\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tauthStorage.setRuntimeApiKey(sessionOptions.model.provider, parsed.apiKey);\n\t\t\t}\n\t\t}\n\n\t\tconst created = await createAgentSessionFromServices({\n\t\t\tservices,\n\t\t\tsessionManager,\n\t\t\tsessionStartEvent,\n\t\t\tmodel: sessionOptions.model,\n\t\t\tthinkingLevel: sessionOptions.thinkingLevel,\n\t\t\tscopedModels: sessionOptions.scopedModels,\n\t\t\ttools: sessionOptions.tools,\n\t\t\tcustomTools: sessionOptions.customTools,\n\t\t});\n\t\tconst cliThinkingOverride = parsed.thinking !== undefined || cliThinkingFromModel;\n\t\tif (created.session.model && cliThinkingOverride) {\n\t\t\tlet effectiveThinking = created.session.thinkingLevel;\n\t\t\tif (!created.session.model.reasoning) {\n\t\t\t\teffectiveThinking = \"off\";\n\t\t\t} else if (effectiveThinking === \"xhigh\" && !supportsXhigh(created.session.model)) {\n\t\t\t\teffectiveThinking = \"high\";\n\t\t\t}\n\t\t\tif (effectiveThinking !== created.session.thinkingLevel) {\n\t\t\t\tcreated.session.setThinkingLevel(effectiveThinking);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\t...created,\n\t\t\tservices,\n\t\t\tdiagnostics,\n\t\t};\n\t};\n\ttime(\"createRuntime\");\n\tconst runtime = await createAgentSessionRuntime(createRuntime, {\n\t\tcwd: sessionManager.getCwd(),\n\t\tagentDir,\n\t\tsessionManager,\n\t});\n\tconst { services, session, modelFallbackMessage } = runtime;\n\tconst { settingsManager, modelRegistry, resourceLoader } = services;\n\n\tif (parsed.help) {\n\t\tconst extensionFlags = resourceLoader\n\t\t\t.getExtensions()\n\t\t\t.extensions.flatMap((extension) => Array.from(extension.flags.values()));\n\t\tprintHelp(extensionFlags);\n\t\tprocess.exit(0);\n\t}\n\n\tif (parsed.listModels !== undefined) {\n\t\tconst searchPattern = typeof parsed.listModels === \"string\" ? parsed.listModels : undefined;\n\t\tawait listModels(modelRegistry, searchPattern);\n\t\tprocess.exit(0);\n\t}\n\n\t// Read piped stdin content (if any) - skip for RPC mode which uses stdin for JSON-RPC\n\tlet stdinContent: string | undefined;\n\tif (appMode !== \"rpc\") {\n\t\tstdinContent = await readPipedStdin();\n\t\tif (stdinContent !== undefined && appMode === \"interactive\") {\n\t\t\tappMode = \"print\";\n\t\t}\n\t}\n\ttime(\"readPipedStdin\");\n\n\tconst { initialMessage, initialImages } = await prepareInitialMessage(\n\t\tparsed,\n\t\tsettingsManager.getImageAutoResize(),\n\t\tstdinContent,\n\t);\n\ttime(\"prepareInitialMessage\");\n\tinitTheme(settingsManager.getTheme(), appMode === \"interactive\");\n\ttime(\"initTheme\");\n\n\t// Show deprecation warnings in interactive mode\n\tif (appMode === \"interactive\" && deprecationWarnings.length > 0) {\n\t\tawait showDeprecationWarnings(deprecationWarnings);\n\t}\n\n\tconst scopedModels = [...session.scopedModels];\n\ttime(\"resolveModelScope\");\n\treportDiagnostics(runtime.diagnostics);\n\tif (runtime.diagnostics.some((diagnostic) => diagnostic.type === \"error\")) {\n\t\tprocess.exit(1);\n\t}\n\ttime(\"createAgentSession\");\n\n\tif (appMode !== \"interactive\" && !session.model) {\n\t\tconsole.error(chalk.red(\"No models available.\"));\n\t\tconsole.error(chalk.yellow(\"\\nSet an API key environment variable:\"));\n\t\tconsole.error(\" ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, etc.\");\n\t\tconsole.error(chalk.yellow(`\\nOr create ${getModelsPath()}`));\n\t\tprocess.exit(1);\n\t}\n\n\tconst startupBenchmark = isTruthyEnvFlag(process.env.PI_STARTUP_BENCHMARK);\n\tif (startupBenchmark && appMode !== \"interactive\") {\n\t\tconsole.error(chalk.red(\"Error: PI_STARTUP_BENCHMARK only supports interactive mode\"));\n\t\tprocess.exit(1);\n\t}\n\n\tif (appMode === \"rpc\") {\n\t\tprintTimings();\n\t\tawait runRpcMode(runtime);\n\t} else if (appMode === \"interactive\") {\n\t\tif (scopedModels.length > 0 && (parsed.verbose || !settingsManager.getQuietStartup())) {\n\t\t\tconst modelList = scopedModels\n\t\t\t\t.map((sm) => {\n\t\t\t\t\tconst thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : \"\";\n\t\t\t\t\treturn `${sm.model.id}${thinkingStr}`;\n\t\t\t\t})\n\t\t\t\t.join(\", \");\n\t\t\tconsole.log(chalk.dim(`Model scope: ${modelList} ${chalk.gray(\"(Ctrl+P to cycle)\")}`));\n\t\t}\n\n\t\tconst interactiveMode = new InteractiveMode(runtime, {\n\t\t\tmigratedProviders,\n\t\t\tmodelFallbackMessage,\n\t\t\tinitialMessage,\n\t\t\tinitialImages,\n\t\t\tinitialMessages: parsed.messages,\n\t\t\tverbose: parsed.verbose,\n\t\t});\n\t\tif (startupBenchmark) {\n\t\t\tawait interactiveMode.init();\n\t\t\ttime(\"interactiveMode.init\");\n\t\t\tprintTimings();\n\t\t\tinteractiveMode.stop();\n\t\t\tstopThemeWatcher();\n\t\t\tif (process.stdout.writableLength > 0) {\n\t\t\t\tawait new Promise<void>((resolve) => process.stdout.once(\"drain\", resolve));\n\t\t\t}\n\t\t\tif (process.stderr.writableLength > 0) {\n\t\t\t\tawait new Promise<void>((resolve) => process.stderr.once(\"drain\", resolve));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tprintTimings();\n\t\tawait interactiveMode.run();\n\t} else {\n\t\tprintTimings();\n\t\tconst exitCode = await runPrintMode(runtime, {\n\t\t\tmode: toPrintOutputMode(appMode),\n\t\t\tmessages: parsed.messages,\n\t\t\tinitialMessage,\n\t\t\tinitialImages,\n\t\t});\n\t\tstopThemeWatcher();\n\t\trestoreStdout();\n\t\tif (exitCode !== 0) {\n\t\t\tprocess.exitCode = exitCode;\n\t\t}\n\t\treturn;\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAoDhD;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CA+CnD;AA+ID;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB/E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,GAAE,MAAsB,GAAG;IAC3D,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC9B,CAOA","sourcesContent":["/**\n * One-time migrations that run on startup.\n */\n\nimport chalk from \"chalk\";\nimport { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir, getBinDir } from \"./config.js\";\nimport { migrateKeybindingsConfig } from \"./core/keybindings.js\";\n\nconst MIGRATION_GUIDE_URL =\n\t\"https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/CHANGELOG.md#extensions-migration\";\nconst EXTENSIONS_DOC_URL = \"https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/extensions.md\";\n\n/**\n * Migrate legacy oauth.json and settings.json apiKeys to auth.json.\n *\n * @returns Array of provider names that were migrated\n */\nexport function migrateAuthToAuthJson(): string[] {\n\tconst agentDir = getAgentDir();\n\tconst authPath = join(agentDir, \"auth.json\");\n\tconst oauthPath = join(agentDir, \"oauth.json\");\n\tconst settingsPath = join(agentDir, \"settings.json\");\n\n\t// Skip if auth.json already exists\n\tif (existsSync(authPath)) return [];\n\n\tconst migrated: Record<string, unknown> = {};\n\tconst providers: string[] = [];\n\n\t// Migrate oauth.json\n\tif (existsSync(oauthPath)) {\n\t\ttry {\n\t\t\tconst oauth = JSON.parse(readFileSync(oauthPath, \"utf-8\"));\n\t\t\tfor (const [provider, cred] of Object.entries(oauth)) {\n\t\t\t\tmigrated[provider] = { type: \"oauth\", ...(cred as object) };\n\t\t\t\tproviders.push(provider);\n\t\t\t}\n\t\t\trenameSync(oauthPath, `${oauthPath}.migrated`);\n\t\t} catch {\n\t\t\t// Skip on error\n\t\t}\n\t}\n\n\t// Migrate settings.json apiKeys\n\tif (existsSync(settingsPath)) {\n\t\ttry {\n\t\t\tconst content = readFileSync(settingsPath, \"utf-8\");\n\t\t\tconst settings = JSON.parse(content);\n\t\t\tif (settings.apiKeys && typeof settings.apiKeys === \"object\") {\n\t\t\t\tfor (const [provider, key] of Object.entries(settings.apiKeys)) {\n\t\t\t\t\tif (!migrated[provider] && typeof key === \"string\") {\n\t\t\t\t\t\tmigrated[provider] = { type: \"api_key\", key };\n\t\t\t\t\t\tproviders.push(provider);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdelete settings.apiKeys;\n\t\t\t\twriteFileSync(settingsPath, JSON.stringify(settings, null, 2));\n\t\t\t}\n\t\t} catch {\n\t\t\t// Skip on error\n\t\t}\n\t}\n\n\tif (Object.keys(migrated).length > 0) {\n\t\tmkdirSync(dirname(authPath), { recursive: true });\n\t\twriteFileSync(authPath, JSON.stringify(migrated, null, 2), { mode: 0o600 });\n\t}\n\n\treturn providers;\n}\n\n/**\n * Migrate sessions from ~/.pi/agent/*.jsonl to proper session directories.\n *\n * Bug in v0.30.0: Sessions were saved to ~/.pi/agent/ instead of\n * ~/.pi/agent/sessions/<encoded-cwd>/. This migration moves them\n * to the correct location based on the cwd in their session header.\n *\n * See: https://github.com/badlogic/pi-mono/issues/320\n */\nexport function migrateSessionsFromAgentRoot(): void {\n\tconst agentDir = getAgentDir();\n\n\t// Find all .jsonl files directly in agentDir (not in subdirectories)\n\tlet files: string[];\n\ttry {\n\t\tfiles = readdirSync(agentDir)\n\t\t\t.filter((f) => f.endsWith(\".jsonl\"))\n\t\t\t.map((f) => join(agentDir, f));\n\t} catch {\n\t\treturn;\n\t}\n\n\tif (files.length === 0) return;\n\n\tfor (const file of files) {\n\t\ttry {\n\t\t\t// Read first line to get session header\n\t\t\tconst content = readFileSync(file, \"utf8\");\n\t\t\tconst firstLine = content.split(\"\\n\")[0];\n\t\t\tif (!firstLine?.trim()) continue;\n\n\t\t\tconst header = JSON.parse(firstLine);\n\t\t\tif (header.type !== \"session\" || !header.cwd) continue;\n\n\t\t\tconst cwd: string = header.cwd;\n\n\t\t\t// Compute the correct session directory (same encoding as session-manager.ts)\n\t\t\tconst safePath = `--${cwd.replace(/^[/\\\\]/, \"\").replace(/[/\\\\:]/g, \"-\")}--`;\n\t\t\tconst correctDir = join(agentDir, \"sessions\", safePath);\n\n\t\t\t// Create directory if needed\n\t\t\tif (!existsSync(correctDir)) {\n\t\t\t\tmkdirSync(correctDir, { recursive: true });\n\t\t\t}\n\n\t\t\t// Move the file\n\t\t\tconst fileName = file.split(\"/\").pop() || file.split(\"\\\\\").pop();\n\t\t\tconst newPath = join(correctDir, fileName!);\n\n\t\t\tif (existsSync(newPath)) continue; // Skip if target exists\n\n\t\t\trenameSync(file, newPath);\n\t\t} catch {\n\t\t\t// Skip files that can't be migrated\n\t\t}\n\t}\n}\n\n/**\n * Migrate commands/ to prompts/ if needed.\n * Works for both regular directories and symlinks.\n */\nfunction migrateCommandsToPrompts(baseDir: string, label: string): boolean {\n\tconst commandsDir = join(baseDir, \"commands\");\n\tconst promptsDir = join(baseDir, \"prompts\");\n\n\tif (existsSync(commandsDir) && !existsSync(promptsDir)) {\n\t\ttry {\n\t\t\trenameSync(commandsDir, promptsDir);\n\t\t\tconsole.log(chalk.green(`Migrated ${label} commands/ → prompts/`));\n\t\t\treturn true;\n\t\t} catch (err) {\n\t\t\tconsole.log(\n\t\t\t\tchalk.yellow(\n\t\t\t\t\t`Warning: Could not migrate ${label} commands/ to prompts/: ${err instanceof Error ? err.message : err}`,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction migrateKeybindingsConfigFile(): void {\n\tconst configPath = join(getAgentDir(), \"keybindings.json\");\n\tif (!existsSync(configPath)) return;\n\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(configPath, \"utf-8\")) as unknown;\n\t\tif (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n\t\t\treturn;\n\t\t}\n\t\tconst { config, migrated } = migrateKeybindingsConfig(parsed as Record<string, unknown>);\n\t\tif (!migrated) return;\n\t\twriteFileSync(configPath, `${JSON.stringify(config, null, 2)}\\n`, \"utf-8\");\n\t} catch {\n\t\t// Ignore malformed files during migration\n\t}\n}\n\n/**\n * Move fd/rg binaries from tools/ to bin/ if they exist.\n */\nfunction migrateToolsToBin(): void {\n\tconst agentDir = getAgentDir();\n\tconst toolsDir = join(agentDir, \"tools\");\n\tconst binDir = getBinDir();\n\n\tif (!existsSync(toolsDir)) return;\n\n\tconst binaries = [\"fd\", \"rg\", \"fd.exe\", \"rg.exe\"];\n\tlet movedAny = false;\n\n\tfor (const bin of binaries) {\n\t\tconst oldPath = join(toolsDir, bin);\n\t\tconst newPath = join(binDir, bin);\n\n\t\tif (existsSync(oldPath)) {\n\t\t\tif (!existsSync(binDir)) {\n\t\t\t\tmkdirSync(binDir, { recursive: true });\n\t\t\t}\n\t\t\tif (!existsSync(newPath)) {\n\t\t\t\ttry {\n\t\t\t\t\trenameSync(oldPath, newPath);\n\t\t\t\t\tmovedAny = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// Ignore errors\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Target exists, just delete the old one\n\t\t\t\ttry {\n\t\t\t\t\trmSync?.(oldPath, { force: true });\n\t\t\t\t} catch {\n\t\t\t\t\t// Ignore\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (movedAny) {\n\t\tconsole.log(chalk.green(`Migrated managed binaries tools/ → bin/`));\n\t}\n}\n\n/**\n * Check for deprecated hooks/ and tools/ directories.\n * Note: tools/ may contain fd/rg binaries extracted by pi, so only warn if it has other files.\n */\nfunction checkDeprecatedExtensionDirs(baseDir: string, label: string): string[] {\n\tconst hooksDir = join(baseDir, \"hooks\");\n\tconst toolsDir = join(baseDir, \"tools\");\n\tconst warnings: string[] = [];\n\n\tif (existsSync(hooksDir)) {\n\t\twarnings.push(`${label} hooks/ directory found. Hooks have been renamed to extensions.`);\n\t}\n\n\tif (existsSync(toolsDir)) {\n\t\t// Check if tools/ contains anything other than fd/rg (which are auto-extracted binaries)\n\t\ttry {\n\t\t\tconst entries = readdirSync(toolsDir);\n\t\t\tconst customTools = entries.filter((e) => {\n\t\t\t\tconst lower = e.toLowerCase();\n\t\t\t\treturn (\n\t\t\t\t\tlower !== \"fd\" && lower !== \"rg\" && lower !== \"fd.exe\" && lower !== \"rg.exe\" && !e.startsWith(\".\") // Ignore .DS_Store and other hidden files\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (customTools.length > 0) {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`${label} tools/ directory contains custom tools. Custom tools have been merged into extensions.`,\n\t\t\t\t);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Ignore read errors\n\t\t}\n\t}\n\n\treturn warnings;\n}\n\n/**\n * Run extension system migrations (commands→prompts) and collect warnings about deprecated directories.\n */\nfunction migrateExtensionSystem(cwd: string): string[] {\n\tconst agentDir = getAgentDir();\n\tconst projectDir = join(cwd, CONFIG_DIR_NAME);\n\n\t// Migrate commands/ to prompts/\n\tmigrateCommandsToPrompts(agentDir, \"Global\");\n\tmigrateCommandsToPrompts(projectDir, \"Project\");\n\n\t// Check for deprecated directories\n\tconst warnings = [\n\t\t...checkDeprecatedExtensionDirs(agentDir, \"Global\"),\n\t\t...checkDeprecatedExtensionDirs(projectDir, \"Project\"),\n\t];\n\n\treturn warnings;\n}\n\n/**\n * Print deprecation warnings and wait for keypress.\n */\nexport async function showDeprecationWarnings(warnings: string[]): Promise<void> {\n\tif (warnings.length === 0) return;\n\n\tfor (const warning of warnings) {\n\t\tconsole.log(chalk.yellow(`Warning: ${warning}`));\n\t}\n\tconsole.log(chalk.yellow(`\\nMove your extensions to the extensions/ directory.`));\n\tconsole.log(chalk.yellow(`Migration guide: ${MIGRATION_GUIDE_URL}`));\n\tconsole.log(chalk.yellow(`Documentation: ${EXTENSIONS_DOC_URL}`));\n\tconsole.log(chalk.dim(`\\nPress any key to continue...`));\n\n\tawait new Promise<void>((resolve) => {\n\t\tprocess.stdin.setRawMode?.(true);\n\t\tprocess.stdin.resume();\n\t\tprocess.stdin.once(\"data\", () => {\n\t\t\tprocess.stdin.setRawMode?.(false);\n\t\t\tprocess.stdin.pause();\n\t\t\tresolve();\n\t\t});\n\t});\n\tconsole.log();\n}\n\n/**\n * Run all migrations. Called once on startup.\n *\n * @returns Object with migration results and deprecation warnings\n */\nexport function runMigrations(cwd: string = process.cwd()): {\n\tmigratedAuthProviders: string[];\n\tdeprecationWarnings: string[];\n} {\n\tconst migratedAuthProviders = migrateAuthToAuthJson();\n\tmigrateSessionsFromAgentRoot();\n\tmigrateToolsToBin();\n\tmigrateKeybindingsConfigFile();\n\tconst deprecationWarnings = migrateExtensionSystem(cwd);\n\treturn { migratedAuthProviders, deprecationWarnings };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.js","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAA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AC,GAAG,EAAE,EAGvD;IACD,MAAM,qBAAqB,GAAG,qBAAqB,EAAE,CAAC;IACtD,4BAA4B,EAAE,CAAC;IAC/B,iBAAiB,EAAE,CAAC;IACpB,4BAA4B,EAAE,CAAC;IAC/B,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACxD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC;AAAA,CACtD","sourcesContent":["/**\n * One-time migrations that run on startup.\n */\n\nimport chalk from \"chalk\";\nimport { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir, getBinDir } from \"./config.js\";\nimport { migrateKeybindingsConfig } from \"./core/keybindings.js\";\n\nconst MIGRATION_GUIDE_URL =\n\t\"https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/CHANGELOG.md#extensions-migration\";\nconst EXTENSIONS_DOC_URL = \"https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/extensions.md\";\n\n/**\n * Migrate legacy oauth.json and settings.json apiKeys to auth.json.\n *\n * @returns Array of provider names that were migrated\n */\nexport function migrateAuthToAuthJson(): string[] {\n\tconst agentDir = getAgentDir();\n\tconst authPath = join(agentDir, \"auth.json\");\n\tconst oauthPath = join(agentDir, \"oauth.json\");\n\tconst settingsPath = join(agentDir, \"settings.json\");\n\n\t// Skip if auth.json already exists\n\tif (existsSync(authPath)) return [];\n\n\tconst migrated: Record<string, unknown> = {};\n\tconst providers: string[] = [];\n\n\t// Migrate oauth.json\n\tif (existsSync(oauthPath)) {\n\t\ttry {\n\t\t\tconst oauth = JSON.parse(readFileSync(oauthPath, \"utf-8\"));\n\t\t\tfor (const [provider, cred] of Object.entries(oauth)) {\n\t\t\t\tmigrated[provider] = { type: \"oauth\", ...(cred as object) };\n\t\t\t\tproviders.push(provider);\n\t\t\t}\n\t\t\trenameSync(oauthPath, `${oauthPath}.migrated`);\n\t\t} catch {\n\t\t\t// Skip on error\n\t\t}\n\t}\n\n\t// Migrate settings.json apiKeys\n\tif (existsSync(settingsPath)) {\n\t\ttry {\n\t\t\tconst content = readFileSync(settingsPath, \"utf-8\");\n\t\t\tconst settings = JSON.parse(content);\n\t\t\tif (settings.apiKeys && typeof settings.apiKeys === \"object\") {\n\t\t\t\tfor (const [provider, key] of Object.entries(settings.apiKeys)) {\n\t\t\t\t\tif (!migrated[provider] && typeof key === \"string\") {\n\t\t\t\t\t\tmigrated[provider] = { type: \"api_key\", key };\n\t\t\t\t\t\tproviders.push(provider);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdelete settings.apiKeys;\n\t\t\t\twriteFileSync(settingsPath, JSON.stringify(settings, null, 2));\n\t\t\t}\n\t\t} catch {\n\t\t\t// Skip on error\n\t\t}\n\t}\n\n\tif (Object.keys(migrated).length > 0) {\n\t\tmkdirSync(dirname(authPath), { recursive: true });\n\t\twriteFileSync(authPath, JSON.stringify(migrated, null, 2), { mode: 0o600 });\n\t}\n\n\treturn providers;\n}\n\n/**\n * Migrate sessions from ~/.pi/agent/*.jsonl to proper session directories.\n *\n * Bug in v0.30.0: Sessions were saved to ~/.pi/agent/ instead of\n * ~/.pi/agent/sessions/<encoded-cwd>/. This migration moves them\n * to the correct location based on the cwd in their session header.\n *\n * See: https://github.com/badlogic/pi-mono/issues/320\n */\nexport function migrateSessionsFromAgentRoot(): void {\n\tconst agentDir = getAgentDir();\n\n\t// Find all .jsonl files directly in agentDir (not in subdirectories)\n\tlet files: string[];\n\ttry {\n\t\tfiles = readdirSync(agentDir)\n\t\t\t.filter((f) => f.endsWith(\".jsonl\"))\n\t\t\t.map((f) => join(agentDir, f));\n\t} catch {\n\t\treturn;\n\t}\n\n\tif (files.length === 0) return;\n\n\tfor (const file of files) {\n\t\ttry {\n\t\t\t// Read first line to get session header\n\t\t\tconst content = readFileSync(file, \"utf8\");\n\t\t\tconst firstLine = content.split(\"\\n\")[0];\n\t\t\tif (!firstLine?.trim()) continue;\n\n\t\t\tconst header = JSON.parse(firstLine);\n\t\t\tif (header.type !== \"session\" || !header.cwd) continue;\n\n\t\t\tconst cwd: string = header.cwd;\n\n\t\t\t// Compute the correct session directory (same encoding as session-manager.ts)\n\t\t\tconst safePath = `--${cwd.replace(/^[/\\\\]/, \"\").replace(/[/\\\\:]/g, \"-\")}--`;\n\t\t\tconst correctDir = join(agentDir, \"sessions\", safePath);\n\n\t\t\t// Create directory if needed\n\t\t\tif (!existsSync(correctDir)) {\n\t\t\t\tmkdirSync(correctDir, { recursive: true });\n\t\t\t}\n\n\t\t\t// Move the file\n\t\t\tconst fileName = file.split(\"/\").pop() || file.split(\"\\\\\").pop();\n\t\t\tconst newPath = join(correctDir, fileName!);\n\n\t\t\tif (existsSync(newPath)) continue; // Skip if target exists\n\n\t\t\trenameSync(file, newPath);\n\t\t} catch {\n\t\t\t// Skip files that can't be migrated\n\t\t}\n\t}\n}\n\n/**\n * Migrate commands/ to prompts/ if needed.\n * Works for both regular directories and symlinks.\n */\nfunction migrateCommandsToPrompts(baseDir: string, label: string): boolean {\n\tconst commandsDir = join(baseDir, \"commands\");\n\tconst promptsDir = join(baseDir, \"prompts\");\n\n\tif (existsSync(commandsDir) && !existsSync(promptsDir)) {\n\t\ttry {\n\t\t\trenameSync(commandsDir, promptsDir);\n\t\t\tconsole.log(chalk.green(`Migrated ${label} commands/ → prompts/`));\n\t\t\treturn true;\n\t\t} catch (err) {\n\t\t\tconsole.log(\n\t\t\t\tchalk.yellow(\n\t\t\t\t\t`Warning: Could not migrate ${label} commands/ to prompts/: ${err instanceof Error ? err.message : err}`,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction migrateKeybindingsConfigFile(): void {\n\tconst configPath = join(getAgentDir(), \"keybindings.json\");\n\tif (!existsSync(configPath)) return;\n\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(configPath, \"utf-8\")) as unknown;\n\t\tif (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n\t\t\treturn;\n\t\t}\n\t\tconst { config, migrated } = migrateKeybindingsConfig(parsed as Record<string, unknown>);\n\t\tif (!migrated) return;\n\t\twriteFileSync(configPath, `${JSON.stringify(config, null, 2)}\\n`, \"utf-8\");\n\t} catch {\n\t\t// Ignore malformed files during migration\n\t}\n}\n\n/**\n * Move fd/rg binaries from tools/ to bin/ if they exist.\n */\nfunction migrateToolsToBin(): void {\n\tconst agentDir = getAgentDir();\n\tconst toolsDir = join(agentDir, \"tools\");\n\tconst binDir = getBinDir();\n\n\tif (!existsSync(toolsDir)) return;\n\n\tconst binaries = [\"fd\", \"rg\", \"fd.exe\", \"rg.exe\"];\n\tlet movedAny = false;\n\n\tfor (const bin of binaries) {\n\t\tconst oldPath = join(toolsDir, bin);\n\t\tconst newPath = join(binDir, bin);\n\n\t\tif (existsSync(oldPath)) {\n\t\t\tif (!existsSync(binDir)) {\n\t\t\t\tmkdirSync(binDir, { recursive: true });\n\t\t\t}\n\t\t\tif (!existsSync(newPath)) {\n\t\t\t\ttry {\n\t\t\t\t\trenameSync(oldPath, newPath);\n\t\t\t\t\tmovedAny = true;\n\t\t\t\t} catch {\n\t\t\t\t\t// Ignore errors\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Target exists, just delete the old one\n\t\t\t\ttry {\n\t\t\t\t\trmSync?.(oldPath, { force: true });\n\t\t\t\t} catch {\n\t\t\t\t\t// Ignore\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (movedAny) {\n\t\tconsole.log(chalk.green(`Migrated managed binaries tools/ → bin/`));\n\t}\n}\n\n/**\n * Check for deprecated hooks/ and tools/ directories.\n * Note: tools/ may contain fd/rg binaries extracted by pi, so only warn if it has other files.\n */\nfunction checkDeprecatedExtensionDirs(baseDir: string, label: string): string[] {\n\tconst hooksDir = join(baseDir, \"hooks\");\n\tconst toolsDir = join(baseDir, \"tools\");\n\tconst warnings: string[] = [];\n\n\tif (existsSync(hooksDir)) {\n\t\twarnings.push(`${label} hooks/ directory found. Hooks have been renamed to extensions.`);\n\t}\n\n\tif (existsSync(toolsDir)) {\n\t\t// Check if tools/ contains anything other than fd/rg (which are auto-extracted binaries)\n\t\ttry {\n\t\t\tconst entries = readdirSync(toolsDir);\n\t\t\tconst customTools = entries.filter((e) => {\n\t\t\t\tconst lower = e.toLowerCase();\n\t\t\t\treturn (\n\t\t\t\t\tlower !== \"fd\" && lower !== \"rg\" && lower !== \"fd.exe\" && lower !== \"rg.exe\" && !e.startsWith(\".\") // Ignore .DS_Store and other hidden files\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (customTools.length > 0) {\n\t\t\t\twarnings.push(\n\t\t\t\t\t`${label} tools/ directory contains custom tools. Custom tools have been merged into extensions.`,\n\t\t\t\t);\n\t\t\t}\n\t\t} catch {\n\t\t\t// Ignore read errors\n\t\t}\n\t}\n\n\treturn warnings;\n}\n\n/**\n * Run extension system migrations (commands→prompts) and collect warnings about deprecated directories.\n */\nfunction migrateExtensionSystem(cwd: string): string[] {\n\tconst agentDir = getAgentDir();\n\tconst projectDir = join(cwd, CONFIG_DIR_NAME);\n\n\t// Migrate commands/ to prompts/\n\tmigrateCommandsToPrompts(agentDir, \"Global\");\n\tmigrateCommandsToPrompts(projectDir, \"Project\");\n\n\t// Check for deprecated directories\n\tconst warnings = [\n\t\t...checkDeprecatedExtensionDirs(agentDir, \"Global\"),\n\t\t...checkDeprecatedExtensionDirs(projectDir, \"Project\"),\n\t];\n\n\treturn warnings;\n}\n\n/**\n * Print deprecation warnings and wait for keypress.\n */\nexport async function showDeprecationWarnings(warnings: string[]): Promise<void> {\n\tif (warnings.length === 0) return;\n\n\tfor (const warning of warnings) {\n\t\tconsole.log(chalk.yellow(`Warning: ${warning}`));\n\t}\n\tconsole.log(chalk.yellow(`\\nMove your extensions to the extensions/ directory.`));\n\tconsole.log(chalk.yellow(`Migration guide: ${MIGRATION_GUIDE_URL}`));\n\tconsole.log(chalk.yellow(`Documentation: ${EXTENSIONS_DOC_URL}`));\n\tconsole.log(chalk.dim(`\\nPress any key to continue...`));\n\n\tawait new Promise<void>((resolve) => {\n\t\tprocess.stdin.setRawMode?.(true);\n\t\tprocess.stdin.resume();\n\t\tprocess.stdin.once(\"data\", () => {\n\t\t\tprocess.stdin.setRawMode?.(false);\n\t\t\tprocess.stdin.pause();\n\t\t\tresolve();\n\t\t});\n\t});\n\tconsole.log();\n}\n\n/**\n * Run all migrations. Called once on startup.\n *\n * @returns Object with migration results and deprecation warnings\n */\nexport function runMigrations(cwd: string = process.cwd()): {\n\tmigratedAuthProviders: string[];\n\tdeprecationWarnings: string[];\n} {\n\tconst migratedAuthProviders = migrateAuthToAuthJson();\n\tmigrateSessionsFromAgentRoot();\n\tmigrateToolsToBin();\n\tmigrateKeybindingsConfigFile();\n\tconst deprecationWarnings = migrateExtensionSystem(cwd);\n\treturn { migratedAuthProviders, deprecationWarnings };\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/modes/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACjG,OAAO,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/**\n * Run modes for the coding agent.\n */\n\nexport { InteractiveMode, type InteractiveModeOptions } from \"./interactive/interactive-mode.js\";\nexport { type PrintModeOptions, runPrintMode } from \"./print-mode.js\";\nexport { type ModelInfo, RpcClient, type RpcClientOptions, type RpcEventListener } from \"./rpc/rpc-client.js\";\nexport { runRpcMode } from \"./rpc/rpc-mode.js\";\nexport type { RpcCommand, RpcResponse, RpcSessionState } from \"./rpc/rpc-types.js\";\n"]}
|