@cortexkit/opencode-magic-context 0.38.1 → 0.39.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 (143) hide show
  1. package/README.md +37 -4
  2. package/dist/config/index.d.ts.map +1 -1
  3. package/dist/config/project-security.d.ts +11 -6
  4. package/dist/config/project-security.d.ts.map +1 -1
  5. package/dist/config/raw-loader.d.ts +42 -0
  6. package/dist/config/raw-loader.d.ts.map +1 -0
  7. package/dist/config/schema/magic-context.d.ts +585 -550
  8. package/dist/config/schema/magic-context.d.ts.map +1 -1
  9. package/dist/features/magic-context/dreamer/classify.d.ts +3 -2
  10. package/dist/features/magic-context/dreamer/classify.d.ts.map +1 -1
  11. package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts +9 -2
  12. package/dist/features/magic-context/dreamer/evaluate-smart-notes.d.ts.map +1 -1
  13. package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts +4 -2
  14. package/dist/features/magic-context/dreamer/map-memories-prompt.d.ts.map +1 -1
  15. package/dist/features/magic-context/dreamer/map-memories.d.ts +21 -5
  16. package/dist/features/magic-context/dreamer/map-memories.d.ts.map +1 -1
  17. package/dist/features/magic-context/dreamer/refresh-primers.d.ts +3 -2
  18. package/dist/features/magic-context/dreamer/refresh-primers.d.ts.map +1 -1
  19. package/dist/features/magic-context/dreamer/task-config.d.ts +2 -1
  20. package/dist/features/magic-context/dreamer/task-config.d.ts.map +1 -1
  21. package/dist/features/magic-context/dreamer/task-executor.d.ts +0 -1
  22. package/dist/features/magic-context/dreamer/task-executor.d.ts.map +1 -1
  23. package/dist/features/magic-context/dreamer/task-scheduler.d.ts +3 -2
  24. package/dist/features/magic-context/dreamer/task-scheduler.d.ts.map +1 -1
  25. package/dist/features/magic-context/dreamer/verify-prompt.d.ts +5 -2
  26. package/dist/features/magic-context/dreamer/verify-prompt.d.ts.map +1 -1
  27. package/dist/features/magic-context/dreamer/verify.d.ts +6 -3
  28. package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
  29. package/dist/features/magic-context/migrations.d.ts.map +1 -1
  30. package/dist/features/magic-context/mural/compress-cues.d.ts +3 -2
  31. package/dist/features/magic-context/mural/compress-cues.d.ts.map +1 -1
  32. package/dist/features/magic-context/smart-notes/compiler.d.ts +3 -2
  33. package/dist/features/magic-context/smart-notes/compiler.d.ts.map +1 -1
  34. package/dist/features/magic-context/smart-notes/condition-compiler.d.ts +2 -0
  35. package/dist/features/magic-context/smart-notes/condition-compiler.d.ts.map +1 -1
  36. package/dist/features/magic-context/smart-notes/sandbox-runner.d.ts.map +1 -1
  37. package/dist/features/magic-context/storage-db.d.ts +1 -1
  38. package/dist/features/magic-context/storage-db.d.ts.map +1 -1
  39. package/dist/features/magic-context/storage-meta-persisted.d.ts +7 -2
  40. package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
  41. package/dist/features/magic-context/storage-meta-shared.d.ts +1 -0
  42. package/dist/features/magic-context/storage-meta-shared.d.ts.map +1 -1
  43. package/dist/features/magic-context/storage-meta.d.ts +1 -1
  44. package/dist/features/magic-context/storage-meta.d.ts.map +1 -1
  45. package/dist/features/magic-context/storage-session-tables.d.ts.map +1 -1
  46. package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
  47. package/dist/features/magic-context/storage.d.ts +1 -1
  48. package/dist/features/magic-context/storage.d.ts.map +1 -1
  49. package/dist/features/magic-context/tool-definition-tokens.d.ts +10 -0
  50. package/dist/features/magic-context/tool-definition-tokens.d.ts.map +1 -1
  51. package/dist/features/magic-context/transform-decision-log.d.ts +11 -0
  52. package/dist/features/magic-context/transform-decision-log.d.ts.map +1 -1
  53. package/dist/features/magic-context/user-memory/review-user-memories.d.ts +3 -2
  54. package/dist/features/magic-context/user-memory/review-user-memories.d.ts.map +1 -1
  55. package/dist/hooks/magic-context/channel2-delivery.d.ts +3 -1
  56. package/dist/hooks/magic-context/channel2-delivery.d.ts.map +1 -1
  57. package/dist/hooks/magic-context/command-handler.d.ts +4 -0
  58. package/dist/hooks/magic-context/command-handler.d.ts.map +1 -1
  59. package/dist/hooks/magic-context/compartment-runner-historian.d.ts +4 -1
  60. package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
  61. package/dist/hooks/magic-context/compartment-runner-partial-recomp.d.ts.map +1 -1
  62. package/dist/hooks/magic-context/compartment-runner-recomp.d.ts.map +1 -1
  63. package/dist/hooks/magic-context/compartment-runner-types.d.ts +4 -1
  64. package/dist/hooks/magic-context/compartment-runner-types.d.ts.map +1 -1
  65. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts +14 -2
  66. package/dist/hooks/magic-context/ctx-reduce-nudge.d.ts.map +1 -1
  67. package/dist/hooks/magic-context/emergency-fail-closed.d.ts +7 -0
  68. package/dist/hooks/magic-context/emergency-fail-closed.d.ts.map +1 -1
  69. package/dist/hooks/magic-context/hook-handlers.d.ts.map +1 -1
  70. package/dist/hooks/magic-context/hook.d.ts.map +1 -1
  71. package/dist/hooks/magic-context/inject-compartments.d.ts +12 -1
  72. package/dist/hooks/magic-context/inject-compartments.d.ts.map +1 -1
  73. package/dist/hooks/magic-context/lkg-persist.d.ts +14 -0
  74. package/dist/hooks/magic-context/lkg-persist.d.ts.map +1 -0
  75. package/dist/hooks/magic-context/lkg-slot.d.ts +13 -0
  76. package/dist/hooks/magic-context/lkg-slot.d.ts.map +1 -1
  77. package/dist/hooks/magic-context/module-state-sync.d.ts +1 -0
  78. package/dist/hooks/magic-context/module-state-sync.d.ts.map +1 -1
  79. package/dist/hooks/magic-context/module-transport.d.ts +12 -0
  80. package/dist/hooks/magic-context/module-transport.d.ts.map +1 -1
  81. package/dist/hooks/magic-context/raw-fallback-context-limit.d.ts.map +1 -1
  82. package/dist/hooks/magic-context/recomp-orchestrator.d.ts +4 -1
  83. package/dist/hooks/magic-context/recomp-orchestrator.d.ts.map +1 -1
  84. package/dist/hooks/magic-context/rust-mode-transform.d.ts.map +1 -1
  85. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts +12 -0
  86. package/dist/hooks/magic-context/tail-hygiene-walk.d.ts.map +1 -1
  87. package/dist/hooks/magic-context/transform-compartment-phase.d.ts +3 -1
  88. package/dist/hooks/magic-context/transform-compartment-phase.d.ts.map +1 -1
  89. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +4 -0
  90. package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
  91. package/dist/hooks/magic-context/transform.d.ts +9 -1
  92. package/dist/hooks/magic-context/transform.d.ts.map +1 -1
  93. package/dist/hooks/magic-context/wrapup-orchestrator.d.ts.map +1 -1
  94. package/dist/{index-2y0ybv5x.js → index-3dkzzh0t.js} +15 -17
  95. package/dist/index-ehpzdy0v.js +126 -0
  96. package/dist/{index-5znjkjws.js → index-k2ts0wk1.js} +486 -106
  97. package/dist/{index-22mw8km4.js → index-rw0qrkvq.js} +4 -2
  98. package/dist/index.d.ts.map +1 -1
  99. package/dist/index.js +17186 -14853
  100. package/dist/model-resolution-r9jbcz86.js +15 -0
  101. package/dist/plugin/dream-timer.d.ts +3 -0
  102. package/dist/plugin/dream-timer.d.ts.map +1 -1
  103. package/dist/plugin/hooks/create-session-hooks.d.ts.map +1 -1
  104. package/dist/plugin/messages-transform.d.ts +14 -6
  105. package/dist/plugin/messages-transform.d.ts.map +1 -1
  106. package/dist/plugin/rpc-handlers.d.ts.map +1 -1
  107. package/dist/{recomp-orchestrator-p030kxtc.js → recomp-orchestrator-2pncxee7.js} +2 -3
  108. package/dist/shared/jsonc-edit.d.ts +6 -1
  109. package/dist/shared/jsonc-edit.d.ts.map +1 -1
  110. package/dist/shared/model-resolution.d.ts +53 -0
  111. package/dist/shared/model-resolution.d.ts.map +1 -0
  112. package/dist/shared/model-suggestion-retry.d.ts +4 -1
  113. package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
  114. package/dist/shared/resolve-fallbacks.d.ts +5 -1
  115. package/dist/shared/resolve-fallbacks.d.ts.map +1 -1
  116. package/dist/shared/status-detail-text.d.ts +4 -0
  117. package/dist/shared/status-detail-text.d.ts.map +1 -0
  118. package/dist/shared/subagent-runner.d.ts +2 -1
  119. package/dist/shared/subagent-runner.d.ts.map +1 -1
  120. package/dist/{storage-meta-session-2306t3j7.js → storage-meta-session-yvtbaw7c.js} +1 -1
  121. package/dist/{task-config-at3adc59.js → task-config-a1qmj9bx.js} +2 -2
  122. package/package.json +4 -2
  123. package/src/config/index.test.ts +73 -17
  124. package/src/config/index.ts +38 -23
  125. package/src/config/project-security.hostile-matrix.test.ts +471 -0
  126. package/src/config/project-security.test.ts +26 -5
  127. package/src/config/project-security.ts +141 -22
  128. package/src/config/raw-loader.test.ts +424 -0
  129. package/src/config/raw-loader.ts +490 -0
  130. package/src/config/schema/magic-context.test.ts +144 -2
  131. package/src/config/schema/magic-context.ts +253 -49
  132. package/src/shared/jsonc-edit.ts +74 -1
  133. package/src/shared/model-resolution.test.ts +170 -0
  134. package/src/shared/model-resolution.ts +227 -0
  135. package/src/shared/model-suggestion-retry.test.ts +27 -0
  136. package/src/shared/model-suggestion-retry.ts +19 -10
  137. package/src/shared/resolve-fallbacks.test.ts +13 -1
  138. package/src/shared/resolve-fallbacks.ts +19 -4
  139. package/src/shared/status-detail-text.test.ts +80 -0
  140. package/src/shared/status-detail-text.ts +56 -0
  141. package/src/shared/subagent-runner.ts +3 -1
  142. package/dist/index-td9depx5.js +0 -46
  143. package/dist/resolve-fallbacks-qf0ekmz9.js +0 -11
