mixdog 0.9.63 → 0.9.64

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.
Files changed (403) hide show
  1. package/README.md +3 -0
  2. package/package.json +9 -2
  3. package/scripts/code-graph-description-contract.mjs +3 -3
  4. package/scripts/verify-release-assets.mjs +2 -2
  5. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +11 -14
  6. package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +6 -6
  7. package/src/runtime/agent/orchestrator/agent-runtime/cache-strategy.mjs +2 -2
  8. package/src/runtime/agent/orchestrator/agent-trace-format.mjs +1 -0
  9. package/src/runtime/agent/orchestrator/config.mjs +19 -124
  10. package/src/runtime/agent/orchestrator/context/collect.mjs +6 -6
  11. package/src/runtime/agent/orchestrator/dispatch-persist.mjs +2 -2
  12. package/src/runtime/agent/orchestrator/internal-agents.mjs +2 -2
  13. package/src/runtime/agent/orchestrator/mcp/child-tree.mjs +1 -1
  14. package/src/runtime/agent/orchestrator/mcp/client.mjs +4 -4
  15. package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +2 -2
  16. package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +4 -4
  17. package/src/runtime/agent/orchestrator/providers/anthropic-effort.mjs +2 -2
  18. package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +4 -4
  19. package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +333 -0
  20. package/src/runtime/agent/orchestrator/providers/anthropic-model-resolve.mjs +2 -2
  21. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +4 -4
  22. package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +1 -1
  23. package/src/runtime/agent/orchestrator/providers/anthropic.mjs +3 -277
  24. package/src/runtime/agent/orchestrator/providers/codex-client-meta.mjs +2 -2
  25. package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +1 -1
  26. package/src/runtime/agent/orchestrator/providers/gemini-cache.mjs +2 -2
  27. package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +6 -6
  28. package/src/runtime/agent/orchestrator/providers/grok-oauth-login.mjs +196 -0
  29. package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +460 -0
  30. package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +14 -593
  31. package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +1 -1
  32. package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +1 -1
  33. package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +1 -1
  34. package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +4 -4
  35. package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +2 -2
  36. package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +5 -280
  37. package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +357 -0
  38. package/src/runtime/agent/orchestrator/providers/openai-ws-headers.mjs +216 -0
  39. package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +2 -188
  40. package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +2 -2
  41. package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +2 -2
  42. package/src/runtime/agent/orchestrator/providers/opencode-go.mjs +1 -1
  43. package/src/runtime/agent/orchestrator/providers/provider-catalog-cache.mjs +1 -1
  44. package/src/runtime/agent/orchestrator/providers/registry.mjs +1 -1
  45. package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +2 -2
  46. package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +1 -1
  47. package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +1 -1
  48. package/src/runtime/agent/orchestrator/session/cache/scoped-cache.mjs +3 -3
  49. package/src/runtime/agent/orchestrator/session/compact/budget.mjs +2 -2
  50. package/src/runtime/agent/orchestrator/session/compact/file-reattach.mjs +2 -2
  51. package/src/runtime/agent/orchestrator/session/compact/summary-schema.mjs +1 -1
  52. package/src/runtime/agent/orchestrator/session/compact/summary.mjs +1 -1
  53. package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +2 -2
  54. package/src/runtime/agent/orchestrator/session/context-utils.mjs +4 -4
  55. package/src/runtime/agent/orchestrator/session/loop/deferred-call-through.mjs +1 -1
  56. package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +17 -0
  57. package/src/runtime/agent/orchestrator/session/loop/steering.mjs +1 -1
  58. package/src/runtime/agent/orchestrator/session/loop/stored-tool-args.mjs +18 -26
  59. package/src/runtime/agent/orchestrator/session/loop/termination.mjs +1 -1
  60. package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +3 -3
  61. package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +1 -0
  62. package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +1 -1
  63. package/src/runtime/agent/orchestrator/session/manager/delivered-completions.mjs +1 -1
  64. package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +1 -1
  65. package/src/runtime/agent/orchestrator/session/store/live-state.mjs +49 -0
  66. package/src/runtime/agent/orchestrator/session/store/load-cache.mjs +49 -0
  67. package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +260 -0
  68. package/src/runtime/agent/orchestrator/session/store/serialize.mjs +72 -0
  69. package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +163 -0
  70. package/src/runtime/agent/orchestrator/session/store/write-guards.mjs +1 -1
  71. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +1 -1
  72. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +4 -1
  73. package/src/runtime/agent/orchestrator/session/store.mjs +9 -561
  74. package/src/runtime/agent/orchestrator/session/tool-envelope.mjs +1 -1
  75. package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +2 -2
  76. package/src/runtime/agent/orchestrator/stall-policy.mjs +11 -11
  77. package/src/runtime/agent/orchestrator/tools/bash-policy-scan.mjs +1 -1
  78. package/src/runtime/agent/orchestrator/tools/bash-session.mjs +2 -2
  79. package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +1 -1
  80. package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +2 -2
  81. package/src/runtime/agent/orchestrator/tools/builtin/atomic-write.mjs +1 -1
  82. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +2 -154
  83. package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +1 -1
  84. package/src/runtime/agent/orchestrator/tools/builtin/cwd-utils.mjs +1 -1
  85. package/src/runtime/agent/orchestrator/tools/builtin/fs-reachability.mjs +1 -1
  86. package/src/runtime/agent/orchestrator/tools/builtin/fuzzy-match.mjs +1 -1
  87. package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +1 -1
  88. package/src/runtime/agent/orchestrator/tools/builtin/path-locks.mjs +1 -1
  89. package/src/runtime/agent/orchestrator/tools/builtin/path-utils.mjs +1 -1
  90. package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +2 -2
  91. package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +2 -3
  92. package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +4 -4
  93. package/src/runtime/agent/orchestrator/tools/builtin/read-open.mjs +1 -1
  94. package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +1 -1
  95. package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +2 -2
  96. package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +5 -5
  97. package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +1 -1
  98. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +2 -2
  99. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-process.mjs +2 -2
  100. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-spawn.mjs +519 -0
  101. package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +5 -449
  102. package/src/runtime/agent/orchestrator/tools/builtin/snapshot-helpers.mjs +1 -1
  103. package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +212 -0
  104. package/src/runtime/agent/orchestrator/tools/builtin.mjs +1 -1
  105. package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +1 -7
  106. package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +9 -36
  107. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +15 -3
  108. package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +429 -0
  109. package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +2 -395
  110. package/src/runtime/agent/orchestrator/tools/code-graph/symbol-index.mjs +2 -2
  111. package/src/runtime/agent/orchestrator/tools/code-graph/text-mask.mjs +1 -1
  112. package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +1 -1
  113. package/src/runtime/agent/orchestrator/tools/code-graph-prewarm-worker.mjs +1 -1
  114. package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +3 -3
  115. package/src/runtime/agent/orchestrator/tools/mutation-planner.mjs +5 -5
  116. package/src/runtime/agent/orchestrator/tools/next-call-utils.mjs +1 -1
  117. package/src/runtime/agent/orchestrator/tools/patch/dispatch.mjs +1 -1
  118. package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +7 -7
  119. package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +72 -9
  120. package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +4 -4
  121. package/src/runtime/agent/orchestrator/tools/patch/paths.mjs +1 -1
  122. package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +1 -1
  123. package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +4 -4
  124. package/src/runtime/agent/orchestrator/tools/patch.mjs +1 -1
  125. package/src/runtime/agent/orchestrator/tools/result-compression.mjs +3 -3
  126. package/src/runtime/agent/orchestrator/tools/shell-command.mjs +2 -444
  127. package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +505 -0
  128. package/src/runtime/agent/orchestrator/tools/shell-exec-policy.mjs +2 -2
  129. package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +1 -1
  130. package/src/runtime/channels/lib/backend-dispatch.mjs +20 -5
  131. package/src/runtime/channels/lib/scheduler.mjs +1 -1
  132. package/src/runtime/channels/lib/telegram-format.mjs +1 -1
  133. package/src/runtime/channels/lib/voice-runtime-fetcher.mjs +4 -4
  134. package/src/runtime/channels/tool-defs.mjs +2 -3
  135. package/src/runtime/memory/index.mjs +1 -5
  136. package/src/runtime/memory/lib/core-memory-candidates.mjs +357 -0
  137. package/src/runtime/memory/lib/core-memory-store.mjs +7 -357
  138. package/src/runtime/memory/lib/cycle-signatures.mjs +1 -1
  139. package/src/runtime/memory/lib/embedding-model-config.mjs +1 -1
  140. package/src/runtime/memory/lib/embedding-provider.mjs +1 -5
  141. package/src/runtime/memory/lib/embedding-worker.mjs +1 -5
  142. package/src/runtime/memory/lib/ko-morph.mjs +2 -2
  143. package/src/runtime/memory/lib/memory-config-flags.mjs +2 -5
  144. package/src/runtime/memory/lib/memory-cycle-requests.mjs +3 -7
  145. package/src/runtime/memory/lib/memory-cycle1.mjs +4 -8
  146. package/src/runtime/memory/lib/memory-cycle2-gate.mjs +1 -1
  147. package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +1 -1
  148. package/src/runtime/memory/lib/memory-cycle2-shared.mjs +2 -5
  149. package/src/runtime/memory/lib/memory-cycle3.mjs +1 -5
  150. package/src/runtime/memory/lib/memory-embed.mjs +2 -6
  151. package/src/runtime/memory/lib/memory-log.mjs +8 -0
  152. package/src/runtime/memory/lib/memory-ops-policy.mjs +4 -8
  153. package/src/runtime/memory/lib/memory-recall-scope-filter.mjs +1 -1
  154. package/src/runtime/memory/lib/memory-recall-store.mjs +2 -193
  155. package/src/runtime/memory/lib/memory-score.mjs +1 -1
  156. package/src/runtime/memory/lib/memory-text-utils.mjs +2 -2
  157. package/src/runtime/memory/lib/memory.mjs +2 -6
  158. package/src/runtime/memory/lib/pg/adapter.mjs +2 -6
  159. package/src/runtime/memory/lib/pg/process.mjs +1 -5
  160. package/src/runtime/memory/lib/pg/supervisor.mjs +1 -5
  161. package/src/runtime/memory/lib/recall-format.mjs +2 -2
  162. package/src/runtime/memory/lib/recall-scoring.mjs +195 -0
  163. package/src/runtime/memory/lib/runtime-fetcher.mjs +1 -5
  164. package/src/runtime/memory/lib/trace-store.mjs +2 -6
  165. package/src/runtime/search/lib/http-fetch.mjs +6 -6
  166. package/src/runtime/search/lib/web-tools.mjs +2 -2
  167. package/src/runtime/shared/buffered-appender.mjs +1 -1
  168. package/src/runtime/shared/child-guardian.mjs +1 -1
  169. package/src/runtime/shared/child-spawn-gate.mjs +1 -1
  170. package/src/runtime/shared/config.mjs +4 -4
  171. package/src/runtime/shared/launcher-control.mjs +9 -10
  172. package/src/runtime/shared/llm/index.mjs +5 -20
  173. package/src/runtime/shared/markdown-frontmatter.mjs +1 -1
  174. package/src/runtime/shared/memory-snapshot.mjs +4 -4
  175. package/src/runtime/shared/pristine-execution.mjs +1 -1
  176. package/src/runtime/shared/process-lifecycle.mjs +0 -1
  177. package/src/runtime/shared/process-shutdown.mjs +1 -1
  178. package/src/runtime/shared/resource-admission.mjs +2 -2
  179. package/src/runtime/shared/schedule-session-run.mjs +1 -1
  180. package/src/runtime/shared/schedules-db.mjs +1 -1
  181. package/src/runtime/shared/service-discovery.mjs +2 -2
  182. package/src/runtime/shared/staged-update.mjs +6 -6
  183. package/src/runtime/shared/tool-execution-contract.mjs +1 -1
  184. package/src/runtime/shared/tool-primitives.mjs +1 -1
  185. package/src/runtime/shared/tool-surface.mjs +2 -2
  186. package/src/runtime/shared/update-checker.mjs +1 -1
  187. package/src/runtime/shared/user-cwd.mjs +3 -3
  188. package/src/runtime/shared/user-data-guard.mjs +4 -4
  189. package/src/runtime/shared/workspace-router.mjs +5 -5
  190. package/src/session-runtime/config-helpers.mjs +2 -3
  191. package/src/session-runtime/config-lifecycle.mjs +1 -1
  192. package/src/session-runtime/hitch-profile.mjs +1 -1
  193. package/src/session-runtime/lifecycle-api.mjs +6 -4
  194. package/src/session-runtime/model-recency.mjs +5 -5
  195. package/src/session-runtime/plugin-mcp.mjs +1 -1
  196. package/src/session-runtime/provider-request-snapshot.mjs +338 -0
  197. package/src/session-runtime/session-text.mjs +4 -4
  198. package/src/session-runtime/tool-catalog-schema.mjs +197 -0
  199. package/src/session-runtime/tool-catalog.mjs +6 -483
  200. package/src/session-runtime/tool-defs.mjs +1 -1
  201. package/src/standalone/agent-task-status.mjs +1 -1
  202. package/src/standalone/agent-tool/helpers.mjs +2 -2
  203. package/src/standalone/channel-admin.mjs +4 -4
  204. package/src/standalone/explore-tool.mjs +3 -3
  205. package/src/standalone/hook-bus/config.mjs +1 -1
  206. package/src/standalone/hook-bus/constants.mjs +1 -1
  207. package/src/standalone/hook-bus/rules.mjs +1 -1
  208. package/src/standalone/projects.mjs +1 -1
  209. package/src/standalone/provider-admin.mjs +2 -2
  210. package/src/tui/app/app-format.mjs +2 -2
  211. package/src/tui/app/clipboard.mjs +3 -3
  212. package/src/tui/app/input-parsers.mjs +1 -1
  213. package/src/tui/app/text-layout.mjs +1 -1
  214. package/src/tui/app/transcript-row-estimate.mjs +360 -0
  215. package/src/tui/app/transcript-window.mjs +5 -347
  216. package/src/tui/app/use-mouse-input.mjs +1 -1
  217. package/src/tui/app/use-prompt-handlers.mjs +1 -1
  218. package/src/tui/components/tool-execution/surface-detail.mjs +9 -9
  219. package/src/tui/components/tool-execution/text-format.mjs +2 -2
  220. package/src/tui/components/tool-output-format.mjs +7 -7
  221. package/src/tui/display-width.mjs +4 -4
  222. package/src/tui/dist/index.mjs +63 -97
  223. package/src/tui/engine/agent-envelope.mjs +5 -5
  224. package/src/tui/engine/notification-plan.mjs +1 -1
  225. package/src/tui/engine/queue-helpers.mjs +3 -3
  226. package/src/tui/engine/render-timing.mjs +4 -5
  227. package/src/tui/engine/session-api-ext.mjs +3 -3
  228. package/src/tui/engine/tool-result-status.mjs +5 -5
  229. package/src/tui/engine/tool-result-text.mjs +1 -1
  230. package/src/tui/engine/transcript-spill.mjs +585 -0
  231. package/src/tui/engine/tui-steering-persist.mjs +1 -1
  232. package/src/tui/engine.mjs +2 -474
  233. package/src/tui/lib/voice-setup.mjs +1 -1
  234. package/src/tui/markdown/format-token.mjs +1 -1
  235. package/src/tui/markdown/render-ansi.mjs +1 -1
  236. package/src/tui/markdown/table-layout.mjs +4 -4
  237. package/src/tui/paste-attachments.mjs +1 -1
  238. package/src/tui/prompt-history-store.mjs +3 -3
  239. package/src/tui/statusline-ansi-bridge.mjs +2 -2
  240. package/src/tui/theme.mjs +1 -1
  241. package/src/tui/transcript-tool-failures.mjs +2 -2
  242. package/src/ui/ansi.mjs +0 -9
  243. package/src/ui/statusline-format.mjs +2 -4
  244. package/scripts/_bench-cwc.json +0 -20
  245. package/scripts/_jitter-fuzz.jsx +0 -42
  246. package/scripts/_jitter-fuzz2.jsx +0 -30
  247. package/scripts/_jitter-probe.jsx +0 -35
  248. package/scripts/_jp2.jsx +0 -16
  249. package/scripts/_smoke_wd.mjs +0 -7
  250. package/scripts/abort-recovery-test.mjs +0 -175
  251. package/scripts/agent-dispatch-abort-compose-test.mjs +0 -31
  252. package/scripts/agent-live-arg-guard-smoke.mjs +0 -20
  253. package/scripts/agent-live-path-suffix-smoke.mjs +0 -34
  254. package/scripts/agent-live-toolcall-args-smoke.mjs +0 -45
  255. package/scripts/agent-loop-policy-test.mjs +0 -37
  256. package/scripts/agent-model-liveness-test.mjs +0 -763
  257. package/scripts/agent-parallel-smoke.mjs +0 -435
  258. package/scripts/agent-route-batch-test.mjs +0 -40
  259. package/scripts/agent-tag-reuse-smoke.mjs +0 -441
  260. package/scripts/agent-terminal-reap-test.mjs +0 -252
  261. package/scripts/agent-trace-io-test.mjs +0 -133
  262. package/scripts/ansi-color-capability-test.mjs +0 -90
  263. package/scripts/anthropic-admission-retry-integration-test.mjs +0 -119
  264. package/scripts/anthropic-maxtokens-test.mjs +0 -119
  265. package/scripts/anthropic-oauth-refresh-race-test.mjs +0 -397
  266. package/scripts/anthropic-transport-policy-test.mjs +0 -726
  267. package/scripts/apply-patch-edit-smoke.mjs +0 -71
  268. package/scripts/arg-guard-test.mjs +0 -93
  269. package/scripts/async-notify-settlement-test.mjs +0 -99
  270. package/scripts/atomic-lock-tryonce-test.mjs +0 -125
  271. package/scripts/background-task-meta-smoke.mjs +0 -38
  272. package/scripts/bench-run.mjs +0 -508
  273. package/scripts/boot-smoke.mjs +0 -137
  274. package/scripts/build-runtime-windows.ps1 +0 -242
  275. package/scripts/channel-daemon-smoke.mjs +0 -1103
  276. package/scripts/code-graph-aggregate-cwd-test.mjs +0 -158
  277. package/scripts/code-graph-disk-hit-test.mjs +0 -290
  278. package/scripts/code-graph-dispatch-test.mjs +0 -96
  279. package/scripts/code-graph-root-federation-test.mjs +0 -273
  280. package/scripts/compact-active-turn-test.mjs +0 -68
  281. package/scripts/compact-file-reattach-test.mjs +0 -88
  282. package/scripts/compact-pressure-test.mjs +0 -788
  283. package/scripts/compact-prior-context-flatten-test.mjs +0 -252
  284. package/scripts/compact-recall-digest-test.mjs +0 -57
  285. package/scripts/compact-smoke.mjs +0 -1017
  286. package/scripts/compact-trigger-migration-smoke.mjs +0 -261
  287. package/scripts/compacted-placeholder-scrub-test.mjs +0 -63
  288. package/scripts/context-mcp-metering-test.mjs +0 -1406
  289. package/scripts/debounced-skills-async-save-test.mjs +0 -57
  290. package/scripts/deferred-tool-loading-test.mjs +0 -250
  291. package/scripts/desktop-session-bridge-test.mjs +0 -1013
  292. package/scripts/dispatch-persist-recovery-test.mjs +0 -141
  293. package/scripts/embedding-worker-exit-test.mjs +0 -76
  294. package/scripts/execution-completion-dedup-test.mjs +0 -205
  295. package/scripts/execution-pending-resume-kick-test.mjs +0 -151
  296. package/scripts/execution-resume-esc-integration-test.mjs +0 -176
  297. package/scripts/explore-bench-tmp.mjs +0 -36
  298. package/scripts/explore-bench.mjs +0 -248
  299. package/scripts/explore-prompt-policy-test.mjs +0 -256
  300. package/scripts/explore-timeout-cancel-test.mjs +0 -345
  301. package/scripts/find-fuzzy-hidden-test.mjs +0 -267
  302. package/scripts/forwarder-rebind-tail-test.mjs +0 -67
  303. package/scripts/freevar-smoke.mjs +0 -98
  304. package/scripts/gemini-provider-test.mjs +0 -1448
  305. package/scripts/generate-oc-icons.mjs +0 -11
  306. package/scripts/grok-oauth-refresh-race-test.mjs +0 -273
  307. package/scripts/headless-pristine-execution-test.mjs +0 -614
  308. package/scripts/hook-bus-test.mjs +0 -552
  309. package/scripts/ingest-pure-conversation-smoke.mjs +0 -175
  310. package/scripts/internal-comms-bench-test.mjs +0 -226
  311. package/scripts/internal-comms-bench.mjs +0 -853
  312. package/scripts/internal-comms-smoke.mjs +0 -277
  313. package/scripts/internal-tools-normalization-test.mjs +0 -62
  314. package/scripts/interrupted-turn-history-test.mjs +0 -399
  315. package/scripts/lead-workflow-smoke.mjs +0 -592
  316. package/scripts/lifecycle-api-test.mjs +0 -137
  317. package/scripts/live-share-test.mjs +0 -148
  318. package/scripts/live-worker-smoke.mjs +0 -333
  319. package/scripts/log-writer-guard-smoke.mjs +0 -131
  320. package/scripts/maintenance-default-routes-test.mjs +0 -164
  321. package/scripts/max-output-recovery-persist-test.mjs +0 -81
  322. package/scripts/max-output-recovery-test.mjs +0 -368
  323. package/scripts/mcp-client-normalization-test.mjs +0 -45
  324. package/scripts/mcp-grace-deferred-test.mjs +0 -225
  325. package/scripts/memory-core-input-test.mjs +0 -167
  326. package/scripts/memory-cycle-routing-test.mjs +0 -111
  327. package/scripts/memory-meta-concurrency-test.mjs +0 -20
  328. package/scripts/memory-pg-recovery-test.mjs +0 -59
  329. package/scripts/memory-rule-contract-test.mjs +0 -93
  330. package/scripts/model-list-sanitize-test.mjs +0 -37
  331. package/scripts/mouse-tracking-restore-smoke.mjs +0 -107
  332. package/scripts/native-edit-wire-test.mjs +0 -152
  333. package/scripts/notify-completion-mirror-test.mjs +0 -73
  334. package/scripts/openai-oauth-refresh-race-test.mjs +0 -120
  335. package/scripts/openai-oauth-ws-1006-retry-test.mjs +0 -954
  336. package/scripts/openai-ws-early-settle-test.mjs +0 -216
  337. package/scripts/output-style-bench.mjs +0 -292
  338. package/scripts/output-style-smoke.mjs +0 -145
  339. package/scripts/parent-abort-link-test.mjs +0 -90
  340. package/scripts/patch-binary-cache-test.mjs +0 -181
  341. package/scripts/path-suffix-test.mjs +0 -57
  342. package/scripts/pending-completion-drop-test.mjs +0 -239
  343. package/scripts/pending-messages-lock-nonblocking-test.mjs +0 -62
  344. package/scripts/pretool-ask-runtime-test.mjs +0 -54
  345. package/scripts/process-lifecycle-test.mjs +0 -461
  346. package/scripts/prompt-immediate-render-test.mjs +0 -89
  347. package/scripts/prompt-input-parity-test.mjs +0 -145
  348. package/scripts/provider-admission-scheduler-test.mjs +0 -681
  349. package/scripts/provider-contract-test.mjs +0 -632
  350. package/scripts/provider-stream-stall-test.mjs +0 -276
  351. package/scripts/provider-toolcall-test.mjs +0 -3063
  352. package/scripts/reactive-compact-persist-smoke.mjs +0 -203
  353. package/scripts/recall-bench.mjs +0 -359
  354. package/scripts/resource-admission-test.mjs +0 -792
  355. package/scripts/result-classification-test.mjs +0 -75
  356. package/scripts/rg-runner-test.mjs +0 -240
  357. package/scripts/routing-corpus-test.mjs +0 -349
  358. package/scripts/sanitize-tool-pairs-test.mjs +0 -260
  359. package/scripts/session-bench-cache-break-test.mjs +0 -102
  360. package/scripts/session-bench.mjs +0 -1708
  361. package/scripts/session-context-bench.mjs +0 -344
  362. package/scripts/session-heartbeat-lifecycle-test.mjs +0 -68
  363. package/scripts/session-ingest-compaction-smoke.mjs +0 -279
  364. package/scripts/session-ingest-smoke.mjs +0 -177
  365. package/scripts/session-orphan-sweep-test.mjs +0 -109
  366. package/scripts/set-effort-config-test.mjs +0 -41
  367. package/scripts/shell-failure-diagnostics-test.mjs +0 -280
  368. package/scripts/shell-hardening-test.mjs +0 -209
  369. package/scripts/shell-jobs-windows-hide-test.mjs +0 -164
  370. package/scripts/ship-mode-test.mjs +0 -98
  371. package/scripts/smoke-loop-failure-summary-test.mjs +0 -38
  372. package/scripts/smoke-loop-failure-summary.mjs +0 -16
  373. package/scripts/smoke-loop-report.mjs +0 -221
  374. package/scripts/smoke-loop.mjs +0 -202
  375. package/scripts/smoke-runtime-negative.ps1 +0 -106
  376. package/scripts/statusline-quota-hysteresis-test.mjs +0 -62
  377. package/scripts/steering-drain-buckets-test.mjs +0 -467
  378. package/scripts/steering-fold-provenance-test.mjs +0 -71
  379. package/scripts/streaming-tail-window-test.mjs +0 -175
  380. package/scripts/submit-commandbusy-race-test.mjs +0 -257
  381. package/scripts/task-bench.mjs +0 -205
  382. package/scripts/terminal-bench-isolation-guards-test.mjs +0 -102
  383. package/scripts/termio-input-smoke.mjs +0 -199
  384. package/scripts/tool-result-hook-test.mjs +0 -48
  385. package/scripts/tool-smoke.mjs +0 -2453
  386. package/scripts/tool-tui-presentation-test.mjs +0 -286
  387. package/scripts/toolcall-args-test.mjs +0 -239
  388. package/scripts/tui-ambiguous-width-test.mjs +0 -113
  389. package/scripts/tui-background-failure-smoke.mjs +0 -73
  390. package/scripts/tui-perf-run.ps1 +0 -26
  391. package/scripts/tui-render-smoke.mjs +0 -90
  392. package/scripts/tui-runtime-load-bench-entry.jsx +0 -608
  393. package/scripts/tui-runtime-load-bench.mjs +0 -50
  394. package/scripts/tui-store-frame-batch-test.mjs +0 -99
  395. package/scripts/tui-transcript-jitter-harness-entry.jsx +0 -383
  396. package/scripts/tui-transcript-perf-test.mjs +0 -934
  397. package/scripts/usage-metrics-epoch-smoke.mjs +0 -114
  398. package/scripts/verify-release-assets-test.mjs +0 -281
  399. package/scripts/web-fetch-routing-test.mjs +0 -158
  400. package/scripts/webhook-smoke.mjs +0 -201
  401. package/scripts/windows-hide-spawn-options-test.mjs +0 -19
  402. package/scripts/worker-notify-rejection-test.mjs +0 -51
  403. package/scripts/write-backpressure-test.mjs +0 -147
