@jonit-dev/night-watch-cli 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/dashboard/tab-actions.d.ts +10 -0
- package/dist/commands/dashboard/tab-actions.d.ts.map +1 -0
- package/dist/commands/dashboard/tab-actions.js +245 -0
- package/dist/commands/dashboard/tab-actions.js.map +1 -0
- package/dist/commands/dashboard/tab-config.d.ts +21 -0
- package/dist/commands/dashboard/tab-config.d.ts.map +1 -0
- package/dist/commands/dashboard/tab-config.js +821 -0
- package/dist/commands/dashboard/tab-config.js.map +1 -0
- package/dist/commands/dashboard/tab-logs.d.ts +10 -0
- package/dist/commands/dashboard/tab-logs.d.ts.map +1 -0
- package/dist/commands/dashboard/tab-logs.js +178 -0
- package/dist/commands/dashboard/tab-logs.js.map +1 -0
- package/dist/commands/dashboard/tab-schedules.d.ts +21 -0
- package/dist/commands/dashboard/tab-schedules.d.ts.map +1 -0
- package/dist/commands/dashboard/tab-schedules.js +304 -0
- package/dist/commands/dashboard/tab-schedules.js.map +1 -0
- package/dist/commands/dashboard/tab-status.d.ts +32 -0
- package/dist/commands/dashboard/tab-status.d.ts.map +1 -0
- package/dist/commands/dashboard/tab-status.js +416 -0
- package/dist/commands/dashboard/tab-status.js.map +1 -0
- package/dist/commands/dashboard/types.d.ts +43 -0
- package/dist/commands/dashboard/types.d.ts.map +1 -0
- package/dist/commands/dashboard/types.js +5 -0
- package/dist/commands/dashboard/types.js.map +1 -0
- package/dist/commands/dashboard.d.ts +2 -20
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +166 -224
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/install.d.ts +16 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +54 -0
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +4 -0
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/uninstall.d.ts +12 -0
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +44 -0
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +9 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/config-writer.d.ts +16 -0
- package/dist/utils/config-writer.d.ts.map +1 -0
- package/dist/utils/config-writer.js +45 -0
- package/dist/utils/config-writer.js.map +1 -0
- package/package.json +2 -1
- package/scripts/night-watch-helpers.sh +20 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions tab for the dashboard TUI
|
|
3
|
+
* Provides manual triggers for executor, reviewer, install, uninstall, and doctor
|
|
4
|
+
*/
|
|
5
|
+
import { ITab } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Create the Actions tab
|
|
8
|
+
*/
|
|
9
|
+
export declare function createActionsTab(): ITab;
|
|
10
|
+
//# sourceMappingURL=tab-actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-actions.d.ts","sourceRoot":"","sources":["../../../src/commands/dashboard/tab-actions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AAqJ/C;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAsHvC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actions tab for the dashboard TUI
|
|
3
|
+
* Provides manual triggers for executor, reviewer, install, uninstall, and doctor
|
|
4
|
+
*/
|
|
5
|
+
import blessed from "blessed";
|
|
6
|
+
import { spawn } from "child_process";
|
|
7
|
+
import { performInstall } from "../install.js";
|
|
8
|
+
import { performUninstall } from "../uninstall.js";
|
|
9
|
+
function spawnAction(args, ctx, outputBox, onDone) {
|
|
10
|
+
outputBox.setContent("{cyan-fg}Starting...{/cyan-fg}\n");
|
|
11
|
+
ctx.screen.render();
|
|
12
|
+
const child = spawn("npx", ["tsx", "src/cli.ts", ...args], {
|
|
13
|
+
cwd: ctx.projectDir,
|
|
14
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
15
|
+
env: { ...process.env },
|
|
16
|
+
});
|
|
17
|
+
let output = "";
|
|
18
|
+
const maxLines = 500;
|
|
19
|
+
const appendOutput = (data) => {
|
|
20
|
+
output += data.toString();
|
|
21
|
+
// Trim to last maxLines
|
|
22
|
+
const lines = output.split("\n");
|
|
23
|
+
if (lines.length > maxLines) {
|
|
24
|
+
output = lines.slice(-maxLines).join("\n");
|
|
25
|
+
}
|
|
26
|
+
outputBox.setContent(output);
|
|
27
|
+
outputBox.setScrollPerc(100);
|
|
28
|
+
ctx.screen.render();
|
|
29
|
+
};
|
|
30
|
+
child.stdout?.on("data", appendOutput);
|
|
31
|
+
child.stderr?.on("data", appendOutput);
|
|
32
|
+
child.on("close", (code) => {
|
|
33
|
+
const exitMsg = code === 0
|
|
34
|
+
? "\n{green-fg}--- Completed successfully ---{/green-fg}"
|
|
35
|
+
: `\n{red-fg}--- Exited with code ${code} ---{/red-fg}`;
|
|
36
|
+
output += exitMsg;
|
|
37
|
+
outputBox.setContent(output);
|
|
38
|
+
outputBox.setScrollPerc(100);
|
|
39
|
+
ctx.screen.render();
|
|
40
|
+
onDone?.();
|
|
41
|
+
});
|
|
42
|
+
child.on("error", (err) => {
|
|
43
|
+
output += `\n{red-fg}Error: ${err.message}{/red-fg}`;
|
|
44
|
+
outputBox.setContent(output);
|
|
45
|
+
ctx.screen.render();
|
|
46
|
+
onDone?.();
|
|
47
|
+
});
|
|
48
|
+
return child;
|
|
49
|
+
}
|
|
50
|
+
function buildActions() {
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
label: "Run PRD Executor",
|
|
54
|
+
description: "Execute the next eligible PRD",
|
|
55
|
+
execute: (ctx, outputBox) => {
|
|
56
|
+
spawnAction(["run"], ctx, outputBox);
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: "Run PR Reviewer",
|
|
61
|
+
description: "Review open pull requests",
|
|
62
|
+
execute: (ctx, outputBox) => {
|
|
63
|
+
spawnAction(["review"], ctx, outputBox);
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: "Run Executor (dry run)",
|
|
68
|
+
description: "Preview executor without making changes",
|
|
69
|
+
execute: (ctx, outputBox) => {
|
|
70
|
+
spawnAction(["run", "--dry-run"], ctx, outputBox);
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: "Run Reviewer (dry run)",
|
|
75
|
+
description: "Preview reviewer without making changes",
|
|
76
|
+
execute: (ctx, outputBox) => {
|
|
77
|
+
spawnAction(["review", "--dry-run"], ctx, outputBox);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: "Install Cron",
|
|
82
|
+
description: "Add crontab entries for automated execution",
|
|
83
|
+
execute: (ctx, outputBox) => {
|
|
84
|
+
const result = performInstall(ctx.projectDir, ctx.config);
|
|
85
|
+
if (result.success) {
|
|
86
|
+
outputBox.setContent(`{green-fg}Cron installed successfully!{/green-fg}\n\n` +
|
|
87
|
+
`Entries added:\n${result.entries.map((e) => ` ${e}`).join("\n")}`);
|
|
88
|
+
ctx.showMessage(`Installed ${result.entries.length} cron entries`, "success");
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
outputBox.setContent(`{red-fg}Install failed: ${result.error}{/red-fg}`);
|
|
92
|
+
ctx.showMessage("Install failed", "error");
|
|
93
|
+
}
|
|
94
|
+
const snap = ctx.refreshSnapshot();
|
|
95
|
+
ctx.snapshot = snap;
|
|
96
|
+
ctx.screen.render();
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "Uninstall Cron",
|
|
101
|
+
description: "Remove crontab entries (keeps logs)",
|
|
102
|
+
execute: (ctx, outputBox) => {
|
|
103
|
+
const result = performUninstall(ctx.projectDir, { keepLogs: true });
|
|
104
|
+
if (result.success) {
|
|
105
|
+
outputBox.setContent(`{green-fg}Cron uninstalled.{/green-fg}\n` +
|
|
106
|
+
`Removed ${result.removedCount} entries.`);
|
|
107
|
+
ctx.showMessage(`Removed ${result.removedCount} entries`, "success");
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
outputBox.setContent(`{red-fg}Uninstall failed: ${result.error}{/red-fg}`);
|
|
111
|
+
ctx.showMessage("Uninstall failed", "error");
|
|
112
|
+
}
|
|
113
|
+
const snap = ctx.refreshSnapshot();
|
|
114
|
+
ctx.snapshot = snap;
|
|
115
|
+
ctx.screen.render();
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: "Run Doctor",
|
|
120
|
+
description: "Validate config and system health",
|
|
121
|
+
execute: (ctx, outputBox) => {
|
|
122
|
+
spawnAction(["doctor"], ctx, outputBox);
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: "View Status",
|
|
127
|
+
description: "Show detailed status output",
|
|
128
|
+
execute: (ctx, outputBox) => {
|
|
129
|
+
spawnAction(["status", "--verbose"], ctx, outputBox);
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create the Actions tab
|
|
136
|
+
*/
|
|
137
|
+
export function createActionsTab() {
|
|
138
|
+
const container = blessed.box({
|
|
139
|
+
top: 0,
|
|
140
|
+
left: 0,
|
|
141
|
+
width: "100%",
|
|
142
|
+
height: "100%",
|
|
143
|
+
hidden: true,
|
|
144
|
+
});
|
|
145
|
+
const actions = buildActions();
|
|
146
|
+
const actionList = blessed.list({
|
|
147
|
+
top: 0,
|
|
148
|
+
left: 0,
|
|
149
|
+
width: "100%",
|
|
150
|
+
height: "40%",
|
|
151
|
+
border: { type: "line" },
|
|
152
|
+
label: "[ Actions ]",
|
|
153
|
+
tags: true,
|
|
154
|
+
scrollable: true,
|
|
155
|
+
alwaysScroll: true,
|
|
156
|
+
style: {
|
|
157
|
+
border: { fg: "cyan" },
|
|
158
|
+
selected: { bg: "blue", fg: "white" },
|
|
159
|
+
item: { fg: "white" },
|
|
160
|
+
},
|
|
161
|
+
keys: true,
|
|
162
|
+
vi: false,
|
|
163
|
+
interactive: true,
|
|
164
|
+
});
|
|
165
|
+
actionList.setItems(actions.map((a) => ` ${a.label} {#888888-fg}${a.description}{/#888888-fg}`));
|
|
166
|
+
const outputBox = blessed.box({
|
|
167
|
+
top: "40%",
|
|
168
|
+
left: 0,
|
|
169
|
+
width: "100%",
|
|
170
|
+
height: "60%",
|
|
171
|
+
border: { type: "line" },
|
|
172
|
+
label: "[ Output ]",
|
|
173
|
+
tags: true,
|
|
174
|
+
scrollable: true,
|
|
175
|
+
alwaysScroll: true,
|
|
176
|
+
scrollbar: { style: { bg: "blue" } },
|
|
177
|
+
style: { border: { fg: "white" } },
|
|
178
|
+
content: "Select an action and press Enter to execute.",
|
|
179
|
+
});
|
|
180
|
+
container.append(actionList);
|
|
181
|
+
container.append(outputBox);
|
|
182
|
+
let runningProcess = null;
|
|
183
|
+
let activeKeyHandlers = [];
|
|
184
|
+
let activeCtx = null;
|
|
185
|
+
function bindKeys(ctx) {
|
|
186
|
+
const handlers = [
|
|
187
|
+
[["enter"], () => {
|
|
188
|
+
const idx = actionList.selected;
|
|
189
|
+
if (idx === undefined || idx < 0 || idx >= actions.length)
|
|
190
|
+
return;
|
|
191
|
+
if (runningProcess) {
|
|
192
|
+
ctx.showMessage("An action is already running. Press c to cancel.", "info");
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
actions[idx].execute(ctx, outputBox);
|
|
196
|
+
}],
|
|
197
|
+
[["c"], () => {
|
|
198
|
+
if (runningProcess) {
|
|
199
|
+
runningProcess.kill("SIGTERM");
|
|
200
|
+
runningProcess = null;
|
|
201
|
+
ctx.showMessage("Action cancelled", "info");
|
|
202
|
+
}
|
|
203
|
+
}],
|
|
204
|
+
];
|
|
205
|
+
for (const [keys, handler] of handlers) {
|
|
206
|
+
ctx.screen.key(keys, handler);
|
|
207
|
+
}
|
|
208
|
+
activeKeyHandlers = handlers;
|
|
209
|
+
}
|
|
210
|
+
function unbindKeys(ctx) {
|
|
211
|
+
for (const [keys, handler] of activeKeyHandlers) {
|
|
212
|
+
for (const key of keys) {
|
|
213
|
+
ctx.screen.unkey(key, handler);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
activeKeyHandlers = [];
|
|
217
|
+
}
|
|
218
|
+
return {
|
|
219
|
+
name: "Actions",
|
|
220
|
+
container,
|
|
221
|
+
activate(ctx) {
|
|
222
|
+
ctx.setFooter(" \u2191\u2193:Navigate Enter:Execute c:Cancel q:Quit");
|
|
223
|
+
actionList.focus();
|
|
224
|
+
activeCtx = ctx;
|
|
225
|
+
bindKeys(ctx);
|
|
226
|
+
ctx.screen.render();
|
|
227
|
+
},
|
|
228
|
+
deactivate() {
|
|
229
|
+
if (activeCtx) {
|
|
230
|
+
unbindKeys(activeCtx);
|
|
231
|
+
activeCtx = null;
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
refresh(_ctx) {
|
|
235
|
+
// No auto-refresh needed for actions
|
|
236
|
+
},
|
|
237
|
+
destroy() {
|
|
238
|
+
if (runningProcess) {
|
|
239
|
+
runningProcess.kill("SIGTERM");
|
|
240
|
+
runningProcess = null;
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=tab-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-actions.js","sourceRoot":"","sources":["../../../src/commands/dashboard/tab-actions.ts"],"names":[],"m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|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Config tab for the dashboard TUI
|
|
3
|
+
* Allows viewing and editing all configuration fields
|
|
4
|
+
*/
|
|
5
|
+
import { INightWatchConfig } from "../../types.js";
|
|
6
|
+
import { ITab } from "./types.js";
|
|
7
|
+
type FieldType = "string" | "number" | "boolean" | "enum" | "string[]" | "keyvalue" | "webhooks";
|
|
8
|
+
interface IConfigField {
|
|
9
|
+
key: keyof INightWatchConfig;
|
|
10
|
+
label: string;
|
|
11
|
+
type: FieldType;
|
|
12
|
+
options?: string[];
|
|
13
|
+
validate?: (value: string) => string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare const CONFIG_FIELDS: IConfigField[];
|
|
16
|
+
/**
|
|
17
|
+
* Create the Config editor tab
|
|
18
|
+
*/
|
|
19
|
+
export declare function createConfigTab(): ITab;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=tab-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-config.d.ts","sourceRoot":"","sources":["../../../src/commands/dashboard/tab-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAkD,MAAM,gBAAgB,CAAC;AAKnG,OAAO,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AAE/C,KAAK,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAEjG,UAAU,YAAY;IACpB,GAAG,EAAE,MAAM,iBAAiB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC7C;AAmBD,eAAO,MAAM,aAAa,EAAE,YAAY,EA2BvC,CAAC;AA0BF;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CA8vBtC"}
|