@cortexkit/pi-magic-context 0.44.3 → 0.45.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 (40) hide show
  1. package/dist/embedding-worker.js +47 -0
  2. package/dist/emscripten-module-0g8f45e6.js +602 -0
  3. package/dist/emscripten-module-0pekdjxz.js +1532 -0
  4. package/dist/emscripten-module-e67xwsp3.js +503 -0
  5. package/dist/emscripten-module-pj1vyb44.js +4559 -0
  6. package/dist/ffi-3cx1cxpk.js +78 -0
  7. package/dist/ffi-7bqqe4cd.js +91 -0
  8. package/dist/ffi-7e6gryj5.js +91 -0
  9. package/dist/ffi-bpvkebwr.js +78 -0
  10. package/dist/historian-calibration-extension.js +7 -4
  11. package/dist/{index-atb1ecv9.js → index-2bw9k8nx.js} +7930 -23026
  12. package/dist/index-2pbbk3en.js +410 -0
  13. package/dist/index-4d3cba70.js +10 -0
  14. package/dist/{index-59dmj4zs.js → index-7n8gb6j3.js} +165 -3
  15. package/dist/{index-97e5fzy3.js → index-7s5yk3za.js} +1 -1
  16. package/dist/index-901ekbga.js +244 -0
  17. package/dist/index-e16q5sd7.js +240 -0
  18. package/dist/index-g0xfx1c2.js +275 -0
  19. package/dist/{module-asyncify-2EFITU5U-rkqjhjxd.js → index-g20jdh0p.js} +114 -105
  20. package/dist/index-j0mbc5vj.js +359 -0
  21. package/dist/index-k0yd1ph9.js +7774 -0
  22. package/dist/{index-5fw91enm.js → index-n3g5mwa8.js} +1 -1
  23. package/dist/index-q1yc6bs0.js +104 -0
  24. package/dist/index-ttf0cqq8.js +8938 -0
  25. package/dist/{index-tckvezry.js → index-vxjgsr9m.js} +797 -914
  26. package/dist/{index-n8kg008j.js → index-w76x3af7.js} +28 -18
  27. package/dist/index.js +4060 -1695
  28. package/dist/{message-time-backfill-5yrp95cx.js → message-time-backfill-g83dkh8m.js} +19 -4
  29. package/dist/migration-worker.js +51 -0
  30. package/dist/module-ES6BEMUI-3cet1pyp.js +12 -0
  31. package/dist/module-asyncify-2EFITU5U-c2razzd9.js +6 -0
  32. package/dist/{read-session-chunk-z2weg25w.js → read-session-chunk-kmt7a6zj.js} +32 -5
  33. package/dist/rpc-notifications-gm1mdpwh.js +16 -0
  34. package/dist/{safe-notification-target-y3hg2m7p.js → safe-notification-target-6cn3z99t.js} +2 -2
  35. package/dist/subagent-entry.js +15 -6
  36. package/package.json +4 -4
  37. package/dist/index-b3eqj1g6.js +0 -51
  38. package/dist/index-rn7gafjr.js +0 -8
  39. package/dist/index-v6t0tg85.js +0 -13
  40. package/dist/rpc-notifications-jxy30tgz.js +0 -8
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  log
3
- } from "./index-59dmj4zs.js";
3
+ } from "./index-7n8gb6j3.js";
4
4
 
5
5
  // ../plugin/src/shared/safe-notification-target.ts
6
6
  var DEFAULT_TITLE_RE = /^(New session - |Child session - )\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
