@affectively/aeon 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +342 -342
  3. package/dist/compression/index.cjs.map +1 -1
  4. package/dist/compression/index.js.map +1 -1
  5. package/dist/core/index.d.cts +213 -208
  6. package/dist/core/index.d.ts +213 -208
  7. package/dist/crypto/index.cjs.map +1 -1
  8. package/dist/crypto/index.d.cts +441 -402
  9. package/dist/crypto/index.d.ts +441 -402
  10. package/dist/crypto/index.js.map +1 -1
  11. package/dist/distributed/index.cjs +8 -2
  12. package/dist/distributed/index.cjs.map +1 -1
  13. package/dist/distributed/index.d.cts +1005 -890
  14. package/dist/distributed/index.d.ts +1005 -890
  15. package/dist/distributed/index.js +8 -2
  16. package/dist/distributed/index.js.map +1 -1
  17. package/dist/index.cjs +58 -733
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +50 -5
  20. package/dist/index.d.ts +50 -5
  21. package/dist/index.js +55 -732
  22. package/dist/index.js.map +1 -1
  23. package/dist/offline/index.cjs.map +1 -1
  24. package/dist/offline/index.d.cts +148 -142
  25. package/dist/offline/index.d.ts +148 -142
  26. package/dist/offline/index.js.map +1 -1
  27. package/dist/optimization/index.cjs.map +1 -1
  28. package/dist/optimization/index.js.map +1 -1
  29. package/dist/persistence/index.cjs.map +1 -1
  30. package/dist/persistence/index.d.cts +57 -57
  31. package/dist/persistence/index.d.ts +57 -57
  32. package/dist/persistence/index.js.map +1 -1
  33. package/dist/presence/index.cjs.map +1 -1
  34. package/dist/presence/index.js.map +1 -1
  35. package/dist/{types-CMxO7QF0.d.cts → types-B7CxsoLh.d.cts} +30 -30
  36. package/dist/{types-CMxO7QF0.d.ts → types-B7CxsoLh.d.ts} +30 -30
  37. package/dist/utils/index.cjs.map +1 -1
  38. package/dist/utils/index.d.cts +35 -35
  39. package/dist/utils/index.d.ts +35 -35
  40. package/dist/utils/index.js.map +1 -1
  41. package/dist/versioning/index.cjs +18 -8
  42. package/dist/versioning/index.cjs.map +1 -1
  43. package/dist/versioning/index.d.cts +1 -1
  44. package/dist/versioning/index.d.ts +1 -1
  45. package/dist/versioning/index.js +18 -8
  46. package/dist/versioning/index.js.map +1 -1
  47. package/package.json +196 -192
