beth-copilot 1.0.18 → 2.0.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 (429) hide show
  1. package/CHANGELOG.md +79 -28
  2. package/README.md +127 -298
  3. package/assets/beth-questioning.png +0 -0
  4. package/assets/yellowstone-beth.png +0 -0
  5. package/bin/cli.js +124 -715
  6. package/dist/__tests__/inject-skills.test.d.ts +9 -0
  7. package/dist/__tests__/inject-skills.test.d.ts.map +1 -0
  8. package/dist/__tests__/inject-skills.test.js +143 -0
  9. package/dist/__tests__/inject-skills.test.js.map +1 -0
  10. package/dist/__tests__/skills/disambiguation.test.d.ts +10 -0
  11. package/dist/__tests__/skills/disambiguation.test.d.ts.map +1 -0
  12. package/dist/__tests__/skills/disambiguation.test.js +192 -0
  13. package/dist/__tests__/skills/disambiguation.test.js.map +1 -0
  14. package/dist/__tests__/skills/hook-injection.test.d.ts +11 -0
  15. package/dist/__tests__/skills/hook-injection.test.d.ts.map +1 -0
  16. package/dist/__tests__/skills/hook-injection.test.js +173 -0
  17. package/dist/__tests__/skills/hook-injection.test.js.map +1 -0
  18. package/dist/__tests__/skills/mapping-completeness.test.d.ts +17 -0
  19. package/dist/__tests__/skills/mapping-completeness.test.d.ts.map +1 -0
  20. package/dist/__tests__/skills/mapping-completeness.test.js +281 -0
  21. package/dist/__tests__/skills/mapping-completeness.test.js.map +1 -0
  22. package/dist/__tests__/skills/pipeline-integration.test.d.ts +18 -0
  23. package/dist/__tests__/skills/pipeline-integration.test.d.ts.map +1 -0
  24. package/dist/__tests__/skills/pipeline-integration.test.js +234 -0
  25. package/dist/__tests__/skills/pipeline-integration.test.js.map +1 -0
  26. package/dist/__tests__/skills/skill-routing.test.d.ts +15 -0
  27. package/dist/__tests__/skills/skill-routing.test.d.ts.map +1 -0
  28. package/dist/__tests__/skills/skill-routing.test.js +723 -0
  29. package/dist/__tests__/skills/skill-routing.test.js.map +1 -0
  30. package/dist/__tests__/skills/trigger-coverage.test.d.ts +24 -0
  31. package/dist/__tests__/skills/trigger-coverage.test.d.ts.map +1 -0
  32. package/dist/__tests__/skills/trigger-coverage.test.js +746 -0
  33. package/dist/__tests__/skills/trigger-coverage.test.js.map +1 -0
  34. package/dist/__tests__/smoke.test.d.ts +8 -0
  35. package/dist/__tests__/smoke.test.d.ts.map +1 -0
  36. package/dist/__tests__/smoke.test.js +62 -0
  37. package/dist/__tests__/smoke.test.js.map +1 -0
  38. package/dist/__tests__/verify-skills.test.d.ts +9 -0
  39. package/dist/__tests__/verify-skills.test.d.ts.map +1 -0
  40. package/dist/__tests__/verify-skills.test.js +78 -0
  41. package/dist/__tests__/verify-skills.test.js.map +1 -0
  42. package/dist/cli/commands/beads.e2e.test.d.ts +15 -0
  43. package/dist/cli/commands/beads.e2e.test.d.ts.map +1 -0
  44. package/dist/cli/commands/beads.e2e.test.js +585 -0
  45. package/dist/cli/commands/beads.e2e.test.js.map +1 -0
  46. package/dist/cli/commands/cli-edge-cases.e2e.test.d.ts +32 -0
  47. package/dist/cli/commands/cli-edge-cases.e2e.test.d.ts.map +1 -0
  48. package/dist/cli/commands/cli-edge-cases.e2e.test.js +162 -0
  49. package/dist/cli/commands/cli-edge-cases.e2e.test.js.map +1 -0
  50. package/dist/cli/commands/close.d.ts +54 -0
  51. package/dist/cli/commands/close.d.ts.map +1 -0
  52. package/dist/cli/commands/close.e2e.test.d.ts +11 -0
  53. package/dist/cli/commands/close.e2e.test.d.ts.map +1 -0
  54. package/dist/cli/commands/close.e2e.test.js +71 -0
  55. package/dist/cli/commands/close.e2e.test.js.map +1 -0
  56. package/dist/cli/commands/close.js +95 -0
  57. package/dist/cli/commands/close.js.map +1 -0
  58. package/dist/cli/commands/close.test.d.ts +13 -0
  59. package/dist/cli/commands/close.test.d.ts.map +1 -0
  60. package/dist/cli/commands/close.test.js +254 -0
  61. package/dist/cli/commands/close.test.js.map +1 -0
  62. package/dist/cli/commands/doctor.d.ts +7 -1
  63. package/dist/cli/commands/doctor.d.ts.map +1 -1
  64. package/dist/cli/commands/doctor.e2e.test.js +3 -59
  65. package/dist/cli/commands/doctor.e2e.test.js.map +1 -1
  66. package/dist/cli/commands/doctor.js +38 -18
  67. package/dist/cli/commands/doctor.js.map +1 -1
  68. package/dist/cli/commands/doctor.test.js +32 -25
  69. package/dist/cli/commands/doctor.test.js.map +1 -1
  70. package/dist/cli/commands/framework-isolation.test.d.ts +30 -0
  71. package/dist/cli/commands/framework-isolation.test.d.ts.map +1 -0
  72. package/dist/cli/commands/framework-isolation.test.js +118 -0
  73. package/dist/cli/commands/framework-isolation.test.js.map +1 -0
  74. package/dist/cli/commands/help.e2e.test.js +5 -9
  75. package/dist/cli/commands/help.e2e.test.js.map +1 -1
  76. package/dist/cli/commands/init-logic.e2e.test.d.ts +37 -0
  77. package/dist/cli/commands/init-logic.e2e.test.d.ts.map +1 -0
  78. package/dist/cli/commands/init-logic.e2e.test.js +315 -0
  79. package/dist/cli/commands/init-logic.e2e.test.js.map +1 -0
  80. package/dist/cli/commands/init.test.js +4 -21
  81. package/dist/cli/commands/init.test.js.map +1 -1
  82. package/dist/cli/commands/land.d.ts +130 -0
  83. package/dist/cli/commands/land.d.ts.map +1 -0
  84. package/dist/cli/commands/land.js +592 -0
  85. package/dist/cli/commands/land.js.map +1 -0
  86. package/dist/cli/commands/land.test.d.ts +19 -0
  87. package/dist/cli/commands/land.test.d.ts.map +1 -0
  88. package/dist/cli/commands/land.test.js +567 -0
  89. package/dist/cli/commands/land.test.js.map +1 -0
  90. package/dist/cli/commands/mcp.e2e.test.js +24 -31
  91. package/dist/cli/commands/mcp.e2e.test.js.map +1 -1
  92. package/dist/cli/commands/pipeline.e2e.test.js +28 -31
  93. package/dist/cli/commands/pipeline.e2e.test.js.map +1 -1
  94. package/dist/cli/commands/pre-push-guard.d.ts +74 -0
  95. package/dist/cli/commands/pre-push-guard.d.ts.map +1 -0
  96. package/dist/cli/commands/pre-push-guard.e2e.test.d.ts +24 -0
  97. package/dist/cli/commands/pre-push-guard.e2e.test.d.ts.map +1 -0
  98. package/dist/cli/commands/pre-push-guard.e2e.test.js +171 -0
  99. package/dist/cli/commands/pre-push-guard.e2e.test.js.map +1 -0
  100. package/dist/cli/commands/pre-push-guard.js +212 -0
  101. package/dist/cli/commands/pre-push-guard.js.map +1 -0
  102. package/dist/cli/commands/pre-push-guard.test.d.ts +14 -0
  103. package/dist/cli/commands/pre-push-guard.test.d.ts.map +1 -0
  104. package/dist/cli/commands/pre-push-guard.test.js +314 -0
  105. package/dist/cli/commands/pre-push-guard.test.js.map +1 -0
  106. package/dist/cli/commands/quickstart-expanded.e2e.test.d.ts +23 -0
  107. package/dist/cli/commands/quickstart-expanded.e2e.test.d.ts.map +1 -0
  108. package/dist/cli/commands/quickstart-expanded.e2e.test.js +152 -0
  109. package/dist/cli/commands/quickstart-expanded.e2e.test.js.map +1 -0
  110. package/dist/cli/commands/quickstart.d.ts +0 -1
  111. package/dist/cli/commands/quickstart.d.ts.map +1 -1
  112. package/dist/cli/commands/quickstart.js +9 -83
  113. package/dist/cli/commands/quickstart.js.map +1 -1
  114. package/dist/cli/commands/quickstart.test.js +8 -129
  115. package/dist/cli/commands/quickstart.test.js.map +1 -1
  116. package/dist/cli/commands/update.d.ts +35 -0
  117. package/dist/cli/commands/update.d.ts.map +1 -0
  118. package/dist/cli/commands/update.e2e.test.d.ts +24 -0
  119. package/dist/cli/commands/update.e2e.test.d.ts.map +1 -0
  120. package/dist/cli/commands/update.e2e.test.js +240 -0
  121. package/dist/cli/commands/update.e2e.test.js.map +1 -0
  122. package/dist/cli/commands/update.js +255 -0
  123. package/dist/cli/commands/update.js.map +1 -0
  124. package/dist/core/agents/frontmatter.test.js +1 -1
  125. package/dist/core/agents/frontmatter.test.js.map +1 -1
  126. package/dist/core/agents/handoffs.test.js +1 -1
  127. package/dist/core/agents/handoffs.test.js.map +1 -1
  128. package/dist/core/agents/loader.d.ts +4 -2
  129. package/dist/core/agents/loader.d.ts.map +1 -1
  130. package/dist/core/agents/loader.js +5 -3
  131. package/dist/core/agents/loader.js.map +1 -1
  132. package/dist/core/agents/loader.test.js +42 -4
  133. package/dist/core/agents/loader.test.js.map +1 -1
  134. package/dist/core/agents/suite.test.js +12 -9
  135. package/dist/core/agents/suite.test.js.map +1 -1
  136. package/dist/core/agents/tools.test.js +15 -9
  137. package/dist/core/agents/tools.test.js.map +1 -1
  138. package/dist/core/agents/types.test.js +1 -1
  139. package/dist/core/agents/types.test.js.map +1 -1
  140. package/dist/core/skills/loader.test.js +1 -1
  141. package/dist/core/skills/loader.test.js.map +1 -1
  142. package/dist/index.d.ts +3 -11
  143. package/dist/index.d.ts.map +1 -1
  144. package/dist/index.js +5 -12
  145. package/dist/index.js.map +1 -1
  146. package/dist/lib/pathValidation.d.ts +0 -5
  147. package/dist/lib/pathValidation.d.ts.map +1 -1
  148. package/dist/lib/pathValidation.js +0 -11
  149. package/dist/lib/pathValidation.js.map +1 -1
  150. package/dist/lib/pathValidation.test.js +2 -14
  151. package/dist/lib/pathValidation.test.js.map +1 -1
  152. package/package.json +13 -10
  153. package/sbom.json +1927 -847
  154. package/templates/.github/agents/beth.agent.md +331 -105
  155. package/templates/.github/agents/developer.agent.md +73 -102
  156. package/templates/.github/agents/product-manager.agent.md +24 -68
  157. package/templates/.github/agents/researcher.agent.md +21 -69
  158. package/templates/.github/agents/security-reviewer.agent.md +39 -82
  159. package/templates/.github/agents/tester.agent.md +44 -65
  160. package/templates/.github/agents/ux-designer.agent.md +25 -76
  161. package/templates/.github/copilot-instructions.md +246 -225
  162. package/templates/.github/copilot-mcp-config.json +12 -0
  163. package/templates/.github/dependabot.yml +68 -0
  164. package/templates/.github/hooks/scripts/inject-skills.mjs +139 -0
  165. package/templates/.github/hooks/scripts/verify-skills.mjs +47 -0
  166. package/templates/.github/hooks/skill-enforcement.json +18 -0
  167. package/templates/.github/pull_request_template.md +48 -0
  168. package/templates/.github/skills/framer-components/SKILL.md +0 -0
  169. package/templates/.github/skills/prd/SKILL.md +0 -0
  170. package/templates/.github/skills/security-analysis/SKILL.md +798 -798
  171. package/templates/.github/skills/shadcn-ui/SKILL.md +561 -561
  172. package/templates/.github/skills/vercel-react-best-practices/AGENTS.md +0 -0
  173. package/templates/.github/skills/vercel-react-best-practices/SKILL.md +0 -0
  174. package/templates/.github/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -0
  175. package/templates/.github/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -0
  176. package/templates/.github/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -0
  177. package/templates/.github/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -0
  178. package/templates/.github/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -0
  179. package/templates/.github/skills/vercel-react-best-practices/rules/async-parallel.md +0 -0
  180. package/templates/.github/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -0
  181. package/templates/.github/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -0
  182. package/templates/.github/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -0
  183. package/templates/.github/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -0
  184. package/templates/.github/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -0
  185. package/templates/.github/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -0
  186. package/templates/.github/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -0
  187. package/templates/.github/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -0
  188. package/templates/.github/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -0
  189. package/templates/.github/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -0
  190. package/templates/.github/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -0
  191. package/templates/.github/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -0
  192. package/templates/.github/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -0
  193. package/templates/.github/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -0
  194. package/templates/.github/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -0
  195. package/templates/.github/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -0
  196. package/templates/.github/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -0
  197. package/templates/.github/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -0
  198. package/templates/.github/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -0
  199. package/templates/.github/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -0
  200. package/templates/.github/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -0
  201. package/templates/.github/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -0
  202. package/templates/.github/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -0
  203. package/templates/.github/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -0
  204. package/templates/.github/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -0
  205. package/templates/.github/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -0
  206. package/templates/.github/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -0
  207. package/templates/.github/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -0
  208. package/templates/.github/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -0
  209. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -0
  210. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -0
  211. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -0
  212. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -0
  213. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -0
  214. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -0
  215. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -0
  216. package/templates/.github/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -0
  217. package/templates/.github/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -0
  218. package/templates/.github/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -0
  219. package/templates/.github/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -0
  220. package/templates/.github/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -0
  221. package/templates/.github/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -0
  222. package/templates/.github/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -0
  223. package/templates/.github/skills/vercel-react-best-practices/rules/server-serialization.md +0 -0
  224. package/templates/.github/skills/web-design-guidelines/SKILL.md +0 -0
  225. package/templates/.vscode/settings.json +16 -16
  226. package/templates/AGENTS.md +103 -54
  227. package/templates/Backlog.md +80 -80
  228. package/templates/mcp.json.example +0 -3
  229. package/assets/beth-portrait-small.txt +0 -13
  230. package/assets/beth-portrait.txt +0 -60
  231. package/bin/beth-animation.sh +0 -155
  232. package/bin/lib/animation.js +0 -189
  233. package/bin/lib/pathValidation.js +0 -233
  234. package/bin/lib/pathValidation.test.js +0 -280
  235. package/dist/cli/commands/client-config.d.ts +0 -31
  236. package/dist/cli/commands/client-config.d.ts.map +0 -1
  237. package/dist/cli/commands/client-config.e2e.test.d.ts +0 -15
  238. package/dist/cli/commands/client-config.e2e.test.d.ts.map +0 -1
  239. package/dist/cli/commands/client-config.e2e.test.js +0 -556
  240. package/dist/cli/commands/client-config.e2e.test.js.map +0 -1
  241. package/dist/cli/commands/client-config.js +0 -73
  242. package/dist/cli/commands/client-config.js.map +0 -1
  243. package/dist/cli/commands/client-config.test.d.ts +0 -6
  244. package/dist/cli/commands/client-config.test.d.ts.map +0 -1
  245. package/dist/cli/commands/client-config.test.js +0 -133
  246. package/dist/cli/commands/client-config.test.js.map +0 -1
  247. package/dist/cli/commands/init-quickstart.e2e.test.d.ts +0 -11
  248. package/dist/cli/commands/init-quickstart.e2e.test.d.ts.map +0 -1
  249. package/dist/cli/commands/init-quickstart.e2e.test.js +0 -221
  250. package/dist/cli/commands/init-quickstart.e2e.test.js.map +0 -1
  251. package/dist/core/context.d.ts +0 -171
  252. package/dist/core/context.d.ts.map +0 -1
  253. package/dist/core/context.js +0 -353
  254. package/dist/core/context.js.map +0 -1
  255. package/dist/core/context.test.d.ts +0 -8
  256. package/dist/core/context.test.d.ts.map +0 -1
  257. package/dist/core/context.test.js +0 -253
  258. package/dist/core/context.test.js.map +0 -1
  259. package/dist/core/handoffs.d.ts +0 -151
  260. package/dist/core/handoffs.d.ts.map +0 -1
  261. package/dist/core/handoffs.js +0 -220
  262. package/dist/core/handoffs.js.map +0 -1
  263. package/dist/core/handoffs.test.d.ts +0 -8
  264. package/dist/core/handoffs.test.d.ts.map +0 -1
  265. package/dist/core/handoffs.test.js +0 -231
  266. package/dist/core/handoffs.test.js.map +0 -1
  267. package/dist/core/orchestrator.d.ts +0 -246
  268. package/dist/core/orchestrator.d.ts.map +0 -1
  269. package/dist/core/orchestrator.js +0 -514
  270. package/dist/core/orchestrator.js.map +0 -1
  271. package/dist/core/orchestrator.test.d.ts +0 -8
  272. package/dist/core/orchestrator.test.d.ts.map +0 -1
  273. package/dist/core/orchestrator.test.js +0 -517
  274. package/dist/core/orchestrator.test.js.map +0 -1
  275. package/dist/core/router.d.ts +0 -102
  276. package/dist/core/router.d.ts.map +0 -1
  277. package/dist/core/router.js +0 -178
  278. package/dist/core/router.js.map +0 -1
  279. package/dist/core/router.test.d.ts +0 -8
  280. package/dist/core/router.test.d.ts.map +0 -1
  281. package/dist/core/router.test.js +0 -215
  282. package/dist/core/router.test.js.map +0 -1
  283. package/dist/init.test.js +0 -288
  284. package/dist/providers/azure.d.ts +0 -147
  285. package/dist/providers/azure.d.ts.map +0 -1
  286. package/dist/providers/azure.js +0 -491
  287. package/dist/providers/azure.js.map +0 -1
  288. package/dist/providers/azure.test.d.ts +0 -11
  289. package/dist/providers/azure.test.d.ts.map +0 -1
  290. package/dist/providers/azure.test.js +0 -330
  291. package/dist/providers/azure.test.js.map +0 -1
  292. package/dist/providers/config.d.ts +0 -87
  293. package/dist/providers/config.d.ts.map +0 -1
  294. package/dist/providers/config.js +0 -193
  295. package/dist/providers/config.js.map +0 -1
  296. package/dist/providers/config.test.d.ts +0 -7
  297. package/dist/providers/config.test.d.ts.map +0 -1
  298. package/dist/providers/config.test.js +0 -370
  299. package/dist/providers/config.test.js.map +0 -1
  300. package/dist/providers/index.d.ts +0 -18
  301. package/dist/providers/index.d.ts.map +0 -1
  302. package/dist/providers/index.js +0 -14
  303. package/dist/providers/index.js.map +0 -1
  304. package/dist/providers/interface.d.ts +0 -191
  305. package/dist/providers/interface.d.ts.map +0 -1
  306. package/dist/providers/interface.js +0 -94
  307. package/dist/providers/interface.js.map +0 -1
  308. package/dist/providers/retry.d.ts +0 -128
  309. package/dist/providers/retry.d.ts.map +0 -1
  310. package/dist/providers/retry.js +0 -205
  311. package/dist/providers/retry.js.map +0 -1
  312. package/dist/providers/retry.test.d.ts +0 -7
  313. package/dist/providers/retry.test.d.ts.map +0 -1
  314. package/dist/providers/retry.test.js +0 -439
  315. package/dist/providers/retry.test.js.map +0 -1
  316. package/dist/providers/streaming.d.ts +0 -157
  317. package/dist/providers/streaming.d.ts.map +0 -1
  318. package/dist/providers/streaming.js +0 -233
  319. package/dist/providers/streaming.js.map +0 -1
  320. package/dist/providers/streaming.test.d.ts +0 -7
  321. package/dist/providers/streaming.test.d.ts.map +0 -1
  322. package/dist/providers/streaming.test.js +0 -372
  323. package/dist/providers/streaming.test.js.map +0 -1
  324. package/dist/providers/types.d.ts +0 -209
  325. package/dist/providers/types.d.ts.map +0 -1
  326. package/dist/providers/types.js +0 -53
  327. package/dist/providers/types.js.map +0 -1
  328. package/dist/providers/types.test.d.ts +0 -7
  329. package/dist/providers/types.test.d.ts.map +0 -1
  330. package/dist/providers/types.test.js +0 -141
  331. package/dist/providers/types.test.js.map +0 -1
  332. package/dist/tools/cli/beads.d.ts +0 -27
  333. package/dist/tools/cli/beads.d.ts.map +0 -1
  334. package/dist/tools/cli/beads.js +0 -172
  335. package/dist/tools/cli/beads.js.map +0 -1
  336. package/dist/tools/cli/beads.test.d.ts +0 -8
  337. package/dist/tools/cli/beads.test.d.ts.map +0 -1
  338. package/dist/tools/cli/beads.test.js +0 -264
  339. package/dist/tools/cli/beads.test.js.map +0 -1
  340. package/dist/tools/cli/editFile.d.ts +0 -17
  341. package/dist/tools/cli/editFile.d.ts.map +0 -1
  342. package/dist/tools/cli/editFile.js +0 -125
  343. package/dist/tools/cli/editFile.js.map +0 -1
  344. package/dist/tools/cli/editFile.test.d.ts +0 -8
  345. package/dist/tools/cli/editFile.test.d.ts.map +0 -1
  346. package/dist/tools/cli/editFile.test.js +0 -177
  347. package/dist/tools/cli/editFile.test.js.map +0 -1
  348. package/dist/tools/cli/readFile.d.ts +0 -25
  349. package/dist/tools/cli/readFile.d.ts.map +0 -1
  350. package/dist/tools/cli/readFile.js +0 -118
  351. package/dist/tools/cli/readFile.js.map +0 -1
  352. package/dist/tools/cli/readFile.test.d.ts +0 -8
  353. package/dist/tools/cli/readFile.test.d.ts.map +0 -1
  354. package/dist/tools/cli/readFile.test.js +0 -194
  355. package/dist/tools/cli/readFile.test.js.map +0 -1
  356. package/dist/tools/cli/search.d.ts +0 -16
  357. package/dist/tools/cli/search.d.ts.map +0 -1
  358. package/dist/tools/cli/search.js +0 -261
  359. package/dist/tools/cli/search.js.map +0 -1
  360. package/dist/tools/cli/search.test.d.ts +0 -8
  361. package/dist/tools/cli/search.test.d.ts.map +0 -1
  362. package/dist/tools/cli/search.test.js +0 -172
  363. package/dist/tools/cli/search.test.js.map +0 -1
  364. package/dist/tools/cli/subagent.d.ts +0 -43
  365. package/dist/tools/cli/subagent.d.ts.map +0 -1
  366. package/dist/tools/cli/subagent.js +0 -99
  367. package/dist/tools/cli/subagent.js.map +0 -1
  368. package/dist/tools/cli/subagent.test.d.ts +0 -8
  369. package/dist/tools/cli/subagent.test.d.ts.map +0 -1
  370. package/dist/tools/cli/subagent.test.js +0 -190
  371. package/dist/tools/cli/subagent.test.js.map +0 -1
  372. package/dist/tools/cli/terminal.d.ts +0 -19
  373. package/dist/tools/cli/terminal.d.ts.map +0 -1
  374. package/dist/tools/cli/terminal.js +0 -164
  375. package/dist/tools/cli/terminal.js.map +0 -1
  376. package/dist/tools/cli/terminal.test.d.ts +0 -8
  377. package/dist/tools/cli/terminal.test.d.ts.map +0 -1
  378. package/dist/tools/cli/terminal.test.js +0 -161
  379. package/dist/tools/cli/terminal.test.js.map +0 -1
  380. package/dist/tools/index.d.ts +0 -25
  381. package/dist/tools/index.d.ts.map +0 -1
  382. package/dist/tools/index.js +0 -41
  383. package/dist/tools/index.js.map +0 -1
  384. package/dist/tools/interface.d.ts +0 -64
  385. package/dist/tools/interface.d.ts.map +0 -1
  386. package/dist/tools/interface.js +0 -37
  387. package/dist/tools/interface.js.map +0 -1
  388. package/dist/tools/interface.test.d.ts +0 -7
  389. package/dist/tools/interface.test.d.ts.map +0 -1
  390. package/dist/tools/interface.test.js +0 -179
  391. package/dist/tools/interface.test.js.map +0 -1
  392. package/dist/tools/mcp/bridge.d.ts +0 -48
  393. package/dist/tools/mcp/bridge.d.ts.map +0 -1
  394. package/dist/tools/mcp/bridge.js +0 -128
  395. package/dist/tools/mcp/bridge.js.map +0 -1
  396. package/dist/tools/mcp/bridge.test.d.ts +0 -8
  397. package/dist/tools/mcp/bridge.test.d.ts.map +0 -1
  398. package/dist/tools/mcp/bridge.test.js +0 -300
  399. package/dist/tools/mcp/bridge.test.js.map +0 -1
  400. package/dist/tools/mcp/client.d.ts +0 -135
  401. package/dist/tools/mcp/client.d.ts.map +0 -1
  402. package/dist/tools/mcp/client.js +0 -263
  403. package/dist/tools/mcp/client.js.map +0 -1
  404. package/dist/tools/mcp/client.test.d.ts +0 -8
  405. package/dist/tools/mcp/client.test.d.ts.map +0 -1
  406. package/dist/tools/mcp/client.test.js +0 -390
  407. package/dist/tools/mcp/client.test.js.map +0 -1
  408. package/dist/tools/registry.d.ts +0 -82
  409. package/dist/tools/registry.d.ts.map +0 -1
  410. package/dist/tools/registry.js +0 -99
  411. package/dist/tools/registry.js.map +0 -1
  412. package/dist/tools/registry.test.d.ts +0 -7
  413. package/dist/tools/registry.test.d.ts.map +0 -1
  414. package/dist/tools/registry.test.js +0 -199
  415. package/dist/tools/registry.test.js.map +0 -1
  416. package/dist/tools/suite.test.d.ts +0 -11
  417. package/dist/tools/suite.test.d.ts.map +0 -1
  418. package/dist/tools/suite.test.js +0 -119
  419. package/dist/tools/suite.test.js.map +0 -1
  420. package/dist/tools/types.d.ts +0 -75
  421. package/dist/tools/types.d.ts.map +0 -1
  422. package/dist/tools/types.js +0 -30
  423. package/dist/tools/types.js.map +0 -1
  424. package/dist/tools/types.test.d.ts +0 -7
  425. package/dist/tools/types.test.d.ts.map +0 -1
  426. package/dist/tools/types.test.js +0 -178
  427. package/dist/tools/types.test.js.map +0 -1
  428. package/templates/.vscode/mcp.json +0 -20
  429. package/templates/CLAUDE.md +0 -129
