@jonit-dev/night-watch-cli 1.7.30 → 1.7.31

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 (384) hide show
  1. package/bin/night-watch.mjs +1 -1
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/{src/cli.js → cli.js} +1 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/{src/commands → commands}/audit.d.ts +2 -2
  7. package/dist/commands/audit.d.ts.map +1 -0
  8. package/dist/{src/commands → commands}/audit.js +29 -33
  9. package/dist/commands/audit.js.map +1 -0
  10. package/dist/{src/commands → commands}/board.d.ts +1 -1
  11. package/dist/commands/board.d.ts.map +1 -0
  12. package/dist/commands/board.js +664 -0
  13. package/dist/commands/board.js.map +1 -0
  14. package/dist/{src/commands → commands}/cancel.d.ts +3 -3
  15. package/dist/commands/cancel.d.ts.map +1 -0
  16. package/dist/{src/commands → commands}/cancel.js +18 -20
  17. package/dist/commands/cancel.js.map +1 -0
  18. package/dist/commands/dashboard/tab-actions.d.ts.map +1 -0
  19. package/dist/commands/dashboard/tab-actions.js.map +1 -0
  20. package/dist/{src/commands → commands}/dashboard/tab-config.d.ts +3 -3
  21. package/dist/commands/dashboard/tab-config.d.ts.map +1 -0
  22. package/dist/{src/commands → commands}/dashboard/tab-config.js +250 -187
  23. package/dist/commands/dashboard/tab-config.js.map +1 -0
  24. package/dist/{src/commands → commands}/dashboard/tab-logs.d.ts +1 -1
  25. package/dist/commands/dashboard/tab-logs.d.ts.map +1 -0
  26. package/dist/{src/commands → commands}/dashboard/tab-logs.js +62 -38
  27. package/dist/commands/dashboard/tab-logs.js.map +1 -0
  28. package/dist/{src/commands → commands}/dashboard/tab-schedules.d.ts +1 -1
  29. package/dist/commands/dashboard/tab-schedules.d.ts.map +1 -0
  30. package/dist/{src/commands → commands}/dashboard/tab-schedules.js +85 -76
  31. package/dist/commands/dashboard/tab-schedules.js.map +1 -0
  32. package/dist/{src/commands → commands}/dashboard/tab-status.d.ts +7 -7
  33. package/dist/commands/dashboard/tab-status.d.ts.map +1 -0
  34. package/dist/{src/commands → commands}/dashboard/tab-status.js +98 -95
  35. package/dist/commands/dashboard/tab-status.js.map +1 -0
  36. package/dist/{src/commands → commands}/dashboard/types.d.ts +3 -4
  37. package/dist/commands/dashboard/types.d.ts.map +1 -0
  38. package/dist/commands/dashboard/types.js.map +1 -0
  39. package/dist/{src/commands → commands}/dashboard.d.ts +2 -2
  40. package/dist/commands/dashboard.d.ts.map +1 -0
  41. package/dist/{src/commands → commands}/dashboard.js +32 -33
  42. package/dist/commands/dashboard.js.map +1 -0
  43. package/dist/{src/commands → commands}/doctor.d.ts +2 -2
  44. package/dist/commands/doctor.d.ts.map +1 -0
  45. package/dist/{src/commands → commands}/doctor.js +40 -43
  46. package/dist/commands/doctor.js.map +1 -0
  47. package/dist/{src/commands → commands}/history.d.ts +1 -1
  48. package/dist/commands/history.d.ts.map +1 -0
  49. package/dist/{src/commands → commands}/history.js +11 -18
  50. package/dist/commands/history.js.map +1 -0
  51. package/dist/{src/commands → commands}/init.d.ts +1 -1
  52. package/dist/commands/init.d.ts.map +1 -0
  53. package/dist/{src/commands → commands}/init.js +57 -36
  54. package/dist/commands/init.js.map +1 -0
  55. package/dist/{src/commands → commands}/install.d.ts +2 -2
  56. package/dist/commands/install.d.ts.map +1 -0
  57. package/dist/{src/commands → commands}/install.js +48 -50
  58. package/dist/commands/install.js.map +1 -0
  59. package/dist/{src/commands → commands}/logs.d.ts +1 -1
  60. package/dist/commands/logs.d.ts.map +1 -0
  61. package/dist/{src/commands → commands}/logs.js +29 -30
  62. package/dist/commands/logs.js.map +1 -0
  63. package/dist/{src/commands → commands}/prd-state.d.ts +1 -1
  64. package/dist/commands/prd-state.d.ts.map +1 -0
  65. package/dist/{src/commands → commands}/prd-state.js +14 -14
  66. package/dist/commands/prd-state.js.map +1 -0
  67. package/dist/{src/commands → commands}/prd.d.ts +1 -1
  68. package/dist/commands/prd.d.ts.map +1 -0
  69. package/dist/{src/commands → commands}/prd.js +57 -66
  70. package/dist/commands/prd.js.map +1 -0
  71. package/dist/{src/commands → commands}/prds.d.ts +1 -1
  72. package/dist/commands/prds.d.ts.map +1 -0
  73. package/dist/{src/commands → commands}/prds.js +51 -53
  74. package/dist/commands/prds.js.map +1 -0
  75. package/dist/{src/commands → commands}/prs.d.ts +1 -1
  76. package/dist/commands/prs.d.ts.map +1 -0
  77. package/dist/{src/commands → commands}/prs.js +22 -24
  78. package/dist/commands/prs.js.map +1 -0
  79. package/dist/{src/commands → commands}/qa.d.ts +2 -2
  80. package/dist/commands/qa.d.ts.map +1 -0
  81. package/dist/{src/commands → commands}/qa.js +50 -51
  82. package/dist/commands/qa.js.map +1 -0
  83. package/dist/{src/commands → commands}/retry.d.ts +1 -1
  84. package/dist/commands/retry.d.ts.map +1 -0
  85. package/dist/{src/commands → commands}/retry.js +9 -10
  86. package/dist/commands/retry.js.map +1 -0
  87. package/dist/{src/commands → commands}/review.d.ts +2 -2
  88. package/dist/commands/review.d.ts.map +1 -0
  89. package/dist/{src/commands → commands}/review.js +68 -59
  90. package/dist/commands/review.js.map +1 -0
  91. package/dist/{src/commands → commands}/run.d.ts +2 -2
  92. package/dist/commands/run.d.ts.map +1 -0
  93. package/dist/{src/commands → commands}/run.js +87 -83
  94. package/dist/commands/run.js.map +1 -0
  95. package/dist/{src/commands → commands}/serve.d.ts +2 -2
  96. package/dist/commands/serve.d.ts.map +1 -0
  97. package/dist/{src/commands → commands}/serve.js +18 -18
  98. package/dist/commands/serve.js.map +1 -0
  99. package/dist/{src/commands → commands}/slice.d.ts +2 -2
  100. package/dist/commands/slice.d.ts.map +1 -0
  101. package/dist/{src/commands → commands}/slice.js +50 -46
  102. package/dist/commands/slice.js.map +1 -0
  103. package/dist/{src/commands → commands}/state.d.ts +1 -1
  104. package/dist/commands/state.d.ts.map +1 -0
  105. package/dist/{src/commands → commands}/state.js +20 -22
  106. package/dist/commands/state.js.map +1 -0
  107. package/dist/{src/commands → commands}/status.d.ts +1 -1
  108. package/dist/commands/status.d.ts.map +1 -0
  109. package/dist/{src/commands → commands}/status.js +75 -54
  110. package/dist/commands/status.js.map +1 -0
  111. package/dist/{src/commands → commands}/uninstall.d.ts +1 -1
  112. package/dist/commands/uninstall.d.ts.map +1 -0
  113. package/dist/{src/commands → commands}/uninstall.js +12 -14
  114. package/dist/commands/uninstall.js.map +1 -0
  115. package/dist/{src/commands → commands}/update.d.ts +1 -1
  116. package/dist/commands/update.d.ts.map +1 -0
  117. package/dist/{src/commands → commands}/update.js +23 -23
  118. package/dist/commands/update.js.map +1 -0
  119. package/package.json +18 -42
  120. package/LICENSE +0 -21
  121. package/README.md +0 -132
  122. package/dist/shared/types.d.ts +0 -226
  123. package/dist/shared/types.d.ts.map +0 -1
  124. package/dist/shared/types.js +0 -7
  125. package/dist/shared/types.js.map +0 -1
  126. package/dist/src/agents/soul-compiler.d.ts +0 -11
  127. package/dist/src/agents/soul-compiler.d.ts.map +0 -1
  128. package/dist/src/agents/soul-compiler.js +0 -157
  129. package/dist/src/agents/soul-compiler.js.map +0 -1
  130. package/dist/src/board/factory.d.ts +0 -3
  131. package/dist/src/board/factory.d.ts.map +0 -1
  132. package/dist/src/board/factory.js +0 -10
  133. package/dist/src/board/factory.js.map +0 -1
  134. package/dist/src/board/providers/github-graphql.d.ts +0 -16
  135. package/dist/src/board/providers/github-graphql.d.ts.map +0 -1
  136. package/dist/src/board/providers/github-graphql.js +0 -43
  137. package/dist/src/board/providers/github-graphql.js.map +0 -1
  138. package/dist/src/board/providers/github-projects.d.ts +0 -51
  139. package/dist/src/board/providers/github-projects.d.ts.map +0 -1
  140. package/dist/src/board/providers/github-projects.js +0 -672
  141. package/dist/src/board/providers/github-projects.js.map +0 -1
  142. package/dist/src/board/types.d.ts +0 -60
  143. package/dist/src/board/types.d.ts.map +0 -1
  144. package/dist/src/board/types.js +0 -4
  145. package/dist/src/board/types.js.map +0 -1
  146. package/dist/src/cli.d.ts +0 -3
  147. package/dist/src/cli.d.ts.map +0 -1
  148. package/dist/src/cli.js.map +0 -1
  149. package/dist/src/commands/audit.d.ts.map +0 -1
  150. package/dist/src/commands/audit.js.map +0 -1
  151. package/dist/src/commands/board.d.ts.map +0 -1
  152. package/dist/src/commands/board.js +0 -294
  153. package/dist/src/commands/board.js.map +0 -1
  154. package/dist/src/commands/cancel.d.ts.map +0 -1
  155. package/dist/src/commands/cancel.js.map +0 -1
  156. package/dist/src/commands/dashboard/tab-actions.d.ts.map +0 -1
  157. package/dist/src/commands/dashboard/tab-actions.js.map +0 -1
  158. package/dist/src/commands/dashboard/tab-config.d.ts.map +0 -1
  159. package/dist/src/commands/dashboard/tab-config.js.map +0 -1
  160. package/dist/src/commands/dashboard/tab-logs.d.ts.map +0 -1
  161. package/dist/src/commands/dashboard/tab-logs.js.map +0 -1
  162. package/dist/src/commands/dashboard/tab-schedules.d.ts.map +0 -1
  163. package/dist/src/commands/dashboard/tab-schedules.js.map +0 -1
  164. package/dist/src/commands/dashboard/tab-status.d.ts.map +0 -1
  165. package/dist/src/commands/dashboard/tab-status.js.map +0 -1
  166. package/dist/src/commands/dashboard/types.d.ts.map +0 -1
  167. package/dist/src/commands/dashboard/types.js.map +0 -1
  168. package/dist/src/commands/dashboard.d.ts.map +0 -1
  169. package/dist/src/commands/dashboard.js.map +0 -1
  170. package/dist/src/commands/doctor.d.ts.map +0 -1
  171. package/dist/src/commands/doctor.js.map +0 -1
  172. package/dist/src/commands/history.d.ts.map +0 -1
  173. package/dist/src/commands/history.js.map +0 -1
  174. package/dist/src/commands/init.d.ts.map +0 -1
  175. package/dist/src/commands/init.js.map +0 -1
  176. package/dist/src/commands/install.d.ts.map +0 -1
  177. package/dist/src/commands/install.js.map +0 -1
  178. package/dist/src/commands/logs.d.ts.map +0 -1
  179. package/dist/src/commands/logs.js.map +0 -1
  180. package/dist/src/commands/prd-state.d.ts.map +0 -1
  181. package/dist/src/commands/prd-state.js.map +0 -1
  182. package/dist/src/commands/prd.d.ts.map +0 -1
  183. package/dist/src/commands/prd.js.map +0 -1
  184. package/dist/src/commands/prds.d.ts.map +0 -1
  185. package/dist/src/commands/prds.js.map +0 -1
  186. package/dist/src/commands/prs.d.ts.map +0 -1
  187. package/dist/src/commands/prs.js.map +0 -1
  188. package/dist/src/commands/qa.d.ts.map +0 -1
  189. package/dist/src/commands/qa.js.map +0 -1
  190. package/dist/src/commands/retry.d.ts.map +0 -1
  191. package/dist/src/commands/retry.js.map +0 -1
  192. package/dist/src/commands/review.d.ts.map +0 -1
  193. package/dist/src/commands/review.js.map +0 -1
  194. package/dist/src/commands/run.d.ts.map +0 -1
  195. package/dist/src/commands/run.js.map +0 -1
  196. package/dist/src/commands/serve.d.ts.map +0 -1
  197. package/dist/src/commands/serve.js.map +0 -1
  198. package/dist/src/commands/slice.d.ts.map +0 -1
  199. package/dist/src/commands/slice.js.map +0 -1
  200. package/dist/src/commands/state.d.ts.map +0 -1
  201. package/dist/src/commands/state.js.map +0 -1
  202. package/dist/src/commands/status.d.ts.map +0 -1
  203. package/dist/src/commands/status.js.map +0 -1
  204. package/dist/src/commands/uninstall.d.ts.map +0 -1
  205. package/dist/src/commands/uninstall.js.map +0 -1
  206. package/dist/src/commands/update.d.ts.map +0 -1
  207. package/dist/src/commands/update.js.map +0 -1
  208. package/dist/src/config.d.ts +0 -23
  209. package/dist/src/config.d.ts.map +0 -1
  210. package/dist/src/config.js +0 -671
  211. package/dist/src/config.js.map +0 -1
  212. package/dist/src/constants.d.ts +0 -67
  213. package/dist/src/constants.d.ts.map +0 -1
  214. package/dist/src/constants.js +0 -131
  215. package/dist/src/constants.js.map +0 -1
  216. package/dist/src/server/index.d.ts +0 -23
  217. package/dist/src/server/index.d.ts.map +0 -1
  218. package/dist/src/server/index.js +0 -1704
  219. package/dist/src/server/index.js.map +0 -1
  220. package/dist/src/slack/channel-manager.d.ts +0 -32
  221. package/dist/src/slack/channel-manager.d.ts.map +0 -1
  222. package/dist/src/slack/channel-manager.js +0 -128
  223. package/dist/src/slack/channel-manager.js.map +0 -1
  224. package/dist/src/slack/client.d.ts +0 -76
  225. package/dist/src/slack/client.d.ts.map +0 -1
  226. package/dist/src/slack/client.js +0 -193
  227. package/dist/src/slack/client.js.map +0 -1
  228. package/dist/src/slack/deliberation.d.ts +0 -87
  229. package/dist/src/slack/deliberation.d.ts.map +0 -1
  230. package/dist/src/slack/deliberation.js +0 -1354
  231. package/dist/src/slack/deliberation.js.map +0 -1
  232. package/dist/src/slack/index.d.ts +0 -6
  233. package/dist/src/slack/index.d.ts.map +0 -1
  234. package/dist/src/slack/index.js +0 -5
  235. package/dist/src/slack/index.js.map +0 -1
  236. package/dist/src/slack/interaction-listener.d.ts +0 -130
  237. package/dist/src/slack/interaction-listener.d.ts.map +0 -1
  238. package/dist/src/slack/interaction-listener.js +0 -1386
  239. package/dist/src/slack/interaction-listener.js.map +0 -1
  240. package/dist/src/storage/json-state-migrator.d.ts +0 -24
  241. package/dist/src/storage/json-state-migrator.d.ts.map +0 -1
  242. package/dist/src/storage/json-state-migrator.js +0 -197
  243. package/dist/src/storage/json-state-migrator.js.map +0 -1
  244. package/dist/src/storage/repositories/index.d.ts +0 -25
  245. package/dist/src/storage/repositories/index.d.ts.map +0 -1
  246. package/dist/src/storage/repositories/index.js +0 -45
  247. package/dist/src/storage/repositories/index.js.map +0 -1
  248. package/dist/src/storage/repositories/interfaces.d.ts +0 -60
  249. package/dist/src/storage/repositories/interfaces.d.ts.map +0 -1
  250. package/dist/src/storage/repositories/interfaces.js +0 -6
  251. package/dist/src/storage/repositories/interfaces.js.map +0 -1
  252. package/dist/src/storage/repositories/sqlite/agent-persona-repository.d.ts +0 -33
  253. package/dist/src/storage/repositories/sqlite/agent-persona-repository.d.ts.map +0 -1
  254. package/dist/src/storage/repositories/sqlite/agent-persona-repository.js +0 -715
  255. package/dist/src/storage/repositories/sqlite/agent-persona-repository.js.map +0 -1
  256. package/dist/src/storage/repositories/sqlite/execution-history-repository.d.ts +0 -21
  257. package/dist/src/storage/repositories/sqlite/execution-history-repository.d.ts.map +0 -1
  258. package/dist/src/storage/repositories/sqlite/execution-history-repository.js +0 -94
  259. package/dist/src/storage/repositories/sqlite/execution-history-repository.js.map +0 -1
  260. package/dist/src/storage/repositories/sqlite/prd-state-repository.d.ts +0 -17
  261. package/dist/src/storage/repositories/sqlite/prd-state-repository.d.ts.map +0 -1
  262. package/dist/src/storage/repositories/sqlite/prd-state-repository.js +0 -74
  263. package/dist/src/storage/repositories/sqlite/prd-state-repository.js.map +0 -1
  264. package/dist/src/storage/repositories/sqlite/project-registry-repository.d.ts +0 -17
  265. package/dist/src/storage/repositories/sqlite/project-registry-repository.d.ts.map +0 -1
  266. package/dist/src/storage/repositories/sqlite/project-registry-repository.js +0 -43
  267. package/dist/src/storage/repositories/sqlite/project-registry-repository.js.map +0 -1
  268. package/dist/src/storage/repositories/sqlite/roadmap-state-repository.d.ts +0 -14
  269. package/dist/src/storage/repositories/sqlite/roadmap-state-repository.d.ts.map +0 -1
  270. package/dist/src/storage/repositories/sqlite/roadmap-state-repository.js +0 -47
  271. package/dist/src/storage/repositories/sqlite/roadmap-state-repository.js.map +0 -1
  272. package/dist/src/storage/repositories/sqlite/slack-discussion-repository.d.ts +0 -20
  273. package/dist/src/storage/repositories/sqlite/slack-discussion-repository.d.ts.map +0 -1
  274. package/dist/src/storage/repositories/sqlite/slack-discussion-repository.js +0 -88
  275. package/dist/src/storage/repositories/sqlite/slack-discussion-repository.js.map +0 -1
  276. package/dist/src/storage/sqlite/client.d.ts +0 -23
  277. package/dist/src/storage/sqlite/client.d.ts.map +0 -1
  278. package/dist/src/storage/sqlite/client.js +0 -47
  279. package/dist/src/storage/sqlite/client.js.map +0 -1
  280. package/dist/src/storage/sqlite/migrations.d.ts +0 -11
  281. package/dist/src/storage/sqlite/migrations.d.ts.map +0 -1
  282. package/dist/src/storage/sqlite/migrations.js +0 -94
  283. package/dist/src/storage/sqlite/migrations.js.map +0 -1
  284. package/dist/src/templates/prd-template.d.ts +0 -11
  285. package/dist/src/templates/prd-template.d.ts.map +0 -1
  286. package/dist/src/templates/prd-template.js +0 -166
  287. package/dist/src/templates/prd-template.js.map +0 -1
  288. package/dist/src/templates/slicer-prompt.d.ts +0 -54
  289. package/dist/src/templates/slicer-prompt.d.ts.map +0 -1
  290. package/dist/src/templates/slicer-prompt.js +0 -163
  291. package/dist/src/templates/slicer-prompt.js.map +0 -1
  292. package/dist/src/types.d.ts +0 -140
  293. package/dist/src/types.d.ts.map +0 -1
  294. package/dist/src/types.js +0 -5
  295. package/dist/src/types.js.map +0 -1
  296. package/dist/src/utils/avatar-generator.d.ts +0 -6
  297. package/dist/src/utils/avatar-generator.d.ts.map +0 -1
  298. package/dist/src/utils/avatar-generator.js +0 -133
  299. package/dist/src/utils/avatar-generator.js.map +0 -1
  300. package/dist/src/utils/checks.d.ts +0 -55
  301. package/dist/src/utils/checks.d.ts.map +0 -1
  302. package/dist/src/utils/checks.js +0 -246
  303. package/dist/src/utils/checks.js.map +0 -1
  304. package/dist/src/utils/config-writer.d.ts +0 -16
  305. package/dist/src/utils/config-writer.d.ts.map +0 -1
  306. package/dist/src/utils/config-writer.js +0 -45
  307. package/dist/src/utils/config-writer.js.map +0 -1
  308. package/dist/src/utils/crontab.d.ts +0 -62
  309. package/dist/src/utils/crontab.d.ts.map +0 -1
  310. package/dist/src/utils/crontab.js +0 -168
  311. package/dist/src/utils/crontab.js.map +0 -1
  312. package/dist/src/utils/execution-history.d.ts +0 -54
  313. package/dist/src/utils/execution-history.d.ts.map +0 -1
  314. package/dist/src/utils/execution-history.js +0 -80
  315. package/dist/src/utils/execution-history.js.map +0 -1
  316. package/dist/src/utils/github.d.ts +0 -40
  317. package/dist/src/utils/github.d.ts.map +0 -1
  318. package/dist/src/utils/github.js +0 -126
  319. package/dist/src/utils/github.js.map +0 -1
  320. package/dist/src/utils/notify.d.ts +0 -64
  321. package/dist/src/utils/notify.d.ts.map +0 -1
  322. package/dist/src/utils/notify.js +0 -405
  323. package/dist/src/utils/notify.js.map +0 -1
  324. package/dist/src/utils/prd-states.d.ts +0 -16
  325. package/dist/src/utils/prd-states.d.ts.map +0 -1
  326. package/dist/src/utils/prd-states.js +0 -28
  327. package/dist/src/utils/prd-states.js.map +0 -1
  328. package/dist/src/utils/registry.d.ts +0 -45
  329. package/dist/src/utils/registry.d.ts.map +0 -1
  330. package/dist/src/utils/registry.js +0 -86
  331. package/dist/src/utils/registry.js.map +0 -1
  332. package/dist/src/utils/roadmap-parser.d.ts +0 -45
  333. package/dist/src/utils/roadmap-parser.d.ts.map +0 -1
  334. package/dist/src/utils/roadmap-parser.js +0 -136
  335. package/dist/src/utils/roadmap-parser.js.map +0 -1
  336. package/dist/src/utils/roadmap-scanner.d.ts +0 -92
  337. package/dist/src/utils/roadmap-scanner.d.ts.map +0 -1
  338. package/dist/src/utils/roadmap-scanner.js +0 -349
  339. package/dist/src/utils/roadmap-scanner.js.map +0 -1
  340. package/dist/src/utils/roadmap-state.d.ts +0 -90
  341. package/dist/src/utils/roadmap-state.d.ts.map +0 -1
  342. package/dist/src/utils/roadmap-state.js +0 -154
  343. package/dist/src/utils/roadmap-state.js.map +0 -1
  344. package/dist/src/utils/script-result.d.ts +0 -12
  345. package/dist/src/utils/script-result.d.ts.map +0 -1
  346. package/dist/src/utils/script-result.js +0 -46
  347. package/dist/src/utils/script-result.js.map +0 -1
  348. package/dist/src/utils/shell.d.ts +0 -27
  349. package/dist/src/utils/shell.d.ts.map +0 -1
  350. package/dist/src/utils/shell.js +0 -64
  351. package/dist/src/utils/shell.js.map +0 -1
  352. package/dist/src/utils/status-data.d.ts +0 -148
  353. package/dist/src/utils/status-data.d.ts.map +0 -1
  354. package/dist/src/utils/status-data.js +0 -548
  355. package/dist/src/utils/status-data.js.map +0 -1
  356. package/dist/src/utils/ui.d.ts +0 -55
  357. package/dist/src/utils/ui.d.ts.map +0 -1
  358. package/dist/src/utils/ui.js +0 -121
  359. package/dist/src/utils/ui.js.map +0 -1
  360. package/scripts/night-watch-audit-cron.sh +0 -165
  361. package/scripts/night-watch-cron.sh +0 -484
  362. package/scripts/night-watch-helpers.sh +0 -499
  363. package/scripts/night-watch-pr-reviewer-cron.sh +0 -528
  364. package/scripts/night-watch-qa-cron.sh +0 -281
  365. package/scripts/night-watch-slicer-cron.sh +0 -90
  366. package/scripts/test-helpers.bats +0 -77
  367. package/templates/night-watch-audit.md +0 -87
  368. package/templates/night-watch-pr-reviewer.md +0 -174
  369. package/templates/night-watch-qa.md +0 -157
  370. package/templates/night-watch-slicer.md +0 -219
  371. package/templates/night-watch.config.json +0 -30
  372. package/templates/night-watch.md +0 -94
  373. package/templates/prd-executor.md +0 -235
  374. package/templates/prd.md +0 -26
  375. package/web/dist/assets/index-BiJf9LFT.js +0 -458
  376. package/web/dist/assets/index-OpSgvsYu.css +0 -1
  377. package/web/dist/avatars/carlos.webp +0 -0
  378. package/web/dist/avatars/dev.webp +0 -0
  379. package/web/dist/avatars/maya.webp +0 -0
  380. package/web/dist/avatars/priya.webp +0 -0
  381. package/web/dist/index.html +0 -82
  382. /package/dist/{src/commands → commands}/dashboard/tab-actions.d.ts +0 -0
  383. /package/dist/{src/commands → commands}/dashboard/tab-actions.js +0 -0
  384. /package/dist/{src/commands → commands}/dashboard/types.js +0 -0
