@affectively/aeon 1.1.0 → 1.2.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.
- package/dist/core/index.d.cts +70 -5
- package/dist/core/index.d.ts +70 -5
- package/dist/index.cjs +151 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +151 -0
- package/dist/index.js.map +1 -1
- package/dist/presence/index.cjs +151 -0
- package/dist/presence/index.cjs.map +1 -1
- package/dist/presence/index.d.cts +116 -1
- package/dist/presence/index.d.ts +116 -1
- package/dist/presence/index.js +151 -0
- package/dist/presence/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -112,6 +112,68 @@ interface CRDTOperation {
|
|
|
112
112
|
nodeId: string;
|
|
113
113
|
vectorClock: VectorClock;
|
|
114
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
|
+
}
|
|
115
177
|
/**
|
|
116
178
|
* Presence information for real-time collaboration
|
|
117
179
|
*/
|
|
@@ -122,10 +184,13 @@ interface PresenceInfo {
|
|
|
122
184
|
x: number;
|
|
123
185
|
y: number;
|
|
124
186
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
187
|
+
focusNode?: string;
|
|
188
|
+
selection?: PresenceSelection;
|
|
189
|
+
typing?: PresenceTyping;
|
|
190
|
+
scroll?: PresenceScroll;
|
|
191
|
+
viewport?: PresenceViewport;
|
|
192
|
+
inputState?: PresenceInputState;
|
|
193
|
+
emotion?: PresenceEmotion;
|
|
129
194
|
metadata?: Record<string, unknown>;
|
|
130
195
|
lastActivity: number;
|
|
131
196
|
}
|
|
@@ -143,4 +208,4 @@ interface IEventEmitter {
|
|
|
143
208
|
emit<T = unknown>(event: string, data?: T): void;
|
|
144
209
|
}
|
|
145
210
|
|
|
146
|
-
export type { BandwidthProfile, CRDTOperation, ConflictDetectionResult, EventCallback, EventUnsubscribe, IEventEmitter, NetworkState, Operation, OperationPriority, OperationStatus, OperationType, PresenceInfo, ResolutionStrategy, SyncBatch, SyncCoordinatorConfig, SyncResult, VectorClock };
|
|
211
|
+
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 };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -112,6 +112,68 @@ interface CRDTOperation {
|
|
|
112
112
|
nodeId: string;
|
|
113
113
|
vectorClock: VectorClock;
|
|
114
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
|
+
}
|
|
115
177
|
/**
|
|
116
178
|
* Presence information for real-time collaboration
|
|
117
179
|
*/
|
|
@@ -122,10 +184,13 @@ interface PresenceInfo {
|
|
|
122
184
|
x: number;
|
|
123
185
|
y: number;
|
|
124
186
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
187
|
+
focusNode?: string;
|
|
188
|
+
selection?: PresenceSelection;
|
|
189
|
+
typing?: PresenceTyping;
|
|
190
|
+
scroll?: PresenceScroll;
|
|
191
|
+
viewport?: PresenceViewport;
|
|
192
|
+
inputState?: PresenceInputState;
|
|
193
|
+
emotion?: PresenceEmotion;
|
|
129
194
|
metadata?: Record<string, unknown>;
|
|
130
195
|
lastActivity: number;
|
|
131
196
|
}
|
|
@@ -143,4 +208,4 @@ interface IEventEmitter {
|
|
|
143
208
|
emit<T = unknown>(event: string, data?: T): void;
|
|
144
209
|
}
|
|
145
210
|
|
|
146
|
-
export type { BandwidthProfile, CRDTOperation, ConflictDetectionResult, EventCallback, EventUnsubscribe, IEventEmitter, NetworkState, Operation, OperationPriority, OperationStatus, OperationType, PresenceInfo, ResolutionStrategy, SyncBatch, SyncCoordinatorConfig, SyncResult, VectorClock };
|
|
211
|
+
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 };
|
package/dist/index.cjs
CHANGED
|
@@ -5341,6 +5341,157 @@ var AgentPresenceManager = class extends eventemitter3.EventEmitter {
|
|
|
5341
5341
|
});
|
|
5342
5342
|
}
|
|
5343
5343
|
}
|
|
5344
|
+
/**
|
|
5345
|
+
* Update focused node path
|
|
5346
|
+
*/
|
|
5347
|
+
updateFocusNode(agentId, nodePath) {
|
|
5348
|
+
const presence = this.presences.get(agentId);
|
|
5349
|
+
if (presence) {
|
|
5350
|
+
presence.focusNode = nodePath;
|
|
5351
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5352
|
+
this.presences.set(agentId, presence);
|
|
5353
|
+
this.emit("focus_updated", {
|
|
5354
|
+
agentId,
|
|
5355
|
+
focusNode: nodePath
|
|
5356
|
+
});
|
|
5357
|
+
}
|
|
5358
|
+
}
|
|
5359
|
+
/**
|
|
5360
|
+
* Update text selection range
|
|
5361
|
+
*/
|
|
5362
|
+
updateSelection(agentId, selectionRange) {
|
|
5363
|
+
const presence = this.presences.get(agentId);
|
|
5364
|
+
if (presence) {
|
|
5365
|
+
presence.selectionRange = selectionRange;
|
|
5366
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5367
|
+
this.presences.set(agentId, presence);
|
|
5368
|
+
this.emit("selection_updated", {
|
|
5369
|
+
agentId,
|
|
5370
|
+
selectionRange
|
|
5371
|
+
});
|
|
5372
|
+
}
|
|
5373
|
+
}
|
|
5374
|
+
/**
|
|
5375
|
+
* Update typing state
|
|
5376
|
+
*/
|
|
5377
|
+
updateTyping(agentId, isTyping, field, isComposing = false) {
|
|
5378
|
+
const presence = this.presences.get(agentId);
|
|
5379
|
+
if (presence) {
|
|
5380
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
5381
|
+
const previous = presence.typingState;
|
|
5382
|
+
const typingState = {
|
|
5383
|
+
isTyping,
|
|
5384
|
+
field,
|
|
5385
|
+
isComposing,
|
|
5386
|
+
startedAt: isTyping && !previous?.isTyping ? now : isTyping ? previous?.startedAt : void 0,
|
|
5387
|
+
stoppedAt: isTyping ? void 0 : now
|
|
5388
|
+
};
|
|
5389
|
+
presence.typingState = typingState;
|
|
5390
|
+
presence.lastSeen = now;
|
|
5391
|
+
this.presences.set(agentId, presence);
|
|
5392
|
+
this.emit("typing_updated", {
|
|
5393
|
+
agentId,
|
|
5394
|
+
typingState
|
|
5395
|
+
});
|
|
5396
|
+
}
|
|
5397
|
+
}
|
|
5398
|
+
/**
|
|
5399
|
+
* Update scroll state
|
|
5400
|
+
*/
|
|
5401
|
+
updateScroll(agentId, scrollState) {
|
|
5402
|
+
const presence = this.presences.get(agentId);
|
|
5403
|
+
if (presence) {
|
|
5404
|
+
presence.scrollState = {
|
|
5405
|
+
...scrollState,
|
|
5406
|
+
depth: Math.max(0, Math.min(1, scrollState.depth))
|
|
5407
|
+
};
|
|
5408
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5409
|
+
this.presences.set(agentId, presence);
|
|
5410
|
+
this.emit("scroll_updated", {
|
|
5411
|
+
agentId,
|
|
5412
|
+
scrollState: presence.scrollState
|
|
5413
|
+
});
|
|
5414
|
+
}
|
|
5415
|
+
}
|
|
5416
|
+
/**
|
|
5417
|
+
* Update viewport size
|
|
5418
|
+
*/
|
|
5419
|
+
updateViewport(agentId, width, height) {
|
|
5420
|
+
const presence = this.presences.get(agentId);
|
|
5421
|
+
if (presence) {
|
|
5422
|
+
presence.viewport = { width, height };
|
|
5423
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5424
|
+
this.presences.set(agentId, presence);
|
|
5425
|
+
this.emit("viewport_updated", {
|
|
5426
|
+
agentId,
|
|
5427
|
+
viewport: presence.viewport
|
|
5428
|
+
});
|
|
5429
|
+
}
|
|
5430
|
+
}
|
|
5431
|
+
/**
|
|
5432
|
+
* Update input state
|
|
5433
|
+
*/
|
|
5434
|
+
updateInputState(agentId, inputState) {
|
|
5435
|
+
const presence = this.presences.get(agentId);
|
|
5436
|
+
if (presence) {
|
|
5437
|
+
presence.inputState = inputState;
|
|
5438
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5439
|
+
this.presences.set(agentId, presence);
|
|
5440
|
+
this.emit("input_state_updated", {
|
|
5441
|
+
agentId,
|
|
5442
|
+
inputState
|
|
5443
|
+
});
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
/**
|
|
5447
|
+
* Clear input state
|
|
5448
|
+
*/
|
|
5449
|
+
clearInputState(agentId) {
|
|
5450
|
+
const presence = this.presences.get(agentId);
|
|
5451
|
+
if (presence) {
|
|
5452
|
+
presence.inputState = void 0;
|
|
5453
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5454
|
+
this.presences.set(agentId, presence);
|
|
5455
|
+
this.emit("input_state_updated", {
|
|
5456
|
+
agentId,
|
|
5457
|
+
inputState: void 0
|
|
5458
|
+
});
|
|
5459
|
+
}
|
|
5460
|
+
}
|
|
5461
|
+
/**
|
|
5462
|
+
* Update emotional state
|
|
5463
|
+
*/
|
|
5464
|
+
updateEmotionState(agentId, emotionState) {
|
|
5465
|
+
const presence = this.presences.get(agentId);
|
|
5466
|
+
if (presence) {
|
|
5467
|
+
const enrichedState = {
|
|
5468
|
+
...emotionState,
|
|
5469
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
5470
|
+
};
|
|
5471
|
+
presence.emotionState = enrichedState;
|
|
5472
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5473
|
+
this.presences.set(agentId, presence);
|
|
5474
|
+
this.emit("emotion_updated", {
|
|
5475
|
+
agentId,
|
|
5476
|
+
emotionState: enrichedState
|
|
5477
|
+
});
|
|
5478
|
+
}
|
|
5479
|
+
}
|
|
5480
|
+
/**
|
|
5481
|
+
* Clear emotional state
|
|
5482
|
+
*/
|
|
5483
|
+
clearEmotionState(agentId) {
|
|
5484
|
+
const presence = this.presences.get(agentId);
|
|
5485
|
+
if (presence) {
|
|
5486
|
+
presence.emotionState = void 0;
|
|
5487
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5488
|
+
this.presences.set(agentId, presence);
|
|
5489
|
+
this.emit("emotion_updated", {
|
|
5490
|
+
agentId,
|
|
5491
|
+
emotionState: void 0
|
|
5492
|
+
});
|
|
5493
|
+
}
|
|
5494
|
+
}
|
|
5344
5495
|
/**
|
|
5345
5496
|
* Update status
|
|
5346
5497
|
*/
|