@cortexkit/pi-magic-context 0.49.16 → 0.49.17
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 +76 -63
- package/dist/chunk-embedding-write-worker.js +10 -10
- package/dist/{compaction-marker-candidates-k4tqg4jb.js → compaction-marker-candidates-wjzqbspm.js} +2 -2
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/embedding-backfill-vwag34t0.js +23 -0
- package/dist/embedding-worker-process.js +1 -1
- package/dist/embedding-worker.js +4 -4
- package/dist/historian-calibration-extension.js +4 -1
- package/dist/{index-g4jf772p.js → index-1kcfwk9c.js} +22 -2
- package/dist/{index-657xh9w4.js → index-2mmy81qt.js} +2 -2
- package/dist/{index-v8d4vgam.js → index-469ttgzv.js} +6 -6
- package/dist/index-4knyh1kt.js +1387 -0
- package/dist/{index-44h64qza.js → index-5k2mshvq.js} +9 -9
- package/dist/{index-fhyy4ave.js → index-8r2t8fv2.js} +842 -73
- package/dist/{index-xmzhrht0.js → index-9j809q6f.js} +29 -18
- package/dist/{index-6dz2ed1v.js → index-d8gc0112.js} +2 -2
- package/dist/{index-x3k1530z.js → index-dvbjsh98.js} +3 -3
- package/dist/{index-hy44m6jc.js → index-e1rza8gp.js} +1 -1
- package/dist/{index-dne4ja7a.js → index-ej4eak9d.js} +2 -2
- package/dist/{index-4178cbfw.js → index-es03azap.js} +121 -2038
- package/dist/{index-ajfpyk0x.js → index-fa485mqs.js} +59 -1
- package/dist/{index-y5c73caa.js → index-g7p75667.js} +32 -3
- package/dist/{index-tympym62.js → index-gdjv1nnd.js} +2 -2
- package/dist/{index-46q4e104.js → index-qpq6w67c.js} +1 -1
- package/dist/{index-asrxgdt4.js → index-rrwv9y2k.js} +8 -0
- package/dist/{index-mx59cve4.js → index-svgkv4g2.js} +1 -1
- package/dist/{index-qqxqwqhp.js → index-vktahpdj.js} +1 -1
- package/dist/{index-n3r2d2pr.js → index-vmcgew7x.js} +10 -7
- package/dist/{index-afy3dzf9.js → index-xnch62s6.js} +12 -6
- package/dist/{index-s1xn8qfw.js → index-yygsh681.js} +6 -3
- package/dist/{index-p3evwech.js → index-z2rkv0mb.js} +3 -3
- package/dist/{index-ja1c33qa.js → index-z7kbck29.js} +2 -2
- package/dist/index.js +523 -227
- package/dist/{message-fts-rowid-map-mbanfkt1.js → message-fts-rowid-map-cvpy2dmb.js} +5 -3
- package/dist/{message-index-easvmz22.js → message-index-2g23b7fe.js} +11 -11
- package/dist/{message-index-bounded-xzerjxmp.js → message-index-bounded-d6zj2tn5.js} +15 -15
- package/dist/{message-time-backfill-3q4kemfc.js → message-time-backfill-ssshbdy8.js} +1 -1
- package/dist/migration-worker.js +7 -7
- package/dist/{project-embedding-registry-xwnmqmx8.js → project-embedding-registry-vf1ncptn.js} +10 -10
- package/dist/raw-ordinal-warmup-worker.js +10 -10
- package/dist/{read-session-chunk-1sb5n7zs.js → read-session-chunk-2ky7mbqp.js} +5 -5
- package/dist/{read-session-raw-jz5e9jz0.js → read-session-raw-9s3xn7fc.js} +2 -2
- package/dist/{search-archive-3ma5n0wr.js → search-archive-9akqcr90.js} +6 -6
- package/dist/{search-x3fa0561.js → search-zjyc65g1.js} +17 -17
- package/dist/{sqlite-adjpy399.js → sqlite-fsp0sf3r.js} +1 -1
- package/dist/{storage-memory-axnsk5t1.js → storage-memory-yxxc5v4n.js} +2 -2
- package/dist/{storage-tags-jtessrec.js → storage-tags-cx6ccsv1.js} +3 -3
- package/dist/subagent-entry.js +22 -21
- package/dist/tag-snapshot-worker-pi.js +9 -9
- package/package.json +1 -1
- package/dist/embedding-backfill-c4bdw8pp.js +0 -23
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
inRootAsyncContext2,
|
|
6
6
|
isTransientSqliteError2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-rrwv9y2k.js";
|
|
8
8
|
import {
|
|
9
9
|
PROMOTABLE_CATEGORIES,
|
|
10
10
|
CATEGORY_DEFAULT_TTL
|
|
@@ -22,17 +22,17 @@ import {
|
|
|
22
22
|
resolveStoredPathWorkspaceIdentity,
|
|
23
23
|
sourceNameForMemory,
|
|
24
24
|
managedAuthorityNoteRow
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-gdjv1nnd.js";
|
|
26
26
|
import {
|
|
27
27
|
isKnownAutocommit
|
|
28
28
|
} from "./index-jrap43gc.js";
|
|
29
29
|
import {
|
|
30
30
|
SubcClient
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-d8gc0112.js";
|
|
32
32
|
import {
|
|
33
33
|
buildCanonicalChunkTextFromFts,
|
|
34
34
|
loadCompartmentChunkEmbeddingsForSearch
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-xnch62s6.js";
|
|
36
36
|
import {
|
|
37
37
|
recordEmbeddingMeasurement,
|
|
38
38
|
saveCommitEmbedding,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
getProjectEmbeddingSnapshot2,
|
|
51
51
|
embedTextForProject2,
|
|
52
52
|
embedItemsForProject2
|
|
53
|
-
} from "./index-
|
|
53
|
+
} from "./index-vmcgew7x.js";
|
|
54
54
|
import {
|
|
55
55
|
saveEmbeddingIfHashMatches,
|
|
56
56
|
getProjectEmbeddings2
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
isEmbeddingEnabled,
|
|
61
61
|
embedText,
|
|
62
62
|
ensureMemoryEmbeddings2
|
|
63
|
-
} from "./index-
|
|
63
|
+
} from "./index-z2rkv0mb.js";
|
|
64
64
|
import {
|
|
65
65
|
getMemorySelectColumns2,
|
|
66
66
|
isMemoryRow2,
|
|
@@ -74,14 +74,17 @@ import {
|
|
|
74
74
|
getMemoryById2,
|
|
75
75
|
updateMemorySeenCount2,
|
|
76
76
|
updateMemoryRetrievalCount2
|
|
77
|
-
} from "./index-
|
|
77
|
+
} from "./index-e1rza8gp.js";
|
|
78
|
+
import {
|
|
79
|
+
cleanSearchText,
|
|
80
|
+
keywordRelevance,
|
|
81
|
+
matchedSearchSnippet,
|
|
82
|
+
getIndexedMessageCorpusSize2
|
|
83
|
+
} from "./index-8r2t8fv2.js";
|
|
78
84
|
import {
|
|
79
85
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
80
86
|
withMessageFtsSessionFilter
|
|
81
87
|
} from "./index-1cvyaw9a.js";
|
|
82
|
-
import {
|
|
83
|
-
getIndexedMessageCorpusSize2
|
|
84
|
-
} from "./index-fhyy4ave.js";
|
|
85
88
|
import {
|
|
86
89
|
computeNormalizedHash
|
|
87
90
|
} from "./index-9x1f96r8.js";
|
|
@@ -1499,6 +1502,10 @@ async function indexCommitsForProject(db, projectPath, directory, options) {
|
|
|
1499
1502
|
embedded: 0,
|
|
1500
1503
|
nonIndexable: false
|
|
1501
1504
|
};
|
|
1505
|
+
if (projectPath.startsWith("dir:")) {
|
|
1506
|
+
result.nonIndexable = true;
|
|
1507
|
+
return result;
|
|
1508
|
+
}
|
|
1502
1509
|
if (indexInProgress.has(projectPath)) {
|
|
1503
1510
|
log2(`[git-commits] index already in progress for ${projectPath}, skipping`);
|
|
1504
1511
|
return result;
|
|
@@ -1552,6 +1559,7 @@ async function embedUnembeddedCommits(db, projectPath) {
|
|
|
1552
1559
|
embedInProgress.add(projectPath);
|
|
1553
1560
|
const startedAt = Date.now();
|
|
1554
1561
|
const deadline = startedAt + EMBED_SWEEP_MAX_WALL_CLOCK_MS;
|
|
1562
|
+
const signal = AbortSignal.timeout(EMBED_SWEEP_MAX_WALL_CLOCK_MS);
|
|
1555
1563
|
let total = 0;
|
|
1556
1564
|
try {
|
|
1557
1565
|
while (Date.now() < deadline && total < EMBED_MAX_PER_SWEEP) {
|
|
@@ -1564,7 +1572,7 @@ async function embedUnembeddedCommits(db, projectPath) {
|
|
|
1564
1572
|
id: `commit:${row.sha}`,
|
|
1565
1573
|
text: row.message,
|
|
1566
1574
|
contentSha256: contentSha2562(row.message)
|
|
1567
|
-
})),
|
|
1575
|
+
})), signal, db, projectPath);
|
|
1568
1576
|
if (!result)
|
|
1569
1577
|
break;
|
|
1570
1578
|
db.transaction(() => {
|
|
@@ -2922,7 +2930,7 @@ function searchMessagesInSnapshot(args, sessionFirst) {
|
|
|
2922
2930
|
const filtered = rows.slice(0, limit);
|
|
2923
2931
|
return filtered.map((row, rank) => ({
|
|
2924
2932
|
source: "message",
|
|
2925
|
-
content: previewText(row.content),
|
|
2933
|
+
content: matchedSearchSnippet(row.content, args.query) || previewText(row.content),
|
|
2926
2934
|
score: linearDecayScore(rank, filtered.length),
|
|
2927
2935
|
messageOrdinal: row.messageOrdinal,
|
|
2928
2936
|
messageId: row.messageId,
|
|
@@ -2999,7 +3007,7 @@ function searchMessagesInSnapshot(args, sessionFirst) {
|
|
|
2999
3007
|
const ranked = [...fused.values()].sort((a, b) => b.score !== a.score ? b.score - a.score : a.row.messageOrdinal - b.row.messageOrdinal).slice(0, resultLimit);
|
|
3000
3008
|
return ranked.map((entry, rank) => ({
|
|
3001
3009
|
source: "message",
|
|
3002
|
-
content: previewText(entry.row.content),
|
|
3010
|
+
content: matchedSearchSnippet(entry.row.content, args.query) || previewText(entry.row.content),
|
|
3003
3011
|
score: linearDecayScore(rank, ranked.length),
|
|
3004
3012
|
messageOrdinal: entry.row.messageOrdinal,
|
|
3005
3013
|
messageId: entry.row.messageId,
|
|
@@ -3222,10 +3230,7 @@ function mergeMessageAndCompartmentResults(args) {
|
|
|
3222
3230
|
}
|
|
3223
3231
|
}
|
|
3224
3232
|
const ranked = [...fused.values()].sort((left, right) => right.score !== left.score ? right.score - left.score : left.tieOrdinal - right.tieOrdinal).slice(0, args.limit);
|
|
3225
|
-
return ranked.map((entry
|
|
3226
|
-
...entry.result,
|
|
3227
|
-
score: linearDecayScore(rank, ranked.length)
|
|
3228
|
-
}));
|
|
3233
|
+
return ranked.map((entry) => entry.result);
|
|
3229
3234
|
}
|
|
3230
3235
|
function getSourceBoost(result) {
|
|
3231
3236
|
switch (result.source) {
|
|
@@ -3503,7 +3508,7 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
|
|
|
3503
3508
|
if (options.diagnostics) {
|
|
3504
3509
|
options.diagnostics.suppressedLiveMessageMatches = outcome.suppressedLiveMessageMatches;
|
|
3505
3510
|
}
|
|
3506
|
-
messageResults = outcome.results;
|
|
3511
|
+
messageResults = outcome.results.filter((result) => result.messageId !== options.excludeMessageId);
|
|
3507
3512
|
if (lanes)
|
|
3508
3513
|
lanes.message_fts = (outcome.laneResults ?? outcome.results).slice(0, 25);
|
|
3509
3514
|
}
|
|
@@ -3636,6 +3641,12 @@ async function unifiedSearch2(db, sessionId, projectPath, query, options = {}) {
|
|
|
3636
3641
|
}).immediate();
|
|
3637
3642
|
}
|
|
3638
3643
|
}
|
|
3644
|
+
if (options.autoHint) {
|
|
3645
|
+
return results.map((result) => ({
|
|
3646
|
+
...result,
|
|
3647
|
+
relevanceScore: cleanSearchText(result.source === "compartment" ? result.title : result.content).length === 0 ? 0 : result.source === "message" || ("matchType" in result) && result.source !== "compartment" && result.matchType !== "semantic" ? keywordRelevance(trimmedQuery, result.content) : result.score
|
|
3648
|
+
}));
|
|
3649
|
+
}
|
|
3639
3650
|
return results;
|
|
3640
3651
|
}
|
|
3641
3652
|
var SEARCH_NOTE_EXPAND_HINT = "Use ctx_expand(start=N-10, end=N) around any note @msg anchor above to read the surrounding conversation context.";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-1kcfwk9c.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./index-0h2mkab2.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./index-7bqrfyny.js";
|
|
10
10
|
import {
|
|
11
11
|
inRootAsyncContext2
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-rrwv9y2k.js";
|
|
13
13
|
|
|
14
14
|
// ../plugin/src/features/magic-context/memory/embedding-synapse.ts
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
getTagsBySession2,
|
|
9
9
|
getTagsByNumbers2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-ej4eak9d.js";
|
|
11
11
|
import {
|
|
12
12
|
inRootAsyncContext2,
|
|
13
13
|
getSqliteDatabasePath2
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-rrwv9y2k.js";
|
|
15
15
|
import {
|
|
16
16
|
createFailClosedBlockingError
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-469ttgzv.js";
|
|
18
18
|
|
|
19
19
|
// src/tag-snapshot-worker-client-pi.ts
|
|
20
20
|
import { setImmediate as yieldImmediate } from "node:timers/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
estimateTokens
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-1kcfwk9c.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./index-0h2mkab2.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
getTagIdentityWriteGeneration2,
|
|
12
12
|
getSqliteDatabasePath2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-rrwv9y2k.js";
|
|
14
14
|
import {
|
|
15
15
|
jsonHashSink,
|
|
16
16
|
tagOrderConstraintIndex,
|