@bastani/atomic 0.9.5-alpha.8 → 0.9.5
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 +122 -0
- package/README.md +2 -2
- package/dist/builtin/cursor/CHANGELOG.md +12 -0
- package/dist/builtin/cursor/package.json +3 -3
- package/dist/builtin/cursor/src/model-mapper.ts +6 -3
- package/dist/builtin/intercom/CHANGELOG.md +37 -0
- package/dist/builtin/intercom/README.md +4 -2
- package/dist/builtin/intercom/broker/broker.ts +6 -114
- package/dist/builtin/intercom/broker/client.ts +29 -54
- package/dist/builtin/intercom/broker/delivered-message-cache.ts +44 -0
- package/dist/builtin/intercom/broker/pending-send-registry.ts +142 -0
- package/dist/builtin/intercom/broker/send-handler.ts +106 -0
- package/dist/builtin/intercom/broker/send-signature.ts +37 -0
- package/dist/builtin/intercom/foreground-detach-handoff.ts +136 -0
- package/dist/builtin/intercom/index-heavy.ts +49 -53
- package/dist/builtin/intercom/index.ts +278 -262
- package/dist/builtin/intercom/lazy-heavy-proxy.ts +114 -0
- package/dist/builtin/intercom/lazy-subagent-ack.ts +20 -0
- package/dist/builtin/intercom/lazy-tool-execution.ts +39 -0
- package/dist/builtin/intercom/lifecycle-lease.ts +51 -0
- package/dist/builtin/intercom/lifecycle.ts +37 -20
- package/dist/builtin/intercom/package.json +3 -6
- package/dist/builtin/intercom/reply-routing.ts +17 -0
- package/dist/builtin/intercom/subagent-relay.ts +58 -12
- package/dist/builtin/intercom/types.ts +3 -3
- package/dist/builtin/mcp/CHANGELOG.md +38 -0
- package/dist/builtin/mcp/OAUTH.md +1 -0
- package/dist/builtin/mcp/README.md +10 -6
- package/dist/builtin/mcp/apps-cancellation.ts +32 -0
- package/dist/builtin/mcp/call-tool-result.ts +9 -0
- package/dist/builtin/mcp/caller-wait.ts +50 -0
- package/dist/builtin/mcp/command-registration.ts +82 -0
- package/dist/builtin/mcp/direct-tool-executor.ts +279 -0
- package/dist/builtin/mcp/direct-tools.ts +40 -255
- package/dist/builtin/mcp/host-html-template.ts +4 -2
- package/dist/builtin/mcp/index.ts +274 -239
- package/dist/builtin/mcp/init.ts +96 -126
- package/dist/builtin/mcp/mcp-auth-flow.ts +247 -237
- package/dist/builtin/mcp/mcp-callback-server.ts +89 -68
- package/dist/builtin/mcp/mcp-oauth-provider.ts +23 -1
- package/dist/builtin/mcp/metadata-hydration.ts +52 -0
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/mcp/proxy-auth.ts +4 -4
- package/dist/builtin/mcp/proxy-call.ts +111 -40
- package/dist/builtin/mcp/proxy-connect.ts +35 -15
- package/dist/builtin/mcp/proxy-info-modes.ts +106 -23
- package/dist/builtin/mcp/proxy-modes.ts +3 -3
- package/dist/builtin/mcp/session-cleanup-barrier.ts +43 -0
- package/dist/builtin/mcp/startup-warmup.ts +98 -0
- package/dist/builtin/mcp/state-lease.ts +12 -0
- package/dist/builtin/mcp/tool-result-renderer.ts +3 -3
- package/dist/builtin/mcp/ui-server.ts +8 -8
- package/dist/builtin/mcp/ui-session.ts +9 -18
- package/dist/builtin/subagents/CHANGELOG.md +78 -0
- package/dist/builtin/subagents/README.md +30 -29
- package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
- package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -2
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
- package/dist/builtin/subagents/agents/debugger.md +2 -2
- package/dist/builtin/subagents/agents/worker.md +2 -2
- package/dist/builtin/subagents/package.json +5 -5
- package/dist/builtin/subagents/prompts/review-loop.md +1 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +37 -36
- package/dist/builtin/subagents/src/extension/api-lifecycle.ts +64 -0
- package/dist/builtin/subagents/src/extension/fanout-child.ts +44 -51
- package/dist/builtin/subagents/src/extension/index.ts +289 -320
- package/dist/builtin/subagents/src/extension/prompt-guidance.ts +7 -10
- package/dist/builtin/subagents/src/extension/schemas.ts +22 -5
- package/dist/builtin/subagents/src/extension/startup-maintenance.ts +89 -0
- package/dist/builtin/subagents/src/extension/tool-description.ts +29 -0
- package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +13 -2
- package/dist/builtin/subagents/src/intercom/result-intercom.ts +4 -4
- package/dist/builtin/subagents/src/runs/background/async-event-journal.ts +106 -0
- package/dist/builtin/subagents/src/runs/background/async-execution-common.ts +26 -20
- package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +13 -2
- package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +3 -0
- package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +1 -1
- package/dist/builtin/subagents/src/runs/background/completion-claims.ts +189 -0
- package/dist/builtin/subagents/src/runs/background/completion-dedupe.ts +44 -7
- package/dist/builtin/subagents/src/runs/background/completion-notification.ts +34 -0
- package/dist/builtin/subagents/src/runs/background/notify.ts +72 -22
- package/dist/builtin/subagents/src/runs/background/result-delivery-processor.ts +232 -0
- package/dist/builtin/subagents/src/runs/background/result-file-claims.ts +151 -0
- package/dist/builtin/subagents/src/runs/background/result-quarantine.ts +72 -0
- package/dist/builtin/subagents/src/runs/background/result-retry-scheduler.ts +48 -0
- package/dist/builtin/subagents/src/runs/background/result-status.ts +81 -0
- package/dist/builtin/subagents/src/runs/background/result-watcher-data.ts +59 -0
- package/dist/builtin/subagents/src/runs/background/result-watcher.ts +177 -233
- package/dist/builtin/subagents/src/runs/background/run-id-resolver.ts +3 -2
- package/dist/builtin/subagents/src/runs/background/stale-run-reconciler.ts +73 -14
- package/dist/builtin/subagents/src/runs/background/subagent-runner-streaming.ts +29 -15
- package/dist/builtin/subagents/src/runs/background/top-level-async.ts +1 -2
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +1 -0
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +7 -9
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +3 -13
- package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +2 -15
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt-finalize.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +63 -46
- package/dist/builtin/subagents/src/runs/foreground/execution-detach-reservations.ts +48 -0
- package/dist/builtin/subagents/src/runs/foreground/execution-detach-route.ts +17 -0
- package/dist/builtin/subagents/src/runs/foreground/execution-run-sync.ts +39 -26
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +3 -1
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +3 -51
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +6 -11
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-input.ts +11 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +5 -112
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +2 -0
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +68 -118
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +79 -7
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +2 -2
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +3 -0
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +2 -2
- package/dist/builtin/subagents/src/runs/shared/pi-spawn.ts +55 -12
- package/dist/builtin/subagents/src/shared/artifacts.ts +22 -11
- package/dist/builtin/subagents/src/shared/event-jsonl-writer.ts +294 -0
- package/dist/builtin/subagents/src/shared/exclusive-file-publication.ts +44 -0
- package/dist/builtin/subagents/src/shared/jsonl-writer.ts +1 -0
- package/dist/builtin/subagents/src/shared/model-info.ts +2 -2
- package/dist/builtin/subagents/src/shared/settings.ts +20 -10
- package/dist/builtin/subagents/src/shared/types-async.ts +3 -1
- package/dist/builtin/subagents/src/shared/types-config.ts +2 -0
- package/dist/builtin/subagents/src/shared/types-runtime.ts +3 -2
- package/dist/builtin/subagents/src/slash/slash-commands.ts +9 -12
- package/dist/builtin/subagents/src/slash/slash-live-state.ts +63 -32
- package/dist/builtin/subagents/src/tui/render-result.ts +7 -0
- package/dist/builtin/subagents/src/tui/render-stable-output.ts +1 -0
- package/dist/builtin/subagents/src/tui/render-widget.ts +157 -89
- package/dist/builtin/web-access/CHANGELOG.md +28 -0
- package/dist/builtin/web-access/README.md +4 -0
- package/dist/builtin/web-access/content-tools.ts +8 -3
- package/dist/builtin/web-access/index-heavy.ts +1 -1
- package/dist/builtin/web-access/index.ts +190 -46
- package/dist/builtin/web-access/lifecycle-lease.ts +38 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/web-access/result-renderers.ts +1 -1
- package/dist/builtin/web-access/summary-review.ts +1 -1
- package/dist/builtin/web-access/web-search-activity.ts +1 -1
- package/dist/builtin/web-access/web-search-return.ts +7 -0
- package/dist/builtin/web-access/web-search-summary.ts +1 -1
- package/dist/builtin/web-access/web-search-tool.ts +4 -2
- package/dist/builtin/workflows/CHANGELOG.md +86 -0
- package/dist/builtin/workflows/README.md +5 -5
- package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +27 -4
- package/dist/builtin/workflows/builtin/goal-runner.ts +86 -27
- package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +10 -0
- package/dist/builtin/workflows/builtin/ralph-core.ts +9 -9
- package/dist/builtin/workflows/builtin/ralph-models.ts +71 -36
- package/dist/builtin/workflows/builtin/ralph-runner.ts +20 -31
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/impeccable/SKILL.md +16 -13
- package/dist/builtin/workflows/skills/impeccable/reference/adapt.md +1 -0
- package/dist/builtin/workflows/skills/impeccable/reference/adapt.native.md +58 -0
- package/dist/builtin/workflows/skills/impeccable/reference/android.md +40 -0
- package/dist/builtin/workflows/skills/impeccable/reference/animate.md +2 -0
- package/dist/builtin/workflows/skills/impeccable/reference/audit.md +2 -0
- package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +139 -0
- package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +69 -62
- package/dist/builtin/workflows/skills/impeccable/reference/critique.md +21 -7
- package/dist/builtin/workflows/skills/impeccable/reference/document.md +1 -1
- package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +92 -0
- package/dist/builtin/workflows/skills/impeccable/reference/init.md +29 -7
- package/dist/builtin/workflows/skills/impeccable/reference/ios.md +45 -0
- package/dist/builtin/workflows/skills/impeccable/reference/layout.md +25 -1
- package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +23 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +2 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +75 -14
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +1 -1
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +31 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +64 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +118 -11
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +16 -11
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +66 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +42 -10
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/fonts.mjs +30 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/page.mjs +4 -6
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +660 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-before-edit.mjs +516 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +1764 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +61 -0
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +4 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/lib/is-generated.mjs +2 -2
- package/dist/builtin/workflows/skills/impeccable/scripts/live/svelte-component.mjs +13 -16
- package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +17 -11
- package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +104 -37
- package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +9 -0
- package/dist/builtin/workflows/src/durable/backend.ts +12 -0
- package/dist/builtin/workflows/src/durable/dbos-backend.ts +17 -1
- package/dist/builtin/workflows/src/durable/resume-catalog.ts +12 -0
- package/dist/builtin/workflows/src/durable/resume-runtime.ts +5 -2
- package/dist/builtin/workflows/src/durable/stage-primitive.ts +2 -1
- package/dist/builtin/workflows/src/durable/types.ts +16 -0
- package/dist/builtin/workflows/src/engine/primitives/task.ts +3 -1
- package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +1 -2
- package/dist/builtin/workflows/src/engine/run-returned-status.ts +50 -16
- package/dist/builtin/workflows/src/engine/run.ts +20 -19
- package/dist/builtin/workflows/src/engine/runtime.ts +5 -0
- package/dist/builtin/workflows/src/extension/extension-factory.ts +3 -0
- package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +9 -2
- package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +137 -27
- package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +22 -6
- package/dist/builtin/workflows/src/extension/public-types.ts +1 -1
- package/dist/builtin/workflows/src/extension/workflow-command-completions.ts +13 -1
- package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +19 -4
- package/dist/builtin/workflows/src/extension/workflow-command-surfaces.ts +9 -0
- package/dist/builtin/workflows/src/extension/workflow-prompts.ts +17 -22
- package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +48 -23
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +15 -2
- package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +20 -8
- package/dist/builtin/workflows/src/extension/workflow-tool.ts +24 -8
- package/dist/builtin/workflows/src/runs/background/status.ts +4 -3
- package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +29 -8
- package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +1 -1
- package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +3 -2
- package/dist/builtin/workflows/src/runs/shared/model-fallback-candidates.ts +1 -1
- package/dist/builtin/workflows/src/runs/shared/worktree-git.ts +155 -20
- package/dist/builtin/workflows/src/runs/shared/worktree-types.ts +6 -0
- package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -1
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +2 -2
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +2 -2
- package/dist/builtin/workflows/src/shared/resume-continuation.ts +2 -0
- package/dist/builtin/workflows/src/shared/returned-run-status.ts +116 -0
- package/dist/builtin/workflows/src/shared/workflow-failures-decisions.ts +2 -0
- package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +21 -3
- package/dist/builtin/workflows/src/tui/graph-view-state.ts +3 -0
- package/dist/builtin/workflows/src/tui/graph-view-types.ts +3 -0
- package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +1 -23
- package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +54 -9
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +5 -2
- package/dist/builtin/workflows/src/tui/status-list.ts +22 -15
- package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +4 -4
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts +23 -3
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +129 -17
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +9 -1
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-message-queue.d.ts.map +1 -1
- package/dist/core/agent-session-message-queue.js +1 -1
- package/dist/core/agent-session-message-queue.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +6 -3
- 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-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +2 -2
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-retry.d.ts.map +1 -1
- package/dist/core/agent-session-retry.js +1 -1
- package/dist/core/agent-session-retry.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +3 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +4 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +4 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/anthropic-thinking-guard.d.ts +5 -5
- package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
- package/dist/core/anthropic-thinking-guard.js +42 -32
- package/dist/core/anthropic-thinking-guard.js.map +1 -1
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +15 -15
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +14 -9
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +79 -46
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/context-assistant-turns.d.ts +42 -0
- package/dist/core/compaction/context-assistant-turns.d.ts.map +1 -0
- package/dist/core/compaction/context-assistant-turns.js +87 -0
- package/dist/core/compaction/context-assistant-turns.js.map +1 -0
- package/dist/core/compaction/context-compaction-critical.d.ts +1 -1
- package/dist/core/compaction/context-compaction-critical.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-critical.js +2 -2
- package/dist/core/compaction/context-compaction-critical.js.map +1 -1
- package/dist/core/compaction/context-compaction-eviction-alternates.d.ts +18 -0
- package/dist/core/compaction/context-compaction-eviction-alternates.d.ts.map +1 -0
- package/dist/core/compaction/context-compaction-eviction-alternates.js +186 -0
- package/dist/core/compaction/context-compaction-eviction-alternates.js.map +1 -0
- package/dist/core/compaction/context-compaction-eviction.d.ts +10 -2
- package/dist/core/compaction/context-compaction-eviction.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-eviction.js +196 -146
- package/dist/core/compaction/context-compaction-eviction.js.map +1 -1
- package/dist/core/compaction/context-compaction-prompt.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-prompt.js +1 -1
- package/dist/core/compaction/context-compaction-prompt.js.map +1 -1
- package/dist/core/compaction/context-compaction-types.d.ts +2 -0
- package/dist/core/compaction/context-compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction-types.js.map +1 -1
- package/dist/core/compaction/context-deletion-application.d.ts +5 -4
- package/dist/core/compaction/context-deletion-application.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-application.js +17 -15
- package/dist/core/compaction/context-deletion-application.js.map +1 -1
- package/dist/core/compaction/context-deletion-store.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-store.js +1 -1
- package/dist/core/compaction/context-deletion-store.js.map +1 -1
- package/dist/core/compaction/context-deletion-targets.d.ts +2 -1
- package/dist/core/compaction/context-deletion-targets.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-targets.js +36 -31
- package/dist/core/compaction/context-deletion-targets.js.map +1 -1
- package/dist/core/compaction/context-deletion-tool-helpers.d.ts.map +1 -1
- package/dist/core/compaction/context-deletion-tool-helpers.js +116 -43
- package/dist/core/compaction/context-deletion-tool-helpers.js.map +1 -1
- package/dist/core/compaction/context-transcript-analysis.d.ts +1 -2
- package/dist/core/compaction/context-transcript-analysis.d.ts.map +1 -1
- package/dist/core/compaction/context-transcript-analysis.js +33 -37
- package/dist/core/compaction/context-transcript-analysis.js.map +1 -1
- package/dist/core/copilot-model-synthesis.d.ts.map +1 -1
- package/dist/core/copilot-model-synthesis.js +3 -1
- package/dist/core/copilot-model-synthesis.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts +8 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +2 -1
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/provider-types.d.ts +2 -7
- package/dist/core/extensions/provider-types.d.ts.map +1 -1
- package/dist/core/extensions/provider-types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +6 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +72 -29
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/messages.d.ts +9 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +100 -18
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-registry-builtins.d.ts.map +1 -1
- package/dist/core/model-registry-builtins.js +5 -0
- 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 +49 -8
- 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-dynamic.js +11 -5
- package/dist/core/model-registry-dynamic.js.map +1 -1
- package/dist/core/model-registry-loader.d.ts.map +1 -1
- package/dist/core/model-registry-loader.js +8 -0
- package/dist/core/model-registry-loader.js.map +1 -1
- package/dist/core/model-registry-schemas.d.ts +93 -8
- package/dist/core/model-registry-schemas.d.ts.map +1 -1
- package/dist/core/model-registry-schemas.js +24 -12
- package/dist/core/model-registry-schemas.js.map +1 -1
- package/dist/core/model-registry-types.d.ts +7 -6
- package/dist/core/model-registry-types.d.ts.map +1 -1
- package/dist/core/model-registry-types.js.map +1 -1
- package/dist/core/model-registry.d.ts +5 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +23 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver-cli.d.ts.map +1 -1
- package/dist/core/model-resolver-cli.js +33 -5
- package/dist/core/model-resolver-cli.js.map +1 -1
- package/dist/core/model-resolver-initial.d.ts +6 -1
- package/dist/core/model-resolver-initial.d.ts.map +1 -1
- package/dist/core/model-resolver-initial.js +12 -7
- package/dist/core/model-resolver-initial.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/openai-responses-payload-sanitizer.d.ts +1 -0
- package/dist/core/openai-responses-payload-sanitizer.d.ts.map +1 -1
- package/dist/core/openai-responses-payload-sanitizer.js +24 -9
- package/dist/core/openai-responses-payload-sanitizer.js.map +1 -1
- package/dist/core/resource-loader-context-files.d.ts +1 -0
- package/dist/core/resource-loader-context-files.d.ts.map +1 -1
- package/dist/core/resource-loader-context-files.js +13 -10
- package/dist/core/resource-loader-context-files.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-entry-normalization.d.ts +7 -0
- package/dist/core/session-entry-normalization.d.ts.map +1 -0
- package/dist/core/session-entry-normalization.js +14 -0
- package/dist/core/session-entry-normalization.js.map +1 -0
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +1 -0
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-history.d.ts +2 -2
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +127 -108
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +2 -2
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +1 -1
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +141 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +11 -8
- package/dist/core/tools/bash.js.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-deferred-startup.d.ts.map +1 -1
- package/dist/main-deferred-startup.js +2 -2
- package/dist/main-deferred-startup.js.map +1 -1
- package/dist/main-early-input.d.ts.map +1 -1
- package/dist/main-early-input.js +7 -0
- package/dist/main-early-input.js.map +1 -1
- package/dist/main-session.d.ts.map +1 -1
- package/dist/main-session.js +1 -0
- package/dist/main-session.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.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-actions.js +0 -1
- package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-options.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-options.js +3 -1
- package/dist/modes/interactive/components/settings-selector-options.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +2 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +3 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-autocomplete.js +21 -9
- package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
- package/dist/modes/interactive/interactive-child-ordering.d.ts +7 -0
- package/dist/modes/interactive/interactive-child-ordering.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-child-ordering.js +26 -0
- package/dist/modes/interactive/interactive-child-ordering.js.map +1 -0
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +43 -30
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.js +1 -0
- package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +41 -6
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +3 -0
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-deps.js +2 -2
- package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +11 -4
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +0 -3
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +15 -1
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-session-routing.js +5 -1
- package/dist/modes/interactive/interactive-session-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +20 -21
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/theme/global-theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/global-theme.js +26 -2
- package/dist/modes/interactive/theme/global-theme.js.map +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts +1 -1
- package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-class.js +2 -0
- package/dist/modes/interactive/theme/theme-class.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +3 -0
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/fs-watch.d.ts +24 -1
- package/dist/utils/fs-watch.d.ts.map +1 -1
- package/dist/utils/fs-watch.js +60 -5
- package/dist/utils/fs-watch.js.map +1 -1
- package/docs/changelog.mdx +19 -0
- package/docs/compaction.md +60 -49
- package/docs/custom-provider.md +18 -5
- package/docs/development.md +4 -0
- package/docs/extensions.md +11 -2
- package/docs/json.md +1 -1
- package/docs/models.md +69 -10
- package/docs/providers.md +1 -1
- package/docs/quickstart.md +12 -8
- package/docs/rpc.md +2 -2
- package/docs/sdk.md +1 -1
- package/docs/settings.md +4 -4
- package/docs/subagents.md +40 -5
- package/docs/tools.md +1 -1
- package/docs/usage.md +4 -2
- package/docs/windows.md +4 -0
- package/docs/workflows.md +33 -48
- package/examples/extensions/preset.ts +2 -2
- package/examples/extensions/subagent/README.md +2 -2
- package/examples/extensions/subagent/index.ts +1 -2
- package/examples/extensions/subagent/schemas.ts +4 -1
- package/examples/sdk/12-full-control.ts +1 -1
- package/npm-shrinkwrap.json +48 -51
- package/package.json +7 -7
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-behavior.ts +0 -75
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-component.ts +0 -202
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-edit.ts +0 -97
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-editor.ts +0 -160
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-frame.ts +0 -72
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-render-modes.ts +0 -161
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-render-selectors.ts +0 -203
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-selectors.ts +0 -234
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-state.ts +0 -103
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify-types.ts +0 -29
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify.ts +0 -9
- package/dist/builtin/subagents/src/runs/foreground/chain-execution-clarify.ts +0 -117
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-deferred-startup.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-deferred-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAkB,oBAAoB,EAA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C,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { modelsAreEqual } from \"@earendil-works/pi-ai/compat\";\nimport { type Container, recordTimeSinceReset, resolveModelScopeWithDiagnostics, resolveSavedModelReference, setRegisteredThemes } from \"./interactive-mode-deps.ts\";\n\nexport interface DeferredStartupMode {\n deferredStartupPending: boolean;\n deferredStartupPromise: Promise<void> | undefined;\n completeDeferredStartup(): Promise<void>;\n }\n\nexport async function ensureDeferredStartupComplete(mode: DeferredStartupMode): Promise<void> {\n if (!mode.deferredStartupPending && !mode.deferredStartupPromise) return;\n mode.deferredStartupPromise ??= mode.completeDeferredStartup();\n await mode.deferredStartupPromise;\n }\n\nInteractiveModeBase.prototype.ensureDeferredStartupComplete = async function(this: InteractiveModeBase): Promise<void> {\n await ensureDeferredStartupComplete(this);\n };\n\n/**\n * Finishes a startup where extension loading was deferred so the TUI could\n * paint immediately. Loads extension code via session.reload(), then applies\n * the same post-load UI wiring as /reload and discloses loaded resources.\n */\nInteractiveModeBase.prototype.completeDeferredStartup = async function(this: InteractiveModeBase): Promise<void> {\n\ttry {\n\t\tawait this.bindCurrentSessionExtensions();\n\t\tawait this.session.reload({ reason: \"startup\" });\n\t} catch (error) {\n\t\tthis.stopWorkingLoader();\n this.deferredStartupPending = false;\n this.showError(\n `Extension loading failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n // The RESOURCES disclosure will not render; surface the held warning.\n void this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, this.startupNoticesContainer);\n return;\n }\n\n\tthis.stopWorkingLoader();\n\tthis.deferredStartupPending = false;\n recordTimeSinceReset(\"deferred-extension-load\");\n\n setRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n await this.themeController.applyFromSettings();\n this.setupAutocompleteProvider();\n this.setupExtensionShortcuts(this.session.extensionRunner);\n await applyDeferredModelScope(this);\n await this.retryDeferredModelRestore(this.startupNoticesContainer);\n\tif (this.deferLoadedResourcesDisclosureUntilAgentEnd) {\n\t\tthis.pendingLoadedResourcesDisclosure = true;\n\t} else {\n\t\tthis.showLoadedResources({ force: true, showDiagnosticsWhenQuiet: true, targetContainer: this.startupNoticesContainer });\n\t\t// Keep the subscription warning after the RESOURCES disclosure.\n\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, this.startupNoticesContainer);\n\t}\n\tthis.showStartupNoticesIfNeeded(this.startupNoticesContainer);\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n void this.updateAvailableProviderCount().catch(() => {});\n this.updateEditorBorderColor();\n this.ui.requestRender();\n };\n\nexport async function applyDeferredModelScope(mode: InteractiveModeBase): Promise<void> {\n const patterns = mode.options.deferredModelScopePatterns;\n if (!patterns || patterns.length === 0) {\n return;\n }\n\n const { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(patterns, mode.session.modelRegistry);\n for (const diagnostic of diagnostics) {\n mode.showWarning(diagnostic.message);\n }\n mode.session.setScopedModels(scopedModels);\n\n if (mode.sessionManager.buildSessionContext().messages.length > 0 || scopedModels.length === 0) {\n return;\n }\n\n const currentModel = mode.session.model;\n if (currentModel && scopedModels.some((scoped) => modelsAreEqual(scoped.model, currentModel))) {\n return;\n }\n\n const savedProvider = mode.settingsManager.getDefaultProvider();\n const savedModelId = mode.settingsManager.getDefaultModel();\n const savedModel = savedProvider && savedModelId ? mode.session.modelRegistry.find(savedProvider, savedModelId) : undefined;\n const preferred = savedModel ? scopedModels.find((scoped) => modelsAreEqual(scoped.model, savedModel)) : undefined;\n const nextScopedModel = preferred ?? scopedModels[0];\n if (mode.session.modelRegistry.hasConfiguredAuth(nextScopedModel.model)) {\n await mode.session.setModel(nextScopedModel.model);\n if (nextScopedModel.thinkingLevel && !mode.options.deferredModelScopePreserveThinking) {\n mode.session.setThinkingLevel(nextScopedModel.thinkingLevel);\n }\n }\n }\n\n/**\n * A session model saved with an extension-registered provider cannot resolve\n * until extensions load; retry the restore now and only surface the fallback\n * warning if it still fails.\n */\nInteractiveModeBase.prototype.retryDeferredModelRestore = async function(this: InteractiveModeBase, targetContainer?: Container): Promise<void> {\n const fallbackMessage = this.options.modelFallbackMessage;\n if (!fallbackMessage) {\n return;\n }\n const savedModel = this.sessionManager.buildSessionContext().model;\n if (savedModel) {\n const restoredModel = await resolveSavedModelReference(\n savedModel.provider,\n savedModel.modelId,\n this.session.modelRegistry,\n );\n if (restoredModel && this.session.modelRegistry.hasConfiguredAuth(restoredModel)) {\n await this.session.setModel(restoredModel);\n return;\n }\n }\n this.showWarning(fallbackMessage, targetContainer);\n };\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-deferred-startup.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-deferred-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAkB,oBAAoB,EAAE,gCAAgC,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAQxK,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,IAAyB;IACzE,IAAI,CAAC,IAAI,CAAC,sBAAsB,IAAI,CAAC,IAAI,CAAC,sBAAsB;QAAE,OAAO;IACzE,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;IACnH,IAAI,CAAC,sBAAsB,GAAG,cAAc,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,cAAc,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC;IACtC,CAAC;YAAS,CAAC;QACT,IAAI,IAAI,CAAC,sBAAsB,KAAK,cAAc,IAAI,CAAC,IAAI,CAAC,sBAAsB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import { modelsAreEqual } from \"@earendil-works/pi-ai/compat\";\nimport { type Container, recordTimeSinceReset, resolveModelScopeWithDiagnostics, resolveRestoredModelReference, setRegisteredThemes } from \"./interactive-mode-deps.ts\";\n\nexport interface DeferredStartupMode {\n deferredStartupPending: boolean;\n deferredStartupPromise: Promise<void> | undefined;\n completeDeferredStartup(): Promise<void>;\n }\n\nexport async function ensureDeferredStartupComplete(mode: DeferredStartupMode): Promise<void> {\n if (!mode.deferredStartupPending && !mode.deferredStartupPromise) return;\n const startupPromise = mode.deferredStartupPromise ?? Promise.resolve().then(() => mode.completeDeferredStartup());\n mode.deferredStartupPromise = startupPromise;\n try {\n await startupPromise;\n } catch {\n mode.deferredStartupPending = false;\n } finally {\n if (mode.deferredStartupPromise === startupPromise && !mode.deferredStartupPending) {\n mode.deferredStartupPromise = undefined;\n }\n }\n }\n\nInteractiveModeBase.prototype.ensureDeferredStartupComplete = async function(this: InteractiveModeBase): Promise<void> {\n await ensureDeferredStartupComplete(this);\n };\n\n/**\n * Finishes a startup where extension loading was deferred so the TUI could\n * paint immediately. Loads extension code via session.reload(), then applies\n * the same post-load UI wiring as /reload and discloses loaded resources.\n */\nInteractiveModeBase.prototype.completeDeferredStartup = async function(this: InteractiveModeBase): Promise<void> {\n try {\n await this.bindCurrentSessionExtensions();\n await this.session.reload({ reason: \"startup\" });\n\n this.stopWorkingLoader();\n this.deferredStartupPending = false;\n recordTimeSinceReset(\"deferred-extension-load\");\n\n setRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n await this.themeController.applyFromSettings();\n this.setupAutocompleteProvider();\n this.setupExtensionShortcuts(this.session.extensionRunner);\n await applyDeferredModelScope(this);\n await this.retryDeferredModelRestore(this.startupNoticesContainer);\n if (this.deferLoadedResourcesDisclosureUntilAgentEnd) {\n this.pendingLoadedResourcesDisclosure = true;\n } else {\n this.showLoadedResources({ force: true, showDiagnosticsWhenQuiet: true, targetContainer: this.startupNoticesContainer });\n // Keep the subscription warning after the RESOURCES disclosure.\n void this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, this.startupNoticesContainer);\n this.showStartupNoticesIfNeeded(this.startupNoticesContainer);\n }\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n void this.updateAvailableProviderCount().catch(() => {});\n this.updateEditorBorderColor();\n this.ui.requestRender();\n } catch (error) {\n this.stopWorkingLoader();\n this.deferredStartupPending = false;\n this.showError(\n `Extension loading failed: ${error instanceof Error ? error.message : String(error)}`,\n );\n // The RESOURCES disclosure will not render; surface the held warning.\n void this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, this.startupNoticesContainer);\n }\n };\n\nexport async function applyDeferredModelScope(mode: InteractiveModeBase): Promise<void> {\n const patterns = mode.options.deferredModelScopePatterns;\n if (!patterns || patterns.length === 0) {\n return;\n }\n\n const { scopedModels, diagnostics } = await resolveModelScopeWithDiagnostics(patterns, mode.session.modelRegistry);\n for (const diagnostic of diagnostics) {\n mode.showWarning(diagnostic.message);\n }\n mode.session.setScopedModels(scopedModels);\n\n if (mode.sessionManager.buildSessionContext().messages.length > 0 || scopedModels.length === 0) {\n return;\n }\n\n const currentModel = mode.session.model;\n if (currentModel && scopedModels.some((scoped) => modelsAreEqual(scoped.model, currentModel))) {\n return;\n }\n\n const savedProvider = mode.settingsManager.getDefaultProvider();\n const savedModelId = mode.settingsManager.getDefaultModel();\n const savedModel = savedProvider && savedModelId ? mode.session.modelRegistry.find(savedProvider, savedModelId) : undefined;\n const preferred = savedModel ? scopedModels.find((scoped) => modelsAreEqual(scoped.model, savedModel)) : undefined;\n const nextScopedModel = preferred ?? scopedModels[0];\n if (mode.session.modelRegistry.hasConfiguredAuth(nextScopedModel.model)) {\n await mode.session.setModel(nextScopedModel.model);\n if (nextScopedModel.thinkingLevel && !mode.options.deferredModelScopePreserveThinking) {\n mode.session.setThinkingLevel(nextScopedModel.thinkingLevel);\n }\n }\n }\n\n/**\n * A session model saved with an extension-registered provider cannot resolve\n * until extensions load; retry the restore now and only surface the fallback\n * warning if it still fails.\n */\nInteractiveModeBase.prototype.retryDeferredModelRestore = async function(this: InteractiveModeBase, targetContainer?: Container): Promise<void> {\n const fallbackMessage = this.options.modelFallbackMessage;\n if (!fallbackMessage) {\n return;\n }\n const savedModel = this.sessionManager.buildSessionContext().model;\n if (!savedModel && this.session.model && this.session.modelRegistry.hasConfiguredAuth(this.session.model)) {\n return;\n }\n if (savedModel) {\n const restoredModel = await resolveRestoredModelReference(\n savedModel.provider,\n savedModel.modelId,\n this.session.modelRegistry,\n );\n if (restoredModel && this.session.modelRegistry.hasConfiguredAuth(restoredModel)) {\n await this.session.setModel(restoredModel);\n return;\n }\n }\n this.showWarning(fallbackMessage, targetContainer);\n };\n"]}
|
|
@@ -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 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":"","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"]}
|
|
@@ -116,6 +116,7 @@ InteractiveModeBase.prototype.handleHotkeysCommand = function () {
|
|
|
116
116
|
this.ui.requestRender();
|
|
117
117
|
};
|
|
118
118
|
InteractiveModeBase.prototype.handleClearCommand = async function () {
|
|
119
|
+
await this.ensureDeferredStartupComplete();
|
|
119
120
|
if (this.loadingAnimation) {
|
|
120
121
|
this.loadingAnimation.stop();
|
|
121
122
|
this.loadingAnimation = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-hotkeys-debug.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-hotkeys-debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,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AW,CAAC,EAC9C,CAAC;QACC,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;AACH,CAAC,CAAC","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 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.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-hotkeys-debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAuC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,6BAA6B,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExQ,mBAAmB,CAAC,SAAS,CAAC,gBAAgB,GAAG,UAAoC,MAAqB;IACtG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC,CAAC;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C3C,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACzD,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,GAAG;IACjD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,6BAA6B,EAAE,CAAC,CAAC;IACjE,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,aAAa,GAAG;IAC1C,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;AAC1B,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,qBAAqB,GAAG,UAAoC,KAAuC;IAC7H,IACE,KAAK,CAAC,QAAQ,KAAK,UAAU;QAC7B,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,EAC9C,CAAC;QACC,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;AACH,CAAC,CAAC","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 +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 } 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 if (this.deferredStartupPending) {\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 await this.ensureDeferredStartupComplete();\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 }\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 this.cycleModel(\"forward\"),\n );\n this.defaultEditor.onAction(\"app.model.cycleBackward\", () =>\n this.cycleModel(\"backward\"),\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 this.showModelSelector(),\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 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\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.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.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.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 // 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":"","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,24 +1,28 @@
|
|
|
1
1
|
import { InteractiveModeBase, seedStartupInput } from "./interactive-mode-base.js";
|
|
2
|
-
import { pasteClipboardImageToEditor } from "./interactive-mode-deps.js";
|
|
2
|
+
import { pasteClipboardImageToEditor, recordTimeSinceReset } from "./interactive-mode-deps.js";
|
|
3
3
|
import { yieldToEventLoop } from "../../utils/event-loop.js";
|
|
4
4
|
InteractiveModeBase.prototype.runUserPromptTurn = async function (userInput) {
|
|
5
5
|
// Show the working spinner immediately on submit so there is no visible gap
|
|
6
6
|
// while prompt preflight runs before the agent emits `agent_start`.
|
|
7
7
|
this.showWorkingLoaderNow();
|
|
8
|
-
|
|
8
|
+
const deferredStartupNeedsPromptGate = this.deferredStartupPending || this.deferredStartupPromise !== undefined;
|
|
9
|
+
if (deferredStartupNeedsPromptGate) {
|
|
9
10
|
this.deferLoadedResourcesDisclosureUntilAgentEnd = true;
|
|
10
11
|
}
|
|
11
12
|
// Yield once so the freshly-mounted spinner paints before synchronous
|
|
12
13
|
// preflight work can block the event loop.
|
|
13
14
|
await yieldToEventLoop();
|
|
14
15
|
try {
|
|
15
|
-
|
|
16
|
+
if (deferredStartupNeedsPromptGate) {
|
|
17
|
+
await this.ensureDeferredStartupComplete();
|
|
18
|
+
}
|
|
16
19
|
await this.session.prompt(userInput);
|
|
17
20
|
this.deferLoadedResourcesDisclosureUntilAgentEnd = false;
|
|
18
21
|
if (this.pendingLoadedResourcesDisclosure) {
|
|
19
22
|
this.pendingLoadedResourcesDisclosure = false;
|
|
20
23
|
this.showLoadedResources({ force: true, showDiagnosticsWhenQuiet: true, targetContainer: this.startupNoticesContainer });
|
|
21
24
|
void this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, this.startupNoticesContainer);
|
|
25
|
+
this.showStartupNoticesIfNeeded(this.startupNoticesContainer);
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
catch (error) {
|
|
@@ -85,11 +89,26 @@ InteractiveModeBase.prototype.setupKeyHandlers = function () {
|
|
|
85
89
|
this.defaultEditor.onCtrlD = () => this.handleCtrlD();
|
|
86
90
|
this.defaultEditor.onAction("app.suspend", () => this.handleCtrlZ());
|
|
87
91
|
this.defaultEditor.onAction("app.thinking.cycle", () => this.cycleThinkingLevel());
|
|
88
|
-
this.defaultEditor.onAction("app.model.cycleForward", () =>
|
|
89
|
-
|
|
92
|
+
this.defaultEditor.onAction("app.model.cycleForward", () => {
|
|
93
|
+
void (async () => {
|
|
94
|
+
await this.ensureDeferredStartupComplete();
|
|
95
|
+
await this.cycleModel("forward");
|
|
96
|
+
})();
|
|
97
|
+
});
|
|
98
|
+
this.defaultEditor.onAction("app.model.cycleBackward", () => {
|
|
99
|
+
void (async () => {
|
|
100
|
+
await this.ensureDeferredStartupComplete();
|
|
101
|
+
await this.cycleModel("backward");
|
|
102
|
+
})();
|
|
103
|
+
});
|
|
90
104
|
// Global debug handler on TUI (works regardless of focus)
|
|
91
105
|
this.ui.onDebug = () => this.handleDebugCommand();
|
|
92
|
-
this.defaultEditor.onAction("app.model.select", () =>
|
|
106
|
+
this.defaultEditor.onAction("app.model.select", () => {
|
|
107
|
+
void (async () => {
|
|
108
|
+
await this.ensureDeferredStartupComplete();
|
|
109
|
+
this.showModelSelector();
|
|
110
|
+
})();
|
|
111
|
+
});
|
|
93
112
|
this.defaultEditor.onAction("app.tools.expand", () => this.toggleToolOutputExpansion());
|
|
94
113
|
this.defaultEditor.onAction("app.thinking.toggle", () => this.toggleThinkingBlockVisibility());
|
|
95
114
|
this.defaultEditor.onAction("app.editor.external", () => this.openExternalEditor());
|
|
@@ -205,6 +224,10 @@ InteractiveModeBase.prototype.advanceStartupInputReplay = function (submittedTex
|
|
|
205
224
|
};
|
|
206
225
|
InteractiveModeBase.prototype.setupEditorSubmitHandler = function () {
|
|
207
226
|
this.defaultEditor.onSubmit = async (text) => {
|
|
227
|
+
if (!this.firstSubmitRecorded) {
|
|
228
|
+
this.firstSubmitRecorded = true;
|
|
229
|
+
recordTimeSinceReset("interactive-first-submit");
|
|
230
|
+
}
|
|
208
231
|
text = text.trim();
|
|
209
232
|
if (!text)
|
|
210
233
|
return;
|
|
@@ -228,6 +251,7 @@ InteractiveModeBase.prototype.setupEditorSubmitHandler = function () {
|
|
|
228
251
|
}
|
|
229
252
|
if (text === "/scoped-models") {
|
|
230
253
|
this.editor.setText("");
|
|
254
|
+
await this.ensureDeferredStartupComplete();
|
|
231
255
|
await this.showModelsSelector();
|
|
232
256
|
return;
|
|
233
257
|
}
|
|
@@ -236,6 +260,7 @@ InteractiveModeBase.prototype.setupEditorSubmitHandler = function () {
|
|
|
236
260
|
? text.slice(7).trim()
|
|
237
261
|
: undefined;
|
|
238
262
|
this.editor.setText("");
|
|
263
|
+
await this.ensureDeferredStartupComplete();
|
|
239
264
|
await this.handleModelCommand(searchTerm);
|
|
240
265
|
return;
|
|
241
266
|
}
|
|
@@ -330,6 +355,7 @@ InteractiveModeBase.prototype.setupEditorSubmitHandler = function () {
|
|
|
330
355
|
}
|
|
331
356
|
if (text === "/reload") {
|
|
332
357
|
this.editor.setText("");
|
|
358
|
+
await this.ensureDeferredStartupComplete();
|
|
333
359
|
await this.handleReloadCommand();
|
|
334
360
|
return;
|
|
335
361
|
}
|
|
@@ -358,6 +384,15 @@ InteractiveModeBase.prototype.setupEditorSubmitHandler = function () {
|
|
|
358
384
|
await this.shutdown();
|
|
359
385
|
return;
|
|
360
386
|
}
|
|
387
|
+
if (text.startsWith("/") && this.deferredStartupPending) {
|
|
388
|
+
this.editor.addToHistory?.(text);
|
|
389
|
+
this.editor.setText("");
|
|
390
|
+
this.ui.requestRender();
|
|
391
|
+
await yieldToEventLoop();
|
|
392
|
+
await this.ensureDeferredStartupComplete();
|
|
393
|
+
await this.session.prompt(text);
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
361
396
|
// Handle bash command (! for normal, !! for excluded from context)
|
|
362
397
|
if (text.startsWith("!")) {
|
|
363
398
|
const isExcluded = text.startsWith("!!");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-input-handling.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-input-handling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,mBAAmB,CAAC,SAAS,CAAC,iBAAiB,GAAG,KAAK,WAAqC,SAAiB;IACzG,4EAA4E;IAC5E,oEAAoE;IACpE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC5B,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChC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CAAC;gBAC7B,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;gBACjC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBACxB,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC;gBAChE,IAAI,CAAC,4BAA4B,EAAE,CAAC;gBACpC,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;gBACxB,OAAO;YACT,CAAC;YAED,4BAA4B;YAC5B,kDAAkD;YAClD,IAAI,CAAC,0BAA0B,EAAE,CAAC;YAElC,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;gBACzB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC1B,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;gBACrC,CAAC;gBACD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,yBAAyB,EAAE,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase, seedStartupInput } from \"./interactive-mode-base.ts\";\nimport { pasteClipboardImageToEditor } 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 if (this.deferredStartupPending) {\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 await this.ensureDeferredStartupComplete();\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 }\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 this.cycleModel(\"forward\"),\n );\n this.defaultEditor.onAction(\"app.model.cycleBackward\", () =>\n this.cycleModel(\"backward\"),\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 this.showModelSelector(),\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 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\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.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.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.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 // 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.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-input-handling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,mBAAmB,CAAC,SAAS,CAAC,iBAAiB,GAAG,KAAK,WAAqC,SAAiB;IACzG,4EAA4E;IAC5E,oEAAoE;IACpE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC5B,MAAM,8BAA8B,GAAG,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,sBAAsB,KAAK,SAAS,CAAC;IAChH,IAAI,8BAA8B,EAAE,CAAC;QACnC,IAAI,CAAC,2CAA2C,GAAG,IAAI,CAAC;IAC1D,CAAC;IACD,sEAAsE;IACtE,2CAA2C;IAC3C,MAAM,gBAAgB,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,IAAI,8BAA8B,EAAE,CAAC;YACnC,MAAM,IAAI,CAAC,6BAA6B,EAAE,CAAC;QAC7C,CAAC;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,2CAA2C,GAAG,KAAK,CAAC;QACzD,IAAI,IAAI,CAAC,gCAAgC,EAAE,CAAC;YAC1C,IAAI,CAAC,gCAAgC,GAAG,KAAK,CAAC;YAC9C,IAAI,CAAC,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;YACzH,KAAK,IAA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gBACrC,CAAC;gBACD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,yBAAyB,EAAE,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC","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"]}
|
|
@@ -50,6 +50,7 @@ export declare class InteractiveModeBase {
|
|
|
50
50
|
lastEscapeTime: number;
|
|
51
51
|
changelogMarkdown: string | undefined;
|
|
52
52
|
startupNoticesShown: boolean;
|
|
53
|
+
startupNoticesPrepared: boolean;
|
|
53
54
|
anthropicSubscriptionWarningShown: boolean;
|
|
54
55
|
firstRunNoticeVisible: boolean;
|
|
55
56
|
hadLastChangelogVersionAtStartup: boolean;
|
|
@@ -78,6 +79,8 @@ export declare class InteractiveModeBase {
|
|
|
78
79
|
compactionQueuedMessages: CompactionQueuedMessage[];
|
|
79
80
|
deferredStartupPending: boolean;
|
|
80
81
|
deferredStartupPromise: Promise<void> | undefined;
|
|
82
|
+
inputHandlerReadyRecorded: boolean;
|
|
83
|
+
firstSubmitRecorded: boolean;
|
|
81
84
|
deferLoadedResourcesDisclosureUntilAgentEnd: boolean;
|
|
82
85
|
pendingLoadedResourcesDisclosure: boolean;
|
|
83
86
|
shutdownRequested: boolean;
|