@claudexor/daemon 3.25.1 → 4.0.1

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 (453) hide show
  1. package/dist/account-resets.d.ts +2 -2
  2. package/dist/account-resets.d.ts.map +1 -1
  3. package/dist/account-resets.js +15 -0
  4. package/dist/account-resets.js.map +1 -1
  5. package/dist/client.d.ts +25 -6
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +55 -51
  8. package/dist/client.js.map +1 -1
  9. package/dist/command-authority.d.ts +11 -8
  10. package/dist/command-authority.d.ts.map +1 -1
  11. package/dist/command-authority.js +5 -6
  12. package/dist/command-authority.js.map +1 -1
  13. package/dist/command-list-projection.d.ts +0 -1
  14. package/dist/command-list-projection.d.ts.map +1 -1
  15. package/dist/command-list-projection.js +0 -6
  16. package/dist/command-list-projection.js.map +1 -1
  17. package/dist/command-list-select.d.ts +0 -4
  18. package/dist/command-list-select.d.ts.map +1 -1
  19. package/dist/command-list-select.js +1 -115
  20. package/dist/command-list-select.js.map +1 -1
  21. package/dist/command-retention.d.ts +7 -19
  22. package/dist/command-retention.d.ts.map +1 -1
  23. package/dist/command-retention.js +1 -120
  24. package/dist/command-retention.js.map +1 -1
  25. package/dist/command-rpc.d.ts +4 -1
  26. package/dist/command-rpc.d.ts.map +1 -1
  27. package/dist/command-rpc.js +12 -1
  28. package/dist/command-rpc.js.map +1 -1
  29. package/dist/command-store.d.ts +15 -52
  30. package/dist/command-store.d.ts.map +1 -1
  31. package/dist/command-store.js +5 -493
  32. package/dist/command-store.js.map +1 -1
  33. package/dist/daemon-health.d.ts +56 -8
  34. package/dist/daemon-health.d.ts.map +1 -1
  35. package/dist/daemon-health.js +44 -9
  36. package/dist/daemon-health.js.map +1 -1
  37. package/dist/daemon-local-client.d.ts +28 -0
  38. package/dist/daemon-local-client.d.ts.map +1 -0
  39. package/dist/daemon-local-client.js +55 -0
  40. package/dist/daemon-local-client.js.map +1 -0
  41. package/dist/delivery-command.d.ts +4 -4
  42. package/dist/delivery-command.d.ts.map +1 -1
  43. package/dist/delivery-command.js.map +1 -1
  44. package/dist/index.d.ts +23 -8
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +25 -8
  47. package/dist/index.js.map +1 -1
  48. package/dist/interactions.d.ts +12 -28
  49. package/dist/interactions.d.ts.map +1 -1
  50. package/dist/interactions.js +22 -123
  51. package/dist/interactions.js.map +1 -1
  52. package/dist/job-admission.d.ts +26 -0
  53. package/dist/job-admission.d.ts.map +1 -0
  54. package/dist/job-admission.js +67 -0
  55. package/dist/job-admission.js.map +1 -0
  56. package/dist/journal-fold-policy.d.ts +1 -1
  57. package/dist/journal-fold-policy.d.ts.map +1 -1
  58. package/dist/journal-recovery-files.d.ts +1 -41
  59. package/dist/journal-recovery-files.d.ts.map +1 -1
  60. package/dist/journal-recovery-files.js +2 -340
  61. package/dist/journal-recovery-files.js.map +1 -1
  62. package/dist/loop-facts.d.ts +28 -0
  63. package/dist/loop-facts.d.ts.map +1 -0
  64. package/dist/loop-facts.js +97 -0
  65. package/dist/loop-facts.js.map +1 -0
  66. package/dist/memory-facts.d.ts +2 -0
  67. package/dist/memory-facts.d.ts.map +1 -1
  68. package/dist/memory-facts.js +5 -0
  69. package/dist/memory-facts.js.map +1 -1
  70. package/dist/model-operations.d.ts +11 -4
  71. package/dist/model-operations.d.ts.map +1 -1
  72. package/dist/model-operations.js +68 -38
  73. package/dist/model-operations.js.map +1 -1
  74. package/dist/operator-decisions.d.ts +15 -25
  75. package/dist/operator-decisions.d.ts.map +1 -1
  76. package/dist/operator-decisions.js +5 -84
  77. package/dist/operator-decisions.js.map +1 -1
  78. package/dist/projects.d.ts +42 -41
  79. package/dist/projects.d.ts.map +1 -1
  80. package/dist/projects.js +46 -184
  81. package/dist/projects.js.map +1 -1
  82. package/dist/quota-registry-replay.d.ts +2 -2
  83. package/dist/quota-registry-replay.d.ts.map +1 -1
  84. package/dist/quota-registry-replay.js.map +1 -1
  85. package/dist/quota-registry-support.d.ts +4 -1
  86. package/dist/quota-registry-support.d.ts.map +1 -1
  87. package/dist/quota-registry-support.js +15 -2
  88. package/dist/quota-registry-support.js.map +1 -1
  89. package/dist/quota-registry.d.ts +64 -2
  90. package/dist/quota-registry.d.ts.map +1 -1
  91. package/dist/quota-registry.js +10 -3
  92. package/dist/quota-registry.js.map +1 -1
  93. package/dist/quota-resources.d.ts +6 -3
  94. package/dist/quota-resources.d.ts.map +1 -1
  95. package/dist/quota-resources.js +25 -8
  96. package/dist/quota-resources.js.map +1 -1
  97. package/dist/runless-turn-recovery.d.ts +2 -9
  98. package/dist/runless-turn-recovery.d.ts.map +1 -1
  99. package/dist/runless-turn-recovery.js +0 -14
  100. package/dist/runless-turn-recovery.js.map +1 -1
  101. package/dist/server.d.ts +23 -22
  102. package/dist/server.d.ts.map +1 -1
  103. package/dist/server.js +74 -84
  104. package/dist/server.js.map +1 -1
  105. package/dist/store/blob-files.d.ts +71 -0
  106. package/dist/store/blob-files.d.ts.map +1 -0
  107. package/dist/store/blob-files.js +160 -0
  108. package/dist/store/blob-files.js.map +1 -0
  109. package/dist/store/command-prune.d.ts +37 -0
  110. package/dist/store/command-prune.d.ts.map +1 -0
  111. package/dist/store/command-prune.js +123 -0
  112. package/dist/store/command-prune.js.map +1 -0
  113. package/dist/store/command-queries.d.ts +41 -0
  114. package/dist/store/command-queries.d.ts.map +1 -0
  115. package/dist/store/command-queries.js +186 -0
  116. package/dist/store/command-queries.js.map +1 -0
  117. package/dist/store/command-rows.d.ts +66 -0
  118. package/dist/store/command-rows.d.ts.map +1 -0
  119. package/dist/store/command-rows.js +141 -0
  120. package/dist/store/command-rows.js.map +1 -0
  121. package/dist/store/commands.d.ts +49 -0
  122. package/dist/store/commands.d.ts.map +1 -0
  123. package/dist/store/commands.js +247 -0
  124. package/dist/store/commands.js.map +1 -0
  125. package/dist/store/cursors.d.ts +33 -0
  126. package/dist/store/cursors.d.ts.map +1 -0
  127. package/dist/store/cursors.js +82 -0
  128. package/dist/store/cursors.js.map +1 -0
  129. package/dist/store/engine-recovery-files.d.ts +14 -0
  130. package/dist/store/engine-recovery-files.d.ts.map +1 -0
  131. package/dist/store/engine-recovery-files.js +53 -0
  132. package/dist/store/engine-recovery-files.js.map +1 -0
  133. package/dist/store/engine-state-recovery.d.ts +71 -0
  134. package/dist/store/engine-state-recovery.d.ts.map +1 -0
  135. package/dist/store/engine-state-recovery.js +318 -0
  136. package/dist/store/engine-state-recovery.js.map +1 -0
  137. package/dist/store/errors.d.ts +80 -0
  138. package/dist/store/errors.d.ts.map +1 -0
  139. package/dist/store/errors.js +130 -0
  140. package/dist/store/errors.js.map +1 -0
  141. package/dist/store/event-store.d.ts +52 -0
  142. package/dist/store/event-store.d.ts.map +1 -0
  143. package/dist/store/event-store.js +117 -0
  144. package/dist/store/event-store.js.map +1 -0
  145. package/dist/store/external-files.d.ts +40 -0
  146. package/dist/store/external-files.d.ts.map +1 -0
  147. package/dist/store/external-files.js +90 -0
  148. package/dist/store/external-files.js.map +1 -0
  149. package/dist/store/flusher-protocol.d.ts +82 -0
  150. package/dist/store/flusher-protocol.d.ts.map +1 -0
  151. package/dist/store/flusher-protocol.js +23 -0
  152. package/dist/store/flusher-protocol.js.map +1 -0
  153. package/dist/store/flusher-worker.d.ts +24 -0
  154. package/dist/store/flusher-worker.d.ts.map +1 -0
  155. package/dist/store/flusher-worker.js +185 -0
  156. package/dist/store/flusher-worker.js.map +1 -0
  157. package/dist/store/flusher.d.ts +87 -0
  158. package/dist/store/flusher.d.ts.map +1 -0
  159. package/dist/store/flusher.js +264 -0
  160. package/dist/store/flusher.js.map +1 -0
  161. package/dist/store/generations.d.ts +43 -0
  162. package/dist/store/generations.d.ts.map +1 -0
  163. package/dist/store/generations.js +143 -0
  164. package/dist/store/generations.js.map +1 -0
  165. package/dist/store/idempotency.d.ts +25 -0
  166. package/dist/store/idempotency.d.ts.map +1 -0
  167. package/dist/store/idempotency.js +53 -0
  168. package/dist/store/idempotency.js.map +1 -0
  169. package/dist/store/import-context.d.ts +22 -0
  170. package/dist/store/import-context.d.ts.map +1 -0
  171. package/dist/store/import-context.js +87 -0
  172. package/dist/store/import-context.js.map +1 -0
  173. package/dist/store/import-discovery.d.ts +6 -0
  174. package/dist/store/import-discovery.d.ts.map +1 -0
  175. package/dist/store/import-discovery.js +66 -0
  176. package/dist/store/import-discovery.js.map +1 -0
  177. package/dist/store/import-records.d.ts +6 -0
  178. package/dist/store/import-records.d.ts.map +1 -0
  179. package/dist/store/import-records.js +191 -0
  180. package/dist/store/import-records.js.map +1 -0
  181. package/dist/store/import-resources.d.ts +14 -0
  182. package/dist/store/import-resources.d.ts.map +1 -0
  183. package/dist/store/import-resources.js +197 -0
  184. package/dist/store/import-resources.js.map +1 -0
  185. package/dist/store/import-source.d.ts +24 -0
  186. package/dist/store/import-source.d.ts.map +1 -0
  187. package/dist/store/import-source.js +65 -0
  188. package/dist/store/import-source.js.map +1 -0
  189. package/dist/store/import-verify.d.ts +6 -0
  190. package/dist/store/import-verify.d.ts.map +1 -0
  191. package/dist/store/import-verify.js +97 -0
  192. package/dist/store/import-verify.js.map +1 -0
  193. package/dist/store/import-worker.d.ts +18 -0
  194. package/dist/store/import-worker.d.ts.map +1 -0
  195. package/dist/store/import-worker.js +69 -0
  196. package/dist/store/import-worker.js.map +1 -0
  197. package/dist/store/importer.d.ts +42 -0
  198. package/dist/store/importer.d.ts.map +1 -0
  199. package/dist/store/importer.js +239 -0
  200. package/dist/store/importer.js.map +1 -0
  201. package/dist/store/interactions.d.ts +22 -0
  202. package/dist/store/interactions.d.ts.map +1 -0
  203. package/dist/store/interactions.js +82 -0
  204. package/dist/store/interactions.js.map +1 -0
  205. package/dist/store/legacy-journal/frame-codec.d.ts +94 -0
  206. package/dist/store/legacy-journal/frame-codec.d.ts.map +1 -0
  207. package/dist/store/legacy-journal/frame-codec.js +352 -0
  208. package/dist/store/legacy-journal/frame-codec.js.map +1 -0
  209. package/dist/store/legacy-journal/frame-reader.d.ts +30 -0
  210. package/dist/store/legacy-journal/frame-reader.d.ts.map +1 -0
  211. package/dist/store/legacy-journal/frame-reader.js +97 -0
  212. package/dist/store/legacy-journal/frame-reader.js.map +1 -0
  213. package/dist/store/legacy-journal/journal-fold.d.ts +47 -0
  214. package/dist/store/legacy-journal/journal-fold.d.ts.map +1 -0
  215. package/dist/store/legacy-journal/journal-fold.js +81 -0
  216. package/dist/store/legacy-journal/journal-fold.js.map +1 -0
  217. package/dist/store/legacy-journal/journal-partition.d.ts +2 -0
  218. package/dist/store/legacy-journal/journal-partition.d.ts.map +1 -0
  219. package/dist/store/legacy-journal/journal-partition.js +10 -0
  220. package/dist/store/legacy-journal/journal-partition.js.map +1 -0
  221. package/dist/store/legacy-journal/read-only-preparation.d.ts +48 -0
  222. package/dist/store/legacy-journal/read-only-preparation.d.ts.map +1 -0
  223. package/dist/store/legacy-journal/read-only-preparation.js +430 -0
  224. package/dist/store/legacy-journal/read-only-preparation.js.map +1 -0
  225. package/dist/store/maintenance-worker.d.ts +5 -0
  226. package/dist/store/maintenance-worker.d.ts.map +1 -0
  227. package/dist/store/maintenance-worker.js +175 -0
  228. package/dist/store/maintenance-worker.js.map +1 -0
  229. package/dist/store/maintenance.d.ts +124 -0
  230. package/dist/store/maintenance.d.ts.map +1 -0
  231. package/dist/store/maintenance.js +197 -0
  232. package/dist/store/maintenance.js.map +1 -0
  233. package/dist/store/mutation.d.ts +34 -0
  234. package/dist/store/mutation.d.ts.map +1 -0
  235. package/dist/store/mutation.js +85 -0
  236. package/dist/store/mutation.js.map +1 -0
  237. package/dist/store/obligations.d.ts +101 -0
  238. package/dist/store/obligations.d.ts.map +1 -0
  239. package/dist/store/obligations.js +226 -0
  240. package/dist/store/obligations.js.map +1 -0
  241. package/dist/store/operator-decisions.d.ts +23 -0
  242. package/dist/store/operator-decisions.d.ts.map +1 -0
  243. package/dist/store/operator-decisions.js +68 -0
  244. package/dist/store/operator-decisions.js.map +1 -0
  245. package/dist/store/owner-generations.d.ts +33 -0
  246. package/dist/store/owner-generations.d.ts.map +1 -0
  247. package/dist/store/owner-generations.js +63 -0
  248. package/dist/store/owner-generations.js.map +1 -0
  249. package/dist/store/partitions.d.ts +37 -0
  250. package/dist/store/partitions.d.ts.map +1 -0
  251. package/dist/store/partitions.js +68 -0
  252. package/dist/store/partitions.js.map +1 -0
  253. package/dist/store/pragmas.d.ts +32 -0
  254. package/dist/store/pragmas.d.ts.map +1 -0
  255. package/dist/store/pragmas.js +65 -0
  256. package/dist/store/pragmas.js.map +1 -0
  257. package/dist/store/project-router.d.ts +325 -0
  258. package/dist/store/project-router.d.ts.map +1 -0
  259. package/dist/store/project-router.js +298 -0
  260. package/dist/store/project-router.js.map +1 -0
  261. package/dist/store/projects.d.ts +36 -0
  262. package/dist/store/projects.d.ts.map +1 -0
  263. package/dist/store/projects.js +238 -0
  264. package/dist/store/projects.js.map +1 -0
  265. package/dist/store/publish-blob.d.ts +20 -0
  266. package/dist/store/publish-blob.d.ts.map +1 -0
  267. package/dist/store/publish-blob.js +158 -0
  268. package/dist/store/publish-blob.js.map +1 -0
  269. package/dist/store/purge-files.d.ts +30 -0
  270. package/dist/store/purge-files.d.ts.map +1 -0
  271. package/dist/store/purge-files.js +79 -0
  272. package/dist/store/purge-files.js.map +1 -0
  273. package/dist/store/resource-rows.d.ts +40 -0
  274. package/dist/store/resource-rows.d.ts.map +1 -0
  275. package/dist/store/resource-rows.js +103 -0
  276. package/dist/store/resource-rows.js.map +1 -0
  277. package/dist/store/resources.d.ts +67 -0
  278. package/dist/store/resources.d.ts.map +1 -0
  279. package/dist/store/resources.js +147 -0
  280. package/dist/store/resources.js.map +1 -0
  281. package/dist/store/retention.d.ts +95 -0
  282. package/dist/store/retention.d.ts.map +1 -0
  283. package/dist/store/retention.js +173 -0
  284. package/dist/store/retention.js.map +1 -0
  285. package/dist/store/run-events.d.ts +14 -0
  286. package/dist/store/run-events.d.ts.map +1 -0
  287. package/dist/store/run-events.js +35 -0
  288. package/dist/store/run-events.js.map +1 -0
  289. package/dist/store/runtime.d.ts +24 -0
  290. package/dist/store/runtime.d.ts.map +1 -0
  291. package/dist/store/runtime.js +67 -0
  292. package/dist/store/runtime.js.map +1 -0
  293. package/dist/store/schema.d.ts +33 -0
  294. package/dist/store/schema.d.ts.map +1 -0
  295. package/dist/store/schema.js +187 -0
  296. package/dist/store/schema.js.map +1 -0
  297. package/dist/store/setup-bindings.d.ts +20 -0
  298. package/dist/store/setup-bindings.d.ts.map +1 -0
  299. package/dist/store/setup-bindings.js +52 -0
  300. package/dist/store/setup-bindings.js.map +1 -0
  301. package/dist/store/sql-command-router.d.ts +79 -0
  302. package/dist/store/sql-command-router.d.ts.map +1 -0
  303. package/dist/store/sql-command-router.js +92 -0
  304. package/dist/store/sql-command-router.js.map +1 -0
  305. package/dist/store/sql-daemon-services.d.ts +61 -0
  306. package/dist/store/sql-daemon-services.d.ts.map +1 -0
  307. package/dist/store/sql-daemon-services.js +124 -0
  308. package/dist/store/sql-daemon-services.js.map +1 -0
  309. package/dist/store/sql-recovery-export.d.ts +8 -0
  310. package/dist/store/sql-recovery-export.d.ts.map +1 -0
  311. package/dist/store/sql-recovery-export.js +110 -0
  312. package/dist/store/sql-recovery-export.js.map +1 -0
  313. package/dist/store/sql-recovery-inspection.d.ts +22 -0
  314. package/dist/store/sql-recovery-inspection.d.ts.map +1 -0
  315. package/dist/store/sql-recovery-inspection.js +88 -0
  316. package/dist/store/sql-recovery-inspection.js.map +1 -0
  317. package/dist/store/sql-recovery.d.ts +69 -0
  318. package/dist/store/sql-recovery.d.ts.map +1 -0
  319. package/dist/store/sql-recovery.js +169 -0
  320. package/dist/store/sql-recovery.js.map +1 -0
  321. package/dist/store/sql-validation.d.ts +9 -0
  322. package/dist/store/sql-validation.d.ts.map +1 -0
  323. package/dist/store/sql-validation.js +103 -0
  324. package/dist/store/sql-validation.js.map +1 -0
  325. package/dist/store/statement-observer.d.ts +7 -0
  326. package/dist/store/statement-observer.d.ts.map +1 -0
  327. package/dist/store/statement-observer.js +44 -0
  328. package/dist/store/statement-observer.js.map +1 -0
  329. package/dist/store/store.d.ts +110 -0
  330. package/dist/store/store.d.ts.map +1 -0
  331. package/dist/store/store.js +296 -0
  332. package/dist/store/store.js.map +1 -0
  333. package/dist/store/terminal-files.d.ts +21 -0
  334. package/dist/store/terminal-files.d.ts.map +1 -0
  335. package/dist/store/terminal-files.js +115 -0
  336. package/dist/store/terminal-files.js.map +1 -0
  337. package/dist/store/thread-replay.d.ts +12 -0
  338. package/dist/store/thread-replay.d.ts.map +1 -0
  339. package/dist/store/thread-replay.js +49 -0
  340. package/dist/store/thread-replay.js.map +1 -0
  341. package/dist/store/thread-rows.d.ts +25 -0
  342. package/dist/store/thread-rows.d.ts.map +1 -0
  343. package/dist/store/thread-rows.js +141 -0
  344. package/dist/store/thread-rows.js.map +1 -0
  345. package/dist/store/threads.d.ts +105 -0
  346. package/dist/store/threads.d.ts.map +1 -0
  347. package/dist/store/threads.js +423 -0
  348. package/dist/store/threads.js.map +1 -0
  349. package/dist/store/upload-binding-retention.d.ts +26 -0
  350. package/dist/store/upload-binding-retention.d.ts.map +1 -0
  351. package/dist/store/upload-binding-retention.js +142 -0
  352. package/dist/store/upload-binding-retention.js.map +1 -0
  353. package/dist/store/uploads.d.ts +30 -0
  354. package/dist/store/uploads.d.ts.map +1 -0
  355. package/dist/store/uploads.js +238 -0
  356. package/dist/store/uploads.js.map +1 -0
  357. package/dist/store-contracts.d.ts +181 -0
  358. package/dist/store-contracts.d.ts.map +1 -0
  359. package/dist/store-contracts.js +2 -0
  360. package/dist/store-contracts.js.map +1 -0
  361. package/dist/terminal-authority.d.ts +9 -0
  362. package/dist/terminal-authority.d.ts.map +1 -1
  363. package/dist/terminal-authority.js +103 -1
  364. package/dist/terminal-authority.js.map +1 -1
  365. package/dist/thread-lane-checkpoints.d.ts +0 -2
  366. package/dist/thread-lane-checkpoints.d.ts.map +1 -1
  367. package/dist/thread-lane-checkpoints.js +0 -4
  368. package/dist/thread-lane-checkpoints.js.map +1 -1
  369. package/dist/thread-store-support.d.ts +1 -27
  370. package/dist/thread-store-support.d.ts.map +1 -1
  371. package/dist/thread-store-support.js +0 -63
  372. package/dist/thread-store-support.js.map +1 -1
  373. package/dist/threads.d.ts +1 -113
  374. package/dist/threads.d.ts.map +1 -1
  375. package/dist/threads.js +1 -379
  376. package/dist/threads.js.map +1 -1
  377. package/package.json +9 -7
  378. package/dist/command-activity.d.ts +0 -14
  379. package/dist/command-activity.d.ts.map +0 -1
  380. package/dist/command-activity.js +0 -16
  381. package/dist/command-activity.js.map +0 -1
  382. package/dist/journal-events.d.ts +0 -4
  383. package/dist/journal-events.d.ts.map +0 -1
  384. package/dist/journal-events.js +0 -23
  385. package/dist/journal-events.js.map +0 -1
  386. package/dist/journal-maintenance.d.ts +0 -50
  387. package/dist/journal-maintenance.d.ts.map +0 -1
  388. package/dist/journal-maintenance.js +0 -162
  389. package/dist/journal-maintenance.js.map +0 -1
  390. package/dist/journal-manager-journal.d.ts +0 -18
  391. package/dist/journal-manager-journal.d.ts.map +0 -1
  392. package/dist/journal-manager-journal.js +0 -25
  393. package/dist/journal-manager-journal.js.map +0 -1
  394. package/dist/journal-manager-lifecycle.d.ts +0 -11
  395. package/dist/journal-manager-lifecycle.d.ts.map +0 -1
  396. package/dist/journal-manager-lifecycle.js +0 -2
  397. package/dist/journal-manager-lifecycle.js.map +0 -1
  398. package/dist/journal-manager.d.ts +0 -99
  399. package/dist/journal-manager.d.ts.map +0 -1
  400. package/dist/journal-manager.js +0 -559
  401. package/dist/journal-manager.js.map +0 -1
  402. package/dist/journal-prepared-operation.d.ts +0 -53
  403. package/dist/journal-prepared-operation.d.ts.map +0 -1
  404. package/dist/journal-prepared-operation.js +0 -158
  405. package/dist/journal-prepared-operation.js.map +0 -1
  406. package/dist/journal-projection-slot.d.ts +0 -28
  407. package/dist/journal-projection-slot.d.ts.map +0 -1
  408. package/dist/journal-projection-slot.js +0 -71
  409. package/dist/journal-projection-slot.js.map +0 -1
  410. package/dist/journal-projection.d.ts +0 -13
  411. package/dist/journal-projection.d.ts.map +0 -1
  412. package/dist/journal-projection.js +0 -2
  413. package/dist/journal-projection.js.map +0 -1
  414. package/dist/partition-accounts.d.ts +0 -27
  415. package/dist/partition-accounts.d.ts.map +0 -1
  416. package/dist/partition-accounts.js +0 -21
  417. package/dist/partition-accounts.js.map +0 -1
  418. package/dist/project-partition-preparation.d.ts +0 -87
  419. package/dist/project-partition-preparation.d.ts.map +0 -1
  420. package/dist/project-partition-preparation.js +0 -273
  421. package/dist/project-partition-preparation.js.map +0 -1
  422. package/dist/project-partitions.d.ts +0 -214
  423. package/dist/project-partitions.d.ts.map +0 -1
  424. package/dist/project-partitions.js +0 -486
  425. package/dist/project-partitions.js.map +0 -1
  426. package/dist/project-remove.d.ts +0 -11
  427. package/dist/project-remove.d.ts.map +0 -1
  428. package/dist/project-remove.js +0 -65
  429. package/dist/project-remove.js.map +0 -1
  430. package/dist/project-thread-listing.d.ts +0 -14
  431. package/dist/project-thread-listing.d.ts.map +0 -1
  432. package/dist/project-thread-listing.js +0 -37
  433. package/dist/project-thread-listing.js.map +0 -1
  434. package/dist/quota-projection.d.ts +0 -11
  435. package/dist/quota-projection.d.ts.map +0 -1
  436. package/dist/quota-projection.js +0 -10
  437. package/dist/quota-projection.js.map +0 -1
  438. package/dist/resource-store.d.ts +0 -39
  439. package/dist/resource-store.d.ts.map +0 -1
  440. package/dist/resource-store.js +0 -464
  441. package/dist/resource-store.js.map +0 -1
  442. package/dist/run-event-terminal-index.d.ts +0 -13
  443. package/dist/run-event-terminal-index.d.ts.map +0 -1
  444. package/dist/run-event-terminal-index.js +0 -38
  445. package/dist/run-event-terminal-index.js.map +0 -1
  446. package/dist/run-events.d.ts +0 -17
  447. package/dist/run-events.d.ts.map +0 -1
  448. package/dist/run-events.js +0 -31
  449. package/dist/run-events.js.map +0 -1
  450. package/dist/thread-head-ping.d.ts +0 -35
  451. package/dist/thread-head-ping.d.ts.map +0 -1
  452. package/dist/thread-head-ping.js +0 -67
  453. package/dist/thread-head-ping.js.map +0 -1
