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
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// One-off model selection for a spawn the user explicitly pinned to a model.
|
|
2
2
|
// The agent's preset route stays the default; this only runs when `model` is
|
|
3
|
-
// passed. The query is matched against the
|
|
4
|
-
// then exact display name, then every query
|
|
5
|
-
//
|
|
6
|
-
//
|
|
3
|
+
// passed. The query is matched against the quick/cached provider catalog —
|
|
4
|
+
// literal id, then normalized id, then exact display name, then every query
|
|
5
|
+
// word — and a catalog miss retries once on a catalog refreshed for the
|
|
6
|
+
// requested provider (concurrent misses share that refresh). One match runs;
|
|
7
|
+
// several or none fail with candidates instead of substituting another model.
|
|
7
8
|
import { clean } from './helpers.mjs';
|
|
8
9
|
|
|
9
10
|
const CANDIDATE_LIMIT = 8;
|
|
@@ -20,7 +21,7 @@ const terms = (value) =>
|
|
|
20
21
|
.filter(Boolean);
|
|
21
22
|
const label = (row) => `${row.provider}/${row.id}`;
|
|
22
23
|
|
|
23
|
-
function providerRows(rows, provider) {
|
|
24
|
+
export function providerRows(rows, provider) {
|
|
24
25
|
if (!provider) return rows;
|
|
25
26
|
const wanted = norm(provider);
|
|
26
27
|
const exact = rows.filter((row) => norm(row.provider) === wanted);
|
|
@@ -33,6 +34,8 @@ function matchModels(rows, query) {
|
|
|
33
34
|
// Nothing to match on ("???"): `[].every` would accept every row.
|
|
34
35
|
if (!words.length) return [];
|
|
35
36
|
const tiers = [
|
|
37
|
+
// A literal id wins over its normalized look-alikes (`foo-bar` vs `foo_bar`).
|
|
38
|
+
(row) => row.id === query,
|
|
36
39
|
(row) => norm(row.id) === wanted,
|
|
37
40
|
(row) => norm(row.display) === wanted,
|
|
38
41
|
(row) => words.every((word) => `${norm(row.id)} ${norm(row.display)}`.includes(word)),
|
|
@@ -49,6 +52,34 @@ function candidates(rows) {
|
|
|
49
52
|
return rows.length > CANDIDATE_LIMIT ? `${shown}, … (${rows.length} total)` : shown;
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
// A quick read answered from the loaded catalog marks every row complete.
|
|
56
|
+
// Otherwise a hit stands only when it is a literal id of the exact provider the
|
|
57
|
+
// caller named, which the full catalog would pick the same way.
|
|
58
|
+
function quickAnswerHolds(rows, hits, model, provider) {
|
|
59
|
+
if (rows.length > 0 && rows.every((row) => row.catalogComplete === true)) return true;
|
|
60
|
+
const wanted = norm(provider);
|
|
61
|
+
return hits.length > 0 && wanted !== '' && hits.every((row) => row.id === model && norm(row.provider) === wanted);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// The forced refresh in flight per catalog reader and provider scope: concurrent
|
|
65
|
+
// misses share it instead of each refreshing.
|
|
66
|
+
const refreshing = new WeakMap();
|
|
67
|
+
|
|
68
|
+
// One forced refresh, scoped to the requested provider when one is given.
|
|
69
|
+
function refreshedRows(listProviderModels, provider) {
|
|
70
|
+
if (!refreshing.has(listProviderModels)) refreshing.set(listProviderModels, new Map());
|
|
71
|
+
const inflight = refreshing.get(listProviderModels);
|
|
72
|
+
const scope = norm(provider);
|
|
73
|
+
if (!inflight.has(scope)) {
|
|
74
|
+
const request = listProviderModels({ force: true, ...(provider ? { provider } : {}) });
|
|
75
|
+
inflight.set(
|
|
76
|
+
scope,
|
|
77
|
+
request.finally(() => inflight.delete(scope))
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return inflight.get(scope);
|
|
81
|
+
}
|
|
82
|
+
|
|
52
83
|
/** Resolve args.provider/args.model to one exact catalog route. Without a
|
|
53
84
|
* catalog (headless/daemon surfaces) exact provider + model pass through. */
|
|
54
85
|
export async function resolveRequestedModel(args, listProviderModels) {
|
|
@@ -64,10 +95,20 @@ export async function resolveRequestedModel(args, listProviderModels) {
|
|
|
64
95
|
if (!terms(model).length) throw new Error(`agent spawn: model "${model}" for provider "${provider}" not found`);
|
|
65
96
|
return args;
|
|
66
97
|
}
|
|
67
|
-
|
|
98
|
+
// The quick/cached catalog answers first. A loaded catalog is final, so its
|
|
99
|
+
// hit never waits on a provider; an incomplete one (cold or partial) may
|
|
100
|
+
// lack the model that wins, or one that makes the name ambiguous, so only a
|
|
101
|
+
// literal id inside an exact, explicitly named provider is taken from it.
|
|
102
|
+
// Anything else waits for the full catalog.
|
|
103
|
+
const quickRows = await listProviderModels({ quick: true });
|
|
104
|
+
let pool = providerRows(quickRows, provider);
|
|
68
105
|
let hits = matchModels(pool, model);
|
|
106
|
+
if (!quickAnswerHolds(quickRows, hits, model, provider)) {
|
|
107
|
+
pool = providerRows(await listProviderModels(), provider);
|
|
108
|
+
hits = matchModels(pool, model);
|
|
109
|
+
}
|
|
69
110
|
if (!hits.length) {
|
|
70
|
-
pool = providerRows(await listProviderModels
|
|
111
|
+
pool = providerRows(await refreshedRows(listProviderModels, provider), provider);
|
|
71
112
|
hits = matchModels(pool, model);
|
|
72
113
|
}
|
|
73
114
|
if (hits.length === 1) return { ...args, provider: hits[0].provider, model: hits[0].id };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Pure result-rendering and finish-classification helpers.
|
|
2
2
|
import { oneLine } from '../../../runtime/shared/clean.mjs';
|
|
3
|
+
import { isActiveWorkerRow } from './job-views/agent-list.mjs';
|
|
4
|
+
import { isTerminalJobStatus } from './job-views/session-progress.mjs';
|
|
3
5
|
import { compactIso, elapsedFromStamps, stripFinalAnswerWrapper } from './helpers.mjs';
|
|
4
6
|
|
|
5
7
|
// A worker that gets truncated mid-synthesis or produces an empty terminal
|
|
@@ -32,25 +34,77 @@ export function abnormalEmptyFinishError(result, agent) {
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
const ROSTER_TAIL = 5;
|
|
38
|
+
const ROSTER_MATCH_CAP = 25;
|
|
39
|
+
|
|
40
|
+
function workerLine(worker) {
|
|
41
|
+
const status = worker.status || 'idle';
|
|
42
|
+
const stage = worker.worker_stage || worker.stage;
|
|
43
|
+
const progress = oneLine(worker.last_progress);
|
|
44
|
+
const summary = progress.length > 60 ? `${progress.slice(0, 59)}…` : progress;
|
|
45
|
+
return `- ${worker.tag} ${status}${stage && stage !== status ? `/${stage}` : ''}${summary ? ` ${summary}` : ''}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function jobLine(job) {
|
|
49
|
+
const error = job.status === 'failed' ? oneLine(job.error) : '';
|
|
50
|
+
return `- ${job.task_id} ${job.type} ${job.status} ${job.tag || '-'}${error ? ` error=${error}` : ''}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const stamp = (row) => String(row.updatedAt || row.lastUsedAt || row.finishedAt || row.startedAt || '');
|
|
54
|
+
|
|
55
|
+
// Inactive rows: newest first (stable for rows without stamps).
|
|
56
|
+
const newestFirst = (rows) => rows.slice().sort((a, b) => stamp(b).localeCompare(stamp(a)));
|
|
57
|
+
|
|
58
|
+
// Inactive rows collapse to a count plus a short tail. A `tag` filter lists the
|
|
59
|
+
// matching inactive rows (bounded) so a specific one can still be found.
|
|
60
|
+
function inactiveSection(label, rows, render, tagOf, filter) {
|
|
61
|
+
if (rows.length === 0) return [];
|
|
62
|
+
const needle = filter.toLowerCase();
|
|
63
|
+
const matched = needle
|
|
64
|
+
? rows.filter((row) =>
|
|
65
|
+
String(tagOf(row) ?? '')
|
|
66
|
+
.toLowerCase()
|
|
67
|
+
.includes(needle)
|
|
68
|
+
)
|
|
69
|
+
: null;
|
|
70
|
+
const shown = newestFirst(matched ?? rows).slice(0, matched ? ROSTER_MATCH_CAP : ROSTER_TAIL);
|
|
71
|
+
const shownFilter = filter.replace(/\s+/g, ' ');
|
|
72
|
+
const head = matched
|
|
73
|
+
? `${label}: ${rows.length} (${matched.length} match tag "${shownFilter}", showing ${shown.length})`
|
|
74
|
+
: `${label}: ${rows.length} (latest ${shown.length}; pass tag=<text> to find one)`;
|
|
75
|
+
// Bulleted: a non-bullet line would make the list read as an authored response.
|
|
76
|
+
return [`- ${head}`, ...shown.map(render)];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// The /agents roster: active workers and running tasks in full; idle/closed
|
|
80
|
+
// workers and finished tasks as counts with a bounded tail.
|
|
81
|
+
function renderRoster(value, filter = '') {
|
|
37
82
|
const workers = Array.isArray(value.workers) ? value.workers : [];
|
|
38
83
|
const jobs = Array.isArray(value.jobs) ? value.jobs : [];
|
|
39
84
|
const lines = [`agents: ${workers.length} · tasks: ${jobs.length}`];
|
|
85
|
+
const isActive = (worker) => Boolean(worker.awaitingUser) || isActiveWorkerRow(worker);
|
|
86
|
+
const isRunning = (job) => !isTerminalJobStatus(job.status);
|
|
40
87
|
// Keep list bullets: agent cards distinguish these rows from authored responses.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
88
|
+
lines.push(...workers.filter(isActive).map(workerLine));
|
|
89
|
+
lines.push(...jobs.filter(isRunning).map(jobLine));
|
|
90
|
+
lines.push(
|
|
91
|
+
...inactiveSection(
|
|
92
|
+
'idle/closed agents',
|
|
93
|
+
workers.filter((w) => !isActive(w)),
|
|
94
|
+
workerLine,
|
|
95
|
+
(w) => w.tag,
|
|
96
|
+
filter
|
|
97
|
+
)
|
|
98
|
+
);
|
|
99
|
+
lines.push(
|
|
100
|
+
...inactiveSection(
|
|
101
|
+
'finished tasks',
|
|
102
|
+
jobs.filter((j) => !isRunning(j)),
|
|
103
|
+
jobLine,
|
|
104
|
+
(j) => j.tag || j.task_id,
|
|
105
|
+
filter
|
|
106
|
+
)
|
|
107
|
+
);
|
|
54
108
|
if (workers.length === 0 && jobs.length === 0) lines.push('(no agents or tasks)');
|
|
55
109
|
return lines.join('\n');
|
|
56
110
|
}
|
|
@@ -151,11 +205,11 @@ function renderContent(value) {
|
|
|
151
205
|
return `${header}\n${stripFinalAnswerWrapper(value.content)}`;
|
|
152
206
|
}
|
|
153
207
|
|
|
154
|
-
export function renderResult(value, { includeDiagnostics = false } = {}) {
|
|
208
|
+
export function renderResult(value, { includeDiagnostics = false, listFilter = '' } = {}) {
|
|
155
209
|
if (value === undefined || value === null) return '';
|
|
156
210
|
if (typeof value === 'string') return value;
|
|
157
211
|
if (value && typeof value === 'object') {
|
|
158
|
-
if (Array.isArray(value.workers) || Array.isArray(value.jobs)) return renderRoster(value);
|
|
212
|
+
if (Array.isArray(value.workers) || Array.isArray(value.jobs)) return renderRoster(value, listFilter);
|
|
159
213
|
// close-flow results carry `closed` plus task_id: render the close outcome.
|
|
160
214
|
// close-flow results carry `closed` plus task_id: render the close outcome.
|
|
161
215
|
if (value.closed !== undefined) return renderClosed(value);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAgentProgressWatchdogAbortError,
|
|
3
|
+
noteStoppedShellJobsOnError,
|
|
3
4
|
resolveAgentWatchdogPolicy,
|
|
4
5
|
resolveHandoffMessageStartIndex,
|
|
5
6
|
turnPartialHandoff,
|
|
@@ -20,6 +21,7 @@ import { handoffContent } from '../../handoff-attachments.mjs';
|
|
|
20
21
|
import { rebindDelegation } from '../../../runtime/agent/orchestrator/session/human-gate/delegation.mjs';
|
|
21
22
|
import { settledWorkerStatus } from './worker-index/row-liveness.mjs';
|
|
22
23
|
import { whileTurnDispatched } from '../../../runtime/agent/orchestrator/session/manager/runtime-state.mjs';
|
|
24
|
+
import { takeStoppedShellJobs } from '../../../runtime/agent/orchestrator/session/manager/turn-reap.mjs';
|
|
23
25
|
|
|
24
26
|
function workerResultIdentity({ session, tag, sessionId }) {
|
|
25
27
|
return { tag, sessionId, agent: session.agent || null, provider: session.provider, model: session.model };
|
|
@@ -92,7 +94,12 @@ export function createSendFlow({ mgr, defaultCwd, sessionSurface, canUseSessionS
|
|
|
92
94
|
// the watchdog sweep re-stamps turnStartedAt at each turn boundary.
|
|
93
95
|
const watchdogPolicy = resolveAgentWatchdogPolicy(
|
|
94
96
|
sendAgent,
|
|
95
|
-
spawnFlow.agentWatchdogOverrides({
|
|
97
|
+
spawnFlow.agentWatchdogOverrides({
|
|
98
|
+
agent: sendAgent,
|
|
99
|
+
provider: session.provider,
|
|
100
|
+
model: session.model,
|
|
101
|
+
...(session.modelParameters ? { modelParameters: session.modelParameters } : {}),
|
|
102
|
+
})
|
|
96
103
|
);
|
|
97
104
|
const watchdog = spawnFlow.startProgressIdleWatchdog(sessionId, watchdogPolicy, sendAgent, {
|
|
98
105
|
onTurnStart: spawnFlow.turnStartStamper(session, tag),
|
|
@@ -146,7 +153,7 @@ export function createSendFlow({ mgr, defaultCwd, sessionSurface, canUseSessionS
|
|
|
146
153
|
finalStatus = 'idle';
|
|
147
154
|
const value = {
|
|
148
155
|
...workerResultIdentity({ session, tag, sessionId }),
|
|
149
|
-
content: watchdogStoppedHandoff(error, partial),
|
|
156
|
+
content: watchdogStoppedHandoff(error, partial, await takeStoppedShellJobs(sessionId)),
|
|
150
157
|
stallAbort: true,
|
|
151
158
|
};
|
|
152
159
|
if (job) job._terminalResultValue = value;
|
|
@@ -154,6 +161,7 @@ export function createSendFlow({ mgr, defaultCwd, sessionSurface, canUseSessionS
|
|
|
154
161
|
return value;
|
|
155
162
|
}
|
|
156
163
|
finalStatus = 'error';
|
|
164
|
+
noteStoppedShellJobsOnError(error, await takeStoppedShellJobs(sessionId));
|
|
157
165
|
reconcileJobStreamStalled(job, error);
|
|
158
166
|
throw error;
|
|
159
167
|
} finally {
|
|
@@ -77,8 +77,8 @@ export function createSpawnPreparer({
|
|
|
77
77
|
* first-response deadline and the provider's first-response budget for the
|
|
78
78
|
* routed model (headers, and first output), handed to
|
|
79
79
|
* resolveAgentWatchdogPolicy. A provider on the shared window names none. */
|
|
80
|
-
function agentWatchdogOverrides({ agent, provider, model }) {
|
|
81
|
-
const budget = getProvider(provider)?.firstResponseBudget?.(model);
|
|
80
|
+
function agentWatchdogOverrides({ agent, provider, model, modelParameters }) {
|
|
81
|
+
const budget = getProvider(provider)?.firstResponseBudget?.(model, { modelParameters });
|
|
82
82
|
return {
|
|
83
83
|
firstResponseTimeoutMs: readAgentFirstResponseTimeoutMs(agent, dataDir, STANDALONE_SOURCE_ROOT) ?? undefined,
|
|
84
84
|
providerFirstByteTimeoutMs: budget?.transportMs,
|
|
@@ -145,7 +145,12 @@ export function createSpawnPreparer({
|
|
|
145
145
|
prompt: plan.prompt,
|
|
146
146
|
watchdogPolicy: resolveAgentWatchdogPolicy(
|
|
147
147
|
plan.agent,
|
|
148
|
-
agentWatchdogOverrides({
|
|
148
|
+
agentWatchdogOverrides({
|
|
149
|
+
agent: plan.agent,
|
|
150
|
+
provider: plan.preset.provider,
|
|
151
|
+
model: plan.preset.model,
|
|
152
|
+
modelParameters: plan.preset.modelParameters,
|
|
153
|
+
})
|
|
149
154
|
),
|
|
150
155
|
};
|
|
151
156
|
}
|
|
@@ -16,6 +16,7 @@ import { abnormalEmptyFinishError } from '../render.mjs';
|
|
|
16
16
|
import { createProgressWatchdogRegistry } from '../../agent-watchdog-registry.mjs';
|
|
17
17
|
import {
|
|
18
18
|
isAgentProgressWatchdogAbortError,
|
|
19
|
+
noteStoppedShellJobsOnError,
|
|
19
20
|
resolveHandoffMessageStartIndex,
|
|
20
21
|
turnPartialHandoff,
|
|
21
22
|
watchdogPartialHandoffFromError,
|
|
@@ -27,6 +28,7 @@ import { presetDescriptor } from './spawn-prep.mjs';
|
|
|
27
28
|
import { workerStageForStatus } from '../worker-rows.mjs';
|
|
28
29
|
import { handoffContent } from '../../../handoff-attachments.mjs';
|
|
29
30
|
import { whileTurnDispatched } from '../../../../runtime/agent/orchestrator/session/manager/runtime-state.mjs';
|
|
31
|
+
import { takeStoppedShellJobs } from '../../../../runtime/agent/orchestrator/session/manager/turn-reap.mjs';
|
|
30
32
|
|
|
31
33
|
// Mid-turn worker persistence cadence. The watchdog sweep runs every second;
|
|
32
34
|
// a transcript save is far more expensive than a bookkeeping stamp, so the
|
|
@@ -209,7 +211,7 @@ export function createSpawnRunner({
|
|
|
209
211
|
tag,
|
|
210
212
|
sessionId: session.id,
|
|
211
213
|
...presetDescriptor(agent, preset, presetName),
|
|
212
|
-
content: watchdogStoppedHandoff(error, partial),
|
|
214
|
+
content: watchdogStoppedHandoff(error, partial, await takeStoppedShellJobs(session.id)),
|
|
213
215
|
stallAbort: true,
|
|
214
216
|
};
|
|
215
217
|
if (job) job._terminalResultValue = value;
|
|
@@ -217,6 +219,7 @@ export function createSpawnRunner({
|
|
|
217
219
|
return value;
|
|
218
220
|
}
|
|
219
221
|
finalStatus = 'error';
|
|
222
|
+
noteStoppedShellJobsOnError(error, await takeStoppedShellJobs(session.id));
|
|
220
223
|
reconcileJobStreamStalled(job, error);
|
|
221
224
|
throw error;
|
|
222
225
|
} finally {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { configuredAgentRouteCandidates } from '../../../runtime/shared/agent-route-config.mjs';
|
|
2
|
+
import { executionFallbacks } from '../../../runtime/shared/model-route-chain.mjs';
|
|
2
3
|
import {
|
|
3
4
|
agentPresetName,
|
|
4
5
|
clean,
|
|
@@ -29,8 +30,11 @@ export function resolveAgentSpawnPreset(config, args = {}) {
|
|
|
29
30
|
const agentName = normalizeAgentName(args.agent);
|
|
30
31
|
// The agent's stored route: config.agents, or a store bot's own folder.
|
|
31
32
|
const candidates = !clean(args.preset) ? configuredAgentRouteCandidates(config, agentName) : [];
|
|
32
|
-
const
|
|
33
|
-
const
|
|
33
|
+
const storedCandidate = candidates.find((candidate) => normalizeAgentRoute(candidate));
|
|
34
|
+
const agentRoute = storedCandidate ? normalizeAgentRoute(storedCandidate) : null;
|
|
35
|
+
const storedFallbacks = agentRoute
|
|
36
|
+
? executionFallbacks({ ...agentRoute, fallbacks: storedCandidate.fallbacks })
|
|
37
|
+
: undefined;
|
|
34
38
|
// Where the spawned session reads its fallback chain at each hop
|
|
35
39
|
// (route-fallback-chain.mjs): this agent's route, else Main's.
|
|
36
40
|
const fallbackSource = { agent: agentName };
|
|
@@ -28,7 +28,7 @@ export const AGENT_TOOL = {
|
|
|
28
28
|
agentHidden: false,
|
|
29
29
|
},
|
|
30
30
|
description:
|
|
31
|
-
'Run scoped agent work as background tasks. spawn/send return task_id immediately. Reuse one tag for one scope for its whole lifetime; give distinct tags only to independent scopes. Never mint a new tag because a session expired or was lost — same-tag spawn respawns it with the full brief.
|
|
31
|
+
'Run scoped agent work as background tasks. spawn/send return task_id immediately. Reuse one tag for one scope for its whole lifetime; give distinct tags only to independent scopes. Never mint a new tag because a session expired or was lost — same-tag spawn respawns it with the full brief. Completion notifications arrive automatically; use status/read only for manual recovery. Close finished agents yourself.',
|
|
32
32
|
inputSchema: {
|
|
33
33
|
type: 'object',
|
|
34
34
|
properties: {
|
|
@@ -36,21 +36,21 @@ export const AGENT_TOOL = {
|
|
|
36
36
|
type: 'string',
|
|
37
37
|
enum: ['spawn', 'send', 'list', 'close', 'cancel', 'status', 'read', 'cleanup'],
|
|
38
38
|
description:
|
|
39
|
-
'Required action. New spawn requires agent and one of prompt/message/file; send requires tag and one of prompt/message/file; read/status/close/cancel require task_id or tag; list/cleanup require no target.',
|
|
39
|
+
'Required action. New spawn requires agent and one of prompt/message/file; send requires tag and one of prompt/message/file; read/status/close/cancel require task_id or tag; list/cleanup require no target. list shows active agents and running tasks in full; idle/closed agents and finished tasks are counts plus a short latest tail (list with tag=<text> shows matching ones: case-insensitive substring, at most 25 per section).',
|
|
40
40
|
},
|
|
41
|
-
task_id: { type: 'string', description: 'Task ID returned by spawn/send
|
|
41
|
+
task_id: { type: 'string', description: 'Task ID returned by spawn/send.' },
|
|
42
42
|
agent: {
|
|
43
43
|
type: 'string',
|
|
44
|
-
description: 'Workflow agent id
|
|
44
|
+
description: 'Workflow agent id; same-tag reuse can inherit it.',
|
|
45
45
|
},
|
|
46
46
|
tag: {
|
|
47
47
|
type: 'string',
|
|
48
48
|
description:
|
|
49
|
-
'Stable scope handle
|
|
49
|
+
'Stable scope handle; never derive a variant by appending a number or suffix. spawn generates one when omitted.',
|
|
50
50
|
},
|
|
51
|
-
prompt: { type: 'string', description: 'Spawn task brief
|
|
52
|
-
message: { type: 'string', description: 'Send follow-up
|
|
53
|
-
file: { type: 'string', description: 'Path to task text;
|
|
51
|
+
prompt: { type: 'string', description: 'Spawn task brief.' },
|
|
52
|
+
message: { type: 'string', description: 'Send follow-up.' },
|
|
53
|
+
file: { type: 'string', description: 'Path to task text; used instead of prompt/message.' },
|
|
54
54
|
cwd: { type: 'string', description: 'Project directory for a new or respawned agent.' },
|
|
55
55
|
context: { type: 'string', description: 'Extra context for the spawn/send turn.' },
|
|
56
56
|
attachments: {
|
|
@@ -63,7 +63,7 @@ export const AGENT_TOOL = {
|
|
|
63
63
|
model: {
|
|
64
64
|
type: 'string',
|
|
65
65
|
description:
|
|
66
|
-
"Spawn only, and only when the user explicitly names a model: runs this one spawn on it instead of the agent's preset route
|
|
66
|
+
"Spawn only, and only when the user explicitly names a model: runs this one spawn on it instead of the agent's preset route. Id, display name, or words of it; ambiguous or unknown names fail with candidates. The agent still supplies role and permissions.",
|
|
67
67
|
},
|
|
68
68
|
provider: { type: 'string', description: 'Narrows model to one provider; requires model.' },
|
|
69
69
|
effort: { type: 'string', description: 'Reasoning effort for an explicit model.' },
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// One shared 1s timer sweeps every watched session, so a burst
|
|
3
3
|
// of agents costs a single interval; the timer stops as soon as the last
|
|
4
4
|
// watchdog is released. Abort policy itself lives in the runtime module.
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
|
+
import { armTurnTimeout } from '../../runtime/agent/orchestrator/session/manager/turn-reap.mjs';
|
|
5
7
|
import {
|
|
6
8
|
abortAgentProgressWatchdog,
|
|
7
9
|
agentWatchdogPolicyActive,
|
|
@@ -23,6 +25,13 @@ export function getProgressWatchdogState(mgr, sessionId) {
|
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
// This watchdog owns its timeout: arm the session's shell reap before the
|
|
29
|
+
// abort propagates, unless the turn is already stopped (the guard skips it).
|
|
30
|
+
function abortOnTimeout(controller, ctx) {
|
|
31
|
+
if (!controller?.signal?.aborted && ctx?.error) armTurnTimeout(ctx.sessionId);
|
|
32
|
+
abortAgentProgressWatchdog(controller, ctx);
|
|
33
|
+
}
|
|
34
|
+
|
|
26
35
|
export function createProgressWatchdogRegistry({ mgr }) {
|
|
27
36
|
const watched = new Map();
|
|
28
37
|
registrations.set(mgr, watched);
|
|
@@ -100,6 +109,15 @@ export function createProgressWatchdogRegistry({ mgr }) {
|
|
|
100
109
|
const abortErr = snapshot ? evaluateAgentWatchdogAbort(snapshot, now, watchdogPolicy) : null;
|
|
101
110
|
// No progress snapshot: fall back to the coarse last-progress timestamp so a
|
|
102
111
|
// session that never reports structured progress can still stall out.
|
|
112
|
+
const observe = () => {
|
|
113
|
+
try {
|
|
114
|
+
return typeof mgr.getSessionProgressObservation === 'function'
|
|
115
|
+
? mgr.getSessionProgressObservation(sessionId)
|
|
116
|
+
: null;
|
|
117
|
+
} catch {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
103
121
|
if (!abortErr && !snapshot) {
|
|
104
122
|
// start() admits a manager that provides EITHER progress source, so this
|
|
105
123
|
// fallback must not assume the coarse one exists: throwing here escaped
|
|
@@ -114,7 +132,7 @@ export function createProgressWatchdogRegistry({ mgr }) {
|
|
|
114
132
|
}
|
|
115
133
|
const last = reported || anchorTs;
|
|
116
134
|
if (watchdogPolicy.idleStaleMs > 0 && now - last > watchdogPolicy.idleStaleMs) {
|
|
117
|
-
|
|
135
|
+
abortOnTimeout(controller, {
|
|
118
136
|
sessionId,
|
|
119
137
|
agent,
|
|
120
138
|
error: new AgentStallAbortError(`agent task stale (${watchdogPolicy.idleStaleMs}ms without progress)`),
|
|
@@ -123,12 +141,14 @@ export function createProgressWatchdogRegistry({ mgr }) {
|
|
|
123
141
|
anchorTs,
|
|
124
142
|
lastProgressAt: reported,
|
|
125
143
|
iteration,
|
|
144
|
+
observation: observe(),
|
|
145
|
+
registrationId: state.registrationId,
|
|
126
146
|
});
|
|
127
147
|
}
|
|
128
148
|
return;
|
|
129
149
|
}
|
|
130
150
|
if (abortErr) {
|
|
131
|
-
|
|
151
|
+
abortOnTimeout(controller, {
|
|
132
152
|
sessionId,
|
|
133
153
|
agent,
|
|
134
154
|
error: abortErr,
|
|
@@ -137,6 +157,8 @@ export function createProgressWatchdogRegistry({ mgr }) {
|
|
|
137
157
|
now,
|
|
138
158
|
anchorTs,
|
|
139
159
|
iteration,
|
|
160
|
+
observation: observe(),
|
|
161
|
+
registrationId: state.registrationId,
|
|
140
162
|
});
|
|
141
163
|
}
|
|
142
164
|
}
|
|
@@ -151,14 +173,19 @@ export function createProgressWatchdogRegistry({ mgr }) {
|
|
|
151
173
|
state.lastSuccessfulCheckAt = Date.now();
|
|
152
174
|
} catch (error) {
|
|
153
175
|
state.error = String(error?.message || error);
|
|
154
|
-
const
|
|
176
|
+
const compared = state.lastSuccessfulCheckAt
|
|
177
|
+
? { at: state.lastSuccessfulCheckAt, field: 'last_successful_check_at' }
|
|
178
|
+
: { at: state.anchorTs, field: 'anchor_ts' };
|
|
179
|
+
const elapsed = Date.now() - compared.at;
|
|
155
180
|
if (state.watchdogPolicy.idleStaleMs > 0 && elapsed > state.watchdogPolicy.idleStaleMs) {
|
|
156
|
-
|
|
181
|
+
abortOnTimeout(state.controller, {
|
|
157
182
|
sessionId: state.sessionId,
|
|
158
183
|
agent: state.agent,
|
|
159
184
|
error: new AgentStallAbortError(`agent progress checks failed: ${state.error}`),
|
|
160
185
|
policy: state.watchdogPolicy,
|
|
161
186
|
anchorTs: state.anchorTs,
|
|
187
|
+
comparedClock: compared,
|
|
188
|
+
registrationId: state.registrationId,
|
|
162
189
|
});
|
|
163
190
|
}
|
|
164
191
|
}
|
|
@@ -177,6 +204,7 @@ export function createProgressWatchdogRegistry({ mgr }) {
|
|
|
177
204
|
return null;
|
|
178
205
|
if (typeof mgr.linkParentSignalToSession !== 'function') return null;
|
|
179
206
|
const state = {
|
|
207
|
+
registrationId: randomUUID().slice(0, 8),
|
|
180
208
|
sessionId,
|
|
181
209
|
watchdogPolicy,
|
|
182
210
|
agent,
|
|
@@ -7,6 +7,7 @@ import { resolve } from 'node:path';
|
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
import { scrubLoaderVars } from '../../../runtime/agent/orchestrator/tools/env-scrub.mjs';
|
|
9
9
|
import { withHeapCap } from '../../../runtime/shared/heap-cap.mjs';
|
|
10
|
+
import { systemProxyHandoffEnv } from '../../../runtime/shared/llm/system-proxy.mjs';
|
|
10
11
|
import { detachedSpawnOpts } from '../../../runtime/shared/spawn-flags.mjs';
|
|
11
12
|
import { forkDaemonCandidate } from '../daemon-candidate.mjs';
|
|
12
13
|
|
|
@@ -24,6 +25,7 @@ export function daemonEnv({ rootDir, dataDir, runtimeDir, leadPid }) {
|
|
|
24
25
|
scrubLoaderVars(env);
|
|
25
26
|
return {
|
|
26
27
|
...env,
|
|
28
|
+
...systemProxyHandoffEnv(),
|
|
27
29
|
MIXDOG_ROOT: rootDir,
|
|
28
30
|
MIXDOG_DATA_DIR: dataDir,
|
|
29
31
|
MIXDOG_RUNTIME_ROOT: runtimeDir,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// and attaches to whoever won. The resolved `summary()` describes this boot as
|
|
9
9
|
// observed when called, for a caller that has to give up.
|
|
10
10
|
import { fork } from 'node:child_process';
|
|
11
|
+
import { withEnvProxy } from '../../runtime/shared/llm/http-agent.mjs';
|
|
11
12
|
import { beginDaemonSpawnCapture } from './daemon-crash-capture.mjs';
|
|
12
13
|
|
|
13
14
|
export function forkDaemonCandidate({
|
|
@@ -43,7 +44,9 @@ export function forkDaemonCandidate({
|
|
|
43
44
|
cwd,
|
|
44
45
|
execArgv,
|
|
45
46
|
stdio: ['ignore', 'ignore', capture.stderrStdio, 'ipc'],
|
|
46
|
-
|
|
47
|
+
// Proxy variables (the user's or the desktop's system proxy) need
|
|
48
|
+
// NODE_USE_ENV_PROXY to reach the daemon's fetch.
|
|
49
|
+
env: withEnvProxy(env),
|
|
47
50
|
...spawnOptions,
|
|
48
51
|
});
|
|
49
52
|
} catch (error) {
|
|
@@ -4,6 +4,7 @@ import { dirname } from 'node:path';
|
|
|
4
4
|
import { detachedSpawnOpts } from '../../../runtime/shared/spawn-flags.mjs';
|
|
5
5
|
import { withHeapCap } from '../../../runtime/shared/heap-cap.mjs';
|
|
6
6
|
import { resolveRuntimeRoot } from '../../../runtime/shared/runtime-root.mjs';
|
|
7
|
+
import { systemProxyHandoffEnv } from '../../../runtime/shared/llm/system-proxy.mjs';
|
|
7
8
|
import { scrubLoaderVars } from '../../../runtime/agent/orchestrator/tools/env-scrub.mjs';
|
|
8
9
|
|
|
9
10
|
// Once a spawn crashes deterministically, short-circuit re-forks for this
|
|
@@ -33,6 +34,9 @@ function daemonEnv({ dataDir, idleTtlMs }) {
|
|
|
33
34
|
scrubLoaderVars(env);
|
|
34
35
|
return {
|
|
35
36
|
...env,
|
|
37
|
+
// The runtime and model downloads follow the system proxy this process
|
|
38
|
+
// settled; the memory process consumes the handoff at startup.
|
|
39
|
+
...systemProxyHandoffEnv(),
|
|
36
40
|
MIXDOG_DATA_DIR: dataDir,
|
|
37
41
|
MIXDOG_RUNTIME_ROOT: resolveRuntimeRoot(),
|
|
38
42
|
MIXDOG_WORKER_MODE: '1',
|
|
@@ -8,6 +8,7 @@ import { resolvePluginData } from '../../runtime/shared/plugin-paths.mjs';
|
|
|
8
8
|
import { pluginManifest } from '../../runtime/shared/plugin-manifest.mjs';
|
|
9
9
|
import { pluginMetadata } from '../../runtime/shared/plugin-metadata.mjs';
|
|
10
10
|
import { clean } from '../../runtime/shared/clean.mjs';
|
|
11
|
+
import { startGitSync } from '../../runtime/shared/git-launch.mjs';
|
|
11
12
|
|
|
12
13
|
const REGISTRY_VERSION = 1;
|
|
13
14
|
|
|
@@ -125,12 +126,15 @@ function normalizeSource(input) {
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
function runGit(args, options = {}) {
|
|
128
|
-
const result =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
const result = startGitSync(null, (command, env) =>
|
|
130
|
+
spawnSync(command, args, {
|
|
131
|
+
cwd: options.cwd,
|
|
132
|
+
env,
|
|
133
|
+
encoding: 'utf8',
|
|
134
|
+
windowsHide: true,
|
|
135
|
+
timeout: options.timeout ?? 120000,
|
|
136
|
+
})
|
|
137
|
+
);
|
|
134
138
|
if (result.status !== 0) {
|
|
135
139
|
const detail = clean(result.stderr) || clean(result.stdout) || `git ${args.join(' ')} failed`;
|
|
136
140
|
throw new Error(detail);
|