@jonit-dev/night-watch-cli 1.7.10 → 1.7.11
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/LICENSE +1 -1
- package/dist/commands/dashboard/tab-config.d.ts.map +1 -1
- package/dist/commands/dashboard/tab-config.js +8 -1
- package/dist/commands/dashboard/tab-config.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +3 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/review.d.ts +4 -0
- package/dist/commands/review.d.ts.map +1 -1
- package/dist/commands/review.js +30 -0
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/run.d.ts +11 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +47 -7
- package/dist/commands/run.js.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +43 -3
- package/dist/server/index.js.map +1 -1
- package/dist/shared/types.d.ts +223 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +7 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/src/agents/soul-compiler.d.ts +11 -0
- package/dist/src/agents/soul-compiler.d.ts.map +1 -0
- package/dist/src/agents/soul-compiler.js +103 -0
- package/dist/src/agents/soul-compiler.js.map +1 -0
- package/dist/src/board/factory.d.ts +3 -0
- package/dist/src/board/factory.d.ts.map +1 -0
- package/dist/src/board/factory.js +10 -0
- package/dist/src/board/factory.js.map +1 -0
- package/dist/src/board/providers/github-graphql.d.ts +16 -0
- package/dist/src/board/providers/github-graphql.d.ts.map +1 -0
- package/dist/src/board/providers/github-graphql.js +43 -0
- package/dist/src/board/providers/github-graphql.js.map +1 -0
- package/dist/src/board/providers/github-projects.d.ts +51 -0
- package/dist/src/board/providers/github-projects.d.ts.map +1 -0
- package/dist/src/board/providers/github-projects.js +672 -0
- package/dist/src/board/providers/github-projects.js.map +1 -0
- package/dist/src/board/types.d.ts +60 -0
- package/dist/src/board/types.d.ts.map +1 -0
- package/dist/src/board/types.js +4 -0
- package/dist/src/board/types.js.map +1 -0
- package/dist/src/cli.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +80 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/commands/board.d.ts +9 -0
- package/dist/src/commands/board.d.ts.map +1 -0
- package/dist/src/commands/board.js +294 -0
- package/dist/src/commands/board.js.map +1 -0
- package/dist/src/commands/cancel.d.ts +46 -0
- package/dist/src/commands/cancel.d.ts.map +1 -0
- package/dist/src/commands/cancel.js +241 -0
- package/dist/src/commands/cancel.js.map +1 -0
- package/dist/src/commands/dashboard/tab-actions.d.ts +10 -0
- package/dist/src/commands/dashboard/tab-actions.d.ts.map +1 -0
- package/dist/src/commands/dashboard/tab-actions.js +245 -0
- package/dist/src/commands/dashboard/tab-actions.js.map +1 -0
- package/dist/src/commands/dashboard/tab-config.d.ts +21 -0
- package/dist/src/commands/dashboard/tab-config.d.ts.map +1 -0
- package/dist/src/commands/dashboard/tab-config.js +829 -0
- package/dist/src/commands/dashboard/tab-config.js.map +1 -0
- package/dist/src/commands/dashboard/tab-logs.d.ts +10 -0
- package/dist/src/commands/dashboard/tab-logs.d.ts.map +1 -0
- package/dist/src/commands/dashboard/tab-logs.js +178 -0
- package/dist/src/commands/dashboard/tab-logs.js.map +1 -0
- package/dist/src/commands/dashboard/tab-schedules.d.ts +21 -0
- package/dist/src/commands/dashboard/tab-schedules.d.ts.map +1 -0
- package/dist/src/commands/dashboard/tab-schedules.js +304 -0
- package/dist/src/commands/dashboard/tab-schedules.js.map +1 -0
- package/dist/src/commands/dashboard/tab-status.d.ts +32 -0
- package/dist/src/commands/dashboard/tab-status.d.ts.map +1 -0
- package/dist/src/commands/dashboard/tab-status.js +421 -0
- package/dist/src/commands/dashboard/tab-status.js.map +1 -0
- package/dist/src/commands/dashboard/types.d.ts +43 -0
- package/dist/src/commands/dashboard/types.d.ts.map +1 -0
- package/dist/src/commands/dashboard/types.js +5 -0
- package/dist/src/commands/dashboard/types.js.map +1 -0
- package/dist/src/commands/dashboard.d.ts +11 -0
- package/dist/src/commands/dashboard.d.ts.map +1 -0
- package/dist/src/commands/dashboard.js +239 -0
- package/dist/src/commands/dashboard.js.map +1 -0
- package/dist/src/commands/doctor.d.ts +16 -0
- package/dist/src/commands/doctor.d.ts.map +1 -0
- package/dist/src/commands/doctor.js +202 -0
- package/dist/src/commands/doctor.js.map +1 -0
- package/dist/src/commands/history.d.ts +7 -0
- package/dist/src/commands/history.d.ts.map +1 -0
- package/dist/src/commands/history.js +56 -0
- package/dist/src/commands/history.js.map +1 -0
- package/dist/src/commands/init.d.ts +25 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +543 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/install.d.ts +48 -0
- package/dist/src/commands/install.d.ts.map +1 -0
- package/dist/src/commands/install.js +303 -0
- package/dist/src/commands/install.js.map +1 -0
- package/dist/src/commands/logs.d.ts +15 -0
- package/dist/src/commands/logs.d.ts.map +1 -0
- package/dist/src/commands/logs.js +104 -0
- package/dist/src/commands/logs.js.map +1 -0
- package/dist/src/commands/prd-state.d.ts +12 -0
- package/dist/src/commands/prd-state.d.ts.map +1 -0
- package/dist/src/commands/prd-state.js +47 -0
- package/dist/src/commands/prd-state.js.map +1 -0
- package/dist/src/commands/prd.d.ts +24 -0
- package/dist/src/commands/prd.d.ts.map +1 -0
- package/dist/src/commands/prd.js +283 -0
- package/dist/src/commands/prd.js.map +1 -0
- package/dist/src/commands/prds.d.ts +13 -0
- package/dist/src/commands/prds.d.ts.map +1 -0
- package/dist/src/commands/prds.js +196 -0
- package/dist/src/commands/prds.js.map +1 -0
- package/dist/src/commands/prs.d.ts +14 -0
- package/dist/src/commands/prs.d.ts.map +1 -0
- package/dist/src/commands/prs.js +106 -0
- package/dist/src/commands/prs.js.map +1 -0
- package/dist/src/commands/qa.d.ts +30 -0
- package/dist/src/commands/qa.d.ts.map +1 -0
- package/dist/src/commands/qa.js +159 -0
- package/dist/src/commands/qa.js.map +1 -0
- package/dist/src/commands/retry.d.ts +9 -0
- package/dist/src/commands/retry.d.ts.map +1 -0
- package/dist/src/commands/retry.js +72 -0
- package/dist/src/commands/retry.js.map +1 -0
- package/dist/src/commands/review.d.ts +35 -0
- package/dist/src/commands/review.d.ts.map +1 -0
- package/dist/src/commands/review.js +252 -0
- package/dist/src/commands/review.js.map +1 -0
- package/dist/src/commands/run.d.ts +61 -0
- package/dist/src/commands/run.d.ts.map +1 -0
- package/dist/src/commands/run.js +364 -0
- package/dist/src/commands/run.js.map +1 -0
- package/dist/src/commands/serve.d.ts +7 -0
- package/dist/src/commands/serve.d.ts.map +1 -0
- package/dist/src/commands/serve.js +27 -0
- package/dist/src/commands/serve.js.map +1 -0
- package/dist/src/commands/slice.d.ts +26 -0
- package/dist/src/commands/slice.d.ts.map +1 -0
- package/dist/src/commands/slice.js +175 -0
- package/dist/src/commands/slice.js.map +1 -0
- package/dist/src/commands/state.d.ts +8 -0
- package/dist/src/commands/state.d.ts.map +1 -0
- package/dist/src/commands/state.js +56 -0
- package/dist/src/commands/state.js.map +1 -0
- package/dist/src/commands/status.d.ts +14 -0
- package/dist/src/commands/status.d.ts.map +1 -0
- package/dist/src/commands/status.js +147 -0
- package/dist/src/commands/status.js.map +1 -0
- package/dist/src/commands/uninstall.d.ts +25 -0
- package/dist/src/commands/uninstall.d.ts.map +1 -0
- package/dist/src/commands/uninstall.js +141 -0
- package/dist/src/commands/uninstall.js.map +1 -0
- package/dist/src/commands/update.d.ts +21 -0
- package/dist/src/commands/update.d.ts.map +1 -0
- package/dist/src/commands/update.js +87 -0
- package/dist/src/commands/update.js.map +1 -0
- package/dist/src/config.d.ts +23 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +629 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/constants.d.ts +60 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +118 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/server/index.d.ts +23 -0
- package/dist/src/server/index.d.ts.map +1 -0
- package/dist/src/server/index.js +1642 -0
- package/dist/src/server/index.js.map +1 -0
- package/dist/src/slack/channel-manager.d.ts +32 -0
- package/dist/src/slack/channel-manager.d.ts.map +1 -0
- package/dist/src/slack/channel-manager.js +128 -0
- package/dist/src/slack/channel-manager.js.map +1 -0
- package/dist/src/slack/client.d.ts +63 -0
- package/dist/src/slack/client.d.ts.map +1 -0
- package/dist/src/slack/client.js +151 -0
- package/dist/src/slack/client.js.map +1 -0
- package/dist/src/slack/deliberation.d.ts +45 -0
- package/dist/src/slack/deliberation.d.ts.map +1 -0
- package/dist/src/slack/deliberation.js +539 -0
- package/dist/src/slack/deliberation.js.map +1 -0
- package/dist/src/slack/index.d.ts +6 -0
- package/dist/src/slack/index.d.ts.map +1 -0
- package/dist/src/slack/index.js +5 -0
- package/dist/src/slack/index.js.map +1 -0
- package/dist/src/slack/interaction-listener.d.ts +47 -0
- package/dist/src/slack/interaction-listener.d.ts.map +1 -0
- package/dist/src/slack/interaction-listener.js +216 -0
- package/dist/src/slack/interaction-listener.js.map +1 -0
- package/dist/src/storage/json-state-migrator.d.ts +24 -0
- package/dist/src/storage/json-state-migrator.d.ts.map +1 -0
- package/dist/src/storage/json-state-migrator.js +197 -0
- package/dist/src/storage/json-state-migrator.js.map +1 -0
- package/dist/src/storage/repositories/index.d.ts +25 -0
- package/dist/src/storage/repositories/index.d.ts.map +1 -0
- package/dist/src/storage/repositories/index.js +43 -0
- package/dist/src/storage/repositories/index.js.map +1 -0
- package/dist/src/storage/repositories/interfaces.d.ts +59 -0
- package/dist/src/storage/repositories/interfaces.d.ts.map +1 -0
- package/dist/src/storage/repositories/interfaces.js +6 -0
- package/dist/src/storage/repositories/interfaces.js.map +1 -0
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.d.ts +27 -0
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.js +569 -0
- package/dist/src/storage/repositories/sqlite/agent-persona-repository.js.map +1 -0
- package/dist/src/storage/repositories/sqlite/execution-history-repository.d.ts +21 -0
- package/dist/src/storage/repositories/sqlite/execution-history-repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/sqlite/execution-history-repository.js +94 -0
- package/dist/src/storage/repositories/sqlite/execution-history-repository.js.map +1 -0
- package/dist/src/storage/repositories/sqlite/prd-state-repository.d.ts +17 -0
- package/dist/src/storage/repositories/sqlite/prd-state-repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/sqlite/prd-state-repository.js +74 -0
- package/dist/src/storage/repositories/sqlite/prd-state-repository.js.map +1 -0
- package/dist/src/storage/repositories/sqlite/project-registry-repository.d.ts +17 -0
- package/dist/src/storage/repositories/sqlite/project-registry-repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/sqlite/project-registry-repository.js +43 -0
- package/dist/src/storage/repositories/sqlite/project-registry-repository.js.map +1 -0
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.d.ts +14 -0
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.js +47 -0
- package/dist/src/storage/repositories/sqlite/roadmap-state-repository.js.map +1 -0
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.d.ts +20 -0
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.js +88 -0
- package/dist/src/storage/repositories/sqlite/slack-discussion-repository.js.map +1 -0
- package/dist/src/storage/sqlite/client.d.ts +23 -0
- package/dist/src/storage/sqlite/client.d.ts.map +1 -0
- package/dist/src/storage/sqlite/client.js +47 -0
- package/dist/src/storage/sqlite/client.js.map +1 -0
- package/dist/src/storage/sqlite/migrations.d.ts +11 -0
- package/dist/src/storage/sqlite/migrations.d.ts.map +1 -0
- package/dist/src/storage/sqlite/migrations.js +94 -0
- package/dist/src/storage/sqlite/migrations.js.map +1 -0
- package/dist/src/templates/prd-template.d.ts +11 -0
- package/dist/src/templates/prd-template.d.ts.map +1 -0
- package/dist/src/templates/prd-template.js +166 -0
- package/dist/src/templates/prd-template.js.map +1 -0
- package/dist/src/templates/slicer-prompt.d.ts +54 -0
- package/dist/src/templates/slicer-prompt.d.ts.map +1 -0
- package/dist/src/templates/slicer-prompt.js +163 -0
- package/dist/src/templates/slicer-prompt.js.map +1 -0
- package/dist/src/types.d.ts +127 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +5 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/checks.d.ts +55 -0
- package/dist/src/utils/checks.d.ts.map +1 -0
- package/dist/src/utils/checks.js +246 -0
- package/dist/src/utils/checks.js.map +1 -0
- package/dist/src/utils/config-writer.d.ts +16 -0
- package/dist/src/utils/config-writer.d.ts.map +1 -0
- package/dist/src/utils/config-writer.js +45 -0
- package/dist/src/utils/config-writer.js.map +1 -0
- package/dist/src/utils/crontab.d.ts +62 -0
- package/dist/src/utils/crontab.d.ts.map +1 -0
- package/dist/src/utils/crontab.js +168 -0
- package/dist/src/utils/crontab.js.map +1 -0
- package/dist/src/utils/execution-history.d.ts +54 -0
- package/dist/src/utils/execution-history.d.ts.map +1 -0
- package/dist/src/utils/execution-history.js +80 -0
- package/dist/src/utils/execution-history.js.map +1 -0
- package/dist/src/utils/github.d.ts +40 -0
- package/dist/src/utils/github.d.ts.map +1 -0
- package/dist/src/utils/github.js +126 -0
- package/dist/src/utils/github.js.map +1 -0
- package/dist/src/utils/notify.d.ts +63 -0
- package/dist/src/utils/notify.d.ts.map +1 -0
- package/dist/src/utils/notify.js +389 -0
- package/dist/src/utils/notify.js.map +1 -0
- package/dist/src/utils/prd-states.d.ts +16 -0
- package/dist/src/utils/prd-states.d.ts.map +1 -0
- package/dist/src/utils/prd-states.js +28 -0
- package/dist/src/utils/prd-states.js.map +1 -0
- package/dist/src/utils/registry.d.ts +45 -0
- package/dist/src/utils/registry.d.ts.map +1 -0
- package/dist/src/utils/registry.js +86 -0
- package/dist/src/utils/registry.js.map +1 -0
- package/dist/src/utils/roadmap-parser.d.ts +45 -0
- package/dist/src/utils/roadmap-parser.d.ts.map +1 -0
- package/dist/src/utils/roadmap-parser.js +136 -0
- package/dist/src/utils/roadmap-parser.js.map +1 -0
- package/dist/src/utils/roadmap-scanner.d.ts +92 -0
- package/dist/src/utils/roadmap-scanner.d.ts.map +1 -0
- package/dist/src/utils/roadmap-scanner.js +349 -0
- package/dist/src/utils/roadmap-scanner.js.map +1 -0
- package/dist/src/utils/roadmap-state.d.ts +90 -0
- package/dist/src/utils/roadmap-state.d.ts.map +1 -0
- package/dist/src/utils/roadmap-state.js +154 -0
- package/dist/src/utils/roadmap-state.js.map +1 -0
- package/dist/src/utils/script-result.d.ts +12 -0
- package/dist/src/utils/script-result.d.ts.map +1 -0
- package/dist/src/utils/script-result.js +46 -0
- package/dist/src/utils/script-result.js.map +1 -0
- package/dist/src/utils/shell.d.ts +27 -0
- package/dist/src/utils/shell.d.ts.map +1 -0
- package/dist/src/utils/shell.js +64 -0
- package/dist/src/utils/shell.js.map +1 -0
- package/dist/src/utils/status-data.d.ts +148 -0
- package/dist/src/utils/status-data.d.ts.map +1 -0
- package/dist/src/utils/status-data.js +593 -0
- package/dist/src/utils/status-data.js.map +1 -0
- package/dist/src/utils/ui.d.ts +55 -0
- package/dist/src/utils/ui.d.ts.map +1 -0
- package/dist/src/utils/ui.js +121 -0
- package/dist/src/utils/ui.js.map +1 -0
- package/package.json +3 -1
- package/scripts/night-watch-cron.sh +7 -0
- package/scripts/night-watch-helpers.sh +33 -4
- package/scripts/night-watch-pr-reviewer-cron.sh +11 -3
- package/web/dist/assets/index-BtxQU4oX.css +1 -0
- package/web/dist/assets/index-CsNIryJz.js +473 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-BPW-7_1C.js +0 -380
- package/web/dist/assets/index-DVqjjJEO.css +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,246 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,QAA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C,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAEpD,uBAAuB;IACvB,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;IAE7C,uBAAuB;IACvB,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEnC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-writer.js","sourceRoot":"","sources":["../../../src/utils/config-writer.ts"],"names":[],"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AC,CAAC,GAAG,IAAI,CAAC,CAAC;QAErE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Crontab utility functions for Night Watch CLI
|
|
3
|
+
* Provides safe read/write operations for user crontab
|
|
4
|
+
*/
|
|
5
|
+
import { execSync } from "child_process";
|
|
6
|
+
import * as fs from "fs";
|
|
7
|
+
import * as os from "os";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
/**
|
|
10
|
+
* Marker prefix used to identify Night Watch entries
|
|
11
|
+
*/
|
|
12
|
+
export const CRONTAB_MARKER_PREFIX = "# night-watch-cli:";
|
|
13
|
+
/**
|
|
14
|
+
* Check whether a crontab line belongs to the given project directory.
|
|
15
|
+
* Supports unquoted, single-quoted, and double-quoted cd paths.
|
|
16
|
+
*/
|
|
17
|
+
function isEntryForProject(line, projectDir) {
|
|
18
|
+
if (!line.includes(CRONTAB_MARKER_PREFIX)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const normalized = projectDir.replace(/\/+$/, "");
|
|
22
|
+
const candidates = [
|
|
23
|
+
`cd ${normalized}`,
|
|
24
|
+
`cd '${normalized}'`,
|
|
25
|
+
`cd "${normalized}"`,
|
|
26
|
+
];
|
|
27
|
+
return candidates.some((candidate) => line.includes(candidate));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Read current crontab entries
|
|
31
|
+
* Returns empty array if user has no crontab
|
|
32
|
+
*/
|
|
33
|
+
export function readCrontab() {
|
|
34
|
+
try {
|
|
35
|
+
const output = execSync("crontab -l 2>/dev/null", {
|
|
36
|
+
encoding: "utf-8",
|
|
37
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
38
|
+
});
|
|
39
|
+
return output.trim().split("\n").filter((line) => line.length > 0);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// crontab -l returns error if no crontab exists
|
|
43
|
+
// This is expected and should return empty array
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Write crontab entries
|
|
49
|
+
* @param lines - Array of crontab lines to write
|
|
50
|
+
* @throws Error if crontab write fails
|
|
51
|
+
*/
|
|
52
|
+
export function writeCrontab(lines) {
|
|
53
|
+
if (process.env.NW_EXECUTION_CONTEXT === "agent") {
|
|
54
|
+
throw new Error("Crontab writes are blocked during agent execution (NW_EXECUTION_CONTEXT=agent). " +
|
|
55
|
+
"This prevents the running agent from accidentally modifying its own scheduling.");
|
|
56
|
+
}
|
|
57
|
+
const content = lines.join("\n");
|
|
58
|
+
// Create a backup first
|
|
59
|
+
try {
|
|
60
|
+
const currentCrontab = readCrontab();
|
|
61
|
+
if (currentCrontab.length > 0) {
|
|
62
|
+
execSync(`crontab -l > /tmp/night-watch-crontab-backup-$(date +%s).txt`, {
|
|
63
|
+
encoding: "utf-8",
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Ignore backup errors
|
|
69
|
+
}
|
|
70
|
+
// Write new crontab via temp file to avoid shell line length limits
|
|
71
|
+
const tmpFile = path.join(os.tmpdir(), `night-watch-crontab-${Date.now()}.txt`);
|
|
72
|
+
try {
|
|
73
|
+
fs.writeFileSync(tmpFile, content + "\n");
|
|
74
|
+
execSync(`crontab ${tmpFile}`, { encoding: "utf-8" });
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
throw new Error(`Failed to write crontab: ${error instanceof Error ? error.message : String(error)}`);
|
|
78
|
+
}
|
|
79
|
+
finally {
|
|
80
|
+
try {
|
|
81
|
+
fs.unlinkSync(tmpFile);
|
|
82
|
+
}
|
|
83
|
+
catch { /* ignore cleanup errors */ }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Generate a marker comment for identifying entries
|
|
88
|
+
* @param projectName - Name of the project
|
|
89
|
+
*/
|
|
90
|
+
export function generateMarker(projectName) {
|
|
91
|
+
return `${CRONTAB_MARKER_PREFIX} ${projectName}`;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Add a crontab entry if it doesn't already exist
|
|
95
|
+
* @param entry - The crontab entry to add
|
|
96
|
+
* @param marker - The marker to use for deduplication
|
|
97
|
+
* @returns true if entry was added, false if it already existed
|
|
98
|
+
*/
|
|
99
|
+
export function addEntry(entry, marker) {
|
|
100
|
+
// Check if entry already exists
|
|
101
|
+
if (hasEntry(marker)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
const lines = readCrontab();
|
|
105
|
+
// Add the entry with marker comment on the same line
|
|
106
|
+
const entryWithMarker = entry.endsWith(marker)
|
|
107
|
+
? entry
|
|
108
|
+
: `${entry} ${marker}`;
|
|
109
|
+
lines.push(entryWithMarker);
|
|
110
|
+
writeCrontab(lines);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Remove all crontab entries containing the marker
|
|
115
|
+
* @param marker - The marker to search for
|
|
116
|
+
* @returns Number of entries removed
|
|
117
|
+
*/
|
|
118
|
+
export function removeEntries(marker) {
|
|
119
|
+
const lines = readCrontab();
|
|
120
|
+
const filtered = lines.filter((line) => !line.includes(marker));
|
|
121
|
+
const removedCount = lines.length - filtered.length;
|
|
122
|
+
if (removedCount > 0) {
|
|
123
|
+
writeCrontab(filtered);
|
|
124
|
+
}
|
|
125
|
+
return removedCount;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Check if an entry with the marker exists
|
|
129
|
+
* @param marker - The marker to search for
|
|
130
|
+
* @returns true if entry exists
|
|
131
|
+
*/
|
|
132
|
+
export function hasEntry(marker) {
|
|
133
|
+
const lines = readCrontab();
|
|
134
|
+
return lines.some((line) => line.includes(marker));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get all entries containing the marker
|
|
138
|
+
* @param marker - The marker to search for
|
|
139
|
+
* @returns Array of matching entries
|
|
140
|
+
*/
|
|
141
|
+
export function getEntries(marker) {
|
|
142
|
+
const lines = readCrontab();
|
|
143
|
+
return lines.filter((line) => line.includes(marker));
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get all Night Watch entries for a project directory (independent of marker text)
|
|
147
|
+
* @param projectDir - Absolute project directory
|
|
148
|
+
*/
|
|
149
|
+
export function getProjectEntries(projectDir) {
|
|
150
|
+
const lines = readCrontab();
|
|
151
|
+
return lines.filter((line) => isEntryForProject(line, projectDir));
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Remove Night Watch entries for a project directory and/or marker
|
|
155
|
+
* @param projectDir - Absolute project directory
|
|
156
|
+
* @param marker - Optional marker for backward compatibility
|
|
157
|
+
* @returns Number of entries removed
|
|
158
|
+
*/
|
|
159
|
+
export function removeEntriesForProject(projectDir, marker) {
|
|
160
|
+
const lines = readCrontab();
|
|
161
|
+
const filtered = lines.filter((line) => !isEntryForProject(line, projectDir) && !(marker && line.includes(marker)));
|
|
162
|
+
const removedCount = lines.length - filtered.length;
|
|
163
|
+
if (removedCount > 0) {
|
|
164
|
+
writeCrontab(filtered);
|
|
165
|
+
}
|
|
166
|
+
return removedCount;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=crontab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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