@cortexkit/pi-magic-context 0.49.43 → 0.49.45

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.
Files changed (43) hide show
  1. package/dist/auto-search-worker.js +4 -4
  2. package/dist/chunk-embedding-write-worker.js +6 -6
  3. package/dist/{compaction-marker-candidates-8qhackvy.js → compaction-marker-candidates-17a21jfn.js} +12 -2
  4. package/dist/compaction-marker-candidates-worker.js +5 -2
  5. package/dist/{compartment-chunk-embedding-jpcme6tz.js → compartment-chunk-embedding-nyjs3dfh.js} +5 -5
  6. package/dist/{embedding-backfill-002vyexq.js → embedding-backfill-er9jc4xf.js} +9 -9
  7. package/dist/embedding-worker.js +4 -4
  8. package/dist/{index-wt7vmyj4.js → index-000fthre.js} +4 -0
  9. package/dist/{index-p8jpbrj4.js → index-2kmwjq42.js} +64 -12
  10. package/dist/{index-c1dqxr10.js → index-3g9fnq6y.js} +2 -1
  11. package/dist/{index-f9qet7y8.js → index-4sa1rx3h.js} +3 -3
  12. package/dist/{index-p9jfa33t.js → index-6bedye3n.js} +7 -7
  13. package/dist/{index-mx757f3g.js → index-7esg5v2x.js} +7 -4
  14. package/dist/{index-ck8wj35v.js → index-bbbp8zs1.js} +1 -1
  15. package/dist/{index-j0h89gxy.js → index-fzadydec.js} +3 -3
  16. package/dist/{index-rzfr7wdv.js → index-gwvahsdz.js} +1 -1
  17. package/dist/{index-ccanzg8p.js → index-gzk7d940.js} +1 -1
  18. package/dist/{index-wwsfevck.js → index-jaqdcqwz.js} +1 -1
  19. package/dist/{index-6cvt64cn.js → index-k7gdgs11.js} +143 -57
  20. package/dist/{index-k0csz6pb.js → index-nvgq29cw.js} +3 -3
  21. package/dist/{index-g2j58qpq.js → index-qt711raa.js} +6 -6
  22. package/dist/{index-z7dktknj.js → index-rcenqffj.js} +64 -22
  23. package/dist/{index-2qqsnh1b.js → index-tsg6swzr.js} +2 -2
  24. package/dist/{index-ry84c8dr.js → index-v7m1nqwz.js} +2 -2
  25. package/dist/{index-a7sj2bam.js → index-wwf9vxpf.js} +2 -2
  26. package/dist/{index-pwp6zyx3.js → index-zchc0df8.js} +1 -1
  27. package/dist/{index-jbkwszd5.js → index-zwbgxt01.js} +4 -4
  28. package/dist/index.js +217 -73
  29. package/dist/{message-fts-rowid-map-hmgyfxxa.js → message-fts-rowid-map-ff4qg3e4.js} +2 -2
  30. package/dist/{message-index-bounded-39z2atfj.js → message-index-bounded-cqn6x6fc.js} +7 -7
  31. package/dist/migration-worker.js +4 -4
  32. package/dist/{project-embedding-registry-16pj4vyf.js → project-embedding-registry-ysaezfqw.js} +8 -8
  33. package/dist/raw-ordinal-warmup-worker.js +7 -7
  34. package/dist/{read-session-chunk-jxq427v6.js → read-session-chunk-0ecmbegv.js} +5 -5
  35. package/dist/{read-session-raw-a9ntjqap.js → read-session-raw-nttnwy8p.js} +1 -1
  36. package/dist/{render-6bhqgkpq.js → render-s6k2xqhj.js} +11 -11
  37. package/dist/{search-archive-yvdq2nfp.js → search-archive-qza20zkm.js} +7 -7
  38. package/dist/{search-45wknkb6.js → search-p4fj69gn.js} +13 -13
  39. package/dist/{storage-tags-p9y3bnw7.js → storage-tags-g0j9mr4b.js} +2 -2
  40. package/dist/subagent-entry.js +19 -19
  41. package/dist/tag-snapshot-worker-pi.js +6 -6
  42. package/dist/{v2-archive-reader-bd94n954.js → v2-archive-reader-2v7a879f.js} +1 -1
  43. package/package.json +1 -1
