@cortexkit/opencode-magic-context 0.49.82 → 0.49.84

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 (112) hide show
  1. package/dist/auto-search-worker.js +1 -1
  2. package/dist/chunk-embedding-write-worker.js +1 -1
  3. package/dist/{context-00f1hdz2.js → context-3sajdysh.js} +309 -98
  4. package/dist/{derive-budgets-2z6xxm7e.js → derive-budgets-0kcek5ex.js} +1 -1
  5. package/dist/features/magic-context/dreamer/map-memories-retry.d.ts +18 -0
  6. package/dist/features/magic-context/dreamer/map-memories-retry.d.ts.map +1 -0
  7. package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
  8. package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts +2 -0
  9. package/dist/features/magic-context/dreamer/retrospective-raw-provider.d.ts.map +1 -1
  10. package/dist/features/magic-context/dreamer/task-gates.d.ts +1 -1
  11. package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
  12. package/dist/features/magic-context/dreamer/task-registry.d.ts +7 -0
  13. package/dist/features/magic-context/dreamer/task-registry.d.ts.map +1 -1
  14. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +9 -0
  15. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  16. package/dist/features/magic-context/mural/render-trigger.d.ts +3 -3
  17. package/dist/features/magic-context/mural/render-trigger.d.ts.map +1 -1
  18. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  19. package/dist/{index-zzvd4a9z.js → index-05bm2ndp.js} +1 -1
  20. package/dist/{index-2xhzmwf6.js → index-0wehkw71.js} +5 -5
  21. package/dist/{index-zvane1rq.js → index-5wjv4c41.js} +1 -1
  22. package/dist/{index-twmeey4h.js → index-70cv85b0.js} +2 -2
  23. package/dist/{index-2q0t43fy.js → index-7j2zv9nm.js} +1 -1
  24. package/dist/{index-wxxcfpxh.js → index-cfy5k1pa.js} +6 -6
  25. package/dist/{index-b2787fk6.js → index-d028gmgp.js} +25 -9
  26. package/dist/{index-dg5jvh9r.js → index-k0jnsjcp.js} +3 -3
  27. package/dist/{index-nda0zgna.js → index-kknjvmpx.js} +2 -1
  28. package/dist/{index-tky3j43e.js → index-kthfyf45.js} +55 -11
  29. package/dist/{index-hz1xdb15.js → index-qybp04ff.js} +3 -3
  30. package/dist/{index-e21n48yd.js → index-rdh63md0.js} +23 -0
  31. package/dist/{index-x8qgqnym.js → index-skwwbcnv.js} +2 -2
  32. package/dist/{index-2ygw6q5s.js → index-szwrpyac.js} +2 -2
  33. package/dist/{index-eptthgkw.js → index-tqnvn9pa.js} +5 -5
  34. package/dist/{index-93rezfvc.js → index-tvbkemec.js} +37 -6
  35. package/dist/{index-rnyaa7cj.js → index-xd0ww0ns.js} +1 -1
  36. package/dist/{index-jvr9ba9y.js → index-xjfan0za.js} +210 -139
  37. package/dist/{index-y208s7zx.js → index-xrnhxkz7.js} +6 -1
  38. package/dist/index.js +21 -21
  39. package/dist/{message-index-bounded-cfkeyf72.js → message-index-bounded-6fr624zf.js} +3 -3
  40. package/dist/migration-worker.js +1 -1
  41. package/dist/raw-ordinal-warmup-worker.js +4 -4
  42. package/dist/{read-session-chunk-s3qac56g.js → read-session-chunk-6wedfths.js} +2 -2
  43. package/dist/{recomp-orchestrator-fjdp3t1d.js → recomp-orchestrator-m2s3jpvj.js} +9 -9
  44. package/dist/{render-c9fjwrad.js → render-p2j7rn9a.js} +7 -7
  45. package/dist/{search-archive-s2jas2jb.js → search-archive-hz9xh7nh.js} +4 -4
  46. package/dist/{search-1jejx5cx.js → search-ksx0f1qd.js} +5 -5
  47. package/dist/shared/models-dev-cache.d.ts +6 -1
  48. package/dist/shared/models-dev-cache.d.ts.map +1 -1
  49. package/dist/shared/test-git-env.d.ts +3 -0
  50. package/dist/shared/test-git-env.d.ts.map +1 -0
  51. package/dist/{storage-tags-6e83pvff.js → storage-tags-y2mrb8e6.js} +1 -1
  52. package/dist/{store-reader-tr64nxyy.js → store-reader-tsv1w4vt.js} +1 -1
  53. package/dist/{store-ggrq9e14.js → store-x0swqb5c.js} +2 -2
  54. package/dist/{task-config-t6bpyka7.js → task-config-qt6n4bxm.js} +1 -1
  55. package/dist/{transform-postprocess-phase-p2egg02g.js → transform-postprocess-phase-1wb2rrr1.js} +10 -10
  56. package/dist/v2/auto-search-worker.js +1 -1
  57. package/dist/v2/chunk-embedding-write-worker.js +3 -3
  58. package/dist/v2/{context-gwkgh0wd.js → context-at9nje0j.js} +711 -435
  59. package/dist/v2/{derive-budgets-2eam671q.js → derive-budgets-xbwcap8k.js} +2 -2
  60. package/dist/v2/fold/restore.d.ts.map +1 -1
  61. package/dist/v2/hooks/context.d.ts.map +1 -1
  62. package/dist/v2/hooks/revert-message-state.d.ts +12 -0
  63. package/dist/v2/hooks/revert-message-state.d.ts.map +1 -0
  64. package/dist/v2/hooks/storage-notice.d.ts +12 -6
  65. package/dist/v2/hooks/storage-notice.d.ts.map +1 -1
  66. package/dist/v2/{message-index-bounded-0xy4dn04.js → message-index-bounded-jqy7283g.js} +4 -4
  67. package/dist/v2/migration-worker.js +3 -3
  68. package/dist/v2/raw-ordinal-warmup-worker.js +4 -4
  69. package/dist/v2/{read-session-chunk-6mt2t6dy.js → read-session-chunk-n3nhfvd7.js} +3 -3
  70. package/dist/v2/{recomp-orchestrator-jn39mxh0.js → recomp-orchestrator-nhef90gc.js} +13 -13
  71. package/dist/v2/{render-q2aj9bgy.js → render-c9r2g2jv.js} +10 -10
  72. package/dist/v2/retrospective-raw-provider.d.ts.map +1 -1
  73. package/dist/v2/{search-archive-fj59gjv1.js → search-archive-80ckv9kq.js} +5 -5
  74. package/dist/v2/{search-9xn6ds9x.js → search-t06js5dc.js} +7 -7
  75. package/dist/v2/{server-2ktxmtbd.js → server-210rc0z9.js} +1 -1
  76. package/dist/v2/{server-2gcfmd47.js → server-2k8tkbhz.js} +2 -2
  77. package/dist/v2/{server-92g7d776.js → server-2kswss3d.js} +2 -1
  78. package/dist/v2/{server-c8mqs0v5.js → server-3cndh146.js} +10 -10
  79. package/dist/v2/{server-vt6nj2hn.js → server-3hhakg5a.js} +35 -19
  80. package/dist/v2/{server-53n8hv5q.js → server-863bwkga.js} +4 -4
  81. package/dist/v2/{server-5yfq912a.js → server-9nk5h6w6.js} +23 -0
  82. package/dist/v2/{server-xepx8t43.js → server-a2f1bhyj.js} +1 -1
  83. package/dist/v2/{server-r00xyx66.js → server-ap81bk3c.js} +28 -28
  84. package/dist/v2/{server-1efjj215.js → server-cce6m31c.js} +37 -6
  85. package/dist/v2/{server-2w1rdttn.js → server-dfesqfv1.js} +2 -2
  86. package/dist/v2/{server-569he5mh.js → server-hhw6rzsn.js} +1 -1
  87. package/dist/v2/{server-1cn3kryt.js → server-mr9rqn0y.js} +5 -5
  88. package/dist/v2/{server-g1a0nhtk.js → server-ry6rpspz.js} +4 -4
  89. package/dist/v2/{server-xdh4r20h.js → server-s15knz0w.js} +642 -627
  90. package/dist/v2/{server-0dmzr7f9.js → server-sxfbjdye.js} +2 -2
  91. package/dist/v2/{server-nqdzv8b7.js → server-sy98vksf.js} +55 -11
  92. package/dist/v2/{server-rp52f40v.js → server-w1jfaxas.js} +1 -1
  93. package/dist/v2/{server-bj779zmp.js → server-y4favn4d.js} +1 -1
  94. package/dist/v2/server.js +4 -4
  95. package/dist/v2/{storage-tags-z8j8wq34.js → storage-tags-xq81zgt2.js} +2 -2
  96. package/dist/v2/{store-qdgzd38f.js → store-h3s95ywe.js} +2 -2
  97. package/dist/v2/{store-reader-83tka051.js → store-reader-paamf0ac.js} +1 -1
  98. package/dist/v2/store-reader.d.ts +11 -0
  99. package/dist/v2/store-reader.d.ts.map +1 -1
  100. package/dist/v2/{task-config-7md27rx8.js → task-config-ex2vajr2.js} +1 -1
  101. package/dist/v2/{v2-archive-reader-9z8z97db.js → v2-archive-reader-1zzteaa5.js} +1 -1
  102. package/dist/v2/{wrapup-orchestrator-vd5zfp3v.js → wrapup-orchestrator-9y98qcqz.js} +13 -13
  103. package/dist/{v2-archive-reader-r0xpxsb1.js → v2-archive-reader-3yjxaj5z.js} +1 -1
  104. package/dist/{wrapup-orchestrator-k29zqfp9.js → wrapup-orchestrator-sa3a075a.js} +10 -10
  105. package/package.json +1 -1
  106. package/src/features/magic-context/dreamer/task-registry.ts +8 -0
  107. package/src/shared/models-dev-cache.ts +90 -21
  108. package/src/shared/reusable-worker.test.ts +31 -29
  109. package/src/shared/sqlite.test.ts +19 -6
  110. package/src/shared/test-db.test.ts +5 -3
  111. package/src/shared/test-git-env.test.ts +38 -0
  112. package/src/shared/test-git-env.ts +10 -0
