mixdog 0.8.1 → 0.9.1

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 (299) hide show
  1. package/README.md +47 -23
  2. package/package.json +34 -28
  3. package/scripts/_test-folder-dialog.mjs +30 -0
  4. package/scripts/agent-parallel-smoke.mjs +388 -0
  5. package/scripts/agent-tag-reuse-smoke.mjs +183 -0
  6. package/scripts/background-task-meta-smoke.mjs +38 -0
  7. package/scripts/boot-smoke.mjs +52 -9
  8. package/scripts/build-runtime-linux.sh +348 -0
  9. package/scripts/build-runtime-macos.sh +217 -0
  10. package/scripts/build-runtime-windows.ps1 +242 -0
  11. package/scripts/compact-active-turn-test.mjs +68 -0
  12. package/scripts/compact-smoke.mjs +859 -129
  13. package/scripts/compact-trigger-migration-smoke.mjs +187 -0
  14. package/scripts/fix-brief-fn.mjs +35 -0
  15. package/scripts/fix-format-tool-surface.mjs +24 -0
  16. package/scripts/fix-tool-exec-visible.mjs +42 -0
  17. package/scripts/generate-runtime-manifest.mjs +166 -0
  18. package/scripts/hook-bus-test.mjs +330 -0
  19. package/scripts/lead-workflow-smoke.mjs +33 -39
  20. package/scripts/live-worker-smoke.mjs +43 -37
  21. package/scripts/llm-trace-summary.mjs +315 -0
  22. package/scripts/memory-meta-concurrency-test.mjs +20 -0
  23. package/scripts/output-style-smoke.mjs +56 -15
  24. package/scripts/parent-abort-link-test.mjs +44 -0
  25. package/scripts/patch-agent-brief.mjs +48 -0
  26. package/scripts/patch-app.mjs +21 -0
  27. package/scripts/patch-app2.mjs +18 -0
  28. package/scripts/patch-dist-brief.mjs +96 -0
  29. package/scripts/patch-tool-exec.mjs +70 -0
  30. package/scripts/pretool-ask-runtime-test.mjs +54 -0
  31. package/scripts/provider-toolcall-test.mjs +376 -0
  32. package/scripts/reactive-compact-persist-smoke.mjs +124 -0
  33. package/scripts/sanitize-tool-pairs-test.mjs +260 -0
  34. package/scripts/session-context-bench.mjs +205 -33
  35. package/scripts/session-ingest-smoke.mjs +177 -0
  36. package/scripts/set-effort-config-test.mjs +41 -0
  37. package/scripts/smoke-runtime-negative.ps1 +106 -0
  38. package/scripts/smoke-runtime-negative.sh +97 -0
  39. package/scripts/smoke.mjs +25 -0
  40. package/scripts/tool-result-hook-test.mjs +48 -0
  41. package/scripts/tool-smoke.mjs +1222 -90
  42. package/scripts/toolcall-args-test.mjs +150 -0
  43. package/scripts/tui-background-failure-smoke.mjs +73 -0
  44. package/scripts/usage-metrics-epoch-smoke.mjs +114 -0
  45. package/src/agents/debugger/AGENT.md +8 -0
  46. package/src/agents/explore/AGENT.md +4 -0
  47. package/src/agents/heavy-worker/AGENT.md +9 -3
  48. package/src/agents/maintainer/AGENT.md +4 -0
  49. package/src/agents/reviewer/AGENT.md +8 -0
  50. package/src/agents/scheduler-task/AGENT.md +12 -0
  51. package/src/agents/scheduler-task/agent.json +6 -0
  52. package/src/agents/webhook-handler/AGENT.md +12 -0
  53. package/src/agents/webhook-handler/agent.json +6 -0
  54. package/src/agents/worker/AGENT.md +9 -3
  55. package/src/app.mjs +77 -3
  56. package/src/defaults/hidden-roles.json +17 -12
  57. package/src/headless-role.mjs +117 -0
  58. package/src/help.mjs +30 -0
  59. package/src/hooks/lib/permission-evaluator.cjs +11 -475
  60. package/src/lib/keychain-cjs.cjs +9 -1
  61. package/src/lib/mixdog-debug.cjs +0 -29
  62. package/src/lib/plugin-paths.cjs +1 -7
  63. package/src/lib/rules-builder.cjs +242 -98
  64. package/src/lib/text-utils.cjs +1 -1
  65. package/src/mixdog-session-runtime.mjs +2211 -446
  66. package/src/output-styles/default.md +12 -28
  67. package/src/output-styles/extreme-simple.md +9 -6
  68. package/src/output-styles/simple.md +22 -9
  69. package/src/repl.mjs +108 -59
  70. package/src/rules/agent/00-common.md +15 -0
  71. package/src/rules/{bridge → agent}/20-skip-protocol.md +1 -2
  72. package/src/rules/agent/30-explorer.md +22 -0
  73. package/src/rules/{bridge → agent}/40-cycle1-agent.md +7 -0
  74. package/src/rules/{bridge → agent}/41-cycle2-agent.md +7 -0
  75. package/src/rules/{bridge → agent}/42-cycle3-agent.md +7 -0
  76. package/src/rules/lead/01-general.md +9 -5
  77. package/src/rules/lead/04-workflow.md +51 -12
  78. package/src/rules/lead/lead-tool.md +6 -0
  79. package/src/rules/shared/01-tool.md +12 -1
  80. package/src/runtime/agent/orchestrator/activity-bus.mjs +7 -18
  81. package/src/runtime/agent/orchestrator/agent-owner.mjs +11 -0
  82. package/src/runtime/agent/orchestrator/{smart-bridge/bridge-llm.mjs → agent-runtime/agent-dispatch.mjs} +138 -111
  83. package/src/runtime/agent/orchestrator/agent-runtime/agent-progress-watchdog.mjs +94 -0
  84. package/src/runtime/agent/orchestrator/{smart-bridge → agent-runtime}/cache-strategy.mjs +32 -23
  85. package/src/runtime/agent/orchestrator/{smart-bridge → agent-runtime}/session-builder.mjs +33 -27
  86. package/src/runtime/agent/orchestrator/{bridge-trace.mjs → agent-trace.mjs} +132 -81
  87. package/src/runtime/agent/orchestrator/cache-mtime.mjs +0 -21
  88. package/src/runtime/agent/orchestrator/config.mjs +174 -55
  89. package/src/runtime/agent/orchestrator/context/collect.mjs +195 -487
  90. package/src/runtime/agent/orchestrator/dispatch-persist.mjs +1 -1
  91. package/src/runtime/agent/orchestrator/internal-roles.mjs +77 -29
  92. package/src/runtime/agent/orchestrator/internal-tools.mjs +5 -6
  93. package/src/runtime/agent/orchestrator/mcp/client.mjs +15 -9
  94. package/src/runtime/agent/orchestrator/providers/anthropic-betas.mjs +7 -1
  95. package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +380 -268
  96. package/src/runtime/agent/orchestrator/providers/anthropic.mjs +131 -93
  97. package/src/runtime/agent/orchestrator/providers/api-usage.mjs +236 -4
  98. package/src/runtime/agent/orchestrator/providers/custom-tool-wire.mjs +49 -0
  99. package/src/runtime/agent/orchestrator/providers/gemini.mjs +58 -13
  100. package/src/runtime/agent/orchestrator/providers/grok-oauth.mjs +67 -149
  101. package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +132 -2
  102. package/src/runtime/agent/orchestrator/providers/model-catalog.mjs +4 -1
  103. package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +45 -0
  104. package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +61 -116
  105. package/src/runtime/agent/orchestrator/providers/openai-compat-presets.mjs +25 -0
  106. package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +79 -255
  107. package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +203 -71
  108. package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +512 -312
  109. package/src/runtime/agent/orchestrator/providers/openai-oauth.mjs +343 -518
  110. package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +6 -6
  111. package/src/runtime/agent/orchestrator/providers/registry.mjs +88 -51
  112. package/src/runtime/agent/orchestrator/providers/retry-classifier.mjs +289 -11
  113. package/src/runtime/agent/orchestrator/providers/statusline-route-meta.mjs +41 -8
  114. package/src/runtime/agent/orchestrator/session/compact.mjs +1173 -267
  115. package/src/runtime/agent/orchestrator/session/context-utils.mjs +199 -36
  116. package/src/runtime/agent/orchestrator/session/loop.mjs +840 -612
  117. package/src/runtime/agent/orchestrator/session/manager.mjs +1574 -459
  118. package/src/runtime/agent/orchestrator/session/manager.reactive-persist.test.mjs +107 -0
  119. package/src/runtime/agent/orchestrator/session/store.mjs +67 -29
  120. package/src/runtime/agent/orchestrator/session/tool-result-offload.mjs +2 -2
  121. package/src/runtime/agent/orchestrator/stall-policy.mjs +31 -16
  122. package/src/runtime/agent/orchestrator/tool-loop-guard.mjs +3 -219
  123. package/src/runtime/agent/orchestrator/tools/bash-session.mjs +35 -8
  124. package/src/runtime/agent/orchestrator/tools/builtin/arg-guard.mjs +19 -8
  125. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +10 -53
  126. package/src/runtime/agent/orchestrator/tools/builtin/builtin-tools.mjs +60 -37
  127. package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +21 -2
  128. package/src/runtime/agent/orchestrator/tools/builtin/device-paths.mjs +1 -1
  129. package/src/runtime/agent/orchestrator/tools/builtin/diagnostics-tool.mjs +0 -7
  130. package/src/runtime/agent/orchestrator/tools/builtin/glob-walk.mjs +1 -3
  131. package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +36 -12
  132. package/src/runtime/agent/orchestrator/tools/builtin/read-args.mjs +2 -0
  133. package/src/runtime/agent/orchestrator/tools/builtin/read-constants.mjs +2 -2
  134. package/src/runtime/agent/orchestrator/tools/builtin/read-formatting.mjs +5 -12
  135. package/src/runtime/agent/orchestrator/tools/builtin/read-image-resize.mjs +1 -1
  136. package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +4 -36
  137. package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +2 -40
  138. package/src/runtime/agent/orchestrator/tools/builtin/rg-runner.mjs +148 -27
  139. package/src/runtime/agent/orchestrator/tools/builtin/search-builders.mjs +2 -2
  140. package/src/runtime/agent/orchestrator/tools/builtin/search-tool.mjs +43 -75
  141. package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +90 -20
  142. package/src/runtime/agent/orchestrator/tools/builtin.mjs +59 -5
  143. package/src/runtime/agent/orchestrator/tools/code-graph-state.mjs +86 -0
  144. package/src/runtime/agent/orchestrator/tools/code-graph-tool-defs.mjs +11 -11
  145. package/src/runtime/agent/orchestrator/tools/code-graph.mjs +4106 -4019
  146. package/src/runtime/agent/orchestrator/tools/patch-tool-defs.mjs +33 -4
  147. package/src/runtime/agent/orchestrator/tools/patch.mjs +90 -6
  148. package/src/runtime/agent/orchestrator/tools/progress-message.mjs +6 -4
  149. package/src/runtime/agent/orchestrator/tools/result-compression.mjs +4 -4
  150. package/src/runtime/agent/orchestrator/tools/shell-command.mjs +8 -1
  151. package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +4 -4
  152. package/src/runtime/channels/index.mjs +149 -51
  153. package/src/runtime/channels/lib/cli-worker-host.mjs +1 -8
  154. package/src/runtime/channels/lib/config.mjs +0 -1
  155. package/src/runtime/channels/lib/drop-trace.mjs +1 -1
  156. package/src/runtime/channels/lib/executor.mjs +0 -3
  157. package/src/runtime/channels/lib/memory-client.mjs +0 -38
  158. package/src/runtime/channels/lib/output-forwarder.mjs +1 -8
  159. package/src/runtime/channels/lib/runtime-paths.mjs +0 -6
  160. package/src/runtime/channels/lib/scheduler.mjs +18 -14
  161. package/src/runtime/channels/lib/session-discovery.mjs +3 -6
  162. package/src/runtime/channels/lib/tool-format.mjs +0 -1
  163. package/src/runtime/channels/lib/transcript-discovery.mjs +4 -12
  164. package/src/runtime/channels/lib/webhook.mjs +1 -1
  165. package/src/runtime/channels/tool-defs.mjs +29 -29
  166. package/src/runtime/lib/keychain-cjs.cjs +0 -1
  167. package/src/runtime/memory/data/runtime-manifest.json +6 -7
  168. package/src/runtime/memory/index.mjs +519 -118
  169. package/src/runtime/memory/lib/agent-ipc.mjs +29 -12
  170. package/src/runtime/memory/lib/core-memory-store.mjs +2 -2
  171. package/src/runtime/memory/lib/embedding-model-config.mjs +55 -0
  172. package/src/runtime/memory/lib/embedding-provider.mjs +31 -4
  173. package/src/runtime/memory/lib/embedding-worker.mjs +19 -10
  174. package/src/runtime/memory/lib/llm-worker-host.mjs +0 -4
  175. package/src/runtime/memory/lib/memory-cycle1.mjs +28 -7
  176. package/src/runtime/memory/lib/memory-cycle2.mjs +4 -5
  177. package/src/runtime/memory/lib/memory-cycle3.mjs +2 -2
  178. package/src/runtime/memory/lib/memory-ops-policy.mjs +2 -2
  179. package/src/runtime/memory/lib/memory-session-merge.mjs +38 -0
  180. package/src/runtime/memory/lib/memory.mjs +88 -9
  181. package/src/runtime/memory/lib/model-profile.mjs +1 -1
  182. package/src/runtime/memory/lib/pg/adapter.mjs +1 -1
  183. package/src/runtime/memory/lib/pg/supervisor.mjs +12 -0
  184. package/src/runtime/memory/lib/runtime-fetcher.mjs +80 -21
  185. package/src/runtime/memory/lib/session-ingest.mjs +196 -0
  186. package/src/runtime/memory/lib/trace-store.mjs +96 -51
  187. package/src/runtime/memory/tool-defs.mjs +46 -37
  188. package/src/runtime/search/index.mjs +104 -473
  189. package/src/runtime/search/lib/config.mjs +0 -4
  190. package/src/runtime/search/lib/state.mjs +1 -15
  191. package/src/runtime/search/lib/web-tools.mjs +44 -25
  192. package/src/runtime/search/tool-defs.mjs +16 -23
  193. package/src/runtime/shared/abort-controller.mjs +1 -1
  194. package/src/runtime/shared/atomic-file.mjs +4 -3
  195. package/src/runtime/shared/background-tasks.mjs +122 -11
  196. package/src/runtime/shared/child-spawn-gate.mjs +139 -0
  197. package/src/runtime/shared/config.mjs +7 -4
  198. package/src/runtime/shared/err-text.mjs +131 -4
  199. package/src/runtime/shared/llm/cost.mjs +2 -2
  200. package/src/runtime/shared/llm/http-agent.mjs +23 -7
  201. package/src/runtime/shared/llm/index.mjs +34 -11
  202. package/src/runtime/shared/llm/usage-log.mjs +4 -4
  203. package/src/runtime/shared/markdown-frontmatter.mjs +56 -0
  204. package/src/runtime/shared/singleton-owner.mjs +104 -0
  205. package/src/runtime/shared/tool-execution-contract.mjs +199 -20
  206. package/src/runtime/shared/tool-execution-contract.test.mjs +183 -0
  207. package/src/runtime/shared/tool-surface.mjs +624 -95
  208. package/src/runtime/shared/user-data-guard.mjs +0 -2
  209. package/src/standalone/agent-task-status.mjs +203 -0
  210. package/src/standalone/agent-task-status.test.mjs +76 -0
  211. package/src/standalone/agent-tool.mjs +1913 -0
  212. package/src/standalone/channel-worker.mjs +370 -14
  213. package/src/standalone/explore-tool.mjs +165 -70
  214. package/src/standalone/folder-dialog.mjs +314 -0
  215. package/src/standalone/hook-bus.mjs +898 -22
  216. package/src/standalone/memory-runtime-proxy.mjs +320 -0
  217. package/src/standalone/projects.mjs +226 -0
  218. package/src/standalone/provider-admin.mjs +41 -24
  219. package/src/standalone/seeds.mjs +1 -78
  220. package/src/standalone/usage-dashboard.mjs +96 -8
  221. package/src/tui/App.jsx +4800 -2140
  222. package/src/tui/components/AnsiText.jsx +39 -28
  223. package/src/tui/components/ContextPanel.jsx +14 -4
  224. package/src/tui/components/Markdown.jsx +43 -77
  225. package/src/tui/components/MarkdownTable.jsx +9 -184
  226. package/src/tui/components/Message.jsx +28 -11
  227. package/src/tui/components/Picker.jsx +95 -56
  228. package/src/tui/components/PromptInput.jsx +428 -239
  229. package/src/tui/components/QueuedCommands.jsx +1 -1
  230. package/src/tui/components/SlashCommandPalette.jsx +27 -21
  231. package/src/tui/components/Spinner.jsx +67 -38
  232. package/src/tui/components/StatusLine.jsx +606 -38
  233. package/src/tui/components/TextEntryPanel.jsx +128 -9
  234. package/src/tui/components/ToolExecution.jsx +597 -362
  235. package/src/tui/components/TurnDone.jsx +3 -3
  236. package/src/tui/components/UsagePanel.jsx +3 -5
  237. package/src/tui/components/tool-output-format.mjs +499 -0
  238. package/src/tui/components/tool-output-format.test.mjs +312 -0
  239. package/src/tui/dist/index.mjs +9192 -2399
  240. package/src/tui/engine-runtime-notification.test.mjs +115 -0
  241. package/src/tui/engine-tool-result-text.test.mjs +75 -0
  242. package/src/tui/engine.mjs +1455 -279
  243. package/src/tui/figures.mjs +21 -40
  244. package/src/tui/index.jsx +75 -31
  245. package/src/tui/input-editing.mjs +25 -0
  246. package/src/tui/markdown/format-token.mjs +671 -69
  247. package/src/tui/markdown/format-token.test.mjs +312 -0
  248. package/src/tui/markdown/render-ansi.mjs +94 -0
  249. package/src/tui/markdown/render-ansi.test.mjs +108 -0
  250. package/src/tui/markdown/stream-fence.mjs +34 -0
  251. package/src/tui/markdown/stream-fence.test.mjs +26 -0
  252. package/src/tui/markdown/table-layout.mjs +250 -0
  253. package/src/tui/paste-attachments.mjs +0 -7
  254. package/src/tui/spinner-verbs.mjs +1 -2
  255. package/src/tui/statusline-ansi-bridge.mjs +172 -0
  256. package/src/tui/statusline-ansi-bridge.test.mjs +159 -0
  257. package/src/tui/theme.mjs +756 -24
  258. package/src/tui/time-format.mjs +1 -1
  259. package/src/tui/transcript-tool-failures.mjs +67 -0
  260. package/src/tui/transcript-tool-failures.test.mjs +111 -0
  261. package/src/ui/ansi.mjs +1 -2
  262. package/src/ui/markdown.mjs +85 -26
  263. package/src/ui/markdown.test.mjs +70 -0
  264. package/src/ui/model-display.mjs +121 -0
  265. package/src/ui/session-stats.mjs +44 -0
  266. package/src/ui/statusline-context-label.test.mjs +15 -0
  267. package/src/ui/statusline.mjs +386 -178
  268. package/src/ui/tool-card.mjs +2 -13
  269. package/src/vendor/statusline/bin/statusline-lib.mjs +1 -620
  270. package/src/vendor/statusline/bin/statusline-route.mjs +169 -37
  271. package/src/vendor/statusline/bin/statusline-route.test.mjs +80 -0
  272. package/src/vendor/statusline/scripts/lib/gateway-settings.mjs +3 -3
  273. package/src/vendor/statusline/src/gateway/claude-current.mjs +1 -1
  274. package/src/vendor/statusline/src/gateway/route-meta.mjs +44 -6
  275. package/src/vendor/statusline/src/gateway/session-routes.mjs +1 -1
  276. package/src/workflows/default/WORKFLOW.md +12 -5
  277. package/src/workflows/default/workflow.json +0 -1
  278. package/src/workflows/solo/WORKFLOW.md +15 -0
  279. package/src/workflows/solo/workflow.json +7 -0
  280. package/vendor/ink/build/ink.js +54 -8
  281. package/vendor/ink/build/output.js +6 -1
  282. package/src/agents/scheduler-task.md +0 -3
  283. package/src/agents/web-researcher/AGENT.md +0 -3
  284. package/src/agents/web-researcher/agent.json +0 -6
  285. package/src/agents/webhook-handler.md +0 -3
  286. package/src/hooks/lib/permission-rules.cjs +0 -170
  287. package/src/hooks/lib/settings-loader.cjs +0 -112
  288. package/src/lib/hook-pipe-path.cjs +0 -10
  289. package/src/rules/bridge/00-common.md +0 -5
  290. package/src/rules/bridge/30-explorer.md +0 -4
  291. package/src/rules/lead/00-tool-lead.md +0 -5
  292. package/src/rules/shared/00-language.md +0 -3
  293. package/src/runtime/agent/orchestrator/tools/builtin/native-edit-runner.mjs +0 -110
  294. package/src/runtime/agent/orchestrator/tools/mutation-content-cache.mjs +0 -67
  295. package/src/runtime/channels/lib/hook-pipe-server.mjs +0 -671
  296. package/src/runtime/memory/lib/bridge-trace-queries.mjs +0 -120
  297. package/src/runtime/shared/llm/pid-cleanup.mjs +0 -27
  298. package/src/standalone/bridge-tool.mjs +0 -1414
  299. package/src/tui/runtime/shared/process-shutdown.mjs +0 -1
