@claudexor/daemon 3.25.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +91 -0
  282. package/dist/store/retention.d.ts.map +1 -0
  283. package/dist/store/retention.js +169 -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,37 @@
1
+ import type { EngineStore } from "./store.js";
2
+ import { type SqlWriteContext } from "./mutation.js";
3
+ /** One generation of a partition: the surrogate `pid` is the only key rows carry. */
4
+ export interface PartitionGeneration {
5
+ pid: number;
6
+ name: string;
7
+ epoch: string;
8
+ status: string;
9
+ nextSeq: number;
10
+ }
11
+ interface PartitionRow {
12
+ id: number | bigint;
13
+ name: string;
14
+ epoch: string;
15
+ status: string;
16
+ next_seq: number | bigint;
17
+ }
18
+ export declare function generationOf(row: PartitionRow): PartitionGeneration;
19
+ /** Create a new generation (inside the caller's transaction). Sequence numbers start at 1, as today. */
20
+ export declare function createPartition(store: EngineStore, name: string, options?: {
21
+ epoch?: string;
22
+ projectId?: string | null;
23
+ }): PartitionGeneration;
24
+ /** Importers supply the original identity, time and sparse sequence head. */
25
+ export declare function insertPartitionInTx(sql: SqlWriteContext, input: {
26
+ name: string;
27
+ epoch: string;
28
+ createdAt: string;
29
+ projectId?: string | null;
30
+ status?: string;
31
+ nextSeq?: number;
32
+ }): PartitionGeneration;
33
+ /** The current (`ready`) generation of a partition name, or null. */
34
+ export declare function currentGeneration(store: Pick<SqlWriteContext, "prepare">, name: string): PartitionGeneration | null;
35
+ export declare function partitionById(sql: Pick<SqlWriteContext, "prepare">, pid: number): PartitionGeneration | null;
36
+ export {};
37
+ //# sourceMappingURL=partitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partitions.d.ts","sourceRoot":"","sources":["../../src/store/partitions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEzE,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,YAAY,GAAG,mBAAmB,CAQnE;AAED,wGAAwG;AACxG,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAC1D,mBAAmB,CAQrB;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,eAAe,EACpB,KAAK,EAAE;IACL,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,mBAAmB,CAiBrB;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACvC,IAAI,EAAE,MAAM,GACX,mBAAmB,GAAG,IAAI,CA4B5B;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACrC,GAAG,EAAE,MAAM,GACV,mBAAmB,GAAG,IAAI,CAK5B"}
@@ -0,0 +1,68 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { requireTransaction } from "./mutation.js";
3
+ export function generationOf(row) {
4
+ return {
5
+ pid: Number(row.id),
6
+ name: row.name,
7
+ epoch: row.epoch,
8
+ status: row.status,
9
+ nextSeq: Number(row.next_seq),
10
+ };
11
+ }
12
+ /** Create a new generation (inside the caller's transaction). Sequence numbers start at 1, as today. */
13
+ export function createPartition(store, name, options = {}) {
14
+ const epoch = options.epoch ?? randomUUID().replace(/-/g, "");
15
+ return insertPartitionInTx(store, {
16
+ name,
17
+ epoch,
18
+ projectId: options.projectId,
19
+ createdAt: store.now().toISOString(),
20
+ });
21
+ }
22
+ /** Importers supply the original identity, time and sparse sequence head. */
23
+ export function insertPartitionInTx(sql, input) {
24
+ requireTransaction(sql);
25
+ if (!input.name.trim())
26
+ throw new Error("journal partition must not be empty");
27
+ const status = input.status ?? "ready";
28
+ const nextSeq = input.nextSeq ?? 1;
29
+ const result = sql
30
+ .prepare("INSERT INTO partition(name, epoch, status, next_seq, project_id, created_at) VALUES(?, ?, ?, ?, ?, ?)")
31
+ .run(input.name, input.epoch, status, nextSeq, input.projectId ?? null, input.createdAt);
32
+ return {
33
+ pid: Number(result.lastInsertRowid),
34
+ name: input.name,
35
+ epoch: input.epoch,
36
+ status,
37
+ nextSeq,
38
+ };
39
+ }
40
+ /** The current (`ready`) generation of a partition name, or null. */
41
+ export function currentGeneration(store, name) {
42
+ const global = store.prepare("SELECT value FROM meta WHERE key = 'global_pid'").get();
43
+ if (global) {
44
+ const row = name === "global"
45
+ ? store
46
+ .prepare("SELECT id,name,epoch,status,next_seq FROM partition WHERE id=? AND name='global' AND status='ready'")
47
+ .get(Number(global.value))
48
+ : store
49
+ .prepare(`SELECT q.id,q.name,q.epoch,q.status,q.next_seq FROM project p
50
+ JOIN partition q ON q.id=p.current_pid JOIN partition g ON g.id=p.pid
51
+ WHERE p.pid=? AND p.status='active' AND g.status='ready' AND q.name=? AND q.status='ready'`)
52
+ .get(Number(global.value), name);
53
+ return row ? generationOf(row) : null;
54
+ }
55
+ // Core/import fixtures may construct a partition before binding the registry;
56
+ // admitted composition always has global_pid and uses the branch above.
57
+ const row = store
58
+ .prepare("SELECT id, name, epoch, status, next_seq FROM partition WHERE name = ? AND status = 'ready'")
59
+ .get(name);
60
+ return row ? generationOf(row) : null;
61
+ }
62
+ export function partitionById(sql, pid) {
63
+ const row = sql
64
+ .prepare("SELECT id, name, epoch, status, next_seq FROM partition WHERE id = ?")
65
+ .get(pid);
66
+ return row ? generationOf(row) : null;
67
+ }
68
+ //# sourceMappingURL=partitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partitions.js","sourceRoot":"","sources":["../../src/store/partitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAAwB,MAAM,eAAe,CAAC;AAmBzE,MAAM,UAAU,YAAY,CAAC,GAAiB;IAC5C,OAAO;QACL,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACnB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;KAC9B,CAAC;AACJ,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,eAAe,CAC7B,KAAkB,EAClB,IAAY,EACZ,OAAO,GAAkD,EAAE;IAE3D,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9D,OAAO,mBAAmB,CAAC,KAAK,EAAE;QAChC,IAAI;QACJ,KAAK;QACL,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;KACrC,CAAC,CAAC;AACL,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CACjC,GAAoB,EACpB,KAOC;IA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,CAAC;IACD,8EAA8E;IAC9E,wEAAwE;IACxE,MAAM,GAAG,GAAG,KAAK;SACd,OAAO,CACN,6FAA6F,CAC9F;SACA,GAAG,CAAC,IAAI,CAA6B,CAAC;IACzC,OAAO,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,GAAqC,EACrC,GAAW;IAEX,MAAM,GAAG,GAAG,GAAG;SACZ,OAAO,CAAC,sEAAsE,CAAC;SAC/E,GAAG,CAAC,GAAG,CAA6B,CAAC;IACxC,OAAO,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { DatabaseSync } from "node:sqlite";
2
+ /**
3
+ * Connection pragmas of the engine store (SYNTHESIS_R5 §2, topology A2).
4
+ *
5
+ * Main connection: WAL + NORMAL (a commit performs no sync), autocheckpoint
6
+ * TRIGGERED at 4000 pages (about 16 MiB of frames — a threshold, not a WAL
7
+ * size bound: a pinned reader or a large transaction grows the WAL beyond it
8
+ * until the reader releases, R5_AMENDMENTS A6)
9
+ * with `checkpoint_fullfsync=1` so the one checkpoint that may complete a
10
+ * backfill on this thread syncs WAL -> DB -> reuse with F_FULLFSYNC; plain
11
+ * `fullfsync` stays off so nothing else on the request thread syncs. The busy
12
+ * timeout is a fuse, not a design: hitting it is the `busy_waits` fact.
13
+ *
14
+ * Flusher connection: never writes rows, never waits for a lock (PASSIVE
15
+ * checkpoints are lock-free by contract), same checkpoint sync class.
16
+ */
17
+ export interface PragmaSpec {
18
+ readonly [name: string]: number | string;
19
+ }
20
+ export declare const MAIN_CONNECTION_PRAGMAS: PragmaSpec;
21
+ export declare const FLUSHER_CONNECTION_PRAGMAS: PragmaSpec;
22
+ export declare class PragmaReadbackError extends Error {
23
+ readonly pragma: string;
24
+ readonly expected: number | string;
25
+ readonly actual: unknown;
26
+ constructor(pragma: string, expected: number | string, actual: unknown);
27
+ }
28
+ /** Apply every pragma, then prove each one by reading it back. */
29
+ export declare function applyPragmas(db: DatabaseSync, spec: PragmaSpec): Record<string, number | string>;
30
+ /** Read the named pragmas back and compare against the spec. */
31
+ export declare function readPragmas(db: DatabaseSync, spec: PragmaSpec): Record<string, number | string>;
32
+ //# sourceMappingURL=pragmas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pragmas.d.ts","sourceRoot":"","sources":["../../src/store/pragmas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAC1C;AAED,eAAO,MAAM,uBAAuB,EAAE,UAWpC,CAAC;AAEH,eAAO,MAAM,0BAA0B,EAAE,UAIvC,CAAC;AAaH,qBAAa,mBAAoB,SAAQ,KAAK;IAE1C,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAClC,QAAQ,CAAC,MAAM,EAAE,OAAO;IAH1B,YACW,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,MAAM,EAAE,OAAO,EAIzB;CACF;AAED,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAMhG;AAED,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAgB/F"}
@@ -0,0 +1,65 @@
1
+ export const MAIN_CONNECTION_PRAGMAS = Object.freeze({
2
+ journal_mode: "wal",
3
+ synchronous: 1,
4
+ wal_autocheckpoint: 4000,
5
+ checkpoint_fullfsync: 1,
6
+ fullfsync: 0,
7
+ journal_size_limit: 67108864,
8
+ busy_timeout: 5000,
9
+ temp_store: 2,
10
+ page_size: 4096,
11
+ auto_vacuum: 0,
12
+ });
13
+ export const FLUSHER_CONNECTION_PRAGMAS = Object.freeze({
14
+ checkpoint_fullfsync: 1,
15
+ fullfsync: 0,
16
+ busy_timeout: 0,
17
+ });
18
+ /** Human spellings SQLite accepts on assignment for the symbolic pragmas. */
19
+ const ASSIGNMENT_VALUE = {
20
+ journal_mode: { wal: "WAL" },
21
+ synchronous: { "1": "NORMAL" },
22
+ temp_store: { "2": "MEMORY" },
23
+ auto_vacuum: { "0": "NONE" },
24
+ };
25
+ /** `PRAGMA busy_timeout` reads back under the column name `timeout`. */
26
+ const READBACK_COLUMN = { busy_timeout: "timeout" };
27
+ export class PragmaReadbackError extends Error {
28
+ pragma;
29
+ expected;
30
+ actual;
31
+ constructor(pragma, expected, actual) {
32
+ super(`PRAGMA ${pragma} read back ${JSON.stringify(actual)}, expected ${expected}`);
33
+ this.pragma = pragma;
34
+ this.expected = expected;
35
+ this.actual = actual;
36
+ this.name = "PragmaReadbackError";
37
+ }
38
+ }
39
+ /** Apply every pragma, then prove each one by reading it back. */
40
+ export function applyPragmas(db, spec) {
41
+ for (const [name, value] of Object.entries(spec)) {
42
+ const spelled = ASSIGNMENT_VALUE[name]?.[String(value)] ?? String(value);
43
+ db.exec(`PRAGMA ${name}=${spelled}`);
44
+ }
45
+ return readPragmas(db, spec);
46
+ }
47
+ /** Read the named pragmas back and compare against the spec. */
48
+ export function readPragmas(db, spec) {
49
+ const observed = {};
50
+ for (const [name, expected] of Object.entries(spec)) {
51
+ const row = db.prepare(`PRAGMA ${name}`).get();
52
+ const column = READBACK_COLUMN[name] ?? name;
53
+ const actual = row?.[column];
54
+ const normalized = typeof actual === "string"
55
+ ? actual.toLowerCase()
56
+ : typeof actual === "bigint"
57
+ ? Number(actual)
58
+ : actual;
59
+ if (normalized !== expected)
60
+ throw new PragmaReadbackError(name, expected, actual);
61
+ observed[name] = normalized;
62
+ }
63
+ return observed;
64
+ }
65
+ //# sourceMappingURL=pragmas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pragmas.js","sourceRoot":"","sources":["../../src/store/pragmas.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,uBAAuB,GAAe,MAAM,CAAC,MAAM,CAAC;IAC/D,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,CAAC;IACd,kBAAkB,EAAE,IAAI;IACxB,oBAAoB,EAAE,CAAC;IACvB,SAAS,EAAE,CAAC;IACZ,kBAAkB,EAAE,QAAQ;IAC5B,YAAY,EAAE,IAAI;IAClB,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,CAAC;CACf,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAe,MAAM,CAAC,MAAM,CAAC;IAClE,oBAAoB,EAAE,CAAC;IACvB,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,CAAC;CAChB,CAAC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,gBAAgB,GAA2C;IAC/D,YAAY,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE;IAC5B,WAAW,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;IAC9B,UAAU,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;IAC7B,WAAW,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE;CAC7B,CAAC;AAEF,wEAAwE;AACxE,MAAM,eAAe,GAA2B,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AAE5E,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAEjC,MAAM;IACN,QAAQ;IACR,MAAM;IAHjB,YACW,MAAc,EACd,QAAyB,EACzB,MAAe;QAExB,KAAK,CAAC,UAAU,MAAM,cAA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AChB,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,UAAU,KAAK,QAAQ;YAAE,MAAM,IAAI,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACnF,QAAQ,CAAC,IAAI,CAAC,GAAG,UAA6B,CAAC;IACjD,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,325 @@
1
+ import { type ControlProjectListingProblem, type Thread, type ThreadTurn } from "@claudexor/schema";
2
+ import type { CreateThreadInput, CreateTurnInput, UpdateThreadInput } from "../threads.js";
3
+ import { type PartitionGeneration } from "./partitions.js";
4
+ import { SqlProjectStore } from "./projects.js";
5
+ import { SqlThreadStore } from "./threads.js";
6
+ /** SQL routing returns one generation, never an array of recovered stores.
7
+ * Command/interaction/decision owners use these same addressed routes. */
8
+ export declare class SqlProjectRouter {
9
+ readonly projects: SqlProjectStore;
10
+ constructor(projects: SqlProjectStore);
11
+ get store(): import("./store.js").EngineStore;
12
+ threadStore(generation: Pick<PartitionGeneration, "pid" | "name" | "epoch">): SqlThreadStore;
13
+ private globalThreads;
14
+ generationForThread(id: string): PartitionGeneration | null;
15
+ generationForTurn(id: string): PartitionGeneration | null;
16
+ generationForCommand(id: string): PartitionGeneration | null;
17
+ private entityGeneration;
18
+ generationForRequest(params: unknown): PartitionGeneration;
19
+ registerProject(input: Parameters<SqlProjectStore["register"]>[0]): import("../projects.js").ProjectRegistration;
20
+ relinkProject(id: string, root: string): {
21
+ schema_version: 2;
22
+ id: string;
23
+ root: string;
24
+ created_at: string;
25
+ updated_at: string;
26
+ };
27
+ removeProject(id: string, activeRunRoots: ReadonlySet<string>): {
28
+ projectId: string;
29
+ root: string;
30
+ registryRemoved: true;
31
+ journalPartitionArchived: boolean;
32
+ archivedPartitionPath: string | null;
33
+ artifactsRetained: true;
34
+ activeRunCheck: "snapshot";
35
+ };
36
+ findThreadCreation(input: CreateThreadInput & {
37
+ ephemeral?: boolean;
38
+ }): Thread | null;
39
+ createThread(input: CreateThreadInput & {
40
+ ephemeral?: boolean;
41
+ }): Thread;
42
+ listThreadsResilient(): {
43
+ threads: Thread[];
44
+ problems: ControlProjectListingProblem[];
45
+ };
46
+ listThreads(): Thread[];
47
+ listPurgedThreads(): Thread[];
48
+ getThread(id: string): Thread | undefined;
49
+ getTurn(id: string): ThreadTurn | undefined;
50
+ turnsFor(id: string): ThreadTurn[];
51
+ sessionsForThread(id: string): {
52
+ id: string;
53
+ thread_id: string;
54
+ harness_id: string;
55
+ native_session_id: string | null;
56
+ resume_kind: "none" | "resume_by_id";
57
+ profile_id: string | null;
58
+ last_observed_model: string | null;
59
+ state: "live" | "rebound" | "stale";
60
+ created_at: string;
61
+ updated_at: string;
62
+ }[];
63
+ createTurn(id: string, prompt: string, input?: CreateTurnInput): {
64
+ id: string;
65
+ thread_id: string;
66
+ run_id: string | null;
67
+ parent_run_id: string | null;
68
+ answers_plan_run_id: string | null;
69
+ plan_run_id: string | null;
70
+ plan_hash: string | null;
71
+ plan_readiness_overridden: boolean;
72
+ kind: "decision" | "followup" | "initial";
73
+ prompt: string;
74
+ attachments: {
75
+ resource_id: string;
76
+ kind: "file" | "image";
77
+ mime: string;
78
+ name: string;
79
+ sha256: string;
80
+ size_bytes: number;
81
+ path: string;
82
+ }[];
83
+ enqueue_error: {
84
+ message: string;
85
+ code: string | null;
86
+ retryable: boolean;
87
+ required_actions: string[];
88
+ context: Record<string, unknown>;
89
+ failed_at: string;
90
+ } | null;
91
+ continuity: {
92
+ kind: "fresh" | "native_resume" | "packet";
93
+ packet_turns: number;
94
+ summarized: boolean;
95
+ lane_switched_from: {
96
+ harness_id: string;
97
+ profile_id: string | null;
98
+ } | null;
99
+ } | null;
100
+ created_at: string;
101
+ };
102
+ findTurnByIdempotency(id: string, input: NonNullable<CreateTurnInput["idempotency"]>): {
103
+ id: string;
104
+ thread_id: string;
105
+ run_id: string | null;
106
+ parent_run_id: string | null;
107
+ answers_plan_run_id: string | null;
108
+ plan_run_id: string | null;
109
+ plan_hash: string | null;
110
+ plan_readiness_overridden: boolean;
111
+ kind: "decision" | "followup" | "initial";
112
+ prompt: string;
113
+ attachments: {
114
+ resource_id: string;
115
+ kind: "file" | "image";
116
+ mime: string;
117
+ name: string;
118
+ sha256: string;
119
+ size_bytes: number;
120
+ path: string;
121
+ }[];
122
+ enqueue_error: {
123
+ message: string;
124
+ code: string | null;
125
+ retryable: boolean;
126
+ required_actions: string[];
127
+ context: Record<string, unknown>;
128
+ failed_at: string;
129
+ } | null;
130
+ continuity: {
131
+ kind: "fresh" | "native_resume" | "packet";
132
+ packet_turns: number;
133
+ summarized: boolean;
134
+ lane_switched_from: {
135
+ harness_id: string;
136
+ profile_id: string | null;
137
+ } | null;
138
+ } | null;
139
+ created_at: string;
140
+ } | undefined;
141
+ updateThread(id: string, patch: UpdateThreadInput): {
142
+ schema_version: 2;
143
+ id: string;
144
+ created_at: string;
145
+ updated_at: string;
146
+ repo: {
147
+ root: string;
148
+ base_ref: string;
149
+ } | null;
150
+ title: string | null;
151
+ folder: string | null;
152
+ mode: "agent" | "ask" | "plan";
153
+ auth_preference: "api_key" | "auto" | "subscription";
154
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
155
+ credential_profile_id: string | null;
156
+ primary_harness: string | null;
157
+ eligible_harnesses: string[];
158
+ workspace: {
159
+ mode: "delegated" | "in_place" | "isolated";
160
+ worktree_path: string | null;
161
+ base_sha: string | null;
162
+ delivered_through_run_id: string | null;
163
+ workspace_root: string | null;
164
+ };
165
+ run_ids: string[];
166
+ head_run_id: string | null;
167
+ state: "active" | "closed" | "purged" | "trashed";
168
+ trashed_at: string | null;
169
+ purge_after: string | null;
170
+ pre_trash_state: "active" | "closed" | null;
171
+ };
172
+ trashThread(id: string): {
173
+ schema_version: 2;
174
+ id: string;
175
+ created_at: string;
176
+ updated_at: string;
177
+ repo: {
178
+ root: string;
179
+ base_ref: string;
180
+ } | null;
181
+ title: string | null;
182
+ folder: string | null;
183
+ mode: "agent" | "ask" | "plan";
184
+ auth_preference: "api_key" | "auto" | "subscription";
185
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
186
+ credential_profile_id: string | null;
187
+ primary_harness: string | null;
188
+ eligible_harnesses: string[];
189
+ workspace: {
190
+ mode: "delegated" | "in_place" | "isolated";
191
+ worktree_path: string | null;
192
+ base_sha: string | null;
193
+ delivered_through_run_id: string | null;
194
+ workspace_root: string | null;
195
+ };
196
+ run_ids: string[];
197
+ head_run_id: string | null;
198
+ state: "active" | "closed" | "purged" | "trashed";
199
+ trashed_at: string | null;
200
+ purge_after: string | null;
201
+ pre_trash_state: "active" | "closed" | null;
202
+ };
203
+ restoreThread(id: string): {
204
+ schema_version: 2;
205
+ id: string;
206
+ created_at: string;
207
+ updated_at: string;
208
+ repo: {
209
+ root: string;
210
+ base_ref: string;
211
+ } | null;
212
+ title: string | null;
213
+ folder: string | null;
214
+ mode: "agent" | "ask" | "plan";
215
+ auth_preference: "api_key" | "auto" | "subscription";
216
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
217
+ credential_profile_id: string | null;
218
+ primary_harness: string | null;
219
+ eligible_harnesses: string[];
220
+ workspace: {
221
+ mode: "delegated" | "in_place" | "isolated";
222
+ worktree_path: string | null;
223
+ base_sha: string | null;
224
+ delivered_through_run_id: string | null;
225
+ workspace_root: string | null;
226
+ };
227
+ run_ids: string[];
228
+ head_run_id: string | null;
229
+ state: "active" | "closed" | "purged" | "trashed";
230
+ trashed_at: string | null;
231
+ purge_after: string | null;
232
+ pre_trash_state: "active" | "closed" | null;
233
+ };
234
+ purgeThread(id: string): {
235
+ schema_version: 2;
236
+ id: string;
237
+ created_at: string;
238
+ updated_at: string;
239
+ repo: {
240
+ root: string;
241
+ base_ref: string;
242
+ } | null;
243
+ title: string | null;
244
+ folder: string | null;
245
+ mode: "agent" | "ask" | "plan";
246
+ auth_preference: "api_key" | "auto" | "subscription";
247
+ access: "external_sandbox_full" | "full" | "inherit_native" | "readonly" | "workspace_write" | null;
248
+ credential_profile_id: string | null;
249
+ primary_harness: string | null;
250
+ eligible_harnesses: string[];
251
+ workspace: {
252
+ mode: "delegated" | "in_place" | "isolated";
253
+ worktree_path: string | null;
254
+ base_sha: string | null;
255
+ delivered_through_run_id: string | null;
256
+ workspace_root: string | null;
257
+ };
258
+ run_ids: string[];
259
+ head_run_id: string | null;
260
+ state: "active" | "closed" | "purged" | "trashed";
261
+ trashed_at: string | null;
262
+ purge_after: string | null;
263
+ pre_trash_state: "active" | "closed" | null;
264
+ };
265
+ setThreadWorktree(id: string, path: string, base: string, through?: string): void;
266
+ assertKnownIds(threadId: unknown, turnId: unknown): {
267
+ threadId?: string;
268
+ turnId?: string;
269
+ };
270
+ bindTurnRun(id: string, runId: string): void;
271
+ setTurnEnqueueError(id: string, problem: Parameters<SqlThreadStore["setTurnEnqueueError"]>[1]): void;
272
+ resumeMap(id: string, profileId?: string | null): Record<string, {
273
+ sessionId: string;
274
+ profileId: string | null;
275
+ }>;
276
+ resumeMapAuto(id: string): Record<string, {
277
+ sessionId: string;
278
+ profileId: string | null;
279
+ }>;
280
+ accountBindings(id: string): Record<string, string>;
281
+ recordSession(id: string, harnessId: string, nativeId: string, observed?: string | null, profileId?: string | null): void;
282
+ recordLaneCheckpoint(id: string, harnessId: string, profileId: string | null, turnId: string): void;
283
+ laneCheckpoint(id: string, harnessId: string, profileId: string | null): string | null;
284
+ laneCheckpointsForThread(id: string): {
285
+ id: string;
286
+ thread_id: string;
287
+ harness_id: string;
288
+ profile_id: string | null;
289
+ turn_id: string;
290
+ updated_at: string;
291
+ }[];
292
+ setTurnContinuity(id: string, disclosure: Parameters<SqlThreadStore["setTurnContinuity"]>[1]): void;
293
+ pingThreadHead(id: string): void;
294
+ migrateNullProfileContinuity(harnessId: string, rowId: string): {
295
+ sessions: number;
296
+ checkpoints: number;
297
+ skippedPartitions: string[];
298
+ };
299
+ rollbackProfileContinuity(harnessId: string, rowId: string): {
300
+ sessions: number;
301
+ checkpoints: number;
302
+ skippedPartitions: string[];
303
+ };
304
+ private continuity;
305
+ private unreadyProjects;
306
+ assertCredentialProfileInvalidationReady(): void;
307
+ invalidateCredentialProfile(harnessId: string, profileId: string): {
308
+ clearedThreads: number;
309
+ invalidatedSessions: number;
310
+ };
311
+ healthyProjectRoots(): string[];
312
+ quarantineGhostProjects(): {
313
+ projectId: string;
314
+ root: string;
315
+ reason: string;
316
+ }[];
317
+ /** Startup-only query joins the selected turn to its command, without
318
+ * loading accepted request bodies or every command's retained history. */
319
+ recoverRunlessTurns(): number;
320
+ private forThread;
321
+ private forTurn;
322
+ private requireThread;
323
+ private requireTurn;
324
+ }
325
+ //# sourceMappingURL=project-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-router.d.ts","sourceRoot":"","sources":["../../src/store/project-router.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,4BAA4B,EACjC,KAAK,MAAM,EACX,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQ3F,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C;0EAC0E;AAC1E,qBAAa,gBAAgB;IACf,QAAQ,CAAC,QAAQ,EAAE,eAAe;IAA9C,YAAqB,QAAQ,EAAE,eAAe,EAAI;IAClD,IAAI,KAAK,qCAER;IAED,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,cAAc,CAO3F;IACD,OAAO,CAAC,aAAa;IAIrB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG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