@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 +0,0 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/dispatch/middleware/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAmD,UAAU,EAAE,MAAM,aAAa,CAAC;AAkB/F,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAqF1D;;;GAGG;AACH,wBAAgB,WAAW,IAAI,UAAU,CAkExC;AAGD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,169 +0,0 @@
1
- /**
2
- * Audit Trail Middleware for CQRS Dispatch Layer.
3
- *
4
- * Dual-writes every audited operation to:
5
- * 1. Pino structured log (subsystem: 'audit') -> .cleo/logs/cleo.log
6
- * 2. SQLite audit_log table -> .cleo/tasks.db
7
- *
8
- * Legacy JSON file logging (.cleo/audit-log.json + rotated audit-log-*.json)
9
- * has been removed per ADR-019.
10
- *
11
- * @task T2920
12
- * @task T2929
13
- * @task T4844
14
- */
15
- import { getLogger, getProjectInfoSync } from '@cleocode/core/internal';
16
- import { getConfig } from '../lib/config.js';
17
- const log = getLogger('audit');
18
- /** Cached project hash — read once from project-info.json (immutable at runtime). */
19
- let cachedProjectHash;
20
- function resolveProjectHash() {
21
- if (cachedProjectHash !== undefined)
22
- return cachedProjectHash;
23
- try {
24
- const info = getProjectInfoSync();
25
- cachedProjectHash = info?.projectHash ?? null;
26
- }
27
- catch {
28
- cachedProjectHash = null;
29
- }
30
- return cachedProjectHash;
31
- }
32
- /**
33
- * Check if the current context is a grade session.
34
- *
35
- * Now simplified: session-resolver middleware (T4959) populates request.sessionId
36
- * before audit runs, so we only need to check grade mode flags.
37
- */
38
- function isGradeMode() {
39
- return process.env.CLEO_SESSION_GRADE === 'true';
40
- }
41
- /**
42
- * Get active session info from SQLite or env vars.
43
- *
44
- * Session-resolver middleware (T4959) now populates request.sessionId.
45
- * This function is retained as a fallback for edge cases where
46
- * session-resolver is not in the pipeline (e.g., tests, legacy callers).
47
- */
48
- async function getActiveSessionInfo() {
49
- const gradeId = process.env.CLEO_SESSION_GRADE_ID;
50
- if (gradeId && process.env.CLEO_SESSION_GRADE === 'true') {
51
- return { id: gradeId, gradeMode: true };
52
- }
53
- const envId = process.env.CLEO_SESSION_ID;
54
- if (envId) {
55
- return { id: envId, gradeMode: false };
56
- }
57
- return null;
58
- }
59
- /**
60
- * Write audit entry to SQLite audit_log table.
61
- * Validates the payload with Zod before inserting.
62
- * Fire-and-forget — errors are logged to Pino but never thrown.
63
- *
64
- * @task T4848
65
- */
66
- async function writeToSqlite(entry, requestId) {
67
- try {
68
- const { getDb } = await import('@cleocode/core/internal');
69
- const { auditLog } = await import('@cleocode/core/internal');
70
- const { AuditLogInsertSchema } = await import('@cleocode/core/internal');
71
- const { randomUUID } = await import('node:crypto');
72
- const payload = {
73
- id: randomUUID(),
74
- timestamp: entry.timestamp,
75
- action: entry.operation,
76
- taskId: entry.metadata.taskId ?? 'system',
77
- actor: entry.metadata.userId ?? 'agent',
78
- detailsJson: JSON.stringify(entry.params),
79
- // Dispatch-level columns (ADR-019)
80
- domain: entry.domain,
81
- operation: entry.operation,
82
- sessionId: entry.sessionId,
83
- requestId: requestId ?? null,
84
- durationMs: entry.result.duration,
85
- success: entry.result.success ? 1 : 0,
86
- source: entry.metadata.source,
87
- gateway: entry.metadata.gateway ?? null,
88
- errorMessage: entry.error ?? null,
89
- // Project correlation (T5337)
90
- projectHash: resolveProjectHash(),
91
- };
92
- // Validate payload before insert (T4848)
93
- const parsed = AuditLogInsertSchema.safeParse(payload);
94
- if (!parsed.success) {
95
- log.warn({ issues: parsed.error.issues }, 'Audit payload failed Zod validation; skipping insert');
96
- return;
97
- }
98
- const db = await getDb(process.cwd());
99
- await db.insert(auditLog).values(parsed.data).run();
100
- }
101
- catch (err) {
102
- log.warn({ err }, 'Failed to write audit entry to SQLite');
103
- }
104
- }
105
- /**
106
- * Creates an audit middleware that logs all mutate operations
107
- * (and query operations during grade sessions) to Pino + SQLite.
108
- */
109
- export function createAudit() {
110
- return async (req, next) => {
111
- const startTime = Date.now();
112
- // T4959: session-resolver middleware now populates req.sessionId before
113
- // audit runs. Fall back to legacy lookup only if resolver missed it.
114
- const currentSessionId = req.sessionId ?? (await getActiveSessionInfo())?.id ?? null;
115
- const isGradeSession = isGradeMode();
116
- const response = await next();
117
- // Audit mutations always; audit queries only during grade sessions
118
- const shouldAudit = req.gateway === 'mutate' || (req.gateway === 'query' && isGradeSession);
119
- if (!shouldAudit)
120
- return response;
121
- // Check if audit logging is enabled
122
- const config = getConfig();
123
- if (!config.auditLog)
124
- return response;
125
- const entry = {
126
- timestamp: new Date().toISOString(),
127
- sessionId: currentSessionId,
128
- domain: req.domain,
129
- operation: req.operation,
130
- params: req.params || {},
131
- result: {
132
- success: response.success,
133
- exitCode: response.error?.exitCode || 0,
134
- duration: Date.now() - startTime,
135
- },
136
- metadata: {
137
- taskId: req.params?.taskId || req.params?.parent,
138
- source: req.source,
139
- gateway: req.gateway,
140
- },
141
- error: response.error?.message,
142
- };
143
- // Pino structured log (immediate, non-blocking)
144
- log.info({
145
- domain: entry.domain,
146
- operation: entry.operation,
147
- sessionId: entry.sessionId,
148
- taskId: entry.metadata.taskId,
149
- gateway: entry.metadata.gateway,
150
- success: entry.result.success,
151
- exitCode: entry.result.exitCode,
152
- durationMs: entry.result.duration,
153
- }, `${entry.metadata.gateway ?? 'dispatch'} ${entry.domain}.${entry.operation}`);
154
- // SQLite write — await in grade mode to avoid race with grading query;
155
- // fire-and-forget otherwise for performance.
156
- if (isGradeSession) {
157
- await writeToSqlite(entry, req.requestId);
158
- }
159
- else {
160
- writeToSqlite(entry, req.requestId).catch((err) => {
161
- log.error({ err }, 'Failed to persist audit entry to SQLite');
162
- });
163
- }
164
- return response;
165
- };
166
- }
167
- // queryAudit re-exported from core (canonical location)
168
- export { queryAudit } from '@cleocode/core/internal';
169
- //# sourceMappingURL=audit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../src/dispatch/middleware/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAE/B,qFAAqF;AACrF,IAAI,iBAA4C,CAAC;AACjD,SAAS,kBAAkB;IACzB,IAAI,iBAAiB,KAAK,SAAS;QAAE,OAAO,iBAAiB,CAAC;IAC9D,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,kBAAkB,EAAE,CAAC;QAClC,iBA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C"}
@@ -1,25 +0,0 @@
1
- /**
2
- * LAFS Field Filter Middleware
3
- *
4
- * Implements LAFS _fields parameter (field selection) and _mvi envelope verbosity.
5
- * Extracts _fields and _mvi from params (for callers that pass them as params),
6
- * stores them on the request, and post-processes the response via the canonical
7
- * SDK utilities from @cleocode/lafs v1.5.0.
8
- *
9
- * @epic T4820
10
- * @task T4979
11
- * @task T338 — updated for canonical CLI envelope (meta, data)
12
- */
13
- import type { Middleware } from '../types.js';
14
- /**
15
- * Create the LAFS field-filter middleware.
16
- *
17
- * Handles:
18
- * - _fields: filter response data to specified fields (delegates to SDK applyFieldFilter)
19
- * - _mvi: envelope verbosity — stored on request for downstream use
20
- *
21
- * _fields and _mvi are extracted from req.params (for callers that pass
22
- * them as params) and stored on the DispatchRequest before the domain handler runs.
23
- */
24
- export declare function createFieldFilter(): Middleware;
25
- //# sourceMappingURL=field-filter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-filter.d.ts","sourceRoot":"","sources":["../../../src/dispatch/middleware/field-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAqC,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAsD9C"}
@@ -1,70 +0,0 @@
1
- /**
2
- * LAFS Field Filter Middleware
3
- *
4
- * Implements LAFS _fields parameter (field selection) and _mvi envelope verbosity.
5
- * Extracts _fields and _mvi from params (for callers that pass them as params),
6
- * stores them on the request, and post-processes the response via the canonical
7
- * SDK utilities from @cleocode/lafs v1.5.0.
8
- *
9
- * @epic T4820
10
- * @task T4979
11
- * @task T338 — updated for canonical CLI envelope (meta, data)
12
- */
13
- import { isMVILevel, applyFieldFilter as sdkApplyFieldFilter } from '@cleocode/lafs';
14
- /**
15
- * Create the LAFS field-filter middleware.
16
- *
17
- * Handles:
18
- * - _fields: filter response data to specified fields (delegates to SDK applyFieldFilter)
19
- * - _mvi: envelope verbosity — stored on request for downstream use
20
- *
21
- * _fields and _mvi are extracted from req.params (for callers that pass
22
- * them as params) and stored on the DispatchRequest before the domain handler runs.
23
- */
24
- export function createFieldFilter() {
25
- return async (req, next) => {
26
- // Extract control params from req.params (callers may pass them here)
27
- const _fields = req._fields ?? req.params?._fields;
28
- const rawMvi = req._mvi ?? req.params?._mvi;
29
- const _mvi = isMVILevel(rawMvi) ? rawMvi : undefined;
30
- // Remove from params so domain handlers don't see them
31
- if (req.params) {
32
- delete req.params['_fields'];
33
- delete req.params['_mvi'];
34
- }
35
- // Store on request for potential downstream use
36
- if (_fields)
37
- req._fields = _fields;
38
- if (_mvi)
39
- req._mvi = _mvi;
40
- const response = await next();
41
- // Apply _fields filter via SDK — handles all four result shapes,
42
- // preserves envelope structure. Bridges DispatchResponse (canonical CLI shape)
43
- // to the lafs SDK proto-envelope shape for filtering, then maps back.
44
- if (_fields?.length && response.success && response.data !== undefined) {
45
- const stub = {
46
- $schema: 'https://lafs.dev/schemas/v1/envelope.schema.json',
47
- _meta: {
48
- specVersion: '',
49
- schemaVersion: '',
50
- timestamp: response.meta.timestamp,
51
- operation: response.meta.operation,
52
- requestId: response.meta.requestId,
53
- transport: 'sdk',
54
- strict: true,
55
- mvi: 'minimal',
56
- contextVersion: 0,
57
- },
58
- success: true,
59
- result: response.data,
60
- };
61
- // Type assertion: applyFieldFilter expects LAFSEnvelope (proto shape) but
62
- // our stub satisfies the structural contract at runtime.
63
- const filtered = sdkApplyFieldFilter(stub, _fields);
64
- // Map filtered.result back to the canonical DispatchResponse.data field
65
- response.data = filtered.result ?? undefined;
66
- }
67
- return response;
68
- };
69
- }
70
- //# sourceMappingURL=field-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"field-filter.js","sourceRoot":"","sources":["../../../src/dispatch/middleware/field-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,IAAI,mBAAmB,EAAE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,MAAM,EAAE,IAAI;oBACZ,GAAG,EAAE,SAAS;oBACd,cAAc,EAAE,CAAC;iBAClB;gBACD,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,QAAQ,CAAC,IAAoC;aACtD,CAAC;YACF,0EAA0E;YAC1E,yDAAyD;YACzD,MAAM,QAAQ,GAAG,mBAAmB,CAClC,IAAiD,EACjD,OAAO,CACR,CAAC;YACF,wEAAwE;YACxE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC;QAC/C,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Unified CQRS Dispatch Layer -- Middleware Pipeline
3
- *
4
- * Provides compose() to chain multiple Middleware functions together
5
- * into a single executable pipeline.
6
- *
7
- * @epic T4820
8
- * @task T4815
9
- */
10
- import type { Middleware } from '../types.js';
11
- /**
12
- * Composes an array of Middleware functions into a single Middleware function.
13
- * Execution flows through the array from first to last, and returns bubble
14
- * back up from last to first.
15
- *
16
- * @remarks
17
- * Uses an index-tracked dispatch function to prevent `next()` from being
18
- * called multiple times within a single middleware. If the array is empty,
19
- * a passthrough middleware that immediately calls `next()` is returned.
20
- *
21
- * @param middlewares - Array of middleware functions to chain
22
- * @returns A single composed Middleware function
23
- *
24
- * @example
25
- * ```typescript
26
- * import { compose } from './pipeline.js';
27
- *
28
- * const pipeline = compose([sanitizer, rateLimiter, protocolEnforcement]);
29
- * const response = await pipeline(request, handler);
30
- * ```
31
- */
32
- export declare function compose(middlewares: Middleware[]): Middleware;
33
- //# sourceMappingURL=pipeline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../src/dispatch/middleware/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAmD,UAAU,EAAE,MAAM,aAAa,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,OAAO,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAkC7D"}
@@ -1,60 +0,0 @@
1
- /**
2
- * Unified CQRS Dispatch Layer -- Middleware Pipeline
3
- *
4
- * Provides compose() to chain multiple Middleware functions together
5
- * into a single executable pipeline.
6
- *
7
- * @epic T4820
8
- * @task T4815
9
- */
10
- /**
11
- * Composes an array of Middleware functions into a single Middleware function.
12
- * Execution flows through the array from first to last, and returns bubble
13
- * back up from last to first.
14
- *
15
- * @remarks
16
- * Uses an index-tracked dispatch function to prevent `next()` from being
17
- * called multiple times within a single middleware. If the array is empty,
18
- * a passthrough middleware that immediately calls `next()` is returned.
19
- *
20
- * @param middlewares - Array of middleware functions to chain
21
- * @returns A single composed Middleware function
22
- *
23
- * @example
24
- * ```typescript
25
- * import { compose } from './pipeline.js';
26
- *
27
- * const pipeline = compose([sanitizer, rateLimiter, protocolEnforcement]);
28
- * const response = await pipeline(request, handler);
29
- * ```
30
- */
31
- export function compose(middlewares) {
32
- if (middlewares.length === 0) {
33
- return async (_req, next) => next();
34
- }
35
- return async (request, next) => {
36
- let index = -1;
37
- async function dispatch(i) {
38
- if (i <= index) {
39
- throw new Error('next() called multiple times in middleware');
40
- }
41
- index = i;
42
- let fn = middlewares[i];
43
- if (i === middlewares.length) {
44
- // We've reached the end of the middleware chain; call the final handler
45
- fn = async (_req, nxt) => nxt();
46
- }
47
- if (!fn) {
48
- return next();
49
- }
50
- return fn(request, async () => {
51
- if (i === middlewares.length) {
52
- return next();
53
- }
54
- return dispatch(i + 1);
55
- });
56
- }
57
- return dispatch(0);
58
- };
59
- }
60
- //# sourceMappingURL=pipeline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../../src/dispatch/middleware/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,OAAO,CAAC,WAAyB;IAC/C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,EAAE,IAAqB,EAAE,IAAkB,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;IACrE,CAAC;IAED,OAAO,KAAK,EAAE,OAAwB,EAAE,IAAkB,EAA6B,EAAE;QACvF,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;QAEf,KAAK,UAAU,QAAQ,CAAC,CAAS;YAC/B,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;YACD,KAAK,GAAG,CAAC,CAAC;YAEV,IAAI,EAAE,GAA2B,WAAW,CAAC,CAAC,CAAC,CAAC;YAChD,IAAI,CAAC,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;gBAC7B,wEAAwE;gBACxE,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;YAClC,CAAC;YAED,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,OAAO,IAAI,EAAE,CAAC;YAChB,CAAC;YAED,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;gBAC5B,IAAI,CAAC,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;oBAC7B,OAAO,IAAI,EAAE,CAAC;gBAChB,CAAC;gBACD,OAAO,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC;QAED,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC;AACJ,CAAC"}
@@ -1,35 +0,0 @@
1
- /**
2
- * MVI projection middleware.
3
- * Reads _mviTier from request params and filters response fields accordingly.
4
- * If the domain is not allowed at the resolved tier, short-circuits with an error.
5
- *
6
- * @epic T4820
7
- * @task T5096
8
- */
9
- import { type MviTier, type ProjectionConfig } from '../lib/projections.js';
10
- import type { Middleware } from '../types.js';
11
- export interface ProjectionContext {
12
- tier: MviTier;
13
- config: ProjectionConfig;
14
- }
15
- /**
16
- * Check if a domain is allowed at the given tier.
17
- */
18
- export declare function isOperationAllowed(domain: string, tier: MviTier): boolean;
19
- /**
20
- * Apply field projection to a result object.
21
- * Removes fields that are excluded at the given tier and prunes depth.
22
- */
23
- export declare function applyProjection<T>(data: T, config: ProjectionConfig): T;
24
- /**
25
- * Create projection context from request params.
26
- */
27
- export declare function createProjectionContext(params?: Record<string, unknown>): ProjectionContext;
28
- /**
29
- * Create the MVI projection middleware.
30
- *
31
- * Extracts _mviTier from params, checks domain access, and applies
32
- * field exclusions to the response.
33
- */
34
- export declare function createProjectionMiddleware(): Middleware;
35
- //# sourceMappingURL=projection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../src/dispatch/middleware/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,gBAAgB,EAEtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAqC,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAEzE;AAiCD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,gBAAgB,GAAG,CAAC,CAuCvE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAG3F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,UAAU,CAsDvD"}
@@ -1,146 +0,0 @@
1
- /**
2
- * MVI projection middleware.
3
- * Reads _mviTier from request params and filters response fields accordingly.
4
- * If the domain is not allowed at the resolved tier, short-circuits with an error.
5
- *
6
- * @epic T4820
7
- * @task T5096
8
- */
9
- import { getBoundSession } from '../context/session-context.js';
10
- import { PROJECTIONS, resolveTier, } from '../lib/projections.js';
11
- /**
12
- * Check if a domain is allowed at the given tier.
13
- */
14
- export function isOperationAllowed(domain, tier) {
15
- return PROJECTIONS[tier].allowedDomains.includes(domain);
16
- }
17
- /**
18
- * Recursively prune data beyond maxDepth.
19
- * At maxDepth, objects become '[Object]' and arrays become '[Array(N)]'.
20
- */
21
- function pruneDepth(data, maxDepth, currentDepth = 0) {
22
- // Primitives pass through at any depth
23
- if (data === null || data === undefined || typeof data !== 'object') {
24
- return data;
25
- }
26
- // At max depth, replace with placeholder
27
- if (currentDepth >= maxDepth) {
28
- if (Array.isArray(data)) {
29
- return `[Array(${data.length})]`;
30
- }
31
- return '[Object]';
32
- }
33
- // Recurse into arrays
34
- if (Array.isArray(data)) {
35
- return data.map((item) => pruneDepth(item, maxDepth, currentDepth + 1));
36
- }
37
- // Recurse into objects
38
- const result = {};
39
- for (const [key, value] of Object.entries(data)) {
40
- result[key] = pruneDepth(value, maxDepth, currentDepth + 1);
41
- }
42
- return result;
43
- }
44
- /**
45
- * Apply field projection to a result object.
46
- * Removes fields that are excluded at the given tier and prunes depth.
47
- */
48
- export function applyProjection(data, config) {
49
- if (!data || typeof data !== 'object')
50
- return data;
51
- let result = data;
52
- // Apply field exclusions
53
- if (config.excludeFields?.length) {
54
- const obj = { ...data };
55
- for (const field of config.excludeFields) {
56
- const parts = field.split('.');
57
- if (parts.length === 1) {
58
- delete obj[parts[0]];
59
- }
60
- else {
61
- // Handle nested fields like 'metadata._internal'
62
- let current = obj;
63
- for (let i = 0; i < parts.length - 1; i++) {
64
- const val = current?.[parts[i]];
65
- if (val && typeof val === 'object') {
66
- current[parts[i]] = { ...val };
67
- current = current[parts[i]];
68
- }
69
- else {
70
- current = undefined;
71
- break;
72
- }
73
- }
74
- if (current) {
75
- delete current[parts[parts.length - 1]];
76
- }
77
- }
78
- }
79
- result = obj;
80
- }
81
- // Apply depth pruning
82
- if (config.maxDepth !== undefined) {
83
- result = pruneDepth(result, config.maxDepth);
84
- }
85
- return result;
86
- }
87
- /**
88
- * Create projection context from request params.
89
- */
90
- export function createProjectionContext(params) {
91
- const tier = resolveTier(params);
92
- return { tier, config: PROJECTIONS[tier] };
93
- }
94
- /**
95
- * Create the MVI projection middleware.
96
- *
97
- * Extracts _mviTier from params, checks domain access, and applies
98
- * field exclusions to the response.
99
- */
100
- export function createProjectionMiddleware() {
101
- return async (req, next) => {
102
- const session = getBoundSession();
103
- const tier = resolveTier(req.params, session?.scope ?? null);
104
- const config = PROJECTIONS[tier];
105
- // Remove control param so domain handlers don't see it
106
- if (req.params) {
107
- delete req.params['_mviTier'];
108
- }
109
- // Smart defaults: tasks.list defaults to compact mode for non-CLI sources.
110
- // CLI is the only source — compact injection applies to non-CLI callers.
111
- if (req.domain === 'tasks' && req.operation === 'list' && req.source !== 'cli') {
112
- req.params ??= {};
113
- if (req.params['compact'] === undefined) {
114
- req.params['compact'] = true;
115
- }
116
- }
117
- // Check domain access at this tier
118
- if (!config.allowedDomains.includes(req.domain)) {
119
- return {
120
- meta: {
121
- gateway: req.gateway,
122
- domain: req.domain,
123
- operation: req.operation,
124
- version: '1.0.0',
125
- timestamp: new Date().toISOString(),
126
- duration_ms: 0,
127
- source: req.source,
128
- requestId: req.requestId,
129
- },
130
- success: false,
131
- error: {
132
- code: 'E_INVALID_OPERATION',
133
- exitCode: 2,
134
- message: `Operation not available at '${tier}' tier. Domain '${req.domain}' requires a higher tier.`,
135
- },
136
- };
137
- }
138
- const response = await next();
139
- // Apply field exclusions to successful responses
140
- if (response.success && response.data !== undefined) {
141
- response.data = applyProjection(response.data, config);
142
- }
143
- return response;
144
- };
145
- }
146
- //# sourceMappingURL=projection.js.map
@@ -1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,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,SAAS,EAAE,CAAC;gBACxC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;YAC/B,CAAC;QACH,CAAC;QAED,mCAAmC;QACnC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,OAAO;gBACL,IAAI,EAAE;oBACJ,OAAO,EAAE,GAAG,CAAC,OAAO;oBACpB,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,SAAS,EAAE,GAAG,CAAC,SAAS;oBACxB,OAAO,EAAE,OAAO;oBAChB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACnC,WAAW,EAAE,CAAC;oBACd,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,SAAS,EAAE,GAAG,CAAC,SAAS;iBACzB;gBACD,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE;oBACL,IAAI,EAAE,qBAAqB;oBAC3B,QAAQ,EAAE,CAAC;oBACX,OAAO,EAAE,+BAA+B,IAAI,mBAAmB,GAAG,CAAC,MAAM,2BAA2B;iBACrG;aACF,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC;QAE9B,iDAAiD;QACjD,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACpD,QAAQ,CAAC,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"}
@@ -1,30 +0,0 @@
1
- import type { Middleware } from '../types.js';
2
- /**
3
- * Creates a middleware that enforces protocol compliance.
4
- *
5
- * Delegates to ProtocolEnforcer.enforceProtocol() which:
6
- * - Passes through query operations untouched
7
- * - Passes through mutate operations that don't require validation
8
- * - Validates protocol compliance on validated mutate operations after execution
9
- * - In strict mode, blocks operations with protocol violations (exit codes 60-70)
10
- *
11
- * @remarks
12
- * ProtocolEnforcer.enforceProtocol uses the core's proto-shape (`_meta`) while
13
- * the dispatch layer uses the canonical CLI envelope shape (`meta`). This
14
- * middleware bridges between the two shapes:
15
- * - Wraps `next` to map `DispatchResponse.meta` → proto-shape `_meta` for the enforcer
16
- * - Maps the enforcer's proto-shape result back to `DispatchResponse` (with `meta`)
17
- * - Ensures `source` and `requestId` are always populated on the returned `meta`
18
- *
19
- * @param strictMode - When true, blocks operations that violate protocol rules
20
- * @returns Middleware function that enforces protocol compliance
21
- *
22
- * @example
23
- * ```typescript
24
- * import { createProtocolEnforcement } from './protocol-enforcement.js';
25
- *
26
- * const enforcement = createProtocolEnforcement(true);
27
- * ```
28
- */
29
- export declare function createProtocolEnforcement(strictMode?: boolean): Middleware;
30
- //# sourceMappingURL=protocol-enforcement.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol-enforcement.d.ts","sourceRoot":"","sources":["../../../src/dispatch/middleware/protocol-enforcement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmD,UAAU,EAAE,MAAM,aAAa,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,GAAE,OAAc,GAAG,UAAU,CA8BhF"}