@jamesaphoenix/tx-core 0.4.2 → 0.4.4

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 (336) hide show
  1. package/README.md +480 -0
  2. package/dist/db.d.ts +28 -14
  3. package/dist/db.d.ts.map +1 -1
  4. package/dist/db.js +108 -14
  5. package/dist/db.js.map +1 -1
  6. package/dist/errors.d.ts +178 -34
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +119 -26
  9. package/dist/errors.js.map +1 -1
  10. package/dist/id.d.ts +10 -0
  11. package/dist/id.d.ts.map +1 -1
  12. package/dist/id.js +17 -1
  13. package/dist/id.js.map +1 -1
  14. package/dist/index.d.ts +15 -7
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +62 -8
  17. package/dist/index.js.map +1 -1
  18. package/dist/layer.d.ts +23 -14
  19. package/dist/layer.d.ts.map +1 -1
  20. package/dist/layer.js +75 -76
  21. package/dist/layer.js.map +1 -1
  22. package/dist/mappers/attempt.d.ts +3 -1
  23. package/dist/mappers/attempt.d.ts.map +1 -1
  24. package/dist/mappers/attempt.js +23 -9
  25. package/dist/mappers/attempt.js.map +1 -1
  26. package/dist/mappers/claim.d.ts +1 -1
  27. package/dist/mappers/claim.d.ts.map +1 -1
  28. package/dist/mappers/claim.js +11 -4
  29. package/dist/mappers/claim.js.map +1 -1
  30. package/dist/mappers/deduplication.d.ts +13 -1
  31. package/dist/mappers/deduplication.d.ts.map +1 -1
  32. package/dist/mappers/deduplication.js +22 -3
  33. package/dist/mappers/deduplication.js.map +1 -1
  34. package/dist/mappers/doc.d.ts +24 -0
  35. package/dist/mappers/doc.d.ts.map +1 -0
  36. package/dist/mappers/doc.js +161 -0
  37. package/dist/mappers/doc.js.map +1 -0
  38. package/dist/mappers/file-learning.d.ts.map +1 -1
  39. package/dist/mappers/file-learning.js +2 -1
  40. package/dist/mappers/file-learning.js.map +1 -1
  41. package/dist/mappers/index.d.ts +6 -7
  42. package/dist/mappers/index.d.ts.map +1 -1
  43. package/dist/mappers/index.js +10 -12
  44. package/dist/mappers/index.js.map +1 -1
  45. package/dist/mappers/learning.d.ts +9 -1
  46. package/dist/mappers/learning.d.ts.map +1 -1
  47. package/dist/mappers/learning.js +94 -14
  48. package/dist/mappers/learning.js.map +1 -1
  49. package/dist/mappers/orchestrator-state.d.ts +1 -1
  50. package/dist/mappers/orchestrator-state.d.ts.map +1 -1
  51. package/dist/mappers/orchestrator-state.js +31 -5
  52. package/dist/mappers/orchestrator-state.js.map +1 -1
  53. package/dist/mappers/parse-date.d.ts +11 -0
  54. package/dist/mappers/parse-date.d.ts.map +1 -0
  55. package/dist/mappers/parse-date.js +18 -0
  56. package/dist/mappers/parse-date.js.map +1 -0
  57. package/dist/mappers/run.d.ts +14 -4
  58. package/dist/mappers/run.d.ts.map +1 -1
  59. package/dist/mappers/run.js +49 -18
  60. package/dist/mappers/run.js.map +1 -1
  61. package/dist/mappers/task.d.ts +5 -1
  62. package/dist/mappers/task.d.ts.map +1 -1
  63. package/dist/mappers/task.js +66 -16
  64. package/dist/mappers/task.js.map +1 -1
  65. package/dist/mappers/tracked-project.d.ts +3 -1
  66. package/dist/mappers/tracked-project.d.ts.map +1 -1
  67. package/dist/mappers/tracked-project.js +23 -9
  68. package/dist/mappers/tracked-project.js.map +1 -1
  69. package/dist/mappers/worker.d.ts +1 -1
  70. package/dist/mappers/worker.d.ts.map +1 -1
  71. package/dist/mappers/worker.js +44 -6
  72. package/dist/mappers/worker.js.map +1 -1
  73. package/dist/repo/attempt-repo.d.ts +2 -2
  74. package/dist/repo/attempt-repo.d.ts.map +1 -1
  75. package/dist/repo/attempt-repo.js +16 -6
  76. package/dist/repo/attempt-repo.js.map +1 -1
  77. package/dist/repo/claim-repo.d.ts +46 -2
  78. package/dist/repo/claim-repo.d.ts.map +1 -1
  79. package/dist/repo/claim-repo.js +113 -6
  80. package/dist/repo/claim-repo.js.map +1 -1
  81. package/dist/repo/deduplication-repo.d.ts +9 -1
  82. package/dist/repo/deduplication-repo.d.ts.map +1 -1
  83. package/dist/repo/deduplication-repo.js +46 -9
  84. package/dist/repo/deduplication-repo.js.map +1 -1
  85. package/dist/repo/dep-repo.d.ts +27 -3
  86. package/dist/repo/dep-repo.d.ts.map +1 -1
  87. package/dist/repo/dep-repo.js +166 -39
  88. package/dist/repo/dep-repo.js.map +1 -1
  89. package/dist/repo/doc-repo.d.ts +59 -0
  90. package/dist/repo/doc-repo.d.ts.map +1 -0
  91. package/dist/repo/doc-repo.js +276 -0
  92. package/dist/repo/doc-repo.js.map +1 -0
  93. package/dist/repo/file-learning-repo.d.ts +3 -3
  94. package/dist/repo/file-learning-repo.d.ts.map +1 -1
  95. package/dist/repo/file-learning-repo.js +19 -8
  96. package/dist/repo/file-learning-repo.js.map +1 -1
  97. package/dist/repo/index.d.ts +4 -6
  98. package/dist/repo/index.d.ts.map +1 -1
  99. package/dist/repo/index.js +3 -5
  100. package/dist/repo/index.js.map +1 -1
  101. package/dist/repo/learning-repo.d.ts +10 -3
  102. package/dist/repo/learning-repo.d.ts.map +1 -1
  103. package/dist/repo/learning-repo.js +68 -11
  104. package/dist/repo/learning-repo.js.map +1 -1
  105. package/dist/repo/orchestrator-state-repo.d.ts.map +1 -1
  106. package/dist/repo/orchestrator-state-repo.js +8 -1
  107. package/dist/repo/orchestrator-state-repo.js.map +1 -1
  108. package/dist/repo/run-repo.d.ts +3 -3
  109. package/dist/repo/run-repo.d.ts.map +1 -1
  110. package/dist/repo/run-repo.js +40 -19
  111. package/dist/repo/run-repo.js.map +1 -1
  112. package/dist/repo/task-repo.d.ts +14 -3
  113. package/dist/repo/task-repo.d.ts.map +1 -1
  114. package/dist/repo/task-repo.js +194 -20
  115. package/dist/repo/task-repo.js.map +1 -1
  116. package/dist/repo/tracked-project-repo.d.ts.map +1 -1
  117. package/dist/repo/tracked-project-repo.js +15 -1
  118. package/dist/repo/tracked-project-repo.js.map +1 -1
  119. package/dist/repo/worker-repo.d.ts +3 -2
  120. package/dist/repo/worker-repo.d.ts.map +1 -1
  121. package/dist/repo/worker-repo.js +54 -8
  122. package/dist/repo/worker-repo.js.map +1 -1
  123. package/dist/schemas/sync.js +2 -2
  124. package/dist/schemas/sync.js.map +1 -1
  125. package/dist/schemas/worker.d.ts +1 -0
  126. package/dist/schemas/worker.d.ts.map +1 -1
  127. package/dist/schemas/worker.js +1 -0
  128. package/dist/schemas/worker.js.map +1 -1
  129. package/dist/services/agent-service.d.ts +57 -0
  130. package/dist/services/agent-service.d.ts.map +1 -0
  131. package/dist/services/agent-service.js +81 -0
  132. package/dist/services/agent-service.js.map +1 -0
  133. package/dist/services/attempt-service.d.ts.map +1 -1
  134. package/dist/services/attempt-service.js +1 -4
  135. package/dist/services/attempt-service.js.map +1 -1
  136. package/dist/services/auto-sync-service.d.ts.map +1 -1
  137. package/dist/services/auto-sync-service.js +18 -10
  138. package/dist/services/auto-sync-service.js.map +1 -1
  139. package/dist/services/claim-service.d.ts +8 -2
  140. package/dist/services/claim-service.d.ts.map +1 -1
  141. package/dist/services/claim-service.js +37 -23
  142. package/dist/services/claim-service.js.map +1 -1
  143. package/dist/services/cycle-scan-service.d.ts +32 -0
  144. package/dist/services/cycle-scan-service.d.ts.map +1 -0
  145. package/dist/services/cycle-scan-service.js +546 -0
  146. package/dist/services/cycle-scan-service.js.map +1 -0
  147. package/dist/services/daemon-service.d.ts +40 -2
  148. package/dist/services/daemon-service.d.ts.map +1 -1
  149. package/dist/services/daemon-service.js +199 -52
  150. package/dist/services/daemon-service.js.map +1 -1
  151. package/dist/services/deduplication-service.d.ts +8 -4
  152. package/dist/services/deduplication-service.d.ts.map +1 -1
  153. package/dist/services/deduplication-service.js +79 -25
  154. package/dist/services/deduplication-service.js.map +1 -1
  155. package/dist/services/dep-service.d.ts +2 -2
  156. package/dist/services/dep-service.d.ts.map +1 -1
  157. package/dist/services/dep-service.js +9 -5
  158. package/dist/services/dep-service.js.map +1 -1
  159. package/dist/services/diversifier-service.d.ts +2 -1
  160. package/dist/services/diversifier-service.d.ts.map +1 -1
  161. package/dist/services/diversifier-service.js +37 -43
  162. package/dist/services/diversifier-service.js.map +1 -1
  163. package/dist/services/doc-service.d.ts +49 -0
  164. package/dist/services/doc-service.d.ts.map +1 -0
  165. package/dist/services/doc-service.js +605 -0
  166. package/dist/services/doc-service.js.map +1 -0
  167. package/dist/services/embedding-service.d.ts +66 -2
  168. package/dist/services/embedding-service.d.ts.map +1 -1
  169. package/dist/services/embedding-service.js +138 -24
  170. package/dist/services/embedding-service.js.map +1 -1
  171. package/dist/services/file-learning-service.d.ts.map +1 -1
  172. package/dist/services/file-learning-service.js +8 -7
  173. package/dist/services/file-learning-service.js.map +1 -1
  174. package/dist/services/file-watcher-service.d.ts.map +1 -1
  175. package/dist/services/file-watcher-service.js +58 -11
  176. package/dist/services/file-watcher-service.js.map +1 -1
  177. package/dist/services/hierarchy-service.d.ts +1 -1
  178. package/dist/services/hierarchy-service.d.ts.map +1 -1
  179. package/dist/services/hierarchy-service.js +50 -32
  180. package/dist/services/hierarchy-service.js.map +1 -1
  181. package/dist/services/index.d.ts +13 -15
  182. package/dist/services/index.d.ts.map +1 -1
  183. package/dist/services/index.js +13 -15
  184. package/dist/services/index.js.map +1 -1
  185. package/dist/services/learning-service.d.ts +3 -3
  186. package/dist/services/learning-service.d.ts.map +1 -1
  187. package/dist/services/learning-service.js +75 -42
  188. package/dist/services/learning-service.js.map +1 -1
  189. package/dist/services/llm-service.d.ts +62 -0
  190. package/dist/services/llm-service.d.ts.map +1 -0
  191. package/dist/services/llm-service.js +172 -0
  192. package/dist/services/llm-service.js.map +1 -0
  193. package/dist/services/migration-service.d.ts +1 -1
  194. package/dist/services/migration-service.d.ts.map +1 -1
  195. package/dist/services/migration-service.js +18 -7
  196. package/dist/services/migration-service.js.map +1 -1
  197. package/dist/services/orchestrator-service.d.ts +4 -3
  198. package/dist/services/orchestrator-service.d.ts.map +1 -1
  199. package/dist/services/orchestrator-service.js +66 -27
  200. package/dist/services/orchestrator-service.js.map +1 -1
  201. package/dist/services/query-expansion-service.d.ts +30 -9
  202. package/dist/services/query-expansion-service.d.ts.map +1 -1
  203. package/dist/services/query-expansion-service.js +54 -63
  204. package/dist/services/query-expansion-service.js.map +1 -1
  205. package/dist/services/ready-service.d.ts +21 -1
  206. package/dist/services/ready-service.d.ts.map +1 -1
  207. package/dist/services/ready-service.js +44 -21
  208. package/dist/services/ready-service.js.map +1 -1
  209. package/dist/services/retriever-service.d.ts +10 -10
  210. package/dist/services/retriever-service.d.ts.map +1 -1
  211. package/dist/services/retriever-service.js +53 -161
  212. package/dist/services/retriever-service.js.map +1 -1
  213. package/dist/services/sync-service.d.ts +17 -4
  214. package/dist/services/sync-service.d.ts.map +1 -1
  215. package/dist/services/sync-service.js +381 -116
  216. package/dist/services/sync-service.js.map +1 -1
  217. package/dist/services/task-service.d.ts +6 -4
  218. package/dist/services/task-service.d.ts.map +1 -1
  219. package/dist/services/task-service.js +165 -35
  220. package/dist/services/task-service.js.map +1 -1
  221. package/dist/services/tracing-service.d.ts +55 -0
  222. package/dist/services/tracing-service.d.ts.map +1 -0
  223. package/dist/services/tracing-service.js +99 -0
  224. package/dist/services/tracing-service.js.map +1 -0
  225. package/dist/services/transcript-adapter.d.ts +99 -0
  226. package/dist/services/transcript-adapter.d.ts.map +1 -0
  227. package/dist/services/transcript-adapter.js +283 -0
  228. package/dist/services/transcript-adapter.js.map +1 -0
  229. package/dist/services/validation-service.d.ts +85 -0
  230. package/dist/services/validation-service.d.ts.map +1 -0
  231. package/dist/services/validation-service.js +289 -0
  232. package/dist/services/validation-service.js.map +1 -0
  233. package/dist/services/worker-process.d.ts +23 -4
  234. package/dist/services/worker-process.d.ts.map +1 -1
  235. package/dist/services/worker-process.js +168 -72
  236. package/dist/services/worker-process.js.map +1 -1
  237. package/dist/services/worker-service.d.ts.map +1 -1
  238. package/dist/services/worker-service.js +7 -12
  239. package/dist/services/worker-service.js.map +1 -1
  240. package/dist/sync/claude-task-writer.d.ts +49 -0
  241. package/dist/sync/claude-task-writer.d.ts.map +1 -0
  242. package/dist/sync/claude-task-writer.js +135 -0
  243. package/dist/sync/claude-task-writer.js.map +1 -0
  244. package/dist/utils/doc-hash.d.ts +10 -0
  245. package/dist/utils/doc-hash.d.ts.map +1 -0
  246. package/dist/utils/doc-hash.js +14 -0
  247. package/dist/utils/doc-hash.js.map +1 -0
  248. package/dist/utils/doc-renderer.d.ts +44 -0
  249. package/dist/utils/doc-renderer.d.ts.map +1 -0
  250. package/dist/utils/doc-renderer.js +202 -0
  251. package/dist/utils/doc-renderer.js.map +1 -0
  252. package/dist/utils/math.d.ts +5 -1
  253. package/dist/utils/math.d.ts.map +1 -1
  254. package/dist/utils/math.js +12 -4
  255. package/dist/utils/math.js.map +1 -1
  256. package/dist/utils/sql.d.ts +9 -0
  257. package/dist/utils/sql.d.ts.map +1 -0
  258. package/dist/utils/sql.js +9 -0
  259. package/dist/utils/sql.js.map +1 -0
  260. package/dist/utils/toml-config.d.ts +22 -0
  261. package/dist/utils/toml-config.d.ts.map +1 -0
  262. package/dist/utils/toml-config.js +75 -0
  263. package/dist/utils/toml-config.js.map +1 -0
  264. package/dist/worker/hooks.d.ts +102 -0
  265. package/dist/worker/hooks.d.ts.map +1 -0
  266. package/dist/worker/hooks.js +11 -0
  267. package/dist/worker/hooks.js.map +1 -0
  268. package/dist/worker/index.d.ts +9 -0
  269. package/dist/worker/index.d.ts.map +1 -0
  270. package/dist/worker/index.js +8 -0
  271. package/dist/worker/index.js.map +1 -0
  272. package/dist/worker/run-worker.d.ts +33 -0
  273. package/dist/worker/run-worker.d.ts.map +1 -0
  274. package/dist/worker/run-worker.js +265 -0
  275. package/dist/worker/run-worker.js.map +1 -0
  276. package/package.json +14 -12
  277. package/dist/mappers/anchor.d.ts +0 -14
  278. package/dist/mappers/anchor.d.ts.map +0 -1
  279. package/dist/mappers/anchor.js +0 -38
  280. package/dist/mappers/anchor.js.map +0 -1
  281. package/dist/mappers/candidate.d.ts +0 -23
  282. package/dist/mappers/candidate.d.ts.map +0 -1
  283. package/dist/mappers/candidate.js +0 -53
  284. package/dist/mappers/candidate.js.map +0 -1
  285. package/dist/mappers/edge.d.ts +0 -10
  286. package/dist/mappers/edge.d.ts.map +0 -1
  287. package/dist/mappers/edge.js +0 -19
  288. package/dist/mappers/edge.js.map +0 -1
  289. package/dist/repo/anchor-repo.d.ts +0 -52
  290. package/dist/repo/anchor-repo.d.ts.map +0 -1
  291. package/dist/repo/anchor-repo.js +0 -204
  292. package/dist/repo/anchor-repo.js.map +0 -1
  293. package/dist/repo/candidate-repo.d.ts +0 -16
  294. package/dist/repo/candidate-repo.d.ts.map +0 -1
  295. package/dist/repo/candidate-repo.js +0 -143
  296. package/dist/repo/candidate-repo.js.map +0 -1
  297. package/dist/repo/edge-repo.d.ts +0 -26
  298. package/dist/repo/edge-repo.d.ts.map +0 -1
  299. package/dist/repo/edge-repo.js +0 -227
  300. package/dist/repo/edge-repo.js.map +0 -1
  301. package/dist/services/anchor-service.d.ts +0 -147
  302. package/dist/services/anchor-service.d.ts.map +0 -1
  303. package/dist/services/anchor-service.js +0 -540
  304. package/dist/services/anchor-service.js.map +0 -1
  305. package/dist/services/anchor-verification.d.ts +0 -94
  306. package/dist/services/anchor-verification.d.ts.map +0 -1
  307. package/dist/services/anchor-verification.js +0 -617
  308. package/dist/services/anchor-verification.js.map +0 -1
  309. package/dist/services/ast-grep-service.d.ts +0 -58
  310. package/dist/services/ast-grep-service.d.ts.map +0 -1
  311. package/dist/services/ast-grep-service.js +0 -356
  312. package/dist/services/ast-grep-service.js.map +0 -1
  313. package/dist/services/candidate-extractor-service.d.ts +0 -56
  314. package/dist/services/candidate-extractor-service.d.ts.map +0 -1
  315. package/dist/services/candidate-extractor-service.js +0 -365
  316. package/dist/services/candidate-extractor-service.js.map +0 -1
  317. package/dist/services/edge-service.d.ts +0 -78
  318. package/dist/services/edge-service.d.ts.map +0 -1
  319. package/dist/services/edge-service.js +0 -158
  320. package/dist/services/edge-service.js.map +0 -1
  321. package/dist/services/feedback-tracker.d.ts +0 -64
  322. package/dist/services/feedback-tracker.d.ts.map +0 -1
  323. package/dist/services/feedback-tracker.js +0 -110
  324. package/dist/services/feedback-tracker.js.map +0 -1
  325. package/dist/services/graph-expansion.d.ts +0 -155
  326. package/dist/services/graph-expansion.d.ts.map +0 -1
  327. package/dist/services/graph-expansion.js +0 -466
  328. package/dist/services/graph-expansion.js.map +0 -1
  329. package/dist/services/promotion-service.d.ts +0 -67
  330. package/dist/services/promotion-service.d.ts.map +0 -1
  331. package/dist/services/promotion-service.js +0 -151
  332. package/dist/services/promotion-service.js.map +0 -1
  333. package/dist/services/swarm-verification.d.ts +0 -104
  334. package/dist/services/swarm-verification.d.ts.map +0 -1
  335. package/dist/services/swarm-verification.js +0 -400
  336. package/dist/services/swarm-verification.js.map +0 -1
