@xnetjs/data 0.0.2 → 0.1.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 (139) hide show
  1. package/README.md +112 -0
  2. package/dist/account-MWNCH4GJ.js +12 -0
  3. package/dist/account-ledger-R2GAFJL6.js +38 -0
  4. package/dist/auth/index.d.ts +420 -0
  5. package/dist/auth/index.js +102 -0
  6. package/dist/budget-NN7P35XP.js +12 -0
  7. package/dist/canvas-6WYBNH53.js +10 -0
  8. package/dist/channel-AT3LQF4A.js +12 -0
  9. package/dist/chat-message-DSVO72B3.js +10 -0
  10. package/dist/chunk-2ZNJWIQG.js +84 -0
  11. package/dist/chunk-3J3HILXO.js +46 -0
  12. package/dist/chunk-3RUDVTMH.js +5543 -0
  13. package/dist/chunk-4EYKGTSQ.js +49 -0
  14. package/dist/chunk-53F4PRNC.js +32 -0
  15. package/dist/chunk-5EXHNXPL.js +48 -0
  16. package/dist/{chunk-BQBPA5HS.js → chunk-5HC5NO57.js} +16 -2
  17. package/dist/chunk-6KLGA6IR.js +47 -0
  18. package/dist/chunk-6OMG4I7M.js +41 -0
  19. package/dist/chunk-7PDRDSFH.js +69 -0
  20. package/dist/chunk-BQLQSWKZ.js +232 -0
  21. package/dist/chunk-BY5O6LNC.js +380 -0
  22. package/dist/chunk-DCTRX6II.js +40 -0
  23. package/dist/{chunk-VYR5GPJP.js → chunk-DWEXKD6E.js} +9 -3
  24. package/dist/chunk-EBNMV2VO.js +896 -0
  25. package/dist/chunk-FVEACSKE.js +102 -0
  26. package/dist/chunk-GU6THOAB.js +45 -0
  27. package/dist/chunk-H4GA4BBK.js +75 -0
  28. package/dist/chunk-IJ44LR7N.js +76 -0
  29. package/dist/chunk-J4ANIXIV.js +402 -0
  30. package/dist/chunk-JDFNMFOZ.js +45 -0
  31. package/dist/chunk-K7DOZWWT.js +1811 -0
  32. package/dist/chunk-KQAT4XBL.js +49 -0
  33. package/dist/chunk-KQUALW4O.js +183 -0
  34. package/dist/chunk-LYSWLCOI.js +47 -0
  35. package/dist/chunk-MBTUO3ZL.js +65 -0
  36. package/dist/chunk-NI4FHG2K.js +52 -0
  37. package/dist/chunk-OCMSAKWV.js +78 -0
  38. package/dist/chunk-OGJCRNGE.js +57 -0
  39. package/dist/chunk-OPPHF3TF.js +143 -0
  40. package/dist/{chunk-IDMBCRUC.js → chunk-OSAWNZVM.js} +1 -1
  41. package/dist/chunk-PMUQACPY.js +33 -0
  42. package/dist/chunk-PNESGUH5.js +63 -0
  43. package/dist/chunk-Q3IEGH4B.js +51 -0
  44. package/dist/chunk-QJW5LDP4.js +52 -0
  45. package/dist/chunk-QWFTRZQT.js +142 -0
  46. package/dist/{chunk-SZC345Z2.js → chunk-RL64OJJ5.js} +1025 -1110
  47. package/dist/chunk-S5RP5RKY.js +416 -0
  48. package/dist/chunk-S6U6TCMN.js +722 -0
  49. package/dist/chunk-SVNGSZZA.js +69 -0
  50. package/dist/chunk-T5AZAOG5.js +54 -0
  51. package/dist/chunk-TCTZW4A6.js +42 -0
  52. package/dist/chunk-U64CW73O.js +109 -0
  53. package/dist/chunk-UDWKWTAX.js +6526 -0
  54. package/dist/chunk-UQM3G5A2.js +148 -0
  55. package/dist/chunk-VQ7JHB67.js +57 -0
  56. package/dist/chunk-W7EBL7ZU.js +73 -0
  57. package/dist/chunk-WEPK7SZF.js +65 -0
  58. package/dist/chunk-XHEA5UER.js +75 -0
  59. package/dist/chunk-XMSKJ5PV.js +66 -0
  60. package/dist/chunk-XROI44ZP.js +64 -0
  61. package/dist/chunk-Y3S5SRVM.js +45 -0
  62. package/dist/chunk-YEFKQYKA.js +43 -0
  63. package/dist/chunk-YSUIXD2Y.js +105 -0
  64. package/dist/chunk-ZCOFZY5M.js +70 -0
  65. package/dist/chunk-ZLU4Y3O2.js +50 -0
  66. package/dist/chunk-ZPZ7XDA6.js +54 -0
  67. package/dist/chunk-ZZ6TWKGS.js +40 -0
  68. package/dist/clone-C0Jhk2UN.d.ts +2205 -0
  69. package/dist/comment-QSWYAQVS.js +10 -0
  70. package/dist/crm-L5RYAAF3.js +68 -0
  71. package/dist/dashboard-JMKTTRA7.js +10 -0
  72. package/dist/database/index.d.ts +882 -0
  73. package/dist/database/index.js +523 -0
  74. package/dist/database-GIXSPZJW.js +10 -0
  75. package/dist/database-field-3EPAMZUR.js +10 -0
  76. package/dist/database-row-6Q6TRVE4.js +10 -0
  77. package/dist/database-select-option-BBBJFLLH.js +10 -0
  78. package/dist/database-view-5PLSOBI2.js +10 -0
  79. package/dist/experiment-DOVOZ34Y.js +10 -0
  80. package/dist/external-item-P2E5X7BZ.js +14 -0
  81. package/dist/external-reference-7BSFF6SA.js +8 -0
  82. package/dist/feed-2IXHHP6O.js +12 -0
  83. package/dist/feed-item-DPE6LN7I.js +12 -0
  84. package/dist/folder-6KM3KYD5.js +21 -0
  85. package/dist/game-5AK5XWBR.js +50 -0
  86. package/dist/grant-WTQSNT5A.js +8 -0
  87. package/dist/grant-expiration-cleaner-CY6BcmlR.d.ts +249 -0
  88. package/dist/import-batch-IXBJLQPJ.js +12 -0
  89. package/dist/inbox-state-E5NSVOGP.js +12 -0
  90. package/dist/index.d.ts +224 -4548
  91. package/dist/index.js +2252 -4754
  92. package/dist/map-RG5Y3CPC.js +10 -0
  93. package/dist/media-asset-QTCGLIZA.js +8 -0
  94. package/dist/memory-PNRTMBZO.js +12 -0
  95. package/dist/metric-65SVOX5C.js +10 -0
  96. package/dist/milestone-XEO6ZGDG.js +12 -0
  97. package/dist/moderation-FFHETMRB.js +30 -0
  98. package/dist/observation-2Y3QKUXM.js +10 -0
  99. package/dist/page-2V27JGKJ.js +10 -0
  100. package/dist/posting-GBOSZCMZ.js +12 -0
  101. package/dist/profile-BLLDWIDK.js +8 -0
  102. package/dist/project-CQL5LN26.js +10 -0
  103. package/dist/query-ast-C3m6kZYv.d.ts +226 -0
  104. package/dist/reaction-T2DTJBBV.js +10 -0
  105. package/dist/registry-DunPv__d.d.ts +99 -0
  106. package/dist/saved-view-4R2DBCL3.js +10 -0
  107. package/dist/schema/index.d.ts +6489 -0
  108. package/dist/schema/index.js +677 -0
  109. package/dist/schema-extension-LNRF2YRD.js +18 -0
  110. package/dist/space-IJU24PBH.js +42 -0
  111. package/dist/space-membership-DEUMM7NV.js +14 -0
  112. package/dist/store/index.d.ts +518 -0
  113. package/dist/store/index.js +135 -0
  114. package/dist/store-DtIDjk7c.d.ts +355 -0
  115. package/dist/sync/awareness.d.ts +69 -0
  116. package/dist/sync/awareness.js +20 -0
  117. package/dist/system-ILHCZOVO.js +38 -0
  118. package/dist/tag-SKCHM3U5.js +16 -0
  119. package/dist/task-7AOBP7WC.js +16 -0
  120. package/dist/task-view-NUGKELJP.js +10 -0
  121. package/dist/transaction-ZDSEGDIR.js +12 -0
  122. package/dist/transcription-PSCLDAGX.js +12 -0
  123. package/dist/types-S-BJAKyK.d.ts +1576 -0
  124. package/dist/updates.d.ts +44 -0
  125. package/dist/updates.js +16 -0
  126. package/dist/user-widget-RLY2N46A.js +8 -0
  127. package/dist/view-types-DSde-uT_.d.ts +316 -0
  128. package/package.json +32 -9
  129. package/dist/canvas-HSIKIQFK.js +0 -7
  130. package/dist/chunk-2L5ZUGG5.js +0 -53
  131. package/dist/chunk-4MTS5KAQ.js +0 -22
  132. package/dist/chunk-GZHARFKC.js +0 -25
  133. package/dist/chunk-WKIKJTI2.js +0 -45
  134. package/dist/comment-277JD7DV.js +0 -7
  135. package/dist/database-W3KEHLI3.js +0 -7
  136. package/dist/database-row-3O2QSNZN.js +0 -7
  137. package/dist/grant-QVZ454YC.js +0 -7
  138. package/dist/page-O4WTOIEO.js +0 -7
  139. package/dist/task-SEKAYJH7.js +0 -7
