lastlight 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (478) hide show
  1. package/README.md +265 -118
  2. package/agent-context/rules.md +62 -9
  3. package/agent-context/security.md +69 -0
  4. package/config/default.yaml +89 -0
  5. package/deploy/.env.production.example +20 -2
  6. package/deploy/entrypoint.sh +16 -17
  7. package/deploy/native/README.md +160 -0
  8. package/deploy/native/install.sh +110 -0
  9. package/deploy/native/lastlight.env.example +95 -0
  10. package/deploy/native/lastlight.service +50 -0
  11. package/deploy/sandbox-entrypoint.sh +59 -42
  12. package/dist/admin/auth.d.ts +1 -1
  13. package/dist/admin/auth.js +3 -1
  14. package/dist/admin/auth.js.map +1 -1
  15. package/dist/admin/chat-session-reader.d.ts +11 -14
  16. package/dist/admin/chat-session-reader.js +27 -51
  17. package/dist/admin/chat-session-reader.js.map +1 -1
  18. package/dist/admin/docker.d.ts +37 -0
  19. package/dist/admin/docker.js +86 -1
  20. package/dist/admin/docker.js.map +1 -1
  21. package/dist/admin/index.js +38 -3
  22. package/dist/admin/index.js.map +1 -1
  23. package/dist/admin/log-search.test.d.ts +1 -0
  24. package/dist/admin/log-search.test.js +78 -0
  25. package/dist/admin/log-search.test.js.map +1 -0
  26. package/dist/admin/routes.d.ts +52 -3
  27. package/dist/admin/routes.js +780 -63
  28. package/dist/admin/routes.js.map +1 -1
  29. package/dist/admin/routes.test.js +680 -14
  30. package/dist/admin/routes.test.js.map +1 -1
  31. package/dist/admin/server-logs.test.d.ts +1 -0
  32. package/dist/admin/server-logs.test.js +58 -0
  33. package/dist/admin/server-logs.test.js.map +1 -0
  34. package/dist/admin/sessions.d.ts +26 -39
  35. package/dist/admin/sessions.js +86 -310
  36. package/dist/admin/sessions.js.map +1 -1
  37. package/dist/admin/sessions.test.d.ts +1 -0
  38. package/dist/admin/sessions.test.js +78 -0
  39. package/dist/admin/sessions.test.js.map +1 -0
  40. package/dist/admin/version.d.ts +15 -0
  41. package/dist/admin/version.js +73 -0
  42. package/dist/admin/version.js.map +1 -0
  43. package/dist/admin/version.test.d.ts +1 -0
  44. package/dist/admin/version.test.js +71 -0
  45. package/dist/admin/version.test.js.map +1 -0
  46. package/dist/cli-config.d.ts +55 -0
  47. package/dist/cli-config.js +119 -0
  48. package/dist/cli-config.js.map +1 -0
  49. package/dist/cli-config.test.d.ts +1 -0
  50. package/dist/cli-config.test.js +92 -0
  51. package/dist/cli-config.test.js.map +1 -0
  52. package/dist/cli-format.d.ts +19 -0
  53. package/dist/cli-format.js +107 -0
  54. package/dist/cli-format.js.map +1 -0
  55. package/dist/cli-server.d.ts +73 -0
  56. package/dist/cli-server.js +347 -0
  57. package/dist/cli-server.js.map +1 -0
  58. package/dist/cli-server.test.d.ts +1 -0
  59. package/dist/cli-server.test.js +38 -0
  60. package/dist/cli-server.test.js.map +1 -0
  61. package/dist/cli-timeline.d.ts +35 -0
  62. package/dist/cli-timeline.js +373 -0
  63. package/dist/cli-timeline.js.map +1 -0
  64. package/dist/cli-timeline.test.d.ts +1 -0
  65. package/dist/cli-timeline.test.js +104 -0
  66. package/dist/cli-timeline.test.js.map +1 -0
  67. package/dist/cli.d.ts +0 -19
  68. package/dist/cli.js +910 -194
  69. package/dist/cli.js.map +1 -1
  70. package/dist/config-overlay.test.d.ts +1 -0
  71. package/dist/config-overlay.test.js +112 -0
  72. package/dist/config-overlay.test.js.map +1 -0
  73. package/dist/config-resolve.d.ts +28 -0
  74. package/dist/config-resolve.js +47 -0
  75. package/dist/config-resolve.js.map +1 -0
  76. package/dist/config-resolve.test.d.ts +1 -0
  77. package/dist/config-resolve.test.js +68 -0
  78. package/dist/config-resolve.test.js.map +1 -0
  79. package/dist/config.d.ts +62 -49
  80. package/dist/config.js +452 -76
  81. package/dist/config.js.map +1 -1
  82. package/dist/config.test.js +201 -32
  83. package/dist/config.test.js.map +1 -1
  84. package/dist/connectors/github-webhook.js +83 -5
  85. package/dist/connectors/github-webhook.js.map +1 -1
  86. package/dist/connectors/github-webhook.test.d.ts +1 -0
  87. package/dist/connectors/github-webhook.test.js +156 -0
  88. package/dist/connectors/github-webhook.test.js.map +1 -0
  89. package/dist/connectors/messaging/session-manager.d.ts +18 -0
  90. package/dist/connectors/messaging/session-manager.js +83 -2
  91. package/dist/connectors/messaging/session-manager.js.map +1 -1
  92. package/dist/connectors/messaging/session-manager.test.d.ts +1 -0
  93. package/dist/connectors/messaging/session-manager.test.js +144 -0
  94. package/dist/connectors/messaging/session-manager.test.js.map +1 -0
  95. package/dist/connectors/slack/connector.d.ts +9 -0
  96. package/dist/connectors/slack/connector.js +15 -0
  97. package/dist/connectors/slack/connector.js.map +1 -1
  98. package/dist/connectors/slack/mrkdwn.js +81 -0
  99. package/dist/connectors/slack/mrkdwn.js.map +1 -1
  100. package/dist/connectors/slack/mrkdwn.test.js +49 -0
  101. package/dist/connectors/slack/mrkdwn.test.js.map +1 -1
  102. package/dist/connectors/types.d.ts +1 -1
  103. package/dist/cron/fanout.d.ts +33 -0
  104. package/dist/cron/fanout.js +55 -0
  105. package/dist/cron/fanout.js.map +1 -0
  106. package/dist/cron/fanout.test.d.ts +1 -0
  107. package/dist/cron/fanout.test.js +73 -0
  108. package/dist/cron/fanout.test.js.map +1 -0
  109. package/dist/cron/jobs.d.ts +5 -0
  110. package/dist/cron/jobs.js +10 -3
  111. package/dist/cron/jobs.js.map +1 -1
  112. package/dist/cron/scheduler.d.ts +12 -0
  113. package/dist/cron/scheduler.js +27 -1
  114. package/dist/cron/scheduler.js.map +1 -1
  115. package/dist/engine/agent-executor.d.ts +158 -0
  116. package/dist/engine/agent-executor.js +1140 -0
  117. package/dist/engine/agent-executor.js.map +1 -0
  118. package/dist/engine/agent-executor.test.d.ts +1 -0
  119. package/dist/engine/agent-executor.test.js +395 -0
  120. package/dist/engine/agent-executor.test.js.map +1 -0
  121. package/dist/engine/chat-runner.d.ts +123 -0
  122. package/dist/engine/chat-runner.js +379 -0
  123. package/dist/engine/chat-runner.js.map +1 -0
  124. package/dist/engine/chat-runner.test.d.ts +1 -0
  125. package/dist/engine/chat-runner.test.js +104 -0
  126. package/dist/engine/chat-runner.test.js.map +1 -0
  127. package/dist/engine/chat-skills.d.ts +45 -0
  128. package/dist/engine/chat-skills.js +184 -0
  129. package/dist/engine/chat-skills.js.map +1 -0
  130. package/dist/engine/chat-skills.test.d.ts +1 -0
  131. package/dist/engine/chat-skills.test.js +20 -0
  132. package/dist/engine/chat-skills.test.js.map +1 -0
  133. package/dist/engine/chat.d.ts +20 -23
  134. package/dist/engine/chat.js +251 -155
  135. package/dist/engine/chat.js.map +1 -1
  136. package/dist/engine/chat.test.d.ts +1 -0
  137. package/dist/engine/chat.test.js +42 -0
  138. package/dist/engine/chat.test.js.map +1 -0
  139. package/dist/engine/classifier.d.ts +35 -2
  140. package/dist/engine/classifier.js +170 -31
  141. package/dist/engine/classifier.js.map +1 -1
  142. package/dist/engine/classifier.test.d.ts +1 -0
  143. package/dist/engine/classifier.test.js +115 -0
  144. package/dist/engine/classifier.test.js.map +1 -0
  145. package/dist/engine/dispatcher.d.ts +60 -0
  146. package/dist/engine/dispatcher.js +601 -0
  147. package/dist/engine/dispatcher.js.map +1 -0
  148. package/dist/engine/dispatcher.test.d.ts +1 -0
  149. package/dist/engine/dispatcher.test.js +511 -0
  150. package/dist/engine/dispatcher.test.js.map +1 -0
  151. package/dist/engine/event-shim.d.ts +117 -0
  152. package/dist/engine/event-shim.js +435 -0
  153. package/dist/engine/event-shim.js.map +1 -0
  154. package/dist/engine/event-shim.test.d.ts +1 -0
  155. package/dist/engine/event-shim.test.js +194 -0
  156. package/dist/engine/event-shim.test.js.map +1 -0
  157. package/dist/engine/git-auth.d.ts +13 -17
  158. package/dist/engine/git-auth.js +99 -42
  159. package/dist/engine/git-auth.js.map +1 -1
  160. package/dist/engine/git-auth.test.d.ts +1 -0
  161. package/dist/engine/git-auth.test.js +117 -0
  162. package/dist/engine/git-auth.test.js.map +1 -0
  163. package/dist/engine/github-app-client.d.ts +7 -0
  164. package/dist/engine/github-app-client.js +16 -0
  165. package/dist/engine/github-app-client.js.map +1 -0
  166. package/dist/engine/github-app-client.test.d.ts +1 -0
  167. package/dist/engine/github-app-client.test.js +44 -0
  168. package/dist/engine/github-app-client.test.js.map +1 -0
  169. package/dist/engine/github-tools.d.ts +12 -0
  170. package/dist/engine/github-tools.js +261 -0
  171. package/dist/engine/github-tools.js.map +1 -0
  172. package/dist/engine/github.d.ts +1027 -43
  173. package/dist/engine/github.js +153 -14
  174. package/dist/engine/github.js.map +1 -1
  175. package/dist/engine/llm.d.ts +47 -0
  176. package/dist/engine/llm.js +221 -0
  177. package/dist/engine/llm.js.map +1 -0
  178. package/dist/engine/llm.test.d.ts +1 -0
  179. package/dist/engine/llm.test.js +189 -0
  180. package/dist/engine/llm.test.js.map +1 -0
  181. package/dist/engine/profiles.d.ts +249 -0
  182. package/dist/engine/profiles.js +42 -0
  183. package/dist/engine/profiles.js.map +1 -0
  184. package/dist/engine/router.d.ts +12 -6
  185. package/dist/engine/router.js +339 -81
  186. package/dist/engine/router.js.map +1 -1
  187. package/dist/engine/router.test.js +428 -78
  188. package/dist/engine/router.test.js.map +1 -1
  189. package/dist/engine/screen.d.ts +41 -0
  190. package/dist/engine/screen.js +93 -0
  191. package/dist/engine/screen.js.map +1 -0
  192. package/dist/engine/screen.test.d.ts +1 -0
  193. package/dist/engine/screen.test.js +82 -0
  194. package/dist/engine/screen.test.js.map +1 -0
  195. package/dist/index.js +423 -437
  196. package/dist/index.js.map +1 -1
  197. package/dist/managed-repos.d.ts +7 -9
  198. package/dist/managed-repos.js +12 -15
  199. package/dist/managed-repos.js.map +1 -1
  200. package/dist/managed-repos.test.js +24 -19
  201. package/dist/managed-repos.test.js.map +1 -1
  202. package/dist/notify/index.d.ts +15 -0
  203. package/dist/notify/index.js +6 -0
  204. package/dist/notify/index.js.map +1 -0
  205. package/dist/notify/model.d.ts +57 -0
  206. package/dist/notify/model.js +89 -0
  207. package/dist/notify/model.js.map +1 -0
  208. package/dist/notify/model.test.d.ts +1 -0
  209. package/dist/notify/model.test.js +109 -0
  210. package/dist/notify/model.test.js.map +1 -0
  211. package/dist/notify/notifier.d.ts +17 -0
  212. package/dist/notify/notifier.js +87 -0
  213. package/dist/notify/notifier.js.map +1 -0
  214. package/dist/notify/notifier.test.d.ts +1 -0
  215. package/dist/notify/notifier.test.js +100 -0
  216. package/dist/notify/notifier.test.js.map +1 -0
  217. package/dist/notify/render.d.ts +21 -0
  218. package/dist/notify/render.js +59 -0
  219. package/dist/notify/render.js.map +1 -0
  220. package/dist/notify/render.test.d.ts +1 -0
  221. package/dist/notify/render.test.js +65 -0
  222. package/dist/notify/render.test.js.map +1 -0
  223. package/dist/notify/transports/github.d.ts +26 -0
  224. package/dist/notify/transports/github.js +26 -0
  225. package/dist/notify/transports/github.js.map +1 -0
  226. package/dist/notify/transports/slack.d.ts +26 -0
  227. package/dist/notify/transports/slack.js +28 -0
  228. package/dist/notify/transports/slack.js.map +1 -0
  229. package/dist/notify/transports.test.d.ts +1 -0
  230. package/dist/notify/transports.test.js +71 -0
  231. package/dist/notify/transports.test.js.map +1 -0
  232. package/dist/notify/types.d.ts +95 -0
  233. package/dist/notify/types.js +16 -0
  234. package/dist/notify/types.js.map +1 -0
  235. package/dist/sandbox/docker-compose.test.d.ts +1 -0
  236. package/dist/sandbox/docker-compose.test.js +128 -0
  237. package/dist/sandbox/docker-compose.test.js.map +1 -0
  238. package/dist/sandbox/docker.d.ts +97 -9
  239. package/dist/sandbox/docker.js +192 -41
  240. package/dist/sandbox/docker.js.map +1 -1
  241. package/dist/sandbox/docker.test.d.ts +1 -0
  242. package/dist/sandbox/docker.test.js +137 -0
  243. package/dist/sandbox/docker.test.js.map +1 -0
  244. package/dist/sandbox/egress-allowlist.d.ts +69 -0
  245. package/dist/sandbox/egress-allowlist.js +164 -0
  246. package/dist/sandbox/egress-allowlist.js.map +1 -0
  247. package/dist/sandbox/egress-allowlist.test.d.ts +1 -0
  248. package/dist/sandbox/egress-allowlist.test.js +65 -0
  249. package/dist/sandbox/egress-allowlist.test.js.map +1 -0
  250. package/dist/sandbox/egress-firewall-config.d.ts +127 -0
  251. package/dist/sandbox/egress-firewall-config.js +434 -0
  252. package/dist/sandbox/egress-firewall-config.js.map +1 -0
  253. package/dist/sandbox/egress-firewall-config.test.d.ts +1 -0
  254. package/dist/sandbox/egress-firewall-config.test.js +244 -0
  255. package/dist/sandbox/egress-firewall-config.test.js.map +1 -0
  256. package/dist/sandbox/images.d.ts +23 -0
  257. package/dist/sandbox/images.js +55 -0
  258. package/dist/sandbox/images.js.map +1 -0
  259. package/dist/sandbox/index.d.ts +82 -3
  260. package/dist/sandbox/index.js +223 -93
  261. package/dist/sandbox/index.js.map +1 -1
  262. package/dist/sandbox/index.test.d.ts +1 -0
  263. package/dist/sandbox/index.test.js +157 -0
  264. package/dist/sandbox/index.test.js.map +1 -0
  265. package/dist/session-log.d.ts +63 -0
  266. package/dist/session-log.js +290 -0
  267. package/dist/session-log.js.map +1 -0
  268. package/dist/session-log.test.d.ts +1 -0
  269. package/dist/session-log.test.js +85 -0
  270. package/dist/session-log.test.js.map +1 -0
  271. package/dist/setup.d.ts +31 -12
  272. package/dist/setup.js +516 -174
  273. package/dist/setup.js.map +1 -1
  274. package/dist/setup.test.js +138 -6
  275. package/dist/setup.test.js.map +1 -1
  276. package/dist/state/approval-store.d.ts +86 -0
  277. package/dist/state/approval-store.js +140 -0
  278. package/dist/state/approval-store.js.map +1 -0
  279. package/dist/state/build-assets.d.ts +50 -0
  280. package/dist/state/build-assets.js +154 -0
  281. package/dist/state/build-assets.js.map +1 -0
  282. package/dist/state/build-assets.test.d.ts +1 -0
  283. package/dist/state/build-assets.test.js +106 -0
  284. package/dist/state/build-assets.test.js.map +1 -0
  285. package/dist/state/db.d.ts +65 -333
  286. package/dist/state/db.js +112 -835
  287. package/dist/state/db.js.map +1 -1
  288. package/dist/state/db.test.js +127 -91
  289. package/dist/state/db.test.js.map +1 -1
  290. package/dist/state/execution-store.d.ts +257 -0
  291. package/dist/state/execution-store.js +527 -0
  292. package/dist/state/execution-store.js.map +1 -0
  293. package/dist/state/migrate.d.ts +15 -0
  294. package/dist/state/migrate.js +175 -0
  295. package/dist/state/migrate.js.map +1 -0
  296. package/dist/state/workflow-run-store.d.ts +195 -0
  297. package/dist/state/workflow-run-store.js +363 -0
  298. package/dist/state/workflow-run-store.js.map +1 -0
  299. package/dist/state/workflow-run-store.test.d.ts +1 -0
  300. package/dist/state/workflow-run-store.test.js +264 -0
  301. package/dist/state/workflow-run-store.test.js.map +1 -0
  302. package/dist/telemetry/index.d.ts +38 -0
  303. package/dist/telemetry/index.js +253 -0
  304. package/dist/telemetry/index.js.map +1 -0
  305. package/dist/telemetry/index.test.d.ts +1 -0
  306. package/dist/telemetry/index.test.js +73 -0
  307. package/dist/telemetry/index.test.js.map +1 -0
  308. package/dist/telemetry/pi-events.d.ts +12 -0
  309. package/dist/telemetry/pi-events.js +134 -0
  310. package/dist/telemetry/pi-events.js.map +1 -0
  311. package/dist/telemetry/pi-events.test.d.ts +1 -0
  312. package/dist/telemetry/pi-events.test.js +69 -0
  313. package/dist/telemetry/pi-events.test.js.map +1 -0
  314. package/dist/workflows/dag.d.ts +13 -1
  315. package/dist/workflows/dag.js +7 -3
  316. package/dist/workflows/dag.js.map +1 -1
  317. package/dist/workflows/dag.test.js +22 -0
  318. package/dist/workflows/dag.test.js.map +1 -1
  319. package/dist/workflows/golden-build.test.d.ts +1 -0
  320. package/dist/workflows/golden-build.test.js +45 -0
  321. package/dist/workflows/golden-build.test.js.map +1 -0
  322. package/dist/workflows/loader-overlay.test.d.ts +1 -0
  323. package/dist/workflows/loader-overlay.test.js +101 -0
  324. package/dist/workflows/loader-overlay.test.js.map +1 -0
  325. package/dist/workflows/loader.d.ts +36 -11
  326. package/dist/workflows/loader.js +311 -87
  327. package/dist/workflows/loader.js.map +1 -1
  328. package/dist/workflows/loader.test.js +114 -10
  329. package/dist/workflows/loader.test.js.map +1 -1
  330. package/dist/workflows/loop-eval.js +2 -0
  331. package/dist/workflows/loop-eval.js.map +1 -1
  332. package/dist/workflows/loop-eval.test.js +14 -0
  333. package/dist/workflows/loop-eval.test.js.map +1 -1
  334. package/dist/workflows/phase-executor.d.ts +145 -0
  335. package/dist/workflows/phase-executor.js +691 -0
  336. package/dist/workflows/phase-executor.js.map +1 -0
  337. package/dist/workflows/phase-executor.test.d.ts +1 -0
  338. package/dist/workflows/phase-executor.test.js +434 -0
  339. package/dist/workflows/phase-executor.test.js.map +1 -0
  340. package/dist/workflows/phase-ref.d.ts +44 -0
  341. package/dist/workflows/phase-ref.js +78 -0
  342. package/dist/workflows/phase-ref.js.map +1 -0
  343. package/dist/workflows/phase-ref.test.d.ts +1 -0
  344. package/dist/workflows/phase-ref.test.js +24 -0
  345. package/dist/workflows/phase-ref.test.js.map +1 -0
  346. package/dist/workflows/resume.d.ts +5 -11
  347. package/dist/workflows/resume.js +88 -7
  348. package/dist/workflows/resume.js.map +1 -1
  349. package/dist/workflows/runner.d.ts +34 -27
  350. package/dist/workflows/runner.js +252 -930
  351. package/dist/workflows/runner.js.map +1 -1
  352. package/dist/workflows/runner.test.js +346 -35
  353. package/dist/workflows/runner.test.js.map +1 -1
  354. package/dist/workflows/schema.d.ts +52 -10
  355. package/dist/workflows/schema.js +147 -7
  356. package/dist/workflows/schema.js.map +1 -1
  357. package/dist/workflows/simple.d.ts +67 -3
  358. package/dist/workflows/simple.js +248 -87
  359. package/dist/workflows/simple.js.map +1 -1
  360. package/dist/workflows/simple.test.d.ts +1 -0
  361. package/dist/workflows/simple.test.js +107 -0
  362. package/dist/workflows/simple.test.js.map +1 -0
  363. package/dist/workflows/templates.d.ts +29 -0
  364. package/dist/workflows/templates.js +42 -4
  365. package/dist/workflows/templates.js.map +1 -1
  366. package/dist/workflows/templates.test.js +103 -0
  367. package/dist/workflows/templates.test.js.map +1 -1
  368. package/dist/workflows/triggers.d.ts +21 -0
  369. package/dist/workflows/triggers.js +44 -0
  370. package/dist/workflows/triggers.js.map +1 -0
  371. package/dist/workflows/verdict.d.ts +19 -0
  372. package/dist/workflows/verdict.js +30 -0
  373. package/dist/workflows/verdict.js.map +1 -0
  374. package/dist/workflows/verdict.test.d.ts +1 -0
  375. package/dist/workflows/verdict.test.js +44 -0
  376. package/dist/workflows/verdict.test.js.map +1 -0
  377. package/dist/worktree/manager.d.ts +1 -1
  378. package/dist/worktree/manager.js +14 -14
  379. package/dist/worktree/manager.js.map +1 -1
  380. package/dist/worktree/manager.test.d.ts +1 -0
  381. package/dist/worktree/manager.test.js +87 -0
  382. package/dist/worktree/manager.test.js.map +1 -0
  383. package/docker-compose.yml +206 -5
  384. package/package.json +19 -7
  385. package/sandbox.Dockerfile +97 -18
  386. package/skills/README.md +40 -0
  387. package/skills/browser-qa/SKILL.md +193 -0
  388. package/skills/browser-qa/scripts/agent-browser.mjs +380 -0
  389. package/skills/building/SKILL.md +95 -0
  390. package/skills/chat/SKILL.md +30 -11
  391. package/skills/code-review/SKILL.md +59 -0
  392. package/skills/debug-production/SKILL.md +108 -0
  393. package/skills/demo/SKILL.md +194 -0
  394. package/skills/demo/scripts/compose-demo.sh +205 -0
  395. package/skills/issue-answer/SKILL.md +90 -0
  396. package/skills/issue-comment/SKILL.md +38 -24
  397. package/skills/issue-triage/SKILL.md +103 -37
  398. package/skills/issue-triage/references/AGENT-BRIEF.md +61 -0
  399. package/skills/pr-comment/SKILL.md +64 -0
  400. package/skills/pr-review/SKILL.md +65 -49
  401. package/skills/qa-test/SKILL.md +97 -0
  402. package/skills/repo-health/SKILL.md +48 -45
  403. package/skills/security-feedback/SKILL.md +173 -0
  404. package/skills/security-feedback/references/templates.md +77 -0
  405. package/skills/security-review/SKILL.md +213 -0
  406. package/skills/security-review/references/issue-format.md +302 -0
  407. package/skills/verify/SKILL.md +118 -0
  408. package/workflows/answer.yaml +37 -0
  409. package/workflows/build.yaml +32 -22
  410. package/workflows/cron-security.yaml +6 -0
  411. package/workflows/demo.yaml +55 -0
  412. package/workflows/explore.yaml +9 -0
  413. package/workflows/pr-comment.yaml +16 -0
  414. package/workflows/pr-fix.yaml +3 -0
  415. package/workflows/pr-review.yaml +4 -1
  416. package/workflows/prompts/answer.md +67 -0
  417. package/workflows/prompts/architect.md +24 -7
  418. package/workflows/prompts/demo.md +100 -0
  419. package/workflows/prompts/executor.md +29 -20
  420. package/workflows/prompts/explore-ask.md +51 -22
  421. package/workflows/prompts/explore-publish.md +2 -2
  422. package/workflows/prompts/explore-read.md +24 -10
  423. package/workflows/prompts/explore-synthesize.md +15 -8
  424. package/workflows/prompts/fix.md +9 -10
  425. package/workflows/prompts/guardrails.md +26 -8
  426. package/workflows/prompts/pr-fix.md +6 -7
  427. package/workflows/prompts/pr.md +11 -10
  428. package/workflows/prompts/qa-browser.md +95 -0
  429. package/workflows/prompts/qa-synth.md +44 -0
  430. package/workflows/prompts/qa-test.md +60 -0
  431. package/workflows/prompts/re-reviewer.md +8 -9
  432. package/workflows/prompts/reviewer.md +10 -9
  433. package/workflows/prompts/verify-browser.md +93 -0
  434. package/workflows/prompts/verify-synth.md +44 -0
  435. package/workflows/prompts/verify.md +63 -0
  436. package/workflows/qa-test.yaml +87 -0
  437. package/workflows/security-feedback.yaml +25 -0
  438. package/workflows/security-review.yaml +29 -0
  439. package/workflows/verify.yaml +85 -0
  440. package/deploy/mcp-config.tmpl.json +0 -14
  441. package/dist/cron/rate-limits.d.ts +0 -26
  442. package/dist/cron/rate-limits.js +0 -193
  443. package/dist/cron/rate-limits.js.map +0 -1
  444. package/dist/engine/executor.d.ts +0 -75
  445. package/dist/engine/executor.js +0 -292
  446. package/dist/engine/executor.js.map +0 -1
  447. package/mcp-github-app/package.json +0 -18
  448. package/mcp-github-app/src/auth.js +0 -66
  449. package/mcp-github-app/src/github.js +0 -371
  450. package/mcp-github-app/src/index.js +0 -534
  451. package/skills/devops/webhook-subscriptions/SKILL.md +0 -180
  452. package/skills/github/DESCRIPTION.md +0 -3
  453. package/skills/github/codebase-inspection/SKILL.md +0 -115
  454. package/skills/github/github-auth/SKILL.md +0 -54
  455. package/skills/github/github-auth/scripts/gh-env.sh +0 -66
  456. package/skills/github/github-code-review/SKILL.md +0 -480
  457. package/skills/github/github-code-review/references/review-output-template.md +0 -74
  458. package/skills/github/github-issues/SKILL.md +0 -369
  459. package/skills/github/github-issues/templates/bug-report.md +0 -35
  460. package/skills/github/github-issues/templates/feature-request.md +0 -31
  461. package/skills/github/github-pr-workflow/SKILL.md +0 -395
  462. package/skills/github/github-pr-workflow/references/ci-troubleshooting.md +0 -183
  463. package/skills/github/github-pr-workflow/references/conventional-commits.md +0 -71
  464. package/skills/github/github-pr-workflow/templates/pr-body-bugfix.md +0 -35
  465. package/skills/github/github-pr-workflow/templates/pr-body-feature.md +0 -33
  466. package/skills/github/github-repo-management/SKILL.md +0 -515
  467. package/skills/github/github-repo-management/references/github-api-cheatsheet.md +0 -161
  468. package/skills/github-orchestrator/SKILL.md +0 -103
  469. package/skills/mcp/DESCRIPTION.md +0 -3
  470. package/skills/mcp/mcporter/SKILL.md +0 -122
  471. package/skills/mcp/native-mcp/SKILL.md +0 -356
  472. package/skills/software-development/architect/SKILL.md +0 -154
  473. package/skills/software-development/assure-guardrails/SKILL.md +0 -239
  474. package/skills/software-development/plan/SKILL.md +0 -64
  475. package/skills/software-development/requesting-code-review/SKILL.md +0 -291
  476. package/skills/software-development/subagent-driven-development/SKILL.md +0 -433
  477. package/skills/software-development/systematic-debugging/SKILL.md +0 -366
  478. package/skills/software-development/test-driven-development/SKILL.md +0 -342
