mixdog 0.9.95 → 0.9.97

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 (282) hide show
  1. package/LICENSES/Apache-2.0.txt +201 -0
  2. package/LICENSES/MIT.txt +56 -0
  3. package/LICENSES/codex-NOTICE.txt +6 -0
  4. package/NOTICE.md +46 -9
  5. package/README.md +0 -17
  6. package/package.json +16 -12
  7. package/scripts/.tmp-coverage-report.mjs +96 -0
  8. package/scripts/build-tui.mjs +17 -1
  9. package/scripts/{channel-daemon-stub.mjs → daemon-stub.mjs} +18 -12
  10. package/scripts/fixtures/patch-replay-corpus.json +98 -0
  11. package/src/defaults/mixdog-config.template.json +5 -8
  12. package/src/defaults/skills/setup/SKILL.md +1 -1
  13. package/src/lib/keychain-cjs.cjs +1 -1
  14. package/src/lib/mixdog-debug.cjs +2 -3
  15. package/src/rules/agent/30-explorer.md +7 -4
  16. package/src/rules/lead/01-general.md +1 -2
  17. package/src/rules/lead/lead-tool.md +0 -3
  18. package/src/rules/shared/01-tool.md +21 -29
  19. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +18 -2
  20. package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +31 -1
  21. package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +6 -17
  22. package/src/runtime/agent/orchestrator/agent-trace-format.mjs +12 -1
  23. package/src/runtime/agent/orchestrator/agent-trace-io.mjs +4 -13
  24. package/src/runtime/agent/orchestrator/config.mjs +246 -67
  25. package/src/runtime/agent/orchestrator/mcp/client.mjs +104 -41
  26. package/src/runtime/agent/orchestrator/mcp/reconnect-singleflight.mjs +23 -0
  27. package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +113 -14
  28. package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +5 -1
  29. package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +32 -11
  30. package/src/runtime/agent/orchestrator/providers/gemini.mjs +89 -2
  31. package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +12 -1
  32. package/src/runtime/agent/orchestrator/providers/openai-compat-xai.mjs +19 -1
  33. package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +144 -39
  34. package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +22 -8
  35. package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +15 -1
  36. package/src/runtime/agent/orchestrator/providers/openai-transport-policy.mjs +1 -1
  37. package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +3 -4
  38. package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +3 -6
  39. package/src/runtime/agent/orchestrator/providers/registry.mjs +2 -2
  40. package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +67 -7
  41. package/src/runtime/agent/orchestrator/providers/stream-json-pool.mjs +291 -0
  42. package/src/runtime/agent/orchestrator/providers/stream-json-worker.mjs +21 -0
  43. package/src/runtime/agent/orchestrator/session/agent-loop.mjs +36 -10
  44. package/src/runtime/agent/orchestrator/session/compact.mjs +1 -1
  45. package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +22 -33
  46. package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +13 -0
  47. package/src/runtime/agent/orchestrator/session/loop/termination.mjs +2 -2
  48. package/src/runtime/agent/orchestrator/session/loop/tool-classify.mjs +0 -24
  49. package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +21 -29
  50. package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +7 -10
  51. package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +45 -25
  52. package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +2 -3
  53. package/src/runtime/agent/orchestrator/session/manager/pending-messages.mjs +142 -84
  54. package/src/runtime/agent/orchestrator/session/manager/prefetch-bridge.mjs +12 -6
  55. package/src/runtime/agent/orchestrator/session/manager/runtime-loaders.mjs +4 -0
  56. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +31 -1
  57. package/src/runtime/agent/orchestrator/session/manager/session-lock.mjs +38 -2
  58. package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +29 -9
  59. package/src/runtime/agent/orchestrator/session/manager.mjs +2 -0
  60. package/src/runtime/agent/orchestrator/session/result-classification.mjs +65 -0
  61. package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +86 -8
  62. package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +10 -3
  63. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +4 -0
  64. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +71 -42
  65. package/src/runtime/agent/orchestrator/session/tool-batch.mjs +4 -33
  66. package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +4 -5
  67. package/src/runtime/agent/orchestrator/stall-policy.mjs +1 -1
  68. package/src/runtime/agent/orchestrator/tools/bash-session.mjs +2 -2
  69. package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +35 -1
  70. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +116 -26
  71. package/src/runtime/agent/orchestrator/tools/builtin/binary-file.mjs +92 -19
  72. package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +8 -9
  73. package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +2 -2
  74. package/src/runtime/agent/orchestrator/tools/builtin/device-paths.mjs +2 -2
  75. package/src/runtime/agent/orchestrator/tools/builtin/fs-reachability.mjs +2 -2
  76. package/src/runtime/agent/orchestrator/tools/builtin/lib/grep-context-expander.mjs +6 -15
  77. package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +12 -26
  78. package/src/runtime/agent/orchestrator/tools/builtin/read-image.mjs +5 -5
  79. package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +83 -33
  80. package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +42 -45
  81. package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +27 -9
  82. package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +7 -0
  83. package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +17 -39
  84. package/src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs +73 -0
  85. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-paths.mjs +1 -1
  86. package/src/runtime/agent/orchestrator/tools/builtin/shell-job-spawn.mjs +0 -2
  87. package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +3 -8
  88. package/src/runtime/agent/orchestrator/tools/builtin/shell-runtime.mjs +30 -0
  89. package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +5 -5
  90. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +142 -26
  91. package/src/runtime/agent/orchestrator/tools/code-graph/search-references.mjs +12 -1
  92. package/src/runtime/agent/orchestrator/tools/code-graph/search.mjs +47 -19
  93. package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +3 -2
  94. package/src/runtime/agent/orchestrator/tools/env-scrub.mjs +1 -2
  95. package/src/runtime/agent/orchestrator/tools/lib/pwsh-standby-pool.mjs +83 -13
  96. package/src/runtime/agent/orchestrator/tools/patch/matcher.mjs +39 -1
  97. package/src/runtime/agent/orchestrator/tools/patch/native-server.mjs +1 -1
  98. package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +94 -20
  99. package/src/runtime/agent/orchestrator/tools/patch/parsing.mjs +16 -0
  100. package/src/runtime/agent/orchestrator/tools/patch/v4a-convert.mjs +108 -12
  101. package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +12 -11
  102. package/src/runtime/agent/orchestrator/tools/patch.mjs +1 -1
  103. package/src/runtime/agent/orchestrator/tools/shell-command.mjs +63 -9
  104. package/src/runtime/agent/orchestrator/tools/shell-exec-output.mjs +2 -2
  105. package/src/runtime/channels/lib/config.mjs +34 -34
  106. package/src/runtime/channels/lib/inbound-handler.mjs +8 -8
  107. package/src/runtime/channels/lib/interaction-handlers.mjs +6 -6
  108. package/src/runtime/channels/lib/memory-client.mjs +31 -157
  109. package/src/runtime/channels/lib/output-forwarder.mjs +16 -16
  110. package/src/runtime/channels/lib/owned-runtime.mjs +60 -60
  111. package/src/runtime/channels/lib/owner-heartbeat.mjs +1 -1
  112. package/src/runtime/channels/lib/{backend-dispatch.mjs → provider-dispatch.mjs} +6 -6
  113. package/src/runtime/channels/lib/runtime-paths.mjs +4 -30
  114. package/src/runtime/channels/lib/scheduler.mjs +2 -2
  115. package/src/runtime/channels/lib/status-snapshot.mjs +3 -3
  116. package/src/runtime/channels/lib/tool-dispatch.mjs +4 -4
  117. package/src/runtime/channels/lib/worker-bootstrap.mjs +1 -1
  118. package/src/runtime/channels/lib/worker-ipc.mjs +7 -7
  119. package/src/runtime/channels/lib/worker-main.mjs +38 -38
  120. package/src/runtime/channels/{backends → providers}/discord-access.mjs +1 -1
  121. package/src/runtime/channels/{backends → providers}/discord-gateway.mjs +1 -1
  122. package/src/runtime/channels/{backends → providers}/discord.mjs +3 -3
  123. package/src/runtime/channels/{backends → providers}/telegram.mjs +12 -12
  124. package/src/runtime/channels/tool-defs.mjs +1 -1
  125. package/src/runtime/memory/index.mjs +76 -248
  126. package/src/runtime/memory/lib/agent-ipc.mjs +146 -81
  127. package/src/runtime/memory/lib/compact-vector-cache.mjs +88 -0
  128. package/src/runtime/memory/lib/core-memory-store.mjs +18 -1
  129. package/src/runtime/memory/lib/cycle-llm-adapters.mjs +13 -34
  130. package/src/runtime/memory/lib/embedding-provider.mjs +47 -26
  131. package/src/runtime/memory/lib/embedding-worker.mjs +30 -34
  132. package/src/runtime/memory/lib/http-router.mjs +9 -6
  133. package/src/runtime/memory/lib/ko-morph.mjs +3 -20
  134. package/src/runtime/memory/lib/memory-action-handlers.mjs +2 -1
  135. package/src/runtime/memory/lib/memory-config-flags.mjs +1 -1
  136. package/src/runtime/memory/lib/memory-cycle1.mjs +1 -0
  137. package/src/runtime/memory/lib/memory-cycle2-gate.mjs +4 -2
  138. package/src/runtime/memory/lib/memory-cycle2-mutations.mjs +1 -0
  139. package/src/runtime/memory/lib/memory-cycle2-shared.mjs +4 -1
  140. package/src/runtime/memory/lib/memory-cycle3.mjs +3 -1
  141. package/src/runtime/memory/lib/memory-daemon-lifecycle.mjs +5 -0
  142. package/src/runtime/memory/lib/memory-log.mjs +1 -1
  143. package/src/runtime/memory/lib/memory-process-lock.mjs +5 -60
  144. package/src/runtime/memory/lib/memory.mjs +1 -1
  145. package/src/runtime/memory/lib/pg/process.mjs +32 -9
  146. package/src/runtime/memory/lib/session-ingest.mjs +1 -1
  147. package/src/runtime/memory/tool-defs.mjs +1 -5
  148. package/src/runtime/search/index.mjs +2 -2
  149. package/src/runtime/search/tool-defs.mjs +2 -2
  150. package/src/runtime/shared/abort-race.mjs +70 -0
  151. package/src/runtime/shared/agent-route-config.mjs +119 -0
  152. package/src/runtime/shared/atomic-file.mjs +80 -4
  153. package/src/runtime/shared/channel-notification-routing.mjs +2 -2
  154. package/src/runtime/shared/child-guardian.mjs +204 -108
  155. package/src/runtime/shared/child-spawn-gate.mjs +139 -72
  156. package/src/runtime/shared/config.mjs +120 -47
  157. package/src/runtime/shared/llm/index.mjs +1 -1
  158. package/src/runtime/shared/owner-fair-gate.mjs +134 -0
  159. package/src/runtime/shared/resource-admission.mjs +150 -100
  160. package/src/runtime/shared/stream-progress.mjs +6 -0
  161. package/src/runtime/shared/tool-execution-owner.mjs +12 -0
  162. package/src/runtime/shared/tool-result-summary.mjs +1 -1
  163. package/src/runtime/shared/tool-surface.mjs +91 -27
  164. package/src/runtime/shared/tool-workload-gates.mjs +29 -0
  165. package/src/runtime/shared/turn-snapshot.mjs +47 -6
  166. package/src/runtime/shared/turn-worktree-snapshot.mjs +14 -2
  167. package/src/session-runtime/channel-config-api.mjs +5 -5
  168. package/src/session-runtime/config-helpers.mjs +39 -37
  169. package/src/session-runtime/config-lifecycle.mjs +27 -27
  170. package/src/session-runtime/lifecycle-api.mjs +22 -3
  171. package/src/session-runtime/memory-runtime-prewarm.mjs +15 -0
  172. package/src/session-runtime/model-route-api.mjs +7 -5
  173. package/src/session-runtime/prewarm.mjs +1 -1
  174. package/src/session-runtime/provider-auth-api.mjs +0 -7
  175. package/src/session-runtime/provider-models.mjs +1 -1
  176. package/src/session-runtime/remote-control.mjs +6 -7
  177. package/src/session-runtime/runtime-core.mjs +63 -39
  178. package/src/session-runtime/runtime-tunables.mjs +4 -4
  179. package/src/session-runtime/self-update.mjs +1 -1
  180. package/src/session-runtime/session-lifecycle.mjs +45 -17
  181. package/src/session-runtime/session-title.mjs +1 -1
  182. package/src/session-runtime/session-turn-api.mjs +96 -24
  183. package/src/session-runtime/settings-api.mjs +12 -24
  184. package/src/session-runtime/tool-defs.mjs +3 -3
  185. package/src/session-runtime/workflow-agents-api.mjs +55 -81
  186. package/src/session-runtime/workflow.mjs +14 -24
  187. package/src/standalone/agent-dispatch-broker.mjs +198 -0
  188. package/src/standalone/agent-tool/helpers.mjs +2 -2
  189. package/src/standalone/agent-tool/spawn-flow.mjs +2 -0
  190. package/src/standalone/agent-tool/spawn-preset.mjs +11 -21
  191. package/src/standalone/agent-tool/tool-def.mjs +0 -14
  192. package/src/standalone/channel-admin.mjs +53 -64
  193. package/src/standalone/{channel-daemon-client.mjs → channel-client.mjs} +33 -19
  194. package/src/standalone/{channel-daemon-transport.mjs → channel-transport.mjs} +127 -46
  195. package/src/standalone/channel-worker.mjs +124 -647
  196. package/src/standalone/{backend-daemon.mjs → daemon.mjs} +270 -154
  197. package/src/standalone/explore-tool.mjs +187 -70
  198. package/src/standalone/fair-call-scheduler.mjs +264 -0
  199. package/src/standalone/memory-runtime-proxy.mjs +58 -1
  200. package/src/standalone/session-client.mjs +1134 -0
  201. package/src/standalone/session-protocol.mjs +192 -0
  202. package/src/standalone/session-runtime-pool.mjs +393 -0
  203. package/src/standalone/session-runtime-record.mjs +20 -0
  204. package/src/standalone/session-runtime-worker.mjs +203 -0
  205. package/src/standalone/{engine-daemon-service.mjs → session-service.mjs} +481 -224
  206. package/src/standalone/{engine-daemon-transport.mjs → session-transport.mjs} +390 -121
  207. package/src/standalone/session-wire.mjs +55 -0
  208. package/src/tui/App.jsx +34 -21
  209. package/src/tui/app/app-format.mjs +1 -1
  210. package/src/tui/app/app-view.jsx +5 -2
  211. package/src/tui/app/channel-pickers.mjs +41 -41
  212. package/src/tui/app/core-memory-picker.mjs +19 -19
  213. package/src/tui/app/doctor.mjs +5 -11
  214. package/src/tui/app/input-parsers.mjs +2 -2
  215. package/src/tui/app/message-selector.mjs +103 -0
  216. package/src/tui/app/onboarding-steps.mjs +3 -4
  217. package/src/tui/app/project-picker.mjs +80 -56
  218. package/src/tui/app/prompt-submit.mjs +48 -43
  219. package/src/tui/app/resume-picker.mjs +2 -2
  220. package/src/tui/app/route-pickers.mjs +3 -1
  221. package/src/tui/app/settings-picker.mjs +31 -33
  222. package/src/tui/app/transcript-window.mjs +38 -0
  223. package/src/tui/app/use-prompt-draft-flow.mjs +5 -7
  224. package/src/tui/app/use-prompt-handlers.mjs +86 -21
  225. package/src/tui/app/use-prompt-hint.mjs +3 -2
  226. package/src/tui/app/use-prompt-queue-history.mjs +10 -3
  227. package/src/tui/app/use-transcript-scroll.mjs +10 -3
  228. package/src/tui/app/use-transcript-window.mjs +50 -17
  229. package/src/tui/components/PromptInput.jsx +71 -38
  230. package/src/tui/components/Spinner.jsx +1 -1
  231. package/src/tui/components/ToolExecution.jsx +1 -1
  232. package/src/tui/components/prompt-input/edit-helpers.mjs +9 -11
  233. package/src/tui/components/prompt-input/escape-policy.mjs +42 -0
  234. package/src/tui/components/prompt-input/immediate-render.mjs +0 -10
  235. package/src/tui/components/prompt-input/interrupt-policy.mjs +10 -0
  236. package/src/tui/components/prompt-input/restore-policy.mjs +10 -0
  237. package/src/tui/components/tool-execution/surface-detail.mjs +1 -1
  238. package/src/tui/dist/index.mjs +1031 -1676
  239. package/src/tui/hooks/useSession.mjs +16 -0
  240. package/src/tui/index.jsx +12 -13
  241. package/src/tui/{engine → session}/agent-envelope.mjs +3 -3
  242. package/src/tui/{engine → session}/agent-job-feed.mjs +4 -4
  243. package/src/tui/{engine → session}/boot-profile.mjs +2 -2
  244. package/src/tui/{engine → session}/context-state.mjs +3 -3
  245. package/src/tui/{engine → session}/labels.mjs +2 -2
  246. package/src/tui/{engine → session}/live-share.mjs +38 -4
  247. package/src/tui/{engine → session}/notice-text.mjs +2 -2
  248. package/src/tui/{engine → session}/notification-plan.mjs +3 -3
  249. package/src/tui/session/oauth-flows.mjs +140 -0
  250. package/src/tui/{engine → session}/prompt-history.mjs +3 -3
  251. package/src/tui/{engine → session}/queue-helpers.mjs +2 -2
  252. package/src/tui/{engine → session}/render-timing.mjs +2 -2
  253. package/src/tui/{engine → session}/session-api-ext.mjs +30 -20
  254. package/src/tui/{engine → session}/session-api.mjs +110 -93
  255. package/src/tui/{engine → session}/session-flow.mjs +8 -2
  256. package/src/tui/{engine → session}/session-stats.mjs +3 -3
  257. package/src/tui/{engine → session}/tool-approval.mjs +3 -3
  258. package/src/tui/{engine → session}/tool-call-fields.mjs +2 -2
  259. package/src/tui/{engine → session}/tool-card-results.mjs +8 -6
  260. package/src/tui/{engine → session}/tool-result-status.mjs +5 -5
  261. package/src/tui/{engine → session}/tool-result-text.mjs +13 -3
  262. package/src/tui/{engine → session}/transcript-spill.mjs +34 -34
  263. package/src/tui/{engine → session}/turn.mjs +38 -176
  264. package/src/tui/{engine-local-session.mjs → session-local.mjs} +103 -103
  265. package/src/tui/session.mjs +22 -0
  266. package/src/tui/spinner-meta.mjs +4 -4
  267. package/src/tui/spinner-verbs.mjs +51 -3
  268. package/src/ui/statusline-segments.mjs +1 -1
  269. package/src/ui/statusline.mjs +1 -1
  270. package/vendor/ink/build/components/App.js +10 -1
  271. package/src/session-runtime/memory-daemon-probe.mjs +0 -61
  272. package/src/standalone/engine-daemon-client.mjs +0 -894
  273. package/src/standalone/engine-daemon-local-bridge.mjs +0 -20
  274. package/src/standalone/engine-daemon-protocol.mjs +0 -33
  275. package/src/tui/engine/turn-watchdog.mjs +0 -92
  276. package/src/tui/engine.mjs +0 -22
  277. package/src/tui/hooks/useEngine.mjs +0 -16
  278. /package/src/runtime/agent/orchestrator/session/compact/{engine.mjs → runner.mjs} +0 -0
  279. /package/src/runtime/channels/{backends → providers}/discord-attachments.mjs +0 -0
  280. /package/src/tui/{engine → session}/agent-response-tail.mjs +0 -0
  281. /package/src/tui/{engine → session}/frame-batched-store.mjs +0 -0
  282. /package/src/tui/{engine → session}/tui-steering-persist.mjs +0 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 OpenAI
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,56 @@
1
+ MIT-licensed components used by Mixdog
2
+ ======================================
3
+
4
+ The permission notice reproduced at the bottom of this file applies to every
5
+ component listed here. Each component keeps its own copyright notice.
6
+
7
+ Visual Studio Code
8
+ https://github.com/microsoft/vscode
9
+ Copyright (c) 2015 - present Microsoft Corporation
10
+
11
+ GitHub Pull Requests and Issues (VS Code extension)
12
+ https://github.com/microsoft/vscode-pull-request-github
13
+ Copyright (c) Microsoft Corporation. All rights reserved.
14
+
15
+ Files
16
+ https://github.com/files-community/Files
17
+ Copyright (c) 2018 - present Files Community
18
+
19
+ OpenCode
20
+ https://github.com/anomalyco/opencode
21
+ Copyright (c) 2025 opencode
22
+
23
+ pi
24
+ https://github.com/earendil-works/pi
25
+ Copyright (c) 2025 Mario Zechner
26
+
27
+ Orca
28
+ Copyright (c) 2026 Lovecast Inc.
29
+
30
+ Ink (vendored under vendor/ink, which keeps its own license file)
31
+ https://github.com/vadimdemedes/ink
32
+ Copyright (c) Vadym Demedes <vadimdemedes@hey.com>
33
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com>
34
+
35
+ Seti UI (bundled glyph/colour data; see apps/desktop/THIRD-PARTY-NOTICES.txt)
36
+ https://github.com/jesseweed/seti-ui
37
+ Copyright (c) 2014 Jesse Weed
38
+
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining a copy
41
+ of this software and associated documentation files (the "Software"), to deal
42
+ in the Software without restriction, including without limitation the rights
43
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
+ copies of the Software, and to permit persons to whom the Software is
45
+ furnished to do so, subject to the following conditions:
46
+
47
+ The above copyright notice and this permission notice shall be included in all
48
+ copies or substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
56
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ OpenAI Codex
2
+ Copyright 2025 OpenAI
3
+
4
+ This project includes code derived from [Ratatui](https://github.com/ratatui/ratatui), licensed under the MIT license.
5
+ Copyright (c) 2016-2022 Florian Dehau
6
+ Copyright (c) 2023-2025 The Ratatui Developers
package/NOTICE.md CHANGED
@@ -5,6 +5,14 @@ against the public source of the projects listed below. Their terms are
5
5
  preserved here in one place so the individual source files can stay free of
6
6
  scattered attribution comments.
7
7
 
8
+ Full license texts live in `LICENSES/`:
9
+
10
+ - `LICENSES/MIT.txt` — the MIT permission notice with every covered copyright
11
+ holder.
12
+ - `LICENSES/Apache-2.0.txt` — the Apache License 2.0.
13
+ - `LICENSES/codex-NOTICE.txt` — the upstream NOTICE file of the Codex CLI,
14
+ carried forward as Apache-2.0 section 4(d) requires.
15
+
8
16
  ## MIT
9
17
 
10
18
  ### Visual Studio Code — Copyright (c) Microsoft Corporation
@@ -22,6 +30,17 @@ language contributions used to generate the Monaco pane languages.
22
30
  - `apps/desktop/scripts/generate-seti-icons.mjs`,
23
31
  `apps/desktop/scripts/generate-editor-languages.mjs`
24
32
 
33
+ `explorer-logic.ts` reuses the Explorer validation messages verbatim,
34
+ `editor-ansi.ts` the terminal ANSI palette values, and `seti-icons.ts` /
35
+ `editor-languages.ts` are generated from the shipped extension data.
36
+
37
+ ### GitHub Pull Requests extension — Copyright (c) Microsoft Corporation
38
+
39
+ <https://github.com/microsoft/vscode-pull-request-github>
40
+
41
+ The default pull-request query set and its category labels in
42
+ `apps/desktop/src/main/gh-cli.ts`.
43
+
25
44
  ### Seti UI — Copyright (c) 2014 Jesse Weed
26
45
 
27
46
  Bundled glyphs and colour tables. Full license text in
@@ -45,6 +64,22 @@ streaming-markdown projection model.
45
64
  `transcript-measure.ts`, `transcript-rows.ts`, `transcript-virtual-cache.ts`,
46
65
  `StreamingMarkdownBody.tsx`, `streaming-markdown.ts`, `Conversation.tsx`
47
66
 
67
+ ### pi — Copyright (c) 2025 Mario Zechner
68
+
69
+ <https://github.com/earendil-works/pi>
70
+
71
+ `trimPartialClosingFences()` in `src/tui/markdown/stream-fence.mjs`, ported
72
+ from the TUI markdown component.
73
+
74
+ ### Orca — Copyright (c) 2026 Lovecast Inc.
75
+
76
+ Editor-surface and tab-hierarchy structure, the terminal host portal, the
77
+ keep-awake power-save blocker and the hosted-review link derivation.
78
+
79
+ - `apps/desktop/src/renderer/EditorPane.lazy.tsx`, `PaneSurfaceGate.tsx`,
80
+ `PullRequestsPane.tsx`, `SourceControlDock.tsx`
81
+ - `apps/desktop/src/main/agent-awake.ts`
82
+
48
83
  ### Ink — Copyright (c) Vadim Demedes
49
84
 
50
85
  Vendored under `vendor/ink` together with its own license file.
@@ -55,18 +90,20 @@ Vendored under `vendor/ink` together with its own license file.
55
90
 
56
91
  <https://github.com/openai/codex>
57
92
 
58
- The V4A `apply_patch` grammar with its seek/replacement semantics.
93
+ The V4A `apply_patch` Lark grammar, reproduced verbatim from
94
+ `codex-rs/core/src/tools/handlers/apply_patch.lark` in
95
+ `src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs`, together with the
96
+ seek/replacement semantics of the patch engine.
59
97
 
60
98
  - `src/runtime/agent/orchestrator/tools/patch/`
61
99
  - `native/mixdog-patch/`
62
100
 
63
- ### AiderDesk Copyright (c) Hotovo
64
-
65
- <https://github.com/hotovo/aider-desk>
66
-
67
- electron-vite configuration structure in
68
- `apps/desktop/electron.vite.config.ts`.
101
+ Statement of changes (Apache-2.0 section 4(b)): the Lark grammar is carried
102
+ unmodified. The patch engine under the two paths above is an independent
103
+ implementation in JavaScript and Rust that follows the same seek and
104
+ replacement semantics; it is not a copy of the upstream Rust sources. The
105
+ upstream NOTICE file is preserved as `LICENSES/codex-NOTICE.txt`.
69
106
 
70
107
  The Apache-2.0 terms require this notice to travel with any redistribution of
71
- the derived files. Full license text:
72
- <https://www.apache.org/licenses/LICENSE-2.0>.
108
+ the derived files. Full license text: `LICENSES/Apache-2.0.txt`
109
+ (<https://www.apache.org/licenses/LICENSE-2.0>).
package/README.md CHANGED
@@ -65,23 +65,6 @@ measured cache writes; the archived OpenAI runs did not retain
65
65
  artifacts, the exact run commands, and the metric scripts that recompute
66
66
  every number above live under `benchmarks/terminal-bench-2.1/`.
67
67
 
68
- ## Boot overhead — measured, not estimated
69
-
70
- Fixed cost of the default system prompt + tool schemas, measured with a
71
- minimal one-turn ping ("hi"). Every number below is what the provider's own
72
- usage accounting reported for the first API call — same tokenizer on both
73
- sides of each row, no offline estimates (2026-08).
74
-
75
- | Tokenizer | Baseline harness | First-call prompt | mixdog Lead | mixdog worker agent |
76
- |-----------|------------------|------------------:|------------:|--------------------:|
77
- | Anthropic — pristine containers, TB2.1 harness | Claude Code 2.1.220 | 19,149 tok (median, n=89) | **7,295 (−62%)** | 4,856 (−75%) |
78
- | OpenAI — same host, same model (`gpt-5.6-sol`) | Codex CLI 0.145.0 | 17,706 tok | **7,488 (−58%)** | 4,616 (−74%) |
79
-
80
- The Lead surface carries the full default rule set, skills manifest, and
81
- per-user profile; spawning a sub-agent costs a flat ~4.6–4.9k tokens. Low
82
- boot overhead compounds: it is re-read on every request, so it is the
83
- baseline of every cache write, compaction, and long-session turn.
84
-
85
68
  ## Why mixdog
86
69
 
87
70
  **Maximum performance at minimum cost**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixdog",
3
- "version": "0.9.95",
3
+ "version": "0.9.97",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Standalone mixdog coding-agent CLI/TUI workspace.",
@@ -26,6 +26,7 @@
26
26
  "files": [
27
27
  "README.md",
28
28
  "NOTICE.md",
29
+ "LICENSES/",
29
30
  "scripts/",
30
31
  "!scripts/bench/",
31
32
  "!scripts/recall-bench-*.txt",
@@ -58,6 +59,8 @@
58
59
  "smoke:loop:report": "node scripts/smoke-loop-report.mjs",
59
60
  "test:tool-contracts": "node scripts/tool-smoke.mjs",
60
61
  "smoke:patch": "node scripts/apply-patch-edit-smoke.mjs",
62
+ "smoke:patch-replay": "node scripts/apply-patch-replay-smoke.mjs",
63
+ "smoke:tool-rescue": "node scripts/tool-rescue-smoke.mjs",
61
64
  "smoke:output": "node scripts/output-style-smoke.mjs",
62
65
  "smoke:tui": "node scripts/build-tui.mjs && node scripts/tui-render-smoke.mjs && npm run test:tui-input-render && npm run test:tui-streaming-window && npm run test:tui-queue",
63
66
  "smoke:freevars": "node scripts/freevar-smoke.mjs",
@@ -68,36 +71,37 @@
68
71
  "test:agent-job-views": "node --test scripts/agent-job-terminal-view-test.mjs",
69
72
  "test:agent-fanout": "node scripts/agent-parallel-smoke.mjs && node --test scripts/agent-route-batch-test.mjs scripts/execution-completion-dedup-test.mjs",
70
73
  "test:toolcall": "node --test scripts/toolcall-args-test.mjs",
71
- "test:tool-batching": "node --test scripts/eager-patch-shell-order-test.mjs scripts/session-bench-batching-test.mjs",
74
+ "test:tool-batching": "node --test scripts/eager-patch-shell-order-test.mjs scripts/session-bench-batching-test.mjs scripts/tool-cwd-rebind-test.mjs",
72
75
  "test:shipmode": "node --test scripts/ship-mode-test.mjs",
73
76
  "test:shellhardening": "node --test scripts/shell-hardening-test.mjs scripts/shell-failure-diagnostics-test.mjs scripts/windows-hide-spawn-options-test.mjs scripts/shell-job-session-scope-test.mjs",
74
77
  "test:placeholder": "node --test scripts/compacted-placeholder-scrub-test.mjs",
75
- "test:providers": "node --test scripts/provider-toolcall-test.mjs scripts/provider-contract-test.mjs scripts/provider-stream-stall-test.mjs scripts/provider-stream-outcome-test.mjs scripts/stream-frame-fault-matrix-test.mjs scripts/gemini-provider-test.mjs scripts/anthropic-transport-policy-test.mjs scripts/anthropic-native-block-replay-test.mjs scripts/openai-oauth-ws-1006-retry-test.mjs scripts/openai-end-turn-signal-test.mjs",
76
- "test:provider-admission": "node --test scripts/provider-admission-scheduler-test.mjs",
77
- "test:resource-admission": "node --test scripts/resource-admission-test.mjs",
78
+ "test:providers": "node --test scripts/provider-toolcall-test.mjs scripts/provider-contract-test.mjs scripts/provider-stream-stall-test.mjs scripts/provider-stream-outcome-test.mjs scripts/stream-frame-fault-matrix-test.mjs scripts/gemini-provider-test.mjs scripts/anthropic-transport-policy-test.mjs scripts/anthropic-native-block-replay-test.mjs scripts/openai-oauth-ws-1006-retry-test.mjs scripts/stream-close-retry-test.mjs scripts/openai-end-turn-signal-test.mjs",
79
+ "test:provider-admission": "node --test scripts/provider-admission-scheduler-test.mjs scripts/provider-stream-json-test.mjs",
80
+ "test:resource-admission": "node --test scripts/resource-admission-test.mjs scripts/child-spawn-isolation-test.mjs scripts/owner-fair-gate-test.mjs",
78
81
  "test:deferred-tools": "node --test scripts/deferred-tool-loading-test.mjs",
79
82
  "test:anthropic-oauth-race": "node --test scripts/anthropic-oauth-refresh-race-test.mjs",
80
83
  "test:grok-oauth-race": "node --test scripts/grok-oauth-refresh-race-test.mjs",
81
84
  "test:atomiclock": "node --test scripts/atomic-lock-tryonce-test.mjs",
82
85
  "test:keychain": "node --test scripts/keychain-prewarm-test.mjs",
86
+ "test:memory-leaks": "node --expose-gc --test scripts/memory-retention-test.mjs scripts/memory-worker-stability-test.mjs scripts/session-transport-test.mjs apps/desktop/src/renderer/memory-retention.test.mjs",
83
87
  "test:memory-routing": "node --test scripts/memory-cycle-routing-test.mjs scripts/maintenance-default-routes-test.mjs scripts/embedding-worker-exit-test.mjs scripts/embedding-runtime-prune-test.mjs",
84
88
  "test:embedding-runtime": "node --test scripts/embedding-runtime-prune-test.mjs scripts/memory-pg-recovery-test.mjs && node scripts/verify-embedding-runtime.mjs",
85
89
  "test:embedding-runtime:core": "node --test scripts/embedding-runtime-prune-test.mjs scripts/memory-pg-recovery-test.mjs && node scripts/verify-embedding-runtime.mjs --core",
86
90
  "test:embedding-runtime:warmup": "node scripts/verify-embedding-runtime.mjs --warmup",
87
91
  "test:code-graph-dispatch": "node --test scripts/code-graph-dispatch-test.mjs",
88
- "test:tui-queue": "node --test scripts/submit-commandbusy-race-test.mjs scripts/steering-drain-buckets-test.mjs scripts/abort-recovery-test.mjs scripts/execution-pending-resume-kick-test.mjs scripts/execution-resume-esc-integration-test.mjs scripts/pending-stale-injection-test.mjs",
89
- "test:tui-input-render": "node --test scripts/prompt-immediate-render-test.mjs",
92
+ "test:tui-queue": "node --test scripts/submit-commandbusy-race-test.mjs scripts/steering-drain-buckets-test.mjs scripts/abort-recovery-test.mjs scripts/message-rewind-test.mjs scripts/execution-pending-resume-kick-test.mjs scripts/execution-resume-esc-integration-test.mjs scripts/pending-stale-injection-test.mjs",
93
+ "test:tui-input-render": "node --test scripts/prompt-immediate-render-test.mjs scripts/prompt-key-parity-test.mjs",
90
94
  "test:tui-streaming-window": "node --test scripts/streaming-tail-window-test.mjs scripts/tui-store-frame-batch-test.mjs && node scripts/tui-transcript-jitter-harness.mjs",
91
95
  "test:tui-ambiguous-width": "node --test scripts/tui-ambiguous-width-test.mjs",
92
- "test:release-assets": "node --check scripts/verify-release-assets.mjs && node --check scripts/verify-release-assets-test.mjs && node --check scripts/deploy-workflow-test.mjs && node --test scripts/verify-release-assets-test.mjs scripts/deploy-workflow-test.mjs",
96
+ "test:release-assets": "node --check scripts/verify-release-assets.mjs && node --check scripts/verify-release-assets-test.mjs && node --check scripts/deploy-workflow-test.mjs && node --check scripts/release-version-discipline-test.mjs && node --test scripts/verify-release-assets-test.mjs scripts/deploy-workflow-test.mjs scripts/release-version-discipline-test.mjs",
93
97
  "test:release-focused": "npm run test:release-assets && npm run test:tool-contracts && npm run test:tool-batching && 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 && npm run test:compact && npm run test:context && 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 && npm run test:project-registry && npm run test:session && npm run test:workflow-editor && npm run test:embedding-runtime && node --test scripts/tui-transcript-perf-test.mjs",
94
98
  "test:native-edit-wire": "node --test scripts/native-edit-wire-test.mjs",
95
99
  "test:patch-binary-cache": "node --test scripts/patch-binary-cache-test.mjs",
96
100
  "test:patch-parity": "node --test scripts/v4a-parity-test.mjs",
97
101
  "test:project-registry": "node --test scripts/project-registry-isolation-test.mjs",
98
- "test:engine-daemon": "node --test scripts/engine-daemon-test.mjs scripts/engine-daemon-local-bridge-test.mjs scripts/engine-daemon-tui-parity-test.mjs scripts/engine-daemon-recovery-test.mjs scripts/engine-daemon-submit-delivery-test.mjs scripts/engine-daemon-process-lifetime-test.mjs scripts/engine-daemon-multipane-stress-test.mjs",
99
- "smoke:engine-daemon": "node scripts/engine-daemon-smoke.mjs",
100
- "test:session": "node --test scripts/session-orphan-sweep-test.mjs scripts/interrupted-turn-history-test.mjs scripts/turn-checkpoint-crash-test.mjs scripts/turn-outcome-fault-matrix-test.mjs scripts/session-save-fault-store-test.mjs scripts/session-disk-authority-test.mjs scripts/session-load-cache-race-test.mjs scripts/agent-loop-complete-turn-test.mjs scripts/session-heartbeat-lifecycle-test.mjs scripts/remote-transition-order-test.mjs scripts/session-new-reset-test.mjs",
102
+ "test:session-transport": "node --test scripts/fair-call-scheduler-test.mjs scripts/session-transport-test.mjs scripts/session-tui-parity-test.mjs scripts/session-recovery-test.mjs scripts/session-submit-delivery-test.mjs scripts/daemon-process-lifetime-test.mjs scripts/session-multipane-stress-test.mjs && node --test scripts/runtime-isolation-stress-test.mjs",
103
+ "smoke:session": "node scripts/session-smoke.mjs",
104
+ "test:session": "node --test scripts/runtime-turn-contract-test.mjs scripts/session-orphan-sweep-test.mjs scripts/interrupted-turn-history-test.mjs scripts/turn-checkpoint-crash-test.mjs scripts/turn-outcome-fault-matrix-test.mjs scripts/session-save-fault-store-test.mjs scripts/session-disk-authority-test.mjs scripts/session-load-cache-race-test.mjs scripts/agent-loop-complete-turn-test.mjs scripts/session-heartbeat-lifecycle-test.mjs scripts/remote-transition-order-test.mjs scripts/session-new-reset-test.mjs scripts/turn-ttft-critical-path-test.mjs",
101
105
  "test:live-canary": "node --test scripts/live-canary-test.mjs",
102
106
  "test:rebindtail": "node --test scripts/forwarder-rebind-tail-test.mjs scripts/channel-remote-format-test.mjs",
103
107
  "test:workflow-editor": "node --test scripts/workflow-id-test.mjs scripts/workflow-pack-editor-test.mjs",
@@ -119,7 +123,7 @@
119
123
  "bench:explore": "node scripts/explore-bench.mjs",
120
124
  "bench:output-style": "node scripts/output-style-bench.mjs",
121
125
  "bench:session-context": "node scripts/session-context-bench.mjs",
122
- "bench:engine-daemon": "node scripts/engine-daemon-bench.mjs",
126
+ "bench:session-transport": "node scripts/session-transport-bench.mjs",
123
127
  "bench:tool-overhead": "node scripts/tool-overhead-microbench.mjs",
124
128
  "bench:internal-comms": "node scripts/internal-comms-bench.mjs",
125
129
  "audit:models": "node scripts/model-catalog-audit.mjs",
@@ -0,0 +1,96 @@
1
+ // TEMPORARY (delete after use): replay every current rescue/classification
2
+ // rule over the last 5 days of logged tool failures and report what would no
3
+ // longer surface as a failure.
4
+ import { readFileSync, existsSync } from 'node:fs';
5
+ import { homedir } from 'node:os';
6
+ import { join, resolve } from 'node:path';
7
+ import { isLegitimateShellExit } from '../src/runtime/agent/orchestrator/session/result-classification.mjs';
8
+ import { _isBenignSearchExitOne } from '../src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs';
9
+ import { hasPowerShellOnlySyntax, planInlineScriptHoist } from '../src/runtime/agent/orchestrator/tools/builtin/shell-analysis.mjs';
10
+ import { normalizeCoreOp, normalizeCoreInput } from '../src/runtime/memory/lib/core-memory-store.mjs';
11
+
12
+ const dir = resolve(homedir(), '.mixdog', 'data', 'history');
13
+ const rows = [];
14
+ for (const file of ['tool-failures.jsonl', 'tool-failures.jsonl.1']) {
15
+ const p = join(dir, file);
16
+ if (!existsSync(p)) continue;
17
+ for (const line of readFileSync(p, 'utf8').split(/\r?\n/)) {
18
+ if (!line) continue;
19
+ try { rows.push(JSON.parse(line)); } catch { /* skip */ }
20
+ }
21
+ }
22
+ const recent = rows.filter((r) => Number(r.ts) >= Date.now() - 5 * 86400000);
23
+
24
+ const TEST_FIXTURES = new Set(['unknown_test_tool', 'definitely_missing_tool']);
25
+ const buckets = {
26
+ total: recent.length,
27
+ testNoise: 0,
28
+ retiredGuard: 0,
29
+ legitimateExit: 0,
30
+ benignSearch: 0,
31
+ bashRescue: 0,
32
+ inlineHoist: 0,
33
+ codeGraphDot: 0,
34
+ memoryArgs: 0,
35
+ webFetchArgs: 0,
36
+ grepArgs: 0,
37
+ realFailure: 0,
38
+ };
39
+
40
+ for (const row of recent) {
41
+ const tool = String(row.tool_name || '');
42
+ const head = String(row.error_first_line || '');
43
+ const preview = String(row.error_preview || head);
44
+ const cmd = String(row.tool_args?.command || '');
45
+ if (TEST_FIXTURES.has(tool) || /^Error: patch failed$/.test(head)
46
+ || /must be of type string\. Received undefined/.test(head)) { buckets.testNoise += 1; continue; }
47
+ if (/resource pressure/i.test(preview)) { buckets.retiredGuard += 1; continue; }
48
+ if (tool === 'shell') {
49
+ if (/PowerShell preflight blocked/.test(head)) {
50
+ if (cmd && !hasPowerShellOnlySyntax(cmd)) { buckets.bashRescue += 1; continue; }
51
+ buckets.realFailure += 1; continue;
52
+ }
53
+ if (/\[exit code: 1\]/.test(head)) {
54
+ if (cmd && _isBenignSearchExitOne(cmd, 1, null, '')) { buckets.benignSearch += 1; continue; }
55
+ const body = preview.replace(/^Error:[^\n]*\n?/, '');
56
+ const stderr = /\[stderr/.test(body) ? 'x' : '';
57
+ if (isLegitimateShellExit({ exitCode: 1, signal: null, stdout: body, stderr })) { buckets.legitimateExit += 1; continue; }
58
+ if (cmd && planInlineScriptHoist(cmd) && /SyntaxError|ParserError|Unexpected token|missing the terminator/i.test(preview)) {
59
+ buckets.inlineHoist += 1; continue;
60
+ }
61
+ }
62
+ buckets.realFailure += 1; continue;
63
+ }
64
+ if (tool === 'code_graph') {
65
+ const a = row.tool_args || {};
66
+ const files = Array.isArray(a.files) ? a.files : (typeof a.files === 'string' ? [a.files] : []);
67
+ if (files.length && files.every((f) => String(f).trim() === '.')) { buckets.codeGraphDot += 1; continue; }
68
+ buckets.realFailure += 1; continue;
69
+ }
70
+ if (tool === 'memory') {
71
+ const a = row.tool_args || {};
72
+ const opFixed = ['add', 'edit', 'delete', 'list', 'candidates', 'promote', 'dismiss'].includes(normalizeCoreOp(a.op));
73
+ const argsFixed = normalizeCoreInput(a, { requireElement: true, requireSummary: true }).errors.length === 0;
74
+ if (opFixed && argsFixed) { buckets.memoryArgs += 1; continue; }
75
+ buckets.realFailure += 1; continue;
76
+ }
77
+ if (tool === 'web_fetch') {
78
+ const url = row.tool_args?.url;
79
+ if (typeof url === 'string' && /^\s*\[/.test(url)) { buckets.webFetchArgs += 1; continue; }
80
+ buckets.realFailure += 1; continue;
81
+ }
82
+ if (tool === 'grep' || tool === 'glob' || tool === 'list' || tool === 'find') {
83
+ if (/must be string or string\[\] \(got (?:null|undefined|array)\)/.test(head)) { buckets.grepArgs += 1; continue; }
84
+ buckets.realFailure += 1; continue;
85
+ }
86
+ buckets.realFailure += 1;
87
+ }
88
+
89
+ const rescued = buckets.legitimateExit + buckets.benignSearch + buckets.bashRescue + buckets.inlineHoist
90
+ + buckets.codeGraphDot + buckets.memoryArgs + buckets.webFetchArgs + buckets.grepArgs;
91
+ const pct = (n) => `${((n / buckets.total) * 100).toFixed(1)}%`;
92
+ console.log(JSON.stringify(buckets, null, 1));
93
+ console.log(`\nrescued/reclassified: ${rescued} (${pct(rescued)})`);
94
+ console.log(`test noise: ${buckets.testNoise} (${pct(buckets.testNoise)})`);
95
+ console.log(`retired guard: ${buckets.retiredGuard} (${pct(buckets.retiredGuard)})`);
96
+ console.log(`remaining real failures: ${buckets.realFailure} (${pct(buckets.realFailure)})`);
@@ -41,6 +41,18 @@ const sharedRuntimeExternalPlugin = {
41
41
  },
42
42
  };
43
43
 
44
+ const sessionClientExternalPlugin = {
45
+ name: 'mixdog-session-client-external',
46
+ setup(build) {
47
+ build.onResolve({ filter: /^\.\.\/standalone\/session-client\.mjs$/ }, () => ({
48
+ // Keep this module outside the TUI bundle so its import.meta.url stays
49
+ // anchored in src/standalone, where daemon.mjs actually lives.
50
+ path: '../../standalone/session-client.mjs',
51
+ external: true,
52
+ }));
53
+ },
54
+ };
55
+
44
56
  await build({
45
57
  entryPoints: [join(SRC, 'index.jsx')],
46
58
  outfile: join(SRC, 'dist', 'index.mjs'),
@@ -75,7 +87,11 @@ await build({
75
87
  '../../runtime/channels/lib/voice-runtime-fetcher.mjs',
76
88
  '../../runtime/channels/lib/whisper-server.mjs',
77
89
  ],
78
- plugins: [mixdogInkAliasPlugin, sharedRuntimeExternalPlugin],
90
+ plugins: [
91
+ mixdogInkAliasPlugin,
92
+ sharedRuntimeExternalPlugin,
93
+ sessionClientExternalPlugin,
94
+ ],
79
95
  logLevel: 'info',
80
96
  });
81
97