@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
package/src/paths.ts CHANGED
@@ -17,6 +17,20 @@ import { getPlatformPaths } from './system/platform-paths.js';
17
17
  /**
18
18
  * Check if a CLEO project is initialized at the given root.
19
19
  * Checks for tasks.db.
20
+ *
21
+ * @param projectRoot - Absolute path to check; defaults to the resolved project root
22
+ * @returns True if .cleo/ and tasks.db exist at the given root
23
+ *
24
+ * @remarks
25
+ * A project is considered initialized when both the .cleo/ directory and
26
+ * the tasks.db SQLite database file are present.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * if (isProjectInitialized('/my/project')) {
31
+ * console.log('CLEO project found');
32
+ * }
33
+ * ```
20
34
  */
21
35
  export function isProjectInitialized(projectRoot?: string): boolean {
22
36
  const root = projectRoot ?? getProjectRoot();
@@ -29,6 +43,17 @@ export function isProjectInitialized(projectRoot?: string): boolean {
29
43
  * Respects CLEO_HOME env var; otherwise uses the OS-appropriate data path
30
44
  * via env-paths (XDG_DATA_HOME on Linux, Library/Application Support on macOS,
31
45
  * %LOCALAPPDATA% on Windows).
46
+ *
47
+ * @returns Absolute path to the global CLEO data directory
48
+ *
49
+ * @remarks
50
+ * Delegates to `getPlatformPaths().data` which uses the `env-paths` package
51
+ * for XDG-compliant path resolution across operating systems.
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const home = getCleoHome(); // e.g. "/home/user/.local/share/cleo"
56
+ * ```
32
57
  */
33
58
  export function getCleoHome(): string {
34
59
  return getPlatformPaths().data;
@@ -36,6 +61,17 @@ export function getCleoHome(): string {
36
61
 
37
62
  /**
38
63
  * Get the global CLEO templates directory.
64
+ *
65
+ * @returns Absolute path to the templates directory under CLEO home
66
+ *
67
+ * @remarks
68
+ * Returns `{cleoHome}/templates` where CLEO-INJECTION.md and other global
69
+ * templates are stored.
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const dir = getCleoTemplatesDir(); // e.g. "/home/user/.local/share/cleo/templates"
74
+ * ```
39
75
  */
40
76
  export function getCleoTemplatesDir(): string {
41
77
  return join(getCleoHome(), 'templates');
@@ -43,6 +79,17 @@ export function getCleoTemplatesDir(): string {
43
79
 
44
80
  /**
45
81
  * Get the global CLEO schemas directory.
82
+ *
83
+ * @returns Absolute path to the schemas directory under CLEO home
84
+ *
85
+ * @remarks
86
+ * Returns `{cleoHome}/schemas`. Note that schemas are typically read at
87
+ * runtime from the npm package root, not this global directory.
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * const dir = getCleoSchemasDir();
92
+ * ```
46
93
  */
47
94
  export function getCleoSchemasDir(): string {
48
95
  return join(getCleoHome(), 'schemas');
@@ -50,6 +97,16 @@ export function getCleoSchemasDir(): string {
50
97
 
51
98
  /**
52
99
  * Get the global CLEO docs directory.
100
+ *
101
+ * @returns Absolute path to the docs directory under CLEO home
102
+ *
103
+ * @remarks
104
+ * Returns `{cleoHome}/docs` for global documentation storage.
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * const dir = getCleoDocsDir();
109
+ * ```
53
110
  */
54
111
  export function getCleoDocsDir(): string {
55
112
  return join(getCleoHome(), 'docs');
@@ -58,6 +115,19 @@ export function getCleoDocsDir(): string {
58
115
  /**
59
116
  * Get the project CLEO data directory (relative).
60
117
  * Respects CLEO_DIR env var, defaults to ".cleo".
118
+ *
119
+ * @param cwd - Optional working directory; when provided, returns absolute path
120
+ * @returns Relative or absolute path to the project's .cleo directory
121
+ *
122
+ * @remarks
123
+ * If `cwd` is provided, delegates to `getCleoDirAbsolute`. Otherwise returns
124
+ * the `CLEO_DIR` env var or the default ".cleo" relative path.
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * const rel = getCleoDir(); // ".cleo"
129
+ * const abs = getCleoDir('/project'); // "/project/.cleo"
130
+ * ```
61
131
  */
62
132
  export function getCleoDir(cwd?: string): string {
63
133
  if (cwd) {
@@ -68,6 +138,18 @@ export function getCleoDir(cwd?: string): string {
68
138
 
69
139
  /**
70
140
  * Get the absolute path to the project CLEO directory.
141
+ *
142
+ * @param cwd - Optional working directory to resolve against; defaults to process.cwd()
143
+ * @returns Absolute path to the project's .cleo directory
144
+ *
145
+ * @remarks
146
+ * If CLEO_DIR is already absolute, returns it directly. Otherwise resolves
147
+ * it relative to the provided cwd or process.cwd().
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * const dir = getCleoDirAbsolute('/my/project'); // "/my/project/.cleo"
152
+ * ```
71
153
  */
72
154
  export function getCleoDirAbsolute(cwd?: string): string {
73
155
  const cleoDir = getCleoDir();
@@ -81,6 +163,18 @@ export function getCleoDirAbsolute(cwd?: string): string {
81
163
  * Get the project root from the CLEO directory.
82
164
  * Respects CLEO_ROOT env var, then derives from CLEO_DIR.
83
165
  * If CLEO_DIR is ".cleo", the project root is its parent.
166
+ *
167
+ * @param cwd - Optional working directory hint
168
+ * @returns Absolute path to the project root
169
+ *
170
+ * @remarks
171
+ * Resolution order: CLEO_ROOT env var (if no cwd), parent of the resolved
172
+ * .cleo directory (if it ends with /.cleo), or the cwd/process.cwd() fallback.
173
+ *
174
+ * @example
175
+ * ```typescript
176
+ * const root = getProjectRoot(); // "/home/user/projects/myapp"
177
+ * ```
84
178
  */
85
179
  export function getProjectRoot(cwd?: string): string {
86
180
  if (!cwd && process.env['CLEO_ROOT']) {
@@ -95,13 +189,28 @@ export function getProjectRoot(cwd?: string): string {
95
189
 
96
190
  /**
97
191
  * Resolve a project-relative path to an absolute path.
192
+ *
193
+ * @param relativePath - Path to resolve (relative, absolute, or tilde-prefixed)
194
+ * @param cwd - Optional working directory for project root resolution
195
+ * @returns Absolute resolved path
196
+ *
197
+ * @remarks
198
+ * Returns absolute paths unchanged. Expands leading tilde (`~/`) to the user's
199
+ * home directory. Resolves other relative paths against the project root.
200
+ *
201
+ * @example
202
+ * ```typescript
203
+ * resolveProjectPath('src/index.ts'); // "/project/src/index.ts"
204
+ * resolveProjectPath('~/notes.md'); // "/home/user/notes.md"
205
+ * resolveProjectPath('/absolute/path'); // "/absolute/path"
206
+ * ```
98
207
  */
99
208
  export function resolveProjectPath(relativePath: string, cwd?: string): string {
100
209
  if (isAbsolutePath(relativePath)) {
101
210
  return relativePath;
102
211
  }
103
- // Expand leading tilde
104
- if (relativePath.startsWith('~/') || relativePath === '~') {
212
+ // Expand leading tilde (handles both ~/ on Unix and ~\ on Windows)
213
+ if (relativePath.startsWith('~/') || relativePath.startsWith('~\\') || relativePath === '~') {
105
214
  return resolve(homedir(), relativePath.slice(2));
106
215
  }
107
216
  return resolve(getProjectRoot(cwd), relativePath);
@@ -119,6 +228,17 @@ export function resolveProjectPath(relativePath: string, cwd?: string): string {
119
228
  * // NEW (correct):
120
229
  * const accessor = await getAccessor(cwd);
121
230
  * const data = await accessor.queryTasks({});
231
+ *
232
+ * @param cwd - Optional working directory for path resolution
233
+ * @returns Absolute path to the tasks.db file
234
+ *
235
+ * @remarks
236
+ * Returns `{cleoDir}/tasks.db`. Prefer `getAccessor()` for actual data access.
237
+ *
238
+ * @example
239
+ * ```typescript
240
+ * const dbPath = getTaskPath('/project');
241
+ * ```
122
242
  */
123
243
  export function getTaskPath(cwd?: string): string {
124
244
  return join(getCleoDirAbsolute(cwd), 'tasks.db');
@@ -126,6 +246,17 @@ export function getTaskPath(cwd?: string): string {
126
246
 
127
247
  /**
128
248
  * Get the path to the project's config.json file.
249
+ *
250
+ * @param cwd - Optional working directory for path resolution
251
+ * @returns Absolute path to the project config.json
252
+ *
253
+ * @remarks
254
+ * Returns `{cleoDir}/config.json`.
255
+ *
256
+ * @example
257
+ * ```typescript
258
+ * const configPath = getConfigPath('/project');
259
+ * ```
129
260
  */
130
261
  export function getConfigPath(cwd?: string): string {
131
262
  return join(getCleoDirAbsolute(cwd), 'config.json');
@@ -133,6 +264,17 @@ export function getConfigPath(cwd?: string): string {
133
264
 
134
265
  /**
135
266
  * Get the path to the project's sessions.json file.
267
+ *
268
+ * @param cwd - Optional working directory for path resolution
269
+ * @returns Absolute path to the sessions.json file
270
+ *
271
+ * @remarks
272
+ * Returns `{cleoDir}/sessions.json`.
273
+ *
274
+ * @example
275
+ * ```typescript
276
+ * const sessionsPath = getSessionsPath('/project');
277
+ * ```
136
278
  */
137
279
  export function getSessionsPath(cwd?: string): string {
138
280
  return join(getCleoDirAbsolute(cwd), 'sessions.json');
@@ -140,6 +282,17 @@ export function getSessionsPath(cwd?: string): string {
140
282
 
141
283
  /**
142
284
  * Get the path to the project's archive file.
285
+ *
286
+ * @param cwd - Optional working directory for path resolution
287
+ * @returns Absolute path to the tasks-archive.json file
288
+ *
289
+ * @remarks
290
+ * Returns `{cleoDir}/tasks-archive.json` where archived tasks are stored.
291
+ *
292
+ * @example
293
+ * ```typescript
294
+ * const archivePath = getArchivePath('/project');
295
+ * ```
143
296
  */
144
297
  export function getArchivePath(cwd?: string): string {
145
298
  return join(getCleoDirAbsolute(cwd), 'tasks-archive.json');
@@ -148,6 +301,18 @@ export function getArchivePath(cwd?: string): string {
148
301
  /**
149
302
  * Get the path to the project's log file.
150
303
  * Canonical structured runtime log path (pino).
304
+ *
305
+ * @param cwd - Optional working directory for path resolution
306
+ * @returns Absolute path to the cleo.log file
307
+ *
308
+ * @remarks
309
+ * Returns `{cleoDir}/logs/cleo.log`. Used by pino for structured JSON logging.
310
+ *
311
+ * @example
312
+ * ```typescript
313
+ * const logPath = getLogPath('/project');
314
+ * ```
315
+ *
151
316
  * @task T4644
152
317
  */
153
318
  export function getLogPath(cwd?: string): string {
@@ -156,6 +321,17 @@ export function getLogPath(cwd?: string): string {
156
321
 
157
322
  /**
158
323
  * Get the backup directory for operational backups.
324
+ *
325
+ * @param cwd - Optional working directory for path resolution
326
+ * @returns Absolute path to the operational backups directory
327
+ *
328
+ * @remarks
329
+ * Returns `{cleoDir}/backups/operational`.
330
+ *
331
+ * @example
332
+ * ```typescript
333
+ * const backupDir = getBackupDir('/project');
334
+ * ```
159
335
  */
160
336
  export function getBackupDir(cwd?: string): string {
161
337
  return join(getCleoDirAbsolute(cwd), 'backups', 'operational');
@@ -163,6 +339,16 @@ export function getBackupDir(cwd?: string): string {
163
339
 
164
340
  /**
165
341
  * Get the global config file path.
342
+ *
343
+ * @returns Absolute path to the global config.json in CLEO home
344
+ *
345
+ * @remarks
346
+ * Returns `{cleoHome}/config.json` for global CLEO configuration.
347
+ *
348
+ * @example
349
+ * ```typescript
350
+ * const globalConfig = getGlobalConfigPath();
351
+ * ```
166
352
  */
167
353
  export function getGlobalConfigPath(): string {
168
354
  return join(getCleoHome(), 'config.json');
@@ -183,6 +369,18 @@ const DEFAULT_AGENT_OUTPUTS_DIR = '.cleo/agent-outputs';
183
369
  * 3. config.directories.agentOutputs (deprecated)
184
370
  * 4. Default: '.cleo/agent-outputs'
185
371
  *
372
+ * @param cwd - Optional working directory for path resolution
373
+ * @returns Relative or absolute path to the agent outputs directory
374
+ *
375
+ * @remarks
376
+ * Checks config fields in priority order: `agentOutputs.directory`, `research.outputDir`,
377
+ * `directories.agentOutputs`. Falls back to `.cleo/agent-outputs`.
378
+ *
379
+ * @example
380
+ * ```typescript
381
+ * const dir = getAgentOutputsDir('/project');
382
+ * ```
383
+ *
186
384
  * @task T4700
187
385
  */
188
386
  export function getAgentOutputsDir(cwd?: string): string {
@@ -221,6 +419,19 @@ export function getAgentOutputsDir(cwd?: string): string {
221
419
 
222
420
  /**
223
421
  * Get the absolute path to the agent outputs directory.
422
+ *
423
+ * @param cwd - Optional working directory for path resolution
424
+ * @returns Absolute path to the agent outputs directory
425
+ *
426
+ * @remarks
427
+ * Resolves the output of `getAgentOutputsDir()` against the project root
428
+ * if it is not already absolute.
429
+ *
430
+ * @example
431
+ * ```typescript
432
+ * const absDir = getAgentOutputsAbsolute('/project');
433
+ * ```
434
+ *
224
435
  * @task T4700
225
436
  */
226
437
  export function getAgentOutputsAbsolute(cwd?: string): string {
@@ -237,6 +448,18 @@ export function getAgentOutputsAbsolute(cwd?: string): string {
237
448
  * Checks config.agentOutputs.manifestFile for custom filename,
238
449
  * defaults to 'MANIFEST.jsonl'.
239
450
  *
451
+ * @param cwd - Optional working directory for path resolution
452
+ * @returns Absolute path to the MANIFEST.jsonl file
453
+ *
454
+ * @remarks
455
+ * Checks `config.agentOutputs.manifestFile` for a custom filename,
456
+ * defaults to `MANIFEST.jsonl` in the agent outputs directory.
457
+ *
458
+ * @example
459
+ * ```typescript
460
+ * const manifestPath = getManifestPath('/project');
461
+ * ```
462
+ *
240
463
  * @task T4700
241
464
  */
242
465
  export function getManifestPath(cwd?: string): string {
@@ -262,6 +485,18 @@ export function getManifestPath(cwd?: string): string {
262
485
 
263
486
  /**
264
487
  * Get the absolute path to the MANIFEST.archive.jsonl file.
488
+ *
489
+ * @param cwd - Optional working directory for path resolution
490
+ * @returns Absolute path to the MANIFEST.archive.jsonl file
491
+ *
492
+ * @remarks
493
+ * Returns the archive manifest path in the agent outputs directory.
494
+ *
495
+ * @example
496
+ * ```typescript
497
+ * const archivePath = getManifestArchivePath('/project');
498
+ * ```
499
+ *
265
500
  * @task T4700
266
501
  */
267
502
  export function getManifestArchivePath(cwd?: string): string {
@@ -276,6 +511,20 @@ export function getManifestArchivePath(cwd?: string): string {
276
511
 
277
512
  /**
278
513
  * Check if a path is absolute (POSIX or Windows).
514
+ *
515
+ * @param path - Filesystem path to check
516
+ * @returns True if the path is absolute on any supported OS
517
+ *
518
+ * @remarks
519
+ * Recognizes POSIX absolute paths (`/...`), Windows drive letters (`C:\...`),
520
+ * and UNC paths (`\\...`).
521
+ *
522
+ * @example
523
+ * ```typescript
524
+ * isAbsolutePath('/usr/bin'); // true
525
+ * isAbsolutePath('C:\\Users'); // true
526
+ * isAbsolutePath('./relative'); // false
527
+ * ```
279
528
  */
280
529
  export function isAbsolutePath(path: string): boolean {
281
530
  // POSIX absolute
@@ -294,6 +543,16 @@ export function isAbsolutePath(path: string): boolean {
294
543
  /**
295
544
  * Get the OS log directory for CLEO global logs.
296
545
  * Linux: ~/.local/state/cleo | macOS: ~/Library/Logs/cleo | Windows: %LOCALAPPDATA%\cleo\Log
546
+ *
547
+ * @returns Absolute path to the OS-appropriate log directory
548
+ *
549
+ * @remarks
550
+ * Delegates to `getPlatformPaths().log` for XDG-compliant resolution.
551
+ *
552
+ * @example
553
+ * ```typescript
554
+ * const logDir = getCleoLogDir();
555
+ * ```
297
556
  */
298
557
  export function getCleoLogDir(): string {
299
558
  return getPlatformPaths().log;
@@ -302,6 +561,16 @@ export function getCleoLogDir(): string {
302
561
  /**
303
562
  * Get the OS cache directory for CLEO.
304
563
  * Linux: ~/.cache/cleo | macOS: ~/Library/Caches/cleo | Windows: %LOCALAPPDATA%\cleo\Cache
564
+ *
565
+ * @returns Absolute path to the OS-appropriate cache directory
566
+ *
567
+ * @remarks
568
+ * Delegates to `getPlatformPaths().cache` for XDG-compliant resolution.
569
+ *
570
+ * @example
571
+ * ```typescript
572
+ * const cacheDir = getCleoCacheDir();
573
+ * ```
305
574
  */
306
575
  export function getCleoCacheDir(): string {
307
576
  return getPlatformPaths().cache;
@@ -309,6 +578,16 @@ export function getCleoCacheDir(): string {
309
578
 
310
579
  /**
311
580
  * Get the OS temp directory for CLEO ephemeral files.
581
+ *
582
+ * @returns Absolute path to the OS-appropriate temp directory
583
+ *
584
+ * @remarks
585
+ * Delegates to `getPlatformPaths().temp` for platform-specific resolution.
586
+ *
587
+ * @example
588
+ * ```typescript
589
+ * const tempDir = getCleoTempDir();
590
+ * ```
312
591
  */
313
592
  export function getCleoTempDir(): string {
314
593
  return getPlatformPaths().temp;
@@ -317,6 +596,16 @@ export function getCleoTempDir(): string {
317
596
  /**
318
597
  * Get the OS config directory for CLEO.
319
598
  * Linux: ~/.config/cleo | macOS: ~/Library/Preferences/cleo | Windows: %APPDATA%\cleo\Config
599
+ *
600
+ * @returns Absolute path to the OS-appropriate config directory
601
+ *
602
+ * @remarks
603
+ * Delegates to `getPlatformPaths().config` for XDG-compliant resolution.
604
+ *
605
+ * @example
606
+ * ```typescript
607
+ * const configDir = getCleoConfigDir();
608
+ * ```
320
609
  */
321
610
  export function getCleoConfigDir(): string {
322
611
  return getPlatformPaths().config;
@@ -331,12 +620,27 @@ export function getCleoConfigDir(): string {
331
620
  * Linux: ~/.local/share/cleo/templates
332
621
  * macOS: ~/Library/Application Support/cleo/templates
333
622
  * Windows: ~/AppData/Local/cleo/Data/templates (approximate)
623
+ *
624
+ * @returns Tilde-prefixed path like "~/.local/share/cleo/templates"
625
+ *
626
+ * @remarks
627
+ * Returns the absolute path if the home directory is not a prefix
628
+ * (unlikely but handled). Always uses forward slashes after the tilde
629
+ * for cross-platform compatibility in `@`-reference resolution.
630
+ *
631
+ * @example
632
+ * ```typescript
633
+ * const tildePath = getCleoTemplatesTildePath();
634
+ * // "~/.local/share/cleo/templates"
635
+ * ```
334
636
  */
335
637
  export function getCleoTemplatesTildePath(): string {
336
638
  const absPath = getCleoTemplatesDir();
337
639
  const home = homedir();
338
640
  if (absPath.startsWith(home)) {
339
- return `~${absPath.slice(home.length)}`;
641
+ // Always use forward slash after tilde for cross-platform @-reference resolution
642
+ const relative = absPath.slice(home.length).replace(/\\/g, '/');
643
+ return `~${relative}`;
340
644
  }
341
645
  return absPath;
342
646
  }
@@ -348,6 +652,16 @@ export function getCleoTemplatesTildePath(): string {
348
652
  /**
349
653
  * Get the global agents hub directory.
350
654
  * Respects AGENTS_HOME env var, defaults to ~/.agents.
655
+ *
656
+ * @returns Absolute path to the agents hub directory
657
+ *
658
+ * @remarks
659
+ * Returns `AGENTS_HOME` env var if set, otherwise `~/.agents`.
660
+ *
661
+ * @example
662
+ * ```typescript
663
+ * const agentsHome = getAgentsHome(); // "/home/user/.agents"
664
+ * ```
351
665
  */
352
666
  export function getAgentsHome(): string {
353
667
  return process.env['AGENTS_HOME'] ?? join(homedir(), '.agents');
@@ -355,6 +669,17 @@ export function getAgentsHome(): string {
355
669
 
356
670
  /**
357
671
  * Get the Claude Code agents directory (~/.claude/agents by default).
672
+ *
673
+ * @returns Absolute path to the Claude agents directory
674
+ *
675
+ * @remarks
676
+ * Respects `CLAUDE_HOME` env var for the parent directory.
677
+ *
678
+ * @example
679
+ * ```typescript
680
+ * const dir = getClaudeAgentsDir();
681
+ * ```
682
+ *
358
683
  * @deprecated Use AdapterPathProvider.getAgentInstallDir() from the active adapter instead.
359
684
  */
360
685
  export function getClaudeAgentsDir(): string {
@@ -364,9 +689,19 @@ export function getClaudeAgentsDir(): string {
364
689
 
365
690
  /**
366
691
  * Get the claude-mem SQLite database path.
367
- * @deprecated Use AdapterPathProvider.getMemoryDbPath() from the active adapter instead.
368
- * Respects CLAUDE_MEM_DB env var, defaults to ~/.claude-mem/claude-mem.db.
692
+ *
693
+ * @returns Absolute path to the claude-mem.db file
694
+ *
695
+ * @remarks
696
+ * Respects `CLAUDE_MEM_DB` env var, defaults to `~/.claude-mem/claude-mem.db`.
369
697
  * This is a third-party tool path; homedir() is correct here (no env-paths standard).
698
+ *
699
+ * @example
700
+ * ```typescript
701
+ * const dbPath = getClaudeMemDbPath();
702
+ * ```
703
+ *
704
+ * @deprecated Use AdapterPathProvider.getMemoryDbPath() from the active adapter instead.
370
705
  */
371
706
  export function getClaudeMemDbPath(): string {
372
707
  return process.env['CLAUDE_MEM_DB'] ?? join(homedir(), '.claude-mem', 'claude-mem.db');