@cleocode/core 2026.5.134 → 2026.6.0

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 (548) hide show
  1. package/binaries/README.md +49 -27
  2. package/dist/agents/{agent-registry.d.ts → agent-capacity-tracker.d.ts} +2 -2
  3. package/dist/agents/agent-capacity-tracker.d.ts.map +1 -0
  4. package/dist/agents/{agent-registry.js → agent-capacity-tracker.js} +2 -2
  5. package/dist/agents/agent-capacity-tracker.js.map +1 -0
  6. package/dist/agents/index.d.ts +1 -1
  7. package/dist/agents/index.d.ts.map +1 -1
  8. package/dist/agents/index.js +4 -2
  9. package/dist/agents/index.js.map +1 -1
  10. package/dist/agents/seed-install.d.ts +1 -1
  11. package/dist/agents/seed-install.d.ts.map +1 -1
  12. package/dist/agents/seed-install.js +42 -36
  13. package/dist/agents/seed-install.js.map +1 -1
  14. package/dist/caamp-export.d.ts +18 -0
  15. package/dist/caamp-export.d.ts.map +1 -0
  16. package/dist/caamp-export.js +18 -0
  17. package/dist/caamp-export.js.map +1 -0
  18. package/dist/conduit/local-transport.d.ts +1 -1
  19. package/dist/conduit/local-transport.d.ts.map +1 -1
  20. package/dist/conduit/local-transport.js +69 -43
  21. package/dist/conduit/local-transport.js.map +1 -1
  22. package/dist/dispatch/mutate-projection.d.ts.map +1 -1
  23. package/dist/dispatch/mutate-projection.js +11 -0
  24. package/dist/dispatch/mutate-projection.js.map +1 -1
  25. package/dist/docs/docs-read-model.d.ts +7 -0
  26. package/dist/docs/docs-read-model.d.ts.map +1 -1
  27. package/dist/docs/docs-read-model.js +5 -0
  28. package/dist/docs/docs-read-model.js.map +1 -1
  29. package/dist/docs/supersede.d.ts.map +1 -1
  30. package/dist/docs/supersede.js +12 -7
  31. package/dist/docs/supersede.js.map +1 -1
  32. package/dist/doctor/db-substrate.d.ts.map +1 -1
  33. package/dist/doctor/db-substrate.js +10 -9
  34. package/dist/doctor/db-substrate.js.map +1 -1
  35. package/dist/git-shim-export.d.ts +18 -0
  36. package/dist/git-shim-export.d.ts.map +1 -0
  37. package/dist/git-shim-export.js +18 -0
  38. package/dist/git-shim-export.js.map +1 -0
  39. package/dist/hooks/payload-schemas.d.ts +2 -2
  40. package/dist/init.d.ts.map +1 -1
  41. package/dist/init.js +39 -32
  42. package/dist/init.js.map +1 -1
  43. package/dist/internal.d.ts +11 -3
  44. package/dist/internal.d.ts.map +1 -1
  45. package/dist/internal.js +14 -5
  46. package/dist/internal.js.map +1 -1
  47. package/dist/lafs-export.d.ts +18 -0
  48. package/dist/lafs-export.d.ts.map +1 -0
  49. package/dist/lafs-export.js +18 -0
  50. package/dist/lafs-export.js.map +1 -0
  51. package/dist/lifecycle/effective-stage.js +1 -1
  52. package/dist/lifecycle/index.js +1 -1
  53. package/dist/lifecycle/index.js.map +1 -1
  54. package/dist/lifecycle/rollup.js +1 -1
  55. package/dist/llm/credential-pool.d.ts +17 -0
  56. package/dist/llm/credential-pool.d.ts.map +1 -1
  57. package/dist/llm/credential-pool.js +40 -1
  58. package/dist/llm/credential-pool.js.map +1 -1
  59. package/dist/llm/plugin-facade.d.ts.map +1 -1
  60. package/dist/llm/plugin-facade.js +11 -19
  61. package/dist/llm/plugin-facade.js.map +1 -1
  62. package/dist/llm/role-executor.d.ts +8 -0
  63. package/dist/llm/role-executor.d.ts.map +1 -1
  64. package/dist/llm/role-executor.js +96 -4
  65. package/dist/llm/role-executor.js.map +1 -1
  66. package/dist/llm/role-resolver.d.ts.map +1 -1
  67. package/dist/llm/role-resolver.js +56 -1
  68. package/dist/llm/role-resolver.js.map +1 -1
  69. package/dist/llm/transports/codex-oauth-headers.d.ts +51 -0
  70. package/dist/llm/transports/codex-oauth-headers.d.ts.map +1 -0
  71. package/dist/llm/transports/codex-oauth-headers.js +89 -0
  72. package/dist/llm/transports/codex-oauth-headers.js.map +1 -0
  73. package/dist/memory/claude-mem-migration.d.ts.map +1 -1
  74. package/dist/memory/claude-mem-migration.js +1 -3
  75. package/dist/memory/claude-mem-migration.js.map +1 -1
  76. package/dist/memory/decisions.d.ts.map +1 -1
  77. package/dist/memory/decisions.js +77 -23
  78. package/dist/memory/decisions.js.map +1 -1
  79. package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
  80. package/dist/memory/graph-memory-bridge.js +12 -6
  81. package/dist/memory/graph-memory-bridge.js.map +1 -1
  82. package/dist/memory/learnings.d.ts +2 -2
  83. package/dist/memory/nexus-plasticity.d.ts +21 -9
  84. package/dist/memory/nexus-plasticity.d.ts.map +1 -1
  85. package/dist/memory/nexus-plasticity.js +44 -22
  86. package/dist/memory/nexus-plasticity.js.map +1 -1
  87. package/dist/memory/patterns.d.ts +2 -2
  88. package/dist/memory/redaction.d.ts +19 -3
  89. package/dist/memory/redaction.d.ts.map +1 -1
  90. package/dist/memory/redaction.js +22 -94
  91. package/dist/memory/redaction.js.map +1 -1
  92. package/dist/metrics/token-service.d.ts +8 -2
  93. package/dist/metrics/token-service.d.ts.map +1 -1
  94. package/dist/metrics/token-service.js +1 -1
  95. package/dist/metrics/token-service.js.map +1 -1
  96. package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
  97. package/dist/nexus/analyze-orchestrator.js +6 -8
  98. package/dist/nexus/analyze-orchestrator.js.map +1 -1
  99. package/dist/nexus/api-extractors/http-extractor.d.ts.map +1 -1
  100. package/dist/nexus/api-extractors/http-extractor.js +3 -3
  101. package/dist/nexus/api-extractors/http-extractor.js.map +1 -1
  102. package/dist/nexus/clusters.d.ts.map +1 -1
  103. package/dist/nexus/clusters.js +3 -2
  104. package/dist/nexus/clusters.js.map +1 -1
  105. package/dist/nexus/context.d.ts.map +1 -1
  106. package/dist/nexus/context.js +10 -16
  107. package/dist/nexus/context.js.map +1 -1
  108. package/dist/nexus/diff.d.ts.map +1 -1
  109. package/dist/nexus/diff.js +6 -4
  110. package/dist/nexus/diff.js.map +1 -1
  111. package/dist/nexus/export.d.ts.map +1 -1
  112. package/dist/nexus/export.js +7 -4
  113. package/dist/nexus/export.js.map +1 -1
  114. package/dist/nexus/flows.d.ts.map +1 -1
  115. package/dist/nexus/flows.js +3 -1
  116. package/dist/nexus/flows.js.map +1 -1
  117. package/dist/nexus/impact.d.ts +1 -1
  118. package/dist/nexus/impact.d.ts.map +1 -1
  119. package/dist/nexus/impact.js +31 -17
  120. package/dist/nexus/impact.js.map +1 -1
  121. package/dist/nexus/living-brain.d.ts.map +1 -1
  122. package/dist/nexus/living-brain.js +27 -15
  123. package/dist/nexus/living-brain.js.map +1 -1
  124. package/dist/nexus/nexus-bridge.d.ts.map +1 -1
  125. package/dist/nexus/nexus-bridge.js +28 -29
  126. package/dist/nexus/nexus-bridge.js.map +1 -1
  127. package/dist/nexus/plasticity-queries.d.ts +4 -2
  128. package/dist/nexus/plasticity-queries.d.ts.map +1 -1
  129. package/dist/nexus/plasticity-queries.js +27 -15
  130. package/dist/nexus/plasticity-queries.js.map +1 -1
  131. package/dist/nexus/query.d.ts.map +1 -1
  132. package/dist/nexus/query.js +6 -2
  133. package/dist/nexus/query.js.map +1 -1
  134. package/dist/nexus/registry.d.ts.map +1 -1
  135. package/dist/nexus/registry.js +65 -30
  136. package/dist/nexus/registry.js.map +1 -1
  137. package/dist/nexus/route-analysis.d.ts +3 -2
  138. package/dist/nexus/route-analysis.d.ts.map +1 -1
  139. package/dist/nexus/route-analysis.js +11 -10
  140. package/dist/nexus/route-analysis.js.map +1 -1
  141. package/dist/nexus/sigil.d.ts.map +1 -1
  142. package/dist/nexus/sigil.js +60 -13
  143. package/dist/nexus/sigil.js.map +1 -1
  144. package/dist/nexus/user-profile.d.ts +2 -1
  145. package/dist/nexus/user-profile.d.ts.map +1 -1
  146. package/dist/nexus/user-profile.js +8 -4
  147. package/dist/nexus/user-profile.js.map +1 -1
  148. package/dist/orchestrate/index.d.ts +1 -1
  149. package/dist/orchestrate/index.d.ts.map +1 -1
  150. package/dist/orchestrate/index.js +1 -1
  151. package/dist/orchestrate/index.js.map +1 -1
  152. package/dist/orchestrate/plan.d.ts +3 -3
  153. package/dist/orchestrate/plan.d.ts.map +1 -1
  154. package/dist/orchestrate/plan.js +7 -7
  155. package/dist/orchestrate/plan.js.map +1 -1
  156. package/dist/orchestrate/spawn-ops.js +2 -2
  157. package/dist/orchestrate/spawn-ops.js.map +1 -1
  158. package/dist/orchestration/classify.d.ts +2 -2
  159. package/dist/orchestration/classify.js +3 -3
  160. package/dist/orchestration/classify.js.map +1 -1
  161. package/dist/orchestration/validate-spawn.d.ts.map +1 -1
  162. package/dist/orchestration/validate-spawn.js +5 -5
  163. package/dist/orchestration/validate-spawn.js.map +1 -1
  164. package/dist/paths-export.d.ts +18 -0
  165. package/dist/paths-export.d.ts.map +1 -0
  166. package/dist/paths-export.js +18 -0
  167. package/dist/paths-export.js.map +1 -0
  168. package/dist/paths.d.ts.map +1 -1
  169. package/dist/paths.js +24 -11
  170. package/dist/paths.js.map +1 -1
  171. package/dist/playbooks/index.d.ts +1 -0
  172. package/dist/playbooks/index.d.ts.map +1 -1
  173. package/dist/playbooks/index.js +4 -0
  174. package/dist/playbooks/index.js.map +1 -1
  175. package/dist/playbooks/skill-node-executor.d.ts +155 -0
  176. package/dist/playbooks/skill-node-executor.d.ts.map +1 -0
  177. package/dist/playbooks/skill-node-executor.js +156 -0
  178. package/dist/playbooks/skill-node-executor.js.map +1 -0
  179. package/dist/repair.d.ts +3 -7
  180. package/dist/repair.d.ts.map +1 -1
  181. package/dist/repair.js +5 -43
  182. package/dist/repair.js.map +1 -1
  183. package/dist/sagas/migrate-containment.js +7 -7
  184. package/dist/sagas/migrate-containment.js.map +1 -1
  185. package/dist/scaffold/ensure-dirs.d.ts +8 -2
  186. package/dist/scaffold/ensure-dirs.d.ts.map +1 -1
  187. package/dist/scaffold/ensure-dirs.js +24 -11
  188. package/dist/scaffold/ensure-dirs.js.map +1 -1
  189. package/dist/scaffold/project-detection.d.ts +5 -1
  190. package/dist/scaffold/project-detection.d.ts.map +1 -1
  191. package/dist/scaffold/project-detection.js +9 -5
  192. package/dist/scaffold/project-detection.js.map +1 -1
  193. package/dist/sentient/hygiene-scan.js +6 -6
  194. package/dist/sentient/hygiene-scan.js.map +1 -1
  195. package/dist/sentient/proposal-dedup.js +2 -2
  196. package/dist/sentient/proposal-rate-limiter.js +1 -1
  197. package/dist/sentient/propose-tick.js +5 -5
  198. package/dist/sentient/propose-tick.js.map +1 -1
  199. package/dist/sentient/stage-drift-tick.js +3 -3
  200. package/dist/sentient/stage-drift-tick.js.map +1 -1
  201. package/dist/sequence/index.d.ts.map +1 -1
  202. package/dist/sequence/index.js +6 -2
  203. package/dist/sequence/index.js.map +1 -1
  204. package/dist/setup/sections/verification.js +2 -2
  205. package/dist/setup/sections/verification.js.map +1 -1
  206. package/dist/shutdown.d.ts +81 -0
  207. package/dist/shutdown.d.ts.map +1 -0
  208. package/dist/shutdown.js +105 -0
  209. package/dist/shutdown.js.map +1 -0
  210. package/dist/skills/index.d.ts +2 -0
  211. package/dist/skills/index.d.ts.map +1 -1
  212. package/dist/skills/index.js +1 -0
  213. package/dist/skills/index.js.map +1 -1
  214. package/dist/skills/skill-executor-adapter.d.ts +136 -0
  215. package/dist/skills/skill-executor-adapter.d.ts.map +1 -0
  216. package/dist/skills/skill-executor-adapter.js +137 -0
  217. package/dist/skills/skill-executor-adapter.js.map +1 -0
  218. package/dist/skills/usage-recorder.d.ts.map +1 -1
  219. package/dist/skills/usage-recorder.js +30 -0
  220. package/dist/skills/usage-recorder.js.map +1 -1
  221. package/dist/skills-export.d.ts +23 -0
  222. package/dist/skills-export.d.ts.map +1 -0
  223. package/dist/skills-export.js +23 -0
  224. package/dist/skills-export.js.map +1 -0
  225. package/dist/stats/index.d.ts.map +1 -1
  226. package/dist/stats/index.js +8 -3
  227. package/dist/stats/index.js.map +1 -1
  228. package/dist/store/agent-doctor.d.ts +3 -3
  229. package/dist/store/agent-doctor.d.ts.map +1 -1
  230. package/dist/store/agent-doctor.js +18 -13
  231. package/dist/store/agent-doctor.js.map +1 -1
  232. package/dist/store/agent-install.d.ts +6 -5
  233. package/dist/store/agent-install.d.ts.map +1 -1
  234. package/dist/store/agent-install.js +20 -16
  235. package/dist/store/agent-install.js.map +1 -1
  236. package/dist/store/agent-registry-accessor.d.ts +66 -28
  237. package/dist/store/agent-registry-accessor.d.ts.map +1 -1
  238. package/dist/store/agent-registry-accessor.js +248 -167
  239. package/dist/store/agent-registry-accessor.js.map +1 -1
  240. package/dist/store/agent-registry-store.d.ts +242 -0
  241. package/dist/store/agent-registry-store.d.ts.map +1 -0
  242. package/dist/store/agent-registry-store.js +501 -0
  243. package/dist/store/agent-registry-store.js.map +1 -0
  244. package/dist/store/agent-resolver.d.ts +8 -8
  245. package/dist/store/agent-resolver.d.ts.map +1 -1
  246. package/dist/store/agent-resolver.js +19 -17
  247. package/dist/store/agent-resolver.js.map +1 -1
  248. package/dist/store/backup-pack.d.ts.map +1 -1
  249. package/dist/store/backup-pack.js +24 -8
  250. package/dist/store/backup-pack.js.map +1 -1
  251. package/dist/store/conduit-sqlite.d.ts +181 -74
  252. package/dist/store/conduit-sqlite.d.ts.map +1 -1
  253. package/dist/store/conduit-sqlite.js +307 -528
  254. package/dist/store/conduit-sqlite.js.map +1 -1
  255. package/dist/store/cross-db-cleanup.d.ts +5 -5
  256. package/dist/store/cross-db-cleanup.d.ts.map +1 -1
  257. package/dist/store/cross-db-cleanup.js +12 -10
  258. package/dist/store/cross-db-cleanup.js.map +1 -1
  259. package/dist/store/data-accessor.d.ts +4 -4
  260. package/dist/store/data-accessor.js +5 -5
  261. package/dist/store/data-accessor.js.map +1 -1
  262. package/dist/store/data-safety-central.d.ts +83 -1
  263. package/dist/store/data-safety-central.d.ts.map +1 -1
  264. package/dist/store/data-safety-central.js +257 -0
  265. package/dist/store/data-safety-central.js.map +1 -1
  266. package/dist/store/db-helpers.d.ts +8 -2
  267. package/dist/store/db-helpers.d.ts.map +1 -1
  268. package/dist/store/db-helpers.js +6 -2
  269. package/dist/store/db-helpers.js.map +1 -1
  270. package/dist/store/dual-scope-db.d.ts +46 -4
  271. package/dist/store/dual-scope-db.d.ts.map +1 -1
  272. package/dist/store/dual-scope-db.js +103 -9
  273. package/dist/store/dual-scope-db.js.map +1 -1
  274. package/dist/store/exodus/__fixtures__/representative-fixture.d.ts +116 -0
  275. package/dist/store/exodus/__fixtures__/representative-fixture.d.ts.map +1 -0
  276. package/dist/store/exodus/__fixtures__/representative-fixture.js +274 -0
  277. package/dist/store/exodus/__fixtures__/representative-fixture.js.map +1 -0
  278. package/dist/store/exodus/index.d.ts +3 -1
  279. package/dist/store/exodus/index.d.ts.map +1 -1
  280. package/dist/store/exodus/index.js +3 -1
  281. package/dist/store/exodus/index.js.map +1 -1
  282. package/dist/store/exodus/migrate.d.ts +120 -1
  283. package/dist/store/exodus/migrate.d.ts.map +1 -1
  284. package/dist/store/exodus/migrate.js +923 -119
  285. package/dist/store/exodus/migrate.js.map +1 -1
  286. package/dist/store/exodus/on-open.d.ts +189 -0
  287. package/dist/store/exodus/on-open.d.ts.map +1 -0
  288. package/dist/store/exodus/on-open.js +464 -0
  289. package/dist/store/exodus/on-open.js.map +1 -0
  290. package/dist/store/exodus/table-name-map.d.ts +173 -0
  291. package/dist/store/exodus/table-name-map.d.ts.map +1 -0
  292. package/dist/store/exodus/table-name-map.js +660 -0
  293. package/dist/store/exodus/table-name-map.js.map +1 -0
  294. package/dist/store/exodus/verify-migration.d.ts +72 -0
  295. package/dist/store/exodus/verify-migration.d.ts.map +1 -0
  296. package/dist/store/exodus/verify-migration.js +678 -0
  297. package/dist/store/exodus/verify-migration.js.map +1 -0
  298. package/dist/store/exodus/verify.d.ts +32 -8
  299. package/dist/store/exodus/verify.d.ts.map +1 -1
  300. package/dist/store/exodus/verify.js +48 -142
  301. package/dist/store/exodus/verify.js.map +1 -1
  302. package/dist/store/index.d.ts +2 -3
  303. package/dist/store/index.d.ts.map +1 -1
  304. package/dist/store/index.js +2 -3
  305. package/dist/store/index.js.map +1 -1
  306. package/dist/store/memory-accessor.d.ts +31 -0
  307. package/dist/store/memory-accessor.d.ts.map +1 -1
  308. package/dist/store/memory-accessor.js +38 -0
  309. package/dist/store/memory-accessor.js.map +1 -1
  310. package/dist/store/memory-sqlite.d.ts +86 -13
  311. package/dist/store/memory-sqlite.d.ts.map +1 -1
  312. package/dist/store/memory-sqlite.js +326 -528
  313. package/dist/store/memory-sqlite.js.map +1 -1
  314. package/dist/store/migrate-signaldock-to-conduit.d.ts +1 -1
  315. package/dist/store/migrate-signaldock-to-conduit.d.ts.map +1 -1
  316. package/dist/store/migrate-signaldock-to-conduit.js +126 -35
  317. package/dist/store/migrate-signaldock-to-conduit.js.map +1 -1
  318. package/dist/store/migration-manager.d.ts +49 -0
  319. package/dist/store/migration-manager.d.ts.map +1 -1
  320. package/dist/store/migration-manager.js +167 -67
  321. package/dist/store/migration-manager.js.map +1 -1
  322. package/dist/store/migration-sqlite.d.ts +1 -1
  323. package/dist/store/migration-sqlite.d.ts.map +1 -1
  324. package/dist/store/migration-sqlite.js +32 -3
  325. package/dist/store/migration-sqlite.js.map +1 -1
  326. package/dist/store/nexus-sqlite.d.ts +152 -29
  327. package/dist/store/nexus-sqlite.d.ts.map +1 -1
  328. package/dist/store/nexus-sqlite.js +496 -177
  329. package/dist/store/nexus-sqlite.js.map +1 -1
  330. package/dist/store/nexus-validation-schemas.d.ts +32 -32
  331. package/dist/store/open-cleo-db.d.ts +37 -40
  332. package/dist/store/open-cleo-db.d.ts.map +1 -1
  333. package/dist/store/open-cleo-db.js +76 -153
  334. package/dist/store/open-cleo-db.js.map +1 -1
  335. package/dist/store/role-accessors-impl.d.ts +4 -4
  336. package/dist/store/role-accessors-impl.d.ts.map +1 -1
  337. package/dist/store/role-accessors-impl.js +18 -15
  338. package/dist/store/role-accessors-impl.js.map +1 -1
  339. package/dist/store/schema/{signaldock-schema.d.ts → agent-registry-schema.d.ts} +15 -5
  340. package/dist/store/schema/agent-registry-schema.d.ts.map +1 -0
  341. package/dist/store/schema/{signaldock-schema.js → agent-registry-schema.js} +15 -5
  342. package/dist/store/schema/agent-registry-schema.js.map +1 -0
  343. package/dist/store/schema/agent-schema.d.ts +1 -1
  344. package/dist/store/schema/agent-schema.js +4 -4
  345. package/dist/store/schema/agent-schema.js.map +1 -1
  346. package/dist/store/schema/attachments.d.ts +1 -1
  347. package/dist/store/schema/audit.d.ts +15 -5
  348. package/dist/store/schema/audit.d.ts.map +1 -1
  349. package/dist/store/schema/audit.js +12 -2
  350. package/dist/store/schema/audit.js.map +1 -1
  351. package/dist/store/schema/background-jobs.d.ts +1 -1
  352. package/dist/store/schema/cleo-global/{signaldock.d.ts → agent-registry.d.ts} +277 -271
  353. package/dist/store/schema/cleo-global/agent-registry.d.ts.map +1 -0
  354. package/dist/store/schema/cleo-global/{signaldock.js → agent-registry.js} +136 -125
  355. package/dist/store/schema/cleo-global/agent-registry.js.map +1 -0
  356. package/dist/store/schema/cleo-global/index.d.ts +29 -22
  357. package/dist/store/schema/cleo-global/index.d.ts.map +1 -1
  358. package/dist/store/schema/cleo-global/index.js +29 -22
  359. package/dist/store/schema/cleo-global/index.js.map +1 -1
  360. package/dist/store/schema/cleo-global/nexus.d.ts +36 -1034
  361. package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
  362. package/dist/store/schema/cleo-global/nexus.js +32 -337
  363. package/dist/store/schema/cleo-global/nexus.js.map +1 -1
  364. package/dist/store/schema/cleo-global/skills.d.ts +16 -0
  365. package/dist/store/schema/cleo-global/skills.d.ts.map +1 -1
  366. package/dist/store/schema/cleo-global/skills.js +11 -0
  367. package/dist/store/schema/cleo-global/skills.js.map +1 -1
  368. package/dist/store/schema/{cleo-project → cleo-global}/telemetry.d.ts +33 -17
  369. package/dist/store/schema/cleo-global/telemetry.d.ts.map +1 -0
  370. package/dist/store/schema/{cleo-project → cleo-global}/telemetry.js +30 -18
  371. package/dist/store/schema/cleo-global/telemetry.js.map +1 -0
  372. package/dist/store/schema/cleo-project/audit.d.ts +8 -8
  373. package/dist/store/schema/cleo-project/audit.d.ts.map +1 -1
  374. package/dist/store/schema/cleo-project/audit.js +2 -6
  375. package/dist/store/schema/cleo-project/audit.js.map +1 -1
  376. package/dist/store/schema/cleo-project/docs.d.ts +1 -1
  377. package/dist/store/schema/cleo-project/index.d.ts +29 -12
  378. package/dist/store/schema/cleo-project/index.d.ts.map +1 -1
  379. package/dist/store/schema/cleo-project/index.js +29 -12
  380. package/dist/store/schema/cleo-project/index.js.map +1 -1
  381. package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
  382. package/dist/store/schema/cleo-project/nexus-graph.d.ts +1067 -0
  383. package/dist/store/schema/cleo-project/nexus-graph.d.ts.map +1 -0
  384. package/dist/store/schema/cleo-project/nexus-graph.js +407 -0
  385. package/dist/store/schema/cleo-project/nexus-graph.js.map +1 -0
  386. package/dist/store/schema/cleo-project/provenance-orphans.d.ts +385 -0
  387. package/dist/store/schema/cleo-project/provenance-orphans.d.ts.map +1 -0
  388. package/dist/store/schema/cleo-project/provenance-orphans.js +142 -0
  389. package/dist/store/schema/cleo-project/provenance-orphans.js.map +1 -0
  390. package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
  391. package/dist/store/schema/cleo-project/runtime.d.ts +1 -1
  392. package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +1 -1
  393. package/dist/store/schema/cleo-project/tasks-core.d.ts +3 -3
  394. package/dist/store/schema/cleo-shared/brain.d.ts +711 -494
  395. package/dist/store/schema/cleo-shared/brain.d.ts.map +1 -1
  396. package/dist/store/schema/cleo-shared/brain.js +215 -134
  397. package/dist/store/schema/cleo-shared/brain.js.map +1 -1
  398. package/dist/store/schema/conduit-schema.d.ts +63 -51
  399. package/dist/store/schema/conduit-schema.d.ts.map +1 -1
  400. package/dist/store/schema/conduit-schema.js +23 -11
  401. package/dist/store/schema/conduit-schema.js.map +1 -1
  402. package/dist/store/schema/goal.d.ts +3 -2
  403. package/dist/store/schema/goal.d.ts.map +1 -1
  404. package/dist/store/schema/goal.js +3 -2
  405. package/dist/store/schema/goal.js.map +1 -1
  406. package/dist/store/schema/index.d.ts +1 -0
  407. package/dist/store/schema/index.d.ts.map +1 -1
  408. package/dist/store/schema/index.js +1 -0
  409. package/dist/store/schema/index.js.map +1 -1
  410. package/dist/store/schema/lifecycle.d.ts +2 -2
  411. package/dist/store/schema/memory-schema.d.ts +2 -2
  412. package/dist/store/schema/nexus-schema.d.ts +174 -115
  413. package/dist/store/schema/nexus-schema.d.ts.map +1 -1
  414. package/dist/store/schema/nexus-schema.js +175 -55
  415. package/dist/store/schema/nexus-schema.js.map +1 -1
  416. package/dist/store/schema/provenance/releases.d.ts +1 -1
  417. package/dist/store/schema/schema-utils.d.ts +78 -0
  418. package/dist/store/schema/schema-utils.d.ts.map +1 -0
  419. package/dist/store/schema/schema-utils.js +49 -0
  420. package/dist/store/schema/schema-utils.js.map +1 -0
  421. package/dist/store/schema/skills-schema.d.ts +81 -44
  422. package/dist/store/schema/skills-schema.d.ts.map +1 -1
  423. package/dist/store/schema/skills-schema.js +49 -16
  424. package/dist/store/schema/skills-schema.js.map +1 -1
  425. package/dist/store/schema/tasks.d.ts +3 -3
  426. package/dist/store/skills-db.d.ts +90 -50
  427. package/dist/store/skills-db.d.ts.map +1 -1
  428. package/dist/store/skills-db.js +132 -146
  429. package/dist/store/skills-db.js.map +1 -1
  430. package/dist/store/sqlite-backup.d.ts +2 -2
  431. package/dist/store/sqlite-backup.d.ts.map +1 -1
  432. package/dist/store/sqlite-backup.js +11 -10
  433. package/dist/store/sqlite-backup.js.map +1 -1
  434. package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
  435. package/dist/store/sqlite-data-accessor.js +25 -18
  436. package/dist/store/sqlite-data-accessor.js.map +1 -1
  437. package/dist/store/sqlite.d.ts +72 -12
  438. package/dist/store/sqlite.d.ts.map +1 -1
  439. package/dist/store/sqlite.js +153 -89
  440. package/dist/store/sqlite.js.map +1 -1
  441. package/dist/store/tasks-schema.d.ts +4 -0
  442. package/dist/store/tasks-schema.d.ts.map +1 -1
  443. package/dist/store/tasks-schema.js +60 -0
  444. package/dist/store/tasks-schema.js.map +1 -1
  445. package/dist/store/tasks-sqlite.d.ts +2 -2
  446. package/dist/store/tasks-sqlite.d.ts.map +1 -1
  447. package/dist/store/tasks-sqlite.js +10 -5
  448. package/dist/store/tasks-sqlite.js.map +1 -1
  449. package/dist/store/umbrella-data-accessor.d.ts +17 -6
  450. package/dist/store/umbrella-data-accessor.d.ts.map +1 -1
  451. package/dist/store/umbrella-data-accessor.js +8 -8
  452. package/dist/store/umbrella-data-accessor.js.map +1 -1
  453. package/dist/store/validation-schemas.d.ts +241 -208
  454. package/dist/store/validation-schemas.d.ts.map +1 -1
  455. package/dist/system/health.d.ts.map +1 -1
  456. package/dist/system/health.js +11 -6
  457. package/dist/system/health.js.map +1 -1
  458. package/dist/system/project-health.d.ts.map +1 -1
  459. package/dist/system/project-health.js +58 -12
  460. package/dist/system/project-health.js.map +1 -1
  461. package/dist/tasks/add.d.ts +8 -0
  462. package/dist/tasks/add.d.ts.map +1 -1
  463. package/dist/tasks/add.js +101 -0
  464. package/dist/tasks/add.js.map +1 -1
  465. package/dist/tasks/cancelled-child-waiver-audit.d.ts +47 -0
  466. package/dist/tasks/cancelled-child-waiver-audit.d.ts.map +1 -0
  467. package/dist/tasks/cancelled-child-waiver-audit.js +34 -0
  468. package/dist/tasks/cancelled-child-waiver-audit.js.map +1 -0
  469. package/dist/tasks/complete.d.ts +22 -2
  470. package/dist/tasks/complete.d.ts.map +1 -1
  471. package/dist/tasks/complete.js +71 -6
  472. package/dist/tasks/complete.js.map +1 -1
  473. package/dist/tasks/compute-task-view.js +1 -1
  474. package/dist/tasks/session-scope.d.ts +5 -0
  475. package/dist/tasks/session-scope.d.ts.map +1 -1
  476. package/dist/tasks/session-scope.js +4 -0
  477. package/dist/tasks/session-scope.js.map +1 -1
  478. package/dist/tools/guard.d.ts +71 -1
  479. package/dist/tools/guard.d.ts.map +1 -1
  480. package/dist/tools/guard.js +73 -1
  481. package/dist/tools/guard.js.map +1 -1
  482. package/dist/tools/index.d.ts +21 -0
  483. package/dist/tools/index.d.ts.map +1 -1
  484. package/dist/tools/index.js +25 -0
  485. package/dist/tools/index.js.map +1 -1
  486. package/dist/upgrade.d.ts.map +1 -1
  487. package/dist/upgrade.js +22 -13
  488. package/dist/upgrade.js.map +1 -1
  489. package/dist/workgraph/containment.js +18 -18
  490. package/dist/workgraph/relations.js +2 -2
  491. package/dist/worktree/list.d.ts +1 -1
  492. package/dist/worktree/list.d.ts.map +1 -1
  493. package/dist/worktree/list.js +19 -21
  494. package/dist/worktree/list.js.map +1 -1
  495. package/dist/worktree-export.d.ts +18 -0
  496. package/dist/worktree-export.d.ts.map +1 -0
  497. package/dist/worktree-export.js +18 -0
  498. package/dist/worktree-export.js.map +1 -0
  499. package/migrations/drizzle-agent-registry/20260412000000_initial-global-agent-registry/migration.sql +29 -0
  500. package/migrations/drizzle-brain/20260601000001_t11522-brain-task-observations/migration.sql +28 -0
  501. package/migrations/drizzle-brain/20260601000002_t11522-inline-only-brain-tables/migration.sql +75 -0
  502. package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/migration.sql +49 -144
  503. package/migrations/drizzle-cleo-global/20260531000001_t11363-consolidation-cleo-global/snapshot.json +8 -8
  504. package/migrations/drizzle-cleo-global/20260531000002_t11546-brain-usage-log/migration.sql +16 -0
  505. package/migrations/drizzle-cleo-global/20260601000001_t11544-skills-usage-project-id/migration.sql +12 -0
  506. package/migrations/drizzle-cleo-global/20260602000001_t11622-agent-registry-rename/migration.sql +80 -0
  507. package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/migration.sql +26 -167
  508. package/migrations/drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project/snapshot.json +8 -8
  509. package/migrations/drizzle-cleo-project/20260531000002_t11546-brain-usage-log/migration.sql +21 -0
  510. package/migrations/drizzle-cleo-project/20260601000001_t11549-agent-credentials-brain-release-links/migration.sql +49 -0
  511. package/migrations/drizzle-cleo-project/20260601000002_t11538-project-nexus-graph/migration.sql +140 -0
  512. package/migrations/drizzle-cleo-project/20260602000002_t11649-token-usage-transport-mcp/migration.sql +146 -0
  513. package/migrations/drizzle-conduit/20260601000003_t11523-conduit-inline-schema/migration.sql +82 -0
  514. package/migrations/drizzle-nexus/20260421200001_t1165-baseline-reset/migration.sql +26 -8
  515. package/migrations/drizzle-nexus/20260601000001_t11545-nexus-relation-weights-partition/migration.sql +97 -0
  516. package/package.json +44 -12
  517. package/scripts/install-supervisor-binary.mjs +50 -201
  518. package/scripts/napi-binary-picker.mjs +267 -0
  519. package/dist/agents/agent-registry.d.ts.map +0 -1
  520. package/dist/agents/agent-registry.js.map +0 -1
  521. package/dist/store/data-safety.d.ts +0 -92
  522. package/dist/store/data-safety.d.ts.map +0 -1
  523. package/dist/store/data-safety.js +0 -274
  524. package/dist/store/data-safety.js.map +0 -1
  525. package/dist/store/schema/cleo-global/signaldock.d.ts.map +0 -1
  526. package/dist/store/schema/cleo-global/signaldock.js.map +0 -1
  527. package/dist/store/schema/cleo-project/telemetry.d.ts.map +0 -1
  528. package/dist/store/schema/cleo-project/telemetry.js.map +0 -1
  529. package/dist/store/schema/signaldock-schema.d.ts.map +0 -1
  530. package/dist/store/schema/signaldock-schema.js.map +0 -1
  531. package/dist/store/signaldock-sqlite.d.ts +0 -173
  532. package/dist/store/signaldock-sqlite.d.ts.map +0 -1
  533. package/dist/store/signaldock-sqlite.js +0 -445
  534. package/dist/store/signaldock-sqlite.js.map +0 -1
  535. package/migrations/drizzle-nexus/20260318205558_initial/migration.sql +0 -46
  536. package/migrations/drizzle-nexus/20260412000001_t529-nexus-graph-tables/migration.sql +0 -49
  537. package/migrations/drizzle-nexus/20260415000001_t622-project-registry-paths/migration.sql +0 -12
  538. package/migrations/drizzle-nexus/20260419000001_t998-nexus-plasticity/migration.sql +0 -13
  539. package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/migration.sql +0 -16
  540. package/migrations/drizzle-nexus/20260423052640_t1077-add-user-profile-table/snapshot.json +0 -1531
  541. package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/migration.sql +0 -13
  542. package/migrations/drizzle-nexus/20260424140538_t1148-add-sigils-table/snapshot.json +0 -1652
  543. package/migrations/drizzle-nexus/20260504000001_t1839-fts5-nexus-symbols/migration.sql +0 -68
  544. package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/migration.sql +0 -20
  545. package/migrations/drizzle-nexus/20260507135519_t9163-nexus-is-external/snapshot.json +0 -1652
  546. package/migrations/drizzle-nexus/20260526222449_t11025-project-id-aliases/migration.sql +0 -16
  547. package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/migration.sql +0 -209
  548. package/migrations/drizzle-signaldock/20260412000000_initial-global-signaldock/snapshot.json +0 -2060