@@ -68,7 +68,7 @@ import {
68
68
  getPendingPiCompactionMarkerState,
69
69
  logPiCompactionMarkerClear,
70
70
  isPrefixBoundThinkingModel
71
- } from "./index-y208s7zx.js";
71
+ } from "./index-xrnhxkz7.js";
72
72
  import {
73
73
  withReadOnlySessionDb
74
74
  } from "./index-x40zr813.js";
@@ -79,7 +79,7 @@ import {
79
79
  import {
80
80
  gaDatabasePath2,
81
81
  V2StoreReader2
82
- } from "./index-e21n48yd.js";
82
+ } from "./index-rdh63md0.js";
83
83
  import {
84
84
  markHostInstructionRow,
85
85
  hostInstructionRowID,
@@ -19,10 +19,10 @@ import {
19
19
  rawMessageWorkerSource2,
20
20
  rawMessageOffThreadRangeReader2,
21
21
  readRawSessionMessageIdOrdinalsForRange2
22
- } from "./index-2q0t43fy.js";
22
+ } from "./index-7j2zv9nm.js";
23
23
  import {
24
24
  readV2ArchiveOffThread2
25
- } from "./index-2xhzmwf6.js";
25
+ } from "./index-0wehkw71.js";
26
26
 
27
27
  // src/tools/ctx-expand/search-archive.ts
