mixdog 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/package.json +1 -1
- package/scripts/gate-local.mjs +19 -3
- package/scripts/model-catalog-audit.mjs +1 -15
- package/src/agents/reviewer/AGENT.md +3 -3
- package/src/agents/reviewer/agent.json +1 -1
- package/src/defaults/shipped-history.json +5 -0
- package/src/defaults/skills/pptx/SKILL.md +6 -6
- package/src/defaults/skills/pptx/references/review.md +6 -4
- package/src/defaults/skills/pptx/scripts/source-extract.mjs +1 -1
- package/src/defaults/skills/setup/references/actions.md +13 -3
- package/src/defaults/skills/visualize/SKILL.md +12 -9
- package/src/repl/slash-commands.mjs +16 -1
- package/src/rules/shared/60-verification.md +3 -1
- package/src/rules/shared/70-delivery.md +4 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +29 -4
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +10 -0
- package/src/runtime/agent/orchestrator/cache-mtime.mjs +26 -5
- package/src/runtime/agent/orchestrator/config.mjs +10 -4
- package/src/runtime/agent/orchestrator/context/collect.mjs +2 -1
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +11 -5
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +74 -21
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +122 -15
- package/src/runtime/agent/orchestrator/mcp/client-handshake.mjs +54 -11
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +104 -9
- package/src/runtime/agent/orchestrator/mcp/client.mjs +358 -140
- package/src/runtime/agent/orchestrator/mcp/lazy-output-validator.mjs +25 -0
- package/src/runtime/agent/orchestrator/mcp/oauth-callback.mjs +103 -0
- package/src/runtime/agent/orchestrator/mcp/oauth-credentials.mjs +150 -0
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +111 -0
- package/src/runtime/agent/orchestrator/mcp/oauth-probe.mjs +87 -0
- package/src/runtime/agent/orchestrator/mcp/oauth-provider.mjs +95 -0
- package/src/runtime/agent/orchestrator/mcp/oauth-request.mjs +122 -0
- package/src/runtime/agent/orchestrator/mcp/oauth-shared.mjs +9 -0
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +229 -0
- package/src/runtime/agent/orchestrator/mcp/plugin-placeholders.mjs +54 -0
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +294 -44
- package/src/runtime/agent/orchestrator/providers/anthropic-api-recovery.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-api-transport.mjs +94 -31
- package/src/runtime/agent/orchestrator/providers/anthropic-error-contract.mjs +96 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-fast-mode.mjs +39 -18
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens-recovery.mjs +55 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +25 -21
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-midstream-recovery.mjs +18 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +13 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-midstream.mjs +10 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-recovery.mjs +23 -9
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/initial-status.mjs +46 -20
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request.mjs +14 -9
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +73 -35
- package/src/runtime/agent/orchestrator/providers/anthropic-overload-fallback.mjs +69 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-server-fallback.mjs +4 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +8 -1
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +53 -18
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-catalog.mjs +30 -9
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +7 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-request.mjs +30 -14
- package/src/runtime/agent/orchestrator/providers/antigravity-response.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-retry-policy.mjs +93 -0
- package/src/runtime/agent/orchestrator/providers/antigravity-transport.mjs +82 -9
- package/src/runtime/agent/orchestrator/providers/auto-effort.mjs +9 -0
- package/src/runtime/agent/orchestrator/providers/command-code-oauth-login.mjs +337 -0
- package/src/runtime/agent/orchestrator/providers/command-code-oauth-tokens.mjs +159 -0
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +447 -0
- package/src/runtime/agent/orchestrator/providers/cursor-auth.mjs +38 -5
- package/src/runtime/agent/orchestrator/providers/cursor-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor-wire-guards.mjs +97 -2
- package/src/runtime/agent/orchestrator/providers/cursor-wire-stream-bridge.mjs +102 -23
- package/src/runtime/agent/orchestrator/providers/cursor-wire-transport.mjs +103 -33
- package/src/runtime/agent/orchestrator/providers/cursor-wire.mjs +29 -6
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +18 -1
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +7 -4
- package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +86 -19
- package/src/runtime/agent/orchestrator/providers/gemini-cache-policy.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +29 -8
- package/src/runtime/agent/orchestrator/providers/gemini-error-contract.mjs +191 -0
- package/src/runtime/agent/orchestrator/providers/gemini-family.mjs +9 -0
- package/src/runtime/agent/orchestrator/providers/gemini-history-signatures.mjs +9 -4
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/gemini-retry-policy.mjs +180 -0
- package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +21 -82
- package/src/runtime/agent/orchestrator/providers/gemini-sdk-request.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +71 -12
- package/src/runtime/agent/orchestrator/providers/gemini-thinking.mjs +21 -20
- package/src/runtime/agent/orchestrator/providers/gemini.mjs +97 -51
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +68 -19
- package/src/runtime/agent/orchestrator/providers/lib/gemini-model-catalog.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/model-list-sanitize.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/model-proxy-bridge.mjs +1080 -0
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.d.mts +15 -0
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.mjs +35 -0
- package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +4 -9
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +12 -0
- package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +6 -5
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +5 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-result.mjs +22 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-error-contract.mjs +50 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-models.mjs +6 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-options.mjs +11 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-response-normalization.mjs +23 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-events.mjs +16 -8
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-state.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +94 -13
- package/src/runtime/agent/orchestrator/providers/openai-compat-retry-profile.mjs +193 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream-common.mjs +66 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +6 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +6 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +23 -14
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +26 -6
- package/src/runtime/agent/orchestrator/providers/openai-direct-request.mjs +42 -25
- package/src/runtime/agent/orchestrator/providers/openai-error-contract.mjs +274 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-request.mjs +72 -32
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/terminal-frames.mjs +18 -11
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-outcome.mjs +1 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-stamps.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-state.mjs +2 -3
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-watchdogs.mjs +1 -3
- package/src/runtime/agent/orchestrator/providers/openai-oauth-dispatch.mjs +34 -3
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +5 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +22 -2
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +5 -0
- package/src/runtime/agent/orchestrator/providers/openai-responses-input.mjs +5 -9
- package/src/runtime/agent/orchestrator/providers/openai-retry-policy.mjs +9 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-handshake.mjs +16 -8
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/attempt-context.mjs +1 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws-send-attempts/policy.mjs +25 -14
- package/src/runtime/agent/orchestrator/providers/openai-ws-terminal.mjs +18 -11
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +35 -24
- package/src/runtime/agent/orchestrator/providers/provider-error-kind.mjs +581 -0
- package/src/runtime/agent/orchestrator/providers/registry.mjs +35 -9
- package/src/runtime/agent/orchestrator/providers/retry-backoff.mjs +46 -7
- package/src/runtime/agent/orchestrator/providers/retry-classification.mjs +118 -219
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/retry-executor.mjs +148 -45
- package/src/runtime/agent/orchestrator/providers/retry-midstream.mjs +81 -16
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/effort.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/extension-scopes.mjs +15 -55
- package/src/runtime/agent/orchestrator/runtime-core/goal-control.mjs +15 -2
- package/src/runtime/agent/orchestrator/runtime-core/goal-reminder.mjs +0 -18
- package/src/runtime/agent/orchestrator/runtime-core/model-capabilities.mjs +57 -28
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +19 -16
- package/src/runtime/agent/orchestrator/runtime-core/plugin-mcp.mjs +268 -181
- package/src/runtime/agent/orchestrator/runtime-core/skill-tool-loading.mjs +4 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-schema.mjs +21 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +54 -3
- package/src/runtime/agent/orchestrator/session/catalog-db/index.mjs +284 -0
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +270 -0
- package/src/runtime/agent/orchestrator/session/catalog-db/sqlite-gate.mjs +27 -0
- package/src/runtime/agent/orchestrator/session/catalog-db/worker.mjs +628 -0
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +6 -2
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +184 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +136 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +128 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +127 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +101 -0
- package/src/runtime/agent/orchestrator/session/explicit-skills.mjs +83 -5
- package/src/runtime/agent/orchestrator/session/imported-message.mjs +11 -0
- package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +10 -4
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/loop/step-auto-effort.mjs +102 -18
- package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-phase.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-queue.mjs +42 -5
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +14 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +20 -12
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +50 -23
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +22 -14
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +18 -7
- package/src/runtime/agent/orchestrator/session/manager.mjs +0 -1
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +155 -29
- package/src/runtime/agent/orchestrator/session/store/listing.mjs +6 -2
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +6 -3
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/store/write-guards.mjs +16 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +22 -10
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +819 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +12 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +22 -12
- package/src/runtime/agent/orchestrator/session/store-summary-reader-catalog-fixture.mjs +158 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +183 -374
- package/src/runtime/agent/orchestrator/session/synthetic-user-envelope.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +41 -3
- package/src/runtime/agent/orchestrator/session/transcript-restore/user-text.mjs +38 -17
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/deadline-plan.mjs +12 -15
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/invocation-plan.mjs +17 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +4 -0
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/list-helpers.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/path-diagnostics.mjs +6 -6
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +173 -22
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-guards.mjs +8 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +5 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-source-windows.mjs +15 -2
- package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +13 -10
- package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +17 -12
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/root-resolution.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/codex-batch.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch/apply-patch/route.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/read-redirects.mjs +34 -30
- package/src/runtime/agent/orchestrator/tools/patch/sequence/units.mjs +7 -7
- package/src/runtime/agent/orchestrator/tools/patch/sequence.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +4 -0
- package/src/runtime/attachments/store.d.mts +3 -0
- package/src/runtime/channels/lib/owned-runtime/owned-start.mjs +1 -1
- package/src/runtime/channels/lib/webhook/session-dispatch.mjs +16 -4
- package/src/runtime/channels/lib/worker-main.mjs +17 -14
- package/src/runtime/computer-bridge/linux-readiness.mjs +0 -2
- package/src/runtime/effort-judge/judge-client.mjs +56 -18
- package/src/runtime/memory/lib/memory.mjs +1 -1
- package/src/runtime/memory/lib/pg/process.mjs +34 -24
- package/src/runtime/memory/lib/pg/supervisor.mjs +16 -13
- package/src/runtime/memory/lib/session-ingest.mjs +2 -2
- package/src/runtime/office/README.md +1 -1
- package/src/runtime/office/shared/values.mjs +0 -5
- package/src/runtime/shared/atomic-file.mjs +25 -4
- package/src/runtime/shared/background-tasks.mjs +92 -14
- package/src/runtime/shared/err-text.mjs +25 -0
- package/src/runtime/shared/error-presentation.mjs +159 -19
- package/src/runtime/shared/extension-scopes.mjs +5 -3
- package/src/runtime/shared/file-lock.mjs +37 -11
- package/src/runtime/shared/llm/anthropic-betas.mjs +4 -3
- package/src/runtime/shared/llm/anthropic-effort.mjs +134 -131
- package/src/runtime/shared/llm/anthropic-thinking-contract.mjs +50 -14
- package/src/runtime/shared/llm/model-catalog.mjs +53 -52
- package/src/runtime/shared/llm/openai-daybreak.mjs +4 -16
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +17 -0
- package/src/runtime/shared/llm/provider-model-identities.mjs +13 -4
- package/src/runtime/shared/llm/usage-rollup.mjs +0 -1
- package/src/runtime/shared/model-display.mjs +13 -0
- package/src/runtime/shared/plugin-manifest.mjs +18 -9
- package/src/runtime/shared/pristine-execution-contract.json +9 -2
- package/src/runtime/shared/pristine-execution.mjs +28 -4
- package/src/runtime/shared/provider-accounts.mjs +124 -20
- package/src/runtime/shared/provider-api-key.mjs +12 -0
- package/src/runtime/shared/quota-resume-store.mjs +11 -0
- package/src/runtime/shared/session-baseline-store.mjs +960 -0
- package/src/runtime/shared/shell-display.mjs +9 -3
- package/src/runtime/shared/skill-mentions.d.mts +10 -0
- package/src/runtime/shared/skill-mentions.mjs +133 -0
- package/src/runtime/shared/skill-script-runtime.mjs +264 -0
- package/src/runtime/shared/statusline/statusline-format.mjs +4 -4
- package/src/runtime/shared/task-notification-envelope.mjs +2 -2
- package/src/runtime/shared/tool-primitives.mjs +35 -2
- package/src/runtime/shared/turn-changes.mjs +447 -219
- package/src/runtime/shared/turn-snapshot-store.mjs +182 -1
- package/src/runtime/shared/turn-snapshot.mjs +170 -48
- package/src/runtime/shared/turn-worktree-snapshot.mjs +160 -51
- package/src/runtime/shared/worker-requests.mjs +15 -2
- package/src/runtime/shared/worktrees/contract.mjs +0 -24
- package/src/runtime/shared/worktrees/test-support.mjs +19 -4
- package/src/session-runtime/automation-agents.mjs +8 -2
- package/src/session-runtime/boot/apis.mjs +61 -0
- package/src/session-runtime/boot/config.mjs +5 -2
- package/src/session-runtime/boot/facade.mjs +1 -0
- package/src/session-runtime/boot/infrastructure.mjs +35 -18
- package/src/session-runtime/conversation-import/discovery.mjs +698 -0
- package/src/session-runtime/conversation-import/service.mjs +369 -0
- package/src/session-runtime/cwd-plugins/cwd-apply.mjs +10 -5
- package/src/session-runtime/cwd-plugins/plugin-status.mjs +47 -42
- package/src/session-runtime/lifecycle/session-catalog.mjs +2 -0
- package/src/session-runtime/lifecycle/teardown.mjs +1 -1
- package/src/session-runtime/mcp-glue/connect.mjs +83 -16
- package/src/session-runtime/mcp-glue/plugin-servers.mjs +499 -0
- package/src/session-runtime/mcp-glue/server-catalog.mjs +135 -33
- package/src/session-runtime/mcp-glue.mjs +25 -2
- package/src/session-runtime/mcp-oauth-login.mjs +174 -0
- package/src/session-runtime/model-route/model-switch-target.mjs +34 -0
- package/src/session-runtime/model-route/set-route.mjs +83 -15
- package/src/session-runtime/model-route/web-search-route.mjs +1 -1
- package/src/session-runtime/native-web-search/routes.mjs +22 -3
- package/src/session-runtime/new-session-config.mjs +3 -2
- package/src/session-runtime/notification-bus.mjs +9 -2
- package/src/session-runtime/provider-auth/accounts.mjs +33 -15
- package/src/session-runtime/provider-models/model-meta.mjs +12 -3
- package/src/session-runtime/provider-models/web-search-catalog.mjs +5 -1
- package/src/session-runtime/provider-readiness.mjs +16 -10
- package/src/session-runtime/quick-model-rows/web-search-rows.mjs +13 -8
- package/src/session-runtime/quick-web-search-models.mjs +13 -38
- package/src/session-runtime/resource-extension-sync.mjs +24 -5
- package/src/session-runtime/resource-mcp-api.mjs +198 -78
- package/src/session-runtime/resource-plugins-api.mjs +29 -41
- package/src/session-runtime/resource-scope-decorate.mjs +6 -8
- package/src/session-runtime/resource-skills-api.mjs +23 -2
- package/src/session-runtime/runtime-review-api.mjs +13 -0
- package/src/session-runtime/schedule-session-run.mjs +1 -1
- package/src/session-runtime/services/agent-tool/job-task-reconcile.mjs +13 -1
- package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +7 -2
- package/src/session-runtime/services/agent-tool/send-flow.mjs +22 -4
- package/src/session-runtime/services/agent-tool/spawn-flow/job-start.mjs +2 -0
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +22 -5
- package/src/session-runtime/services/agent-tool/worker-index/row-liveness.mjs +8 -1
- package/src/session-runtime/services/agent-tool/worker-index/row-shape.mjs +2 -2
- package/src/session-runtime/services/agent-tool/worker-rows.mjs +17 -0
- package/src/session-runtime/services/channel-session-router.mjs +4 -1
- package/src/session-runtime/services/hook-bus/command-handler.mjs +4 -1
- package/src/session-runtime/services/hook-bus/handlers.mjs +7 -3
- package/src/session-runtime/services/provider-admin.mjs +64 -18
- package/src/session-runtime/services/usage-dashboard-model.mjs +3 -0
- package/src/session-runtime/settings-compaction-api.mjs +1 -0
- package/src/session-runtime/setup-tool/executor.mjs +12 -1
- package/src/session-runtime/setup-tool/extended-actions.mjs +1 -0
- package/src/session-runtime/setup-tool/settings-contract.mjs +1 -0
- package/src/session-runtime/setup-tool/tool-defs.mjs +7 -1
- package/src/session-runtime/skills-api.mjs +7 -3
- package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +1 -0
- package/src/session-runtime/webhook-session-run.mjs +16 -4
- package/src/skill-script-entry.mjs +36 -0
- package/src/standalone/daemon-drain-policy.mjs +8 -0
- package/src/standalone/daemon-stored-session-views.mjs +11 -3
- package/src/standalone/daemon-telemetry.mjs +55 -0
- package/src/standalone/daemon.mjs +44 -11
- package/src/standalone/session-protocol.mjs +12 -0
- package/src/standalone/session-service/agent-tree/agent-cancel.mjs +33 -2
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +26 -10
- package/src/standalone/session-service/agent-tree.mjs +12 -0
- package/src/standalone/session-service/quota-resume.mjs +8 -0
- package/src/standalone/session-service/retention/busy.mjs +15 -1
- package/src/standalone/session-service/session-calls/session-action.mjs +6 -1
- package/src/standalone/session-service-api.mjs +5 -0
- package/src/standalone/session-service.mjs +1 -0
- package/src/tui/App.jsx +9 -1
- package/src/tui/app/app-view/floating-panel.jsx +9 -1
- package/src/tui/app/app-view.jsx +7 -0
- package/src/tui/app/create-app-pickers.mjs +4 -0
- package/src/tui/app/extension-pickers/mcp-login.mjs +107 -0
- package/src/tui/app/extension-pickers/mcp-servers-picker.mjs +2 -1
- package/src/tui/app/extension-pickers/plugins-pickers.mjs +35 -16
- package/src/tui/app/extension-pickers.mjs +2 -1
- package/src/tui/app/model-options.mjs +13 -16
- package/src/tui/app/skill-mention-palette.mjs +88 -0
- package/src/tui/app/slash-commands.mjs +7 -2
- package/src/tui/app/slash-dispatch/panel-commands.mjs +16 -1
- package/src/tui/app/slash-palette.mjs +23 -7
- package/src/tui/app/transcript-row-estimate.mjs +11 -3
- package/src/tui/app/use-prompt-draft-flow.mjs +7 -2
- package/src/tui/app/use-prompt-state.mjs +5 -0
- package/src/tui/components/Message.jsx +22 -1
- package/src/tui/components/PromptInput.jsx +21 -3
- package/src/tui/components/SlashCommandPalette.jsx +12 -3
- package/src/tui/components/StatusLine.jsx +2 -0
- package/src/tui/components/TranscriptItem.jsx +9 -1
- package/src/tui/components/prompt-input/key-handler.mjs +21 -8
- package/src/tui/components/status-line/local-line.mjs +5 -2
- package/src/tui/components/status-line/use-statusline-text.mjs +7 -1
- package/src/tui/components/user-message-skills.mjs +38 -0
- package/src/tui/dist/index.mjs +1323 -214
- package/src/tui/session/queue-helpers.mjs +7 -2
- package/src/tui/session/quota-resume.mjs +46 -14
- package/src/tui/session/session-api/commands.mjs +33 -24
- package/src/tui/session/session-api/extensions.mjs +26 -2
- package/src/tui/session/session-api/integrations.mjs +7 -0
- package/src/tui/session/session-api/lifecycle.mjs +5 -1
- package/src/tui/session/session-api/routes.mjs +71 -7
- package/src/tui/session/session-api/settings.mjs +12 -14
- package/src/tui/session/session-flow/drain.mjs +21 -5
- package/src/tui/session/session-flow/failed-turn-rewind.mjs +10 -4
- package/src/tui/session/tui-steering-persist.mjs +25 -9
- package/src/tui/session/turn.mjs +55 -15
- package/src/tui/statusline-ansi-bridge.mjs +1 -1
- package/src/ui/statusline-agents.mjs +15 -4
- package/src/ui/statusline.mjs +7 -3
- package/src/ui/streaming-markdown-heal.mjs +34 -3
- package/src/vendor/statusline/src/gateway/claude-current.mjs +14 -4
- package/src/runtime/effort-judge/previous-human-request.mjs +0 -162
- package/src/runtime/effort-judge/verified-context-input.mjs +0 -10
- package/src/runtime/memory/lib/memory-session-merge.mjs +0 -32
- package/src/runtime/shared/llm/usage-session-history.mjs +0 -266
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
import { isShellTool } from '../../runtime/shared/tool-card-model/shell-surface.mjs';
|
|
21
21
|
import { stripLeadingStatusMarkerFromText } from '../../runtime/shared/tool-card-model/terminal-status.mjs';
|
|
22
22
|
import { readRowsForDisplay } from '../../runtime/shared/read-row-numbers.mjs';
|
|
23
|
+
import { appliedSkillsLine } from '../components/user-message-skills.mjs';
|
|
23
24
|
import { aggregateRawResultForDisplay } from '../session/tool-result-status.mjs';
|
|
24
25
|
import { formatExpandedResult, wrapExpandedResultLines } from '../components/tool-output-format.mjs';
|
|
25
26
|
import {
|
|
@@ -100,7 +101,9 @@ function toolDisplayedResultTextForRows(item) {
|
|
|
100
101
|
const backgroundError = String(bgArgs.error || '');
|
|
101
102
|
const normalizedName = String(normalizeToolName(item?.name) || '').toLowerCase();
|
|
102
103
|
const errorOnlyResult =
|
|
103
|
-
Boolean(rt) &&
|
|
104
|
+
Boolean(rt) &&
|
|
105
|
+
hasBackgroundMetaForRows(normalizedName, bgArgs, rt) &&
|
|
106
|
+
isBackgroundErrorOnlyBody(rt, backgroundError);
|
|
104
107
|
if (!toolItemPendingForRows(item) && isBackgroundTaskTool(normalizedName)) {
|
|
105
108
|
const meta = parseBackgroundTaskResultForRows(rt);
|
|
106
109
|
if (meta?.hasResponse && String(meta.body || '').trim()) {
|
|
@@ -213,8 +216,13 @@ function estimateToolRenderedResultRows(value, { pathArg = '', isShell = false,
|
|
|
213
216
|
export function estimateTranscriptItemRows(item, columns, toolOutputExpanded, attachedTool = false) {
|
|
214
217
|
if (!item) return 1;
|
|
215
218
|
switch (item.kind) {
|
|
216
|
-
case 'user':
|
|
217
|
-
|
|
219
|
+
case 'user': {
|
|
220
|
+
// UserMessage: marginTop + wrapped text + the applied-skills line.
|
|
221
|
+
const skillsLine = appliedSkillsLine(item.appliedSkills);
|
|
222
|
+
return (
|
|
223
|
+
1 + estimateWrappedRows(item.text, columns, 4) + (skillsLine ? estimateWrappedRows(skillsLine, columns, 4) : 0)
|
|
224
|
+
);
|
|
225
|
+
}
|
|
218
226
|
case 'assistant':
|
|
219
227
|
// marginTop={1} (AssistantMessage <Box>) + rendered body height.
|
|
220
228
|
return (
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { useCallback } from 'react';
|
|
10
10
|
import { slashCommandTokenForPaletteAccept } from './slash-commands.mjs';
|
|
11
11
|
import { withPickerEnterLatch } from './picker-enter-latch.mjs';
|
|
12
|
+
import { completeSkillMention } from './skill-mention-palette.mjs';
|
|
12
13
|
import { applyPromptDraftChange } from './use-prompt-draft-flow/draft-change.mjs';
|
|
13
14
|
import { cancelProviderPromptFlow, cancelSettingsPromptFlow } from './use-prompt-draft-flow/prompt-cancels.mjs';
|
|
14
15
|
|
|
@@ -85,9 +86,12 @@ export function usePromptDraftFlow({
|
|
|
85
86
|
);
|
|
86
87
|
|
|
87
88
|
const acceptSlashPalette = useCallback(
|
|
88
|
-
(draftValue = '') => {
|
|
89
|
+
(draftValue = '', caret) => {
|
|
89
90
|
const command = slashCommands[slashIndex];
|
|
90
91
|
if (!command) return false;
|
|
92
|
+
// A skill row completes the `$name` mention at the caret (the returned
|
|
93
|
+
// { value, cursor } replaces the draft) instead of running anything.
|
|
94
|
+
if (command.kind === 'skill') return completeSkillMention(draftValue, command.name, caret) ?? false;
|
|
91
95
|
return withPickerEnterLatch(pickerOpenedFromEnterRef, pickerOpenedFromEnterTimerRef, () =>
|
|
92
96
|
runSlashCommand(slashCommandTokenForPaletteAccept(command, draftValue), '')
|
|
93
97
|
);
|
|
@@ -96,9 +100,10 @@ export function usePromptDraftFlow({
|
|
|
96
100
|
);
|
|
97
101
|
|
|
98
102
|
const completeSlashPalette = useCallback(
|
|
99
|
-
(draftValue = '') => {
|
|
103
|
+
(draftValue = '', caret) => {
|
|
100
104
|
const command = slashCommands[slashIndex];
|
|
101
105
|
if (!command) return undefined;
|
|
106
|
+
if (command.kind === 'skill') return completeSkillMention(draftValue, command.name, caret);
|
|
102
107
|
const token = slashCommandTokenForPaletteAccept(command, draftValue);
|
|
103
108
|
return token ? `/${token} ` : undefined;
|
|
104
109
|
},
|
|
@@ -7,6 +7,9 @@ import { useRef, useState } from 'react';
|
|
|
7
7
|
export function usePromptState() {
|
|
8
8
|
const [promptDraft, setPromptDraft] = useState('');
|
|
9
9
|
const [promptDraftOverride, setPromptDraftOverride] = useState(null);
|
|
10
|
+
// The prompt caret offset as reported by PromptInput (null = end of draft);
|
|
11
|
+
// the `$name` skill palette reads the mention before it.
|
|
12
|
+
const [promptCaret, setPromptCaret] = useState(null);
|
|
10
13
|
const promptLayoutValueRef = useRef('');
|
|
11
14
|
const [, setPromptLayoutRows] = useState(1);
|
|
12
15
|
const [textEntryLayoutRows, setTextEntryLayoutRows] = useState(1);
|
|
@@ -26,6 +29,8 @@ export function usePromptState() {
|
|
|
26
29
|
setPromptDraft,
|
|
27
30
|
promptDraftOverride,
|
|
28
31
|
setPromptDraftOverride,
|
|
32
|
+
promptCaret,
|
|
33
|
+
setPromptCaret,
|
|
29
34
|
promptLayoutValueRef,
|
|
30
35
|
setPromptLayoutRows,
|
|
31
36
|
textEntryLayoutRows,
|
|
@@ -17,6 +17,7 @@ import { Box, Text } from 'ink';
|
|
|
17
17
|
import { theme, TURN_MARKER } from '../theme.mjs';
|
|
18
18
|
import { StreamingMarkdown, resetStreamingMarkdownStablePrefix, windowPlainStreamingText } from './Markdown.jsx';
|
|
19
19
|
import { assistantBodyWidth } from '../markdown/table-layout.mjs';
|
|
20
|
+
import { appliedSkillsLine, userTextSegments } from './user-message-skills.mjs';
|
|
20
21
|
|
|
21
22
|
// `themeEpoch` is a memo-busting prop (threaded from App): the active theme
|
|
22
23
|
// mutates `theme` in-place, so a /theme switch must re-render this memoized row
|
|
@@ -66,6 +67,7 @@ export const UserMessage = React.memo(function UserMessage({
|
|
|
66
67
|
text,
|
|
67
68
|
attached = false,
|
|
68
69
|
columns,
|
|
70
|
+
appliedSkills,
|
|
69
71
|
themeEpoch: _themeEpoch = 0,
|
|
70
72
|
}) {
|
|
71
73
|
// `attached` = the previous transcript row is also a user message (consecutive
|
|
@@ -79,6 +81,10 @@ export const UserMessage = React.memo(function UserMessage({
|
|
|
79
81
|
// makes Windows Terminal/conhost auto-wrap, which drifts the alt-screen frame
|
|
80
82
|
// and stacks stale gray bands on re-render. One narrower cell is invisible.
|
|
81
83
|
const bandColumns = Math.max(1, columns - 1);
|
|
84
|
+
// `$name` tokens of the skills this turn applied are marked; the applied
|
|
85
|
+
// skills are listed on their own line (user-message-skills.mjs).
|
|
86
|
+
const skillsLine = appliedSkillsLine(appliedSkills);
|
|
87
|
+
const segments = userTextSegments(text, appliedSkills);
|
|
82
88
|
return (
|
|
83
89
|
<Box
|
|
84
90
|
flexDirection="column"
|
|
@@ -89,8 +95,23 @@ export const UserMessage = React.memo(function UserMessage({
|
|
|
89
95
|
paddingRight={1}
|
|
90
96
|
>
|
|
91
97
|
<Text color={theme.mixdogIvory} wrap="wrap">
|
|
92
|
-
{
|
|
98
|
+
{segments.length === 1 && !segments[0].mention
|
|
99
|
+
? text
|
|
100
|
+
: segments.map((segment, index) =>
|
|
101
|
+
segment.mention ? (
|
|
102
|
+
<Text key={index} color={theme.panelTitle} bold>
|
|
103
|
+
{segment.text}
|
|
104
|
+
</Text>
|
|
105
|
+
) : (
|
|
106
|
+
segment.text
|
|
107
|
+
)
|
|
108
|
+
)}
|
|
93
109
|
</Text>
|
|
110
|
+
{skillsLine ? (
|
|
111
|
+
<Text color={theme.subtle} wrap="wrap">
|
|
112
|
+
{skillsLine}
|
|
113
|
+
</Text>
|
|
114
|
+
) : null}
|
|
94
115
|
</Box>
|
|
95
116
|
);
|
|
96
117
|
});
|
|
@@ -24,7 +24,7 @@ import { createVerticalMover } from './prompt-input/edit-chords.mjs';
|
|
|
24
24
|
import { cancelPromptImmediateFlush, schedulePromptImmediateFlush } from './prompt-input/immediate-render.mjs';
|
|
25
25
|
import { renderSelectedText } from './prompt-input/selected-text.jsx';
|
|
26
26
|
import { IME_LEFT_GUARD_COLUMNS, createCursorAnchor } from './prompt-input/cursor-anchor.mjs';
|
|
27
|
-
import { createPromptKeyHandler } from './prompt-input/key-handler.mjs';
|
|
27
|
+
import { createPromptKeyHandler, paletteResultDraft } from './prompt-input/key-handler.mjs';
|
|
28
28
|
import { createPromptMouseSelection } from './prompt-input/mouse-selection.mjs';
|
|
29
29
|
import { createUndoStack } from './prompt-input/undo-stack.mjs';
|
|
30
30
|
|
|
@@ -37,6 +37,8 @@ export function PromptInput({
|
|
|
37
37
|
commandPaletteActive = false,
|
|
38
38
|
commandPaletteOpen = commandPaletteActive,
|
|
39
39
|
commandPaletteOptionCount = commandPaletteActive ? 2 : 0,
|
|
40
|
+
commandPaletteMovesCaret = false,
|
|
41
|
+
onCaretChange,
|
|
40
42
|
mask = false,
|
|
41
43
|
hint = '',
|
|
42
44
|
hintTone = 'info',
|
|
@@ -66,6 +68,7 @@ export function PromptInput({
|
|
|
66
68
|
const [, bumpCursorAnchorEpoch] = useState(0);
|
|
67
69
|
const draftRef = useRef(draft);
|
|
68
70
|
const lastReportedValueRef = useRef(draft.value);
|
|
71
|
+
const lastReportedCursorRef = useRef(null);
|
|
69
72
|
// Bumped on every submit/draftOverride replace/unmount so an async paste
|
|
70
73
|
// (clipboard read or onPasteText promise) that resolves after the draft
|
|
71
74
|
// moved on can detect staleness and drop its result instead of mutating
|
|
@@ -171,9 +174,20 @@ export function PromptInput({
|
|
|
171
174
|
lastReportedValueRef.current = next.value;
|
|
172
175
|
onDraftChange?.(next.value);
|
|
173
176
|
}
|
|
177
|
+
reportCaret(next.cursor);
|
|
174
178
|
if (valueRef) valueRef.current = next.value;
|
|
175
179
|
};
|
|
176
180
|
|
|
181
|
+
// The caret offset for caret-aware completion (`$name` skill mentions).
|
|
182
|
+
function reportCaret(nextCursor) {
|
|
183
|
+
if (nextCursor === lastReportedCursorRef.current) return;
|
|
184
|
+
lastReportedCursorRef.current = nextCursor;
|
|
185
|
+
onCaretChange?.(nextCursor);
|
|
186
|
+
}
|
|
187
|
+
// A (re)mounted input starts at the end of its initial value.
|
|
188
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: mount-only report
|
|
189
|
+
useEffect(() => reportCaret(draftRef.current.cursor), []);
|
|
190
|
+
|
|
177
191
|
const installCursorAnchor = () => {
|
|
178
192
|
if (!boxRef.current || boxRef.current.internal_cursorAnchor) return false;
|
|
179
193
|
// The anchor function itself (box-rect publish + caret math) lives in
|
|
@@ -327,8 +341,11 @@ export function PromptInput({
|
|
|
327
341
|
const current = draftRef.current;
|
|
328
342
|
const next = prefix ? insertText(current, prefix) : current;
|
|
329
343
|
if (commandPaletteActive) {
|
|
330
|
-
const accepted = onCommandPaletteAccept?.(next.value);
|
|
331
|
-
|
|
344
|
+
const accepted = onCommandPaletteAccept?.(next.value, next.cursor);
|
|
345
|
+
const replacement = paletteResultDraft(accepted);
|
|
346
|
+
if (replacement) {
|
|
347
|
+
commitDraft(replacement);
|
|
348
|
+
} else if (accepted !== false) {
|
|
332
349
|
commitDraft({ value: '', cursor: 0, selectionAnchor: null });
|
|
333
350
|
} else if (next !== current) {
|
|
334
351
|
commitDraft(next);
|
|
@@ -361,6 +378,7 @@ export function PromptInput({
|
|
|
361
378
|
commandPaletteActive,
|
|
362
379
|
commandPaletteOpen,
|
|
363
380
|
commandPaletteOptionCount,
|
|
381
|
+
commandPaletteMovesCaret,
|
|
364
382
|
onCommandPaletteNavigate,
|
|
365
383
|
onCommandPaletteAccept,
|
|
366
384
|
onCommandPaletteCancel,
|
|
@@ -28,6 +28,7 @@ function queryMatchesAlias(command, query) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function commandDisplayLabel(command, query) {
|
|
31
|
+
if (command?.label) return command.label;
|
|
31
32
|
const usage = String(command?.usage || command?.name || '').replace(/^\/+/, '');
|
|
32
33
|
const aliasText =
|
|
33
34
|
command?.showAliasUsage !== false &&
|
|
@@ -41,7 +42,15 @@ function commandDisplayLabel(command, query) {
|
|
|
41
42
|
return `${label}${aliasText}`;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
export function SlashCommandPalette({
|
|
45
|
+
export function SlashCommandPalette({
|
|
46
|
+
commands,
|
|
47
|
+
selectedIndex = 0,
|
|
48
|
+
title = 'Commands',
|
|
49
|
+
columns = 80,
|
|
50
|
+
query = '',
|
|
51
|
+
description: descriptionText = SLASH_DESCRIPTION,
|
|
52
|
+
help: helpText = SLASH_HELP,
|
|
53
|
+
}) {
|
|
45
54
|
const total = commands.length;
|
|
46
55
|
const half = Math.floor(MAX_VISIBLE / 2);
|
|
47
56
|
let start = Math.max(0, selectedIndex - half);
|
|
@@ -58,9 +67,9 @@ export function SlashCommandPalette({ commands, selectedIndex = 0, title = 'Comm
|
|
|
58
67
|
const labelWidth = Math.min(COMMAND_LABEL_WIDTH, Math.max(12, Math.floor(columns * 0.45)));
|
|
59
68
|
const descriptionWidth = Math.max(0, columns - labelWidth - 12);
|
|
60
69
|
// Standard panel rhythm: title row, blank, description/hint row, blank, content.
|
|
61
|
-
const description = truncateText(
|
|
70
|
+
const description = truncateText(descriptionText, Math.max(0, columns - 4));
|
|
62
71
|
const titleWidth = stringWidth(String(title || ''));
|
|
63
|
-
const help = truncateText(
|
|
72
|
+
const help = truncateText(helpText, Math.max(0, columns - titleWidth - 7));
|
|
64
73
|
|
|
65
74
|
return (
|
|
66
75
|
<Box flexDirection="column" flexShrink={0} width="100%">
|
|
@@ -80,7 +80,15 @@ export const Item = React.memo(function Item({
|
|
|
80
80
|
let node = null;
|
|
81
81
|
switch (item.kind) {
|
|
82
82
|
case 'user':
|
|
83
|
-
node =
|
|
83
|
+
node = (
|
|
84
|
+
<UserMessage
|
|
85
|
+
text={item.text}
|
|
86
|
+
attached={prevKind === 'user'}
|
|
87
|
+
columns={columns}
|
|
88
|
+
appliedSkills={item.appliedSkills}
|
|
89
|
+
themeEpoch={themeEpoch}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
84
92
|
break;
|
|
85
93
|
case 'assistant':
|
|
86
94
|
node = (
|
|
@@ -42,6 +42,14 @@ function gridSelectionActive(suppressShiftNavRef) {
|
|
|
42
42
|
return Boolean(suppressShiftNavRef?.current);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// A palette accept/complete may hand back the next draft: a string (caret at
|
|
46
|
+
// its end) or { value, cursor } (a `$name` skill mention completed at the caret).
|
|
47
|
+
export function paletteResultDraft(result) {
|
|
48
|
+
if (typeof result === 'string') return { value: result, cursor: result.length, selectionAnchor: null };
|
|
49
|
+
if (typeof result?.value === 'string') return { value: result.value, cursor: result.cursor, selectionAnchor: null };
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
45
53
|
export function createPromptKeyHandler(ctx) {
|
|
46
54
|
const {
|
|
47
55
|
disabled,
|
|
@@ -55,6 +63,7 @@ export function createPromptKeyHandler(ctx) {
|
|
|
55
63
|
submitDraft,
|
|
56
64
|
commandPaletteActive,
|
|
57
65
|
commandPaletteOptionCount,
|
|
66
|
+
commandPaletteMovesCaret,
|
|
58
67
|
onCommandPaletteNavigate,
|
|
59
68
|
onCommandPaletteAccept,
|
|
60
69
|
onCommandPaletteComplete,
|
|
@@ -177,8 +186,12 @@ export function createPromptKeyHandler(ctx) {
|
|
|
177
186
|
}
|
|
178
187
|
|
|
179
188
|
if (commandPaletteActive) {
|
|
180
|
-
const accepted = onCommandPaletteAccept?.(draftRef.current.value);
|
|
181
|
-
|
|
189
|
+
const accepted = onCommandPaletteAccept?.(draftRef.current.value, draftRef.current.cursor);
|
|
190
|
+
// A draft-shaped accept (skill mention completion) replaces the draft.
|
|
191
|
+
const replacement = paletteResultDraft(accepted);
|
|
192
|
+
if (replacement) {
|
|
193
|
+
commitDraft(replacement);
|
|
194
|
+
} else if (accepted !== false) {
|
|
182
195
|
commitDraft({ value: '', cursor: 0, selectionAnchor: null });
|
|
183
196
|
}
|
|
184
197
|
return;
|
|
@@ -276,10 +289,10 @@ export function createPromptKeyHandler(ctx) {
|
|
|
276
289
|
|
|
277
290
|
if (key.tab) {
|
|
278
291
|
if (commandPaletteActive) {
|
|
279
|
-
const completed =
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
292
|
+
const completed = paletteResultDraft(
|
|
293
|
+
onCommandPaletteComplete?.(draftRef.current.value, draftRef.current.cursor)
|
|
294
|
+
);
|
|
295
|
+
if (completed) commitDraft(completed);
|
|
283
296
|
return;
|
|
284
297
|
}
|
|
285
298
|
if (onTab?.(draftRef.current.value) === true) return;
|
|
@@ -291,7 +304,7 @@ export function createPromptKeyHandler(ctx) {
|
|
|
291
304
|
}
|
|
292
305
|
|
|
293
306
|
if (key.leftArrow || rawShiftLeft) {
|
|
294
|
-
if (commandPaletteActive) {
|
|
307
|
+
if (commandPaletteActive && !commandPaletteMovesCaret) {
|
|
295
308
|
onCommandPaletteNavigate?.('left');
|
|
296
309
|
return;
|
|
297
310
|
}
|
|
@@ -301,7 +314,7 @@ export function createPromptKeyHandler(ctx) {
|
|
|
301
314
|
return;
|
|
302
315
|
}
|
|
303
316
|
if (key.rightArrow || rawShiftRight) {
|
|
304
|
-
if (commandPaletteActive) {
|
|
317
|
+
if (commandPaletteActive && !commandPaletteMovesCaret) {
|
|
305
318
|
onCommandPaletteNavigate?.('right');
|
|
306
319
|
return;
|
|
307
320
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { rgbSgr } from '../../../runtime/shared/statusline/ansi.mjs';
|
|
6
6
|
import { measuredContextUsage, contextMeasurementLabel } from '../../../runtime/shared/context-measurement.mjs';
|
|
7
|
-
import { displayModelName, shortenModelName } from '../../../runtime/shared/model-display.mjs';
|
|
7
|
+
import { displayModelName, effortDisplayLabel, shortenModelName } from '../../../runtime/shared/model-display.mjs';
|
|
8
8
|
import { theme } from '../../theme.mjs';
|
|
9
9
|
import { normalizeStatuslineAnsi } from '../../statusline-ansi-bridge.mjs';
|
|
10
10
|
// Cache-only synchronous read (never touches fs on the render path), so the
|
|
@@ -160,6 +160,7 @@ export function localBootStatusLine(args = {}) {
|
|
|
160
160
|
model = '',
|
|
161
161
|
effort = '',
|
|
162
162
|
fast = false,
|
|
163
|
+
ultra = false,
|
|
163
164
|
stats = null,
|
|
164
165
|
contextWindow = 0,
|
|
165
166
|
displayContextWindow = 0,
|
|
@@ -168,7 +169,9 @@ export function localBootStatusLine(args = {}) {
|
|
|
168
169
|
const raw = String(model || '').trim();
|
|
169
170
|
const { STATUS, SUBTLE } = statusColors();
|
|
170
171
|
const display = shortenModelName(displayModelName(raw, provider, ''), terminalColumns());
|
|
171
|
-
|
|
172
|
+
let speedLabel = '';
|
|
173
|
+
if (fast === true) speedLabel = ultra === true ? 'Ultrafast' : 'Fast';
|
|
174
|
+
const flags = [effort ? effortDisplayLabel(effort) : '', speedLabel].filter(Boolean);
|
|
172
175
|
const modelBits = [display, ...flags].join(` ${SUBTLE}·${RESET} `);
|
|
173
176
|
const ctxPct = measuredContextUsage({
|
|
174
177
|
stats,
|
|
@@ -29,6 +29,7 @@ export function useStatusLineText({
|
|
|
29
29
|
model,
|
|
30
30
|
effort,
|
|
31
31
|
fast,
|
|
32
|
+
ultra,
|
|
32
33
|
cwd,
|
|
33
34
|
stats,
|
|
34
35
|
contextWindow,
|
|
@@ -52,6 +53,7 @@ export function useStatusLineText({
|
|
|
52
53
|
model,
|
|
53
54
|
effort,
|
|
54
55
|
fast,
|
|
56
|
+
ultra,
|
|
55
57
|
stats,
|
|
56
58
|
contextWindow,
|
|
57
59
|
displayContextWindow,
|
|
@@ -83,6 +85,7 @@ export function useStatusLineText({
|
|
|
83
85
|
model,
|
|
84
86
|
effort,
|
|
85
87
|
fast,
|
|
88
|
+
ultra,
|
|
86
89
|
cwd,
|
|
87
90
|
stats,
|
|
88
91
|
contextWindow,
|
|
@@ -180,7 +183,8 @@ export function useStatusLineText({
|
|
|
180
183
|
prevImmediate.provider !== args.provider ||
|
|
181
184
|
prevImmediate.model !== args.model ||
|
|
182
185
|
prevImmediate.effort !== args.effort ||
|
|
183
|
-
prevImmediate.fast !== args.fast
|
|
186
|
+
prevImmediate.fast !== args.fast ||
|
|
187
|
+
prevImmediate.ultra !== args.ultra;
|
|
184
188
|
// A theme switch must re-tone the footer immediately: the stored `line`
|
|
185
189
|
// holds already-normalized ANSI with the OLD palette, so re-running
|
|
186
190
|
// normalizeStatusLine on it is a no-op. Force a fresh local rebuild (new
|
|
@@ -218,6 +222,7 @@ export function useStatusLineText({
|
|
|
218
222
|
model: args.model,
|
|
219
223
|
effort: args.effort,
|
|
220
224
|
fast: args.fast,
|
|
225
|
+
ultra: args.ultra,
|
|
221
226
|
contextWindow: args.contextWindow,
|
|
222
227
|
displayContextWindow: args.displayContextWindow,
|
|
223
228
|
rawContextWindow: args.rawContextWindow,
|
|
@@ -299,6 +304,7 @@ export function useStatusLineText({
|
|
|
299
304
|
model,
|
|
300
305
|
effort,
|
|
301
306
|
fast,
|
|
307
|
+
ultra,
|
|
302
308
|
cwd,
|
|
303
309
|
statsSignature,
|
|
304
310
|
contextWindow,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* components/user-message-skills.mjs — the skills a user row applied.
|
|
3
|
+
*
|
|
4
|
+
* A user transcript row carries `appliedSkills` (the runtime's record of the
|
|
5
|
+
* skills that turn actually loaded, live or restored). The row marks the
|
|
6
|
+
* `$name` tokens of exactly those skills — found by the shared mention parser
|
|
7
|
+
* the runtime and desktop use — and adds one applied-skills line under the
|
|
8
|
+
* text. The row-height estimate counts that same line.
|
|
9
|
+
*/
|
|
10
|
+
import { skillMentions } from '../../runtime/shared/skill-mentions.mjs';
|
|
11
|
+
|
|
12
|
+
/** The applied skill names of a row value: non-empty strings only. */
|
|
13
|
+
export function appliedSkillNames(value) {
|
|
14
|
+
return (Array.isArray(value) ? value : []).filter((name) => typeof name === 'string' && name);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** The line rendered under a user row, or '' when it applied no skill. */
|
|
18
|
+
export function appliedSkillsLine(value) {
|
|
19
|
+
const names = appliedSkillNames(value);
|
|
20
|
+
return names.length ? `Skills applied: ${names.join(', ')}` : '';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** `text` split into plain and marked spans; only `$name` tokens of applied
|
|
24
|
+
* skills are marked, so unknown names, `$HOME` and `$300` stay plain. */
|
|
25
|
+
export function userTextSegments(text, value) {
|
|
26
|
+
const source = String(text ?? '');
|
|
27
|
+
const applied = new Set(appliedSkillNames(value));
|
|
28
|
+
if (!applied.size) return [{ text: source, mention: false }];
|
|
29
|
+
const segments = [];
|
|
30
|
+
let at = 0;
|
|
31
|
+
for (const mention of skillMentions(source, (name) => applied.has(name))) {
|
|
32
|
+
if (mention.start > at) segments.push({ text: source.slice(at, mention.start), mention: false });
|
|
33
|
+
segments.push({ text: source.slice(mention.start, mention.end), mention: true });
|
|
34
|
+
at = mention.end;
|
|
35
|
+
}
|
|
36
|
+
if (at < source.length || !segments.length) segments.push({ text: source.slice(at), mention: false });
|
|
37
|
+
return segments;
|
|
38
|
+
}
|