@@ -27,12 +27,12 @@ serveWorkerJobs(async (initial, port) => {
27
27
  { Database, registerSqliteDiagnosticSink },
28
28
  { log }
29
29
  ] = await Promise.all([
30
- import("./embedding-backfill-002vyexq.js"),
30
+ import("./embedding-backfill-er9jc4xf.js"),
31
31
  import("./embedding-cache-7rp4gqzr.js"),
32
32
  import("./storage-memory-0ndn65fm.js"),
33
- import("./project-embedding-registry-16pj4vyf.js"),
34
- import("./search-45wknkb6.js"),
35
- import("./compartment-chunk-embedding-jpcme6tz.js"),
33
+ import("./project-embedding-registry-ysaezfqw.js"),
34
+ import("./search-p4fj69gn.js"),
35
+ import("./compartment-chunk-embedding-nyjs3dfh.js"),
36
36
  import("./embedding-activity-ew6dshfd.js"),
37
37
  import("./harness-9872e0ym.js"),
38
38
  import("./sqlite-v89bj0yy.js"),
@@ -11,20 +11,20 @@ import {
11
11
  isWorkerCloseMessage,
12
12
  exitOnWorkerClose
13
13
  } from "./index-x2n261wp.js";
14
- import"./index-wt7vmyj4.js";
14
+ import"./index-000fthre.js";
15
15
  import"./index-gymgz20n.js";
16
16
  import"./index-dnp1jjar.js";
17
- import"./index-rzfr7wdv.js";
17
+ import"./index-gwvahsdz.js";
18
18
  import"./index-8sqebjzk.js";
19
19
  import"./index-wfqysrwq.js";
20
- import"./index-c1dqxr10.js";
21
- import"./index-ck8wj35v.js";
20
+ import"./index-3g9fnq6y.js";
21
+ import"./index-bbbp8zs1.js";
22
22
  import {
23
23
  replaceCompartmentChunkEmbeddings2,
24
24
  recordChunkEmbedBackoff2,
25
25
  loadUnembeddedSessionChunkCandidates2,
26
26
  countUnembeddedSessionCompartments2
27
- } from "./index-f9qet7y8.js";
27
+ } from "./index-4sa1rx3h.js";
28
28
  import {
29
29
  recordSessionProjectIdentity,
30
30
  acquireGitSweepLease,
@@ -35,7 +35,7 @@ import"./index-6pk49fc3.js";
35
35
  import {
36
36
  LATEST_SUPPORTED_VERSION,
37
37
  enforceSchemaFence
38
- } from "./index-a7sj2bam.js";
38
+ } from "./index-wwf9vxpf.js";
39
39
  import"./index-3bb24eb6.js";
40
40
  import"./index-d107f484.js";
41
41
  import"./index-yacs388s.js";
@@ -1,10 +1,15 @@
1
1
  import {
2
2
  isMarkerCandidateBasisCurrent2,
3
3
  invalidateMarkerCandidateBasis2,
4
+ discardMarkerCandidateBasis2,
4
5
  readMarkerCandidateBasis2,
5
6
  prepareMarkerCandidateBasis2,
6
- scanMarkerCandidateSnapshot2
7
- } from "./index-p8jpbrj4.js";
7
+ scanMarkerCandidateSnapshot2,
8
+ readMarkerFrontiers2,
9
+ certifiedMarkerReferenceFloor2,
10
+ readMarkerReferenceRows2,
11
+ readKnownMarkerReferenceRows2
12
+ } from "./index-2kmwjq42.js";
8
13
  import"./index-wfqysrwq.js";
9
14
  import"./index-8sqebjzk.js";
10
15
  import"./index-2qtx0q6h.js";
@@ -13,9 +18,14 @@ import"./index-0h2mkab2.js";
13
18
  import"./index-dnp1jjar.js";
14
19
  import"./index-x2n261wp.js";
15
20
  export {
21
+ certifiedMarkerReferenceFloor2 as certifiedMarkerReferenceFloor,
22
+ discardMarkerCandidateBasis2 as discardMarkerCandidateBasis,
16
23
  invalidateMarkerCandidateBasis2 as invalidateMarkerCandidateBasis,
17
24
  isMarkerCandidateBasisCurrent2 as isMarkerCandidateBasisCurrent,
18
25
  prepareMarkerCandidateBasis2 as prepareMarkerCandidateBasis,
26
+ readKnownMarkerReferenceRows2 as readKnownMarkerReferenceRows,
19
27
  readMarkerCandidateBasis2 as readMarkerCandidateBasis,
28
+ readMarkerFrontiers2 as readMarkerFrontiers,
29
+ readMarkerReferenceRows2 as readMarkerReferenceRows,
20
30
  scanMarkerCandidateSnapshot2 as scanMarkerCandidateSnapshot
21
31
  };
@@ -7,14 +7,17 @@ serveWorkerJobs(async (input, port) => {
7
7
  port.postMessage({ kind: "accepted" });
8
8
  const [{ Database }, { scanMarkerCandidateSnapshot }] = await Promise.all([
9
9
  import("./sqlite-v89bj0yy.js"),
10
- import("./compaction-marker-candidates-8qhackvy.js")
10
+ import("./compaction-marker-candidates-17a21jfn.js")
11
11
  ]);
12
12
  let db;
13
13
  let reply;
14
14
  try {
15
15
  db = new Database(input.path, { readonly: true });
16
16
  db.exec("PRAGMA busy_timeout=250");
17
- reply = { kind: "candidates", snapshot: scanMarkerCandidateSnapshot(db, input.sessionId) };
17
+ reply = {
18
+ kind: "candidates",
19
+ snapshot: scanMarkerCandidateSnapshot(db, input.sessionId, input.references !== false)
20
+ };
18
21
  } catch (error) {
19
22
  reply = { kind: "error", error: error instanceof Error ? error.message : String(error) };
20
23
  } finally {
@@ -24,14 +24,14 @@ import {
24
24
  countSessionCompartmentEmbedCoverage2,
25
25
  countSessionCompartmentEmbedCoveragePolite2,
26
26
  countUnembeddedSessionCompartmentsPolite2
27
- } from "./index-f9qet7y8.js";
28
- import"./index-rzfr7wdv.js";
29
- import"./index-ck8wj35v.js";
30
- import"./index-c1dqxr10.js";
27
+ } from "./index-4sa1rx3h.js";
28
+ import"./index-gwvahsdz.js";
29
+ import"./index-bbbp8zs1.js";
30
+ import"./index-3g9fnq6y.js";
31
31
  import"./index-wfqysrwq.js";
32
32
  import"./index-8sqebjzk.js";
33
33
  import"./index-0wtm7g7f.js";
34
- import"./index-wt7vmyj4.js";
34
+ import"./index-000fthre.js";
35
35
  import"./index-2qtx0q6h.js";
36
36
  import"./index-gymgz20n.js";
37
37
  import"./index-0h2mkab2.js";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  ensureMemoryEmbeddings2
3
- } from "./index-jbkwszd5.js";
4
- import"./index-z7dktknj.js";
3
+ } from "./index-zwbgxt01.js";
4
+ import"./index-rcenqffj.js";
5
5
  import"./index-9p40dgkm.js";
6
6
  import"./index-hgd00nas.js";
7
7
  import"./index-yhzhdp3m.js";
8
8
  import"./index-mp0gh04g.js";
9
- import"./index-f9qet7y8.js";
10
- import"./index-2qqsnh1b.js";
11
- import"./index-rzfr7wdv.js";
12
- import"./index-ccanzg8p.js";
9
+ import"./index-4sa1rx3h.js";
10
+ import"./index-tsg6swzr.js";
11
+ import"./index-gwvahsdz.js";
12
+ import"./index-gzk7d940.js";
13
13
  import"./index-6pk49fc3.js";
14
- import"./index-ck8wj35v.js";
15
- import"./index-c1dqxr10.js";
14
+ import"./index-bbbp8zs1.js";
15
+ import"./index-3g9fnq6y.js";
16
16
  import"./index-wfqysrwq.js";
17
17
  import"./index-8sqebjzk.js";
18
18
  import"./index-0wtm7g7f.js";
19
- import"./index-wt7vmyj4.js";
19
+ import"./index-000fthre.js";
20
20
  import"./index-2qtx0q6h.js";
21
21
  import"./index-gymgz20n.js";
22
22
  import"./index-0h2mkab2.js";
@@ -5,15 +5,15 @@ import {
5
5
  log2
6
6
  } from "./index-gymgz20n.js";
7
7
  import"./index-dnp1jjar.js";
8
- import"./index-ccanzg8p.js";
9
- import"./index-rzfr7wdv.js";
10
- import"./index-wt7vmyj4.js";
8
+ import"./index-gzk7d940.js";
9
+ import"./index-gwvahsdz.js";
10
+ import"./index-000fthre.js";
11
11
  import"./index-2qtx0q6h.js";
12
12
  import {
13
13
  resolveLocalEmbeddingWorkerRuntime,
14
14
  getLocalEmbeddingNativeMemoryStats,
15
15
  LocalEmbeddingProvider
16
- } from "./index-2qqsnh1b.js";
16
+ } from "./index-tsg6swzr.js";
17
17
  import {
18
18
  setStoragePrivatePermissionEnforcement
19
19
  } from "./index-81nthk8j.js";
