@cortexkit/pi-magic-context 0.44.4 → 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.
- package/dist/embedding-worker.js +47 -0
- package/dist/emscripten-module-0g8f45e6.js +602 -0
- package/dist/emscripten-module-0pekdjxz.js +1532 -0
- package/dist/emscripten-module-e67xwsp3.js +503 -0
- package/dist/emscripten-module-pj1vyb44.js +4559 -0
- package/dist/ffi-3cx1cxpk.js +78 -0
- package/dist/ffi-7bqqe4cd.js +91 -0
- package/dist/ffi-7e6gryj5.js +91 -0
- package/dist/ffi-bpvkebwr.js +78 -0
- package/dist/historian-calibration-extension.js +7 -4
- package/dist/{index-5am7amy4.js → index-2bw9k8nx.js} +7848 -23072
- package/dist/index-2pbbk3en.js +410 -0
- package/dist/index-4d3cba70.js +10 -0
- package/dist/{index-59dmj4zs.js → index-7n8gb6j3.js} +165 -3
- package/dist/{index-97e5fzy3.js → index-7s5yk3za.js} +1 -1
- package/dist/index-901ekbga.js +244 -0
- package/dist/index-e16q5sd7.js +240 -0
- package/dist/index-g0xfx1c2.js +275 -0
- package/dist/{module-asyncify-2EFITU5U-rkqjhjxd.js → index-g20jdh0p.js} +114 -105
- package/dist/index-j0mbc5vj.js +359 -0
- package/dist/index-k0yd1ph9.js +7774 -0
- package/dist/{index-5fw91enm.js → index-n3g5mwa8.js} +1 -1
- package/dist/index-q1yc6bs0.js +104 -0
- package/dist/index-ttf0cqq8.js +8938 -0
- package/dist/{index-npagr1cy.js → index-vxjgsr9m.js} +736 -904
- package/dist/{index-n8kg008j.js → index-w76x3af7.js} +28 -18
- package/dist/index.js +3983 -1670
- package/dist/{message-time-backfill-5yrp95cx.js → message-time-backfill-g83dkh8m.js} +19 -4
- package/dist/migration-worker.js +51 -0
- package/dist/module-ES6BEMUI-3cet1pyp.js +12 -0
- package/dist/module-asyncify-2EFITU5U-c2razzd9.js +6 -0
- package/dist/{read-session-chunk-w493f72c.js → read-session-chunk-kmt7a6zj.js} +32 -5
- package/dist/rpc-notifications-gm1mdpwh.js +16 -0
- package/dist/{safe-notification-target-y3hg2m7p.js → safe-notification-target-6cn3z99t.js} +2 -2
- package/dist/subagent-entry.js +15 -6
- package/package.json +4 -4
- package/dist/index-b3eqj1g6.js +0 -51
- package/dist/index-rn7gafjr.js +0 -8
- package/dist/index-v6t0tg85.js +0 -13
- package/dist/rpc-notifications-jxy30tgz.js +0 -8
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
withSqliteBackgroundWriter,
|
|
3
|
+
withoutSqliteTransformPass
|
|
4
|
+
} from "./index-2pbbk3en.js";
|
|
5
|
+
import"./index-7n8gb6j3.js";
|
|
2
6
|
import {
|
|
3
7
|
logSlowWriteTransaction
|
|
4
|
-
} from "./index-
|
|
8
|
+
} from "./index-7s5yk3za.js";
|
|
5
9
|
|
|
6
10
|
// ../plugin/src/features/magic-context/message-time-backfill.ts
|
|
7
11
|
var MESSAGE_TIME_BACKFILL_BATCH_SIZE = 500;
|
|
@@ -65,8 +69,11 @@ function backfillMessageTimesBatch(db, reader, batchSize = MESSAGE_TIME_BACKFILL
|
|
|
65
69
|
const completed = rows.length < boundedBatchSize;
|
|
66
70
|
const cursorSessionId = last?.sessionId ?? state.cursorSessionId;
|
|
67
71
|
const cursorOrdinal = last ? Number(last.messageOrdinal) : state.cursorOrdinal;
|
|
68
|
-
|
|
72
|
+
let transactionStartedAt = 0;
|
|
69
73
|
db.transaction(() => {
|
|
74
|
+
transactionStartedAt = performance.now();
|
|
75
|
+
db.prepare(`INSERT OR IGNORE INTO message_time_backfill_state
|
|
76
|
+
(id, cursor_session_id, cursor_ordinal, completed) VALUES (?, '', 0, 0)`).run(BACKFILL_STATE_ID);
|
|
70
77
|
const update = db.prepare(`UPDATE message_fts_rowid_map
|
|
71
78
|
SET message_time_ms = ?
|
|
72
79
|
WHERE session_id = ? AND message_ordinal = ? AND message_time_ms IS NULL`);
|
|
@@ -88,6 +95,7 @@ function backfillMessageTimesBatch(db, reader, batchSize = MESSAGE_TIME_BACKFILL
|
|
|
88
95
|
};
|
|
89
96
|
}
|
|
90
97
|
async function runMessageTimeBackfill(db, reader) {
|
|
98
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
91
99
|
for (;; ) {
|
|
92
100
|
const progress = backfillMessageTimesBatch(db, reader);
|
|
93
101
|
if (progress.completed)
|
|
@@ -99,10 +107,17 @@ function startMessageTimeBackfill(db, reader) {
|
|
|
99
107
|
const active = activeBackfills.get(db);
|
|
100
108
|
if (active)
|
|
101
109
|
return active;
|
|
102
|
-
const run = runMessageTimeBackfill(db, reader).finally(() => activeBackfills.delete(db));
|
|
110
|
+
const run = withoutSqliteTransformPass(() => withSqliteBackgroundWriter(() => runMessageTimeBackfill(db, reader))).finally(() => activeBackfills.delete(db));
|
|
103
111
|
activeBackfills.set(db, run);
|
|
104
112
|
return run;
|
|
105
113
|
}
|
|
114
|
+
function getMessageTimeBackfillProgress(db) {
|
|
115
|
+
return getBackfillState(db);
|
|
116
|
+
}
|
|
106
117
|
export {
|
|
118
|
+
MESSAGE_TIME_BACKFILL_BATCH_SIZE,
|
|
119
|
+
backfillMessageTimesBatch,
|
|
120
|
+
getMessageTimeBackfillProgress,
|
|
121
|
+
runMessageTimeBackfill,
|
|
107
122
|
startMessageTimeBackfill
|
|
108
123
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setLogLineForwarder
|
|
3
|
+
} from "./index-7n8gb6j3.js";
|
|
4
|
+
import {
|
|
5
|
+
Database
|
|
6
|
+
} from "./index-2pbbk3en.js";
|
|
7
|
+
import {
|
|
8
|
+
runMigrationsWithRetry,
|
|
9
|
+
setSqlitePragmaConfig,
|
|
10
|
+
initializeDatabase
|
|
11
|
+
} from "./index-k0yd1ph9.js";
|
|
12
|
+
import {
|
|
13
|
+
closeQuietly
|
|
14
|
+
} from "./index-e16q5sd7.js";
|
|
15
|
+
import"./index-j0mbc5vj.js";
|
|
16
|
+
import"./index-7s5yk3za.js";
|
|
17
|
+
|
|
18
|
+
// ../plugin/src/features/magic-context/migration-worker.ts
|
|
19
|
+
import { parentPort, workerData } from "node:worker_threads";
|
|
20
|
+
function post(message) {
|
|
21
|
+
parentPort?.postMessage(message);
|
|
22
|
+
}
|
|
23
|
+
async function main() {
|
|
24
|
+
const data = workerData;
|
|
25
|
+
setLogLineForwarder((line) => post({ type: "log", line }));
|
|
26
|
+
setSqlitePragmaConfig(data.sqlitePragmaConfig);
|
|
27
|
+
post({ type: "ready" });
|
|
28
|
+
let db;
|
|
29
|
+
try {
|
|
30
|
+
db = new Database(data.dbPath);
|
|
31
|
+
initializeDatabase(db, data.busyTimeoutMs);
|
|
32
|
+
await runMigrationsWithRetry(db, {
|
|
33
|
+
sleep: async (delayMs) => {
|
|
34
|
+
post({ type: "lock-wait", waiting: true });
|
|
35
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
36
|
+
post({ type: "lock-wait", waiting: false });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
post({ type: "done" });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
post({
|
|
42
|
+
type: "failed",
|
|
43
|
+
message: error instanceof Error ? error.message : String(error)
|
|
44
|
+
});
|
|
45
|
+
} finally {
|
|
46
|
+
if (db)
|
|
47
|
+
closeQuietly(db);
|
|
48
|
+
setLogLineForwarder(null);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
main();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
QuickJSModuleCallbacks2,
|
|
3
|
+
applyBaseRuntimeOptions2,
|
|
4
|
+
applyModuleEvalRuntimeOptions2,
|
|
5
|
+
QuickJSWASMModule2
|
|
6
|
+
} from "./index-g20jdh0p.js";
|
|
7
|
+
export {
|
|
8
|
+
QuickJSModuleCallbacks2 as QuickJSModuleCallbacks,
|
|
9
|
+
QuickJSWASMModule2 as QuickJSWASMModule,
|
|
10
|
+
applyBaseRuntimeOptions2 as applyBaseRuntimeOptions,
|
|
11
|
+
applyModuleEvalRuntimeOptions2 as applyModuleEvalRuntimeOptions
|
|
12
|
+
};
|
|
@@ -1,51 +1,78 @@
|
|
|
1
1
|
import {
|
|
2
|
-
hasMeaningfulUserText2,
|
|
3
|
-
extractTexts2,
|
|
4
2
|
resolveHostServedBoundaryId2,
|
|
5
3
|
hasRawMessageProvider2,
|
|
6
4
|
setRawMessageProvider2,
|
|
5
|
+
setBoundedRawMessageProvider2,
|
|
7
6
|
withRawMessageProvider2,
|
|
8
7
|
cleanUserText2,
|
|
9
8
|
withRawSessionMessageCache2,
|
|
10
9
|
readRawSessionMessages2,
|
|
11
10
|
readRawSessionMessagePage2,
|
|
12
11
|
getRawSessionMessageOrdinalCount2,
|
|
12
|
+
RAW_MESSAGE_VISIT_PAGE_SIZE2,
|
|
13
13
|
visitRawSessionMessages2,
|
|
14
14
|
readRawSessionMessageRange2,
|
|
15
15
|
primeTailRawMessageCache2,
|
|
16
16
|
getCachedAbsoluteMessageCount2,
|
|
17
17
|
primeInMemoryTailRawMessageCache2,
|
|
18
|
+
readRawSessionMessageOrdinalPage2,
|
|
19
|
+
getRawSessionStoredMessageCount2,
|
|
18
20
|
readRawSessionMessageIdOrdinalsForRange2,
|
|
21
|
+
readRawSessionMessageIdOrdinals2,
|
|
22
|
+
readRawSessionMessagePartsById2,
|
|
19
23
|
hasRawSessionMessageById2,
|
|
20
24
|
readRawSessionMessageOrdinalById2,
|
|
21
25
|
compareRawSessionMessageOrder2,
|
|
26
|
+
readRawSessionMessageById2,
|
|
22
27
|
getRawSessionMessageCount2,
|
|
28
|
+
RAW_SESSION_TAG_KEY_PAGE_SIZE2,
|
|
23
29
|
getRawSessionTagKeysThrough2,
|
|
24
30
|
getLegacyProtectedTailStartOrdinal2,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
getProtectedTailStartOrdinal2,
|
|
32
|
+
readSessionChunk2,
|
|
33
|
+
getRawSessionMessageIdsThrough2,
|
|
34
|
+
readRawSessionSeedTail2
|
|
35
|
+
} from "./index-vxjgsr9m.js";
|
|
36
|
+
import"./index-g0xfx1c2.js";
|
|
37
|
+
import"./index-e16q5sd7.js";
|
|
38
|
+
import {
|
|
39
|
+
hasMeaningfulUserText2,
|
|
40
|
+
extractTexts2
|
|
41
|
+
} from "./index-j0mbc5vj.js";
|
|
42
|
+
import"./index-2pbbk3en.js";
|
|
43
|
+
import"./index-7n8gb6j3.js";
|
|
28
44
|
export {
|
|
45
|
+
RAW_MESSAGE_VISIT_PAGE_SIZE2 as RAW_MESSAGE_VISIT_PAGE_SIZE,
|
|
46
|
+
RAW_SESSION_TAG_KEY_PAGE_SIZE2 as RAW_SESSION_TAG_KEY_PAGE_SIZE,
|
|
29
47
|
cleanUserText2 as cleanUserText,
|
|
30
48
|
compareRawSessionMessageOrder2 as compareRawSessionMessageOrder,
|
|
31
49
|
extractTexts2 as extractTexts,
|
|
32
50
|
getCachedAbsoluteMessageCount2 as getCachedAbsoluteMessageCount,
|
|
33
51
|
getLegacyProtectedTailStartOrdinal2 as getLegacyProtectedTailStartOrdinal,
|
|
52
|
+
getProtectedTailStartOrdinal2 as getProtectedTailStartOrdinal,
|
|
34
53
|
getRawSessionMessageCount2 as getRawSessionMessageCount,
|
|
54
|
+
getRawSessionMessageIdsThrough2 as getRawSessionMessageIdsThrough,
|
|
35
55
|
getRawSessionMessageOrdinalCount2 as getRawSessionMessageOrdinalCount,
|
|
56
|
+
getRawSessionStoredMessageCount2 as getRawSessionStoredMessageCount,
|
|
36
57
|
getRawSessionTagKeysThrough2 as getRawSessionTagKeysThrough,
|
|
37
58
|
hasMeaningfulUserText2 as hasMeaningfulUserText,
|
|
38
59
|
hasRawMessageProvider2 as hasRawMessageProvider,
|
|
39
60
|
hasRawSessionMessageById2 as hasRawSessionMessageById,
|
|
40
61
|
primeInMemoryTailRawMessageCache2 as primeInMemoryTailRawMessageCache,
|
|
41
62
|
primeTailRawMessageCache2 as primeTailRawMessageCache,
|
|
63
|
+
readRawSessionMessageById2 as readRawSessionMessageById,
|
|
64
|
+
readRawSessionMessageIdOrdinals2 as readRawSessionMessageIdOrdinals,
|
|
42
65
|
readRawSessionMessageIdOrdinalsForRange2 as readRawSessionMessageIdOrdinalsForRange,
|
|
43
66
|
readRawSessionMessageOrdinalById2 as readRawSessionMessageOrdinalById,
|
|
67
|
+
readRawSessionMessageOrdinalPage2 as readRawSessionMessageOrdinalPage,
|
|
44
68
|
readRawSessionMessagePage2 as readRawSessionMessagePage,
|
|
69
|
+
readRawSessionMessagePartsById2 as readRawSessionMessagePartsById,
|
|
45
70
|
readRawSessionMessageRange2 as readRawSessionMessageRange,
|
|
46
71
|
readRawSessionMessages2 as readRawSessionMessages,
|
|
72
|
+
readRawSessionSeedTail2 as readRawSessionSeedTail,
|
|
47
73
|
readSessionChunk2 as readSessionChunk,
|
|
48
74
|
resolveHostServedBoundaryId2 as resolveHostServedBoundaryId,
|
|
75
|
+
setBoundedRawMessageProvider2 as setBoundedRawMessageProvider,
|
|
49
76
|
setRawMessageProvider2 as setRawMessageProvider,
|
|
50
77
|
visitRawSessionMessages2 as visitRawSessionMessages,
|
|
51
78
|
withRawMessageProvider2 as withRawMessageProvider,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerNotificationSink2,
|
|
3
|
+
pushNotification2,
|
|
4
|
+
acknowledgeNotifications2,
|
|
5
|
+
__resetNotificationStateForTests2,
|
|
6
|
+
drainNotifications2,
|
|
7
|
+
isTuiConnected2
|
|
8
|
+
} from "./index-q1yc6bs0.js";
|
|
9
|
+
export {
|
|
10
|
+
__resetNotificationStateForTests2 as __resetNotificationStateForTests,
|
|
11
|
+
acknowledgeNotifications2 as acknowledgeNotifications,
|
|
12
|
+
drainNotifications2 as drainNotifications,
|
|
13
|
+
isTuiConnected2 as isTuiConnected,
|
|
14
|
+
pushNotification2 as pushNotification,
|
|
15
|
+
registerNotificationSink2 as registerNotificationSink
|
|
16
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDefaultSessionTitle2,
|
|
3
3
|
waitForSafeNotificationTarget2
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-n3g5mwa8.js";
|
|
5
|
+
import"./index-7n8gb6j3.js";
|
|
6
6
|
export {
|
|
7
7
|
isDefaultSessionTitle2 as isDefaultSessionTitle,
|
|
8
8
|
waitForSafeNotificationTarget2 as waitForSafeNotificationTarget
|
package/dist/subagent-entry.js
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOKEN_BUDGET_TOOL_REFUSAL
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-vxjgsr9m.js";
|
|
4
4
|
import {
|
|
5
5
|
setHarness,
|
|
6
6
|
log
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-7n8gb6j3.js";
|
|
8
8
|
import {
|
|
9
|
-
setStoragePrivatePermissionEnforcement,
|
|
10
9
|
resolveProjectIdentityForSession,
|
|
11
|
-
openDatabase
|
|
10
|
+
openDatabase
|
|
11
|
+
} from "./index-k0yd1ph9.js";
|
|
12
|
+
import"./index-2pbbk3en.js";
|
|
13
|
+
import"./index-e16q5sd7.js";
|
|
14
|
+
import"./index-j0mbc5vj.js";
|
|
15
|
+
import {
|
|
12
16
|
loadPiConfig,
|
|
13
17
|
ensureProjectRegisteredFromPiDirectory,
|
|
14
18
|
resolvePiHarnessKind,
|
|
15
19
|
registerMagicContextTools
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
20
|
+
} from "./index-2bw9k8nx.js";
|
|
21
|
+
import"./index-ttf0cqq8.js";
|
|
22
|
+
import"./index-g0xfx1c2.js";
|
|
23
|
+
import {
|
|
24
|
+
setStoragePrivatePermissionEnforcement
|
|
25
|
+
} from "./index-4d3cba70.js";
|
|
26
|
+
import"./index-7s5yk3za.js";
|
|
18
27
|
|
|
19
28
|
// src/subagent-entry.ts
|
|
20
29
|
import { readFileSync } from "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/pi-magic-context",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"//": "The build intentionally bundles typebox (no --external typebox) and keeps it a regular dependency. OMP's extension loader rewrites every bare `typebox` import to its own omptype-based shim, whose schemas are callable objects rather than JSON Schema; they fail structuredClone during tool registration, so an external typebox import stops Magic Context loading on OMP. src/typebox-bundling.test.ts guards this.",
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json &&
|
|
33
|
-
"build:e2e-argv": "bun build src/subagent-runner.ts --
|
|
32
|
+
"build": "bun ../../scripts/check-bun.mjs && tsc -p ../retina-local-fs/tsconfig.build.json && bun ../../scripts/clean-dist-chunks.mjs dist index.js subagent-entry.js historian-calibration-extension.js transformers-web.js transformers-node-wasm.js && bun build ../plugin/src/features/magic-context/memory/transformers-web-entry.ts --outfile dist/transformers-web.js --target browser --format esm --external onnxruntime-web && bun ../plugin/scripts/build-transformers-node-wasm.ts dist && bun build src/index.ts src/subagent-entry.ts src/historian-calibration-extension.ts ../plugin/src/features/magic-context/memory/embedding-worker.ts ../plugin/src/features/magic-context/migration-worker.ts --outdir dist --entry-naming '[name].[ext]' --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @earendil-works/pi-tui --external onnxruntime-node --external onnxruntime-web --external sharp --external node:sqlite",
|
|
33
|
+
"build:e2e-argv": "bun ../../scripts/clean-dist-chunks.mjs ../../tests/docker/.generated subagent-runner-e2e.mjs && bun build src/subagent-runner.ts --outdir ../../tests/docker/.generated --entry-naming 'subagent-runner-e2e.mjs' --splitting --target node --format esm --external node:sqlite && node --input-type=module -e 'const { __test } = await import(\"../../tests/docker/.generated/subagent-runner-e2e.mjs\"); if (typeof __test.buildArgs !== \"function\" || typeof __test.resolvePiInvocation !== \"function\") throw new Error(\"argv renderer exports missing\"); console.log(\"Node argv renderer: 2 exports loaded\")'",
|
|
34
34
|
"typecheck": "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit",
|
|
35
35
|
"test": "bun ../../scripts/check-bun.mjs && bun install --frozen-lockfile && bun test --parallel --timeout 30000",
|
|
36
36
|
"test:serial": "bun install --frozen-lockfile && bun test --timeout 30000",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lint:fix": "biome check --write src",
|
|
39
39
|
"format": "biome format --write src",
|
|
40
40
|
"format:check": "biome format src",
|
|
41
|
-
"clean": "
|
|
41
|
+
"clean": "bun ../../scripts/clean-dist-chunks.mjs dist index.js subagent-entry.js historian-calibration-extension.js embedding-worker.js migration-worker.js transformers-web.js transformers-node-wasm.js",
|
|
42
42
|
"prepublishOnly": "bun run build"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
package/dist/index-b3eqj1g6.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// ../plugin/src/shared/rpc-notifications.ts
|
|
2
|
-
var queue = [];
|
|
3
|
-
var nextNotificationId = 1;
|
|
4
|
-
var sinks = new Set;
|
|
5
|
-
function notificationMatchesSink(notification, sink) {
|
|
6
|
-
if (notification.sessionId === undefined)
|
|
7
|
-
return true;
|
|
8
|
-
if (sink.sessionId !== undefined)
|
|
9
|
-
return notification.sessionId === sink.sessionId;
|
|
10
|
-
return sink.protocol !== 2;
|
|
11
|
-
}
|
|
12
|
-
function pushNotification2(type, payload, sessionId) {
|
|
13
|
-
const notification = { id: nextNotificationId++, type, payload, sessionId };
|
|
14
|
-
queue.push(notification);
|
|
15
|
-
for (const sink of sinks) {
|
|
16
|
-
if (!notificationMatchesSink(notification, sink))
|
|
17
|
-
continue;
|
|
18
|
-
try {
|
|
19
|
-
sink.send(notification);
|
|
20
|
-
} catch {}
|
|
21
|
-
}
|
|
22
|
-
if (queue.length > 100) {
|
|
23
|
-
const reservedIds = new Set;
|
|
24
|
-
const reservedScopes = new Set;
|
|
25
|
-
for (let i = queue.length - 1;i >= 0 && reservedScopes.size < 25; i -= 1) {
|
|
26
|
-
const candidate = queue[i];
|
|
27
|
-
const scope = candidate.sessionId ?? "\x00global";
|
|
28
|
-
if (reservedScopes.has(scope))
|
|
29
|
-
continue;
|
|
30
|
-
reservedScopes.add(scope);
|
|
31
|
-
reservedIds.add(candidate.id);
|
|
32
|
-
}
|
|
33
|
-
const evictionIndex = queue.findIndex((candidate) => !reservedIds.has(candidate.id));
|
|
34
|
-
queue.splice(evictionIndex >= 0 ? evictionIndex : 0, 1);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function isTuiConnected2(sessionId) {
|
|
38
|
-
if (sinks.size === 0)
|
|
39
|
-
return false;
|
|
40
|
-
if (sessionId === undefined)
|
|
41
|
-
return true;
|
|
42
|
-
for (const sink of sinks) {
|
|
43
|
-
if (sink.sessionId === sessionId)
|
|
44
|
-
return true;
|
|
45
|
-
if (sink.sessionId === undefined && sink.protocol !== 2)
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export { pushNotification2, isTuiConnected2 };
|
package/dist/index-rn7gafjr.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.bun/@jitl+quickjs-ffi-types@0.32.0/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs
|
|
2
|
-
var EvalFlags = { JS_EVAL_TYPE_GLOBAL: 0, JS_EVAL_TYPE_MODULE: 1, JS_EVAL_TYPE_DIRECT: 2, JS_EVAL_TYPE_INDIRECT: 3, JS_EVAL_TYPE_MASK: 3, JS_EVAL_FLAG_STRICT: 8, JS_EVAL_FLAG_STRIP: 16, JS_EVAL_FLAG_COMPILE_ONLY: 32, JS_EVAL_FLAG_BACKTRACE_BARRIER: 64 };
|
|
3
|
-
var IntrinsicsFlags = { BaseObjects: 1, Date: 2, Eval: 4, StringNormalize: 8, RegExp: 16, RegExpCompiler: 32, JSON: 64, Proxy: 128, MapSet: 256, TypedArrays: 512, Promise: 1024, BigInt: 2048, BigFloat: 4096, BigDecimal: 8192, OperatorOverloading: 16384, BignumExt: 32768 };
|
|
4
|
-
var JSPromiseStateEnum = { Pending: 0, Fulfilled: 1, Rejected: 2 };
|
|
5
|
-
var GetOwnPropertyNamesFlags = { JS_GPN_STRING_MASK: 1, JS_GPN_SYMBOL_MASK: 2, JS_GPN_PRIVATE_MASK: 4, JS_GPN_ENUM_ONLY: 16, JS_GPN_SET_ENUM: 32, QTS_GPN_NUMBER_MASK: 64, QTS_STANDARD_COMPLIANT_NUMBER: 128 };
|
|
6
|
-
var IsEqualOp = { IsStrictlyEqual: 0, IsSameValue: 1, IsSameValueZero: 2 };
|
|
7
|
-
|
|
8
|
-
export { EvalFlags, IntrinsicsFlags, JSPromiseStateEnum, GetOwnPropertyNamesFlags, IsEqualOp };
|
package/dist/index-v6t0tg85.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// ../../node_modules/.bun/quickjs-emscripten-core@0.32.0/node_modules/quickjs-emscripten-core/dist/index.mjs
|
|
2
|
-
async function newQuickJSAsyncWASMModuleFromVariant(variantOrPromise) {
|
|
3
|
-
let variant = smartUnwrap(await variantOrPromise), [wasmModuleLoader, QuickJSAsyncFFI, { QuickJSAsyncWASMModule: QuickJSAsyncWASMModule2 }] = await Promise.all([variant.importModuleLoader().then(smartUnwrap), variant.importFFI(), import("./module-asyncify-2EFITU5U-rkqjhjxd.js").then(smartUnwrap)]), wasmModule = await wasmModuleLoader();
|
|
4
|
-
wasmModule.type = "async";
|
|
5
|
-
let ffi = new QuickJSAsyncFFI(wasmModule);
|
|
6
|
-
return new QuickJSAsyncWASMModule2(wasmModule, ffi);
|
|
7
|
-
}
|
|
8
|
-
function smartUnwrap(val) {
|
|
9
|
-
return val && "default" in val && val.default ? val.default && "default" in val.default && val.default.default ? val.default.default : val.default : val;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
newQuickJSAsyncWASMModuleFromVariant
|
|
13
|
-
};
|