28
28
  var archiveReadsOnThisThread = 0;
@@ -9,7 +9,7 @@ import {
9
9
  getCompartments,
10
10
  getLastCompartmentEndMessage,
11
11
  requestPendingMaterialization
12
- } from "./index-x8qgqnym.js";
12
+ } from "./index-skwwbcnv.js";
13
13
  import {
14
14
  inRootAsyncContext2
15
15
  } from "./index-gzy5w8ya.js";
@@ -20,10 +20,10 @@ import {
20
20
  releaseWrapupInProgress,
21
21
  getHistorianFailureState,
22
22
  clearEmergencyRecovery
23
- } from "./index-y208s7zx.js";
23
+ } from "./index-xrnhxkz7.js";
24
24
  import {
25
25
  prepareRawSessionOrdinals2
26
- } from "./index-2q0t43fy.js";
26
+ } from "./index-7j2zv9nm.js";
27
27
  import {
28
28
  pushNotification2
29
29
  } from "./index-fzgyvsb1.js";
@@ -35,14 +35,14 @@ import {
35
35
  getActiveCompartmentRun,
36
36
  markActiveCompartmentRunPublished,
37
37
  registerActiveCompartmentRun
38
- } from "./index-b2787fk6.js";
38
+ } from "./index-d028gmgp.js";
39
39
  import {
40
40
  sendStatusNotification2
41
41
  } from "./index-g6hfh4h4.js";
42
42
  import {
43
43
  setRecompStarting2,
44
44
  setRecompTerminal2
45
- } from "./index-hz1xdb15.js";
45
+ } from "./index-qybp04ff.js";
46
46
 
47
47
  // src/hooks/magic-context/wrapup-orchestrator.ts
48
48
  import * as crypto from "node:crypto";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-wh9fxds5.js";
4
4
  import {
5
5
  RAW_MESSAGE_TYPES2
6
- } from "./index-e21n48yd.js";
6
+ } from "./index-rdh63md0.js";
7
7
  import {
8
8
  markHostUnservedRow
9
9
  } from "./index-s9x93tfs.js";
