@wrongstack/core 0.284.1 → 0.286.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 (831) 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 +129 -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 +152 -0
  60. package/dist/coordination/autonomous-brain.d.ts.map +1 -0
  61. package/dist/coordination/autonomous-coordinator.d.ts +243 -0
  62. package/dist/coordination/autonomous-coordinator.d.ts.map +1 -0
  63. package/dist/coordination/brain-ledger.d.ts +142 -0
  64. package/dist/coordination/brain-ledger.d.ts.map +1 -0
  65. package/dist/coordination/brain-monitor.d.ts +103 -0
  66. package/dist/coordination/brain-monitor.d.ts.map +1 -0
  67. package/dist/coordination/brain.d.ts +147 -0
  68. package/dist/coordination/brain.d.ts.map +1 -0
  69. package/dist/coordination/change-manager.d.ts +151 -0
  70. package/dist/coordination/change-manager.d.ts.map +1 -0
  71. package/dist/coordination/checkpoint-wiring.d.ts +61 -0
  72. package/dist/coordination/checkpoint-wiring.d.ts.map +1 -0
  73. package/dist/coordination/collab-bus.d.ts +132 -0
  74. package/dist/coordination/collab-bus.d.ts.map +1 -0
  75. package/dist/coordination/collab-debug.d.ts +302 -0
  76. package/dist/coordination/collab-debug.d.ts.map +1 -0
  77. package/dist/coordination/commit-safety.d.ts +72 -0
  78. package/dist/coordination/commit-safety.d.ts.map +1 -0
  79. package/dist/coordination/consensus-protocol.d.ts +106 -0
  80. package/dist/coordination/consensus-protocol.d.ts.map +1 -0
  81. package/dist/coordination/coordinator/error-classifier.d.ts +15 -0
  82. package/dist/coordination/coordinator/error-classifier.d.ts.map +1 -0
  83. package/dist/coordination/delegate-tool.d.ts +101 -0
  84. package/dist/coordination/delegate-tool.d.ts.map +1 -0
  85. package/dist/coordination/dep-watcher-bridge.d.ts +47 -0
  86. package/dist/coordination/dep-watcher-bridge.d.ts.map +1 -0
  87. package/dist/coordination/dep-watcher.d.ts +74 -0
  88. package/dist/coordination/dep-watcher.d.ts.map +1 -0
  89. package/dist/coordination/director/director-errors.d.ts +29 -0
  90. package/dist/coordination/director/director-errors.d.ts.map +1 -0
  91. package/dist/coordination/director-construction.d.ts +90 -0
  92. package/dist/coordination/director-construction.d.ts.map +1 -0
  93. package/dist/coordination/director-prompts.d.ts +119 -0
  94. package/dist/coordination/director-prompts.d.ts.map +1 -0
  95. package/dist/coordination/director-session.d.ts +68 -0
  96. package/dist/coordination/director-session.d.ts.map +1 -0
  97. package/dist/coordination/director-tools.d.ts +65 -0
  98. package/dist/coordination/director-tools.d.ts.map +1 -0
  99. package/dist/coordination/director.d.ts +802 -0
  100. package/dist/coordination/director.d.ts.map +1 -0
  101. package/dist/coordination/dispatcher.d.ts +82 -0
  102. package/dist/coordination/dispatcher.d.ts.map +1 -0
  103. package/dist/coordination/file-author-tracker.d.ts +76 -0
  104. package/dist/coordination/file-author-tracker.d.ts.map +1 -0
  105. package/dist/coordination/fleet-bus.d.ts +122 -0
  106. package/dist/coordination/fleet-bus.d.ts.map +1 -0
  107. package/dist/coordination/fleet-event-validation.d.ts +10 -0
  108. package/dist/coordination/fleet-event-validation.d.ts.map +1 -0
  109. package/dist/coordination/fleet-manager.d.ts +234 -0
  110. package/dist/coordination/fleet-manager.d.ts.map +1 -0
  111. package/dist/coordination/fleet-spawn.d.ts +102 -0
  112. package/dist/coordination/fleet-spawn.d.ts.map +1 -0
  113. package/dist/coordination/fleet-status-tool.d.ts +36 -0
  114. package/dist/coordination/fleet-status-tool.d.ts.map +1 -0
  115. package/dist/coordination/fleet-supervisor.d.ts +157 -0
  116. package/dist/coordination/fleet-supervisor.d.ts.map +1 -0
  117. package/dist/coordination/fleet.d.ts +96 -0
  118. package/dist/coordination/fleet.d.ts.map +1 -0
  119. package/dist/coordination/global-mailbox.d.ts +295 -0
  120. package/dist/coordination/global-mailbox.d.ts.map +1 -0
  121. package/dist/coordination/icoordinator.d.ts +97 -0
  122. package/dist/coordination/icoordinator.d.ts.map +1 -0
  123. package/dist/coordination/ifleet-manager.d.ts +177 -0
  124. package/dist/coordination/ifleet-manager.d.ts.map +1 -0
  125. package/dist/coordination/in-memory-transport.d.ts +12 -0
  126. package/dist/coordination/in-memory-transport.d.ts.map +1 -0
  127. package/dist/coordination/index.d.ts +79 -2587
  128. package/dist/coordination/index.d.ts.map +1 -0
  129. package/dist/coordination/index.js +2262 -673
  130. package/dist/coordination/index.js.map +7 -1
  131. package/dist/coordination/knowledge-graph.d.ts +229 -0
  132. package/dist/coordination/knowledge-graph.d.ts.map +1 -0
  133. package/dist/coordination/large-answer-store.d.ts +61 -0
  134. package/dist/coordination/large-answer-store.d.ts.map +1 -0
  135. package/dist/coordination/mail-tools.d.ts +34 -0
  136. package/dist/coordination/mail-tools.d.ts.map +1 -0
  137. package/dist/coordination/mailbox-actions.d.ts +67 -0
  138. package/dist/coordination/mailbox-actions.d.ts.map +1 -0
  139. package/dist/coordination/mailbox-constants.d.ts +64 -0
  140. package/dist/coordination/mailbox-constants.d.ts.map +1 -0
  141. package/dist/coordination/mailbox-events.d.ts +32 -0
  142. package/dist/coordination/mailbox-events.d.ts.map +1 -0
  143. package/dist/coordination/mailbox-health.d.ts +131 -0
  144. package/dist/coordination/mailbox-health.d.ts.map +1 -0
  145. package/dist/coordination/mailbox-hooks.d.ts +55 -0
  146. package/dist/coordination/mailbox-hooks.d.ts.map +1 -0
  147. package/dist/coordination/mailbox-message-codec.d.ts +8 -0
  148. package/dist/coordination/mailbox-message-codec.d.ts.map +1 -0
  149. package/dist/coordination/mailbox-tool.d.ts +75 -0
  150. package/dist/coordination/mailbox-tool.d.ts.map +1 -0
  151. package/dist/{mailbox-types-BGZWrYTJ.d.ts → coordination/mailbox-types.d.ts} +125 -26
  152. package/dist/coordination/mailbox-types.d.ts.map +1 -0
  153. package/dist/coordination/mailbox.d.ts +88 -0
  154. package/dist/coordination/mailbox.d.ts.map +1 -0
  155. package/dist/coordination/model-matrix.d.ts +98 -0
  156. package/dist/coordination/model-matrix.d.ts.map +1 -0
  157. package/dist/coordination/multi-agent-coordinator.d.ts +202 -0
  158. package/dist/coordination/multi-agent-coordinator.d.ts.map +1 -0
  159. package/dist/coordination/null-fleet-bus.d.ts +10 -0
  160. package/dist/coordination/null-fleet-bus.d.ts.map +1 -0
  161. package/dist/coordination/package-author-tracker.d.ts +87 -0
  162. package/dist/coordination/package-author-tracker.d.ts.map +1 -0
  163. package/dist/coordination/package-outdated-watcher.d.ts +83 -0
  164. package/dist/coordination/package-outdated-watcher.d.ts.map +1 -0
  165. package/dist/coordination/single-instance-mailbox.d.ts +154 -0
  166. package/dist/coordination/single-instance-mailbox.d.ts.map +1 -0
  167. package/dist/coordination/spawn-budget.d.ts +6 -0
  168. package/dist/coordination/spawn-budget.d.ts.map +1 -0
  169. package/dist/coordination/subagent-budget.d.ts +323 -0
  170. package/dist/coordination/subagent-budget.d.ts.map +1 -0
  171. package/dist/coordination/subagent-nicknames.d.ts +42 -0
  172. package/dist/coordination/subagent-nicknames.d.ts.map +1 -0
  173. package/dist/coordination/subagent-result-tool.d.ts +20 -0
  174. package/dist/coordination/subagent-result-tool.d.ts.map +1 -0
  175. package/dist/coordination/task-auctioneer.d.ts +143 -0
  176. package/dist/coordination/task-auctioneer.d.ts.map +1 -0
  177. package/dist/coordination/task-dag.d.ts +147 -0
  178. package/dist/coordination/task-dag.d.ts.map +1 -0
  179. package/dist/coordination/techstack-mailbox-consumer.d.ts +50 -0
  180. package/dist/coordination/techstack-mailbox-consumer.d.ts.map +1 -0
  181. package/dist/coordination/transport.d.ts +2 -0
  182. package/dist/coordination/transport.d.ts.map +1 -0
  183. package/dist/coordination/worktree-task-runner.d.ts +45 -0
  184. package/dist/coordination/worktree-task-runner.d.ts.map +1 -0
  185. package/dist/core/agent-internals.d.ts +41 -0
  186. package/dist/core/agent-internals.d.ts.map +1 -0
  187. package/dist/core/agent-loop.d.ts +18 -0
  188. package/dist/core/agent-loop.d.ts.map +1 -0
  189. package/dist/core/agent-response.d.ts +21 -0
  190. package/dist/core/agent-response.d.ts.map +1 -0
  191. package/dist/core/agent-tools.d.ts +21 -0
  192. package/dist/core/agent-tools.d.ts.map +1 -0
  193. package/dist/core/agent-types.d.ts +95 -0
  194. package/dist/core/agent-types.d.ts.map +1 -0
  195. package/dist/core/agent.d.ts +54 -0
  196. package/dist/core/agent.d.ts.map +1 -0
  197. package/dist/core/btw.d.ts +40 -0
  198. package/dist/core/btw.d.ts.map +1 -0
  199. package/dist/core/context.d.ts +269 -0
  200. package/dist/core/context.d.ts.map +1 -0
  201. package/dist/core/continue-intent.d.ts +92 -0
  202. package/dist/core/continue-intent.d.ts.map +1 -0
  203. package/dist/core/continue-to-next-iteration.d.ts +96 -0
  204. package/dist/core/continue-to-next-iteration.d.ts.map +1 -0
  205. package/dist/core/conversation-state.d.ts +96 -0
  206. package/dist/core/conversation-state.d.ts.map +1 -0
  207. package/dist/core/fallback-model.d.ts +94 -0
  208. package/dist/core/fallback-model.d.ts.map +1 -0
  209. package/dist/core/fleet-pulse.d.ts +42 -0
  210. package/dist/core/fleet-pulse.d.ts.map +1 -0
  211. package/dist/core/input-builder.d.ts +95 -0
  212. package/dist/core/input-builder.d.ts.map +1 -0
  213. package/dist/core/instruction-bundle.d.ts +22 -0
  214. package/dist/core/instruction-bundle.d.ts.map +1 -0
  215. package/dist/core/iteration-limit.d.ts +35 -0
  216. package/dist/core/iteration-limit.d.ts.map +1 -0
  217. package/dist/core/mailbox-loop.d.ts +63 -0
  218. package/dist/core/mailbox-loop.d.ts.map +1 -0
  219. package/dist/core/modes/brief.d.ts +2 -0
  220. package/dist/core/modes/brief.d.ts.map +1 -0
  221. package/dist/core/modes/default.d.ts +8 -0
  222. package/dist/core/modes/default.d.ts.map +1 -0
  223. package/dist/core/modes/teach.d.ts +2 -0
  224. package/dist/core/modes/teach.d.ts.map +1 -0
  225. package/dist/core/provider-runner.d.ts +24 -0
  226. package/dist/core/provider-runner.d.ts.map +1 -0
  227. package/dist/core/queued-messages.d.ts +55 -0
  228. package/dist/core/queued-messages.d.ts.map +1 -0
  229. package/dist/core/run-env.d.ts +49 -0
  230. package/dist/core/run-env.d.ts.map +1 -0
  231. package/dist/core/streaming-response-builder.d.ts +78 -0
  232. package/dist/core/streaming-response-builder.d.ts.map +1 -0
  233. package/dist/core/system-prompt-builder.d.ts +213 -0
  234. package/dist/core/system-prompt-builder.d.ts.map +1 -0
  235. package/dist/defaults/index.d.ts +68 -158
  236. package/dist/defaults/index.d.ts.map +1 -0
  237. package/dist/defaults/index.js +2061 -1300
  238. package/dist/defaults/index.js.map +7 -1
  239. package/dist/execution/auto-compaction-middleware.d.ts +123 -0
  240. package/dist/execution/auto-compaction-middleware.d.ts.map +1 -0
  241. package/dist/execution/autonomous-runner.d.ts +61 -0
  242. package/dist/execution/autonomous-runner.d.ts.map +1 -0
  243. package/dist/execution/autonomy-brain.d.ts +151 -0
  244. package/dist/execution/autonomy-brain.d.ts.map +1 -0
  245. package/dist/execution/autonomy-prompt-contributor.d.ts +39 -0
  246. package/dist/execution/autonomy-prompt-contributor.d.ts.map +1 -0
  247. package/dist/execution/brain-chain.d.ts +53 -0
  248. package/dist/execution/brain-chain.d.ts.map +1 -0
  249. package/dist/execution/brain-evaluation.d.ts +66 -0
  250. package/dist/execution/brain-evaluation.d.ts.map +1 -0
  251. package/dist/execution/brain-runtime.d.ts +171 -0
  252. package/dist/execution/brain-runtime.d.ts.map +1 -0
  253. package/dist/execution/compaction-core.d.ts +103 -0
  254. package/dist/execution/compaction-core.d.ts.map +1 -0
  255. package/dist/execution/compactor.d.ts +56 -0
  256. package/dist/execution/compactor.d.ts.map +1 -0
  257. package/dist/execution/council-brain.d.ts +79 -0
  258. package/dist/execution/council-brain.d.ts.map +1 -0
  259. package/dist/execution/design-color.d.ts +31 -0
  260. package/dist/execution/design-color.d.ts.map +1 -0
  261. package/dist/execution/design-detect.d.ts +96 -0
  262. package/dist/execution/design-detect.d.ts.map +1 -0
  263. package/dist/execution/design-kit-loader.d.ts +53 -0
  264. package/dist/execution/design-kit-loader.d.ts.map +1 -0
  265. package/dist/execution/design-materialize.d.ts +32 -0
  266. package/dist/execution/design-materialize.d.ts.map +1 -0
  267. package/dist/execution/design-project-store.d.ts +57 -0
  268. package/dist/execution/design-project-store.d.ts.map +1 -0
  269. package/dist/execution/design-verify.d.ts +44 -0
  270. package/dist/execution/design-verify.d.ts.map +1 -0
  271. package/dist/execution/error-handler.d.ts +34 -0
  272. package/dist/execution/error-handler.d.ts.map +1 -0
  273. package/dist/{parallel-eternal-engine-HUrtePLd.d.ts → execution/eternal-autonomy.d.ts} +22 -225
  274. package/dist/execution/eternal-autonomy.d.ts.map +1 -0
  275. package/dist/execution/goal-preamble.d.ts +2 -0
  276. package/dist/execution/goal-preamble.d.ts.map +1 -0
  277. package/dist/execution/index.d.ts +25 -180
  278. package/dist/execution/index.d.ts.map +1 -0
  279. package/dist/execution/index.js +1748 -490
  280. package/dist/execution/index.js.map +7 -1
  281. package/dist/execution/intelligent-compactor.d.ts +85 -0
  282. package/dist/execution/intelligent-compactor.d.ts.map +1 -0
  283. package/dist/execution/model-runtime.d.ts +75 -0
  284. package/dist/execution/model-runtime.d.ts.map +1 -0
  285. package/dist/execution/parallel-eternal-engine.d.ts +142 -0
  286. package/dist/execution/parallel-eternal-engine.d.ts.map +1 -0
  287. package/dist/execution/prompt-enhancer.d.ts +12 -13
  288. package/dist/execution/prompt-enhancer.d.ts.map +1 -0
  289. package/dist/execution/prompt-enhancer.js +13 -7
  290. package/dist/execution/prompt-enhancer.js.map +7 -1
  291. package/dist/execution/prompt-loader.d.ts +52 -0
  292. package/dist/execution/prompt-loader.d.ts.map +1 -0
  293. package/dist/execution/provider-runner-impl.d.ts +14 -0
  294. package/dist/execution/provider-runner-impl.d.ts.map +1 -0
  295. package/dist/execution/regex-patterns.d.ts +7 -0
  296. package/dist/execution/regex-patterns.d.ts.map +1 -0
  297. package/dist/execution/retry-policy.d.ts +35 -0
  298. package/dist/execution/retry-policy.d.ts.map +1 -0
  299. package/dist/execution/selective-compactor.d.ts +94 -0
  300. package/dist/execution/selective-compactor.d.ts.map +1 -0
  301. package/dist/execution/skill-loader.d.ts +43 -0
  302. package/dist/execution/skill-loader.d.ts.map +1 -0
  303. package/dist/execution/strategy-compactor.d.ts +43 -0
  304. package/dist/execution/strategy-compactor.d.ts.map +1 -0
  305. package/dist/execution/tool-executor.d.ts +112 -0
  306. package/dist/execution/tool-executor.d.ts.map +1 -0
  307. package/dist/extension/extension-points.d.ts +121 -0
  308. package/dist/extension/extension-points.d.ts.map +1 -0
  309. package/dist/extension/index.d.ts +3 -10
  310. package/dist/extension/index.d.ts.map +1 -0
  311. package/dist/extension/index.js +59 -5
  312. package/dist/extension/index.js.map +7 -1
  313. package/dist/extension/registry.d.ts +86 -0
  314. package/dist/extension/registry.d.ts.map +1 -0
  315. package/dist/fleet-notifier.d.ts +28 -0
  316. package/dist/fleet-notifier.d.ts.map +1 -0
  317. package/dist/hooks/http-executor.d.ts +11 -0
  318. package/dist/hooks/http-executor.d.ts.map +1 -0
  319. package/dist/hooks/index.d.ts +10 -0
  320. package/dist/hooks/index.d.ts.map +1 -0
  321. package/dist/hooks/registry.d.ts +71 -0
  322. package/dist/hooks/registry.d.ts.map +1 -0
  323. package/dist/hooks/runner.d.ts +65 -0
  324. package/dist/hooks/runner.d.ts.map +1 -0
  325. package/dist/hooks/shell-executor.d.ts +33 -0
  326. package/dist/hooks/shell-executor.d.ts.map +1 -0
  327. package/dist/hooks/shell-hooks-equal.d.ts +15 -0
  328. package/dist/hooks/shell-hooks-equal.d.ts.map +1 -0
  329. package/dist/hq/agent-bridge.d.ts +27 -0
  330. package/dist/hq/agent-bridge.d.ts.map +1 -0
  331. package/dist/hq/alerts.d.ts +67 -0
  332. package/dist/hq/alerts.d.ts.map +1 -0
  333. package/dist/hq/auth-store.d.ts +179 -0
  334. package/dist/hq/auth-store.d.ts.map +1 -0
  335. package/dist/hq/brain-bridge.d.ts +37 -0
  336. package/dist/hq/brain-bridge.d.ts.map +1 -0
  337. package/dist/hq/commands.d.ts +122 -0
  338. package/dist/hq/commands.d.ts.map +1 -0
  339. package/dist/hq/cost-bridge.d.ts +36 -0
  340. package/dist/hq/cost-bridge.d.ts.map +1 -0
  341. package/dist/hq/factory.d.ts +69 -0
  342. package/dist/hq/factory.d.ts.map +1 -0
  343. package/dist/hq/fleet-bridge.d.ts +39 -0
  344. package/dist/hq/fleet-bridge.d.ts.map +1 -0
  345. package/dist/hq/index.d.ts +18 -816
  346. package/dist/hq/index.d.ts.map +1 -0
  347. package/dist/hq/index.js +1043 -192
  348. package/dist/hq/index.js.map +7 -1
  349. package/dist/hq/mailbox-mapper.d.ts +27 -0
  350. package/dist/hq/mailbox-mapper.d.ts.map +1 -0
  351. package/dist/hq/persistence.d.ts +121 -0
  352. package/dist/hq/persistence.d.ts.map +1 -0
  353. package/dist/hq/protocol.d.ts +612 -0
  354. package/dist/hq/protocol.d.ts.map +1 -0
  355. package/dist/hq/publisher.d.ts +181 -0
  356. package/dist/hq/publisher.d.ts.map +1 -0
  357. package/dist/hq/redaction.d.ts +30 -0
  358. package/dist/hq/redaction.d.ts.map +1 -0
  359. package/dist/hq/session-bridge.d.ts +29 -0
  360. package/dist/hq/session-bridge.d.ts.map +1 -0
  361. package/dist/hq/tool-bridge.d.ts +41 -0
  362. package/dist/hq/tool-bridge.d.ts.map +1 -0
  363. package/dist/hq/transcript-mapper.d.ts +36 -0
  364. package/dist/hq/transcript-mapper.d.ts.map +1 -0
  365. package/dist/hq/worktree-bridge.d.ts +34 -0
  366. package/dist/hq/worktree-bridge.d.ts.map +1 -0
  367. package/dist/index.d.ts +114 -2872
  368. package/dist/index.d.ts.map +1 -0
  369. package/dist/index.js +6104 -2737
  370. package/dist/index.js.map +7 -1
  371. package/dist/infrastructure/context-manager.d.ts +92 -0
  372. package/dist/infrastructure/context-manager.d.ts.map +1 -0
  373. package/dist/infrastructure/index.d.ts +6 -64
  374. package/dist/infrastructure/index.d.ts.map +1 -0
  375. package/dist/infrastructure/index.js +39 -12
  376. package/dist/infrastructure/index.js.map +7 -1
  377. package/dist/infrastructure/logger.d.ts +99 -0
  378. package/dist/infrastructure/logger.d.ts.map +1 -0
  379. package/dist/infrastructure/mcp-servers.d.ts +83 -0
  380. package/dist/infrastructure/mcp-servers.d.ts.map +1 -0
  381. package/dist/{path-resolver-CMS5307d.d.ts → infrastructure/path-resolver.d.ts} +3 -5
  382. package/dist/infrastructure/path-resolver.d.ts.map +1 -0
  383. package/dist/infrastructure/token-counter.d.ts +57 -0
  384. package/dist/infrastructure/token-counter.d.ts.map +1 -0
  385. package/dist/kernel/container.d.ts +84 -0
  386. package/dist/kernel/container.d.ts.map +1 -0
  387. package/dist/{events-Bgnh43r9.d.ts → kernel/events.d.ts} +134 -210
  388. package/dist/kernel/events.d.ts.map +1 -0
  389. package/dist/kernel/index.d.ts +6 -107
  390. package/dist/kernel/index.d.ts.map +1 -0
  391. package/dist/kernel/index.js +56 -4
  392. package/dist/kernel/index.js.map +7 -1
  393. package/dist/kernel/pipeline.d.ts +105 -0
  394. package/dist/kernel/pipeline.d.ts.map +1 -0
  395. package/dist/kernel/run-controller.d.ts +55 -0
  396. package/dist/kernel/run-controller.d.ts.map +1 -0
  397. package/dist/kernel/tokens.d.ts +53 -0
  398. package/dist/kernel/tokens.d.ts.map +1 -0
  399. package/dist/mailbox-attach.d.ts +27 -0
  400. package/dist/mailbox-attach.d.ts.map +1 -0
  401. package/dist/middleware/collab-pause.d.ts +73 -0
  402. package/dist/middleware/collab-pause.d.ts.map +1 -0
  403. package/dist/models/codex-catalog.d.ts +41 -0
  404. package/dist/models/codex-catalog.d.ts.map +1 -0
  405. package/dist/models/index.d.ts +8 -163
  406. package/dist/models/index.d.ts.map +1 -0
  407. package/dist/models/index.js +150 -51
  408. package/dist/models/index.js.map +7 -1
  409. package/dist/models/llm-selector.d.ts +47 -0
  410. package/dist/models/llm-selector.d.ts.map +1 -0
  411. package/dist/models/mode-store.d.ts +22 -0
  412. package/dist/models/mode-store.d.ts.map +1 -0
  413. package/dist/models/model-intelligence.d.ts +56 -0
  414. package/dist/models/model-intelligence.d.ts.map +1 -0
  415. package/dist/models/model-router.d.ts +100 -0
  416. package/dist/models/model-router.d.ts.map +1 -0
  417. package/dist/models/models-registry.d.ts +106 -0
  418. package/dist/models/models-registry.d.ts.map +1 -0
  419. package/dist/models/provider-model-resolve.d.ts +69 -0
  420. package/dist/models/provider-model-resolve.d.ts.map +1 -0
  421. package/dist/observability/event-bridge.d.ts +10 -0
  422. package/dist/observability/event-bridge.d.ts.map +1 -0
  423. package/dist/observability/health.d.ts +18 -0
  424. package/dist/observability/health.d.ts.map +1 -0
  425. package/dist/observability/index.d.ts +9 -354
  426. package/dist/observability/index.d.ts.map +1 -0
  427. package/dist/observability/index.js +37 -23
  428. package/dist/observability/index.js.map +7 -1
  429. package/dist/observability/metrics.d.ts +26 -0
  430. package/dist/observability/metrics.d.ts.map +1 -0
  431. package/dist/observability/otel-tracer.d.ts +41 -0
  432. package/dist/observability/otel-tracer.d.ts.map +1 -0
  433. package/dist/observability/otlp-metrics.d.ts +111 -0
  434. package/dist/observability/otlp-metrics.d.ts.map +1 -0
  435. package/dist/observability/otlp-traces.d.ts +95 -0
  436. package/dist/observability/otlp-traces.d.ts.map +1 -0
  437. package/dist/observability/prometheus.d.ts +49 -0
  438. package/dist/observability/prometheus.d.ts.map +1 -0
  439. package/dist/observability/tracer.d.ts +9 -0
  440. package/dist/observability/tracer.d.ts.map +1 -0
  441. package/dist/plugin/api.d.ts +226 -0
  442. package/dist/plugin/api.d.ts.map +1 -0
  443. package/dist/plugin/loader.d.ts +73 -0
  444. package/dist/plugin/loader.d.ts.map +1 -0
  445. package/dist/plugins/chimera-plugin.d.ts +37 -0
  446. package/dist/plugins/chimera-plugin.d.ts.map +1 -0
  447. package/dist/plugins/prompts-plugin.d.ts +26 -0
  448. package/dist/plugins/prompts-plugin.d.ts.map +1 -0
  449. package/dist/plugins/security-plugin.d.ts +19 -0
  450. package/dist/plugins/security-plugin.d.ts.map +1 -0
  451. package/dist/plugins/skills-plugin.d.ts +42 -0
  452. package/dist/plugins/skills-plugin.d.ts.map +1 -0
  453. package/dist/plugins/sync-plugin.d.ts +22 -0
  454. package/dist/plugins/sync-plugin.d.ts.map +1 -0
  455. package/dist/prompts/index.d.ts +3 -0
  456. package/dist/prompts/index.d.ts.map +1 -0
  457. package/dist/prompts/prompt-installer.d.ts +50 -0
  458. package/dist/prompts/prompt-installer.d.ts.map +1 -0
  459. package/dist/prompts/prompt-manifest-store.d.ts +18 -0
  460. package/dist/prompts/prompt-manifest-store.d.ts.map +1 -0
  461. package/dist/registry/provider-registry.d.ts +51 -0
  462. package/dist/registry/provider-registry.d.ts.map +1 -0
  463. package/dist/registry/slash-command-registry.d.ts +61 -0
  464. package/dist/registry/slash-command-registry.d.ts.map +1 -0
  465. package/dist/registry/tool-registry.d.ts +154 -0
  466. package/dist/registry/tool-registry.d.ts.map +1 -0
  467. package/dist/replay/hash.d.ts +31 -0
  468. package/dist/replay/hash.d.ts.map +1 -0
  469. package/dist/replay/replay-provider-runner.d.ts +53 -0
  470. package/dist/replay/replay-provider-runner.d.ts.map +1 -0
  471. package/dist/{index-CbyuOE5y.d.ts → security/capabilities.d.ts} +31 -34
  472. package/dist/security/capabilities.d.ts.map +1 -0
  473. package/dist/security/config-secrets.d.ts +25 -0
  474. package/dist/security/config-secrets.d.ts.map +1 -0
  475. package/dist/security/index.d.ts +7 -8
  476. package/dist/security/index.d.ts.map +1 -0
  477. package/dist/security/index.js +354 -401
  478. package/dist/security/index.js.map +7 -1
  479. package/dist/security/permission-policy-schema.d.ts +77 -0
  480. package/dist/security/permission-policy-schema.d.ts.map +1 -0
  481. package/dist/security/permission-policy.d.ts +158 -0
  482. package/dist/security/permission-policy.d.ts.map +1 -0
  483. package/dist/security/secret-scrubber.d.ts +14 -0
  484. package/dist/security/secret-scrubber.d.ts.map +1 -0
  485. package/dist/security/secret-vault.d.ts +96 -0
  486. package/dist/security/secret-vault.d.ts.map +1 -0
  487. package/dist/security/yolo-risk.d.ts +11 -0
  488. package/dist/security/yolo-risk.d.ts.map +1 -0
  489. package/dist/{session-registry-Dvg7i_IA.d.ts → session-registry.d.ts} +8 -9
  490. package/dist/session-registry.d.ts.map +1 -0
  491. package/dist/skills/foreign-sources.d.ts +59 -0
  492. package/dist/skills/foreign-sources.d.ts.map +1 -0
  493. package/dist/skills/frontmatter.d.ts +44 -0
  494. package/dist/skills/frontmatter.d.ts.map +1 -0
  495. package/dist/skills/github-fetcher.d.ts +38 -0
  496. package/dist/skills/github-fetcher.d.ts.map +1 -0
  497. package/dist/skills/index.d.ts +11 -582
  498. package/dist/skills/index.d.ts.map +1 -0
  499. package/dist/skills/index.js +81 -43
  500. package/dist/skills/index.js.map +7 -1
  501. package/dist/skills/limits.d.ts +92 -0
  502. package/dist/skills/limits.d.ts.map +1 -0
  503. package/dist/skills/manifest-store.d.ts +42 -0
  504. package/dist/skills/manifest-store.d.ts.map +1 -0
  505. package/dist/skills/registry/github-direct-adapter.d.ts +17 -0
  506. package/dist/skills/registry/github-direct-adapter.d.ts.map +1 -0
  507. package/dist/skills/registry/registry-adapter.d.ts +84 -0
  508. package/dist/skills/registry/registry-adapter.d.ts.map +1 -0
  509. package/dist/skills/registry/skills-sh-adapter.d.ts +13 -0
  510. package/dist/skills/registry/skills-sh-adapter.d.ts.map +1 -0
  511. package/dist/skills/skill-generator.d.ts +82 -0
  512. package/dist/skills/skill-generator.d.ts.map +1 -0
  513. package/dist/skills/skill-installer.d.ts +124 -0
  514. package/dist/skills/skill-installer.d.ts.map +1 -0
  515. package/dist/storage/annotations-store.d.ts +118 -0
  516. package/dist/storage/annotations-store.d.ts.map +1 -0
  517. package/dist/storage/attachment-store.d.ts +31 -0
  518. package/dist/storage/attachment-store.d.ts.map +1 -0
  519. package/dist/storage/cloud-sync.d.ts +44 -0
  520. package/dist/storage/cloud-sync.d.ts.map +1 -0
  521. package/dist/storage/completed-work-checkpoint.d.ts +11 -0
  522. package/dist/storage/completed-work-checkpoint.d.ts.map +1 -0
  523. package/dist/storage/config-loader.d.ts +114 -0
  524. package/dist/storage/config-loader.d.ts.map +1 -0
  525. package/dist/storage/config-migration.d.ts +87 -0
  526. package/dist/storage/config-migration.d.ts.map +1 -0
  527. package/dist/storage/config-store.d.ts +22 -0
  528. package/dist/storage/config-store.d.ts.map +1 -0
  529. package/dist/{director-state-CMS_bMs4.d.ts → storage/director-state.d.ts} +28 -8
  530. package/dist/storage/director-state.d.ts.map +1 -0
  531. package/dist/storage/file-session-writer.d.ts +169 -0
  532. package/dist/storage/file-session-writer.d.ts.map +1 -0
  533. package/dist/{goal-store-Datpp-ar.d.ts → storage/goal-store.d.ts} +26 -19
  534. package/dist/storage/goal-store.d.ts.map +1 -0
  535. package/dist/storage/index.d.ts +39 -1031
  536. package/dist/storage/index.d.ts.map +1 -0
  537. package/dist/storage/index.js +783 -443
  538. package/dist/storage/index.js.map +7 -1
  539. package/dist/storage/input-history-store.d.ts +56 -0
  540. package/dist/storage/input-history-store.d.ts.map +1 -0
  541. package/dist/storage/memory-backend.d.ts +66 -0
  542. package/dist/storage/memory-backend.d.ts.map +1 -0
  543. package/dist/storage/memory-consolidator.d.ts +50 -0
  544. package/dist/storage/memory-consolidator.d.ts.map +1 -0
  545. package/dist/storage/memory-graph-backend.d.ts +117 -0
  546. package/dist/storage/memory-graph-backend.d.ts.map +1 -0
  547. package/dist/storage/memory-store.d.ts +119 -0
  548. package/dist/storage/memory-store.d.ts.map +1 -0
  549. package/dist/storage/plan-store.d.ts +78 -0
  550. package/dist/storage/plan-store.d.ts.map +1 -0
  551. package/dist/storage/plan-templates.d.ts +21 -0
  552. package/dist/storage/plan-templates.d.ts.map +1 -0
  553. package/dist/storage/prompt-store.d.ts +37 -0
  554. package/dist/storage/prompt-store.d.ts.map +1 -0
  555. package/dist/storage/prompt-usage-store.d.ts +29 -0
  556. package/dist/storage/prompt-usage-store.d.ts.map +1 -0
  557. package/dist/storage/provider-config-watcher.d.ts +34 -0
  558. package/dist/storage/provider-config-watcher.d.ts.map +1 -0
  559. package/dist/storage/queue-store.d.ts +41 -0
  560. package/dist/storage/queue-store.d.ts.map +1 -0
  561. package/dist/storage/recovery-lock.d.ts +79 -0
  562. package/dist/storage/recovery-lock.d.ts.map +1 -0
  563. package/dist/storage/replay-log-store.d.ts +97 -0
  564. package/dist/storage/replay-log-store.d.ts.map +1 -0
  565. package/dist/storage/session-analyzer.d.ts +48 -0
  566. package/dist/storage/session-analyzer.d.ts.map +1 -0
  567. package/dist/storage/session-checkpoint-cas.d.ts +37 -0
  568. package/dist/storage/session-checkpoint-cas.d.ts.map +1 -0
  569. package/dist/{session-event-bridge-D_z_mBwk.d.ts → storage/session-event-bridge.d.ts} +14 -15
  570. package/dist/storage/session-event-bridge.d.ts.map +1 -0
  571. package/dist/storage/session-helpers.d.ts +9 -0
  572. package/dist/storage/session-helpers.d.ts.map +1 -0
  573. package/dist/storage/session-id.d.ts +18 -0
  574. package/dist/storage/session-id.d.ts.map +1 -0
  575. package/dist/storage/session-reader.d.ts +21 -0
  576. package/dist/storage/session-reader.d.ts.map +1 -0
  577. package/dist/storage/session-recovery.d.ts +93 -0
  578. package/dist/storage/session-recovery.d.ts.map +1 -0
  579. package/dist/storage/session-resume-validation.d.ts +6 -0
  580. package/dist/storage/session-resume-validation.d.ts.map +1 -0
  581. package/dist/storage/session-rewinder.d.ts +21 -0
  582. package/dist/storage/session-rewinder.d.ts.map +1 -0
  583. package/dist/storage/session-store.d.ts +219 -0
  584. package/dist/storage/session-store.d.ts.map +1 -0
  585. package/dist/storage/session-summary.d.ts +12 -0
  586. package/dist/storage/session-summary.d.ts.map +1 -0
  587. package/dist/storage/session-tool-call-ends.d.ts +5 -0
  588. package/dist/storage/session-tool-call-ends.d.ts.map +1 -0
  589. package/dist/storage/storage-concurrency.d.ts +2 -0
  590. package/dist/storage/storage-concurrency.d.ts.map +1 -0
  591. package/dist/storage/task-store.d.ts +33 -0
  592. package/dist/storage/task-store.d.ts.map +1 -0
  593. package/dist/storage/todos-checkpoint.d.ts +39 -0
  594. package/dist/storage/todos-checkpoint.d.ts.map +1 -0
  595. package/dist/storage/tool-audit-log.d.ts +141 -0
  596. package/dist/storage/tool-audit-log.d.ts.map +1 -0
  597. package/dist/tasking/index.d.ts +3 -124
  598. package/dist/tasking/index.d.ts.map +1 -0
  599. package/dist/tasking/index.js +57 -4
  600. package/dist/tasking/index.js.map +7 -1
  601. package/dist/tasking/task-store.d.ts +22 -0
  602. package/dist/tasking/task-store.d.ts.map +1 -0
  603. package/dist/tasking/task-tracker.d.ts +102 -0
  604. package/dist/tasking/task-tracker.d.ts.map +1 -0
  605. package/dist/tools/index.d.ts +2 -59
  606. package/dist/tools/index.d.ts.map +1 -0
  607. package/dist/tools/index.js +93 -14
  608. package/dist/tools/index.js.map +7 -1
  609. package/dist/tools/mcp-control.d.ts +53 -0
  610. package/dist/tools/mcp-control.d.ts.map +1 -0
  611. package/dist/tools/mcp-use.d.ts +24 -0
  612. package/dist/tools/mcp-use.d.ts.map +1 -0
  613. package/dist/types/agent-bridge.d.ts +42 -0
  614. package/dist/types/agent-bridge.d.ts.map +1 -0
  615. package/dist/types/attachment.d.ts +54 -0
  616. package/dist/types/attachment.d.ts.map +1 -0
  617. package/dist/types/autonomy.d.ts +5 -0
  618. package/dist/types/autonomy.d.ts.map +1 -0
  619. package/dist/types/blocks.d.ts +76 -0
  620. package/dist/types/blocks.d.ts.map +1 -0
  621. package/dist/{compactor-DQLL4HTo.d.ts → types/compactor.d.ts} +5 -7
  622. package/dist/types/compactor.d.ts.map +1 -0
  623. package/dist/{config-MRqn1V-u.d.ts → types/config.d.ts} +344 -355
  624. package/dist/types/config.d.ts.map +1 -0
  625. package/dist/types/context-evidence.d.ts +68 -0
  626. package/dist/types/context-evidence.d.ts.map +1 -0
  627. package/dist/types/context-window.d.ts +35 -0
  628. package/dist/types/context-window.d.ts.map +1 -0
  629. package/dist/{default-config-B79_gJYv.d.ts → types/default-config.d.ts} +10 -11
  630. package/dist/types/default-config.d.ts.map +1 -0
  631. package/dist/types/design-kit.d.ts +91 -0
  632. package/dist/types/design-kit.d.ts.map +1 -0
  633. package/dist/{retry-policy-CQ7KwXJa.d.ts → types/error-handler.d.ts} +5 -12
  634. package/dist/types/error-handler.d.ts.map +1 -0
  635. package/dist/types/errors.d.ts +277 -0
  636. package/dist/types/errors.d.ts.map +1 -0
  637. package/dist/types/hooks.d.ts +167 -0
  638. package/dist/types/hooks.d.ts.map +1 -0
  639. package/dist/types/index.d.ts +40 -244
  640. package/dist/types/index.d.ts.map +1 -0
  641. package/dist/types/index.js +101 -12
  642. package/dist/types/index.js.map +7 -1
  643. package/dist/{input-reader-E-ffP2ee.d.ts → types/input-reader.d.ts} +3 -4
  644. package/dist/types/input-reader.d.ts.map +1 -0
  645. package/dist/{logger-B63L5bTg.d.ts → types/logger.d.ts} +3 -4
  646. package/dist/types/logger.d.ts.map +1 -0
  647. package/dist/types/memory.d.ts +89 -0
  648. package/dist/types/memory.d.ts.map +1 -0
  649. package/dist/types/messages.d.ts +24 -0
  650. package/dist/types/messages.d.ts.map +1 -0
  651. package/dist/types/mode-prompts.d.ts +2 -0
  652. package/dist/types/mode-prompts.d.ts.map +1 -0
  653. package/dist/{mode-CZlO9iU1.d.ts → types/mode.d.ts} +6 -7
  654. package/dist/types/mode.d.ts.map +1 -0
  655. package/dist/types/models-registry.d.ts +105 -0
  656. package/dist/types/models-registry.d.ts.map +1 -0
  657. package/dist/types/multi-agent.d.ts +443 -0
  658. package/dist/types/multi-agent.d.ts.map +1 -0
  659. package/dist/{observability-D-HZN_mF.d.ts → types/observability.d.ts} +17 -13
  660. package/dist/types/observability.d.ts.map +1 -0
  661. package/dist/{path-resolver-CPRj4bFY.d.ts → types/path-resolver.d.ts} +2 -3
  662. package/dist/types/path-resolver.d.ts.map +1 -0
  663. package/dist/{permission-ByDKXEcG.d.ts → types/permission.d.ts} +8 -9
  664. package/dist/types/permission.d.ts.map +1 -0
  665. package/dist/types/plugin.d.ts +385 -0
  666. package/dist/types/plugin.d.ts.map +1 -0
  667. package/dist/types/prompt-registry.d.ts +81 -0
  668. package/dist/types/prompt-registry.d.ts.map +1 -0
  669. package/dist/{prompt-DLd35n4Q.d.ts → types/prompt.d.ts} +14 -15
  670. package/dist/types/prompt.d.ts.map +1 -0
  671. package/dist/{provider-runner-ChL-kVg6.d.ts → types/provider-runner.d.ts} +9 -10
  672. package/dist/types/provider-runner.d.ts.map +1 -0
  673. package/dist/types/provider.d.ts +387 -0
  674. package/dist/types/provider.d.ts.map +1 -0
  675. package/dist/types/renderer.d.ts +23 -0
  676. package/dist/types/renderer.d.ts.map +1 -0
  677. package/dist/types/retry-policy.d.ts +7 -0
  678. package/dist/types/retry-policy.d.ts.map +1 -0
  679. package/dist/types/secret-scrubber.d.ts +5 -0
  680. package/dist/types/secret-scrubber.d.ts.map +1 -0
  681. package/dist/{secret-vault-BAKpgFw_.d.ts → types/secret-vault.d.ts} +13 -7
  682. package/dist/types/secret-vault.d.ts.map +1 -0
  683. package/dist/{selector-D8O6B_Rm.d.ts → types/selector.d.ts} +4 -6
  684. package/dist/types/selector.d.ts.map +1 -0
  685. package/dist/types/session-reader.d.ts +81 -0
  686. package/dist/types/session-reader.d.ts.map +1 -0
  687. package/dist/{session-rewinder-C9HnMkhP.d.ts → types/session-rewinder.d.ts} +5 -6
  688. package/dist/types/session-rewinder.d.ts.map +1 -0
  689. package/dist/types/session.d.ts +650 -0
  690. package/dist/types/session.d.ts.map +1 -0
  691. package/dist/types/side-effect.d.ts +34 -0
  692. package/dist/types/side-effect.d.ts.map +1 -0
  693. package/dist/{skill-DHniprNl.d.ts → types/skill.d.ts} +4 -5
  694. package/dist/types/skill.d.ts.map +1 -0
  695. package/dist/types/slash-command.d.ts +59 -0
  696. package/dist/types/slash-command.d.ts.map +1 -0
  697. package/dist/types/spec.d.ts +77 -0
  698. package/dist/types/spec.d.ts.map +1 -0
  699. package/dist/types/system-prompt-contributor.d.ts +20 -0
  700. package/dist/types/system-prompt-contributor.d.ts.map +1 -0
  701. package/dist/types/system-prompt.d.ts +51 -0
  702. package/dist/types/system-prompt.d.ts.map +1 -0
  703. package/dist/{task-graph-CH3acNQ7.d.ts → types/task-graph.d.ts} +21 -22
  704. package/dist/types/task-graph.d.ts.map +1 -0
  705. package/dist/types/token-counter.d.ts +42 -0
  706. package/dist/types/token-counter.d.ts.map +1 -0
  707. package/dist/types/tool-executor.d.ts +133 -0
  708. package/dist/types/tool-executor.d.ts.map +1 -0
  709. package/dist/types/tool-markers.d.ts +23 -0
  710. package/dist/types/tool-markers.d.ts.map +1 -0
  711. package/dist/types/tool.d.ts +252 -0
  712. package/dist/types/tool.d.ts.map +1 -0
  713. package/dist/types/utility-types.d.ts +31 -0
  714. package/dist/types/utility-types.d.ts.map +1 -0
  715. package/dist/utils/assert-never.d.ts +14 -0
  716. package/dist/utils/assert-never.d.ts.map +1 -0
  717. package/dist/utils/atomic-write.d.ts +12 -0
  718. package/dist/utils/atomic-write.d.ts.map +1 -0
  719. package/dist/utils/child-env.d.ts +67 -0
  720. package/dist/utils/child-env.d.ts.map +1 -0
  721. package/dist/utils/color.d.ts +20 -0
  722. package/dist/utils/color.d.ts.map +1 -0
  723. package/dist/utils/config-json.d.ts +14 -0
  724. package/dist/utils/config-json.d.ts.map +1 -0
  725. package/dist/utils/context-evidence.d.ts +47 -0
  726. package/dist/utils/context-evidence.d.ts.map +1 -0
  727. package/dist/utils/deep-merge.d.ts +64 -0
  728. package/dist/utils/deep-merge.d.ts.map +1 -0
  729. package/dist/utils/diff.d.ts +11 -0
  730. package/dist/utils/diff.d.ts.map +1 -0
  731. package/dist/utils/error.d.ts +2 -3
  732. package/dist/utils/error.d.ts.map +1 -0
  733. package/dist/utils/error.js +3 -3
  734. package/dist/utils/error.js.map +7 -1
  735. package/dist/utils/expect-defined.d.ts +2 -3
  736. package/dist/utils/expect-defined.d.ts.map +1 -0
  737. package/dist/utils/expect-defined.js +3 -3
  738. package/dist/utils/expect-defined.js.map +7 -1
  739. package/dist/utils/glob-expand.d.ts +10 -0
  740. package/dist/utils/glob-expand.d.ts.map +1 -0
  741. package/dist/utils/glob-match.d.ts +4 -0
  742. package/dist/utils/glob-match.d.ts.map +1 -0
  743. package/dist/utils/incoming-images.d.ts +39 -0
  744. package/dist/utils/incoming-images.d.ts.map +1 -0
  745. package/dist/utils/index.d.ts +38 -920
  746. package/dist/utils/index.d.ts.map +1 -0
  747. package/dist/utils/index.js +323 -36
  748. package/dist/utils/index.js.map +7 -1
  749. package/dist/utils/instruction-file.d.ts +3 -0
  750. package/dist/utils/instruction-file.d.ts.map +1 -0
  751. package/dist/utils/ip-guard.d.ts +34 -0
  752. package/dist/utils/ip-guard.d.ts.map +1 -0
  753. package/dist/utils/json-repair.d.ts +23 -0
  754. package/dist/utils/json-repair.d.ts.map +1 -0
  755. package/dist/utils/json-schema-validate.d.ts +42 -0
  756. package/dist/utils/json-schema-validate.d.ts.map +1 -0
  757. package/dist/utils/lru-cache.d.ts +29 -0
  758. package/dist/utils/lru-cache.d.ts.map +1 -0
  759. package/dist/utils/merge-custom-models.d.ts +12 -0
  760. package/dist/utils/merge-custom-models.d.ts.map +1 -0
  761. package/dist/utils/merge-models-payload.d.ts +20 -0
  762. package/dist/utils/merge-models-payload.d.ts.map +1 -0
  763. package/dist/utils/message-invariants.d.ts +22 -0
  764. package/dist/utils/message-invariants.d.ts.map +1 -0
  765. package/dist/utils/newline-normalize.d.ts +5 -0
  766. package/dist/utils/newline-normalize.d.ts.map +1 -0
  767. package/dist/utils/regex-guard.d.ts +21 -0
  768. package/dist/utils/regex-guard.d.ts.map +1 -0
  769. package/dist/utils/safe-json.d.ts +31 -0
  770. package/dist/utils/safe-json.d.ts.map +1 -0
  771. package/dist/utils/session-scoped-path.d.ts +13 -0
  772. package/dist/utils/session-scoped-path.d.ts.map +1 -0
  773. package/dist/utils/sleep.d.ts +5 -0
  774. package/dist/utils/sleep.d.ts.map +1 -0
  775. package/dist/utils/slug.d.ts +13 -0
  776. package/dist/utils/slug.d.ts.map +1 -0
  777. package/dist/utils/string.d.ts +9 -0
  778. package/dist/utils/string.d.ts.map +1 -0
  779. package/dist/utils/task-format.d.ts +22 -0
  780. package/dist/utils/task-format.d.ts.map +1 -0
  781. package/dist/utils/term.d.ts +133 -0
  782. package/dist/utils/term.d.ts.map +1 -0
  783. package/dist/utils/todos-format.d.ts +30 -0
  784. package/dist/utils/todos-format.d.ts.map +1 -0
  785. package/dist/utils/token-estimate.d.ts +112 -0
  786. package/dist/utils/token-estimate.d.ts.map +1 -0
  787. package/dist/utils/tool-description-mode.d.ts +28 -0
  788. package/dist/utils/tool-description-mode.d.ts.map +1 -0
  789. package/dist/utils/tool-output-serializer.d.ts +40 -0
  790. package/dist/utils/tool-output-serializer.d.ts.map +1 -0
  791. package/dist/utils/tool-result-render-mode.d.ts +55 -0
  792. package/dist/utils/tool-result-render-mode.d.ts.map +1 -0
  793. package/dist/utils/tool-subject.d.ts +5 -0
  794. package/dist/utils/tool-subject.d.ts.map +1 -0
  795. package/dist/utils/tool-wire-compact.d.ts +28 -0
  796. package/dist/utils/tool-wire-compact.d.ts.map +1 -0
  797. package/dist/utils/ulid.d.ts +11 -0
  798. package/dist/utils/ulid.d.ts.map +1 -0
  799. package/dist/{wstack-paths-C3K40Qst.d.ts → utils/wstack-paths.d.ts} +7 -8
  800. package/dist/utils/wstack-paths.d.ts.map +1 -0
  801. package/dist/worktree/index.d.ts +2 -0
  802. package/dist/worktree/index.d.ts.map +1 -0
  803. package/dist/{worktree-manager-DzwxKE35.d.ts → worktree/worktree-manager.d.ts} +32 -17
  804. package/dist/worktree/worktree-manager.d.ts.map +1 -0
  805. package/instructions/agents/browser.md +25 -16
  806. package/instructions/autonomy/active-mission.md +2 -4
  807. package/instructions/coordination/subagent-baseline.md +16 -2
  808. package/instructions/leader-after-task.md +3 -1
  809. package/instructions/sections/tool/common-patterns.md +7 -1
  810. package/instructions/sections/tool/delegation-full.md +1 -1
  811. package/instructions/system.md +47 -0
  812. package/package.json +4 -5
  813. package/skills/docker-deploy/SKILL.md +1 -1
  814. package/skills/node-modern/SKILL.md +2 -2
  815. package/skills/plugin-author/SKILL.md +9 -16
  816. package/skills/wrongstack-mailbox/SKILL.md +51 -12
  817. package/dist/dispatcher-types.d-BBeXBQgS.d.ts +0 -66
  818. package/dist/global-mailbox-sZwyI6CS.d.ts +0 -959
  819. package/dist/index--Gm41aBJ.d.ts +0 -671
  820. package/dist/mcp-servers-DEV4s6Ks.d.ts +0 -259
  821. package/dist/multi-agent-coordinator-4RCRZKjN.d.ts +0 -1770
  822. package/dist/null-fleet-bus-CFoNVQEK.d.ts +0 -2127
  823. package/dist/pipeline-DGDyIohT.d.ts +0 -331
  824. package/dist/provider-model-resolve-o2hHLs79.d.ts +0 -263
  825. package/dist/secret-scrubber-3MHDDAtm.d.ts +0 -6
  826. package/dist/secret-vault-DxohkUBc.d.ts +0 -272
  827. package/dist/session-reader-7Esxrkpw.d.ts +0 -155
  828. package/dist/task-format-GX0B1mMC.d.ts +0 -23
  829. package/dist/todos-checkpoint-FY7PjmMx.d.ts +0 -850
  830. package/dist/tool-BNlnIJvo.d.ts +0 -2190
  831. package/dist/tool-executor-CckSCM5E.d.ts +0 -906
