@cleocode/cleo 2026.4.12 → 2026.4.14

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 (710) hide show
  1. package/README.md +27 -0
  2. package/dist/cli/index.js +121925 -340
  3. package/dist/cli/index.js.map +7 -1
  4. package/package.json +7 -7
  5. package/dist/cli/commander-shim.d.ts +0 -112
  6. package/dist/cli/commander-shim.d.ts.map +0 -1
  7. package/dist/cli/commander-shim.js +0 -233
  8. package/dist/cli/commander-shim.js.map +0 -1
  9. package/dist/cli/commands/add.d.ts +0 -12
  10. package/dist/cli/commands/add.d.ts.map +0 -1
  11. package/dist/cli/commands/add.js +0 -202
  12. package/dist/cli/commands/add.js.map +0 -1
  13. package/dist/cli/commands/admin.d.ts +0 -12
  14. package/dist/cli/commands/admin.d.ts.map +0 -1
  15. package/dist/cli/commands/admin.js +0 -59
  16. package/dist/cli/commands/admin.js.map +0 -1
  17. package/dist/cli/commands/adr.d.ts +0 -27
  18. package/dist/cli/commands/adr.d.ts.map +0 -1
  19. package/dist/cli/commands/adr.js +0 -79
  20. package/dist/cli/commands/adr.js.map +0 -1
  21. package/dist/cli/commands/agent-profile-status.d.ts +0 -98
  22. package/dist/cli/commands/agent-profile-status.d.ts.map +0 -1
  23. package/dist/cli/commands/agent-profile-status.js +0 -71
  24. package/dist/cli/commands/agent-profile-status.js.map +0 -1
  25. package/dist/cli/commands/agent.d.ts +0 -38
  26. package/dist/cli/commands/agent.d.ts.map +0 -1
  27. package/dist/cli/commands/agent.js +0 -1169
  28. package/dist/cli/commands/agent.js.map +0 -1
  29. package/dist/cli/commands/agents.d.ts +0 -17
  30. package/dist/cli/commands/agents.d.ts.map +0 -1
  31. package/dist/cli/commands/agents.js +0 -20
  32. package/dist/cli/commands/agents.js.map +0 -1
  33. package/dist/cli/commands/analyze.d.ts +0 -12
  34. package/dist/cli/commands/analyze.d.ts.map +0 -1
  35. package/dist/cli/commands/analyze.js +0 -20
  36. package/dist/cli/commands/analyze.js.map +0 -1
  37. package/dist/cli/commands/archive-stats.d.ts +0 -18
  38. package/dist/cli/commands/archive-stats.d.ts.map +0 -1
  39. package/dist/cli/commands/archive-stats.js +0 -49
  40. package/dist/cli/commands/archive-stats.js.map +0 -1
  41. package/dist/cli/commands/archive.d.ts +0 -12
  42. package/dist/cli/commands/archive.d.ts.map +0 -1
  43. package/dist/cli/commands/archive.js +0 -32
  44. package/dist/cli/commands/archive.js.map +0 -1
  45. package/dist/cli/commands/backfill.d.ts +0 -38
  46. package/dist/cli/commands/backfill.d.ts.map +0 -1
  47. package/dist/cli/commands/backfill.js +0 -147
  48. package/dist/cli/commands/backfill.js.map +0 -1
  49. package/dist/cli/commands/backup.d.ts +0 -9
  50. package/dist/cli/commands/backup.d.ts.map +0 -1
  51. package/dist/cli/commands/backup.js +0 -41
  52. package/dist/cli/commands/backup.js.map +0 -1
  53. package/dist/cli/commands/blockers.d.ts +0 -7
  54. package/dist/cli/commands/blockers.d.ts.map +0 -1
  55. package/dist/cli/commands/blockers.js +0 -16
  56. package/dist/cli/commands/blockers.js.map +0 -1
  57. package/dist/cli/commands/brain.d.ts +0 -29
  58. package/dist/cli/commands/brain.d.ts.map +0 -1
  59. package/dist/cli/commands/brain.js +0 -107
  60. package/dist/cli/commands/brain.js.map +0 -1
  61. package/dist/cli/commands/briefing.d.ts +0 -22
  62. package/dist/cli/commands/briefing.d.ts.map +0 -1
  63. package/dist/cli/commands/briefing.js +0 -45
  64. package/dist/cli/commands/briefing.js.map +0 -1
  65. package/dist/cli/commands/bug.d.ts +0 -12
  66. package/dist/cli/commands/bug.d.ts.map +0 -1
  67. package/dist/cli/commands/bug.js +0 -81
  68. package/dist/cli/commands/bug.js.map +0 -1
  69. package/dist/cli/commands/cant.d.ts +0 -32
  70. package/dist/cli/commands/cant.d.ts.map +0 -1
  71. package/dist/cli/commands/cant.js +0 -281
  72. package/dist/cli/commands/cant.js.map +0 -1
  73. package/dist/cli/commands/check.d.ts +0 -22
  74. package/dist/cli/commands/check.d.ts.map +0 -1
  75. package/dist/cli/commands/check.js +0 -164
  76. package/dist/cli/commands/check.js.map +0 -1
  77. package/dist/cli/commands/checkpoint.d.ts +0 -15
  78. package/dist/cli/commands/checkpoint.d.ts.map +0 -1
  79. package/dist/cli/commands/checkpoint.js +0 -91
  80. package/dist/cli/commands/checkpoint.js.map +0 -1
  81. package/dist/cli/commands/code.d.ts +0 -11
  82. package/dist/cli/commands/code.d.ts.map +0 -1
  83. package/dist/cli/commands/code.js +0 -114
  84. package/dist/cli/commands/code.js.map +0 -1
  85. package/dist/cli/commands/commands.d.ts +0 -13
  86. package/dist/cli/commands/commands.d.ts.map +0 -1
  87. package/dist/cli/commands/commands.js +0 -29
  88. package/dist/cli/commands/commands.js.map +0 -1
  89. package/dist/cli/commands/complete.d.ts +0 -12
  90. package/dist/cli/commands/complete.d.ts.map +0 -1
  91. package/dist/cli/commands/complete.js +0 -92
  92. package/dist/cli/commands/complete.js.map +0 -1
  93. package/dist/cli/commands/compliance.d.ts +0 -8
  94. package/dist/cli/commands/compliance.d.ts.map +0 -1
  95. package/dist/cli/commands/compliance.js +0 -85
  96. package/dist/cli/commands/compliance.js.map +0 -1
  97. package/dist/cli/commands/config.d.ts +0 -10
  98. package/dist/cli/commands/config.d.ts.map +0 -1
  99. package/dist/cli/commands/config.js +0 -69
  100. package/dist/cli/commands/config.js.map +0 -1
  101. package/dist/cli/commands/consensus.d.ts +0 -13
  102. package/dist/cli/commands/consensus.d.ts.map +0 -1
  103. package/dist/cli/commands/consensus.js +0 -45
  104. package/dist/cli/commands/consensus.js.map +0 -1
  105. package/dist/cli/commands/context.d.ts +0 -8
  106. package/dist/cli/commands/context.d.ts.map +0 -1
  107. package/dist/cli/commands/context.js +0 -40
  108. package/dist/cli/commands/context.js.map +0 -1
  109. package/dist/cli/commands/contribution.d.ts +0 -13
  110. package/dist/cli/commands/contribution.d.ts.map +0 -1
  111. package/dist/cli/commands/contribution.js +0 -41
  112. package/dist/cli/commands/contribution.js.map +0 -1
  113. package/dist/cli/commands/current.d.ts +0 -13
  114. package/dist/cli/commands/current.d.ts.map +0 -1
  115. package/dist/cli/commands/current.js +0 -20
  116. package/dist/cli/commands/current.js.map +0 -1
  117. package/dist/cli/commands/dash.d.ts +0 -12
  118. package/dist/cli/commands/dash.d.ts.map +0 -1
  119. package/dist/cli/commands/dash.js +0 -24
  120. package/dist/cli/commands/dash.js.map +0 -1
  121. package/dist/cli/commands/decomposition.d.ts +0 -13
  122. package/dist/cli/commands/decomposition.d.ts.map +0 -1
  123. package/dist/cli/commands/decomposition.js +0 -45
  124. package/dist/cli/commands/decomposition.js.map +0 -1
  125. package/dist/cli/commands/delete.d.ts +0 -12
  126. package/dist/cli/commands/delete.d.ts.map +0 -1
  127. package/dist/cli/commands/delete.js +0 -37
  128. package/dist/cli/commands/delete.js.map +0 -1
  129. package/dist/cli/commands/deps.d.ts +0 -24
  130. package/dist/cli/commands/deps.d.ts.map +0 -1
  131. package/dist/cli/commands/deps.js +0 -98
  132. package/dist/cli/commands/deps.js.map +0 -1
  133. package/dist/cli/commands/detect-drift.d.ts +0 -15
  134. package/dist/cli/commands/detect-drift.d.ts.map +0 -1
  135. package/dist/cli/commands/detect-drift.js +0 -424
  136. package/dist/cli/commands/detect-drift.js.map +0 -1
  137. package/dist/cli/commands/detect.d.ts +0 -10
  138. package/dist/cli/commands/detect.d.ts.map +0 -1
  139. package/dist/cli/commands/detect.js +0 -24
  140. package/dist/cli/commands/detect.js.map +0 -1
  141. package/dist/cli/commands/docs.d.ts +0 -13
  142. package/dist/cli/commands/docs.d.ts.map +0 -1
  143. package/dist/cli/commands/docs.js +0 -169
  144. package/dist/cli/commands/docs.js.map +0 -1
  145. package/dist/cli/commands/doctor.d.ts +0 -15
  146. package/dist/cli/commands/doctor.d.ts.map +0 -1
  147. package/dist/cli/commands/doctor.js +0 -133
  148. package/dist/cli/commands/doctor.js.map +0 -1
  149. package/dist/cli/commands/dynamic.d.ts +0 -24
  150. package/dist/cli/commands/dynamic.d.ts.map +0 -1
  151. package/dist/cli/commands/dynamic.js +0 -27
  152. package/dist/cli/commands/dynamic.js.map +0 -1
  153. package/dist/cli/commands/env.d.ts +0 -12
  154. package/dist/cli/commands/env.d.ts.map +0 -1
  155. package/dist/cli/commands/env.js +0 -44
  156. package/dist/cli/commands/env.js.map +0 -1
  157. package/dist/cli/commands/exists.d.ts +0 -22
  158. package/dist/cli/commands/exists.d.ts.map +0 -1
  159. package/dist/cli/commands/exists.js +0 -51
  160. package/dist/cli/commands/exists.js.map +0 -1
  161. package/dist/cli/commands/export-tasks.d.ts +0 -10
  162. package/dist/cli/commands/export-tasks.d.ts.map +0 -1
  163. package/dist/cli/commands/export-tasks.js +0 -47
  164. package/dist/cli/commands/export-tasks.js.map +0 -1
  165. package/dist/cli/commands/export.d.ts +0 -9
  166. package/dist/cli/commands/export.d.ts.map +0 -1
  167. package/dist/cli/commands/export.js +0 -46
  168. package/dist/cli/commands/export.js.map +0 -1
  169. package/dist/cli/commands/find.d.ts +0 -14
  170. package/dist/cli/commands/find.d.ts.map +0 -1
  171. package/dist/cli/commands/find.js +0 -134
  172. package/dist/cli/commands/find.js.map +0 -1
  173. package/dist/cli/commands/generate-changelog.d.ts +0 -14
  174. package/dist/cli/commands/generate-changelog.d.ts.map +0 -1
  175. package/dist/cli/commands/generate-changelog.js +0 -252
  176. package/dist/cli/commands/generate-changelog.js.map +0 -1
  177. package/dist/cli/commands/grade.d.ts +0 -13
  178. package/dist/cli/commands/grade.d.ts.map +0 -1
  179. package/dist/cli/commands/grade.js +0 -26
  180. package/dist/cli/commands/grade.js.map +0 -1
  181. package/dist/cli/commands/history.d.ts +0 -9
  182. package/dist/cli/commands/history.d.ts.map +0 -1
  183. package/dist/cli/commands/history.js +0 -30
  184. package/dist/cli/commands/history.js.map +0 -1
  185. package/dist/cli/commands/implementation.d.ts +0 -13
  186. package/dist/cli/commands/implementation.d.ts.map +0 -1
  187. package/dist/cli/commands/implementation.js +0 -41
  188. package/dist/cli/commands/implementation.js.map +0 -1
  189. package/dist/cli/commands/import-tasks.d.ts +0 -10
  190. package/dist/cli/commands/import-tasks.d.ts.map +0 -1
  191. package/dist/cli/commands/import-tasks.js +0 -38
  192. package/dist/cli/commands/import-tasks.js.map +0 -1
  193. package/dist/cli/commands/import.d.ts +0 -9
  194. package/dist/cli/commands/import.d.ts.map +0 -1
  195. package/dist/cli/commands/import.js +0 -28
  196. package/dist/cli/commands/import.js.map +0 -1
  197. package/dist/cli/commands/init.d.ts +0 -34
  198. package/dist/cli/commands/init.d.ts.map +0 -1
  199. package/dist/cli/commands/init.js +0 -96
  200. package/dist/cli/commands/init.js.map +0 -1
  201. package/dist/cli/commands/inject.d.ts +0 -8
  202. package/dist/cli/commands/inject.d.ts.map +0 -1
  203. package/dist/cli/commands/inject.js +0 -28
  204. package/dist/cli/commands/inject.js.map +0 -1
  205. package/dist/cli/commands/issue.d.ts +0 -17
  206. package/dist/cli/commands/issue.d.ts.map +0 -1
  207. package/dist/cli/commands/issue.js +0 -107
  208. package/dist/cli/commands/issue.js.map +0 -1
  209. package/dist/cli/commands/labels.d.ts +0 -13
  210. package/dist/cli/commands/labels.d.ts.map +0 -1
  211. package/dist/cli/commands/labels.js +0 -44
  212. package/dist/cli/commands/labels.js.map +0 -1
  213. package/dist/cli/commands/lifecycle.d.ts +0 -8
  214. package/dist/cli/commands/lifecycle.d.ts.map +0 -1
  215. package/dist/cli/commands/lifecycle.js +0 -84
  216. package/dist/cli/commands/lifecycle.js.map +0 -1
  217. package/dist/cli/commands/list.d.ts +0 -14
  218. package/dist/cli/commands/list.d.ts.map +0 -1
  219. package/dist/cli/commands/list.js +0 -143
  220. package/dist/cli/commands/list.js.map +0 -1
  221. package/dist/cli/commands/log.d.ts +0 -12
  222. package/dist/cli/commands/log.d.ts.map +0 -1
  223. package/dist/cli/commands/log.js +0 -30
  224. package/dist/cli/commands/log.js.map +0 -1
  225. package/dist/cli/commands/map.d.ts +0 -10
  226. package/dist/cli/commands/map.d.ts.map +0 -1
  227. package/dist/cli/commands/map.js +0 -23
  228. package/dist/cli/commands/map.js.map +0 -1
  229. package/dist/cli/commands/memory-brain.d.ts +0 -14
  230. package/dist/cli/commands/memory-brain.d.ts.map +0 -1
  231. package/dist/cli/commands/memory-brain.js +0 -157
  232. package/dist/cli/commands/memory-brain.js.map +0 -1
  233. package/dist/cli/commands/migrate-claude-mem.d.ts +0 -18
  234. package/dist/cli/commands/migrate-claude-mem.d.ts.map +0 -1
  235. package/dist/cli/commands/migrate-claude-mem.js +0 -60
  236. package/dist/cli/commands/migrate-claude-mem.js.map +0 -1
  237. package/dist/cli/commands/next.d.ts +0 -9
  238. package/dist/cli/commands/next.d.ts.map +0 -1
  239. package/dist/cli/commands/next.js +0 -20
  240. package/dist/cli/commands/next.js.map +0 -1
  241. package/dist/cli/commands/nexus.d.ts +0 -16
  242. package/dist/cli/commands/nexus.d.ts.map +0 -1
  243. package/dist/cli/commands/nexus.js +0 -155
  244. package/dist/cli/commands/nexus.js.map +0 -1
  245. package/dist/cli/commands/observe.d.ts +0 -12
  246. package/dist/cli/commands/observe.d.ts.map +0 -1
  247. package/dist/cli/commands/observe.js +0 -42
  248. package/dist/cli/commands/observe.js.map +0 -1
  249. package/dist/cli/commands/ops.d.ts +0 -10
  250. package/dist/cli/commands/ops.d.ts.map +0 -1
  251. package/dist/cli/commands/ops.js +0 -19
  252. package/dist/cli/commands/ops.js.map +0 -1
  253. package/dist/cli/commands/orchestrate.d.ts +0 -8
  254. package/dist/cli/commands/orchestrate.d.ts.map +0 -1
  255. package/dist/cli/commands/orchestrate.js +0 -58
  256. package/dist/cli/commands/orchestrate.js.map +0 -1
  257. package/dist/cli/commands/otel.d.ts +0 -12
  258. package/dist/cli/commands/otel.d.ts.map +0 -1
  259. package/dist/cli/commands/otel.js +0 -128
  260. package/dist/cli/commands/otel.js.map +0 -1
  261. package/dist/cli/commands/phase.d.ts +0 -12
  262. package/dist/cli/commands/phase.d.ts.map +0 -1
  263. package/dist/cli/commands/phase.js +0 -91
  264. package/dist/cli/commands/phase.js.map +0 -1
  265. package/dist/cli/commands/phases.d.ts +0 -12
  266. package/dist/cli/commands/phases.d.ts.map +0 -1
  267. package/dist/cli/commands/phases.js +0 -37
  268. package/dist/cli/commands/phases.js.map +0 -1
  269. package/dist/cli/commands/plan.d.ts +0 -8
  270. package/dist/cli/commands/plan.d.ts.map +0 -1
  271. package/dist/cli/commands/plan.js +0 -15
  272. package/dist/cli/commands/plan.js.map +0 -1
  273. package/dist/cli/commands/promote.d.ts +0 -7
  274. package/dist/cli/commands/promote.d.ts.map +0 -1
  275. package/dist/cli/commands/promote.js +0 -15
  276. package/dist/cli/commands/promote.js.map +0 -1
  277. package/dist/cli/commands/reason.d.ts +0 -35
  278. package/dist/cli/commands/reason.d.ts.map +0 -1
  279. package/dist/cli/commands/reason.js +0 -104
  280. package/dist/cli/commands/reason.js.map +0 -1
  281. package/dist/cli/commands/refresh-memory.d.ts +0 -9
  282. package/dist/cli/commands/refresh-memory.d.ts.map +0 -1
  283. package/dist/cli/commands/refresh-memory.js +0 -24
  284. package/dist/cli/commands/refresh-memory.js.map +0 -1
  285. package/dist/cli/commands/relates.d.ts +0 -12
  286. package/dist/cli/commands/relates.d.ts.map +0 -1
  287. package/dist/cli/commands/relates.js +0 -53
  288. package/dist/cli/commands/relates.js.map +0 -1
  289. package/dist/cli/commands/release.d.ts +0 -8
  290. package/dist/cli/commands/release.d.ts.map +0 -1
  291. package/dist/cli/commands/release.js +0 -72
  292. package/dist/cli/commands/release.js.map +0 -1
  293. package/dist/cli/commands/remote.d.ts +0 -12
  294. package/dist/cli/commands/remote.d.ts.map +0 -1
  295. package/dist/cli/commands/remote.js +0 -207
  296. package/dist/cli/commands/remote.js.map +0 -1
  297. package/dist/cli/commands/reorder.d.ts +0 -7
  298. package/dist/cli/commands/reorder.d.ts.map +0 -1
  299. package/dist/cli/commands/reorder.js +0 -20
  300. package/dist/cli/commands/reorder.js.map +0 -1
  301. package/dist/cli/commands/reparent.d.ts +0 -10
  302. package/dist/cli/commands/reparent.d.ts.map +0 -1
  303. package/dist/cli/commands/reparent.js +0 -19
  304. package/dist/cli/commands/reparent.js.map +0 -1
  305. package/dist/cli/commands/research.d.ts +0 -8
  306. package/dist/cli/commands/research.d.ts.map +0 -1
  307. package/dist/cli/commands/research.js +0 -129
  308. package/dist/cli/commands/research.js.map +0 -1
  309. package/dist/cli/commands/restore.d.ts +0 -12
  310. package/dist/cli/commands/restore.d.ts.map +0 -1
  311. package/dist/cli/commands/restore.js +0 -228
  312. package/dist/cli/commands/restore.js.map +0 -1
  313. package/dist/cli/commands/roadmap.d.ts +0 -8
  314. package/dist/cli/commands/roadmap.d.ts.map +0 -1
  315. package/dist/cli/commands/roadmap.js +0 -21
  316. package/dist/cli/commands/roadmap.js.map +0 -1
  317. package/dist/cli/commands/safestop.d.ts +0 -14
  318. package/dist/cli/commands/safestop.d.ts.map +0 -1
  319. package/dist/cli/commands/safestop.js +0 -32
  320. package/dist/cli/commands/safestop.js.map +0 -1
  321. package/dist/cli/commands/schema.d.ts +0 -27
  322. package/dist/cli/commands/schema.d.ts.map +0 -1
  323. package/dist/cli/commands/schema.js +0 -160
  324. package/dist/cli/commands/schema.js.map +0 -1
  325. package/dist/cli/commands/self-update.d.ts +0 -15
  326. package/dist/cli/commands/self-update.d.ts.map +0 -1
  327. package/dist/cli/commands/self-update.js +0 -329
  328. package/dist/cli/commands/self-update.js.map +0 -1
  329. package/dist/cli/commands/sequence.d.ts +0 -8
  330. package/dist/cli/commands/sequence.d.ts.map +0 -1
  331. package/dist/cli/commands/sequence.js +0 -30
  332. package/dist/cli/commands/sequence.js.map +0 -1
  333. package/dist/cli/commands/session.d.ts +0 -12
  334. package/dist/cli/commands/session.d.ts.map +0 -1
  335. package/dist/cli/commands/session.js +0 -175
  336. package/dist/cli/commands/session.js.map +0 -1
  337. package/dist/cli/commands/show.d.ts +0 -13
  338. package/dist/cli/commands/show.d.ts.map +0 -1
  339. package/dist/cli/commands/show.js +0 -40
  340. package/dist/cli/commands/show.js.map +0 -1
  341. package/dist/cli/commands/skills.d.ts +0 -13
  342. package/dist/cli/commands/skills.d.ts.map +0 -1
  343. package/dist/cli/commands/skills.js +0 -131
  344. package/dist/cli/commands/skills.js.map +0 -1
  345. package/dist/cli/commands/snapshot.d.ts +0 -9
  346. package/dist/cli/commands/snapshot.d.ts.map +0 -1
  347. package/dist/cli/commands/snapshot.js +0 -50
  348. package/dist/cli/commands/snapshot.js.map +0 -1
  349. package/dist/cli/commands/specification.d.ts +0 -13
  350. package/dist/cli/commands/specification.d.ts.map +0 -1
  351. package/dist/cli/commands/specification.js +0 -45
  352. package/dist/cli/commands/specification.js.map +0 -1
  353. package/dist/cli/commands/start.d.ts +0 -13
  354. package/dist/cli/commands/start.d.ts.map +0 -1
  355. package/dist/cli/commands/start.js +0 -20
  356. package/dist/cli/commands/start.js.map +0 -1
  357. package/dist/cli/commands/stats.d.ts +0 -12
  358. package/dist/cli/commands/stats.d.ts.map +0 -1
  359. package/dist/cli/commands/stats.js +0 -35
  360. package/dist/cli/commands/stats.js.map +0 -1
  361. package/dist/cli/commands/sticky.d.ts +0 -16
  362. package/dist/cli/commands/sticky.d.ts.map +0 -1
  363. package/dist/cli/commands/sticky.js +0 -211
  364. package/dist/cli/commands/sticky.js.map +0 -1
  365. package/dist/cli/commands/stop.d.ts +0 -13
  366. package/dist/cli/commands/stop.d.ts.map +0 -1
  367. package/dist/cli/commands/stop.js +0 -20
  368. package/dist/cli/commands/stop.js.map +0 -1
  369. package/dist/cli/commands/testing.d.ts +0 -13
  370. package/dist/cli/commands/testing.d.ts.map +0 -1
  371. package/dist/cli/commands/testing.js +0 -64
  372. package/dist/cli/commands/testing.js.map +0 -1
  373. package/dist/cli/commands/token.d.ts +0 -10
  374. package/dist/cli/commands/token.d.ts.map +0 -1
  375. package/dist/cli/commands/token.js +0 -135
  376. package/dist/cli/commands/token.js.map +0 -1
  377. package/dist/cli/commands/update.d.ts +0 -12
  378. package/dist/cli/commands/update.d.ts.map +0 -1
  379. package/dist/cli/commands/update.js +0 -83
  380. package/dist/cli/commands/update.js.map +0 -1
  381. package/dist/cli/commands/upgrade.d.ts +0 -18
  382. package/dist/cli/commands/upgrade.d.ts.map +0 -1
  383. package/dist/cli/commands/upgrade.js +0 -103
  384. package/dist/cli/commands/upgrade.js.map +0 -1
  385. package/dist/cli/commands/validate.d.ts +0 -12
  386. package/dist/cli/commands/validate.d.ts.map +0 -1
  387. package/dist/cli/commands/validate.js +0 -23
  388. package/dist/cli/commands/validate.js.map +0 -1
  389. package/dist/cli/commands/verify.d.ts +0 -8
  390. package/dist/cli/commands/verify.d.ts.map +0 -1
  391. package/dist/cli/commands/verify.js +0 -28
  392. package/dist/cli/commands/verify.js.map +0 -1
  393. package/dist/cli/commands/web.d.ts +0 -13
  394. package/dist/cli/commands/web.d.ts.map +0 -1
  395. package/dist/cli/commands/web.js +0 -277
  396. package/dist/cli/commands/web.js.map +0 -1
  397. package/dist/cli/field-context.d.ts +0 -32
  398. package/dist/cli/field-context.d.ts.map +0 -1
  399. package/dist/cli/field-context.js +0 -47
  400. package/dist/cli/field-context.js.map +0 -1
  401. package/dist/cli/format-context.d.ts +0 -32
  402. package/dist/cli/format-context.d.ts.map +0 -1
  403. package/dist/cli/format-context.js +0 -50
  404. package/dist/cli/format-context.js.map +0 -1
  405. package/dist/cli/help-generator.d.ts +0 -74
  406. package/dist/cli/help-generator.d.ts.map +0 -1
  407. package/dist/cli/help-generator.js +0 -229
  408. package/dist/cli/help-generator.js.map +0 -1
  409. package/dist/cli/index.d.ts +0 -9
  410. package/dist/cli/index.d.ts.map +0 -1
  411. package/dist/cli/logger-bootstrap.d.ts +0 -6
  412. package/dist/cli/logger-bootstrap.d.ts.map +0 -1
  413. package/dist/cli/logger-bootstrap.js +0 -10
  414. package/dist/cli/logger-bootstrap.js.map +0 -1
  415. package/dist/cli/middleware/output-format.d.ts +0 -30
  416. package/dist/cli/middleware/output-format.d.ts.map +0 -1
  417. package/dist/cli/middleware/output-format.js +0 -35
  418. package/dist/cli/middleware/output-format.js.map +0 -1
  419. package/dist/cli/progress.d.ts +0 -84
  420. package/dist/cli/progress.d.ts.map +0 -1
  421. package/dist/cli/progress.js +0 -169
  422. package/dist/cli/progress.js.map +0 -1
  423. package/dist/cli/renderers/colors.d.ts +0 -32
  424. package/dist/cli/renderers/colors.d.ts.map +0 -1
  425. package/dist/cli/renderers/colors.js +0 -141
  426. package/dist/cli/renderers/colors.js.map +0 -1
  427. package/dist/cli/renderers/error.d.ts +0 -13
  428. package/dist/cli/renderers/error.d.ts.map +0 -1
  429. package/dist/cli/renderers/error.js +0 -42
  430. package/dist/cli/renderers/error.js.map +0 -1
  431. package/dist/cli/renderers/index.d.ts +0 -87
  432. package/dist/cli/renderers/index.d.ts.map +0 -1
  433. package/dist/cli/renderers/index.js +0 -262
  434. package/dist/cli/renderers/index.js.map +0 -1
  435. package/dist/cli/renderers/lafs-validator.d.ts +0 -91
  436. package/dist/cli/renderers/lafs-validator.d.ts.map +0 -1
  437. package/dist/cli/renderers/lafs-validator.js +0 -176
  438. package/dist/cli/renderers/lafs-validator.js.map +0 -1
  439. package/dist/cli/renderers/normalizer.d.ts +0 -21
  440. package/dist/cli/renderers/normalizer.d.ts.map +0 -1
  441. package/dist/cli/renderers/normalizer.js +0 -106
  442. package/dist/cli/renderers/normalizer.js.map +0 -1
  443. package/dist/cli/renderers/system.d.ts +0 -25
  444. package/dist/cli/renderers/system.d.ts.map +0 -1
  445. package/dist/cli/renderers/system.js +0 -416
  446. package/dist/cli/renderers/system.js.map +0 -1
  447. package/dist/cli/renderers/tasks.d.ts +0 -28
  448. package/dist/cli/renderers/tasks.d.ts.map +0 -1
  449. package/dist/cli/renderers/tasks.js +0 -306
  450. package/dist/cli/renderers/tasks.js.map +0 -1
  451. package/dist/dispatch/adapters/cli.d.ts +0 -67
  452. package/dist/dispatch/adapters/cli.d.ts.map +0 -1
  453. package/dist/dispatch/adapters/cli.js +0 -276
  454. package/dist/dispatch/adapters/cli.js.map +0 -1
  455. package/dist/dispatch/context/session-context.d.ts +0 -54
  456. package/dist/dispatch/context/session-context.d.ts.map +0 -1
  457. package/dist/dispatch/context/session-context.js +0 -61
  458. package/dist/dispatch/context/session-context.js.map +0 -1
  459. package/dist/dispatch/dispatcher.d.ts +0 -23
  460. package/dist/dispatch/dispatcher.d.ts.map +0 -1
  461. package/dist/dispatch/dispatcher.js +0 -84
  462. package/dist/dispatch/dispatcher.js.map +0 -1
  463. package/dist/dispatch/domains/_base.d.ts +0 -59
  464. package/dist/dispatch/domains/_base.d.ts.map +0 -1
  465. package/dist/dispatch/domains/_base.js +0 -77
  466. package/dist/dispatch/domains/_base.js.map +0 -1
  467. package/dist/dispatch/domains/_meta.d.ts +0 -23
  468. package/dist/dispatch/domains/_meta.d.ts.map +0 -1
  469. package/dist/dispatch/domains/_meta.js +0 -25
  470. package/dist/dispatch/domains/_meta.js.map +0 -1
  471. package/dist/dispatch/domains/_routing.d.ts +0 -8
  472. package/dist/dispatch/domains/_routing.d.ts.map +0 -1
  473. package/dist/dispatch/domains/_routing.js +0 -20
  474. package/dist/dispatch/domains/_routing.js.map +0 -1
  475. package/dist/dispatch/domains/admin.d.ts +0 -25
  476. package/dist/dispatch/domains/admin.d.ts.map +0 -1
  477. package/dist/dispatch/domains/admin.js +0 -719
  478. package/dist/dispatch/domains/admin.js.map +0 -1
  479. package/dist/dispatch/domains/check.d.ts +0 -22
  480. package/dist/dispatch/domains/check.d.ts.map +0 -1
  481. package/dist/dispatch/domains/check.js +0 -360
  482. package/dist/dispatch/domains/check.js.map +0 -1
  483. package/dist/dispatch/domains/conduit.d.ts +0 -38
  484. package/dist/dispatch/domains/conduit.d.ts.map +0 -1
  485. package/dist/dispatch/domains/conduit.js +0 -247
  486. package/dist/dispatch/domains/conduit.js.map +0 -1
  487. package/dist/dispatch/domains/index.d.ts +0 -27
  488. package/dist/dispatch/domains/index.d.ts.map +0 -1
  489. package/dist/dispatch/domains/index.js +0 -40
  490. package/dist/dispatch/domains/index.js.map +0 -1
  491. package/dist/dispatch/domains/memory.d.ts +0 -22
  492. package/dist/dispatch/domains/memory.d.ts.map +0 -1
  493. package/dist/dispatch/domains/memory.js +0 -303
  494. package/dist/dispatch/domains/memory.js.map +0 -1
  495. package/dist/dispatch/domains/nexus.d.ts +0 -22
  496. package/dist/dispatch/domains/nexus.d.ts.map +0 -1
  497. package/dist/dispatch/domains/nexus.js +0 -286
  498. package/dist/dispatch/domains/nexus.js.map +0 -1
  499. package/dist/dispatch/domains/orchestrate.d.ts +0 -19
  500. package/dist/dispatch/domains/orchestrate.d.ts.map +0 -1
  501. package/dist/dispatch/domains/orchestrate.js +0 -259
  502. package/dist/dispatch/domains/orchestrate.js.map +0 -1
  503. package/dist/dispatch/domains/pipeline.d.ts +0 -35
  504. package/dist/dispatch/domains/pipeline.d.ts.map +0 -1
  505. package/dist/dispatch/domains/pipeline.js +0 -593
  506. package/dist/dispatch/domains/pipeline.js.map +0 -1
  507. package/dist/dispatch/domains/session.d.ts +0 -22
  508. package/dist/dispatch/domains/session.d.ts.map +0 -1
  509. package/dist/dispatch/domains/session.js +0 -257
  510. package/dist/dispatch/domains/session.js.map +0 -1
  511. package/dist/dispatch/domains/sticky.d.ts +0 -20
  512. package/dist/dispatch/domains/sticky.d.ts.map +0 -1
  513. package/dist/dispatch/domains/sticky.js +0 -164
  514. package/dist/dispatch/domains/sticky.js.map +0 -1
  515. package/dist/dispatch/domains/tasks.d.ts +0 -25
  516. package/dist/dispatch/domains/tasks.d.ts.map +0 -1
  517. package/dist/dispatch/domains/tasks.js +0 -361
  518. package/dist/dispatch/domains/tasks.js.map +0 -1
  519. package/dist/dispatch/domains/tools.d.ts +0 -37
  520. package/dist/dispatch/domains/tools.d.ts.map +0 -1
  521. package/dist/dispatch/domains/tools.js +0 -481
  522. package/dist/dispatch/domains/tools.js.map +0 -1
  523. package/dist/dispatch/engines/_error.d.ts +0 -119
  524. package/dist/dispatch/engines/_error.d.ts.map +0 -1
  525. package/dist/dispatch/engines/_error.js +0 -288
  526. package/dist/dispatch/engines/_error.js.map +0 -1
  527. package/dist/dispatch/engines/code-engine.d.ts +0 -18
  528. package/dist/dispatch/engines/code-engine.d.ts.map +0 -1
  529. package/dist/dispatch/engines/code-engine.js +0 -71
  530. package/dist/dispatch/engines/code-engine.js.map +0 -1
  531. package/dist/dispatch/engines/codebase-map-engine.d.ts +0 -31
  532. package/dist/dispatch/engines/codebase-map-engine.d.ts.map +0 -1
  533. package/dist/dispatch/engines/codebase-map-engine.js +0 -43
  534. package/dist/dispatch/engines/codebase-map-engine.js.map +0 -1
  535. package/dist/dispatch/engines/config-engine.d.ts +0 -32
  536. package/dist/dispatch/engines/config-engine.d.ts.map +0 -1
  537. package/dist/dispatch/engines/config-engine.js +0 -70
  538. package/dist/dispatch/engines/config-engine.js.map +0 -1
  539. package/dist/dispatch/engines/hooks-engine.d.ts +0 -96
  540. package/dist/dispatch/engines/hooks-engine.d.ts.map +0 -1
  541. package/dist/dispatch/engines/hooks-engine.js +0 -144
  542. package/dist/dispatch/engines/hooks-engine.js.map +0 -1
  543. package/dist/dispatch/engines/init-engine.d.ts +0 -56
  544. package/dist/dispatch/engines/init-engine.d.ts.map +0 -1
  545. package/dist/dispatch/engines/init-engine.js +0 -78
  546. package/dist/dispatch/engines/init-engine.js.map +0 -1
  547. package/dist/dispatch/engines/lifecycle-engine.d.ts +0 -66
  548. package/dist/dispatch/engines/lifecycle-engine.d.ts.map +0 -1
  549. package/dist/dispatch/engines/lifecycle-engine.js +0 -224
  550. package/dist/dispatch/engines/lifecycle-engine.js.map +0 -1
  551. package/dist/dispatch/engines/memory-engine.d.ts +0 -10
  552. package/dist/dispatch/engines/memory-engine.d.ts.map +0 -1
  553. package/dist/dispatch/engines/memory-engine.js +0 -10
  554. package/dist/dispatch/engines/memory-engine.js.map +0 -1
  555. package/dist/dispatch/engines/nexus-engine.d.ts +0 -167
  556. package/dist/dispatch/engines/nexus-engine.d.ts.map +0 -1
  557. package/dist/dispatch/engines/nexus-engine.js +0 -356
  558. package/dist/dispatch/engines/nexus-engine.js.map +0 -1
  559. package/dist/dispatch/engines/orchestrate-engine.d.ts +0 -133
  560. package/dist/dispatch/engines/orchestrate-engine.d.ts.map +0 -1
  561. package/dist/dispatch/engines/orchestrate-engine.js +0 -769
  562. package/dist/dispatch/engines/orchestrate-engine.js.map +0 -1
  563. package/dist/dispatch/engines/pipeline-engine.d.ts +0 -51
  564. package/dist/dispatch/engines/pipeline-engine.d.ts.map +0 -1
  565. package/dist/dispatch/engines/pipeline-engine.js +0 -191
  566. package/dist/dispatch/engines/pipeline-engine.js.map +0 -1
  567. package/dist/dispatch/engines/release-engine.d.ts +0 -94
  568. package/dist/dispatch/engines/release-engine.d.ts.map +0 -1
  569. package/dist/dispatch/engines/release-engine.js +0 -763
  570. package/dist/dispatch/engines/release-engine.js.map +0 -1
  571. package/dist/dispatch/engines/session-engine.d.ts +0 -383
  572. package/dist/dispatch/engines/session-engine.d.ts.map +0 -1
  573. package/dist/dispatch/engines/session-engine.js +0 -910
  574. package/dist/dispatch/engines/session-engine.js.map +0 -1
  575. package/dist/dispatch/engines/sticky-engine.d.ts +0 -100
  576. package/dist/dispatch/engines/sticky-engine.d.ts.map +0 -1
  577. package/dist/dispatch/engines/sticky-engine.js +0 -181
  578. package/dist/dispatch/engines/sticky-engine.js.map +0 -1
  579. package/dist/dispatch/engines/system-engine.d.ts +0 -539
  580. package/dist/dispatch/engines/system-engine.d.ts.map +0 -1
  581. package/dist/dispatch/engines/system-engine.js +0 -1258
  582. package/dist/dispatch/engines/system-engine.js.map +0 -1
  583. package/dist/dispatch/engines/task-engine.d.ts +0 -1055
  584. package/dist/dispatch/engines/task-engine.d.ts.map +0 -1
  585. package/dist/dispatch/engines/task-engine.js +0 -1193
  586. package/dist/dispatch/engines/task-engine.js.map +0 -1
  587. package/dist/dispatch/engines/template-parser.d.ts +0 -85
  588. package/dist/dispatch/engines/template-parser.d.ts.map +0 -1
  589. package/dist/dispatch/engines/template-parser.js +0 -108
  590. package/dist/dispatch/engines/template-parser.js.map +0 -1
  591. package/dist/dispatch/engines/tools-engine.d.ts +0 -270
  592. package/dist/dispatch/engines/tools-engine.d.ts.map +0 -1
  593. package/dist/dispatch/engines/tools-engine.js +0 -636
  594. package/dist/dispatch/engines/tools-engine.js.map +0 -1
  595. package/dist/dispatch/engines/validate-engine.d.ts +0 -218
  596. package/dist/dispatch/engines/validate-engine.d.ts.map +0 -1
  597. package/dist/dispatch/engines/validate-engine.js +0 -737
  598. package/dist/dispatch/engines/validate-engine.js.map +0 -1
  599. package/dist/dispatch/index.d.ts +0 -20
  600. package/dist/dispatch/index.d.ts.map +0 -1
  601. package/dist/dispatch/index.js +0 -19
  602. package/dist/dispatch/index.js.map +0 -1
  603. package/dist/dispatch/lib/background-jobs.d.ts +0 -86
  604. package/dist/dispatch/lib/background-jobs.d.ts.map +0 -1
  605. package/dist/dispatch/lib/background-jobs.js +0 -183
  606. package/dist/dispatch/lib/background-jobs.js.map +0 -1
  607. package/dist/dispatch/lib/budget.d.ts +0 -36
  608. package/dist/dispatch/lib/budget.d.ts.map +0 -1
  609. package/dist/dispatch/lib/budget.js +0 -109
  610. package/dist/dispatch/lib/budget.js.map +0 -1
  611. package/dist/dispatch/lib/capability-matrix.d.ts +0 -11
  612. package/dist/dispatch/lib/capability-matrix.d.ts.map +0 -1
  613. package/dist/dispatch/lib/capability-matrix.js +0 -10
  614. package/dist/dispatch/lib/capability-matrix.js.map +0 -1
  615. package/dist/dispatch/lib/config-loader.d.ts +0 -42
  616. package/dist/dispatch/lib/config-loader.d.ts.map +0 -1
  617. package/dist/dispatch/lib/config-loader.js +0 -217
  618. package/dist/dispatch/lib/config-loader.js.map +0 -1
  619. package/dist/dispatch/lib/config.d.ts +0 -11
  620. package/dist/dispatch/lib/config.d.ts.map +0 -1
  621. package/dist/dispatch/lib/config.js +0 -10
  622. package/dist/dispatch/lib/config.js.map +0 -1
  623. package/dist/dispatch/lib/defaults.d.ts +0 -115
  624. package/dist/dispatch/lib/defaults.d.ts.map +0 -1
  625. package/dist/dispatch/lib/defaults.js +0 -61
  626. package/dist/dispatch/lib/defaults.js.map +0 -1
  627. package/dist/dispatch/lib/engine.d.ts +0 -26
  628. package/dist/dispatch/lib/engine.d.ts.map +0 -1
  629. package/dist/dispatch/lib/engine.js +0 -46
  630. package/dist/dispatch/lib/engine.js.map +0 -1
  631. package/dist/dispatch/lib/exit-codes.d.ts +0 -35
  632. package/dist/dispatch/lib/exit-codes.d.ts.map +0 -1
  633. package/dist/dispatch/lib/exit-codes.js +0 -60
  634. package/dist/dispatch/lib/exit-codes.js.map +0 -1
  635. package/dist/dispatch/lib/gateway-meta.d.ts +0 -37
  636. package/dist/dispatch/lib/gateway-meta.d.ts.map +0 -1
  637. package/dist/dispatch/lib/gateway-meta.js +0 -50
  638. package/dist/dispatch/lib/gateway-meta.js.map +0 -1
  639. package/dist/dispatch/lib/job-manager-accessor.d.ts +0 -9
  640. package/dist/dispatch/lib/job-manager-accessor.d.ts.map +0 -1
  641. package/dist/dispatch/lib/job-manager-accessor.js +0 -13
  642. package/dist/dispatch/lib/job-manager-accessor.js.map +0 -1
  643. package/dist/dispatch/lib/meta.d.ts +0 -26
  644. package/dist/dispatch/lib/meta.d.ts.map +0 -1
  645. package/dist/dispatch/lib/meta.js +0 -37
  646. package/dist/dispatch/lib/meta.js.map +0 -1
  647. package/dist/dispatch/lib/param-utils.d.ts +0 -11
  648. package/dist/dispatch/lib/param-utils.d.ts.map +0 -1
  649. package/dist/dispatch/lib/param-utils.js +0 -10
  650. package/dist/dispatch/lib/param-utils.js.map +0 -1
  651. package/dist/dispatch/lib/projections.d.ts +0 -56
  652. package/dist/dispatch/lib/projections.d.ts.map +0 -1
  653. package/dist/dispatch/lib/projections.js +0 -65
  654. package/dist/dispatch/lib/projections.js.map +0 -1
  655. package/dist/dispatch/lib/proto-envelope.d.ts +0 -56
  656. package/dist/dispatch/lib/proto-envelope.d.ts.map +0 -1
  657. package/dist/dispatch/lib/proto-envelope.js +0 -17
  658. package/dist/dispatch/lib/proto-envelope.js.map +0 -1
  659. package/dist/dispatch/lib/schema-utils.d.ts +0 -39
  660. package/dist/dispatch/lib/schema-utils.d.ts.map +0 -1
  661. package/dist/dispatch/lib/schema-utils.js +0 -88
  662. package/dist/dispatch/lib/schema-utils.js.map +0 -1
  663. package/dist/dispatch/lib/security.d.ts +0 -11
  664. package/dist/dispatch/lib/security.d.ts.map +0 -1
  665. package/dist/dispatch/lib/security.js +0 -10
  666. package/dist/dispatch/lib/security.js.map +0 -1
  667. package/dist/dispatch/middleware/audit.d.ts +0 -23
  668. package/dist/dispatch/middleware/audit.d.ts.map +0 -1
  669. package/dist/dispatch/middleware/audit.js +0 -169
  670. package/dist/dispatch/middleware/audit.js.map +0 -1
  671. package/dist/dispatch/middleware/field-filter.d.ts +0 -25
  672. package/dist/dispatch/middleware/field-filter.d.ts.map +0 -1
  673. package/dist/dispatch/middleware/field-filter.js +0 -70
  674. package/dist/dispatch/middleware/field-filter.js.map +0 -1
  675. package/dist/dispatch/middleware/pipeline.d.ts +0 -33
  676. package/dist/dispatch/middleware/pipeline.d.ts.map +0 -1
  677. package/dist/dispatch/middleware/pipeline.js +0 -60
  678. package/dist/dispatch/middleware/pipeline.js.map +0 -1
  679. package/dist/dispatch/middleware/projection.d.ts +0 -35
  680. package/dist/dispatch/middleware/projection.d.ts.map +0 -1
  681. package/dist/dispatch/middleware/projection.js +0 -146
  682. package/dist/dispatch/middleware/projection.js.map +0 -1
  683. package/dist/dispatch/middleware/protocol-enforcement.d.ts +0 -30
  684. package/dist/dispatch/middleware/protocol-enforcement.d.ts.map +0 -1
  685. package/dist/dispatch/middleware/protocol-enforcement.js +0 -56
  686. package/dist/dispatch/middleware/protocol-enforcement.js.map +0 -1
  687. package/dist/dispatch/middleware/rate-limiter.d.ts +0 -72
  688. package/dist/dispatch/middleware/rate-limiter.d.ts.map +0 -1
  689. package/dist/dispatch/middleware/rate-limiter.js +0 -127
  690. package/dist/dispatch/middleware/rate-limiter.js.map +0 -1
  691. package/dist/dispatch/middleware/sanitizer.d.ts +0 -24
  692. package/dist/dispatch/middleware/sanitizer.d.ts.map +0 -1
  693. package/dist/dispatch/middleware/sanitizer.js +0 -56
  694. package/dist/dispatch/middleware/sanitizer.js.map +0 -1
  695. package/dist/dispatch/middleware/session-resolver.d.ts +0 -26
  696. package/dist/dispatch/middleware/session-resolver.d.ts.map +0 -1
  697. package/dist/dispatch/middleware/session-resolver.js +0 -65
  698. package/dist/dispatch/middleware/session-resolver.js.map +0 -1
  699. package/dist/dispatch/middleware/verification-gates.d.ts +0 -22
  700. package/dist/dispatch/middleware/verification-gates.d.ts.map +0 -1
  701. package/dist/dispatch/middleware/verification-gates.js +0 -59
  702. package/dist/dispatch/middleware/verification-gates.js.map +0 -1
  703. package/dist/dispatch/registry.d.ts +0 -91
  704. package/dist/dispatch/registry.d.ts.map +0 -1
  705. package/dist/dispatch/registry.js +0 -3133
  706. package/dist/dispatch/registry.js.map +0 -1
  707. package/dist/dispatch/types.d.ts +0 -206
  708. package/dist/dispatch/types.d.ts.map +0 -1
  709. package/dist/dispatch/types.js +0 -26
  710. package/dist/dispatch/types.js.map +0 -1
