@cleocode/cleo 2026.3.56 → 2026.3.58

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 (705) hide show
  1. package/dist/cli/commander-shim.d.ts +112 -0
  2. package/dist/cli/commander-shim.d.ts.map +1 -0
  3. package/dist/cli/commander-shim.js +233 -0
  4. package/dist/cli/commander-shim.js.map +1 -0
  5. package/dist/cli/commands/add.d.ts +12 -0
  6. package/dist/cli/commands/add.d.ts.map +1 -0
  7. package/dist/cli/commands/add.js +91 -0
  8. package/dist/cli/commands/add.js.map +1 -0
  9. package/dist/cli/commands/adr.d.ts +27 -0
  10. package/dist/cli/commands/adr.d.ts.map +1 -0
  11. package/dist/cli/commands/adr.js +79 -0
  12. package/dist/cli/commands/adr.js.map +1 -0
  13. package/dist/cli/commands/analyze.d.ts +12 -0
  14. package/dist/cli/commands/analyze.d.ts.map +1 -0
  15. package/dist/cli/commands/analyze.js +20 -0
  16. package/dist/cli/commands/analyze.js.map +1 -0
  17. package/dist/cli/commands/archive-stats.d.ts +18 -0
  18. package/dist/cli/commands/archive-stats.d.ts.map +1 -0
  19. package/dist/cli/commands/archive-stats.js +49 -0
  20. package/dist/cli/commands/archive-stats.js.map +1 -0
  21. package/dist/cli/commands/archive.d.ts +12 -0
  22. package/dist/cli/commands/archive.d.ts.map +1 -0
  23. package/dist/cli/commands/archive.js +32 -0
  24. package/dist/cli/commands/archive.js.map +1 -0
  25. package/dist/cli/commands/backup.d.ts +8 -0
  26. package/dist/cli/commands/backup.d.ts.map +1 -0
  27. package/dist/cli/commands/backup.js +35 -0
  28. package/dist/cli/commands/backup.js.map +1 -0
  29. package/dist/cli/commands/blockers.d.ts +7 -0
  30. package/dist/cli/commands/blockers.d.ts.map +1 -0
  31. package/dist/cli/commands/blockers.js +16 -0
  32. package/dist/cli/commands/blockers.js.map +1 -0
  33. package/dist/cli/commands/briefing.d.ts +22 -0
  34. package/dist/cli/commands/briefing.d.ts.map +1 -0
  35. package/dist/cli/commands/briefing.js +45 -0
  36. package/dist/cli/commands/briefing.js.map +1 -0
  37. package/dist/cli/commands/bug.d.ts +12 -0
  38. package/dist/cli/commands/bug.d.ts.map +1 -0
  39. package/dist/cli/commands/bug.js +81 -0
  40. package/dist/cli/commands/bug.js.map +1 -0
  41. package/dist/cli/commands/checkpoint.d.ts +15 -0
  42. package/dist/cli/commands/checkpoint.d.ts.map +1 -0
  43. package/dist/cli/commands/checkpoint.js +91 -0
  44. package/dist/cli/commands/checkpoint.js.map +1 -0
  45. package/dist/cli/commands/commands.d.ts +13 -0
  46. package/dist/cli/commands/commands.d.ts.map +1 -0
  47. package/dist/cli/commands/commands.js +30 -0
  48. package/dist/cli/commands/commands.js.map +1 -0
  49. package/dist/cli/commands/complete.d.ts +12 -0
  50. package/dist/cli/commands/complete.d.ts.map +1 -0
  51. package/dist/cli/commands/complete.js +43 -0
  52. package/dist/cli/commands/complete.js.map +1 -0
  53. package/dist/cli/commands/compliance.d.ts +8 -0
  54. package/dist/cli/commands/compliance.d.ts.map +1 -0
  55. package/dist/cli/commands/compliance.js +85 -0
  56. package/dist/cli/commands/compliance.js.map +1 -0
  57. package/dist/cli/commands/config.d.ts +9 -0
  58. package/dist/cli/commands/config.d.ts.map +1 -0
  59. package/dist/cli/commands/config.js +43 -0
  60. package/dist/cli/commands/config.js.map +1 -0
  61. package/dist/cli/commands/consensus.d.ts +13 -0
  62. package/dist/cli/commands/consensus.d.ts.map +1 -0
  63. package/dist/cli/commands/consensus.js +45 -0
  64. package/dist/cli/commands/consensus.js.map +1 -0
  65. package/dist/cli/commands/context.d.ts +8 -0
  66. package/dist/cli/commands/context.d.ts.map +1 -0
  67. package/dist/cli/commands/context.js +40 -0
  68. package/dist/cli/commands/context.js.map +1 -0
  69. package/dist/cli/commands/contribution.d.ts +13 -0
  70. package/dist/cli/commands/contribution.d.ts.map +1 -0
  71. package/dist/cli/commands/contribution.js +41 -0
  72. package/dist/cli/commands/contribution.js.map +1 -0
  73. package/dist/cli/commands/current.d.ts +13 -0
  74. package/dist/cli/commands/current.d.ts.map +1 -0
  75. package/dist/cli/commands/current.js +20 -0
  76. package/dist/cli/commands/current.js.map +1 -0
  77. package/dist/cli/commands/dash.d.ts +12 -0
  78. package/dist/cli/commands/dash.d.ts.map +1 -0
  79. package/dist/cli/commands/dash.js +24 -0
  80. package/dist/cli/commands/dash.js.map +1 -0
  81. package/dist/cli/commands/decomposition.d.ts +13 -0
  82. package/dist/cli/commands/decomposition.d.ts.map +1 -0
  83. package/dist/cli/commands/decomposition.js +45 -0
  84. package/dist/cli/commands/decomposition.js.map +1 -0
  85. package/dist/cli/commands/delete.d.ts +12 -0
  86. package/dist/cli/commands/delete.d.ts.map +1 -0
  87. package/dist/cli/commands/delete.js +37 -0
  88. package/dist/cli/commands/delete.js.map +1 -0
  89. package/dist/cli/commands/deps.d.ts +9 -0
  90. package/dist/cli/commands/deps.d.ts.map +1 -0
  91. package/dist/cli/commands/deps.js +73 -0
  92. package/dist/cli/commands/deps.js.map +1 -0
  93. package/dist/cli/commands/detect-drift.d.ts +15 -0
  94. package/dist/cli/commands/detect-drift.d.ts.map +1 -0
  95. package/dist/cli/commands/detect-drift.js +386 -0
  96. package/dist/cli/commands/detect-drift.js.map +1 -0
  97. package/dist/cli/commands/detect.d.ts +10 -0
  98. package/dist/cli/commands/detect.d.ts.map +1 -0
  99. package/dist/cli/commands/detect.js +24 -0
  100. package/dist/cli/commands/detect.js.map +1 -0
  101. package/dist/cli/commands/docs.d.ts +13 -0
  102. package/dist/cli/commands/docs.d.ts.map +1 -0
  103. package/dist/cli/commands/docs.js +169 -0
  104. package/dist/cli/commands/docs.js.map +1 -0
  105. package/dist/cli/commands/doctor.d.ts +11 -0
  106. package/dist/cli/commands/doctor.d.ts.map +1 -0
  107. package/dist/cli/commands/doctor.js +54 -0
  108. package/dist/cli/commands/doctor.js.map +1 -0
  109. package/dist/cli/commands/dynamic.d.ts +24 -0
  110. package/dist/cli/commands/dynamic.d.ts.map +1 -0
  111. package/dist/cli/commands/dynamic.js +27 -0
  112. package/dist/cli/commands/dynamic.js.map +1 -0
  113. package/dist/cli/commands/env.d.ts +12 -0
  114. package/dist/cli/commands/env.d.ts.map +1 -0
  115. package/dist/cli/commands/env.js +44 -0
  116. package/dist/cli/commands/env.js.map +1 -0
  117. package/dist/cli/commands/exists.d.ts +7 -0
  118. package/dist/cli/commands/exists.d.ts.map +1 -0
  119. package/dist/cli/commands/exists.js +33 -0
  120. package/dist/cli/commands/exists.js.map +1 -0
  121. package/dist/cli/commands/export-tasks.d.ts +10 -0
  122. package/dist/cli/commands/export-tasks.d.ts.map +1 -0
  123. package/dist/cli/commands/export-tasks.js +47 -0
  124. package/dist/cli/commands/export-tasks.js.map +1 -0
  125. package/dist/cli/commands/export.d.ts +9 -0
  126. package/dist/cli/commands/export.d.ts.map +1 -0
  127. package/dist/cli/commands/export.js +46 -0
  128. package/dist/cli/commands/export.js.map +1 -0
  129. package/dist/cli/commands/find.d.ts +14 -0
  130. package/dist/cli/commands/find.d.ts.map +1 -0
  131. package/dist/cli/commands/find.js +70 -0
  132. package/dist/cli/commands/find.js.map +1 -0
  133. package/dist/cli/commands/generate-changelog.d.ts +14 -0
  134. package/dist/cli/commands/generate-changelog.d.ts.map +1 -0
  135. package/dist/cli/commands/generate-changelog.js +252 -0
  136. package/dist/cli/commands/generate-changelog.js.map +1 -0
  137. package/dist/cli/commands/grade.d.ts +13 -0
  138. package/dist/cli/commands/grade.d.ts.map +1 -0
  139. package/dist/cli/commands/grade.js +26 -0
  140. package/dist/cli/commands/grade.js.map +1 -0
  141. package/dist/cli/commands/history.d.ts +9 -0
  142. package/dist/cli/commands/history.d.ts.map +1 -0
  143. package/dist/cli/commands/history.js +30 -0
  144. package/dist/cli/commands/history.js.map +1 -0
  145. package/dist/cli/commands/implementation.d.ts +13 -0
  146. package/dist/cli/commands/implementation.d.ts.map +1 -0
  147. package/dist/cli/commands/implementation.js +41 -0
  148. package/dist/cli/commands/implementation.js.map +1 -0
  149. package/dist/cli/commands/import-tasks.d.ts +10 -0
  150. package/dist/cli/commands/import-tasks.d.ts.map +1 -0
  151. package/dist/cli/commands/import-tasks.js +38 -0
  152. package/dist/cli/commands/import-tasks.js.map +1 -0
  153. package/dist/cli/commands/import.d.ts +9 -0
  154. package/dist/cli/commands/import.d.ts.map +1 -0
  155. package/dist/cli/commands/import.js +28 -0
  156. package/dist/cli/commands/import.js.map +1 -0
  157. package/dist/cli/commands/init.d.ts +34 -0
  158. package/dist/cli/commands/init.d.ts.map +1 -0
  159. package/dist/cli/commands/init.js +89 -0
  160. package/dist/cli/commands/init.js.map +1 -0
  161. package/dist/cli/commands/inject.d.ts +8 -0
  162. package/dist/cli/commands/inject.d.ts.map +1 -0
  163. package/dist/cli/commands/inject.js +28 -0
  164. package/dist/cli/commands/inject.js.map +1 -0
  165. package/dist/cli/commands/install-global.d.ts +19 -0
  166. package/dist/cli/commands/install-global.d.ts.map +1 -0
  167. package/dist/cli/commands/install-global.js +50 -0
  168. package/dist/cli/commands/install-global.js.map +1 -0
  169. package/dist/cli/commands/issue.d.ts +14 -0
  170. package/dist/cli/commands/issue.d.ts.map +1 -0
  171. package/dist/cli/commands/issue.js +105 -0
  172. package/dist/cli/commands/issue.js.map +1 -0
  173. package/dist/cli/commands/labels.d.ts +13 -0
  174. package/dist/cli/commands/labels.d.ts.map +1 -0
  175. package/dist/cli/commands/labels.js +44 -0
  176. package/dist/cli/commands/labels.js.map +1 -0
  177. package/dist/cli/commands/lifecycle.d.ts +8 -0
  178. package/dist/cli/commands/lifecycle.d.ts.map +1 -0
  179. package/dist/cli/commands/lifecycle.js +72 -0
  180. package/dist/cli/commands/lifecycle.js.map +1 -0
  181. package/dist/cli/commands/list.d.ts +14 -0
  182. package/dist/cli/commands/list.d.ts.map +1 -0
  183. package/dist/cli/commands/list.js +71 -0
  184. package/dist/cli/commands/list.js.map +1 -0
  185. package/dist/cli/commands/log.d.ts +12 -0
  186. package/dist/cli/commands/log.d.ts.map +1 -0
  187. package/dist/cli/commands/log.js +30 -0
  188. package/dist/cli/commands/log.js.map +1 -0
  189. package/dist/cli/commands/map.d.ts +10 -0
  190. package/dist/cli/commands/map.d.ts.map +1 -0
  191. package/dist/cli/commands/map.js +23 -0
  192. package/dist/cli/commands/map.js.map +1 -0
  193. package/dist/cli/commands/mcp-install.d.ts +17 -0
  194. package/dist/cli/commands/mcp-install.d.ts.map +1 -0
  195. package/dist/cli/commands/mcp-install.js +128 -0
  196. package/dist/cli/commands/mcp-install.js.map +1 -0
  197. package/dist/cli/commands/memory-brain.d.ts +14 -0
  198. package/dist/cli/commands/memory-brain.d.ts.map +1 -0
  199. package/dist/cli/commands/memory-brain.js +151 -0
  200. package/dist/cli/commands/memory-brain.js.map +1 -0
  201. package/dist/cli/commands/migrate-claude-mem.d.ts +18 -0
  202. package/dist/cli/commands/migrate-claude-mem.d.ts.map +1 -0
  203. package/dist/cli/commands/migrate-claude-mem.js +60 -0
  204. package/dist/cli/commands/migrate-claude-mem.js.map +1 -0
  205. package/dist/cli/commands/next.d.ts +9 -0
  206. package/dist/cli/commands/next.d.ts.map +1 -0
  207. package/dist/cli/commands/next.js +20 -0
  208. package/dist/cli/commands/next.js.map +1 -0
  209. package/dist/cli/commands/nexus.d.ts +16 -0
  210. package/dist/cli/commands/nexus.d.ts.map +1 -0
  211. package/dist/cli/commands/nexus.js +155 -0
  212. package/dist/cli/commands/nexus.js.map +1 -0
  213. package/dist/cli/commands/observe.d.ts +9 -0
  214. package/dist/cli/commands/observe.d.ts.map +1 -0
  215. package/dist/cli/commands/observe.js +39 -0
  216. package/dist/cli/commands/observe.js.map +1 -0
  217. package/dist/cli/commands/ops.d.ts +10 -0
  218. package/dist/cli/commands/ops.d.ts.map +1 -0
  219. package/dist/cli/commands/ops.js +19 -0
  220. package/dist/cli/commands/ops.js.map +1 -0
  221. package/dist/cli/commands/orchestrate.d.ts +8 -0
  222. package/dist/cli/commands/orchestrate.d.ts.map +1 -0
  223. package/dist/cli/commands/orchestrate.js +58 -0
  224. package/dist/cli/commands/orchestrate.js.map +1 -0
  225. package/dist/cli/commands/otel.d.ts +12 -0
  226. package/dist/cli/commands/otel.d.ts.map +1 -0
  227. package/dist/cli/commands/otel.js +128 -0
  228. package/dist/cli/commands/otel.js.map +1 -0
  229. package/dist/cli/commands/phase.d.ts +12 -0
  230. package/dist/cli/commands/phase.d.ts.map +1 -0
  231. package/dist/cli/commands/phase.js +88 -0
  232. package/dist/cli/commands/phase.js.map +1 -0
  233. package/dist/cli/commands/phases.d.ts +12 -0
  234. package/dist/cli/commands/phases.d.ts.map +1 -0
  235. package/dist/cli/commands/phases.js +37 -0
  236. package/dist/cli/commands/phases.js.map +1 -0
  237. package/dist/cli/commands/plan.d.ts +8 -0
  238. package/dist/cli/commands/plan.d.ts.map +1 -0
  239. package/dist/cli/commands/plan.js +15 -0
  240. package/dist/cli/commands/plan.js.map +1 -0
  241. package/dist/cli/commands/promote.d.ts +7 -0
  242. package/dist/cli/commands/promote.d.ts.map +1 -0
  243. package/dist/cli/commands/promote.js +15 -0
  244. package/dist/cli/commands/promote.js.map +1 -0
  245. package/dist/cli/commands/refresh-memory.d.ts +9 -0
  246. package/dist/cli/commands/refresh-memory.d.ts.map +1 -0
  247. package/dist/cli/commands/refresh-memory.js +24 -0
  248. package/dist/cli/commands/refresh-memory.js.map +1 -0
  249. package/dist/cli/commands/relates.d.ts +12 -0
  250. package/dist/cli/commands/relates.d.ts.map +1 -0
  251. package/dist/cli/commands/relates.js +53 -0
  252. package/dist/cli/commands/relates.js.map +1 -0
  253. package/dist/cli/commands/release.d.ts +8 -0
  254. package/dist/cli/commands/release.d.ts.map +1 -0
  255. package/dist/cli/commands/release.js +72 -0
  256. package/dist/cli/commands/release.js.map +1 -0
  257. package/dist/cli/commands/remote.d.ts +12 -0
  258. package/dist/cli/commands/remote.d.ts.map +1 -0
  259. package/dist/cli/commands/remote.js +207 -0
  260. package/dist/cli/commands/remote.js.map +1 -0
  261. package/dist/cli/commands/reorder.d.ts +7 -0
  262. package/dist/cli/commands/reorder.d.ts.map +1 -0
  263. package/dist/cli/commands/reorder.js +20 -0
  264. package/dist/cli/commands/reorder.js.map +1 -0
  265. package/dist/cli/commands/reparent.d.ts +10 -0
  266. package/dist/cli/commands/reparent.d.ts.map +1 -0
  267. package/dist/cli/commands/reparent.js +19 -0
  268. package/dist/cli/commands/reparent.js.map +1 -0
  269. package/dist/cli/commands/research.d.ts +8 -0
  270. package/dist/cli/commands/research.d.ts.map +1 -0
  271. package/dist/cli/commands/research.js +129 -0
  272. package/dist/cli/commands/research.js.map +1 -0
  273. package/dist/cli/commands/restore.d.ts +11 -0
  274. package/dist/cli/commands/restore.d.ts.map +1 -0
  275. package/dist/cli/commands/restore.js +224 -0
  276. package/dist/cli/commands/restore.js.map +1 -0
  277. package/dist/cli/commands/roadmap.d.ts +8 -0
  278. package/dist/cli/commands/roadmap.d.ts.map +1 -0
  279. package/dist/cli/commands/roadmap.js +21 -0
  280. package/dist/cli/commands/roadmap.js.map +1 -0
  281. package/dist/cli/commands/safestop.d.ts +14 -0
  282. package/dist/cli/commands/safestop.d.ts.map +1 -0
  283. package/dist/cli/commands/safestop.js +32 -0
  284. package/dist/cli/commands/safestop.js.map +1 -0
  285. package/dist/cli/commands/self-update.d.ts +15 -0
  286. package/dist/cli/commands/self-update.d.ts.map +1 -0
  287. package/dist/cli/commands/self-update.js +329 -0
  288. package/dist/cli/commands/self-update.js.map +1 -0
  289. package/dist/cli/commands/sequence.d.ts +8 -0
  290. package/dist/cli/commands/sequence.d.ts.map +1 -0
  291. package/dist/cli/commands/sequence.js +30 -0
  292. package/dist/cli/commands/sequence.js.map +1 -0
  293. package/dist/cli/commands/session.d.ts +12 -0
  294. package/dist/cli/commands/session.d.ts.map +1 -0
  295. package/dist/cli/commands/session.js +160 -0
  296. package/dist/cli/commands/session.js.map +1 -0
  297. package/dist/cli/commands/show.d.ts +13 -0
  298. package/dist/cli/commands/show.d.ts.map +1 -0
  299. package/dist/cli/commands/show.js +20 -0
  300. package/dist/cli/commands/show.js.map +1 -0
  301. package/dist/cli/commands/skills.d.ts +13 -0
  302. package/dist/cli/commands/skills.d.ts.map +1 -0
  303. package/dist/cli/commands/skills.js +131 -0
  304. package/dist/cli/commands/skills.js.map +1 -0
  305. package/dist/cli/commands/snapshot.d.ts +9 -0
  306. package/dist/cli/commands/snapshot.d.ts.map +1 -0
  307. package/dist/cli/commands/snapshot.js +50 -0
  308. package/dist/cli/commands/snapshot.js.map +1 -0
  309. package/dist/cli/commands/specification.d.ts +13 -0
  310. package/dist/cli/commands/specification.d.ts.map +1 -0
  311. package/dist/cli/commands/specification.js +45 -0
  312. package/dist/cli/commands/specification.js.map +1 -0
  313. package/dist/cli/commands/start.d.ts +13 -0
  314. package/dist/cli/commands/start.d.ts.map +1 -0
  315. package/dist/cli/commands/start.js +20 -0
  316. package/dist/cli/commands/start.js.map +1 -0
  317. package/dist/cli/commands/stats.d.ts +12 -0
  318. package/dist/cli/commands/stats.d.ts.map +1 -0
  319. package/dist/cli/commands/stats.js +23 -0
  320. package/dist/cli/commands/stats.js.map +1 -0
  321. package/dist/cli/commands/sticky.d.ts +16 -0
  322. package/dist/cli/commands/sticky.d.ts.map +1 -0
  323. package/dist/cli/commands/sticky.js +211 -0
  324. package/dist/cli/commands/sticky.js.map +1 -0
  325. package/dist/cli/commands/stop.d.ts +13 -0
  326. package/dist/cli/commands/stop.d.ts.map +1 -0
  327. package/dist/cli/commands/stop.js +20 -0
  328. package/dist/cli/commands/stop.js.map +1 -0
  329. package/dist/cli/commands/testing.d.ts +13 -0
  330. package/dist/cli/commands/testing.d.ts.map +1 -0
  331. package/dist/cli/commands/testing.js +64 -0
  332. package/dist/cli/commands/testing.js.map +1 -0
  333. package/dist/cli/commands/token.d.ts +10 -0
  334. package/dist/cli/commands/token.d.ts.map +1 -0
  335. package/dist/cli/commands/token.js +135 -0
  336. package/dist/cli/commands/token.js.map +1 -0
  337. package/dist/cli/commands/update.d.ts +12 -0
  338. package/dist/cli/commands/update.d.ts.map +1 -0
  339. package/dist/cli/commands/update.js +77 -0
  340. package/dist/cli/commands/update.js.map +1 -0
  341. package/dist/cli/commands/upgrade.d.ts +16 -0
  342. package/dist/cli/commands/upgrade.d.ts.map +1 -0
  343. package/dist/cli/commands/upgrade.js +83 -0
  344. package/dist/cli/commands/upgrade.js.map +1 -0
  345. package/dist/cli/commands/validate.d.ts +12 -0
  346. package/dist/cli/commands/validate.d.ts.map +1 -0
  347. package/dist/cli/commands/validate.js +23 -0
  348. package/dist/cli/commands/validate.js.map +1 -0
  349. package/dist/cli/commands/verify.d.ts +8 -0
  350. package/dist/cli/commands/verify.d.ts.map +1 -0
  351. package/dist/cli/commands/verify.js +28 -0
  352. package/dist/cli/commands/verify.js.map +1 -0
  353. package/dist/cli/commands/web.d.ts +13 -0
  354. package/dist/cli/commands/web.d.ts.map +1 -0
  355. package/dist/cli/commands/web.js +264 -0
  356. package/dist/cli/commands/web.js.map +1 -0
  357. package/dist/cli/field-context.d.ts +32 -0
  358. package/dist/cli/field-context.d.ts.map +1 -0
  359. package/dist/cli/field-context.js +47 -0
  360. package/dist/cli/field-context.js.map +1 -0
  361. package/dist/cli/format-context.d.ts +32 -0
  362. package/dist/cli/format-context.d.ts.map +1 -0
  363. package/dist/cli/format-context.js +50 -0
  364. package/dist/cli/format-context.js.map +1 -0
  365. package/dist/cli/index.d.ts +9 -0
  366. package/dist/cli/index.d.ts.map +1 -0
  367. package/dist/cli/index.js +16876 -14937
  368. package/dist/cli/index.js.map +4 -4
  369. package/dist/cli/logger-bootstrap.d.ts +6 -0
  370. package/dist/cli/logger-bootstrap.d.ts.map +1 -0
  371. package/dist/cli/logger-bootstrap.js +10 -0
  372. package/dist/cli/logger-bootstrap.js.map +1 -0
  373. package/dist/cli/middleware/output-format.d.ts +30 -0
  374. package/dist/cli/middleware/output-format.d.ts.map +1 -0
  375. package/dist/cli/middleware/output-format.js +35 -0
  376. package/dist/cli/middleware/output-format.js.map +1 -0
  377. package/dist/cli/progress.d.ts +84 -0
  378. package/dist/cli/progress.d.ts.map +1 -0
  379. package/dist/cli/progress.js +169 -0
  380. package/dist/cli/progress.js.map +1 -0
  381. package/dist/cli/renderers/colors.d.ts +32 -0
  382. package/dist/cli/renderers/colors.d.ts.map +1 -0
  383. package/dist/cli/renderers/colors.js +141 -0
  384. package/dist/cli/renderers/colors.js.map +1 -0
  385. package/dist/cli/renderers/error.d.ts +13 -0
  386. package/dist/cli/renderers/error.d.ts.map +1 -0
  387. package/dist/cli/renderers/error.js +42 -0
  388. package/dist/cli/renderers/error.js.map +1 -0
  389. package/dist/cli/renderers/index.d.ts +59 -0
  390. package/dist/cli/renderers/index.d.ts.map +1 -0
  391. package/dist/cli/renderers/index.js +184 -0
  392. package/dist/cli/renderers/index.js.map +1 -0
  393. package/dist/cli/renderers/normalizer.d.ts +21 -0
  394. package/dist/cli/renderers/normalizer.d.ts.map +1 -0
  395. package/dist/cli/renderers/normalizer.js +106 -0
  396. package/dist/cli/renderers/normalizer.js.map +1 -0
  397. package/dist/cli/renderers/system.d.ts +25 -0
  398. package/dist/cli/renderers/system.d.ts.map +1 -0
  399. package/dist/cli/renderers/system.js +416 -0
  400. package/dist/cli/renderers/system.js.map +1 -0
  401. package/dist/cli/renderers/tasks.d.ts +28 -0
  402. package/dist/cli/renderers/tasks.d.ts.map +1 -0
  403. package/dist/cli/renderers/tasks.js +306 -0
  404. package/dist/cli/renderers/tasks.js.map +1 -0
  405. package/dist/dispatch/adapters/cli.d.ts +67 -0
  406. package/dist/dispatch/adapters/cli.d.ts.map +1 -0
  407. package/dist/dispatch/adapters/cli.js +205 -0
  408. package/dist/dispatch/adapters/cli.js.map +1 -0
  409. package/dist/dispatch/adapters/mcp.d.ts +37 -0
  410. package/dist/dispatch/adapters/mcp.d.ts.map +1 -0
  411. package/dist/dispatch/adapters/mcp.js +122 -0
  412. package/dist/dispatch/adapters/mcp.js.map +1 -0
  413. package/dist/dispatch/context/session-context.d.ts +54 -0
  414. package/dist/dispatch/context/session-context.d.ts.map +1 -0
  415. package/dist/dispatch/context/session-context.js +61 -0
  416. package/dist/dispatch/context/session-context.js.map +1 -0
  417. package/dist/dispatch/dispatcher.d.ts +23 -0
  418. package/dist/dispatch/dispatcher.d.ts.map +1 -0
  419. package/dist/dispatch/dispatcher.js +84 -0
  420. package/dist/dispatch/dispatcher.js.map +1 -0
  421. package/dist/dispatch/domains/_base.d.ts +59 -0
  422. package/dist/dispatch/domains/_base.d.ts.map +1 -0
  423. package/dist/dispatch/domains/_base.js +77 -0
  424. package/dist/dispatch/domains/_base.js.map +1 -0
  425. package/dist/dispatch/domains/_meta.d.ts +23 -0
  426. package/dist/dispatch/domains/_meta.d.ts.map +1 -0
  427. package/dist/dispatch/domains/_meta.js +25 -0
  428. package/dist/dispatch/domains/_meta.js.map +1 -0
  429. package/dist/dispatch/domains/_routing.d.ts +8 -0
  430. package/dist/dispatch/domains/_routing.d.ts.map +1 -0
  431. package/dist/dispatch/domains/_routing.js +20 -0
  432. package/dist/dispatch/domains/_routing.js.map +1 -0
  433. package/dist/dispatch/domains/admin.d.ts +25 -0
  434. package/dist/dispatch/domains/admin.d.ts.map +1 -0
  435. package/dist/dispatch/domains/admin.js +670 -0
  436. package/dist/dispatch/domains/admin.js.map +1 -0
  437. package/dist/dispatch/domains/check.d.ts +22 -0
  438. package/dist/dispatch/domains/check.d.ts.map +1 -0
  439. package/dist/dispatch/domains/check.js +279 -0
  440. package/dist/dispatch/domains/check.js.map +1 -0
  441. package/dist/dispatch/domains/index.d.ts +26 -0
  442. package/dist/dispatch/domains/index.d.ts.map +1 -0
  443. package/dist/dispatch/domains/index.js +38 -0
  444. package/dist/dispatch/domains/index.js.map +1 -0
  445. package/dist/dispatch/domains/memory.d.ts +22 -0
  446. package/dist/dispatch/domains/memory.d.ts.map +1 -0
  447. package/dist/dispatch/domains/memory.js +303 -0
  448. package/dist/dispatch/domains/memory.js.map +1 -0
  449. package/dist/dispatch/domains/nexus.d.ts +22 -0
  450. package/dist/dispatch/domains/nexus.d.ts.map +1 -0
  451. package/dist/dispatch/domains/nexus.js +286 -0
  452. package/dist/dispatch/domains/nexus.js.map +1 -0
  453. package/dist/dispatch/domains/orchestrate.d.ts +19 -0
  454. package/dist/dispatch/domains/orchestrate.d.ts.map +1 -0
  455. package/dist/dispatch/domains/orchestrate.js +259 -0
  456. package/dist/dispatch/domains/orchestrate.js.map +1 -0
  457. package/dist/dispatch/domains/pipeline.d.ts +35 -0
  458. package/dist/dispatch/domains/pipeline.d.ts.map +1 -0
  459. package/dist/dispatch/domains/pipeline.js +553 -0
  460. package/dist/dispatch/domains/pipeline.js.map +1 -0
  461. package/dist/dispatch/domains/session.d.ts +22 -0
  462. package/dist/dispatch/domains/session.d.ts.map +1 -0
  463. package/dist/dispatch/domains/session.js +255 -0
  464. package/dist/dispatch/domains/session.js.map +1 -0
  465. package/dist/dispatch/domains/sticky.d.ts +20 -0
  466. package/dist/dispatch/domains/sticky.d.ts.map +1 -0
  467. package/dist/dispatch/domains/sticky.js +164 -0
  468. package/dist/dispatch/domains/sticky.js.map +1 -0
  469. package/dist/dispatch/domains/tasks.d.ts +25 -0
  470. package/dist/dispatch/domains/tasks.d.ts.map +1 -0
  471. package/dist/dispatch/domains/tasks.js +323 -0
  472. package/dist/dispatch/domains/tasks.js.map +1 -0
  473. package/dist/dispatch/domains/tools.d.ts +36 -0
  474. package/dist/dispatch/domains/tools.d.ts.map +1 -0
  475. package/dist/dispatch/domains/tools.js +451 -0
  476. package/dist/dispatch/domains/tools.js.map +1 -0
  477. package/dist/dispatch/engines/_error.d.ts +42 -0
  478. package/dist/dispatch/engines/_error.d.ts.map +1 -0
  479. package/dist/dispatch/engines/_error.js +201 -0
  480. package/dist/dispatch/engines/_error.js.map +1 -0
  481. package/dist/dispatch/engines/codebase-map-engine.d.ts +17 -0
  482. package/dist/dispatch/engines/codebase-map-engine.d.ts.map +1 -0
  483. package/dist/dispatch/engines/codebase-map-engine.js +29 -0
  484. package/dist/dispatch/engines/codebase-map-engine.js.map +1 -0
  485. package/dist/dispatch/engines/config-engine.d.ts +21 -0
  486. package/dist/dispatch/engines/config-engine.d.ts.map +1 -0
  487. package/dist/dispatch/engines/config-engine.js +45 -0
  488. package/dist/dispatch/engines/config-engine.js.map +1 -0
  489. package/dist/dispatch/engines/hooks-engine.d.ts +47 -0
  490. package/dist/dispatch/engines/hooks-engine.d.ts.map +1 -0
  491. package/dist/dispatch/engines/hooks-engine.js +57 -0
  492. package/dist/dispatch/engines/hooks-engine.js.map +1 -0
  493. package/dist/dispatch/engines/init-engine.d.ts +43 -0
  494. package/dist/dispatch/engines/init-engine.d.ts.map +1 -0
  495. package/dist/dispatch/engines/init-engine.js +73 -0
  496. package/dist/dispatch/engines/init-engine.js.map +1 -0
  497. package/dist/dispatch/engines/lifecycle-engine.d.ts +66 -0
  498. package/dist/dispatch/engines/lifecycle-engine.d.ts.map +1 -0
  499. package/dist/dispatch/engines/lifecycle-engine.js +213 -0
  500. package/dist/dispatch/engines/lifecycle-engine.js.map +1 -0
  501. package/dist/dispatch/engines/memory-engine.d.ts +10 -0
  502. package/dist/dispatch/engines/memory-engine.d.ts.map +1 -0
  503. package/dist/dispatch/engines/memory-engine.js +10 -0
  504. package/dist/dispatch/engines/memory-engine.js.map +1 -0
  505. package/dist/dispatch/engines/nexus-engine.d.ts +167 -0
  506. package/dist/dispatch/engines/nexus-engine.d.ts.map +1 -0
  507. package/dist/dispatch/engines/nexus-engine.js +356 -0
  508. package/dist/dispatch/engines/nexus-engine.js.map +1 -0
  509. package/dist/dispatch/engines/orchestrate-engine.d.ts +133 -0
  510. package/dist/dispatch/engines/orchestrate-engine.d.ts.map +1 -0
  511. package/dist/dispatch/engines/orchestrate-engine.js +769 -0
  512. package/dist/dispatch/engines/orchestrate-engine.js.map +1 -0
  513. package/dist/dispatch/engines/pipeline-engine.d.ts +51 -0
  514. package/dist/dispatch/engines/pipeline-engine.d.ts.map +1 -0
  515. package/dist/dispatch/engines/pipeline-engine.js +191 -0
  516. package/dist/dispatch/engines/pipeline-engine.js.map +1 -0
  517. package/dist/dispatch/engines/release-engine.d.ts +94 -0
  518. package/dist/dispatch/engines/release-engine.d.ts.map +1 -0
  519. package/dist/dispatch/engines/release-engine.js +669 -0
  520. package/dist/dispatch/engines/release-engine.js.map +1 -0
  521. package/dist/dispatch/engines/session-engine.d.ts +323 -0
  522. package/dist/dispatch/engines/session-engine.d.ts.map +1 -0
  523. package/dist/dispatch/engines/session-engine.js +865 -0
  524. package/dist/dispatch/engines/session-engine.js.map +1 -0
  525. package/dist/dispatch/engines/sticky-engine.d.ts +100 -0
  526. package/dist/dispatch/engines/sticky-engine.d.ts.map +1 -0
  527. package/dist/dispatch/engines/sticky-engine.js +181 -0
  528. package/dist/dispatch/engines/sticky-engine.js.map +1 -0
  529. package/dist/dispatch/engines/system-engine.d.ts +377 -0
  530. package/dist/dispatch/engines/system-engine.d.ts.map +1 -0
  531. package/dist/dispatch/engines/system-engine.js +979 -0
  532. package/dist/dispatch/engines/system-engine.js.map +1 -0
  533. package/dist/dispatch/engines/task-engine.d.ts +612 -0
  534. package/dist/dispatch/engines/task-engine.d.ts.map +1 -0
  535. package/dist/dispatch/engines/task-engine.js +950 -0
  536. package/dist/dispatch/engines/task-engine.js.map +1 -0
  537. package/dist/dispatch/engines/template-parser.d.ts +34 -0
  538. package/dist/dispatch/engines/template-parser.d.ts.map +1 -0
  539. package/dist/dispatch/engines/template-parser.js +57 -0
  540. package/dist/dispatch/engines/template-parser.js.map +1 -0
  541. package/dist/dispatch/engines/tools-engine.d.ts +270 -0
  542. package/dist/dispatch/engines/tools-engine.d.ts.map +1 -0
  543. package/dist/dispatch/engines/tools-engine.js +636 -0
  544. package/dist/dispatch/engines/tools-engine.js.map +1 -0
  545. package/dist/dispatch/engines/validate-engine.d.ts +154 -0
  546. package/dist/dispatch/engines/validate-engine.d.ts.map +1 -0
  547. package/dist/dispatch/engines/validate-engine.js +524 -0
  548. package/dist/dispatch/engines/validate-engine.js.map +1 -0
  549. package/dist/dispatch/index.d.ts +20 -0
  550. package/dist/dispatch/index.d.ts.map +1 -0
  551. package/dist/dispatch/index.js +19 -0
  552. package/dist/dispatch/index.js.map +1 -0
  553. package/dist/dispatch/lib/capability-matrix.d.ts +11 -0
  554. package/dist/dispatch/lib/capability-matrix.d.ts.map +1 -0
  555. package/dist/dispatch/lib/capability-matrix.js +10 -0
  556. package/dist/dispatch/lib/capability-matrix.js.map +1 -0
  557. package/dist/dispatch/lib/config.d.ts +16 -0
  558. package/dist/dispatch/lib/config.d.ts.map +1 -0
  559. package/dist/dispatch/lib/config.js +15 -0
  560. package/dist/dispatch/lib/config.js.map +1 -0
  561. package/dist/dispatch/lib/engine.d.ts +25 -0
  562. package/dist/dispatch/lib/engine.d.ts.map +1 -0
  563. package/dist/dispatch/lib/engine.js +44 -0
  564. package/dist/dispatch/lib/engine.js.map +1 -0
  565. package/dist/dispatch/lib/meta.d.ts +26 -0
  566. package/dist/dispatch/lib/meta.d.ts.map +1 -0
  567. package/dist/dispatch/lib/meta.js +37 -0
  568. package/dist/dispatch/lib/meta.js.map +1 -0
  569. package/dist/dispatch/lib/param-utils.d.ts +11 -0
  570. package/dist/dispatch/lib/param-utils.d.ts.map +1 -0
  571. package/dist/dispatch/lib/param-utils.js +10 -0
  572. package/dist/dispatch/lib/param-utils.js.map +1 -0
  573. package/dist/dispatch/lib/projections.d.ts +23 -0
  574. package/dist/dispatch/lib/projections.d.ts.map +1 -0
  575. package/dist/dispatch/lib/projections.js +48 -0
  576. package/dist/dispatch/lib/projections.js.map +1 -0
  577. package/dist/dispatch/lib/schema-utils.d.ts +42 -0
  578. package/dist/dispatch/lib/schema-utils.d.ts.map +1 -0
  579. package/dist/dispatch/lib/schema-utils.js +93 -0
  580. package/dist/dispatch/lib/schema-utils.js.map +1 -0
  581. package/dist/dispatch/lib/security.d.ts +11 -0
  582. package/dist/dispatch/lib/security.d.ts.map +1 -0
  583. package/dist/dispatch/lib/security.js +10 -0
  584. package/dist/dispatch/lib/security.js.map +1 -0
  585. package/dist/dispatch/middleware/audit.d.ts +23 -0
  586. package/dist/dispatch/middleware/audit.d.ts.map +1 -0
  587. package/dist/dispatch/middleware/audit.js +169 -0
  588. package/dist/dispatch/middleware/audit.js.map +1 -0
  589. package/dist/dispatch/middleware/field-filter.d.ts +24 -0
  590. package/dist/dispatch/middleware/field-filter.d.ts.map +1 -0
  591. package/dist/dispatch/middleware/field-filter.js +65 -0
  592. package/dist/dispatch/middleware/field-filter.js.map +1 -0
  593. package/dist/dispatch/middleware/pipeline.d.ts +20 -0
  594. package/dist/dispatch/middleware/pipeline.d.ts.map +1 -0
  595. package/dist/dispatch/middleware/pipeline.js +47 -0
  596. package/dist/dispatch/middleware/pipeline.js.map +1 -0
  597. package/dist/dispatch/middleware/projection.d.ts +35 -0
  598. package/dist/dispatch/middleware/projection.d.ts.map +1 -0
  599. package/dist/dispatch/middleware/projection.js +145 -0
  600. package/dist/dispatch/middleware/projection.js.map +1 -0
  601. package/dist/dispatch/middleware/protocol-enforcement.d.ts +12 -0
  602. package/dist/dispatch/middleware/protocol-enforcement.d.ts.map +1 -0
  603. package/dist/dispatch/middleware/protocol-enforcement.js +30 -0
  604. package/dist/dispatch/middleware/protocol-enforcement.js.map +1 -0
  605. package/dist/dispatch/middleware/rate-limiter.d.ts +30 -0
  606. package/dist/dispatch/middleware/rate-limiter.d.ts.map +1 -0
  607. package/dist/dispatch/middleware/rate-limiter.js +101 -0
  608. package/dist/dispatch/middleware/rate-limiter.js.map +1 -0
  609. package/dist/dispatch/middleware/sanitizer.d.ts +10 -0
  610. package/dist/dispatch/middleware/sanitizer.d.ts.map +1 -0
  611. package/dist/dispatch/middleware/sanitizer.js +42 -0
  612. package/dist/dispatch/middleware/sanitizer.js.map +1 -0
  613. package/dist/dispatch/middleware/session-resolver.d.ts +26 -0
  614. package/dist/dispatch/middleware/session-resolver.d.ts.map +1 -0
  615. package/dist/dispatch/middleware/session-resolver.js +65 -0
  616. package/dist/dispatch/middleware/session-resolver.js.map +1 -0
  617. package/dist/dispatch/middleware/verification-gates.d.ts +3 -0
  618. package/dist/dispatch/middleware/verification-gates.d.ts.map +1 -0
  619. package/dist/dispatch/middleware/verification-gates.js +40 -0
  620. package/dist/dispatch/middleware/verification-gates.js.map +1 -0
  621. package/dist/dispatch/registry.d.ts +91 -0
  622. package/dist/dispatch/registry.d.ts.map +1 -0
  623. package/dist/dispatch/registry.js +2833 -0
  624. package/dist/dispatch/registry.js.map +1 -0
  625. package/dist/dispatch/types.d.ts +218 -0
  626. package/dist/dispatch/types.d.ts.map +1 -0
  627. package/dist/dispatch/types.js +25 -0
  628. package/dist/dispatch/types.js.map +1 -0
  629. package/dist/mcp/gateways/mutate.d.ts +146 -0
  630. package/dist/mcp/gateways/mutate.d.ts.map +1 -0
  631. package/dist/mcp/gateways/mutate.js +1016 -0
  632. package/dist/mcp/gateways/mutate.js.map +1 -0
  633. package/dist/mcp/gateways/query.d.ts +138 -0
  634. package/dist/mcp/gateways/query.d.ts.map +1 -0
  635. package/dist/mcp/gateways/query.js +186 -0
  636. package/dist/mcp/gateways/query.js.map +1 -0
  637. package/dist/mcp/index.d.ts +16 -0
  638. package/dist/mcp/index.d.ts.map +1 -0
  639. package/dist/mcp/index.js +16735 -14861
  640. package/dist/mcp/index.js.map +4 -4
  641. package/dist/mcp/lib/background-jobs.d.ts +86 -0
  642. package/dist/mcp/lib/background-jobs.d.ts.map +1 -0
  643. package/dist/mcp/lib/background-jobs.js +183 -0
  644. package/dist/mcp/lib/background-jobs.js.map +1 -0
  645. package/dist/mcp/lib/budget.d.ts +35 -0
  646. package/dist/mcp/lib/budget.d.ts.map +1 -0
  647. package/dist/mcp/lib/budget.js +102 -0
  648. package/dist/mcp/lib/budget.js.map +1 -0
  649. package/dist/mcp/lib/cache.d.ts +78 -0
  650. package/dist/mcp/lib/cache.d.ts.map +1 -0
  651. package/dist/mcp/lib/cache.js +207 -0
  652. package/dist/mcp/lib/cache.js.map +1 -0
  653. package/dist/mcp/lib/config.d.ts +42 -0
  654. package/dist/mcp/lib/config.d.ts.map +1 -0
  655. package/dist/mcp/lib/config.js +241 -0
  656. package/dist/mcp/lib/config.js.map +1 -0
  657. package/dist/mcp/lib/defaults.d.ts +115 -0
  658. package/dist/mcp/lib/defaults.d.ts.map +1 -0
  659. package/dist/mcp/lib/defaults.js +61 -0
  660. package/dist/mcp/lib/defaults.js.map +1 -0
  661. package/dist/mcp/lib/gate-validators.d.ts +13 -0
  662. package/dist/mcp/lib/gate-validators.d.ts.map +1 -0
  663. package/dist/mcp/lib/gate-validators.js +13 -0
  664. package/dist/mcp/lib/gate-validators.js.map +1 -0
  665. package/dist/mcp/lib/gateway-meta.d.ts +37 -0
  666. package/dist/mcp/lib/gateway-meta.d.ts.map +1 -0
  667. package/dist/mcp/lib/gateway-meta.js +50 -0
  668. package/dist/mcp/lib/gateway-meta.js.map +1 -0
  669. package/dist/mcp/lib/job-manager-accessor.d.ts +10 -0
  670. package/dist/mcp/lib/job-manager-accessor.d.ts.map +1 -0
  671. package/dist/mcp/lib/job-manager-accessor.js +14 -0
  672. package/dist/mcp/lib/job-manager-accessor.js.map +1 -0
  673. package/dist/mcp/lib/protocol-enforcement.d.ts +12 -0
  674. package/dist/mcp/lib/protocol-enforcement.d.ts.map +1 -0
  675. package/dist/mcp/lib/protocol-enforcement.js +12 -0
  676. package/dist/mcp/lib/protocol-enforcement.js.map +1 -0
  677. package/dist/mcp/lib/protocol-rules.d.ts +12 -0
  678. package/dist/mcp/lib/protocol-rules.d.ts.map +1 -0
  679. package/dist/mcp/lib/protocol-rules.js +12 -0
  680. package/dist/mcp/lib/protocol-rules.js.map +1 -0
  681. package/dist/mcp/lib/rate-limiter.d.ts +110 -0
  682. package/dist/mcp/lib/rate-limiter.d.ts.map +1 -0
  683. package/dist/mcp/lib/rate-limiter.js +208 -0
  684. package/dist/mcp/lib/rate-limiter.js.map +1 -0
  685. package/dist/mcp/lib/router.d.ts +58 -0
  686. package/dist/mcp/lib/router.d.ts.map +1 -0
  687. package/dist/mcp/lib/router.js +12 -0
  688. package/dist/mcp/lib/router.js.map +1 -0
  689. package/dist/mcp/lib/security.d.ts +161 -0
  690. package/dist/mcp/lib/security.d.ts.map +1 -0
  691. package/dist/mcp/lib/security.js +360 -0
  692. package/dist/mcp/lib/security.js.map +1 -0
  693. package/dist/mcp/lib/verification-gates.d.ts +13 -0
  694. package/dist/mcp/lib/verification-gates.d.ts.map +1 -0
  695. package/dist/mcp/lib/verification-gates.js +12 -0
  696. package/dist/mcp/lib/verification-gates.js.map +1 -0
  697. package/dist/mcp/resources/budget.d.ts +22 -0
  698. package/dist/mcp/resources/budget.d.ts.map +1 -0
  699. package/dist/mcp/resources/budget.js +46 -0
  700. package/dist/mcp/resources/budget.js.map +1 -0
  701. package/dist/mcp/resources/index.d.ts +53 -0
  702. package/dist/mcp/resources/index.d.ts.map +1 -0
  703. package/dist/mcp/resources/index.js +278 -0
  704. package/dist/mcp/resources/index.js.map +1 -0
  705. package/package.json +3 -3
