mixdog 0.9.63 → 0.9.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/package.json +9 -2
- package/scripts/code-graph-description-contract.mjs +3 -3
- package/scripts/verify-release-assets.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +11 -14
- package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +6 -6
- package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -2
- package/src/runtime/agent/orchestrator/agent-trace-format.mjs +1 -0
- package/src/runtime/agent/orchestrator/config.mjs +19 -124
- package/src/runtime/agent/orchestrator/context/collect.mjs +6 -6
- package/src/runtime/agent/orchestrator/dispatch-persist.mjs +2 -2
- package/src/runtime/agent/orchestrator/internal-agents.mjs +2 -2
- package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +1 -1
- package/src/runtime/agent/orchestrator/mcp/client.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +333 -0
- package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +3 -277
- package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +6 -6
- package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +196 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +460 -0
- package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +14 -593
- package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +4 -4
- package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +5 -280
- package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +357 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-headers.mjs +216 -0
- package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +2 -188
- package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/provider-catalog-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +2 -2
- package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/compact/budget.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/compact/file-reattach.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/compact/summary-schema.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/summary.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/context-utils.mjs +4 -4
- package/src/runtime/agent/orchestrator/session/loop/deferred-call-through.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +17 -0
- package/src/runtime/agent/orchestrator/session/loop/steering.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +18 -26
- package/src/runtime/agent/orchestrator/session/loop/termination.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +3 -3
- package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/delivered-completions.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store/live-state.mjs +49 -0
- package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +49 -0
- package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +260 -0
- package/src/runtime/agent/orchestrator/session/store/serialize.mjs +72 -0
- package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +163 -0
- package/src/runtime/agent/orchestrator/session/store/write-guards.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +4 -1
- package/src/runtime/agent/orchestrator/session/store.mjs +9 -561
- package/src/runtime/agent/orchestrator/session/tool-envelope.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +2 -2
- package/src/runtime/agent/orchestrator/stall-policy.mjs +11 -11
- package/src/runtime/agent/orchestrator/tools/bash-policy-scan.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/bash-session.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +2 -154
- package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/cwd-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/fs-reachability.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/fuzzy-match.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/path-locks.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +2 -3
- package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/builtin/read-open.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-process.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/builtin/shell-job-spawn.mjs +519 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +5 -449
- package/src/runtime/agent/orchestrator/tools/builtin/snapshot-helpers.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +212 -0
- package/src/runtime/agent/orchestrator/tools/builtin.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +1 -7
- package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +9 -36
- package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +15 -3
- package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +429 -0
- package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +2 -395
- package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-prewarm-worker.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/mutation-planner.mjs +5 -5
- package/src/runtime/agent/orchestrator/tools/next-call-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +7 -7
- package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +72 -9
- package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +4 -4
- package/src/runtime/agent/orchestrator/tools/patch.mjs +1 -1
- package/src/runtime/agent/orchestrator/tools/result-compression.mjs +3 -3
- package/src/runtime/agent/orchestrator/tools/shell-command.mjs +2 -444
- package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +505 -0
- package/src/runtime/agent/orchestrator/tools/shell-exec-policy.mjs +2 -2
- package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +1 -1
- package/src/runtime/channels/lib/backend-dispatch.mjs +20 -5
- package/src/runtime/channels/lib/scheduler.mjs +1 -1
- package/src/runtime/channels/lib/telegram-format.mjs +1 -1
- package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +4 -4
- package/src/runtime/channels/tool-defs.mjs +2 -3
- package/src/runtime/memory/index.mjs +1 -5
- package/src/runtime/memory/lib/core-memory-candidates.mjs +357 -0
- package/src/runtime/memory/lib/core-memory-store.mjs +7 -357
- package/src/runtime/memory/lib/cycle-signatures.mjs +1 -1
- package/src/runtime/memory/lib/embedding-model-config.mjs +1 -1
- package/src/runtime/memory/lib/embedding-provider.mjs +1 -5
- package/src/runtime/memory/lib/embedding-worker.mjs +1 -5
- package/src/runtime/memory/lib/ko-morph.mjs +2 -2
- package/src/runtime/memory/lib/memory-config-flags.mjs +2 -5
- package/src/runtime/memory/lib/memory-cycle-requests.mjs +3 -7
- package/src/runtime/memory/lib/memory-cycle1.mjs +4 -8
- package/src/runtime/memory/lib/memory-cycle2-gate.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +1 -1
- package/src/runtime/memory/lib/memory-cycle2-shared.mjs +2 -5
- package/src/runtime/memory/lib/memory-cycle3.mjs +1 -5
- package/src/runtime/memory/lib/memory-embed.mjs +2 -6
- package/src/runtime/memory/lib/memory-log.mjs +8 -0
- package/src/runtime/memory/lib/memory-ops-policy.mjs +4 -8
- package/src/runtime/memory/lib/memory-recall-scope-filter.mjs +1 -1
- package/src/runtime/memory/lib/memory-recall-store.mjs +2 -193
- package/src/runtime/memory/lib/memory-score.mjs +1 -1
- package/src/runtime/memory/lib/memory-text-utils.mjs +2 -2
- package/src/runtime/memory/lib/memory.mjs +2 -6
- package/src/runtime/memory/lib/pg/adapter.mjs +2 -6
- package/src/runtime/memory/lib/pg/process.mjs +1 -5
- package/src/runtime/memory/lib/pg/supervisor.mjs +1 -5
- package/src/runtime/memory/lib/recall-format.mjs +2 -2
- package/src/runtime/memory/lib/recall-scoring.mjs +195 -0
- package/src/runtime/memory/lib/runtime-fetcher.mjs +1 -5
- package/src/runtime/memory/lib/trace-store.mjs +2 -6
- package/src/runtime/search/lib/http-fetch.mjs +6 -6
- package/src/runtime/search/lib/web-tools.mjs +2 -2
- package/src/runtime/shared/buffered-appender.mjs +1 -1
- package/src/runtime/shared/child-guardian.mjs +1 -1
- package/src/runtime/shared/child-spawn-gate.mjs +1 -1
- package/src/runtime/shared/config.mjs +4 -4
- package/src/runtime/shared/launcher-control.mjs +9 -10
- package/src/runtime/shared/llm/index.mjs +5 -20
- package/src/runtime/shared/markdown-frontmatter.mjs +1 -1
- package/src/runtime/shared/memory-snapshot.mjs +4 -4
- package/src/runtime/shared/pristine-execution.mjs +1 -1
- package/src/runtime/shared/process-lifecycle.mjs +0 -1
- package/src/runtime/shared/process-shutdown.mjs +1 -1
- package/src/runtime/shared/resource-admission.mjs +2 -2
- package/src/runtime/shared/schedule-session-run.mjs +1 -1
- package/src/runtime/shared/schedules-db.mjs +1 -1
- package/src/runtime/shared/service-discovery.mjs +2 -2
- package/src/runtime/shared/staged-update.mjs +6 -6
- package/src/runtime/shared/tool-execution-contract.mjs +1 -1
- package/src/runtime/shared/tool-primitives.mjs +1 -1
- package/src/runtime/shared/tool-surface.mjs +2 -2
- package/src/runtime/shared/turn-snapshot.mjs +184 -0
- package/src/runtime/shared/update-checker.mjs +1 -1
- package/src/runtime/shared/user-cwd.mjs +3 -3
- package/src/runtime/shared/user-data-guard.mjs +4 -4
- package/src/runtime/shared/workspace-router.mjs +5 -5
- package/src/session-runtime/config-helpers.mjs +2 -3
- package/src/session-runtime/config-lifecycle.mjs +1 -1
- package/src/session-runtime/hitch-profile.mjs +1 -1
- package/src/session-runtime/lifecycle-api.mjs +6 -4
- package/src/session-runtime/model-recency.mjs +5 -5
- package/src/session-runtime/plugin-mcp.mjs +1 -1
- package/src/session-runtime/provider-request-snapshot.mjs +338 -0
- package/src/session-runtime/runtime-core.mjs +4 -0
- package/src/session-runtime/session-text.mjs +4 -4
- package/src/session-runtime/session-turn-api.mjs +7 -0
- package/src/session-runtime/tool-catalog-schema.mjs +197 -0
- package/src/session-runtime/tool-catalog.mjs +6 -483
- package/src/session-runtime/tool-defs.mjs +1 -1
- package/src/standalone/agent-task-status.mjs +1 -1
- package/src/standalone/agent-tool/helpers.mjs +2 -2
- package/src/standalone/channel-admin.mjs +4 -4
- package/src/standalone/explore-tool.mjs +3 -3
- package/src/standalone/hook-bus/config.mjs +1 -1
- package/src/standalone/hook-bus/constants.mjs +1 -1
- package/src/standalone/hook-bus/rules.mjs +1 -1
- package/src/standalone/projects.mjs +1 -1
- package/src/standalone/provider-admin.mjs +2 -2
- package/src/tui/App.jsx +1 -1
- package/src/tui/app/app-format.mjs +2 -2
- package/src/tui/app/clipboard.mjs +3 -3
- package/src/tui/app/input-parsers.mjs +1 -1
- package/src/tui/app/text-layout.mjs +1 -1
- package/src/tui/app/transcript-row-estimate.mjs +360 -0
- package/src/tui/app/transcript-window.mjs +5 -347
- package/src/tui/app/use-mouse-input.mjs +1 -1
- package/src/tui/app/use-prompt-handlers.mjs +1 -1
- package/src/tui/components/tool-execution/surface-detail.mjs +9 -9
- package/src/tui/components/tool-execution/text-format.mjs +2 -2
- package/src/tui/components/tool-output-format.mjs +7 -7
- package/src/tui/display-width.mjs +4 -4
- package/src/tui/dist/index.mjs +187 -99
- package/src/tui/engine/agent-envelope.mjs +5 -5
- package/src/tui/engine/live-share.mjs +100 -0
- package/src/tui/engine/notification-plan.mjs +1 -1
- package/src/tui/engine/queue-helpers.mjs +3 -3
- package/src/tui/engine/render-timing.mjs +4 -5
- package/src/tui/engine/session-api-ext.mjs +6 -3
- package/src/tui/engine/tool-result-status.mjs +5 -5
- package/src/tui/engine/tool-result-text.mjs +1 -1
- package/src/tui/engine/transcript-spill.mjs +585 -0
- package/src/tui/engine/tui-steering-persist.mjs +1 -1
- package/src/tui/engine.mjs +29 -474
- package/src/tui/lib/voice-setup.mjs +1 -1
- package/src/tui/markdown/format-token.mjs +1 -1
- package/src/tui/markdown/render-ansi.mjs +1 -1
- package/src/tui/markdown/table-layout.mjs +4 -4
- package/src/tui/paste-attachments.mjs +1 -1
- package/src/tui/prompt-history-store.mjs +3 -3
- package/src/tui/statusline-ansi-bridge.mjs +2 -2
- package/src/tui/theme.mjs +1 -1
- package/src/tui/transcript-tool-failures.mjs +2 -2
- package/src/ui/ansi.mjs +0 -9
- package/src/ui/statusline-format.mjs +2 -4
- package/scripts/_bench-cwc.json +0 -20
- package/scripts/_jitter-fuzz.jsx +0 -42
- package/scripts/_jitter-fuzz2.jsx +0 -30
- package/scripts/_jitter-probe.jsx +0 -35
- package/scripts/_jp2.jsx +0 -16
- package/scripts/_smoke_wd.mjs +0 -7
- package/scripts/abort-recovery-test.mjs +0 -175
- package/scripts/agent-dispatch-abort-compose-test.mjs +0 -31
- package/scripts/agent-live-arg-guard-smoke.mjs +0 -20
- package/scripts/agent-live-path-suffix-smoke.mjs +0 -34
- package/scripts/agent-live-toolcall-args-smoke.mjs +0 -45
- package/scripts/agent-loop-policy-test.mjs +0 -37
- package/scripts/agent-model-liveness-test.mjs +0 -763
- package/scripts/agent-parallel-smoke.mjs +0 -435
- package/scripts/agent-route-batch-test.mjs +0 -40
- package/scripts/agent-tag-reuse-smoke.mjs +0 -441
- package/scripts/agent-terminal-reap-test.mjs +0 -252
- package/scripts/agent-trace-io-test.mjs +0 -133
- package/scripts/ansi-color-capability-test.mjs +0 -90
- package/scripts/anthropic-admission-retry-integration-test.mjs +0 -119
- package/scripts/anthropic-maxtokens-test.mjs +0 -119
- package/scripts/anthropic-oauth-refresh-race-test.mjs +0 -397
- package/scripts/anthropic-transport-policy-test.mjs +0 -726
- package/scripts/apply-patch-edit-smoke.mjs +0 -71
- package/scripts/arg-guard-test.mjs +0 -93
- package/scripts/async-notify-settlement-test.mjs +0 -99
- package/scripts/atomic-lock-tryonce-test.mjs +0 -125
- package/scripts/background-task-meta-smoke.mjs +0 -38
- package/scripts/bench-run.mjs +0 -508
- package/scripts/boot-smoke.mjs +0 -137
- package/scripts/build-runtime-windows.ps1 +0 -242
- package/scripts/channel-daemon-smoke.mjs +0 -1103
- package/scripts/code-graph-aggregate-cwd-test.mjs +0 -158
- package/scripts/code-graph-disk-hit-test.mjs +0 -290
- package/scripts/code-graph-dispatch-test.mjs +0 -96
- package/scripts/code-graph-root-federation-test.mjs +0 -273
- package/scripts/compact-active-turn-test.mjs +0 -68
- package/scripts/compact-file-reattach-test.mjs +0 -88
- package/scripts/compact-pressure-test.mjs +0 -788
- package/scripts/compact-prior-context-flatten-test.mjs +0 -252
- package/scripts/compact-recall-digest-test.mjs +0 -57
- package/scripts/compact-smoke.mjs +0 -1017
- package/scripts/compact-trigger-migration-smoke.mjs +0 -261
- package/scripts/compacted-placeholder-scrub-test.mjs +0 -63
- package/scripts/context-mcp-metering-test.mjs +0 -1406
- package/scripts/debounced-skills-async-save-test.mjs +0 -57
- package/scripts/deferred-tool-loading-test.mjs +0 -250
- package/scripts/desktop-session-bridge-test.mjs +0 -1013
- package/scripts/dispatch-persist-recovery-test.mjs +0 -141
- package/scripts/embedding-worker-exit-test.mjs +0 -76
- package/scripts/execution-completion-dedup-test.mjs +0 -205
- package/scripts/execution-pending-resume-kick-test.mjs +0 -151
- package/scripts/execution-resume-esc-integration-test.mjs +0 -176
- package/scripts/explore-bench-tmp.mjs +0 -36
- package/scripts/explore-bench.mjs +0 -248
- package/scripts/explore-prompt-policy-test.mjs +0 -256
- package/scripts/explore-timeout-cancel-test.mjs +0 -345
- package/scripts/find-fuzzy-hidden-test.mjs +0 -267
- package/scripts/forwarder-rebind-tail-test.mjs +0 -67
- package/scripts/freevar-smoke.mjs +0 -98
- package/scripts/gemini-provider-test.mjs +0 -1448
- package/scripts/generate-oc-icons.mjs +0 -11
- package/scripts/grok-oauth-refresh-race-test.mjs +0 -273
- package/scripts/headless-pristine-execution-test.mjs +0 -614
- package/scripts/hook-bus-test.mjs +0 -552
- package/scripts/ingest-pure-conversation-smoke.mjs +0 -175
- package/scripts/internal-comms-bench-test.mjs +0 -226
- package/scripts/internal-comms-bench.mjs +0 -853
- package/scripts/internal-comms-smoke.mjs +0 -277
- package/scripts/internal-tools-normalization-test.mjs +0 -62
- package/scripts/interrupted-turn-history-test.mjs +0 -399
- package/scripts/lead-workflow-smoke.mjs +0 -592
- package/scripts/lifecycle-api-test.mjs +0 -137
- package/scripts/live-share-test.mjs +0 -148
- package/scripts/live-worker-smoke.mjs +0 -333
- package/scripts/log-writer-guard-smoke.mjs +0 -131
- package/scripts/maintenance-default-routes-test.mjs +0 -164
- package/scripts/max-output-recovery-persist-test.mjs +0 -81
- package/scripts/max-output-recovery-test.mjs +0 -368
- package/scripts/mcp-client-normalization-test.mjs +0 -45
- package/scripts/mcp-grace-deferred-test.mjs +0 -225
- package/scripts/memory-core-input-test.mjs +0 -167
- package/scripts/memory-cycle-routing-test.mjs +0 -111
- package/scripts/memory-meta-concurrency-test.mjs +0 -20
- package/scripts/memory-pg-recovery-test.mjs +0 -59
- package/scripts/memory-rule-contract-test.mjs +0 -93
- package/scripts/model-list-sanitize-test.mjs +0 -37
- package/scripts/mouse-tracking-restore-smoke.mjs +0 -107
- package/scripts/native-edit-wire-test.mjs +0 -152
- package/scripts/notify-completion-mirror-test.mjs +0 -73
- package/scripts/openai-oauth-refresh-race-test.mjs +0 -120
- package/scripts/openai-oauth-ws-1006-retry-test.mjs +0 -954
- package/scripts/openai-ws-early-settle-test.mjs +0 -216
- package/scripts/output-style-bench.mjs +0 -292
- package/scripts/output-style-smoke.mjs +0 -145
- package/scripts/parent-abort-link-test.mjs +0 -90
- package/scripts/patch-binary-cache-test.mjs +0 -181
- package/scripts/path-suffix-test.mjs +0 -57
- package/scripts/pending-completion-drop-test.mjs +0 -239
- package/scripts/pending-messages-lock-nonblocking-test.mjs +0 -62
- package/scripts/pretool-ask-runtime-test.mjs +0 -54
- package/scripts/process-lifecycle-test.mjs +0 -461
- package/scripts/prompt-immediate-render-test.mjs +0 -89
- package/scripts/prompt-input-parity-test.mjs +0 -145
- package/scripts/provider-admission-scheduler-test.mjs +0 -681
- package/scripts/provider-contract-test.mjs +0 -632
- package/scripts/provider-stream-stall-test.mjs +0 -276
- package/scripts/provider-toolcall-test.mjs +0 -3063
- package/scripts/reactive-compact-persist-smoke.mjs +0 -203
- package/scripts/recall-bench.mjs +0 -359
- package/scripts/resource-admission-test.mjs +0 -792
- package/scripts/result-classification-test.mjs +0 -75
- package/scripts/rg-runner-test.mjs +0 -240
- package/scripts/routing-corpus-test.mjs +0 -349
- package/scripts/sanitize-tool-pairs-test.mjs +0 -260
- package/scripts/session-bench-cache-break-test.mjs +0 -102
- package/scripts/session-bench.mjs +0 -1708
- package/scripts/session-context-bench.mjs +0 -344
- package/scripts/session-heartbeat-lifecycle-test.mjs +0 -68
- package/scripts/session-ingest-compaction-smoke.mjs +0 -279
- package/scripts/session-ingest-smoke.mjs +0 -177
- package/scripts/session-orphan-sweep-test.mjs +0 -109
- package/scripts/set-effort-config-test.mjs +0 -41
- package/scripts/shell-failure-diagnostics-test.mjs +0 -280
- package/scripts/shell-hardening-test.mjs +0 -209
- package/scripts/shell-jobs-windows-hide-test.mjs +0 -164
- package/scripts/ship-mode-test.mjs +0 -98
- package/scripts/smoke-loop-failure-summary-test.mjs +0 -38
- package/scripts/smoke-loop-failure-summary.mjs +0 -16
- package/scripts/smoke-loop-report.mjs +0 -221
- package/scripts/smoke-loop.mjs +0 -202
- package/scripts/smoke-runtime-negative.ps1 +0 -106
- package/scripts/statusline-quota-hysteresis-test.mjs +0 -62
- package/scripts/steering-drain-buckets-test.mjs +0 -467
- package/scripts/steering-fold-provenance-test.mjs +0 -71
- package/scripts/streaming-tail-window-test.mjs +0 -175
- package/scripts/submit-commandbusy-race-test.mjs +0 -257
- package/scripts/task-bench.mjs +0 -205
- package/scripts/terminal-bench-isolation-guards-test.mjs +0 -102
- package/scripts/termio-input-smoke.mjs +0 -199
- package/scripts/tool-result-hook-test.mjs +0 -48
- package/scripts/tool-smoke.mjs +0 -2453
- package/scripts/tool-tui-presentation-test.mjs +0 -286
- package/scripts/toolcall-args-test.mjs +0 -239
- package/scripts/tui-ambiguous-width-test.mjs +0 -113
- package/scripts/tui-background-failure-smoke.mjs +0 -73
- package/scripts/tui-perf-run.ps1 +0 -26
- package/scripts/tui-render-smoke.mjs +0 -90
- package/scripts/tui-runtime-load-bench-entry.jsx +0 -608
- package/scripts/tui-runtime-load-bench.mjs +0 -50
- package/scripts/tui-store-frame-batch-test.mjs +0 -99
- package/scripts/tui-transcript-jitter-harness-entry.jsx +0 -383
- package/scripts/tui-transcript-perf-test.mjs +0 -934
- package/scripts/usage-metrics-epoch-smoke.mjs +0 -114
- package/scripts/verify-release-assets-test.mjs +0 -281
- package/scripts/web-fetch-routing-test.mjs +0 -158
- package/scripts/webhook-smoke.mjs +0 -201
- package/scripts/windows-hide-spawn-options-test.mjs +0 -19
- package/scripts/worker-notify-rejection-test.mjs +0 -51
- package/scripts/write-backpressure-test.mjs +0 -147
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mixdog",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.65",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Standalone mixdog coding-agent CLI/TUI workspace.",
|
|
@@ -28,6 +28,13 @@
|
|
|
28
28
|
"scripts/",
|
|
29
29
|
"!scripts/bench/",
|
|
30
30
|
"!scripts/recall-bench-*.txt",
|
|
31
|
+
"!scripts/*-test.mjs",
|
|
32
|
+
"!scripts/*-smoke.mjs",
|
|
33
|
+
"!scripts/smoke-loop*.mjs",
|
|
34
|
+
"!scripts/*-bench.mjs",
|
|
35
|
+
"!scripts/*bench-*.mjs",
|
|
36
|
+
"!scripts/*.ps1",
|
|
37
|
+
"!scripts/*.jsx",
|
|
31
38
|
"src/",
|
|
32
39
|
"!src/tui/dev",
|
|
33
40
|
"vendor/"
|
|
@@ -72,7 +79,7 @@
|
|
|
72
79
|
"test:tui-streaming-window": "node --test scripts/streaming-tail-window-test.mjs",
|
|
73
80
|
"test:tui-ambiguous-width": "node --test scripts/tui-ambiguous-width-test.mjs",
|
|
74
81
|
"test:release-assets": "node --check scripts/verify-release-assets.mjs && node --check scripts/verify-release-assets-test.mjs && node --test scripts/verify-release-assets-test.mjs",
|
|
75
|
-
"test:release-focused": "npm run test:release-assets && npm run test:patch-binary-cache && npm run test:providers && npm run test:deferred-tools && npm run smoke:compact && node --test scripts/code-graph-aggregate-cwd-test.mjs && npm run test:code-graph-dispatch && node --test scripts/code-graph-disk-hit-test.mjs && npm run test:shellhardening && node --test scripts/windows-hide-spawn-options-test.mjs && npm run test:session && node --test scripts/tui-transcript-perf-test.mjs",
|
|
82
|
+
"test:release-focused": "npm run test:release-assets && npm run test:tool-contracts && npm run test:placeholder && npm run smoke:patch && npm run test:patch-binary-cache && npm run test:providers && npm run test:deferred-tools && npm run smoke:compact && node --test scripts/code-graph-root-federation-test.mjs scripts/code-graph-aggregate-cwd-test.mjs && npm run test:code-graph-dispatch && node --test scripts/code-graph-disk-hit-test.mjs && npm run test:shellhardening && node --test scripts/windows-hide-spawn-options-test.mjs && npm run test:session && node --test scripts/tui-transcript-perf-test.mjs",
|
|
76
83
|
"test:native-edit-wire": "node --test scripts/native-edit-wire-test.mjs",
|
|
77
84
|
"test:patch-binary-cache": "node --test scripts/patch-binary-cache-test.mjs",
|
|
78
85
|
"test:session": "node --test scripts/session-orphan-sweep-test.mjs scripts/interrupted-turn-history-test.mjs scripts/session-heartbeat-lifecycle-test.mjs",
|
|
@@ -25,7 +25,7 @@ const removeIdentifier = (text, identifier) => (
|
|
|
25
25
|
text.replace(new RegExp(`(?<![a-z0-9_])${escapeRegExp(identifier)}(?![a-z0-9_])`, 'gi'), '')
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const CODE_GRAPH_EQUIVALENT_DESCRIPTION_PROBES = [
|
|
29
29
|
{
|
|
30
30
|
description: [
|
|
31
31
|
'Keywords use search/symbol_search while callers/callees/references/find_symbol use exact identifiers.',
|
|
@@ -64,7 +64,7 @@ export const CODE_GRAPH_EQUIVALENT_DESCRIPTION_PROBES = [
|
|
|
64
64
|
},
|
|
65
65
|
];
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
const CODE_GRAPH_DESCRIPTION_MUTATION_CORPUS = [
|
|
68
68
|
{
|
|
69
69
|
name: 'contracted negated file assignment',
|
|
70
70
|
mutate: (parts) => ({
|
|
@@ -140,7 +140,7 @@ export const CODE_GRAPH_DESCRIPTION_MUTATION_CORPUS = [
|
|
|
140
140
|
},
|
|
141
141
|
];
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
function hasCodeGraphDescriptionContract({ description, modeDescription, symbolsDescription }) {
|
|
144
144
|
return (
|
|
145
145
|
hasPositiveClause(description, ['file modes', 'files[]'])
|
|
146
146
|
&& hasModeClause(description, 'symbol modes', SYMBOL_MODES, 'symbols[]')
|
|
@@ -27,8 +27,8 @@ const RUNTIME_PLATFORMS = [
|
|
|
27
27
|
];
|
|
28
28
|
const STRICT_VERSION = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/;
|
|
29
29
|
const SHA256 = /^[a-f0-9]{64}$/i;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const MAX_ASSET_BYTES = 256 * 1024 * 1024;
|
|
31
|
+
const MAX_DOWNLOAD_TIMEOUT_MS = 300_000;
|
|
32
32
|
const PATCH_MANIFEST_PATH = 'src/runtime/agent/orchestrator/tools/patch-manifest.json';
|
|
33
33
|
const PATCH_CARGO_PATH = 'native/mixdog-patch/Cargo.toml';
|
|
34
34
|
const RUNTIME_MANIFEST_PATH = 'src/runtime/memory/data/runtime-manifest.json';
|
|
@@ -142,19 +142,19 @@ export function resolveHiddenRoleSchemaAllowedTools(hidden) {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
|
-
* Resolve the maintenance ROUTE (or
|
|
145
|
+
* Resolve the maintenance ROUTE (or preset name) for a dispatch.
|
|
146
146
|
*
|
|
147
147
|
* Returns one of:
|
|
148
148
|
* - a route object `{ provider, model, effort?, fast? }` — the preferred
|
|
149
149
|
* shape: a maintenance slot now stores its model directly (parity with
|
|
150
150
|
* `agents.<role>`), so no preset-array name lookup is needed.
|
|
151
|
-
* - a string — a
|
|
152
|
-
* explicit `preset`/`opts.preset` override. The caller resolves the name
|
|
153
|
-
* against config.presets
|
|
151
|
+
* - a string — a preset NAME (Main inheritance via config.default, or an
|
|
152
|
+
* explicit `preset`/`opts.preset` override). The caller resolves the name
|
|
153
|
+
* against config.presets.
|
|
154
154
|
* - null — unresolved.
|
|
155
155
|
*
|
|
156
156
|
* Explore and memory hidden roles mirror public spawning precedence:
|
|
157
|
-
* `agents.<role>` (including
|
|
157
|
+
* `agents.<role>` (including the `agents.maintenance` alias) → workflow route →
|
|
158
158
|
* maintenance route → Main. The cycle1/2/3 agents share the memory knob via
|
|
159
159
|
* their `maintKey: 'memory'` override. Scheduler and webhook are unchanged.
|
|
160
160
|
*/
|
|
@@ -207,9 +207,6 @@ export function resolveMaintenanceRoute({ preset, optsPreset, agent, config: cfg
|
|
|
207
207
|
return null;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
// Back-compat alias: older callers/tests import resolvePresetName. It now
|
|
211
|
-
// returns whatever resolveMaintenanceRoute does (route object OR name string).
|
|
212
|
-
export const resolvePresetName = resolveMaintenanceRoute;
|
|
213
210
|
|
|
214
211
|
// A maintenance slot value is a direct route when it carries provider+model.
|
|
215
212
|
function maintenanceRouteToPreset(routeOrName, agent) {
|
|
@@ -324,22 +321,22 @@ export function makeAgentDispatch(opts = {}) {
|
|
|
324
321
|
);
|
|
325
322
|
}
|
|
326
323
|
// Preferred path: a maintenance slot that stores its model directly
|
|
327
|
-
// (route object).
|
|
328
|
-
//
|
|
324
|
+
// (route object). Name path: Main inheritance (config.default) or an
|
|
325
|
+
// explicit preset override still identify a preset by NAME.
|
|
329
326
|
let preset = maintenanceRouteToPreset(routeOrName, agent);
|
|
330
327
|
if (!preset) {
|
|
331
|
-
const
|
|
332
|
-
preset = config.presets?.find((p) => p.id ===
|
|
328
|
+
const routeName = String(routeOrName || '').trim();
|
|
329
|
+
preset = config.presets?.find((p) => p.id === routeName || p.name === routeName) || null;
|
|
333
330
|
if (!preset) {
|
|
334
331
|
throw new Error(
|
|
335
332
|
`[agent-dispatch] maintenance route for agent "${agent}" is neither a `
|
|
336
|
-
+ `{provider,model} route nor a known preset name ("${
|
|
333
|
+
+ `{provider,model} route nor a known preset name ("${routeName}")`,
|
|
337
334
|
);
|
|
338
335
|
}
|
|
339
336
|
}
|
|
340
337
|
// Stable label for traces / session metadata, derived from the resolved
|
|
341
338
|
// preset object regardless of whether it came from a direct route or a
|
|
342
|
-
//
|
|
339
|
+
// preset name.
|
|
343
340
|
const presetName = preset.id || preset.name || `maint-${agent}`;
|
|
344
341
|
|
|
345
342
|
const runtimeSpec = resolveRuntimeSpec(preset, {
|
|
@@ -28,7 +28,7 @@ export class AgentStallAbortError extends Error {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
function isAgentProgressWatchdogAbortError(err) {
|
|
32
32
|
const msg = err?.message;
|
|
33
33
|
return typeof msg === 'string' && WATCHDOG_ABORT_RE.test(msg);
|
|
34
34
|
}
|
|
@@ -104,7 +104,7 @@ export function resolveHandoffMessageStartIndex(session) {
|
|
|
104
104
|
return messages.length;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
function collectSessionAssistantHandoffText(session, messageStartIndex = 0) {
|
|
108
108
|
const messages = Array.isArray(session?.messages) ? session.messages : [];
|
|
109
109
|
const start = Math.max(0, Math.floor(Number(messageStartIndex) || 0));
|
|
110
110
|
const parts = [];
|
|
@@ -141,7 +141,7 @@ function resolveWatchdogAbortElapsedMs({ error, snapshot, policy, now, anchorTs,
|
|
|
141
141
|
return null;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
function recordAgentWatchdogAbort({
|
|
145
145
|
sessionId,
|
|
146
146
|
agent = null,
|
|
147
147
|
error,
|
|
@@ -190,15 +190,15 @@ function envTimeoutMs(name, fallback) {
|
|
|
190
190
|
return Number.isFinite(n) && n >= 0 ? Math.floor(n) : fallback;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
const DEFAULT_FIRST_RESPONSE_TIMEOUT_MS = envTimeoutMs(
|
|
194
194
|
'MIXDOG_AGENT_FIRST_RESPONSE_TIMEOUT_MS',
|
|
195
195
|
120_000,
|
|
196
196
|
);
|
|
197
|
-
|
|
197
|
+
const DEFAULT_FIRST_VISIBLE_CEILING_MS = envTimeoutMs(
|
|
198
198
|
'MIXDOG_AGENT_FIRST_VISIBLE_TIMEOUT_MS',
|
|
199
199
|
600_000,
|
|
200
200
|
);
|
|
201
|
-
|
|
201
|
+
const DEFAULT_STALE_TIMEOUT_MS = envTimeoutMs(
|
|
202
202
|
'MIXDOG_AGENT_STALE_TIMEOUT_MS',
|
|
203
203
|
30 * 60_000,
|
|
204
204
|
);
|
|
@@ -463,7 +463,7 @@ export function buildProviderCacheOpts(provider, sessionId, agent, options = {})
|
|
|
463
463
|
* order (BP1 / BP2 / ...), serialized deterministically as a JSON array.
|
|
464
464
|
* Invariant: callers must pass an array.
|
|
465
465
|
*/
|
|
466
|
-
|
|
466
|
+
function computePrefixContent(systemPrompt, tools) {
|
|
467
467
|
const systemMessages = Array.isArray(systemPrompt)
|
|
468
468
|
? systemPrompt.map(s => s == null ? '' : String(s))
|
|
469
469
|
: [systemPrompt == null ? '' : String(systemPrompt)];
|
|
@@ -480,7 +480,7 @@ export function computePrefixContent(systemPrompt, tools) {
|
|
|
480
480
|
/**
|
|
481
481
|
* Longest-lived layer TTL (seconds) for registry expiry tracking.
|
|
482
482
|
*/
|
|
483
|
-
|
|
483
|
+
function ttlSecondsForCache(agent) {
|
|
484
484
|
const ttls = resolveCacheStrategy(agent);
|
|
485
485
|
if (
|
|
486
486
|
ttls.tools === 'none'
|
|
@@ -281,6 +281,7 @@ function classifyToolFailure(resultText, toolName) {
|
|
|
281
281
|
if (/\[signal:\s*[^\]]+/i.test(leading)) return 'process/signal';
|
|
282
282
|
return 'command-exit';
|
|
283
283
|
}
|
|
284
|
+
if (/\[tool-input-validation\]|compacted-history placeholder/.test(text)) return 'schema/args';
|
|
284
285
|
if (/requires either|invalid arguments|unknown parameter|must be|schema|expected|required|old_string is .*>=/.test(text)) return 'schema/args';
|
|
285
286
|
if (/not in allow-list|not allowed/.test(text)) return 'permission';
|
|
286
287
|
if (String(toolName || '') === 'shell' || /^\s*\[exit code:\s*\d+\]/i.test(raw)) return 'command-exit';
|
|
@@ -46,7 +46,7 @@ export function getPluginData() {
|
|
|
46
46
|
// SUBSET of DEFAULT_MAINTENANCE: scheduler/webhook carry a per-entry model and
|
|
47
47
|
// are not shown as shared rows, but still inherit the haiku default above when
|
|
48
48
|
// an entry omits its own model.
|
|
49
|
-
|
|
49
|
+
const MAINTENANCE_SLOTS = Object.freeze(['explore', 'memory']);
|
|
50
50
|
|
|
51
51
|
// --- User profile (statusline /profile) -------------------------------------
|
|
52
52
|
// Supported response languages for the /profile picker. `system` is the default
|
|
@@ -129,10 +129,10 @@ function resolveAnthropicFamilyModel(family) {
|
|
|
129
129
|
// Each maintenance slot stores its model route DIRECTLY ({provider, model}) —
|
|
130
130
|
// parity with `agents.<role>`. The old shape stored a preset NAME string (e.g.
|
|
131
131
|
// "haiku") that had to be looked up in the config.presets array; that
|
|
132
|
-
// indirection
|
|
133
|
-
// accepts a
|
|
134
|
-
// these defaults use the direct route. loadConfig()
|
|
135
|
-
//
|
|
132
|
+
// indirection resolves at dispatch. agent-dispatch.resolveMaintenanceRoute
|
|
133
|
+
// accepts a preset NAME (Main inheritance via config.default), and
|
|
134
|
+
// these defaults use the direct route. loadConfig() normalizes stored
|
|
135
|
+
// slots on read (see normalizeMaintenanceRoutes). The cycle1/2/3 memory
|
|
136
136
|
// agents share ONE `memory` route via the `maintKey: 'memory'` override on
|
|
137
137
|
// their hidden-role entries.
|
|
138
138
|
const _HAIKU_ROUTE = Object.freeze({
|
|
@@ -227,15 +227,11 @@ function normalizeSearchRoute(route) {
|
|
|
227
227
|
return out;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
//
|
|
231
|
-
//
|
|
232
|
-
// route
|
|
233
|
-
|
|
234
|
-
// to a route. Unresolvable strings are dropped so the DEFAULT_MAINTENANCE route
|
|
235
|
-
// fills the slot. `presets` is the normalized preset array for legacy lookup.
|
|
236
|
-
function migrateMaintenanceRoutes(rawMaint, presets, defaultProvider) {
|
|
230
|
+
// Normalize stored maintenance slots to the direct {provider, model} route
|
|
231
|
+
// shape (provider/model/effort/fast only). Non-route values are dropped so the
|
|
232
|
+
// DEFAULT_MAINTENANCE route fills the slot.
|
|
233
|
+
function normalizeMaintenanceRoutes(rawMaint, defaultProvider) {
|
|
237
234
|
const out = {};
|
|
238
|
-
const list = Array.isArray(presets) ? presets : [];
|
|
239
235
|
const configuredProvider = String(defaultProvider || '').trim();
|
|
240
236
|
const fallbackProvider = isConfiguredProviderId(configuredProvider)
|
|
241
237
|
? configuredProvider
|
|
@@ -255,16 +251,6 @@ function migrateMaintenanceRoutes(rawMaint, presets, defaultProvider) {
|
|
|
255
251
|
}
|
|
256
252
|
continue;
|
|
257
253
|
}
|
|
258
|
-
const name = String(value || '').trim();
|
|
259
|
-
if (!name) continue;
|
|
260
|
-
const preset = list.find(p => p && (p.id === name || p.name === name));
|
|
261
|
-
if (preset && preset.provider && preset.model) {
|
|
262
|
-
const route = { provider: preset.provider, model: preset.model };
|
|
263
|
-
if (preset.effort) route.effort = preset.effort;
|
|
264
|
-
if (preset.fast === true) route.fast = true;
|
|
265
|
-
out[slot] = route;
|
|
266
|
-
}
|
|
267
|
-
// Unresolvable legacy name → dropped; DEFAULT_MAINTENANCE route fills it.
|
|
268
254
|
}
|
|
269
255
|
return out;
|
|
270
256
|
}
|
|
@@ -288,25 +274,10 @@ async function persistAgentConfigAsync(build) {
|
|
|
288
274
|
}
|
|
289
275
|
|
|
290
276
|
// Recap toggle (recap.enabled, default true) gates ONLY the background memory
|
|
291
|
-
// cycles. The memory module itself is always-on.
|
|
292
|
-
|
|
293
|
-
// (loadConfig) persists the migration so the legacy flag is dropped from disk.
|
|
294
|
-
let _migratedRecapLegacy = false;
|
|
295
|
-
function normalizeRecapConfig(rawRecap, rawModules) {
|
|
277
|
+
// cycles. The memory module itself is always-on.
|
|
278
|
+
function normalizeRecapConfig(rawRecap) {
|
|
296
279
|
const recap = rawRecap && typeof rawRecap === 'object' ? { ...rawRecap } : {};
|
|
297
|
-
|
|
298
|
-
const legacyMemory = rawModules && typeof rawModules === 'object' ? rawModules.memory : undefined;
|
|
299
|
-
const legacyDisabled = legacyMemory === false
|
|
300
|
-
|| (legacyMemory && typeof legacyMemory === 'object' && legacyMemory.enabled === false);
|
|
301
|
-
if (legacyDisabled) {
|
|
302
|
-
recap.enabled = false;
|
|
303
|
-
_migratedRecapLegacy = true;
|
|
304
|
-
} else {
|
|
305
|
-
recap.enabled = true;
|
|
306
|
-
}
|
|
307
|
-
} else {
|
|
308
|
-
recap.enabled = recap.enabled !== false;
|
|
309
|
-
}
|
|
280
|
+
recap.enabled = recap.enabled !== false;
|
|
310
281
|
return recap;
|
|
311
282
|
}
|
|
312
283
|
|
|
@@ -355,19 +326,7 @@ export function loadConfig(options = {}) {
|
|
|
355
326
|
for (const [k, v] of Object.entries(raw.maintenance || {})) {
|
|
356
327
|
if (allowedMaintKeys.has(k)) rawMaint[k] = v;
|
|
357
328
|
}
|
|
358
|
-
|
|
359
|
-
// (cycle1/cycle2/cycle3) collapsed into a single `memory` key. If the
|
|
360
|
-
// stored config still carries any old cycle key and no `memory`, fold
|
|
361
|
-
// the first present value into `memory` (preserving the user's
|
|
362
|
-
// choice), then the old keys drop via the allow-list above. This is a
|
|
363
|
-
// schema migration, NOT a runtime fallback — the persisted config is
|
|
364
|
-
// cleaned once so runtime never has to re-migrate.
|
|
365
|
-
const legacyCycleKeys = ['cycle1', 'cycle2', 'cycle3'];
|
|
366
|
-
let migratedMaintenance = false;
|
|
367
|
-
if (!('memory' in rawMaint) && legacyCycleKeys.some(k => k in (raw.maintenance || {}))) {
|
|
368
|
-
rawMaint.memory = raw.maintenance.cycle1 ?? raw.maintenance.cycle2 ?? raw.maintenance.cycle3 ?? DEFAULT_MAINTENANCE.memory;
|
|
369
|
-
migratedMaintenance = true;
|
|
370
|
-
}
|
|
329
|
+
|
|
371
330
|
// Self-ref guard: mcpServers.mixdog / mcpServers["trib-plugin"]
|
|
372
331
|
// would self-spawn through the in-process tool adapter. Strip on
|
|
373
332
|
// ingress so user-edited configs cannot brick the agent boot.
|
|
@@ -400,72 +359,8 @@ export function loadConfig(options = {}) {
|
|
|
400
359
|
process.stderr.write(`[config] persist sanitized config failed: ${err?.message}\n`);
|
|
401
360
|
}
|
|
402
361
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
// keys (not in the allow-list); rebase onto the in-lock current so a
|
|
406
|
-
// concurrent writer's unrelated edits survive, mirroring the
|
|
407
|
-
// mcpServers self-ref strip above.
|
|
408
|
-
if (migratedMaintenance) {
|
|
409
|
-
try {
|
|
410
|
-
persistAgentConfig((current) => {
|
|
411
|
-
const cur = { ...current };
|
|
412
|
-
const target = (cur.agent && cur.agent.providers)
|
|
413
|
-
? (cur.agent = { ...cur.agent })
|
|
414
|
-
: cur;
|
|
415
|
-
const curMaint = (target.maintenance && typeof target.maintenance === 'object') ? { ...target.maintenance } : {};
|
|
416
|
-
// Derive `memory` from the IN-LOCK current, not the
|
|
417
|
-
// pre-lock rawMaint snapshot — a concurrent writer may
|
|
418
|
-
// have set maintenance.memory or changed a legacy cycle
|
|
419
|
-
// value between this loadConfig()'s read and the lock.
|
|
420
|
-
// If `memory` is already present in-lock, preserve it
|
|
421
|
-
// (lost-update guard); otherwise fold the in-lock legacy
|
|
422
|
-
// cycle value first, with the pre-lock snapshot as the
|
|
423
|
-
// last-resort seed.
|
|
424
|
-
if (!('memory' in curMaint)) {
|
|
425
|
-
curMaint.memory = curMaint.cycle1 ?? curMaint.cycle2 ?? curMaint.cycle3 ?? rawMaint.memory;
|
|
426
|
-
}
|
|
427
|
-
for (const k of legacyCycleKeys) delete curMaint[k];
|
|
428
|
-
target.maintenance = curMaint;
|
|
429
|
-
return cur;
|
|
430
|
-
});
|
|
431
|
-
} catch (err) {
|
|
432
|
-
process.stderr.write(`[config] persist maintenance migration failed: ${err?.message}\n`);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
// One-time recap migration: fold a legacy `modules.memory === false`
|
|
436
|
-
// flag into `recap.enabled=false` and drop the legacy flag on disk.
|
|
437
|
-
// Compute the recap shape here (before the return) so the
|
|
438
|
-
// _migratedRecapLegacy latch is set, then persist under the lock.
|
|
439
|
-
const recapConfig = normalizeRecapConfig(raw.recap, raw.modules);
|
|
440
|
-
if (_migratedRecapLegacy) {
|
|
441
|
-
_migratedRecapLegacy = false;
|
|
442
|
-
try {
|
|
443
|
-
persistAgentConfig((current) => {
|
|
444
|
-
const cur = { ...current };
|
|
445
|
-
const target = (cur.agent && cur.agent.providers)
|
|
446
|
-
? (cur.agent = { ...cur.agent })
|
|
447
|
-
: cur;
|
|
448
|
-
const recap = (target.recap && typeof target.recap === 'object') ? { ...target.recap } : {};
|
|
449
|
-
if (!('enabled' in recap)) recap.enabled = false;
|
|
450
|
-
target.recap = recap;
|
|
451
|
-
if (target.modules && typeof target.modules === 'object' && target.modules.memory === false) {
|
|
452
|
-
const modules = { ...target.modules };
|
|
453
|
-
delete modules.memory;
|
|
454
|
-
target.modules = modules;
|
|
455
|
-
} else if (target.modules && typeof target.modules === 'object' && target.modules.memory) {
|
|
456
|
-
const modules = { ...target.modules };
|
|
457
|
-
const memoryMod = { ...modules.memory };
|
|
458
|
-
delete memoryMod.enabled;
|
|
459
|
-
if (Object.keys(memoryMod).length === 0) delete modules.memory;
|
|
460
|
-
else modules.memory = memoryMod;
|
|
461
|
-
target.modules = modules;
|
|
462
|
-
}
|
|
463
|
-
return cur;
|
|
464
|
-
});
|
|
465
|
-
} catch (err) {
|
|
466
|
-
process.stderr.write(`[config] persist recap migration failed: ${err?.message}\n`);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
362
|
+
const recapConfig = normalizeRecapConfig(raw.recap);
|
|
363
|
+
|
|
469
364
|
const rawPresets = Array.isArray(raw.presets) ? raw.presets : [];
|
|
470
365
|
const normalizedPresets = rawPresets
|
|
471
366
|
.map(p => normalizePreset(p))
|
|
@@ -473,9 +368,9 @@ export function loadConfig(options = {}) {
|
|
|
473
368
|
.filter(p => p.id !== 'workflow-search');
|
|
474
369
|
const workflowRoutes = raw.workflowRoutes && typeof raw.workflowRoutes === 'object' ? { ...raw.workflowRoutes } : {};
|
|
475
370
|
delete workflowRoutes.search;
|
|
476
|
-
//
|
|
477
|
-
//
|
|
478
|
-
const
|
|
371
|
+
// Normalize maintenance slots to routes, then overlay onto the
|
|
372
|
+
// route-shaped defaults.
|
|
373
|
+
const normalizedMaint = normalizeMaintenanceRoutes(rawMaint, raw.defaultProvider);
|
|
479
374
|
return {
|
|
480
375
|
providers: mergedProviders,
|
|
481
376
|
mcpServers,
|
|
@@ -484,7 +379,7 @@ export function loadConfig(options = {}) {
|
|
|
484
379
|
: {},
|
|
485
380
|
presets: normalizedPresets,
|
|
486
381
|
default: raw.default || null,
|
|
487
|
-
maintenance: { ...DEFAULT_MAINTENANCE, ...
|
|
382
|
+
maintenance: { ...DEFAULT_MAINTENANCE, ...normalizedMaint },
|
|
488
383
|
workflowRoutes,
|
|
489
384
|
searchRoute: normalizeSearchRoute(raw.searchRoute),
|
|
490
385
|
fastModels: raw.fastModels && typeof raw.fastModels === 'object' ? raw.fastModels : {},
|
|
@@ -134,7 +134,7 @@ function normalizeSkillNameKey(name) {
|
|
|
134
134
|
return String(name || '').trim().toLowerCase();
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
function getDisabledSkillNameSet(config = null) {
|
|
138
138
|
const cfg = config || loadConfig({ secrets: false });
|
|
139
139
|
const keys = normalizeSkillsConfig(cfg.skills).disabled
|
|
140
140
|
.map((n) => normalizeSkillNameKey(n))
|
|
@@ -203,7 +203,7 @@ export function collectSkillsCached(cwd) {
|
|
|
203
203
|
/**
|
|
204
204
|
* Load full skill content by name.
|
|
205
205
|
*/
|
|
206
|
-
|
|
206
|
+
function loadSkillContent(name, cwd) {
|
|
207
207
|
const skills = collectSkillsCached(cwd);
|
|
208
208
|
const skill = skills.find(s => s.name === name);
|
|
209
209
|
if (!skill)
|
|
@@ -250,7 +250,7 @@ export function buildSkillResultEnvelope(name, content, skillDir) {
|
|
|
250
250
|
* body is delivered separately as ONE injected user message (newMessages),
|
|
251
251
|
* never in the tool_result — so the body appears exactly once.
|
|
252
252
|
*/
|
|
253
|
-
|
|
253
|
+
function buildSkillStub(name) {
|
|
254
254
|
return `Loaded skill: ${String(name || '').trim()}`;
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -320,7 +320,7 @@ function sanitizeDeferredToolManifestName(name) {
|
|
|
320
320
|
return text;
|
|
321
321
|
}
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
function bp1HasDeferredToolManifestBlock(text) {
|
|
324
324
|
const raw = String(text || '');
|
|
325
325
|
return /<available-deferred-tools>[\s\S]*?<\/available-deferred-tools>/i.test(raw)
|
|
326
326
|
|| /<mcp-instructions>[\s\S]*?<\/mcp-instructions>/i.test(raw);
|
|
@@ -375,7 +375,7 @@ function sanitizeMcpInstructionText(text, max = MCP_INSTRUCTION_MAX_CHARS) {
|
|
|
375
375
|
* Per-server MCP initialize instructions for deferred-pool tools only.
|
|
376
376
|
* Empty when no instructions or no matching deferred MCP tools → omit block.
|
|
377
377
|
*/
|
|
378
|
-
|
|
378
|
+
function buildMcpInstructionsManifest(mcpServerInstructions, poolNames) {
|
|
379
379
|
const map = mcpServerInstructions && typeof mcpServerInstructions === 'object'
|
|
380
380
|
? mcpServerInstructions
|
|
381
381
|
: {};
|
|
@@ -421,7 +421,7 @@ export function stripDeferredToolManifestBlock(text) {
|
|
|
421
421
|
// manifest, agent rules, …) is reordered or dropped. The fresh manifest already
|
|
422
422
|
// carries the mcp-instructions companion, so any pre-existing standalone one is
|
|
423
423
|
// removed first to avoid duplication.
|
|
424
|
-
|
|
424
|
+
function rebuildDeferredToolManifestBlock(text, manifest) {
|
|
425
425
|
let out = String(text || '').replace(MCP_INSTRUCTIONS_BLOCK_RE, '');
|
|
426
426
|
let replaced = false;
|
|
427
427
|
out = out.replace(DEFERRED_TOOLS_BLOCK_RE, (match, sep) => {
|
|
@@ -61,7 +61,7 @@ function setTail(dataDir, p) {
|
|
|
61
61
|
// the drain window. The window is bounded (process is exiting) and eliminating
|
|
62
62
|
// it requires a fundamentally different design (e.g. a dedicated lock-owner
|
|
63
63
|
// process). Best-effort is the correct trade-off here.
|
|
64
|
-
|
|
64
|
+
function drainDispatchPersist() {
|
|
65
65
|
// Prefer _pendingPayload (desired state captured at writeAll entry) over
|
|
66
66
|
// _lastPayload (last successfully written state). Pending is strictly
|
|
67
67
|
// newer when a writeAll is still in-flight or queued at process exit.
|
|
@@ -296,7 +296,7 @@ export function hasPending(dataDir) {
|
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
|
|
299
|
+
function removePending(dataDir, handle) {
|
|
300
300
|
if (!dataDir || !handle) return;
|
|
301
301
|
const tail = getTail(dataDir).then(async () => {
|
|
302
302
|
try {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* invoked only by internal handlers (explore / recall / search) and carry
|
|
6
6
|
* their own system prompt + tool-set policy.
|
|
7
7
|
*
|
|
8
|
-
* Lookup order (agent-dispatch.
|
|
8
|
+
* Lookup order (agent-dispatch.resolveMaintenanceRoute):
|
|
9
9
|
* 1. explicit preset arg
|
|
10
10
|
* 2. opts.preset
|
|
11
11
|
* 3. hidden-agent registry (defaults/agents.json + systemFile frontmatter)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* The preset names refer to entries seeded in mixdog-config.json (agent.presets)
|
|
17
17
|
* via DEFAULT_PRESETS (see config.mjs). If the user deletes the referenced preset
|
|
18
|
-
* from their config the hidden agents degrade gracefully — `
|
|
18
|
+
* from their config the hidden agents degrade gracefully — `resolveMaintenanceRoute`
|
|
19
19
|
* returns a name, but session creation will fail with a clear "preset not
|
|
20
20
|
* found" error rather than silently mis-dispatching.
|
|
21
21
|
*
|
|
@@ -82,7 +82,7 @@ function descendantsOf(childrenOf, rootPid) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
// Exposed for tests: descendant pid list captured while the tree is intact.
|
|
85
|
-
|
|
85
|
+
async function collectDescendants(rootPid) {
|
|
86
86
|
const { childrenOf } = await enumerate();
|
|
87
87
|
return descendantsOf(childrenOf, rootPid);
|
|
88
88
|
}
|
|
@@ -20,7 +20,7 @@ const AUTO_DETECT_PORTS = {
|
|
|
20
20
|
};
|
|
21
21
|
const DEFAULT_MCP_CALL_TIMEOUT_MS = 120000;
|
|
22
22
|
// Per-server STARTUP handshake budget (connect + listTools). Codex parity: 10s.
|
|
23
|
-
|
|
23
|
+
const DEFAULT_MCP_STARTUP_TIMEOUT_MS = 10000;
|
|
24
24
|
// --- State ---
|
|
25
25
|
const servers = new Map();
|
|
26
26
|
let mcpSdkPromise = null;
|
|
@@ -60,7 +60,7 @@ async function loadMcpSdk() {
|
|
|
60
60
|
* provided env map (defaults to process.env). Recurses into arrays/objects.
|
|
61
61
|
* Unknown vars expand to an empty string. No shell execution.
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
function expandEnvVars(value, env = process.env) {
|
|
64
64
|
if (typeof value === 'string') {
|
|
65
65
|
return value.replace(/\$\{(?:env:)?([A-Za-z_][A-Za-z0-9_]*)\}/g, (_m, name) => {
|
|
66
66
|
const v = env?.[name];
|
|
@@ -249,7 +249,7 @@ export function normalizeMcpToolResult(result) {
|
|
|
249
249
|
// per-server timeoutMs/callTimeoutMs config value (0/off/none/false disables).
|
|
250
250
|
// On expiry we close the transport so the next dispatch reconnects fresh, but
|
|
251
251
|
// we do not retry the timed-out call automatically (avoids side-effect dupes).
|
|
252
|
-
|
|
252
|
+
function resolveMcpCallTimeoutMs(cfg = {}, env = process.env) {
|
|
253
253
|
const raw = cfg?.timeoutMs ?? cfg?.timeout_ms ?? cfg?.callTimeoutMs ?? cfg?.call_timeout_ms
|
|
254
254
|
?? env?.MIXDOG_MCP_CALL_TIMEOUT_MS;
|
|
255
255
|
if (raw == null || raw === '' || raw === false) return DEFAULT_MCP_CALL_TIMEOUT_MS;
|
|
@@ -259,7 +259,7 @@ export function resolveMcpCallTimeoutMs(cfg = {}, env = process.env) {
|
|
|
259
259
|
return Math.round(parsed);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
|
|
262
|
+
function isMcpToolCallTimeoutError(err) {
|
|
263
263
|
return err?.code === 'EMCPTOOLTIMEOUT';
|
|
264
264
|
}
|
|
265
265
|
|
|
@@ -62,7 +62,7 @@ function retryAfterMs(error, now) {
|
|
|
62
62
|
return Number.isFinite(date) ? Math.max(0, date - now) : 0;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
class ProviderAdmissionQueueOverflowError extends Error {
|
|
66
66
|
constructor(key, maxQueue) {
|
|
67
67
|
super(`provider admission queue full for ${key} (maximum ${maxQueue})`);
|
|
68
68
|
this.name = 'ProviderAdmissionQueueOverflowError';
|
|
@@ -78,7 +78,7 @@ export class ProviderAdmissionQueueOverflowError extends Error {
|
|
|
78
78
|
* silently parking the request until the quota window resets. httpStatus 429
|
|
79
79
|
* routes it through the existing quota/rate-limit error presentation.
|
|
80
80
|
*/
|
|
81
|
-
|
|
81
|
+
class ProviderCooldownError extends Error {
|
|
82
82
|
constructor(key, cooldownUntil, now) {
|
|
83
83
|
const remaining = Math.max(0, Number(cooldownUntil) - Number(now));
|
|
84
84
|
super(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EFFORT_BETA_HEADER } from './anthropic-effort.mjs';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const EXTENDED_CACHE_TTL_BETA_HEADER = 'extended-cache-ttl-2025-04-11';
|
|
4
|
+
const INTERLEAVED_THINKING_BETA_HEADER = 'interleaved-thinking-2025-05-14';
|
|
5
|
+
const FAST_MODE_BETA_HEADER = 'fast-mode-2026-02-01';
|
|
6
|
+
const TOOL_SEARCH_BETA_HEADER = 'advanced-tool-use-2025-11-20';
|
|
7
7
|
export { EFFORT_BETA_HEADER };
|
|
8
8
|
|
|
9
9
|
export function supportsAnthropicFastMode(model) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Anthropic "effort" (extended-thinking budget) request parameter handling.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
|
|
6
6
|
|
|
7
7
|
// Canonical display/transport ordering for effort levels. Used only to sort
|
|
8
8
|
// whatever set the catalog actually advertises — NOT as an allowlist. The
|
|
@@ -157,7 +157,7 @@ export function normalizeAnthropicEffortInput(raw, model, logTag = 'anthropic')
|
|
|
157
157
|
return undefined;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
function anthropicEffortUsesOutputConfig(model, opts = {}) {
|
|
161
161
|
const thinkingBudgetTokens = Number(opts.thinkingBudgetTokens);
|
|
162
162
|
if (Number.isFinite(thinkingBudgetTokens) && thinkingBudgetTokens > 0) return false;
|
|
163
163
|
return modelSupportsEffort(model);
|