@powerhousedao/reactor 4.1.0-dev.11 → 4.1.0-dev.110

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 (286) hide show
  1. package/dist/src/cache/buffer/ring-buffer.d.ts +37 -0
  2. package/dist/src/cache/buffer/ring-buffer.d.ts.map +1 -0
  3. package/dist/src/cache/buffer/ring-buffer.js +69 -0
  4. package/dist/src/cache/buffer/ring-buffer.js.map +1 -0
  5. package/dist/src/cache/kysely-write-cache.d.ts +134 -0
  6. package/dist/src/cache/kysely-write-cache.d.ts.map +1 -0
  7. package/dist/src/cache/kysely-write-cache.js +375 -0
  8. package/dist/src/cache/kysely-write-cache.js.map +1 -0
  9. package/dist/src/cache/lru/lru-tracker.d.ts +15 -0
  10. package/dist/src/cache/lru/lru-tracker.d.ts.map +1 -0
  11. package/dist/src/cache/lru/lru-tracker.js +96 -0
  12. package/dist/src/cache/lru/lru-tracker.js.map +1 -0
  13. package/dist/src/cache/types.d.ts +42 -0
  14. package/dist/src/cache/types.d.ts.map +1 -0
  15. package/dist/src/cache/types.js +2 -0
  16. package/dist/src/cache/types.js.map +1 -0
  17. package/dist/src/cache/write/interfaces.d.ts +83 -0
  18. package/dist/src/cache/write/interfaces.d.ts.map +1 -0
  19. package/dist/src/cache/write/interfaces.js +2 -0
  20. package/dist/src/cache/write/interfaces.js.map +1 -0
  21. package/dist/src/client/reactor-client.d.ts +103 -0
  22. package/dist/src/client/reactor-client.d.ts.map +1 -0
  23. package/dist/src/client/reactor-client.js +184 -0
  24. package/dist/src/client/reactor-client.js.map +1 -0
  25. package/dist/src/client/types.d.ts +213 -0
  26. package/dist/src/client/types.d.ts.map +1 -0
  27. package/dist/src/client/types.js +14 -0
  28. package/dist/src/client/types.js.map +1 -0
  29. package/dist/src/core/builder.d.ts +20 -0
  30. package/dist/src/core/builder.d.ts.map +1 -0
  31. package/dist/src/core/builder.js +47 -0
  32. package/dist/src/core/builder.js.map +1 -0
  33. package/dist/src/core/reactor-builder.d.ts +32 -0
  34. package/dist/src/core/reactor-builder.d.ts.map +1 -0
  35. package/dist/src/core/reactor-builder.js +120 -0
  36. package/dist/src/core/reactor-builder.js.map +1 -0
  37. package/dist/src/core/reactor.d.ts +107 -0
  38. package/dist/src/core/reactor.d.ts.map +1 -0
  39. package/dist/src/core/reactor.js +989 -0
  40. package/dist/src/core/reactor.js.map +1 -0
  41. package/dist/src/core/types.d.ts +178 -0
  42. package/dist/src/core/types.d.ts.map +1 -0
  43. package/dist/src/core/types.js +2 -0
  44. package/dist/src/core/types.js.map +1 -0
  45. package/dist/src/core/utils.d.ts +55 -0
  46. package/dist/src/core/utils.d.ts.map +1 -0
  47. package/dist/src/core/utils.js +150 -0
  48. package/dist/src/core/utils.js.map +1 -0
  49. package/dist/src/events/event-bus.d.ts +3 -3
  50. package/dist/src/events/event-bus.d.ts.map +1 -1
  51. package/dist/src/events/event-bus.js.map +1 -1
  52. package/dist/src/events/interfaces.d.ts +1 -1
  53. package/dist/src/events/interfaces.d.ts.map +1 -1
  54. package/dist/src/events/types.d.ts +15 -1
  55. package/dist/src/events/types.d.ts.map +1 -1
  56. package/dist/src/events/types.js +6 -0
  57. package/dist/src/events/types.js.map +1 -1
  58. package/dist/src/executor/interfaces.d.ts +31 -54
  59. package/dist/src/executor/interfaces.d.ts.map +1 -1
  60. package/dist/src/executor/simple-job-executor-manager.d.ts +32 -0
  61. package/dist/src/executor/simple-job-executor-manager.d.ts.map +1 -0
  62. package/dist/src/executor/simple-job-executor-manager.js +214 -0
  63. package/dist/src/executor/simple-job-executor-manager.js.map +1 -0
  64. package/dist/src/executor/simple-job-executor.d.ts +60 -0
  65. package/dist/src/executor/simple-job-executor.d.ts.map +1 -0
  66. package/dist/src/executor/simple-job-executor.js +622 -0
  67. package/dist/src/executor/simple-job-executor.js.map +1 -0
  68. package/dist/src/executor/types.d.ts +32 -8
  69. package/dist/src/executor/types.d.ts.map +1 -1
  70. package/dist/src/executor/types.js.map +1 -1
  71. package/dist/src/executor/util.d.ts +65 -0
  72. package/dist/src/executor/util.d.ts.map +1 -0
  73. package/dist/src/executor/util.js +154 -0
  74. package/dist/src/executor/util.js.map +1 -0
  75. package/dist/src/index.d.ts +33 -3
  76. package/dist/src/index.d.ts.map +1 -1
  77. package/dist/src/index.js +40 -2
  78. package/dist/src/index.js.map +1 -1
  79. package/dist/src/job-tracker/in-memory-job-tracker.d.ts +16 -0
  80. package/dist/src/job-tracker/in-memory-job-tracker.d.ts.map +1 -0
  81. package/dist/src/job-tracker/in-memory-job-tracker.js +84 -0
  82. package/dist/src/job-tracker/in-memory-job-tracker.js.map +1 -0
  83. package/dist/src/job-tracker/index.d.ts +3 -0
  84. package/dist/src/job-tracker/index.d.ts.map +1 -0
  85. package/dist/src/job-tracker/index.js +2 -0
  86. package/dist/src/job-tracker/index.js.map +1 -0
  87. package/dist/src/job-tracker/interfaces.d.ts +42 -0
  88. package/dist/src/job-tracker/interfaces.d.ts.map +1 -0
  89. package/dist/src/job-tracker/interfaces.js +2 -0
  90. package/dist/src/job-tracker/interfaces.js.map +1 -0
  91. package/dist/src/queue/interfaces.d.ts +46 -5
  92. package/dist/src/queue/interfaces.d.ts.map +1 -1
  93. package/dist/src/queue/job-execution-handle.d.ts +25 -0
  94. package/dist/src/queue/job-execution-handle.d.ts.map +1 -0
  95. package/dist/src/queue/job-execution-handle.js +62 -0
  96. package/dist/src/queue/job-execution-handle.js.map +1 -0
  97. package/dist/src/queue/queue.d.ts +56 -5
  98. package/dist/src/queue/queue.d.ts.map +1 -1
  99. package/dist/src/queue/queue.js +284 -36
  100. package/dist/src/queue/queue.js.map +1 -1
  101. package/dist/src/queue/types.d.ts +38 -5
  102. package/dist/src/queue/types.d.ts.map +1 -1
  103. package/dist/src/queue/types.js +12 -0
  104. package/dist/src/queue/types.js.map +1 -1
  105. package/dist/src/read-models/coordinator.d.ts +38 -0
  106. package/dist/src/read-models/coordinator.d.ts.map +1 -0
  107. package/dist/src/read-models/coordinator.js +62 -0
  108. package/dist/src/read-models/coordinator.js.map +1 -0
  109. package/dist/src/read-models/document-view.d.ts +24 -0
  110. package/dist/src/read-models/document-view.d.ts.map +1 -0
  111. package/dist/src/read-models/document-view.js +368 -0
  112. package/dist/src/read-models/document-view.js.map +1 -0
  113. package/dist/src/read-models/interfaces.d.ts +29 -0
  114. package/dist/src/read-models/interfaces.d.ts.map +1 -0
  115. package/dist/src/read-models/interfaces.js +2 -0
  116. package/dist/src/read-models/interfaces.js.map +1 -0
  117. package/dist/src/read-models/types.d.ts +46 -0
  118. package/dist/src/read-models/types.d.ts.map +1 -0
  119. package/dist/src/read-models/types.js +2 -0
  120. package/dist/src/read-models/types.js.map +1 -0
  121. package/dist/src/registry/implementation.d.ts +62 -0
  122. package/dist/src/registry/implementation.d.ts.map +1 -0
  123. package/dist/src/registry/implementation.js +96 -0
  124. package/dist/src/registry/implementation.js.map +1 -0
  125. package/dist/src/registry/index.d.ts +3 -0
  126. package/dist/src/registry/index.d.ts.map +1 -0
  127. package/dist/src/registry/index.js +2 -0
  128. package/dist/src/registry/index.js.map +1 -0
  129. package/dist/src/registry/interfaces.d.ts +39 -0
  130. package/dist/src/registry/interfaces.d.ts.map +1 -0
  131. package/dist/src/registry/interfaces.js +2 -0
  132. package/dist/src/registry/interfaces.js.map +1 -0
  133. package/dist/src/shared/awaiter.d.ts +32 -0
  134. package/dist/src/shared/awaiter.d.ts.map +1 -0
  135. package/dist/src/shared/awaiter.js +132 -0
  136. package/dist/src/shared/awaiter.js.map +1 -0
  137. package/dist/src/shared/consistency-tracker.d.ts +48 -0
  138. package/dist/src/shared/consistency-tracker.d.ts.map +1 -0
  139. package/dist/src/shared/consistency-tracker.js +123 -0
  140. package/dist/src/shared/consistency-tracker.js.map +1 -0
  141. package/dist/src/shared/errors.d.ts +17 -0
  142. package/dist/src/shared/errors.d.ts.map +1 -0
  143. package/dist/src/shared/errors.js +33 -0
  144. package/dist/src/shared/errors.js.map +1 -0
  145. package/dist/src/shared/factories.d.ts +16 -0
  146. package/dist/src/shared/factories.d.ts.map +1 -0
  147. package/dist/src/shared/factories.js +33 -0
  148. package/dist/src/shared/factories.js.map +1 -0
  149. package/dist/src/shared/types.d.ts +126 -20
  150. package/dist/src/shared/types.d.ts.map +1 -1
  151. package/dist/src/shared/types.js +35 -1
  152. package/dist/src/shared/types.js.map +1 -1
  153. package/dist/src/shared/utils.d.ts +3 -0
  154. package/dist/src/shared/utils.d.ts.map +1 -0
  155. package/dist/src/shared/utils.js +8 -0
  156. package/dist/src/shared/utils.js.map +1 -0
  157. package/dist/src/signer/passthrough-signer.d.ts +6 -0
  158. package/dist/src/signer/passthrough-signer.d.ts.map +1 -0
  159. package/dist/src/signer/passthrough-signer.js +6 -0
  160. package/dist/src/signer/passthrough-signer.js.map +1 -0
  161. package/dist/src/signer/types.d.ts +15 -0
  162. package/dist/src/signer/types.d.ts.map +1 -0
  163. package/dist/src/signer/types.js +2 -0
  164. package/dist/src/signer/types.js.map +1 -0
  165. package/dist/src/storage/interfaces.d.ts +267 -0
  166. package/dist/src/storage/interfaces.d.ts.map +1 -0
  167. package/dist/src/storage/interfaces.js +19 -0
  168. package/dist/src/storage/interfaces.js.map +1 -0
  169. package/dist/src/storage/kysely/document-indexer.d.ts +28 -0
  170. package/dist/src/storage/kysely/document-indexer.d.ts.map +1 -0
  171. package/dist/src/storage/kysely/document-indexer.js +350 -0
  172. package/dist/src/storage/kysely/document-indexer.js.map +1 -0
  173. package/dist/src/storage/kysely/keyframe-store.d.ts +15 -0
  174. package/dist/src/storage/kysely/keyframe-store.d.ts.map +1 -0
  175. package/dist/src/storage/kysely/keyframe-store.js +64 -0
  176. package/dist/src/storage/kysely/keyframe-store.js.map +1 -0
  177. package/dist/src/storage/kysely/store.d.ts +15 -0
  178. package/dist/src/storage/kysely/store.d.ts.map +1 -0
  179. package/dist/src/storage/kysely/store.js +196 -0
  180. package/dist/src/storage/kysely/store.js.map +1 -0
  181. package/dist/src/storage/kysely/types.d.ts +72 -0
  182. package/dist/src/storage/kysely/types.d.ts.map +1 -0
  183. package/dist/src/storage/kysely/types.js +2 -0
  184. package/dist/src/storage/kysely/types.js.map +1 -0
  185. package/dist/src/storage/migrations/001_create_operation_table.d.ts +3 -0
  186. package/dist/src/storage/migrations/001_create_operation_table.d.ts.map +1 -0
  187. package/dist/src/storage/migrations/001_create_operation_table.js +40 -0
  188. package/dist/src/storage/migrations/001_create_operation_table.js.map +1 -0
  189. package/dist/src/storage/migrations/002_create_keyframe_table.d.ts +3 -0
  190. package/dist/src/storage/migrations/002_create_keyframe_table.d.ts.map +1 -0
  191. package/dist/src/storage/migrations/002_create_keyframe_table.js +27 -0
  192. package/dist/src/storage/migrations/002_create_keyframe_table.js.map +1 -0
  193. package/dist/src/storage/migrations/003_create_document_table.d.ts +3 -0
  194. package/dist/src/storage/migrations/003_create_document_table.d.ts.map +1 -0
  195. package/dist/src/storage/migrations/003_create_document_table.js +10 -0
  196. package/dist/src/storage/migrations/003_create_document_table.js.map +1 -0
  197. package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts +3 -0
  198. package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts.map +1 -0
  199. package/dist/src/storage/migrations/004_create_document_relationship_table.js +35 -0
  200. package/dist/src/storage/migrations/004_create_document_relationship_table.js.map +1 -0
  201. package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts +3 -0
  202. package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts.map +1 -0
  203. package/dist/src/storage/migrations/005_create_indexer_state_table.js +10 -0
  204. package/dist/src/storage/migrations/005_create_indexer_state_table.js.map +1 -0
  205. package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts +3 -0
  206. package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts.map +1 -0
  207. package/dist/src/storage/migrations/006_create_document_snapshot_table.js +49 -0
  208. package/dist/src/storage/migrations/006_create_document_snapshot_table.js.map +1 -0
  209. package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts +3 -0
  210. package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts.map +1 -0
  211. package/dist/src/storage/migrations/007_create_slug_mapping_table.js +24 -0
  212. package/dist/src/storage/migrations/007_create_slug_mapping_table.js.map +1 -0
  213. package/dist/src/storage/migrations/008_create_view_state_table.d.ts +3 -0
  214. package/dist/src/storage/migrations/008_create_view_state_table.d.ts.map +1 -0
  215. package/dist/src/storage/migrations/008_create_view_state_table.js +9 -0
  216. package/dist/src/storage/migrations/008_create_view_state_table.js.map +1 -0
  217. package/dist/src/storage/migrations/index.d.ts +3 -0
  218. package/dist/src/storage/migrations/index.d.ts.map +1 -0
  219. package/dist/src/storage/migrations/index.js +3 -0
  220. package/dist/src/storage/migrations/index.js.map +1 -0
  221. package/dist/src/storage/migrations/migrator.d.ts +5 -0
  222. package/dist/src/storage/migrations/migrator.d.ts.map +1 -0
  223. package/dist/src/storage/migrations/migrator.js +51 -0
  224. package/dist/src/storage/migrations/migrator.js.map +1 -0
  225. package/dist/src/storage/migrations/run-migrations.d.ts +2 -0
  226. package/dist/src/storage/migrations/run-migrations.d.ts.map +1 -0
  227. package/dist/src/storage/migrations/run-migrations.js +58 -0
  228. package/dist/src/storage/migrations/run-migrations.js.map +1 -0
  229. package/dist/src/storage/migrations/types.d.ts +9 -0
  230. package/dist/src/storage/migrations/types.d.ts.map +1 -0
  231. package/dist/src/storage/migrations/types.js +2 -0
  232. package/dist/src/storage/migrations/types.js.map +1 -0
  233. package/dist/src/storage/txn.d.ts +15 -0
  234. package/dist/src/storage/txn.d.ts.map +1 -0
  235. package/dist/src/storage/txn.js +43 -0
  236. package/dist/src/storage/txn.js.map +1 -0
  237. package/dist/src/subs/default-error-handler.d.ts +13 -0
  238. package/dist/src/subs/default-error-handler.d.ts.map +1 -0
  239. package/dist/src/subs/default-error-handler.js +27 -0
  240. package/dist/src/subs/default-error-handler.js.map +1 -0
  241. package/dist/src/subs/react-subscription-manager.d.ts +45 -0
  242. package/dist/src/subs/react-subscription-manager.d.ts.map +1 -0
  243. package/dist/src/subs/react-subscription-manager.js +185 -0
  244. package/dist/src/subs/react-subscription-manager.js.map +1 -0
  245. package/dist/src/subs/types.d.ts +64 -0
  246. package/dist/src/subs/types.d.ts.map +1 -0
  247. package/dist/src/subs/types.js +2 -0
  248. package/dist/src/subs/types.js.map +1 -0
  249. package/dist/src/utils/reshuffle.d.ts +30 -0
  250. package/dist/src/utils/reshuffle.d.ts.map +1 -0
  251. package/dist/src/utils/reshuffle.js +47 -0
  252. package/dist/src/utils/reshuffle.js.map +1 -0
  253. package/package.json +21 -7
  254. package/dist/bench/end-to-end-flow.bench.d.ts +0 -2
  255. package/dist/bench/end-to-end-flow.bench.d.ts.map +0 -1
  256. package/dist/bench/end-to-end-flow.bench.js +0 -256
  257. package/dist/bench/end-to-end-flow.bench.js.map +0 -1
  258. package/dist/bench/event-bus.bench.d.ts +0 -2
  259. package/dist/bench/event-bus.bench.d.ts.map +0 -1
  260. package/dist/bench/event-bus.bench.js +0 -238
  261. package/dist/bench/event-bus.bench.js.map +0 -1
  262. package/dist/bench/queue-only.bench.d.ts +0 -2
  263. package/dist/bench/queue-only.bench.d.ts.map +0 -1
  264. package/dist/bench/queue-only.bench.js +0 -40
  265. package/dist/bench/queue-only.bench.js.map +0 -1
  266. package/dist/bench/reactor-throughput.bench.d.ts +0 -2
  267. package/dist/bench/reactor-throughput.bench.d.ts.map +0 -1
  268. package/dist/bench/reactor-throughput.bench.js +0 -137
  269. package/dist/bench/reactor-throughput.bench.js.map +0 -1
  270. package/dist/src/executor/job-executor.d.ts +0 -62
  271. package/dist/src/executor/job-executor.d.ts.map +0 -1
  272. package/dist/src/executor/job-executor.js +0 -325
  273. package/dist/src/executor/job-executor.js.map +0 -1
  274. package/dist/test/event-bus.test.d.ts +0 -2
  275. package/dist/test/event-bus.test.d.ts.map +0 -1
  276. package/dist/test/event-bus.test.js +0 -532
  277. package/dist/test/event-bus.test.js.map +0 -1
  278. package/dist/test/job-executor.test.d.ts +0 -2
  279. package/dist/test/job-executor.test.d.ts.map +0 -1
  280. package/dist/test/job-executor.test.js +0 -581
  281. package/dist/test/job-executor.test.js.map +0 -1
  282. package/dist/test/queue.test.d.ts +0 -2
  283. package/dist/test/queue.test.d.ts.map +0 -1
  284. package/dist/test/queue.test.js +0 -396
  285. package/dist/test/queue.test.js.map +0 -1
  286. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,23 +1,129 @@
