@affectively/aeon 1.1.0 → 1.3.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/compression/index.cjs.map +1 -1
- package/dist/compression/index.js.map +1 -1
- package/dist/core/index.d.cts +136 -66
- package/dist/core/index.d.ts +136 -66
- package/dist/crypto/index.cjs.map +1 -1
- package/dist/crypto/index.d.cts +310 -271
- package/dist/crypto/index.d.ts +310 -271
- package/dist/crypto/index.js.map +1 -1
- package/dist/distributed/index.cjs +8 -2
- package/dist/distributed/index.cjs.map +1 -1
- package/dist/distributed/index.d.cts +871 -756
- package/dist/distributed/index.d.ts +871 -756
- package/dist/distributed/index.js +8 -2
- package/dist/distributed/index.js.map +1 -1
- package/dist/index.cjs +177 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +177 -10
- package/dist/index.js.map +1 -1
- package/dist/offline/index.cjs.map +1 -1
- package/dist/offline/index.d.cts +128 -122
- package/dist/offline/index.d.ts +128 -122
- 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 +38 -38
- package/dist/persistence/index.d.ts +38 -38
- package/dist/persistence/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/dist/{types-CMxO7QF0.d.cts → types-B7gCpNX9.d.cts} +6 -6
- package/dist/{types-CMxO7QF0.d.ts → types-B7gCpNX9.d.ts} +6 -6
- package/dist/utils/index.d.cts +4 -4
- package/dist/utils/index.d.ts +4 -4
- package/dist/versioning/index.cjs +18 -8
- 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 +18 -8
- package/dist/versioning/index.js.map +1 -1
- package/package.json +6 -2
package/dist/index.cjs
CHANGED
|
@@ -1088,11 +1088,13 @@ var MigrationTracker = class _MigrationTracker {
|
|
|
1088
1088
|
});
|
|
1089
1089
|
previousHash = hash;
|
|
1090
1090
|
}
|
|
1091
|
-
const persistedMigrations = normalizedMigrations.map(
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1091
|
+
const persistedMigrations = normalizedMigrations.map(
|
|
1092
|
+
(migration, index) => ({
|
|
1093
|
+
...migration,
|
|
1094
|
+
previousHash: integrityEntries[index]?.previousHash,
|
|
1095
|
+
integrityHash: integrityEntries[index]?.hash
|
|
1096
|
+
})
|
|
1097
|
+
);
|
|
1096
1098
|
const data = {
|
|
1097
1099
|
migrations: persistedMigrations,
|
|
1098
1100
|
snapshots: Array.from(this.snapshots.entries()).map(
|
|
@@ -1115,7 +1117,10 @@ var MigrationTracker = class _MigrationTracker {
|
|
|
1115
1117
|
data
|
|
1116
1118
|
};
|
|
1117
1119
|
const serialize = this.persistence.serializer ?? ((value) => JSON.stringify(value));
|
|
1118
|
-
await this.persistence.adapter.setItem(
|
|
1120
|
+
await this.persistence.adapter.setItem(
|
|
1121
|
+
this.persistence.key,
|
|
1122
|
+
serialize(envelope)
|
|
1123
|
+
);
|
|
1119
1124
|
}
|
|
1120
1125
|
/**
|
|
1121
1126
|
* Load tracker state and verify integrity chain.
|
|
@@ -1128,7 +1133,9 @@ var MigrationTracker = class _MigrationTracker {
|
|
|
1128
1133
|
if (!raw) {
|
|
1129
1134
|
return { migrations: 0, snapshots: 0 };
|
|
1130
1135
|
}
|
|
1131
|
-
const deserialize = this.persistence.deserializer ?? ((value) => JSON.parse(
|
|
1136
|
+
const deserialize = this.persistence.deserializer ?? ((value) => JSON.parse(
|
|
1137
|
+
value
|
|
1138
|
+
));
|
|
1132
1139
|
const envelope = deserialize(raw);
|
|
1133
1140
|
if (envelope.version !== 1 || !envelope.data) {
|
|
1134
1141
|
throw new Error("Invalid migration tracker persistence payload");
|
|
@@ -1191,7 +1198,10 @@ var MigrationTracker = class _MigrationTracker {
|
|
|
1191
1198
|
migrations: this.migrations.length,
|
|
1192
1199
|
snapshots: this.snapshots.size
|
|
1193
1200
|
});
|
|
1194
|
-
return {
|
|
1201
|
+
return {
|
|
1202
|
+
migrations: this.migrations.length,
|
|
1203
|
+
snapshots: this.snapshots.size
|
|
1204
|
+
};
|
|
1195
1205
|
}
|
|
1196
1206
|
/**
|
|
1197
1207
|
* Remove persisted migration tracker state.
|
|
@@ -2277,7 +2287,10 @@ var ReplicationManager = class _ReplicationManager {
|
|
|
2277
2287
|
data
|
|
2278
2288
|
};
|
|
2279
2289
|
const serialize = this.persistence.serializer ?? ((value) => JSON.stringify(value));
|
|
2280
|
-
await this.persistence.adapter.setItem(
|
|
2290
|
+
await this.persistence.adapter.setItem(
|
|
2291
|
+
this.persistence.key,
|
|
2292
|
+
serialize(envelope)
|
|
2293
|
+
);
|
|
2281
2294
|
}
|
|
2282
2295
|
/**
|
|
2283
2296
|
* Load replication snapshot from persistence.
|
|
@@ -2990,7 +3003,10 @@ var SyncProtocol = class _SyncProtocol {
|
|
|
2990
3003
|
data
|
|
2991
3004
|
};
|
|
2992
3005
|
const serialize = this.persistence.serializer ?? ((value) => JSON.stringify(value));
|
|
2993
|
-
await this.persistence.adapter.setItem(
|
|
3006
|
+
await this.persistence.adapter.setItem(
|
|
3007
|
+
this.persistence.key,
|
|
3008
|
+
serialize(envelope)
|
|
3009
|
+
);
|
|
2994
3010
|
}
|
|
2995
3011
|
/**
|
|
2996
3012
|
* Load protocol state from persistence.
|
|
@@ -5341,6 +5357,157 @@ var AgentPresenceManager = class extends eventemitter3.EventEmitter {
|
|
|
5341
5357
|
});
|
|
5342
5358
|
}
|
|
5343
5359
|
}
|
|
5360
|
+
/**
|
|
5361
|
+
* Update focused node path
|
|
5362
|
+
*/
|
|
5363
|
+
updateFocusNode(agentId, nodePath) {
|
|
5364
|
+
const presence = this.presences.get(agentId);
|
|
5365
|
+
if (presence) {
|
|
5366
|
+
presence.focusNode = nodePath;
|
|
5367
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5368
|
+
this.presences.set(agentId, presence);
|
|
5369
|
+
this.emit("focus_updated", {
|
|
5370
|
+
agentId,
|
|
5371
|
+
focusNode: nodePath
|
|
5372
|
+
});
|
|
5373
|
+
}
|
|
5374
|
+
}
|
|
5375
|
+
/**
|
|
5376
|
+
* Update text selection range
|
|
5377
|
+
*/
|
|
5378
|
+
updateSelection(agentId, selectionRange) {
|
|
5379
|
+
const presence = this.presences.get(agentId);
|
|
5380
|
+
if (presence) {
|
|
5381
|
+
presence.selectionRange = selectionRange;
|
|
5382
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5383
|
+
this.presences.set(agentId, presence);
|
|
5384
|
+
this.emit("selection_updated", {
|
|
5385
|
+
agentId,
|
|
5386
|
+
selectionRange
|
|
5387
|
+
});
|
|
5388
|
+
}
|
|
5389
|
+
}
|
|
5390
|
+
/**
|
|
5391
|
+
* Update typing state
|
|
5392
|
+
*/
|
|
5393
|
+
updateTyping(agentId, isTyping, field, isComposing = false) {
|
|
5394
|
+
const presence = this.presences.get(agentId);
|
|
5395
|
+
if (presence) {
|
|
5396
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
5397
|
+
const previous = presence.typingState;
|
|
5398
|
+
const typingState = {
|
|
5399
|
+
isTyping,
|
|
5400
|
+
field,
|
|
5401
|
+
isComposing,
|
|
5402
|
+
startedAt: isTyping && !previous?.isTyping ? now : isTyping ? previous?.startedAt : void 0,
|
|
5403
|
+
stoppedAt: isTyping ? void 0 : now
|
|
5404
|
+
};
|
|
5405
|
+
presence.typingState = typingState;
|
|
5406
|
+
presence.lastSeen = now;
|
|
5407
|
+
this.presences.set(agentId, presence);
|
|
5408
|
+
this.emit("typing_updated", {
|
|
5409
|
+
agentId,
|
|
5410
|
+
typingState
|
|
5411
|
+
});
|
|
5412
|
+
}
|
|
5413
|
+
}
|
|
5414
|
+
/**
|
|
5415
|
+
* Update scroll state
|
|
5416
|
+
*/
|
|
5417
|
+
updateScroll(agentId, scrollState) {
|
|
5418
|
+
const presence = this.presences.get(agentId);
|
|
5419
|
+
if (presence) {
|
|
5420
|
+
presence.scrollState = {
|
|
5421
|
+
...scrollState,
|
|
5422
|
+
depth: Math.max(0, Math.min(1, scrollState.depth))
|
|
5423
|
+
};
|
|
5424
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5425
|
+
this.presences.set(agentId, presence);
|
|
5426
|
+
this.emit("scroll_updated", {
|
|
5427
|
+
agentId,
|
|
5428
|
+
scrollState: presence.scrollState
|
|
5429
|
+
});
|
|
5430
|
+
}
|
|
5431
|
+
}
|
|
5432
|
+
/**
|
|
5433
|
+
* Update viewport size
|
|
5434
|
+
*/
|
|
5435
|
+
updateViewport(agentId, width, height) {
|
|
5436
|
+
const presence = this.presences.get(agentId);
|
|
5437
|
+
if (presence) {
|
|
5438
|
+
presence.viewport = { width, height };
|
|
5439
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5440
|
+
this.presences.set(agentId, presence);
|
|
5441
|
+
this.emit("viewport_updated", {
|
|
5442
|
+
agentId,
|
|
5443
|
+
viewport: presence.viewport
|
|
5444
|
+
});
|
|
5445
|
+
}
|
|
5446
|
+
}
|
|
5447
|
+
/**
|
|
5448
|
+
* Update input state
|
|
5449
|
+
*/
|
|
5450
|
+
updateInputState(agentId, inputState) {
|
|
5451
|
+
const presence = this.presences.get(agentId);
|
|
5452
|
+
if (presence) {
|
|
5453
|
+
presence.inputState = inputState;
|
|
5454
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5455
|
+
this.presences.set(agentId, presence);
|
|
5456
|
+
this.emit("input_state_updated", {
|
|
5457
|
+
agentId,
|
|
5458
|
+
inputState
|
|
5459
|
+
});
|
|
5460
|
+
}
|
|
5461
|
+
}
|
|
5462
|
+
/**
|
|
5463
|
+
* Clear input state
|
|
5464
|
+
*/
|
|
5465
|
+
clearInputState(agentId) {
|
|
5466
|
+
const presence = this.presences.get(agentId);
|
|
5467
|
+
if (presence) {
|
|
5468
|
+
presence.inputState = void 0;
|
|
5469
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5470
|
+
this.presences.set(agentId, presence);
|
|
5471
|
+
this.emit("input_state_updated", {
|
|
5472
|
+
agentId,
|
|
5473
|
+
inputState: void 0
|
|
5474
|
+
});
|
|
5475
|
+
}
|
|
5476
|
+
}
|
|
5477
|
+
/**
|
|
5478
|
+
* Update emotional state
|
|
5479
|
+
*/
|
|
5480
|
+
updateEmotionState(agentId, emotionState) {
|
|
5481
|
+
const presence = this.presences.get(agentId);
|
|
5482
|
+
if (presence) {
|
|
5483
|
+
const enrichedState = {
|
|
5484
|
+
...emotionState,
|
|
5485
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
5486
|
+
};
|
|
5487
|
+
presence.emotionState = enrichedState;
|
|
5488
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5489
|
+
this.presences.set(agentId, presence);
|
|
5490
|
+
this.emit("emotion_updated", {
|
|
5491
|
+
agentId,
|
|
5492
|
+
emotionState: enrichedState
|
|
5493
|
+
});
|
|
5494
|
+
}
|
|
5495
|
+
}
|
|
5496
|
+
/**
|
|
5497
|
+
* Clear emotional state
|
|
5498
|
+
*/
|
|
5499
|
+
clearEmotionState(agentId) {
|
|
5500
|
+
const presence = this.presences.get(agentId);
|
|
5501
|
+
if (presence) {
|
|
5502
|
+
presence.emotionState = void 0;
|
|
5503
|
+
presence.lastSeen = (/* @__PURE__ */ new Date()).toISOString();
|
|
5504
|
+
this.presences.set(agentId, presence);
|
|
5505
|
+
this.emit("emotion_updated", {
|
|
5506
|
+
agentId,
|
|
5507
|
+
emotionState: void 0
|
|
5508
|
+
});
|
|
5509
|
+
}
|
|
5510
|
+
}
|
|
5344
5511
|
/**
|
|
5345
5512
|
* Update status
|
|
5346
5513
|
*/
|