@@ -1,921 +1,39 @@
1
- import { M as Message, H as CompletedWorkSource, d as Context, s as TextBlock, K as ContextEvidenceState, G as CompletedWorkEvidence, o as ToolOutputMetadata, J as JSONSchema, A as TodoItem, g as Tool } from '../tool-BNlnIJvo.js';
2
- export { H as HttpDispatcher, a as HttpsAgentAsDispatcher } from '../dispatcher-types.d-BBeXBQgS.js';
1
+ export * from './assert-never.js';
2
+ export * from './atomic-write.js';
3
+ export * from './child-env.js';
4
+ export * from './color.js';
5
+ export * from './config-json.js';
6
+ export { buildContextEvidenceDigest, COMPLETED_WORK_LEDGER_MARKER, createContextEvidenceState, formatCompletedWorkLedger, markAssistantReferencedEvidence, type RecordCompletedWorkInput, type RecordToolOutputEvidenceInput, recordCompletedWorkEvidence, buildCompletedWorkLedgerBlock, recordToolOutputEvidence, recordUserIntentEvidence, repeatedReadPressure, syncCompletedWorkLedgerBlock, } from './context-evidence.js';
7
+ export { type DeepMergeOptions, deepMerge, FORBIDDEN_PROTO_KEYS, isPrimitiveArray, } from './deep-merge.js';
8
+ export * from './diff.js';
9
+ export type { HttpDispatcher, HttpsAgentAsDispatcher } from './dispatcher-types.js';
3
10
  export { toErrorMessage } from './error.js';
