@cortexkit/pi-magic-context 0.49.19 → 0.49.20
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/auto-search-worker.js +48 -9
- package/dist/chunk-embedding-write-worker.js +29 -22
- package/dist/{compaction-marker-candidates-wjzqbspm.js → compaction-marker-candidates-fnm47jat.js} +3 -3
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/compartment-chunk-embedding-81qesfjs.js +64 -0
- package/dist/embedding-backfill-56e871c6.js +24 -0
- package/dist/embedding-worker-process.js +2 -2
- package/dist/embedding-worker.js +5 -5
- package/dist/historian-calibration-extension.js +1 -1
- package/dist/index-54wmg4rj.js +82 -0
- package/dist/{index-xnch62s6.js → index-5n5zxs8e.js} +314 -127
- package/dist/{index-msqrs4nf.js → index-5vgt1zeh.js} +5 -5
- package/dist/{index-qpq6w67c.js → index-6kb2xpw7.js} +2 -2
- package/dist/{index-58mj0dzc.js → index-af9t637y.js} +68 -16
- package/dist/{index-z2rkv0mb.js → index-b8am7tns.js} +4 -4
- package/dist/{index-rhprywn6.js → index-bttctq07.js} +23 -5
- package/dist/{index-e1rza8gp.js → index-dzem6gn9.js} +1 -1
- package/dist/{index-2mmy81qt.js → index-e19qtjj0.js} +468 -18
- package/dist/{index-7bqrfyny.js → index-fgs78jyd.js} +12 -15
- package/dist/{index-d4dt19md.js → index-hqw0rt9k.js} +1 -1
- package/dist/{index-rrwv9y2k.js → index-hws5f0z9.js} +1 -1
- package/dist/{index-f18ec69t.js → index-jn44h81p.js} +1 -1
- package/dist/{index-ek9zvs4f.js → index-jt0g3hn0.js} +37 -25
- package/dist/{index-d8gc0112.js → index-jxjr7kz9.js} +3 -3
- package/dist/{index-rc1dez8m.js → index-kqb3d8bs.js} +9 -5
- package/dist/{index-sqt2haap.js → index-mtvvhcw4.js} +10 -10
- package/dist/{index-1kcfwk9c.js → index-my0dn413.js} +1 -1
- package/dist/{index-apgwdby5.js → index-n4wyxcgr.js} +1 -1
- package/dist/{index-g7p75667.js → index-p63nwn5v.js} +2 -2
- package/dist/{index-svgkv4g2.js → index-qerzchrs.js} +2 -2
- package/dist/{index-vktahpdj.js → index-rfyvax95.js} +9 -3
- package/dist/{index-yygsh681.js → index-rgfb753z.js} +3 -3
- package/dist/{index-dtp1efvf.js → index-tb3d9trm.js} +2 -2
- package/dist/{index-vmcgew7x.js → index-v2epyzbm.js} +75 -57
- package/dist/{index-ym6nh2gk.js → index-vdy273xw.js} +107 -20
- package/dist/{index-jrap43gc.js → index-w1avzkdt.js} +1 -1
- package/dist/{index-wveb51es.js → index-zhwwp8zz.js} +63 -8
- package/dist/index.js +978 -235
- package/dist/{logger-dygt96rn.js → logger-shetp43v.js} +1 -1
- package/dist/{message-fts-rowid-map-cvpy2dmb.js → message-fts-rowid-map-bpexnsdj.js} +6 -5
- package/dist/{message-index-bounded-66saeq5j.js → message-index-bounded-d4r3weh0.js} +14 -13
- package/dist/{message-index-rc2x41k4.js → message-index-mvag9crh.js} +14 -13
- package/dist/{message-time-backfill-ssshbdy8.js → message-time-backfill-kc10yrcj.js} +3 -3
- package/dist/migration-worker.js +12 -11
- package/dist/{project-embedding-registry-vf1ncptn.js → project-embedding-registry-cfrg952x.js} +13 -12
- package/dist/raw-ordinal-warmup-worker.js +136 -101
- package/dist/{read-session-chunk-h5bzj91r.js → read-session-chunk-7g4zvpd8.js} +9 -8
- package/dist/{read-session-raw-9s3xn7fc.js → read-session-raw-0fsjh10f.js} +4 -3
- package/dist/{safe-notification-target-2rkvkmw8.js → safe-notification-target-zcpchea6.js} +2 -2
- package/dist/search-archive-qbhp7e89.js +21 -0
- package/dist/{search-wh7b9zht.js → search-hp4g3g9v.js} +22 -21
- package/dist/{sqlite-fsp0sf3r.js → sqlite-d67n6dtr.js} +1 -1
- package/dist/{storage-memory-yxxc5v4n.js → storage-memory-9g882j7a.js} +2 -2
- package/dist/{storage-tags-1kets0q8.js → storage-tags-m2qcp1g2.js} +7 -5
- package/dist/subagent-entry.js +26 -25
- package/dist/tag-snapshot-worker-pi.js +22 -14
- package/package.json +1 -1
- package/dist/embedding-backfill-vwag34t0.js +0 -23
- package/dist/search-archive-4817pqev.js +0 -20
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
getMagicContextStorageDir,
|
|
18
18
|
log2,
|
|
19
19
|
sessionLog2
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-fgs78jyd.js";
|
|
21
21
|
import {
|
|
22
22
|
piModelRefToCanonical,
|
|
23
23
|
modelRefLookupOrder,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
visitRawSessionMessages2,
|
|
68
68
|
readRawSessionMessageById2,
|
|
69
69
|
readSessionChunk2
|
|
70
|
-
} from "./index-
|
|
70
|
+
} from "./index-zhwwp8zz.js";
|
|
71
71
|
import {
|
|
72
72
|
isRecord,
|
|
73
73
|
providerVisibleMessage,
|
|
@@ -81,25 +81,25 @@ import {
|
|
|
81
81
|
getTagNumberByMessageId2,
|
|
82
82
|
getTagsBySession2,
|
|
83
83
|
getTagById2
|
|
84
|
-
} from "./index-
|
|
84
|
+
} from "./index-bttctq07.js";
|
|
85
85
|
import {
|
|
86
86
|
estimateTokens
|
|
87
|
-
} from "./index-
|
|
87
|
+
} from "./index-my0dn413.js";
|
|
88
88
|
import {
|
|
89
89
|
inRootAsyncContext2,
|
|
90
90
|
Database2,
|
|
91
91
|
withSqliteBackgroundWriter2,
|
|
92
92
|
withoutSqliteTransformPass2
|
|
93
|
-
} from "./index-
|
|
93
|
+
} from "./index-hws5f0z9.js";
|
|
94
94
|
import {
|
|
95
95
|
stableStringify,
|
|
96
96
|
closeQuietly,
|
|
97
97
|
getTableColumnNames
|
|
98
|
-
} from "./index-
|
|
98
|
+
} from "./index-w1avzkdt.js";
|
|
99
99
|
import {
|
|
100
100
|
piHarnessKindFromExecutable,
|
|
101
101
|
isPidAlive
|
|
102
|
-
} from "./index-
|
|
102
|
+
} from "./index-n4wyxcgr.js";
|
|
103
103
|
import {
|
|
104
104
|
BoundedSessionMap,
|
|
105
105
|
clearLkgFenceProcessState,
|
|
@@ -109,21 +109,21 @@ import {
|
|
|
109
109
|
V2StoreReader,
|
|
110
110
|
deleteSessionScopedRows,
|
|
111
111
|
getLastIndexedOrdinal2
|
|
112
|
-
} from "./index-
|
|
112
|
+
} from "./index-vdy273xw.js";
|
|
113
113
|
import {
|
|
114
114
|
resolveOpenCodeDbPath,
|
|
115
115
|
assertOpenCodeStoreGeneration
|
|
116
116
|
} from "./index-8976mezv.js";
|
|
117
117
|
import {
|
|
118
118
|
noteRawSessionSummaryRowWritten2
|
|
119
|
-
} from "./index-
|
|
119
|
+
} from "./index-rfyvax95.js";
|
|
120
120
|
import {
|
|
121
121
|
SubcClient,
|
|
122
122
|
connectionFileExists,
|
|
123
123
|
SYNAPSE_DEFAULT_MODEL,
|
|
124
124
|
toSynapseLaneDescriptor,
|
|
125
125
|
SynapseEmbeddingProvider
|
|
126
|
-
} from "./index-
|
|
126
|
+
} from "./index-jxjr7kz9.js";
|
|
127
127
|
import {
|
|
128
128
|
invalidateAutoEmbedSession,
|
|
129
129
|
drainBackgroundBatches,
|
|
@@ -136,10 +136,10 @@ import {
|
|
|
136
136
|
unregisterProjectEmbedding2,
|
|
137
137
|
getProjectEmbeddingSnapshot2,
|
|
138
138
|
embedTextForProject2
|
|
139
|
-
} from "./index-
|
|
139
|
+
} from "./index-v2epyzbm.js";
|
|
140
140
|
import {
|
|
141
141
|
getErrorMessage
|
|
142
|
-
} from "./index-
|
|
142
|
+
} from "./index-mtvvhcw4.js";
|
|
143
143
|
import {
|
|
144
144
|
V2_MEMORY_CATEGORIES,
|
|
145
145
|
CATEGORY_PRIORITY,
|
|
@@ -153,13 +153,13 @@ import {
|
|
|
153
153
|
expandWorkspaceIdentitySetWithAliases,
|
|
154
154
|
resolveStoredPathWorkspaceIdentity,
|
|
155
155
|
storedPathBelongsToWorkspace
|
|
156
|
-
} from "./index-
|
|
156
|
+
} from "./index-5vgt1zeh.js";
|
|
157
157
|
import {
|
|
158
158
|
directoryHasGitMetadata,
|
|
159
159
|
resolveProjectIdentityForSession,
|
|
160
160
|
normalizeStoredProjectPath,
|
|
161
161
|
storedPathBelongsToIdentity
|
|
162
|
-
} from "./index-
|
|
162
|
+
} from "./index-p63nwn5v.js";
|
|
163
163
|
import {
|
|
164
164
|
getNoteByIdInScope,
|
|
165
165
|
getNotes,
|
|
@@ -175,7 +175,7 @@ import {
|
|
|
175
175
|
resolveMemoriesByIdsForSearch2,
|
|
176
176
|
unifiedSearch2,
|
|
177
177
|
formatSearchResults2
|
|
178
|
-
} from "./index-
|
|
178
|
+
} from "./index-af9t637y.js";
|
|
179
179
|
import {
|
|
180
180
|
computeCueContentHash,
|
|
181
181
|
getMuralCueState,
|
|
@@ -191,25 +191,28 @@ import {
|
|
|
191
191
|
supersededMemory2,
|
|
192
192
|
mergeMemoryStats2,
|
|
193
193
|
archiveMemory2
|
|
194
|
-
} from "./index-
|
|
194
|
+
} from "./index-dzem6gn9.js";
|
|
195
195
|
import {
|
|
196
196
|
saveEmbedding,
|
|
197
197
|
invalidateMemory2
|
|
198
198
|
} from "./index-yhzhdp3m.js";
|
|
199
|
+
import {
|
|
200
|
+
preflightLocalEmbeddingPooling
|
|
201
|
+
} from "./index-e19qtjj0.js";
|
|
199
202
|
import {
|
|
200
203
|
isMarkerCandidateBasisCurrent2,
|
|
201
204
|
invalidateMarkerCandidateBasis2,
|
|
202
205
|
readMarkerCandidateBasis2
|
|
203
|
-
} from "./index-
|
|
206
|
+
} from "./index-6kb2xpw7.js";
|
|
204
207
|
import {
|
|
205
208
|
renderSearchArchive2
|
|
206
|
-
} from "./index-
|
|
209
|
+
} from "./index-tb3d9trm.js";
|
|
207
210
|
import {
|
|
208
211
|
computeNormalizedHash
|
|
209
212
|
} from "./index-9x1f96r8.js";
|
|
210
213
|
import {
|
|
211
214
|
logSlowWriteTransaction
|
|
212
|
-
} from "./index-
|
|
215
|
+
} from "./index-hqw0rt9k.js";
|
|
213
216
|
import {
|
|
214
217
|
ensureStorageDirectorySync,
|
|
215
218
|
writeStorageFileAtomicSync
|
|
@@ -9932,7 +9935,7 @@ function unregisterPiProjectEmbeddings(db) {
|
|
|
9932
9935
|
registeredIdentitiesByDatabase.delete(db);
|
|
9933
9936
|
registrationFingerprintsByDatabase.get(db)?.clear();
|
|
9934
9937
|
}
|
|
9935
|
-
async function ensureProjectRegisteredFromPiDirectory(directory, db) {
|
|
9938
|
+
async function ensureProjectRegisteredFromPiDirectory(directory, db, options = {}) {
|
|
9936
9939
|
const detailed = loadPiConfigDetailed({ cwd: directory });
|
|
9937
9940
|
const projectIdentity = resolveProjectIdentityForSession(directory, detailed.config.allow_home_project);
|
|
9938
9941
|
if (!projectIdentity)
|
|
@@ -9963,6 +9966,9 @@ async function ensureProjectRegisteredFromPiDirectory(directory, db) {
|
|
|
9963
9966
|
memoryEnabled: detailed.config.memory.enabled,
|
|
9964
9967
|
gitCommitEnabled: detailed.config.memory.git_commit_indexing.enabled
|
|
9965
9968
|
};
|
|
9969
|
+
if (options.preflightLocalPooling && routing.primary.provider === "local") {
|
|
9970
|
+
await preflightLocalEmbeddingPooling(routing.primary.model ?? "Xenova/all-MiniLM-L6-v2");
|
|
9971
|
+
}
|
|
9966
9972
|
let registered = registeredIdentitiesByDatabase.get(db);
|
|
9967
9973
|
if (!registered) {
|
|
9968
9974
|
registered = new Set;
|
|
@@ -12717,7 +12723,7 @@ function createCtxReduceTool(deps) {
|
|
|
12717
12723
|
params = unwrapImitatedReducedArgs(params, ["drop"], { drop: "string" });
|
|
12718
12724
|
const sessionId = ctx.sessionManager.getSessionId();
|
|
12719
12725
|
if (!params.drop) {
|
|
12720
|
-
return err4(
|
|
12726
|
+
return err4(`Error: 'drop' must be provided as a string of tag numbers, for example {"drop": "3-5,8"}.`);
|
|
12721
12727
|
}
|
|
12722
12728
|
let dropIds = [];
|
|
12723
12729
|
try {
|
|
@@ -12881,7 +12887,7 @@ function createCtxSearchTool(deps) {
|
|
|
12881
12887
|
label: "Magic Context: Search",
|
|
12882
12888
|
description: CTX_SEARCH_DESCRIPTION,
|
|
12883
12889
|
parameters: ParamsSchema4,
|
|
12884
|
-
async execute(_toolCallId, params,
|
|
12890
|
+
async execute(_toolCallId, params, signal, _onUpdate, ctx) {
|
|
12885
12891
|
params = unwrapImitatedReducedArgs(params, ["query"], {
|
|
12886
12892
|
query: "string",
|
|
12887
12893
|
limit: "number",
|
|
@@ -12977,6 +12983,7 @@ function createCtxSearchTool(deps) {
|
|
|
12977
12983
|
gitRepositoryAvailable: directoryHasGitMetadata(ctx.cwd),
|
|
12978
12984
|
explicitSearch: true,
|
|
12979
12985
|
rerankConnectionFile: deps.rerankConnectionFile,
|
|
12986
|
+
signal,
|
|
12980
12987
|
...dateRange
|
|
12981
12988
|
});
|
|
12982
12989
|
return {
|
|
@@ -13521,6 +13528,11 @@ function createTodowriteTool() {
|
|
|
13521
13528
|
|
|
13522
13529
|
// src/tools/index.ts
|
|
13523
13530
|
var CTX_MEMORY_TOOL_NAME = "ctx_memory";
|
|
13531
|
+
function setOmpEssentialLoadMode(definition) {
|
|
13532
|
+
if (resolvePiHarnessKind() !== "omp")
|
|
13533
|
+
return definition;
|
|
13534
|
+
return Object.assign(definition, { loadMode: "essential" });
|
|
13535
|
+
}
|
|
13524
13536
|
function syncCtxMemoryToolEnabled(pi, memoryEnabled) {
|
|
13525
13537
|
const activeTools = pi.getActiveTools();
|
|
13526
13538
|
const isActive = activeTools.includes(CTX_MEMORY_TOOL_NAME);
|
|
@@ -13539,11 +13551,11 @@ function registerMagicContextTools(pi, opts) {
|
|
|
13539
13551
|
const surfaceTool = (definition) => {
|
|
13540
13552
|
const parameters = structuredClone(definition.parameters);
|
|
13541
13553
|
applyJsonSchemaParameterDescriptions(definition.name, parameters, registration.preset, smartNotesAvailable ? opts.smartNotesEnabled : false);
|
|
13542
|
-
return throwReturnedToolErrors({
|
|
13554
|
+
return setOmpEssentialLoadMode(throwReturnedToolErrors({
|
|
13543
13555
|
...definition,
|
|
13544
13556
|
parameters,
|
|
13545
13557
|
description: definition.name === "ctx_note" && !smartNotesAvailable ? withoutSmartNoteText(registration.preset === "light" ? CTX_NOTE_LIGHT_DESCRIPTION : definition.description) : registration.descriptionFor(definition.name, definition.description)
|
|
13546
|
-
});
|
|
13558
|
+
}));
|
|
13547
13559
|
};
|
|
13548
13560
|
pi.registerTool(surfaceTool(createCtxSearchTool({
|
|
13549
13561
|
db: opts.db,
|
|
@@ -13565,7 +13577,7 @@ function registerMagicContextTools(pi, opts) {
|
|
|
13565
13577
|
};
|
|
13566
13578
|
pi.registerTool(surfaceTool(createCtxMemoryTool(memoryDeps)));
|
|
13567
13579
|
if (opts.allowDreamerActions === true) {
|
|
13568
|
-
pi.registerTool(throwReturnedToolErrors(createCtxMemoryListTool(memoryDeps)));
|
|
13580
|
+
pi.registerTool(setOmpEssentialLoadMode(throwReturnedToolErrors(createCtxMemoryListTool(memoryDeps))));
|
|
13569
13581
|
}
|
|
13570
13582
|
}
|
|
13571
13583
|
if (!opts.sessionScopedToolsDisabled) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-my0dn413.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./index-0h2mkab2.js";
|
|
7
7
|
import {
|
|
8
8
|
log2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-fgs78jyd.js";
|
|
10
10
|
import {
|
|
11
11
|
inRootAsyncContext2
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-hws5f0z9.js";
|
|
13
13
|
|
|
14
14
|
// ../plugin/src/features/magic-context/memory/embedding-synapse.ts
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
@@ -3,18 +3,21 @@ import {
|
|
|
3
3
|
tagRevisionCountSql,
|
|
4
4
|
tagRevisionKey,
|
|
5
5
|
TAG_INSERT_CONFLICT_ROWS
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-w1avzkdt.js";
|
|
7
7
|
import {
|
|
8
8
|
getTagsBySession2,
|
|
9
9
|
getTagsByNumbers2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-bttctq07.js";
|
|
11
11
|
import {
|
|
12
12
|
inRootAsyncContext2,
|
|
13
13
|
getSqliteDatabasePath2
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-hws5f0z9.js";
|
|
15
15
|
import {
|
|
16
16
|
createFailClosedBlockingError
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-mtvvhcw4.js";
|
|
18
|
+
import {
|
|
19
|
+
createWorkerShutdown
|
|
20
|
+
} from "./index-54wmg4rj.js";
|
|
18
21
|
|
|
19
22
|
// src/tag-snapshot-worker-client-pi.ts
|
|
20
23
|
import { setImmediate as yieldImmediate } from "node:timers/promises";
|
|
@@ -228,6 +231,7 @@ function startPiTagSnapshotWorker(request, options = {}) {
|
|
|
228
231
|
const started = performance.now();
|
|
229
232
|
const consumer = createPiHydrationPacketConsumer(request, options.cached, options.byteLimit);
|
|
230
233
|
const worker = inRootAsyncContext2(() => new Worker(entry, { workerData: request }));
|
|
234
|
+
const shutdown = createWorkerShutdown(worker, "pi-tag-snapshot", 1000);
|
|
231
235
|
let exited = false;
|
|
232
236
|
let settled = false;
|
|
233
237
|
let consumption = Promise.resolve();
|
|
@@ -292,7 +296,7 @@ function startPiTagSnapshotWorker(request, options = {}) {
|
|
|
292
296
|
clearTimeout(timer);
|
|
293
297
|
rejectResult(error);
|
|
294
298
|
if (!exited)
|
|
295
|
-
|
|
299
|
+
shutdown.close();
|
|
296
300
|
}
|
|
297
301
|
const timer = inRootAsyncContext2(() => setTimeout(() => abort(new PiTagHydrationError("job deadline exceeded", "deadline")), options.deadlineMs ?? 1e4));
|
|
298
302
|
timer.unref();
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
importPluginModule,
|
|
6
6
|
writeForwardedLogLine2,
|
|
7
7
|
log2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-fgs78jyd.js";
|
|
9
9
|
import {
|
|
10
10
|
inRootAsyncContext2,
|
|
11
11
|
registerSlowWriteReporter2,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
withoutSqliteTransformPass2,
|
|
17
17
|
isTransientSqliteError2,
|
|
18
18
|
withPrivilegedWriter2
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-hws5f0z9.js";
|
|
20
20
|
import {
|
|
21
21
|
scheduleAfterBootQuiet
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-p63nwn5v.js";
|
|
23
23
|
import {
|
|
24
24
|
getHarness2,
|
|
25
25
|
harnessOwnsOpenCodeStore2
|
|
@@ -34,13 +34,13 @@ import {
|
|
|
34
34
|
parseRpcPortFile,
|
|
35
35
|
inspectProcessesAsync,
|
|
36
36
|
inspectWindowsProcessesSync
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-n4wyxcgr.js";
|
|
38
38
|
import {
|
|
39
39
|
configureContextDatabasePragmas2
|
|
40
40
|
} from "./index-fapenpch.js";
|
|
41
41
|
import {
|
|
42
42
|
startMessageFtsRowidMapBackfill2
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-rgfb753z.js";
|
|
44
44
|
import {
|
|
45
45
|
LKG_SLOT_CHUNKS_DDL,
|
|
46
46
|
SESSION_REPLAY_DECISIONS_DDL,
|
|
@@ -50,13 +50,13 @@ import {
|
|
|
50
50
|
hasPendingMigrations,
|
|
51
51
|
getMainThreadMigrationBodyCount,
|
|
52
52
|
runMigrations
|
|
53
|
-
} from "./index-
|
|
53
|
+
} from "./index-5vgt1zeh.js";
|
|
54
54
|
import {
|
|
55
55
|
closeQuietly,
|
|
56
56
|
ensureColumn,
|
|
57
57
|
installV95PerfSchema,
|
|
58
58
|
installTagIdentityRevisionTrigger
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-w1avzkdt.js";
|
|
60
60
|
import {
|
|
61
61
|
resolveOpenCodeDbPath,
|
|
62
62
|
hasV1MessageTables,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
} from "./index-8976mezv.js";
|
|
66
66
|
import {
|
|
67
67
|
logSlowWriteTransaction
|
|
68
|
-
} from "./index-
|
|
68
|
+
} from "./index-hqw0rt9k.js";
|
|
69
69
|
import {
|
|
70
70
|
shouldEnforcePrivateStoragePermissions,
|
|
71
71
|
ensureStorageDirectorySync,
|
|
@@ -1305,8 +1305,8 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
1305
1305
|
state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
|
|
1306
1306
|
if (signal.aborted || !readsOpenCodeStore)
|
|
1307
1307
|
return;
|
|
1308
|
-
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-
|
|
1309
|
-
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-
|
|
1308
|
+
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-7g4zvpd8.js"));
|
|
1309
|
+
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-kc10yrcj.js"));
|
|
1310
1310
|
if (signal.aborted)
|
|
1311
1311
|
return;
|
|
1312
1312
|
await startMessageTimeBackfill(db, Object.assign(readRawSessionMessages, {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMagicContextStorageDir,
|
|
3
3
|
log2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-fgs78jyd.js";
|
|
5
5
|
import {
|
|
6
6
|
inRootAsyncContext2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-hws5f0z9.js";
|
|
8
8
|
import {
|
|
9
9
|
projectDirectoryKey
|
|
10
10
|
} from "./index-wrr9rp9a.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./index-0h2mkab2.js";
|
|
4
4
|
import {
|
|
5
5
|
isUserHomeDirectory
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-p63nwn5v.js";
|
|
7
7
|
import {
|
|
8
8
|
logSlowWriteTransaction
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-hqw0rt9k.js";
|
|
10
10
|
|
|
11
11
|
// ../plugin/src/features/magic-context/session-project-storage.ts
|
|
12
12
|
var SESSION_CHUNK_REPAIR_BATCH_SIZE = 100;
|
|
@@ -2,13 +2,16 @@ import {
|
|
|
2
2
|
inRootAsyncContext2,
|
|
3
3
|
getSqliteDatabasePath2,
|
|
4
4
|
releaseIndexOwner2
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hws5f0z9.js";
|
|
6
6
|
import {
|
|
7
7
|
registerExitAbort
|
|
8
8
|
} from "./index-399p688g.js";
|
|
9
9
|
import {
|
|
10
10
|
log2
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-fgs78jyd.js";
|
|
12
|
+
import {
|
|
13
|
+
createWorkerShutdown
|
|
14
|
+
} from "./index-54wmg4rj.js";
|
|
12
15
|
|
|
13
16
|
// ../plugin/src/hooks/magic-context/read-session-raw.ts
|
|
14
17
|
import { isMainThread } from "node:worker_threads";
|
|
@@ -17,6 +20,7 @@ import { isMainThread } from "node:worker_threads";
|
|
|
17
20
|
import { Worker } from "node:worker_threads";
|
|
18
21
|
var ACCEPT_TIMEOUT_MS = 2000;
|
|
19
22
|
var RESULT_TIMEOUT_MS = 10 * 60000;
|
|
23
|
+
var WARMUP_CLOSE_DEADLINE_MS = 2000;
|
|
20
24
|
var FAILURE_BACKOFF_MS = 5 * 60000;
|
|
21
25
|
var inFlight = new Map;
|
|
22
26
|
var connectionIds = new WeakMap;
|
|
@@ -45,6 +49,7 @@ function runSessionWarmupWorker(input, options) {
|
|
|
45
49
|
return new Promise((resolve) => {
|
|
46
50
|
const openCancellation = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
|
47
51
|
let worker;
|
|
52
|
+
let shutdown;
|
|
48
53
|
let deadline;
|
|
49
54
|
let settled = false;
|
|
50
55
|
const finish = (result) => {
|
|
@@ -56,7 +61,7 @@ function runSessionWarmupWorker(input, options) {
|
|
|
56
61
|
options.signal?.removeEventListener("abort", abort);
|
|
57
62
|
if (worker) {
|
|
58
63
|
activeWorkers.delete(worker);
|
|
59
|
-
const stopped = worker.terminate();
|
|
64
|
+
const stopped = shutdown?.close() ?? worker.terminate();
|
|
60
65
|
worker.unref();
|
|
61
66
|
stopped.finally(() => {
|
|
62
67
|
releaseIndexOwner2(input);
|
|
@@ -82,6 +87,7 @@ function runSessionWarmupWorker(input, options) {
|
|
|
82
87
|
worker = inRootAsyncContext2(() => new Worker(options.entry ?? defaultEntry(), {
|
|
83
88
|
workerData: { ...input, openCancellation: openCancellation.buffer }
|
|
84
89
|
}));
|
|
90
|
+
shutdown = createWorkerShutdown(worker, "raw-ordinal-warmup", WARMUP_CLOSE_DEADLINE_MS);
|
|
85
91
|
} catch (error) {
|
|
86
92
|
finish({ failure: "start-failed", detail: String(error) });
|
|
87
93
|
return;
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
getSqliteDatabasePath2,
|
|
3
3
|
withSqliteBackgroundWriter2,
|
|
4
4
|
withoutSqliteTransformPass2
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hws5f0z9.js";
|
|
6
6
|
import {
|
|
7
7
|
runSessionWarmupWorker
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-rfyvax95.js";
|
|
9
9
|
import {
|
|
10
10
|
logSlowWriteTransaction
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-hqw0rt9k.js";
|
|
12
12
|
|
|
13
13
|
// ../plugin/src/features/magic-context/message-fts-rowid-map.ts
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./index-1cvyaw9a.js";
|
|
4
4
|
import {
|
|
5
5
|
estimateTokens
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-my0dn413.js";
|
|
7
7
|
import {
|
|
8
8
|
readRawSessionMessageIdOrdinalsForRange2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-zhwwp8zz.js";
|
|
10
10
|
|
|
11
11
|
// ../plugin/src/tools/ctx-expand/search-archive.ts
|
|
12
12
|
var archiveReadsOnThisThread = 0;
|