mixdog 0.9.152 → 0.9.154

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 (300) hide show
  1. package/LICENSES/browser-import-NOTICE.txt +11 -0
  2. package/NOTICE.md +11 -0
  3. package/README.md +8 -10
  4. package/package.json +19 -3
  5. package/scripts/computer-task-cost-report.mjs +144 -0
  6. package/scripts/run-office-live-tests.mjs +32 -0
  7. package/src/agents/front-worker/AGENT.md +13 -0
  8. package/src/agents/front-worker/agent.json +6 -0
  9. package/src/agents/heavy-worker/AGENT.md +10 -11
  10. package/src/agents/heavy-worker/agent.json +1 -1
  11. package/src/agents/maintainer/AGENT.md +0 -2
  12. package/src/agents/reviewer/AGENT.md +9 -13
  13. package/src/agents/reviewer/agent.json +1 -1
  14. package/src/agents/security/AGENT.md +14 -0
  15. package/src/agents/security/agent.json +6 -0
  16. package/src/agents/worker/AGENT.md +8 -8
  17. package/src/agents/worker/agent.json +1 -1
  18. package/src/agents/writer/AGENT.md +14 -0
  19. package/src/agents/writer/agent.json +6 -0
  20. package/src/rules/agent/00-common.md +4 -7
  21. package/src/rules/lead/01-general.md +0 -3
  22. package/src/rules/shared/10-tool-workflow.md +10 -2
  23. package/src/rules/shared/60-verification.md +2 -0
  24. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +183 -26
  25. package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +4 -0
  26. package/src/runtime/agent/orchestrator/cache-break-trace.mjs +109 -0
  27. package/src/runtime/agent/orchestrator/config.mjs +7 -2
  28. package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +16 -3
  29. package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +9 -1
  30. package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +30 -9
  31. package/src/runtime/agent/orchestrator/providers/openai-codex-metadata.mjs +18 -26
  32. package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +25 -2
  33. package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +103 -10
  34. package/src/runtime/agent/orchestrator/providers/openai-turn-state.mjs +68 -0
  35. package/src/runtime/agent/orchestrator/providers/openai-ws-delta.mjs +36 -11
  36. package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +140 -86
  37. package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +9 -13
  38. package/src/runtime/agent/orchestrator/session/agent-loop.mjs +72 -4
  39. package/src/runtime/agent/orchestrator/session/browser-snapshot-supersession.mjs +61 -0
  40. package/src/runtime/agent/orchestrator/session/compact/handoff.mjs +0 -22
  41. package/src/runtime/agent/orchestrator/session/compact/messages.mjs +2 -2
  42. package/src/runtime/agent/orchestrator/session/compact/runner.mjs +11 -23
  43. package/src/runtime/agent/orchestrator/session/compact/summary.mjs +28 -269
  44. package/src/runtime/agent/orchestrator/session/compact.mjs +0 -6
  45. package/src/runtime/agent/orchestrator/session/context-utils.mjs +86 -11
  46. package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +17 -1
  47. package/src/runtime/agent/orchestrator/session/image-strip-recovery.mjs +12 -8
  48. package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +110 -2
  49. package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +3 -16
  50. package/src/runtime/agent/orchestrator/session/loop/recall-fasttrack.mjs +80 -18
  51. package/src/runtime/agent/orchestrator/session/loop/steering.mjs +6 -0
  52. package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +3 -0
  53. package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +6 -0
  54. package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +80 -21
  55. package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +33 -72
  56. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +21 -2
  57. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +25 -51
  58. package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +3 -0
  59. package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +4 -110
  60. package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +39 -15
  61. package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +14 -4
  62. package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +41 -8
  63. package/src/runtime/agent/orchestrator/session/provider-prefix-guard.mjs +129 -12
  64. package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +2 -2
  65. package/src/runtime/agent/orchestrator/session/store/listing.mjs +8 -1
  66. package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +15 -1
  67. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +36 -2
  68. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +157 -30
  69. package/src/runtime/agent/orchestrator/session/store-summary-visibility.mjs +57 -0
  70. package/src/runtime/agent/orchestrator/session/store.mjs +3 -1
  71. package/src/runtime/agent/orchestrator/session/tool-batch.mjs +22 -0
  72. package/src/runtime/agent/orchestrator/tools/builtin/read-special-files.mjs +6 -6
  73. package/src/runtime/agent/orchestrator/tools/progress-message.mjs +4 -0
  74. package/src/runtime/attachments/pdf-extract.mjs +3 -0
  75. package/src/runtime/attachments/pdfjs-runtime.mjs +13 -0
  76. package/src/runtime/browser-bridge/action-schema.mjs +251 -0
  77. package/src/runtime/browser-bridge/client.mjs +75 -26
  78. package/src/runtime/browser-bridge/tool-defs.mjs +132 -15
  79. package/src/runtime/computer-bridge/action-schema.mjs +653 -0
  80. package/src/runtime/computer-bridge/client.mjs +211 -28
  81. package/src/runtime/computer-bridge/tool-defs.mjs +25 -45
  82. package/src/runtime/office/assurance-benchmark.mjs +358 -0
  83. package/src/runtime/office/assurance.mjs +833 -0
  84. package/src/runtime/office/benchmark.mjs +496 -0
  85. package/src/runtime/office/capabilities.mjs +551 -0
  86. package/src/runtime/office/com-adapter.mjs +283 -0
  87. package/src/runtime/office/content-model.mjs +183 -0
  88. package/src/runtime/office/contract-benchmark.mjs +105 -0
  89. package/src/runtime/office/design-library.mjs +1562 -0
  90. package/src/runtime/office/design-system.mjs +1966 -0
  91. package/src/runtime/office/index.mjs +2413 -0
  92. package/src/runtime/office/journal.mjs +82 -0
  93. package/src/runtime/office/office-com-host.ps1 +3781 -0
  94. package/src/runtime/office/office-com-session-host.ps1 +855 -0
  95. package/src/runtime/office/ooxml-validator.mjs +271 -0
  96. package/src/runtime/office/pagination.mjs +132 -0
  97. package/src/runtime/office/pdf-adapter.mjs +591 -0
  98. package/src/runtime/office/pdf-analysis.mjs +372 -0
  99. package/src/runtime/office/pdf-render.mjs +167 -0
  100. package/src/runtime/office/pdf-security.mjs +63 -0
  101. package/src/runtime/office/polish-benchmark.mjs +190 -0
  102. package/src/runtime/office/portable-ooxml.mjs +1867 -0
  103. package/src/runtime/office/quality-live-benchmark.mjs +486 -0
  104. package/src/runtime/office/quality-pipeline.mjs +136 -0
  105. package/src/runtime/office/tabular.mjs +302 -0
  106. package/src/runtime/office/templates/mixdog-executive.pptx +0 -0
  107. package/src/runtime/office/templates/mixdog-executive.pptx.mixdog.json +190 -0
  108. package/src/runtime/office/tool-defs.mjs +113 -0
  109. package/src/runtime/office/visual-diff.mjs +89 -0
  110. package/src/runtime/office/xlsx-assertions.mjs +172 -0
  111. package/src/runtime/office/xlsx-contract.mjs +147 -0
  112. package/src/runtime/shared/agent-route-config.mjs +9 -0
  113. package/src/runtime/shared/tool-execution-contract.mjs +16 -0
  114. package/src/runtime/shared/tool-surface.mjs +9 -0
  115. package/src/session-runtime/context-status.mjs +9 -3
  116. package/src/session-runtime/deferred-tool-delta.mjs +104 -0
  117. package/src/session-runtime/goal-runtime.mjs +617 -197
  118. package/src/session-runtime/lifecycle-api.mjs +50 -8
  119. package/src/session-runtime/provider-request-snapshot.mjs +33 -9
  120. package/src/session-runtime/resource-api.mjs +31 -94
  121. package/src/session-runtime/runtime-core.mjs +78 -26
  122. package/src/session-runtime/session-lifecycle.mjs +34 -12
  123. package/src/session-runtime/session-title.mjs +2 -2
  124. package/src/session-runtime/session-turn-api.mjs +15 -14
  125. package/src/session-runtime/tool-catalog-data.mjs +1 -1
  126. package/src/session-runtime/tool-catalog.mjs +38 -99
  127. package/src/session-runtime/tool-defs.mjs +6 -1
  128. package/src/session-runtime/tool-surface.mjs +18 -8
  129. package/src/session-runtime/workflow-agents-api.mjs +8 -25
  130. package/src/session-runtime/workflow.mjs +8 -6
  131. package/src/standalone/agent-tool/helpers.mjs +2 -2
  132. package/src/standalone/agent-tool/job-views.mjs +3 -1
  133. package/src/standalone/agent-tool/notify.mjs +5 -1
  134. package/src/standalone/agent-tool/render.mjs +3 -0
  135. package/src/standalone/agent-tool/spawn-flow.mjs +61 -16
  136. package/src/standalone/agent-tool/tool-def.mjs +1 -1
  137. package/src/standalone/agent-tool/worker-index.mjs +123 -0
  138. package/src/standalone/agent-tool/worker-rows.mjs +2 -1
  139. package/src/standalone/agent-tool.mjs +57 -10
  140. package/src/standalone/daemon.mjs +105 -6
  141. package/src/standalone/session-runtime-host.mjs +61 -48
  142. package/src/standalone/session-runtime-inline-host.mjs +34 -127
  143. package/src/standalone/session-runtime-worker.mjs +20 -198
  144. package/src/standalone/session-service.mjs +632 -7
  145. package/src/tui/dist/index.mjs +24 -1
  146. package/src/tui/lib/voice-setup.mjs +4 -1
  147. package/src/tui/session/context-state.mjs +2 -13
  148. package/src/tui/session/goal-continuation.mjs +38 -7
  149. package/src/tui/session/session-api-ext.mjs +9 -0
  150. package/src/tui/session/session-api.mjs +15 -1
  151. package/src/tui/session/session-flow.mjs +25 -1
  152. package/src/tui/session/turn.mjs +88 -16
  153. package/src/tui/session-local.mjs +25 -3
  154. package/src/vendor/statusline/src/gateway/route-meta.mjs +31 -0
  155. package/scripts/generate-voice-runtime-manifest.test.mjs +0 -135
  156. package/scripts/native-binary-arch.test.mjs +0 -111
  157. package/scripts/patch-replay.test.mjs +0 -94
  158. package/src/headless-exec.test.mjs +0 -539
  159. package/src/runtime/agent/orchestrator/agent-trace-timing.test.mjs +0 -57
  160. package/src/runtime/agent/orchestrator/context/collect-skills.test.mjs +0 -153
  161. package/src/runtime/agent/orchestrator/mcp/cancellation.test.mjs +0 -139
  162. package/src/runtime/agent/orchestrator/mcp/features.test.mjs +0 -66
  163. package/src/runtime/agent/orchestrator/mcp/security.test.mjs +0 -80
  164. package/src/runtime/agent/orchestrator/providers/anthropic-fast-mode.test.mjs +0 -90
  165. package/src/runtime/agent/orchestrator/providers/anthropic-server-fallback.test.mjs +0 -215
  166. package/src/runtime/agent/orchestrator/providers/antigravity-oauth.test.mjs +0 -165
  167. package/src/runtime/agent/orchestrator/providers/media-parity.test.mjs +0 -142
  168. package/src/runtime/agent/orchestrator/providers/openai-codex-identity.test.mjs +0 -153
  169. package/src/runtime/agent/orchestrator/providers/openai-codex-model.test.mjs +0 -24
  170. package/src/runtime/agent/orchestrator/providers/openai-ws-delta-parity.test.mjs +0 -190
  171. package/src/runtime/agent/orchestrator/providers/provider-replay.test.mjs +0 -235
  172. package/src/runtime/agent/orchestrator/providers/sse-framing.test.mjs +0 -719
  173. package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.test.mjs +0 -40
  174. package/src/runtime/agent/orchestrator/session/compact-policy.test.mjs +0 -176
  175. package/src/runtime/agent/orchestrator/session/compaction-read-reset.test.mjs +0 -161
  176. package/src/runtime/agent/orchestrator/session/eager-dispatch.test.mjs +0 -115
  177. package/src/runtime/agent/orchestrator/session/evidence-union.test.mjs +0 -228
  178. package/src/runtime/agent/orchestrator/session/image-strip-recovery.test.mjs +0 -245
  179. package/src/runtime/agent/orchestrator/session/lossless-tool-output.test.mjs +0 -125
  180. package/src/runtime/agent/orchestrator/session/manager/pending-messages-persistence.test.mjs +0 -325
  181. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.test.mjs +0 -70
  182. package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.test.mjs +0 -457
  183. package/src/runtime/agent/orchestrator/session/provider-prefix-guard.test.mjs +0 -117
  184. package/src/runtime/agent/orchestrator/session/reduction-metrics.test.mjs +0 -87
  185. package/src/runtime/agent/orchestrator/session/store/serialize.test.mjs +0 -60
  186. package/src/runtime/agent/orchestrator/session/store-summary-reader.test.mjs +0 -583
  187. package/src/runtime/agent/orchestrator/session/task-wait-control.test.mjs +0 -78
  188. package/src/runtime/agent/orchestrator/tools/builtin/absence-absorption.test.mjs +0 -43
  189. package/src/runtime/agent/orchestrator/tools/builtin/absolute-glob-expand.test.mjs +0 -63
  190. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool-cwd-env.test.mjs +0 -14
  191. package/src/runtime/agent/orchestrator/tools/builtin/edit-encoding-eol.test.mjs +0 -224
  192. package/src/runtime/agent/orchestrator/tools/builtin/edit-sequential-occupation.test.mjs +0 -224
  193. package/src/runtime/agent/orchestrator/tools/builtin/enoent-outside-project.test.mjs +0 -56
  194. package/src/runtime/agent/orchestrator/tools/builtin/find-search-budget.test.mjs +0 -103
  195. package/src/runtime/agent/orchestrator/tools/builtin/git-command-policy.test.mjs +0 -30
  196. package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.test.mjs +0 -390
  197. package/src/runtime/agent/orchestrator/tools/builtin/git-repo-rw-lock.test.mjs +0 -83
  198. package/src/runtime/agent/orchestrator/tools/builtin/grep-output-budget.test.mjs +0 -31
  199. package/src/runtime/agent/orchestrator/tools/builtin/grep-single-file-rescue.test.mjs +0 -106
  200. package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.test.mjs +0 -102
  201. package/src/runtime/agent/orchestrator/tools/builtin/list-tool-integrity.test.mjs +0 -152
  202. package/src/runtime/agent/orchestrator/tools/builtin/native-search-health.test.mjs +0 -24
  203. package/src/runtime/agent/orchestrator/tools/builtin/native-search-transport.test.mjs +0 -24
  204. package/src/runtime/agent/orchestrator/tools/builtin/noise-dir-visibility.test.mjs +0 -69
  205. package/src/runtime/agent/orchestrator/tools/builtin/read-glob-survey.test.mjs +0 -71
  206. package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.test.mjs +0 -56
  207. package/src/runtime/agent/orchestrator/tools/builtin/search-builders.test.mjs +0 -16
  208. package/src/runtime/agent/orchestrator/tools/builtin/search-glob-top-k.test.mjs +0 -39
  209. package/src/runtime/agent/orchestrator/tools/builtin/write-symlink.test.mjs +0 -153
  210. package/src/runtime/agent/orchestrator/tools/code-graph/aggregate-anchor-relocation.test.mjs +0 -55
  211. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.test.mjs +0 -88
  212. package/src/runtime/agent/orchestrator/tools/code-graph/loose-file-target.test.mjs +0 -72
  213. package/src/runtime/agent/orchestrator/tools/code-graph/memory-cache.test.mjs +0 -54
  214. package/src/runtime/agent/orchestrator/tools/code-graph/search-references.test.mjs +0 -20
  215. package/src/runtime/agent/orchestrator/tools/code-graph/symbol-search-scope.test.mjs +0 -55
  216. package/src/runtime/agent/orchestrator/tools/code-graph/text-span-mask.test.mjs +0 -268
  217. package/src/runtime/agent/orchestrator/tools/env-scrub.test.mjs +0 -57
  218. package/src/runtime/agent/orchestrator/tools/graph-binary-fetcher.test.mjs +0 -19
  219. package/src/runtime/agent/orchestrator/tools/lib/native-spawn-client.test.mjs +0 -104
  220. package/src/runtime/agent/orchestrator/tools/patch/engine-contract-gate.test.mjs +0 -661
  221. package/src/runtime/agent/orchestrator/tools/patch/patch-codec-eol.test.mjs +0 -552
  222. package/src/runtime/agent/orchestrator/tools/patch/patch-symlink.test.mjs +0 -141
  223. package/src/runtime/agent/orchestrator/tools/patch/v4a-pure-move.test.mjs +0 -57
  224. package/src/runtime/agent/orchestrator/tools/patch/v4a-section-coalesce.test.mjs +0 -81
  225. package/src/runtime/agent/orchestrator/tools/spawn-binary-fetcher.test.mjs +0 -52
  226. package/src/runtime/attachments/store.test.mjs +0 -209
  227. package/src/runtime/channels/lib/voice-runtime-fetcher.test.mjs +0 -17
  228. package/src/runtime/channels/lib/webhook/deliveries.test.mjs +0 -18
  229. package/src/runtime/channels/lib/webhook/relay-tunnel.test.mjs +0 -68
  230. package/src/runtime/media/adapters/codex-image.test.mjs +0 -22
  231. package/src/runtime/media/download.test.mjs +0 -52
  232. package/src/runtime/media/renditions.test.mjs +0 -99
  233. package/src/runtime/media/store.test.mjs +0 -159
  234. package/src/runtime/memory/lib/archive-security.test.mjs +0 -128
  235. package/src/runtime/memory/lib/embedding-model-config.test.mjs +0 -33
  236. package/src/runtime/memory/lib/http-wire.test.mjs +0 -15
  237. package/src/runtime/memory/lib/memory-cycle-packets.test.mjs +0 -49
  238. package/src/runtime/memory/lib/memory-cycle2-shared.test.mjs +0 -78
  239. package/src/runtime/memory/lib/memory-embedding-migration.test.mjs +0 -50
  240. package/src/runtime/memory/lib/pg/process.test.mjs +0 -36
  241. package/src/runtime/memory/lib/trace-store.test.mjs +0 -57
  242. package/src/runtime/memory/lib/transcript-ingest.test.mjs +0 -52
  243. package/src/runtime/shared/background-tasks.test.mjs +0 -78
  244. package/src/runtime/shared/bounded-download.test.mjs +0 -41
  245. package/src/runtime/shared/channel-notification-routing.test.mjs +0 -25
  246. package/src/runtime/shared/child-spawn-remote.test.mjs +0 -124
  247. package/src/runtime/shared/remote-intent.test.mjs +0 -40
  248. package/src/runtime/shared/resource-admission.test.mjs +0 -43
  249. package/src/runtime/shared/runtime-root.test.mjs +0 -34
  250. package/src/runtime/shared/schedule-time.test.mjs +0 -29
  251. package/src/runtime/shared/session-runtime-health.test.mjs +0 -83
  252. package/src/runtime/shared/skill-document.test.mjs +0 -81
  253. package/src/runtime/shared/tool-surface.test.mjs +0 -87
  254. package/src/runtime/shared/update-checker.test.mjs +0 -33
  255. package/src/runtime/shared/user-cwd.test.mjs +0 -43
  256. package/src/runtime/shared/webhook-session-run.test.mjs +0 -14
  257. package/src/session-runtime/agent-disable.test.mjs +0 -123
  258. package/src/session-runtime/cwd-plugins.test.mjs +0 -75
  259. package/src/session-runtime/cwd-tool-routing.test.mjs +0 -61
  260. package/src/session-runtime/global-extensions.test.mjs +0 -28
  261. package/src/session-runtime/goal-runtime.test.mjs +0 -108
  262. package/src/session-runtime/lifecycle-api.test.mjs +0 -21
  263. package/src/session-runtime/model-settings-persist.test.mjs +0 -105
  264. package/src/session-runtime/notification-bus.test.mjs +0 -148
  265. package/src/session-runtime/plugin-mcp-standard.test.mjs +0 -177
  266. package/src/session-runtime/prewarm.test.mjs +0 -52
  267. package/src/session-runtime/provider-request-snapshot.test.mjs +0 -37
  268. package/src/session-runtime/resource-api-global.test.mjs +0 -69
  269. package/src/session-runtime/session-lifecycle.test.mjs +0 -125
  270. package/src/session-runtime/session-title.test.mjs +0 -36
  271. package/src/session-runtime/skills-api.test.mjs +0 -99
  272. package/src/session-runtime/tool-policy-surface.test.mjs +0 -331
  273. package/src/standalone/agent-tool/helpers.test.mjs +0 -62
  274. package/src/standalone/agent-tool/notify.test.mjs +0 -37
  275. package/src/standalone/agent-tool/spawn-flow.test.mjs +0 -63
  276. package/src/standalone/channel-restart.test.mjs +0 -145
  277. package/src/standalone/channel-session-router.test.mjs +0 -37
  278. package/src/standalone/channel-worker-heartbeat.test.mjs +0 -30
  279. package/src/standalone/hook-bus/handlers.test.mjs +0 -88
  280. package/src/standalone/plugin-admin.test.mjs +0 -173
  281. package/src/standalone/session-runtime-agent-control-client.test.mjs +0 -71
  282. package/src/standalone/session-runtime-dispatch-cancel.test.mjs +0 -139
  283. package/src/standalone/session-runtime-host-factory.test.mjs +0 -31
  284. package/src/standalone/session-runtime-host-health.test.mjs +0 -160
  285. package/src/standalone/session-runtime-inline-host.test.mjs +0 -83
  286. package/src/standalone/session-runtime-provider-cooldown.test.mjs +0 -80
  287. package/src/standalone/session-runtime-shard-host.test.mjs +0 -569
  288. package/src/standalone/session-runtime-shard-router.test.mjs +0 -101
  289. package/src/tui/app/live-spinner-visibility.test.mjs +0 -44
  290. package/src/tui/app/panel-epoch.test.mjs +0 -1009
  291. package/src/tui/app/panel-handoff.test.mjs +0 -311
  292. package/src/tui/app/prompt-submit.test.mjs +0 -206
  293. package/src/tui/session/completion-card-restore.test.mjs +0 -111
  294. package/src/tui/session/goal-continuation.test.mjs +0 -84
  295. package/src/tui/session/oauth-flows.test.mjs +0 -134
  296. package/src/tui/session/queue-helpers.test.mjs +0 -46
  297. package/src/tui/session/session-action-surface.test.mjs +0 -108
  298. package/src/tui/session/task-wait-submit.test.mjs +0 -80
  299. package/src/tui/session/tool-result-status.test.mjs +0 -131
  300. package/src/tui/session/tui-steering-persist.test.mjs +0 -104
