@cortexkit/pi-magic-context 0.49.66 → 0.49.68

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 (26) hide show
  1. package/dist/auto-search-worker.js +1 -1
  2. package/dist/chunk-embedding-write-worker.js +1 -1
  3. package/dist/{index-thj34b3p.js → index-01xpfs6w.js} +4 -4
  4. package/dist/{index-xrhj81gf.js → index-2rqb9gs1.js} +1 -1
  5. package/dist/{index-3e0w4aa3.js → index-7qedjycm.js} +7 -7
  6. package/dist/{index-wxgfn7h9.js → index-979pfatc.js} +3 -3
  7. package/dist/{index-ndc0xtrh.js → index-f686v7vm.js} +1 -1
  8. package/dist/{index-5vqnvjb2.js → index-k6110hrj.js} +1 -1
  9. package/dist/{index-pehdap7a.js → index-n3msyfqa.js} +37 -4
  10. package/dist/{index-pvd2xhwy.js → index-sa8m6awf.js} +1 -1
  11. package/dist/{index-msp5k4hv.js → index-vn6dj2d3.js} +1 -1
  12. package/dist/{index-wdeb9me3.js → index-xgfh9h2j.js} +1 -1
  13. package/dist/index.js +25 -16
  14. package/dist/{message-index-bounded-53hv89kz.js → message-index-bounded-0zz16k8x.js} +3 -3
  15. package/dist/migration-worker.js +1 -1
  16. package/dist/raw-ordinal-warmup-worker.js +4 -4
  17. package/dist/{read-session-chunk-0bcnmmch.js → read-session-chunk-e6aztf4q.js} +2 -2
  18. package/dist/{render-ervyr738.js → render-3x6z4qxx.js} +5 -5
  19. package/dist/{search-btspay8j.js → search-3r76qtmk.js} +4 -4
  20. package/dist/{search-archive-2bh9j29f.js → search-archive-54jhedy7.js} +4 -4
  21. package/dist/{storage-tags-2j1zhtq7.js → storage-tags-vesdscgd.js} +1 -1
  22. package/dist/{store-0hhs1db3.js → store-grcwn6hs.js} +6 -3
  23. package/dist/subagent-entry.js +9 -9
  24. package/dist/tag-snapshot-worker-pi.js +3 -3
  25. package/dist/{v2-archive-reader-kxc3cdez.js → v2-archive-reader-06ny8gx4.js} +1 -1
  26. package/package.json +1 -1
@@ -31,7 +31,7 @@ serveWorkerJobs(async (initial, port) => {
31
31
  import("./embedding-cache-7rp4gqzr.js"),
32
32
  import("./storage-memory-0ndn65fm.js"),
33
33
  import("./project-embedding-registry-63wsm3a8.js"),
34
- import("./search-btspay8j.js"),
34
+ import("./search-3r76qtmk.js"),
35
35
  import("./compartment-chunk-embedding-avkyp2df.js"),
36
36
  import("./embedding-activity-ew6dshfd.js"),
37
37
  import("./harness-9872e0ym.js"),
@@ -35,7 +35,7 @@ import"./index-453s1hj6.js";
35
35
  import {
36
36
  LATEST_SUPPORTED_VERSION,
37
37
  enforceSchemaFence
38
- } from "./index-msp5k4hv.js";
38
+ } from "./index-vn6dj2d3.js";
39
39
  import"./index-3bb24eb6.js";
40
40
  import"./index-gavj3e6h.js";
41
41
  import"./index-jhmz9tgv.js";
@@ -138,10 +138,10 @@ async function serveV2ArchiveReads2(port, openConnections) {
138
138
  ] = await Promise.all([
139
139
  import("./sqlite-v89bj0yy.js"),
140
140
  import("./store-reader-mmfw2h48.js"),
141
- import("./store-0hhs1db3.js"),
142
- import("./read-session-chunk-0bcnmmch.js"),
143
- import("./render-ervyr738.js"),
144
- import("./search-archive-2bh9j29f.js"),
141
+ import("./store-grcwn6hs.js"),
142
+ import("./read-session-chunk-e6aztf4q.js"),
143
+ import("./render-3x6z4qxx.js"),
144
+ import("./search-archive-54jhedy7.js"),
145
145
  import("./expand-attachments-8sxeyj26.js")
146
146
  ]);
147
147
  const pool = new V2StoreReaderPool;
@@ -6,7 +6,7 @@ import {
6
6
  } from "./index-pefn1gt5.js";
7
7
  import {
8
8
  readRawSessionMessageIdOrdinalsForRange2
9
- } from "./index-5vqnvjb2.js";
9
+ } from "./index-k6110hrj.js";
10
10
 