@@ -1,12 +1,5 @@
1
- function hasCliWorker() {
2
- return true;
3
- }
4
1
  function startCliWorker(_options) {
5
2
  }
6
- async function stopCliWorker() {
7
- }
8
3
  export {
9
- hasCliWorker,
10
- startCliWorker,
11
- stopCliWorker
4
+ startCliWorker
12
5
  };
@@ -276,7 +276,6 @@ function loadProfileConfig() {
276
276
  export {
277
277
  DATA_DIR,
278
278
  DEFAULT_HOLIDAY_COUNTRY,
279
- applyDefaults,
280
279
  createBackend,
281
280
  getDiscordToken,
282
281
  isInQuietWindow,
@@ -68,4 +68,4 @@ function dropTrace(event, fields) {
68
68
  } catch {}
69
69
  }
70
70
 
71
- export { dropTrace, _dtPreview, DROP_TRACE_ENABLED };
71
+ export { dropTrace, _dtPreview };
@@ -196,8 +196,5 @@ export {
196
196
  ensureNopluginDir,
197
197
  evaluateFilter,
198
198
  logEvent,
199
- parseGeneric,
200
- parseGithub,
201
- parseSentry,
202
199
  runScript
203
200
  };
@@ -109,41 +109,3 @@ export async function ingestTranscript(filePath, { cwd } = {}) {
109
109
  }
110
110
  }
