@cortexkit/pi-magic-context 0.49.51 → 0.49.53
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/{embedding-backfill-fbhpk2yy.js → embedding-backfill-ad4k8e3f.js} +2 -2
- package/dist/{index-babadndp.js → index-1tk6065b.js} +32 -16
- package/dist/{index-r6dj8rm9.js → index-2yjpxzga.js} +9 -5
- package/dist/{index-jexm22qn.js → index-4cmj48mq.js} +3 -3
- package/dist/{index-4j5442b0.js → index-8cgk0pyh.js} +52 -15
- package/dist/{index-1cvyaw9a.js → index-8d2z6503.js} +1 -1
- package/dist/{index-sm51c9bc.js → index-a70dwgff.js} +8 -8
- package/dist/{index-jy9fq8gp.js → index-f07s5m8x.js} +504 -9
- package/dist/{index-ch3rvpjg.js → index-nevbaezn.js} +7 -6
- package/dist/{index-ty2m0s0s.js → index-njd3qa8e.js} +1 -1
- package/dist/{index-ywvhr524.js → index-snrkpmpf.js} +1 -1
- package/dist/{index-06rdy9h6.js → index-tv9pqeek.js} +1 -1
- package/dist/index.js +669 -144
- package/dist/{message-index-bounded-wg71m86d.js → message-index-bounded-hwatm90p.js} +2 -2
- package/dist/migration-worker.js +1 -1
- package/dist/{project-embedding-registry-hpca84nz.js → project-embedding-registry-d67axw7r.js} +3 -1
- package/dist/raw-ordinal-warmup-worker.js +3 -3
- package/dist/{read-session-chunk-dmpabgvh.js → read-session-chunk-mj91mv8r.js} +1 -1
- package/dist/{render-71rpjt3g.js → render-js5tkc4g.js} +4 -4
- package/dist/{search-archive-w12r0c45.js → search-archive-159s0qp9.js} +4 -4
- package/dist/{search-7w8m1snz.js → search-hyc5s9t0.js} +6 -6
- package/dist/subagent-entry.js +11 -11
- package/dist/tag-snapshot-worker-pi.js +1 -1
- package/dist/{v2-archive-reader-5n1w78zj.js → v2-archive-reader-5sc0rsh9.js} +1 -1
- package/package.json +3 -1
|
@@ -27,11 +27,11 @@ serveWorkerJobs(async (initial, port) => {
|
|
|
27
27
|
{ Database, registerSqliteDiagnosticSink },
|
|
28
28
|
{ log }
|
|
29
29
|
] = await Promise.all([
|
|
30
|
-
import("./embedding-backfill-
|
|
30
|
+
import("./embedding-backfill-ad4k8e3f.js"),
|
|
31
31
|
import("./embedding-cache-7rp4gqzr.js"),
|
|
32
32
|
import("./storage-memory-0ndn65fm.js"),
|
|
33
|
-
import("./project-embedding-registry-
|
|
34
|
-
import("./search-
|
|
33
|
+
import("./project-embedding-registry-d67axw7r.js"),
|
|
34
|
+
import("./search-hyc5s9t0.js"),
|
|
35
35
|
import("./compartment-chunk-embedding-wg7emg3z.js"),
|
|
36
36
|
import("./embedding-activity-ew6dshfd.js"),
|
|
37
37
|
import("./harness-9872e0ym.js"),
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
getProjectEmbeddingSnapshot2,
|
|
48
48
|
embedTextForProject2,
|
|
49
49
|
embedItemsForProject2
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-2yjpxzga.js";
|
|
51
51
|
import {
|
|
52
52
|
recordEmbeddingMeasurement
|
|
53
53
|
} from "./index-hgd00nas.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
isEmbeddingEnabled,
|
|
64
64
|
embedText,
|
|
65
65
|
ensureMemoryEmbeddings2
|
|
66
|
-
} from "./index-
|
|
66
|
+
} from "./index-njd3qa8e.js";
|
|
67
67
|
import {
|
|
68
68
|
getMemorySelectColumns2,
|
|
69
69
|
isMemoryRow2,
|
|
@@ -91,11 +91,11 @@ import {
|
|
|
91
91
|
clearIndexedMessages,
|
|
92
92
|
indexSingleMessage,
|
|
93
93
|
indexMessagesAfterOrdinal
|
|
94
|
-
} from "./index-
|
|
94
|
+
} from "./index-snrkpmpf.js";
|
|
95
95
|
import {
|
|
96
96
|
MESSAGE_FTS_SESSION_FILTER_SQL,
|
|
97
97
|
withMessageFtsSessionFilter
|
|
98
|
-
} from "./index-
|
|
98
|
+
} from "./index-8d2z6503.js";
|
|
99
99
|
import {
|
|
100
100
|
resolveWorkspaceShareCategories,
|
|
101
101
|
resolveWorkspaceIdentitySet,
|
|
@@ -128,8 +128,13 @@ var USER_FACING_FAILURES = {
|
|
|
128
128
|
},
|
|
129
129
|
history_boundary_unresolved: {
|
|
130
130
|
code: "MC-H04",
|
|
131
|
-
sentence: "This request was not sent:
|
|
132
|
-
action: "
|
|
131
|
+
sentence: "This request was not sent: it is larger than the model's context window, and Magic Context could not cut the already-summarized history out of it.",
|
|
132
|
+
action: "Run /ctx-flush to compress the history now, then send your message again."
|
|
133
|
+
},
|
|
134
|
+
history_boundary_recovering: {
|
|
135
|
+
code: "MC-H08",
|
|
136
|
+
sentence: "This request was not sent: it is larger than the model's context window, and Magic Context could not cut the already-summarized history out of it.",
|
|
137
|
+
action: "Send your message again: Magic Context will first summarize more of the history and drop old tool output to make it fit."
|
|
133
138
|
},
|
|
134
139
|
history_over_window_unmanaged: {
|
|
135
140
|
code: "MC-H06",
|
|
@@ -2385,7 +2390,7 @@ function getMessageSearchStatement(db, sessionFirst) {
|
|
|
2385
2390
|
const statements = sessionFirst ? sessionFirstMessageSearchStatements : messageSearchStatements;
|
|
2386
2391
|
let stmt = statements.get(db);
|
|
2387
2392
|
if (!stmt) {
|
|
2388
|
-
stmt = db.prepare(`SELECT message_ordinal AS messageOrdinal, message_id AS messageId, role, content FROM message_history_fts WHERE ${sessionFirst ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}session_id = ?
|
|
2393
|
+
stmt = db.prepare(`SELECT message_ordinal AS messageOrdinal, message_id AS messageId, role, content FROM message_history_fts WHERE ${sessionFirst ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}session_id = ? AND message_history_fts MATCH ? ORDER BY bm25(message_history_fts), CAST(message_ordinal AS INTEGER) ASC LIMIT ?`);
|
|
2389
2394
|
statements.set(db, stmt);
|
|
2390
2395
|
}
|
|
2391
2396
|
return stmt;
|
|
@@ -2394,7 +2399,7 @@ function getMessageSearchStatementWithCutoff(db, sessionFirst) {
|
|
|
2394
2399
|
const statements = sessionFirst ? sessionFirstMessageSearchStatementsWithCutoff : messageSearchStatementsWithCutoff;
|
|
2395
2400
|
let stmt = statements.get(db);
|
|
2396
2401
|
if (!stmt) {
|
|
2397
|
-
stmt = db.prepare(`SELECT message_ordinal AS messageOrdinal, message_id AS messageId, role, content FROM message_history_fts WHERE ${sessionFirst ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}session_id = ?
|
|
2402
|
+
stmt = db.prepare(`SELECT message_ordinal AS messageOrdinal, message_id AS messageId, role, content FROM message_history_fts WHERE ${sessionFirst ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}session_id = ? AND message_history_fts MATCH ? AND CAST(message_ordinal AS INTEGER) <= ? ORDER BY bm25(message_history_fts), CAST(message_ordinal AS INTEGER) ASC LIMIT ?`);
|
|
2398
2403
|
statements.set(db, stmt);
|
|
2399
2404
|
}
|
|
2400
2405
|
return stmt;
|
|
@@ -2416,7 +2421,7 @@ function getMessageSearchStatementWithDateRange(db, withCutoff) {
|
|
|
2416
2421
|
JOIN message_fts_rowid_map AS map
|
|
2417
2422
|
ON map.session_id = message_history_fts.session_id
|
|
2418
2423
|
AND map.fts_rowid = message_history_fts.rowid
|
|
2419
|
-
WHERE ${MESSAGE_FTS_SESSION_FILTER_SQL}message_history_fts.session_id = ?
|
|
2424
|
+
WHERE ${MESSAGE_FTS_SESSION_FILTER_SQL}message_history_fts.session_id = ?
|
|
2420
2425
|
AND message_history_fts MATCH ?
|
|
2421
2426
|
AND map.message_time_ms BETWEEN ? AND ?
|
|
2422
2427
|
${withCutoff ? "AND CAST(message_history_fts.message_ordinal AS INTEGER) <= ?" : ""}
|
|
@@ -2441,7 +2446,7 @@ function getMessageSearchDiagnosticStatement(db, sessionFirst) {
|
|
|
2441
2446
|
CAST(message_ordinal AS INTEGER) AS ordinalValue,
|
|
2442
2447
|
bm25(message_history_fts) AS ftsRank
|
|
2443
2448
|
FROM message_history_fts
|
|
2444
|
-
WHERE ${sessionFirst ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}session_id = ?
|
|
2449
|
+
WHERE ${sessionFirst ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}session_id = ? AND message_history_fts MATCH ?
|
|
2445
2450
|
),
|
|
2446
2451
|
eligible AS (
|
|
2447
2452
|
SELECT * FROM matches
|
|
@@ -2489,7 +2494,7 @@ function getMessageSearchDiagnosticStatementWithDateRange(db) {
|
|
|
2489
2494
|
JOIN message_fts_rowid_map AS map
|
|
2490
2495
|
ON map.session_id = message_history_fts.session_id
|
|
2491
2496
|
AND map.fts_rowid = message_history_fts.rowid
|
|
2492
|
-
WHERE ${MESSAGE_FTS_SESSION_FILTER_SQL}message_history_fts.session_id = ?
|
|
2497
|
+
WHERE ${MESSAGE_FTS_SESSION_FILTER_SQL}message_history_fts.session_id = ?
|
|
2493
2498
|
AND message_history_fts MATCH ?
|
|
2494
2499
|
AND map.message_time_ms BETWEEN ? AND ?
|
|
2495
2500
|
),
|
|
@@ -2539,7 +2544,7 @@ function getBatchedFtsCountStatement(db, queryCount, cutoff, dateRange, sessionF
|
|
|
2539
2544
|
const dateSql = dateRange === null ? "" : " AND map.message_time_ms BETWEEN ? AND ?";
|
|
2540
2545
|
statement = db.prepare(Array.from({ length: queryCount }, (_, index) => `SELECT ${index} AS queryIndex, COUNT(*) AS count
|
|
2541
2546
|
FROM message_history_fts${joinSql}
|
|
2542
|
-
WHERE ${sessionFirst || dateRange !== null ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}message_history_fts.session_id =
|
|
2547
|
+
WHERE ${sessionFirst || dateRange !== null ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}message_history_fts.session_id = ?
|
|
2543
2548
|
AND message_history_fts MATCH ?${dateSql}${cutoffSql}`).join(`
|
|
2544
2549
|
UNION ALL
|
|
2545
2550
|
`));
|
|
@@ -2555,6 +2560,8 @@ function countSessionFtsMatchesBatch(db, sessionId, ftsQueries, cutoff, dateRang
|
|
|
2555
2560
|
return [];
|
|
2556
2561
|
const bindings = [];
|
|
2557
2562
|
for (const query of ftsQueries) {
|
|
2563
|
+
if (sessionFirst || dateRange !== null)
|
|
2564
|
+
bindings.push(sessionId);
|
|
2558
2565
|
bindings.push(sessionId, contentOnlyMessageQuery(query));
|
|
2559
2566
|
if (dateRange !== null)
|
|
2560
2567
|
bindings.push(dateRange.from, dateRange.to);
|
|
@@ -2819,13 +2826,20 @@ function runMessageFtsQuery(db, sessionId, ftsQuery, fetchLimit, cutoff, dateRan
|
|
|
2819
2826
|
let rawRows;
|
|
2820
2827
|
const matchQuery = contentOnlyMessageQuery(ftsQuery);
|
|
2821
2828
|
if (dateRange !== null) {
|
|
2822
|
-
const bindings = [
|
|
2829
|
+
const bindings = [
|
|
2830
|
+
sessionId,
|
|
2831
|
+
sessionId,
|
|
2832
|
+
matchQuery,
|
|
2833
|
+
dateRange.from,
|
|
2834
|
+
dateRange.to
|
|
2835
|
+
];
|
|
2823
2836
|
if (cutoff !== null)
|
|
2824
2837
|
bindings.push(cutoff);
|
|
2825
2838
|
bindings.push(fetchLimit);
|
|
2826
2839
|
rawRows = getMessageSearchStatementWithDateRange(db, cutoff !== null).all(...bindings);
|
|
2827
2840
|
} else {
|
|
2828
|
-
|
|
2841
|
+
const sessionBindings = sessionFirst ? [sessionId, sessionId] : [sessionId];
|
|
2842
|
+
rawRows = cutoff !== null ? getMessageSearchStatementWithCutoff(db, sessionFirst).all(...sessionBindings, matchQuery, cutoff, fetchLimit) : getMessageSearchStatement(db, sessionFirst).all(...sessionBindings, matchQuery, fetchLimit);
|
|
2829
2843
|
}
|
|
2830
2844
|
const rows = rawRows.map((row) => row);
|
|
2831
2845
|
const result = [];
|
|
@@ -2840,7 +2854,7 @@ function runMessageFtsQueryWithDiagnostics(args) {
|
|
|
2840
2854
|
if (args.ftsQuery.length === 0)
|
|
2841
2855
|
return { rows: [], suppressedCount: 0 };
|
|
2842
2856
|
const matchQuery = contentOnlyMessageQuery(args.ftsQuery);
|
|
2843
|
-
const rawRows = (args.dateRange === null ? getMessageSearchDiagnosticStatement(args.db, args.sessionFirst).all(args.sessionId, matchQuery, args.cutoff, args.fetchLimit, args.cutoff) : getMessageSearchDiagnosticStatementWithDateRange(args.db).all(args.sessionId, matchQuery, args.dateRange.from, args.dateRange.to, args.cutoff, args.fetchLimit, args.cutoff)).map((row) => row);
|
|
2857
|
+
const rawRows = (args.dateRange === null ? getMessageSearchDiagnosticStatement(args.db, args.sessionFirst).all(...args.sessionFirst ? [args.sessionId, args.sessionId] : [args.sessionId], matchQuery, args.cutoff, args.fetchLimit, args.cutoff) : getMessageSearchDiagnosticStatementWithDateRange(args.db).all(args.sessionId, args.sessionId, matchQuery, args.dateRange.from, args.dateRange.to, args.cutoff, args.fetchLimit, args.cutoff)).map((row) => row);
|
|
2844
2858
|
const suppressedCount = rawRows[0]?.suppressedCount ?? 0;
|
|
2845
2859
|
const rows = [];
|
|
2846
2860
|
for (const row of rawRows) {
|
|
@@ -2874,7 +2888,7 @@ function getBatchedMessageSearchStatement(db, queryCount, cutoff, dateRange, ses
|
|
|
2874
2888
|
message_history_fts.content AS content,
|
|
2875
2889
|
bm25(message_history_fts) AS ftsRank
|
|
2876
2890
|
FROM message_history_fts${joinSql}
|
|
2877
|
-
WHERE ${sessionFirst || dateRange !== null ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}message_history_fts.session_id =
|
|
2891
|
+
WHERE ${sessionFirst || dateRange !== null ? MESSAGE_FTS_SESSION_FILTER_SQL : ""}message_history_fts.session_id = ?
|
|
2878
2892
|
AND message_history_fts MATCH ?${dateSql}${cutoffSql}
|
|
2879
2893
|
ORDER BY ftsRank
|
|
2880
2894
|
LIMIT ?
|
|
@@ -2892,6 +2906,8 @@ function runMessageFtsQueriesBatch(db, sessionId, ftsQueries, fetchLimit, cutoff
|
|
|
2892
2906
|
return [];
|
|
2893
2907
|
const bindings = [];
|
|
2894
2908
|
for (const query of ftsQueries) {
|
|
2909
|
+
if (sessionFirst || dateRange !== null)
|
|
2910
|
+
bindings.push(sessionId);
|
|
2895
2911
|
bindings.push(sessionId, contentOnlyMessageQuery(query));
|
|
2896
2912
|
if (dateRange !== null)
|
|
2897
2913
|
bindings.push(dateRange.from, dateRange.to);
|
|
@@ -2557,17 +2557,21 @@ async function embedItemsForProject2(projectIdentity, items, signal, db, session
|
|
|
2557
2557
|
}
|
|
2558
2558
|
return { vectors, modelId, generation };
|
|
2559
2559
|
}
|
|
2560
|
-
async function
|
|
2560
|
+
async function embedItemsWindowBounded2(projectIdentity, items, signal, db, sessionId = projectIdentity, options = {}) {
|
|
2561
2561
|
if (items.length <= MAX_WINDOWS_PER_EMBED_CALL) {
|
|
2562
|
-
return embedItemsForProject2(projectIdentity, items, signal, db,
|
|
2562
|
+
return embedItemsForProject2(projectIdentity, items, signal, db, sessionId);
|
|
2563
2563
|
}
|
|
2564
2564
|
const vectors = new Map;
|
|
2565
2565
|
let modelId = null;
|
|
2566
2566
|
let generation = null;
|
|
2567
2567
|
for (let start = 0;start < items.length; start += MAX_WINDOWS_PER_EMBED_CALL) {
|
|
2568
|
-
const
|
|
2568
|
+
const slice = items.slice(start, start + MAX_WINDOWS_PER_EMBED_CALL);
|
|
2569
|
+
const result = await embedItemsForProject2(projectIdentity, slice, signal, db, sessionId);
|
|
2569
2570
|
if (!result)
|
|
2570
2571
|
return null;
|
|
2572
|
+
if (options.stopOnIncompleteSlice && slice.some((item) => !result.vectors.has(item.id))) {
|
|
2573
|
+
return null;
|
|
2574
|
+
}
|
|
2571
2575
|
if (modelId === null) {
|
|
2572
2576
|
modelId = result.modelId;
|
|
2573
2577
|
generation = result.generation;
|
|
@@ -2780,7 +2784,7 @@ async function embedCandidateChunkBatch(db, projectIdentity, modelId, candidates
|
|
|
2780
2784
|
let result = null;
|
|
2781
2785
|
const attemptStart = Date.now();
|
|
2782
2786
|
try {
|
|
2783
|
-
result = await
|
|
2787
|
+
result = await embedItemsWindowBounded2(projectIdentity, items, signal, db);
|
|
2784
2788
|
} catch (error) {
|
|
2785
2789
|
log2("[magic-context] failed to proactively embed compartment chunks:", error);
|
|
2786
2790
|
}
|
|
@@ -3144,4 +3148,4 @@ function _resetProjectEmbeddingRegistryForTests2() {
|
|
|
3144
3148
|
setBootQuietPeriodForTests(null);
|
|
3145
3149
|
}
|
|
3146
3150
|
|
|
3147
|
-
export { withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, getShadowBackfillStopReason2, markProjectLoadUntrusted2, contentSha2562, drainProjectEmbeddingIdentityMaintenance2, drainStaleEmbeddingIdentitiesForProject2, registerProjectEmbedding2, registerProjectShadowEmbedding2, getShadowEmbeddingMeasurementCohort2, getPrimaryEmbeddingMeasurementCohort2, embedShadowTextForProject2, enqueueShadowEmbeddingItems2, getShadowBackfillRemaining2, flushShadowEmbeddingBacklog2, registerProjectInObservationMode2, unregisterProjectShadowEmbedding2, unregisterProjectEmbedding2, getProjectEmbeddingSnapshot2, installProjectEmbeddingSearchBridge2, getProjectChunkEmbeddingModelId2, getProjectEmbeddingMaxInputTokens2, embedTextForProject2, embedBatchForProject2, embedItemsForProject2, embedUnembeddedMemoriesForProject2, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };
|
|
3151
|
+
export { withQueryEmbeddingDeadline, OpenAICompatibleEmbeddingProvider, saveCommitEmbedding, loadProjectCommitEmbeddings, loadUnembeddedCommits, countEmbeddedCommits, upsertCommits, getLatestIndexedCommitSha, enforceProjectCap, describeShadowBackfillWriteRefusal2, listShadowBackfillStalls2, 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, drainCommitBacklogForProject2, embedUnembeddedCompartmentChunksForProject2, embedSessionCompartmentChunks2, getEmbeddingCoverageStatus2, getAutoEmbeddingSessionCoverage2, sweepAllRegisteredProjects2, _setTestProviderFactoryForProject2, _resetProjectEmbeddingRegistryForTests2 };
|
|
@@ -139,9 +139,9 @@ async function serveV2ArchiveReads2(port, openConnections) {
|
|
|
139
139
|
import("./sqlite-v89bj0yy.js"),
|
|
140
140
|
import("./store-reader-mmfw2h48.js"),
|
|
141
141
|
import("./store-0hhs1db3.js"),
|
|
142
|
-
import("./read-session-chunk-
|
|
143
|
-
import("./render-
|
|
144
|
-
import("./search-archive-
|
|
142
|
+
import("./read-session-chunk-mj91mv8r.js"),
|
|
143
|
+
import("./render-js5tkc4g.js"),
|
|
144
|
+
import("./search-archive-159s0qp9.js"),
|
|
145
145
|
import("./expand-attachments-8sxeyj26.js")
|
|
146
146
|
]);
|
|
147
147
|
const pool = new V2StoreReaderPool;
|
|
@@ -2242,7 +2242,7 @@ function normalizeDetectedLimitModelKey(modelKey) {
|
|
|
2242
2242
|
return typeof modelKey === "string" && modelKey.length > 0 ? piModelRefToCanonical(modelKey) : null;
|
|
2243
2243
|
}
|
|
2244
2244
|
function normalizeEmergencyRecoveryOrigin(value) {
|
|
2245
|
-
return value === "provider_overflow" || value === "proactive_model_shrink" ? value : null;
|
|
2245
|
+
return value === "provider_overflow" || value === "proactive_model_shrink" || value === "history_boundary_over_window" ? value : null;
|
|
2246
2246
|
}
|
|
2247
2247
|
function parseOverflowState(result, modelKey) {
|
|
2248
2248
|
if (!result) {
|
|
@@ -2474,7 +2474,9 @@ function getThinkingBindingRecoveryTarget(db, sessionId) {
|
|
|
2474
2474
|
function armThinkingBindingRecovery(db, sessionId) {
|
|
2475
2475
|
ensureSessionMetaRow(db, sessionId);
|
|
2476
2476
|
db.prepare("UPDATE session_meta SET thinking_binding_recovery_target = ? WHERE session_id = ?").run(THINKING_BINDING_RECOVERY_ALL_ASSISTANTS, sessionId);
|
|
2477
|
+
bindingRecoveriesAwaitingClear.delete(sessionId);
|
|
2477
2478
|
}
|
|
2479
|
+
var bindingRecoveriesAwaitingClear = new Map;
|
|
2478
2480
|
function clearThinkingBindingRecoveryIf(db, sessionId, expectedTarget) {
|
|
2479
2481
|
const result = db.prepare("UPDATE session_meta SET thinking_binding_recovery_target = '' WHERE session_id = ? AND thinking_binding_recovery_target = ?").run(sessionId, expectedTarget);
|
|
2480
2482
|
return result.changes > 0;
|
|
@@ -3981,6 +3983,40 @@ function applyEditMarkerToInput(input) {
|
|
|
3981
3983
|
}
|
|
3982
3984
|
}
|
|
3983
3985
|
|
|
3986
|
+
// ../plugin/src/features/magic-context/storage-reasoning-removal.ts
|
|
3987
|
+
var NAMESPACE = "reasoningRemoval";
|
|
3988
|
+
var BACKUP_NAMESPACE = "reasoningRemovalBackup";
|
|
3989
|
+
function invalidState(sessionId) {
|
|
3990
|
+
return new Error(`invalid persisted reasoning removal state for session ${sessionId}`);
|
|
3991
|
+
}
|
|
3992
|
+
function parseState(doc, sessionId, namespace = NAMESPACE) {
|
|
3993
|
+
const lane = doc[namespace];
|
|
3994
|
+
if (lane === undefined)
|
|
3995
|
+
return { messageIds: new Set, dropLeavesReasoning: false };
|
|
3996
|
+
if (!isRecord(lane) || !Array.isArray(lane.messageIds))
|
|
3997
|
+
throw invalidState(sessionId);
|
|
3998
|
+
const ids = new Set;
|
|
3999
|
+
for (const id of lane.messageIds) {
|
|
4000
|
+
if (typeof id !== "string" || id.length === 0)
|
|
4001
|
+
throw invalidState(sessionId);
|
|
4002
|
+
ids.add(id);
|
|
4003
|
+
}
|
|
4004
|
+
if (lane.dropLeavesReasoning !== undefined && typeof lane.dropLeavesReasoning !== "boolean") {
|
|
4005
|
+
throw invalidState(sessionId);
|
|
4006
|
+
}
|
|
4007
|
+
return { messageIds: ids, dropLeavesReasoning: lane.dropLeavesReasoning === true };
|
|
4008
|
+
}
|
|
4009
|
+
function getReasoningRemovalState(db, sessionId) {
|
|
4010
|
+
const doc = readReplayEnvelope(db, sessionId);
|
|
4011
|
+
try {
|
|
4012
|
+
return parseState(doc, sessionId);
|
|
4013
|
+
} catch (error) {
|
|
4014
|
+
if (doc[BACKUP_NAMESPACE] === undefined)
|
|
4015
|
+
throw error;
|
|
4016
|
+
return parseState(doc, sessionId, BACKUP_NAMESPACE);
|
|
4017
|
+
}
|
|
4018
|
+
}
|
|
4019
|
+
|
|
3984
4020
|
// ../plugin/src/hooks/magic-context/sentinel.ts
|
|
3985
4021
|
function modelAcceptsEmptyContent(providerID) {
|
|
3986
4022
|
return providerID === "anthropic";
|
|
@@ -4024,22 +4060,23 @@ function activeAnthropicTurnStart(messages, anthropic) {
|
|
|
4024
4060
|
if (!anthropic)
|
|
4025
4061
|
return;
|
|
4026
4062
|
for (let user = messages.length - 1;user >= 0; user--) {
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
continue;
|
|
4030
|
-
const info = isRecord(message.info) ? message.info : message;
|
|
4031
|
-
if (info.role !== "user" || info.synthetic === true || message.synthetic === true)
|
|
4032
|
-
continue;
|
|
4033
|
-
const id = typeof info.id === "string" ? info.id : "";
|
|
4034
|
-
if (id.startsWith("synth-user-"))
|
|
4035
|
-
continue;
|
|
4036
|
-
const parts = Array.isArray(message.parts) ? message.parts : Array.isArray(message.content) ? message.content : [];
|
|
4037
|
-
if (parts.length > 0 && parts.every((part) => isRecord(part) && (part.synthetic === true || part.ignored === true || ["tool_result", "toolResult", "tool-result"].includes(String(part.type)))))
|
|
4038
|
-
continue;
|
|
4039
|
-
return user + 1;
|
|
4063
|
+
if (isRealUserRequest(messages[user]))
|
|
4064
|
+
return user + 1;
|
|
4040
4065
|
}
|
|
4041
4066
|
return;
|
|
4042
4067
|
}
|
|
4068
|
+
function isRealUserRequest(message) {
|
|
4069
|
+
if (!isRecord(message))
|
|
4070
|
+
return false;
|
|
4071
|
+
const info = isRecord(message.info) ? message.info : message;
|
|
4072
|
+
if (info.role !== "user" || info.synthetic === true || message.synthetic === true)
|
|
4073
|
+
return false;
|
|
4074
|
+
const id = typeof info.id === "string" ? info.id : "";
|
|
4075
|
+
if (id.startsWith("synth-user-"))
|
|
4076
|
+
return false;
|
|
4077
|
+
const parts = Array.isArray(message.parts) ? message.parts : Array.isArray(message.content) ? message.content : [];
|
|
4078
|
+
return !(parts.length > 0 && parts.every((part) => isRecord(part) && (part.synthetic === true || part.ignored === true || ["tool_result", "toolResult", "tool-result"].includes(String(part.type)))));
|
|
4079
|
+
}
|
|
4043
4080
|
function hasAnthropicReasoning(messages) {
|
|
4044
4081
|
return messages.some((message) => {
|
|
4045
4082
|
if (!isRecord(message))
|
|
@@ -5268,4 +5305,4 @@ function readRawSessionSeedTail2(sessionId, boundaryId, onQuery) {
|
|
|
5268
5305
|
});
|
|
5269
5306
|
}
|
|
5270
5307
|
|
|
5271
|
-
export { detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, rowWindowMass, computeProtectionWindow, readEpochFloorSnapshot, getProtectionWindowForSession, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, isRustMarkerAdmissionFenced, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, EMERGENCY_DRAIN_FAILURE_BACKOFF_MS, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, getDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingPiMarker, setSessionWorkMetrics, getSessionWorkMetrics, resolveEpochFloorForPass, withReadOnlySessionDb, expandToolPart, askAnswerLines, removeUnsupportedCommitHashes, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripSystemInjection, isFilePart, hasUserAnswerMetadata, DreamTokenBudgetExceeded, TOKEN_BUDGET_FINALIZE_MESSAGE, TOKEN_BUDGET_TOOL_REFUSAL, registerBudgetFinalizeChild, releaseBudgetFinalizeChild, createDreamTokenBudget, droppedInputMarker, createDroppedInputGuard, isEditTool, applyEditMarkerToInput, modelAcceptsEmptyContent, isAnthropicFamilyRoute, variantChangeBustsProviderCache, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, isMarkerOnlyText, findLatestAssistantReasoningMutationExemptMessage, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opaqueThinkingCost, estimatePartImageTokens, SKELETON_REAL_INPUT_MAX_BYTES, toolInputStringBytes, resolveHostServedBoundaryId2, hasRawMessageProvider2, rawMessageWorkerSource2, rawMessageOffThreadRangeReader2, setRawMessageProvider2, setBoundedRawMessageProvider2, withRawMessageProvider2, cleanUserText2, withRawSessionMessageCache2, readRawSessionMessages2, readRawSessionMessagePage2, getRawSessionMessageOrdinalCount2, RAW_MESSAGE_VISIT_PAGE_SIZE2, visitRawSessionMessages2, visitRawSessionMessagesAsync2, readRawSessionMessageRange2, prepareRawSessionOrdinals2, primeTailRawMessageCache2, getCachedAbsoluteMessageCount2, primeInMemoryTailRawMessageCache2, readRawSessionMessageOrdinalPage2, getRawSessionStoredMessageCount2, readRawSessionMessageIdOrdinalsForRange2, readRawSessionMessageIdOrdinals2, readRawSessionMessagePartsById2, readRawSessionBoundaryEndpoints2, hasRawSessionMessageById2, readRawSessionMessageOrdinalById2, resolveHistorianChunkStart2, compareRawSessionMessageOrder2, readRawSessionMessageById2, getRawSessionMessageCount2, RAW_SESSION_TAG_KEY_PAGE_SIZE2, getRawSessionTagKeysThrough2, getLegacyProtectedTailStartOrdinal2, getProtectedTailStartOrdinal2, readSessionChunk2, getRawSessionMessageIdsThrough2, readRawSessionSeedTail2 };
|
|
5308
|
+
export { detectThinkingBindingMismatch, detectLatestTurnThinkingMismatch, isPrefixBoundThinkingModel, detectOverflow, MAX_EXECUTE_THRESHOLD, escalationBands, MERGED_REASONING_PARTS_PREFIX, decodeMergedReasoningParts, HYGIENE_PROVIDER_UNITS_VERSION, sessionDecisionCalibration, transitionSessionHygieneUnits, rowWindowMass, computeProtectionWindow, readEpochFloorSnapshot, getProtectionWindowForSession, SESSION_META_SELECT_COLUMNS, META_COLUMNS, BOOLEAN_META_KEYS, NULL_BIND_META_KEYS, isSessionMetaRow, getDefaultSessionMeta, ensureSessionMetaRow, toSessionMeta, persistCachedM0, clearCachedM0M1, isRustMarkerAdmissionFenced, ReplayDocumentError, readReplayEnvelope, readReplayDocument, updateReplayDocument, writeReplayDocument, isProviderOverflowFailClosedProven, getEmergencyRecoveryArmedAt, describeProtectedTailDrainBudgetSkip, loadProtectedTailMeta, markProtectedTailPolicyV3Seeded, recordProtectedTailPublicationFloor, recordProtectedTailNoEligibleHead, getWrapupInProgressState, isWrapupInProgress, acquireWrapupInProgress, updateWrapupInProgress, releaseWrapupInProgress, resolveCompactionModeRecord, getCompactionModeRecord, setCompactionModeRecord, EMERGENCY_DRAIN_FAILURE_BACKOFF_MS, getProtectedTailDrainBudgetSkip, reserveProtectedTailDrainTokens, clearEmergencyDrainLatch, recordHistorianDrainFailure, clearHistorianDrainFailure, rollbackProtectedTailDrainReservation, clearPersistedReasoningWatermark, getEmergencyInputSample, setEmergencyDropSample, clearEmergencyDropSample, getLastNudgeUndropped, setLastNudgeUndropped, getChannel1NudgeState, setChannel1NudgeState, markChannel1PostReduceGracePending, captureChannel1PostReduceGraceBaseline, getChannel2NudgeState, getChannel2NudgeClaim, setChannel2NudgeState, casChannel2NudgeState, claimChannel2NudgeState, casChannel2NudgeClaim, getPersistedNoteNudge, setPersistedNoteNudgeTrigger, setPersistedNoteNudgeTriggerMessageId, getNoteNudgeAnchors, getAutoSearchHintDecisions, deliverNoteNudgeAtomic, appendAutoSearchHintDecision, pruneNoteNudgeAnchors, queueAutoSearchHintDecisionRetirement, flushAutoSearchHintDecisionRetirement, getPersistedTodoSyntheticAnchor, setPersistedTodoSyntheticAnchor, clearPersistedTodoSyntheticAnchor, getNoteLastReadAt, setNoteLastReadAt, getHistorianFailureState, incrementHistorianFailure, clearHistorianFailureState, getOverflowState, recordOverflowDetected, clearEmergencyRecovery, clearDetectedContextLimit, getPersistedCompactionMarkerState, getCompactionMarkerPublicationState, compareAndSetCompactionMarkerPublicationState, getDeferredClearedCompactionMarkerState, parseStrippedPlaceholderState, serializeStrippedPlaceholderState, getStrippedPlaceholderIds, applyStrippedPlaceholderDelta, THINKING_BINDING_RECOVERY_FROZEN_PREFIX, THINKING_BINDING_STRIP_ORDER_END_MARKER, thinkingBindingRecoveryFrozenId, COMPACTION_OFF_THINKING_FROZEN_PREFIX, getThinkingBindingRecoveryTarget, armThinkingBindingRecovery, clearThinkingBindingRecoveryIf, getMergedReasoningStrippedIds, addMergedReasoningStrippedIds, getProcessedImageStrippedIds, parseProcessedImageMarkers, serializeProcessedImageMarkers, addProcessedImageStrippedIds, getPendingCompactionMarkerState, getCompactionMarkerHealth, loadPostprocessReplaySnapshot, clearPendingCompactionMarkerStateIf, getPendingPiCompactionMarkerState, setPendingPiCompactionMarkerState, clearPendingPiCompactionMarkerStateIf, logPiCompactionMarkerClear, getSessionsWithPendingPiMarker, setSessionWorkMetrics, getSessionWorkMetrics, resolveEpochFloorForPass, withReadOnlySessionDb, expandToolPart, askAnswerLines, removeUnsupportedCommitHashes, completedToolArcCrossesBoundary, estimateTrueRawMessageTokens, buildToolArcs, fenceBoundaryForCompletedToolArcs, fenceBoundaryForToolArcs, buildTrueRawTokenIndex, computeRawRangeFingerprint, invalidateTrueRawTokenCache, stripSystemInjection, isFilePart, hasUserAnswerMetadata, DreamTokenBudgetExceeded, TOKEN_BUDGET_FINALIZE_MESSAGE, TOKEN_BUDGET_TOOL_REFUSAL, registerBudgetFinalizeChild, releaseBudgetFinalizeChild, createDreamTokenBudget, droppedInputMarker, createDroppedInputGuard, isEditTool, applyEditMarkerToInput, getReasoningRemovalState, modelAcceptsEmptyContent, isAnthropicFamilyRoute, variantChangeBustsProviderCache, isInActiveAnthropicTurn, activeAnthropicTurnStart, hasAnthropicReasoning, isMarkerOnlyText, findLatestAssistantReasoningMutationExemptMessage, DEFAULT_KEEP_REASONING_TOKENS, resolveKeepReasoningTokens, reasoningStepCost, reasoningBudgetCutoff, reasoningTextAndOpaque, opaqueThinkingCost, estimatePartImageTokens, SKELETON_REAL_INPUT_MAX_BYTES, toolInputStringBytes, resolveHostServedBoundaryId2, hasRawMessageProvider2, rawMessageWorkerSource2, rawMessageOffThreadRangeReader2, setRawMessageProvider2, setBoundedRawMessageProvider2, withRawMessageProvider2, cleanUserText2, withRawSessionMessageCache2, readRawSessionMessages2, readRawSessionMessagePage2, getRawSessionMessageOrdinalCount2, RAW_MESSAGE_VISIT_PAGE_SIZE2, visitRawSessionMessages2, visitRawSessionMessagesAsync2, readRawSessionMessageRange2, prepareRawSessionOrdinals2, primeTailRawMessageCache2, getCachedAbsoluteMessageCount2, primeInMemoryTailRawMessageCache2, readRawSessionMessageOrdinalPage2, getRawSessionStoredMessageCount2, readRawSessionMessageIdOrdinalsForRange2, readRawSessionMessageIdOrdinals2, readRawSessionMessagePartsById2, readRawSessionBoundaryEndpoints2, hasRawSessionMessageById2, readRawSessionMessageOrdinalById2, resolveHistorianChunkStart2, compareRawSessionMessageOrder2, readRawSessionMessageById2, getRawSessionMessageCount2, RAW_SESSION_TAG_KEY_PAGE_SIZE2, getRawSessionTagKeysThrough2, getLegacyProtectedTailStartOrdinal2, getProtectedTailStartOrdinal2, readSessionChunk2, getRawSessionMessageIdsThrough2, readRawSessionSeedTail2 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// ../plugin/src/features/magic-context/message-fts-session-filter.ts
|
|
2
2
|
var MESSAGE_FTS_SESSION_FILTER_SQL = `+message_history_fts.rowid IN (
|
|
3
|
-
SELECT fts_rowid FROM message_fts_rowid_map WHERE session_id = ?
|
|
3
|
+
SELECT fts_rowid FROM message_fts_rowid_map WHERE session_id = ?
|
|
4
4
|
) AND `;
|
|
5
5
|
var coverageCaches = new WeakMap;
|
|
6
6
|
var coverageScansOnThisThread = 0;
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
import {
|
|
57
57
|
piHarnessKindFromExecutable,
|
|
58
58
|
getErrorMessage
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-tv9pqeek.js";
|
|
60
60
|
import {
|
|
61
61
|
getOrCreateSessionMeta,
|
|
62
62
|
updateSessionMeta,
|
|
@@ -70,10 +70,10 @@ import {
|
|
|
70
70
|
renderMessageByOrdinal2,
|
|
71
71
|
renderVerboseRange2,
|
|
72
72
|
renderItemByTag2
|
|
73
|
-
} from "./index-
|
|
73
|
+
} from "./index-f07s5m8x.js";
|
|
74
74
|
import {
|
|
75
75
|
getLastIndexedOrdinal
|
|
76
|
-
} from "./index-
|
|
76
|
+
} from "./index-snrkpmpf.js";
|
|
77
77
|
import {
|
|
78
78
|
setNoteLastReadAt,
|
|
79
79
|
getPersistedCompactionMarkerState,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
hasRawMessageProvider2,
|
|
84
84
|
setRawMessageProvider2,
|
|
85
85
|
readSessionChunk2
|
|
86
|
-
} from "./index-
|
|
86
|
+
} from "./index-8cgk0pyh.js";
|
|
87
87
|
import {
|
|
88
88
|
stableStringify
|
|
89
89
|
} from "./index-jxm4bvm4.js";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
unregisterProjectEmbedding2,
|
|
122
122
|
getProjectEmbeddingSnapshot2,
|
|
123
123
|
embedTextForProject2
|
|
124
|
-
} from "./index-
|
|
124
|
+
} from "./index-2yjpxzga.js";
|
|
125
125
|
import {
|
|
126
126
|
directoryHasGitMetadata,
|
|
127
127
|
resolveProjectIdentityForSession,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
resolveMemoriesByIdsForSearch2,
|
|
135
135
|
unifiedSearch2,
|
|
136
136
|
formatSearchResults2
|
|
137
|
-
} from "./index-
|
|
137
|
+
} from "./index-1tk6065b.js";
|
|
138
138
|
import {
|
|
139
139
|
TODO_STATUSES,
|
|
140
140
|
TODO_PRIORITIES,
|
|
@@ -184,7 +184,7 @@ import {
|
|
|
184
184
|
} from "./index-xssjy4z9.js";
|
|
185
185
|
import {
|
|
186
186
|
renderSearchArchive2
|
|
187
|
-
} from "./index-
|
|
187
|
+
} from "./index-nevbaezn.js";
|
|
188
188
|
import {
|
|
189
189
|
computeNormalizedHash
|
|
190
190
|
} from "./index-9x1f96r8.js";
|
|
@@ -3629,7 +3629,7 @@ function updateUserMemoryContent(db, id, content) {
|
|
|
3629
3629
|
db.prepare("UPDATE user_memories SET content = ?, updated_at = ? WHERE id = ?").run(content, Date.now(), id);
|
|
3630
3630
|
}
|
|
3631
3631
|
function dismissUserMemory(db, id) {
|
|
3632
|
-
db.prepare("UPDATE user_memories SET status = 'dismissed', updated_at = ? WHERE id = ?").run(Date.now(), id);
|
|
3632
|
+
db.prepare("UPDATE user_memories SET status = 'dismissed', updated_at = ? WHERE id = ? AND status = 'active'").run(Date.now(), id);
|
|
3633
3633
|
}
|
|
3634
3634
|
function parseCandidateIds(raw) {
|
|
3635
3635
|
try {
|