mixdog 1.1.2 → 1.2.0
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 +1 -0
- package/package.json +2 -1
- package/scripts/lib/run-node-tests.mjs +9 -0
- package/scripts/prune-desktop-runtime.mjs +3 -0
- package/scripts/test-direct.mjs +4 -2
- package/src/defaults/shipped-history.json +6 -0
- package/src/defaults/skills/setup/references/actions.md +5 -2
- package/src/defaults/skills/visualize/SKILL.md +157 -0
- package/src/defaults/skills/visualize/references/craft.md +88 -0
- package/src/headless-command.mjs +56 -3
- package/src/headless-exec.mjs +17 -1
- package/src/help.mjs +2 -0
- package/src/rules/shared/70-delivery.md +2 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/preset.mjs +1 -0
- package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +1 -0
- package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +2 -0
- package/src/runtime/agent/orchestrator/config-presets.mjs +2 -0
- package/src/runtime/agent/orchestrator/config-providers-merge.mjs +17 -11
- package/src/runtime/agent/orchestrator/config-storage.mjs +1 -0
- package/src/runtime/agent/orchestrator/config.mjs +9 -1
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +47 -7
- package/src/runtime/agent/orchestrator/mcp/client-handshake.mjs +51 -8
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +25 -5
- package/src/runtime/agent/orchestrator/mcp/client.mjs +348 -122
- package/src/runtime/agent/orchestrator/mcp/reconnect-singleflight.mjs +4 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +15 -1
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +13 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/cursor-auth.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/cursor-wire-normalization.mjs +2 -1
- package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +12 -4
- package/src/runtime/agent/orchestrator/providers/effort-rejection.mjs +244 -0
- package/src/runtime/agent/orchestrator/providers/grok-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/mimo-oauth-profile.mjs +8 -40
- package/src/runtime/agent/orchestrator/providers/mimo-oauth-tokens.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +51 -12
- package/src/runtime/agent/orchestrator/providers/model-cache.mjs +37 -2
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.d.mts +67 -0
- package/src/runtime/agent/orchestrator/providers/model-proxy-channel.mjs +521 -0
- package/src/runtime/agent/orchestrator/providers/model-proxy-provider.mjs +251 -0
- package/src/runtime/agent/orchestrator/providers/muse-code-oauth-tokens.mjs +2 -0
- package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +69 -102
- package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +6 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-catalog-store.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-oauth-catalog.mjs +5 -2
- package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/registry.mjs +15 -1
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +10 -0
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +36 -3
- package/src/runtime/agent/orchestrator/runtime-core/effort.mjs +12 -11
- package/src/runtime/agent/orchestrator/runtime-core/model-capabilities.mjs +16 -1
- package/src/runtime/agent/orchestrator/runtime-core/plugin-mcp.mjs +11 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +10 -3
- package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +10 -0
- package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +9 -5
- package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +18 -8
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +10 -3
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +18 -11
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +13 -5
- package/src/runtime/agent/orchestrator/session/compaction-archive-capture.mjs +362 -0
- package/src/runtime/agent/orchestrator/session/compaction-archive.mjs +253 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/continuation.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/diagnostic.mjs +1 -7
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/refusal.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/segments.mjs +3 -2
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +17 -7
- package/src/runtime/agent/orchestrator/session/loop/usage.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +12 -2
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +5 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +5 -2
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +37 -16
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +90 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +22 -12
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +32 -3
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +27 -0
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +16 -1
- package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/message-ids.mjs +123 -0
- package/src/runtime/agent/orchestrator/session/message-ids.test-support.mjs +29 -0
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +29 -19
- package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-finish.mjs +10 -3
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +11 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +29 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +23 -4
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +20 -3
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +28 -8
- package/src/runtime/agent/orchestrator/session/transcript-restore/user-text.mjs +140 -0
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +52 -2
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +32 -22
- package/src/runtime/agent/orchestrator/tools/builtin/git-repo-rw-lock.mjs +10 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-cache-policy.mjs +8 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +31 -12
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-fast-paths.mjs +32 -35
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-render.mjs +11 -12
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-stream.mjs +9 -6
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +80 -66
- package/src/runtime/agent/orchestrator/tools/builtin/read-snapshot-runtime.mjs +8 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-source-windows.mjs +5 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +16 -7
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +2 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-publication.mjs +137 -0
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-snapshot.mjs +11 -10
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +21 -11
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +12 -1
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +56 -13
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +58 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +25 -1
- package/src/runtime/agent/orchestrator/tools/patch/ui-diff.mjs +78 -5
- package/src/runtime/agent/orchestrator/tools/progress-message.mjs +2 -0
- package/src/runtime/attachments/store.mjs +38 -0
- package/src/runtime/shared/atomic-file.mjs +8 -2
- package/src/runtime/shared/best-effort-stderr.mjs +8 -0
- package/src/runtime/shared/code-graph-state.mjs +12 -0
- package/src/runtime/shared/defaults-separation.mjs +2 -0
- package/src/runtime/shared/git-runner-worker.mjs +3 -2
- package/src/runtime/shared/git-runner.mjs +4 -3
- package/src/runtime/shared/llm/default-context-window.mjs +6 -0
- package/src/runtime/shared/llm/model-catalog-projection.mjs +5 -4
- package/src/runtime/shared/llm/model-catalog.mjs +240 -118
- package/src/runtime/shared/llm/provider-catalog-cache.mjs +36 -28
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +156 -0
- package/src/runtime/shared/llm/provider-seed-rosters.mjs +130 -0
- package/src/runtime/shared/model-proxy-mode.d.mts +3 -0
- package/src/runtime/shared/model-proxy-mode.mjs +19 -0
- package/src/runtime/shared/provider-accounts.mjs +2 -2
- package/src/runtime/shared/provider-api-key.mjs +21 -1
- package/src/runtime/shared/schedule-model-ref.mjs +11 -2
- package/src/runtime/shared/session-usage-totals.mjs +19 -0
- package/src/runtime/shared/sharp-electron-linux.mjs +25 -0
- package/src/runtime/shared/singleton-owner.mjs +36 -6
- package/src/runtime/shared/statusline/statusline-segments.mjs +68 -14
- package/src/runtime/shared/tool-surface.mjs +7 -0
- package/src/runtime/shared/tool-work-units.mjs +14 -0
- package/src/runtime/shared/transcript-metadata.mjs +17 -1
- package/src/runtime/shared/turn-changes.mjs +791 -0
- package/src/runtime/shared/turn-snapshot-store.mjs +346 -12
- package/src/runtime/shared/turn-snapshot.mjs +690 -81
- package/src/runtime/shared/turn-worktree-snapshot.mjs +161 -11
- package/src/runtime/shared/worktrees/cache-cleanups.mjs +52 -0
- package/src/runtime/shared/worktrees/contract.mjs +551 -0
- package/src/runtime/shared/worktrees/disk.mjs +57 -0
- package/src/runtime/shared/worktrees/git.mjs +247 -0
- package/src/runtime/shared/worktrees/include.mjs +480 -0
- package/src/runtime/shared/worktrees/lock.mjs +46 -0
- package/src/runtime/shared/worktrees/maintenance.mjs +96 -0
- package/src/runtime/shared/worktrees/manager.mjs +1215 -0
- package/src/runtime/shared/worktrees/merge.mjs +182 -0
- package/src/runtime/shared/worktrees/owner.mjs +46 -0
- package/src/runtime/shared/worktrees/paths.mjs +62 -0
- package/src/runtime/shared/worktrees/registry.mjs +110 -0
- package/src/runtime/shared/worktrees/settings.mjs +84 -0
- package/src/runtime/shared/worktrees/slug.mjs +62 -0
- package/src/runtime/shared/worktrees/test-support.mjs +96 -0
- package/src/runtime/visualize-bridge/client.mjs +181 -0
- package/src/runtime/visualize-bridge/tool-defs.mjs +97 -0
- package/src/session-runtime/boot/apis.mjs +35 -0
- package/src/session-runtime/boot/config.mjs +2 -0
- package/src/session-runtime/boot/facade.mjs +20 -0
- package/src/session-runtime/boot/infrastructure.mjs +1 -0
- package/src/session-runtime/boot/session.mjs +1 -0
- package/src/session-runtime/boot/tools.mjs +4 -0
- package/src/session-runtime/config-lifecycle.mjs +10 -1
- package/src/session-runtime/cwd-plugins/cwd-apply.mjs +11 -1
- package/src/session-runtime/global-extensions.mjs +2 -2
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +27 -2
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +32 -1
- package/src/session-runtime/internal-tool-executor.mjs +9 -1
- package/src/session-runtime/lifecycle/session-catalog.mjs +8 -1
- package/src/session-runtime/lifecycle/session-switch/context-switch.mjs +5 -0
- package/src/session-runtime/lifecycle/session-switch/resume.mjs +21 -3
- package/src/session-runtime/lifecycle/session-switch/session-delete.mjs +16 -0
- package/src/session-runtime/mcp-glue/connect.mjs +11 -6
- package/src/session-runtime/mcp-glue/server-catalog.mjs +7 -3
- package/src/session-runtime/mcp-glue/server-input.mjs +29 -0
- package/src/session-runtime/model-route/route-persist.mjs +3 -0
- package/src/session-runtime/model-route/set-route.mjs +15 -2
- package/src/session-runtime/notification-bus.mjs +9 -1
- package/src/session-runtime/provider-models/row-hydration.mjs +2 -0
- package/src/session-runtime/resource-extension-sync.mjs +30 -7
- package/src/session-runtime/resource-mcp-api.mjs +20 -7
- package/src/session-runtime/route-resolution.mjs +10 -1
- package/src/session-runtime/route-state.mjs +16 -2
- package/src/session-runtime/runtime-core.mjs +5 -0
- package/src/session-runtime/runtime-facade.mjs +8 -0
- package/src/session-runtime/runtime-review-api.mjs +9 -0
- package/src/session-runtime/services/agent-tool/helpers.mjs +5 -0
- package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +3 -0
- package/src/session-runtime/services/agent-tool/job-views/job-lookup.mjs +1 -0
- package/src/session-runtime/services/agent-tool/job-views/spawn-meta.mjs +1 -0
- package/src/session-runtime/services/agent-tool/lead-worker-index.mjs +15 -0
- package/src/session-runtime/services/agent-tool/send-flow.mjs +1 -0
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-plan.mjs +10 -2
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +19 -7
- package/src/session-runtime/services/agent-tool/spawn-preset.mjs +3 -0
- package/src/session-runtime/services/agent-tool/tag-registry.mjs +2 -1
- package/src/session-runtime/services/agent-tool/worker-index/row-shape.mjs +5 -0
- package/src/session-runtime/services/agent-tool/worker-rows.mjs +1 -0
- package/src/session-runtime/services/agent-tool.mjs +1 -0
- package/src/session-runtime/services/daemon-candidate.mjs +3 -2
- package/src/session-runtime/services/daemon-crash-capture/spawn-capture.mjs +55 -0
- package/src/session-runtime/session-create/session-options.mjs +10 -1
- package/src/session-runtime/session-turn-api.mjs +1 -0
- package/src/session-runtime/settings-api.mjs +4 -2
- package/src/session-runtime/settings-builtin-tools-api.mjs +9 -2
- package/src/session-runtime/settings-worktree-api.mjs +17 -0
- package/src/session-runtime/setup-tool/executor.mjs +11 -4
- package/src/session-runtime/setup-tool/settings-contract.mjs +3 -1
- package/src/session-runtime/setup-tool/tool-defs.mjs +31 -3
- package/src/session-runtime/turn/agent-ops.mjs +12 -1
- package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +13 -3
- package/src/session-runtime/turn/turn-run/snapshot-tracker.mjs +20 -15
- package/src/session-runtime/turn/turn-run/turn-open.mjs +4 -5
- package/src/session-runtime/turn/turn-run/turn-prepare.mjs +29 -1
- package/src/session-runtime/turn/turn-run/turn-settle.mjs +6 -1
- package/src/session-runtime/turn/turn-run.mjs +6 -7
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +15 -3
- package/src/session-runtime/workspace/admission-gate.mjs +197 -0
- package/src/session-runtime/workspace/project-branches.mjs +136 -0
- package/src/session-runtime/workspace/transition-steps.mjs +364 -0
- package/src/session-runtime/workspace/transitions.mjs +651 -0
- package/src/session-runtime/workspace/workspace-state.mjs +112 -0
- package/src/standalone/channel-transport/http-routes.mjs +17 -0
- package/src/standalone/channel-transport.mjs +13 -1
- package/src/standalone/daemon-desktop-runtime.mjs +1 -0
- package/src/standalone/daemon-owner.mjs +372 -0
- package/src/standalone/daemon-stored-session-views.mjs +4 -1
- package/src/standalone/daemon.mjs +139 -5
- package/src/standalone/desktop-service-registry.mjs +20 -0
- package/src/standalone/local-session-runtime.mjs +11 -0
- package/src/standalone/session-client/attachment-calls.mjs +3 -1
- package/src/standalone/session-client/daemon-unavailable.mjs +62 -0
- package/src/standalone/session-client/lease-heartbeat.mjs +47 -0
- package/src/standalone/session-client.mjs +104 -13
- package/src/standalone/session-protocol.mjs +16 -0
- package/src/standalone/session-proxy.mjs +3 -0
- package/src/standalone/session-service/agent-tree/agent-child.mjs +4 -0
- package/src/standalone/session-service/agent-tree/agent-rehydrate.mjs +1 -0
- package/src/standalone/session-service/entries/lifecycle.mjs +6 -0
- package/src/standalone/session-service/projection/revisions.mjs +2 -0
- package/src/standalone/session-service/projection/transcript-window.mjs +149 -19
- package/src/standalone/session-service/projection/workspace.mjs +14 -0
- package/src/standalone/session-service/session-calls/session-action.mjs +11 -3
- package/src/standalone/session-transport/call-route.mjs +13 -0
- package/src/standalone/session-transport/client-registry/client-grace.mjs +45 -3
- package/src/standalone/session-transport/client-registry/registration-replays.mjs +1 -0
- package/src/standalone/session-transport/client-registry.mjs +20 -3
- package/src/standalone/session-transport/routes.mjs +79 -2
- package/src/standalone/session-transport/stack.mjs +2 -0
- package/src/standalone/session-transport.mjs +24 -1
- package/src/tui/app/message-selector.mjs +2 -1
- package/src/tui/app/model-options.mjs +35 -5
- package/src/tui/app/model-picker/provider-models-list.mjs +2 -2
- package/src/tui/app/model-picker.mjs +4 -2
- package/src/tui/dist/index.mjs +332 -36
- package/src/tui/index.jsx +10 -2
- package/src/tui/session/compaction-view.mjs +147 -0
- package/src/tui/session/context-state.mjs +6 -0
- package/src/tui/session/initial-state.mjs +3 -0
- package/src/tui/session/quota-resume.mjs +2 -1
- package/src/tui/session/session-api/commands.mjs +10 -2
- package/src/tui/session/session-api/controls.mjs +4 -0
- package/src/tui/session/session-api/intake/rewind.mjs +2 -1
- package/src/tui/session/session-api/integrations.mjs +17 -0
- package/src/tui/session/session-api/lifecycle/dispose.mjs +6 -1
- package/src/tui/session/session-api/lifecycle/inheritance.mjs +2 -0
- package/src/tui/session/session-api/lifecycle/resume.mjs +3 -0
- package/src/tui/session/session-api/routes.mjs +10 -1
- package/src/tui/session/session-api/settings.mjs +2 -0
- package/src/tui/session/session-api/worktree.mjs +60 -0
- package/src/tui/session/session-api.mjs +2 -0
- package/src/tui/session/session-flow/auto-clear.mjs +31 -12
- package/src/tui/session/session-flow/drain.mjs +15 -1
- package/src/tui/session/session-flow/session-reset.mjs +4 -3
- package/src/tui/session/session-flow.mjs +2 -0
- package/src/tui/session/transcript-intake.mjs +14 -5
- package/src/tui/session/turn-stream.mjs +32 -4
- package/src/tui/session/turn-tool-cards.mjs +10 -2
- package/src/tui/session/turn.mjs +39 -10
package/src/tui/dist/index.mjs
CHANGED
|
@@ -39950,6 +39950,7 @@ var TOOL_CATEGORY = /* @__PURE__ */ new Map([
|
|
|
39950
39950
|
["office", "Office"],
|
|
39951
39951
|
["media", "Media"],
|
|
39952
39952
|
["tidy", "Tidy"],
|
|
39953
|
+
["visualize", "Visualize"],
|
|
39953
39954
|
["list_mcp_resources", "Setup"],
|
|
39954
39955
|
["list_mcp_resource_templates", "Setup"],
|
|
39955
39956
|
["cwd", "Setup"],
|
|
@@ -39989,6 +39990,7 @@ var CATEGORY_COPY = /* @__PURE__ */ new Map([
|
|
|
39989
39990
|
["Office", { active: "Editing", done: "Edited", noun: "document action" }],
|
|
39990
39991
|
["Media", { active: "Generating", done: "Generated", noun: "media action" }],
|
|
39991
39992
|
["Tidy", { active: "Tidying", done: "Tidied", noun: "cleanup pass" }],
|
|
39993
|
+
["Visualize", { active: "Showing", done: "Showed", noun: "artifact" }],
|
|
39992
39994
|
["Other", { active: "Calling", done: "Called", noun: "tool" }]
|
|
39993
39995
|
]);
|
|
39994
39996
|
function categoryCopy(category) {
|
|
@@ -40179,6 +40181,16 @@ function officeUnit(a) {
|
|
|
40179
40181
|
const [active, done] = OFFICE_ACTION_VERBS.get(action) || ["Editing", "Edited"];
|
|
40180
40182
|
return unitDescriptor("Office", { count: 1, active, done, noun: "document action", effect: true });
|
|
40181
40183
|
}
|
|
40184
|
+
function visualizeUnit(a) {
|
|
40185
|
+
const action = String(a.action || "").toLowerCase();
|
|
40186
|
+
if (action === "capture") return unitDescriptor("Visualize", { count: 1, active: "Capturing", done: "Captured", noun: "screenshot" });
|
|
40187
|
+
if (action === "export") return unitDescriptor("Visualize", { count: 1, active: "Exporting", done: "Exported", noun: "file" });
|
|
40188
|
+
if (action === "annotate") return unitDescriptor("Visualize", { count: 1, active: "Marking", done: "Marked", noun: "annotation" });
|
|
40189
|
+
if (action === "check") return unitDescriptor("Visualize", { count: 1, active: "Checking", done: "Checked", noun: "page" });
|
|
40190
|
+
if (action === "inspect") return unitDescriptor("Visualize", { count: 1, active: "Inspecting", done: "Inspected", noun: "page" });
|
|
40191
|
+
if (action === "close") return unitDescriptor("Visualize", { count: 1, active: "Closing", done: "Closed", noun: "tab" });
|
|
40192
|
+
return unitDescriptor("Visualize", { count: 1, active: "Showing", done: "Showed", noun: "artifact" });
|
|
40193
|
+
}
|
|
40182
40194
|
function terminalUnit(a) {
|
|
40183
40195
|
return String(a.action || "").toLowerCase() === "list" ? unitDescriptor("Terminal", { count: 1, active: "Listing", done: "Listed", noun: "terminal tab" }) : unitDescriptor("Terminal", { count: 1, active: "Reading", done: "Read", noun: "terminal output" });
|
|
40184
40196
|
}
|
|
@@ -40449,6 +40461,7 @@ var TOOL_UNITS = /* @__PURE__ */ new Map([
|
|
|
40449
40461
|
["setup", setupUnit],
|
|
40450
40462
|
["media", mediaUnit],
|
|
40451
40463
|
["tidy", tidyUnit],
|
|
40464
|
+
["visualize", visualizeUnit],
|
|
40452
40465
|
["fetch", fetchUnit],
|
|
40453
40466
|
["recall", memoryReadUnit],
|
|
40454
40467
|
["recall_memory", memoryReadUnit],
|
|
@@ -40562,6 +40575,8 @@ function displayToolName(name, args = {}) {
|
|
|
40562
40575
|
return "Media";
|
|
40563
40576
|
case "tidy":
|
|
40564
40577
|
return "Tidy";
|
|
40578
|
+
case "visualize":
|
|
40579
|
+
return "Visualize";
|
|
40565
40580
|
case "list_mcp_resources":
|
|
40566
40581
|
case "list_mcp_resource_templates":
|
|
40567
40582
|
case "cwd":
|
|
@@ -40723,6 +40738,11 @@ function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}) {
|
|
|
40723
40738
|
}
|
|
40724
40739
|
case "terminal":
|
|
40725
40740
|
return compactParts([String(a.action || ""), a.tab ? `tab ${a.tab}` : ""]);
|
|
40741
|
+
case "visualize": {
|
|
40742
|
+
const input = a.input && typeof a.input === "object" ? a.input : {};
|
|
40743
|
+
const targets = Array.isArray(input.targets) ? input.targets.map(String).join(", ") : "";
|
|
40744
|
+
return compactParts([String(a.action || ""), targets || String(input.tab || "")]);
|
|
40745
|
+
}
|
|
40726
40746
|
case "office":
|
|
40727
40747
|
return compactParts([String(a.action || ""), pathOrId(a.path, a.session, max)]);
|
|
40728
40748
|
case "media":
|
|
@@ -49046,14 +49066,186 @@ var RETIRED_MODEL_ALIASES = Object.freeze({
|
|
|
49046
49066
|
"grok-code-fast-1-0825": "grok-build-0.1"
|
|
49047
49067
|
});
|
|
49048
49068
|
|
|
49049
|
-
// src/runtime/shared/llm/provider-
|
|
49050
|
-
var
|
|
49051
|
-
|
|
49052
|
-
|
|
49053
|
-
|
|
49054
|
-
|
|
49055
|
-
|
|
49056
|
-
|
|
49069
|
+
// src/runtime/shared/llm/provider-seed-rosters.mjs
|
|
49070
|
+
var MUSE_DEFAULT_EFFORT_LEVELS = Object.freeze(["minimal", "low", "medium", "high", "xhigh"]);
|
|
49071
|
+
var MUSE_SIX_LEVELS = Object.freeze([...MUSE_DEFAULT_EFFORT_LEVELS, "max"]);
|
|
49072
|
+
var MUSE_SPARK_CONTEXT = 1048576;
|
|
49073
|
+
var MUSE_SPARK_MAX_OUTPUT = 131072;
|
|
49074
|
+
var STANDARD_COST = { inputCostPerM: 1.25, outputCostPerM: 4.25, cacheReadCostPerM: 0.15, cacheWriteCostPerM: 0 };
|
|
49075
|
+
var CONTRIBUTOR_COST = { inputCostPerM: 0.1, outputCostPerM: 0.2, cacheReadCostPerM: 2e-3, cacheWriteCostPerM: 0 };
|
|
49076
|
+
var MUSE_SEEDS = Object.freeze({
|
|
49077
|
+
"muse-spark-1.1": { name: "Muse Spark 1.1", levels: MUSE_DEFAULT_EFFORT_LEVELS, cost: STANDARD_COST },
|
|
49078
|
+
"muse-spark-1.2": { name: "Muse Spark 1.2", levels: MUSE_DEFAULT_EFFORT_LEVELS, cost: STANDARD_COST },
|
|
49079
|
+
"muse-spark-1.2-contributor": {
|
|
49080
|
+
name: "Muse Spark 1.2 (C)",
|
|
49081
|
+
levels: MUSE_DEFAULT_EFFORT_LEVELS,
|
|
49082
|
+
cost: CONTRIBUTOR_COST
|
|
49083
|
+
},
|
|
49084
|
+
"muse-spark-1.3": { name: "Muse Spark 1.3", levels: MUSE_SIX_LEVELS, cost: STANDARD_COST },
|
|
49085
|
+
"muse-spark-1.3-contributor": { name: "Muse Spark 1.3 (C)", levels: MUSE_SIX_LEVELS, cost: CONTRIBUTOR_COST }
|
|
49086
|
+
});
|
|
49087
|
+
var MUSE_SEED_IDS = Object.freeze(Object.keys(MUSE_SEEDS));
|
|
49088
|
+
function museEffortRow(id, name, levels, cost) {
|
|
49089
|
+
return {
|
|
49090
|
+
id,
|
|
49091
|
+
name,
|
|
49092
|
+
provider: "muse-code-oauth",
|
|
49093
|
+
family: "muse-spark",
|
|
49094
|
+
contextWindow: MUSE_SPARK_CONTEXT,
|
|
49095
|
+
outputTokens: MUSE_SPARK_MAX_OUTPUT,
|
|
49096
|
+
supportsReasoning: true,
|
|
49097
|
+
supportsVision: true,
|
|
49098
|
+
supportsFunctionCalling: true,
|
|
49099
|
+
reasoningLevels: [...levels],
|
|
49100
|
+
reasoningOptions: [{ type: "effort", values: [...levels] }],
|
|
49101
|
+
...cost
|
|
49102
|
+
};
|
|
49103
|
+
}
|
|
49104
|
+
var SPARK_ID_RE = /^muse-spark-(\d+)\.(\d+)(?:\.(\d+))?(-contributor)?$/i;
|
|
49105
|
+
function revisionOf(id) {
|
|
49106
|
+
const m = SPARK_ID_RE.exec(id);
|
|
49107
|
+
return m ? [Number(m[1]), Number(m[2]), Number(m[3] || 0)] : null;
|
|
49108
|
+
}
|
|
49109
|
+
function compareRevision(a, b) {
|
|
49110
|
+
for (let i = 0; i < 3; i += 1) if (a[i] !== b[i]) return a[i] - b[i];
|
|
49111
|
+
return 0;
|
|
49112
|
+
}
|
|
49113
|
+
function museLineageRow(id) {
|
|
49114
|
+
const match = SPARK_ID_RE.exec(id);
|
|
49115
|
+
if (!match) return null;
|
|
49116
|
+
const contributor = Boolean(match[4]);
|
|
49117
|
+
let template = null;
|
|
49118
|
+
let templateRevision = null;
|
|
49119
|
+
for (const seedId of MUSE_SEED_IDS) {
|
|
49120
|
+
if (SPARK_ID_RE.exec(seedId)[4] ? !contributor : contributor) continue;
|
|
49121
|
+
const candidate = revisionOf(seedId);
|
|
49122
|
+
if (!templateRevision || compareRevision(candidate, templateRevision) > 0) {
|
|
49123
|
+
template = seedId;
|
|
49124
|
+
templateRevision = candidate;
|
|
49125
|
+
}
|
|
49126
|
+
}
|
|
49127
|
+
if (!template) return null;
|
|
49128
|
+
const revision = match[3] && Number(match[3]) !== 0 ? `${match[1]}.${match[2]}.${match[3]}` : `${match[1]}.${match[2]}`;
|
|
49129
|
+
return museEffortRow(
|
|
49130
|
+
id,
|
|
49131
|
+
`Muse Spark ${revision}${contributor ? " (C)" : ""}`,
|
|
49132
|
+
MUSE_DEFAULT_EFFORT_LEVELS,
|
|
49133
|
+
MUSE_SEEDS[template].cost
|
|
49134
|
+
);
|
|
49135
|
+
}
|
|
49136
|
+
function museSeedRow(id) {
|
|
49137
|
+
const key = String(id || "");
|
|
49138
|
+
const seed = MUSE_SEEDS[key];
|
|
49139
|
+
if (seed) return museEffortRow(key, seed.name, seed.levels, seed.cost);
|
|
49140
|
+
return museLineageRow(key);
|
|
49141
|
+
}
|
|
49142
|
+
var MIMO_SEED_CONTEXT = 1048576;
|
|
49143
|
+
var MIMO_SEED_OUTPUT = 131072;
|
|
49144
|
+
var MIMO_SEED_MODELS = Object.freeze(
|
|
49145
|
+
[
|
|
49146
|
+
["mimo-v2.6-pro", "MiMo-V2.6-Pro", MIMO_SEED_CONTEXT],
|
|
49147
|
+
["mimo-v2.6-flash", "MiMo-V2.6-Flash", MIMO_SEED_CONTEXT],
|
|
49148
|
+
["mimo-v2.6-pro-ultraspeed", "MiMo-V2.6-Pro-Ultraspeed", MIMO_SEED_CONTEXT],
|
|
49149
|
+
["mimo-v2.5-pro", "MiMo-V2.5-Pro", MIMO_SEED_CONTEXT],
|
|
49150
|
+
["mimo-v2.5", "MiMo-V2.5", MIMO_SEED_CONTEXT],
|
|
49151
|
+
["mimo-v2-pro", "MiMo-V2-Pro", MIMO_SEED_CONTEXT],
|
|
49152
|
+
["mimo-v2-omni", "MiMo-V2-Omni", 262144]
|
|
49153
|
+
].map(
|
|
49154
|
+
([id, display_name, context_window]) => Object.freeze({ id, display_name, context_window, max_output_tokens: MIMO_SEED_OUTPUT })
|
|
49155
|
+
)
|
|
49156
|
+
);
|
|
49157
|
+
function mimoSeedRow(model) {
|
|
49158
|
+
const id = String(model || "").toLowerCase();
|
|
49159
|
+
let seed = MIMO_SEED_MODELS.find((item) => item.id === id) || null;
|
|
49160
|
+
if (!seed) {
|
|
49161
|
+
for (const item of MIMO_SEED_MODELS) {
|
|
49162
|
+
if (id.startsWith(`${item.id}-`) && (!seed || item.id.length > seed.id.length)) seed = item;
|
|
49163
|
+
}
|
|
49164
|
+
}
|
|
49165
|
+
if (!seed) return null;
|
|
49166
|
+
return {
|
|
49167
|
+
id: String(model),
|
|
49168
|
+
contextWindow: seed.context_window,
|
|
49169
|
+
outputTokens: seed.max_output_tokens,
|
|
49170
|
+
reasoning: true,
|
|
49171
|
+
vision: true,
|
|
49172
|
+
inputModalities: ["text", "image"]
|
|
49173
|
+
};
|
|
49174
|
+
}
|
|
49175
|
+
|
|
49176
|
+
// src/runtime/shared/llm/provider-catalog-registry.mjs
|
|
49177
|
+
function mimoSeedMetadata(model) {
|
|
49178
|
+
const seed = mimoSeedRow(model);
|
|
49179
|
+
return seed ? {
|
|
49180
|
+
contextWindow: seed.contextWindow,
|
|
49181
|
+
outputTokens: seed.outputTokens,
|
|
49182
|
+
supportsReasoning: seed.reasoning === true,
|
|
49183
|
+
supportsVision: seed.vision === true
|
|
49184
|
+
} : null;
|
|
49185
|
+
}
|
|
49186
|
+
var PROVIDER_CATALOGS = Object.freeze({
|
|
49187
|
+
// api.openai.com — the endpoint models.dev `openai` describes.
|
|
49188
|
+
openai: { modelsDev: "openai", sameEndpoint: true },
|
|
49189
|
+
// chatgpt.com/backend-api/codex: subscription backend, not the public API.
|
|
49190
|
+
"openai-oauth": {
|
|
49191
|
+
modelsDev: "openai",
|
|
49192
|
+
sameEndpoint: false,
|
|
49193
|
+
rosterFiles: ["openai-oauth-models.json"],
|
|
49194
|
+
rosterLimitsAuthoritative: true
|
|
49195
|
+
},
|
|
49196
|
+
// api.anthropic.com with a subscription token: account-scoped windows and
|
|
49197
|
+
// effort surface differ from the public API SKU.
|
|
49198
|
+
"anthropic-oauth": {
|
|
49199
|
+
modelsDev: "anthropic",
|
|
49200
|
+
sameEndpoint: false,
|
|
49201
|
+
rosterFiles: ["anthropic-oauth-models.json"],
|
|
49202
|
+
rosterLimitsAuthoritative: true
|
|
49203
|
+
},
|
|
49204
|
+
// api.anthropic.com with an API key. Shares the OAuth roster file.
|
|
49205
|
+
anthropic: { modelsDev: "anthropic", sameEndpoint: true, rosterFiles: ["anthropic-oauth-models.json"] },
|
|
49206
|
+
// generativelanguage.googleapis.com — the endpoint models.dev `google` describes.
|
|
49207
|
+
gemini: { modelsDev: "google", sameEndpoint: true, rosterFiles: ["gemini-models.json"] },
|
|
49208
|
+
// cli-chat-proxy.grok.com, not api.x.ai.
|
|
49209
|
+
"grok-oauth": {
|
|
49210
|
+
modelsDev: "xai",
|
|
49211
|
+
sameEndpoint: false,
|
|
49212
|
+
rosterFiles: ["grok-oauth-models.json"],
|
|
49213
|
+
rosterLimitsAuthoritative: true
|
|
49214
|
+
},
|
|
49215
|
+
// api.meta.ai/v1 — the endpoint models.dev `meta` describes.
|
|
49216
|
+
"muse-code-oauth": {
|
|
49217
|
+
modelsDev: "meta",
|
|
49218
|
+
sameEndpoint: true,
|
|
49219
|
+
rosterFiles: ["muse-code-oauth-models.json"],
|
|
49220
|
+
rosterLimitsAuthoritative: true,
|
|
49221
|
+
seedRow: museSeedRow
|
|
49222
|
+
},
|
|
49223
|
+
// token-plan-*.xiaomimimo.com subscription gateway, not the public API.
|
|
49224
|
+
"mimo-oauth": {
|
|
49225
|
+
modelsDev: "xiaomi",
|
|
49226
|
+
sameEndpoint: false,
|
|
49227
|
+
rosterFiles: ["mimo-oauth-models.json"],
|
|
49228
|
+
rosterLimitsAuthoritative: true,
|
|
49229
|
+
seedRow: mimoSeedMetadata
|
|
49230
|
+
},
|
|
49231
|
+
// Relays: their own models.dev id (when published) is their own endpoint.
|
|
49232
|
+
// Effort tiers live in the wire id; a row without levels has no effort
|
|
49233
|
+
// surface (resolveAntigravityWireModel drops the effort).
|
|
49234
|
+
"antigravity-oauth": { relay: true, rosterFiles: ["antigravity-oauth-models.json"], rosterLadderFinal: true },
|
|
49235
|
+
"cursor-oauth": { relay: true },
|
|
49236
|
+
"cursor-api": { relay: true },
|
|
49237
|
+
"opencode-go": { relay: true }
|
|
49238
|
+
});
|
|
49239
|
+
var VERIFIED_CORRECTIONS = Object.freeze({
|
|
49240
|
+
"muse-code-oauth": Object.freeze({
|
|
49241
|
+
// models.dev `meta` stops this ladder at xhigh; the Muse OAuth endpoint
|
|
49242
|
+
// accepts reasoning.effort "max" for the contributor tier as for 1.3.
|
|
49243
|
+
"muse-spark-1.3-contributor": Object.freeze({
|
|
49244
|
+
reasoningOptions: Object.freeze([
|
|
49245
|
+
Object.freeze({ type: "effort", values: Object.freeze(["minimal", "low", "medium", "high", "xhigh", "max"]) })
|
|
49246
|
+
])
|
|
49247
|
+
})
|
|
49248
|
+
})
|
|
49057
49249
|
});
|
|
49058
49250
|
|
|
49059
49251
|
// src/runtime/shared/llm/model-pricing-rates.mjs
|
|
@@ -49099,7 +49291,7 @@ function projectModelsDevRow(row) {
|
|
|
49099
49291
|
if (limit) out.limit = limit;
|
|
49100
49292
|
const modalities = pickArrays(row.modalities, MODELSDEV_MODALITY_FIELDS);
|
|
49101
49293
|
if (modalities) out.modalities = modalities;
|
|
49102
|
-
if (row.reasoning ===
|
|
49294
|
+
if (typeof row.reasoning === "boolean") out.reasoning = row.reasoning;
|
|
49103
49295
|
if (Array.isArray(row.reasoning_options) && row.reasoning_options.length > 0) {
|
|
49104
49296
|
out.reasoning_options = row.reasoning_options;
|
|
49105
49297
|
}
|
|
@@ -49166,7 +49358,7 @@ function projectLitellmRow(row) {
|
|
|
49166
49358
|
out[field] = value;
|
|
49167
49359
|
}
|
|
49168
49360
|
for (const field of LITELLM_FLAG_FIELDS) {
|
|
49169
|
-
if (row[field] ===
|
|
49361
|
+
if (typeof row[field] === "boolean") out[field] = row[field];
|
|
49170
49362
|
}
|
|
49171
49363
|
for (const field of LITELLM_STRING_FIELDS) {
|
|
49172
49364
|
const value = row[field];
|
|
@@ -49326,6 +49518,37 @@ var CURSOR_PRICING = Object.freeze({
|
|
|
49326
49518
|
fast: { inputCostPerM: 30, cacheWriteCostPerM: 37.5, cacheReadCostPerM: 3, outputCostPerM: 150 }
|
|
49327
49519
|
}
|
|
49328
49520
|
});
|
|
49521
|
+
var PRICING_FIELDS = Object.freeze([
|
|
49522
|
+
...PRICING_RATE_KEYS,
|
|
49523
|
+
"pricingTiers",
|
|
49524
|
+
"fastPricing",
|
|
49525
|
+
"ultrafastPricing",
|
|
49526
|
+
"offPeakMultiplier",
|
|
49527
|
+
"outputImageCostPerM",
|
|
49528
|
+
"outputVideoCostPerM",
|
|
49529
|
+
"outputCostPerImage",
|
|
49530
|
+
"outputCostPerSecond",
|
|
49531
|
+
"outputCostPerSecondByResolution",
|
|
49532
|
+
"pricingSource",
|
|
49533
|
+
"pricingProvider",
|
|
49534
|
+
// Decides whether a cache-read rate is required, so it travels with prices.
|
|
49535
|
+
"supportsPromptCaching"
|
|
49536
|
+
]);
|
|
49537
|
+
var GUESSED_FLAGS = Object.freeze([
|
|
49538
|
+
"supportsVision",
|
|
49539
|
+
"supportsFunctionCalling",
|
|
49540
|
+
"supportsWebSearch",
|
|
49541
|
+
"supportsPromptCaching",
|
|
49542
|
+
"supportsReasoning"
|
|
49543
|
+
]);
|
|
49544
|
+
var CAPABILITY_FLAGS = Object.freeze([
|
|
49545
|
+
"supportsVision",
|
|
49546
|
+
"supportsFunctionCalling",
|
|
49547
|
+
"supportsWebSearch",
|
|
49548
|
+
"supportsPromptCaching",
|
|
49549
|
+
"supportsFastMode",
|
|
49550
|
+
"supportsReasoning"
|
|
49551
|
+
]);
|
|
49329
49552
|
|
|
49330
49553
|
// src/runtime/shared/statusline/statusline-format.mjs
|
|
49331
49554
|
var statusText = rgb(198, 198, 198);
|
|
@@ -49373,15 +49596,29 @@ function isPidAlive(value) {
|
|
|
49373
49596
|
var DEFAULT_MIXDOG_HOME = process.env.MIXDOG_HOME || join9(homedir2(), ".mixdog");
|
|
49374
49597
|
var DEFAULT_STANDALONE_DATA_DIR = join9(DEFAULT_MIXDOG_HOME, "data");
|
|
49375
49598
|
var SHELL_JOBS_SEGMENT_CACHE_MS = 1e3;
|
|
49376
|
-
var
|
|
49599
|
+
var FINISHED_SHELL_JOB_TTL_MS = 30 * 60 * 1e3;
|
|
49600
|
+
var EMPTY_SHELL_JOBS_SESSION = Object.freeze({
|
|
49601
|
+
count: 0,
|
|
49602
|
+
elapsedLabel: "",
|
|
49603
|
+
jobs: Object.freeze([]),
|
|
49604
|
+
finished: Object.freeze([])
|
|
49605
|
+
});
|
|
49377
49606
|
var EMPTY_SHELL_JOBS = Object.freeze({
|
|
49378
49607
|
count: 0,
|
|
49379
49608
|
elapsedLabel: "",
|
|
49380
49609
|
jobs: Object.freeze([]),
|
|
49381
49610
|
sessions: Object.freeze({})
|
|
49382
49611
|
});
|
|
49383
|
-
var _shellJobsSegmentCache =
|
|
49384
|
-
var _shellJobsRefreshInFlight =
|
|
49612
|
+
var _shellJobsSegmentCache = /* @__PURE__ */ new Map();
|
|
49613
|
+
var _shellJobsRefreshInFlight = /* @__PURE__ */ new Set();
|
|
49614
|
+
var SHELL_JOBS_OWNER_CACHE_TTL_MS = 6e4;
|
|
49615
|
+
function rememberShellJobs(ownerPid, value) {
|
|
49616
|
+
const at = Date.now();
|
|
49617
|
+
for (const [pid, entry] of _shellJobsSegmentCache) {
|
|
49618
|
+
if (at - entry.at > SHELL_JOBS_OWNER_CACHE_TTL_MS) _shellJobsSegmentCache.delete(pid);
|
|
49619
|
+
}
|
|
49620
|
+
_shellJobsSegmentCache.set(ownerPid, { at, value });
|
|
49621
|
+
}
|
|
49385
49622
|
function dataDir() {
|
|
49386
49623
|
return process.env.MIXDOG_DATA_DIR || DEFAULT_STANDALONE_DATA_DIR;
|
|
49387
49624
|
}
|
|
@@ -49391,15 +49628,15 @@ function shellJobsStatus({ clientHostPid, sessionId } = {}) {
|
|
|
49391
49628
|
const scope = String(sessionId ?? "").trim();
|
|
49392
49629
|
if (!ownerPid) return scoped ? EMPTY_SHELL_JOBS_SESSION : EMPTY_SHELL_JOBS;
|
|
49393
49630
|
const now = Date.now();
|
|
49394
|
-
const
|
|
49395
|
-
const fresh =
|
|
49396
|
-
if (!fresh && !_shellJobsRefreshInFlight) {
|
|
49397
|
-
_shellJobsRefreshInFlight
|
|
49631
|
+
const cached = _shellJobsSegmentCache.get(ownerPid);
|
|
49632
|
+
const fresh = cached && now - cached.at < SHELL_JOBS_SEGMENT_CACHE_MS;
|
|
49633
|
+
if (!fresh && !_shellJobsRefreshInFlight.has(ownerPid)) {
|
|
49634
|
+
_shellJobsRefreshInFlight.add(ownerPid);
|
|
49398
49635
|
refreshShellJobsStatus(ownerPid).finally(() => {
|
|
49399
|
-
_shellJobsRefreshInFlight
|
|
49636
|
+
_shellJobsRefreshInFlight.delete(ownerPid);
|
|
49400
49637
|
});
|
|
49401
49638
|
}
|
|
49402
|
-
const value =
|
|
49639
|
+
const value = cached?.value || EMPTY_SHELL_JOBS;
|
|
49403
49640
|
if (!scoped) return value;
|
|
49404
49641
|
return scope && value.sessions?.[scope] || EMPTY_SHELL_JOBS_SESSION;
|
|
49405
49642
|
}
|
|
@@ -49411,10 +49648,10 @@ async function refreshShellJobsStatus(ownerPid) {
|
|
|
49411
49648
|
try {
|
|
49412
49649
|
names = await readdir(dir);
|
|
49413
49650
|
} catch {
|
|
49414
|
-
|
|
49651
|
+
rememberShellJobs(ownerPid, value);
|
|
49415
49652
|
return;
|
|
49416
49653
|
}
|
|
49417
|
-
const { ids, ownerByJob } = listOpenShellJobs(names);
|
|
49654
|
+
const { ids, ownerByJob, doneIds } = listOpenShellJobs(names);
|
|
49418
49655
|
let count = 0;
|
|
49419
49656
|
let oldestMs = Infinity;
|
|
49420
49657
|
const jobs = [];
|
|
@@ -49428,6 +49665,7 @@ async function refreshShellJobsStatus(ownerPid) {
|
|
|
49428
49665
|
continue;
|
|
49429
49666
|
}
|
|
49430
49667
|
if (!await isShellJobAlive(detail, p, dir, id)) continue;
|
|
49668
|
+
if (detail?.foreground === true) continue;
|
|
49431
49669
|
const ownedByThisHost = ownerByJob.get(id) === ownerPid;
|
|
49432
49670
|
if (ownedByThisHost) count++;
|
|
49433
49671
|
let jobMs = Infinity;
|
|
@@ -49446,17 +49684,42 @@ async function refreshShellJobsStatus(ownerPid) {
|
|
|
49446
49684
|
};
|
|
49447
49685
|
if (ownedByThisHost) jobs.push(job);
|
|
49448
49686
|
if (!owner) continue;
|
|
49449
|
-
const bucket = bySession.get(owner) || { count: 0, oldestMs: Infinity, jobs: [] };
|
|
49687
|
+
const bucket = bySession.get(owner) || { count: 0, oldestMs: Infinity, jobs: [], finished: [] };
|
|
49450
49688
|
bucket.count += 1;
|
|
49451
49689
|
if (jobMs < bucket.oldestMs) bucket.oldestMs = jobMs;
|
|
49452
49690
|
bucket.jobs.push(job);
|
|
49453
49691
|
bySession.set(owner, bucket);
|
|
49454
49692
|
}
|
|
49693
|
+
const finishedCutoff = Date.now() - FINISHED_SHELL_JOB_TTL_MS;
|
|
49694
|
+
for (const id of doneIds) {
|
|
49695
|
+
let detail;
|
|
49696
|
+
try {
|
|
49697
|
+
detail = JSON.parse(await readFile(join9(dir, `${id}.json`), "utf-8"));
|
|
49698
|
+
} catch {
|
|
49699
|
+
continue;
|
|
49700
|
+
}
|
|
49701
|
+
if (detail?.foreground === true) continue;
|
|
49702
|
+
const owner = String(detail?.ownerSessionId ?? "").trim();
|
|
49703
|
+
if (!owner) continue;
|
|
49704
|
+
const finishedMs = Date.parse(detail?.finishedAt || detail?.recordedAt || "");
|
|
49705
|
+
if (Number.isFinite(finishedMs) && finishedMs < finishedCutoff) continue;
|
|
49706
|
+
const bucket = bySession.get(owner) || { count: 0, oldestMs: Infinity, jobs: [], finished: [] };
|
|
49707
|
+
bucket.finished.push({
|
|
49708
|
+
taskId: id,
|
|
49709
|
+
command: String(detail?.command || "").trim(),
|
|
49710
|
+
cwd: String(detail?.cwd || "").trim(),
|
|
49711
|
+
startedAt: detail?.startedAt || null,
|
|
49712
|
+
status: String(detail?.status || ""),
|
|
49713
|
+
exitCode: Number.isInteger(detail?.exitCode) ? detail.exitCode : null,
|
|
49714
|
+
finishedAt: detail?.finishedAt || detail?.recordedAt || null
|
|
49715
|
+
});
|
|
49716
|
+
bySession.set(owner, bucket);
|
|
49717
|
+
}
|
|
49455
49718
|
if (count || bySession.size) value = summarizeShellJobs({ count, oldestMs, jobs, bySession });
|
|
49456
49719
|
} catch {
|
|
49457
49720
|
value = EMPTY_SHELL_JOBS;
|
|
49458
49721
|
}
|
|
49459
|
-
|
|
49722
|
+
rememberShellJobs(ownerPid, value);
|
|
49460
49723
|
}
|
|
49461
49724
|
function listOpenShellJobs(names) {
|
|
49462
49725
|
const done = new Set(names.filter((n) => n.endsWith(".done")).map((n) => n.slice(0, -5)));
|
|
@@ -49469,7 +49732,8 @@ function listOpenShellJobs(names) {
|
|
|
49469
49732
|
}
|
|
49470
49733
|
}
|
|
49471
49734
|
const ids = names.filter((n) => n.endsWith(".json")).map((n) => n.slice(0, -5)).filter((id) => !done.has(id)).sort((a, b) => jobStampMs(b) - jobStampMs(a)).slice(0, 60);
|
|
49472
|
-
|
|
49735
|
+
const doneIds = [...done].filter((id) => names.includes(`${id}.json`)).sort((a, b) => jobStampMs(b) - jobStampMs(a)).slice(0, 30);
|
|
49736
|
+
return { ids, ownerByJob, doneIds };
|
|
49473
49737
|
}
|
|
49474
49738
|
function summarizeShellJobs({ count, oldestMs, jobs, bySession }) {
|
|
49475
49739
|
const now = Date.now();
|
|
@@ -49479,7 +49743,8 @@ function summarizeShellJobs({ count, oldestMs, jobs, bySession }) {
|
|
|
49479
49743
|
sessions[owner] = {
|
|
49480
49744
|
count: bucket.count,
|
|
49481
49745
|
elapsedLabel: Number.isFinite(bucket.oldestMs) ? formatElapsed(now - bucket.oldestMs) : "",
|
|
49482
|
-
jobs: bucket.jobs
|
|
49746
|
+
jobs: bucket.jobs,
|
|
49747
|
+
finished: bucket.finished
|
|
49483
49748
|
};
|
|
49484
49749
|
}
|
|
49485
49750
|
return { count, elapsedLabel, jobs, sessions };
|
|
@@ -56848,6 +57113,27 @@ var PROVIDER_DISPLAY_NAMES = /* @__PURE__ */ new Map([
|
|
|
56848
57113
|
["default", "Default"]
|
|
56849
57114
|
]);
|
|
56850
57115
|
var providerDisplayName = (provider) => PROVIDER_DISPLAY_NAMES.get(String(provider || "").toLowerCase()) ?? (provider || "Provider");
|
|
57116
|
+
var resolveProviderDisplayName = (provider, providerNames = null) => String(provider || "").trim().startsWith("custom-") && providerNames?.[String(provider).trim()] || providerDisplayName(provider);
|
|
57117
|
+
var loadProviderDisplayNames = async (store) => {
|
|
57118
|
+
let setup = null;
|
|
57119
|
+
try {
|
|
57120
|
+
setup = await store?.getProviderSetup?.();
|
|
57121
|
+
} catch {
|
|
57122
|
+
return {};
|
|
57123
|
+
}
|
|
57124
|
+
const names = {};
|
|
57125
|
+
for (const group of ["api", "oauth", "local"]) {
|
|
57126
|
+
const entries = setup?.[group];
|
|
57127
|
+
if (!Array.isArray(entries)) continue;
|
|
57128
|
+
for (const entry of entries) {
|
|
57129
|
+
if (!entry || typeof entry !== "object") continue;
|
|
57130
|
+
const id = String(entry.id || entry.provider || "").trim();
|
|
57131
|
+
const name = String(entry.name || entry.label || "").trim();
|
|
57132
|
+
if (id && name) names[id] = name;
|
|
57133
|
+
}
|
|
57134
|
+
}
|
|
57135
|
+
return names;
|
|
57136
|
+
};
|
|
56851
57137
|
var PROVIDER_DISPLAY_RANKS = {
|
|
56852
57138
|
default: 0,
|
|
56853
57139
|
"openai-oauth": 10,
|
|
@@ -56887,7 +57173,7 @@ var routeModelDisplayName = (route) => [
|
|
|
56887
57173
|
displayModelName(route?.model, route?.provider, route?.modelDisplay || ""),
|
|
56888
57174
|
route?.provider === DAYBREAK_PROVIDER && daybreakBlueOn(route?.modelParameters) ? "Blue" : ""
|
|
56889
57175
|
].filter(Boolean).join(" ");
|
|
56890
|
-
var groupModelsByProvider = (models) => {
|
|
57176
|
+
var groupModelsByProvider = (models, providerNames = null) => {
|
|
56891
57177
|
const providers = /* @__PURE__ */ new Map();
|
|
56892
57178
|
for (const model of models) {
|
|
56893
57179
|
if (!providers.has(model.provider)) providers.set(model.provider, []);
|
|
@@ -56896,20 +57182,22 @@ var groupModelsByProvider = (models) => {
|
|
|
56896
57182
|
const orderedProviders = [...providers.keys()].sort((a, b) => {
|
|
56897
57183
|
const rank = providerDisplayRank(a) - providerDisplayRank(b);
|
|
56898
57184
|
if (rank !== 0) return rank;
|
|
56899
|
-
const label =
|
|
57185
|
+
const label = resolveProviderDisplayName(a, providerNames).localeCompare(
|
|
57186
|
+
resolveProviderDisplayName(b, providerNames)
|
|
57187
|
+
);
|
|
56900
57188
|
if (label !== 0) return label;
|
|
56901
57189
|
return a.localeCompare(b);
|
|
56902
57190
|
});
|
|
56903
57191
|
return { providers, orderedProviders };
|
|
56904
57192
|
};
|
|
56905
|
-
var buildModelProviderItems = (models, currentRoute = null) => {
|
|
56906
|
-
const { providers, orderedProviders } = groupModelsByProvider(models);
|
|
57193
|
+
var buildModelProviderItems = (models, currentRoute = null, providerNames = null) => {
|
|
57194
|
+
const { providers, orderedProviders } = groupModelsByProvider(models, providerNames);
|
|
56907
57195
|
return orderedProviders.map((provider) => {
|
|
56908
57196
|
const providerModels = providers.get(provider) || [];
|
|
56909
57197
|
const currentModel = currentRoute?.provider === provider ? providerModels.find((model) => model.id === currentRoute.model) : null;
|
|
56910
57198
|
return {
|
|
56911
57199
|
value: `provider:${provider}`,
|
|
56912
|
-
label:
|
|
57200
|
+
label: resolveProviderDisplayName(provider, providerNames),
|
|
56913
57201
|
marker: currentModel ? "\u2713" : "",
|
|
56914
57202
|
markerColor: theme.success,
|
|
56915
57203
|
meta: currentModel ? modelRecordDisplayName(currentModel) : "",
|
|
@@ -58295,7 +58583,7 @@ function openProviderModelsPicker({ view, provider, onBack, saveRoute }) {
|
|
|
58295
58583
|
)
|
|
58296
58584
|
);
|
|
58297
58585
|
view.paint({
|
|
58298
|
-
title:
|
|
58586
|
+
title: resolveProviderDisplayName(provider, view.providerNames),
|
|
58299
58587
|
description: options.modelDescription || "Select a model. Adjust Effort with \u2190/\u2192.",
|
|
58300
58588
|
footer: (item) => modelFooter(selection, item?._model),
|
|
58301
58589
|
help: returnOnNestedCancel && returnTo ? `${MODEL_LIST_HELP} \xB7 Esc ${returnLabel}` : `${MODEL_LIST_HELP} \xB7 Esc Back`,
|
|
@@ -58390,6 +58678,7 @@ function createModelPicker({
|
|
|
58390
58678
|
return;
|
|
58391
58679
|
}
|
|
58392
58680
|
const models = normalizeModelOptions(providerModels);
|
|
58681
|
+
const providerNames = await loadProviderDisplayNames(store);
|
|
58393
58682
|
const activeRoute = options.currentRoute || {
|
|
58394
58683
|
provider: state.provider,
|
|
58395
58684
|
model: state.model,
|
|
@@ -58403,6 +58692,7 @@ function createModelPicker({
|
|
|
58403
58692
|
state,
|
|
58404
58693
|
models,
|
|
58405
58694
|
activeRoute,
|
|
58695
|
+
providerNames,
|
|
58406
58696
|
returnTo,
|
|
58407
58697
|
returnLabel,
|
|
58408
58698
|
returnOnNestedCancel,
|
|
@@ -58426,7 +58716,7 @@ function createModelPicker({
|
|
|
58426
58716
|
providerListHighlightProvider = renderOptions.highlightProvider;
|
|
58427
58717
|
}
|
|
58428
58718
|
const highlightProvider = renderOptions.highlightProvider || providerListHighlightProvider || null;
|
|
58429
|
-
const providerItems = buildModelProviderItems(models, activeRoute);
|
|
58719
|
+
const providerItems = buildModelProviderItems(models, activeRoute, providerNames);
|
|
58430
58720
|
const providerHighlight = highlightProvider || activeRoute?.provider || null;
|
|
58431
58721
|
const providerInitialIndex = Math.max(
|
|
58432
58722
|
0,
|
|
@@ -59041,7 +59331,7 @@ async function backupUserDataAsync(dataDir2, reason = "snapshot") {
|
|
|
59041
59331
|
// src/runtime/shared/provider-api-key.mjs
|
|
59042
59332
|
import { createRequire as createRequire2 } from "node:module";
|
|
59043
59333
|
var require2 = createRequire2(import.meta.url);
|
|
59044
|
-
var { getSecret, hasSecret } = require2("../../lib/keychain-cjs.cjs");
|
|
59334
|
+
var { getSecret, getSecretAsync, hasSecret } = require2("../../lib/keychain-cjs.cjs");
|
|
59045
59335
|
var AGENT_PROVIDER_ENV = Object.freeze({
|
|
59046
59336
|
openai: "OPENAI_API_KEY",
|
|
59047
59337
|
anthropic: "ANTHROPIC_API_KEY",
|
|
@@ -60767,7 +61057,7 @@ function selectableUserItems(items, limit = MAX_SELECTABLE_MESSAGES) {
|
|
|
60767
61057
|
for (let index = source.length - 1; index >= 0 && rows2.length < limit; index -= 1) {
|
|
60768
61058
|
const item = source[index];
|
|
60769
61059
|
if (item?.kind !== "user") continue;
|
|
60770
|
-
if (item?.id == null) continue;
|
|
61060
|
+
if (item?.id == null || item.archived === true) continue;
|
|
60771
61061
|
const text = String(item.text || "").trim();
|
|
60772
61062
|
if (!text) continue;
|
|
60773
61063
|
rows2.push({ id: String(item.id), text });
|
|
@@ -63486,7 +63776,7 @@ function registerStdioDeathGuards(signalCleanup) {
|
|
|
63486
63776
|
register(process.stderr, "close");
|
|
63487
63777
|
return listeners;
|
|
63488
63778
|
}
|
|
63489
|
-
async function runTui({ provider, model, toolMode, remote, forceOnboarding } = {}) {
|
|
63779
|
+
async function runTui({ provider, model, toolMode, remote, forceOnboarding, worktree } = {}) {
|
|
63490
63780
|
const startedAt = performance2.now();
|
|
63491
63781
|
bootProfile("run:start", { provider, model, toolMode, remote });
|
|
63492
63782
|
if (!process.stdin.isTTY) {
|
|
@@ -63520,7 +63810,13 @@ async function runTui({ provider, model, toolMode, remote, forceOnboarding } = {
|
|
|
63520
63810
|
);
|
|
63521
63811
|
process.stdout.write("\x1B[5 q");
|
|
63522
63812
|
process.on("exit", restoreTerminal);
|
|
63523
|
-
const storeOutcomePromise = createSessionRuntime({
|
|
63813
|
+
const storeOutcomePromise = createSessionRuntime({
|
|
63814
|
+
provider,
|
|
63815
|
+
model,
|
|
63816
|
+
toolMode,
|
|
63817
|
+
remote,
|
|
63818
|
+
worktree: worktree ?? { mode: "default" }
|
|
63819
|
+
}).then(
|
|
63524
63820
|
(store2) => ({ store: store2, error: null }),
|
|
63525
63821
|
(error) => ({ store: null, error })
|
|
63526
63822
|
);
|
package/src/tui/index.jsx
CHANGED
|
@@ -578,7 +578,7 @@ function registerStdioDeathGuards(signalCleanup) {
|
|
|
578
578
|
return listeners;
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
export async function runTui({ provider, model, toolMode, remote, forceOnboarding } = {}) {
|
|
581
|
+
export async function runTui({ provider, model, toolMode, remote, forceOnboarding, worktree } = {}) {
|
|
582
582
|
const startedAt = performance.now();
|
|
583
583
|
bootProfile('run:start', { provider, model, toolMode, remote });
|
|
584
584
|
// The React/ink TUI needs a raw-mode-capable TTY (interactive input). In a
|
|
@@ -636,7 +636,15 @@ export async function runTui({ provider, model, toolMode, remote, forceOnboardin
|
|
|
636
636
|
// Session runtime startup is independent from palette selection. Start it now and
|
|
637
637
|
// overlap its runtime import/config work with the theme read, while still
|
|
638
638
|
// awaiting the theme before the first React frame.
|
|
639
|
-
|
|
639
|
+
// An interactive Lead the user starts follows the worktree settings default
|
|
640
|
+
// unless `--worktree [name]` / `--no-worktree` decided.
|
|
641
|
+
const storeOutcomePromise = createSessionRuntime({
|
|
642
|
+
provider,
|
|
643
|
+
model,
|
|
644
|
+
toolMode,
|
|
645
|
+
remote,
|
|
646
|
+
worktree: worktree ?? { mode: 'default' },
|
|
647
|
+
}).then(
|
|
640
648
|
(store) => ({ store, error: null }),
|
|
641
649
|
(error) => ({ store: null, error })
|
|
642
650
|
);
|