@@ -1,25 +1,55 @@
1
- import { classifyComment } from "./classifier.js";
2
- import { isManagedRepo, MANAGED_REPOS } from "../managed-repos.js";
1
+ import { classifyComment, classifyIssueIsQuestion } from "./classifier.js";
2
+ import { screenForInjection, flagPrefix } from "./screen.js";
3
+ import { getManagedRepos, isManagedRepo } from "../managed-repos.js";
4
+ import { getRoutes } from "../config.js";
3
5
  /** Friendly reply when a Slack/CLI command targets an unmanaged repo. */
4
6
  function unmanagedRepoReply(repo) {
5
7
  return (`❌ I'm not configured to work on \`${repo}\`.\n` +
6
- `Managed repos: ${MANAGED_REPOS.map((r) => `\`${r}\``).join(", ")}.\n` +
8
+ `Managed repos: ${getManagedRepos().map((r) => `\`${r}\``).join(", ")}.\n` +
7
9
  `Ask cliftonc to add it.`);
8
10
  }
11
+ /**
12
+ * Managed-repo gate shared by every Slack command that targets a repo.
13
+ * Returns `{ ok: true, repo }` when the repo is present and managed, or
14
+ * `{ ok: false, route }` carrying the reply Route to short-circuit with —
15
+ * a missing-repo prompt or the unmanaged-repo reply. Collapses the guard
16
+ * that was copy-pasted across triage/review/security/explore.
17
+ */
18
+ function requireManagedRepo(repo, missingReply) {
19
+ if (!repo)
20
+ return { ok: false, route: { action: "reply", message: missingReply } };
21
+ if (!isManagedRepo(repo)) {
22
+ return { ok: false, route: { action: "reply", message: unmanagedRepoReply(repo) } };
23
+ }
24
+ return { ok: true, repo };
25
+ }
9
26
  /** Author associations that can trigger builds via @mention */
10
27
  const MAINTAINER_ROLES = new Set(["OWNER", "MEMBER", "COLLABORATOR"]);
11
28
  /** Bot mention pattern — case-insensitive */
12
29
  const BOT_MENTION = /@last-light\b/i;
13
30
  /**
14
31
  * Event routing — deterministic for most events, LLM-classified for comments.
15
- * Maps normalized events to the skill that should handle them.
32
+ * Maps normalized events to the handler that should process them. Returns a
33
+ * decision only; the dispatcher performs the side effects.
16
34
  */
17
35
  export async function routeEvent(envelope, deps = {}) {
36
+ const routes = getRoutes();
37
+ const gh = routes.github;
38
+ const slack = routes.slack;
18
39
  switch (envelope.type) {
19
- case "issue.opened":
40
+ case "issue.opened": {
41
+ // Pure question issues ("how does X work?", "X vs Y?") want an ANSWER,
42
+ // not a code change — route them to the dedicated answer workflow (web
43
+ // search + its own model) instead of triage, which would otherwise file
44
+ // a question as an enhancement and write an agent brief. Classified with
45
+ // the same cheap model as comments; WORK is the safe default.
46
+ const isQuestion = await classifyIssueIsQuestion(envelope.title || "", envelope.body || "");
47
+ console.log(`[router] New issue ${envelope.repo}#${envelope.issueNumber} classified as: ${isQuestion ? "question" : "work"}`);
20
48
  return {
21
- action: "skill",
22
- skill: "issue-triage",
49
+ action: "handler",
50
+ handler: isQuestion
51
+ ? gh.issue_answer || "answer"
52
+ : gh.issue_opened || "issue-triage",
23
53
  context: {
24
54
  repo: envelope.repo,
25
55
  issueNumber: envelope.issueNumber,
@@ -29,10 +59,11 @@ export async function routeEvent(envelope, deps = {}) {
29
59
  labels: envelope.labels,
30
60
  },
31
61
  };
62
+ }
32
63
  case "issue.reopened":
