verbolab 0.1.0-alpha.1

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 (493) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/dist/bin/verbo.d.ts +3 -0
  4. package/dist/bin/verbo.d.ts.map +1 -0
  5. package/dist/bin/verbo.js +1156 -0
  6. package/dist/bin/verbo.js.map +1 -0
  7. package/dist/relay/index.d.ts +2 -0
  8. package/dist/relay/index.d.ts.map +1 -0
  9. package/dist/relay/index.js +15 -0
  10. package/dist/relay/index.js.map +1 -0
  11. package/dist/src/agent/agent-launcher.d.ts +64 -0
  12. package/dist/src/agent/agent-launcher.d.ts.map +1 -0
  13. package/dist/src/agent/agent-launcher.js +326 -0
  14. package/dist/src/agent/agent-launcher.js.map +1 -0
  15. package/dist/src/agent/agent-monitor.d.ts +16 -0
  16. package/dist/src/agent/agent-monitor.d.ts.map +1 -0
  17. package/dist/src/agent/agent-monitor.js +41 -0
  18. package/dist/src/agent/agent-monitor.js.map +1 -0
  19. package/dist/src/agent/fun-names.d.ts +9 -0
  20. package/dist/src/agent/fun-names.d.ts.map +1 -0
  21. package/dist/src/agent/fun-names.js +118 -0
  22. package/dist/src/agent/fun-names.js.map +1 -0
  23. package/dist/src/agent/mcp-shim.d.ts +45 -0
  24. package/dist/src/agent/mcp-shim.d.ts.map +1 -0
  25. package/dist/src/agent/mcp-shim.js +192 -0
  26. package/dist/src/agent/mcp-shim.js.map +1 -0
  27. package/dist/src/agent/personas.d.ts +47 -0
  28. package/dist/src/agent/personas.d.ts.map +1 -0
  29. package/dist/src/agent/personas.js +86 -0
  30. package/dist/src/agent/personas.js.map +1 -0
  31. package/dist/src/agent/provider-detection.d.ts +21 -0
  32. package/dist/src/agent/provider-detection.d.ts.map +1 -0
  33. package/dist/src/agent/provider-detection.js +47 -0
  34. package/dist/src/agent/provider-detection.js.map +1 -0
  35. package/dist/src/agent/providers/claude-provider.d.ts +3 -0
  36. package/dist/src/agent/providers/claude-provider.d.ts.map +1 -0
  37. package/dist/src/agent/providers/claude-provider.js +119 -0
  38. package/dist/src/agent/providers/claude-provider.js.map +1 -0
  39. package/dist/src/agent/providers/gemini-provider.d.ts +13 -0
  40. package/dist/src/agent/providers/gemini-provider.d.ts.map +1 -0
  41. package/dist/src/agent/providers/gemini-provider.js +143 -0
  42. package/dist/src/agent/providers/gemini-provider.js.map +1 -0
  43. package/dist/src/agent/providers/openai-provider.d.ts +3 -0
  44. package/dist/src/agent/providers/openai-provider.d.ts.map +1 -0
  45. package/dist/src/agent/providers/openai-provider.js +127 -0
  46. package/dist/src/agent/providers/openai-provider.js.map +1 -0
  47. package/dist/src/agent/providers/registry.d.ts +19 -0
  48. package/dist/src/agent/providers/registry.d.ts.map +1 -0
  49. package/dist/src/agent/providers/registry.js +30 -0
  50. package/dist/src/agent/providers/registry.js.map +1 -0
  51. package/dist/src/agent/providers/types.d.ts +118 -0
  52. package/dist/src/agent/providers/types.d.ts.map +1 -0
  53. package/dist/src/agent/providers/types.js +2 -0
  54. package/dist/src/agent/providers/types.js.map +1 -0
  55. package/dist/src/approval/approval-server.d.ts +17 -0
  56. package/dist/src/approval/approval-server.d.ts.map +1 -0
  57. package/dist/src/approval/approval-server.js +90 -0
  58. package/dist/src/approval/approval-server.js.map +1 -0
  59. package/dist/src/approval/approval-store.d.ts +29 -0
  60. package/dist/src/approval/approval-store.d.ts.map +1 -0
  61. package/dist/src/approval/approval-store.js +94 -0
  62. package/dist/src/approval/approval-store.js.map +1 -0
  63. package/dist/src/auth/auth-store.d.ts +18 -0
  64. package/dist/src/auth/auth-store.d.ts.map +1 -0
  65. package/dist/src/auth/auth-store.js +34 -0
  66. package/dist/src/auth/auth-store.js.map +1 -0
  67. package/dist/src/auth/device-code-client.d.ts +32 -0
  68. package/dist/src/auth/device-code-client.d.ts.map +1 -0
  69. package/dist/src/auth/device-code-client.js +41 -0
  70. package/dist/src/auth/device-code-client.js.map +1 -0
  71. package/dist/src/auth/plan-enforcer.d.ts +8 -0
  72. package/dist/src/auth/plan-enforcer.d.ts.map +1 -0
  73. package/dist/src/auth/plan-enforcer.js +14 -0
  74. package/dist/src/auth/plan-enforcer.js.map +1 -0
  75. package/dist/src/commands/audit.d.ts +7 -0
  76. package/dist/src/commands/audit.d.ts.map +1 -0
  77. package/dist/src/commands/audit.js +92 -0
  78. package/dist/src/commands/audit.js.map +1 -0
  79. package/dist/src/commands/team.d.ts +48 -0
  80. package/dist/src/commands/team.d.ts.map +1 -0
  81. package/dist/src/commands/team.js +175 -0
  82. package/dist/src/commands/team.js.map +1 -0
  83. package/dist/src/config/verbo-config.d.ts +43 -0
  84. package/dist/src/config/verbo-config.d.ts.map +1 -0
  85. package/dist/src/config/verbo-config.js +111 -0
  86. package/dist/src/config/verbo-config.js.map +1 -0
  87. package/dist/src/core/agent-session-store.d.ts +69 -0
  88. package/dist/src/core/agent-session-store.d.ts.map +1 -0
  89. package/dist/src/core/agent-session-store.js +168 -0
  90. package/dist/src/core/agent-session-store.js.map +1 -0
  91. package/dist/src/core/audit-log-store.d.ts +33 -0
  92. package/dist/src/core/audit-log-store.d.ts.map +1 -0
  93. package/dist/src/core/audit-log-store.js +104 -0
  94. package/dist/src/core/audit-log-store.js.map +1 -0
  95. package/dist/src/core/compliance.d.ts +50 -0
  96. package/dist/src/core/compliance.d.ts.map +1 -0
  97. package/dist/src/core/compliance.js +59 -0
  98. package/dist/src/core/compliance.js.map +1 -0
  99. package/dist/src/core/conflict-detector.d.ts +19 -0
  100. package/dist/src/core/conflict-detector.d.ts.map +1 -0
  101. package/dist/src/core/conflict-detector.js +87 -0
  102. package/dist/src/core/conflict-detector.js.map +1 -0
  103. package/dist/src/core/conflict-enforcer.d.ts +37 -0
  104. package/dist/src/core/conflict-enforcer.d.ts.map +1 -0
  105. package/dist/src/core/conflict-enforcer.js +139 -0
  106. package/dist/src/core/conflict-enforcer.js.map +1 -0
  107. package/dist/src/core/cost-store.d.ts +55 -0
  108. package/dist/src/core/cost-store.d.ts.map +1 -0
  109. package/dist/src/core/cost-store.js +140 -0
  110. package/dist/src/core/cost-store.js.map +1 -0
  111. package/dist/src/core/hot-files.d.ts +19 -0
  112. package/dist/src/core/hot-files.d.ts.map +1 -0
  113. package/dist/src/core/hot-files.js +64 -0
  114. package/dist/src/core/hot-files.js.map +1 -0
  115. package/dist/src/core/human-action-store.d.ts +33 -0
  116. package/dist/src/core/human-action-store.d.ts.map +1 -0
  117. package/dist/src/core/human-action-store.js +92 -0
  118. package/dist/src/core/human-action-store.js.map +1 -0
  119. package/dist/src/core/learning-store.d.ts +32 -0
  120. package/dist/src/core/learning-store.d.ts.map +1 -0
  121. package/dist/src/core/learning-store.js +95 -0
  122. package/dist/src/core/learning-store.js.map +1 -0
  123. package/dist/src/core/merge-queue.d.ts +28 -0
  124. package/dist/src/core/merge-queue.d.ts.map +1 -0
  125. package/dist/src/core/merge-queue.js +92 -0
  126. package/dist/src/core/merge-queue.js.map +1 -0
  127. package/dist/src/core/notification-service.d.ts +13 -0
  128. package/dist/src/core/notification-service.d.ts.map +1 -0
  129. package/dist/src/core/notification-service.js +126 -0
  130. package/dist/src/core/notification-service.js.map +1 -0
  131. package/dist/src/core/notifications.d.ts +10 -0
  132. package/dist/src/core/notifications.d.ts.map +1 -0
  133. package/dist/src/core/notifications.js +33 -0
  134. package/dist/src/core/notifications.js.map +1 -0
  135. package/dist/src/core/orchestrator-store.d.ts +44 -0
  136. package/dist/src/core/orchestrator-store.d.ts.map +1 -0
  137. package/dist/src/core/orchestrator-store.js +69 -0
  138. package/dist/src/core/orchestrator-store.js.map +1 -0
  139. package/dist/src/core/parallelizer.d.ts +47 -0
  140. package/dist/src/core/parallelizer.d.ts.map +1 -0
  141. package/dist/src/core/parallelizer.js +224 -0
  142. package/dist/src/core/parallelizer.js.map +1 -0
  143. package/dist/src/core/pipeline-rollback.d.ts +29 -0
  144. package/dist/src/core/pipeline-rollback.d.ts.map +1 -0
  145. package/dist/src/core/pipeline-rollback.js +84 -0
  146. package/dist/src/core/pipeline-rollback.js.map +1 -0
  147. package/dist/src/core/pipeline-runner.d.ts +73 -0
  148. package/dist/src/core/pipeline-runner.d.ts.map +1 -0
  149. package/dist/src/core/pipeline-runner.js +165 -0
  150. package/dist/src/core/pipeline-runner.js.map +1 -0
  151. package/dist/src/core/pr-creator.d.ts +22 -0
  152. package/dist/src/core/pr-creator.d.ts.map +1 -0
  153. package/dist/src/core/pr-creator.js +55 -0
  154. package/dist/src/core/pr-creator.js.map +1 -0
  155. package/dist/src/core/rbac.d.ts +27 -0
  156. package/dist/src/core/rbac.d.ts.map +1 -0
  157. package/dist/src/core/rbac.js +76 -0
  158. package/dist/src/core/rbac.js.map +1 -0
  159. package/dist/src/core/startup-cleanup.d.ts +47 -0
  160. package/dist/src/core/startup-cleanup.d.ts.map +1 -0
  161. package/dist/src/core/startup-cleanup.js +150 -0
  162. package/dist/src/core/startup-cleanup.js.map +1 -0
  163. package/dist/src/core/task-store.d.ts +96 -0
  164. package/dist/src/core/task-store.d.ts.map +1 -0
  165. package/dist/src/core/task-store.js +309 -0
  166. package/dist/src/core/task-store.js.map +1 -0
  167. package/dist/src/core/verbo-config-editor.d.ts +44 -0
  168. package/dist/src/core/verbo-config-editor.d.ts.map +1 -0
  169. package/dist/src/core/verbo-config-editor.js +204 -0
  170. package/dist/src/core/verbo-config-editor.js.map +1 -0
  171. package/dist/src/core/verbo-config.d.ts +35 -0
  172. package/dist/src/core/verbo-config.d.ts.map +1 -0
  173. package/dist/src/core/verbo-config.js +55 -0
  174. package/dist/src/core/verbo-config.js.map +1 -0
  175. package/dist/src/core/verbo-md.d.ts +96 -0
  176. package/dist/src/core/verbo-md.d.ts.map +1 -0
  177. package/dist/src/core/verbo-md.js +410 -0
  178. package/dist/src/core/verbo-md.js.map +1 -0
  179. package/dist/src/db/database.d.ts +9 -0
  180. package/dist/src/db/database.d.ts.map +1 -0
  181. package/dist/src/db/database.js +37 -0
  182. package/dist/src/db/database.js.map +1 -0
  183. package/dist/src/db/migrations/001-personas-subtasks.d.ts +10 -0
  184. package/dist/src/db/migrations/001-personas-subtasks.d.ts.map +1 -0
  185. package/dist/src/db/migrations/001-personas-subtasks.js +32 -0
  186. package/dist/src/db/migrations/001-personas-subtasks.js.map +1 -0
  187. package/dist/src/db/migrations/002-rbac.d.ts +9 -0
  188. package/dist/src/db/migrations/002-rbac.d.ts.map +1 -0
  189. package/dist/src/db/migrations/002-rbac.js +31 -0
  190. package/dist/src/db/migrations/002-rbac.js.map +1 -0
  191. package/dist/src/db/migrations/003-provider-column.d.ts +8 -0
  192. package/dist/src/db/migrations/003-provider-column.d.ts.map +1 -0
  193. package/dist/src/db/migrations/003-provider-column.js +12 -0
  194. package/dist/src/db/migrations/003-provider-column.js.map +1 -0
  195. package/dist/src/db/migrations/004-pipeline-cost.d.ts +8 -0
  196. package/dist/src/db/migrations/004-pipeline-cost.d.ts.map +1 -0
  197. package/dist/src/db/migrations/004-pipeline-cost.js +23 -0
  198. package/dist/src/db/migrations/004-pipeline-cost.js.map +1 -0
  199. package/dist/src/db/migrations/005-audit-log-timestamp.d.ts +10 -0
  200. package/dist/src/db/migrations/005-audit-log-timestamp.d.ts.map +1 -0
  201. package/dist/src/db/migrations/005-audit-log-timestamp.js +39 -0
  202. package/dist/src/db/migrations/005-audit-log-timestamp.js.map +1 -0
  203. package/dist/src/db/migrations/006-human-action-type.d.ts +9 -0
  204. package/dist/src/db/migrations/006-human-action-type.d.ts.map +1 -0
  205. package/dist/src/db/migrations/006-human-action-type.js +16 -0
  206. package/dist/src/db/migrations/006-human-action-type.js.map +1 -0
  207. package/dist/src/db/schema.d.ts +6 -0
  208. package/dist/src/db/schema.d.ts.map +1 -0
  209. package/dist/src/db/schema.js +255 -0
  210. package/dist/src/db/schema.js.map +1 -0
  211. package/dist/src/deps/dependabot-generator.d.ts +22 -0
  212. package/dist/src/deps/dependabot-generator.d.ts.map +1 -0
  213. package/dist/src/deps/dependabot-generator.js +83 -0
  214. package/dist/src/deps/dependabot-generator.js.map +1 -0
  215. package/dist/src/deps/dependabot-monitor.d.ts +22 -0
  216. package/dist/src/deps/dependabot-monitor.d.ts.map +1 -0
  217. package/dist/src/deps/dependabot-monitor.js +28 -0
  218. package/dist/src/deps/dependabot-monitor.js.map +1 -0
  219. package/dist/src/deps/package-auditor.d.ts +24 -0
  220. package/dist/src/deps/package-auditor.d.ts.map +1 -0
  221. package/dist/src/deps/package-auditor.js +118 -0
  222. package/dist/src/deps/package-auditor.js.map +1 -0
  223. package/dist/src/init/ensure-init.d.ts +6 -0
  224. package/dist/src/init/ensure-init.d.ts.map +1 -0
  225. package/dist/src/init/ensure-init.js +27 -0
  226. package/dist/src/init/ensure-init.js.map +1 -0
  227. package/dist/src/init/project-detector.d.ts +11 -0
  228. package/dist/src/init/project-detector.d.ts.map +1 -0
  229. package/dist/src/init/project-detector.js +117 -0
  230. package/dist/src/init/project-detector.js.map +1 -0
  231. package/dist/src/init/questionnaire.d.ts +5 -0
  232. package/dist/src/init/questionnaire.d.ts.map +1 -0
  233. package/dist/src/init/questionnaire.js +112 -0
  234. package/dist/src/init/questionnaire.js.map +1 -0
  235. package/dist/src/init/template.d.ts +17 -0
  236. package/dist/src/init/template.d.ts.map +1 -0
  237. package/dist/src/init/template.js +46 -0
  238. package/dist/src/init/template.js.map +1 -0
  239. package/dist/src/intelligence/claude-client.d.ts +3 -0
  240. package/dist/src/intelligence/claude-client.d.ts.map +1 -0
  241. package/dist/src/intelligence/claude-client.js +12 -0
  242. package/dist/src/intelligence/claude-client.js.map +1 -0
  243. package/dist/src/intelligence/conflict-mediator.d.ts +17 -0
  244. package/dist/src/intelligence/conflict-mediator.d.ts.map +1 -0
  245. package/dist/src/intelligence/conflict-mediator.js +83 -0
  246. package/dist/src/intelligence/conflict-mediator.js.map +1 -0
  247. package/dist/src/intelligence/github-orchestrator.d.ts +30 -0
  248. package/dist/src/intelligence/github-orchestrator.d.ts.map +1 -0
  249. package/dist/src/intelligence/github-orchestrator.js +270 -0
  250. package/dist/src/intelligence/github-orchestrator.js.map +1 -0
  251. package/dist/src/intelligence/kill-switch.d.ts +10 -0
  252. package/dist/src/intelligence/kill-switch.d.ts.map +1 -0
  253. package/dist/src/intelligence/kill-switch.js +12 -0
  254. package/dist/src/intelligence/kill-switch.js.map +1 -0
  255. package/dist/src/intelligence/learnings-extractor.d.ts +13 -0
  256. package/dist/src/intelligence/learnings-extractor.d.ts.map +1 -0
  257. package/dist/src/intelligence/learnings-extractor.js +74 -0
  258. package/dist/src/intelligence/learnings-extractor.js.map +1 -0
  259. package/dist/src/intelligence/project-scanner.d.ts +2 -0
  260. package/dist/src/intelligence/project-scanner.d.ts.map +1 -0
  261. package/dist/src/intelligence/project-scanner.js +28 -0
  262. package/dist/src/intelligence/project-scanner.js.map +1 -0
  263. package/dist/src/intelligence/task-decomposer.d.ts +14 -0
  264. package/dist/src/intelligence/task-decomposer.d.ts.map +1 -0
  265. package/dist/src/intelligence/task-decomposer.js +97 -0
  266. package/dist/src/intelligence/task-decomposer.js.map +1 -0
  267. package/dist/src/intelligence/types.d.ts +14 -0
  268. package/dist/src/intelligence/types.d.ts.map +1 -0
  269. package/dist/src/intelligence/types.js +2 -0
  270. package/dist/src/intelligence/types.js.map +1 -0
  271. package/dist/src/mcp/server.d.ts +63 -0
  272. package/dist/src/mcp/server.d.ts.map +1 -0
  273. package/dist/src/mcp/server.js +537 -0
  274. package/dist/src/mcp/server.js.map +1 -0
  275. package/dist/src/mcp/stdio-entry.d.ts +2 -0
  276. package/dist/src/mcp/stdio-entry.d.ts.map +1 -0
  277. package/dist/src/mcp/stdio-entry.js +124 -0
  278. package/dist/src/mcp/stdio-entry.js.map +1 -0
  279. package/dist/src/mcp/subtask-handlers.d.ts +7 -0
  280. package/dist/src/mcp/subtask-handlers.d.ts.map +1 -0
  281. package/dist/src/mcp/subtask-handlers.js +50 -0
  282. package/dist/src/mcp/subtask-handlers.js.map +1 -0
  283. package/dist/src/security/network-proxy.d.ts +20 -0
  284. package/dist/src/security/network-proxy.d.ts.map +1 -0
  285. package/dist/src/security/network-proxy.js +125 -0
  286. package/dist/src/security/network-proxy.js.map +1 -0
  287. package/dist/src/security/network-sandbox.d.ts +19 -0
  288. package/dist/src/security/network-sandbox.d.ts.map +1 -0
  289. package/dist/src/security/network-sandbox.js +100 -0
  290. package/dist/src/security/network-sandbox.js.map +1 -0
  291. package/dist/src/security/sanitize.d.ts +13 -0
  292. package/dist/src/security/sanitize.d.ts.map +1 -0
  293. package/dist/src/security/sanitize.js +19 -0
  294. package/dist/src/security/sanitize.js.map +1 -0
  295. package/dist/src/security/secrets-patterns.d.ts +29 -0
  296. package/dist/src/security/secrets-patterns.d.ts.map +1 -0
  297. package/dist/src/security/secrets-patterns.js +430 -0
  298. package/dist/src/security/secrets-patterns.js.map +1 -0
  299. package/dist/src/security/secrets-scanner.d.ts +26 -0
  300. package/dist/src/security/secrets-scanner.d.ts.map +1 -0
  301. package/dist/src/security/secrets-scanner.js +62 -0
  302. package/dist/src/security/secrets-scanner.js.map +1 -0
  303. package/dist/src/skills/classifier.d.ts +9 -0
  304. package/dist/src/skills/classifier.d.ts.map +1 -0
  305. package/dist/src/skills/classifier.js +41 -0
  306. package/dist/src/skills/classifier.js.map +1 -0
  307. package/dist/src/skills/registry.d.ts +16 -0
  308. package/dist/src/skills/registry.d.ts.map +1 -0
  309. package/dist/src/skills/registry.js +61 -0
  310. package/dist/src/skills/registry.js.map +1 -0
  311. package/dist/src/sync/events.d.ts +9 -0
  312. package/dist/src/sync/events.d.ts.map +1 -0
  313. package/dist/src/sync/events.js +2 -0
  314. package/dist/src/sync/events.js.map +1 -0
  315. package/dist/src/sync/relay-server.d.ts +18 -0
  316. package/dist/src/sync/relay-server.d.ts.map +1 -0
  317. package/dist/src/sync/relay-server.js +131 -0
  318. package/dist/src/sync/relay-server.js.map +1 -0
  319. package/dist/src/sync/sync-client.d.ts +31 -0
  320. package/dist/src/sync/sync-client.d.ts.map +1 -0
  321. package/dist/src/sync/sync-client.js +314 -0
  322. package/dist/src/sync/sync-client.js.map +1 -0
  323. package/dist/src/tui/app.d.ts +35 -0
  324. package/dist/src/tui/app.d.ts.map +1 -0
  325. package/dist/src/tui/app.js +676 -0
  326. package/dist/src/tui/app.js.map +1 -0
  327. package/dist/src/tui/components/activity-feed.d.ts +12 -0
  328. package/dist/src/tui/components/activity-feed.d.ts.map +1 -0
  329. package/dist/src/tui/components/activity-feed.js +82 -0
  330. package/dist/src/tui/components/activity-feed.js.map +1 -0
  331. package/dist/src/tui/components/agent-list.d.ts +19 -0
  332. package/dist/src/tui/components/agent-list.d.ts.map +1 -0
  333. package/dist/src/tui/components/agent-list.js +33 -0
  334. package/dist/src/tui/components/agent-list.js.map +1 -0
  335. package/dist/src/tui/components/agent-row.d.ts +12 -0
  336. package/dist/src/tui/components/agent-row.d.ts.map +1 -0
  337. package/dist/src/tui/components/agent-row.js +37 -0
  338. package/dist/src/tui/components/agent-row.js.map +1 -0
  339. package/dist/src/tui/components/approval-terminal.d.ts +13 -0
  340. package/dist/src/tui/components/approval-terminal.d.ts.map +1 -0
  341. package/dist/src/tui/components/approval-terminal.js +34 -0
  342. package/dist/src/tui/components/approval-terminal.js.map +1 -0
  343. package/dist/src/tui/components/audit-viewer.d.ts +16 -0
  344. package/dist/src/tui/components/audit-viewer.d.ts.map +1 -0
  345. package/dist/src/tui/components/audit-viewer.js +46 -0
  346. package/dist/src/tui/components/audit-viewer.js.map +1 -0
  347. package/dist/src/tui/components/auth-gate.d.ts +9 -0
  348. package/dist/src/tui/components/auth-gate.d.ts.map +1 -0
  349. package/dist/src/tui/components/auth-gate.js +112 -0
  350. package/dist/src/tui/components/auth-gate.js.map +1 -0
  351. package/dist/src/tui/components/command-palette.d.ts +12 -0
  352. package/dist/src/tui/components/command-palette.d.ts.map +1 -0
  353. package/dist/src/tui/components/command-palette.js +51 -0
  354. package/dist/src/tui/components/command-palette.js.map +1 -0
  355. package/dist/src/tui/components/compliance-badge.d.ts +11 -0
  356. package/dist/src/tui/components/compliance-badge.d.ts.map +1 -0
  357. package/dist/src/tui/components/compliance-badge.js +12 -0
  358. package/dist/src/tui/components/compliance-badge.js.map +1 -0
  359. package/dist/src/tui/components/decomposition-review.d.ts +10 -0
  360. package/dist/src/tui/components/decomposition-review.d.ts.map +1 -0
  361. package/dist/src/tui/components/decomposition-review.js +19 -0
  362. package/dist/src/tui/components/decomposition-review.js.map +1 -0
  363. package/dist/src/tui/components/dependency-graph.d.ts +13 -0
  364. package/dist/src/tui/components/dependency-graph.d.ts.map +1 -0
  365. package/dist/src/tui/components/dependency-graph.js +143 -0
  366. package/dist/src/tui/components/dependency-graph.js.map +1 -0
  367. package/dist/src/tui/components/diff-viewer.d.ts +11 -0
  368. package/dist/src/tui/components/diff-viewer.d.ts.map +1 -0
  369. package/dist/src/tui/components/diff-viewer.js +82 -0
  370. package/dist/src/tui/components/diff-viewer.js.map +1 -0
  371. package/dist/src/tui/components/edit-task-input.d.ts +10 -0
  372. package/dist/src/tui/components/edit-task-input.d.ts.map +1 -0
  373. package/dist/src/tui/components/edit-task-input.js +20 -0
  374. package/dist/src/tui/components/edit-task-input.js.map +1 -0
  375. package/dist/src/tui/components/footer.d.ts +12 -0
  376. package/dist/src/tui/components/footer.d.ts.map +1 -0
  377. package/dist/src/tui/components/footer.js +41 -0
  378. package/dist/src/tui/components/footer.js.map +1 -0
  379. package/dist/src/tui/components/header.d.ts +8 -0
  380. package/dist/src/tui/components/header.d.ts.map +1 -0
  381. package/dist/src/tui/components/header.js +20 -0
  382. package/dist/src/tui/components/header.js.map +1 -0
  383. package/dist/src/tui/components/human-actions.d.ts +14 -0
  384. package/dist/src/tui/components/human-actions.d.ts.map +1 -0
  385. package/dist/src/tui/components/human-actions.js +43 -0
  386. package/dist/src/tui/components/human-actions.js.map +1 -0
  387. package/dist/src/tui/components/log-panel.d.ts +10 -0
  388. package/dist/src/tui/components/log-panel.d.ts.map +1 -0
  389. package/dist/src/tui/components/log-panel.js +38 -0
  390. package/dist/src/tui/components/log-panel.js.map +1 -0
  391. package/dist/src/tui/components/memory-viewer.d.ts +10 -0
  392. package/dist/src/tui/components/memory-viewer.d.ts.map +1 -0
  393. package/dist/src/tui/components/memory-viewer.js +44 -0
  394. package/dist/src/tui/components/memory-viewer.js.map +1 -0
  395. package/dist/src/tui/components/new-task-input.d.ts +9 -0
  396. package/dist/src/tui/components/new-task-input.d.ts.map +1 -0
  397. package/dist/src/tui/components/new-task-input.js +21 -0
  398. package/dist/src/tui/components/new-task-input.js.map +1 -0
  399. package/dist/src/tui/components/orchestrator-status.d.ts +9 -0
  400. package/dist/src/tui/components/orchestrator-status.d.ts.map +1 -0
  401. package/dist/src/tui/components/orchestrator-status.js +15 -0
  402. package/dist/src/tui/components/orchestrator-status.js.map +1 -0
  403. package/dist/src/tui/components/parallelize-banner.d.ts +8 -0
  404. package/dist/src/tui/components/parallelize-banner.d.ts.map +1 -0
  405. package/dist/src/tui/components/parallelize-banner.js +9 -0
  406. package/dist/src/tui/components/parallelize-banner.js.map +1 -0
  407. package/dist/src/tui/components/progress-bar.d.ts +9 -0
  408. package/dist/src/tui/components/progress-bar.d.ts.map +1 -0
  409. package/dist/src/tui/components/progress-bar.js +15 -0
  410. package/dist/src/tui/components/progress-bar.js.map +1 -0
  411. package/dist/src/tui/components/review-queue.d.ts +13 -0
  412. package/dist/src/tui/components/review-queue.d.ts.map +1 -0
  413. package/dist/src/tui/components/review-queue.js +78 -0
  414. package/dist/src/tui/components/review-queue.js.map +1 -0
  415. package/dist/src/tui/components/rich-header.d.ts +11 -0
  416. package/dist/src/tui/components/rich-header.d.ts.map +1 -0
  417. package/dist/src/tui/components/rich-header.js +25 -0
  418. package/dist/src/tui/components/rich-header.js.map +1 -0
  419. package/dist/src/tui/components/spinner.d.ts +7 -0
  420. package/dist/src/tui/components/spinner.d.ts.map +1 -0
  421. package/dist/src/tui/components/spinner.js +8 -0
  422. package/dist/src/tui/components/spinner.js.map +1 -0
  423. package/dist/src/tui/components/status-bar.d.ts +23 -0
  424. package/dist/src/tui/components/status-bar.d.ts.map +1 -0
  425. package/dist/src/tui/components/status-bar.js +28 -0
  426. package/dist/src/tui/components/status-bar.js.map +1 -0
  427. package/dist/src/tui/components/task-queue.d.ts +11 -0
  428. package/dist/src/tui/components/task-queue.d.ts.map +1 -0
  429. package/dist/src/tui/components/task-queue.js +30 -0
  430. package/dist/src/tui/components/task-queue.js.map +1 -0
  431. package/dist/src/tui/components/team-view.d.ts +13 -0
  432. package/dist/src/tui/components/team-view.d.ts.map +1 -0
  433. package/dist/src/tui/components/team-view.js +12 -0
  434. package/dist/src/tui/components/team-view.js.map +1 -0
  435. package/dist/src/tui/graph-renderer.d.ts +11 -0
  436. package/dist/src/tui/graph-renderer.d.ts.map +1 -0
  437. package/dist/src/tui/graph-renderer.js +296 -0
  438. package/dist/src/tui/graph-renderer.js.map +1 -0
  439. package/dist/src/tui/hooks/use-bell.d.ts +21 -0
  440. package/dist/src/tui/hooks/use-bell.d.ts.map +1 -0
  441. package/dist/src/tui/hooks/use-bell.js +38 -0
  442. package/dist/src/tui/hooks/use-bell.js.map +1 -0
  443. package/dist/src/tui/hooks/use-ci-status.d.ts +16 -0
  444. package/dist/src/tui/hooks/use-ci-status.d.ts.map +1 -0
  445. package/dist/src/tui/hooks/use-ci-status.js +97 -0
  446. package/dist/src/tui/hooks/use-ci-status.js.map +1 -0
  447. package/dist/src/tui/hooks/use-command-palette.d.ts +37 -0
  448. package/dist/src/tui/hooks/use-command-palette.d.ts.map +1 -0
  449. package/dist/src/tui/hooks/use-command-palette.js +108 -0
  450. package/dist/src/tui/hooks/use-command-palette.js.map +1 -0
  451. package/dist/src/tui/hooks/use-diff-view.d.ts +16 -0
  452. package/dist/src/tui/hooks/use-diff-view.d.ts.map +1 -0
  453. package/dist/src/tui/hooks/use-diff-view.js +75 -0
  454. package/dist/src/tui/hooks/use-diff-view.js.map +1 -0
  455. package/dist/src/tui/hooks/use-keyboard.d.ts +3 -0
  456. package/dist/src/tui/hooks/use-keyboard.d.ts.map +1 -0
  457. package/dist/src/tui/hooks/use-keyboard.js +70 -0
  458. package/dist/src/tui/hooks/use-keyboard.js.map +1 -0
  459. package/dist/src/tui/hooks/use-log-stream.d.ts +25 -0
  460. package/dist/src/tui/hooks/use-log-stream.d.ts.map +1 -0
  461. package/dist/src/tui/hooks/use-log-stream.js +83 -0
  462. package/dist/src/tui/hooks/use-log-stream.js.map +1 -0
  463. package/dist/src/tui/hooks/use-spinner.d.ts +3 -0
  464. package/dist/src/tui/hooks/use-spinner.d.ts.map +1 -0
  465. package/dist/src/tui/hooks/use-spinner.js +13 -0
  466. package/dist/src/tui/hooks/use-spinner.js.map +1 -0
  467. package/dist/src/tui/hooks/use-store.d.ts +33 -0
  468. package/dist/src/tui/hooks/use-store.d.ts.map +1 -0
  469. package/dist/src/tui/hooks/use-store.js +21 -0
  470. package/dist/src/tui/hooks/use-store.js.map +1 -0
  471. package/dist/src/tui/lib/diff-parser.d.ts +24 -0
  472. package/dist/src/tui/lib/diff-parser.d.ts.map +1 -0
  473. package/dist/src/tui/lib/diff-parser.js +115 -0
  474. package/dist/src/tui/lib/diff-parser.js.map +1 -0
  475. package/dist/src/tui/lib/palette-commands.d.ts +14 -0
  476. package/dist/src/tui/lib/palette-commands.d.ts.map +1 -0
  477. package/dist/src/tui/lib/palette-commands.js +101 -0
  478. package/dist/src/tui/lib/palette-commands.js.map +1 -0
  479. package/dist/src/tui/tui.d.ts +8 -0
  480. package/dist/src/tui/tui.d.ts.map +1 -0
  481. package/dist/src/tui/tui.js +8 -0
  482. package/dist/src/tui/tui.js.map +1 -0
  483. package/package.json +66 -0
  484. package/skills/api-design.md +84 -0
  485. package/skills/backend-typescript.md +76 -0
  486. package/skills/data-modeling.md +73 -0
  487. package/skills/devops-ci.md +82 -0
  488. package/skills/frontend-design.md +69 -0
  489. package/skills/observability.md +73 -0
  490. package/skills/react-nextjs.md +76 -0
  491. package/skills/refactoring.md +77 -0
  492. package/skills/security.md +75 -0
  493. package/skills/testing.md +69 -0