@@ -1,153 +0,0 @@
1
- import assert from 'node:assert/strict';
2
- import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
3
- import { tmpdir } from 'node:os';
4
- import { join } from 'node:path';
5
- import test from 'node:test';
6
-
7
- import {
8
- collectSkillsCached,
9
- invalidateSkillsCache,
10
- loadSkillResource,
11
- } from './collect.mjs';
12
-
13
- test('discovers global standard skill folders and ignores project-local skills and reference Markdown', () => {
14
- const root = mkdtempSync(join(tmpdir(), 'mixdog-standard-skill-'));
15
- const previousDataDir = process.env.MIXDOG_DATA_DIR;
16
- process.env.MIXDOG_DATA_DIR = join(root, 'data');
17
- try {
18
- const cwd = join(root, 'project');
19
- const skillDir = join(process.env.MIXDOG_DATA_DIR, 'skills', 'copied-skill');
20
- const projectSkillDir = join(cwd, '.mixdog', 'skills', 'project-only');
21
- mkdirSync(join(skillDir, 'references'), { recursive: true });
22
- mkdirSync(join(skillDir, 'scripts'), { recursive: true });
23
- mkdirSync(projectSkillDir, { recursive: true });
24
- writeFileSync(join(skillDir, 'SKILL.md'), [
25
- '---',
26
- 'name: copied-skill',
27
- 'description: >',
28
- ' Use when a copied standard skill',
29
- ' should be discovered.',
30
- 'metadata:',
31
- ' source: external',
32
- '---',
33
- '',
34
- '# Instructions',
35
- '',
36
- 'Read `references/guide.md` and run `scripts/check.py` when needed.',
37
- '',
38
- ].join('\n'));
39
- writeFileSync(join(skillDir, 'references', 'guide.md'), [
40
- '---',
41
- 'name: not-a-skill',
42
- 'description: This reference must never become a skill.',
43
- '---',
44
- '',
45
- '# Reference',
46
- '',
47
- ].join('\n'));
48
- writeFileSync(join(skillDir, 'scripts', 'check.py'), 'print("ok")\n');
49
- writeFileSync(join(projectSkillDir, 'SKILL.md'), [
50
- '---',
51
- 'name: project-only',
52
- 'description: This project-local skill must be ignored.',
53
- '---',
54
- '',
55
- '# Project instructions',
56
- '',
57
- ].join('\n'));
58
-
59
- invalidateSkillsCache(cwd);
60
- const copied = collectSkillsCached(cwd)
61
- .find((skill) => skill.name === 'copied-skill');
62
- assert.ok(copied);
63
- assert.equal(copied.description,
64
- 'Use when a copied standard skill should be discovered.');
65
- assert.equal(collectSkillsCached(cwd)
66
- .some((skill) => skill.name === 'not-a-skill'), false);
67
- assert.equal(collectSkillsCached(cwd)
68
- .some((skill) => skill.name === 'project-only'), false);
69
-
70
- const loaded = loadSkillResource('copied-skill', cwd);
71
- assert.match(loaded.content, /^# Instructions/);
72
- assert.equal(loaded.dir, skillDir);
73
- assert.equal(existsSync(join(loaded.dir, 'references', 'guide.md')), true);
74
- assert.equal(existsSync(join(loaded.dir, 'scripts', 'check.py')), true);
75
- } finally {
76
- invalidateSkillsCache(join(root, 'project'));
77
- if (previousDataDir === undefined) delete process.env.MIXDOG_DATA_DIR;
78
- else process.env.MIXDOG_DATA_DIR = previousDataDir;
79
- rmSync(root, { recursive: true, force: true });
80
- }
81
- });
82
-
83
- test('loads skills only from globally enabled plugins', () => {
84
- const root = mkdtempSync(join(tmpdir(), 'mixdog-plugin-skill-'));
85
- const previousDataDir = process.env.MIXDOG_DATA_DIR;
86
- process.env.MIXDOG_DATA_DIR = join(root, 'data');
87
- try {
88
- const enabledRoot = join(root, 'enabled-plugin');
89
- const disabledRoot = join(root, 'disabled-plugin');
90
- const writeSkill = (pluginRoot, name) => {
91
- const dir = join(pluginRoot, 'skills', name);
92
- mkdirSync(dir, { recursive: true });
93
- writeFileSync(join(dir, 'SKILL.md'), [
94
- '---',
95
- `name: ${name}`,
96
- `description: Use when ${name} is needed.`,
97
- '---',
98
- '',
99
- '# Instructions',
100
- '',
101
- ].join('\n'));
102
- };
103
- writeSkill(enabledRoot, 'enabled-plugin-skill');
104
- writeSkill(disabledRoot, 'disabled-plugin-skill');
105
- const registryDir = join(process.env.MIXDOG_DATA_DIR, 'plugins');
106
- mkdirSync(registryDir, { recursive: true });
107
- writeFileSync(join(registryDir, 'registry.json'), JSON.stringify({
108
- plugins: [
109
- { id: 'enabled', root: enabledRoot, enabled: true },
110
- { id: 'disabled', root: disabledRoot, enabled: false },
111
- ],
112
- }));
113
-
114
- invalidateSkillsCache();
115
- const names = collectSkillsCached(join(root, 'any-project')).map((skill) => skill.name);
116
- assert.equal(names.includes('enabled-plugin-skill'), true);
117
- assert.equal(names.includes('disabled-plugin-skill'), false);
118
- } finally {
119
- invalidateSkillsCache();
120
- if (previousDataDir === undefined) delete process.env.MIXDOG_DATA_DIR;
121
- else process.env.MIXDOG_DATA_DIR = previousDataDir;
122
- rmSync(root, { recursive: true, force: true });
123
- }
124
- });
125
-
126
- test('requires a standard folder name that matches the manifest name', () => {
127
- const root = mkdtempSync(join(tmpdir(), 'mixdog-mismatched-skill-'));
128
- const previousDataDir = process.env.MIXDOG_DATA_DIR;
129
- process.env.MIXDOG_DATA_DIR = join(root, 'data');
130
- try {
131
- const cwd = join(root, 'project');
132
- const skillDir = join(process.env.MIXDOG_DATA_DIR, 'skills', 'folder-name');
133
- mkdirSync(skillDir, { recursive: true });
134
- writeFileSync(join(skillDir, 'SKILL.md'), [
135
- '---',
136
- 'name: different-name',
137
- 'description: Use when testing mismatched folders.',
138
- '---',
139
- '',
140
- '# Instructions',
141
- '',
142
- ].join('\n'));
143
-
144
- invalidateSkillsCache(cwd);
145
- assert.equal(collectSkillsCached(cwd)
146
- .some((skill) => skill.name === 'different-name'), false);
147
- } finally {
148
- invalidateSkillsCache(join(root, 'project'));
149
- if (previousDataDir === undefined) delete process.env.MIXDOG_DATA_DIR;
150
- else process.env.MIXDOG_DATA_DIR = previousDataDir;
151
- rmSync(root, { recursive: true, force: true });
152
- }
153
- });
@@ -1,139 +0,0 @@
1
- // MCP tool-call cancellation: an aborted caller (hook timeout, aborted turn,
2
- // closed pane) must settle immediately AND release its admission slot, in every
3
- // phase of a call — queued, admitted-and-running, and stalled mid-reconnect.
4
- import assert from 'node:assert/strict';
5
- import test from 'node:test';
6
-
7
- import {
8
- _registerMcpServerForTest,
9
- executeMcpTool,
10
- getMcpAdmissionSnapshot,
11
- } from './client.mjs';
12
-
13
- const never = () => new Promise(() => {});
14
-
15
- function deferred() {
16
- let resolve;
17
- const promise = new Promise((res) => { resolve = res; });
18
- return { promise, resolve };
19
- }
20
-
21
- async function waitFor(predicate, label, timeoutMs = 2_000) {
22
- const deadline = Date.now() + timeoutMs;
23
- while (Date.now() < deadline) {
24
- if (predicate()) return;
25
- await new Promise((resolve) => { setTimeout(resolve, 10); });
26
- }
27
- throw new Error(`timed out waiting for ${label}`);
28
- }
29
-
30
- function slotsFor(scopeId, serverName) {
31
- const gate = getMcpAdmissionSnapshot(scopeId).find((entry) => entry.name === serverName);
32
- return { active: gate?.active ?? 0, queued: gate?.queued ?? 0 };
33
- }
34
-
35
- /** Settle-state probe: a cancellation fix is only real if the promise settles
36
- * while the callee is still stuck. */
37
- function track(promise) {
38
- const state = { settled: false, error: null };
39
- promise.then(
40
- () => { state.settled = true; },
41
- (error) => { state.settled = true; state.error = error; },
42
- );
43
- return state;
44
- }
45
-
46
- test('an aborted caller settles a QUEUED call and frees its queue seat', async () => {
47
- const scopeId = 'mcp-cancel-queued';
48
- _registerMcpServerForTest(scopeId, 'busy', [{ name: 'hang' }], {
49
- cfg: { maxConcurrency: 1, timeoutMs: 'off' },
50
- callTool: never,
51
- });
52
- const held = executeMcpTool('mcp__busy__hang', {}, { scopeId });
53
- held.catch(() => {});
54
- await waitFor(() => slotsFor(scopeId, 'busy').active === 1, 'the first call to occupy the slot');
55
-
56
- const controller = new AbortController();
57
- const queued = executeMcpTool('mcp__busy__hang', {}, { scopeId, signal: controller.signal });
58
- const state = track(queued);
59
- await waitFor(() => slotsFor(scopeId, 'busy').queued === 1, 'the second call to queue');
60
-
61
- controller.abort(new Error('queued hook aborted'));
62
- await assert.rejects(queued, /queued hook aborted/);
63
- assert.equal(state.settled, true);
64
- assert.equal(slotsFor(scopeId, 'busy').queued, 0, 'the queue seat is released');
65
- });
66
-
67
- test('an aborted caller settles an ADMITTED call whose server ignores cancellation', async () => {
68
- const scopeId = 'mcp-cancel-active';
69
- let sawSignal = false;
70
- _registerMcpServerForTest(scopeId, 'deaf', [{ name: 'hang' }], {
71
- // Server call timeout DISABLED: the caller's abort is the only bound.
72
- cfg: { maxConcurrency: 1, timeoutMs: 'off' },
73
- callTool: (_params, _schema, options) => {
74
- sawSignal = Boolean(options?.signal);
75
- return never();
76
- },
77
- });
78
- const controller = new AbortController();
79
- const call = executeMcpTool('mcp__deaf__hang', {}, { scopeId, signal: controller.signal });
80
- const state = track(call);
81
- await waitFor(() => slotsFor(scopeId, 'deaf').active === 1, 'the call to be admitted');
82
- assert.equal(state.settled, false, 'a running call does not settle on its own');
83
-
84
- controller.abort(new Error('mcp_tool hook timed out: mcp__deaf__hang'));
85
- await assert.rejects(call, /mcp_tool hook timed out/);
86
- assert.equal(sawSignal, true, 'the abort signal reaches the SDK request');
87
- await waitFor(() => slotsFor(scopeId, 'deaf').active === 0, 'the admission slot to be released');
88
-
89
- // The freed slot is genuinely reusable.
90
- _registerMcpServerForTest(scopeId, 'deaf-ok', [{ name: 'go' }], {
91
- cfg: { maxConcurrency: 1 },
92
- callTool: async () => ({ content: [{ type: 'text', text: 'ran after cancel' }] }),
93
- });
94
- assert.equal(await executeMcpTool('mcp__deaf-ok__go', {}, { scopeId }), 'ran after cancel');
95
- });
96
-
97
- test('an aborted caller settles a call stalled inside a shared reconnect', async () => {
98
- const scopeId = 'mcp-cancel-reconnect';
99
- const closeEntered = deferred();
100
- _registerMcpServerForTest(scopeId, 'flaky', [{ name: 'boom' }], {
101
- cfg: { maxConcurrency: 1, timeoutMs: 'off' },
102
- // A plain failure (not a timeout, not an abort) is what sends the call into
103
- // the shared reconnect path.
104
- callTool: async () => { throw new Error('transport went away'); },
105
- // Teardown never completes, so the reconnect stays in flight forever.
106
- close: () => { closeEntered.resolve(); return never(); },
107
- });
108
- const controller = new AbortController();
109
- const call = executeMcpTool('mcp__flaky__boom', {}, { scopeId, signal: controller.signal });
110
- const state = track(call);
111
- await closeEntered.promise;
112
- await waitFor(() => slotsFor(scopeId, 'flaky').active === 1, 'the call to hold its slot in reconnect');
113
- assert.equal(state.settled, false, 'the stalled reconnect keeps the call pending');
114
-
115
- controller.abort(new Error('hook aborted during reconnect'));
116
- await assert.rejects(call, /hook aborted during reconnect/);
117
- await waitFor(
118
- () => slotsFor(scopeId, 'flaky').active === 0,
119
- 'the admission slot to be released while the reconnect is still stalled',
120
- );
121
- });
122
-
123
- test('cancellation never turns into a reconnect-and-retry (no duplicate side effect)', async () => {
124
- const scopeId = 'mcp-cancel-no-retry';
125
- let calls = 0;
126
- const closeEntered = deferred();
127
- _registerMcpServerForTest(scopeId, 'once', [{ name: 'effect' }], {
128
- cfg: { maxConcurrency: 1, timeoutMs: 'off' },
129
- callTool: async () => { calls += 1; throw new Error('transport went away'); },
130
- close: () => { closeEntered.resolve(); return never(); },
131
- });
132
- const controller = new AbortController();
133
- const call = executeMcpTool('mcp__once__effect', {}, { scopeId, signal: controller.signal });
134
- await closeEntered.promise;
135
- controller.abort(new Error('aborted before retry'));
136
- await assert.rejects(call, /aborted before retry/);
137
- await new Promise((resolve) => { setTimeout(resolve, 50); });
138
- assert.equal(calls, 1, 'the aborted call is never replayed against a reconnected server');
139
- });
@@ -1,66 +0,0 @@
1
- import assert from 'node:assert/strict';
2
- import test from 'node:test';
3
-
4
- import {
5
- _registerMcpServerForTest,
6
- disconnectAll,
7
- executeMcpTool,
8
- getMcpServerStatus,
9
- getMcpTools,
10
- } from './client.mjs';
11
-
12
- test('resources and prompts become callable MCP feature tools', async () => {
13
- const scopeId = 'mcp-features-test';
14
- const calls = [];
15
- _registerMcpServerForTest(scopeId, 'catalog', [], {
16
- capabilities: {
17
- resources: {},
18
- prompts: {},
19
- },
20
- client: {
21
- listResources: async (params) => {
22
- calls.push(['listResources', params]);
23
- return { resources: [{ uri: 'file:///guide.md', name: 'Guide' }] };
24
- },
25
- listResourceTemplates: async () => ({ resourceTemplates: [] }),
26
- readResource: async ({ uri }) => ({ contents: [{ uri, text: '# Guide' }] }),
27
- listPrompts: async () => ({ prompts: [{ name: 'review' }] }),
28
- getPrompt: async ({ name, arguments: args }) => ({
29
- description: 'Review prompt',
30
- messages: [{ role: 'user', content: { type: 'text', text: `${name}:${args.depth}` } }],
31
- }),
32
- },
33
- });
34
- try {
35
- const names = getMcpTools(scopeId).map((tool) => tool.name);
36
- assert.deepEqual(names, [
37
- 'mcp__catalog__mixdog_list_resources',
38
- 'mcp__catalog__mixdog_list_resource_templates',
39
- 'mcp__catalog__mixdog_read_resource',
40
- 'mcp__catalog__mixdog_list_prompts',
41
- 'mcp__catalog__mixdog_get_prompt',
42
- ]);
43
- assert.deepEqual(getMcpServerStatus(scopeId)[0]?.capabilities, {
44
- tools: false,
45
- prompts: true,
46
- resources: true,
47
- });
48
-
49
- const resources = await executeMcpTool(
50
- 'mcp__catalog__mixdog_list_resources',
51
- { cursor: 'next-page' },
52
- { scopeId },
53
- );
54
- assert.match(resources, /file:\/\/\/guide\.md/);
55
- assert.deepEqual(calls, [['listResources', { cursor: 'next-page' }]]);
56
-
57
- const prompt = await executeMcpTool(
58
- 'mcp__catalog__mixdog_get_prompt',
59
- { name: 'review', arguments: { depth: 'deep' } },
60
- { scopeId },
61
- );
62
- assert.match(prompt, /review:deep/);
63
- } finally {
64
- await disconnectAll({ scopeId });
65
- }
66
- });
@@ -1,80 +0,0 @@
1
- import assert from 'node:assert/strict';
2
- import test from 'node:test';
3
-
4
- import {
5
- mcpUrlForLog,
6
- normalizeMcpTransportUrl,
7
- resolveMcpHttpHeaders,
8
- resolveMcpStdioEnvironment,
9
- scrubMcpConnectionMessage,
10
- } from './client.mjs';
11
- test('MCP transport requires encryption except for loopback', () => {
12
- assert.equal(
13
- normalizeMcpTransportUrl('http://127.0.0.1:3000/mcp', 'http'),
14
- 'http://127.0.0.1:3000/mcp',
15
- );
16
- assert.equal(
17
- normalizeMcpTransportUrl('ws://localhost:3000/mcp', 'ws'),
18
- 'ws://localhost:3000/mcp',
19
- );
20
- assert.match(normalizeMcpTransportUrl('https://mcp.example/mcp', 'http'), /^https:/);
21
- assert.match(normalizeMcpTransportUrl('wss://mcp.example/mcp', 'ws'), /^wss:/);
22
- assert.throws(
23
- () => normalizeMcpTransportUrl('http://mcp.example/mcp', 'http'),
24
- /must use https/,
25
- );
26
- assert.throws(
27
- () => normalizeMcpTransportUrl('ws://mcp.example/mcp', 'ws'),
28
- /must use wss/,
29
- );
30
- assert.throws(
31
- () => normalizeMcpTransportUrl('https://user:secret@mcp.example/mcp', 'http'),
32
- /must not contain credentials/,
33
- );
34
- });
35
-
36
- test('MCP logs and failures redact URL and header credentials', () => {
37
- const secret = 'mcp-secret-value';
38
- const url = `https://mcp.example/mcp?token=${secret}`;
39
- assert.doesNotMatch(mcpUrlForLog(url), new RegExp(secret));
40
- const scrubbed = scrubMcpConnectionMessage(
41
- `failed ${url} Authorization: Bearer ${secret}`,
42
- { url, headers: { Authorization: `Bearer ${secret}` } },
43
- );
44
- assert.doesNotMatch(scrubbed, new RegExp(secret));
45
- assert.match(scrubbed, /redacted/);
46
- });
47
-
48
- test('MCP HTTP auth resolves from environment without storing secret values', () => {
49
- const headers = resolveMcpHttpHeaders({
50
- bearer_token_env_var: 'MCP_TOKEN',
51
- env_http_headers: { 'X-API-Key': 'MCP_API_KEY' },
52
- headers: { 'X-Static': '${MCP_STATIC}', Authorization: 'Explicit auth' },
53
- }, {
54
- MCP_TOKEN: 'bearer-secret',
55
- MCP_API_KEY: 'key-secret',
56
- MCP_STATIC: 'expanded',
57
- });
58
- assert.deepEqual(headers, {
59
- Authorization: 'Explicit auth',
60
- 'X-API-Key': 'key-secret',
61
- 'X-Static': 'expanded',
62
- });
63
- });
64
-
65
- test('MCP stdio passthrough narrows inherited environment only when configured', () => {
66
- const env = {
67
- PATH: '/bin',
68
- HOME: '/home/test',
69
- KEEP_ME: 'kept',
70
- DROP_ME: 'dropped',
71
- };
72
- assert.equal(resolveMcpStdioEnvironment({ env: { LOCAL: '${KEEP_ME}' } }, env).DROP_ME, 'dropped');
73
- const narrowed = resolveMcpStdioEnvironment({
74
- env_vars: ['KEEP_ME'],
75
- env: { LOCAL: '${KEEP_ME}' },
76
- }, env);
77
- assert.equal(narrowed.KEEP_ME, 'kept');
78
- assert.equal(narrowed.LOCAL, 'kept');
79
- assert.equal(narrowed.DROP_ME, undefined);
80
- });
@@ -1,90 +0,0 @@
1
- import assert from 'node:assert/strict';
2
- import test from 'node:test';
3
-
4
- import {
5
- _FAST_MODE_POLICY,
6
- clearFastModeCooldown,
7
- fastModeAvailable,
8
- fastModeCooldownRemainingMs,
9
- fastModeDisabledReason,
10
- noteFastModeCapacityError,
11
- } from './anthropic-fast-mode.mjs';
12
-
13
- test.beforeEach(() => clearFastModeCooldown());
14
- test.after(() => clearFastModeCooldown());
15
-
16
- test('non-capacity failures and standard-speed requests leave fast mode alone', () => {
17
- assert.equal(noteFastModeCapacityError({ httpStatus: 429 }, { fast: false }), 'ignored');
18
- assert.equal(noteFastModeCapacityError({ httpStatus: 500 }, { fast: true }), 'ignored');
19
- assert.equal(noteFastModeCapacityError({ httpStatus: 401 }, { fast: true }), 'ignored');
20
- assert.equal(fastModeAvailable(), true);
21
- });
22
-
23
- test('a short server window keeps fast mode so the cache prefix survives', () => {
24
- const decision = noteFastModeCapacityError(
25
- { httpStatus: 429, retryAfterMs: _FAST_MODE_POLICY.SHORT_RETRY_THRESHOLD_MS - 1 },
26
- { fast: true },
27
- );
28
- assert.equal(decision, 'retry-fast');
29
- assert.equal(fastModeAvailable(), true);
30
- });
31
-
32
- test('a long window downgrades to standard speed for at least the cooldown floor', () => {
33
- const now = 1_000_000;
34
- const retryAfterMs = 20_000;
35
- assert.equal(
36
- noteFastModeCapacityError({ httpStatus: 429, retryAfterMs }, { fast: true, now }),
37
- 'downgrade',
38
- );
39
- assert.equal(fastModeAvailable(now), false);
40
- // 20s window is below the floor, so the floor wins.
41
- assert.equal(fastModeCooldownRemainingMs(now), _FAST_MODE_POLICY.MIN_COOLDOWN_MS);
42
- assert.equal(fastModeAvailable(now + _FAST_MODE_POLICY.MIN_COOLDOWN_MS), true);
43
- });
44
-
45
- test('a long window longer than the floor is honored verbatim', () => {
46
- const now = 2_000_000;
47
- const retryAfterMs = _FAST_MODE_POLICY.MIN_COOLDOWN_MS * 3;
48
- noteFastModeCapacityError({ httpStatus: 529, retryAfterMs }, { fast: true, now });
49
- assert.equal(fastModeCooldownRemainingMs(now), retryAfterMs);
50
- });
51
-
52
- test('a 529 with no window uses the default cooldown', () => {
53
- const now = 3_000_000;
54
- assert.equal(noteFastModeCapacityError({ httpStatus: 529 }, { fast: true, now }), 'downgrade');
55
- assert.equal(fastModeCooldownRemainingMs(now), _FAST_MODE_POLICY.DEFAULT_COOLDOWN_MS);
56
- });
57
-
58
- test('cooldowns never shrink an existing longer cooldown', () => {
59
- const now = 4_000_000;
60
- noteFastModeCapacityError({ httpStatus: 429, retryAfterMs: 600_000 }, { fast: true, now });
61
- noteFastModeCapacityError({ httpStatus: 429, retryAfterMs: 60_000 }, { fast: true, now });
62
- assert.equal(fastModeCooldownRemainingMs(now), 600_000);
63
- });
64
-
65
- test('an overage-disabled header turns fast mode off for the process', () => {
66
- const decision = noteFastModeCapacityError(
67
- {
68
- httpStatus: 429,
69
- headers: new Map([[_FAST_MODE_POLICY.OVERAGE_DISABLED_HEADER, 'no_overage']]),
70
- retryAfterMs: 1,
71
- },
72
- { fast: true },
73
- );
74
- assert.equal(decision, 'disabled');
75
- assert.equal(fastModeDisabledReason(), 'no_overage');
76
- assert.equal(fastModeAvailable(Date.now() + 86_400_000), false);
77
- clearFastModeCooldown();
78
- assert.equal(fastModeAvailable(), true);
79
- });
80
-
81
- test('plain-object headers resolve case-insensitively', () => {
82
- noteFastModeCapacityError(
83
- {
84
- httpStatus: 429,
85
- response: { headers: { 'ANTHROPIC-RateLimit-Unified-Overage-Disabled-Reason': 'billing' } },
86
- },
87
- { fast: true },
88
- );
89
- assert.equal(fastModeDisabledReason(), 'billing');
90
- });