@@ -0,0 +1,146 @@
1
+ -- T11649 — Widen `tasks_token_usage.transport` CHECK to preserve 'mcp'.
2
+ --
3
+ -- Background:
4
+ -- The consolidation migration (20260531000001_t11363) created
5
+ -- `tasks_token_usage` with `CHECK ("transport" IN ('cli','api','agent','unknown'))`.
6
+ -- `'mcp'` was NOT in the enum, so the exodus migrate layer coerced
7
+ -- `transport = 'mcp'` → `'agent'` (T11548) to satisfy the CHECK. The full
8
+ -- cutover dry-run flagged this as a SILENT SEMANTIC ALTERATION: ~194 real
9
+ -- telemetry rows had their true origin (MCP-gateway, `source: "mcp"`) rewritten
10
+ -- to `'agent'`, with no preserving column capturing the lost value. Count was
11
+ -- preserved; integrity was not.
12
+ --
13
+ -- Owner directive (T11649): 100% data integrity. `'mcp'` is a first-class
14
+ -- transport origin, distinct from `'agent'`, and MUST be stored verbatim.
15
+ --
16
+ -- Change:
17
+ -- Old CHECK: transport IN ('cli','api','agent','unknown')
18
+ -- New CHECK: transport IN ('cli','api','agent','mcp','unknown')
19
+ --
20
+ -- The widened enum is the canonical `TOKEN_USAGE_TRANSPORTS` SSoT in
21
+ -- packages/core/src/store/schema/audit.ts. The exodus `tasks_token_usage.transport`
22
+ -- normalization rule is removed in the same change so `'mcp'` lands unmodified.
23
+ --
24
+ -- SQLite cannot ALTER a CHECK constraint in place, so this migration follows the
25
+ -- canonical "table rebuild" recipe (same pattern as drizzle-tasks T9073 / T1408):
26
+ --
27
+ -- 1. Create `__new_tasks_token_usage` with the widened CHECK (every other
28
+ -- column / default / CHECK preserved verbatim from the T11363 DDL).
29
+ -- 2. INSERT … SELECT every row (no data transformation — existing values are
30
+ -- all valid under the wider constraint).
31
+ -- 3. DROP `tasks_token_usage`; RENAME `__new_tasks_token_usage` TO it.
32
+ -- 4. Recreate all nine indexes.
33
+ --
34
+ -- This migration is purely additive at the schema level (the enum only GROWS),
35
+ -- runs AFTER the consolidation CREATE, and leaves every other table untouched.
36
+ --
37
+ -- @task T11649
38
+ -- @epic T11245
39
+ -- @saga T11242
40
+
41
+ PRAGMA foreign_keys = OFF;
42
+ --> statement-breakpoint
43
+
44
+ -- --------------------------------------------------------------------------
45
+ -- Step 1 — Drop the nine indexes attached to `tasks_token_usage`
46
+ -- (they are recreated against the rebuilt table in Step 4).
47
+ -- --------------------------------------------------------------------------
48
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_created_at`;
49
+ --> statement-breakpoint
50
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_request_id`;
51
+ --> statement-breakpoint
52
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_session_id`;
53
+ --> statement-breakpoint
54
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_task_id`;
55
+ --> statement-breakpoint
56
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_provider`;
57
+ --> statement-breakpoint
58
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_transport`;
59
+ --> statement-breakpoint
60
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_domain_operation`;
61
+ --> statement-breakpoint
62
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_method`;
63
+ --> statement-breakpoint
64
+ DROP INDEX IF EXISTS `idx_tasks_token_usage_gateway`;
65
+ --> statement-breakpoint
66
+
67
+ -- --------------------------------------------------------------------------
68
+ -- Step 2 — Create `__new_tasks_token_usage` with the widened transport CHECK.
69
+ -- All other columns / constraints / defaults are byte-identical to the
70
+ -- T11363 consolidation DDL — the only change is the transport enum.
71
+ -- --------------------------------------------------------------------------
72
+ CREATE TABLE `__new_tasks_token_usage` (
73
+ `id` text PRIMARY KEY,
74
+ `created_at` text DEFAULT (datetime('now')) NOT NULL,
75
+ `provider` text DEFAULT 'unknown' NOT NULL,
76
+ `model` text,
77
+ `transport` text DEFAULT 'unknown' NOT NULL,
78
+ `gateway` text,
79
+ `domain` text,
80
+ `operation` text,
81
+ `session_id` text,
82
+ `task_id` text,
83
+ `request_id` text,
84
+ `input_chars` integer DEFAULT 0 NOT NULL,
85
+ `output_chars` integer DEFAULT 0 NOT NULL,
86
+ `input_tokens` integer DEFAULT 0 NOT NULL,
87
+ `output_tokens` integer DEFAULT 0 NOT NULL,
88
+ `total_tokens` integer DEFAULT 0 NOT NULL,
89
+ `method` text DEFAULT 'heuristic' NOT NULL,
90
+ `confidence` text DEFAULT 'coarse' NOT NULL,
91
+ `request_hash` text,
92
+ `response_hash` text,
93
+ `metadata_json` text DEFAULT '{}' NOT NULL,
94
+ -- consolidation CHECK constraints (T11363) — transport widened to include 'mcp' (T11649)
95
+ CHECK ("created_at" IS NULL OR "created_at" GLOB '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]*'),
96
+ CHECK ("transport" IN ('cli', 'api', 'agent', 'mcp', 'unknown')),
97
+ CHECK ("method" IN ('otel', 'provider_api', 'tokenizer', 'heuristic')),
98
+ CHECK ("confidence" IN ('real', 'high', 'estimated', 'coarse'))
99
+ );
100
+ --> statement-breakpoint
101
+
102
+ -- --------------------------------------------------------------------------
103
+ -- Step 3 — Copy every row (no transformation; every value is valid under the
104
+ -- wider constraint) then swap tables.
105
+ -- --------------------------------------------------------------------------
106
+ INSERT INTO `__new_tasks_token_usage` (
107
+ `id`, `created_at`, `provider`, `model`, `transport`, `gateway`, `domain`,
108
+ `operation`, `session_id`, `task_id`, `request_id`, `input_chars`,
109
+ `output_chars`, `input_tokens`, `output_tokens`, `total_tokens`, `method`,
110
+ `confidence`, `request_hash`, `response_hash`, `metadata_json`
111
+ )
112
+ SELECT
113
+ `id`, `created_at`, `provider`, `model`, `transport`, `gateway`, `domain`,
114
+ `operation`, `session_id`, `task_id`, `request_id`, `input_chars`,
115
+ `output_chars`, `input_tokens`, `output_tokens`, `total_tokens`, `method`,
116
+ `confidence`, `request_hash`, `response_hash`, `metadata_json`
117
+ FROM `tasks_token_usage`;
118
+ --> statement-breakpoint
119
+ DROP TABLE `tasks_token_usage`;
120
+ --> statement-breakpoint
121
+ ALTER TABLE `__new_tasks_token_usage` RENAME TO `tasks_token_usage`;
122
+ --> statement-breakpoint
123
+
124
+ -- --------------------------------------------------------------------------
125
+ -- Step 4 — Recreate all nine indexes (verbatim from the T11363 DDL).
126
+ -- --------------------------------------------------------------------------
127
+ CREATE INDEX `idx_tasks_token_usage_created_at` ON `tasks_token_usage` (`created_at`);
128
+ --> statement-breakpoint
129
+ CREATE INDEX `idx_tasks_token_usage_request_id` ON `tasks_token_usage` (`request_id`);
130
+ --> statement-breakpoint
131
+ CREATE INDEX `idx_tasks_token_usage_session_id` ON `tasks_token_usage` (`session_id`);
132
+ --> statement-breakpoint
133
+ CREATE INDEX `idx_tasks_token_usage_task_id` ON `tasks_token_usage` (`task_id`);
134
+ --> statement-breakpoint
135
+ CREATE INDEX `idx_tasks_token_usage_provider` ON `tasks_token_usage` (`provider`);
136
+ --> statement-breakpoint
137
+ CREATE INDEX `idx_tasks_token_usage_transport` ON `tasks_token_usage` (`transport`);
138
+ --> statement-breakpoint
139
+ CREATE INDEX `idx_tasks_token_usage_domain_operation` ON `tasks_token_usage` (`domain`,`operation`);
140
+ --> statement-breakpoint
141
+ CREATE INDEX `idx_tasks_token_usage_method` ON `tasks_token_usage` (`method`);
142
+ --> statement-breakpoint
143
+ CREATE INDEX `idx_tasks_token_usage_gateway` ON `tasks_token_usage` (`gateway`);
144
+ --> statement-breakpoint
145
+
146
+ PRAGMA foreign_keys = ON;
@@ -0,0 +1,82 @@
1
+ -- T11523 (E6-L3) → T11578 (AC4 · COMPLETE-CUTOVER): conduit FTS5 quartet over the
2
+ -- consolidated `conduit_*` tables.
3
+ --
4
+ -- ## History
5
+ --
6
+ -- E6-L3 (T11523) routed `ensureConduitDb()` through `openDualScopeDb('project')`
7
+ -- (the consolidated `cleo.db` chokepoint, ADR-068/069) and reproduced the legacy
8
+ -- BARE-table conduit shape (`conversations`, `messages`, `delivery_jobs`, …) here
9
+ -- as a forward migration so the runtime writers kept working unchanged. The bare
10
+ -- tables co-existed (disjoint names) with the consolidated `conduit_*` tables the
11
+ -- exodus migration (T11248 / T11553) renames into.
12
+ --
13
+ -- ## AC4 cutover (T11578)
14
+ --
15
+ -- The conduit runtime READ + WRITE path now targets the PREFIXED consolidated
16
+ -- tables (`conduit_conversations`, `conduit_messages`, `conduit_topics`, …) that
17
+ -- the consolidated cleo-project migration
18
+ -- (`drizzle-cleo-project/20260531000001_t11363-consolidation-cleo-project`)
19
+ -- creates. Those 14 prefixed tables are therefore NO LONGER created here — the
20
+ -- consolidated migration owns them (single SSoT; CHECK constraints + ISO-8601
21
+ -- TEXT timestamp affinity are injected by T11363). This migration's sole
22
+ -- remaining responsibility is the FTS5 full-text index over `conduit_messages`,
23
+ -- which drizzle-orm sqlite-core cannot model (FTS5 virtual tables) and which the
24
+ -- consolidated migration therefore omits.
25
+ --
26
+ -- ## FTS5 rename: `messages_fts` → `conduit_messages_fts` (T11578 decision)
27
+ --
28
+ -- The full-text index and its three sync triggers are renamed with the `conduit_`
29
+ -- domain prefix for clarity and to stay disjoint inside the shared `cleo.db`
30
+ -- (which also holds `brain_*_fts` indexes). The index content table is
31
+ -- `conduit_messages` and `content_rowid='rowid'` is preserved. The exodus
32
+ -- migration skips `*_fts` tables (rebuilt post-migration from their content
33
+ -- table — see exodus/table-name-map.ts `isDerivedFtsTable`), so the
34
+ -- `INSERT INTO conduit_messages_fts(conduit_messages_fts) VALUES('rebuild')` seed
35
+ -- below reindexes whatever rows the consolidated migration + exodus already
36
+ -- placed in `conduit_messages`. Every statement is `IF NOT EXISTS`, so re-running
37
+ -- on a DB that already has the FTS index is idempotent.
38
+
39
+ -- -------------------------------------------------------------------------
40
+ -- FTS5 virtual table for full-text search on conduit_messages content.
41
+ -- The INSERT … VALUES('rebuild') is idempotent — safe to run on every open;
42
+ -- it (re)indexes the existing conduit_messages rows.
43
+ -- -------------------------------------------------------------------------
44
+ CREATE VIRTUAL TABLE IF NOT EXISTS conduit_messages_fts
45
+ USING fts5(content, from_agent_id, content='conduit_messages', content_rowid='rowid');
46
+ --> statement-breakpoint
47
+ INSERT INTO conduit_messages_fts(conduit_messages_fts) VALUES('rebuild');
48
+ --> statement-breakpoint
49
+ CREATE TRIGGER IF NOT EXISTS conduit_messages_ai AFTER INSERT ON conduit_messages BEGIN
50
+ INSERT INTO conduit_messages_fts(rowid, content, from_agent_id)
51
+ VALUES (new.rowid, new.content, new.from_agent_id);
52
+ END;
53
+ --> statement-breakpoint
54
+ CREATE TRIGGER IF NOT EXISTS conduit_messages_ad AFTER DELETE ON conduit_messages BEGIN
55
+ INSERT INTO conduit_messages_fts(conduit_messages_fts, rowid, content, from_agent_id)
56
+ VALUES('delete', old.rowid, old.content, old.from_agent_id);
57
+ END;
58
+ --> statement-breakpoint
59
+ CREATE TRIGGER IF NOT EXISTS conduit_messages_au AFTER UPDATE ON conduit_messages BEGIN
60
+ INSERT INTO conduit_messages_fts(conduit_messages_fts, rowid, content, from_agent_id)
61
+ VALUES('delete', old.rowid, old.content, old.from_agent_id);
62
+ INSERT INTO conduit_messages_fts(rowid, content, from_agent_id)
63
+ VALUES (new.rowid, new.content, new.from_agent_id);
64
+ END;
65
+ --> statement-breakpoint
66
+
67
+ -- -------------------------------------------------------------------------
68
+ -- Legacy meta tracking tables — retained for backwards-compatible health
69
+ -- probes (`checkConduitDbHealth` reads `_conduit_meta.schema_version`).
70
+ -- `__drizzle_migrations` is the canonical migration journal; these are kept
71
+ -- only for the pre-T1407 health-check consumers.
72
+ -- -------------------------------------------------------------------------
73
+ CREATE TABLE IF NOT EXISTS _conduit_meta (
74
+ key TEXT PRIMARY KEY,
75
+ value TEXT NOT NULL,
76
+ updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
77
+ );
78
+ --> statement-breakpoint
79
+ CREATE TABLE IF NOT EXISTS _conduit_migrations (
80
+ name TEXT PRIMARY KEY,
81
+ applied_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
82
+ );
@@ -1,8 +1,26 @@
1
- -- BASELINE MARKER — T1165 Hybrid Path A+ (ADR-054).
2
- -- Schema state for nexus captured in snapshot.json. No DDL to apply here.
3
- -- On fresh installs, the CREATE statements from the canonical tree
4
- -- (prior migrations in this folder) produce the target schema.
5
- -- On existing installs, reconcileJournal Scenario 1 will see that
6
- -- all migrations in this folder are applied and skip this baseline.
7
- -- Snapshot.json MUST be preserved — it is the anchor for drizzle-kit
8
- -- generate going forward.
1
+ -- BASELINE MARKER — T1165 Hybrid Path A+ (ADR-054) · rewritten for T11578 · AC3.
2
+ -- No DDL to apply here (comment-only marker).
3
+ --
4
+ -- ## COMPLETE-CUTOVER (T11578 · AC3)
5
+ --
6
+ -- The nexus runtime now reads + writes the PREFIXED consolidated `nexus_*`
7
+ -- tables that the consolidated cleo-global migration
8
+ -- (`drizzle-cleo-global/…t11363-consolidation-cleo-global`) creates — it OWNS
9
+ -- the 10 prefixed base tables (single SSoT). The former base-table-creating
10
+ -- migrations in THIS folder (initial / t529 graph / t622 registry-paths /
11
+ -- t998 plasticity / t1077 user_profile / t1148 sigils / t1839 fts5 / t9163
12
+ -- is_external / t11025 aliases) were REMOVED — the consolidated migration
13
+ -- supersedes them. This folder now carries ONLY the FTS5 quartet over
14
+ -- `nexus_nodes` + the plasticity-partition CREATE (the delta drizzle-orm
15
+ -- sqlite-core cannot model / the consolidated migration omits), see the
16
+ -- T11545 forward migration alongside this marker.
17
+ --
18
+ -- On existing DBs the old per-table migration hashes are removed from disk,
19
+ -- so reconcileJournal Scenario 2 (Sub-case B) treats them as true orphans,
20
+ -- deletes the orphaned journal rows, and re-probes the surviving migrations.
21
+ -- The col-drop half of the plasticity partition is handled idempotently in
22
+ -- `nexus-sqlite.ts` (`ensureNexusRelationWeights`) so a destructive ALTER never
23
+ -- sits in the journaled SQL.
24
+ --
25
+ -- Snapshot.json is retained as the drizzle-kit generate anchor; it is ignored
26
+ -- at runtime (`readMigrationFiles` reads only migration.sql bodies).
@@ -0,0 +1,97 @@
1
+ -- T11545 (ADR-090 §5.3) → T11578 (AC3 · COMPLETE-CUTOVER): nexus delta over the
2
+ -- consolidated `nexus_*` tables.
3
+ --
4
+ -- ## History
5
+ --
6
+ -- T11545 partitioned the Hebbian plasticity columns (`weight`,
7
+ -- `last_accessed_at`, `co_accessed_count`) out of `nexus_relations` into the
8
+ -- sibling 1:1 `nexus_relation_weights` table.
9
+ --
10
+ -- ## AC3 cutover (T11578)
11
+ --
12
+ -- The nexus runtime READ + WRITE path now targets the PREFIXED consolidated
13
+ -- tables (`nexus_project_registry`, `nexus_user_profile`, `nexus_sigils`,
14
+ -- `nexus_project_id_aliases`, `nexus_nodes`, `nexus_relations`, …) that the
15
+ -- consolidated cleo-global migration
16
+ -- (`drizzle-cleo-global/…t11363-consolidation-cleo-global`) creates. Those 10
17
+ -- prefixed base tables are therefore NO LONGER created here — the consolidated
18
+ -- migration owns them (single SSoT; CHECK constraints + ISO-8601 TEXT timestamp
19
+ -- affinity are injected by T11363). This migration's remaining responsibility is:
20
+ --
21
+ -- 1. the `nexus_relation_weights` sibling table (the consolidated GLOBAL
22
+ -- migration's `nexus_relations` still carries the inline plasticity columns
23
+ -- — the matching column-DROP is applied idempotently in `nexus-sqlite.ts`
24
+ -- `ensureNexusRelationWeights`, never as a non-idempotent journaled ALTER);
25
+ -- 2. the `nexus_symbols_fts` FTS5 virtual table + its three `nexus_nodes` sync
26
+ -- triggers — drizzle-orm sqlite-core cannot model FTS5, so the consolidated
27
+ -- migration omits them;
28
+ -- 3. the legacy `_nexus_meta` health-probe table — pinned as the reconcile
29
+ -- sentinel (a table THIS migration creates, NOT a consolidated-owned one) so
30
+ -- `reconcileJournal` Scenario 2 stays dormant until the nexus set is
31
+ -- journaled (mirrors the conduit `_conduit_meta` sentinel, T11578 · AC4).
32
+ --
33
+ -- Every statement is `IF NOT EXISTS` / `DROP … IF EXISTS` — idempotent across
34
+ -- repeated opens and the orphan re-probe path.
35
+
36
+ -- -------------------------------------------------------------------------
37
+ -- 1. Plasticity weights sibling (1:1 with nexus_relations.id).
38
+ -- -------------------------------------------------------------------------
39
+ CREATE TABLE IF NOT EXISTS `nexus_relation_weights` (
40
+ `relation_id` text PRIMARY KEY NOT NULL,
41
+ `weight` real DEFAULT 0.0 NOT NULL,
42
+ `last_accessed_at` text,
43
+ `co_accessed_count` integer DEFAULT 0 NOT NULL
44
+ );
45
+ --> statement-breakpoint
46
+ CREATE INDEX IF NOT EXISTS `idx_nexus_relation_weights_last_accessed` ON `nexus_relation_weights` (`last_accessed_at`);
47
+ --> statement-breakpoint
48
+ CREATE INDEX IF NOT EXISTS `idx_nexus_relation_weights_weight` ON `nexus_relation_weights` (`weight`);
49
+ --> statement-breakpoint
50
+
51
+ -- -------------------------------------------------------------------------
52
+ -- 2. FTS5 full-text index over nexus_nodes (label + file_path) + triggers.
53
+ -- The consolidated migration cannot model FTS5 virtual tables.
54
+ -- -------------------------------------------------------------------------
55
+ CREATE VIRTUAL TABLE IF NOT EXISTS nexus_symbols_fts USING fts5(
56
+ node_id UNINDEXED,
57
+ label,
58
+ file_path,
59
+ tokenize = 'unicode61 remove_diacritics 1'
60
+ );
61
+ --> statement-breakpoint
62
+ DROP TRIGGER IF EXISTS nexus_nodes_fts_ai;
63
+ --> statement-breakpoint
64
+ CREATE TRIGGER nexus_nodes_fts_ai
65
+ AFTER INSERT ON nexus_nodes
66
+ BEGIN
67
+ INSERT INTO nexus_symbols_fts(rowid, node_id, label, file_path)
68
+ VALUES (new.rowid, new.id, new.label, new.file_path);
69
+ END;
70
+ --> statement-breakpoint
71
+ DROP TRIGGER IF EXISTS nexus_nodes_fts_ad;
72
+ --> statement-breakpoint
73
+ CREATE TRIGGER nexus_nodes_fts_ad
74
+ AFTER DELETE ON nexus_nodes
75
+ BEGIN
76
+ DELETE FROM nexus_symbols_fts WHERE rowid = old.rowid;
77
+ END;
78
+ --> statement-breakpoint
79
+ DROP TRIGGER IF EXISTS nexus_nodes_fts_au;
80
+ --> statement-breakpoint
81
+ CREATE TRIGGER nexus_nodes_fts_au
82
+ AFTER UPDATE ON nexus_nodes
83
+ BEGIN
84
+ DELETE FROM nexus_symbols_fts WHERE rowid = old.rowid;
85
+ INSERT INTO nexus_symbols_fts(rowid, node_id, label, file_path)
86
+ VALUES (new.rowid, new.id, new.label, new.file_path);
87
+ END;
88
+ --> statement-breakpoint
89
+
90
+ -- -------------------------------------------------------------------------
91
+ -- 3. Legacy meta health-probe table + reconcile sentinel (T11578 · AC3).
92
+ -- -------------------------------------------------------------------------
93
+ CREATE TABLE IF NOT EXISTS _nexus_meta (
94
+ key TEXT PRIMARY KEY,
95
+ value TEXT NOT NULL,
96
+ updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now'))
97
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/core",
3
- "version": "2026.5.134",
3
+ "version": "2026.6.0",
4
4
  "description": "CLEO core business logic kernel — tasks, sessions, memory, orchestration, lifecycle, with bundled SQLite store",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -360,6 +360,36 @@
360
360
  "types": "./dist/llm/*.d.ts",
361
361
  "import": "./dist/llm/*.js",
362
362
  "require": "./dist/llm/*.js"
363
+ },
364
+ "./paths": {
365
+ "types": "./dist/paths-export.d.ts",
366
+ "import": "./dist/paths-export.js",
367
+ "require": "./dist/paths-export.js"
368
+ },
369
+ "./lafs": {
370
+ "types": "./dist/lafs-export.d.ts",
371
+ "import": "./dist/lafs-export.js",
372
+ "require": "./dist/lafs-export.js"
373
+ },
374
+ "./skills-lib": {
375
+ "types": "./dist/skills-export.d.ts",
376
+ "import": "./dist/skills-export.js",
377
+ "require": "./dist/skills-export.js"
378
+ },
379
+ "./caamp": {
380
+ "types": "./dist/caamp-export.d.ts",
381
+ "import": "./dist/caamp-export.js",
382
+ "require": "./dist/caamp-export.js"
383
+ },
384
+ "./worktree": {
385
+ "types": "./dist/worktree-export.d.ts",
386
+ "import": "./dist/worktree-export.js",
387
+ "require": "./dist/worktree-export.js"
388
+ },
389
+ "./git-shim": {
390
+ "types": "./dist/git-shim-export.d.ts",
391
+ "import": "./dist/git-shim-export.js",
392
+ "require": "./dist/git-shim-export.js"
363
393
  }
