@ouro.bot/cli 0.1.0-alpha.1469 → 0.1.0-alpha.1470

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 (567) hide show
  1. package/README.md +1 -1
  2. package/changelog.json +6 -2
  3. package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
  4. package/deploy/unraid/sanctuary.xml +1 -1
  5. package/desk.lock.json +8 -0
  6. package/dist/heart/identity.js +27 -1
  7. package/dist/mind/desk-section.js +33 -43
  8. package/dist/repertoire/desk-mcp.js +140 -0
  9. package/dist/repertoire/mcp-manager.js +22 -0
  10. package/dist/repertoire/mcp-tools.js +11 -7
  11. package/npm-shrinkwrap.json +2 -2
  12. package/package.json +4 -1
  13. package/vendor/desk/.claude-plugin/plugin.json +35 -0
  14. package/vendor/desk/.mcp.claude-codex.json +28 -0
  15. package/vendor/desk/.mcp.copilot.json +16 -0
  16. package/vendor/desk/.ouro-desk.json +6 -0
  17. package/vendor/desk/CHANGELOG.md +7004 -0
  18. package/vendor/desk/README.md +195 -0
  19. package/vendor/desk/activation/README.md +98 -0
  20. package/vendor/desk/activation/copilot-root.flattened-bundle.json +38 -0
  21. package/vendor/desk/activation/desk.activation.json +251 -0
  22. package/vendor/desk/activation/host-capability-evidence.md +46 -0
  23. package/vendor/desk/activation/support-matrix.json +84 -0
  24. package/vendor/desk/agency.json +20 -0
  25. package/vendor/desk/agents/observer.agent.md +26 -0
  26. package/vendor/desk/agents/observer.md +29 -0
  27. package/vendor/desk/agents/worker.agent.md +32 -0
  28. package/vendor/desk/agents/worker.md +40 -0
  29. package/vendor/desk/artifacts/tombstones/tombstone.schema.json +53 -0
  30. package/vendor/desk/artifacts/tombstones/tombstones.jsonl +1 -0
  31. package/vendor/desk/changelog.d/README.md +12 -0
  32. package/vendor/desk/docs/agent-files.md +104 -0
  33. package/vendor/desk/docs/agentic-engineering-v2-rfc.md +206 -0
  34. package/vendor/desk/docs/agentic-engineering-v3-rfc.md +109 -0
  35. package/vendor/desk/docs/browser-remote-desktops.md +69 -0
  36. package/vendor/desk/docs/dependency-activation-stories-and-criteria.md +500 -0
  37. package/vendor/desk/docs/evaluation-packet.md +363 -0
  38. package/vendor/desk/docs/factory-local-capture.md +651 -0
  39. package/vendor/desk/docs/factory-store-playbook.md +927 -0
  40. package/vendor/desk/docs/images/factory-site.png +0 -0
  41. package/vendor/desk/docs/issue-drains.md +79 -0
  42. package/vendor/desk/docs/lfs-inspection.md +55 -0
  43. package/vendor/desk/docs/preview-diagnostics.md +11 -0
  44. package/vendor/desk/docs/relays.md +88 -0
  45. package/vendor/desk/docs/schedules.md +69 -0
  46. package/vendor/desk/docs/search-recovery.md +22 -0
  47. package/vendor/desk/docs/session-labels.md +157 -0
  48. package/vendor/desk/docs/session-retention.md +125 -0
  49. package/vendor/desk/docs/sessions.md +17 -0
  50. package/vendor/desk/docs/stalled-nudges.md +54 -0
  51. package/vendor/desk/docs/webhooks.md +80 -0
  52. package/vendor/desk/docs/workspace-tidy.md +74 -0
  53. package/vendor/desk/hooks/boot-checks.cjs +7 -0
  54. package/vendor/desk/hooks/claude-session-start.cjs +123 -0
  55. package/vendor/desk/hooks/compatible-node.cjs +97 -0
  56. package/vendor/desk/hooks/copilot-boot-prompt.cjs +69 -0
  57. package/vendor/desk/hooks/copilot-durable-files.cjs +8 -0
  58. package/vendor/desk/hooks/copilot-hooks.json +61 -0
  59. package/vendor/desk/hooks/copilot-intake-context.cjs +5 -0
  60. package/vendor/desk/hooks/copilot-lane-model.cjs +8 -0
  61. package/vendor/desk/hooks/copilot-session-start.cjs +264 -0
  62. package/vendor/desk/hooks/copilot-skill-current.cjs +28 -0
  63. package/vendor/desk/hooks/factory-end.cjs +5 -0
  64. package/vendor/desk/hooks/factory-start.cjs +27 -0
  65. package/vendor/desk/hooks/hooks.json +40 -0
  66. package/vendor/desk/hooks/lib/boot-checks.cjs +643 -0
  67. package/vendor/desk/hooks/lib/child-agent.cjs +14 -0
  68. package/vendor/desk/hooks/lib/copilot-intake-context.cjs +73 -0
  69. package/vendor/desk/hooks/lib/current-release.cjs +162 -0
  70. package/vendor/desk/hooks/lib/delivery-stop.cjs +326 -0
  71. package/vendor/desk/hooks/lib/detach-worker.cjs +43 -0
  72. package/vendor/desk/hooks/lib/durable-files.cjs +102 -0
  73. package/vendor/desk/hooks/lib/factory-end.cjs +327 -0
  74. package/vendor/desk/hooks/lib/lane-model.cjs +82 -0
  75. package/vendor/desk/hooks/lib/node-required.cjs +56 -0
  76. package/vendor/desk/hooks/lib/orca-session-title.cjs +60 -0
  77. package/vendor/desk/hooks/lib/session-end.cjs +30 -0
  78. package/vendor/desk/hooks/lib/sync-end.cjs +89 -0
  79. package/vendor/desk/hooks/loop-start.cjs +105 -0
  80. package/vendor/desk/hooks/node-missing.sh +78 -0
  81. package/vendor/desk/hooks/orca-session-title.cjs +8 -0
  82. package/vendor/desk/hooks/session-end.cjs +8 -0
  83. package/vendor/desk/mcp/README.md +269 -0
  84. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  85. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  86. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  87. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  88. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  89. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/darwin-arm64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  90. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  91. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  92. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-127/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  93. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  94. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  95. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  96. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  97. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  98. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/linux-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  99. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/support-matrix.json +72 -0
  100. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  101. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  102. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-137/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  103. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.manifest.json +881 -0
  104. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.sha256 +1 -0
  105. package/vendor/desk/mcp/artifacts/runtime-deps/1.4.0-alpha.6/win32-x64-node-147/3b0cb8b1e7dd77a982b38375fe88a5278bd77974213e18be025d7dc8deea800f/runtime-deps.tgz +0 -0
  106. package/vendor/desk/mcp/artifacts/runtime-deps/README.md +25 -0
  107. package/vendor/desk/mcp/bootstrap.cjs +761 -0
  108. package/vendor/desk/mcp/docs/private-feedback.md +13 -0
  109. package/vendor/desk/mcp/idle-proxy.cjs +423 -0
  110. package/vendor/desk/mcp/index.js +813 -0
  111. package/vendor/desk/mcp/package-lock.json +3717 -0
  112. package/vendor/desk/mcp/package.json +44 -0
  113. package/vendor/desk/mcp/scripts/agency-desk-channel.js +7 -0
  114. package/vendor/desk/mcp/scripts/build-runtime-deps-pack.js +5 -0
  115. package/vendor/desk/mcp/scripts/crew.js +89 -0
  116. package/vendor/desk/mcp/scripts/drains-launcher.mjs +329 -0
  117. package/vendor/desk/mcp/scripts/drains.js +5 -0
  118. package/vendor/desk/mcp/scripts/factory.js +657 -0
  119. package/vendor/desk/mcp/scripts/file-desk-problem.js +9 -0
  120. package/vendor/desk/mcp/scripts/finish-commit.js +7 -0
  121. package/vendor/desk/mcp/scripts/lfs.js +37 -0
  122. package/vendor/desk/mcp/scripts/local-recovery.js +363 -0
  123. package/vendor/desk/mcp/scripts/migrations.js +11 -0
  124. package/vendor/desk/mcp/scripts/private-view.js +177 -0
  125. package/vendor/desk/mcp/scripts/resolve-desk-root.js +106 -0
  126. package/vendor/desk/mcp/scripts/session-boot.js +22 -0
  127. package/vendor/desk/mcp/scripts/session-retention.js +5 -0
  128. package/vendor/desk/mcp/scripts/session-sync.js +10 -0
  129. package/vendor/desk/mcp/scripts/sessions.js +5 -0
  130. package/vendor/desk/mcp/scripts/sync-push.js +13 -0
  131. package/vendor/desk/mcp/scripts/tidy-status.js +8 -0
  132. package/vendor/desk/mcp/scripts/verify-runtime-deps-pack.js +5 -0
  133. package/vendor/desk/mcp/src/actions/desk-read.actions.mts +73 -0
  134. package/vendor/desk/mcp/src/actions/desk-session.actions.mts +42 -0
  135. package/vendor/desk/mcp/src/actions/desk-web.actions.mts +52 -0
  136. package/vendor/desk/mcp/src/actions/desk.actions.mts +5 -0
  137. package/vendor/desk/mcp/src/actions/generated/desk/OuroActions.swift +649 -0
  138. package/vendor/desk/mcp/src/actions/generated/desk/OuroActionsReins.swift +61 -0
  139. package/vendor/desk/mcp/src/actions/generated/desk/actions.json +280 -0
  140. package/vendor/desk/mcp/src/actions/generated/desk/commands.json +145 -0
  141. package/vendor/desk/mcp/src/actions/generated/desk/mcp.json +256 -0
  142. package/vendor/desk/mcp/src/actions/generated/desk/web.ts +59 -0
  143. package/vendor/desk/mcp/src/actions/generated/desk/webmcp.json +250 -0
  144. package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActions.swift +241 -0
  145. package/vendor/desk/mcp/src/actions/generated/desk-web/OuroActionsReins.swift +25 -0
  146. package/vendor/desk/mcp/src/actions/generated/desk-web/actions.json +73 -0
  147. package/vendor/desk/mcp/src/actions/generated/desk-web/commands.json +53 -0
  148. package/vendor/desk/mcp/src/actions/generated/desk-web/mcp.json +83 -0
  149. package/vendor/desk/mcp/src/actions/generated/desk-web/web.ts +47 -0
  150. package/vendor/desk/mcp/src/actions/generated/desk-web/webmcp.json +81 -0
  151. package/vendor/desk/mcp/src/actions/served.js +5 -0
  152. package/vendor/desk/mcp/src/activation/admit.js +77 -0
  153. package/vendor/desk/mcp/src/activation/failures.js +65 -0
  154. package/vendor/desk/mcp/src/activation/readiness-policy.js +102 -0
  155. package/vendor/desk/mcp/src/activation/schema.js +17 -0
  156. package/vendor/desk/mcp/src/activation/superpowers-context.js +265 -0
  157. package/vendor/desk/mcp/src/activation/validate.js +540 -0
  158. package/vendor/desk/mcp/src/artifacts/tombstones.js +61 -0
  159. package/vendor/desk/mcp/src/crew/initiative.js +287 -0
  160. package/vendor/desk/mcp/src/crew/workspace.js +1259 -0
  161. package/vendor/desk/mcp/src/db/init.js +75 -0
  162. package/vendor/desk/mcp/src/db/schema.sql +83 -0
  163. package/vendor/desk/mcp/src/desk/active-tasks.js +408 -0
  164. package/vendor/desk/mcp/src/desk/card-commit-guard.js +281 -0
  165. package/vendor/desk/mcp/src/desk/cleanup-index.js +53 -0
  166. package/vendor/desk/mcp/src/desk/content-home.js +246 -0
  167. package/vendor/desk/mcp/src/desk/crew-config.js +102 -0
  168. package/vendor/desk/mcp/src/desk/crew-member.js +196 -0
  169. package/vendor/desk/mcp/src/desk/crew-roster.js +151 -0
  170. package/vendor/desk/mcp/src/desk/frontmatter-lite.js +228 -0
  171. package/vendor/desk/mcp/src/desk/gh-logins.js +109 -0
  172. package/vendor/desk/mcp/src/desk/handles.js +123 -0
  173. package/vendor/desk/mcp/src/desk/handoff-reference.js +35 -0
  174. package/vendor/desk/mcp/src/desk/improvement-authority.js +3 -0
  175. package/vendor/desk/mcp/src/desk/improvement-cards.js +704 -0
  176. package/vendor/desk/mcp/src/desk/improvement-person.js +51 -0
  177. package/vendor/desk/mcp/src/desk/lifecycle.js +16 -0
  178. package/vendor/desk/mcp/src/desk/machine-desks.js +119 -0
  179. package/vendor/desk/mcp/src/desk/naming.js +333 -0
  180. package/vendor/desk/mcp/src/desk/organization.js +592 -0
  181. package/vendor/desk/mcp/src/desk/resources.js +274 -0
  182. package/vendor/desk/mcp/src/desk/runtime-resolver.js +30 -0
  183. package/vendor/desk/mcp/src/desk/scratch-paths.js +44 -0
  184. package/vendor/desk/mcp/src/desk/step-delivery.js +140 -0
  185. package/vendor/desk/mcp/src/desk/steps.js +263 -0
  186. package/vendor/desk/mcp/src/desk/tidy.js +930 -0
  187. package/vendor/desk/mcp/src/desk/unsigned-deliveries.js +359 -0
  188. package/vendor/desk/mcp/src/factory/agent-types.js +45 -0
  189. package/vendor/desk/mcp/src/factory/andon-watch.js +109 -0
  190. package/vendor/desk/mcp/src/factory/binding.js +612 -0
  191. package/vendor/desk/mcp/src/factory/boot-check.js +645 -0
  192. package/vendor/desk/mcp/src/factory/capture-classify.js +158 -0
  193. package/vendor/desk/mcp/src/factory/capture-count.js +183 -0
  194. package/vendor/desk/mcp/src/factory/capture-flush.js +268 -0
  195. package/vendor/desk/mcp/src/factory/capture-publish.js +141 -0
  196. package/vendor/desk/mcp/src/factory/capture-schema.js +193 -0
  197. package/vendor/desk/mcp/src/factory/capture-sweep.js +239 -0
  198. package/vendor/desk/mcp/src/factory/catch-point.js +60 -0
  199. package/vendor/desk/mcp/src/factory/commit-resolve.js +94 -0
  200. package/vendor/desk/mcp/src/factory/consent-answer.js +37 -0
  201. package/vendor/desk/mcp/src/factory/context-capability.js +15 -0
  202. package/vendor/desk/mcp/src/factory/context-outbox.js +885 -0
  203. package/vendor/desk/mcp/src/factory/context-run.js +386 -0
  204. package/vendor/desk/mcp/src/factory/context-schema.js +249 -0
  205. package/vendor/desk/mcp/src/factory/copilot-turn-index.js +93 -0
  206. package/vendor/desk/mcp/src/factory/copilot-usage.js +148 -0
  207. package/vendor/desk/mcp/src/factory/credential.js +45 -0
  208. package/vendor/desk/mcp/src/factory/derive-claude.js +960 -0
  209. package/vendor/desk/mcp/src/factory/derive-codex.js +734 -0
  210. package/vendor/desk/mcp/src/factory/derive-common.js +279 -0
  211. package/vendor/desk/mcp/src/factory/derive-copilot.js +1057 -0
  212. package/vendor/desk/mcp/src/factory/derive-run.js +807 -0
  213. package/vendor/desk/mcp/src/factory/desk-problem-file.js +310 -0
  214. package/vendor/desk/mcp/src/factory/desk-problem-fingerprint.js +70 -0
  215. package/vendor/desk/mcp/src/factory/desk-problem-known.js +246 -0
  216. package/vendor/desk/mcp/src/factory/desk-problem-template.js +107 -0
  217. package/vendor/desk/mcp/src/factory/desk-repo.js +1223 -0
  218. package/vendor/desk/mcp/src/factory/desk-task-line.js +28 -0
  219. package/vendor/desk/mcp/src/factory/desk-visibility.js +48 -0
  220. package/vendor/desk/mcp/src/factory/end-hook.js +14 -0
  221. package/vendor/desk/mcp/src/factory/evaluate-kick.js +164 -0
  222. package/vendor/desk/mcp/src/factory/evaluate-run.js +678 -0
  223. package/vendor/desk/mcp/src/factory/evaluator-step.js +484 -0
  224. package/vendor/desk/mcp/src/factory/filer-launch.js +79 -0
  225. package/vendor/desk/mcp/src/factory/flush-health.js +26 -0
  226. package/vendor/desk/mcp/src/factory/flush.js +1758 -0
  227. package/vendor/desk/mcp/src/factory/focus.js +326 -0
  228. package/vendor/desk/mcp/src/factory/headless-flag.cjs +32 -0
  229. package/vendor/desk/mcp/src/factory/headless-flag.js +25 -0
  230. package/vendor/desk/mcp/src/factory/headless-ledger.js +743 -0
  231. package/vendor/desk/mcp/src/factory/headless.js +567 -0
  232. package/vendor/desk/mcp/src/factory/held-route.js +93 -0
  233. package/vendor/desk/mcp/src/factory/host-flags.js +36 -0
  234. package/vendor/desk/mcp/src/factory/improvement-verify.js +429 -0
  235. package/vendor/desk/mcp/src/factory/kaizen-file.js +231 -0
  236. package/vendor/desk/mcp/src/factory/label-binding.js +90 -0
  237. package/vendor/desk/mcp/src/factory/label-schema.js +426 -0
  238. package/vendor/desk/mcp/src/factory/local-status.js +368 -0
  239. package/vendor/desk/mcp/src/factory/loop-conditions.js +121 -0
  240. package/vendor/desk/mcp/src/factory/loop-health.js +500 -0
  241. package/vendor/desk/mcp/src/factory/loop-slot.js +90 -0
  242. package/vendor/desk/mcp/src/factory/loop-status.js +100 -0
  243. package/vendor/desk/mcp/src/factory/loop-switch.cjs +14 -0
  244. package/vendor/desk/mcp/src/factory/loop-worker-state.js +96 -0
  245. package/vendor/desk/mcp/src/factory/loop-worker.js +290 -0
  246. package/vendor/desk/mcp/src/factory/marker.js +61 -0
  247. package/vendor/desk/mcp/src/factory/mirror-step.js +145 -0
  248. package/vendor/desk/mcp/src/factory/os-protect.js +243 -0
  249. package/vendor/desk/mcp/src/factory/outbox.js +2231 -0
  250. package/vendor/desk/mcp/src/factory/outcome.js +431 -0
  251. package/vendor/desk/mcp/src/factory/pipeline/andon.js +319 -0
  252. package/vendor/desk/mcp/src/factory/pipeline/attention-rollup.js +158 -0
  253. package/vendor/desk/mcp/src/factory/pipeline/attention.js +146 -0
  254. package/vendor/desk/mcp/src/factory/pipeline/build.js +299 -0
  255. package/vendor/desk/mcp/src/factory/pipeline/compare.js +148 -0
  256. package/vendor/desk/mcp/src/factory/pipeline/formulas.js +652 -0
  257. package/vendor/desk/mcp/src/factory/pipeline/kaizen.js +387 -0
  258. package/vendor/desk/mcp/src/factory/pipeline/lifecycle-clocks.js +345 -0
  259. package/vendor/desk/mcp/src/factory/pipeline/normalize.js +73 -0
  260. package/vendor/desk/mcp/src/factory/pipeline/number-states.js +154 -0
  261. package/vendor/desk/mcp/src/factory/pipeline/outcomes.js +268 -0
  262. package/vendor/desk/mcp/src/factory/pipeline/report.js +737 -0
  263. package/vendor/desk/mcp/src/factory/pipeline/rollups.js +883 -0
  264. package/vendor/desk/mcp/src/factory/pipeline/stretches.js +523 -0
  265. package/vendor/desk/mcp/src/factory/pipeline/timeline.js +199 -0
  266. package/vendor/desk/mcp/src/factory/pipeline/validate-pr.js +238 -0
  267. package/vendor/desk/mcp/src/factory/pipeline/versions.js +42 -0
  268. package/vendor/desk/mcp/src/factory/pipeline/walk.js +1177 -0
  269. package/vendor/desk/mcp/src/factory/plugin-registry.js +72 -0
  270. package/vendor/desk/mcp/src/factory/plugin-sources.cjs +249 -0
  271. package/vendor/desk/mcp/src/factory/pr-green.js +77 -0
  272. package/vendor/desk/mcp/src/factory/process-lock.js +142 -0
  273. package/vendor/desk/mcp/src/factory/proof-session.js +75 -0
  274. package/vendor/desk/mcp/src/factory/publish.js +637 -0
  275. package/vendor/desk/mcp/src/factory/published-schema.js +648 -0
  276. package/vendor/desk/mcp/src/factory/reconcile-reasons.js +22 -0
  277. package/vendor/desk/mcp/src/factory/reconcile-step.js +251 -0
  278. package/vendor/desk/mcp/src/factory/reconcile.js +808 -0
  279. package/vendor/desk/mcp/src/factory/release-version.js +134 -0
  280. package/vendor/desk/mcp/src/factory/repo-name.js +13 -0
  281. package/vendor/desk/mcp/src/factory/retention.js +60 -0
  282. package/vendor/desk/mcp/src/factory/route-desk.js +40 -0
  283. package/vendor/desk/mcp/src/factory/route-issues.js +251 -0
  284. package/vendor/desk/mcp/src/factory/route-local.js +264 -0
  285. package/vendor/desk/mcp/src/factory/schema.js +957 -0
  286. package/vendor/desk/mcp/src/factory/session-kind.js +16 -0
  287. package/vendor/desk/mcp/src/factory/session-lifetime.js +56 -0
  288. package/vendor/desk/mcp/src/factory/session-route.js +183 -0
  289. package/vendor/desk/mcp/src/factory/shell-git.js +500 -0
  290. package/vendor/desk/mcp/src/factory/store-issues.js +143 -0
  291. package/vendor/desk/mcp/src/factory/store-route.js +208 -0
  292. package/vendor/desk/mcp/src/factory/test-state-guard.js +103 -0
  293. package/vendor/desk/mcp/src/factory/time.js +36 -0
  294. package/vendor/desk/mcp/src/factory/tool-issue-file.js +84 -0
  295. package/vendor/desk/mcp/src/factory/tool-kinds.js +87 -0
  296. package/vendor/desk/mcp/src/factory/triage-schema.js +233 -0
  297. package/vendor/desk/mcp/src/factory/windows-acl.js +679 -0
  298. package/vendor/desk/mcp/src/indexer/chunk.js +232 -0
  299. package/vendor/desk/mcp/src/indexer/discover.js +434 -0
  300. package/vendor/desk/mcp/src/indexer/exclusions.js +247 -0
  301. package/vendor/desk/mcp/src/indexer/index.js +167 -0
  302. package/vendor/desk/mcp/src/indexer/refs.js +0 -0
  303. package/vendor/desk/mcp/src/indexer/text-hash.js +18 -0
  304. package/vendor/desk/mcp/src/lib/ouro-actions/actions.claims.json +75 -0
  305. package/vendor/desk/mcp/src/lib/ouro-actions/dist-manifest.json +70 -0
  306. package/vendor/desk/mcp/src/lib/ouro-actions/ouro-actions.mts +1416 -0
  307. package/vendor/desk/mcp/src/lib/ouro-ui/LICENSE +21 -0
  308. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-claims.ts +190 -0
  309. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/ax-command.ts +1020 -0
  310. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/checks.ts +343 -0
  311. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/cli.ts +240 -0
  312. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/component.ts +430 -0
  313. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/dev-commands.ts +204 -0
  314. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/doctor.ts +126 -0
  315. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/effects.ts +68 -0
  316. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/exit-codes.ts +75 -0
  317. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/help.ts +220 -0
  318. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/mcp.ts +268 -0
  319. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/outcome.ts +265 -0
  320. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/output.ts +67 -0
  321. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/precise-copy.ts +235 -0
  322. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/problem.ts +124 -0
  323. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.kit.mts +8 -0
  324. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/surfaces.ts +568 -0
  325. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/terminal.ts +245 -0
  326. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/voice.ts +136 -0
  327. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/wait.ts +226 -0
  328. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/work-event.ts +181 -0
  329. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.kit.mts +18 -0
  330. package/vendor/desk/mcp/src/lib/ouro-ui/registry/ouro/ax/xray.ts +2072 -0
  331. package/vendor/desk/mcp/src/package-metadata.js +20 -0
  332. package/vendor/desk/mcp/src/protected/legacy-ledger.js +55 -0
  333. package/vendor/desk/mcp/src/readiness/leftovers.js +75 -0
  334. package/vendor/desk/mcp/src/readiness/process-start.js +149 -0
  335. package/vendor/desk/mcp/src/runtime/admission-worker.js +194 -0
  336. package/vendor/desk/mcp/src/runtime/admission.js +177 -0
  337. package/vendor/desk/mcp/src/runtime/agency-desk-channel.js +342 -0
  338. package/vendor/desk/mcp/src/runtime/agents-md.js +62 -0
  339. package/vendor/desk/mcp/src/runtime/append-lane.js +68 -0
  340. package/vendor/desk/mcp/src/runtime/argv-safe-reason.js +55 -0
  341. package/vendor/desk/mcp/src/runtime/boot-dependencies.js +75 -0
  342. package/vendor/desk/mcp/src/runtime/boot-text.js +504 -0
  343. package/vendor/desk/mcp/src/runtime/boot.js +1677 -0
  344. package/vendor/desk/mcp/src/runtime/bootstrap.js +1455 -0
  345. package/vendor/desk/mcp/src/runtime/chunked-import.js +102 -0
  346. package/vendor/desk/mcp/src/runtime/copilot-commit-trailer.js +133 -0
  347. package/vendor/desk/mcp/src/runtime/copilot-session.js +155 -0
  348. package/vendor/desk/mcp/src/runtime/deliver.js +469 -0
  349. package/vendor/desk/mcp/src/runtime/desk-channel.js +86 -0
  350. package/vendor/desk/mcp/src/runtime/desk-failure.js +26 -0
  351. package/vendor/desk/mcp/src/runtime/desk-health.js +168 -0
  352. package/vendor/desk/mcp/src/runtime/desk-session.js +1451 -0
  353. package/vendor/desk/mcp/src/runtime/diagnostic-server.js +72 -0
  354. package/vendor/desk/mcp/src/runtime/diagnostics.js +241 -0
  355. package/vendor/desk/mcp/src/runtime/drains-cli.js +187 -0
  356. package/vendor/desk/mcp/src/runtime/drains.js +781 -0
  357. package/vendor/desk/mcp/src/runtime/elsewhere-note.js +9 -0
  358. package/vendor/desk/mcp/src/runtime/failure-evidence.js +21 -0
  359. package/vendor/desk/mcp/src/runtime/fast-refs.js +209 -0
  360. package/vendor/desk/mcp/src/runtime/filer-throttle.js +66 -0
  361. package/vendor/desk/mcp/src/runtime/focused-card.js +147 -0
  362. package/vendor/desk/mcp/src/runtime/front-door.js +204 -0
  363. package/vendor/desk/mcp/src/runtime/gate-wait.js +2 -0
  364. package/vendor/desk/mcp/src/runtime/git-inspection.js +201 -0
  365. package/vendor/desk/mcp/src/runtime/git-read-worker.js +157 -0
  366. package/vendor/desk/mcp/src/runtime/health.js +50 -0
  367. package/vendor/desk/mcp/src/runtime/hooks.js +353 -0
  368. package/vendor/desk/mcp/src/runtime/hosted.js +163 -0
  369. package/vendor/desk/mcp/src/runtime/inbox.js +102 -0
  370. package/vendor/desk/mcp/src/runtime/index-drift.js +118 -0
  371. package/vendor/desk/mcp/src/runtime/last-start.js +133 -0
  372. package/vendor/desk/mcp/src/runtime/lesson-section.js +92 -0
  373. package/vendor/desk/mcp/src/runtime/lessons-shelf.js +100 -0
  374. package/vendor/desk/mcp/src/runtime/lfs.js +319 -0
  375. package/vendor/desk/mcp/src/runtime/native-path.js +12 -0
  376. package/vendor/desk/mcp/src/runtime/newest-release.js +197 -0
  377. package/vendor/desk/mcp/src/runtime/node-selection.js +233 -0
  378. package/vendor/desk/mcp/src/runtime/orca-session-title.js +225 -0
  379. package/vendor/desk/mcp/src/runtime/other-sessions.js +183 -0
  380. package/vendor/desk/mcp/src/runtime/pending-migrations.js +653 -0
  381. package/vendor/desk/mcp/src/runtime/plugin-update.js +215 -0
  382. package/vendor/desk/mcp/src/runtime/pluginless-runtimes.js +34 -0
  383. package/vendor/desk/mcp/src/runtime/pr-publication.js +226 -0
  384. package/vendor/desk/mcp/src/runtime/preview-snapshot.js +23 -0
  385. package/vendor/desk/mcp/src/runtime/publication-mode.js +19 -0
  386. package/vendor/desk/mcp/src/runtime/relays.js +974 -0
  387. package/vendor/desk/mcp/src/runtime/release-alert.js +148 -0
  388. package/vendor/desk/mcp/src/runtime/remote-identity.js +140 -0
  389. package/vendor/desk/mcp/src/runtime/resolve-here.js +4 -0
  390. package/vendor/desk/mcp/src/runtime/runtime-deps-cli.js +65 -0
  391. package/vendor/desk/mcp/src/runtime/runtime-deps.js +1109 -0
  392. package/vendor/desk/mcp/src/runtime/runtime-identity.js +22 -0
  393. package/vendor/desk/mcp/src/runtime/runtime-swap.js +101 -0
  394. package/vendor/desk/mcp/src/runtime/schedules.js +235 -0
  395. package/vendor/desk/mcp/src/runtime/session-activity.js +190 -0
  396. package/vendor/desk/mcp/src/runtime/session-label.js +30 -0
  397. package/vendor/desk/mcp/src/runtime/session-retention.js +662 -0
  398. package/vendor/desk/mcp/src/runtime/session-sync.js +333 -0
  399. package/vendor/desk/mcp/src/runtime/session-trailer.js +126 -0
  400. package/vendor/desk/mcp/src/runtime/sessions-cli.js +301 -0
  401. package/vendor/desk/mcp/src/runtime/signoff-listed.js +81 -0
  402. package/vendor/desk/mcp/src/runtime/skills.js +76 -0
  403. package/vendor/desk/mcp/src/runtime/stale-card-lead.js +52 -0
  404. package/vendor/desk/mcp/src/runtime/stale-desk-refresh.js +198 -0
  405. package/vendor/desk/mcp/src/runtime/stale-desk.js +219 -0
  406. package/vendor/desk/mcp/src/runtime/stalled.js +255 -0
  407. package/vendor/desk/mcp/src/runtime/standing-authority.js +79 -0
  408. package/vendor/desk/mcp/src/runtime/startup-boot.js +341 -0
  409. package/vendor/desk/mcp/src/runtime/startup-resolve.js +140 -0
  410. package/vendor/desk/mcp/src/runtime/state-branch.js +203 -0
  411. package/vendor/desk/mcp/src/runtime/status-compact.js +165 -0
  412. package/vendor/desk/mcp/src/runtime/status-inspection-child.js +26 -0
  413. package/vendor/desk/mcp/src/runtime/status-inspection.js +147 -0
  414. package/vendor/desk/mcp/src/runtime/status-root.js +39 -0
  415. package/vendor/desk/mcp/src/runtime/sync-worker.js +911 -0
  416. package/vendor/desk/mcp/src/runtime/test-state-guard.js +107 -0
  417. package/vendor/desk/mcp/src/runtime/unmerged-saves.js +247 -0
  418. package/vendor/desk/mcp/src/runtime/workspace-claim.js +53 -0
  419. package/vendor/desk/mcp/src/runtime/workspace-evidence.js +96 -0
  420. package/vendor/desk/mcp/src/runtime/workspace-tidy.js +509 -0
  421. package/vendor/desk/mcp/src/search/direct-lexical.js +54 -0
  422. package/vendor/desk/mcp/src/search/embedder.js +108 -0
  423. package/vendor/desk/mcp/src/search/engine.js +406 -0
  424. package/vendor/desk/mcp/src/search/files-router.js +22 -0
  425. package/vendor/desk/mcp/src/search/old-index.js +46 -0
  426. package/vendor/desk/mcp/src/search/vectors.js +60 -0
  427. package/vendor/desk/mcp/src/server.js +389 -0
  428. package/vendor/desk/mcp/src/tool-names.js +73 -0
  429. package/vendor/desk/mcp/src/tool-refusal.cjs +35 -0
  430. package/vendor/desk/mcp/src/tool-schema-parts.js +12 -0
  431. package/vendor/desk/mcp/src/tool-schemas.js +325 -0
  432. package/vendor/desk/mcp/src/tools/_card-commit.js +148 -0
  433. package/vendor/desk/mcp/src/tools/archive-links.js +185 -0
  434. package/vendor/desk/mcp/src/tools/archive-move.js +18 -0
  435. package/vendor/desk/mcp/src/tools/archive-native-session.js +728 -0
  436. package/vendor/desk/mcp/src/tools/archive-state.js +513 -0
  437. package/vendor/desk/mcp/src/tools/delivery-gate.js +251 -0
  438. package/vendor/desk/mcp/src/tools/desk-save.js +444 -0
  439. package/vendor/desk/mcp/src/tools/doctor.js +122 -0
  440. package/vendor/desk/mcp/src/tools/done-evidence.js +260 -0
  441. package/vendor/desk/mcp/src/tools/factory-context.js +204 -0
  442. package/vendor/desk/mcp/src/tools/friction.js +332 -0
  443. package/vendor/desk/mcp/src/tools/improvement.js +156 -0
  444. package/vendor/desk/mcp/src/tools/lesson-lines.js +22 -0
  445. package/vendor/desk/mcp/src/tools/lesson-owners.js +137 -0
  446. package/vendor/desk/mcp/src/tools/lesson-team.js +169 -0
  447. package/vendor/desk/mcp/src/tools/lesson.js +254 -0
  448. package/vendor/desk/mcp/src/tools/local-only.js +151 -0
  449. package/vendor/desk/mcp/src/tools/move.js +794 -0
  450. package/vendor/desk/mcp/src/tools/native-stage-context.js +32 -0
  451. package/vendor/desk/mcp/src/tools/note.js +267 -0
  452. package/vendor/desk/mcp/src/tools/search.js +634 -0
  453. package/vendor/desk/mcp/src/tools/shared-write.js +196 -0
  454. package/vendor/desk/mcp/src/tools/sibling-desk.js +37 -0
  455. package/vendor/desk/mcp/src/tools/status.js +233 -0
  456. package/vendor/desk/mcp/src/tools/task-archive-due.js +9 -0
  457. package/vendor/desk/mcp/src/tools/task-archived-resource.js +53 -0
  458. package/vendor/desk/mcp/src/tools/task-body.js +141 -0
  459. package/vendor/desk/mcp/src/tools/task-focus.js +164 -0
  460. package/vendor/desk/mcp/src/tools/task-log.js +76 -0
  461. package/vendor/desk/mcp/src/tools/task-signoff.js +155 -0
  462. package/vendor/desk/mcp/src/tools/task.js +1768 -0
  463. package/vendor/desk/mcp/src/tools/track-row.js +89 -0
  464. package/vendor/desk/mcp/src/tools/track.js +240 -0
  465. package/vendor/desk/mcp/src/util/agency-session.cjs +29 -0
  466. package/vendor/desk/mcp/src/util/archive-links.js +105 -0
  467. package/vendor/desk/mcp/src/util/bash.js +36 -0
  468. package/vendor/desk/mcp/src/util/capture-record.js +73 -0
  469. package/vendor/desk/mcp/src/util/cas-commit.js +252 -0
  470. package/vendor/desk/mcp/src/util/created-dirs.js +71 -0
  471. package/vendor/desk/mcp/src/util/deferred-tools.js +51 -0
  472. package/vendor/desk/mcp/src/util/desk-owner.js +99 -0
  473. package/vendor/desk/mcp/src/util/env-value.js +13 -0
  474. package/vendor/desk/mcp/src/util/file-identity.js +40 -0
  475. package/vendor/desk/mcp/src/util/finish-commit.js +145 -0
  476. package/vendor/desk/mcp/src/util/fm.js +410 -0
  477. package/vendor/desk/mcp/src/util/git-config-file.js +85 -0
  478. package/vendor/desk/mcp/src/util/git-stage.js +440 -0
  479. package/vendor/desk/mcp/src/util/main-publish.js +240 -0
  480. package/vendor/desk/mcp/src/util/markdown-links.cjs +555 -0
  481. package/vendor/desk/mcp/src/util/object-input.js +59 -0
  482. package/vendor/desk/mcp/src/util/paths.js +647 -0
  483. package/vendor/desk/mcp/src/util/rank.js +189 -0
  484. package/vendor/desk/mcp/src/util/redact.js +92 -0
  485. package/vendor/desk/mcp/src/util/remove-retry.js +35 -0
  486. package/vendor/desk/mcp/src/util/rename-retry.js +73 -0
  487. package/vendor/desk/mcp/src/util/route-around.js +265 -0
  488. package/vendor/desk/mcp/src/util/shell-quote.js +18 -0
  489. package/vendor/desk/mcp/src/util/startup-direction.js +124 -0
  490. package/vendor/desk/mcp/src/util/state-ignore.js +33 -0
  491. package/vendor/desk/mcp/src/util/tool-commits.js +64 -0
  492. package/vendor/desk/mcp/src/util/unicode-16/LICENSE-MIT.txt +7 -0
  493. package/vendor/desk/mcp/src/util/unicode-16/README.md +9 -0
  494. package/vendor/desk/mcp/src/util/unicode-16/letter.cjs +1 -0
  495. package/vendor/desk/mcp/src/util/unicode-16/mark.cjs +1 -0
  496. package/vendor/desk/mcp/src/util/unicode-16/number.cjs +1 -0
  497. package/vendor/desk/mcp/web-auth.cjs +1897 -0
  498. package/vendor/desk/mcp/web-browser-discovery.cjs +53 -0
  499. package/vendor/desk/mcp/web-catalog.json +34 -0
  500. package/vendor/desk/mcp/web-launch.cjs +101 -0
  501. package/vendor/desk/mcp/web.cjs +1239 -0
  502. package/vendor/desk/migrations/01-move-to-ourostack-desk.md +188 -0
  503. package/vendor/desk/migrations/02-tidy-desk.md +87 -0
  504. package/vendor/desk/migrations/03-desk-release-channel.md +38 -0
  505. package/vendor/desk/optional/session-label/consumer.mjs +237 -0
  506. package/vendor/desk/optional/session-label/extension.mjs +32 -0
  507. package/vendor/desk/plugin.json +54 -0
  508. package/vendor/desk/settings.json +3 -0
  509. package/vendor/desk/skills/add-workspace-mcp/SKILL.md +180 -0
  510. package/vendor/desk/skills/adopt-inflight-work/SKILL.md +212 -0
  511. package/vendor/desk/skills/archive-workflow/SKILL.md +132 -0
  512. package/vendor/desk/skills/content-routing/SKILL.md +95 -0
  513. package/vendor/desk/skills/core-meeting-capture/SKILL.md +47 -0
  514. package/vendor/desk/skills/core-meeting-capture/references/capture-contract.md +175 -0
  515. package/vendor/desk/skills/curator/SKILL.md +103 -0
  516. package/vendor/desk/skills/delightful-decks/SKILL.md +67 -0
  517. package/vendor/desk/skills/desk-problem/SKILL.md +87 -0
  518. package/vendor/desk/skills/directory-structure/SKILL.md +169 -0
  519. package/vendor/desk/skills/doc-review-rigor/SKILL.md +63 -0
  520. package/vendor/desk/skills/draining-issues/SKILL.md +62 -0
  521. package/vendor/desk/skills/evaluate-release/SKILL.md +96 -0
  522. package/vendor/desk/skills/evidence-discipline/SKILL.md +150 -0
  523. package/vendor/desk/skills/factory-evaluator/SKILL.md +122 -0
  524. package/vendor/desk/skills/factory-task-context/SKILL.md +116 -0
  525. package/vendor/desk/skills/factory-work/SKILL.md +16 -0
  526. package/vendor/desk/skills/fast-honest-ci/SKILL.md +70 -0
  527. package/vendor/desk/skills/fast-honest-ci/examples.md +49 -0
  528. package/vendor/desk/skills/first-run-bootstrap/SKILL.md +95 -0
  529. package/vendor/desk/skills/friction-management/SKILL.md +98 -0
  530. package/vendor/desk/skills/git-hygiene/SKILL.md +253 -0
  531. package/vendor/desk/skills/independent-review/SKILL.md +34 -0
  532. package/vendor/desk/skills/interaction-style/SKILL.md +239 -0
  533. package/vendor/desk/skills/lesson-capture/SKILL.md +85 -0
  534. package/vendor/desk/skills/lesson-capture/agents-md-budget.mjs +61 -0
  535. package/vendor/desk/skills/online-evaluation/SKILL.md +81 -0
  536. package/vendor/desk/skills/operator-voice-comments/LICENSE-humanize +21 -0
  537. package/vendor/desk/skills/operator-voice-comments/SKILL.md +90 -0
  538. package/vendor/desk/skills/operator-voice-comments/human-voice.md +43 -0
  539. package/vendor/desk/skills/peer-pr-review/SKILL.md +104 -0
  540. package/vendor/desk/skills/pr-feedback-on-own-pr/SKILL.md +145 -0
  541. package/vendor/desk/skills/pr-review-interrogation/SKILL.md +121 -0
  542. package/vendor/desk/skills/pr-reviewer-audit/SKILL.md +68 -0
  543. package/vendor/desk/skills/pr-reviewer-audit/helpers/audit.py +335 -0
  544. package/vendor/desk/skills/pr-reviewer-audit/helpers/test_audit.py +486 -0
  545. package/vendor/desk/skills/pr-self-review/SKILL.md +86 -0
  546. package/vendor/desk/skills/pr-surface-hygiene/SKILL.md +105 -0
  547. package/vendor/desk/skills/pr-surface-hygiene/check-visual-proof.cjs +99 -0
  548. package/vendor/desk/skills/pr-surface-hygiene/repository-setup.md +19 -0
  549. package/vendor/desk/skills/pr-surface-hygiene/resources/pr-visual-proof.yml +29 -0
  550. package/vendor/desk/skills/pr-surface-hygiene/resources/pull-request-template.md +5 -0
  551. package/vendor/desk/skills/preflight-actions/SKILL.md +60 -0
  552. package/vendor/desk/skills/preview-feedback/SKILL.md +70 -0
  553. package/vendor/desk/skills/repo-handling/SKILL.md +67 -0
  554. package/vendor/desk/skills/rnd-lab/SKILL.md +52 -0
  555. package/vendor/desk/skills/runtime-symptom-investigation/SKILL.md +106 -0
  556. package/vendor/desk/skills/session-resumption/SKILL.md +126 -0
  557. package/vendor/desk/skills/session-start/SKILL.md +54 -0
  558. package/vendor/desk/skills/session-start/details.md +150 -0
  559. package/vendor/desk/skills/session-start-migrations/README.md +71 -0
  560. package/vendor/desk/skills/session-start-migrations/SKILL.md +108 -0
  561. package/vendor/desk/skills/start-task/SKILL.md +88 -0
  562. package/vendor/desk/skills/task-card-format/SKILL.md +198 -0
  563. package/vendor/desk/skills/task-lifecycle/SKILL.md +217 -0
  564. package/vendor/desk/skills/track-card-format/SKILL.md +90 -0
  565. package/vendor/desk/skills/using-desk/SKILL.md +58 -0
  566. package/vendor/desk/skills/using-superpowers-with-desk/SKILL.md +156 -0
  567. package/vendor/desk/skills/work-orchestration/SKILL.md +162 -0