11
11
  // ../plugin/src/tools/ctx-expand/search-archive.ts
12
12
  var archiveReadsOnThisThread = 0;
@@ -56,7 +56,7 @@ import {
56
56
  import {
57
57
  piHarnessKindFromExecutable,
58
58
  getErrorMessage
59
- } from "./index-msp5k4hv.js";
59
+ } from "./index-vn6dj2d3.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-wxgfn7h9.js";
73
+ } from "./index-979pfatc.js";
74
74
  import {
75
75
  getLastIndexedOrdinal
76
- } from "./index-pvd2xhwy.js";
76
+ } from "./index-sa8m6awf.js";
77
77
  import {
78
78
  TODO_STATUSES,
79
79
  TODO_PRIORITIES,
@@ -89,7 +89,7 @@ import {
89
89
  getCompactionMarkerPublicationState,
90
90
  compareAndSetCompactionMarkerPublicationState,
91
91
  getDeferredClearedCompactionMarkerState
92
- } from "./index-pehdap7a.js";
92
+ } from "./index-n3msyfqa.js";
93
93
  import {
94
94
  stableStringify,
95
95
  BoundedSessionMap
@@ -142,7 +142,7 @@ import {
142
142
  resolveMemoriesByIdsForSearch2,
143
143
  unifiedSearch2,
144
144
  formatSearchResults2
145
- } from "./index-ndc0xtrh.js";
145
+ } from "./index-f686v7vm.js";
146
146
  import {
147
147
  resolveOpenCodeDbPath,
148
148
  assertOpenCodeStoreGeneration
@@ -151,7 +151,7 @@ import {
151
151
  hasRawMessageProvider2,
152
152
  setRawMessageProvider2,
153
153
  readSessionChunk2
154
- } from "./index-5vqnvjb2.js";
154
+ } from "./index-k6110hrj.js";
155
155
  import {
156
156
  resolveWorkspaceShareCategories,
157
157
  resolveWorkspaceIdentitySet,
@@ -184,7 +184,7 @@ import {
184
184
  } from "./index-3s39a1md.js";
185
185
  import {
186
186
  renderSearchArchive2
187
- } from "./index-xrhj81gf.js";
187
+ } from "./index-2rqb9gs1.js";
188
188
  import {
189
189
  computeNormalizedHash
190
190
  } from "./index-9x1f96r8.js";
@@ -40,7 +40,7 @@ import {
40
40
  serializeProcessedImageMarkers,
41
41
  getPendingPiCompactionMarkerState,
42
42
  logPiCompactionMarkerClear
43
- } from "./index-pehdap7a.js";
43
+ } from "./index-n3msyfqa.js";
44
44
  import {
45
45
  estimateTokens
46
46
  } from "./index-pefn1gt5.js";