111
111
 
112
- export async function listCoreMemories(args = {}) {
113
- const rawProjectId = args && Object.prototype.hasOwnProperty.call(args, 'project_id')
114
- ? args.project_id
115
- : args?.projectScope
116
- const projectId = rawProjectId == null || rawProjectId === 'all' ? '*' : rawProjectId
117
- const result = await memoryFetch('POST', '/api/tool', {
118
- name: 'memory',
119
- arguments: {
120
- action: 'core',
121
- op: 'list',
122
- project_id: projectId,
123
- },
124
- }, 30_000)
125
- if (!result || result.error) {
126
- throw new Error(result?.error || 'core memory list: empty response')
127
- }
128
- return result
129
- }
130
-
131
- export async function searchMemories(args = {}) {
132
- const result = await memoryFetch('POST', '/api/tool', {
133
- name: 'search_memories',
134
- arguments: args && typeof args === 'object' ? args : {},
135
- }, 30_000)
136
- if (!result || result.error) {
137
- throw new Error(result?.error || 'memory_search: empty response')
138
- }
139
- return result
140
- }
141
-
142
- export async function isHealthy() {
143
- try {
144
- const result = await memoryFetch('GET', '/health')
145
- return result.status === 'ok'
146
- } catch {
147
- return false
148
- }
149
- }
@@ -754,12 +754,5 @@ ${_bt.trim()}` : _bt.trim();
754
754
  }
755
755
  }
756
756
  export {
757
- OutputForwarder,
758
- cwdToProjectSlug,
759
- detectCurrentSessionTranscript,
760
- discoverCurrentClaudeSession,
761
- discoverSessionBoundTranscript,
762
- findLatestTranscriptByMtime,
763
- getLatestInteractiveClaudeSession,
764
- listInteractiveClaudeSessions
757
+ OutputForwarder
765
758
  };
@@ -468,11 +468,7 @@ function clearActiveInstance(instanceId) {
468
468
  });
469
469
  }
470
470
  export {
471
- ACTIVE_INSTANCE_FILE,
472
- OWNER_DIR,
473
471
  RUNTIME_ROOT,
474
- RUNTIME_STALE_TTL,
475
- buildActiveInstanceState,
476
472
  cleanupInstanceRuntimeFiles,
477
473
  cleanupStaleRuntimeFiles,
478
474
  clearActiveInstance,
@@ -485,13 +481,11 @@ export {
485
481
  getPermissionResultPath,
486
482
  getTerminalLeadPid,
487
483
  getStatusPath,
488
- getStopFlagPath,
489
484
  getTurnEndPath,
490
485
  notePreviousServerIfAny,
491
486
  makeInstanceId,
492
487
  readActiveInstance,
493
488
  refreshActiveInstance,
494
489
  releaseOwnedChannelLocks,
495
- writeActiveInstance,
496
490
  writeServerPid
497
491
  };
@@ -6,9 +6,9 @@ import { randomUUID } from "crypto";
6
6
  import { DATA_DIR, DEFAULT_HOLIDAY_COUNTRY, isInQuietWindow } from "./config.mjs";
7
7
  import { runScript as execScript, ensureNopluginDir } from "./executor.mjs";
8
8
  import { withFileLockSync } from "../../shared/atomic-file.mjs";
9
- import { makeBridgeLlm } from '../../agent/orchestrator/smart-bridge/bridge-llm.mjs';
9
+ import { makeAgentDispatch } from '../../agent/orchestrator/agent-runtime/agent-dispatch.mjs';
10
10
 
11
- const schedulerLlm = makeBridgeLlm({ taskType: 'scheduler-task', role: 'scheduler-task', sourceType: 'scheduler' });
11
+ const schedulerLlm = makeAgentDispatch({ taskType: 'scheduler-task', role: 'scheduler-task', sourceType: 'scheduler' });
12
12
  const SCHEDULE_LOG = join(DATA_DIR, "schedule.log");
13
13
  // Buffered async logger — coalesces per-line appends into batched writes.
14
14
  let _schedLogBuf = [];
@@ -265,6 +265,7 @@ ${prompt}`;
265
265
  }