@@ -0,0 +1,268 @@
1
+ export { createMcpHandler, mcpTools, PROTOCOL_VERSIONS, serveMcp, toolName };
2
+ export type { McpCall, McpCallResult, McpOptions, McpTool };
3
+
4
+ // The export list comes first because the shadcn CLI drops comments before a file's
5
+ // first statement, which would take the JSDoc below with it.
6
+
7
+ import { checkInput, checkOwner, invocation, type Cli, type CommandDef, type Input } from "./ax-command.ts";
8
+ import { DRY_RUN_FLAG, WHY_FLAG, WHY_PLACEHOLDER, effectAnnotations } from "./effects.ts";
9
+ import { didYouMean, errorJson, errorLine, isAxError, type AxError, type AxErrorShape } from "./problem.ts";
10
+ import { commandManifest } from "./help.ts";
11
+ import { isOutcome, outcomeText } from "./outcome.ts";
12
+ import { truncate } from "./output.ts";
13
+ import { isWait, waitText } from "./wait.ts";
14
+
15
+ /**
16
+ * The same definitions as an MCP server over stdio (newline-delimited JSON-RPC 2.0), with no dependencies: one tool per
17
+ * command, its inputSchema from the definition, calls checked before they run with the fix in the one error shape,
18
+ * effects as tool annotations, and results cut to a size an agent's context can hold.
19
+ * It speaks [MCP 2026-07-28](https://modelcontextprotocol.io/specification/2026-07-28), the current revision, where every request carries its version in `_meta` and `server/discover` says what the server supports, and it answers the `initialize` handshake of 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05 for older clients, which one process serves side by side.
20
+ *
21
+ * @claim "the current revision, where every request carries its version" registry/ouro/ax/mcp.test.mts verify:testExists(registry/ouro/ax/mcp.test.mts::2026-07-28: server/discover names the versions, the capabilities and the server, and the results carry resultType, a cache hint and the server's identity)
22
+ * @claim "with no dependencies" registry/ouro/ax/mcp.test.mts verify:testExists(registry/ouro/ax/mcp.test.mts::initialize, ping and tools/list: one tool per command, schema and effect annotations from the definition)
23
+ */
24
+ const PROTOCOL_VERSIONS = ["2026-07-28", "2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"] as const;
25
+
26
+ const MODERN_VERSION = PROTOCOL_VERSIONS[0];
27
+ const LEGACY_VERSIONS = PROTOCOL_VERSIONS.slice(1);
28
+ const META = "io.modelcontextprotocol/";
29
+ const VERSION_KEY = `${META}protocolVersion`;
30
+ const CAPABILITIES_KEY = `${META}clientCapabilities`;
31
+ // The command set is fixed for the life of the process, and a stdio server has no shared intermediaries in front of it.
32
+ const CACHE = { ttlMs: 3_600_000, cacheScope: "public" } as const;
33
+
34
+ type McpCallResult = { ok: true; data: unknown; text?: string } | { ok: false; error: AxErrorShape };
35
+ /** Runs one command for a tool call; the default runs the definition's run(). */
36
+ type McpCall = (cmd: CommandDef, input: Input) => Promise<McpCallResult>;
37
+
38
+ interface McpOptions {
39
+ cli: Cli;
40
+ version?: string;
41
+ call?: McpCall;
42
+ /** Which commands are tools; by default, the commands that are not hidden. */
43
+ include?: (cmd: CommandDef) => boolean;
44
+ /**
45
+ * The most characters a result's text may have (default 20,000).
46
+ *
47
+ * @claim "The most characters" registry/ouro/ax/mcp.ts verify:fileLine(registry/ouro/ax/mcp.ts, /maxChars \?\? 20_000/)
48
+ */
49
+ maxChars?: number;
50
+ /** Run tool calls side by side; by default one at a time, in the order they came, as an agent would type them. */
51
+ concurrent?: boolean;
52
+ }
53
+
54
+ interface McpTool {
55
+ name: string;
56
+ title: string;
57
+ description: string;
58
+ inputSchema: ReturnType<typeof commandManifest>["inputSchema"];
59
+ annotations: { title: string; readOnlyHint: boolean; destructiveHint: boolean; openWorldHint: boolean };
60
+ }
61
+
62
+ /** "draft set" is the tool draft_set; the default command is word-less, so it is the tool itself, named after the tool. */
63
+ const toolName = (cli: Pick<Cli, "name" | "defaultCommand">, cmd: CommandDef) => (cmd === cli.defaultCommand ? cli.name : cmd.name.replace(/ /g, "_"));
64
+
65
+ function toolsOf(options: McpOptions): CommandDef[] {
66
+ const include = options.include ?? ((c: CommandDef) => !c.hidden);
67
+ return options.cli.commands.filter((c) => !c.loose && include(c));
68
+ }
69
+
70
+ function mcpTools(options: McpOptions): McpTool[] {
71
+ const { cli } = options;
72
+ return toolsOf(options).map((cmd) => {
73
+ const m = commandManifest(cli, cmd);
74
+ const who = cmd.effect === "others" ? `${cli.headings.others}: call it only when a human asked you to, with "${WHY_FLAG}" (${WHY_PLACEHOLDER.slice(1, -1)}).` : `${cli.headings.private}${cmd.readOnly ? "; it changes nothing" : ""}.`;
75
+ return {
76
+ name: toolName(cli, cmd),
77
+ title: invocation(cli, cmd),
78
+ description: [cmd.summary, who, m.output ? `Returns ${m.output}` : ""].filter(Boolean).join(" "),
79
+ inputSchema: m.inputSchema,
80
+ annotations: { title: invocation(cli, cmd), ...effectAnnotations(cmd.effect, cmd.readOnly === true) },
81
+ };
82
+ });
83
+ }
84
+
85
+ // A tool call's context: no stdin, and the answer is data.
86
+ const callContext = () => ({ stdin: async () => "", json: true });
87
+
88
+ const defaultCall: McpCall = async (cmd, input) => {
89
+ const ctx = callContext();
90
+ if (input[DRY_RUN_FLAG] === true) {
91
+ if (!cmd.plan) return { ok: false, error: { code: "no-preview", exit: 2, thing: `${cmd.name.replace(/ /g, "_")} ${DRY_RUN_FLAG}`, problem: "this tool has no preview, so nothing was done", fix: null } };
92
+ return { ok: true, data: await cmd.plan(input, ctx) };
93
+ }
94
+ if (!cmd.run) return { ok: false, error: { code: "not-runnable", exit: 1, thing: cmd.name, problem: "this command has no run() in its definition", fix: null } };
95
+ const data = await cmd.run(input, ctx);
96
+ return cmd.text ? { ok: true, data, text: cmd.text(data, input) } : { ok: true, data };
97
+ };
98
+
99
+ interface Message {
100
+ jsonrpc?: unknown;
101
+ id?: unknown;
102
+ method?: unknown;
103
+ params?: unknown;
104
+ }
105
+
106
+ type Reply = Record<string, unknown>;
107
+
108
+ /**
109
+ * Handles one JSON-RPC message; null for a notification, which gets no reply. Exposed for tests.
110
+ *
111
+ * @claim "which gets no reply" registry/ouro/ax/mcp.test.mts verify:testExists(registry/ouro/ax/mcp.test.mts::initialize, ping and tools/list: one tool per command, schema and effect annotations from the definition)
112
+ */
113
+ function createMcpHandler(options: McpOptions): (message: unknown) => Promise<Reply | null> {
114
+ const { cli } = options;
115
+ const maxChars = options.maxChars ?? 20_000;
116
+ const call = options.call ?? defaultCall;
117
+ const byName = new Map(toolsOf(options).map((c) => [toolName(cli, c), c]));
118
+ let queue: Promise<unknown> = Promise.resolve();
119
+ const inTurn = <T>(work: () => Promise<T>): Promise<T> => {
120
+ if (options.concurrent) return work();
121
+ const next = queue.then(work, work);
122
+ queue = next.catch(() => undefined);
123
+ return next;
124
+ };
125
+ const toolError = (shape: AxErrorShape) => ({ content: [{ type: "text", text: errorLine(cli.name, shape) }], structuredContent: errorJson(shape), isError: true });
126
+ const serverInfo = { name: cli.name, version: options.version ?? "0.0.0" };
127
+ const instructions = [...cli.about, `Tools under "${cli.headings.private}" touch only the person's own space; tools under "${cli.headings.others}" reach other people and need "${WHY_FLAG}". Every error has a fix: the arguments to send instead.`].join(" ");
128
+ // A client that opened with initialize is an older one: its later requests carry no _meta.
129
+ let initialized = false;
130
+ const inFlight = new Map<unknown, { cancelled: boolean }>();
131
+ /** Runs one tools/call; null when the client cancelled it before it started. */
132
+ const callTool = async (params: Record<string, unknown>, turn: { cancelled: boolean }): Promise<Record<string, unknown> | null> => {
133
+ const name = typeof params["name"] === "string" ? params["name"] : "";
134
+ const cmd = byName.get(name);
135
+ if (!cmd) {
136
+ const near = didYouMean(name, [...byName.keys()]);
137
+ return toolError({ code: "unknown-tool", exit: cli.exits.code("usage"), thing: name || "tools/call", problem: `there is no tool "${name}"`, fix: near ?? [...byName.keys()].join(", ") });
138
+ }
139
+ let input: Input;
140
+ try {
141
+ input = checkInput(cli, cmd, params["arguments"] ?? {});
142
+ } catch (e) {
143
+ // checkInput throws only AxErrors.
144
+ return toolError((e as AxError).shape);
145
+ }
146
+ let result: McpCallResult | null;
147
+ try {
148
+ result = await inTurn(async () => {
149
+ if (turn.cancelled) return null;
150
+ await checkOwner(cli, cmd, input, callContext());
151
+ return call(cmd, input);
152
+ });
153
+ } catch (e) {
154
+ const shape: AxErrorShape = isAxError(e) ? e.shape : { code: "error", exit: cli.exits.code("error"), thing: cmd.name.replace(/ /g, "_"), problem: e instanceof Error ? e.message : String(e), fix: null };
155
+ return toolError(shape);
156
+ }
157
+ if (!result) return null;
158
+ if (!result.ok) return toolError(result.error);
159
+ const data = result.data;
160
+ // An outcome that refused or failed is a tool error an agent repairs from, with the outcome as its data.
161
+ const outcomeError = isOutcome(data) && (data.state === "refused" || data.state === "failed");
162
+ const whole = result.text ?? (isOutcome(data) ? outcomeText(data, cli.name) : isWait(data) ? waitText(data) : JSON.stringify(data));
163
+ const cut = truncate(whole, maxChars, "call again asking for less, such as a smaller limit");
164
+ const structured = !cut.truncated && data !== null && typeof data === "object" && !Array.isArray(data);
165
+ return { content: [{ type: "text", text: cut.text }], ...(structured ? { structuredContent: data } : {}), isError: outcomeError };
166
+ };
167
+ return async (raw) => {
168
+ const msg = (raw && typeof raw === "object" ? raw : {}) as Message;
169
+ const id = msg.id;
170
+ const isRequest = id !== undefined && id !== null;
171
+ const fail = (code: number, message: string, data?: unknown): Reply => ({ jsonrpc: "2.0", id: isRequest ? id : null, error: { code, message, ...(data === undefined ? {} : { data }) } });
172
+ if (msg.jsonrpc !== "2.0" || typeof msg.method !== "string") return fail(-32600, "Invalid Request: expected a JSON-RPC 2.0 message with a method.");
173
+ const params = (msg.params && typeof msg.params === "object" ? msg.params : {}) as Record<string, unknown>;
174
+ if (!isRequest) {
175
+ const target = msg.method === "notifications/cancelled" ? inFlight.get(params["requestId"]) : undefined;
176
+ if (target) target.cancelled = true;
177
+ return null;
178
+ }
179
+ const meta = (params["_meta"] && typeof params["_meta"] === "object" ? params["_meta"] : {}) as Record<string, unknown>;
180
+ const asked = meta[VERSION_KEY];
181
+ // With a version in _meta the request is 2026-07-28's and stands alone; without one it is an older client's, after initialize.
182
+ const modern = asked !== undefined;
183
+ const ok = (result: Record<string, unknown>): Reply => ({ jsonrpc: "2.0", id, result: modern ? { resultType: "complete", ...result, _meta: { [`${META}serverInfo`]: serverInfo } } : result });
184
+ if (msg.method === "initialize") {
185
+ initialized = true;
186
+ const requested = params["protocolVersion"];
187
+ const protocolVersion = LEGACY_VERSIONS.find((v) => v === requested) ?? LEGACY_VERSIONS[0];
188
+ return { jsonrpc: "2.0", id, result: { protocolVersion, capabilities: { tools: { listChanged: false } }, serverInfo, instructions } };
189
+ }
190
+ if (msg.method === "ping" && !modern) return ok({});
191
+ if (!modern && (!initialized || msg.method === "server/discover")) {
192
+ return fail(-32602, `Invalid params: send _meta["${VERSION_KEY}"]: "${MODERN_VERSION}" and _meta["${CAPABILITIES_KEY}"]: {} on every request (MCP ${MODERN_VERSION} has no initialize handshake), or open with initialize as an older client does.`);
193
+ }
194
+ if (modern) {
195
+ if (typeof asked !== "string") return fail(-32602, `Invalid params: _meta["${VERSION_KEY}"] must be a version string such as "${MODERN_VERSION}".`);
196
+ if (asked !== MODERN_VERSION) return fail(-32022, `Unsupported protocol version: ${asked}. Send "${MODERN_VERSION}" in _meta; the older versions open with initialize instead.`, { supported: [...PROTOCOL_VERSIONS], requested: asked });
197
+ const capabilities = meta[CAPABILITIES_KEY];
198
+ if (!capabilities || typeof capabilities !== "object" || Array.isArray(capabilities)) return fail(-32602, `Invalid params: _meta["${CAPABILITIES_KEY}"] must be an object, {} when the client has no capabilities.`);
199
+ }
200
+ const turn = { cancelled: false };
201
+ inFlight.set(id, turn);
202
+ try {
203
+ let reply: Reply;
204
+ switch (msg.method) {
205
+ case "server/discover":
206
+ reply = ok({ supportedVersions: [...PROTOCOL_VERSIONS], capabilities: { tools: {} }, instructions, ...CACHE });
207
+ break;
208
+ case "tools/list":
209
+ if (modern && params["cursor"] !== undefined) return fail(-32602, "Invalid params: tools/list has one page, so it takes no cursor.");
210
+ reply = ok({ tools: mcpTools(options), ...(modern ? CACHE : {}) });
211
+ break;
212
+ case "tools/call": {
213
+ const result = await callTool(params, turn);
214
+ if (!result) return null;
215
+ reply = ok(result);
216
+ break;
217
+ }
218
+ default:
219
+ reply = fail(-32601, `Method not found: ${msg.method}. This server answers server/discover, tools/list and tools/call${modern ? "" : ", and initialize and ping for older clients"}.`);
220
+ }
221
+ return turn.cancelled ? null : reply;
222
+ } finally {
223
+ // A client may reuse the id of a call it cancelled while that call still runs.
224
+ if (inFlight.get(id) === turn) inFlight.delete(id);
225
+ }
226
+ };
227
+ }
228
+
229
+ /** Serves MCP on a byte stream until it ends: one JSON-RPC message per line in, one reply per line out. */
230
+ async function serveMcp(options: McpOptions & { input: AsyncIterable<string | Uint8Array> | Iterable<string | Uint8Array>; output: { write(s: string): unknown } }): Promise<void> {
231
+ const handle = createMcpHandler(options);
232
+ const pending = new Set<Promise<void>>();
233
+ const decoder = new TextDecoder();
234
+ let buffer = "";
235
+ const dispatch = (line: string) => {
236
+ if (!line.trim()) return;
237
+ let message: unknown;
238
+ try {
239
+ message = JSON.parse(line);
240
+ } catch {
241
+ options.output.write(`${JSON.stringify({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "Parse error: each line must be one JSON-RPC message." } })}\n`);
242
+ return;
243
+ }
244
+ const p = handle(message)
245
+ .then((reply) => {
246
+ if (reply) options.output.write(`${JSON.stringify(reply)}\n`);
247
+ })
248
+ // handle() answers every message itself; this only guards against a bug in it.
249
+ /* node:coverage ignore next 4 */
250
+ .catch((e: unknown) => {
251
+ const id = message && typeof message === "object" ? ((message as Message).id ?? null) : null;
252
+ options.output.write(`${JSON.stringify({ jsonrpc: "2.0", id, error: { code: -32603, message: e instanceof Error ? e.message : String(e) } })}\n`);
253
+ })
254
+ .finally(() => pending.delete(p));
255
+ pending.add(p);
256
+ };
257
+ for await (const chunk of options.input) {
258
+ buffer += typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true });
259
+ let nl: number;
260
+ while ((nl = buffer.indexOf("\n")) !== -1) {
261
+ dispatch(buffer.slice(0, nl));
262
+ buffer = buffer.slice(nl + 1);
263
+ }
264
+ }
265
+ dispatch(buffer + decoder.decode());
266
+ await Promise.all(pending);
267
+ }
268
+
@@ -0,0 +1,265 @@
1
+ export { DEFAULT_OUTCOME_EXITS, isGenericAudience, isOutcome, nextStep, OUTCOME_STATES, OUTCOME_VERSION, outcome, outcomeExit, outcomeText, validateOutcome };
2
+ export type { AxRef, NextStep, Outcome, OutcomeExits, OutcomeFields, OutcomeHuman, OutcomeState, Postcondition, Receipt, Validation };
3
+
4
+ // The export list comes first because the shadcn CLI drops comments before a file's
5
+ // first statement, which would take the JSDoc below with it.
6
+
7
+ import { ONLY_YOU, type Audience, type Effect } from "./effects.ts";
8
+ import { preciseFailureProblem } from "./precise-copy.ts";
9
+ import { errorLine, errorMessage, type AxErrorBody, type AxErrorShape } from "./problem.ts";
10
+ import type { ExitTable } from "./exit-codes.ts";
11
+
12
+ /**
13
+ * The outcome of an action: what became of it, who can see it, whether that was checked, how to find it again and what
14
+ * to run next, in one shape over a CLI's `--json`, an HTTP route and an MCP tool.
15
+ */
16
+ const OUTCOME_VERSION = "outcome/1";
17
+
18
+ /**
19
+ * What became of an action.
20
+ * - `done`: it happened; the postcondition says how that is known.
21
+ * - `queued`: accepted, not performed yet; `receipt.id` and `next` follow it.
22
+ * - `planned`: a dry run; nothing happened.
23
+ * - `needs-human`: only a person can take the next step; `human` says why and how to resume.
24
+ * - `uncertain`: it may or may not have happened; reconcile before any retry.
25
+ * - `refused`: checked and not done, with the reason; nothing happened.
26
+ * - `failed`: tried and proven not done.
27
+ */
28
+ const OUTCOME_STATES = Object.freeze(["done", "queued", "planned", "needs-human", "uncertain", "refused", "failed"] as const);
29
+ type OutcomeState = (typeof OUTCOME_STATES)[number];
30
+
31
+ /** A thing an agent holds a reference to: a conversation, a message, a meeting, a request. `id` is what the tool takes back. */
32
+ interface AxRef {
33
+ kind: string;
34
+ id: string;
35
+ name?: string;
36
+ }
37
+
38
+ /**
39
+ * The check that the effect holds, made apart from the transport's answer. `holds` is null while the effect cannot be
40
+ * observed yet; `how` names what was read.
41
+ */
42
+ interface Postcondition {
43
+ checked: boolean;
44
+ holds: boolean | null;
45
+ how: string;
46
+ }
47
+
48
+ /** A durable record of the request: the id that finds it again, when, by whom and why. */
49
+ interface Receipt {
50
+ id: string;
51
+ at: string;
52
+ by: string;
53
+ why: string | null;
54
+ }
55
+
56
+ /** One next valid action: an exact command an agent can run, and why it would. */
57
+ interface NextStep {
58
+ command: string;
59
+ why: string;
60
+ /**
61
+ * The step only works in a source checkout (a repository script, say), and the tool shows it only there. Without
62
+ * it, a step may not ask for a developer command or a repository path (ax-dev-commands), since an agent passes it
63
+ * on to a person who has the installed tool.
64
+ */
65
+ sourceCheckout?: true;
66
+ }
67
+
68
+ /** Why only a person can go on, and the step that resumes once they have. */
69
+ interface OutcomeHuman {
70
+ reason: string;
71
+ resume: NextStep;
72
+ /** Why the reason is precise though it is short or holds a vague phrase; the vague-failure check and the X-ray pass it with this reason. */
73
+ preciseFailure?: string;
74
+ }
75
+
76
+ /** The envelope an action returns. */
77
+ interface Outcome {
78
+ ax: typeof OUTCOME_VERSION;
79
+ action: string;
80
+ effect: Effect;
81
+ audience: Audience;
82
+ target: AxRef | null;
83
+ state: OutcomeState;
84
+ summary: string;
85
+ postcondition: Postcondition;
86
+ receipt: Receipt | null;
87
+ next: NextStep[];
88
+ error?: AxErrorBody;
89
+ human?: OutcomeHuman;
90
+ }
91
+
92
+ /** Problems that make an envelope untrustworthy are errors; honest gaps are warnings. */
93
+ interface Validation {
94
+ ok: boolean;
95
+ errors: string[];
96
+ warnings: string[];
97
+ }
98
+
99
+ /** An exact next step. */
100
+ function nextStep(command: string, why: string): NextStep {
101
+ return { command, why };
102
+ }
103
+
104
+ /** What {@link outcome} takes: the action, its state and summary, and whatever else is known. */
105
+ type OutcomeFields = Pick<Outcome, "action" | "state" | "summary"> & {
106
+ effect?: Effect;
107
+ audience?: Audience;
108
+ target?: AxRef | null;
109
+ postcondition?: Postcondition;
110
+ receipt?: Receipt | null;
111
+ next?: NextStep[];
112
+ error?: AxErrorShape;
113
+ human?: OutcomeHuman;
114
+ };
115
+
116
+ /**
117
+ * Builds an outcome with honest defaults: private, only you, nothing checked, no receipt and no next steps. Pass what is
118
+ * known; {@link validateOutcome} says what is missing.
119
+ *
120
+ * @example
121
+ * outcome({ action: "message.send", effect: "others", audience: { only: false, who: 'everyone in "Design sync"' },
122
+ * state: "queued", summary: 'Queued for "Design sync".',
123
+ * receipt: { id: "a1b2c3", at: new Date().toISOString(), by: "agent:planner", why: "Jo asked" },
124
+ * next: [nextStep("tool outcome a1b2c3 --timeout 60s", "wait until it is sent")] });
125
+ *
126
+ * @claim "Builds an outcome with honest defaults" registry/ouro/ax/outcome.test.mts verify:testExists(registry/ouro/ax/outcome.test.mts::outcome fills honest defaults: private, only you, nothing checked, no receipt; an error gets its message)
127
+ */
128
+ function outcome(fields: OutcomeFields): Outcome {
129
+ const { action, state, summary, effect = "private", audience = ONLY_YOU, target = null, postcondition, receipt = null, next = [], error, human } = fields;
130
+ return {
131
+ ax: OUTCOME_VERSION,
132
+ action,
133
+ effect,
134
+ audience: { ...audience },
135
+ target,
136
+ state,
137
+ summary,
138
+ postcondition: postcondition ?? { checked: false, holds: null, how: "not checked" },
139
+ receipt,
140
+ next,
141
+ ...(error ? { error: { ...error, message: errorMessage(error) } } : {}),
142
+ ...(human ? { human } : {}),
143
+ };
144
+ }
145
+
146
+ const isRecord = (v: unknown): v is Record<string, unknown> => typeof v === "object" && v !== null && !Array.isArray(v);
147
+ const isText = (v: unknown): v is string => typeof v === "string" && v.trim().length > 0;
148
+ const isStep = (v: unknown): v is NextStep => isRecord(v) && isText(v["command"]) && isText(v["why"]);
149
+
150
+ /**
151
+ * Whether an audience's `who` names no one in particular ("other people", "someone", "everyone"), so an agent reading
152
+ * the JSON learns less than one reading the text.
153
+ *
154
+ * @claim "names no one in particular" registry/ouro/ax/outcome.test.mts verify:testExists(registry/ouro/ax/outcome.test.mts::an action for other people that names no one is warned about)
155
+ */
156
+ function isGenericAudience(who: string): boolean {
157
+ return /^(?:other people|others|people|someone|somebody|anyone|anybody|everyone|everybody|the audience|recipients|users?)\.?$/i.test(who.trim());
158
+ }
159
+
160
+ /** Whether a value is an outcome of this version (its shape only; {@link validateOutcome} checks its meaning). */
161
+ function isOutcome(v: unknown): v is Outcome {
162
+ return isRecord(v) && v["ax"] === OUTCOME_VERSION && (OUTCOME_STATES as readonly unknown[]).includes(v["state"]);
163
+ }
164
+
165
+ /**
166
+ * Checks an outcome's meaning, not only its shape:
167
+ * - `done` never rests on a postcondition that failed; one not checked is a warning.
168
+ * - `refused` and `failed` carry an error and never claim the effect holds.
169
+ * - `queued` and `uncertain` carry a receipt and a next step, and `uncertain` cannot claim to know.
170
+ * - an effect other people see carries a receipt with a why, unless nothing happened, and an audience that is not only you.
171
+ * - `needs-human` carries the reason and the step that resumes.
172
+ * - a next step is an exact command with its why.
173
+ *
174
+ * @claim "never claim the effect holds" registry/ouro/ax/outcome.test.mts verify:testExists(registry/ouro/ax/outcome.test.mts::the rules: done, queued, uncertain, refused, failed, needs-human, planned and effects other people see)
175
+ */
176
+ function validateOutcome(v: unknown): Validation {
177
+ const errors: string[] = [];
178
+ const warnings: string[] = [];
179
+ if (!isOutcome(v)) return { ok: false, errors: [`not an ${OUTCOME_VERSION} envelope: ax must be "${OUTCOME_VERSION}" and state one of ${OUTCOME_STATES.join(", ")}`], warnings };
180
+ if (!isText(v.action)) errors.push("action is empty");
181
+ if (v.effect !== "private" && v.effect !== "others") errors.push('effect is "private" or "others"');
182
+ if (!isRecord(v.audience) || typeof v.audience.only !== "boolean" || !isText(v.audience.who)) errors.push("audience needs only (true or false) and who (words)");
183
+ else if (v.effect === "others" && v.audience.only) errors.push("an effect other people see cannot have an audience of only you");
184
+ else if (v.effect === "others" && isGenericAudience(v.audience.who)) warnings.push(`audience.who is "${v.audience.who}", which names no one: say who will see it, as the text does (everyone in "Design sync", Jo Park)`);
185
+ if (v.target !== null && !(isRecord(v.target) && isText(v.target.kind) && isText(v.target.id))) errors.push("target is null or { kind, id }");
186
+ if (!isText(v.summary)) errors.push("summary is empty");
187
+ const p: unknown = v.postcondition;
188
+ const pOk = isRecord(p) && typeof p["checked"] === "boolean" && (p["holds"] === null || typeof p["holds"] === "boolean") && isText(p["how"]);
189
+ if (!pOk) errors.push("postcondition needs checked, holds (true, false or null) and how");
190
+ const holds = pOk ? p["holds"] : null;
191
+ if (!Array.isArray(v.next) || !v.next.every(isStep)) errors.push("every next step needs a command and a why");
192
+ const r: unknown = v.receipt;
193
+ const rOk = r === null || (isRecord(r) && isText(r["id"]) && isText(r["at"]) && isText(r["by"]) && (r["why"] === null || typeof r["why"] === "string"));
194
+ if (!rOk) errors.push("receipt needs id, at, by and why (or null)");
195
+ const why = rOk && r !== null ? r["why"] : null;
196
+ const hasReceipt = rOk && r !== null;
197
+ const hasNext = Array.isArray(v.next) && v.next.length > 0;
198
+ const e: unknown = v.error;
199
+ const hasError = isRecord(e) && isText(e["code"]) && isText(e["message"]);
200
+ if (e !== undefined && !hasError) errors.push("error needs a code and a message");
201
+ if (isRecord(e) && preciseFailureProblem(e)) errors.push(`error.${preciseFailureProblem(e)}`);
202
+ if (isRecord(v.human) && preciseFailureProblem(v.human)) errors.push(`human.${preciseFailureProblem(v.human)}`);
203
+ switch (v.state) {
204
+ case "done":
205
+ if (holds === false) errors.push("done, but the postcondition does not hold");
206
+ if (pOk && p["checked"] === false) warnings.push("done without an independent check: say what it rests on in postcondition.how");
207
+ if (hasError) errors.push("done carries an error");
208
+ break;
209
+ case "queued":
210
+ case "uncertain":
211
+ if (!hasReceipt) errors.push(`${v.state} needs a receipt, so the request can be found again`);
212
+ if (!hasNext) errors.push(`${v.state} needs a next step`);
213
+ if (v.state === "uncertain" && holds !== null) errors.push("uncertain, but the postcondition claims to know");
214
+ break;
215
+ case "refused":
216
+ case "failed":
217
+ if (!hasError) errors.push(`${v.state} needs an error with a code and a message`);
218
+ if (holds === true) errors.push(`${v.state}, but the postcondition says the effect holds`);
219
+ if (!hasNext && !(hasError && isRecord(e) && isText(e["fix"]))) warnings.push(`${v.state} without a next step or a fix: say what to do instead`);
220
+ break;
221
+ case "needs-human":
222
+ if (!isRecord(v.human) || !isText(v.human.reason) || !isStep(v.human.resume)) errors.push("needs-human needs human.reason and human.resume");
223
+ break;
224
+ case "planned":
225
+ if (holds === true) errors.push("planned, but the postcondition says the effect holds");
226
+ break;
227
+ }
228
+ if (v.effect === "others" && (v.state === "done" || v.state === "queued" || v.state === "uncertain") && !isText(why)) errors.push("an effect other people see needs a receipt with a why");
229
+ return { ok: errors.length === 0, errors, warnings };
230
+ }
231
+
232
+ /** Exit code names by outcome state, in the tool's table. */
233
+ type OutcomeExits = Readonly<Record<OutcomeState, string>>;
234
+
235
+ /**
236
+ * The default: what was done, queued, planned or handed to the person exits `ok` (the outcome says which); a refusal
237
+ * exits `usage`; a failure or an uncertain result exits `error`. A tool with its own codes (such as "possibly done")
238
+ * passes its own names.
239
+ */
240
+ const DEFAULT_OUTCOME_EXITS: OutcomeExits = Object.freeze({ done: "ok", queued: "ok", planned: "ok", "needs-human": "ok", uncertain: "error", refused: "usage", failed: "error" });
241
+
242
+ /** The exit code an outcome gives: a refusal's or failure's own error exit, else its state's name in the table. */
243
+ function outcomeExit(o: Outcome, exits: ExitTable, names: OutcomeExits = DEFAULT_OUTCOME_EXITS): number {
244
+ if ((o.state === "refused" || o.state === "failed") && o.error) return o.error.exit;
245
+ return exits.code(names[o.state]);
246
+ }
247
+
248
+ /**
249
+ * The outcome as text for a person: the summary, what was checked (or why it is not checked yet), what only the person
250
+ * can do, then the next steps.
251
+ * A refusal or failure with an error is the one error line, as every Ouro AX error is.
252
+ *
253
+ * @claim "as every Ouro AX error is" registry/ouro/ax/outcome.test.mts verify:testExists(registry/ouro/ax/outcome.test.mts::outcomeText: the summary, the check, the receipt, the person's step and the next steps; a refusal is its error line)
254
+ */
255
+ function outcomeText(o: Outcome, tool: string): string {
256
+ if ((o.state === "refused" || o.state === "failed") && o.error) return errorLine(tool, o.error);
257
+ const lines = [o.summary];
258
+ const how = o.postcondition.how.replace(/[.\s]+$/, "");
259
+ if (o.postcondition.checked && o.postcondition.holds !== null) lines.push(`Checked: ${how}${o.postcondition.holds === false ? " (it does not hold)" : ""}.`);
260
+ else if (how !== "not checked") lines.push(`Not checked yet: ${how}.`);
261
+ if (o.receipt) lines.push(`Receipt: ${o.receipt.id}`);
262
+ if (o.human) lines.push(`Needs the person: ${o.human.reason.replace(/[.\s]+$/, "")}. Then: ${o.human.resume.command}`);
263
+ for (const n of o.next) lines.push(`Next: ${n.command} (${n.why})`);
264
+ return lines.join("\n");
265
+ }
@@ -0,0 +1,67 @@
1
+ export { emptyText, page, render, truncate };
2
+ export type { Page, Truncated };
3
+
4
+ // The export list comes first because the shadcn CLI drops comments before a file's
5
+ // first statement, which would take the JSDoc below with it.
6
+
7
+ /**
8
+ * One result, two renderings: `--json` prints the data, text prints what the command's text() makes of the same data.
9
+ * Long results are cut predictably, and lists page with a cursor, so an agent can read a long answer in pieces.
10
+ *
11
+ * @claim "One result, two renderings" registry/ouro/ax/output.test.mts verify:testExists(registry/ouro/ax/output.test.mts::one result renders as JSON or as its text, with one trailing newline)
12
+ */
13
+
14
+ /**
15
+ * What stdout gets for a result: the JSON document, or the text. Always one trailing newline.
16
+ *
17
+ * @claim "Always one trailing newline" registry/ouro/ax/output.test.mts verify:testExists(registry/ouro/ax/output.test.mts::one result renders as JSON or as its text, with one trailing newline)
18
+ */
19
+ function render<R>(result: R, options: { json: boolean; text?: (result: R) => string }): string {
20
+ const body = options.json || !options.text ? JSON.stringify(result, null, 2) : options.text(result);
21
+ return body.endsWith("\n") ? body : `${body}\n`;
22
+ }
23
+
24
+ interface Truncated {
25
+ text: string;
26
+ truncated: boolean;
27
+ /** The whole length, in characters. */
28
+ total: number;
29
+ }
30
+
31
+ /**
32
+ * Cuts text to at most `max` characters at a line break where it can, and says so on its last line with how to get the
33
+ * rest.
34
+ */
35
+ function truncate(text: string, max: number, more: string = "ask for less, such as a smaller limit"): Truncated {
36
+ if (text.length <= max) return { text, truncated: false, total: text.length };
37
+ const note = `\n[truncated: ${max} of ${text.length} characters shown; ${more}]`;
38
+ const room = Math.max(0, max - note.length);
39
+ const cut = text.lastIndexOf("\n", room);
40
+ return { text: text.slice(0, cut > room / 2 ? cut : room) + note, truncated: true, total: text.length };
41
+ }
42
+
43
+ interface Page<T> {
44
+ items: T[];
45
+ total: number;
46
+ /** Pass it back as `cursor` for the next page; null on the last. */
47
+ nextCursor: string | null;
48
+ }
49
+
50
+ /** One page of a list. The cursor is the next item's offset, so it is stable while the list is. */
51
+ function page<T>(items: readonly T[], options: { limit: number; cursor?: string | null }): Page<T> {
52
+ const start = options.cursor ? Number.parseInt(options.cursor, 10) : 0;
53
+ if (!Number.isSafeInteger(start) || start < 0 || start > items.length) throw new Error(`cursor "${options.cursor}" is not one this list gave. Fix: start again without a cursor.`);
54
+ const end = Math.min(items.length, start + Math.max(1, options.limit));
55
+ return { items: items.slice(start, end), total: items.length, nextCursor: end < items.length ? String(end) : null };
56
+ }
57
+
58
+ /**
59
+ * The text for a list that came back empty: what is empty, by the filter that emptied it ("Nothing unread."), never
60
+ * "nothing held yet" when the filter is why, then the command to run next. A tool's voice may add its `empty` line after.
61
+ *
62
+ * @claim "by the filter that emptied it" registry/ouro/ax/output.test.mts verify:testExists(registry/ouro/ax/output.test.mts::an empty list says what is empty and what to run next)
63
+ */
64
+ function emptyText(what: string, next?: { command: string; why: string }): string {
65
+ const fact = `Nothing ${what.replace(/[.\s]+$/, "")}.`;
66
+ return next ? `${fact}\nNext: ${next.command} (${next.why})` : fact;
67
+ }