package/dist/layer.d.ts CHANGED
@@ -5,31 +5,40 @@
5
5
  * See DD-002 for full specification.
6
6
  */
7
7
  import { Layer } from "effect";
8
+ import { type SqliteClient } from "./db.js";
8
9
  export { SyncService } from "./services/sync-service.js";
9
10
  export { MigrationService } from "./services/migration-service.js";
10
11
  export { AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive } from "./services/auto-sync-service.js";
11
12
  export { LearningService } from "./services/learning-service.js";
12
13
  export { FileLearningService } from "./services/file-learning-service.js";
13
14
  export { EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer, type EmbedderConfig } from "./services/embedding-service.js";
14
- export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError, type QueryExpansionResult } from "./services/query-expansion-service.js";
15
15
  export { AttemptService } from "./services/attempt-service.js";
16
16
  export { TaskService } from "./services/task-service.js";
17
17
  export { DependencyService } from "./services/dep-service.js";
18
- export { ReadyService } from "./services/ready-service.js";
18
+ export { ReadyService, type ReadyCheckResult, isReadyResult } from "./services/ready-service.js";
19
19
  export { HierarchyService } from "./services/hierarchy-service.js";
20
20
  export { ScoreService } from "./services/score-service.js";
21
- export { RunRepository } from "./repo/run-repo.js";
22
21
  export { RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto, type RerankerResult } from "./services/reranker-service.js";
