attocode 0.2.3 → 0.2.5

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 (787) hide show
  1. package/CHANGELOG.md +122 -1
  2. package/README.md +65 -5
  3. package/dist/src/adapters.d.ts +2 -1
  4. package/dist/src/adapters.d.ts.map +1 -1
  5. package/dist/src/adapters.js +74 -12
  6. package/dist/src/adapters.js.map +1 -1
  7. package/dist/src/agent/agent-builder.d.ts +117 -0
  8. package/dist/src/agent/agent-builder.d.ts.map +1 -0
  9. package/dist/src/agent/agent-builder.js +204 -0
  10. package/dist/src/agent/agent-builder.js.map +1 -0
  11. package/dist/src/agent/feature-initializer.d.ts +80 -0
  12. package/dist/src/agent/feature-initializer.d.ts.map +1 -0
  13. package/dist/src/agent/feature-initializer.js +677 -0
  14. package/dist/src/agent/feature-initializer.js.map +1 -0
  15. package/dist/src/agent/index.d.ts +13 -0
  16. package/dist/src/agent/index.d.ts.map +1 -0
  17. package/dist/src/agent/index.js +13 -0
  18. package/dist/src/agent/index.js.map +1 -0
  19. package/dist/src/agent/message-builder.d.ts +50 -0
  20. package/dist/src/agent/message-builder.d.ts.map +1 -0
  21. package/dist/src/agent/message-builder.js +173 -0
  22. package/dist/src/agent/message-builder.js.map +1 -0
  23. package/dist/src/agent/session-api.d.ts +94 -0
  24. package/dist/src/agent/session-api.d.ts.map +1 -0
  25. package/dist/src/agent/session-api.js +262 -0
  26. package/dist/src/agent/session-api.js.map +1 -0
  27. package/dist/src/agent-tools/lsp-file-tools.d.ts +1 -1
  28. package/dist/src/agent-tools/lsp-file-tools.d.ts.map +1 -1
  29. package/dist/src/agent.d.ts +52 -213
  30. package/dist/src/agent.d.ts.map +1 -1
  31. package/dist/src/agent.js +544 -4072
  32. package/dist/src/agent.js.map +1 -1
  33. package/dist/src/cli.d.ts.map +1 -1
  34. package/dist/src/cli.js +2 -1
  35. package/dist/src/cli.js.map +1 -1
  36. package/dist/src/commands/handler.d.ts.map +1 -1
  37. package/dist/src/commands/handler.js +18 -9
  38. package/dist/src/commands/handler.js.map +1 -1
  39. package/dist/src/commands/init-commands.d.ts.map +1 -1
  40. package/dist/src/commands/init-commands.js +16 -1
  41. package/dist/src/commands/init-commands.js.map +1 -1
  42. package/dist/src/commands/init.d.ts.map +1 -1
  43. package/dist/src/commands/init.js +31 -0
  44. package/dist/src/commands/init.js.map +1 -1
  45. package/dist/src/config/base-types.d.ts +45 -0
  46. package/dist/src/config/base-types.d.ts.map +1 -0
  47. package/dist/src/config/base-types.js +9 -0
  48. package/dist/src/config/base-types.js.map +1 -0
  49. package/dist/src/config/config-manager.d.ts +35 -0
  50. package/dist/src/config/config-manager.d.ts.map +1 -0
  51. package/dist/src/config/config-manager.js +108 -0
  52. package/dist/src/config/config-manager.js.map +1 -0
  53. package/dist/src/config/index.d.ts +4 -0
  54. package/dist/src/config/index.d.ts.map +1 -0
  55. package/dist/src/config/index.js +3 -0
  56. package/dist/src/config/index.js.map +1 -0
  57. package/dist/src/config/schema.d.ts +1546 -0
  58. package/dist/src/config/schema.d.ts.map +1 -0
  59. package/dist/src/config/schema.js +268 -0
  60. package/dist/src/config/schema.js.map +1 -0
  61. package/dist/src/config.d.ts +4 -1
  62. package/dist/src/config.d.ts.map +1 -1
  63. package/dist/src/config.js +8 -12
  64. package/dist/src/config.js.map +1 -1
  65. package/dist/src/core/agent-state-machine.d.ts +131 -0
  66. package/dist/src/core/agent-state-machine.d.ts.map +1 -0
  67. package/dist/src/core/agent-state-machine.js +302 -0
  68. package/dist/src/core/agent-state-machine.js.map +1 -0
  69. package/dist/src/core/base-manager.d.ts +79 -0
  70. package/dist/src/core/base-manager.d.ts.map +1 -0
  71. package/dist/src/core/base-manager.js +170 -0
  72. package/dist/src/core/base-manager.js.map +1 -0
  73. package/dist/src/core/completion-analyzer.d.ts +15 -0
  74. package/dist/src/core/completion-analyzer.d.ts.map +1 -0
  75. package/dist/src/core/completion-analyzer.js +53 -0
  76. package/dist/src/core/completion-analyzer.js.map +1 -0
  77. package/dist/src/core/execution-loop.d.ts +46 -0
  78. package/dist/src/core/execution-loop.d.ts.map +1 -0
  79. package/dist/src/core/execution-loop.js +1397 -0
  80. package/dist/src/core/execution-loop.js.map +1 -0
  81. package/dist/src/core/index.d.ts +7 -0
  82. package/dist/src/core/index.d.ts.map +1 -1
  83. package/dist/src/core/index.js +9 -0
  84. package/dist/src/core/index.js.map +1 -1
  85. package/dist/src/core/process-handlers.d.ts.map +1 -1
  86. package/dist/src/core/process-handlers.js +14 -0
  87. package/dist/src/core/process-handlers.js.map +1 -1
  88. package/dist/src/core/protocol/types.d.ts +12 -12
  89. package/dist/src/core/response-handler.d.ts +16 -0
  90. package/dist/src/core/response-handler.d.ts.map +1 -0
  91. package/dist/src/core/response-handler.js +235 -0
  92. package/dist/src/core/response-handler.js.map +1 -0
  93. package/dist/src/core/subagent-spawner.d.ts +43 -0
  94. package/dist/src/core/subagent-spawner.d.ts.map +1 -0
  95. package/dist/src/core/subagent-spawner.js +973 -0
  96. package/dist/src/core/subagent-spawner.js.map +1 -0
  97. package/dist/src/core/tool-executor.d.ts +59 -0
  98. package/dist/src/core/tool-executor.d.ts.map +1 -0
  99. package/dist/src/core/tool-executor.js +682 -0
  100. package/dist/src/core/tool-executor.js.map +1 -0
  101. package/dist/src/core/types.d.ts +134 -0
  102. package/dist/src/core/types.d.ts.map +1 -0
  103. package/dist/src/core/types.js +12 -0
  104. package/dist/src/core/types.js.map +1 -0
  105. package/dist/src/defaults.d.ts +2 -2
  106. package/dist/src/defaults.d.ts.map +1 -1
  107. package/dist/src/defaults.js +29 -1
  108. package/dist/src/defaults.js.map +1 -1
  109. package/dist/src/integrations/agents/agent-registry.d.ts +262 -0
  110. package/dist/src/integrations/agents/agent-registry.d.ts.map +1 -0
  111. package/dist/src/integrations/agents/agent-registry.js +686 -0
  112. package/dist/src/integrations/agents/agent-registry.js.map +1 -0
  113. package/dist/src/integrations/agents/async-subagent.d.ts +135 -0
  114. package/dist/src/integrations/agents/async-subagent.d.ts.map +1 -0
  115. package/dist/src/integrations/agents/async-subagent.js +213 -0
  116. package/dist/src/integrations/agents/async-subagent.js.map +1 -0
  117. package/dist/src/integrations/agents/complexity-classifier.d.ts +86 -0
  118. package/dist/src/integrations/agents/complexity-classifier.d.ts.map +1 -0
  119. package/dist/src/integrations/agents/complexity-classifier.js +233 -0
  120. package/dist/src/integrations/agents/complexity-classifier.js.map +1 -0
  121. package/dist/src/integrations/agents/delegation-protocol.d.ts +86 -0
  122. package/dist/src/integrations/agents/delegation-protocol.d.ts.map +1 -0
  123. package/dist/src/integrations/agents/delegation-protocol.js +127 -0
  124. package/dist/src/integrations/agents/delegation-protocol.js.map +1 -0
  125. package/dist/src/integrations/agents/multi-agent.d.ts +150 -0
  126. package/dist/src/integrations/agents/multi-agent.d.ts.map +1 -0
  127. package/dist/src/integrations/agents/multi-agent.js +306 -0
  128. package/dist/src/integrations/agents/multi-agent.js.map +1 -0
  129. package/dist/src/integrations/agents/result-synthesizer.d.ts +389 -0
  130. package/dist/src/integrations/agents/result-synthesizer.d.ts.map +1 -0
  131. package/dist/src/integrations/agents/result-synthesizer.js +951 -0
  132. package/dist/src/integrations/agents/result-synthesizer.js.map +1 -0
  133. package/dist/src/integrations/agents/shared-blackboard.d.ts +406 -0
  134. package/dist/src/integrations/agents/shared-blackboard.d.ts.map +1 -0
  135. package/dist/src/integrations/agents/shared-blackboard.js +757 -0
  136. package/dist/src/integrations/agents/shared-blackboard.js.map +1 -0
  137. package/dist/src/integrations/agents/subagent-output-store.d.ts +91 -0
  138. package/dist/src/integrations/agents/subagent-output-store.d.ts.map +1 -0
  139. package/dist/src/integrations/agents/subagent-output-store.js +257 -0
  140. package/dist/src/integrations/agents/subagent-output-store.js.map +1 -0
  141. package/dist/src/integrations/auto-compaction.d.ts.map +1 -1
  142. package/dist/src/integrations/auto-compaction.js +3 -2
  143. package/dist/src/integrations/auto-compaction.js.map +1 -1
  144. package/dist/src/integrations/budget/budget-pool.d.ts +115 -0
  145. package/dist/src/integrations/budget/budget-pool.d.ts.map +1 -0
  146. package/dist/src/integrations/budget/budget-pool.js +205 -0
  147. package/dist/src/integrations/budget/budget-pool.js.map +1 -0
  148. package/dist/src/integrations/budget/cancellation.d.ts +229 -0
  149. package/dist/src/integrations/budget/cancellation.d.ts.map +1 -0
  150. package/dist/src/integrations/budget/cancellation.js +520 -0
  151. package/dist/src/integrations/budget/cancellation.js.map +1 -0
  152. package/dist/src/integrations/budget/dynamic-budget.d.ts +81 -0
  153. package/dist/src/integrations/budget/dynamic-budget.d.ts.map +1 -0
  154. package/dist/src/integrations/budget/dynamic-budget.js +151 -0
  155. package/dist/src/integrations/budget/dynamic-budget.js.map +1 -0
  156. package/dist/src/integrations/budget/economics.d.ts +435 -0
  157. package/dist/src/integrations/budget/economics.d.ts.map +1 -0
  158. package/dist/src/integrations/budget/economics.js +1007 -0
  159. package/dist/src/integrations/budget/economics.js.map +1 -0
  160. package/dist/src/integrations/budget/injection-budget.d.ts +71 -0
  161. package/dist/src/integrations/budget/injection-budget.d.ts.map +1 -0
  162. package/dist/src/integrations/budget/injection-budget.js +137 -0
  163. package/dist/src/integrations/budget/injection-budget.js.map +1 -0
  164. package/dist/src/integrations/budget/loop-detector.d.ts +105 -0
  165. package/dist/src/integrations/budget/loop-detector.d.ts.map +1 -0
  166. package/dist/src/integrations/budget/loop-detector.js +287 -0
  167. package/dist/src/integrations/budget/loop-detector.js.map +1 -0
  168. package/dist/src/integrations/budget/phase-tracker.d.ts +114 -0
  169. package/dist/src/integrations/budget/phase-tracker.d.ts.map +1 -0
  170. package/dist/src/integrations/budget/phase-tracker.js +262 -0
  171. package/dist/src/integrations/budget/phase-tracker.js.map +1 -0
  172. package/dist/src/integrations/budget/resources.d.ts +182 -0
  173. package/dist/src/integrations/budget/resources.d.ts.map +1 -0
  174. package/dist/src/integrations/budget/resources.js +318 -0
  175. package/dist/src/integrations/budget/resources.js.map +1 -0
  176. package/dist/src/integrations/budget-pool.d.ts +7 -0
  177. package/dist/src/integrations/budget-pool.d.ts.map +1 -1
  178. package/dist/src/integrations/budget-pool.js +43 -0
  179. package/dist/src/integrations/budget-pool.js.map +1 -1
  180. package/dist/src/integrations/codebase-ast.d.ts +52 -0
  181. package/dist/src/integrations/codebase-ast.d.ts.map +1 -0
  182. package/dist/src/integrations/codebase-ast.js +457 -0
  183. package/dist/src/integrations/codebase-ast.js.map +1 -0
  184. package/dist/src/integrations/codebase-context.d.ts +18 -0
  185. package/dist/src/integrations/codebase-context.d.ts.map +1 -1
  186. package/dist/src/integrations/codebase-context.js +197 -17
  187. package/dist/src/integrations/codebase-context.js.map +1 -1
  188. package/dist/src/integrations/compaction.d.ts.map +1 -1
  189. package/dist/src/integrations/compaction.js +14 -6
  190. package/dist/src/integrations/compaction.js.map +1 -1
  191. package/dist/src/integrations/context/auto-compaction.d.ts +210 -0
  192. package/dist/src/integrations/context/auto-compaction.d.ts.map +1 -0
  193. package/dist/src/integrations/context/auto-compaction.js +477 -0
  194. package/dist/src/integrations/context/auto-compaction.js.map +1 -0
  195. package/dist/src/integrations/context/code-analyzer.d.ts +71 -0
  196. package/dist/src/integrations/context/code-analyzer.d.ts.map +1 -0
  197. package/dist/src/integrations/context/code-analyzer.js +448 -0
  198. package/dist/src/integrations/context/code-analyzer.js.map +1 -0
  199. package/dist/src/integrations/context/code-selector.d.ts +78 -0
  200. package/dist/src/integrations/context/code-selector.d.ts.map +1 -0
  201. package/dist/src/integrations/context/code-selector.js +649 -0
  202. package/dist/src/integrations/context/code-selector.js.map +1 -0
  203. package/dist/src/integrations/context/codebase-ast.d.ts +138 -0
  204. package/dist/src/integrations/context/codebase-ast.d.ts.map +1 -0
  205. package/dist/src/integrations/context/codebase-ast.js +818 -0
  206. package/dist/src/integrations/context/codebase-ast.js.map +1 -0
  207. package/dist/src/integrations/context/codebase-context.d.ts +473 -0
  208. package/dist/src/integrations/context/codebase-context.d.ts.map +1 -0
  209. package/dist/src/integrations/context/codebase-context.js +685 -0
  210. package/dist/src/integrations/context/codebase-context.js.map +1 -0
  211. package/dist/src/integrations/context/compaction.d.ts +191 -0
  212. package/dist/src/integrations/context/compaction.d.ts.map +1 -0
  213. package/dist/src/integrations/context/compaction.js +384 -0
  214. package/dist/src/integrations/context/compaction.js.map +1 -0
  215. package/dist/src/integrations/context/context-engineering.d.ts +274 -0
  216. package/dist/src/integrations/context/context-engineering.d.ts.map +1 -0
  217. package/dist/src/integrations/context/context-engineering.js +437 -0
  218. package/dist/src/integrations/context/context-engineering.js.map +1 -0
  219. package/dist/src/integrations/context/file-cache.d.ts +97 -0
  220. package/dist/src/integrations/context/file-cache.d.ts.map +1 -0
  221. package/dist/src/integrations/context/file-cache.js +218 -0
  222. package/dist/src/integrations/context/file-cache.js.map +1 -0
  223. package/dist/src/integrations/context/semantic-cache.d.ts +178 -0
  224. package/dist/src/integrations/context/semantic-cache.d.ts.map +1 -0
  225. package/dist/src/integrations/context/semantic-cache.js +372 -0
  226. package/dist/src/integrations/context/semantic-cache.js.map +1 -0
  227. package/dist/src/integrations/context-engineering.d.ts +8 -0
  228. package/dist/src/integrations/context-engineering.d.ts.map +1 -1
  229. package/dist/src/integrations/context-engineering.js +19 -0
  230. package/dist/src/integrations/context-engineering.js.map +1 -1
  231. package/dist/src/integrations/economics.d.ts +25 -1
  232. package/dist/src/integrations/economics.d.ts.map +1 -1
  233. package/dist/src/integrations/economics.js +217 -38
  234. package/dist/src/integrations/economics.js.map +1 -1
  235. package/dist/src/integrations/edit-validator.d.ts +30 -0
  236. package/dist/src/integrations/edit-validator.d.ts.map +1 -0
  237. package/dist/src/integrations/edit-validator.js +85 -0
  238. package/dist/src/integrations/edit-validator.js.map +1 -0
  239. package/dist/src/integrations/file-cache.d.ts +7 -0
  240. package/dist/src/integrations/file-cache.d.ts.map +1 -1
  241. package/dist/src/integrations/file-cache.js +54 -0
  242. package/dist/src/integrations/file-cache.js.map +1 -1
  243. package/dist/src/integrations/health-check.d.ts.map +1 -1
  244. package/dist/src/integrations/health-check.js +3 -2
  245. package/dist/src/integrations/health-check.js.map +1 -1
  246. package/dist/src/integrations/hierarchical-config.d.ts +3 -0
  247. package/dist/src/integrations/hierarchical-config.d.ts.map +1 -1
  248. package/dist/src/integrations/hierarchical-config.js +3 -0
  249. package/dist/src/integrations/hierarchical-config.js.map +1 -1
  250. package/dist/src/integrations/hooks.d.ts +2 -0
  251. package/dist/src/integrations/hooks.d.ts.map +1 -1
  252. package/dist/src/integrations/hooks.js +99 -15
  253. package/dist/src/integrations/hooks.js.map +1 -1
  254. package/dist/src/integrations/index.d.ts +77 -66
  255. package/dist/src/integrations/index.d.ts.map +1 -1
  256. package/dist/src/integrations/index.js +83 -67
  257. package/dist/src/integrations/index.js.map +1 -1
  258. package/dist/src/integrations/logger.d.ts +104 -0
  259. package/dist/src/integrations/logger.d.ts.map +1 -0
  260. package/dist/src/integrations/logger.js +219 -0
  261. package/dist/src/integrations/logger.js.map +1 -0
  262. package/dist/src/integrations/lsp/lsp.d.ts +196 -0
  263. package/dist/src/integrations/lsp/lsp.d.ts.map +1 -0
  264. package/dist/src/integrations/lsp/lsp.js +583 -0
  265. package/dist/src/integrations/lsp/lsp.js.map +1 -0
  266. package/dist/src/integrations/lsp.d.ts.map +1 -1
  267. package/dist/src/integrations/lsp.js +5 -4
  268. package/dist/src/integrations/lsp.js.map +1 -1
  269. package/dist/src/integrations/mcp/mcp-client.d.ts +279 -0
  270. package/dist/src/integrations/mcp/mcp-client.d.ts.map +1 -0
  271. package/dist/src/integrations/mcp/mcp-client.js +755 -0
  272. package/dist/src/integrations/mcp/mcp-client.js.map +1 -0
  273. package/dist/src/integrations/mcp/mcp-custom-tools.d.ts +102 -0
  274. package/dist/src/integrations/mcp/mcp-custom-tools.d.ts.map +1 -0
  275. package/dist/src/integrations/mcp/mcp-custom-tools.js +232 -0
  276. package/dist/src/integrations/mcp/mcp-custom-tools.js.map +1 -0
  277. package/dist/src/integrations/mcp/mcp-tool-search.d.ts +77 -0
  278. package/dist/src/integrations/mcp/mcp-tool-search.d.ts.map +1 -0
  279. package/dist/src/integrations/mcp/mcp-tool-search.js +220 -0
  280. package/dist/src/integrations/mcp/mcp-tool-search.js.map +1 -0
  281. package/dist/src/integrations/mcp/mcp-tool-validator.d.ts +60 -0
  282. package/dist/src/integrations/mcp/mcp-tool-validator.d.ts.map +1 -0
  283. package/dist/src/integrations/mcp/mcp-tool-validator.js +141 -0
  284. package/dist/src/integrations/mcp/mcp-tool-validator.js.map +1 -0
  285. package/dist/src/integrations/mcp-client.d.ts.map +1 -1
  286. package/dist/src/integrations/mcp-client.js +8 -7
  287. package/dist/src/integrations/mcp-client.js.map +1 -1
  288. package/dist/src/integrations/observability.d.ts.map +1 -1
  289. package/dist/src/integrations/observability.js +5 -4
  290. package/dist/src/integrations/observability.js.map +1 -1
  291. package/dist/src/integrations/openrouter-pricing.d.ts.map +1 -1
  292. package/dist/src/integrations/openrouter-pricing.js +4 -3
  293. package/dist/src/integrations/openrouter-pricing.js.map +1 -1
  294. package/dist/src/integrations/persistence/codebase-repository.d.ts +45 -0
  295. package/dist/src/integrations/persistence/codebase-repository.d.ts.map +1 -0
  296. package/dist/src/integrations/persistence/codebase-repository.js +81 -0
  297. package/dist/src/integrations/persistence/codebase-repository.js.map +1 -0
  298. package/dist/src/integrations/persistence/goal-repository.d.ts +71 -0
  299. package/dist/src/integrations/persistence/goal-repository.d.ts.map +1 -0
  300. package/dist/src/integrations/persistence/goal-repository.js +184 -0
  301. package/dist/src/integrations/persistence/goal-repository.js.map +1 -0
  302. package/dist/src/integrations/persistence/history.d.ts +72 -0
  303. package/dist/src/integrations/persistence/history.d.ts.map +1 -0
  304. package/dist/src/integrations/persistence/history.js +165 -0
  305. package/dist/src/integrations/persistence/history.js.map +1 -0
  306. package/dist/src/integrations/persistence/persistence.d.ts +49 -0
  307. package/dist/src/integrations/persistence/persistence.d.ts.map +1 -0
  308. package/dist/src/integrations/persistence/persistence.js +197 -0
  309. package/dist/src/integrations/persistence/persistence.js.map +1 -0
  310. package/dist/src/integrations/persistence/session-repository.d.ts +212 -0
  311. package/dist/src/integrations/persistence/session-repository.d.ts.map +1 -0
  312. package/dist/src/integrations/persistence/session-repository.js +770 -0
  313. package/dist/src/integrations/persistence/session-repository.js.map +1 -0
  314. package/dist/src/integrations/persistence/session-store.d.ts +184 -0
  315. package/dist/src/integrations/persistence/session-store.d.ts.map +1 -0
  316. package/dist/src/integrations/persistence/session-store.js +346 -0
  317. package/dist/src/integrations/persistence/session-store.js.map +1 -0
  318. package/dist/src/integrations/persistence/sqlite-store.d.ts +453 -0
  319. package/dist/src/integrations/persistence/sqlite-store.d.ts.map +1 -0
  320. package/dist/src/integrations/persistence/sqlite-store.js +676 -0
  321. package/dist/src/integrations/persistence/sqlite-store.js.map +1 -0
  322. package/dist/src/integrations/persistence/worker-repository.d.ts +65 -0
  323. package/dist/src/integrations/persistence/worker-repository.d.ts.map +1 -0
  324. package/dist/src/integrations/persistence/worker-repository.js +183 -0
  325. package/dist/src/integrations/persistence/worker-repository.js.map +1 -0
  326. package/dist/src/integrations/persistence.d.ts.map +1 -1
  327. package/dist/src/integrations/persistence.js +5 -4
  328. package/dist/src/integrations/persistence.js.map +1 -1
  329. package/dist/src/integrations/planning.d.ts.map +1 -1
  330. package/dist/src/integrations/planning.js +5 -4
  331. package/dist/src/integrations/planning.js.map +1 -1
  332. package/dist/src/integrations/quality/auto-checkpoint.d.ts +98 -0
  333. package/dist/src/integrations/quality/auto-checkpoint.d.ts.map +1 -0
  334. package/dist/src/integrations/quality/auto-checkpoint.js +252 -0
  335. package/dist/src/integrations/quality/auto-checkpoint.js.map +1 -0
  336. package/dist/src/integrations/quality/dead-letter-queue.d.ts +233 -0
  337. package/dist/src/integrations/quality/dead-letter-queue.d.ts.map +1 -0
  338. package/dist/src/integrations/quality/dead-letter-queue.js +543 -0
  339. package/dist/src/integrations/quality/dead-letter-queue.js.map +1 -0
  340. package/dist/src/integrations/quality/health-check.d.ts +218 -0
  341. package/dist/src/integrations/quality/health-check.d.ts.map +1 -0
  342. package/dist/src/integrations/quality/health-check.js +415 -0
  343. package/dist/src/integrations/quality/health-check.js.map +1 -0
  344. package/dist/src/integrations/quality/learning-store.d.ts +291 -0
  345. package/dist/src/integrations/quality/learning-store.d.ts.map +1 -0
  346. package/dist/src/integrations/quality/learning-store.js +646 -0
  347. package/dist/src/integrations/quality/learning-store.js.map +1 -0
  348. package/dist/src/integrations/quality/self-improvement.d.ts +90 -0
  349. package/dist/src/integrations/quality/self-improvement.d.ts.map +1 -0
  350. package/dist/src/integrations/quality/self-improvement.js +229 -0
  351. package/dist/src/integrations/quality/self-improvement.js.map +1 -0
  352. package/dist/src/integrations/quality/tool-recommendation.d.ts +61 -0
  353. package/dist/src/integrations/quality/tool-recommendation.d.ts.map +1 -0
  354. package/dist/src/integrations/quality/tool-recommendation.js +268 -0
  355. package/dist/src/integrations/quality/tool-recommendation.js.map +1 -0
  356. package/dist/src/integrations/retry.d.ts +1 -0
  357. package/dist/src/integrations/retry.d.ts.map +1 -1
  358. package/dist/src/integrations/retry.js.map +1 -1
  359. package/dist/src/integrations/routing.d.ts.map +1 -1
  360. package/dist/src/integrations/routing.js +2 -1
  361. package/dist/src/integrations/routing.js.map +1 -1
  362. package/dist/src/integrations/safety/bash-policy.d.ts +33 -0
  363. package/dist/src/integrations/safety/bash-policy.d.ts.map +1 -0
  364. package/dist/src/integrations/safety/bash-policy.js +144 -0
  365. package/dist/src/integrations/safety/bash-policy.js.map +1 -0
  366. package/dist/src/integrations/safety/edit-validator.d.ts +30 -0
  367. package/dist/src/integrations/safety/edit-validator.d.ts.map +1 -0
  368. package/dist/src/integrations/safety/edit-validator.js +87 -0
  369. package/dist/src/integrations/safety/edit-validator.js.map +1 -0
  370. package/dist/src/integrations/safety/execution-policy.d.ts +189 -0
  371. package/dist/src/integrations/safety/execution-policy.d.ts.map +1 -0
  372. package/dist/src/integrations/safety/execution-policy.js +352 -0
  373. package/dist/src/integrations/safety/execution-policy.js.map +1 -0
  374. package/dist/src/integrations/safety/policy-engine.d.ts +55 -0
  375. package/dist/src/integrations/safety/policy-engine.d.ts.map +1 -0
  376. package/dist/src/integrations/safety/policy-engine.js +247 -0
  377. package/dist/src/integrations/safety/policy-engine.js.map +1 -0
  378. package/dist/src/integrations/safety/safety.d.ts +174 -0
  379. package/dist/src/integrations/safety/safety.d.ts.map +1 -0
  380. package/dist/src/integrations/safety/safety.js +470 -0
  381. package/dist/src/integrations/safety/safety.js.map +1 -0
  382. package/dist/src/integrations/safety/sandbox/basic.d.ts +81 -0
  383. package/dist/src/integrations/safety/sandbox/basic.d.ts.map +1 -0
  384. package/dist/src/integrations/safety/sandbox/basic.js +335 -0
  385. package/dist/src/integrations/safety/sandbox/basic.js.map +1 -0
  386. package/dist/src/integrations/safety/sandbox/docker.d.ts +94 -0
  387. package/dist/src/integrations/safety/sandbox/docker.d.ts.map +1 -0
  388. package/dist/src/integrations/safety/sandbox/docker.js +294 -0
  389. package/dist/src/integrations/safety/sandbox/docker.js.map +1 -0
  390. package/dist/src/integrations/safety/sandbox/index.d.ts +188 -0
  391. package/dist/src/integrations/safety/sandbox/index.d.ts.map +1 -0
  392. package/dist/src/integrations/safety/sandbox/index.js +386 -0
  393. package/dist/src/integrations/safety/sandbox/index.js.map +1 -0
  394. package/dist/src/integrations/safety/sandbox/landlock.d.ts +59 -0
  395. package/dist/src/integrations/safety/sandbox/landlock.d.ts.map +1 -0
  396. package/dist/src/integrations/safety/sandbox/landlock.js +329 -0
  397. package/dist/src/integrations/safety/sandbox/landlock.js.map +1 -0
  398. package/dist/src/integrations/safety/sandbox/seatbelt.d.ts +68 -0
  399. package/dist/src/integrations/safety/sandbox/seatbelt.d.ts.map +1 -0
  400. package/dist/src/integrations/safety/sandbox/seatbelt.js +298 -0
  401. package/dist/src/integrations/safety/sandbox/seatbelt.js.map +1 -0
  402. package/dist/src/integrations/safety/type-checker.d.ts +53 -0
  403. package/dist/src/integrations/safety/type-checker.d.ts.map +1 -0
  404. package/dist/src/integrations/safety/type-checker.js +142 -0
  405. package/dist/src/integrations/safety/type-checker.js.map +1 -0
  406. package/dist/src/integrations/safety.d.ts.map +1 -1
  407. package/dist/src/integrations/safety.js +13 -13
  408. package/dist/src/integrations/safety.js.map +1 -1
  409. package/dist/src/integrations/sandbox/docker.d.ts.map +1 -1
  410. package/dist/src/integrations/sandbox/docker.js +2 -1
  411. package/dist/src/integrations/sandbox/docker.js.map +1 -1
  412. package/dist/src/integrations/sandbox/index.d.ts.map +1 -1
  413. package/dist/src/integrations/sandbox/index.js +5 -4
  414. package/dist/src/integrations/sandbox/index.js.map +1 -1
  415. package/dist/src/integrations/session-store.d.ts +1 -0
  416. package/dist/src/integrations/session-store.d.ts.map +1 -1
  417. package/dist/src/integrations/session-store.js +1 -0
  418. package/dist/src/integrations/session-store.js.map +1 -1
  419. package/dist/src/integrations/shared-blackboard.d.ts +3 -0
  420. package/dist/src/integrations/shared-blackboard.d.ts.map +1 -1
  421. package/dist/src/integrations/shared-blackboard.js +47 -0
  422. package/dist/src/integrations/shared-blackboard.js.map +1 -1
  423. package/dist/src/integrations/skills/skill-executor.d.ts +113 -0
  424. package/dist/src/integrations/skills/skill-executor.d.ts.map +1 -0
  425. package/dist/src/integrations/skills/skill-executor.js +270 -0
  426. package/dist/src/integrations/skills/skill-executor.js.map +1 -0
  427. package/dist/src/integrations/skills/skills.d.ts +262 -0
  428. package/dist/src/integrations/skills/skills.d.ts.map +1 -0
  429. package/dist/src/integrations/skills/skills.js +602 -0
  430. package/dist/src/integrations/skills/skills.js.map +1 -0
  431. package/dist/src/integrations/smart-decomposer.d.ts +27 -0
  432. package/dist/src/integrations/smart-decomposer.d.ts.map +1 -1
  433. package/dist/src/integrations/smart-decomposer.js +414 -30
  434. package/dist/src/integrations/smart-decomposer.js.map +1 -1
  435. package/dist/src/integrations/sqlite-store.d.ts +2 -0
  436. package/dist/src/integrations/sqlite-store.d.ts.map +1 -1
  437. package/dist/src/integrations/sqlite-store.js +18 -6
  438. package/dist/src/integrations/sqlite-store.js.map +1 -1
  439. package/dist/src/integrations/streaming/pty-shell.d.ts +169 -0
  440. package/dist/src/integrations/streaming/pty-shell.d.ts.map +1 -0
  441. package/dist/src/integrations/streaming/pty-shell.js +367 -0
  442. package/dist/src/integrations/streaming/pty-shell.js.map +1 -0
  443. package/dist/src/integrations/streaming/streaming.d.ts +102 -0
  444. package/dist/src/integrations/streaming/streaming.d.ts.map +1 -0
  445. package/dist/src/integrations/streaming/streaming.js +362 -0
  446. package/dist/src/integrations/streaming/streaming.js.map +1 -0
  447. package/dist/src/integrations/swarm/failure-classifier.d.ts +11 -0
  448. package/dist/src/integrations/swarm/failure-classifier.d.ts.map +1 -0
  449. package/dist/src/integrations/swarm/failure-classifier.js +95 -0
  450. package/dist/src/integrations/swarm/failure-classifier.js.map +1 -0
  451. package/dist/src/integrations/swarm/index.d.ts +2 -1
  452. package/dist/src/integrations/swarm/index.d.ts.map +1 -1
  453. package/dist/src/integrations/swarm/index.js +2 -0
  454. package/dist/src/integrations/swarm/index.js.map +1 -1
  455. package/dist/src/integrations/swarm/model-selector.d.ts.map +1 -1
  456. package/dist/src/integrations/swarm/model-selector.js +2 -1
  457. package/dist/src/integrations/swarm/model-selector.js.map +1 -1
  458. package/dist/src/integrations/swarm/swarm-budget.d.ts +1 -1
  459. package/dist/src/integrations/swarm/swarm-budget.d.ts.map +1 -1
  460. package/dist/src/integrations/swarm/swarm-budget.js +1 -1
  461. package/dist/src/integrations/swarm/swarm-budget.js.map +1 -1
  462. package/dist/src/integrations/swarm/swarm-config-loader.d.ts +8 -0
  463. package/dist/src/integrations/swarm/swarm-config-loader.d.ts.map +1 -1
  464. package/dist/src/integrations/swarm/swarm-config-loader.js +102 -0
  465. package/dist/src/integrations/swarm/swarm-config-loader.js.map +1 -1
  466. package/dist/src/integrations/swarm/swarm-event-bridge.d.ts +74 -0
  467. package/dist/src/integrations/swarm/swarm-event-bridge.d.ts.map +1 -1
  468. package/dist/src/integrations/swarm/swarm-event-bridge.js +37 -0
  469. package/dist/src/integrations/swarm/swarm-event-bridge.js.map +1 -1
  470. package/dist/src/integrations/swarm/swarm-events.d.ts +4 -1
  471. package/dist/src/integrations/swarm/swarm-events.d.ts.map +1 -1
  472. package/dist/src/integrations/swarm/swarm-events.js +1 -1
  473. package/dist/src/integrations/swarm/swarm-events.js.map +1 -1
  474. package/dist/src/integrations/swarm/swarm-execution.d.ts +27 -0
  475. package/dist/src/integrations/swarm/swarm-execution.d.ts.map +1 -0
  476. package/dist/src/integrations/swarm/swarm-execution.js +1021 -0
  477. package/dist/src/integrations/swarm/swarm-execution.js.map +1 -0
  478. package/dist/src/integrations/swarm/swarm-helpers.d.ts +26 -0
  479. package/dist/src/integrations/swarm/swarm-helpers.d.ts.map +1 -0
  480. package/dist/src/integrations/swarm/swarm-helpers.js +95 -0
  481. package/dist/src/integrations/swarm/swarm-helpers.js.map +1 -0
  482. package/dist/src/integrations/swarm/swarm-lifecycle.d.ts +100 -0
  483. package/dist/src/integrations/swarm/swarm-lifecycle.d.ts.map +1 -0
  484. package/dist/src/integrations/swarm/swarm-lifecycle.js +922 -0
  485. package/dist/src/integrations/swarm/swarm-lifecycle.js.map +1 -0
  486. package/dist/src/integrations/swarm/swarm-orchestrator.d.ts +96 -192
  487. package/dist/src/integrations/swarm/swarm-orchestrator.d.ts.map +1 -1
  488. package/dist/src/integrations/swarm/swarm-orchestrator.js +384 -2528
  489. package/dist/src/integrations/swarm/swarm-orchestrator.js.map +1 -1
  490. package/dist/src/integrations/swarm/swarm-quality-gate.js +1 -1
  491. package/dist/src/integrations/swarm/swarm-quality-gate.js.map +1 -1
  492. package/dist/src/integrations/swarm/swarm-recovery.d.ts +75 -0
  493. package/dist/src/integrations/swarm/swarm-recovery.d.ts.map +1 -0
  494. package/dist/src/integrations/swarm/swarm-recovery.js +550 -0
  495. package/dist/src/integrations/swarm/swarm-recovery.js.map +1 -0
  496. package/dist/src/integrations/swarm/swarm-state-store.d.ts +4 -1
  497. package/dist/src/integrations/swarm/swarm-state-store.d.ts.map +1 -1
  498. package/dist/src/integrations/swarm/swarm-state-store.js +14 -1
  499. package/dist/src/integrations/swarm/swarm-state-store.js.map +1 -1
  500. package/dist/src/integrations/swarm/task-queue.d.ts +11 -1
  501. package/dist/src/integrations/swarm/task-queue.d.ts.map +1 -1
  502. package/dist/src/integrations/swarm/task-queue.js +64 -2
  503. package/dist/src/integrations/swarm/task-queue.js.map +1 -1
  504. package/dist/src/integrations/swarm/types.d.ts +57 -4
  505. package/dist/src/integrations/swarm/types.d.ts.map +1 -1
  506. package/dist/src/integrations/swarm/types.js +9 -0
  507. package/dist/src/integrations/swarm/types.js.map +1 -1
  508. package/dist/src/integrations/swarm/worker-pool.d.ts +13 -3
  509. package/dist/src/integrations/swarm/worker-pool.d.ts.map +1 -1
  510. package/dist/src/integrations/swarm/worker-pool.js +66 -13
  511. package/dist/src/integrations/swarm/worker-pool.js.map +1 -1
  512. package/dist/src/integrations/task-manager.d.ts +33 -1
  513. package/dist/src/integrations/task-manager.d.ts.map +1 -1
  514. package/dist/src/integrations/task-manager.js +78 -4
  515. package/dist/src/integrations/task-manager.js.map +1 -1
  516. package/dist/src/integrations/tasks/dependency-analyzer.d.ts +34 -0
  517. package/dist/src/integrations/tasks/dependency-analyzer.d.ts.map +1 -0
  518. package/dist/src/integrations/tasks/dependency-analyzer.js +232 -0
  519. package/dist/src/integrations/tasks/dependency-analyzer.js.map +1 -0
  520. package/dist/src/integrations/tasks/interactive-planning.d.ts +322 -0
  521. package/dist/src/integrations/tasks/interactive-planning.d.ts.map +1 -0
  522. package/dist/src/integrations/tasks/interactive-planning.js +655 -0
  523. package/dist/src/integrations/tasks/interactive-planning.js.map +1 -0
  524. package/dist/src/integrations/tasks/pending-plan.d.ts +196 -0
  525. package/dist/src/integrations/tasks/pending-plan.d.ts.map +1 -0
  526. package/dist/src/integrations/tasks/pending-plan.js +431 -0
  527. package/dist/src/integrations/tasks/pending-plan.js.map +1 -0
  528. package/dist/src/integrations/tasks/planning.d.ts +115 -0
  529. package/dist/src/integrations/tasks/planning.d.ts.map +1 -0
  530. package/dist/src/integrations/tasks/planning.js +413 -0
  531. package/dist/src/integrations/tasks/planning.js.map +1 -0
  532. package/dist/src/integrations/tasks/smart-decomposer.d.ts +316 -0
  533. package/dist/src/integrations/tasks/smart-decomposer.d.ts.map +1 -0
  534. package/dist/src/integrations/tasks/smart-decomposer.js +661 -0
  535. package/dist/src/integrations/tasks/smart-decomposer.js.map +1 -0
  536. package/dist/src/integrations/tasks/task-manager.d.ts +164 -0
  537. package/dist/src/integrations/tasks/task-manager.d.ts.map +1 -0
  538. package/dist/src/integrations/tasks/task-manager.js +383 -0
  539. package/dist/src/integrations/tasks/task-manager.js.map +1 -0
  540. package/dist/src/integrations/tasks/task-splitter.d.ts +56 -0
  541. package/dist/src/integrations/tasks/task-splitter.d.ts.map +1 -0
  542. package/dist/src/integrations/tasks/task-splitter.js +537 -0
  543. package/dist/src/integrations/tasks/task-splitter.js.map +1 -0
  544. package/dist/src/integrations/tasks/verification-gate.d.ts +103 -0
  545. package/dist/src/integrations/tasks/verification-gate.d.ts.map +1 -0
  546. package/dist/src/integrations/tasks/verification-gate.js +193 -0
  547. package/dist/src/integrations/tasks/verification-gate.js.map +1 -0
  548. package/dist/src/integrations/tasks/work-log.d.ts +87 -0
  549. package/dist/src/integrations/tasks/work-log.d.ts.map +1 -0
  550. package/dist/src/integrations/tasks/work-log.js +275 -0
  551. package/dist/src/integrations/tasks/work-log.js.map +1 -0
  552. package/dist/src/integrations/utilities/capabilities.d.ts +160 -0
  553. package/dist/src/integrations/utilities/capabilities.d.ts.map +1 -0
  554. package/dist/src/integrations/utilities/capabilities.js +426 -0
  555. package/dist/src/integrations/utilities/capabilities.js.map +1 -0
  556. package/dist/src/integrations/utilities/diff-utils.d.ts +105 -0
  557. package/dist/src/integrations/utilities/diff-utils.d.ts.map +1 -0
  558. package/dist/src/integrations/utilities/diff-utils.js +497 -0
  559. package/dist/src/integrations/utilities/diff-utils.js.map +1 -0
  560. package/dist/src/integrations/utilities/environment-facts.d.ts +52 -0
  561. package/dist/src/integrations/utilities/environment-facts.d.ts.map +1 -0
  562. package/dist/src/integrations/utilities/environment-facts.js +84 -0
  563. package/dist/src/integrations/utilities/environment-facts.js.map +1 -0
  564. package/dist/src/integrations/utilities/file-change-tracker.d.ts +162 -0
  565. package/dist/src/integrations/utilities/file-change-tracker.d.ts.map +1 -0
  566. package/dist/src/integrations/utilities/file-change-tracker.js +538 -0
  567. package/dist/src/integrations/utilities/file-change-tracker.js.map +1 -0
  568. package/dist/src/integrations/utilities/graph-visualization.d.ts +72 -0
  569. package/dist/src/integrations/utilities/graph-visualization.d.ts.map +1 -0
  570. package/dist/src/integrations/utilities/graph-visualization.js +383 -0
  571. package/dist/src/integrations/utilities/graph-visualization.js.map +1 -0
  572. package/dist/src/integrations/utilities/hierarchical-config.d.ts +215 -0
  573. package/dist/src/integrations/utilities/hierarchical-config.d.ts.map +1 -0
  574. package/dist/src/integrations/utilities/hierarchical-config.js +504 -0
  575. package/dist/src/integrations/utilities/hierarchical-config.js.map +1 -0
  576. package/dist/src/integrations/utilities/hooks.d.ts +116 -0
  577. package/dist/src/integrations/utilities/hooks.d.ts.map +1 -0
  578. package/dist/src/integrations/utilities/hooks.js +410 -0
  579. package/dist/src/integrations/utilities/hooks.js.map +1 -0
  580. package/dist/src/integrations/utilities/ignore.d.ts +143 -0
  581. package/dist/src/integrations/utilities/ignore.d.ts.map +1 -0
  582. package/dist/src/integrations/utilities/ignore.js +417 -0
  583. package/dist/src/integrations/utilities/ignore.js.map +1 -0
  584. package/dist/src/integrations/utilities/image-renderer.d.ts +119 -0
  585. package/dist/src/integrations/utilities/image-renderer.d.ts.map +1 -0
  586. package/dist/src/integrations/utilities/image-renderer.js +306 -0
  587. package/dist/src/integrations/utilities/image-renderer.js.map +1 -0
  588. package/dist/src/integrations/utilities/logger.d.ts +104 -0
  589. package/dist/src/integrations/utilities/logger.d.ts.map +1 -0
  590. package/dist/src/integrations/utilities/logger.js +219 -0
  591. package/dist/src/integrations/utilities/logger.js.map +1 -0
  592. package/dist/src/integrations/utilities/memory.d.ts +116 -0
  593. package/dist/src/integrations/utilities/memory.d.ts.map +1 -0
  594. package/dist/src/integrations/utilities/memory.js +311 -0
  595. package/dist/src/integrations/utilities/memory.js.map +1 -0
  596. package/dist/src/integrations/utilities/observability.d.ts +162 -0
  597. package/dist/src/integrations/utilities/observability.d.ts.map +1 -0
  598. package/dist/src/integrations/utilities/observability.js +407 -0
  599. package/dist/src/integrations/utilities/observability.js.map +1 -0
  600. package/dist/src/integrations/utilities/openrouter-pricing.d.ts +67 -0
  601. package/dist/src/integrations/utilities/openrouter-pricing.d.ts.map +1 -0
  602. package/dist/src/integrations/utilities/openrouter-pricing.js +166 -0
  603. package/dist/src/integrations/utilities/openrouter-pricing.js.map +1 -0
  604. package/dist/src/integrations/utilities/react.d.ts +139 -0
  605. package/dist/src/integrations/utilities/react.d.ts.map +1 -0
  606. package/dist/src/integrations/utilities/react.js +273 -0
  607. package/dist/src/integrations/utilities/react.js.map +1 -0
  608. package/dist/src/integrations/utilities/retry.d.ts +132 -0
  609. package/dist/src/integrations/utilities/retry.d.ts.map +1 -0
  610. package/dist/src/integrations/utilities/retry.js +233 -0
  611. package/dist/src/integrations/utilities/retry.js.map +1 -0
  612. package/dist/src/integrations/utilities/routing.d.ts +118 -0
  613. package/dist/src/integrations/utilities/routing.d.ts.map +1 -0
  614. package/dist/src/integrations/utilities/routing.js +348 -0
  615. package/dist/src/integrations/utilities/routing.js.map +1 -0
  616. package/dist/src/integrations/utilities/rules.d.ts +131 -0
  617. package/dist/src/integrations/utilities/rules.d.ts.map +1 -0
  618. package/dist/src/integrations/utilities/rules.js +284 -0
  619. package/dist/src/integrations/utilities/rules.js.map +1 -0
  620. package/dist/src/integrations/utilities/sourcegraph.d.ts +169 -0
  621. package/dist/src/integrations/utilities/sourcegraph.d.ts.map +1 -0
  622. package/dist/src/integrations/utilities/sourcegraph.js +379 -0
  623. package/dist/src/integrations/utilities/sourcegraph.js.map +1 -0
  624. package/dist/src/integrations/utilities/thinking-strategy.d.ts +52 -0
  625. package/dist/src/integrations/utilities/thinking-strategy.d.ts.map +1 -0
  626. package/dist/src/integrations/utilities/thinking-strategy.js +129 -0
  627. package/dist/src/integrations/utilities/thinking-strategy.js.map +1 -0
  628. package/dist/src/integrations/utilities/thread-manager.d.ts +199 -0
  629. package/dist/src/integrations/utilities/thread-manager.d.ts.map +1 -0
  630. package/dist/src/integrations/utilities/thread-manager.js +357 -0
  631. package/dist/src/integrations/utilities/thread-manager.js.map +1 -0
  632. package/dist/src/integrations/utilities/token-estimate.d.ts +11 -0
  633. package/dist/src/integrations/utilities/token-estimate.d.ts.map +1 -0
  634. package/dist/src/integrations/utilities/token-estimate.js +14 -0
  635. package/dist/src/integrations/utilities/token-estimate.js.map +1 -0
  636. package/dist/src/main.js +92 -35
  637. package/dist/src/main.js.map +1 -1
  638. package/dist/src/modes/repl.d.ts.map +1 -1
  639. package/dist/src/modes/repl.js +60 -11
  640. package/dist/src/modes/repl.js.map +1 -1
  641. package/dist/src/modes/tui.d.ts.map +1 -1
  642. package/dist/src/modes/tui.js +57 -10
  643. package/dist/src/modes/tui.js.map +1 -1
  644. package/dist/src/modes.js +1 -1
  645. package/dist/src/modes.js.map +1 -1
  646. package/dist/src/observability/tracer.d.ts.map +1 -1
  647. package/dist/src/observability/tracer.js +2 -1
  648. package/dist/src/observability/tracer.js.map +1 -1
  649. package/dist/src/persistence/schema.d.ts +2 -0
  650. package/dist/src/persistence/schema.d.ts.map +1 -1
  651. package/dist/src/persistence/schema.js +42 -0
  652. package/dist/src/persistence/schema.js.map +1 -1
  653. package/dist/src/providers/adapters/anthropic.d.ts +6 -0
  654. package/dist/src/providers/adapters/anthropic.d.ts.map +1 -1
  655. package/dist/src/providers/adapters/anthropic.js +101 -16
  656. package/dist/src/providers/adapters/anthropic.js.map +1 -1
  657. package/dist/src/providers/adapters/azure.d.ts +74 -0
  658. package/dist/src/providers/adapters/azure.d.ts.map +1 -0
  659. package/dist/src/providers/adapters/azure.js +354 -0
  660. package/dist/src/providers/adapters/azure.js.map +1 -0
  661. package/dist/src/providers/adapters/mock.d.ts +16 -2
  662. package/dist/src/providers/adapters/mock.d.ts.map +1 -1
  663. package/dist/src/providers/adapters/mock.js +44 -3
  664. package/dist/src/providers/adapters/mock.js.map +1 -1
  665. package/dist/src/providers/adapters/openai.d.ts +6 -1
  666. package/dist/src/providers/adapters/openai.d.ts.map +1 -1
  667. package/dist/src/providers/adapters/openai.js +41 -9
  668. package/dist/src/providers/adapters/openai.js.map +1 -1
  669. package/dist/src/providers/adapters/openrouter.d.ts +6 -0
  670. package/dist/src/providers/adapters/openrouter.d.ts.map +1 -1
  671. package/dist/src/providers/adapters/openrouter.js +83 -13
  672. package/dist/src/providers/adapters/openrouter.js.map +1 -1
  673. package/dist/src/providers/circuit-breaker.d.ts +1 -0
  674. package/dist/src/providers/circuit-breaker.d.ts.map +1 -1
  675. package/dist/src/providers/circuit-breaker.js.map +1 -1
  676. package/dist/src/providers/provider.d.ts.map +1 -1
  677. package/dist/src/providers/provider.js +2 -1
  678. package/dist/src/providers/provider.js.map +1 -1
  679. package/dist/src/providers/resilient-provider.d.ts.map +1 -1
  680. package/dist/src/providers/resilient-provider.js +2 -1
  681. package/dist/src/providers/resilient-provider.js.map +1 -1
  682. package/dist/src/providers/types.d.ts +23 -2
  683. package/dist/src/providers/types.d.ts.map +1 -1
  684. package/dist/src/session-picker.d.ts +1 -1
  685. package/dist/src/session-picker.d.ts.map +1 -1
  686. package/dist/src/session-picker.js +40 -5
  687. package/dist/src/session-picker.js.map +1 -1
  688. package/dist/src/shared/budget-tracker.d.ts +65 -0
  689. package/dist/src/shared/budget-tracker.d.ts.map +1 -0
  690. package/dist/src/shared/budget-tracker.js +128 -0
  691. package/dist/src/shared/budget-tracker.js.map +1 -0
  692. package/dist/src/shared/context-engine.d.ts +64 -0
  693. package/dist/src/shared/context-engine.d.ts.map +1 -0
  694. package/dist/src/shared/context-engine.js +117 -0
  695. package/dist/src/shared/context-engine.js.map +1 -0
  696. package/dist/src/shared/index.d.ts +12 -0
  697. package/dist/src/shared/index.d.ts.map +1 -0
  698. package/dist/src/shared/index.js +12 -0
  699. package/dist/src/shared/index.js.map +1 -0
  700. package/dist/src/shared/persistence.d.ts +57 -0
  701. package/dist/src/shared/persistence.d.ts.map +1 -0
  702. package/dist/src/shared/persistence.js +168 -0
  703. package/dist/src/shared/persistence.js.map +1 -0
  704. package/dist/src/shared/shared-context-state.d.ts +89 -0
  705. package/dist/src/shared/shared-context-state.d.ts.map +1 -0
  706. package/dist/src/shared/shared-context-state.js +175 -0
  707. package/dist/src/shared/shared-context-state.js.map +1 -0
  708. package/dist/src/shared/shared-economics-state.d.ts +61 -0
  709. package/dist/src/shared/shared-economics-state.d.ts.map +1 -0
  710. package/dist/src/shared/shared-economics-state.js +100 -0
  711. package/dist/src/shared/shared-economics-state.js.map +1 -0
  712. package/dist/src/tools/agent.d.ts +1 -1
  713. package/dist/src/tools/agent.d.ts.map +1 -1
  714. package/dist/src/tools/bash.d.ts +3 -3
  715. package/dist/src/tools/bash.d.ts.map +1 -1
  716. package/dist/src/tools/bash.js +2 -1
  717. package/dist/src/tools/bash.js.map +1 -1
  718. package/dist/src/tools/file.d.ts +3 -3
  719. package/dist/src/tools/file.js +1 -1
  720. package/dist/src/tools/file.js.map +1 -1
  721. package/dist/src/tools/permission.d.ts.map +1 -1
  722. package/dist/src/tools/permission.js +7 -6
  723. package/dist/src/tools/permission.js.map +1 -1
  724. package/dist/src/tools/registry.d.ts +1 -1
  725. package/dist/src/tools/registry.d.ts.map +1 -1
  726. package/dist/src/tools/registry.js +1 -1
  727. package/dist/src/tools/registry.js.map +1 -1
  728. package/dist/src/tools/tasks.d.ts +1 -1
  729. package/dist/src/tools/tasks.d.ts.map +1 -1
  730. package/dist/src/tools/types.d.ts +1 -0
  731. package/dist/src/tools/types.d.ts.map +1 -1
  732. package/dist/src/tools/types.js.map +1 -1
  733. package/dist/src/tools/undo.d.ts +1 -1
  734. package/dist/src/tools/undo.d.ts.map +1 -1
  735. package/dist/src/tracing/cache-boundary-tracker.d.ts.map +1 -1
  736. package/dist/src/tracing/cache-boundary-tracker.js +2 -2
  737. package/dist/src/tracing/cache-boundary-tracker.js.map +1 -1
  738. package/dist/src/tracing/trace-collector.d.ts +147 -0
  739. package/dist/src/tracing/trace-collector.d.ts.map +1 -1
  740. package/dist/src/tracing/trace-collector.js +138 -7
  741. package/dist/src/tracing/trace-collector.js.map +1 -1
  742. package/dist/src/tracing/types.d.ts +112 -1
  743. package/dist/src/tracing/types.d.ts.map +1 -1
  744. package/dist/src/tracing/types.js.map +1 -1
  745. package/dist/src/tricks/failure-evidence.d.ts.map +1 -1
  746. package/dist/src/tricks/failure-evidence.js +2 -1
  747. package/dist/src/tricks/failure-evidence.js.map +1 -1
  748. package/dist/src/tricks/recitation.d.ts.map +1 -1
  749. package/dist/src/tricks/recitation.js +2 -1
  750. package/dist/src/tricks/recitation.js.map +1 -1
  751. package/dist/src/tricks/recursive-context.d.ts.map +1 -1
  752. package/dist/src/tricks/recursive-context.js +2 -2
  753. package/dist/src/tricks/recursive-context.js.map +1 -1
  754. package/dist/src/tricks/reversible-compaction.d.ts.map +1 -1
  755. package/dist/src/tricks/reversible-compaction.js +6 -2
  756. package/dist/src/tricks/reversible-compaction.js.map +1 -1
  757. package/dist/src/tui/app.d.ts +16 -3
  758. package/dist/src/tui/app.d.ts.map +1 -1
  759. package/dist/src/tui/app.js +211 -25
  760. package/dist/src/tui/app.js.map +1 -1
  761. package/dist/src/tui/components/CollapsibleDiffView.d.ts +1 -1
  762. package/dist/src/tui/components/CollapsibleDiffView.d.ts.map +1 -1
  763. package/dist/src/tui/components/DiagnosticsPanel.d.ts +24 -0
  764. package/dist/src/tui/components/DiagnosticsPanel.d.ts.map +1 -0
  765. package/dist/src/tui/components/DiagnosticsPanel.js +47 -0
  766. package/dist/src/tui/components/DiagnosticsPanel.js.map +1 -0
  767. package/dist/src/tui/components/DiffView.d.ts +1 -1
  768. package/dist/src/tui/components/DiffView.d.ts.map +1 -1
  769. package/dist/src/tui/components/ErrorBoundary.d.ts.map +1 -1
  770. package/dist/src/tui/components/ErrorBoundary.js +3 -2
  771. package/dist/src/tui/components/ErrorBoundary.js.map +1 -1
  772. package/dist/src/tui/components/TasksPanel.d.ts +1 -1
  773. package/dist/src/tui/components/TasksPanel.d.ts.map +1 -1
  774. package/dist/src/tui/event-display.d.ts.map +1 -1
  775. package/dist/src/tui/event-display.js +36 -62
  776. package/dist/src/tui/event-display.js.map +1 -1
  777. package/dist/src/tui/index.d.ts +4 -0
  778. package/dist/src/tui/index.d.ts.map +1 -1
  779. package/dist/src/tui/index.js +17 -0
  780. package/dist/src/tui/index.js.map +1 -1
  781. package/dist/src/tui/transparency-aggregator.d.ts +13 -0
  782. package/dist/src/tui/transparency-aggregator.d.ts.map +1 -1
  783. package/dist/src/tui/transparency-aggregator.js +21 -0
  784. package/dist/src/tui/transparency-aggregator.js.map +1 -1
  785. package/dist/src/types.d.ts +170 -3
  786. package/dist/src/types.d.ts.map +1 -1
  787. package/package.json +18 -3
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Complexity Classifier
3
+ *
4
+ * Heuristic-based task complexity assessment that determines
5
+ * the appropriate execution strategy (agent count, tool budget,
6
+ * swarm mode) without requiring an LLM call.
7
+ *
8
+ * Inspired by Anthropic's multi-agent research system's approach
9
+ * to scaling effort based on task complexity.
10
+ */
11
+ // =============================================================================
12
+ // CONSTANTS
13
+ // =============================================================================
14
+ /** Keywords that indicate higher complexity */
15
+ const COMPLEX_KEYWORDS = [
16
+ // Multi-file operations
17
+ 'refactor', 'migrate', 'redesign', 'rewrite', 'overhaul',
18
+ 'restructure', 'reorganize', 'rearchitect',
19
+ // Broad scope
20
+ 'all files', 'entire', 'codebase', 'every', 'across',
21
+ 'comprehensive', 'full audit', 'system-wide',
22
+ // Multi-step
23
+ 'first', 'then', 'after that', 'finally', 'step by step',
24
+ 'and then', 'once done', 'followed by',
25
+ // Research-heavy
26
+ 'investigate', 'analyze', 'audit', 'security review',
27
+ 'performance analysis', 'benchmark', 'compare',
28
+ ];
29
+ /** Keywords that indicate simplicity */
30
+ const SIMPLE_KEYWORDS = [
31
+ 'fix typo', 'rename', 'update version', 'add comment',
32
+ 'change color', 'fix import', 'remove unused',
33
+ 'what is', 'how does', 'where is', 'explain',
34
+ ];
35
+ /** Dependency indicators (suggest sequential steps) */
36
+ const DEPENDENCY_PATTERNS = [
37
+ /first\s.*then/i,
38
+ /after\s.*(?:do|make|create|implement)/i,
39
+ /before\s.*(?:need|must|should)/i,
40
+ /depends?\s+on/i,
41
+ /step\s+\d/i,
42
+ /phase\s+\d/i,
43
+ ];
44
+ /** Tier -> execution recommendation mapping */
45
+ const TIER_RECOMMENDATIONS = {
46
+ simple: {
47
+ agentCount: { min: 1, max: 1 },
48
+ toolCallsPerAgent: { min: 3, max: 10 },
49
+ useSwarmMode: false,
50
+ suggestedAgents: [],
51
+ budgetMultiplier: 0.5,
52
+ useExtendedThinking: false,
53
+ },
54
+ medium: {
55
+ agentCount: { min: 1, max: 4 },
56
+ toolCallsPerAgent: { min: 10, max: 20 },
57
+ useSwarmMode: false,
58
+ suggestedAgents: ['researcher', 'coder'],
59
+ budgetMultiplier: 1.0,
60
+ useExtendedThinking: false,
61
+ },
62
+ complex: {
63
+ agentCount: { min: 3, max: 8 },
64
+ toolCallsPerAgent: { min: 15, max: 30 },
65
+ useSwarmMode: true,
66
+ suggestedAgents: ['researcher', 'coder', 'reviewer'],
67
+ budgetMultiplier: 2.0,
68
+ useExtendedThinking: true,
69
+ },
70
+ deep_research: {
71
+ agentCount: { min: 5, max: 15 },
72
+ toolCallsPerAgent: { min: 20, max: 50 },
73
+ useSwarmMode: true,
74
+ suggestedAgents: ['researcher', 'coder', 'reviewer', 'architect'],
75
+ budgetMultiplier: 3.0,
76
+ useExtendedThinking: true,
77
+ },
78
+ };
79
+ // =============================================================================
80
+ // CLASSIFIER
81
+ // =============================================================================
82
+ /**
83
+ * Classify task complexity using heuristic signals.
84
+ * No LLM call needed — fast and deterministic.
85
+ */
86
+ export function classifyComplexity(task, context) {
87
+ const signals = [];
88
+ const taskLower = task.toLowerCase();
89
+ // Signal 1: Task length (proxy for detail/scope)
90
+ const wordCount = task.split(/\s+/).length;
91
+ const lengthScore = wordCount < 10 ? 0 : wordCount < 30 ? 1 : wordCount < 80 ? 2 : 3;
92
+ signals.push({
93
+ name: 'task_length',
94
+ value: lengthScore,
95
+ weight: 0.15,
96
+ description: `${wordCount} words (${lengthScore > 1 ? 'detailed' : 'brief'})`,
97
+ });
98
+ // Signal 2: Complex keyword matches
99
+ const complexMatches = COMPLEX_KEYWORDS.filter(kw => taskLower.includes(kw));
100
+ const complexScore = Math.min(complexMatches.length * 1.5, 4);
101
+ signals.push({
102
+ name: 'complex_keywords',
103
+ value: complexScore,
104
+ weight: 0.25,
105
+ description: complexMatches.length > 0
106
+ ? `Matches: ${complexMatches.slice(0, 3).join(', ')}`
107
+ : 'No complex keywords',
108
+ });
109
+ // Signal 3: Simple keyword matches (reduces score)
110
+ const simpleMatches = SIMPLE_KEYWORDS.filter(kw => taskLower.includes(kw));
111
+ const simpleScore = simpleMatches.length > 0 ? -2 : 0;
112
+ signals.push({
113
+ name: 'simple_keywords',
114
+ value: simpleScore,
115
+ weight: 0.2,
116
+ description: simpleMatches.length > 0
117
+ ? `Simple: ${simpleMatches.slice(0, 2).join(', ')}`
118
+ : 'No simplicity signals',
119
+ });
120
+ // Signal 4: Dependency patterns (suggest multi-step)
121
+ const depMatches = DEPENDENCY_PATTERNS.filter(p => p.test(task));
122
+ const depScore = depMatches.length * 2;
123
+ signals.push({
124
+ name: 'dependency_patterns',
125
+ value: depScore,
126
+ weight: 0.2,
127
+ description: depMatches.length > 0
128
+ ? `${depMatches.length} sequential dependencies detected`
129
+ : 'No dependency chains',
130
+ });
131
+ // Signal 5: Question vs action
132
+ const isQuestion = /^(what|how|where|when|why|which|can|does|is|are)\b/i.test(task.trim());
133
+ const actionScore = isQuestion ? -1 : 1;
134
+ signals.push({
135
+ name: 'question_vs_action',
136
+ value: actionScore,
137
+ weight: 0.1,
138
+ description: isQuestion ? 'Question (likely simpler)' : 'Action request',
139
+ });
140
+ // Signal 6: Multiple file/component references
141
+ const fileRefs = (task.match(/\b\w+\.(ts|tsx|js|jsx|py|rs|go|java|cpp|c|h)\b/g) || []).length;
142
+ const dirRefs = (task.match(/\b(?:src|lib|test|docs|config)\//g) || []).length;
143
+ const scopeScore = Math.min((fileRefs + dirRefs) * 0.5, 3);
144
+ signals.push({
145
+ name: 'scope_indicators',
146
+ value: scopeScore,
147
+ weight: 0.1,
148
+ description: `${fileRefs} file refs, ${dirRefs} dir refs`,
149
+ });
150
+ // Calculate weighted score
151
+ const totalScore = signals.reduce((sum, s) => sum + s.value * s.weight, 0);
152
+ // Determine tier
153
+ let tier;
154
+ if (totalScore < 0.5) {
155
+ tier = 'simple';
156
+ }
157
+ else if (totalScore < 1.5) {
158
+ tier = 'medium';
159
+ }
160
+ else if (totalScore < 2.5) {
161
+ tier = 'complex';
162
+ }
163
+ else {
164
+ tier = 'deep_research';
165
+ }
166
+ // Calculate confidence (higher when signals agree)
167
+ const signalVariance = signals.reduce((sum, s) => {
168
+ const normalized = s.value / 4; // Normalize to ~0-1 range
169
+ return sum + Math.abs(normalized - totalScore / 3);
170
+ }, 0) / signals.length;
171
+ const confidence = Math.max(0.3, Math.min(1.0, 1.0 - signalVariance));
172
+ // Build reasoning
173
+ const topSignals = [...signals]
174
+ .sort((a, b) => Math.abs(b.value * b.weight) - Math.abs(a.value * a.weight))
175
+ .slice(0, 3);
176
+ const reasoning = `Classified as ${tier} (score: ${totalScore.toFixed(2)}). ` +
177
+ `Top factors: ${topSignals.map(s => s.description).join('; ')}`;
178
+ return {
179
+ tier,
180
+ confidence,
181
+ reasoning,
182
+ recommendation: TIER_RECOMMENDATIONS[tier],
183
+ signals,
184
+ };
185
+ }
186
+ /**
187
+ * Generate scaling guidance for injection into the agent's system prompt.
188
+ * This follows Anthropic's pattern of embedding scaling rules directly in prompts.
189
+ */
190
+ export function getScalingGuidance(assessment) {
191
+ const { tier, recommendation } = assessment;
192
+ const guidelines = {
193
+ simple: `## Effort Scaling: SIMPLE TASK
194
+ - Handle directly, no subagents needed
195
+ - ${recommendation.toolCallsPerAgent.min}-${recommendation.toolCallsPerAgent.max} tool calls maximum
196
+ - Respond quickly and concisely
197
+ - Do not over-explore the codebase`,
198
+ medium: `## Effort Scaling: MEDIUM TASK
199
+ - Consider spawning ${recommendation.agentCount.min}-${recommendation.agentCount.max} subagents for independent subtasks
200
+ - Each agent: ${recommendation.toolCallsPerAgent.min}-${recommendation.toolCallsPerAgent.max} tool calls
201
+ - Coordinate via blackboard for shared findings
202
+ - Balance speed with thoroughness`,
203
+ complex: `## Effort Scaling: COMPLEX TASK
204
+ - Spawn ${recommendation.agentCount.min}-${recommendation.agentCount.max} subagents with clear delegation specs
205
+ - Use parallel execution where possible
206
+ - Quality gate each result before synthesis
207
+ - Consider a researcher agent to scope the work first
208
+ - Extended thinking recommended for planning`,
209
+ deep_research: `## Effort Scaling: DEEP RESEARCH TASK
210
+ - Consider swarm mode for ${recommendation.agentCount.min}+ parallel agents
211
+ - Budget for extended exploration and multiple passes
212
+ - Use researcher agents to scope before implementation
213
+ - Multiple review waves for quality assurance
214
+ - Extended thinking strongly recommended`,
215
+ };
216
+ return guidelines[tier];
217
+ }
218
+ /**
219
+ * Create a complexity classifier with custom thresholds.
220
+ */
221
+ export function createComplexityClassifier(config) {
222
+ const thresholds = {
223
+ simple: config?.simpleThreshold ?? 0.5,
224
+ medium: config?.mediumThreshold ?? 1.5,
225
+ complex: config?.complexThreshold ?? 2.5,
226
+ };
227
+ return {
228
+ classify: (task, context) => classifyComplexity(task, context),
229
+ getScalingGuidance,
230
+ thresholds,
231
+ };
232
+ }
233
+ //# sourceMappingURL=complexity-classifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complexity-classifier.js","sourceRoot":"","sources":["../../../../src/integrations/agents/complexity-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAsDH,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,+CAA+C;AAC/C,MAAM,gBAAgB,GAAG;IACvB,wBAAwB;IACxB,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU;IACxD,aAAa,EAAE,YAAY,EAAE,aAAa;IAC1C,cAAc;IACd,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ;IACpD,eAAe,EAAE,YAAY,EAAE,aAAa;IAC5C,aAAa;IACb,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc;IACxD,UAAU,EAAE,WAAW,EAAE,aAAa;IACtC,iBAAiB;IACjB,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB;IACpD,sBAAsB,EAAE,WAAW,EAAE,SAAS;CAC/C,CAAC;AAEF,wCAAwC;AACxC,MAAM,eAAe,GAAG;IACtB,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa;IACrD,cAAc,EAAE,YAAY,EAAE,eAAe;IAC7C,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS;CAC7C,CAAC;AAEF,uDAAuD;AACvD,MAAM,mBAAmB,GAAG;IAC1B,gBAAgB;IAChB,wCAAwC;IACxC,iCAAiC;IACjC,gBAAgB;IAChB,YAAY;IACZ,aAAa;CACd,CAAC;AAEF,+CAA+C;AAC/C,MAAM,oBAAoB,GAAoD;IAC5E,MAAM,EAAE;QACN,UAAU,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QAC9B,iBAAiB,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE;QACtC,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,EAAE;QACn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c,CAAC,UAAU,CAAC,GAAG;gBACpE,cAAc,CAAC,iBAAiB,CAAC,GAAG,IAAI,cAAc,CAAC,iBAAiB,CAAC,GAAG;;kCAE1D;QAE9B,OAAO,EAAE;UACH,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,cAAc,CAAC,UAAU,CAAC,GAAG;;;;6CAI3B;QAEzC,aAAa,EAAE;4BACS,cAAc,CAAC,UAAU,CAAC,GAAG;;;;yCAIhB;KACtC,CAAC;IAEF,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAI1C;IACC,MAAM,UAAU,GAAG;QACjB,MAAM,EAAE,MAAM,EAAE,eAAe,IAAI,GAAG;QACtC,MAAM,EAAE,MAAM,EAAE,eAAe,IAAI,GAAG;QACtC,OAAO,EAAE,MAAM,EAAE,gBAAgB,IAAI,GAAG;KACzC,CAAC;IAEF,OAAO;QACL,QAAQ,EAAE,CAAC,IAAY,EAAE,OAA+B,EAAE,EAAE,CAC1D,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC;QACnC,kBAAkB;QAClB,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Structured Delegation Protocol
3
+ *
4
+ * Provides a structured interface for delegating tasks to subagents,
5
+ * inspired by Anthropic's multi-agent research system.
6
+ *
7
+ * Instead of passing freeform task strings, the orchestrator creates
8
+ * a DelegationSpec that explicitly communicates:
9
+ * - Clear objective and success criteria
10
+ * - Expected output format
11
+ * - Tool guidance (what to use, what to avoid)
12
+ * - Task boundaries (in-scope vs out-of-scope)
13
+ * - Sibling context (what other agents are doing)
14
+ */
15
+ /**
16
+ * Structured delegation spec for subagent tasks.
17
+ * Every field is intentionally explicit to prevent vague delegations.
18
+ */
19
+ export interface DelegationSpec {
20
+ /** One-sentence objective: what the subagent must accomplish */
21
+ objective: string;
22
+ /** Detailed context: why this task matters, how it fits the bigger picture */
23
+ context: string;
24
+ /** Expected output format */
25
+ outputFormat: OutputFormatSpec;
26
+ /** Tools and sources guidance */
27
+ toolGuidance: ToolGuidance;
28
+ /** Explicit task boundaries */
29
+ boundaries: TaskBoundaries;
30
+ /** How to know when done */
31
+ successCriteria: string[];
32
+ /** What other agents are doing (prevents duplicate work) */
33
+ siblingContext?: SiblingContext;
34
+ }
35
+ export interface OutputFormatSpec {
36
+ /** Format type */
37
+ type: 'structured_json' | 'markdown_report' | 'code_changes' | 'free_text';
38
+ /** Schema or template for expected output */
39
+ schema?: string;
40
+ /** Example of good output */
41
+ example?: string;
42
+ }
43
+ export interface ToolGuidance {
44
+ /** Tools the agent should use */
45
+ recommended: string[];
46
+ /** Tools the agent should avoid (with reason) */
47
+ avoid?: Array<{
48
+ tool: string;
49
+ reason: string;
50
+ }>;
51
+ /** Specific sources/files to consult */
52
+ sources?: string[];
53
+ }
54
+ export interface TaskBoundaries {
55
+ /** What to include in scope */
56
+ inScope: string[];
57
+ /** What to explicitly exclude */
58
+ outOfScope: string[];
59
+ /** Maximum depth of exploration */
60
+ maxExplorationDepth?: 'shallow' | 'moderate' | 'deep';
61
+ }
62
+ export interface SiblingContext {
63
+ /** Brief description of what other agents are working on */
64
+ siblingTasks: Array<{
65
+ agent: string;
66
+ task: string;
67
+ }>;
68
+ /** Files claimed by other agents (do not modify) */
69
+ claimedFiles?: string[];
70
+ }
71
+ /**
72
+ * Convert a DelegationSpec into a structured prompt for a subagent.
73
+ * The output is injected into the subagent's system prompt or task description.
74
+ */
75
+ export declare function buildDelegationPrompt(spec: DelegationSpec): string;
76
+ /**
77
+ * Create a minimal DelegationSpec from a task string.
78
+ * Used as a fallback when the orchestrator doesn't provide a full spec.
79
+ */
80
+ export declare function createMinimalDelegationSpec(task: string, agentType?: string): DelegationSpec;
81
+ /**
82
+ * Delegation protocol instructions for the orchestrator's system prompt.
83
+ * Teaches the lead agent HOW to delegate effectively.
84
+ */
85
+ export declare const DELEGATION_INSTRUCTIONS = "\n## Delegation Protocol\n\nWhen using spawn_agent, provide structured delegation:\n\n1. **OBJECTIVE**: One clear sentence of what the agent must accomplish\n2. **CONTEXT**: Why this matters and how it fits the bigger picture\n3. **OUTPUT FORMAT**: What the result should look like (JSON/markdown/code)\n4. **TOOLS**: Which tools to use and which to avoid\n5. **BOUNDARIES**: What is in-scope vs out-of-scope\n6. **SUCCESS CRITERIA**: How to know when done\n\nInclude a delegationSpec in the spawn_agent call for best results.\nWhen spawning multiple agents, describe what siblings are working on\nto prevent duplicate effort.\n";
86
+ //# sourceMappingURL=delegation-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-protocol.d.ts","sourceRoot":"","sources":["../../../../src/integrations/agents/delegation-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAElB,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAEhB,6BAA6B;IAC7B,YAAY,EAAE,gBAAgB,CAAC;IAE/B,iCAAiC;IACjC,YAAY,EAAE,YAAY,CAAC;IAE3B,+BAA+B;IAC/B,UAAU,EAAE,cAAc,CAAC;IAE3B,4BAA4B;IAC5B,eAAe,EAAE,MAAM,EAAE,CAAC;IAE1B,4DAA4D;IAC5D,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB;IAClB,IAAI,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,cAAc,GAAG,WAAW,CAAC;IAC3E,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,iDAAiD;IACjD,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iCAAiC;IACjC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mCAAmC;IACnC,mBAAmB,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;CACvD;AAED,MAAM,WAAW,cAAc;IAC7B,4DAA4D;IAC5D,YAAY,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAMD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAsDlE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GACjB,cAAc,CAchB;AAsBD;;;GAGG;AACH,eAAO,MAAM,uBAAuB,ynBAenC,CAAC"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Structured Delegation Protocol
3
+ *
4
+ * Provides a structured interface for delegating tasks to subagents,
5
+ * inspired by Anthropic's multi-agent research system.
6
+ *
7
+ * Instead of passing freeform task strings, the orchestrator creates
8
+ * a DelegationSpec that explicitly communicates:
9
+ * - Clear objective and success criteria
10
+ * - Expected output format
11
+ * - Tool guidance (what to use, what to avoid)
12
+ * - Task boundaries (in-scope vs out-of-scope)
13
+ * - Sibling context (what other agents are doing)
14
+ */
15
+ // =============================================================================
16
+ // BUILDER
17
+ // =============================================================================
18
+ /**
19
+ * Convert a DelegationSpec into a structured prompt for a subagent.
20
+ * The output is injected into the subagent's system prompt or task description.
21
+ */
22
+ export function buildDelegationPrompt(spec) {
23
+ const sections = [];
24
+ // Objective
25
+ sections.push(`## OBJECTIVE\n${spec.objective}`);
26
+ // Context
27
+ if (spec.context) {
28
+ sections.push(`## CONTEXT\n${spec.context}`);
29
+ }
30
+ // Output Format
31
+ sections.push(`## EXPECTED OUTPUT\nFormat: ${spec.outputFormat.type}`);
32
+ if (spec.outputFormat.schema) {
33
+ sections.push(`Schema:\n\`\`\`\n${spec.outputFormat.schema}\n\`\`\``);
34
+ }
35
+ if (spec.outputFormat.example) {
36
+ sections.push(`Example:\n\`\`\`\n${spec.outputFormat.example}\n\`\`\``);
37
+ }
38
+ // Tool Guidance
39
+ if (spec.toolGuidance.recommended.length > 0) {
40
+ sections.push(`## RECOMMENDED TOOLS\n${spec.toolGuidance.recommended.map(t => `- ${t}`).join('\n')}`);
41
+ }
42
+ if (spec.toolGuidance.avoid && spec.toolGuidance.avoid.length > 0) {
43
+ sections.push(`## TOOLS TO AVOID\n${spec.toolGuidance.avoid.map(a => `- ${a.tool}: ${a.reason}`).join('\n')}`);
44
+ }
45
+ if (spec.toolGuidance.sources && spec.toolGuidance.sources.length > 0) {
46
+ sections.push(`## KEY SOURCES\n${spec.toolGuidance.sources.map(s => `- ${s}`).join('\n')}`);
47
+ }
48
+ // Boundaries
49
+ sections.push(`## SCOPE`);
50
+ sections.push(`In scope:\n${spec.boundaries.inScope.map(s => `- ${s}`).join('\n')}`);
51
+ sections.push(`Out of scope:\n${spec.boundaries.outOfScope.map(s => `- ${s}`).join('\n')}`);
52
+ if (spec.boundaries.maxExplorationDepth) {
53
+ sections.push(`Exploration depth: ${spec.boundaries.maxExplorationDepth}`);
54
+ }
55
+ // Success Criteria
56
+ sections.push(`## SUCCESS CRITERIA\n${spec.successCriteria.map((c, i) => `${i + 1}. ${c}`).join('\n')}`);
57
+ // Sibling Context
58
+ if (spec.siblingContext) {
59
+ sections.push(`## SIBLING AGENTS (avoid duplicate work)`);
60
+ for (const sibling of spec.siblingContext.siblingTasks) {
61
+ sections.push(`- ${sibling.agent}: ${sibling.task}`);
62
+ }
63
+ if (spec.siblingContext.claimedFiles && spec.siblingContext.claimedFiles.length > 0) {
64
+ sections.push(`\nClaimed files (DO NOT modify):\n${spec.siblingContext.claimedFiles.map(f => `- ${f}`).join('\n')}`);
65
+ }
66
+ }
67
+ return sections.join('\n\n');
68
+ }
69
+ /**
70
+ * Create a minimal DelegationSpec from a task string.
71
+ * Used as a fallback when the orchestrator doesn't provide a full spec.
72
+ */
73
+ export function createMinimalDelegationSpec(task, agentType) {
74
+ return {
75
+ objective: task,
76
+ context: '',
77
+ outputFormat: { type: 'free_text' },
78
+ toolGuidance: {
79
+ recommended: getDefaultToolsForAgent(agentType),
80
+ },
81
+ boundaries: {
82
+ inScope: [task],
83
+ outOfScope: ['Changes outside the immediate task scope'],
84
+ },
85
+ successCriteria: ['Task objective is fully addressed'],
86
+ };
87
+ }
88
+ /**
89
+ * Get default recommended tools based on agent type.
90
+ */
91
+ function getDefaultToolsForAgent(agentType) {
92
+ switch (agentType) {
93
+ case 'researcher':
94
+ return ['read_file', 'glob', 'grep', 'list_files'];
95
+ case 'coder':
96
+ return ['write_file', 'edit_file', 'read_file', 'glob', 'grep', 'bash'];
97
+ case 'reviewer':
98
+ return ['read_file', 'glob', 'grep'];
99
+ case 'architect':
100
+ return ['read_file', 'glob', 'grep', 'list_files'];
101
+ case 'debugger':
102
+ return ['read_file', 'edit_file', 'glob', 'grep', 'bash'];
103
+ default:
104
+ return ['read_file', 'glob', 'grep'];
105
+ }
106
+ }
107
+ /**
108
+ * Delegation protocol instructions for the orchestrator's system prompt.
109
+ * Teaches the lead agent HOW to delegate effectively.
110
+ */
111
+ export const DELEGATION_INSTRUCTIONS = `
112
+ ## Delegation Protocol
113
+
114
+ When using spawn_agent, provide structured delegation:
115
+
116
+ 1. **OBJECTIVE**: One clear sentence of what the agent must accomplish
117
+ 2. **CONTEXT**: Why this matters and how it fits the bigger picture
118
+ 3. **OUTPUT FORMAT**: What the result should look like (JSON/markdown/code)
119
+ 4. **TOOLS**: Which tools to use and which to avoid
120
+ 5. **BOUNDARIES**: What is in-scope vs out-of-scope
121
+ 6. **SUCCESS CRITERIA**: How to know when done
122
+
123
+ Include a delegationSpec in the spawn_agent call for best results.
124
+ When spawning multiple agents, describe what siblings are working on
125
+ to prevent duplicate effort.
126
+ `;
127
+ //# sourceMappingURL=delegation-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-protocol.js","sourceRoot":"","sources":["../../../../src/integrations/agents/delegation-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAmEH,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAoB;IACxD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,YAAY;IACZ,QAAQ,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAEjD,UAAU;IACV,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,gBAAgB;IAChB,QAAQ,CAAC,IAAI,CAAC,+BAA+B,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IACvE,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;QAC7B,QAAQ,CAAC,IAAI,CAAC,oBAAoB,IAAI,CAAC,YAAY,CAAC,MAAM,UAAU,CAAC,CAAC;IACxE,CAAC;IACD,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC9B,QAAQ,CAAC,IAAI,CAAC,qBAAqB,IAAI,CAAC,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC;IAC1E,CAAC;IAED,gBAAgB;IAChB,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,MA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AE,IAAI;QACf,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;QACnC,YAAY,EAAE;YACZ,WAAW,EAAE,uBAAuB,CAAC,SAAS,CAAC;SAChD;QACD,UAAU,EAAE;YACV,OAAO,EAAE,CAAC,IAAI,CAAC;YACf,UAAU,EAAE,CAAC,0CAA0C,CAAC;SACzD;QACD,eAAe,EAAE,CAAC,mCAAmC,CAAC;KACvD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB,CAAC,SAAkB;IACjD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,YAAY;YACf,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACrD,KAAK,OAAO;YACV,OAAO,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1E,KAAK,UAAU;YACb,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACvC,KAAK,WAAW;YACd,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACrD,KAAK,UAAU;YACb,OAAO,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5D;YACE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;CAetC,CAAC"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Lesson 25: Multi-Agent Integration
3
+ *
4
+ * Integrates multi-agent coordination (from Lesson 17) into
5
+ * the production agent. Enables team-based execution with
6
+ * consensus and role-based task distribution.
7
+ */
8
+ import type { LLMProvider, ToolDefinition } from '../../types.js';
9
+ /**
10
+ * Agent role definition.
11
+ */
12
+ export interface AgentRole {
13
+ name: string;
14
+ description: string;
15
+ systemPrompt: string;
16
+ capabilities: string[];
17
+ authority: number;
18
+ model?: string;
19
+ }
20
+ /**
21
+ * Multi-agent team configuration.
22
+ */
23
+ export interface TeamConfig {
24
+ roles: AgentRole[];
25
+ consensusStrategy: ConsensusStrategy;
26
+ communicationMode: 'broadcast' | 'directed';
27
+ coordinatorRole?: string;
28
+ }
29
+ export type ConsensusStrategy = 'voting' | 'authority' | 'unanimous' | 'first-complete';
30
+ /**
31
+ * Task for team execution.
32
+ */
33
+ export interface TeamTask {
34
+ id: string;
35
+ goal: string;
36
+ context?: string;
37
+ requiredCapabilities?: string[];
38
+ deadline?: Date;
39
+ }
40
+ /**
41
+ * Individual agent result.
42
+ */
43
+ export interface AgentTaskResult {
44
+ agentId: string;
45
+ role: string;
46
+ success: boolean;
47
+ output: string;
48
+ artifacts?: Artifact[];
49
+ confidence?: number;
50
+ }
51
+ export interface Artifact {
52
+ type: string;
53
+ name: string;
54
+ content: string;
55
+ }
56
+ /**
57
+ * Team execution result.
58
+ */
59
+ export interface TeamResult {
60
+ success: boolean;
61
+ task: TeamTask;
62
+ agentResults: AgentTaskResult[];
63
+ consensus?: Decision;
64
+ coordinator: string;
65
+ duration: number;
66
+ }
67
+ export interface Decision {
68
+ agreed: boolean;
69
+ result: string;
70
+ votes: Map<string, boolean>;
71
+ dissent: string[];
72
+ }
73
+ /**
74
+ * Multi-agent events.
75
+ */
76
+ export type MultiAgentEvent = {
77
+ type: 'team.start';
78
+ task: TeamTask;
79
+ } | {
80
+ type: 'agent.spawn';
81
+ agentId: string;
82
+ role: string;
83
+ } | {
84
+ type: 'agent.working';
85
+ agentId: string;
86
+ status: string;
87
+ } | {
88
+ type: 'agent.complete';
89
+ agentId: string;
90
+ result: AgentTaskResult;
91
+ } | {
92
+ type: 'consensus.start';
93
+ strategy: ConsensusStrategy;
94
+ } | {
95
+ type: 'consensus.vote';
96
+ agentId: string;
97
+ vote: boolean;
98
+ } | {
99
+ type: 'consensus.reached';
100
+ decision: Decision;
101
+ } | {
102
+ type: 'team.complete';
103
+ result: TeamResult;
104
+ };
105
+ export type MultiAgentEventListener = (event: MultiAgentEvent) => void;
106
+ /**
107
+ * MultiAgentManager coordinates team-based task execution.
108
+ */
109
+ export declare class MultiAgentManager {
110
+ private roles;
111
+ private provider;
112
+ private tools;
113
+ private listeners;
114
+ constructor(provider: LLMProvider, tools: ToolDefinition[], initialRoles?: AgentRole[]);
115
+ /**
116
+ * Register an agent role.
117
+ */
118
+ registerRole(role: AgentRole): void;
119
+ /**
120
+ * Get all registered roles.
121
+ */
122
+ getRoles(): AgentRole[];
123
+ /**
124
+ * Find roles with specific capability.
125
+ */
126
+ findRolesWithCapability(capability: string): AgentRole[];
127
+ /**
128
+ * Execute task with a team.
129
+ */
130
+ runWithTeam(task: TeamTask, config: TeamConfig): Promise<TeamResult>;
131
+ /**
132
+ * Subscribe to events.
133
+ */
134
+ on(listener: MultiAgentEventListener): () => void;
135
+ private emit;
136
+ private selectCoordinator;
137
+ private selectAgents;
138
+ private runAgents;
139
+ private runSingleAgent;
140
+ private buildConsensus;
141
+ }
142
+ /**
143
+ * Create a multi-agent manager.
144
+ */
145
+ export declare function createMultiAgentManager(provider: LLMProvider, tools: ToolDefinition[], roles?: AgentRole[]): MultiAgentManager;
146
+ export declare const CODER_ROLE: AgentRole;
147
+ export declare const REVIEWER_ROLE: AgentRole;
148
+ export declare const ARCHITECT_ROLE: AgentRole;
149
+ export declare const RESEARCHER_ROLE: AgentRole;
150
+ //# sourceMappingURL=multi-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-agent.d.ts","sourceRoot":"","sources":["../../../../src/integrations/agents/multi-agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAkC,MAAM,gBAAgB,CAAC;AAMlG;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,E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