@@ -0,0 +1,950 @@
1
+ /**
2
+ * Task Engine
3
+ *
4
+ * Native TypeScript implementation of core task CRUD operations.
5
+ * Uses StoreProvider (via getStore()) for task/session data access,
6
+ * falling back to direct JSON for config and specialized operations.
7
+ *
8
+ * CRUD operations (show, list, find, exists, create, update, complete, delete, archive)
9
+ * delegate to src/core/tasks/*.
10
+ *
11
+ * Non-CRUD operations delegate to src/core/tasks/task-ops.ts.
12
+ *
13
+ * @task T4657
14
+ * @task T4790
15
+ * @epic T4654
16
+ */
17
+ // validation-rules.js still used by other engines; core modules handle their own validation
18
+ // Core module imports for accessor-based operations
19
+ import { addTask as coreAddTask, archiveTasks as coreArchiveTasks, completeTask as coreCompleteTask, deleteTask as coreDeleteTask, findTasks as coreFindTasks, listTasks as coreListTasks, showTask as coreShowTask, coreTaskAnalyze, coreTaskBatchValidate, coreTaskBlockers, coreTaskCancel, coreTaskComplexityEstimate, coreTaskDepends, coreTaskDeps, coreTaskDepsCycles, coreTaskDepsOverview, coreTaskExport, coreTaskHistory, coreTaskImport, coreTaskLint, coreTaskNext, coreTaskPromote, coreTaskRelates, coreTaskRelatesAdd, coreTaskReopen, coreTaskReorder, coreTaskReparent, coreTaskRestore, coreTaskStats, coreTaskTree, coreTaskUnarchive, updateTask as coreUpdateTask, getAccessor, toCompact, } from '@cleocode/core/internal';
20
+ import { engineError } from './_error.js';
21
+ const TASK_COMPLETE_EXIT_TO_ENGINE_CODE = {
22
+ 4: 'E_NOT_FOUND',
23
+ 5: 'E_DEPENDENCY_ERROR',
24
+ 6: 'E_VALIDATION_FAILED',
25
+ 16: 'E_HAS_CHILDREN',
26
+ 17: 'E_TASK_COMPLETED',
27
+ 40: 'E_VERIFICATION_INIT_FAILED',
28
+ 44: 'E_MAX_ROUNDS_EXCEEDED',
29
+ 45: 'E_GATE_DEPENDENCY',
30
+ 80: 'E_LIFECYCLE_GATE_FAILED',
31
+ };
32
+ /**
33
+ * Convert a core Task to a TaskRecord for backward compatibility.
34
+ * TaskRecord has string-typed status/priority; Task has union types.
35
+ *
36
+ * @task T4657
37
+ * @epic T4654
38
+ */
39
+ function taskToRecord(task) {
40
+ // Task union-typed fields (status, priority, origin, etc.) widen to string in TaskRecord.
41
+ // Some fields have structural mismatches (blockedBy: string vs string[], etc.)
42
+ // so we explicitly map each field rather than relying on spread.
43
+ return {
44
+ id: task.id,
45
+ title: task.title,
46
+ description: task.description ?? '',
47
+ status: task.status,
48
+ priority: task.priority,
49
+ type: task.type,
50
+ phase: task.phase,
51
+ createdAt: task.createdAt,
52
+ updatedAt: task.updatedAt ?? null,
53
+ completedAt: task.completedAt ?? null,
54
+ cancelledAt: task.cancelledAt ?? null,
55
+ parentId: task.parentId,
56
+ position: task.position,
57
+ positionVersion: task.positionVersion,
58
+ depends: task.depends,
59
+ relates: task.relates,
60
+ files: task.files,
61
+ acceptance: task.acceptance,
62
+ notes: task.notes,
63
+ labels: task.labels,
64
+ size: task.size ?? null,
65
+ epicLifecycle: task.epicLifecycle ?? null,
66
+ noAutoComplete: task.noAutoComplete ?? null,
67
+ verification: task.verification ? { ...task.verification } : null,
68
+ origin: task.origin ?? null,
69
+ cancellationReason: task.cancellationReason,
70
+ blockedBy: task.blockedBy ? [task.blockedBy] : undefined,
71
+ };
72
+ }
73
+ /**
74
+ * Convert an array of core Tasks to TaskRecords.
75
+ *
76
+ * @task T4657
77
+ * @epic T4654
78
+ */
79
+ function tasksToRecords(tasks) {
80
+ return tasks.map(taskToRecord);
81
+ }
82
+ // loadTaskFile and saveTaskFile removed — all operations now use DataAccessor.
83
+ // Config reads (hierarchy limits, phase meta) still use readJsonFile directly
84
+ // since they are NOT domain data (they don't go through the accessor).
85
+ // Priority normalization moved to core/tasks/add.ts (normalizePriority)
86
+ // ===== Query Operations =====
87
+ /**
88
+ * Get a single task by ID
89
+ * @task T4657
90
+ * @epic T4654
91
+ */
92
+ export async function taskShow(projectRoot, taskId) {
93
+ try {
94
+ const accessor = await getAccessor(projectRoot);
95
+ const detail = await coreShowTask(taskId, projectRoot, accessor);
96
+ return { success: true, data: { task: taskToRecord(detail) } };
97
+ }
98
+ catch (err) {
99
+ const code = err?.code;
100
+ if (code === 4 /* NOT_FOUND */) {
101
+ return engineError('E_NOT_FOUND', err.message || `Task '${taskId}' not found`);
102
+ }
103
+ if (code === 2 /* INVALID_INPUT */) {
104
+ return engineError('E_INVALID_INPUT', err.message || 'Invalid input');
105
+ }
106
+ return engineError('E_NOT_INITIALIZED', err.message || 'Task database not initialized');
107
+ }
108
+ }
109
+ /**
110
+ * List tasks with optional filters
111
+ * @task T4657
112
+ * @epic T4654
113
+ */
114
+ export async function taskList(projectRoot, params) {
115
+ try {
116
+ const accessor = await getAccessor(projectRoot);
117
+ const result = await coreListTasks({
118
+ parentId: params?.parent ?? undefined,
119
+ status: params?.status,
120
+ priority: params?.priority,
121
+ type: params?.type,
122
+ phase: params?.phase,
123
+ label: params?.label,
124
+ children: params?.children,
125
+ limit: params?.limit,
126
+ offset: params?.offset,
127
+ }, projectRoot, accessor);
128
+ const tasks = params?.compact
129
+ ? result.tasks.map((t) => toCompact(t))
130
+ : tasksToRecords(result.tasks);
131
+ if (params?.compact) {
132
+ return {
133
+ success: true,
134
+ data: { tasks, total: result.total, filtered: result.filtered },
135
+ page: result.page,
136
+ };
137
+ }
138
+ return {
139
+ success: true,
140
+ data: { tasks, total: result.total, filtered: result.filtered },
141
+ page: result.page,
142
+ };
143
+ }
144
+ catch (err) {
145
+ const code = err?.code;
146
+ if (code === 4)
147
+ return engineError('E_NOT_FOUND', err.message || 'Task not found');
148
+ if (code === 2)
149
+ return engineError('E_INVALID_INPUT', err.message || 'Invalid input');
150
+ return engineError('E_NOT_INITIALIZED', err.message || 'Task database not initialized');
151
+ }
152
+ }
153
+ /**
154
+ * Fuzzy search tasks by title/description/ID
155
+ * @task T4657
156
+ * @epic T4654
157
+ */
158
+ export async function taskFind(projectRoot, query, limit, options) {
159
+ try {
160
+ const accessor = await getAccessor(projectRoot);
161
+ const findResult = await coreFindTasks({
162
+ query,
163
+ id: options?.id,
164
+ exact: options?.exact,
165
+ status: options?.status,
166
+ includeArchive: options?.includeArchive,
167
+ limit: limit ?? 20,
168
+ offset: options?.offset,
169
+ }, projectRoot, accessor);
170
+ const results = findResult.results.map((r) => ({
171
+ id: r.id,
172
+ title: r.title,
173
+ status: r.status,
174
+ priority: r.priority,
175
+ parentId: r.parentId,
176
+ }));
177
+ return { success: true, data: { results, total: results.length } };
178
+ }
179
+ catch (err) {
180
+ const code = err?.code;
181
+ if (code === 4)
182
+ return engineError('E_NOT_FOUND', err.message || 'Task not found');
183
+ if (code === 2)
184
+ return engineError('E_INVALID_INPUT', err.message || 'Invalid input');
185
+ return engineError('E_NOT_INITIALIZED', err.message || 'Task database not initialized');
186
+ }
187
+ }
188
+ /**
189
+ * Check if a task exists
190
+ * @task T4657
191
+ * @epic T4654
192
+ */
193
+ export async function taskExists(projectRoot, taskId) {
194
+ try {
195
+ const accessor = await getAccessor(projectRoot);
196
+ const exists = await accessor.taskExists(taskId);
197
+ return { success: true, data: { exists, taskId } };
198
+ }
199
+ catch {
200
+ return { success: true, data: { exists: false, taskId } };
201
+ }
202
+ }
203
+ // ===== Mutate Operations =====
204
+ /**
205
+ * Create a new task
206
+ */
207
+ export async function taskCreate(projectRoot, params) {
208
+ try {
209
+ const accessor = await getAccessor(projectRoot);
210
+ const result = await coreAddTask({
211
+ title: params.title,
212
+ description: params.description,
213
+ parentId: params.parent || null,
214
+ depends: params.depends,
215
+ priority: params.priority || 'medium',
216
+ labels: params.labels,
217
+ type: params.type || undefined,
218
+ phase: params.phase,
219
+ size: params.size,
220
+ acceptance: params.acceptance,
221
+ notes: params.notes,
222
+ files: params.files,
223
+ }, projectRoot, accessor);
224
+ return {
225
+ success: true,
226
+ data: { task: taskToRecord(result.task), duplicate: result.duplicate ?? false },
227
+ };
228
+ }
229
+ catch (err) {
230
+ const cleoErr = err;
231
+ // Map CleoError exit codes to engine error codes (see src/types/exit-codes.ts)
232
+ if (cleoErr.code === 10 /* PARENT_NOT_FOUND */) {
233
+ return engineError('E_PARENT_NOT_FOUND', cleoErr.message ?? 'Parent task not found');
234
+ }
235
+ if (cleoErr.code === 11 /* DEPTH_EXCEEDED */) {
236
+ return engineError('E_DEPTH_EXCEEDED', cleoErr.message ?? 'Max hierarchy depth exceeded');
237
+ }
238
+ if (cleoErr.code === 12 /* SIBLING_LIMIT */) {
239
+ return engineError('E_SIBLING_LIMIT', cleoErr.message ?? 'Max siblings exceeded');
240
+ }
241
+ if (cleoErr.code === 13 /* INVALID_PARENT_TYPE */) {
242
+ return engineError('E_INVALID_PARENT', cleoErr.message ?? 'Invalid parent type');
243
+ }
244
+ if (cleoErr.code === 14 /* CIRCULAR_REFERENCE */) {
245
+ return engineError('E_CIRCULAR_REFERENCE', cleoErr.message ?? 'Circular reference detected');
246
+ }
247
+ if (cleoErr.code === 6 /* VALIDATION_ERROR */ || cleoErr.code === 2 /* INVALID_INPUT */) {
248
+ return engineError('E_VALIDATION_FAILED', cleoErr.message ?? 'Validation failed');
249
+ }
250
+ if (cleoErr.code === 4 /* NOT_FOUND */) {
251
+ return engineError('E_NOT_FOUND', cleoErr.message ?? 'Task not found');
252
+ }
253
+ return engineError('E_NOT_INITIALIZED', cleoErr.message ?? 'Task database not initialized');
254
+ }
255
+ }
256
+ /**
257
+ * Update a task
258
+ */
259
+ export async function taskUpdate(projectRoot, taskId, updates) {
260
+ try {
261
+ const accessor = await getAccessor(projectRoot);
262
+ const result = await coreUpdateTask({
263
+ taskId,
264
+ title: updates.title,
265
+ description: updates.description,
266
+ status: updates.status,
267
+ priority: updates.priority,
268
+ notes: updates.notes,
269
+ labels: updates.labels,
270
+ addLabels: updates.addLabels,
271
+ removeLabels: updates.removeLabels,
272
+ depends: updates.depends,
273
+ addDepends: updates.addDepends,
274
+ removeDepends: updates.removeDepends,
275
+ acceptance: updates.acceptance,
276
+ parentId: updates.parent,
277
+ type: updates.type,
278
+ size: updates.size,
279
+ }, projectRoot, accessor);
280
+ return { success: true, data: { task: taskToRecord(result.task), changes: result.changes } };
281
+ }
282
+ catch (err) {
283
+ const cleoErr = err;
284
+ if (cleoErr.code === 4 /* NOT_FOUND */) {
285
+ return engineError('E_NOT_FOUND', cleoErr.message ?? `Task '${taskId}' not found`);
286
+ }
287
+ if (cleoErr.code === 6 /* VALIDATION_ERROR */ || cleoErr.code === 2 /* INVALID_INPUT */) {
288
+ return engineError('E_VALIDATION_FAILED', cleoErr.message ?? 'Validation failed');
289
+ }
290
+ if (cleoErr.code === 102 /* NO_CHANGE */) {
291
+ return engineError('E_NO_CHANGE', cleoErr.message ?? 'No changes specified');
292
+ }
293
+ return engineError('E_NOT_INITIALIZED', cleoErr.message ?? 'Task database not initialized');
294
+ }
295
+ }
296
+ /**
297
+ * Complete a task (set status to done)
298
+ */
299
+ export async function taskComplete(projectRoot, taskId, notes) {
300
+ try {
301
+ const accessor = await getAccessor(projectRoot);
302
+ const result = await coreCompleteTask({ taskId, notes }, projectRoot, accessor);
303
+ return {
304
+ success: true,
305
+ data: {
306
+ task: result.task,
307
+ ...(result.autoCompleted && { autoCompleted: result.autoCompleted }),
308
+ ...(result.unblockedTasks && { unblockedTasks: result.unblockedTasks }),
309
+ },
310
+ };
311
+ }
312
+ catch (err) {
313
+ const cleoErr = err;
314
+ const message = cleoErr.message ?? 'Failed to complete task';
315
+ if (typeof cleoErr.code === 'number') {
316
+ const mappedCode = TASK_COMPLETE_EXIT_TO_ENGINE_CODE[cleoErr.code];
317
+ if (mappedCode) {
318
+ return engineError(mappedCode, message);
319
+ }
320
+ }
321
+ return engineError('E_INTERNAL', message);
322
+ }
323
+ }
324
+ /**
325
+ * Delete a task
326
+ */
327
+ export async function taskDelete(projectRoot, taskId, force) {
328
+ try {
329
+ const accessor = await getAccessor(projectRoot);
330
+ const result = await coreDeleteTask({
331
+ taskId,
332
+ force: force ?? false,
333
+ cascade: force ?? false,
334
+ }, projectRoot, accessor);
335
+ return {
336
+ success: true,
337
+ data: {
338
+ deletedTask: taskToRecord(result.deletedTask),
339
+ deleted: true,
340
+ cascadeDeleted: result.cascadeDeleted,
341
+ },
342
+ };
343
+ }
344
+ catch (err) {
345
+ const cleoErr = err;
346
+ if (cleoErr.code === 4 /* NOT_FOUND */) {
347
+ return engineError('E_NOT_FOUND', cleoErr.message ?? `Task '${taskId}' not found`);
348
+ }
349
+ if (cleoErr.code === 16 /* HAS_CHILDREN */) {
350
+ return engineError('E_HAS_CHILDREN', cleoErr.message ?? `Task '${taskId}' has children`);
351
+ }
352
+ return engineError('E_NOT_INITIALIZED', cleoErr.message ?? 'Task database not initialized');
353
+ }
354
+ }
355
+ /**
356
+ * Archive completed tasks.
357
+ * Moves done/cancelled tasks from active task data to archive.
358
+ */
359
+ export async function taskArchive(projectRoot, taskId, before) {
360
+ try {
361
+ const accessor = await getAccessor(projectRoot);
362
+ const result = await coreArchiveTasks({
363
+ taskIds: taskId ? [taskId] : undefined,
364
+ before,
365
+ }, projectRoot, accessor);
366
+ return {
367
+ success: true,
368
+ data: {
369
+ archivedCount: result.archived.length,
370
+ archivedTasks: result.archived.map((id) => ({ id })),
371
+ },
372
+ };
373
+ }
374
+ catch (err) {
375
+ const cleoErr = err;
376
+ if (cleoErr.code === 4 /* NOT_FOUND */) {
377
+ return engineError('E_NOT_FOUND', cleoErr.message ?? 'Task not found');
378
+ }
379
+ return engineError('E_NOT_INITIALIZED', cleoErr.message ?? 'Task database not initialized');
380
+ }
381
+ }
382
+ // ===== Non-CRUD Operations (delegated to core/tasks/task-ops.ts) =====
383
+ /**
384
+ * Suggest next task to work on based on priority, phase alignment, age, and dependency readiness.
385
+ * @task T4657
386
+ * @task T4790
387
+ * @epic T4654
388
+ */
389
+ export async function taskNext(projectRoot, params) {
390
+ try {
391
+ const result = await coreTaskNext(projectRoot, params);
392
+ return { success: true, data: result };
393
+ }
394
+ catch {
395
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
396
+ }
397
+ }
398
+ /**
399
+ * Show blocked tasks and analyze blocking chains.
400
+ * @task T4657
401
+ * @task T4790
402
+ * @epic T4654
403
+ */
404
+ export async function taskBlockers(projectRoot, params) {
405
+ try {
406
+ const result = await coreTaskBlockers(projectRoot, params);
407
+ return { success: true, data: result };
408
+ }
409
+ catch {
410
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
411
+ }
412
+ }
413
+ /**
414
+ * Build hierarchy tree.
415
+ * @task T4657
416
+ * @task T4790
417
+ * @epic T4654
418
+ */
419
+ export async function taskTree(projectRoot, taskId) {
420
+ try {
421
+ const result = await coreTaskTree(projectRoot, taskId);
422
+ return { success: true, data: result };
423
+ }
424
+ catch (err) {
425
+ const message = err instanceof Error ? err.message : String(err);
426
+ if (message.includes('not found')) {
427
+ return engineError('E_NOT_FOUND', message);
428
+ }
429
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
430
+ }
431
+ }
432
+ /**
433
+ * Show dependencies for a task - both what it depends on and what depends on it.
434
+ * @task T4657
435
+ * @task T4790
436
+ * @epic T4654
437
+ */
438
+ export async function taskDeps(projectRoot, taskId) {
439
+ try {
440
+ const result = await coreTaskDeps(projectRoot, taskId);
441
+ return { success: true, data: result };
442
+ }
443
+ catch (err) {
444
+ const message = err instanceof Error ? err.message : String(err);
445
+ if (message.includes('not found')) {
446
+ return engineError('E_NOT_FOUND', message);
447
+ }
448
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
449
+ }
450
+ }
451
+ /**
452
+ * Show task relations (existing relates entries).
453
+ * @task T4657
454
+ * @task T4790
455
+ * @epic T4654
456
+ */
457
+ export async function taskRelates(projectRoot, taskId) {
458
+ try {
459
+ const result = await coreTaskRelates(projectRoot, taskId);
460
+ return { success: true, data: result };
461
+ }
462
+ catch (err) {
463
+ const message = err instanceof Error ? err.message : String(err);
464
+ if (message.includes('not found')) {
465
+ return engineError('E_NOT_FOUND', message);
466
+ }
467
+ return engineError('E_GENERAL', `Failed to read task relations: ${message}`);
468
+ }
469
+ }
470
+ /**
471
+ * Add a relation between two tasks.
472
+ * @task T4790
473
+ */
474
+ export async function taskRelatesAdd(projectRoot, taskId, relatedId, type, reason) {
475
+ try {
476
+ const result = await coreTaskRelatesAdd(projectRoot, taskId, relatedId, type, reason);
477
+ return { success: true, data: result };
478
+ }
479
+ catch (err) {
480
+ const message = err instanceof Error ? err.message : String(err);
481
+ if (message.includes('not found')) {
482
+ return engineError('E_NOT_FOUND', message);
483
+ }
484
+ if (message.includes('Invalid relation type')) {
485
+ return engineError('E_VALIDATION', message, {
486
+ fix: 'Use a valid relation type: related, blocks, duplicates, absorbs, fixes, extends, supersedes',
487
+ });
488
+ }
489
+ return engineError('E_GENERAL', `Failed to update task relations: ${message}`);
490
+ }
491
+ }
492
+ /**
493
+ * Analyze a task for description quality, missing fields, and dependency health.
494
+ * @task T4657
495
+ * @task T4790
496
+ * @epic T4654
497
+ */
498
+ export async function taskAnalyze(projectRoot, taskId, params) {
499
+ try {
500
+ const result = await coreTaskAnalyze(projectRoot, taskId, params);
501
+ return { success: true, data: result };
502
+ }
503
+ catch (err) {
504
+ const message = err instanceof Error ? err.message : String(err);
505
+ if (message.includes('not found')) {
506
+ return engineError('E_NOT_FOUND', message);
507
+ }
508
+ return engineError('E_GENERAL', `Task analysis failed: ${message}`);
509
+ }
510
+ }
511
+ /**
512
+ * Restore a cancelled task back to pending.
513
+ * @task T4790
514
+ */
515
+ export async function taskRestore(projectRoot, taskId, params) {
516
+ try {
517
+ const result = await coreTaskRestore(projectRoot, taskId, params);
518
+ return { success: true, data: result };
519
+ }
520
+ catch (err) {
521
+ const message = err instanceof Error ? err.message : String(err);
522
+ if (message.includes('not found')) {
523
+ return engineError('E_NOT_FOUND', message);
524
+ }
525
+ if (message.includes('not cancelled')) {
526
+ return engineError('E_INVALID_INPUT', message);
527
+ }
528
+ return engineError('E_NOT_INITIALIZED', 'Failed to restore task');
529
+ }
530
+ }
531
+ /**
532
+ * Move an archived task back to active task data with status 'done' (or specified status).
533
+ * @task T4790
534
+ */
535
+ export async function taskUnarchive(projectRoot, taskId, params) {
536
+ try {
537
+ const result = await coreTaskUnarchive(projectRoot, taskId, params);
538
+ return { success: true, data: result };
539
+ }
540
+ catch (err) {
541
+ const message = err instanceof Error ? err.message : String(err);
542
+ if (message.includes('not found')) {
543
+ return engineError('E_NOT_FOUND', message);
544
+ }
545
+ if (message.includes('already exists')) {
546
+ return engineError('E_ID_COLLISION', message);
547
+ }
548
+ return engineError('E_NOT_INITIALIZED', 'Failed to unarchive task');
549
+ }
550
+ }
551
+ /**
552
+ * Change task position within its sibling group.
553
+ * @task T4790
554
+ */
555
+ export async function taskReorder(projectRoot, taskId, position) {
556
+ try {
557
+ const result = await coreTaskReorder(projectRoot, taskId, position);
558
+ return { success: true, data: result };
559
+ }
560
+ catch (err) {
561
+ const message = err instanceof Error ? err.message : String(err);
562
+ if (message.includes('not found')) {
563
+ return engineError('E_NOT_FOUND', message);
564
+ }
565
+ return engineError('E_NOT_INITIALIZED', 'Failed to reorder task');
566
+ }
567
+ }
568
+ /**
569
+ * Move task under a different parent.
570
+ * @task T4790
571
+ */
572
+ export async function taskReparent(projectRoot, taskId, newParentId) {
573
+ try {
574
+ const result = await coreTaskReparent(projectRoot, taskId, newParentId);
575
+ return { success: true, data: result };
576
+ }
577
+ catch (err) {
578
+ const message = err instanceof Error ? err.message : String(err);
579
+ if (message.includes('not found')) {
580
+ const code = message.includes('Parent') ? 'E_PARENT_NOT_FOUND' : 'E_NOT_FOUND';
581
+ return engineError(code, message);
582
+ }
583
+ if (message.includes('subtask')) {
584
+ return engineError('E_INVALID_PARENT_TYPE', message);
585
+ }
586
+ if (message.includes('circular')) {
587
+ return engineError('E_CIRCULAR_REFERENCE', message);
588
+ }
589
+ if (message.includes('depth')) {
590
+ return engineError('E_DEPTH_EXCEEDED', message);
591
+ }
592
+ if (message.includes('siblings')) {
593
+ return engineError('E_SIBLING_LIMIT', message);
594
+ }
595
+ return engineError('E_NOT_INITIALIZED', 'Failed to reparent task');
596
+ }
597
+ }
598
+ /**
599
+ * Promote a subtask to task or task to root (remove parent).
600
+ * @task T4790
601
+ */
602
+ export async function taskPromote(projectRoot, taskId) {
603
+ try {
604
+ const result = await coreTaskPromote(projectRoot, taskId);
605
+ return { success: true, data: result };
606
+ }
607
+ catch (err) {
608
+ const message = err instanceof Error ? err.message : String(err);
609
+ if (message.includes('not found')) {
610
+ return engineError('E_NOT_FOUND', message);
611
+ }
612
+ return engineError('E_NOT_INITIALIZED', 'Failed to promote task');
613
+ }
614
+ }
615
+ /**
616
+ * Reopen a completed task (set status back to pending).
617
+ * @task T4790
618
+ */
619
+ export async function taskReopen(projectRoot, taskId, params) {
620
+ try {
621
+ const result = await coreTaskReopen(projectRoot, taskId, params);
622
+ return { success: true, data: result };
623
+ }
624
+ catch (err) {
625
+ const message = err instanceof Error ? err.message : String(err);
626
+ if (message.includes('not found')) {
627
+ return engineError('E_NOT_FOUND', message);
628
+ }
629
+ if (message.includes('not completed')) {
630
+ return engineError('E_INVALID_INPUT', message);
631
+ }
632
+ if (message.includes('Invalid target')) {
633
+ return engineError('E_INVALID_INPUT', message);
634
+ }
635
+ return engineError('E_NOT_INITIALIZED', 'Failed to reopen task');
636
+ }
637
+ }
638
+ /**
639
+ * Cancel a task (soft terminal state — reversible via restore).
640
+ * @task T4529
641
+ */
642
+ export async function taskCancel(projectRoot, taskId, reason) {
643
+ try {
644
+ const result = await coreTaskCancel(projectRoot, taskId, { reason });
645
+ return { success: true, data: result };
646
+ }
647
+ catch (err) {
648
+ const message = err instanceof Error ? err.message : String(err);
649
+ if (message.includes('not found'))
650
+ return engineError('E_NOT_FOUND', message);
651
+ if (message.includes('already cancelled') || message.includes('completed'))
652
+ return engineError('E_INVALID_INPUT', message);
653
+ return engineError('E_INTERNAL', message);
654
+ }
655
+ }
656
+ /**
657
+ * Deterministic complexity scoring from task metadata.
658
+ * @task T4657
659
+ * @task T4790
660
+ * @epic T4654
661
+ */
662
+ export async function taskComplexityEstimate(projectRoot, params) {
663
+ try {
664
+ const result = await coreTaskComplexityEstimate(projectRoot, params);
665
+ return { success: true, data: result };
666
+ }
667
+ catch (err) {
668
+ const message = err instanceof Error ? err.message : String(err);
669
+ if (message.includes('not found')) {
670
+ return engineError('E_NOT_FOUND', message);
671
+ }
672
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
673
+ }
674
+ }
675
+ /**
676
+ * List dependencies for a task in a given direction.
677
+ * @task T4657
678
+ * @task T4790
679
+ * @epic T4654
680
+ */
681
+ export async function taskDepends(projectRoot, taskId, direction = 'both', tree) {
682
+ try {
683
+ const result = await coreTaskDepends(projectRoot, taskId, direction, tree ? { tree } : undefined);
684
+ return { success: true, data: result };
685
+ }
686
+ catch (err) {
687
+ const message = err instanceof Error ? err.message : String(err);
688
+ if (message.includes('not found')) {
689
+ return engineError('E_NOT_FOUND', message);
690
+ }
691
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
692
+ }
693
+ }
694
+ /**
695
+ * Overview of all dependencies across the project.
696
+ * @task T5157
697
+ */
698
+ export async function taskDepsOverview(projectRoot) {
699
+ try {
700
+ const result = await coreTaskDepsOverview(projectRoot);
701
+ return { success: true, data: result };
702
+ }
703
+ catch (err) {
704
+ const message = err instanceof Error ? err.message : String(err);
705
+ return engineError('E_NOT_INITIALIZED', message);
706
+ }
707
+ }
708
+ /**
709
+ * Detect circular dependencies across the project.
710
+ * @task T5157
711
+ */
712
+ export async function taskDepsCycles(projectRoot) {
713
+ try {
714
+ const result = await coreTaskDepsCycles(projectRoot);
715
+ return { success: true, data: result };
716
+ }
717
+ catch (err) {
718
+ const message = err instanceof Error ? err.message : String(err);
719
+ return engineError('E_NOT_INITIALIZED', message);
720
+ }
721
+ }
722
+ /**
723
+ * Compute task statistics, optionally scoped to an epic.
724
+ * @task T4657
725
+ * @task T4790
726
+ * @epic T4654
727
+ */
728
+ export async function taskStats(projectRoot, epicId) {
729
+ try {
730
+ const result = await coreTaskStats(projectRoot, epicId);
731
+ return { success: true, data: result };
732
+ }
733
+ catch {
734
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
735
+ }
736
+ }
737
+ /**
738
+ * Export tasks as JSON or CSV.
739
+ * @task T4657
740
+ * @task T4790
741
+ * @epic T4654
742
+ */
743
+ export async function taskExport(projectRoot, params) {
744
+ try {
745
+ const result = await coreTaskExport(projectRoot, params);
746
+ return { success: true, data: result };
747
+ }
748
+ catch {
749
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
750
+ }
751
+ }
752
+ /**
753
+ * Get task history from the log file.
754
+ * @task T4657
755
+ * @task T4790
756
+ * @epic T4654
757
+ */
758
+ export async function taskHistory(projectRoot, taskId, limit) {
759
+ try {
760
+ const result = await coreTaskHistory(projectRoot, taskId, limit);
761
+ return { success: true, data: result };
762
+ }
763
+ catch {
764
+ return engineError('E_NOT_INITIALIZED', 'Failed to read task history');
765
+ }
766
+ }
767
+ /**
768
+ * Lint tasks for common issues.
769
+ * @task T4657
770
+ * @task T4790
771
+ * @epic T4654
772
+ */
773
+ export async function taskLint(projectRoot, taskId) {
774
+ try {
775
+ const result = await coreTaskLint(projectRoot, taskId);
776
+ return { success: true, data: result };
777
+ }
778
+ catch (err) {
779
+ const message = err instanceof Error ? err.message : String(err);
780
+ if (message.includes('not found')) {
781
+ return engineError('E_NOT_FOUND', message);
782
+ }
783
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
784
+ }
785
+ }
786
+ /**
787
+ * Validate multiple tasks at once.
788
+ * @task T4657
789
+ * @task T4790
790
+ * @epic T4654
791
+ */
792
+ export async function taskBatchValidate(projectRoot, taskIds, checkMode = 'full') {
793
+ try {
794
+ const result = await coreTaskBatchValidate(projectRoot, taskIds, checkMode);
795
+ return { success: true, data: result };
796
+ }
797
+ catch {
798
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
799
+ }
800
+ }
801
+ /**
802
+ * Import tasks from a JSON source string or export package.
803
+ * @task T4790
804
+ */
805
+ export async function taskImport(projectRoot, source, overwrite) {
806
+ try {
807
+ const result = await coreTaskImport(projectRoot, source, overwrite);
808
+ return { success: true, data: result };
809
+ }
810
+ catch (err) {
811
+ const message = err instanceof Error ? err.message : String(err);
812
+ if (message.includes('Invalid JSON')) {
813
+ return engineError('E_INVALID_INPUT', message);
814
+ }
815
+ return engineError('E_NOT_INITIALIZED', 'Failed to import tasks');
816
+ }
817
+ }
818
+ /**
819
+ * Compute a ranked plan: in-progress epics, ready tasks, blockers, bugs.
820
+ * @task T4815
821
+ */
822
+ export async function taskPlan(projectRoot) {
823
+ const { coreTaskPlan } = await import('@cleocode/core/internal');
824
+ try {
825
+ const result = await coreTaskPlan(projectRoot);
826
+ return { success: true, data: result };
827
+ }
828
+ catch {
829
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
830
+ }
831
+ }
832
+ /**
833
+ * Find related tasks using semantic search or keyword matching.
834
+ * @task T5672
835
+ */
836
+ export async function taskRelatesFind(projectRoot, taskId, params) {
837
+ try {
838
+ const { suggestRelated, discoverRelated } = await import('@cleocode/core/internal');
839
+ const accessor = await getAccessor(projectRoot);
840
+ const mode = params?.mode ?? 'suggest';
841
+ let result;
842
+ if (mode === 'discover') {
843
+ result = await discoverRelated(taskId, undefined, accessor);
844
+ }
845
+ else {
846
+ const threshold = params?.threshold ?? 50;
847
+ result = await suggestRelated(taskId, { threshold }, accessor);
848
+ }
849
+ return { success: true, data: result };
850
+ }
851
+ catch (err) {
852
+ const message = err instanceof Error ? err.message : String(err);
853
+ if (message.includes('not found')) {
854
+ return engineError('E_NOT_FOUND', message);
855
+ }
856
+ return engineError('E_INTERNAL', message);
857
+ }
858
+ }
859
+ /**
860
+ * List all labels used in tasks.
861
+ * @task T5672
862
+ */
863
+ export async function taskLabelList(projectRoot) {
864
+ try {
865
+ const { listLabels } = await import('@cleocode/core/internal');
866
+ const accessor = await getAccessor(projectRoot);
867
+ const labels = await listLabels(projectRoot, accessor);
868
+ return { success: true, data: { labels, count: labels.length } };
869
+ }
870
+ catch {
871
+ return engineError('E_NOT_INITIALIZED', 'Task database not initialized');
872
+ }
873
+ }
874
+ /**
875
+ * Show tasks associated with a label.
876
+ * @task T5672
877
+ */
878
+ export async function taskLabelShow(projectRoot, label) {
879
+ try {
880
+ const { showLabelTasks } = await import('@cleocode/core/internal');
881
+ const accessor = await getAccessor(projectRoot);
882
+ const result = await showLabelTasks(label, projectRoot, accessor);
883
+ return { success: true, data: result };
884
+ }
885
+ catch (err) {
886
+ const message = err instanceof Error ? err.message : String(err);
887
+ return engineError('E_INTERNAL', message);
888
+ }
889
+ }
890
+ // ---------------------------------------------------------------------------
891
+ // Sync sub-domain (provider-agnostic task reconciliation)
892
+ // ---------------------------------------------------------------------------
893
+ /**
894
+ * Reconcile external tasks with CLEO as SSoT.
895
+ */
896
+ export async function taskSyncReconcile(projectRoot, params) {
897
+ try {
898
+ const { reconcile } = await import('@cleocode/core/internal');
899
+ const accessor = await getAccessor(projectRoot);
900
+ const result = await reconcile(params.externalTasks, {
901
+ providerId: params.providerId,
902
+ cwd: projectRoot,
903
+ dryRun: params.dryRun,
904
+ conflictPolicy: params.conflictPolicy,
905
+ defaultPhase: params.defaultPhase,
906
+ defaultLabels: params.defaultLabels,
907
+ }, accessor);
908
+ return { success: true, data: result };
909
+ }
910
+ catch (err) {
911
+ const message = err instanceof Error ? err.message : String(err);
912
+ return engineError('E_INTERNAL', message);
913
+ }
914
+ }
915
+ /**
916
+ * List external task links by provider or task ID.
917
+ */
918
+ export async function taskSyncLinks(projectRoot, params) {
919
+ try {
920
+ const { getLinksByProvider, getLinksByTaskId } = await import('@cleocode/core/internal');
921
+ if (params?.taskId) {
922
+ const links = await getLinksByTaskId(params.taskId, projectRoot);
923
+ return { success: true, data: { links, count: links.length } };
924
+ }
925
+ if (params?.providerId) {
926
+ const links = await getLinksByProvider(params.providerId, projectRoot);
927
+ return { success: true, data: { links, count: links.length } };
928
+ }
929
+ return engineError('E_INVALID_INPUT', 'Either providerId or taskId is required');
930
+ }
931
+ catch (err) {
932
+ const message = err instanceof Error ? err.message : String(err);
933
+ return engineError('E_INTERNAL', message);
934
+ }
935
+ }
936
+ /**
937
+ * Remove all external task links for a provider.
938
+ */
939
+ export async function taskSyncLinksRemove(projectRoot, providerId) {
940
+ try {
941
+ const { removeLinksByProvider } = await import('@cleocode/core/internal');
942
+ const removed = await removeLinksByProvider(providerId, projectRoot);
943
+ return { success: true, data: { providerId, removed } };
944
+ }
945
+ catch (err) {
946
+ const message = err instanceof Error ? err.message : String(err);
947
+ return engineError('E_INTERNAL', message);
948
+ }
949
+ }
950
+ //# sourceMappingURL=task-engine.js.map