@@ -0,0 +1,80 @@
1
+ import type { ControlJournalInspection } from "@claudexor/schema";
2
+ export type JournalRecoveryState = ControlJournalInspection["recovery"];
3
+ export declare class JournalRecoveryRequiredError extends Error {
4
+ readonly code: string;
5
+ readonly status = 503;
6
+ readonly retryable = false;
7
+ readonly requiredActions: string[];
8
+ readonly evidenceRefs: string[];
9
+ readonly recovery: Extract<JournalRecoveryState, {
10
+ status: "recovery_required";
11
+ }>;
12
+ constructor(recovery: Extract<JournalRecoveryState, {
13
+ status: "recovery_required";
14
+ }>);
15
+ }
16
+ /**
17
+ * Typed failures of the engine store. Every error carries the `code` /
18
+ * `status` / `retryable` triple the daemon's problem projection already
19
+ * understands (`rpc-problem.ts`, control-api problem mapping), so no consumer
20
+ * needs a new enum value: a dispatch that cannot be flushed stays
21
+ * `not_started` with this problem attached, an account reset becomes
22
+ * `completed/unavailable` with `detail: store_flush_unavailable`.
23
+ */
24
+ export declare class StoreError extends Error {
25
+ readonly code: string;
26
+ readonly status: number;
27
+ readonly retryable: boolean;
28
+ constructor(code: string, status: number, retryable: boolean, message: string, options?: ErrorOptions);
29
+ }
30
+ /** The running Node lacks `node:sqlite` or bundles a SQLite older than the
31
+ * WAL-reset corruption fix (3.51.3). Raised before any root is touched. */
32
+ export declare class EngineRuntimeUnsupportedError extends StoreError {
33
+ readonly nodeVersion: string;
34
+ readonly sqliteVersion: string | null;
35
+ readonly requiredSqlite: string;
36
+ constructor(input: {
37
+ nodeVersion: string;
38
+ sqliteVersion: string | null;
39
+ requiredSqlite: string;
40
+ detail: string;
41
+ cause?: unknown;
42
+ });
43
+ }
44
+ /** The database file carries another application's id or a schema version
45
+ * this engine cannot serve. Raised before any write. */
46
+ export declare class StoreSchemaUnsupportedError extends StoreError {
47
+ readonly applicationId: number;
48
+ readonly userVersion: number;
49
+ constructor(input: {
50
+ applicationId: number;
51
+ userVersion: number;
52
+ detail: string;
53
+ });
54
+ }
55
+ /** The flusher died before the requested generation was proven durable. The
56
+ * commit itself is intact (crash-class); only the power-loss barrier is
57
+ * unproven. A false refusal after an already completed barrier is safe. */
58
+ export declare class StoreFlushUnavailableError extends StoreError {
59
+ readonly generation: number;
60
+ constructor(generation: number, detail: string);
61
+ }
62
+ /** ENOSPC / SQLITE_FULL on the database or an external file. */
63
+ export declare class StoreFullError extends StoreError {
64
+ constructor(detail: string, cause?: unknown);
65
+ }
66
+ /** SQLITE_CORRUPT / SQLITE_NOTADB surfaced by a statement. */
67
+ export declare class StoreCorruptError extends StoreError {
68
+ constructor(detail: string, cause?: unknown);
69
+ }
70
+ /** The busy fuse blew: a statement waited the whole busy timeout. */
71
+ export declare class StoreBusyError extends StoreError {
72
+ constructor(detail: string, cause?: unknown);
73
+ }
74
+ /** Primary SQLite result code of a `node:sqlite` error, or null for any other error. */
75
+ export declare function sqlitePrimaryCode(error: unknown): number | null;
76
+ /** Map a statement failure to the store's typed classes; anything else is returned as is. */
77
+ export declare function mapStoreError(error: unknown, context: string): unknown;
78
+ /** Whether a mapped error means the busy fuse blew (counted as `busy_waits`). */
79
+ export declare function isBusyFailure(error: unknown): boolean;
80
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/store/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;AAExE,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA+B;IACpD,QAAQ,CAAC,MAAM,OAAO;IACtB,QAAQ,CAAC,SAAS,SAAS;IAC3B,QAAQ,CAAC,eAAe,WAAmE;IAC3F,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAM;IACrC,QAAQ,CAAC,QAAQ,EA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IACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,YAAY,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAS7C;CACF;AAED,gEAAgE;AAChE,qBAAa,cAAe,SAAQ,UAAU;IAC5C,YAAY,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAS1C;CACF;AAED,8DAA8D;AAC9D,qBAAa,iBAAkB,SAAQ,UAAU;IAC/C,YAAY,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAS1C;CACF;AAED,qEAAqE;AACrE,qBAAa,cAAe,SAAQ,UAAU;IAC5C,YAAY,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAS1C;CACF;AAeD,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAK/D;AAED,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAYtE;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAErD"}
@@ -0,0 +1,130 @@
1
+ export class JournalRecoveryRequiredError extends Error {
2
+ code = "journal_recovery_required";
3
+ status = 503;
4
+ retryable = false;
5
+ requiredActions = ["inspect_recovery", "export_recovery", "quarantine_partition"];
6
+ evidenceRefs = [];
7
+ recovery;
8
+ constructor(recovery) {
9
+ const safe = Object.freeze({ ...recovery, location: Object.freeze({ ...recovery.location }) });
10
+ const where = safe.location.kind === "byte"
11
+ ? `byte ${safe.location.byteOffset}`
12
+ : `cursor ${safe.location.epoch}:${safe.location.seq}`;
13
+ super(`journal partition requires recovery at ${where}: ${safe.reason}`);
14
+ this.name = "JournalRecoveryRequiredError";
15
+ this.recovery = safe;
16
+ }
17
+ }
18
+ /**
19
+ * Typed failures of the engine store. Every error carries the `code` /
20
+ * `status` / `retryable` triple the daemon's problem projection already
21
+ * understands (`rpc-problem.ts`, control-api problem mapping), so no consumer
22
+ * needs a new enum value: a dispatch that cannot be flushed stays
23
+ * `not_started` with this problem attached, an account reset becomes
24
+ * `completed/unavailable` with `detail: store_flush_unavailable`.
25
+ */
26
+ export class StoreError extends Error {
27
+ code;
28
+ status;
29
+ retryable;
30
+ constructor(code, status, retryable, message, options) {
31
+ super(message, options);
32
+ this.name = "StoreError";
33
+ this.code = code;
34
+ this.status = status;
35
+ this.retryable = retryable;
36
+ }
37
+ }
38
+ /** The running Node lacks `node:sqlite` or bundles a SQLite older than the
39
+ * WAL-reset corruption fix (3.51.3). Raised before any root is touched. */
40
+ export class EngineRuntimeUnsupportedError extends StoreError {
41
+ nodeVersion;
42
+ sqliteVersion;
43
+ requiredSqlite;
44
+ constructor(input) {
45
+ super("engine_runtime_unsupported", 503, false, `engine runtime unsupported: ${input.detail} (node ${input.nodeVersion}, sqlite ${input.sqliteVersion ?? "absent"}, requires sqlite >= ${input.requiredSqlite})`, input.cause === undefined ? undefined : { cause: input.cause });
46
+ this.name = "EngineRuntimeUnsupportedError";
47
+ this.nodeVersion = input.nodeVersion;
48
+ this.sqliteVersion = input.sqliteVersion;
49
+ this.requiredSqlite = input.requiredSqlite;
50
+ }
51
+ }
52
+ /** The database file carries another application's id or a schema version
53
+ * this engine cannot serve. Raised before any write. */
54
+ export class StoreSchemaUnsupportedError extends StoreError {
55
+ applicationId;
56
+ userVersion;
57
+ constructor(input) {
58
+ super("store_schema_unsupported", 503, false, `engine store schema unsupported: ${input.detail} (application_id ${input.applicationId}, user_version ${input.userVersion})`);
59
+ this.name = "StoreSchemaUnsupportedError";
60
+ this.applicationId = input.applicationId;
61
+ this.userVersion = input.userVersion;
62
+ }
63
+ }
64
+ /** The flusher died before the requested generation was proven durable. The
65
+ * commit itself is intact (crash-class); only the power-loss barrier is
66
+ * unproven. A false refusal after an already completed barrier is safe. */
67
+ export class StoreFlushUnavailableError extends StoreError {
68
+ generation;
69
+ constructor(generation, detail) {
70
+ super("store_flush_unavailable", 503, true, `engine store flush unavailable for generation ${generation}: ${detail}`);
71
+ this.name = "StoreFlushUnavailableError";
72
+ this.generation = generation;
73
+ }
74
+ }
75
+ /** ENOSPC / SQLITE_FULL on the database or an external file. */
76
+ export class StoreFullError extends StoreError {
77
+ constructor(detail, cause) {
78
+ super("store_full", 507, true, `engine store is out of space: ${detail}`, cause === undefined ? undefined : { cause });
79
+ this.name = "StoreFullError";
80
+ }
81
+ }
82
+ /** SQLITE_CORRUPT / SQLITE_NOTADB surfaced by a statement. */
83
+ export class StoreCorruptError extends StoreError {
84
+ constructor(detail, cause) {
85
+ super("store_corrupt", 503, false, `engine store is corrupt: ${detail}`, cause === undefined ? undefined : { cause });
86
+ this.name = "StoreCorruptError";
87
+ }
88
+ }
89
+ /** The busy fuse blew: a statement waited the whole busy timeout. */
90
+ export class StoreBusyError extends StoreError {
91
+ constructor(detail, cause) {
92
+ super("store_busy", 503, true, `engine store is busy: ${detail}`, cause === undefined ? undefined : { cause });
93
+ this.name = "StoreBusyError";
94
+ }
95
+ }
96
+ const SQLITE_BUSY = 5;
97
+ const SQLITE_LOCKED = 6;
98
+ const SQLITE_CORRUPT = 11;
99
+ const SQLITE_FULL = 13;
100
+ const SQLITE_NOTADB = 26;
101
+ /** Primary SQLite result code of a `node:sqlite` error, or null for any other error. */
102
+ export function sqlitePrimaryCode(error) {
103
+ if (!error || typeof error !== "object")
104
+ return null;
105
+ const shape = error;
106
+ if (shape.code !== "ERR_SQLITE_ERROR" || typeof shape.errcode !== "number")
107
+ return null;
108
+ return shape.errcode & 0xff;
109
+ }
110
+ /** Map a statement failure to the store's typed classes; anything else is returned as is. */
111
+ export function mapStoreError(error, context) {
112
+ if (error instanceof StoreError)
113
+ return error;
114
+ const primary = sqlitePrimaryCode(error);
115
+ const detail = `${context}: ${error instanceof Error ? error.message : String(error)}`;
116
+ if (primary === SQLITE_FULL)
117
+ return new StoreFullError(detail, error);
118
+ if (primary === SQLITE_CORRUPT || primary === SQLITE_NOTADB)
119
+ return new StoreCorruptError(detail, error);
120
+ if (primary === SQLITE_BUSY || primary === SQLITE_LOCKED)
121
+ return new StoreBusyError(detail, error);
122
+ if (error && typeof error === "object" && error.code === "ENOSPC")
123
+ return new StoreFullError(detail, error);
124
+ return error;
125
+ }
126
+ /** Whether a mapped error means the busy fuse blew (counted as `busy_waits`). */
127
+ export function isBusyFailure(error) {
128
+ return error instanceof StoreBusyError;
129
+ }
130
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/store/errors.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAC5C,IAAI,GAAW,2BAA2B,CAAC;IAC3C,MAAM,GAAG,GAAG,CAAC;IACb,SAAS,GAAG,KAAK,CAAC;IAClB,eAAe,GAAG,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;IAClF,YAAY,GAAa,EAAE,CAAC;IAC5B,QAAQ,CAAiE;IAElF,YAAY,QAAwE;QAClF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;QAC/F,MAAM,KAAK,GACT,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;YAC3B,CAAC,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;YACpC,CAAC,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QAC3D,KAAK,CAAC,0CAA0C,KAAK,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CA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,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACtE,IAAI,OAAO,KAAK,cAAc,IAAI,OAAO,KAAK,aAAa;QACzD,OAAO,IAAI,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC9C,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,aAAa;QACtD,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA4B,CAAC,IAAI,KAAK,QAAQ;QACvF,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,YAAY,cAAc,CAAC;AACzC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { EventLedger, StoreEvent } from "../store-contracts.js";
2
+ import { BlobFiles, type BodyRef } from "./blob-files.js";
3
+ import { type MutationContext } from "./mutation.js";
4
+ import type { PartitionGeneration } from "./partitions.js";
5
+ import { type AppendedEvent } from "./retention.js";
6
+ import type { EngineStore } from "./store.js";
7
+ /** File-mode bodies outlive the SQL deletion until the shared C10 barrier.
8
+ * Inline rows are removed atomically by runMutation before COMMIT. */
9
+ export declare function collectReleasedBodies(store: EngineStore, blobs: BlobFiles, digests: readonly string[], log?: (message: string) => void): void;
10
+ export interface PreparedEvent<T = unknown> {
11
+ type: string;
12
+ time: string;
13
+ payload: T;
14
+ encodedPayload: Buffer;
15
+ body: BodyRef | null;
16
+ }
17
+ /** Prepare the immutable JSON body before entering a transaction. Large bodies
18
+ * use the existing BlobFiles writer; rollback may leave an unowned file for
19
+ * its existing sweep, never a committed row or an advanced owner generation. */
20
+ export declare function prepareEvent<T>(blobs: BlobFiles, input: {
21
+ type: string;
22
+ time: string;
23
+ payload: T;
24
+ }): PreparedEvent<T>;
25
+ /** Composes with the decision's other row writers in one mutation. The fold
26
+ * sees the logical payload, while the row holds JSON null for a referenced body. */
27
+ export declare function appendPreparedEventInTx(tx: MutationContext, blobs: BlobFiles, pid: number, event: PreparedEvent): AppendedEvent;
28
+ /** Prune uses the same addressed key deletion as fold, including owner deltas. */
29
+ export declare function deleteEventsInTx(tx: MutationContext, pid: number, keys: readonly string[]): string[];
30
+ /** The narrow logical event port used by quota/setup reducers. Production
31
+ * composition still chooses the legacy ledger until the importer switch. Run
32
+ * event producers continue to own typed selection and journal-copy redaction. */
33
+ export declare class SqlEventLedger implements EventLedger {
34
+ private readonly store;
35
+ private readonly blobs;
36
+ readonly generation: Pick<PartitionGeneration, "pid" | "name" | "epoch">;
37
+ constructor(store: EngineStore, blobs: BlobFiles, generation: Pick<PartitionGeneration, "pid" | "name" | "epoch">);
38
+ prepare<T>(type: string, payload: T): PreparedEvent<T>;
39
+ appendInTx<T>(tx: MutationContext, prepared: PreparedEvent<T>): StoreEvent<T>;
40
+ append<T>(type: string, payload: T): StoreEvent<T>;
41
+ appendBatch(entries: readonly {
42
+ type: string;
43
+ payload: unknown;
44
+ }[]): StoreEvent[];
45
+ records<T = unknown>(afterSeq: number, types: readonly string[]): StoreEvent<T>[];
46
+ /** Addressed setup history uses the stable saved group, never the log group
47
+ * that terminal saves retire. Both readers hydrate through the same decoder. */
48
+ recordsInGroup<T = unknown>(groupKey: string, afterSeq: number, types: readonly string[]): StoreEvent<T>[];
49
+ private readRows;
50
+ cursorFor(record: Pick<StoreEvent, "partition" | "epoch" | "seq">): string;
51
+ }
52
+ //# sourceMappingURL=event-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-store.d.ts","sourceRoot":"","sources":["../../src/store/event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAyB,KAAK,OAAO,EAAE,MAAM,iBAAiB,C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117 @@
1
+ import { INLINE_BODY_MAX_BYTES } from "./blob-files.js";
2
+ import { encodeJournalCursor, readStoredEventPayload } from "./cursors.js";
3
+ import { runMutation } from "./mutation.js";
4
+ import { appendEvent, deleteEventKeysInTx } from "./retention.js";
5
+ /** File-mode bodies outlive the SQL deletion until the shared C10 barrier.
6
+ * Inline rows are removed atomically by runMutation before COMMIT. */
7
+ export function collectReleasedBodies(store, blobs, digests, log = console.warn) {
8
+ for (const digest of new Set(digests)) {
9
+ if (!store.prepare("SELECT 1 FROM blob WHERE sha256=? AND inline IS NULL").get(digest))
10
+ continue;
11
+ void blobs.gc(digest).catch((error) => {
12
+ if (!store.isClosed)
13
+ log(`Body cleanup remains pending: ${String(error)}`);
14
+ });
15
+ }
16
+ }
17
+ /** Prepare the immutable JSON body before entering a transaction. Large bodies
18
+ * use the existing BlobFiles writer; rollback may leave an unowned file for
19
+ * its existing sweep, never a committed row or an advanced owner generation. */
20
+ export function prepareEvent(blobs, input) {
21
+ const bytes = Buffer.from(JSON.stringify(input.payload ?? null));
22
+ return {
23
+ type: input.type,
24
+ time: input.time,
25
+ payload: JSON.parse(bytes.toString("utf8")),
26
+ encodedPayload: bytes,
27
+ body: bytes.byteLength > INLINE_BODY_MAX_BYTES ? blobs.prepareBody(bytes) : null,
28
+ };
29
+ }
30
+ /** Composes with the decision's other row writers in one mutation. The fold
31
+ * sees the logical payload, while the row holds JSON null for a referenced body. */
32
+ export function appendPreparedEventInTx(tx, blobs, pid, event) {
33
+ const appended = appendEvent(tx, pid, {
34
+ type: event.type,
35
+ time: event.time,
36
+ payload: event.payload,
37
+ encodedPayload: event.encodedPayload,
38
+ payloadSha: event.body?.sha256,
39
+ });
40
+ if (appended.stored && event.body) {
41
+ blobs.insertRow(event.body);
42
+ tx.changes.blobChanged(event.body.sha256);
43
+ }
44
+ tx.changes.blobChanged(...appended.releasedDigests);
45
+ return appended;
46
+ }
47
+ /** Prune uses the same addressed key deletion as fold, including owner deltas. */
48
+ export function deleteEventsInTx(tx, pid, keys) {
49
+ const released = deleteEventKeysInTx(tx, pid, keys);
50
+ tx.changes.blobChanged(...released);
51
+ return released;
52
+ }
53
+ /** The narrow logical event port used by quota/setup reducers. Production
54
+ * composition still chooses the legacy ledger until the importer switch. Run
55
+ * event producers continue to own typed selection and journal-copy redaction. */
56
+ export class SqlEventLedger {
57
+ store;
58
+ blobs;
59
+ generation;
60
+ constructor(store, blobs, generation) {
61
+ this.store = store;
62
+ this.blobs = blobs;
63
+ this.generation = generation;
64
+ }
65
+ prepare(type, payload) {
66
+ return prepareEvent(this.blobs, { type, payload, time: this.store.now().toISOString() });
67
+ }
68
+ appendInTx(tx, prepared) {
69
+ const result = appendPreparedEventInTx(tx, this.blobs, this.generation.pid, prepared);
70
+ if (result.releasedDigests.length)
71
+ tx.changes.afterCommit(() => collectReleasedBodies(this.store, this.blobs, result.releasedDigests));
72
+ return {
73
+ partition: this.generation.name,
74
+ epoch: this.generation.epoch,
75
+ seq: result.seq,
76
+ time: prepared.time,
77
+ type: prepared.type,
78
+ payload: prepared.payload,
79
+ };
80
+ }
81
+ append(type, payload) {
82
+ const prepared = this.prepare(type, payload);
83
+ return runMutation(this.store, (tx) => this.appendInTx(tx, prepared));
84
+ }
85
+ appendBatch(entries) {
86
+ const prepared = entries.map((entry) => this.prepare(entry.type, entry.payload));
87
+ return runMutation(this.store, (tx) => prepared.map((entry) => this.appendInTx(tx, entry)));
88
+ }
89
+ records(afterSeq, types) {
90
+ return this.readRows(afterSeq, types);
91
+ }
92
+ /** Addressed setup history uses the stable saved group, never the log group
93
+ * that terminal saves retire. Both readers hydrate through the same decoder. */
94
+ recordsInGroup(groupKey, afterSeq, types) {
95
+ return this.readRows(afterSeq, types, groupKey);
96
+ }
97
+ readRows(afterSeq, types, groupKey) {
98
+ if (types.length === 0)
99
+ return [];
100
+ const rows = this.store
101
+ .prepare(`SELECT seq, time, type, payload, payload_sha FROM event${groupKey === undefined ? "" : " INDEXED BY event_group"}
102
+ WHERE pid = ? AND seq > ? AND type IN (${types.map(() => "?").join(",")})${groupKey === undefined ? "" : " AND group_key = ?"} ORDER BY seq`)
103
+ .all(this.generation.pid, afterSeq, ...types, ...(groupKey === undefined ? [] : [groupKey]));
104
+ return rows.map((row) => ({
105
+ partition: this.generation.name,
106
+ epoch: this.generation.epoch,
107
+ seq: Number(row.seq),
108
+ time: row.time,
109
+ type: row.type,
110
+ payload: readStoredEventPayload(row, this.blobs),
111
+ }));
112
+ }
113
+ cursorFor(record) {
114
+ return encodeJournalCursor(record.partition, record.epoch, record.seq);
115
+ }
116
+ }
117
+ //# sourceMappingURL=event-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-store.js","sourceRoot":"","sources":["../../src/store/event-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,qBAAqB,EAAgB,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAsB,MAAM,gBAAgB,CAAC;AAGtF;sEACsE;AACtE,MAAM,UAAU,qBAAqB,CACnC,KAAkB,EAClB,KAAgB,EAChB,OAA0B,EAC1B,GAAG,GAA8B,OAAO,CAAC,IAAI;IAE7C,KAAK,MAAM,MAAM,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,sDAAsD,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;YACpF,SAAS;QACX,KAAK,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;YAC7C,IAAI,CAAC,KAAK,CAAC,QAAQ;gBAAE,GAAG,CAAC,iCAAiC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACL,CAAC;A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AS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,yBAAyB;kDACvE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,eAAe,CAC9I;aACA,GAAG,CACF,IAAI,CAAC,UAAU,CAAC,GAAG,EACnB,QAAQ,EACR,GAAG,KAAK,EACR,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAO/C,CAAC;QACH,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACxB,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI;YAC/B,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK;YAC5B,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;YACpB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,OAAO,EAAE,sBAAsB,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAM;SACtD,CAAC,CAAC,CAAC;IACN,CAAC;IAED,SAAS,CAAC,MAAuD;QAC/D,OAAO,mBAAmB,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ /** The one thing an external-file writer needs from the store. */
2
+ export interface ExternalRegistry {
3
+ registerExternal(dir: string): number;
4
+ }
5
+ export interface ExternalFileReceipt {
6
+ path: string;
7
+ /** Generation whose pass makes the directory entry durable. */
8
+ generation: number;
9
+ /** False when a content-addressed target already existed and was kept. */
10
+ written: boolean;
11
+ }
12
+ /** Node does not expose the POSIX O_DSYNC name on Windows, but passes numeric
13
+ * open flags to libuv. UV_FS_O_DSYNC maps to FILE_FLAG_WRITE_THROUGH there
14
+ * (deps/uv/include/uv/win.h in the supported Node runtime). */
15
+ export declare function externalWriteFlags(access: number): number;
16
+ /**
17
+ * Write an external file the SYNTHESIS_R5 §4.4 way: a sibling `.tmp` opened
18
+ * `O_DSYNC` (the data is at the drive when `write` returns, 0.05–0.4 ms for
19
+ * 4 KiB–2 MiB), then `rename` into place, then a `{g, dir}` registration so
20
+ * the flusher's pass fsyncs the directory entry. No Node sync primitive runs
21
+ * on this thread. `keepExisting` is the content-addressed mode: an existing
22
+ * target is never rewritten.
23
+ */
24
+ export declare function writeExternalFile(registry: ExternalRegistry, input: {
25
+ dir: string;
26
+ name: string;
27
+ bytes: Uint8Array;
28
+ keepExisting?: boolean;
29
+ }): ExternalFileReceipt;
30
+ /** Publish by hard link (finalize, SYNTHESIS_R5 §6.4): an existing target wins. */
31
+ export declare function linkExternalFile(registry: ExternalRegistry, input: {
32
+ source: string;
33
+ dir: string;
34
+ name: string;
35
+ }): ExternalFileReceipt;
36
+ /** Remove a file; a missing file is already removed. The directory is registered. */
37
+ export declare function unlinkExternalFile(registry: ExternalRegistry, path: string): number;
38
+ /** Create a directory (and register its parent, whose entry changed). */
39
+ export declare function ensureDirectory(registry: ExternalRegistry, dir: string): void;
40
+ //# sourceMappingURL=external-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-files.d.ts","sourceRoot":"","sources":["../../src/store/external-files.ts"],"names":[],"mappings":"AAeA,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;+DAE+D;AAC/D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGzD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9E,mBAAmB,CAmCrB;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnD,mBAAmB,CAarB;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CASnF;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAI7E"}
@@ -0,0 +1,90 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { closeSync, constants, existsSync, linkSync, mkdirSync, openSync, renameSync, unlinkSync, writeSync, } from "node:fs";
3
+ import { dirname, join } from "node:path";
4
+ import { mapStoreError } from "./errors.js";
5
+ /** Node does not expose the POSIX O_DSYNC name on Windows, but passes numeric
6
+ * open flags to libuv. UV_FS_O_DSYNC maps to FILE_FLAG_WRITE_THROUGH there
7
+ * (deps/uv/include/uv/win.h in the supported Node runtime). */
8
+ export function externalWriteFlags(access) {
9
+ const sync = process.platform === "win32" ? 0x04000000 : constants.O_DSYNC;
10
+ return access | sync | (constants.O_NOFOLLOW ?? 0);
11
+ }
12
+ /**
13
+ * Write an external file the SYNTHESIS_R5 §4.4 way: a sibling `.tmp` opened
14
+ * `O_DSYNC` (the data is at the drive when `write` returns, 0.05–0.4 ms for
15
+ * 4 KiB–2 MiB), then `rename` into place, then a `{g, dir}` registration so
16
+ * the flusher's pass fsyncs the directory entry. No Node sync primitive runs
17
+ * on this thread. `keepExisting` is the content-addressed mode: an existing
18
+ * target is never rewritten.
19
+ */
20
+ export function writeExternalFile(registry, input) {
21
+ const target = join(input.dir, input.name);
22
+ if (input.keepExisting && existsSync(target)) {
23
+ return { path: target, generation: registry.registerExternal(input.dir), written: false };
24
+ }
25
+ ensureDirectory(registry, input.dir);
26
+ const temp = join(input.dir, `.${input.name}.${randomUUID()}.tmp`);
27
+ let fd = null;
28
+ try {
29
+ fd = openSync(temp, externalWriteFlags(constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL), 0o600);
30
+ let offset = 0;
31
+ while (offset < input.bytes.byteLength) {
32
+ offset += writeSync(fd, input.bytes, offset, input.bytes.byteLength - offset, offset);
33
+ }
34
+ closeSync(fd);
35
+ fd = null;
36
+ if (input.keepExisting && existsSync(target)) {
37
+ unlinkSync(temp);
38
+ return { path: target, generation: registry.registerExternal(input.dir), written: false };
39
+ }
40
+ renameSync(temp, target);
41
+ }
42
+ catch (error) {
43
+ if (fd !== null)
44
+ closeSync(fd);
45
+ try {
46
+ unlinkSync(temp);
47
+ }
48
+ catch {
49
+ /* best effort; the orphan sweep removes stale .tmp files */
50
+ }
51
+ throw mapStoreError(error, `writing ${target}`);
52
+ }
53
+ return { path: target, generation: registry.registerExternal(input.dir), written: true };
54
+ }
55
+ /** Publish by hard link (finalize, SYNTHESIS_R5 §6.4): an existing target wins. */
56
+ export function linkExternalFile(registry, input) {
57
+ const target = join(input.dir, input.name);
58
+ ensureDirectory(registry, input.dir);
59
+ let written = false;
60
+ try {
61
+ linkSync(input.source, target);
62
+ written = true;
63
+ }
64
+ catch (error) {
65
+ if (error.code !== "EEXIST") {
66
+ throw mapStoreError(error, `linking ${input.source} to ${target}`);
67
+ }
68
+ }
69
+ return { path: target, generation: registry.registerExternal(input.dir), written };
70
+ }
71
+ /** Remove a file; a missing file is already removed. The directory is registered. */
72
+ export function unlinkExternalFile(registry, path) {
73
+ try {
74
+ unlinkSync(path);
75
+ }
76
+ catch (error) {
77
+ if (error.code !== "ENOENT") {
78
+ throw mapStoreError(error, `unlinking ${path}`);
79
+ }
80
+ }
81
+ return registry.registerExternal(dirname(path));
82
+ }
83
+ /** Create a directory (and register its parent, whose entry changed). */
84
+ export function ensureDirectory(registry, dir) {
85
+ if (existsSync(dir))
86
+ return;
87
+ mkdirSync(dir, { recursive: true, mode: 0o700 });
88
+ registry.registerExternal(dirname(dir));
89
+ }
90
+ //# sourceMappingURL=external-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-files.js","sourceRoot":"","sources":["../../src/store/external-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAe5C;;+DAE+D;AAC/D,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;IAC3E,OAAO,MAAM,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAA0B,EAC1B,KAA+E;IAE/E,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,KAAK,CAAC,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,IAAI,CAAC;QACH,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvD,MAAM,aAAa,CAAC,KAAK,EAAE,aAAa,IAAI,EAAE,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAAC,QAA0B,EAAE,GAAW;IACrE,IAAI,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO;IAC5B,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACjD,QAAQ,CAAC,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,82 @@
1
+ /** Flusher pass interval (SYNTHESIS_R5 §4.2): a code constant, not a knob. */
2
+ export declare const FLUSH_INTERVAL_MS = 200;
3
+ /** The `workerData` discriminator every store worker is spawned with. The
4
+ * worker modules self-start on it, so the same module graph serves the dev
5
+ * `dist/` layout (adjacent worker file) and the single-file daemon bundle
6
+ * (the bundle itself is the worker entry and dispatches by this key). */
7
+ export declare const STORE_WORKER_DATA_KEY = "claudexorStoreWorker";
8
+ /** Test seams of the flusher worker. Inert unless the store was opened with them. */
9
+ export interface FlusherHooks {
10
+ /** Passes run only on an explicit `tick` command (generation causality tests). */
11
+ manualTick?: boolean;
12
+ /** Honour an `exit` command (worker-death tests). */
13
+ allowExit?: boolean;
14
+ /** Sleep inside the pass, between checkpoint and barrier (kill-during-pass tests). */
15
+ passDelayMs?: number;
16
+ }
17
+ export interface FlusherWorkerData {
18
+ [STORE_WORKER_DATA_KEY]: "flusher";
19
+ dbPath: string;
20
+ hooks: FlusherHooks;
21
+ }
22
+ export type FlusherCommand = {
23
+ type: "register";
24
+ g: number;
25
+ dir: string;
26
+ } | {
27
+ type: "flush";
28
+ g: number;
29
+ } | {
30
+ type: "tick";
31
+ } | {
32
+ type: "exit";
33
+ code: number;
34
+ } | {
35
+ type: "stop";
36
+ };
37
+ export interface FlusherCounters {
38
+ passes: number;
39
+ barriers: number;
40
+ dirSyncs: number;
41
+ busyPassive: number;
42
+ walReopens: number;
43
+ }
44
+ export interface FlusherPassReport {
45
+ /** Highest generation received before the pass started; everything up to it is covered. */
46
+ g: number;
47
+ dirty: boolean;
48
+ /** The explicit WAL F_FULLFSYNC ran in this pass. Never derived from the checkpoint result. */
49
+ barrier: boolean;
50
+ dirsSynced: string[];
51
+ /** Registered directories that no longer existed at pass time (nothing left to prove). */
52
+ dirsMissing: string[];
53
+ /** Raw `PRAGMA wal_checkpoint(PASSIVE)` row — informational, never a barrier proof. */
54
+ checkpoint: {
55
+ busy: number;
56
+ log: number;
57
+ checkpointed: number;
58
+ } | null;
59
+ walBytes: number | null;
60
+ passMs: number;
61
+ barrierMs: number | null;
62
+ counters: FlusherCounters;
63
+ at: number;
64
+ }
65
+ export type FlusherEvent = {
66
+ type: "ready";
67
+ at: number;
68
+ } | {
69
+ type: "synced";
70
+ report: FlusherPassReport;
71
+ } | {
72
+ type: "stopped";
73
+ };
74
+ /**
75
+ * Where a store worker starts. Beside this module in the built `dist/` tree
76
+ * the worker file exists and is the entry; inside the single-file daemon
77
+ * bundle `import.meta.url` IS the bundle (esbuild defines it so), the
78
+ * adjacent file does not exist, and the bundle itself is the entry — it
79
+ * embeds the worker modules, which self-start on `workerData`.
80
+ */
81
+ export declare function resolveStoreWorkerEntry(moduleUrl: string, workerFile: string): string;
82
+ //# sourceMappingURL=flusher-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flusher-protocol.d.ts","sourceRoot":"","sources":["../../src/store/flusher-protocol.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,eA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