@cleocode/core 2026.3.76 → 2026.4.2

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 (473) hide show
  1. package/dist/agents/agent-schema.d.ts.map +1 -1
  2. package/dist/audit.d.ts +1 -1
  3. package/dist/audit.d.ts.map +1 -1
  4. package/dist/bootstrap.d.ts +2 -2
  5. package/dist/bootstrap.d.ts.map +1 -1
  6. package/dist/caamp/adapter.d.ts +6 -49
  7. package/dist/caamp/adapter.d.ts.map +1 -1
  8. package/dist/caamp/index.d.ts +2 -2
  9. package/dist/caamp/index.d.ts.map +1 -1
  10. package/dist/code/index.d.ts +10 -0
  11. package/dist/code/index.d.ts.map +1 -0
  12. package/dist/code/outline.d.ts +51 -0
  13. package/dist/code/outline.d.ts.map +1 -0
  14. package/dist/code/parser.d.ts +32 -0
  15. package/dist/code/parser.d.ts.map +1 -0
  16. package/dist/code/search.d.ts +42 -0
  17. package/dist/code/search.d.ts.map +1 -0
  18. package/dist/code/unfold.d.ts +44 -0
  19. package/dist/code/unfold.d.ts.map +1 -0
  20. package/dist/compliance/protocol-enforcement.d.ts +1 -1
  21. package/dist/compliance/protocol-rules.d.ts +1 -1
  22. package/dist/compliance/protocol-types.d.ts +2 -3
  23. package/dist/compliance/protocol-types.d.ts.map +1 -1
  24. package/dist/conduit/conduit-client.d.ts +14 -0
  25. package/dist/conduit/conduit-client.d.ts.map +1 -1
  26. package/dist/conduit/factory.d.ts +11 -1
  27. package/dist/conduit/factory.d.ts.map +1 -1
  28. package/dist/conduit/http-transport.d.ts +17 -5
  29. package/dist/conduit/http-transport.d.ts.map +1 -1
  30. package/dist/conduit/index.d.ts +5 -2
  31. package/dist/conduit/index.d.ts.map +1 -1
  32. package/dist/conduit/local-transport.d.ts +91 -0
  33. package/dist/conduit/local-transport.d.ts.map +1 -0
  34. package/dist/conduit/sse-transport.d.ts +68 -0
  35. package/dist/conduit/sse-transport.d.ts.map +1 -0
  36. package/dist/crypto/credentials.d.ts.map +1 -1
  37. package/dist/error-catalog.d.ts +3 -3
  38. package/dist/error-catalog.d.ts.map +1 -1
  39. package/dist/errors.d.ts +1 -1
  40. package/dist/hooks/handlers/index.d.ts +2 -2
  41. package/dist/hooks/handlers/index.d.ts.map +1 -1
  42. package/dist/hooks/handlers/notification-hooks.d.ts +31 -0
  43. package/dist/hooks/handlers/notification-hooks.d.ts.map +1 -0
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +4646 -3476
  47. package/dist/index.js.map +4 -4
  48. package/dist/init.d.ts +6 -6
  49. package/dist/init.d.ts.map +1 -1
  50. package/dist/injection.d.ts.map +1 -1
  51. package/dist/internal.d.ts +7 -5
  52. package/dist/internal.d.ts.map +1 -1
  53. package/dist/lib/index.d.ts +1 -0
  54. package/dist/lib/index.d.ts.map +1 -1
  55. package/dist/lib/tree-sitter-languages.d.ts +29 -0
  56. package/dist/lib/tree-sitter-languages.d.ts.map +1 -0
  57. package/dist/logger.d.ts +3 -3
  58. package/dist/memory/brain-links.d.ts.map +1 -1
  59. package/dist/memory/brain-maintenance.d.ts +13 -0
  60. package/dist/memory/brain-maintenance.d.ts.map +1 -1
  61. package/dist/memory/brain-retrieval.d.ts +1 -1
  62. package/dist/memory/brain-retrieval.d.ts.map +1 -1
  63. package/dist/memory/decisions.d.ts.map +1 -1
  64. package/dist/memory/engine-compat.d.ts +392 -25
  65. package/dist/memory/engine-compat.d.ts.map +1 -1
  66. package/dist/memory/index.d.ts +416 -3
  67. package/dist/memory/index.d.ts.map +1 -1
  68. package/dist/metrics/token-service.d.ts +3 -3
  69. package/dist/metrics/token-service.d.ts.map +1 -1
  70. package/dist/orchestration/hierarchy.d.ts +32 -0
  71. package/dist/orchestration/hierarchy.d.ts.map +1 -0
  72. package/dist/orchestration/index.d.ts +1 -0
  73. package/dist/orchestration/index.d.ts.map +1 -1
  74. package/dist/paths.d.ts +335 -2
  75. package/dist/paths.d.ts.map +1 -1
  76. package/dist/routing/capability-matrix.d.ts +3 -3
  77. package/dist/routing/capability-matrix.d.ts.map +1 -1
  78. package/dist/scaffold.d.ts +422 -11
  79. package/dist/scaffold.d.ts.map +1 -1
  80. package/dist/security/input-sanitization.d.ts +2 -2
  81. package/dist/skills/dynamic-skill-generator.d.ts +3 -2
  82. package/dist/skills/dynamic-skill-generator.d.ts.map +1 -1
  83. package/dist/skills/routing-table.d.ts +4 -4
  84. package/dist/skills/routing-table.d.ts.map +1 -1
  85. package/dist/store/agent-registry-accessor.d.ts +10 -433
  86. package/dist/store/agent-registry-accessor.d.ts.map +1 -1
  87. package/dist/store/cross-db-cleanup.d.ts +34 -0
  88. package/dist/store/cross-db-cleanup.d.ts.map +1 -1
  89. package/dist/store/provider.d.ts +1 -1
  90. package/dist/store/signaldock-sqlite.d.ts.map +1 -1
  91. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  92. package/dist/store/sqlite.d.ts +1 -1
  93. package/dist/store/task-store.d.ts.map +1 -1
  94. package/dist/store/tasks-schema.d.ts +4 -228
  95. package/dist/store/tasks-schema.d.ts.map +1 -1
  96. package/dist/store/validation-schemas.d.ts +4 -5
  97. package/dist/store/validation-schemas.d.ts.map +1 -1
  98. package/dist/system/archive-analytics.d.ts +1 -1
  99. package/dist/system/health.d.ts +2 -2
  100. package/dist/system/health.d.ts.map +1 -1
  101. package/dist/system/runtime.d.ts +2 -1
  102. package/dist/system/runtime.d.ts.map +1 -1
  103. package/dist/tasks/list.d.ts +1 -1
  104. package/dist/tasks/list.d.ts.map +1 -1
  105. package/dist/tasks/task-ops.d.ts +415 -3
  106. package/dist/tasks/task-ops.d.ts.map +1 -1
  107. package/dist/templates/parser.d.ts +1 -1
  108. package/dist/ui/index.d.ts +1 -1
  109. package/dist/upgrade.d.ts +1 -1
  110. package/dist/upgrade.d.ts.map +1 -1
  111. package/dist/validation/operation-gate-validators.d.ts +1 -1
  112. package/dist/validation/operation-verification-gates.d.ts +3 -3
  113. package/dist/validation/param-utils.d.ts +6 -5
  114. package/dist/validation/param-utils.d.ts.map +1 -1
  115. package/dist/validation/validate-ops.d.ts +1 -1
  116. package/dist/validation/validate-ops.d.ts.map +1 -1
  117. package/package.json +19 -7
  118. package/src/__tests__/caamp-skill-install.test.js +0 -15
  119. package/src/__tests__/caamp-skill-install.test.js.map +1 -1
  120. package/src/__tests__/caamp-skill-install.test.ts +0 -16
  121. package/src/__tests__/injection-mvi-tiers.test.js +7 -7
  122. package/src/__tests__/injection-mvi-tiers.test.js.map +1 -1
  123. package/src/__tests__/injection-mvi-tiers.test.ts +55 -103
  124. package/src/agents/agent-schema.ts +2 -5
  125. package/src/audit.ts +2 -2
  126. package/src/bootstrap.ts +5 -39
  127. package/src/caamp/adapter.ts +3 -219
  128. package/src/caamp/index.ts +1 -13
  129. package/src/cant/__tests__/cant-agent-parse.test.d.ts.map +1 -0
  130. package/src/cant/__tests__/cant-agent-parse.test.js +77 -0
  131. package/src/cant/__tests__/cant-agent-parse.test.js.map +1 -0
  132. package/src/code/index.ts +10 -0
  133. package/src/code/outline.ts +214 -0
  134. package/src/code/parser.ts +331 -0
  135. package/src/code/search.ts +173 -0
  136. package/src/code/unfold.ts +204 -0
  137. package/src/codebase-map/analyzers/architecture.ts +2 -2
  138. package/src/compliance/protocol-enforcement.ts +1 -1
  139. package/src/compliance/protocol-rules.ts +1 -1
  140. package/src/compliance/protocol-types.ts +2 -3
  141. package/src/conduit/__tests__/dual-api-e2e.test.d.ts.map +1 -0
  142. package/src/conduit/__tests__/dual-api-e2e.test.js +178 -0
  143. package/src/conduit/__tests__/dual-api-e2e.test.js.map +1 -0
  144. package/src/conduit/__tests__/dual-api-e2e.test.ts +212 -0
  145. package/src/conduit/__tests__/local-credential-flow.test.d.ts.map +1 -0
  146. package/src/conduit/__tests__/local-credential-flow.test.js +185 -0
  147. package/src/conduit/__tests__/local-credential-flow.test.js.map +1 -0
  148. package/src/conduit/__tests__/local-credential-flow.test.ts +230 -0
  149. package/src/conduit/__tests__/local-transport.test.d.ts.map +1 -0
  150. package/src/conduit/__tests__/local-transport.test.js +404 -0
  151. package/src/conduit/__tests__/local-transport.test.js.map +1 -0
  152. package/src/conduit/__tests__/local-transport.test.ts +509 -0
  153. package/src/conduit/__tests__/sse-transport.test.d.ts.map +1 -0
  154. package/src/conduit/__tests__/sse-transport.test.js +291 -0
  155. package/src/conduit/__tests__/sse-transport.test.js.map +1 -0
  156. package/src/conduit/__tests__/sse-transport.test.ts +344 -0
  157. package/src/conduit/conduit-client.ts +14 -0
  158. package/src/conduit/factory.ts +29 -8
  159. package/src/conduit/http-transport.ts +78 -16
  160. package/src/conduit/index.ts +5 -2
  161. package/src/conduit/local-transport.ts +309 -0
  162. package/src/conduit/sse-transport.ts +382 -0
  163. package/src/crypto/credentials.ts +59 -13
  164. package/src/error-catalog.ts +3 -3
  165. package/src/errors.ts +1 -1
  166. package/src/hooks/__tests__/provider-hooks.test.js +4 -4
  167. package/src/hooks/__tests__/provider-hooks.test.js.map +1 -1
  168. package/src/hooks/__tests__/provider-hooks.test.ts +4 -4
  169. package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js +2 -2
  170. package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js.map +1 -1
  171. package/src/hooks/handlers/__tests__/hook-automation-e2e.test.ts +6 -4
  172. package/src/hooks/handlers/index.ts +2 -6
  173. package/src/hooks/handlers/notification-hooks.ts +65 -0
  174. package/src/index.ts +2 -1
  175. package/src/init.ts +14 -54
  176. package/src/injection.ts +4 -3
  177. package/src/internal.ts +7 -5
  178. package/src/lib/index.ts +8 -0
  179. package/src/lib/tree-sitter-languages.ts +88 -0
  180. package/src/logger.ts +5 -5
  181. package/src/memory/__tests__/brain-links.test.js +13 -0
  182. package/src/memory/__tests__/brain-links.test.js.map +1 -1
  183. package/src/memory/__tests__/brain-links.test.ts +14 -0
  184. package/src/memory/__tests__/brain-retrieval.test.js +9 -0
  185. package/src/memory/__tests__/brain-retrieval.test.js.map +1 -1
  186. package/src/memory/__tests__/brain-retrieval.test.ts +10 -0
  187. package/src/memory/__tests__/session-memory.test.js +16 -0
  188. package/src/memory/__tests__/session-memory.test.js.map +1 -1
  189. package/src/memory/__tests__/session-memory.test.ts +17 -0
  190. package/src/memory/brain-links.ts +17 -0
  191. package/src/memory/brain-maintenance.ts +33 -1
  192. package/src/memory/brain-retrieval.ts +19 -3
  193. package/src/memory/decisions.ts +18 -2
  194. package/src/memory/engine-compat.ts +392 -25
  195. package/src/memory/index.ts +417 -4
  196. package/src/metrics/token-service.ts +4 -4
  197. package/src/migration/index.ts +1 -1
  198. package/src/orchestration/hierarchy.ts +202 -0
  199. package/src/orchestration/index.ts +1 -0
  200. package/src/paths.ts +340 -5
  201. package/src/routing/capability-matrix.ts +49 -49
  202. package/src/scaffold.ts +428 -70
  203. package/src/security/input-sanitization.ts +4 -4
  204. package/src/sessions/__tests__/session-grade.integration.test.js +9 -9
  205. package/src/sessions/__tests__/session-grade.integration.test.ts +9 -9
  206. package/src/sessions/__tests__/session-grade.test.js +10 -10
  207. package/src/sessions/__tests__/session-grade.test.js.map +1 -1
  208. package/src/sessions/__tests__/session-grade.test.ts +10 -10
  209. package/src/sessions/session-grade.ts +4 -4
  210. package/src/skills/__tests__/dynamic-skill-generator.test.js +24 -26
  211. package/src/skills/__tests__/dynamic-skill-generator.test.js.map +1 -1
  212. package/src/skills/__tests__/dynamic-skill-generator.test.ts +24 -26
  213. package/src/skills/__tests__/routing-table.test.js +22 -22
  214. package/src/skills/__tests__/routing-table.test.js.map +1 -1
  215. package/src/skills/__tests__/routing-table.test.ts +23 -23
  216. package/src/skills/dynamic-skill-generator.ts +13 -24
  217. package/src/skills/routing-table.ts +4 -4
  218. package/src/store/__tests__/data-safety-central.test.js +8 -0
  219. package/src/store/__tests__/data-safety-central.test.js.map +1 -1
  220. package/src/store/__tests__/data-safety-central.test.ts +8 -0
  221. package/src/store/__tests__/safety-accessor.test.js +8 -0
  222. package/src/store/__tests__/safety-accessor.test.js.map +1 -1
  223. package/src/store/__tests__/safety-accessor.test.ts +8 -0
  224. package/src/store/agent-registry-accessor.ts +284 -108
  225. package/src/store/cross-db-cleanup.ts +175 -1
  226. package/src/store/provider.ts +2 -2
  227. package/src/store/signaldock-sqlite.ts +262 -60
  228. package/src/store/sqlite-data-accessor.ts +3 -0
  229. package/src/store/sqlite.ts +2 -2
  230. package/src/store/task-store.ts +8 -1
  231. package/src/store/tasks-schema.ts +5 -40
  232. package/src/system/__tests__/health.test.js +2 -2
  233. package/src/system/__tests__/health.test.js.map +1 -1
  234. package/src/system/__tests__/health.test.ts +2 -2
  235. package/src/system/archive-analytics.ts +1 -1
  236. package/src/system/health.ts +43 -19
  237. package/src/system/inject-generate.ts +20 -20
  238. package/src/system/runtime.ts +5 -4
  239. package/src/tasks/atomicity.ts +1 -1
  240. package/src/tasks/list.ts +1 -1
  241. package/src/tasks/task-ops.ts +415 -3
  242. package/src/templates/parser.ts +1 -1
  243. package/src/ui/index.ts +4 -4
  244. package/src/upgrade.ts +3 -14
  245. package/src/validation/operation-gate-validators.ts +1 -1
  246. package/src/validation/operation-verification-gates.ts +3 -3
  247. package/src/validation/param-utils.ts +11 -10
  248. package/src/validation/validate-ops.ts +6 -6
  249. package/templates/CLEO-INJECTION.md +38 -110
  250. package/dist/hooks/handlers/mcp-hooks.d.ts +0 -48
  251. package/dist/hooks/handlers/mcp-hooks.d.ts.map +0 -1
  252. package/dist/mcp/index.d.ts +0 -42
  253. package/dist/mcp/index.d.ts.map +0 -1
  254. package/src/__tests__/audit-prune.test.d.ts +0 -2
  255. package/src/__tests__/caamp-skill-install.test.d.ts +0 -14
  256. package/src/__tests__/cli-mcp-parity.integration.test.d.ts +0 -34
  257. package/src/__tests__/cli-mcp-parity.integration.test.d.ts.map +0 -1
  258. package/src/__tests__/cli-mcp-parity.integration.test.js +0 -898
  259. package/src/__tests__/cli-mcp-parity.integration.test.js.map +0 -1
  260. package/src/__tests__/cli-parity.test.d.ts +0 -9
  261. package/src/__tests__/config.test.d.ts +0 -7
  262. package/src/__tests__/core-parity.test.d.ts +0 -17
  263. package/src/__tests__/error-catalog.test.d.ts +0 -2
  264. package/src/__tests__/golden-parity.test.d.ts +0 -12
  265. package/src/__tests__/hooks.test.d.ts +0 -5
  266. package/src/__tests__/human-output.test.d.ts +0 -12
  267. package/src/__tests__/index-api-compat.test.d.ts +0 -2
  268. package/src/__tests__/init-e2e.test.d.ts +0 -12
  269. package/src/__tests__/injection-chain.test.d.ts +0 -18
  270. package/src/__tests__/injection-mvi-tiers.test.d.ts +0 -14
  271. package/src/__tests__/injection-shared.test.d.ts +0 -10
  272. package/src/__tests__/lafs-conformance.test.d.ts +0 -18
  273. package/src/__tests__/logger.test.d.ts +0 -2
  274. package/src/__tests__/mcp-install-verify.test.d.ts +0 -13
  275. package/src/__tests__/mcp-install-verify.test.d.ts.map +0 -1
  276. package/src/__tests__/mcp-install-verify.test.js +0 -177
  277. package/src/__tests__/mcp-install-verify.test.js.map +0 -1
  278. package/src/__tests__/mcp-install-verify.test.ts +0 -217
  279. package/src/__tests__/paths.test.d.ts +0 -7
  280. package/src/__tests__/project-info.test.d.ts +0 -2
  281. package/src/__tests__/rcsd-pipeline-e2e.test.d.ts +0 -14
  282. package/src/__tests__/remote.test.d.ts +0 -6
  283. package/src/__tests__/scaffold.test.d.ts +0 -6
  284. package/src/__tests__/schema-management.test.d.ts +0 -5
  285. package/src/__tests__/schema.test.d.ts +0 -2
  286. package/src/__tests__/sharing.test.d.ts +0 -6
  287. package/src/__tests__/snapshot.test.d.ts +0 -6
  288. package/src/__tests__/upgrade.test.d.ts +0 -7
  289. package/src/adapters/__tests__/discovery.test.d.ts +0 -6
  290. package/src/adapters/__tests__/manager.test.d.ts +0 -6
  291. package/src/agents/__tests__/agent-registry.test.d.ts +0 -12
  292. package/src/agents/__tests__/capacity.test.d.ts +0 -7
  293. package/src/agents/__tests__/execution-learning.test.d.ts +0 -14
  294. package/src/agents/__tests__/health-monitor.test.d.ts +0 -10
  295. package/src/agents/__tests__/registry.test.d.ts +0 -8
  296. package/src/agents/__tests__/retry.test.d.ts +0 -7
  297. package/src/compliance/__tests__/sync.test.d.ts +0 -5
  298. package/src/hooks/__tests__/provider-hooks.test.d.ts +0 -2
  299. package/src/hooks/__tests__/registry.test.d.ts +0 -2
  300. package/src/hooks/handlers/__tests__/error-hooks.test.d.ts +0 -2
  301. package/src/hooks/handlers/__tests__/file-hooks.test.d.ts +0 -2
  302. package/src/hooks/handlers/__tests__/hook-automation-e2e.test.d.ts +0 -13
  303. package/src/hooks/handlers/__tests__/mcp-hooks.test.d.ts +0 -2
  304. package/src/hooks/handlers/__tests__/mcp-hooks.test.d.ts.map +0 -1
  305. package/src/hooks/handlers/__tests__/mcp-hooks.test.js +0 -119
  306. package/src/hooks/handlers/__tests__/mcp-hooks.test.js.map +0 -1
  307. package/src/hooks/handlers/__tests__/mcp-hooks.test.ts +0 -150
  308. package/src/hooks/handlers/__tests__/session-hooks.test.d.ts +0 -2
  309. package/src/hooks/handlers/__tests__/task-hooks.test.d.ts +0 -2
  310. package/src/hooks/handlers/mcp-hooks.ts +0 -162
  311. package/src/intelligence/__tests__/adaptive-validation.test.d.ts +0 -11
  312. package/src/intelligence/__tests__/impact.test.d.ts +0 -16
  313. package/src/intelligence/__tests__/patterns.test.d.ts +0 -8
  314. package/src/intelligence/__tests__/prediction.test.d.ts +0 -8
  315. package/src/lib/__tests__/retry.test.d.ts +0 -7
  316. package/src/lifecycle/__tests__/chain-store.test.d.ts +0 -10
  317. package/src/lifecycle/__tests__/consolidate-rcasd.test.d.ts +0 -7
  318. package/src/lifecycle/__tests__/default-chain.test.d.ts +0 -7
  319. package/src/lifecycle/__tests__/frontmatter.test.d.ts +0 -7
  320. package/src/lifecycle/__tests__/lifecycle.test.d.ts +0 -7
  321. package/src/lifecycle/__tests__/pipeline.integration.test.d.ts +0 -19
  322. package/src/lifecycle/__tests__/rcasd-paths.test.d.ts +0 -7
  323. package/src/lifecycle/__tests__/resume-schema-contract.test.d.ts +0 -16
  324. package/src/lifecycle/__tests__/stage-record-provenance.integration.test.d.ts +0 -7
  325. package/src/lifecycle/__tests__/tessera-engine.test.d.ts +0 -10
  326. package/src/mcp/index.ts +0 -163
  327. package/src/memory/__tests__/auto-extract.test.d.ts +0 -7
  328. package/src/memory/__tests__/brain-automation.test.d.ts +0 -11
  329. package/src/memory/__tests__/brain-embedding.test.d.ts +0 -2
  330. package/src/memory/__tests__/brain-links.test.d.ts +0 -8
  331. package/src/memory/__tests__/brain-migration.test.d.ts +0 -8
  332. package/src/memory/__tests__/brain-retrieval.test.d.ts +0 -10
  333. package/src/memory/__tests__/brain-search.test.d.ts +0 -8
  334. package/src/memory/__tests__/claude-mem-migration.test.d.ts +0 -12
  335. package/src/memory/__tests__/decisions.test.d.ts +0 -8
  336. package/src/memory/__tests__/engine-compat.test.d.ts +0 -12
  337. package/src/memory/__tests__/memory-bridge.test.d.ts +0 -10
  338. package/src/memory/__tests__/pipeline-manifest-sqlite.test.d.ts +0 -13
  339. package/src/memory/__tests__/session-memory.test.d.ts +0 -9
  340. package/src/metrics/__tests__/model-provider-registry.test.d.ts +0 -2
  341. package/src/metrics/__tests__/provider-detection.test.d.ts +0 -2
  342. package/src/migration/__tests__/checksum.test.d.ts +0 -8
  343. package/src/migration/__tests__/logger.test.d.ts +0 -5
  344. package/src/migration/__tests__/migration-failure.integration.test.d.ts +0 -15
  345. package/src/migration/__tests__/migration.test.d.ts +0 -13
  346. package/src/migration/__tests__/state.test.d.ts +0 -8
  347. package/src/migration/__tests__/validate.test.d.ts +0 -8
  348. package/src/nexus/__tests__/deps.test.d.ts +0 -7
  349. package/src/nexus/__tests__/nexus-e2e.test.d.ts +0 -12
  350. package/src/nexus/__tests__/permissions.test.d.ts +0 -7
  351. package/src/nexus/__tests__/query.test.d.ts +0 -7
  352. package/src/nexus/__tests__/reconcile.test.d.ts +0 -7
  353. package/src/nexus/__tests__/registry.test.d.ts +0 -7
  354. package/src/nexus/__tests__/transfer.test.d.ts +0 -8
  355. package/src/observability/__tests__/index.test.d.ts +0 -7
  356. package/src/observability/__tests__/log-filter.test.d.ts +0 -7
  357. package/src/observability/__tests__/log-parser.test.d.ts +0 -7
  358. package/src/observability/__tests__/log-reader.test.d.ts +0 -7
  359. package/src/orchestration/__tests__/autonomous-spec.test.d.ts +0 -9
  360. package/src/orchestration/__tests__/orchestration.test.d.ts +0 -7
  361. package/src/orchestration/__tests__/protocol-validators.test.d.ts +0 -9
  362. package/src/phases/__tests__/deps.test.d.ts +0 -7
  363. package/src/phases/__tests__/phases.test.d.ts +0 -7
  364. package/src/release/__tests__/artifacts.test.d.ts +0 -7
  365. package/src/release/__tests__/cancel-release.test.d.ts +0 -10
  366. package/src/release/__tests__/changelog-writer.test.d.ts +0 -6
  367. package/src/release/__tests__/push-policy.test.d.ts +0 -14
  368. package/src/release/__tests__/release.test.d.ts +0 -11
  369. package/src/sequence/__tests__/allocate.test.d.ts +0 -6
  370. package/src/sessions/__tests__/briefing-blocked.test.d.ts +0 -6
  371. package/src/sessions/__tests__/briefing.test.d.ts +0 -11
  372. package/src/sessions/__tests__/handoff-integration.test.d.ts +0 -8
  373. package/src/sessions/__tests__/handoff.test.d.ts +0 -11
  374. package/src/sessions/__tests__/index.test.d.ts +0 -2
  375. package/src/sessions/__tests__/session-cleanup.test.d.ts +0 -7
  376. package/src/sessions/__tests__/session-edge-cases.test.d.ts +0 -9
  377. package/src/sessions/__tests__/session-find.test.d.ts +0 -9
  378. package/src/sessions/__tests__/session-grade.integration.test.d.ts +0 -11
  379. package/src/sessions/__tests__/session-grade.test.d.ts +0 -6
  380. package/src/sessions/__tests__/session-memory-bridge.test.d.ts +0 -2
  381. package/src/sessions/__tests__/sessions.test.d.ts +0 -7
  382. package/src/skills/__tests__/discovery.test.d.ts +0 -6
  383. package/src/skills/__tests__/dispatch.test.d.ts +0 -6
  384. package/src/skills/__tests__/dynamic-skill-generator.test.d.ts +0 -2
  385. package/src/skills/__tests__/manifests.test.d.ts +0 -6
  386. package/src/skills/__tests__/precedence.test.d.ts +0 -6
  387. package/src/skills/__tests__/routing-table.test.d.ts +0 -2
  388. package/src/skills/__tests__/skill-paths.test.d.ts +0 -7
  389. package/src/skills/__tests__/test-utility.test.d.ts +0 -7
  390. package/src/skills/__tests__/token.test.d.ts +0 -6
  391. package/src/skills/__tests__/validation.test.d.ts +0 -6
  392. package/src/skills/__tests__/version.test.d.ts +0 -5
  393. package/src/skills/injection/__tests__/subagent.test.d.ts +0 -2
  394. package/src/skills/orchestrator/__tests__/spawn-tier.test.d.ts +0 -2
  395. package/src/spawn/__tests__/adapter-registry.test.d.ts +0 -2
  396. package/src/stats/__tests__/stats.test.d.ts +0 -7
  397. package/src/sticky/__tests__/purge.test.d.ts +0 -9
  398. package/src/store/__tests__/atomic.test.d.ts +0 -7
  399. package/src/store/__tests__/backup.test.d.ts +0 -7
  400. package/src/store/__tests__/brain-accessor-pageindex.test.d.ts +0 -12
  401. package/src/store/__tests__/brain-accessor.test.d.ts +0 -10
  402. package/src/store/__tests__/brain-pageindex.test.d.ts +0 -11
  403. package/src/store/__tests__/brain-schema.test.d.ts +0 -11
  404. package/src/store/__tests__/brain-vec.test.d.ts +0 -11
  405. package/src/store/__tests__/collision-detection.test.d.ts +0 -11
  406. package/src/store/__tests__/data-safety-central.test.d.ts +0 -20
  407. package/src/store/__tests__/db-helpers.test.d.ts +0 -7
  408. package/src/store/__tests__/e2e-safety-integration.test.d.ts +0 -13
  409. package/src/store/__tests__/git-checkpoint.test.d.ts +0 -7
  410. package/src/store/__tests__/idempotent-migration.test.d.ts +0 -5
  411. package/src/store/__tests__/import-logging.test.d.ts +0 -7
  412. package/src/store/__tests__/import-sort.test.d.ts +0 -7
  413. package/src/store/__tests__/json.test.d.ts +0 -7
  414. package/src/store/__tests__/lifecycle-schema-parity.test.d.ts +0 -2
  415. package/src/store/__tests__/migration-integration.test.d.ts +0 -15
  416. package/src/store/__tests__/migration-retry.test.d.ts +0 -10
  417. package/src/store/__tests__/migration-safety.test.d.ts +0 -21
  418. package/src/store/__tests__/migration-sqlite.test.d.ts +0 -11
  419. package/src/store/__tests__/performance-safety.test.d.ts +0 -17
  420. package/src/store/__tests__/project-detect.test.d.ts +0 -6
  421. package/src/store/__tests__/project-registry.test.d.ts +0 -7
  422. package/src/store/__tests__/provider.test.d.ts +0 -9
  423. package/src/store/__tests__/relations.test.d.ts +0 -9
  424. package/src/store/__tests__/safety-accessor.test.d.ts +0 -18
  425. package/src/store/__tests__/sequence-validation.test.d.ts +0 -11
  426. package/src/store/__tests__/session-store.test.d.ts +0 -11
  427. package/src/store/__tests__/sqlite-backup.test.d.ts +0 -14
  428. package/src/store/__tests__/sqlite.test.d.ts +0 -11
  429. package/src/store/__tests__/task-store.test.d.ts +0 -11
  430. package/src/store/__tests__/test-db-helper.d.ts +0 -61
  431. package/src/store/__tests__/write-verification.test.d.ts +0 -11
  432. package/src/system/__tests__/cleanup.test.d.ts +0 -2
  433. package/src/system/__tests__/health.test.d.ts +0 -2
  434. package/src/task-work/__tests__/start-deps.test.d.ts +0 -6
  435. package/src/tasks/__tests__/add.test.d.ts +0 -7
  436. package/src/tasks/__tests__/archive.test.d.ts +0 -7
  437. package/src/tasks/__tests__/assignee.test.d.ts +0 -14
  438. package/src/tasks/__tests__/atomicity.test.d.ts +0 -6
  439. package/src/tasks/__tests__/cancel-ops.test.d.ts +0 -7
  440. package/src/tasks/__tests__/complete-unblocks.test.d.ts +0 -6
  441. package/src/tasks/__tests__/complete.test.d.ts +0 -7
  442. package/src/tasks/__tests__/delete.test.d.ts +0 -7
  443. package/src/tasks/__tests__/dependency-check.test.d.ts +0 -7
  444. package/src/tasks/__tests__/deps-ready.test.d.ts +0 -6
  445. package/src/tasks/__tests__/epic-enforcement.test.d.ts +0 -15
  446. package/src/tasks/__tests__/find.test.d.ts +0 -7
  447. package/src/tasks/__tests__/graph-ops.test.d.ts +0 -7
  448. package/src/tasks/__tests__/hierarchy-policy.test.d.ts +0 -6
  449. package/src/tasks/__tests__/hierarchy.test.d.ts +0 -7
  450. package/src/tasks/__tests__/id-generator.test.d.ts +0 -2
  451. package/src/tasks/__tests__/labels.test.d.ts +0 -7
  452. package/src/tasks/__tests__/list.test.d.ts +0 -7
  453. package/src/tasks/__tests__/minimal-test.test.d.ts +0 -2
  454. package/src/tasks/__tests__/phase-tracking.test.d.ts +0 -7
  455. package/src/tasks/__tests__/pipeline-stage.test.d.ts +0 -14
  456. package/src/tasks/__tests__/plan-priority.test.d.ts +0 -10
  457. package/src/tasks/__tests__/priority-normalization.test.d.ts +0 -7
  458. package/src/tasks/__tests__/relates.test.d.ts +0 -9
  459. package/src/tasks/__tests__/show-deps.test.d.ts +0 -6
  460. package/src/tasks/__tests__/show.test.d.ts +0 -7
  461. package/src/tasks/__tests__/staleness.test.d.ts +0 -7
  462. package/src/tasks/__tests__/task-ops-depends.test.d.ts +0 -6
  463. package/src/tasks/__tests__/update.test.d.ts +0 -7
  464. package/src/validation/__tests__/chain-validation.test.d.ts +0 -7
  465. package/src/validation/__tests__/compliance.test.d.ts +0 -7
  466. package/src/validation/__tests__/docs-sync.test.d.ts +0 -7
  467. package/src/validation/__tests__/doctor-gitignore.test.d.ts +0 -7
  468. package/src/validation/__tests__/doctor-injection.test.d.ts +0 -11
  469. package/src/validation/__tests__/doctor.test.d.ts +0 -7
  470. package/src/validation/__tests__/engine.test.d.ts +0 -7
  471. package/src/validation/__tests__/manifest.test.d.ts +0 -7
  472. package/src/validation/__tests__/protocol-common.test.d.ts +0 -7
  473. package/src/validation/__tests__/verification.test.d.ts +0 -7
