@cortexkit/opencode-magic-context 0.36.1 → 0.38.0

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 (176) hide show
  1. package/README.md +2 -0
  2. package/dist/config/index.d.ts.map +1 -1
  3. package/dist/config/project-security.d.ts +2 -1
  4. package/dist/config/project-security.d.ts.map +1 -1
  5. package/dist/config/schema/magic-context.d.ts +10 -0
  6. package/dist/config/schema/magic-context.d.ts.map +1 -1
  7. package/dist/{conflict-warning-hook-mt0ttc4x.js → conflict-warning-hook-an4fxhwf.js} +3 -3
  8. package/dist/{derive-budgets-88mxk2w1.js → derive-budgets-da4yg3tz.js} +3 -2
  9. package/dist/features/magic-context/context-authority.d.ts.map +1 -1
  10. package/dist/features/magic-context/dreamer/classify-prompt.d.ts +5 -1
  11. package/dist/features/magic-context/dreamer/classify-prompt.d.ts.map +1 -1
  12. package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
  13. package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
  14. package/dist/features/magic-context/dreamer/manifest-parser.d.ts +8 -0
  15. package/dist/features/magic-context/dreamer/manifest-parser.d.ts.map +1 -1
  16. package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +7 -1
  17. package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -1
  18. package/dist/features/magic-context/dreamer/map-memories.d.ts +18 -0
  19. package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
  20. package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts +5 -0
  21. package/dist/features/magic-context/dreamer/storage-dream-runs.d.ts.map +1 -1
  22. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  23. package/dist/features/magic-context/dreamer/verify-prompt.d.ts +5 -1
  24. package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -1
  25. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  26. package/dist/features/magic-context/fail-closed-block.d.ts +6 -1
  27. package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
  28. package/dist/features/magic-context/memory/embedding-openai.d.ts +3 -1
  29. package/dist/features/magic-context/memory/embedding-openai.d.ts.map +1 -1
  30. package/dist/features/magic-context/memory/project-identity.d.ts +6 -0
  31. package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
  32. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  33. package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
  34. package/dist/features/magic-context/reclaim-protection.d.ts +13 -0
  35. package/dist/features/magic-context/reclaim-protection.d.ts.map +1 -0
  36. package/dist/features/magic-context/smart-notes/runner.d.ts.map +1 -1
  37. package/dist/features/magic-context/smart-notes/wake-plane.d.ts +21 -0
  38. package/dist/features/magic-context/smart-notes/wake-plane.d.ts.map +1 -0
  39. package/dist/features/magic-context/storage-db.d.ts +19 -3
  40. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  41. package/dist/features/magic-context/storage-meta-persisted.d.ts +23 -0
  42. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  43. package/dist/features/magic-context/storage-meta-session.d.ts.map +1 -1
  44. package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
  45. package/dist/features/magic-context/storage-primers.d.ts +11 -0
  46. package/dist/features/magic-context/storage-primers.d.ts.map +1 -1
  47. package/dist/features/magic-context/storage-schema-helpers.d.ts.map +1 -1
  48. package/dist/features/magic-context/storage-tags.d.ts +13 -5
  49. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  50. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts +7 -0
  51. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
  52. package/dist/features/magic-context/window-report-ledger.d.ts +70 -0
  53. package/dist/features/magic-context/window-report-ledger.d.ts.map +1 -0
  54. package/dist/hooks/auto-update-checker/checker.d.ts +8 -1
  55. package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
  56. package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
  57. package/dist/hooks/magic-context/channel2-cycle.d.ts +16 -0
  58. package/dist/hooks/magic-context/channel2-cycle.d.ts.map +1 -0
  59. package/dist/hooks/magic-context/channel2-delivery.d.ts +3 -9
  60. package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
  61. package/dist/hooks/magic-context/command-handler.d.ts +2 -0
  62. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  63. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +33 -103
  64. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
  65. package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
  66. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  67. package/dist/hooks/magic-context/event-resolvers.d.ts +4 -0
  68. package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
  69. package/dist/hooks/magic-context/execute-status.d.ts +3 -1
  70. package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
  71. package/dist/hooks/magic-context/fold-execution-gate.d.ts +2 -0
  72. package/dist/hooks/magic-context/fold-execution-gate.d.ts.map +1 -0
  73. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  74. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  75. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  76. package/dist/hooks/magic-context/live-session-state.d.ts +3 -0
  77. package/dist/hooks/magic-context/live-session-state.d.ts.map +1 -1
  78. package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
  79. package/dist/hooks/magic-context/lkg-slot.d.ts +20 -0
  80. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  81. package/dist/hooks/magic-context/module-state-sync.d.ts +8 -0
  82. package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
  83. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  84. package/dist/hooks/magic-context/module-wire.d.ts +6 -1
  85. package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
  86. package/dist/hooks/magic-context/rust-mode-transform.d.ts +21 -2
  87. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  88. package/dist/hooks/magic-context/strip-content.d.ts +27 -0
  89. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  90. package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -1
  91. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  92. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +78 -0
  93. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -0
  94. package/dist/hooks/magic-context/tool-reclaim.d.ts.map +1 -1
  95. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +14 -3
  96. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  97. package/dist/hooks/magic-context/transform.d.ts +10 -0
  98. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  99. package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
  100. package/dist/{index-nsx2n9eg.js → index-4cz5nfxf.js} +3 -3
  101. package/dist/{index-f1tnb3vm.js → index-8pqfcghm.js} +21 -9
  102. package/dist/index-9zhhvr4w.js +733 -0
  103. package/dist/{index-zp6x6s6a.js → index-cae89eas.js} +25 -6
  104. package/dist/index-cgyfn1s2.js +53 -0
  105. package/dist/{index-3zqcdwqr.js → index-crke4z5j.js} +7 -4
  106. package/dist/{index-1skzp4dc.js → index-mmvhrqqb.js} +1991 -274
  107. package/dist/{index-tsgs7td8.js → index-pck9vadr.js} +1 -1
  108. package/dist/{index-3tnkymva.js → index-sw8gnq34.js} +1 -1
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +1714 -988
  111. package/dist/plugin/hooks/create-session-hooks.d.ts +3 -0
  112. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  113. package/dist/plugin/messages-transform.d.ts.map +1 -1
  114. package/dist/plugin/rpc-handlers.d.ts +2 -0
  115. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  116. package/dist/{recomp-orchestrator-a0g9b52q.js → recomp-orchestrator-jsde4ygw.js} +7 -6
  117. package/dist/{safe-notification-target-c11fdda2.js → safe-notification-target-b693f9x3.js} +2 -2
  118. package/dist/{send-session-notification-bgtf4853.js → send-session-notification-dxske5zm.js} +3 -3
  119. package/dist/shared/conflict-detector.d.ts +63 -0
  120. package/dist/shared/conflict-detector.d.ts.map +1 -1
  121. package/dist/shared/harness-provider-map.d.ts +8 -0
  122. package/dist/shared/harness-provider-map.d.ts.map +1 -1
  123. package/dist/shared/logger.d.ts +8 -0
  124. package/dist/shared/logger.d.ts.map +1 -1
  125. package/dist/shared/models-dev-cache.d.ts +7 -0
  126. package/dist/shared/models-dev-cache.d.ts.map +1 -1
  127. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
  128. package/dist/shared/prompt-surface.d.ts +2 -0
  129. package/dist/shared/prompt-surface.d.ts.map +1 -1
  130. package/dist/shared/rpc-client.d.ts.map +1 -1
  131. package/dist/shared/rpc-server.d.ts.map +1 -1
  132. package/dist/shared/rpc-types.d.ts +29 -0
  133. package/dist/shared/rpc-types.d.ts.map +1 -1
  134. package/dist/shared/rpc-utils.d.ts +28 -9
  135. package/dist/shared/rpc-utils.d.ts.map +1 -1
  136. package/dist/shared/tail-hygiene-status.d.ts +15 -0
  137. package/dist/shared/tail-hygiene-status.d.ts.map +1 -0
  138. package/dist/shared/window-geometry.d.ts +90 -0
  139. package/dist/shared/window-geometry.d.ts.map +1 -0
  140. package/dist/{storage-meta-session-df9tstzr.js → storage-meta-session-mk4gsnke.js} +4 -3
  141. package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
  142. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  143. package/dist/tui/data/context-db.d.ts.map +1 -1
  144. package/dist/tui-compiled/data/context-db.d.ts.map +1 -1
  145. package/package.json +3 -1
  146. package/src/config/index.ts +2 -0
  147. package/src/config/latch-permanence-guard.test.ts +218 -0
  148. package/src/config/project-security.ts +10 -1
  149. package/src/config/schema/magic-context.ts +12 -2
  150. package/src/shared/__fixtures__/window-overlay.v1.json +337 -0
  151. package/src/shared/conflict-detector.test.ts +176 -1
  152. package/src/shared/conflict-detector.ts +126 -3
  153. package/src/shared/harness-provider-map.test.ts +20 -0
  154. package/src/shared/harness-provider-map.ts +19 -0
  155. package/src/shared/logger.test.ts +119 -0
  156. package/src/shared/logger.ts +33 -15
  157. package/src/shared/models-dev-cache.test.ts +42 -0
  158. package/src/shared/models-dev-cache.ts +62 -9
  159. package/src/shared/prompt-surface-runtime.ts +5 -3
  160. package/src/shared/prompt-surface.test.ts +38 -0
  161. package/src/shared/prompt-surface.ts +15 -2
  162. package/src/shared/rpc-client.ts +4 -2
  163. package/src/shared/rpc-server.ts +1 -0
  164. package/src/shared/rpc-types.ts +30 -0
  165. package/src/shared/rpc-utils.test.ts +162 -13
  166. package/src/shared/rpc-utils.ts +224 -31
  167. package/src/shared/tail-hygiene-status.ts +57 -0
  168. package/src/shared/window-geometry.test.ts +342 -0
  169. package/src/shared/window-geometry.ts +626 -0
  170. package/src/tui/data/context-db.ts +5 -0
  171. package/src/tui/index.tsx +33 -1
  172. package/src/tui/slots/sidebar-content.tsx +17 -5
  173. package/src/tui-compiled/data/context-db.ts +5 -0
  174. package/src/tui-compiled/index.tsx +359 -273
  175. package/src/tui-compiled/slots/sidebar-content.tsx +316 -287
  176. package/dist/index-wgvxkqpx.js +0 -342