23
- export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
24
22
  export { RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto } from "./services/retriever-service.js";
25
- export { GraphExpansionService, GraphExpansionServiceNoop, GraphExpansionServiceLive, type SeedLearning, type ExpandedLearning, type GraphExpansionOptions, type GraphExpansionResult } from "./services/graph-expansion.js";
26
- export { AnchorVerificationService, AnchorVerificationServiceLive, type VerificationResult, type VerificationSummary, type VerifyOptions } from "./services/anchor-verification.js";
27
- export { SwarmVerificationService, SwarmVerificationServiceLive, calculateMajorityVote, type VerificationBatch, type BatchResult, type SwarmMetrics, type SwarmVerificationResult, type SwarmVerifyOptions, type VoteResult } from "./services/swarm-verification.js";
28
- export { PromotionService, PromotionServiceLive, type PromotionResult, type AutoPromoteResult } from "./services/promotion-service.js";
29
- export { FeedbackTrackerService, FeedbackTrackerServiceNoop, FeedbackTrackerServiceLive, type LearningUsageFeedback } from "./services/feedback-tracker.js";
30
- export { CandidateRepository, CandidateRepositoryLive } from "./repo/candidate-repo.js";
31
- export { TrackedProjectRepository, TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
32
- export { DaemonService, DaemonServiceLive, DaemonServiceNoop, type DaemonStatus } from "./services/daemon-service.js";
23
+ export { DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto } from "./services/diversifier-service.js";
24
+ export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError, type QueryExpansionResult } from "./services/query-expansion-service.js";
25
+ export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
26
+ export { LlmService, LlmServiceNoop, LlmServiceClaudeAgentSdk, LlmServiceAnthropicSdk, LlmServiceAuto, type LlmOptions } from "./services/llm-service.js";
27
+ export { RunRepository } from "./repo/run-repo.js";
28
+ export { DocService } from "./services/doc-service.js";
29
+ export { AgentService, AgentServiceNoop } from "./services/agent-service.js";
30
+ export { CycleScanService } from "./services/cycle-scan-service.js";
31
+ /**
32
+ * Create the full application layer from an existing SqliteClient infra layer.
33
+ *
34
+ * Use this when you already have a SqliteClient layer (e.g., from Layer.succeed
35
+ * with a pre-created database instance). This is useful for test utilities that
36
+ * need to share a single database across test runs while getting fresh service
37
+ * instances via Layer.fresh.
38
+ *
39
+ * @param infra A layer providing SqliteClient
40
+ */
41
+ export declare const makeAppLayerFromInfra: <E>(infra: Layer.Layer<SqliteClient, E>) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./services/deduplication-service.js").DeduplicationService | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/doc-repo.js").DocRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/sync-service.js").SyncService | import("./services/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/tracing-service.js").TracingService | import("./services/validation-service.js").ValidationService | import("./services/llm-service.js").LlmService | import("./services/doc-service.js").DocService | import("./services/agent-service.js").AgentService | import("./services/cycle-scan-service.js").CycleScanService, import("./errors.js").DatabaseError | import("./errors.js").LlmUnavailableError | import("./errors.js").AgentError | E, never>;
33
42
  /**
34
43
  * Create the full application layer with all services.
35
44
  *
@@ -39,12 +48,12 @@ export { DaemonService, DaemonServiceLive, DaemonServiceNoop, type DaemonStatus
39
48
  *
40
49
  * @param dbPath Path to SQLite database file
41
50
  */
