@affectively/aeon 1.3.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.
- package/LICENSE +21 -21
- package/README.md +342 -342
- package/dist/compression/index.cjs.map +1 -1
- package/dist/compression/index.js.map +1 -1
- package/dist/core/index.d.cts +213 -213
- package/dist/core/index.d.ts +213 -213
- package/dist/crypto/index.cjs.map +1 -1
- package/dist/crypto/index.d.cts +441 -441
- package/dist/crypto/index.d.ts +441 -441
- package/dist/crypto/index.js.map +1 -1
- package/dist/distributed/index.cjs.map +1 -1
- package/dist/distributed/index.d.cts +1005 -1005
- package/dist/distributed/index.d.ts +1005 -1005
- package/dist/distributed/index.js.map +1 -1
- package/dist/index.cjs +32 -723
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -5
- package/dist/index.d.ts +50 -5
- package/dist/index.js +29 -722
- package/dist/index.js.map +1 -1
- package/dist/offline/index.cjs.map +1 -1
- package/dist/offline/index.d.cts +148 -148
- package/dist/offline/index.d.ts +148 -148
- package/dist/offline/index.js.map +1 -1
- package/dist/optimization/index.cjs.map +1 -1
- package/dist/optimization/index.js.map +1 -1
- package/dist/persistence/index.cjs.map +1 -1
- package/dist/persistence/index.d.cts +57 -57
- package/dist/persistence/index.d.ts +57 -57
- package/dist/persistence/index.js.map +1 -1
- package/dist/presence/index.cjs.map +1 -1
- package/dist/presence/index.js.map +1 -1
- package/dist/{types-B7gCpNX9.d.cts → types-B7CxsoLh.d.cts} +30 -30
- package/dist/{types-B7gCpNX9.d.ts → types-B7CxsoLh.d.ts} +30 -30
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +35 -35
- package/dist/utils/index.d.ts +35 -35
- package/dist/utils/index.js.map +1 -1
- package/dist/versioning/index.cjs.map +1 -1
- package/dist/versioning/index.d.cts +1 -1
- package/dist/versioning/index.d.ts +1 -1
- package/dist/versioning/index.js.map +1 -1
- package/package.json +196 -196
package/dist/core/index.d.cts
CHANGED
|
@@ -1,216 +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 =
|
|
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;
|
|
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;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
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 };
|