364
394
  },
365
395
  "dependencies": {
@@ -399,16 +429,17 @@
399
429
  "write-file-atomic": "^7.0.1",
400
430
  "yaml": "^2.8.3",
401
431
  "zod": "^4.3.6",
402
- "@cleocode/adapters": "2026.5.134",
403
- "@cleocode/agents": "2026.5.134",
404
- "@cleocode/lafs": "2026.5.134",
405
- "@cleocode/caamp": "2026.5.134",
406
- "@cleocode/contracts": "2026.5.134",
407
- "@cleocode/nexus": "2026.5.134",
408
- "@cleocode/paths": "2026.5.134",
409
- "@cleocode/skills": "2026.5.134",
410
- "@cleocode/worktree": "2026.5.134",
411
- "@cleocode/utils": "2026.5.122"
432
+ "@cleocode/adapters": "2026.6.0",
433
+ "@cleocode/agents": "2026.6.0",
434
+ "@cleocode/contracts": "2026.6.0",
435
+ "@cleocode/git-shim": "2026.6.0",
436
+ "@cleocode/caamp": "2026.6.0",
437
+ "@cleocode/lafs": "2026.6.0",
438
+ "@cleocode/paths": "2026.6.0",
439
+ "@cleocode/nexus": "2026.6.0",
440
+ "@cleocode/skills": "2026.6.0",
441
+ "@cleocode/utils": "2026.5.122",
442
+ "@cleocode/worktree": "2026.6.0"
412
443
  },
413
444
  "engines": {
414
445
  "node": ">=24.16.0"
@@ -424,6 +455,7 @@
424
455
  "templates",
425
456
  "binaries",
426
457
  "scripts/install-supervisor-binary.mjs",
458
+ "scripts/napi-binary-picker.mjs",
427
459
  "README.md",
428
460
  "STABILITY.md"
429
461
  ],
@@ -440,7 +472,7 @@
440
472
  },
441
473
  "optionalDependencies": {
442
474
  "llmtxt": "^2026.5.15",
443
- "@cleocode/studio": "^2026.5.134"
475
+ "@cleocode/studio": "^2026.6.0"
444
476
  },
445
477
  "scripts": {
446
478
  "build": "tsc",