mixdog 1.4.1 → 1.4.3
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 +4 -3
- package/scripts/build-shipped-history.mjs +125 -33
- package/scripts/gate-local.mjs +220 -63
- package/scripts/graph-parity.mjs +8 -3
- package/scripts/lib/gate-scheduler.mjs +139 -32
- package/scripts/lib/gate-timing-reporter.mjs +16 -0
- package/scripts/lib/run-node-tests.mjs +71 -34
- package/scripts/lib/scoped-temp.mjs +1 -0
- package/scripts/lib/test-failure-records.mjs +14 -1
- package/scripts/lib/test-failure-summary.mjs +9 -4
- package/scripts/lib/test-spawn-ledger.mjs +43 -3
- package/scripts/post-release-check.mjs +26 -16
- package/scripts/pptx-kit-index.mjs +5 -6
- package/scripts/provider-pingpong-live.mjs +1 -1
- package/scripts/prune-embedding-runtime.mjs +3 -1
- package/scripts/release-paths.mjs +7 -1
- package/scripts/suite-health.mjs +110 -28
- 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/cli.mjs +7 -0
- package/src/defaults/agents.json +7 -0
- package/src/defaults/shipped-history.json +38 -2
- package/src/defaults/skills/browser-use/SKILL.md +4 -1
- 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 +12 -2
- package/src/defaults/skills/setup/SKILL.md +2 -2
- package/src/defaults/skills/setup/references/actions.md +28 -9
- package/src/defaults/skills/setup/references/surfaces.md +5 -2
- package/src/defaults/skills/setup-guide/SKILL.md +11 -3
- 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/instruction-text.cjs +36 -0
- package/src/lib/rules-builder.cjs +40 -50
- package/src/orchestration/balanced.md +23 -0
- package/src/orchestration/focused.md +22 -0
- package/src/orchestration/none.md +5 -0
- package/src/orchestration/swarm.md +24 -0
- package/src/rules/agent-mode/AGENT_MODE.md +3 -1
- package/src/rules/agent-mode/MIXY.md +2 -2
- package/src/rules/lead/LEAD.md +3 -3
- package/src/rules/shared/20-research.md +3 -6
- package/src/rules/shared/40-editing.md +1 -0
- package/src/rules/shared/60-verification.md +10 -9
- package/src/rules/shared/70-delivery.md +4 -3
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/abort-link.mjs +5 -1
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/session-prep.mjs +3 -3
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +10 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +132 -21
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +13 -9
- package/src/runtime/agent/orchestrator/agent-runtime/heartbeat-completion.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +4 -1
- package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +67 -0
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +1 -0
- package/src/runtime/agent/orchestrator/config.mjs +12 -7
- package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +7 -7
- package/src/runtime/agent/orchestrator/context/role-instructions.mjs +9 -30
- package/src/runtime/agent/orchestrator/internal-agents.mjs +3 -14
- package/src/runtime/agent/orchestrator/mcp/agent-connectors.mjs +124 -12
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +204 -49
- package/src/runtime/agent/orchestrator/mcp/client-config.mjs +16 -7
- package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +157 -57
- package/src/runtime/agent/orchestrator/mcp/client.mjs +54 -23
- package/src/runtime/agent/orchestrator/mcp/oauth-client.mjs +1 -1
- package/src/runtime/agent/orchestrator/mcp/oauth-credentials.mjs +8 -2
- package/src/runtime/agent/orchestrator/mcp/oauth-login.mjs +83 -52
- package/src/runtime/agent/orchestrator/mcp/oauth-probe.mjs +1 -1
- package/src/runtime/agent/orchestrator/mcp/oauth-provider.mjs +14 -0
- package/src/runtime/agent/orchestrator/mcp/oauth.mjs +43 -27
- package/src/runtime/agent/orchestrator/providers/account-pool.mjs +43 -8
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +30 -28
- 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-sse-turn/turn-events/content-block-stop.mjs +3 -3
- 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.mjs +1 -1
- 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/gemini-response.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/gemini-thinking.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +48 -31
- 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.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-response-normalization.mjs +4 -6
- package/src/runtime/agent/orchestrator/providers/openai-compat-responses-head-parity.json +2784 -2872
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +5 -8
- package/src/runtime/agent/orchestrator/providers/openai-oauth-login.mjs +26 -28
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload-parity.fixture.json +288 -300
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream/event-switch.mjs +3 -1
- package/src/runtime/agent/orchestrator/providers/openai-ws-watchdogs.mjs +1 -0
- 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 +33 -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 +576 -0
- package/src/runtime/agent/orchestrator/providers/xai-tool-search-head-parity.json +10 -30
- package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +32 -0
- package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +0 -11
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-availability.mjs +8 -0
- package/src/runtime/agent/orchestrator/runtime-core/deferred-tool-delta.mjs +17 -3
- package/src/runtime/agent/orchestrator/runtime-core/goal-control.mjs +47 -27
- package/src/runtime/agent/orchestrator/runtime-core/goal-deadlines.mjs +141 -10
- package/src/runtime/agent/orchestrator/runtime-core/goal-mutations.mjs +26 -63
- package/src/runtime/agent/orchestrator/runtime-core/goal-reminder.mjs +28 -3
- package/src/runtime/agent/orchestrator/runtime-core/goal-runtime.mjs +36 -11
- package/src/runtime/agent/orchestrator/runtime-core/goal-state.mjs +88 -56
- package/src/runtime/agent/orchestrator/runtime-core/goal-storage.mjs +4 -1
- package/src/runtime/agent/orchestrator/runtime-core/goal-store.mjs +51 -32
- package/src/runtime/agent/orchestrator/runtime-core/goal-text.mjs +45 -145
- package/src/runtime/agent/orchestrator/runtime-core/goal-tool-defs.mjs +15 -98
- package/src/runtime/agent/orchestrator/runtime-core/goal-tool-exec.mjs +32 -99
- package/src/runtime/agent/orchestrator/runtime-core/goal-turns.mjs +23 -78
- package/src/runtime/agent/orchestrator/runtime-core/orchestration.mjs +69 -47
- package/src/runtime/agent/orchestrator/runtime-core/todo-list.mjs +367 -0
- package/src/runtime/agent/orchestrator/runtime-core/todo-tool-defs.mjs +47 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-availability.mjs +155 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-data.mjs +12 -0
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +119 -35
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +4 -1
- package/src/runtime/agent/orchestrator/runtime-core/workflow/context.mjs +15 -6
- package/src/runtime/agent/orchestrator/runtime-core/workflow-ids.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +28 -22
- package/src/runtime/agent/orchestrator/session/agent-pool-progress.mjs +30 -0
- 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/attachment-preflight.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache-warm.mjs +94 -10
- package/src/runtime/agent/orchestrator/session/catalog-db/index.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/compact/summary-route.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +8 -12
- package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +4 -4
- package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +11 -6
- package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +6 -6
- package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +7 -3
- package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +11 -1
- package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +4 -3
- package/src/runtime/agent/orchestrator/session/human-gate/held-message.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +37 -8
- package/src/runtime/agent/orchestrator/session/human-gate/run-policy.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/image-strip-recovery.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +11 -1
- package/src/runtime/agent/orchestrator/session/loop/context-overflow.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +5 -3
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/todo-check.mjs +196 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +116 -50
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/loop/provider-tool-exclusions.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/route-fallback.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +5 -6
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +27 -3
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +18 -2
- package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +23 -1
- package/src/runtime/agent/orchestrator/session/loop/turn-limits.mjs +13 -8
- package/src/runtime/agent/orchestrator/session/loop/turn-report.mjs +35 -0
- package/src/runtime/agent/orchestrator/session/loop/usage.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +103 -50
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +9 -7
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +21 -3
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-failure.mjs +27 -11
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-open.mjs +37 -34
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-prepare.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +25 -15
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-state.mjs +79 -24
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-steering-drain.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +12 -1
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/idle-cleanup.mjs +6 -1
- package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +9 -1
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-path.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/manager/pending-spool-shard.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/prompt-settings.mjs +598 -0
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +20 -0
- package/src/runtime/agent/orchestrator/session/manager/rules-cache.mjs +22 -14
- package/src/runtime/agent/orchestrator/session/manager/runtime-liveness.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/session-close.mjs +12 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +15 -0
- package/src/runtime/agent/orchestrator/session/manager/session-fallback-title.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +56 -14
- package/src/runtime/agent/orchestrator/session/manager/session-lock.mjs +31 -0
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +59 -20
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +2 -0
- 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 +18 -4
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-context.mjs +8 -9
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +339 -88
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-recovery.mjs +135 -11
- package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +377 -104
- package/src/runtime/agent/orchestrator/session/manager/turn-durability.mjs +144 -0
- package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +48 -30
- package/src/runtime/agent/orchestrator/session/manager/turn-reap.mjs +125 -0
- package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +4 -0
- package/src/runtime/agent/orchestrator/session/manager.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/mixy-name.mjs +12 -6
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +8 -1
- package/src/runtime/agent/orchestrator/session/restart-prefix-parity.fixture.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/save-session-worker.mjs +5 -1
- package/src/runtime/agent/orchestrator/session/store/canonical-reader.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/liveness-veto.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +23 -2
- package/src/runtime/agent/orchestrator/session/store/sweep/sub-agent-retention.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/store/transcript-durability.mjs +88 -0
- package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/store-summary-log.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +243 -38
- package/src/runtime/agent/orchestrator/session/store-transcript-cache.mjs +163 -64
- package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +177 -8
- package/src/runtime/agent/orchestrator/session/store-transcript-worker.mjs +142 -18
- package/src/runtime/agent/orchestrator/session/store.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/synthetic-user-envelope.mjs +7 -1
- package/src/runtime/agent/orchestrator/session/tail-reminder-rules.mjs +9 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/agent-envelope.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/transcript-restore/user-text.mjs +2 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +3 -5
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/backgrounded-result.mjs +4 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/completed-result.mjs +6 -2
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/misuse-guard.mjs +21 -3
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/result-format.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/worktree-add-guard.mjs +77 -0
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +42 -28
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +30 -14
- package/src/runtime/agent/orchestrator/tools/builtin/lib/search-input-helpers.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +58 -20
- package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-single-fast-paths.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +20 -15
- package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +0 -10
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +95 -20
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +59 -10
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +1 -24
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary/child-kill.mjs +4 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary.mjs +1 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/calls.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/modes/symbols.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +4 -5
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +3 -4
- package/src/runtime/agent/orchestrator/tools/code-graph.mjs +4 -22
- package/src/runtime/agent/orchestrator/tools/graph-manifest.json +13 -13
- 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 +105 -15
- 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 +35 -11
- package/src/runtime/agent/orchestrator/tools/lib/shell-warm-standby.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/lib/wait-until-fixture.mjs +26 -0
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +7 -6
- package/src/runtime/agent/orchestrator/tools/shell-policy.mjs +0 -1
- package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +13 -13
- package/src/runtime/attachments/attachment-reference.mjs +1 -1
- package/src/runtime/attachments/pdf-extract.mjs +1 -1
- package/src/runtime/attachments/store.d.mts +1 -0
- package/src/runtime/attachments/store.mjs +2 -2
- package/src/runtime/channels/lib/config-reload-watch.mjs +42 -0
- package/src/runtime/channels/lib/owned-runtime/config-reload.mjs +29 -9
- package/src/runtime/channels/lib/scheduler.mjs +33 -0
- package/src/runtime/channels/lib/schedules-db.mjs +11 -4
- package/src/runtime/channels/lib/webhook/session-dispatch.mjs +4 -1
- package/src/runtime/channels/lib/webhooks-db.mjs +9 -3
- package/src/runtime/channels/lib/whisper-port.mjs +19 -10
- package/src/runtime/channels/lib/whisper-server.mjs +22 -13
- package/src/runtime/channels/lib/worker-main.mjs +9 -31
- package/src/runtime/computer-bridge/linux-readiness.mjs +10 -14
- package/src/runtime/connectors/connector-accounts-mcp.mjs +372 -103
- package/src/runtime/connectors/gmail-app-password.mjs +4 -4
- package/src/runtime/connectors/google-mcp.mjs +1 -1
- package/src/runtime/effort-judge/judge-client.mjs +2 -2
- package/src/runtime/effort-judge/judge-input.mjs +4 -4
- package/src/runtime/explore/explorer.mjs +88 -0
- package/src/runtime/explore/tool-defs.mjs +35 -0
- package/src/runtime/explore/tool.mjs +123 -0
- package/src/runtime/local-provider/hardware.mjs +1 -1
- package/src/runtime/media/adapters/codex-image.mjs +3 -3
- package/src/runtime/media/adapters/gemini-video.mjs +1 -1
- package/src/runtime/media/media-usage.mjs +1 -1
- package/src/runtime/media/store.mjs +1 -1
- package/src/runtime/memory/index.mjs +15 -1
- package/src/runtime/memory/lib/embedding-provider.mjs +4 -1
- package/src/runtime/memory/lib/embedding-reindex.mjs +27 -0
- package/src/runtime/memory/lib/embedding-worker.mjs +4 -0
- package/src/runtime/memory/lib/memory-embed.mjs +83 -14
- package/src/runtime/memory/lib/memory-process-lock.mjs +159 -36
- package/src/runtime/memory/lib/memory-text-utils.mjs +6 -1
- package/src/runtime/memory/lib/memory.mjs +17 -0
- package/src/runtime/memory/lib/pg/process.mjs +1 -1
- package/src/runtime/memory/lib/pg/supervisor.mjs +16 -96
- package/src/runtime/memory/lib/recall-hybrid/hybrid-sql.mjs +12 -3
- package/src/runtime/office/authoring/docx-html-runner.mjs +1 -1
- package/src/runtime/office/authoring/pptx-author-action.mjs +1 -1
- package/src/runtime/office/authoring/xlsx-html-build.mjs +1 -1
- package/src/runtime/office/authoring/xlsx-html-runner.mjs +1 -1
- package/src/runtime/office/capabilities.mjs +1 -1
- package/src/runtime/office/core/office-core.mjs +1 -1
- package/src/runtime/office/design/content-model.mjs +3 -3
- package/src/runtime/office/design/docx/design-docx/section.mjs +6 -6
- package/src/runtime/office/design/xlsx/design-xlsx-components.mjs +1 -1
- package/src/runtime/office/design/xlsx/design-xlsx.mjs +1 -1
- package/src/runtime/office/pdf/ocr-engine.mjs +1 -1
- package/src/runtime/office/pdf/pdf-writer.mjs +4 -4
- package/src/runtime/office/portable/portable-docx-operations.mjs +2 -2
- package/src/runtime/office/portable/portable-soffice.mjs +8 -6
- package/src/runtime/office/portable/xlsx-contract.mjs +1 -1
- package/src/runtime/office/quality/assurance-structure-docx.mjs +1 -1
- package/src/runtime/shared/agent-route-config.mjs +17 -2
- package/src/runtime/shared/atomic-file.d.mts +8 -0
- package/src/runtime/shared/atomic-file.mjs +103 -2
- package/src/runtime/shared/background-tasks.mjs +37 -10
- package/src/runtime/shared/background-wait.mjs +66 -0
- package/src/runtime/shared/child-guardian.mjs +17 -7
- package/src/runtime/shared/config.mjs +313 -16
- package/src/runtime/shared/connector-accounts.mjs +5 -5
- package/src/runtime/shared/connector-catalog.d.mts +14 -8
- package/src/runtime/shared/connector-catalog.mjs +70 -52
- package/src/runtime/shared/custom-provider-keys.mjs +20 -0
- package/src/runtime/shared/file-has-data.mjs +26 -2
- package/src/runtime/shared/file-lock.mjs +21 -18
- 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/git-runner.mjs +7 -2
- package/src/runtime/shared/idle-gc.mjs +30 -7
- package/src/runtime/shared/llm/cost.mjs +6 -1
- package/src/runtime/shared/llm/http-agent.mjs +316 -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 +453 -0
- package/src/runtime/shared/llm/usage-ledger-quota.mjs +31 -12
- package/src/runtime/shared/llm/usage-ledger-rollup.mjs +84 -8
- package/src/runtime/shared/llm/usage-ledger.mjs +3 -0
- package/src/runtime/shared/llm/usage-rollup.mjs +48 -0
- package/src/runtime/shared/maintenance-schedule.mjs +109 -0
- package/src/runtime/shared/process-runner.mjs +8 -4
- package/src/runtime/shared/provider-accounts.mjs +52 -2
- package/src/runtime/shared/routine-trigger.d.mts +13 -0
- package/src/runtime/shared/routine-trigger.mjs +34 -0
- package/src/runtime/shared/run-child.d.mts +2 -1
- package/src/runtime/shared/run-child.mjs +70 -18
- package/src/runtime/shared/session-scratch.mjs +14 -2
- package/src/runtime/shared/shipped-definitions.mjs +7 -1
- 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.golden.json +3 -12
- package/src/runtime/shared/tool-execution-contract.mjs +2 -0
- package/src/runtime/shared/tool-surface.mjs +110 -36
- package/src/runtime/shared/tool-work-units.mjs +35 -6
- package/src/runtime/shared/turn-snapshot.mjs +26 -4
- package/src/runtime/shared/turn-worktree-snapshot.mjs +409 -54
- package/src/runtime/shared/worker-requests.mjs +17 -3
- 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 +5 -3
- package/src/runtime/shared/worktrees/contract.mjs +16 -6
- package/src/runtime/shared/worktrees/dependencies.mjs +127 -89
- package/src/runtime/shared/worktrees/disk.mjs +79 -2
- package/src/runtime/shared/worktrees/git.mjs +97 -7
- package/src/runtime/shared/worktrees/include.mjs +6 -4
- package/src/runtime/shared/worktrees/maintenance.mjs +422 -30
- package/src/runtime/shared/worktrees/manager.mjs +962 -197
- package/src/runtime/shared/worktrees/settings.mjs +33 -7
- package/src/runtime/shared/worktrees/test-support.mjs +5 -1
- package/src/runtime/shared/worktrees/worker-snapshots.mjs +82 -0
- package/src/runtime/tidy/install.mjs +95 -15
- package/src/runtime/tidy/languages.mjs +17 -15
- package/src/runtime/tidy/process.mjs +9 -5
- 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 +4 -1
- package/src/runtime/visualize-bridge/tool-defs.mjs +7 -2
- package/src/runtime/web-search/index.mjs +4 -23
- package/src/runtime/web-search/lib/web-tools.mjs +2 -2
- package/src/runtime/web-search/tool-defs.mjs +17 -26
- package/src/session-runtime/agent-profile-changes.mjs +55 -4
- package/src/session-runtime/agent-task-sessions.mjs +410 -353
- package/src/session-runtime/boot/apis.mjs +27 -4
- package/src/session-runtime/boot/begin.mjs +2 -0
- package/src/session-runtime/boot/config.mjs +10 -1
- package/src/session-runtime/boot/facade.mjs +1 -0
- package/src/session-runtime/boot/providers.mjs +70 -3
- package/src/session-runtime/boot/session.mjs +2 -0
- package/src/session-runtime/boot/tools.mjs +71 -25
- package/src/session-runtime/bot-status.mjs +103 -103
- package/src/session-runtime/channel-config-api.mjs +1 -0
- package/src/session-runtime/config-change-effects.mjs +179 -0
- package/src/session-runtime/config-lifecycle/config-writers.mjs +1 -0
- package/src/session-runtime/config-lifecycle.mjs +160 -24
- package/src/session-runtime/connector-merge-migration.mjs +18 -15
- package/src/session-runtime/conversation-import/discovery.mjs +245 -47
- package/src/session-runtime/conversation-import/service.mjs +12 -5
- package/src/session-runtime/goal-facade-api.mjs +49 -3
- package/src/session-runtime/handoff-attachments.mjs +1 -1
- package/src/session-runtime/held-requests.mjs +3 -1
- package/src/session-runtime/internal-tool-executor/ask-user-tool.mjs +3 -0
- package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +3 -2
- package/src/session-runtime/internal-tool-executor/feature-tools.mjs +5 -11
- package/src/session-runtime/internal-tool-executor/knowledge-tools.mjs +8 -0
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +161 -120
- package/src/session-runtime/internal-tool-executor.mjs +12 -19
- package/src/session-runtime/lifecycle/cold-heir.mjs +7 -0
- package/src/session-runtime/lifecycle/memory-ingest.mjs +3 -3
- package/src/session-runtime/lifecycle/session-switch/session-delete.mjs +53 -5
- package/src/session-runtime/lifecycle/session-switch.mjs +13 -2
- package/src/session-runtime/lifecycle/teardown/session-close.mjs +10 -5
- package/src/session-runtime/lifecycle/teardown.mjs +1 -1
- package/src/session-runtime/lifecycle-api.mjs +1 -0
- package/src/session-runtime/mcp-glue/server-catalog.mjs +27 -10
- package/src/session-runtime/mcp-glue/server-connection.mjs +34 -8
- 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 +40 -7
- package/src/session-runtime/native-web-search/routes.mjs +3 -3
- package/src/session-runtime/provider-auth/login.mjs +2 -2
- package/src/session-runtime/provider-auth/refresh.mjs +6 -3
- package/src/session-runtime/provider-auth/setup.mjs +1 -1
- package/src/session-runtime/provider-readiness.mjs +53 -4
- package/src/session-runtime/resource-api.mjs +1 -1
- package/src/session-runtime/resource-extension-sync.mjs +4 -8
- package/src/session-runtime/resource-mcp-api.mjs +98 -35
- package/src/session-runtime/resource-mcp-connector-accounts.mjs +49 -32
- package/src/session-runtime/resource-mcp-secrets.mjs +27 -10
- package/src/session-runtime/resource-mcp-servers.mjs +5 -4
- package/src/session-runtime/resource-plugins-api.mjs +4 -0
- package/src/session-runtime/routine-executor.mjs +152 -0
- package/src/session-runtime/routine-home-turn.mjs +46 -5
- package/src/session-runtime/runtime-facade.mjs +5 -0
- package/src/session-runtime/runtime-feature-gates.mjs +2 -11
- package/src/session-runtime/schedule-session-run.mjs +1 -0
- package/src/session-runtime/services/agent-tool/job-task-reconcile.mjs +6 -1
- package/src/session-runtime/services/agent-tool/job-views/session-progress.mjs +7 -0
- package/src/session-runtime/services/agent-tool/send-flow.mjs +120 -8
- package/src/session-runtime/services/agent-tool/spawn-flow/job-start.mjs +12 -0
- package/src/session-runtime/services/agent-tool/spawn-flow/spawn-plan.mjs +5 -0
- 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 +28 -7
- package/src/session-runtime/services/agent-tool.mjs +51 -1
- package/src/session-runtime/services/agent-watchdog-registry.mjs +32 -4
- package/src/session-runtime/services/channel-admin.mjs +18 -0
- 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/hook-bus/command-handler.mjs +7 -11
- package/src/session-runtime/services/memory-runtime-proxy/daemon-spawn.mjs +4 -0
- package/src/session-runtime/services/plugin-admin.mjs +14 -6
- package/src/session-runtime/services/provider-admin.mjs +281 -10
- package/src/session-runtime/services/seeds.mjs +7 -0
- package/src/session-runtime/services/usage-stats-model.mjs +32 -11
- package/src/session-runtime/session-create/materialize.mjs +4 -2
- package/src/session-runtime/session-create/session-options.mjs +2 -0
- package/src/session-runtime/session-turn-api.mjs +2 -0
- package/src/session-runtime/settings-builtin-tools-api.mjs +5 -10
- 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 +14 -3
- package/src/session-runtime/setup-tool/extended-actions.mjs +2 -0
- package/src/session-runtime/setup-tool/settings-contract.mjs +28 -0
- package/src/session-runtime/setup-tool/tool-defs.mjs +28 -2
- package/src/session-runtime/tool-policy/agent-profile-fold.mjs +40 -43
- package/src/session-runtime/tool-policy/mode-switch.mjs +1 -1
- package/src/session-runtime/tool-policy/policy-stage.mjs +106 -8
- package/src/session-runtime/tool-policy/workflow-overlay.mjs +2 -1
- package/src/session-runtime/tool-policy-refresh.mjs +182 -5
- package/src/session-runtime/tool-surface.mjs +38 -1
- package/src/session-runtime/turn/agent-ops.mjs +33 -2
- package/src/session-runtime/turn/session-ops.mjs +2 -0
- package/src/session-runtime/turn/turn-run/turn-prepare.mjs +5 -0
- package/src/session-runtime/turn/turn-run.mjs +1 -1
- package/src/session-runtime/webhook-session-run.mjs +2 -0
- package/src/session-runtime/workflow-agents-api/agent-connectors.mjs +46 -11
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +2 -0
- package/src/session-runtime/workflow-agents-api/instruction-files.mjs +165 -0
- package/src/session-runtime/workflow-agents-api/style-and-mode.mjs +5 -4
- package/src/session-runtime/workflow-agents-api/workflow-packs.mjs +2 -3
- package/src/session-runtime/workflow-agents-api.mjs +2 -0
- package/src/session-runtime/workspace/activity-guards.mjs +176 -0
- package/src/session-runtime/workspace/project-branches.mjs +1 -1
- 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 +128 -1070
- 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 +200 -0
- package/src/session-runtime/workspace/worktree-setup.mjs +97 -0
- package/src/session-runtime/workspace/worktree-tool.mjs +70 -54
- package/src/standalone/daemon-agent-control.mjs +25 -8
- package/src/standalone/daemon-desktop-runtime.mjs +8 -2
- package/src/standalone/daemon-lag-profiler.mjs +7 -7
- package/src/standalone/daemon-session-control.mjs +151 -136
- package/src/standalone/daemon.mjs +61 -2
- package/src/standalone/desktop-service-registry.mjs +9 -0
- package/src/standalone/local-session-runtime.mjs +21 -1
- package/src/standalone/session-client/daemon-unavailable.mjs +4 -1
- package/src/standalone/session-client.mjs +5 -1
- package/src/standalone/session-frame-stream.mjs +83 -11
- package/src/standalone/session-protocol.mjs +15 -0
- package/src/standalone/session-service/agent-route-follow.mjs +23 -20
- package/src/standalone/session-service/agent-tree/agent-turns.mjs +18 -6
- 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/quota-resume.mjs +9 -0
- package/src/standalone/session-service/session-calls/session-action.mjs +51 -1
- package/src/standalone/session-service/session-calls/session-turns.mjs +37 -18
- package/src/standalone/session-service/session-calls/session-views.mjs +160 -104
- package/src/standalone/session-service/session-calls/turn-gate.mjs +34 -0
- package/src/standalone/session-service/session-calls.mjs +2 -1
- package/src/standalone/session-service/stored-reader.mjs +127 -40
- package/src/tui/App.jsx +162 -164
- package/src/tui/app/app-view/floating-panel.jsx +3 -0
- package/src/tui/app/app-view/text-entry-labels.mjs +1 -0
- package/src/tui/app/clipboard.mjs +22 -11
- package/src/tui/app/create-app-pickers.mjs +2 -0
- package/src/tui/app/doctor.mjs +2 -2
- package/src/tui/app/panel-signature.mjs +1 -1
- 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 +25 -6
- package/src/tui/app/provider-setup-picker.mjs +20 -13
- package/src/tui/app/settings-picker.mjs +53 -8
- package/src/tui/app/shell-layout/row-budgets.mjs +14 -12
- package/src/tui/app/slash-commands.mjs +2 -1
- package/src/tui/app/slash-dispatch/route-commands.mjs +1 -1
- package/src/tui/app/slash-dispatch/session-commands.mjs +47 -1
- 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 +5 -4
- 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 +48 -33
- 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 +20 -6
- 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/SignInUrl.jsx +68 -0
- package/src/tui/components/TextEntryPanel.jsx +76 -46
- package/src/tui/components/prompt-input/escape-policy.d.mts +0 -1
- package/src/tui/components/prompt-input/escape-policy.mjs +1 -1
- package/src/tui/components/question-panel-model.mjs +4 -4
- package/src/tui/components/sign-in-url-layout.mjs +24 -0
- package/src/tui/components/tool-execution/standard-card.jsx +3 -4
- package/src/tui/components/user-message-skills.mjs +1 -1
- package/src/tui/dist/index.mjs +2205 -1371
- package/src/tui/markdown/render-ansi.mjs +1 -1
- package/src/tui/session/agent-job-feed/notification-router.mjs +10 -0
- package/src/tui/session/agent-job-feed.mjs +2 -0
- package/src/tui/session/context-state.mjs +3 -0
- package/src/tui/session/goal-turn-state.mjs +6 -2
- package/src/tui/session/quota-resume.mjs +1 -1
- 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/lifecycle/dispose.mjs +1 -0
- package/src/tui/session/session-api/lifecycle/session-reset.mjs +7 -0
- package/src/tui/session/session-api/routes-agent-definitions.mjs +6 -0
- package/src/tui/session/session-api/settings.mjs +2 -2
- package/src/tui/session/session-api/worktree.mjs +13 -1
- package/src/tui/session/session-flow/drain.mjs +11 -14
- package/src/tui/session/tool-card-results/grouped-result.mjs +2 -2
- 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/tui/session/turn-quiet.mjs +1 -1
- package/src/tui/session/turn.mjs +3 -0
- package/src/tui/session/worktree-setup-notice.mjs +1 -1
- package/src/tui/spinner-meta.mjs +3 -3
- package/src/tui/spinner-verbs.mjs +2 -2
- package/src/defaults/skills/goal-management/SKILL.md +0 -169
- package/src/defaults/skills/skill-creator/references/source-review.md +0 -94
- package/src/runtime/agent/orchestrator/runtime-core/goal-tasks.mjs +0 -156
- package/src/session-runtime/goal-tasks.mjs +0 -1
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* and never while the turn waits on the user's approval (`awaitingUser`).
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { appendAgentTrace } from '../agent-trace-io.mjs';
|
|
11
|
+
import { appendAgentTrace, normalizeSessionId, _appendToolFailureRow } from '../agent-trace-io.mjs';
|
|
12
12
|
import { getHiddenAgent } from '../internal-agents.mjs';
|
|
13
|
+
import { PACKAGE_VERSION } from '../../../web-search/lib/package-version.mjs';
|
|
13
14
|
import { envNonNegativeInt, envPresent } from '../../../shared/env.mjs';
|
|
14
15
|
import {
|
|
15
16
|
PROVIDER_FIRST_BYTE_TIMEOUT_MS,
|
|
@@ -126,22 +127,115 @@ export function partialHandoffTextFromSession(session, messageStartIndex = 0) {
|
|
|
126
127
|
/** Owner-facing handoff for a watchdog-stopped agent: the stop and its reason
|
|
127
128
|
* come first, so the owner never mistakes the partial text for a finished
|
|
128
129
|
* result or a user cancel. */
|
|
129
|
-
export function watchdogStoppedHandoff(error, partial) {
|
|
130
|
-
|
|
130
|
+
export function watchdogStoppedHandoff(error, partial, shellJobs) {
|
|
131
|
+
const note = stoppedShellJobsNote(shellJobs);
|
|
132
|
+
return `[Agent stopped by the progress watchdog: ${error.message}. The output below is partial.]${note ? `\n${note}` : ''}\n\n${partial}`;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
// Jobs confirmed gone are "stopped"; the others were killed but their
|
|
136
|
+
// processes are not yet confirmed gone, so they are "still stopping".
|
|
137
|
+
function stoppedShellJobsNote({ stopped = [], stopping = [] } = {}) {
|
|
138
|
+
return [
|
|
139
|
+
stopped.length > 0 && `[Stopped its background shell jobs: ${stopped.join(', ')}.]`,
|
|
140
|
+
stopping.length > 0 && `[Still stopping its background shell jobs: ${stopping.join(', ')}.]`,
|
|
141
|
+
]
|
|
142
|
+
.filter(Boolean)
|
|
143
|
+
.join(' ');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** A stall with no partial output is rethrown as the error: name the stopped
|
|
147
|
+
* jobs in its text so the caller still learns them. */
|
|
148
|
+
export function noteStoppedShellJobsOnError(error, shellJobs) {
|
|
149
|
+
const note = stoppedShellJobsNote(shellJobs);
|
|
150
|
+
if (note && error && typeof error === 'object') error.message = `${error.message} ${note}`;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// The timestamp the stop was measured from, and which clock it is.
|
|
154
|
+
function resolveWatchdogAbortClock({ snapshot, policy, anchorTs, lastProgressAt }) {
|
|
134
155
|
if (snapshot && policy) {
|
|
135
156
|
if (snapshot.waitingForFirstSemantic) {
|
|
136
|
-
|
|
137
|
-
|
|
157
|
+
if (snapshot.modelRequestStartedAt)
|
|
158
|
+
return { at: snapshot.modelRequestStartedAt, field: 'model_request_started_at' };
|
|
159
|
+
if (snapshot.askStartedAt) return { at: snapshot.askStartedAt, field: 'ask_started_at' };
|
|
138
160
|
}
|
|
139
|
-
|
|
140
|
-
if (
|
|
161
|
+
if (snapshot.lastProgressAt) return { at: snapshot.lastProgressAt, field: 'last_progress_at' };
|
|
162
|
+
if (snapshot.firstActivityAt) return { at: snapshot.firstActivityAt, field: 'first_activity_at' };
|
|
141
163
|
}
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
return null;
|
|
164
|
+
if (lastProgressAt) return { at: lastProgressAt, field: 'reported_progress_at' };
|
|
165
|
+
if (anchorTs) return { at: anchorTs, field: 'anchor_ts' };
|
|
166
|
+
return { at: null, field: null };
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Which deadline fired, read from the abort message. `idle_bare` is the form
|
|
170
|
+
// the registry/dispatch fallback throws when no progress snapshot existed.
|
|
171
|
+
function watchdogAbortKind(message) {
|
|
172
|
+
const limit = Number(/\((\d+)ms/.exec(message)?.[1]) || null;
|
|
173
|
+
if (/^agent first transport stale/.test(message)) return { window: 'first_response', form: 'first_transport', limit };
|
|
174
|
+
if (/^agent first semantic response stale/.test(message))
|
|
175
|
+
return { window: 'first_output', form: 'first_semantic', limit };
|
|
176
|
+
if (/^agent task stale \(\d+ms without stream\/tool progress\)/.test(message)) {
|
|
177
|
+
return { window: 'idle', form: 'idle_progress', limit };
|
|
178
|
+
}
|
|
179
|
+
if (/^agent task stale/.test(message)) return { window: 'idle', form: 'idle_bare', limit };
|
|
180
|
+
if (/^agent progress checks failed/.test(message)) return { window: 'idle', form: 'checks_failed', limit: null };
|
|
181
|
+
return { window: null, form: 'other', limit: null };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Shipped builds keep no agent trace, so a stop could not be audited after the
|
|
185
|
+
// fact (was the agent really silent?). The tool-failure log stays on in ship
|
|
186
|
+
// mode; the row holds clocks and names only, never prompt or output text.
|
|
187
|
+
// `observation` says how the snapshot was obtained: a wire-safe runtime is
|
|
188
|
+
// sampled asynchronously and the watchdog may judge a cached read, so
|
|
189
|
+
// `snapshot_present` alone does not prove the clocks are current. Only an error
|
|
190
|
+
// name/code is kept from a failed read, never its message.
|
|
191
|
+
function recordAgentWatchdogAbortRow({
|
|
192
|
+
sessionId,
|
|
193
|
+
agent,
|
|
194
|
+
error,
|
|
195
|
+
snapshot,
|
|
196
|
+
policy,
|
|
197
|
+
clock,
|
|
198
|
+
elapsed,
|
|
199
|
+
anchorTs,
|
|
200
|
+
lastProgressAt,
|
|
201
|
+
iteration,
|
|
202
|
+
observation,
|
|
203
|
+
registrationId,
|
|
204
|
+
}) {
|
|
205
|
+
if (process.env.MIXDOG_AGENT_TRACE_DISABLE === '1') return;
|
|
206
|
+
const message = typeof error.message === 'string' ? error.message : '';
|
|
207
|
+
const { window, form, limit } = watchdogAbortKind(message);
|
|
208
|
+
_appendToolFailureRow({
|
|
209
|
+
ts: Date.now(),
|
|
210
|
+
kind: 'stall_abort',
|
|
211
|
+
category: 'agent-stall',
|
|
212
|
+
build_version: PACKAGE_VERSION,
|
|
213
|
+
registration_id: registrationId || null,
|
|
214
|
+
session_id: normalizeSessionId(sessionId),
|
|
215
|
+
iteration: iteration ?? null,
|
|
216
|
+
agent: agent || null,
|
|
217
|
+
stage: snapshot?.stage ?? null,
|
|
218
|
+
window,
|
|
219
|
+
limit_ms: limit ?? policy?.idleStaleMs ?? null,
|
|
220
|
+
form,
|
|
221
|
+
compared_field: clock.field,
|
|
222
|
+
compared_at: clock.at,
|
|
223
|
+
elapsed_ms: elapsed,
|
|
224
|
+
snapshot_present: Boolean(snapshot),
|
|
225
|
+
snapshot_source: snapshot ? observation?.source || 'direct' : null,
|
|
226
|
+
last_read_ok_at: observation?.lastReadOkAt || null,
|
|
227
|
+
read_pending_since: observation?.readPendingSince || null,
|
|
228
|
+
last_read_error: observation?.lastReadError || null,
|
|
229
|
+
ask_started_at: snapshot?.askStartedAt || null,
|
|
230
|
+
model_request_started_at: snapshot?.modelRequestStartedAt || null,
|
|
231
|
+
waiting_for_transport: snapshot ? Boolean(snapshot.waitingForTransport) : null,
|
|
232
|
+
waiting_for_first_semantic: snapshot ? Boolean(snapshot.waitingForFirstSemantic) : null,
|
|
233
|
+
awaiting_user: snapshot?.awaitingUser || null,
|
|
234
|
+
last_progress_at: snapshot?.lastProgressAt || lastProgressAt || null,
|
|
235
|
+
last_keepalive_at: snapshot?.lastKeepaliveAt || null,
|
|
236
|
+
anchor_ts: anchorTs || null,
|
|
237
|
+
current_tool: snapshot?.currentTool || null,
|
|
238
|
+
});
|
|
145
239
|
}
|
|
146
240
|
|
|
147
241
|
function recordAgentWatchdogAbort({
|
|
@@ -154,15 +248,14 @@ function recordAgentWatchdogAbort({
|
|
|
154
248
|
anchorTs = 0,
|
|
155
249
|
lastProgressAt = 0,
|
|
156
250
|
iteration = null,
|
|
251
|
+
observation = null,
|
|
252
|
+
registrationId = null,
|
|
253
|
+
comparedClock = null,
|
|
157
254
|
}) {
|
|
158
255
|
if (!sessionId || !error) return;
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
now,
|
|
163
|
-
anchorTs,
|
|
164
|
-
lastProgressAt,
|
|
165
|
-
});
|
|
256
|
+
// A caller that decided on its own clock (the failed-checks stop) names it.
|
|
257
|
+
const clock = comparedClock || resolveWatchdogAbortClock({ snapshot, policy, anchorTs, lastProgressAt });
|
|
258
|
+
const elapsed = clock.at ? Math.max(0, now - clock.at) : null;
|
|
166
259
|
try {
|
|
167
260
|
appendAgentTrace({
|
|
168
261
|
sessionId,
|
|
@@ -178,6 +271,24 @@ function recordAgentWatchdogAbort({
|
|
|
178
271
|
} catch {
|
|
179
272
|
/* best-effort */
|
|
180
273
|
}
|
|
274
|
+
try {
|
|
275
|
+
recordAgentWatchdogAbortRow({
|
|
276
|
+
sessionId,
|
|
277
|
+
agent,
|
|
278
|
+
error,
|
|
279
|
+
snapshot,
|
|
280
|
+
policy,
|
|
281
|
+
clock,
|
|
282
|
+
elapsed,
|
|
283
|
+
anchorTs,
|
|
284
|
+
lastProgressAt,
|
|
285
|
+
iteration,
|
|
286
|
+
observation,
|
|
287
|
+
registrationId,
|
|
288
|
+
});
|
|
289
|
+
} catch {
|
|
290
|
+
/* best-effort */
|
|
291
|
+
}
|
|
181
292
|
}
|
|
182
293
|
|
|
183
294
|
export function abortAgentProgressWatchdog(controller, ctx) {
|
|
@@ -246,9 +357,9 @@ export function resolveAgentWatchdogPolicy(agent, overrides = {}) {
|
|
|
246
357
|
// Part B: the provider-level idle abort is the first mid-stream catch, but
|
|
247
358
|
// it is transport-based for Anthropic (pings reset it; other providers
|
|
248
359
|
// judge semantic idle). This public-agent idle is a BACKSTOP only, so it
|
|
249
|
-
// must not exceed the stall abort (600s default)
|
|
250
|
-
//
|
|
251
|
-
//
|
|
360
|
+
// must not exceed the stall abort (600s default): a ping-only wedge that
|
|
361
|
+
// slipped past the provider layer would otherwise hang the owner for half
|
|
362
|
+
// an hour. Anthropic pings extend it only up to
|
|
252
363
|
// KEEPALIVE_MAX_IDLE_MULTIPLIER times (evaluateAgentWatchdogAbort). Cap it at
|
|
253
364
|
// the stall abort while keeping 30 min as an absolute ceiling. Long tool
|
|
254
365
|
// calls refresh progress through the activity heartbeat, so they never
|
|
@@ -255,15 +255,6 @@ export function cacheCapabilityForProvider(provider) {
|
|
|
255
255
|
return PROVIDER_CACHE_CAPABILITY[provider] || 'none';
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
export function shouldMarkWarmForProvider(provider) {
|
|
259
|
-
const capability = cacheCapabilityForProvider(provider);
|
|
260
|
-
return capability === 'explicit-breakpoint' || capability === 'key-prefix' || capability === 'managed-explicit';
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export function shouldRecordObservedForProvider(provider) {
|
|
264
|
-
return cacheCapabilityForProvider(provider) === 'implicit-observed';
|
|
265
|
-
}
|
|
266
|
-
|
|
267
258
|
// Stable provider namespaces, not final wire cache keys. The request builders
|
|
268
259
|
// add session identity by default; explicit overrides can enable shared routing.
|
|
269
260
|
// Anthropic/Gemini use content-keyed breakpoints / explicit cache objects instead.
|
|
@@ -563,6 +554,19 @@ function oneShotPromptCacheOpts(agent) {
|
|
|
563
554
|
return isOneShotMaintenanceAgent(agent) ? { promptCacheScope: 'shared' } : null;
|
|
564
555
|
}
|
|
565
556
|
|
|
557
|
+
/**
|
|
558
|
+
* Cache send options for a session-less loop whose system prompt and tool
|
|
559
|
+
* schemas are the same bytes on every call (the explore tool's explorers):
|
|
560
|
+
* keyed on that prefix, never per call, on the default 5m tier. The parallel
|
|
561
|
+
* explorers of a fan-out and the next calls minutes later are its only
|
|
562
|
+
* readers, so the Lead's 1h / 12h tiers would only raise the write price.
|
|
563
|
+
*/
|
|
564
|
+
export function sharedPrefixProviderCacheOpts(provider) {
|
|
565
|
+
const shared = { promptCacheScope: 'shared' };
|
|
566
|
+
if (cacheCapabilityForProvider(provider) !== 'explicit-breakpoint') return shared;
|
|
567
|
+
return { ...shared, cacheStrategy: { tools: 'none', system: '5m', tier3: 'none', messages: '5m' } };
|
|
568
|
+
}
|
|
569
|
+
|
|
566
570
|
/**
|
|
567
571
|
* Cache send options for a role's requests on `provider`: the breakpoint
|
|
568
572
|
* strategy on explicit-breakpoint providers, the Lead-class 12h prefix TTL on
|
|
@@ -12,8 +12,8 @@ const TIMEOUT_MS = 30_000;
|
|
|
12
12
|
// Every digest is new and asked once: a cache write would cost more than any
|
|
13
13
|
// read it could earn, so no layer is marked.
|
|
14
14
|
const NO_PROMPT_CACHE = Object.freeze({ tools: 'none', system: 'none', tier3: 'none', messages: 'none' });
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const HEARTBEAT_NOTHING = 'NOTHING';
|
|
16
|
+
const HEARTBEAT_WAKE = 'WAKE';
|
|
17
17
|
const MAX_ITEMS = 5;
|
|
18
18
|
const ITEM_LIMIT = 300;
|
|
19
19
|
|
|
@@ -3,6 +3,9 @@ import { normalizeContextTokens } from '../../../shared/llm/default-context-wind
|
|
|
3
3
|
import { loadConfig } from '../config.mjs';
|
|
4
4
|
import { getHiddenAgent } from '../internal-agents.mjs';
|
|
5
5
|
|
|
6
|
+
// The settings agent whose route a hidden role runs on.
|
|
7
|
+
const ROLE_BY_MAINT_KEY = Object.freeze({ memory: 'maintainer', explore: 'explore' });
|
|
8
|
+
|
|
6
9
|
function normalizeMaintenanceCandidate(candidate) {
|
|
7
10
|
if (!candidate || typeof candidate !== 'object' || Array.isArray(candidate)) return candidate || null;
|
|
8
11
|
const provider = String(candidate.provider || '').trim();
|
|
@@ -38,7 +41,7 @@ export function resolveMaintenanceRoute({ preset, optsPreset, agent, config: cfg
|
|
|
38
41
|
try {
|
|
39
42
|
const config = cfgIn || loadConfig({ secrets: false });
|
|
40
43
|
const key = hidden.maintKey || hidden.slot;
|
|
41
|
-
const role = key
|
|
44
|
+
const role = ROLE_BY_MAINT_KEY[key] || '';
|
|
42
45
|
if (!role) return config?.maintenance?.[key] ?? null;
|
|
43
46
|
// A disabled agent must not silently fall back to the Main model:
|
|
44
47
|
// "off" means the maintenance role does not run at all.
|
|
@@ -22,6 +22,16 @@ import { traceAgentPreset } from '../agent-trace.mjs';
|
|
|
22
22
|
import { resolveAgentSessionPermission } from '../internal-agents.mjs';
|
|
23
23
|
import { loadConfig } from '../config.mjs';
|
|
24
24
|
import { RETIRED_COMPACTION_FIELDS } from '../config-storage.mjs';
|
|
25
|
+
import {
|
|
26
|
+
liveFeatureDisallowedTools,
|
|
27
|
+
stageConnectorAvailability,
|
|
28
|
+
stageToolAvailability,
|
|
29
|
+
} from '../runtime-core/tool-availability.mjs';
|
|
30
|
+
import { COMPACTION_CONFIG_KEYS } from '../runtime-core/compaction-config-keys.mjs';
|
|
31
|
+
import { stagePromptSettingsNotice } from '../session/manager/prompt-settings.mjs';
|
|
32
|
+
import { loadInstructionFilesContext } from '../context/instruction-files.mjs';
|
|
33
|
+
import { normalizeInstructionFilesMode } from '../../../shared/instruction-files-mode.mjs';
|
|
34
|
+
import { finalizeSessionToolList, previewSessionTools } from '../session/manager/tool-resolution.mjs';
|
|
25
35
|
|
|
26
36
|
function normalizeAgentCompactionConfig(value = {}) {
|
|
27
37
|
const raw = value && typeof value === 'object' ? value : {};
|
|
@@ -89,8 +99,12 @@ export function prepareAgentSession({
|
|
|
89
99
|
const effectiveOwnerSessionId =
|
|
90
100
|
ownerSessionId === undefined ? process.env.MIXDOG_OWNER_SESSION_ID || null : ownerSessionId;
|
|
91
101
|
let compaction = null;
|
|
102
|
+
// The settings gates as they stand: a disabled feature (git and github
|
|
103
|
+
// included) never reaches the agent's schema or dispatch.
|
|
104
|
+
let featureDenied = [];
|
|
92
105
|
try {
|
|
93
106
|
const cfg = loadConfig({ secrets: false });
|
|
107
|
+
featureDenied = liveFeatureDisallowedTools(cfg);
|
|
94
108
|
if (cfg?.compaction && typeof cfg.compaction === 'object') {
|
|
95
109
|
compaction = normalizeAgentCompactionConfig(cfg.compaction);
|
|
96
110
|
}
|
|
@@ -114,6 +128,8 @@ export function prepareAgentSession({
|
|
|
114
128
|
clientHostPid: clientHostPid || null,
|
|
115
129
|
compaction: compaction || undefined,
|
|
116
130
|
mcpScopeId: mcpScopeId || null,
|
|
131
|
+
callerDisallowedTools: [],
|
|
132
|
+
disallowedTools: featureDenied,
|
|
117
133
|
};
|
|
118
134
|
if (contextPercent) sessionOpts.contextPercent = contextPercent;
|
|
119
135
|
if (contextTokens) sessionOpts.contextTokens = contextTokens;
|
|
@@ -142,3 +158,54 @@ export function prepareAgentSession({
|
|
|
142
158
|
}
|
|
143
159
|
return { session, effectiveCwd };
|
|
144
160
|
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* An in-process agent session reused for another turn (no session runtime
|
|
164
|
+
* turn start reconciles it): bring it to the settings as they stand without
|
|
165
|
+
* touching its request prefix — its settings-gated tools
|
|
166
|
+
* (stageToolAvailability), its connectors (stageConnectorAvailability) and
|
|
167
|
+
* its compaction settings. Returns the tool change, or null.
|
|
168
|
+
*/
|
|
169
|
+
export function reconcileAgentSession(session) {
|
|
170
|
+
if (!session?.id) return null;
|
|
171
|
+
let cfg;
|
|
172
|
+
try {
|
|
173
|
+
cfg = loadConfig({ secrets: false });
|
|
174
|
+
} catch {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
if (cfg?.compaction && typeof cfg.compaction === 'object') {
|
|
178
|
+
// Config-owned keys follow the settings; the session's own state stays.
|
|
179
|
+
const own = { ...(session.compaction || {}) };
|
|
180
|
+
for (const key of COMPACTION_CONFIG_KEYS) delete own[key];
|
|
181
|
+
session.compaction = { ...own, ...normalizeAgentCompactionConfig(cfg.compaction) };
|
|
182
|
+
}
|
|
183
|
+
const connectors = stageConnectorAvailability(session);
|
|
184
|
+
// The prompt settings a delegated worker's prompt carries: its instruction
|
|
185
|
+
// files (the rest are a Lead's). Told once, like a session runtime's turn start.
|
|
186
|
+
if (session.promptSettings && session.skipInstructionFiles !== true && session.cwd) {
|
|
187
|
+
const toolFree = Array.isArray(session.schemaAllowedTools) && session.schemaAllowedTools.length === 0;
|
|
188
|
+
const skip = toolFree || session.promptIdentity?.profileSkip?.claudemd;
|
|
189
|
+
stagePromptSettingsNotice(session, {
|
|
190
|
+
only: ['instructionFiles'],
|
|
191
|
+
instructionFiles: skip ? '' : loadInstructionFilesContext({ mode: cfg?.instructionFiles, cwd: session.cwd }),
|
|
192
|
+
instructionFilesMode: normalizeInstructionFilesMode(cfg?.instructionFiles),
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
const tools = stageToolAvailability(session, liveFeatureDisallowedTools(cfg), (names) =>
|
|
196
|
+
finalizeSessionToolList(
|
|
197
|
+
previewSessionTools('full', [], {
|
|
198
|
+
ownerIsAgentSession: true,
|
|
199
|
+
mcpScopeId: session.mcpScopeId || null,
|
|
200
|
+
modelName: session.model,
|
|
201
|
+
cwd: session.cwd || null,
|
|
202
|
+
}).filter((tool) => names.includes(tool?.name)),
|
|
203
|
+
{ ownerIsAgent: true }
|
|
204
|
+
)
|
|
205
|
+
);
|
|
206
|
+
if (!tools && !connectors) return null;
|
|
207
|
+
return {
|
|
208
|
+
added: [...(tools?.added || []), ...(connectors?.added || [])],
|
|
209
|
+
removed: [...(tools?.removed || []), ...(connectors?.removed || [])],
|
|
210
|
+
};
|
|
211
|
+
}
|
|
@@ -422,6 +422,7 @@ function classifyToolFailure(resultText, toolName) {
|
|
|
422
422
|
if (isUserControlCancellation(leading)) return 'expected-cancellation';
|
|
423
423
|
if (
|
|
424
424
|
/^The arguments provided to `[^`]+` are invalid JSON and could not be parsed:/i.test(leading) ||
|
|
425
|
+
// Retired Goal task errors: still in stored failure logs that get reclassified.
|
|
425
426
|
/^new Goal tasks must omit ids; use updates for existing tasks$/i.test(leading) ||
|
|
426
427
|
/^goal task exceeds \d+ characters$/i.test(leading) ||
|
|
427
428
|
/^goal (?:tasks|updates) support at most \d+ entries(?:$|;)/i.test(leading) ||
|
|
@@ -78,6 +78,10 @@ export function buildDefaultConfig(options = {}) {
|
|
|
78
78
|
apiKey: apiKey || undefined,
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
+
// authMode: 'service-account' (the stored key), 'adc' (the gcloud login or a
|
|
82
|
+
// metadata server, nothing stored) or 'api-key' (an express-mode key). No
|
|
83
|
+
// location: unset follows the environment's region, then global.
|
|
84
|
+
providers['vertex-ai'] = { enabled: false, authMode: 'service-account' };
|
|
81
85
|
// OAuth provider detection uses lightweight credential probes so config
|
|
82
86
|
// load does not import provider runtimes or SDKs.
|
|
83
87
|
//
|
|
@@ -299,13 +303,13 @@ export function loadConfig(options = {}) {
|
|
|
299
303
|
recap: recapConfig,
|
|
300
304
|
// The model may title the session (session tool, action=rename); default on.
|
|
301
305
|
aiSessionTitles: raw.aiSessionTitles !== false,
|
|
302
|
-
// Mixy's heartbeat check (session-runtime/mixy-heartbeat.mjs); default
|
|
303
|
-
heartbeat: raw.heartbeat
|
|
306
|
+
// Mixy's heartbeat check (session-runtime/mixy-heartbeat.mjs); default off.
|
|
307
|
+
heartbeat: raw.heartbeat === true,
|
|
304
308
|
// Minutes between its checks, one of a fixed set (shared/heartbeat-interval.mjs);
|
|
305
309
|
// anything else reads as the default.
|
|
306
310
|
heartbeatIntervalMinutes: normalizeHeartbeatIntervalMinutes(raw.heartbeatIntervalMinutes),
|
|
307
|
-
// Prompt-cache warming (session/cache-warm.mjs); default
|
|
308
|
-
promptCacheWarming: raw?.promptCacheWarming
|
|
311
|
+
// Prompt-cache warming (session/cache-warm.mjs); default off.
|
|
312
|
+
promptCacheWarming: raw?.promptCacheWarming === true,
|
|
309
313
|
// Bots may leave an emoji reaction on the user's message (react tool); default on.
|
|
310
314
|
reactions: raw.reactions !== false,
|
|
311
315
|
// Bots page layout (order, hidden groups, pins, retention) and the shared
|
|
@@ -360,7 +364,7 @@ export function loadConfig(options = {}) {
|
|
|
360
364
|
shell: {},
|
|
361
365
|
update: {},
|
|
362
366
|
recap: { enabled: true },
|
|
363
|
-
promptCacheWarming:
|
|
367
|
+
promptCacheWarming: false,
|
|
364
368
|
worktree: normalizeWorktreeSettings(null),
|
|
365
369
|
developer: {},
|
|
366
370
|
modules: {},
|
|
@@ -490,7 +494,8 @@ function buildAgentSaveBuilder(config) {
|
|
|
490
494
|
// Default true lives in code: only the opt-out is stored.
|
|
491
495
|
if (config.aiSessionTitles === false) next.aiSessionTitles = false;
|
|
492
496
|
else delete next.aiSessionTitles;
|
|
493
|
-
|
|
497
|
+
// Default off lives in code: only the opt-in is stored.
|
|
498
|
+
if (config.heartbeat === true) next.heartbeat = true;
|
|
494
499
|
else delete next.heartbeat;
|
|
495
500
|
// Only a non-default choice is stored.
|
|
496
501
|
const heartbeatMinutes = normalizeHeartbeatIntervalMinutes(config.heartbeatIntervalMinutes);
|
|
@@ -498,7 +503,7 @@ function buildAgentSaveBuilder(config) {
|
|
|
498
503
|
else delete next.heartbeatIntervalMinutes;
|
|
499
504
|
if (config.reactions === false) next.reactions = false;
|
|
500
505
|
else delete next.reactions;
|
|
501
|
-
if (config.promptCacheWarming ===
|
|
506
|
+
if (config.promptCacheWarming === true) next.promptCacheWarming = true;
|
|
502
507
|
else delete next.promptCacheWarming;
|
|
503
508
|
if (Array.isArray(config.botOrder) && config.botOrder.length) next.botOrder = [...config.botOrder];
|
|
504
509
|
else delete next.botOrder;
|
|
@@ -156,8 +156,8 @@ const firstSentence = (text) => {
|
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
// A catalog connector's curated when-to-use trigger; else the first sentence
|
|
159
|
-
// of the server's MCP instructions; else
|
|
160
|
-
// order); else its name. Never the account: that is part of the instruction
|
|
159
|
+
// of the server's MCP instructions; else the leading description of its first
|
|
160
|
+
// described tool (name order); else its name. Never the account: that is part of the instruction
|
|
161
161
|
// text delivered when the server's tools are loaded. Derived lines are
|
|
162
162
|
// compacted to at most 98 characters, ellipsis included.
|
|
163
163
|
function mcpServerTrigger(server, tools, instructions) {
|
|
@@ -168,11 +168,11 @@ function mcpServerTrigger(server, tools, instructions) {
|
|
|
168
168
|
const instruction = String(instructions?.[server] || '')
|
|
169
169
|
.replace(/[<>]/g, '')
|
|
170
170
|
.replace(/^\s*Account: \S+?\.\s+/, '');
|
|
171
|
-
const described =
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
const described =
|
|
172
|
+
[...tools]
|
|
173
|
+
.sort((a, b) => String(a?.name || '').localeCompare(String(b?.name || '')))
|
|
174
|
+
.map((tool) => firstSentence(String(tool?.description || '').replace(/[<>]/g, '')))
|
|
175
|
+
.find(Boolean) || '';
|
|
176
176
|
const derived = firstSentence(instruction) || described;
|
|
177
177
|
return derived ? compactPromptManifestText(derived, 98) : `${titleCaseMcpServer(server)} MCP server tools.`;
|
|
178
178
|
}
|
|
@@ -7,7 +7,7 @@ import { compareCodePoints } from '../../../shared/code-point-order.mjs';
|
|
|
7
7
|
import { BOTS_DIR, MIXY_BOT_ID, botStoreActive, isStoreBot, mixyIdentityDir } from '../../../shared/agent-store.mjs';
|
|
8
8
|
import { mixdogRoot } from '../../../shared/plugin-paths.mjs';
|
|
9
9
|
import { readMarkdownDocument } from '../../../shared/markdown-frontmatter.mjs';
|
|
10
|
-
import { listHiddenAgentsByKind
|
|
10
|
+
import { listHiddenAgentsByKind } from '../internal-agents.mjs';
|
|
11
11
|
import { mixdogGlobalDir, mtimeWithTtl, readSafe } from './skill-catalog.mjs';
|
|
12
12
|
import { mixyDisplayName } from '../session/mixy-name.mjs';
|
|
13
13
|
|
|
@@ -15,14 +15,14 @@ import { mixyDisplayName } from '../session/mixy-name.mjs';
|
|
|
15
15
|
// Emits a BP2 agent/system block scoped to the calling agent:
|
|
16
16
|
// - Public/custom agents: their own agents/<agent>.md when present,
|
|
17
17
|
// plus the public agent-worker contract.
|
|
18
|
-
// - Hidden agents: their own rules/agent/<agent>.md section only.
|
|
18
|
+
// - Hidden maintenance agents: their own rules/agent/<agent>.md section only.
|
|
19
19
|
// - Null agent: falls back to the full all-in-one block
|
|
20
20
|
// (explicit-cache unified-shard path).
|
|
21
21
|
//
|
|
22
22
|
// Agent-specific markdown intentionally rides BP2, behind the shared BP1 tool
|
|
23
23
|
// and skill manifest prefix, so agent changes do not disturb the common layer.
|
|
24
24
|
//
|
|
25
|
-
// Classification is dynamic — hidden
|
|
25
|
+
// Classification is dynamic — the hidden maintenance set comes from the
|
|
26
26
|
// `kind` field in internal-agents.mjs. Any other non-null agent is public/custom.
|
|
27
27
|
|
|
28
28
|
// One catalog/rules section; selectRoleInstructionSections matches sections
|
|
@@ -36,10 +36,7 @@ function loadAgentClassification() {
|
|
|
36
36
|
// listHiddenAgentsByKind now reads from the mtime-aware cache inside
|
|
37
37
|
// internal-agents.mjs so the classification always reflects the current
|
|
38
38
|
// agents.json on disk.
|
|
39
|
-
return {
|
|
40
|
-
retrieval: new Set(listHiddenAgentsByKind('retrieval')),
|
|
41
|
-
maintenance: new Set(listHiddenAgentsByKind('maintenance')),
|
|
42
|
-
};
|
|
39
|
+
return { maintenance: new Set(listHiddenAgentsByKind('maintenance')) };
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
const _scopedRoleInstructionsCache = new Map();
|
|
@@ -167,28 +164,13 @@ function selfHiddenRuleSection(hiddenPairs, agent) {
|
|
|
167
164
|
return self ? [roleSection(self.name, self.body)] : [];
|
|
168
165
|
}
|
|
169
166
|
|
|
170
|
-
function selectRoleInstructionSections({
|
|
171
|
-
useUnified,
|
|
172
|
-
agent,
|
|
173
|
-
classification,
|
|
174
|
-
agentSharesCatalog,
|
|
175
|
-
agentSections,
|
|
176
|
-
hiddenPairs,
|
|
177
|
-
}) {
|
|
167
|
+
function selectRoleInstructionSections({ useUnified, agent, classification, agentSections, hiddenPairs }) {
|
|
178
168
|
if (useUnified || !agent) {
|
|
179
169
|
return {
|
|
180
170
|
agentRuleSectionsToEmit: hiddenRuleSections(hiddenPairs),
|
|
181
171
|
agentSectionsToEmit: agentSections,
|
|
182
172
|
};
|
|
183
173
|
}
|
|
184
|
-
if (classification.retrieval.has(agent)) {
|
|
185
|
-
return {
|
|
186
|
-
agentRuleSectionsToEmit: selfHiddenRuleSection(hiddenPairs, agent),
|
|
187
|
-
agentSectionsToEmit: agentSections.filter((s) =>
|
|
188
|
-
[...agentSharesCatalog].some((name) => s.startsWith(`## ${name}\n`))
|
|
189
|
-
),
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
174
|
if (classification.maintenance.has(agent)) {
|
|
193
175
|
const selfRules = selfHiddenRuleSection(hiddenPairs, agent);
|
|
194
176
|
const fromAgent = agentSections.find((s) => s.startsWith(`## ${agent}\n`));
|
|
@@ -233,8 +215,6 @@ export function loadScopedRoleInstructions(agent, provider = null) {
|
|
|
233
215
|
// failures (malformed/missing agents.json) must propagate, not be
|
|
234
216
|
// silently swallowed by the file-IO catch below.
|
|
235
217
|
const classification = loadAgentClassification();
|
|
236
|
-
const agentSharesCatalog =
|
|
237
|
-
agent && classification.retrieval.has(agent) ? new Set(getAgentCatalogShareAgents(agent)) : new Set();
|
|
238
218
|
try {
|
|
239
219
|
const agentSections = loadAgentSections(pluginRoot);
|
|
240
220
|
const hiddenPairs = loadHiddenAgentSnippets(pluginRoot);
|
|
@@ -243,7 +223,6 @@ export function loadScopedRoleInstructions(agent, provider = null) {
|
|
|
243
223
|
useUnified,
|
|
244
224
|
agent,
|
|
245
225
|
classification,
|
|
246
|
-
agentSharesCatalog,
|
|
247
226
|
agentSections,
|
|
248
227
|
hiddenPairs,
|
|
249
228
|
});
|
|
@@ -274,13 +253,13 @@ export const PERSONA_MAX_CHARS = 4000;
|
|
|
274
253
|
export const PERSONA_TRUNCATION_MARKER = '\n\n[persona truncated]';
|
|
275
254
|
const PERSONA_AGENT_ID = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
276
255
|
|
|
277
|
-
|
|
256
|
+
function truncatePersona(text, max = PERSONA_MAX_CHARS) {
|
|
278
257
|
const value = typeof text === 'string' ? text.trim() : '';
|
|
279
258
|
if (value.length <= max) return value;
|
|
280
259
|
return value.slice(0, max).trimEnd() + PERSONA_TRUNCATION_MARKER;
|
|
281
260
|
}
|
|
282
261
|
|
|
283
|
-
|
|
262
|
+
function loadAgentPersonaSection(agent) {
|
|
284
263
|
if (typeof agent !== 'string' || !PERSONA_AGENT_ID.test(agent) || agent.includes('..')) return '';
|
|
285
264
|
const isLead = agent === 'lead';
|
|
286
265
|
// Mixy's persona is in its own folder; a store bot's in its bots/ folder.
|
|
@@ -325,7 +304,7 @@ function personaSection(persona) {
|
|
|
325
304
|
// The user-editable 일하는 방식 of Mixy, framed like any agent's role section.
|
|
326
305
|
// Agent mode only; empty or missing means no section. Re-read per
|
|
327
306
|
// composition, so an edit applies to the next prompt build.
|
|
328
|
-
|
|
307
|
+
function loadMixyRoleSection() {
|
|
329
308
|
let raw = '';
|
|
330
309
|
try {
|
|
331
310
|
const dir = mixyDir();
|
|
@@ -402,7 +381,7 @@ export function agentModeIdentityLine(agent) {
|
|
|
402
381
|
// invalid id. A coding Lead (`lead` outside Mixy's own thread) embeds no
|
|
403
382
|
// profile file at all, so its stamp is a constant: editing Mixy never
|
|
404
383
|
// rebuilds a coding session's prompt.
|
|
405
|
-
|
|
384
|
+
const CODING_LEAD_PROFILE_REVISION = 'coding-lead';
|
|
406
385
|
export function agentProfileRevision(agent, { mixy = true } = {}) {
|
|
407
386
|
if (typeof agent !== 'string' || !PERSONA_AGENT_ID.test(agent) || agent.includes('..')) return '';
|
|
408
387
|
if (agent === 'lead' && !mixy) return CODING_LEAD_PROFILE_REVISION;
|
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
* found" error rather than silently mis-dispatching.
|
|
21
21
|
*
|
|
22
22
|
* Kind classification:
|
|
23
|
-
* - 'retrieval' : short-lived hidden retrieval agents.
|
|
24
23
|
* - 'maintenance' : background-trigger hidden agents (memory cycle and
|
|
25
24
|
* title generation). Receive only their own self section.
|
|
25
|
+
* An entry without a kind only names a route (the explore tool's
|
|
26
|
+
* `explore-agent`, which runs no session).
|
|
26
27
|
*
|
|
27
28
|
* Permission classification:
|
|
28
29
|
* - 'read' : read-only — apply_patch/shell blocked at loop.mjs runtime
|
|
@@ -185,7 +186,7 @@ export function listHiddenAgentNames() {
|
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
/**
|
|
188
|
-
* List hidden agent names matching a given kind ('
|
|
189
|
+
* List hidden agent names matching a given kind ('maintenance').
|
|
189
190
|
* Consumed by collect.mjs to drive BP2 agent classification dynamically
|
|
190
191
|
* instead of hard-coding agent-name sets.
|
|
191
192
|
*/
|
|
@@ -196,15 +197,3 @@ export function listHiddenAgentsByKind(kind) {
|
|
|
196
197
|
}
|
|
197
198
|
return out;
|
|
198
199
|
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Return the agents/<name>.md sections a hidden agent shares in its BP2 catalog
|
|
202
|
-
* (in addition to its own self section). Drives hidden-role cache
|
|
203
|
-
* alignment declaratively instead of a hard-coded agent-name branch in
|
|
204
|
-
* collect.mjs. Returns [] when the agent declares none.
|
|
205
|
-
*/
|
|
206
|
-
export function getAgentCatalogShareAgents(name) {
|
|
207
|
-
const hidden = getHiddenAgent(name);
|
|
208
|
-
if (!hidden || !Array.isArray(hidden.catalogShareAgents)) return [];
|
|
209
|
-
return hidden.catalogShareAgents.map((n) => String(n || '').trim()).filter(Boolean);
|
|
210
|
-
}
|