package/README.md CHANGED
@@ -113,19 +113,52 @@ If you cannot run the wizard, add this to `opencode.jsonc`:
113
113
 
114
114
  > **Plugin updates:** A bare plugin entry is pinned to the downloaded exact version before restart so OpenCode does not remove the active package mid-session. To deliberately keep it unpinned after removing a version, write `@latest` explicitly.
115
115
 
116
- Then create `magic-context.jsonc` with the one setting the historian needs:
116
+ Then create `magic-context.jsonc` with the OpenCode historian setting:
117
117
 
118
118
  ```jsonc
119
119
  {
120
120
  "$schema": "https://raw.githubusercontent.com/cortexkit/magic-context/master/assets/magic-context.schema.json",
121
- "historian": { "model": "provider/model-id" }
121
+ "historian": {
122
+ "opencode": { "model": "provider/model-id" }
123
+ }
122
124
  }
123
125
  ```
124
126
 
125
- - **Required:** `historian.model` must be a real `provider/model-id`. Without it, the plugin loads but historian runs fail, older history is not summarized, and repeated failures show a `Magic Context — history comparting needs attention` notice.
127
+ - **Required:** `historian.opencode.model` must be a real `provider/model-id`. Without it, the plugin loads but historian runs fail, older history is not summarized, and repeated failures show a `Magic Context — history comparting needs attention` notice.
126
128
  - **Optional:** `dreamer` and `sidekick` model/disable blocks. Omit them to leave periodic memory consolidation and `/ctx-aug` off.