42
- export declare const makeAppLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/anchor-repo.js").AnchorRepository | import("./repo/edge-repo.js").EdgeRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./repo/candidate-repo.js").CandidateRepository | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/edge-service.js").EdgeService | import("./services/graph-expansion.js").GraphExpansionService | import("./services/feedback-tracker.js").FeedbackTrackerService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/anchor-verification.js").AnchorVerificationService | import("./services/anchor-service.js").AnchorService | import("./services/deduplication-service.js").DeduplicationService | import("./services/sync-service.js").SyncService | import("./services/swarm-verification.js").SwarmVerificationService | import("./services/promotion-service.js").PromotionService | import("./services/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/daemon-service.js").DaemonService, import("./errors.js").DatabaseError, never>;
51
+ export declare const makeAppLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | SqliteClient | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/worker-repo.js").WorkerRepository | import("./repo/claim-repo.js").ClaimRepository | import("./repo/orchestrator-state-repo.js").OrchestratorStateRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./services/deduplication-service.js").DeduplicationService | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./repo/doc-repo.js").DocRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/sync-service.js").SyncService | import("./services/worker-service.js").WorkerService | import("./services/claim-service.js").ClaimService | import("./services/orchestrator-service.js").OrchestratorService | import("./services/tracing-service.js").TracingService | import("./services/validation-service.js").ValidationService | import("./services/llm-service.js").LlmService | import("./services/doc-service.js").DocService | import("./services/agent-service.js").AgentService | import("./services/cycle-scan-service.js").CycleScanService, import("./errors.js").DatabaseError | import("./errors.js").LlmUnavailableError | import("./errors.js").AgentError, never>;
43
52
  /**
44
53
  * Create a minimal application layer without auto-sync.
45
54
  * Useful for testing and simple CLI operations.
46
55
  *
47
56
  * @param dbPath Path to SQLite database file
48
57
  */
49
- export declare const makeMinimalLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./repo/anchor-repo.js").AnchorRepository | import("./repo/edge-repo.js").EdgeRepository | import("./repo/deduplication-repo.js").DeduplicationRepository | import("./repo/candidate-repo.js").CandidateRepository | import("./repo/tracked-project-repo.js").TrackedProjectRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/edge-service.js").EdgeService | import("./services/graph-expansion.js").GraphExpansionService | import("./services/feedback-tracker.js").FeedbackTrackerService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/anchor-verification.js").AnchorVerificationService | import("./services/anchor-service.js").AnchorService | import("./services/deduplication-service.js").DeduplicationService | import("./services/sync-service.js").SyncService | import("./services/swarm-verification.js").SwarmVerificationService | import("./services/promotion-service.js").PromotionService | import("./services/daemon-service.js").DaemonService, import("./errors.js").DatabaseError, never>;
58
+ export declare const makeMinimalLayer: (dbPath: string) => Layer.Layer<import("./services/migration-service.js").MigrationService | import("./repo/task-repo.js").TaskRepository | import("./repo/dep-repo.js").DependencyRepository | import("./repo/learning-repo.js").LearningRepository | import("./repo/file-learning-repo.js").FileLearningRepository | import("./repo/attempt-repo.js").AttemptRepository | import("./repo/run-repo.js").RunRepository | import("./services/task-service.js").TaskService | import("./services/dep-service.js").DependencyService | import("./services/ready-service.js").ReadyService | import("./services/hierarchy-service.js").HierarchyService | import("./services/diversifier-service.js").DiversifierService | import("./services/retriever-service.js").RetrieverService | import("./services/learning-service.js").LearningService | import("./services/file-learning-service.js").FileLearningService | import("./services/attempt-service.js").AttemptService | import("./services/sync-service.js").SyncService | import("./services/tracing-service.js").TracingService | import("./services/validation-service.js").ValidationService | import("./services/llm-service.js").LlmService, import("./errors.js").DatabaseError, never>;
50
59
  //# sourceM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,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAC9B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AACpG,OAAO,EACL,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,sBAAsB,EACtB,cAAc,EACd,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,EAAE,OAAO,KAAK,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,6/DA+F3E,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,y/DAE1C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,mqCAyD9C,CAAA"}
