@wrongstack/core 0.284.0 → 0.285.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 (810) hide show
  1. package/dist/agent-status-tracker.d.ts +74 -0
  2. package/dist/agent-status-tracker.d.ts.map +1 -0
  3. package/dist/autophase/auto-phase-planner.d.ts +79 -0
  4. package/dist/autophase/auto-phase-planner.d.ts.map +1 -0
  5. package/dist/autophase/auto-phase-runner.d.ts +79 -0
  6. package/dist/autophase/auto-phase-runner.d.ts.map +1 -0
  7. package/dist/autophase/checkpoint.d.ts +49 -0
  8. package/dist/autophase/checkpoint.d.ts.map +1 -0
  9. package/dist/autophase/index.d.ts +9 -0
  10. package/dist/autophase/index.d.ts.map +1 -0
  11. package/dist/autophase/phase-graph-builder.d.ts +46 -0
  12. package/dist/autophase/phase-graph-builder.d.ts.map +1 -0
  13. package/dist/autophase/phase-orchestrator.d.ts +150 -0
  14. package/dist/autophase/phase-orchestrator.d.ts.map +1 -0
  15. package/dist/autophase/phase-store.d.ts +29 -0
  16. package/dist/autophase/phase-store.d.ts.map +1 -0
  17. package/dist/autophase/types.d.ts +329 -0
  18. package/dist/autophase/types.d.ts.map +1 -0
  19. package/dist/boot.d.ts +73 -0
  20. package/dist/boot.d.ts.map +1 -0
  21. package/dist/coordination/adaptive-concurrency.d.ts +63 -0
  22. package/dist/coordination/adaptive-concurrency.d.ts.map +1 -0
  23. package/dist/coordination/agent-bridge.d.ts +24 -0
  24. package/dist/coordination/agent-bridge.d.ts.map +1 -0
  25. package/dist/coordination/agent-monitor.d.ts +100 -0
  26. package/dist/coordination/agent-monitor.d.ts.map +1 -0
  27. package/dist/coordination/agent-subagent-runner.d.ts +74 -0
  28. package/dist/coordination/agent-subagent-runner.d.ts.map +1 -0
  29. package/dist/coordination/agents/agent-prompts.d.ts +2 -0
  30. package/dist/coordination/agents/agent-prompts.d.ts.map +1 -0
  31. package/dist/coordination/agents/index.d.ts +35 -0
  32. package/dist/coordination/agents/index.d.ts.map +1 -0
  33. package/dist/coordination/agents/phase1-discovery.d.ts +4 -0
  34. package/dist/coordination/agents/phase1-discovery.d.ts.map +1 -0
  35. package/dist/coordination/agents/phase2-planning.d.ts +4 -0
  36. package/dist/coordination/agents/phase2-planning.d.ts.map +1 -0
  37. package/dist/coordination/agents/phase3-build.d.ts +4 -0
  38. package/dist/coordination/agents/phase3-build.d.ts.map +1 -0
  39. package/dist/coordination/agents/phase3-techstack.d.ts +13 -0
  40. package/dist/coordination/agents/phase3-techstack.d.ts.map +1 -0
  41. package/dist/coordination/agents/phase4-verify.d.ts +4 -0
  42. package/dist/coordination/agents/phase4-verify.d.ts.map +1 -0
  43. package/dist/coordination/agents/phase5-review.d.ts +4 -0
  44. package/dist/coordination/agents/phase5-review.d.ts.map +1 -0
  45. package/dist/coordination/agents/phase6-domain.d.ts +4 -0
  46. package/dist/coordination/agents/phase6-domain.d.ts.map +1 -0
  47. package/dist/coordination/agents/phase7-knowledge.d.ts +4 -0
  48. package/dist/coordination/agents/phase7-knowledge.d.ts.map +1 -0
  49. package/dist/coordination/agents/phase8-delivery.d.ts +4 -0
  50. package/dist/coordination/agents/phase8-delivery.d.ts.map +1 -0
  51. package/dist/coordination/agents/phase9-meta.d.ts +4 -0
  52. package/dist/coordination/agents/phase9-meta.d.ts.map +1 -0
  53. package/dist/coordination/agents/types.d.ts +79 -0
  54. package/dist/coordination/agents/types.d.ts.map +1 -0
  55. package/dist/coordination/agents.d.ts +8 -0
  56. package/dist/coordination/agents.d.ts.map +1 -0
  57. package/dist/coordination/auto-extend.d.ts +46 -0
  58. package/dist/coordination/auto-extend.d.ts.map +1 -0
  59. package/dist/coordination/autonomous-brain.d.ts +154 -0
  60. package/dist/coordination/autonomous-brain.d.ts.map +1 -0
  61. package/dist/coordination/autonomous-coordinator.d.ts +239 -0
  62. package/dist/coordination/autonomous-coordinator.d.ts.map +1 -0
  63. package/dist/coordination/brain-monitor.d.ts +74 -0
  64. package/dist/coordination/brain-monitor.d.ts.map +1 -0
  65. package/dist/coordination/brain.d.ts +104 -0
  66. package/dist/coordination/brain.d.ts.map +1 -0
  67. package/dist/coordination/change-manager.d.ts +151 -0
  68. package/dist/coordination/change-manager.d.ts.map +1 -0
  69. package/dist/coordination/checkpoint-wiring.d.ts +61 -0
  70. package/dist/coordination/checkpoint-wiring.d.ts.map +1 -0
  71. package/dist/coordination/collab-bus.d.ts +132 -0
  72. package/dist/coordination/collab-bus.d.ts.map +1 -0
  73. package/dist/coordination/collab-debug.d.ts +302 -0
  74. package/dist/coordination/collab-debug.d.ts.map +1 -0
  75. package/dist/coordination/commit-safety.d.ts +72 -0
  76. package/dist/coordination/commit-safety.d.ts.map +1 -0
  77. package/dist/coordination/consensus-protocol.d.ts +106 -0
  78. package/dist/coordination/consensus-protocol.d.ts.map +1 -0
  79. package/dist/coordination/coordinator/error-classifier.d.ts +15 -0
  80. package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -0
  81. package/dist/coordination/delegate-tool.d.ts +101 -0
  82. package/dist/coordination/delegate-tool.d.ts.map +1 -0
  83. package/dist/coordination/dep-watcher-bridge.d.ts +47 -0
  84. package/dist/coordination/dep-watcher-bridge.d.ts.map +1 -0
  85. package/dist/coordination/dep-watcher.d.ts +74 -0
  86. package/dist/coordination/dep-watcher.d.ts.map +1 -0
  87. package/dist/coordination/director/director-errors.d.ts +29 -0
  88. package/dist/coordination/director/director-errors.d.ts.map +1 -0
  89. package/dist/coordination/director-construction.d.ts +90 -0
  90. package/dist/coordination/director-construction.d.ts.map +1 -0
  91. package/dist/coordination/director-prompts.d.ts +119 -0
  92. package/dist/coordination/director-prompts.d.ts.map +1 -0
  93. package/dist/coordination/director-session.d.ts +68 -0
  94. package/dist/coordination/director-session.d.ts.map +1 -0
  95. package/dist/coordination/director-tools.d.ts +65 -0
  96. package/dist/coordination/director-tools.d.ts.map +1 -0
  97. package/dist/coordination/director.d.ts +802 -0
  98. package/dist/coordination/director.d.ts.map +1 -0
  99. package/dist/coordination/dispatcher.d.ts +82 -0
  100. package/dist/coordination/dispatcher.d.ts.map +1 -0
  101. package/dist/coordination/file-author-tracker.d.ts +76 -0
  102. package/dist/coordination/file-author-tracker.d.ts.map +1 -0
  103. package/dist/coordination/fleet-bus.d.ts +122 -0
  104. package/dist/coordination/fleet-bus.d.ts.map +1 -0
  105. package/dist/coordination/fleet-event-validation.d.ts +10 -0
  106. package/dist/coordination/fleet-event-validation.d.ts.map +1 -0
  107. package/dist/coordination/fleet-manager.d.ts +234 -0
  108. package/dist/coordination/fleet-manager.d.ts.map +1 -0
  109. package/dist/coordination/fleet-spawn.d.ts +102 -0
  110. package/dist/coordination/fleet-spawn.d.ts.map +1 -0
  111. package/dist/coordination/fleet-status-tool.d.ts +36 -0
  112. package/dist/coordination/fleet-status-tool.d.ts.map +1 -0
  113. package/dist/coordination/fleet-supervisor.d.ts +157 -0
  114. package/dist/coordination/fleet-supervisor.d.ts.map +1 -0
  115. package/dist/coordination/fleet.d.ts +96 -0
  116. package/dist/coordination/fleet.d.ts.map +1 -0
  117. package/dist/coordination/global-mailbox.d.ts +234 -0
  118. package/dist/coordination/global-mailbox.d.ts.map +1 -0
  119. package/dist/coordination/icoordinator.d.ts +97 -0
  120. package/dist/coordination/icoordinator.d.ts.map +1 -0
  121. package/dist/coordination/ifleet-manager.d.ts +177 -0
  122. package/dist/coordination/ifleet-manager.d.ts.map +1 -0
  123. package/dist/coordination/in-memory-transport.d.ts +12 -0
  124. package/dist/coordination/in-memory-transport.d.ts.map +1 -0
  125. package/dist/coordination/index.d.ts +78 -2587
  126. package/dist/coordination/index.d.ts.map +1 -0
  127. package/dist/coordination/index.js +739 -254
  128. package/dist/coordination/index.js.map +7 -1
  129. package/dist/coordination/knowledge-graph.d.ts +217 -0
  130. package/dist/coordination/knowledge-graph.d.ts.map +1 -0
  131. package/dist/coordination/large-answer-store.d.ts +61 -0
  132. package/dist/coordination/large-answer-store.d.ts.map +1 -0
  133. package/dist/coordination/mail-tools.d.ts +34 -0
  134. package/dist/coordination/mail-tools.d.ts.map +1 -0
  135. package/dist/coordination/mailbox-actions.d.ts +68 -0
  136. package/dist/coordination/mailbox-actions.d.ts.map +1 -0
  137. package/dist/coordination/mailbox-health.d.ts +131 -0
  138. package/dist/coordination/mailbox-health.d.ts.map +1 -0
  139. package/dist/coordination/mailbox-hooks.d.ts +55 -0
  140. package/dist/coordination/mailbox-hooks.d.ts.map +1 -0
  141. package/dist/coordination/mailbox-tool.d.ts +75 -0
  142. package/dist/coordination/mailbox-tool.d.ts.map +1 -0
  143. package/dist/{mailbox-types-BGZWrYTJ.d.ts → coordination/mailbox-types.d.ts} +37 -22
  144. package/dist/coordination/mailbox-types.d.ts.map +1 -0
  145. package/dist/coordination/mailbox.d.ts +69 -0
  146. package/dist/coordination/mailbox.d.ts.map +1 -0
  147. package/dist/coordination/model-matrix.d.ts +98 -0
  148. package/dist/coordination/model-matrix.d.ts.map +1 -0
  149. package/dist/coordination/multi-agent-coordinator.d.ts +202 -0
  150. package/dist/coordination/multi-agent-coordinator.d.ts.map +1 -0
  151. package/dist/coordination/null-fleet-bus.d.ts +10 -0
  152. package/dist/coordination/null-fleet-bus.d.ts.map +1 -0
  153. package/dist/coordination/package-author-tracker.d.ts +87 -0
  154. package/dist/coordination/package-author-tracker.d.ts.map +1 -0
  155. package/dist/coordination/package-outdated-watcher.d.ts +83 -0
  156. package/dist/coordination/package-outdated-watcher.d.ts.map +1 -0
  157. package/dist/coordination/single-instance-mailbox.d.ts +154 -0
  158. package/dist/coordination/single-instance-mailbox.d.ts.map +1 -0
  159. package/dist/coordination/spawn-budget.d.ts +6 -0
  160. package/dist/coordination/spawn-budget.d.ts.map +1 -0
  161. package/dist/coordination/subagent-budget.d.ts +323 -0
  162. package/dist/coordination/subagent-budget.d.ts.map +1 -0
  163. package/dist/coordination/subagent-nicknames.d.ts +42 -0
  164. package/dist/coordination/subagent-nicknames.d.ts.map +1 -0
  165. package/dist/coordination/subagent-result-tool.d.ts +20 -0
  166. package/dist/coordination/subagent-result-tool.d.ts.map +1 -0
  167. package/dist/coordination/task-auctioneer.d.ts +143 -0
  168. package/dist/coordination/task-auctioneer.d.ts.map +1 -0
  169. package/dist/coordination/task-dag.d.ts +147 -0
  170. package/dist/coordination/task-dag.d.ts.map +1 -0
  171. package/dist/coordination/techstack-mailbox-consumer.d.ts +50 -0
  172. package/dist/coordination/techstack-mailbox-consumer.d.ts.map +1 -0
  173. package/dist/coordination/transport.d.ts +2 -0
  174. package/dist/coordination/transport.d.ts.map +1 -0
  175. package/dist/coordination/worktree-task-runner.d.ts +45 -0
  176. package/dist/coordination/worktree-task-runner.d.ts.map +1 -0
  177. package/dist/core/agent-internals.d.ts +41 -0
  178. package/dist/core/agent-internals.d.ts.map +1 -0
  179. package/dist/core/agent-loop.d.ts +18 -0
  180. package/dist/core/agent-loop.d.ts.map +1 -0
  181. package/dist/core/agent-response.d.ts +21 -0
  182. package/dist/core/agent-response.d.ts.map +1 -0
  183. package/dist/core/agent-tools.d.ts +21 -0
  184. package/dist/core/agent-tools.d.ts.map +1 -0
  185. package/dist/core/agent-types.d.ts +95 -0
  186. package/dist/core/agent-types.d.ts.map +1 -0
  187. package/dist/core/agent.d.ts +54 -0
  188. package/dist/core/agent.d.ts.map +1 -0
  189. package/dist/core/btw.d.ts +40 -0
  190. package/dist/core/btw.d.ts.map +1 -0
  191. package/dist/core/context.d.ts +269 -0
  192. package/dist/core/context.d.ts.map +1 -0
  193. package/dist/core/continue-intent.d.ts +92 -0
  194. package/dist/core/continue-intent.d.ts.map +1 -0
  195. package/dist/core/continue-to-next-iteration.d.ts +96 -0
  196. package/dist/core/continue-to-next-iteration.d.ts.map +1 -0
  197. package/dist/core/conversation-state.d.ts +96 -0
  198. package/dist/core/conversation-state.d.ts.map +1 -0
  199. package/dist/core/fallback-model.d.ts +94 -0
  200. package/dist/core/fallback-model.d.ts.map +1 -0
  201. package/dist/core/fleet-pulse.d.ts +42 -0
  202. package/dist/core/fleet-pulse.d.ts.map +1 -0
  203. package/dist/core/input-builder.d.ts +95 -0
  204. package/dist/core/input-builder.d.ts.map +1 -0
  205. package/dist/core/instruction-bundle.d.ts +22 -0
  206. package/dist/core/instruction-bundle.d.ts.map +1 -0
  207. package/dist/core/iteration-limit.d.ts +35 -0
  208. package/dist/core/iteration-limit.d.ts.map +1 -0
  209. package/dist/core/mailbox-loop.d.ts +63 -0
  210. package/dist/core/mailbox-loop.d.ts.map +1 -0
  211. package/dist/core/modes/brief.d.ts +2 -0
  212. package/dist/core/modes/brief.d.ts.map +1 -0
  213. package/dist/core/modes/default.d.ts +8 -0
  214. package/dist/core/modes/default.d.ts.map +1 -0
  215. package/dist/core/modes/teach.d.ts +2 -0
  216. package/dist/core/modes/teach.d.ts.map +1 -0
  217. package/dist/core/provider-runner.d.ts +24 -0
  218. package/dist/core/provider-runner.d.ts.map +1 -0
  219. package/dist/core/queued-messages.d.ts +55 -0
  220. package/dist/core/queued-messages.d.ts.map +1 -0
  221. package/dist/core/run-env.d.ts +49 -0
  222. package/dist/core/run-env.d.ts.map +1 -0
  223. package/dist/core/streaming-response-builder.d.ts +78 -0
  224. package/dist/core/streaming-response-builder.d.ts.map +1 -0
  225. package/dist/core/system-prompt-builder.d.ts +213 -0
  226. package/dist/core/system-prompt-builder.d.ts.map +1 -0
  227. package/dist/defaults/index.d.ts +68 -158
  228. package/dist/defaults/index.d.ts.map +1 -0
  229. package/dist/defaults/index.js +1257 -819
  230. package/dist/defaults/index.js.map +7 -1
  231. package/dist/execution/auto-compaction-middleware.d.ts +123 -0
  232. package/dist/execution/auto-compaction-middleware.d.ts.map +1 -0
  233. package/dist/execution/autonomous-runner.d.ts +55 -0
  234. package/dist/execution/autonomous-runner.d.ts.map +1 -0
  235. package/dist/execution/autonomy-brain.d.ts +90 -0
  236. package/dist/execution/autonomy-brain.d.ts.map +1 -0
  237. package/dist/execution/autonomy-prompt-contributor.d.ts +39 -0
  238. package/dist/execution/autonomy-prompt-contributor.d.ts.map +1 -0
  239. package/dist/execution/compaction-core.d.ts +103 -0
  240. package/dist/execution/compaction-core.d.ts.map +1 -0
  241. package/dist/execution/compactor.d.ts +56 -0
  242. package/dist/execution/compactor.d.ts.map +1 -0
  243. package/dist/execution/design-color.d.ts +31 -0
  244. package/dist/execution/design-color.d.ts.map +1 -0
  245. package/dist/execution/design-detect.d.ts +96 -0
  246. package/dist/execution/design-detect.d.ts.map +1 -0
  247. package/dist/execution/design-kit-loader.d.ts +53 -0
  248. package/dist/execution/design-kit-loader.d.ts.map +1 -0
  249. package/dist/execution/design-materialize.d.ts +32 -0
  250. package/dist/execution/design-materialize.d.ts.map +1 -0
  251. package/dist/execution/design-project-store.d.ts +57 -0
  252. package/dist/execution/design-project-store.d.ts.map +1 -0
  253. package/dist/execution/design-verify.d.ts +44 -0
  254. package/dist/execution/design-verify.d.ts.map +1 -0
  255. package/dist/execution/error-handler.d.ts +34 -0
  256. package/dist/execution/error-handler.d.ts.map +1 -0
  257. package/dist/{parallel-eternal-engine-HUrtePLd.d.ts → execution/eternal-autonomy.d.ts} +10 -225
  258. package/dist/execution/eternal-autonomy.d.ts.map +1 -0
  259. package/dist/execution/goal-preamble.d.ts +2 -0
  260. package/dist/execution/goal-preamble.d.ts.map +1 -0
  261. package/dist/execution/index.d.ts +21 -180
  262. package/dist/execution/index.d.ts.map +1 -0
  263. package/dist/execution/index.js +465 -180
  264. package/dist/execution/index.js.map +7 -1
  265. package/dist/execution/intelligent-compactor.d.ts +85 -0
  266. package/dist/execution/intelligent-compactor.d.ts.map +1 -0
  267. package/dist/execution/model-runtime.d.ts +75 -0
  268. package/dist/execution/model-runtime.d.ts.map +1 -0
  269. package/dist/execution/parallel-eternal-engine.d.ts +130 -0
  270. package/dist/execution/parallel-eternal-engine.d.ts.map +1 -0
  271. package/dist/execution/prompt-enhancer.d.ts +12 -13
  272. package/dist/execution/prompt-enhancer.d.ts.map +1 -0
  273. package/dist/execution/prompt-enhancer.js +13 -7
  274. package/dist/execution/prompt-enhancer.js.map +7 -1
  275. package/dist/execution/prompt-loader.d.ts +52 -0
  276. package/dist/execution/prompt-loader.d.ts.map +1 -0
  277. package/dist/execution/provider-runner-impl.d.ts +14 -0
  278. package/dist/execution/provider-runner-impl.d.ts.map +1 -0
  279. package/dist/execution/regex-patterns.d.ts +7 -0
  280. package/dist/execution/regex-patterns.d.ts.map +1 -0
  281. package/dist/execution/retry-policy.d.ts +35 -0
  282. package/dist/execution/retry-policy.d.ts.map +1 -0
  283. package/dist/execution/selective-compactor.d.ts +94 -0
  284. package/dist/execution/selective-compactor.d.ts.map +1 -0
  285. package/dist/execution/skill-loader.d.ts +43 -0
  286. package/dist/execution/skill-loader.d.ts.map +1 -0
  287. package/dist/execution/strategy-compactor.d.ts +43 -0
  288. package/dist/execution/strategy-compactor.d.ts.map +1 -0
  289. package/dist/execution/tool-executor.d.ts +112 -0
  290. package/dist/execution/tool-executor.d.ts.map +1 -0
  291. package/dist/extension/extension-points.d.ts +121 -0
  292. package/dist/extension/extension-points.d.ts.map +1 -0
  293. package/dist/extension/index.d.ts +3 -10
  294. package/dist/extension/index.d.ts.map +1 -0
  295. package/dist/extension/index.js +59 -5
  296. package/dist/extension/index.js.map +7 -1
  297. package/dist/extension/registry.d.ts +86 -0
  298. package/dist/extension/registry.d.ts.map +1 -0
  299. package/dist/fleet-notifier.d.ts +28 -0
  300. package/dist/fleet-notifier.d.ts.map +1 -0
  301. package/dist/hooks/http-executor.d.ts +11 -0
  302. package/dist/hooks/http-executor.d.ts.map +1 -0
  303. package/dist/hooks/index.d.ts +10 -0
  304. package/dist/hooks/index.d.ts.map +1 -0
  305. package/dist/hooks/registry.d.ts +71 -0
  306. package/dist/hooks/registry.d.ts.map +1 -0
  307. package/dist/hooks/runner.d.ts +65 -0
  308. package/dist/hooks/runner.d.ts.map +1 -0
  309. package/dist/hooks/shell-executor.d.ts +33 -0
  310. package/dist/hooks/shell-executor.d.ts.map +1 -0
  311. package/dist/hooks/shell-hooks-equal.d.ts +15 -0
  312. package/dist/hooks/shell-hooks-equal.d.ts.map +1 -0
  313. package/dist/hq/agent-bridge.d.ts +27 -0
  314. package/dist/hq/agent-bridge.d.ts.map +1 -0
  315. package/dist/hq/alerts.d.ts +67 -0
  316. package/dist/hq/alerts.d.ts.map +1 -0
  317. package/dist/hq/auth-store.d.ts +161 -0
  318. package/dist/hq/auth-store.d.ts.map +1 -0
  319. package/dist/hq/brain-bridge.d.ts +37 -0
  320. package/dist/hq/brain-bridge.d.ts.map +1 -0
  321. package/dist/hq/commands.d.ts +122 -0
  322. package/dist/hq/commands.d.ts.map +1 -0
  323. package/dist/hq/cost-bridge.d.ts +36 -0
  324. package/dist/hq/cost-bridge.d.ts.map +1 -0
  325. package/dist/hq/factory.d.ts +66 -0
  326. package/dist/hq/factory.d.ts.map +1 -0
  327. package/dist/hq/fleet-bridge.d.ts +39 -0
  328. package/dist/hq/fleet-bridge.d.ts.map +1 -0
  329. package/dist/hq/index.d.ts +18 -816
  330. package/dist/hq/index.d.ts.map +1 -0
  331. package/dist/hq/index.js +417 -122
  332. package/dist/hq/index.js.map +7 -1
  333. package/dist/hq/mailbox-mapper.d.ts +27 -0
  334. package/dist/hq/mailbox-mapper.d.ts.map +1 -0
  335. package/dist/hq/persistence.d.ts +121 -0
  336. package/dist/hq/persistence.d.ts.map +1 -0
  337. package/dist/hq/protocol.d.ts +560 -0
  338. package/dist/hq/protocol.d.ts.map +1 -0
  339. package/dist/hq/publisher.d.ts +177 -0
  340. package/dist/hq/publisher.d.ts.map +1 -0
  341. package/dist/hq/redaction.d.ts +30 -0
  342. package/dist/hq/redaction.d.ts.map +1 -0
  343. package/dist/hq/session-bridge.d.ts +29 -0
  344. package/dist/hq/session-bridge.d.ts.map +1 -0
  345. package/dist/hq/tool-bridge.d.ts +41 -0
  346. package/dist/hq/tool-bridge.d.ts.map +1 -0
  347. package/dist/hq/transcript-mapper.d.ts +36 -0
  348. package/dist/hq/transcript-mapper.d.ts.map +1 -0
  349. package/dist/hq/worktree-bridge.d.ts +34 -0
  350. package/dist/hq/worktree-bridge.d.ts.map +1 -0
  351. package/dist/index.d.ts +108 -2872
  352. package/dist/index.d.ts.map +1 -0
  353. package/dist/index.js +2724 -1344
  354. package/dist/index.js.map +7 -1
  355. package/dist/infrastructure/context-manager.d.ts +92 -0
  356. package/dist/infrastructure/context-manager.d.ts.map +1 -0
  357. package/dist/infrastructure/index.d.ts +6 -64
  358. package/dist/infrastructure/index.d.ts.map +1 -0
  359. package/dist/infrastructure/index.js +39 -12
  360. package/dist/infrastructure/index.js.map +7 -1
  361. package/dist/infrastructure/logger.d.ts +99 -0
  362. package/dist/infrastructure/logger.d.ts.map +1 -0
  363. package/dist/infrastructure/mcp-servers.d.ts +83 -0
  364. package/dist/infrastructure/mcp-servers.d.ts.map +1 -0
  365. package/dist/{path-resolver-CMS5307d.d.ts → infrastructure/path-resolver.d.ts} +3 -5
  366. package/dist/infrastructure/path-resolver.d.ts.map +1 -0
  367. package/dist/infrastructure/token-counter.d.ts +57 -0
  368. package/dist/infrastructure/token-counter.d.ts.map +1 -0
  369. package/dist/kernel/container.d.ts +84 -0
  370. package/dist/kernel/container.d.ts.map +1 -0
  371. package/dist/{events-Bgnh43r9.d.ts → kernel/events.d.ts} +112 -206
  372. package/dist/kernel/events.d.ts.map +1 -0
  373. package/dist/kernel/index.d.ts +6 -107
  374. package/dist/kernel/index.d.ts.map +1 -0
  375. package/dist/kernel/index.js +56 -4
  376. package/dist/kernel/index.js.map +7 -1
  377. package/dist/kernel/pipeline.d.ts +105 -0
  378. package/dist/kernel/pipeline.d.ts.map +1 -0
  379. package/dist/kernel/run-controller.d.ts +55 -0
  380. package/dist/kernel/run-controller.d.ts.map +1 -0
  381. package/dist/kernel/tokens.d.ts +53 -0
  382. package/dist/kernel/tokens.d.ts.map +1 -0
  383. package/dist/mailbox-attach.d.ts +27 -0
  384. package/dist/mailbox-attach.d.ts.map +1 -0
  385. package/dist/middleware/collab-pause.d.ts +73 -0
  386. package/dist/middleware/collab-pause.d.ts.map +1 -0
  387. package/dist/models/codex-catalog.d.ts +41 -0
  388. package/dist/models/codex-catalog.d.ts.map +1 -0
  389. package/dist/models/index.d.ts +8 -163
  390. package/dist/models/index.d.ts.map +1 -0
  391. package/dist/models/index.js +150 -51
  392. package/dist/models/index.js.map +7 -1
  393. package/dist/models/llm-selector.d.ts +47 -0
  394. package/dist/models/llm-selector.d.ts.map +1 -0
  395. package/dist/models/mode-store.d.ts +22 -0
  396. package/dist/models/mode-store.d.ts.map +1 -0
  397. package/dist/models/model-intelligence.d.ts +56 -0
  398. package/dist/models/model-intelligence.d.ts.map +1 -0
  399. package/dist/models/model-router.d.ts +100 -0
  400. package/dist/models/model-router.d.ts.map +1 -0
  401. package/dist/models/models-registry.d.ts +106 -0
  402. package/dist/models/models-registry.d.ts.map +1 -0
  403. package/dist/models/provider-model-resolve.d.ts +69 -0
  404. package/dist/models/provider-model-resolve.d.ts.map +1 -0
  405. package/dist/observability/event-bridge.d.ts +10 -0
  406. package/dist/observability/event-bridge.d.ts.map +1 -0
  407. package/dist/observability/health.d.ts +18 -0
  408. package/dist/observability/health.d.ts.map +1 -0
  409. package/dist/observability/index.d.ts +9 -354
  410. package/dist/observability/index.d.ts.map +1 -0
  411. package/dist/observability/index.js +21 -8
  412. package/dist/observability/index.js.map +7 -1
  413. package/dist/observability/metrics.d.ts +26 -0
  414. package/dist/observability/metrics.d.ts.map +1 -0
  415. package/dist/observability/otel-tracer.d.ts +41 -0
  416. package/dist/observability/otel-tracer.d.ts.map +1 -0
  417. package/dist/observability/otlp-metrics.d.ts +111 -0
  418. package/dist/observability/otlp-metrics.d.ts.map +1 -0
  419. package/dist/observability/otlp-traces.d.ts +95 -0
  420. package/dist/observability/otlp-traces.d.ts.map +1 -0
  421. package/dist/observability/prometheus.d.ts +49 -0
  422. package/dist/observability/prometheus.d.ts.map +1 -0
  423. package/dist/observability/tracer.d.ts +9 -0
  424. package/dist/observability/tracer.d.ts.map +1 -0
  425. package/dist/plugin/api.d.ts +226 -0
  426. package/dist/plugin/api.d.ts.map +1 -0
  427. package/dist/plugin/loader.d.ts +73 -0
  428. package/dist/plugin/loader.d.ts.map +1 -0
  429. package/dist/plugins/chimera-plugin.d.ts +37 -0
  430. package/dist/plugins/chimera-plugin.d.ts.map +1 -0
  431. package/dist/plugins/git-plugin.d.ts +15 -0
  432. package/dist/plugins/git-plugin.d.ts.map +1 -0
  433. package/dist/plugins/observability-plugin.d.ts +19 -0
  434. package/dist/plugins/observability-plugin.d.ts.map +1 -0
  435. package/dist/plugins/plan-plugin.d.ts +16 -0
  436. package/dist/plugins/plan-plugin.d.ts.map +1 -0
  437. package/dist/plugins/prompts-plugin.d.ts +26 -0
  438. package/dist/plugins/prompts-plugin.d.ts.map +1 -0
  439. package/dist/plugins/security-plugin.d.ts +19 -0
  440. package/dist/plugins/security-plugin.d.ts.map +1 -0
  441. package/dist/plugins/skills-plugin.d.ts +42 -0
  442. package/dist/plugins/skills-plugin.d.ts.map +1 -0
  443. package/dist/plugins/sync-plugin.d.ts +22 -0
  444. package/dist/plugins/sync-plugin.d.ts.map +1 -0
  445. package/dist/prompts/index.d.ts +3 -0
  446. package/dist/prompts/index.d.ts.map +1 -0
  447. package/dist/prompts/prompt-installer.d.ts +50 -0
  448. package/dist/prompts/prompt-installer.d.ts.map +1 -0
  449. package/dist/prompts/prompt-manifest-store.d.ts +18 -0
  450. package/dist/prompts/prompt-manifest-store.d.ts.map +1 -0
  451. package/dist/registry/provider-registry.d.ts +51 -0
  452. package/dist/registry/provider-registry.d.ts.map +1 -0
  453. package/dist/registry/slash-command-registry.d.ts +61 -0
  454. package/dist/registry/slash-command-registry.d.ts.map +1 -0
  455. package/dist/registry/tool-registry.d.ts +154 -0
  456. package/dist/registry/tool-registry.d.ts.map +1 -0
  457. package/dist/replay/hash.d.ts +31 -0
  458. package/dist/replay/hash.d.ts.map +1 -0
  459. package/dist/replay/replay-provider-runner.d.ts +53 -0
  460. package/dist/replay/replay-provider-runner.d.ts.map +1 -0
  461. package/dist/{index-CbyuOE5y.d.ts → security/capabilities.d.ts} +31 -34
  462. package/dist/security/capabilities.d.ts.map +1 -0
  463. package/dist/security/config-secrets.d.ts +25 -0
  464. package/dist/security/config-secrets.d.ts.map +1 -0
  465. package/dist/security/index.d.ts +6 -8
  466. package/dist/security/index.d.ts.map +1 -0
  467. package/dist/security/index.js +102 -381
  468. package/dist/security/index.js.map +7 -1
  469. package/dist/security/permission-policy.d.ts +153 -0
  470. package/dist/security/permission-policy.d.ts.map +1 -0
  471. package/dist/security/secret-scrubber.d.ts +14 -0
  472. package/dist/security/secret-scrubber.d.ts.map +1 -0
  473. package/dist/security/secret-vault.d.ts +87 -0
  474. package/dist/security/secret-vault.d.ts.map +1 -0
  475. package/dist/security/yolo-risk.d.ts +11 -0
  476. package/dist/security/yolo-risk.d.ts.map +1 -0
  477. package/dist/{session-registry-Dvg7i_IA.d.ts → session-registry.d.ts} +8 -9
  478. package/dist/session-registry.d.ts.map +1 -0
  479. package/dist/skills/foreign-sources.d.ts +59 -0
  480. package/dist/skills/foreign-sources.d.ts.map +1 -0
  481. package/dist/skills/frontmatter.d.ts +44 -0
  482. package/dist/skills/frontmatter.d.ts.map +1 -0
  483. package/dist/skills/github-fetcher.d.ts +38 -0
  484. package/dist/skills/github-fetcher.d.ts.map +1 -0
  485. package/dist/skills/index.d.ts +11 -582
  486. package/dist/skills/index.d.ts.map +1 -0
  487. package/dist/skills/index.js +81 -43
  488. package/dist/skills/index.js.map +7 -1
  489. package/dist/skills/limits.d.ts +92 -0
  490. package/dist/skills/limits.d.ts.map +1 -0
  491. package/dist/skills/manifest-store.d.ts +42 -0
  492. package/dist/skills/manifest-store.d.ts.map +1 -0
  493. package/dist/skills/registry/github-direct-adapter.d.ts +17 -0
  494. package/dist/skills/registry/github-direct-adapter.d.ts.map +1 -0
  495. package/dist/skills/registry/registry-adapter.d.ts +84 -0
  496. package/dist/skills/registry/registry-adapter.d.ts.map +1 -0
  497. package/dist/skills/registry/skills-sh-adapter.d.ts +13 -0
  498. package/dist/skills/registry/skills-sh-adapter.d.ts.map +1 -0
  499. package/dist/skills/skill-generator.d.ts +82 -0
  500. package/dist/skills/skill-generator.d.ts.map +1 -0
  501. package/dist/skills/skill-installer.d.ts +124 -0
  502. package/dist/skills/skill-installer.d.ts.map +1 -0
  503. package/dist/storage/annotations-store.d.ts +118 -0
  504. package/dist/storage/annotations-store.d.ts.map +1 -0
  505. package/dist/storage/attachment-store.d.ts +31 -0
  506. package/dist/storage/attachment-store.d.ts.map +1 -0
  507. package/dist/storage/cloud-sync.d.ts +44 -0
  508. package/dist/storage/cloud-sync.d.ts.map +1 -0
  509. package/dist/storage/completed-work-checkpoint.d.ts +11 -0
  510. package/dist/storage/completed-work-checkpoint.d.ts.map +1 -0
  511. package/dist/storage/config-loader.d.ts +104 -0
  512. package/dist/storage/config-loader.d.ts.map +1 -0
  513. package/dist/storage/config-migration.d.ts +87 -0
  514. package/dist/storage/config-migration.d.ts.map +1 -0
  515. package/dist/storage/config-store.d.ts +22 -0
  516. package/dist/storage/config-store.d.ts.map +1 -0
  517. package/dist/{director-state-CMS_bMs4.d.ts → storage/director-state.d.ts} +28 -8
  518. package/dist/storage/director-state.d.ts.map +1 -0
  519. package/dist/storage/file-session-writer.d.ts +169 -0
  520. package/dist/storage/file-session-writer.d.ts.map +1 -0
  521. package/dist/{goal-store-Datpp-ar.d.ts → storage/goal-store.d.ts} +26 -19
  522. package/dist/storage/goal-store.d.ts.map +1 -0
  523. package/dist/storage/index.d.ts +39 -1031
  524. package/dist/storage/index.d.ts.map +1 -0
  525. package/dist/storage/index.js +655 -300
  526. package/dist/storage/index.js.map +7 -1
  527. package/dist/storage/input-history-store.d.ts +56 -0
  528. package/dist/storage/input-history-store.d.ts.map +1 -0
  529. package/dist/storage/memory-backend.d.ts +66 -0
  530. package/dist/storage/memory-backend.d.ts.map +1 -0
  531. package/dist/storage/memory-consolidator.d.ts +50 -0
  532. package/dist/storage/memory-consolidator.d.ts.map +1 -0
  533. package/dist/storage/memory-graph-backend.d.ts +117 -0
  534. package/dist/storage/memory-graph-backend.d.ts.map +1 -0
  535. package/dist/storage/memory-store.d.ts +119 -0
  536. package/dist/storage/memory-store.d.ts.map +1 -0
  537. package/dist/storage/plan-store.d.ts +78 -0
  538. package/dist/storage/plan-store.d.ts.map +1 -0
  539. package/dist/storage/plan-templates.d.ts +21 -0
  540. package/dist/storage/plan-templates.d.ts.map +1 -0
  541. package/dist/storage/prompt-store.d.ts +37 -0
  542. package/dist/storage/prompt-store.d.ts.map +1 -0
  543. package/dist/storage/prompt-usage-store.d.ts +29 -0
  544. package/dist/storage/prompt-usage-store.d.ts.map +1 -0
  545. package/dist/storage/provider-config-watcher.d.ts +34 -0
  546. package/dist/storage/provider-config-watcher.d.ts.map +1 -0
  547. package/dist/storage/queue-store.d.ts +37 -0
  548. package/dist/storage/queue-store.d.ts.map +1 -0
  549. package/dist/storage/recovery-lock.d.ts +79 -0
  550. package/dist/storage/recovery-lock.d.ts.map +1 -0
  551. package/dist/storage/replay-log-store.d.ts +97 -0
  552. package/dist/storage/replay-log-store.d.ts.map +1 -0
  553. package/dist/storage/session-analyzer.d.ts +48 -0
  554. package/dist/storage/session-analyzer.d.ts.map +1 -0
  555. package/dist/storage/session-checkpoint-cas.d.ts +37 -0
  556. package/dist/storage/session-checkpoint-cas.d.ts.map +1 -0
  557. package/dist/{session-event-bridge-D_z_mBwk.d.ts → storage/session-event-bridge.d.ts} +14 -15
  558. package/dist/storage/session-event-bridge.d.ts.map +1 -0
  559. package/dist/storage/session-helpers.d.ts +9 -0
  560. package/dist/storage/session-helpers.d.ts.map +1 -0
  561. package/dist/storage/session-id.d.ts +18 -0
  562. package/dist/storage/session-id.d.ts.map +1 -0
  563. package/dist/storage/session-reader.d.ts +21 -0
  564. package/dist/storage/session-reader.d.ts.map +1 -0
  565. package/dist/storage/session-recovery.d.ts +93 -0
  566. package/dist/storage/session-recovery.d.ts.map +1 -0
  567. package/dist/storage/session-resume-validation.d.ts +6 -0
  568. package/dist/storage/session-resume-validation.d.ts.map +1 -0
  569. package/dist/storage/session-rewinder.d.ts +21 -0
  570. package/dist/storage/session-rewinder.d.ts.map +1 -0
  571. package/dist/storage/session-store.d.ts +210 -0
  572. package/dist/storage/session-store.d.ts.map +1 -0
  573. package/dist/storage/session-summary.d.ts +12 -0
  574. package/dist/storage/session-summary.d.ts.map +1 -0
  575. package/dist/storage/session-tool-call-ends.d.ts +5 -0
  576. package/dist/storage/session-tool-call-ends.d.ts.map +1 -0
  577. package/dist/storage/storage-concurrency.d.ts +2 -0
  578. package/dist/storage/storage-concurrency.d.ts.map +1 -0
  579. package/dist/storage/task-store.d.ts +33 -0
  580. package/dist/storage/task-store.d.ts.map +1 -0
  581. package/dist/storage/todos-checkpoint.d.ts +39 -0
  582. package/dist/storage/todos-checkpoint.d.ts.map +1 -0
  583. package/dist/storage/tool-audit-log.d.ts +141 -0
  584. package/dist/storage/tool-audit-log.d.ts.map +1 -0
  585. package/dist/tasking/index.d.ts +3 -124
  586. package/dist/tasking/index.d.ts.map +1 -0
  587. package/dist/tasking/index.js +57 -4
  588. package/dist/tasking/index.js.map +7 -1
  589. package/dist/tasking/task-store.d.ts +22 -0
  590. package/dist/tasking/task-store.d.ts.map +1 -0
  591. package/dist/tasking/task-tracker.d.ts +102 -0
  592. package/dist/tasking/task-tracker.d.ts.map +1 -0
  593. package/dist/tools/index.d.ts +2 -59
  594. package/dist/tools/index.d.ts.map +1 -0
  595. package/dist/tools/index.js +93 -14
  596. package/dist/tools/index.js.map +7 -1
  597. package/dist/tools/mcp-control.d.ts +53 -0
  598. package/dist/tools/mcp-control.d.ts.map +1 -0
  599. package/dist/tools/mcp-use.d.ts +24 -0
  600. package/dist/tools/mcp-use.d.ts.map +1 -0
  601. package/dist/types/agent-bridge.d.ts +42 -0
  602. package/dist/types/agent-bridge.d.ts.map +1 -0
  603. package/dist/types/attachment.d.ts +54 -0
  604. package/dist/types/attachment.d.ts.map +1 -0
  605. package/dist/types/autonomy.d.ts +5 -0
  606. package/dist/types/autonomy.d.ts.map +1 -0
  607. package/dist/types/blocks.d.ts +76 -0
  608. package/dist/types/blocks.d.ts.map +1 -0
  609. package/dist/{compactor-DQLL4HTo.d.ts → types/compactor.d.ts} +5 -7
  610. package/dist/types/compactor.d.ts.map +1 -0
  611. package/dist/{config-MRqn1V-u.d.ts → types/config.d.ts} +135 -354
  612. package/dist/types/config.d.ts.map +1 -0
  613. package/dist/types/context-evidence.d.ts +68 -0
  614. package/dist/types/context-evidence.d.ts.map +1 -0
  615. package/dist/types/context-window.d.ts +35 -0
  616. package/dist/types/context-window.d.ts.map +1 -0
  617. package/dist/{default-config-B79_gJYv.d.ts → types/default-config.d.ts} +10 -11
  618. package/dist/types/default-config.d.ts.map +1 -0
  619. package/dist/types/design-kit.d.ts +91 -0
  620. package/dist/types/design-kit.d.ts.map +1 -0
  621. package/dist/{retry-policy-CQ7KwXJa.d.ts → types/error-handler.d.ts} +5 -12
  622. package/dist/types/error-handler.d.ts.map +1 -0
  623. package/dist/types/errors.d.ts +277 -0
  624. package/dist/types/errors.d.ts.map +1 -0
  625. package/dist/types/hooks.d.ts +167 -0
  626. package/dist/types/hooks.d.ts.map +1 -0
  627. package/dist/types/index.d.ts +40 -244
  628. package/dist/types/index.d.ts.map +1 -0
  629. package/dist/types/index.js +90 -12
  630. package/dist/types/index.js.map +7 -1
  631. package/dist/{input-reader-E-ffP2ee.d.ts → types/input-reader.d.ts} +3 -4
  632. package/dist/types/input-reader.d.ts.map +1 -0
  633. package/dist/{logger-B63L5bTg.d.ts → types/logger.d.ts} +3 -4
  634. package/dist/types/logger.d.ts.map +1 -0
  635. package/dist/types/memory.d.ts +89 -0
  636. package/dist/types/memory.d.ts.map +1 -0
  637. package/dist/types/messages.d.ts +24 -0
  638. package/dist/types/messages.d.ts.map +1 -0
  639. package/dist/types/mode-prompts.d.ts +2 -0
  640. package/dist/types/mode-prompts.d.ts.map +1 -0
  641. package/dist/{mode-CZlO9iU1.d.ts → types/mode.d.ts} +6 -7
  642. package/dist/types/mode.d.ts.map +1 -0
  643. package/dist/types/models-registry.d.ts +105 -0
  644. package/dist/types/models-registry.d.ts.map +1 -0
  645. package/dist/types/multi-agent.d.ts +435 -0
  646. package/dist/types/multi-agent.d.ts.map +1 -0
  647. package/dist/{observability-D-HZN_mF.d.ts → types/observability.d.ts} +12 -13
  648. package/dist/types/observability.d.ts.map +1 -0
  649. package/dist/{path-resolver-CPRj4bFY.d.ts → types/path-resolver.d.ts} +2 -3
  650. package/dist/types/path-resolver.d.ts.map +1 -0
  651. package/dist/{permission-ByDKXEcG.d.ts → types/permission.d.ts} +8 -9
  652. package/dist/types/permission.d.ts.map +1 -0
  653. package/dist/types/plugin.d.ts +385 -0
  654. package/dist/types/plugin.d.ts.map +1 -0
  655. package/dist/types/prompt-registry.d.ts +81 -0
  656. package/dist/types/prompt-registry.d.ts.map +1 -0
  657. package/dist/{prompt-DLd35n4Q.d.ts → types/prompt.d.ts} +14 -15
  658. package/dist/types/prompt.d.ts.map +1 -0
  659. package/dist/{provider-runner-ChL-kVg6.d.ts → types/provider-runner.d.ts} +9 -10
  660. package/dist/types/provider-runner.d.ts.map +1 -0
  661. package/dist/types/provider.d.ts +387 -0
  662. package/dist/types/provider.d.ts.map +1 -0
  663. package/dist/types/renderer.d.ts +23 -0
  664. package/dist/types/renderer.d.ts.map +1 -0
  665. package/dist/types/retry-policy.d.ts +7 -0
  666. package/dist/types/retry-policy.d.ts.map +1 -0
  667. package/dist/types/secret-scrubber.d.ts +5 -0
  668. package/dist/types/secret-scrubber.d.ts.map +1 -0
  669. package/dist/{secret-vault-BAKpgFw_.d.ts → types/secret-vault.d.ts} +13 -7
  670. package/dist/types/secret-vault.d.ts.map +1 -0
  671. package/dist/{selector-D8O6B_Rm.d.ts → types/selector.d.ts} +4 -6
  672. package/dist/types/selector.d.ts.map +1 -0
  673. package/dist/types/session-reader.d.ts +81 -0
  674. package/dist/types/session-reader.d.ts.map +1 -0
  675. package/dist/{session-rewinder-C9HnMkhP.d.ts → types/session-rewinder.d.ts} +5 -6
  676. package/dist/types/session-rewinder.d.ts.map +1 -0
  677. package/dist/types/session.d.ts +650 -0
  678. package/dist/types/session.d.ts.map +1 -0
  679. package/dist/types/side-effect.d.ts +34 -0
  680. package/dist/types/side-effect.d.ts.map +1 -0
  681. package/dist/{skill-DHniprNl.d.ts → types/skill.d.ts} +4 -5
  682. package/dist/types/skill.d.ts.map +1 -0
  683. package/dist/types/slash-command.d.ts +59 -0
  684. package/dist/types/slash-command.d.ts.map +1 -0
  685. package/dist/types/spec.d.ts +77 -0
  686. package/dist/types/spec.d.ts.map +1 -0
  687. package/dist/types/system-prompt-contributor.d.ts +20 -0
  688. package/dist/types/system-prompt-contributor.d.ts.map +1 -0
  689. package/dist/types/system-prompt.d.ts +51 -0
  690. package/dist/types/system-prompt.d.ts.map +1 -0
  691. package/dist/{task-graph-CH3acNQ7.d.ts → types/task-graph.d.ts} +21 -22
  692. package/dist/types/task-graph.d.ts.map +1 -0
  693. package/dist/types/token-counter.d.ts +42 -0
  694. package/dist/types/token-counter.d.ts.map +1 -0
  695. package/dist/types/tool-executor.d.ts +133 -0
  696. package/dist/types/tool-executor.d.ts.map +1 -0
  697. package/dist/types/tool-markers.d.ts +23 -0
  698. package/dist/types/tool-markers.d.ts.map +1 -0
  699. package/dist/types/tool.d.ts +245 -0
  700. package/dist/types/tool.d.ts.map +1 -0
  701. package/dist/types/utility-types.d.ts +31 -0
  702. package/dist/types/utility-types.d.ts.map +1 -0
  703. package/dist/utils/assert-never.d.ts +14 -0
  704. package/dist/utils/assert-never.d.ts.map +1 -0
  705. package/dist/utils/atomic-write.d.ts +12 -0
  706. package/dist/utils/atomic-write.d.ts.map +1 -0
  707. package/dist/utils/child-env.d.ts +67 -0
  708. package/dist/utils/child-env.d.ts.map +1 -0
  709. package/dist/utils/color.d.ts +20 -0
  710. package/dist/utils/color.d.ts.map +1 -0
  711. package/dist/utils/config-json.d.ts +14 -0
  712. package/dist/utils/config-json.d.ts.map +1 -0
  713. package/dist/utils/context-evidence.d.ts +47 -0
  714. package/dist/utils/context-evidence.d.ts.map +1 -0
  715. package/dist/utils/deep-merge.d.ts +64 -0
  716. package/dist/utils/deep-merge.d.ts.map +1 -0
  717. package/dist/utils/diff.d.ts +11 -0
  718. package/dist/utils/diff.d.ts.map +1 -0
  719. package/dist/utils/error.d.ts +2 -3
  720. package/dist/utils/error.d.ts.map +1 -0
  721. package/dist/utils/error.js +3 -3
  722. package/dist/utils/error.js.map +7 -1
  723. package/dist/utils/expect-defined.d.ts +2 -3
  724. package/dist/utils/expect-defined.d.ts.map +1 -0
  725. package/dist/utils/expect-defined.js +3 -3
  726. package/dist/utils/expect-defined.js.map +7 -1
  727. package/dist/utils/glob-expand.d.ts +10 -0
  728. package/dist/utils/glob-expand.d.ts.map +1 -0
  729. package/dist/utils/glob-match.d.ts +4 -0
  730. package/dist/utils/glob-match.d.ts.map +1 -0
  731. package/dist/utils/index.d.ts +37 -920
  732. package/dist/utils/index.d.ts.map +1 -0
  733. package/dist/utils/index.js +242 -33
  734. package/dist/utils/index.js.map +7 -1
  735. package/dist/utils/instruction-file.d.ts +3 -0
  736. package/dist/utils/instruction-file.d.ts.map +1 -0
  737. package/dist/utils/ip-guard.d.ts +34 -0
  738. package/dist/utils/ip-guard.d.ts.map +1 -0
  739. package/dist/utils/json-repair.d.ts +23 -0
  740. package/dist/utils/json-repair.d.ts.map +1 -0
  741. package/dist/utils/json-schema-validate.d.ts +42 -0
  742. package/dist/utils/json-schema-validate.d.ts.map +1 -0
  743. package/dist/utils/lru-cache.d.ts +29 -0
  744. package/dist/utils/lru-cache.d.ts.map +1 -0
  745. package/dist/utils/merge-custom-models.d.ts +12 -0
  746. package/dist/utils/merge-custom-models.d.ts.map +1 -0
  747. package/dist/utils/merge-models-payload.d.ts +20 -0
  748. package/dist/utils/merge-models-payload.d.ts.map +1 -0
  749. package/dist/utils/message-invariants.d.ts +22 -0
  750. package/dist/utils/message-invariants.d.ts.map +1 -0
  751. package/dist/utils/newline-normalize.d.ts +5 -0
  752. package/dist/utils/newline-normalize.d.ts.map +1 -0
  753. package/dist/utils/regex-guard.d.ts +21 -0
  754. package/dist/utils/regex-guard.d.ts.map +1 -0
  755. package/dist/utils/safe-json.d.ts +31 -0
  756. package/dist/utils/safe-json.d.ts.map +1 -0
  757. package/dist/utils/session-scoped-path.d.ts +13 -0
  758. package/dist/utils/session-scoped-path.d.ts.map +1 -0
  759. package/dist/utils/sleep.d.ts +5 -0
  760. package/dist/utils/sleep.d.ts.map +1 -0
  761. package/dist/utils/slug.d.ts +13 -0
  762. package/dist/utils/slug.d.ts.map +1 -0
  763. package/dist/utils/string.d.ts +9 -0
  764. package/dist/utils/string.d.ts.map +1 -0
  765. package/dist/utils/task-format.d.ts +22 -0
  766. package/dist/utils/task-format.d.ts.map +1 -0
  767. package/dist/utils/term.d.ts +133 -0
  768. package/dist/utils/term.d.ts.map +1 -0
  769. package/dist/utils/todos-format.d.ts +30 -0
  770. package/dist/utils/todos-format.d.ts.map +1 -0
  771. package/dist/utils/token-estimate.d.ts +112 -0
  772. package/dist/utils/token-estimate.d.ts.map +1 -0
  773. package/dist/utils/tool-description-mode.d.ts +28 -0
  774. package/dist/utils/tool-description-mode.d.ts.map +1 -0
  775. package/dist/utils/tool-output-serializer.d.ts +40 -0
  776. package/dist/utils/tool-output-serializer.d.ts.map +1 -0
  777. package/dist/utils/tool-result-render-mode.d.ts +55 -0
  778. package/dist/utils/tool-result-render-mode.d.ts.map +1 -0
  779. package/dist/utils/tool-subject.d.ts +5 -0
  780. package/dist/utils/tool-subject.d.ts.map +1 -0
  781. package/dist/utils/tool-wire-compact.d.ts +28 -0
  782. package/dist/utils/tool-wire-compact.d.ts.map +1 -0
  783. package/dist/utils/ulid.d.ts +11 -0
  784. package/dist/utils/ulid.d.ts.map +1 -0
  785. package/dist/{wstack-paths-C3K40Qst.d.ts → utils/wstack-paths.d.ts} +7 -8
  786. package/dist/utils/wstack-paths.d.ts.map +1 -0
  787. package/dist/worktree/index.d.ts +2 -0
  788. package/dist/worktree/index.d.ts.map +1 -0
  789. package/dist/{worktree-manager-DzwxKE35.d.ts → worktree/worktree-manager.d.ts} +19 -13
  790. package/dist/worktree/worktree-manager.d.ts.map +1 -0
  791. package/instructions/autonomy/active-mission.md +2 -4
  792. package/instructions/sections/tool/delegation-full.md +1 -1
  793. package/package.json +4 -5
  794. package/skills/node-modern/SKILL.md +2 -2
  795. package/skills/plugin-author/SKILL.md +9 -16
  796. package/dist/dispatcher-types.d-BBeXBQgS.d.ts +0 -66
  797. package/dist/global-mailbox-sZwyI6CS.d.ts +0 -959
  798. package/dist/index--Gm41aBJ.d.ts +0 -671
  799. package/dist/mcp-servers-DEV4s6Ks.d.ts +0 -259
  800. package/dist/multi-agent-coordinator-4RCRZKjN.d.ts +0 -1770
  801. package/dist/null-fleet-bus-CFoNVQEK.d.ts +0 -2127
  802. package/dist/pipeline-DGDyIohT.d.ts +0 -331
  803. package/dist/provider-model-resolve-o2hHLs79.d.ts +0 -263
  804. package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
  805. package/dist/secret-vault-DxohkUBc.d.ts +0 -272
  806. package/dist/session-reader-7Esxrkpw.d.ts +0 -155
  807. package/dist/task-format-GX0B1mMC.d.ts +0 -23
  808. package/dist/todos-checkpoint-FY7PjmMx.d.ts +0 -850
  809. package/dist/tool-BNlnIJvo.d.ts +0 -2190
  810. package/dist/tool-executor-CckSCM5E.d.ts +0 -906
