mixdog 0.9.151 → 0.9.153

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 (307) hide show
  1. package/LICENSES/browser-import-NOTICE.txt +11 -0
  2. package/NOTICE.md +11 -0
  3. package/README.md +108 -68
  4. package/package.json +17 -4
  5. package/scripts/computer-task-cost-report.mjs +144 -0
  6. package/scripts/run-office-live-tests.mjs +32 -0
  7. package/scripts/tool-stress.mjs +0 -2
  8. package/src/agents/front-worker/AGENT.md +13 -0
  9. package/src/agents/front-worker/agent.json +6 -0
  10. package/src/agents/heavy-worker/AGENT.md +10 -11
  11. package/src/agents/heavy-worker/agent.json +1 -1
  12. package/src/agents/maintainer/AGENT.md +0 -2
  13. package/src/agents/reviewer/AGENT.md +9 -13
  14. package/src/agents/reviewer/agent.json +1 -1
  15. package/src/agents/security/AGENT.md +14 -0
  16. package/src/agents/security/agent.json +6 -0
  17. package/src/agents/worker/AGENT.md +8 -8
  18. package/src/agents/worker/agent.json +1 -1
  19. package/src/agents/writer/AGENT.md +14 -0
  20. package/src/agents/writer/agent.json +6 -0
  21. package/src/defaults/skills/setup/SKILL.md +18 -27
  22. package/src/headless-exec.mjs +3 -10
  23. package/src/headless-exec.test.mjs +2 -7
  24. package/src/rules/agent/00-common.md +4 -7
  25. package/src/rules/lead/01-general.md +0 -3
  26. package/src/rules/shared/10-tool-workflow.md +10 -2
  27. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.mjs +183 -26
  28. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch.test.mjs +378 -0
  29. package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +4 -0
  30. package/src/runtime/agent/orchestrator/cache-break-trace.mjs +109 -0
  31. package/src/runtime/agent/orchestrator/cache-break-trace.test.mjs +115 -0
  32. package/src/runtime/agent/orchestrator/config.mjs +13 -68
  33. package/src/runtime/agent/orchestrator/context/collect-skills.test.mjs +153 -0
  34. package/src/runtime/agent/orchestrator/context/collect.mjs +49 -45
  35. package/src/runtime/agent/orchestrator/mcp/client.mjs +242 -15
  36. package/src/runtime/agent/orchestrator/mcp/features.test.mjs +66 -0
  37. package/src/runtime/agent/orchestrator/mcp/security.test.mjs +36 -20
  38. package/src/runtime/agent/orchestrator/providers/admission-scheduler-metrics.test.mjs +47 -0
  39. package/src/runtime/agent/orchestrator/providers/admission-scheduler.mjs +16 -3
  40. package/src/runtime/agent/orchestrator/providers/anthropic-sse.mjs +54 -33
  41. package/src/runtime/agent/orchestrator/providers/anthropic.mjs +1 -0
  42. package/src/runtime/agent/orchestrator/providers/antigravity-oauth.mjs +7 -0
  43. package/src/runtime/agent/orchestrator/providers/gemini-schema.mjs +7 -0
  44. package/src/runtime/agent/orchestrator/providers/gemini-stream.mjs +3 -8
  45. package/src/runtime/agent/orchestrator/providers/gemini.mjs +7 -0
  46. package/src/runtime/agent/orchestrator/providers/lib/anthropic-request-utils.mjs +19 -3
  47. package/src/runtime/agent/orchestrator/providers/lib/provider-replay.mjs +50 -0
  48. package/src/runtime/agent/orchestrator/providers/lib/sse-framing.mjs +93 -0
  49. package/src/runtime/agent/orchestrator/providers/media-normalization.mjs +30 -9
  50. package/src/runtime/agent/orchestrator/providers/media-parity.test.mjs +59 -0
  51. package/src/runtime/agent/orchestrator/providers/model-list-sanitize.mjs +3 -3
  52. package/src/runtime/agent/orchestrator/providers/openai-codex-identity.test.mjs +71 -0
  53. package/src/runtime/agent/orchestrator/providers/openai-codex-metadata.mjs +18 -26
  54. package/src/runtime/agent/orchestrator/providers/openai-compat-presets.mjs +8 -0
  55. package/src/runtime/agent/orchestrator/providers/openai-compat-stream.mjs +7 -0
  56. package/src/runtime/agent/orchestrator/providers/openai-compat-wire.mjs +25 -2
  57. package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +35 -4
  58. package/src/runtime/agent/orchestrator/providers/openai-oauth-http-sse.mjs +47 -2
  59. package/src/runtime/agent/orchestrator/providers/openai-oauth-ws.mjs +103 -12
  60. package/src/runtime/agent/orchestrator/providers/openai-responses-payload.mjs +13 -0
  61. package/src/runtime/agent/orchestrator/providers/openai-turn-state.mjs +68 -0
  62. package/src/runtime/agent/orchestrator/providers/openai-ws-delta-parity.test.mjs +122 -6
  63. package/src/runtime/agent/orchestrator/providers/openai-ws-delta.mjs +36 -11
  64. package/src/runtime/agent/orchestrator/providers/openai-ws-pool.mjs +144 -93
  65. package/src/runtime/agent/orchestrator/providers/openai-ws-stream.mjs +18 -13
  66. package/src/runtime/agent/orchestrator/providers/provider-replay.test.mjs +288 -0
  67. package/src/runtime/agent/orchestrator/providers/sse-framing.test.mjs +719 -0
  68. package/src/runtime/agent/orchestrator/providers/stream-json-pool.mjs +399 -39
  69. package/src/runtime/agent/orchestrator/providers/stream-json-worker.mjs +26 -0
  70. package/src/runtime/agent/orchestrator/session/agent-loop.mjs +86 -7
  71. package/src/runtime/agent/orchestrator/session/agent-loop.test.mjs +222 -0
  72. package/src/runtime/agent/orchestrator/session/browser-snapshot-supersession.mjs +61 -0
  73. package/src/runtime/agent/orchestrator/session/browser-snapshot-supersession.test.mjs +83 -0
  74. package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +13 -0
  75. package/src/runtime/agent/orchestrator/session/compact/runner.mjs +26 -2
  76. package/src/runtime/agent/orchestrator/session/compact-policy.test.mjs +112 -0
  77. package/src/runtime/agent/orchestrator/session/compaction-read-reset.test.mjs +192 -0
  78. package/src/runtime/agent/orchestrator/session/context-usage-restart.test.mjs +72 -0
  79. package/src/runtime/agent/orchestrator/session/context-utils.mjs +100 -15
  80. package/src/runtime/agent/orchestrator/session/eager-dispatch.mjs +17 -1
  81. package/src/runtime/agent/orchestrator/session/eager-dispatch.test.mjs +74 -0
  82. package/src/runtime/agent/orchestrator/session/image-strip-recovery.mjs +12 -8
  83. package/src/runtime/agent/orchestrator/session/image-strip-recovery.test.mjs +20 -1
  84. package/src/runtime/agent/orchestrator/session/loop/compact-policy.mjs +110 -2
  85. package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.mjs +3 -16
  86. package/src/runtime/agent/orchestrator/session/loop/pre-dispatch-deny.test.mjs +28 -0
  87. package/src/runtime/agent/orchestrator/session/loop/recall-fasttrack.mjs +2 -2
  88. package/src/runtime/agent/orchestrator/session/loop/steering.mjs +6 -0
  89. package/src/runtime/agent/orchestrator/session/loop/tool-exec.mjs +15 -1
  90. package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +6 -0
  91. package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +111 -39
  92. package/src/runtime/agent/orchestrator/session/manager/ask-session.test.mjs +46 -0
  93. package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +30 -6
  94. package/src/runtime/agent/orchestrator/session/manager/message-sanitize.mjs +3 -0
  95. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +27 -3
  96. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +26 -54
  97. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.test.mjs +63 -1
  98. package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +3 -0
  99. package/src/runtime/agent/orchestrator/session/manager/tool-resolution.mjs +4 -110
  100. package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.mjs +580 -0
  101. package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint-journal.test.mjs +593 -0
  102. package/src/runtime/agent/orchestrator/session/manager/turn-checkpoint.mjs +119 -190
  103. package/src/runtime/agent/orchestrator/session/manager/turn-interruption.mjs +115 -0
  104. package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +43 -8
  105. package/src/runtime/agent/orchestrator/session/provider-prefix-guard.mjs +129 -12
  106. package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +9 -2
  107. package/src/runtime/agent/orchestrator/session/store/listing.mjs +8 -1
  108. package/src/runtime/agent/orchestrator/session/store/save-worker.mjs +15 -1
  109. package/src/runtime/agent/orchestrator/session/store-live-publication.test.mjs +83 -0
  110. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +36 -2
  111. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +157 -30
  112. package/src/runtime/agent/orchestrator/session/store-summary-reader.test.mjs +64 -0
  113. package/src/runtime/agent/orchestrator/session/store-summary-visibility.mjs +57 -0
  114. package/src/runtime/agent/orchestrator/session/store-summary-visibility.test.mjs +219 -0
  115. package/src/runtime/agent/orchestrator/session/store.mjs +26 -2
  116. package/src/runtime/agent/orchestrator/session/tool-batch.mjs +22 -0
  117. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool-cwd-env.test.mjs +14 -0
  118. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool.mjs +19 -10
  119. package/src/runtime/agent/orchestrator/tools/builtin/find-search-budget.test.mjs +30 -14
  120. package/src/runtime/agent/orchestrator/tools/builtin/git-command-policy.mjs +15 -4
  121. package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +73 -15
  122. package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.test.mjs +76 -2
  123. package/src/runtime/agent/orchestrator/tools/builtin/list-tool.mjs +24 -683
  124. package/src/runtime/agent/orchestrator/tools/builtin/native-search-client.mjs +64 -72
  125. package/src/runtime/agent/orchestrator/tools/builtin/native-search-runner.mjs +2 -5
  126. package/src/runtime/agent/orchestrator/tools/builtin/native-search-transport.mjs +75 -0
  127. package/src/runtime/agent/orchestrator/tools/builtin/native-search-transport.test.mjs +24 -0
  128. package/src/runtime/agent/orchestrator/tools/builtin/read-special-files.mjs +6 -6
  129. package/src/runtime/agent/orchestrator/tools/code-graph/build.mjs +12 -0
  130. package/src/runtime/agent/orchestrator/tools/code-graph/constants.mjs +4 -1
  131. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +24 -5
  132. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.test.mjs +44 -0
  133. package/src/runtime/agent/orchestrator/tools/code-graph/graph-binary.mjs +12 -2
  134. package/src/runtime/agent/orchestrator/tools/code-graph/graph-model.mjs +35 -21
  135. package/src/runtime/agent/orchestrator/tools/code-graph/memory-cache.mjs +28 -13
  136. package/src/runtime/agent/orchestrator/tools/code-graph/memory-cache.test.mjs +54 -0
  137. package/src/runtime/agent/orchestrator/tools/graph-manifest.json +11 -11
  138. package/src/runtime/agent/orchestrator/tools/patch-manifest.json +11 -11
  139. package/src/runtime/agent/orchestrator/tools/progress-message.mjs +12 -0
  140. package/src/runtime/agent/orchestrator/tools/spawn-manifest.json +11 -11
  141. package/src/runtime/attachments/pdf-extract.mjs +3 -0
  142. package/src/runtime/attachments/pdfjs-runtime.mjs +13 -0
  143. package/src/runtime/bridge-clients.test.mjs +827 -0
  144. package/src/runtime/browser-bridge/action-schema.mjs +251 -0
  145. package/src/runtime/browser-bridge/client.mjs +152 -0
  146. package/src/runtime/browser-bridge/tool-defs.mjs +159 -0
  147. package/src/runtime/computer-bridge/action-schema.mjs +653 -0
  148. package/src/runtime/computer-bridge/client.mjs +231 -0
  149. package/src/runtime/computer-bridge/tool-defs.mjs +33 -0
  150. package/src/runtime/media/store.mjs +18 -8
  151. package/src/runtime/media/store.test.mjs +14 -0
  152. package/src/runtime/memory/index.mjs +1 -1
  153. package/src/runtime/memory/lib/transcript-ingest.mjs +8 -6
  154. package/src/runtime/memory/lib/transcript-ingest.test.mjs +52 -0
  155. package/src/runtime/office/assurance-benchmark.mjs +358 -0
  156. package/src/runtime/office/assurance.mjs +833 -0
  157. package/src/runtime/office/benchmark.mjs +496 -0
  158. package/src/runtime/office/capabilities.mjs +551 -0
  159. package/src/runtime/office/com-adapter.mjs +283 -0
  160. package/src/runtime/office/content-model.mjs +183 -0
  161. package/src/runtime/office/contract-benchmark.mjs +105 -0
  162. package/src/runtime/office/design-library.mjs +1562 -0
  163. package/src/runtime/office/design-system.mjs +1966 -0
  164. package/src/runtime/office/index.mjs +2413 -0
  165. package/src/runtime/office/journal.mjs +82 -0
  166. package/src/runtime/office/office-assurance.test.mjs +371 -0
  167. package/src/runtime/office/office-com-host.ps1 +3781 -0
  168. package/src/runtime/office/office-com-session-host.ps1 +855 -0
  169. package/src/runtime/office/office-live-runtime.test.mjs +819 -0
  170. package/src/runtime/office/office-runtime.test.mjs +2070 -0
  171. package/src/runtime/office/ooxml-validator.mjs +271 -0
  172. package/src/runtime/office/pagination.mjs +132 -0
  173. package/src/runtime/office/pdf-adapter.mjs +591 -0
  174. package/src/runtime/office/pdf-analysis.mjs +372 -0
  175. package/src/runtime/office/pdf-render.mjs +167 -0
  176. package/src/runtime/office/pdf-security.mjs +63 -0
  177. package/src/runtime/office/polish-benchmark.mjs +190 -0
  178. package/src/runtime/office/portable-ooxml.mjs +1867 -0
  179. package/src/runtime/office/quality-live-benchmark.mjs +486 -0
  180. package/src/runtime/office/quality-pipeline.mjs +136 -0
  181. package/src/runtime/office/tabular.mjs +302 -0
  182. package/src/runtime/office/templates/mixdog-executive.pptx +0 -0
  183. package/src/runtime/office/templates/mixdog-executive.pptx.mixdog.json +190 -0
  184. package/src/runtime/office/tool-defs.mjs +113 -0
  185. package/src/runtime/office/visual-diff.mjs +89 -0
  186. package/src/runtime/office/xlsx-assertions.mjs +172 -0
  187. package/src/runtime/office/xlsx-contract.mjs +147 -0
  188. package/src/runtime/shared/agent-route-config.mjs +9 -0
  189. package/src/runtime/shared/child-spawn-gate.mjs +17 -0
  190. package/src/runtime/shared/child-spawn-remote.mjs +69 -7
  191. package/src/runtime/shared/child-spawn-remote.test.mjs +124 -0
  192. package/src/runtime/shared/pristine-execution-contract.json +2 -1
  193. package/src/runtime/shared/provider-api-key.mjs +1 -0
  194. package/src/runtime/shared/session-runtime-health.mjs +91 -0
  195. package/src/runtime/shared/session-runtime-health.test.mjs +53 -0
  196. package/src/runtime/shared/skill-document.mjs +86 -0
  197. package/src/runtime/shared/skill-document.test.mjs +81 -0
  198. package/src/runtime/shared/tool-execution-contract.mjs +16 -0
  199. package/src/runtime/shared/tool-surface.mjs +27 -0
  200. package/src/runtime/shared/turn-snapshot-store.mjs +1 -0
  201. package/src/runtime/shared/turn-snapshot.mjs +32 -9
  202. package/src/runtime/shared/user-cwd.mjs +33 -14
  203. package/src/runtime/shared/user-cwd.test.mjs +43 -0
  204. package/src/session-runtime/agent-disable.test.mjs +20 -1
  205. package/src/session-runtime/context-status.mjs +9 -3
  206. package/src/session-runtime/cwd-plugins.mjs +26 -26
  207. package/src/session-runtime/cwd-plugins.test.mjs +75 -0
  208. package/src/session-runtime/cwd-tool-routing.test.mjs +5 -0
  209. package/src/session-runtime/deferred-tool-delta.mjs +104 -0
  210. package/src/session-runtime/deferred-tool-delta.test.mjs +40 -0
  211. package/src/session-runtime/global-extensions.mjs +26 -0
  212. package/src/session-runtime/global-extensions.test.mjs +28 -0
  213. package/src/session-runtime/global-settings-session-identity.test.mjs +76 -0
  214. package/src/session-runtime/goal-runtime.mjs +1141 -0
  215. package/src/session-runtime/goal-runtime.test.mjs +645 -0
  216. package/src/session-runtime/lifecycle-api.mjs +58 -11
  217. package/src/session-runtime/lifecycle-api.test.mjs +183 -0
  218. package/src/session-runtime/mcp-glue.mjs +49 -47
  219. package/src/session-runtime/plugin-mcp-standard.test.mjs +177 -0
  220. package/src/session-runtime/plugin-mcp.mjs +96 -22
  221. package/src/session-runtime/prewarm.mjs +1 -10
  222. package/src/session-runtime/provider-request-snapshot.mjs +33 -9
  223. package/src/session-runtime/provider-request-snapshot.test.mjs +27 -5
  224. package/src/session-runtime/resource-api-global.test.mjs +109 -0
  225. package/src/session-runtime/resource-api.mjs +168 -116
  226. package/src/session-runtime/runtime-core.mjs +208 -29
  227. package/src/session-runtime/runtime-tunables.mjs +6 -8
  228. package/src/session-runtime/session-lifecycle.mjs +34 -12
  229. package/src/session-runtime/session-title.mjs +2 -2
  230. package/src/session-runtime/session-turn-api.mjs +37 -25
  231. package/src/session-runtime/skills-api.mjs +79 -25
  232. package/src/session-runtime/skills-api.test.mjs +99 -0
  233. package/src/session-runtime/tool-catalog-data.mjs +1 -1
  234. package/src/session-runtime/tool-catalog-schema.mjs +0 -5
  235. package/src/session-runtime/tool-catalog.mjs +42 -112
  236. package/src/session-runtime/tool-defs.mjs +6 -1
  237. package/src/session-runtime/tool-policy-surface.test.mjs +93 -17
  238. package/src/session-runtime/tool-surface.mjs +30 -8
  239. package/src/session-runtime/workflow-agents-api.mjs +8 -25
  240. package/src/session-runtime/workflow.mjs +8 -6
  241. package/src/standalone/agent-dispatch-broker.mjs +5 -9
  242. package/src/standalone/agent-tool/helpers.mjs +2 -2
  243. package/src/standalone/agent-tool/job-views.mjs +3 -1
  244. package/src/standalone/agent-tool/notify.mjs +11 -9
  245. package/src/standalone/agent-tool/notify.test.mjs +37 -0
  246. package/src/standalone/agent-tool/render.mjs +3 -0
  247. package/src/standalone/agent-tool/spawn-flow.mjs +61 -16
  248. package/src/standalone/agent-tool/spawn-flow.test.mjs +41 -0
  249. package/src/standalone/agent-tool/tool-def.mjs +1 -1
  250. package/src/standalone/agent-tool/worker-index.mjs +123 -0
  251. package/src/standalone/agent-tool/worker-index.test.mjs +132 -0
  252. package/src/standalone/agent-tool/worker-rows.mjs +2 -1
  253. package/src/standalone/agent-tool.mjs +57 -10
  254. package/src/standalone/daemon.mjs +113 -15
  255. package/src/standalone/hook-bus/config.mjs +1 -0
  256. package/src/standalone/plugin-admin.mjs +17 -0
  257. package/src/standalone/plugin-admin.test.mjs +7 -0
  258. package/src/standalone/provider-admin.mjs +1 -0
  259. package/src/standalone/session-protocol.mjs +5 -0
  260. package/src/standalone/session-runtime-agent-control-client.mjs +133 -0
  261. package/src/standalone/session-runtime-agent-control-client.test.mjs +71 -0
  262. package/src/standalone/session-runtime-dispatch-cancel.test.mjs +139 -0
  263. package/src/standalone/session-runtime-host-factory.mjs +17 -0
  264. package/src/standalone/session-runtime-host-factory.test.mjs +31 -0
  265. package/src/standalone/session-runtime-host-health.test.mjs +5 -0
  266. package/src/standalone/session-runtime-host.mjs +709 -58
  267. package/src/standalone/session-runtime-inline-host.mjs +258 -0
  268. package/src/standalone/session-runtime-inline-host.test.mjs +385 -0
  269. package/src/standalone/session-runtime-provider-cooldown.mjs +78 -0
  270. package/src/standalone/session-runtime-provider-cooldown.test.mjs +80 -0
  271. package/src/standalone/session-runtime-shard-host.test.mjs +642 -0
  272. package/src/standalone/session-runtime-shard-router.mjs +149 -0
  273. package/src/standalone/session-runtime-shard-router.test.mjs +101 -0
  274. package/src/standalone/session-runtime-worker.mjs +302 -26
  275. package/src/standalone/session-service-agent-tree.test.mjs +984 -0
  276. package/src/standalone/session-service-goal-recovery.test.mjs +177 -0
  277. package/src/standalone/session-service.mjs +711 -11
  278. package/src/tui/app/app-view.jsx +1 -0
  279. package/src/tui/app/core-memory-picker.mjs +2 -0
  280. package/src/tui/app/extension-pickers.mjs +1 -1
  281. package/src/tui/app/maintenance-pickers.mjs +3 -3
  282. package/src/tui/app/model-options.mjs +2 -0
  283. package/src/tui/app/model-picker.mjs +14 -4
  284. package/src/tui/app/panel-handoff.test.mjs +311 -0
  285. package/src/tui/app/project-picker.mjs +1 -0
  286. package/src/tui/app/route-pickers.mjs +21 -6
  287. package/src/tui/app/settings-picker.mjs +26 -3
  288. package/src/tui/app/slash-commands.mjs +1 -0
  289. package/src/tui/app/slash-dispatch.mjs +73 -22
  290. package/src/tui/app/theme-effort-pickers.mjs +7 -2
  291. package/src/tui/components/Picker.jsx +10 -1
  292. package/src/tui/dist/index.mjs +187 -45
  293. package/src/tui/lib/voice-setup.mjs +4 -1
  294. package/src/tui/session/agent-message-source.test.mjs +37 -0
  295. package/src/tui/session/completion-card-restore.test.mjs +50 -0
  296. package/src/tui/session/context-state.mjs +3 -13
  297. package/src/tui/session/goal-continuation.mjs +141 -0
  298. package/src/tui/session/goal-continuation.test.mjs +203 -0
  299. package/src/tui/session/queue-helpers.mjs +5 -2
  300. package/src/tui/session/session-action-surface.test.mjs +190 -0
  301. package/src/tui/session/session-api-ext.mjs +48 -8
  302. package/src/tui/session/session-api.mjs +73 -1
  303. package/src/tui/session/session-flow.mjs +31 -1
  304. package/src/tui/session/turn.mjs +88 -15
  305. package/src/tui/session-local.mjs +39 -3
  306. package/src/vendor/statusline/src/gateway/route-meta.mjs +31 -0
  307. package/src/runtime/agent/orchestrator/tools/builtin/fuzzy-match.mjs +0 -301