@@ -393,6 +393,7 @@ function extractToolCallSummaries(parts) {
393
393
  }
394
394
  return summaries;
395
395
  }
396
+ var COMMAND_ARG_MAX_CHARS = 200;
396
397
  function extractKeyArg(_toolName, input) {
397
398
  if (!input)
398
399
  return null;
@@ -410,6 +411,9 @@ function extractKeyArg(_toolName, input) {
410
411
  return input.module;
411
412
  if (typeof input.action === "string")
412
413
  return input.action;
414
+ if (typeof input.command === "string") {
415
+ return truncateArg(normalizeText(input.command), COMMAND_ARG_MAX_CHARS);
416
+ }
413
417
  return null;
414
418
  }
415
419
  function truncateArg(value, maxLen = 60) {
@@ -26,9 +26,10 @@ var missingWorkerWarnings = new Set;
26
26
  var ownWriteRevisions = new Map;
27
27
  var exitRegistered = false;
28
28
  function reportWorkerUnavailable(entry, detail) {
29
- if (missingWorkerWarnings.has(entry.href))
29
+ const key = `${entry.href}\x00${detail}`;
30
+ if (missingWorkerWarnings.has(key))
30
31
  return;
31
- missingWorkerWarnings.add(entry.href);
32
+ missingWorkerWarnings.add(key);
32
33
  const path = entry.protocol === "file:" ? fileURLToPath(entry) : entry.href;
33
34
  log2(`[magic-context] [ERROR] compaction-marker: candidate worker unavailable ${path}: ${detail}; marker unchanged, advancement deferred`);
34
35
  }
@@ -64,6 +65,9 @@ function invalidateMarkerCandidateBasis2(db, sessionId) {
64
65
  if (revision !== undefined)
65
66
  ownWriteRevisions.set(key, revision + 1);
66
67
  }
68
+ function discardMarkerCandidateBasis2(db, sessionId) {
69
+ candidates.get(db)?.delete(sessionId);
70
+ }
67
71
  function readMarkerCandidateBasis2(db, sessionId, readConnection = db) {
68
72
  const basis = candidates.get(db)?.get(sessionId);
69
73
  if (basis) {
@@ -94,7 +98,7 @@ function prepareMarkerCandidateBasis2(db, sessionId, options = {}) {
94
98
  reportWorkerUnavailable(entry, "file missing");
95
99
  return Promise.resolve(false);
96
100
  }
97
- const preparation = runCandidateWorker(path, sessionId, options).then((snapshot) => {
101
+ const preparation = runCandidateWorker(path, sessionId, options.references !== false, options).then((snapshot) => {
98
102
  if (!snapshot)
99
103
  return false;
100
104
  const basis = {
@@ -124,7 +128,7 @@ function prepareMarkerCandidateBasis2(db, sessionId, options = {}) {
124
128
  function markerWorkerEntry() {
125
129
  return new URL(new URL(import.meta.url).pathname.endsWith(".ts") ? "./compaction-marker-candidates-worker.ts" : "./compaction-marker-candidates-worker.js", import.meta.url);
126
130
  }
127
- function runCandidateWorker(path, sessionId, options) {
131
+ function runCandidateWorker(path, sessionId, references, options) {
128
132
  if (!exitRegistered) {
129
133
  exitRegistered = true;
130
134
  const controller = new AbortController;
@@ -164,10 +168,14 @@ function runCandidateWorker(path, sessionId, options) {
164
168
  timer.unref?.();
165
169
  };
166
170
  try {
167
- worker = inRootAsyncContext2(() => options.entry ? new Worker(entry, { workerData: { path, sessionId } }) : reuseWorker(entry, { workerData: { path, sessionId } }));
171
+ const pooled = !options.entry || options.shareWorker === true;
172
+ worker = inRootAsyncContext2(() => pooled ? reuseWorker(entry, { workerData: { path, sessionId, references } }) : new Worker(entry, { workerData: { path, sessionId, references } }));
168
173
  workers.add(worker);
169
174
  worker.unref();
170
- deadline(options.acceptMs ?? 2000);
175
+ if (pooled)
176
+ worker.once("online", () => deadline(options.acceptMs ?? 2000));
177
+ else
178
+ deadline(options.acceptMs ?? 2000);
171
179
  worker.on("message", (reply) => {
172
180
  if (reply.kind === "accepted")
173
181
  deadline(options.resultMs ?? 600000);
@@ -205,20 +213,64 @@ function scanMarkerSummaryCandidates(db, sessionId) {
205
213
  db.exec("ROLLBACK");
206
214
  }
207
215
  }
208
- function scanMarkerCandidateSnapshot2(db, sessionId) {
216
+ function scanMarkerCandidateSnapshot2(db, sessionId, references = true) {
209
217
  const ownsSnapshot = !db.inTransaction;
210
218
  if (ownsSnapshot)
211
219
  db.exec("BEGIN");
212
220
  try {
213
221
  const ids = scanMarkerSummaryCandidates(db, sessionId);
214
- const frontier = db.prepare("SELECT rowid,id FROM message ORDER BY rowid DESC LIMIT 1").get() ?? null;
215
- if (frontier && !Number.isSafeInteger(frontier.rowid))
216
- throw new Error("marker frontier rowid is not a safe integer");
217
- return { ids, frontier };
222
+ const frontier = readMarkerFrontier(db, "message");
223
+ if (!references)
224
+ return { ids, frontier };
225
+ return {
226
+ ids,
227
+ frontier,
228
+ references: {
229
+ partIds: readMarkerReferenceRows2(db, sessionId, "part").map((row) => row.id),
230
+ partFrontiers: readMarkerFrontiers2(db, "part")
231
+ }
232
+ };
218
233
  } finally {
219
234
  if (ownsSnapshot)
220
235
  db.exec("ROLLBACK");
221
236
  }
222
237
  }
238
+ function readMarkerFrontier(db, table) {
239
+ const frontier = db.prepare(`SELECT rowid,id FROM ${table} ORDER BY rowid DESC LIMIT 1`).all()[0] ?? null;
240
+ if (frontier && !Number.isSafeInteger(frontier.rowid))
241
+ throw new Error(`marker ${table} frontier rowid is not a safe integer`);
242
+ return frontier;
243
+ }
244
+ var MARKER_FRONTIER_CANDIDATES = 3;
245
+ function readMarkerFrontiers2(db, table, count = MARKER_FRONTIER_CANDIDATES) {
246
+ const frontiers = db.prepare(`SELECT rowid,id FROM ${table} ORDER BY rowid DESC LIMIT ?`).all(count);
247
+ if (frontiers.some((frontier) => !Number.isSafeInteger(frontier.rowid)))
248
+ throw new Error(`marker ${table} frontier rowid is not a safe integer`);
249
+ return frontiers;
250
+ }
251
+ var MARKER_REFERENCE_FRONTIER_SQL = (table) => `SELECT rowid FROM ${table} WHERE id = ?`;
252
+ function certifiedMarkerReferenceFloor2(db, table, frontiers) {
253
+ if (frontiers.length === 0)
254
+ return 0;
255
+ const probe = db.prepare(MARKER_REFERENCE_FRONTIER_SQL(table));
256
+ for (const frontier of [...frontiers].sort((a, b) => b.rowid - a.rowid)) {
257
+ const current = probe.all(frontier.id);
258
+ if (current[0]?.rowid === frontier.rowid)
259
+ return frontier.rowid;
260
+ }
261
+ return;
262
+ }
263
+ var MARKER_TAIL_REFERENCE_COLUMNS = `id,
264
+ CASE WHEN data LIKE '%tail_start_id%' THEN json_extract(data, '$.tail_start_id') END AS direct,
265
+ CASE WHEN data LIKE '%tail_start_id%' THEN json_extract(data, '$.compaction.tail_start_id') END AS nested`;
266
+ function readMarkerReferenceRows2(db, sessionId, table, afterRowid) {
267
+ return db.prepare(`SELECT ${MARKER_TAIL_REFERENCE_COLUMNS} FROM ${table}
268
+ WHERE ${afterRowid === undefined ? "session_id = ?" : "rowid > ? AND +session_id = ?"}
269
+ AND ${table === "part" ? "data LIKE '%compaction%' AND json_valid(data) AND json_extract(data, '$.type') = 'compaction'" : "(data LIKE '%compaction%' OR data LIKE '%tail_start_id%') AND json_valid(data) AND (json_type(data, '$.compaction') IS NOT NULL OR json_type(data, '$.tail_start_id') IS NOT NULL)"}`).all(...afterRowid === undefined ? [sessionId] : [afterRowid, sessionId]);
270
+ }
271
+ function readKnownMarkerReferenceRows2(db, sessionId, table, ids) {
272
+ const byId = db.prepare(`SELECT ${MARKER_TAIL_REFERENCE_COLUMNS} FROM ${table} WHERE id = ? AND session_id = ?`);
273
+ return ids.flatMap((id) => byId.all(id, sessionId));
274
+ }
223
275
 
224
- export { isMarkerCandidateBasisCurrent2, invalidateMarkerCandidateBasis2, readMarkerCandidateBasis2, prepareMarkerCandidateBasis2, scanMarkerCandidateSnapshot2 };
276
+ export { isMarkerCandidateBasisCurrent2, invalidateMarkerCandidateBasis2, discardMarkerCandidateBasis2, readMarkerCandidateBasis2, prepareMarkerCandidateBasis2, scanMarkerCandidateSnapshot2, readMarkerFrontiers2, certifiedMarkerReferenceFloor2, readMarkerReferenceRows2, readKnownMarkerReferenceRows2 };
@@ -427,7 +427,8 @@ var RAW_SUMMARY_TOOL_INPUT_KEYS = [
427
427
  "query",
428
428
  "symbol",
429
429
  "module",
430
- "action"
430
+ "action",
431
+ "command"
431
432
  ];
432
433
  function summaryStringField(jsonPath) {
433
434
  return `CASE WHEN json_type(data, '${jsonPath}') = 'text' THEN substr(json_extract(data, '${jsonPath}'), 1, ${RAW_SUMMARY_ARG_MAX_CHARS}) END`;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getTokenEstimatorFingerprint,
3
3
  estimateTokens
4
- } from "./index-wt7vmyj4.js";
4
+ } from "./index-000fthre.js";
5
5
  import {
6
6
  getHarness2
7
7
  } from "./index-0h2mkab2.js";
@@ -10,10 +10,10 @@ import {
10
10
  } from "./index-gymgz20n.js";
11
11
  import {
12
12
  isSynapseEmbeddingTruncated
13
- } from "./index-rzfr7wdv.js";
13
+ } from "./index-gwvahsdz.js";
14
14
  import {
15
15
  messageFtsOrdinalRangeIsMapped2
16
- } from "./index-ck8wj35v.js";
16
+ } from "./index-bbbp8zs1.js";
17
17
  import {
18
18
  isKnownAutocommit
19
19
  } from "./index-nrzkqte4.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  piModelRefToCanonical
3
- } from "./index-ccanzg8p.js";
3
+ } from "./index-gzk7d940.js";
4
4
  import {
5
5
  getHarness2
6
6
  } from "./index-0h2mkab2.js";
@@ -39,15 +39,15 @@ import {
39
39
  expandToolPart,
40
40
  visitRawSessionMessages2,
41
41
  readRawSessionMessageById2
42
- } from "./index-mx757f3g.js";
42
+ } from "./index-7esg5v2x.js";
43
43
  import {
44
44
  isRecord,
45
45
  providerVisibleMessage,
46
46
  getTagById2
47
- } from "./index-pwp6zyx3.js";
47
+ } from "./index-zchc0df8.js";
48
48
  import {
49
49
  estimateTokens
50
- } from "./index-wt7vmyj4.js";
50
+ } from "./index-000fthre.js";
51
51
  import {
52
52
  prepareCachedStatement2,
53
53
  withSqliteBackgroundWriter2,
@@ -64,17 +64,17 @@ import {
64
64
  import {
65
65
  isPidAlive,
66
66
  readProcessStartTime
67
- } from "./index-a7sj2bam.js";
67
+ } from "./index-wwf9vxpf.js";
68
68
  import {
69
69
  gaDatabasePath2,
70
70
  V2StoreReader2
71
71
  } from "./index-ea37qn4x.js";
72
72
  import {
73
73
  deleteUnmappedMessageFtsRows2
74
- } from "./index-ck8wj35v.js";
74
+ } from "./index-bbbp8zs1.js";
75
75
  import {
76
76
  deleteChunkEmbedBackoffForSession2
77
- } from "./index-f9qet7y8.js";
77
+ } from "./index-4sa1rx3h.js";
78
78
  import {
79
79
  invalidateAutoEmbedSession,
80
80
  drainBackgroundBatches
@@ -4,7 +4,7 @@ import {
4
4
  renderToolTemplate,
5
5
  resolveModelConfigValue,
6
6
  deriveDefaultProtectedTokens
7
- } from "./index-ccanzg8p.js";
7
+ } from "./index-gzk7d940.js";
8
8
  import {
9
9
  getHarness2,
10
10
  harnessOwnsOpenCodeStore2
@@ -23,7 +23,7 @@ import {
23
23
  TAG_SELECT_COLUMNS2,
24
24
  getCandidateToolOwners2,
25
25
  pickNearestPriorOwner2
26
- } from "./index-pwp6zyx3.js";
26
+ } from "./index-zchc0df8.js";
27
27
  import {
28
28
  OMO_INTERNAL_INITIATOR_MARKER,
29
29
  isSystemDirective,
@@ -39,7 +39,7 @@ import {
39
39
  formatBlock,
40
40
  compactTextForSummary,
41
41
  mergeCommitHashes
42
- } from "./index-wt7vmyj4.js";
42
+ } from "./index-000fthre.js";
43
43
  import {
44
44
  Database2,
45
45
  prepareCachedStatement2
@@ -71,7 +71,7 @@ import {
71
71
  hasRawSessionMessageByIdFromDb2,
72
72
  readRawSeedTailFromDb2,
73
73
  readRawSessionBoundaryEndpointsFromDb2
74
- } from "./index-c1dqxr10.js";
74
+ } from "./index-3g9fnq6y.js";
75
75
  import {
76
76
  markHostUnservedRow,
77
77
  isHostUnservedRow
@@ -219,6 +219,9 @@ function detectLatestTurnThinkingMismatch(error) {
219
219
  }
220
220
  var PREFIX_BOUND_THINKING_MODELS = [
221
221
  ["fable", 5, 1],
222
+ ["fable", 5, 2],
223
+ ["mythos", 5, 1],
224
+ ["mythos", 5, 2],
222
225
  ["opus", 5, 5],
223
226
  ["sonnet", 5, 5],
224
227
  ["haiku", 5, 5]
@@ -5,7 +5,7 @@ import {
5
5
  } from "./index-2qtx0q6h.js";
6
6
  import {
7
7
  runSessionWarmupWorker
8
- } from "./index-c1dqxr10.js";
8
+ } from "./index-3g9fnq6y.js";
9
9
  import {
10
10
  logSlowWriteTransaction
11
11
  } from "./index-0wtm7g7f.js";
@@ -6,16 +6,16 @@ import {
6
6
  removeNestedBlocks,
7
7
  hasMeaningfulUserText2,
8
8
  extractTexts2
9
- } from "./index-wt7vmyj4.js";
9
+ } from "./index-000fthre.js";
10
10
  import {
11
11
  cleanUserText2
12
- } from "./index-mx757f3g.js";
12
+ } from "./index-7esg5v2x.js";
13
13
  import {
14
14
  recordMessageFtsRowid2,
15
15
  recordIndexedMessageTime2,
16
16
  messageFtsOrdinalRangeIsMapped2,
17
17
  deleteUnmappedMessageFtsRows2
18
- } from "./index-ck8wj35v.js";
18
+ } from "./index-bbbp8zs1.js";
19
19
  import {
20
20
  logSlowWriteTransaction
21
21
  } from "./index-0wtm7g7f.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  estimateTokens
3
- } from "./index-wt7vmyj4.js";
3
+ } from "./index-000fthre.js";
4
4
  import {
5
5
  getHarness2
6
6
  } from "./index-0h2mkab2.js";
@@ -6832,7 +6832,7 @@ var MagicContextConfigSchema = object({
6832
6832
  enabled: boolean2().default(true).describe("Enable smart-note authoring and condition evaluation. Needs a runnable dreamer, which evaluates the conditions: with dreamer.disable true (or no dreamer block) ctx_note offers no surface_condition whatever this says. User-level only: tool definitions are process-wide. Changes require a host restart and rebuild each session's cached prompt once. Pending notes remain stored and unchecked; already-ready notes still surface."),
6833
6833
  retina_handoff: boolean2().default(false).describe("When true, dreamer skips smart notes whose surface conditions compiled to retina provider configs at authoring time. Default false keeps both paths active until the retina consumer is deployed.")
6834
6834
  }).default({ enabled: true, retina_handoff: false }).describe("Smart-note ownership transition controls."),
6835
- cache_ttl: union([string2(), object({ default: string2() }).catchall(string2())]).default("5m").describe(`How long Magic Context assumes the provider's cached prefix stays valid. This is MC's own deferral gate — it does not change the provider's actual cache lifetime. String (e.g. "5m", "1h", "30s") or per-model object ({ default: "5m", "provider/model": "1h", "provider/*": "never" }); keys resolve most-specific first (exact provider/model, bare model ID, shorter dash-prefixes, then the provider/* wildcard, then default). User and project settings, including an explicit "5m" or object default, apply on the next pass. Only built-in defaults are frozen per session, including across restarts: when unset, GPT-5.6 and later (including gpt-6*, through any provider prefix) use 30m, other models use 5m. /ctx-status shows the effective TTL and whether it comes from your config or a frozen built-in default. Editing the TTL does not itself rewrite prompt bytes; a lowered TTL rebuilds only after normal idle expiry. OpenAI documents at least 30 minutes since the latest write or reuse: https://developers.openai.com/api/docs/guides/prompt-caching (Cache lifetime and Summary of model differences). Set to "never" to mean MC never assumes expiry (for lanes kept warm externally by a cache-keep tool) — disables the idle-TTL heuristic so MC never initiates a rebuild based on elapsed time. Provider-side extended TTL is a separate request-level concern (cache_control: { ttl } in the request body).`),
6835
+ cache_ttl: union([string2(), object({ default: string2() }).catchall(string2())]).default("5m").describe(`How long Magic Context assumes the provider's cached prefix stays valid. It does not change the provider's actual cache lifetime, and it triggers no rebuild or fold: after an expiry the next request replays the same bytes. Magic Context uses it for diagnostics and, on OpenCode 2, to time an idle checkpoint in the host's session store (the experimental Rust transform still rebuilds on it). String (e.g. "5m", "1h", "30s") or per-model object ({ default: "5m", "provider/model": "1h", "provider/*": "never" }); keys resolve most-specific first (exact provider/model, bare model ID, shorter dash-prefixes, then the provider/* wildcard, then default). User and project settings, including an explicit "5m" or object default, apply on the next pass. Only built-in defaults are frozen per session, including across restarts: when unset, GPT-5.6 and later (including gpt-6*, through any provider prefix) use 30m, other models use 5m. /ctx-status shows the effective TTL and whether it comes from your config or a frozen built-in default. Editing the TTL never rewrites prompt bytes. OpenAI documents at least 30 minutes since the latest write or reuse: https://developers.openai.com/api/docs/guides/prompt-caching (Cache lifetime and Summary of model differences). Set to "never" to mean MC never assumes expiry (for a provider cache that an external cache-keep tool keeps warm). Provider-side extended TTL is a separate request-level concern (cache_control: { ttl } in the request body).`),
6836
6836
  prompt_surface: PromptSurfaceConfigSchema.default({ default: "full" }).describe("Prompt-surface presets: default is full; models use bare model IDs, provider/model, or provider/* routing keys. Guidance and tool-description overrides are user-level only. OpenCode 1.x, Pi, and OMP register tool descriptions once per process (they follow the default preset). OpenCode 2 rewrites the five ctx_* descriptions per request from the draft model."),
6837
6837
  output_reserve: union([
6838
6838
  number2().min(0),
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  getTagsBySession2,
9
9
  getTagsByNumbers2
10
- } from "./index-pwp6zyx3.js";
10
+ } from "./index-zchc0df8.js";
11
11
  import {
12
12
  inRootAsyncContext2,
13
13
  getSqliteDatabasePath2,