@@ -22,6 +22,12 @@ function formatStorageRecoveryNotice(hiddenWorkRecovered) {
22
22
  function isStorageNoticeText(text) {
23
23
  return typeof text === "string" && text.startsWith(STORAGE_NOTICE_PREFIX);
24
24
  }
25
+ function isStoredStorageNotice(row) {
26
+ return row.type === "synthetic" && isStorageNoticeText(row.data.text);
27
+ }
28
+ function isCopiedStorageNotice(row) {
29
+ return row !== null && isStoredStorageNotice(row) && /^msg_[A-Za-z0-9]+_\d+$/.test(row.id) && row.id.endsWith(`_${row.seq}`);
30
+ }
25
31
  function hasStorageNoticeShape(message) {
26
32
  if (message.role !== "user" || typeof message.id !== "string")
27
33
  return false;
@@ -30,12 +36,12 @@ function hasStorageNoticeShape(message) {
30
36
  const part = message.content[0];
31
37
  return part?.type === "text" && isStorageNoticeText(part.text);
32
38
  }
33
- async function dropStorageNotices(messages, isAdmittedSynthetic) {
39
+ async function dropStorageNotices(messages, isAdmittedSynthetic, isCopy = () => false) {
34
40
  const drop = new Set;
35
41
  for (const message of messages) {
36
- if (!hasStorageNoticeShape(message))
42
+ if (!message.id || !hasStorageNoticeShape(message))
37
43
  continue;
38
- if (await isAdmittedSynthetic(message.id))
44
+ if (await isAdmittedSynthetic(message.id) || isCopy(message.id))
39
45
  drop.add(message);
40
46
  }
41
47
  if (drop.size === 0)
@@ -44,6 +50,31 @@ async function dropStorageNotices(messages, isAdmittedSynthetic) {
44
50
  messages.splice(0, messages.length, ...kept);
45
51
  return drop.size;
46
52
  }
53
+ function storageNoticeHasNewInput(messages, idleSeq, sequenceOf) {
54
+ let idlessTool = false;
55
+ for (let i = messages.length - 1;i >= 0; i--) {
56
+ const message = messages[i];
57
+ if (message.role === "assistant") {
58
+ if (!idlessTool)
59
+ return false;
60
+ const owner = message.id ? sequenceOf(message.id) : undefined;
61
+ return owner === undefined || owner > idleSeq;
62
+ }
63
+ if (message.role !== "user" && message.role !== "tool")
64
+ continue;
65
+ if (!message.id) {
66
+ if (message.role === "user")
67
+ return true;
68
+ idlessTool = true;
69
+ continue;
70
+ }
71
+ const seq = sequenceOf(message.id);
72
+ if (seq === undefined || seq > idleSeq)
73
+ return true;
74
+ return idlessTool;
75
+ }
76
+ return idlessTool;
77
+ }
47
78
 
48
79
  // src/v2/fold/host-media.ts
49
80
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
@@ -245,7 +276,7 @@ function restoreRow(row, model, media = HOST_RESTORE_MEDIA) {
245
276
  if (row.type === "system")
246
277
  return [{ role: "system", content: [{ type: "text", text: data.text ?? "" }] }];
247
278
  if (row.type === "synthetic") {
248
- if (isStorageNoticeText(data.text))
279
+ if (isStoredStorageNotice(row))
249
280
  return [];
250
281
  return [make("user", [{ type: "text", text: data.text ?? "", synthetic: true }])];
251
282
  }
@@ -657,4 +688,4 @@ function createV2RawMessageProvider2(reader, sessionID) {
657
688
  };
658
689
  }
659
690
 
660
- export { STORAGE_NOTICE_PREFIX, formatStorageRefusalNotice, formatStorageRecoveryNotice, hasStorageNoticeShape, dropStorageNotices, rememberHostMedia, hostMediaAsset, hostMediaFromEncoded, HOST_RESTORE_MEDIA, restoreRow, isToolError, toolErrorText, toolStateContent, rawMessagePage2, readV2MessageRange2, iterateV2MessageRange2, servedBoundaryRow2, resolveV2BoundaryUserMessage2, readAllV2RawMessagesForConversion2, readV2RawMessagePagesForConversion2, createV2RawMessageReader2, createV2RawMessageProvider2 };
691
+ export { STORAGE_NOTICE_PREFIX, formatStorageRefusalNotice, formatStorageRecoveryNotice, isCopiedStorageNotice, hasStorageNoticeShape, dropStorageNotices, storageNoticeHasNewInput, rememberHostMedia, hostMediaAsset, hostMediaFromEncoded, HOST_RESTORE_MEDIA, restoreRow, isToolError, toolErrorText, toolStateContent, rawMessagePage2, readV2MessageRange2, iterateV2MessageRange2, servedBoundaryRow2, resolveV2BoundaryUserMessage2, readAllV2RawMessagesForConversion2, readV2RawMessagePagesForConversion2, createV2RawMessageReader2, createV2RawMessageProvider2 };
@@ -28,7 +28,7 @@ import {
28
28
  clearIndexedMessages,
29
29
  indexSingleMessage,
30
30
  indexMessagesAfterOrdinal
31
- } from "./index-zzvd4a9z.js";
31
+ } from "./index-05bm2ndp.js";
32
32
 
33
33
  // src/features/magic-context/message-index-async.ts
34
34
  var indexCancellations = new Map;