@@ -0,0 +1 @@
1
+ {"version":3,"file":"window-geometry.d.ts","sourceRoot":"","sources":["../../src/shared/window-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAClE,eAAO,MAAM,kBAAkB,OAAQ,CAAC;AACxC,eAAO,MAAM,eAAe,OAAQ,CAAC;AACrC,eAAO,MAAM,mBAAmB,QAAS,CAAC;A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,wBAAwB,IAAI,MAAM,CAEjD;AAED,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,MAAM,EACZ,GAAG,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAiD,GAC5E,aAAa,GAAG,SAAS,CAyB3B;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAInE;AAED,wBAAgB,8BAA8B,IAAI,IAAI,CAIrD;AAED,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAQ5D;AAED,wBAAgB,yBAAyB,CACrC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,aAAa,GAAG,SAA8B,GACxD,0BAA0B,GAAG,SAAS,CAoBxC;AAgCD,2FAA2F;AAC3F,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,SAAS,CAIpB;AAeD,wBAAgB,oBAAoB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,UAAU,GAAG,SAAS,EACpC,OAAO,GAAE,2BAAgC,GAC1C,oBAAoB,GAAG,SAAS,CAwKlC;AAED,wBAAgB,0BAA0B,CACtC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,oBAAoB,GAC7B,MAAM,CASR;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQzD"}
@@ -5,9 +5,10 @@ import {
5
5
  markSessionCleanupPending,
6
6
  retryPendingSessionCleanups,
7
7
  updateSessionMeta
8
- } from "./index-3zqcdwqr.js";
9
- import"./index-3tnkymva.js";
10
- import"./index-f1tnb3vm.js";
8
+ } from "./index-crke4z5j.js";
9
+ import"./index-cgyfn1s2.js";
10
+ import"./index-sw8gnq34.js";
11
+ import"./index-8pqfcghm.js";
11
12
  import"./index-mmrhhk9a.js";