1
1
  /**
2
- * Basic Operation type for the queue
3
- * This is a simplified version that includes the essential fields needed for queuing
4
- */
5
- export type Operation = {
6
- /** Position of the operation in the history */
7
- index: number;
8
- /** Timestamp of when the operation was added */
9
- timestamp: string;
10
- /** Hash of the resulting document data after the operation */
11
- hash: string;
12
- /** The number of operations skipped with this Operation */
13
- skip: number;
14
- /** The type/name of the operation */
15
- type: string;
16
- /** The input data for the operation */
17
- input: any;
18
- /** Error message for a failed action */
19
- error?: string;
20
- /** Unique operation id */
21
- id?: string;
2
+ * The document ID used for system operations (CREATE_DOCUMENT, DELETE_DOCUMENT, etc.)
3
+ * System operations use this special ID along with the "system" scope.
4
+ */
5
+ export declare const SYSTEM_DOCUMENT_ID = "00000000-0000-0000-0000-000000000000";
6
+ /**
7
+ * Information about an error including message and stack trace.
8
+ */
9
+ export type ErrorInfo = {
10
+ message: string;
11
+ stack: string;
12
+ };
13
+ /**
14
+ * Describes the status of a shutdown operation.
15
+ */
16
+ export type ShutdownStatus = {
17
+ /**
18
+ * True if and only if the system has been shutdown.
19
+ *
20
+ * This value is meant to be polled to determine if the system has been shutdown.
21
+ *
22
+ * In the case of a browser process, the `kill` method should be able to synchronously set this to true.
23
+ *
24
+ * In the case of a server process, a graceful shutdown period should be allowed for the system to finish its work.
25
+ */
26
+ get isShutdown(): boolean;
27
+ };
28
+ /**
29
+ * Enum that determines deletion propagation.
30
+ */
31
+ export declare enum PropagationMode {
32
+ None = "none",
33
+ Cascade = "cascade"
34
+ }
35
+ /**
36
+ * Enum that describes the type of relationship change.
37
+ */
38
+ export declare enum RelationshipChangeType {
39
+ Added = "added",
40
+ Removed = "removed"
41
+ }
42
+ /**
43
+ * Describes the current state of a job.
44
+ */
45
+ export type JobInfo = {
46
+ id: string;
47
+ status: JobStatus;
48
+ createdAtUtcIso: string;
49
+ completedAtUtcIso?: string;
50
+ error?: ErrorInfo;
51
+ errorHistory?: ErrorInfo[];
52
+ result?: any;
53
+ /**
54
+ * A token for coordinating reads, only valid once a job reaches COMPLETED.
55
+ */
56
+ consistencyToken: ConsistencyToken;
57
+ };
58
+ /**
59
+ * Job execution statuses
60
+ */
61
+ export declare enum JobStatus {
62
+ /** Job is queued but not yet started */
63
+ PENDING = "PENDING",
64
+ /** Job is currently being executed */
65
+ RUNNING = "RUNNING",
66
+ /** Job completed successfully */
67
+ COMPLETED = "COMPLETED",
68
+ /** Job failed (may be retried) */
69
+ FAILED = "FAILED"
70
+ }
71
+ /**
72
+ * Describe the view of a set of documents. That is, what pieces of the
73
+ * documents are populated.
74
+ */
75
+ export type ViewFilter = {
76
+ branch?: string;
77
+ scopes?: string[];
78
+ revision?: number;
79
+ };
80
+ /**
81
+ * Describes filter options for searching documents.
82
+ *
83
+ * Each parameter is treated as an AND condition.
84
+ */
85
+ export type SearchFilter = {
86
+ type?: string;
87
+ parentId?: string;
88
+ ids?: string[];
89
+ slugs?: string[];
90
+ };
91
+ /**
92
+ * Describes the options for paging.
93
+ */
94
+ export type PagingOptions = {
95
+ cursor: string;
96
+ limit: number;
97
+ };
98
+ /**
99
+ * The paged result.
100
+ */
101
+ export type PagedResults<T> = {
102
+ results: T[];
103
+ options: PagingOptions;
104
+ next?: () => Promise<PagedResults<T>>;
105
+ nextCursor?: string;
106
+ };
107
+ /**
108
+ * A string key in the format `documentId:scope:branch` used to identify a consistency checkpoint.
109
+ */
110
+ export type ConsistencyKey = `${string}:${string}:${string}`;
111
+ /**
112
+ * Describes a specific point in a document's operation history.
113
+ */
114
+ export type ConsistencyCoordinate = {
115
+ documentId: string;
116
+ scope: string;
117
+ branch: string;
118
+ operationIndex: number;
119
+ };
120
+ /**
121
+ * A token that captures the state of write operations at a point in time.
122
+ * Can be used to ensure read-after-write consistency.
123
+ */
124
+ export type ConsistencyToken = {
125
+ version: 1;
126
+ createdAtUtcIso: string;
127
+ coordinates: ConsistencyCoordinate[];
22
128
  };
23
129
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,KAAK,EAAE,GAAG,CAAC;IACX,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;;;OAQG;IACH,IAAI,UAAU,IAAI,OAAO,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAChC,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED;;GAEG;AACH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CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,CAAC,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC"}
@@ -1,2 +1,36 @@
1
- export {};
1
+ /**
2
+ * The document ID used for system operations (CREATE_DOCUMENT, DELETE_DOCUMENT, etc.)
3
+ * System operations use this special ID along with the "system" scope.
4
+ */
5
+ export const SYSTEM_DOCUMENT_ID = "00000000-0000-0000-0000-000000000000";
6
+ /**
7
+ * Enum that determines deletion propagation.
8
+ */
9
+ export var PropagationMode;
10
+ (function (PropagationMode) {
11
+ PropagationMode["None"] = "none";
12
+ PropagationMode["Cascade"] = "cascade";
13
+ })(PropagationMode || (PropagationMode = {}));
14
+ /**
15
+ * Enum that describes the type of relationship change.
16
+ */
17
+ export var RelationshipChangeType;
18
+ (function (RelationshipChangeType) {
19
+ RelationshipChangeType["Added"] = "added";
20
+ RelationshipChangeType["Removed"] = "removed";
21
+ })(RelationshipChangeType || (RelationshipChangeType = {}));
22
+ /**
23
+ * Job execution statuses
24
+ */
25
+ export var JobStatus;
26
+ (function (JobStatus) {
27
+ /** Job is queued but not yet started */
28
+ JobStatus["PENDING"] = "PENDING";
29
+ /** Job is currently being executed */
30
+ JobStatus["RUNNING"] = "RUNNING";
31
+ /** Job completed successfully */
32
+ JobStatus["COMPLETED"] = "COMPLETED";
33
+ /** Job failed (may be retried) */
34
+ JobStatus["FAILED"] = "FAILED";
35
+ })(JobStatus || (JobStatus = {}));
2
36
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shared/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AA0BzE;;GAEG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,sCAAmB,CAAA;AACrB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,6CAAmB,CAAA;AACrB,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,QAGjC;AAoBD;;GAEG;AACH,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACnB,wCAAwC;IACxC,gCAAmB,CAAA;IACnB,sCAAsC;IACtC,gCAAmB,CAAA;IACnB,iCAAiC;IACjC,oCAAuB,CAAA;IACvB,kCAAkC;IAClC,8BAAiB,CAAA;AACnB,CAAC,EATW,SAAS,KAAT,SAAS,QASpB"}
@@ -0,0 +1,3 @@
1
+ import type { ViewFilter } from "./types.js";
2
+ export declare function matchesScope(view: ViewFilter | undefined, scope: string): boolean;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/shared/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,YAAK,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAO1E"}
@@ -0,0 +1,8 @@
1
+ export function matchesScope(view = {}, scope) {
2
+ if (view.scopes) {
3
+ return view.scopes.includes(scope);
4
+ }
5
+ // if there are no scopes specified, we match all scopes
6
+ return true;
7
+ }
8
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/shared/utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,OAAmB,EAAE,EAAE,KAAa;IAC/D,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,wDAAwD;IACxD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Signature } from "document-model";
2
+ import type { ISigner } from "./types.js";
3
+ export declare class PassthroughSigner implements ISigner {
4
+ sign(): Promise<Signature>;
5
+ }
6
+ //# sourceMappingURL=passthrough-signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passthrough-signer.d.ts","sourceRoot":"","sources":["../../../src/signer/passthrough-signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,iBAAkB,YAAW,OAAO;IAC/C,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC;CAG3B"}
@@ -0,0 +1,6 @@
1
+ export class PassthroughSigner {
2
+ sign() {
3
+ return Promise.resolve(["", "", "", "", ""]);
4
+ }
5
+ }
6
+ //# sourceMappingURL=passthrough-signer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passthrough-signer.js","sourceRoot":"","sources":["../../../src/signer/passthrough-signer.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,iBAAiB;IAC5B,IAAI;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ import type { Action, Signature } from "document-model";
2
+ /**
3
+ * Interface for signing actions before submission to the reactor.
4
+ */
5
+ export interface ISigner {
6
+ /**
7
+ * Signs an action
8
+ *
9
+ * @param action - The action to sign
10
+ * @param abortSignal - Optional abort signal to cancel the signing
11
+ * @returns The signature
12
+ */
13
+ sign(action: Action, abortSignal?: AbortSignal): Promise<Signature>;
14
+ }
15
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/signer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACrE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/signer/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,267 @@
1
+ import type { Operation, PHDocument } from "document-model";
2
+ import type { ConsistencyToken } from "../shared/types.js";
3
+ export type OperationContext = {
4
+ documentId: string;
5
+ documentType: string;
6
+ scope: string;
7
+ branch: string;
8
+ resultingState?: string;
9
+ };
10
+ export type OperationWithContext = {
11
+ operation: Operation;
12
+ context: OperationContext;
13
+ };
14
+ export declare class DuplicateOperationError extends Error {
15
+ constructor(opId: string);
16
+ }
17
+ export declare class OptimisticLockError extends Error {
18
+ constructor(message: string);
19
+ }
20
+ export declare class RevisionMismatchError extends Error {
21
+ constructor(expected: number, actual: number);
22
+ }
23
+ export interface AtomicTxn {
24
+ addOperations(...operations: Operation[]): void;
25
+ }
26
+ export type DocumentRevisions = {
27
+ /** Map of scope to operation index for that scope */
28
+ revision: Record<string, number>;
29
+ /** Latest timestamp across revisions */
30
+ latestTimestamp: string;
31
+ };
32
+ export interface IOperationStore {
33
+ apply(documentId: string, documentType: string, scope: string, branch: string, revision: number, fn: (txn: AtomicTxn) => void | Promise<void>, signal?: AbortSignal): Promise<void>;
34
+ getSince(documentId: string, scope: string, branch: string, revision: number, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<Operation>>;
35
+ getSinceId(id: number, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<OperationWithContext>>;
36
+ /**
37
+ * Gets the latest operation index for each scope of a document, along with
38
+ * the latest timestamp across all scopes. This is used to efficiently reconstruct
39
+ * the revision map and lastModified timestamp for document headers.
40
+ *
41
+ * @param documentId - The document id
42
+ * @param branch - The branch name
43
+ * @param signal - Optional abort signal to cancel the request
44
+ * @returns Object containing revision map and latest timestamp
45
+ */
46
+ getRevisions(documentId: string, branch: string, signal?: AbortSignal): Promise<DocumentRevisions>;
47
+ }
48
+ export interface IKeyframeStore {
49
+ putKeyframe(documentId: string, scope: string, branch: string, revision: number, document: PHDocument, signal?: AbortSignal): Promise<void>;
50
+ findNearestKeyframe(documentId: string, scope: string, branch: string, targetRevision: number, signal?: AbortSignal): Promise<{
51
+ revision: number;
52
+ document: PHDocument;
53
+ } | undefined>;
54
+ deleteKeyframes(documentId: string, scope?: string, branch?: string, signal?: AbortSignal): Promise<number>;
55
+ }
56
+ export interface ViewFilter {
57
+ branch?: string;
58
+ scopes?: string[];
59
+ }
60
+ export interface SearchFilter {
61
+ documentType?: string;
62
+ parentId?: string;
63
+ identifiers?: Record<string, any>;
64
+ includeDeleted?: boolean;
65
+ }
66
+ export interface PagingOptions {
67
+ cursor?: string;
68
+ limit?: number;
69
+ }
70
+ export interface PagedResults<T> {
71
+ items: T[];
72
+ nextCursor?: string;
73
+ hasMore: boolean;
74
+ }
75
+ export interface DocumentSnapshot {
76
+ id: string;
77
+ documentId: string;
78
+ slug: string | null;
79
+ name: string | null;
80
+ scope: string;
81
+ branch: string;
82
+ content: string;
83
+ documentType: string;
84
+ lastOperationIndex: number;
85
+ lastOperationHash: string;
86
+ lastUpdatedAt: Date;
87
+ snapshotVersion: number;
88
+ identifiers: string | null;
89
+ metadata: string | null;
90
+ isDeleted: boolean;
91
+ deletedAt: Date | null;
92
+ }
93
+ export interface IDocumentView {
94
+ /**
95
+ * Initializes the view.
96
+ */
97
+ init(): Promise<void>;
98
+ /**
99
+ * Indexes a list of operations.
100
+ *
101
+ * @param items - Operations with context. Context MUST include ephemeral
102
+ * `resultingState` for optimization. IDocumentView never rebuilds
103
+ * documents from operations - it always requires resultingState.
104
+ */
105
+ indexOperations(items: OperationWithContext[]): Promise<void>;
106
+ /**
107
+ * Blocks until the view has processed the coordinates referenced by the
108
+ * provided consistency token.
109
+ *
110
+ * @param token - Consistency token derived from the originating job
111
+ * @param timeoutMs - Optional timeout window in milliseconds
112
+ * @param signal - Optional abort signal to cancel the wait
113
+ */
114
+ waitForConsistency(token: ConsistencyToken, timeoutMs?: number, signal?: AbortSignal): Promise<void>;
115
+ /**
116
+ * Returns true if and only if the documents exist.
117
+ *
118
+ * @param documentIds - The list of document ids to check.
119
+ * @param consistencyToken - Optional token for read-after-write consistency
120
+ * @param signal - Optional abort signal to cancel the request
121
+ */
122
+ exists(documentIds: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<boolean[]>;
123
+ /**
124
+ * Returns the document with the given id.
125
+ *
126
+ * @param documentId - The id of the document to get.
127
+ * @param view - Optional filter containing branch and scopes information
128
+ * @param consistencyToken - Optional token for read-after-write consistency
129
+ * @param signal - Optional abort signal to cancel the request
130
+ */
131
+ get<TDocument extends PHDocument>(documentId: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<TDocument>;
132
+ /**
133
+ * Finds documents by their document type.
134
+ *
135
+ * @param type - The document type to search for
136
+ * @param view - Optional filter containing branch and scopes information
137
+ * @param paging - Optional paging options for cursor-based pagination
138
+ * @param consistencyToken - Optional token for read-after-write consistency
139
+ * @param signal - Optional abort signal to cancel the request
140
+ */
141
+ findByType(type: string, view?: ViewFilter, paging?: PagingOptions, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<PagedResults<PHDocument>>;
142
+ /**
143
+ * Resolves a slug to a document ID.
144
+ *
145
+ * @param slug - The slug to resolve
146
+ * @param view - Optional filter containing branch and scopes information
147
+ * @param consistencyToken - Optional token for read-after-write consistency
148
+ * @param signal - Optional abort signal to cancel the request
149
+ * @returns The document ID or undefined if the slug doesn't exist
150
+ */
151
+ resolveSlug(slug: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string | undefined>;
152
+ }
153
+ export type DocumentRelationship = {
154
+ sourceId: string;
155
+ targetId: string;
156
+ relationshipType: string;
157
+ metadata?: Record<string, unknown>;
158
+ createdAt: Date;
159
+ updatedAt: Date;
160
+ };
161
+ export type DocumentGraphEdge = {
162
+ from: string;
163
+ to: string;
164
+ type: string;
165
+ };
166
+ export interface IDocumentGraph {
167
+ nodes: string[];
168
+ edges: DocumentGraphEdge[];
169
+ }
170
+ export interface IDocumentIndexer {
171
+ /**
172
+ * Initializes the indexer and catches up on any missed operations.
173
+ */
174
+ init(): Promise<void>;
175
+ /**
176
+ * Indexes a list of operations to update the relationship graph.
177
+ *
178
+ * @param operations - Operations to index. Will process ADD_RELATIONSHIP and
179
+ * REMOVE_RELATIONSHIP operations.
180
+ */
181
+ indexOperations(operations: OperationWithContext[]): Promise<void>;
182
+ /**
183
+ * Blocks until the indexer has processed the coordinates referenced by the
184
+ * provided consistency token.
185
+ *
186
+ * @param token - Consistency token derived from the originating job
187
+ * @param timeoutMs - Optional timeout window in milliseconds
188
+ * @param signal - Optional abort signal to cancel the wait
189
+ */
190
+ waitForConsistency(token: ConsistencyToken, timeoutMs?: number, signal?: AbortSignal): Promise<void>;
191
+ /**
192
+ * Returns outgoing relationships from a document.
193
+ *
194
+ * @param documentId - The source document id
195
+ * @param types - Optional filter by relationship types
196
+ * @param consistencyToken - Optional token for read-after-write consistency
197
+ * @param signal - Optional abort signal to cancel the request
198
+ */
199
+ getOutgoing(documentId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
200
+ /**
201
+ * Returns incoming relationships to a document.
202
+ *
203
+ * @param documentId - The target document id
204
+ * @param types - Optional filter by relationship types
205
+ * @param consistencyToken - Optional token for read-after-write consistency
206
+ * @param signal - Optional abort signal to cancel the request
207
+ */
208
+ getIncoming(documentId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
209
+ /**
210
+ * Checks if a relationship exists between two documents.
211
+ *
212
+ * @param sourceId - The source document id
213
+ * @param targetId - The target document id
214
+ * @param types - Optional filter by relationship types
215
+ * @param consistencyToken - Optional token for read-after-write consistency
216
+ * @param signal - Optional abort signal to cancel the request
217
+ */
218
+ hasRelationship(sourceId: string, targetId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<boolean>;
219
+ /**
220
+ * Returns all undirected relationships between two documents.
221
+ *
222
+ * @param a - The ID of the first document
223
+ * @param b - The ID of the second document
224
+ * @param types - Optional filter by relationship types
225
+ * @param consistencyToken - Optional token for read-after-write consistency
226
+ * @param signal - Optional abort signal to cancel the request
227
+ */
228
+ getUndirectedRelationships(a: string, b: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
229
+ /**
230
+ * Returns all directed relationships between two documents.
231
+ *
232
+ * @param sourceId - The source document id
233
+ * @param targetId - The target document id
234
+ * @param types - Optional filter by relationship types
235
+ * @param consistencyToken - Optional token for read-after-write consistency
236
+ * @param signal - Optional abort signal to cancel the request
237
+ */
238
+ getDirectedRelationships(sourceId: string, targetId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
239
+ /**
240
+ * Finds a path from source to target following directed edges.
241
+ *
242
+ * @param sourceId - The source document id
243
+ * @param targetId - The target document id
244
+ * @param types - Optional filter by relationship types
245
+ * @param consistencyToken - Optional token for read-after-write consistency
246
+ * @param signal - Optional abort signal to cancel the request
247
+ * @returns Array of document ids representing the path, or null if no path exists
248
+ */
249
+ findPath(sourceId: string, targetId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[] | null>;
250
+ /**
251
+ * Returns all ancestors of a document in the relationship graph.
252
+ *
253
+ * @param documentId - The document id
254
+ * @param types - Optional filter by relationship types
255
+ * @param consistencyToken - Optional token for read-after-write consistency
256
+ * @param signal - Optional abort signal to cancel the request
257
+ */
258
+ findAncestors(documentId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<IDocumentGraph>;
259
+ /**
260
+ * Returns all relationship types currently in the system.
261
+ *
262
+ * @param consistencyToken - Optional token for read-after-write consistency
263
+ * @param signal - Optional abort signal to cancel the request
264
+ */
265
+ getRelationshipTypes(consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[]>;
266
+ }
267
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/storage/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,gBAAgB,CAAC;CAC3B,CA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,EAAE,CAAC,CAAC;IAEnC;;;;;;;;;OASG;IACH,QAAQ,CACN,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;IAE5B;;;;;;;OAOG;IACH,aAAa,CACX,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,EAAE,EAChB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;;;;OAKG;IACH,oBAAoB,CAClB,gBAAgB,CAAC,EAAE,gBAAgB,EACnC,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACtB"}
@@ -0,0 +1,19 @@
1
+ export class DuplicateOperationError extends Error {
2
+ constructor(opId) {
3
+ super(`Operation with opId ${opId} already exists`);
4
+ this.name = "DuplicateOperationError";
5
+ }
6
+ }
7
+ export class OptimisticLockError extends Error {
8
+ constructor(message) {
9
+ super(message);
10
+ this.name = "OptimisticLockError";
11
+ }
12
+ }
13
+ export class RevisionMismatchError extends Error {
14
+ constructor(expected, actual) {
15
+ super(`Revision mismatch: expected ${expected}, got ${actual}`);
16
+ this.name = "RevisionMismatchError";
17
+ }
18
+ }
19
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/storage/interfaces.ts"],"names":[],"mappings":"AAgBA,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,IAAY;QACtB,KAAK,CAAC,uBAAuB,IAAI,iBAAiB,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,QAAgB,EAAE,MAAc;QAC1C,KAAK,CAAC,+BAA+B,QAAQ,SAAS,MAAM,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import type { Kysely } from "kysely";
2
+ import type { IConsistencyTracker } from "../../shared/consistency-tracker.js";
3
+ import type { ConsistencyToken } from "../../shared/types.js";
4
+ import type { DocumentRelationship, IDocumentGraph, IDocumentIndexer, IOperationStore, OperationWithContext } from "../interfaces.js";
5
+ import type { Database as StorageDatabase, DocumentIndexerDatabase } from "./types.js";
6
+ type Database = StorageDatabase & DocumentIndexerDatabase;
7
+ export declare class KyselyDocumentIndexer implements IDocumentIndexer {
8
+ private db;
9
+ private operationStore;
10
+ private consistencyTracker;
11
+ private lastOperationId;
12
+ constructor(db: Kysely<Database>, operationStore: IOperationStore, consistencyTracker: IConsistencyTracker);
13
+ init(): Promise<void>;
14
+ indexOperations(items: OperationWithContext[]): Promise<void>;
15
+ waitForConsistency(token: ConsistencyToken, timeoutMs?: number, signal?: AbortSignal): Promise<void>;
16
+ getOutgoing(documentId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
17
+ getIncoming(documentId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
18
+ hasRelationship(sourceId: string, targetId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<boolean>;
19
+ getUndirectedRelationships(a: string, b: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
20
+ getDirectedRelationships(sourceId: string, targetId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<DocumentRelationship[]>;
21
+ findPath(sourceId: string, targetId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[] | null>;
22
+ findAncestors(documentId: string, types?: string[], consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<IDocumentGraph>;
23
+ getRelationshipTypes(consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[]>;
24
+ private handleAddRelationship;
25
+ private handleRemoveRelationship;
26
+ }
27
+ export {};
28
+ //# sourceMappingURL=document-indexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-indexer.d.ts","sourceRoot":"","sources":["../../../../src/storage/kysely/document-indexer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,QAAQ,IAAI,eAAe,EAC3B,uBAAuB,EAExB,MAAM,YAAY,CAAC;AAEpB,KAAK,QAAQ,GAAG,eAAe,GAAG,uBAAuB,CAAC;AAE1D,qBAAa,qBAAsB,YAAW,gBAAgB;IAI1D,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,kBAAkB;IAL5B,OAAO,CAAC,eAAe,CAAa;gBAG1B,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,EACpB,cAAc,EAAE,eAAe,EAC/B,kBAAkB,EAAE,mBAAmB;IAG3C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BrB,eAAe,CAAC,KAA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