mixdog 1.1.2 → 1.2.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 (424) hide show
  1. package/README.md +8 -5
  2. package/package.json +2 -1
  3. package/scripts/lib/run-node-tests.mjs +9 -0
  4. package/scripts/prune-desktop-runtime.mjs +3 -0
  5. package/scripts/test-direct.mjs +4 -2
  6. package/src/defaults/shipped-history.json +10 -0
  7. package/src/defaults/skills/pptx/SKILL.md +6 -6
  8. package/src/defaults/skills/pptx/references/review.md +6 -4
  9. package/src/defaults/skills/pptx/scripts/source-extract.mjs +1 -1
  10. package/src/defaults/skills/setup/references/actions.md +18 -5
  11. package/src/defaults/skills/visualize/SKILL.md +160 -0
  12. package/src/defaults/skills/visualize/references/craft.md +88 -0
  13. package/src/headless-command.mjs +56 -3
  14. package/src/headless-exec.mjs +17 -1
  15. package/src/help.mjs +2 -0
  16. package/src/rules/shared/60-verification.md +3 -1
  17. package/src/rules/shared/70-delivery.md +4 -2
  18. package/src/runtime/agent/orchestrator/agent-runtime/agent-dispatch/preset.mjs +1 -0
  19. package/src/runtime/agent/orchestrator/agent-runtime/maintenance-route.mjs +1 -0
  20. package/src/runtime/agent/orchestrator/agent-runtime/session-builder.mjs +2 -0
  21. package/src/runtime/agent/orchestrator/cache-mtime.mjs +26 -5
  22. package/src/runtime/agent/orchestrator/config-presets.mjs +2 -0
  23. package/src/runtime/agent/orchestrator/config-providers-merge.mjs +17 -11
  24. package/src/runtime/agent/orchestrator/config-storage.mjs +1 -0
  25. package/src/runtime/agent/orchestrator/config.mjs +19 -5
  26. package/src/runtime/agent/orchestrator/context/collect.mjs +2 -1
  27. package/src/runtime/agent/orchestrator/context/deferred-tools.mjs +11 -5
  28. package/src/runtime/agent/orchestrator/context/skill-catalog.mjs +74 -21
  29. package/src/runtime/agent/orchestrator/mcp/client-config.mjs +133 -15
  30. package/src/runtime/agent/orchestrator/mcp/client-handshake.mjs +55 -8
  31. package/src/runtime/agent/orchestrator/mcp/client-transport.mjs +86 -8
  32. package/src/runtime/agent/orchestrator/mcp/client.mjs +474 -164
  33. package/src/runtime/agent/orchestrator/mcp/lazy-output-validator.mjs +25 -0
  34. package/src/runtime/agent/orchestrator/mcp/plugin-placeholders.mjs +54 -0
  35. package/src/runtime/agent/orchestrator/mcp/reconnect-singleflight.mjs +4 -0
  36. package/src/runtime/agent/orchestrator/providers/account-pool.mjs +108 -17
  37. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
  38. package/src/runtime/agent/orchestrator/providers/anthropic-oauth-credentials.mjs +3 -0
  39. package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +15 -1
  40. package/src/runtime/agent/orchestrator/providers/anthropic.mjs +32 -12
  41. package/src/runtime/agent/orchestrator/providers/antigravity-oauth-tokens.mjs +2 -0
  42. package/src/runtime/agent/orchestrator/providers/auto-effort.mjs +9 -0
  43. package/src/runtime/agent/orchestrator/providers/command-code-oauth-login.mjs +337 -0
  44. package/src/runtime/agent/orchestrator/providers/command-code-oauth-tokens.mjs +159 -0
  45. package/src/runtime/agent/orchestrator/providers/command-code-oauth.mjs +444 -0
  46. package/src/runtime/agent/orchestrator/providers/cursor-auth.mjs +2 -0
  47. package/src/runtime/agent/orchestrator/providers/cursor-client-version.mjs +1 -1
  48. package/src/runtime/agent/orchestrator/providers/cursor-wire-normalization.mjs +2 -1
  49. package/src/runtime/agent/orchestrator/providers/custom-provider.mjs +7 -4
  50. package/src/runtime/agent/orchestrator/providers/effort-configuration.mjs +21 -6
  51. package/src/runtime/agent/orchestrator/providers/effort-rejection.mjs +244 -0
  52. package/src/runtime/agent/orchestrator/providers/gemini.mjs +41 -28
  53. package/src/runtime/agent/orchestrator/providers/grok-client-version.mjs +1 -1
  54. package/src/runtime/agent/orchestrator/providers/grok-oauth-tokens.mjs +3 -0
  55. package/src/runtime/agent/orchestrator/providers/lib/gemini-model-catalog.mjs +7 -1
  56. package/src/runtime/agent/orchestrator/providers/mimo-oauth-profile.mjs +8 -40
  57. package/src/runtime/agent/orchestrator/providers/mimo-oauth-tokens.mjs +2 -0
  58. package/src/runtime/agent/orchestrator/providers/mimo-oauth.mjs +51 -12
  59. package/src/runtime/agent/orchestrator/providers/model-cache.mjs +37 -2
  60. package/src/runtime/agent/orchestrator/providers/model-proxy-bridge.mjs +1080 -0
  61. package/src/runtime/agent/orchestrator/providers/model-proxy-channel.d.mts +82 -0
  62. package/src/runtime/agent/orchestrator/providers/model-proxy-channel.mjs +556 -0
  63. package/src/runtime/agent/orchestrator/providers/model-proxy-provider.mjs +251 -0
  64. package/src/runtime/agent/orchestrator/providers/muse-code-oauth-tokens.mjs +2 -0
  65. package/src/runtime/agent/orchestrator/providers/muse-code-oauth.mjs +69 -102
  66. package/src/runtime/agent/orchestrator/providers/oauth-credential-probes.mjs +15 -0
  67. package/src/runtime/agent/orchestrator/providers/oauth-usage.mjs +6 -5
  68. package/src/runtime/agent/orchestrator/providers/openai-compat-chat-send.mjs +1 -1
  69. package/src/runtime/agent/orchestrator/providers/openai-compat-models.mjs +6 -2
  70. package/src/runtime/agent/orchestrator/providers/openai-compat-options.mjs +11 -0
  71. package/src/runtime/agent/orchestrator/providers/openai-compat-xai-send.mjs +2 -1
  72. package/src/runtime/agent/orchestrator/providers/openai-compat.mjs +15 -4
  73. package/src/runtime/agent/orchestrator/providers/openai-oauth-catalog-store.mjs +1 -1
  74. package/src/runtime/agent/orchestrator/providers/openai-oauth-catalog.mjs +5 -2
  75. package/src/runtime/agent/orchestrator/providers/openai-oauth-tokens.mjs +3 -0
  76. package/src/runtime/agent/orchestrator/providers/openai-ws.mjs +4 -4
  77. package/src/runtime/agent/orchestrator/providers/registry.mjs +47 -7
  78. package/src/runtime/agent/orchestrator/runtime-core/builtin-features.mjs +10 -0
  79. package/src/runtime/agent/orchestrator/runtime-core/config-helpers.mjs +36 -3
  80. package/src/runtime/agent/orchestrator/runtime-core/effort.mjs +15 -11
  81. package/src/runtime/agent/orchestrator/runtime-core/extension-scopes.mjs +15 -55
  82. package/src/runtime/agent/orchestrator/runtime-core/goal-control.mjs +15 -2
  83. package/src/runtime/agent/orchestrator/runtime-core/model-capabilities.mjs +16 -1
  84. package/src/runtime/agent/orchestrator/runtime-core/plugin-mcp.mjs +278 -84
  85. package/src/runtime/agent/orchestrator/runtime-core/skill-tool-loading.mjs +4 -1
  86. package/src/runtime/agent/orchestrator/runtime-core/tool-catalog-schema.mjs +21 -0
  87. package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +54 -3
  88. package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +10 -3
  89. package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +10 -0
  90. package/src/runtime/agent/orchestrator/session/cache/prefetch-cache.mjs +9 -5
  91. package/src/runtime/agent/orchestrator/session/cache/read-cache.mjs +18 -8
  92. package/src/runtime/agent/orchestrator/session/catalog-db/index.mjs +284 -0
  93. package/src/runtime/agent/orchestrator/session/catalog-db/schema.mjs +268 -0
  94. package/src/runtime/agent/orchestrator/session/catalog-db/sqlite-gate.mjs +27 -0
  95. package/src/runtime/agent/orchestrator/session/catalog-db/worker.mjs +628 -0
  96. package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +10 -3
  97. package/src/runtime/agent/orchestrator/session/compact/messages.mjs +24 -13
  98. package/src/runtime/agent/orchestrator/session/compact/runner.mjs +13 -5
  99. package/src/runtime/agent/orchestrator/session/compaction-archive-capture.mjs +362 -0
  100. package/src/runtime/agent/orchestrator/session/compaction-archive.mjs +253 -0
  101. package/src/runtime/agent/orchestrator/session/conversation-import/claude.mjs +184 -0
  102. package/src/runtime/agent/orchestrator/session/conversation-import/codex.mjs +136 -0
  103. package/src/runtime/agent/orchestrator/session/conversation-import/convert.mjs +128 -0
  104. package/src/runtime/agent/orchestrator/session/conversation-import/imported-session.mjs +127 -0
  105. package/src/runtime/agent/orchestrator/session/conversation-import/turns.mjs +101 -0
  106. package/src/runtime/agent/orchestrator/session/explicit-skills.mjs +83 -5
  107. package/src/runtime/agent/orchestrator/session/imported-message.mjs +11 -0
  108. package/src/runtime/agent/orchestrator/session/loop/completion-guards.mjs +2 -1
  109. package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +1 -1
  110. package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/continuation.mjs +1 -1
  111. package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/diagnostic.mjs +1 -7
  112. package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/refusal.mjs +1 -1
  113. package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/segments.mjs +3 -2
  114. package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +5 -3
  115. package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +7 -4
  116. package/src/runtime/agent/orchestrator/session/loop/steering.mjs +21 -10
  117. package/src/runtime/agent/orchestrator/session/loop/tool-helpers.mjs +3 -0
  118. package/src/runtime/agent/orchestrator/session/loop/usage.mjs +3 -0
  119. package/src/runtime/agent/orchestrator/session/manager/ask-queue.mjs +12 -3
  120. package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +15 -3
  121. package/src/runtime/agent/orchestrator/session/manager/ask-turn-auto-effort.mjs +22 -12
  122. package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +9 -2
  123. package/src/runtime/agent/orchestrator/session/manager/ask-turn-loop-options.mjs +9 -3
  124. package/src/runtime/agent/orchestrator/session/manager/ask-turn-settle.mjs +5 -2
  125. package/src/runtime/agent/orchestrator/session/manager/compaction-runner.mjs +37 -16
  126. package/src/runtime/agent/orchestrator/session/manager/context-meta.mjs +4 -0
  127. package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +17 -4
  128. package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +90 -0
  129. package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +22 -12
  130. package/src/runtime/agent/orchestrator/session/manager/session-lifecycle.mjs +32 -3
  131. package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +27 -0
  132. package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +16 -1
  133. package/src/runtime/agent/orchestrator/session/manager/status-telemetry.mjs +1 -0
  134. package/src/runtime/agent/orchestrator/session/manager/usage-metrics.mjs +2 -0
  135. package/src/runtime/agent/orchestrator/session/manager.mjs +0 -1
  136. package/src/runtime/agent/orchestrator/session/message-ids.mjs +123 -0
  137. package/src/runtime/agent/orchestrator/session/message-ids.test-support.mjs +29 -0
  138. package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +33 -22
  139. package/src/runtime/agent/orchestrator/session/store/listing.mjs +6 -2
  140. package/src/runtime/agent/orchestrator/session/store/session-delete.mjs +3 -0
  141. package/src/runtime/agent/orchestrator/session/store/summary-cache.mjs +6 -0
  142. package/src/runtime/agent/orchestrator/session/store/sweep/sweep-finish.mjs +10 -3
  143. package/src/runtime/agent/orchestrator/session/store-agent-worker-rows.mjs +11 -0
  144. package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +817 -0
  145. package/src/runtime/agent/orchestrator/session/store-summary-fields.mjs +36 -0
  146. package/src/runtime/agent/orchestrator/session/store-summary-index.mjs +23 -12
  147. package/src/runtime/agent/orchestrator/session/store-summary-reader-catalog-fixture.mjs +158 -0
  148. package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +202 -374
  149. package/src/runtime/agent/orchestrator/session/store-transcript-projection.mjs +20 -3
  150. package/src/runtime/agent/orchestrator/session/synthetic-user-envelope.mjs +3 -1
  151. package/src/runtime/agent/orchestrator/session/tool-batch/pre-dispatch.mjs +1 -1
  152. package/src/runtime/agent/orchestrator/session/transcript-restore/restore.mjs +48 -9
  153. package/src/runtime/agent/orchestrator/session/transcript-restore/user-text.mjs +161 -0
  154. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/invocation-plan.mjs +17 -1
  155. package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/spawn-env.mjs +4 -0
  156. package/src/runtime/agent/orchestrator/tools/builtin/cache-layers.mjs +52 -2
  157. package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +32 -22
  158. package/src/runtime/agent/orchestrator/tools/builtin/git-repo-rw-lock.mjs +10 -3
  159. package/src/runtime/agent/orchestrator/tools/builtin/lib/list-helpers.mjs +2 -2
  160. package/src/runtime/agent/orchestrator/tools/builtin/path-diagnostics.mjs +6 -6
  161. package/src/runtime/agent/orchestrator/tools/builtin/read-cache-policy.mjs +8 -0
  162. package/src/runtime/agent/orchestrator/tools/builtin/read-range-index.mjs +203 -33
  163. package/src/runtime/agent/orchestrator/tools/builtin/read-single-fast-paths.mjs +32 -35
  164. package/src/runtime/agent/orchestrator/tools/builtin/read-single-guards.mjs +8 -4
  165. package/src/runtime/agent/orchestrator/tools/builtin/read-single-render.mjs +11 -12
  166. package/src/runtime/agent/orchestrator/tools/builtin/read-single-stream.mjs +9 -6
  167. package/src/runtime/agent/orchestrator/tools/builtin/read-single-tool.mjs +83 -68
  168. package/src/runtime/agent/orchestrator/tools/builtin/read-snapshot-runtime.mjs +8 -3
  169. package/src/runtime/agent/orchestrator/tools/builtin/read-source-windows.mjs +20 -3
  170. package/src/runtime/agent/orchestrator/tools/builtin/read-streaming.mjs +16 -7
  171. package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-dispatch.mjs +2 -1
  172. package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-publication.mjs +137 -0
  173. package/src/runtime/agent/orchestrator/tools/builtin/read-tool/batch-snapshot.mjs +11 -10
  174. package/src/runtime/agent/orchestrator/tools/builtin/read-tool.mjs +21 -11
  175. package/src/runtime/agent/orchestrator/tools/builtin/runtime-capabilities.mjs +12 -1
  176. package/src/runtime/agent/orchestrator/tools/builtin/search-glob-tool.mjs +13 -10
  177. package/src/runtime/agent/orchestrator/tools/builtin/search-grep-tool.mjs +1 -1
  178. package/src/runtime/agent/orchestrator/tools/builtin/search-path-diagnostics.mjs +17 -12
  179. package/src/runtime/agent/orchestrator/tools/builtin/task-tool.mjs +56 -13
  180. package/src/runtime/agent/orchestrator/tools/code-graph/disk-cache.mjs +58 -0
  181. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch/root-resolution.mjs +2 -2
  182. package/src/runtime/agent/orchestrator/tools/code-graph/dispatch.mjs +1 -1
  183. package/src/runtime/agent/orchestrator/tools/code-graph/trusted-roots.mjs +25 -1
  184. package/src/runtime/agent/orchestrator/tools/patch/apply-patch/codex-batch.mjs +4 -4
  185. package/src/runtime/agent/orchestrator/tools/patch/apply-patch/route.mjs +2 -2
  186. package/src/runtime/agent/orchestrator/tools/patch/orchestrator.mjs +1 -1
  187. package/src/runtime/agent/orchestrator/tools/patch/read-redirects.mjs +34 -30
  188. package/src/runtime/agent/orchestrator/tools/patch/sequence/units.mjs +7 -7
  189. package/src/runtime/agent/orchestrator/tools/patch/sequence.mjs +1 -1
  190. package/src/runtime/agent/orchestrator/tools/patch/ui-diff.mjs +78 -5
  191. package/src/runtime/agent/orchestrator/tools/progress-message.mjs +2 -0
  192. package/src/runtime/agent/orchestrator/tools/shell-snapshot.mjs +4 -0
  193. package/src/runtime/attachments/store.d.mts +3 -0
  194. package/src/runtime/attachments/store.mjs +38 -0
  195. package/src/runtime/channels/lib/owned-runtime/owned-start.mjs +1 -1
  196. package/src/runtime/channels/lib/webhook/session-dispatch.mjs +16 -4
  197. package/src/runtime/channels/lib/worker-main.mjs +17 -14
  198. package/src/runtime/computer-bridge/linux-readiness.mjs +0 -2
  199. package/src/runtime/effort-judge/judge-client.mjs +56 -18
  200. package/src/runtime/memory/lib/memory.mjs +1 -1
  201. package/src/runtime/memory/lib/session-ingest.mjs +2 -2
  202. package/src/runtime/shared/atomic-file.mjs +33 -6
  203. package/src/runtime/shared/best-effort-stderr.mjs +8 -0
  204. package/src/runtime/shared/code-graph-state.mjs +12 -0
  205. package/src/runtime/shared/defaults-separation.mjs +2 -0
  206. package/src/runtime/shared/extension-scopes.mjs +5 -3
  207. package/src/runtime/shared/file-lock.mjs +37 -11
  208. package/src/runtime/shared/git-runner-worker.mjs +3 -2
  209. package/src/runtime/shared/git-runner.mjs +4 -3
  210. package/src/runtime/shared/llm/anthropic-effort.mjs +14 -0
  211. package/src/runtime/shared/llm/default-context-window.mjs +6 -0
  212. package/src/runtime/shared/llm/model-catalog-projection.mjs +5 -4
  213. package/src/runtime/shared/llm/model-catalog.mjs +240 -130
  214. package/src/runtime/shared/llm/provider-catalog-cache.mjs +36 -28
  215. package/src/runtime/shared/llm/provider-catalog-registry.mjs +162 -0
  216. package/src/runtime/shared/llm/provider-seed-rosters.mjs +130 -0
  217. package/src/runtime/shared/model-proxy-mode.d.mts +3 -0
  218. package/src/runtime/shared/model-proxy-mode.mjs +19 -0
  219. package/src/runtime/shared/plugin-manifest.mjs +18 -9
  220. package/src/runtime/shared/pristine-execution-contract.json +9 -2
  221. package/src/runtime/shared/pristine-execution.mjs +28 -4
  222. package/src/runtime/shared/provider-accounts.mjs +125 -21
  223. package/src/runtime/shared/provider-api-key.mjs +33 -1
  224. package/src/runtime/shared/schedule-model-ref.mjs +11 -2
  225. package/src/runtime/shared/session-usage-totals.mjs +19 -0
  226. package/src/runtime/shared/sharp-electron-linux.mjs +25 -0
  227. package/src/runtime/shared/shell-display.mjs +9 -3
  228. package/src/runtime/shared/singleton-owner.mjs +36 -6
  229. package/src/runtime/shared/skill-mentions.d.mts +10 -0
  230. package/src/runtime/shared/skill-mentions.mjs +133 -0
  231. package/src/runtime/shared/skill-script-runtime.mjs +264 -0
  232. package/src/runtime/shared/statusline/statusline-segments.mjs +68 -14
  233. package/src/runtime/shared/tool-primitives.mjs +35 -2
  234. package/src/runtime/shared/tool-surface.mjs +7 -0
  235. package/src/runtime/shared/tool-work-units.mjs +14 -0
  236. package/src/runtime/shared/transcript-metadata.mjs +17 -1
  237. package/src/runtime/shared/turn-changes.mjs +791 -0
  238. package/src/runtime/shared/turn-snapshot-store.mjs +346 -12
  239. package/src/runtime/shared/turn-snapshot.mjs +690 -81
  240. package/src/runtime/shared/turn-worktree-snapshot.mjs +185 -15
  241. package/src/runtime/shared/worker-requests.mjs +15 -2
  242. package/src/runtime/shared/worktrees/cache-cleanups.mjs +52 -0
  243. package/src/runtime/shared/worktrees/contract.mjs +551 -0
  244. package/src/runtime/shared/worktrees/disk.mjs +57 -0
  245. package/src/runtime/shared/worktrees/git.mjs +247 -0
  246. package/src/runtime/shared/worktrees/include.mjs +480 -0
  247. package/src/runtime/shared/worktrees/lock.mjs +46 -0
  248. package/src/runtime/shared/worktrees/maintenance.mjs +96 -0
  249. package/src/runtime/shared/worktrees/manager.mjs +1215 -0
  250. package/src/runtime/shared/worktrees/merge.mjs +182 -0
  251. package/src/runtime/shared/worktrees/owner.mjs +46 -0
  252. package/src/runtime/shared/worktrees/paths.mjs +62 -0
  253. package/src/runtime/shared/worktrees/registry.mjs +110 -0
  254. package/src/runtime/shared/worktrees/settings.mjs +84 -0
  255. package/src/runtime/shared/worktrees/slug.mjs +62 -0
  256. package/src/runtime/shared/worktrees/test-support.mjs +96 -0
  257. package/src/runtime/visualize-bridge/client.mjs +181 -0
  258. package/src/runtime/visualize-bridge/tool-defs.mjs +97 -0
  259. package/src/session-runtime/automation-agents.mjs +8 -2
  260. package/src/session-runtime/boot/apis.mjs +90 -0
  261. package/src/session-runtime/boot/config.mjs +7 -2
  262. package/src/session-runtime/boot/facade.mjs +21 -0
  263. package/src/session-runtime/boot/infrastructure.mjs +30 -18
  264. package/src/session-runtime/boot/session.mjs +1 -0
  265. package/src/session-runtime/boot/tools.mjs +4 -0
  266. package/src/session-runtime/config-lifecycle.mjs +10 -1
  267. package/src/session-runtime/conversation-import/discovery.mjs +698 -0
  268. package/src/session-runtime/conversation-import/service.mjs +369 -0
  269. package/src/session-runtime/cwd-plugins/cwd-apply.mjs +21 -6
  270. package/src/session-runtime/cwd-plugins/plugin-status.mjs +47 -42
  271. package/src/session-runtime/global-extensions.mjs +2 -2
  272. package/src/session-runtime/internal-tool-executor/bridge-tools.mjs +27 -2
  273. package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +32 -1
  274. package/src/session-runtime/internal-tool-executor.mjs +9 -1
  275. package/src/session-runtime/lifecycle/session-catalog.mjs +8 -1
  276. package/src/session-runtime/lifecycle/session-switch/context-switch.mjs +5 -0
  277. package/src/session-runtime/lifecycle/session-switch/resume.mjs +21 -3
  278. package/src/session-runtime/lifecycle/session-switch/session-delete.mjs +16 -0
  279. package/src/session-runtime/mcp-glue/connect.mjs +68 -16
  280. package/src/session-runtime/mcp-glue/plugin-servers.mjs +499 -0
  281. package/src/session-runtime/mcp-glue/server-catalog.mjs +122 -33
  282. package/src/session-runtime/mcp-glue/server-input.mjs +29 -0
  283. package/src/session-runtime/mcp-glue.mjs +22 -2
  284. package/src/session-runtime/model-route/route-persist.mjs +3 -0
  285. package/src/session-runtime/model-route/set-route.mjs +15 -2
  286. package/src/session-runtime/new-session-config.mjs +3 -2
  287. package/src/session-runtime/notification-bus.mjs +18 -3
  288. package/src/session-runtime/provider-auth/accounts.mjs +33 -15
  289. package/src/session-runtime/provider-models/row-hydration.mjs +2 -0
  290. package/src/session-runtime/provider-models/web-search-catalog.mjs +5 -1
  291. package/src/session-runtime/provider-readiness.mjs +16 -10
  292. package/src/session-runtime/resource-extension-sync.mjs +45 -7
  293. package/src/session-runtime/resource-mcp-api.mjs +121 -84
  294. package/src/session-runtime/resource-plugins-api.mjs +29 -41
  295. package/src/session-runtime/resource-scope-decorate.mjs +6 -8
  296. package/src/session-runtime/resource-skills-api.mjs +23 -2
  297. package/src/session-runtime/route-resolution.mjs +10 -1
  298. package/src/session-runtime/route-state.mjs +16 -2
  299. package/src/session-runtime/runtime-core.mjs +5 -0
  300. package/src/session-runtime/runtime-facade.mjs +8 -0
  301. package/src/session-runtime/runtime-review-api.mjs +9 -0
  302. package/src/session-runtime/schedule-session-run.mjs +1 -1
  303. package/src/session-runtime/services/agent-tool/helpers.mjs +5 -0
  304. package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +3 -0
  305. package/src/session-runtime/services/agent-tool/job-views/job-lookup.mjs +1 -0
  306. package/src/session-runtime/services/agent-tool/job-views/spawn-meta.mjs +1 -0
  307. package/src/session-runtime/services/agent-tool/lead-worker-index.mjs +15 -0
  308. package/src/session-runtime/services/agent-tool/send-flow.mjs +1 -0
  309. package/src/session-runtime/services/agent-tool/spawn-flow/spawn-plan.mjs +10 -2
  310. package/src/session-runtime/services/agent-tool/spawn-flow/spawn-prep.mjs +19 -7
  311. package/src/session-runtime/services/agent-tool/spawn-preset.mjs +3 -0
  312. package/src/session-runtime/services/agent-tool/tag-registry.mjs +2 -1
  313. package/src/session-runtime/services/agent-tool/worker-index/row-shape.mjs +5 -0
  314. package/src/session-runtime/services/agent-tool/worker-rows.mjs +1 -0
  315. package/src/session-runtime/services/agent-tool.mjs +1 -0
  316. package/src/session-runtime/services/channel-session-router.mjs +4 -1
  317. package/src/session-runtime/services/daemon-candidate.mjs +3 -2
  318. package/src/session-runtime/services/daemon-crash-capture/spawn-capture.mjs +55 -0
  319. package/src/session-runtime/services/hook-bus/command-handler.mjs +4 -1
  320. package/src/session-runtime/services/hook-bus/handlers.mjs +7 -3
  321. package/src/session-runtime/services/provider-admin.mjs +64 -18
  322. package/src/session-runtime/services/usage-dashboard-model.mjs +3 -0
  323. package/src/session-runtime/session-create/session-options.mjs +10 -1
  324. package/src/session-runtime/session-turn-api.mjs +1 -0
  325. package/src/session-runtime/settings-api.mjs +4 -2
  326. package/src/session-runtime/settings-builtin-tools-api.mjs +9 -2
  327. package/src/session-runtime/settings-worktree-api.mjs +17 -0
  328. package/src/session-runtime/setup-tool/executor.mjs +23 -5
  329. package/src/session-runtime/setup-tool/extended-actions.mjs +1 -0
  330. package/src/session-runtime/setup-tool/settings-contract.mjs +4 -1
  331. package/src/session-runtime/setup-tool/tool-defs.mjs +38 -4
  332. package/src/session-runtime/skills-api.mjs +7 -3
  333. package/src/session-runtime/turn/agent-ops.mjs +12 -1
  334. package/src/session-runtime/turn/turn-run/ask-callbacks.mjs +14 -3
  335. package/src/session-runtime/turn/turn-run/snapshot-tracker.mjs +20 -15
  336. package/src/session-runtime/turn/turn-run/turn-open.mjs +4 -5
  337. package/src/session-runtime/turn/turn-run/turn-prepare.mjs +29 -1
  338. package/src/session-runtime/turn/turn-run/turn-settle.mjs +6 -1
  339. package/src/session-runtime/turn/turn-run.mjs +6 -7
  340. package/src/session-runtime/webhook-session-run.mjs +16 -4
  341. package/src/session-runtime/workflow-agents-api/agent-route.mjs +15 -3
  342. package/src/session-runtime/workspace/admission-gate.mjs +197 -0
  343. package/src/session-runtime/workspace/project-branches.mjs +136 -0
  344. package/src/session-runtime/workspace/transition-steps.mjs +364 -0
  345. package/src/session-runtime/workspace/transitions.mjs +651 -0
  346. package/src/session-runtime/workspace/workspace-state.mjs +112 -0
  347. package/src/skill-script-entry.mjs +36 -0
  348. package/src/standalone/channel-transport/http-routes.mjs +17 -0
  349. package/src/standalone/channel-transport.mjs +13 -1
  350. package/src/standalone/daemon-desktop-runtime.mjs +1 -0
  351. package/src/standalone/daemon-owner.mjs +372 -0
  352. package/src/standalone/daemon-stored-session-views.mjs +15 -4
  353. package/src/standalone/daemon.mjs +179 -8
  354. package/src/standalone/desktop-service-registry.mjs +20 -0
  355. package/src/standalone/local-session-runtime.mjs +11 -0
  356. package/src/standalone/session-client/attachment-calls.mjs +3 -1
  357. package/src/standalone/session-client/daemon-unavailable.mjs +62 -0
  358. package/src/standalone/session-client/lease-heartbeat.mjs +47 -0
  359. package/src/standalone/session-client.mjs +104 -13
  360. package/src/standalone/session-protocol.mjs +21 -0
  361. package/src/standalone/session-proxy.mjs +3 -0
  362. package/src/standalone/session-service/agent-tree/agent-child.mjs +4 -0
  363. package/src/standalone/session-service/agent-tree/agent-rehydrate.mjs +1 -0
  364. package/src/standalone/session-service/entries/lifecycle.mjs +6 -0
  365. package/src/standalone/session-service/projection/revisions.mjs +2 -0
  366. package/src/standalone/session-service/projection/transcript-window.mjs +149 -19
  367. package/src/standalone/session-service/projection/workspace.mjs +14 -0
  368. package/src/standalone/session-service/session-calls/session-action.mjs +17 -4
  369. package/src/standalone/session-transport/call-route.mjs +13 -0
  370. package/src/standalone/session-transport/client-registry/client-grace.mjs +45 -3
  371. package/src/standalone/session-transport/client-registry/registration-replays.mjs +1 -0
  372. package/src/standalone/session-transport/client-registry.mjs +20 -3
  373. package/src/standalone/session-transport/routes.mjs +79 -2
  374. package/src/standalone/session-transport/stack.mjs +2 -0
  375. package/src/standalone/session-transport.mjs +24 -1
  376. package/src/tui/App.jsx +9 -1
  377. package/src/tui/app/app-view/floating-panel.jsx +9 -1
  378. package/src/tui/app/app-view.jsx +6 -0
  379. package/src/tui/app/extension-pickers/plugins-pickers.mjs +35 -16
  380. package/src/tui/app/message-selector.mjs +2 -1
  381. package/src/tui/app/model-options.mjs +37 -5
  382. package/src/tui/app/model-picker/provider-models-list.mjs +2 -2
  383. package/src/tui/app/model-picker.mjs +4 -2
  384. package/src/tui/app/skill-mention-palette.mjs +88 -0
  385. package/src/tui/app/slash-palette.mjs +23 -7
  386. package/src/tui/app/transcript-row-estimate.mjs +11 -3
  387. package/src/tui/app/use-prompt-draft-flow.mjs +7 -2
  388. package/src/tui/app/use-prompt-state.mjs +5 -0
  389. package/src/tui/components/Message.jsx +22 -1
  390. package/src/tui/components/PromptInput.jsx +21 -3
  391. package/src/tui/components/SlashCommandPalette.jsx +12 -3
  392. package/src/tui/components/TranscriptItem.jsx +9 -1
  393. package/src/tui/components/prompt-input/key-handler.mjs +21 -8
  394. package/src/tui/components/user-message-skills.mjs +38 -0
  395. package/src/tui/dist/index.mjs +839 -207
  396. package/src/tui/index.jsx +10 -2
  397. package/src/tui/session/compaction-view.mjs +147 -0
  398. package/src/tui/session/context-state.mjs +6 -0
  399. package/src/tui/session/initial-state.mjs +3 -0
  400. package/src/tui/session/queue-helpers.mjs +7 -2
  401. package/src/tui/session/quota-resume.mjs +2 -1
  402. package/src/tui/session/session-api/commands.mjs +10 -2
  403. package/src/tui/session/session-api/controls.mjs +4 -0
  404. package/src/tui/session/session-api/extensions.mjs +4 -2
  405. package/src/tui/session/session-api/intake/rewind.mjs +2 -1
  406. package/src/tui/session/session-api/integrations.mjs +17 -0
  407. package/src/tui/session/session-api/lifecycle/dispose.mjs +6 -1
  408. package/src/tui/session/session-api/lifecycle/inheritance.mjs +2 -0
  409. package/src/tui/session/session-api/lifecycle/resume.mjs +3 -0
  410. package/src/tui/session/session-api/routes.mjs +10 -1
  411. package/src/tui/session/session-api/settings.mjs +9 -0
  412. package/src/tui/session/session-api/worktree.mjs +60 -0
  413. package/src/tui/session/session-api.mjs +2 -0
  414. package/src/tui/session/session-flow/auto-clear.mjs +31 -12
  415. package/src/tui/session/session-flow/drain.mjs +27 -3
  416. package/src/tui/session/session-flow/session-reset.mjs +4 -3
  417. package/src/tui/session/session-flow.mjs +2 -0
  418. package/src/tui/session/transcript-intake.mjs +14 -5
  419. package/src/tui/session/tui-steering-persist.mjs +25 -9
  420. package/src/tui/session/turn-stream.mjs +32 -4
  421. package/src/tui/session/turn-tool-cards.mjs +10 -2
  422. package/src/tui/session/turn.mjs +56 -10
  423. package/src/runtime/effort-judge/previous-human-request.mjs +0 -162
  424. package/src/runtime/effort-judge/verified-context-input.mjs +0 -10
