@cortexkit/opencode-magic-context 0.41.4 → 0.42.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 (328) hide show
  1. package/README.md +21 -3
  2. package/dist/agents/hidden-agent-registrations.d.ts +1 -3
  3. package/dist/agents/hidden-agent-registrations.d.ts.map +1 -1
  4. package/dist/agents/magic-context-prompt.d.ts +1 -1
  5. package/dist/agents/magic-context-prompt.d.ts.map +1 -1
  6. package/dist/agents/permissions.d.ts +1 -22
  7. package/dist/agents/permissions.d.ts.map +1 -1
  8. package/dist/config/agent-disable.d.ts +0 -5
  9. package/dist/config/agent-disable.d.ts.map +1 -1
  10. package/dist/config/index.d.ts +5 -0
  11. package/dist/config/index.d.ts.map +1 -1
  12. package/dist/config/migrate-config-location.d.ts.map +1 -1
  13. package/dist/config/project-security.d.ts +17 -0
  14. package/dist/config/project-security.d.ts.map +1 -1
  15. package/dist/config/removed-agent-config.d.ts +8 -0
  16. package/dist/config/removed-agent-config.d.ts.map +1 -0
  17. package/dist/config/schema/magic-context.d.ts +23 -201
  18. package/dist/config/schema/magic-context.d.ts.map +1 -1
  19. package/dist/{conflict-warning-hook-ejkc9sjn.js → conflict-warning-hook-6p3xqeac.js} +3 -3
  20. package/dist/{derive-budgets-bc366cz8.js → derive-budgets-s2pgnnm4.js} +1 -1
  21. package/dist/features/builtin-commands/commands.d.ts +0 -4
  22. package/dist/features/builtin-commands/commands.d.ts.map +1 -1
  23. package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
  24. package/dist/features/magic-context/compartment-chunk-embedding.d.ts +7 -0
  25. package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
  26. package/dist/features/magic-context/compartment-storage.d.ts.map +1 -1
  27. package/dist/features/magic-context/context-authority.d.ts +31 -4
  28. package/dist/features/magic-context/context-authority.d.ts.map +1 -1
  29. package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
  30. package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
  31. package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
  32. package/dist/features/magic-context/dreamer/open-opencode-db.d.ts.map +1 -1
  33. package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
  34. package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts +19 -9
  35. package/dist/features/magic-context/dreamer/retrospective-orphan-sweep.d.ts.map +1 -1
  36. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  37. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +4 -0
  38. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  39. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  40. package/dist/features/magic-context/fail-closed-block.d.ts.map +1 -1
  41. package/dist/features/magic-context/git-commits/sweep-coordinator.d.ts.map +1 -1
  42. package/dist/features/magic-context/index.d.ts +0 -1
  43. package/dist/features/magic-context/index.d.ts.map +1 -1
  44. package/dist/features/magic-context/memory/embedding-local.d.ts +13 -0
  45. package/dist/features/magic-context/memory/embedding-local.d.ts.map +1 -1
  46. package/dist/features/magic-context/memory/embedding-synapse.d.ts +43 -10
  47. package/dist/features/magic-context/memory/embedding-synapse.d.ts.map +1 -1
  48. package/dist/features/magic-context/memory/embedding.d.ts +1 -1
  49. package/dist/features/magic-context/memory/embedding.d.ts.map +1 -1
  50. package/dist/features/magic-context/memory/memory-migration.d.ts.map +1 -1
  51. package/dist/features/magic-context/memory/project-identity.d.ts +1 -0
  52. package/dist/features/magic-context/memory/project-identity.d.ts.map +1 -1
  53. package/dist/features/magic-context/memory/promotion.d.ts +7 -1
  54. package/dist/features/magic-context/memory/promotion.d.ts.map +1 -1
  55. package/dist/features/magic-context/merged-reasoning-decisions.d.ts +6 -0
  56. package/dist/features/magic-context/merged-reasoning-decisions.d.ts.map +1 -0
  57. package/dist/features/magic-context/message-fts-rowid-map.d.ts.map +1 -1
  58. package/dist/features/magic-context/message-index-async.d.ts +12 -0
  59. package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
  60. package/dist/features/magic-context/message-index.d.ts.map +1 -1
  61. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  62. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  63. package/dist/features/magic-context/mural/render-trigger.d.ts +6 -0
  64. package/dist/features/magic-context/mural/render-trigger.d.ts.map +1 -1
  65. package/dist/features/magic-context/no-content-compartment.d.ts +12 -0
  66. package/dist/features/magic-context/no-content-compartment.d.ts.map +1 -0
  67. package/dist/features/magic-context/pi-content-decisions.d.ts +9 -0
  68. package/dist/features/magic-context/pi-content-decisions.d.ts.map +1 -0
  69. package/dist/features/magic-context/project-docs-hash.d.ts +4 -0
  70. package/dist/features/magic-context/project-docs-hash.d.ts.map +1 -1
  71. package/dist/features/magic-context/project-embedding-registry.d.ts +13 -4
  72. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  73. package/dist/features/magic-context/protection-window.d.ts +79 -0
  74. package/dist/features/magic-context/protection-window.d.ts.map +1 -0
  75. package/dist/features/magic-context/search.d.ts.map +1 -1
  76. package/dist/features/magic-context/session-project-backfill.d.ts.map +1 -1
  77. package/dist/features/magic-context/shadow-backfill-state.d.ts +26 -0
  78. package/dist/features/magic-context/shadow-backfill-state.d.ts.map +1 -0
  79. package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
  80. package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts +4 -0
  81. package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -1
  82. package/dist/features/magic-context/smart-notes/storage.d.ts.map +1 -1
  83. package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
  84. package/dist/features/magic-context/storage-db.d.ts +1 -1
  85. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  86. package/dist/features/magic-context/storage-embedding-measurements.d.ts +2 -2
  87. package/dist/features/magic-context/storage-embedding-measurements.d.ts.map +1 -1
  88. package/dist/features/magic-context/storage-historian-runs.d.ts +4 -0
  89. package/dist/features/magic-context/storage-historian-runs.d.ts.map +1 -1
  90. package/dist/features/magic-context/storage-memory-mutation-log.d.ts +1 -0
  91. package/dist/features/magic-context/storage-memory-mutation-log.d.ts.map +1 -1
  92. package/dist/features/magic-context/storage-meta-persisted.d.ts +79 -13
  93. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  94. package/dist/features/magic-context/storage-meta.d.ts +1 -1
  95. package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
  96. package/dist/features/magic-context/storage-native-replay.d.ts +29 -0
  97. package/dist/features/magic-context/storage-native-replay.d.ts.map +1 -0
  98. package/dist/features/magic-context/storage-notes.d.ts +6 -0
  99. package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
  100. package/dist/features/magic-context/storage-replay-document.d.ts +33 -0
  101. package/dist/features/magic-context/storage-replay-document.d.ts.map +1 -0
  102. package/dist/features/magic-context/storage-subagent-invocations.d.ts +1 -1
  103. package/dist/features/magic-context/storage-subagent-invocations.d.ts.map +1 -1
  104. package/dist/features/magic-context/storage-tags.d.ts +19 -11
  105. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  106. package/dist/features/magic-context/storage.d.ts +3 -3
  107. package/dist/features/magic-context/storage.d.ts.map +1 -1
  108. package/dist/features/magic-context/subagent-token-capture.d.ts.map +1 -1
  109. package/dist/features/magic-context/tagger.d.ts +13 -0
  110. package/dist/features/magic-context/tagger.d.ts.map +1 -1
  111. package/dist/features/magic-context/tool-owner-backfill.d.ts.map +1 -1
  112. package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
  113. package/dist/features/magic-context/user-memory/storage-user-memory.d.ts.map +1 -1
  114. package/dist/features/magic-context/workspaces.d.ts.map +1 -1
  115. package/dist/hooks/magic-context/apply-operations.d.ts +11 -5
  116. package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
  117. package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
  118. package/dist/hooks/magic-context/cache-busting-signals.d.ts +9 -1
  119. package/dist/hooks/magic-context/cache-busting-signals.d.ts.map +1 -1
  120. package/dist/hooks/magic-context/caveman-cleanup.d.ts +1 -1
  121. package/dist/hooks/magic-context/caveman-cleanup.d.ts.map +1 -1
  122. package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
  123. package/dist/hooks/magic-context/child-session-spawn.d.ts +3 -3
  124. package/dist/hooks/magic-context/child-session-spawn.d.ts.map +1 -1
  125. package/dist/hooks/magic-context/command-handler.d.ts +1 -10
  126. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  127. package/dist/hooks/magic-context/compaction-marker-manager.d.ts.map +1 -1
  128. package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts +10 -21
  129. package/dist/hooks/magic-context/compartment-runner-drop-queue.d.ts.map +1 -1
  130. package/dist/hooks/magic-context/compartment-runner-incremental.d.ts.map +1 -1
  131. package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
  132. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +26 -2
  133. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
  134. package/dist/hooks/magic-context/decay-render.d.ts.map +1 -1
  135. package/dist/hooks/magic-context/dropped-input-guard.d.ts +9 -0
  136. package/dist/hooks/magic-context/dropped-input-guard.d.ts.map +1 -0
  137. package/dist/hooks/magic-context/emergency-drop.d.ts +6 -1
  138. package/dist/hooks/magic-context/emergency-drop.d.ts.map +1 -1
  139. package/dist/hooks/magic-context/event-handler.d.ts +0 -1
  140. package/dist/hooks/magic-context/event-handler.d.ts.map +1 -1
  141. package/dist/hooks/magic-context/event-payloads.d.ts +7 -6
  142. package/dist/hooks/magic-context/event-payloads.d.ts.map +1 -1
  143. package/dist/hooks/magic-context/event-resolvers.d.ts +1 -1
  144. package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
  145. package/dist/hooks/magic-context/execute-status.d.ts +1 -1
  146. package/dist/hooks/magic-context/execute-status.d.ts.map +1 -1
  147. package/dist/hooks/magic-context/format-embed-status.d.ts.map +1 -1
  148. package/dist/hooks/magic-context/heuristic-cleanup.d.ts +7 -1
  149. package/dist/hooks/magic-context/heuristic-cleanup.d.ts.map +1 -1
  150. package/dist/hooks/magic-context/hook-handlers.d.ts +3 -1
  151. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  152. package/dist/hooks/magic-context/hook.d.ts +13 -4
  153. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  154. package/dist/hooks/magic-context/inject-compartments.d.ts +14 -1
  155. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  156. package/dist/hooks/magic-context/live-session-state.d.ts +1 -1
  157. package/dist/hooks/magic-context/lkg-slot.d.ts +34 -0
  158. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  159. package/dist/hooks/magic-context/module-state-sync-timing.d.ts +21 -0
  160. package/dist/hooks/magic-context/module-state-sync-timing.d.ts.map +1 -0
  161. package/dist/hooks/magic-context/module-state-sync.d.ts +21 -7
  162. package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
  163. package/dist/hooks/magic-context/module-transport.d.ts +12 -0
  164. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  165. package/dist/hooks/magic-context/module-wire.d.ts +8 -0
  166. package/dist/hooks/magic-context/module-wire.d.ts.map +1 -1
  167. package/dist/hooks/magic-context/note-nudger.d.ts.map +1 -1
  168. package/dist/hooks/magic-context/persist-filtered-noise.d.ts +5 -0
  169. package/dist/hooks/magic-context/persist-filtered-noise.d.ts.map +1 -0
  170. package/dist/hooks/magic-context/protected-tail-boundary.d.ts +6 -0
  171. package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
  172. package/dist/hooks/magic-context/read-session-chunk.d.ts +18 -18
  173. package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
  174. package/dist/hooks/magic-context/read-session-db.d.ts +22 -12
  175. package/dist/hooks/magic-context/read-session-db.d.ts.map +1 -1
  176. package/dist/hooks/magic-context/read-session-formatting.d.ts +8 -0
  177. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  178. package/dist/hooks/magic-context/read-session-raw.d.ts +10 -1
  179. package/dist/hooks/magic-context/read-session-raw.d.ts.map +1 -1
  180. package/dist/hooks/magic-context/reference-retrieval.d.ts.map +1 -1
  181. package/dist/hooks/magic-context/rust-mode-transform.d.ts +74 -9
  182. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  183. package/dist/hooks/magic-context/send-session-notification.d.ts +11 -10
  184. package/dist/hooks/magic-context/send-session-notification.d.ts.map +1 -1
  185. package/dist/hooks/magic-context/strip-content.d.ts +7 -0
  186. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  187. package/dist/hooks/magic-context/supersession-reclaim.d.ts +13 -0
  188. package/dist/hooks/magic-context/supersession-reclaim.d.ts.map +1 -1
  189. package/dist/hooks/magic-context/system-prompt-hash.d.ts +2 -3
  190. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  191. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +8 -3
  192. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
  193. package/dist/hooks/magic-context/tool-drop-target.d.ts.map +1 -1
  194. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  195. package/dist/hooks/magic-context/transform-context-state.d.ts +7 -1
  196. package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
  197. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +11 -4
  198. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  199. package/dist/hooks/magic-context/transform.d.ts +7 -2
  200. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  201. package/dist/hooks/magic-context/upgrade-reminder.d.ts +7 -9
  202. package/dist/hooks/magic-context/upgrade-reminder.d.ts.map +1 -1
  203. package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
  204. package/dist/index-1974jvn3.js +783 -0
  205. package/dist/{index-4avmwfp5.js → index-36wd1d6k.js} +6 -29
  206. package/dist/{index-0y2mcg5y.js → index-c9hamh36.js} +18332 -16226
  207. package/dist/{index-fz104x1j.js → index-jmtjh2d3.js} +3 -3
  208. package/dist/{index-q264erdp.js → index-nqgjwfzn.js} +70 -38
  209. package/dist/{index-mjv9je4e.js → index-xdtge3y2.js} +45 -7
  210. package/dist/index.d.ts.map +1 -1
  211. package/dist/index.js +6199 -5088
  212. package/dist/plugin/conflict-warning-hook.d.ts +5 -6
  213. package/dist/plugin/conflict-warning-hook.d.ts.map +1 -1
  214. package/dist/plugin/dream-timer.d.ts +1 -0
  215. package/dist/plugin/dream-timer.d.ts.map +1 -1
  216. package/dist/plugin/embedding-routing.d.ts +4 -1
  217. package/dist/plugin/embedding-routing.d.ts.map +1 -1
  218. package/dist/plugin/hooks/create-session-hooks.d.ts +16 -2
  219. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  220. package/dist/plugin/rpc-handlers.d.ts +31 -1
  221. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  222. package/dist/plugin/rust-tool-backends.d.ts +1 -0
  223. package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
  224. package/dist/plugin/tool-registry.d.ts.map +1 -1
  225. package/dist/{recomp-orchestrator-q98r6rga.js → recomp-orchestrator-3atsasjy.js} +5 -5
  226. package/dist/{send-session-notification-hdh02wy9.js → send-session-notification-1qeqkswb.js} +6 -4
  227. package/dist/shared/child-session-teardown.d.ts +34 -0
  228. package/dist/shared/child-session-teardown.d.ts.map +1 -0
  229. package/dist/shared/keep-subagents.d.ts +1 -1
  230. package/dist/shared/keep-subagents.d.ts.map +1 -1
  231. package/dist/shared/model-suggestion-retry.d.ts +1 -1
  232. package/dist/shared/opencode-db-path.d.ts +24 -0
  233. package/dist/shared/opencode-db-path.d.ts.map +1 -0
  234. package/dist/shared/prompt-surface-runtime.d.ts +10 -5
  235. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
  236. package/dist/shared/resolve-fallbacks.d.ts +1 -1
  237. package/dist/shared/rpc-types.d.ts +111 -0
  238. package/dist/shared/rpc-types.d.ts.map +1 -1
  239. package/dist/shared/sqlite.d.ts +42 -0
  240. package/dist/shared/sqlite.d.ts.map +1 -1
  241. package/dist/shared/status-detail-text.d.ts.map +1 -1
  242. package/dist/shared/subagent-runner.d.ts +17 -10
  243. package/dist/shared/subagent-runner.d.ts.map +1 -1
  244. package/dist/shared/tag-transcript.d.ts.map +1 -1
  245. package/dist/shared/transcript.d.ts +6 -0
  246. package/dist/shared/transcript.d.ts.map +1 -1
  247. package/dist/shared/window-geometry.d.ts +23 -0
  248. package/dist/shared/window-geometry.d.ts.map +1 -1
  249. package/dist/shared/write-transaction-timing.d.ts +1 -1
  250. package/dist/shared/write-transaction-timing.d.ts.map +1 -1
  251. package/dist/{storage-meta-session-dvwfw778.js → storage-meta-session-e6g0mmec.js} +2 -2
  252. package/dist/tools/ctx-memory/tools.d.ts.map +1 -1
  253. package/dist/tools/ctx-memory/verification-recording.d.ts.map +1 -1
  254. package/dist/tools/ctx-note/constants.d.ts +1 -1
  255. package/dist/tools/ctx-note/constants.d.ts.map +1 -1
  256. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  257. package/dist/tools/ctx-note/types.d.ts +1 -0
  258. package/dist/tools/ctx-note/types.d.ts.map +1 -1
  259. package/dist/tools/ctx-reduce/tools.d.ts +10 -1
  260. package/dist/tools/ctx-reduce/tools.d.ts.map +1 -1
  261. package/dist/tools/ctx-search/constants.d.ts +1 -1
  262. package/dist/tools/ctx-search/constants.d.ts.map +1 -1
  263. package/dist/tools/light-descriptions.d.ts +2 -2
  264. package/dist/tools/light-descriptions.d.ts.map +1 -1
  265. package/package.json +2 -3
  266. package/src/agents/hidden-agent-registrations.ts +3 -15
  267. package/src/agents/magic-context-prompt.test.ts +7 -5
  268. package/src/agents/magic-context-prompt.ts +22 -30
  269. package/src/agents/permissions.test.ts +1 -42
  270. package/src/agents/permissions.ts +1 -24
  271. package/src/config/agent-disable.ts +5 -22
  272. package/src/config/index.test.ts +126 -15
  273. package/src/config/index.ts +41 -6
  274. package/src/config/latch-permanence-guard.test.ts +4 -0
  275. package/src/config/migrate-config-location.test.ts +39 -6
  276. package/src/config/migrate-config-location.ts +18 -31
  277. package/src/config/profiles.ts +1 -1
  278. package/src/config/project-security.hostile-matrix.test.ts +0 -8
  279. package/src/config/project-security.test.ts +11 -22
  280. package/src/config/project-security.ts +103 -9
  281. package/src/config/protected-tokens.test.ts +235 -0
  282. package/src/config/removed-agent-config.ts +45 -0
  283. package/src/config/removed-agent-source-fence.test.ts +56 -0
  284. package/src/config/schema/magic-context.test.ts +21 -42
  285. package/src/config/schema/magic-context.ts +46 -37
  286. package/src/shared/child-session-teardown.test.ts +218 -0
  287. package/src/shared/child-session-teardown.ts +66 -0
  288. package/src/shared/keep-subagents.ts +9 -14
  289. package/src/shared/model-suggestion-retry.ts +1 -1
  290. package/src/shared/opencode-db-path.test.ts +196 -0
  291. package/src/shared/opencode-db-path.ts +215 -0
  292. package/src/shared/prompt-surface-a1-golden.md +50 -35
  293. package/src/shared/prompt-surface-runtime.test.ts +28 -0
  294. package/src/shared/prompt-surface-runtime.ts +22 -5
  295. package/src/shared/resolve-fallbacks.ts +1 -1
  296. package/src/shared/rpc-types.ts +118 -0
  297. package/src/shared/session-messages-bounded.test.ts +1 -1
  298. package/src/shared/sqlite-import-fence.test.ts +19 -0
  299. package/src/shared/sqlite.test.ts +27 -1
  300. package/src/shared/sqlite.ts +204 -1
  301. package/src/shared/status-detail-text.test.ts +6 -3
  302. package/src/shared/status-detail-text.ts +15 -0
  303. package/src/shared/subagent-runner.ts +17 -10
  304. package/src/shared/tag-transcript.ts +33 -21
  305. package/src/shared/transcript.ts +7 -0
  306. package/src/shared/window-geometry.test.ts +44 -0
  307. package/src/shared/window-geometry.ts +89 -11
  308. package/src/shared/write-transaction-attribution.test.ts +241 -0
  309. package/src/shared/write-transaction-timing.ts +2 -1
  310. package/src/tui/index.tsx +3 -3
  311. package/src/tui/slots/sidebar-content.tsx +12 -7
  312. package/src/tui-compiled/index.tsx +3 -3
  313. package/src/tui-compiled/slots/sidebar-content.tsx +301 -305
  314. package/dist/agents/sidekick.d.ts +0 -2
  315. package/dist/agents/sidekick.d.ts.map +0 -1
  316. package/dist/features/magic-context/defaults.d.ts +0 -2
  317. package/dist/features/magic-context/defaults.d.ts.map +0 -1
  318. package/dist/features/magic-context/sidekick/agent.d.ts +0 -14
  319. package/dist/features/magic-context/sidekick/agent.d.ts.map +0 -1
  320. package/dist/features/magic-context/sidekick/core.d.ts +0 -38
  321. package/dist/features/magic-context/sidekick/core.d.ts.map +0 -1
  322. package/dist/features/magic-context/sidekick/index.d.ts +0 -3
  323. package/dist/features/magic-context/sidekick/index.d.ts.map +0 -1
  324. package/dist/hooks/magic-context/boundary-execution.d.ts +0 -27
  325. package/dist/hooks/magic-context/boundary-execution.d.ts.map +0 -1
  326. package/dist/index-raatkvw5.js +0 -360
  327. package/src/agents/sidekick.ts +0 -1
  328. package/src/features/magic-context/defaults.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,mBAAmB,EACnB,iBAAiB,EACpB,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAC9B,+EAA+E;IAC/E,CAAC,EAAE,MAAM,CAAC;IACV,wFAAwF;IACxF,CAAC,EAAE,MAAM,CAAC;IACV,+FAA+F;IAC/F,QAAQ,EAAE,MAAM,CAAC;IACjB,wGAAwG;IACxG,SAAS,EAAE,OAAO,CAAC;IACnB,qBAAqB,E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ACF,SAAS,EAAE;QACP,MAAM,EAAE,OAAO,CAAC;QAChB,aAAa,EAAE,OAAO,CAAC;QACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;KAC5B,CAAC;IACF,cAAc,EAAE;QACZ,MAAM,EAAE,OAAO,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;QACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,cAAc,EAAE,MAAM,CAAC;QACvB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,uBAAuB,EAAE,MAAM,CAAC;KACnC,CAAC;IACF,OAAO,EAAE;QACL,aAAa,EAAE,OAAO,CAAC;QACvB,MAAM,EAAE,OAAO,CAAC;KACnB,CAAC;CACL;AAED,MAAM,WAAW,wBAAwB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,uBAAuB,CAAC;IACrC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,OAAO,EAAE,kBAAkB,CAAC;CAC/B;AAED,MAAM,WAAW,yBAA0B,SAAQ,wBAAwB;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -39,6 +39,16 @@