4
- export { expectDefined } from './expect-defined.js';
5
- import { E as CustomModelDefinition, c as ModelsDevPayload, ac as ToolDescriptionMode, ad as ToolDescriptionModeConfig, T as ToolResultRenderMode, ae as ToolResultRenderModeConfig } from '../config-MRqn1V-u.js';
6
- export { T as TaskItem, c as computeTaskItemProgress, f as formatTaskList, a as formatTaskProgress } from '../task-format-GX0B1mMC.js';
7
- export { a as WstackPathOptions, W as WstackPaths, p as projectHash, b as projectSlug, r as resolveWstackPaths, w as wstackGlobalRoot } from '../wstack-paths-C3K40Qst.js';
8
- export { a as TaskPriority, b as TaskStatus, T as TaskType } from '../task-graph-CH3acNQ7.js';
9
- import 'node:https';
10
- import 'undici';
11
-
12
- /**
13
- * Estimate tokens for a tool_use block input.
14
- * Caches the stringified result keyed by the stable string representation
15
- * to avoid repeated JSON.stringify calls during context window checks.
16
- */
17
- declare function estimateToolInputTokens(input: unknown): number;
18
- /**
19
- * Estimate tokens for a tool_result content.
20
- */
21
- declare function estimateToolResultTokens(content: string | unknown): number;
22
- /**
23
- * Estimate tokens for a text block.
24
- */
25
- declare function estimateTextTokens(text: string): number;
26
- /**
27
- * Compute and cache the token estimate for a single message. This is the
28
- * canonical per-message estimator called once by ConversationState on
29
- * append/replace so the O(n·m) content-block walk happens at mutation time,
30
- * not on every context-pressure check.
31
- */
32
- declare function computeMessageTokens(msg: Message): number;
33
- /**
34
- * Estimate tokens for an array of messages (text + tool I/O), using the shared
35
- * 3.5 chars/token basis. This is the single canonical message-array estimator —
36
- * compactors, the context_manager tool, and the `/context` display all route
37
- * through it so the number a user sees matches the number compaction decides on.
38
- *
39
- * When a message carries a pre-computed `_estTokens` field (set by
40
- * ConversationState on append/replace), it is used directly instead of
41
- * re-walking the content blocks — turning the O(n·m) scan into an O(n)
42
- * sum for fully-cached arrays.
43
- */
44
- declare function estimateMessageTokens(messages: readonly Message[]): number;
45
- /**
46
- * Rough estimate of tokens in a tool definition (name + description + schema).
47
- * Accounts for the JSON-serialized inputSchema which is sent to the API
48
- * but NOT included in roughEstimate(content).
49
- */
50
- declare function estimateToolDefTokens(tool: {
51
- name: string;
52
- description?: string | undefined;
53
- inputSchema: unknown;
54
- }): number;
55
- /**
56
- * Estimate the total API request token count: system prompt + tool definitions
57
- * + conversation messages. Use this for context-window bar calculations
58
- * instead of roughEstimate (which only counts messages).
59
- *
60
- * The overhead ratio (overhead / messages) varies by conversation length:
61
- * - Short conversations (< 10 messages): ~30-50% overhead (large system+tools)
62
- * - Medium (10-50 messages): ~15-30%
63
- * - Long (> 50 messages): ~5-15%
64
- *
65
- * Returns { messages, systemPrompt, tools, total } for debugging display.
66
- */
67
- interface RequestTokenBreakdown {
68
- messages: number;
69
- systemPrompt: number;
70
- tools: number;
71
- total: number;
72
- }
73
- declare function estimateRequestTokens(messages: unknown, systemPrompt: unknown, tools: {
74
- name: string;
75
- description?: string | undefined;
76
- inputSchema: unknown;
77
- }[], calibrationKey?: string): RequestTokenBreakdown;
78
- /**
79
- * Record the actual API input token count after a provider call so
80
- * `estimateRequestTokensCalibrated` can self-correct on subsequent calls.
81
- *
82
- * Prefer passing `estimatedInputTokens` explicitly (the calibrated pre-flight
83
- * estimate from the middleware) — this avoids race conditions when other code
84
- * also calls `estimateRequestTokens` between the pre-flight and this call
85
- * (e.g. audit logging in agent.ts).
86
- *
87
- * When `estimatedInputTokens` is omitted, falls back to the keyed bucket's
88
- * `prevEst` for backward compatibility with callers that don't have the
89
- * pre-flight value. `calibrationKey` selects the per-(provider,model) bucket
90
- * (defaults to the shared global bucket).
91
- */
92
- declare function recordActualUsage(actualInputTokens: number, estimatedInputTokens?: number, calibrationKey?: string): void;
93
- /**
94
- * Returns the current calibration state for a bucket. Exposed for debugging
95
- * and tests — not needed by normal callers.
96
- */
97
- declare function getCalibrationState(calibrationKey?: string): {
98
- ratio: number;
99
- count: number;
100
- calibrated: boolean;
101
- };
102
- /**
103
- * Like `estimateRequestTokens` but applies the rolling calibration factor
104
- * so context pressure readings converge on reality within a few iterations.
105
- *
106
- * Before any `recordActualUsage` samples are collected, returns the same
107
- * result as `estimateRequestTokens` (ratio = 1.0, no distortion).
108
- * After `MIN_SAMPLES_FOR_CALIBRATION` samples, applies the calibrated
109
- * multiplier capped to the range [0.5, 1.5] as a sanity bound.
110
- */
111
- declare function estimateRequestTokensCalibrated(messages: unknown, systemPrompt: unknown, tools: {
112
- name: string;
113
- description?: string | undefined;
114
- inputSchema: unknown;
115
- }[], calibrationKey?: string): RequestTokenBreakdown;
116
- /**
117
- * Resets calibration state. Primarily for tests that run in the same
118
- * process and need a clean slate between suites. With no argument it clears
119
- * every bucket (including the global one); pass a key to reset just that bucket.
120
- */
121
- declare function resetCalibration(calibrationKey?: string): void;
122
-
123
- /**
124
- * Exhaustiveness check for discriminated union switches.
125
- * Place in the `default` branch of a switch over a union type
126
- * to get a compile-time error when a new variant is added.
127
- *
128
- * @example
129
- * switch (block.type) {
130
- * case 'text': return renderText(block);
131
- * case 'tool_use': return renderToolUse(block);
132
- * default: return assertNever(block);
133
- * }
134
- */
135
- declare function assertNever(x: never, message?: string): never;
136
-
137
- interface AtomicWriteOptions {
138
- mode?: number | undefined;
139
- encoding?: BufferEncoding | undefined;
140
- }
141
- interface FileLockOptions {
142
- timeoutMs?: number | undefined;
143
- staleMs?: number | undefined;
144
- }
145
- declare function atomicWrite(targetPath: string, content: string | Uint8Array, opts?: AtomicWriteOptions): Promise<void>;
146
- declare function ensureDir(dir: string): Promise<void>;
147
- declare function withFileLock<T>(targetPath: string, fn: () => Promise<T>, opts?: FileLockOptions): Promise<T>;
148
-
149
- /**
150
- * Build a sanitized child-process environment.
151
- *
152
- * The bash/exec tools and MCP stdio transports execute LLM-generated or
153
- * configured commands. The parent process carries provider API keys
154
- * (ANTHROPIC_API_KEY, OPENAI_API_KEY, ...), VCS tokens (GITHUB_TOKEN),
155
- * and cloud credentials. Forwarding those to a child is an exfiltration
156
- * vector even with `permission: 'confirm'` — a compromised MCP server
157
- * or a cleverly composed shell pipeline can leak secrets.
158
- *
159
- * Strategy: copy a small, explicit allowlist of variables that real builds
160
- * need, then copy anything else that does NOT look secret-bearing. This
161
- * preserves user-friendly behavior (locale, terminal, npm config) while
162
- * blocking the obvious leak channels. Two value-side guards back up the
163
- * name-based filter:
164
- * - any value carrying an embedded URI credential (`scheme://user:pass@host`,
165
- * e.g. `DATABASE_URL`/`REDIS_URL`/`*_DSN`) is dropped (WS-01);
166
- * - `NODE_OPTIONS` is forwarded but with module-preload directives
167
- * (`--require`/`--import`/`--loader`) stripped so a parent-set value can't
168
- * inject code into node children (WS-02).
169
- *
170
- * Override with `WRONGSTACK_CHILD_ENV_PASSTHROUGH=1` to forward the full
171
- * parent environment unchanged (opt-in for advanced users who understand
172
- * the risk).
173
- */
174
- /**
175
- * Strip module-preload directives from a `NODE_OPTIONS` value while preserving
176
- * benign flags (`--no-warnings`, `--max-old-space-size=…`, etc.). Handles both
177
- * the `--require=./x.js` and space-separated `--require ./x.js` forms. Returns
178
- * the sanitized string (possibly empty).
179
- */
180
- declare function sanitizeNodeOptions(value: string): string;
181
- interface BuildChildEnvOptions {
182
- /** Session ID to inject as WRONGSTACK_SESSION_ID. */
183
- sessionId?: string | undefined;
184
- /** Additional env vars to merge (takes priority over filtered parent env). */
185
- extra?: NodeJS.ProcessEnv | undefined;
186
- }
187
- /**
188
- * Build a filtered child-process environment suitable for bash, exec, and
189
- * MCP server subprocesses. Strips API keys, tokens, and other credentials
190
- * while preserving system/tooling variables.
191
- */
192
- declare function buildChildEnv(optsOrSessionId?: BuildChildEnvOptions | string): NodeJS.ProcessEnv;
193
-
194
- declare const color: {
195
- reset: (s: string) => string;
196
- bold: (s: string) => string;
197
- dim: (s: string) => string;
198
- italic: (s: string) => string;
199
- underline: (s: string) => string;
200
- red: (s: string) => string;
201
- green: (s: string) => string;
202
- yellow: (s: string) => string;
203
- blue: (s: string) => string;
204
- magenta: (s: string) => string;
205
- cyan: (s: string) => string;
206
- gray: (s: string) => string;
207
- amber: (s: string) => string;
208
- pink: (s: string) => string;
209
- bgRed: (s: string) => string;
210
- bgGreen: (s: string) => string;
211
- };
212
- declare function stripAnsi(s: string): string;
213
-
214
- type JsonObject = Record<string, unknown>;
215
- type JsonPathSegment = string | number;
216
- type JsonPath = readonly JsonPathSegment[];
217
- declare function readJsonObjectFile(filePath: string): Promise<JsonObject>;
218
- declare function jsonObjectFileExists(filePath: string): Promise<boolean>;
219
- declare function writeJsonObjectFile(filePath: string, value: JsonObject): Promise<void>;
220
- declare function updateJsonObjectFile(filePath: string, mutator: (config: JsonObject) => void | JsonObject | Promise<void | JsonObject>): Promise<JsonObject>;
221
- declare function getJsonPath(root: unknown, path: JsonPath): unknown;
222
- declare function setJsonPath(root: JsonObject, path: JsonPath, value: unknown): JsonObject;
223
- declare function removeJsonPath(root: JsonObject, path: JsonPath): boolean;
224
- declare function setJsonPathInFile(filePath: string, path: JsonPath, value: unknown): Promise<JsonObject>;
225
- declare function removeJsonPathInFile(filePath: string, path: JsonPath): Promise<JsonObject>;
226
- declare function isJsonObject(value: unknown): value is JsonObject;
227
-
228
- declare function createContextEvidenceState(): ContextEvidenceState;
229
- interface RecordToolOutputEvidenceInput {
230
- toolUseId: string;
231
- toolName: string;
232
- input: unknown;
233
- content: string;
234
- ok: boolean;
235
- outputBytes?: number | undefined;
236
- outputTokens?: number | undefined;
237
- outputLines?: number | undefined;
238
- }
239
- declare function recordUserIntentEvidence(ctx: Context, text: string): void;
240
- declare function recordToolOutputEvidence(ctx: Context, input: RecordToolOutputEvidenceInput): ToolOutputMetadata;
241
- declare function markAssistantReferencedEvidence(ctx: Context, text: string): void;
242
- declare function buildContextEvidenceDigest(ctx: Context): string;
243
- declare function repeatedReadPressure(ctx: Context): number;
244
- /** Marker prefixing the ledger's system-prompt block (also used to find/replace it). */
245
- declare const COMPLETED_WORK_LEDGER_MARKER = "[completed_work_ledger]";
246
- interface RecordCompletedWorkInput {
247
- /** Stable dedupe key, e.g. `task:<id>` — re-completion updates in place. */
248
- key: string;
249
- source: CompletedWorkSource;
250
- summary: string;
251
- /** Optional pointer to proof (test run, commit hash, file path). */
252
- evidence?: string | undefined;
253
- /** Epoch ms; defaults to now. */
254
- completedAt?: number | undefined;
255
- }
256
- /**
257
- * Append one finished unit of work to the session ledger. The provider request
258
- * composer renders this state as a volatile tail block; the stable system-prompt
259
- * prefix is never mutated here.
260
- */
261
- declare function recordCompletedWorkEvidence(ctx: Context, input: RecordCompletedWorkInput): CompletedWorkEvidence;
262
- /** Render the ledger's system-prompt block text (marker + newest entries). */
263
- declare function formatCompletedWorkLedger(items: readonly CompletedWorkEvidence[]): string;
264
- /** Build the current volatile completed-work block without mutating the prompt. */
265
- declare function buildCompletedWorkLedgerBlock(ctx: Context): TextBlock | undefined;
266
- /**
267
- * @deprecated Volatile state must be composed at request time. Kept as a
268
- * compatibility no-op for embedders importing the old helper.
269
- */
270
- declare function syncCompletedWorkLedgerBlock(_ctx: Context): void;
271
-
272
- /**
273
- * Deep merge utility — safely merges nested objects with configurable
274
- * conflict resolution, array merging, and prototype-pollution guarding.
275
- *
276
- * Used by:
277
- * - config-loader (config layer merging with primitive-array concatenation)
278
- * - secret-vault (config patching)
279
- * - json-path (json_merge tool with prefer-base / prefer-patch semantics)
280
- *
281
- * @module utils/deep-merge
282
- */
283
- declare const FORBIDDEN_PROTO_KEYS: Set<string>;
284
- /** True when every element is a primitive or null (no nested objects/arrays). */
285
- declare function isPrimitiveArray(a: unknown[]): boolean;
286
- interface DeepMergeOptions {
287
- /**
288
- * Which side wins on collision for scalars and arrays.
289
- *
290
- * - `'prefer-patch'` (default): patch value replaces base value.
291
- * - `'prefer-base'`: base value is kept, patch value is ignored.
292
- */
293
- conflictResolution?: 'prefer-base' | 'prefer-patch';
294
- /**
295
- * How to handle array values.
296
- *
297
- * - `'replace'` (default): patch array replaces base array entirely.
298
- * - `'concat-primitives'`: when both values are primitive arrays,
299
- * they are concatenated and deduped (via Set). Non-primitive
300
- * arrays still replace the base wholesale.
301
- */
302
- arrayMode?: 'replace' | 'concat-primitives';
303
- /**
304
- * Skip prototype-pollution keys (`__proto__`, `constructor`, etc.).
305
- * Enabled by default. Only disable when you control both inputs
306
- * and the keyset (e.g. when merging trusted JSON schemas).
307
- */
308
- protectProto?: boolean;
309
- /**
310
- * Optional callback fired when a non-primitive (object) array is
311
- * replaced wholesale (only relevant with `arrayMode: 'concat-primitives'`).
312
- * Receives the key name, existing array length, and patch array length.
313
- * Used by config-loader for debug logging.
314
- */
315
- onNonPrimitiveArrayReplace?: (key: string, existingLen: number, patchLen: number) => void;
316
- }
317
- /**
318
- * Recursively merge `patch` into `base`, returning a new object.
319
- *
320
- * - Nested plain objects are merged recursively.
321
- * - Arrays are handled per `options.arrayMode`.
322
- * - Scalar collisions are resolved per `options.conflictResolution`.
323
- * - `null` and non-object values in `patch` replace the base value
324
- * (unless `conflictResolution` is `'prefer-base'`).
325
- * - Keys in `base` that are absent from `patch` are preserved.
326
- * - `FORBIDDEN_PROTO_KEYS` are skipped in the patch (unless
327
- * `options.protectProto` is set to `false`).
328
- *
329
- * The function is generic over `T extends Record<string, unknown>` for
330
- * callers that pass typed config objects, but the runtime signature
331
- * also accepts `unknown` inputs (used by the json-path plugin).
332
- */
333
- declare function deepMerge<T extends Record<string, unknown>>(base: T, patch: Record<string, unknown>, options?: DeepMergeOptions): T;
334
- declare function deepMerge(base: unknown, patch: unknown, options?: DeepMergeOptions): unknown;
335
-
336
- /**
337
- * Myers diff with unified-format output. No external dependencies.
338
- * Operates on arrays of lines (newline-terminated or stripped).
339
- */
340
- interface UnifiedDiffOptions {
341
- context?: number | undefined;
342
- fromFile?: string | undefined;
343
- toFile?: string | undefined;
344
- }
345
- declare function unifiedDiff(oldText: string, newText: string, opts?: UnifiedDiffOptions): string;
346
-
347
- /**
348
- * Resolve `pattern` to the set of concrete file paths it matches.
349
- * Literal paths (no glob chars) are returned as-is.
350
- *
351
- * @example
352
- * await expandGlob('src/**\/*.ts') // → ['src/a.ts', 'src/b/c.ts', ...]
353
- * await expandGlob('foo.txt') // → ['foo.txt']
354
- */
355
- declare function expandGlob(pattern: string): Promise<string[]>;
356
-
357
- declare function compileGlob(pattern: string): RegExp;
358
- declare function matchGlob(pattern: string, input: string): boolean;
359
- declare function matchAny(patterns: string[], input: string): boolean;
360
-
361
- /**
362
- * Shared IP-address guards for SSRF protection.
363
- *
364
- * Exported so `fetch.ts` (tools), `web-search/index.ts` (plugins), and any
365
- * other package that needs to validate IPs can all consume the same logic.
366
- * Any future additions (e.g. extra CIDR blocks) need only be made here.
367
- */
368
- /**
369
- * True if `addr` is in a private / loopback / link-local / reserved / CGNAT /
370
- * multicast range. `net.isIP` is called by the caller first so `addr` is
371
- * guaranteed to be a canonical dotted-quad at this point.
372
- */
373
- declare function isPrivateIPv4(addr: string): boolean;
374
- /**
375
- * True if `raw` (an IPv6 literal, already lowercased) is loopback / unique-local /
376
- * link-local / unspecified / IPv4-mapped-private.
377
- */
378
- declare function isPrivateIPv6(raw: string): boolean;
379
- /**
380
- * Expand an IPv6 string into exactly 8 16-bit numbers. Handles `::` compression.
381
- * Returns null on malformed input — caller should treat that as "block".
382
- */
383
- declare function expandIPv6(addr: string): number[] | null;
384
- /**
385
- * Convenience: throw if `hostname` resolves to a private / loopback IP.
386
- * Use as a pre-flight check before opening a socket.
387
- *
388
- * ⚠️ This is not sufficient alone — connections must also use a pinned
389
- * dispatcher (so the OS re-uses the already-resolved address) or the same
390
- * check must be applied after every redirect hop. See `guardedLookup` in
391
- * `fetch.ts` for the connection-level enforcement.
392
- */
393
- declare function assertNotPrivateHost(hostname: string): Promise<void>;
394
-
395
- /**
396
- * Attempt to close an incomplete JSON object string by auto-closing braces
397
- * and completing any unclosed double-quoted string values.
398
- *
399
- * Strategy:
400
- * 1. Compute origOpen from the ORIGINAL input (how many braces are unclosed).
401
- * 2. Add that many closing braces. If result is now valid JSON → return it.
402
- * 3. If still invalid: trim trailing whitespace, strip trailing backslash.
403
- * 4. Walk backwards to detect an unclosed string value.
404
- * - Quote followed by `:` → key-name, skip
405
- * - Quote followed by `,` `}` or end-of-string → toggle in/out of string
406
- * 5. If we end INSIDE a string (unclosed opening `"`), append `"` + origOpen `}`.
407
- *
408
- * Known limitations:
409
- * - Strings whose content ends with a `"` character cannot be repaired
410
- * (algorithm can't distinguish content-`"` from string-terminator `"`).
411
- * - Input ending in bare `:` (incomplete value expression) can't be meaningfully repaired.
412
- * - Bare `{` returns unchanged.
413
- * - If origOpen=0 (braces balanced) but string is unclosed, repair is skipped
414
- * (the input would be valid JSON per JSON.parse, so it's returned as-is).
415
- */
416
- declare function completePartialObject(s: string): string;
417
-
418
- /**
419
- * Minimal JSON Schema validator — covers the subset needed for plugin
420
- * configSchema validation and tool inputSchema sanity checks. Intentionally
421
- * small (~80 lines, zero deps) and tolerant: unknown keywords are ignored so
422
- * authors can mix in non-standard extensions without breaking validation.
423
- *
424
- * NOT for full JSON Schema 2020-12 conformance. If a plugin needs $ref,
425
- * conditional schemas, format validation, or anything else exotic, it should
426
- * bring its own ajv-based validator and call this only for the cheap path.
427
- */
428
-
429
- interface ValidationError {
430
- path: string;
431
- message: string;
432
- }
433
- interface ValidationResult {
434
- ok: boolean;
435
- errors: ValidationError[];
436
- }
437
- declare function validateAgainstSchema(value: unknown, schema: JSONSchema): ValidationResult;
438
- interface CoercionResult {
439
- value: unknown;
440
- /** True when at least one leaf was rewritten. */
441
- changed: boolean;
442
- }
443
- /**
444
- * Best-effort, lossless coercion of a value toward a JSON Schema. Models —
445
- * especially through OpenAI-compatible proxies — frequently deliver
446
- * arguments with the right *content* in the wrong *type*: numbers and
447
- * booleans encoded as strings ("5", "true"), scalars where a string is
448
- * expected, or a whole nested object serialized into a JSON string.
449
- *
450
- * Only conversions that cannot lose information are applied:
451
- * - string → number/integer when the whole trimmed string parses cleanly
452
- * - string "true"/"false" → boolean
453
- * - number/boolean → string when a string is expected
454
- * - JSON-serialized string → object/array when the parse yields that shape
455
- * Recurses into `properties`/`items`. Returns the (possibly new) value and
456
- * whether anything changed — callers should re-validate before trusting it.
457
- */
458
- declare function coerceAgainstSchema(value: unknown, schema: JSONSchema): CoercionResult;
459
-
460
- /**
461
- * Merge per-provider `customModels` into top-level `configModels`.
462
- *
463
- * Keys present in `configModels` always win over `providerCustomModels`
464
- * when the same model id appears in both places. This lets the user
465
- * override provider-attached definitions from the top-level config.
466
- *
467
- * Pure: never mutates its inputs.
468
- */
469
- declare function mergeCustomModelDefs(providerCustomModels: Record<string, CustomModelDefinition> | undefined, configModels: Record<string, CustomModelDefinition> | undefined): Record<string, CustomModelDefinition> | undefined;
470
-
471
- /**
472
- * Deep-merge a curated `overlay` payload on top of a `base` payload (both in
473
- * the models.dev `api.json` shape). The overlay always wins: it can add
474
- * providers/models the base lacks and override fields the base gets wrong.
475
- *
476
- * Precedence rules:
477
- * - Provider present in both → scalar fields (`name`, `npm`, `api`, `env`,
478
- * `doc`) come from the overlay when set; `models` maps merge by model id.
479
- * - Provider only in the overlay → added wholesale.
480
- * - Model present in both → overlay model fields override base model fields
481
- * (`{ ...base, ...overlay }`), with the nested `limit` / `cost` /
482
- * `modalities` objects merged one level deeper so an overlay can fix just
483
- * `limit.context` without restating the rest of the model.
484
- * - Model only in the overlay → added.
485
- *
486
- * Pure: never mutates its inputs.
487
- */
488
- declare function mergeModelsPayload(base: ModelsDevPayload, overlay: ModelsDevPayload): ModelsDevPayload;
489
-
490
- interface MessageRepairReport {
491
- changed: boolean;
492
- removedToolUses: string[];
493
- removedToolResults: string[];
494
- removedMessages: number;
495
- }
496
- interface MessageRepairResult {
497
- messages: Message[];
498
- report: MessageRepairReport;
499
- }
500
- /**
501
- * Repair provider-level tool-call adjacency invariants.
502
- *
503
- * Anthropic requires every assistant `tool_use` block to have a matching
504
- * `tool_result` block in the immediately following user message. Manual
505
- * context surgery (summary/prune) can cut through the middle of such an
506
- * exchange. This function removes only the now-orphaned protocol blocks,
507
- * preserving surrounding text/images/thinking blocks where possible.
508
- */
509
- declare function repairToolUseAdjacency(messages: Message[]): MessageRepairResult;
510
-
511
- type NewlineStyle = 'lf' | 'crlf' | 'cr';
512
- declare function detectNewlineStyle(text: string): NewlineStyle;
513
- declare function toStyle(text: string, style: NewlineStyle): string;
514
- declare function normalizeToLf(text: string): string;
515
-
516
- /**
517
- * Compile a user-supplied regex with conservative bounds against ReDoS.
518
- *
519
- * Duplicated from @wrongstack/tools/_regex.ts to avoid a circular
520
- * dependency (tools depends on core, not vice versa). Keep both copies
521
- * in sync if the heuristics change.
522
- *
523
- * V8's regex engine is backtracking-based and cannot interrupt a
524
- * synchronous match — a pattern like `(a+)+$` against a sufficiently
525
- * long line will pin a worker for seconds.
526
- */
527
- interface CompileResult {
528
- ok: true;
529
- regex: RegExp;
530
- }
531
- interface CompileFail {
532
- ok: false;
533
- reason: string;
534
- }
535
- declare function compileUserRegex(pattern: string, flags: string): CompileResult | CompileFail;
536
-
537
- interface SafeParseResult<T> {
538
- ok: boolean;
539
- value?: T | undefined;
540
- error?: string | undefined;
541
- }
542
- declare function safeParse<T = unknown>(input: string, maxBytes?: number): SafeParseResult<T>;
543
- declare function safeStringify(value: unknown, pretty?: boolean): string;
544
- /**
545
- * Attempt to parse JSON5-style input and return a valid JSON string.
546
- * Handles trailing commas, single-line comments, and unquoted keys
547
- * that are common in provider output.
548
- *
549
- * Returns the sanitized string if it parses successfully as JSON,
550
- * or `null` if the input cannot be made valid. Callers use this to
551
- * decide whether to proceed with the parsed result or fall back to
552
- * raw handling.
553
- */
554
- declare function sanitizeJsonString(s: string): string | null;
555
- /**
556
- * Strip a Markdown code-fence wrapper from a payload.
557
- *
558
- * Models occasionally return tool-call arguments wrapped in ```json fences
559
- * (or embedded in prose around one) instead of bare JSON. Returns the inner
560
- * content when the input starts with a fence (closing fence optional, so a
561
- * truncated stream still unwraps) or contains one complete fenced block;
562
- * returns null when no fence is present. Callers should only invoke this
563
- * after a direct parse failed, so fences inside legitimate string values are
564
- * never touched.
565
- */
566
- declare function stripCodeFences(s: string): string | null;
567
-
568
- /**
569
- * Resolve `<dir>/<sessionId><suffix>` for per-session sidecar files
570
- * (annotations, audit chain, replay log, the session JSONL itself).
571
- *
572
- * Modern session ids are date-sharded ("2026-06-11/sess_<ULID>"),
573
- * so a forward slash is a legitimate shard separator — NOT traversal.
574
- * Escape attempts are blocked two ways: an explicit ban on `..` and
575
- * backslashes, plus a resolved-path containment check that rejects any
576
- * id whose resolved target leaves `dir`. Character bans alone are how
577
- * several stores ended up throwing on every modern session id.
578
- */
579
- declare function sessionScopedPath(dir: string, sessionId: string, suffix: string): string;
580
-
581
- /**
582
- * Turn an arbitrary string into a filesystem- and URL-safe lowercase slug.
583
- *
584
- * Collapses every run of non-alphanumeric characters into a single hyphen,
585
- * trims leading/trailing hyphens, and caps the length. Returns `fallback`
586
- * when the input slugifies to the empty string.
587
- *
588
- * Used as the stable dedup + registry key for prompts. (Distinct from the
589
- * project-folder slug in `wstack-paths.ts`, which has its own `'project'`
590
- * fallback and shorter cap.)
591
- */
592
- declare function slugify(name: string, fallback?: string, maxLen?: number): string;
593
-
594
- /**
595
- * Generate a ULID — a 26-char Crockford-base32 identifier whose first 10 chars
596
- * encode the millisecond timestamp (so IDs sort lexicographically by creation
597
- * time) followed by 16 chars of randomness. Zero runtime dependencies.
598
- *
599
- * The codebase convention is "IDs are ULIDs"; use this for any new store key.
600
- */
601
- declare function ulid(seedTime?: number): string;
602
- /** True for a well-formed 26-char Crockford-base32 ULID. */
603
- declare function isUlid(value: string): boolean;
604
-
605
- /** Resolve a promise after `ms` milliseconds. Prefer this over raw
606
- * `setTimeout` wrappers so all delay sites use a single implementation
607
- * and an abortable variant can be introduced without a codebase-wide hunt. */
608
- declare function sleep(ms: number): Promise<void>;
609
-
610
- /**
611
- * String utilities shared across the WrongStack codebase.
612
- */
613
- /**
614
- * Truncate a string to at most `max` characters, appending an ellipsis if it
615
- * was longer. Returns the original string unchanged when it fits.
616
- */
617
- declare function truncate(s: string, max: number): string;
618
-
619
- /**
620
- * TTY detection helpers — the single source of truth for "is this process
621
- * running against a real terminal?". Replaces ad-hoc `process.stdin.isTTY`
622
- * / `process.stdout.isTTY` checks scattered across the codebase so that:
623
- *
624
- * 1. test code can mock a single module instead of stubbing `isTTY` on
625
- * every ReadStream/WriteStream the test happens to touch;
626
- * 2. a future TTY-detection source (an env var override, a Windows
627
- * ConPTY workaround, …) lands in one place;
628
- * 3. `isInteractive()` encodes the rule the project already used inline
629
- * ("both streams are TTYs AND we're not running under CI") in one
630
- * testable helper instead of the same 3-condition check in two
631
- * different files.
632
- *
633
- * Scope: detection only. Raw-mode control (`setRawMode`), resize
634
- * subscriptions, and write-injection belong to a future, larger TTY
635
- * abstraction; this module is the smallest pull that gives us a
636
- * testable seam and dedups 20+ call sites.
637
- */
638
- /** True when `process.stdout` is attached to a terminal (not a pipe/file). */
639
- declare function isStdoutTTY(): boolean;
640
- /** True when `process.stdin` is attached to a terminal (not a pipe/file). */
641
- declare function isStdinTTY(): boolean;
642
- /**
643
- * True when the current process is an interactive session: both stdin and
644
- * stdout are TTYs. Callers that also need a "not a single-shot invocation"
645
- * or "not under CI" check should layer that on top — keeping this helper
646
- * minimal preserves the original inline checks it replaces.
647
- */
648
- declare function isInteractive(): boolean;
649
- /** Current terminal size in characters, with a 24×80 fallback for non-TTYs. */
650
- declare function getTermSize(): {
651
- rows: number;
652
- cols: number;
653
- };
654
- /**
655
- * Subscribe to terminal resize events. `cb` is called with the new size each
656
- * time the underlying stream emits `resize`. Returns a cleanup function the
657
- * caller MUST call on dispose to remove the listener — leaving a stale
658
- * `resize` listener on a disposed component leaks the closure (and the
659
- * component itself, transitively) until the process exits.
660
- *
661
- * The stream argument defaults to `process.stdout`. Pass an explicit
662
- * `NodeJS.WriteStream` when the caller already owns one (e.g. a status line
663
- * that targets an injected `out` for testability). For non-TTY streams no
664
- * listener is registered and the returned cleanup is a no-op.
665
- */
666
- declare function onResize(cb: (size: {
667
- rows: number;
668
- cols: number;
669
- }) => void, stream?: NodeJS.WriteStream): () => void;
670
- /**
671
- * Toggle raw mode on a TTY stdin stream. Returns `true` when the toggle was
672
- * applied, `false` when the stream is null, not a TTY, or doesn't expose
673
- * `setRawMode` (pipes, file descriptors, Windows ConPTY edge cases). Callers
674
- * that need to restore the previous mode should snapshot `input.isRaw`
675
- * BEFORE the call and pass the value to a second call to flip back.
676
- *
677
- * Use this helper to drop the now-redundant
678
- * `if (input.isTTY) input.setRawMode(...)` ceremony at every call site.
679
- */
680
- declare function setRawMode(input: NodeJS.ReadStream, mode: boolean): boolean;
681
- /**
682
- * Bracket installed by the interactive input reader while a `readline`
683
- * prompt is on screen. Out-of-band terminal writes — logger WARN/INFO
684
- * lines, async activity from the Telegram bridge, etc. — go to the same
685
- * physical terminal as the half-typed prompt but readline has no idea they
686
- * happened, so it never repaints. The result is the classic corruption the
687
- * user sees: every async line strands the in-progress draft as a fresh
688
- * scrollback row (sometimes with its cursor underline).
689
- *
690
- * The guard closes that gap. `suspend()` wipes the draft row so the message
691
- * prints clean; `resume()` repaints the prompt + draft (cursor preserved).
692
- * When no prompt is active the guard is `null` and writes pass straight
693
- * through — so agent-turn output (spinner, renderer) is untouched.
694
- */
695
- interface OutputLineGuard {
696
- /** Clear the current input row right before an out-of-band write. */
697
- suspend(): void;
698
- /** Repaint the prompt + in-progress draft right after the write. */
699
- resume(): void;
700
- }
701
- /**
702
- * Register (or clear, with `null`) the guard that brackets out-of-band
703
- * writes. Installed by {@link writeOut}/{@link writeErr} consumers — in
704
- * practice the CLI's readline input reader — only while a prompt is live.
705
- * Idempotent; the most recent caller wins.
706
- */
707
- declare function setOutputLineGuard(guard: OutputLineGuard | null): void;
708
- /**
709
- * Write `s` to `stream` (defaults to `process.stdout`). Returns `false`
710
- * when the stream is missing or doesn't expose `write` so callers can
711
- * degrade silently under hostile host environments (closed pipe, mock
712
- * injects `null`, test replaces the stream with a stub).
713
- *
714
- * Why a helper:
715
- * 1. **Single seam for output capture in tests** — stub `writeOut` once
716
- * and assert on what the rest of the codebase intended to print,
717
- * without spying on `process.stdout.write` (which is brittle and
718
- * leaks across parallel test files).
719
- * 2. **Stream swap without grep** — routing the CLI's output to a
720
- * logger or `out.log` becomes a one-line change at process boot.
721
- * 3. **Defensive default** — closes the "what if `process.stdout` is
722
- * `null`" gap that currently exists at ~50 call sites that just
723
- * call `process.stdout.write(s)` and crash on certain Windows
724
- * redirect invocations.
725
- *
726
- * Call-site migration is staged: this commit introduces the helper, a
727
- * follow-up commit replaces the 50+ `process.stdout.write(...)` sites
728
- * with `writeOut(...)`. Until that migration lands, both forms coexist
729
- * and `writeOut` is the preferred form for new code.
730
- */
731
- declare function writeOut(s: string, stream?: NodeJS.WriteStream): boolean;
732
- /**
733
- * Symmetric partner of `writeOut` for the standard error stream. Same shape,
734
- * same defensive contract, same single-seam-for-tests story — just defaults to
735
- * `process.stderr` instead of `process.stdout`.
736
- *
737
- * Use this in code paths that emit error/diagnostic/warning text. Keeping
738
- * these two helpers split (rather than a single `writeTo(s, stream)`) means
739
- * the call site reads as a clear intent signal: "I am writing an error" vs.
740
- * "I am writing a result" — which matters for callers that decide between
741
- * stdout/stderr routing (e.g. `--quiet` flags, log-level filtering,
742
- * structured-log rewriters that fork on stream).
743
- *
744
- * Stderr writes from the core logger (see `infrastructure/logger.ts`) and from
745
- * the TUI guard (see `tui/run-tui.ts`) used to call `process.stderr.write`
746
- * directly. Routing them through this helper lets tests stub the stream at
747
- * one boundary and lets future logging middleware (e.g. a JSON-line rewriter)
748
- * swap the destination for the entire process in one place.
749
- */
750
- declare function writeErr(s: string, stream?: NodeJS.WriteStream): boolean;
751
-
752
- /**
753
- * Canonical text rendering of the live todo list, shared by the CLI's
754
- * `/todos` slash command and the TUI's auto-echo (which prints the same
755
- * snapshot to chat history each time the `todo` tool mutates the list).
756
- *
757
- * Layout: a header line with the `done/total done` count, then one row
758
- * per item — `[ ]` pending, `[~]` in-progress, `[x]` completed. In-
759
- * progress rows prefer `activeForm` ("Building the project") over the
760
- * imperative `content` ("Build the project") when present.
761
- *
762
- * Returned as a single newline-joined string so callers can hand it
763
- * straight to a history dispatcher or stdout.
764
- */
765
- declare function formatTodosList(todos: TodoItem[]): string;
766
- /**
767
- * True when the todos list still has at least one unfinished item — either
768
- * `pending` (not started) or `in_progress` (underway). The REPL and other
769
- * post-turn handlers call this to decide whether to surface `<nextsteps>`
770
- * suggestions to the user: as long as the agent has open todos, finishing
771
- * them takes priority over offering new prompt options. Surfacing
772
- * `<nextsteps>` mid-task is what causes YOLO+auto mode and the autonomy
773
- * 'auto' loop to prematurely pivot away from the in-flight todo list.
774
- *
775
- * Returns false for an empty / undefined list (nothing pending, nothing to
776
- * block on) and false for an all-completed list. Treats any non-array input
777
- * (legacy contexts, mocks) as "no todos" rather than throwing.
778
- */
779
- declare function hasOpenTodos(todos: readonly TodoItem[] | undefined | null): boolean;
780
-
781
- declare function escapeGlobSubject(value: string): string;
782
- declare function normalizePathSubject(value: string): string;
783
- declare function isPathSubjectKey(subjectKey: string): boolean;
784
- declare function subjectForToolInput(toolName: string, input: unknown, subjectKey?: string): string | undefined;
785
-
786
- /**
787
- * Tool output serialization utilities.
788
- * Extracted from Agent.executeTools to allow reuse and consistent output handling.
789
- */
790
- interface ToolOutputSerializerOptions {
791
- perIterationOutputCapBytes?: number | undefined;
792
- estimator?: ((text: string) => number) | undefined;
793
- }
794
- interface ToolOutputSerializeContext {
795
- toolName?: string | undefined;
796
- input?: unknown;
797
- /**
798
- * Optional reference to the Tool object. When present and the tool defines
799
- * a `serialize()` method, the serializer delegates to it instead of the
800
- * central `renderToolObject()` switch (P3 #21).
801
- */
802
- tool?: {
803
- serialize?: (output: unknown, input: unknown) => string;
804
- } | undefined;
805
- }
806
- declare function createToolOutputSerializer(opts?: ToolOutputSerializerOptions): {
807
- serialize: (value: unknown, context?: ToolOutputSerializeContext) => string;
808
- enforceCap: (text: string, remainingBudget: number) => {
809
- text: string;
810
- newBudget: number;
811
- };
812
- capBytes: number;
813
- };
814
-
815
- declare const DEFAULT_TOOL_DESCRIPTION_MODE: ToolDescriptionMode;
816
- interface ToolDescriptionRegistryLike {
817
- get(name: string): Tool | undefined;
818
- list(): Tool[];
819
- wrap?(name: string, wrapper: (tool: Tool) => Tool, owner?: string): void;
820
- setDescriptionMode?(name: string, mode: ToolDescriptionMode): boolean;
821
- applyDescriptionModes?(modes?: ToolDescriptionModeConfig): {
822
- applied: number;
823
- missing: string[];
824
- };
825
- getDescriptionMode?(name: string): ToolDescriptionMode;
826
- }
827
- declare function normalizeToolDescriptionMode(value: unknown): ToolDescriptionMode | undefined;
828
- declare function resolveToolDescriptionMode(modes: ToolDescriptionModeConfig | undefined, toolName: string): ToolDescriptionMode;
829
- declare function simplifyToolDescription(text: string, opts?: {
830
- maxSentences?: number | undefined;
831
- maxChars?: number | undefined;
832
- }): string;
833
- declare function applyToolDescriptionModeToTool(tool: Tool, mode: ToolDescriptionMode): Tool;
834
- declare function setToolDescriptionMode(registry: ToolDescriptionRegistryLike, name: string, mode: ToolDescriptionMode): boolean;
835
- declare function getToolDescriptionMode(registry: ToolDescriptionRegistryLike, name: string): ToolDescriptionMode;
836
- declare function applyToolDescriptionModes(registry: ToolDescriptionRegistryLike, modes?: ToolDescriptionModeConfig): {
837
- applied: number;
838
- missing: string[];
839
- };
840
-
841
- declare const DEFAULT_TOOL_RESULT_RENDER_MODE: ToolResultRenderMode;
842
- /**
843
- * Normalize a raw value to a {@link ToolResultRenderMode}. Accepts the
844
- * canonical strings (`'extend' | 'simple'`) plus a few synonyms so the
845
- * slash command feels forgiving (`extended`/`full` → `extend`,
846
- * `short`/`brief` → `simple`). Returns `undefined` for anything else so
847
- * the caller can reject unknown input without throwing.
848
- */
849
- declare function normalizeToolResultRenderMode(value: unknown): ToolResultRenderMode | undefined;
850
- /**
851
- * Look up the result-render mode for `toolName` from a config map. Falls
852
- * back to the default `'extend'` when the map is missing the entry.
853
- */
854
- declare function resolveToolResultRenderMode(modes: ToolResultRenderModeConfig | undefined, toolName: string): ToolResultRenderMode;
855
- /**
856
- * Subset of {@link import('../registry/tool-registry.js').ToolRegistry}
857
- * the result-render-mode setters need. Decouples this module from the
858
- * concrete registry class so it can be reused by tests and by tools
859
- * that wrap their own registry.
860
- */
861
- interface ToolResultRenderModeRegistryLike {
862
- get(name: string): Tool | undefined;
863
- setResultRenderMode?(name: string, mode: ToolResultRenderMode): boolean;
864
- applyResultRenderModes?(modes?: ToolResultRenderModeConfig): {
865
- applied: number;
866
- missing: string[];
867
- };
868
- getResultRenderMode?(name: string): ToolResultRenderMode;
869
- }
870
- /**
871
- * Set a single tool's result-render mode on a registry. Prefers the
872
- * registry's native accessor (so it can update any internal state, e.g.
873
- * usage caches); falls back to a no-op so callers stay decoupled from
874
- * the registry implementation.
875
- */
876
- declare function setToolResultRenderMode(registry: ToolResultRenderModeRegistryLike, name: string, mode: ToolResultRenderMode): boolean;
877
- /**
878
- * Look up the current result-render mode for a single tool. Returns the
879
- * registry's view if it has one, otherwise the default. This is what the
880
- * tool-executor calls on each tool invocation to decide whether the next
881
- * `writeToolResult` should be `simple` or `extend`.
882
- */
883
- declare function getToolResultRenderMode(registry: ToolResultRenderModeRegistryLike, name: string): ToolResultRenderMode;
884
- /**
885
- * Bulk-apply a config map (`tools.resultRenderMode`) to a registry.
886
- * Mirrors {@link import('./tool-description-mode.js').applyToolDescriptionModes}
887
- * for symmetry with the LLM-side description mode.
888
- */
889
- declare function applyToolResultRenderModes(registry: ToolResultRenderModeRegistryLike, modes?: ToolResultRenderModeConfig): {
890
- applied: number;
891
- missing: string[];
892
- };
893
-
894
- interface ToolWireDefinitionLike {
895
- name: string;
896
- description?: string | undefined;
897
- inputSchema: unknown;
898
- }
899
- interface CompactToolDefinitionForWireOptions {
900
- /** Top-level tool description budget. */
901
- descriptionMaxChars?: number | undefined;
902
- /** Per-JSON-Schema `description` annotation budget. */
903
- schemaDescriptionMaxChars?: number | undefined;
904
- }
905
- interface CompactWireToolDefinition {
906
- name: string;
907
- description: string;
908
- inputSchema: Record<string, unknown>;
909
- }
910
- /**
911
- * Return the provider-wire version of a tool definition.
912
- *
913
- * Tool schemas remain structurally intact: validation keywords, property
914
- * names, required fields, enum values, and nested shapes are preserved. The
915
- * only reduction is on human prose annotations (`description`), which are the
916
- * largest repeated cost in provider tool declarations.
917
- */
918
- declare function compactToolDefinitionForWire(tool: ToolWireDefinitionLike, opts?: CompactToolDefinitionForWireOptions): CompactWireToolDefinition;
919
- declare function compactSchemaDescriptions(schema: unknown, maxDescriptionChars?: number): Record<string, unknown>;
920
-
921
- export { type AtomicWriteOptions, type BuildChildEnvOptions, COMPLETED_WORK_LEDGER_MARKER, type CoercionResult, type CompactToolDefinitionForWireOptions, type CompactWireToolDefinition, type CompileFail, type CompileResult, DEFAULT_TOOL_DESCRIPTION_MODE, DEFAULT_TOOL_RESULT_RENDER_MODE, type DeepMergeOptions, FORBIDDEN_PROTO_KEYS, type FileLockOptions, type JsonObject, type JsonPath, type JsonPathSegment, type MessageRepairReport, type MessageRepairResult, type NewlineStyle, type OutputLineGuard, type RecordCompletedWorkInput, type RecordToolOutputEvidenceInput, type RequestTokenBreakdown, type SafeParseResult, type ToolDescriptionRegistryLike, type ToolOutputSerializerOptions, type ToolResultRenderModeRegistryLike, type ToolWireDefinitionLike, type UnifiedDiffOptions, type ValidationError, type ValidationResult, applyToolDescriptionModeToTool, applyToolDescriptionModes, applyToolResultRenderModes, assertNever, assertNotPrivateHost, atomicWrite, buildChildEnv, buildCompletedWorkLedgerBlock, buildContextEvidenceDigest, coerceAgainstSchema, color, compactSchemaDescriptions, compactToolDefinitionForWire, compileGlob, compileUserRegex, completePartialObject, computeMessageTokens, createContextEvidenceState, createToolOutputSerializer, deepMerge, detectNewlineStyle, ensureDir, escapeGlobSubject, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, expandGlob, expandIPv6, formatCompletedWorkLedger, formatTodosList, getCalibrationState, getJsonPath, getTermSize, getToolDescriptionMode, getToolResultRenderMode, hasOpenTodos, isInteractive, isJsonObject, isPathSubjectKey, isPrimitiveArray, isPrivateIPv4, isPrivateIPv6, isStdinTTY, isStdoutTTY, isUlid, jsonObjectFileExists, markAssistantReferencedEvidence, matchAny, matchGlob, mergeCustomModelDefs, mergeModelsPayload, normalizePathSubject, normalizeToLf, normalizeToolDescriptionMode, normalizeToolResultRenderMode, onResize, readJsonObjectFile, recordActualUsage, recordCompletedWorkEvidence, recordToolOutputEvidence, recordUserIntentEvidence, removeJsonPath, removeJsonPathInFile, repairToolUseAdjacency, repeatedReadPressure, resetCalibration, resolveToolDescriptionMode, resolveToolResultRenderMode, safeParse, safeStringify, sanitizeJsonString, sanitizeNodeOptions, sessionScopedPath, setJsonPath, setJsonPathInFile, setOutputLineGuard, setRawMode, setToolDescriptionMode, setToolResultRenderMode, simplifyToolDescription, sleep, slugify, stripAnsi, stripCodeFences, subjectForToolInput, syncCompletedWorkLedgerBlock, toStyle, truncate, ulid, unifiedDiff, updateJsonObjectFile, validateAgainstSchema, withFileLock, writeErr, writeJsonObjectFile, writeOut };
11
+ export * from './expect-defined.js';
12
+ export { expandGlob } from './glob-expand.js';
13
+ export * from './glob-match.js';
14
+ export { buildUserContentBlocks, type IncomingImagePayload, IncomingImageError, MAX_INCOMING_IMAGE_BYTES, MAX_INCOMING_IMAGES, parseIncomingImages, } from './incoming-images.js';
15
+ export { assertNotPrivateHost, expandIPv6, isPrivateIPv4, isPrivateIPv6 } from './ip-guard.js';
16
+ export { completePartialObject } from './json-repair.js';
17
+ export { type CoercionResult, type ValidationError, type ValidationResult, coerceAgainstSchema, validateAgainstSchema, } from './json-schema-validate.js';
18
+ export { mergeCustomModelDefs } from './merge-custom-models.js';
19
+ export { mergeModelsPayload } from './merge-models-payload.js';
20
+ export { type MessageRepairReport, type MessageRepairResult, repairToolUseAdjacency, } from './message-invariants.js';
21
+ export * from './newline-normalize.js';
22
+ export { type CompileFail, type CompileResult, compileUserRegex } from './regex-guard.js';
23
+ export * from './safe-json.js';
24
+ export { sessionScopedPath } from './session-scoped-path.js';
25
+ export { slugify } from './slug.js';
26
+ export { ulid, isUlid } from './ulid.js';
27
+ export * from './sleep.js';
28
+ export * from './string.js';
29
+ export * from './task-format.js';
30
+ export * from './term.js';
31
+ export * from './todos-format.js';
32
+ export * from './tool-subject.js';
33
+ export { computeMessageTokens, estimateMessageTokens, estimateRequestTokens, estimateRequestTokensCalibrated, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, getCalibrationState, type RequestTokenBreakdown, recordActualUsage, resetCalibration, } from './token-estimate.js';
34
+ export { createToolOutputSerializer, type ToolOutputSerializerOptions, } from './tool-output-serializer.js';
35
+ export { DEFAULT_TOOL_DESCRIPTION_MODE, applyToolDescriptionModeToTool, applyToolDescriptionModes, getToolDescriptionMode, normalizeToolDescriptionMode, resolveToolDescriptionMode, setToolDescriptionMode, simplifyToolDescription, type ToolDescriptionRegistryLike, } from './tool-description-mode.js';
36
+ export { DEFAULT_TOOL_RESULT_RENDER_MODE, applyToolResultRenderModes, getToolResultRenderMode, normalizeToolResultRenderMode, resolveToolResultRenderMode, setToolResultRenderMode, type ToolResultRenderModeRegistryLike, } from './tool-result-render-mode.js';
37
+ export { type CompactToolDefinitionForWireOptions, type CompactWireToolDefinition, compactSchemaDescriptions, compactToolDefinitionForWire, type ToolWireDefinitionLike, } from './tool-wire-compact.js';
38
+ export * from './wstack-paths.js';
39
+ //# sourceMappingURL=index.d.ts.map