@@ -0,0 +1,245 @@
1
+ import type { Context } from '../core/context.js';
2
+ export type Permission = 'auto' | 'confirm' | 'deny';
3
+ /**
4
+ * Risk tier for tools in UI/audit surfaces. YOLO auto-approves non-denied
5
+ * calls regardless of risk tier; when YOLO is off, risk can inform prompts.
6
+ *
7
+ * - `safe` — read-only, no side effects (read, glob, grep, etc.)
8
+ * - `standard` — non-destructive writes and mutations (write, edit, safe shell commands)
9
+ * - `destructive` — irreversible or broadside effects (recursive deletes, db drops, etc.)
10
+ */
11
+ export type RiskTier = 'safe' | 'standard' | 'destructive';
12
+ /**
13
+ * Icon identifiers for tools — each UI (WebUI/TUI/REPL) maps these to its own icon library.
14
+ * Add the icon directly on each Tool so all UIs consume the same canonical value.
15
+ */
16
+ export type ToolIconId = 'file' | 'edit' | 'search' | 'folder' | 'terminal' | 'web' | 'git' | 'tree' | 'code' | 'test' | 'package' | 'document' | 'scaffold' | 'todo' | 'plan' | 'task' | 'meta' | 'index' | 'json' | 'diff' | 'logs' | 'settings' | 'fallback';
17
+ export interface JSONSchema {
18
+ type?: string | undefined;
19
+ properties?: Record<string, JSONSchema>;
20
+ required?: string[] | undefined;
21
+ items?: JSONSchema | undefined;
22
+ enum?: unknown[] | undefined;
23
+ description?: string | undefined;
24
+ [k: string]: unknown;
25
+ }
26
+ /**
27
+ * Tool progress event — yielded by `Tool.executeStream` to give the UI
28
+ * something to render while a long-running tool works. The executor
29
+ * publishes each event via EventBus as `tool.progress` so the TUI, logger,
30
+ * and observability layer can consume them uniformly.
31
+ *
32
+ * Keep events small. They are buffered through the EventBus synchronously
33
+ * and rendered on the main thread.
34
+ */
35
+ export interface ToolProgressEvent {
36
+ /**
37
+ * - `log` — verbose informational message (e.g. "scanning…")
38
+ * - `warning` — non-fatal issue (e.g. "skipped X due to ENOENT")
39
+ * - `metric` — numeric data (e.g. files scanned so far)
40
+ * - `file_changed` — a tool that mutates the workspace announces a write
41
+ * - `partial_output` — stream of textual output (bash stdout, fetch body)
42
+ */
43
+ type: 'log' | 'warning' | 'metric' | 'file_changed' | 'partial_output';
44
+ text?: string | undefined;
45
+ data?: Record<string, unknown>;
46
+ }
47
+ /**
48
+ * Terminal event for `executeStream`. The output must match the tool's
49
+ * declared output type — the executor unwraps `output` and treats it like
50
+ * a normal `execute` return value.
51
+ */
52
+ export interface ToolFinalEvent<O> {
53
+ type: 'final';
54
+ output: O;
55
+ }
56
+ export type ToolStreamEvent<O = unknown> = ToolProgressEvent | ToolFinalEvent<O>;
57
+ export interface Tool<I = unknown, O = unknown> {
58
+ name: string;
59
+ description: string;
60
+ /**
61
+ * Pre-computed token estimate for this tool's definition (name +
62
+ * description + JSON-serialized inputSchema). Set by ToolRegistry on
63
+ * registration; consumed by estimateToolDefTokens / estimateRequestTokens
64
+ * to skip redundant JSON.stringify on every context-pressure check.
65
+ */
66
+ _estDefTokens?: number | undefined;
67
+ usageHint?: string | undefined;
68
+ /** Structured guidance for choosing between similar tools. */
69
+ selection?: {
70
+ /** A concise boundary where this tool should not be selected. */
71
+ doNotUseWhen: string;
72
+ /** Tool names the model should prefer for that boundary. */
73
+ useInstead?: readonly string[] | undefined;
74
+ } | undefined;
75
+ /** Optional category for grouping in help lists and system prompts. */
76
+ category?: string | undefined;
77
+ inputSchema: JSONSchema;
78
+ permission: Permission;
79
+ mutating: boolean;
80
+ /**
81
+ * Risk tier for selective YOLO gating. When YOLO is active, clearly
82
+ * destructive calls still emit `confirm`. Defaults to `standard` when
83
+ * omitted — callers should always check `riskTier` after the basic
84
+ * permission decision.
85
+ */
86
+ riskTier?: RiskTier | undefined;
87
+ /**
88
+ * Input-field name that the permission policy should match trust rules
89
+ * against. Without this, the policy falls back to a heuristic
90
+ * (`command` / `path` / `url` / `name`) that can collide across tools —
91
+ * e.g. an HTTP tool whose `path` means "request path" would be checked
92
+ * against filesystem-path trust rules. Set explicitly to avoid the
93
+ * cross-tool subject collision.
94
+ *
95
+ * The named field's value must be a string at runtime; non-string values
96
+ * fall back to the heuristic.
97
+ */
98
+ subjectKey?: string | undefined;
99
+ maxOutputBytes?: number | undefined;
100
+ timeoutMs?: number | undefined;
101
+ /**
102
+ * Hint for the TUI spinner — does NOT affect actual timeout enforcement.
103
+ * Use `timeoutMs` for hard limits. Leave undefined when duration varies
104
+ * unpredictably.
105
+ */
106
+ estimatedDurationMs?: number | undefined;
107
+ /**
108
+ * Declarative security capabilities granted by this tool.
109
+ *
110
+ * Examples: "shell.arbitrary", "fs.write", "fs.write.outside-project",
111
+ * "net.outbound", "mcp.proxy", "subagent.spawn", "config.mutate".
112
+ *
113
+ * These are used by permission policies (especially subagent guards) and
114
+ * future capability-based allowlists. Prefer well-known values over ad-hoc strings.
115
+ *
116
+ * This field is optional for backward compatibility. Tools without it are
117
+ * treated conservatively by guards.
118
+ */
119
+ capabilities?: readonly string[] | undefined;
120
+ /**
121
+ * Icon identifier for this tool — consumed by all UIs (WebUI/TUI/REPL) to
122
+ * render a tool-specific icon instead of a generic fallback.
123
+ * Each UI maps this id to its own icon library.
124
+ */
125
+ icon?: ToolIconId | undefined;
126
+ execute(input: I, ctx: Context, opts: {
127
+ signal: AbortSignal;
128
+ }): Promise<O>;
129
+ /**
130
+ * Optional cross-field validation hook. Called by the executor AFTER
131
+ * JSON Schema validation passes and AFTER PreToolUse hooks may have
132
+ * rewritten the input, but BEFORE permission checks and execution.
133
+ *
134
+ * Use this for invariants the JSON Schema cannot express — e.g.
135
+ * `old_string !== new_string` in edit, or `end > start` in a range tool.
136
+ * Return an array of validation errors (empty = valid). The executor
137
+ * surfaces them to the model just like schema validation errors, so the
138
+ * model can self-correct without the tool's `execute()` running.
139
+ *
140
+ * P3 #16 (before-release.md): tools that implement cross-field checks
141
+ * inside `execute()` can migrate them here for earlier rejection and
142
+ * consistent error formatting.
143
+ */
144
+ validate?(input: I): string[];
145
+ /**
146
+ * Optional streaming variant. When defined, the executor prefers this
147
+ * over `execute` — yielded events become `tool.progress` EventBus events
148
+ * and the terminal `final` event provides the output. Tools that don't
149
+ * have intermediate state shouldn't implement this; the default `execute`
150
+ * path is more efficient.
151
+ */
152
+ executeStream?(input: I, ctx: Context, opts: {
153
+ signal: AbortSignal;
154
+ }): AsyncIterable<ToolStreamEvent<O>>;
155
+ /**
156
+ * Optional teardown hook fired by the executor when the tool's run is
157
+ * aborted (signal triggered). Errors thrown here are swallowed so they
158
+ * never mask the originating failure.
159
+ *
160
+ * **When to use `cleanup` vs `ctx.registerAbortHook`:**
161
+ *
162
+ * - Use `cleanup` for resources **owned by the tool author** that are
163
+ * established at execute-time: child processes spawned by the tool,
164
+ * file handles opened by the tool, network connections initiated by
165
+ * the tool. The lifecycle is co-located with the tool definition, so
166
+ * readers see the resource and its teardown in one place.
167
+ *
168
+ * ```ts
169
+ * async execute(input, ctx, opts) {
170
+ * const child = spawn(...);
171
+ * // … tool work …
172
+ * },
173
+ * async cleanup(_input, _ctx) {
174
+ * // best-effort kill of any child still running
175
+ * }
176
+ * ```
177
+ *
178
+ * - Use `ctx.registerAbortHook` for **context-scoped teardown** registered
179
+ * dynamically inside `execute`: when the tool delegates to a library
180
+ * that needs cancellation, or when the resource is created lazily
181
+ * somewhere down the call stack and the natural cleanup point isn't
182
+ * at the tool boundary. The hook fires when the **agent run** ends,
183
+ * not when this specific tool call aborts.
184
+ *
185
+ * ```ts
186
+ * async execute(input, ctx, opts) {
187
+ * const handle = openHelper();
188
+ * ctx.registerAbortHook(() => handle.dispose());
189
+ * // … work …
190
+ * }
191
+ * ```
192
+ *
193
+ * If both are registered for the same resource, `cleanup` fires first
194
+ * (on tool abort) and the abort-hook fires after on the wider run abort.
195
+ * Avoid double-free by gating one on the other's effect, or pick a single
196
+ * teardown channel per resource.
197
+ */
198
+ cleanup?(input: I, ctx: Context): Promise<void>;
199
+ /**
200
+ * Optional custom output serializer. When present, the executor's output
201
+ * serializer calls this INSTEAD of the central `renderToolObject()` switch
202
+ * — the tool owns its own pretty-printing.
203
+ *
204
+ * Return a string representation of the output that the model will see in
205
+ * its tool_result block. The serializer applies the iteration output cap
206
+ * AFTER this runs, so don't worry about truncation.
207
+ *
208
+ * P3 #21 (before-release.md): `renderToolObject()` is a god function with
209
+ * 30+ per-tool branches, far from each tool's definition. New tools that
210
+ * want custom output no longer need to add a branch there — they implement
211
+ * this method instead. Existing branches stay until migrated incrementally.
212
+ */
213
+ serialize?(output: O, input: I): string;
214
+ }
215
+ export interface ToolCallContext {
216
+ tool: Tool;
217
+ input: unknown;
218
+ callId: string;
219
+ ctx: Context;
220
+ signal: AbortSignal;
221
+ }
222
+ /**
223
+ * Error categories for tool execution failures.
224
+ * Used by the executor to classify errors and determine retry strategy.
225
+ */
226
+ export declare enum ToolErrorCategory {
227
+ TRANSIENT = "transient",// ETIMEDOUT, ECONNRESET, network timeout, HTTP 429/503
228
+ NOT_FOUND = "not_found",// ENOENT, ENOTDIR, HTTP 404
229
+ PERMISSION = "permission",// EACCES, EPERM, HTTP 401/403
230
+ VALIDATION = "validation",// schema validation error, HTTP 400
231
+ FATAL = "fatal"
232
+ }
233
+ /**
234
+ * Structured tool error information for the LLM and retry logic.
235
+ */
236
+ export interface ToolErrorInfo {
237
+ readonly category: ToolErrorCategory;
238
+ /** Whether the operation can be retried automatically. */
239
+ readonly retryable: boolean;
240
+ /** User-facing message describing the error. */
241
+ readonly userMessage: string;
242
+ /** Optional technical detail for debugging. */
243
+ readonly detail?: string;
244
+ }
245
+ //# sourceMappingURL=tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/types/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,UAAU,GACV,UAAU,GACV,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAChC,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,gBAAgB,CAAC;IACvE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,CAAC,CAAC;CACX;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IAAI,iBAAiB,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAEjF,MAAM,WAAW,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,8DAA8D;IAC9D,SAAS,CAAC,EAAE;QACV,iEAAiE;QACjE,YAAY,EAAE,MAAM,CAAC;QACrB,4DAA4D;QAC5D,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;KAC5C,GAAG,SAAS,CAAC;IACd,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,EAAE,UAAU,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChC;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzC;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC7C;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3E;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;IAC9B;;;;;;OAMG;IACH,aAAa,CAAC,CACZ,KAAK,EAAE,CAAC,EACR,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,GAC5B,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;CACzC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,SAAS,cAAc,CAAE,uDAAuD;IAChF,SAAS,cAAc,CAAE,4BAA4B;IACrD,UAAU,eAAe,CAAE,8BAA8B;IACzD,UAAU,eAAe,CAAE,oCAAoC;IAC/D,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Shared type-level utilities used across WrongStack packages.
3
+ *
4
+ * These are pure type helpers with no runtime footprint. They solve
5
+ * recurring TypeScript pattern problems that the standard library
6
+ * types (Pick, Omit, Partial, etc.) don't handle well — particularly
7
+ * around discriminated unions and distribution.
8
+ */
9
+ /**
10
+ * Distributive version of the built-in {@link Omit}.
11
+ *
12
+ * **Why this exists:** The standard `Omit<T, K>` is defined as
13
+ * `Pick<T, Exclude<keyof T, K>>`. When `T` is a discriminated union,
14
+ * `keyof T` returns the *intersection* of all members' keys — not
15
+ * what you want. `Omit<{ a: 1 } | { b: 2 }, 'id'>` collapses to `{}`.
16
+ *
17
+ * `DistributiveOmit` forces distribution over each union member via
18
+ * a conditional type (`T extends unknown`), yielding the expected
19
+ * result: `Omit<{ a: 1 }, 'id'> | Omit<{ b: 2 }, 'id'>`.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * type Entry = { id: number; kind: 'user'; text: string }
24
+ * | { id: number; kind: 'tool'; name: string };
25
+ *
26
+ * type Broken = Omit<Entry, 'id'>; // {}
27
+ * type Working = DistributiveOmit<Entry, 'id'>; // { kind: 'user'; text } | { kind: 'tool'; name }
28
+ * ```
29
+ */
30
+ export type DistributiveOmit<T, K extends string | number | symbol> = T extends unknown ? Omit<T, K> : never;
31
+ //# sourceMappingURL=utility-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utility-types.d.ts","sourceRoot":"","sources":["../../src/types/utility-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,OAAO,GACnF,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,KAAK,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Exhaustiveness check for discriminated union switches.
3
+ * Place in the `default` branch of a switch over a union type
4
+ * to get a compile-time error when a new variant is added.
5
+ *
6
+ * @example
7
+ * switch (block.type) {
8
+ * case 'text': return renderText(block);
9
+ * case 'tool_use': return renderToolUse(block);
10
+ * default: return assertNever(block);
11
+ * }
12
+ */
13
+ export declare function assertNever(x: never, message?: string): never;
14
+ //# sourceMappingURL=assert-never.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-never.d.ts","sourceRoot":"","sources":["../../src/utils/assert-never.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAM7D"}
@@ -0,0 +1,12 @@
1
+ export interface AtomicWriteOptions {
2
+ mode?: number | undefined;
3
+ encoding?: BufferEncoding | undefined;
4
+ }
5
+ export interface FileLockOptions {
6
+ timeoutMs?: number | undefined;
7
+ staleMs?: number | undefined;
8
+ }
9
+ export declare function atomicWrite(targetPath: string, content: string | Uint8Array, opts?: AtomicWriteOptions): Promise<void>;
10
+ export declare function ensureDir(dir: string): Promise<void>;
11
+ export declare function withFileLock<T>(targetPath: string, fn: () => Promise<T>, opts?: FileLockOptions): Promise<T>;
12
+ //# sourceMappingURL=atomic-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atomic-write.d.ts","sourceRoot":"","sources":["../../src/utils/atomic-write.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CACvC;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,wBAAsB,WAAW,CAC/B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,UAAU,EAC5B,IAAI,GAAE,kBAAuB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA4Df;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;AAED,wBAAsB,YAAY,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,CAAC,CAAC,CA0DZ"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Build a sanitized child-process environment.
3
+ *
4
+ * The bash/exec tools and MCP stdio transports execute LLM-generated or
5
+ * configured commands. The parent process carries provider API keys
6
+ * (ANTHROPIC_API_KEY, OPENAI_API_KEY, ...), VCS tokens (GITHUB_TOKEN),
7
+ * and cloud credentials. Forwarding those to a child is an exfiltration
8
+ * vector even with `permission: 'confirm'` — a compromised MCP server
9
+ * or a cleverly composed shell pipeline can leak secrets.
10
+ *
11
+ * Strategy: copy a small, explicit allowlist of variables that real builds
12
+ * need, then copy anything else that does NOT look secret-bearing. This
13
+ * preserves user-friendly behavior (locale, terminal, npm config) while
14
+ * blocking the obvious leak channels. Two value-side guards back up the
15
+ * name-based filter:
16
+ * - any value carrying an embedded URI credential (`scheme://user:pass@host`,
17
+ * e.g. `DATABASE_URL`/`REDIS_URL`/`*_DSN`) is dropped (WS-01);
18
+ * - `NODE_OPTIONS` is forwarded but with module-preload directives
19
+ * (`--require`/`--import`/`--loader`) stripped so a parent-set value can't
20
+ * inject code into node children (WS-02).
21
+ *
22
+ * Override with `WRONGSTACK_CHILD_ENV_PASSTHROUGH=1` to forward the full
23
+ * parent environment unchanged (opt-in for advanced users who understand
24
+ * the risk).
25
+ */
26
+ /**
27
+ * Strip module-preload directives from a `NODE_OPTIONS` value while preserving
28
+ * benign flags (`--no-warnings`, `--max-old-space-size=…`, etc.). Handles both
29
+ * the `--require=./x.js` and space-separated `--require ./x.js` forms. Returns
30
+ * the sanitized string (possibly empty).
31
+ */
32
+ export declare function sanitizeNodeOptions(value: string): string;
33
+ export interface BuildChildEnvOptions {
34
+ /** Session ID to inject as WRONGSTACK_SESSION_ID. */
35
+ sessionId?: string | undefined;
36
+ /** Additional env vars to merge (takes priority over filtered parent env). */
37
+ extra?: NodeJS.ProcessEnv | undefined;
38
+ }
39
+ /**
40
+ * Commit identity applied to every git-touching child process via the
41
+ * `GIT_AUTHOR_*` / `GIT_COMMITTER_*` env vars. Env-var identity outranks
42
+ * every `git config` layer (repo/global/system), so commits made by any
43
+ * tool (git tool, bash/exec, worktree manager, plugins) carry this
44
+ * name/email without touching the user's git config — hand-made commits
45
+ * in a normal terminal are unaffected.
46
+ */
47
+ export interface GitIdentity {
48
+ name?: string | undefined;
49
+ email?: string | undefined;
50
+ }
51
+ /**
52
+ * Set (or clear with `null`) the git commit identity injected by
53
+ * `buildChildEnv()`. Wired at boot from the user-level `config.git.identity`
54
+ * (the config loader strips `git` from repo-committed in-project configs —
55
+ * identity spoofing must not be repo-controllable) and re-applied at runtime
56
+ * by the `/gitid` slash command.
57
+ */
58
+ export declare function configureChildEnvGitIdentity(identity: GitIdentity | null | undefined): void;
59
+ /** Current configured git identity, or null when none is set. */
60
+ export declare function getChildEnvGitIdentity(): Readonly<GitIdentity> | null;
61
+ /**
62
+ * Build a filtered child-process environment suitable for bash, exec, and
63
+ * MCP server subprocesses. Strips API keys, tokens, and other credentials
64
+ * while preserving system/tooling variables.
65
+ */
66
+ export declare function buildChildEnv(optsOrSessionId?: BuildChildEnvOptions | string): NodeJS.ProcessEnv;
67
+ //# sourceMappingURL=child-env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-env.d.ts","sourceRoot":"","sources":["../../src/utils/child-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA8FH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAazD;AAED,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,SAAS,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAID;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAI3F;AAED,iEAAiE;AACjE,wBAAgB,sBAAsB,IAAI,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAErE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,eAAe,CAAC,EAAE,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC,UAAU,CAkHhG"}
@@ -0,0 +1,20 @@
1
+ export declare const color: {
2
+ reset: (s: string) => string;
3
+ bold: (s: string) => string;
4
+ dim: (s: string) => string;
5
+ italic: (s: string) => string;
6
+ underline: (s: string) => string;
7
+ red: (s: string) => string;
8
+ green: (s: string) => string;
9
+ yellow: (s: string) => string;
10
+ blue: (s: string) => string;
11
+ magenta: (s: string) => string;
12
+ cyan: (s: string) => string;
13
+ gray: (s: string) => string;
14
+ amber: (s: string) => string;
15
+ pink: (s: string) => string;
16
+ bgRed: (s: string) => string;
17
+ bgGreen: (s: string) => string;
18
+ };
19
+ export declare function stripAnsi(s: string): string;
20
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/utils/color.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,KAAK;IAChB,KAAK,MAJD,MAAM,KAAG,MAAM;IAKnB,IAAI;IACJ,GAAG;IACH,MAAM;IACN,SAAS;IACT,GAAG;IACH,KAAK;IACL,MAAM;IACN,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,KAAK;IACL,OAAO;CACR,CAAC;AAEF,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C"}
@@ -0,0 +1,14 @@
1
+ export type JsonObject = Record<string, unknown>;
2
+ export type JsonPathSegment = string | number;
3
+ export type JsonPath = readonly JsonPathSegment[];
4
+ export declare function readJsonObjectFile(filePath: string): Promise<JsonObject>;
5
+ export declare function jsonObjectFileExists(filePath: string): Promise<boolean>;
6
+ export declare function writeJsonObjectFile(filePath: string, value: JsonObject): Promise<void>;
7
+ export declare function updateJsonObjectFile(filePath: string, mutator: (config: JsonObject) => void | JsonObject | Promise<void | JsonObject>): Promise<JsonObject>;
8
+ export declare function getJsonPath(root: unknown, path: JsonPath): unknown;
9
+ export declare function setJsonPath(root: JsonObject, path: JsonPath, value: unknown): JsonObject;
10
+ export declare function removeJsonPath(root: JsonObject, path: JsonPath): boolean;
11
+ export declare function setJsonPathInFile(filePath: string, path: JsonPath, value: unknown): Promise<JsonObject>;
12
+ export declare function removeJsonPathInFile(filePath: string, path: JsonPath): Promise<JsonObject>;
13
+ export declare function isJsonObject(value: unknown): value is JsonObject;
14
+ //# sourceMappingURL=config-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-json.d.ts","sourceRoot":"","sources":["../../src/utils/config-json.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACjD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAC9C,MAAM,MAAM,QAAQ,GAAG,SAAS,eAAe,EAAE,CAAC;AAElD,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAO9E;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO7E;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5F;AAED,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,GAAG,UAAU,CAAC,GAC9E,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAYlE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,CAexF;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAYxE;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7G;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAIhG;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
@@ -0,0 +1,47 @@
1
+ import type { Context } from '../core/context.js';
2
+ import type { TextBlock } from '../types/blocks.js';
3
+ import type { CompletedWorkEvidence, CompletedWorkSource, ContextEvidenceState, ToolOutputMetadata } from '../types/context-evidence.js';
4
+ export declare function createContextEvidenceState(): ContextEvidenceState;
5
+ export interface RecordToolOutputEvidenceInput {
6
+ toolUseId: string;
7
+ toolName: string;
8
+ input: unknown;
9
+ content: string;
10
+ ok: boolean;
11
+ outputBytes?: number | undefined;
12
+ outputTokens?: number | undefined;
13
+ outputLines?: number | undefined;
14
+ }
15
+ export declare function recordUserIntentEvidence(ctx: Context, text: string): void;
16
+ export declare function recordToolOutputEvidence(ctx: Context, input: RecordToolOutputEvidenceInput): ToolOutputMetadata;
17
+ export declare function markAssistantReferencedEvidence(ctx: Context, text: string): void;
18
+ export declare function buildContextEvidenceDigest(ctx: Context): string;
19
+ export declare function repeatedReadPressure(ctx: Context): number;
20
+ /** Marker prefixing the ledger's system-prompt block (also used to find/replace it). */
21
+ export declare const COMPLETED_WORK_LEDGER_MARKER = "[completed_work_ledger]";
22
+ export interface RecordCompletedWorkInput {
23
+ /** Stable dedupe key, e.g. `task:<id>` — re-completion updates in place. */
24
+ key: string;
25
+ source: CompletedWorkSource;
26
+ summary: string;
27
+ /** Optional pointer to proof (test run, commit hash, file path). */
28
+ evidence?: string | undefined;
29
+ /** Epoch ms; defaults to now. */
30
+ completedAt?: number | undefined;
31
+ }
32
+ /**
33
+ * Append one finished unit of work to the session ledger. The provider request
34
+ * composer renders this state as a volatile tail block; the stable system-prompt
35
+ * prefix is never mutated here.
36
+ */
37
+ export declare function recordCompletedWorkEvidence(ctx: Context, input: RecordCompletedWorkInput): CompletedWorkEvidence;
38
+ /** Render the ledger's system-prompt block text (marker + newest entries). */
39
+ export declare function formatCompletedWorkLedger(items: readonly CompletedWorkEvidence[]): string;
40
+ /** Build the current volatile completed-work block without mutating the prompt. */
41
+ export declare function buildCompletedWorkLedgerBlock(ctx: Context): TextBlock | undefined;
42
+ /**
43
+ * @deprecated Volatile state must be composed at request time. Kept as a
44
+ * compatibility no-op for embedders importing the old helper.
45
+ */
46
+ export declare function syncCompletedWorkLedgerBlock(_ctx: Context): void;
47
+ //# sourceMappingURL=context-evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-evidence.d.ts","sourceRoot":"","sources":["../../src/utils/context-evidence.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,8BAA8B,CAAC;AAgBtC,wBAAgB,0BAA0B,IAAI,oBAAoB,CAWjE;AAED,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CASzE;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,6BAA6B,GACnC,kBAAkB,CAqDpB;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAyBhF;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAgE/D;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEzD;AAoBD,wFAAwF;AACxF,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,MAAM,WAAW,wBAAwB;IACvC,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,mBAAmB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,wBAAwB,GAC9B,qBAAqB,CAiBvB;AAED,8EAA8E;AAC9E,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,GAAG,MAAM,CAYzF;AAED,mFAAmF;AACnF,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAQjF;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAEhE"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Deep merge utility — safely merges nested objects with configurable
3
+ * conflict resolution, array merging, and prototype-pollution guarding.
4
+ *
5
+ * Used by:
6
+ * - config-loader (config layer merging with primitive-array concatenation)
7
+ * - secret-vault (config patching)
8
+ * - json-path (json_merge tool with prefer-base / prefer-patch semantics)
9
+ *
10
+ * @module utils/deep-merge
11
+ */
12
+ export declare const FORBIDDEN_PROTO_KEYS: Set<string>;
13
+ /** True when every element is a primitive or null (no nested objects/arrays). */
14
+ export declare function isPrimitiveArray(a: unknown[]): boolean;
15
+ export interface DeepMergeOptions {
16
+ /**
17
+ * Which side wins on collision for scalars and arrays.
18
+ *
19
+ * - `'prefer-patch'` (default): patch value replaces base value.
20
+ * - `'prefer-base'`: base value is kept, patch value is ignored.
21
+ */
22
+ conflictResolution?: 'prefer-base' | 'prefer-patch';
23
+ /**
24
+ * How to handle array values.
25
+ *
26
+ * - `'replace'` (default): patch array replaces base array entirely.
27
+ * - `'concat-primitives'`: when both values are primitive arrays,
28
+ * they are concatenated and deduped (via Set). Non-primitive
29
+ * arrays still replace the base wholesale.
30
+ */
31
+ arrayMode?: 'replace' | 'concat-primitives';
32
+ /**
33
+ * Skip prototype-pollution keys (`__proto__`, `constructor`, etc.).
34
+ * Enabled by default. Only disable when you control both inputs
35
+ * and the keyset (e.g. when merging trusted JSON schemas).
36
+ */
37
+ protectProto?: boolean;
38
+ /**
39
+ * Optional callback fired when a non-primitive (object) array is
40
+ * replaced wholesale (only relevant with `arrayMode: 'concat-primitives'`).
41
+ * Receives the key name, existing array length, and patch array length.
42
+ * Used by config-loader for debug logging.
43
+ */
44
+ onNonPrimitiveArrayReplace?: (key: string, existingLen: number, patchLen: number) => void;
45
+ }
46
+ /**
47
+ * Recursively merge `patch` into `base`, returning a new object.
48
+ *
49
+ * - Nested plain objects are merged recursively.
50
+ * - Arrays are handled per `options.arrayMode`.
51
+ * - Scalar collisions are resolved per `options.conflictResolution`.
52
+ * - `null` and non-object values in `patch` replace the base value
53
+ * (unless `conflictResolution` is `'prefer-base'`).
54
+ * - Keys in `base` that are absent from `patch` are preserved.
55
+ * - `FORBIDDEN_PROTO_KEYS` are skipped in the patch (unless
56
+ * `options.protectProto` is set to `false`).
57
+ *
58
+ * The function is generic over `T extends Record<string, unknown>` for
59
+ * callers that pass typed config objects, but the runtime signature
60
+ * also accepts `unknown` inputs (used by the json-path plugin).
61
+ */
62
+ export declare function deepMerge<T extends Record<string, unknown>>(base: T, patch: Record<string, unknown>, options?: DeepMergeOptions): T;
63
+ export declare function deepMerge(base: unknown, patch: unknown, options?: DeepMergeOptions): unknown;
64
+ //# sourceMappingURL=deep-merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-merge.d.ts","sourceRoot":"","sources":["../../src/utils/deep-merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,eAAO,MAAM,oBAAoB,aAQ/B,CAAC;AAMH,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAEtD;AAMD,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC;IAEpD;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,mBAAmB,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,CAC3B,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzD,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,CAAC,EAAE,gBAAgB,GACzB,CAAC,CAAC;AAEL,wBAAgB,SAAS,CACvB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Myers diff with unified-format output. No external dependencies.
3
+ * Operates on arrays of lines (newline-terminated or stripped).
4
+ */
5
+ export interface UnifiedDiffOptions {
6
+ context?: number | undefined;
7
+ fromFile?: string | undefined;
8
+ toFile?: string | undefined;
9
+ }
10
+ export declare function unifiedDiff(oldText: string, newText: string, opts?: UnifiedDiffOptions): string;
11
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/utils/diff.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6FH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,kBAAuB,GAC5B,MAAM,CA4ER"}
@@ -2,6 +2,5 @@
2
2
  * Converts an unknown error value to a human-readable string.