127
129
  - **Optional:** `embedding`. Omit it to use the local `Xenova/all-MiniLM-L6-v2`; turning embeddings off removes semantic/embedding-backed search, but keyword search and context management continue.
128
130
 
131
+ ### Flat model-config migration (before/after)
132
+
133
+ Existing flat model settings migrate automatically on the first config read. The
134
+ flat form below is shown only as a migration **before** example; write the
135
+ per-harness **after** form for all new configuration.
136
+
137
+ **Before (flat shape — migration only):**
138
+
139
+ ```jsonc
140
+ {
141
+ "historian": {
142
+ "model": "provider/model-id",
143
+ "thinking_level": "medium"
144
+ }
145
+ }
146
+ ```
147
+
148
+ **After (per-harness shape):**
149
+
150
+ ```jsonc
151
+ {
152
+ "historian": {
153
+ "opencode": { "model": "provider/model-id" },
154
+ "pi": {
155
+ "model": "provider/model-id",
156
+ "thinking_level": "medium"
157
+ }
158
+ }
159
+ }
160
+ ```
161
+
129
162
  User-level config is `~/.config/cortexkit/magic-context.jsonc` on macOS/Linux and `%USERPROFILE%\.config\cortexkit\magic-context.jsonc` on Windows (or `$XDG_CONFIG_HOME/cortexkit/magic-context.jsonc` when set). OpenCode Desktop users can use the dashboard's config editor or hand-edit that file; Desktop does not include the CLI setup wizard.
