mixdog 1.4.0 → 1.4.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/package.json +3 -2
- package/scripts/build-shipped-history.mjs +115 -33
- package/scripts/check-voice-runtime-inputs.mjs +25 -0
- package/scripts/gate-local.mjs +183 -63
- package/scripts/latest-guard.mjs +21 -9
- package/scripts/lib/gate-scheduler.mjs +138 -32
- package/scripts/lib/gate-timing-reporter.mjs +16 -0
- package/scripts/lib/isolated-test-env.mjs +10 -5
- package/scripts/lib/run-node-tests.mjs +91 -66
- package/scripts/lib/scoped-temp.d.mts +16 -0
- package/scripts/lib/scoped-temp.mjs +124 -0
- package/scripts/lib/stale-temp.mjs +44 -0
- package/scripts/lib/test-failure-records.mjs +14 -1
- package/scripts/lib/test-failure-summary.mjs +16 -4
- package/scripts/lib/test-spawn-ledger.mjs +12 -3
- package/scripts/post-release-check.mjs +1 -6
- package/scripts/pptx-kit-index.mjs +17 -5
- package/scripts/suite-health.mjs +115 -24
- package/scripts/test-data-dir.mjs +10 -7
- package/scripts/test.mjs +9 -14
- package/src/agents/advisor/AGENT.md +4 -4
- package/src/agents/advisor/agent.json +1 -1
- package/src/agents/explore/AGENT.md +22 -0
- package/src/agents/explore/agent.json +6 -0
- package/src/app.mjs +4 -0
- package/src/cli.mjs +7 -0
- package/src/defaults/agents.json +7 -0
- package/src/defaults/shipped-history.json +23 -2
- package/src/defaults/skills/browser-use/SKILL.md +10 -5
- package/src/defaults/skills/code-tidy/SKILL.md +71 -102
- package/src/defaults/skills/code-tidy/references/agent-cleanup.md +66 -114
- package/src/defaults/skills/code-tidy/references/cleanup-report.md +19 -35
- package/src/defaults/skills/code-tidy/references/dead-code.md +3 -9
- package/src/defaults/skills/code-tidy/references/test-suite-slop.md +16 -27
- package/src/defaults/skills/computer-use/SKILL.md +16 -4
- package/src/defaults/skills/goal-management/SKILL.md +1 -1
- package/src/defaults/skills/setup/references/actions.md +12 -6
- package/src/defaults/skills/setup/references/surfaces.md +2 -2
- package/src/defaults/skills/setup-guide/SKILL.md +5 -2
- package/src/defaults/skills/setup-guide/model-recommendations.json +13 -0
- package/src/defaults/skills/skill-creator/SKILL.md +85 -190
- package/src/defaults/skills/skill-creator/references/design.md +70 -162
- package/src/defaults/skills/skill-creator/references/evaluation.md +33 -92
- package/src/defaults/skills/test-suite/SKILL.md +194 -0
- package/src/defaults/skills/test-suite/references/case-management.md +51 -0
- package/src/defaults/skills/test-suite/references/flaky-policy.md +39 -0
- package/src/defaults/skills/test-suite/references/reliability.md +49 -0
- package/src/defaults/skills/test-suite/references/suite-design.md +78 -0
- package/src/defaults/skills/test-suite/scripts/inventory.mjs +335 -0
- package/src/defaults/skills/visualize/SKILL.md +6 -2
- package/src/lib/rules-builder.cjs +35 -42
- package/src/output-styles/common.md +2 -2
- package/src/output-styles/simple.md +1 -1
- package/src/rules/agent/AGENT.md +5 -4
- package/src/rules/lead/LEAD.md +12 -7
- package/src/rules/shared/10-tool-workflow.md +3 -1
- package/src/rules/shared/20-research.md +3 -6
- package/src/rules/shared/40-editing.md +1 -0
- package/src/rules/shared/45-destructive.md +0 -2
- package/src/rules/shared/50-execution.md +2 -0
- package/src/rules/shared/60-verification.md +10 -9
- package/src/rules/shared/70-delivery.md +8 -9
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/abort-link.mjs +5 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +10 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +156 -24
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +13 -0
- package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +4 -1
- package/src/runtime/agent/orchestrator/cache-break-trace.mjs +2 -0
- package/src/runtime/agent/orchestrator/config.mjs +12 -7
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +8 -8
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +5 -26
- package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +3 -1
- package/src/runtime/agent/orchestrator/internal-agents.mjs +3 -14
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +122 -12
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +5 -3
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +13 -2
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +152 -58
- package/src/runtime/agent/orchestrator/mcp/client.mjs +51 -18
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +88 -54
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +42 -26
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +54 -8
- package/src/runtime/agent/orchestrator/providers/anthropic-api-recovery.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +37 -31
- package/src/runtime/agent/orchestrator/providers/anthropic-api-transport.mjs +8 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens-recovery.mjs +6 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +31 -21
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-request/initial-status.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +14 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +6 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-turn-result.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-login.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/command-code-oauth-login.mjs +1 -10
- package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/cursor.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +40 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider-keys.mjs +34 -0
- package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/devin-auth.mjs +14 -7
- package/src/runtime/agent/orchestrator/providers/devin-wire-transport.mjs +3 -2
- package/src/runtime/agent/orchestrator/providers/devin.mjs +3 -0
- package/src/runtime/agent/orchestrator/providers/gemini-response.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +248 -41
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-prefix-trace.mjs +76 -11
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +45 -6
- package/src/runtime/agent/orchestrator/providers/lib/first-output-window.mjs +58 -0
- package/src/runtime/agent/orchestrator/providers/lib/listen-on.mjs +14 -0
- package/src/runtime/agent/orchestrator/providers/lib/oauth-page.mjs +0 -18
- package/src/runtime/agent/orchestrator/providers/lib/oauth-token-utils.mjs +138 -6
- package/src/runtime/agent/orchestrator/providers/mimo-oauth-login.mjs +1 -10
- package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/model-cache.mjs +100 -33
- package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/oauth-secret-fields.fixtures.mjs +45 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/chunk-events.mjs +9 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream/stream-state.mjs +7 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-chat-stream.mjs +14 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-events.mjs +4 -2
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream-common.mjs +5 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +16 -3
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +1 -0
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events/output-items.mjs +5 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state/response-events.mjs +13 -3
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-response-state.mjs +13 -2
- package/src/runtime/agent/orchestrator/providers/openai-http-sse-watchdogs.mjs +81 -42
- package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +8 -0
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +160 -31
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +22 -12
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +7 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +49 -22
- package/src/runtime/agent/orchestrator/providers/opencode-go-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +45 -2
- package/src/runtime/agent/orchestrator/providers/vertex-ai-auth.mjs +622 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-maas.mjs +185 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai-models.mjs +445 -0
- package/src/runtime/agent/orchestrator/providers/vertex-ai.mjs +567 -0
- package/src/runtime/agent/orchestrator/runtime-core/ask-user-tool-defs.mjs +41 -13
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +2 -0
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +8 -6
- package/src/runtime/agent/orchestrator/runtime-core/session-text.mjs +7 -3
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +3 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +6 -1
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +14 -5
- package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -0
- package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +5 -2
- package/src/runtime/agent/orchestrator/session/agent-room.d.mts +30 -5
- package/src/runtime/agent/orchestrator/session/agent-room.mjs +171 -37
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +1 -3
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +102 -12
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +1 -8
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +23 -0
- package/src/runtime/agent/orchestrator/session/compact/observation-supersession.mjs +103 -23
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +160 -36
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +164 -23
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +139 -19
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +38 -7
- package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +100 -22
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +36 -6
- package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +33 -3
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +9 -2
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/provider-tool-exclusions.mjs +13 -5
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +14 -0
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +23 -4
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +23 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-exposure-migration.mjs +39 -21
- package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +13 -8
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +50 -28
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/manager/owner-route-fallbacks.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/route-fallback-chain.mjs +2 -1
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +30 -13
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +63 -6
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +35 -13
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +24 -14
- package/src/runtime/agent/orchestrator/session/manager/session-scratch-environment.mjs +70 -0
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +0 -3
- package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +10 -6
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-context.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +56 -29
- package/src/runtime/agent/orchestrator/session/manager/turn-reap.mjs +125 -0
- package/src/runtime/agent/orchestrator/session/mixy-name.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/prompt-cache-touch-store.mjs +30 -7
- package/src/runtime/agent/orchestrator/session/restart-prefix-parity.fixture.mjs +154 -0
- package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +37 -8
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +252 -39
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +163 -64
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +164 -4
- package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +142 -18
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +61 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +23 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/invocation-plan.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +4 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +46 -20
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +67 -31
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +25 -13
- package/src/runtime/agent/orchestrator/tools/builtin/lib/scoped-search-flight.mjs +9 -5
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +58 -20
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-stream.mjs +7 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +6 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-publication.mjs +23 -12
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-snapshot.mjs +6 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +1 -8
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +20 -15
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +96 -20
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +59 -10
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/federation.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- package/src/runtime/agent/orchestrator/tools/lib/isolated-test-env.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.mjs +99 -2
- package/src/runtime/agent/orchestrator/tools/lib/owned-shell-trees.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/shell-descendants.mjs +103 -13
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-background/promote-job.mjs +3 -1
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-settle.mjs +49 -15
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-spawn.mjs +45 -27
- package/src/runtime/agent/orchestrator/tools/lib/shell-run-state.mjs +34 -10
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +28 -4
- package/src/runtime/agent/orchestrator/tools/lib/wait-until-fixture.mjs +26 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +7 -2
- package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +13 -13
- package/src/runtime/channels/lib/webhook/signature.mjs +4 -1
- package/src/runtime/channels/lib/whisper-port.mjs +29 -11
- package/src/runtime/channels/lib/whisper-server.mjs +10 -1
- package/src/runtime/computer-bridge/action-schema.mjs +2 -2
- package/src/runtime/computer-bridge/core-actions.mjs +2 -2
- package/src/runtime/computer-bridge/error-recovery.mjs +5 -4
- package/src/runtime/computer-bridge/linux-action-capabilities.mjs +24 -5
- package/src/runtime/computer-bridge/linux-readiness.d.mts +7 -2
- package/src/runtime/connectors/connector-accounts-mcp.mjs +236 -103
- package/src/runtime/connectors/gmail-app-password.mjs +3 -3
- package/src/runtime/explore/explorer.mjs +93 -0
- package/src/runtime/explore/tool-defs.mjs +35 -0
- package/src/runtime/explore/tool.mjs +123 -0
- package/src/runtime/local-provider/server-process.mjs +2 -1
- package/src/runtime/media/adapters/gemini-video.mjs +4 -1
- package/src/runtime/media/adapters/xai-media.mjs +2 -1
- package/src/runtime/memory/index.mjs +4 -0
- package/src/runtime/memory/lib/embedding-provider.mjs +4 -1
- package/src/runtime/memory/lib/embedding-worker.mjs +10 -3
- package/src/runtime/memory/lib/memory-action-handlers/cycle-backfill-action.mjs +1 -7
- package/src/runtime/memory/lib/memory-chunk-quality.mjs +1 -6
- package/src/runtime/office/authoring/pdf-author-action.mjs +1 -6
- package/src/runtime/office/design/design-art-direction.mjs +29 -27
- package/src/runtime/office/pdf/pdf-writer.mjs +6 -1
- package/src/runtime/office/portable/portable-snapshot-docx.mjs +7 -1
- package/src/runtime/office/portable/portable-snapshot-shared.mjs +6 -1
- package/src/runtime/office/quality/assurance-rendered.mjs +9 -2
- package/src/runtime/office/quality/assurance-structure-docx.mjs +4 -2
- package/src/runtime/office/quality/design-review.mjs +1 -5
- package/src/runtime/office/quality/document-brief.mjs +1 -5
- package/src/runtime/office/quality/forced-break-pages.mjs +9 -6
- package/src/runtime/office/quality/quality-pipeline.mjs +1 -1
- package/src/runtime/shared/agent-route-config.mjs +17 -2
- package/src/runtime/shared/atomic-file.mjs +103 -2
- package/src/runtime/shared/background-tasks.mjs +15 -6
- package/src/runtime/shared/bot-owned-work.mjs +56 -0
- package/src/runtime/shared/connector-accounts.mjs +5 -5
- package/src/runtime/shared/connector-catalog.d.mts +11 -4
- package/src/runtime/shared/connector-catalog.mjs +60 -52
- package/src/runtime/shared/custom-provider-keys.mjs +20 -0
- package/src/runtime/shared/defaults-separation.mjs +1 -4
- package/src/runtime/shared/fetch-safe-listen.d.mts +16 -0
- package/src/runtime/shared/fetch-safe-listen.mjs +50 -0
- package/src/runtime/shared/file-has-data.mjs +26 -2
- package/src/runtime/shared/file-lock.mjs +13 -15
- package/src/runtime/shared/git-launch.d.mts +9 -0
- package/src/runtime/shared/git-launch.mjs +213 -0
- package/src/runtime/shared/git-runner-worker.mjs +2 -1
- package/src/runtime/shared/handoff-artifacts.d.mts +2 -1
- package/src/runtime/shared/handoff-artifacts.mjs +18 -8
- package/src/runtime/shared/idle-auto-clear-gate.mjs +29 -7
- package/src/runtime/shared/llm/cost.mjs +11 -2
- package/src/runtime/shared/llm/http-agent.mjs +313 -29
- package/src/runtime/shared/llm/model-catalog-projection.mjs +3 -2
- package/src/runtime/shared/llm/model-catalog.mjs +46 -6
- package/src/runtime/shared/llm/provider-catalog-registry.mjs +3 -0
- package/src/runtime/shared/llm/system-proxy.mjs +452 -0
- package/src/runtime/shared/loopback-listener.mjs +25 -2
- package/src/runtime/shared/model-route-chain.d.mts +7 -2
- package/src/runtime/shared/model-route-chain.mjs +22 -4
- package/src/runtime/shared/open-url.mjs +10 -0
- package/src/runtime/shared/provider-accounts.mjs +52 -2
- package/src/runtime/shared/session-activity-signal.mjs +14 -0
- package/src/runtime/shared/session-scratch.mjs +37 -0
- package/src/runtime/shared/staged-install-worker.mjs +5 -0
- package/src/runtime/shared/staged-update.mjs +47 -2
- package/src/runtime/shared/tool-card-model/agent-surface.mjs +1 -3
- package/src/runtime/shared/tool-card-model/card-status.mjs +15 -2
- package/src/runtime/shared/tool-result-summary.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +113 -36
- package/src/runtime/shared/tool-work-units.mjs +6 -0
- package/src/runtime/shared/turn-snapshot-store.mjs +13 -6
- package/src/runtime/shared/turn-worktree-snapshot.mjs +414 -54
- package/src/runtime/shared/worktrees/activity-gate.mjs +215 -318
- package/src/runtime/shared/worktrees/activity-ledger-worker.mjs +56 -0
- package/src/runtime/shared/worktrees/activity-ledger.mjs +391 -0
- package/src/runtime/shared/worktrees/branch-management.mjs +9 -3
- package/src/runtime/shared/worktrees/contract.mjs +4 -1
- package/src/runtime/shared/worktrees/git.mjs +72 -0
- package/src/runtime/shared/worktrees/manager.mjs +285 -168
- package/src/runtime/shared/worktrees/test-support.mjs +6 -10
- package/src/runtime/tidy/install.mjs +95 -15
- package/src/runtime/tidy/languages.mjs +17 -15
- package/src/runtime/tidy/process.mjs +7 -4
- package/src/runtime/tidy/resolve.mjs +19 -16
- package/src/runtime/tidy/runners/biome.mjs +3 -3
- package/src/runtime/tidy/tool.mjs +1 -1
- package/src/runtime/tidy/worktree.mjs +10 -6
- package/src/runtime/visualize-bridge/client.mjs +6 -1
- package/src/runtime/visualize-bridge/tool-defs.mjs +7 -2
- package/src/runtime/web-search/index.mjs +1 -1
- package/src/session-runtime/agent-home-delivery.mjs +41 -0
- package/src/session-runtime/agent-task-sessions.mjs +458 -312
- package/src/session-runtime/agent-tool-routing.mjs +8 -41
- package/src/session-runtime/boot/tools.mjs +7 -1
- package/src/session-runtime/bot-status.mjs +107 -101
- package/src/session-runtime/bot-target.mjs +38 -0
- package/src/session-runtime/channel-config-api.mjs +6 -1
- package/src/session-runtime/connector-merge-migration.mjs +18 -15
- package/src/session-runtime/conversation-import/codex-titles.mjs +88 -0
- package/src/session-runtime/conversation-import/discovery.mjs +401 -36
- package/src/session-runtime/conversation-import/service.mjs +35 -8
- package/src/session-runtime/handoff-attachments.mjs +82 -31
- package/src/session-runtime/held-requests.mjs +3 -1
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +12 -13
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +1 -0
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +2 -0
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +8 -0
- package/src/session-runtime/internal-tool-executor/reaction-tool.mjs +4 -1
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +145 -112
- package/src/session-runtime/lifecycle/cold-heir.mjs +11 -6
- package/src/session-runtime/lifecycle/session-catalog.mjs +9 -1
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +6 -1
- package/src/session-runtime/lifecycle/teardown.mjs +1 -1
- package/src/session-runtime/mcp-glue/server-catalog.mjs +16 -10
- package/src/session-runtime/mcp-glue/server-input.mjs +4 -1
- package/src/session-runtime/mixy-heartbeat.mjs +1 -1
- package/src/session-runtime/model-route/set-route.mjs +11 -2
- package/src/session-runtime/provider-auth/login.mjs +2 -2
- package/src/session-runtime/provider-catalog-cache.mjs +82 -36
- package/src/session-runtime/provider-models/catalog-load.mjs +23 -6
- package/src/session-runtime/provider-models.mjs +4 -2
- package/src/session-runtime/resource-mcp-api.mjs +98 -35
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +44 -31
- package/src/session-runtime/resource-mcp-secrets.mjs +28 -11
- package/src/session-runtime/resource-mcp-servers.mjs +5 -4
- package/src/session-runtime/resource-recall-api.mjs +6 -1
- package/src/session-runtime/runtime-feature-gates.mjs +5 -1
- package/src/session-runtime/services/agent-tool/execute.mjs +14 -9
- package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +20 -4
- package/src/session-runtime/services/agent-tool/model-select.mjs +48 -7
- package/src/session-runtime/services/agent-tool/render.mjs +71 -17
- package/src/session-runtime/services/agent-tool/send-flow.mjs +10 -2
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +8 -3
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-run.mjs +4 -1
- package/src/session-runtime/services/agent-tool/spawn-preset.mjs +6 -2
- package/src/session-runtime/services/agent-tool/tool-def.mjs +9 -9
- package/src/session-runtime/services/agent-watchdog-registry.mjs +32 -4
- package/src/session-runtime/services/channel-worker/daemon-spawn.mjs +2 -0
- package/src/session-runtime/services/daemon-candidate.mjs +4 -1
- package/src/session-runtime/services/memory-runtime-proxy/daemon-spawn.mjs +4 -0
- package/src/session-runtime/services/plugin-admin.mjs +10 -6
- package/src/session-runtime/services/provider-admin.mjs +283 -11
- package/src/session-runtime/session-turn-api.mjs +2 -0
- package/src/session-runtime/settings-builtin-tools-api.mjs +4 -1
- package/src/session-runtime/settings-system-api.mjs +1 -1
- package/src/session-runtime/setup-tool/agent-settings-actions.mjs +13 -3
- package/src/session-runtime/setup-tool/connector-widen-approval.mjs +96 -0
- package/src/session-runtime/setup-tool/executor.mjs +6 -2
- package/src/session-runtime/setup-tool/tool-defs.mjs +2 -1
- package/src/session-runtime/tool-policy/policy-stage.mjs +1 -0
- package/src/session-runtime/turn/agent-ops.mjs +23 -0
- package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +49 -11
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +5 -1
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +25 -5
- package/src/session-runtime/workflow-agents-api/onboarding.mjs +3 -3
- package/src/session-runtime/workspace/activity-guards.mjs +176 -0
- package/src/session-runtime/workspace/session-view.mjs +149 -0
- package/src/session-runtime/workspace/side-checkouts.mjs +203 -0
- package/src/session-runtime/workspace/transition-runner.mjs +188 -0
- package/src/session-runtime/workspace/transitions.mjs +108 -1041
- package/src/session-runtime/workspace/workspace-merge.mjs +132 -0
- package/src/session-runtime/workspace/worktree-intents.mjs +242 -0
- package/src/session-runtime/workspace/worktree-maintenance.mjs +80 -0
- package/src/session-runtime/workspace/worktree-setup.mjs +85 -0
- package/src/session-runtime/workspace/worktree-tool.mjs +73 -56
- package/src/standalone/daemon-desktop-runtime.mjs +2 -0
- package/src/standalone/daemon-session-control.mjs +169 -138
- package/src/standalone/daemon.mjs +7 -0
- package/src/standalone/desktop-service-registry.mjs +9 -0
- package/src/standalone/local-session-runtime.mjs +5 -1
- package/src/standalone/session-client/daemon-unavailable.mjs +3 -0
- package/src/standalone/session-client.mjs +5 -1
- package/src/standalone/session-frame-stream.mjs +83 -11
- package/src/standalone/session-protocol.mjs +4 -0
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +16 -12
- package/src/standalone/session-service/agent-tree.mjs +45 -9
- package/src/standalone/session-service/projection/transcript-window.mjs +700 -64
- package/src/standalone/session-service/session-calls/session-action.mjs +10 -3
- package/src/standalone/session-service/session-calls/session-views.mjs +160 -104
- package/src/standalone/session-service/stored-reader.mjs +127 -40
- package/src/standalone/session-transport/client-registry/client-grace.mjs +12 -9
- package/src/tui/App.jsx +154 -164
- package/src/tui/app/app-view/floating-panel.jsx +10 -4
- package/src/tui/app/app-view/text-entry-labels.mjs +1 -0
- package/src/tui/app/clipboard.mjs +21 -10
- package/src/tui/app/model-picker/route-selection/fast-parameters.mjs +1 -3
- package/src/tui/app/model-picker/route-selection.mjs +5 -6
- package/src/tui/app/prompt-handlers/use-prompt-history-nav.mjs +1 -1
- package/src/tui/app/prompt-handlers/use-prompt-interrupt.mjs +3 -0
- package/src/tui/app/prompt-submit/provider-prompts.mjs +3 -1
- package/src/tui/app/provider-setup/api-key-actions.mjs +31 -1
- package/src/tui/app/provider-setup/oauth-actions.mjs +58 -21
- package/src/tui/app/provider-setup/provider-items.mjs +8 -2
- package/src/tui/app/provider-setup-picker.mjs +29 -18
- package/src/tui/app/shell-layout/row-budgets.mjs +12 -10
- package/src/tui/app/slash-commands.mjs +1 -0
- package/src/tui/app/slash-dispatch/session-commands.mjs +46 -0
- package/src/tui/app/slash-dispatch.mjs +1 -1
- package/src/tui/app/use-btw-panel.mjs +29 -0
- package/src/tui/app/use-context-panel-refresh.mjs +31 -0
- package/src/tui/app/use-model-catalog-cache.mjs +13 -10
- package/src/tui/app/use-mouse-input.mjs +11 -0
- package/src/tui/app/use-onboarding-start.mjs +8 -3
- package/src/tui/app/use-panel-transition.mjs +10 -1
- package/src/tui/app/use-pasted-buffers.mjs +28 -20
- package/src/tui/app/use-prompt-draft-flow.mjs +7 -0
- package/src/tui/app/use-prompt-layout-rows.mjs +3 -3
- package/src/tui/app/use-prompt-queue-history.mjs +3 -2
- package/src/tui/app/use-selection-focus.mjs +11 -2
- package/src/tui/app/use-selection-geometry.mjs +18 -9
- package/src/tui/app/use-selection-paint.mjs +4 -4
- package/src/tui/app/use-selection-stitch.mjs +3 -3
- package/src/tui/app/use-slash-palette.mjs +62 -0
- package/src/tui/app/use-terminal-chrome.mjs +2 -2
- package/src/tui/app/use-transcript-activity.mjs +47 -32
- package/src/tui/app/use-transcript-follow.mjs +12 -4
- package/src/tui/app/use-transcript-scroll.mjs +46 -17
- package/src/tui/app/use-transcript-swap-reset.mjs +27 -0
- package/src/tui/app/use-transcript-window/geometry.mjs +19 -5
- package/src/tui/app/use-transcript-window/instance-state.mjs +4 -0
- package/src/tui/app/use-transcript-window/selection-shift.mjs +5 -1
- package/src/tui/app/use-transcript-window.mjs +21 -11
- package/src/tui/app/use-tui-ready.mjs +18 -0
- package/src/tui/app/use-welcome-prompt-hint.mjs +5 -0
- package/src/tui/app/use-workflow-tab-cycle.mjs +5 -3
- package/src/tui/components/Picker.jsx +27 -3
- package/src/tui/components/QuestionPanel.jsx +13 -4
- package/src/tui/components/SignInUrl.jsx +68 -0
- package/src/tui/components/TextEntryPanel.jsx +76 -46
- package/src/tui/components/sign-in-url-layout.mjs +24 -0
- package/src/tui/dist/index.mjs +1963 -1361
- package/src/tui/session/goal-turn-state.mjs +6 -2
- package/src/tui/session/session-api/controls.mjs +4 -0
- package/src/tui/session/session-api/extensions.mjs +8 -0
- package/src/tui/session/session-api/intake/abort.mjs +2 -1
- package/src/tui/session/session-api/intake.mjs +2 -0
- package/src/tui/session/session-api/integrations.mjs +2 -2
- package/src/tui/session/session-api/routes-agent-definitions.mjs +1 -0
- package/src/tui/session/session-api/settings.mjs +2 -2
- package/src/tui/session/session-flow/queue/take-entries.mjs +11 -0
- package/src/tui/session/transcript-spill/spill-writer.mjs +15 -0
- package/src/tui/session/transcript-spill.mjs +92 -4
- package/src/tui/session/transcript-store.mjs +2 -0
- package/src/ui/statusline-agents.mjs +1 -3
- package/src/defaults/skills/skill-creator/references/source-review.md +0 -94
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Per-session scratch directory under Mixdog's data directory. Processes the
|
|
2
|
+
// `shell` tool starts see it as TEMP/TMP/TMPDIR, so scratch files never land in
|
|
3
|
+
// the project, and it is removed with its session (session-delete.mjs).
|
|
4
|
+
import { mkdirSync, rmSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { resolvePluginData } from './plugin-paths.mjs';
|
|
7
|
+
|
|
8
|
+
const SESSION_ID = /^[A-Za-z0-9_-]+$/;
|
|
9
|
+
|
|
10
|
+
/** The session's scratch path (not created), or '' for an unusable id. */
|
|
11
|
+
export function sessionScratchDir(sessionId) {
|
|
12
|
+
const id = typeof sessionId === 'string' ? sessionId : '';
|
|
13
|
+
return SESSION_ID.test(id) ? join(resolvePluginData(), 'scratch', id) : '';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Create the session's scratch directory if absent; returns its path ('' without a session id). */
|
|
17
|
+
export function ensureSessionScratchDir(sessionId) {
|
|
18
|
+
const dir = sessionScratchDir(sessionId);
|
|
19
|
+
if (dir) mkdirSync(dir, { recursive: true });
|
|
20
|
+
return dir;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function removeSessionScratchDir(sessionId) {
|
|
24
|
+
const dir = sessionScratchDir(sessionId);
|
|
25
|
+
if (dir) rmSync(dir, { recursive: true, force: true });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Point an env's temp variables at the session's scratch directory. */
|
|
29
|
+
export function applySessionScratchEnv(env, sessionId) {
|
|
30
|
+
const dir = ensureSessionScratchDir(sessionId);
|
|
31
|
+
if (dir) {
|
|
32
|
+
env.TEMP = dir;
|
|
33
|
+
env.TMP = dir;
|
|
34
|
+
env.TMPDIR = dir;
|
|
35
|
+
}
|
|
36
|
+
return env;
|
|
37
|
+
}
|
|
@@ -6,8 +6,13 @@
|
|
|
6
6
|
* quitting mid-install. Does its work and exits; the swap happens on a later
|
|
7
7
|
* clean launch via performPendingSwap().
|
|
8
8
|
*/
|
|
9
|
+
import { adoptSystemProxy } from './llm/system-proxy.mjs';
|
|
9
10
|
import { runStagedInstall } from './staged-update.mjs';
|
|
10
11
|
|
|
12
|
+
// Consume the system proxy handed over by the launcher (removing it from this
|
|
13
|
+
// env); only the npm install below receives it, as npm settings.
|
|
14
|
+
adoptSystemProxy();
|
|
15
|
+
|
|
11
16
|
const version = process.argv[2] || process.env.MIXDOG_STAGE_VERSION || '';
|
|
12
17
|
runStagedInstall(version)
|
|
13
18
|
.then((r) => process.exit(r?.ok || r?.alreadyStaged || r?.inProgress ? 0 : 1))
|
|
@@ -46,6 +46,7 @@ import { dirname, basename, join } from 'node:path';
|
|
|
46
46
|
import { fileURLToPath } from 'node:url';
|
|
47
47
|
import { spawn } from 'node:child_process';
|
|
48
48
|
import { resolvePluginData } from './plugin-paths.mjs';
|
|
49
|
+
import { systemProxyHandoffEnv, systemProxyNpmEnv } from './llm/system-proxy.mjs';
|
|
49
50
|
// Same probe every discovery/lock reader uses; `process.pid` is trivially alive.
|
|
50
51
|
import { isPidAlive as pidAlive } from './pid-liveness.mjs';
|
|
51
52
|
import { sleepSync } from './sleep.mjs';
|
|
@@ -222,6 +223,38 @@ function releaseStagingLock(verDir) {
|
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
|
|
226
|
+
const DEFAULT_NPM_REGISTRY = 'https://registry.npmjs.org/';
|
|
227
|
+
|
|
228
|
+
/** The registry npm installs from (its .npmrc files included); npm's default when npm cannot say. */
|
|
229
|
+
function npmRegistry(cliJs) {
|
|
230
|
+
return new Promise((resolve) => {
|
|
231
|
+
let out = '';
|
|
232
|
+
let child;
|
|
233
|
+
try {
|
|
234
|
+
child = spawn(process.execPath, [cliJs, 'config', 'get', 'registry'], {
|
|
235
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
236
|
+
shell: false,
|
|
237
|
+
timeout: 10_000,
|
|
238
|
+
...hiddenSpawnOpts,
|
|
239
|
+
});
|
|
240
|
+
} catch {
|
|
241
|
+
resolve(DEFAULT_NPM_REGISTRY);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
child.stdout?.on('data', (chunk) => {
|
|
245
|
+
out += chunk;
|
|
246
|
+
});
|
|
247
|
+
child.once('error', () => resolve(DEFAULT_NPM_REGISTRY));
|
|
248
|
+
child.once('close', (code) => {
|
|
249
|
+
try {
|
|
250
|
+
resolve(code === 0 ? new URL(out.trim()).href : DEFAULT_NPM_REGISTRY);
|
|
251
|
+
} catch {
|
|
252
|
+
resolve(DEFAULT_NPM_REGISTRY);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
225
258
|
/**
|
|
226
259
|
* runStagedInstall(version) — perform the full staging install for one version
|
|
227
260
|
* into ~/.mixdog/data/staging/<version>. Runs to completion (awaits the npm
|
|
@@ -259,10 +292,17 @@ export async function runStagedInstall(version) {
|
|
|
259
292
|
// shell spawn (AV constraint — no shell spawns).
|
|
260
293
|
const cliJs = npmCliJsPath();
|
|
261
294
|
if (!cliJs) return { ok: false, error: 'npm-cli.js unresolved — staging skipped' };
|
|
295
|
+
// The system proxy of npm's registry, as npm's own settings for this one install.
|
|
296
|
+
const npmProxyEnv = await systemProxyNpmEnv(() => npmRegistry(cliJs));
|
|
262
297
|
const code = await new Promise((res) => {
|
|
263
298
|
let child;
|
|
264
299
|
try {
|
|
265
|
-
child = spawn(process.execPath, [cliJs, ...installArgs], {
|
|
300
|
+
child = spawn(process.execPath, [cliJs, ...installArgs], {
|
|
301
|
+
stdio: 'ignore',
|
|
302
|
+
shell: false,
|
|
303
|
+
env: { ...process.env, ...npmProxyEnv },
|
|
304
|
+
...hiddenSpawnOpts,
|
|
305
|
+
});
|
|
266
306
|
} catch {
|
|
267
307
|
res(-1);
|
|
268
308
|
return;
|
|
@@ -319,7 +359,12 @@ export function spawnStagedInstall(version) {
|
|
|
319
359
|
if (isStagedComplete(v)) return false;
|
|
320
360
|
try {
|
|
321
361
|
const worker = join(_MODULE_DIR, 'staged-install-worker.mjs');
|
|
322
|
-
|
|
362
|
+
// The worker gets the system proxy decision privately (it consumes it).
|
|
363
|
+
const child = spawn(process.execPath, [worker, v], {
|
|
364
|
+
stdio: 'ignore',
|
|
365
|
+
env: { ...process.env, ...systemProxyHandoffEnv() },
|
|
366
|
+
...detachedSpawnOpts,
|
|
367
|
+
});
|
|
323
368
|
child.once?.('error', () => {});
|
|
324
369
|
child.unref?.();
|
|
325
370
|
return true;
|
|
@@ -38,9 +38,7 @@ function agentNameFromResult(resultText) {
|
|
|
38
38
|
// The agent identity a card shows: the call's own fields, else the result
|
|
39
39
|
// envelope when the call only carried a tag/task id.
|
|
40
40
|
function agentDisplayName(args, resultText = '') {
|
|
41
|
-
return (
|
|
42
|
-
titleizeAgentName(args?.agent || args?.subagent_type || args?.name || '') || agentNameFromResult(resultText)
|
|
43
|
-
);
|
|
41
|
+
return titleizeAgentName(args?.agent || args?.subagent_type || args?.name || '') || agentNameFromResult(resultText);
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
function agentModelLabel(args) {
|
|
@@ -7,13 +7,26 @@ import { backgroundTaskFailureStatusLabel } from '../err-text.mjs';
|
|
|
7
7
|
import { agentTerminalDetail, isAgentTool } from './agent-surface.mjs';
|
|
8
8
|
import { backgroundTaskElapsed, backgroundTaskFailureDetail, isBackgroundTaskTool } from './background-task.mjs';
|
|
9
9
|
import { shellDisplayStatus } from './shell-surface.mjs';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
normalizeTerminalStatus,
|
|
12
|
+
resultControlStatus,
|
|
13
|
+
resultEnvelopeStatus,
|
|
14
|
+
shellResultElapsed,
|
|
15
|
+
} from './terminal-status.mjs';
|
|
11
16
|
import { mediaTerminalStatus } from './media-result.mjs';
|
|
12
17
|
import { gitTerminalStatus } from './git-result.mjs';
|
|
13
18
|
import { isUserControlCancellation } from '../tool-status.mjs';
|
|
14
19
|
|
|
15
20
|
// Tools whose result opens with a task/bridge envelope that reports the call's status.
|
|
16
|
-
const ENVELOPE_STATUS_TOOLS = new Set([
|
|
21
|
+
const ENVELOPE_STATUS_TOOLS = new Set([
|
|
22
|
+
'agent',
|
|
23
|
+
'bridge',
|
|
24
|
+
'task',
|
|
25
|
+
'web_search',
|
|
26
|
+
'search_query',
|
|
27
|
+
'image_query',
|
|
28
|
+
'web_search_call',
|
|
29
|
+
]);
|
|
17
30
|
|
|
18
31
|
function shellFragments(base, display, isShellSurface) {
|
|
19
32
|
if (!isShellSurface) return { shellStatus: '', shellElapsed: '' };
|
|
@@ -648,7 +648,7 @@ const summarizeAskUserResult = ({ text, translate }) => {
|
|
|
648
648
|
|
|
649
649
|
const TOOL_RESULT_SUMMARIZERS = new Map(
|
|
650
650
|
[
|
|
651
|
-
[['ask_user'], summarizeAskUserResult],
|
|
651
|
+
[['ask_user', 'handoff_user'], summarizeAskUserResult],
|
|
652
652
|
[['read', 'view_image', 'read_mcp_resource'], summarizeReadResult],
|
|
653
653
|
[['apply_patch'], summarizePatchResult],
|
|
654
654
|
[['grep'], summarizeGrepResult],
|
|
@@ -83,7 +83,7 @@ export function isTaskWaitToolCall(name, args = {}) {
|
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
function displayToolName(name, args = {}) {
|
|
87
87
|
if (isExternalMcpToolName(name)) {
|
|
88
88
|
const mcp = parseMcpToolName(name);
|
|
89
89
|
return `MCP ${titleCaseMcpServer(mcp.server)}`;
|
|
@@ -127,6 +127,8 @@ export function displayToolName(name, args = {}) {
|
|
|
127
127
|
case 'web_fetch':
|
|
128
128
|
case 'fetch':
|
|
129
129
|
return 'Fetch';
|
|
130
|
+
case 'explore':
|
|
131
|
+
return 'Explore';
|
|
130
132
|
case 'browser':
|
|
131
133
|
case 'browser_devtools':
|
|
132
134
|
return 'Browser';
|
|
@@ -151,6 +153,7 @@ export function displayToolName(name, args = {}) {
|
|
|
151
153
|
case 'request_user_input':
|
|
152
154
|
return 'Ask User';
|
|
153
155
|
case 'ask_user':
|
|
156
|
+
case 'handoff_user':
|
|
154
157
|
return 'Question';
|
|
155
158
|
case 'update_plan':
|
|
156
159
|
return 'Plan';
|
|
@@ -212,18 +215,14 @@ export function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}
|
|
|
212
215
|
}
|
|
213
216
|
switch (normalized) {
|
|
214
217
|
case 'read':
|
|
215
|
-
if (!a.path && !a.file_path) return '';
|
|
216
|
-
if (Array.isArray(a.path) || Array.isArray(a.file_path)) {
|
|
217
|
-
return formatCountedUnit(collectionCount(a.path, a.file_path), 'file');
|
|
218
|
-
}
|
|
219
|
-
return compactParts([
|
|
220
|
-
displayToolPath(a.path ?? a.file_path),
|
|
221
|
-
a.pages ? `pages ${a.pages}` : summarizeLineWindow(a),
|
|
222
|
-
]);
|
|
223
218
|
case 'view_image':
|
|
224
|
-
return displayToolPath(a.path || a.file_path || '');
|
|
225
219
|
case 'apply_patch':
|
|
226
|
-
|
|
220
|
+
case 'list':
|
|
221
|
+
case 'ls':
|
|
222
|
+
case 'grep':
|
|
223
|
+
case 'glob':
|
|
224
|
+
case 'find':
|
|
225
|
+
return summarizeFileToolArgs(normalized, a, max);
|
|
227
226
|
case 'shell':
|
|
228
227
|
case 'bash':
|
|
229
228
|
case 'bash_session':
|
|
@@ -239,6 +238,8 @@ export function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}
|
|
|
239
238
|
return summarizeGithub(a, max);
|
|
240
239
|
case 'goal':
|
|
241
240
|
return compactParts([String(a.action || ''), truncateToolText(a.objective, max)]);
|
|
241
|
+
case 'handoff_user':
|
|
242
|
+
return '';
|
|
242
243
|
case 'ask_user':
|
|
243
244
|
return truncateToolText(
|
|
244
245
|
(Array.isArray(a.questions) ? a.questions : [])
|
|
@@ -247,6 +248,82 @@ export function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}
|
|
|
247
248
|
.join(', '),
|
|
248
249
|
max
|
|
249
250
|
);
|
|
251
|
+
case 'search_query':
|
|
252
|
+
case 'image_query':
|
|
253
|
+
case 'web_search':
|
|
254
|
+
case 'web_search_call':
|
|
255
|
+
case 'load_tool':
|
|
256
|
+
case 'web_fetch':
|
|
257
|
+
case 'fetch':
|
|
258
|
+
return summarizeWebToolArgs(normalized, a, max);
|
|
259
|
+
case 'browser':
|
|
260
|
+
case 'browser_devtools':
|
|
261
|
+
case 'computer':
|
|
262
|
+
case 'terminal':
|
|
263
|
+
case 'visualize':
|
|
264
|
+
case 'office':
|
|
265
|
+
case 'media':
|
|
266
|
+
case 'tidy':
|
|
267
|
+
return summarizeInterfaceToolArgs(normalized, a, args, max);
|
|
268
|
+
case 'explore':
|
|
269
|
+
if (Array.isArray(a.query)) return formatCountedUnit(collectionCount(a.query), 'query', 'queries');
|
|
270
|
+
return truncateToolText(a.query || '', Math.min(max, 80));
|
|
271
|
+
case 'read_mcp_resource':
|
|
272
|
+
return truncateToolText(a.uri || '', max);
|
|
273
|
+
case 'list_mcp_resources':
|
|
274
|
+
case 'list_mcp_resource_templates':
|
|
275
|
+
return a.server ? `server "${truncateToolText(a.server, max)}"` : 'all servers';
|
|
276
|
+
case 'cwd':
|
|
277
|
+
case 'session':
|
|
278
|
+
case 'setup':
|
|
279
|
+
case 'memory':
|
|
280
|
+
case 'remember':
|
|
281
|
+
case 'save_memory':
|
|
282
|
+
case 'update_memory':
|
|
283
|
+
case 'recall_memory':
|
|
284
|
+
case 'recall':
|
|
285
|
+
case 'search_memories':
|
|
286
|
+
return summarizeStateToolArgs(normalized, a, max);
|
|
287
|
+
case 'bridge':
|
|
288
|
+
case 'agent': {
|
|
289
|
+
const agentModel = bridgeAgentModelSummary(a);
|
|
290
|
+
if (agentModel) return agentModel;
|
|
291
|
+
const bridgeAction = a.type || a.action || a.mode || '';
|
|
292
|
+
const showTarget = !/^(status|read)$/i.test(String(bridgeAction || ''));
|
|
293
|
+
return compactParts([bridgeAction, showTarget ? a.tag || a.sessionId || a.task_id || '' : '']);
|
|
294
|
+
}
|
|
295
|
+
case 'code_graph':
|
|
296
|
+
return codeGraphSummary(a, max);
|
|
297
|
+
case 'skill':
|
|
298
|
+
case 'skill_execute':
|
|
299
|
+
case 'skill_view':
|
|
300
|
+
case 'skills_list':
|
|
301
|
+
case 'use_skill':
|
|
302
|
+
return truncateToolText(
|
|
303
|
+
firstText(a.name, a.skill, a.skill_name, a.query, a.q, normalized === 'skills_list' ? 'all skills' : ''),
|
|
304
|
+
max
|
|
305
|
+
);
|
|
306
|
+
default:
|
|
307
|
+
return genericArgsSummary(a, max);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Files, directories and patches.
|
|
312
|
+
function summarizeFileToolArgs(normalized, a, max) {
|
|
313
|
+
switch (normalized) {
|
|
314
|
+
case 'read':
|
|
315
|
+
if (!a.path && !a.file_path) return '';
|
|
316
|
+
if (Array.isArray(a.path) || Array.isArray(a.file_path)) {
|
|
317
|
+
return formatCountedUnit(collectionCount(a.path, a.file_path), 'file');
|
|
318
|
+
}
|
|
319
|
+
return compactParts([
|
|
320
|
+
displayToolPath(a.path ?? a.file_path),
|
|
321
|
+
a.pages ? `pages ${a.pages}` : summarizeLineWindow(a),
|
|
322
|
+
]);
|
|
323
|
+
case 'view_image':
|
|
324
|
+
return displayToolPath(a.path || a.file_path || '');
|
|
325
|
+
case 'apply_patch':
|
|
326
|
+
return summarizePatch(a.patch, a.base_path);
|
|
250
327
|
case 'list':
|
|
251
328
|
case 'ls':
|
|
252
329
|
if (Array.isArray(a.path) || Array.isArray(a.dir) || Array.isArray(a.cwd)) {
|
|
@@ -281,6 +358,14 @@ export function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}
|
|
|
281
358
|
return formatCountedUnit(collectionCount(a.query, a.fuzzy), 'query', 'queries');
|
|
282
359
|
}
|
|
283
360
|
return compactParts([quoted(a.query ?? a.fuzzy, max), a.path ? `path: ${displayToolPath(a.path)}` : '']);
|
|
361
|
+
default:
|
|
362
|
+
return '';
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Search, fetch and tool-search loading.
|
|
367
|
+
function summarizeWebToolArgs(normalized, a, max) {
|
|
368
|
+
switch (normalized) {
|
|
284
369
|
case 'search_query':
|
|
285
370
|
case 'image_query':
|
|
286
371
|
case 'web_search':
|
|
@@ -300,6 +385,14 @@ export function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}
|
|
|
300
385
|
return formatCountedUnit(collectionCount(a.url, a.uri), 'URL', 'URLs');
|
|
301
386
|
}
|
|
302
387
|
return truncateToolText(a.url || a.uri || '', max);
|
|
388
|
+
default:
|
|
389
|
+
return '';
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// Bridge and interface tools: browser, computer, terminal, visualize, office, media, tidy.
|
|
394
|
+
function summarizeInterfaceToolArgs(normalized, a, args, max) {
|
|
395
|
+
switch (normalized) {
|
|
303
396
|
case 'browser':
|
|
304
397
|
case 'browser_devtools': {
|
|
305
398
|
const call = bridgeToolCall(args);
|
|
@@ -339,11 +432,14 @@ export function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}
|
|
|
339
432
|
Array.isArray(a.paths) && a.paths.length ? truncateToolText(a.paths.join(' '), max) : '',
|
|
340
433
|
a.apply === true ? 'apply' : '',
|
|
341
434
|
]);
|
|
342
|
-
|
|
343
|
-
return
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
435
|
+
default:
|
|
436
|
+
return '';
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Sessions, setup and memory.
|
|
441
|
+
function summarizeStateToolArgs(normalized, a, max) {
|
|
442
|
+
switch (normalized) {
|
|
347
443
|
case 'cwd': // legacy: old transcripts
|
|
348
444
|
case 'session':
|
|
349
445
|
return compactParts([
|
|
@@ -393,27 +489,8 @@ export function summarizeToolArgs(name, args, { max = DEFAULT_SUMMARY_MAX } = {}
|
|
|
393
489
|
a.limit || a.topK ? `top ${a.limit ?? a.topK}` : '',
|
|
394
490
|
]);
|
|
395
491
|
}
|
|
396
|
-
case 'bridge':
|
|
397
|
-
case 'agent': {
|
|
398
|
-
const agentModel = bridgeAgentModelSummary(a);
|
|
399
|
-
if (agentModel) return agentModel;
|
|
400
|
-
const bridgeAction = a.type || a.action || a.mode || '';
|
|
401
|
-
const showTarget = !/^(status|read)$/i.test(String(bridgeAction || ''));
|
|
402
|
-
return compactParts([bridgeAction, showTarget ? a.tag || a.sessionId || a.task_id || '' : '']);
|
|
403
|
-
}
|
|
404
|
-
case 'code_graph':
|
|
405
|
-
return codeGraphSummary(a, max);
|
|
406
|
-
case 'skill':
|
|
407
|
-
case 'skill_execute':
|
|
408
|
-
case 'skill_view':
|
|
409
|
-
case 'skills_list':
|
|
410
|
-
case 'use_skill':
|
|
411
|
-
return truncateToolText(
|
|
412
|
-
firstText(a.name, a.skill, a.skill_name, a.query, a.q, normalized === 'skills_list' ? 'all skills' : ''),
|
|
413
|
-
max
|
|
414
|
-
);
|
|
415
492
|
default:
|
|
416
|
-
return
|
|
493
|
+
return '';
|
|
417
494
|
}
|
|
418
495
|
}
|
|
419
496
|
|
|
@@ -20,6 +20,7 @@ export const CATEGORY_ORDER = [
|
|
|
20
20
|
'Skill',
|
|
21
21
|
'Web Research',
|
|
22
22
|
'Memory',
|
|
23
|
+
'Explore',
|
|
23
24
|
'Patch',
|
|
24
25
|
'Git',
|
|
25
26
|
'Shell',
|
|
@@ -58,6 +59,7 @@ const TOOL_CATEGORY = new Map([
|
|
|
58
59
|
['save_memory', 'Memory'],
|
|
59
60
|
['update_memory', 'Memory'],
|
|
60
61
|
['memory', 'Memory'],
|
|
62
|
+
['explore', 'Explore'],
|
|
61
63
|
['apply_patch', 'Patch'],
|
|
62
64
|
['edit', 'Patch'],
|
|
63
65
|
['strreplace', 'Patch'],
|
|
@@ -91,6 +93,7 @@ const TOOL_CATEGORY = new Map([
|
|
|
91
93
|
['goal', 'Setup'],
|
|
92
94
|
['request_user_input', 'Setup'],
|
|
93
95
|
['ask_user', 'Setup'],
|
|
96
|
+
['handoff_user', 'Setup'],
|
|
94
97
|
['update_plan', 'Setup'],
|
|
95
98
|
['skill', 'Skill'],
|
|
96
99
|
['skill_execute', 'Skill'],
|
|
@@ -115,6 +118,7 @@ const CATEGORY_COPY = new Map([
|
|
|
115
118
|
['Skill', { active: 'Loading', done: 'Loaded', noun: 'skill' }],
|
|
116
119
|
['Web Research', { active: 'Researching', done: 'Researched', noun: 'query', pluralNoun: 'queries' }],
|
|
117
120
|
['Memory', { active: 'Checking', done: 'Checked', noun: 'memory item' }],
|
|
121
|
+
['Explore', { active: 'Exploring', done: 'Explored', noun: 'query', pluralNoun: 'queries' }],
|
|
118
122
|
['Patch', { active: 'Editing', done: 'Edited', noun: 'file' }],
|
|
119
123
|
['Git', { active: 'Running', done: 'Ran', noun: 'Git command' }],
|
|
120
124
|
['Shell', { active: 'Running', done: 'Ran', noun: 'command' }],
|
|
@@ -688,6 +692,7 @@ const TOOL_UNITS = new Map([
|
|
|
688
692
|
pluralNoun: 'URLs',
|
|
689
693
|
}),
|
|
690
694
|
],
|
|
695
|
+
['explore', (a) => unitDescriptor('Explore', { count: queryCount(a, 'query') || 1 })],
|
|
691
696
|
['browser', browserUnit],
|
|
692
697
|
['browser_devtools', browserUnit],
|
|
693
698
|
['computer', () => unitDescriptor('Computer', { count: 1, active: 'Operating', done: 'Operated', noun: 'action' })],
|
|
@@ -734,6 +739,7 @@ const TOOL_UNITS = new Map([
|
|
|
734
739
|
['code_graph', codeGraphUnit],
|
|
735
740
|
['request_user_input', () => unitDescriptor('Setup', { active: 'Asking', done: 'Asked', noun: 'user' })],
|
|
736
741
|
['ask_user', () => unitDescriptor('Setup', { active: 'Asking', done: 'Asked', noun: 'user' })],
|
|
742
|
+
['handoff_user', () => unitDescriptor('Setup', { active: 'Asking', done: 'Asked', noun: 'user' })],
|
|
737
743
|
['update_plan', () => unitDescriptor('Setup', { active: 'Updating', done: 'Updated', noun: 'plan' })],
|
|
738
744
|
['list_mcp_resources', () => unitDescriptor('Setup', { active: 'Listing', done: 'Listed', noun: 'MCP resource' })],
|
|
739
745
|
[
|
|
@@ -117,16 +117,23 @@ function recordPath(sessionId) {
|
|
|
117
117
|
function chain(sessionId, task) {
|
|
118
118
|
const previous = writeChains.get(sessionId) || Promise.resolve();
|
|
119
119
|
const next = previous.then(task, task);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
() => undefined,
|
|
124
|
-
() => undefined
|
|
125
|
-
)
|
|
120
|
+
const settled = next.then(
|
|
121
|
+
() => undefined,
|
|
122
|
+
() => undefined
|
|
126
123
|
);
|
|
124
|
+
writeChains.set(sessionId, settled);
|
|
125
|
+
// A settled chain with nothing queued behind it holds no order to keep.
|
|
126
|
+
void settled.then(() => {
|
|
127
|
+
if (writeChains.get(sessionId) === settled) writeChains.delete(sessionId);
|
|
128
|
+
});
|
|
127
129
|
return next;
|
|
128
130
|
}
|
|
129
131
|
|
|
132
|
+
/** Sessions with a write chain still held (tests). */
|
|
133
|
+
export function _turnSnapshotWriteChainCountForTest() {
|
|
134
|
+
return writeChains.size;
|
|
135
|
+
}
|
|
136
|
+
|
|
130
137
|
async function readRecordFile(path) {
|
|
131
138
|
try {
|
|
132
139
|
const parsed = JSON.parse(await readFile(path, 'utf8'));
|