@jonit-dev/night-watch-cli 1.7.29 → 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.
- package/bin/night-watch.mjs +1 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/{src/cli.js → cli.js} +1 -0
- package/dist/cli.js.map +1 -0
- package/dist/{src/commands → commands}/audit.d.ts +2 -2
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +105 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/{src/commands → commands}/board.d.ts +1 -1
- package/dist/commands/board.d.ts.map +1 -0
- package/dist/commands/board.js +664 -0
- package/dist/commands/board.js.map +1 -0
- package/dist/{src/commands → commands}/cancel.d.ts +3 -3
- package/dist/commands/cancel.d.ts.map +1 -0
- package/dist/{src/commands → commands}/cancel.js +18 -20
- package/dist/commands/cancel.js.map +1 -0
- package/dist/commands/dashboard/tab-actions.d.ts.map +1 -0
- package/dist/commands/dashboard/tab-actions.js.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-config.d.ts +3 -3
- package/dist/commands/dashboard/tab-config.d.ts.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-config.js +250 -187
- package/dist/commands/dashboard/tab-config.js.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-logs.d.ts +1 -1
- package/dist/commands/dashboard/tab-logs.d.ts.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-logs.js +62 -38
- package/dist/commands/dashboard/tab-logs.js.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-schedules.d.ts +1 -1
- package/dist/commands/dashboard/tab-schedules.d.ts.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-schedules.js +85 -76
- package/dist/commands/dashboard/tab-schedules.js.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-status.d.ts +7 -7
- package/dist/commands/dashboard/tab-status.d.ts.map +1 -0
- package/dist/{src/commands → commands}/dashboard/tab-status.js +98 -95
- package/dist/commands/dashboard/tab-status.js.map +1 -0
- package/dist/{src/commands → commands}/dashboard/types.d.ts +3 -4
- package/dist/commands/dashboard/types.d.ts.map +1 -0
- package/dist/commands/dashboard/types.js.map +1 -0
- package/dist/{src/commands → commands}/dashboard.d.ts +2 -2
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/{src/commands → commands}/dashboard.js +32 -33
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/{src/commands → commands}/doctor.d.ts +2 -2
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/{src/commands → commands}/doctor.js +40 -43
- package/dist/commands/doctor.js.map +1 -0
- package/dist/{src/commands → commands}/history.d.ts +1 -1
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/{src/commands → commands}/history.js +11 -18
- package/dist/commands/history.js.map +1 -0
- package/dist/{src/commands → commands}/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/{src/commands → commands}/init.js +62 -36
- package/dist/commands/init.js.map +1 -0
- package/dist/{src/commands → commands}/install.d.ts +2 -2
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/{src/commands → commands}/install.js +48 -50
- package/dist/commands/install.js.map +1 -0
- package/dist/{src/commands → commands}/logs.d.ts +1 -1
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/{src/commands → commands}/logs.js +29 -30
- package/dist/commands/logs.js.map +1 -0
- package/dist/{src/commands → commands}/prd-state.d.ts +1 -1
- package/dist/commands/prd-state.d.ts.map +1 -0
- package/dist/{src/commands → commands}/prd-state.js +14 -14
- package/dist/commands/prd-state.js.map +1 -0
- package/dist/{src/commands → commands}/prd.d.ts +1 -1
- package/dist/commands/prd.d.ts.map +1 -0
- package/dist/{src/commands → commands}/prd.js +57 -66
- package/dist/commands/prd.js.map +1 -0
- package/dist/{src/commands → commands}/prds.d.ts +1 -1
- package/dist/commands/prds.d.ts.map +1 -0
- package/dist/{src/commands → commands}/prds.js +51 -53
- package/dist/commands/prds.js.map +1 -0
- package/dist/{src/commands → commands}/prs.d.ts +1 -1
- package/dist/commands/prs.d.ts.map +1 -0
- package/dist/{src/commands → commands}/prs.js +22 -24
- package/dist/commands/prs.js.map +1 -0
- package/dist/{src/commands → commands}/qa.d.ts +2 -2
- package/dist/commands/qa.d.ts.map +1 -0
- package/dist/{src/commands → commands}/qa.js +50 -51
- package/dist/commands/qa.js.map +1 -0
- package/dist/{src/commands → commands}/retry.d.ts +1 -1
- package/dist/commands/retry.d.ts.map +1 -0
- package/dist/{src/commands → commands}/retry.js +9 -10
- package/dist/commands/retry.js.map +1 -0
- package/dist/{src/commands → commands}/review.d.ts +2 -2
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/{src/commands → commands}/review.js +68 -59
- package/dist/commands/review.js.map +1 -0
- package/dist/{src/commands → commands}/run.d.ts +2 -2
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/{src/commands → commands}/run.js +87 -83
- package/dist/commands/run.js.map +1 -0
- package/dist/{src/commands → commands}/serve.d.ts +2 -2
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/{src/commands → commands}/serve.js +18 -18
- package/dist/commands/serve.js.map +1 -0
- package/dist/{src/commands → commands}/slice.d.ts +2 -2
- package/dist/commands/slice.d.ts.map +1 -0
- package/dist/{src/commands → commands}/slice.js +50 -46
- package/dist/commands/slice.js.map +1 -0
- package/dist/{src/commands → commands}/state.d.ts +1 -1
- package/dist/commands/state.d.ts.map +1 -0
- package/dist/{src/commands → commands}/state.js +20 -22
- package/dist/commands/state.js.map +1 -0
- package/dist/{src/commands → commands}/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/{src/commands → commands}/status.js +75 -54
- package/dist/commands/status.js.map +1 -0
- package/dist/{src/commands → commands}/uninstall.d.ts +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/{src/commands → commands}/uninstall.js +12 -14
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/{src/commands → commands}/update.d.ts +1 -1
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/{src/commands → commands}/update.js +23 -23
- package/dist/commands/update.js.map +1 -0
- package/package.json +18 -42
- package/LICENSE +0 -21
- package/README.md +0 -132
- package/dist/shared/types.d.ts +0 -226
- package/dist/shared/types.d.ts.map +0 -1
- package/dist/shared/types.js +0 -7
- package/dist/shared/types.js.map +0 -1
- package/dist/src/agents/soul-compiler.d.ts +0 -11
- package/dist/src/agents/soul-compiler.d.ts.map +0 -1
- package/dist/src/agents/soul-compiler.js +0 -157
- package/dist/src/agents/soul-compiler.js.map +0 -1
- package/dist/src/board/factory.d.ts +0 -3
- package/dist/src/board/factory.d.ts.map +0 -1
- package/dist/src/board/factory.js +0 -10
- package/dist/src/board/factory.js.map +0 -1
- package/dist/src/board/providers/github-graphql.d.ts +0 -16
- package/dist/src/board/providers/github-graphql.d.ts.map +0 -1
- package/dist/src/board/providers/github-graphql.js +0 -43
- package/dist/src/board/providers/github-graphql.js.map +0 -1
- package/dist/src/board/providers/github-projects.d.ts +0 -51
- package/dist/src/board/providers/github-projects.d.ts.map +0 -1
- package/dist/src/board/providers/github-projects.js +0 -672
- package/dist/src/board/providers/github-projects.js.map +0 -1
- package/dist/src/board/types.d.ts +0 -60
- package/dist/src/board/types.d.ts.map +0 -1
- package/dist/src/board/types.js +0 -4
- package/dist/src/board/types.js.map +0 -1
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js.map +0 -1
- package/dist/src/commands/audit.d.ts.map +0 -1
- package/dist/src/commands/audit.js +0 -98
- package/dist/src/commands/audit.js.map +0 -1
- package/dist/src/commands/board.d.ts.map +0 -1
- package/dist/src/commands/board.js +0 -294
- package/dist/src/commands/board.js.map +0 -1
- package/dist/src/commands/cancel.d.ts.map +0 -1
- package/dist/src/commands/cancel.js.map +0 -1
- package/dist/src/commands/dashboard/tab-actions.d.ts.map +0 -1
- package/dist/src/commands/dashboard/tab-actions.js.map +0 -1
- package/dist/src/commands/dashboard/tab-config.d.ts.map +0 -1
- package/dist/src/commands/dashboard/tab-config.js.map +0 -1
- package/dist/src/commands/dashboard/tab-logs.d.ts.map +0 -1
- package/dist/src/commands/dashboard/tab-logs.js.map +0 -1
- package/dist/src/commands/dashboard/tab-schedules.d.ts.map +0 -1
- package/dist/src/commands/dashboard/tab-schedules.js.map +0 -1
- package/dist/src/commands/dashboard/tab-status.d.ts.map +0 -1
- package/dist/src/commands/dashboard/tab-status.js.map +0 -1
- package/dist/src/commands/dashboard/types.d.ts.map +0 -1
- package/dist/src/commands/dashboard/types.js.map +0 -1
- package/dist/src/commands/dashboard.d.ts.map +0 -1
- package/dist/src/commands/dashboard.js.map +0 -1
- package/dist/src/commands/doctor.d.ts.map +0 -1
- package/dist/src/commands/doctor.js.map +0 -1
- package/dist/src/commands/history.d.ts.map +0 -1
- package/dist/src/commands/history.js.map +0 -1
- package/dist/src/commands/init.d.ts.map +0 -1
- package/dist/src/commands/init.js.map +0 -1
- package/dist/src/commands/install.d.ts.map +0 -1
- package/dist/src/commands/install.js.map +0 -1
- package/dist/src/commands/logs.d.ts.map +0 -1
- package/dist/src/commands/logs.js.map +0 -1
- package/dist/src/commands/prd-state.d.ts.map +0 -1
- package/dist/src/commands/prd-state.js.map +0 -1
- package/dist/src/commands/prd.d.ts.map +0 -1
- package/dist/src/commands/prd.js.map +0 -1
- package/dist/src/commands/prds.d.ts.map +0 -1
- package/dist/src/commands/prds.js.map +0 -1
- package/dist/src/commands/prs.d.ts.map +0 -1
- package/dist/src/commands/prs.js.map +0 -1
- package/dist/src/commands/qa.d.ts.map +0 -1
- package/dist/src/commands/qa.js.map +0 -1
- package/dist/src/commands/retry.d.ts.map +0 -1
- package/dist/src/commands/retry.js.map +0 -1
- package/dist/src/commands/review.d.ts.map +0 -1
- package/dist/src/commands/review.js.map +0 -1
- package/dist/src/commands/run.d.ts.map +0 -1
- package/dist/src/commands/run.js.map +0 -1
- package/dist/src/commands/serve.d.ts.map +0 -1
- package/dist/src/commands/serve.js.map +0 -1
- package/dist/src/commands/slice.d.ts.map +0 -1
- package/dist/src/commands/slice.js.map +0 -1
- package/dist/src/commands/state.d.ts.map +0 -1
- package/dist/src/commands/state.js.map +0 -1
- package/dist/src/commands/status.d.ts.map +0 -1
- package/dist/src/commands/status.js.map +0 -1
- package/dist/src/commands/uninstall.d.ts.map +0 -1
- package/dist/src/commands/uninstall.js.map +0 -1
- package/dist/src/commands/update.d.ts.map +0 -1
- package/dist/src/commands/update.js.map +0 -1
- package/dist/src/config.d.ts +0 -23
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -671
- package/dist/src/config.js.map +0 -1
- package/dist/src/constants.d.ts +0 -67
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js +0 -131
- package/dist/src/constants.js.map +0 -1
- package/dist/src/server/index.d.ts +0 -23
- package/dist/src/server/index.d.ts.map +0 -1
- package/dist/src/server/index.js +0 -1704
- package/dist/src/server/index.js.map +0 -1
- package/dist/src/slack/channel-manager.d.ts +0 -32
- package/dist/src/slack/channel-manager.d.ts.map +0 -1
- package/dist/src/slack/channel-manager.js +0 -128
- package/dist/src/slack/channel-manager.js.map +0 -1
- package/dist/src/slack/client.d.ts +0 -76
- package/dist/src/slack/client.d.ts.map +0 -1
- package/dist/src/slack/client.js +0 -193
- package/dist/src/slack/client.js.map +0 -1
- package/dist/src/slack/deliberation.d.ts +0 -87
- package/dist/src/slack/deliberation.d.ts.map +0 -1
- package/dist/src/slack/deliberation.js +0 -1354
- package/dist/src/slack/deliberation.js.map +0 -1
- package/dist/src/slack/index.d.ts +0 -6
- package/dist/src/slack/index.d.ts.map +0 -1
- package/dist/src/slack/index.js +0 -5
- package/dist/src/slack/index.js.map +0 -1
- package/dist/src/slack/interaction-listener.d.ts +0 -130
- package/dist/src/slack/interaction-listener.d.ts.map +0 -1
- package/dist/src/slack/interaction-listener.js +0 -1329
- package/dist/src/slack/interaction-listener.js.map +0 -1
- package/dist/src/storage/json-state-migrator.d.ts +0 -24
- package/dist/src/storage/json-state-migrator.d.ts.map +0 -1
- package/dist/src/storage/json-state-migrator.js +0 -197
- package/dist/src/storage/json-state-migrator.js.map +0 -1
- package/dist/src/storage/repositories/index.d.ts +0 -25
- package/dist/src/storage/repositories/index.d.ts.map +0 -1
- package/dist/src/storage/repositories/index.js +0 -45
- package/dist/src/storage/repositories/index.js.map +0 -1
- package/dist/src/storage/repositories/interfaces.d.ts +0 -60
- package/dist/src/storage/repositories/interfaces.d.ts.map +0 -1
- package/dist/src/storage/repositories/interfaces.js +0 -6
- package/dist/src/storage/repositories/interfaces.js.map +0 -1
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.d.ts +0 -33
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.d.ts.map +0 -1
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.js +0 -715
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.js.map +0 -1
- package/dist/src/storage/repositories/sqlite/execution-history-repository.d.ts +0 -21
- package/dist/src/storage/repositories/sqlite/execution-history-repository.d.ts.map +0 -1
- package/dist/src/storage/repositories/sqlite/execution-history-repository.js +0 -94
- package/dist/src/storage/repositories/sqlite/execution-history-repository.js.map +0 -1
- package/dist/src/storage/repositories/sqlite/prd-state-repository.d.ts +0 -17
- package/dist/src/storage/repositories/sqlite/prd-state-repository.d.ts.map +0 -1
- package/dist/src/storage/repositories/sqlite/prd-state-repository.js +0 -74
- package/dist/src/storage/repositories/sqlite/prd-state-repository.js.map +0 -1
- package/dist/src/storage/repositories/sqlite/project-registry-repository.d.ts +0 -17
- package/dist/src/storage/repositories/sqlite/project-registry-repository.d.ts.map +0 -1
- package/dist/src/storage/repositories/sqlite/project-registry-repository.js +0 -43
- package/dist/src/storage/repositories/sqlite/project-registry-repository.js.map +0 -1
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.d.ts +0 -14
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.d.ts.map +0 -1
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.js +0 -47
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.js.map +0 -1
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.d.ts +0 -20
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.d.ts.map +0 -1
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.js +0 -88
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.js.map +0 -1
- package/dist/src/storage/sqlite/client.d.ts +0 -23
- package/dist/src/storage/sqlite/client.d.ts.map +0 -1
- package/dist/src/storage/sqlite/client.js +0 -47
- package/dist/src/storage/sqlite/client.js.map +0 -1
- package/dist/src/storage/sqlite/migrations.d.ts +0 -11
- package/dist/src/storage/sqlite/migrations.d.ts.map +0 -1
- package/dist/src/storage/sqlite/migrations.js +0 -94
- package/dist/src/storage/sqlite/migrations.js.map +0 -1
- package/dist/src/templates/prd-template.d.ts +0 -11
- package/dist/src/templates/prd-template.d.ts.map +0 -1
- package/dist/src/templates/prd-template.js +0 -166
- package/dist/src/templates/prd-template.js.map +0 -1
- package/dist/src/templates/slicer-prompt.d.ts +0 -54
- package/dist/src/templates/slicer-prompt.d.ts.map +0 -1
- package/dist/src/templates/slicer-prompt.js +0 -163
- package/dist/src/templates/slicer-prompt.js.map +0 -1
- package/dist/src/types.d.ts +0 -140
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -5
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils/avatar-generator.d.ts +0 -6
- package/dist/src/utils/avatar-generator.d.ts.map +0 -1
- package/dist/src/utils/avatar-generator.js +0 -133
- package/dist/src/utils/avatar-generator.js.map +0 -1
- package/dist/src/utils/checks.d.ts +0 -55
- package/dist/src/utils/checks.d.ts.map +0 -1
- package/dist/src/utils/checks.js +0 -246
- package/dist/src/utils/checks.js.map +0 -1
- package/dist/src/utils/config-writer.d.ts +0 -16
- package/dist/src/utils/config-writer.d.ts.map +0 -1
- package/dist/src/utils/config-writer.js +0 -45
- package/dist/src/utils/config-writer.js.map +0 -1
- package/dist/src/utils/crontab.d.ts +0 -62
- package/dist/src/utils/crontab.d.ts.map +0 -1
- package/dist/src/utils/crontab.js +0 -168
- package/dist/src/utils/crontab.js.map +0 -1
- package/dist/src/utils/execution-history.d.ts +0 -54
- package/dist/src/utils/execution-history.d.ts.map +0 -1
- package/dist/src/utils/execution-history.js +0 -80
- package/dist/src/utils/execution-history.js.map +0 -1
- package/dist/src/utils/github.d.ts +0 -40
- package/dist/src/utils/github.d.ts.map +0 -1
- package/dist/src/utils/github.js +0 -126
- package/dist/src/utils/github.js.map +0 -1
- package/dist/src/utils/notify.d.ts +0 -64
- package/dist/src/utils/notify.d.ts.map +0 -1
- package/dist/src/utils/notify.js +0 -405
- package/dist/src/utils/notify.js.map +0 -1
- package/dist/src/utils/prd-states.d.ts +0 -16
- package/dist/src/utils/prd-states.d.ts.map +0 -1
- package/dist/src/utils/prd-states.js +0 -28
- package/dist/src/utils/prd-states.js.map +0 -1
- package/dist/src/utils/registry.d.ts +0 -45
- package/dist/src/utils/registry.d.ts.map +0 -1
- package/dist/src/utils/registry.js +0 -86
- package/dist/src/utils/registry.js.map +0 -1
- package/dist/src/utils/roadmap-parser.d.ts +0 -45
- package/dist/src/utils/roadmap-parser.d.ts.map +0 -1
- package/dist/src/utils/roadmap-parser.js +0 -136
- package/dist/src/utils/roadmap-parser.js.map +0 -1
- package/dist/src/utils/roadmap-scanner.d.ts +0 -92
- package/dist/src/utils/roadmap-scanner.d.ts.map +0 -1
- package/dist/src/utils/roadmap-scanner.js +0 -349
- package/dist/src/utils/roadmap-scanner.js.map +0 -1
- package/dist/src/utils/roadmap-state.d.ts +0 -90
- package/dist/src/utils/roadmap-state.d.ts.map +0 -1
- package/dist/src/utils/roadmap-state.js +0 -154
- package/dist/src/utils/roadmap-state.js.map +0 -1
- package/dist/src/utils/script-result.d.ts +0 -12
- package/dist/src/utils/script-result.d.ts.map +0 -1
- package/dist/src/utils/script-result.js +0 -46
- package/dist/src/utils/script-result.js.map +0 -1
- package/dist/src/utils/shell.d.ts +0 -27
- package/dist/src/utils/shell.d.ts.map +0 -1
- package/dist/src/utils/shell.js +0 -64
- package/dist/src/utils/shell.js.map +0 -1
- package/dist/src/utils/status-data.d.ts +0 -148
- package/dist/src/utils/status-data.d.ts.map +0 -1
- package/dist/src/utils/status-data.js +0 -548
- package/dist/src/utils/status-data.js.map +0 -1
- package/dist/src/utils/ui.d.ts +0 -55
- package/dist/src/utils/ui.d.ts.map +0 -1
- package/dist/src/utils/ui.js +0 -121
- package/dist/src/utils/ui.js.map +0 -1
- package/scripts/night-watch-audit-cron.sh +0 -149
- package/scripts/night-watch-cron.sh +0 -484
- package/scripts/night-watch-helpers.sh +0 -499
- package/scripts/night-watch-pr-reviewer-cron.sh +0 -528
- package/scripts/night-watch-qa-cron.sh +0 -281
- package/scripts/night-watch-slicer-cron.sh +0 -90
- package/scripts/test-helpers.bats +0 -77
- package/templates/night-watch-pr-reviewer.md +0 -174
- package/templates/night-watch-qa.md +0 -157
- package/templates/night-watch-slicer.md +0 -219
- package/templates/night-watch.config.json +0 -30
- package/templates/night-watch.md +0 -94
- package/templates/prd-executor.md +0 -235
- package/templates/prd.md +0 -26
- package/web/dist/assets/index-BiJf9LFT.js +0 -458
- package/web/dist/assets/index-OpSgvsYu.css +0 -1
- package/web/dist/avatars/carlos.webp +0 -0
- package/web/dist/avatars/dev.webp +0 -0
- package/web/dist/avatars/maya.webp +0 -0
- package/web/dist/avatars/priya.webp +0 -0
- package/web/dist/index.html +0 -82
- /package/dist/{src/commands → commands}/dashboard/tab-actions.d.ts +0 -0
- /package/dist/{src/commands → commands}/dashboard/tab-actions.js +0 -0
- /package/dist/{src/commands → commands}/dashboard/types.js +0 -0
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates persona avatars using Replicate's Flux 1.1 Pro model.
|
|
3
|
-
* Output URLs are valid for ~1 hour; Slack caches them on first display.
|
|
4
|
-
*/
|
|
5
|
-
export declare function generatePersonaAvatar(personaName: string, personaRole: string, apiToken: string): Promise<string | null>;
|
|
6
|
-
//# sourceMappingURL=avatar-generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-generator.d.ts","sourceRoot":"","sources":["../../../src/utils/avatar-generator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiGH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoExB"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates persona avatars using Replicate's Flux 1.1 Pro model.
|
|
3
|
-
* Output URLs are valid for ~1 hour; Slack caches them on first display.
|
|
4
|
-
*/
|
|
5
|
-
const REPLICATE_MODEL = 'black-forest-labs/flux-1.1-pro';
|
|
6
|
-
const POLL_INTERVAL_MS = 3_000;
|
|
7
|
-
const MAX_POLLS = 60; // 3 minutes max
|
|
8
|
-
function extractOutputUrl(output) {
|
|
9
|
-
if (!output)
|
|
10
|
-
return null;
|
|
11
|
-
return Array.isArray(output) ? (output[0] ?? null) : output;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Persona-specific portrait descriptions.
|
|
15
|
-
* Each persona gets a distinct, memorable appearance — not a generic stock photo.
|
|
16
|
-
*/
|
|
17
|
-
const PERSONA_PORTRAITS = {
|
|
18
|
-
maya: [
|
|
19
|
-
'South Asian woman in her late 20s with sharp dark eyes and straight black hair pulled back in a low ponytail',
|
|
20
|
-
'wearing a dark charcoal blazer over a plain black turtleneck',
|
|
21
|
-
'expression is focused and perceptive — the look of someone who notices details others miss',
|
|
22
|
-
'minimal jewelry, small silver stud earrings',
|
|
23
|
-
].join(', '),
|
|
24
|
-
carlos: [
|
|
25
|
-
'Hispanic man in his mid-30s with short dark wavy hair and a neatly trimmed beard',
|
|
26
|
-
'wearing a navy blue henley shirt with sleeves slightly pushed up',
|
|
27
|
-
'expression is calm and confident — easy authority, like someone used to making decisions',
|
|
28
|
-
'slight smile that reads more thoughtful than warm',
|
|
29
|
-
].join(', '),
|
|
30
|
-
priya: [
|
|
31
|
-
'Indian woman in her early 30s with shoulder-length dark brown hair with subtle highlights',
|
|
32
|
-
'wearing a soft olive green cardigan over a white crew-neck t-shirt',
|
|
33
|
-
'expression is alert and curious — bright eyes, slight head tilt, like she just thought of something interesting',
|
|
34
|
-
'round tortoiseshell glasses',
|
|
35
|
-
].join(', '),
|
|
36
|
-
dev: [
|
|
37
|
-
'East Asian man in his late 20s with short textured black hair styled casually',
|
|
38
|
-
'wearing a heather gray crewneck sweatshirt',
|
|
39
|
-
'expression is friendly and approachable — relaxed confidence, like someone in the middle of good work',
|
|
40
|
-
'clean-shaven, natural look',
|
|
41
|
-
].join(', '),
|
|
42
|
-
};
|
|
43
|
-
function buildAvatarPrompt(personaName, role) {
|
|
44
|
-
const nameKey = personaName.toLowerCase();
|
|
45
|
-
const personaDescription = PERSONA_PORTRAITS[nameKey];
|
|
46
|
-
if (personaDescription) {
|
|
47
|
-
return (`Professional headshot portrait photo of a ${personaDescription}, ` +
|
|
48
|
-
`photorealistic, clean soft neutral background, natural diffused window lighting, ` +
|
|
49
|
-
`shot at f/2.8, shallow depth of field, looking directly at camera, ` +
|
|
50
|
-
`candid professional headshot style, no retouching artifacts, natural skin texture`);
|
|
51
|
-
}
|
|
52
|
-
// Fallback for custom personas — generate based on role
|
|
53
|
-
const lower = role.toLowerCase();
|
|
54
|
-
let descriptor;
|
|
55
|
-
if (lower.includes('security')) {
|
|
56
|
-
descriptor = 'sharp-eyed cybersecurity professional with a serious and analytical expression, wearing a dark blazer';
|
|
57
|
-
}
|
|
58
|
-
else if (lower.includes('architect') || lower.includes('tech lead') || lower.includes('lead')) {
|
|
59
|
-
descriptor = 'confident senior software architect with a composed and thoughtful expression, business casual attire';
|
|
60
|
-
}
|
|
61
|
-
else if (lower.includes('qa') || lower.includes('quality')) {
|
|
62
|
-
descriptor = 'meticulous quality engineer with a focused and detail-oriented expression, smart casual attire';
|
|
63
|
-
}
|
|
64
|
-
else if (lower.includes('implement') || lower.includes('developer') || lower.includes('engineer')) {
|
|
65
|
-
descriptor = 'software developer with a creative and approachable expression, casual tech attire';
|
|
66
|
-
}
|
|
67
|
-
else if (lower.includes('product') || lower.includes('manager')) {
|
|
68
|
-
descriptor = 'product manager with a strategic and empathetic expression, business professional attire';
|
|
69
|
-
}
|
|
70
|
-
else if (lower.includes('design')) {
|
|
71
|
-
descriptor = 'UX/UI designer with a creative and innovative expression, modern stylish attire';
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
descriptor = 'professional software team member with a friendly and competent expression, smart casual attire';
|
|
75
|
-
}
|
|
76
|
-
return (`Professional headshot portrait photo of a ${descriptor}, ` +
|
|
77
|
-
`photorealistic, clean soft neutral background, natural diffused window lighting, ` +
|
|
78
|
-
`shot at f/2.8, shallow depth of field, looking directly at camera, ` +
|
|
79
|
-
`candid professional headshot style, no retouching artifacts, natural skin texture`);
|
|
80
|
-
}
|
|
81
|
-
function sleep(ms) {
|
|
82
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
83
|
-
}
|
|
84
|
-
export async function generatePersonaAvatar(personaName, personaRole, apiToken) {
|
|
85
|
-
const prompt = buildAvatarPrompt(personaName, personaRole);
|
|
86
|
-
console.log(`[avatar] Generating avatar for ${personaName} (${personaRole})`);
|
|
87
|
-
const createRes = await fetch(`https://api.replicate.com/v1/models/${REPLICATE_MODEL}/predictions`, {
|
|
88
|
-
method: 'POST',
|
|
89
|
-
headers: {
|
|
90
|
-
Authorization: `Bearer ${apiToken}`,
|
|
91
|
-
'Content-Type': 'application/json',
|
|
92
|
-
Prefer: 'wait',
|
|
93
|
-
},
|
|
94
|
-
body: JSON.stringify({
|
|
95
|
-
input: {
|
|
96
|
-
prompt,
|
|
97
|
-
aspect_ratio: '1:1',
|
|
98
|
-
output_format: 'webp',
|
|
99
|
-
output_quality: 85,
|
|
100
|
-
},
|
|
101
|
-
}),
|
|
102
|
-
});
|
|
103
|
-
if (!createRes.ok) {
|
|
104
|
-
const body = await createRes.text();
|
|
105
|
-
throw new Error(`Replicate create failed (${createRes.status}): ${body}`);
|
|
106
|
-
}
|
|
107
|
-
let prediction = (await createRes.json());
|
|
108
|
-
// If the Prefer: wait header resolved it immediately
|
|
109
|
-
if (prediction.status === 'succeeded') {
|
|
110
|
-
const url = extractOutputUrl(prediction.output);
|
|
111
|
-
console.log(`[avatar] Generated for ${personaName}: ${url}`);
|
|
112
|
-
return url;
|
|
113
|
-
}
|
|
114
|
-
// Poll until done
|
|
115
|
-
for (let i = 0; i < MAX_POLLS; i++) {
|
|
116
|
-
await sleep(POLL_INTERVAL_MS);
|
|
117
|
-
const pollRes = await fetch(`https://api.replicate.com/v1/predictions/${prediction.id}`, { headers: { Authorization: `Bearer ${apiToken}` } });
|
|
118
|
-
if (!pollRes.ok)
|
|
119
|
-
continue;
|
|
120
|
-
prediction = (await pollRes.json());
|
|
121
|
-
if (prediction.status === 'succeeded') {
|
|
122
|
-
const url = extractOutputUrl(prediction.output);
|
|
123
|
-
console.log(`[avatar] Generated for ${personaName}: ${url}`);
|
|
124
|
-
return url;
|
|
125
|
-
}
|
|
126
|
-
if (prediction.status === 'failed' || prediction.status === 'canceled') {
|
|
127
|
-
throw new Error(`Replicate prediction ${prediction.status}: ${prediction.error ?? 'unknown error'}`);
|
|
128
|
-
}
|
|
129
|
-
console.log(`[avatar] Polling… status=${prediction.status} (${i + 1}/${MAX_POLLS})`);
|
|
130
|
-
}
|
|
131
|
-
throw new Error('Replicate avatar generation timed out after 3 minutes');
|
|
132
|
-
}
|
|
133
|
-
//# sourceMappingURL=avatar-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-generator.js","sourceRoot":"","sources":["../../../src/utils/avatar-generator.ts"],"names":[],"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C,GAAG,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAE9B,MAAM,OAAO,GAAG,MAAM,KAAK,CACzB,4CAA4C,UAAU,CAAC,EAAE,EAAE,EAC3D,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,QAAQ,EAAE,EAAE,EAAE,CACrD,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC,EAAE;YAAE,SAAS;QAE1B,UAAU,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAyB,CAAC;QAE5D,IAAI,UAAU,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YACtC,MAAM,GAAG,GAAG,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,0BAA0B,WAAW,KAAK,GAAG,EAAE,CAAC,CAAC;YAC7D,OAAO,GAAG,CAAC;QACb,CAAC;QAED,IAAI,UAAU,CAAC,MAAM,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YACvE,MAAM,IAAI,KAAK,CACb,wBAAwB,UAAU,CAAC,MAAM,KAAK,UAAU,CAAC,KAAK,IAAI,eAAe,EAAE,CACpF,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,4BAA4B,UAAU,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC;IACvF,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared validation utilities for Night Watch CLI
|
|
3
|
-
* Used by init, doctor, and other commands that need to verify environment
|
|
4
|
-
*/
|
|
5
|
-
import { Provider } from "../types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Result of an environment check
|
|
8
|
-
*/
|
|
9
|
-
export interface ICheckResult {
|
|
10
|
-
passed: boolean;
|
|
11
|
-
message: string;
|
|
12
|
-
fixable: boolean;
|
|
13
|
-
fix?: () => void;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Check if directory is a git repository
|
|
17
|
-
*/
|
|
18
|
-
export declare function checkGitRepo(cwd: string): ICheckResult;
|
|
19
|
-
/**
|
|
20
|
-
* Check if GitHub CLI is authenticated
|
|
21
|
-
*/
|
|
22
|
-
export declare function checkGhCli(): ICheckResult;
|
|
23
|
-
/**
|
|
24
|
-
* Check if a specific provider CLI is available
|
|
25
|
-
*/
|
|
26
|
-
export declare function checkProviderCli(provider: Provider): ICheckResult;
|
|
27
|
-
/**
|
|
28
|
-
* Detect which AI provider CLIs are installed
|
|
29
|
-
*/
|
|
30
|
-
export declare function detectProviders(): Provider[];
|
|
31
|
-
/**
|
|
32
|
-
* Check if Node.js version meets minimum requirement
|
|
33
|
-
*/
|
|
34
|
-
export declare function checkNodeVersion(minMajor: number): ICheckResult;
|
|
35
|
-
/**
|
|
36
|
-
* Check if config file exists and is valid JSON
|
|
37
|
-
*/
|
|
38
|
-
export declare function checkConfigFile(projectDir: string): ICheckResult;
|
|
39
|
-
/**
|
|
40
|
-
* Check if PRD directory exists
|
|
41
|
-
*/
|
|
42
|
-
export declare function checkPrdDirectory(projectDir: string, prdDir: string): ICheckResult;
|
|
43
|
-
/**
|
|
44
|
-
* Check if logs directory exists
|
|
45
|
-
*/
|
|
46
|
-
export declare function checkLogsDirectory(projectDir: string): ICheckResult;
|
|
47
|
-
/**
|
|
48
|
-
* Check if crontab is accessible
|
|
49
|
-
*/
|
|
50
|
-
export declare function checkCrontabAccess(): ICheckResult;
|
|
51
|
-
/**
|
|
52
|
-
* Run all environment checks and return results
|
|
53
|
-
*/
|
|
54
|
-
export declare function runAllChecks(projectDir: string, prdDir: string): ICheckResult[];
|
|
55
|
-
//# sourceMappingURL=checks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../src/utils/checks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAOtD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,YAAY,CAkBzC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAkBjE;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,QAAQ,EAAE,CAc5C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAsB/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CA4BhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,YAAY,CA0Bd;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CAmBnE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAoBjD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,YAAY,EAAE,CAuChB"}
|
package/dist/src/utils/checks.js
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared validation utilities for Night Watch CLI
|
|
3
|
-
* Used by init, doctor, and other commands that need to verify environment
|
|
4
|
-
*/
|
|
5
|
-
import * as fs from "fs";
|
|
6
|
-
import * as path from "path";
|
|
7
|
-
import { execSync } from "child_process";
|
|
8
|
-
import { CONFIG_FILE_NAME, LOG_DIR, VALID_PROVIDERS } from "../constants.js";
|
|
9
|
-
/**
|
|
10
|
-
* Check if directory is a git repository
|
|
11
|
-
*/
|
|
12
|
-
export function checkGitRepo(cwd) {
|
|
13
|
-
const isRepo = fs.existsSync(path.join(cwd, ".git"));
|
|
14
|
-
return {
|
|
15
|
-
passed: isRepo,
|
|
16
|
-
message: isRepo ? "Git repository found" : "Not a git repository",
|
|
17
|
-
fixable: false,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Check if GitHub CLI is authenticated
|
|
22
|
-
*/
|
|
23
|
-
export function checkGhCli() {
|
|
24
|
-
try {
|
|
25
|
-
execSync("gh auth status", {
|
|
26
|
-
encoding: "utf-8",
|
|
27
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
28
|
-
});
|
|
29
|
-
return {
|
|
30
|
-
passed: true,
|
|
31
|
-
message: "GitHub CLI authenticated",
|
|
32
|
-
fixable: false,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
return {
|
|
37
|
-
passed: false,
|
|
38
|
-
message: "GitHub CLI not authenticated (run: gh auth login)",
|
|
39
|
-
fixable: false,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Check if a specific provider CLI is available
|
|
45
|
-
*/
|
|
46
|
-
export function checkProviderCli(provider) {
|
|
47
|
-
try {
|
|
48
|
-
execSync(`which ${provider}`, {
|
|
49
|
-
encoding: "utf-8",
|
|
50
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
51
|
-
});
|
|
52
|
-
return {
|
|
53
|
-
passed: true,
|
|
54
|
-
message: `Provider CLI found: ${provider}`,
|
|
55
|
-
fixable: false,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
return {
|
|
60
|
-
passed: false,
|
|
61
|
-
message: `Provider CLI not found: ${provider}`,
|
|
62
|
-
fixable: false,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Detect which AI provider CLIs are installed
|
|
68
|
-
*/
|
|
69
|
-
export function detectProviders() {
|
|
70
|
-
const providers = [];
|
|
71
|
-
for (const provider of VALID_PROVIDERS) {
|
|
72
|
-
try {
|
|
73
|
-
execSync(`which ${provider}`, {
|
|
74
|
-
encoding: "utf-8",
|
|
75
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
76
|
-
});
|
|
77
|
-
providers.push(provider);
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
// Provider not available
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return providers;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Check if Node.js version meets minimum requirement
|
|
87
|
-
*/
|
|
88
|
-
export function checkNodeVersion(minMajor) {
|
|
89
|
-
const nodeVersion = process.version;
|
|
90
|
-
const match = nodeVersion.match(/^v?(\d+)/);
|
|
91
|
-
if (!match) {
|
|
92
|
-
return {
|
|
93
|
-
passed: false,
|
|
94
|
-
message: `Could not determine Node.js version (got: ${nodeVersion})`,
|
|
95
|
-
fixable: false,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
const major = parseInt(match[1], 10);
|
|
99
|
-
const passed = major >= minMajor;
|
|
100
|
-
return {
|
|
101
|
-
passed,
|
|
102
|
-
message: passed
|
|
103
|
-
? `Node.js version ${nodeVersion} (>= ${minMajor}.0.0)`
|
|
104
|
-
: `Node.js version ${nodeVersion} is too old (minimum: ${minMajor}.0.0)`,
|
|
105
|
-
fixable: false,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Check if config file exists and is valid JSON
|
|
110
|
-
*/
|
|
111
|
-
export function checkConfigFile(projectDir) {
|
|
112
|
-
const configPath = path.join(projectDir, CONFIG_FILE_NAME);
|
|
113
|
-
if (!fs.existsSync(configPath)) {
|
|
114
|
-
return {
|
|
115
|
-
passed: false,
|
|
116
|
-
message: `Config file not found: ${CONFIG_FILE_NAME} (run: night-watch init)`,
|
|
117
|
-
fixable: false,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
try {
|
|
121
|
-
const content = fs.readFileSync(configPath, "utf-8");
|
|
122
|
-
JSON.parse(content);
|
|
123
|
-
return {
|
|
124
|
-
passed: true,
|
|
125
|
-
message: `Config file valid: ${CONFIG_FILE_NAME}`,
|
|
126
|
-
fixable: false,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
catch (err) {
|
|
130
|
-
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
131
|
-
return {
|
|
132
|
-
passed: false,
|
|
133
|
-
message: `Config file has invalid JSON: ${errorMsg}`,
|
|
134
|
-
fixable: false,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Check if PRD directory exists
|
|
140
|
-
*/
|
|
141
|
-
export function checkPrdDirectory(projectDir, prdDir) {
|
|
142
|
-
const prdPath = path.join(projectDir, prdDir);
|
|
143
|
-
if (!fs.existsSync(prdPath)) {
|
|
144
|
-
return {
|
|
145
|
-
passed: false,
|
|
146
|
-
message: `PRD directory not found: ${prdDir}`,
|
|
147
|
-
fixable: true,
|
|
148
|
-
fix: () => {
|
|
149
|
-
fs.mkdirSync(prdPath, { recursive: true });
|
|
150
|
-
// Also create the done subdirectory
|
|
151
|
-
fs.mkdirSync(path.join(prdPath, "done"), { recursive: true });
|
|
152
|
-
},
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
// Count PRD files (exclude summary and files in done/)
|
|
156
|
-
const prds = fs
|
|
157
|
-
.readdirSync(prdPath)
|
|
158
|
-
.filter((f) => f.endsWith(".md") && f !== "NIGHT-WATCH-SUMMARY.md");
|
|
159
|
-
return {
|
|
160
|
-
passed: true,
|
|
161
|
-
message: `PRD directory found: ${prdDir} (${prds.length} PRDs)`,
|
|
162
|
-
fixable: false,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Check if logs directory exists
|
|
167
|
-
*/
|
|
168
|
-
export function checkLogsDirectory(projectDir) {
|
|
169
|
-
const logsPath = path.join(projectDir, LOG_DIR);
|
|
170
|
-
if (!fs.existsSync(logsPath)) {
|
|
171
|
-
return {
|
|
172
|
-
passed: false,
|
|
173
|
-
message: `Logs directory not found: ${LOG_DIR}`,
|
|
174
|
-
fixable: true,
|
|
175
|
-
fix: () => {
|
|
176
|
-
fs.mkdirSync(logsPath, { recursive: true });
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
return {
|
|
181
|
-
passed: true,
|
|
182
|
-
message: `Logs directory found: ${LOG_DIR}`,
|
|
183
|
-
fixable: false,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Check if crontab is accessible
|
|
188
|
-
*/
|
|
189
|
-
export function checkCrontabAccess() {
|
|
190
|
-
try {
|
|
191
|
-
execSync("crontab -l", {
|
|
192
|
-
encoding: "utf-8",
|
|
193
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
194
|
-
});
|
|
195
|
-
return {
|
|
196
|
-
passed: true,
|
|
197
|
-
message: "Crontab accessible",
|
|
198
|
-
fixable: false,
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
catch {
|
|
202
|
-
// crontab -l returns error if no crontab exists, but that's still "accessible"
|
|
203
|
-
// We check if the error is about access or just "no crontab"
|
|
204
|
-
return {
|
|
205
|
-
passed: true,
|
|
206
|
-
message: "Crontab accessible (empty)",
|
|
207
|
-
fixable: false,
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Run all environment checks and return results
|
|
213
|
-
*/
|
|
214
|
-
export function runAllChecks(projectDir, prdDir) {
|
|
215
|
-
const results = [];
|
|
216
|
-
// Check Node version
|
|
217
|
-
results.push(checkNodeVersion(18));
|
|
218
|
-
// Check git repo
|
|
219
|
-
results.push(checkGitRepo(projectDir));
|
|
220
|
-
// Check GitHub CLI
|
|
221
|
-
results.push(checkGhCli());
|
|
222
|
-
// Check provider CLIs
|
|
223
|
-
const providers = detectProviders();
|
|
224
|
-
if (providers.length === 0) {
|
|
225
|
-
results.push({
|
|
226
|
-
passed: false,
|
|
227
|
-
message: "No AI provider CLI found (install claude or codex)",
|
|
228
|
-
fixable: false,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
for (const provider of providers) {
|
|
233
|
-
results.push(checkProviderCli(provider));
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
// Check config file
|
|
237
|
-
results.push(checkConfigFile(projectDir));
|
|
238
|
-
// Check PRD directory
|
|
239
|
-
results.push(checkPrdDirectory(projectDir, prdDir));
|
|
240
|
-
// Check logs directory
|
|
241
|
-
results.push(checkLogsDirectory(projectDir));
|
|
242
|
-
// Check crontab access
|
|
243
|
-
results.push(checkCrontabAccess());
|
|
244
|
-
return results;
|
|
245
|
-
}
|
|
246
|
-
//# sourceMappingURL=checks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../src/utils/checks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAY7E;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC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CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config writer utility for Night Watch CLI
|
|
3
|
-
* Saves partial config changes to night-watch.config.json while preserving unknown keys
|
|
4
|
-
*/
|
|
5
|
-
import { INightWatchConfig } from "../types.js";
|
|
6
|
-
export interface ISaveConfigResult {
|
|
7
|
-
success: boolean;
|
|
8
|
-
error?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Save partial config changes to the night-watch.config.json file.
|
|
12
|
-
* Reads the existing file, merges changes, and writes back.
|
|
13
|
-
* Preserves unknown keys (like $schema, projectName).
|
|
14
|
-
*/
|
|
15
|
-
export declare function saveConfig(projectDir: string, changes: Partial<INightWatchConfig>): ISaveConfigResult;
|
|
16
|
-
//# sourceMappingURL=config-writer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../../src/utils/config-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAClC,iBAAiB,CAiCnB"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Config writer utility for Night Watch CLI
|
|
3
|
-
* Saves partial config changes to night-watch.config.json while preserving unknown keys
|
|
4
|
-
*/
|
|
5
|
-
import * as fs from "fs";
|
|
6
|
-
import * as path from "path";
|
|
7
|
-
import { CONFIG_FILE_NAME } from "../constants.js";
|
|
8
|
-
/**
|
|
9
|
-
* Save partial config changes to the night-watch.config.json file.
|
|
10
|
-
* Reads the existing file, merges changes, and writes back.
|
|
11
|
-
* Preserves unknown keys (like $schema, projectName).
|
|
12
|
-
*/
|
|
13
|
-
export function saveConfig(projectDir, changes) {
|
|
14
|
-
const configPath = path.join(projectDir, CONFIG_FILE_NAME);
|
|
15
|
-
try {
|
|
16
|
-
// Read existing file
|
|
17
|
-
let existing = {};
|
|
18
|
-
if (fs.existsSync(configPath)) {
|
|
19
|
-
const content = fs.readFileSync(configPath, "utf-8");
|
|
20
|
-
existing = JSON.parse(content);
|
|
21
|
-
}
|
|
22
|
-
// Merge changes (shallow merge for top-level keys, deep merge for notifications)
|
|
23
|
-
const merged = { ...existing };
|
|
24
|
-
for (const [key, value] of Object.entries(changes)) {
|
|
25
|
-
if (value !== undefined) {
|
|
26
|
-
if (key === "notifications" && existing.notifications && typeof existing.notifications === "object") {
|
|
27
|
-
merged.notifications = { ...existing.notifications, ...value };
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
merged[key] = value;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// Write back with consistent formatting
|
|
35
|
-
fs.writeFileSync(configPath, JSON.stringify(merged, null, 2) + "\n");
|
|
36
|
-
return { success: true };
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
return {
|
|
40
|
-
success: false,
|
|
41
|
-
error: err instanceof Error ? err.message : String(err),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=config-writer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.js","sourceRoot":"","sources":["../../../src/utils/config-writer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAQnD;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,UAAkB,EAClB,OAAmC;I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AO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Crontab utility functions for Night Watch CLI
|
|
3
|
-
* Provides safe read/write operations for user crontab
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Marker prefix used to identify Night Watch entries
|
|
7
|
-
*/
|
|
8
|
-
export declare const CRONTAB_MARKER_PREFIX = "# night-watch-cli:";
|
|
9
|
-
/**
|
|
10
|
-
* Read current crontab entries
|
|
11
|
-
* Returns empty array if user has no crontab
|
|
12
|
-
*/
|
|
13
|
-
export declare function readCrontab(): string[];
|
|
14
|
-
/**
|
|
15
|
-
* Write crontab entries
|
|
16
|
-
* @param lines - Array of crontab lines to write
|
|
17
|
-
* @throws Error if crontab write fails
|
|
18
|
-
*/
|
|
19
|
-
export declare function writeCrontab(lines: string[]): void;
|
|
20
|
-
/**
|
|
21
|
-
* Generate a marker comment for identifying entries
|
|
22
|
-
* @param projectName - Name of the project
|
|
23
|
-
*/
|
|
24
|
-
export declare function generateMarker(projectName: string): string;
|
|
25
|
-
/**
|
|
26
|
-
* Add a crontab entry if it doesn't already exist
|
|
27
|
-
* @param entry - The crontab entry to add
|
|
28
|
-
* @param marker - The marker to use for deduplication
|
|
29
|
-
* @returns true if entry was added, false if it already existed
|
|
30
|
-
*/
|
|
31
|
-
export declare function addEntry(entry: string, marker: string): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Remove all crontab entries containing the marker
|
|
34
|
-
* @param marker - The marker to search for
|
|
35
|
-
* @returns Number of entries removed
|
|
36
|
-
*/
|
|
37
|
-
export declare function removeEntries(marker: string): number;
|
|
38
|
-
/**
|
|
39
|
-
* Check if an entry with the marker exists
|
|
40
|
-
* @param marker - The marker to search for
|
|
41
|
-
* @returns true if entry exists
|
|
42
|
-
*/
|
|
43
|
-
export declare function hasEntry(marker: string): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Get all entries containing the marker
|
|
46
|
-
* @param marker - The marker to search for
|
|
47
|
-
* @returns Array of matching entries
|
|
48
|
-
*/
|
|
49
|
-
export declare function getEntries(marker: string): string[];
|
|
50
|
-
/**
|
|
51
|
-
* Get all Night Watch entries for a project directory (independent of marker text)
|
|
52
|
-
* @param projectDir - Absolute project directory
|
|
53
|
-
*/
|
|
54
|
-
export declare function getProjectEntries(projectDir: string): string[];
|
|
55
|
-
/**
|
|
56
|
-
* Remove Night Watch entries for a project directory and/or marker
|
|
57
|
-
* @param projectDir - Absolute project directory
|
|
58
|
-
* @param marker - Optional marker for backward compatibility
|
|
59
|
-
* @returns Number of entries removed
|
|
60
|
-
*/
|
|
61
|
-
export declare function removeEntriesForProject(projectDir: string, marker?: string): number;
|
|
62
|
-
//# sourceMappingURL=crontab.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crontab.d.ts","sourceRoot":"","sources":["../../../src/utils/crontab.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;GAEG;AACH,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAqB1D;;;GAGG;AACH,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAYtC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAkClD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAiB/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUpD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAGnD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAG9D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAYnF"}
|