130
163
 
131
164
  **Pi:** `npx @cortexkit/magic-context@latest setup --harness pi` (requires Pi `>= 0.74.0`). The Pi extension shares the same database as OpenCode; project memories and embeddings pool across both.
@@ -290,7 +323,7 @@ It reads directly from Magic Context's SQLite database. No extra server, no API.
290
323
 
291
324
  ## Configuration
292
325
 
293
- Settings live in `magic-context.jsonc`. Most settings have sensible defaults, but `historian.model` is required for history compacting; project config merges on top of user-wide settings. For the full reference — cache TTL tuning, per-model execute thresholds, historian and dreamer model selection, embedding providers, memory settings, and prompt-surface presets (`full`/`light`) — see **[CONFIGURATION.md](./CONFIGURATION.md)** or the **[configuration reference on docs.cortexkit.io](https://docs.cortexkit.io/magic-context/reference/configuration/)**.
326
+ Settings live in `magic-context.jsonc`. Most settings have sensible defaults, but the active harness's historian model (`historian.opencode.model` or `historian.pi.model`) is required for history compacting; project config merges on top of user-wide settings. For the full reference — cache TTL tuning, per-model execute thresholds, historian and dreamer model selection, embedding providers, memory settings, and prompt-surface presets (`full`/`light`) — see **[CONFIGURATION.md](./CONFIGURATION.md)** or the **[configuration reference on docs.cortexkit.io](https://docs.cortexkit.io/magic-context/reference/configuration/)**.
294
327
 
295
328
  > **Note on per-model settings (OpenCode/Pi):** settings that route per model — like `prompt_surface.models` — apply to the injected guidance block. Tool descriptions are registered once per process by the current (v1) plugin API and follow the default preset; per-model tool descriptions arrive with the OpenCode v2 plugin API once the SDK stabilizes ([#260](https://github.com/cortexkit/magic-context/issues/260)).
296
329
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAkBpE,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAI3F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CACZ,MAAM,EACN;QACI,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CACJ,CAAC;CACL;AAsCD,MAAM,MAAM,WAAW,GACjB,IAAI,GACJ,0BAA0B,GAC1B,uBAAuB,GACvB,0BAA0B,GAC1B,iBAAiB,GACjB,sBAAsB,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,wBAAwB,GAAG;QAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACjE,6EAA6E;IAC7E,yBAAyB,EAAE,mBAAmB,CAAC;IAC/C,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE;QACL,UAAU,EAAE,WAAW,CAAC;QACxB,aAAa,EAAE,WAAW,CAAC;KAC9B,CAAC;IACF,oBAAoB,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9F,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACnC;AAiUD,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,MAAM,GAClB,wBAAwB,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAY1D;AAwDD,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAwJ9E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAmBpE,OAAO,EAAE,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAI3F,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CACZ,MAAM,EACN;QACI,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CACJ,CAAC;CACL;AAsCD,MAAM,MAAM,WAAW,GACjB,IAAI,GACJ,0BAA0B,GAC1B,uBAAuB,GACvB,0BAA0B,GAC1B,iBAAiB,GACjB,sBAAsB,CAAC;AAE7B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,wBAAwB,GAAG;QAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACjE,6EAA6E;IAC7E,yBAAyB,EAAE,mBAAmB,CAAC;IAC/C,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE;QACL,UAAU,EAAE,WAAW,CAAC;QACxB,aAAa,EAAE,WAAW,CAAC;KAC9B,CAAC;IACF,oBAAoB,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9F,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACnC;AA+UD,wBAAgB,gBAAgB,CAC5B,SAAS,EAAE,MAAM,GAClB,wBAAwB,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAY1D;AAwDD,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAwJ9E"}
@@ -27,17 +27,22 @@
27
27
  * - `transform_mode` is intentionally allowed at project tier so a repository
28
28
  * can opt its own runtime into the experimental Rust pipeline. The resolver
29
29
  * requires trusted user-level `subc` configuration before Rust can activate.
30
- * - `historian.model` / `historian.fallback_models` — historian model spend is
31
- * user-level only; a cloned repo cannot force extra compaction cost.
32
- * - `mural.model` — mural cue-compressor model selection is user-level only;
33
- * a cloned repo cannot choose a model that sends project memory to a provider.
30
+ * - historian model-resolution fields (model, fallback_models, variant,
31
+ * thinking_level), including both per-harness blocks — historian model
32
+ * spend is user-level only. Qualifiers merge onto the user's historian
33
+ * model at resolve time, so a cloned repo cannot force extra thinking or
34
+ * variant cost.
35
+ * - `mural.model` at the top-level block, the legacy experimental spelling,
36
+ * and any nested `mural.model` under hidden agents — a cloned repo cannot
37
+ * choose where project memory is sent.
34
38
  * - `pi.subagent_extensions` — a cloned repo must not choose which extensions
35
39
  * the user's Pi child processes load.
36
40
  * - `prompt_surface.guidance_override_path` / `tool_descriptions` — a repository
37
41
  * may select a reviewed preset, but must not inject arbitrary guidance or tool
38
42
  * description text into the user's provider-visible prompt.
39
- * - hidden-agent `prompt`/`permission`/`tools` — a repo must not reprogram or
40
- * re-permission the historian/dreamer/sidekick.
43
+ * - hidden-agent `prompt`/`permission`/`tools`/`system_prompt` at the agent
44
+ * root, each harness block, each task block, and inside model/fallback
45
+ * entry objects — a repo must not reprogram or re-permission hidden agents.
41
46
  */
42
47
  export declare function stripUnsafeProjectConfigFields(projectRaw: Record<string, unknown>): string[];
43
48
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"project-security.d.ts","sourceRoot":"","sources":["../../src/config/project-security.ts"],"names":[],"mappings":"AA0LA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CA4L5F;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE;IACrD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,iBAAiB,EAAE;QACf,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACtC,CAAC;CACL,GAAG,MAAM,EAAE,CA+IX;AA2BD,wBAAgB,mCAAmC,CAC/C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,EAAE,CAsCV"}
1
+ {"version":3,"file":"project-security.d.ts","sourceRoot":"","sources":["../../src/config/project-security.ts"],"names":[],"mappings":"AA6PA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CA2O5F;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE;IACrD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,iBAAiB,EAAE;QACf,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACtC,CAAC;CACL,GAAG,MAAM,EAAE,CA+IX;AA2BD,wBAAgB,mCAAmC,CAC/C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,EAAE,CAsCV"}
@@ -0,0 +1,42 @@
1
+ export type ConfigTier = "user" | "project";
2
+ export interface FlatConfigDiagnostic {
3
+ path: string;
4
+ message: string;
5
+ }
6
+ export interface FlatConfigMigration {
7
+ bytes: Buffer;
8
+ hasFlatKeys: boolean;
9
+ diagnostics: FlatConfigDiagnostic[];
10
+ }
11
+ export interface RawConfigLoadOptions {
12
+ configPath: string;
13
+ tier: ConfigTier;
14
+ /** Test-only seam for making a competing loader replace the target before this loader re-checks it. */
15
+ afterTemporaryWrite?: () => void;
16
+ }
17
+ export interface RawConfigLoadResult {
18
+ configPath: string;
19
+ bytes: Buffer;
20
+ text: string;
21
+ warnings: string[];
22
+ migrated: boolean;
23
+ }
24
+ /** True when historian, dreamer, or dreamer-task fields still use the flat shape. */
25
+ export declare function hasFlatKeys(input: Buffer | string): boolean;
26
+ /**
27
+ * Deterministically maps flat model fields into per-harness blocks while leaving
28
+ * unrelated JSONC regions untouched. The return type matches the caller's input
29
+ * representation so callers that operate on file bytes retain BOM and line-ending
30
+ * details exactly outside the surgical edits.
31
+ */
32
+ export declare function migrateFlat(input: string): string;
33
+ export declare function migrateFlat(input: Buffer): Buffer;
34
+ export declare function migrateFlatDetailed(input: Buffer | string): FlatConfigMigration;
35
+ /**
36
+ * Reads the raw tier before substitution and schema validation. User files are
37
+ * rewritten through an exact-byte backup and same-directory atomic replacement;
38
+ * project files are adapted only in memory. This is the common seam used by both
39
+ * harness loaders and their doctor paths.
40
+ */
41
+ export declare function loadRawConfigFile(options: RawConfigLoadOptions): RawConfigLoadResult | null;
42
+ //# sourceMappingURL=raw-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-loader.d.ts","sourceRoot":"","sources":["../../src/config/raw-loader.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,uGAAuG;IACvG,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACrB;AA+OD,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAG3D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AACnD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAOnD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,mBAAmB,CAQ/E;AAsED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,IAAI,CAwG3F"}