@bastani/atomic 0.9.9-alpha.1 → 0.9.9-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/builtin/cursor/CHANGELOG.md +12 -0
- package/dist/builtin/cursor/package.json +3 -3
- package/dist/builtin/intercom/CHANGELOG.md +14 -0
- package/dist/builtin/intercom/README.md +10 -3
- package/dist/builtin/intercom/broker/client.ts +2 -0
- package/dist/builtin/intercom/broker/send-handler.ts +22 -20
- package/dist/builtin/intercom/foreground-detach-handoff.ts +3 -1
- package/dist/builtin/intercom/inbound-idle-queue.ts +82 -0
- package/dist/builtin/intercom/index-heavy.ts +47 -37
- package/dist/builtin/intercom/intercom-tool.ts +6 -4
- package/dist/builtin/intercom/intercom-utils.ts +30 -0
- package/dist/builtin/intercom/lifecycle.ts +8 -5
- package/dist/builtin/intercom/package.json +3 -3
- package/dist/builtin/intercom/reply-tracker.ts +19 -19
- package/dist/builtin/intercom/session-target.ts +68 -0
- package/dist/builtin/intercom/skills/intercom/SKILL.md +7 -4
- package/dist/builtin/intercom/source-ownership.ts +34 -0
- package/dist/builtin/intercom/subagent-relay.ts +45 -20
- package/dist/builtin/intercom/terminal-ordering-barrier.ts +111 -0
- package/dist/builtin/intercom/types.ts +5 -0
- package/dist/builtin/mcp/CHANGELOG.md +13 -0
- package/dist/builtin/mcp/package.json +4 -4
- package/dist/builtin/subagents/CHANGELOG.md +13 -0
- package/dist/builtin/subagents/package.json +5 -5
- package/dist/builtin/subagents/src/runs/background/notify.ts +53 -9
- package/dist/builtin/subagents/src/shared/types-config.ts +1 -0
- package/dist/builtin/web-access/CHANGELOG.md +13 -0
- package/dist/builtin/web-access/package.json +3 -3
- package/dist/builtin/web-access/web-search-tool.ts +1 -2
- package/dist/builtin/workflows/CHANGELOG.md +13 -0
- package/dist/builtin/workflows/package.json +3 -3
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +18 -2
- package/dist/builtin/workflows/src/shared/serializable.ts +1 -1
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/internal-intercom-broker.d.ts.map +1 -1
- package/dist/bun/register-bedrock.d.ts.map +1 -1
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
- package/dist/bun/split-loader.d.ts.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/project-trust.d.ts.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/config-self-update.d.ts.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/core/agent-session-accessors.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-bash.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-export.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +9 -0
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts +4 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +35 -0
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +2 -1
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-models.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-skill-block.d.ts.map +1 -1
- package/dist/core/agent-session-state.d.ts.map +1 -1
- package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tree.d.ts.map +1 -1
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
- package/dist/core/async/format.d.ts.map +1 -1
- package/dist/core/async/job-manager.d.ts.map +1 -1
- package/dist/core/async/session-manager.d.ts.map +1 -1
- package/dist/core/async/types.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/auth-guidance.d.ts.map +1 -1
- package/dist/core/auth-storage-backends.d.ts.map +1 -1
- package/dist/core/auth-storage.d.ts +4 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/codex-fast-mode.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-parameters.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/deleted-ranges.d.ts.map +1 -1
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/context-window.d.ts.map +1 -1
- package/dist/core/copilot-anthropic-sse-repair.d.ts.map +1 -1
- package/dist/core/copilot-errors.d.ts.map +1 -1
- package/dist/core/copilot-gemini-payload-sanitizer.d.ts.map +1 -1
- package/dist/core/copilot-gemini-reasoning.d.ts.map +1 -1
- package/dist/core/copilot-gemini-tool-arguments.d.ts.map +1 -1
- package/dist/core/copilot-hosts.d.ts.map +1 -1
- package/dist/core/copilot-model-catalog.d.ts.map +1 -1
- package/dist/core/copilot-model-static-fallbacks.d.ts.map +1 -1
- package/dist/core/copilot-model-synthesis.d.ts.map +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/event-bus.d.ts.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/template-script.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/extensions/agent-events.d.ts.map +1 -1
- package/dist/core/extensions/api-types.d.ts +3 -1
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/command-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/event-results.d.ts.map +1 -1
- package/dist/core/extensions/event-types.d.ts.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +4 -0
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-core.d.ts.map +1 -1
- package/dist/core/extensions/loader-discovery.d.ts.map +1 -1
- package/dist/core/extensions/loader-resources.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +1 -0
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/message-types.d.ts +3 -0
- package/dist/core/extensions/message-types.d.ts.map +1 -1
- package/dist/core/extensions/message-types.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/reactive-widget.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-events.d.ts.map +1 -1
- package/dist/core/extensions/runner-handlers.d.ts.map +1 -1
- package/dist/core/extensions/runner-project-trust.d.ts.map +1 -1
- package/dist/core/extensions/runner-registries.d.ts.map +1 -1
- package/dist/core/extensions/runner-shortcuts.d.ts.map +1 -1
- package/dist/core/extensions/runner-ui.d.ts.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +3 -1
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/session-events.d.ts.map +1 -1
- package/dist/core/extensions/tool-events.d.ts.map +1 -1
- package/dist/core/extensions/tool-types.d.ts.map +1 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/model-registry-auth.d.ts.map +1 -1
- package/dist/core/model-registry-builtins.d.ts.map +1 -1
- package/dist/core/model-registry-builtins.js.map +1 -1
- package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
- package/dist/core/model-registry-custom-loader.js.map +1 -1
- package/dist/core/model-registry-dynamic.d.ts.map +1 -1
- package/dist/core/model-registry-loader.d.ts.map +1 -1
- package/dist/core/model-registry-schemas.d.ts +65 -13
- package/dist/core/model-registry-schemas.d.ts.map +1 -1
- package/dist/core/model-registry-schemas.js +5 -1
- package/dist/core/model-registry-schemas.js.map +1 -1
- package/dist/core/model-registry-types.d.ts.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-resolver-cli.d.ts.map +1 -1
- package/dist/core/model-resolver-defaults.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-patterns.d.ts.map +1 -1
- package/dist/core/model-resolver-scope.d.ts.map +1 -1
- package/dist/core/model-resolver-types.d.ts.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/openai-responses-payload-sanitizer.d.ts.map +1 -1
- package/dist/core/output-guard.d.ts.map +1 -1
- package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
- package/dist/core/package-manager-command.d.ts.map +1 -1
- package/dist/core/package-manager-constants.d.ts.map +1 -1
- package/dist/core/package-manager-env.d.ts.map +1 -1
- package/dist/core/package-manager-git.d.ts.map +1 -1
- package/dist/core/package-manager-manifest.d.ts.map +1 -1
- package/dist/core/package-manager-npm.d.ts.map +1 -1
- package/dist/core/package-manager-operations.d.ts.map +1 -1
- package/dist/core/package-manager-paths.d.ts.map +1 -1
- package/dist/core/package-manager-progress.d.ts.map +1 -1
- package/dist/core/package-manager-resolver.d.ts.map +1 -1
- package/dist/core/package-manager-resource-accumulator.d.ts.map +1 -1
- package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
- package/dist/core/package-manager-resource-files.d.ts.map +1 -1
- package/dist/core/package-manager-resource-patterns.d.ts.map +1 -1
- package/dist/core/package-manager-settings.d.ts.map +1 -1
- package/dist/core/package-manager-source.d.ts.map +1 -1
- package/dist/core/package-manager-types.d.ts.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/prompt-templates-async.d.ts.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-context-usage.d.ts.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-context-files.d.ts.map +1 -1
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-discovery.d.ts.map +1 -1
- package/dist/core/resource-loader-extensions.d.ts.map +1 -1
- package/dist/core/resource-loader-helpers.d.ts.map +1 -1
- package/dist/core/resource-loader-internals.d.ts.map +1 -1
- package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
- package/dist/core/resource-loader-paths.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-source-info.d.ts.map +1 -1
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/sdk-exports.d.ts.map +1 -1
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-entry-normalization.d.ts.map +1 -1
- package/dist/core/session-manager-archive.d.ts.map +1 -1
- package/dist/core/session-manager-classification.d.ts.map +1 -1
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-entries.d.ts.map +1 -1
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-list.d.ts.map +1 -1
- package/dist/core/session-manager-migrations.d.ts.map +1 -1
- package/dist/core/session-manager-paths.d.ts.map +1 -1
- package/dist/core/session-manager-storage.d.ts.map +1 -1
- package/dist/core/session-manager-types.d.ts.map +1 -1
- package/dist/core/session-manager-validation.d.ts.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-core.d.ts.map +1 -1
- package/dist/core/settings-manager-internals.d.ts.map +1 -1
- package/dist/core/settings-manager-resource-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-merge.d.ts.map +1 -1
- package/dist/core/settings-storage.d.ts.map +1 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/skills-async.d.ts.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/thinking-blocks.d.ts.map +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/tools/artifact-protocol.d.ts.map +1 -1
- package/dist/core/tools/artifacts.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/config.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/index.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/inline-input.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/key-router.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/row-intent.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/derivations.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/focus.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/selectors/projections.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/state-reducer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/state/state.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/types.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/tool/validate-questionnaire.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/body-residual-spacer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/component-binding.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/chat-row-view.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/option-list-view.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-box-renderer.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/submit-picker.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/tab-bar.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/components/wrapping-select.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/props-adapter.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/stateful-view.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-components.d.ts.map +1 -1
- package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts.map +1 -1
- package/dist/core/tools/bash-async-execution.d.ts.map +1 -1
- package/dist/core/tools/bash-async-jobs.d.ts.map +1 -1
- package/dist/core/tools/bash-async-output.d.ts.map +1 -1
- package/dist/core/tools/bash-interceptor.d.ts.map +1 -1
- package/dist/core/tools/bash-leading-cd.d.ts.map +1 -1
- package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/block-resolver.d.ts.map +1 -1
- package/dist/core/tools/conflict-registry.d.ts.map +1 -1
- package/dist/core/tools/directory-tree.d.ts.map +1 -1
- package/dist/core/tools/edit-diff-preserve.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/fetch-url.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/glob-path-utils.d.ts.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/apply.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/block.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/diff-preview.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/format.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/fs.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/index.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/input.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/messages.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/mismatch.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/normalize.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/parser.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/patcher.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/prefixes.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/recovery.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/snapshots.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/stream.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/tokenizer.d.ts.map +1 -1
- package/dist/core/tools/hashline-engine/types.d.ts.map +1 -1
- package/dist/core/tools/hashline.d.ts.map +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/notebook.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/oversized-tool-result.d.ts.map +1 -1
- package/dist/core/tools/path-utils.d.ts.map +1 -1
- package/dist/core/tools/read-document-extract.d.ts.map +1 -1
- package/dist/core/tools/read-selectors.d.ts.map +1 -1
- package/dist/core/tools/read-url.d.ts.map +1 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/resource-selectors.d.ts.map +1 -1
- package/dist/core/tools/search-details.d.ts.map +1 -1
- package/dist/core/tools/search-line-ranges.d.ts.map +1 -1
- package/dist/core/tools/search-native.d.ts.map +1 -1
- package/dist/core/tools/search.d.ts.map +1 -1
- package/dist/core/tools/structured-output.d.ts.map +1 -1
- package/dist/core/tools/todos-execute.d.ts.map +1 -1
- package/dist/core/tools/todos-locks.d.ts.map +1 -1
- package/dist/core/tools/todos-model.d.ts.map +1 -1
- package/dist/core/tools/todos-mutations.d.ts.map +1 -1
- package/dist/core/tools/todos-paths.d.ts.map +1 -1
- package/dist/core/tools/todos-render.d.ts.map +1 -1
- package/dist/core/tools/todos-storage.d.ts.map +1 -1
- package/dist/core/tools/todos-types.d.ts.map +1 -1
- package/dist/core/tools/todos-types.js +1 -1
- package/dist/core/tools/todos-types.js.map +1 -1
- package/dist/core/tools/todos.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +6 -2
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/tool-limits.d.ts.map +1 -1
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/url-ip-guards.d.ts.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/typebox-compat.d.ts +12 -0
- package/dist/core/typebox-compat.d.ts.map +1 -0
- package/dist/core/typebox-compat.js +10 -0
- package/dist/core/typebox-compat.js.map +1 -0
- package/dist/index-extensions.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main-app-mode.d.ts.map +1 -1
- package/dist/main-deferred-startup.d.ts.map +1 -1
- package/dist/main-early-input.d.ts.map +1 -1
- package/dist/main-session-options.d.ts.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-stdio.d.ts.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/migrations-config-values.d.ts.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/modes/index.d.ts.map +1 -1
- package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-utils.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/context-window-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/fast-mode-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-delete.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-header.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-tree.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-utils.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-options.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-component.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-help.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-label-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-list.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector-viewport.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/working-status.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-login.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-child-ordering.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-context.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-custom-ui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-dialogs.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-widgets.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-onboarding.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-resource-paths.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-slash-commands.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/model-search.d.ts.map +1 -1
- package/dist/modes/interactive/theme/color-utils.d.ts.map +1 -1
- package/dist/modes/interactive/theme/export-colors.d.ts.map +1 -1
- package/dist/modes/interactive/theme/global-theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/terminal-detection.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-parse.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/tui-theme.d.ts.map +1 -1
- package/dist/modes/interactive/whimsical-messages.d.ts.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-input.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/package-manager-cli-parser.d.ts.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/rpc-entry.d.ts.map +1 -1
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/deprecation.d.ts.map +1 -1
- package/dist/utils/event-loop.d.ts.map +1 -1
- package/dist/utils/exif-orientation.d.ts.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/fs-watch.d.ts.map +1 -1
- package/dist/utils/git-env.d.ts.map +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/html.d.ts.map +1 -1
- package/dist/utils/image-convert.d.ts.map +1 -1
- package/dist/utils/image-process.d.ts.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-worker.d.ts.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/markit.d.ts.map +1 -1
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/module-require.d.ts.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/photon.d.ts.map +1 -1
- package/dist/utils/pi-user-agent.d.ts.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/sleep.d.ts.map +1 -1
- package/dist/utils/split-launcher.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/docs/custom-provider.md +7 -1
- package/docs/extensions.md +19 -4
- package/docs/subagents.md +2 -0
- package/docs/workflows.md +2 -2
- package/examples/extensions/README.md +3 -1
- package/examples/extensions/subagent/schemas.ts +1 -1
- package/examples/extensions/tic-tac-toe.ts +1 -2
- package/examples/extensions/todo.ts +1 -2
- package/npm-shrinkwrap.json +214 -98
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector-model.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAc,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAElG,wBAAgB,WAAW,CAC1B,KAAK,EAAE,eAAe,EAAE,EACxB,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GACpC,QAAQ,EAAE,CAgIZ;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAkBrH;AAED,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,QAAQ,EAAE,EACrB,aAAa,EAAE,QAAQ,EAAE,EACzB,OAAO,EAAE,MAAM,GAAG,IAAI,GACpB,MAAM,CAwBR;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAiG1D","sourcesContent":["import type { SessionTreeNode } from \"../../../core/session-manager.ts\";\nimport { getSearchableText, hasTextContent } from \"./tree-selector-content.ts\";\nimport type { FlatNode, GutterInfo, ToolCallInfo, TreeListState } from \"./tree-selector-types.ts\";\n\nexport function flattenTree(\n\troots: SessionTreeNode[],\n\tcurrentLeafId: string | null,\n\ttoolCallMap: Map<string, ToolCallInfo>,\n): FlatNode[] {\n\tconst result: FlatNode[] = [];\n\ttoolCallMap.clear();\n\n\t// Indentation rules:\n\t// - At indent 0: stay at 0 unless parent has >1 children (then +1)\n\t// - At indent 1: children always go to indent 2 (visual grouping of subtree)\n\t// - At indent 2+: stay flat for single-child chains, +1 only if parent branches\n\n\t// Stack items: [node, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild]\n\ttype StackItem = [SessionTreeNode, number, boolean, boolean, boolean, GutterInfo[], boolean];\n\tconst stack: StackItem[] = [];\n\n\t// Determine which subtrees contain the active leaf (to sort current branch first)\n\t// Use iterative post-order traversal to avoid stack overflow\n\tconst containsActive = new Map<SessionTreeNode, boolean>();\n\tconst leafId = currentLeafId;\n\t{\n\t\t// Build list in pre-order, then process in reverse for post-order effect\n\t\tconst allNodes: SessionTreeNode[] = [];\n\t\tconst preOrderStack: SessionTreeNode[] = [...roots];\n\t\twhile (preOrderStack.length > 0) {\n\t\t\tconst node = preOrderStack.pop()!;\n\t\t\tallNodes.push(node);\n\t\t\t// Push children in reverse so they're processed left-to-right\n\t\t\tfor (let i = node.children.length - 1; i >= 0; i--) {\n\t\t\t\tpreOrderStack.push(node.children[i]);\n\t\t\t}\n\t\t}\n\t\t// Process in reverse (post-order): children before parents\n\t\tfor (let i = allNodes.length - 1; i >= 0; i--) {\n\t\t\tconst node = allNodes[i];\n\t\t\tlet has = leafId !== null && node.entry.id === leafId;\n\t\t\tfor (const child of node.children) {\n\t\t\t\tif (containsActive.get(child)) {\n\t\t\t\t\thas = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontainsActive.set(node, has);\n\t\t}\n\t}\n\n\t// Add roots in reverse order, prioritizing the one containing the active leaf\n\t// If multiple roots, treat them as children of a virtual root that branches\n\tconst multipleRoots = roots.length > 1;\n\tconst orderedRoots = [...roots].sort((a, b) => Number(containsActive.get(b)) - Number(containsActive.get(a)));\n\tfor (let i = orderedRoots.length - 1; i >= 0; i--) {\n\t\tconst isLast = i === orderedRoots.length - 1;\n\t\tstack.push([orderedRoots[i], multipleRoots ? 1 : 0, multipleRoots, multipleRoots, isLast, [], multipleRoots]);\n\t}\n\n\twhile (stack.length > 0) {\n\t\tconst [node, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild] = stack.pop()!;\n\n\t\t// Extract tool calls from assistant messages for later lookup\n\t\tconst entry = node.entry;\n\t\tif (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\tconst content = (entry.message as { content?: unknown }).content;\n\t\t\tif (Array.isArray(content)) {\n\t\t\t\tfor (const block of content) {\n\t\t\t\t\tif (typeof block === \"object\" && block !== null && \"type\" in block && block.type === \"toolCall\") {\n\t\t\t\t\t\tconst tc = block as { id: string; name: string; arguments: Record<string, unknown> };\n\t\t\t\t\t\ttoolCallMap.set(tc.id, { name: tc.name, arguments: tc.arguments });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tresult.push({ node, indent, showConnector, isLast, gutters, isVirtualRootChild });\n\n\t\tconst children = node.children;\n\t\tconst multipleChildren = children.length > 1;\n\n\t\t// Order children so the branch containing the active leaf comes first\n\t\tconst orderedChildren = (() => {\n\t\t\tconst prioritized: SessionTreeNode[] = [];\n\t\t\tconst rest: SessionTreeNode[] = [];\n\t\t\tfor (const child of children) {\n\t\t\t\tif (containsActive.get(child)) {\n\t\t\t\t\tprioritized.push(child);\n\t\t\t\t} else {\n\t\t\t\t\trest.push(child);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [...prioritized, ...rest];\n\t\t})();\n\n\t\t// Calculate child indent\n\t\tlet childIndent: number;\n\t\tif (multipleChildren) {\n\t\t\t// Parent branches: children get +1\n\t\t\tchildIndent = indent + 1;\n\t\t} else if (justBranched && indent > 0) {\n\t\t\t// First generation after a branch: +1 for visual grouping\n\t\t\tchildIndent = indent + 1;\n\t\t} else {\n\t\t\t// Single-child chain: stay flat\n\t\t\tchildIndent = indent;\n\t\t}\n\n\t\t// Build gutters for children\n\t\t// If this node showed a connector, add a gutter entry for descendants\n\t\t// Only add gutter if connector is actually displayed (not suppressed for virtual root children)\n\t\tconst connectorDisplayed = showConnector && !isVirtualRootChild;\n\t\t// When connector is displayed, add a gutter entry at the connector's position\n\t\t// Connector is at position (displayIndent - 1), so gutter should be there too\n\t\tconst currentDisplayIndent = multipleRoots ? Math.max(0, indent - 1) : indent;\n\t\tconst connectorPosition = Math.max(0, currentDisplayIndent - 1);\n\t\tconst childGutters: GutterInfo[] = connectorDisplayed\n\t\t\t? [...gutters, { position: connectorPosition, show: !isLast }]\n\t\t\t: gutters;\n\n\t\t// Add children in reverse order\n\t\tfor (let i = orderedChildren.length - 1; i >= 0; i--) {\n\t\t\tconst childIsLast = i === orderedChildren.length - 1;\n\t\t\tstack.push([\n\t\t\t\torderedChildren[i],\n\t\t\t\tchildIndent,\n\t\t\t\tmultipleChildren,\n\t\t\t\tmultipleChildren,\n\t\t\t\tchildIsLast,\n\t\t\t\tchildGutters,\n\t\t\t\tfalse,\n\t\t\t]);\n\t\t}\n\t}\n\n\treturn result;\n}\n\nexport function buildActivePath(flatNodes: FlatNode[], currentLeafId: string | null, activePathIds: Set<string>): void {\n\tactivePathIds.clear();\n\tif (!currentLeafId) return;\n\n\t// Build a map of id -> entry for parent lookup\n\tconst entryMap = new Map<string, FlatNode>();\n\tfor (const flatNode of flatNodes) {\n\t\tentryMap.set(flatNode.node.entry.id, flatNode);\n\t}\n\n\t// Walk from leaf to root\n\tlet currentId: string | null = currentLeafId;\n\twhile (currentId) {\n\t\tactivePathIds.add(currentId);\n\t\tconst node = entryMap.get(currentId);\n\t\tif (!node) break;\n\t\tcurrentId = node.node.entry.parentId ?? null;\n\t}\n}\n\nexport function findNearestVisibleIndex(\n\tflatNodes: FlatNode[],\n\tfilteredNodes: FlatNode[],\n\tentryId: string | null,\n): number {\n\tif (filteredNodes.length === 0) return 0;\n\n\t// Build a map for parent lookup\n\tconst entryMap = new Map<string, FlatNode>();\n\tfor (const flatNode of flatNodes) {\n\t\tentryMap.set(flatNode.node.entry.id, flatNode);\n\t}\n\n\t// Build a map of visible entry IDs to their indices in filteredNodes\n\tconst visibleIdToIndex = new Map<string, number>(filteredNodes.map((node, i) => [node.node.entry.id, i]));\n\n\t// Walk from entryId up to root, looking for a visible entry\n\tlet currentId = entryId;\n\twhile (currentId !== null) {\n\t\tconst index = visibleIdToIndex.get(currentId);\n\t\tif (index !== undefined) return index;\n\t\tconst node = entryMap.get(currentId);\n\t\tif (!node) break;\n\t\tcurrentId = node.node.entry.parentId ?? null;\n\t}\n\n\t// Fallback: last visible entry\n\treturn filteredNodes.length - 1;\n}\n\nexport function applyTreeFilter(state: TreeListState): void {\n\t// Update lastSelectedId only when we have a valid selection (non-empty list)\n\t// This preserves the selection when switching through empty filter results\n\tif (state.filteredNodes.length > 0) {\n\t\tstate.lastSelectedId = state.filteredNodes[state.selectedIndex]?.node.entry.id ?? state.lastSelectedId;\n\t}\n\n\tconst searchTokens = state.searchQuery.toLowerCase().split(/\\s+/).filter(Boolean);\n\n\tstate.filteredNodes = state.flatNodes.filter((flatNode) => {\n\t\tconst entry = flatNode.node.entry;\n\t\tconst isCurrentLeaf = entry.id === state.currentLeafId;\n\n\t\t// Skip assistant messages with only tool calls (no text) unless error/aborted\n\t\t// Always show current leaf so active position is visible\n\t\tif (entry.type === \"message\" && entry.message.role === \"assistant\" && !isCurrentLeaf) {\n\t\t\tconst msg = entry.message as { stopReason?: string; content?: unknown };\n\t\t\tconst hasText = hasTextContent(msg.content);\n\t\t\tconst isErrorOrAborted = msg.stopReason && msg.stopReason !== \"stop\" && msg.stopReason !== \"toolUse\";\n\t\t\t// Only hide if no text AND not an error/aborted message\n\t\t\tif (!hasText && !isErrorOrAborted) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Apply filter mode\n\t\tlet passesFilter = true;\n\t\t// Entry types hidden in default view (settings/bookkeeping)\n\t\tconst isSettingsEntry =\n\t\t\tentry.type === \"label\" ||\n\t\t\tentry.type === \"custom\" ||\n\t\t\tentry.type === \"model_change\" ||\n\t\t\tentry.type === \"thinking_level_change\" ||\n\t\t\tentry.type === \"context_window_change\" ||\n\t\t\tentry.type === \"session_info\";\n\n\t\tswitch (state.filterMode) {\n\t\t\tcase \"user-only\":\n\t\t\t\t// Just user messages\n\t\t\t\tpassesFilter = entry.type === \"message\" && entry.message.role === \"user\";\n\t\t\t\tbreak;\n\t\t\tcase \"no-tools\":\n\t\t\t\t// Default minus tool results\n\t\t\t\tpassesFilter = !isSettingsEntry && !(entry.type === \"message\" && entry.message.role === \"toolResult\");\n\t\t\t\tbreak;\n\t\t\tcase \"labeled-only\":\n\t\t\t\t// Just labeled entries\n\t\t\t\tpassesFilter = flatNode.node.label !== undefined;\n\t\t\t\tbreak;\n\t\t\tcase \"all\":\n\t\t\t\t// Show everything\n\t\t\t\tpassesFilter = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// Default mode: hide settings/bookkeeping entries\n\t\t\t\tpassesFilter = !isSettingsEntry;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!passesFilter) return false;\n\n\t\t// Apply search filter\n\t\tif (searchTokens.length > 0) {\n\t\t\tconst nodeText = getSearchableText(flatNode.node).toLowerCase();\n\t\t\treturn searchTokens.every((token) => nodeText.includes(token));\n\t\t}\n\n\t\treturn true;\n\t});\n\n\t// Filter out descendants of folded nodes.\n\tif (state.foldedNodes.size > 0) {\n\t\tconst skipSet = new Set<string>();\n\t\tfor (const flatNode of state.flatNodes) {\n\t\t\tconst { id, parentId } = flatNode.node.entry;\n\t\t\tif (parentId != null && (state.foldedNodes.has(parentId) || skipSet.has(parentId))) {\n\t\t\t\tskipSet.add(id);\n\t\t\t}\n\t\t}\n\t\tstate.filteredNodes = state.filteredNodes.filter((flatNode) => !skipSet.has(flatNode.node.entry.id));\n\t}\n\n\t// Recalculate visual structure (indent, connectors, gutters) based on visible tree\n\trecalculateVisualStructure(state);\n\n\t// Try to preserve cursor on the same node, or find nearest visible ancestor\n\tif (state.lastSelectedId) {\n\t\tstate.selectedIndex = findNearestVisibleIndex(state.flatNodes, state.filteredNodes, state.lastSelectedId);\n\t} else if (state.selectedIndex >= state.filteredNodes.length) {\n\t\t// Clamp index if out of bounds\n\t\tstate.selectedIndex = Math.max(0, state.filteredNodes.length - 1);\n\t}\n\n\t// Update lastSelectedId to the actual selection (may have changed due to parent walk)\n\tif (state.filteredNodes.length > 0) {\n\t\tstate.lastSelectedId = state.filteredNodes[state.selectedIndex]?.node.entry.id ?? state.lastSelectedId;\n\t}\n}\n\n/**\n * Recompute indentation/connectors for the filtered view\n *\n * Filtering can hide intermediate entries; descendants attach to the nearest visible ancestor.\n * Keep indentation semantics aligned with flattenTree() so single-child chains don't drift right.\n */\nfunction recalculateVisualStructure(state: TreeListState): void {\n\tif (state.filteredNodes.length === 0) return;\n\n\tconst visibleIds = new Set(state.filteredNodes.map((n) => n.node.entry.id));\n\n\t// Build entry map for efficient parent lookup (using full tree)\n\tconst entryMap = new Map<string, FlatNode>();\n\tfor (const flatNode of state.flatNodes) {\n\t\tentryMap.set(flatNode.node.entry.id, flatNode);\n\t}\n\n\t// Find nearest visible ancestor for a node\n\tconst findVisibleAncestor = (nodeId: string): string | null => {\n\t\tlet currentId = entryMap.get(nodeId)?.node.entry.parentId ?? null;\n\t\twhile (currentId !== null) {\n\t\t\tif (visibleIds.has(currentId)) {\n\t\t\t\treturn currentId;\n\t\t\t}\n\t\t\tcurrentId = entryMap.get(currentId)?.node.entry.parentId ?? null;\n\t\t}\n\t\treturn null;\n\t};\n\n\t// Build visible tree structure:\n\t// - visibleParent: nodeId → nearest visible ancestor (or null for roots)\n\t// - visibleChildren: parentId → list of visible children (in filteredNodes order)\n\tconst visibleParent = new Map<string, string | null>();\n\tconst visibleChildren = new Map<string | null, string[]>();\n\tvisibleChildren.set(null, []); // root-level nodes\n\n\tfor (const flatNode of state.filteredNodes) {\n\t\tconst nodeId = flatNode.node.entry.id;\n\t\tconst ancestorId = findVisibleAncestor(nodeId);\n\t\tvisibleParent.set(nodeId, ancestorId);\n\n\t\tif (!visibleChildren.has(ancestorId)) {\n\t\t\tvisibleChildren.set(ancestorId, []);\n\t\t}\n\t\tvisibleChildren.get(ancestorId)!.push(nodeId);\n\t}\n\n\t// Update multipleRoots based on visible roots\n\tconst visibleRootIds = visibleChildren.get(null)!;\n\tstate.multipleRoots = visibleRootIds.length > 1;\n\n\t// Build a map for quick lookup: nodeId → FlatNode\n\tconst filteredNodeMap = new Map<string, FlatNode>();\n\tfor (const flatNode of state.filteredNodes) {\n\t\tfilteredNodeMap.set(flatNode.node.entry.id, flatNode);\n\t}\n\n\t// DFS over the visible tree using flattenTree() indentation semantics\n\t// Stack items: [nodeId, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild]\n\ttype StackItem = [string, number, boolean, boolean, boolean, GutterInfo[], boolean];\n\tconst stack: StackItem[] = [];\n\n\t// Add visible roots in reverse order (to process in forward order via stack)\n\tfor (let i = visibleRootIds.length - 1; i >= 0; i--) {\n\t\tconst isLast = i === visibleRootIds.length - 1;\n\t\tstack.push([\n\t\t\tvisibleRootIds[i],\n\t\t\tstate.multipleRoots ? 1 : 0,\n\t\t\tstate.multipleRoots,\n\t\t\tstate.multipleRoots,\n\t\t\tisLast,\n\t\t\t[],\n\t\t\tstate.multipleRoots,\n\t\t]);\n\t}\n\n\twhile (stack.length > 0) {\n\t\tconst [nodeId, indent, justBranched, showConnector, isLast, gutters, isVirtualRootChild] = stack.pop()!;\n\n\t\tconst flatNode = filteredNodeMap.get(nodeId);\n\t\tif (!flatNode) continue;\n\n\t\t// Update this node's visual properties\n\t\tflatNode.indent = indent;\n\t\tflatNode.showConnector = showConnector;\n\t\tflatNode.isLast = isLast;\n\t\tflatNode.gutters = gutters;\n\t\tflatNode.isVirtualRootChild = isVirtualRootChild;\n\n\t\t// Get visible children of this node\n\t\tconst children = visibleChildren.get(nodeId) || [];\n\t\tconst multipleChildren = children.length > 1;\n\n\t\t// Child indent follows flattenTree(): branch points (and first generation after a branch) shift +1\n\t\tlet childIndent: number;\n\t\tif (multipleChildren) {\n\t\t\tchildIndent = indent + 1;\n\t\t} else if (justBranched && indent > 0) {\n\t\t\tchildIndent = indent + 1;\n\t\t} else {\n\t\t\tchildIndent = indent;\n\t\t}\n\n\t\t// Child gutters follow flattenTree() connector/gutter rules\n\t\tconst connectorDisplayed = showConnector && !isVirtualRootChild;\n\t\tconst currentDisplayIndent = state.multipleRoots ? Math.max(0, indent - 1) : indent;\n\t\tconst connectorPosition = Math.max(0, currentDisplayIndent - 1);\n\t\tconst childGutters: GutterInfo[] = connectorDisplayed\n\t\t\t? [...gutters, { position: connectorPosition, show: !isLast }]\n\t\t\t: gutters;\n\n\t\t// Add children in reverse order (to process in forward order via stack)\n\t\tfor (let i = children.length - 1; i >= 0; i--) {\n\t\t\tconst childIsLast = i === children.length - 1;\n\t\t\tstack.push([\n\t\t\t\tchildren[i],\n\t\t\t\tchildIndent,\n\t\t\t\tmultipleChildren,\n\t\t\t\tmultipleChildren,\n\t\t\t\tchildIsLast,\n\t\t\t\tchildGutters,\n\t\t\t\tfalse,\n\t\t\t]);\n\t\t}\n\t}\n\n\t// Store visible tree maps for ancestor/descendant lookups in navigation\n\tstate.visibleParentMap = visibleParent;\n\tstate.visibleChildrenMap = visibleChildren;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tree-selector-model.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAc,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAElG,wBAAgB,WAAW,CAC1B,KAAK,EAAE,eAAe,EAAE,EACxB,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GACpC,QAAQ,EAAE,CAgIZ;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAkBrH;AAED,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,QAAQ,EAAE,EACrB,aAAa,EAAE,QAAQ,EAAE,EACzB,OAAO,EAAE,MAAM,GAAG,IAAI,GACpB,MAAM,CAwBR;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAiG1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector-types.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,sFAAsF;AACtF,MAAM,WAAW,UAAU;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACd;AAED,yCAAyC;AACzC,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,aAAa,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,kFAAkF;IAClF,kBAAkB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,mCAAmC;AACnC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,KAAK,CAAC;AAEvF,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC7B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,EAAE,QAAQ,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACvC,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,kBAAkB,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB"
|
|
1
|
+
{"version":3,"file":"tree-selector-types.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,sFAAsF;AACtF,MAAM,WAAW,UAAU;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACd;AAED,yCAAyC;AACzC,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,eAAe,CAAC;IACtB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,aAAa,EAAE,OAAO,CAAC;IACvB,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,kFAAkF;IAClF,kBAAkB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAClD,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,mCAAmC;AACnC,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,KAAK,CAAC;AAEvF,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC7B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,EAAE,QAAQ,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACvC,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7C,kBAAkB,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector-viewport.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-viewport.ts"],"names":[],"mappings":"AACA,OAAO,EAMN,KAAK,qBAAqB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA8B/F"
|
|
1
|
+
{"version":3,"file":"tree-selector-viewport.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-viewport.ts"],"names":[],"mappings":"AACA,OAAO,EAMN,KAAK,qBAAqB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,qBAAqB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA8B/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC"
|
|
1
|
+
{"version":3,"file":"tree-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trust-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/trust-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgC,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAGN,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,MAAM,gCAAgC,CAAC;AAKxC,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7C,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACrB;AAaD,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAY;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsC;IACvE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAa;IAE9C,YAAY,OAAO,EAAE,oBAAoB,EA2CxC;IAED,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,UAAU;IAiBlB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAgBjC;CACD"
|
|
1
|
+
{"version":3,"file":"trust-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/trust-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgC,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAGN,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,MAAM,gCAAgC,CAAC;AAKxC,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7C,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACrB;AAaD,qBAAa,sBAAuB,SAAQ,SAAS;IACpD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAY;IAC1C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAsC;IACvE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAa;IAE9C,YAAY,OAAO,EAAE,oBAAoB,EA2CxC;IAED,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,UAAU;IAiBlB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAgBjC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-message-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAiD,MAAM,wBAAwB,CAAC;AAIlH,UAAU,eAAe;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,cAAM,eAAgB,YAAW,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,aAAa,CAAa;IAC3B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAc;IAEhC,YAAY,QAAQ,EAAE,eAAe,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAMlE;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA8C9B;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAuBjC;CACD;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;IAC1D,OAAO,CAAC,WAAW,CAAkB;IAErC,YACC,QAAQ,EAAE,eAAe,EAAE,EAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACnC,QAAQ,EAAE,MAAM,IAAI,EACpB,iBAAiB,CAAC,EAAE,MAAM,EAiC1B;IAED,cAAc,IAAI,eAAe,CAEhC;CACD"
|
|
1
|
+
{"version":3,"file":"user-message-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAiD,MAAM,wBAAwB,CAAC;AAIlH,UAAU,eAAe;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,cAAM,eAAgB,YAAW,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,aAAa,CAAa;IAC3B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,CAAC,UAAU,CAAc;IAEhC,YAAY,QAAQ,EAAE,eAAe,EAAE,EAAE,iBAAiB,CAAC,EAAE,MAAM,EAMlE;IAED,UAAU,IAAI,IAAI,CAEjB;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA8C9B;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAuBjC;CACD;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;IAC1D,OAAO,CAAC,WAAW,CAAkB;IAErC,YACC,QAAQ,EAAE,eAAe,EAAE,EAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EACnC,QAAQ,EAAE,MAAM,IAAI,EACpB,iBAAiB,CAAC,EAAE,MAAM,EAiC1B;IAED,cAAc,IAAI,eAAe,CAEhC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAY,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAOtF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAS;IAE1B,YAAY,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,aAAkC,EAAE,SAAS,SAAI,EAMzF;IAED,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAGlC;IAED,OAAO,CAAC,OAAO;IAkBN,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CASvC;CACD"
|
|
1
|
+
{"version":3,"file":"user-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/user-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,SAAS,EAAY,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAOtF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAS;IAE1B,YAAY,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,aAAkC,EAAE,SAAS,SAAI,EAMzF;IAED,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAGlC;IAED,OAAO,CAAC,OAAO;IAkBN,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CASvC;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-truncate.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/visual-truncate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,oBAAoB;IACpC,kCAAkC;IAClC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAU,GAClB,oBAAoB,CAkBtB"
|
|
1
|
+
{"version":3,"file":"visual-truncate.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/visual-truncate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,oBAAoB;IACpC,kCAAkC;IAClC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAU,GAClB,oBAAoB,CAkBtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"working-status.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/working-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,WAAW,6BAA6B;IAC5C,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,sEAAsE;IACtE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC;AAED;;;;;;GAMG;AACH,qBAAa,sBAAuB,YAAW,SAAS;IACtD,iBAAyB,OAAO,CAAgC;IAEhE,YAAY,OAAO,GAAE,6BAAkC,EAEvD;IAEA,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAa9B;IAED,UAAU,IAAI,IAAI,CAAG;CACtB"
|
|
1
|
+
{"version":3,"file":"working-status.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/working-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,WAAW,6BAA6B;IAC5C,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,sEAAsE;IACtE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC;AAED;;;;;;GAMG;AACH,qBAAa,sBAAuB,YAAW,SAAS;IACtD,iBAAyB,OAAO,CAAgC;IAEhE,YAAY,OAAO,GAAE,6BAAkC,EAEvD;IAEA,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAa9B;IAED,UAAU,IAAI,IAAI,CAAG;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-agent-events.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-agent-events.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type Message, type AgentSessionEvent, Loader, Spacer, Text, pickWhimsicalWorkingMessage, AssistantMessageComponent, CountdownTimer, keyText, ToolExecutionComponent, theme } from \"./interactive-mode-deps.ts\";\nimport { appendNewChildrenBeforeAttachedChild } from \"./interactive-child-ordering.ts\";\n\nInteractiveModeBase.prototype.subscribeToAgent = function(this: InteractiveModeBase): void {\n this.unsubscribe = this.session.subscribe(async (event) => {\n await this.handleEvent(event);\n });\n };\n\nInteractiveModeBase.prototype.handleEvent = async function(this: InteractiveModeBase, event: AgentSessionEvent): Promise<void> {\n if (!this.isInitialized) {\n await this.init();\n }\n\n this.footer.invalidate();\n\n switch (event.type) {\n case \"agent_start\":\n this.pendingTools.clear();\n if (this.settingsManager.getShowTerminalProgress()) {\n this.ui.terminal.setProgress(true);\n }\n // Restore main escape handler if retry handler is still active\n // (retry success event fires later, but we need main handler now)\n if (this.retryEscapeHandler) {\n this.defaultEditor.onEscape = this.retryEscapeHandler;\n this.retryEscapeHandler = undefined;\n }\n if (this.retryCountdown) {\n this.retryCountdown.dispose();\n this.retryCountdown = undefined;\n }\n if (this.retryLoader) {\n this.retryLoader.stop();\n this.retryLoader = undefined;\n }\n if (this.fallbackLoader) {\n this.fallbackLoader.stop();\n this.fallbackLoader = undefined;\n }\n this.stopWorkingLoader();\n if (this.workingVisible) {\n this.loadingAnimation = this.createWorkingLoader();\n this.statusContainer.addChild(this.loadingAnimation);\n }\n this.ui.requestRender();\n break;\n\n case \"turn_start\": {\n this.workingMessage = pickWhimsicalWorkingMessage();\n if (this.loadingAnimation) {\n this.loadingAnimation.setMessage(this.workingMessage);\n }\n break;\n }\n\n case \"turn_end\": {\n this.workingMessage = undefined;\n if (this.loadingAnimation) {\n this.loadingAnimation.setMessage(this.defaultWorkingMessage);\n }\n break;\n }\n\n case \"queue_update\":\n this.updatePendingMessagesDisplay();\n this.ui.requestRender();\n break;\n\n case \"session_info_changed\":\n this.updateTerminalTitle();\n this.footer.invalidate();\n this.ui.requestRender();\n break;\n\n case \"model_changed\":\n this.refreshBuiltInHeader();\n this.updateEditorBorderColor();\n break;\n\n case \"thinking_level_changed\":\n this.footer.invalidate();\n this.refreshBuiltInHeader();\n this.updateEditorBorderColor();\n break;\n\n case \"context_window_changed\":\n this.footer.invalidate();\n this.usageMeter.invalidate();\n this.ui.requestRender();\n break;\n\n case \"message_start\":\n if (event.message.role === \"custom\") {\n appendNewChildrenBeforeAttachedChild(\n this.chatContainer,\n this.streamingComponent,\n () => this.addMessageToChat(event.message),\n );\n this.ui.requestRender();\n } else if (event.message.role === \"user\") {\n if (!this.consumeDeferredRenderedUserInput(this.getUserMessageText(event.message))) {\n this.addMessageToChat(event.message);\n }\n this.updatePendingMessagesDisplay();\n this.ui.requestRender();\n } else if (event.message.role === \"assistant\") {\n this.streamingComponent = new AssistantMessageComponent(\n undefined,\n this.hideThinkingBlock,\n this.getMarkdownThemeWithSettings(),\n this.hiddenThinkingLabel,\n this.outputPad,\n );\n this.streamingMessage = event.message;\n this.chatContainer.addChild(this.streamingComponent);\n this.streamingComponent.updateContent(this.streamingMessage);\n this.ui.requestRender();\n }\n break;\n\n case \"message_update\":\n if (this.streamingComponent && event.message.role === \"assistant\") {\n this.streamingMessage = event.message;\n this.streamingComponent.updateContent(this.streamingMessage);\n\n for (const content of this.streamingMessage.content) {\n if (content.type === \"toolCall\") {\n if (!this.pendingTools.has(content.id)) {\n const component = new ToolExecutionComponent(\n content.name,\n content.id,\n content.arguments,\n {\n showImages: this.settingsManager.getShowImages(),\n imageWidthCells: this.settingsManager.getImageWidthCells(),\n },\n this.getRegisteredToolDefinition(content.name),\n this.ui,\n this.sessionManager.getCwd(),\n );\n component.setExpanded(this.toolOutputExpanded);\n this.chatContainer.addChild(component);\n this.pendingTools.set(content.id, component);\n } else {\n const component = this.pendingTools.get(content.id);\n if (component) {\n component.updateArgs(content.arguments);\n }\n }\n }\n }\n this.ui.requestRender();\n }\n break;\n\n case \"message_end\":\n if (event.message.role === \"user\") break;\n if (this.streamingComponent && event.message.role === \"assistant\") {\n this.streamingMessage = event.message;\n let errorMessage: string | undefined;\n if (this.streamingMessage.stopReason === \"aborted\") {\n const existingAbortMessage =\n this.streamingMessage.errorMessage && this.streamingMessage.errorMessage !== \"Request was aborted\"\n ? this.streamingMessage.errorMessage\n : undefined;\n const retryAttempt = this.session.retryAttempt;\n errorMessage = existingAbortMessage ?? (\n retryAttempt > 0\n ? `Aborted after ${retryAttempt} retry attempt${retryAttempt > 1 ? \"s\" : \"\"}`\n : \"Operation aborted\"\n );\n this.streamingMessage.errorMessage = errorMessage;\n }\n this.streamingComponent.updateContent(this.streamingMessage);\n\n if (\n this.streamingMessage.stopReason === \"aborted\" ||\n this.streamingMessage.stopReason === \"error\"\n ) {\n if (!errorMessage) {\n errorMessage = this.streamingMessage.errorMessage || \"Error\";\n }\n for (const [, component] of this.pendingTools.entries()) {\n component.updateResult({\n content: [{ type: \"text\", text: errorMessage }],\n isError: true,\n });\n }\n this.pendingTools.clear();\n } else {\n // Args are now complete - trigger diff computation for edit tools\n for (const [, component] of this.pendingTools.entries()) {\n component.setArgsComplete();\n }\n }\n this.streamingComponent = undefined;\n this.streamingMessage = undefined;\n this.footer.invalidate();\n }\n this.ui.requestRender();\n break;\n\n case \"tool_execution_start\": {\n let component = this.pendingTools.get(event.toolCallId);\n if (!component) {\n component = new ToolExecutionComponent(\n event.toolName,\n event.toolCallId,\n event.args,\n {\n showImages: this.settingsManager.getShowImages(),\n imageWidthCells: this.settingsManager.getImageWidthCells(),\n },\n this.getRegisteredToolDefinition(event.toolName),\n this.ui,\n this.sessionManager.getCwd(),\n );\n component.setExpanded(this.toolOutputExpanded);\n this.chatContainer.addChild(component);\n this.pendingTools.set(event.toolCallId, component);\n }\n component.markExecutionStarted();\n this.ui.requestRender();\n break;\n }\n\n case \"tool_execution_update\": {\n const component = this.pendingTools.get(event.toolCallId);\n if (component) {\n component.updateResult(\n { ...event.partialResult, isError: false },\n true,\n );\n this.ui.requestRender();\n }\n break;\n }\n\n case \"tool_execution_end\": {\n const component = this.pendingTools.get(event.toolCallId);\n if (component) {\n component.updateResult({ ...event.result, isError: event.isError });\n this.pendingTools.delete(event.toolCallId);\n this.ui.requestRender();\n }\n break;\n }\n\n case \"agent_end\":\n if (this.settingsManager.getShowTerminalProgress()) {\n this.ui.terminal.setProgress(false);\n }\n if (this.loadingAnimation) {\n this.loadingAnimation.stop();\n this.loadingAnimation = undefined;\n this.statusContainer.clear();\n }\n if (this.streamingComponent) {\n this.chatContainer.removeChild(this.streamingComponent);\n this.streamingComponent = undefined;\n this.streamingMessage = undefined;\n }\n this.pendingTools.clear();\n\n\t\tif (this.pendingLoadedResourcesDisclosure) {\n\t\t\tthis.pendingLoadedResourcesDisclosure = false;\n\t\t\tthis.deferLoadedResourcesDisclosureUntilAgentEnd = false;\n\t\t\tthis.showLoadedResources({ force: true, showDiagnosticsWhenQuiet: true, targetContainer: this.startupNoticesContainer });\n\t\t\t// Keep the subscription warning after the RESOURCES disclosure.\n\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, this.startupNoticesContainer);\n\t\t\tthis.showStartupNoticesIfNeeded(this.startupNoticesContainer);\n\t\t}\n await this.checkShutdownRequested();\n\n this.ui.requestRender();\n break;\n\n case \"compaction_start\": {\n if (this.settingsManager.getShowTerminalProgress()) {\n this.ui.terminal.setProgress(true);\n }\n // Keep editor active; submissions are queued during compaction.\n this.autoCompactionEscapeHandler = this.defaultEditor.onEscape;\n this.defaultEditor.onEscape = () => {\n this.session.abortCompaction();\n };\n this.statusContainer.clear();\n const cancelHint = `(${keyText(\"app.interrupt\")} Cancel)`;\n const isOverflowAutoCompaction = event.reason === \"overflow\";\n const label =\n event.reason === \"manual\"\n ? `Compacting context... ${cancelHint}`\n : `${isOverflowAutoCompaction ? \"Context overflow detected. \" : \"\"}Auto-compacting... ${cancelHint}`;\n this.autoCompactionLoader = new Loader(\n this.ui,\n (spinner) => theme.fg(\"accent\", spinner),\n (text) => theme.fg(isOverflowAutoCompaction ? \"warning\" : \"muted\", text),\n label,\n );\n this.statusContainer.addChild(this.autoCompactionLoader);\n this.ui.requestRender();\n break;\n }\n\n case \"compaction_end\": {\n if (this.settingsManager.getShowTerminalProgress()) {\n this.ui.terminal.setProgress(false);\n }\n if (this.autoCompactionEscapeHandler) {\n this.defaultEditor.onEscape = this.autoCompactionEscapeHandler;\n this.autoCompactionEscapeHandler = undefined;\n }\n if (this.autoCompactionLoader) {\n this.autoCompactionLoader.stop();\n this.autoCompactionLoader = undefined;\n this.statusContainer.clear();\n }\n if (event.aborted) {\n if (event.reason === \"manual\") {\n this.showError(\"Compaction cancelled\");\n } else {\n this.showStatus(\"Auto-compaction cancelled\");\n }\n } else if (event.result && !event.errorMessage) {\n this.chatContainer.clear();\n this.rebuildChatFromMessages({ suppressCompactionBoundary: event.result });\n this.addCompactionBoundaryToChat(event.result);\n this.footer.invalidate();\n } else if (event.errorMessage) {\n if (event.reason === \"manual\") {\n this.showError(event.errorMessage);\n } else {\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Text(theme.fg(\"error\", event.errorMessage), 1, 0),\n );\n }\n }\n void this.flushCompactionQueue({ willRetry: event.willRetry });\n this.ui.requestRender();\n break;\n }\n\n\n case \"auto_retry_start\": {\n // Set up escape to abort retry\n this.retryEscapeHandler = this.defaultEditor.onEscape;\n this.defaultEditor.onEscape = () => {\n this.session.abortRetry();\n };\n // Show retry indicator\n this.statusContainer.clear();\n this.retryCountdown?.dispose();\n const retryMessage = (seconds: number) =>\n `Retrying (${event.attempt}/${event.maxAttempts}) in ${seconds}s... (${keyText(\"app.interrupt\")} Cancel)`;\n this.retryLoader = new Loader(\n this.ui,\n (spinner) => theme.fg(\"warning\", spinner),\n (text) => theme.fg(\"muted\", text),\n retryMessage(Math.ceil(event.delayMs / 1000)),\n );\n this.retryCountdown = new CountdownTimer(\n event.delayMs,\n this.ui,\n (seconds) => {\n this.retryLoader?.setMessage(retryMessage(seconds));\n },\n () => {\n this.retryCountdown = undefined;\n },\n );\n this.statusContainer.addChild(this.retryLoader);\n this.ui.requestRender();\n break;\n }\n\n\n case \"model_fallback_start\": {\n this.statusContainer.clear();\n if (this.fallbackLoader) {\n this.fallbackLoader.stop();\n this.fallbackLoader = undefined;\n }\n this.fallbackLoader = new Loader(\n this.ui,\n (spinner) => theme.fg(\"warning\", spinner),\n (text) => theme.fg(\"muted\", text),\n `Falling back from ${event.from} to ${event.to}...`,\n );\n this.statusContainer.addChild(this.fallbackLoader);\n this.ui.requestRender();\n break;\n }\n\n case \"model_fallback_end\": {\n if (this.fallbackLoader) {\n this.fallbackLoader.stop();\n this.fallbackLoader = undefined;\n }\n this.statusContainer.clear();\n this.ui.requestRender();\n break;\n }\n case \"auto_retry_end\": {\n // Restore escape handler\n if (this.retryEscapeHandler) {\n this.defaultEditor.onEscape = this.retryEscapeHandler;\n this.retryEscapeHandler = undefined;\n }\n if (this.retryCountdown) {\n this.retryCountdown.dispose();\n this.retryCountdown = undefined;\n }\n // Stop loader\n if (this.retryLoader) {\n this.retryLoader.stop();\n this.retryLoader = undefined;\n this.statusContainer.clear();\n }\n // Show error only on final failure (success shows normal response)\n if (!event.success) {\n this.showError(\n `Retry failed after ${event.attempt} attempts: ${event.finalError || \"Unknown error\"}`,\n );\n }\n this.ui.requestRender();\n break;\n }\n\n case \"agent_continue_error\": {\n this.showError(event.errorMessage);\n this.ui.requestRender();\n break;\n }\n }\n };\n\nInteractiveModeBase.prototype.getUserMessageText = function(this: InteractiveModeBase, message: Message): string {\n if (message.role !== \"user\") return \"\";\n const textBlocks =\n typeof message.content === \"string\"\n ? [{ type: \"text\", text: message.content }]\n : message.content.filter((c: { type: string }) => c.type === \"text\");\n return textBlocks.map((c) => (c as { text: string }).text).join(\"\");\n };\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-agent-events.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-agent-events.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-auth-login.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-auth-login.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type Api, type Model, type OAuthProviderId, type OAuthSelectPrompt, path, getAuthPath, getDocsPath, defaultModelPerProvider, ExtensionSelectorComponent, LoginDialogComponent, theme } from \"./interactive-mode-deps.ts\";\nimport { hasDefaultModelProvider, isUnknownModel } from \"./interactive-mode-helpers.ts\";\n\nInteractiveModeBase.prototype.completeProviderAuthentication = async function(this: InteractiveModeBase, providerId: string, providerName: string, authType: \"oauth\" | \"api_key\", previousModel: Model<Api> | undefined): Promise<void> {\n this.session.modelRegistry.refresh();\n\n const actionLabel =\n authType === \"oauth\"\n ? `Logged in to ${providerName}`\n : `Saved API key for ${providerName}`;\n\n let selectedModel: Model<Api> | undefined;\n let selectionError: string | undefined;\n if (isUnknownModel(previousModel)) {\n const availableModels = this.session.modelRegistry.getAvailable();\n const providerModels = availableModels.filter(\n (model) => model.provider === providerId,\n );\n if (!hasDefaultModelProvider(providerId)) {\n selectionError = `${actionLabel}, but no default model is configured for provider \"${providerId}\". Use /model to select a model.`;\n } else if (providerModels.length === 0) {\n selectionError = `${actionLabel}, but no models are available for that provider. Use /model to select a model.`;\n } else {\n const defaultModelId = defaultModelPerProvider[providerId];\n selectedModel = providerModels.find(\n (model) => model.id === defaultModelId,\n );\n if (!selectedModel) {\n selectionError = `${actionLabel}, but its default model \"${defaultModelId}\" is not available. Use /model to select a model.`;\n } else {\n try {\n await this.session.setModel(selectedModel);\n } catch (error: unknown) {\n selectedModel = undefined;\n const errorMessage =\n error instanceof Error ? error.message : String(error);\n selectionError = `${actionLabel}, but selecting its default model failed: ${errorMessage}. Use /model to select a model.`;\n }\n }\n }\n }\n\n await this.updateAvailableProviderCount();\n this.setupAutocompleteProvider();\n this.footer.invalidate();\n this.updateEditorBorderColor();\n if (selectedModel) {\n this.showStatus(\n `${actionLabel}. Selected ${selectedModel.id}. Credentials saved to ${getAuthPath()}`,\n );\n void this.maybeWarnAboutAnthropicSubscriptionAuth(selectedModel);\n this.checkDaxnutsEasterEgg(selectedModel);\n } else {\n this.showStatus(`${actionLabel}. Credentials saved to ${getAuthPath()}`);\n if (selectionError) {\n this.showError(selectionError);\n } else {\n void this.maybeWarnAboutAnthropicSubscriptionAuth();\n }\n }\n\n };\n\nInteractiveModeBase.prototype.showBedrockSetupDialog = function(this: InteractiveModeBase, providerId: string, providerName: string): void {\n const restoreEditor = () => {\n this.editorContainer.clear();\n this.editorContainer.addChild(this.editor);\n this.ui.setFocus(this.editor);\n this.ui.requestRender();\n };\n\n const dialog = new LoginDialogComponent(\n this.ui,\n providerId,\n () => restoreEditor(),\n providerName,\n \"Amazon Bedrock setup\",\n );\n dialog.showInfo([\n theme.fg(\n \"text\",\n \"Amazon Bedrock uses AWS credentials instead of a single API key.\",\n ),\n theme.fg(\n \"text\",\n \"Configure an AWS profile, IAM keys, bearer token, or role-based credentials.\",\n ),\n theme.fg(\"muted\", \"See:\"),\n theme.fg(\"accent\", ` ${path.join(getDocsPath(), \"providers.md\")}`),\n ]);\n\n this.editorContainer.clear();\n this.editorContainer.addChild(dialog);\n this.ui.setFocus(dialog);\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.showApiKeyLoginDialog = async function(this: InteractiveModeBase, providerId: string, providerName: string): Promise<void> {\n const previousModel = this.session.model;\n\n const dialog = new LoginDialogComponent(\n this.ui,\n providerId,\n (_success, _message) => {\n // Completion handled below\n },\n providerName,\n );\n\n this.editorContainer.clear();\n this.editorContainer.addChild(dialog);\n this.ui.setFocus(dialog);\n this.ui.requestRender();\n\n const restoreEditor = () => {\n this.editorContainer.clear();\n this.editorContainer.addChild(this.editor);\n this.ui.setFocus(this.editor);\n this.ui.requestRender();\n };\n\n try {\n const apiKey = (await dialog.showPrompt(\"Enter API key:\")).trim();\n if (!apiKey) {\n throw new Error(\"API key cannot be empty.\");\n }\n\n this.session.modelRegistry.authStorage.set(providerId, {\n type: \"api_key\",\n key: apiKey,\n });\n\n restoreEditor();\n await this.completeProviderAuthentication(\n providerId,\n providerName,\n \"api_key\",\n previousModel,\n );\n } catch (error: unknown) {\n restoreEditor();\n const errorMsg = error instanceof Error ? error.message : String(error);\n if (errorMsg !== \"Login cancelled\") {\n this.showError(\n `Failed to save API key for ${providerName}: ${errorMsg}`,\n );\n }\n }\n };\n\nInteractiveModeBase.prototype.showOAuthLoginSelect = function(this: InteractiveModeBase, dialog: LoginDialogComponent, prompt: OAuthSelectPrompt): Promise<string | undefined> {\n return new Promise((resolve) => {\n const restoreDialog = () => {\n this.editorContainer.clear();\n this.editorContainer.addChild(dialog);\n this.ui.setFocus(dialog);\n this.ui.requestRender();\n };\n const labels = prompt.options.map((option) => option.label);\n const selector = new ExtensionSelectorComponent(\n prompt.message,\n labels,\n (optionLabel) => {\n restoreDialog();\n resolve(\n prompt.options.find((option) => option.label === optionLabel)?.id,\n );\n },\n () => {\n restoreDialog();\n resolve(undefined);\n },\n );\n this.editorContainer.clear();\n this.editorContainer.addChild(selector);\n this.ui.setFocus(selector);\n this.ui.requestRender();\n });\n };\n\nInteractiveModeBase.prototype.showLoginDialog = async function(this: InteractiveModeBase, providerId: string, providerName: string): Promise<void> {\n const providerInfo = this.session.modelRegistry.authStorage\n .getOAuthProviders()\n .find((provider) => provider.id === providerId);\n const previousModel = this.session.model;\n\n // Providers that use callback servers (can paste redirect URL)\n const usesCallbackServer = providerInfo?.usesCallbackServer ?? false;\n\n // Create login dialog component\n const dialog = new LoginDialogComponent(\n this.ui,\n providerId,\n (_success, _message) => {\n // Completion handled below\n },\n providerName,\n );\n\n // Show dialog in editor container\n this.editorContainer.clear();\n this.editorContainer.addChild(dialog);\n this.ui.setFocus(dialog);\n this.ui.requestRender();\n\n // Promise for manual code input (racing with callback server)\n let manualCodeResolve: ((code: string) => void) | undefined;\n let manualCodeReject: ((err: Error) => void) | undefined;\n const manualCodePromise = new Promise<string>((resolve, reject) => {\n manualCodeResolve = resolve;\n manualCodeReject = reject;\n });\n\n // Restore editor helper\n const restoreEditor = () => {\n this.editorContainer.clear();\n this.editorContainer.addChild(this.editor);\n this.ui.setFocus(this.editor);\n this.ui.requestRender();\n };\n\n try {\n await this.session.modelRegistry.authStorage.login(\n providerId as OAuthProviderId,\n {\n onAuth: (info: { url: string; instructions?: string }) => {\n dialog.showAuth(info.url, info.instructions, {\n showCancelHint: !usesCallbackServer,\n });\n\n if (usesCallbackServer) {\n // Show input for manual paste, racing with callback\n dialog\n .showManualInput(\n \"Paste redirect URL below, or complete login in browser:\",\n )\n .then((value) => {\n if (value && manualCodeResolve) {\n manualCodeResolve(value);\n manualCodeResolve = undefined;\n }\n })\n .catch(() => {\n if (manualCodeReject) {\n manualCodeReject(new Error(\"Login cancelled\"));\n manualCodeReject = undefined;\n }\n });\n }\n // For Anthropic: onPrompt is called immediately after\n },\n\n onDeviceCode: (info) => {\n dialog.showDeviceCode(info);\n dialog.showWaiting(\"Waiting for authentication...\");\n },\n\n onPrompt: async (prompt: {\n message: string;\n placeholder?: string;\n }) => {\n return dialog.showPrompt(prompt.message, prompt.placeholder);\n },\n\n onProgress: (message: string) => {\n dialog.showProgress(message);\n },\n\n onSelect: (prompt: OAuthSelectPrompt) =>\n this.showOAuthLoginSelect(dialog, prompt),\n\n onManualCodeInput: () => manualCodePromise,\n\n signal: dialog.signal,\n },\n );\n\n // Success\n restoreEditor();\n await this.completeProviderAuthentication(\n providerId,\n providerName,\n \"oauth\",\n previousModel,\n );\n } catch (error: unknown) {\n restoreEditor();\n const errorMsg = error instanceof Error ? error.message : String(error);\n if (errorMsg !== \"Login cancelled\") {\n this.showError(`Failed to login to ${providerName}: ${errorMsg}`);\n }\n }\n };\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-auth-login.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-auth-login.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-auth-routing.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-auth-routing.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-auth-routing.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-auth-routing.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-autocomplete.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-autocomplete.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type Api, type Model, type AutocompleteItem, type AutocompleteProvider, type AutocompleteSuggestions, type SlashCommand, type ExtensionRunner, type ResourceDiagnostic, type SourceInfo, CombinedAutocompleteProvider, fuzzyFilter, hasSupportedCodexFastModeModel, BUILTIN_SLASH_COMMANDS, BUNDLED_EXTENSION_SLASH_COMMANDS, parseGitUrl, getModelSearchText } from \"./interactive-mode-deps.ts\";\nimport { BUILTIN_SLASH_COMMAND_NAMES } from \"./interactive-mode-helpers.ts\";\n\nconst AT_MENTION_PATH_DELIMITERS = new Set([\" \", \"\\t\", '\"', \"'\", \"=\"]);\n\nfunction findLastAtMentionDelimiter(text: string): number {\n for (let index = text.length - 1; index >= 0; index -= 1) {\n if (AT_MENTION_PATH_DELIMITERS.has(text[index] ?? \"\")) return index;\n }\n return -1;\n}\n\nfunction isAtMentionTokenStart(text: string, index: number): boolean {\n return index === 0 || AT_MENTION_PATH_DELIMITERS.has(text[index - 1] ?? \"\");\n}\n\nfunction findUnclosedAtMentionQuoteStart(text: string): number | null {\n let quoteStart = -1;\n let inQuotes = false;\n for (let index = 0; index < text.length; index += 1) {\n if (text[index] === '\"') {\n inQuotes = !inQuotes;\n if (inQuotes) quoteStart = index;\n }\n }\n return inQuotes ? quoteStart : null;\n}\n\nfunction extractAtMentionPrefix(textBeforeCursor: string): string | null {\n const quoteStart = findUnclosedAtMentionQuoteStart(textBeforeCursor);\n if (quoteStart !== null && quoteStart > 0 && textBeforeCursor[quoteStart - 1] === \"@\") {\n return isAtMentionTokenStart(textBeforeCursor, quoteStart - 1)\n ? textBeforeCursor.slice(quoteStart - 1)\n : null;\n }\n const lastDelimiterIndex = findLastAtMentionDelimiter(textBeforeCursor);\n const tokenStart = lastDelimiterIndex === -1 ? 0 : lastDelimiterIndex + 1;\n return textBeforeCursor[tokenStart] === \"@\" ? textBeforeCursor.slice(tokenStart) : null;\n}\n\nfunction atMentionPrefixToPathPrefix(atPrefix: string): string {\n return atPrefix.startsWith('@\"') ? `\"${atPrefix.slice(2)}` : atPrefix.slice(1);\n}\n\nfunction toAtMentionCompletion(item: AutocompleteItem): AutocompleteItem {\n return {\n ...item,\n value: item.value.startsWith(\"@\") ? item.value : `@${item.value}`,\n };\n}\n\nclass AtMentionFallbackAutocompleteProvider implements AutocompleteProvider {\n private readonly primary: AutocompleteProvider;\n private readonly pathFallback: AutocompleteProvider;\n\n constructor(primary: AutocompleteProvider, pathFallback: AutocompleteProvider) {\n this.primary = primary;\n this.pathFallback = pathFallback;\n }\n\n async getSuggestions(\n lines: string[],\n cursorLine: number,\n cursorCol: number,\n options: { signal: AbortSignal; force?: boolean },\n ): Promise<AutocompleteSuggestions | null> {\n const primarySuggestions = await this.primary.getSuggestions(lines, cursorLine, cursorCol, options);\n if (primarySuggestions || options.signal.aborted) return primarySuggestions;\n\n const currentLine = lines[cursorLine] ?? \"\";\n const textBeforeCursor = currentLine.slice(0, cursorCol);\n const atPrefix = extractAtMentionPrefix(textBeforeCursor);\n if (!atPrefix) return null;\n\n const pathPrefix = atMentionPrefixToPathPrefix(atPrefix);\n const prefixStart = cursorCol - atPrefix.length;\n const fallbackLines = [...lines];\n fallbackLines[cursorLine] = `${currentLine.slice(0, prefixStart)}${pathPrefix}${currentLine.slice(cursorCol)}`;\n const fallbackSuggestions = await this.pathFallback.getSuggestions(\n fallbackLines,\n cursorLine,\n prefixStart + pathPrefix.length,\n { ...options, force: true },\n );\n if (!fallbackSuggestions) return null;\n\n return {\n prefix: atPrefix,\n items: fallbackSuggestions.items.map(toAtMentionCompletion),\n };\n }\n\n applyCompletion(\n lines: string[],\n cursorLine: number,\n cursorCol: number,\n item: AutocompleteItem,\n prefix: string,\n ): { lines: string[]; cursorLine: number; cursorCol: number } {\n return this.primary.applyCompletion(lines, cursorLine, cursorCol, item, prefix);\n }\n\n shouldTriggerFileCompletion(lines: string[], cursorLine: number, cursorCol: number): boolean {\n return this.primary.shouldTriggerFileCompletion?.(lines, cursorLine, cursorCol) ?? true;\n }\n}\n\nInteractiveModeBase.prototype.getAutocompleteSourceTag = function(this: InteractiveModeBase, sourceInfo?: SourceInfo): string | undefined {\n if (!sourceInfo) {\n return undefined;\n }\n\n const scopePrefix =\n sourceInfo.scope === \"user\"\n ? \"u\"\n : sourceInfo.scope === \"project\"\n ? \"p\"\n : \"t\";\n const source = sourceInfo.source.trim();\n\n if (source === \"auto\" || source === \"local\" || source === \"cli\") {\n return scopePrefix;\n }\n\n if (source.startsWith(\"npm:\")) {\n return `${scopePrefix}:${source}`;\n }\n\n const gitSource = parseGitUrl(source);\n if (gitSource) {\n const ref = gitSource.ref ? `@${gitSource.ref}` : \"\";\n return `${scopePrefix}:git:${gitSource.host}/${gitSource.path}${ref}`;\n }\n\n return scopePrefix;\n };\n\nInteractiveModeBase.prototype.prefixAutocompleteDescription = function(this: InteractiveModeBase, description: string | undefined, sourceInfo?: SourceInfo): string | undefined {\n const sourceTag = this.getAutocompleteSourceTag(sourceInfo);\n if (!sourceTag) {\n return description;\n }\n return description ? `[${sourceTag}] ${description}` : `[${sourceTag}]`;\n };\n\nInteractiveModeBase.prototype.getBuiltInCommandConflictDiagnostics = function(this: InteractiveModeBase, extensionRunner: ExtensionRunner): ResourceDiagnostic[] {\n return extensionRunner\n .getRegisteredCommands()\n .filter((command) => BUILTIN_SLASH_COMMAND_NAMES.has(command.name))\n .map((command) => ({\n type: \"warning\" as const,\n message:\n command.invocationName === command.name\n ? `Extension command '/${command.name}' conflicts with built-in interactive command. Skipping in autocomplete.`\n : `Extension command '/${command.name}' conflicts with built-in interactive command. Available as '/${command.invocationName}'.`,\n path: command.sourceInfo.path,\n }));\n };\n\nInteractiveModeBase.prototype.getCodexFastModeCandidateModels = function(this: InteractiveModeBase): Model<Api>[] {\n if (this.session.scopedModels.length > 0) {\n return this.session.scopedModels\n .map((scoped) => scoped.model)\n .filter((model) => this.session.modelRegistry.hasConfiguredAuth(model));\n }\n\n return this.session.modelRegistry.getAvailable();\n };\n\nInteractiveModeBase.prototype.hasCodexFastModeSupportedModels = function(this: InteractiveModeBase): boolean {\n return hasSupportedCodexFastModeModel(\n this.getCodexFastModeCandidateModels(),\n );\n };\n\nInteractiveModeBase.prototype.createBaseAutocompleteProvider = function(this: InteractiveModeBase): AutocompleteProvider {\n // Define commands for autocomplete\n const slashCommands: SlashCommand[] = BUILTIN_SLASH_COMMANDS.filter(\n (command) => command.name !== \"fast\" || this.hasCodexFastModeSupportedModels(),\n ).map((command) => ({\n name: command.name,\n description: command.description,\n getArgumentCompletions: command.getArgumentCompletions,\n }));\n\n const modelCommand = slashCommands.find(\n (command) => command.name === \"model\",\n );\n if (modelCommand) {\n modelCommand.getArgumentCompletions = (\n prefix: string,\n ): AutocompleteItem[] | null => {\n // Get available models (scoped or from registry)\n const models =\n this.session.scopedModels.length > 0\n ? this.session.scopedModels.map((s) => s.model)\n : this.session.modelRegistry.getAvailable();\n\n if (models.length === 0) return null;\n\n // Create items with provider/id format\n const items = models.map((m) => ({\n id: m.id,\n provider: m.provider,\n name: m.name,\n label: `${m.provider}/${m.id}`,\n }));\n\n // Fuzzy filter by model ID + provider in either order.\n const filtered = fuzzyFilter(items, prefix, getModelSearchText);\n\n if (filtered.length === 0) return null;\n\n return filtered.map((item) => ({\n value: item.label,\n label: item.id,\n description: item.provider,\n }));\n };\n }\n\n // Convert prompt templates to SlashCommand format for autocomplete\n const templateCommands: SlashCommand[] = this.session.promptTemplates.map(\n (cmd) => ({\n name: cmd.name,\n description: this.prefixAutocompleteDescription(\n cmd.description,\n cmd.sourceInfo,\n ),\n ...(cmd.argumentHint && { argumentHint: cmd.argumentHint }),\n }),\n );\n\n // Convert extension commands to SlashCommand format. Built-in command names\n // stay reserved even when a built-in is contextually hidden (for example,\n // /fast without a supported OpenAI model) so extension visibility cannot\n // change as auth/model state changes. While extension loading is deferred,\n // expose lightweight bundled command metadata without importing heavy\n // implementations; the submit path loads the implementation on demand.\n const registeredExtensionCommands = this.session.extensionRunner\n .getRegisteredCommands()\n .filter((cmd) => !BUILTIN_SLASH_COMMAND_NAMES.has(cmd.name));\n const registeredNames = new Set(registeredExtensionCommands.map((cmd) => cmd.invocationName));\n const extensionCommands: SlashCommand[] = [\n ...(this.deferredStartupPending\n ? BUNDLED_EXTENSION_SLASH_COMMANDS.filter(\n (cmd) => !BUILTIN_SLASH_COMMAND_NAMES.has(cmd.name) && !registeredNames.has(cmd.name),\n ).map((cmd) => ({\n name: cmd.name,\n description: cmd.description,\n getArgumentCompletions: cmd.getArgumentCompletions,\n }))\n : []),\n ...registeredExtensionCommands.map((cmd) => ({\n name: cmd.invocationName,\n description: this.prefixAutocompleteDescription(\n cmd.description,\n cmd.sourceInfo,\n ),\n getArgumentCompletions: cmd.getArgumentCompletions,\n })),\n ];\n\n // Build skill commands from session.skills (if enabled)\n this.skillCommands.clear();\n const skillCommandList: SlashCommand[] = [];\n if (this.settingsManager.getEnableSkillCommands()) {\n for (const skill of this.session.resourceLoader.getSkills().skills) {\n const commandName = `skill:${skill.name}`;\n this.skillCommands.set(commandName, skill.filePath);\n skillCommandList.push({\n name: commandName,\n description: this.prefixAutocompleteDescription(\n skill.description,\n skill.sourceInfo,\n ),\n });\n }\n }\n\n const commands = [\n ...slashCommands,\n ...templateCommands,\n ...extensionCommands,\n ...skillCommandList,\n ];\n const cwd = this.sessionManager.getCwd();\n return new AtMentionFallbackAutocompleteProvider(\n new CombinedAutocompleteProvider(commands, cwd, this.fdPath),\n new CombinedAutocompleteProvider(commands, cwd, null),\n );\n };\n\nInteractiveModeBase.prototype.setupAutocompleteProvider = function(this: InteractiveModeBase): void {\n let provider = this.createBaseAutocompleteProvider();\n for (const wrapProvider of this.autocompleteProviderWrappers) {\n provider = wrapProvider(provider);\n }\n\n this.autocompleteProvider = provider;\n this.defaultEditor.setAutocompleteProvider(provider);\n if (this.editor !== this.defaultEditor) {\n this.editor.setAutocompleteProvider?.(provider);\n }\n };\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-autocomplete.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-autocomplete.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-bash-compact.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-bash-compact.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-bash-compact.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-bash-compact.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-child-ordering.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-child-ordering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,oCAAoC,CACnD,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,IAAI,GAChB,IAAI,CAoBN"
|
|
1
|
+
{"version":3,"file":"interactive-child-ordering.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-child-ordering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,oCAAoC,CACnD,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,GAAG,SAAS,EAC7B,MAAM,EAAE,MAAM,IAAI,GAChB,IAAI,CAoBN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-deferred-startup.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-deferred-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,WAAW,mBAAmB;IAChC,sBAAsB,EAAE,OAAO,CAAC;IAChC,sBAAsB,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAClD,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAEH,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAa1F;AAoDH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCpF"
|
|
1
|
+
{"version":3,"file":"interactive-deferred-startup.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-deferred-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAIjE,MAAM,WAAW,mBAAmB;IAChC,sBAAsB,EAAE,OAAO,CAAC;IAChC,sBAAsB,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAClD,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAEH,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAa1F;AAoDH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-editor-actions.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-editor-actions.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-editor-actions.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-editor-actions.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-extension-context.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-context.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-extension-context.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-context.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-extension-custom-ui.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-custom-ui.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-extension-custom-ui.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-custom-ui.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-extension-dialogs.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-dialogs.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-extension-dialogs.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-dialogs.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-extension-runtime.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-runtime.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-extension-runtime.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-runtime.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-extension-widgets.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-widgets.ts"],"names":[],"mappings":""
|
|
1
|
+
{"version":3,"file":"interactive-extension-widgets.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-widgets.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-hotkeys-debug.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-hotkeys-debug.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type Keybinding, type AppKeybinding, fs, path, Markdown, Spacer, Text, visibleWidth, getDebugLogPath, ArminComponent, DaxnutsComponent, DynamicBorder, EarendilAnnouncementComponent, formatKeyText, keyDisplayText, theme } from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.getAppKeyDisplay = function(this: InteractiveModeBase, action: AppKeybinding): string {\n return keyDisplayText(action);\n };\n\nInteractiveModeBase.prototype.getEditorKeyDisplay = function(this: InteractiveModeBase, action: Keybinding): string {\n return keyDisplayText(action);\n };\n\nInteractiveModeBase.prototype.handleHotkeysCommand = function(this: InteractiveModeBase): void {\n // Navigation keybindings\n const cursorUp = this.getEditorKeyDisplay(\"tui.editor.cursorUp\");\n const cursorDown = this.getEditorKeyDisplay(\"tui.editor.cursorDown\");\n const cursorLeft = this.getEditorKeyDisplay(\"tui.editor.cursorLeft\");\n const cursorRight = this.getEditorKeyDisplay(\"tui.editor.cursorRight\");\n const cursorWordLeft = this.getEditorKeyDisplay(\n \"tui.editor.cursorWordLeft\",\n );\n const cursorWordRight = this.getEditorKeyDisplay(\n \"tui.editor.cursorWordRight\",\n );\n const cursorLineStart = this.getEditorKeyDisplay(\n \"tui.editor.cursorLineStart\",\n );\n const cursorLineEnd = this.getEditorKeyDisplay(\"tui.editor.cursorLineEnd\");\n const jumpForward = this.getEditorKeyDisplay(\"tui.editor.jumpForward\");\n const jumpBackward = this.getEditorKeyDisplay(\"tui.editor.jumpBackward\");\n const pageUp = this.getEditorKeyDisplay(\"tui.editor.pageUp\");\n const pageDown = this.getEditorKeyDisplay(\"tui.editor.pageDown\");\n\n // Editing keybindings\n const submit = this.getEditorKeyDisplay(\"tui.input.submit\");\n const newLine = this.getEditorKeyDisplay(\"tui.input.newLine\");\n const deleteWordBackward = this.getEditorKeyDisplay(\n \"tui.editor.deleteWordBackward\",\n );\n const deleteWordForward = this.getEditorKeyDisplay(\n \"tui.editor.deleteWordForward\",\n );\n const deleteToLineStart = this.getEditorKeyDisplay(\n \"tui.editor.deleteToLineStart\",\n );\n const deleteToLineEnd = this.getEditorKeyDisplay(\n \"tui.editor.deleteToLineEnd\",\n );\n const yank = this.getEditorKeyDisplay(\"tui.editor.yank\");\n const yankPop = this.getEditorKeyDisplay(\"tui.editor.yankPop\");\n const undo = this.getEditorKeyDisplay(\"tui.editor.undo\");\n const tab = this.getEditorKeyDisplay(\"tui.input.tab\");\n\n // App keybindings\n const interrupt = this.getAppKeyDisplay(\"app.interrupt\");\n const clear = this.getAppKeyDisplay(\"app.clear\");\n const exit = this.getAppKeyDisplay(\"app.exit\");\n const suspend = this.getAppKeyDisplay(\"app.suspend\");\n const cycleThinkingLevel = this.getAppKeyDisplay(\"app.thinking.cycle\");\n const cycleModelForward = this.getAppKeyDisplay(\"app.model.cycleForward\");\n const selectModel = this.getAppKeyDisplay(\"app.model.select\");\n const expandTools = this.getAppKeyDisplay(\"app.tools.expand\");\n const toggleThinking = this.getAppKeyDisplay(\"app.thinking.toggle\");\n const externalEditor = this.getAppKeyDisplay(\"app.editor.external\");\n const cycleModelBackward = this.getAppKeyDisplay(\"app.model.cycleBackward\");\n const followUp = this.getAppKeyDisplay(\"app.message.followUp\");\n const dequeue = this.getAppKeyDisplay(\"app.message.dequeue\");\n const pasteImage = this.getAppKeyDisplay(\"app.clipboard.pasteImage\");\n\n let hotkeys = `\n**Navigation**\n| Key | Action |\n|-----|--------|\n| \\`${cursorUp}\\` / \\`${cursorDown}\\` / \\`${cursorLeft}\\` / \\`${cursorRight}\\` | Move cursor / browse history (Up when empty) |\n| \\`${cursorWordLeft}\\` / \\`${cursorWordRight}\\` | Move by word |\n| \\`${cursorLineStart}\\` | Start of line |\n| \\`${cursorLineEnd}\\` | End of line |\n| \\`${jumpForward}\\` | Jump forward to character |\n| \\`${jumpBackward}\\` | Jump backward to character |\n| \\`${pageUp}\\` / \\`${pageDown}\\` | Scroll by page |\n\n**Editing**\n| Key | Action |\n|-----|--------|\n| \\`${submit}\\` | Send message |\n| \\`${newLine}\\` | New line${process.platform === \"win32\" ? \" (ctrl+enter on Windows Terminal)\" : \"\"} |\n| \\`${deleteWordBackward}\\` | Delete word backwards |\n| \\`${deleteWordForward}\\` | Delete word forwards |\n| \\`${deleteToLineStart}\\` | Delete to start of line |\n| \\`${deleteToLineEnd}\\` | Delete to end of line |\n| \\`${yank}\\` | Paste the most-recently-deleted text |\n| \\`${yankPop}\\` | Cycle through the deleted text after pasting |\n| \\`${undo}\\` | Undo |\n\n**Other**\n| Key | Action |\n|-----|--------|\n| \\`${tab}\\` | Path completion / accept autocomplete |\n| \\`${interrupt}\\` | Cancel autocomplete / abort streaming |\n| \\`${clear}\\` | Clear editor (first) / exit (second) |\n| \\`${exit}\\` | Exit (when editor is empty) |\n| \\`${suspend}\\` | Suspend to background |\n| \\`${cycleThinkingLevel}\\` | Cycle thinking level |\n| \\`${cycleModelForward}\\` / \\`${cycleModelBackward}\\` | Cycle models |\n| \\`${selectModel}\\` | Open model selector |\n| \\`${expandTools}\\` | Toggle tool output expansion |\n| \\`${toggleThinking}\\` | Toggle thinking block visibility |\n| \\`${externalEditor}\\` | Edit message in external editor |\n| \\`${followUp}\\` | Queue follow-up message |\n| \\`${dequeue}\\` | Restore queued messages |\n| \\`${pasteImage}\\` | Paste image from clipboard |\n| \\`/\\` | Slash commands |\n| \\`!\\` | Run bash command |\n| \\`!!\\` | Run bash command (excluded from context) |\n`;\n\n // Add extension-registered shortcuts\n const extensionRunner = this.session.extensionRunner;\n const shortcuts = extensionRunner.getShortcuts(\n this.keybindings.getEffectiveConfig(),\n );\n if (shortcuts.size > 0) {\n hotkeys += `\n**Extensions**\n| Key | Action |\n|-----|--------|\n`;\n for (const [key, shortcut] of shortcuts) {\n const description = shortcut.description ?? shortcut.extensionPath;\n const keyDisplay = formatKeyText(key, { capitalize: true });\n hotkeys += `| \\`${keyDisplay}\\` | ${description} |\\n`;\n }\n }\n\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(new DynamicBorder());\n this.chatContainer.addChild(\n new Text(theme.bold(theme.fg(\"accent\", \"Keyboard Shortcuts\")), 1, 0),\n );\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Markdown(hotkeys.trim(), 1, 1, this.getMarkdownThemeWithSettings()),\n );\n this.chatContainer.addChild(new DynamicBorder());\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.handleClearCommand = async function(this: InteractiveModeBase): Promise<void> {\n await this.ensureDeferredStartupComplete();\n if (this.loadingAnimation) {\n this.loadingAnimation.stop();\n this.loadingAnimation = undefined;\n }\n this.statusContainer.clear();\n try {\n const result = await this.runtimeHost.newSession();\n if (result.cancelled) {\n return;\n }\n this.renderCurrentSessionState();\n if (this.firstRunNoticeVisible) {\n this.clearFirstRunOnboardingUi();\n }\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Text(`${theme.fg(\"accent\", \"✓ New session started\")}`, 1, 1),\n );\n this.ui.requestRender();\n } catch (error: unknown) {\n await this.handleFatalRuntimeError(\"Failed to create session\", error);\n }\n };\n\nInteractiveModeBase.prototype.handleDebugCommand = function(this: InteractiveModeBase): void {\n const width = this.ui.terminal.columns;\n const height = this.ui.terminal.rows;\n const allLines = this.ui.render(width);\n\n const debugLogPath = getDebugLogPath();\n const debugData = [\n `Debug output at ${new Date().toISOString()}`,\n `Terminal: ${width}x${height}`,\n `Total lines: ${allLines.length}`,\n \"\",\n \"=== All rendered lines with visible widths ===\",\n ...allLines.map((line, idx) => {\n const vw = visibleWidth(line);\n const escaped = JSON.stringify(line);\n return `[${idx}] (w=${vw}) ${escaped}`;\n }),\n \"\",\n \"=== Agent messages (JSONL) ===\",\n ...this.session.messages.map((msg) => JSON.stringify(msg)),\n \"\",\n ].join(\"\\n\");\n\n fs.mkdirSync(path.dirname(debugLogPath), { recursive: true });\n fs.writeFileSync(debugLogPath, debugData);\n\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Text(\n `${theme.fg(\"accent\", \"✓ Debug log written\")}\\n${theme.fg(\"muted\", debugLogPath)}`,\n 1,\n 1,\n ),\n );\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.handleArminSaysHi = function(this: InteractiveModeBase): void {\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(new ArminComponent(this.ui));\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.handleDementedDelves = function(this: InteractiveModeBase): void {\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(new EarendilAnnouncementComponent());\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.handleDaxnuts = function(this: InteractiveModeBase): void {\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(new DaxnutsComponent(this.ui));\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.checkDaxnutsEasterEgg = function(this: InteractiveModeBase, model: { provider: string; id: string }): void {\n if (\n model.provider === \"opencode\" &&\n model.id.toLowerCase().includes(\"kimi-k2.5\")\n ) {\n this.handleDaxnuts();\n }\n };\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-hotkeys-debug.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-hotkeys-debug.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-input-handling.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-input-handling.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase, seedStartupInput } from \"./interactive-mode-base.ts\";\nimport { pasteClipboardImageToEditor, recordTimeSinceReset } from \"./interactive-mode-deps.ts\";\nimport { yieldToEventLoop } from \"../../utils/event-loop.ts\";\n\nInteractiveModeBase.prototype.runUserPromptTurn = async function(this: InteractiveModeBase, userInput: string): Promise<void> {\n // Show the working spinner immediately on submit so there is no visible gap\n // while prompt preflight runs before the agent emits `agent_start`.\n this.showWorkingLoaderNow();\n const deferredStartupNeedsPromptGate = this.deferredStartupPending || this.deferredStartupPromise !== undefined;\n if (deferredStartupNeedsPromptGate) {\n this.deferLoadedResourcesDisclosureUntilAgentEnd = true;\n }\n // Yield once so the freshly-mounted spinner paints before synchronous\n // preflight work can block the event loop.\n await yieldToEventLoop();\n try {\n if (deferredStartupNeedsPromptGate) {\n await this.ensureDeferredStartupComplete();\n }\n await this.session.prompt(userInput);\n this.deferLoadedResourcesDisclosureUntilAgentEnd = false;\n if (this.pendingLoadedResourcesDisclosure) {\n this.pendingLoadedResourcesDisclosure = false;\n this.showLoadedResources({ force: true, showDiagnosticsWhenQuiet: true, targetContainer: this.startupNoticesContainer });\n void this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, this.startupNoticesContainer);\n this.showStartupNoticesIfNeeded(this.startupNoticesContainer);\n }\n } catch (error: unknown) {\n this.deferLoadedResourcesDisclosureUntilAgentEnd = false;\n this.discardDeferredRenderedUserInput(userInput);\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n } finally {\n // A submission that resolves without starting an agent turn (e.g. an\n // extension slash-command) never emits `agent_end`, so clear the\n // pre-shown spinner here when idle to avoid a lingering indicator.\n if (!this.session.isStreaming) {\n this.stopWorkingLoader();\n }\n }\n };\n\nInteractiveModeBase.prototype.setupKeyHandlers = function(this: InteractiveModeBase): void {\n this.ui.addInputListener((data) => {\n if (!this.keybindings.matches(data, \"app.clear\")) return undefined;\n if (this.ui.hasOverlay()) return undefined;\n this.handleCtrlC();\n this.ui.requestRender();\n return { consume: true };\n });\n\n // Set up handlers on defaultEditor - they use this.editor for text access\n // so they work correctly regardless of which editor is active\n this.defaultEditor.onEscape = () => {\n if (this.session.isStreaming) {\n this.restoreQueuedMessagesToEditor({ abort: true });\n } else if (this.session.isBashRunning) {\n this.session.abortBash();\n } else if (this.isBashMode) {\n this.editor.setText(\"\");\n this.isBashMode = false;\n this.updateEditorBorderColor();\n } else if (!this.editor.getText().trim()) {\n // Double-escape with empty editor triggers /tree, /fork, or nothing based on setting\n const action = this.settingsManager.getDoubleEscapeAction();\n if (action !== \"none\") {\n const now = Date.now();\n if (now - this.lastEscapeTime < 500) {\n if (action === \"tree\") {\n this.showTreeSelector();\n } else {\n this.showUserMessageSelector();\n }\n this.lastEscapeTime = 0;\n } else {\n this.lastEscapeTime = now;\n }\n }\n }\n };\n\n // Register app action handlers\n this.defaultEditor.onAction(\"app.clear\", () => this.handleCtrlC());\n this.defaultEditor.onCtrlD = () => this.handleCtrlD();\n this.defaultEditor.onAction(\"app.suspend\", () => this.handleCtrlZ());\n this.defaultEditor.onAction(\"app.thinking.cycle\", () =>\n this.cycleThinkingLevel(),\n );\n this.defaultEditor.onAction(\"app.model.cycleForward\", () => {\n void (async () => {\n await this.ensureDeferredStartupComplete();\n await this.cycleModel(\"forward\");\n })();\n });\n this.defaultEditor.onAction(\"app.model.cycleBackward\", () => {\n void (async () => {\n await this.ensureDeferredStartupComplete();\n await this.cycleModel(\"backward\");\n })();\n });\n\n // Global debug handler on TUI (works regardless of focus)\n this.ui.onDebug = () => this.handleDebugCommand();\n this.defaultEditor.onAction(\"app.model.select\", () => {\n void (async () => {\n await this.ensureDeferredStartupComplete();\n this.showModelSelector();\n })();\n });\n this.defaultEditor.onAction(\"app.tools.expand\", () =>\n this.toggleToolOutputExpansion(),\n );\n this.defaultEditor.onAction(\"app.thinking.toggle\", () =>\n this.toggleThinkingBlockVisibility(),\n );\n this.defaultEditor.onAction(\"app.editor.external\", () =>\n this.openExternalEditor(),\n );\n this.defaultEditor.onAction(\"app.message.followUp\", () =>\n this.handleFollowUp(),\n );\n this.defaultEditor.onAction(\"app.message.dequeue\", () =>\n this.handleDequeue(),\n );\n this.defaultEditor.onAction(\"app.session.new\", () =>\n this.handleClearCommand(),\n );\n this.defaultEditor.onAction(\"app.session.tree\", () =>\n this.showTreeSelector(),\n );\n this.defaultEditor.onAction(\"app.session.fork\", () =>\n this.showUserMessageSelector(),\n );\n this.defaultEditor.onAction(\"app.session.resume\", () =>\n this.showSessionSelector(),\n );\n\n this.defaultEditor.onChange = (text: string) => {\n const wasBashMode = this.isBashMode;\n this.isBashMode = text.trimStart().startsWith(\"!\");\n if (wasBashMode !== this.isBashMode) {\n this.updateEditorBorderColor();\n }\n };\n\n // Handle clipboard image paste (triggered on Ctrl+V)\n this.defaultEditor.onPasteImage = () => {\n this.handleClipboardImagePaste();\n };\n };\n\nInteractiveModeBase.prototype.handleClipboardImagePaste = async function(this: InteractiveModeBase): Promise<void> {\n await pasteClipboardImageToEditor(this.editor, () => this.ui.requestRender(), {\n showWarning: (message) => this.showWarning(message),\n });\n };\n\nInteractiveModeBase.prototype.deliverStartupReplayPrompt = function(this: InteractiveModeBase, text: string): void {\n if (this.onInputCallback) {\n if (!text.startsWith(\"/\")) {\n this.renderDeferredUserInput(text);\n }\n const callback = this.onInputCallback;\n this.onInputCallback = undefined;\n callback(text);\n } else {\n this.pendingUserInputs.push(text);\n }\n };\n\nInteractiveModeBase.prototype.recoverCookedStartupInput = function(this: InteractiveModeBase): boolean {\n if (this.startupCookedInputRecovered || this.pendingUserInputs.length > 0) return true;\n const text = this.editor.getText();\n const cookedLines = text.split(/\\r?\\n/).map((line) => line.trim()).filter(Boolean);\n const isCommandLike = (line: string | undefined) =>\n line !== undefined && (line.startsWith(\"/\") || line.startsWith(\"!\"));\n const singleCommandLike = cookedLines.length === 1 && isCommandLike(cookedLines[0]);\n if (cookedLines.length < 2 && !singleCommandLike) return false;\n\n this.startupCookedInputRecovered = true;\n const activeInput = this.startupReplayActiveInput?.trim();\n let draftText = \"\";\n let submissions = cookedLines;\n if (\n activeInput === undefined &&\n cookedLines.length > 1 &&\n !isCommandLike(cookedLines[cookedLines.length - 1]) &&\n (!isCommandLike(cookedLines[0]) || cookedLines.length > 2)\n ) {\n draftText = cookedLines[cookedLines.length - 1] ?? \"\";\n submissions = cookedLines.slice(0, -1);\n } else if (activeInput && cookedLines.length > 1 && !isCommandLike(cookedLines[cookedLines.length - 1])) {\n draftText = cookedLines[cookedLines.length - 1] ?? \"\";\n submissions = cookedLines.slice(0, -1);\n }\n if (submissions.length === 0) return true;\n\n if (activeInput) {\n const queuedSubmissions =\n submissions[0] === activeInput ? submissions.slice(1) : submissions;\n this.editor.setText(draftText);\n this.startupReplayInputs.push(...queuedSubmissions);\n return true;\n }\n\n this.editor.setText(\"\");\n seedStartupInput(this.pendingUserInputs, this.editor, { text: draftText, submissions }, this.startupReplayInputs, (draft) => {\n this.startupDraftText = draft;\n }, (active) => {\n this.startupReplayActiveInput = active;\n });\n return true;\n };\n\nInteractiveModeBase.prototype.drainStartupReplayCommands = async function(this: InteractiveModeBase): Promise<void> {\n while (this.pendingUserInputs.length === 0 && this.startupReplayActiveInput) {\n const activeInput = this.startupReplayActiveInput;\n await this.defaultEditor.onSubmit?.(activeInput);\n if (this.editor.getText().trim() === activeInput.trim()) {\n this.editor.setText(\"\");\n }\n if (this.startupReplayActiveInput?.trim() === activeInput.trim()) break;\n }\n };\n\nInteractiveModeBase.prototype.advanceStartupInputReplay = function(this: InteractiveModeBase, submittedText: string): void {\n if (this.startupReplayActiveInput?.trim() !== submittedText.trim()) return;\n this.startupReplayActiveInput = undefined;\n\n while (this.startupReplayInputs.length > 0) {\n const nextInput = this.startupReplayInputs.shift();\n if (nextInput === undefined) break;\n const trimmed = nextInput.trimStart();\n if (trimmed.startsWith(\"/\") || trimmed.startsWith(\"!\")) {\n this.startupReplayActiveInput = nextInput.trim();\n this.editor.setText(this.startupReplayActiveInput);\n this.ui.requestRender();\n return;\n }\n this.deliverStartupReplayPrompt(nextInput);\n }\n\n if (this.startupDraftText !== undefined) {\n this.editor.setText(this.startupDraftText);\n this.startupDraftText = undefined;\n this.ui.requestRender();\n }\n };\n\nInteractiveModeBase.prototype.setupEditorSubmitHandler = function(this: InteractiveModeBase): void {\n this.defaultEditor.onSubmit = async (text: string) => {\n if (!this.firstSubmitRecorded) {\n this.firstSubmitRecorded = true;\n recordTimeSinceReset(\"interactive-first-submit\");\n }\n text = text.trim();\n if (!text) return;\n\n if (this.startupReplayActiveInput && this.startupReplayActiveInput.trim() !== text.trim()) {\n this.startupReplayInputs.push(text);\n this.editor.addToHistory?.(text);\n this.editor.setText(\"\");\n return;\n }\n try {\n // Handle commands\n if (text === \"/settings\") {\n this.showSettingsSelector();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/fast\") {\n this.editor.setText(\"\");\n this.showFastModeSelector();\n return;\n }\n if (text === \"/scoped-models\") {\n this.editor.setText(\"\");\n await this.ensureDeferredStartupComplete();\n await this.showModelsSelector();\n return;\n }\n if (text === \"/model\" || text.startsWith(\"/model \")) {\n const searchTerm = text.startsWith(\"/model \")\n ? text.slice(7).trim()\n : undefined;\n this.editor.setText(\"\");\n await this.ensureDeferredStartupComplete();\n await this.handleModelCommand(searchTerm);\n return;\n }\n if (text === \"/export\" || text.startsWith(\"/export \")) {\n await this.handleExportCommand(text);\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/import\" || text.startsWith(\"/import \")) {\n await this.handleImportCommand(text);\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/share\") {\n await this.handleShareCommand();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/copy\") {\n await this.handleCopyCommand();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/name\" || text.startsWith(\"/name \")) {\n this.handleNameCommand(text);\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/session\") {\n this.handleSessionCommand();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/changelog\") {\n this.handleChangelogCommand();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/atomic\" || text.startsWith(\"/atomic \")) {\n this.editor.setText(\"\");\n await this.session.prompt(text);\n return;\n }\n if (text === \"/hotkeys\") {\n this.handleHotkeysCommand();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/fork\") {\n this.showUserMessageSelector();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/clone\") {\n this.editor.setText(\"\");\n await this.handleCloneCommand();\n return;\n }\n if (text === \"/tree\") {\n this.showTreeSelector();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/trust\") {\n this.showTrustSelector();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/login\") {\n this.showOAuthSelector(\"login\");\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/logout\") {\n this.showOAuthSelector(\"logout\");\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/new\") {\n this.editor.setText(\"\");\n await this.handleClearCommand();\n return;\n }\n if (/^\\/compact(?:\\s|$)/.test(text)) {\n this.editor.setText(\"\");\n if (text !== \"/compact\") {\n this.showWarning(\"Usage: /compact\");\n return;\n }\n await this.handleCompactCommand();\n return;\n }\n if (text === \"/reload\") {\n this.editor.setText(\"\");\n await this.ensureDeferredStartupComplete();\n await this.handleReloadCommand();\n return;\n }\n if (text === \"/debug\") {\n this.handleDebugCommand();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/arminsayshi\") {\n this.handleArminSaysHi();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/dementedelves\") {\n this.handleDementedDelves();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/resume\") {\n this.showSessionSelector();\n this.editor.setText(\"\");\n return;\n }\n if (text === \"/quit\" || text === \"/exit\") {\n this.editor.setText(\"\");\n await this.shutdown();\n return;\n }\n\n if (text.startsWith(\"/\") && this.deferredStartupPending) {\n this.editor.addToHistory?.(text);\n this.editor.setText(\"\");\n this.ui.requestRender();\n await yieldToEventLoop();\n await this.ensureDeferredStartupComplete();\n await this.session.prompt(text);\n return;\n }\n // Handle bash command (! for normal, !! for excluded from context)\n if (text.startsWith(\"!\")) {\n const isExcluded = text.startsWith(\"!!\");\n const command = isExcluded\n ? text.slice(2).trim()\n : text.slice(1).trim();\n if (command) {\n if (this.session.isBashRunning) {\n this.showWarning(\n \"A bash command is already running. esc cancel first.\",\n );\n this.editor.setText(text);\n return;\n }\n this.editor.addToHistory?.(text);\n await this.handleBashCommand(command, isExcluded);\n this.isBashMode = false;\n this.updateEditorBorderColor();\n return;\n }\n }\n\n // Queue input during compaction (extension commands execute immediately)\n if (this.session.isCompacting) {\n if (this.isExtensionCommand(text)) {\n this.editor.addToHistory?.(text);\n this.editor.setText(\"\");\n await this.session.prompt(text);\n } else {\n this.queueCompactionMessage(text, \"steer\");\n }\n return;\n }\n\n // If streaming, use prompt() with steer behavior\n // This handles extension commands (execute immediately), prompt template expansion, and queueing\n if (this.session.isStreaming) {\n this.editor.addToHistory?.(text);\n this.editor.setText(\"\");\n await this.session.prompt(text, { streamingBehavior: \"steer\" });\n this.updatePendingMessagesDisplay();\n this.ui.requestRender();\n return;\n }\n\n // Normal message submission\n // First, move any pending bash components to chat\n this.flushPendingBashComponents();\n\n if (this.onInputCallback) {\n if (!text.startsWith(\"/\")) {\n this.renderDeferredUserInput(text);\n }\n this.onInputCallback(text);\n } else {\n this.pendingUserInputs.push(text);\n }\n this.editor.addToHistory?.(text);\n } finally {\n this.advanceStartupInputReplay?.(text);\n }\n };\n };\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-input-handling.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-input-handling.ts"],"names":[],"mappings":""}
|