@cortexkit/opencode-magic-context 0.49.20 → 0.49.21
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 +6 -6
- package/dist/chunk-embedding-write-worker.js +9 -9
- package/dist/{compaction-marker-candidates-b2q30cft.js → compaction-marker-candidates-31h86ph0.js} +2 -2
- package/dist/compaction-marker-candidates-worker.js +2 -2
- package/dist/{compartment-chunk-embedding-va090as0.js → compartment-chunk-embedding-he60aaa2.js} +5 -5
- package/dist/config/project-security.d.ts.map +1 -1
- package/dist/config/schema/magic-context.d.ts +37 -3
- package/dist/config/schema/magic-context.d.ts.map +1 -1
- package/dist/{conflict-warning-hook-frp3z2wk.js → conflict-warning-hook-2r32hyx6.js} +5 -5
- package/dist/{context-mkece1db.js → context-j7hp43a0.js} +153 -83
- package/dist/{embedding-backfill-gy3p78py.js → embedding-backfill-dtke6tck.js} +11 -11
- package/dist/embedding-worker-process.js +1 -1
- package/dist/embedding-worker.js +4 -4
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts +1 -0
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts +7 -1
- package/dist/features/magic-context/memory/embedding-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/message-index-async.d.ts +7 -2
- package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
- package/dist/features/magic-context/project-embedding-registry.d.ts +2 -0
- package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts +9 -2
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +2 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-db.d.ts +2 -0
- package/dist/features/magic-context/storage-db.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/cache-busting-signals.d.ts +1 -0
- package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/served-shape-repair.d.ts +19 -0
- package/dist/hooks/magic-context/served-shape-repair.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-content.d.ts +4 -2
- package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-content-primitives.d.ts +1 -1
- package/dist/hooks/magic-context/tag-content-primitives.d.ts.map +1 -1
- package/dist/hooks/magic-context/tag-messages.d.ts +2 -1
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/text-complete.d.ts +1 -1
- package/dist/hooks/magic-context/text-complete.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +2 -2
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-t7hx3qcb.js → index-11gzxvf4.js} +101 -46
- package/dist/{index-neb2jaed.js → index-1gtfne2c.js} +1 -1
- package/dist/{index-67nyj0gy.js → index-1kbznkft.js} +48 -24
- package/dist/{index-1pefp8ar.js → index-3svaejkh.js} +4 -4
- package/dist/{index-0wthn7fp.js → index-51rdvtkz.js} +35 -4
- package/dist/{index-kc9pn495.js → index-66eby7hx.js} +1 -1
- package/dist/{index-pnjwa6qa.js → index-9q1g3c5q.js} +2 -2
- package/dist/{index-rmd0069m.js → index-a9zvn5fe.js} +24 -10
- package/dist/{index-jfh3cktr.js → index-ffzhwfzy.js} +3 -3
- package/dist/{v2/server-1zx2pa5d.js → index-gzy5w8ya.js} +193 -4
- package/dist/{index-d6rp4dxh.js → index-j32jj2t8.js} +4 -4
- package/dist/{index-35qc6606.js → index-jfem3dgz.js} +1 -1
- package/dist/{index-y4a3nhtk.js → index-jjvbk92s.js} +1 -1
- package/dist/{index-4n7w9rad.js → index-jmq8kfe7.js} +5 -5
- package/dist/{index-c4b76d4t.js → index-kfyb3k6n.js} +1 -1
- package/dist/{index-vkc1ca9p.js → index-kq5w68dp.js} +1 -1
- package/dist/{index-11zf2wwc.js → index-ksq50rg0.js} +2 -2
- package/dist/{index-153r2q6z.js → index-m32esgmj.js} +2 -2
- package/dist/{index-x4k3f4mf.js → index-mnhcdfxg.js} +148 -8
- package/dist/{index-48stjd56.js → index-mnnkgq0q.js} +10 -4
- package/dist/{index-wgypt3cs.js → index-nxrsns5x.js} +2466 -1290
- package/dist/{index-616rsjrv.js → index-qgh1qwjj.js} +1 -1
- package/dist/{index-jr5na10t.js → index-rxqr723x.js} +4 -4
- package/dist/{index-dc8hy95c.js → index-syaazvy2.js} +123 -40
- package/dist/{index-adk2z5d8.js → index-wfybj1dw.js} +2 -4
- package/dist/{index-305y133n.js → index-whcgcfrv.js} +6 -3
- package/dist/{index-jmycsey7.js → index-x6cbrv9h.js} +2 -2
- package/dist/{index-v7r4td4c.js → index-y76rhsnr.js} +28 -17
- package/dist/{index-2yhtnfcf.js → index-zy67whjr.js} +26 -8
- package/dist/index.js +43 -42
- package/dist/{message-fts-rowid-map-22tevnnj.js → message-fts-rowid-map-e79b7b6x.js} +3 -3
- package/dist/{message-index-5qxcz6h7.js → message-index-4q8ek2fc.js} +10 -10
- package/dist/{message-index-bounded-n0m0t7tv.js → message-index-bounded-rydsg9r5.js} +10 -10
- package/dist/{message-time-backfill-0myx7fz3.js → message-time-backfill-4qva0b4f.js} +1 -1
- package/dist/migration-worker.js +6 -6
- package/dist/plugin/embedding-bootstrap.d.ts +1 -0
- package/dist/plugin/embedding-bootstrap.d.ts.map +1 -1
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
- package/dist/plugin/tool-registry.d.ts.map +1 -1
- package/dist/{project-embedding-registry-s2pqgec9.js → project-embedding-registry-hn529988.js} +12 -10
- package/dist/raw-ordinal-warmup-worker.js +8 -8
- package/dist/{read-session-chunk-0a8vdyqp.js → read-session-chunk-t039f0m5.js} +6 -6
- package/dist/{read-session-raw-y5cszf0b.js → read-session-raw-aw6jgvwg.js} +2 -2
- package/dist/{recomp-orchestrator-61vyha9j.js → recomp-orchestrator-hbm53jj5.js} +23 -23
- package/dist/{search-archive-8q9s49p5.js → search-archive-weh164mh.js} +7 -7
- package/dist/{search-v1y9ejws.js → search-hea079d7.js} +19 -19
- package/dist/{send-session-notification-0k6qzydk.js → send-session-notification-gqzkz7da.js} +4 -4
- package/dist/shared/sqlite.d.ts +5 -0
- package/dist/shared/sqlite.d.ts.map +1 -1
- package/dist/shared/tag-transcript.d.ts +2 -0
- package/dist/shared/tag-transcript.d.ts.map +1 -1
- package/dist/{sqlite-1rpvw2rj.js → sqlite-zdgm52sv.js} +5 -1
- package/dist/{storage-memory-nm7v82mj.js → storage-memory-e6a7mb0k.js} +2 -2
- package/dist/{storage-tags-r6nk29n4.js → storage-tags-a77q4v77.js} +2 -2
- package/dist/tools/ctx-search/tools.d.ts.map +1 -1
- package/dist/tools/ctx-search/types.d.ts +1 -0
- package/dist/tools/ctx-search/types.d.ts.map +1 -1
- package/dist/{transform-postprocess-phase-vtrgb7m6.js → transform-postprocess-phase-0b04tm1p.js} +23 -23
- package/dist/v2/auto-search-worker.js +6 -6
- package/dist/v2/chunk-embedding-write-worker.js +11 -11
- package/dist/v2/{compaction-marker-candidates-cfab70cs.js → compaction-marker-candidates-m4vmye3w.js} +2 -2
- package/dist/v2/compaction-marker-candidates-worker.js +2 -2
- package/dist/v2/{compartment-chunk-embedding-nbdqx1td.js → compartment-chunk-embedding-8jjmcgeg.js} +5 -5
- package/dist/v2/{context-cc33tv2z.js → context-ea3x7smm.js} +652 -468
- package/dist/v2/{embedding-backfill-yxv2h5mc.js → embedding-backfill-5e74ae0m.js} +11 -11
- package/dist/v2/embedding-worker-process.js +1 -1
- package/dist/v2/embedding-worker.js +4 -4
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/copied-tag-notation.d.ts +1 -1
- package/dist/v2/hooks/copied-tag-notation.d.ts.map +1 -1
- package/dist/v2/hooks/dream-timer.d.ts +2 -0
- package/dist/v2/hooks/dream-timer.d.ts.map +1 -1
- package/dist/v2/hooks/embedding-lifecycle.d.ts +7 -0
- package/dist/v2/hooks/embedding-lifecycle.d.ts.map +1 -0
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +2 -0
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/tools.d.ts +2 -1
- package/dist/v2/hooks/tools.d.ts.map +1 -1
- package/dist/v2/hooks/transform-features.d.ts +2 -2
- package/dist/v2/hooks/transform-features.d.ts.map +1 -1
- package/dist/v2/{message-fts-rowid-map-dg12wymk.js → message-fts-rowid-map-n8fdg2ja.js} +3 -3
- package/dist/v2/{message-index-bounded-f4e01xk0.js → message-index-bounded-8rcd7qq9.js} +12 -12
- package/dist/v2/{message-index-ydzrp6y6.js → message-index-qz9wdp82.js} +12 -12
- package/dist/v2/{message-time-backfill-ddh8n9gy.js → message-time-backfill-zvthw6xb.js} +1 -1
- package/dist/v2/migration-worker.js +8 -8
- package/dist/v2/{project-embedding-registry-deza9ksw.js → project-embedding-registry-v38q4xd5.js} +12 -10
- package/dist/v2/raw-ordinal-warmup-worker.js +8 -8
- package/dist/v2/{read-session-chunk-8cxfagky.js → read-session-chunk-wazfyxcg.js} +8 -8
- package/dist/v2/{read-session-raw-1nrrecvx.js → read-session-raw-b70cpwzj.js} +2 -2
- package/dist/v2/{recomp-orchestrator-47m4hv5g.js → recomp-orchestrator-b12zaptj.js} +25 -25
- package/dist/v2/{search-archive-e80cvc09.js → search-archive-x64rtz1z.js} +9 -9
- package/dist/v2/{search-fjz746zr.js → search-hza9x72a.js} +21 -21
- package/dist/v2/{send-session-notification-nwvrv34d.js → send-session-notification-8eqe259v.js} +4 -4
- package/dist/v2/{server-4sxjs6hn.js → server-132h8twc.js} +4 -4
- package/dist/v2/{server-271qxsf5.js → server-24g8r2d0.js} +2466 -1290
- package/dist/v2/{server-m91f9m5s.js → server-33nqbqkw.js} +123 -40
- package/dist/v2/{server-brj8j2gk.js → server-3vhxy2k5.js} +1 -1
- package/dist/v2/{server-55rgxfrw.js → server-4kjmrjn4.js} +1 -1
- package/dist/v2/{server-wyawsa88.js → server-62g58aaz.js} +2 -2
- package/dist/v2/{server-230fnbws.js → server-6v3cdzsx.js} +1 -1
- package/dist/v2/{server-ygtykank.js → server-806rzhs6.js} +1 -1
- package/dist/v2/{server-5arr9ecn.js → server-94wk1ey3.js} +12 -1
- package/dist/v2/{server-af2pght7.js → server-ab1g0wn9.js} +2 -4
- package/dist/v2/{server-0epqaxhd.js → server-ad18djzs.js} +26 -8
- package/dist/v2/{server-4nw4fqhr.js → server-bsgd4dk1.js} +1 -1
- package/dist/v2/{server-dj7tz4ph.js → server-d1dzgvwd.js} +1 -1
- package/dist/v2/{server-vn2nwcv6.js → server-d48x3m4x.js} +4 -4
- package/dist/v2/{server-br1x0tev.js → server-dtp8hcjh.js} +2 -2
- package/dist/v2/{server-a3dwxfgd.js → server-fa7vtp40.js} +7 -4
- package/dist/{index-1zx2pa5d.js → v2/server-gzy5w8ya.js} +193 -4
- package/dist/v2/{server-hqzyq8n4.js → server-j8h7bsca.js} +26 -12
- package/dist/v2/{server-y4a3nhtk.js → server-jjvbk92s.js} +1 -1
- package/dist/v2/{server-ej96a39v.js → server-m4bfaevz.js} +1186 -1046
- package/dist/v2/{server-63fqdghs.js → server-ppcd1qxh.js} +92 -86
- package/dist/v2/{server-ne8arh8t.js → server-qjvk4a9t.js} +1 -1
- package/dist/v2/{server-xsryvyf6.js → server-qteg2kt9.js} +4 -4
- package/dist/v2/{server-168pb207.js → server-rqebawx1.js} +1 -1
- package/dist/v2/{server-j4jnp9b5.js → server-vr4szghm.js} +35 -4
- package/dist/v2/{server-9x0kmta4.js → server-wwaw5npa.js} +3 -3
- package/dist/v2/{server-c7dxxsj7.js → server-zg5y109h.js} +33 -33
- package/dist/v2/server.js +6 -6
- package/dist/v2/{sqlite-1rpvw2rj.js → sqlite-zdgm52sv.js} +5 -1
- package/dist/v2/{storage-memory-nm7v82mj.js → storage-memory-e6a7mb0k.js} +2 -2
- package/dist/v2/{storage-tags-ss08kj5r.js → storage-tags-q71rnr9f.js} +3 -3
- package/dist/v2/store-reader.d.ts +2 -0
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-639whfhq.js → wrapup-orchestrator-3ssd5yy1.js} +25 -25
- package/dist/wrapup-orchestrator-5vpcd1zx.js +49 -0
- package/package.json +2 -2
- package/src/config/index.test.ts +44 -0
- package/src/config/project-security.ts +15 -0
- package/src/config/rerank.test.ts +60 -0
- package/src/config/schema/magic-context.ts +57 -0
- package/src/shared/model-suggestion-retry.ts +1 -1
- package/src/shared/sqlite-turn-deadline.test.ts +270 -0
- package/src/shared/sqlite.ts +235 -7
- package/src/shared/tag-transcript.ts +9 -1
- package/dist/wrapup-orchestrator-mnvt2g8m.js +0 -49
|
@@ -9,18 +9,22 @@ import {
|
|
|
9
9
|
readProcessStartTime
|
|
10
10
|
} from "./server-k3t06fxr.js";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
extractTexts2
|
|
16
|
-
} from "./server-3mz2qh5a.js";
|
|
12
|
+
resolveOpenCodeDbPath,
|
|
13
|
+
assertOpenCodeStoreGeneration
|
|
14
|
+
} from "./server-2ra6pwf3.js";
|
|
17
15
|
import {
|
|
18
16
|
Database2,
|
|
19
17
|
getSqliteDatabasePath2,
|
|
20
18
|
prepareCachedStatement2,
|
|
21
19
|
withSqliteBackgroundWriter2,
|
|
22
20
|
withoutSqliteTransformPass2
|
|
23
|
-
} from "./server-
|
|
21
|
+
} from "./server-gzy5w8ya.js";
|
|
22
|
+
import {
|
|
23
|
+
removeSystemReminders,
|
|
24
|
+
removeNestedBlocks,
|
|
25
|
+
hasMeaningfulUserText2,
|
|
26
|
+
extractTexts2
|
|
27
|
+
} from "./server-3mz2qh5a.js";
|
|
24
28
|
import {
|
|
25
29
|
TAG_TOMBSTONE_OWNER_PREFIX,
|
|
26
30
|
tagTombstoneOwnerRange,
|
|
@@ -28,24 +32,20 @@ import {
|
|
|
28
32
|
tagRevisionKey,
|
|
29
33
|
tagIdentityRevisionKey,
|
|
30
34
|
deleteTagIdentityRevisions
|
|
31
|
-
} from "./server-
|
|
32
|
-
import {
|
|
33
|
-
resolveOpenCodeDbPath,
|
|
34
|
-
assertOpenCodeStoreGeneration
|
|
35
|
-
} from "./server-2ra6pwf3.js";
|
|
35
|
+
} from "./server-rqebawx1.js";
|
|
36
36
|
import {
|
|
37
37
|
cleanUserText2
|
|
38
|
-
} from "./server-
|
|
38
|
+
} from "./server-m4bfaevz.js";
|
|
39
39
|
import {
|
|
40
40
|
recordMessageFtsRowid2,
|
|
41
41
|
recordIndexedMessageTime2,
|
|
42
42
|
messageFtsOrdinalRangeIsMapped2,
|
|
43
43
|
getMessageFtsRowidMapBackfillProgress2,
|
|
44
44
|
deleteUnmappedMessageFtsRows2
|
|
45
|
-
} from "./server-
|
|
45
|
+
} from "./server-dtp8hcjh.js";
|
|
46
46
|
import {
|
|
47
47
|
deleteChunkEmbedBackoffForSession2
|
|
48
|
-
} from "./server-
|
|
48
|
+
} from "./server-62g58aaz.js";
|
|
49
49
|
import {
|
|
50
50
|
sameProjectDirectory
|
|
51
51
|
} from "./server-knvkbfvh.js";
|
|
@@ -108,32 +108,6 @@ class BoundedSessionMap {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
// src/features/magic-context/compression-depth-storage.ts
|
|
112
|
-
var incrementDepthStatements = new WeakMap;
|
|
113
|
-
var totalDepthStatements = new WeakMap;
|
|
114
|
-
var maxDepthStatements = new WeakMap;
|
|
115
|
-
var clearDepthStatements = new WeakMap;
|
|
116
|
-
function getClearDepthStatement(db) {
|
|
117
|
-
let stmt = clearDepthStatements.get(db);
|
|
118
|
-
if (!stmt) {
|
|
119
|
-
stmt = db.prepare("DELETE FROM compression_depth WHERE session_id = ?");
|
|
120
|
-
clearDepthStatements.set(db, stmt);
|
|
121
|
-
}
|
|
122
|
-
return stmt;
|
|
123
|
-
}
|
|
124
|
-
function clearCompressionDepth(db, sessionId) {
|
|
125
|
-
getClearDepthStatement(db).run(sessionId);
|
|
126
|
-
}
|
|
127
|
-
function clearCompressionDepthRange(db, sessionId, startOrdinal, endOrdinal) {
|
|
128
|
-
if (endOrdinal < startOrdinal) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
db.prepare("DELETE FROM compression_depth WHERE session_id = ? AND message_ordinal BETWEEN ? AND ?").run(sessionId, startOrdinal, endOrdinal);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// src/features/magic-context/message-index.ts
|
|
135
|
-
import { createHash as createHash4 } from "node:crypto";
|
|
136
|
-
|
|
137
111
|
// src/hooks/magic-context/lkg-recovery-fence.ts
|
|
138
112
|
import { createHash as createHash2, randomUUID as randomUUID2 } from "node:crypto";
|
|
139
113
|
import {
|
|
@@ -617,51 +591,6 @@ function clearLkgRecoveryFence(sessionId, remove, shouldClear) {
|
|
|
617
591
|
}
|
|
618
592
|
}
|
|
619
593
|
|
|
620
|
-
// src/shared/search-text.ts
|
|
621
|
-
function removeTaskNotifications(text) {
|
|
622
|
-
return removeNestedBlocks(text, ["task", "task_cohort"]);
|
|
623
|
-
}
|
|
624
|
-
function cleanSearchText(text) {
|
|
625
|
-
return removeNestedBlocks(text, ["system-reminder", "task", "task_cohort"]).replace(/\s+/g, " ").trim();
|
|
626
|
-
}
|
|
627
|
-
var QUERY_STOP_WORDS = new Set("a an and are as at be been by can could did do does for from how i in is it me my of on or our please should that the their them there these they this to us was we were what when where which who why will with would you your".split(" "));
|
|
628
|
-
function terms(text) {
|
|
629
|
-
return [
|
|
630
|
-
...new Set((text.toLowerCase().match(/[\p{L}\p{N}_]+/gu) ?? []).filter((term) => !QUERY_STOP_WORDS.has(term)))
|
|
631
|
-
];
|
|
632
|
-
}
|
|
633
|
-
function keywordRelevance(query, content) {
|
|
634
|
-
const needles = terms(query);
|
|
635
|
-
if (needles.length === 0)
|
|
636
|
-
return 0;
|
|
637
|
-
const words = new Set(terms(cleanSearchText(content)));
|
|
638
|
-
return 0.8 * needles.filter((term) => words.has(term)).length / needles.length;
|
|
639
|
-
}
|
|
640
|
-
function matchedSearchSnippet(content, query, cap = 220) {
|
|
641
|
-
const text = cleanSearchText(content);
|
|
642
|
-
const needles = new Set(terms(query));
|
|
643
|
-
const matches = [...text.matchAll(/[\p{L}\p{N}_]+/gu)].filter((match) => needles.has(match[0].toLowerCase()));
|
|
644
|
-
if (matches.length === 0)
|
|
645
|
-
return "";
|
|
646
|
-
let bestStart = matches[0].index;
|
|
647
|
-
let bestCoverage = -1;
|
|
648
|
-
for (const match of matches) {
|
|
649
|
-
const start = Math.max(0, match.index - Math.floor(cap / 5));
|
|
650
|
-
const coverage = keywordRelevance(query, text.slice(start, start + cap));
|
|
651
|
-
if (coverage > bestCoverage) {
|
|
652
|
-
bestStart = start;
|
|
653
|
-
bestCoverage = coverage;
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
if (bestStart > 0) {
|
|
657
|
-
const boundary = text.indexOf(" ", bestStart);
|
|
658
|
-
if (boundary >= 0 && boundary < matches[matches.length - 1].index)
|
|
659
|
-
bestStart = boundary + 1;
|
|
660
|
-
}
|
|
661
|
-
const passage = text.slice(bestStart, bestStart + cap).trim();
|
|
662
|
-
return `${bestStart > 0 ? "…" : ""}${passage}${bestStart + cap < text.length ? "…" : ""}`;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
594
|
// src/v2/store-reader.ts
|
|
666
595
|
import { createHash as createHash3 } from "node:crypto";
|
|
667
596
|
import { statSync } from "node:fs";
|
|
@@ -1016,6 +945,12 @@ class V2StoreReader {
|
|
|
1016
945
|
return typeof row?.count === "number" ? row.count : 0;
|
|
1017
946
|
});
|
|
1018
947
|
}
|
|
948
|
+
messageCountAfterSequence(sessionID, after, through) {
|
|
949
|
+
const rawTypes = RAW_MESSAGE_TYPES.map(() => "?").join(", ");
|
|
950
|
+
const row = this.prepare(`SELECT COUNT(*) AS count FROM session_message
|
|
951
|
+
WHERE session_id = ? AND seq > ? AND seq <= ? AND type IN (${rawTypes})`).get(sessionID, after, through, ...RAW_MESSAGE_TYPES);
|
|
952
|
+
return typeof row?.count === "number" ? row.count : 0;
|
|
953
|
+
}
|
|
1019
954
|
sessionDirectoryPage(afterSessionID, limit) {
|
|
1020
955
|
const rows = this.prepare(`SELECT id, COALESCE(directory, '') AS directory FROM session_v2
|
|
1021
956
|
WHERE id > ? ORDER BY id ASC LIMIT ?`).all(afterSessionID ?? "", limit);
|
|
@@ -1362,6 +1297,77 @@ class V2StoreReader {
|
|
|
1362
1297
|
}
|
|
1363
1298
|
}
|
|
1364
1299
|
|
|
1300
|
+
// src/features/magic-context/message-index.ts
|
|
1301
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
1302
|
+
|
|
1303
|
+
// src/shared/search-text.ts
|
|
1304
|
+
function removeTaskNotifications(text) {
|
|
1305
|
+
return removeNestedBlocks(text, ["task", "task_cohort"]);
|
|
1306
|
+
}
|
|
1307
|
+
function cleanSearchText(text) {
|
|
1308
|
+
return removeNestedBlocks(text, ["system-reminder", "task", "task_cohort"]).replace(/\s+/g, " ").trim();
|
|
1309
|
+
}
|
|
1310
|
+
var QUERY_STOP_WORDS = new Set("a an and are as at be been by can could did do does for from how i in is it me my of on or our please should that the their them there these they this to us was we were what when where which who why will with would you your".split(" "));
|
|
1311
|
+
function terms(text) {
|
|
1312
|
+
return [
|
|
1313
|
+
...new Set((text.toLowerCase().match(/[\p{L}\p{N}_]+/gu) ?? []).filter((term) => !QUERY_STOP_WORDS.has(term)))
|
|
1314
|
+
];
|
|
1315
|
+
}
|
|
1316
|
+
function keywordRelevance(query, content) {
|
|
1317
|
+
const needles = terms(query);
|
|
1318
|
+
if (needles.length === 0)
|
|
1319
|
+
return 0;
|
|
1320
|
+
const words = new Set(terms(cleanSearchText(content)));
|
|
1321
|
+
return 0.8 * needles.filter((term) => words.has(term)).length / needles.length;
|
|
1322
|
+
}
|
|
1323
|
+
function matchedSearchSnippet(content, query, cap = 220) {
|
|
1324
|
+
const text = cleanSearchText(content);
|
|
1325
|
+
const needles = new Set(terms(query));
|
|
1326
|
+
const matches = [...text.matchAll(/[\p{L}\p{N}_]+/gu)].filter((match) => needles.has(match[0].toLowerCase()));
|
|
1327
|
+
if (matches.length === 0)
|
|
1328
|
+
return "";
|
|
1329
|
+
let bestStart = matches[0].index;
|
|
1330
|
+
let bestCoverage = -1;
|
|
1331
|
+
for (const match of matches) {
|
|
1332
|
+
const start = Math.max(0, match.index - Math.floor(cap / 5));
|
|
1333
|
+
const coverage = keywordRelevance(query, text.slice(start, start + cap));
|
|
1334
|
+
if (coverage > bestCoverage) {
|
|
1335
|
+
bestStart = start;
|
|
1336
|
+
bestCoverage = coverage;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
if (bestStart > 0) {
|
|
1340
|
+
const boundary = text.indexOf(" ", bestStart);
|
|
1341
|
+
if (boundary >= 0 && boundary < matches[matches.length - 1].index)
|
|
1342
|
+
bestStart = boundary + 1;
|
|
1343
|
+
}
|
|
1344
|
+
const passage = text.slice(bestStart, bestStart + cap).trim();
|
|
1345
|
+
return `${bestStart > 0 ? "…" : ""}${passage}${bestStart + cap < text.length ? "…" : ""}`;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
// src/features/magic-context/compression-depth-storage.ts
|
|
1349
|
+
var incrementDepthStatements = new WeakMap;
|
|
1350
|
+
var totalDepthStatements = new WeakMap;
|
|
1351
|
+
var maxDepthStatements = new WeakMap;
|
|
1352
|
+
var clearDepthStatements = new WeakMap;
|
|
1353
|
+
function getClearDepthStatement(db) {
|
|
1354
|
+
let stmt = clearDepthStatements.get(db);
|
|
1355
|
+
if (!stmt) {
|
|
1356
|
+
stmt = db.prepare("DELETE FROM compression_depth WHERE session_id = ?");
|
|
1357
|
+
clearDepthStatements.set(db, stmt);
|
|
1358
|
+
}
|
|
1359
|
+
return stmt;
|
|
1360
|
+
}
|
|
1361
|
+
function clearCompressionDepth(db, sessionId) {
|
|
1362
|
+
getClearDepthStatement(db).run(sessionId);
|
|
1363
|
+
}
|
|
1364
|
+
function clearCompressionDepthRange(db, sessionId, startOrdinal, endOrdinal) {
|
|
1365
|
+
if (endOrdinal < startOrdinal) {
|
|
1366
|
+
return;
|
|
1367
|
+
}
|
|
1368
|
+
db.prepare("DELETE FROM compression_depth WHERE session_id = ? AND message_ordinal BETWEEN ? AND ?").run(sessionId, startOrdinal, endOrdinal);
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1365
1371
|
// src/features/magic-context/session-activity.ts
|
|
1366
1372
|
var PREFIX = "retrospective_activity:";
|
|
1367
1373
|
var pending = new WeakMap;
|
|
@@ -2253,4 +2259,4 @@ async function sweepOrphanedOpenCodeMessageIndexesCooperatively2(db, openSource,
|
|
|
2253
2259
|
}));
|
|
2254
2260
|
}
|
|
2255
2261
|
|
|
2256
|
-
export { BoundedSessionMap,
|
|
2262
|
+
export { BoundedSessionMap, LkgRecoveryFenceError, clearLkgFenceProcessState, lkgServedArrayDigest, takeLkgRecoveryLockSweepPage, hasCleanLkgRecoveryFence, lkgFenceRequiresRebuild, lkgRecoveryFenceUnclean, dirtyLkgRecoveryRevision, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, prepareLkgCaptureFence, certifyCommittedLkgCapture, markLkgRecoveryDirty, commitLkgWithRecoveryFence, clearLkgRecoveryFence, gaDatabasePath, RAW_MESSAGE_TYPES, V2StoreReaderPool, V2StoreReader, cleanSearchText, keywordRelevance, matchedSearchSnippet, clearCompressionDepth, clearCompressionDepthRange, advanceSessionActivity, backfillSessionActivity, deleteSessionScopedRows, MESSAGE_INDEX_MAX_FTS_BYTES2, messageIndexSkipKey2, toMessageIndexSource2, getMessageIndexSourceIdentity2, isMessageIndexSourceCurrent2, getLastIndexedOrdinal2, getIndexedMessageCorpusSize2, markMessageIndexDirty2, getMessageIndexReconciliationStartOrdinal2, isMessageIndexReconciledThrough2, deleteIndexedMessage2, clearIndexedMessagesInTransaction2, clearIndexedMessages2, getIndexableContent2, indexSingleMessage2, indexMessagesAfterOrdinal2, indexSourcesAfterOrdinal2, sweepOrphanedOpenCodeMessageIndexesCooperatively2 };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-24g8r2d0.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
6
|
} from "./server-6495nmn9.js";
|
|
7
7
|
import {
|
|
8
8
|
isSynapseEmbeddingTruncated,
|
|
9
9
|
SynapseEmbeddingProvider
|
|
10
|
-
} from "./server-
|
|
10
|
+
} from "./server-ab1g0wn9.js";
|
|
11
11
|
import {
|
|
12
12
|
LocalEmbeddingProvider
|
|
13
|
-
} from "./server-
|
|
13
|
+
} from "./server-vr4szghm.js";
|
|
14
14
|
import {
|
|
15
15
|
OpenAICompatibleEmbeddingProvider,
|
|
16
16
|
getProjectEmbeddingSnapshot2,
|
|
17
17
|
embedBatchForProject2
|
|
18
|
-
} from "./server-
|
|
18
|
+
} from "./server-ad18djzs.js";
|
|
19
19
|
import {
|
|
20
20
|
isEmbeddingHostBusy2
|
|
21
21
|
} from "./server-qt1qqasc.js";
|
|
@@ -530,4 +530,4 @@ function jsonHashSink(prefix = "") {
|
|
|
530
530
|
return { write, digest: () => (hash >>> 0).toString(16).padStart(8, "0") };
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
export {
|
|
533
|
+
export { stableStringify, stableStringifyHash, getTableColumnNames, ensureColumn, healAllNullColumns, getTemporalDecisions, observeTemporalDecisions, freezeTemporalDecisions, installV95PerfSchema, tagOrderConstraintIndex, TAG_TOMBSTONE_OWNER_PREFIX, tagTombstoneOwnerRange, tagTombstoneOwnerKey, tagRevisionKey, tagIdentityRevisionKey, installTagIdentityRevisionTrigger, deleteTagIdentityRevisions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_LOCAL_EMBEDDING_MODEL
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-24g8r2d0.js";
|
|
4
4
|
import {
|
|
5
5
|
getHarness2
|
|
6
6
|
} from "./server-pavzsdc6.js";
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
} from "./server-6495nmn9.js";
|
|
12
12
|
import {
|
|
13
13
|
getSynapseLaneIdentity
|
|
14
|
-
} from "./server-
|
|
14
|
+
} from "./server-ab1g0wn9.js";
|
|
15
15
|
import {
|
|
16
16
|
inRootAsyncContext2
|
|
17
|
-
} from "./server-
|
|
17
|
+
} from "./server-gzy5w8ya.js";
|
|
18
18
|
import {
|
|
19
19
|
computeNormalizedHash
|
|
20
20
|
} from "./server-2bvekkfy.js";
|
|
@@ -725,16 +725,20 @@ class EmbeddingWorkerClient {
|
|
|
725
725
|
entry;
|
|
726
726
|
timeoutMs;
|
|
727
727
|
prepareTelemetry;
|
|
728
|
+
idleMs;
|
|
728
729
|
worker = null;
|
|
729
730
|
startPromise = null;
|
|
730
731
|
nextId = 1;
|
|
731
732
|
pending = new Map;
|
|
732
733
|
disposed = false;
|
|
733
|
-
|
|
734
|
+
activeRequests = 0;
|
|
735
|
+
idleTimer = null;
|
|
736
|
+
constructor(data, entry = new URL(new URL(import.meta.url).pathname.endsWith(".ts") ? "./embedding-worker.ts" : "./embedding-worker.js", import.meta.url), timeoutMs = 5 * 60000, prepareTelemetry = prepareNativeOnnxTelemetry, idleMs = 10 * 60000) {
|
|
734
737
|
this.data = data;
|
|
735
738
|
this.entry = entry;
|
|
736
739
|
this.timeoutMs = timeoutMs;
|
|
737
740
|
this.prepareTelemetry = prepareTelemetry;
|
|
741
|
+
this.idleMs = idleMs;
|
|
738
742
|
}
|
|
739
743
|
start() {
|
|
740
744
|
if (this.startPromise)
|
|
@@ -800,6 +804,7 @@ class EmbeddingWorkerClient {
|
|
|
800
804
|
const fail = (error) => {
|
|
801
805
|
if (this.worker !== worker)
|
|
802
806
|
return;
|
|
807
|
+
this.clearIdleTimer();
|
|
803
808
|
this.worker = null;
|
|
804
809
|
for (const request of this.pending.values()) {
|
|
805
810
|
clearTimeout(request.timer);
|
|
@@ -824,6 +829,31 @@ class EmbeddingWorkerClient {
|
|
|
824
829
|
async request(texts, signal) {
|
|
825
830
|
if (signal?.aborted)
|
|
826
831
|
return Promise.reject(new Error("embedding request aborted"));
|
|
832
|
+
this.activeRequests++;
|
|
833
|
+
this.clearIdleTimer();
|
|
834
|
+
try {
|
|
835
|
+
return await this.requestOnWorker(texts, signal);
|
|
836
|
+
} finally {
|
|
837
|
+
this.activeRequests--;
|
|
838
|
+
this.armIdleTimer();
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
clearIdleTimer() {
|
|
842
|
+
if (this.idleTimer)
|
|
843
|
+
clearTimeout(this.idleTimer);
|
|
844
|
+
this.idleTimer = null;
|
|
845
|
+
}
|
|
846
|
+
armIdleTimer() {
|
|
847
|
+
if (this.disposed || this.activeRequests !== 0 || !this.worker)
|
|
848
|
+
return;
|
|
849
|
+
this.clearIdleTimer();
|
|
850
|
+
this.idleTimer = inRootAsyncContext2(() => setTimeout(() => {
|
|
851
|
+
this.idleTimer = null;
|
|
852
|
+
this.stop(new Error("embedding worker idle"));
|
|
853
|
+
}, this.idleMs));
|
|
854
|
+
this.idleTimer.unref();
|
|
855
|
+
}
|
|
856
|
+
async requestOnWorker(texts, signal) {
|
|
827
857
|
const worker = await this.start();
|
|
828
858
|
if (this.disposed)
|
|
829
859
|
throw new Error("embedding worker disposed");
|
|
@@ -875,6 +905,7 @@ class EmbeddingWorkerClient {
|
|
|
875
905
|
});
|
|
876
906
|
}
|
|
877
907
|
async stop(error) {
|
|
908
|
+
this.clearIdleTimer();
|
|
878
909
|
const worker = this.worker;
|
|
879
910
|
this.worker = null;
|
|
880
911
|
for (const request of this.pending.values()) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ensureColumn,
|
|
9
9
|
healAllNullColumns,
|
|
10
10
|
installV95PerfSchema
|
|
11
|
-
} from "./server-
|
|
11
|
+
} from "./server-rqebawx1.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveOpenCodeDbPath,
|
|
14
14
|
openCodeDbPathExists,
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
} from "./server-2ra6pwf3.js";
|
|
17
17
|
import {
|
|
18
18
|
Database2
|
|
19
|
-
} from "./server-
|
|
19
|
+
} from "./server-gzy5w8ya.js";
|
|
20
20
|
import {
|
|
21
21
|
normalizeStoredProjectPath,
|
|
22
22
|
storedPathBelongsToIdentity
|
|
23
|
-
} from "./server-
|
|
23
|
+
} from "./server-qjvk4a9t.js";
|
|
24
24
|
import {
|
|
25
25
|
logSlowWriteTransaction
|
|
26
26
|
} from "./server-gyy4k6mf.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
cortexKitProjectConfigBasePath,
|
|
19
19
|
resolveLegacyConfigSourcesForHarness,
|
|
20
20
|
loadPluginConfigDetailed
|
|
21
|
-
} from "./server-
|
|
21
|
+
} from "./server-94wk1ey3.js";
|
|
22
22
|
import {
|
|
23
23
|
catalogOutputReserve,
|
|
24
24
|
getSdkContextLimit,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
resolvePromptSurface,
|
|
32
32
|
DEFAULT_HISTORIAN_TIMEOUT_MS,
|
|
33
33
|
LIVE_RELOAD_CONFIG_PATHS
|
|
34
|
-
} from "./server-
|
|
34
|
+
} from "./server-24g8r2d0.js";
|
|
35
35
|
import {
|
|
36
36
|
invalidateAutoEmbedSession,
|
|
37
37
|
drainBackgroundBatches,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
getProjectChunkEmbeddingModelId2,
|
|
41
41
|
getProjectEmbeddingMaxInputTokens2,
|
|
42
42
|
embedItemsForProject2
|
|
43
|
-
} from "./server-
|
|
43
|
+
} from "./server-ad18djzs.js";
|
|
44
44
|
import {
|
|
45
45
|
hasMeaningfulUserText2,
|
|
46
46
|
estimateTokens,
|
|
@@ -53,13 +53,13 @@ import {
|
|
|
53
53
|
withSqliteBackgroundWriter2,
|
|
54
54
|
withoutSqliteTransformPass2,
|
|
55
55
|
beginSqliteWriterAsync2
|
|
56
|
-
} from "./server-
|
|
56
|
+
} from "./server-gzy5w8ya.js";
|
|
57
57
|
import {
|
|
58
58
|
isStrictGapHealingMessage2,
|
|
59
59
|
noteRawSessionSummaryRowWritten2,
|
|
60
60
|
RawOrdinalsNotReady2,
|
|
61
61
|
runSessionWarmupWorker
|
|
62
|
-
} from "./server-
|
|
62
|
+
} from "./server-4kjmrjn4.js";
|
|
63
63
|
import {
|
|
64
64
|
buildCanonicalChunkTextFromFts2,
|
|
65
65
|
buildCompartmentSummaryFallbackText2,
|
|
@@ -69,14 +69,12 @@ import {
|
|
|
69
69
|
replaceCompartmentChunkEmbeddings2,
|
|
70
70
|
deleteChunkEmbedBackoffForSession2,
|
|
71
71
|
chunkWindowSourceKey2
|
|
72
|
-
} from "./server-
|
|
72
|
+
} from "./server-62g58aaz.js";
|
|
73
73
|
import {
|
|
74
74
|
isPidAlive
|
|
75
75
|
} from "./server-k3t06fxr.js";
|
|
76
76
|
import {
|
|
77
77
|
BoundedSessionMap,
|
|
78
|
-
clearCompressionDepth,
|
|
79
|
-
clearCompressionDepthRange,
|
|
80
78
|
clearLkgFenceProcessState,
|
|
81
79
|
lkgFenceRequiresRebuild,
|
|
82
80
|
lkgRecoveryFenceUnclean,
|
|
@@ -85,23 +83,14 @@ import {
|
|
|
85
83
|
clearLkgRecoveryFence,
|
|
86
84
|
gaDatabasePath,
|
|
87
85
|
V2StoreReader,
|
|
86
|
+
clearCompressionDepth,
|
|
87
|
+
clearCompressionDepthRange,
|
|
88
88
|
deleteSessionScopedRows,
|
|
89
89
|
toMessageIndexSource2,
|
|
90
90
|
clearIndexedMessagesInTransaction2,
|
|
91
91
|
indexSourcesAfterOrdinal2
|
|
92
|
-
} from "./server-
|
|
92
|
+
} from "./server-ppcd1qxh.js";
|
|
93
93
|
import {
|
|
94
|
-
detectOverflow,
|
|
95
|
-
SESSION_META_SELECT_COLUMNS,
|
|
96
|
-
META_COLUMNS,
|
|
97
|
-
BOOLEAN_META_KEYS,
|
|
98
|
-
NULL_BIND_META_KEYS,
|
|
99
|
-
isSessionMetaRow,
|
|
100
|
-
getDefaultSessionMeta,
|
|
101
|
-
ensureSessionMetaRow,
|
|
102
|
-
toSessionMeta,
|
|
103
|
-
persistCachedM0,
|
|
104
|
-
clearCachedM0M1,
|
|
105
94
|
retreatPastHostUnservedRows,
|
|
106
95
|
snapTerminalCompartmentToServedRow,
|
|
107
96
|
isHostRenderedSystemMessage,
|
|
@@ -127,6 +116,16 @@ import {
|
|
|
127
116
|
decodeMergedReasoningParts,
|
|
128
117
|
escalationBands,
|
|
129
118
|
sessionDecisionCalibration,
|
|
119
|
+
SESSION_META_SELECT_COLUMNS,
|
|
120
|
+
META_COLUMNS,
|
|
121
|
+
BOOLEAN_META_KEYS,
|
|
122
|
+
NULL_BIND_META_KEYS,
|
|
123
|
+
isSessionMetaRow,
|
|
124
|
+
getDefaultSessionMeta,
|
|
125
|
+
ensureSessionMetaRow,
|
|
126
|
+
toSessionMeta,
|
|
127
|
+
persistCachedM0,
|
|
128
|
+
clearCachedM0M1,
|
|
130
129
|
isRustMarkerAdmissionFenced,
|
|
131
130
|
readReplayEnvelope,
|
|
132
131
|
readReplayDocument,
|
|
@@ -171,6 +170,7 @@ import {
|
|
|
171
170
|
clearPendingCompactionMarkerStateIf,
|
|
172
171
|
getPendingPiCompactionMarkerState,
|
|
173
172
|
logPiCompactionMarkerClear,
|
|
173
|
+
detectOverflow,
|
|
174
174
|
resolveHostServedBoundaryId2,
|
|
175
175
|
hasRawMessageProvider2,
|
|
176
176
|
withRawSessionMessageCache2,
|
|
@@ -187,17 +187,17 @@ import {
|
|
|
187
187
|
getRawSessionTagKeysThrough2,
|
|
188
188
|
getLegacyProtectedTailStartOrdinal2,
|
|
189
189
|
readSessionChunk2
|
|
190
|
-
} from "./server-
|
|
190
|
+
} from "./server-m4bfaevz.js";
|
|
191
191
|
import {
|
|
192
192
|
getTableColumnNames
|
|
193
|
-
} from "./server-
|
|
193
|
+
} from "./server-rqebawx1.js";
|
|
194
194
|
import {
|
|
195
195
|
FAIL_CLOSED_DOCTOR_COMMAND,
|
|
196
196
|
getSchemaFenceRejection,
|
|
197
197
|
LATEST_SUPPORTED_VERSION,
|
|
198
198
|
getPersistedSchemaVersion,
|
|
199
199
|
openDatabase
|
|
200
|
-
} from "./server-
|
|
200
|
+
} from "./server-j8h7bsca.js";
|
|
201
201
|
import {
|
|
202
202
|
providerMass,
|
|
203
203
|
calibrationForModelKey,
|
|
@@ -215,7 +215,7 @@ import {
|
|
|
215
215
|
foldShrunkPartTags2,
|
|
216
216
|
getTagNumberByMessageId2,
|
|
217
217
|
getActiveTagsBySession2
|
|
218
|
-
} from "./server-
|
|
218
|
+
} from "./server-fa7vtp40.js";
|
|
219
219
|
import {
|
|
220
220
|
resolveOpenCodeDbPath,
|
|
221
221
|
assertOpenCodeStoreGeneration,
|
|
@@ -226,10 +226,10 @@ import {
|
|
|
226
226
|
openCodeDbExists,
|
|
227
227
|
withReadOnlySessionDb,
|
|
228
228
|
getMessageTimesFromOpenCodeDb
|
|
229
|
-
} from "./server-
|
|
229
|
+
} from "./server-3vhxy2k5.js";
|
|
230
230
|
import {
|
|
231
231
|
getMeasuredToolDefinitionTokens
|
|
232
|
-
} from "./server-
|
|
232
|
+
} from "./server-d1dzgvwd.js";
|
|
233
233
|
import {
|
|
234
234
|
V2_MEMORY_CATEGORIES,
|
|
235
235
|
CATEGORY_PRIORITY,
|
|
@@ -245,11 +245,11 @@ import {
|
|
|
245
245
|
resolveStoredPathWorkspaceIdentity,
|
|
246
246
|
sourceNameForMemory,
|
|
247
247
|
computeWorkspaceEpochFingerprint
|
|
248
|
-
} from "./server-
|
|
248
|
+
} from "./server-wwaw5npa.js";
|
|
249
249
|
import {
|
|
250
250
|
shouldSkipHomeProjectMemory,
|
|
251
251
|
resolveProjectIdentity
|
|
252
|
-
} from "./server-
|
|
252
|
+
} from "./server-qjvk4a9t.js";
|
|
253
253
|
import {
|
|
254
254
|
getSessionNotes,
|
|
255
255
|
getReadySmartNotes,
|
|
@@ -258,13 +258,13 @@ import {
|
|
|
258
258
|
userFacingFailureCode,
|
|
259
259
|
promoteSessionFactsDurable,
|
|
260
260
|
embedPromotedFacts
|
|
261
|
-
} from "./server-
|
|
261
|
+
} from "./server-d48x3m4x.js";
|
|
262
262
|
import {
|
|
263
263
|
isMarkerCandidateBasisCurrent2,
|
|
264
264
|
invalidateMarkerCandidateBasis2,
|
|
265
265
|
readMarkerCandidateBasis2,
|
|
266
266
|
prepareMarkerCandidateBasis2
|
|
267
|
-
} from "./server-
|
|
267
|
+
} from "./server-806rzhs6.js";
|
|
268
268
|
import {
|
|
269
269
|
computeCueContentHash,
|
|
270
270
|
getMuralCueState,
|
|
@@ -272,7 +272,7 @@ import {
|
|
|
272
272
|
getMemoriesByProject2,
|
|
273
273
|
getMemoriesByProjects2,
|
|
274
274
|
getMaxMemoryIdForProjects2
|
|
275
|
-
} from "./server-
|
|
275
|
+
} from "./server-jjvbk92s.js";
|
|
276
276
|
import {
|
|
277
277
|
pushNotification2
|
|
278
278
|
} from "./server-x8a7jmkh.js";
|
|
@@ -283,7 +283,7 @@ import {
|
|
|
283
283
|
} from "./server-53eh1r8r.js";
|
|
284
284
|
import {
|
|
285
285
|
sendStatusNotification2
|
|
286
|
-
} from "./server-
|
|
286
|
+
} from "./server-6v3cdzsx.js";
|
|
287
287
|
import {
|
|
288
288
|
piModelRefToCanonical
|
|
289
289
|
} from "./server-avwt563y.js";
|
|
@@ -6961,7 +6961,7 @@ async function promptSyncWithValidatedOutputRetry(client, args, options) {
|
|
|
6961
6961
|
throwWithPromptFailure(failure.error, failedAttempts, args, timeoutMs, options.transport);
|
|
6962
6962
|
}
|
|
6963
6963
|
if (!cooledPrimary && !quota)
|
|
6964
|
-
log2(`[${callContext}] primary (${explicitPrimaryLabel}) failed validation/prompt: ${shortErr(failure.error)};
|
|
6964
|
+
log2(`[${callContext}] primary (${explicitPrimaryLabel}) failed validation/prompt: ${shortErr(failure.error)}; ${fallbacks.length} fallback(s) configured, subject to remaining budget`);
|
|
6965
6965
|
}
|
|
6966
6966
|
for (let i = 0;i < fallbacks.length; i += 1) {
|
|
6967
6967
|
const fallback = toModelEntry(fallbacks[i]);
|
package/dist/v2/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadPluginConfigDetailed
|
|
3
|
-
} from "./server-
|
|
3
|
+
} from "./server-94wk1ey3.js";
|
|
4
4
|
import {
|
|
5
5
|
setHarness2
|
|
6
6
|
} from "./server-pavzsdc6.js";
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
union,
|
|
22
22
|
tuple,
|
|
23
23
|
record
|
|
24
|
-
} from "./server-
|
|
24
|
+
} from "./server-24g8r2d0.js";
|
|
25
25
|
import {
|
|
26
26
|
pushNotification2
|
|
27
27
|
} from "./server-x8a7jmkh.js";
|
|
28
|
-
import"./server-
|
|
28
|
+
import"./server-gzy5w8ya.js";
|
|
29
29
|
import {
|
|
30
30
|
compareSemverCore
|
|
31
31
|
} from "./server-84w6rvvf.js";
|
|
@@ -7874,7 +7874,7 @@ var require_src2 = __commonJS(function(exports, module) {
|
|
|
7874
7874
|
// package.json
|
|
7875
7875
|
var package_default = {
|
|
7876
7876
|
name: "@cortexkit/opencode-magic-context",
|
|
7877
|
-
version: "0.49.
|
|
7877
|
+
version: "0.49.21",
|
|
7878
7878
|
type: "module",
|
|
7879
7879
|
description: "OpenCode plugin for Magic Context — cross-session memory and context management",
|
|
7880
7880
|
main: "dist/index.js",
|
|
@@ -7940,7 +7940,7 @@ var package_default = {
|
|
|
7940
7940
|
"jsonc-parser": "^3.3.1",
|
|
7941
7941
|
"onnxruntime-web": "1.26.0-dev.20260416-b7804b056c",
|
|
7942
7942
|
"quickjs-emscripten": "^0.32.0",
|
|
7943
|
-
zod: "^4.
|
|
7943
|
+
zod: "^4.6.6"
|
|
7944
7944
|
},
|
|
7945
7945
|
optionalDependencies: {
|
|
7946
7946
|
"onnxruntime-node": "1.30.0",
|
|
@@ -8195,7 +8195,7 @@ async function setup(context) {
|
|
|
8195
8195
|
if (claimStorageBackupWarningCheck() && isMagicContextStorageOutsideEngram(storageDir)) {
|
|
8196
8196
|
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.`);
|
|
8197
8197
|
}
|
|
8198
|
-
const { registerContext } = await import("./context-
|
|
8198
|
+
const { registerContext } = await import("./context-ea3x7smm.js");
|
|
8199
8199
|
setHarness2("opencode2");
|
|
8200
8200
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
8201
8201
|
const duties = await registerContext(context);
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
detectSqliteRuntime2,
|
|
6
6
|
getTagIdentityWriteGeneration2,
|
|
7
7
|
Database2,
|
|
8
|
+
createSqliteTurnDatabase2,
|
|
9
|
+
hasSqliteTurnDeadlineRouting2,
|
|
8
10
|
getSqliteDatabasePath2,
|
|
9
11
|
getSqliteMemoryStats2,
|
|
10
12
|
prepareCachedStatement2,
|
|
@@ -21,16 +23,18 @@ import {
|
|
|
21
23
|
releaseIndexOwner2,
|
|
22
24
|
withIndexChunk2,
|
|
23
25
|
yieldIndexChunk2
|
|
24
|
-
} from "./server-
|
|
26
|
+
} from "./server-gzy5w8ya.js";
|
|
25
27
|
export {
|
|
26
28
|
Database2 as Database,
|
|
27
29
|
SqliteAcquisitionBusyError2 as SqliteAcquisitionBusyError,
|
|
28
30
|
assertTransformWrite2 as assertTransformWrite,
|
|
29
31
|
beginSqliteWriterAsync2 as beginSqliteWriterAsync,
|
|
32
|
+
createSqliteTurnDatabase2 as createSqliteTurnDatabase,
|
|
30
33
|
detectSqliteRuntime2 as detectSqliteRuntime,
|
|
31
34
|
getSqliteDatabasePath2 as getSqliteDatabasePath,
|
|
32
35
|
getSqliteMemoryStats2 as getSqliteMemoryStats,
|
|
33
36
|
getTagIdentityWriteGeneration2 as getTagIdentityWriteGeneration,
|
|
37
|
+
hasSqliteTurnDeadlineRouting2 as hasSqliteTurnDeadlineRouting,
|
|
34
38
|
inRootAsyncContext2 as inRootAsyncContext,
|
|
35
39
|
indexCoordinationInput2 as indexCoordinationInput,
|
|
36
40
|
isTransientSqliteError2 as isTransientSqliteError,
|