@cortexkit/opencode-magic-context 0.49.75 → 0.49.77
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/chunk-embedding-write-worker.js +1 -1
- package/dist/{context-966c0vdq.js → context-8zhjv9tj.js} +93 -69
- package/dist/{embedding-backfill-exnyad7d.js → embedding-backfill-rrmzvg7n.js} +2 -2
- package/dist/features/magic-context/compartment-storage.d.ts +3 -1
- package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/docs-proposals.d.ts.map +1 -1
- package/dist/features/magic-context/memory/embedding-backfill.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/hooks/magic-context/inject-compartments.d.ts +2 -0
- package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
- package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/{index-q9ywd8b2.js → index-16h5fhem.js} +13 -2
- package/dist/{index-ztjgymb9.js → index-1pfjvk89.js} +8 -8
- package/dist/{index-6qqc8ef2.js → index-5jtq51xv.js} +19 -21
- package/dist/{index-jeckjrh0.js → index-72qk8fs8.js} +5 -5
- package/dist/{index-cpmqvc1c.js → index-7jj5jk78.js} +4 -4
- package/dist/{index-yhz1w3ss.js → index-8mt6vvwx.js} +2 -1
- package/dist/{index-ypm4aa3h.js → index-bw3pmrtk.js} +3 -3
- package/dist/{index-k2rk6z1y.js → index-dcdk1thy.js} +13 -7
- package/dist/{index-ve863q40.js → index-jfs6k0xk.js} +1 -1
- package/dist/{index-zt6d9fag.js → index-k6b1av2m.js} +1 -1
- package/dist/{index-3mx8math.js → index-kn23xzst.js} +1 -1
- package/dist/{index-xha0yxhy.js → index-r865s8hf.js} +1 -1
- package/dist/{index-ne2awfqp.js → index-rjm4hjyb.js} +7 -1
- package/dist/{index-238xbkhk.js → index-swfwxev1.js} +2 -2
- package/dist/{index-etm62gd7.js → index-vr6t0y4w.js} +1 -1
- package/dist/{index-h2w3kzkt.js → index-xkn7vq89.js} +3 -3
- package/dist/{index-9swgykdd.js → index-yfn52pb6.js} +12 -1
- package/dist/index.js +20 -20
- package/dist/{message-index-bounded-vf70t44t.js → message-index-bounded-s0bckzqz.js} +2 -2
- package/dist/migration-worker.js +1 -1
- package/dist/{project-embedding-registry-n50fbax6.js → project-embedding-registry-sw4z2ptg.js} +6 -2
- package/dist/raw-ordinal-warmup-worker.js +3 -3
- package/dist/{read-session-chunk-9jtq1swq.js → read-session-chunk-kqyb1y8c.js} +1 -1
- package/dist/{recomp-orchestrator-z0m2vgbe.js → recomp-orchestrator-38ed4yhj.js} +9 -9
- package/dist/{render-rf6dmb9v.js → render-8s531gd5.js} +5 -5
- package/dist/{search-archive-myb6n35b.js → search-archive-4vcfm0wv.js} +3 -3
- package/dist/{search-0v2v9yd5.js → search-m4r4v4aw.js} +7 -7
- package/dist/{transform-postprocess-phase-r6t8m6qq.js → transform-postprocess-phase-ch5fsw7h.js} +10 -10
- package/dist/v2/auto-search-worker.js +3 -3
- package/dist/v2/chunk-embedding-write-worker.js +1 -1
- package/dist/v2/{context-f4v3ptyh.js → context-9nm9edea.js} +95 -73
- package/dist/v2/{embedding-backfill-jhmn81cz.js → embedding-backfill-g9scycm5.js} +2 -2
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/generate.d.ts +1 -1
- package/dist/v2/hooks/generate.d.ts.map +1 -1
- package/dist/v2/hooks/payload.d.ts +1 -1
- package/dist/v2/hooks/payload.d.ts.map +1 -1
- package/dist/v2/{message-index-bounded-ev9sarf6.js → message-index-bounded-vfx2zx9y.js} +2 -2
- package/dist/v2/migration-worker.js +1 -1
- package/dist/v2/{project-embedding-registry-07nz4qas.js → project-embedding-registry-52f2jept.js} +6 -2
- package/dist/v2/raw-ordinal-warmup-worker.js +3 -3
- package/dist/v2/{read-session-chunk-eb49qfzz.js → read-session-chunk-bh402br0.js} +1 -1
- package/dist/v2/{recomp-orchestrator-14bek576.js → recomp-orchestrator-43grkr1k.js} +8 -8
- package/dist/v2/{render-rw6tk2fj.js → render-90pve6jf.js} +5 -5
- package/dist/v2/{search-archive-w33x2z9z.js → search-archive-9sx7fn3t.js} +3 -3
- package/dist/v2/{search-03pzsd5w.js → search-xr5wb3a3.js} +6 -6
- package/dist/v2/{server-yspcz6v9.js → server-06ew2dbf.js} +3 -3
- package/dist/v2/{server-rd7v8c8y.js → server-10af6m7d.js} +13 -2
- package/dist/v2/{server-ar3awhcy.js → server-65r7p1z4.js} +4 -4
- package/dist/v2/{server-k8mj4ccb.js → server-6jxvkyrr.js} +2 -1
- package/dist/v2/{server-sk08dem3.js → server-86vydsx9.js} +1 -1
- package/dist/v2/{server-kya7jvx5.js → server-92fhew3p.js} +13 -7
- package/dist/v2/{server-ds7y8nmk.js → server-b0k0cfkd.js} +2 -2
- package/dist/v2/{server-rpdbmk63.js → server-b8qp1ark.js} +1 -1
- package/dist/v2/{server-d0ec5f7b.js → server-fw2sjpkx.js} +1 -1
- package/dist/v2/{server-11rbew2r.js → server-gsz7h1zr.js} +7 -1
- package/dist/v2/{server-ndkzagjz.js → server-kmaxv4g3.js} +1 -1
- package/dist/v2/{server-t091cjj4.js → server-mhrgymcs.js} +12 -1
- package/dist/v2/server.js +2 -2
- package/dist/v2/{v2-archive-reader-cw9fm88j.js → v2-archive-reader-rm5qkv00.js} +1 -1
- package/dist/v2/{wrapup-orchestrator-sk2zx55m.js → wrapup-orchestrator-ghbsa00k.js} +8 -8
- package/dist/{v2-archive-reader-42chk89p.js → v2-archive-reader-gwe0ry1a.js} +1 -1
- package/dist/{wrapup-orchestrator-4sfkj8z4.js → wrapup-orchestrator-q12ejyw9.js} +10 -10
- package/package.json +1 -1
|
@@ -139,9 +139,9 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
139
139
|
import("./sqlite-zdgm52sv.js"),
|
|
140
140
|
import("./store-reader-yaxtdy6f.js"),
|
|
141
141
|
import("./store-4se2a0n0.js"),
|
|
142
|
-
import("./read-session-chunk-
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
142
|
+
import("./read-session-chunk-bh402br0.js"),
|
|
143
|
+
import("./render-90pve6jf.js"),
|
|
144
|
+
import("./search-archive-9sx7fn3t.js"),
|
|
145
145
|
import("./expand-attachments-h33jbgyz.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -7,8 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
contentSha2562,
|
|
9
9
|
getProjectEmbeddingSnapshot2,
|
|
10
|
+
readSearchBackfillCursor2,
|
|
11
|
+
writeSearchBackfillCursor2,
|
|
10
12
|
embedItemsWindowBounded2
|
|
11
|
-
} from "./server-
|
|
13
|
+
} from "./server-mhrgymcs.js";
|
|
12
14
|
import {
|
|
13
15
|
saveEmbeddingIfHashMatches
|
|
14
16
|
} from "./server-4dhv7mqz.js";
|
|
@@ -23,7 +25,12 @@ async function ensureMemoryEmbeddings2(args) {
|
|
|
23
25
|
if (!snapshot?.enabled) {
|
|
24
26
|
return args.existingEmbeddings;
|
|
25
27
|
}
|
|
26
|
-
const
|
|
28
|
+
const missing = args.memories.filter((memory) => !args.existingEmbeddings.has(memory.id)).sort((a, b) => a.id - b.id);
|
|
29
|
+
const capped = missing.length > SEARCH_BACKFILL_LIMIT;
|
|
30
|
+
const cursor = capped ? readSearchBackfillCursor2(args.projectIdentity, snapshot.generation) : undefined;
|
|
31
|
+
const next = cursor === undefined ? 0 : missing.findIndex((memory) => memory.id > cursor);
|
|
32
|
+
const start = Math.max(0, next);
|
|
33
|
+
const missingMemories = missing.slice(start, start + SEARCH_BACKFILL_LIMIT);
|
|
27
34
|
if (missingMemories.length === 0) {
|
|
28
35
|
return args.existingEmbeddings;
|
|
29
36
|
}
|
|
@@ -53,6 +60,10 @@ async function ensureMemoryEmbeddings2(args) {
|
|
|
53
60
|
if (!currentSnapshot || currentSnapshot.generation !== result.generation) {
|
|
54
61
|
return args.existingEmbeddings;
|
|
55
62
|
}
|
|
63
|
+
if (capped && (cursor !== undefined || result.vectors.size < missingMemories.length)) {
|
|
64
|
+
const nextCursor = start + missingMemories.length < missing.length ? missingMemories.at(-1)?.id : undefined;
|
|
65
|
+
writeSearchBackfillCursor2(args.projectIdentity, snapshot.generation, cursor, nextCursor);
|
|
66
|
+
}
|
|
56
67
|
for (const [id, embedding] of staged) {
|
|
57
68
|
args.existingEmbeddings.set(id, embedding);
|
|
58
69
|
}
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
isMessageIndexReconciledThrough,
|
|
26
26
|
clearIndexedMessages,
|
|
27
27
|
indexMessagesAfterOrdinal
|
|
28
|
-
} from "./server-
|
|
28
|
+
} from "./server-fw2sjpkx.js";
|
|
29
29
|
import {
|
|
30
30
|
Priority,
|
|
31
31
|
AdmissionClass,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
enqueueShadowEmbeddingItems2,
|
|
57
57
|
getProjectEmbeddingSnapshot2,
|
|
58
58
|
embedItemsForProject2
|
|
59
|
-
} from "./server-
|
|
59
|
+
} from "./server-mhrgymcs.js";
|
|
60
60
|
import {
|
|
61
61
|
recordEmbeddingMeasurement
|
|
62
62
|
} from "./server-2amn2s73.js";
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
sanitizeFtsQuery,
|
|
73
73
|
searchMemoriesFTS,
|
|
74
74
|
searchMemoriesFTSUnion
|
|
75
|
-
} from "./server-
|
|
75
|
+
} from "./server-kmaxv4g3.js";
|
|
76
76
|
import {
|
|
77
77
|
ModuleMemoryAuthorityError2,
|
|
78
78
|
getMemoriesByProject2,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
} from "./server-jjvbk92s.js";
|
|
82
82
|
import {
|
|
83
83
|
ensureMemoryEmbeddings2
|
|
84
|
-
} from "./server-
|
|
84
|
+
} from "./server-10af6m7d.js";
|
|
85
85
|
import {
|
|
86
86
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
87
87
|
withMessageFtsSessionFilter
|
|
@@ -1595,7 +1595,8 @@ function createToolDropTarget(compositeKey, thinkingParts, index, batch, tagId)
|
|
|
1595
1595
|
parts
|
|
1596
1596
|
});
|
|
1597
1597
|
const before = count(served);
|
|
1598
|
-
const
|
|
1598
|
+
const stripAttachments = skeleton && hasAttachments();
|
|
1599
|
+
const retained = skeleton ? parts.map((part) => skeletonRealToolPart(part, tagId, stripAttachments)) : [];
|
|
1599
1600
|
const after = count(retained);
|
|
1600
1601
|
return {
|
|
1601
1602
|
beforeTools: before.toolCall,
|
|
@@ -156,14 +156,14 @@ import {
|
|
|
156
156
|
getRawSessionTagKeysThrough2,
|
|
157
157
|
getLegacyProtectedTailStartOrdinal2,
|
|
158
158
|
readSessionChunk2
|
|
159
|
-
} from "./server-
|
|
159
|
+
} from "./server-6jxvkyrr.js";
|
|
160
160
|
import {
|
|
161
161
|
clearCompressionDepth,
|
|
162
162
|
clearCompressionDepthRange,
|
|
163
163
|
toMessageIndexSource,
|
|
164
164
|
clearIndexedMessagesInTransaction,
|
|
165
165
|
indexSourcesAfterOrdinal
|
|
166
|
-
} from "./server-
|
|
166
|
+
} from "./server-fw2sjpkx.js";
|
|
167
167
|
import {
|
|
168
168
|
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
169
169
|
getCompartmentLeaseBlocker,
|
|
@@ -179,6 +179,7 @@ import {
|
|
|
179
179
|
getNewestCompartmentIds,
|
|
180
180
|
getLastCompartmentEndMessage,
|
|
181
181
|
getLastCompartmentEndMessageId,
|
|
182
|
+
cachedHistoryCoversLatestCompartment,
|
|
182
183
|
getCompartmentsByEndMessageId,
|
|
183
184
|
appendCompartments,
|
|
184
185
|
buildCompartmentBlock,
|
|
@@ -209,7 +210,7 @@ import {
|
|
|
209
210
|
getProjectState,
|
|
210
211
|
recordSubagentInvocation,
|
|
211
212
|
getLatestHistorianInvocationId
|
|
212
|
-
} from "./server-
|
|
213
|
+
} from "./server-gsz7h1zr.js";
|
|
213
214
|
import {
|
|
214
215
|
invalidateAutoEmbedSession
|
|
215
216
|
} from "./server-2amn2s73.js";
|
|
@@ -244,7 +245,7 @@ import {
|
|
|
244
245
|
getProjectChunkEmbeddingModelId2,
|
|
245
246
|
getProjectEmbeddingMaxInputTokens2,
|
|
246
247
|
embedItemsWindowBounded2
|
|
247
|
-
} from "./server-
|
|
248
|
+
} from "./server-mhrgymcs.js";
|
|
248
249
|
import {
|
|
249
250
|
V2_MEMORY_CATEGORIES,
|
|
250
251
|
CATEGORY_PRIORITY,
|
|
@@ -255,7 +256,7 @@ import {
|
|
|
255
256
|
userFacingFailureCode,
|
|
256
257
|
promoteSessionFactsDurable,
|
|
257
258
|
embedPromotedFacts
|
|
258
|
-
} from "./server-
|
|
259
|
+
} from "./server-kmaxv4g3.js";
|
|
259
260
|
import {
|
|
260
261
|
computeCueContentHash,
|
|
261
262
|
getMuralCueState,
|
|
@@ -269,7 +270,7 @@ import {
|
|
|
269
270
|
LATEST_SUPPORTED_VERSION,
|
|
270
271
|
getPersistedSchemaVersion,
|
|
271
272
|
openDatabase
|
|
272
|
-
} from "./server-
|
|
273
|
+
} from "./server-b8qp1ark.js";
|
|
273
274
|
import {
|
|
274
275
|
parseCompartmentOutput,
|
|
275
276
|
resolveWorkspaceShareCategories,
|
|
@@ -9800,7 +9801,8 @@ function softRefreshCachedM1(options) {
|
|
|
9800
9801
|
return {
|
|
9801
9802
|
text: replayCachedM1(options.state),
|
|
9802
9803
|
memoryUpdateCount: 0,
|
|
9803
|
-
renderedMemoryIds: []
|
|
9804
|
+
renderedMemoryIds: [],
|
|
9805
|
+
wrapupPublicationUnconfirmed: options.skipPressureRefold === true && !cachedHistoryCoversLatestCompartment(getCompartments(options.db, options.sessionId), options.state.cachedM0MaxCompartmentSeq ?? -1, options.state.cachedM0TrimBoundaryId ?? null)
|
|
9804
9806
|
};
|
|
9805
9807
|
}
|
|
9806
9808
|
steps.mark("staleCheck");
|
|
@@ -10409,6 +10411,7 @@ function injectM0M1(options) {
|
|
|
10409
10411
|
let m1Text;
|
|
10410
10412
|
let memoryUpdateCount = 0;
|
|
10411
10413
|
let m1Recomputed = m1Render !== null;
|
|
10414
|
+
let wrapupPublicationUnconfirmed;
|
|
10412
10415
|
if (m1Render) {
|
|
10413
10416
|
m1Text = m1Render.text;
|
|
10414
10417
|
memoryUpdateCount = m1Render.memoryUpdateCount;
|
|
@@ -10425,6 +10428,7 @@ function injectM0M1(options) {
|
|
|
10425
10428
|
m1Text = refreshed.text;
|
|
10426
10429
|
memoryUpdateCount = refreshed.memoryUpdateCount;
|
|
10427
10430
|
m1Recomputed = true;
|
|
10431
|
+
wrapupPublicationUnconfirmed = refreshed.wrapupPublicationUnconfirmed;
|
|
10428
10432
|
m0Text = decodeM0Bytes(options.state.cachedM0Bytes) ?? M0_EMPTY_BODY;
|
|
10429
10433
|
} catch (error) {
|
|
10430
10434
|
if (!options.allowFreshContentionFallback)
|
|
@@ -10466,6 +10470,7 @@ function injectM0M1(options) {
|
|
|
10466
10470
|
rematerialized = true;
|
|
10467
10471
|
m0Text = decodeM0Bytes(options.state.cachedM0Bytes) ?? M0_EMPTY_BODY;
|
|
10468
10472
|
m1Text = refolded.m1Text;
|
|
10473
|
+
wrapupPublicationUnconfirmed = undefined;
|
|
10469
10474
|
} catch (error) {
|
|
10470
10475
|
if (!(error instanceof MaterializeContentionError))
|
|
10471
10476
|
throw error;
|
|
@@ -10502,6 +10507,7 @@ function injectM0M1(options) {
|
|
|
10502
10507
|
prependedMessageCount,
|
|
10503
10508
|
m0RematerializedThisPass: rematerialized,
|
|
10504
10509
|
materializationContentionRetryExhausted: contentionExhausted,
|
|
10510
|
+
wrapupPublicationUnconfirmed,
|
|
10505
10511
|
decision,
|
|
10506
10512
|
m0Bytes: options.state.cachedM0Bytes,
|
|
10507
10513
|
m1Text,
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
rawMessageWorkerSource2,
|
|
20
20
|
rawMessageOffThreadRangeReader2,
|
|
21
21
|
readRawSessionMessageIdOrdinalsForRange2
|
|
22
|
-
} from "./server-
|
|
22
|
+
} from "./server-6jxvkyrr.js";
|
|
23
23
|
import {
|
|
24
24
|
readV2ArchiveOffThread2
|
|
25
|
-
} from "./server-
|
|
25
|
+
} from "./server-06ew2dbf.js";
|
|
26
26
|
|
|
27
27
|
// src/tools/ctx-expand/search-archive.ts
|
|
28
28
|
var archiveReadsOnThisThread = 0;
|
|
@@ -1021,7 +1021,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
|
|
|
1021
1021
|
state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
|
|
1022
1022
|
if (signal.aborted || !readsOpenCodeStore)
|
|
1023
1023
|
return;
|
|
1024
|
-
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-
|
|
1024
|
+
const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-bh402br0.js"));
|
|
1025
1025
|
const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-ynb3vg6r.js"));
|
|
1026
1026
|
if (signal.aborted)
|
|
1027
1027
|
return;
|
|
@@ -306,6 +306,12 @@ function getLastCompartmentEndMessageId(db, sessionId) {
|
|
|
306
306
|
const id = row?.end_message_id;
|
|
307
307
|
return id && id.length > 0 ? id : null;
|
|
308
308
|
}
|
|
309
|
+
function cachedHistoryCoversLatestCompartment(compartments, m0MaxSequence, historyEndMessageId) {
|
|
310
|
+
const latest = compartments.at(-1);
|
|
311
|
+
if (!latest || latest.sequence <= m0MaxSequence)
|
|
312
|
+
return true;
|
|
313
|
+
return !!historyEndMessageId && latest.endMessageId === historyEndMessageId && !compartments.some((other) => other !== latest && other.endMessageId === historyEndMessageId);
|
|
314
|
+
}
|
|
309
315
|
function getCompartmentsByEndMessageId(db, sessionId, endMessageId) {
|
|
310
316
|
const rows = db.prepare("SELECT * FROM compartments WHERE session_id = ? AND end_message_id = ? ORDER BY sequence ASC").all(sessionId, endMessageId).filter(isCompartmentRow);
|
|
311
317
|
return rows.map(toCompartment);
|
|
@@ -5154,4 +5160,4 @@ var ERROR_CLASSES = new Set([
|
|
|
5154
5160
|
"permission_denied",
|
|
5155
5161
|
"unknown"
|
|
5156
5162
|
]);
|
|
5157
|
-
export { COMPARTMENT_LEASE_RENEWAL_MS, getCompartmentLeaseBlocker, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, queueM0Mutation, getMaxM0MutationId, getCompartments, getNewestCompartmentIds, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, getCompartmentsByEndMessageId, appendCompartments, buildCompartmentBlock, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndsThrough, isPartialCompartmentEnd, readProjectDocsCanonical, readServerFallbackUsage, providerResponseFailed, isSuccessfulProviderCompletion, LkgRecoveryFenceError, lkgServedArrayDigest, hasCleanLkgRecoveryFence, dirtyLkgRecoveryRevision, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, prepareLkgCaptureFence, certifyCommittedLkgCapture, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, advanceSessionActivity, backfillSessionActivity, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, clearSession, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, hasExplicitRefreshRequest, clearPendingMaterialization, clearReclaimedMaterialization, clearPendingMaterializationOrigin, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, isHeldHeadForRequest, deferDeliveredSystemRefresh, retirePendingSystemPromptDelivery, lkgProviderInputTotal, beginV2LkgRequest, claimLkgRequestIdentity, currentLkgRequestIdentity, noteCapturedLkgRequest, noteLkgProviderResponse, measuredLkgPrefix, clearLkgMeasuredRequest, saveLkgSlotToDb, clearPersistedLkgSlotStrict, loadPersistedLkgSlot, drainStaleLkgSlots, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, beginServedRequest, noteServedPassPermission, noteServedModel, noteServedReplay, noteServedHostInput, noteServedRefusal, countServedRefusal, dropServedRecord, forgetServedRecord, commitServedRequest, lkgInputIdentity, beginLkgPass, visitMessageContentFields, contentSnapshotValue, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgContentDigest, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, forgetInMemorySlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, externalHistorianFailureReason, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, MEMORY_VISIBILITY_MUTATION_CATEGORY, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId };
|
|
5163
|
+
export { COMPARTMENT_LEASE_RENEWAL_MS, getCompartmentLeaseBlocker, acquireCompartmentLease, renewCompartmentLease, releaseCompartmentLease, releaseCompartmentLeaseBestEffort, isCompartmentLeaseHeld, isNoContentCompartment, queueM0Mutation, getMaxM0MutationId, getCompartments, getNewestCompartmentIds, getLastCompartmentEndMessage, getLastCompartmentEndMessageId, cachedHistoryCoversLatestCompartment, getCompartmentsByEndMessageId, appendCompartments, buildCompartmentBlock, saveRecompStagingPass, getRecompStaging, clearRecompStaging, getRecompPartialRange, setRecompPartialRange, escapeXmlAttr, escapeXmlContent, getUncoveredCompartmentEndsThrough, isPartialCompartmentEnd, readProjectDocsCanonical, readServerFallbackUsage, providerResponseFailed, isSuccessfulProviderCompletion, LkgRecoveryFenceError, lkgServedArrayDigest, hasCleanLkgRecoveryFence, dirtyLkgRecoveryRevision, ownsLkgDirtyFence, invalidateCleanLkgRecoveryFence, prepareLkgCaptureFence, certifyCommittedLkgCapture, markLkgRecoveryDirty, rememberUnpublishedAutoSearchNoHint, getUnpublishedAutoSearchNoHint, forgetUnpublishedAutoSearchNoHint, registerAutoSearchWork, advanceSessionActivity, backfillSessionActivity, readSessionMeta, getOrCreateSessionMeta, updateSessionMeta, advanceToolReclaimWatermark, markSessionCleanupPending, retryPendingSessionCleanups, retryPendingRustSessionCleanupsForProject, clearSession, requestPendingMaterialization, pendingMaterializationOrigin, hasPendingMaterializationOrigin, hasExplicitRefreshRequest, clearPendingMaterialization, clearReclaimedMaterialization, clearPendingMaterializationOrigin, recordSystemPromptForRequest, recordHeldHeadForRequest, bindSystemPromptResponse, isHeldHeadForRequest, deferDeliveredSystemRefresh, retirePendingSystemPromptDelivery, lkgProviderInputTotal, beginV2LkgRequest, claimLkgRequestIdentity, currentLkgRequestIdentity, noteCapturedLkgRequest, noteLkgProviderResponse, measuredLkgPrefix, clearLkgMeasuredRequest, saveLkgSlotToDb, clearPersistedLkgSlotStrict, loadPersistedLkgSlot, drainStaleLkgSlots, resolveLkgModelKeys, createLkgEntryProjector, captureLkgSlot, validateAnthropicReasoningRuns, validateLkgSeam, replayLkg, coldStartRawServedIndex, coldStartUncapturedReplay, noteUncertifiedNormalLkg, hasProcessLocalLkgProof, lkgDirtyRevision, rememberLkgDirtyRevision, readPersistedLkgUntaggedInputIds, persistLkgUntaggedInputIds, noteLkgRecoveryPrefix, readLkgRecoveryPrefix, noteLkgHealthyPrefix, lkgRecoveryReplayUnproven, lkgRecoveryEntryUnproven, beginServedRequest, noteServedPassPermission, noteServedModel, noteServedReplay, noteServedHostInput, noteServedRefusal, countServedRefusal, dropServedRecord, forgetServedRecord, commitServedRequest, lkgInputIdentity, beginLkgPass, visitMessageContentFields, contentSnapshotValue, messageContentFields, signatureForFields, exactReusablePrefix, incrementalLkgContentDigests, lkgContentDigest, lkgSlotRejection, captureSlot, getInMemorySlot, getSlot, forgetInMemorySlot, dropSlot, noteEntry, getLkgSlotHeapStats, TOOL_SWEEP_SCOPED_MARKER, useScopedToolSweep, createPreAdoptionToolSweepResolver, copySessionStateForClone, externalHistorianFailureReason, getRecentFailedHistorianRunTimes, recordHistorianRun, summarizeImportance, tallyFactsByCategory, MEMORY_VISIBILITY_MUTATION_CATEGORY, queueMemoryMutation, getMemoryMutationsForRender, getMemoryMutationsForRenderByProjects, getMaxMemoryMutationId, getMaxMemoryMutationIdForProjects, GLOBAL_USER_PROFILE_PROJECT_PATH, getProjectState, bumpProjectUserProfileVersion, saveSourceContent, replaceSourceContent, getSourceContents, recordSubagentInvocation, getLatestHistorianInvocationId };
|
|
@@ -1745,6 +1745,7 @@ function registerProjectEmbedding2(db, projectIdentity, config, features, source
|
|
|
1745
1745
|
runtimeFingerprint,
|
|
1746
1746
|
provider: canReuseProvider ? prior.provider : null,
|
|
1747
1747
|
generation,
|
|
1748
|
+
searchBackfillAfterId: generationChanged ? undefined : prior.searchBackfillAfterId,
|
|
1748
1749
|
features: { ...features },
|
|
1749
1750
|
modelId: providerIdentity === OFF_PROVIDER_IDENTITY ? "off" : providerIdentity,
|
|
1750
1751
|
chunkModelId: providerIdentity === OFF_PROVIDER_IDENTITY ? "off" : chunkModelId,
|
|
@@ -2439,6 +2440,15 @@ function getProjectEmbeddingSnapshot2(projectIdentity) {
|
|
|
2439
2440
|
const registration = projectRegistrations.get(projectIdentity);
|
|
2440
2441
|
return registration ? snapshotFor(registration) : null;
|
|
2441
2442
|
}
|
|
2443
|
+
function readSearchBackfillCursor2(projectIdentity, generation) {
|
|
2444
|
+
const registration = projectRegistrations.get(projectIdentity);
|
|
2445
|
+
return registration?.generation === generation ? registration.searchBackfillAfterId : undefined;
|
|
2446
|
+
}
|
|
2447
|
+
function writeSearchBackfillCursor2(projectIdentity, generation, expected, afterId) {
|
|
2448
|
+
const registration = projectRegistrations.get(projectIdentity);
|
|
2449
|
+
if (registration?.generation === generation && registration.searchBackfillAfterId === expected)
|
|
2450
|
+
registration.searchBackfillAfterId = afterId;
|
|
2451
|
+
}
|
|
2442
2452
|
function installProjectEmbeddingSearchBridge2(snapshot, provider) {
|
|
2443
2453
|
projectRegistrations.set(snapshot.projectIdentity, {
|
|
2444
2454
|
projectIdentity: snapshot.projectIdentity,
|
|
@@ -2446,6 +2456,7 @@ function installProjectEmbeddingSearchBridge2(snapshot, provider) {
|
|
|
2446
2456
|
providerIdentity: snapshot.providerIdentity,
|
|
2447
2457
|
runtimeFingerprint: snapshot.runtimeFingerprint,
|
|
2448
2458
|
generation: snapshot.generation,
|
|
2459
|
+
searchBackfillAfterId: readSearchBackfillCursor2(snapshot.projectIdentity, snapshot.generation),
|
|
2449
2460
|
features: { ...snapshot.features },
|
|
2450
2461
|
modelId: snapshot.modelId,
|
|
2451
2462
|
chunkModelId: snapshot.chunkModelId,
|
|
@@ -3165,4 +3176,4 @@ function _resetProjectEmbeddingRegistryForTests2() {
|
|
|
3165
3176
|
setBootQuietPeriodForTests(null);
|
|
3166
3177
|
}
|
|
3167
3178
|
|
|
3168
|
-
export { saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, retainProjectEmbedding2, getShadowBackfillStopReason2, markProjectLoadUntrusted2, contentSha2562, drainProjectEmbeddingIdentityMaintenance2, drainStaleEmbeddingIdentitiesForProject2, registerProjectEmbedding2, registerProjectShadowEmbedding2, getShadowEmbeddingMeasurementCohort2, getPrimaryEmbeddingMeasurementCohort2, embedShadowTextForProject2, enqueueShadowEmbeddingItems2, getShadowBackfillRemaining2, flushShadowEmbeddingBacklog2, registerProjectInObservationMode2, unregisterProjectShadowEmbedding2, unregisterProjectEmbedding2, getProjectEmbeddingSnapshot2, installProjectEmbeddingSearchBridge2, getProjectChunkEmbeddingModelId2, getProjectEmbeddingMaxInputTokens2, embedTextForProject2, embedBatchForProject2, embedItemsForProject2, embedItemsWindowBounded2, embedUnembeddedMemoriesForProject2, embedUnembeddedMemoriesForProjectOutcome2, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };
|
|
3179
|
+
export { saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, retainProjectEmbedding2, getShadowBackfillStopReason2, markProjectLoadUntrusted2, contentSha2562, drainProjectEmbeddingIdentityMaintenance2, drainStaleEmbeddingIdentitiesForProject2, registerProjectEmbedding2, registerProjectShadowEmbedding2, getShadowEmbeddingMeasurementCohort2, getPrimaryEmbeddingMeasurementCohort2, embedShadowTextForProject2, enqueueShadowEmbeddingItems2, getShadowBackfillRemaining2, flushShadowEmbeddingBacklog2, registerProjectInObservationMode2, unregisterProjectShadowEmbedding2, unregisterProjectEmbedding2, getProjectEmbeddingSnapshot2, readSearchBackfillCursor2, writeSearchBackfillCursor2, installProjectEmbeddingSearchBridge2, getProjectChunkEmbeddingModelId2, getProjectEmbeddingMaxInputTokens2, embedTextForProject2, embedBatchForProject2, embedItemsForProject2, embedItemsWindowBounded2, embedUnembeddedMemoriesForProject2, embedUnembeddedMemoriesForProjectOutcome2, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };
|
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.77",
|
|
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-9nm9edea.js");
|
|
8200
8200
|
setHarness2("opencode2");
|
|
8201
8201
|
bindStaleBuildNotice({}, import.meta.url, "opencode2");
|
|
8202
8202
|
const duties = await registerContext(context);
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getCompartments,
|
|
13
13
|
getLastCompartmentEndMessage,
|
|
14
14
|
requestPendingMaterialization
|
|
15
|
-
} from "./server-
|
|
15
|
+
} from "./server-gsz7h1zr.js";
|
|
16
16
|
import"./server-2amn2s73.js";
|
|
17
17
|
import"./server-y8xjr8rx.js";
|
|
18
18
|
import"./server-x6fn9x8q.js";
|
|
@@ -25,7 +25,7 @@ import"./server-1d042x6w.js";
|
|
|
25
25
|
import"./server-6ash6z8z.js";
|
|
26
26
|
import"./server-ds8vpfkr.js";
|
|
27
27
|
import"./server-8pdfmc27.js";
|
|
28
|
-
import"./server-
|
|
28
|
+
import"./server-fw2sjpkx.js";
|
|
29
29
|
import {
|
|
30
30
|
getWrapupInProgressState,
|
|
31
31
|
acquireWrapupInProgress,
|
|
@@ -35,14 +35,14 @@ import {
|
|
|
35
35
|
clearEmergencyRecovery
|
|
36
36
|
} from "./server-cxkb9725.js";
|
|
37
37
|
import"./server-xepx8t43.js";
|
|
38
|
-
import"./server-
|
|
38
|
+
import"./server-b8qp1ark.js";
|
|
39
39
|
import"./server-1zx87sdm.js";
|
|
40
40
|
import"./server-rz6g5xne.js";
|
|
41
41
|
import"./server-2ra6pwf3.js";
|
|
42
42
|
import"./server-3ap5dmhc.js";
|
|
43
43
|
import {
|
|
44
44
|
prepareRawSessionOrdinals2
|
|
45
|
-
} from "./server-
|
|
45
|
+
} from "./server-6jxvkyrr.js";
|
|
46
46
|
import"./server-fr0wbhdn.js";
|
|
47
47
|
import"./server-jn4pktdk.js";
|
|
48
48
|
import"./server-afsz3cmx.js";
|
|
@@ -64,14 +64,14 @@ import {
|
|
|
64
64
|
registerActiveCompartmentRun,
|
|
65
65
|
setRecompStarting2,
|
|
66
66
|
setRecompTerminal2
|
|
67
|
-
} from "./server-
|
|
67
|
+
} from "./server-92fhew3p.js";
|
|
68
68
|
import"./server-qt1qqasc.js";
|
|
69
|
-
import"./server-
|
|
69
|
+
import"./server-mhrgymcs.js";
|
|
70
70
|
import"./server-jtq03rkb.js";
|
|
71
71
|
import"./server-4dhv7mqz.js";
|
|
72
72
|
import"./server-d706s5xn.js";
|
|
73
|
-
import"./server-
|
|
74
|
-
import"./server-
|
|
73
|
+
import"./server-kmaxv4g3.js";
|
|
74
|
+
import"./server-10af6m7d.js";
|
|
75
75
|
import"./server-jjvbk92s.js";
|
|
76
76
|
import"./server-9sf3qp02.js";
|
|
77
77
|
import"./server-2adwe0be.js";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runManagedWrapup2
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
5
|
-
import"./index-
|
|
3
|
+
} from "./index-7jj5jk78.js";
|
|
4
|
+
import"./index-xkn7vq89.js";
|
|
5
|
+
import"./index-dcdk1thy.js";
|
|
6
6
|
import"./index-832w615x.js";
|
|
7
7
|
import"./index-sd3egckz.js";
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
import"./index-jfs6k0xk.js";
|
|
9
|
+
import"./index-16h5fhem.js";
|
|
10
10
|
import"./index-jjvbk92s.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-yfn52pb6.js";
|
|
12
12
|
import"./index-4dhv7mqz.js";
|
|
13
|
-
import"./index-
|
|
13
|
+
import"./index-rjm4hjyb.js";
|
|
14
14
|
import"./index-tebcx987.js";
|
|
15
|
-
import"./index-
|
|
15
|
+
import"./index-vr6t0y4w.js";
|
|
16
16
|
import"./index-2amn2s73.js";
|
|
17
17
|
import"./index-6athgjba.js";
|
|
18
18
|
import"./index-ngwmx6nt.js";
|
|
19
19
|
import"./index-1sq1krqw.js";
|
|
20
20
|
import"./index-qt1qqasc.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-8mt6vvwx.js";
|
|
22
22
|
import"./index-bdnak4d0.js";
|
|
23
23
|
import"./index-1zx87sdm.js";
|
|
24
24
|
import"./index-x40zr813.js";
|
|
@@ -29,7 +29,7 @@ import"./index-6nqz8hsz.js";
|
|
|
29
29
|
import"./index-jg7sbt3v.js";
|
|
30
30
|
import"./index-snbpdpa3.js";
|
|
31
31
|
import"./index-pxnzyvjc.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-kn23xzst.js";
|
|
33
33
|
import"./index-fb3zxn06.js";
|
|
34
34
|
import"./index-xx05vta0.js";
|
|
35
35
|
import"./index-fr0wbhdn.js";
|
package/package.json
CHANGED