@cortexkit/opencode-magic-context 0.35.1 → 0.36.1

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 (155) hide show
  1. package/README.md +9 -5
  2. package/dist/agents/permissions.d.ts +17 -0
  3. package/dist/agents/permissions.d.ts.map +1 -1
  4. package/dist/{announcement-gms2nhya.js → announcement-6c1g4es4.js} +2 -2
  5. package/dist/config/index.d.ts.map +1 -1
  6. package/dist/config/schema/magic-context.d.ts +10 -0
  7. package/dist/config/schema/magic-context.d.ts.map +1 -1
  8. package/dist/{conflict-warning-hook-p2pmhvn7.js → conflict-warning-hook-mt0ttc4x.js} +5 -5
  9. package/dist/{derive-budgets-9crp0cvd.js → derive-budgets-88mxk2w1.js} +3 -3
  10. package/dist/features/magic-context/context-authority.d.ts +12 -0
  11. package/dist/features/magic-context/context-authority.d.ts.map +1 -1
  12. package/dist/features/magic-context/dreamer/classify.d.ts +2 -0
  13. package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
  14. package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts +4 -0
  15. package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
  16. package/dist/features/magic-context/dreamer/lease.d.ts +10 -3
  17. package/dist/features/magic-context/dreamer/lease.d.ts.map +1 -1
  18. package/dist/features/magic-context/dreamer/map-memories.d.ts +2 -0
  19. package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
  20. package/dist/features/magic-context/dreamer/module-apply.d.ts +5 -0
  21. package/dist/features/magic-context/dreamer/module-apply.d.ts.map +1 -1
  22. package/dist/features/magic-context/dreamer/promote-primers.d.ts +2 -0
  23. package/dist/features/magic-context/dreamer/promote-primers.d.ts.map +1 -1
  24. package/dist/features/magic-context/dreamer/refresh-primers.d.ts +2 -0
  25. package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
  26. package/dist/features/magic-context/dreamer/task-executor.d.ts +1 -0
  27. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  28. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +5 -2
  29. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  30. package/dist/features/magic-context/dreamer/verify.d.ts +2 -0
  31. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  32. package/dist/features/magic-context/message-index-async.d.ts.map +1 -1
  33. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  34. package/dist/features/magic-context/mural/compress-cues.d.ts +2 -0
  35. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  36. package/dist/features/magic-context/project-embedding-registry.d.ts.map +1 -1
  37. package/dist/features/magic-context/schema-fence-probe.d.ts +1 -0
  38. package/dist/features/magic-context/schema-fence-probe.d.ts.map +1 -1
  39. package/dist/features/magic-context/smart-notes/condition-compiler.d.ts +38 -0
  40. package/dist/features/magic-context/smart-notes/condition-compiler.d.ts.map +1 -0
  41. package/dist/features/magic-context/smart-notes/runner.d.ts +1 -0
  42. package/dist/features/magic-context/smart-notes/runner.d.ts.map +1 -1
  43. package/dist/features/magic-context/smart-notes/storage.d.ts +3 -3
  44. package/dist/features/magic-context/smart-notes/storage.d.ts.map +1 -1
  45. package/dist/features/magic-context/storage-clone.d.ts +6 -0
  46. package/dist/features/magic-context/storage-clone.d.ts.map +1 -1
  47. package/dist/features/magic-context/storage-db.d.ts +2 -2
  48. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  49. package/dist/features/magic-context/storage-identity-merge.d.ts.map +1 -1
  50. package/dist/features/magic-context/storage-notes.d.ts +13 -0
  51. package/dist/features/magic-context/storage-notes.d.ts.map +1 -1
  52. package/dist/features/magic-context/storage-tags.d.ts +2 -0
  53. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  54. package/dist/features/magic-context/storage.d.ts +2 -2
  55. package/dist/features/magic-context/storage.d.ts.map +1 -1
  56. package/dist/features/magic-context/user-memory/review-user-memories.d.ts +2 -0
  57. package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
  58. package/dist/hooks/magic-context/child-session-spawn.d.ts +1 -0
  59. package/dist/hooks/magic-context/child-session-spawn.d.ts.map +1 -1
  60. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  61. package/dist/hooks/magic-context/compaction-off-transition.d.ts.map +1 -1
  62. package/dist/hooks/magic-context/compartment-render-epoch.d.ts +5 -3
  63. package/dist/hooks/magic-context/compartment-render-epoch.d.ts.map +1 -1
  64. package/dist/hooks/magic-context/embed-session-state.d.ts +1 -1
  65. package/dist/hooks/magic-context/embed-session-state.d.ts.map +1 -1
  66. package/dist/hooks/magic-context/hook.d.ts +3 -0
  67. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  68. package/dist/hooks/magic-context/inject-compartments.d.ts +8 -0
  69. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  70. package/dist/hooks/magic-context/lkg-replay.d.ts +5 -2
  71. package/dist/hooks/magic-context/lkg-replay.d.ts.map +1 -1
  72. package/dist/hooks/magic-context/lkg-slot.d.ts +15 -1
  73. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  74. package/dist/hooks/magic-context/module-state-sync.d.ts +7 -0
  75. package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
  76. package/dist/hooks/magic-context/module-transport.d.ts +29 -3
  77. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  78. package/dist/hooks/magic-context/raw-fallback-context-limit.d.ts +10 -0
  79. package/dist/hooks/magic-context/raw-fallback-context-limit.d.ts.map +1 -0
  80. package/dist/hooks/magic-context/read-session-formatting.d.ts +1 -0
  81. package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
  82. package/dist/hooks/magic-context/rust-mode-transform.d.ts +10 -2
  83. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  84. package/dist/hooks/magic-context/strip-content.d.ts +6 -1
  85. package/dist/hooks/magic-context/strip-content.d.ts.map +1 -1
  86. package/dist/hooks/magic-context/system-prompt-hash.d.ts.map +1 -1
  87. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +1 -0
  88. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  89. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  90. package/dist/{index-fkyamz2w.js → index-1skzp4dc.js} +444 -98
  91. package/dist/{index-w0nygb4p.js → index-3tnkymva.js} +2 -2
  92. package/dist/{index-dpdnjawy.js → index-3zqcdwqr.js} +140 -13
  93. package/dist/{index-0c9dmw9m.js → index-8mtsfhyg.js} +33 -3
  94. package/dist/{index-k1esqfwk.js → index-f1tnb3vm.js} +1 -1
  95. package/dist/{index-kvrcg31b.js → index-mmrhhk9a.js} +8 -1
  96. package/dist/{index-h5zjfesc.js → index-nsx2n9eg.js} +3 -3
  97. package/dist/{index-dmr999a2.js → index-qf20mv7e.js} +1 -1
  98. package/dist/{index-73xz0247.js → index-tsgs7td8.js} +1 -1
  99. package/dist/{index-ry8rh8cv.js → index-wgvxkqpx.js} +5 -4
  100. package/dist/{index-8aaadh98.js → index-zp6x6s6a.js} +3 -3
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +1556 -619
  103. package/dist/plugin/dream-timer.d.ts +1 -0
  104. package/dist/plugin/dream-timer.d.ts.map +1 -1
  105. package/dist/plugin/hooks/create-session-hooks.d.ts +3 -0
  106. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  107. package/dist/plugin/messages-transform.d.ts +5 -5
  108. package/dist/plugin/messages-transform.d.ts.map +1 -1
  109. package/dist/plugin/rust-tool-backends.d.ts +4 -0
  110. package/dist/plugin/rust-tool-backends.d.ts.map +1 -1
  111. package/dist/{recomp-orchestrator-29f4rqax.js → recomp-orchestrator-a0g9b52q.js} +8 -8
  112. package/dist/{safe-notification-target-q9jk5n44.js → safe-notification-target-c11fdda2.js} +3 -3
  113. package/dist/{send-session-notification-sr5g06hz.js → send-session-notification-bgtf4853.js} +4 -4
  114. package/dist/shared/conflict-fixer.d.ts.map +1 -1
  115. package/dist/shared/data-path.d.ts +27 -0
  116. package/dist/shared/data-path.d.ts.map +1 -1
  117. package/dist/shared/harness-provider-map.d.ts +23 -20
  118. package/dist/shared/harness-provider-map.d.ts.map +1 -1
  119. package/dist/shared/jsonc-edit.d.ts +18 -0
  120. package/dist/shared/jsonc-edit.d.ts.map +1 -0
  121. package/dist/shared/jsonc-parser.d.ts +11 -1
  122. package/dist/shared/jsonc-parser.d.ts.map +1 -1
  123. package/dist/shared/prompt-surface-runtime.d.ts +15 -2
  124. package/dist/shared/prompt-surface-runtime.d.ts.map +1 -1
  125. package/dist/shared/prompt-surface.d.ts +5 -3
  126. package/dist/shared/prompt-surface.d.ts.map +1 -1
  127. package/dist/shared/rpc-utils.d.ts +16 -0
  128. package/dist/shared/rpc-utils.d.ts.map +1 -1
  129. package/dist/shared/tui-preferences.d.ts +9 -0
  130. package/dist/shared/tui-preferences.d.ts.map +1 -1
  131. package/dist/{storage-meta-session-ev8b55a9.js → storage-meta-session-df9tstzr.js} +4 -4
  132. package/dist/tools/ctx-note/tools.d.ts.map +1 -1
  133. package/package.json +4 -3
  134. package/src/agents/permissions.ts +87 -0
  135. package/src/config/compaction-accessor-guard.test.ts +9 -4
  136. package/src/config/index.test.ts +23 -0
  137. package/src/config/index.ts +41 -9
  138. package/src/config/schema/magic-context.test.ts +4 -1
  139. package/src/config/schema/magic-context.ts +18 -3
  140. package/src/shared/conflict-fixer.test.ts +174 -0
  141. package/src/shared/conflict-fixer.ts +66 -70
  142. package/src/shared/data-path.test.ts +65 -9
  143. package/src/shared/data-path.ts +66 -1
  144. package/src/shared/harness-provider-map.test.ts +42 -1
  145. package/src/shared/harness-provider-map.ts +48 -26
  146. package/src/shared/jsonc-edit.ts +295 -0
  147. package/src/shared/jsonc-parser.test.ts +33 -0
  148. package/src/shared/jsonc-parser.ts +54 -2
  149. package/src/shared/prompt-surface-runtime.ts +13 -5
  150. package/src/shared/prompt-surface.test.ts +53 -2
  151. package/src/shared/prompt-surface.ts +20 -9
  152. package/src/shared/rpc-utils.test.ts +36 -0
  153. package/src/shared/rpc-utils.ts +71 -0
  154. package/src/shared/tui-preferences.test.ts +52 -2
  155. package/src/shared/tui-preferences.ts +42 -17