@@ -61,13 +61,13 @@ import {
61
61
  import {
62
62
  isPidAlive,
63
63
  readProcessStartTime
64
- } from "./index-msp5k4hv.js";
64
+ } from "./index-vn6dj2d3.js";
65
65
  import {
66
66
  withReadOnlySessionDb,
67
67
  expandToolPart,
68
68
  visitRawSessionMessages2,
69
69
  readRawSessionMessageById2
70
- } from "./index-5vqnvjb2.js";
70
+ } from "./index-k6110hrj.js";
71
71
  import {
72
72
  gaDatabasePath2,
73
73
  V2StoreReader2
@@ -91,7 +91,7 @@ import {
91
91
  clearIndexedMessages,
92
92
  indexSingleMessage,
93
93
  indexMessagesAfterOrdinal
94
- } from "./index-pvd2xhwy.js";
94
+ } from "./index-sa8m6awf.js";
95
95
  import {
96
96
  MESSAGE_FTS_SESSION_FILTER_SQL,
97
97
  withMessageFtsSessionFilter
@@ -39,7 +39,7 @@ import {
39
39
  providerVisiblePart,
40
40
  getCandidateToolOwners2,
41
41
  pickNearestPriorOwner2
42
- } from "./index-pehdap7a.js";
42
+ } from "./index-n3msyfqa.js";
43
43
  import {
44
44
  OMO_INTERNAL_INITIATOR_MARKER,
45
45
  isSystemDirective,
@@ -1343,8 +1343,9 @@ function estimateImageTokensFromDataUrl(url) {
1343
1343
  const comma = url.indexOf(",");
1344
1344
  if (comma < 0)
1345
1345
  return IMAGE_FALLBACK_TOKENS;
1346
- const header = url.slice(0, comma);
1347
- const payload = url.slice(comma + 1);
1346
+ return estimateImageTokensFromBase64(url.slice(0, comma), url.slice(comma + 1));
1347
+ }
1348
+ function estimateImageTokensFromBase64(header, payload) {
1348
1349
  const sliceLen = Math.min(512, payload.length);
1349
1350
  const preview = payload.slice(0, sliceLen);
1350
1351
  let bytes;
@@ -1353,12 +1354,15 @@ function estimateImageTokensFromDataUrl(url) {
1353
1354
  } catch {
1354
1355
  return IMAGE_FALLBACK_TOKENS;
1355
1356
  }
1357
+ return estimateImageTokensFromHeader(header, bytes, () => createBase64ByteReader(payload, bytes));
1358
+ }
1359
+ function estimateImageTokensFromHeader(header, bytes, jpegReader) {
1356
1360
  if (header.includes("image/png")) {
1357
1361
  const dims = parsePngDimensions(bytes);
1358
1362
  if (dims)
1359
1363
  return clampImageTokens(Math.ceil(dims.w * dims.h / IMAGE_TOKEN_DIVISOR));
1360
1364
  } else if (header.includes("image/jpeg") || header.includes("image/jpg")) {
1361
- const dims = parseJpegDimensions(createBase64ByteReader(payload, bytes));
1365
+ const dims = parseJpegDimensions(jpegReader());
1362
1366
  if (dims)
1363
1367
  return clampImageTokens(Math.ceil(dims.w * dims.h / IMAGE_TOKEN_DIVISOR));
1364
1368
  } else if (header.includes("image/webp")) {
@@ -1372,6 +1376,33 @@ function estimateImageTokensFromDataUrl(url) {
1372
1376
  }
1373
1377
  return IMAGE_FALLBACK_TOKENS;
1374
1378
  }
1379
+ function nativeMediaImage(part) {
1380
+ if (part.type !== "media" || !isRecord(part.media))
1381
+ return;
1382
+ const { mediaType, source } = part.media;
1383
+ if (typeof mediaType !== "string" || !mediaType.startsWith("image/"))
1384
+ return;
1385
+ let inline;
1386
+ if (isRecord(source)) {
1387
+ const { type, data } = source;
1388
+ if (type === "base64" && typeof data === "string" && data.length > 0)
1389
+ inline = data;
1390
+ if (type === "bytes" && data instanceof Uint8Array && data.byteLength > 0)
1391
+ inline = data;
1392
+ }
1393
+ return { mediaType, inline };
1394
+ }
1395
+ function estimateNativeMediaImageTokens(part) {
1396
+ const image = nativeMediaImage(part);
1397
+ if (!image)
1398
+ return 0;
1399
+ const { mediaType, inline } = image;
1400
+ if (typeof inline === "string")
1401
+ return estimateImageTokensFromBase64(mediaType, inline);
1402
+ if (inline)
1403
+ return estimateImageTokensFromHeader(mediaType, inline, () => (i) => inline[i]);
1404
+ return IMAGE_FALLBACK_TOKENS;
1405
+ }
1375
1406
  function estimateToolAttachmentImageTokens(state) {
1376
1407
  if (!state || typeof state !== "object")
1377
1408
  return 0;
@@ -2943,11 +2974,13 @@ function opaqueThinkingCost(reasoning, output) {
2943
2974
  // ../plugin/src/hooks/magic-context/final-wire-token-estimate.ts
2944
2975
  var wireTextTokens = createTokenCountMemo(1e5, 128 * 1024 * 1024);
2945
2976
  function estimatePartImageTokens(raw) {
2946
- if (!raw || typeof raw !== "object")
2977
+ if (!isRecord(raw))
2947
2978
  return 0;
2948
2979
  const part = raw;
2949
2980
  if (part.ignored)
2950
2981
  return 0;
2982
+ if (part.type === "media")
2983
+ return estimateNativeMediaImageTokens(raw);
2951
2984
  if (part.type === "file" && part.mime?.startsWith("image/")) {
2952
2985
  return typeof part.url === "string" && part.url.startsWith("data:") ? estimateImageTokensFromDataUrl(part.url) : 1200;
2953
2986
  }
@@ -9,7 +9,7 @@ import {
9
9
  } from "./index-pefn1gt5.js";
10
10
  import {
11
11
  cleanUserText2
12
- } from "./index-5vqnvjb2.js";
12
+ } from "./index-k6110hrj.js";
13
13
  import {
14
14
  recordMessageFtsRowid2,
15
15
  recordIndexedMessageTime2,
@@ -1787,7 +1787,7 @@ function finishDatabaseOpen(db, dbPath, explicitDbPath, latestSupportedVersion)
1787
1787
  state.running = startMessageFtsRowidMapBackfill2(db, signal).then(async () => {
1788
1788
  if (signal.aborted || !readsOpenCodeStore)
1789
1789
  return;
1790
- const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-0bcnmmch.js"));
1790
+ const { readRawSessionMessagePage, readRawSessionMessages } = await importPluginModule(() => import("./read-session-chunk-e6aztf4q.js"));
1791
1791
  const { startMessageTimeBackfill } = await importPluginModule(() => import("./message-time-backfill-8zwv9byv.js"));
1792
1792
  if (signal.aborted)
1793
1793
  return;
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  getTagsBySession2,
9
9
  getTagsByNumbers2
10
- } from "./index-pehdap7a.js";
10
+ } from "./index-n3msyfqa.js";
11
11
  import {
12
12
  inRootAsyncContext2,
13
13
  getSqliteDatabasePath2,
package/dist/index.js CHANGED
@@ -158,7 +158,7 @@ import {
158
158
  registerTodoStateLifecycle,
159
159
  syncCtxMemoryToolEnabled,
160
160
  registerMagicContextTools
161
- } from "./index-3e0w4aa3.js";
161
+ } from "./index-7qedjycm.js";
162
162
  import"./index-4knyh1kt.js";
163
163
  import {
164
164
  canonicalModelIdentity,
@@ -409,7 +409,7 @@ import {
409
409
  setSessionWorkMetrics,
410
410
  getSessionWorkMetrics,
411
411
  resolveEpochFloorForPass
412
- } from "./index-pehdap7a.js";
412
+ } from "./index-n3msyfqa.js";
413
413
  import {
414
414
  textMentionsRecentCommit,
415
415
  hasMeaningfulUserText2,
@@ -460,7 +460,7 @@ import {
460
460
  openCurrentDatabase,
461
461
  openDatabaseAsync,
462
462
  closeDatabase
463
- } from "./index-msp5k4hv.js";
463
+ } from "./index-vn6dj2d3.js";
464
464
  import {
465
465
  LkgRecoveryFenceError,
466
466
  clearLkgFenceProcessState,
@@ -586,7 +586,7 @@ import {
586
586
  getSourceContents,
587
587
  recordSubagentInvocation,
588
588
  getLatestHistorianInvocationId
589
- } from "./index-wxgfn7h9.js";
589
+ } from "./index-979pfatc.js";
590
590
  import {
591
591
  resolveOpenCodeDbPath,
592
592
  assertOpenCodeStoreGeneration,
@@ -652,7 +652,7 @@ import {
652
652
  getRawSessionTagKeysThrough2,
653
653
  getLegacyProtectedTailStartOrdinal2,
654
654
  readSessionChunk2
655
- } from "./index-5vqnvjb2.js";
655
+ } from "./index-k6110hrj.js";
656
656
  import"./index-nvh6d3bz.js";
657
657
  import {
658
658
  formatSynapseLaneDescriptor
@@ -692,7 +692,7 @@ import {
692
692
  clearCompressionDepthRange,
693
693
  cleanSearchText,
694
694
  matchedSearchSnippet
695
- } from "./index-pvd2xhwy.js";
695
+ } from "./index-sa8m6awf.js";
696
696
  import {
697
697
  rememberV1HiddenRun
698
698
  } from "./index-6x556c2q.js";
@@ -821,7 +821,7 @@ import {
821
821
  scheduleClearAndReindex,
822
822
  clearSessionTracking,
823
823
  createAutoSearchDiagnostics
824
- } from "./index-ndc0xtrh.js";
824
+ } from "./index-f686v7vm.js";
825
825
  import"./index-3s39a1md.js";
826
826
  import {
827
827
  DREAMER_PRIMER_INVESTIGATOR_ALLOWED_TOOLS,
@@ -850,11 +850,11 @@ import {
850
850
  drainPiTagSnapshotSession,
851
851
  assertPiTagSnapshotReady,
852
852
  ensurePiTagSnapshotReady
853
- } from "./index-wdeb9me3.js";
853
+ } from "./index-xgfh9h2j.js";
854
854
  import"./index-71rg8j43.js";
855
855
  import"./index-8d2z6503.js";
856
- import"./index-thj34b3p.js";
857
- import"./index-xrhj81gf.js";
856
+ import"./index-01xpfs6w.js";
857
+ import"./index-2rqb9gs1.js";
858
858
  import {
859
859
  __toESM
860
860
  } from "./index-22jkk6wg.js";
@@ -3606,7 +3606,7 @@ function startHostStallProfilerSwitch() {
3606
3606
  // package.json
3607
3607
  var package_default = {
3608
3608
  name: "@cortexkit/pi-magic-context",
3609
- version: "0.49.66",
3609
+ version: "0.49.68",
3610
3610
  type: "module",
3611
3611
  description: "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
3612
3612
  main: "dist/index.js",
@@ -39176,6 +39176,8 @@ function piToolCallWireId(id, model, source) {
39176
39176
  var dateReminderPlans = new WeakMap;
39177
39177
  var MAX_MESSAGES = 1e5;
39178
39178
  var ORPHAN_NOTE = Symbol("prepared orphan tool result");
39179
+ var ORPHAN_NOTE_ALTERNATIVES = Symbol("prepared orphan tool result variants");
39180
+ var OMP_PROVIDER_ERROR_REPLAY_TEXT = "Tool call was not executed because the provider stream ended with an error before the tool could run.";
39179
39181
  var rowDiagnostics = new WeakMap;
39180
39182
  var preparedSources = new WeakMap;
39181
39183
  var ANTHROPIC_CONTINUE_PAD_TEXT = "Continue.";
@@ -39226,6 +39228,9 @@ function messageStructure(value) {
39226
39228
  if (message.content.length > 32 * 1024 * 1024)
39227
39229
  return;
39228
39230
  row.exactText = message.content;
39231
+ const alternatives = Reflect.get(message, ORPHAN_NOTE_ALTERNATIVES);
39232
+ if (Array.isArray(alternatives))
39233
+ row.exactTextAlternatives = alternatives;
39229
39234
  }
39230
39235
  if (typeof message.timestamp === "number")
39231
39236
  row.timestamp = message.timestamp;
@@ -39456,15 +39461,19 @@ function projectMissingToolResults(messages, model, host = "omp") {
39456
39461
  if (!parts.length)
39457
39462
  continue;
39458
39463
  const error = message.isError ? ' is-error="true"' : "";
39459
- const note = `<stale-tool-result tool="${message.toolName}" id="${message.toolCallId}"${error}>
39460
- ${parts.join(`
39461
- `)}
39464
+ const staleNote = (text) => `<stale-tool-result tool="${message.toolName}" id="${message.toolCallId}"${error}>
39465
+ ${text}
39462
39466
  </stale-tool-result>`;
39467
+ const note = staleNote(parts.join(`
39468
+ `));
39469
+ const details = object11(message.details);
39470
+ const replayNote = details?.__synthetic === true && details.source === "assistant_stop_error" ? staleNote(OMP_PROVIDER_ERROR_REPLAY_TEXT) : undefined;
39463
39471
  projected.push({
39464
39472
  role: "user",
39465
39473
  content: api === "ollama-chat" ? note : new TextDecoder().decode(new TextEncoder().encode(note)),
39466
39474
  timestamp: message.timestamp,
39467
- [ORPHAN_NOTE]: true
39475
+ [ORPHAN_NOTE]: true,
39476
+ ...replayNote !== undefined && replayNote !== note ? { [ORPHAN_NOTE_ALTERNATIVES]: [replayNote] } : {}
39468
39477
  });
39469
39478
  }
39470
39479
  flush();
@@ -40484,7 +40493,7 @@ function preparedStructureMismatch(payload, prepared, onImageTrim, reminders, re
40484
40493
  if (expected.exactText !== undefined || expected.exactImages !== undefined) {
40485
40494
  if (actual.wireRole !== "user")
40486
40495
  return "role";
40487
- if (expected.exactText !== undefined && !matchesUserText(actual.wireContent, expected.exactText, prepared?.api, responses, google || body.inferenceConfig !== undefined) || expected.exactImages !== undefined && !piMatchesChatImages(actual.wireContent, expected.exactImages))
40496
+ if (expected.exactText !== undefined && !matchesUserText(actual.wireContent, expected.exactText, prepared?.api, responses, google || body.inferenceConfig !== undefined) && !expected.exactTextAlternatives?.some((text) => matchesUserText(actual.wireContent, text, prepared?.api, responses, google || body.inferenceConfig !== undefined)) || expected.exactImages !== undefined && !piMatchesChatImages(actual.wireContent, expected.exactImages))
40488
40497
  return "content";
40489
40498
  }
40490
40499
  if (actual.calls.length !== expected.calls.length || actual.results.length !== expected.results.length)
@@ -3,7 +3,7 @@ import {
3
3
  withIndexChunk2,
4
4
  yieldIndexChunk2
5
5
  } from "./index-2qtx0q6h.js";
6
- import"./index-pehdap7a.js";
6
+ import"./index-n3msyfqa.js";
7
7
  import"./index-pefn1gt5.js";
8
8
  import"./index-0h2mkab2.js";
9
9
  import"./index-tm11k42a.js";
@@ -15,7 +15,7 @@ import"./index-wfqysrwq.js";
15
15
  import"./index-x2n261wp.js";
16
16
  import"./index-xjhq27z9.js";
17
17
  import"./index-n0zjvs3h.js";
18
- import"./index-5vqnvjb2.js";
18
+ import"./index-k6110hrj.js";
19
19
  import"./index-6x556c2q.js";
20
20
  import {
21
21
  MESSAGE_INDEX_MAX_FTS_BYTES,
@@ -24,7 +24,7 @@ import {
24
24
  markMessageIndexDirty,
25
25
  getIndexableContent,
26
26
  indexSingleMessage
27
- } from "./index-pvd2xhwy.js";
27
+ } from "./index-sa8m6awf.js";
28
28
  import"./index-ghp32f9m.js";
29
29
  import"./index-1ts77n1b.js";
30
30
 
@@ -17,7 +17,7 @@ import"./index-453s1hj6.js";
17
17
  import {
18
18
  setSqlitePragmaConfig,
19
19
  initializeDatabase
20
- } from "./index-msp5k4hv.js";
20
+ } from "./index-vn6dj2d3.js";
21
21
  import"./index-fapenpch.js";
22
22
  import"./index-3bb24eb6.js";
23
23
  import"./index-8sqebjzk.js";
@@ -19,7 +19,7 @@ serveWorkerJobs(async (input, port) => {
19
19
  await main();
20
20
  async function main() {
21
21
  if (input.v2ArchiveReader) {
22
- const { serveV2ArchiveReads } = await import("./v2-archive-reader-kxc3cdez.js");
22
+ const { serveV2ArchiveReads } = await import("./v2-archive-reader-06ny8gx4.js");
23
23
  await serveV2ArchiveReads(port, openConnections);
24
24
  return;
25
25
  }
@@ -51,7 +51,7 @@ serveWorkerJobs(async (input, port) => {
51
51
  await runMessageFtsRowidMapBackfill(db);
52
52
  reply = { kind: "fts-rowid-backfill" };
53
53
  } else if (input.searchArchive) {
54
- const { renderSearchArchive } = await import("./search-archive-2bh9j29f.js");
54
+ const { renderSearchArchive } = await import("./search-archive-54jhedy7.js");
55
55
  const { readRawSessionMessageIdOrdinalsForRangeFromDb } = await import("./read-session-raw-0tytrjye.js");
56
56
  const archive = input.searchArchive;
57
57
  let raw;
@@ -81,7 +81,7 @@ serveWorkerJobs(async (input, port) => {
81
81
  const { setHarness } = await import("./harness-9872e0ym.js");
82
82
  setHarness(input.harness ?? "opencode");
83
83
  const [{ indexMessageInShortChunks }, { configureContextDatabasePragmas }] = await Promise.all([
84
- import("./message-index-bounded-53hv89kz.js"),
84
+ import("./message-index-bounded-0zz16k8x.js"),
85
85
  import("./sqlite-context-pragmas-gcgch6qz.js")
86
86
  ]);
87
87
  configureContextDatabasePragmas(db);
@@ -95,7 +95,7 @@ serveWorkerJobs(async (input, port) => {
95
95
  measurements: result.measurements
96
96
  };
97
97
  } else if (input.tagRatio !== undefined) {
98
- const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-2j1zhtq7.js");
98
+ const { scanTagOwnerSummary, scanTagOwnerDelta } = await import("./storage-tags-vesdscgd.js");
99
99
  const delta = input.tagState ? scanTagOwnerDelta(db, input.sessionId, input.tagState) : null;
100
100
  if (delta)
101
101
  reply = { kind: "tag-delta", delta };
@@ -38,8 +38,8 @@ import {
38
38
  readSessionChunk2,
39
39
  getRawSessionMessageIdsThrough2,
40
40
  readRawSessionSeedTail2
41
- } from "./index-5vqnvjb2.js";
42
- import"./index-pehdap7a.js";
41
+ } from "./index-k6110hrj.js";
42
+ import"./index-n3msyfqa.js";
43
43
  import"./index-6x556c2q.js";
44
44
  import"./index-vcegxfwg.js";
45
45
  import"./index-jhmz9tgv.js";
@@ -3,18 +3,18 @@ import {
3
3
  renderVerboseRange2,
4
4
  renderVerboseRangeForTool2,
5
5
  renderItemByTag2
6
- } from "./index-wxgfn7h9.js";
6
+ } from "./index-979pfatc.js";
7
7
  import"./index-k7a8x7ba.js";
8
- import"./index-pvd2xhwy.js";
8
+ import"./index-sa8m6awf.js";
9
9
  import"./index-hgd00nas.js";
10
10
  import"./index-nvh6d3bz.js";
11
11
  import"./index-cxczethe.js";
12
- import"./index-5vqnvjb2.js";
13
- import"./index-pehdap7a.js";
12
+ import"./index-k6110hrj.js";
13
+ import"./index-n3msyfqa.js";
14
14
  import"./index-6x556c2q.js";
15
15
  import"./index-5rcjs14a.js";
16
16
  import"./index-vcegxfwg.js";
17
- import"./index-msp5k4hv.js";
17
+ import"./index-vn6dj2d3.js";
18
18
  import"./index-fapenpch.js";
19
19
  import"./index-gavj3e6h.js";
20
20
  import"./index-135e8hvg.js";
@@ -5,9 +5,9 @@ import {
5
5
  resolveMemoriesByIdsForSearch2,
6
6
  unifiedSearch2,
7
7
  formatSearchResults2
8
- } from "./index-ndc0xtrh.js";
8
+ } from "./index-f686v7vm.js";
9
9
  import"./index-k7a8x7ba.js";
10
- import"./index-pvd2xhwy.js";
10
+ import"./index-sa8m6awf.js";
11
11
  import"./index-8d2z6503.js";
12
12
  import"./index-qdy49kwk.js";
13
13
  import"./index-29nw7n1r.js";
@@ -17,8 +17,8 @@ import"./index-hgd00nas.js";
17
17
  import"./index-yhzhdp3m.js";
18
18
  import"./index-79xfn84y.js";
19
19
  import"./index-cxczethe.js";
20
- import"./index-5vqnvjb2.js";
21
- import"./index-pehdap7a.js";
20
+ import"./index-k6110hrj.js";
21
+ import"./index-n3msyfqa.js";
22
22
  import"./index-6x556c2q.js";
23
23
  import"./index-txcs0vnj.js";
24
24
  import"./index-5rcjs14a.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  renderSearchArchive2
3
- } from "./index-xrhj81gf.js";
4
- import"./index-thj34b3p.js";
3
+ } from "./index-2rqb9gs1.js";
4
+ import"./index-01xpfs6w.js";
5
5
  import"./index-8d2z6503.js";
6
- import"./index-5vqnvjb2.js";
7
- import"./index-pehdap7a.js";
6
+ import"./index-k6110hrj.js";
7
+ import"./index-n3msyfqa.js";
8
8
  import"./index-6x556c2q.js";
9
9
  import"./index-vcegxfwg.js";
10
10
  import"./index-jhmz9tgv.js";
@@ -62,7 +62,7 @@ import {
62
62
  adoptNullOwnerToolTag2,
63
63
  getCandidateToolOwners2,
64
64
  pickNearestPriorOwner2
65
- } from "./index-pehdap7a.js";
65
+ } from "./index-n3msyfqa.js";
66
66
  import"./index-vcegxfwg.js";
67
67
  import"./index-jhmz9tgv.js";
68
68
  import"./index-1ts77n1b.js";
@@ -115,9 +115,12 @@ function restoreRow(row, model, media) {
115
115
  }
116
116
  if (row.type === "system")
117
117
  return [{ role: "system", content: [{ type: "text", text: data.text ?? "" }] }];
118
- if (row.type === "synthetic" && isStorageNoticeText(data.text))
119
- return [];
120
- if (["synthetic", "skill"].includes(row.type))
118
+ if (row.type === "synthetic") {
119
+ if (isStorageNoticeText(data.text))
120
+ return [];
121
+ return [make("user", [{ type: "text", text: data.text ?? "", synthetic: true }])];
122
+ }
123
+ if (row.type === "skill")
121
124
  return [make("user", [{ type: "text", text: data.text ?? "" }])];
122
125
  if (row.type === "location-switched")
123
126
  return [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TOKEN_BUDGET_TOOL_REFUSAL
3
- } from "./index-5vqnvjb2.js";
3
+ } from "./index-k6110hrj.js";
4
4
  import {
5
5
  setHarness2
6
6
  } from "./index-0h2mkab2.js";
@@ -14,7 +14,7 @@ import {
14
14
  import"./index-2qtx0q6h.js";
15
15
  import {
16
16
  openDatabase
17
- } from "./index-msp5k4hv.js";
17
+ } from "./index-vn6dj2d3.js";
18
18
  import"./index-fapenpch.js";
19
19
  import"./index-3bb24eb6.js";
20
20
  import"./index-8sqebjzk.js";
@@ -34,7 +34,7 @@ import {
34
34
  resolvePiHarnessKind,
35
35
  reportSubagentStartupError,
36
36
  registerMagicContextTools
37
- } from "./index-3e0w4aa3.js";
37
+ } from "./index-7qedjycm.js";
38
38
  import"./index-vcegxfwg.js";
39
39
  import"./index-5rcjs14a.js";
40
40
  import"./index-cxczethe.js";
@@ -45,17 +45,17 @@ import"./index-9p40dgkm.js";
45
45
  import"./index-79xfn84y.js";
46
46
  import"./index-yhzhdp3m.js";
47
47
  import"./index-qdy49kwk.js";
48
- import"./index-wxgfn7h9.js";
49
- import"./index-pvd2xhwy.js";
50
- import"./index-pehdap7a.js";
48
+ import"./index-979pfatc.js";
49
+ import"./index-sa8m6awf.js";
50
+ import"./index-n3msyfqa.js";
51
51
  import"./index-6x556c2q.js";
52
52
  import"./index-nvh6d3bz.js";
53
53
  import"./index-k7a8x7ba.js";
54
54
  import"./index-8d2z6503.js";
55
- import"./index-thj34b3p.js";
56
- import"./index-xrhj81gf.js";
55
+ import"./index-01xpfs6w.js";
56
+ import"./index-2rqb9gs1.js";
57
57
  import"./index-29nw7n1r.js";
58
- import"./index-ndc0xtrh.js";
58
+ import"./index-f686v7vm.js";
59
59
  import"./index-3s39a1md.js";
60
60
  import"./index-1ts77n1b.js";
61
61
  import {
@@ -8,7 +8,7 @@ import"./index-tm11k42a.js";
8
8
  import {
9
9
  LATEST_SUPPORTED_VERSION,
10
10
  getPersistedSchemaVersion
11
- } from "./index-msp5k4hv.js";
11
+ } from "./index-vn6dj2d3.js";
12
12
  import"./index-fapenpch.js";
13
13
  import"./index-3bb24eb6.js";
14
14
  import"./index-8sqebjzk.js";
@@ -28,14 +28,14 @@ import"./index-pefn1gt5.js";
28
28
  import {
29
29
  normalizeTagSnapshotRow2,
30
30
  TAG_SELECT_COLUMNS2
31
- } from "./index-pehdap7a.js";
31
+ } from "./index-n3msyfqa.js";
32
32
  import"./index-vcegxfwg.js";
33
33
  import {
34
34
  encodePiHydrationOperation,
35
35
  projectPiPassTag,
36
36
  PI_FALLBACK_ROW_COLUMNS,
37
37
  PI_FALLBACK_ROW_PREDICATE
38
- } from "./index-wdeb9me3.js";
38
+ } from "./index-xgfh9h2j.js";
39
39
  import"./index-1ts77n1b.js";
40
40
  import {
41
41
  serveWorkerJobs
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  readV2ArchiveOffThread2,
3
3
  serveV2ArchiveReads2
4
- } from "./index-thj34b3p.js";
4
+ } from "./index-01xpfs6w.js";
5
5
  import"./index-8sqebjzk.js";
6
6
  import"./index-2qtx0q6h.js";
7
7
  import"./index-x2n261wp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/pi-magic-context",
3
- "version": "0.49.66",
3
+ "version": "0.49.68",
4
4
  "type": "module",
5
5
  "description": "Pi and OMP coding agent extension for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",