package/dist/layer.js CHANGED
@@ -12,14 +12,13 @@ import { LearningRepositoryLive } from "./repo/learning-repo.js";
12
12
  import { FileLearningRepositoryLive } from "./repo/file-learning-repo.js";
13
13
  import { AttemptRepositoryLive } from "./repo/attempt-repo.js";
14
14
  import { RunRepositoryLive } from "./repo/run-repo.js";
15
- import { AnchorRepositoryLive } from "./repo/anchor-repo.js";
16
- import { EdgeRepositoryLive } from "./repo/edge-repo.js";
17
- import { DeduplicationRepositoryLive } from "./repo/deduplication-repo.js";
18
- import { CandidateRepositoryLive } from "./repo/candidate-repo.js";
19
- import { TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
20
15
  import { WorkerRepositoryLive } from "./repo/worker-repo.js";
21
16
  import { ClaimRepositoryLive } from "./repo/claim-repo.js";
22
17
  import { OrchestratorStateRepositoryLive } from "./repo/orchestrator-state-repo.js";
18
+ import { DeduplicationRepositoryLive } from "./repo/deduplication-repo.js";
19
+ import { DeduplicationServiceLive } from "./services/deduplication-service.js";
20
+ import { TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
21
+ import { DocRepositoryLive } from "./repo/doc-repo.js";
23
22
  import { TaskServiceLive } from "./services/task-service.js";
24
23
  import { DependencyServiceLive } from "./services/dep-service.js";
25
24
  import { ReadyServiceLive } from "./services/ready-service.js";
@@ -27,25 +26,22 @@ import { HierarchyServiceLive } from "./services/hierarchy-service.js";
27
26
  import { LearningServiceLive } from "./services/learning-service.js";
28
27
  import { FileLearningServiceLive } from "./services/file-learning-service.js";
29
28
  import { AttemptServiceLive } from "./services/attempt-service.js";
30
- import { AnchorServiceLive } from "./services/anchor-service.js";
31
- import { EdgeServiceLive } from "./services/edge-service.js";
32
- import { DeduplicationServiceLive } from "./services/deduplication-service.js";
33
29
  import { SyncServiceLive } from "./services/sync-service.js";
34
30
  import { AutoSyncServiceLive, AutoSyncServiceNoop } from "./services/auto-sync-service.js";
35
31
  import { MigrationServiceLive } from "./services/migration-service.js";
36
32
  import { EmbeddingServiceNoop } from "./services/embedding-service.js";
37
- import { QueryExpansionServiceNoop } from "./services/query-expansion-service.js";
38
33
  import { RerankerServiceNoop } from "./services/reranker-service.js";
39
34
  import { RetrieverServiceLive } from "./services/retriever-service.js";
40
- import { GraphExpansionServiceLive } from "./services/graph-expansion.js";
41
- import { AnchorVerificationServiceLive } from "./services/anchor-verification.js";
42
- import { SwarmVerificationServiceLive } from "./services/swarm-verification.js";
43
- import { PromotionServiceLive } from "./services/promotion-service.js";
44
- import { FeedbackTrackerServiceLive } from "./services/feedback-tracker.js";
35
+ import { DiversifierServiceLive } from "./services/diversifier-service.js";
45
36
  import { WorkerServiceLive } from "./services/worker-service.js";
46
37
  import { ClaimServiceLive } from "./services/claim-service.js";
47
38
  import { OrchestratorServiceLive } from "./services/orchestrator-service.js";
48
- import { DaemonServiceLive, DaemonServiceNoop } from "./services/daemon-service.js";
39
+ import { TracingServiceLive, TracingServiceNoop } from "./services/tracing-service.js";
40
+ import { ValidationServiceLive } from "./services/validation-service.js";
41
+ import { LlmServiceClaudeAgentSdk, LlmServiceNoop } from "./services/llm-service.js";
42
+ import { DocServiceLive } from "./services/doc-service.js";
43
+ import { AgentServiceLive } from "./services/agent-service.js";
44
+ import { CycleScanServiceLive } from "./services/cycle-scan-service.js";
49
45
  // Re-export services for cleaner imports
50
46
  export { SyncService } from "./services/sync-service.js";
51
47
  export { MigrationService } from "./services/migration-service.js";
@@ -53,70 +49,81 @@ export { AutoSyncService, AutoSyncServiceNoop, AutoSyncServiceLive } from "./ser
53
49
  export { LearningService } from "./services/learning-service.js";
54
50
  export { FileLearningService } from "./services/file-learning-service.js";
55
51
  export { EmbeddingService, EmbeddingServiceNoop, EmbeddingServiceLive, EmbeddingServiceOpenAI, EmbeddingServiceAuto, createEmbedderLayer } from "./services/embedding-service.js";
56
- export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError } from "./services/query-expansion-service.js";
57
52
  export { AttemptService } from "./services/attempt-service.js";
58
53
  export { TaskService } from "./services/task-service.js";
59
54
  export { DependencyService } from "./services/dep-service.js";
60
- export { ReadyService } from "./services/ready-service.js";
55
+ export { ReadyService, isReadyResult } from "./services/ready-service.js";
61
56
  export { HierarchyService } from "./services/hierarchy-service.js";
62
57
  export { ScoreService } from "./services/score-service.js";
63
- export { RunRepository } from "./repo/run-repo.js";
64
58
  export { RerankerService, RerankerServiceNoop, RerankerServiceLive, RerankerServiceAuto } from "./services/reranker-service.js";
65
- export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
66
59
  export { RetrieverService, RetrieverServiceNoop, RetrieverServiceLive, RetrieverServiceAuto } from "./services/retriever-service.js";
67
- export { GraphExpansionService, GraphExpansionServiceNoop, GraphExpansionServiceLive } from "./services/graph-expansion.js";
68
- export { AnchorVerificationService, AnchorVerificationServiceLive } from "./services/anchor-verification.js";
69
- export { SwarmVerificationService, SwarmVerificationServiceLive, calculateMajorityVote } from "./services/swarm-verification.js";
70
- export { PromotionService, PromotionServiceLive } from "./services/promotion-service.js";
71
- export { FeedbackTrackerService, FeedbackTrackerServiceNoop, FeedbackTrackerServiceLive } from "./services/feedback-tracker.js";
72
- export { CandidateRepository, CandidateRepositoryLive } from "./repo/candidate-repo.js";
73
- export { TrackedProjectRepository, TrackedProjectRepositoryLive } from "./repo/tracked-project-repo.js";
74
- export { DaemonService, DaemonServiceLive, DaemonServiceNoop } from "./services/daemon-service.js";
60
+ export { DiversifierService, DiversifierServiceNoop, DiversifierServiceLive, DiversifierServiceAuto } from "./services/diversifier-service.js";
61
+ export { QueryExpansionService, QueryExpansionServiceNoop, QueryExpansionServiceLive, QueryExpansionServiceAuto, QueryExpansionUnavailableError } from "./services/query-expansion-service.js";
62
+ export { DeduplicationService, DeduplicationServiceLive } from "./services/deduplication-service.js";
63
+ export { LlmService, LlmServiceNoop, LlmServiceClaudeAgentSdk, LlmServiceAnthropicSdk, LlmServiceAuto } from "./services/llm-service.js";
64
+ export { RunRepository } from "./repo/run-repo.js";
65
+ export { DocService } from "./services/doc-service.js";
66
+ export { AgentService, AgentServiceNoop } from "./services/agent-service.js";
67
+ export { CycleScanService } from "./services/cycle-scan-service.js";
75
68
  /**
76
- * Create the full application layer with all services.
69
+ * Create the full application layer from an existing SqliteClient infra layer.
77
70
  *
78
- * This is the standard entry point for CLI, MCP, and SDK consumers.
79
- * Provides: TaskService, DependencyService, ReadyService, HierarchyService,
80
- * LearningService, FileLearningService, AttemptService, SyncService, MigrationService
71
+ * Use this when you already have a SqliteClient layer (e.g., from Layer.succeed
72
+ * with a pre-created database instance). This is useful for test utilities that
73
+ * need to share a single database across test runs while getting fresh service
74
+ * instances via Layer.fresh.
81
75
  *
82
- * @param dbPath Path to SQLite database file
76
+ * @param infra A layer providing SqliteClient
83
77
  */
84
- export const makeAppLayer = (dbPath) => {
85
- const infra = SqliteClientLive(dbPath);
86
- const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, AnchorRepositoryLive, EdgeRepositoryLive, DeduplicationRepositoryLive, CandidateRepositoryLive, TrackedProjectRepositoryLive, WorkerRepositoryLive, ClaimRepositoryLive, OrchestratorStateRepositoryLive).pipe(Layer.provide(infra));
78
+ export const makeAppLayerFromInfra = (infra) => {
79
+ const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, WorkerRepositoryLive, ClaimRepositoryLive, OrchestratorStateRepositoryLive, DeduplicationRepositoryLive, TrackedProjectRepositoryLive, DocRepositoryLive).pipe(Layer.provide(infra));
87
80
  // SyncServiceLive needs TaskService, repos, and infra
88
81
  const syncServiceWithDeps = SyncServiceLive.pipe(Layer.provide(Layer.mergeAll(infra, repos, TaskServiceLive.pipe(Layer.provide(repos)))));
89
82
  // AutoSyncServiceLive needs SyncService and infra
90
83
  const autoSyncService = AutoSyncServiceLive.pipe(Layer.provide(Layer.merge(infra, syncServiceWithDeps)));
91
- // EdgeServiceLive needs EdgeRepository from repos
92
- const edgeService = EdgeServiceLive.pipe(Layer.provide(repos));
93
- // FeedbackTrackerServiceLive needs EdgeService (created early for RetrieverService optional dependency)
94
- const feedbackTrackerService = FeedbackTrackerServiceLive.pipe(Layer.provide(edgeService));
95
- // GraphExpansionServiceLive needs EdgeService, LearningRepository, and AnchorRepository
96
- const graphExpansionService = GraphExpansionServiceLive.pipe(Layer.provide(Layer.merge(repos, edgeService)));
97
- // RetrieverServiceLive needs repos, embedding, query expansion, reranker, graph expansion, and optionally feedback tracker
98
- const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, graphExpansionService, feedbackTrackerService)));
99
- // Services need repos, embedding, query expansion, reranker, retriever, and autoSyncService
100
- const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive, AnchorServiceLive, DeduplicationServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, retrieverService, autoSyncService)));
101
- // AnchorVerificationServiceLive needs AnchorRepository from repos
102
- const anchorVerificationService = AnchorVerificationServiceLive.pipe(Layer.provide(repos));
103
- // SwarmVerificationServiceLive needs AnchorVerificationService and AnchorRepository
104
- const swarmVerificationService = SwarmVerificationServiceLive.pipe(Layer.provide(Layer.merge(repos, anchorVerificationService)));
105
- // PromotionServiceLive needs CandidateRepository, LearningService, and EdgeService
106
- const promotionService = PromotionServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, edgeService)));
84
+ // RetrieverServiceLive needs repos, embedding, reranker, diversifier
85
+ const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, DiversifierServiceLive)));
86
+ // Services need repos, embedding, reranker, retriever, and autoSyncService
87
+ const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, retrieverService, autoSyncService)));
107
88
  // WorkerServiceLive needs WorkerRepository and OrchestratorStateRepository (from repos)
