@cortexkit/pi-magic-context 0.49.31 → 0.49.33
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 +4 -4
- package/dist/chunk-embedding-write-worker.js +4 -4
- package/dist/{compartment-chunk-embedding-pkk5beqp.js → compartment-chunk-embedding-8c85ebce.js} +1 -1
- package/dist/{embedding-backfill-v83xh6e8.js → embedding-backfill-rwfmyvze.js} +3 -3
- package/dist/{index-kmk3xpf9.js → index-0gymvr5j.js} +47 -7
- package/dist/{index-34e3mm36.js → index-87xkw8xm.js} +6 -4
- package/dist/{index-4nny4r40.js → index-9xd7qveg.js} +1 -1
- package/dist/{index-g026ztby.js → index-c474g0gj.js} +4 -18
- package/dist/{index-sr1ss4f8.js → index-d5q1q700.js} +1 -1
- package/dist/{index-v40sm8q6.js → index-drmr22ac.js} +3 -3
- package/dist/{index-bpd654bz.js → index-e59j3yq5.js} +414 -11
- package/dist/{index-0x1c054v.js → index-eqw9t2ty.js} +1 -1
- package/dist/{index-2nryd8ye.js → index-k5ya5k8r.js} +16 -12
- package/dist/index-nrzkqte4.js +18 -0
- package/dist/{index-0s14xaca.js → index-pb3ea2tq.js} +1 -1
- package/dist/{index-xvqcqg0r.js → index-r9y6tbbm.js} +6 -4
- package/dist/{index-yddeb86g.js → index-wpazxe9x.js} +64 -3
- package/dist/{index-0jykn0dw.js → index-xn5yh0pn.js} +65 -2
- package/dist/index.js +85 -314
- package/dist/{message-index-bounded-7aw556kv.js → message-index-bounded-n30vk21s.js} +4 -4
- package/dist/migration-worker.js +6 -5
- package/dist/{project-embedding-registry-wwbhm9rf.js → project-embedding-registry-acqb6be4.js} +2 -2
- package/dist/raw-ordinal-warmup-worker.js +3 -3
- package/dist/{read-session-chunk-xrymr0pp.js → read-session-chunk-ka6dhc77.js} +3 -3
- package/dist/{search-archive-5tmg1jyb.js → search-archive-msy2bczx.js} +4 -4
- package/dist/{search-dcdmpc62.js → search-qbxrnnjb.js} +9 -9
- package/dist/{storage-tags-9qaasrky.js → storage-tags-6409qq18.js} +2 -2
- package/dist/subagent-entry.js +12 -12
- package/dist/tag-snapshot-worker-pi.js +5 -5
- package/package.json +1 -1
|
@@ -24,12 +24,12 @@ var [
|
|
|
24
24
|
{ Database, registerSqliteDiagnosticSink },
|
|
25
25
|
{ log }
|
|
26
26
|
] = await Promise.all([
|
|
27
|
-
import("./embedding-backfill-
|
|
27
|
+
import("./embedding-backfill-rwfmyvze.js"),
|
|
28
28
|
import("./embedding-cache-7rp4gqzr.js"),
|
|
29
29
|
import("./storage-memory-0ndn65fm.js"),
|
|
30
|
-
import("./project-embedding-registry-
|
|
31
|
-
import("./search-
|
|
32
|
-
import("./compartment-chunk-embedding-
|
|
30
|
+
import("./project-embedding-registry-acqb6be4.js"),
|
|
31
|
+
import("./search-qbxrnnjb.js"),
|
|
32
|
+
import("./compartment-chunk-embedding-8c85ebce.js"),
|
|
33
33
|
import("./embedding-activity-ew6dshfd.js"),
|
|
34
34
|
import("./harness-9872e0ym.js"),
|
|
35
35
|
import("./sqlite-v89bj0yy.js"),
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
recordChunkEmbedBackoff2,
|
|
23
23
|
loadUnembeddedSessionChunkCandidates2,
|
|
24
24
|
countUnembeddedSessionCompartments2
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-0gymvr5j.js";
|
|
26
26
|
import {
|
|
27
27
|
recordSessionProjectIdentity,
|
|
28
28
|
acquireGitSweepLease,
|
|
@@ -33,9 +33,9 @@ import"./index-48twbev2.js";
|
|
|
33
33
|
import {
|
|
34
34
|
LATEST_SUPPORTED_VERSION,
|
|
35
35
|
enforceSchemaFence
|
|
36
|
-
} from "./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
36
|
+
} from "./index-r9y6tbbm.js";
|
|
37
|
+
import"./index-pb3ea2tq.js";
|
|
38
|
+
import"./index-c474g0gj.js";
|
|
39
39
|
import"./index-135e8hvg.js";
|
|
40
40
|
import"./index-23t8ryqw.js";
|
|
41
41
|
import"./index-hqw0rt9k.js";
|
package/dist/{compartment-chunk-embedding-pkk5beqp.js → compartment-chunk-embedding-8c85ebce.js}
RENAMED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
countSessionCompartmentEmbedCoverage2,
|
|
25
25
|
countSessionCompartmentEmbedCoveragePolite2,
|
|
26
26
|
countUnembeddedSessionCompartmentsPolite2
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-0gymvr5j.js";
|
|
28
28
|
import"./index-gwxaz0z5.js";
|
|
29
29
|
import"./index-bvpar0bg.js";
|
|
30
30
|
import"./index-6981g1xv.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureMemoryEmbeddings2
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
3
|
+
} from "./index-9xd7qveg.js";
|
|
4
|
+
import"./index-xn5yh0pn.js";
|
|
5
5
|
import"./index-9p40dgkm.js";
|
|
6
6
|
import"./index-yhzhdp3m.js";
|
|
7
7
|
import"./index-4zemngt7.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-0gymvr5j.js";
|
|
9
9
|
import"./index-wqpjhx1p.js";
|
|
10
10
|
import"./index-gwxaz0z5.js";
|
|
11
11
|
import"./index-ccanzg8p.js";
|
|
@@ -14,6 +14,9 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
messageFtsOrdinalRangeIsMapped2
|
|
16
16
|
} from "./index-bvpar0bg.js";
|
|
17
|
+
import {
|
|
18
|
+
isKnownAutocommit
|
|
19
|
+
} from "./index-nrzkqte4.js";
|
|
17
20
|
|
|
18
21
|
// ../plugin/src/features/magic-context/compartment-chunk-embedding.ts
|
|
19
22
|
import { createHash } from "node:crypto";
|
|
@@ -346,15 +349,15 @@ function readDatabaseRevision(db) {
|
|
|
346
349
|
if (!statements) {
|
|
347
350
|
statements = {
|
|
348
351
|
version: db.prepare("PRAGMA data_version"),
|
|
349
|
-
changes: db.prepare("SELECT total_changes() AS changes")
|
|
352
|
+
changes: db.prepare("SELECT total_changes() AS changes, (SELECT schema_version FROM pragma_schema_version) AS schemaVersion")
|
|
350
353
|
};
|
|
351
354
|
revisionStatements.set(db, statements);
|
|
352
355
|
}
|
|
353
356
|
const version = statements.version.get();
|
|
354
357
|
const changes = statements.changes.get();
|
|
355
|
-
if (typeof version?.data_version !== "number" || typeof changes?.changes !== "number")
|
|
358
|
+
if (typeof version?.data_version !== "number" || typeof changes?.changes !== "number" || typeof changes.schemaVersion !== "number")
|
|
356
359
|
return null;
|
|
357
|
-
return `${version.data_version}:${changes.changes}`;
|
|
360
|
+
return `${version.data_version}:${changes.changes}:${changes.schemaVersion}`;
|
|
358
361
|
}
|
|
359
362
|
function sameSearchScope(left, right) {
|
|
360
363
|
return left.rowCount === right.rowCount && left.maxRowId === right.maxRowId && left.rowIdSum === right.rowIdSum && (left.metadata === right.metadata || [...left.metadata].every(([id, value]) => right.metadata.get(id) === value));
|
|
@@ -1198,6 +1201,44 @@ function storedWindowsMatchRecordedSource(db, compartmentId, sourceKey, existing
|
|
|
1198
1201
|
}
|
|
1199
1202
|
var COVERAGE_MEMO_LIMIT = 2048;
|
|
1200
1203
|
var cachedCoverageWindows = new Map;
|
|
1204
|
+
var cachedCoverageSources = new WeakMap;
|
|
1205
|
+
function coverageSource(db, candidate, modelId, maxInputTokens) {
|
|
1206
|
+
const revision = isKnownAutocommit(db) ? readDatabaseRevision(db) : null;
|
|
1207
|
+
if (revision === null)
|
|
1208
|
+
cachedCoverageSources.delete(db);
|
|
1209
|
+
let cache = cachedCoverageSources.get(db);
|
|
1210
|
+
if (revision !== null && cache?.revision !== revision) {
|
|
1211
|
+
cache = { revision, entries: new Map };
|
|
1212
|
+
cachedCoverageSources.set(db, cache);
|
|
1213
|
+
}
|
|
1214
|
+
const key = JSON.stringify([
|
|
1215
|
+
candidate.id,
|
|
1216
|
+
candidate.sessionId,
|
|
1217
|
+
candidate.startMessage,
|
|
1218
|
+
candidate.endMessage,
|
|
1219
|
+
modelId,
|
|
1220
|
+
maxInputTokens,
|
|
1221
|
+
CHUNKER_VERSION,
|
|
1222
|
+
getTokenEstimatorFingerprint()
|
|
1223
|
+
]);
|
|
1224
|
+
const cached = cache?.entries.get(key);
|
|
1225
|
+
if (cached)
|
|
1226
|
+
return cached;
|
|
1227
|
+
const mappedText = buildCanonicalChunkTextFromFts2(db, candidate.sessionId, candidate.startMessage, candidate.endMessage);
|
|
1228
|
+
if (mappedText === null)
|
|
1229
|
+
return null;
|
|
1230
|
+
const canonicalText = mappedText || buildCompartmentSummaryFallbackText2(db, candidate.id);
|
|
1231
|
+
const source = {
|
|
1232
|
+
canonicalText,
|
|
1233
|
+
sourceKey: chunkWindowSourceKey2(canonicalText, candidate.startMessage, candidate.endMessage, maxInputTokens)
|
|
1234
|
+
};
|
|
1235
|
+
if (cache && readDatabaseRevision(db) === revision) {
|
|
1236
|
+
if (cache.entries.size >= 8192)
|
|
1237
|
+
cache.entries.delete(cache.entries.keys().next().value);
|
|
1238
|
+
cache.entries.set(key, source);
|
|
1239
|
+
}
|
|
1240
|
+
return source;
|
|
1241
|
+
}
|
|
1201
1242
|
function memoizedCoverageWindows(candidate, canonicalText, sourceKey, modelId, maxInputTokens) {
|
|
1202
1243
|
const key = JSON.stringify([candidate.id, sourceKey, modelId]);
|
|
1203
1244
|
const cached = cachedCoverageWindows.get(key);
|
|
@@ -1236,14 +1277,13 @@ function renumberOneBasedChunkWindows(db, candidate, projectPath, modelId, windo
|
|
|
1236
1277
|
}).immediate();
|
|
1237
1278
|
}
|
|
1238
1279
|
function classifyChunkCoverageDefect(db, projectPath, modelId, candidate, maxInputTokens) {
|
|
1239
|
-
const
|
|
1240
|
-
if (
|
|
1280
|
+
const source = coverageSource(db, candidate, modelId, maxInputTokens);
|
|
1281
|
+
if (source === null)
|
|
1241
1282
|
return { defect: "deferred", windows: [] };
|
|
1242
|
-
const canonicalText
|
|
1283
|
+
const { canonicalText, sourceKey } = source;
|
|
1243
1284
|
if (!canonicalText || chunkEmbedBackoffActive(db, candidate, projectPath, modelId, canonicalText)) {
|
|
1244
1285
|
return { defect: "deferred", windows: [] };
|
|
1245
1286
|
}
|
|
1246
|
-
const sourceKey = chunkWindowSourceKey2(canonicalText, candidate.startMessage, candidate.endMessage, maxInputTokens);
|
|
1247
1287
|
const existing = getExistingChunkHashes(db, candidate.id, modelId, projectPath);
|
|
1248
1288
|
if (storedWindowsMatchRecordedSource(db, candidate.id, sourceKey, existing)) {
|
|
1249
1289
|
return { defect: null, windows: [], sourceKey, confirmedByRecord: true };
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
TAG_SELECT_COLUMNS2,
|
|
24
24
|
getCandidateToolOwners2,
|
|
25
25
|
pickNearestPriorOwner2
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-eqw9t2ty.js";
|
|
27
27
|
import {
|
|
28
28
|
OMO_INTERNAL_INITIATOR_MARKER,
|
|
29
29
|
isSystemDirective,
|
|
@@ -45,9 +45,8 @@ import {
|
|
|
45
45
|
prepareCachedStatement2
|
|
46
46
|
} from "./index-2qtx0q6h.js";
|
|
47
47
|
import {
|
|
48
|
-
stableStringify
|
|
49
|
-
|
|
50
|
-
} from "./index-g026ztby.js";
|
|
48
|
+
stableStringify
|
|
49
|
+
} from "./index-c474g0gj.js";
|
|
51
50
|
import {
|
|
52
51
|
resolveOpenCodeDbPath,
|
|
53
52
|
assertOpenCodeStoreGeneration,
|
|
@@ -73,6 +72,9 @@ import {
|
|
|
73
72
|
readRawSeedTailFromDb2,
|
|
74
73
|
readRawSessionBoundaryEndpointsFromDb2
|
|
75
74
|
} from "./index-6981g1xv.js";
|
|
75
|
+
import {
|
|
76
|
+
closeQuietly
|
|
77
|
+
} from "./index-nrzkqte4.js";
|
|
76
78
|
import {
|
|
77
79
|
logSlowWriteTransaction
|
|
78
80
|
} from "./index-hqw0rt9k.js";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionLog2
|
|
3
3
|
} from "./index-fgs78jyd.js";
|
|
4
|
+
import {
|
|
5
|
+
isKnownAutocommit
|
|
6
|
+
} from "./index-nrzkqte4.js";
|
|
4
7
|
|
|
5
8
|
// ../plugin/src/shared/stable-json.ts
|
|
6
9
|
function stableStringify(value, seen = new WeakSet) {
|
|
@@ -65,23 +68,6 @@ function jsonHashSink(prefix = "") {
|
|
|
65
68
|
return { write, digest: () => (hash >>> 0).toString(16).padStart(8, "0") };
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
// ../plugin/src/shared/sqlite-helpers.ts
|
|
69
|
-
function closeQuietly(db) {
|
|
70
|
-
if (!db)
|
|
71
|
-
return;
|
|
72
|
-
try {
|
|
73
|
-
db.close();
|
|
74
|
-
} catch {}
|
|
75
|
-
}
|
|
76
|
-
function isKnownAutocommit(db) {
|
|
77
|
-
const state = db;
|
|
78
|
-
try {
|
|
79
|
-
return state.inTransaction === false || state.isTransaction === false;
|
|
80
|
-
} catch {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
71
|
// ../plugin/src/features/magic-context/storage-schema-helpers.ts
|
|
86
72
|
var columnCaches = new WeakMap;
|
|
87
73
|
function readColumnNames(db, table) {
|
|
@@ -539,4 +525,4 @@ function deleteTagIdentityRevisions(db, sessionIds) {
|
|
|
539
525
|
}
|
|
540
526
|
}
|
|
541
527
|
|
|
542
|
-
export { stableStringify, jsonHashSink,
|
|
528
|
+
export { stableStringify, jsonHashSink, getTableColumnNames, ensureColumn, healAllNullColumns, observeTemporalDecisions, freezeTemporalDecisions, installV95PerfSchema, tagOrderConstraintIndex, tagRevisionIncarnationSql, tagRevisionCountSql, tagTombstoneOwnerRange, tagTombstoneOwnerKey, tagRevisionKey, tagIdentityRevisionKey, TAG_INSERT_CONFLICT_ROWS, installTagIdentityRevisionTrigger, deleteTagIdentityRevisions };
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
tagRevisionCountSql,
|
|
4
4
|
tagRevisionKey,
|
|
5
5
|
TAG_INSERT_CONFLICT_ROWS
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-c474g0gj.js";
|
|
7
7
|
import {
|
|
8
8
|
getTagsBySession2,
|
|
9
9
|
getTagsByNumbers2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-eqw9t2ty.js";
|
|
11
11
|
import {
|
|
12
12
|
inRootAsyncContext2,
|
|
13
13
|
getSqliteDatabasePath2,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./index-2qtx0q6h.js";
|
|
16
16
|
import {
|
|
17
17
|
createFailClosedBlockingError
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-r9y6tbbm.js";
|
|
19
19
|
import {
|
|
20
20
|
createWorkerShutdown
|
|
21
21
|
} from "./index-54wmg4rj.js";
|