@@ -1,499 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Night Watch helper functions — shared by cron scripts.
3
- # Source this file, don't execute it directly.
4
-
5
- # ── Provider validation ───────────────────────────────────────────────────────
6
-
7
- # Validates that the provider command is supported.
8
- # Returns 0 if valid, 1 if unknown.
9
- # Supported providers: claude, codex
10
- validate_provider() {
11
- local provider="${1:?provider required}"
12
- case "${provider}" in
13
- claude|codex)
14
- return 0
15
- ;;
16
- *)
17
- return 1
18
- ;;
19
- esac
20
- }
21
-
22
- # Resolve a usable night-watch CLI binary for nested script calls.
23
- # Resolution order:
24
- # 1) NW_CLI_BIN from parent environment (absolute path set by installer/runtime)
25
- # 2) `night-watch` found in PATH
26
- # 3) bundled bin path next to scripts/ in this package checkout/install
27
- resolve_night_watch_cli() {
28
- if [ -n "${NW_CLI_BIN:-}" ] && [ -x "${NW_CLI_BIN}" ]; then
29
- printf "%s" "${NW_CLI_BIN}"
30
- return 0
31
- fi
32
-
33
- if command -v night-watch >/dev/null 2>&1; then
34
- printf "%s" "night-watch"
35
- return 0
36
- fi
37
-
38
- local script_dir
39
- if [ -n "${SCRIPT_DIR:-}" ]; then
40
- script_dir="${SCRIPT_DIR}"
41
- else
42
- script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
43
- fi
44
-
45
- local bundled_bin="${script_dir}/../bin/night-watch.mjs"
46
- if [ -x "${bundled_bin}" ]; then
47
- printf "%s" "${bundled_bin}"
48
- return 0
49
- fi
50
-
51
- return 1
52
- }
53
-
54
- night_watch_history() {
55
- local cli_bin
56
- cli_bin=$(resolve_night_watch_cli) || return 127
57
- "${cli_bin}" history "$@"
58
- }
59
-
60
- # ── Logging ──────────────────────────────────────────────────────────────────
61
-
62
- log() {
63
- local log_file="${LOG_FILE:?LOG_FILE not set}"
64
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >> "${log_file}"
65
- }
66
-
67
- # ── Log rotation ─────────────────────────────────────────────────────────────
68
-
69
- rotate_log() {
70
- local log_file="${LOG_FILE:?LOG_FILE not set}"
71
- local max_size="${MAX_LOG_SIZE:-524288}"
72
-
73
- if [ -f "${log_file}" ] && [ "$(stat -c%s "${log_file}" 2>/dev/null || echo 0)" -gt "${max_size}" ]; then
74
- mv "${log_file}" "${log_file}.old"
75
- fi
76
- }
77
-
78
- # ── Lock management ──────────────────────────────────────────────────────────
79
-
80
- project_runtime_key() {
81
- local project_dir="${1:?project_dir required}"
82
- local project_name
83
- local project_hash=""
84
- project_name=$(basename "${project_dir}")
85
-
86
- if command -v sha1sum >/dev/null 2>&1; then
87
- project_hash=$(printf '%s' "${project_dir}" | sha1sum | awk '{print $1}')
88
- elif command -v shasum >/dev/null 2>&1; then
89
- project_hash=$(printf '%s' "${project_dir}" | shasum -a 1 | awk '{print $1}')
90
- elif command -v openssl >/dev/null 2>&1; then
91
- project_hash=$(printf '%s' "${project_dir}" | openssl sha1 | awk '{print $NF}')
92
- else
93
- return 1
94
- fi
95
-
96
- printf '%s-%s' "${project_name}" "${project_hash:0:12}"
97
- }
98
-
99
- acquire_lock() {
100
- local lock_file="${1:?lock_file required}"
101
-
102
- if [ -f "${lock_file}" ]; then
103
- local lock_pid
104
- lock_pid=$(cat "${lock_file}" 2>/dev/null || echo "")
105
- if [ -n "${lock_pid}" ] && kill -0 "${lock_pid}" 2>/dev/null; then
106
- log "SKIP: Previous run (PID ${lock_pid}) still active"
107
- return 1
108
- fi
109
- log "WARN: Stale lock file found (PID ${lock_pid}), removing"
110
- rm -f "${lock_file}"
111
- fi
112
-
113
- trap "rm -f '${lock_file}'" EXIT
114
- echo $$ > "${lock_file}"
115
- return 0
116
- }
117
-
118
- # ── Detect default branch ───────────────────────────────────────────────────
119
-
120
- get_branch_tip_timestamp() {
121
- local project_dir="${1:?project_dir required}"
122
- local branch="${2:?branch required}"
123
- local remote_ts=""
124
- local local_ts=""
125
- local latest_ts=""
126
-
127
- remote_ts=$(git -C "${project_dir}" log -1 --format=%ct "refs/remotes/origin/${branch}" 2>/dev/null || true)
128
- local_ts=$(git -C "${project_dir}" log -1 --format=%ct "refs/heads/${branch}" 2>/dev/null || true)
129
-
130
- if [ -n "${remote_ts}" ]; then
131
- latest_ts="${remote_ts}"
132
- fi
133
- if [ -n "${local_ts}" ] && { [ -z "${latest_ts}" ] || [ "${local_ts}" -gt "${latest_ts}" ]; }; then
134
- latest_ts="${local_ts}"
135
- fi
136
-
137
- printf "%s" "${latest_ts}"
138
- }
139
-
140
- detect_default_branch() {
141
- local project_dir="${1:?project_dir required}"
142
- local main_ts=""
143
- local master_ts=""
144
- local remote_head=""
145
-
146
- main_ts=$(get_branch_tip_timestamp "${project_dir}" "main")
147
- master_ts=$(get_branch_tip_timestamp "${project_dir}" "master")
148
-
149
- if [ -n "${main_ts}" ] && [ -n "${master_ts}" ]; then
150
- if [ "${main_ts}" -ge "${master_ts}" ]; then
151
- echo "main"
152
- else
153
- echo "master"
154
- fi
155
- return 0
156
- fi
157
-
158
- if [ -n "${main_ts}" ]; then
159
- echo "main"
160
- return 0
161
- fi
162
-
163
- if [ -n "${master_ts}" ]; then
164
- echo "master"
165
- return 0
166
- fi
167
-
168
- remote_head=$(git -C "${project_dir}" symbolic-ref refs/remotes/origin/HEAD 2>/dev/null \
169
- | sed 's@^refs/remotes/origin/@@' || true)
170
- if [ -n "${remote_head}" ]; then
171
- echo "${remote_head}"
172
- return 0
173
- fi
174
-
175
- echo "main"
176
- }
177
-
178
- # ── Claim management ─────────────────────────────────────────────────────────
179
-
180
- claim_prd() {
181
- local prd_dir="${1:?prd_dir required}"
182
- local prd_file="${2:?prd_file required}"
183
- local claim_file="${prd_dir}/${prd_file}.claim"
184
-
185
- printf '{"timestamp":%d,"hostname":"%s","pid":%d}\n' \
186
- "$(date +%s)" "$(hostname)" "$$" > "${claim_file}"
187
- }
188
-
189
- release_claim() {
190
- local prd_dir="${1:?prd_dir required}"
191
- local prd_file="${2:?prd_file required}"
192
- local claim_file="${prd_dir}/${prd_file}.claim"
193
-
194
- rm -f "${claim_file}"
195
- }
196
-
197
- is_claimed() {
198
- local prd_dir="${1:?prd_dir required}"
199
- local prd_file="${2:?prd_file required}"
200
- local max_runtime="${3:-7200}"
201
- local claim_file="${prd_dir}/${prd_file}.claim"
202
-
203
- if [ ! -f "${claim_file}" ]; then
204
- return 1
205
- fi
206
-
207
- local claim_ts
208
- claim_ts=$(grep -o '"timestamp":[0-9]*' "${claim_file}" 2>/dev/null | grep -o '[0-9]*' || echo "0")
209
- local now
210
- now=$(date +%s)
211
- local age=$(( now - claim_ts ))
212
-
213
- if [ "${age}" -lt "${max_runtime}" ]; then
214
- return 0 # actively claimed
215
- else
216
- # Stale claim — remove it
217
- rm -f "${claim_file}"
218
- return 1
219
- fi
220
- }
221
-
222
- # ── Find next eligible PRD ───────────────────────────────────────────────────
223
-
224
- find_eligible_prd() {
225
- local prd_dir="${1:?prd_dir required}"
226
- local max_runtime="${2:-7200}"
227
- local project_dir="${3:-}"
228
- local done_dir="${prd_dir}/done"
229
-
230
- local prd_files
231
- prd_files=$(find "${prd_dir}" -maxdepth 1 -name '*.md' ! -name 'NIGHT-WATCH-SUMMARY.md' -type f 2>/dev/null | sort)
232
-
233
- if [ -z "${prd_files}" ]; then
234
- return 0
235
- fi
236
-
237
- # Apply priority ordering if NW_PRD_PRIORITY is set (colon-separated PRD names)
238
- if [ -n "${NW_PRD_PRIORITY:-}" ]; then
239
- local ordered=""
240
- IFS=':' read -ra prio_list <<< "${NW_PRD_PRIORITY}"
241
- for pname in "${prio_list[@]}"; do
242
- local match
243
- match=$(echo "${prd_files}" | grep "/${pname}\.md$" || true)
244
- if [ -n "${match}" ]; then
245
- ordered="${ordered}${match}"$'\n'
246
- fi
247
- done
248
- # Append remaining files not in priority list
249
- while IFS= read -r pf; do
250
- if [ -n "${pf}" ] && ! echo "${ordered}" | grep -qF "${pf}"; then
251
- ordered="${ordered}${pf}"$'\n'
252
- fi
253
- done <<< "${prd_files}"
254
- prd_files=$(echo "${ordered}" | sed '/^$/d')
255
- fi
256
-
257
- local open_branches
258
- open_branches=$(gh pr list --state open --json headRefName --jq '.[].headRefName' 2>/dev/null || echo "")
259
-
260
- for prd_path in ${prd_files}; do
261
- local prd_file
262
- prd_file=$(basename "${prd_path}")
263
- local prd_name="${prd_file%.md}"
264
-
265
- # Skip if claimed by another process
266
- if is_claimed "${prd_dir}" "${prd_file}" "${max_runtime}"; then
267
- log "SKIP-PRD: ${prd_file} — claimed by another process"
268
- continue
269
- fi
270
-
271
- # Skip if in cooldown after a recent failure (checked via execution history ledger)
272
- if [ -n "${project_dir}" ] && night_watch_history check "${project_dir}" "${prd_file}" --cooldown "${max_runtime}" 2>/dev/null; then
273
- log "SKIP-PRD: ${prd_file} — in cooldown after recent failure"
274
- continue
275
- fi
276
-
277
- # Skip if a PR already exists for this PRD
278
- if echo "${open_branches}" | grep -qF "${prd_name}"; then
279
- log "SKIP-PRD: ${prd_file} — open PR already exists"
280
- continue
281
- fi
282
-
283
- # Check dependencies
284
- local depends_on
285
- depends_on=$(grep -i 'depends on' "${prd_path}" 2>/dev/null \
286
- | head -1 \
287
- | grep -oP '[a-z0-9_-]+\.md' || echo "")
288
- if [ -n "${depends_on}" ]; then
289
- local dep_met=true
290
- for dep_file in ${depends_on}; do
291
- if [ ! -f "${done_dir}/${dep_file}" ]; then
292
- log "SKIP-PRD: ${prd_file} — unmet dependency: ${dep_file}"
293
- dep_met=false
294
- break
295
- fi
296
- done
297
- if [ "${dep_met}" = false ]; then
298
- continue
299
- fi
300
- fi
301
-
302
- echo "${prd_file}"
303
- return 0
304
- done
305
- }
306
-
307
- # ── Clean up worktrees ───────────────────────────────────────────────────────
308
- # Removes night-watch worktrees for this project.
309
- # Optional second argument narrows cleanup to worktrees containing that token.
310
- # This prevents parallel reviewer workers from deleting each other's worktrees.
311
-
312
- cleanup_worktrees() {
313
- local project_dir="${1:?project_dir required}"
314
- local scope="${2:-}"
315
- local project_name
316
- project_name=$(basename "${project_dir}")
317
-
318
- local match_token="${project_name}-nw"
319
- if [ -n "${scope}" ]; then
320
- match_token="${scope}"
321
- fi
322
-
323
- git -C "${project_dir}" worktree list --porcelain 2>/dev/null \
324
- | grep '^worktree ' \
325
- | awk '{print $2}' \
326
- | grep -F "${match_token}" \
327
- | while read -r wt; do
328
- log "CLEANUP: Removing leftover worktree ${wt}"
329
- git -C "${project_dir}" worktree remove --force "${wt}" 2>/dev/null || true
330
- done || true
331
- }
332
-
333
- # Pick the best available ref for creating a new detached worktree.
334
- resolve_worktree_base_ref() {
335
- local project_dir="${1:?project_dir required}"
336
- local default_branch="${2:?default_branch required}"
337
-
338
- if git -C "${project_dir}" rev-parse --verify --quiet "refs/remotes/origin/${default_branch}" >/dev/null; then
339
- printf "%s" "origin/${default_branch}"
340
- return 0
341
- fi
342
-
343
- if git -C "${project_dir}" rev-parse --verify --quiet "refs/heads/${default_branch}" >/dev/null; then
344
- printf "%s" "${default_branch}"
345
- return 0
346
- fi
347
-
348
- if git -C "${project_dir}" rev-parse --verify --quiet "refs/remotes/origin/HEAD" >/dev/null; then
349
- printf "%s" "origin/HEAD"
350
- return 0
351
- fi
352
-
353
- return 1
354
- }
355
-
356
- # Create an isolated worktree on a branch without checking out that branch
357
- # in the user's current project directory.
358
- prepare_branch_worktree() {
359
- local project_dir="${1:?project_dir required}"
360
- local worktree_dir="${2:?worktree_dir required}"
361
- local branch_name="${3:?branch_name required}"
362
- local default_branch="${4:?default_branch required}"
363
- local log_file="${5:-${LOG_FILE:-/dev/null}}"
364
- local base_ref=""
365
-
366
- git -C "${project_dir}" fetch origin "${default_branch}" >> "${log_file}" 2>&1 || true
367
- base_ref=$(resolve_worktree_base_ref "${project_dir}" "${default_branch}") || return 1
368
-
369
- if git -C "${project_dir}" rev-parse --verify --quiet "refs/heads/${branch_name}" >/dev/null; then
370
- git -C "${project_dir}" worktree add "${worktree_dir}" "${branch_name}" >> "${log_file}" 2>&1
371
- return $?
372
- fi
373
-
374
- if git -C "${project_dir}" rev-parse --verify --quiet "refs/remotes/origin/${branch_name}" >/dev/null; then
375
- git -C "${project_dir}" worktree add -b "${branch_name}" "${worktree_dir}" "origin/${branch_name}" >> "${log_file}" 2>&1
376
- return $?
377
- fi
378
-
379
- git -C "${project_dir}" worktree add -b "${branch_name}" "${worktree_dir}" "${base_ref}" >> "${log_file}" 2>&1
380
- }
381
-
382
- # Create an isolated detached worktree (useful for reviewer/controller flows).
383
- prepare_detached_worktree() {
384
- local project_dir="${1:?project_dir required}"
385
- local worktree_dir="${2:?worktree_dir required}"
386
- local default_branch="${3:?default_branch required}"
387
- local log_file="${4:-${LOG_FILE:-/dev/null}}"
388
- local base_ref=""
389
-
390
- git -C "${project_dir}" fetch origin "${default_branch}" >> "${log_file}" 2>&1 || true
391
- base_ref=$(resolve_worktree_base_ref "${project_dir}" "${default_branch}") || return 1
392
-
393
- git -C "${project_dir}" worktree add --detach "${worktree_dir}" "${base_ref}" >> "${log_file}" 2>&1
394
- }
395
-
396
- # ── Mark PRD as done ─────────────────────────────────────────────────────────
397
-
398
- mark_prd_done() {
399
- local prd_dir="${1:?prd_dir required}"
400
- local prd_file="${2:?prd_file required}"
401
- local done_dir="${prd_dir}/done"
402
-
403
- mkdir -p "${done_dir}"
404
-
405
- if [ -f "${prd_dir}/${prd_file}" ]; then
406
- mv "${prd_dir}/${prd_file}" "${done_dir}/${prd_file}"
407
- log "DONE-PRD: Moved ${prd_file} to done/"
408
- return 0
409
- else
410
- log "WARN: PRD file not found: ${prd_dir}/${prd_file}"
411
- return 1
412
- fi
413
- }
414
-
415
- # ── Rate limit detection ────────────────────────────────────────────────────
416
-
417
- # Check if the log contains a 429 rate limit error since a given line number.
418
- # Usage: check_rate_limited <log_file> [start_line]
419
- # When start_line is provided, only lines after that position are checked,
420
- # preventing false positives from 429 errors in previous runs.
421
- # Returns 0 if rate limited, 1 otherwise.
422
- check_rate_limited() {
423
- local log_file="${1:?log_file required}"
424
- local start_line="${2:-0}"
425
- if [ "${start_line}" -gt 0 ] 2>/dev/null; then
426
- tail -n "+$((start_line + 1))" "${log_file}" 2>/dev/null | grep -q "429"
427
- else
428
- tail -20 "${log_file}" 2>/dev/null | grep -q "429"
429
- fi
430
- }
431
-
432
- # Send an immediate Telegram warning when the rate-limit fallback is triggered.
433
- # Preferred input: NW_TELEGRAM_RATE_LIMIT_WEBHOOKS (JSON array with botToken/chatId).
434
- # Legacy fallback: NW_TELEGRAM_BOT_TOKEN + NW_TELEGRAM_CHAT_ID.
435
- # Usage: send_rate_limit_fallback_warning <model> <project_name>
436
- send_rate_limit_fallback_warning() {
437
- local model="${1:-native Claude}"
438
- local project_name="${2:-unknown}"
439
- local msg="⚠️ Rate Limit Fallback
440
-
441
- Project: ${project_name}
442
- Proxy quota exhausted - falling back to native Claude (${model})"
443
-
444
- # Preferred path: iterate all opted-in Telegram webhooks.
445
- if [ -n "${NW_TELEGRAM_RATE_LIMIT_WEBHOOKS:-}" ] && command -v jq >/dev/null 2>&1; then
446
- local sent=0
447
- local webhook_json
448
- while IFS= read -r webhook_json; do
449
- [ -z "${webhook_json}" ] && continue
450
- local bot_token
451
- local chat_id
452
- bot_token=$(printf '%s' "${webhook_json}" | jq -r '.botToken // empty' 2>/dev/null || true)
453
- chat_id=$(printf '%s' "${webhook_json}" | jq -r '.chatId // empty' 2>/dev/null || true)
454
- if [ -n "${bot_token}" ] && [ -n "${chat_id}" ]; then
455
- curl -s -X POST "https://api.telegram.org/bot${bot_token}/sendMessage" \
456
- --data-urlencode "chat_id=${chat_id}" \
457
- --data-urlencode "text=${msg}" > /dev/null 2>&1 || true
458
- sent=1
459
- fi
460
- done < <(printf '%s' "${NW_TELEGRAM_RATE_LIMIT_WEBHOOKS}" | jq -c '.[]?' 2>/dev/null || true)
461
-
462
- if [ "${sent}" -eq 1 ]; then
463
- return 0
464
- fi
465
- fi
466
-
467
- # Legacy single-webhook fallback.
468
- if [ -z "${NW_TELEGRAM_BOT_TOKEN:-}" ] || [ -z "${NW_TELEGRAM_CHAT_ID:-}" ]; then
469
- return 0
470
- fi
471
- curl -s -X POST "https://api.telegram.org/bot${NW_TELEGRAM_BOT_TOKEN}/sendMessage" \
472
- --data-urlencode "chat_id=${NW_TELEGRAM_CHAT_ID}" \
473
- --data-urlencode "text=${msg}" > /dev/null 2>&1 || true
474
- }
475
-
476
- # ── Board mode issue discovery ────────────────────────────────────────────────
477
-
478
- # Get the next eligible issue from the board provider.
479
- # Prints the JSON of the first "Ready" issue to stdout, or nothing if none found.
480
- # Returns 0 on success, 1 if no issue found or CLI unavailable.
481
- find_eligible_board_issue() {
482
- local cli_bin
483
- cli_bin=$(resolve_night_watch_cli) || {
484
- log "WARN: Cannot find night-watch CLI for board mode"
485
- return 1
486
- }
487
- local result
488
- result=$("${cli_bin}" board next-issue --column "Ready" --json 2>/dev/null) || true
489
- if [ -z "${result}" ]; then
490
- return 1
491
- fi
492
- # Require valid JSON with an issue number to avoid treating plain text output
493
- # as a runnable board issue.
494
- if ! printf '%s' "${result}" | jq -e '.number and (.number | type == "number")' >/dev/null 2>&1; then
495
- return 1
496
- fi
497
- printf '%s' "${result}"
498
- return 0
499
- }