@@ -1,262 +0,0 @@
1
- import { randomUUID } from 'node:crypto';
2
- /**
3
- * Generate a request UUID for error envelopes.
4
- * Extracted to keep the hot path synchronous.
5
- *
6
- * @internal
7
- */
8
- function generateRequestId() {
9
- return randomUUID();
10
- }
11
- /**
12
- * Central output dispatch for V2 CLI commands.
13
- *
14
- * Provides cliOutput() which replaces `console.log(formatSuccess(data))`.
15
- * Checks the resolved format (JSON/human/quiet) and dispatches to either
16
- * the LAFS JSON envelope (formatSuccess) or a human-readable renderer.
17
- *
18
- * Commands call:
19
- * cliOutput(data, { command: 'show', message, operation, page })
20
- *
21
- * @task T4665
22
- * @task T4666
23
- * @task T4813
24
- * @epic T4663
25
- */
26
- import { formatSuccess } from '@cleocode/core';
27
- import { applyFieldFilter, extractFieldFromResult } from '@cleocode/lafs';
28
- import { getFieldContext } from '../field-context.js';
29
- import { getFormatContext } from '../format-context.js';
30
- import { emitLafsViolation, LafsViolationError, validateLafsShape } from './lafs-validator.js';
31
- import { normalizeForHuman } from './normalizer.js';
32
- // System renderers
33
- import { renderBlockers, renderCurrent, renderDoctor, renderGeneric, renderNext, renderPlan, renderSession, renderStart, renderStats, renderStop, renderTree, renderVersion, } from './system.js';
34
- // Task renderers
35
- import { renderAdd, renderArchive, renderComplete, renderDelete, renderFind, renderList, renderRestore, renderShow, renderUpdate, } from './tasks.js';
36
- const renderers = {
37
- // Task CRUD
38
- show: renderShow,
39
- list: renderList,
40
- ls: renderList,
41
- find: renderFind,
42
- search: renderFind,
43
- add: renderAdd,
44
- update: renderUpdate,
45
- complete: renderComplete,
46
- done: renderComplete,
47
- delete: renderDelete,
48
- rm: renderDelete,
49
- archive: renderArchive,
50
- restore: renderRestore,
51
- // Task work
52
- start: renderStart,
53
- stop: renderStop,
54
- current: renderCurrent,
55
- // System
56
- doctor: renderDoctor,
57
- stats: renderStats,
58
- next: renderNext,
59
- plan: renderPlan,
60
- blockers: renderBlockers,
61
- tree: renderTree,
62
- depends: renderTree,
63
- deps: renderTree,
64
- session: renderSession,
65
- version: renderVersion,
66
- };
67
- // ---------------------------------------------------------------------------
68
- // Main output function
69
- // ---------------------------------------------------------------------------
70
- /**
71
- * Output data to stdout in the resolved format (JSON or human-readable).
72
- *
73
- * Replaces `console.log(formatSuccess(data))` in all V2 commands.
74
- * When format is 'human', normalizes the data shape then dispatches to
75
- * the appropriate renderer.
76
- * When format is 'json', delegates to existing formatSuccess().
77
- *
78
- * @task T4665
79
- * @task T4666
80
- * @task T4813
81
- */
82
- export function cliOutput(data, opts) {
83
- const ctx = getFormatContext();
84
- const fieldCtx = getFieldContext();
85
- if (ctx.format === 'human') {
86
- let dataToRender = data;
87
- // §5.4.1 filter-then-render: apply --field extraction BEFORE human rendering
88
- let fieldExtracted = false;
89
- if (fieldCtx.field) {
90
- const extracted = extractFieldFromResult(data, fieldCtx.field);
91
- if (extracted === undefined) {
92
- cliError(`Field "${fieldCtx.field}" not found`, 4, { name: 'E_NOT_FOUND' });
93
- process.exit(4);
94
- }
95
- // If extracted is a primitive, render directly
96
- if (typeof extracted !== 'object' || extracted === null) {
97
- console.log(String(extracted));
98
- return;
99
- }
100
- // If extracted is an array, wrap it for renderGeneric
101
- if (Array.isArray(extracted)) {
102
- dataToRender = { [fieldCtx.field]: extracted };
103
- }
104
- else {
105
- dataToRender = extracted;
106
- }
107
- fieldExtracted = true;
108
- }
109
- const normalized = normalizeForHuman(opts.command, dataToRender);
110
- // After field extraction, use renderGeneric — command-specific renderers
111
- // expect the full data structure, not a filtered subset (§5.4.1)
112
- const renderer = fieldExtracted ? renderGeneric : (renderers[opts.command] ?? renderGeneric);
113
- const text = renderer(normalized, ctx.quiet);
114
- if (text) {
115
- console.log(text);
116
- }
117
- return;
118
- }
119
- // --field: single-field plain text extraction (scripting / agent use).
120
- // Centralised here so ALL commands (dispatchFromCli and dispatchRaw) honour the flag.
121
- if (fieldCtx.field) {
122
- // extractFieldFromResult operates on the data payload (not the envelope).
123
- // Cast to the proto-envelope result type for the SDK call.
124
- const value = extractFieldFromResult(data, fieldCtx.field);
125
- if (value === undefined) {
126
- cliError(`Field "${fieldCtx.field}" not found`, 4, { name: 'E_NOT_FOUND' });
127
- process.exit(4);
128
- }
129
- const out = value !== null && typeof value === 'object' ? JSON.stringify(value) : String(value);
130
- process.stdout.write(out + '\n');
131
- return;
132
- }
133
- // JSON format (default): apply --fields filter, then emit canonical CLI envelope.
134
- // Centralised here so ALL commands honour the flag without per-command wiring.
135
- // applyFieldFilter can throw on unusual mixed-type arrays (e.g. changes: ['status']).
136
- // In that case we fall back to unfiltered output rather than crashing.
137
- let filteredData = data;
138
- if (fieldCtx.fields?.length && data !== undefined && data !== null) {
139
- try {
140
- // Build a proto-envelope stub to drive the SDK field filter (ADR-039 bridge).
141
- const stub = {
142
- $schema: 'https://lafs.dev/schemas/v1/envelope.schema.json',
143
- _meta: {
144
- specVersion: '',
145
- schemaVersion: '',
146
- timestamp: '',
147
- operation: '',
148
- requestId: '',
149
- transport: 'cli',
150
- strict: false,
151
- mvi: 'standard',
152
- contextVersion: 0,
153
- },
154
- success: true,
155
- result: data,
156
- };
157
- const filtered = applyFieldFilter(stub, fieldCtx.fields);
158
- filteredData = filtered.result;
159
- }
160
- catch {
161
- // applyFieldFilter limitation: mixed-type arrays (strings inside arrays) are not
162
- // supported. Fall through to emit the full unfiltered result.
163
- }
164
- }
165
- // Build FormatOptions for formatSuccess (now emits canonical CliEnvelope shape).
166
- const formatOpts = {};
167
- if (opts.operation)
168
- formatOpts.operation = opts.operation;
169
- if (opts.page)
170
- formatOpts.page = opts.page;
171
- if (opts.extensions)
172
- formatOpts.extensions = opts.extensions;
173
- if (fieldCtx.mvi)
174
- formatOpts.mvi = fieldCtx.mvi;
175
- // Phase 6 — LAFS envelope validation middleware.
176
- // Every CLI output flows through `formatSuccess()` → string. We parse the
177
- // string, assert the shape invariants, and only emit if validation passes.
178
- // A shape violation is a CLEO developer bug, so we:
179
- // 1. Emit a valid LAFS error envelope to stderr describing the violation
180
- // 2. Set process.exitCode to ExitCode.LAFS_VIOLATION (104)
181
- // 3. Still emit the (invalid) original to stdout so operators can inspect
182
- // This is a safety net — it never SILENTLY swallows output.
183
- const envelopeString = formatSuccess(filteredData, opts.message, Object.keys(formatOpts).length > 0 ? formatOpts : opts.operation);
184
- if (process.env['CLEO_LAFS_VALIDATE'] !== 'off') {
185
- try {
186
- const report = validateLafsShape(envelopeString);
187
- if (report.reasons.length > 0) {
188
- emitLafsViolation(new LafsViolationError(`cliOutput: envelope failed LAFS shape validation`, report));
189
- }
190
- }
191
- catch (err) {
192
- if (err instanceof LafsViolationError) {
193
- emitLafsViolation(err);
194
- }
195
- // Non-validator errors — re-raise so tests can see them
196
- }
197
- }
198
- console.log(envelopeString);
199
- }
200
- /**
201
- * Output an error in the resolved format.
202
- *
203
- * In JSON format (default / agent mode): emits a canonical `CliEnvelope` error
204
- * envelope to stdout. The envelope always includes `meta` (ADR-039).
205
- * All optional fields (`codeName`, `fix`, `alternatives`, `details`) are
206
- * included only when they are actually present — no `undefined` keys are emitted.
207
- *
208
- * In human format: prints a plain error line to stderr and, when
209
- * `details.fix` is a string, appends a `Fix: <hint>` line.
210
- *
211
- * @param message - Human-readable error message.
212
- * @param code - Numeric exit code or string error code.
213
- * @param details - Optional structured details (codeName, fix, alternatives, …).
214
- * @param meta - Optional partial meta to merge into the error envelope.
215
- *
216
- * @task T4666
217
- * @task T4813
218
- * @task T336
219
- * @task T338
220
- */
221
- export function cliError(message, code, details, meta) {
222
- const ctx = getFormatContext();
223
- if (ctx.format === 'human') {
224
- console.error(`Error: ${message}${code ? ` (${code})` : ''}`);
225
- if (typeof details?.fix === 'string') {
226
- console.error(`Fix: ${details.fix}`);
227
- }
228
- return;
229
- }
230
- // JSON envelope always goes to stdout for consistent machine-readable output.
231
- // Build the error object incrementally so that absent optional fields are
232
- // never serialised as `undefined` (which JSON.stringify would strip anyway,
233
- // but being explicit keeps the intent clear and avoids lint warnings).
234
- const errorObj = {
235
- code: code ?? 1,
236
- message,
237
- };
238
- if (details?.name !== undefined)
239
- errorObj['codeName'] = details.name;
240
- if (details?.fix !== undefined)
241
- errorObj['fix'] = details.fix;
242
- if (details?.alternatives !== undefined)
243
- errorObj['alternatives'] = details.alternatives;
244
- if (details?.details !== undefined)
245
- errorObj['details'] = details.details;
246
- // Canonical error envelope: {success, error, meta} — meta is ALWAYS present.
247
- // Merge caller-supplied meta with defaults (ADR-039).
248
- const errorMeta = {
249
- operation: meta?.operation ?? 'cli.error',
250
- requestId: meta?.requestId ?? generateRequestId(),
251
- duration_ms: meta?.duration_ms ?? 0,
252
- timestamp: meta?.timestamp ?? new Date().toISOString(),
253
- ...meta,
254
- };
255
- const envelope = {
256
- success: false,
257
- error: errorObj,
258
- meta: errorMeta,
259
- };
260
- console.log(JSON.stringify(envelope));
261
- }
262
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/renderers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;GAKG;AACH,SAAS,iBAAiB;IACxB,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAsB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,mBAAmB;AACnB,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,iBAAiB;AACjB,OAAO,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,UAAU,EACV,YAAY,GACb,MAAM,YAAY,CAAC;AAQpB,MAAM,SAAS,GAAkC;IAC/C,YAAY;IACZ,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,UAAU;IAClB,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,cAAc;IACxB,IAAI,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IAEF,MAAM,QAAQ,GAAuB;QACnC,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,QAAqD;QAC5D,IAAI,EAAE,SAAS;KAChB,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -1,91 +0,0 @@
1
- /**
2
- * CLI envelope validator middleware (Phase 6 / ADR-039 update).
3
- *
4
- * Every CLI envelope emitted by `cliOutput()` flows through this module
5
- * before hitting stdout. Validates the **canonical CLI envelope** shape
6
- * (`{success, data?, error?, meta, page?}`) as defined in ADR-039.
7
- *
8
- * The canonical shape replaces the three legacy shapes:
9
- * - `{ok, r, _m}` (minimal MVI — removed)
10
- * - `{$schema, _meta, success, result}` (full LAFS — migrated)
11
- * - `{success, result}` (observe command — migrated)
12
- *
13
- * Validation invariants:
14
- * - Envelope MUST be a JSON object
15
- * - `success` MUST be present and boolean
16
- * - On success, `data` MUST exist (may be null)
17
- * - On failure, `error` MUST exist with at least `code` and `message`
18
- * - `meta` MUST be present (always — success and failure)
19
- *
20
- * When a violation is detected, the validator:
21
- * 1. Wraps the malformed output in a valid error envelope
22
- * 2. Sets the process exit code to `ExitCode.LAFS_VIOLATION` (104)
23
- * 3. Emits the wrapped envelope to stderr for diagnostic tooling
24
- *
25
- * @task Phase 6 — LAFS formalization + schema consolidation
26
- * @task T338 — ADR-039 canonical envelope unification
27
- */
28
- import { ExitCode } from '@cleocode/contracts';
29
- /**
30
- * Shape violation report for a canonical CLI envelope.
31
- *
32
- * Carries the individual invariant results so diagnostic tooling can
33
- * report exactly which invariants were violated.
34
- */
35
- export interface LafsShapeViolation {
36
- /** True iff the input is a well-formed JSON object. */
37
- isObject: boolean;
38
- /** True iff `success` is present. */
39
- hasSuccessField: boolean;
40
- /** True iff `success` is a boolean. */
41
- successIsBoolean: boolean;
42
- /** True iff `meta` is present (always required — ADR-039). */
43
- hasMeta: boolean;
44
- /** True iff the data/error invariants hold for the indicated success value. */
45
- resultOrErrorValid: boolean;
46
- /** Human-readable reasons the envelope failed validation (empty = valid). */
47
- reasons: string[];
48
- }
49
- /**
50
- * Validate a canonical CLI envelope shape and report violations.
51
- *
52
- * Validates the unified `{success, data?, error?, meta, page?}` shape
53
- * defined in ADR-039. All three legacy shapes (`{ok,r,_m}`,
54
- * `{$schema,_meta,success,result}`, `{success,result}`) are now invalid
55
- * and will produce violation reports.
56
- *
57
- * @param envelope - The candidate envelope (serialized string or parsed object).
58
- * @returns A `LafsShapeViolation` report. `.reasons.length === 0` when valid.
59
- */
60
- export declare function validateLafsShape(envelope: unknown): LafsShapeViolation;
61
- /**
62
- * Assert that a LAFS envelope conforms to the shape contract, throwing
63
- * an error with a LAFS-shaped diagnostic if it does not.
64
- *
65
- * Used by the renderer middleware to fail LOUDLY when CLEO itself emits
66
- * a malformed envelope — this is a developer bug, not an operator issue.
67
- *
68
- * @param envelope - The candidate envelope
69
- * @throws `LafsViolationError` if the envelope fails any shape invariant
70
- */
71
- export declare function assertLafsShape(envelope: unknown): void;
72
- /**
73
- * Error thrown by `assertLafsShape` when an envelope fails validation.
74
- *
75
- * Carries the full `LafsShapeViolation` report so diagnostic tooling can
76
- * report which specific invariants were violated.
77
- */
78
- export declare class LafsViolationError extends Error {
79
- readonly code = ExitCode.LAFS_VIOLATION;
80
- readonly report: LafsShapeViolation;
81
- constructor(message: string, report: LafsShapeViolation);
82
- }
83
- /**
84
- * Emit a LAFS-shaped error envelope describing a validation failure and
85
- * set `process.exitCode` to `ExitCode.LAFS_VIOLATION`.
86
- *
87
- * Called by the renderer middleware as a recovery path when a previously-
88
- * emitted envelope turns out to be malformed.
89
- */
90
- export declare function emitLafsViolation(err: LafsViolationError): void;
91
- //# sourceMappingURL=lafs-validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lafs-validator.d.ts","sourceRoot":"","sources":["../../../src/cli/renderers/lafs-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,uDAAuD;IACvD,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,eAAe,EAAE,OAAO,CAAC;IACzB,uCAAuC;IACvC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,+EAA+E;IAC/E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,CAqFvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAQvD;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,2BAA2B;IACxC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB;CAKxD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI,CAqB/D"}
@@ -1,176 +0,0 @@
1
- /**
2
- * CLI envelope validator middleware (Phase 6 / ADR-039 update).
3
- *
4
- * Every CLI envelope emitted by `cliOutput()` flows through this module
5
- * before hitting stdout. Validates the **canonical CLI envelope** shape
6
- * (`{success, data?, error?, meta, page?}`) as defined in ADR-039.
7
- *
8
- * The canonical shape replaces the three legacy shapes:
9
- * - `{ok, r, _m}` (minimal MVI — removed)
10
- * - `{$schema, _meta, success, result}` (full LAFS — migrated)
11
- * - `{success, result}` (observe command — migrated)
12
- *
13
- * Validation invariants:
14
- * - Envelope MUST be a JSON object
15
- * - `success` MUST be present and boolean
16
- * - On success, `data` MUST exist (may be null)
17
- * - On failure, `error` MUST exist with at least `code` and `message`
18
- * - `meta` MUST be present (always — success and failure)
19
- *
20
- * When a violation is detected, the validator:
21
- * 1. Wraps the malformed output in a valid error envelope
22
- * 2. Sets the process exit code to `ExitCode.LAFS_VIOLATION` (104)
23
- * 3. Emits the wrapped envelope to stderr for diagnostic tooling
24
- *
25
- * @task Phase 6 — LAFS formalization + schema consolidation
26
- * @task T338 — ADR-039 canonical envelope unification
27
- */
28
- import { ExitCode } from '@cleocode/contracts';
29
- const ENVELOPE_SUCCESS_KEY = 'success';
30
- const ENVELOPE_DATA_KEY = 'data';
31
- const ENVELOPE_META_KEY = 'meta';
32
- /**
33
- * Validate a canonical CLI envelope shape and report violations.
34
- *
35
- * Validates the unified `{success, data?, error?, meta, page?}` shape
36
- * defined in ADR-039. All three legacy shapes (`{ok,r,_m}`,
37
- * `{$schema,_meta,success,result}`, `{success,result}`) are now invalid
38
- * and will produce violation reports.
39
- *
40
- * @param envelope - The candidate envelope (serialized string or parsed object).
41
- * @returns A `LafsShapeViolation` report. `.reasons.length === 0` when valid.
42
- */
43
- export function validateLafsShape(envelope) {
44
- const report = {
45
- isObject: false,
46
- hasSuccessField: false,
47
- successIsBoolean: false,
48
- hasMeta: false,
49
- resultOrErrorValid: false,
50
- reasons: [],
51
- };
52
- // Allow callers to pass either a serialized envelope or a parsed one
53
- let parsed = envelope;
54
- if (typeof envelope === 'string') {
55
- try {
56
- parsed = JSON.parse(envelope);
57
- }
58
- catch {
59
- report.reasons.push('Envelope is not valid JSON');
60
- return report;
61
- }
62
- }
63
- if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
64
- report.reasons.push('Envelope is not a JSON object');
65
- return report;
66
- }
67
- report.isObject = true;
68
- const obj = parsed;
69
- // Success-indicator field presence (`success`, not legacy `ok`)
70
- if (!(ENVELOPE_SUCCESS_KEY in obj)) {
71
- report.reasons.push(`Envelope missing success indicator — expected: "${ENVELOPE_SUCCESS_KEY}"`);
72
- return report;
73
- }
74
- report.hasSuccessField = true;
75
- const successValue = obj[ENVELOPE_SUCCESS_KEY];
76
- if (typeof successValue !== 'boolean') {
77
- report.reasons.push(`Envelope "${ENVELOPE_SUCCESS_KEY}" field must be boolean, got ${typeof successValue}`);
78
- return report;
79
- }
80
- report.successIsBoolean = true;
81
- // `meta` MUST be present and an object on every envelope (ADR-039)
82
- report.hasMeta = ENVELOPE_META_KEY in obj && typeof obj[ENVELOPE_META_KEY] === 'object';
83
- if (!report.hasMeta) {
84
- report.reasons.push(`Envelope missing required "${ENVELOPE_META_KEY}" object (ADR-039 — every envelope must carry meta)`);
85
- }
86
- // Success / error invariants
87
- if (successValue === true) {
88
- // Successful envelopes carry `data` (not legacy `result` or `r`)
89
- const hasData = ENVELOPE_DATA_KEY in obj;
90
- if (!hasData) {
91
- report.reasons.push(`Successful envelope missing "${ENVELOPE_DATA_KEY}" field (legacy "result" / "r" are no longer valid — ADR-039)`);
92
- }
93
- else {
94
- report.resultOrErrorValid = true;
95
- }
96
- }
97
- else {
98
- const errorField = obj['error'];
99
- if (typeof errorField !== 'object' || errorField === null) {
100
- report.reasons.push('Failed envelope missing "error" object');
101
- }
102
- else {
103
- const err = errorField;
104
- const hasCode = 'code' in err;
105
- const hasMessage = 'message' in err && typeof err['message'] === 'string';
106
- if (!hasCode || !hasMessage) {
107
- report.reasons.push('Failed envelope "error" object must contain "code" and "message" (string)');
108
- }
109
- else {
110
- report.resultOrErrorValid = true;
111
- }
112
- }
113
- }
114
- return report;
115
- }
116
- /**
117
- * Assert that a LAFS envelope conforms to the shape contract, throwing
118
- * an error with a LAFS-shaped diagnostic if it does not.
119
- *
120
- * Used by the renderer middleware to fail LOUDLY when CLEO itself emits
121
- * a malformed envelope — this is a developer bug, not an operator issue.
122
- *
123
- * @param envelope - The candidate envelope
124
- * @throws `LafsViolationError` if the envelope fails any shape invariant
125
- */
126
- export function assertLafsShape(envelope) {
127
- const report = validateLafsShape(envelope);
128
- if (report.reasons.length > 0) {
129
- throw new LafsViolationError(`LAFS envelope shape violation: ${report.reasons.join('; ')}`, report);
130
- }
131
- }
132
- /**
133
- * Error thrown by `assertLafsShape` when an envelope fails validation.
134
- *
135
- * Carries the full `LafsShapeViolation` report so diagnostic tooling can
136
- * report which specific invariants were violated.
137
- */
138
- export class LafsViolationError extends Error {
139
- code = ExitCode.LAFS_VIOLATION;
140
- report;
141
- constructor(message, report) {
142
- super(message);
143
- this.name = 'LafsViolationError';
144
- this.report = report;
145
- }
146
- }
147
- /**
148
- * Emit a LAFS-shaped error envelope describing a validation failure and
149
- * set `process.exitCode` to `ExitCode.LAFS_VIOLATION`.
150
- *
151
- * Called by the renderer middleware as a recovery path when a previously-
152
- * emitted envelope turns out to be malformed.
153
- */
154
- export function emitLafsViolation(err) {
155
- // Emit canonical CLI envelope shape (ADR-039) even for violation errors
156
- const envelope = {
157
- success: false,
158
- error: {
159
- code: ExitCode.LAFS_VIOLATION,
160
- codeName: 'E_LAFS_VIOLATION',
161
- message: err.message,
162
- details: {
163
- report: err.report,
164
- },
165
- },
166
- meta: {
167
- operation: 'cli.lafs-validator',
168
- requestId: 'lafs-validator-emit',
169
- duration_ms: 0,
170
- timestamp: new Date().toISOString(),
171
- },
172
- };
173
- process.stderr.write(`${JSON.stringify(envelope)}\n`);
174
- process.exitCode = ExitCode.LAFS_VIOLATION;
175
- }
176
- //# sourceMappingURL=lafs-validator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lafs-validator.js","sourceRoot":"","sources":["../../../src/cli/renderers/lafs-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAuB/C,MAAM,oBAAoB,GAAG,SAAS,CAAC;AACvC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC;;;;;;;;;;GAUG;AACH,MA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CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC;AAC7C,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * CLI Rendering Normalizer — safety net for human-readable output.
3
- *
4
- * Ensures data passed to human renderers has the expected shape,
5
- * regardless of whether the engine layer has been fully fixed.
6
- * Only called for human format — JSON output is untouched.
7
- *
8
- * Detection is idempotent: if data already has the expected key,
9
- * it passes through unchanged.
10
- *
11
- * @task T4813
12
- */
13
- /**
14
- * Normalize data shape for human renderers.
15
- *
16
- * Each command expects data with specific named keys (e.g., `data.task`
17
- * for 'show', `data.tasks` for 'list'). This function detects and
18
- * corrects flat/array data from the engine layer.
19
- */
20
- export declare function normalizeForHuman(command: string, data: Record<string, unknown>): Record<string, unknown>;
21
- //# sourceMappingURL=normalizer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizer.d.ts","sourceRoot":"","sources":["../../../src/cli/renderers/normalizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiCzB"}