108
89
  const workerService = WorkerServiceLive.pipe(Layer.provide(repos));
109
90
  // ClaimServiceLive needs ClaimRepository and OrchestratorStateRepository (from repos)
110
91
  const claimService = ClaimServiceLive.pipe(Layer.provide(repos));
111
- // OrchestratorServiceLive needs WorkerService, ClaimService, TaskService, and OrchestratorStateRepository
112
- const orchestratorService = OrchestratorServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, workerService, claimService)));
113
- // Merge all services including edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, orchestration services, and daemon service
114
- const allServices = Layer.mergeAll(services, edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, workerService, claimService, orchestratorService, DaemonServiceLive);
92
+ // OrchestratorServiceLive needs WorkerService, ClaimService, TaskService, OrchestratorStateRepository, and SqliteClient
93
+ const orchestratorService = OrchestratorServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, workerService, claimService, infra)));
94
+ // TracingServiceLive needs SqliteClient
95
+ const tracingService = TracingServiceLive.pipe(Layer.provide(infra));
96
+ // ValidationServiceLive needs SqliteClient
97
+ const validationService = ValidationServiceLive.pipe(Layer.provide(infra));
98
+ // DeduplicationServiceLive needs DeduplicationRepository (from repos)
99
+ const deduplicationService = DeduplicationServiceLive.pipe(Layer.provide(repos));
100
+ // DocServiceLive needs DocRepository (from repos)
101
+ const docService = DocServiceLive.pipe(Layer.provide(repos));
102
+ // LlmServiceClaudeAgentSdk is the default — uses Claude Code subscription (DD-022)
103
+ const llmService = LlmServiceClaudeAgentSdk;
104
+ // AgentServiceLive — wraps Claude Agent SDK for sub-agent dispatch (cycle scan)
105
+ const agentService = AgentServiceLive;
106
+ // CycleScanServiceLive needs AgentService + SqliteClient
107
+ const cycleScanService = CycleScanServiceLive.pipe(Layer.provide(Layer.mergeAll(agentService, infra)));
108
+ // Merge all services
109
+ const allServices = Layer.mergeAll(services, retrieverService, DiversifierServiceLive, workerService, claimService, orchestratorService, tracingService, validationService, llmService, deduplicationService, docService, agentService, cycleScanService);
115
110
  // MigrationService only needs SqliteClient
116
111
  const migrationService = MigrationServiceLive.pipe(Layer.provide(infra));
117
112
  // Also expose RunRepository directly for run tracking
