@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
|
@@ -1,120 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dashboard command for Night Watch CLI
|
|
3
|
-
*
|
|
3
|
+
* Tabbed TUI with Status, Config, Schedules, Actions, and Logs tabs
|
|
4
4
|
*/
|
|
5
5
|
import blessed from "blessed";
|
|
6
6
|
import { loadConfig } from "../config.js";
|
|
7
|
-
import { fetchStatusSnapshot
|
|
8
|
-
import
|
|
7
|
+
import { fetchStatusSnapshot } from "../utils/status-data.js";
|
|
8
|
+
import { createStatusTab } from "./dashboard/tab-status.js";
|
|
9
|
+
import { createConfigTab } from "./dashboard/tab-config.js";
|
|
10
|
+
import { createSchedulesTab } from "./dashboard/tab-schedules.js";
|
|
11
|
+
import { createActionsTab } from "./dashboard/tab-actions.js";
|
|
12
|
+
import { createLogsTab } from "./dashboard/tab-logs.js";
|
|
13
|
+
// Re-export render functions for backward compatibility (used by tests)
|
|
14
|
+
export { renderPrdPane, renderProcessPane, renderPrPane, renderLogPane, } from "./dashboard/tab-status.js";
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
11
|
-
* Each PRD gets a colored status indicator and optional dependency list.
|
|
16
|
+
* Show a temporary flash message overlay
|
|
12
17
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
indicator = "{#888888-fg}\u25cf{/#888888-fg}";
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
let line = `${indicator} ${prd.name}`;
|
|
35
|
-
if (prd.dependencies.length > 0) {
|
|
36
|
-
line += ` (deps: ${prd.dependencies.join(", ")})`;
|
|
37
|
-
}
|
|
38
|
-
lines.push(line);
|
|
39
|
-
}
|
|
40
|
-
return lines.join("\n");
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Render the Process Status pane content from snapshot data.
|
|
44
|
-
*/
|
|
45
|
-
export function renderProcessPane(processes) {
|
|
46
|
-
const lines = [];
|
|
47
|
-
for (const proc of processes) {
|
|
48
|
-
if (proc.running) {
|
|
49
|
-
lines.push(`{green-fg}\u25cf{/green-fg} ${proc.name}: Running (PID: ${proc.pid})`);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
lines.push(`{white-fg}\u25cb{/white-fg} ${proc.name}: Not running`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return lines.join("\n");
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Render the PR Status pane content from snapshot data.
|
|
59
|
-
*/
|
|
60
|
-
export function renderPrPane(prs) {
|
|
61
|
-
if (prs.length === 0) {
|
|
62
|
-
return "No matching pull requests";
|
|
63
|
-
}
|
|
64
|
-
const lines = [];
|
|
65
|
-
for (const pr of prs) {
|
|
66
|
-
let ciIndicator;
|
|
67
|
-
switch (pr.ciStatus) {
|
|
68
|
-
case "pass":
|
|
69
|
-
ciIndicator = "{green-fg}\u25cf{/green-fg}";
|
|
70
|
-
break;
|
|
71
|
-
case "fail":
|
|
72
|
-
ciIndicator = "{red-fg}\u25cf{/red-fg}";
|
|
73
|
-
break;
|
|
74
|
-
case "pending":
|
|
75
|
-
ciIndicator = "{yellow-fg}\u25cf{/yellow-fg}";
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
ciIndicator = "{white-fg}\u25cf{/white-fg}";
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
const reviewLabel = pr.reviewScore !== null ? ` [Review: ${pr.reviewScore}%]` : "";
|
|
82
|
-
lines.push(`${ciIndicator} #${pr.number} ${pr.title}${reviewLabel}`);
|
|
83
|
-
lines.push(` ${pr.branch}`);
|
|
84
|
-
}
|
|
85
|
-
return lines.join("\n");
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Render the Log Tail pane content from snapshot data.
|
|
89
|
-
* Shows the last 20 lines from the most recent log file.
|
|
90
|
-
*/
|
|
91
|
-
export function renderLogPane(projectDir, logs) {
|
|
92
|
-
// Find the most recent log file that exists
|
|
93
|
-
const existingLogs = logs.filter((l) => l.exists);
|
|
94
|
-
if (existingLogs.length === 0) {
|
|
95
|
-
return "No log files found";
|
|
96
|
-
}
|
|
97
|
-
// Pick the log with the most recent modification time
|
|
98
|
-
let newestLog = existingLogs[0];
|
|
99
|
-
let newestMtime = 0;
|
|
100
|
-
for (const log of existingLogs) {
|
|
101
|
-
try {
|
|
102
|
-
const stat = fs.statSync(log.path);
|
|
103
|
-
if (stat.mtimeMs > newestMtime) {
|
|
104
|
-
newestMtime = stat.mtimeMs;
|
|
105
|
-
newestLog = log;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch {
|
|
109
|
-
// Ignore stat errors
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
// Read the last 20 lines directly for the dashboard
|
|
113
|
-
const lines = getLastLogLines(newestLog.path, 20);
|
|
114
|
-
if (lines.length === 0) {
|
|
115
|
-
return `${newestLog.name}.log: (empty)`;
|
|
116
|
-
}
|
|
117
|
-
return `--- ${newestLog.name}.log ---\n${lines.join("\n")}`;
|
|
18
|
+
function showMessage(screen, text, type, durationMs = 2000) {
|
|
19
|
+
const colors = { success: "green", error: "red", info: "cyan" };
|
|
20
|
+
const msgBox = blessed.box({
|
|
21
|
+
top: "center",
|
|
22
|
+
left: "center",
|
|
23
|
+
width: Math.min(60, text.length + 6),
|
|
24
|
+
height: 3,
|
|
25
|
+
content: `{center}${text}{/center}`,
|
|
26
|
+
tags: true,
|
|
27
|
+
border: { type: "line" },
|
|
28
|
+
style: { border: { fg: colors[type] }, fg: "white", bg: "black" },
|
|
29
|
+
});
|
|
30
|
+
screen.append(msgBox);
|
|
31
|
+
screen.render();
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
msgBox.destroy();
|
|
34
|
+
screen.render();
|
|
35
|
+
}, durationMs);
|
|
118
36
|
}
|
|
119
37
|
export function dashboardCommand(program) {
|
|
120
38
|
program
|
|
@@ -123,139 +41,144 @@ export function dashboardCommand(program) {
|
|
|
123
41
|
.option("--interval <seconds>", "Refresh interval in seconds", "10")
|
|
124
42
|
.action(async (options) => {
|
|
125
43
|
const projectDir = process.cwd();
|
|
126
|
-
|
|
44
|
+
let config = loadConfig(projectDir);
|
|
127
45
|
// Create blessed screen
|
|
128
46
|
const screen = blessed.screen({
|
|
129
47
|
smartCSR: true,
|
|
130
48
|
title: "Night Watch Dashboard",
|
|
131
49
|
fullUnicode: true,
|
|
132
50
|
});
|
|
133
|
-
//
|
|
51
|
+
// --- Layout ---
|
|
52
|
+
// Header: row 0, height 1
|
|
134
53
|
const headerBox = blessed.box({
|
|
135
54
|
top: 0,
|
|
136
55
|
left: 0,
|
|
137
56
|
width: "100%",
|
|
138
|
-
height:
|
|
57
|
+
height: 1,
|
|
139
58
|
content: "{center}Night Watch Dashboard{/center}",
|
|
140
59
|
tags: true,
|
|
141
60
|
style: { fg: "cyan", bold: true },
|
|
142
61
|
});
|
|
143
|
-
//
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
top: 3,
|
|
62
|
+
// Tab bar: row 1, height 1
|
|
63
|
+
const tabBar = blessed.box({
|
|
64
|
+
top: 1,
|
|
147
65
|
left: 0,
|
|
148
|
-
width: "
|
|
149
|
-
height:
|
|
150
|
-
label: "[ PRD Queue ]",
|
|
151
|
-
border: { type: "line" },
|
|
152
|
-
scrollable: true,
|
|
153
|
-
alwaysScroll: true,
|
|
154
|
-
scrollbar: { style: { bg: "blue" } },
|
|
155
|
-
style: { border: { fg: "white" } },
|
|
156
|
-
tags: true,
|
|
157
|
-
content: "Loading...",
|
|
158
|
-
});
|
|
159
|
-
// Top-right: Process Status (50% width, 40% height)
|
|
160
|
-
const processPane = blessed.box({
|
|
161
|
-
top: 3,
|
|
162
|
-
left: "50%",
|
|
163
|
-
width: "50%",
|
|
164
|
-
height: "40%",
|
|
165
|
-
label: "[ Processes ]",
|
|
166
|
-
border: { type: "line" },
|
|
167
|
-
scrollable: true,
|
|
168
|
-
alwaysScroll: true,
|
|
169
|
-
scrollbar: { style: { bg: "blue" } },
|
|
170
|
-
style: { border: { fg: "white" } },
|
|
66
|
+
width: "100%",
|
|
67
|
+
height: 1,
|
|
171
68
|
tags: true,
|
|
172
|
-
|
|
69
|
+
style: { fg: "white", bg: "black" },
|
|
70
|
+
content: "",
|
|
173
71
|
});
|
|
174
|
-
//
|
|
175
|
-
const
|
|
176
|
-
top:
|
|
72
|
+
// Content area: rows 2..n-2
|
|
73
|
+
const contentArea = blessed.box({
|
|
74
|
+
top: 2,
|
|
177
75
|
left: 0,
|
|
178
|
-
width: "
|
|
179
|
-
height: "
|
|
180
|
-
label: "[ Pull Requests ]",
|
|
181
|
-
border: { type: "line" },
|
|
182
|
-
scrollable: true,
|
|
183
|
-
alwaysScroll: true,
|
|
184
|
-
scrollbar: { style: { bg: "blue" } },
|
|
185
|
-
style: { border: { fg: "white" } },
|
|
186
|
-
tags: true,
|
|
187
|
-
content: "Loading...",
|
|
188
|
-
});
|
|
189
|
-
// Bottom-right: Log Tail (50% width, 30% height)
|
|
190
|
-
const logPane = blessed.box({
|
|
191
|
-
top: "43%",
|
|
192
|
-
left: "50%",
|
|
193
|
-
width: "50%",
|
|
194
|
-
height: "30%",
|
|
195
|
-
label: "[ Logs ]",
|
|
196
|
-
border: { type: "line" },
|
|
197
|
-
scrollable: true,
|
|
198
|
-
alwaysScroll: true,
|
|
199
|
-
scrollbar: { style: { bg: "blue" } },
|
|
200
|
-
style: { border: { fg: "white" } },
|
|
201
|
-
tags: true,
|
|
202
|
-
content: "Loading...",
|
|
76
|
+
width: "100%",
|
|
77
|
+
height: "100%-4",
|
|
203
78
|
});
|
|
204
|
-
// Footer
|
|
79
|
+
// Footer: bottom row
|
|
205
80
|
const footerBox = blessed.box({
|
|
206
81
|
bottom: 0,
|
|
207
82
|
left: 0,
|
|
208
83
|
width: "100%",
|
|
209
84
|
height: 1,
|
|
210
|
-
content: "
|
|
85
|
+
content: "",
|
|
86
|
+
tags: true,
|
|
211
87
|
style: { fg: "white", bg: "blue" },
|
|
212
88
|
});
|
|
213
|
-
// Append all elements
|
|
214
89
|
screen.append(headerBox);
|
|
215
|
-
screen.append(
|
|
216
|
-
screen.append(
|
|
217
|
-
screen.append(prPane);
|
|
218
|
-
screen.append(logPane);
|
|
90
|
+
screen.append(tabBar);
|
|
91
|
+
screen.append(contentArea);
|
|
219
92
|
screen.append(footerBox);
|
|
220
|
-
//
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
93
|
+
// --- Create tabs ---
|
|
94
|
+
const tabs = [
|
|
95
|
+
createStatusTab(),
|
|
96
|
+
createConfigTab(),
|
|
97
|
+
createSchedulesTab(),
|
|
98
|
+
createActionsTab(),
|
|
99
|
+
createLogsTab(),
|
|
100
|
+
];
|
|
101
|
+
// Append all tab containers to content area
|
|
102
|
+
for (const tab of tabs) {
|
|
103
|
+
contentArea.append(tab.container);
|
|
104
|
+
}
|
|
105
|
+
// --- State ---
|
|
106
|
+
let activeTabIndex = 0;
|
|
107
|
+
let isEditing = false;
|
|
108
|
+
let snapshot = fetchStatusSnapshot(projectDir, config);
|
|
109
|
+
// --- Tab context ---
|
|
110
|
+
const ctx = {
|
|
111
|
+
screen,
|
|
112
|
+
projectDir,
|
|
113
|
+
config,
|
|
114
|
+
snapshot,
|
|
115
|
+
reloadConfig: () => {
|
|
116
|
+
config = loadConfig(projectDir);
|
|
117
|
+
ctx.config = config;
|
|
118
|
+
return config;
|
|
119
|
+
},
|
|
120
|
+
refreshSnapshot: () => {
|
|
121
|
+
snapshot = fetchStatusSnapshot(projectDir, config);
|
|
122
|
+
ctx.snapshot = snapshot;
|
|
123
|
+
return snapshot;
|
|
124
|
+
},
|
|
125
|
+
setFooter: (text) => {
|
|
126
|
+
footerBox.setContent(text);
|
|
127
|
+
},
|
|
128
|
+
showMessage: (text, type, durationMs) => {
|
|
129
|
+
showMessage(screen, text, type, durationMs);
|
|
130
|
+
},
|
|
131
|
+
setEditing: (editing) => {
|
|
132
|
+
isEditing = editing;
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
// --- Tab bar rendering ---
|
|
136
|
+
function renderTabBar() {
|
|
137
|
+
const parts = tabs.map((tab, idx) => {
|
|
138
|
+
const num = idx + 1;
|
|
139
|
+
if (idx === activeTabIndex) {
|
|
140
|
+
return `{white-bg}{black-fg} ${num}:${tab.name} {/black-fg}{/white-bg}`;
|
|
231
141
|
}
|
|
142
|
+
return ` {blue-fg}${num}:${tab.name}{/blue-fg} `;
|
|
232
143
|
});
|
|
144
|
+
tabBar.setContent(parts.join(""));
|
|
145
|
+
}
|
|
146
|
+
// --- Tab switching ---
|
|
147
|
+
function switchTab(newIndex) {
|
|
148
|
+
if (newIndex === activeTabIndex)
|
|
149
|
+
return;
|
|
150
|
+
if (newIndex < 0 || newIndex >= tabs.length)
|
|
151
|
+
return;
|
|
152
|
+
if (isEditing)
|
|
153
|
+
return; // Don't switch while editing
|
|
154
|
+
// Deactivate current tab
|
|
155
|
+
tabs[activeTabIndex].deactivate();
|
|
156
|
+
tabs[activeTabIndex].container.hide();
|
|
157
|
+
// Activate new tab
|
|
158
|
+
activeTabIndex = newIndex;
|
|
159
|
+
tabs[activeTabIndex].container.show();
|
|
160
|
+
renderTabBar();
|
|
161
|
+
tabs[activeTabIndex].activate(ctx);
|
|
233
162
|
screen.render();
|
|
234
|
-
}
|
|
235
|
-
//
|
|
236
|
-
let snapshot = fetchStatusSnapshot(projectDir, config);
|
|
237
|
-
// Render all panes from snapshot data
|
|
238
|
-
const renderPanes = (snap) => {
|
|
239
|
-
prdPane.setContent(renderPrdPane(snap.prds));
|
|
240
|
-
processPane.setContent(renderProcessPane(snap.processes));
|
|
241
|
-
prPane.setContent(renderPrPane(snap.prs));
|
|
242
|
-
logPane.setContent(renderLogPane(snap.projectDir, snap.logs));
|
|
243
|
-
// Auto-scroll log pane to bottom
|
|
244
|
-
logPane.setScrollPerc(100);
|
|
245
|
-
};
|
|
246
|
-
// Auto-refresh setup
|
|
163
|
+
}
|
|
164
|
+
// --- Header ---
|
|
247
165
|
const intervalSeconds = parseInt(options.interval, 10) || 10;
|
|
248
166
|
let countdown = intervalSeconds;
|
|
249
|
-
|
|
250
|
-
headerBox.setContent(`{center}Night Watch: ${snapshot.projectName} | Provider: ${config.provider} | Last
|
|
251
|
-
}
|
|
252
|
-
|
|
167
|
+
function updateHeader() {
|
|
168
|
+
headerBox.setContent(`{center}Night Watch: ${snapshot.projectName} | Provider: ${config.provider} | Last: ${snapshot.timestamp.toLocaleTimeString()} | Next: ${countdown}s{/center}`);
|
|
169
|
+
}
|
|
170
|
+
// --- Refresh ---
|
|
171
|
+
function refreshData() {
|
|
172
|
+
config = loadConfig(projectDir);
|
|
173
|
+
ctx.config = config;
|
|
253
174
|
snapshot = fetchStatusSnapshot(projectDir, config);
|
|
254
|
-
|
|
175
|
+
ctx.snapshot = snapshot;
|
|
255
176
|
countdown = intervalSeconds;
|
|
256
177
|
updateHeader();
|
|
178
|
+
tabs[activeTabIndex].refresh(ctx);
|
|
257
179
|
screen.render();
|
|
258
|
-
}
|
|
180
|
+
}
|
|
181
|
+
// --- Timer ---
|
|
259
182
|
const timer = setInterval(() => {
|
|
260
183
|
countdown--;
|
|
261
184
|
updateHeader();
|
|
@@ -264,33 +187,52 @@ export function dashboardCommand(program) {
|
|
|
264
187
|
refreshData();
|
|
265
188
|
}
|
|
266
189
|
}, 1000);
|
|
267
|
-
//
|
|
268
|
-
renderPanes(snapshot);
|
|
269
|
-
updateHeader();
|
|
270
|
-
// Wire keyboard handlers
|
|
190
|
+
// --- Global keyboard handlers ---
|
|
271
191
|
screen.key(["q", "escape"], () => {
|
|
192
|
+
if (isEditing)
|
|
193
|
+
return;
|
|
272
194
|
clearInterval(timer);
|
|
195
|
+
for (const tab of tabs) {
|
|
196
|
+
tab.destroy();
|
|
197
|
+
}
|
|
273
198
|
screen.destroy();
|
|
274
199
|
process.exit(0);
|
|
275
200
|
});
|
|
276
201
|
screen.key(["r"], () => {
|
|
202
|
+
if (isEditing)
|
|
203
|
+
return;
|
|
277
204
|
refreshData();
|
|
278
205
|
});
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
206
|
+
// Tab switching via number keys
|
|
207
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
208
|
+
const idx = i;
|
|
209
|
+
screen.key([String(i + 1)], () => {
|
|
210
|
+
if (isEditing)
|
|
211
|
+
return;
|
|
212
|
+
switchTab(idx);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
// Tab cycling is handled per-tab (Status tab uses Tab for pane focus)
|
|
216
|
+
// Shift+Tab always cycles tabs
|
|
217
|
+
screen.key(["S-tab"], () => {
|
|
218
|
+
if (isEditing)
|
|
219
|
+
return;
|
|
220
|
+
const newIndex = (activeTabIndex - 1 + tabs.length) % tabs.length;
|
|
221
|
+
switchTab(newIndex);
|
|
290
222
|
});
|
|
291
|
-
// Initial
|
|
292
|
-
|
|
293
|
-
|
|
223
|
+
// --- Initial render ---
|
|
224
|
+
// Show only the first tab's container
|
|
225
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
226
|
+
if (i === 0) {
|
|
227
|
+
tabs[i].container.show();
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
tabs[i].container.hide();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
renderTabBar();
|
|
234
|
+
updateHeader();
|
|
235
|
+
tabs[activeTabIndex].activate(ctx);
|
|
294
236
|
screen.render();
|
|
295
237
|
});
|
|
296
238
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/commands/dashboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,wEAAwE;AACxE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,Y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3B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;QAED,YAAY,EAAE,CAAC;QACf,YAAY,EAAE,CAAC;QACf,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -3,11 +3,27 @@
|
|
|
3
3
|
* Adds crontab entries for automated PRD execution
|
|
4
4
|
*/
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { INightWatchConfig } from "../types.js";
|
|
6
7
|
export interface IInstallOptions {
|
|
7
8
|
schedule?: string;
|
|
8
9
|
reviewerSchedule?: string;
|
|
9
10
|
noReviewer?: boolean;
|
|
10
11
|
}
|
|
12
|
+
export interface IInstallResult {
|
|
13
|
+
success: boolean;
|
|
14
|
+
entries: string[];
|
|
15
|
+
error?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Core install logic, reusable from dashboard.
|
|
19
|
+
* Returns result without printing to console.
|
|
20
|
+
*/
|
|
21
|
+
export declare function performInstall(projectDir: string, config: INightWatchConfig, options?: {
|
|
22
|
+
schedule?: string;
|
|
23
|
+
reviewerSchedule?: string;
|
|
24
|
+
noReviewer?: boolean;
|
|
25
|
+
force?: boolean;
|
|
26
|
+
}): IInstallResult;
|
|
11
27
|
/**
|
|
12
28
|
* Install crontab entries for night-watch
|
|
13
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAiBhD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAoED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAChG,cAAc,CA2DhB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuGrD"}
|
package/dist/commands/install.js
CHANGED
|
@@ -73,6 +73,60 @@ function getProjectName(projectDir) {
|
|
|
73
73
|
// Fall back to directory name
|
|
74
74
|
return path.basename(projectDir);
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Core install logic, reusable from dashboard.
|
|
78
|
+
* Returns result without printing to console.
|
|
79
|
+
*/
|
|
80
|
+
export function performInstall(projectDir, config, options) {
|
|
81
|
+
try {
|
|
82
|
+
const executorSchedule = options?.schedule || config.cronSchedule;
|
|
83
|
+
const reviewerSchedule = options?.reviewerSchedule || config.reviewerSchedule;
|
|
84
|
+
const nightWatchBin = getNightWatchBinPath();
|
|
85
|
+
const projectName = getProjectName(projectDir);
|
|
86
|
+
const marker = generateMarker(projectName);
|
|
87
|
+
const logDir = path.join(projectDir, LOG_DIR);
|
|
88
|
+
if (!fs.existsSync(logDir)) {
|
|
89
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
90
|
+
}
|
|
91
|
+
const executorLog = path.join(logDir, "executor.log");
|
|
92
|
+
const reviewerLog = path.join(logDir, "reviewer.log");
|
|
93
|
+
// Check if already installed (unless force)
|
|
94
|
+
if (!options?.force) {
|
|
95
|
+
const existingEntries = Array.from(new Set([...getEntries(marker), ...getProjectEntries(projectDir)]));
|
|
96
|
+
if (existingEntries.length > 0) {
|
|
97
|
+
return { success: false, entries: existingEntries, error: "Already installed. Uninstall first or use force." };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const entries = [];
|
|
101
|
+
const nodeBinDir = getNodeBinDir();
|
|
102
|
+
const pathPrefix = nodeBinDir ? `export PATH="${nodeBinDir}:$PATH" && ` : "";
|
|
103
|
+
let providerEnvPrefix = "";
|
|
104
|
+
if (config.providerEnv && Object.keys(config.providerEnv).length > 0) {
|
|
105
|
+
const exports = Object.entries(config.providerEnv)
|
|
106
|
+
.map(([key, value]) => `export ${key}=${shellQuote(value)}`)
|
|
107
|
+
.join(" && ");
|
|
108
|
+
providerEnvPrefix = exports + " && ";
|
|
109
|
+
}
|
|
110
|
+
const executorEntry = `${executorSchedule} ${pathPrefix}${providerEnvPrefix}cd ${shellQuote(projectDir)} && ${shellQuote(nightWatchBin)} run >> ${shellQuote(executorLog)} 2>&1 ${marker}`;
|
|
111
|
+
entries.push(executorEntry);
|
|
112
|
+
const installReviewer = options?.noReviewer === true ? false : config.reviewerEnabled;
|
|
113
|
+
if (installReviewer) {
|
|
114
|
+
const reviewerEntry = `${reviewerSchedule} ${pathPrefix}${providerEnvPrefix}cd ${shellQuote(projectDir)} && ${shellQuote(nightWatchBin)} review >> ${shellQuote(reviewerLog)} 2>&1 ${marker}`;
|
|
115
|
+
entries.push(reviewerEntry);
|
|
116
|
+
}
|
|
117
|
+
const currentCrontab = readCrontab();
|
|
118
|
+
const newCrontab = [...currentCrontab, ...entries];
|
|
119
|
+
writeCrontab(newCrontab);
|
|
120
|
+
return { success: true, entries };
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
return {
|
|
124
|
+
success: false,
|
|
125
|
+
entries: [],
|
|
126
|
+
error: err instanceof Error ? err.message : String(err),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
76
130
|
/**
|
|
77
131
|
* Install crontab entries for night-watch
|
|
78
132
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,GACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,GAAG,EACH,MAAM,EACN,OAAO,EACP,KAAK,IAAI,OAAO,EAChB,IAAI,GACL,MAAM,gBAAgB,CAAC;AAQxB;;GAEG;AACH,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC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