33
64
  return {
34
- action: "skill",
35
- skill: "issue-triage",
65
+ action: "handler",
66
+ handler: gh.issue_reopened || "issue-triage",
36
67
  context: {
37
68
  repo: envelope.repo,
38
69
  issueNumber: envelope.issueNumber,
@@ -43,10 +74,18 @@ export async function routeEvent(envelope, deps = {}) {
43
74
  },
44
75
  };
45
76
  case "pr.opened":
77
+ case "pr.synchronize":
78
+ case "pr.reopened":
79
+ // All three deserve a fresh review on the current head SHA. The
80
+ // pr-review skill's "skip if already reviewed this SHA" guard covers
81
+ // the no-op case (e.g. synchronize triggered by a non-code change
82
+ // when we already reviewed the resulting SHA), so a stable handler
83
+ // for every PR-attention event is correct.
46
84
  return {
47
- action: "skill",
48
- skill: "pr-review",
85
+ action: "handler",
86
+ handler: gh[`pr_${envelope.type.split(".")[1]}`] || "pr-review",
49
87
  context: {
88
+ _routeKey: `github.pr_${envelope.type.split(".")[1]}`,
50
89
  repo: envelope.repo,
51
90
  prNumber: envelope.prNumber,
52
91
  title: envelope.title,
@@ -63,11 +102,11 @@ export async function routeEvent(envelope, deps = {}) {
63
102
  // resume the conversation naturally.
64
103
  if (deps.db && envelope.issueNumber) {
65
104
  const triggerId = `${envelope.repo}#${envelope.issueNumber}`;
66
- const pendingReply = deps.db.getPendingReplyGateByTrigger(triggerId);
105
+ const pendingReply = deps.db.approvals.getPendingReplyGateByTrigger(triggerId);
67
106
  if (pendingReply) {
68
107
  return {
69
- action: "skill",
70
- skill: "explore-reply",
108
+ action: "handler",
109
+ handler: gh.explore_reply || "explore-reply",
71
110
  context: {
72
111
  repo: envelope.repo,
73
112
  issueNumber: envelope.issueNumber,
@@ -98,8 +137,8 @@ export async function routeEvent(envelope, deps = {}) {
98
137
  const rejectMatch = envelope.body.match(/@last-light\s+reject\b(.*)/i);
99
138
  if (approveMatch || rejectMatch) {
100
139
  return {
101
- action: "skill",
102
- skill: "approval-response",
140
+ action: "handler",
141
+ handler: gh.approval_response || "approval-response",
103
142
  context: {
104
143
  repo: envelope.repo,
105
144
  issueNumber: envelope.issueNumber,
@@ -109,43 +148,163 @@ export async function routeEvent(envelope, deps = {}) {
109
148
  },
110
149
  };
111
150
  }
112
- // Classify intent: is this a build/fix request or a lightweight action?
113
- const { intent } = await classifyComment(envelope.body);
114
- console.log(`[router] Comment classified as: ${intent}`);
151
+ // Structured match for security-review before LLM classification
152
+ const securityMatch = envelope.body.match(/@last-light\s+security-review\b/i);
153
+ if (securityMatch) {
154
+ return {
155
+ action: "handler",
156
+ handler: gh.security_review || "security-review",
157
+ context: { repo: envelope.repo, sender: envelope.sender, source: envelope.source },
158
+ };
159
+ }
160
+ // Structured matches for verify / qa-test before LLM classification.
161
+ // Everything after the command word is the claim (verify) or the
162
+ // target/steps (qa-test); it flows through as `commentBody`. Both work on
163
+ // issues and PRs. Maintainer-gated above, like security-review.
164
+ const verifyMatch = envelope.body.match(/@last-light\s+verify\b([\s\S]*)/i);
165
+ if (verifyMatch) {
166
+ return {
167
+ action: "handler",
168
+ handler: gh.verify || "verify",
169
+ context: {
170
+ repo: envelope.repo,
171
+ issueNumber: envelope.issueNumber,
172
+ ...(envelope.prNumber ? { prNumber: envelope.prNumber } : {}),
173
+ title: envelope.title,
174
+ sender: envelope.sender,
175
+ commentBody: verifyMatch[1].trim() || envelope.body,
176
+ },
177
+ };
178
+ }
179
+ const qaTestMatch = envelope.body.match(/@last-light\s+qa-test\b([\s\S]*)/i);
180
+ if (qaTestMatch) {
181
+ return {
182
+ action: "handler",
183
+ handler: gh.qa_test || "qa-test",
184
+ context: {
185
+ repo: envelope.repo,
186
+ issueNumber: envelope.issueNumber,
187
+ ...(envelope.prNumber ? { prNumber: envelope.prNumber } : {}),
188
+ title: envelope.title,
189
+ sender: envelope.sender,
190
+ commentBody: qaTestMatch[1].trim() || envelope.body,
191
+ },
192
+ };
193
+ }
194
+ // `@last-light demo [notes]` — record a demo video of the PR/feature.
195
+ // Anything after the command word flows through as `commentBody` (demo
196
+ // scope/notes). Gated to the docker QA image at the workflow level; on a
197
+ // host without it the demo phase silently skips.
198
+ const demoMatch = envelope.body.match(/@last-light\s+demo\b([\s\S]*)/i);
199
+ if (demoMatch) {
200
+ return {
201
+ action: "handler",
202
+ handler: gh.demo || "demo",
203
+ context: {
204
+ repo: envelope.repo,
205
+ issueNumber: envelope.issueNumber,
206
+ ...(envelope.prNumber ? { prNumber: envelope.prNumber } : {}),
207
+ title: envelope.title,
208
+ sender: envelope.sender,
209
+ commentBody: demoMatch[1].trim() || envelope.body,
210
+ },
211
+ };
212
+ }
213
+ // Classify intent + screen for injection in parallel. Both run on the
214
+ // same comment text and have similar latency (single haiku call); doing
215
+ // them in parallel keeps overall router latency at max(classifier, screener)
216
+ // rather than their sum.
217
+ const [{ intent }, screen] = await Promise.all([
218
+ classifyComment(envelope.body, {
219
+ issueTitle: envelope.title,
220
+ isPullRequest: !!envelope.prNumber,
221
+ }),
222
+ screenForInjection(envelope.body),
223
+ ]);
224
+ console.log(`[router] Comment classified as: ${intent}` +
225
+ (screen.flagged ? ` [screener flagged: ${screen.reason || "no reason"}]` : ""));
226
+ // When the screener flags, prefix the commentBody with a one-line
227
+ // warning. Downstream agents anchored by agent-context/security.md
228
+ // treat flagged content skeptically. Never refuse — false positives
229
+ // shouldn't break legitimate comments.
230
+ const commentBody = screen.flagged
231
+ ? `${flagPrefix(screen.reason)}${envelope.body}`
232
+ : envelope.body;
115
233
  if (envelope.prNumber) {
116
- // PR comments: build → pr-fix; explore is not meaningful on PRs
117
- // (the code already exists) so collapse it to issue-comment.
234
+ // PR comments:
235
+ // build → pr-fix (full Architect→Executor→Reviewer fix loop)
236
+ // verify → verify (test a behavioural claim against the PR)
237
+ // qa-test → qa-test (drive a flow against the PR, step pass/fail)
238
+ // else → pr-comment (diff-aware Q&A; the issue-comment skill
239
+ // caps at 2 file reads which isn't enough to answer
240
+ // "does this PR consider X?" with code-cited evidence)
241
+ // Explore isn't meaningful on PRs since the code already exists.
242
+ const { handler: prHandler, routeKey: prRouteKey } = intent === "build" ? { handler: gh.pr_fix || "pr-fix", routeKey: "github.pr_fix" }
243
+ : intent === "verify" ? { handler: gh.verify || "verify", routeKey: "github.verify" }
244
+ : intent === "qa-test" ? { handler: gh.qa_test || "qa-test", routeKey: "github.qa_test" }
245
+ : intent === "demo" ? { handler: gh.demo || "demo", routeKey: "github.demo" }
246
+ : { handler: gh.pr_comment || "pr-comment", routeKey: "github.pr_comment" };
118
247
  return {
119
- action: "skill",
120
- skill: intent === "build" ? "pr-fix" : "issue-comment",
248
+ action: "handler",
249
+ handler: prHandler,
121
250
  context: {
251
+ _routeKey: prRouteKey,
122
252
  repo: envelope.repo,
123
253
  prNumber: envelope.prNumber,
124
254
  issueNumber: envelope.issueNumber,
125
255
  title: envelope.title,
126
256
  body: envelope.body,
127
257
  sender: envelope.sender,
128
- commentBody: envelope.body,
258
+ commentBody,
129
259
  },
130
260
  };
131
261
  }
132
262
  // Issue comments: build → full build cycle, explore → socratic
133
- // explore workflow, otherwiseissue-comment.
134
- const issueSkill = intent === "build"
135
- ? "github-orchestrator"
136
- : intent === "explore"
137
- ? "explore"
138
- : "issue-comment";
263
+ // explore workflow, security scan summary issues security-feedback,
264
+ // otherwise issue-comment.
265
+ //
266
+ // Key on `security-scan` (not just `security`) so we only divert to
267
+ // security-feedback on the per-run SUMMARY issue. Broken-out sub-issues
268
+ // carry `["security", severity]` (no `security-scan`) and must stay on
269
+ // the normal build/issue-comment path — "@last-light build this fix"
270
+ // on a sub-issue needs the real build cycle, not security-feedback.
271
+ //
272
+ // ALL comment intents on a summary issue funnel to security-feedback
273
+ // — including BUILD ("create issues for the highs" looks like build to
274
+ // the classifier but is really a break-out request). Approve/reject
275
+ // regex matches already returned above, so they don't reach here.
276
+ const hasScanSummaryLabel = (envelope.labels || []).includes("security-scan");
277
+ if (hasScanSummaryLabel) {
278
+ return {
279
+ action: "handler",
280
+ handler: gh.security_feedback || "security-feedback",
281
+ context: {
282
+ repo: envelope.repo,
283
+ issueNumber: envelope.issueNumber,
284
+ title: envelope.title,
285
+ body: envelope.body,
286
+ sender: envelope.sender,
287
+ commentBody,
288
+ },
289
+ };
290
+ }
291
+ const { handler: issueSkill, routeKey: issueRouteKey } = intent === "build" ? { handler: gh.issue_build || "github-orchestrator", routeKey: "github.issue_build" }
292
+ : intent === "explore" ? { handler: gh.issue_explore || "explore", routeKey: "github.issue_explore" }
293
+ : intent === "verify" ? { handler: gh.verify || "verify", routeKey: "github.verify" }
294
+ : intent === "qa-test" ? { handler: gh.qa_test || "qa-test", routeKey: "github.qa_test" }
295
+ : intent === "demo" ? { handler: gh.demo || "demo", routeKey: "github.demo" }
296
+ : { handler: gh.issue_comment || "issue-comment", routeKey: "github.issue_comment" };
139
297
  return {
140
- action: "skill",
141
- skill: issueSkill,
298
+ action: "handler",
299
+ handler: issueSkill,
142
300
  context: {
301
+ _routeKey: issueRouteKey,
143
302
  repo: envelope.repo,
144
303
  issueNumber: envelope.issueNumber,
145
304
  title: envelope.title,
146
305
  body: envelope.body,
147
306
  sender: envelope.sender,
148
- commentBody: envelope.body,
307
+ commentBody,
149
308
  },
150
309
  };
151
310
  }
@@ -166,11 +325,11 @@ export async function routeEvent(envelope, deps = {}) {
166
325
  // the next reply — this must sit above all slash-command handling
167
326
  // so replies don't get mis-parsed as commands.
168
327
  if (deps.db && slackTriggerId) {
169
- const pendingReply = deps.db.getPendingReplyGateByTrigger(slackTriggerId);
328
+ const pendingReply = deps.db.approvals.getPendingReplyGateByTrigger(slackTriggerId);
170
329
  if (pendingReply) {
171
330
  return {
172
- action: "skill",
173
- skill: "explore-reply",
331
+ action: "handler",
332
+ handler: slack.explore_reply || "explore-reply",
174
333
  context: {
175
334
  sender: envelope.sender,
176
335
  reply: text,
@@ -185,34 +344,42 @@ export async function routeEvent(envelope, deps = {}) {
185
344
  }
186
345
  // Classify all Slack messages via the LLM classifier — no regex
187
346
  // commands. The classifier extracts intent, repo, issue number, and
188
- // reject reason from natural language.
189
- const { intent, repo: classifiedRepo, issueNumber: classifiedIssue, reason: classifiedReason, } = await classifyComment(text);
347
+ // reject reason from natural language. Screen for injection in parallel
348
+ // (Slack messages are user-supplied text and reach the chat skill or a
349
+ // workflow, both of which need the flag annotation).
350
+ const [classification, screen] = await Promise.all([
351
+ classifyComment(text),
352
+ screenForInjection(text),
353
+ ]);
354
+ const { intent, repo: classifiedRepo, issueNumber: classifiedIssue, reason: classifiedReason, } = classification;
190
355
  console.log(`[router] Slack message classified as: ${intent}` +
191
356
  `${classifiedRepo ? ` (repo: ${classifiedRepo})` : ""}` +
192
- `${classifiedIssue ? ` (#${classifiedIssue})` : ""}`);
357
+ `${classifiedIssue ? ` (#${classifiedIssue})` : ""}` +
358
+ (screen.flagged ? ` [screener flagged: ${screen.reason || "no reason"}]` : ""));
359
+ const slackText = screen.flagged ? `${flagPrefix(screen.reason)}${text}` : text;
193
360
  switch (intent) {
194
361
  case "reset":
195
362
  return {
196
- action: "skill",
197
- skill: "chat-reset",
363
+ action: "handler",
364
+ handler: slack.reset || "chat-reset",
198
365
  context: { sessionId: raw?.sessionId, sender: envelope.sender, source: envelope.source },
199
366
  };
200
367
  case "status":
201
368
  return {
202
- action: "skill",
203
- skill: "status-report",
369
+ action: "handler",
370
+ handler: slack.status || "status-report",
204
371
  context: { sender: envelope.sender, source: envelope.source },
205
372
  };
206
373
  case "approve":
207
374
  return {
208
- action: "skill",
209
- skill: "approval-response",
375
+ action: "handler",
376
+ handler: slack.approve || "approval-response",
210
377
  context: { sender: envelope.sender, decision: "approved", source: envelope.source },
211
378
  };
212
379
  case "reject":
213
380
  return {
214
- action: "skill",
215
- skill: "approval-response",
381
+ action: "handler",
382
+ handler: slack.reject || "approval-response",
216
383
  context: {
217
384
  sender: envelope.sender,
218
385
  decision: "rejected",
@@ -221,69 +388,160 @@ export async function routeEvent(envelope, deps = {}) {
221
388
  },
222
389
  };
223
390
  case "build": {
391
+ // No repo + no issue context → classifier likely over-fired on
392
+ // an imperative verb ("delete files in X", "clean up my docs").
393
+ // Fall through to chat rather than nag the user for a repo.
224
394
  if (!classifiedRepo) {
225
- return { action: "reply", message: "Which repo should I build against? e.g. `build cliftonc/repo#42`" };
395
+ return {
396
+ action: "handler",
397
+ handler: slack.chat || "chat",
398
+ context: {
399
+ sessionId: raw?.sessionId,
400
+ message: slackText,
401
+ sender: envelope.sender,
402
+ source: envelope.source,
403
+ },
404
+ };
226
405
  }
227
406
  if (!isManagedRepo(classifiedRepo)) {
228
407
  return { action: "reply", message: unmanagedRepoReply(classifiedRepo) };
229
408
  }
230
409
  return {
231
- action: "skill",
232
- skill: "github-orchestrator",
410
+ action: "handler",
411
+ handler: slack.build || "github-orchestrator",
233
412
  context: {
413
+ _routeKey: "slack.build",
234
414
  repo: classifiedRepo,
235
415
  issueNumber: classifiedIssue,
236
416
  sender: envelope.sender,
237
- commentBody: text,
417
+ commentBody: slackText,
238
418
  source: envelope.source,
239
419
  },
240
420
  };
241
421
  }
242
422
  case "triage": {
243
- if (!classifiedRepo) {
244
- return { action: "reply", message: "Which repo should I triage? e.g. `triage cliftonc/repo`" };
245
- }
246
- if (!isManagedRepo(classifiedRepo)) {
247
- return { action: "reply", message: unmanagedRepoReply(classifiedRepo) };
248
- }
423
+ const gate = requireManagedRepo(classifiedRepo, "Which repo should I triage? e.g. `triage cliftonc/repo`");
424
+ if (!gate.ok)
425
+ return gate.route;
249
426
  return {
250
- action: "skill",
251
- skill: "issue-triage",
252
- context: { repo: classifiedRepo, sender: envelope.sender, source: envelope.source },
427
+ action: "handler",
428
+ handler: slack.triage || "issue-triage",
429
+ context: { repo: gate.repo, sender: envelope.sender, source: envelope.source },
253
430
  };
254
431
  }
255
432
  case "review": {
433
+ const gate = requireManagedRepo(classifiedRepo, "Which repo should I review PRs for? e.g. `review cliftonc/repo`");
434
+ if (!gate.ok)
435
+ return gate.route;
436
+ return {
437
+ action: "handler",
438
+ handler: slack.review || "pr-review",
439
+ context: {
440
+ repo: gate.repo,
441
+ prNumber: classifiedIssue,
442
+ issueNumber: classifiedIssue,
443
+ sender: envelope.sender,
444
+ source: envelope.source,
445
+ },
446
+ };
447
+ }
448
+ case "security": {
449
+ const gate = requireManagedRepo(classifiedRepo, "Which repo should I scan? e.g. `security review cliftonc/repo`");
450
+ if (!gate.ok)
451
+ return gate.route;
452
+ return {
453
+ action: "handler",
454
+ handler: slack.security || "security-review",
455
+ context: { repo: gate.repo, sender: envelope.sender, source: envelope.source },
456
+ };
457
+ }
458
+ case "verify": {
459
+ const gate = requireManagedRepo(classifiedRepo, "Which repo should I verify? e.g. `verify cliftonc/repo#42 — the fork flag creates a new session`");
460
+ if (!gate.ok)
461
+ return gate.route;
462
+ return {
463
+ action: "handler",
464
+ handler: slack.verify || "verify",
465
+ context: {
466
+ repo: gate.repo,
467
+ issueNumber: classifiedIssue,
468
+ sender: envelope.sender,
469
+ commentBody: slackText,
470
+ source: envelope.source,
471
+ triggerId: slackTriggerId,
472
+ channelId,
473
+ threadId,
474
+ },
475
+ };
476
+ }
477
+ case "qa-test": {
478
+ const gate = requireManagedRepo(classifiedRepo, "Which repo should I QA-test? e.g. `qa-test cliftonc/repo#42 -- login, create a project`");
479
+ if (!gate.ok)
480
+ return gate.route;
481
+ return {
482
+ action: "handler",
483
+ handler: slack.qa_test || "qa-test",
484
+ context: {
485
+ repo: gate.repo,
486
+ issueNumber: classifiedIssue,
487
+ sender: envelope.sender,
488
+ commentBody: slackText,
489
+ source: envelope.source,
490
+ triggerId: slackTriggerId,
491
+ channelId,
492
+ threadId,
493
+ },
494
+ };
495
+ }
496
+ case "question": {
497
+ // A substantive question targeting a managed repo → run the sandboxed
498
+ // answer workflow (web search + repo docs), delivered back to this
499
+ // thread. A repo-less question can't seed a sandbox workspace, so it
500
+ // falls through to in-process chat for a quick answer (mirrors build).
256
501
  if (!classifiedRepo) {
257
- return { action: "reply", message: "Which repo should I review PRs for? e.g. `review cliftonc/repo`" };
502
+ return {
503
+ action: "handler",
504
+ handler: slack.chat || "chat",
505
+ context: {
506
+ sessionId: raw?.sessionId,
507
+ message: slackText,
508
+ sender: envelope.sender,
509
+ source: envelope.source,
510
+ },
511
+ };
258
512
  }
259
513
  if (!isManagedRepo(classifiedRepo)) {
260
514
  return { action: "reply", message: unmanagedRepoReply(classifiedRepo) };
261
515
  }
262
516
  return {
263
- action: "skill",
264
- skill: "pr-review",
265
- context: { repo: classifiedRepo, sender: envelope.sender, source: envelope.source },
517
+ action: "handler",
518
+ handler: slack.answer || "answer",
519
+ context: {
520
+ repo: classifiedRepo,
521
+ issueNumber: classifiedIssue,
522
+ sender: envelope.sender,
523
+ commentBody: slackText,
524
+ source: envelope.source,
525
+ triggerId: slackTriggerId,
526
+ channelId,
527
+ threadId,
528
+ },
266
529
  };
267
530
  }
268
531
  case "explore": {
269
- if (!classifiedRepo || !isManagedRepo(classifiedRepo)) {
270
- return {
271
- action: "reply",
272
- message: classifiedRepo
273
- ? unmanagedRepoReply(classifiedRepo)
274
- : "I'd love to help explore that idea, but I need to know which repo to work against. " +
275
- "Could you restate your request and include the repo? For example: " +
276
- "\"let's explore adding webhooks to cliftonc/lastlight\"",
277
- };
278
- }
532
+ const gate = requireManagedRepo(classifiedRepo, "I'd love to help explore that idea, but I need to know which repo to work against. " +
533
+ "Could you restate your request and include the repo? For example: " +
534
+ '"let\'s explore adding webhooks to cliftonc/lastlight"');
535
+ if (!gate.ok)
536
+ return gate.route;
279
537
  return {
280
- action: "skill",
281
- skill: "explore",
538
+ action: "handler",
539
+ handler: slack.explore || "explore",
282
540
  context: {
283
- repo: classifiedRepo,
541
+ repo: gate.repo,
284
542
  issueNumber: classifiedIssue,
285
543
  sender: envelope.sender,
286
- commentBody: text,
544
+ commentBody: slackText,
287
545
  source: envelope.source,
288
546
  triggerId: slackTriggerId,
289
547
  channelId,
@@ -294,11 +552,11 @@ export async function routeEvent(envelope, deps = {}) {
294
552
  default:
295
553
  // chat — conversational reply
296
554
  return {
297
- action: "skill",
298
- skill: "chat",
555
+ action: "handler",
556
+ handler: slack.chat || "chat",
299
557
  context: {
300
558
  sessionId: raw?.sessionId,
301
- message: text,
559
+ message: slackText,
302
560
  sender: envelope.sender,
303
561
  source: envelope.source,
304
562
  },
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/engine/router.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAcnE,yEAAyE;AACzE,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,CACL,qCAAqC,IAAI,OAAO;QAChD,kBAAkB,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;QACtE,yBAAyB,CAC1B,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;AAEtE,6CAA6C;AAC7C,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,QAAuB,EACvB,OAAmB,EAAE;IAErB,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,KAAK,cAAc;YACjB,OAAO;gBACL,MAAM,EAAE,OAAO;gB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