118
- // (Note: Consider creating RunService in future refactor)
119
- return Layer.mergeAll(allServices, syncServiceWithDeps, migrationService, repos);
113
+ // Also expose SqliteClient directly for direct database access (e.g., trace commands)
114
+ return Layer.mergeAll(allServices, syncServiceWithDeps, migrationService, repos, infra);
115
+ };
116
+ /**
117
+ * Create the full application layer with all services.
118
+ *
119
+ * This is the standard entry point for CLI, MCP, and SDK consumers.
120
+ * Provides: TaskService, DependencyService, ReadyService, HierarchyService,
121
+ * LearningService, FileLearningService, AttemptService, SyncService, MigrationService
122
+ *
123
+ * @param dbPath Path to SQLite database file
124
+ */
125
+ export const makeAppLayer = (dbPath) => {
126
+ return makeAppLayerFromInfra(SqliteClientLive(dbPath));
120
127
  };
121
128
  /**
122
129
  * Create a minimal application layer without auto-sync.
@@ -126,25 +133,17 @@ export const makeAppLayer = (dbPath) => {
126
133
  */
127
134
  export const makeMinimalLayer = (dbPath) => {
128
135
  const infra = SqliteClientLive(dbPath);
129
- const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive, AnchorRepositoryLive, EdgeRepositoryLive, DeduplicationRepositoryLive, CandidateRepositoryLive, TrackedProjectRepositoryLive).pipe(Layer.provide(infra));
130
- // EdgeServiceLive needs EdgeRepository from repos
131
- const edgeService = EdgeServiceLive.pipe(Layer.provide(repos));
132
- // FeedbackTrackerServiceLive needs EdgeService (created early for RetrieverService optional dependency)
133
- const feedbackTrackerService = FeedbackTrackerServiceLive.pipe(Layer.provide(edgeService));
134
- // GraphExpansionServiceLive needs EdgeService, LearningRepository, and AnchorRepository
135
- const graphExpansionService = GraphExpansionServiceLive.pipe(Layer.provide(Layer.merge(repos, edgeService)));
136
- // RetrieverServiceLive needs repos, embedding, query expansion, reranker, graph expansion, and optionally feedback tracker
137
- const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, graphExpansionService, feedbackTrackerService)));
138
- // Services with Noop embedding, query expansion, reranker, retriever, and auto-sync
139
- const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive, AnchorServiceLive, DeduplicationServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, QueryExpansionServiceNoop, RerankerServiceNoop, retrieverService, AutoSyncServiceNoop)));
140
- // AnchorVerificationServiceLive needs AnchorRepository from repos
141
- const anchorVerificationService = AnchorVerificationServiceLive.pipe(Layer.provide(repos));
142
- // SwarmVerificationServiceLive needs AnchorVerificationService and AnchorRepository
143
- const swarmVerificationService = SwarmVerificationServiceLive.pipe(Layer.provide(Layer.merge(repos, anchorVerificationService)));
144
- // PromotionServiceLive needs CandidateRepository, LearningService, and EdgeService
145
- const promotionService = PromotionServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, services, edgeService)));
146
- // Merge all services including edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, and daemon service (noop for minimal layer)
147
- const allServices = Layer.mergeAll(services, edgeService, graphExpansionService, anchorVerificationService, swarmVerificationService, promotionService, feedbackTrackerService, retrieverService, DaemonServiceNoop);
136
+ const repos = Layer.mergeAll(TaskRepositoryLive, DependencyRepositoryLive, LearningRepositoryLive, FileLearningRepositoryLive, AttemptRepositoryLive, RunRepositoryLive).pipe(Layer.provide(infra));
137
+ // RetrieverServiceLive needs repos, embedding, reranker, diversifier
138
+ const retrieverService = RetrieverServiceLive.pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, DiversifierServiceLive)));
139
+ // Services with Noop embedding, reranker, retriever, and auto-sync
140
+ const services = Layer.mergeAll(TaskServiceLive, DependencyServiceLive, ReadyServiceLive, HierarchyServiceLive, LearningServiceLive, FileLearningServiceLive, AttemptServiceLive).pipe(Layer.provide(Layer.mergeAll(repos, EmbeddingServiceNoop, RerankerServiceNoop, retrieverService, AutoSyncServiceNoop)));
141
+ // ValidationServiceLive needs SqliteClient
142
+ const validationService = ValidationServiceLive.pipe(Layer.provide(infra));
143
+ // LlmServiceNoop for minimal layer no LLM needed for core commands (DD-022)
144
+ const llmService = LlmServiceNoop;
145
+ // Merge all services
146
+ const allServices = Layer.mergeAll(services, retrieverService, DiversifierServiceLive, TracingServiceNoop, validationService, llmService);
148
147
  // MigrationService only needs SqliteClient
149
148
  const migrationService = MigrationServiceLive.pipe(Layer.provide(infra));
150
149
  // SyncService for manual exports
package/dist/layer.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"layer.js","sourceRoot":"","sources":["../src/layer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE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;IAED,sDAAsD;IACtD,OAAO,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,CAAC,CAAA;AAC1E,CAAC,CAAA"}
@@ -2,14 +2,16 @@
2
2
  * Attempt mappers - convert database rows to domain objects
3
3
  */
4
4
  import type { Attempt, AttemptOutcome, AttemptRow } from "@jamesaphoenix/tx-types";
5
+ import { ATTEMPT_OUTCOMES } from "@jamesaphoenix/tx-types";
5
6
  export type { AttemptRow } from "@jamesaphoenix/tx-types";
6
- export { ATTEMPT_OUTCOMES } from "@jamesaphoenix/tx-types";
7
+ export { ATTEMPT_OUTCOMES };
7
8
  /**
8
9
  * Check if a string is a valid AttemptOutcome.
9
10
  */
10
11
  export declare const isValidOutcome: (s: string) => s is AttemptOutcome;
11
12
  /**
12
13
  * Convert a database row to an Attempt domain object.
14
+ * Validates outcome and TaskId fields at runtime.
13
15
  */
14
16
  export declare const rowToAttempt: (row: AttemptRow) => Attempt;
15
17
  //# sourceMappingURL=attempt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,OAAO,EAEP,cAAc,EACd,UAAU,EAEX,MAAM,yBAAyB,CAAA;AAGhC,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE1D;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,cAG/C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,UAAU,KAAG,OAO7C,CAAA"}
1
+ {"version":3,"file":"attempt.d.ts","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,UAAU,EACX,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAgB,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAKxE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAE3B;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,cAG/C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,UAAU,KAAG,OAiB9C,CAAA"}
@@ -1,7 +1,10 @@
1
1
  /**
2
2
  * Attempt mappers - convert database rows to domain objects
3
3
  */
4
- export { ATTEMPT_OUTCOMES } from "@jamesaphoenix/tx-types";
4
+ import { assertTaskId, ATTEMPT_OUTCOMES } from "@jamesaphoenix/tx-types";
5
+ import { InvalidStatusError } from "../errors.js";
6
+ import { parseDate } from "./parse-date.js";
7
+ export { ATTEMPT_OUTCOMES };
5
8
  /**
6
9
  * Check if a string is a valid AttemptOutcome.
7
10
  */
@@ -11,13 +14,24 @@ export const isValidOutcome = (s) => {
11
14
  };
