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,209 +0,0 @@
1
- /**
2
- * LLM Provider Types
3
- *
4
- * Type definitions for the LLM provider abstraction layer.
5
- * Designed to be compatible with OpenAI/Azure OpenAI API shapes (Responses API).
6
- * Authentication uses Entra ID (Azure AD) via @azure/identity TokenCredential.
7
- */
8
- import type { TokenCredential } from '@azure/identity';
9
- /**
10
- * Error codes for LLM provider errors.
11
- * Used to categorize failures and determine retry behavior.
12
- */
13
- export type LLMErrorCode = 'AUTH_FAILED' | 'RATE_LIMITED' | 'TIMEOUT' | 'INVALID_REQUEST' | 'SERVER_ERROR' | 'NETWORK_ERROR';
14
- /**
15
- * Custom error class for LLM provider errors.
16
- * Includes metadata for error handling and retry logic.
17
- */
18
- export declare class LLMError extends Error {
19
- /** Categorized error code for programmatic handling */
20
- readonly code: LLMErrorCode;
21
- /** HTTP status code if applicable */
22
- readonly statusCode: number | undefined;
23
- /** Whether this error can be retried */
24
- readonly retryable: boolean;
25
- /** Provider that generated this error */
26
- readonly provider: string;
27
- /** Original error that caused this error */
28
- readonly cause?: Error;
29
- constructor(message: string, code: LLMErrorCode, provider: string, options?: {
30
- statusCode?: number;
31
- retryable?: boolean;
32
- cause?: Error;
33
- });
34
- /**
35
- * Determines default retry behavior based on error code.
36
- */
37
- private isRetryableByDefault;
38
- }
39
- /**
40
- * Role of a message in a chat conversation.
41
- */
42
- export type ChatRole = 'system' | 'user' | 'assistant' | 'tool';
43
- /**
44
- * A function call within a tool call.
45
- */
46
- export interface ToolCallFunction {
47
- /** Name of the function to call */
48
- name: string;
49
- /** JSON-encoded arguments for the function */
50
- arguments: string;
51
- }
52
- /**
53
- * A tool call requested by the model.
54
- */
55
- export interface ToolCall {
56
- /** Unique identifier for this tool call */
57
- id: string;
58
- /** Type of tool (currently only 'function' is supported) */
59
- type: 'function';
60
- /** Function call details */
61
- function: ToolCallFunction;
62
- }
63
- /**
64
- * A message in a chat conversation.
65
- * Represents a single turn from system, user, assistant, or tool.
66
- */
67
- export interface ChatMessage {
68
- /** The role of the message author */
69
- role: ChatRole;
70
- /** The content of the message */
71
- content: string;
72
- /** Optional name of the author (for multi-user conversations) */
73
- name?: string;
74
- /** Tool call ID this message is responding to (for tool role) */
75
- tool_call_id?: string;
76
- /** Tool calls requested by the assistant */
77
- tool_calls?: ToolCall[];
78
- }
79
- /**
80
- * Reason the model stopped generating.
81
- */
82
- export type FinishReason = 'stop' | 'tool_calls' | 'length' | 'content_filter';
83
- /**
84
- * Delta for a tool call in a streaming response.
85
- * Fields are optional as they arrive incrementally.
86
- */
87
- export interface ToolCallDelta {
88
- /** Index of the tool call in the array */
89
- index: number;
90
- /** Tool call ID (sent in first chunk) */
91
- id?: string;
92
- /** Type of tool (sent in first chunk) */
93
- type?: 'function';
94
- /** Function details (arrives incrementally) */
95
- function?: {
96
- /** Function name (sent in first chunk) */
97
- name?: string;
98
- /** Arguments (streamed incrementally) */
99
- arguments?: string;
100
- };
101
- }
102
- /**
103
- * A chunk of a streaming chat response.
104
- * Represents incremental content as it's generated.
105
- */
106
- export interface ChatChunk {
107
- /** Unique identifier for this completion */
108
- id: string;
109
- /** Incremental content (null when no content in this chunk) */
110
- content: string | null;
111
- /** Role of the response (typically only in first chunk) */
112
- role?: ChatRole;
113
- /** Reason for stopping (only in final chunk) */
114
- finish_reason: FinishReason | null;
115
- /** Incremental tool call data */
116
- tool_calls?: ToolCallDelta[];
117
- }
118
- /**
119
- * JSON Schema definition for function parameters.
120
- * Uses Record for flexibility with standard JSON Schema properties.
121
- */
122
- export type JSONSchema = Record<string, unknown>;
123
- /**
124
- * Function definition within a tool.
125
- */
126
- export interface ToolFunctionDefinition {
127
- /** Name of the function */
128
- name: string;
129
- /** Description of what the function does */
130
- description: string;
131
- /** JSON Schema describing the function parameters */
132
- parameters: JSONSchema;
133
- }
134
- /**
135
- * A tool definition that can be provided to the model.
136
- * Defines tools the model can choose to call.
137
- */
138
- export interface ToolDefinition {
139
- /** Type of tool (currently only 'function' is supported) */
140
- type: 'function';
141
- /** Function definition */
142
- function: ToolFunctionDefinition;
143
- }
144
- /**
145
- * Supported LLM providers.
146
- */
147
- export type LLMProvider = 'azure-openai';
148
- /**
149
- * Configuration for an LLM provider connection.
150
- * Contains credentials, model selection, and generation parameters.
151
- * Authentication uses Entra ID via TokenCredential.
152
- */
153
- export interface LLMConfig {
154
- /** The LLM provider to use */
155
- provider: LLMProvider;
156
- /** Model or deployment name */
157
- model: string;
158
- /** API endpoint URL */
159
- endpoint: string;
160
- /** Entra ID token credential for authentication */
161
- credential: TokenCredential;
162
- /** API version (required for Azure OpenAI) */
163
- apiVersion?: string;
164
- /** Sampling temperature (0-2, default varies by provider) */
165
- temperature?: number;
166
- /** Maximum tokens to generate */
167
- maxTokens?: number;
168
- /** Top-p (nucleus) sampling parameter (0-1) */
169
- topP?: number;
170
- /** Frequency penalty (-2 to 2) */
171
- frequencyPenalty?: number;
172
- /** Presence penalty (-2 to 2) */
173
- presencePenalty?: number;
174
- }
175
- /**
176
- * Token usage statistics for a completion.
177
- */
178
- export interface TokenUsage {
179
- /** Number of tokens in the prompt */
180
- prompt_tokens: number;
181
- /** Number of tokens in the completion */
182
- completion_tokens: number;
183
- /** Total tokens used (prompt + completion) */
184
- total_tokens: number;
185
- }
186
- /**
187
- * A choice within an LLM response.
188
- * Represents one possible completion (typically just one for chat).
189
- */
190
- export interface LLMResponseChoice {
191
- /** Index of this choice */
192
- index: number;
193
- /** The generated message */
194
- message: ChatMessage;
195
- /** Reason the model stopped generating */
196
- finish_reason: FinishReason;
197
- }
198
- /**
199
- * Full (non-streaming) response from an LLM.
200
- */
201
- export interface LLMResponse {
202
- /** Unique identifier for this completion */
203
- id: string;
204
- /** List of completion choices */
205
- choices: LLMResponseChoice[];
206
- /** Token usage statistics */
207
- usage: TokenUsage;
208
- }
209
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/providers/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,cAAc,GACd,SAAS,GACT,iBAAiB,GACjB,cAAc,GACd,eAAe,CAAC;AAEpB;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC,uDAAuD;IACvD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAE5B,qCAAqC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAExC,wCAAwC;IACxC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5B,yCAAyC;IACzC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,4CAA4C;IAC5C,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;gBAGrB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE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C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,iCAAiC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAMD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAC;IAEtB,yCAAyC;IACzC,iBAAiB,EAAE,MAAM,CAAC;IAE1B,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IAEd,4BAA4B;IAC5B,OAAO,EAAE,WAAW,CAAC;IAErB,0CAA0C;IAC1C,aAAa,EAAE,YAAY,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IAEX,iCAAiC;IACjC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAE7B,6BAA6B;IAC7B,KAAK,EAAE,UAAU,CAAC;CACnB"}
@@ -1,53 +0,0 @@
1
- /**
2
- * LLM Provider Types
3
- *
4
- * Type definitions for the LLM provider abstraction layer.
5
- * Designed to be compatible with OpenAI/Azure OpenAI API shapes (Responses API).
6
- * Authentication uses Entra ID (Azure AD) via @azure/identity TokenCredential.
7
- */
8
- /**
9
- * Custom error class for LLM provider errors.
10
- * Includes metadata for error handling and retry logic.
11
- */
12
- export class LLMError extends Error {
13
- /** Categorized error code for programmatic handling */
14
- code;
15
- /** HTTP status code if applicable */
16
- statusCode;
17
- /** Whether this error can be retried */
18
- retryable;
19
- /** Provider that generated this error */
20
- provider;
21
- /** Original error that caused this error */
22
- cause;
23
- constructor(message, code, provider, options) {
24
- super(message);
25
- this.name = 'LLMError';
26
- this.code = code;
27
- this.provider = provider;
28
- this.statusCode = options?.statusCode;
29
- this.retryable = options?.retryable ?? this.isRetryableByDefault(code);
30
- // Set cause for error chaining (ES2022+)
31
- if (options?.cause) {
32
- this.cause = options.cause;
33
- }
34
- }
35
- /**
36
- * Determines default retry behavior based on error code.
37
- */
38
- isRetryableByDefault(code) {
39
- switch (code) {
40
- case 'RATE_LIMITED':
41
- case 'TIMEOUT':
42
- case 'SERVER_ERROR':
43
- case 'NETWORK_ERROR':
44
- return true;
45
- case 'AUTH_FAILED':
46
- case 'INVALID_REQUEST':
47
- return false;
48
- default:
49
- return false;
50
- }
51
- }
52
- }
53
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/providers/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH;;;GAGG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,uDAAuD;IAC9C,IAAI,CAAe;IAE5B,qCAAqC;IAC5B,UAAU,CAAqB;IAExC,wCAAwC;IAC/B,SAAS,CAAU;IAE5B,yCAAyC;IAChC,QAAQ,CAAS;IAE1B,4CAA4C;IACnC,KAAK,CAAS;IAEvB,YACE,OAAe,EACf,IAAkB,EAClB,QAAgB,EAChB,OAIC;QAED,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAEvE,yCAAyC;QACzC,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC;IAED;;OAEG;IACK,oBAAoB,CAAC,IAAkB;QAC7C,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,cAAc,CAAC;YACpB,KAAK,SAAS,CAAC;YACf,KAAK,cAAc,CAAC;YACpB,KAAK,eAAe;gBAClB,OAAO,IAAI,CAAC;YACd,KAAK,aAAa,CAAC;YACnB,KAAK,iBAAiB;gBACpB,OAAO,KAAK,CAAC;YACf;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF"}
@@ -1,7 +0,0 @@
1
- /**
2
- * LLM Provider Types Tests
3
- *
4
- * Tests for LLMError class and type definitions.
5
- */
6
- export {};
7
- //# sourceMappingURL=types.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../src/providers/types.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -1,141 +0,0 @@
1
- /**
2
- * LLM Provider Types Tests
3
- *
4
- * Tests for LLMError class and type definitions.
5
- */
6
- import { describe, it } from 'node:test';
7
- import assert from 'node:assert';
8
- import { LLMError } from './types.js';
9
- describe('LLMError', () => {
10
- describe('constructor', () => {
11
- it('should set message correctly', () => {
12
- const error = new LLMError('Test message', 'AUTH_FAILED', 'test-provider');
13
- assert.strictEqual(error.message, 'Test message');
14
- });
15
- it('should set code correctly', () => {
16
- const error = new LLMError('Test', 'RATE_LIMITED', 'test-provider');
17
- assert.strictEqual(error.code, 'RATE_LIMITED');
18
- });
19
- it('should set provider correctly', () => {
20
- const error = new LLMError('Test', 'TIMEOUT', 'azure-openai');
21
- assert.strictEqual(error.provider, 'azure-openai');
22
- });
23
- it('should set statusCode from options', () => {
24
- const error = new LLMError('Test', 'SERVER_ERROR', 'test-provider', {
25
- statusCode: 503,
26
- });
27
- assert.strictEqual(error.statusCode, 503);
28
- });
29
- it('should leave statusCode undefined when not provided', () => {
30
- const error = new LLMError('Test', 'SERVER_ERROR', 'test-provider');
31
- assert.strictEqual(error.statusCode, undefined);
32
- });
33
- it('should set cause from options', () => {
34
- const originalError = new Error('Original error');
35
- const error = new LLMError('Wrapped', 'NETWORK_ERROR', 'test-provider', {
36
- cause: originalError,
37
- });
38
- assert.strictEqual(error.cause, originalError);
39
- });
40
- it('should leave cause undefined when not provided', () => {
41
- const error = new LLMError('Test', 'AUTH_FAILED', 'test-provider');
42
- assert.strictEqual(error.cause, undefined);
43
- });
44
- it('should set all options together', () => {
45
- const cause = new Error('Root cause');
46
- const error = new LLMError('Complete error', 'RATE_LIMITED', 'azure-openai', {
47
- statusCode: 429,
48
- retryable: true,
49
- cause,
50
- });
51
- assert.strictEqual(error.message, 'Complete error');
52
- assert.strictEqual(error.code, 'RATE_LIMITED');
53
- assert.strictEqual(error.provider, 'azure-openai');
54
- assert.strictEqual(error.statusCode, 429);
55
- assert.strictEqual(error.retryable, true);
56
- assert.strictEqual(error.cause, cause);
57
- });
58
- });
59
- describe('name property', () => {
60
- it('should be "LLMError"', () => {
61
- const error = new LLMError('Test', 'AUTH_FAILED', 'test');
62
- assert.strictEqual(error.name, 'LLMError');
63
- });
64
- });
65
- describe('inheritance', () => {
66
- it('should be an instance of Error', () => {
67
- const error = new LLMError('Test', 'AUTH_FAILED', 'test');
68
- assert.ok(error instanceof Error);
69
- });
70
- it('should be an instance of LLMError', () => {
71
- const error = new LLMError('Test', 'AUTH_FAILED', 'test');
72
- assert.ok(error instanceof LLMError);
73
- });
74
- it('should have a stack trace', () => {
75
- const error = new LLMError('Test', 'AUTH_FAILED', 'test');
76
- assert.ok(typeof error.stack === 'string');
77
- assert.ok(error.stack.length > 0);
78
- });
79
- });
80
- describe('isRetryableByDefault', () => {
81
- describe('retryable error codes', () => {
82
- const retryableErrorCodes = [
83
- 'RATE_LIMITED',
84
- 'TIMEOUT',
85
- 'SERVER_ERROR',
86
- 'NETWORK_ERROR',
87
- ];
88
- for (const code of retryableErrorCodes) {
89
- it(`should default retryable to true for ${code}`, () => {
90
- const error = new LLMError('Test', code, 'test-provider');
91
- assert.strictEqual(error.retryable, true, `${code} should be retryable by default`);
92
- });
93
- }
94
- });
95
- describe('non-retryable error codes', () => {
96
- const nonRetryableErrorCodes = ['AUTH_FAILED', 'INVALID_REQUEST'];
97
- for (const code of nonRetryableErrorCodes) {
98
- it(`should default retryable to false for ${code}`, () => {
99
- const error = new LLMError('Test', code, 'test-provider');
100
- assert.strictEqual(error.retryable, false, `${code} should not be retryable by default`);
101
- });
102
- }
103
- });
104
- });
105
- describe('custom retryable override', () => {
106
- it('should allow overriding retryable to false for a normally-retryable code', () => {
107
- const error = new LLMError('Test', 'RATE_LIMITED', 'test-provider', {
108
- retryable: false,
109
- });
110
- assert.strictEqual(error.retryable, false);
111
- });
112
- it('should allow overriding retryable to true for a normally-non-retryable code', () => {
113
- const error = new LLMError('Test', 'AUTH_FAILED', 'test-provider', {
114
- retryable: true,
115
- });
116
- assert.strictEqual(error.retryable, true);
117
- });
118
- it('should respect explicit retryable false even for SERVER_ERROR', () => {
119
- const error = new LLMError('Test', 'SERVER_ERROR', 'test-provider', {
120
- retryable: false,
121
- });
122
- assert.strictEqual(error.retryable, false);
123
- });
124
- });
125
- describe('readonly properties', () => {
126
- it('should have readonly code', () => {
127
- const error = new LLMError('Test', 'AUTH_FAILED', 'test');
128
- // TypeScript enforces this at compile time, but we verify the value is set correctly
129
- assert.strictEqual(error.code, 'AUTH_FAILED');
130
- });
131
- it('should have readonly provider', () => {
132
- const error = new LLMError('Test', 'AUTH_FAILED', 'test-provider');
133
- assert.strictEqual(error.provider, 'test-provider');
134
- });
135
- it('should have readonly retryable', () => {
136
- const error = new LLMError('Test', 'AUTH_FAILED', 'test');
137
- assert.strictEqual(error.retryable, false);
138
- });
139
- });
140
- });
141
- //# sourceMappingURL=types.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.test.js","sourceRoot":"","sources":["../../src/providers/types.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC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C;QACtD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACxC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;YAE1D,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Beads Tool
3
- *
4
- * Wraps the `bd` CLI for issue tracking via the beads system.
5
- * Supports creating, closing, listing, and inspecting issues
6
- * and their dependency trees.
7
- *
8
- * @see https://github.com/steveyegge/beads
9
- */
10
- import { execFile as nodeExecFile } from 'node:child_process';
11
- import type { Tool } from '../interface.js';
12
- /** Type for the execFile callback-style function, used for dependency injection in tests */
13
- type ExecFileFn = typeof nodeExecFile;
14
- /**
15
- * Create a beads tool instance.
16
- *
17
- * Accepts an optional `execFn` for dependency injection in tests.
18
- * When omitted, uses `node:child_process.execFile`.
19
- *
20
- * @param execFn - Optional execFile function for testing
21
- * @returns A Tool implementation for beads
22
- */
23
- export declare function createBeadsTool(execFn?: ExecFileFn): Tool;
24
- /** Default beads tool instance using real execFile */
25
- export declare const beadsTool: Tool;
26
- export {};
27
- //# sourceMappingURL=beads.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beads.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/beads.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,4FAA4F;AAC5F,KAAK,UAAU,GAAG,OAAO,YAAY,CAAC;AAsGtC;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CA2EzD;AAED,sDAAsD;AACtD,eAAO,MAAM,SAAS,EAAE,IAAwB,CAAC"}
@@ -1,172 +0,0 @@
1
- /**
2
- * Beads Tool
3
- *
4
- * Wraps the `bd` CLI for issue tracking via the beads system.
5
- * Supports creating, closing, listing, and inspecting issues
6
- * and their dependency trees.
7
- *
8
- * @see https://github.com/steveyegge/beads
9
- */
10
- import { execFile as nodeExecFile } from 'node:child_process';
11
- import { ToolError } from '../types.js';
12
- /** Valid beads commands */
13
- const BEADS_COMMANDS = ['create', 'close', 'list', 'ready', 'show', 'dep-tree'];
14
- /** Input schema for the beads tool */
15
- const inputSchema = {
16
- type: 'object',
17
- properties: {
18
- command: {
19
- type: 'string',
20
- enum: [...BEADS_COMMANDS],
21
- description: 'Beads command to execute',
22
- },
23
- args: {
24
- type: 'object',
25
- description: 'Command-specific arguments',
26
- properties: {
27
- title: { type: 'string', description: 'Issue title (for create)' },
28
- description: { type: 'string', description: 'Issue description (for create)' },
29
- type: { type: 'string', enum: ['task', 'epic'], description: 'Issue type (for create)' },
30
- priority: { type: 'number', description: 'Priority level (for create)' },
31
- parent: { type: 'string', description: 'Parent issue ID (for create)' },
32
- deps: { type: 'string', description: 'Comma-separated dependency IDs (for create)' },
33
- label: { type: 'string', description: 'Label to apply (for create)' },
34
- id: { type: 'string', description: 'Issue ID (for close, show, dep-tree)' },
35
- },
36
- },
37
- },
38
- required: ['command'],
39
- };
40
- /**
41
- * Build the `bd` CLI argument array for a given command and args.
42
- *
43
- * @param command - The beads command to run
44
- * @param args - Command-specific arguments
45
- * @param toolName - Tool name for error reporting
46
- * @returns Array of string arguments to pass to `bd`
47
- */
48
- function buildArgs(command, args, toolName) {
49
- switch (command) {
50
- case 'create': {
51
- const title = args?.title;
52
- if (typeof title !== 'string' || title.trim().length === 0) {
53
- throw new ToolError('title is required for create command', 'INVALID_INPUT', toolName);
54
- }
55
- const result = ['create', title];
56
- if (typeof args?.description === 'string' && args.description.length > 0) {
57
- result.push(`--description=${args.description}`);
58
- }
59
- if (args?.type === 'epic') {
60
- result.push('--type', 'epic');
61
- }
62
- if (typeof args?.priority === 'number') {
63
- result.push('-p', String(args.priority));
64
- }
65
- if (typeof args?.parent === 'string' && args.parent.length > 0) {
66
- result.push('--parent', args.parent);
67
- }
68
- if (typeof args?.deps === 'string' && args.deps.length > 0) {
69
- result.push('--deps', args.deps);
70
- }
71
- if (typeof args?.label === 'string' && args.label.length > 0) {
72
- result.push('-l', args.label);
73
- }
74
- return result;
75
- }
76
- case 'close': {
77
- const id = args?.id;
78
- if (typeof id !== 'string' || id.trim().length === 0) {
79
- throw new ToolError('id is required for close command', 'INVALID_INPUT', toolName);
80
- }
81
- return ['close', id];
82
- }
83
- case 'list':
84
- return ['list'];
85
- case 'ready':
86
- return ['ready'];
87
- case 'show': {
88
- const id = args?.id;
89
- if (typeof id !== 'string' || id.trim().length === 0) {
90
- throw new ToolError('id is required for show command', 'INVALID_INPUT', toolName);
91
- }
92
- return ['show', id];
93
- }
94
- case 'dep-tree': {
95
- const id = args?.id;
96
- if (typeof id !== 'string' || id.trim().length === 0) {
97
- throw new ToolError('id is required for dep-tree command', 'INVALID_INPUT', toolName);
98
- }
99
- return ['dep', 'tree', id];
100
- }
101
- }
102
- }
103
- /**
104
- * Create a beads tool instance.
105
- *
106
- * Accepts an optional `execFn` for dependency injection in tests.
107
- * When omitted, uses `node:child_process.execFile`.
108
- *
109
- * @param execFn - Optional execFile function for testing
110
- * @returns A Tool implementation for beads
111
- */
112
- export function createBeadsTool(execFn) {
113
- const exec = execFn ?? nodeExecFile;
114
- return {
115
- name: 'beads',
116
- description: 'Manage issues and work tracking via the beads (bd) CLI',
117
- inputSchema,
118
- async execute(input, context) {
119
- // Check permission — beads runs as a CLI command
120
- if (!context.permissions.allowTerminal) {
121
- throw new ToolError('Terminal permission denied', 'PERMISSION_DENIED', 'beads');
122
- }
123
- // Validate command
124
- const command = input.command;
125
- if (typeof command !== 'string' || !BEADS_COMMANDS.includes(command)) {
126
- throw new ToolError(`command must be one of: ${BEADS_COMMANDS.join(', ')}`, 'INVALID_INPUT', 'beads');
127
- }
128
- const args = (input.args ?? undefined);
129
- const bdArgs = buildArgs(command, args, 'beads');
130
- // Verify bd is available
131
- await new Promise((resolve, reject) => {
132
- exec('bd', ['--version'], { timeout: 5000 }, (error) => {
133
- if (error) {
134
- reject(new ToolError('beads (bd) CLI not found. Install from https://github.com/steveyegge/beads', 'NOT_FOUND', 'beads', { cause: error }));
135
- }
136
- else {
137
- resolve();
138
- }
139
- });
140
- });
141
- // Execute the bd command
142
- return new Promise((resolve, reject) => {
143
- exec('bd', bdArgs, { cwd: context.workingDir, timeout: 30_000 }, (error, stdout, stderr) => {
144
- let output = '';
145
- if (stdout)
146
- output += stdout;
147
- if (stderr) {
148
- if (output.length > 0 && !output.endsWith('\n'))
149
- output += '\n';
150
- if (stderr.length > 0)
151
- output += stderr;
152
- }
153
- if (error) {
154
- reject(new ToolError(`bd ${command} failed: ${output || error.message}`, 'EXECUTION_FAILED', 'beads', { cause: error }));
155
- return;
156
- }
157
- resolve({
158
- success: true,
159
- output: output.trim(),
160
- metadata: {
161
- command,
162
- args: bdArgs,
163
- },
164
- });
165
- });
166
- });
167
- },
168
- };
169
- }
170
- /** Default beads tool instance using real execFile */
171
- export const beadsTool = createBeadsTool();
172
- //# sourceMappingURL=beads.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"beads.js","sourceRoot":"","sources":["../../../src/tools/cli/beads.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,2BAA2B;AAC3B,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC;AAMzF,sCAAsC;AACtC,MAAM,WAAW,GAAoB;IACnC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* Uses dependency injection (createBeadsTool) to mock execFile.
6
- */
7
- export {};
8
- //# sourceMappingURL=beads.test.d.ts.map