@@ -55,6 +55,44 @@ export function createSlashDispatch({
55
55
  runDoctor,
56
56
  requestExit,
57
57
  }) {
58
+ const openSlashPanel = (command, title, open) => {
59
+ const own = surface.claim();
60
+ if (!own.paint({
61
+ _kind: `slash-loading:${command}`,
62
+ title,
63
+ description: `Loading ${title.toLowerCase()}...`,
64
+ help: 'Esc Close',
65
+ indexMode: 'never',
66
+ pickerKey: `slash-loading:${command}`,
67
+ loading: true,
68
+ items: [],
69
+ onSelect: () => {},
70
+ onCancel: () => own.close(),
71
+ })) return;
72
+ const finishUnclaimedLoading = () => {
73
+ // A real picker/context/usage surface supersedes this loading identity.
74
+ // If the opener completed without painting (empty result or failure),
75
+ // remove only the still-owned placeholder and restore the normal prompt.
76
+ if (own.owns()) own.close();
77
+ };
78
+ try {
79
+ const opening = open();
80
+ if (opening && typeof opening.then === 'function') {
81
+ void Promise.resolve(opening).then(
82
+ finishUnclaimedLoading,
83
+ (error) => {
84
+ finishUnclaimedLoading();
85
+ store.pushNotice(`${title} panel failed: ${error?.message || error}`, 'error');
86
+ },
87
+ );
88
+ } else {
89
+ finishUnclaimedLoading();
90
+ }
91
+ } catch (error) {
92
+ finishUnclaimedLoading();
93
+ store.pushNotice(`${title} panel failed: ${error?.message || error}`, 'error');
94
+ }
95
+ };
58
96
  const runSlashCommand = (cmd, arg = '') => {
59
97
  const rawName = String(cmd || '').toLowerCase();
60
98
  cmd = normalizeSlashCommandName(cmd);
@@ -86,12 +124,12 @@ export function createSlashDispatch({
86
124
  return true;
87
125
  case 'model':
88
126
  if (!arg) {
89
- openModelPicker();
127
+ openSlashPanel('model', 'Model', () => openModelPicker());
90
128
  return true;
91
129
  }
92
130
  if (arg.trim().toLowerCase() === 'refresh') {
93
131
  // Explicit catalog reload: force a fresh remote provider list.
94
- openModelPicker({ refreshModels: true });
132
+ openSlashPanel('model', 'Model', () => openModelPicker({ refreshModels: true }));
95
133
  return true;
96
134
  }
97
135
  void store.setModel(arg)
@@ -104,14 +142,16 @@ export function createSlashDispatch({
104
142
  // in-flight turn, and the same picker is already reachable mid-turn via
105
143
  // /settings, so blocking it here was inconsistent.
106
144
  if (arg) store.pushNotice('/websearch sets the web-search provider/model; the web_search tool uses that model when called.', 'warn');
107
- openWebSearchPicker();
145
+ openSlashPanel('websearch', 'Web Search Model', () => openWebSearchPicker());
108
146
  return true;
109
147
  case 'agents':
110
- openAgentsPicker(arg.trim().toLowerCase() === 'refresh' ? { refreshModels: true } : {});
148
+ openSlashPanel('agents', 'Agents', () => openAgentsPicker(
149
+ arg.trim().toLowerCase() === 'refresh' ? { refreshModels: true } : {},
150
+ ));
111
151
  return true;
112
152
  case 'workflow':
113
153
  if (!arg) {
114
- openWorkflowPicker();
154
+ openSlashPanel('workflow', 'Workflow', () => openWorkflowPicker());
115
155
  return true;
116
156
  }
117
157
  void store.setWorkflow?.(arg.trim())
@@ -132,7 +172,7 @@ export function createSlashDispatch({
132
172
  const value = arg.trim();
133
173
  const lower = value.toLowerCase();
134
174
  if (!value) {
135
- openOutputStylePicker();
175
+ openSlashPanel('outputstyle', 'Output Style', () => openOutputStylePicker());
136
176
  return true;
137
177
  }
138
178
  if (lower === 'status' || lower === 'current' || lower === 'show') {
@@ -159,7 +199,7 @@ export function createSlashDispatch({
159
199
  const value = arg.trim();
160
200
  const lower = value.toLowerCase();
161
201
  if (!value) {
162
- openThemePicker();
202
+ openSlashPanel('theme', 'Theme', () => openThemePicker());
163
203
  return true;
164
204
  }
165
205
  let themes = [];
@@ -194,7 +234,7 @@ export function createSlashDispatch({
194
234
  // turn. Same for /fast below.
195
235
  const pendingTurn = state.busy ? ' (applies from the next turn)' : '';
196
236
  if (!arg) {
197
- openEffortPicker();
237
+ openSlashPanel('effort', 'Effort', () => openEffortPicker());
198
238
  return true;
199
239
  }
200
240
  void store.setEffort(arg)
@@ -237,23 +277,23 @@ export function createSlashDispatch({
237
277
  enterProject(target);
238
278
  return true;
239
279
  }
240
- openProjectPicker();
280
+ openSlashPanel('project', 'Projects', () => openProjectPicker());
241
281
  return true;
242
282
  }
243
283
  case 'mcp':
244
- openMcpPicker();
284
+ openSlashPanel('mcp', 'MCP Servers', () => openMcpPicker());
245
285
  return true;
246
286
  case 'skills':
247
- openSkillsPicker();
287
+ openSlashPanel('skills', 'Skills', () => openSkillsPicker());
248
288
  return true;
249
289
  case 'plugins':
250
- openPluginsPicker();
290
+ openSlashPanel('plugins', 'Plugins', () => openPluginsPicker());
251
291
  return true;
252
292
  case 'hooks':
253
- openHooksPicker();
293
+ openSlashPanel('hooks', 'Hooks', () => openHooksPicker());
254
294
  return true;
255
295
  case 'providers':
256
- void openProviderSetupPicker();
296
+ openSlashPanel('providers', 'Providers', () => openProviderSetupPicker());
257
297
  return true;
258
298
  case 'schedules':
259
299
  case 'webhooks':
@@ -263,7 +303,7 @@ export function createSlashDispatch({
263
303
  return true;
264
304
  case 'memory': {
265
305
  if (!arg.trim()) {
266
- openMemoryCorePicker({ returnTo: null });
306
+ openSlashPanel('memory', 'Memory', () => openMemoryCorePicker({ returnTo: null }));
267
307
  return true;
268
308
  }
269
309
  void store.memoryControl?.(parseMemoryCommand(arg))
@@ -273,7 +313,7 @@ export function createSlashDispatch({
273
313
  case 'autoclear': {
274
314
  const value = arg.trim().toLowerCase();
275
315
  if (!value) {
276
- openAutoClearPicker();
316
+ openSlashPanel('autoclear', 'Auto-clear', () => openAutoClearPicker());
277
317
  return true;
278
318
  }
279
319
  // Promise-shaped on a daemon-backed store, so the verdict is reported
@@ -324,6 +364,17 @@ export function createSlashDispatch({
324
364
  })
325
365
  .catch((error) => store.pushNotice(compactFailureNotice(error), 'error'));
326
366
  return true;
367
+ case 'goal':
368
+ void Promise.resolve(store.goalControl?.({ command: arg }))
369
+ .then((result) => {
370
+ if (!result) {
371
+ store.pushNotice('Goal is unavailable.', 'warn');
372
+ return;
373
+ }
374
+ store.pushNotice(result.message || 'Goal updated.', 'info');
375
+ })
376
+ .catch((error) => store.pushNotice(`Goal failed: ${error?.message || error}`, 'error'));
377
+ return true;
327
378
  case 'resume':
328
379
  if (state.busy) {
329
380
  store.pushNotice('wait for the current turn to finish before /resume', 'warn');
@@ -334,14 +385,14 @@ export function createSlashDispatch({
334
385
  .then(ok => store.pushNotice(ok ? `Resumed ${arg}` : 'Couldn’t resume chat.', ok ? 'info' : 'warn'))
335
386
  .catch((e) => store.pushNotice(`Couldn’t resume chat: ${e?.message || e}`, 'error'));
336
387
  } else {
337
- openResumePicker();
388
+ openSlashPanel('resume', 'Resume', () => openResumePicker());
338
389
  }
339
390
  return true;
340
391
  case 'usage':
341
- openUsagePanel(arg);
392
+ openSlashPanel('usage', 'Provider Quotas', () => openUsagePanel(arg));
342
393
  return true;
343
394
  case 'context':
344
- openContextPicker();
395
+ openSlashPanel('context', 'Context Usage', () => openContextPicker());
345
396
  return true;
346
397
  case 'inherit':
347
398
  if (state.busy) {
@@ -363,13 +414,13 @@ export function createSlashDispatch({
363
414
  return true;
364
415
  case 'settings':
365
416
  case 'config':
366
- openSettingsPicker();
417
+ openSlashPanel('settings', 'Settings', () => openSettingsPicker());
367
418
  return true;
368
419
  case 'profile':
369
- openProfilePicker();
420
+ openSlashPanel('profile', 'Profile', () => openProfilePicker());
370
421
  return true;
371
422
  case 'update':
372
- openUpdatePicker();
423
+ openSlashPanel('update', 'Update', () => openUpdatePicker());
373
424
  return true;
374
425
  case 'doctor':
375
426
  if (state.commandBusy) {
@@ -24,6 +24,9 @@ export function createThemeEffortPickers({
24
24
  const openThemePicker = (options = {}) => {
25
25
  const returnTo = typeof options.returnTo === 'function' ? options.returnTo : null;
26
26
  const onboarding = options.onboarding || null;
27
+ const handoffPanel = options.handoffPanel && typeof options.handoffPanel === 'object'
28
+ ? options.handoffPanel
29
+ : null;
27
30
  const own = surface.claim();
28
31
  let themes = [];
29
32
  try {
@@ -60,7 +63,8 @@ export function createThemeEffortPickers({
60
63
  // Onboarding: Enter (row) and ConfirmBar Next both persist the highlighted
61
64
  // theme, then advance; Back restores the original palette then steps back.
62
65
  const saveTheme = (id, { advance = false } = {}) => {
63
- own.close();
66
+ if (handoffPanel) own.paint(handoffPanel);
67
+ else own.close();
64
68
  const applied = applyTheme(id, { persist: true });
65
69
  store.pushNotice(themeNotice(applied || { id }), 'info');
66
70
  if (advance && onboarding) onboarding.onAdvance?.();
@@ -102,7 +106,8 @@ export function createThemeEffortPickers({
102
106
  saveTheme(entry.id, { advance: Boolean(onboarding) });
103
107
  },
104
108
  onCancel: () => {
105
- own.close();
109
+ if (handoffPanel) own.paint(handoffPanel);
110
+ else own.close();
106
111
  // Restore the theme that was active before the picker opened.
107
112
  if (currentId) applyTheme(currentId, { persist: false });
108
113
  if (onboarding) onboarding.onCancel?.();
@@ -94,6 +94,10 @@ export function Picker({
94
94
  indexMode = 'auto',
95
95
  fillHeight = false,
96
96
  visibleCount = MAX_VISIBLE,
97
+ // Loading panels reserve the same content-row geometry as the real list.
98
+ // This prevents an `(empty)` row from being replaced by a multi-row menu in
99
+ // one commit, which reads as the option items jumping into place.
100
+ loading = false,
97
101
  // Onboarding confirm bar: { buttons:[{value,label}], onConfirm(button,index) }.
98
102
  // When present, ←/→ and Tab drive button focus (mutually exclusive with
99
103
  // onLeft/onRight), and Enter fires onConfirm while a button is focused.
@@ -284,6 +288,11 @@ export function Picker({
284
288
  // Clamp selected index when items change length.
285
289
  if (items.length === 0) {
286
290
  const emptyLine = truncateText(String(description || '').replace(/\s+/g, ' ').trim(), Math.max(0, columns - 4));
291
+ const loadingRows = loading
292
+ ? Array.from({ length: visibleLimit }, (_, index) => (
293
+ <Text key={`loading-${index}`} color={theme.inactive}> </Text>
294
+ ))
295
+ : null;
287
296
  return (
288
297
  <Box flexDirection="column" flexShrink={0} height={fillHeight ? '100%' : undefined}>
289
298
  <Box
@@ -303,7 +312,7 @@ export function Picker({
303
312
  <Text> </Text>
304
313
  <Text color={theme.text}>{emptyLine || ' '}</Text>
305
314
  <Text> </Text>
306
- <Text color={theme.inactive}>(empty)</Text>
315
+ {loading ? loadingRows : <Text color={theme.inactive}>(empty)</Text>}
307
316
  {hasConfirm ? (
308
317
  <>
309
318
  <Box flexGrow={1} />