package/README.md CHANGED
@@ -219,6 +219,9 @@ src/
219
219
  vendor/
220
220
  ```
221
221
 
222
+ Test, smoke, and bench scripts are excluded from the tarball; they live in the
223
+ repository only.
224
+
222
225
  `docs/` is not included in the published package unless `package.json#files` is
223
226
  changed.
224
227
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixdog",
3
- "version": "0.9.63",
3
+ "version": "0.9.64",
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
- export const CODE_GRAPH_EQUIVALENT_DESCRIPTION_PROBES = [
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
- export const CODE_GRAPH_DESCRIPTION_MUTATION_CORPUS = [
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
- export function hasCodeGraphDescriptionContract({ description, modeDescription, symbolsDescription }) {
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
- export const MAX_ASSET_BYTES = 256 * 1024 * 1024;
31
- export const MAX_DOWNLOAD_TIMEOUT_MS = 300_000;
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 legacy preset name) for a dispatch.
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 legacy preset NAME still stored in a maintenance slot, or an
152
- * explicit `preset`/`opts.preset` override. The caller resolves the name
153
- * against config.presets for backward compatibility.
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 legacy `agents.maintenance`) → workflow route →
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). Legacy path: a slot still holding a preset NAME —
328
- // resolve it against config.presets for backward compatibility.
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 legacyName = String(routeOrName || '').trim();
332
- preset = config.presets?.find((p) => p.id === legacyName || p.name === legacyName) || null;
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 ("${legacyName}")`,
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
- // legacy preset name.
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
- export function isAgentProgressWatchdogAbortError(err) {
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
- export function collectSessionAssistantHandoffText(session, messageStartIndex = 0) {
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
- export function recordAgentWatchdogAbort({
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
- export const DEFAULT_FIRST_RESPONSE_TIMEOUT_MS = envTimeoutMs(
193
+ const DEFAULT_FIRST_RESPONSE_TIMEOUT_MS = envTimeoutMs(
194
194
  'MIXDOG_AGENT_FIRST_RESPONSE_TIMEOUT_MS',
195
195
  120_000,
196
196
  );
197
- export const DEFAULT_FIRST_VISIBLE_CEILING_MS = envTimeoutMs(
197
+ const DEFAULT_FIRST_VISIBLE_CEILING_MS = envTimeoutMs(
198
198
  'MIXDOG_AGENT_FIRST_VISIBLE_TIMEOUT_MS',
199
199
  600_000,
200
200
  );
201
- export const DEFAULT_STALE_TIMEOUT_MS = envTimeoutMs(
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
- export function computePrefixContent(systemPrompt, tools) {
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
- export function ttlSecondsForCache(agent) {
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
- export const MAINTENANCE_SLOTS = Object.freeze(['explore', 'memory']);
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 is the legacy path. agent-dispatch.resolveMaintenanceRoute still
133
- // accepts a legacy name string for backward compatibility, but new configs and
134
- // these defaults use the direct route. loadConfig() migrates any stored string
135
- // slot to a route on read (see migrateMaintenanceRoutes). The cycle1/2/3 memory
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
- // Migrate stored maintenance slots from the legacy preset-NAME string shape to
231
- // the direct {provider, model} route shape. A slot value that is already a
232
- // route object is normalized (provider/model/effort/fast only); a string value
233
- // is resolved against the config.presets array (the legacy lookup) and rewritten
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. On load we fold a legacy
292
- // `modules.memory === false` flag into recap.enabled=false one time; the caller
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
- if (!('enabled' in recap)) {
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
- // One-time schema migration: the three memory-cycle MODEL presets
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
- // Persist the memory-cycle schema migration once. rawMaint already
404
- // carries the folded `memory` key and excludes the dropped cycle1/2/3
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
- // Migrate legacy preset-name maintenance slots to direct routes,
477
- // then overlay onto the route-shaped defaults.
478
- const migratedMaint = migrateMaintenanceRoutes(rawMaint, normalizedPresets, raw.defaultProvider);
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, ...migratedMaint },
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
- export function getDisabledSkillNameSet(config = null) {
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
- export function loadSkillContent(name, cwd) {
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
- export function buildSkillStub(name) {
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
- export function bp1HasDeferredToolManifestBlock(text) {
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
- export function buildMcpInstructionsManifest(mcpServerInstructions, poolNames) {
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
- export function rebuildDeferredToolManifestBlock(text, manifest) {
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
- export function drainDispatchPersist() {
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
- export function removePending(dataDir, handle) {
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.resolvePresetName):
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 — `resolvePresetName`
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
- export async function collectDescendants(rootPid) {
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
- export const DEFAULT_MCP_STARTUP_TIMEOUT_MS = 10000;
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
- export function expandEnvVars(value, env = process.env) {
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
- export function resolveMcpCallTimeoutMs(cfg = {}, env = process.env) {
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
- export function isMcpToolCallTimeoutError(err) {
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
- export class ProviderAdmissionQueueOverflowError extends Error {
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
- export class ProviderCooldownError extends Error {
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
- export const EXTENDED_CACHE_TTL_BETA_HEADER = 'extended-cache-ttl-2025-04-11';
4
- export const INTERLEAVED_THINKING_BETA_HEADER = 'interleaved-thinking-2025-05-14';
5
- export const FAST_MODE_BETA_HEADER = 'fast-mode-2026-02-01';
6
- export const TOOL_SEARCH_BETA_HEADER = 'advanced-tool-use-2025-11-20';
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
- export const EFFORT_LEVELS = Object.freeze(['low', 'medium', 'high', 'xhigh', 'max']);
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
- export function anthropicEffortUsesOutputConfig(model, opts = {}) {
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);