@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
@@ -73,7 +73,23 @@ function parseIdPrefix(id: string): 'decision' | 'pattern' | 'learning' | 'obser
73
73
  // Brain.db Entry Lookup
74
74
  // ============================================================================
75
75
 
76
- /** memory.show - Look up a brain.db entry by ID */
76
+ /**
77
+ * Look up a brain.db entry by ID.
78
+ *
79
+ * @param entryId - Brain entry ID with type prefix (D-, P-, L-, O-, or CM-)
80
+ * @param projectRoot - Optional project root path; defaults to resolved root
81
+ * @returns EngineResult containing the typed entry data on success
82
+ *
83
+ * @remarks
84
+ * Parses the ID prefix to determine the entry type (decision, pattern, learning,
85
+ * or observation) and queries the corresponding brain.db table.
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const result = await memoryShow('O-abc123', '/project');
90
+ * if (result.success) console.log(result.data.type, result.data.entry);
91
+ * ```
92
+ */
77
93
  export async function memoryShow(entryId: string, projectRoot?: string): Promise<EngineResult> {
78
94
  if (!entryId) {
79
95
  return { success: false, error: { code: 'E_INVALID_INPUT', message: 'entryId is required' } };
@@ -155,7 +171,22 @@ export async function memoryShow(entryId: string, projectRoot?: string): Promise
155
171
  // Brain.db Aggregate Stats
156
172
  // ============================================================================
157
173
 
158
- /** memory.stats - Aggregate stats from brain.db across all tables */
174
+ /**
175
+ * Aggregate stats from brain.db across all tables.
176
+ *
177
+ * @param projectRoot - Optional project root path; defaults to resolved root
178
+ * @returns EngineResult with observation, decision, pattern, and learning counts
179
+ *
180
+ * @remarks
181
+ * Queries each brain.db table for row counts and returns a combined statistics object.
182
+ * Returns zero counts if brain.db is not initialized.
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * const result = await memoryBrainStats('/project');
187
+ * if (result.success) console.log(result.data.observations);
188
+ * ```
189
+ */
159
190
  export async function memoryBrainStats(projectRoot?: string): Promise<EngineResult> {
160
191
  try {
161
192
  const root = resolveRoot(projectRoot);
@@ -215,7 +246,21 @@ export async function memoryBrainStats(projectRoot?: string): Promise<EngineResu
215
246
  // Brain.db Decision Operations
216
247
  // ============================================================================
217
248
 
218
- /** memory.decision.find - Search decisions in brain.db */
249
+ /**
250
+ * Search decisions in brain.db.
251
+ *
252
+ * @param params - Search parameters (query, limit, etc.)
253
+ * @param projectRoot - Optional project root path; defaults to resolved root
254
+ * @returns EngineResult with matching decision entries
255
+ *
256
+ * @remarks
257
+ * Queries the brain.db decisions table with optional text filtering and pagination.
258
+ *
259
+ * @example
260
+ * ```typescript
261
+ * const result = await memoryDecisionFind({ query: 'auth' }, '/project');
262
+ * ```
263
+ */
219
264
  export async function memoryDecisionFind(
220
265
  params: { query?: string; taskId?: string; limit?: number },
221
266
  projectRoot?: string,
@@ -264,7 +309,22 @@ export async function memoryDecisionFind(
264
309
  }
265
310
  }
266
311
 
267
- /** memory.decision.store - Store a decision to brain.db */
312
+ /**
313
+ * Store a decision to brain.db.
314
+ *
315
+ * @param params - Decision data including title, rationale, and alternatives
316
+ * @param projectRoot - Optional project root path; defaults to resolved root
317
+ * @returns EngineResult with the stored decision ID
318
+ *
319
+ * @remarks
320
+ * Creates a new decision entry in brain.db with a D-prefixed ID.
321
+ * Optionally refreshes the memory bridge after storing.
322
+ *
323
+ * @example
324
+ * ```typescript
325
+ * const result = await memoryDecisionStore({ title: 'Use SQLite', rationale: 'Embedded, fast' }, '/project');
326
+ * ```
327
+ */
268
328
  export async function memoryDecisionStore(
269
329
  params: {
270
330
  decision: string;
@@ -329,7 +389,22 @@ export async function memoryDecisionStore(
329
389
  // BRAIN Retrieval Operations (T5131-T5135) — Renamed from brain.* to flat ops
330
390
  // ============================================================================
331
391
 
332
- /** memory.find - Token-efficient brain search */
392
+ /**
393
+ * Token-efficient brain search returning compact results.
394
+ *
395
+ * @param params - Search parameters including query string and limit
396
+ * @param projectRoot - Optional project root path; defaults to resolved root
397
+ * @returns EngineResult with compact search hits (IDs and titles)
398
+ *
399
+ * @remarks
400
+ * Designed for the cheapest-first retrieval pattern. Returns minimal fields
401
+ * per hit to conserve tokens. Use memoryFetch for full entry details.
402
+ *
403
+ * @example
404
+ * ```typescript
405
+ * const result = await memoryFind({ query: 'authentication', limit: 10 }, '/project');
406
+ * ```
407
+ */
333
408
  export async function memoryFind(
334
409
  params: {
335
410
  query: string;
@@ -363,7 +438,22 @@ export async function memoryFind(
363
438
  }
364
439
  }
365
440
 
366
- /** memory.timeline - Chronological context around anchor */
441
+ /**
442
+ * Chronological context around a brain entry anchor.
443
+ *
444
+ * @param params - Timeline parameters including anchor ID and window size
445
+ * @param projectRoot - Optional project root path; defaults to resolved root
446
+ * @returns EngineResult with chronologically ordered entries around the anchor
447
+ *
448
+ * @remarks
449
+ * Retrieves entries before and after a given anchor ID for temporal context.
450
+ * Useful for understanding the sequence of observations and decisions.
451
+ *
452
+ * @example
453
+ * ```typescript
454
+ * const result = await memoryTimeline({ anchorId: 'O-abc123', window: 5 }, '/project');
455
+ * ```
456
+ */
367
457
  export async function memoryTimeline(
368
458
  params: { anchor: string; depthBefore?: number; depthAfter?: number },
369
459
  projectRoot?: string,
@@ -387,7 +477,22 @@ export async function memoryTimeline(
387
477
  }
388
478
  }
389
479
 
390
- /** memory.fetch - Batch fetch brain entries by IDs */
480
+ /**
481
+ * Batch fetch brain entries by IDs.
482
+ *
483
+ * @param params - Fetch parameters including an array of entry IDs
484
+ * @param projectRoot - Optional project root path; defaults to resolved root
485
+ * @returns EngineResult with full entry details for each requested ID
486
+ *
487
+ * @remarks
488
+ * Use after memoryFind to retrieve full details for specific entries.
489
+ * Part of the 3-layer retrieval pattern: search -> filter -> fetch.
490
+ *
491
+ * @example
492
+ * ```typescript
493
+ * const result = await memoryFetch({ ids: ['O-abc123', 'D-def456'] }, '/project');
494
+ * ```
495
+ */
391
496
  export async function memoryFetch(
392
497
  params: { ids: string[] },
393
498
  projectRoot?: string,
@@ -407,7 +512,22 @@ export async function memoryFetch(
407
512
  }
408
513
  }
409
514
 
410
- /** memory.observe - Save observation to brain */
515
+ /**
516
+ * Save an observation to brain.db.
517
+ *
518
+ * @param params - Observation data including text, title, and optional tags
519
+ * @param projectRoot - Optional project root path; defaults to resolved root
520
+ * @returns EngineResult with the stored observation ID
521
+ *
522
+ * @remarks
523
+ * Creates a new observation entry in brain.db with an O-prefixed ID.
524
+ * Optionally refreshes the memory bridge after storing.
525
+ *
526
+ * @example
527
+ * ```typescript
528
+ * const result = await memoryObserve({ text: 'Auth uses JWT', title: 'Auth discovery' }, '/project');
529
+ * ```
530
+ */
411
531
  export async function memoryObserve(
412
532
  params: {
413
533
  text: string;
@@ -445,7 +565,21 @@ export async function memoryObserve(
445
565
  // BRAIN Pattern Operations (T4770)
446
566
  // ============================================================================
447
567
 
448
- /** memory.pattern.store - Store a pattern to BRAIN memory */
568
+ /**
569
+ * Store a pattern to BRAIN memory.
570
+ *
571
+ * @param params - Pattern data including pattern string, type, and confidence
572
+ * @param projectRoot - Optional project root path; defaults to resolved root
573
+ * @returns EngineResult with the stored pattern ID
574
+ *
575
+ * @remarks
576
+ * Persists a detected pattern (success or failure) to brain.db for future scoring.
577
+ *
578
+ * @example
579
+ * ```typescript
580
+ * const result = await memoryPatternStore({ pattern: 'migration', type: 'success' }, '/project');
581
+ * ```
582
+ */
449
583
  export async function memoryPatternStore(
450
584
  params: StorePatternParams,
451
585
  projectRoot?: string,
@@ -465,7 +599,21 @@ export async function memoryPatternStore(
465
599
  }
466
600
  }
467
601
 
468
- /** memory.pattern.find - Search patterns in BRAIN memory */
602
+ /**
603
+ * Search patterns in BRAIN memory.
604
+ *
605
+ * @param params - Search parameters including query and type filter
606
+ * @param projectRoot - Optional project root path; defaults to resolved root
607
+ * @returns EngineResult with matching pattern entries
608
+ *
609
+ * @remarks
610
+ * Queries the brain.db patterns table with optional type filtering.
611
+ *
612
+ * @example
613
+ * ```typescript
614
+ * const result = await memoryPatternFind({ type: 'success', limit: 10 }, '/project');
615
+ * ```
616
+ */
469
617
  export async function memoryPatternFind(
470
618
  params: SearchPatternParams,
471
619
  projectRoot?: string,
@@ -485,7 +633,20 @@ export async function memoryPatternFind(
485
633
  }
486
634
  }
487
635
 
488
- /** memory.pattern.stats - Get pattern memory statistics */
636
+ /**
637
+ * Get pattern memory statistics.
638
+ *
639
+ * @param projectRoot - Optional project root path; defaults to resolved root
640
+ * @returns EngineResult with pattern counts by type and overall totals
641
+ *
642
+ * @remarks
643
+ * Aggregates pattern data from brain.db to provide type distribution and counts.
644
+ *
645
+ * @example
646
+ * ```typescript
647
+ * const result = await memoryPatternStats('/project');
648
+ * ```
649
+ */
489
650
  export async function memoryPatternStats(projectRoot?: string): Promise<EngineResult> {
490
651
  try {
491
652
  const root = resolveRoot(projectRoot);
@@ -506,7 +667,21 @@ export async function memoryPatternStats(projectRoot?: string): Promise<EngineRe
506
667
  // BRAIN Learning Operations (T4770)
507
668
  // ============================================================================
508
669
 
509
- /** memory.learning.store - Store a learning to BRAIN memory */
670
+ /**
671
+ * Store a learning to BRAIN memory.
672
+ *
673
+ * @param params - Learning data including text and confidence level
674
+ * @param projectRoot - Optional project root path; defaults to resolved root
675
+ * @returns EngineResult with the stored learning ID
676
+ *
677
+ * @remarks
678
+ * Creates a new learning entry in brain.db with an L-prefixed ID.
679
+ *
680
+ * @example
681
+ * ```typescript
682
+ * const result = await memoryLearningStore({ text: 'Drizzle v1 requires beta flag' }, '/project');
683
+ * ```
684
+ */
510
685
  export async function memoryLearningStore(
511
686
  params: StoreLearningParams,
512
687
  projectRoot?: string,
@@ -526,7 +701,21 @@ export async function memoryLearningStore(
526
701
  }
527
702
  }
528
703
 
529
- /** memory.learning.find - Search learnings in BRAIN memory */
704
+ /**
705
+ * Search learnings in BRAIN memory.
706
+ *
707
+ * @param params - Search parameters including query and limit
708
+ * @param projectRoot - Optional project root path; defaults to resolved root
709
+ * @returns EngineResult with matching learning entries
710
+ *
711
+ * @remarks
712
+ * Queries the brain.db learnings table with optional text filtering.
713
+ *
714
+ * @example
715
+ * ```typescript
716
+ * const result = await memoryLearningFind({ query: 'drizzle' }, '/project');
717
+ * ```
718
+ */
530
719
  export async function memoryLearningFind(
531
720
  params: SearchLearningParams,
532
721
  projectRoot?: string,
@@ -546,7 +735,20 @@ export async function memoryLearningFind(
546
735
  }
547
736
  }
548
737
 
549
- /** memory.learning.stats - Get learning memory statistics */
738
+ /**
739
+ * Get learning memory statistics.
740
+ *
741
+ * @param projectRoot - Optional project root path; defaults to resolved root
742
+ * @returns EngineResult with learning counts and confidence distribution
743
+ *
744
+ * @remarks
745
+ * Aggregates learning data from brain.db to provide totals and breakdowns.
746
+ *
747
+ * @example
748
+ * ```typescript
749
+ * const result = await memoryLearningStats('/project');
750
+ * ```
751
+ */
550
752
  export async function memoryLearningStats(projectRoot?: string): Promise<EngineResult> {
551
753
  try {
552
754
  const root = resolveRoot(projectRoot);
@@ -567,7 +769,22 @@ export async function memoryLearningStats(projectRoot?: string): Promise<EngineR
567
769
  // BRAIN Advanced Queries & Links (T5241)
568
770
  // ============================================================================
569
771
 
570
- /** memory.contradictions - Find contradictory entries in brain.db */
772
+ /**
773
+ * Find contradictory entries in brain.db.
774
+ *
775
+ * @param projectRoot - Optional project root path; defaults to resolved root
776
+ * @returns EngineResult with pairs of contradicting observations
777
+ *
778
+ * @remarks
779
+ * Scans brain.db for observations that contradict each other based on
780
+ * semantic similarity and opposing sentiment or content.
781
+ *
782
+ * @example
783
+ * ```typescript
784
+ * const result = await memoryContradictions('/project');
785
+ * if (result.success) console.log(result.data.contradictions);
786
+ * ```
787
+ */
571
788
  export async function memoryContradictions(projectRoot?: string): Promise<EngineResult> {
572
789
  try {
573
790
  const root = resolveRoot(projectRoot);
@@ -749,14 +966,29 @@ export async function memoryContradictions(projectRoot?: string): Promise<Engine
749
966
  }
750
967
  }
751
968
 
752
- /** memory.superseded - Find superseded entries in brain.db
969
+ /**
970
+ * Find superseded entries in brain.db.
753
971
  *
754
972
  * Identifies entries that have been superseded by newer entries on the same topic.
973
+ *
974
+ * @param params - Superseded search parameters
975
+ * @param projectRoot - Optional project root path; defaults to resolved root
976
+ * @returns EngineResult with superseded entry pairs and their replacements
977
+ *
978
+ * @remarks
979
+ * Scans brain.db for entries where a newer observation or decision covers
980
+ * the same topic, rendering the older entry obsolete.
981
+ *
755
982
  * For brain.db, we group by:
756
983
  * - Decisions: type + contextTaskId/contextEpicId
757
984
  * - Patterns: type + context (first 100 chars for similarity)
758
985
  * - Learnings: source + applicableTypes
759
986
  * - Observations: type + project
987
+ *
988
+ * @example
989
+ * ```typescript
990
+ * const result = await memorySuperseded({ type: 'decision' }, '/project');
991
+ * ```
760
992
  */
761
993
  export async function memorySuperseded(
762
994
  params?: { type?: string; project?: string },
@@ -932,7 +1164,22 @@ export async function memorySuperseded(
932
1164
  }
933
1165
  }
934
1166
 
935
- /** memory.link - Link a brain entry to a task */
1167
+ /**
1168
+ * Link a brain entry to a task.
1169
+ *
1170
+ * @param params - Link parameters including entryId and taskId
1171
+ * @param projectRoot - Optional project root path; defaults to resolved root
1172
+ * @returns EngineResult confirming the link was created
1173
+ *
1174
+ * @remarks
1175
+ * Creates an association between a brain.db entry and a task in tasks.db.
1176
+ * Used for traceability between memory entries and the work they relate to.
1177
+ *
1178
+ * @example
1179
+ * ```typescript
1180
+ * const result = await memoryLink({ entryId: 'O-abc123', taskId: 'T042' }, '/project');
1181
+ * ```
1182
+ */
936
1183
  export async function memoryLink(
937
1184
  params: { taskId: string; entryId: string },
938
1185
  projectRoot?: string,
@@ -970,7 +1217,22 @@ export async function memoryLink(
970
1217
  }
971
1218
  }
972
1219
 
973
- /** memory.unlink - Remove a link between a brain entry and a task */
1220
+ /**
1221
+ * Remove a link between a brain entry and a task.
1222
+ *
1223
+ * @param params - Unlink parameters including entryId and taskId
1224
+ * @param projectRoot - Optional project root path; defaults to resolved root
1225
+ * @returns EngineResult confirming the link was removed
1226
+ *
1227
+ * @remarks
1228
+ * Removes the association created by memoryLink. Idempotent if the link
1229
+ * does not exist.
1230
+ *
1231
+ * @example
1232
+ * ```typescript
1233
+ * const result = await memoryUnlink({ entryId: 'O-abc123', taskId: 'T042' }, '/project');
1234
+ * ```
1235
+ */
974
1236
  export async function memoryUnlink(
975
1237
  params: { taskId: string; entryId: string },
976
1238
  projectRoot?: string,
@@ -1012,7 +1274,22 @@ export async function memoryUnlink(
1012
1274
  // PageIndex Graph Operations (T5385)
1013
1275
  // ============================================================================
1014
1276
 
1015
- /** memory.graph.add - Add a node or edge to the PageIndex graph */
1277
+ /**
1278
+ * Add a node or edge to the PageIndex graph.
1279
+ *
1280
+ * @param params - Graph add parameters (node data or edge endpoints)
1281
+ * @param projectRoot - Optional project root path; defaults to resolved root
1282
+ * @returns EngineResult confirming the node or edge was added
1283
+ *
1284
+ * @remarks
1285
+ * Supports adding both nodes (concepts) and edges (relationships) to the
1286
+ * brain.db knowledge graph (PageIndex).
1287
+ *
1288
+ * @example
1289
+ * ```typescript
1290
+ * const result = await memoryGraphAdd({ type: 'node', label: 'auth', nodeType: 'concept' }, '/project');
1291
+ * ```
1292
+ */
1016
1293
  export async function memoryGraphAdd(
1017
1294
  params: {
1018
1295
  nodeId?: string;
@@ -1073,7 +1350,22 @@ export async function memoryGraphAdd(
1073
1350
  }
1074
1351
  }
1075
1352
 
1076
- /** memory.graph.show - Get a node and its edges from the PageIndex graph */
1353
+ /**
1354
+ * Get a node and its edges from the PageIndex graph.
1355
+ *
1356
+ * @param params - Parameters including the node ID to look up
1357
+ * @param projectRoot - Optional project root path; defaults to resolved root
1358
+ * @returns EngineResult with the node data and its connected edges
1359
+ *
1360
+ * @remarks
1361
+ * Returns the full node record plus all edges where the node appears as
1362
+ * either source or target.
1363
+ *
1364
+ * @example
1365
+ * ```typescript
1366
+ * const result = await memoryGraphShow({ nodeId: 'auth' }, '/project');
1367
+ * ```
1368
+ */
1077
1369
  export async function memoryGraphShow(
1078
1370
  params: { nodeId: string },
1079
1371
  projectRoot?: string,
@@ -1107,7 +1399,22 @@ export async function memoryGraphShow(
1107
1399
  }
1108
1400
  }
1109
1401
 
1110
- /** memory.graph.neighbors - Get neighbor nodes from the PageIndex graph */
1402
+ /**
1403
+ * Get neighbor nodes from the PageIndex graph.
1404
+ *
1405
+ * @param params - Parameters including the node ID and optional depth
1406
+ * @param projectRoot - Optional project root path; defaults to resolved root
1407
+ * @returns EngineResult with neighboring nodes and connecting edges
1408
+ *
1409
+ * @remarks
1410
+ * Traverses the knowledge graph outward from a given node to find related
1411
+ * concepts within the specified depth.
1412
+ *
1413
+ * @example
1414
+ * ```typescript
1415
+ * const result = await memoryGraphNeighbors({ nodeId: 'auth', depth: 2 }, '/project');
1416
+ * ```
1417
+ */
1111
1418
  export async function memoryGraphNeighbors(
1112
1419
  params: { nodeId: string; edgeType?: string },
1113
1420
  projectRoot?: string,
@@ -1142,7 +1449,22 @@ export async function memoryGraphNeighbors(
1142
1449
  // BRAIN Reasoning & Hybrid Search Operations (T5388-T5393)
1143
1450
  // ============================================================================
1144
1451
 
1145
- /** memory.reason.why - Causal trace through task dependency chains */
1452
+ /**
1453
+ * Causal trace through task dependency chains.
1454
+ *
1455
+ * @param params - Parameters including the entry or task ID to trace
1456
+ * @param projectRoot - Optional project root path; defaults to resolved root
1457
+ * @returns EngineResult with the causal chain explaining why something happened
1458
+ *
1459
+ * @remarks
1460
+ * Traces backward through task dependencies and brain entries to build
1461
+ * an explanation chain for a given decision or observation.
1462
+ *
1463
+ * @example
1464
+ * ```typescript
1465
+ * const result = await memoryReasonWhy({ id: 'D-abc123' }, '/project');
1466
+ * ```
1467
+ */
1146
1468
  export async function memoryReasonWhy(
1147
1469
  params: { taskId: string },
1148
1470
  projectRoot?: string,
@@ -1168,7 +1490,22 @@ export async function memoryReasonWhy(
1168
1490
  }
1169
1491
  }
1170
1492
 
1171
- /** memory.reason.similar - Find semantically similar entries */
1493
+ /**
1494
+ * Find semantically similar entries.
1495
+ *
1496
+ * @param params - Parameters including the source entry ID or query text
1497
+ * @param projectRoot - Optional project root path; defaults to resolved root
1498
+ * @returns EngineResult with entries ranked by semantic similarity
1499
+ *
1500
+ * @remarks
1501
+ * Uses embedding vectors or text similarity to find brain entries that are
1502
+ * semantically close to the given reference.
1503
+ *
1504
+ * @example
1505
+ * ```typescript
1506
+ * const result = await memoryReasonSimilar({ id: 'O-abc123', limit: 5 }, '/project');
1507
+ * ```
1508
+ */
1172
1509
  export async function memoryReasonSimilar(
1173
1510
  params: { entryId: string; limit?: number },
1174
1511
  projectRoot?: string,
@@ -1193,7 +1530,22 @@ export async function memoryReasonSimilar(
1193
1530
  }
1194
1531
  }
1195
1532
 
1196
- /** memory.search.hybrid - Hybrid search across FTS5, vector, and graph */
1533
+ /**
1534
+ * Hybrid search across FTS5, vector, and graph.
1535
+ *
1536
+ * @param params - Search parameters including query and optional mode/limit
1537
+ * @param projectRoot - Optional project root path; defaults to resolved root
1538
+ * @returns EngineResult with merged and ranked results from all search backends
1539
+ *
1540
+ * @remarks
1541
+ * Combines full-text search (FTS5), vector similarity, and graph traversal
1542
+ * to produce comprehensive search results with merged relevance scoring.
1543
+ *
1544
+ * @example
1545
+ * ```typescript
1546
+ * const result = await memorySearchHybrid({ query: 'authentication flow' }, '/project');
1547
+ * ```
1548
+ */
1197
1549
  export async function memorySearchHybrid(
1198
1550
  params: {
1199
1551
  query: string;
@@ -1229,7 +1581,22 @@ export async function memorySearchHybrid(
1229
1581
  }
1230
1582
  }
1231
1583
 
1232
- /** memory.graph.remove - Remove a node or edge from the PageIndex graph */
1584
+ /**
1585
+ * Remove a node or edge from the PageIndex graph.
1586
+ *
1587
+ * @param params - Parameters specifying the node or edge to remove
1588
+ * @param projectRoot - Optional project root path; defaults to resolved root
1589
+ * @returns EngineResult confirming the removal
1590
+ *
1591
+ * @remarks
1592
+ * Removes a node (and its connected edges) or a specific edge from the
1593
+ * brain.db knowledge graph.
1594
+ *
1595
+ * @example
1596
+ * ```typescript
1597
+ * const result = await memoryGraphRemove({ type: 'node', nodeId: 'stale-concept' }, '/project');
1598
+ * ```
1599
+ */
1233
1600
  export async function memoryGraphRemove(
1234
1601
  params: {
1235
1602
  nodeId?: string;