@cortexkit/opencode-magic-context 0.49.38 → 0.49.39
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 +1 -1
- package/dist/{context-3vgc2dmf.js → context-na1w4gqp.js} +9 -9
- package/dist/features/magic-context/auto-search-diagnostics.d.ts +3 -1
- package/dist/features/magic-context/auto-search-diagnostics.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/{index-2rs7912w.js → index-9z4d2ha0.js} +34 -1
- package/dist/{index-7rn2x4gq.js → index-gfd41hm4.js} +10 -10
- package/dist/{index-dz48h1wx.js → index-hb76vdmm.js} +11 -5
- package/dist/{index-dfdg2cgg.js → index-hf771sk4.js} +7 -7
- package/dist/{index-8wztpf82.js → index-j5qma52p.js} +10 -9
- package/dist/{index-ys7j6679.js → index-m8v7nqgp.js} +1 -1
- package/dist/{index-4ks89h5a.js → index-ryz4pdvf.js} +1 -1
- package/dist/{index-9tdvbdv1.js → index-tr6vcwt0.js} +1 -1
- package/dist/{index-pp8vdn01.js → index-wk7x13qv.js} +2 -2
- package/dist/{index-prw8apnc.js → index-z7etaphs.js} +2 -2
- package/dist/index.js +13 -13
- package/dist/{message-index-bounded-wfk6aqxk.js → message-index-bounded-jqm3ezva.js} +1 -1
- package/dist/raw-ordinal-warmup-worker.js +3 -3
- package/dist/{recomp-orchestrator-wk509qkp.js → recomp-orchestrator-34mh19vm.js} +3 -3
- package/dist/{render-h1qarr8a.js → render-gqdq6t7f.js} +1 -1
- package/dist/{search-archive-q79hyqxs.js → search-archive-kfwpk73t.js} +2 -2
- package/dist/{search-v2twazx5.js → search-vqkmmy9c.js} +3 -3
- package/dist/shared/search-text.d.ts +2 -0
- package/dist/shared/search-text.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-4gj0mtcg.js → transform-postprocess-phase-61f7t9xq.js} +4 -4
- package/dist/v2/auto-search-worker.js +1 -1
- package/dist/v2/{context-m1te41ec.js → context-ejyvb9kp.js} +7 -7
- package/dist/v2/{message-index-bounded-w14496s9.js → message-index-bounded-dgd8a2x1.js} +1 -1
- package/dist/v2/raw-ordinal-warmup-worker.js +3 -3
- package/dist/v2/{recomp-orchestrator-9cjk6aej.js → recomp-orchestrator-x0r6sy3a.js} +2 -2
- package/dist/v2/{render-5dz1knf2.js → render-yyv8nv4p.js} +1 -1
- package/dist/v2/{search-archive-z6z9jqwf.js → search-archive-gagdnrb3.js} +2 -2
- package/dist/v2/{search-2n9zsqrm.js → search-cb1kdgqw.js} +2 -2
- package/dist/v2/{server-a9w5f0yw.js → server-2d01821b.js} +1 -1
- package/dist/v2/{server-e51xmr4d.js → server-2tp6y1qs.js} +2 -2
- package/dist/v2/{server-5by3vdzs.js → server-405ap0b0.js} +1 -1
- package/dist/v2/{server-dfq5vb8j.js → server-dt9b00ja.js} +34 -1
- package/dist/v2/{server-r0gdhz69.js → server-r4mmc670.js} +12 -6
- package/dist/v2/server.js +2 -2
- package/dist/v2/{v2-archive-reader-z7wr42ry.js → v2-archive-reader-2rv5dz7k.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-j1v62bkj.js → wrapup-orchestrator-f8w3kcjf.js} +2 -2
- package/dist/{v2-archive-reader-028z6kck.js → v2-archive-reader-4hz9pnmy.js} +1 -1
- package/dist/{wrapup-orchestrator-xg9avt2p.js → wrapup-orchestrator-7dxwer1p.js} +4 -4
- package/package.json +1 -1
- package/src/shared/search-text.test.ts +36 -1
- package/src/shared/search-text.ts +48 -0
|
@@ -31,7 +31,7 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
31
31
|
import("./embedding-cache-mgyr73ef.js"),
|
|
32
32
|
import("./storage-memory-e6a7mb0k.js"),
|
|
33
33
|
import("./project-embedding-registry-3yyegjma.js"),
|
|
34
|
-
import("./search-
|
|
34
|
+
import("./search-vqkmmy9c.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-ypktm0tk.js"),
|
|
36
36
|
import("./embedding-activity-g1dhes6g.js"),
|
|
37
37
|
import("./harness-e4avh192.js"),
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
rebaseSessionCoordinatesAsync,
|
|
38
38
|
resolveOpenCodeProtectedTailBoundary,
|
|
39
39
|
getActiveCompartmentRun
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-tr6vcwt0.js";
|
|
41
41
|
import"./index-sd3egckz.js";
|
|
42
42
|
import {
|
|
43
43
|
getHarness2
|
|
@@ -131,7 +131,7 @@ import {
|
|
|
131
131
|
applyJsonSchemaParameterDescriptions,
|
|
132
132
|
MagicContextRpcServer,
|
|
133
133
|
subagentTemperature
|
|
134
|
-
} from "./index-
|
|
134
|
+
} from "./index-gfd41hm4.js";
|
|
135
135
|
import {
|
|
136
136
|
resolveHistorianModel2
|
|
137
137
|
} from "./index-5kym00ag.js";
|
|
@@ -214,11 +214,11 @@ import {
|
|
|
214
214
|
recordToolDefinitionSet,
|
|
215
215
|
getCurrentToolSetHash
|
|
216
216
|
} from "./index-jkanybgq.js";
|
|
217
|
-
import"./index-
|
|
217
|
+
import"./index-9z4d2ha0.js";
|
|
218
218
|
import"./index-b1ydbp95.js";
|
|
219
219
|
import {
|
|
220
220
|
scheduleClearAndReindex
|
|
221
|
-
} from "./index-
|
|
221
|
+
} from "./index-hb76vdmm.js";
|
|
222
222
|
import {
|
|
223
223
|
invalidateAutoEmbedSession,
|
|
224
224
|
clearEmbedSessionState
|
|
@@ -282,7 +282,7 @@ import {
|
|
|
282
282
|
EmergencyFailClosedError,
|
|
283
283
|
DegradedPassRefusalError,
|
|
284
284
|
isSyntheticHeadMessage2
|
|
285
|
-
} from "./index-
|
|
285
|
+
} from "./index-hf771sk4.js";
|
|
286
286
|
import"./index-850vthn3.js";
|
|
287
287
|
import"./index-qt1qqasc.js";
|
|
288
288
|
import {
|
|
@@ -303,8 +303,8 @@ import {
|
|
|
303
303
|
} from "./index-x8a7jmkh.js";
|
|
304
304
|
import"./index-fw42ms3m.js";
|
|
305
305
|
import"./index-ae1ar4v1.js";
|
|
306
|
-
import"./index-
|
|
307
|
-
import"./index-
|
|
306
|
+
import"./index-j5qma52p.js";
|
|
307
|
+
import"./index-m8v7nqgp.js";
|
|
308
308
|
import"./index-gp3kcpc4.js";
|
|
309
309
|
import {
|
|
310
310
|
detectConflicts
|
|
@@ -329,8 +329,8 @@ import {
|
|
|
329
329
|
import"./index-fmsr7v69.js";
|
|
330
330
|
import"./index-j105mf16.js";
|
|
331
331
|
import"./index-kaqs6h31.js";
|
|
332
|
-
import"./index-
|
|
333
|
-
import"./index-
|
|
332
|
+
import"./index-z7etaphs.js";
|
|
333
|
+
import"./index-ryz4pdvf.js";
|
|
334
334
|
import {
|
|
335
335
|
isDreamerRunnable,
|
|
336
336
|
isSmartNoteSurfaceAvailable,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { UnifiedSearchResult } from "./search";
|
|
1
|
+
import type { MemorySearchResult, UnifiedSearchResult } from "./search";
|
|
2
|
+
/** Keep full memory text in a side map for hint scoring so tools still receive only the preview. */
|
|
3
|
+
export declare function withMemoryHintContent(result: MemorySearchResult, fullContent: string): MemorySearchResult;
|
|
2
4
|
export type AutoSearchLane = "memory" | "messages" | "summaries" | "git";
|
|
3
5
|
export type ChunkPoolPeek = "not-run" | "hit" | "missing" | "transaction" | "signature-changed" | "no-model";
|
|
4
6
|
/** Only numeric aggregates and enumerated state values cross the worker boundary. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-search-diagnostics.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/auto-search-diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"auto-search-diagnostics.d.ts","sourceRoot":"","sources":["../../../src/features/magic-context/auto-search-diagnostics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE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,MAAM,CAAC;IACpB,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd;gFAC4E;IAC5E,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,kBAAkB,EAAE,GAAG,IAAI,CAwD9B;AAED,wBAAsB,aAAa,CAC/B,EAAE,EAAE,QAAQ,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,oBAAyB,GACnC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA4XhC;AAsGD;;qDAEqD;AACrD,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mBAAmB,EAAE,EAC9B,gBAAgB,EAAE,MAAM,EACxB,WAAW,CAAC,EAAE,wBAAwB,GACvC,MAAM,CA6BR"}
|
|
@@ -66,6 +66,39 @@ function keywordRelevance(query, content) {
|
|
|
66
66
|
const words = new Set(terms(cleanSearchText(content)));
|
|
67
67
|
return 0.8 * needles.filter((term) => words.has(term)).length / needles.length;
|
|
68
68
|
}
|
|
69
|
+
var CJK_RUN = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]+$/u;
|
|
70
|
+
var CJK_RUN_SPLIT = /([\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]+)/u;
|
|
71
|
+
function hintTerms(text) {
|
|
72
|
+
return [
|
|
73
|
+
...new Set(terms(text).flatMap((term) => term.split(CJK_RUN_SPLIT)).filter((term) => term.length > 0 && !QUERY_STOP_WORDS.has(term)))
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
function characterBigrams(run) {
|
|
77
|
+
const characters = [...run];
|
|
78
|
+
return characters.length === 1 ? characters : characters.slice(1).map((character, index) => characters[index] + character);
|
|
79
|
+
}
|
|
80
|
+
function hintKeywordRelevance(query, content) {
|
|
81
|
+
const needles = hintTerms(query);
|
|
82
|
+
if (needles.length === 0)
|
|
83
|
+
return 0;
|
|
84
|
+
const words = new Set(hintTerms(cleanSearchText(content)));
|
|
85
|
+
const runs = [...words].filter((word) => CJK_RUN.test(word));
|
|
86
|
+
const bigrams = new Set(runs.flatMap(characterBigrams));
|
|
87
|
+
let matched = 0;
|
|
88
|
+
for (const needle of needles) {
|
|
89
|
+
if (!CJK_RUN.test(needle)) {
|
|
90
|
+
matched += Number(words.has(needle));
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const grams = characterBigrams(needle);
|
|
94
|
+
if ([...needle].length === 1) {
|
|
95
|
+
matched += Number(runs.some((run) => run.includes(needle)));
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
matched += Math.min(1, grams.filter((gram) => bigrams.has(gram)).length / Math.ceil(grams.length / 2));
|
|
99
|
+
}
|
|
100
|
+
return 0.8 * matched / needles.length;
|
|
101
|
+
}
|
|
69
102
|
function matchedSearchSnippet(content, query, cap = 220) {
|
|
70
103
|
const text = cleanSearchText(content);
|
|
71
104
|
const needles = new Set(terms(query));
|
|
@@ -556,4 +589,4 @@ function indexItemsAfterOrdinal(db, sessionId, items, finalWatermark, toSource)
|
|
|
556
589
|
return inserted;
|
|
557
590
|
}
|
|
558
591
|
|
|
559
|
-
export { clearCompressionDepth, clearCompressionDepthRange, cleanSearchText,
|
|
592
|
+
export { clearCompressionDepth, clearCompressionDepthRange, cleanSearchText, hintKeywordRelevance, matchedSearchSnippet, MESSAGE_INDEX_MAX_FTS_BYTES, messageIndexSkipKey, toMessageIndexSource, getMessageIndexSourceIdentity, isMessageIndexSourceCurrent, getLastIndexedOrdinal, getIndexedMessageCorpusSize, markMessageIndexDirty, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, deleteIndexedMessage, clearIndexedMessagesInTransaction, clearIndexedMessages, getIndexableContent, indexSingleMessage, indexMessagesAfterOrdinal, indexSourcesAfterOrdinal };
|
|
@@ -191,7 +191,7 @@ import {
|
|
|
191
191
|
snapRangeToCompartments,
|
|
192
192
|
getActiveCompartmentRun,
|
|
193
193
|
startCompartmentAgent
|
|
194
|
-
} from "./index-
|
|
194
|
+
} from "./index-tr6vcwt0.js";
|
|
195
195
|
import {
|
|
196
196
|
hasTrustedAbsoluteWall,
|
|
197
197
|
applyProvenInputFloor,
|
|
@@ -558,7 +558,7 @@ import {
|
|
|
558
558
|
} from "./index-72czy45z.js";
|
|
559
559
|
import {
|
|
560
560
|
getLastIndexedOrdinal
|
|
561
|
-
} from "./index-
|
|
561
|
+
} from "./index-9z4d2ha0.js";
|
|
562
562
|
import {
|
|
563
563
|
SESSION_NOTE_CONDITION_ERROR,
|
|
564
564
|
getNoteByIdInScope,
|
|
@@ -691,13 +691,13 @@ import {
|
|
|
691
691
|
resolveMemoriesByIdsForSearch2,
|
|
692
692
|
unifiedSearch2,
|
|
693
693
|
formatSearchResults2
|
|
694
|
-
} from "./index-
|
|
694
|
+
} from "./index-j5qma52p.js";
|
|
695
695
|
import {
|
|
696
696
|
scheduleReconciliation,
|
|
697
697
|
scheduleIncrementalIndex,
|
|
698
698
|
getMessageIndexQueueHeapStats,
|
|
699
699
|
clearSessionTracking
|
|
700
|
-
} from "./index-
|
|
700
|
+
} from "./index-hb76vdmm.js";
|
|
701
701
|
import {
|
|
702
702
|
flushIgnoredMessages2,
|
|
703
703
|
clearIgnoredMessages2,
|
|
@@ -707,7 +707,7 @@ import {
|
|
|
707
707
|
import {
|
|
708
708
|
setRecompStarting2,
|
|
709
709
|
setRecompTerminal2
|
|
710
|
-
} from "./index-
|
|
710
|
+
} from "./index-m8v7nqgp.js";
|
|
711
711
|
import {
|
|
712
712
|
makeToolCompositeKey,
|
|
713
713
|
searchMessageHistoryOffThread,
|
|
@@ -772,7 +772,7 @@ import {
|
|
|
772
772
|
abortSessionFailClosed2,
|
|
773
773
|
evaluateEmergencyFailClosed2,
|
|
774
774
|
runPostTransformPhase2
|
|
775
|
-
} from "./index-
|
|
775
|
+
} from "./index-hf771sk4.js";
|
|
776
776
|
import {
|
|
777
777
|
ANNOUNCEMENT_VERSION2,
|
|
778
778
|
ANNOUNCEMENT_FEATURES2,
|
|
@@ -790,10 +790,10 @@ import {
|
|
|
790
790
|
} from "./index-j105mf16.js";
|
|
791
791
|
import {
|
|
792
792
|
readV2ArchiveOffThread2
|
|
793
|
-
} from "./index-
|
|
793
|
+
} from "./index-z7etaphs.js";
|
|
794
794
|
import {
|
|
795
795
|
renderSearchArchiveOffThread2
|
|
796
|
-
} from "./index-
|
|
796
|
+
} from "./index-ryz4pdvf.js";
|
|
797
797
|
import {
|
|
798
798
|
COMPACTION_ENABLED_PATH,
|
|
799
799
|
isDreamerRunnable,
|
|
@@ -16418,7 +16418,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16418
16418
|
const db = readDatabase();
|
|
16419
16419
|
if (!db)
|
|
16420
16420
|
return { ok: false, error: "db unavailable" };
|
|
16421
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
16421
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-34mh19vm.js"));
|
|
16422
16422
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-14p3yje4.js"));
|
|
16423
16423
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
16424
16424
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -16503,7 +16503,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
16503
16503
|
const db = readDatabase();
|
|
16504
16504
|
if (!db)
|
|
16505
16505
|
return { ok: false, error: "db unavailable" };
|
|
16506
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
16506
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-7dxwer1p.js"));
|
|
16507
16507
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
16508
16508
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
16509
16509
|
const ctx = {
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./index-txs8tce6.js";
|
|
20
20
|
import {
|
|
21
21
|
cleanSearchText,
|
|
22
|
-
|
|
22
|
+
hintKeywordRelevance,
|
|
23
23
|
getMessageIndexSourceIdentity,
|
|
24
24
|
isMessageIndexSourceCurrent,
|
|
25
25
|
getLastIndexedOrdinal,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
clearIndexedMessages,
|
|
29
29
|
indexSingleMessage,
|
|
30
30
|
indexMessagesAfterOrdinal
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-9z4d2ha0.js";
|
|
32
32
|
|
|
33
33
|
// src/features/magic-context/message-index-async.ts
|
|
34
34
|
var indexCancellations = new Map;
|
|
@@ -429,6 +429,11 @@ function invalidateIncrementalWork(sessionId) {
|
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
// src/features/magic-context/auto-search-diagnostics.ts
|
|
432
|
+
var memoryHintContent = new WeakMap;
|
|
433
|
+
function withMemoryHintContent(result, fullContent) {
|
|
434
|
+
memoryHintContent.set(result, fullContent);
|
|
435
|
+
return result;
|
|
436
|
+
}
|
|
432
437
|
function createAutoSearchDiagnostics(threshold) {
|
|
433
438
|
return {
|
|
434
439
|
threshold,
|
|
@@ -440,9 +445,10 @@ function createAutoSearchDiagnostics(threshold) {
|
|
|
440
445
|
};
|
|
441
446
|
}
|
|
442
447
|
function autoSearchRelevance(query, result) {
|
|
443
|
-
|
|
448
|
+
const content = result.source === "memory" ? memoryHintContent.get(result) ?? result.content : result.source === "compartment" ? result.title : result.content;
|
|
449
|
+
if (cleanSearchText(content).length === 0)
|
|
444
450
|
return 0;
|
|
445
|
-
return result.source === "message" || "matchType" in result && result.source !== "compartment" && result.matchType !== "semantic" ?
|
|
451
|
+
return result.source === "message" || "matchType" in result && result.source !== "compartment" && result.matchType !== "semantic" ? hintKeywordRelevance(query, content) : result.score;
|
|
446
452
|
}
|
|
447
453
|
function recordAutoSearchLane(diagnostics, lane, query, results) {
|
|
448
454
|
if (!diagnostics)
|
|
@@ -454,4 +460,4 @@ function recordAutoSearchLane(diagnostics, lane, query, results) {
|
|
|
454
460
|
};
|
|
455
461
|
}
|
|
456
462
|
|
|
457
|
-
export { getMessageIndexEpoch, isMessageIndexSearchable, scheduleReconciliation, scheduleIncrementalIndex, scheduleClearAndReindex, getMessageIndexQueueHeapStats, clearSessionTracking, createAutoSearchDiagnostics, autoSearchRelevance, recordAutoSearchLane };
|
|
463
|
+
export { getMessageIndexEpoch, isMessageIndexSearchable, scheduleReconciliation, scheduleIncrementalIndex, scheduleClearAndReindex, getMessageIndexQueueHeapStats, clearSessionTracking, withMemoryHintContent, createAutoSearchDiagnostics, autoSearchRelevance, recordAutoSearchLane };
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
import {
|
|
125
125
|
cleanSearchText,
|
|
126
126
|
matchedSearchSnippet
|
|
127
|
-
} from "./index-
|
|
127
|
+
} from "./index-9z4d2ha0.js";
|
|
128
128
|
import {
|
|
129
129
|
stripSystemInjection,
|
|
130
130
|
isTextPart,
|
|
@@ -234,6 +234,11 @@ import {
|
|
|
234
234
|
import {
|
|
235
235
|
isEmbeddingHostBusy2
|
|
236
236
|
} from "./index-qt1qqasc.js";
|
|
237
|
+
import {
|
|
238
|
+
getMessageIndexEpoch,
|
|
239
|
+
isMessageIndexSearchable,
|
|
240
|
+
createAutoSearchDiagnostics
|
|
241
|
+
} from "./index-hb76vdmm.js";
|
|
237
242
|
import {
|
|
238
243
|
openCodeDbExists,
|
|
239
244
|
withReadOnlySessionDb,
|
|
@@ -242,11 +247,6 @@ import {
|
|
|
242
247
|
import {
|
|
243
248
|
BoundedSessionMap
|
|
244
249
|
} from "./index-jkanybgq.js";
|
|
245
|
-
import {
|
|
246
|
-
getMessageIndexEpoch,
|
|
247
|
-
isMessageIndexSearchable,
|
|
248
|
-
createAutoSearchDiagnostics
|
|
249
|
-
} from "./index-dz48h1wx.js";
|
|
250
250
|
import {
|
|
251
251
|
compareOpenCodeMessagesByCanonicalOrder,
|
|
252
252
|
prepareCompactionMarkerCandidates,
|
|
@@ -266,7 +266,7 @@ import {
|
|
|
266
266
|
peekNoteNudgeText,
|
|
267
267
|
markNoteNudgeDelivered,
|
|
268
268
|
getActiveCompartmentRun
|
|
269
|
-
} from "./index-
|
|
269
|
+
} from "./index-tr6vcwt0.js";
|
|
270
270
|
import {
|
|
271
271
|
userFacingFailureCode
|
|
272
272
|
} from "./index-xnm0wq1r.js";
|
|
@@ -69,7 +69,14 @@ import {
|
|
|
69
69
|
import {
|
|
70
70
|
matchedSearchSnippet,
|
|
71
71
|
getIndexedMessageCorpusSize
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-9z4d2ha0.js";
|
|
73
|
+
import {
|
|
74
|
+
getMessageIndexEpoch,
|
|
75
|
+
isMessageIndexSearchable,
|
|
76
|
+
withMemoryHintContent,
|
|
77
|
+
autoSearchRelevance,
|
|
78
|
+
recordAutoSearchLane
|
|
79
|
+
} from "./index-hb76vdmm.js";
|
|
73
80
|
import {
|
|
74
81
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
75
82
|
withMessageFtsSessionFilter
|
|
@@ -77,12 +84,6 @@ import {
|
|
|
77
84
|
import {
|
|
78
85
|
isRecord
|
|
79
86
|
} from "./index-8jjjmhab.js";
|
|
80
|
-
import {
|
|
81
|
-
getMessageIndexEpoch,
|
|
82
|
-
isMessageIndexSearchable,
|
|
83
|
-
autoSearchRelevance,
|
|
84
|
-
recordAutoSearchLane
|
|
85
|
-
} from "./index-dz48h1wx.js";
|
|
86
87
|
import {
|
|
87
88
|
resolveWorkspaceShareCategories,
|
|
88
89
|
resolveWorkspaceIdentitySet,
|
|
@@ -2230,7 +2231,7 @@ function mergeMemoryResults(args) {
|
|
|
2230
2231
|
suppressedVisibleIds.push(id);
|
|
2231
2232
|
continue;
|
|
2232
2233
|
}
|
|
2233
|
-
results.push({
|
|
2234
|
+
results.push(withMemoryHintContent({
|
|
2234
2235
|
source: "memory",
|
|
2235
2236
|
content: previewText(memory.content),
|
|
2236
2237
|
score,
|
|
@@ -2238,7 +2239,7 @@ function mergeMemoryResults(args) {
|
|
|
2238
2239
|
category: memory.category,
|
|
2239
2240
|
matchType,
|
|
2240
2241
|
sourceName: args.sourceNameByMemoryId?.get(memory.id)
|
|
2241
|
-
});
|
|
2242
|
+
}, memory.content));
|
|
2242
2243
|
}
|
|
2243
2244
|
return {
|
|
2244
2245
|
results: results.sort((left, right) => {
|
|
@@ -32,14 +32,14 @@ import {
|
|
|
32
32
|
getActiveCompartmentRun,
|
|
33
33
|
markActiveCompartmentRunPublished,
|
|
34
34
|
registerActiveCompartmentRun
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-tr6vcwt0.js";
|
|
36
36
|
import {
|
|
37
37
|
sendStatusNotification2
|
|
38
38
|
} from "./index-ae1ar4v1.js";
|
|
39
39
|
import {
|
|
40
40
|
setRecompStarting2,
|
|
41
41
|
setRecompTerminal2
|
|
42
|
-
} from "./index-
|
|
42
|
+
} from "./index-m8v7nqgp.js";
|
|
43
43
|
|
|
44
44
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
45
45
|
import * as crypto from "node:crypto";
|
|
@@ -140,8 +140,8 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
140
140
|
import("./store-reader-yh19h38c.js"),
|
|
141
141
|
import("./store-s3eykdjt.js"),
|
|
142
142
|
import("./read-session-chunk-26yrrhyz.js"),
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
143
|
+
import("./render-gqdq6t7f.js"),
|
|
144
|
+
import("./search-archive-kfwpk73t.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
checkCompactionMarkerConsistency,
|
|
85
85
|
clearInjectionCache,
|
|
86
86
|
clearNoteNudgeTriggerOnly
|
|
87
|
-
} from "./index-
|
|
87
|
+
} from "./index-tr6vcwt0.js";
|
|
88
88
|
import"./index-sd3egckz.js";
|
|
89
89
|
import {
|
|
90
90
|
hasTrustedAbsoluteWall,
|
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
parameterDescriptionsFor,
|
|
172
172
|
MagicContextRpcServer,
|
|
173
173
|
applyHiddenSubagentTemperature
|
|
174
|
-
} from "./index-
|
|
174
|
+
} from "./index-gfd41hm4.js";
|
|
175
175
|
import {
|
|
176
176
|
resolveOpenCodeDbPath,
|
|
177
177
|
openCodeDbPathExists,
|
|
@@ -259,7 +259,7 @@ import"./index-g4t7850m.js";
|
|
|
259
259
|
import {
|
|
260
260
|
getDefaultSubcConnectionFile,
|
|
261
261
|
SubcModuleTransport
|
|
262
|
-
} from "./index-
|
|
262
|
+
} from "./index-j5qma52p.js";
|
|
263
263
|
import"./index-qt1qqasc.js";
|
|
264
264
|
import"./index-fw42ms3m.js";
|
|
265
265
|
import {
|
|
@@ -297,7 +297,7 @@ import {
|
|
|
297
297
|
import"./index-dcjkw41m.js";
|
|
298
298
|
import {
|
|
299
299
|
deleteIndexedMessage
|
|
300
|
-
} from "./index-
|
|
300
|
+
} from "./index-9z4d2ha0.js";
|
|
301
301
|
import"./index-66a50f3e.js";
|
|
302
302
|
import"./index-2qbtqg1w.js";
|
|
303
303
|
import {
|
|
@@ -319,13 +319,13 @@ import {
|
|
|
319
319
|
clearToolPermissionDenied,
|
|
320
320
|
collectForeignTextParts,
|
|
321
321
|
resetDegradedCacheCount2
|
|
322
|
-
} from "./index-
|
|
322
|
+
} from "./index-hf771sk4.js";
|
|
323
323
|
import {
|
|
324
324
|
scheduleClearAndReindex
|
|
325
|
-
} from "./index-
|
|
325
|
+
} from "./index-hb76vdmm.js";
|
|
326
326
|
import {
|
|
327
327
|
runManagedRecomp2
|
|
328
|
-
} from "./index-
|
|
328
|
+
} from "./index-m8v7nqgp.js";
|
|
329
329
|
import {
|
|
330
330
|
isValidSemver,
|
|
331
331
|
compareSemverCore
|
|
@@ -333,11 +333,11 @@ import {
|
|
|
333
333
|
import"./index-fmsr7v69.js";
|
|
334
334
|
import {
|
|
335
335
|
runManagedWrapup2
|
|
336
|
-
} from "./index-
|
|
336
|
+
} from "./index-wk7x13qv.js";
|
|
337
337
|
import"./index-j105mf16.js";
|
|
338
338
|
import"./index-kaqs6h31.js";
|
|
339
|
-
import"./index-
|
|
340
|
-
import"./index-
|
|
339
|
+
import"./index-z7etaphs.js";
|
|
340
|
+
import"./index-ryz4pdvf.js";
|
|
341
341
|
import {
|
|
342
342
|
isDreamerRunnable,
|
|
343
343
|
isSmartNoteSurfaceAvailable,
|
|
@@ -8205,7 +8205,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
8205
8205
|
// package.json
|
|
8206
8206
|
var package_default = {
|
|
8207
8207
|
name: "@cortexkit/opencode-magic-context",
|
|
8208
|
-
version: "0.49.
|
|
8208
|
+
version: "0.49.39",
|
|
8209
8209
|
type: "module",
|
|
8210
8210
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
8211
8211
|
main: "dist/index.js",
|
|
@@ -12059,7 +12059,7 @@ async function setup(context) {
|
|
|
12059
12059
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
12060
12060
|
log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
|
|
12061
12061
|
}
|
|
12062
|
-
const { registerContext } = await import("./context-
|
|
12062
|
+
const { registerContext } = await import("./context-na1w4gqp.js");
|
|
12063
12063
|
setHarness2("opencode2");
|
|
12064
12064
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
12065
12065
|
const duties = await registerContext(context);
|
|
@@ -12532,7 +12532,7 @@ var server = async (ctx) => {
|
|
|
12532
12532
|
rustReplayParticipant: () => magicContextRuntime.magicContext?.getRustReplayParticipant?.() ?? null,
|
|
12533
12533
|
onStorageBusyRefusal: async (sessionId, message) => {
|
|
12534
12534
|
const { sendStatusNotification } = await importPluginModule(() => import("./send-session-notification-14p3yje4.js"));
|
|
12535
|
-
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-
|
|
12535
|
+
const { abortSessionFailClosed } = await importPluginModule(() => import("./transform-postprocess-phase-61f7t9xq.js"));
|
|
12536
12536
|
await sendStatusNotification(ctx.client, sessionId, message, {
|
|
12537
12537
|
toastDurationMs: 15000
|
|
12538
12538
|
});
|
|
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
19
19
|
await main();
|
|
20
20
|
async function main() {
|
|
21
21
|
if (input.v2ArchiveReader) {
|
|
22
|
-
const { serveV2ArchiveReads } = await import("./v2-archive-reader-
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-4hz9pnmy.js");
|
|
23
23
|
await serveV2ArchiveReads(port, openConnections);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
51
51
|
await runMessageFtsRowidMapBackfill(db);
|
|
52
52
|
reply = { kind: "fts-rowid-backfill" };
|
|
53
53
|
} else if (input.searchArchive) {
|
|
54
|
-
const { renderSearchArchive } = await import("./search-archive-
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-kfwpk73t.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-j7c9w57v.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
81
81
|
const { setHarness } = await import("./harness-e4avh192.js");
|
|
82
82
|
setHarness(input.harness ?? "opencode");
|
|
83
83
|
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
84
|
-
import("./message-index-bounded-
|
|
84
|
+
import("./message-index-bounded-jqm3ezva.js"),
|
|
85
85
|
import("./sqlite-context-pragmas-mv9jqwjh.js")
|
|
86
86
|
]);
|
|
87
87
|
configureContextDatabasePragmas(db);
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-m8v7nqgp.js";
|
|
11
|
+
import"./index-tr6vcwt0.js";
|
|
12
12
|
import"./index-850vthn3.js";
|
|
13
13
|
import"./index-sd3egckz.js";
|
|
14
14
|
import"./index-xnm0wq1r.js";
|
|
@@ -18,7 +18,7 @@ import"./index-21fgrfrf.js";
|
|
|
18
18
|
import"./index-4dhv7mqz.js";
|
|
19
19
|
import"./index-72czy45z.js";
|
|
20
20
|
import"./index-2qbtqg1w.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-9z4d2ha0.js";
|
|
22
22
|
import"./index-2amn2s73.js";
|
|
23
23
|
import"./index-66a50f3e.js";
|
|
24
24
|
import"./index-dnqqqc5f.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderSearchArchive2,
|
|
3
3
|
renderSearchArchiveOffThread2
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-ryz4pdvf.js";
|
|
5
|
+
import"./index-z7etaphs.js";
|
|
6
6
|
import"./index-kaqs6h31.js";
|
|
7
7
|
import"./index-tn9drm1a.js";
|
|
8
8
|
import"./index-8jjjmhab.js";
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-j5qma52p.js";
|
|
9
|
+
import"./index-hb76vdmm.js";
|
|
10
10
|
import"./index-kaqs6h31.js";
|
|
11
11
|
import"./index-xnm0wq1r.js";
|
|
12
12
|
import"./index-ty4vhe4n.js";
|
|
@@ -14,7 +14,7 @@ import"./index-jjvbk92s.js";
|
|
|
14
14
|
import"./index-21fgrfrf.js";
|
|
15
15
|
import"./index-4dhv7mqz.js";
|
|
16
16
|
import"./index-2qbtqg1w.js";
|
|
17
|
-
import"./index-
|
|
17
|
+
import"./index-9z4d2ha0.js";
|
|
18
18
|
import"./index-2amn2s73.js";
|
|
19
19
|
import"./index-qt1qqasc.js";
|
|
20
20
|
import"./index-tn9drm1a.js";
|
|
@@ -3,6 +3,8 @@ export declare function removeTaskNotifications(text: string): string;
|
|
|
3
3
|
export declare function cleanSearchText(text: string): string;
|
|
4
4
|
/** Score the share of distinct query terms present, independently of other results. */
|
|
5
5
|
export declare function keywordRelevance(query: string, content: string): number;
|
|
6
|
+
/** Match unspaced clauses for hints without changing retrieval or snippet scoring. */
|
|
7
|
+
export declare function hintKeywordRelevance(query: string, content: string): number;
|
|
6
8
|
/** Pick the densest matching passage before compression can discard the matched words. */
|
|
7
9
|
export declare function matchedSearchSnippet(content: string, query: string, cap?: number): string;
|
|
8
10
|
//# sourceMappingURL=search-text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-text.d.ts","sourceRoot":"","sources":["../../src/shared/search-text.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIpD;AAkBD,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvE;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAM,GAAG,MAAM,CAwBtF"}
|
|
1
|
+
{"version":3,"file":"search-text.d.ts","sourceRoot":"","sources":["../../src/shared/search-text.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIpD;AAkBD,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvE;AAsBD,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAyB3E;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAM,GAAG,MAAM,CAwBtF"}
|
package/dist/{transform-postprocess-phase-4gj0mtcg.js → transform-postprocess-phase-61f7t9xq.js}
RENAMED
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
finalizeMessageRepresentation2,
|
|
20
20
|
runPostTransformPhase2,
|
|
21
21
|
checkM0MutationDriftAndSignal2
|
|
22
|
-
} from "./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
22
|
+
} from "./index-hf771sk4.js";
|
|
23
|
+
import"./index-hb76vdmm.js";
|
|
24
|
+
import"./index-tr6vcwt0.js";
|
|
25
25
|
import"./index-850vthn3.js";
|
|
26
26
|
import"./index-sd3egckz.js";
|
|
27
27
|
import"./index-xnm0wq1r.js";
|
|
@@ -31,7 +31,7 @@ import"./index-21fgrfrf.js";
|
|
|
31
31
|
import"./index-4dhv7mqz.js";
|
|
32
32
|
import"./index-72czy45z.js";
|
|
33
33
|
import"./index-2qbtqg1w.js";
|
|
34
|
-
import"./index-
|
|
34
|
+
import"./index-9z4d2ha0.js";
|
|
35
35
|
import"./index-2amn2s73.js";
|
|
36
36
|
import"./index-66a50f3e.js";
|
|
37
37
|
import"./index-dnqqqc5f.js";
|
|
@@ -31,7 +31,7 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
31
31
|
import("./embedding-cache-mgyr73ef.js"),
|
|
32
32
|
import("./storage-memory-e6a7mb0k.js"),
|
|
33
33
|
import("./project-embedding-registry-jqq2qeqb.js"),
|
|
34
|
-
import("./search-
|
|
34
|
+
import("./search-cb1kdgqw.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-qfk791bd.js"),
|
|
36
36
|
import("./embedding-activity-g1dhes6g.js"),
|
|
37
37
|
import("./harness-e4avh192.js"),
|
|
@@ -209,7 +209,7 @@ import {
|
|
|
209
209
|
startCompartmentAgent,
|
|
210
210
|
setRecompStarting2,
|
|
211
211
|
setRecompTerminal2
|
|
212
|
-
} from "./server-
|
|
212
|
+
} from "./server-405ap0b0.js";
|
|
213
213
|
import {
|
|
214
214
|
resolveHistorianModel2
|
|
215
215
|
} from "./server-5kym00ag.js";
|
|
@@ -601,7 +601,7 @@ import {
|
|
|
601
601
|
cleanSearchText,
|
|
602
602
|
matchedSearchSnippet,
|
|
603
603
|
getLastIndexedOrdinal
|
|
604
|
-
} from "./server-
|
|
604
|
+
} from "./server-dt9b00ja.js";
|
|
605
605
|
import"./server-nmyganc8.js";
|
|
606
606
|
import {
|
|
607
607
|
getMessageIndexEpoch,
|
|
@@ -628,7 +628,7 @@ import {
|
|
|
628
628
|
resolveMemoriesByIdsForSearch2,
|
|
629
629
|
unifiedSearch2,
|
|
630
630
|
formatSearchResults2
|
|
631
|
-
} from "./server-
|
|
631
|
+
} from "./server-r4mmc670.js";
|
|
632
632
|
import {
|
|
633
633
|
embedPauseBySession,
|
|
634
634
|
embedRunStateBySession,
|
|
@@ -966,10 +966,10 @@ import {
|
|
|
966
966
|
import"./server-kaqs6h31.js";
|
|
967
967
|
import {
|
|
968
968
|
readV2ArchiveOffThread2
|
|
969
|
-
} from "./server-
|
|
969
|
+
} from "./server-2tp6y1qs.js";
|
|
970
970
|
import {
|
|
971
971
|
renderSearchArchiveOffThread2
|
|
972
|
-
} from "./server-
|
|
972
|
+
} from "./server-2d01821b.js";
|
|
973
973
|
import {
|
|
974
974
|
markCoveredInstructionRow,
|
|
975
975
|
isCoveredInstructionRow,
|
|
@@ -24320,7 +24320,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
24320
24320
|
const db = readDatabase();
|
|
24321
24321
|
if (!db)
|
|
24322
24322
|
return { ok: false, error: "db unavailable" };
|
|
24323
|
-
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-
|
|
24323
|
+
const { runManagedRecomp } = await importPluginModule(() => import("./recomp-orchestrator-x0r6sy3a.js"));
|
|
24324
24324
|
const { sendIgnoredMessage } = await importPluginModule(() => import("./send-session-notification-kxp47tsw.js"));
|
|
24325
24325
|
log2(`[rpc] recomp requested for session ${sessionId}`);
|
|
24326
24326
|
if (!args.client && !args.hiddenCompletionExecutor) {
|
|
@@ -24405,7 +24405,7 @@ function registerRpcHandlers(rpcServer, args) {
|
|
|
24405
24405
|
const db = readDatabase();
|
|
24406
24406
|
if (!db)
|
|
24407
24407
|
return { ok: false, error: "db unavailable" };
|
|
24408
|
-
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-
|
|
24408
|
+
const { runManagedWrapup } = await importPluginModule(() => import("./wrapup-orchestrator-f8w3kcjf.js"));
|
|
24409
24409
|
const model = liveSessionState.liveModelBySession.get(sessionId);
|
|
24410
24410
|
const contextLimit = model ? resolveContextLimit(model.providerID, model.modelID, { db, sessionID: sessionId }) : 128000;
|
|
24411
24411
|
const ctx = {
|
|
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
19
19
|
await main();
|
|
20
20
|
async function main() {
|
|
21
21
|
if (input.v2ArchiveReader) {
|
|
22
|
-
const { serveV2ArchiveReads } = await import("./v2-archive-reader-
|
|
22
|
+
const { serveV2ArchiveReads } = await import("./v2-archive-reader-2rv5dz7k.js");
|
|
23
23
|
await serveV2ArchiveReads(port, openConnections);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
51
51
|
await runMessageFtsRowidMapBackfill(db);
|
|
52
52
|
reply = { kind: "fts-rowid-backfill" };
|
|
53
53
|
} else if (input.searchArchive) {
|
|
54
|
-
const { renderSearchArchive } = await import("./search-archive-
|
|
54
|
+
const { renderSearchArchive } = await import("./search-archive-gagdnrb3.js");
|
|
55
55
|
const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-qpp6x9kg.js");
|
|
56
56
|
const archive = input.searchArchive;
|
|
57
57
|
let raw;
|
|
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
|
|
|
81
81
|
const { setHarness } = await import("./harness-e4avh192.js");
|
|
82
82
|
setHarness(input.harness ?? "opencode");
|
|
83
83
|
const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
|
|
84
|
-
import("./message-index-bounded-
|
|
84
|
+
import("./message-index-bounded-dgd8a2x1.js"),
|
|
85
85
|
import("./sqlite-context-pragmas-mv9jqwjh.js")
|
|
86
86
|
]);
|
|
87
87
|
configureContextDatabasePragmas(db);
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
setRecompTerminal2,
|
|
8
8
|
buildRecompDeps2,
|
|
9
9
|
runManagedRecomp2
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-405ap0b0.js";
|
|
11
11
|
import"./server-r4430x9m.js";
|
|
12
12
|
import"./server-nq3cb7be.js";
|
|
13
13
|
import"./server-gkse1wyz.js";
|
|
@@ -16,7 +16,7 @@ import"./server-7acq7815.js";
|
|
|
16
16
|
import"./server-4dhv7mqz.js";
|
|
17
17
|
import"./server-t8y64xj7.js";
|
|
18
18
|
import"./server-ypf1ap0v.js";
|
|
19
|
-
import"./server-
|
|
19
|
+
import"./server-dt9b00ja.js";
|
|
20
20
|
import"./server-2amn2s73.js";
|
|
21
21
|
import"./server-ef1mskas.js";
|
|
22
22
|
import"./server-sd8hvzte.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./server-qjyp27vf.js";
|
|
6
6
|
import"./server-t8y64xj7.js";
|
|
7
7
|
import"./server-ypf1ap0v.js";
|
|
8
|
-
import"./server-
|
|
8
|
+
import"./server-dt9b00ja.js";
|
|
9
9
|
import"./server-2amn2s73.js";
|
|
10
10
|
import"./server-ef1mskas.js";
|
|
11
11
|
import"./server-jd7vzwn4.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderSearchArchive2,
|
|
3
3
|
renderSearchArchiveOffThread2
|
|
4
|
-
} from "./server-
|
|
5
|
-
import"./server-
|
|
4
|
+
} from "./server-2d01821b.js";
|
|
5
|
+
import"./server-2tp6y1qs.js";
|
|
6
6
|
import"./server-kaqs6h31.js";
|
|
7
7
|
import"./server-jd7vzwn4.js";
|
|
8
8
|
import"./server-xfjjbrkt.js";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveMemoriesByIdsForSearch2,
|
|
6
6
|
unifiedSearch2,
|
|
7
7
|
formatSearchResults2
|
|
8
|
-
} from "./server-
|
|
8
|
+
} from "./server-r4mmc670.js";
|
|
9
9
|
import"./server-kaqs6h31.js";
|
|
10
10
|
import"./server-nq3cb7be.js";
|
|
11
11
|
import"./server-gkse1wyz.js";
|
|
@@ -13,7 +13,7 @@ import"./server-jjvbk92s.js";
|
|
|
13
13
|
import"./server-7acq7815.js";
|
|
14
14
|
import"./server-4dhv7mqz.js";
|
|
15
15
|
import"./server-ypf1ap0v.js";
|
|
16
|
-
import"./server-
|
|
16
|
+
import"./server-dt9b00ja.js";
|
|
17
17
|
import"./server-2amn2s73.js";
|
|
18
18
|
import"./server-qt1qqasc.js";
|
|
19
19
|
import"./server-jd7vzwn4.js";
|
|
@@ -140,8 +140,8 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
140
140
|
import("./store-reader-cgx47zkp.js"),
|
|
141
141
|
import("./store-z3qe67cg.js"),
|
|
142
142
|
import("./read-session-chunk-tqnh1ret.js"),
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
143
|
+
import("./render-yyv8nv4p.js"),
|
|
144
|
+
import("./search-archive-gagdnrb3.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -43,6 +43,39 @@ function keywordRelevance(query, content) {
|
|
|
43
43
|
const words = new Set(terms(cleanSearchText(content)));
|
|
44
44
|
return 0.8 * needles.filter((term) => words.has(term)).length / needles.length;
|
|
45
45
|
}
|
|
46
|
+
var CJK_RUN = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]+$/u;
|
|
47
|
+
var CJK_RUN_SPLIT = /([\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]+)/u;
|
|
48
|
+
function hintTerms(text) {
|
|
49
|
+
return [
|
|
50
|
+
...new Set(terms(text).flatMap((term) => term.split(CJK_RUN_SPLIT)).filter((term) => term.length > 0 && !QUERY_STOP_WORDS.has(term)))
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
function characterBigrams(run) {
|
|
54
|
+
const characters = [...run];
|
|
55
|
+
return characters.length === 1 ? characters : characters.slice(1).map((character, index) => characters[index] + character);
|
|
56
|
+
}
|
|
57
|
+
function hintKeywordRelevance(query, content) {
|
|
58
|
+
const needles = hintTerms(query);
|
|
59
|
+
if (needles.length === 0)
|
|
60
|
+
return 0;
|
|
61
|
+
const words = new Set(hintTerms(cleanSearchText(content)));
|
|
62
|
+
const runs = [...words].filter((word) => CJK_RUN.test(word));
|
|
63
|
+
const bigrams = new Set(runs.flatMap(characterBigrams));
|
|
64
|
+
let matched = 0;
|
|
65
|
+
for (const needle of needles) {
|
|
66
|
+
if (!CJK_RUN.test(needle)) {
|
|
67
|
+
matched += Number(words.has(needle));
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const grams = characterBigrams(needle);
|
|
71
|
+
if ([...needle].length === 1) {
|
|
72
|
+
matched += Number(runs.some((run) => run.includes(needle)));
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
matched += Math.min(1, grams.filter((gram) => bigrams.has(gram)).length / Math.ceil(grams.length / 2));
|
|
76
|
+
}
|
|
77
|
+
return 0.8 * matched / needles.length;
|
|
78
|
+
}
|
|
46
79
|
function matchedSearchSnippet(content, query, cap = 220) {
|
|
47
80
|
const text = cleanSearchText(content);
|
|
48
81
|
const needles = new Set(terms(query));
|
|
@@ -535,4 +568,4 @@ function indexItemsAfterOrdinal(db, sessionId, items, finalWatermark, toSource)
|
|
|
535
568
|
return inserted;
|
|
536
569
|
}
|
|
537
570
|
|
|
538
|
-
export { cleanSearchText,
|
|
571
|
+
export { cleanSearchText, hintKeywordRelevance, matchedSearchSnippet, clearCompressionDepth, clearCompressionDepthRange, MESSAGE_INDEX_MAX_FTS_BYTES, messageIndexSkipKey, toMessageIndexSource, getLastIndexedOrdinal, getIndexedMessageCorpusSize, markMessageIndexDirty, getMessageIndexReconciliationStartOrdinal, isMessageIndexReconciledThrough, clearIndexedMessagesInTransaction, clearIndexedMessages, getIndexableContent, indexSingleMessage, indexMessagesAfterOrdinal, indexSourcesAfterOrdinal };
|
|
@@ -18,14 +18,14 @@ import {
|
|
|
18
18
|
} from "./server-xfjjbrkt.js";
|
|
19
19
|
import {
|
|
20
20
|
cleanSearchText,
|
|
21
|
-
|
|
21
|
+
hintKeywordRelevance,
|
|
22
22
|
matchedSearchSnippet,
|
|
23
23
|
getIndexedMessageCorpusSize,
|
|
24
24
|
getMessageIndexReconciliationStartOrdinal,
|
|
25
25
|
isMessageIndexReconciledThrough,
|
|
26
26
|
clearIndexedMessages,
|
|
27
27
|
indexMessagesAfterOrdinal
|
|
28
|
-
} from "./server-
|
|
28
|
+
} from "./server-dt9b00ja.js";
|
|
29
29
|
import {
|
|
30
30
|
Priority,
|
|
31
31
|
AdmissionClass,
|
|
@@ -397,6 +397,11 @@ function invalidateIncrementalWork(sessionId) {
|
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
// src/features/magic-context/auto-search-diagnostics.ts
|
|
400
|
+
var memoryHintContent = new WeakMap;
|
|
401
|
+
function withMemoryHintContent(result, fullContent) {
|
|
402
|
+
memoryHintContent.set(result, fullContent);
|
|
403
|
+
return result;
|
|
404
|
+
}
|
|
400
405
|
function createAutoSearchDiagnostics(threshold) {
|
|
401
406
|
return {
|
|
402
407
|
threshold,
|
|
@@ -408,9 +413,10 @@ function createAutoSearchDiagnostics(threshold) {
|
|
|
408
413
|
};
|
|
409
414
|
}
|
|
410
415
|
function autoSearchRelevance(query, result) {
|
|
411
|
-
|
|
416
|
+
const content = result.source === "memory" ? memoryHintContent.get(result) ?? result.content : result.source === "compartment" ? result.title : result.content;
|
|
417
|
+
if (cleanSearchText(content).length === 0)
|
|
412
418
|
return 0;
|
|
413
|
-
return result.source === "message" || "matchType" in result && result.source !== "compartment" && result.matchType !== "semantic" ?
|
|
419
|
+
return result.source === "message" || "matchType" in result && result.source !== "compartment" && result.matchType !== "semantic" ? hintKeywordRelevance(query, content) : result.score;
|
|
414
420
|
}
|
|
415
421
|
function recordAutoSearchLane(diagnostics, lane, query, results) {
|
|
416
422
|
if (!diagnostics)
|
|
@@ -2554,7 +2560,7 @@ function mergeMemoryResults(args) {
|
|
|
2554
2560
|
suppressedVisibleIds.push(id);
|
|
2555
2561
|
continue;
|
|
2556
2562
|
}
|
|
2557
|
-
results.push({
|
|
2563
|
+
results.push(withMemoryHintContent({
|
|
2558
2564
|
source: "memory",
|
|
2559
2565
|
content: previewText(memory.content),
|
|
2560
2566
|
score,
|
|
@@ -2562,7 +2568,7 @@ function mergeMemoryResults(args) {
|
|
|
2562
2568
|
category: memory.category,
|
|
2563
2569
|
matchType,
|
|
2564
2570
|
sourceName: args.sourceNameByMemoryId?.get(memory.id)
|
|
2565
|
-
});
|
|
2571
|
+
}, memory.content));
|
|
2566
2572
|
}
|
|
2567
2573
|
return {
|
|
2568
2574
|
results: results.sort((left, right) => {
|
package/dist/v2/server.js
CHANGED
|
@@ -7875,7 +7875,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
7875
7875
|
// package.json
|
|
7876
7876
|
var package_default = {
|
|
7877
7877
|
name: "@cortexkit/opencode-magic-context",
|
|
7878
|
-
version: "0.49.
|
|
7878
|
+
version: "0.49.39",
|
|
7879
7879
|
type: "module",
|
|
7880
7880
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
7881
7881
|
main: "dist/index.js",
|
|
@@ -8196,7 +8196,7 @@ async function setup(context) {
|
|
|
8196
8196
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
8197
8197
|
log2(`[magic-context] Magic Context storage is at ${storageDir}, outside the folder Engram backs up (~/.local/share/cortexkit/magic-context). It is not included in CortexKit backups.`);
|
|
8198
8198
|
}
|
|
8199
|
-
const { registerContext } = await import("./context-
|
|
8199
|
+
const { registerContext } = await import("./context-ejyvb9kp.js");
|
|
8200
8200
|
setHarness2("opencode2");
|
|
8201
8201
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
8202
8202
|
const duties = await registerContext(context);
|
|
@@ -24,7 +24,7 @@ import"./server-1d042x6w.js";
|
|
|
24
24
|
import"./server-tnzbk64q.js";
|
|
25
25
|
import"./server-nmyganc8.js";
|
|
26
26
|
import"./server-cp1a03vc.js";
|
|
27
|
-
import"./server-
|
|
27
|
+
import"./server-dt9b00ja.js";
|
|
28
28
|
import {
|
|
29
29
|
getWrapupInProgressState,
|
|
30
30
|
acquireWrapupInProgress,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
registerActiveCompartmentRun,
|
|
64
64
|
setRecompStarting2,
|
|
65
65
|
setRecompTerminal2
|
|
66
|
-
} from "./server-
|
|
66
|
+
} from "./server-405ap0b0.js";
|
|
67
67
|
import"./server-qt1qqasc.js";
|
|
68
68
|
import"./server-7acq7815.js";
|
|
69
69
|
import"./server-dcws5831.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runManagedWrapup2
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
5
|
-
import"./index-
|
|
3
|
+
} from "./index-wk7x13qv.js";
|
|
4
|
+
import"./index-m8v7nqgp.js";
|
|
5
|
+
import"./index-tr6vcwt0.js";
|
|
6
6
|
import"./index-850vthn3.js";
|
|
7
7
|
import"./index-sd3egckz.js";
|
|
8
8
|
import"./index-xnm0wq1r.js";
|
|
@@ -12,7 +12,7 @@ import"./index-21fgrfrf.js";
|
|
|
12
12
|
import"./index-4dhv7mqz.js";
|
|
13
13
|
import"./index-72czy45z.js";
|
|
14
14
|
import"./index-2qbtqg1w.js";
|
|
15
|
-
import"./index-
|
|
15
|
+
import"./index-9z4d2ha0.js";
|
|
16
16
|
import"./index-2amn2s73.js";
|
|
17
17
|
import"./index-66a50f3e.js";
|
|
18
18
|
import"./index-dnqqqc5f.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,42 @@
|
|
|
1
1
|
import { expect, test } from "bun:test";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
cleanSearchText,
|
|
4
|
+
hintKeywordRelevance,
|
|
5
|
+
keywordRelevance,
|
|
6
|
+
matchedSearchSnippet,
|
|
7
|
+
} from "./search-text";
|
|
3
8
|
import { removeSystemReminders } from "./system-directive";
|
|
4
9
|
|
|
10
|
+
test("hint scoring preserves exact English and other space-separated keyword scores", () => {
|
|
11
|
+
const cases: Array<[string, string, number]> = [
|
|
12
|
+
["explain historian cache wiring", "cache icons", 0.2],
|
|
13
|
+
["historian cache wiring", "historian cache wiring details", 0.8000000000000002],
|
|
14
|
+
["please explain cache wiring to me", "cache wiring", 0.5333333333333333],
|
|
15
|
+
["CACHE cache cache_timeout", "cache_timeout", 0.4],
|
|
16
|
+
["how are you", "how are you", 0],
|
|
17
|
+
["historian cache", "<task>historian cache</task>", 0],
|
|
18
|
+
["résumé über prüfen", "über prüfen", 0.5333333333333333],
|
|
19
|
+
["память кеш", "кеш", 0.4],
|
|
20
|
+
["ذاكرة تخزين", "تخزين", 0.4],
|
|
21
|
+
];
|
|
22
|
+
for (const [query, content, expected] of cases) {
|
|
23
|
+
expect(keywordRelevance(query, content)).toBe(expected);
|
|
24
|
+
expect(hintKeywordRelevance(query, content)).toBe(expected);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("only hint scoring splits unspaced CJK runs into overlapping character bigrams", () => {
|
|
29
|
+
expect(keywordRelevance("MC_Maze 残差怎样汇总?", "MC_Maze 残差按种子汇总。")).toBe(0.4);
|
|
30
|
+
expect(hintKeywordRelevance("残差", "残留")).toBe(0);
|
|
31
|
+
expect(hintKeywordRelevance("差", "残差")).toBe(0.8);
|
|
32
|
+
expect(hintKeywordRelevance("𠮷野家", "𠮷野川")).toBe(0.8);
|
|
33
|
+
expect(hintKeywordRelevance("かながき", "かながきです")).toBe(0.8);
|
|
34
|
+
expect(hintKeywordRelevance("カタカナ", "カタカナです")).toBe(0.8);
|
|
35
|
+
expect(hintKeywordRelevance("프로젝트캐시", "프로젝트의캐시")).toBe(0.8);
|
|
36
|
+
expect(hintKeywordRelevance("cache残差", "cache残差按种子汇总")).toBe(0.8);
|
|
37
|
+
expect(hintKeywordRelevance("差", "<task>残差</task> unrelated")).toBe(0);
|
|
38
|
+
});
|
|
39
|
+
|
|
5
40
|
test("nested reminder contents stay quarantined through the outer closing tag", () => {
|
|
6
41
|
expect(
|
|
7
42
|
removeSystemReminders(
|
|
@@ -35,6 +35,54 @@ export function keywordRelevance(query: string, content: string): number {
|
|
|
35
35
|
return (0.8 * needles.filter((term) => words.has(term)).length) / needles.length;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
const CJK_RUN = /^[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]+$/u;
|
|
39
|
+
const CJK_RUN_SPLIT = /([\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]+)/u;
|
|
40
|
+
|
|
41
|
+
function hintTerms(text: string): string[] {
|
|
42
|
+
return [
|
|
43
|
+
...new Set(
|
|
44
|
+
terms(text)
|
|
45
|
+
.flatMap((term) => term.split(CJK_RUN_SPLIT))
|
|
46
|
+
.filter((term) => term.length > 0 && !QUERY_STOP_WORDS.has(term)),
|
|
47
|
+
),
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function characterBigrams(run: string): string[] {
|
|
52
|
+
const characters = [...run];
|
|
53
|
+
return characters.length === 1
|
|
54
|
+
? characters
|
|
55
|
+
: characters.slice(1).map((character, index) => characters[index] + character);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Match unspaced clauses for hints without changing retrieval or snippet scoring. */
|
|
59
|
+
export function hintKeywordRelevance(query: string, content: string): number {
|
|
60
|
+
const needles = hintTerms(query);
|
|
61
|
+
if (needles.length === 0) return 0;
|
|
62
|
+
const words = new Set(hintTerms(cleanSearchText(content)));
|
|
63
|
+
const runs = [...words].filter((word) => CJK_RUN.test(word));
|
|
64
|
+
const bigrams = new Set(runs.flatMap(characterBigrams));
|
|
65
|
+
let matched = 0;
|
|
66
|
+
for (const needle of needles) {
|
|
67
|
+
if (!CJK_RUN.test(needle)) {
|
|
68
|
+
matched += Number(words.has(needle));
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const grams = characterBigrams(needle);
|
|
72
|
+
if ([...needle].length === 1) {
|
|
73
|
+
matched += Number(runs.some((run) => run.includes(needle)));
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
// Count each clause as one term so filler bigrams across word boundaries
|
|
77
|
+
// do not dilute it; require half coverage so shared function words alone do not pass.
|
|
78
|
+
matched += Math.min(
|
|
79
|
+
1,
|
|
80
|
+
grams.filter((gram) => bigrams.has(gram)).length / Math.ceil(grams.length / 2),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
return (0.8 * matched) / needles.length;
|
|
84
|
+
}
|
|
85
|
+
|
|
38
86
|
/** Pick the densest matching passage before compression can discard the matched words. */
|
|
39
87
|
export function matchedSearchSnippet(content: string, query: string, cap = 220): string {
|
|
40
88
|
const text = cleanSearchText(content);
|