12
15
  /**
13
16
  * Convert a database row to an Attempt domain object.
17
+ * Validates outcome and TaskId fields at runtime.
14
18
  */
15
- export const rowToAttempt = (row) => ({
16
- id: row.id,
17
- taskId: row.task_id,
18
- approach: row.approach,
19
- outcome: row.outcome,
20
- reason: row.reason,
21
- createdAt: new Date(row.created_at)
22
- });
19
+ export const rowToAttempt = (row) => {
20
+ if (!isValidOutcome(row.outcome)) {
21
+ throw new InvalidStatusError({
22
+ entity: "attempt",
23
+ status: row.outcome,
24
+ validStatuses: ATTEMPT_OUTCOMES,
25
+ rowId: row.id
26
+ });
27
+ }
28
+ return {
29
+ id: row.id,
30
+ taskId: assertTaskId(row.task_id),
31
+ approach: row.approach,
32
+ outcome: row.outcome,
33
+ reason: row.reason,
34
+ createdAt: parseDate(row.created_at, "created_at", row.id)
35
+ };
36
+ };
23
37
  //# sourceMappingURL=attempt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"attempt.js","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAS,EAAuB,EAAE;IAC/D,MAAM,QAAQ,GAAsB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;IAC3D,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAe,EAAW,EAAE,CAAC,CAAC;IACzD,EAAE,EAAE,GAAG,CAAC,EAAe;IACvB,MAAM,EAAE,GAAG,CAAC,OAAiB;IAC7B,QAAQ,EAAE,GAAG,CAAC,QAAQ;IACtB,OAAO,EAAE,GAAG,CAAC,OAAyB;IACtC,MAAM,EAAE,GAAG,CAAC,MAAM;IAClB,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;CACpC,CAAC,CAAA"}
1
+ {"version":3,"file":"attempt.js","sourceRoot":"","sources":["../../src/mappers/attempt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3C,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAS,EAAuB,EAAE;IAC/D,MAAM,QAAQ,GAAsB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;IAC3D,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAe,EAAW,EAAE;IACvD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,kBAAkB,CAAC;YAC3B,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,GAAG,CAAC,OAAO;YACnB,aAAa,EAAE,gBAAgB;YAC/B,KAAK,EAAE,GAAG,CAAC,EAAE;SACd,CAAC,CAAA;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAmB;QAC3B,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;QACjC,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,CAAC;KAC3D,CAAA;AACH,CAAC,CAAA"}
@@ -24,7 +24,7 @@ export declare const CLAIM_STATUSES: readonly ["active", "released", "expired",
24
24
  export declare const isValidClaimStatus: (s: string) => s is ClaimStatus;
25
25
  /**
26
26
  * Convert a database row to a TaskClaim domain object.
27
- * Throws if status is invalid.
27
+ * Throws InvalidStatusError if status is invalid.
28
28
  */
29
29
  export declare const rowToClaim: (row: ClaimRow) => TaskClaim;
30
30
  //# sourceMappingURL=claim.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/mappers/claim.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,yDAA0D,CAAA;AAErF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,WAEnD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,QAAQ,KAAG,SAa1C,CAAA"}
1
+ {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/mappers/claim.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,yDAA0D,CAAA;AAErF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,KAAG,CAAC,IAAI,WAEnD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,QAAQ,KAAG,SAkB1C,CAAA"}
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Claim mappers - convert database rows to domain objects
3
3
  */
4
+ import { InvalidStatusError } from "../errors.js";
5
+ import { parseDate } from "./parse-date.js";
4
6
  /**
5
7
  * Valid claim statuses.
6
8
  */
@@ -13,18 +15,23 @@ export const isValidClaimStatus = (s) => {
13
15
  };
14
16
  /**
15
17
  * Convert a database row to a TaskClaim domain object.
16
- * Throws if status is invalid.
18
+ * Throws InvalidStatusError if status is invalid.
17
19
  */
18
20
  export const rowToClaim = (row) => {
19
21
  if (!isValidClaimStatus(row.status)) {
20
- throw new Error(`Invalid claim status: ${row.status}`);
22
+ throw new InvalidStatusError({
23
+ entity: "claim",
24
+ status: row.status,
25
+ validStatuses: CLAIM_STATUSES,
26
+ rowId: row.id
27
+ });
21
28
  }
22
29
  return {
23
30
  id: row.id,
24
31
  taskId: row.task_id,
25
32
  workerId: row.worker_id,
26
- claimedAt: new Date(row.claimed_at),
27
- leaseExpiresAt: new Date(row.lease_expires_at),
33
+ claimedAt: parseDate(row.claimed_at, "claimed_at", row.id),
34
+ leaseExpiresAt: parseDate(row.lease_expires_at, "lease_expires_at", row.id),
28
35
  renewedCount: row.renewed_count,
29
36
  status: row.status
30
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/mappers/claim.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAU,CAAA;AAErF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAS,EAAoB,EAAE;IAChE,OAAQ,cAAoC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;AAC1D,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAa,EAAa,EAAE;IACrD,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAA;IACxD,CAAC;IACD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,QAAQ,EAAE,GAAG,CAAC,SAAS;QACvB,SAAS,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CA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AAC,EAAE,CAAC;QAC3E,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,MAAM,EAAE,GAAG,CAAC,MAAM;KACnB,CAAA;AACH,CAAC,CAAA"}
@@ -2,10 +2,22 @@
2
2
  * Deduplication mappers - convert database rows to domain objects
3
3
  */
4
4
  import type { ProcessedHash, ProcessedHashRow, FileProgress, FileProgressRow } from "@jamesaphoenix/tx-types";
5
+ /**
6
+ * Normalize content for deduplication comparison.
7
+ * Handles common semantic equivalences:
8
+ * - Trailing/leading whitespace
9
+ * - Line ending differences (CRLF → LF)
10
+ * - Unicode normalization (NFC canonical form)
11
+ */
12
+ export declare const normalizeContent: (content: string) => string;
5
13
  /**
6
14
  * Compute SHA256 hash of content.
15
+ * By default, hashes raw content for backward compatibility with existing data.
16
+ * Pass normalize=true to normalize (trim, CRLF→LF, NFC) before hashing,
17
+ * which catches semantic duplicates but produces different hashes for
18
+ * previously stored content.
7
19
  */
8
- export declare const hashContent: (content: string) => string;
20
+ export declare const hashContent: (content: string, normalize?: boolean) => string;
9
21
  /**
10
22
  * Convert a database row to a ProcessedHash domain object.
11
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"deduplication.d.ts","sourceRoot":"","sources":["../../src/mappers/deduplication.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAChB,MAAM,yBAAyB,CAAA;AAEhC;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,KAAG,MACM,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,gBAAgB,KAAG,aAMzD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,aAAa;;;;;;CAMxD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,eAAe,KAAG,YAQvD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,YAAY;;;;;;;;CAQ1D,CAAA"}
1
+ {"version":3,"file":"deduplication.d.ts","sourceRoot":"","sources":["../../src/mappers/deduplication.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,eAAe,EAChB,MAAM,yBAAyB,CAAA;AAGhC;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,MAI9B,CAAA;AAErB;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,mBAAiB,KAAG,MAGhE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,gBAAgB,KAAG,aAMzD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,aAAa;;;;;;CAMxD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,eAAe,KAAG,YAQvD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,YAAY;;;;;;;;CAQ1D,CAAA"}