266
266
  static SCHEDULER_LOCK = join(tmpdir(), "mixdog-scheduler.lock");
267
267
  static INSTANCE_UUID = randomUUID();
268
+ static _exitHookInstalled = false;
268
269
  start() {
269
270
  if (this.tickTimer) return;
270
271
  const total = this.nonInteractive.length + this.interactive.length;
@@ -328,18 +329,21 @@ ${Scheduler.INSTANCE_UUID}`;
328
329
  }
329
330
  }, { timeoutMs: 60000, staleMs: 30000 });
330
331
  if (!acquiredSchedulerLock) return;
331
- process.on("exit", () => {
332
- // Verify ownership before unlink: an exiting process whose lock
333
- // was already reclaimed by a newer owner (PID-reuse / restart race)
334
- // must NOT delete the new owner's lock file. Read-verify-then-unlink
335
- // mirrors memory/index.mjs releaseLock().
336
- try {
337
- const content = readFileSync(Scheduler.SCHEDULER_LOCK, "utf8");
338
- const lockedPid = parseInt(content.split("\n")[0]);
339
- if (lockedPid === process.pid) unlinkSync(Scheduler.SCHEDULER_LOCK);
340
- } catch {
341
- }
342
- });
332
+ if (!Scheduler._exitHookInstalled) {
333
+ Scheduler._exitHookInstalled = true;
334
+ process.on("exit", () => {
335
+ // Verify ownership before unlink: an exiting process whose lock
336
+ // was already reclaimed by a newer owner (PID-reuse / restart race)
337
+ // must NOT delete the new owner's lock file. Read-verify-then-unlink
338
+ // mirrors memory/index.mjs releaseLock().
339
+ try {
340
+ const content = readFileSync(Scheduler.SCHEDULER_LOCK, "utf8");
341
+ const lockedPid = parseInt(content.split("\n")[0]);
342
+ if (lockedPid === process.pid) unlinkSync(Scheduler.SCHEDULER_LOCK);
343
+ } catch {
344
+ }
345
+ });
346
+ }
343
347
  logSchedule(`${this.nonInteractive.length} non-interactive, ${this.interactive.length} interactive
344
348
  `);
345
349
  this.registerCronJobs();
@@ -1,7 +1,7 @@
1
1
  import { readFileSync, readdirSync, statSync } from "fs";
2
2
  import { execFileSync } from "child_process";
3
3
  import { basename, join, resolve } from "path";
4
- import { homedir } from "os";
4
+ import { mixdogHome } from "../../shared/plugin-paths.mjs";
5
5
 
6
6
  function cwdToProjectSlug(cwd) {
7
7
  return resolve(cwd).replace(/\\/g, "/").replace(/^([A-Za-z]):/, "$1-").replace(/\//g, "-");
@@ -41,7 +41,7 @@ function getParentPid(pid) {
41
41
  }
42
42
  }
43
43
  function readSessionRecord(pid) {
44
- const sessionFile = join(homedir(), ".mixdog", "sessions", `${pid}.json`);
44
+ const sessionFile = join(mixdogHome(), "sessions", `${pid}.json`);
45
45
  try {
46
46
  const sessionFileStat = statSync(sessionFile);
47
47
  const session = JSON.parse(readFileSync(sessionFile, "utf8"));
@@ -77,7 +77,7 @@ function discoverCurrentClaudeSession() {
77
77
  return null;
78
78
  }
79
79
  function listInteractiveClaudeSessions() {
80
- const sessionsDir = join(homedir(), ".mixdog", "sessions");
80
+ const sessionsDir = join(mixdogHome(), "sessions");
81
81
  try {
82
82
  return readdirSync(sessionsDir).filter((file) => file.endsWith(".json")).map((file) => parseInt(basename(file, ".json"), 10)).filter((pid) => Number.isFinite(pid)).map((pid) => readSessionRecord(pid)).filter(isInteractiveSession).sort((a, b) => {
83
83
  if (b.startedAt !== a.startedAt) return b.startedAt - a.startedAt;
@@ -93,9 +93,6 @@ function getLatestInteractiveClaudeSession() {
93
93
 
94
94
  export {
95
95
  cwdToProjectSlug,
96
- getParentPid,
97
- readSessionRecord,
98
- isInteractiveSession,
99
96
  discoverCurrentClaudeSession,
100
97
  listInteractiveClaudeSessions,
101
98
  getLatestInteractiveClaudeSession
@@ -116,7 +116,6 @@ export {
116
116
  HIDDEN_TOOLS,
117
117
  isRecallMemory,
118
118
  isMemoryFile,
119
- isHidden,
120
119
  buildDedupKey,
121
120
  buildToolLine
122
121
  };
@@ -1,14 +1,14 @@
1
1
  import { readdirSync, existsSync, statSync } from "fs";
2
2
  import { basename, join, resolve } from "path";
3
- import { homedir } from "os";
4
3
  import {
5
4
  cwdToProjectSlug,
6
5
  discoverCurrentClaudeSession,
7
6
  listInteractiveClaudeSessions
8
7
  } from "./session-discovery.mjs";
8
+ import { mixdogHome } from "../../shared/plugin-paths.mjs";
9
9
 
10
10
  function resolveTranscriptForSession(session) {
11
- const projectsDir = join(homedir(), ".mixdog", "projects");
11
+ const projectsDir = join(mixdogHome(), "projects");
12
12
  const projectSlug = cwdToProjectSlug(process.cwd());
13
13
  const directTranscript = session.transcriptPath ? resolve(session.transcriptPath) : "";
14
14
  if (directTranscript && existsSync(directTranscript)) {
@@ -49,7 +49,7 @@ function resolveTranscriptForSession(session) {
49
49
  };
50
50
  }
51
51
  function findLatestTranscriptByMtime(cwd) {
52
- const projectsDir = join(homedir(), ".mixdog", "projects");
52
+ const projectsDir = join(mixdogHome(), "projects");
53
53
  const slug = cwdToProjectSlug(cwd ?? process.cwd());
54
54
  const projectDir = join(projectsDir, slug);
55
55
  try {
@@ -180,16 +180,8 @@ function discoverSessionBoundTranscript() {
180
180
  }
181
181
 
182
182
  export {
183
- resolveTranscriptForSession,
184
183
  findLatestTranscriptByMtime,
185
- isPidAlive,
186
184
  sameResolvedPath,
187
- transcriptStat,
188
- sessionTranscriptCandidate,
189
- latestMtimeTranscriptCandidate,
190
- candidateAffinity,
191
- compareTranscriptCandidates,
192
185
  detectCurrentSessionTranscript,
193
- discoverSessionBoundTranscript,
194
- TRANSCRIPT_MTIME_DECISIVE_MS
186
+ discoverSessionBoundTranscript
195
187
  };
@@ -410,7 +410,7 @@ function resolveNgrokBin() {
410
410
  // are candidate sources. process.env is the shell-start snapshot; registry
411
411
  // is the live user definition. Each candidate is tried in order and the
412
412
  // first that resolves to an existing file wins. This recovers two distinct
413
- // post-setx cases without a Claude Code restart:
413
+ // post-setx cases without a host-agent restart:
414
414
  // (a) env unset, registry set — fresh install + setx after process start
415
415
  // (b) env set to stale old path, registry set to new — user moved or
416
416
  // re-installed ngrok and setx'd the new path; the old env value would
@@ -3,27 +3,27 @@ export const TOOL_DEFS = [
3
3
  name: "reply",
4
4
  title: "Discord Reply",
5
5
  annotations: { title: "Discord Reply", readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
6
- description: "Send a reply/message to a configured channel. Requires chat_id and text; files are local paths to attach.",
6
+ description: "Send message to configured channel. files are local paths.",
7
7
  inputSchema: {
8
8
  type: "object",
9
9
  properties: {
10
- chat_id: { type: "string", description: "Target channel/chat id from the channel context." },
11
- text: { type: "string", description: "Message text to send." },
12
- reply_to: { type: "string", description: "Optional message id to reply to." },
10
+ chat_id: { type: "string", description: "Target channel/chat id." },
11
+ text: { type: "string", description: "Message text." },
12
+ reply_to: { type: "string", description: "Reply message id." },
13
13
  files: {
14
14
  type: "array",
15
15
  items: { type: "string" },
16
- description: "Local file paths to attach."
16
+ description: "Local file paths."
17
17
  },
18
18
  embeds: {
19
19
  type: "array",
20
20
  items: { type: "object", additionalProperties: true },
21
- description: "Discord embed payloads."
21
+ description: "Discord embeds."
22
22
  },
23
23
  components: {
24
24
  type: "array",
25
25
  items: { type: "object", additionalProperties: true },
26
- description: "Discord component payloads."
26
+ description: "Discord components."
27
27
  }
28
28
  },
29
29
  required: ["chat_id", "text"]
@@ -33,13 +33,13 @@ export const TOOL_DEFS = [
33
33
  name: "react",
34
34
  title: "Reaction",
35
35
  annotations: { title: "Reaction", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
36
- description: "Add an emoji reaction to an existing channel message.",
36
+ description: "React to channel message.",
37
37
  inputSchema: {
38
38
  type: "object",
39
39
  properties: {
40
40
  chat_id: { type: "string", description: "Target channel/chat id." },
41
- message_id: { type: "string", description: "Message id to react to." },
42
- emoji: { type: "string", description: "Emoji name or Unicode emoji." }
41
+ message_id: { type: "string", description: "Message id." },
42
+ emoji: { type: "string", description: "Emoji." }
43
43
  },
44
44
  required: ["chat_id", "message_id", "emoji"]
45
45
  }
@@ -48,22 +48,22 @@ export const TOOL_DEFS = [
48
48
  name: "edit_message",
49
49
  title: "Edit Message",
50
50
  annotations: { title: "Edit Message", readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: true },
51
- description: "Edit a bot-authored channel message. Requires chat_id, message_id, and replacement text.",
51
+ description: "Edit bot-authored channel message.",
52
52
  inputSchema: {
53
53
  type: "object",
54
54
  properties: {
55
55
  chat_id: { type: "string", description: "Target channel/chat id." },
56
- message_id: { type: "string", description: "Bot message id to edit." },
57
- text: { type: "string", description: "Replacement message text." },
56
+ message_id: { type: "string", description: "Bot message id." },
57
+ text: { type: "string", description: "Replacement text." },
58
58
  embeds: {
59
59
  type: "array",
60
60
  items: { type: "object", additionalProperties: true },
61
- description: "Replacement Discord embed payloads."
61
+ description: "Replacement embeds."
62
62
  },
63
63
  components: {
64
64
  type: "array",
65
65
  items: { type: "object", additionalProperties: true },
66
- description: "Replacement Discord component payloads."
66
+ description: "Replacement components."
67
67
  }
68
68
  },
69
69
  required: ["chat_id", "message_id", "text"]
@@ -73,12 +73,12 @@ export const TOOL_DEFS = [
73
73
  name: "download_attachment",
74
74
  title: "Download Attachment",
75
75
  annotations: { title: "Download Attachment", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
76
- description: "Download attachments from a channel message. Requires chat_id and message_id.",
76
+ description: "Download message attachments.",
77
77
  inputSchema: {
78
78
  type: "object",
79
79
  properties: {
80
80
  chat_id: { type: "string", description: "Source channel/chat id." },
81
- message_id: { type: "string", description: "Message id containing attachments." }
81
+ message_id: { type: "string", description: "Message id." }
82
82
  },
83
83
  required: ["chat_id", "message_id"]
84
84
  }
@@ -87,12 +87,12 @@ export const TOOL_DEFS = [
87
87
  name: "fetch",
88
88
  title: "Fetch",
89
89
  annotations: { title: "Fetch", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
90
- description: "Discord-only: fetch recent messages from a Discord channel. Requires channel (id); optional limit (count). NOT for URLs or web pages — use web_fetch for those.",
90
+ description: "Discord-only recent messages. NOT for URLs; use web_fetch.",
91
91
  inputSchema: {
92
92
  type: "object",
93
93
  properties: {
94
94
  channel: { type: "string", description: "Discord channel id." },
95
- limit: { type: "number", description: "Maximum recent messages to return." }
95
+ limit: { type: "number", description: "Max messages." }
96
96
  },
97
97
  required: ["channel"]
98
98
  }
@@ -101,7 +101,7 @@ export const TOOL_DEFS = [
101
101
  name: "schedule_status",
102
102
  title: "Schedule Status",
103
103
  annotations: { title: "Schedule Status", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
104
- description: "Show configured schedules and their current status.",
104
+ description: "Show schedule status.",
105
105
  inputSchema: {
106
106
  type: "object",
107
107
  properties: {},
@@ -112,7 +112,7 @@ export const TOOL_DEFS = [
112
112
  name: "trigger_schedule",
113
113
  title: "Trigger Schedule",
114
114
  annotations: { title: "Trigger Schedule", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
115
- description: "Run a configured scheduled task immediately by name. Requires name.",
115
+ description: "Run schedule now.",
116
116
  inputSchema: {
117
117
  type: "object",
118
118
  properties: {
@@ -125,13 +125,13 @@ export const TOOL_DEFS = [
125
125
  name: "schedule_control",
126
126
  title: "Schedule Control",
127
127
  annotations: { title: "Schedule Control", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
128
- description: 'Defer or skip a schedule without running it now: action=defer pushes by minutes; action=skip_today skips the next run today. Requires name and action.',
128
+ description: 'Defer or skip a schedule.',
129
129
  inputSchema: {
130
130
  type: "object",
131
131
  properties: {
132
132
  name: { type: "string", description: "Schedule name." },
133
- action: { type: "string", enum: ["defer", "skip_today"], description: "Schedule control action." },
134
- minutes: { type: "number", description: "Minutes to defer when action=defer." }
133
+ action: { type: "string", enum: ["defer", "skip_today"], description: "Control action." },
134
+ minutes: { type: "number", description: "Defer minutes." }
135
135
  },
136
136
  required: ["name", "action"]
137
137
  }
@@ -140,11 +140,11 @@ export const TOOL_DEFS = [
140
140
  name: "activate_channel_bridge",
141
141
  title: "Activate Channel Bridge",
142
142
  annotations: { title: "Activate Channel Bridge", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
143
- description: "Enable or disable channel bridge forwarding.",
143
+ description: "Toggle channel bridge.",
144
144
  inputSchema: {
145
145
  type: "object",
146
146
  properties: {
147
- active: { type: "boolean", description: "true to activate forwarding, false to deactivate." }
147
+ active: { type: "boolean", description: "Activate forwarding." }
148
148
  },
149
149
  required: ["active"]
150
150
  }
@@ -154,21 +154,21 @@ export const TOOL_DEFS = [
154
154
  name: "reload_config",
155
155
  title: "Reload Config",
156
156
  annotations: { title: "Reload Config", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
157
- description: "Reload channel/runtime configuration from disk.",
157
+ description: "Reload channel/runtime config.",
158
158
  inputSchema: { type: "object", properties: {}, additionalProperties: false }
159
159
  },
160
160
  {
161
161
  name: "inject_command",
162
162
  title: "Inject Mixdog Slash Command",
163
163
  annotations: { title: "Inject Mixdog Slash Command", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
164
- description: "Inject a supported Mixdog slash command into the active channel/session.",
164
+ description: "Inject supported Mixdog slash command.",
165
165
  inputSchema: {
166
166
  type: "object",
167
167
  properties: {
168
168
  command: {
169
169
  type: "string",
170
170
  enum: ["reload-plugins", "clear"],
171
- description: "Slash command to inject."
171
+ description: "Slash command."
172
172
  }
173
173
  },
174
174
  required: ["command"]
@@ -148,7 +148,6 @@ function loadKeytar() {
148
148
  // Avoids Atomics.wait on main thread (which hangs when SAB is not forwarded to worker).
149
149
  function keytarSync(method, ...args) {
150
150
  loadKeytar(); // throws if not installed — before spawning child
151
- const { spawnSync } = require('child_process');
152
151
  // Pass service/account/value via env to avoid shell injection entirely.
153
152
  const env = {
154
153
  ...process.env,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "generated_at": "2026-06-11T13:16:44.033Z",
3
+ "generated_at": "2026-06-30T06:23:20.385Z",
4
4
  "release_tag": "runtime-v0.4.0",
5
5
  "pg": {
6
6
  "major": 16,
@@ -20,6 +20,11 @@
20
20
  "sha256": "8e39bfc3f06d88e9854946d5d83f7d77d9530f99284d7c1c51872c12f389f7e7",
21
21
  "size": 23687666
22
22
  },
23
+ "linux-arm64": {
24
+ "url": "https://github.com/tribgames/mixdog/releases/download/runtime-v0.4.0/mixdog-runtime-linux-arm64-pg16.4-pgvector0.8.2.tar.gz",
25
+ "sha256": "64ff170013b9543ad8843c98cbfe14019e6be6ea3d142ec189b2bea0dd1dc797",
26
+ "size": 22885036
27
+ },
23
28
  "linux-x64": {
24
29
  "url": "https://github.com/tribgames/mixdog/releases/download/runtime-v0.4.0/mixdog-runtime-linux-x64-pg16.4-pgvector0.8.2.tar.gz",
25
30
  "sha256": "28ee64125a0125ff36c47560c08ce8f38e49aef034c010c7e4867e8cdd783385",
@@ -29,12 +34,6 @@
29
34
  "url": "https://github.com/tribgames/mixdog/releases/download/runtime-v0.4.0/mixdog-runtime-win32-x64-pg16.4-pgvector0.8.2.tar.gz",
30
35
  "sha256": "6faed8a49b3303b0adb1c5715b2b19c5cc47df2e738d586d0d0bd432f1ca035d",
31
36
  "size": 44036958
32
- },
33
- "linux-arm64": {
34
- "unsupported": true,
35
- "url": "TBD",
36
- "sha256": "TBD",
37
- "size": 0
38
37
  }
39
38
  }
40
39
  }