@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,850 +0,0 @@
1
- import { A as AttachmentStore, a as AddAttachmentInput, b as AttachmentRef, c as Attachment } from './session-reader-7Esxrkpw.js';
2
- import { i as ContentBlock, u as ConversationState, k as SessionStore, S as SessionEvent, j as SessionMetadata, b as SessionWriter, v as SessionForkOptions, F as ForkedSession, W as WorkspaceCheckpointRef, w as WorkspaceMaterializationResult, x as ResumedSession, y as SessionData, z as SessionSummary, A as TodoItem } from './tool-BNlnIJvo.js';
3
- import { E as EventBus, M as MemoryScope, b as MemoryEntry, c as MemoryStore, d as MemoryRelevanceContext, S as ScoredEntry } from './events-Bgnh43r9.js';
4
- import { j as Config, l as ConfigLoader, m as SyncConfig, n as ConfigStore } from './config-MRqn1V-u.js';
5
- import { S as SecretVault } from './secret-vault-BAKpgFw_.js';
6
- import { W as WstackPaths } from './wstack-paths-C3K40Qst.js';
7
- import { S as SecretScrubber } from './secret-scrubber-3MHDDAtm.js';
8
-
9
- interface AttachmentStoreOptions {
10
- /**
11
- * Directory for spooling payloads larger than `spoolThresholdBytes`.
12
- * When omitted, all payloads stay in memory.
13
- */
14
- spoolDir?: string | undefined;
15
- spoolThresholdBytes?: number | undefined;
16
- }
17
- /**
18
- * In-memory attachment store with optional disk spool. Placeholder syntax
19
- * is `[<kind> #<seq>]` (seq-keyed) or `[file:<path>]` (path-keyed) where kind
20
- * is `pasted` / `image` / `file`. Unknown placeholders are passed through
21
- * as-is so users can write that literal text without losing it.
22
- */
23
- declare class DefaultAttachmentStore implements AttachmentStore {
24
- private readonly items;
25
- private readonly refs;
26
- private nextSeq;
27
- private readonly spoolDir;
28
- private readonly spoolThreshold;
29
- constructor(opts?: AttachmentStoreOptions);
30
- add(input: AddAttachmentInput): Promise<AttachmentRef>;
31
- get(id: string): Promise<Attachment | undefined>;
32
- list(): AttachmentRef[];
33
- expand(text: string): Promise<ContentBlock[]>;
34
- clear(): Promise<void>;
35
- private toBlock;
36
- }
37
-
38
- /**
39
- * A single config source. Higher priority wins in merges.
40
- * Sources are applied in priority order (lowest first), so a source
41
- * with priority=10 overrides one with priority=1.
42
- */
43
- interface ConfigSource {
44
- /** Unique name for debugging and error messages. */
45
- name: string;
46
- /** Lower numbers merge first, higher numbers override lower. Default: 50. */
47
- priority?: number | undefined;
48
- /**
49
- * Read the raw config patch. Return an empty object if unavailable.
50
- * Errors are surfaced but do not abort loading — the source is skipped.
51
- */
52
- read(): Promise<Partial<Config>>;
53
- }
54
- interface ConfigLoaderOptions {
55
- paths: WstackPaths;
56
- strict?: boolean | undefined;
57
- vault?: SecretVault | undefined;
58
- /** Extra sources merged after the built-in layers. */
59
- sources?: ConfigSource[] | undefined;
60
- events?: EventBus;
61
- traceId?: string;
62
- }
63
- declare class DefaultConfigLoader implements ConfigLoader {
64
- private readonly paths;
65
- private readonly strict;
66
- private readonly vault;
67
- private readonly extraSources;
68
- private readonly events;
69
- private readonly traceId;
70
- private readonly jsonCache;
71
- constructor(opts: ConfigLoaderOptions);
72
- load(opts?: {
73
- cliFlags?: Partial<Config> | undefined;
74
- cwd?: string | undefined;
75
- }): Promise<Config>;
76
- private ensureGlobalDefaults;
77
- /**
78
- * Persist a sync config to ~/.wrongstack/sync.json, with the token encrypted
79
- * by the vault (if provided). The file is isolated from the main config
80
- * hierarchy to prevent accidental commits.
81
- */
82
- persistSyncConfig(cfg: SyncConfig): Promise<void>;
83
- /**
84
- * Read ~/.wrongstack/sync.json (encrypted GitHub token storage) and decrypt
85
- * the token if a vault is available. Returns null if the file doesn't exist.
86
- * This is separate from main config loading because sync.json is intentionally
87
- * isolated — it should never be part of project-local or env-driven config.
88
- */
89
- loadSyncConfig(): Promise<SyncConfig | null>;
90
- private readJson;
91
- private validateBehavior;
92
- private validateIdentity;
93
- }
94
-
95
- /**
96
- * L2-D: Config version migration framework. Pure functions, decoupled
97
- * from disk/CLI — caller passes a parsed JSON object and gets back the
98
- * up-to-date `Config` shape (or a structured error explaining why
99
- * migration failed).
100
- *
101
- * Migrations are registered as `{ from, to, migrate }` triples and run
102
- * sequentially. Each migration is independently testable. Adding a new
103
- * version means appending one migration; existing user configs are
104
- * upgraded in place at load time.
105
- */
106
- interface MigrationContext {
107
- /**
108
- * Original on-disk version of the input. Migrations may use this to
109
- * decide between in-place patches and rewrites.
110
- */
111
- fromVersion: number;
112
- /**
113
- * Set when the migration writes back to disk. Callers persist the
114
- * migrated config when this is true so the user doesn't see the same
115
- * migration banner on every boot.
116
- */
117
- shouldPersist: boolean;
118
- }
119
- interface ConfigMigration {
120
- /** Version of the input this migration accepts. */
121
- from: number;
122
- /** Version of the output it produces. */
123
- to: number;
124
- /** Pure transform — no I/O. */
125
- migrate(input: Record<string, unknown>, ctx: MigrationContext): Record<string, unknown>;
126
- /** Optional human-readable description for migration logs / banners. */
127
- describe?: string | undefined;
128
- }
129
- interface MigrationResult {
130
- /** Final config (still typed as `unknown`-keyed — caller validates). */
131
- config: Record<string, unknown>;
132
- /** Ordered list of `from→to` versions that ran. */
133
- applied: string[];
134
- /** True when at least one migration produced changes worth persisting. */
135
- shouldPersist: boolean;
136
- }
137
- declare class ConfigMigrationError extends Error {
138
- readonly fromVersion: number;
139
- readonly targetVersion: number;
140
- readonly missingStep: number | null;
141
- constructor(opts: {
142
- message: string;
143
- fromVersion: number;
144
- targetVersion: number;
145
- missingStep: number | null;
146
- });
147
- }
148
- /**
149
- * Run registered migrations until the input reaches `targetVersion`.
150
- *
151
- * Resolution rules:
152
- * 1. If `input.version === targetVersion`, no migrations run; `shouldPersist`
153
- * is false.
154
- * 2. Otherwise walk the migration chain from `input.version` upward,
155
- * picking the migration whose `from` matches the current version.
156
- * 3. Stop when `current.version === targetVersion`.
157
- * 4. If no migration matches at some point, throw `ConfigMigrationError`
158
- * with the missing step recorded for diagnostics.
159
- *
160
- * Migrations may be downward (e.g. for staged rollouts), but `targetVersion`
161
- * must be reachable strictly via the registered chain — there's no implicit
162
- * "skip" or transitive resolution.
163
- */
164
- declare function runConfigMigrations(input: Record<string, unknown>, targetVersion: number, migrations: readonly ConfigMigration[]): MigrationResult;
165
- /**
166
- * Default empty migration registry. Real migrations are appended as new
167
- * Config versions are introduced. Example (when v2 lands):
168
- *
169
- * export const CONFIG_MIGRATIONS: readonly ConfigMigration[] = [
170
- * {
171
- * from: 1, to: 2, describe: 'rename `apiKey` → `auth.apiKey`',
172
- * migrate(cfg) {
173
- * const apiKey = cfg.apiKey;
174
- * delete cfg.apiKey;
175
- * return { ...cfg, auth: { ...(cfg.auth ?? {}), apiKey } };
176
- * },
177
- * },
178
- * ];
179
- */
180
- declare const DEFAULT_CONFIG_MIGRATIONS: readonly ConfigMigration[];
181
-
182
- /**
183
- * Reference implementation of `ConfigStore`. Stores a single frozen Config
184
- * and notifies watchers synchronously on every update. Updates use a deep
185
- * clone so callers can mutate their `partial` argument freely without
186
- * tainting state.
187
- *
188
- * For the CLI: instantiate once at boot, pass the store (not the Config)
189
- * to subsystems that care about runtime changes (provider switching,
190
- * extension reload).
191
- */
192
- declare class DefaultConfigStore implements ConfigStore {
193
- private current;
194
- private watchers;
195
- constructor(initial: Config);
196
- get(): Readonly<Config>;
197
- getSection<K extends keyof Config>(key: K): Readonly<Config[K]>;
198
- getExtension(pluginName: string): Readonly<Record<string, unknown>>;
199
- update(partial: Partial<Config>): Readonly<Config>;
200
- watch(cb: (next: Readonly<Config>, prev: Readonly<Config>) => void): () => void;
201
- }
202
-
203
- interface MemoryBackend {
204
- readonly kind: string;
205
- remember(scope: MemoryScope, entry: MemoryEntry, filePath: string): Promise<void>;
206
- forget(scope: MemoryScope, query: string, filePath: string): Promise<number>;
207
- readAll(scope: MemoryScope, filePath: string): Promise<string>;
208
- list(scope: MemoryScope, filePath: string, limit?: number | undefined): Promise<MemoryEntry[]>;
209
- search(scope: MemoryScope, query: string, filePath: string, limit?: number | undefined): Promise<MemoryEntry[]>;
210
- /** Find memories related to the given text via graph traversal. Optional — falls back to search. */
211
- findRelated?(scope: MemoryScope, filePath: string, text: string, limit: number): Promise<MemoryEntry[]>;
212
- clear(scope: MemoryScope, filePath: string): Promise<void>;
213
- consolidate(scope: MemoryScope, filePath: string): Promise<number>;
214
- }
215
- interface FileMemoryBackendOptions {
216
- paths: WstackPaths;
217
- }
218
- declare class FileMemoryBackend implements MemoryBackend {
219
- readonly kind = "file";
220
- private readonly files;
221
- /** Cache of parsed entries per file path. */
222
- private readonly entryCache;
223
- /** Inverted index per file path. */
224
- private readonly indexCache;
225
- /** File mtime cache for invalidation. */
226
- private readonly mtimeCache;
227
- constructor(opts: FileMemoryBackendOptions);
228
- private resolveFile;
229
- private getMtime;
230
- private invalidateCache;
231
- /**
232
- * Load (and cache) the parsed entries for a file. Callers that have already
233
- * stat'd the file this tick (e.g. `getIndex`) can pass the known `mtime` to
234
- * avoid a redundant `fs.stat` — otherwise it's fetched here.
235
- */
236
- private loadEntries;
237
- private getIndex;
238
- remember(scope: MemoryScope, entry: MemoryEntry, filePath: string): Promise<void>;
239
- forget(scope: MemoryScope, query: string, filePath: string): Promise<number>;
240
- readAll(scope: MemoryScope, filePath: string): Promise<string>;
241
- list(scope: MemoryScope, filePath: string, limit?: number): Promise<MemoryEntry[]>;
242
- search(scope: MemoryScope, query: string, filePath: string, limit?: number): Promise<MemoryEntry[]>;
243
- clear(scope: MemoryScope, filePath: string): Promise<void>;
244
- consolidate(scope: MemoryScope, filePath: string): Promise<number>;
245
- }
246
- declare function parseEntries(raw: string, scope?: MemoryScope): MemoryEntry[];
247
-
248
- interface MemoryStoreOptions {
249
- paths: WstackPaths;
250
- /**
251
- * Optional event bus — when provided, mutations emit events so plugins
252
- * and other subsystems can react to memory changes.
253
- */
254
- events?: EventBus | undefined;
255
- /**
256
- * Storage backend. Defaults to FileMemoryBackend when omitted.
257
- * Plugins can register a custom backend (graph, semantic, vector)
258
- * via the DI container to override storage behavior.
259
- */
260
- backend?: MemoryBackend | undefined;
261
- }
262
- /**
263
- * Three scopes:
264
- * project-agents → <project>/.wrongstack/AGENTS.md (committed)
265
- * project-memory → ~/.wrongstack/projects/<hash>/memory.md (per-project agent notes)
266
- * user-memory → ~/.wrongstack/memory.md (global personal memory)
267
- */
268
- declare class DefaultMemoryStore implements MemoryStore {
269
- private readonly files;
270
- private readonly events?;
271
- private traceId?;
272
- private readonly backend;
273
- /**
274
- * Per-scope serialization queue. `remember` / `forget` / `consolidate` /
275
- * `clear` are read-modify-write against a single file; without a lock,
276
- * two concurrent calls on the same scope can read the same baseline and
277
- * the later write silently drops the earlier entry. We chain each
278
- * mutation onto the prior promise for the same scope so they run in
279
- * issue order. Different scopes still proceed in parallel.
280
- *
281
- * The chain tracks only the last pending write. If a write fails, its
282
- * error is caught and swallowed so the chain stays alive for subsequent
283
- * calls. The error is stored in `writeErrors` so callers can learn about
284
- * it on the next read operation.
285
- */
286
- private readonly writeChain;
287
- /** Last write error per scope — surfaced as warnings on the next readAll(). */
288
- private readonly writeErrors;
289
- /**
290
- * When the global root is a temporary directory (opencode, CI sandboxes),
291
- * memory files are also mirrored to the project tree so they survive
292
- * session cleanup. The primary path stays in the temp root for isolation;
293
- * this backup ensures memory is never lost.
294
- */
295
- private readonly persistBackup;
296
- private readonly backupDir;
297
- /**
298
- * Per-scope tracked byte sizes — incremented on `remember()`, decremented on
299
- * `forget()`, recalculated after `consolidate()`. Eliminates the redundant
300
- * readAll() call that previously checked the file size after every write.
301
- */
302
- private readonly _trackedByteSizes;
303
- /** Result cache for scoreRelevant() — keyed by scope + context hash, TTL 30s. */
304
- private readonly _scoreCache;
305
- /**
306
- * Per-entry cached lowercase strings — lazily allocated once and reused
307
- * across scoreRelevant() calls so repeated scoring of the same entries skips
308
- * re-lowercasing. Keyed by entry object identity; cleared (set to null) on
309
- * every mutation (remember/forget/consolidate/clear) via invalidateScoreCaches().
310
- */
311
- private _cachedLower;
312
- constructor(opts: MemoryStoreOptions);
313
- /** Expose the backend for plugin introspection and advanced queries. */
314
- getBackend(): MemoryBackend;
315
- private runSerialized;
316
- /**
317
- * Recalculate the tracked byte size for a scope by re-reading the file and
318
- * summing the serialized byte length of each line. Called after consolidate()
319
- * (which modifies the file) to keep the tracker accurate.
320
- */
321
- private _recalcTrackedByteSize;
322
- readAll(): Promise<string>;
323
- read(scope: MemoryScope): Promise<string>;
324
- /**
325
- * List entries from a scope, newest first. Delegates to the backend
326
- * so graph/semantic backends can return enriched or filtered results.
327
- */
328
- list(scope?: MemoryScope, limit?: number): Promise<MemoryEntry[]>;
329
- /**
330
- * Find memories related to the given text via graph traversal.
331
- * Falls back to content search when no graph backend is available.
332
- */
333
- findRelated(text: string, scope?: MemoryScope, limit?: number): Promise<MemoryEntry[]>;
334
- search(query: string, scope?: MemoryScope, limit?: number): Promise<MemoryEntry[]>;
335
- remember(text: string, scope?: MemoryScope, metadata?: Omit<Partial<MemoryEntry>, 'scope' | 'text' | 'ts'>): Promise<void>;
336
- /**
337
- * Drop the relevance caches after a mutation. Both the per-context score
338
- * cache and the per-entry lowercase cache are keyed on entry objects that a
339
- * mutation invalidates, so they must be cleared together when entries change.
340
- */
341
- private invalidateScoreCaches;
342
- /**
343
- * Score and rank memories by relevance to the current context.
344
- * Returns entries with score >= MIN_RELEVANCE_SCORE, sorted highest first.
345
- */
346
- scoreRelevant(ctx: MemoryRelevanceContext, scope?: MemoryScope, limit?: number): Promise<ScoredEntry[]>;
347
- forget(query: string, scope?: MemoryScope): Promise<number>;
348
- consolidate(scope: MemoryScope): Promise<void>;
349
- clear(scope?: MemoryScope): Promise<void>;
350
- /**
351
- * Return a new MemoryStore proxy that carries `traceId` on every storage
352
- * event. The original store is left unchanged — callers that need a
353
- * trace-decorated view (e.g. session-run tools) receive the proxy while
354
- * the singleton remains trace-free for boot-time use.
355
- *
356
- * The proxy implements the full `MemoryStore` interface; all other
357
- * properties (backend, etc.) are delegated to the original store.
358
- */
359
- withTraceId(traceId: string): MemoryStore;
360
- private mirrorBackup;
361
- }
362
-
363
- /**
364
- * Plan items are the strategic counterpart to todos. Where `ctx.todos`
365
- * is the moment-to-moment task board the LLM mutates per-turn, a plan
366
- * captures the higher-level approach — the steps the user (or LLM)
367
- * laid out before any work began.
368
- *
369
- * Plans persist by default (per session) so a resumed session can show
370
- * "you were on step 3 of 5". Todos are derived/transient. Both can
371
- * coexist: think roadmap (plan) vs. sprint board (todos).
372
- */
373
- interface PlanItem {
374
- id: string;
375
- title: string;
376
- /** Optional longer-form context or rationale. */
377
- details?: string | undefined;
378
- status: 'open' | 'in_progress' | 'done';
379
- createdAt: string;
380
- updatedAt: string;
381
- }
382
- interface PlanFile {
383
- version: 1;
384
- sessionId: string;
385
- title?: string | undefined;
386
- updatedAt: string;
387
- items: PlanItem[];
388
- }
389
- declare function loadPlan(filePath: string, events?: EventBus): Promise<PlanFile | null>;
390
- /**
391
- * Persist a plan. Returns `true` on success, `false` if the write failed
392
- * (still emits `storage.error` + warns — it does NOT throw, so callers that
393
- * treat a lost plan-save as non-fatal keep working). `mutatePlan` inspects the
394
- * result and throws so the plan TOOL can report `ok:false` instead of falsely
395
- * claiming the plan was persisted.
396
- */
397
- declare function savePlan(filePath: string, plan: PlanFile, events?: EventBus): Promise<boolean>;
398
- /** Create a new PlanFile when none exists on disk. */
399
- declare function emptyPlan(sessionId: string, title?: string): PlanFile;
400
- declare function addPlanItem(plan: PlanFile, title: string, details?: string | undefined): {
401
- plan: PlanFile;
402
- item: PlanItem;
403
- };
404
- declare function removePlanItem(plan: PlanFile, idOrIndex: string): PlanFile;
405
- declare function setPlanItemStatus(plan: PlanFile, idOrIndex: string, status: PlanItem['status']): PlanFile;
406
- declare function clearPlan(plan: PlanFile): PlanFile;
407
- /** Render the plan as a short markdown-ish string suitable for slash output. */
408
- declare function formatPlan(plan: PlanFile): string;
409
- /**
410
- * Promote a plan item to a set of todo items.
411
- * The plan item is marked 'in_progress' (if not already done) and its
412
- * title + details become the first todo; additional subtasks are appended.
413
- * Returns the derived todo list so the caller can pass it to `todoTool`
414
- * or `ctx.state.replaceTodos()`.
415
- */
416
- declare function deriveTodosFromPlanItem(plan: PlanFile, idOrIndex: string, subtasks?: string[] | undefined): {
417
- plan: PlanFile;
418
- todos: Array<{
419
- id: string;
420
- content: string;
421
- status: 'pending' | 'in_progress' | 'completed';
422
- activeForm?: string | undefined;
423
- promotedFromPlan?: string | undefined;
424
- }>;
425
- } | null;
426
- /**
427
- * Load, modify, and save the plan file under a file-level lock.
428
- * Prevents races from parallel tool invocations (e.g. batch_tool_use).
429
- */
430
- declare function mutatePlan(filePath: string, sessionId: string, fn: (plan: PlanFile) => PlanFile | Promise<PlanFile>): Promise<PlanFile>;
431
- /**
432
- * Optional: attach a state-listener so meta operations (storing a plan
433
- * id on ctx.meta) trigger a save. Currently a stub — plans don't live
434
- * on Context, but this keeps the API surface symmetric with the todos
435
- * checkpoint so future refactors can flip plans into Context if needed.
436
- */
437
- declare function attachPlanCheckpoint(_state: ConversationState, _filePath: string, _sessionId: string): () => void;
438
-
439
- /**
440
- * Plan templates — pre-defined plan skeletons for common workflows.
441
- *
442
- * Templates are stored in-memory (no disk I/O). Users instantiate them
443
- * via `/plan template use <name>` or `planTool(action: 'template_use')`.
444
- * Each template is a function that returns an array of item titles, so
445
- * dynamic content (dates, project names) can be injected later.
446
- */
447
- interface PlanTemplate {
448
- name: string;
449
- description: string;
450
- category: 'development' | 'release' | 'maintenance' | 'infrastructure';
451
- items: Array<{
452
- title: string;
453
- details?: string | undefined;
454
- }>;
455
- }
456
- declare function listPlanTemplates(): PlanTemplate[];
457
- declare function getPlanTemplate(name: string): PlanTemplate | undefined;
458
- declare function formatPlanTemplates(): string;
459
-
460
- /**
461
- * The persisted form of a single queued user message. The TUI's
462
- * in-memory QueueItem has a render id; that's pure UI bookkeeping, so
463
- * we drop it when serializing — fresh ids are assigned on rehydrate.
464
- */
465
- interface PersistedQueueItem {
466
- displayText: string;
467
- blocks: ContentBlock[];
468
- }
469
- /**
470
- * Side-file storage for a session's pending input queue. Lives at
471
- * `<sessionDir>/queue.json` next to the attachment spool. Reads are
472
- * tolerant (missing/malformed file → empty array); writes are atomic
473
- * (tmp + rename) so a crash mid-write can never leave a partial file
474
- * the next launch would choke on.
475
- *
476
- * The contract is "snapshot replacement": every mutation hands the
477
- * full queue and we rewrite the file. The queue is small (rarely more
478
- * than a handful of messages), so this is cheaper than delta logging
479
- * and avoids the replay complexity.
480
- */
481
- declare class QueueStore {
482
- private readonly file;
483
- private readonly events;
484
- private readonly traceId;
485
- constructor(opts: {
486
- dir: string;
487
- events?: EventBus;
488
- traceId?: string;
489
- });
490
- write(items: PersistedQueueItem[]): Promise<void>;
491
- read(): Promise<PersistedQueueItem[]>;
492
- clear(): Promise<void>;
493
- }
494
-
495
- /**
496
- * Per-project lockfile used for crash detection. The CLI writes one of
497
- * these alongside the session JSONLs (`<projectSessions>/active.json`)
498
- * when an interactive run starts, and deletes it on clean exit. If we
499
- * find one on the next launch whose owning PID is dead (or whose host
500
- * doesn't match), we know the previous run was killed mid-flight and
501
- * the session it was writing to is a recovery candidate.
502
- *
503
- * The lockfile is intentionally per-project (already isolated by
504
- * `wpaths.projectSessions`), so two TUIs in two different repos do not
505
- * fight each other.
506
- */
507
- interface RecoveryLockOptions {
508
- /** Directory the lockfile lives in. Usually `wpaths.projectSessions`. */
509
- dir: string;
510
- /** This process's PID. Default: `process.pid`. */
511
- pid?: number | undefined;
512
- /** Hostname recorded for the lock. Default: `os.hostname()`. */
513
- hostname?: string | undefined;
514
- /** Locks older than this are considered orphaned (disk wiped, etc.). Default 24h. */
515
- maxAgeMs?: number | undefined;
516
- /** Used to check whether the abandoned session was actually closed cleanly. */
517
- sessionStore?: SessionStore | undefined;
518
- /**
519
- * Override the PID-liveness probe. Default: `process.kill(pid, 0)` —
520
- * succeeds (or throws EPERM) when the PID is alive, throws ESRCH when
521
- * it is gone. Tests inject a deterministic stub.
522
- */
523
- isPidAlive?: (((pid: number) => boolean)) | undefined;
524
- }
525
- interface AbandonedSession {
526
- sessionId: string;
527
- pid: number;
528
- startedAt: string;
529
- /** Lockfile age in ms at the time of the check. */
530
- ageMs: number;
531
- /** Number of messages already on disk for this session. */
532
- messageCount: number;
533
- }
534
- declare class RecoveryLock {
535
- private readonly file;
536
- private readonly pid;
537
- private readonly hostname;
538
- private readonly maxAgeMs;
539
- private readonly sessionStore?;
540
- private readonly probe;
541
- constructor(opts: RecoveryLockOptions);
542
- /**
543
- * Examine the lockfile and decide whether it represents an abandoned
544
- * session. Returns `null` if the file is missing, points to a live
545
- * instance, references a clean-closed session, is too old, or is
546
- * malformed. Otherwise returns enough detail to prompt the user.
547
- *
548
- * Important: this is a read-only check. We never delete an active
549
- * lock from here — if another wstack instance is alive, the caller
550
- * should bail or run with a fresh session instead.
551
- */
552
- checkAbandoned(): Promise<AbandonedSession | null>;
553
- /**
554
- * Claim the lock for the given session. Uses exclusive-create (`O_EXCL`)
555
- * to detect whether another process acquired the lock between our
556
- * `checkAbandoned()` call and now. If the file already exists, it means
557
- * another process won the race and we throw instead of silently
558
- * overwriting their recovery record.
559
- *
560
- * The caller MUST have already called `checkAbandoned()` and handled its
561
- * null return before calling this.
562
- */
563
- write(sessionId: string): Promise<void>;
564
- /**
565
- * Release the lock. Idempotent — silently succeeds if the file is
566
- * already gone (e.g. someone else cleared it, or the directory was
567
- * wiped).
568
- */
569
- clear(): Promise<void>;
570
- private readLock;
571
- }
572
-
573
- interface QueryFilter {
574
- eventTypes?: string[] | undefined;
575
- toolNames?: string[] | undefined;
576
- timeRange?: {
577
- start: string;
578
- end: string;
579
- } | undefined;
580
- }
581
- interface ModeChange {
582
- ts: string;
583
- from: string;
584
- to: string;
585
- }
586
- interface TaskSummary {
587
- taskId: string;
588
- title: string;
589
- status: string;
590
- createdAt: string;
591
- completedAt?: string | undefined;
592
- }
593
- interface SessionAnalysis {
594
- sessionId: string;
595
- totalDuration: number;
596
- toolUsageCount: Record<string, number>;
597
- errorCount: number;
598
- modeChanges: ModeChange[];
599
- tasks: TaskSummary[];
600
- }
601
- declare class SessionAnalyzer {
602
- analyze(events: SessionEvent[]): SessionAnalysis;
603
- query(events: SessionEvent[], filter: QueryFilter): SessionEvent[];
604
- private calcDuration;
605
- }
606
-
607
- interface SessionStoreOptions {
608
- dir: string;
609
- /**
610
- * Active project root used to revalidate persisted file-observation hashes
611
- * during resume. Omit for stores that only inspect/archive transcripts.
612
- */
613
- projectRoot?: string | undefined;
614
- /** Optional EventBus for emitting session diagnostics. */
615
- events?: EventBus | undefined;
616
- /**
617
- * Optional secret scrubber. When set, `user_input` and `llm_response` event
618
- * content is scrubbed before being persisted to the JSONL log and the
619
- * summary sidecar — so a secret a user pastes or the model echoes does not
620
- * sit in cleartext on disk (and does not ride along in history cloud-sync).
621
- * Tool output is already scrubbed upstream by the executor; this closes the
622
- * conversation-turn gap (finding F-06).
623
- */
624
- secretScrubber?: SecretScrubber | undefined;
625
- /**
626
- * Optional guard consulted by {@link DefaultSessionStore.delete} before
627
- * removing a session. Returns `true` if the session is currently in use by
628
- * any live process (e.g. it is the active session of another terminal, TUI,
629
- * or WebUI in this project). The store ALWAYS also checks `active.json`
630
- * directly; this callback widens the check to cross-process live sessions
631
- * via the SessionRegistry. When omitted, only the `active.json` check runs.
632
- * Resolves to a human-readable reason when in use, or `null` when safe.
633
- */
634
- isSessionInUse?: ((sessionId: string) => Promise<string | null>) | undefined;
635
- }
636
- declare class DefaultSessionStore implements SessionStore {
637
- private readonly dir;
638
- private readonly events?;
639
- private readonly secretScrubber?;
640
- private readonly projectRoot?;
641
- private readonly checkpointCas?;
642
- private readonly isSessionInUse?;
643
- /**
644
- * In-memory cache for load() results, keyed by session ID. The cache is
645
- * invalidated when the file's mtimeMs or size changes (indicating the
646
- * file was written to). This eliminates redundant full-file reads and
647
- * JSON parses when the same session is loaded multiple times within the
648
- * store's lifetime (e.g., webui session detail views, list() fallbacks).
649
- *
650
- * Max size is capped to prevent unbounded memory growth in long-running
651
- * processes. When the limit is reached, the oldest entry is evicted.
652
- */
653
- private readonly _loadCache;
654
- private _indexCache;
655
- private readonly shardManifestCache;
656
- private static readonly LOAD_CACHE_MAX_ENTRIES;
657
- private static readonly LIST_SCAN_CONCURRENCY;
658
- constructor(opts: SessionStoreOptions);
659
- /**
660
- * Clear the load() cache. Useful for testing or when the caller knows
661
- * the file has changed externally (e.g., another process wrote to it).
662
- */
663
- clearLoadCache(sessionId?: string): void;
664
- private emitRead;
665
- private emitWrite;
666
- private emitError;
667
- /** Absolute path to the session index file. */
668
- private get indexFile();
669
- /** Join session ID to its absolute path within the store directory. */
670
- private sessionPath;
671
- private shardManifestPath;
672
- private shardKeyForSessionId;
673
- private invalidateShardManifestBySessionId;
674
- /**
675
- * Ensure the directory implied by the session ID exists. When the ID
676
- * contains a date prefix like `2026-06-06/...`, this creates the date
677
- * subdirectory so sessions group naturally by day.
678
- */
679
- private ensureShardDir;
680
- create(meta: Omit<SessionMetadata, 'startedAt'>): Promise<SessionWriter>;
681
- fork(id: string, opts?: SessionForkOptions): Promise<ForkedSession>;
682
- materializeWorkspaceCheckpoint(checkpoint: WorkspaceCheckpointRef, targetRoot: string): Promise<WorkspaceMaterializationResult>;
683
- resume(id: string): Promise<ResumedSession>;
684
- load(id: string): Promise<SessionData>;
685
- /**
686
- * Fast-path loader that skips message reconstruction and adjacency repair.
687
- *
688
- * Use this for callers that only need the raw event stream + session
689
- * metadata — e.g. session listers, analytics, audit, and the TUI's
690
- * "events only" views. It avoids the message array build and
691
- * repairToolUseAdjacency cost on large session files (a long agent
692
- * run can have 50k+ events; rebuilding messages is O(events) and
693
- * allocates per-block, so skipping it is a meaningful win).
694
- *
695
- * The returned data.messages is an empty array; data.toolCallEnds
696
- * is computed from the raw events. usage is the sum across all
697
- * llm_response events — same as full load().
698
- */
699
- loadEventsOnly(id: string): Promise<SessionData>;
700
- private loadInternal;
701
- /**
702
- * Streaming search over a session's JSONL. Walks the file once, parses
703
- * each event lazily, and yields only the events that match `predicate`.
704
- * Stops as soon as `opts.limit` matches are collected.
705
- *
706
- * Why this exists: `load()` parses the entire file into memory and
707
- * rebuilds `messages`/`toolCallEnds` for every caller. `search()` only
708
- * needs to know which events contain matching text — a per-line
709
- * predicate is enough. The full parse work (and the `_loadCache` poll)
710
- * is wasted in that case.
711
- *
712
- * Memory: O(hits) regardless of file size. Disk: one linear scan,
713
- * terminated at `limit` if the caller asked for one.
714
- *
715
- * Errors: missing file yields []. Corrupt lines are skipped (same
716
- * policy as `load()`). Aborting via `signal` rejects with `AbortError`.
717
- */
718
- searchEvents(id: string, predicate: (event: SessionEvent, eventIndex: number, ts: string) => boolean, opts?: {
719
- limit?: number | undefined;
720
- signal?: AbortSignal | undefined;
721
- }): Promise<Array<{
722
- event: SessionEvent;
723
- eventIndex: number;
724
- ts: string;
725
- }>>;
726
- list(limit?: number): Promise<SessionSummary[]>;
727
- /**
728
- * List sessions matching filter criteria, using the cached index.
729
- * Filters are applied BEFORE sorting and slicing, so the caller gets
730
- * exactly `limit` matching sessions — not a slice of a larger fetch.
731
- *
732
- * This avoids the DefaultSessionReader pattern of fetching 1000 sessions
733
- * then linear-filtering: the index is already in memory (readIndex
734
- * caches it), and the filter runs over the cached array without any
735
- * additional disk I/O.
736
- */
737
- listFiltered(criteria: {
738
- since?: string | undefined;
739
- until?: string | undefined;
740
- provider?: string | undefined;
741
- model?: string | undefined;
742
- minTokens?: number | undefined;
743
- titleContains?: string | undefined;
744
- limit?: number | undefined;
745
- }): Promise<SessionSummary[]>;
746
- private indexAppendCount;
747
- private static readonly COMPACT_EVERY;
748
- /** Append a session summary to the index. */
749
- private appendToIndex;
750
- /** Append a tombstone entry for a deleted session. */
751
- private writeTombstone;
752
- /**
753
- * Compact the index: read all entries, drop tombstones, deduplicate
754
- * (keep latest per session), and rewrite atomically. Acquires the index
755
- * file lock so a concurrent append (this process or another wstack in the
756
- * same project) can't be overwritten by the rewrite.
757
- */
758
- private compactIndex;
759
- /**
760
- * Lock-free compaction body. The caller MUST already hold the index file
761
- * lock (via withFileLock(this.indexFile, ...)). Uses atomicWrite for the
762
- * rewrite so the temp file gets a random suffix (no collision between two
763
- * compactions) and the Windows transient-EPERM rename retry.
764
- */
765
- private compactIndexInner;
766
- /**
767
- * Read the index file and return deduplicated session summaries.
768
- * Entries with a matching tombstone are filtered out.
769
- * Returns empty array when the index doesn't exist or is corrupt.
770
- */
771
- private readIndex;
772
- /**
773
- * Rebuild the index from disk by scanning all sessions and writing a
774
- * fresh _index.jsonl. Useful after manual cleanup or index corruption.
775
- */
776
- rebuildIndex(): Promise<number>;
777
- private listFromDirectoryScan;
778
- private collectShardKeys;
779
- private readOrBuildShardManifest;
780
- private collectSessionFilesInShard;
781
- private collectSessionFiles;
782
- /** Recursively collect session IDs from date-shard subdirectories.
783
- * IDs include the date-prefix path (e.g. "2026-06-06/17-46-57Z_…").
784
- * Skips `.jsonl`/`.summary.json` root files, dot-files, and
785
- * sub-directories that belong to fleet/subagent sessions. */
786
- private collectSessionIds;
787
- private summaryFor;
788
- private readSummaryManifest;
789
- private summaryHeaderFor;
790
- /**
791
- * Delete a session and all associated files: JSONL, summary, plan/todos
792
- * sidecars, and the session directory (fleet.json, shared/, subagents/).
793
- *
794
- * Individual file deletions are best-effort (logged as structured warnings),
795
- * but a tombstone is always written so readIndex() filters this session out.
796
- * If the session directory itself can't be removed, the error is surfaced
797
- * to the caller so prune() can report it.
798
- */
799
- private deleteSession;
800
- /**
801
- * Read the session id currently marked active in `active.json`, or `null`
802
- * when the lock is absent/unreadable. Shared by {@link delete} and
803
- * {@link prune} to avoid clobbering a session a live process is writing to.
804
- */
805
- private readActiveSessionId;
806
- delete(id: string): Promise<void>;
807
- rename(id: string, name: string): Promise<SessionSummary>;
808
- prune(maxAgeDays?: number): Promise<number>;
809
- clearHistory(id: string): Promise<void>;
810
- private summarize;
811
- private iterSessionEvents;
812
- }
813
-
814
- /**
815
- * On-disk checkpoint for `ctx.todos`. Written atomically every time the
816
- * todo list changes, read once on session resume. This is the missing
817
- * piece that lets `wstack resume <id>` rehydrate where the previous run
818
- * stopped instead of starting with an empty board.
819
- *
820
- * Schema is intentionally small — a single JSON object so a future
821
- * format bump is easy. The `version` field is the only contract; the
822
- * shape under `todos` mirrors `TodoItem` so reading is a straight assign.
823
- */
824
- interface TodosCheckpointFile {
825
- version: 1;
826
- sessionId: string;
827
- updatedAt: string;
828
- todos: TodoItem[];
829
- }
830
- type TodosCheckpointDetach = () => Promise<void>;
831
- /** Read a checkpoint from disk. Returns null when the file doesn't
832
- * exist or is corrupt — callers treat both cases as "no prior state".
833
- */
834
- declare function loadTodosCheckpoint(filePath: string, events?: EventBus, traceId?: string): Promise<TodoItem[] | null>;
835
- /** Write the checkpoint atomically. Best-effort: a write failure is
836
- * logged but does not throw — losing one checkpoint shouldn't bring
837
- * down the agent run.
838
- */
839
- declare function saveTodosCheckpoint(filePath: string, sessionId: string, todos: readonly TodoItem[], events?: EventBus, traceId?: string): Promise<void>;
840
- /**
841
- * Subscribe a `ConversationState` so every `todos_replaced` mutation
842
- * triggers an atomic write to disk. Returns the unsubscribe function.
843
- *
844
- * Writes are debounced by 150ms so a flurry of edits (e.g. the LLM
845
- * marking three items done in the same tool call) coalesces into one
846
- * disk hit.
847
- */
848
- declare function attachTodosCheckpoint(state: ConversationState, filePath: string, sessionId: string, events?: EventBus, traceId?: string): TodosCheckpointDetach;
849
-
850
- export { type AbandonedSession as A, getPlanTemplate as B, type ConfigLoaderOptions as C, DEFAULT_CONFIG_MIGRATIONS as D, listPlanTemplates as E, FileMemoryBackend as F, loadPlan as G, loadTodosCheckpoint as H, mutatePlan as I, parseEntries as J, removePlanItem as K, runConfigMigrations as L, type MemoryBackend as M, savePlan as N, saveTodosCheckpoint as O, type PersistedQueueItem as P, QueueStore as Q, RecoveryLock as R, SessionAnalyzer as S, type TodosCheckpointFile as T, setPlanItemStatus as U, type AttachmentStoreOptions as a, type ConfigMigration as b, ConfigMigrationError as c, type ConfigSource as d, DefaultAttachmentStore as e, DefaultConfigLoader as f, DefaultConfigStore as g, DefaultMemoryStore as h, DefaultSessionStore as i, type FileMemoryBackendOptions as j, type MemoryStoreOptions as k, type MigrationContext as l, type MigrationResult as m, type PlanFile as n, type PlanItem as o, type PlanTemplate as p, type RecoveryLockOptions as q, type SessionStoreOptions as r, addPlanItem as s, attachPlanCheckpoint as t, attachTodosCheckpoint as u, clearPlan as v, deriveTodosFromPlanItem as w, emptyPlan as x, formatPlan as y, formatPlanTemplates as z };