mixdog 0.9.172 → 0.9.173
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/package.json +3 -3
- package/scripts/code-graph-description-contract.mjs +1 -2
- package/scripts/context-renewal-live-check.mjs +1 -1
- package/scripts/coverage-query.mjs +27 -0
- package/scripts/generate-runtime-manifest.mjs +12 -16
- package/scripts/graph-parity.mjs +108 -75
- package/scripts/lib/coverage.mjs +309 -0
- package/scripts/lib/embedding-model-bench-core.mjs +4 -2
- package/scripts/lib/recall-bench-eval.mjs +4 -4
- package/scripts/lib/run-node-tests.mjs +137 -13
- package/scripts/lib/test-failure-records.mjs +46 -0
- package/scripts/lib/test-failure-summary.mjs +59 -0
- package/scripts/lib/test-summary-reporter.mjs +7 -3
- package/scripts/mouse-probe.mjs +1 -3
- package/scripts/office/build-pptx-icons.mjs +0 -1
- package/scripts/perf/transcript-runtime-probe.mjs +20 -4
- package/scripts/pg-memory-diet.mjs +2 -4
- package/scripts/routing-corpus.mjs +0 -2
- package/scripts/session-diag.mjs +0 -7
- package/scripts/session-sweep.mjs +102 -56
- package/scripts/test.mjs +113 -37
- package/scripts/tui-frame-harness.mjs +1 -1
- package/src/app.mjs +79 -74
- package/src/cli.mjs +0 -2
- package/src/defaults/skills/browser-use/SKILL.md +8 -6
- package/src/defaults/skills/code-tidy/SKILL.md +67 -17
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +26 -3
- package/src/defaults/skills/computer-use/SKILL.md +12 -5
- package/src/defaults/skills/goal-management/SKILL.md +16 -9
- package/src/defaults/skills/pdf/SKILL.md +2 -1
- package/src/defaults/skills/xlsx/SKILL.md +3 -3
- package/src/headless-exec.mjs +1 -2
- package/src/help.mjs +2 -2
- package/src/lib/rules-builder.cjs +0 -23
- package/src/repl/slash-commands.mjs +1 -5
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/turn.mjs +4 -4
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +25 -41
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +25 -24
- package/src/runtime/agent/orchestrator/agent-trace-io.mjs +15 -22
- package/src/runtime/agent/orchestrator/agent-trace.mjs +0 -22
- package/src/runtime/agent/orchestrator/config-providers-merge.mjs +56 -0
- package/src/runtime/agent/orchestrator/config.mjs +34 -76
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +40 -39
- package/src/runtime/agent/orchestrator/providers/anthropic-api-recovery.mjs +75 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +152 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-api-transport.mjs +168 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-midstream-recovery.mjs +248 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-midstream.mjs +16 -206
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-recovery.mjs +11 -63
- package/src/runtime/agent/orchestrator/providers/anthropic-recovery-guards.mjs +86 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-turn-result.mjs +88 -0
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +87 -591
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +32 -288
- package/src/runtime/agent/orchestrator/providers/antigravity-response.mjs +101 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-stream.mjs +161 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-transport.mjs +114 -0
- package/src/runtime/agent/orchestrator/providers/gemini-cache-policy.mjs +266 -0
- package/src/runtime/agent/orchestrator/providers/gemini-request-body.mjs +54 -0
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +145 -0
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +56 -39
- package/src/runtime/agent/orchestrator/providers/gemini-sdk-request.mjs +107 -0
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +23 -533
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +10 -4
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +83 -32
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +41 -25
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-outcome.mjs +4 -98
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-stamps.mjs +114 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-dispatch.mjs +258 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +48 -214
- package/src/runtime/agent/orchestrator/providers/openai-responses-input.mjs +80 -60
- package/src/runtime/agent/orchestrator/providers/openai-ws-handshake.mjs +108 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +8 -87
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-outcome.mjs +52 -293
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-trace.mjs +316 -0
- package/src/runtime/agent/orchestrator/providers/opencode-go-usage.mjs +76 -253
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +1 -7
- package/src/runtime/agent/orchestrator/session/compact/budget.mjs +17 -16
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +6 -4
- package/src/runtime/agent/orchestrator/session/compact/summary-schema.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/context-compaction-policy.mjs +9 -13
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +1 -2
- package/src/runtime/agent/orchestrator/session/evidence-union.mjs +6 -9
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +2 -3
- package/src/runtime/agent/orchestrator/session/loop/diagnostics.mjs +1 -8
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +1 -3
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/call-prep.mjs +1 -5
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +0 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +4 -55
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-steering-drain.mjs +63 -0
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/foreign-pending-messages.mjs +80 -65
- package/src/runtime/agent/orchestrator/session/manager/pending-claim-ledger.mjs +68 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-delivered-ledger.mjs +56 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-lifecycle-epoch.mjs +84 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +51 -651
- package/src/runtime/agent/orchestrator/session/manager/pending-persist-queue.mjs +264 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-file.mjs +131 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-sweep.mjs +73 -0
- package/src/runtime/agent/orchestrator/session/manager/prepared-resume-cache.mjs +122 -0
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +5 -4
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +60 -35
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +22 -646
- package/src/runtime/agent/orchestrator/session/manager/session-owner-liveness.mjs +135 -0
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +150 -0
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +154 -0
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +135 -0
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +4 -11
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +0 -6
- package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +1 -3
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +11 -12
- package/src/runtime/agent/orchestrator/session/provider-prefix-guard.mjs +23 -32
- package/src/runtime/agent/orchestrator/session/store/lifecycle-barriers.mjs +275 -0
- package/src/runtime/agent/orchestrator/session/store/lifecycle-read.mjs +67 -0
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/live-cache-eviction.mjs +72 -0
- package/src/runtime/agent/orchestrator/session/store/liveness-veto.mjs +53 -0
- package/src/runtime/agent/orchestrator/session/store/load-session.mjs +60 -0
- package/src/runtime/agent/orchestrator/session/store/pending-saves.mjs +55 -0
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +7 -15
- package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +149 -0
- package/src/runtime/agent/orchestrator/session/store/session-observers.mjs +55 -0
- package/src/runtime/agent/orchestrator/session/store/write-admission.mjs +108 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +531 -0
- package/src/runtime/agent/orchestrator/session/store-summary-archived-agent.mjs +126 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +24 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +2 -10
- package/src/runtime/agent/orchestrator/session/store-summary-locations.mjs +46 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +11 -791
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +126 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +33 -771
- package/src/runtime/agent/orchestrator/session/tool-batch/finalize.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +13 -7
- package/src/runtime/agent/orchestrator/stable-hash-stringify.mjs +10 -0
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +50 -75
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +22 -21
- package/src/runtime/agent/orchestrator/tools/builtin/external-tool-adapters.mjs +0 -2
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-policy.mjs +44 -27
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +36 -54
- package/src/runtime/agent/orchestrator/tools/builtin/git-partial-stage.mjs +8 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-context-expander.mjs +8 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-output.mjs +18 -9
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-request.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-single-file-rescue.mjs +80 -67
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-task-output.mjs +12 -4
- package/src/runtime/agent/orchestrator/tools/builtin/native-search-client.mjs +1 -4
- package/src/runtime/agent/orchestrator/tools/builtin/path-diagnostics.mjs +61 -72
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +0 -5
- package/src/runtime/agent/orchestrator/tools/builtin/read-office-files.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +11 -14
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-render.mjs +3 -6
- package/src/runtime/agent/orchestrator/tools/builtin/read-special-files.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +124 -94
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/reach-preflight.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-windows.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/search-builders.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +6 -6
- package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +21 -35
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +0 -3
- package/src/runtime/agent/orchestrator/tools/builtin/shell-lossless-compact.mjs +1 -3
- package/src/runtime/agent/orchestrator/tools/builtin/shell-output.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +0 -2
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/builtin/text-stats.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +0 -4
- package/src/runtime/agent/orchestrator/tools/code-graph/aggregate-roots.mjs +7 -7
- package/src/runtime/agent/orchestrator/tools/code-graph/ast-calls.mjs +0 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/build-file-infos.mjs +182 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +14 -159
- package/src/runtime/agent/orchestrator/tools/code-graph/constants.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +21 -8
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary.mjs +0 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +5 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.golden.json +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +11 -11
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +3 -6
- package/src/runtime/agent/orchestrator/tools/patch/mutation-output.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/native-server.mjs +25 -39
- package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +9 -14
- package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +11 -6
- package/src/runtime/agent/orchestrator/tools/patch/replay-capture.mjs +5 -6
- package/src/runtime/agent/orchestrator/tools/patch/text-lines.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch/v4a-anchors.mjs +10 -7
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +20 -30
- package/src/runtime/agent/orchestrator/tools/patch/v4a-windows.mjs +4 -19
- package/src/runtime/agent/orchestrator/tools/patch/wave.mjs +13 -2
- package/src/runtime/agent/orchestrator/tools/patch.mjs +0 -19
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +60 -36
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +0 -4
- package/src/runtime/agent/orchestrator/tools/shell-policy.mjs +6 -7
- package/src/runtime/attachments/store.mjs +13 -12
- package/src/runtime/browser-bridge/client.mjs +19 -9
- package/src/runtime/channels/index.mjs +1 -1
- package/src/runtime/channels/lib/event-pipeline.mjs +8 -8
- package/src/runtime/channels/lib/event-queue.mjs +15 -20
- package/src/runtime/channels/lib/executor.mjs +10 -7
- package/src/runtime/channels/lib/owner-heartbeat.mjs +0 -4
- package/src/runtime/channels/lib/runtime-paths.mjs +30 -33
- package/src/runtime/channels/lib/scheduler.mjs +11 -20
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +0 -4
- package/src/runtime/channels/lib/voice-transcription.mjs +127 -104
- package/src/runtime/channels/lib/webhook/verification.mjs +33 -20
- package/src/runtime/channels/lib/worker-bootstrap.mjs +0 -2
- package/src/runtime/channels/lib/worker-main.mjs +2 -2
- package/src/runtime/computer-bridge/action-schema.mjs +20 -0
- package/src/runtime/computer-bridge/core-actions.mjs +15 -0
- package/src/runtime/github/client.mjs +2 -3
- package/src/runtime/github/commands.mjs +9 -3
- package/src/runtime/github/contract.mjs +7 -0
- package/src/runtime/local-provider/catalog.mjs +4 -3
- package/src/runtime/local-provider/hardware.mjs +7 -20
- package/src/runtime/local-provider/resumable-installations.mjs +12 -19
- package/src/runtime/media/auth.mjs +16 -13
- package/src/runtime/media/catalog.mjs +14 -6
- package/src/runtime/media/lanes.mjs +2 -1
- package/src/runtime/memory/index.mjs +5 -10
- package/src/runtime/memory/lib/core-memory-store.mjs +3 -7
- package/src/runtime/memory/lib/embedding-provider.mjs +9 -19
- package/src/runtime/memory/lib/embedding-worker.mjs +24 -28
- package/src/runtime/memory/lib/http-router/admin-routes.mjs +5 -51
- package/src/runtime/memory/lib/http-router/admin-trace-routes.mjs +65 -0
- package/src/runtime/memory/lib/memory-action-handlers/cycle-actions.mjs +18 -143
- package/src/runtime/memory/lib/memory-action-handlers/cycle-backfill-action.mjs +84 -0
- package/src/runtime/memory/lib/memory-action-handlers/cycle-rebuild-action.mjs +94 -0
- package/src/runtime/memory/lib/memory-action-handlers/manage-actions.mjs +92 -53
- package/src/runtime/memory/lib/memory-categories.mjs +13 -0
- package/src/runtime/memory/lib/memory-chunk-quality.mjs +134 -74
- package/src/runtime/memory/lib/memory-cycle-requests.mjs +64 -70
- package/src/runtime/memory/lib/memory-cycle1.mjs +17 -33
- package/src/runtime/memory/lib/memory-embed.mjs +10 -2
- package/src/runtime/memory/lib/memory-ops-policy.mjs +3 -2
- package/src/runtime/memory/lib/memory-recall-scope-filter.mjs +1 -1
- package/src/runtime/memory/lib/memory.mjs +7 -35
- package/src/runtime/memory/lib/pg/adapter.mjs +3 -4
- package/src/runtime/memory/lib/pg/process.mjs +23 -28
- package/src/runtime/memory/lib/pg/supervisor.mjs +10 -11
- package/src/runtime/memory/lib/query-hybrid-search.mjs +2 -2
- package/src/runtime/memory/lib/query-maintenance-handlers.mjs +112 -89
- package/src/runtime/memory/lib/query-ranking.mjs +8 -11
- package/src/runtime/memory/lib/recall-format.mjs +6 -12
- package/src/runtime/memory/lib/recall-hybrid/plan.mjs +1 -1
- package/src/runtime/memory/lib/runtime-fetcher.mjs +73 -65
- package/src/runtime/memory/lib/trace-store.mjs +10 -19
- package/src/runtime/memory/lib/transcript-ingest.mjs +7 -4
- package/src/runtime/memory/tool-defs.mjs +5 -8
- package/src/runtime/office/authoring/pptx-author-action.mjs +2 -2
- package/src/runtime/office/authoring/pptx-author-session.mjs +6 -9
- package/src/runtime/office/authoring/pptx-brief.mjs +11 -4
- package/src/runtime/office/authoring/pptx-receipt.mjs +79 -60
- package/src/runtime/office/bench/benchmark.mjs +102 -82
- package/src/runtime/office/capabilities-catalog.mjs +2 -0
- package/src/runtime/office/capabilities-signatures.mjs +8 -0
- package/src/runtime/office/capabilities.mjs +3 -4
- package/src/runtime/office/com/com-adapter.mjs +13 -1
- package/src/runtime/office/com/office-com-host.ps1 +63 -1
- package/src/runtime/office/core/office-actions-batch.mjs +12 -12
- package/src/runtime/office/core/office-actions-open.mjs +2 -7
- package/src/runtime/office/core/office-core.mjs +20 -1
- package/src/runtime/office/core/office-finalize/session-save.mjs +9 -6
- package/src/runtime/office/core/office-session-dispatch.mjs +86 -0
- package/src/runtime/office/core/office-sessionless-actions.mjs +115 -0
- package/src/runtime/office/core/office-sessions.mjs +2 -2
- package/src/runtime/office/core/office-transactions.mjs +2 -4
- package/src/runtime/office/core/tabular.mjs +13 -16
- package/src/runtime/office/design/composition-system.mjs +32 -28
- package/src/runtime/office/design/content-model.mjs +2 -1
- package/src/runtime/office/design/design-art-direction.mjs +17 -14
- package/src/runtime/office/design/design-creative-director.mjs +1 -1
- package/src/runtime/office/design/design-discipline.mjs +8 -0
- package/src/runtime/office/design/design-tokens.mjs +9 -5
- package/src/runtime/office/design/docx/design-docx-components.mjs +88 -156
- package/src/runtime/office/design/library/design-library-pack.mjs +11 -23
- package/src/runtime/office/design/library/design-library.mjs +15 -37
- package/src/runtime/office/design/library/design-template-index.mjs +1 -9
- package/src/runtime/office/design/library/design-template-induct.mjs +2 -1
- package/src/runtime/office/design/native-design.mjs +2 -3
- package/src/runtime/office/index.mjs +7 -160
- package/src/runtime/office/pdf/pdf-adapter.mjs +17 -2
- package/src/runtime/office/pdf/pdf-ocr.mjs +2 -1
- package/src/runtime/office/pdf/pdf-render.mjs +12 -13
- package/src/runtime/office/pdf/pdf-writer.mjs +135 -6
- package/src/runtime/office/portable/docx-revisions.mjs +5 -5
- package/src/runtime/office/portable/docx-runs.mjs +4 -7
- package/src/runtime/office/portable/docx-tracked-edits.mjs +14 -9
- package/src/runtime/office/portable/font-provisioner.mjs +2 -2
- package/src/runtime/office/portable/ooxml-validator.mjs +4 -1
- package/src/runtime/office/portable/portable-docx-edits.mjs +61 -45
- package/src/runtime/office/portable/portable-docx-operations.mjs +13 -4
- package/src/runtime/office/portable/portable-docx-parts.mjs +59 -70
- package/src/runtime/office/portable/portable-docx-xml.mjs +3 -5
- package/src/runtime/office/portable/portable-opc.mjs +63 -39
- package/src/runtime/office/portable/portable-package.mjs +5 -23
- package/src/runtime/office/portable/portable-pptx-chart.mjs +7 -6
- package/src/runtime/office/portable/portable-pptx-charts.mjs +27 -20
- package/src/runtime/office/portable/portable-pptx-core.mjs +10 -21
- package/src/runtime/office/portable/portable-pptx-deck.mjs +5 -8
- package/src/runtime/office/portable/portable-pptx-package.mjs +23 -30
- package/src/runtime/office/portable/portable-pptx-shapes.mjs +21 -57
- package/src/runtime/office/portable/portable-sheet-audits.mjs +14 -36
- package/src/runtime/office/portable/portable-sheet-page.mjs +22 -23
- package/src/runtime/office/portable/portable-sheet-parts.mjs +4 -5
- package/src/runtime/office/portable/portable-sheet-styles.mjs +11 -19
- package/src/runtime/office/portable/portable-sheet-xml.mjs +15 -7
- package/src/runtime/office/portable/portable-slide-shapes.mjs +4 -0
- package/src/runtime/office/portable/portable-snapshot-pptx.mjs +2 -2
- package/src/runtime/office/portable/portable-snapshot-shared.mjs +1 -1
- package/src/runtime/office/portable/portable-snapshot-xlsx.mjs +16 -17
- package/src/runtime/office/portable/portable-soffice.mjs +176 -13
- package/src/runtime/office/portable/portable-validation-package.mjs +16 -18
- package/src/runtime/office/portable/portable-validation.mjs +57 -31
- package/src/runtime/office/portable/portable-xlsx-cell-values.mjs +15 -0
- package/src/runtime/office/portable/portable-xlsx-charts.mjs +192 -0
- package/src/runtime/office/portable/portable-xlsx-drawings.mjs +323 -0
- package/src/runtime/office/portable/portable-xlsx-operations.mjs +29 -627
- package/src/runtime/office/portable/portable-xlsx-pivot-ops.mjs +94 -0
- package/src/runtime/office/portable/portable-xlsx-range-layout.mjs +236 -0
- package/src/runtime/office/portable/portable-xlsx-sheet-edits.mjs +19 -14
- package/src/runtime/office/portable/portable-xlsx.mjs +32 -0
- package/src/runtime/office/portable/portable-xml.mjs +9 -0
- package/src/runtime/office/portable/pptx-relations.mjs +11 -0
- package/src/runtime/office/portable/pptx-targets.mjs +2 -1
- package/src/runtime/office/portable/review-editability.mjs +4 -11
- package/src/runtime/office/portable/text-metrics.mjs +35 -55
- package/src/runtime/office/portable/xlsx-assertions.mjs +2 -15
- package/src/runtime/office/portable/xlsx-audit-support.mjs +2 -6
- package/src/runtime/office/portable/xlsx-contract.mjs +4 -0
- package/src/runtime/office/portable/xlsx-formula-audit.mjs +11 -4
- package/src/runtime/office/portable/xlsx-recalculate.mjs +1 -1
- package/src/runtime/office/portable/xlsx-sheet-hygiene.mjs +5 -1
- package/src/runtime/office/quality/assurance-rendered.mjs +3 -2
- package/src/runtime/office/quality/assurance-structure-pptx.mjs +16 -15
- package/src/runtime/office/quality/assurance-trust.mjs +25 -10
- package/src/runtime/office/quality/design-aesthetics.mjs +172 -145
- package/src/runtime/office/quality/design-deck-diversity.mjs +2 -5
- package/src/runtime/office/quality/design-review-authored.mjs +2 -2
- package/src/runtime/office/quality/design-review-critique.mjs +36 -37
- package/src/runtime/office/quality/design-review.mjs +113 -96
- package/src/runtime/office/quality/document-acceptance.mjs +10 -3
- package/src/runtime/office/quality/inline-audit.mjs +7 -2
- package/src/runtime/office/quality/pptx-deck-rubric.mjs +14 -6
- package/src/runtime/office/quality/pptx-slide-roles.mjs +7 -9
- package/src/runtime/office/quality/presentation-acceptance.mjs +2 -6
- package/src/runtime/office/quality/quality-pipeline.mjs +21 -14
- package/src/runtime/office/quality/quality-score.mjs +2 -2
- package/src/runtime/office/quality/render-air.mjs +12 -5
- package/src/runtime/shared/atomic-file.mjs +19 -8
- package/src/runtime/shared/config.mjs +7 -13
- package/src/runtime/shared/err-text.mjs +11 -6
- package/src/runtime/shared/file-lock.mjs +10 -6
- package/src/runtime/shared/inline-file-kind.mjs +51 -0
- package/src/runtime/shared/llm/usage-accounting.mjs +9 -6
- package/src/runtime/shared/llm/usage-ledger-rollup.mjs +272 -0
- package/src/runtime/shared/llm/usage-ledger.mjs +8 -218
- package/src/runtime/shared/pristine-execution.mjs +2 -6
- package/src/runtime/shared/process-lifecycle.mjs +34 -52
- package/src/runtime/shared/process-shutdown.mjs +1 -1
- package/src/runtime/shared/schedule-model-ref.mjs +14 -0
- package/src/runtime/shared/schedule-session-run.mjs +3 -13
- package/src/runtime/shared/schedules-db.mjs +16 -39
- package/src/runtime/shared/staged-child-result.mjs +2 -7
- package/src/runtime/shared/staged-update.mjs +1 -5
- package/src/runtime/shared/tool-card-model/agent-surface.mjs +8 -3
- package/src/runtime/shared/tool-card-model/card-status.mjs +2 -1
- package/src/runtime/shared/tool-card-model/displayed-result.mjs +2 -3
- package/src/runtime/shared/tool-card-model/generic-detail.mjs +5 -3
- package/src/runtime/shared/tool-card-model.golden-cases.mjs +10 -2
- package/src/runtime/shared/tool-card-model.golden.json +3 -12
- package/src/runtime/shared/tool-execution-contract.mjs +22 -26
- package/src/runtime/shared/tool-result-summary.mjs +7 -14
- package/src/runtime/shared/tool-surface.mjs +30 -33
- package/src/runtime/shared/tool-work-units.mjs +12 -8
- package/src/runtime/shared/turn-snapshot-store.mjs +2 -4
- package/src/runtime/shared/turn-worktree-snapshot.mjs +13 -16
- package/src/runtime/shared/update-checker.mjs +5 -0
- package/src/runtime/shared/user-data-guard.mjs +10 -17
- package/src/runtime/shared/webhook-session-run.mjs +3 -15
- package/src/runtime/tidy/history-comment.mjs +32 -27
- package/src/runtime/tidy/process.mjs +18 -21
- package/src/runtime/tidy/report.mjs +50 -9
- package/src/runtime/tidy/resolve.mjs +13 -14
- package/src/runtime/tidy/runners/air.mjs +2 -20
- package/src/runtime/tidy/runners/biome.mjs +4 -6
- package/src/runtime/tidy/runners/dprint.mjs +2 -23
- package/src/runtime/tidy/runners/mago.mjs +2 -20
- package/src/runtime/tidy/runners/ruff.mjs +2 -8
- package/src/runtime/tidy/runners/shared.mjs +35 -9
- package/src/runtime/tidy/runners/stylua.mjs +2 -20
- package/src/runtime/tidy/shadow.mjs +138 -0
- package/src/runtime/tidy/tool.mjs +33 -0
- package/src/runtime/tidy/worktree.mjs +114 -0
- package/src/runtime/web-search/index.mjs +64 -68
- package/src/runtime/web-search/lib/http-fetch.mjs +39 -54
- package/src/runtime/web-search/lib/ssrf-guard.mjs +19 -52
- package/src/runtime/web-search/lib/web-tools.mjs +2 -2
- package/src/session-runtime/config-helpers.mjs +9 -9
- package/src/session-runtime/context-inspection.mjs +64 -23
- package/src/session-runtime/context-status-cache.mjs +0 -2
- package/src/session-runtime/context-status-inspection.mjs +54 -25
- package/src/session-runtime/context-status-shape.mjs +1 -18
- package/src/session-runtime/goal-facade-api.mjs +15 -12
- package/src/session-runtime/goal-mutations.mjs +4 -3
- package/src/session-runtime/goal-runtime.mjs +5 -0
- package/src/session-runtime/goal-tasks.mjs +5 -10
- package/src/session-runtime/goal-text.mjs +46 -9
- package/src/session-runtime/goal-tool-defs.mjs +7 -8
- package/src/session-runtime/goal-tool-exec.mjs +1 -1
- package/src/session-runtime/goal-turns.mjs +54 -3
- package/src/session-runtime/hook-payload.mjs +2 -1
- package/src/session-runtime/inheritance-fit.mjs +3 -3
- package/src/session-runtime/lifecycle/teardown.mjs +9 -1
- package/src/session-runtime/mcp-glue/server-catalog.mjs +4 -6
- package/src/session-runtime/model-capabilities.mjs +1 -3
- package/src/session-runtime/notification-bus.mjs +30 -7
- package/src/session-runtime/plugin-mcp.mjs +0 -2
- package/src/session-runtime/provider-auth/accounts.mjs +2 -2
- package/src/session-runtime/provider-auth/login.mjs +0 -7
- package/src/session-runtime/provider-usage.mjs +1 -1
- package/src/session-runtime/runtime-paths.mjs +1 -3
- package/src/session-runtime/session-hooks.mjs +37 -96
- package/src/session-runtime/statusline-route.mjs +1 -4
- package/src/session-runtime/tool-catalog-schema.mjs +0 -6
- package/src/session-runtime/tool-catalog.mjs +10 -15
- package/src/session-runtime/workflow-ids.mjs +1 -2
- package/src/standalone/agent-task-status.mjs +1 -2
- package/src/standalone/agent-tool/close-flow/close-all.mjs +67 -0
- package/src/standalone/agent-tool/close-flow.mjs +2 -58
- package/src/standalone/agent-tool/execute-send.mjs +91 -0
- package/src/standalone/agent-tool/execute-spawn.mjs +76 -0
- package/src/standalone/agent-tool/execute.mjs +7 -147
- package/src/standalone/agent-tool/helpers.mjs +3 -6
- package/src/standalone/agent-tool/notify/early-completion.mjs +58 -0
- package/src/standalone/agent-tool/notify.mjs +7 -55
- package/src/standalone/agent-tool/provider-init.mjs +73 -64
- package/src/standalone/agent-tool/render.mjs +123 -115
- package/src/standalone/agent-tool/spawn-flow/spawn-plan.mjs +89 -0
- package/src/standalone/agent-tool/spawn-flow/spawn-prep.mjs +16 -75
- package/src/standalone/agent-tool/spawn-flow/spawn-run.mjs +1 -1
- package/src/standalone/agent-tool/worker-rows.mjs +0 -7
- package/src/standalone/channel-admin.mjs +13 -18
- package/src/standalone/channel-transport/remote-binding.mjs +10 -79
- package/src/standalone/channel-transport/remote-intent.mjs +52 -0
- package/src/standalone/channel-transport/remote-notify.mjs +15 -107
- package/src/standalone/channel-transport/remote-pointer.mjs +124 -0
- package/src/standalone/channel-transport/remote-state.mjs +47 -0
- package/src/standalone/daemon-agent-control.mjs +65 -0
- package/src/standalone/daemon-channels-loader.mjs +60 -0
- package/src/standalone/daemon-desktop-runtime.mjs +28 -0
- package/src/standalone/daemon-local-session-bridge.mjs +62 -0
- package/src/standalone/daemon-stored-session-views.mjs +55 -0
- package/src/standalone/daemon.mjs +175 -320
- package/src/standalone/desktop-service-registry.mjs +9 -7
- package/src/standalone/folder-dialog.mjs +11 -12
- package/src/standalone/hook-bus/command-handler.mjs +60 -49
- package/src/standalone/hook-bus/event-runner.mjs +7 -74
- package/src/standalone/hook-bus/handler-dispatch.mjs +75 -0
- package/src/standalone/provider-admin.mjs +14 -35
- package/src/standalone/session-client/attachment-calls.mjs +67 -0
- package/src/standalone/session-client/stream-link.mjs +85 -0
- package/src/standalone/session-client.mjs +31 -106
- package/src/standalone/session-frame-stream.mjs +4 -2
- package/src/standalone/session-protocol.mjs +0 -1
- package/src/standalone/session-runtime-agent-control-client.mjs +11 -27
- package/src/standalone/session-runtime-agent-control.mjs +85 -0
- package/src/standalone/session-runtime-host.mjs +30 -472
- package/src/standalone/session-runtime-inline-host/telemetry.mjs +38 -0
- package/src/standalone/session-runtime-inline-host.mjs +6 -37
- package/src/standalone/session-runtime-proxy.mjs +164 -0
- package/src/standalone/session-runtime-shard-router.mjs +4 -7
- package/src/standalone/session-runtime-spawn-leases.mjs +82 -0
- package/src/standalone/session-runtime-worker.mjs +27 -7
- package/src/standalone/session-service/agent-tree/agent-child.mjs +59 -0
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +4 -55
- package/src/standalone/session-service/agent-tree.mjs +3 -1
- package/src/standalone/session-service/entries/disposal.mjs +72 -0
- package/src/standalone/session-service/entries/external-binding.mjs +6 -3
- package/src/standalone/session-service/entries/lifecycle.mjs +15 -59
- package/src/standalone/session-service/retention/busy.mjs +50 -0
- package/src/standalone/session-service/retention.mjs +5 -44
- package/src/standalone/session-service/session-calls/goal-recovery.mjs +44 -0
- package/src/standalone/session-service/session-calls/session-action.mjs +5 -8
- package/src/standalone/session-service/session-calls/session-turns.mjs +12 -42
- package/src/standalone/session-service/session-calls/session-views.mjs +8 -8
- package/src/standalone/session-transport/stack.mjs +131 -0
- package/src/standalone/session-transport.mjs +10 -103
- package/src/standalone/usage-dashboard.mjs +167 -165
- package/src/standalone/usage-stats-model.mjs +117 -97
- package/src/tui/App.jsx +27 -210
- package/src/tui/app/app-format.mjs +7 -0
- package/src/tui/app/app-view/floating-panel.jsx +229 -0
- package/src/tui/app/app-view/text-entry-labels.mjs +81 -0
- package/src/tui/app/app-view/transcript-viewport/trailing-bands.jsx +94 -0
- package/src/tui/app/app-view/transcript-viewport/transcript-rows.jsx +87 -0
- package/src/tui/app/app-view/transcript-viewport.jsx +74 -0
- package/src/tui/app/app-view.jsx +12 -450
- package/src/tui/app/core-memory-picker/core-rows.mjs +32 -0
- package/src/tui/app/core-memory-picker/entry-prompts.mjs +45 -0
- package/src/tui/app/core-memory-picker/list-panels.mjs +75 -0
- package/src/tui/app/core-memory-picker.mjs +26 -120
- package/src/tui/app/doctor.mjs +17 -12
- package/src/tui/app/extension-pickers/skills-pickers/project-skills.mjs +38 -0
- package/src/tui/app/extension-pickers/skills-pickers/skill-detail.mjs +80 -0
- package/src/tui/app/extension-pickers/skills-pickers/skill-items.mjs +44 -0
- package/src/tui/app/extension-pickers/skills-pickers.mjs +31 -137
- package/src/tui/app/model-picker/route-selection/context-window.mjs +47 -0
- package/src/tui/app/model-picker/route-selection/effort.mjs +87 -0
- package/src/tui/app/model-picker/route-selection/fast-parameters.mjs +84 -0
- package/src/tui/app/model-picker/route-selection/model-key.mjs +5 -0
- package/src/tui/app/model-picker/route-selection.mjs +34 -200
- package/src/tui/app/mouse-input/edge-autoscroll.mjs +53 -0
- package/src/tui/app/mouse-input/geometry.mjs +109 -0
- package/src/tui/app/mouse-input/sgr-buttons.mjs +14 -0
- package/src/tui/app/mouse-input/wheel-router.mjs +96 -0
- package/src/tui/app/panel-signature.mjs +58 -0
- package/src/tui/app/project-picker/project-service.mjs +3 -7
- package/src/tui/app/prompt-submit.mjs +2 -7
- package/src/tui/app/provider-setup/api-key-actions.mjs +7 -80
- package/src/tui/app/provider-setup/oauth-actions.mjs +2 -10
- package/src/tui/app/provider-setup/provider-items.mjs +20 -3
- package/src/tui/app/settings-picker/settings-toggles/cycled.mjs +4 -0
- package/src/tui/app/settings-picker/settings-toggles/listed-cyclers.mjs +77 -0
- package/src/tui/app/settings-picker/settings-toggles/store-toggles.mjs +61 -0
- package/src/tui/app/settings-picker/settings-toggles/theme-cycler.mjs +36 -0
- package/src/tui/app/settings-picker/settings-toggles.mjs +21 -149
- package/src/tui/app/slash-commands.mjs +14 -4
- package/src/tui/app/store-service-call.mjs +17 -0
- package/src/tui/app/text-entry-policy.mjs +1 -3
- package/src/tui/app/transcript-row-estimate.mjs +31 -91
- package/src/tui/app/transcript-window.mjs +19 -0
- package/src/tui/app/use-disabled-skills.mjs +52 -0
- package/src/tui/app/use-global-key-input/copy-first.mjs +43 -0
- package/src/tui/app/use-global-key-input/shift-arrow.mjs +30 -0
- package/src/tui/app/use-global-key-input.mjs +10 -67
- package/src/tui/app/use-model-catalog-cache.mjs +86 -0
- package/src/tui/app/use-mouse-input.mjs +64 -218
- package/src/tui/app/use-pasted-buffers.mjs +55 -81
- package/src/tui/app/use-prompt-draft-flow/draft-change.mjs +66 -0
- package/src/tui/app/use-prompt-draft-flow/prompt-cancels.mjs +40 -0
- package/src/tui/app/use-prompt-draft-flow.mjs +38 -77
- package/src/tui/app/use-prompt-queue-history/prompt-history.mjs +22 -0
- package/src/tui/app/use-prompt-queue-history/restore-to-prompt.mjs +147 -0
- package/src/tui/app/use-prompt-queue-history.mjs +20 -117
- package/src/tui/app/use-selection-focus.mjs +2 -1
- package/src/tui/app/use-selection-geometry.mjs +9 -12
- package/src/tui/app/use-selection-paint/paint-queue.mjs +90 -0
- package/src/tui/app/use-selection-paint/selection-clip.mjs +33 -0
- package/src/tui/app/use-selection-paint.mjs +31 -102
- package/src/tui/app/use-transcript-activity.mjs +1 -1
- package/src/tui/app/use-transcript-window/instance-state.mjs +1 -1
- package/src/tui/app/use-welcome-prompt-hint.mjs +1 -1
- package/src/tui/app/workflow-cycle.mjs +63 -0
- package/src/tui/components/AnsiText.jsx +47 -15
- package/src/tui/components/ItemRightHintOverprint.jsx +2 -15
- package/src/tui/components/Picker.jsx +9 -23
- package/src/tui/components/PromptInput.jsx +89 -335
- package/src/tui/components/QueuedCommands.jsx +1 -3
- package/src/tui/components/Spinner.jsx +1 -2
- package/src/tui/components/StatusLine.jsx +11 -21
- package/src/tui/components/TextEntryPanel.jsx +5 -52
- package/src/tui/components/ToolExecution.jsx +5 -14
- package/src/tui/components/TranscriptItem.jsx +0 -2
- package/src/tui/components/TurnDone.jsx +2 -14
- package/src/tui/components/prompt-input/cursor-anchor.mjs +65 -0
- package/src/tui/components/prompt-input/edit-helpers.mjs +1 -2
- package/src/tui/components/prompt-input/key-signals.mjs +122 -0
- package/src/tui/components/prompt-input/mouse-selection.mjs +114 -0
- package/src/tui/components/prompt-input/restore-policy.d.mts +0 -1
- package/src/tui/components/prompt-input/restore-policy.mjs +3 -8
- package/src/tui/components/prompt-input/selected-text.jsx +25 -0
- package/src/tui/components/prompt-input/undo-stack.mjs +75 -0
- package/src/tui/components/tool-output-format.mjs +1 -2
- package/src/tui/dist/index.mjs +2841 -2469
- package/src/tui/index.jsx +2 -2
- package/src/tui/markdown/measure-rendered-rows.mjs +8 -33
- package/src/tui/markdown/render-ansi.mjs +5 -5
- package/src/tui/markdown/table-layout/box-lines.mjs +46 -0
- package/src/tui/markdown/table-layout/cells.mjs +23 -0
- package/src/tui/markdown/table-layout/column-widths.mjs +65 -0
- package/src/tui/markdown/table-layout/vertical-lines.mjs +46 -0
- package/src/tui/markdown/table-layout.mjs +21 -151
- package/src/tui/prompt-history-store.mjs +0 -9
- package/src/tui/session/active-tool-summary.mjs +19 -27
- package/src/tui/session/agent-envelope.mjs +9 -9
- package/src/tui/session/live-share/owner.mjs +9 -7
- package/src/tui/session/live-share/retry.mjs +15 -0
- package/src/tui/session/live-share/viewer/frame-router.mjs +32 -0
- package/src/tui/session/live-share/viewer/pipe-client.mjs +108 -0
- package/src/tui/session/live-share/viewer.mjs +23 -114
- package/src/tui/session/notice-surface.mjs +1 -1
- package/src/tui/session/notice-text.mjs +21 -17
- package/src/tui/session/queue-helpers.mjs +12 -14
- package/src/tui/session/session-api/intake/submission.mjs +3 -8
- package/src/tui/session/session-api/integrations.mjs +0 -11
- package/src/tui/session/session-api/lifecycle/session-reset.mjs +76 -74
- package/src/tui/session/session-flow/drain.mjs +18 -5
- package/src/tui/session/session-flow/queue/entry-shape.mjs +53 -0
- package/src/tui/session/session-flow/queue/take-entries.mjs +82 -0
- package/src/tui/session/session-flow/queue.mjs +10 -112
- package/src/tui/session/session-flow/session-reset.mjs +2 -7
- package/src/tui/session/tool-approval.mjs +13 -17
- package/src/tui/session/tool-result-text.mjs +16 -28
- package/src/tui/session/transcript-spill.mjs +3 -7
- package/src/tui/session/transcript-store/replace-items.mjs +66 -0
- package/src/tui/session/transcript-store/streaming-tail.mjs +49 -0
- package/src/tui/session/transcript-store.mjs +16 -95
- package/src/tui/statusline-ansi-bridge.mjs +1 -40
- package/src/ui/markdown.mjs +3 -2
- package/src/ui/statusline-agents.mjs +9 -14
- package/src/ui/statusline.mjs +4 -4
- package/src/runtime/channels/lib/cli-worker-host.mjs +0 -2
- package/src/runtime/memory/lib/llm-worker-host.mjs +0 -11
- package/src/standalone/opencode-go-login.mjs +0 -140
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
// before PromptInput sees a key: tool-approval y/n, copy-first Ctrl+C with
|
|
3
3
|
// region-aware selection sources, Ctrl+O expand, shift-arrow grid-selection
|
|
4
4
|
// moves, panel Escapes, and PageUp/PageDown transcript paging.
|
|
5
|
+
// The ordered dispatch below stays whole; two leaf branches live next to it in
|
|
6
|
+
// use-global-key-input/ — the Ctrl+C copy source (copy-first) and the chord
|
|
7
|
+
// decoding of the grid-selection move (shift-arrow).
|
|
5
8
|
import { useInput } from 'ink';
|
|
6
|
-
import { copyToClipboard } from './clipboard.mjs';
|
|
7
9
|
import { overlayBlocksGlobalTranscriptScroll } from './slash-commands.mjs';
|
|
10
|
+
import { copyActiveSelection } from './use-global-key-input/copy-first.mjs';
|
|
11
|
+
import { decodeSelectionMoveChord } from './use-global-key-input/shift-arrow.mjs';
|
|
8
12
|
export function useGlobalKeyInput({
|
|
9
13
|
store,
|
|
10
14
|
state: _state,
|
|
@@ -54,83 +58,22 @@ export function useGlobalKeyInput({
|
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
if (key.ctrl && (input === 'c' || input === 'C')) {
|
|
57
|
-
|
|
58
|
-
// key event to us on Windows Terminal, so a missing app-owned selection
|
|
59
|
-
// must NOT cancel the active turn; use Esc to interrupt instead.
|
|
60
|
-
// Region-aware copy source: a prompt-box selection (its OWN engine) copies
|
|
61
|
-
// from promptSelectionRef; a transcript/status ink-grid selection copies
|
|
62
|
-
// from store.getRenderSelectionText via copySelection(). Only one region is
|
|
63
|
-
// ever active at a time (a press in one region clears the others), but when
|
|
64
|
-
// the last drag was in the prompt we prefer its selection explicitly.
|
|
65
|
-
const promptSelectionText = promptSelectionRef.current?.text;
|
|
66
|
-
const lastRegion = dragRef.current.region;
|
|
67
|
-
const inkRect = dragRef.current.rect;
|
|
68
|
-
const hasInkSelection = inkRect && !(inkRect.x1 === inkRect.x2 && inkRect.y1 === inkRect.y2);
|
|
69
|
-
if (promptSelectionText && (lastRegion === 'prompt' || !hasInkSelection)) {
|
|
70
|
-
copyToClipboard(promptSelectionText)
|
|
71
|
-
.then(() =>
|
|
72
|
-
showSelectionCopyHint(
|
|
73
|
-
`copied ${promptSelectionText.length} char${promptSelectionText.length === 1 ? '' : 's'}`,
|
|
74
|
-
'plain'
|
|
75
|
-
)
|
|
76
|
-
)
|
|
77
|
-
.catch((e) => showSelectionCopyHint(`copy failed: ${e?.message || e}`, 'error'));
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
if (hasInkSelection) {
|
|
81
|
-
copySelection();
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
// No app-owned selection. On Windows Terminal the same Ctrl+C is also the
|
|
85
|
-
// native terminal's copy shortcut for a mouse selection we can't see — so
|
|
86
|
-
// rendering a hint here fights that copy and flashes a spurious message.
|
|
87
|
-
// Suppress the hint on win32 (interrupt routing is unchanged: Esc still
|
|
88
|
-
// interrupts). Other platforms keep the guidance.
|
|
89
|
-
if (process.platform !== 'win32') {
|
|
90
|
-
showSelectionCopyHint('select text to copy · Esc interrupts', 'plain');
|
|
91
|
-
}
|
|
61
|
+
copyActiveSelection({ promptSelectionRef, dragRef, copySelection, showSelectionCopyHint });
|
|
92
62
|
return;
|
|
93
63
|
}
|
|
94
64
|
if (key.ctrl && (input === 'o' || input === 'O')) {
|
|
95
65
|
toggleExpand();
|
|
96
66
|
return;
|
|
97
67
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
const rawShiftRight = input === '\x1b[1;2C' || input === '\x1b[c' || input === '[1;2C';
|
|
101
|
-
const rawShiftLeft = input === '\x1b[1;2D' || input === '\x1b[d' || input === '[1;2D';
|
|
102
|
-
const rawCtrlShiftUp = input === '\x1b[1;6A' || input === '[1;6A';
|
|
103
|
-
const rawCtrlShiftDown = input === '\x1b[1;6B' || input === '[1;6B';
|
|
104
|
-
const rawCtrlShiftRight = input === '\x1b[1;6C' || input === '[1;6C';
|
|
105
|
-
const rawCtrlShiftLeft = input === '\x1b[1;6D' || input === '[1;6D';
|
|
106
|
-
const rawModifiedShiftArrow =
|
|
107
|
-
rawShiftUp ||
|
|
108
|
-
rawShiftDown ||
|
|
109
|
-
rawShiftLeft ||
|
|
110
|
-
rawShiftRight ||
|
|
111
|
-
rawCtrlShiftUp ||
|
|
112
|
-
rawCtrlShiftDown ||
|
|
113
|
-
rawCtrlShiftLeft ||
|
|
114
|
-
rawCtrlShiftRight;
|
|
115
|
-
if (
|
|
116
|
-
!picker &&
|
|
117
|
-
((key.shift && (key.leftArrow || key.rightArrow || key.upArrow || key.downArrow || key.home || key.end)) ||
|
|
118
|
-
rawModifiedShiftArrow)
|
|
119
|
-
) {
|
|
68
|
+
const selectionMove = decodeSelectionMoveChord(input, key);
|
|
69
|
+
if (!picker && selectionMove.isChord) {
|
|
120
70
|
// Consume the chord whenever a transcript/status ink-grid selection is
|
|
121
71
|
// live — even if the focus clamps at an edge (moveSelectionFocus returns
|
|
122
72
|
// false there). PromptInput independently skips the same chord via the
|
|
123
73
|
// shared gridSelectionActiveRef predicate, so there is no double-handling.
|
|
124
74
|
// When no grid selection is live, fall through to PromptInput.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
else if (key.rightArrow || rawShiftRight || rawCtrlShiftRight) move = 'right';
|
|
128
|
-
else if (key.upArrow || rawShiftUp || rawCtrlShiftUp) move = 'up';
|
|
129
|
-
else if (key.downArrow || rawShiftDown || rawCtrlShiftDown) move = 'down';
|
|
130
|
-
else if (key.home) move = 'lineStart';
|
|
131
|
-
else if (key.end) move = 'lineEnd';
|
|
132
|
-
if (move && gridSelectionActiveRef.current()) {
|
|
133
|
-
moveSelectionFocus(move);
|
|
75
|
+
if (selectionMove.move && gridSelectionActiveRef.current()) {
|
|
76
|
+
moveSelectionFocus(selectionMove.move);
|
|
134
77
|
return;
|
|
135
78
|
}
|
|
136
79
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* use-model-catalog-cache.mjs — the provider/web-search model catalogs the
|
|
3
|
+
* pickers open from.
|
|
4
|
+
*
|
|
5
|
+
* Owns three things and nothing else: the two catalog caches, the generation
|
|
6
|
+
* counter that makes an invalidation stick, and the boot-time warm-up. The
|
|
7
|
+
* pickers read the refs; auth flows call clearModelCaches.
|
|
8
|
+
*
|
|
9
|
+
* Hook order note: the refs, the callback and the effect are declared here in
|
|
10
|
+
* the same order App.jsx declared them, so this hook drops into the same
|
|
11
|
+
* position in App.jsx's hook list.
|
|
12
|
+
*/
|
|
13
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
14
|
+
|
|
15
|
+
export function useModelCatalogCache({ store, onboardingRef }) {
|
|
16
|
+
const providerModelsCacheRef = useRef({ models: null, at: 0 });
|
|
17
|
+
const webSearchModelsCacheRef = useRef({ models: null, at: 0 });
|
|
18
|
+
const modelPickerRequestRef = useRef(0);
|
|
19
|
+
// Generation guard for the Step 1 background prefetch: bumped on every
|
|
20
|
+
// provider-scope cache clear (e.g. after auth) so a stale in-flight
|
|
21
|
+
// listProviderModels() cannot repopulate the ref after invalidation.
|
|
22
|
+
const onboardingPrefetchSeqRef = useRef(0);
|
|
23
|
+
const clearModelCaches = useCallback((scope = 'all') => {
|
|
24
|
+
if (scope === 'all' || scope === 'provider') {
|
|
25
|
+
providerModelsCacheRef.current = { models: null, at: 0 };
|
|
26
|
+
onboardingRef.current.providerModels = [];
|
|
27
|
+
onboardingPrefetchSeqRef.current += 1;
|
|
28
|
+
}
|
|
29
|
+
if (scope === 'all' || scope === 'webSearch') {
|
|
30
|
+
webSearchModelsCacheRef.current = { models: null, at: 0 };
|
|
31
|
+
}
|
|
32
|
+
}, []);
|
|
33
|
+
// Boot-time catalog prefetch: warm the /model & /agents provider catalog and
|
|
34
|
+
// the /websearch catalog once at startup so those pickers open instantly from
|
|
35
|
+
// cache (openModelPicker still TTL-refreshes stale rows in the background).
|
|
36
|
+
// Provider models load first so the web-search catalog derives from the full
|
|
37
|
+
// runtime cache instead of the sparse quick rows. Guarded by the same
|
|
38
|
+
// generation seq as the onboarding prefetch so an auth-triggered
|
|
39
|
+
// clearModelCaches() can't be clobbered by a stale in-flight result.
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
let alive = true;
|
|
42
|
+
const timer = setTimeout(async () => {
|
|
43
|
+
const seq = onboardingPrefetchSeqRef.current;
|
|
44
|
+
try {
|
|
45
|
+
const models = await Promise.resolve(store.listProviderModels?.() || []);
|
|
46
|
+
if (
|
|
47
|
+
alive &&
|
|
48
|
+
seq === onboardingPrefetchSeqRef.current &&
|
|
49
|
+
Array.isArray(models) &&
|
|
50
|
+
models.length > 0 &&
|
|
51
|
+
!Array.isArray(providerModelsCacheRef.current.models)
|
|
52
|
+
) {
|
|
53
|
+
providerModelsCacheRef.current = { models, at: Date.now() };
|
|
54
|
+
}
|
|
55
|
+
} catch {
|
|
56
|
+
/* prefetch is advisory; pickers fall back to their own load */
|
|
57
|
+
}
|
|
58
|
+
if (!alive) return;
|
|
59
|
+
try {
|
|
60
|
+
const webSearchModels = await Promise.resolve(store.listWebSearchModels?.() || []);
|
|
61
|
+
if (
|
|
62
|
+
alive &&
|
|
63
|
+
Array.isArray(webSearchModels) &&
|
|
64
|
+
webSearchModels.length > 0 &&
|
|
65
|
+
!Array.isArray(webSearchModelsCacheRef.current.models)
|
|
66
|
+
) {
|
|
67
|
+
webSearchModelsCacheRef.current = { models: webSearchModels, at: Date.now() };
|
|
68
|
+
}
|
|
69
|
+
} catch {
|
|
70
|
+
/* prefetch is advisory; /websearch falls back to its own load */
|
|
71
|
+
}
|
|
72
|
+
}, 1500);
|
|
73
|
+
timer.unref?.();
|
|
74
|
+
return () => {
|
|
75
|
+
alive = false;
|
|
76
|
+
clearTimeout(timer);
|
|
77
|
+
};
|
|
78
|
+
}, [store]);
|
|
79
|
+
return {
|
|
80
|
+
providerModelsCacheRef,
|
|
81
|
+
webSearchModelsCacheRef,
|
|
82
|
+
modelPickerRequestRef,
|
|
83
|
+
onboardingPrefetchSeqRef,
|
|
84
|
+
clearModelCaches,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -7,14 +7,11 @@
|
|
|
7
7
|
* refs/callbacks; gesture timers and wheel acceleration stay local to the hook.
|
|
8
8
|
*/
|
|
9
9
|
import { useCallback, useEffect, useRef } from 'react';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
WHEEL_STEP_MAX_ROWS,
|
|
16
|
-
WHEEL_STEP_ROWS,
|
|
17
|
-
} from './transcript-window.mjs';
|
|
10
|
+
import { createEdgeAutoscroll } from './mouse-input/edge-autoscroll.mjs';
|
|
11
|
+
import { createMouseGeometry, linearSelection } from './mouse-input/geometry.mjs';
|
|
12
|
+
import { MOUSE_CTRL_MASK, MOUSE_SHIFT_MASK } from './mouse-input/sgr-buttons.mjs';
|
|
13
|
+
import { createWheelRouter } from './mouse-input/wheel-router.mjs';
|
|
14
|
+
import { TRANSCRIPT_MEASURED_ROWS, WHEEL_STEP_ROWS, selectionRectIsDegenerate } from './transcript-window.mjs';
|
|
18
15
|
|
|
19
16
|
const MOUSE_TRACKING_ON = '\x1b[?1000h\x1b[?1002h\x1b[?1006h';
|
|
20
17
|
const MOUSE_TRACKING_OFF = '\x1b[?1006l\x1b[?1002l\x1b[?1000l';
|
|
@@ -28,15 +25,9 @@ const MOUSE_TRACKING_OFF = '\x1b[?1006l\x1b[?1002l\x1b[?1000l';
|
|
|
28
25
|
// is on, every wheel notch turns into prompt-history Up/Down. Off means a
|
|
29
26
|
// degraded wheel is a no-op, never history navigation.
|
|
30
27
|
const ALT_SCROLL_OFF = '\x1b[?1007l';
|
|
31
|
-
const MOUSE_CTRL_MASK = 16;
|
|
32
28
|
// Wheel step / acceleration knobs live in transcript-window.mjs next to the
|
|
33
|
-
// other MIXDOG_TUI_* scroll tunables (see the block around WHEEL_STEP_ROWS)
|
|
34
|
-
//
|
|
35
|
-
// masking above intentionally strips it for scroll routing; button-press
|
|
36
|
-
// handling below reads it separately (before baseButton = button & 3 drops
|
|
37
|
-
// every modifier bit) so a shift-held left-click can extend an existing
|
|
38
|
-
// selection instead of starting a fresh one.
|
|
39
|
-
const MOUSE_SHIFT_MASK = 4;
|
|
29
|
+
// other MIXDOG_TUI_* scroll tunables (see the block around WHEEL_STEP_ROWS);
|
|
30
|
+
// the SGR button-byte masks live in mouse-input/sgr-buttons.mjs.
|
|
40
31
|
// Windows Terminal (1.25+) forwards shift+click/drag to the app during VT
|
|
41
32
|
// mouse mode while ALSO painting its own native selection — honoring the
|
|
42
33
|
// events would draw two overlapping highlights (app blue + WT white). In WT,
|
|
@@ -222,99 +213,29 @@ export function useMouseInput({
|
|
|
222
213
|
// selection, not terminal block selection.
|
|
223
214
|
useEffect(() => {
|
|
224
215
|
if (!inkInput || !isRawModeSupported) return undefined;
|
|
225
|
-
// Wheel modifier: wheel now arrives as a ParsedKey {name:'wheelup'|
|
|
226
|
-
// 'wheeldown', sequence}. It has NO button field, so read the ctrl bit
|
|
227
|
-
// (16) from the SGR button in the raw sequence `\x1b[<b;col;row…`. This is
|
|
228
|
-
// the one place the raw sequence is still parsed; ParsedMouse (click/drag)
|
|
229
|
-
// carries button/col/row/action pre-parsed and needs no regex.
|
|
230
|
-
const WHEEL_SGR = /\x1b\[<(\d+);/;
|
|
231
|
-
const linearSelection = (a, b) => {
|
|
232
|
-
return {
|
|
233
|
-
mode: 'linear',
|
|
234
|
-
x1: a.x,
|
|
235
|
-
y1: a.y,
|
|
236
|
-
x2: b.x,
|
|
237
|
-
y2: b.y,
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
216
|
// Word/line multi-click drag-extension uses the hoisted buildSpanRect (same
|
|
241
217
|
// logic reachable from the auto-scroll path in scrollTranscriptRows).
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const { top, bottom } = statusBand();
|
|
264
|
-
return row >= top && row <= bottom;
|
|
265
|
-
};
|
|
266
|
-
const clampToStatusBand = (row) => {
|
|
267
|
-
const { top, bottom } = statusBand();
|
|
268
|
-
return Math.max(top, Math.min(bottom, row));
|
|
269
|
-
};
|
|
270
|
-
const maxSelectionColumn = () => {
|
|
271
|
-
const cols = Math.max(1, Number(frameColumns) || Number(stdout?.columns) || 80);
|
|
272
|
-
return cols - 1;
|
|
273
|
-
};
|
|
274
|
-
// Snap a drag point into the region that owns the selection. Rows clamp to
|
|
275
|
-
// the band as before, but the COLUMN now follows normal text-selection
|
|
276
|
-
// semantics: a pointer ABOVE the band selects to the start of its first
|
|
277
|
-
// row, BELOW it to the end of its last row — instead of freezing at
|
|
278
|
-
// whatever column the pointer happened to hold, which painted a partial row
|
|
279
|
-
// on the wrong side of the anchor. Horizontal overshoot is clamped into the
|
|
280
|
-
// grid too: while the pointer sits outside the window a terminal can report
|
|
281
|
-
// column 0 (x = -1 after the 1-based fixup) or a column past the width, and
|
|
282
|
-
// that point orders BEFORE/AFTER the anchor and visibly flips the selection.
|
|
283
|
-
const selectionPointInRegion = (x, y, region) => {
|
|
284
|
-
const { top, bottom } = region === 'status' ? statusBand() : transcriptViewport();
|
|
285
|
-
const maxX = maxSelectionColumn();
|
|
286
|
-
if (y < top) return { x: 0, y: top };
|
|
287
|
-
if (y > bottom) return { x: maxX, y: bottom };
|
|
288
|
-
return { x: Math.max(0, Math.min(maxX, x)), y };
|
|
289
|
-
};
|
|
290
|
-
const promptRect = () => promptBoxRectRef.current;
|
|
291
|
-
const isInPromptBox = (x, y) => {
|
|
292
|
-
const r = promptRect();
|
|
293
|
-
if (!r) return false;
|
|
294
|
-
const top = Math.max(0, Number(r.top) || 0);
|
|
295
|
-
const bottom = top + Math.max(1, Number(r.height) || 1) - 1;
|
|
296
|
-
const left = Math.max(0, Number(r.left) || 0);
|
|
297
|
-
const width = Math.max(1, Number(r.contentWidth) || 1);
|
|
298
|
-
return y >= top && y <= bottom && x >= left && x < left + width;
|
|
299
|
-
};
|
|
300
|
-
// Map an absolute grid cell to a prompt-draft edit offset via PromptInput's
|
|
301
|
-
// measured box rect + its caret math (offsetAtCell handles wrapping).
|
|
302
|
-
const promptOffsetAt = (x, y) => {
|
|
303
|
-
const r = promptRect();
|
|
304
|
-
const ctl = promptMouseSelectionRef.current;
|
|
305
|
-
if (!r || !ctl) return null;
|
|
306
|
-
const top = Math.max(0, Number(r.top) || 0);
|
|
307
|
-
const left = Math.max(0, Number(r.left) || 0);
|
|
308
|
-
const height = Math.max(1, Number(r.height) || 1);
|
|
309
|
-
const width = Math.max(1, Number(r.contentWidth) || 1);
|
|
310
|
-
// Clamp the mapped row/col to the box's own bounds so a drag that runs
|
|
311
|
-
// outside the prompt (above/below/left/right, e.g. onto the transcript
|
|
312
|
-
// or off-screen) still tracks the nearest edge cell instead of jumping
|
|
313
|
-
// to whatever offset a raw negative/overflowing row would resolve to.
|
|
314
|
-
const row = Math.max(0, Math.min(height - 1, y - top));
|
|
315
|
-
const col = Math.max(0, Math.min(width, x - left));
|
|
316
|
-
return ctl.offsetAtCell(row, col);
|
|
317
|
-
};
|
|
218
|
+
// Region geometry (viewport / status band / prompt box mapping and
|
|
219
|
+
// drag-point snapping) lives in mouse-input/geometry.mjs; every helper
|
|
220
|
+
// resolves the CURRENT rects from the refs at call time.
|
|
221
|
+
const {
|
|
222
|
+
transcriptViewport,
|
|
223
|
+
isInTranscriptViewport,
|
|
224
|
+
clampToTranscriptViewport,
|
|
225
|
+
isInStatusBand,
|
|
226
|
+
clampToStatusBand,
|
|
227
|
+
selectionPointInRegion,
|
|
228
|
+
isInPromptBox,
|
|
229
|
+
promptOffsetAt,
|
|
230
|
+
} = createMouseGeometry({
|
|
231
|
+
transcriptViewportRef,
|
|
232
|
+
frameRowsRef,
|
|
233
|
+
statuslineBandRows,
|
|
234
|
+
frameColumns,
|
|
235
|
+
stdout,
|
|
236
|
+
promptBoxRectRef,
|
|
237
|
+
promptMouseSelectionRef,
|
|
238
|
+
});
|
|
318
239
|
// Clear whichever selection is active (ink-grid rect AND/OR prompt engine).
|
|
319
240
|
const clearAllSelections = () => {
|
|
320
241
|
promptMouseSelectionRef.current?.clear?.();
|
|
@@ -325,54 +246,20 @@ export function useMouseInput({
|
|
|
325
246
|
const finishWindowsMouseGesture = () => {
|
|
326
247
|
if (IS_WINDOWS_TERMINAL) store.forceRenderRepaint?.();
|
|
327
248
|
};
|
|
328
|
-
// Edge auto-scroll TIMER (ref:
|
|
329
|
-
// SGR mode 1002 reports
|
|
330
|
-
//
|
|
331
|
-
//
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
//
|
|
335
|
-
|
|
336
|
-
const stopEdgeAutoscroll = (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
st.dir = 0;
|
|
343
|
-
st.noMove = 0;
|
|
344
|
-
};
|
|
345
|
-
const startEdgeAutoscroll = (dir) => {
|
|
346
|
-
const st = edgeAutoscrollRef.current;
|
|
347
|
-
if (st.dir === dir && st.timer) return; // already scrolling this way
|
|
348
|
-
stopEdgeAutoscroll();
|
|
349
|
-
st.dir = dir;
|
|
350
|
-
st.noMove = 0;
|
|
351
|
-
st.timer = setInterval(() => {
|
|
352
|
-
const drag = dragRef.current;
|
|
353
|
-
const st2 = edgeAutoscrollRef.current;
|
|
354
|
-
if (!drag.active || drag.region !== 'transcript' || st2.dir === 0) {
|
|
355
|
-
stopEdgeAutoscroll();
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
const before = Number(scrollTargetRef.current) || 0;
|
|
359
|
-
queueScrollCoalesced(st2.dir * 3);
|
|
360
|
-
// A SINGLE unchanged tick is ambiguous: the coalescer may not have
|
|
361
|
-
// flushed this delta yet (queued behind its 16ms leading-edge timer),
|
|
362
|
-
// so scrollTarget legitimately reads the same value mid-flight. Only a
|
|
363
|
-
// real top/bottom clamp keeps it pinned across several ticks. Require
|
|
364
|
-
// CONSECUTIVE no-move ticks (>=3 ⇒ >150ms ≫ the 16ms coalescer window,
|
|
365
|
-
// so any pending scroll has certainly flushed) before stopping — any
|
|
366
|
-
// movement resets the counter (ref useDragToScroll's getScrollTop<=0 /
|
|
367
|
-
// >=max boundary stop).
|
|
368
|
-
if ((Number(scrollTargetRef.current) || 0) !== before) {
|
|
369
|
-
st2.noMove = 0;
|
|
370
|
-
} else if (++st2.noMove >= 3) {
|
|
371
|
-
stopEdgeAutoscroll();
|
|
372
|
-
}
|
|
373
|
-
}, EDGE_AUTOSCROLL_INTERVAL_MS);
|
|
374
|
-
st.timer.unref?.();
|
|
375
|
-
};
|
|
249
|
+
// Edge auto-scroll TIMER (mouse-input/edge-autoscroll.mjs, ref:
|
|
250
|
+
// ScrollKeybindingHandler useDragToScroll). SGR mode 1002 reports
|
|
251
|
+
// drag-motion only when the pointer changes CELL, so a pointer held
|
|
252
|
+
// stationary at the top/bottom edge stops emitting events and the
|
|
253
|
+
// motion-driven scroll below stalls. The interval keeps scrolling —
|
|
254
|
+
// scrollTranscriptRows' active-drag branch re-extends the selection to the
|
|
255
|
+
// still-held `last` cell each step — until the pointer leaves the edge, the
|
|
256
|
+
// drag ends, or a scroll boundary is reached (delta clamps to 0).
|
|
257
|
+
const { start: startEdgeAutoscroll, stop: stopEdgeAutoscroll } = createEdgeAutoscroll({
|
|
258
|
+
stateRef: edgeAutoscrollRef,
|
|
259
|
+
dragRef,
|
|
260
|
+
scrollTargetRef,
|
|
261
|
+
queueScrollCoalesced,
|
|
262
|
+
});
|
|
376
263
|
// Finalize an in-flight drag exactly like the button-release path: push the
|
|
377
264
|
// final rect from the given point, and reconcile measured row heights. Used
|
|
378
265
|
// by the real release below AND by the ctrl+wheel zoom passthrough, whose
|
|
@@ -409,6 +296,21 @@ export function useMouseInput({
|
|
|
409
296
|
}
|
|
410
297
|
if (TRANSCRIPT_MEASURED_ROWS) setMeasuredRowsVersion((v) => (v + 1) % 1000000);
|
|
411
298
|
};
|
|
299
|
+
// Wheel routing (ctrl+wheel zoom passthrough, slash-palette navigation,
|
|
300
|
+
// overlay gating, wheel acceleration) lives in mouse-input/wheel-router.mjs.
|
|
301
|
+
// Built here so it shares this effect's drag/finalize closures.
|
|
302
|
+
const routeWheelEvent = createWheelRouter({
|
|
303
|
+
dragRef,
|
|
304
|
+
slashPaletteRef,
|
|
305
|
+
scrollFocusRef,
|
|
306
|
+
wheelAccelRef,
|
|
307
|
+
setSlashIndex,
|
|
308
|
+
queueScrollCoalesced,
|
|
309
|
+
passthroughCtrlWheelZoom,
|
|
310
|
+
finalizeActiveDrag,
|
|
311
|
+
finishWindowsMouseGesture,
|
|
312
|
+
stopEdgeAutoscroll,
|
|
313
|
+
});
|
|
412
314
|
// Typed 'mouse' channel handler. Receives one event per emit:
|
|
413
315
|
// • ParsedMouse {kind:'mouse',button,action,col,row,sequence} — click/drag
|
|
414
316
|
// • ParsedKey {kind:'key',name:'wheelup'|'wheeldown',sequence} — wheel
|
|
@@ -417,64 +319,9 @@ export function useMouseInput({
|
|
|
417
319
|
// handler is registered it is the SOLE consumer of these events.)
|
|
418
320
|
const onMouse = (event) => {
|
|
419
321
|
if (!event || typeof event !== 'object') return;
|
|
420
|
-
let up = 0;
|
|
421
|
-
let down = 0;
|
|
422
322
|
// Wheel arrives as a ParsedKey; no button/col/row fields.
|
|
423
323
|
if (event.kind === 'key') {
|
|
424
|
-
|
|
425
|
-
if (name !== 'wheelup' && name !== 'wheeldown') return;
|
|
426
|
-
const seq = typeof event.sequence === 'string' ? event.sequence : '';
|
|
427
|
-
const wm = WHEEL_SGR.exec(seq);
|
|
428
|
-
const ctrl = wm ? (Number(wm[1]) & MOUSE_CTRL_MASK) !== 0 : false;
|
|
429
|
-
if (ctrl) {
|
|
430
|
-
// Zoom passthrough disables mouse tracking for ~700ms, during which
|
|
431
|
-
// the button-release event may never arrive — leaving the drag stuck
|
|
432
|
-
// active and the edge-autoscroll interval firing forever. Finalize
|
|
433
|
-
// the in-flight drag from its last known point (same path as a real
|
|
434
|
-
// release: final applySelectionRect + measured-rows reconcile) so
|
|
435
|
-
// Ctrl+C still copies the full text, then hand the wheel to the
|
|
436
|
-
// terminal's font zoom. stopEdgeAutoscroll is folded into finalize.
|
|
437
|
-
if (dragRef.current.active) {
|
|
438
|
-
const last = dragRef.current.last || {};
|
|
439
|
-
finalizeActiveDrag(Number(last.x) || 0, Number(last.y) || 0);
|
|
440
|
-
finishWindowsMouseGesture();
|
|
441
|
-
} else {
|
|
442
|
-
stopEdgeAutoscroll();
|
|
443
|
-
}
|
|
444
|
-
passthroughCtrlWheelZoom();
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
if (name === 'wheelup') up += 1;
|
|
448
|
-
else down += 1;
|
|
449
|
-
// Fall through to the wheel-scroll dispatch below (shared with the
|
|
450
|
-
// previous SGR path) so slash-palette/overlay/scroll routing is identical.
|
|
451
|
-
if (up !== 0 || down !== 0) {
|
|
452
|
-
const palette = slashPaletteRef.current;
|
|
453
|
-
if (!dragRef.current.active && palette.open && palette.count > 0) {
|
|
454
|
-
const step = down - up;
|
|
455
|
-
if (step !== 0) {
|
|
456
|
-
setSlashIndex((index) => Math.max(0, Math.min(palette.count - 1, index + step)));
|
|
457
|
-
}
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
if (overlayBlocksGlobalTranscriptScroll(scrollFocusRef.current)) return;
|
|
461
|
-
// Wheel while a selection is live (mid-drag OR after release) scrolls
|
|
462
|
-
// the transcript instead of being dropped: scrollTranscriptRows'
|
|
463
|
-
// active-drag branch rebuilds the rect (anchor→last), the released
|
|
464
|
-
// branch shifts it — both keep the highlight and stitch-harvest the
|
|
465
|
-
// rows that scroll off (ref ScrollKeybindingHandler wheel path).
|
|
466
|
-
const wheelDir = up - down;
|
|
467
|
-
const nowWheel = Date.now();
|
|
468
|
-
const accel = wheelAccelRef.current;
|
|
469
|
-
if (!WHEEL_ACCEL_ENABLED || accel.dir !== wheelDir || nowWheel - accel.t > WHEEL_ACCEL_IDLE_MS) {
|
|
470
|
-
accel.step = WHEEL_STEP_ROWS;
|
|
471
|
-
} else {
|
|
472
|
-
accel.step = Math.min(WHEEL_STEP_MAX_ROWS, accel.step + WHEEL_STEP_ROWS);
|
|
473
|
-
}
|
|
474
|
-
accel.dir = wheelDir;
|
|
475
|
-
accel.t = nowWheel;
|
|
476
|
-
queueScrollCoalesced(wheelDir * accel.step);
|
|
477
|
-
}
|
|
324
|
+
routeWheelEvent(event);
|
|
478
325
|
return;
|
|
479
326
|
}
|
|
480
327
|
if (event.kind !== 'mouse') return;
|
|
@@ -552,9 +399,7 @@ export function useMouseInput({
|
|
|
552
399
|
!dragRef.current.anchorSpan &&
|
|
553
400
|
dragRef.current.anchor &&
|
|
554
401
|
dragRef.current.rect &&
|
|
555
|
-
!(
|
|
556
|
-
dragRef.current.rect.x1 === dragRef.current.rect.x2 && dragRef.current.rect.y1 === dragRef.current.rect.y2
|
|
557
|
-
)
|
|
402
|
+
!selectionRectIsDegenerate(dragRef.current.rect)
|
|
558
403
|
) {
|
|
559
404
|
promptMouseSelectionRef.current?.clear?.();
|
|
560
405
|
const selectionY = regionR === 'status' ? clampToStatusBand(y) : clampToTranscriptViewport(y);
|
|
@@ -678,9 +523,7 @@ export function useMouseInput({
|
|
|
678
523
|
!dragRef.current.anchorSpan &&
|
|
679
524
|
dragRef.current.anchor &&
|
|
680
525
|
dragRef.current.rect &&
|
|
681
|
-
!(
|
|
682
|
-
dragRef.current.rect.x1 === dragRef.current.rect.x2 && dragRef.current.rect.y1 === dragRef.current.rect.y2
|
|
683
|
-
)
|
|
526
|
+
!selectionRectIsDegenerate(dragRef.current.rect)
|
|
684
527
|
) {
|
|
685
528
|
const selectionY = region === 'status' ? clampToStatusBand(y) : clampToTranscriptViewport(y);
|
|
686
529
|
const anchor =
|
|
@@ -854,9 +697,12 @@ export function useMouseInput({
|
|
|
854
697
|
inkInput,
|
|
855
698
|
isRawModeSupported,
|
|
856
699
|
store,
|
|
700
|
+
stdout,
|
|
857
701
|
passthroughCtrlWheelZoom,
|
|
858
702
|
frameColumns,
|
|
859
|
-
|
|
703
|
+
statuslineBandRows,
|
|
704
|
+
stopSmoothScroll,
|
|
705
|
+
clearStitchBuffer,
|
|
860
706
|
queueScrollCoalesced,
|
|
861
707
|
applySelectionRect,
|
|
862
708
|
applySelectionRectThrottled,
|