3
3
  * Used in 40+ files across the codebase to normalize error messaging.
4
4
  */
5
- declare function toErrorMessage(err: unknown): string;
6
-
7
- export { toErrorMessage };
5
+ export declare function toErrorMessage(err: unknown): string;
6
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEnD"}
@@ -2,7 +2,7 @@
2
2
  function toErrorMessage(err) {
3
3
  return err instanceof Error ? err.message : String(err);
4
4
  }
5
-
6
- export { toErrorMessage };
5
+ export {
6
+ toErrorMessage
7
+ };
7
8
  //# sourceMappingURL=error.js.map
8
- //# sourceMappingURL=error.js.map
@@ -1 +1,7 @@
1
- {"version":3,"sources":["../../src/utils/error.ts"],"names":[],"mappings":";AAIO,SAAS,eAAe,GAAA,EAAsB;AACnD,EAAA,OAAO,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,OAAO,GAAG,CAAA;AACxD","file":"error.js","sourcesContent":["/**\n * Converts an unknown error value to a human-readable string.\n * Used in 40+ files across the codebase to normalize error messaging.\n */\nexport function toErrorMessage(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/error.ts"],
4
+ "sourcesContent": ["/**\n * Converts an unknown error value to a human-readable string.\n * Used in 40+ files across the codebase to normalize error messaging.\n */\nexport function toErrorMessage(err: unknown): string {\n return err instanceof Error ? err.message : String(err);\n}\n"],
5
+ "mappings": ";AAIO,SAAS,eAAe,KAAsB;AACnD,SAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AACxD;",
6
+ "names": []
7
+ }
@@ -2,6 +2,5 @@
2
2
  * Useful after optional chaining and indexed access when the
3
3
  * control flow guarantees the value exists but TypeScript can't
4
4
  * prove it (e.g. after a check on a related field). */
5
- declare function expectDefined<T>(value: T | null | undefined, label?: string): T;
6
-
7
- export { expectDefined };
5
+ export declare function expectDefined<T>(value: T | null | undefined, label?: string): T;
6
+ //# sourceMappingURL=expect-defined.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expect-defined.d.ts","sourceRoot":"","sources":["../../src/utils/expect-defined.ts"],"names":[],"mappings":"AAAA;;;wDAGwD;AACxD,wBAAgB,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAO/E"}
@@ -7,7 +7,7 @@ function expectDefined(value, label) {
7
7
  }
8
8
  return value;
9
9
  }
10
-
11
- export { expectDefined };
10
+ export {
11
+ expectDefined
12
+ };
12
13
  //# sourceMappingURL=expect-defined.js.map
13
- //# sourceMappingURL=expect-defined.js.map