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,676 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useCallback, useEffect, useRef } from 'react';
3
+ import { execFile } from 'child_process';
4
+ import { Box, Text, useInput } from 'ink';
5
+ import { useStore } from './hooks/use-store.js';
6
+ import { useBell } from './hooks/use-bell.js';
7
+ import { useKeyboard } from './hooks/use-keyboard.js';
8
+ import { useSpinner } from './hooks/use-spinner.js';
9
+ import { RichHeader } from './components/rich-header.js';
10
+ import { StatusBar } from './components/status-bar.js';
11
+ import { AgentList } from './components/agent-list.js';
12
+ import { ApprovalTerminal } from './components/approval-terminal.js';
13
+ import { TaskQueue } from './components/task-queue.js';
14
+ import { Footer } from './components/footer.js';
15
+ import { NewTaskInput } from './components/new-task-input.js';
16
+ import { ReviewQueue, getReviewTasks } from './components/review-queue.js';
17
+ import { ActivityFeed } from './components/activity-feed.js';
18
+ import { HumanActions } from './components/human-actions.js';
19
+ import { DecompositionReview } from './components/decomposition-review.js';
20
+ import { DiffViewer } from './components/diff-viewer.js';
21
+ import { useDiffView } from './hooks/use-diff-view.js';
22
+ import { MemoryViewer } from './components/memory-viewer.js';
23
+ import { AuditViewer } from './components/audit-viewer.js';
24
+ import { CommandPalette } from './components/command-palette.js';
25
+ import { DependencyGraph } from './components/dependency-graph.js';
26
+ import { buildPaletteCommands } from './lib/palette-commands.js';
27
+ import { LogPanel } from './components/log-panel.js';
28
+ import { hasFileOverlap } from '../core/parallelizer.js';
29
+ import { countPrsToday } from '../core/orchestrator-store.js';
30
+ export function App({ getState, teamName, onCreateTask, onLaunchAgent, onLaunchBatch, onKillAgent, onDismiss, onApproveRequest, onDenyRequest, onToggleYolo, onToggleFactory, onResolveHumanAction, onDeleteTask, onDecomposeTask, onConfirmDecompose, onForcePush, getLogLines, getLearnings, getAuditEntries, getTaskTitleById, flashMessage, getDependencyGraph, }) {
31
+ const state = useStore(getState);
32
+ useBell(state);
33
+ const spinnerFrame = useSpinner();
34
+ const [rows, setRows] = useState(process.stdout.rows ?? 24);
35
+ const [cols, setCols] = useState(process.stdout.columns ?? 80);
36
+ const [showNewTask, setShowNewTask] = useState(false);
37
+ const [activeArea, setActiveArea] = useState('tasks');
38
+ const [selectedIndex, setSelectedIndex] = useState(0);
39
+ const [taskIndex, setTaskIndex] = useState(0);
40
+ const [approvalIndex, setApprovalIndex] = useState(0);
41
+ const [showReview, setShowReview] = useState(false);
42
+ const [reviewIndex, setReviewIndex] = useState(0);
43
+ const [showFeed, setShowFeed] = useState(true);
44
+ const [feedOffset, setFeedOffset] = useState(0);
45
+ const [actionIndex, setActionIndex] = useState(0);
46
+ const [trustLevel, setTrustLevel] = useState('medium');
47
+ const [skipFeedback, setSkipFeedback] = useState(null);
48
+ const skipTimerRef = useRef(null);
49
+ const [decomposeState, setDecomposeState] = useState('idle');
50
+ const [decomposeSubtasks, setDecomposeSubtasks] = useState([]);
51
+ const [decomposeTaskId, setDecomposeTaskId] = useState(null);
52
+ const [showLog, setShowLog] = useState(false);
53
+ const [showHelp, setShowHelp] = useState(false);
54
+ const [showMemory, setShowMemory] = useState(false);
55
+ const [showDiff, setShowDiff] = useState(false);
56
+ const [diffWorktreePath, setDiffWorktreePath] = useState(null);
57
+ const [diffBranch, setDiffBranch] = useState(null);
58
+ const [showPalette, setShowPalette] = useState(false);
59
+ const [showAudit, setShowAudit] = useState(false);
60
+ const [auditFilter, setAuditFilter] = useState('');
61
+ const [auditScroll, setAuditScroll] = useState(0);
62
+ const [auditFilterMode, setAuditFilterMode] = useState(false);
63
+ const [showGraph, setShowGraph] = useState(false);
64
+ const [graphFocusedId, setGraphFocusedId] = useState(null);
65
+ // Fetch diff for selected agent (only when diff panel is open)
66
+ const diffView = useDiffView(showDiff ? diffWorktreePath : null, showDiff ? diffBranch : null);
67
+ // Track terminal resize to keep layout within viewport
68
+ useEffect(() => {
69
+ const onResize = () => {
70
+ setRows(process.stdout.rows ?? 24);
71
+ setCols(process.stdout.columns ?? 80);
72
+ };
73
+ process.stdout.on('resize', onResize);
74
+ return () => { process.stdout.off('resize', onResize); };
75
+ }, []);
76
+ const showSkipFeedback = useCallback((message) => {
77
+ if (skipTimerRef.current)
78
+ clearTimeout(skipTimerRef.current);
79
+ setSkipFeedback(message);
80
+ skipTimerRef.current = setTimeout(() => setSkipFeedback(null), 4000);
81
+ }, []);
82
+ // Cleanup timer on unmount
83
+ useEffect(() => {
84
+ return () => {
85
+ if (skipTimerRef.current)
86
+ clearTimeout(skipTimerRef.current);
87
+ };
88
+ }, []);
89
+ const cycleTrustLevel = () => {
90
+ setTrustLevel((prev) => {
91
+ if (prev === 'low')
92
+ return 'medium';
93
+ if (prev === 'medium')
94
+ return 'high';
95
+ return 'low';
96
+ });
97
+ };
98
+ useKeyboard((action) => {
99
+ // When graph is open, component handles its own navigation
100
+ if (showGraph) {
101
+ if (action === 'dismiss')
102
+ setShowGraph(false);
103
+ return;
104
+ }
105
+ // When palette is open, block all other actions (component handles its own navigation)
106
+ if (showPalette) {
107
+ if (action === 'dismiss')
108
+ setShowPalette(false);
109
+ return;
110
+ }
111
+ // When audit viewer is open, handle its own navigation
112
+ if (showAudit && !auditFilterMode) {
113
+ if (action === 'dismiss') {
114
+ setShowAudit(false);
115
+ setAuditFilter('');
116
+ setAuditScroll(0);
117
+ }
118
+ else if (action === 'nav-down') {
119
+ setAuditScroll((prev) => prev + 1);
120
+ }
121
+ else if (action === 'nav-up') {
122
+ setAuditScroll((prev) => Math.max(0, prev - 1));
123
+ }
124
+ // '/' to enter filter mode is handled by the separate useInput below
125
+ return;
126
+ }
127
+ // When decompose review is visible, only handle dismiss
128
+ if (decomposeState === 'review' || decomposeState === 'loading') {
129
+ return;
130
+ }
131
+ // When log panel is open, only handle dismiss (LogPanel has its own useInput for j/k/o/space)
132
+ if (showLog) {
133
+ if (action === 'dismiss') {
134
+ setShowLog(false);
135
+ }
136
+ return;
137
+ }
138
+ // When diff viewer is open, route navigation to it
139
+ if (showDiff) {
140
+ if (action === 'dismiss' || action === 'diff') {
141
+ setShowDiff(false);
142
+ }
143
+ else if (action === 'feed-scroll-down') {
144
+ diffView.nextFile();
145
+ }
146
+ else if (action === 'feed-scroll-up') {
147
+ diffView.prevFile();
148
+ }
149
+ else if (action === 'new-task') {
150
+ diffView.nextHunk();
151
+ }
152
+ else if (action === 'hunk-prev') {
153
+ diffView.prevHunk();
154
+ }
155
+ return;
156
+ }
157
+ // When new-task input is visible, only handle dismiss
158
+ if (showNewTask) {
159
+ if (action === 'dismiss') {
160
+ setShowNewTask(false);
161
+ }
162
+ return;
163
+ }
164
+ switch (action) {
165
+ case 'approve-once': {
166
+ const req = state.pendingApprovals[approvalIndex];
167
+ if (req) {
168
+ onApproveRequest(req.id);
169
+ // Advance to next request or reset
170
+ if (approvalIndex >= state.pendingApprovals.length - 1) {
171
+ setApprovalIndex(0);
172
+ }
173
+ }
174
+ break;
175
+ }
176
+ case 'approve-session': {
177
+ // For now, same as approve-once (session-level approval is future work)
178
+ const req = state.pendingApprovals[approvalIndex];
179
+ if (req) {
180
+ onApproveRequest(req.id);
181
+ if (approvalIndex >= state.pendingApprovals.length - 1) {
182
+ setApprovalIndex(0);
183
+ }
184
+ }
185
+ break;
186
+ }
187
+ case 'deny': {
188
+ const req = state.pendingApprovals[approvalIndex];
189
+ if (req) {
190
+ onDenyRequest(req.id);
191
+ if (approvalIndex >= state.pendingApprovals.length - 1) {
192
+ setApprovalIndex(0);
193
+ }
194
+ }
195
+ break;
196
+ }
197
+ case 'yolo-toggle':
198
+ onToggleYolo();
199
+ break;
200
+ case 'factory-toggle':
201
+ onToggleFactory();
202
+ break;
203
+ case 'new-task':
204
+ setShowNewTask(true);
205
+ break;
206
+ case 'toggle-review':
207
+ setShowReview((prev) => !prev);
208
+ break;
209
+ case 'open-pr': {
210
+ const reviewTasks = getReviewTasks(state.tasks);
211
+ const target = reviewTasks[reviewIndex];
212
+ if (target?.prUrl) {
213
+ const cmd = process.platform === 'win32' ? 'cmd' : process.platform === 'darwin' ? 'open' : 'xdg-open';
214
+ const args = process.platform === 'win32' ? ['/c', 'start', '', target.prUrl] : [target.prUrl];
215
+ execFile(cmd, args, { timeout: 5_000 }, () => { });
216
+ }
217
+ break;
218
+ }
219
+ case 'review-up': {
220
+ setReviewIndex((i) => Math.max(i - 1, 0));
221
+ break;
222
+ }
223
+ case 'review-down': {
224
+ const reviewTasks = getReviewTasks(state.tasks);
225
+ setReviewIndex((i) => Math.min(i + 1, Math.max(0, reviewTasks.length - 1)));
226
+ break;
227
+ }
228
+ case 'toggle-feed':
229
+ setShowFeed((prev) => !prev);
230
+ break;
231
+ case 'feed-scroll-down':
232
+ setFeedOffset((prev) => prev + 1);
233
+ break;
234
+ case 'feed-scroll-up':
235
+ setFeedOffset((prev) => Math.max(0, prev - 1));
236
+ break;
237
+ case 'focus-agents':
238
+ setActiveArea('agents');
239
+ break;
240
+ case 'focus-tasks':
241
+ setActiveArea('tasks');
242
+ break;
243
+ case 'focus-your-turn':
244
+ setActiveArea('your-turn');
245
+ break;
246
+ case 'focus-activity':
247
+ setActiveArea('activity');
248
+ break;
249
+ case 'nav-up': {
250
+ switch (activeArea) {
251
+ case 'agents':
252
+ setSelectedIndex((i) => Math.max(i - 1, 0));
253
+ break;
254
+ case 'tasks':
255
+ setTaskIndex((i) => Math.max(i - 1, 0));
256
+ break;
257
+ case 'your-turn':
258
+ setActionIndex((i) => Math.max(i - 1, 0));
259
+ break;
260
+ case 'activity':
261
+ setFeedOffset((prev) => Math.max(0, prev - 1));
262
+ break;
263
+ }
264
+ break;
265
+ }
266
+ case 'nav-down': {
267
+ switch (activeArea) {
268
+ case 'agents':
269
+ setSelectedIndex((i) => Math.min(i + 1, Math.max(0, state.activeSessions.length - 1)));
270
+ break;
271
+ case 'tasks': {
272
+ const todoTasks = state.tasks.filter((t) => (t.status === 'todo' || t.status === 'blocked') && !t.title.startsWith('HUMANO:'));
273
+ setTaskIndex((i) => Math.min(i + 1, Math.max(0, todoTasks.length - 1)));
274
+ break;
275
+ }
276
+ case 'your-turn':
277
+ setActionIndex((i) => Math.min(i + 1, Math.max(0, state.humanActions.length - 1)));
278
+ break;
279
+ case 'activity':
280
+ setFeedOffset((prev) => prev + 1);
281
+ break;
282
+ }
283
+ break;
284
+ }
285
+ case 'cycle-trust':
286
+ cycleTrustLevel();
287
+ break;
288
+ case 'parallelize':
289
+ if (state.parallelBatch.length > 0) {
290
+ onLaunchBatch(state.parallelBatch.map((t) => t.id), trustLevel);
291
+ }
292
+ break;
293
+ case 'launch': {
294
+ const todoTasks = state.tasks.filter((t) => t.status === 'todo' && !t.title.startsWith('HUMANO:'));
295
+ if (todoTasks.length === 0)
296
+ break;
297
+ const activeTasks = state.tasks.filter((t) => t.status === 'in_progress');
298
+ const activeFiles = activeTasks.flatMap((t) => t.filePaths);
299
+ const startIdx = Math.min(taskIndex, todoTasks.length - 1);
300
+ // Find the first non-conflicting task starting from selected index
301
+ const skippedMessages = [];
302
+ let launched = false;
303
+ for (let offset = 0; offset < todoTasks.length; offset++) {
304
+ const idx = (startIdx + offset) % todoTasks.length;
305
+ const candidate = todoTasks[idx];
306
+ // Check for file conflict with active tasks
307
+ if (activeFiles.length > 0 && candidate.filePaths.length > 0) {
308
+ let conflictFile = null;
309
+ let conflictTask = null;
310
+ for (const active of activeTasks) {
311
+ if (hasFileOverlap(candidate.filePaths, active.filePaths)) {
312
+ // Find the specific conflicting file for the message
313
+ for (const cf of candidate.filePaths) {
314
+ for (const af of active.filePaths) {
315
+ if (cf === af || hasFileOverlap([cf], [af])) {
316
+ conflictFile = cf;
317
+ conflictTask = active;
318
+ break;
319
+ }
320
+ }
321
+ if (conflictFile)
322
+ break;
323
+ }
324
+ break;
325
+ }
326
+ }
327
+ if (conflictFile && conflictTask) {
328
+ skippedMessages.push(`Skipped "${candidate.title}" — conflicts with "${conflictTask.title}" on ${conflictFile}`);
329
+ continue;
330
+ }
331
+ }
332
+ // No conflict — launch this task
333
+ onLaunchAgent(candidate.id, trustLevel);
334
+ setTaskIndex(0);
335
+ launched = true;
336
+ if (skippedMessages.length > 0) {
337
+ showSkipFeedback(skippedMessages.join('\n'));
338
+ }
339
+ break;
340
+ }
341
+ if (!launched) {
342
+ showSkipFeedback(`All ${todoTasks.length} todo tasks conflict with running agents`);
343
+ }
344
+ break;
345
+ }
346
+ case 'resolve-action': {
347
+ const action = state.humanActions[actionIndex];
348
+ if (action) {
349
+ onResolveHumanAction(action.id);
350
+ if (actionIndex >= state.humanActions.length - 1) {
351
+ setActionIndex(Math.max(0, state.humanActions.length - 2));
352
+ }
353
+ }
354
+ break;
355
+ }
356
+ case 'open-action-pr': {
357
+ const action = state.humanActions[actionIndex];
358
+ if (action?.actionType === 'merge-review' && action.prUrl) {
359
+ const cmd = process.platform === 'win32' ? 'cmd' : process.platform === 'darwin' ? 'open' : 'xdg-open';
360
+ const args = process.platform === 'win32' ? ['/c', 'start', '', action.prUrl] : [action.prUrl];
361
+ execFile(cmd, args, { timeout: 5_000 }, () => { });
362
+ }
363
+ break;
364
+ }
365
+ case 'action-up':
366
+ setActionIndex((i) => Math.max(i - 1, 0));
367
+ break;
368
+ case 'action-down':
369
+ setActionIndex((i) => Math.min(i + 1, Math.max(0, state.humanActions.length - 1)));
370
+ break;
371
+ case 'diff': {
372
+ if (state.activeSessions.length > 0) {
373
+ // Open diff for the selected active agent
374
+ const clampedIdx = Math.min(selectedIndex, state.activeSessions.length - 1);
375
+ const session = state.activeSessions[clampedIdx];
376
+ if (session?.worktreePath && session.worktreeBranch) {
377
+ setDiffWorktreePath(session.worktreePath);
378
+ setDiffBranch(session.worktreeBranch);
379
+ setShowDiff(true);
380
+ }
381
+ else {
382
+ showSkipFeedback('Agent has no worktree yet — wait for it to start');
383
+ }
384
+ }
385
+ else {
386
+ // No agents running: fall back to decompose
387
+ const todoTasks = state.tasks.filter((t) => (t.status === 'todo' || t.status === 'blocked') && !t.title.startsWith('HUMANO:'));
388
+ const target = todoTasks[taskIndex] ?? todoTasks[0];
389
+ if (!target)
390
+ break;
391
+ setDecomposeTaskId(target.id);
392
+ setDecomposeState('loading');
393
+ onDecomposeTask(target.id).then((subtasks) => {
394
+ if (subtasks && subtasks.length > 0) {
395
+ setDecomposeSubtasks(subtasks);
396
+ setDecomposeState('review');
397
+ }
398
+ else {
399
+ setDecomposeState('idle');
400
+ showSkipFeedback('No decomposition available (need ANTHROPIC_API_KEY and ≥50-word description)');
401
+ }
402
+ }).catch(() => {
403
+ setDecomposeState('idle');
404
+ showSkipFeedback('Decomposition failed');
405
+ });
406
+ }
407
+ break;
408
+ }
409
+ case 'hunk-prev':
410
+ // Only active inside the diff modal (handled above); ignore outside
411
+ break;
412
+ case 'kill': {
413
+ switch (activeArea) {
414
+ case 'agents': {
415
+ const session = state.activeSessions[selectedIndex];
416
+ if (session)
417
+ onKillAgent(session.id);
418
+ break;
419
+ }
420
+ case 'tasks': {
421
+ const todoTasks = state.tasks.filter((t) => (t.status === 'todo' || t.status === 'blocked') && !t.title.startsWith('HUMANO:'));
422
+ const target = todoTasks[taskIndex];
423
+ if (target) {
424
+ if (target.status === 'todo' || target.status === 'blocked') {
425
+ onDeleteTask(target.id);
426
+ setTaskIndex((i) => Math.max(0, i - 1));
427
+ }
428
+ else if (target.status === 'in_progress' && target.agentSessionId) {
429
+ onKillAgent(target.agentSessionId);
430
+ }
431
+ }
432
+ break;
433
+ }
434
+ case 'your-turn': {
435
+ const action = state.humanActions[actionIndex];
436
+ if (action) {
437
+ onResolveHumanAction(action.id);
438
+ if (actionIndex >= state.humanActions.length - 1) {
439
+ setActionIndex(Math.max(0, state.humanActions.length - 2));
440
+ }
441
+ }
442
+ break;
443
+ }
444
+ case 'activity':
445
+ // no-op
446
+ break;
447
+ }
448
+ break;
449
+ }
450
+ case 'delete-task': {
451
+ switch (activeArea) {
452
+ case 'agents': {
453
+ const session = state.activeSessions[selectedIndex];
454
+ if (session)
455
+ onKillAgent(session.id);
456
+ break;
457
+ }
458
+ case 'tasks': {
459
+ const todoTasks = state.tasks.filter((t) => (t.status === 'todo' || t.status === 'blocked') && !t.title.startsWith('HUMANO:'));
460
+ const target = todoTasks[taskIndex];
461
+ if (target) {
462
+ onDeleteTask(target.id);
463
+ setTaskIndex((i) => Math.max(0, i - 1));
464
+ }
465
+ break;
466
+ }
467
+ case 'your-turn': {
468
+ const action = state.humanActions[actionIndex];
469
+ if (action) {
470
+ onResolveHumanAction(action.id);
471
+ if (actionIndex >= state.humanActions.length - 1) {
472
+ setActionIndex(Math.max(0, state.humanActions.length - 2));
473
+ }
474
+ }
475
+ break;
476
+ }
477
+ case 'activity':
478
+ // no-op
479
+ break;
480
+ }
481
+ break;
482
+ }
483
+ case 'open-log':
484
+ setShowLog((prev) => !prev);
485
+ break;
486
+ case 'help':
487
+ setShowHelp((prev) => !prev);
488
+ break;
489
+ case 'memory':
490
+ if (getLearnings)
491
+ setShowMemory((prev) => !prev);
492
+ break;
493
+ case 'audit':
494
+ if (getAuditEntries) {
495
+ setShowAudit((prev) => {
496
+ if (prev) {
497
+ setAuditFilter('');
498
+ setAuditScroll(0);
499
+ }
500
+ return !prev;
501
+ });
502
+ }
503
+ break;
504
+ case 'graph':
505
+ if (getDependencyGraph) {
506
+ setShowGraph((prev) => {
507
+ if (!prev) {
508
+ // When opening, focus the first task
509
+ const g = getDependencyGraph();
510
+ setGraphFocusedId(g.roots[0] ?? null);
511
+ }
512
+ return !prev;
513
+ });
514
+ }
515
+ break;
516
+ case 'palette':
517
+ setShowPalette(true);
518
+ break;
519
+ case 'dismiss':
520
+ // Palette, log, diff, new-task and decompose are handled by early returns above.
521
+ // This branch handles: help > memory > fallback dismiss.
522
+ if (showHelp) {
523
+ setShowHelp(false);
524
+ }
525
+ else if (showMemory) {
526
+ setShowMemory(false);
527
+ }
528
+ else {
529
+ onDismiss();
530
+ }
531
+ break;
532
+ default:
533
+ break;
534
+ }
535
+ });
536
+ // Audit viewer: '/' to enter filter mode, type to filter, escape/return to exit filter mode
537
+ useInput((input, key) => {
538
+ if (!showAudit)
539
+ return;
540
+ if (auditFilterMode) {
541
+ if (key.escape || key.return) {
542
+ setAuditFilterMode(false);
543
+ }
544
+ else if (key.backspace || key.delete) {
545
+ setAuditFilter((prev) => prev.slice(0, -1));
546
+ setAuditScroll(0);
547
+ }
548
+ else if (input && !key.ctrl && !key.meta) {
549
+ setAuditFilter((prev) => prev + input);
550
+ setAuditScroll(0);
551
+ }
552
+ }
553
+ else if (input === '/') {
554
+ setAuditFilterMode(true);
555
+ }
556
+ }, { isActive: showAudit });
557
+ const paletteCommands = buildPaletteCommands({
558
+ hasLogLines: !!getLogLines,
559
+ hasLearnings: !!getLearnings,
560
+ });
561
+ const onPaletteExecute = (action) => {
562
+ switch (action) {
563
+ case 'new-task':
564
+ setShowNewTask(true);
565
+ break;
566
+ case 'launch': {
567
+ const todoTasks = state.tasks.filter((t) => t.status === 'todo' && !t.title.startsWith('HUMANO:'));
568
+ if (todoTasks.length === 0)
569
+ break;
570
+ const target = todoTasks[Math.min(taskIndex, todoTasks.length - 1)];
571
+ if (target)
572
+ onLaunchAgent(target.id, trustLevel);
573
+ break;
574
+ }
575
+ case 'kill': {
576
+ const session = state.activeSessions[selectedIndex];
577
+ if (session)
578
+ onKillAgent(session.id);
579
+ break;
580
+ }
581
+ case 'parallelize':
582
+ if (state.parallelBatch.length > 0) {
583
+ onLaunchBatch(state.parallelBatch.map((t) => t.id), trustLevel);
584
+ }
585
+ break;
586
+ case 'toggle-review':
587
+ setShowReview((p) => !p);
588
+ break;
589
+ case 'toggle-feed':
590
+ setShowFeed((p) => !p);
591
+ break;
592
+ case 'yolo-toggle':
593
+ onToggleYolo();
594
+ break;
595
+ case 'factory-toggle':
596
+ onToggleFactory();
597
+ break;
598
+ case 'cycle-trust':
599
+ cycleTrustLevel();
600
+ break;
601
+ case 'diff': {
602
+ if (state.activeSessions.length > 0) {
603
+ const clampedIdx = Math.min(selectedIndex, state.activeSessions.length - 1);
604
+ const session = state.activeSessions[clampedIdx];
605
+ if (session?.worktreePath && session.worktreeBranch) {
606
+ setDiffWorktreePath(session.worktreePath);
607
+ setDiffBranch(session.worktreeBranch);
608
+ setShowDiff(true);
609
+ }
610
+ else {
611
+ showSkipFeedback('Agent has no worktree yet — wait for it to start');
612
+ }
613
+ }
614
+ break;
615
+ }
616
+ case 'help':
617
+ setShowHelp((p) => !p);
618
+ break;
619
+ case 'open-log':
620
+ setShowLog((p) => !p);
621
+ break;
622
+ case 'memory':
623
+ if (getLearnings)
624
+ setShowMemory((p) => !p);
625
+ break;
626
+ case 'graph': {
627
+ if (getDependencyGraph) {
628
+ const g = getDependencyGraph();
629
+ setGraphFocusedId(g.roots[0] ?? null);
630
+ setShowGraph((p) => !p);
631
+ }
632
+ break;
633
+ }
634
+ default: break;
635
+ }
636
+ };
637
+ const agentsRunning = state.activeSessions.length;
638
+ const warnings = state.conflicts.length;
639
+ const taskCount = state.tasks.length;
640
+ const blocked = state.tasks.filter((t) => t.status === 'blocked').length;
641
+ const orchestratorReviewing = state.orchestratorStates.filter((s) => s.pushStatus === 'pending').length;
642
+ const orchestratorBlocked = state.orchestratorStates.filter((s) => s.pushStatus === 'blocked').length;
643
+ const prsToday = countPrsToday(state.orchestratorStates);
644
+ return (_jsxs(Box, { flexDirection: "column", height: rows, overflow: "hidden", borderStyle: "round", borderColor: "gray", children: [_jsx(RichHeader, { teamName: teamName, syncStatus: state.syncStatus, cols: cols, spinnerFrame: spinnerFrame }), _jsx(Box, { borderStyle: "single", borderColor: "gray", borderTop: false, borderLeft: false, borderRight: false }), _jsx(StatusBar, { agentsRunning: agentsRunning, warnings: warnings, tasks: taskCount, blocked: blocked, humanActions: state.humanActions.length, factoryMode: state.factoryMode, yoloMode: state.yoloMode, orchestratorReviewing: orchestratorReviewing, orchestratorBlocked: orchestratorBlocked, prsToday: prsToday, cols: cols, flashMessage: flashMessage, isCompliance: state.isCompliance, mergeQueuePending: state.mergeQueueItems?.filter((i) => i.status === 'queued' || i.status === 'processing').length ?? 0, mergeQueueProcessing: state.mergeQueueProcessing ?? false }), _jsx(Box, { borderStyle: "single", borderColor: "gray", borderTop: false, borderLeft: false, borderRight: false }), _jsxs(Box, { flexDirection: "row", flexGrow: 1, overflow: "hidden", children: [_jsx(Box, { flexDirection: "column", width: "50%", overflow: "hidden", children: showReview ? (_jsx(Box, { flexGrow: 1, overflow: "hidden", children: _jsx(ReviewQueue, { tasks: state.tasks, selectedIndex: reviewIndex, orchestratorStates: state.orchestratorStates, onForcePush: onForcePush }) })) : (_jsxs(_Fragment, { children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, flexBasis: 0, overflow: "hidden", children: _jsx(TaskQueue, { tasks: state.tasks, cols: cols, isActive: activeArea === 'tasks', selectedIndex: taskIndex }) }), _jsx(Box, { flexGrow: 1, flexShrink: 1, flexBasis: 0, overflow: "hidden", borderStyle: "single", borderColor: "magenta", borderLeft: false, borderRight: false, borderBottom: false, children: _jsx(HumanActions, { actions: state.humanActions, humanTasks: state.tasks.filter((t) => t.title.startsWith('HUMANO:') && t.status !== 'done'), selectedIndex: actionIndex, isActive: activeArea === 'your-turn' }) })] })) }), _jsxs(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", borderStyle: "single", borderTop: false, borderRight: false, borderBottom: false, borderColor: "gray", children: [_jsx(Box, { flexGrow: 1, overflow: "hidden", flexDirection: "column", children: _jsx(AgentList, { sessions: state.activeSessions, tasks: state.tasks, conflicts: state.conflicts, selectedIndex: selectedIndex, activeArea: activeArea }) }), state.teamMembers.length > 0 && (_jsx(Box, { paddingX: 1, flexShrink: 0, children: _jsx(Text, { color: "gray", dimColor: true, children: 'team: ' + state.teamMembers.map((m) => {
645
+ const count = m.sessions.length;
646
+ return count > 0 ? `${m.humanId}(${count})` : m.humanId;
647
+ }).join(' · ') }) }))] })] }), showLog && getLogLines && (_jsx(LogPanel, { getLines: getLogLines, onClose: () => setShowLog(false) })), showNewTask && (_jsx(Box, { borderStyle: "single", borderColor: "green", borderLeft: false, borderRight: false, borderBottom: false, children: _jsx(NewTaskInput, { visible: showNewTask, onSubmit: (title) => {
648
+ onCreateTask(title);
649
+ setShowNewTask(false);
650
+ }, onDismiss: () => setShowNewTask(false) }) })), decomposeState === 'loading' && (_jsx(Box, { borderStyle: "single", borderColor: "cyan", borderLeft: false, borderRight: false, borderBottom: false, paddingX: 1, children: _jsxs(Text, { color: "cyan", children: [spinnerFrame, " Decomposing task with Claude\u2026"] }) })), decomposeState === 'review' && decomposeSubtasks.length > 0 && (_jsx(Box, { borderStyle: "single", borderColor: "cyan", borderLeft: false, borderRight: false, borderBottom: false, children: _jsx(DecompositionReview, { subtasks: decomposeSubtasks, onConfirm: () => {
651
+ if (decomposeTaskId) {
652
+ onConfirmDecompose(decomposeSubtasks, decomposeTaskId);
653
+ }
654
+ setDecomposeState('idle');
655
+ setDecomposeSubtasks([]);
656
+ setDecomposeTaskId(null);
657
+ }, onCancel: () => {
658
+ setDecomposeState('idle');
659
+ setDecomposeSubtasks([]);
660
+ setDecomposeTaskId(null);
661
+ } }) })), showDiff && (_jsx(Box, { borderStyle: "single", borderColor: "blue", borderLeft: false, borderRight: false, borderBottom: false, flexShrink: 0, children: _jsx(DiffViewer, { diffView: diffView, cols: cols, maxLines: 18 }) })), showMemory && getLearnings && (_jsx(MemoryViewer, { learnings: getLearnings(), taskTitleById: getTaskTitleById, onClose: () => setShowMemory(false) })), showAudit && getAuditEntries && (_jsx(AuditViewer, { entries: getAuditEntries(), filterText: auditFilter, scrollOffset: auditScroll, onClose: () => {
662
+ setShowAudit(false);
663
+ setAuditFilter('');
664
+ setAuditScroll(0);
665
+ } })), showGraph && getDependencyGraph && (_jsx(Box, { borderStyle: "single", borderColor: "blue", borderLeft: false, borderRight: false, borderBottom: false, flexShrink: 0, children: _jsx(DependencyGraph, { tasks: state.tasks, graph: getDependencyGraph(), focusedId: graphFocusedId, onFocus: setGraphFocusedId, onSelect: (taskId) => {
666
+ setShowGraph(false);
667
+ // Focus the task in the task queue
668
+ const todoTasks = state.tasks.filter((t) => (t.status === 'todo' || t.status === 'blocked') && !t.title.startsWith('HUMANO:'));
669
+ const idx = todoTasks.findIndex((t) => t.id === taskId);
670
+ if (idx >= 0) {
671
+ setTaskIndex(idx);
672
+ setActiveArea('tasks');
673
+ }
674
+ }, onExit: () => setShowGraph(false) }) })), _jsx(CommandPalette, { visible: showPalette, commands: paletteCommands, onExecute: onPaletteExecute, onDismiss: () => setShowPalette(false) }), _jsx(Box, { flexShrink: 0, children: _jsx(ApprovalTerminal, { requests: state.pendingApprovals, selectedIndex: approvalIndex, yoloMode: state.yoloMode, cols: cols }) }), showFeed && (_jsx(Box, { flexShrink: 1, overflow: "hidden", borderStyle: "single", borderColor: "gray", borderLeft: false, borderRight: false, borderBottom: false, children: _jsx(ActivityFeed, { tasks: state.tasks, resolvedApprovals: state.resolvedApprovals, scrollOffset: feedOffset, isActive: activeArea === 'activity' }) })), skipFeedback && (_jsx(Box, { flexShrink: 0, paddingX: 1, children: _jsxs(Text, { color: "yellow", children: ["\u26A0 ", skipFeedback] }) })), _jsx(Box, { flexShrink: 0, children: _jsx(Footer, { trustLevel: trustLevel, factoryMode: state.factoryMode, yoloMode: state.yoloMode, showHelp: showHelp, sandboxEnabled: state.sandboxEnabled }) })] }));
675
+ }
676
+ //# sourceMappingURL=app.js.map