@@ -0,0 +1,118 @@
1
+ export const FUN_NAME_LIBRARY = [
2
+ { name: 'Bob', tagline: 'the safety guy', emoji: '🛡️' },
3
+ { name: 'Alice', tagline: 'the bug whisperer', emoji: '🐛' },
4
+ { name: 'Max', tagline: 'the coffee-fueled optimizer', emoji: '☕' },
5
+ { name: 'Nova', tagline: 'the refactor queen', emoji: '♻️' },
6
+ { name: 'Rex', tagline: 'the regex wizard', emoji: '🔮' },
7
+ { name: 'Zara', tagline: 'the stack trace detective', emoji: '🔍' },
8
+ { name: 'Finn', tagline: 'the human', emoji: '🧑' },
9
+ { name: 'Luna', tagline: 'the type checker', emoji: '🌙' },
10
+ { name: 'Dash', tagline: 'the CI pipeline wrangler', emoji: '🚀' },
11
+ { name: 'Pip', tagline: 'the dependency auditor', emoji: '📦' },
12
+ { name: 'Axel', tagline: 'the memory leak hunter', emoji: '🧠' },
13
+ { name: 'Cleo', tagline: 'the documentation duchess', emoji: '📚' },
14
+ { name: 'Blip', tagline: 'the edge case finder', emoji: '🎯' },
15
+ { name: 'Mia', tagline: 'the performance prophet', emoji: '📈' },
16
+ { name: 'Lex', tagline: 'the linter whisperer', emoji: '✨' },
17
+ { name: 'Byte', tagline: 'the cache invalidator', emoji: '💾' },
18
+ { name: 'Vera', tagline: 'the test coverage guardian', emoji: '🧪' },
19
+ { name: 'Orion', tagline: 'the distributed systems sage', emoji: '🌌' },
20
+ { name: 'Kira', tagline: 'the API design philosopher', emoji: '🏛️' },
21
+ { name: 'Chip', tagline: 'the stack overflow scholar', emoji: '📖' },
22
+ { name: 'Ember', tagline: 'the hot reload hero', emoji: '🔥' },
23
+ { name: 'Skye', tagline: 'the cloud migration maestro', emoji: '☁️' },
24
+ { name: 'Juno', tagline: 'the merge conflict mediator', emoji: '🤝' },
25
+ { name: 'Flint', tagline: 'the hard-to-reproduce bug tracker', emoji: '🕵️' },
26
+ { name: 'Wren', tagline: 'the silent refactoring ninja', emoji: '🥷' },
27
+ { name: 'Otto', tagline: 'the infinite loop ender', emoji: '🔁' },
28
+ { name: 'Lark', tagline: 'the early morning deployer', emoji: '🌅' },
29
+ { name: 'Coda', tagline: 'the final-line fixer', emoji: '🎵' },
30
+ { name: 'Remy', tagline: 'the race condition chef', emoji: '👨‍🍳' },
31
+ { name: 'Jinx', tagline: 'the flaky test tamer', emoji: '🎲' },
32
+ { name: 'Mox', tagline: 'the mock master', emoji: '🎭' },
33
+ { name: 'Sage', tagline: 'the code review guru', emoji: '🧙' },
34
+ { name: 'Cruz', tagline: 'the git history archaeologist', emoji: '⛏️' },
35
+ { name: 'Nox', tagline: 'the night-shift debugger', emoji: '🦉' },
36
+ { name: 'Tess', tagline: 'the TDD evangelist', emoji: '✅' },
37
+ { name: 'Brix', tagline: 'the build system bricklayer', emoji: '🧱' },
38
+ { name: 'Lyra', tagline: 'the observability oracle', emoji: '🎻' },
39
+ { name: 'Rook', tagline: 'the security fortress builder', emoji: '♜' },
40
+ { name: 'Pico', tagline: 'the micro-optimization monk', emoji: '⚖️' },
41
+ { name: 'Vex', tagline: 'the version conflict vanquisher', emoji: '⚔️' },
42
+ { name: 'Thorn', tagline: 'the legacy code archaeologist', emoji: '🌵' },
43
+ { name: 'Echo', tagline: 'the infinite recursion survivor', emoji: '🔔' },
44
+ { name: 'Moss', tagline: 'the green build guardian', emoji: '🌿' },
45
+ { name: 'Bolt', tagline: 'the parallelism pioneer', emoji: '🌩️' },
46
+ { name: 'Ivy', tagline: 'the dependency graph weaver', emoji: '🌱' },
47
+ { name: 'Dex', tagline: 'the index optimizer', emoji: '🗂️' },
48
+ { name: 'Fern', tagline: 'the functional programming fancier', emoji: '🌾' },
49
+ { name: 'Grid', tagline: 'the layout perfectionist', emoji: '📐' },
50
+ { name: 'Haze', tagline: 'the abstraction layer painter', emoji: '🌫️' },
51
+ { name: 'Ibis', tagline: 'the integration test herald', emoji: '🦢' },
52
+ { name: 'Jolt', tagline: 'the event-driven architect', emoji: '⚡' },
53
+ { name: 'Knox', tagline: 'the encryption enforcer', emoji: '🔐' },
54
+ { name: 'Lux', tagline: 'the dark mode defender', emoji: '💡' },
55
+ { name: 'Mire', tagline: 'the technical debt logger', emoji: '📝' },
56
+ { name: 'Nara', tagline: 'the null pointer negotiator', emoji: '🤺' },
57
+ { name: 'Opal', tagline: 'the colorful commit message writer', emoji: '💎' },
58
+ { name: 'Pyre', tagline: 'the dead code cremator', emoji: '🔥' },
59
+ { name: 'Quip', tagline: 'the self-documenting code believer', emoji: '💬' },
60
+ { name: 'Raze', tagline: 'the deprecated API demolisher', emoji: '🏚️' },
61
+ { name: 'Sift', tagline: 'the log noise separator', emoji: '🔬' },
62
+ { name: 'Tide', tagline: 'the data flow navigator', emoji: '🌊' },
63
+ { name: 'Uro', tagline: 'the uroboros-pattern spotter', emoji: '🐍' },
64
+ { name: 'Vale', tagline: 'the graceful degradation designer', emoji: '🏔️' },
65
+ { name: 'Wisp', tagline: 'the ephemeral state manager', emoji: '👻' },
66
+ { name: 'Xero', tagline: 'the zero-downtime deployer', emoji: '🎪' },
67
+ { name: 'Yara', tagline: 'the yet-another-refactor advocate', emoji: '🔄' },
68
+ { name: 'Zest', tagline: 'the enthusiastic test writer', emoji: '🍋' },
69
+ { name: 'Arlo', tagline: 'the architecture astronaut', emoji: '🚀' },
70
+ { name: 'Bane', tagline: 'the boolean logic bender', emoji: '🃏' },
71
+ { name: 'Cali', tagline: 'the callback chain champion', emoji: '⛓️' },
72
+ { name: 'Dusk', tagline: 'the sunset release deployer', emoji: '🌆' },
73
+ { name: 'Elan', tagline: 'the elegant error handler', emoji: '🎨' },
74
+ { name: 'Flux', tagline: 'the state management sommelier', emoji: '🍷' },
75
+ { name: 'Gale', tagline: 'the wind-speed CI runner', emoji: '🌬️' },
76
+ { name: 'Huck', tagline: 'the happy path hacker', emoji: '🛤️' },
77
+ { name: 'Inca', tagline: 'the immutable data devotee', emoji: '🏺' },
78
+ { name: 'Jade', tagline: 'the polished code jeweler', emoji: '💚' },
79
+ { name: 'Kael', tagline: 'the concurrency commander', emoji: '⚙️' },
80
+ { name: 'Lore', tagline: 'the internal wiki keeper', emoji: '📜' },
81
+ { name: 'Mora', tagline: 'the migration script maestro', emoji: '🔀' },
82
+ { name: 'Nero', tagline: 'the burn-it-down rewriter', emoji: '🔥' },
83
+ { name: 'Opus', tagline: 'the magnum feature builder', emoji: '🎼' },
84
+ { name: 'Pawn', tagline: 'the strategic tech debt trader', emoji: '♟️' },
85
+ { name: 'Quaz', tagline: 'the quantum state observer', emoji: '🔭' },
86
+ { name: 'Rift', tagline: 'the breaking change announcer', emoji: '📣' },
87
+ { name: 'Sora', tagline: 'the sky-high uptime chaser', emoji: '🕊️' },
88
+ { name: 'Trix', tagline: 'the clever workaround wizard', emoji: '🎩' },
89
+ { name: 'Umber', tagline: 'the brown-field builder', emoji: '🪵' },
90
+ { name: 'Vane', tagline: 'the direction-finding debugger', emoji: '🧭' },
91
+ { name: 'Watt', tagline: 'the power-user shortcut curator', emoji: '🔋' },
92
+ { name: 'Xian', tagline: 'the cross-platform champion', emoji: '🌍' },
93
+ { name: 'Yolo', tagline: 'the Friday afternoon deployer', emoji: '🤞' },
94
+ { name: 'Zion', tagline: 'the promised-land architect', emoji: '🌈' },
95
+ { name: 'Ark', tagline: 'the monorepo shepherd', emoji: '🚢' },
96
+ { name: 'Brio', tagline: 'the vivid variable namer', emoji: '🎺' },
97
+ { name: 'Cyan', tagline: 'the colorful code reviewer', emoji: '🎨' },
98
+ { name: 'Drew', tagline: 'the diagram-first designer', emoji: '✏️' },
99
+ { name: 'Elmo', tagline: 'the everyone-loves-a-helper helper', emoji: '❤️' },
100
+ { name: 'Faro', tagline: 'the lighthouse of best practices', emoji: '🏮' },
101
+ { name: 'Grit', tagline: 'the never-give-up bug fixer', emoji: '💪' },
102
+ // Easter eggs
103
+ { name: 'Dwight', tagline: 'assistant t\u0336o\u0336 \u0336t\u0336h\u0336e\u0336 regional manager', emoji: '🌾' },
104
+ { name: 'Michael', tagline: "World's Best Boss", emoji: '☕' },
105
+ { name: 'Clippy', tagline: "it looks like you're writing a function", emoji: '📎' },
106
+ { name: 'HAL', tagline: "I'm sorry, I can't let you push that", emoji: '🔴' },
107
+ { name: 'Spock', tagline: 'the logical reviewer', emoji: '🖖' },
108
+ { name: 'Neo', tagline: 'there is no null pointer', emoji: '💊' },
109
+ { name: 'Leeloo', tagline: 'multipass', emoji: '🎫' },
110
+ ];
111
+ export function pickFunIdentity() {
112
+ const index = Math.floor(Math.random() * FUN_NAME_LIBRARY.length);
113
+ return FUN_NAME_LIBRARY[index];
114
+ }
115
+ export function formatFunIdentity(identity) {
116
+ return `${identity.name}, ${identity.tagline} ${identity.emoji}`;
117
+ }
118
+ //# sourceMappingURL=fun-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fun-names.js","sourceRoot":"","sources":["../../../src/agent/fun-names.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,gBAAgB,GAAkB;IAC7C,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE;IACxD,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE;IAC5D,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,6BAA6B,EAAE,KAAK,EAAE,GAAG,EAAE;IACnE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,IAAI,EAAE;IAC5D,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,EAAE;IACzD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,EAAE,KAAK,EAAE,IAAI,EAAE;IACnE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE;IACnD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,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,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE;CACtD,CAAC;AAEF,MAAM,UAAU,eAAe;IAC7B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAClE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAqB;IACrD,OAAO,GAAG,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnE,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { type ChildProcess } from 'child_process';
2
+ import type { AgentProvider } from './providers/types.js';
3
+ export interface McpShimOptions {
4
+ /**
5
+ * Path to the verbo mcp.json config that names the MCP server to connect to
6
+ * (same file passed as AgentLaunchConfig.mcpConfigPath).
7
+ */
8
+ mcpConfigPath: string;
9
+ /** Executable to spawn as the provider binary. */
10
+ command: string;
11
+ /** Arguments for the provider binary. */
12
+ args?: string[];
13
+ /** Working directory for the provider binary. */
14
+ cwd?: string;
15
+ /** Additional environment variables for the provider binary. */
16
+ env?: Record<string, string>;
17
+ /**
18
+ * Provider that owns the translation layer. Only the three translate*
19
+ * methods are used by the shim.
20
+ */
21
+ provider: Pick<AgentProvider, 'translateToolDefinition' | 'translateToolCall' | 'translateToolResult'>;
22
+ /** Called for each non-tool-call line from provider stdout. */
23
+ onOutput?: (line: string) => void;
24
+ /** Called with each chunk written to provider stderr. */
25
+ onError?: (data: string) => void;
26
+ /** Called when the provider binary exits. */
27
+ onExit?: (code: number | null, signal: string | null) => void;
28
+ }
29
+ export interface McpShim {
30
+ /**
31
+ * Connect to the MCP server, fetch and translate tool definitions, spawn
32
+ * the provider binary, send the init message, and begin routing.
33
+ * Resolves once the provider binary is running.
34
+ */
35
+ start(): Promise<void>;
36
+ /** Send SIGTERM to the provider binary. Safe to call after exit. */
37
+ kill(): void;
38
+ /**
39
+ * The provider binary's child process.
40
+ * `null` before start() has been called.
41
+ */
42
+ readonly process: ChildProcess | null;
43
+ }
44
+ export declare function createMcpShim(options: McpShimOptions): McpShim;
45
+ //# sourceMappingURL=mcp-shim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-shim.d.ts","sourceRoot":"","sources":["../../../src/agent/mcp-shim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAKzD,OAAO,KAAK,EACV,aAAa,EAKd,MAAM,sBAAsB,CAAC;AA2D9B,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B;;;OAGG;IACH,QAAQ,EAAE,IAAI,CACZ,aAAa,EACb,yBAAyB,GAAG,mBAAmB,GAAG,qBAAqB,CACxE,CAAC;IACF,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,yDAAyD;IACzD,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/D;AAED,MAAM,WAAW,OAAO;IACtB;;;;OAIG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,oEAAoE;IACpE,IAAI,IAAI,IAAI,CAAC;IAEb;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;CACvC;AAoED,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAqL9D"}
@@ -0,0 +1,192 @@
1
+ import { spawn } from 'child_process';
2
+ import fs from 'fs';
3
+ import readline from 'readline';
4
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
+ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
6
+ // ── Internal helpers ───────────────────────────────────────────────────────
7
+ /**
8
+ * Convert the MCP SDK's listTools() entry into our internal MCPToolDefinition
9
+ * so that provider.translateToolDefinition() can consume it.
10
+ */
11
+ function toMCPToolDefinition(tool) {
12
+ const properties = tool.inputSchema.properties ?? {};
13
+ const required = tool.inputSchema.required ?? [];
14
+ const validTypes = new Set(['string', 'number', 'boolean', 'object', 'array']);
15
+ const parameters = Object.entries(properties).map(([paramName, schema]) => {
16
+ const s = schema;
17
+ const rawType = typeof s.type === 'string' ? s.type : 'string';
18
+ return {
19
+ name: paramName,
20
+ description: typeof s.description === 'string' ? s.description : '',
21
+ type: (validTypes.has(rawType) ? rawType : 'string'),
22
+ required: required.includes(paramName),
23
+ schema: s,
24
+ };
25
+ });
26
+ return { name: tool.name, description: tool.description ?? '', parameters };
27
+ }
28
+ function writeLine(child, message) {
29
+ child.stdin.write(JSON.stringify(message) + '\n');
30
+ }
31
+ function extractContent(result) {
32
+ // Modern MCP SDK response shape
33
+ if ('content' in result && Array.isArray(result.content)) {
34
+ const text = result.content
35
+ .map((item) => {
36
+ const c = item;
37
+ return c.type === 'text' ? String(c.text ?? '') : JSON.stringify(c);
38
+ })
39
+ .join('\n');
40
+ return { content: text, isError: result.isError ?? false };
41
+ }
42
+ // Legacy compatibility shape
43
+ if ('toolResult' in result) {
44
+ return { content: JSON.stringify(result.toolResult), isError: false };
45
+ }
46
+ return { content: '', isError: false };
47
+ }
48
+ // ── Factory ────────────────────────────────────────────────────────────────
49
+ export function createMcpShim(options) {
50
+ const { mcpConfigPath, command, args = [], cwd, env = {}, provider, onOutput, onError, onExit, } = options;
51
+ let providerProcess = null;
52
+ let mcpClient = null;
53
+ // ── start ────────────────────────────────────────────────────────────────
54
+ async function start() {
55
+ // 1. Parse the MCP config file
56
+ const configRaw = fs.readFileSync(mcpConfigPath, 'utf-8');
57
+ const config = JSON.parse(configRaw);
58
+ const serverEntries = Object.entries(config.mcpServers);
59
+ if (serverEntries.length === 0) {
60
+ throw new Error(`No MCP servers found in ${mcpConfigPath}`);
61
+ }
62
+ // Prefer the 'verbo' server; fall back to the first entry
63
+ const serverEntry = config.mcpServers['verbo'] ?? serverEntries[0][1];
64
+ // 2. Connect to the MCP server
65
+ const transport = new StdioClientTransport({
66
+ command: serverEntry.command,
67
+ args: serverEntry.args ?? [],
68
+ env: { ...process.env, ...serverEntry.env },
69
+ stderr: 'pipe',
70
+ });
71
+ mcpClient = new Client({ name: 'verbo-mcp-shim', version: '1.0.0' });
72
+ await mcpClient.connect(transport);
73
+ // 3. Fetch available tools and translate them for the provider binary
74
+ const { tools } = await mcpClient.listTools();
75
+ const translatedTools = tools.map((tool) => {
76
+ const mcpDef = toMCPToolDefinition(tool);
77
+ const providerDef = provider.translateToolDefinition(mcpDef);
78
+ return { mcpName: tool.name, definition: providerDef.raw };
79
+ });
80
+ // 4. Spawn the provider binary
81
+ providerProcess = spawn(command, args, {
82
+ cwd,
83
+ stdio: ['pipe', 'pipe', 'pipe'],
84
+ env: { ...process.env, ...env },
85
+ });
86
+ if (!providerProcess.stdin || !providerProcess.stdout) {
87
+ throw new Error('Provider binary does not support piped stdio');
88
+ }
89
+ // 5. Send init message with translated tool definitions
90
+ const initMsg = { type: 'init', tools: translatedTools };
91
+ writeLine(providerProcess, initMsg);
92
+ // 6. Forward stderr
93
+ if (providerProcess.stderr) {
94
+ providerProcess.stderr.on('data', (chunk) => {
95
+ onError?.(chunk.toString());
96
+ });
97
+ }
98
+ // 7. Read stdout line-by-line and route tool calls
99
+ const rl = readline.createInterface({
100
+ input: providerProcess.stdout,
101
+ crlfDelay: Infinity,
102
+ });
103
+ rl.on('line', (line) => {
104
+ void handleLine(line);
105
+ });
106
+ // 8. Clean up when provider exits
107
+ providerProcess.on('close', (code, signal) => {
108
+ mcpClient?.close().catch(() => { });
109
+ onExit?.(code, signal);
110
+ });
111
+ }
112
+ // ── line handler ─────────────────────────────────────────────────────────
113
+ async function handleLine(line) {
114
+ // Try parsing as JSON
115
+ let parsed;
116
+ try {
117
+ parsed = JSON.parse(line);
118
+ }
119
+ catch {
120
+ onOutput?.(line);
121
+ return;
122
+ }
123
+ if (typeof parsed !== 'object' ||
124
+ parsed === null ||
125
+ parsed.type !== 'tool_call') {
126
+ // Not a tool-call event — forward as regular output
127
+ onOutput?.(line);
128
+ return;
129
+ }
130
+ const callMsg = parsed;
131
+ // Build a ProviderToolCall so the provider can translate it back to MCP
132
+ const providerCall = {
133
+ id: callMsg.id,
134
+ providerName: callMsg.name,
135
+ arguments: callMsg.arguments ?? {},
136
+ originalMCPTool: callMsg.name,
137
+ };
138
+ const mcpCall = provider.translateToolCall(providerCall);
139
+ // Route through MCP
140
+ let callResult;
141
+ try {
142
+ const rawResult = await mcpClient.callTool({
143
+ name: mcpCall.toolName,
144
+ arguments: mcpCall.arguments,
145
+ });
146
+ callResult = extractContent(rawResult);
147
+ }
148
+ catch (err) {
149
+ callResult = {
150
+ content: err instanceof Error ? err.message : String(err),
151
+ isError: true,
152
+ };
153
+ }
154
+ // Translate the MCP result back through the provider layer
155
+ const mcpResult = {
156
+ toolName: mcpCall.toolName,
157
+ content: callResult.content,
158
+ isError: callResult.isError,
159
+ };
160
+ const providerResult = provider.translateToolResult(mcpResult);
161
+ // Write result back to the provider binary, echoing the original call id
162
+ const resultMsg = {
163
+ type: 'tool_result',
164
+ id: callMsg.id,
165
+ content: providerResult.content,
166
+ isError: providerResult.isError,
167
+ };
168
+ if (providerProcess?.stdin && !providerProcess.stdin.destroyed) {
169
+ writeLine(providerProcess, resultMsg);
170
+ }
171
+ }
172
+ // ── kill ─────────────────────────────────────────────────────────────────
173
+ function kill() {
174
+ const pid = providerProcess?.pid;
175
+ if (pid !== undefined) {
176
+ try {
177
+ process.kill(pid);
178
+ }
179
+ catch {
180
+ // Process may already be dead — ignore
181
+ }
182
+ }
183
+ }
184
+ return {
185
+ get process() {
186
+ return providerProcess;
187
+ },
188
+ start,
189
+ kill,
190
+ };
191
+ }
192
+ //# sourceMappingURL=mcp-shim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-shim.js","sourceRoot":"","sources":["../../../src/agent/mcp-shim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAkHjF,8EAA8E;AAE9E;;;GAGG;AACH,SAAS,mBAAmB,CAAC,IAQ5B;IACC,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,IAAI,EAAE,CAAC;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,IAAI,EAAE,CAAC;IACjD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAE/E,MAAM,UAAU,GAAuB,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CACnE,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE;QACtB,MAAM,CAAC,GAAG,MAAiC,CAAC;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QA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CAAC,OAAO;SAChC,CAAC;QAEF,IAAI,eAAe,EAAE,KAAK,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YAC/D,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED,4EAA4E;IAE5E,SAAS,IAAI;QACX,MAAM,GAAG,GAAG,eAAe,EAAE,GAAG,CAAC;QACjC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACpB,CAAC;YAAC,MAAM,CAAC;gBACP,uCAAuC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,OAAO;YACT,OAAO,eAAe,CAAC;QACzB,CAAC;QACD,KAAK;QACL,IAAI;KACL,CAAC;AACJ,CAAC"}
@@ -0,0 +1,47 @@
1
+ export interface AgentPersona {
2
+ /** Unique machine key, matches VERBO.md persona name */
3
+ name: string;
4
+ /** Human-readable label shown in TUI */
5
+ label: string;
6
+ /** Keywords matched against task title + description (case-insensitive) */
7
+ matchKeywords: string[];
8
+ /** Appended verbatim to the agent's prompt after the base prompt */
9
+ systemPromptAddendum: string;
10
+ /** Paths relative to projectDir of extra skill/context files to inject into CLAUDE.md */
11
+ skillFiles: string[];
12
+ /** If set, overrides agentRules.defaultTrust from VERBO.md */
13
+ trustLevelOverride?: 'low' | 'medium' | 'high';
14
+ /** Glob patterns this persona must never touch (merged with global neverTouch) */
15
+ neverTouch: string[];
16
+ }
17
+ /**
18
+ * Counts how many of persona.matchKeywords appear in the combined
19
+ * task title + description string (case-insensitive). Each keyword
20
+ * is counted at most once regardless of how many times it appears.
21
+ */
22
+ export declare function scorePersona(persona: AgentPersona, taskTitle: string, taskDescription: string): number;
23
+ /**
24
+ * Returns the persona with the highest score above 0, or null if no match.
25
+ * On a tie, the first persona in the array wins (stable sort).
26
+ */
27
+ export declare function matchPersona(task: {
28
+ title: string;
29
+ description?: string;
30
+ }, personas: AgentPersona[]): AgentPersona | null;
31
+ /**
32
+ * Formats the persona's systemPromptAddendum for injection into the agent prompt.
33
+ */
34
+ export declare function buildPersonaPromptAddendum(persona: AgentPersona): string;
35
+ /**
36
+ * Returns true if `filePath` resolves to a location inside `dir`.
37
+ * Both paths are resolved to absolute form before comparison.
38
+ */
39
+ export declare function isPathInsideDir(filePath: string, dir: string): boolean;
40
+ /**
41
+ * Reads each file in persona.skillFiles from projectDir, then appends their
42
+ * content to the worktree's CLAUDE.md under a "Persona Skill Files" section.
43
+ * Missing files are silently skipped. Files that resolve outside projectDir
44
+ * are rejected to prevent path-traversal attacks.
45
+ */
46
+ export declare function applyPersonaSkillFiles(persona: AgentPersona, worktreePath: string, projectDir: string): void;
47
+ //# sourceMappingURL=personas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personas.d.ts","sourceRoot":"","sources":["../../../src/agent/personas.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,oEAAoE;IACpE,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yFAAyF;IACzF,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,kFAAkF;IAClF,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GACtB,MAAM,CASR;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,EAC7C,QAAQ,EAAE,YAAY,EAAE,GACvB,YAAY,GAAG,IAAI,CAcrB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAOxE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAItE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,YAAY,EACrB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,IAAI,CAyBN"}
@@ -0,0 +1,86 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ /**
4
+ * Counts how many of persona.matchKeywords appear in the combined
5
+ * task title + description string (case-insensitive). Each keyword
6
+ * is counted at most once regardless of how many times it appears.
7
+ */
8
+ export function scorePersona(persona, taskTitle, taskDescription) {
9
+ const haystack = `${taskTitle} ${taskDescription}`.toLowerCase();
10
+ let score = 0;
11
+ for (const keyword of persona.matchKeywords) {
12
+ if (haystack.includes(keyword.toLowerCase())) {
13
+ score++;
14
+ }
15
+ }
16
+ return score;
17
+ }
18
+ /**
19
+ * Returns the persona with the highest score above 0, or null if no match.
20
+ * On a tie, the first persona in the array wins (stable sort).
21
+ */
22
+ export function matchPersona(task, personas) {
23
+ const description = task.description ?? '';
24
+ let bestPersona = null;
25
+ let bestScore = 0;
26
+ for (const persona of personas) {
27
+ const score = scorePersona(persona, task.title, description);
28
+ if (score > bestScore) {
29
+ bestScore = score;
30
+ bestPersona = persona;
31
+ }
32
+ }
33
+ return bestPersona;
34
+ }
35
+ /**
36
+ * Formats the persona's systemPromptAddendum for injection into the agent prompt.
37
+ */
38
+ export function buildPersonaPromptAddendum(persona) {
39
+ const lines = [
40
+ `# Persona: ${persona.label}`,
41
+ '',
42
+ persona.systemPromptAddendum,
43
+ ];
44
+ return lines.join('\n');
45
+ }
46
+ /**
47
+ * Returns true if `filePath` resolves to a location inside `dir`.
48
+ * Both paths are resolved to absolute form before comparison.
49
+ */
50
+ export function isPathInsideDir(filePath, dir) {
51
+ const resolvedDir = path.resolve(dir) + path.sep;
52
+ const resolvedFile = path.resolve(filePath);
53
+ return resolvedFile.startsWith(resolvedDir) || resolvedFile === path.resolve(dir);
54
+ }
55
+ /**
56
+ * Reads each file in persona.skillFiles from projectDir, then appends their
57
+ * content to the worktree's CLAUDE.md under a "Persona Skill Files" section.
58
+ * Missing files are silently skipped. Files that resolve outside projectDir
59
+ * are rejected to prevent path-traversal attacks.
60
+ */
61
+ export function applyPersonaSkillFiles(persona, worktreePath, projectDir) {
62
+ if (persona.skillFiles.length === 0)
63
+ return;
64
+ const sections = [];
65
+ for (const skillFile of persona.skillFiles) {
66
+ const filePath = path.resolve(projectDir, skillFile);
67
+ if (!isPathInsideDir(filePath, projectDir))
68
+ continue;
69
+ if (!fs.existsSync(filePath))
70
+ continue;
71
+ const content = fs.readFileSync(filePath, 'utf-8');
72
+ sections.push(content);
73
+ }
74
+ if (sections.length === 0)
75
+ return;
76
+ const injection = `\n\n# Persona Skill Files (${persona.label})\n\n` + sections.join('\n\n---\n\n');
77
+ const claudeMdPath = path.join(worktreePath, 'CLAUDE.md');
78
+ if (fs.existsSync(claudeMdPath)) {
79
+ const existing = fs.readFileSync(claudeMdPath, 'utf-8');
80
+ fs.writeFileSync(claudeMdPath, existing + injection, 'utf-8');
81
+ }
82
+ else {
83
+ fs.writeFileSync(claudeMdPath, injection, 'utf-8');
84
+ }
85
+ }
86
+ //# sourceMappingURL=personas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personas.js","sourceRoot":"","sources":["../../../src/agent/personas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAmBxB;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAqB,EACrB,SAAiB,EACjB,eAAuB;IAEvB,M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,CAAC;IAChE,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
@@ -0,0 +1,21 @@
1
+ /** Timeout for each --version check. Keeps detection snappy even on slow PATHs. */
2
+ export declare const DETECTION_TIMEOUT_MS = 3000;
3
+ /** Ordered list of known provider CLIs, from most to least preferred. */
4
+ export declare const PROVIDER_PREFERENCE_ORDER: readonly ["claude", "codex", "gemini"];
5
+ export type DetectableProvider = (typeof PROVIDER_PREFERENCE_ORDER)[number];
6
+ /**
7
+ * Return true when `<name> --version` exits successfully within `DETECTION_TIMEOUT_MS`.
8
+ * Any non-zero exit, missing binary, or timeout all map to false — no error is thrown.
9
+ */
10
+ export declare function checkProviderCli(name: string): Promise<boolean>;
11
+ /**
12
+ * Return all provider CLIs that are currently installed, preserving preference order.
13
+ * Runs all checks concurrently for speed.
14
+ */
15
+ export declare function detectAvailableProviders(): Promise<DetectableProvider[]>;
16
+ /**
17
+ * Return the highest-priority installed provider CLI, or undefined if none are found.
18
+ * Checks sequentially so it short-circuits on the first match.
19
+ */
20
+ export declare function detectPreferredProvider(): Promise<DetectableProvider | undefined>;
21
+ //# sourceMappingURL=provider-detection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-detection.d.ts","sourceRoot":"","sources":["../../../src/agent/provider-detection.ts"],"names":[],"mappings":"AAOA,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,wCAAyC,CAAC;AAEhF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAI5E;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOrE;AAID;;;GAGG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAQ9E;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAOvF"}
@@ -0,0 +1,47 @@
1
+ import { execFile } from 'child_process';
2
+ import { promisify } from 'util';
3
+ const execFileAsync = promisify(execFile);
4
+ // ---- Constants ----
5
+ /** Timeout for each --version check. Keeps detection snappy even on slow PATHs. */
6
+ export const DETECTION_TIMEOUT_MS = 3000;
7
+ /** Ordered list of known provider CLIs, from most to least preferred. */
8
+ export const PROVIDER_PREFERENCE_ORDER = ['claude', 'codex', 'gemini'];
9
+ // ---- Low-level CLI probe ----
10
+ /**
11
+ * Return true when `<name> --version` exits successfully within `DETECTION_TIMEOUT_MS`.
12
+ * Any non-zero exit, missing binary, or timeout all map to false — no error is thrown.
13
+ */
14
+ export async function checkProviderCli(name) {
15
+ try {
16
+ await execFileAsync(name, ['--version'], { timeout: DETECTION_TIMEOUT_MS });
17
+ return true;
18
+ }
19
+ catch {
20
+ return false;
21
+ }
22
+ }
23
+ // ---- Higher-level detection helpers ----
24
+ /**
25
+ * Return all provider CLIs that are currently installed, preserving preference order.
26
+ * Runs all checks concurrently for speed.
27
+ */
28
+ export async function detectAvailableProviders() {
29
+ const results = await Promise.all(PROVIDER_PREFERENCE_ORDER.map(async (provider) => ({
30
+ provider,
31
+ available: await checkProviderCli(provider),
32
+ })));
33
+ return results.filter((r) => r.available).map((r) => r.provider);
34
+ }
35
+ /**
36
+ * Return the highest-priority installed provider CLI, or undefined if none are found.
37
+ * Checks sequentially so it short-circuits on the first match.
38
+ */
39
+ export async function detectPreferredProvider() {
40
+ for (const provider of PROVIDER_PREFERENCE_ORDER) {
41
+ if (await checkProviderCli(provider)) {
42
+ return provider;
43
+ }
44
+ }
45
+ return undefined;
46
+ }
47
+ //# sourceMappingURL=provider-detection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-detection.js","sourceRoot":"","sources":["../../../src/agent/provider-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C;QACjD,IAAI,MAAM,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrC,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { AgentProvider } from './types.js';
2
+ export declare function createClaudeProvider(): AgentProvider;
3
+ //# sourceMappingURL=claude-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-provider.d.ts","sourceRoot":"","sources":["../../../../src/agent/providers/claude-provider.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,aAAa,EAYd,MAAM,YAAY,CAAC;AAIpB,wBAAgB,oBAAoB,IAAI,aAAa,CAwIpD"}