39
39
  * `run()` → {changes,lastInsertRowid}) is identical and was verified directly.
40
40
  */
41
41
  import type BetterSqlite3 from "better-sqlite3";
42
+ /**
43
+ * Slow-write reporting is injected rather than imported: this module is also
44
+ * executed directly by Node (the `node:sqlite` smoke in CI, Pi, Desktop), and
45
+ * Node's type-stripping loader does not resolve extensionless imports, so any
46
+ * static import of the plugin's logging chain here breaks that path. The
47
+ * storage bootstrap registers the real reporter; until then slow privileged
48
+ * writes are simply not logged.
49
+ */
50
+ type SlowWriteReporter = (site: string, transactionStartedAt: number) => void;
51
+ export declare function registerSlowWriteReporter(reporter: SlowWriteReporter): void;
42
52
  export type SqliteRuntime = "Bun" | "Node.js";
43
53
  type SqliteModule = {
44
54
  Database?: unknown;
@@ -51,7 +61,39 @@ export declare class SqliteRuntimeUnavailableError extends Error {
51
61
  constructor(runtime: SqliteRuntime, specifier: string, cause: unknown);
52
62
  }
53
63
  export declare function loadSqliteModule(runtime?: SqliteRuntime, importer?: (specifier: string) => Promise<SqliteModule>): Promise<SqliteModule>;
64
+ export interface SqliteConnectionMemoryStats {
65
+ sequence: number;
66
+ filename: string;
67
+ readonly: boolean;
68
+ pageSize: number | null;
69
+ pageCount: number | null;
70
+ freelistCount: number | null;
71
+ cacheSize: number | null;
72
+ cacheSizeUnit: "pages" | "kib" | null;
73
+ cacheUpperBoundBytes: number | null;
74
+ mmapSizeBytes: number | null;
75
+ walFileBytes: number | null;
76
+ shmFileBytes: number | null;
77
+ fts5TableCount: number | null;
78
+ journalMode: string | null;
79
+ }
80
+ export interface SqliteMemoryStats {
81
+ connectionCount: number;
82
+ cacheUpperBoundBytes: number;
83
+ mmapUpperBoundBytes: number;
84
+ walFileBytes: number;
85
+ shmFileBytes: number;
86
+ sqliteStatusApi: "unavailable";
87
+ connections: SqliteConnectionMemoryStats[];
88
+ }
54
89
  export declare const Database: typeof BetterSqlite3;
90
+ /**
91
+ * Read the SQLite memory bounds that Bun/node:sqlite expose without native FFI.
92
+ * SQLite's sqlite3_status()/sqlite3_db_status() counters are not surfaced by
93
+ * either runtime, so cache and mmap values are configured upper bounds rather
94
+ * than resident-byte measurements.
95
+ */
96
+ export declare function getSqliteMemoryStats(): SqliteMemoryStats;
55
97
  /** Instance type alias used by helpers and storage modules. */
56
98
  export type Database = BetterSqlite3.Database;
57
99
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/shared/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAMH,OAAO,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,SAAS,CAAC;AAE9C,KAAK,YAAY,GAAG;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,aAAa,CAWnD;AAgDD,qBAAa,6BAA8B,SAAQ,KAAK;IACpD,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAaxE;AAED,wBAAsB,gBAAgB,CAClC,OAAO,GAAE,aAAqC,EAC9C,QAAQ,GAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAsB,GAC5E,OAAO,CAAC,YAAY,CAAC,CAUvB;AAoHD,eAAO,MAAM,QAAQ,EAAE,OAAO,aAA4B,CAAC;AAE3D,+DAA+D;AAC/D,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AASpE;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,C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,YAAY,GAAG,MAAM,CA6CvE"}
1
+ {"version":3,"file":"status-detail-text.d.ts","sourceRoot":"","sources":["../../src/shared/status-detail-text.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAchD,6FAA6F;AAC7F,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAqDvE"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Cross-harness subagent runner abstraction.
3
3
  *
4
- * Magic Context spawns three kinds of subagents — historian, dreamer, sidekick —
4
+ * Magic Context spawns historian and Dreamer subagents
5
5
  * each as a child "session" with its own model/prompt/tools. OpenCode and Pi
6
6
  * have very different APIs for this:
7
7
  *
@@ -15,15 +15,15 @@
15
15
  * disk, optionally addressed via `--session <path>`.
16
16
  *
17
17
  * The runner interface below normalizes both into the same shape so the
18
- * actual subagent business logic (historian XML parsing, dreamer task loop,
19
- * sidekick augmentation) can stay harness-agnostic. Each harness ships its
18
+ * actual subagent business logic (historian XML parsing and Dreamer task loops)
19
+ * can stay harness-agnostic. Each harness ships its
20
20
  * own runner implementation; agents take a `SubagentRunner` as a dep instead
21
21
  * of reaching for `client.session.*` directly.
22
22
  *
23
23
  * Step 5a (this commit) defines the contract and ships `PiSubagentRunner`.
24
24
  * Step 5b will refactor the OpenCode-side spawn paths in
25
- * `compartment-runner-historian.ts`, `dreamer/runner.ts`, and
26
- * `sidekick/agent.ts` onto an `OpenCodeSubagentRunner` so both harnesses
25
+ * `compartment-runner-historian.ts` and `dreamer/runner.ts` onto an
26
+ * `OpenCodeSubagentRunner` so both harnesses
27
27
  * share the agent business logic instead of duplicating it. Until 5b lands,
28
28
  * OpenCode keeps its existing direct `client.session.*` calls untouched —
29
29
  * the runner contract is purely additive on the OpenCode side.
@@ -34,11 +34,11 @@ import type { ModelInput } from "./model-resolution";
34
34
  *
35
35
  * Mirrors the union of OpenCode's `session.create` + `session.prompt` body
36
36
  * fields and Pi's `--print` CLI flags, picking the shared subset that all
37
- * three subagent kinds (historian, dreamer, sidekick) actually use today.
37
+ * the historian and Dreamer subagents actually use today.
38
38
  *
39
39
  * Fields:
40
40
  * - `agent`: harness-specific agent name. OpenCode looks this up in its
41
- * agent registry (`HISTORIAN_AGENT`, `DREAMER_AGENT`, `SIDEKICK_AGENT`).
41
+ * agent registry (`HISTORIAN_AGENT`, `DREAMER_AGENT`).
42
42
  * Pi has no concept of "agent name" beyond config, so this is ignored
43
43
  * on the Pi side and used only by `OpenCodeSubagentRunner`.
44
44
  * - `systemPrompt`: full system prompt for this child run. Replaces (not
@@ -85,7 +85,7 @@ export interface SubagentRunOptions {
85
85
  /**
86
86
  * Optional progress callback. The runner invokes it for milestone events
87
87
  * during the run: spawn, first event received, terminal stop reason
88
- * detected, child exit. Used by historian/dreamer/sidekick to write
88
+ * detected, child exit. Used by historian/dreamer to write
89
89
  * lifecycle entries to the magic-context.log without polluting the
90
90
  * normal stdout stream.
91
91
  *
@@ -95,7 +95,7 @@ export interface SubagentRunOptions {
95
95
  onProgress?: (event: SubagentProgressEvent) => void;
96
96
  /** Optional token accounting metadata. When present, harness runners persist subagent_invocations. */
97
97
  accountingSessionId?: string | undefined;
98
- accountingSubagent?: "historian" | "historian_editor" | "compressor" | "dreamer" | "sidekick" | "user_memory_review" | "recomp" | undefined;
98
+ accountingSubagent?: "historian" | "historian_editor" | "compressor" | "dreamer" | "user_memory_review" | "recomp" | undefined;
99
99
  accountingTask?: string | null | undefined;
100
100
  accountingParentInvocationId?: number | null | undefined;
101
101
  }
@@ -178,6 +178,10 @@ export type SubagentProgressEvent = {
178
178
  * here so the OpenCode runner can surface the child session ID for log
179
179
  * correlation when Step 5b lands.
180
180
  */
181
+ export interface CompletedSubagentToolCall {
182
+ name: string;
183
+ arguments: Record<string, unknown>;
184
+ }
181
185
  export type SubagentRunResult = {
182
186
  ok: true;
183
187
  assistantText: string;
@@ -191,6 +195,9 @@ export type SubagentRunResult = {
191
195
  * the real session messages.
192
196
  */
193
197
  toolCallCount?: number;
198
+ /** Completed, non-error tool results preserved by runners that can
199
+ * reconstruct invocation/result pairs from their transcript. */
200
+ completedToolCalls?: CompletedSubagentToolCall[];
194
201
  meta?: Record<string, unknown>;
195
202
  } | {
196
203
  ok: false;
@@ -206,7 +213,7 @@ export type SubagentRunResult = {
206
213
  *
207
214
  * Each harness ships a single instance — the OpenCode plugin wires
208
215
  * `OpenCodeSubagentRunner` and the Pi plugin wires `PiSubagentRunner` in
209
- * its `extension` boot path. Agent code (historian, dreamer, sidekick)
216
+ * its `extension` boot path. Agent code (historian and dreamer)
210
217
  * receives the runner as a dep and never reaches for harness-specific
211
218
  * client APIs directly.
212
219
  */
@@ -1 +1 @@
1
- {"version":3,"file":"subagent-runner.d.ts","sourceRoot":"","sources":["../../src/shared/subagent-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,8DAA8D;IAC9D,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC;;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AC;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,iBAAiB,GACvB;IACI,EAAE,EAAE,IAAI,CAAC;IACT,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GACD;IACI,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EACA,gBAAgB,GAChB,SAAS,GACT,OAAO,GACP,cAAc,GACd,WAAW,GACX,cAAc,GACd,eAAe,GACf,cAAc,GACd,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAER;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,GAAG,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAChE"}
1
+ {"version":3,"file":"subagent-runner.d.ts","sourceRoot":"","sources":["../../src/shared/subagent-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,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CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,gFAAgF;IAChF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,gFAAgF;IAChF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CACP,KAAK,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,EAC1D,SAAS,EAAE,MAAM,KAChB,IAAI,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACnC;AA4FD,wBAAgB,aAAa,CACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE,oBAAyB,GACnC,mBAAmB,CAiXrB"}
@@ -147,6 +147,10 @@ export interface TranscriptPart {
147
147
  * replaced (e.g. it's already a sentinel, or it's an image part).
148
148
  */
149
149
  replaceWithSentinel(sentinelText: string): boolean;
150
+ /** Remove one half of a complete tool arc. Callers must remove both halves together. */
151
+ remove?(): boolean;
152
+ /** Refuse structural deletion when the adapter cannot match provider-native identity safely. */
153
+ canRemove?(): boolean;
150
154
  /**
151
155
  * Optional: serialized byte size of the part's REAL payload, including
152
156
  * non-text content (images, structured data) that `getText()` can't
@@ -166,6 +170,8 @@ export interface TranscriptPart {
166
170
  * use `info.id` for cross-pass correlation, never the message reference.
167
171
  */
168
172
  export interface TranscriptMessage {
173
+ /** Override when the receiving protocol does not merge adjacent assistant reasoning turns. */
174
+ requiresToolArcSkeleton?: boolean;
169
175
  /**
170
176
  * Lightweight metadata exposed for tagging, sentinel persistence, and
171
177
  * cross-pass correlation. Adapters fill these from harness-native
@@ -1 +1 @@
1
- {"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../src/shared/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,kBAAkB,GACxB,MAAM,GACN,UAAU,GACV,UAAU,GACV,aAAa,GACb,OAAO,GACP,MAAM,GACN,YAAY,GACZ,SAAS,CAAC;AAEhB;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAElC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC;;;;;;;OAOG;IACH,OAAO,IAAI,MAAM,GAAG,SAAS,CAAC;IAE9B;;;;;;;;OAQG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAElC;;;;OAIG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAExC;;;;;;;;;;;OAWG;IACH,eAAe,IAAI;QACf,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;KAC3B,CAAC;IAEF;;;;;;OAMG;IACH,YAAY,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAEhD;;;;;OAKG;IACH,YAAY,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAEvD;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,YAAY,EAAE,MA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AC;IAEvC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAE5B;;;;;;;;;;;;;OAaG;IACH,MAAM,IAAI,IAAI,CAAC;CAClB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAAiC,CAAC"}
@@ -3,6 +3,12 @@ export declare const WINDOW_OVERLAY_SCHEMA = "fusiform-window-overlay/v1";
3
3
  export declare const PROMPT_WALL_MARGIN = 4096;
4
4
  export declare const PI_OUTPUT_FLOOR = 4096;
5
5
  export declare const OPENCODE_OUTPUT_CAP = 32000;
6
+ /**
7
+ * Smallest context window any served model can plausibly have. Reported or
8
+ * inferred limits below this are placeholders (0, 1) or corrupt state, never a
9
+ * real window, so every denominator check shares this one floor.
10
+ */
11
+ export declare const MIN_PLAUSIBLE_CONTEXT_LIMIT = 1024;
6
12
  export type WindowGeometry = "shared_upfront" | "shared_truncating" | "separate";
7
13
  export type WindowReserveSource = "output_catalog" | "output_config" | "wall_margin" | "none";
8
14
  export type WindowOverlayGrade = "provider_asserted_runtime" | "measured" | "provider_asserted_doc" | "catalog" | "unknown";
@@ -45,11 +51,14 @@ export interface ResolvedWindowOverlayFacts {
45
51
  /** Includes facts whose tagged value is explicitly unknown. */
46
52
  facts: Record<string, WindowOverlayFact>;
47
53
  }
54
+ export type WindowLimitSource = "catalog" | "overlay" | "provider" | "detected";
48
55
  export interface WindowDerivation {
49
56
  window: number;
50
57
  reserve: number;
51
58
  reserveSource: WindowReserveSource;
52
59
  geometry: WindowGeometry;
60
+ windowSource: WindowLimitSource;
61
+ absoluteWall: number;
53
62
  }
54
63
  export interface WindowGeometryResult {
55
64
  usableSoft: number;
@@ -87,6 +96,20 @@ export declare function resolveWindowOverlayFacts(providerID: string, modelID: s
87
96
  /** Placeholder filtering is deliberately per output field, never a row-level rejection. */
88
97
  export declare function placeholderFilteredOutput(output: number | undefined, context: number | undefined): number | undefined;
89
98
  export declare function deriveWindowGeometry(providerID: string, modelID: string, catalogLimit: ModelLimit | undefined, options?: DeriveWindowGeometryOptions): WindowGeometryResult | undefined;
99
+ export interface ProvenInputFloorResult {
100
+ geometry: WindowGeometryResult;
101
+ refused?: {
102
+ reading: number;
103
+ absoluteWall: number;
104
+ };
105
+ }
106
+ export declare function hasTrustedAbsoluteWall(geometry: WindowGeometryResult): boolean;
107
+ /**
108
+ * Successful requests can disprove static catalog metadata, but cannot
109
+ * disprove a provider, overlay, or observed-overflow wall. A reading beyond
110
+ * that wall is malformed usage accounting and must not enlarge the geometry.
111
+ */
112
+ export declare function applyProvenInputFloor(geometry: WindowGeometryResult, provenInputTokens: number | undefined): ProvenInputFloorResult;
90
113
  export declare function formatWindowDerivationLine(inputTokens: number, result: WindowGeometryResult): string;
91
114
  export declare function formatCompactTokens(value: number): string;
92
115
  //# sourceMappingURL=window-geometry.d.ts.map
@@ -1 +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;AAK1C,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,UAAU,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,eAAe,GAAG,aAAa,GAAG,MAAM,CAAC;AAC9F,MAAM,MAAM,kBAAkB,GACxB,2BAA2B,GAC3B,UAAU,GACV,uBAAuB,GACvB,SAAS,GACT,SAAS,CAAC;AAChB,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,CAAC;AACzD,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAC;AAC1E,MAAM,MAAM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AAE,oBAAoB,GAC7B,MAAM,CASR;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQzD"}
@@ -7,5 +7,5 @@ export declare const SLOW_WRITE_TRANSACTION_THRESHOLD_MS = 1000;
7
7
  * Log a slow write only after its COMMIT has completed. The timing diagnostic is
8
8
  * deliberately best-effort so it can never change the transaction's behavior.
9
9
  */
10
- export declare function logSlowWriteTransaction(site: string, startedAt: number, thresholdMs?: number): void;
10
+ export declare function logSlowWriteTransaction(site: string, startedAt: number, thresholdMs?: number, completedAtMs?: number): void;
11
11
  //# sourceMappingURL=write-transaction-timing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"write-transaction-timing.d.ts","sourceRoot":"","sources":["../../src/shared/write-transaction-timing.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,mCAAmC,OAAQ,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,SAAsC,GAClD,IAAI,CAQN"}
1
+ {"version":3,"file":"write-transaction-timing.d.ts","sourceRoot":"","sources":["../../src/shared/write-transaction-timing.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,mCAAmC,OAAQ,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,WAAW,SAAsC,EACjD,aAAa,SAAoB,GAClC,IAAI,CAQN"}
@@ -6,8 +6,8 @@ import {
6
6
  retryPendingSessionCleanups2,
7
7
  retryPendingRustSessionCleanupsForProject2,
8
8
  clearSession2
9
- } from "./index-fz104x1j.js";
10
- import"./index-raatkvw5.js";
9
+ } from "./index-jmtjh2d3.js";
10
+ import"./index-1974jvn3.js";
11
11
  import"./index-dkv2dn46.js";
12
12
  export {
13
13
  advanceToolReclaimWatermark2 as advanceToolReclaimWatermark,
@@ -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;AAuDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAs/BrE,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;AAsDhE,OAAO,EAKH,KAAK,iBAAiB,EACzB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAoiCrE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"verification-recording.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/verification-recording.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAUvE"}
1
+ {"version":3,"file":"verification-recording.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-memory/verification-recording.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAYvE"}
@@ -1,2 +1,2 @@
1
- export declare const CTX_NOTE_DESCRIPTION = "Working notes for this session's future \u2014 reminders, follow-ups, and things to revisit later.\n\nUse a note when something matters LATER but not in the next few steps: \"revisit the retry logic after the release\", \"user wants the dashboard polish batched\", \"flaky test to investigate when touching CI\". Don't use notes for active multi-step work (use todos) or for durable project knowledge that should outlive this session (use ctx_memory). Notes resurface automatically at natural work boundaries and whenever you read them.\n\nActions:\n- write: save a note (content). Add surface_condition to make it a smart note (below).\n- read: list notes, newest first. Default: latest active session notes + ready smart notes; page older ones with limit/offset, or inspect other states with filter.\n- update / dismiss: change or retire a note by note_id.\n\nSmart notes: pass surface_condition and the note stays hidden until a background checker confirms the condition \u2014 using ONLY externally verifiable signals (GitHub state via gh, files on disk, git history, web pages). It cannot see this conversation, so the condition must be checkable from outside:\n\u2713 \"When PR #42 in cortexkit/magic-context is merged\"\n\u2713 \"When the latest release tag is >= v0.22.0\"\n\u2713 \"When packages/plugin/src/foo.ts contains a function named bar\"\n\u2717 \"When the user mentions X\" / \"when we revisit Y\" / \"after we finish this refactor\" \u2014 no external signal; write a regular note instead.\n\nExample: ctx_note(action=\"write\", content=\"Re-run the perf benchmark once the boundary rework ships\", surface_condition=\"When the latest release tag is >= v0.23.0\")";
1
+ export declare const CTX_NOTE_DESCRIPTION = "Working notes for this session \u2014 reminders, follow-ups, and things to revisit later.\n\nUse a note when something matters LATER but not in the next few steps: \"revisit the retry logic after the release\", \"user wants the dashboard polish batched\", \"flaky test to investigate when touching CI\". Don't use notes for active work (use todos) or durable project knowledge (use ctx_memory). Notes resurface at work boundaries and when read.\n\nActions:\n- write: save a note (content). Add surface_condition to make it a smart note (below).\n- read: list notes, newest first. Default: latest active session notes + ready smart notes; page older ones with limit/offset, or inspect other states with filter.\n- update: change a note by note_id. dismiss: retire one by note_id or 1\u201350 by note_ids; provide exactly one.\n\nSmart notes: pass surface_condition and the note stays hidden until a background checker confirms the condition \u2014 using ONLY externally verifiable signals (GitHub state via gh, files on disk, git history, web pages). It cannot see this conversation, so the condition must be checkable from outside:\n\u2713 \"When PR #42 in cortexkit/magic-context is merged\"\n\u2713 \"When the latest release tag is >= v0.22.0\"\n\u2713 \"When packages/plugin/src/foo.ts contains a function named bar\"\n\u2717 \"When the user mentions X\" / \"when we revisit Y\" / \"after we finish this refactor\" \u2014 no external signal; write a regular note instead.\n\nExample: ctx_note(action=\"write\", content=\"Re-run the perf benchmark once the boundary rework ships\", surface_condition=\"When the latest release tag is >= v0.23.0\")";
2
2
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,upDAeoI,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,qnDAeoI,CAAC"}
@@ -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;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
+ {"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;AAsBhE,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;AAygBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAIxF"}
@@ -10,5 +10,6 @@ export interface CtxNoteArgs extends ImitatedReducedArgs {
10
10
  /** Skip this many newest notes for read — pages older ones (default 0). */
11
11
  offset?: number;
12
12
  note_id?: number;
13
+ note_ids?: number[];
13
14
  }
14
15
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAErF,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACpD,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-note/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAErF,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACpD,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB"}
@@ -1,10 +1,19 @@
1
1
  import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ import { type ProtectionWindowResult } from "../../features/magic-context/protection-window";
2
3
  import type { RustToolBackends } from "../../plugin/rust-tool-backends";
3
4
  import type { Database } from "../../shared/sqlite";
4
5
  export { CTX_REDUCE_LIGHT_DESCRIPTION } from "../light-descriptions";
5
6
  export interface CtxReduceToolDeps {
6
7
  db: Database;
7
- protectedTags: number;
8
+ /**
9
+ * Union projection form: protectedSet (tag-number set form).
10
+ * Coordinate space: tag-number space.
11
+ * Empty-window behavior: empty set means zero tool tags are protected by the window;
12
+ * requested drops apply immediately, and non-tool tags are never reclaim targets.
13
+ */
14
+ protectedSet?: ReadonlySet<number> | ((sessionId: string) => ReadonlySet<number>);
15
+ getProtectionWindow?: (sessionId: string) => ProtectionWindowResult;
16
+ floor?: number;
8
17
  getSessionTokens?: (sessionId: string) => number;
9
18
  rustToolBackends?: RustToolBackends;
10
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-reduce/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAUhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,QAAQ,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAsND,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-reduce/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,gDAAgD,CAAC;AAUxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,QAAQ,CAAC;IACb;;;;;OAKG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAClF,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,sBAAsB,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AA+OD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAI5F"}
@@ -1,4 +1,4 @@
1
1
  export declare const CTX_SEARCH_TOOL_NAME = "ctx_search";
2
- export declare const CTX_SEARCH_DESCRIPTION = "Your long-term recall for this project \u2014 search everything that ever happened here, not just what's currently visible.\n\nReach for it when something feels familiar but isn't in view: \"did we solve this before?\", \"what did we decide about X?\", \"when did this break?\", \"where does Y live?\". Results only contain things you CANNOT currently see \u2014 memories already shown in <project-memory> and the live conversation tail are filtered out. A query that is just one or more memory ids (e.g. `#7234` or `12, 34`) bypasses text search and resolves those ids directly.\n\nSources (omit for a broad search across all):\n- memory: curated cross-session project knowledge \u2014 rules, constraints, conventions.\n- message: the raw conversation behind your compacted history. Hits include message ordinals \u2014 expand the surrounding exchange with ctx_expand(start=N-10, end=N+5).\n- git_commit: this repository's commit history.\n- note: parked decisions, follow-ups, and dismissed notes with their recorded text.\n\nPicking sources:\n- \"when did this change / was this working before\" \u2192 [\"git_commit\", \"message\"]\n- \"did we discuss this earlier\" \u2192 [\"message\"]\n- \"did we decide something about this / leave a follow-up\" \u2192 [\"note\"]\n- \"what's our convention / rule for X\" \u2192 [\"memory\"]";
2
+ export declare const CTX_SEARCH_DESCRIPTION = "Your long-term recall for this project \u2014 search everything that ever happened here, not just what's currently visible.\n\nRetrieval matches meaning as well as exact words and fuses them, so phrasing matters: phrase `query` as a natural-language question that still contains the exact terms you expect in the answer (paths, symbols, config keys, error strings); a bare keyword stack finds less than a question carrying the same words.\n- Good: \"where is the retry backoff for the upload client configured?\"\n- Bad: \"upload client retry backoff config\"\n\nReach for it when something feels familiar but isn't in view: \"did we solve this before?\", \"what did we decide about X?\", \"when did this break?\", \"where does Y live?\". Results only contain things you CANNOT currently see \u2014 memories already shown in <project-memory> and the live conversation tail are filtered out. A query that is just one or more memory ids (e.g. `#7234` or `12, 34`) bypasses text search and resolves those ids directly.\n\nSources (omit for a broad search across all):\n- memory: curated cross-session project knowledge \u2014 rules, constraints, conventions.\n- message: the raw conversation behind your compacted history. Hits include message ordinals \u2014 expand the surrounding exchange with ctx_expand(start=N-10, end=N+5).\n- git_commit: this repository's commit history.\n- note: parked decisions and follow-ups with their recorded text.\n\nPicking sources:\n- \"when did this change / was this working before\" \u2192 [\"git_commit\", \"message\"]\n- \"did we discuss this earlier\" \u2192 [\"message\"]\n- \"did we decide something about this / leave a follow-up\" \u2192 [\"note\"]\n- \"what's our convention / rule for X\" \u2192 [\"memory\"]";
3
3
  export declare const DEFAULT_CTX_SEARCH_LIMIT = 10;
4
4
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,sBAAsB,0zCAciB,CAAC;AACrD,eAAO,MAAM,wBAAwB,KAAK,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tools/ctx-search/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,eAAe,CAAC;AACjD,eAAO,MAAM,sBAAsB,4tDAkBiB,CAAC;AACrD,eAAO,MAAM,wBAAwB,KAAK,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export declare const CTX_REDUCE_LIGHT_DESCRIPTION = "For ctx_reduce users, mark spent \u00A7N\u00A7 outputs discardable; release is QUEUED, not immediate, so content stays visible until space is needed. Newest tags stay protected until they age out. Released content becomes a placeholder; recover it only by rerunning the source or recovery tool, so mark only genuinely finished material. Mark analyzed, redundant, persisted, or merely confirmatory outputs; keep user messages, unresolved errors, unextracted evidence, and exact wording. NEVER blanket-mark a large range: review every tag first.";
2
2
  export declare const CTX_EXPAND_LIGHT_DESCRIPTION = "For ctx_expand users, recover compacted conversation by passing a session-history heading's inclusive start/end ordinals. Results are raw [N] U:/A: transcript capped near 15K tokens; oversized ranges return the head and a continuation. Use verbose=true to list each message ordinal, part previews, and tool-output sizes; use message=N for one complete stored message and its tool exchanges. NEVER expand ranges after the last compartment because that live tail is already visible.";
3
- export declare const CTX_NOTE_LIGHT_DESCRIPTION = "For ctx_note users, write saves, read lists, update changes, and dismiss retires future session notes; surface_condition creates a smart note. For smart notes, NEVER use a condition tied to this conversation or an unobservable future action because the background checker can inspect only external GitHub, disk, git, or web signals.";
3
+ export declare const CTX_NOTE_LIGHT_DESCRIPTION = "For ctx_note: write saves, read lists, update changes, dismiss retires one note_id or 1\u201350 note_ids (choose one); surface_condition makes a smart note. Smart-note conditions must be externally verifiable via GitHub, disk, git, or web\u2014not this conversation or future actions.";
4
4
  export declare const CTX_MEMORY_LIGHT_DESCRIPTION = "For ctx_memory users, write one standalone durable fact with category and content; update one ID, archive one or more IDs, merge two or more IDs, or get one to twenty numeric IDs. get reads memories in every status; list remains dreamer-only, so primary agents must NEVER assume bulk-list access.";
5
- export declare const CTX_SEARCH_LIGHT_DESCRIPTION = "For ctx_search users, retrieve only hidden recall: memories not already in <project-memory>, compacted messages outside the live tail, commits, and notes. Omit sources for broad search; select memory, message, git_commit, or note to target a source, or pass memory IDs to bypass text search. Message hits continue through ctx_expand.";
5
+ export declare const CTX_SEARCH_LIGHT_DESCRIPTION = "For ctx_search users, retrieve only hidden recall: memories not in <project-memory>, compacted messages outside the live tail, commits, and notes; phrase query as a question carrying exact terms. Omit sources for broad search; select memory, message, git_commit, or note, or pass memory IDs directly. Hits expand through ctx_expand.";
6
6
  //# sourceMappingURL=light-descriptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"light-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/light-descriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,oiBAA0hB,CAAC;AAEpkB,eAAO,MAAM,4BAA4B,qeAAqe,CAAC;AAE/gB,eAAO,MAAM,0BAA0B,iVAAiV,CAAC;AAEzX,eAAO,MAAM,4BAA4B,6SAA6S,CAAC;AAEvV,eAAO,MAAM,4BAA4B,kVAAkV,CAAC"}
1
+ {"version":3,"file":"light-descriptions.d.ts","sourceRoot":"","sources":["../../src/tools/light-descriptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,oiBAA0hB,CAAC;AAEpkB,eAAO,MAAM,4BAA4B,qeAAqe,CAAC;AAE/gB,eAAO,MAAM,0BAA0B,iSAAuR,CAAC;AAE/T,eAAO,MAAM,4BAA4B,6SAA6S,CAAC;AAEvV,eAAO,MAAM,4BAA4B,iVAAiV,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.41.4",
3
+ "version": "0.42.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",
@@ -29,7 +29,6 @@
29
29
  "src/shared",
30
30
  "src/config",
31
31
  "src/agents",
32
- "src/features/magic-context/defaults.ts",
33
32
  "src/features/magic-context/dreamer/cron.ts",
34
33
  "src/features/magic-context/dreamer/task-registry.ts",
35
34
  "README.md"
@@ -51,7 +50,7 @@
51
50
  "prepublishOnly": "bun run build && bun run build:tui"
52
51
  },
53
52
  "dependencies": {
54
- "@cortexkit/subc-client": "0.4.1",
53
+ "@cortexkit/subc-client": "0.11.1",
55
54
  "@jitl/quickjs-singlefile-cjs-release-asyncify": "0.32.0",
56
55
  "@opencode-ai/plugin": "^1.17.11",
57
56
  "@opencode-ai/sdk": "^1.17.11",
@@ -24,8 +24,8 @@ import { applyDisallowedTools, buildAllowOnlyPermission } from "./permissions";
24
24
 
25
25
  // Clamp a user-provided step override to the hidden-agent's built-in cap (loop
26
26
  // insurance — see buildHiddenAgentConfig). Caps live as inline literals in
27
- // buildHiddenAgentRegistrations (historian/sidekick=40, dreamer=150): a handful
28
- // of tool calls for the historian/sidekick, a real multi-step maintenance loop
27
+ // buildHiddenAgentRegistrations (historian=40, dreamer=150): a handful
28
+ // of tool calls for the historian, a real multi-step maintenance loop
29
29
  // for the dreamer.
30
30
  function clampHiddenAgentStepLimit(value: unknown, cap: number): number {
31
31
  return typeof value === "number" && Number.isFinite(value) ? Math.min(value, cap) : cap;
@@ -75,7 +75,7 @@ export interface HiddenAgentRegistration {
75
75
  }
76
76
 
77
77
  /**
78
- * Hoisted function declaration: returns the four hidden-agent registrations with
78
+ * Hoisted function declaration: returns the hidden-agent registrations with
79
79
  * INLINE id / allow-list / step-cap literals (see {@link HiddenAgentRegistration}
80
80
  * for why these must not come from module-level `var` consts). Prompts and
81
81
  * computed overrides are passed in by the caller; the historian disallow filter
@@ -87,10 +87,8 @@ export function buildHiddenAgentRegistrations(args: {
87
87
  historianPrompt: string | undefined;
88
88
  historianRecompPrompt?: string | undefined;
89
89
  historianEditorPrompt: string | undefined;
90
- sidekickPrompt: string | undefined;
91
90
  dreamerOverrides?: Record<string, unknown>;
92
91
  historianOverrides?: Record<string, unknown>;
93
- sidekickOverrides?: Record<string, unknown>;
94
92
  historianDisallowed: readonly string[];
95
93
  }): HiddenAgentRegistration[] {
96
94
  const historianAllowedTools = applyDisallowedTools(
@@ -287,16 +285,6 @@ export function buildHiddenAgentRegistrations(args: {
287
285
  maxSteps: 40,
288
286
  overrides: args.historianOverrides,
289
287
  },
290
- {
291
- id: "sidekick",
292
- mode: "primary",
293
- hidden: true,
294
- description: HIDDEN_AGENT_DESCRIPTION,
295
- prompt: args.sidekickPrompt,
296
- allowedTools: ["ctx_search", "aft_outline", "aft_zoom"],
297
- maxSteps: 40,
298
- overrides: args.sidekickOverrides,
299
- },
300
288
  ];
301
289
  }
302
290
 
@@ -81,7 +81,7 @@ describe("buildMagicContextSection — subagent mode", () => {
81
81
  expect(out).toContain("## Magic Context");
82
82
  expect(out).toContain("§N§ identifiers");
83
83
  expect(out).toContain("ctx_reduce");
84
- expect(out).toContain("The last 20 tags are protected");
84
+ expect(out).toContain("newest token-mass window");
85
85
  });
86
86
 
87
87
  it("OMITS the long-term-partner frame and primary-only guidance", () => {
@@ -95,9 +95,11 @@ describe("buildMagicContextSection — subagent mode", () => {
95
95
  expect(out).not.toContain("ctx_expand");
96
96
  });
97
97
 
98
- it("threads protectedTags into the protected-count line", () => {
99
- const out = buildMagicContextSection(null, 7, true, false, false, false, true);
100
- expect(out).toContain("The last 7 tags are protected");
98
+ it("describes token-mass protection independently of a legacy count", () => {
99
+ const withSeven = buildMagicContextSection(null, 7, true, false, false, false, true);
100
+ const withTwenty = buildMagicContextSection(null, 20, true, false, false, false, true);
101
+ expect(withSeven).toBe(withTwenty);
102
+ expect(withSeven).toContain("newest token-mass window");
101
103
  });
102
104
 
103
105
  it("is much shorter than the full primary block", () => {
@@ -174,7 +176,7 @@ describe("buildMagicContextSection — caveman compression warning", () => {
174
176
  it("emits the warning when caveman is enabled and ctx_reduce is unavailable", () => {
175
177
  const out = buildMagicContextSection(
176
178
  null, // agent
177
- 20, // protectedTags (ignored in no-reduce path)
179
+ 20, // legacy positional value (ignored in no-reduce path)
178
180
  false, // ctx_reduce is unavailable in this session.
179
181
  false, // dreamerEnabled
180
182
  false, // temporalAwarenessEnabled