@cortexkit/opencode-magic-context 0.48.0 → 0.49.0
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 +3 -3
- package/dist/{conflict-warning-hook-w8cykrnf.js → conflict-warning-hook-kzx4dmk1.js} +7 -7
- package/dist/{context-m0cy262m.js → context-nj5f293n.js} +96 -43
- package/dist/{derive-budgets-sg0xsq7s.js → derive-budgets-qz5rrr08.js} +2 -2
- package/dist/embedding-backfill-aetxv1vt.js +21 -0
- package/dist/embedding-worker.js +4 -4
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts +2 -0
- package/dist/features/magic-context/git-commits/search-git-commits.d.ts.map +1 -1
- package/dist/features/magic-context/message-index.d.ts.map +1 -1
- package/dist/features/magic-context/pi-content-decisions.d.ts +1 -1
- package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts +35 -0
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -0
- package/dist/features/magic-context/search.d.ts +11 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +13 -2
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts +1 -1
- package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta.d.ts +1 -1
- package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
- package/dist/features/magic-context/storage-session-tables.d.ts +2 -0
- package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tag-identity-revision.d.ts +29 -9
- package/dist/features/magic-context/storage-tag-identity-revision.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +9 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/storage.d.ts +1 -1
- package/dist/features/magic-context/storage.d.ts.map +1 -1
- package/dist/features/magic-context/tagger.d.ts +2 -0
- package/dist/features/magic-context/tagger.d.ts.map +1 -1
- package/dist/features/magic-context/transform-decision-log.d.ts +3 -0
- package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-deadline.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-replay.fixture.d.ts +24 -0
- package/dist/hooks/magic-context/auto-search-replay.fixture.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts +1 -1
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts +2 -0
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/command-handler.d.ts +2 -0
- package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts +28 -0
- package/dist/hooks/magic-context/emergency-fail-closed.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
- package/dist/hooks/magic-context/historian-host-runner.d.ts +8 -0
- package/dist/hooks/magic-context/historian-host-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/hook.d.ts +2 -1
- package/dist/hooks/magic-context/hook.d.ts.map +1 -1
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts +7 -0
- package/dist/hooks/magic-context/latest-thinking-recovery.d.ts.map +1 -1
- package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
- package/dist/hooks/magic-context/pass-outcome.d.ts +1 -0
- package/dist/hooks/magic-context/pass-outcome.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +7 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-raw.d.ts +35 -0
- package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
- package/dist/hooks/magic-context/rust-mode-transform.d.ts +36 -0
- package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
- package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts +8 -1
- package/dist/hooks/magic-context/shared-compartment-boundaries.d.ts.map +1 -1
- package/dist/hooks/magic-context/strict-thinking-prefix.d.ts +8 -0
- package/dist/hooks/magic-context/strict-thinking-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/tag-messages.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +13 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts +1 -0
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-db7zwa3v.js → index-1bt88epp.js} +93 -9
- package/dist/{index-f0h6xwqm.js → index-1g30axtz.js} +229 -67
- package/dist/{index-k1xb52kd.js → index-1r0k9js3.js} +5 -5
- package/dist/{index-692jzy0p.js → index-2jcbj7r1.js} +122 -371
- package/dist/{index-bdckkfw6.js → index-2jgwttpt.js} +16 -8
- package/dist/{index-2y0s2hep.js → index-4mjhqadz.js} +1 -1
- package/dist/{index-pdecwzrd.js → index-57mrqed8.js} +1 -1
- package/dist/{index-ty64eqcn.js → index-9qjqq45k.js} +3 -3
- package/dist/{index-yq8n9qcb.js → index-9rt53q79.js} +4 -4
- package/dist/{index-pg50n748.js → index-b7mv1jx3.js} +4 -4
- package/dist/{index-mmyh6d8f.js → index-ezmszwbd.js} +6 -4
- package/dist/{index-fbv1dn35.js → index-gzcmtmar.js} +1 -1
- package/dist/{index-0an7742d.js → index-h2py7207.js} +549 -973
- package/dist/{index-0qhce371.js → index-h2wc01qk.js} +2 -2
- package/dist/{index-dhwzyd54.js → index-h5zfkjyk.js} +160 -25
- package/dist/{index-q2tqeqde.js → index-ha87j7a8.js} +1229 -78
- package/dist/{index-14cjxt20.js → index-hj2q50k0.js} +45 -8
- package/dist/{index-cb7emxgj.js → index-kmpvemph.js} +336 -6
- package/dist/{index-c43kr12f.js → index-kp5qe690.js} +7 -7
- package/dist/{index-bhvjj0ys.js → index-kq57tdf0.js} +2 -2
- package/dist/{index-7mx8v0pw.js → index-nm6a8xpd.js} +4 -4
- package/dist/{index-8j7gqj40.js → index-nsjyysj0.js} +6 -2
- package/dist/{index-k9nnwad5.js → index-nydv6g8r.js} +44 -7
- package/dist/{index-5zygecde.js → index-peshmj6h.js} +4 -4
- package/dist/{index-knh4y330.js → index-pxwp2hjk.js} +7 -2
- package/dist/{index-1qb0z7wa.js → index-qx53vezw.js} +1 -1
- package/dist/{index-q7h7csab.js → index-s4j7t92z.js} +9 -9
- package/dist/{index-z8e0psj8.js → index-stbr4ce6.js} +3 -3
- package/dist/{index-jcbd3znx.js → index-tqf7yg27.js} +1 -1
- package/dist/{index-72nhv486.js → index-vkbqdnkj.js} +2 -2
- package/dist/{index-eeezr5zz.js → index-z1tjp257.js} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -44
- package/dist/{logger-d3wex3dz.js → logger-ewak5q1s.js} +1 -1
- package/dist/{message-index-bounded-7ezbgddp.js → message-index-bounded-h0mrd4pr.js} +13 -13
- package/dist/{message-time-backfill-brbd63hv.js → message-time-backfill-8x06r9kx.js} +2 -2
- package/dist/migration-worker.js +9 -9
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -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-7qzptcw7.js → project-embedding-registry-rtt0djyb.js} +9 -9
- package/dist/raw-ordinal-warmup-worker.js +4 -4
- package/dist/{read-session-chunk-6k83m4fj.js → read-session-chunk-ty89v75e.js} +10 -8
- package/dist/{read-session-raw-3g9qy1xa.js → read-session-raw-8sjbc9h0.js} +5 -3
- package/dist/{recomp-orchestrator-d3fp1cy0.js → recomp-orchestrator-4f1yyd1q.js} +25 -25
- package/dist/{safe-notification-target-5ffqq32m.js → safe-notification-target-q0cyrx3x.js} +2 -2
- package/dist/{search-epax1ecv.js → search-pz4f4wge.js} +20 -20
- package/dist/{send-session-notification-erecz4y4.js → send-session-notification-38cd5dqt.js} +5 -5
- package/dist/shared/auto-search-lifecycle.d.ts +14 -0
- package/dist/shared/auto-search-lifecycle.d.ts.map +1 -1
- package/dist/shared/logger.d.ts.map +1 -1
- package/dist/shared/models-dev-temperature.d.ts +18 -0
- package/dist/shared/models-dev-temperature.d.ts.map +1 -0
- package/dist/shared/project-directory-key.d.ts +16 -0
- package/dist/shared/project-directory-key.d.ts.map +1 -1
- package/dist/shared/subagent-temperature.d.ts +46 -0
- package/dist/shared/subagent-temperature.d.ts.map +1 -0
- package/dist/{storage-tags-d3b0v2ss.js → storage-tags-k0pda32s.js} +6 -4
- package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
- 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-spcy2qre.js → transform-postprocess-phase-tck4g20s.js} +25 -25
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/{context-sf98kstd.js → context-crbt6p1y.js} +809 -1052
- package/dist/v2/{derive-budgets-3vc0y84t.js → derive-budgets-fgej9j46.js} +3 -3
- package/dist/v2/embedding-backfill-ph1qfyn3.js +21 -0
- package/dist/v2/embedding-worker.js +4 -4
- package/dist/v2/hidden-child-native.d.ts.map +1 -1
- package/dist/v2/hidden-completion.d.ts +7 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/dream-trigger.d.ts +4 -1
- package/dist/v2/hooks/dream-trigger.d.ts.map +1 -1
- package/dist/v2/hooks/generate.d.ts +9 -2
- package/dist/v2/hooks/generate.d.ts.map +1 -1
- package/dist/v2/{logger-mxd0ym09.js → logger-pj02s7sr.js} +1 -1
- package/dist/v2/{message-index-bounded-dy3s2k1e.js → message-index-bounded-xwqdywxg.js} +13 -13
- package/dist/v2/{message-time-backfill-gtx1pwk1.js → message-time-backfill-cje68egj.js} +2 -2
- package/dist/v2/migration-worker.js +9 -9
- package/dist/v2/{project-embedding-registry-1tgba5dv.js → project-embedding-registry-d6m7tyxr.js} +9 -9
- package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
- package/dist/v2/{read-session-chunk-rh4khdkv.js → read-session-chunk-8p5mdryx.js} +10 -8
- package/dist/v2/{read-session-raw-bsbmf0vj.js → read-session-raw-j8dvp7f4.js} +5 -3
- package/dist/v2/{recomp-orchestrator-az61rfcg.js → recomp-orchestrator-ckfgt6wq.js} +26 -26
- package/dist/v2/{safe-notification-target-73ax1p5v.js → safe-notification-target-y3p1hce9.js} +2 -2
- package/dist/v2/{search-nzkwrc6n.js → search-ym8rehhz.js} +20 -20
- package/dist/v2/{send-session-notification-6km439kn.js → send-session-notification-5m0yapqx.js} +5 -5
- package/dist/v2/{server-x2g40a71.js → server-19zjmn02.js} +2 -2
- package/dist/v2/{server-sggvvzhb.js → server-1tk82krw.js} +45 -8
- package/dist/v2/{server-vqpf3167.js → server-2s6ayq3t.js} +2 -2
- package/dist/v2/{server-z2037m6z.js → server-2s9qz6n7.js} +2 -2
- package/dist/v2/{server-k228xhjg.js → server-3j4d00kf.js} +1 -1
- package/dist/v2/{server-aan4q8mx.js → server-3t0q2cqx.js} +1 -1
- package/dist/v2/{server-2fbhp79z.js → server-4ez8mntn.js} +16 -8
- package/dist/v2/{server-zxhgvsf9.js → server-676xw7at.js} +1 -1
- package/dist/v2/{server-52awr2mw.js → server-6byqfbqf.js} +93 -9
- package/dist/v2/{server-qye6ykf7.js → server-7ekna9zs.js} +2 -2
- package/dist/v2/{server-g5r0n3b6.js → server-7h861yms.js} +160 -25
- package/dist/v2/{server-v06jcv0w.js → server-8k2agx29.js} +1 -1
- package/dist/v2/{server-686jg6eb.js → server-c5rrgrcd.js} +44 -7
- package/dist/v2/{server-4k748ke6.js → server-hb6xhh9q.js} +2 -2
- package/dist/v2/{server-7wwc2nga.js → server-jvxzm1jy.js} +7 -7
- package/dist/v2/{server-1r6pmz4f.js → server-kzns2hbz.js} +1 -1
- package/dist/v2/{server-xdfwt6kh.js → server-pj4pjv02.js} +2 -2
- package/dist/v2/{server-psqc7e9n.js → server-q4ph9bwn.js} +1227 -78
- package/dist/v2/{server-8pyt7hev.js → server-sa8jvrfc.js} +9 -9
- package/dist/v2/{server-ezhze64f.js → server-ss95ky04.js} +4 -4
- package/dist/v2/{server-5m3dt5r1.js → server-t4k4qexw.js} +6 -2
- package/dist/v2/{server-e0vdaae2.js → server-v4mewb78.js} +4 -4
- package/dist/v2/{server-gjcr4w98.js → server-w32kmdez.js} +4 -4
- package/dist/v2/{server-k8x2rbxc.js → server-x4hscabv.js} +119 -365
- package/dist/v2/{server-yczc713m.js → server-xwz4dqh9.js} +7 -2
- package/dist/v2/{server-xxm59eww.js → server-ycw9qqcy.js} +4 -4
- package/dist/v2/{server-8tqanswc.js → server-zp53y8js.js} +331 -4
- package/dist/v2/server.js +4 -4
- package/dist/v2/{storage-tags-w4tv77sn.js → storage-tags-8vw924zn.js} +6 -4
- package/dist/v2/store-reader.d.ts +8 -2
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/{wrapup-orchestrator-mz7efs7w.js → wrapup-orchestrator-a7efxaax.js} +26 -26
- package/dist/wrapup-orchestrator-barbc6h9.js +44 -0
- package/package.json +1 -1
- package/src/shared/auto-search-lifecycle.ts +43 -0
- package/src/shared/logger.test.ts +38 -0
- package/src/shared/logger.ts +10 -2
- package/src/shared/models-dev-temperature.ts +107 -0
- package/src/shared/project-directory-key.test.ts +59 -0
- package/src/shared/project-directory-key.ts +20 -0
- package/src/shared/subagent-temperature.test.ts +270 -0
- package/src/shared/subagent-temperature.ts +110 -0
- package/dist/embedding-backfill-9rcm1mfy.js +0 -21
- package/dist/v2/embedding-backfill-vn8g1nh1.js +0 -21
- package/dist/wrapup-orchestrator-amzta1t4.js +0 -44
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
TAG_TOMBSTONE_OWNER_PREFIX,
|
|
3
|
+
tagTombstoneOwnerRange,
|
|
4
|
+
tagTombstoneOwnerKey,
|
|
5
|
+
tagRevisionKey,
|
|
6
|
+
tagIdentityRevisionKey,
|
|
2
7
|
deleteTagIdentityRevisions
|
|
3
|
-
} from "./index-
|
|
8
|
+
} from "./index-1bt88epp.js";
|
|
4
9
|
import {
|
|
5
10
|
getHarness2
|
|
6
11
|
} from "./index-pavzsdc6.js";
|
|
@@ -8,29 +13,29 @@ import {
|
|
|
8
13
|
removeSystemReminders,
|
|
9
14
|
hasMeaningfulUserText2,
|
|
10
15
|
extractTexts2
|
|
11
|
-
} from "./index-
|
|
16
|
+
} from "./index-qx53vezw.js";
|
|
12
17
|
import {
|
|
13
18
|
withSqliteBackgroundWriter2,
|
|
14
19
|
withoutSqliteTransformPass2
|
|
15
20
|
} from "./index-kb9nn0a0.js";
|
|
16
21
|
import {
|
|
17
22
|
cleanUserText2
|
|
18
|
-
} from "./index-
|
|
23
|
+
} from "./index-2jgwttpt.js";
|
|
19
24
|
import {
|
|
20
25
|
recordMessageFtsRowid,
|
|
21
26
|
recordIndexedMessageTime,
|
|
22
27
|
messageFtsOrdinalRangeIsMapped,
|
|
23
28
|
deleteUnmappedMessageFtsRows
|
|
24
|
-
} from "./index-
|
|
29
|
+
} from "./index-gzcmtmar.js";
|
|
25
30
|
import {
|
|
26
31
|
deleteChunkEmbedBackoffForSession
|
|
27
|
-
} from "./index-
|
|
32
|
+
} from "./index-b7mv1jx3.js";
|
|
28
33
|
import {
|
|
29
34
|
closeQuietly
|
|
30
35
|
} from "./index-8ajstryz.js";
|
|
31
36
|
import {
|
|
32
37
|
logSlowWriteTransaction
|
|
33
|
-
} from "./index-
|
|
38
|
+
} from "./index-4mjhqadz.js";
|
|
34
39
|
|
|
35
40
|
// src/features/magic-context/session-activity.ts
|
|
36
41
|
var PREFIX = "retrospective_activity:";
|
|
@@ -199,6 +204,17 @@ function deleteSessionScopedRows(db, sessionIds, harness, options = {}) {
|
|
|
199
204
|
if (deletableSessionIds.length === 0)
|
|
200
205
|
return 0;
|
|
201
206
|
const placeholders = deletableSessionIds.map(() => "?").join(", ");
|
|
207
|
+
const harnessTables = SESSION_SCOPED_TABLES.filter((definition) => definition.harnessScoped);
|
|
208
|
+
if (options.preserveTagRevisionTombstones) {
|
|
209
|
+
const owners = db.prepare(harnessTables.map((definition) => `SELECT session_id, harness FROM ${definition.table} WHERE session_id IN (${placeholders})${definition.extraPredicate ? ` AND ${definition.extraPredicate}` : ""}`).join(" UNION ")).all(...harnessTables.flatMap(() => deletableSessionIds));
|
|
210
|
+
const record = db.prepare("INSERT OR IGNORE INTO schema_migrations_meta (key, value) VALUES (?, ?)");
|
|
211
|
+
for (const owner of owners)
|
|
212
|
+
record.run(tagTombstoneOwnerKey(owner.session_id, owner.harness), owner.harness);
|
|
213
|
+
const fallback = db.prepare(`INSERT INTO schema_migrations_meta (key, value)
|
|
214
|
+
SELECT ?, ? WHERE NOT EXISTS (SELECT 1 FROM schema_migrations_meta WHERE key >= ? AND key < ?)`);
|
|
215
|
+
for (const id of deletableSessionIds)
|
|
216
|
+
fallback.run(tagTombstoneOwnerKey(id, getHarness2()), getHarness2(), ...tagTombstoneOwnerRange(id));
|
|
217
|
+
}
|
|
202
218
|
for (const sessionId of deletableSessionIds)
|
|
203
219
|
deleteChunkEmbedBackoffForSession(db, sessionId);
|
|
204
220
|
for (const definition of SESSION_SCOPED_TABLES) {
|
|
@@ -225,6 +241,20 @@ function deleteSessionScopedRows(db, sessionIds, harness, options = {}) {
|
|
|
225
241
|
statement.run(...deletableSessionIds);
|
|
226
242
|
}
|
|
227
243
|
deleteSessionActivity(db, deletableSessionIds);
|
|
244
|
+
if (!options.preserveTagRevisionTombstones) {
|
|
245
|
+
const retireOwner = db.prepare(harness === undefined ? "DELETE FROM schema_migrations_meta WHERE key >= ? AND key < ?" : "DELETE FROM schema_migrations_meta WHERE key = ?");
|
|
246
|
+
const survivingRows = harnessTables.map((definition) => `EXISTS (SELECT 1 FROM ${definition.table} WHERE session_id = ?${definition.extraPredicate ? ` AND ${definition.extraPredicate}` : ""})`).join(" OR ");
|
|
247
|
+
const retire = db.prepare(`DELETE FROM schema_migrations_meta WHERE key IN (?, ?)
|
|
248
|
+
AND NOT (${survivingRows})
|
|
249
|
+
AND NOT EXISTS (SELECT 1 FROM schema_migrations_meta AS owners WHERE owners.key >= ? AND owners.key < ?)`);
|
|
250
|
+
for (const id of deletableSessionIds) {
|
|
251
|
+
if (harness === undefined)
|
|
252
|
+
retireOwner.run(...tagTombstoneOwnerRange(id));
|
|
253
|
+
else
|
|
254
|
+
retireOwner.run(tagTombstoneOwnerKey(id, harness));
|
|
255
|
+
retire.run(tagIdentityRevisionKey(id), tagRevisionKey(id), ...harnessTables.map(() => id), ...tagTombstoneOwnerRange(id));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
228
258
|
return deletableSessionIds.length;
|
|
229
259
|
}
|
|
230
260
|
|
|
@@ -710,12 +740,19 @@ function persistMessageHistoryOrphanSweepState(db, cursor, lastSweptAt, harness)
|
|
|
710
740
|
last_swept_at = excluded.last_swept_at`).run(harness, cursor, lastSweptAt);
|
|
711
741
|
}
|
|
712
742
|
function getOpenCodeSessionScopedCandidateSourceSql(harness) {
|
|
713
|
-
|
|
743
|
+
const sources = SESSION_SCOPED_TABLES.filter((definition) => definition.harnessScoped === true).map((definition) => {
|
|
714
744
|
const predicates = ["session_id IS NOT NULL", `harness = '${harness}'`];
|
|
715
745
|
if (definition.extraPredicate)
|
|
716
746
|
predicates.push(definition.extraPredicate);
|
|
717
747
|
return `SELECT session_id FROM ${definition.table} WHERE ${predicates.join(" AND ")}`;
|
|
718
|
-
})
|
|
748
|
+
});
|
|
749
|
+
const jsonId = `SUBSTR(key, ${TAG_TOMBSTONE_OWNER_PREFIX.length + 1}, LENGTH(key) - ${TAG_TOMBSTONE_OWNER_PREFIX.length + harness.length + 1})`;
|
|
750
|
+
sources.push(`SELECT CASE WHEN json_valid(${jsonId}) THEN
|
|
751
|
+
CASE WHEN json_type(${jsonId}) = 'text' THEN json_extract(${jsonId}, '$') END END AS session_id
|
|
752
|
+
FROM schema_migrations_meta WHERE value = '${harness}'
|
|
753
|
+
AND key >= '${TAG_TOMBSTONE_OWNER_PREFIX}' AND key < '${TAG_TOMBSTONE_OWNER_PREFIX.slice(0, -1)};'
|
|
754
|
+
AND SUBSTR(key, -${harness.length + 1}) = ':${harness}'`);
|
|
755
|
+
return sources.join(`
|
|
719
756
|
UNION
|
|
720
757
|
`);
|
|
721
758
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sanitizeDiagnosticText,
|
|
3
|
+
sessionLog2
|
|
4
|
+
} from "./index-nsjyysj0.js";
|
|
1
5
|
import {
|
|
2
6
|
getHarness2
|
|
3
7
|
} from "./index-pavzsdc6.js";
|
|
@@ -8,15 +12,12 @@ import {
|
|
|
8
12
|
PROMOTABLE_CATEGORIES,
|
|
9
13
|
CATEGORY_DEFAULT_TTL
|
|
10
14
|
} from "./index-fr0wbhdn.js";
|
|
11
|
-
import {
|
|
12
|
-
sessionLog2
|
|
13
|
-
} from "./index-8j7gqj40.js";
|
|
14
15
|
import {
|
|
15
16
|
managedAuthorityNoteRow
|
|
16
|
-
} from "./index-
|
|
17
|
+
} from "./index-nm6a8xpd.js";
|
|
17
18
|
import {
|
|
18
19
|
embedTextForProject2
|
|
19
|
-
} from "./index-
|
|
20
|
+
} from "./index-kp5qe690.js";
|
|
20
21
|
import {
|
|
21
22
|
saveEmbeddingIfHashMatches
|
|
22
23
|
} from "./index-4dhv7mqz.js";
|
|
@@ -34,6 +35,335 @@ import {
|
|
|
34
35
|
computeNormalizedHash
|
|
35
36
|
} from "./index-2bvekkfy.js";
|
|
36
37
|
|
|
38
|
+
// src/shared/user-facing-codes.ts
|
|
39
|
+
var USER_FACING_FAILURES = {
|
|
40
|
+
historian_unavailable: {
|
|
41
|
+
code: "MC-H01",
|
|
42
|
+
sentence: "History compression could not finish this turn.",
|
|
43
|
+
action: "It will retry automatically."
|
|
44
|
+
},
|
|
45
|
+
historian_saved_history_misaligned: {
|
|
46
|
+
code: "MC-H03",
|
|
47
|
+
sentence: "History compression is paused because this session's saved summaries no longer line up with its messages.",
|
|
48
|
+
action: "Run /ctx-recomp to rebuild them."
|
|
49
|
+
},
|
|
50
|
+
history_boundary_unresolved: {
|
|
51
|
+
code: "MC-H04",
|
|
52
|
+
sentence: "This request was not sent: the message that marks where this session's history summary ends is missing from the OpenCode store, and without it the request is larger than the model's context window.",
|
|
53
|
+
action: "Run /ctx-recomp to rebuild the history summary."
|
|
54
|
+
},
|
|
55
|
+
history_over_window_unmanaged: {
|
|
56
|
+
code: "MC-H06",
|
|
57
|
+
sentence: "This request was not sent: this session's history is larger than the model's context window, and Magic Context does not have a summary of it yet to send in its place.",
|
|
58
|
+
action: "Send your message again once history compression has caught up, or switch to a model with a larger context window."
|
|
59
|
+
},
|
|
60
|
+
frozen_history_over_window: {
|
|
61
|
+
code: "MC-H07",
|
|
62
|
+
sentence: "This request was not sent: the conversation is larger than the context window the provider reported, and the compressed history Magic Context has ready does not fit either.",
|
|
63
|
+
action: "Run /ctx-flush to compress it now, then send your message again."
|
|
64
|
+
},
|
|
65
|
+
historian_window_too_small: {
|
|
66
|
+
code: "MC-H05",
|
|
67
|
+
sentence: "History compression is paused because the history model's context window is too small for its instructions.",
|
|
68
|
+
action: "Set historian.model in magic-context.jsonc to a model with a larger context window."
|
|
69
|
+
},
|
|
70
|
+
recomp_unavailable: {
|
|
71
|
+
code: "MC-R01",
|
|
72
|
+
sentence: "History compression could not be rebuilt.",
|
|
73
|
+
action: "Run /ctx-recomp again."
|
|
74
|
+
},
|
|
75
|
+
dream_provider_timeout: {
|
|
76
|
+
code: "MC-D01",
|
|
77
|
+
sentence: "Memory maintenance took too long to respond.",
|
|
78
|
+
action: "Run /ctx-dream again."
|
|
79
|
+
},
|
|
80
|
+
dream_provider_error: {
|
|
81
|
+
code: "MC-D02",
|
|
82
|
+
sentence: "Memory maintenance could not reach its model.",
|
|
83
|
+
action: "Check the model connection, then run /ctx-dream again."
|
|
84
|
+
},
|
|
85
|
+
dream_local_refusal: {
|
|
86
|
+
code: "MC-D12",
|
|
87
|
+
sentence: "Memory maintenance was refused before reaching the model.",
|
|
88
|
+
action: "Check the hidden-request diagnostic in the Magic Context log before retrying."
|
|
89
|
+
},
|
|
90
|
+
dream_step_limit: {
|
|
91
|
+
code: "MC-D10",
|
|
92
|
+
sentence: "Memory maintenance stopped at its hidden agent step limit.",
|
|
93
|
+
action: "This task needs less work per run; changing the model connection will not help."
|
|
94
|
+
},
|
|
95
|
+
dream_token_budget: {
|
|
96
|
+
code: "MC-D11",
|
|
97
|
+
sentence: "Memory maintenance reached its prompt-token budget.",
|
|
98
|
+
action: "The unfinished items will be retried on the next run."
|
|
99
|
+
},
|
|
100
|
+
dream_empty_completion: {
|
|
101
|
+
code: "MC-D03",
|
|
102
|
+
sentence: "Memory maintenance received no usable response.",
|
|
103
|
+
action: "Run /ctx-dream again."
|
|
104
|
+
},
|
|
105
|
+
dream_no_models: {
|
|
106
|
+
code: "MC-D04",
|
|
107
|
+
sentence: "Memory maintenance has no model available.",
|
|
108
|
+
action: "Check the model settings, then run /ctx-dream again."
|
|
109
|
+
},
|
|
110
|
+
dream_child_aborted: {
|
|
111
|
+
code: "MC-D05",
|
|
112
|
+
sentence: "Memory maintenance was interrupted.",
|
|
113
|
+
action: "Run /ctx-dream again."
|
|
114
|
+
},
|
|
115
|
+
dream_parse_failed: {
|
|
116
|
+
code: "MC-D06",
|
|
117
|
+
sentence: "Memory maintenance could not use the model response.",
|
|
118
|
+
action: "Run /ctx-dream again."
|
|
119
|
+
},
|
|
120
|
+
dream_unknown: {
|
|
121
|
+
code: "MC-D07",
|
|
122
|
+
sentence: "Memory maintenance could not finish.",
|
|
123
|
+
action: "Run /ctx-dream again."
|
|
124
|
+
},
|
|
125
|
+
dreamer_tick_blocked: {
|
|
126
|
+
code: "MC-D09",
|
|
127
|
+
sentence: "Background maintenance is not running: its last pass stopped before it reached the scheduled tasks.",
|
|
128
|
+
action: "It is retried automatically; if it keeps happening, check the Magic Context log for the stage that stopped and run `npx @cortexkit/magic-context doctor`."
|
|
129
|
+
},
|
|
130
|
+
dream_task_needs_tool_loop: {
|
|
131
|
+
code: "MC-D08",
|
|
132
|
+
sentence: "Some memory maintenance tasks need a tool loop this host does not provide.",
|
|
133
|
+
action: "The remaining tasks still run; the listed ones are skipped on this host."
|
|
134
|
+
},
|
|
135
|
+
embedding_substitution_rejected: {
|
|
136
|
+
code: "MC-E01",
|
|
137
|
+
sentence: "Search indexing could not use the selected model.",
|
|
138
|
+
action: "Check the embedding model setting, then run /ctx-embed start again."
|
|
139
|
+
},
|
|
140
|
+
embedding_http_error: {
|
|
141
|
+
code: "MC-E02",
|
|
142
|
+
sentence: "The search indexing provider refused the request.",
|
|
143
|
+
action: "Check the provider connection and credentials, then run /ctx-embed start again."
|
|
144
|
+
},
|
|
145
|
+
embedding_transport_error: {
|
|
146
|
+
code: "MC-E03",
|
|
147
|
+
sentence: "Search indexing could not reach its provider.",
|
|
148
|
+
action: "Check the connection, then run /ctx-embed start again."
|
|
149
|
+
},
|
|
150
|
+
embedding_invalid_envelope: {
|
|
151
|
+
code: "MC-E04",
|
|
152
|
+
sentence: "Search indexing received an unsupported response.",
|
|
153
|
+
action: "Check the embedding endpoint, then run /ctx-embed start again."
|
|
154
|
+
},
|
|
155
|
+
embedding_empty_result: {
|
|
156
|
+
code: "MC-E05",
|
|
157
|
+
sentence: "Search indexing received no usable result.",
|
|
158
|
+
action: "Run /ctx-embed start again."
|
|
159
|
+
},
|
|
160
|
+
embedding_certification_refusal: {
|
|
161
|
+
code: "MC-E06",
|
|
162
|
+
sentence: "Search indexing is not ready for this provider.",
|
|
163
|
+
action: "Finish the provider setup, or set a fallback provider in the embedding settings, then run /ctx-embed start again."
|
|
164
|
+
},
|
|
165
|
+
embedding_credential_required: {
|
|
166
|
+
code: "MC-E07",
|
|
167
|
+
sentence: "Search indexing needs provider credentials.",
|
|
168
|
+
action: "Sign in to the provider, then run /ctx-embed start again."
|
|
169
|
+
},
|
|
170
|
+
embedding_local_binding_missing: {
|
|
171
|
+
code: "MC-E08",
|
|
172
|
+
sentence: "Local search indexing is unavailable on this system.",
|
|
173
|
+
action: "Run `npx @cortexkit/magic-context doctor`, then retry."
|
|
174
|
+
},
|
|
175
|
+
embedding_local_fs_unavailable: {
|
|
176
|
+
code: "MC-E09",
|
|
177
|
+
sentence: "Local search indexing cannot save its model files.",
|
|
178
|
+
action: "Update or reinstall Magic Context, then retry."
|
|
179
|
+
},
|
|
180
|
+
embedding_local_download_failure: {
|
|
181
|
+
code: "MC-E10",
|
|
182
|
+
sentence: "Local search indexing could not download its model.",
|
|
183
|
+
action: "Check the network connection, then retry."
|
|
184
|
+
},
|
|
185
|
+
embedding_local_runtime_error: {
|
|
186
|
+
code: "MC-E11",
|
|
187
|
+
sentence: "Local search indexing could not start.",
|
|
188
|
+
action: "Run `npx @cortexkit/magic-context doctor`, then retry."
|
|
189
|
+
},
|
|
190
|
+
embedding_unavailable: {
|
|
191
|
+
code: "MC-E12",
|
|
192
|
+
sentence: "Search indexing could not finish.",
|
|
193
|
+
action: "Run /ctx-embed start again."
|
|
194
|
+
},
|
|
195
|
+
status_unavailable: {
|
|
196
|
+
code: "MC-S01",
|
|
197
|
+
sentence: "Magic Context status is temporarily unavailable.",
|
|
198
|
+
action: "Retry /ctx-status in a moment."
|
|
199
|
+
},
|
|
200
|
+
transform_update_failed: {
|
|
201
|
+
code: "MC-S02",
|
|
202
|
+
sentence: "The last context update did not finish.",
|
|
203
|
+
action: "Send another message to retry."
|
|
204
|
+
},
|
|
205
|
+
transform_pass_degraded: {
|
|
206
|
+
code: "MC-S06",
|
|
207
|
+
sentence: "This request was not sent: Magic Context could not finish preparing it, and without that preparation it could be far larger than the previous request.",
|
|
208
|
+
action: "Send your message again."
|
|
209
|
+
},
|
|
210
|
+
configuration_warning: {
|
|
211
|
+
code: "MC-S03",
|
|
212
|
+
sentence: "Some configuration settings could not be applied.",
|
|
213
|
+
action: "Fix the configuration warning shown in /ctx-status, then restart."
|
|
214
|
+
},
|
|
215
|
+
status_log_unavailable: {
|
|
216
|
+
code: "MC-S04",
|
|
217
|
+
sentence: "Some diagnostic details could not be saved.",
|
|
218
|
+
action: "Retry /ctx-status in a moment."
|
|
219
|
+
},
|
|
220
|
+
memory_writes_paused: {
|
|
221
|
+
code: "MC-C01",
|
|
222
|
+
sentence: "Memory writes are paused while the engine syncs.",
|
|
223
|
+
action: "Retry in a moment."
|
|
224
|
+
},
|
|
225
|
+
memory_access_unavailable: {
|
|
226
|
+
code: "MC-C02",
|
|
227
|
+
sentence: "Memory access is temporarily unavailable.",
|
|
228
|
+
action: "Retry in a moment."
|
|
229
|
+
},
|
|
230
|
+
note_changes_paused: {
|
|
231
|
+
code: "MC-C03",
|
|
232
|
+
sentence: "Note changes are paused while the engine syncs.",
|
|
233
|
+
action: "Retry in a moment."
|
|
234
|
+
},
|
|
235
|
+
note_access_unavailable: {
|
|
236
|
+
code: "MC-C04",
|
|
237
|
+
sentence: "Notes are temporarily unavailable.",
|
|
238
|
+
action: "Retry in a moment."
|
|
239
|
+
},
|
|
240
|
+
context_cleanup_paused: {
|
|
241
|
+
code: "MC-C05",
|
|
242
|
+
sentence: "Context cleanup is paused while the engine syncs.",
|
|
243
|
+
action: "Retry in a moment."
|
|
244
|
+
},
|
|
245
|
+
partial_history_unavailable: {
|
|
246
|
+
code: "MC-C06",
|
|
247
|
+
sentence: "Partial history compression is not available in the current mode.",
|
|
248
|
+
action: "Run /ctx-recomp without a range."
|
|
249
|
+
},
|
|
250
|
+
smart_note_conditions_unavailable: {
|
|
251
|
+
code: "MC-C08",
|
|
252
|
+
sentence: "Conditional notes are not available in the current mode.",
|
|
253
|
+
action: "Save a regular note without a condition."
|
|
254
|
+
},
|
|
255
|
+
history_compression_paused: {
|
|
256
|
+
code: "MC-C09",
|
|
257
|
+
sentence: "History compression is paused while the engine syncs.",
|
|
258
|
+
action: "Retry in a moment."
|
|
259
|
+
},
|
|
260
|
+
history_compression_needs_message: {
|
|
261
|
+
code: "MC-C12",
|
|
262
|
+
sentence: "History compression has not seen this session since Magic Context reconnected.",
|
|
263
|
+
action: "Send a message in this session first, then run /ctx-wrapup again."
|
|
264
|
+
},
|
|
265
|
+
context_service_unavailable: {
|
|
266
|
+
code: "MC-C10",
|
|
267
|
+
sentence: "Magic Context is temporarily unavailable.",
|
|
268
|
+
action: "Retry in a moment."
|
|
269
|
+
},
|
|
270
|
+
context_db_missing: {
|
|
271
|
+
code: "MC-C15",
|
|
272
|
+
sentence: "Magic Context has no context.db.",
|
|
273
|
+
action: "Run `npx @cortexkit/magic-context doctor store init`, then restart ck-mc."
|
|
274
|
+
},
|
|
275
|
+
single_store_migration_required: {
|
|
276
|
+
code: "MC-C14",
|
|
277
|
+
sentence: "Magic Context's Rust mode needs a one-time migration of its store.",
|
|
278
|
+
action: "Quit OpenCode and every ck-mc process, then run `magic-context doctor single-store migrate`."
|
|
279
|
+
},
|
|
280
|
+
store_ahead_of_binary: {
|
|
281
|
+
code: "MC-C13",
|
|
282
|
+
sentence: "Magic Context refused to start: its store (store.db) was migrated by a newer ck-mc build than the one running.",
|
|
283
|
+
action: "Update ck-mc, or roll back by restoring ck-mc together with context.db and store.db from the same backup."
|
|
284
|
+
},
|
|
285
|
+
compaction_marker_missing: {
|
|
286
|
+
code: "MC-C11",
|
|
287
|
+
sentence: "The history boundary marker is missing from the OpenCode store, so requests carry the full session.",
|
|
288
|
+
action: "It is retried on every message; if this persists, run `/ctx-flush`."
|
|
289
|
+
},
|
|
290
|
+
memory_mirror_stalled: {
|
|
291
|
+
code: "MC-M01",
|
|
292
|
+
sentence: "Memory synchronization stopped before the host mirror caught up.",
|
|
293
|
+
action: "Send another message to resume it, or run `ck doctor drain-authority`."
|
|
294
|
+
},
|
|
295
|
+
memory_authority_mismatch: {
|
|
296
|
+
code: "MC-M02",
|
|
297
|
+
sentence: "Memory authority is inconsistent between the host and module.",
|
|
298
|
+
action: "Run `ck doctor drain-authority` before changing Rust mode."
|
|
299
|
+
},
|
|
300
|
+
dreamer_task_failing: {
|
|
301
|
+
code: "MC-S05",
|
|
302
|
+
sentence: "A background maintenance task keeps failing on its schedule.",
|
|
303
|
+
action: "Check the Magic Context log for the failing task and its error."
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
function renderUserFacingFailure(key, style = "markdown") {
|
|
307
|
+
const failure = USER_FACING_FAILURES[key];
|
|
308
|
+
const action = style === "plain" ? failure.action.replaceAll("`", "") : failure.action;
|
|
309
|
+
return `${failure.sentence} ${action} (${failure.code})`;
|
|
310
|
+
}
|
|
311
|
+
function userFacingFailureCode(key) {
|
|
312
|
+
return USER_FACING_FAILURES[key].code;
|
|
313
|
+
}
|
|
314
|
+
var CAPABILITY_FAILURES = {
|
|
315
|
+
memory_write: "memory_writes_paused",
|
|
316
|
+
memory_access: "memory_access_unavailable",
|
|
317
|
+
note_change: "note_changes_paused",
|
|
318
|
+
note_access: "note_access_unavailable",
|
|
319
|
+
context_cleanup: "context_cleanup_paused",
|
|
320
|
+
partial_history: "partial_history_unavailable",
|
|
321
|
+
smart_note_condition: "smart_note_conditions_unavailable",
|
|
322
|
+
history_compression: "history_compression_paused",
|
|
323
|
+
context_service: "context_service_unavailable"
|
|
324
|
+
};
|
|
325
|
+
function renderCapabilityRefusal(capability) {
|
|
326
|
+
return renderUserFacingFailure(CAPABILITY_FAILURES[capability]);
|
|
327
|
+
}
|
|
328
|
+
function capabilityRefusalCode(capability) {
|
|
329
|
+
return userFacingFailureCode(CAPABILITY_FAILURES[capability]);
|
|
330
|
+
}
|
|
331
|
+
var DREAM_FAILURE_KEYS = {
|
|
332
|
+
provider_timeout: "dream_provider_timeout",
|
|
333
|
+
provider_error: "dream_provider_error",
|
|
334
|
+
local_refusal: "dream_local_refusal",
|
|
335
|
+
step_limit: "dream_step_limit",
|
|
336
|
+
token_budget: "dream_token_budget",
|
|
337
|
+
empty_completion: "dream_empty_completion",
|
|
338
|
+
no_models: "dream_no_models",
|
|
339
|
+
child_aborted: "dream_child_aborted",
|
|
340
|
+
parse_failed: "dream_parse_failed",
|
|
341
|
+
unknown: "dream_unknown"
|
|
342
|
+
};
|
|
343
|
+
var EMBEDDING_FAILURE_KEYS = {
|
|
344
|
+
substitution_rejected: "embedding_substitution_rejected",
|
|
345
|
+
http_error: "embedding_http_error",
|
|
346
|
+
transport_error: "embedding_transport_error",
|
|
347
|
+
invalid_envelope: "embedding_invalid_envelope",
|
|
348
|
+
empty_result: "embedding_empty_result",
|
|
349
|
+
certification_refusal: "embedding_certification_refusal",
|
|
350
|
+
credential_required: "embedding_credential_required",
|
|
351
|
+
local_binding_missing: "embedding_local_binding_missing",
|
|
352
|
+
local_fs_unavailable: "embedding_local_fs_unavailable",
|
|
353
|
+
local_download_failure: "embedding_local_download_failure",
|
|
354
|
+
local_runtime_error: "embedding_local_runtime_error"
|
|
355
|
+
};
|
|
356
|
+
function renderDreamFailure(failureClass, style = "markdown", refusalReason) {
|
|
357
|
+
const rendered = renderUserFacingFailure(DREAM_FAILURE_KEYS[failureClass], style);
|
|
358
|
+
return failureClass === "local_refusal" && refusalReason ? `${rendered} Reason: ${sanitizeDiagnosticText(refusalReason).slice(0, 500)}` : rendered;
|
|
359
|
+
}
|
|
360
|
+
function dreamFailureCode(failureClass) {
|
|
361
|
+
return userFacingFailureCode(DREAM_FAILURE_KEYS[failureClass]);
|
|
362
|
+
}
|
|
363
|
+
function renderEmbeddingFailure(failureClass, style = "markdown") {
|
|
364
|
+
return renderUserFacingFailure(EMBEDDING_FAILURE_KEYS[failureClass], style);
|
|
365
|
+
}
|
|
366
|
+
|
|
37
367
|
// src/features/magic-context/storage-notes.ts
|
|
38
368
|
var NOTE_TYPES = new Set(["session", "smart"]);
|
|
39
369
|
var NOTE_STATUSES = new Set(["active", "pending", "ready", "dismissed"]);
|
|
@@ -981,4 +1311,4 @@ async function normalizeVerificationFiles(args) {
|
|
|
981
1311
|
gitRoot
|
|
982
1312
|
};
|
|
983
1313
|
}
|
|
984
|
-
export { SESSION_NOTE_CONDITION_ERROR, getNoteByIdInScope, getNotes, addNote, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, updateNote, dismissNotes, dismissNote, markNoteReady, markNoteChecked, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, insertPrimerCandidates, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, promoteSessionFactsDurable, embedPromotedFacts, relaxedFtsQuery, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles };
|
|
1314
|
+
export { USER_FACING_FAILURES, renderUserFacingFailure, userFacingFailureCode, renderCapabilityRefusal, capabilityRefusalCode, renderDreamFailure, dreamFailureCode, renderEmbeddingFailure, SESSION_NOTE_CONDITION_ERROR, getNoteByIdInScope, getNotes, addNote, getSessionNotes, getPendingSmartNotes, getReadySmartNotes, updateNote, dismissNotes, dismissNote, markNoteReady, markNoteChecked, PRIMER_CANDIDATE_TTL_MS, PRIMER_CANDIDATE_MAX_AGE_MS, primerOccurrenceKey, primerOccurrenceUtcDay, insertPrimerCandidates, updatePrimerCandidateEmbedding, getPrimerCandidatesByIds, getPrimerCandidatesForPromotion, countPrimerCandidatesForProject, getActivePrimers, createPrimer, updatePrimerSupport, updatePrimerAnswer, promoteSessionFactsDurable, embedPromotedFacts, relaxedFtsQuery, sanitizeFtsQuery, searchMemoriesFTS, searchMemoriesFTSUnion, recordMemoryMapping, recordMemoryVerifications, getUnmappedMemoryIds, clearMemoryVerifications, getMemoryVerifications, resolveGitTopLevel, readGitHead, readGitChangedFilesSince, readGitFileChangeTimesSince, verificationFileExists, normalizeVerificationFiles };
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
sanitizeDiagnosticText,
|
|
6
6
|
log2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-nsjyysj0.js";
|
|
8
8
|
import {
|
|
9
9
|
isUserHomeDirectory,
|
|
10
10
|
setBootQuietPeriodForTests
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-pxwp2hjk.js";
|
|
12
12
|
import {
|
|
13
13
|
estimateTokens
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-qx53vezw.js";
|
|
15
15
|
import {
|
|
16
16
|
SYNAPSE_DEFAULT_MODEL,
|
|
17
17
|
isSynapseEmbeddingTruncated,
|
|
18
18
|
getSynapseBatchRequestKey,
|
|
19
19
|
SynapseEmbeddingProvider
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-vkbqdnkj.js";
|
|
21
21
|
import {
|
|
22
22
|
withSqliteBackgroundWriter2,
|
|
23
23
|
withoutSqliteTransformPass2,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
countSessionCompartmentEmbedCoverage,
|
|
40
40
|
countSessionCompartmentEmbedCoveragePolite,
|
|
41
41
|
countUnembeddedSessionCompartmentsPolite
|
|
42
|
-
} from "./index-
|
|
42
|
+
} from "./index-b7mv1jx3.js";
|
|
43
43
|
import {
|
|
44
44
|
DEFAULT_LOCAL_EMBEDDING_MODEL,
|
|
45
45
|
embeddingModelsMatch,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
getEmbeddingProviderIdentity,
|
|
48
48
|
dominantEmbeddingFailure,
|
|
49
49
|
LocalEmbeddingProvider
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-kq57tdf0.js";
|
|
51
51
|
import {
|
|
52
52
|
isEmbeddingHostBusy2
|
|
53
53
|
} from "./index-qt1qqasc.js";
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
} from "./index-4dhv7mqz.js";
|
|
59
59
|
import {
|
|
60
60
|
logSlowWriteTransaction
|
|
61
|
-
} from "./index-
|
|
61
|
+
} from "./index-4mjhqadz.js";
|
|
62
62
|
|
|
63
63
|
// src/features/magic-context/session-project-storage.ts
|
|
64
64
|
var SESSION_CHUNK_REPAIR_BATCH_SIZE = 100;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./index-mfkzp7qj.js";
|
|
4
4
|
import {
|
|
5
5
|
getSynapseLaneIdentity
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-vkbqdnkj.js";
|
|
7
7
|
import {
|
|
8
8
|
getHarness2
|
|
9
9
|
} from "./index-pavzsdc6.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
importPluginModule,
|
|
15
15
|
log2
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-nsjyysj0.js";
|
|
17
17
|
import {
|
|
18
18
|
computeNormalizedHash
|
|
19
19
|
} from "./index-2bvekkfy.js";
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./index-fr0wbhdn.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-nsjyysj0.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureColumn,
|
|
9
9
|
healAllNullColumns,
|
|
10
10
|
installV95PerfSchema
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-1bt88epp.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveOpenCodeDbPath,
|
|
14
14
|
openCodeDbPathExists,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
normalizeStoredProjectPath,
|
|
22
22
|
storedPathBelongsToIdentity
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-pxwp2hjk.js";
|
|
24
24
|
import {
|
|
25
25
|
logSlowWriteTransaction
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-4mjhqadz.js";
|
|
27
27
|
|
|
28
28
|
// src/features/magic-context/lkg-prefix-chunks.ts
|
|
29
29
|
import { createHash } from "node:crypto";
|
|
@@ -458,8 +458,12 @@ function flush() {
|
|
|
458
458
|
let currentSize = getCurrentLogSize(logFile);
|
|
459
459
|
const dataSize = Buffer.byteLength(data);
|
|
460
460
|
if (currentSize > 0 && currentSize + dataSize > MAX_LOG_FILE_BYTES) {
|
|
461
|
-
|
|
462
|
-
currentSize =
|
|
461
|
+
flushesSinceSizeCheck = SIZE_CHECK_INTERVAL_FLUSHES;
|
|
462
|
+
currentSize = getCurrentLogSize(logFile);
|
|
463
|
+
if (currentSize > 0 && currentSize + dataSize > MAX_LOG_FILE_BYTES) {
|
|
464
|
+
rotateLogFile(logFile, currentSize);
|
|
465
|
+
currentSize = 0;
|
|
466
|
+
}
|
|
463
467
|
}
|
|
464
468
|
fs.appendFileSync(logFile, data, { encoding: "utf8", mode: 384 });
|
|
465
469
|
buffer = [];
|