@@ -1,211 +1,216 @@
1
- /**
2
- * Aeon Core Types
3
- *
4
- * Shared type definitions for the Aeon synchronization and versioning system.
5
- */
6
- /**
7
- * Operation type - what action is being performed
8
- */
9
- type OperationType = 'create' | 'update' | 'delete' | 'sync' | 'batch';
10
- /**
11
- * Operation priority for sync ordering
12
- */
13
- type OperationPriority = 'high' | 'normal' | 'low';
14
- /**
15
- * Operation sync status
16
- */
17
- type OperationStatus = 'pending' | 'syncing' | 'synced' | 'failed';
18
- /**
19
- * Queued operation for offline-first synchronization
20
- */
21
- interface Operation {
22
- id: string;
23
- type: OperationType;
24
- sessionId: string;
25
- status: OperationStatus;
26
- data: Record<string, unknown>;
27
- priority?: OperationPriority;
28
- createdAt?: number;
29
- syncedAt?: number;
30
- retryCount?: number;
31
- maxRetries?: number;
32
- }
33
- /**
34
- * Conflict detection result
35
- */
36
- interface ConflictDetectionResult {
37
- hasConflict: boolean;
38
- type?: 'update_update' | 'delete_update' | 'update_delete' | 'concurrent';
39
- severity?: 'low' | 'medium' | 'high';
40
- similarity?: number;
41
- }
42
- /**
43
- * Conflict resolution strategy
44
- */
45
- type ResolutionStrategy = 'local_wins' | 'remote_wins' | 'last_modified' | 'merge' | 'manual';
46
- /**
47
- * Sync batch for uploading multiple operations
48
- */
49
- interface SyncBatch {
50
- batchId: string;
51
- operations: Operation[];
52
- totalSize: number;
53
- createdAt: number;
54
- priority: OperationPriority;
55
- }
56
- /**
57
- * Sync result from server
58
- */
59
- interface SyncResult {
60
- success: boolean;
61
- synced: string[];
62
- failed: Array<{
63
- operationId: string;
64
- error: string;
65
- }>;
66
- conflicts: Array<{
67
- operationId: string;
68
- remoteVersion: Record<string, unknown>;
69
- strategy: ResolutionStrategy;
70
- }>;
71
- }
72
- /**
73
- * Network state for adaptive sync
74
- */
75
- type NetworkState = 'online' | 'offline' | 'poor' | 'unknown';
76
- /**
77
- * Bandwidth profile for sync adaptation
78
- */
79
- interface BandwidthProfile {
80
- bandwidth: number;
81
- latency: number;
82
- timestamp: number;
83
- reliability: number;
84
- }
85
- /**
86
- * Sync coordinator configuration
87
- */
88
- interface SyncCoordinatorConfig {
89
- maxBatchSize: number;
90
- maxBatchBytes: number;
91
- maxRetries: number;
92
- retryDelayMs: number;
93
- enableCompression: boolean;
94
- enableDeltaSync: boolean;
95
- adaptateBatchSize: boolean;
96
- }
97
- /**
98
- * Vector clock for causality tracking
99
- */
100
- interface VectorClock {
101
- [nodeId: string]: number;
102
- }
103
- /**
104
- * CRDT operation for conflict-free updates
105
- */
106
- interface CRDTOperation {
107
- id: string;
108
- type: 'insert' | 'delete' | 'update';
109
- path: string[];
110
- value?: unknown;
111
- timestamp: number;
112
- nodeId: string;
113
- vectorClock: VectorClock;
114
- }
115
- /**
116
- * Presence selection range
117
- */
118
- interface PresenceSelection {
119
- start: number;
120
- end: number;
121
- direction?: 'forward' | 'backward' | 'none';
122
- path?: string;
123
- }
124
- /**
125
- * Presence typing signal
126
- */
127
- interface PresenceTyping {
128
- isTyping: boolean;
129
- field?: string;
130
- isComposing?: boolean;
131
- startedAt?: number;
132
- stoppedAt?: number;
133
- }
134
- /**
135
- * Presence scroll signal
136
- */
137
- interface PresenceScroll {
138
- depth: number;
139
- y?: number;
140
- viewportHeight?: number;
141
- documentHeight?: number;
142
- path?: string;
143
- }
144
- /**
145
- * Presence viewport signal
146
- */
147
- interface PresenceViewport {
148
- width: number;
149
- height: number;
150
- }
151
- /**
152
- * Presence input signal
153
- */
154
- interface PresenceInputState {
155
- field: string;
156
- hasFocus: boolean;
157
- valueLength?: number;
158
- selectionStart?: number;
159
- selectionEnd?: number;
160
- isComposing?: boolean;
161
- inputMode?: string;
162
- }
163
- /**
164
- * Presence emotional state signal
165
- */
166
- interface PresenceEmotion {
167
- primary?: string;
168
- secondary?: string;
169
- confidence?: number;
170
- intensity?: number;
171
- valence?: number;
172
- arousal?: number;
173
- dominance?: number;
174
- source?: 'self-report' | 'inferred' | 'sensor' | 'hybrid';
175
- updatedAt?: number;
176
- }
177
- /**
178
- * Presence information for real-time collaboration
179
- */
180
- interface PresenceInfo {
181
- userId: string;
182
- nodeId: string;
183
- cursor?: {
184
- x: number;
185
- y: number;
186
- };
187
- focusNode?: string;
188
- selection?: PresenceSelection;
189
- typing?: PresenceTyping;
190
- scroll?: PresenceScroll;
191
- viewport?: PresenceViewport;
192
- inputState?: PresenceInputState;
193
- emotion?: PresenceEmotion;
194
- metadata?: Record<string, unknown>;
195
- lastActivity: number;
196
- }
197
- /**
198
- * Event emitter types
199
- */
200
- type EventCallback<T = unknown> = (data: T) => void;
201
- type EventUnsubscribe = () => void;
202
- /**
203
- * Generic event emitter interface
204
- */
205
- interface IEventEmitter {
206
- on<T = unknown>(event: string, callback: EventCallback<T>): EventUnsubscribe;
207
- off(event: string, callback: EventCallback): void;
208
- emit<T = unknown>(event: string, data?: T): void;
1
+ /**
2
+ * Aeon Core Types
3
+ *
4
+ * Shared type definitions for the Aeon synchronization and versioning system.
5
+ */
6
+ /**
7
+ * Operation type - what action is being performed
8
+ */
9
+ type OperationType = 'create' | 'update' | 'delete' | 'sync' | 'batch';
10
+ /**
11
+ * Operation priority for sync ordering
12
+ */
13
+ type OperationPriority = 'high' | 'normal' | 'low';
14
+ /**
15
+ * Operation sync status
16
+ */
17
+ type OperationStatus = 'pending' | 'syncing' | 'synced' | 'failed';
18
+ /**
19
+ * Queued operation for offline-first synchronization
20
+ */
21
+ interface Operation {
22
+ id: string;
23
+ type: OperationType;
24
+ sessionId: string;
25
+ status: OperationStatus;
26
+ data: Record<string, unknown>;
27
+ priority?: OperationPriority;
28
+ createdAt?: number;
29
+ syncedAt?: number;
30
+ retryCount?: number;
31
+ maxRetries?: number;
32
+ }
33
+ /**
34
+ * Conflict detection result
35
+ */
36
+ interface ConflictDetectionResult {
37
+ hasConflict: boolean;
38
+ type?: 'update_update' | 'delete_update' | 'update_delete' | 'concurrent';
39
+ severity?: 'low' | 'medium' | 'high';
40
+ similarity?: number;
41
+ }
42
+ /**
43
+ * Conflict resolution strategy
44
+ */
45
+ type ResolutionStrategy =
46
+ | 'local_wins'
47
+ | 'remote_wins'
48
+ | 'last_modified'
49
+ | 'merge'
50
+ | 'manual';
51
+ /**
52
+ * Sync batch for uploading multiple operations
53
+ */
54
+ interface SyncBatch {
55
+ batchId: string;
56
+ operations: Operation[];
57
+ totalSize: number;
58
+ createdAt: number;
59
+ priority: OperationPriority;
60
+ }
61
+ /**
62
+ * Sync result from server
63
+ */
64
+ interface SyncResult {
65
+ success: boolean;
66
+ synced: string[];
67
+ failed: Array<{
68
+ operationId: string;
69
+ error: string;
70
+ }>;
71
+ conflicts: Array<{
72
+ operationId: string;
73
+ remoteVersion: Record<string, unknown>;
74
+ strategy: ResolutionStrategy;
75
+ }>;
76
+ }
77
+ /**
78
+ * Network state for adaptive sync
79
+ */
80
+ type NetworkState = 'online' | 'offline' | 'poor' | 'unknown';
81
+ /**
82
+ * Bandwidth profile for sync adaptation
83
+ */
84
+ interface BandwidthProfile {
85
+ bandwidth: number;
86
+ latency: number;
87
+ timestamp: number;
88
+ reliability: number;
89
+ }
90
+ /**
91
+ * Sync coordinator configuration
92
+ */
93
+ interface SyncCoordinatorConfig {
94
+ maxBatchSize: number;
95
+ maxBatchBytes: number;
96
+ maxRetries: number;
97
+ retryDelayMs: number;
98
+ enableCompression: boolean;
99
+ enableDeltaSync: boolean;
100
+ adaptateBatchSize: boolean;
101
+ }
102
+ /**
103
+ * Vector clock for causality tracking
104
+ */
105
+ interface VectorClock {
106
+ [nodeId: string]: number;
107
+ }
108
+ /**
109
+ * CRDT operation for conflict-free updates
110
+ */
111
+ interface CRDTOperation {
112
+ id: string;
113
+ type: 'insert' | 'delete' | 'update';
114
+ path: string[];
115
+ value?: unknown;
116
+ timestamp: number;
117
+ nodeId: string;
118
+ vectorClock: VectorClock;
119
+ }
120
+ /**
121
+ * Presence selection range
122
+ */
123
+ interface PresenceSelection {
124
+ start: number;
125
+ end: number;
126
+ direction?: 'forward' | 'backward' | 'none';
127
+ path?: string;
128
+ }
129
+ /**
130
+ * Presence typing signal
131
+ */
132
+ interface PresenceTyping {
133
+ isTyping: boolean;
134
+ field?: string;
135
+ isComposing?: boolean;
136
+ startedAt?: number;
137
+ stoppedAt?: number;
138
+ }
139
+ /**
140
+ * Presence scroll signal
141
+ */
142
+ interface PresenceScroll {
143
+ depth: number;
144
+ y?: number;
145
+ viewportHeight?: number;
146
+ documentHeight?: number;
147
+ path?: string;
148
+ }
149
+ /**
150
+ * Presence viewport signal
151
+ */
152
+ interface PresenceViewport {
153
+ width: number;
154
+ height: number;
155
+ }
156
+ /**
157
+ * Presence input signal
158
+ */
159
+ interface PresenceInputState {
160
+ field: string;
161
+ hasFocus: boolean;
162
+ valueLength?: number;
163
+ selectionStart?: number;
164
+ selectionEnd?: number;
165
+ isComposing?: boolean;
166
+ inputMode?: string;
167
+ }
168
+ /**
169
+ * Presence emotional state signal
170
+ */
171
+ interface PresenceEmotion {
172
+ primary?: string;
173
+ secondary?: string;
174
+ confidence?: number;
175
+ intensity?: number;
176
+ valence?: number;
177
+ arousal?: number;
178
+ dominance?: number;
179
+ source?: 'self-report' | 'inferred' | 'sensor' | 'hybrid';
180
+ updatedAt?: number;
181
+ }
182
+ /**
183
+ * Presence information for real-time collaboration
184
+ */
185
+ interface PresenceInfo {
186
+ userId: string;
187
+ nodeId: string;
188
+ cursor?: {
189
+ x: number;
190
+ y: number;
191
+ };
192
+ focusNode?: string;
193
+ selection?: PresenceSelection;
194
+ typing?: PresenceTyping;
195
+ scroll?: PresenceScroll;
196
+ viewport?: PresenceViewport;
197
+ inputState?: PresenceInputState;
198
+ emotion?: PresenceEmotion;
199
+ metadata?: Record<string, unknown>;
200
+ lastActivity: number;
201
+ }
202
+ /**
203
+ * Event emitter types
204
+ */
205
+ type EventCallback<T = unknown> = (data: T) => void;
206
+ type EventUnsubscribe = () => void;
207
+ /**
208
+ * Generic event emitter interface
209
+ */
210
+ interface IEventEmitter {
211
+ on<T = unknown>(event: string, callback: EventCallback<T>): EventUnsubscribe;
212
+ off(event: string, callback: EventCallback): void;
213
+ emit<T = unknown>(event: string, data?: T): void;
209
214
  }
210
215
 
211
216
  export type { BandwidthProfile, CRDTOperation, ConflictDetectionResult, EventCallback, EventUnsubscribe, IEventEmitter, NetworkState, Operation, OperationPriority, OperationStatus, OperationType, PresenceEmotion, PresenceInfo, PresenceInputState, PresenceScroll, PresenceSelection, PresenceTyping, PresenceViewport, ResolutionStrategy, SyncBatch, SyncCoordinatorConfig, SyncResult, VectorClock };