12
13
  import"./index-wckvcay0.js";
13
14
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAkDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAs3BrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAkDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAk4BrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAmBhE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAK7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AA8bD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAqBhE,OAAO,KAAK,EAAuB,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAK7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,QAAQ,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC/D,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAwdD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"context-db.d.ts","sourceRoot":"","sources":["../../../src/tui/data/context-db.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEzF,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAc3D,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAOrD;AAED,wBAAgB,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EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAchG;AAED,MAAM,MAAM,sBAAsB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG,oFAAoF;AACpF,wBAAsB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAe5F;AAED,6CAA6C;AAC7C,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQvE;AAED;mFACmF;AACnF,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQxE;AAED;;iDAEiD;AACjD,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAUhF;AAED,gEAAgE;AAChE,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAQ3D;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAkBrE;AAED,wEAAwE;AACxE,wBAAsB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAQtD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.36.1",
3
+ "version": "0.38.0",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -63,6 +63,8 @@
63
63
  "zod": "^4.1.8"
64
64
  },
65
65
  "devDependencies": {
66
+ "@ai-sdk/anthropic": "3.0.82",
67
+ "@ai-sdk/openai-compatible": "2.0.41",
66
68
  "@biomejs/biome": "^2.5.1",
67
69
  "@types/better-sqlite3": "^7.6.13",
68
70
  "@types/bun": "^1.3.10",
@@ -3,6 +3,7 @@ import { existsSync, readFileSync } from "node:fs";
3
3
  import { detectConfigFile, isPrototypePollutionKey, parseJsonc } from "../shared/jsonc-parser";
4
4
  import { setOutputReserveConfig } from "../shared/models-dev-cache";
5
5
  import type { PromptSurfaceConfig } from "../shared/prompt-surface";
6
+ import { setWindowOverlayPath } from "../shared/window-geometry";
6
7
  import { isCompactionEnabled, migrateLegacyAgentEnabledInMemory } from "./agent-disable";
7
8
  import {
8
9
  cortexKitProjectConfigBasePath,
@@ -589,6 +590,7 @@ export function loadPluginConfigDetailed(directory: string): LoadResultDetailed
589
590
  const recoveredTopLevelKeys: string[] = [];
590
591
  const config = parsePluginConfig(mergedRaw, recoveredTopLevelKeys);
591
592
  setOutputReserveConfig(config.output_reserve);
593
+ setWindowOverlayPath(config.models?.window_overlay_path);
592
594
  if (config.configWarnings?.length) {
593
595
  allWarnings.push(
594
596
  ...config.configWarnings.map((w) => {
@@ -0,0 +1,218 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { readdirSync, readFileSync } from "node:fs";
3
+ import { dirname, join, relative } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+
6
+ const REPOSITORY_ROOT = join(dirname(fileURLToPath(import.meta.url)), "../../../..");
7
+ const SOURCE_ROOTS = ["packages/plugin/src", "packages/pi-plugin/src"] as const;
8
+
9
+ type Classification = "VERDICT" | "DIAGNOSTIC" | "PUBLICATION";
10
+
11
+ type KnownSlot = {
12
+ classification: Classification;
13
+ reason: string;
14
+ };
15
+
16
+ /**
17
+ * Every module-level mutable slot whose name says it can retain a capability,
18
+ * absence, or failure verdict. A new matching slot must be classified here so
19
+ * a negative cache cannot quietly become permanent.
20
+ */
21
+ const KNOWN_SLOTS: Record<string, KnownSlot> = {
22
+ "packages/plugin/src/features/magic-context/compaction-marker.ts:cachedSchemaCompatible": {
23
+ classification: "VERDICT",
24
+ reason: "DEFECT: a transient PRAGMA/read failure is cached as incompatible until the writable DB is closed.",
25
+ },
26
+ "packages/plugin/src/features/magic-context/memory/embedding-local.ts:nativeRuntimeMissing": {
27
+ classification: "VERDICT",
28
+ reason: "Correct: a missing or unloadable native binding needs an install repair, which this process cannot observe.",
29
+ },
30
+ "packages/plugin/src/features/magic-context/memory/embedding-synapse.ts:sharedClientPromise": {
31
+ classification: "VERDICT",
32
+ reason: "DEFECT: a rejected connection promise remains shared after the daemon recovers.",
33
+ },
34
+ "packages/plugin/src/features/magic-context/memory/embedding-synapse.ts:permanentFailure": {
35
+ classification: "VERDICT",
36
+ reason: "DEFECT: a daemon catalog or response classification can be repaired in-process, but the provider then returns null without another probe.",
37
+ },
38
+ "packages/plugin/src/features/magic-context/memory/embedding-openai.ts:failureTimes": {
39
+ classification: "VERDICT",
40
+ reason: "Correct: circuit state expires and a half-open probe re-evaluates the endpoint.",
41
+ },
42
+ "packages/plugin/src/features/magic-context/memory/project-identity.ts:directoryFallbackCache":
43
+ {
44
+ classification: "VERDICT",
45
+ reason: "Saved: each read checks for a newly-created .git directory and deletes the fallback before resolving again.",
46
+ },
47
+ "packages/plugin/src/features/magic-context/memory/project-identity.ts:transientFailureCooldown":
48
+ {
49
+ classification: "VERDICT",
50
+ reason: "Saved: getActiveCooldown deletes an expired entry and forces a new git probe after five minutes.",
51
+ },
52
+ "packages/plugin/src/features/magic-context/message-index.ts:MESSAGE_HISTORY_ORPHAN_UNAVAILABLE_REPROBE_MS":
53
+ {
54
+ classification: "VERDICT",
55
+ reason: "Saved: source_unavailable persists a future timestamp, then the normal cooldown arithmetic re-probes after one day.",
56
+ },
57
+ "packages/plugin/src/features/magic-context/mural/storage-mural-cues.ts:muralCueColumnCache": {
58
+ classification: "VERDICT",
59
+ reason: "Correct by scope: the database is fully migrated before this handle reaches cue reads, so its schema cannot gain this column during use.",
60
+ },
61
+ "packages/plugin/src/features/magic-context/mural/storage-mural-cues.ts:muralCueRejectionColumnCache":
62
+ {
63
+ classification: "VERDICT",
64
+ reason: "Correct by scope: the database is fully migrated before this handle reaches cue reads, so its schema cannot gain this column during use.",
65
+ },
66
+ "packages/plugin/src/features/magic-context/smart-notes/sandbox-runner.ts:asyncModulePromise": {
67
+ classification: "VERDICT",
68
+ reason: "DEFECT: a rejected dynamic-import/WASM-init promise is retained for every later smart-note check.",
69
+ },
70
+ "packages/plugin/src/features/magic-context/storage-meta-session.ts:sessionMetaSelectColumnsCache":
71
+ {
72
+ classification: "VERDICT",
73
+ reason: "Correct by scope: session_meta migration completes before the first projection is built for this database handle.",
74
+ },
75
+ "packages/plugin/src/features/magic-context/memory/storage-memory.ts:memoryImportanceColumnCache":
76
+ {
77
+ classification: "VERDICT",
78
+ reason: "Correct by scope: memory schema migration completes before this database handle serves memory reads.",
79
+ },
80
+ "packages/plugin/src/features/magic-context/memory/storage-memory.ts:memoryScopeColumnCache": {
81
+ classification: "VERDICT",
82
+ reason: "Correct by scope: memory schema migration completes before this database handle serves memory reads.",
83
+ },
84
+ "packages/plugin/src/features/magic-context/memory/storage-memory.ts:memoryShareableColumnCache":
85
+ {
86
+ classification: "VERDICT",
87
+ reason: "Correct by scope: memory schema migration completes before this database handle serves memory reads.",
88
+ },
89
+ "packages/plugin/src/features/magic-context/memory/storage-memory.ts:memoryClassifiedAtColumnCache":
90
+ {
91
+ classification: "VERDICT",
92
+ reason: "Correct by scope: memory schema migration completes before this database handle serves memory reads.",
93
+ },
94
+ "packages/plugin/src/hooks/magic-context/ctx-reduce-availability.ts:ctxReduceRegisteredGlobally":
95
+ {
96
+ classification: "VERDICT",
97
+ reason: "Correct by scope: tool registration is resolved once at plugin boot and cannot change while that instance runs.",
98
+ },
99
+ "packages/plugin/src/hooks/magic-context/ctx-reduce-availability.ts:availabilityBySession": {
100
+ classification: "VERDICT",
101
+ reason: "Correct by contract: the first persisted user message freezes that session's tool surface.",
102
+ },
103
+ "packages/plugin/src/hooks/magic-context/ctx-reduce-availability.ts:permissionDeniedBySession":
104
+ {
105
+ classification: "DIAGNOSTIC",
106
+ reason: "Repeatedly assigned on each cache-busting permission read; later reads replace an earlier denial.",
107
+ },
108
+ "packages/plugin/src/hooks/magic-context/read-session-formatting.ts:tokenizerLoadAttempted": {
109
+ classification: "VERDICT",
110
+ reason: "DEFECT: a failed tokenizer load permanently selects heuristic token counts even if the package becomes available.",
111
+ },
112
+ "packages/plugin/src/hooks/magic-context/module-transport.ts:stateSyncCapabilityCache": {
113
+ classification: "VERDICT",
114
+ reason: "Saved: invalidateStateSyncCapabilities runs on NEED_FULL_SYNC and connection invalidation before the next capability probe.",
115
+ },
116
+ "packages/plugin/src/plugin/conflict-warning-hook.ts:cachedDesktopStateByDir": {
117
+ classification: "VERDICT",
118
+ reason: "Correct by scope: its deciding startup-warning paths run once per plugin boot, so a later Desktop state-file write is not observed by design.",
119
+ },
120
+ "packages/plugin/src/plugin/embedding-routing.ts:synapseProbeCache": {
121
+ classification: "VERDICT",
122
+ reason: "Saved: the promise has a 60-second TTL, including rejections, and discovery is retried after expiry.",
123
+ },
124
+ "packages/plugin/src/shared/models-dev-cache.ts:authRewarmDone": {
125
+ classification: "VERDICT",
126
+ reason: "Saved: refreshModelLimitsAfterAuthOnce resets the latch when its warm fails.",
127
+ },
128
+ "packages/pi-plugin/src/dreamer/pi-session-api.ts:cachedModulePromise": {
129
+ classification: "VERDICT",
130
+ reason: "Saved: promise.catch clears the same rejected promise, allowing the next resolver call to retry.",
131
+ },
132
+ "packages/plugin/src/features/magic-context/fail-closed-block.ts:lastHookInitFailure": {
133
+ classification: "DIAGNOSTIC",
134
+ reason: "Most-recent boot diagnostic: recordHookInitFailure overwrites it and clearHookInitFailure resets it.",
135
+ },
136
+ "packages/plugin/src/hooks/magic-context/read-session-formatting.ts:tokenizerLoadPromise": {
137
+ classification: "PUBLICATION",
138
+ reason: "In-flight handle only: finally clears it after the load settles, so it cannot retain a failure verdict.",
139
+ },
140
+ "packages/plugin/src/shared/exit-abort-registry.ts:listenerRegistered": {
141
+ classification: "PUBLICATION",
142
+ reason: "One-time process exit-listener installation, not a capability or failure verdict.",
143
+ },
144
+ "packages/plugin/src/shared/storage-permissions.ts:enforcePrivateStoragePermissions": {
145
+ classification: "VERDICT",
146
+ reason: "Repeatedly assigned configuration: the public setter can update it during the process.",
147
+ },
148
+ "packages/plugin/src/features/magic-context/storage-db.ts:lastSchemaFenceRejection": {
149
+ classification: "DIAGNOSTIC",
150
+ reason: "Most-recent diagnostic: every open attempt clears or overwrites it.",
151
+ },
152
+ "packages/plugin/src/features/magic-context/storage-db.ts:lastMigrationOnOpenRefusal": {
153
+ classification: "DIAGNOSTIC",
154
+ reason: "Most-recent diagnostic: every open attempt clears or overwrites it.",
155
+ },
156
+ "packages/plugin/src/shared/models-dev-cache.ts:apiCache": {
157
+ classification: "PUBLICATION",
158
+ reason: "Publishes last-known-good model metadata, not a failure verdict; refresh writes a later successful value.",
159
+ },
160
+ };
161
+
162
+ function sourceFiles(directory: string): string[] {
163
+ const files: string[] = [];
164
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
165
+ const path = join(directory, entry.name);
166
+ if (entry.isDirectory()) {
167
+ files.push(...sourceFiles(path));
168
+ } else if (entry.isFile() && path.endsWith(".ts") && !path.endsWith(".test.ts")) {
169
+ files.push(path);
170
+ }
171
+ }
172
+ return files;
173
+ }
174
+
175
+ function declaredOneShotSlots(source: string): string[] {
176
+ // `let` is deliberate: this targets mutable module state, not constant lookup
177
+ // tables or prepared-statement handles. The initializer restriction excludes
178
+ // ordinary counters and per-call scratch values.
179
+ const declarations =
180
+ /^(?:export\s+)?let\s+([A-Za-z_$][\w$]*)\b[^\n]*(?:=\s*(?:null|false|true)|Promise<)/gm;
181
+ const verdictName =
182
+ /(?:attempted|availability|compatible|cooldown|disabled|failed|failure|latch|missing|permission|promise|registered|unavailable)/i;
183
+ const moduleSlots = [...source.matchAll(declarations)].map((match) => match[1]);
184
+ // A provider-local permanent failure has the same operational effect as a
185
+ // module slot: every later provider call short-circuits without re-probing.
186
+ const providerLatches = [
187
+ ...source.matchAll(/^\s*private\s+(permanentFailure)\s*=\s*false;/gm),
188
+ ].map((match) => match[1]);
189
+ return [...moduleSlots, ...providerLatches].filter(
190
+ (name): name is string => name !== undefined && verdictName.test(name),
191
+ );
192
+ }
193
+
194
+ describe("latch permanence classification guard", () => {
195
+ test("classifies every production one-shot verdict-shaped slot", () => {
196
+ const inlineTestBlocks: string[] = [];
197
+ const discovered = new Set<string>();
198
+ for (const root of SOURCE_ROOTS) {
199
+ for (const file of sourceFiles(join(REPOSITORY_ROOT, root))) {
200
+ const source = readFileSync(file, "utf8");
201
+ if (/from\s+["']bun:test["']/.test(source)) {
202
+ inlineTestBlocks.push(relative(REPOSITORY_ROOT, file));
203
+ }
204
+ for (const slot of declaredOneShotSlots(source)) {
205
+ discovered.add(`${relative(REPOSITORY_ROOT, file)}:${slot}`);
206
+ }
207
+ }
208
+ }
209
+
210
+ expect(inlineTestBlocks).toEqual([]);
211
+ const unclassified = [...discovered].filter((slot) => !(slot in KNOWN_SLOTS)).sort();
212
+ expect(
213
+ unclassified,
214
+ `Classify each new one-shot verdict-shaped slot in KNOWN_SLOTS: ${unclassified.join(", ")}`,
215
+ ).toEqual([]);
216
+ expect(Object.keys(KNOWN_SLOTS).length).toBeGreaterThan(0);
217
+ });
218
+ });
@@ -195,7 +195,8 @@ function makeProjectThresholdWarning(field: string, reason: string): string {
195
195
  * loud inoperability gate; only the user may restore silent degrade.
196
196
  * - `allow_home_project` — only the user may opt a home-directory session
197
197
  * into a durable project identity.
198
- * - `output_reserve` — only the user may change the process-wide safe input budget.
198
+ * - `output_reserve` / `models.window_overlay_path` — only the user may change
199
+ * process-wide window geometry inputs.
199
200
  * - `language`: a repo must not inject prompt text through a user preference.
200
201
  * - `sqlite` — `sqlite.cache_size_mb` / `mmap_size_mb` become PRAGMAs on the
201
202
  * process-global shared DB handle (one connection across every project in the
@@ -268,6 +269,14 @@ export function stripUnsafeProjectConfigFields(projectRaw: Record<string, unknow
268
269
  );
269
270
  }
270
271
 
272
+ const models = projectRaw.models;
273
+ if (isPlainObject(models) && "window_overlay_path" in models) {
274
+ delete models.window_overlay_path;
275
+ warnings.push(
276
+ "Ignoring models.window_overlay_path from project config (security: only user-level config may select model geometry metadata).",
277
+ );
278
+ }
279
+
271
280
  if ("language" in projectRaw) {
272
281
  delete projectRaw.language;
273
282
  warnings.push(
@@ -479,6 +479,8 @@ export interface MagicContextConfig {
479
479
  prompt_surface: PromptSurfaceConfig;
480
480
  /** User-only output-token reservation override. Zero disables reservation. */
481
481
  output_reserve?: number | { default: number; [modelKey: string]: number };
482
+ /** User-only model metadata inputs. */
483
+ models?: { window_overlay_path?: string };
482
484
  /** TUI toast lifetime in milliseconds for Magic Context notifications. Default: 5000. */
483
485
  toast_duration_ms?: number;
484
486
  execute_threshold_percentage: number | { default: number; [modelKey: string]: number };
@@ -719,7 +721,15 @@ export const MagicContextConfigSchema = z
719
721
  ])
720
722
  .optional()
721
723
  .describe(
722
- 'User-only output-token reservation override. Number or per-model object ({ default: 16384, "provider/model": 8192 }); 0 disables reservation. When unset, Magic Context reserves the catalog output limit (capped at 25% of context) for shared-window providers and keeps proven separate-quota Google/Gemini windows unchanged.',
724
+ 'User-only output-token reservation override. Number or per-model object ({ default: 16384, "provider/model": 8192 }); 0 disables reservation. Takes precedence over every derived source: an explicit value here always wins against catalog output limits, provider window-geometry facts, and the 25%-of-context fallback (usable window = context window minus this reserve). When unset, Magic Context reserves the catalog output limit (capped at 25% of context) for shared-window providers and keeps proven separate-quota Google/Gemini windows unchanged.',
725
+ ),
726
+ models: z
727
+ .object({
728
+ window_overlay_path: z.string().trim().min(1).optional(),
729
+ })
730
+ .optional()
731
+ .describe(
732
+ "User-only Fusiform window-overlay settings. The path defaults to <dataDir>/fusiform/window-overlay.json.",
723
733
  ),
724
734
  toast_duration_ms: z
725
735
  .number()
@@ -936,7 +946,7 @@ export const MagicContextConfigSchema = z
936
946
  .boolean()
937
947
  .default(false)
938
948
  .describe(
939
- "Content-aware reclaim of provably-superseded tool output, layered on the existing execute-pass auto-drop. When on: superseded todowrite (keep newest 1), spent ctx_reduce (keep newest 5), and zero-value meta (bash_status, bash_kill, ctx_note read/dismiss) outputs are dropped; older edits to a file are compressed to a filePath-preserving marker while the newest edit per file stays full. Only acts on passes already busting the cache, so it never originates a cache bust. Honors the protected-tag reserve. Experimental: opt-in, default off until cache stability is proven; when off the wire is byte-identical to the positional-only reclaim. Requires a restart.",
949
+ "Content-aware reclaim of provably-superseded tool output, layered on the existing execute-pass auto-drop. When on: superseded todowrite (keep newest 1), spent ctx_reduce (keep newest 3), and zero-value meta (bash_status, bash_kill, ctx_note read/dismiss) outputs are dropped; older edits to a file are compressed to a filePath-preserving marker while the newest edit per file stays full. Only acts on passes already busting the cache, so it never originates a cache bust. Honors the protected-tag reserve. Experimental: opt-in, default off until cache stability is proven; when off the wire is byte-identical to the positional-only reclaim. Requires a restart.",
940
950
  ),
941
951
  caveman_text_compression: z
942
952
  .object({