package/README.md CHANGED
@@ -6,8 +6,12 @@
6
6
 
7
7
  <p align="center">
8
8
  The open-source coding agent that uses 63% fewer tokens.
9
+ <br>
10
+ <a href="#installation"><b>Download ↓</b></a>
9
11
  </p>
10
12
 
13
+ https://github.com/user-attachments/assets/af515dc9-b0fb-4b6a-aaa1-1d82db792ed0
14
+
11
15
  <p align="center">
12
16
  <a href="https://github.com/tribgames/mixdog/releases/latest/download/mixdog-desktop-win-x64.exe"><img src="https://raw.githubusercontent.com/tribgames/mixdog/main/docs/assets/download-windows.svg" alt="Download for Windows" height="48"></a>
13
17
  &nbsp;
@@ -30,8 +34,6 @@
30
34
  <a href="#documentation"><b>Docs</b></a>
31
35
  </p>
32
36
 
33
- https://github.com/user-attachments/assets/af515dc9-b0fb-4b6a-aaa1-1d82db792ed0
34
-
35
37
  ## Highlights
36
38
 
37
39
  - [63% fewer tokens](#benchmarks) than Codex CLI on the same model, at the
@@ -116,9 +118,9 @@ shell networking — headless exec is not an offline sandbox. Run
116
118
 
117
119
  <p align="center">
118
120
  <picture>
119
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/benchmarks/terminal-bench-2.1/tb21-sol-vs-codex-dark.svg">
120
- <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/benchmarks/terminal-bench-2.1/tb21-sol-vs-codex-light.svg">
121
- <img alt="Bar chart: Mixdog vs Codex CLI on Terminal-Bench 2.1" src="https://raw.githubusercontent.com/tribgames/mixdog/main/benchmarks/terminal-bench-2.1/tb21-sol-vs-codex-light.svg">
121
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/design/promo/tb21-sol-vs-codex-dark.svg">
122
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/tribgames/mixdog/main/design/promo/tb21-sol-vs-codex-light.svg">
123
+ <img alt="Bar chart: Mixdog vs Codex CLI on Terminal-Bench 2.1" src="https://raw.githubusercontent.com/tribgames/mixdog/main/design/promo/tb21-sol-vs-codex-light.svg">
122
124
  </picture>
123
125
  </p>
124
126
 
@@ -139,6 +141,7 @@ savings come from.
139
141
  - [Benchmarks](benchmarks/terminal-bench-2.1/)
140
142
  - [Code Tidy](docs/code-tidy.md)
141
143
  - [Git & GitHub](docs/git-github-integration.md)
144
+ - [SSH servers](docs/ssh-remote.md) (Korean, with an English summary)
142
145
  - [Language servers](docs/language-servers.md)
143
146
  - [Office runtime](src/runtime/office/README.md)
144
147
  - [Development, configuration, and testing](docs/development.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixdog",
3
- "version": "1.1.2",
3
+ "version": "1.2.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Open-source coding agent that matches Codex on Terminal-Bench 2.1 with 63% fewer tokens.",
@@ -156,6 +156,7 @@
156
156
  "@formulajs/formulajs": "^4.6.1",
157
157
  "@google/generative-ai": "^0.24.1",
158
158
  "@huggingface/transformers": "^4.2.0",
159
+ "@img/sharp-wasm32": "0.35.3",
159
160
  "@modelcontextprotocol/sdk": "^1.29.0",
160
161
  "@mozilla/readability": "^0.6.0",
161
162
  "@napi-rs/canvas": "^1.0.8",
@@ -132,6 +132,15 @@ export function testIsolationEnv(scratchDir) {
132
132
  export const DEFAULT_TEST_TIMEOUT_MS = 120_000;
133
133
  export const LONG_TEST_TIMEOUT_MS = 600_000;
134
134
 
135
+ /** Per-file timeout default for explicitly named files: a `.slow`/`.live`/
136
+ * `.electron` test file keeps its lane's long bound (scripts/test.mjs laneOf)
137
+ * even when run outside the lane runner. */
138
+ export function explicitFilesTimeoutMs(fileArgs) {
139
+ return fileArgs.some((arg) => /\.(slow|live|electron)\.test\.mjs$/.test(String(arg)))
140
+ ? LONG_TEST_TIMEOUT_MS
141
+ : DEFAULT_TEST_TIMEOUT_MS;
142
+ }
143
+
135
144
  // A batch that has not exited by then is killed with its process tree and
136
145
  // fails the run; MIXDOG_TEST_BATCH_TIMEOUT_MS overrides the default.
137
146
  const DEFAULT_BATCH_TIMEOUT_MS = 60 * 60 * 1000;
@@ -190,6 +190,9 @@ async function prunePdfRuntime(nodeModules) {
190
190
  }
191
191
 
192
192
  async function pruneSharpWasmFallback(nodeModules, target) {
193
+ // The Linux daemon runs on Electron, whose system GLib breaks the native
194
+ // addon; src/runtime/shared/sharp-electron-linux.mjs routes it to wasm.
195
+ if (target.platform === 'linux') return false;
193
196
  const imgRoot = join(nodeModules, '@img');
194
197
  let packages;
195
198
  try {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // Explicit Node test options and file paths, without discovery or lane filters.
3
- import { runNodeTests } from './lib/run-node-tests.mjs';
3
+ import { explicitFilesTimeoutMs, runNodeTests } from './lib/run-node-tests.mjs';
4
4
 
5
5
  const argv = process.argv.slice(2);
6
6
  // The same defaults as scripts/test.mjs: `mock.module` is still flag-gated on
@@ -17,5 +17,7 @@ await runNodeTests(
17
17
  '--test',
18
18
  ...unlessGiven('--test-force-exit'),
19
19
  ],
20
- argv
20
+ argv,
21
+ // A named slow-lane file keeps the slow lane's per-file bound.
22
+ { testTimeoutMs: explicitFilesTimeoutMs(argv) }
21
23
  );
@@ -285,9 +285,11 @@
285
285
  "07802a61d913c3fb7c431774e7f4ebb7",
286
286
  "0a34c5b6011578bebdb6cca63edfcec4",
287
287
  "0ddf9f9845e1fcfc76d81592d6a71e70",
288
+ "0e044c22eb0786162ebb33a30f3bd5ae",
288
289
  "44171df8144101dc74bf21f72cb5b7c0",
289
290
  "48247c1645fd94aad7711082d4512c49",
290
291
  "4f94016363acccd788a724a2d414744e",
292
+ "56e474f78faafae39aebe921ccff112d",
291
293
  "6358ad25dd07a2f92ad65c249a4f360b",
292
294
  "7fb12aeb07b79ae113c0deb0a90c6da7",
293
295
  "804afd71ebc3f68614a4dc419af4b98e",
@@ -319,11 +321,14 @@
319
321
  "0d5c8c6e2349addf71d2ed2b4c1ccb1f",
320
322
  "0d6926aaca2890da9347f15a826546e3",
321
323
  "0f14ba0a3d8b3896b717dc144bbe49a4",
324
+ "15d86146cfbd58d85adf0c25cf1d683f",
322
325
  "1c317db86e1ff80a5c4102e09e36f5fb",
323
326
  "242f11864abdef90fa0cc9cb4599a579",
327
+ "29a347c4d3a2f773fa92c627260301ba",
324
328
  "336ced846a9e4f774cbb109417856c3b",
325
329
  "3f72247651ad9d777b6754bfd46732aa",
326
330
  "50bdf35d06913236855080fdea6b50dc",
331
+ "5b4586a44104b26ae7dd45da101079bf",
327
332
  "6101786127a1e68778eafcd2bf2c9ce0",
328
333
  "6711dbc9d84023b8eabfa928b8d33d18",
329
334
  "6f9e9338f560fa9acd839a67b5e2d1cc",
@@ -339,6 +344,7 @@
339
344
  "e04e6abe9a54e7d07b37f8fc32b5ad30",
340
345
  "e38d606df69865a9cf1cc48386535e8b",
341
346
  "e5ac8ea16905815e36e88d883195a617",
347
+ "e9b89f9193bd9d9c80ba6cf4419e58ff",
342
348
  "feabe973080344c4d52787a96043ab68",
343
349
  "ff18ac1a9f5961925aec27ffb870bae0"
344
350
  ],
@@ -360,6 +366,10 @@
360
366
  "f209e75b6ea0360929516a713474ad71",
361
367
  "fe0512acbb2fc8f80c5961b9f44aa5e2"
362
368
  ],
369
+ "visualize": [
370
+ "aa3531bfc4fd6ec3820493d0c190cc75",
371
+ "f65924f0691284ad31000469a9855b62"
372
+ ],
363
373
  "xlsx": [
364
374
  "0deebbdd009b0a0941ca4b0833dbe7f6",
365
375
  "10778ab8e1e2f7929895c034fef9ac41",
@@ -23,9 +23,9 @@ The model designs; the runtime converts and measures. Write HTML/CSS for the act
23
23
  |---|---|---|
24
24
  | **New deck**, or a redesign the user wants rebuilt | one `author` call per deck: HTML slides in `script` by default (`references/html.md`), or a pptxgenjs script (§2-§4) when the kit's devices are wanted or no local browser exists; a new deck is never assembled from `batch` operations | `author` returns `audit.status: 'pass'`; `render` on that session returns the pages and a `reviewToken` |
25
25
  | **Existing deck** — template fill, partial rewrite, reorder, merging decks | `open` → `snapshot` → `batch` slide and shape operations (§6); a new page is a duplicated source page, never a runtime-composed one | every `batch` returns its own `audit` for the edited slides |
26
- | **Read or extract** — outline, text, or figures from a deck, or the material a deck is built from | `open` + a paged `snapshot` (`pages:[…]` or `cursor:`), or `node "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file>` for blocks with citable locators | blocks prefixed `[slide 4]`, `[p3]`, `[Sheet1!B4]`, `[line 42]` |
26
+ | **Read or extract** — outline, text, or figures from a deck, or the material a deck is built from | `open` + a paged `snapshot` (`pages:[…]` or `cursor:`), or `${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file>` for blocks with citable locators | blocks prefixed `[slide 4]`, `[p3]`, `[Sheet1!B4]`, `[line 42]` |
27
27
 
28
- Prerequisites: the Office capability (`metadata.requires`) — its portable backend needs no installed PowerPoint, and Office on Windows is used in the background when present; fonts that render reliably for the recipient; a signed-in `media` lane only for generated pictures; an explicit `--provider` and `--model` for the reviewer and page-QC scripts, which reuse the existing sign-in and never ask for credentials.
28
+ Prerequisites: the Office capability (`metadata.requires`) — its portable backend needs no installed PowerPoint, and Office on Windows is used in the background when present; fonts that render reliably for the recipient; a signed-in `media` lane only for generated pictures; an explicit `--provider` and `--model` for the reviewer and page-QC scripts, which reuse the existing sign-in and never ask for credentials. Run bundled scripts with `${MIXDOG_SKILL_NODE}` (on PATH in any shell), never plain `node`.
29
29
 
30
30
  ## 1. Load routing
31
31
  | File | Owns | Read when |
@@ -59,10 +59,10 @@ Prerequisites: the Office capability (`metadata.requires`) — its portable back
59
59
  **Bounded refinement**: fix factual and material visual defects before taste edits. Keep each pass focused on the highest-impact changes. After two unsuccessful corrections of the same defect, preserve the last valid artifact and report the limitation rather than cycling for a higher score. This limit is not permission to call an inadequate design complete. If an asset fails, repair or replace it; if it is removed, recompose the space it owned.
60
60
  8. **Page QC (new decks; skip for a one-page edit)**: after the measured audit, `qa render:false`, and the first render, check overflow, clipping, collision, canvas edge, contrast, and distortion; never redesign, reword, add, or delete. In Solo, Lead reviews directly. Only with workflow-approved delegation, use the runner below: each fresh fixer sees one page's image, inventory, and measured defects, uses only office, and edits a working copy. The runner adopts it only if defects did not grow and no other page changed. For this delegated route, `close` the session before running:
61
61
  ```text
62
- node "${MIXDOG_SKILL_DIR}/scripts/qc-pages.mjs" <deck.pptx> --provider <provider> --model <model> --output qc-report.json [--pages 1-12] [--no-vision]
62
+ ${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/qc-pages.mjs" <deck.pptx> --provider <provider> --model <model> --output qc-report.json [--pages 1-12] [--no-vision]
63
63
  ```
64
64
  Provider and model are explicit, as for the reviewer; `--no-vision` runs the geometry read only (a text-only model, or no renderer); at most 20 pages per run. Read the report (`pages[].reason`: improved, polished as unchanged, clean, scope, regression, audit_failed, execution_failed). A page whose run never replied is not a page that passed: `execution_failed` counts into `failed`, turns `ok` false, and exits the command, so rerun those pages before delivery rather than reading the report as clean. Then `open` the deck again and `render` it: the QC edits invalidate the earlier `reviewToken`, and a reopened session no longer carries the brief, which is why the brief read (`qa render:false`) comes before this step.
65
- 9. Reader and art director pass — read the contact sheet for sequence and full-size pages for detail. For substantial new work, use the source questions in `references/review.md`; its separate reviewer procedure (`node "${MIXDOG_SKILL_DIR}/scripts/review-deck.mjs" packet.json --provider <provider> --model <model> --output review.json`) requires workflow-approved delegation. Otherwise, explicitly label the pass self-review. Check the reader's answers against the original source key, then judge message visibility, focal hierarchy, and coherent variation before consulting `deck.rhythm`.
65
+ 9. Reader and art director pass — read the contact sheet for sequence and full-size pages for detail. For substantial new work, use the source questions in `references/review.md`; its separate reviewer procedure (`${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/review-deck.mjs" packet.json --provider <provider> --model <model> --output review.json`) requires workflow-approved delegation. Otherwise, explicitly label the pass self-review. Check the reader's answers against the original source key, then judge message visibility, focal hierarchy, and coherent variation before consulting `deck.rhythm`.
66
66
  **Output**: a slide-specific keep/fix decision with the visible reason. Resolve phrase-breaking wraps, weak evidence, and accidental empty regions; do not move a title merely to vary the sequence or change a successful page to reach a quota. Select at most two high-impact design revisions per pass; zero is valid.
67
67
  **Default — reuse the review**: small text, shape or data edits use `batch`, not re-author; every `batch` returns its own `audit` for the edited slides, read before the next edit. Portable renders report `changedPages` and `reusedPages` for up to 12 requested pages: inspect changed pages and carry forward the unchanged pages' critique. Shared resources invalidate the cache conservatively; PDF export remains whole-document. COM and long-deck contact sheets refresh normally. Always use the new complete render token, never the previous approval.
68
68
  10. `office action:'finalize' session:<id> design:{ reviewed:true, reviewToken, critique:[...] }` — reuses a complete current preview, checks the document, saves, validates, and closes. Use the token from the final complete render; after detail-page inspection, restore a complete render before finalizing. An edit invalidates the previous approval. `fixes` lists work still owed; applied fixes belong in `note`. A render/export failure leaves the deliverable unfinished: preserve the session and artifacts, report the failure, and never substitute a manual save for successful finalize. Finalize an authored deck in its authoring session: a deck reopened in `mode:'background'` is re-saved by PowerPoint, which rewrites the theme, layout, and embedded-workbook parts, and the validation baseline then reports `changed_protected_part` / `lost_protected_part` against the file it opened. Done when finalize reports the saved, validated file and the session is closed.
@@ -84,7 +84,7 @@ Prerequisites: the Office capability (`metadata.requires`) — its portable back
84
84
  ```
85
85
  **Hard rule — the plan is the page's contract**: every slide's plan line names its job, relationship, move, composition move, carriers, texture, and rhythm before any geometry exists, so the design is decided before it is drawn. **The runtime gates on it** from two slides up: `author` refuses a deck whose brief has no `slide plan:` line (`plan_missing`), whose plan leaves a slide unwritten (`plan_slide_unplanned`), whose line names no job or carriers (`plan_incomplete`), or whose page does not carry what its own line named (`plan_promise_missing`) — `reason: plan_gate` with the slides listed, the previous deck and its session untouched, and the answer is the plan line or the page, not a retry. A single-slide specimen is not gated, and a stale slide count stays information (`plan_count_mismatch`). A thin request gets a defensible brief invented from the subject, never blank fields. The `facts:`, `directions:`, and `slide plan:` lines may wrap across comment lines; each continuation line is read as more ` · ` items — so ` · ` is the separator and never appears inside a value or a source (write "관측치와 측정", not "관측치·측정"; a fact cut at an inner ` · ` silently disappears and every figure it carried becomes `number_without_fact`). → runtime `plan_gate` at author (`plan_missing`, `plan_slide_unplanned`, `plan_incomplete`, `plan_promise_missing`); `plan_count_mismatch` in qa
86
86
  **Hard rule — every figure has a fact**: `facts:` lists each number the deck will show, with its source (a page, a cell, a URL, or "user brief"). Dates and slide numbers are exempt. A chart series is one fact listing its values in order (`F3 운영비 1Q–6Q 10.5 10.8 9.1 7.9 7.0 6.5 — 재무팀 시트 B4:G4`); the values in the script's `chart()` call are copied from that line. With source material, the fact sheet is written first; without it, the facts come from the request and say so. **The runtime gates on it**: `author` reads the staged deck and refuses to land one that shows a figure no fact covers (`reason: facts_gate`, the figures listed per slide) — the previous deck and its session stay untouched, and the answer is the facts line, not a retry. A sketch or template with no source at all declares `facts: sample — <why>`: every figure is illustrative, the deck lands with `factsMode: 'sample'`, and the delivery tells the user the numbers are examples. → runtime `facts_gate` at author; `number_without_fact`, `facts_missing`, `facts_illustrative` in qa
87
- **Hard rule — supplied material is cited**: when the deck is built from files or pages the user gave, `sources:` names them and every fact's source points where a reader can open it — a page (`p.12`), a cell (`Sheet1!B4`), a section (`§3`), or a URL. `node "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file>` prints the material as blocks already prefixed with those locators, which is what the fact sheet quotes. A figure that came from somewhere else (a conversation, a live system) says so in its own source. → runtime `fact_without_locator` (advisory)
87
+ **Hard rule — supplied material is cited**: when the deck is built from files or pages the user gave, `sources:` names them and every fact's source points where a reader can open it — a page (`p.12`), a cell (`Sheet1!B4`), a section (`§3`), or a URL. `${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file>` prints the material as blocks already prefixed with those locators, which is what the fact sheet quotes. A figure that came from somewhere else (a conversation, a live system) says so in its own source. → runtime `fact_without_locator` (advisory)
88
88
 
89
89
  ## 4. Script contract and library boundaries
90
90
  - The kit prelude creates `pres` (`pptxgenjs`, `LAYOUT_WIDE` 13.33 × 7.5 in, coordinates in inches) and every helper; a script that declares its own `pres` runs without the prelude. Available modules: `pptxgenjs`, `sharp`, `node:fs`, `node:path`, `node:buffer`; no network and no photo library. Icons come from the injected `ICON` (256 offline Lucide stroke icons; `ICON.names` lists them, the kit's `icon()` / `iconRow()` place them) — a feature marker, a list prefix, or a stage glyph is an icon by name, never a Unicode emoji or a hand-drawn shape.
@@ -113,7 +113,7 @@ The runtime absorbs what it can (one `a:pPr` per paragraph; package validation a
113
113
  | A secondary-axis combo needs `valAxes` and `catAxes` with two entries each | PowerPoint drops the chart → runtime `chart_axis_undeclared` |
114
114
 
115
115
  ## 5. QA and finalize
116
- **Content before pixels**: read the deck's text once against the fact sheet — `node "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <deck.pptx>` on the saved file, or the snapshot's `text` — for missing material, typos, and order; a wrong order or a dropped fact is cheaper to catch in text than on a contact sheet. → manual
116
+ **Content before pixels**: read the deck's text once against the fact sheet — `${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <deck.pptx>` on the saved file, or the snapshot's `text` — for missing material, typos, and order; a wrong order or a dropped fact is cheaper to catch in text than on a contact sheet. → manual
117
117
  Then inspect every rendered slide in this order. Read actual phrase endings, compare peer baselines and gaps, trace each connector to its intended boundary, and check that labels belong to the right object. Record a visible keep/fix reason rather than inferring a pass from a clean QA report. Hard hits need correction; the runtime's actual severity and source determine what blocks finalize. "Manual" means only the rendered image shows it.
118
118
 
119
119
  **Preview fidelity**: the portable preview is LibreOffice, and it spaces Hangul and CJK *chart category labels* by character — `1분기` is drawn as `1 분기` while the chart part holds the unspaced string, and PowerPoint draws it unspaced. Check the string (`source-extract.mjs` or the chart's `c:v` values) before treating it as a defect; slide text is unaffected.
@@ -52,12 +52,14 @@ policy. Provider and model must be explicit; it uses the existing sign-in, never
52
52
  asks to paste credentials. This is context separation, not an OS filesystem
53
53
  sandbox or proof that the model's judgement is unbiased.
54
54
 
55
- Run from the Project; `<pptx-skill-directory>` is the `<base-dir>` the runtime
56
- printed when the skill loaded (`SKILL.md` §2 step 9 carries the command with
57
- that directory already resolved):
55
+ Run it from the Project with the command `SKILL.md` §2 step 9 carries, which
56
+ the runtime resolved when the skill loaded. It starts with the launcher command
57
+ named there (on the shell tool's PATH), not plain `node`, which cannot load the
58
+ script in every installation. Its shape, with `<pptx-skill-directory>` the
59
+ `<base-dir>` the runtime printed:
58
60
 
59
61
  ```text
60
- node "<pptx-skill-directory>/scripts/review-deck.mjs" packet.json --provider <provider> --model <model> --output review.json
62
+ <launcher command from SKILL.md> "<pptx-skill-directory>/scripts/review-deck.mjs" packet.json --provider <provider> --model <model> --output review.json
61
63
  ```
62
64
 
63
65
  Packet format (all paths relative to the packet file unless absolute):
@@ -6,7 +6,7 @@
6
6
  // portable session that is closed without saving; anything else is read as
7
7
  // UTF-8 text. Output is bounded by --chars (default 4000) and every block is
8
8
  // cut at BLOCK_CHARS, so a large source never floods the context.
9
- // node "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file> [--chars 4000]
9
+ // ${MIXDOG_SKILL_NODE} "${MIXDOG_SKILL_DIR}/scripts/source-extract.mjs" <file> [--chars 4000]
10
10
  import { access, readFile } from 'node:fs/promises';
11
11
  import { extname, resolve } from 'node:path';
12
12
  import { pathToFileURL } from 'node:url';
@@ -6,7 +6,7 @@ Read this when choosing a `setup` mutation.
6
6
 
7
7
  - `status` reads one domain: summary, model, agents, workflow, websearch,
8
8
  output-style, profile, autoclear, compaction, memory, features, local-provider, shell,
9
- providers, mcp, skills, plugins, update, onboarding, capabilities, developer,
9
+ providers, mcp, skills, plugins, update, onboarding, worktree, capabilities, developer,
10
10
  desktop, appearance, projects, connection, schedules, webhooks, hooks, or
11
11
  media.
12
12
  - `open` navigates to a supported UI surface. Read `surfaces.md` for targets and
@@ -42,6 +42,7 @@ Read this when choosing a `setup` mutation.
42
42
  | Permanently delete confirmed, unchanged, unused model files | `delete_local_model` |
43
43
  | TUI system shell | `set_system_shell` |
44
44
  | Automatic updates | `set_auto_update` |
45
+ | Worktree defaults: new tasks on the current branch or a new worktree, branch prefix, large-repository warning size, automatic cleanup | `set_worktree_settings` |
45
46
  | Remove stored provider authentication (one OAuth account at a time) | `forget_provider_auth` |
46
47
  | Select, rename, reorder, or auto-switch OAuth accounts, or allow paid credits | `set_provider_account` |
47
48
  | Developer options such as risk-gated OAuth providers | `set_developer_option` |
@@ -56,7 +57,7 @@ Read this when choosing a `setup` mutation.
56
57
  | Refresh a plugin checkout | `update_plugin` |
57
58
  | Enable or disable a plugin | `set_plugin_enabled` |
58
59
  | Remove a plugin | `remove_plugin` |
59
- | Install or reconfigure the MCP server a plugin ships | `enable_plugin_mcp` |
60
+ | Turn back on and reconnect every MCP server a plugin declares | `enable_plugin_mcp` |
60
61
  | Available hosted models and their options; optionally one provider, native-search capable only, or a refreshed catalog | `list_models` |
61
62
  | Agent orchestration, independent of workflow instructions | `set_orchestration_mode` |
62
63
  | Safe MCP edit metadata, excluding raw connection/credential values | `get_mcp_server` |
@@ -85,7 +86,9 @@ Read this when choosing a `setup` mutation.
85
86
  Inspect `status model`, `status agents`, `status websearch`, or `status
86
87
  workflow` before changing the corresponding domain.
87
88
 
88
- - Main and agent routes also accept `modelParameters` and `contextPercent`; agent routes accept `disabled`.
89
+ - Main and agent routes also accept `modelParameters`, `contextPercent`, and
90
+ `contextTokens` (an exact window in tokens that overrides `contextPercent`);
91
+ agent routes accept `disabled`.
89
92
  Use the model catalog for actual available options, not remembered model ids.
90
93
  - A Web Search route must support native web search; tool exposure is changed
91
94
  separately.
@@ -201,8 +204,18 @@ markers are read with `status desktop`.
201
204
  - Environment/header maps are partial patches. Omitted keys are preserved;
202
205
  `null` explicitly removes one key, including a stored credential.
203
206
  - Plugin enablement moves its contributed skills and MCP integrations together.
204
- - `enable_plugin_mcp` writes the MCP server a plugin ships and reconnects; it
205
- fails for a plugin without an MCP script.
207
+ - A registered plugin's MCP servers (its `.mcp.json` and manifest
208
+ `mcpServers`) appear automatically with `source: "plugin"` and `plugin` /
209
+ `pluginServer` in `status mcp`; nothing is copied into the MCP list. A plugin
210
+ server runs only while both the plugin and the server are enabled;
211
+ `set_mcp_enabled` toggles the server, `set_plugin_enabled` the plugin, and
212
+ `set_extension_scope` limits it (the plugin's scope still applies).
213
+ `add_mcp_server`, `save_mcp_server`, and `remove_mcp_server` refuse plugin
214
+ servers. Declaration problems and naming conflicts are reported as
215
+ `declarationErrors` and `warnings`.
216
+ - `enable_plugin_mcp` turns every server the plugin declares back on and
217
+ reconnects them; a disabled plugin stays disabled, and it fails for a plugin
218
+ that declares no MCP servers.
206
219
 
207
220
  ## Desktop, Projects, and automation
208
221
 
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: visualize
3
+ description: Show mockups, design options, diagrams, and finished artifacts in the side panel beside the chat.
4
+ when_to_use: 'Mockups, previews, design options, diagrams, or showing any finished artifact; not code alone.'
5
+ metadata:
6
+ requires: visualize
7
+ dependencies:
8
+ tools:
9
+ - type: tool
10
+ value: visualize
11
+ ---
12
+
13
+ # Visualize (visualize tool)
14
+
15
+ The side panel is where the user sees the work instead of reading about it.
16
+ This file owns when to draw, how a mockup is built and iterated, and how results
17
+ are shown. The schema owns action fields. `references/craft.md` owns the design
18
+ bar every mockup is held to; read it before the first mockup of a session.
19
+
20
+ ## 1. Which job
21
+ **Hard rule — seeing beats reading, or it is not this skill**: draw when the
22
+ answer is a layout, a state, a flow, a spatial relation, or a look. Scope,
23
+ tradeoffs, and wording decisions stay in chat even when the topic is UI.
24
+ - *Show* — any artifact you produced or changed (HTML, deck, document, sheet,
25
+ PDF, image, video, a local dev page): `open` it once when it is ready. Edits
26
+ reload the tab by themselves; never reopen to refresh.
27
+ - *Mockup* — a UI change before implementation, or the user asks for a
28
+ 시안/mockup/preview. §2.
29
+ - *Options* — the direction is genuinely open (the user is unsure, or two
30
+ readings of the request lead to different layouts). §3.
31
+ - *Explain* — a flow, state machine, architecture, or data path the user needs
32
+ to grasp: one HTML diagram page, no option machinery.
33
+ **Hard rule — not this tool**: authoring Office files, images, or video belongs
34
+ to their own skills; this skill only shows their output. Clicking, typing, and
35
+ testing a page belong to `browser`.
36
+
37
+ ## 2. Mockup loop
38
+ 1. **Ground in the real product.** Read the files that define the touched
39
+ surface — tokens, theme, the component and its neighbours — before drawing.
40
+ For an existing app screen, prefer the real screen (a capture of the running
41
+ app) with only the changed parts drawn over it; invented chrome hides what
42
+ actually changes. Done when you can name the exact component and values the
43
+ change touches.
44
+ 2. **Split the change into states.** Every state the user will meet gets its
45
+ own labelled frame: A default, B the interaction, C the result, D failure or
46
+ empty where they exist. One frame per state, captioned with what changed and
47
+ why in one sentence.
48
+ 3. **Write** `design/mockups/<topic>/index.html` (self-contained: inline CSS
49
+ and JS, no network). Sample data is realistic and marked as sample once in
50
+ the lead line; never fake metrics or filler sections.
51
+ 4. **Show**: `open` the page, then `annotate` each changed element with a short
52
+ label. Marks live on the panel, not in the file.
53
+ 5. **Look before you report.** Run `visualize check` on the tab and fix every
54
+ reported page problem (uncaught errors, CSP violations, console errors,
55
+ missing assets, blocked network requests: the page must be self-contained)
56
+ in the file, then `check` again until it reports none; a
57
+ "Page problems" section on any `open`, `annotate`, or `capture` result counts
58
+ the same. Then run `visualize inspect` on the tab: once at the panel's
59
+ width and, when the design is responsive, again with `viewport`
60
+ `{width: 375, height: 812}`; fix every finding it lists (overflow, clipped
61
+ text, tiny or overlapping targets, low contrast, missing alt or labels) in
62
+ the file before reporting. Then `capture` the tab (or read it through
63
+ `browser`) and check it against `references/craft.md` §5; fix what fails
64
+ before the user sees the report.
65
+ 6. **Report** in chat: path, the states shown, what to confirm, and the open
66
+ questions. Then stop — implementation waits for approval.
67
+ 7. **Iterate in place.** Feedback edits the same file; the tab reloads and the
68
+ panel keeps each saved state as a version (v1…vN) the user can step back
69
+ to, compare side by side, or restore, so never copy the file to keep an
70
+ old version. The user can also point at the page: their message then carries a
71
+ `<visualize_feedback>` block of numbered pins (`pin N` = the pin numbered
72
+ N they saw), each with its label, note, tab, project-relative file and
73
+ `kind` (pane kind + element or region). An HTML element pin adds its
74
+ selector, `inside` path, trimmed HTML, key styles and box; a region pin
75
+ (an HTML drag, a document, PDF, image, diagram, or video frame) adds its
76
+ area, plus `elements` for an HTML drag and `time` for a video. The crop
77
+ image "visualize pin N" comes when there is one (`crop: none` otherwise).
78
+ Answer pin by pin by number and act on what the selector or area names;
79
+ secret values arrive as `[redacted]`, so never restore them from the crop
80
+ or guess them.
81
+ 8. **After approval**: implement from the approved mockup; its values are the
82
+ spec. When the work needs a record, `export` the approved tab to PNG or PDF
83
+ beside the page (`export` with `format` and a project-relative `output`,
84
+ e.g. `design/mockups/login/login-approved.png`; `version` for a kept
85
+ version). A single HTML page renders whole in a hidden window, so the tab need
86
+ not be on screen; the result lists the written path, size, and any page
87
+ problems. Remove any temporary data or records you created to stage
88
+ the mockup, and say so.
89
+
90
+ ## 3. Options
91
+ **Default — one strong mockup.** Options only when the direction is open.
92
+ **Hard rule — options differ in stance, not in pixels**: pick one axis that
93
+ matters for this decision (density, layout model, emphasis, interaction model)
94
+ and pull the 2–3 options apart on it. Two options that differ by accent colour
95
+ or radius are one option.
96
+ - Name each by its stance ("1 · one menu", "2 · inline chips") and give its
97
+ cost in one line.
98
+ - `open` 2–3 targets in one call to show them side by side.
99
+ - Make the options pickable: put `data-choice="<id>"` on each option's root
100
+ (and `data-choice-group="<decision>"` when one page asks more than one
101
+ question; ungrouped choices form one group). A click selects one per group
102
+ and adds `data-choice-selected` to it; the panel's default outline uses
103
+ `:where()`, so style `[data-choice][data-choice-selected]` to match the
104
+ mockup. `data-choice-label` names it when its text does not. Picks reach
105
+ you with the user's next message under `choices:` in the
106
+ `<visualize_feedback>` block as tab, file, group, choice id and label.
107
+ - When the user picks, consolidate into one mockup and close the others; a
108
+ pile of options is not a result.
109
+
110
+ ## 4. Showing results
111
+ - Open a result once, when it is ready to look at, not at every intermediate
112
+ write. Long multi-step work shows the first reviewable state, then lets
113
+ reloads carry the rest.
114
+ - Decks and documents: the panel shows the converted pages; still run the
115
+ owning skill's own render review — the panel is for the user, not your QC.
116
+ - Close tabs that no longer match the conversation (a resolved choice, a
117
+ replaced draft) so the user is never looking at stale work.
118
+ - A web URL is opened alone, never mixed with files; marking, capturing, or
119
+ closing a web page belongs to `browser`.
120
+ - `annotate` and `capture` need the tab on screen (`export` of an HTML page does not). When they report the panel
121
+ is hidden, tell the user to open it rather than retrying.
122
+ - When `visualize` is unavailable, give the file path; never start your own
123
+ server or pretend it was shown.
124
+
125
+ ### Inline content or a file
126
+ - **Inline** (`open` with `input.content` — `mermaid`, `svg`, `chart` (an
127
+ ECharts option as JSON), `html`, `markdown`): diagrams, charts, quick
128
+ sketches and notes you will not edit again. No file is written. `mermaid`,
129
+ `svg` and `markdown` are static, sanitized output (no scripts). `chart` is
130
+ interactive (tooltips, zoom) and `html` runs its scripts, as in-memory pages
131
+ held to the same rules as an HTML file: outside network is blocked, so an
132
+ `html` sketch must be self-contained, and its page problems come back in the
133
+ result. Re-opening with the same `title` adds a version.
134
+ - **File** (`targets`): a real mockup that needs iteration, scripts, assets,
135
+ versioning on disk, annotate/Comment feedback, or a deliverable the user keeps.
136
+ - A render error comes back as a page problem (Mermaid parse error, bad chart
137
+ JSON): fix the source and open again; never report it as shown.
138
+
139
+ ### Tweaks
140
+ Offer tweaks when the open decision is a value, not a layout: colour, density,
141
+ spacing, type scale, radius. The page declares them in
142
+ `<script type="application/json" id="mx-tweaks">` (HTML files and inline
143
+ `html`/`chart`): `[{"id":"accent","label":"Accent","type":"color","var":"--accent","default":"#3b82f6"}]`.
144
+ Types: `color` (hex/rgb), `range` (`min`,`max`,`step`,`unit`),
145
+ `select` (`options`), `toggle`; each sets a `--css-var` or a
146
+ `data-*` attribute on the root, which your CSS reads. Keep it to 6 or fewer
147
+ meaningful controls (16 is the hard cap) and give every one a real default.
148
+ The panel adds a Tweaks button; when the user sends their values you get them
149
+ under `tweaks:` in `<visualize_feedback>` (`accent (--accent): #2f6fed (was
150
+ #3b82f6)`): bake them into the file as the new defaults — both the CSS value
151
+ and the control's `default`. A malformed block is a `tweaks: <reason>` page
152
+ problem.
153
+
154
+ ## 5. Reporting
155
+ Short: what is on screen, the path, the decision you need. Do not narrate the
156
+ HTML. Uncertain or unverified rendering is stated, not glossed.
157
+ The panel and the chat card already show the content: never repeat its source
158
+ (Mermaid text, chart JSON, SVG, HTML) or re-render its data as a chat table or
159
+ text chart. Name the tab and give one or two lines on what it shows or what to
160
+ look at.
@@ -0,0 +1,88 @@
1
+ # Craft bar for mockups and visual pages
2
+
3
+ The bar is "a designer on this product drew it", not "a page was generated".
4
+ Most generated-looking design is wrong composition, not wrong colour; fix the
5
+ cause in the order below.
6
+
7
+ ## 1. Source before taste
8
+ - An existing product wins over every rule here. Lift its real tokens,
9
+ spacing, radii, type, copy tone, and density from source files; do not
10
+ approximate from memory or a screenshot when the code is readable.
11
+ - A new surface with no system: define a small one first (4–6 named colours,
12
+ one or two type families with roles, a spacing step, one radius scale) and
13
+ write it as CSS variables at the top of the page.
14
+ - A brief's explicit direction wins, including when it asks for a look this
15
+ file warns against.
16
+
17
+ ## 2. Name the surface, then compose
18
+ Before any colour or component, decide in one line what the user does here;
19
+ the composition follows from it:
20
+
21
+ | Surface | User is… | Composition carries |
22
+ |---|---|---|
23
+ | Watch | following changing state | density, glanceable hierarchy, no marketing framing |
24
+ | Act | working through items | selection, row actions, clear current item |
25
+ | Compare | weighing options | aligned columns, equal structure, one differentiator |
26
+ | Set up | configuring | grouped fields, save/validation states, little decoration |
27
+ | Persuade / teach | being convinced or taught | one idea per section; the only place a hero belongs |
28
+ | Browse | exploring a space | filters, results, peek/zoom |
29
+ | Drive / inspect | commanding or drilling into one object | keyboard paths, focus, detail panes |
30
+
31
+ A screen spanning two picks a primary one; never average them.
32
+
33
+ ## 3. Hierarchy with type and space first
34
+ - Scale, weight, and spacing carry hierarchy before boxes, borders, icons, or
35
+ colour. Add a container only when it groups something the user acts on.
36
+ - Line length under ~80 characters; numbers in tables tabular and aligned.
37
+ - Structural marks (numbers, dividers, labels) only when they encode real
38
+ information — numbered steps only for a real sequence.
39
+ - One memorable element per page; everything around it stays quiet.
40
+
41
+ ## 4. Words are interface
42
+ - Name things by what the user understands, not how the system is built.
43
+ - Buttons say what happens ("Save changes"); the same action keeps the same
44
+ name through the flow ("Publish" → "Published").
45
+ - Errors say what happened and what to do, without apology. Empty states
46
+ invite the next action.
47
+ - Sentence case, plain verbs, no filler or invented claims. Draft copy is
48
+ marked as draft.
49
+
50
+ ## 5. Self-review before showing
51
+ Look at the capture, list which of these fire, then repair by cause:
52
+
53
+ Composition (re-layout; recolouring will not fix these):
54
+ 1. Wrong surface — e.g. a hero on a dashboard.
55
+ 2. Everything centred because no layout was chosen.
56
+ 3. Equal-weight tile grids (icon + heading + sentence ×3) where one thing
57
+ should lead.
58
+
59
+ Decoration (remove; replace with scale, weight, or spacing):
60
+ 4. Coloured side rails on cards.
61
+ 5. Blur or glass with no elevation system behind it.
62
+ 6. Oversized stat numbers filling space meant for content.
63
+ 7. A rounded icon above every heading; icons that do not aid scanning.
64
+ 8. Identical cards, one radius and one soft shadow on everything.
65
+
66
+ Defaults (recolour / re-typeset only if the brief left them free):
67
+ 9. Indigo/violet accent or glossy gradient chosen by habit.
68
+ 10. Default font used without a reason; ALL-CAPS eyebrow labels over every
69
+ heading; one word accented in a headline; "→" on every link.
70
+
71
+ Re-check after repairing. Do not show while 1–3 still fire.
72
+
73
+ ## 6. Quality floor (always, without announcing it)
74
+ `visualize inspect` reports most floor failures (overflow, clipped text,
75
+ small or overlapping targets, low contrast, missing alt or labels); a page is
76
+ not shown while it lists any.
77
+ - Visible keyboard focus, real hover and disabled states where shown.
78
+ - Readable contrast for text and controls; hit targets ≥ 44px on touch frames.
79
+ - Motion only when it shows what changed; respect `prefers-reduced-motion`.
80
+ - Fits the panel width without horizontal scroll; frames wider than the panel
81
+ scale down rather than clip.
82
+ - Self-contained: no CDN, web font, API or other network request. The panel
83
+ blocks outside network unless the user allows it (a blocked request is a
84
+ `blocked-network` page problem), so inline or bundle every asset in the
85
+ project. No fake data passed off as real, or stock imagery.
86
+ - A value the user may want to tune (accent, density, spacing) is a CSS variable
87
+ on the root plus a control in `<script type="application/json" id="mx-tweaks">
88
+ [{"id":"accent","type":"color","var":"--accent","default":"#3b82f6"}]`.