@@ -1,517 +0,0 @@
1
- /**
2
- * Orchestrator Tests
3
- *
4
- * Integration tests for the full agent loop: routing → LLM → tool calls → response.
5
- * Uses mock LLM provider and tools to verify the orchestration flow.
6
- */
7
- import { describe, it } from 'node:test';
8
- import assert from 'node:assert';
9
- import { Orchestrator } from './orchestrator.js';
10
- import { LLMProviderBase } from '../providers/interface.js';
11
- import { ToolRegistry } from '../tools/registry.js';
12
- // =============================================================================
13
- // Mock LLM Provider
14
- // =============================================================================
15
- /** Minimal TokenCredential stub for tests */
16
- const mockCredential = { getToken: async () => ({ token: 'test', expiresOnTimestamp: Date.now() + 3600000 }) };
17
- /**
18
- * A mock LLM provider that returns predetermined responses.
19
- * Extends LLMProviderBase so it satisfies the type hierarchy.
20
- */
21
- class MockProvider extends LLMProviderBase {
22
- responses = [];
23
- callCount = 0;
24
- chatCallCount = 0;
25
- constructor() {
26
- super({
27
- provider: 'azure-openai',
28
- model: 'test-model',
29
- endpoint: 'https://test.openai.azure.com',
30
- credential: mockCredential,
31
- });
32
- }
33
- get name() { return 'mock'; }
34
- get isConfigured() { return true; }
35
- /** Queue a text response */
36
- addTextResponse(content) {
37
- this.responses.push({ content });
38
- }
39
- /** Queue a tool call response */
40
- addToolCallResponse(toolCalls, content) {
41
- this.responses.push({ content: content ?? '', toolCalls });
42
- }
43
- async chat(_messages, _options) {
44
- this.chatCallCount++;
45
- const response = this.responses[this.callCount++];
46
- if (!response) {
47
- return {
48
- id: `resp-${this.callCount}`,
49
- choices: [{ index: 0, message: { role: 'assistant', content: 'No more responses queued.' }, finish_reason: 'stop' }],
50
- usage: { prompt_tokens: 10, completion_tokens: 5, total_tokens: 15 },
51
- };
52
- }
53
- const message = {
54
- role: 'assistant',
55
- content: response.content,
56
- tool_calls: response.toolCalls,
57
- };
58
- return {
59
- id: `resp-${this.callCount}`,
60
- choices: [{ index: 0, message, finish_reason: response.toolCalls ? 'tool_calls' : 'stop' }],
61
- usage: { prompt_tokens: 10, completion_tokens: 5, total_tokens: 15 },
62
- };
63
- }
64
- async *chatStream(messages, options) {
65
- const response = await this.chat(messages, options);
66
- const choice = response.choices[0];
67
- yield {
68
- id: response.id,
69
- content: choice.message.content,
70
- role: 'assistant',
71
- finish_reason: choice.finish_reason,
72
- };
73
- }
74
- async countTokens(_messages) {
75
- return 100;
76
- }
77
- }
78
- // =============================================================================
79
- // Test Fixtures
80
- // =============================================================================
81
- function createAgent(id, name, tools, infer) {
82
- return {
83
- id,
84
- frontmatter: {
85
- name,
86
- description: `${name} agent`,
87
- tools: tools ?? ['readFile', 'editFiles'],
88
- infer: infer ?? true,
89
- handoffs: [],
90
- },
91
- body: `# ${name}\n\nYou are ${name}.`,
92
- sourcePath: `/agents/${id}.agent.md`,
93
- };
94
- }
95
- function createSkill(id, triggers) {
96
- return {
97
- id,
98
- frontmatter: { name: id, description: `Triggers on: ${triggers.join(', ')}` },
99
- body: `Skill content for ${id}`,
100
- sourcePath: `/skills/${id}/SKILL.md`,
101
- triggers,
102
- };
103
- }
104
- /** Create a simple echo tool for testing */
105
- function createEchoTool() {
106
- return {
107
- name: 'echo',
108
- description: 'Echoes input back',
109
- inputSchema: {
110
- type: 'object',
111
- properties: { message: { type: 'string', description: 'Message to echo' } },
112
- required: ['message'],
113
- },
114
- async execute(input) {
115
- return { success: true, output: `Echo: ${input.message}` };
116
- },
117
- };
118
- }
119
- /** Create a readFile tool stub for testing */
120
- function createReadFileTool() {
121
- return {
122
- name: 'readFile',
123
- description: 'Read a file',
124
- inputSchema: {
125
- type: 'object',
126
- properties: { path: { type: 'string', description: 'File path' } },
127
- required: ['path'],
128
- },
129
- async execute(input) {
130
- return { success: true, output: `Contents of ${input.path}` };
131
- },
132
- };
133
- }
134
- /** Create a subagent tool stub that returns pending metadata */
135
- function createSubagentTool() {
136
- return {
137
- name: 'subagent',
138
- description: 'Spawn a subagent',
139
- inputSchema: {
140
- type: 'object',
141
- properties: {
142
- agentName: { type: 'string' },
143
- prompt: { type: 'string' },
144
- description: { type: 'string' },
145
- },
146
- required: ['agentName', 'prompt'],
147
- },
148
- async execute(input) {
149
- return {
150
- success: true,
151
- output: `Subagent request: ${input.agentName}`,
152
- metadata: {
153
- agentName: input.agentName,
154
- prompt: input.prompt,
155
- description: input.description,
156
- status: 'pending',
157
- },
158
- };
159
- },
160
- };
161
- }
162
- function createToolContext() {
163
- return {
164
- workingDir: '/test',
165
- permissions: {
166
- allowFileRead: true,
167
- allowFileWrite: true,
168
- allowTerminal: true,
169
- allowNetwork: true,
170
- },
171
- };
172
- }
173
- function createOrchestratorConfig(provider, registry, agents, skills) {
174
- const agentList = agents ?? [
175
- createAgent('beth', 'Beth'),
176
- createAgent('developer', 'developer'),
177
- createAgent('tester', 'tester'),
178
- ];
179
- return {
180
- agents: { agents: agentList, errors: [] },
181
- skills: { skills: skills ?? [], errors: [] },
182
- provider,
183
- toolRegistry: registry ?? new ToolRegistry(),
184
- toolContext: createToolContext(),
185
- defaultAgentId: 'beth',
186
- maxIterations: 10,
187
- maxSubagentDepth: 2,
188
- };
189
- }
190
- // =============================================================================
191
- // Tests
192
- // =============================================================================
193
- describe('Orchestrator', () => {
194
- describe('Basic message processing', () => {
195
- it('should process a simple text response', async () => {
196
- const provider = new MockProvider();
197
- provider.addTextResponse('Hello! How can I help?');
198
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
199
- const result = await orchestrator.processMessage('Hello');
200
- assert.strictEqual(result.response, 'Hello! How can I help?');
201
- assert.strictEqual(result.agentId, 'beth');
202
- assert.strictEqual(result.iterations, 1);
203
- assert.strictEqual(result.toolCallsExecuted.length, 0);
204
- });
205
- it('should default to beth agent', async () => {
206
- const provider = new MockProvider();
207
- provider.addTextResponse('I am Beth.');
208
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
209
- const result = await orchestrator.processMessage('Who are you?');
210
- assert.strictEqual(result.agentId, 'beth');
211
- assert.strictEqual(result.routeReason, 'default');
212
- });
213
- it('should route @developer mention to developer', async () => {
214
- const provider = new MockProvider();
215
- provider.addTextResponse('I will implement that.');
216
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
217
- const result = await orchestrator.processMessage('@developer implement login');
218
- assert.strictEqual(result.agentId, 'developer');
219
- assert.strictEqual(result.routeReason, 'mention');
220
- });
221
- });
222
- describe('Tool calling loop', () => {
223
- it('should execute tool calls and return final response', async () => {
224
- const provider = new MockProvider();
225
- // First response: tool call
226
- provider.addToolCallResponse([
227
- { id: 'tc1', type: 'function', function: { name: 'readFile', arguments: '{"path":"test.ts"}' } },
228
- ]);
229
- // Second response: text (after seeing tool result)
230
- provider.addTextResponse('The file contains test code.');
231
- const registry = new ToolRegistry();
232
- registry.register(createReadFileTool());
233
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, registry));
234
- const result = await orchestrator.processMessage('Read test.ts');
235
- assert.strictEqual(result.response, 'The file contains test code.');
236
- assert.strictEqual(result.iterations, 2);
237
- assert.strictEqual(result.toolCallsExecuted.length, 1);
238
- assert.strictEqual(result.toolCallsExecuted[0].name, 'readFile');
239
- assert.strictEqual(result.toolCallsExecuted[0].success, true);
240
- });
241
- it('should handle multiple tool calls in one response', async () => {
242
- const provider = new MockProvider();
243
- // Two tool calls in one response
244
- provider.addToolCallResponse([
245
- { id: 'tc1', type: 'function', function: { name: 'echo', arguments: '{"message":"hello"}' } },
246
- { id: 'tc2', type: 'function', function: { name: 'readFile', arguments: '{"path":"a.ts"}' } },
247
- ]);
248
- provider.addTextResponse('Done with both.');
249
- const registry = new ToolRegistry();
250
- registry.register(createEchoTool());
251
- registry.register(createReadFileTool());
252
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, registry));
253
- const result = await orchestrator.processMessage('Do two things');
254
- assert.strictEqual(result.response, 'Done with both.');
255
- assert.strictEqual(result.toolCallsExecuted.length, 2);
256
- });
257
- it('should handle unknown tool gracefully', async () => {
258
- const provider = new MockProvider();
259
- provider.addToolCallResponse([
260
- { id: 'tc1', type: 'function', function: { name: 'unknownTool', arguments: '{}' } },
261
- ]);
262
- provider.addTextResponse('Could not find that tool.');
263
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
264
- const result = await orchestrator.processMessage('Use unknown tool');
265
- assert.strictEqual(result.toolCallsExecuted.length, 1);
266
- assert.strictEqual(result.toolCallsExecuted[0].success, false);
267
- assert.ok(result.toolCallsExecuted[0].output.includes('not found'));
268
- });
269
- it('should handle invalid JSON arguments gracefully', async () => {
270
- const provider = new MockProvider();
271
- provider.addToolCallResponse([
272
- { id: 'tc1', type: 'function', function: { name: 'echo', arguments: 'not json' } },
273
- ]);
274
- provider.addTextResponse('That did not work.');
275
- const registry = new ToolRegistry();
276
- registry.register(createEchoTool());
277
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, registry));
278
- const result = await orchestrator.processMessage('Bad args');
279
- assert.strictEqual(result.toolCallsExecuted[0].success, false);
280
- assert.ok(result.toolCallsExecuted[0].output.includes('Invalid JSON'));
281
- });
282
- it('should respect max iterations', async () => {
283
- const provider = new MockProvider();
284
- // Keep returning tool calls forever
285
- for (let i = 0; i < 15; i++) {
286
- provider.addToolCallResponse([
287
- { id: `tc${i}`, type: 'function', function: { name: 'echo', arguments: `{"message":"loop ${i}"}` } },
288
- ]);
289
- }
290
- const registry = new ToolRegistry();
291
- registry.register(createEchoTool());
292
- const config = createOrchestratorConfig(provider, registry);
293
- config.maxIterations = 5;
294
- const orchestrator = new Orchestrator(config);
295
- const result = await orchestrator.processMessage('Loop forever');
296
- assert.strictEqual(result.iterations, 5);
297
- assert.ok(result.response.includes('maximum iterations'));
298
- });
299
- });
300
- describe('Skill injection', () => {
301
- it('should inject matching skills into context', async () => {
302
- const provider = new MockProvider();
303
- provider.addTextResponse('I will create the PRD.');
304
- const skills = [createSkill('prd', ['create a prd', 'product requirements'])];
305
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, undefined, undefined, skills));
306
- const result = await orchestrator.processMessage('create a prd for auth');
307
- assert.strictEqual(result.injectedSkills.length, 1);
308
- assert.strictEqual(result.injectedSkills[0], 'prd');
309
- });
310
- it('should not inject the same skill twice', async () => {
311
- const provider = new MockProvider();
312
- provider.addTextResponse('First response.');
313
- provider.addTextResponse('Second response.');
314
- const skills = [createSkill('prd', ['create a prd'])];
315
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, undefined, undefined, skills));
316
- const result1 = await orchestrator.processMessage('create a prd for auth');
317
- assert.strictEqual(result1.injectedSkills.length, 1);
318
- const result2 = await orchestrator.processMessage('create a prd for billing');
319
- assert.strictEqual(result2.injectedSkills.length, 0);
320
- });
321
- });
322
- describe('Subagent handling', () => {
323
- it('should handle subagent tool calls', async () => {
324
- const provider = new MockProvider();
325
- // Main agent calls subagent
326
- provider.addToolCallResponse([
327
- {
328
- id: 'tc1',
329
- type: 'function',
330
- function: {
331
- name: 'subagent',
332
- arguments: JSON.stringify({ agentName: 'developer', prompt: 'Build login' }),
333
- },
334
- },
335
- ]);
336
- // Subagent's LLM response
337
- provider.addTextResponse('Login component built successfully.');
338
- // Main agent's final response
339
- provider.addTextResponse('The developer has built the login component.');
340
- const registry = new ToolRegistry();
341
- registry.register(createSubagentTool());
342
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, registry));
343
- const result = await orchestrator.processMessage('Build a login page');
344
- assert.strictEqual(result.subagentResults.length, 1);
345
- assert.strictEqual(result.subagentResults[0].agentId, 'developer');
346
- assert.strictEqual(result.subagentResults[0].success, true);
347
- });
348
- it('should fail gracefully for unknown subagent', async () => {
349
- const provider = new MockProvider();
350
- provider.addToolCallResponse([
351
- {
352
- id: 'tc1',
353
- type: 'function',
354
- function: {
355
- name: 'subagent',
356
- arguments: JSON.stringify({ agentName: 'nonexistent', prompt: 'Do stuff' }),
357
- },
358
- },
359
- ]);
360
- provider.addTextResponse('That agent does not exist.');
361
- const registry = new ToolRegistry();
362
- registry.register(createSubagentTool());
363
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, registry));
364
- const result = await orchestrator.processMessage('Call nonexistent agent');
365
- assert.strictEqual(result.subagentResults.length, 1);
366
- assert.strictEqual(result.subagentResults[0].success, false);
367
- assert.ok(result.subagentResults[0].response.includes('not found'));
368
- });
369
- it('should respect subagent depth limit', async () => {
370
- const provider = new MockProvider();
371
- // Keep requesting subagents
372
- for (let i = 0; i < 5; i++) {
373
- provider.addToolCallResponse([
374
- {
375
- id: `tc${i}`,
376
- type: 'function',
377
- function: {
378
- name: 'subagent',
379
- arguments: JSON.stringify({ agentName: 'developer', prompt: `Depth ${i}` }),
380
- },
381
- },
382
- ]);
383
- }
384
- // Subagent responses
385
- for (let i = 0; i < 5; i++) {
386
- provider.addTextResponse(`Done at depth ${i}`);
387
- }
388
- provider.addTextResponse('All done.');
389
- const registry = new ToolRegistry();
390
- registry.register(createSubagentTool());
391
- const config = createOrchestratorConfig(provider, registry);
392
- config.maxSubagentDepth = 1;
393
- const orchestrator = new Orchestrator(config);
394
- const result = await orchestrator.processMessage('Go deep');
395
- // At least one subagent should have been depth-limited
396
- const hasFailures = result.subagentResults.some((r) => !r.success);
397
- // Depends on exact execution: first call succeeds (depth 0→1), nested would fail
398
- assert.ok(result.subagentResults.length > 0 || hasFailures);
399
- });
400
- });
401
- describe('Handoffs', () => {
402
- it('should execute a handoff to another agent', async () => {
403
- const provider = new MockProvider();
404
- provider.addTextResponse('I am Beth.');
405
- provider.addTextResponse('I am developer now.');
406
- const agents = [
407
- createAgent('beth', 'Beth'),
408
- createAgent('developer', 'developer'),
409
- ];
410
- agents[0].frontmatter.handoffs = [
411
- { label: 'Dev', agent: 'developer', prompt: 'code this', send: false },
412
- ];
413
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, undefined, agents));
414
- // First message goes to Beth
415
- await orchestrator.processMessage('Hello Beth');
416
- assert.strictEqual(orchestrator.getActiveAgentId(), 'beth');
417
- // Execute a handoff
418
- const { handoff } = await orchestrator.executeHandoff('developer', 'Build login');
419
- assert.strictEqual(handoff.executed, true);
420
- assert.strictEqual(orchestrator.getActiveAgentId(), 'developer');
421
- });
422
- it('should fail handoff to unknown agent', async () => {
423
- const provider = new MockProvider();
424
- provider.addTextResponse('I am Beth.');
425
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
426
- await orchestrator.processMessage('Hello');
427
- const { handoff } = await orchestrator.executeHandoff('nonexistent', 'Do stuff');
428
- assert.strictEqual(handoff.executed, false);
429
- });
430
- });
431
- describe('Observer callbacks', () => {
432
- it('should call observer on route', async () => {
433
- const provider = new MockProvider();
434
- provider.addTextResponse('Done.');
435
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
436
- let routeCalled = false;
437
- orchestrator.setObserver({
438
- onRoute: () => { routeCalled = true; },
439
- });
440
- await orchestrator.processMessage('Hello');
441
- assert.strictEqual(routeCalled, true);
442
- });
443
- it('should call observer on LLM calls', async () => {
444
- const provider = new MockProvider();
445
- provider.addTextResponse('Response.');
446
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
447
- let llmCallAgent = '';
448
- orchestrator.setObserver({
449
- onLLMCall: (agentId) => { llmCallAgent = agentId; },
450
- });
451
- await orchestrator.processMessage('Hello');
452
- assert.strictEqual(llmCallAgent, 'beth');
453
- });
454
- it('should call observer on tool calls', async () => {
455
- const provider = new MockProvider();
456
- provider.addToolCallResponse([
457
- { id: 'tc1', type: 'function', function: { name: 'echo', arguments: '{"message":"hi"}' } },
458
- ]);
459
- provider.addTextResponse('Done.');
460
- const registry = new ToolRegistry();
461
- registry.register(createEchoTool());
462
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, registry));
463
- const records = [];
464
- orchestrator.setObserver({
465
- onToolCallEnd: (record) => { records.push(record); },
466
- });
467
- await orchestrator.processMessage('Echo something');
468
- assert.strictEqual(records.length, 1);
469
- assert.strictEqual(records[0].name, 'echo');
470
- });
471
- });
472
- describe('State management', () => {
473
- it('should maintain conversation context across turns', async () => {
474
- const provider = new MockProvider();
475
- provider.addTextResponse('First response.');
476
- provider.addTextResponse('Second response.');
477
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
478
- await orchestrator.processMessage('First message');
479
- await orchestrator.processMessage('Second message');
480
- const context = orchestrator.getActiveContext();
481
- assert.ok(context);
482
- assert.strictEqual(context.getTurnCount(), 2);
483
- });
484
- it('should reset state', async () => {
485
- const provider = new MockProvider();
486
- provider.addTextResponse('Hello.');
487
- provider.addTextResponse('After reset.');
488
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
489
- await orchestrator.processMessage('Hello');
490
- orchestrator.reset();
491
- assert.strictEqual(orchestrator.getActiveAgentId(), 'beth');
492
- const context = orchestrator.getActiveContext();
493
- assert.strictEqual(context, undefined);
494
- });
495
- it('should expose router and handoff manager', () => {
496
- const provider = new MockProvider();
497
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider));
498
- assert.ok(orchestrator.getRouter());
499
- assert.ok(orchestrator.getHandoffManager());
500
- });
501
- });
502
- describe('Agent tool filtering', () => {
503
- it('should send tool definitions to the LLM', async () => {
504
- const provider = new MockProvider();
505
- provider.addTextResponse('Done.');
506
- const registry = new ToolRegistry();
507
- registry.register(createEchoTool());
508
- registry.register(createReadFileTool());
509
- const orchestrator = new Orchestrator(createOrchestratorConfig(provider, registry));
510
- const result = await orchestrator.processMessage('Hello');
511
- // Just verify it completes without error — the LLM receives tool defs
512
- assert.strictEqual(result.response, 'Done.');
513
- assert.strictEqual(provider.chatCallCount, 1);
514
- });
515
- });
516
- });
517
- //# sourceMappingURL=orchestrator.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orchestrator.test.js","sourceRoot":"","sources":["../../src/core/orchestrator.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF,6CAA6C;AAC7C,MAAM,cAAc,GAAG,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,EAAE,CAAC;AAE/G;;;GAGG;AACH,MAAM,YAAa,SAAQ,eAAe;IAChC,SAAS,GAAuD,EAAE,CAAC;IACnE,SAAS,GAAG,CAAC,CAAC;IACtB,aAAa,GAAG,CAAC,CAAC;IAElB;QACE,KAAK,CAAC;YACJ,QAAQ,EAAE,cAAc;YACxB,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,+BAA+B;YACzC,UAAU,EAAE,cAAc;SAC3B,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI,KAAa,OAAO,MAAM,CAAC,CAAC,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,EAAE;YACvD,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;YACpC,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAElC,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;YACpC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;YACpC,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;YAExC,MAAM,YAAY,GAAG,IAAI,YAAY,CACnC,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAC7C,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YAC1D,sEAAsE;YACtE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC7C,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,102 +0,0 @@
1
- /**
2
- * Agent Router
3
- *
4
- * Routes user requests to the appropriate agent based on:
5
- * 1. Explicit @agent mentions in user input
6
- * 2. Active handoff targets from the current agent
7
- * 3. Skill trigger matching
8
- * 4. Default to the orchestrator (Beth)
9
- *
10
- * Also provides agent lookup utilities for the orchestrator.
11
- */
12
- import type { AgentDefinition, AgentLoadResult } from './agents/types.js';
13
- import type { SkillDefinition, SkillLoadResult } from './skills/types.js';
14
- /**
15
- * Result of routing a user request.
16
- */
17
- export interface RouteResult {
18
- /** The agent that should handle this request */
19
- agent: AgentDefinition;
20
- /** How the agent was selected */
21
- reason: RouteReason;
22
- /** Skills that should be injected for this request */
23
- matchedSkills: SkillDefinition[];
24
- /** If routed via @mention, the cleaned prompt without the @mention */
25
- cleanedPrompt?: string;
26
- }
27
- /**
28
- * Why a particular agent was selected.
29
- */
30
- export type RouteReason = 'mention' | 'handoff' | 'skill-match' | 'default';
31
- /**
32
- * Routes requests to the appropriate agent.
33
- *
34
- * @example
35
- * ```typescript
36
- * const router = new AgentRouter(agentLoadResult, skillLoadResult, 'beth');
37
- *
38
- * const result = router.route('@developer implement login page');
39
- * // result.agent.id === 'developer'
40
- * // result.reason === 'mention'
41
- * // result.cleanedPrompt === 'implement login page'
42
- *
43
- * const result2 = router.route('create a prd for auth');
44
- * // result2.matchedSkills contains the PRD skill
45
- * ```
46
- */
47
- export declare class AgentRouter {
48
- /** Map of agent ID → agent definition */
49
- private readonly agents;
50
- /** Map of agent name (lowercase) → agent ID for lookup */
51
- private readonly nameToId;
52
- /** Skill trigger map for matching */
53
- private readonly triggerMap;
54
- /** Default agent ID (typically 'beth') */
55
- private readonly defaultAgentId;
56
- constructor(agentResult: AgentLoadResult, skillResult: SkillLoadResult, defaultAgentId?: string);
57
- /**
58
- * Route a user message to the appropriate agent.
59
- *
60
- * @param userMessage - The user's input text
61
- * @param currentAgentId - The currently active agent (for handoff context)
62
- * @returns Routing result with selected agent and matched skills
63
- */
64
- route(userMessage: string, currentAgentId?: string): RouteResult;
65
- /**
66
- * Route directly to a specific agent by ID or name.
67
- *
68
- * @param agentIdOrName - Agent ID or display name
69
- * @returns The agent definition, or undefined if not found
70
- */
71
- resolveAgent(agentIdOrName: string): AgentDefinition | undefined;
72
- /**
73
- * Get all registered agents.
74
- */
75
- getAgents(): AgentDefinition[];
76
- /**
77
- * Get agents that can be invoked as subagents (infer: true).
78
- */
79
- getInferableAgents(): AgentDefinition[];
80
- /**
81
- * Get the default orchestrator agent.
82
- */
83
- getDefaultAgent(): AgentDefinition;
84
- /**
85
- * Check if a specific agent is registered.
86
- */
87
- hasAgent(agentIdOrName: string): boolean;
88
- /**
89
- * Check for @agent mention in user input.
90
- *
91
- * Matches patterns like:
92
- * - "@developer implement the login page"
93
- * - "@product-manager create a PRD"
94
- * - "@Beth plan a feature"
95
- */
96
- private checkMention;
97
- /**
98
- * Find skills whose triggers match the user message.
99
- */
100
- private findSkills;
101
- }
102
- //# sourceMappingURL=router.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/core/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAc,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOtF;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,KAAK,EAAE,eAAe,CAAC;IAEvB,iCAAiC;IACjC,MAAM,EAAE,WAAW,CAAC;IAEpB,sDAAsD;IACtD,aAAa,EAAE,eAAe,EAAE,CAAC;IAEjC,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,aAAa,GACb,SAAS,CAAC;AAMd;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,WAAW;IACtB,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;IAEtD,0DAA0D;IAC1D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C,qCAAqC;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IAExC,0CAA0C;IAC1C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;gBAGtC,WAAW,EAAE,eAAe,EAC5B,WAAW,EAAE,eAAe,EAC5B,cAAc,GAAE,MAAe;IAsBjC;;;;;;OAMG;IACH,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,WAAW;IAkChE;;;;;OAKG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAYhE;;OAEG;IACH,SAAS,IAAI,eAAe,EAAE;IAI9B;;OAEG;IACH,k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