@@ -0,0 +1,104 @@
1
+ // ../plugin/src/shared/rpc-notifications.ts
2
+ var queue = [];
3
+ var nextNotificationId = 1;
4
+ var sinks = new Set;
5
+ function registerNotificationSink2(sink) {
6
+ sinks.add(sink);
7
+ return () => {
8
+ sinks.delete(sink);
9
+ };
10
+ }
11
+ function notificationMatchesSink(notification, sink) {
12
+ if (notification.sessionId === undefined)
13
+ return true;
14
+ if (sink.sessionId !== undefined)
15
+ return notification.sessionId === sink.sessionId;
16
+ return sink.protocol !== 2;
17
+ }
18
+ function pushNotification2(type, payload, sessionId) {
19
+ const notification = { id: nextNotificationId++, type, payload, sessionId };
20
+ queue.push(notification);
21
+ for (const sink of sinks) {
22
+ if (!notificationMatchesSink(notification, sink))
23
+ continue;
24
+ try {
25
+ sink.send(notification);
26
+ } catch {}
27
+ }
28
+ if (queue.length > 100) {
29
+ const reservedIds = new Set;
30
+ const reservedScopes = new Set;
31
+ for (let i = queue.length - 1;i >= 0 && reservedScopes.size < 25; i -= 1) {
32
+ const candidate = queue[i];
33
+ const scope = candidate.sessionId ?? "\x00global";
34
+ if (reservedScopes.has(scope))
35
+ continue;
36
+ reservedScopes.add(scope);
37
+ reservedIds.add(candidate.id);
38
+ }
39
+ const evictionIndex = queue.findIndex((candidate) => !reservedIds.has(candidate.id));
40
+ queue.splice(evictionIndex >= 0 ? evictionIndex : 0, 1);
41
+ }
42
+ }
43
+ function acknowledgeNotifications2(ids) {
44
+ const acknowledged = new Set(ids.filter((id) => Number.isSafeInteger(id) && id > 0));
45
+ if (acknowledged.size === 0)
46
+ return;
47
+ queue = queue.filter((notification) => !acknowledged.has(notification.id));
48
+ }
49
+ function __resetNotificationStateForTests2() {
50
+ queue = [];
51
+ nextNotificationId = 1;
52
+ sinks.clear();
53
+ }
54
+ function cursor(value) {
55
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0;
56
+ }
57
+ function drainNotifications2(lastReceivedId = 0, sessionId, options = {}) {
58
+ const sessionCursor = cursor(lastReceivedId);
59
+ if (options.globalOnly) {
60
+ queue = queue.filter((notification) => notification.sessionId !== undefined || notification.id > sessionCursor);
61
+ return queue.filter((notification) => notification.sessionId === undefined && notification.id > sessionCursor);
62
+ }
63
+ if (options.sessionOnly) {
64
+ if (sessionId === undefined)
65
+ return [];
66
+ queue = queue.filter((notification) => notification.sessionId !== sessionId || notification.id > sessionCursor);
67
+ return queue.filter((notification) => notification.sessionId === sessionId && notification.id > sessionCursor);
68
+ }
69
+ if (sessionId !== undefined && options.globalLastReceivedId !== undefined) {
70
+ const globalCursor = cursor(options.globalLastReceivedId);
71
+ queue = queue.filter((notification) => {
72
+ if (notification.sessionId === undefined)
73
+ return notification.id > globalCursor;
74
+ if (notification.sessionId === sessionId)
75
+ return notification.id > sessionCursor;
76
+ return true;
77
+ });
78
+ return queue.filter((notification) => {
79
+ if (notification.sessionId === undefined)
80
+ return notification.id > globalCursor;
81
+ return notification.sessionId === sessionId && notification.id > sessionCursor;
82
+ });
83
+ }
84
+ const matchesClient = (notification) => sessionId === undefined || notification.sessionId === undefined || notification.sessionId === sessionId;
85
+ if (sessionCursor > 0) {
86
+ queue = queue.filter((notification) => !(notification.id <= sessionCursor && matchesClient(notification)));
87
+ }
88
+ return queue.filter((notification) => notification.id > sessionCursor && matchesClient(notification));
89
+ }
90
+ function isTuiConnected2(sessionId) {
91
+ if (sinks.size === 0)
92
+ return false;
93
+ if (sessionId === undefined)
94
+ return true;
95
+ for (const sink of sinks) {
96
+ if (sink.sessionId === sessionId)
97
+ return true;
98
+ if (sink.sessionId === undefined && sink.protocol !== 2)
99
+ return true;
100
+ }
101
+ return false;
102
+ }
103
+
104
+ export { registerNotificationSink2, pushNotification2, acknowledgeNotifications2, __resetNotificationStateForTests2, drainNotifications2, isTuiConnected2 };