@@ -45,17 +45,28 @@ type TaskRecord = Task;
45
45
 
46
46
  /** Tree node representation for task hierarchy. */
47
47
  export interface FlatTreeNode {
48
+ /** Unique task identifier (e.g. "T001"). */
48
49
  id: string;
50
+ /** Human-readable task title. */
49
51
  title: string;
52
+ /** Current task status (e.g. "pending", "done"). */
50
53
  status: string;
54
+ /**
55
+ * Task type classification.
56
+ * @defaultValue "task"
57
+ */
51
58
  type?: string;
59
+ /** Child nodes in the hierarchy tree. */
52
60
  children: FlatTreeNode[];
53
61
  }
54
62
 
55
- /** Complexity factor. */
63
+ /** Complexity factor contributing to a task's size estimate. */
56
64
  export interface ComplexityFactor {
65
+ /** Factor name (e.g. "descriptionLength", "dependencyDepth"). */
57
66
  name: string;
67
+ /** Numeric score contribution from this factor. */
58
68
  value: number;
69
+ /** Human-readable explanation of the score (e.g. "short (42 chars)"). */
59
70
  detail: string;
60
71
  }
61
72
 
@@ -167,6 +178,23 @@ function getHierarchyLimits(projectRoot: string): { maxDepth: number; maxSibling
167
178
 
168
179
  /**
169
180
  * Suggest next task to work on based on priority, phase, age, and deps.
181
+ *
182
+ * @param projectRoot - Absolute path to the CLEO project root directory
183
+ * @param params - Optional scoring configuration
184
+ * @param params.count - Number of suggestions to return (default: 1)
185
+ * @param params.explain - When true, include scoring reasons in each suggestion
186
+ * @returns Ranked suggestions with scores and the total number of eligible candidates
187
+ *
188
+ * @remarks
189
+ * Scoring considers priority weight, current phase alignment, dependency readiness,
190
+ * task age, and brain success/failure pattern matches. Results are sorted descending by score.
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * const { suggestions } = await coreTaskNext('/project', { count: 3, explain: true });
195
+ * console.log(suggestions[0].id, suggestions[0].score);
196
+ * ```
197
+ *
170
198
  * @task T4790
171
199
  */
172
200
  export async function coreTaskNext(
@@ -286,6 +314,23 @@ export async function coreTaskNext(
286
314
 
287
315
  /**
288
316
  * Show blocked tasks and analyze blocking chains.
317
+ *
318
+ * @param projectRoot - Absolute path to the CLEO project root directory
319
+ * @param params - Optional analysis configuration
320
+ * @param params.analyze - When true, compute transitive blocking chains
321
+ * @param params.limit - Maximum number of blocked tasks to return (default: 20)
322
+ * @returns Blocked tasks with optional blocking chains, critical bottleneck tasks, and a summary
323
+ *
324
+ * @remarks
325
+ * Collects both explicitly blocked tasks and dependency-blocked pending tasks.
326
+ * Critical blockers are the top 5 tasks that appear most frequently in blocking chains.
327
+ *
328
+ * @example
329
+ * ```typescript
330
+ * const result = await coreTaskBlockers('/project', { analyze: true, limit: 10 });
331
+ * console.log(result.summary, result.criticalBlockers);
332
+ * ```
333
+ *
289
334
  * @task T4790
290
335
  */
291
336
  export async function coreTaskBlockers(
@@ -374,7 +419,22 @@ export async function coreTaskBlockers(
374
419
  // ============================================================================
375
420
 
376
421
  /**
377
- * Build hierarchy tree.
422
+ * Build hierarchy tree for tasks.
423
+ *
424
+ * @param projectRoot - Absolute path to the CLEO project root directory
425
+ * @param taskId - Optional root task ID; when provided, builds the subtree rooted at this task
426
+ * @returns The tree nodes and total node count
427
+ *
428
+ * @remarks
429
+ * When no taskId is given, returns all root-level tasks with their full subtrees.
430
+ * When a taskId is given, returns that single task as the root with its descendants.
431
+ *
432
+ * @example
433
+ * ```typescript
434
+ * const { tree, totalNodes } = await coreTaskTree('/project', 'T042');
435
+ * console.log(`${totalNodes} nodes in subtree`);
436
+ * ```
437
+ *
378
438
  * @task T4790
379
439
  */
380
440
  export async function coreTaskTree(
@@ -417,6 +477,21 @@ export async function coreTaskTree(
417
477
 
418
478
  /**
419
479
  * Show dependencies for a task.
480
+ *
481
+ * @param projectRoot - Absolute path to the CLEO project root directory
482
+ * @param taskId - The task ID to inspect dependencies for
483
+ * @returns Upstream and downstream dependencies, unresolved deps, and readiness flag
484
+ *
485
+ * @remarks
486
+ * Returns both the tasks this task depends on (upstream) and the tasks that depend
487
+ * on it (downstream). Unresolved deps are those not yet done or cancelled.
488
+ *
489
+ * @example
490
+ * ```typescript
491
+ * const deps = await coreTaskDeps('/project', 'T100');
492
+ * if (!deps.allDepsReady) console.log('Blocked by:', deps.unresolvedDeps);
493
+ * ```
494
+ *
420
495
  * @task T4790
421
496
  */
422
497
  export async function coreTaskDeps(projectRoot: string, taskId: string): Promise<TaskDepsResult> {
@@ -459,6 +534,21 @@ export async function coreTaskDeps(projectRoot: string, taskId: string): Promise
459
534
 
460
535
  /**
461
536
  * Show task relations.
537
+ *
538
+ * @param projectRoot - Absolute path to the CLEO project root directory
539
+ * @param taskId - The task ID to retrieve relations for
540
+ * @returns The task's relations array and count
541
+ *
542
+ * @remarks
543
+ * Relations are non-dependency links between tasks (e.g. "related-to", "duplicates").
544
+ * Unlike dependencies, relations do not affect blocking or scheduling.
545
+ *
546
+ * @example
547
+ * ```typescript
548
+ * const { relations, count } = await coreTaskRelates('/project', 'T050');
549
+ * console.log(`${count} relations found`);
550
+ * ```
551
+ *
462
552
  * @task T4790
463
553
  */
464
554
  export async function coreTaskRelates(
@@ -485,6 +575,24 @@ export async function coreTaskRelates(
485
575
 
486
576
  /**
487
577
  * Add a relation between two tasks.
578
+ *
579
+ * @param projectRoot - Absolute path to the CLEO project root directory
580
+ * @param taskId - The source task ID
581
+ * @param relatedId - The target task ID to relate to
582
+ * @param type - Relation type (e.g. "related-to", "duplicates", "blocks")
583
+ * @param reason - Optional human-readable reason for the relation
584
+ * @returns Confirmation of the added relation with source, target, and type
585
+ *
586
+ * @remarks
587
+ * Persists the relation both on the task's `relates` array and in the
588
+ * `task_relations` table for bidirectional querying.
589
+ *
590
+ * @example
591
+ * ```typescript
592
+ * const result = await coreTaskRelatesAdd('/project', 'T010', 'T020', 'related-to', 'Shared scope');
593
+ * console.log(result.added); // true
594
+ * ```
595
+ *
488
596
  * @task T4790
489
597
  */
490
598
  export async function coreTaskRelatesAdd(
@@ -531,6 +639,24 @@ export async function coreTaskRelatesAdd(
531
639
 
532
640
  /**
533
641
  * Analyze tasks for priority and leverage.
642
+ *
643
+ * @param projectRoot - Absolute path to the CLEO project root directory
644
+ * @param taskId - Optional task or epic ID to scope the analysis; omit for project-wide
645
+ * @param params - Optional analysis configuration
646
+ * @param params.tierLimit - Maximum tasks per priority tier in the response (default: 10)
647
+ * @returns Analysis with recommended next task, bottlenecks, priority tiers, and aggregate metrics
648
+ *
649
+ * @remarks
650
+ * Computes a leverage score per task (how many other tasks it unblocks) and combines
651
+ * it with priority to produce a ranked recommendation. Bottlenecks are the top 5
652
+ * incomplete tasks that block the most others.
653
+ *
654
+ * @example
655
+ * ```typescript
656
+ * const analysis = await coreTaskAnalyze('/project', undefined, { tierLimit: 5 });
657
+ * if (analysis.recommended) console.log('Work on:', analysis.recommended.id);
658
+ * ```
659
+ *
534
660
  * @task T4790
535
661
  */
536
662
  export async function coreTaskAnalyze(
@@ -630,6 +756,24 @@ export async function coreTaskAnalyze(
630
756
 
631
757
  /**
632
758
  * Restore a cancelled task back to pending.
759
+ *
760
+ * @param projectRoot - Absolute path to the CLEO project root directory
761
+ * @param taskId - The cancelled task ID to restore
762
+ * @param params - Optional restore options
763
+ * @param params.cascade - When true, also restores cancelled child tasks recursively
764
+ * @param params.notes - Optional note appended to each restored task's notes array
765
+ * @returns The task ID, list of restored task IDs, and total count
766
+ *
767
+ * @remarks
768
+ * Only tasks with status "cancelled" can be restored. Restored tasks are set to
769
+ * "pending" with cancellation metadata cleared. A timestamped note is appended.
770
+ *
771
+ * @example
772
+ * ```typescript
773
+ * const { restored, count } = await coreTaskRestore('/project', 'T099', { cascade: true });
774
+ * console.log(`Restored ${count} tasks:`, restored);
775
+ * ```
776
+ *
633
777
  * @task T4790
634
778
  */
635
779
  export async function coreTaskRestore(
@@ -691,6 +835,24 @@ export async function coreTaskRestore(
691
835
  /**
692
836
  * Cancel a task (sets status to 'cancelled', a soft terminal state).
693
837
  * Use restore to reverse. Use delete for permanent removal.
838
+ *
839
+ * @param projectRoot - Absolute path to the CLEO project root directory
840
+ * @param taskId - The task ID to cancel
841
+ * @param params - Optional cancel options
842
+ * @param params.reason - Human-readable cancellation reason stored on the task
843
+ * @returns Confirmation with cancelled flag and timestamp
844
+ *
845
+ * @remarks
846
+ * Cancellation is a soft terminal state -- the task remains in the database and
847
+ * can be restored via {@link coreTaskRestore}. Not all statuses are cancellable;
848
+ * the `canCancel` guard determines eligibility.
849
+ *
850
+ * @example
851
+ * ```typescript
852
+ * const result = await coreTaskCancel('/project', 'T077', { reason: 'Superseded by T080' });
853
+ * console.log(result.cancelledAt);
854
+ * ```
855
+ *
694
856
  * @task T4529
695
857
  */
696
858
  export async function coreTaskCancel(
@@ -725,6 +887,24 @@ export async function coreTaskCancel(
725
887
 
726
888
  /**
727
889
  * Move an archived task back to active tasks.
890
+ *
891
+ * @param projectRoot - Absolute path to the CLEO project root directory
892
+ * @param taskId - The archived task ID to unarchive
893
+ * @param params - Optional unarchive options
894
+ * @param params.status - Target status for the restored task (default: "pending")
895
+ * @param params.preserveStatus - When true, keeps the task's original archived status
896
+ * @returns Confirmation with task ID, title, and resulting status
897
+ *
898
+ * @remarks
899
+ * Removes the task from the archive file and upserts it into the active task store.
900
+ * Throws if the task already exists in active tasks or is not found in the archive.
901
+ *
902
+ * @example
903
+ * ```typescript
904
+ * const result = await coreTaskUnarchive('/project', 'T055', { status: 'active' });
905
+ * console.log(`${result.title} is now ${result.status}`);
906
+ * ```
907
+ *
728
908
  * @task T4790
729
909
  */
730
910
  export async function coreTaskUnarchive(
@@ -783,6 +963,22 @@ export async function coreTaskUnarchive(
783
963
 
784
964
  /**
785
965
  * Change task position within its sibling group.
966
+ *
967
+ * @param projectRoot - Absolute path to the CLEO project root directory
968
+ * @param taskId - The task ID to reorder
969
+ * @param position - Target 1-based position within the sibling group
970
+ * @returns Confirmation with the new position and total sibling count
971
+ *
972
+ * @remarks
973
+ * Reorders by adjusting `position` and `positionVersion` fields on all siblings.
974
+ * Position is clamped to valid bounds. Uses bulk field updates for efficiency.
975
+ *
976
+ * @example
977
+ * ```typescript
978
+ * const result = await coreTaskReorder('/project', 'T012', 1);
979
+ * console.log(`Moved to position ${result.newPosition} of ${result.totalSiblings}`);
980
+ * ```
981
+ *
786
982
  * @task T4790
787
983
  */
788
984
  export async function coreTaskReorder(
@@ -846,6 +1042,23 @@ export async function coreTaskReorder(
846
1042
 
847
1043
  /**
848
1044
  * Move task under a different parent.
1045
+ *
1046
+ * @param projectRoot - Absolute path to the CLEO project root directory
1047
+ * @param taskId - The task ID to reparent
1048
+ * @param newParentId - The new parent task ID, or null to promote to root level
1049
+ * @returns Confirmation with old and new parent IDs and optional type change
1050
+ *
1051
+ * @remarks
1052
+ * Validates against circular references, depth limits, and sibling limits from
1053
+ * the project hierarchy config. Automatically adjusts task type based on new depth
1054
+ * (depth 1 = "task", depth >= 2 = "subtask").
1055
+ *
1056
+ * @example
1057
+ * ```typescript
1058
+ * const result = await coreTaskReparent('/project', 'T015', 'T010');
1059
+ * console.log(`Moved from ${result.oldParent} to ${result.newParent}`);
1060
+ * ```
1061
+ *
849
1062
  * @task T4790
850
1063
  */
851
1064
  export async function coreTaskReparent(
@@ -939,6 +1152,21 @@ export async function coreTaskReparent(
939
1152
 
940
1153
  /**
941
1154
  * Promote a subtask to task or task to root.
1155
+ *
1156
+ * @param projectRoot - Absolute path to the CLEO project root directory
1157
+ * @param taskId - The task ID to promote
1158
+ * @returns Confirmation with previous parent and whether the type changed
1159
+ *
1160
+ * @remarks
1161
+ * Removes the task's parentId, making it a root-level task. If the task was
1162
+ * a "subtask", its type is changed to "task". No-op if the task is already root-level.
1163
+ *
1164
+ * @example
1165
+ * ```typescript
1166
+ * const result = await coreTaskPromote('/project', 'T025');
1167
+ * if (result.promoted) console.log('Detached from', result.previousParent);
1168
+ * ```
1169
+ *
942
1170
  * @task T4790
943
1171
  */
944
1172
  export async function coreTaskPromote(
@@ -982,6 +1210,24 @@ export async function coreTaskPromote(
982
1210
 
983
1211
  /**
984
1212
  * Reopen a completed task.
1213
+ *
1214
+ * @param projectRoot - Absolute path to the CLEO project root directory
1215
+ * @param taskId - The completed task ID to reopen
1216
+ * @param params - Optional reopen options
1217
+ * @param params.status - Target status after reopening ("pending" or "active", default: "pending")
1218
+ * @param params.reason - Optional reason appended to the task's notes
1219
+ * @returns Confirmation with previous and new status
1220
+ *
1221
+ * @remarks
1222
+ * Only tasks with status "done" can be reopened. Clears the `completedAt` timestamp
1223
+ * and appends a timestamped note recording the reopen event.
1224
+ *
1225
+ * @example
1226
+ * ```typescript
1227
+ * const result = await coreTaskReopen('/project', 'T033', { status: 'active', reason: 'Tests failed' });
1228
+ * console.log(`${result.previousStatus} -> ${result.newStatus}`);
1229
+ * ```
1230
+ *
985
1231
  * @task T4790
986
1232
  */
987
1233
  export async function coreTaskReopen(
@@ -1029,6 +1275,23 @@ export async function coreTaskReopen(
1029
1275
 
1030
1276
  /**
1031
1277
  * Deterministic complexity scoring from task metadata.
1278
+ *
1279
+ * @param projectRoot - Absolute path to the CLEO project root directory
1280
+ * @param params - Parameters containing the task ID to estimate
1281
+ * @param params.taskId - The task ID to compute complexity for
1282
+ * @returns Complexity size ("small"/"medium"/"large"), numeric score, contributing factors, and metadata counts
1283
+ *
1284
+ * @remarks
1285
+ * Scores are computed from description length, acceptance criteria count, dependency depth,
1286
+ * subtask count, and file reference count. Each factor contributes 0-3 points.
1287
+ * Total score 0-3 = small, 4-7 = medium, 8+ = large.
1288
+ *
1289
+ * @example
1290
+ * ```typescript
1291
+ * const est = await coreTaskComplexityEstimate('/project', { taskId: 'T042' });
1292
+ * console.log(`${est.size} (score: ${est.score})`);
1293
+ * ```
1294
+ *
1032
1295
  * @task T4790
1033
1296
  */
1034
1297
  export async function coreTaskComplexityEstimate(
@@ -1111,6 +1374,20 @@ export async function coreTaskComplexityEstimate(
1111
1374
 
1112
1375
  /**
1113
1376
  * Overview of all dependencies across the project.
1377
+ *
1378
+ * @param projectRoot - Absolute path to the CLEO project root directory
1379
+ * @returns Project-wide dependency summary including blocked tasks, ready tasks, and validation results
1380
+ *
1381
+ * @remarks
1382
+ * Aggregates dependency data across all tasks to provide a high-level view of
1383
+ * the dependency graph health, including which tasks are blocked and what would unblock them.
1384
+ *
1385
+ * @example
1386
+ * ```typescript
1387
+ * const overview = await coreTaskDepsOverview('/project');
1388
+ * console.log(`${overview.blockedTasks.length} blocked, ${overview.readyTasks.length} ready`);
1389
+ * ```
1390
+ *
1114
1391
  * @task T5157
1115
1392
  */
1116
1393
  export async function coreTaskDepsOverview(projectRoot: string): Promise<{
@@ -1161,6 +1438,21 @@ export async function coreTaskDepsOverview(projectRoot: string): Promise<{
1161
1438
 
1162
1439
  /**
1163
1440
  * Detect circular dependencies across the project.
1441
+ *
1442
+ * @param projectRoot - Absolute path to the CLEO project root directory
1443
+ * @returns Whether cycles exist and the list of detected cycles with their task paths
1444
+ *
1445
+ * @remarks
1446
+ * Iterates through all tasks with dependencies and uses cycle detection to find
1447
+ * circular chains. Each cycle includes the full path (e.g. [A, B, C, A]) and
1448
+ * the tasks involved with their titles.
1449
+ *
1450
+ * @example
1451
+ * ```typescript
1452
+ * const { hasCycles, cycles } = await coreTaskDepsCycles('/project');
1453
+ * if (hasCycles) console.log('Circular deps:', cycles.map(c => c.path.join(' -> ')));
1454
+ * ```
1455
+ *
1164
1456
  * @task T5157
1165
1457
  */
1166
1458
  export async function coreTaskDepsCycles(projectRoot: string): Promise<{
@@ -1204,6 +1496,25 @@ export async function coreTaskDepsCycles(projectRoot: string): Promise<{
1204
1496
 
1205
1497
  /**
1206
1498
  * List dependencies for a task in a given direction.
1499
+ *
1500
+ * @param projectRoot - Absolute path to the CLEO project root directory
1501
+ * @param taskId - The task ID to inspect
1502
+ * @param direction - Direction to traverse: "upstream" (what this task depends on), "downstream" (what depends on it), or "both"
1503
+ * @param options - Optional display configuration
1504
+ * @param options.tree - When true, includes a recursive upstream dependency tree
1505
+ * @returns Upstream and downstream deps, transitive chain length, leaf blockers, and readiness status
1506
+ *
1507
+ * @remarks
1508
+ * Combines direct dependency lookups with transitive analysis. Leaf blockers are
1509
+ * the deepest unresolved tasks in the dependency chain -- resolving them first
1510
+ * has the most impact on unblocking.
1511
+ *
1512
+ * @example
1513
+ * ```typescript
1514
+ * const deps = await coreTaskDepends('/project', 'T100', 'both', { tree: true });
1515
+ * console.log('Leaf blockers:', deps.leafBlockers.map(b => b.id));
1516
+ * ```
1517
+ *
1207
1518
  * @task T4790
1208
1519
  */
1209
1520
  export async function coreTaskDepends(
@@ -1292,6 +1603,21 @@ export async function coreTaskDepends(
1292
1603
 
1293
1604
  /**
1294
1605
  * Compute task statistics.
1606
+ *
1607
+ * @param projectRoot - Absolute path to the CLEO project root directory
1608
+ * @param epicId - Optional epic ID to scope stats to that subtree
1609
+ * @returns Status counts, priority distribution, and type distribution
1610
+ *
1611
+ * @remarks
1612
+ * When an epicId is provided, statistics are scoped to that epic and all its
1613
+ * transitive children. Without an epicId, stats cover the entire project.
1614
+ *
1615
+ * @example
1616
+ * ```typescript
1617
+ * const stats = await coreTaskStats('/project', 'T001');
1618
+ * console.log(`${stats.done}/${stats.total} complete`);
1619
+ * ```
1620
+ *
1295
1621
  * @task T4790
1296
1622
  */
1297
1623
  export async function coreTaskStats(
@@ -1355,6 +1681,24 @@ export async function coreTaskStats(
1355
1681
 
1356
1682
  /**
1357
1683
  * Export tasks as JSON or CSV.
1684
+ *
1685
+ * @param projectRoot - Absolute path to the CLEO project root directory
1686
+ * @param params - Optional export configuration
1687
+ * @param params.format - Output format: "json" (default) or "csv"
1688
+ * @param params.status - Filter to only tasks with this status
1689
+ * @param params.parent - Filter to tasks under this parent ID (recursive)
1690
+ * @returns Export payload with format, content/tasks, and task count
1691
+ *
1692
+ * @remarks
1693
+ * CSV output includes columns: id, title, status, priority, type, parentId, createdAt.
1694
+ * JSON output returns the full task objects. Both formats support status and parent filtering.
1695
+ *
1696
+ * @example
1697
+ * ```typescript
1698
+ * const result = await coreTaskExport('/project', { format: 'csv', status: 'done' });
1699
+ * console.log(result.content); // CSV string
1700
+ * ```
1701
+ *
1358
1702
  * @task T4790
1359
1703
  */
1360
1704
  export async function coreTaskExport(
@@ -1409,7 +1753,23 @@ export async function coreTaskExport(
1409
1753
  // ============================================================================
1410
1754
 
1411
1755
  /**
1412
- * Get task history from the log file.
1756
+ * Get task history from the audit log.
1757
+ *
1758
+ * @param projectRoot - Absolute path to the CLEO project root directory
1759
+ * @param taskId - The task ID to retrieve history for
1760
+ * @param limit - Maximum number of history entries to return (default: 100)
1761
+ * @returns Array of audit log entries ordered by timestamp descending
1762
+ *
1763
+ * @remarks
1764
+ * Queries the SQLite audit_log table for all operations on the given task.
1765
+ * Returns an empty array if the database is unavailable or no entries exist.
1766
+ *
1767
+ * @example
1768
+ * ```typescript
1769
+ * const history = await coreTaskHistory('/project', 'T042', 10);
1770
+ * for (const entry of history) console.log(entry.timestamp, entry.operation);
1771
+ * ```
1772
+ *
1413
1773
  * @task T4790
1414
1774
  */
1415
1775
  export async function coreTaskHistory(
@@ -1480,6 +1840,23 @@ export async function coreTaskHistory(
1480
1840
 
1481
1841
  /**
1482
1842
  * Lint tasks for common issues.
1843
+ *
1844
+ * @param projectRoot - Absolute path to the CLEO project root directory
1845
+ * @param taskId - Optional task ID to lint; omit to lint all tasks
1846
+ * @returns Array of lint issues with severity, rule name, and descriptive message
1847
+ *
1848
+ * @remarks
1849
+ * Checks for: duplicate IDs, missing titles, missing descriptions, identical
1850
+ * title/description, duplicate descriptions, invalid statuses, future timestamps,
1851
+ * invalid parent references, and invalid dependency references.
1852
+ *
1853
+ * @example
1854
+ * ```typescript
1855
+ * const issues = await coreTaskLint('/project');
1856
+ * const errors = issues.filter(i => i.severity === 'error');
1857
+ * console.log(`${errors.length} errors found`);
1858
+ * ```
1859
+ *
1483
1860
  * @task T4790
1484
1861
  */
1485
1862
  export async function coreTaskLint(
@@ -1616,6 +1993,23 @@ export async function coreTaskLint(
1616
1993
 
1617
1994
  /**
1618
1995
  * Validate multiple tasks at once.
1996
+ *
1997
+ * @param projectRoot - Absolute path to the CLEO project root directory
1998
+ * @param taskIds - Array of task IDs to validate
1999
+ * @param checkMode - Validation depth: "full" runs all checks, "quick" checks only title/description/status
2000
+ * @returns Per-task validation results and an aggregate summary with error/warning counts
2001
+ *
2002
+ * @remarks
2003
+ * In "full" mode, additional checks include title-description equality, parent existence,
2004
+ * dependency existence, and future timestamp detection. Tasks that are not found are
2005
+ * reported as errors.
2006
+ *
2007
+ * @example
2008
+ * ```typescript
2009
+ * const { summary } = await coreTaskBatchValidate('/project', ['T001', 'T002'], 'full');
2010
+ * console.log(`${summary.validTasks}/${summary.totalTasks} valid`);
2011
+ * ```
2012
+ *
1619
2013
  * @task T4790
1620
2014
  */
1621
2015
  export async function coreTaskBatchValidate(
@@ -1737,6 +2131,24 @@ export async function coreTaskBatchValidate(
1737
2131
 
1738
2132
  /**
1739
2133
  * Import tasks from a JSON source string.
2134
+ *
2135
+ * @param projectRoot - Absolute path to the CLEO project root directory
2136
+ * @param source - JSON string containing an array of tasks or an object with a `tasks` array
2137
+ * @param overwrite - When true, overwrites existing tasks with matching IDs; otherwise skips them
2138
+ * @returns Import summary with counts of imported, skipped, errors, and optional ID remap table
2139
+ *
2140
+ * @remarks
2141
+ * When a task ID collides with an existing one and overwrite is false, a new sequential
2142
+ * ID is assigned and recorded in the remapTable. Tasks missing required id or title
2143
+ * fields are skipped with an error message.
2144
+ *
2145
+ * @example
2146
+ * ```typescript
2147
+ * const json = JSON.stringify([{ id: 'T500', title: 'New task', status: 'pending', priority: 'medium' }]);
2148
+ * const result = await coreTaskImport('/project', json, false);
2149
+ * console.log(`Imported ${result.imported}, skipped ${result.skipped}`);
2150
+ * ```
2151
+ *
1740
2152
  * @task T4790
1741
2153
  */
1742
2154
  export async function coreTaskImport(
@@ -2,7 +2,7 @@
2
2
  * GitHub Issue Template Parser (Core Logic)
3
3
  *
4
4
  * Native TypeScript implementation for parsing GitHub issue template YAML files
5
- * and producing structured JSON config. Both the MCP server and the Bash CLI
5
+ * and producing structured JSON config. The CLI
6
6
  * can consume the generated config at .cleo/issue-templates.json.
7
7
  *
8
8
  * Supports: parseIssueTemplates, getTemplateForSubcommand, generateTemplateConfig, validateLabels
package/src/ui/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * UI module - flags, changelog, command registry, aliases, injection, MCP config.
2
+ * UI module - flags, changelog, command registry, aliases, injection.
3
3
  *
4
4
  * @task T4454
5
5
  * @epic T4454
@@ -50,12 +50,12 @@ export {
50
50
  resolveFormat,
51
51
  } from './flags.js';
52
52
 
53
- // Injection & MCP config: DELETED (T4674, T4675, T4677)
54
- // All injection, provider detection, and MCP config management is now
53
+ // Injection config: DELETED (T4674, T4675, T4677)
54
+ // All injection and provider detection is now
55
55
  // delegated to @cleocode/caamp via src/core/caamp/adapter.ts.
56
56
  // See Wave 8 epic T4663 for migration context.
57
57
  //
58
58
  // Legacy exports removed:
59
59
  // injection.ts -> CAAMP inject()/checkInjection()
60
- // mcp-config.ts -> CAAMP detectAllProviders()/installMcpServer()
60
+ // (removed) -> CAAMP detectAllProviders()
61
61
  // injection-registry.ts -> CAAMP getInstructionFiles()
package/src/upgrade.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * 3. Structural repairs (checksums, missing fields)
8
8
  * 4. Global ~/.cleo data migration
9
9
  *
10
- * Both CLI and MCP delegate here (shared-core pattern).
10
+ * CLI delegates here (shared-core pattern).
11
11
  *
12
12
  * @task T4699
13
13
  * @epic T4454
@@ -26,7 +26,6 @@ import { ensureGitHooks } from './hooks.js';
26
26
  import {
27
27
  initAgentDefinition,
28
28
  initCoreSkills,
29
- initMcpServer,
30
29
  initNexusRegistration,
31
30
  installGitHubTemplates,
32
31
  } from './init.js';
@@ -901,17 +900,7 @@ export async function runUpgrade(
901
900
  /* best-effort */
902
901
  }
903
902
 
904
- // Install MCP server to detected providers
905
- try {
906
- const mcpCreated: string[] = [];
907
- const mcpWarnings: string[] = [];
908
- await initMcpServer(projectRootForMaint, mcpCreated, mcpWarnings);
909
- if (mcpCreated.length > 0) {
910
- actions.push({ action: 'mcp_server', status: 'applied', details: mcpCreated.join(', ') });
911
- }
912
- } catch {
913
- /* best-effort */
914
- }
903
+ // (Step skipped CLI dispatch only)
915
904
 
916
905
  // Install core skills
917
906
  try {
@@ -1025,7 +1014,7 @@ export async function runUpgrade(
1025
1014
  action: 'structural_maintenance',
1026
1015
  status: 'preview',
1027
1016
  details:
1028
- 'Would create missing directories, ensure config, install hooks, schemas, project-info, agent definition, MCP server, skills, and NEXUS registration',
1017
+ 'Would create missing directories, ensure config, install hooks, schemas, project-info, agent definition, skills, and NEXUS registration',
1029
1018
  });
1030
1019
  }
1031
1020
 
@@ -7,7 +7,7 @@
7
7
  * - Layer 3: Referential validation (cross-entity integrity)
8
8
  * - Layer 4: Protocol validation (RCASD-IVTR+C lifecycle)
9
9
  *
10
- * Moved from src/mcp/lib/gate-validators.ts to core for proper layering.
10
+ * Moved to core for proper layering (formerly in dispatch).
11
11
  *
12
12
  * @task T2936
13
13
  * @task T3138