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,140 @@
1
+ import { ulid } from 'ulid';
2
+ // ---- Pricing (Claude Sonnet 4.x defaults) ----
3
+ const PRICE_INPUT_PER_TOKEN = 3 / 1_000_000; // $3 per 1M input tokens
4
+ const PRICE_OUTPUT_PER_TOKEN = 15 / 1_000_000; // $15 per 1M output tokens
5
+ const PRICE_CACHE_READ_PER_TOKEN = 0.3 / 1_000_000; // $0.30 per 1M cache-read tokens
6
+ const PRICE_CACHE_WRITE_PER_TOKEN = 3.75 / 1_000_000; // $3.75 per 1M cache-write tokens
7
+ export function computeCostUsd(inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens) {
8
+ return (inputTokens * PRICE_INPUT_PER_TOKEN +
9
+ outputTokens * PRICE_OUTPUT_PER_TOKEN +
10
+ cacheReadTokens * PRICE_CACHE_READ_PER_TOKEN +
11
+ cacheWriteTokens * PRICE_CACHE_WRITE_PER_TOKEN);
12
+ }
13
+ function rowToEntry(row) {
14
+ return {
15
+ id: row.id,
16
+ timestamp: row.timestamp,
17
+ pipelineRunId: row.pipeline_run_id,
18
+ taskId: row.task_id,
19
+ inputTokens: row.input_tokens,
20
+ outputTokens: row.output_tokens,
21
+ cacheReadTokens: row.cache_read_tokens,
22
+ cacheWriteTokens: row.cache_write_tokens,
23
+ costUsd: row.cost_usd,
24
+ };
25
+ }
26
+ // ---- Factory ----
27
+ export function createCostStore(db) {
28
+ const raw = db.raw();
29
+ const stmtInsert = raw.prepare(`
30
+ INSERT INTO task_cost_ledger
31
+ (id, timestamp, pipeline_run_id, task_id, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, cost_usd)
32
+ VALUES
33
+ (@id, @timestamp, @pipeline_run_id, @task_id, @input_tokens, @output_tokens, @cache_read_tokens, @cache_write_tokens, @cost_usd)
34
+ `);
35
+ const stmtGetById = raw.prepare('SELECT * FROM task_cost_ledger WHERE id = ?');
36
+ const stmtGetByRunId = raw.prepare('SELECT * FROM task_cost_ledger WHERE pipeline_run_id = ? ORDER BY timestamp ASC');
37
+ const stmtSumCost = raw.prepare('SELECT COALESCE(SUM(cost_usd), 0) AS total FROM task_cost_ledger WHERE pipeline_run_id = ?');
38
+ function record(input) {
39
+ const id = ulid();
40
+ const timestamp = new Date().toISOString();
41
+ const costUsd = computeCostUsd(input.inputTokens, input.outputTokens, input.cacheReadTokens, input.cacheWriteTokens);
42
+ stmtInsert.run({
43
+ id,
44
+ timestamp,
45
+ pipeline_run_id: input.pipelineRunId,
46
+ task_id: input.taskId ?? null,
47
+ input_tokens: input.inputTokens,
48
+ output_tokens: input.outputTokens,
49
+ cache_read_tokens: input.cacheReadTokens,
50
+ cache_write_tokens: input.cacheWriteTokens,
51
+ cost_usd: costUsd,
52
+ });
53
+ return rowToEntry(stmtGetById.get(id));
54
+ }
55
+ function getTotalCostUsd(pipelineRunId) {
56
+ return stmtSumCost.get(pipelineRunId).total;
57
+ }
58
+ function getEntries(pipelineRunId) {
59
+ return stmtGetByRunId.all(pipelineRunId).map(rowToEntry);
60
+ }
61
+ function getSummary() {
62
+ const row = raw.prepare(`
63
+ SELECT
64
+ COALESCE(SUM(cost_usd), 0) AS total_cost_usd,
65
+ COUNT(*) AS entry_count,
66
+ COALESCE(SUM(input_tokens), 0) AS total_input_tokens,
67
+ COALESCE(SUM(output_tokens), 0) AS total_output_tokens,
68
+ COALESCE(SUM(cache_read_tokens), 0) AS total_cache_read_tokens,
69
+ COALESCE(SUM(cache_write_tokens), 0) AS total_cache_write_tokens
70
+ FROM task_cost_ledger
71
+ `).get();
72
+ return {
73
+ totalCostUsd: row.total_cost_usd,
74
+ entryCount: row.entry_count,
75
+ totalInputTokens: row.total_input_tokens,
76
+ totalOutputTokens: row.total_output_tokens,
77
+ totalCacheReadTokens: row.total_cache_read_tokens,
78
+ totalCacheWriteTokens: row.total_cache_write_tokens,
79
+ };
80
+ }
81
+ function getCostToday() {
82
+ const today = new Date().toISOString().slice(0, 10); // YYYY-MM-DD
83
+ const row = raw.prepare(`SELECT COALESCE(SUM(cost_usd), 0) AS total FROM task_cost_ledger WHERE timestamp >= ?`).get(today);
84
+ return row.total;
85
+ }
86
+ function getCostByTask() {
87
+ return raw.prepare(`
88
+ SELECT COALESCE(task_id, '(no task)') AS "group", SUM(cost_usd) AS cost_usd, COUNT(*) AS entry_count
89
+ FROM task_cost_ledger GROUP BY task_id ORDER BY cost_usd DESC
90
+ `).all();
91
+ }
92
+ function getCostByDay() {
93
+ return raw.prepare(`
94
+ SELECT substr(timestamp, 1, 10) AS "group", SUM(cost_usd) AS cost_usd, COUNT(*) AS entry_count
95
+ FROM task_cost_ledger GROUP BY substr(timestamp, 1, 10) ORDER BY "group" DESC
96
+ `).all();
97
+ }
98
+ function getCostByPipeline() {
99
+ return raw.prepare(`
100
+ SELECT pipeline_run_id AS "group", SUM(cost_usd) AS cost_usd, COUNT(*) AS entry_count
101
+ FROM task_cost_ledger GROUP BY pipeline_run_id ORDER BY cost_usd DESC
102
+ `).all();
103
+ }
104
+ function updateModelPricing(input) {
105
+ raw.prepare(`
106
+ INSERT INTO model_pricing (model, input_cost_per_1m_tokens, output_cost_per_1m_tokens, cache_read_cost_per_1m_tokens, cache_write_cost_per_1m_tokens, updated_at)
107
+ VALUES (@model, @input, @output, @cacheRead, @cacheWrite, @updatedAt)
108
+ ON CONFLICT(model) DO UPDATE SET
109
+ input_cost_per_1m_tokens = @input,
110
+ output_cost_per_1m_tokens = @output,
111
+ cache_read_cost_per_1m_tokens = @cacheRead,
112
+ cache_write_cost_per_1m_tokens = @cacheWrite,
113
+ updated_at = @updatedAt
114
+ `).run({
115
+ model: input.model,
116
+ input: input.inputCostPer1mTokens,
117
+ output: input.outputCostPer1mTokens,
118
+ cacheRead: input.cacheReadCostPer1mTokens,
119
+ cacheWrite: input.cacheWriteCostPer1mTokens,
120
+ updatedAt: new Date().toISOString(),
121
+ });
122
+ }
123
+ function listModelPricing() {
124
+ const rows = raw.prepare('SELECT * FROM model_pricing ORDER BY model').all();
125
+ return rows.map((r) => ({
126
+ model: r.model,
127
+ inputCostPer1mTokens: r.input_cost_per_1m_tokens,
128
+ outputCostPer1mTokens: r.output_cost_per_1m_tokens,
129
+ cacheReadCostPer1mTokens: r.cache_read_cost_per_1m_tokens,
130
+ cacheWriteCostPer1mTokens: r.cache_write_cost_per_1m_tokens,
131
+ }));
132
+ }
133
+ return {
134
+ record, getTotalCostUsd, getEntries,
135
+ getSummary, getCostToday,
136
+ getCostByTask, getCostByDay, getCostByPipeline,
137
+ updateModelPricing, listModelPricing,
138
+ };
139
+ }
140
+ //# sourceMappingURL=cost-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cost-store.js","sourceRoot":"","sources":["../../../src/core/cost-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B,iDAAiD;AAEjD,MAAM,qBAAqB,GAAG,CAAC,GAAG,SAAS,CAAC,CAAS,yBAAyB;AAC9E,MAAM,sBAAsB,GAAG,EAAE,GAAG,SAAS,CAAC,CAAQ,2BAA2B;AACjF,MAAM,0BAA0B,GAAG,GAAG,GAAG,SAAS,CAAC,CAAG,iCAAiC;AACvF,MAAM,2BAA2B,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,kCAAkC;AAExF,MAAM,UAAU,cAAc,CAC5B,WAAmB,EACnB,YAAoB,EACpB,eAAuB,EACvB,gBAAwB;IAExB,OAAO,CACL,WAAW,GAAG,qBAAqB;QACnC,YAAY,GAAG,sBAAsB;QACrC,eAAe,GAAG,0BAA0B;QAC5C,gBAAgB,GAAG,2BAA2B,CAC/C,CAAC;AACJ,CAAC;AA2ED,SAAS,UAAU,CAAC,GAAY;IAC9B,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,aAAa,EAAE,GAAG,CAAC,eAAe;QAClC,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,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,EAAiB,CAAC;IAC1B,CAAC;IAED,SAAS,kBAAkB,CAAC,KAAmB;QAC7C,GAAG,CAAC,OAAO,CAAC;;;;;;;;;KASX,CAAC,CAAC,GAAG,CAAC;YACL,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,oBAAoB;YACjC,MAAM,EAAE,KAAK,CAAC,qBAAqB;YACnC,SAAS,EAAE,KAAK,CAAC,wBAAwB;YACzC,UAAU,EAAE,KAAK,CAAC,yBAAyB;YAC3C,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAC,CAAC;IACL,CAAC;IAED,SAAS,gBAAgB;QACvB,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC,GAAG,EAMvE,CAAC;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACtB,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,oBAAoB,EAAE,CAAC,CAAC,wBAAwB;YAChD,qBAAqB,EAAE,CAAC,CAAC,yBAAyB;YAClD,wBAAwB,EAAE,CAAC,CAAC,6BAA6B;YACzD,yBAAyB,EAAE,CAAC,CAAC,8BAA8B;SAC5D,CAAC,CAAC,CAAC;IACN,CAAC;IAED,OAAO;QACL,MAAM,EAAE,eAAe,EAAE,UAAU;QACnC,UAAU,EAAE,YAAY;QACxB,aAAa,EAAE,YAAY,EAAE,iBAAiB;QAC9C,kBAAkB,EAAE,gBAAgB;KACrC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ export interface HotFilesOptions {
2
+ projectDir: string;
3
+ topN?: number;
4
+ configOverrides?: {
5
+ include?: string[];
6
+ exclude?: string[];
7
+ };
8
+ exec?: (cmd: string, args: string[], opts?: {
9
+ cwd?: string;
10
+ }) => string;
11
+ fileExists?: (path: string) => boolean;
12
+ }
13
+ export interface HotFiles {
14
+ getHotFiles(): string[];
15
+ isHot(filePath: string): boolean;
16
+ refresh(): void;
17
+ }
18
+ export declare function createHotFiles(options: HotFilesOptions): HotFiles;
19
+ //# sourceMappingURL=hot-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hot-files.d.ts","sourceRoot":"","sources":["../../../src/core/hot-files.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC7D,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACxE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,IAAI,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAwEjE"}
@@ -0,0 +1,64 @@
1
+ import { execFileSync } from 'child_process';
2
+ import { existsSync } from 'fs';
3
+ import { join } from 'path';
4
+ export function createHotFiles(options) {
5
+ const { projectDir, configOverrides } = options;
6
+ const topN = options.topN ?? 5;
7
+ const exec = options.exec ??
8
+ ((cmd, args, opts) => execFileSync(cmd, args, {
9
+ cwd: opts?.cwd,
10
+ encoding: 'utf-8',
11
+ stdio: ['ignore', 'pipe', 'ignore'],
12
+ }));
13
+ const fileExists = options.fileExists ?? ((p) => existsSync(join(projectDir, p)));
14
+ let hotSet = new Set();
15
+ let hotList = [];
16
+ function detect() {
17
+ let output = '';
18
+ try {
19
+ output = exec('git', ['log', '--name-only', '--pretty=format:', '-n', '100'], { cwd: projectDir });
20
+ }
21
+ catch {
22
+ hotSet = new Set();
23
+ hotList = [];
24
+ return;
25
+ }
26
+ const freq = new Map();
27
+ for (const line of output.split('\n')) {
28
+ const file = line.trim();
29
+ if (!file)
30
+ continue;
31
+ freq.set(file, (freq.get(file) ?? 0) + 1);
32
+ }
33
+ for (const file of freq.keys()) {
34
+ if (!fileExists(file))
35
+ freq.delete(file);
36
+ }
37
+ const sorted = [...freq.entries()]
38
+ .sort((a, b) => b[1] - a[1])
39
+ .slice(0, topN)
40
+ .map(([file]) => file);
41
+ const excluded = new Set(configOverrides?.exclude ?? []);
42
+ const included = configOverrides?.include ?? [];
43
+ const result = sorted.filter((f) => !excluded.has(f));
44
+ for (const inc of included) {
45
+ if (!result.includes(inc))
46
+ result.push(inc);
47
+ }
48
+ hotList = result;
49
+ hotSet = new Set(result);
50
+ }
51
+ detect();
52
+ return {
53
+ getHotFiles() {
54
+ return hotList.slice();
55
+ },
56
+ isHot(filePath) {
57
+ return hotSet.has(filePath);
58
+ },
59
+ refresh() {
60
+ detect();
61
+ },
62
+ };
63
+ }
64
+ //# sourceMappingURL=hot-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hot-files.js","sourceRoot":"","sources":["../../../src/core/hot-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAgB5B,MAAM,UAAU,cAAc,CAAC,OAAwB;IACrD,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IAC/B,MAAM,IAAI,GACR,OAAO,CAAC,IAAI;QACZ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,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { VerboDatabase } from '../db/database.js';
2
+ export type HumanActionUrgency = 'blocking' | 'important' | 'nice-to-have';
3
+ export interface HumanAction {
4
+ id: string;
5
+ taskId: string | null;
6
+ agentSessionId: string | null;
7
+ description: string;
8
+ context: string | null;
9
+ urgency: HumanActionUrgency;
10
+ status: 'pending' | 'done';
11
+ createdAt: string;
12
+ resolvedAt: string | null;
13
+ actionType: string | null;
14
+ prUrl: string | null;
15
+ }
16
+ export interface CreateHumanActionInput {
17
+ taskId?: string;
18
+ agentSessionId?: string;
19
+ description: string;
20
+ context?: string;
21
+ urgency?: HumanActionUrgency;
22
+ actionType?: string;
23
+ prUrl?: string;
24
+ }
25
+ export interface HumanActionStore {
26
+ create(input: CreateHumanActionInput): HumanAction;
27
+ get(id: string): HumanAction | null;
28
+ resolve(id: string): HumanAction;
29
+ listPending(): HumanAction[];
30
+ listAll(limit?: number): HumanAction[];
31
+ }
32
+ export declare function createHumanActionStore(db: VerboDatabase): HumanActionStore;
33
+ //# sourceMappingURL=human-action-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-action-store.d.ts","sourceRoot":"","sources":["../../../src/core/human-action-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvD,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,CAAC;AAE3E,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,KAAK,EAAE,sBAAsB,GAAG,WAAW,CAAC;IACnD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC;IACjC,WAAW,IAAI,WAAW,EAAE,CAAC;IAC7B,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,WAAW,EAAE,CAAC;CACxC;AA8CD,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,aAAa,GAAG,gBAAgB,CAoF1E"}
@@ -0,0 +1,92 @@
1
+ import { ulid } from 'ulid';
2
+ // ---- Helper: row -> HumanAction ----
3
+ function rowToHumanAction(row) {
4
+ return {
5
+ id: row.id,
6
+ taskId: row.task_id,
7
+ agentSessionId: row.agent_session_id,
8
+ description: row.description,
9
+ context: row.context,
10
+ urgency: row.urgency,
11
+ status: row.status,
12
+ createdAt: row.created_at,
13
+ resolvedAt: row.resolved_at,
14
+ actionType: row.action_type,
15
+ prUrl: row.pr_url,
16
+ };
17
+ }
18
+ // ---- Urgency sort order ----
19
+ const URGENCY_ORDER = {
20
+ blocking: 0,
21
+ important: 1,
22
+ 'nice-to-have': 2,
23
+ };
24
+ // ---- Factory ----
25
+ export function createHumanActionStore(db) {
26
+ const raw = db.raw();
27
+ const stmtInsert = raw.prepare(`
28
+ INSERT INTO human_actions (
29
+ id, task_id, agent_session_id, description, context,
30
+ urgency, status, created_at, resolved_at,
31
+ action_type, pr_url
32
+ ) VALUES (
33
+ @id, @task_id, @agent_session_id, @description, @context,
34
+ @urgency, @status, @created_at, @resolved_at,
35
+ @action_type, @pr_url
36
+ )
37
+ `);
38
+ const stmtGetById = raw.prepare('SELECT * FROM human_actions WHERE id = ?');
39
+ const stmtListPending = raw.prepare("SELECT * FROM human_actions WHERE status = 'pending' ORDER BY created_at ASC");
40
+ const stmtListAll = raw.prepare('SELECT * FROM human_actions ORDER BY created_at DESC LIMIT ?');
41
+ const stmtResolve = raw.prepare(`
42
+ UPDATE human_actions
43
+ SET status = 'done', resolved_at = @resolved_at
44
+ WHERE id = @id
45
+ `);
46
+ function create(input) {
47
+ const now = new Date().toISOString();
48
+ const id = ulid();
49
+ const row = {
50
+ id,
51
+ task_id: input.taskId ?? null,
52
+ agent_session_id: input.agentSessionId ?? null,
53
+ description: input.description,
54
+ context: input.context ?? null,
55
+ urgency: input.urgency ?? 'important',
56
+ status: 'pending',
57
+ created_at: now,
58
+ resolved_at: null,
59
+ action_type: input.actionType ?? null,
60
+ pr_url: input.prUrl ?? null,
61
+ };
62
+ stmtInsert.run(row);
63
+ return get(id);
64
+ }
65
+ function get(id) {
66
+ const row = stmtGetById.get(id);
67
+ if (!row)
68
+ return null;
69
+ return rowToHumanAction(row);
70
+ }
71
+ function resolve(id) {
72
+ const now = new Date().toISOString();
73
+ stmtResolve.run({ id, resolved_at: now });
74
+ return get(id);
75
+ }
76
+ function listPending() {
77
+ const rows = stmtListPending.all();
78
+ return rows.map(rowToHumanAction).sort((a, b) => URGENCY_ORDER[a.urgency] - URGENCY_ORDER[b.urgency]);
79
+ }
80
+ function listAll(limit = 100) {
81
+ const rows = stmtListAll.all(limit);
82
+ return rows.map(rowToHumanAction);
83
+ }
84
+ return {
85
+ create,
86
+ get,
87
+ resolve,
88
+ listPending,
89
+ listAll,
90
+ };
91
+ }
92
+ //# sourceMappingURL=human-action-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human-action-store.js","sourceRoot":"","sources":["../../../src/core/human-action-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAuD5B,uCAAuC;AAEvC,SAAS,gBAAgB,CAAC,GAAmB;IAC3C,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,cAAc,EAAE,GAAG,CAAC,gBAAgB;QACpC,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,OAAO,EAAE,GAAG,CAAC,OAA6B;QAC1C,MAAM,EAAE,GAAG,CAAC,MAA+B;QAC3C,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,KAAK,EAAE,GAAG,CAAC,MAAM;KAClB,CAAC;AACJ,CAAC;AAED,+BAA+B;AAE/B,MAAM,aAAa,GAAuC;IACxD,QAAQ,EAAE,CAAC;IACX,SAAS,EAAE,CAAC;IACZ,cAAc,EAAE,CAAC;CAClB,CAAC;AAEF,oBAAoB;AAEpB,MAAM,UAAU,sBAAsB,CAAC,EAAiB;IACtD,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;IAErB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC;;;;;;;;;;GAU9B,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;IAE5E,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,CACjC,8EAA8E,CAC/E,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAC7B,8DAA8D,CAC/D,CAAC;IAEF,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AAG,eAAe,CAAC,GAAG,EAAsB,CAAC;QACvD,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CACpC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAC9D,CAAC;IACJ,CAAC;IAED,SAAS,OAAO,CAAC,KAAK,GAAG,GAAG;QAC1B,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,CAAqB,CAAC;QACxD,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,MAAM;QACN,GAAG;QACH,OAAO;QACP,WAAW;QACX,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { VerboDatabase } from '../db/database.js';
2
+ export type LearningCategory = 'decision' | 'pattern' | 'pitfall' | 'convention';
3
+ export interface Learning {
4
+ id: string;
5
+ taskId: string | null;
6
+ category: LearningCategory;
7
+ content: string;
8
+ source: string | null;
9
+ embedding: Buffer | null;
10
+ createdAt: string;
11
+ }
12
+ export interface AddLearningInput {
13
+ taskId?: string;
14
+ category: LearningCategory;
15
+ content: string;
16
+ source?: string;
17
+ embedding?: Buffer;
18
+ }
19
+ export interface LearningFilter {
20
+ taskId?: string;
21
+ category?: LearningCategory;
22
+ }
23
+ export interface LearningStore {
24
+ add(input: AddLearningInput): Learning;
25
+ get(id: string): Learning | null;
26
+ list(filter?: LearningFilter): Learning[];
27
+ delete(id: string): void;
28
+ clear(): void;
29
+ getContextForAgent(query: string, limit?: number): Learning[];
30
+ }
31
+ export declare function createLearningStore(db: VerboDatabase): LearningStore;
32
+ //# sourceMappingURL=learning-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learning-store.d.ts","sourceRoot":"","sources":["../../../src/core/learning-store.ts"],"names":[],"mappings":"AACA,OAAO,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id';
2
+ // ---- Helper: row -> Learning ----
3
+ function rowToLearning(row) {
4
+ return {
5
+ id: row.id,
6
+ taskId: row.task_id,
7
+ category: row.category,
8
+ content: row.content,
9
+ source: row.source,
10
+ embedding: row.embedding,
11
+ createdAt: row.created_at,
12
+ };
13
+ }
14
+ // ---- Factory ----
15
+ export function createLearningStore(db) {
16
+ const raw = db.raw();
17
+ const stmtInsert = raw.prepare(`
18
+ INSERT INTO learnings (id, task_id, category, content, source, embedding, created_at)
19
+ VALUES (@id, @task_id, @category, @content, @source, @embedding, @created_at)
20
+ `);
21
+ const stmtGetById = raw.prepare('SELECT * FROM learnings WHERE id = ?');
22
+ const stmtDelete = raw.prepare('DELETE FROM learnings WHERE id = ?');
23
+ const stmtClear = raw.prepare('DELETE FROM learnings');
24
+ function add(input) {
25
+ const now = new Date().toISOString();
26
+ const id = ulid();
27
+ const row = {
28
+ id,
29
+ task_id: input.taskId ?? null,
30
+ category: input.category,
31
+ content: input.content,
32
+ source: input.source ?? null,
33
+ embedding: input.embedding ?? null,
34
+ created_at: now,
35
+ };
36
+ stmtInsert.run(row);
37
+ return get(id);
38
+ }
39
+ function get(id) {
40
+ const row = stmtGetById.get(id);
41
+ if (!row)
42
+ return null;
43
+ return rowToLearning(row);
44
+ }
45
+ function list(filter) {
46
+ const conditions = [];
47
+ const params = [];
48
+ if (filter?.taskId) {
49
+ conditions.push('task_id = ?');
50
+ params.push(filter.taskId);
51
+ }
52
+ if (filter?.category) {
53
+ conditions.push('category = ?');
54
+ params.push(filter.category);
55
+ }
56
+ const where = conditions.length > 0 ? `WHERE ${conditions.join(' AND ')}` : '';
57
+ const sql = `SELECT * FROM learnings ${where} ORDER BY created_at DESC`;
58
+ const stmt = raw.prepare(sql);
59
+ const rows = stmt.all(...params);
60
+ return rows.map(rowToLearning);
61
+ }
62
+ function deleteLearning(id) {
63
+ stmtDelete.run(id);
64
+ }
65
+ function clear() {
66
+ stmtClear.run();
67
+ }
68
+ function getContextForAgent(query, limit = 10) {
69
+ // Sanitise query: strip FTS5 special characters to avoid syntax errors
70
+ const sanitised = query.replace(/[.*()"^~:{}[\]]/g, ' ').trim();
71
+ if (!sanitised)
72
+ return [];
73
+ // Use FTS5 to find relevant learnings by full-text search
74
+ const sql = `
75
+ SELECT l.*
76
+ FROM learnings l
77
+ JOIN learnings_fts fts ON l.rowid = fts.rowid
78
+ WHERE learnings_fts MATCH ?
79
+ ORDER BY rank
80
+ LIMIT ?
81
+ `;
82
+ const stmt = raw.prepare(sql);
83
+ const rows = stmt.all(sanitised, limit);
84
+ return rows.map(rowToLearning);
85
+ }
86
+ return {
87
+ add,
88
+ get,
89
+ list,
90
+ delete: deleteLearning,
91
+ clear,
92
+ getContextForAgent,
93
+ };
94
+ }
95
+ //# sourceMappingURL=learning-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learning-store.js","sourceRoot":"","sources":["../../../src/core/learning-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAmD5B,oCAAoC;AAEpC,SAAS,aAAa,CAAC,GAAgB;IACrC,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,MAAM,EAAE,GAAG,CAAC,OAAO;QACnB,QAAQ,EAAE,GAAG,CAAC,QAA4B;QAC1C,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,SAAS,EAAE,GAAG,CAAC,UAAU;KAC1B,CAAC;AACJ,CAAC;AAED,oBAAoB;AAEpB,MAAM,UAAU,mBAAmB,CAAC,EAAiB;IACnD,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;IAErB,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC;;;GAG9B,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,sCAAsC,CAAC,CAAC;IAExE,MAAM,UAAU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-0,0 +1,28 @@
1
+ import type { HumanActionStore } from './human-action-store.js';
2
+ export interface MergeQueueItem {
3
+ taskId: string;
4
+ branch: string;
5
+ worktreePath: string;
6
+ prUrl: string;
7
+ enqueuedAt: string;
8
+ status: 'queued' | 'processing' | 'merged' | 'failed';
9
+ error?: string;
10
+ }
11
+ export interface MergeQueueOptions {
12
+ baseBranch: string;
13
+ humanActions: HumanActionStore;
14
+ onMerged?: (item: MergeQueueItem) => void;
15
+ onFailed?: (item: MergeQueueItem) => void;
16
+ onQueueChanged?: (queue: MergeQueueItem[]) => void;
17
+ exec?: (cmd: string, args: string[], opts?: {
18
+ cwd?: string;
19
+ }) => string;
20
+ mergeDelayMs?: number;
21
+ }
22
+ export interface MergeQueue {
23
+ enqueue(item: Omit<MergeQueueItem, 'enqueuedAt' | 'status'>): void;
24
+ getQueue(): MergeQueueItem[];
25
+ isProcessing(): boolean;
26
+ }
27
+ export declare function createMergeQueue(options: MergeQueueOptions): MergeQueue;
28
+ //# sourceMappingURL=merge-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-queue.d.ts","sourceRoot":"","sources":["../../../src/core/merge-queue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;IACnD,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;IACxE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;IACnE,QAAQ,IAAI,cAAc,EAAE,CAAC;IAC7B,YAAY,IAAI,OAAO,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,UAAU,CAqGvE"}
@@ -0,0 +1,92 @@
1
+ import { execFileSync } from 'child_process';
2
+ export function createMergeQueue(options) {
3
+ const { baseBranch, humanActions, onMerged, onFailed, onQueueChanged } = options;
4
+ const exec = options.exec ??
5
+ ((cmd, args, opts) => execFileSync(cmd, args, { cwd: opts?.cwd, encoding: 'utf-8', stdio: 'pipe' }));
6
+ const mergeDelayMs = options.mergeDelayMs ?? 3000;
7
+ const queue = [];
8
+ let processing = false;
9
+ function emit() {
10
+ onQueueChanged?.(queue.slice());
11
+ }
12
+ async function processNext() {
13
+ const item = queue.find((i) => i.status === 'queued');
14
+ if (!item) {
15
+ processing = false;
16
+ return;
17
+ }
18
+ processing = true;
19
+ item.status = 'processing';
20
+ emit();
21
+ try {
22
+ exec('git', ['fetch', 'origin', baseBranch], { cwd: item.worktreePath });
23
+ try {
24
+ exec('git', ['rebase', `origin/${baseBranch}`], { cwd: item.worktreePath });
25
+ }
26
+ catch {
27
+ try {
28
+ exec('git', ['rebase', '--abort'], { cwd: item.worktreePath });
29
+ }
30
+ catch {
31
+ /* abort may fail if rebase already cleaned up */
32
+ }
33
+ item.status = 'failed';
34
+ item.error = 'Rebase conflict — manual resolution required';
35
+ humanActions.create({
36
+ taskId: item.taskId,
37
+ description: `Merge conflict: rebase of ${item.prUrl} onto ${baseBranch} failed. Resolve manually.`,
38
+ context: item.prUrl,
39
+ urgency: 'blocking',
40
+ });
41
+ onFailed?.(item);
42
+ emit();
43
+ await processNext();
44
+ return;
45
+ }
46
+ exec('git', ['push', '--force-with-lease', 'origin', item.branch], { cwd: item.worktreePath });
47
+ if (mergeDelayMs > 0) {
48
+ await new Promise((r) => setTimeout(r, mergeDelayMs));
49
+ }
50
+ exec('gh', ['pr', 'merge', '--squash'], { cwd: item.worktreePath });
51
+ item.status = 'merged';
52
+ onMerged?.(item);
53
+ emit();
54
+ }
55
+ catch (err) {
56
+ item.status = 'failed';
57
+ item.error = err.message;
58
+ humanActions.create({
59
+ taskId: item.taskId,
60
+ description: `Auto-merge failed for PR: ${item.prUrl}. Error: ${item.error}`,
61
+ context: item.prUrl,
62
+ urgency: 'blocking',
63
+ });
64
+ onFailed?.(item);
65
+ emit();
66
+ }
67
+ if (mergeDelayMs > 0) {
68
+ await new Promise((r) => setTimeout(r, mergeDelayMs));
69
+ }
70
+ await processNext();
71
+ }
72
+ return {
73
+ enqueue(input) {
74
+ queue.push({
75
+ ...input,
76
+ enqueuedAt: new Date().toISOString(),
77
+ status: 'queued',
78
+ });
79
+ emit();
80
+ if (!processing) {
81
+ processNext();
82
+ }
83
+ },
84
+ getQueue() {
85
+ return queue.slice();
86
+ },
87
+ isProcessing() {
88
+ return processing;
89
+ },
90
+ };
91
+ }
92
+ //# sourceMappingURL=merge-queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-queue.js","sourceRoot":"","sources":["../../../src/core/merge-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA6B7C,MAAM,UAAU,g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