@@ -28,6 +28,7 @@ interface ProjectRegistration {
28
28
  enabled: boolean;
29
29
  model?: string;
30
30
  };
31
+ retinaHandoff?: boolean;
31
32
  embeddingConfig?: {
32
33
  provider?: string;
33
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dream-timer.d.ts","sourceRoot":"","sources":["../../src/plugin/dream-timer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AASvF,OAAO,EAEH,KAAK,wBAAwB,EAChC,MAAM,8DAA8D,CAAC;AAOtE,OAAO,KAAK,EACR,aAAa,EACb,iBAAiB,EACpB,MAAM,iDAAiD,CAAC;AA4BzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAGpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAS7C;;;;;GAKG;AACH,UAAU,mBAAmB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2BAA2B,CAAC,EAAE,MAAM,CA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Q,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,CACvB,EAAE,EAAE,QAAQ,EACZ,eAAe,EAAE,MAAM,KACtB,wBAAwB,GAAG,IAAI,CAAC;IACrC;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,CACvB,SAAS,EAAE,MAAM,KAChB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,kBAAkB,GAAG,IAAI,CAAC;IACpE,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,EAAE,aAAa,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IAChG,YAAY,CAAC,EAAE,oBAAoB,GAAG;QAClC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE;YACrB,kBAAkB,EAAE,MAAM,CAAC;YAC3B,OAAO,EAAE,MAAM,CAAC;YAChB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;SAChC,KAAK,OAAO,CAAC;YAAE,SAAS,EAAE;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAC;gBAAC,UAAU,CAAC,EAAE,MAAM,CAAA;aAAE,GAAG,IAAI,CAAA;SAAE,CAAC,CAAC;KAChF,CAAC;CACL;AAkDD;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CACzC,IAAI,EAAE,mBAAmB,GAC1B,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC,CAoEnC"}
@@ -32,6 +32,9 @@ export declare function buildMagicContextHookConfig(pluginConfig: MagicContextPl
32
32
  language?: string;
33
33
  historian?: import("../../config/schema/magic-context").HistorianConfig;
34
34
  dreamer?: import("../../config/schema/magic-context").DreamerConfig;
35
+ smart_notes: {
36
+ retina_handoff: boolean;
37
+ };
35
38
  cache_ttl: string | {
36
39
  default: string;
37
40
  [modelKey: string]: string;
@@ -1 +1 @@
1
- {"version":3,"file":"create-session-hooks.d.ts","sourceRoot":"","sources":["../../../src/plugin/hooks/create-session-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAO7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,YAAY,EAAE,wBAAwB;;;;;;;;;mBACxD,CAAC;aAA2B,CAAC;aAQnD,CAPC;eAA8B,CAAA;;;;;;;;;;;;;;;;;;;;;eA0Fw4lB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA7E36lB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACrC,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;qBAqEmpJ,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAApoE,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAAujzD,CAAC;;;;;;;;;EAvCjv4D;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,g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uBAAiB,CAAC;;;;;;;;;;;;;qBAApoE,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAA445D,CAAC;;;;;;;;;EAvCtk/D;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAChD,GAAG,EAAE,aAAa,CAAC;IACnB,YAAY,EAAE,wBAAwB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;;;;;;;;;qBA+BmpJ,CAAC;iBAA2B,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;;;;;;;;qBAApoE,CAAC;mBAAyB,CAAC;iBAAuB,CAAC;iBAAuB,CAAC;0BAAc,CAAC;uBAAiB,CAAC;;;;;;0BAA445D,CAAC;;;;;;;;;GADtk/D"}
@@ -17,9 +17,9 @@ type MagicContextTransformHooks = {
17
17
  *
18
18
  * Error handling is tiered:
19
19
  *
20
- * - **FailClosedBlockingError / EmergencyFailClosedError**: Intentional loud
21
- * aborts. Rethrown so the TUI surfaces the message and the turn does not
22
- * silently fall through to native compaction.
20
+ * - **FailClosedBlockingError / EmergencyFailClosedError / RawFallbackContextLimitError**:
21
+ * Intentional loud aborts. Rethrown so the TUI surfaces the message and the turn does not
22
+ * silently fall through to native compaction or a provider-rejected raw prompt.
23
23
  *
24
24
  * - **SQLITE_BUSY**: Transient, expected from concurrent plugin processes
25
25
  * (second OpenCode instance, long dreamer/historian child session, slow
@@ -39,8 +39,8 @@ type MagicContextTransformHooks = {
39
39
  * 3. Return with messages unmodified for this pass.
40
40
  *
41
41
  * Ordinary transform failures are not rethrown because OpenCode's Effect pipeline
42
- * turns thrown errors into user-visible prompt failures. FailClosedBlockingError
43
- * and EmergencyFailClosedError are the intentional exceptions and are rethrown.
42
+ * turns thrown errors into user-visible prompt failures. FailClosedBlockingError,
43
+ * EmergencyFailClosedError, and RawFallbackContextLimitError are intentional exceptions.
44
44
  * We accept degraded behavior (no injection / no drops this turn) rather than
45
45
  * blocking the user for ordinary bugs — but deterministic inoperability must
46
46
  * block loudly when fail_closed_blocking is on.
@@ -1 +1 @@
1
- {"version":3,"file":"messages-transform.d.ts","sourceRoot":"","sources":["../../src/plugin/messages-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,oBAAoB,EAI5B,MAAM,6CAA6C,CAAC;AAoBrD,KAAK,gBAAgB,GAAG;IACpB,IAAI,EAAE,OAAO,kBAAkB,EAAE,OAAO,CAAC;IACzC,KAAK,EAAE,OAAO,kBAAkB,EAAE,IAAI,EAAE,CAAC;CAC5C,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC;AAEhE,KAAK,0BAA0B,GAAG;IAC9B,sCAAsC,CAAC,EAAE,CACrC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC5B,MAAM,EAAE,uBAAuB,KAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB,GAAG,IAAI,CAAC;AAMT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE;IACjD,YAAY,EAAE,0BAA0B,CAAC;IACzC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,0BAA0B,CAAC;IACnD,UAAU,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACzC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD,GAAG,CAAC,KAAK,EAAE,MAAM,CA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AAO,CAAC,gBAAgB,EAAE,CAAC,CAuLjG"}
@@ -11,6 +11,10 @@ export interface RustNoteToolRequest {
11
11
  action: "write" | "read" | "update" | "dismiss";
12
12
  content?: string;
13
13
  surfaceCondition?: string;
14
+ compiledProvider?: string | null;
15
+ compiledConfig?: string | null;
16
+ compiledAt?: number | null;
17
+ compileStatus?: "compiled" | "plain" | "refused";
14
18
  filter?: "all" | "active" | "pending" | "ready" | "dismissed";
15
19
  limit?: number;
16
20
  offset?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"rust-tool-backends.d.ts","sourceRoot":"","sources":["../../src/plugin/rust-tool-backends.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAChC,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IAClC,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,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amz2w.js";
13
- import"./index-ry8rh8cv.js";
12
+ } from "./index-1skzp4dc.js";
13
+ import"./index-wgvxkqpx.js";
14
14
  import"./index-td9depx5.js";
15
- import"./index-h5zjfesc.js";
16
- import"./index-dpdnjawy.js";
17
- import"./index-w0nygb4p.js";
18
- import"./index-0c9dmw9m.js";
15
+ import"./index-nsx2n9eg.js";
16
+ import"./index-3zqcdwqr.js";
17
+ import"./index-3tnkymva.js";
18
+ import"./index-8mtsfhyg.js";
19
19
  import"./index-d62ypazr.js";
20
- import"./index-k1esqfwk.js";
21
- import"./index-kvrcg31b.js";
20
+ import"./index-f1tnb3vm.js";
21
+ import"./index-mmrhhk9a.js";
22
22
  import"./index-wckvcay0.js";
23
23
  export {
24
24
  setRecompTerminal,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  isDefaultSessionTitle,
3
3
  waitForSafeNotificationTarget
4
- } from "./index-73xz0247.js";
5
- import"./index-k1esqfwk.js";
6
- import"./index-kvrcg31b.js";
4
+ } from "./index-tsgs7td8.js";
5
+ import"./index-f1tnb3vm.js";
6
+ import"./index-mmrhhk9a.js";
7
7
  import"./index-wckvcay0.js";
8
8
  export {
9
9
  waitForSafeNotificationTarget,
@@ -5,10 +5,10 @@ import {
5
5
  flushIgnoredMessages,
6
6
  sendIgnoredMessage,
7
7
  sendUserPrompt
8
- } from "./index-h5zjfesc.js";
9
- import"./index-w0nygb4p.js";
10
- import"./index-k1esqfwk.js";
11
- import"./index-kvrcg31b.js";
8
+ } from "./index-nsx2n9eg.js";
9
+ import"./index-3tnkymva.js";
10
+ import"./index-f1tnb3vm.js";
11
+ import"./index-mmrhhk9a.js";
12
12
  import"./index-wckvcay0.js";
13
13
  export {
14
14
  sendUserPrompt,
@@ -1 +1 @@
1
- {"version":3,"file":"conflict-fixer.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-fixer.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,cAAc,EAItB,MAAM,qBAAqB,CAAC;AAgJ7B;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,YAAY,CACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,EACtC,OAAO,CAAC,EAAE,mBAAmB,GAC9B,MAAM,EAAE,CA0HV"}
1
+ {"version":3,"file":"conflict-fixer.d.ts","sourceRoot":"","sources":["../../src/shared/conflict-fixer.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,cAAc,EAItB,MAAM,qBAAqB,CAAC;AAyJ7B;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,mBAAmB;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,YAAY,CACxB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,EACtC,OAAO,CAAC,EAAE,mBAAmB,GAC9B,MAAM,EAAE,CA6GV"}
@@ -115,6 +115,33 @@ export declare function getOpenCodeStorageDir(): string;
115
115
  * - Future cross-harness session migration
116
116
  *
117
117
  * Layout: <XDG_DATA_HOME>/cortexkit/magic-context/
118
+ *
119
+ * TEST-ISOLATION GUARD. `openDatabase()` has been guarded in
120
+ * `resolveDatabasePath()` since the 2026-06-01 (v26) and 2026-06-19 (v41)
121
+ * incidents, in which unisolated tests migrated the user's REAL shared DB.
122
+ * Every OTHER caller bypassed that guard — notably the CLI doctors, which
123
+ * build `join(getMagicContextStorageDir(), "context.db")` themselves and run
124
+ * `PRAGMA integrity_check` against it. A test that deletes XDG_DATA_HOME to
125
+ * exercise path fallbacks cannot restore isolation by setting
126
+ * `process.env.HOME`: bun caches `os.homedir()` at startup, so `getDataDir()`
127
+ * still resolves to the real home. MAGIC_CONTEXT_TEST_DATA_DIR — set by
128
+ * `packages/plugin/test-preload.ts`, and restored by any test that touches it
129
+ * — is honored here, so the preload's "cannot be defeated" guarantee holds for
130
+ * every caller, not just `openDatabase()`. It is never set in production.
131
+ *
132
+ * CWD-INDEPENDENT BACKSTOP. The preload only runs when `bun test`'s CWD has a
133
+ * bunfig wiring `[test] preload`. A run from a dir WITHOUT that wiring (a
134
+ * package missing its bunfig, or a brand-new one) executes every *.test.ts with
135
+ * NO preload, and this resolver would hand back the REAL shared path — which is
136
+ * how the live DB reached v41. Bun sets NODE_ENV=test for EVERY `bun test`
137
+ * regardless of CWD, and production never sets it, so that window redirects to
138
+ * a memoized throwaway dir instead. It lives here rather than in
139
+ * `resolveDatabasePath()` so direct callers (the CLI doctors' own
140
+ * `PRAGMA integrity_check`, announcements, the models.dev cache) are covered
141
+ * too — they never go through the DB resolver.
142
+ *
143
+ * XDG_DATA_HOME still wins over both: a test that manages its own data home is
144
+ * already controlled, and production has no test dir set at all.
118
145
  */
119
146
  export declare function getMagicContextStorageDir(): string;
120
147
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"data-path.d.ts","sourceRoot":"","sources":["../../src/shared/data-path.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAEvD,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,SAAwB,GAAG,MAAM,CAEhF;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,GAAE,SAAwB,GAAG,MAAM,CAOhF;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,SAAwB,GAAG,MAAM,CAErF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnE;AAKD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAkBxE;AAED;;;;;;;;;;;;;GAaG;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,uCAAuC,IAAI,MAAM,CAEhE;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C"}
@@ -2,33 +2,32 @@
2
2
  * Provider-id translation between the canonical (OpenCode) form stored in the
3
3
  * shared magic-context config and Pi's harness-native provider ids.
4
4
  *
5
- * OpenCode and Pi now share ONE config, but a few auth-plugin providers were
6
- * named differently on each side. The model id AFTER the slash is identical;
7
- * only the provider prefix differs:
5
+ * Provider IDs are a harness boundary, not a database identity. Shared config
6
+ * always stores the canonical OpenCode form. Each non-OpenCode harness owns an
7
+ * explicit pair of edge transforms:
8
8
  *
9
- * canonical (OpenCode) Pi's preferred auth-plugin form
10
- * -------------------- ------------------------------
9
+ * canonical (OpenCode) Pi / OMP selector
10
+ * -------------------- -----------------
11
11
  * openai/<model> openai-codex/<model>
12
12
  * google/<model> google-antigravity/<model>
13
13
  * anthropic/<model> anthropic/<model> (same; every other provider too)
14
14
  *
15
- * The mapping is intentionally not a one-to-one provider identity. Pi also
16
- * exposes plain `openai` and `google` providers for direct API keys, while the
17
- * canonical prefix does not record whether a subscription or API-key backend
18
- * should win. Pi therefore starts with the preferred auth-plugin form at the
19
- * spawn boundary and subagent-runner may retry once with the untranslated
20
- * canonical form when that form reports missing credentials. The runner caches
21
- * the winning form per provider prefix in memory only; setup writes still use
22
- * the reverse mapping below so configs remain canonical.
15
+ * Pi and OMP currently expose the same two subscription-provider aliases, but
16
+ * their exported functions remain distinct deliberately. A future OMP catalog
17
+ * rename must not silently change plain-Pi behavior (or vice versa).
23
18
  *
24
- * Canonical = OpenCode: the config always stores the OpenCode form. Pi
25
- * translates at its edges:
26
- * - read: canonical -> Pi when spawning a configured model (subagent-runner),
27
- * with the runtime credential fallback described above.
28
- * - write: Pi -> canonical in the Pi setup wizard, so a config written from
29
- * the Pi side stays readable by OpenCode.
19
+ * The mapping is intentionally not a one-to-one provider identity. Both
20
+ * harnesses also expose plain `openai` and `google` providers for direct API
21
+ * keys, while the canonical prefix does not record whether a subscription or
22
+ * API-key backend should win. The runtime starts with the preferred
23
+ * subscription form and subagent-runner may retry once with the untranslated
24
+ * canonical form when that form reports missing credentials.
30
25
  *
31
- * OpenCode needs no translation (canonical IS the OpenCode form).
26
+ * Only the provider prefix before the first slash is translated. Model IDs,
27
+ * including nested IDs containing more slashes, are preserved byte-for-byte.
28
+ * Scoped or otherwise unknown provider prefixes are identities.
29
+ *
30
+ * OpenCode needs no translation because canonical is its native form.
32
31
  */
33
32
  /** Pi-native `provider/model` -> canonical (OpenCode). Identity when unmapped.
34
33
  * Used by the Pi setup wizard so configs it writes stay OpenCode-readable. */
@@ -37,4 +36,8 @@ export declare function piModelRefToCanonical(ref: string): string;
37
36
  * Pi. Idempotent: normalizes any Pi-form prefix back to canonical first, so it
38
37
  * is safe on a config that already holds Pi-form ids (hand-edited or pre-fix). */
39
38
  export declare function resolveModelRefForPi(ref: string): string;
39
+ /** OMP-native selector -> canonical shared-config model reference. */
40
+ export declare function ompModelRefToCanonical(ref: string): string;
41
+ /** Canonical shared-config model reference -> OMP-native selector. */
42
+ export declare function resolveModelRefForOmp(ref: string): string;
40
43
  //# sourceMappingURL=harness-provider-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"harness-provider-map.d.ts","sourceRoot":"","sources":["../../src/shared/harness-provider-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAuBH;+EAC+E;AAC/E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;mFAEmF;AACnF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD"}
1
+ {"version":3,"file":"harness-provider-map.d.ts","sourceRoot":"","sources":["../../src/shared/harness-provider-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAoCH;+EAC+E;AAC/E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;mFAEmF;AACnF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD"}
@@ -0,0 +1,18 @@
1
+ import { type JSONPath } from "jsonc-parser";
2
+ /**
3
+ * Replace one JSONC value without reserializing the rest of the document. New
4
+ * paths use jsonc-parser's structural edit so the original document remains
5
+ * untouched outside the inserted property.
6
+ */
7
+ export declare function setJsoncValue(text: string, path: JSONPath, value: unknown): string;
8
+ /**
9
+ * Remove matching array entries while retaining the exact bytes for survivor
10
+ * comments and surrounding JSONC regions.
11
+ */
12
+ export declare function removeJsoncArrayEntries(text: string, path: JSONPath, shouldRemove: (entry: unknown) => boolean): {
13
+ text: string;
14
+ removed: boolean;
15
+ };
16
+ /** Append values to an existing JSONC array without reserializing sibling fields. */
17
+ export declare function appendJsoncArrayValues(text: string, path: JSONPath, values: unknown[]): string;
18
+ //# sourceMappingURL=jsonc-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonc-edit.d.ts","sourceRoot":"","sources":["../../src/shared/jsonc-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,QAAQ,EAKhB,MAAM,cAAc,CAAC;AAoOtB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CASlF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAC1C;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAiBpC;AAED,qFAAqF;AACrF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAY9F"}
@@ -1,5 +1,15 @@
1
1
  export declare function stripJsonComments(content: string): string;
2
- export declare function parseJsonc<T = unknown>(content: string): T;
2
+ export declare function isPrototypePollutionKey(key: string): boolean;
3
+ export interface ParsedJsonSanitizerOptions {
4
+ onRejectedKey?: (path: readonly (string | number)[]) => void;
5
+ }
6
+ /**
7
+ * Copy parsed JSON into fresh own-property-only containers while rejecting keys
8
+ * that can alter an object's prototype during a later merge. Rebuilding objects
9
+ * also removes an already-polluted prototype produced by third-party parsers.
10
+ */
11
+ export declare function sanitizeParsedJson<T>(value: T, options?: ParsedJsonSanitizerOptions, path?: readonly (string | number)[]): T;
12
+ export declare function parseJsonc<T = unknown>(content: string, options?: ParsedJsonSanitizerOptions): T;
3
13
  export declare function readJsoncFile<T = unknown>(filePath: string): T | null;
4
14
  export declare function detectConfigFile(basePath: string): {
5
15
  format: "json" | "jsonc" | "none";
@@ -1 +1 @@
1
- {"version":3,"file":"jsonc-parser.d.ts","sourceRoot":"","sources":["../../src/shared/jsonc-parser.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA6DzD;AA6CD,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAG1D;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAMrE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAChD,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CAChB,CAaA"}
1
+ {"version":3,"file":"jsonc-parser.d.ts","sourceRoot":"","sources":["../../src/shared/jsonc-parser.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA6DzD;AA+CD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,MAAM,WAAW,0BAA0B;IACvC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,IAAI,CAAC;CAChE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAChC,KAAK,EAAE,CAAC,EACR,OAAO,GAAE,0BAA+B,EACxC,IAAI,GAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAO,GACxC,CAAC,CA4BH;AAED,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAClC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,0BAA+B,GACzC,CAAC,CAGH;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAMrE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAChD,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;CAChB,CAaA"}
@@ -1,8 +1,21 @@
1
1
  import { type ConfigHarness } from "../config/migrate-config-location";
2
2
  import { type PromptSurfaceConfig, type PromptSurfacePreset } from "./prompt-surface";
3
+ /**
4
+ * The single source of truth for the ctx_* tools exposed by the prompt surface.
5
+ * Consumers derive their registries and light-description catalogs from this list
6
+ * so adding a tool cannot silently skip one prompt-surface integration point.
7
+ */
8
+ export declare const ACTIVE_TOOL_IDS: readonly ["ctx_reduce", "ctx_expand", "ctx_note", "ctx_memory", "ctx_search"];
9
+ /** @deprecated Use ACTIVE_TOOL_IDS. Kept as an alias for existing consumers. */
3
10
  export declare const PROMPT_SURFACE_TOOL_IDS: readonly ["ctx_reduce", "ctx_expand", "ctx_note", "ctx_memory", "ctx_search"];
4
- export type PromptSurfaceToolId = (typeof PROMPT_SURFACE_TOOL_IDS)[number];
5
- export declare const LIGHT_TOOL_DESCRIPTIONS: Readonly<Record<PromptSurfaceToolId, string>>;
11
+ export type PromptSurfaceToolId = (typeof ACTIVE_TOOL_IDS)[number];
12
+ export declare const LIGHT_TOOL_DESCRIPTIONS: {
13
+ readonly ctx_reduce: "For ctx_reduce users, mark spent §N§ 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.";
14
+ readonly ctx_expand: "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.";
15
+ readonly ctx_note: "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.";
16
+ readonly ctx_memory: "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.";
17
+ readonly ctx_search: "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.";
18
+ };
6
19
  /**
7
20
  * Preserve the existing full-preset hash exactly while giving other presets a
8
21
  * distinct semantic cache identity, including during any future asset fallback.
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-surface-runtime.d.ts","sourceRoot":"","sources":["../../src/shared/prompt-surface-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,KAAK,aAAa,EAGrB,MAAM,mCAAmC,CAAC;AAS3C,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAE3B,MAAM,kBAAkB,CAAC;AAK1B,eAAO,MAAM,uBAAuB,+EAM1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3E,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAMjF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CACrC,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,mBAA4B,GACrC,MAAM,CAIR;AAID,MAAM,WAAW,8BAA8B;IAC3C,sCAAsC;IACtC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,qFAAqF;IACrF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kCAAkC;IAC/C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;CACvE;AAED,MAAM,WAAW,oBAAoB;IACjC,mBAAmB,EAAE,CACjB,MAAM,EAAE,mBAAmB,GAAG,SAAS,KACtC,kCAAkC,CAAC;IACxC,eAAe,EAAE,CACb,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAC3B,8BAA8B,CAAC;CACvC;AAED,MAAM,WAAW,iCAAiC;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,SAAS,C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WAAW,kCAAkC;IAC/C,MAAM,EAAE,mBAAmB,CAAC;IAC5B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,KAAK,MAAM,CAAC;CACvE;AAED,MAAM,WAAW,oBAAoB;IACjC,mBAAmB,EAAE,CACjB,MAAM,EAAE,mBAAmB,GAAG,SAAS,KACtC,kCAAkC,CAAC;IACxC,eAAe,EAAE,CACb,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAC3B,8BAA8B,CAAC;CACvC;AAED,MAAM,WAAW,iCAAiC;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAwBD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,iCAAiC,GAC3C,oBAAoB,CAkGtB;AAQD,uFAAuF;AACvF,wBAAgB,qCAAqC,CAAC,OAAO,EAAE,oBAAoB,GAAG;IAClF,OAAO,EAAE,CACL,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAC3B,8BAA8B,CAAC;IACpC,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAkBA"}
@@ -11,10 +11,12 @@ export interface PromptSurfaceConfig {
11
11
  guidance_override_path?: string;
12
12
  tool_descriptions?: Readonly<Record<string, string>>;
13
13
  }
14
- export type PromptSurfaceResolutionSource = "exact" | "wildcard" | "default";
15
- /** Validate the literal provider/model and provider/* key grammar. */
14
+ /** Stable wire identity for the config fields that can alter a served prompt surface. */
15
+ export declare function promptSurfaceConfigIdentity(config: PromptSurfaceConfig | undefined): string;
16
+ export type PromptSurfaceResolutionSource = "exact" | "bare" | "wildcard" | "default";
17
+ /** Validate bare model, provider/model, and provider/* routing keys. */
16
18
  export declare function isValidPromptSurfaceModelKey(key: string): boolean;
17
- export type ModelKeyLookupSource = PromptSurfaceResolutionSource | "bare";
19
+ export type ModelKeyLookupSource = Exclude<PromptSurfaceResolutionSource, "default">;
18
20
  export interface ModelKeyCandidate {
19
21
  key: string;
20
22
  source: ModelKeyLookupSource;
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-surface.d.ts","sourceRoot":"","sources":["../../src/shared/prompt-surface.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACvD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD;AAED,MAAM,MAAM,6BAA6B,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7E,sEAAsE;AACtE,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAwBjE;AAED,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,GAAG,MAAM,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,oBAAoB,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,EAAE,CA2BrF;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CAAC,CAAC,EACrC,MAAM,EAAE,QAAQ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tF,wEAAwE;AACxE,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAyBjE;AAED,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAC;AAErF,MAAM,WAAW,iBAAiB;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,oBAAoB,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,EAAE,CA2BrF;AAED,0EAA0E;AAC1E,wBAAgB,uBAAuB,CAAC,CAAC,EACrC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,EAC/C,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC7B;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,GAAG,SAAS,CAWxD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,mBAAmB,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC7B;IAAE,MAAM,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,6BAA6B,CAAA;CAAE,CASxE;AAED,sEAAsE;AACtE,wBAAgB,2BAA2B,CAAC,CAAC,EACzC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EACnC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,CAAC,GACZ,CAAC,CAEH"}
@@ -41,9 +41,25 @@ export declare function isPidIdentityPlausible(record: RpcPortFileRecord): boole
41
41
  export declare function __setRpcIdentityTestHooks(hooks: {
42
42
  readFileSync?: typeof readFileSync;
43
43
  execFileSync?: typeof execFileSync;
44
+ processListExecFileSync?: typeof execFileSync;
44
45
  platform?: NodeJS.Platform;
45
46
  nowMs?: () => number;
46
47
  }): void;
47
48
  export declare function __resetRpcIdentityTestHooks(): void;
49
+ /** Result of checking whether Pi/OMP processes may currently hold the shared database. */
50
+ export interface PiProcessDiscovery {
51
+ state: "known" | "unreadable";
52
+ processIds: number[];
53
+ error?: string;
54
+ }
55
+ /**
56
+ * Inspect Pi/OMP processes without converting a failed process-list probe into
57
+ * false evidence that no harness is running. Destructive maintenance callers
58
+ * use the unreadable state to fail closed; ordinary migration guards retain
59
+ * their historical best-effort process list through discoverLivePiProcessIds().
60
+ */
61
+ export declare function inspectLivePiProcesses(): PiProcessDiscovery;
62
+ /** Enumerate live Pi/OMP harness processes before deciding whether migration can proceed. */
63
+ export declare function discoverLivePiProcessIds(): number[];
48
64
  export declare function parseRpcPortFile(content: string, fallbackPid?: number): RpcPortFileRecord | null;
49
65
  //# sourceMappingURL=rpc-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-utils.d.ts","sourceRoot":"","sources":["../../src/shared/rpc-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,sCAAsC;AACtC,wBAAgB,eAAe,CAC3B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,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unknown>):
27
27
  export declare function computeEffectiveOrder(root: Record<string, unknown>, pluginKey: string, defaultOrder: number): number;
28
28
  type JsonValue = string | number | boolean | null;
29
29
  export declare function queueTuiPreferenceUpdate(pluginKey: string, path: string[], value: JsonValue): Promise<void>;
30
+ type WatchReadFile = (file: string) => Promise<string>;
31
+ type WatchDirectory = (directory: string, listener: (event: string, filename: string | null) => void) => {
32
+ close(): void;
33
+ };
34
+ export declare function __setTuiPreferencesWatchTestHooks(hooks: {
35
+ readFile?: WatchReadFile;
36
+ watch?: WatchDirectory;
37
+ }): void;
38
+ export declare function __resetTuiPreferencesWatchTestHooks(): void;
30
39
  export declare function watchTuiPreferences(onChange: () => void): () => void;
31
40
  export {};
32
41
  //# sourceMappingURL=tui-preferences.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tui-preferences.d.ts","sourceRoot":"","sources":["../../src/shared/tui-preferences.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,kBAAkB,kCAAkC,CAAC;AAGlE,wBAAgB,qBAAqB,IAAI,MAAM,CAO9C;AAQD,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAS/E;AAMD,wBAAgB,0BAA0B,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASpE;AAED,eAAO,MAAM,UAAU,kBAAkB,CAAC;AAC1C,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAE3B,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,QAAQ,EAAE;QACN,SAAS,EAAE,OAAO,CAAC;QACnB,MAAM,EAAE,OAAO,CAAC;QAChB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AAE;IACrD,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,KAAK,CAAC,EAAE,cAAc,CAAC;CAC1B,GAAG,IAAI,CAGP;AAED,wBAAgB,mCAAmC,IAAI,IAAI,CAG1D;AAaD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CA0CpE"}
@@ -5,10 +5,10 @@ import {
5
5
  markSessionCleanupPending,
6
6
  retryPendingSessionCleanups,
7
7
  updateSessionMeta
8
- } from "./index-dpdnjawy.js";
9
- import"./index-w0nygb4p.js";
10
- import"./index-k1esqfwk.js";
11
- import"./index-kvrcg31b.js";
8
+ } from "./index-3zqcdwqr.js";
9
+ import"./index-3tnkymva.js";
10
+ import"./index-f1tnb3vm.js";
11
+ import"./index-mmrhhk9a.js";
12
12
  import"./index-wckvcay0.js";
13
13
  export {
14
14
  updateSessionMeta,
@@ -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;AAahE,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;AAuaD,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;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/opencode-magic-context",
3
- "version": "0.35.1",
3
+ "version": "0.36.1",
4
4
  "type": "module",
5
5
  "description": "OpenCode plugin for Magic Context — cross-session memory and context management",
6
6
  "main": "dist/index.js",
@@ -35,10 +35,10 @@
35
35
  "README.md"
36
36
  ],
37
37
  "scripts": {
38
- "build": "bun run build:tui && rm -f dist/index.js dist/*-*.js && bun build src/index.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --external @huggingface/transformers --external onnxruntime-web --external bun:sqlite --external node:sqlite && tsc --emitDeclarationOnly",
38
+ "build": "tsc -p ../retina-local-fs/tsconfig.build.json && bun run build:tui && rm -f dist/index.js dist/*-*.js && bun build src/index.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --external @huggingface/transformers --external onnxruntime-web --external bun:sqlite --external node:sqlite && tsc --emitDeclarationOnly",
39
39
  "build:tui": "bun scripts/build-tui.ts",
40
40
  "check:tui-compiled": "bun run build:tui && git diff --exit-code -- src/tui-compiled && test -z \"$(git status --porcelain -- src/tui-compiled)\"",
41
- "typecheck": "tsc --noEmit && tsc -p tsconfig.scripts.json",
41
+ "typecheck": "tsc -p ../retina-local-fs/tsconfig.build.json && tsc --noEmit && tsc -p tsconfig.scripts.json",
42
42
  "test": "bun test",
43
43
  "lint": "biome check .",
44
44
  "lint:fix": "biome check --write .",
@@ -57,6 +57,7 @@
57
57
  "@opentui/solid": "^0.4.2",
58
58
  "ai-tokenizer": "^1.0.6",
59
59
  "comment-json": "^5.0.0",
60
+ "jsonc-parser": "^3.3.1",
60
61
  "quickjs-emscripten": "^0.32.0",
61
62
  "solid-js": "1.9.12",
62
63
  "zod": "^4.1.8"
@@ -109,6 +109,93 @@ export function buildAllowOnlyPermission(
109
109
  return permission;
110
110
  }
111
111
 
112
+ type PermissionAction = "ask" | "allow" | "deny";
113
+
114
+ function isPermissionAction(value: unknown): value is PermissionAction {
115
+ return value === "ask" || value === "allow" || value === "deny";
116
+ }
117
+
118
+ function isPermissionMap(value: unknown): value is Record<string, unknown> {
119
+ return value !== null && typeof value === "object" && !Array.isArray(value);
120
+ }
121
+
122
+ /**
123
+ * Add final `permission.task` denies for Magic Context's internal workers.
124
+ *
125
+ * OpenCode accepts either a whole-permission action or a pattern map for
126
+ * `permission.task`; its evaluator uses the last matching rule. Normalize the
127
+ * whole-permission form, retain every unrelated user rule, then append our
128
+ * exact agent-id denies after both the user's task patterns and any `*` rule.
129
+ */
130
+ export function denyTaskRoutingToAgents(
131
+ permission: unknown,
132
+ internalAgentIds: readonly string[],
133
+ ): Record<string, unknown> {
134
+ const configured = isPermissionAction(permission)
135
+ ? { "*": permission }
136
+ : isPermissionMap(permission)
137
+ ? permission
138
+ : {};
139
+ const { task, ...otherPermissions } = configured;
140
+ const configuredTask = isPermissionAction(task)
141
+ ? { "*": task }
142
+ : isPermissionMap(task)
143
+ ? task
144
+ : {};
145
+ const internalAgentIdSet = new Set(internalAgentIds);
146
+ const retainedTask = Object.fromEntries(
147
+ Object.entries(configuredTask).filter(([agentId]) => !internalAgentIdSet.has(agentId)),
148
+ );
149
+
150
+ return {
151
+ ...otherPermissions,
152
+ task: {
153
+ ...retainedTask,
154
+ ...Object.fromEntries(internalAgentIds.map((agentId) => [agentId, "deny"])),
155
+ },
156
+ };
157
+ }
158
+
159
+ const BUILTIN_TASK_CALLER_IDS = ["build", "plan"] as const;
160
+
161
+ function isTaskRoutingCaller(agentId: string, config: Record<string, unknown>): boolean {
162
+ const mode = config.mode;
163
+ // OpenCode compatibility:
164
+ // Only strictly-primary callers receive explicit Task routing rules.
165
+ // Agents that may execute as Task children are intentionally left untouched,
166
+ // because explicit task permissions can alter OpenCode's default anti-nesting
167
+ // behavior in the currently supported permission model.
168
+ if (mode === "primary") return true;
169
+ if (mode === "subagent" || mode === "all") return false;
170
+ return agentId === "build" || agentId === "plan";
171
+ }
172
+
173
+ /**
174
+ * Apply Task routing denies only to agents that can act as Task callers.
175
+ *
176
+ * A top-level permission rule is merged into every OpenCode agent. Adding one
177
+ * there would suppress the Task tool's default deny for ordinary subagents, so
178
+ * seed only the built-in interactive callers and configured primary agents.
179
+ */
180
+ export function denyTaskRoutingToCallerAgents(
181
+ agentConfigs: Record<string, Record<string, unknown>>,
182
+ internalAgentIds: readonly string[],
183
+ ): Record<string, Record<string, unknown>> {
184
+ const result = { ...agentConfigs };
185
+ const candidateIds = new Set([...BUILTIN_TASK_CALLER_IDS, ...Object.keys(agentConfigs)]);
186
+
187
+ for (const agentId of candidateIds) {
188
+ const agentConfig = agentConfigs[agentId] ?? {};
189
+ if (!isTaskRoutingCaller(agentId, agentConfig)) continue;
190
+ result[agentId] = {
191
+ ...agentConfig,
192
+ permission: denyTaskRoutingToAgents(agentConfig.permission, internalAgentIds),
193
+ };
194
+ }
195
+
196
+ return result;
197
+ }
198
+
112
199
  /**
113
200
  * Tools the historian + historian-editor + compressor agents need.
114
201
  *