@@ -0,0 +1,355 @@
1
+ import { e as StoreAuthAPI, f as NodeStoreOptions, g as NodeStorageAdapter, C as CreateNodeOptions, h as NodeState, i as NodeId, G as GetWithMigrationOptions, M as MigratedNodeState, U as UpdateNodeOptions, L as ListNodesOptions, j as NodeQueryDescriptor, k as NodeQueryResult, T as TransactionOperation, l as TransactionResult, m as DeterministicNodeImportDraft, n as ImportDeterministicNodesOptions, o as ImportDeterministicNodesResult, p as NodeBatchWriteInput, q as NodeBatchWriteResult, S as SchemaIRI, r as NodeChange, s as MergeConflict, t as NodeChangeListener, u as NodeBatchChangeListener } from './types-S-BJAKyK.js';
2
+
3
+ /**
4
+ * NodeStore - Event-sourced storage for Nodes
5
+ *
6
+ * Manages Nodes using Change<T> from @xnetjs/sync with LWW conflict resolution.
7
+ *
8
+ * Key features:
9
+ * - Simple CRUD API that creates Changes under the hood
10
+ * - LWW conflict resolution using Lamport timestamps
11
+ * - Sparse updates (only store changed properties)
12
+ * - Materialized state for fast reads
13
+ */
14
+
15
+ /**
16
+ * NodeStore manages event-sourced Nodes with LWW conflict resolution.
17
+ */
18
+ declare class NodeStore {
19
+ private storage;
20
+ private authorDID;
21
+ private signingKey;
22
+ private changeSigner?;
23
+ private clock;
24
+ private conflicts;
25
+ private listeners;
26
+ private nodeListeners;
27
+ private batchListeners;
28
+ private schemaLookup?;
29
+ private propertyLookup?;
30
+ private lensRegistry?;
31
+ private authEvaluator?;
32
+ private nodeContentCipher?;
33
+ private contentKeyCache?;
34
+ private authRelevantPropertyLookup?;
35
+ private onRecipientsMayNeedRecompute?;
36
+ private onUnauthorizedRemoteChange?;
37
+ readonly auth?: StoreAuthAPI;
38
+ private telemetry?;
39
+ constructor(options: NodeStoreOptions);
40
+ /**
41
+ * Initialize the store by loading the last Lamport time from storage.
42
+ * Call this before using the store.
43
+ */
44
+ initialize(): Promise<void>;
45
+ /**
46
+ * Get the underlying storage adapter.
47
+ *
48
+ * Use this to access low-level storage operations like change history,
49
+ * document content, and Lamport timestamps. Useful for building history,
50
+ * audit, and verification features.
51
+ *
52
+ * @returns The NodeStorageAdapter instance
53
+ */
54
+ getStorageAdapter(): NodeStorageAdapter;
55
+ private cloneNodeState;
56
+ /**
57
+ * Create a new Node.
58
+ */
59
+ create(options: CreateNodeOptions): Promise<NodeState>;
60
+ /**
61
+ * Get a Node by ID.
62
+ */
63
+ get(id: NodeId): Promise<NodeState | null>;
64
+ /**
65
+ * Return the subset of IDs that already exist in materialized storage.
66
+ *
67
+ * This intentionally returns identifiers only and does not hydrate node
68
+ * contents. Importers use it to route deterministic drafts to create/update.
69
+ */
70
+ getExistingNodeIds(ids: readonly NodeId[]): Promise<NodeId[]>;
71
+ /**
72
+ * Get a Node by ID with automatic schema migration.
73
+ *
74
+ * If the stored node's schema version differs from the target schema,
75
+ * and a migration path exists in the lens registry, the node's properties
76
+ * will be automatically transformed.
77
+ *
78
+ * @param id - The node ID to fetch
79
+ * @param options - Options including the target schema IRI
80
+ * @returns The node with migrated properties, or null if not found
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * // Get node and migrate to TaskSchema v2.0.0
85
+ * const node = await store.getWithMigration('node-123', {
86
+ * targetSchemaId: TaskSchemaV2['@id']
87
+ * })
88
+ *
89
+ * if (node?._migrationInfo) {
90
+ * console.log('Migrated from:', node._migrationInfo.from)
91
+ * if (!node._migrationInfo.lossless) {
92
+ * console.warn('Migration warnings:', node._migrationInfo.warnings)
93
+ * }
94
+ * }
95
+ * ```
96
+ */
97
+ getWithMigration(id: NodeId, options: GetWithMigrationOptions): Promise<MigratedNodeState | null>;
98
+ /**
99
+ * Update a Node's properties.
100
+ */
101
+ update(id: NodeId, options: UpdateNodeOptions): Promise<NodeState>;
102
+ /**
103
+ * Delete a Node (soft delete).
104
+ */
105
+ delete(id: NodeId): Promise<void>;
106
+ /**
107
+ * Restore a deleted Node.
108
+ */
109
+ restore(id: NodeId): Promise<NodeState>;
110
+ /**
111
+ * List Nodes with optional filtering.
112
+ */
113
+ list(options?: ListNodesOptions): Promise<NodeState[]>;
114
+ /**
115
+ * Query nodes with descriptor semantics and storage-level pushdown when available.
116
+ */
117
+ query(descriptor: NodeQueryDescriptor): Promise<NodeQueryResult>;
118
+ private loadQueryFallbackCandidates;
119
+ private canPushSystemListQuery;
120
+ /**
121
+ * Execute multiple operations as a single atomic transaction.
122
+ *
123
+ * All changes created in the transaction share the same batchId and Lamport
124
+ * timestamp, making them logically atomic. This is useful for:
125
+ * - Multi-node operations (move task between projects)
126
+ * - Undo/redo grouping
127
+ * - Audit trails ("user did X" as a single action)
128
+ * - Future blockchain integration (batch = transaction)
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * const result = await store.transaction([
133
+ * { type: 'update', nodeId: task.id, options: { properties: { projectId: newProject.id } } },
134
+ * { type: 'update', nodeId: oldProject.id, options: { properties: { taskIds: [...] } } },
135
+ * { type: 'update', nodeId: newProject.id, options: { properties: { taskIds: [...] } } },
136
+ * ])
137
+ * console.log(`Batch ${result.batchId} applied ${result.changes.length} changes`)
138
+ * ```
139
+ */
140
+ transaction(operations: TransactionOperation[]): Promise<TransactionResult>;
141
+ /**
142
+ * Execute a batch of transaction operations atomically: the preflight +
143
+ * applyNodeBatch fast path when storage supports it, otherwise the
144
+ * legacy per-operation path inside a storage transaction.
145
+ */
146
+ private runTransactionOperationsBatch;
147
+ /**
148
+ * Import deterministic node drafts as signed node changes.
149
+ *
150
+ * This is optimized for importers that already have stable node IDs. It uses
151
+ * one Lamport timestamp and batch ID for the whole import, materializes nodes
152
+ * in memory, then persists final node states and all changes in one storage
153
+ * transaction when the adapter supports it.
154
+ */
155
+ importDeterministicNodes(drafts: readonly DeterministicNodeImportDraft[], options?: ImportDeterministicNodesOptions): Promise<ImportDeterministicNodesResult>;
156
+ batchWrite(input: NodeBatchWriteInput): Promise<NodeBatchWriteResult>;
157
+ private resolveNodeBatchWritePolicy;
158
+ private toImportDeterministicNodesResult;
159
+ private executeOperationNodeBatch;
160
+ private executeDeterministicNodeBatch;
161
+ private resolveDeterministicImportIndexMode;
162
+ private emitDeterministicImportEvents;
163
+ private invalidateAuthForNodes;
164
+ private createDeterministicImportAuthOps;
165
+ private planDeterministicNodeImport;
166
+ private executeDeterministicNodeImport;
167
+ private getNodesById;
168
+ private getBatchPreflight;
169
+ private cloneNodeMap;
170
+ private getLastChangesByNodeId;
171
+ private importMaterializedNodes;
172
+ rebuildIndexesForSchemas(schemaIds: readonly SchemaIRI[]): Promise<void>;
173
+ /**
174
+ * Refresh query-planner statistics (ANALYZE). Call after a bulk import so the
175
+ * first post-import reads use indexes instead of full scans (exploration
176
+ * 0184). No-op when the storage backend doesn't support it.
177
+ */
178
+ analyze(): Promise<void>;
179
+ /**
180
+ * Incremental planner maintenance (`PRAGMA optimize`). Cheap; intended for an
181
+ * idle tick after first paint and before close.
182
+ */
183
+ optimize(): Promise<void>;
184
+ private appendImportedChanges;
185
+ private executeTransactionOperations;
186
+ /**
187
+ * Transaction fast path: one preflight for all touched nodes, in-memory
188
+ * materialization and signing, then one transactional applyNodeBatch.
189
+ * Avoids the per-operation storage round trips of
190
+ * {@link executeTransactionOperations} and the adapter-level
191
+ * withTransaction snapshotting that dominates small interactive
192
+ * transactions.
193
+ */
194
+ private executeTransactionOperationsFast;
195
+ /**
196
+ * Apply a remote change (from sync).
197
+ * Verifies the change signature before applying.
198
+ *
199
+ * @throws Error if signature verification fails
200
+ */
201
+ applyRemoteChange(change: NodeChange): Promise<void>;
202
+ /**
203
+ * Apply multiple remote changes (from sync).
204
+ */
205
+ applyRemoteChanges(changes: NodeChange[]): Promise<void>;
206
+ /**
207
+ * Get all changes for a Node (for sync).
208
+ */
209
+ getChanges(nodeId: NodeId): Promise<NodeChange[]>;
210
+ /**
211
+ * Get all changes (for full sync).
212
+ */
213
+ getAllChanges(): Promise<NodeChange[]>;
214
+ /**
215
+ * Get changes since a Lamport time (for delta sync).
216
+ */
217
+ getChangesSince(sinceLamport: number): Promise<NodeChange[]>;
218
+ /**
219
+ * Per-room sync cursor (confirmed high-water mark). Returns 0 when the
220
+ * storage adapter doesn't persist cursors (degrades to replay-from-0).
221
+ */
222
+ getSyncCursor(room: string): Promise<number>;
223
+ /** Persist the per-room confirmed sync cursor (monotonic in the adapter). */
224
+ setSyncCursor(room: string, lamport: number): Promise<void>;
225
+ /**
226
+ * Get the current Lamport time (for sync protocol).
227
+ */
228
+ getCurrentLamportTime(): number;
229
+ /**
230
+ * Get recent merge conflicts (for debugging/UI).
231
+ */
232
+ getRecentConflicts(): MergeConflict[];
233
+ /**
234
+ * Clear conflict history.
235
+ */
236
+ clearConflicts(): void;
237
+ /**
238
+ * Get CRDT document content for a node.
239
+ * Returns null if no document content exists.
240
+ */
241
+ getDocumentContent(nodeId: NodeId): Promise<Uint8Array | null>;
242
+ /**
243
+ * Set CRDT document content for a node.
244
+ * Used to persist serialized Y.Doc or other CRDT state.
245
+ */
246
+ setDocumentContent(nodeId: NodeId, content: Uint8Array): Promise<void>;
247
+ /**
248
+ * Subscribe to node changes.
249
+ *
250
+ * @param listener - Callback invoked when nodes change
251
+ * @returns Unsubscribe function
252
+ *
253
+ * @example
254
+ * ```ts
255
+ * const unsubscribe = store.subscribe((event) => {
256
+ * console.log('Node changed:', event.node?.id, event.isRemote)
257
+ * })
258
+ * // Later: unsubscribe()
259
+ * ```
260
+ */
261
+ subscribe(listener: NodeChangeListener): () => void;
262
+ /**
263
+ * Subscribe to change events for a single node.
264
+ *
265
+ * Dispatch is O(listeners-for-that-node) instead of O(all-listeners):
266
+ * per-cell/per-row UI hooks should prefer this over filtering the global
267
+ * feed, where every change event invokes every mounted callback.
268
+ */
269
+ subscribeToNode(nodeId: NodeId, listener: NodeChangeListener): () => void;
270
+ subscribeToBatchChanges(listener: NodeBatchChangeListener): () => void;
271
+ private emitDeterministicImportBatch;
272
+ /**
273
+ * Emit a change event to all listeners.
274
+ */
275
+ private emit;
276
+ /**
277
+ * Create a signed change.
278
+ */
279
+ private createChange;
280
+ private signNodeChange;
281
+ /**
282
+ * Create a signed change with batch metadata.
283
+ * Used for transaction support - all changes in a batch share the same
284
+ * batchId, Lamport timestamp, and wallTime.
285
+ */
286
+ private createBatchedChange;
287
+ private createBatchedChangeWithParentHash;
288
+ private createInitialNodeFromChange;
289
+ /**
290
+ * Whether singular writes can use the two-round-trip fast path
291
+ * (preflight + transactional applyNodeBatch). Content ciphers need the
292
+ * legacy per-step path for encrypted snapshot persistence.
293
+ */
294
+ private canUseSingleWriteFastPath;
295
+ /**
296
+ * Singular write fast path: one preflight round trip (existing node +
297
+ * parent change), in-memory materialization and signing, then one
298
+ * transactional applyNodeBatch round trip. Replaces the legacy
299
+ * seven-round-trip getNode/getLastChange/getNode/appendChange/
300
+ * setLastLamportTime/setNode/getNode sequence.
301
+ */
302
+ private applySingleNodeWrite;
303
+ /**
304
+ * Apply a change to storage and update materialized state.
305
+ */
306
+ private applyChange;
307
+ private materializeNodeChange;
308
+ /**
309
+ * Apply one property from a change to a node with LWW conflict
310
+ * resolution, recording any conflict against the existing timestamp.
311
+ * Mutates `node` in place (callers own a fresh clone).
312
+ */
313
+ private applyPropertyChangeWithLWW;
314
+ /**
315
+ * Determine if newTs should replace existingTs (LWW).
316
+ */
317
+ private shouldReplace;
318
+ /**
319
+ * Trim conflicts array to prevent unbounded memory growth.
320
+ * Keeps only the most recent MAX_CONFLICTS entries.
321
+ */
322
+ private trimConflicts;
323
+ private assertAuthorized;
324
+ private canReadNode;
325
+ private filterReadableNodes;
326
+ /**
327
+ * Whether storage can safely materialize a view under read authorization
328
+ * (exploration 0226): it must both accept the read authorizer (to authorize
329
+ * the id list at refresh) and expose a reload-stable authorization-state
330
+ * version (to fingerprint cache validity). When either is missing the store
331
+ * falls back to the authorize-then-paginate path, which never caches.
332
+ */
333
+ private materializedAuthSupported;
334
+ /**
335
+ * A reload-stable fingerprint of the viewer's authorization context, folded
336
+ * from the subject DID and the control-plane (grant) state version. Stamped
337
+ * onto a materialized view so any grant change forces an `'authz-changed'`
338
+ * refresh — the cache can never serve rows a revoked viewer may no longer
339
+ * read. Returns `undefined` when authorization is off (materialized views run
340
+ * untouched, as in the trusted single-user case).
341
+ */
342
+ private authFingerprint;
343
+ private applyListPagination;
344
+ private getQueryFallbackReason;
345
+ private assertAuthorizedBatch;
346
+ private inferActionFromChange;
347
+ private shouldRecomputeRecipients;
348
+ private persistEncryptedNodeSnapshot;
349
+ private decryptNodeSnapshotIfPresent;
350
+ private serializeNodeSnapshot;
351
+ private deserializeNodeSnapshot;
352
+ private parseEncryptedNodeSnapshot;
353
+ }
354
+
355
+ export { NodeStore as N };
@@ -0,0 +1,69 @@
1
+ import { Doc } from 'yjs';
2
+ import { Awareness } from 'y-protocols/awareness';
3
+
4
+ /**
5
+ * Awareness/presence tracking for collaborative editing
6
+ */
7
+
8
+ /**
9
+ * User presence information
10
+ */
11
+ interface UserPresence {
12
+ did: string;
13
+ name: string;
14
+ color: string;
15
+ cursor?: CursorPosition;
16
+ selection?: SelectionRange;
17
+ }
18
+ /**
19
+ * Cursor position in a document
20
+ */
21
+ interface CursorPosition {
22
+ blockId: string;
23
+ offset: number;
24
+ }
25
+ /**
26
+ * Selection range in a document
27
+ */
28
+ interface SelectionRange {
29
+ anchor: CursorPosition;
30
+ head: CursorPosition;
31
+ }
32
+ /**
33
+ * Create an awareness instance for a document
34
+ */
35
+ declare function createAwareness(doc: Doc): Awareness;
36
+ /**
37
+ * Set local user presence
38
+ */
39
+ declare function setLocalPresence(awareness: Awareness, presence: UserPresence): void;
40
+ /**
41
+ * Clear local user presence
42
+ */
43
+ declare function clearLocalPresence(awareness: Awareness): void;
44
+ /**
45
+ * Get remote user presences
46
+ */
47
+ declare function getRemotePresences(awareness: Awareness): Map<number, UserPresence>;
48
+ /**
49
+ * Get all presences including local
50
+ */
51
+ declare function getAllPresences(awareness: Awareness): Map<number, UserPresence>;
52
+ /**
53
+ * Subscribe to presence changes
54
+ */
55
+ declare function onPresenceChange(awareness: Awareness, callback: (changes: {
56
+ added: number[];
57
+ updated: number[];
58
+ removed: number[];
59
+ }) => void): () => void;
60
+ /**
61
+ * Get local client ID
62
+ */
63
+ declare function getLocalClientId(awareness: Awareness): number;
64
+ /**
65
+ * Generate a random color for user presence
66
+ */
67
+ declare function generateUserColor(): string;
68
+
69
+ export { type CursorPosition, type SelectionRange, type UserPresence, clearLocalPresence, createAwareness, generateUserColor, getAllPresences, getLocalClientId, getRemotePresences, onPresenceChange, setLocalPresence };
@@ -0,0 +1,20 @@
1
+ import {
2
+ clearLocalPresence,
3
+ createAwareness,
4
+ generateUserColor,
5
+ getAllPresences,
6
+ getLocalClientId,
7
+ getRemotePresences,
8
+ onPresenceChange,
9
+ setLocalPresence
10
+ } from "../chunk-7PDRDSFH.js";
11
+ export {
12
+ clearLocalPresence,
13
+ createAwareness,
14
+ generateUserColor,
15
+ getAllPresences,
16
+ getLocalClientId,
17
+ getRemotePresences,
18
+ onPresenceChange,
19
+ setLocalPresence
20
+ };
@@ -0,0 +1,38 @@
1
+ import {
2
+ PresenceSummarySchema,
3
+ SYSTEM_NAMESPACE_KINDS,
4
+ SYSTEM_SCHEMA_BASE_IRIS,
5
+ SYSTEM_SCHEMA_IRIS,
6
+ SchemaCompatibilitySchema,
7
+ SchemaDefinitionSchema,
8
+ SyncPolicySchema,
9
+ buildSystemNamespace,
10
+ buildSystemNodeId,
11
+ computeSchemaDefinitionContentHash,
12
+ createSchemaDefinitionSigningPayload,
13
+ isSystemNamespaceResource,
14
+ isSystemSchemaIri,
15
+ parseSystemNamespaceResource,
16
+ resolveSchemaAuthority,
17
+ validateSchemaDefinitionNode
18
+ } from "./chunk-BY5O6LNC.js";
19
+ import "./chunk-EBNMV2VO.js";
20
+ import "./chunk-RL64OJJ5.js";
21
+ export {
22
+ PresenceSummarySchema,
23
+ SYSTEM_NAMESPACE_KINDS,
24
+ SYSTEM_SCHEMA_BASE_IRIS,
25
+ SYSTEM_SCHEMA_IRIS,
26
+ SchemaCompatibilitySchema,
27
+ SchemaDefinitionSchema,
28
+ SyncPolicySchema,
29
+ buildSystemNamespace,
30
+ buildSystemNodeId,
31
+ computeSchemaDefinitionContentHash,
32
+ createSchemaDefinitionSigningPayload,
33
+ isSystemNamespaceResource,
34
+ isSystemSchemaIri,
35
+ parseSystemNamespaceResource,
36
+ resolveSchemaAuthority,
37
+ validateSchemaDefinitionNode
38
+ };
@@ -0,0 +1,16 @@
1
+ import {
2
+ MAX_TAG_NAME_LENGTH,
3
+ TAG_SCHEMA_IRI,
4
+ TagSchema,
5
+ isValidTagName,
6
+ normalizeTagName
7
+ } from "./chunk-6KLGA6IR.js";
8
+ import "./chunk-EBNMV2VO.js";
9
+ import "./chunk-RL64OJJ5.js";
10
+ export {
11
+ MAX_TAG_NAME_LENGTH,
12
+ TAG_SCHEMA_IRI,
13
+ TagSchema,
14
+ isValidTagName,
15
+ normalizeTagName
16
+ };
@@ -0,0 +1,16 @@
1
+ import {
2
+ TASK_STATUS_CATEGORIES,
3
+ TaskSchema,
4
+ getTaskStatusCategory,
5
+ isCompletedTaskStatus
6
+ } from "./chunk-UQM3G5A2.js";
7
+ import "./chunk-OCMSAKWV.js";
8
+ import "./chunk-T5AZAOG5.js";
9
+ import "./chunk-EBNMV2VO.js";
10
+ import "./chunk-RL64OJJ5.js";
11
+ export {
12
+ TASK_STATUS_CATEGORIES,
13
+ TaskSchema,
14
+ getTaskStatusCategory,
15
+ isCompletedTaskStatus
16
+ };
@@ -0,0 +1,10 @@
1
+ import {
2
+ TaskViewSchema
3
+ } from "./chunk-4EYKGTSQ.js";
4
+ import "./chunk-OCMSAKWV.js";
5
+ import "./chunk-T5AZAOG5.js";
6
+ import "./chunk-EBNMV2VO.js";
7
+ import "./chunk-RL64OJJ5.js";
8
+ export {
9
+ TaskViewSchema
10
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ TRANSACTION_SCHEMA_IRI,
3
+ TransactionSchema
4
+ } from "./chunk-MBTUO3ZL.js";
5
+ import "./chunk-OCMSAKWV.js";
6
+ import "./chunk-T5AZAOG5.js";
7
+ import "./chunk-EBNMV2VO.js";
8
+ import "./chunk-RL64OJJ5.js";
9
+ export {
10
+ TRANSACTION_SCHEMA_IRI,
11
+ TransactionSchema
12
+ };
@@ -0,0 +1,12 @@
1
+ import {
2
+ TRANSCRIPTION_SCHEMA_IRI,
3
+ TranscriptionSchema
4
+ } from "./chunk-2ZNJWIQG.js";
5
+ import "./chunk-OCMSAKWV.js";
6
+ import "./chunk-T5AZAOG5.js";
7
+ import "./chunk-EBNMV2VO.js";
8
+ import "./chunk-RL64OJJ5.js";
9
+ export {
10
+ TRANSCRIPTION_SCHEMA_IRI,
11
+ TranscriptionSchema
12
+ };