@jonit-dev/night-watch-cli 1.7.56 → 1.7.57

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/cli.js CHANGED
@@ -1,181 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  import 'reflect-metadata';
3
-
4
- // dist/cli.js
5
- import "reflect-metadata";
6
- import "reflect-metadata";
7
- import "reflect-metadata";
8
- import "reflect-metadata";
9
- import "reflect-metadata";
10
- import "reflect-metadata";
11
- import "reflect-metadata";
12
- import "reflect-metadata";
13
- import "reflect-metadata";
14
- import "reflect-metadata";
15
- import * as fs from "fs";
16
- import * as path from "path";
17
- import { fileURLToPath } from "url";
18
- import Database from "better-sqlite3";
19
- import { inject, injectable } from "tsyringe";
20
- import { createCipheriv, createDecipheriv, randomBytes, randomUUID } from "crypto";
21
- import Database2 from "better-sqlite3";
22
- import { inject as inject2, injectable as injectable2 } from "tsyringe";
23
- import Database3 from "better-sqlite3";
24
- import { inject as inject3, injectable as injectable3 } from "tsyringe";
25
- import Database4 from "better-sqlite3";
26
- import { inject as inject4, injectable as injectable4 } from "tsyringe";
27
- import Database5 from "better-sqlite3";
28
- import { inject as inject5, injectable as injectable5 } from "tsyringe";
29
- import Database6 from "better-sqlite3";
30
- import { inject as inject6, injectable as injectable6 } from "tsyringe";
31
- import * as fs2 from "fs";
32
- import * as os from "os";
33
- import * as path2 from "path";
34
- import Database7 from "better-sqlite3";
35
- import "reflect-metadata";
36
- import { container } from "tsyringe";
37
- import { execFile } from "child_process";
38
- import { promisify } from "util";
39
- import { execFile as execFile2 } from "child_process";
40
- import { promisify as promisify2 } from "util";
41
- import * as fs3 from "fs";
42
- import * as path3 from "path";
43
- import { execSync } from "child_process";
44
- import * as fs4 from "fs";
45
- import * as os2 from "os";
46
- import * as path4 from "path";
47
- import { createHash } from "crypto";
48
- import { exec } from "child_process";
49
- import { promisify as promisify3 } from "util";
50
- import * as fs5 from "fs";
51
- import * as path5 from "path";
52
- import * as fs6 from "fs";
53
- import * as fs7 from "fs";
54
- import * as path6 from "path";
55
- import { execSync as execSync2 } from "child_process";
56
- import * as os3 from "os";
57
- import * as path7 from "path";
58
- import * as fs8 from "fs";
59
- import * as fs9 from "fs";
60
- import * as path8 from "path";
61
- import * as os4 from "os";
62
- import * as path9 from "path";
63
- import { execFileSync } from "child_process";
64
- import { execFileSync as execFileSync2 } from "child_process";
65
- import * as fs10 from "fs";
66
- import chalk from "chalk";
67
- import ora from "ora";
68
- import Table from "cli-table3";
69
- import { execFileSync as execFileSync3 } from "child_process";
70
- import * as fs11 from "fs";
71
- import * as path10 from "path";
72
- import * as fs12 from "fs";
73
- import * as path11 from "path";
74
- import * as fs13 from "fs";
75
- import * as os5 from "os";
76
- import * as path12 from "path";
77
- import * as crypto from "crypto";
78
- import * as fs14 from "fs";
79
- import * as path13 from "path";
80
- import * as fs15 from "fs";
81
- import * as path14 from "path";
82
- import * as fs16 from "fs";
83
- import * as path15 from "path";
84
- import { spawn } from "child_process";
85
- import { createHash as createHash3 } from "crypto";
86
- import { spawn as spawn2 } from "child_process";
87
- import { execFileSync as execFileSync4 } from "child_process";
88
- import * as fs17 from "fs";
89
- import * as path16 from "path";
90
- import "reflect-metadata";
91
- import { Command as Command2 } from "commander";
92
- import { existsSync as existsSync30, readFileSync as readFileSync18 } from "fs";
93
- import { fileURLToPath as fileURLToPath4 } from "url";
94
- import { dirname as dirname8, join as join34 } from "path";
95
- import fs18 from "fs";
96
- import path17 from "path";
97
- import { execSync as execSync3 } from "child_process";
98
- import { fileURLToPath as fileURLToPath2 } from "url";
99
- import { dirname as dirname4, join as join16 } from "path";
100
- import * as readline from "readline";
101
- import * as fs19 from "fs";
102
- import * as path18 from "path";
103
- import { execFileSync as execFileSync5 } from "child_process";
104
- import * as path19 from "path";
105
- import * as path20 from "path";
106
- import * as fs20 from "fs";
107
- import * as path21 from "path";
108
- import { execSync as execSync4 } from "child_process";
109
- import * as path22 from "path";
110
- import * as fs21 from "fs";
111
- import * as path23 from "path";
112
- import * as fs22 from "fs";
113
- import chalk2 from "chalk";
114
- import { spawn as spawn3 } from "child_process";
115
- import * as path24 from "path";
116
- import * as fs23 from "fs";
117
- import * as fs24 from "fs";
118
- import * as path25 from "path";
119
- import * as readline2 from "readline";
120
- import blessed6 from "blessed";
121
- import blessed from "blessed";
122
- import * as fs25 from "fs";
123
- import blessed2 from "blessed";
124
- import blessed3 from "blessed";
125
- import cronstrue from "cronstrue";
126
- import blessed4 from "blessed";
127
- import { spawn as spawn4 } from "child_process";
128
- import blessed5 from "blessed";
129
- import * as fs26 from "fs";
130
- import * as path26 from "path";
131
- import * as fs31 from "fs";
132
- import * as fs30 from "fs";
133
- import * as path32 from "path";
134
- import { dirname as dirname7 } from "path";
135
- import { fileURLToPath as fileURLToPath3 } from "url";
136
- import cors from "cors";
137
- import express from "express";
138
- import * as fs27 from "fs";
139
- import * as path27 from "path";
140
- import * as fs28 from "fs";
141
- import * as path28 from "path";
142
- import { spawn as spawn5 } from "child_process";
143
- import { Router } from "express";
144
- import { Router as Router2 } from "express";
145
- import { Router as Router3 } from "express";
146
- import { Router as Router4 } from "express";
147
- import * as fs29 from "fs";
148
- import * as path29 from "path";
149
- import { execSync as execSync5 } from "child_process";
150
- import { Router as Router5 } from "express";
151
- import * as path30 from "path";
152
- import { Router as Router6 } from "express";
153
- import { Router as Router7 } from "express";
154
- import * as path31 from "path";
155
- import { Router as Router8 } from "express";
156
- import { Router as Router9 } from "express";
157
- import { CronExpressionParser } from "cron-parser";
158
- import { spawnSync } from "child_process";
159
- import * as fs32 from "fs";
160
- import * as path33 from "path";
161
- import * as fs33 from "fs";
162
- import * as path34 from "path";
163
- import chalk3 from "chalk";
164
- import chalk4 from "chalk";
165
- import { execSync as execSync6 } from "child_process";
166
- import * as fs34 from "fs";
167
- import * as readline3 from "readline";
168
- import * as fs35 from "fs";
169
- import * as path35 from "path";
170
- import * as os6 from "os";
171
- import * as path36 from "path";
172
- import chalk5 from "chalk";
173
- import { Command } from "commander";
174
- import { execFileSync as execFileSync6 } from "child_process";
175
- import * as fs36 from "fs";
176
- import * as path37 from "path";
177
- import * as readline4 from "readline";
178
- import chalk6 from "chalk";
179
3
  var __defProp = Object.defineProperty;
180
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
181
5
  var __esm = (fn, res) => function __init() {
@@ -185,77 +9,16 @@ var __export = (target, all) => {
185
9
  for (var name in all)
186
10
  __defProp(target, name, { get: all[name], enumerable: true });
187
11
  };
12
+
13
+ // ../core/dist/types.js
188
14
  var init_types = __esm({
189
15
  "../core/dist/types.js"() {
190
16
  "use strict";
191
17
  }
192
18
  });
193
- var DEFAULT_DEFAULT_BRANCH;
194
- var DEFAULT_PRD_DIR;
195
- var DEFAULT_MAX_RUNTIME;
196
- var DEFAULT_REVIEWER_MAX_RUNTIME;
197
- var DEFAULT_CRON_SCHEDULE;
198
- var DEFAULT_REVIEWER_SCHEDULE;
199
- var DEFAULT_CRON_SCHEDULE_OFFSET;
200
- var DEFAULT_MAX_RETRIES;
201
- var DEFAULT_REVIEWER_MAX_RETRIES;
202
- var DEFAULT_REVIEWER_RETRY_DELAY;
203
- var DEFAULT_BRANCH_PREFIX;
204
- var DEFAULT_BRANCH_PATTERNS;
205
- var DEFAULT_MIN_REVIEW_SCORE;
206
- var DEFAULT_MAX_LOG_SIZE;
207
- var DEFAULT_PROVIDER;
208
- var DEFAULT_EXECUTOR_ENABLED;
209
- var DEFAULT_REVIEWER_ENABLED;
210
- var DEFAULT_PROVIDER_ENV;
211
- var DEFAULT_FALLBACK_ON_RATE_LIMIT;
212
- var DEFAULT_CLAUDE_MODEL;
213
- var VALID_CLAUDE_MODELS;
214
- var CLAUDE_MODEL_IDS;
215
- var DEFAULT_NOTIFICATIONS;
216
- var DEFAULT_PRD_PRIORITY;
217
- var DEFAULT_SLICER_SCHEDULE;
218
- var DEFAULT_SLICER_MAX_RUNTIME;
219
- var DEFAULT_ROADMAP_SCANNER;
220
- var DEFAULT_TEMPLATES_DIR;
221
- var DEFAULT_BOARD_PROVIDER;
222
- var DEFAULT_LOCAL_BOARD_INFO;
223
- var DEFAULT_AUTO_MERGE;
224
- var DEFAULT_AUTO_MERGE_METHOD;
225
- var VALID_MERGE_METHODS;
226
- var DEFAULT_QA_ENABLED;
227
- var DEFAULT_QA_SCHEDULE;
228
- var DEFAULT_QA_MAX_RUNTIME;
229
- var DEFAULT_QA_ARTIFACTS;
230
- var DEFAULT_QA_SKIP_LABEL;
231
- var DEFAULT_QA_AUTO_INSTALL_PLAYWRIGHT;
232
- var DEFAULT_QA;
233
- var QA_LOG_NAME;
234
- var DEFAULT_AUDIT_ENABLED;
235
- var DEFAULT_AUDIT_SCHEDULE;
236
- var DEFAULT_AUDIT_MAX_RUNTIME;
237
- var DEFAULT_AUDIT;
238
- var AUDIT_LOG_NAME;
239
- var PLANNER_LOG_NAME;
240
- var VALID_PROVIDERS;
241
- var VALID_JOB_TYPES;
242
- var DEFAULT_JOB_PROVIDERS;
243
- var PROVIDER_COMMANDS;
244
- var CONFIG_FILE_NAME;
245
- var LOCK_FILE_PREFIX;
246
- var LOG_DIR;
247
- var CLAIM_FILE_EXTENSION;
248
- var EXECUTOR_LOG_NAME;
249
- var REVIEWER_LOG_NAME;
250
- var EXECUTOR_LOG_FILE;
251
- var REVIEWER_LOG_FILE;
252
- var LOG_FILE_NAMES;
253
- var GLOBAL_CONFIG_DIR;
254
- var REGISTRY_FILE_NAME;
255
- var HISTORY_FILE_NAME;
256
- var PRD_STATES_FILE_NAME;
257
- var STATE_DB_FILE_NAME;
258
- var MAX_HISTORY_RECORDS_PER_PRD;
19
+
20
+ // ../core/dist/constants.js
21
+ var DEFAULT_DEFAULT_BRANCH, DEFAULT_PRD_DIR, DEFAULT_MAX_RUNTIME, DEFAULT_REVIEWER_MAX_RUNTIME, DEFAULT_CRON_SCHEDULE, DEFAULT_REVIEWER_SCHEDULE, DEFAULT_CRON_SCHEDULE_OFFSET, DEFAULT_MAX_RETRIES, DEFAULT_REVIEWER_MAX_RETRIES, DEFAULT_REVIEWER_RETRY_DELAY, DEFAULT_BRANCH_PREFIX, DEFAULT_BRANCH_PATTERNS, DEFAULT_MIN_REVIEW_SCORE, DEFAULT_MAX_LOG_SIZE, DEFAULT_PROVIDER, DEFAULT_EXECUTOR_ENABLED, DEFAULT_REVIEWER_ENABLED, DEFAULT_PROVIDER_ENV, DEFAULT_FALLBACK_ON_RATE_LIMIT, DEFAULT_CLAUDE_MODEL, VALID_CLAUDE_MODELS, CLAUDE_MODEL_IDS, DEFAULT_NOTIFICATIONS, DEFAULT_PRD_PRIORITY, DEFAULT_SLICER_SCHEDULE, DEFAULT_SLICER_MAX_RUNTIME, DEFAULT_ROADMAP_SCANNER, DEFAULT_TEMPLATES_DIR, DEFAULT_BOARD_PROVIDER, DEFAULT_LOCAL_BOARD_INFO, DEFAULT_AUTO_MERGE, DEFAULT_AUTO_MERGE_METHOD, VALID_MERGE_METHODS, DEFAULT_QA_ENABLED, DEFAULT_QA_SCHEDULE, DEFAULT_QA_MAX_RUNTIME, DEFAULT_QA_ARTIFACTS, DEFAULT_QA_SKIP_LABEL, DEFAULT_QA_AUTO_INSTALL_PLAYWRIGHT, DEFAULT_QA, QA_LOG_NAME, DEFAULT_AUDIT_ENABLED, DEFAULT_AUDIT_SCHEDULE, DEFAULT_AUDIT_MAX_RUNTIME, DEFAULT_AUDIT, AUDIT_LOG_NAME, PLANNER_LOG_NAME, VALID_PROVIDERS, VALID_JOB_TYPES, DEFAULT_JOB_PROVIDERS, PROVIDER_COMMANDS, CONFIG_FILE_NAME, LOCK_FILE_PREFIX, LOG_DIR, CLAIM_FILE_EXTENSION, EXECUTOR_LOG_NAME, REVIEWER_LOG_NAME, EXECUTOR_LOG_FILE, REVIEWER_LOG_FILE, LOG_FILE_NAMES, GLOBAL_CONFIG_DIR, REGISTRY_FILE_NAME, HISTORY_FILE_NAME, PRD_STATES_FILE_NAME, STATE_DB_FILE_NAME, MAX_HISTORY_RECORDS_PER_PRD;
259
22
  var init_constants = __esm({
260
23
  "../core/dist/constants.js"() {
261
24
  "use strict";
@@ -263,8 +26,8 @@ var init_constants = __esm({
263
26
  DEFAULT_PRD_DIR = "docs/prds";
264
27
  DEFAULT_MAX_RUNTIME = 7200;
265
28
  DEFAULT_REVIEWER_MAX_RUNTIME = 3600;
266
- DEFAULT_CRON_SCHEDULE = "0 0-21 * * *";
267
- DEFAULT_REVIEWER_SCHEDULE = "0 0,3,6,9,12,15,18,21 * * *";
29
+ DEFAULT_CRON_SCHEDULE = "5 */3 * * *";
30
+ DEFAULT_REVIEWER_SCHEDULE = "25 */6 * * *";
268
31
  DEFAULT_CRON_SCHEDULE_OFFSET = 0;
269
32
  DEFAULT_MAX_RETRIES = 3;
270
33
  DEFAULT_REVIEWER_MAX_RETRIES = 2;
@@ -277,7 +40,7 @@ var init_constants = __esm({
277
40
  DEFAULT_EXECUTOR_ENABLED = true;
278
41
  DEFAULT_REVIEWER_ENABLED = true;
279
42
  DEFAULT_PROVIDER_ENV = {};
280
- DEFAULT_FALLBACK_ON_RATE_LIMIT = false;
43
+ DEFAULT_FALLBACK_ON_RATE_LIMIT = true;
281
44
  DEFAULT_CLAUDE_MODEL = "sonnet";
282
45
  VALID_CLAUDE_MODELS = ["sonnet", "opus"];
283
46
  CLAUDE_MODEL_IDS = {
@@ -286,7 +49,7 @@ var init_constants = __esm({
286
49
  };
287
50
  DEFAULT_NOTIFICATIONS = { webhooks: [] };
288
51
  DEFAULT_PRD_PRIORITY = [];
289
- DEFAULT_SLICER_SCHEDULE = "0 */6 * * *";
52
+ DEFAULT_SLICER_SCHEDULE = "35 */12 * * *";
290
53
  DEFAULT_SLICER_MAX_RUNTIME = 600;
291
54
  DEFAULT_ROADMAP_SCANNER = {
292
55
  enabled: true,
@@ -307,7 +70,7 @@ var init_constants = __esm({
307
70
  DEFAULT_AUTO_MERGE_METHOD = "squash";
308
71
  VALID_MERGE_METHODS = ["squash", "merge", "rebase"];
309
72
  DEFAULT_QA_ENABLED = true;
310
- DEFAULT_QA_SCHEDULE = "30 1,7,13,19 * * *";
73
+ DEFAULT_QA_SCHEDULE = "45 2,14 * * *";
311
74
  DEFAULT_QA_MAX_RUNTIME = 3600;
312
75
  DEFAULT_QA_ARTIFACTS = "both";
313
76
  DEFAULT_QA_SKIP_LABEL = "skip-qa";
@@ -323,7 +86,7 @@ var init_constants = __esm({
323
86
  };
324
87
  QA_LOG_NAME = "night-watch-qa";
325
88
  DEFAULT_AUDIT_ENABLED = true;
326
- DEFAULT_AUDIT_SCHEDULE = "0 3 * * *";
89
+ DEFAULT_AUDIT_SCHEDULE = "50 3 * * 1";
327
90
  DEFAULT_AUDIT_MAX_RUNTIME = 1800;
328
91
  DEFAULT_AUDIT = {
329
92
  enabled: DEFAULT_AUDIT_ENABLED,
@@ -362,6 +125,11 @@ var init_constants = __esm({
362
125
  MAX_HISTORY_RECORDS_PER_PRD = 10;
363
126
  }
364
127
  });
128
+
129
+ // ../core/dist/config.js
130
+ import * as fs from "fs";
131
+ import * as path from "path";
132
+ import { fileURLToPath } from "url";
365
133
  function getDefaultConfig() {
366
134
  return {
367
135
  // PRD execution
@@ -957,6 +725,8 @@ var init_config = __esm({
957
725
  init_constants();
958
726
  }
959
727
  });
728
+
729
+ // ../core/dist/board/types.js
960
730
  var BOARD_COLUMNS;
961
731
  var init_types2 = __esm({
962
732
  "../core/dist/board/types.js"() {
@@ -964,9 +734,9 @@ var init_types2 = __esm({
964
734
  BOARD_COLUMNS = ["Draft", "Ready", "In Progress", "Review", "Done"];
965
735
  }
966
736
  });
967
- var GITHUB_RAW_BASE;
968
- var DEFAULT_AVATAR_URLS;
969
- var DEFAULT_PERSONAS;
737
+
738
+ // ../core/dist/storage/repositories/sqlite/agent-persona.defaults.js
739
+ var GITHUB_RAW_BASE, DEFAULT_AVATAR_URLS, DEFAULT_PERSONAS;
970
740
  var init_agent_persona_defaults = __esm({
971
741
  "../core/dist/storage/repositories/sqlite/agent-persona.defaults.js"() {
972
742
  "use strict";
@@ -1540,6 +1310,11 @@ var init_agent_persona_defaults = __esm({
1540
1310
  ];
1541
1311
  }
1542
1312
  });
1313
+
1314
+ // ../core/dist/storage/repositories/sqlite/agent-persona.repository.js
1315
+ import Database from "better-sqlite3";
1316
+ import { inject, injectable } from "tsyringe";
1317
+ import { createCipheriv, createDecipheriv, randomBytes, randomUUID } from "crypto";
1543
1318
  function defaultSoul() {
1544
1319
  return {
1545
1320
  whoIAm: "",
@@ -1617,12 +1392,7 @@ function rowToPersona(row, modelConfig) {
1617
1392
  updatedAt: row.updated_at
1618
1393
  };
1619
1394
  }
1620
- var __decorate;
1621
- var __metadata;
1622
- var __param;
1623
- var ENV_KEY_META_KEY;
1624
- var ENV_SEEDED_META_KEY;
1625
- var SqliteAgentPersonaRepository;
1395
+ var __decorate, __metadata, __param, ENV_KEY_META_KEY, ENV_SEEDED_META_KEY, SqliteAgentPersonaRepository;
1626
1396
  var init_agent_persona_repository = __esm({
1627
1397
  "../core/dist/storage/repositories/sqlite/agent-persona.repository.js"() {
1628
1398
  "use strict";
@@ -1815,10 +1585,11 @@ var init_agent_persona_repository = __esm({
1815
1585
  ], SqliteAgentPersonaRepository);
1816
1586
  }
1817
1587
  });
1818
- var __decorate2;
1819
- var __metadata2;
1820
- var __param2;
1821
- var SqliteExecutionHistoryRepository;
1588
+
1589
+ // ../core/dist/storage/repositories/sqlite/execution-history.repository.js
1590
+ import Database2 from "better-sqlite3";
1591
+ import { inject as inject2, injectable as injectable2 } from "tsyringe";
1592
+ var __decorate2, __metadata2, __param2, SqliteExecutionHistoryRepository;
1822
1593
  var init_execution_history_repository = __esm({
1823
1594
  "../core/dist/storage/repositories/sqlite/execution-history.repository.js"() {
1824
1595
  "use strict";
@@ -1920,6 +1691,10 @@ var init_execution_history_repository = __esm({
1920
1691
  ], SqliteExecutionHistoryRepository);
1921
1692
  }
1922
1693
  });
1694
+
1695
+ // ../core/dist/storage/repositories/sqlite/kanban-issue.repository.js
1696
+ import Database3 from "better-sqlite3";
1697
+ import { inject as inject3, injectable as injectable3 } from "tsyringe";
1923
1698
  function rowToIssue(row) {
1924
1699
  return {
1925
1700
  number: row.number,
@@ -1933,10 +1708,7 @@ function rowToIssue(row) {
1933
1708
  updatedAt: row.updated_at
1934
1709
  };
1935
1710
  }
1936
- var __decorate3;
1937
- var __metadata3;
1938
- var __param3;
1939
- var SqliteKanbanIssueRepository;
1711
+ var __decorate3, __metadata3, __param3, SqliteKanbanIssueRepository;
1940
1712
  var init_kanban_issue_repository = __esm({
1941
1713
  "../core/dist/storage/repositories/sqlite/kanban-issue.repository.js"() {
1942
1714
  "use strict";
@@ -2003,10 +1775,11 @@ var init_kanban_issue_repository = __esm({
2003
1775
  ], SqliteKanbanIssueRepository);
2004
1776
  }
2005
1777
  });
2006
- var __decorate4;
2007
- var __metadata4;
2008
- var __param4;
2009
- var SqlitePrdStateRepository;
1778
+
1779
+ // ../core/dist/storage/repositories/sqlite/prd-state.repository.js
1780
+ import Database4 from "better-sqlite3";
1781
+ import { inject as inject4, injectable as injectable4 } from "tsyringe";
1782
+ var __decorate4, __metadata4, __param4, SqlitePrdStateRepository;
2010
1783
  var init_prd_state_repository = __esm({
2011
1784
  "../core/dist/storage/repositories/sqlite/prd-state.repository.js"() {
2012
1785
  "use strict";
@@ -2090,10 +1863,11 @@ var init_prd_state_repository = __esm({
2090
1863
  ], SqlitePrdStateRepository);
2091
1864
  }
2092
1865
  });
2093
- var __decorate5;
2094
- var __metadata5;
2095
- var __param5;
2096
- var SqliteProjectRegistryRepository;
1866
+
1867
+ // ../core/dist/storage/repositories/sqlite/project-registry.repository.js
1868
+ import Database5 from "better-sqlite3";
1869
+ import { inject as inject5, injectable as injectable5 } from "tsyringe";
1870
+ var __decorate5, __metadata5, __param5, SqliteProjectRegistryRepository;
2097
1871
  var init_project_registry_repository = __esm({
2098
1872
  "../core/dist/storage/repositories/sqlite/project-registry.repository.js"() {
2099
1873
  "use strict";
@@ -2144,10 +1918,11 @@ var init_project_registry_repository = __esm({
2144
1918
  ], SqliteProjectRegistryRepository);
2145
1919
  }
2146
1920
  });
2147
- var __decorate6;
2148
- var __metadata6;
2149
- var __param6;
2150
- var SqliteRoadmapStateRepository;
1921
+
1922
+ // ../core/dist/storage/repositories/sqlite/roadmap-state.repository.js
1923
+ import Database6 from "better-sqlite3";
1924
+ import { inject as inject6, injectable as injectable6 } from "tsyringe";
1925
+ var __decorate6, __metadata6, __param6, SqliteRoadmapStateRepository;
2151
1926
  var init_roadmap_state_repository = __esm({
2152
1927
  "../core/dist/storage/repositories/sqlite/roadmap-state.repository.js"() {
2153
1928
  "use strict";
@@ -2209,6 +1984,12 @@ var init_roadmap_state_repository = __esm({
2209
1984
  ], SqliteRoadmapStateRepository);
2210
1985
  }
2211
1986
  });
1987
+
1988
+ // ../core/dist/storage/sqlite/client.js
1989
+ import * as fs2 from "fs";
1990
+ import * as os from "os";
1991
+ import * as path2 from "path";
1992
+ import Database7 from "better-sqlite3";
2212
1993
  function getDbPath() {
2213
1994
  const base = process.env.NIGHT_WATCH_HOME || path2.join(os.homedir(), GLOBAL_CONFIG_DIR);
2214
1995
  return path2.join(base, STATE_DB_FILE_NAME);
@@ -2247,6 +2028,8 @@ var init_client = __esm({
2247
2028
  _db = null;
2248
2029
  }
2249
2030
  });
2031
+
2032
+ // ../core/dist/storage/sqlite/migrations.js
2250
2033
  function runMigrations(db) {
2251
2034
  db.exec(`
2252
2035
  CREATE TABLE IF NOT EXISTS projects (
@@ -2351,6 +2134,10 @@ var init_migrations = __esm({
2351
2134
  SCHEMA_VERSION = "1";
2352
2135
  }
2353
2136
  });
2137
+
2138
+ // ../core/dist/di/container.js
2139
+ import "reflect-metadata";
2140
+ import { container } from "tsyringe";
2354
2141
  function initContainer(projectDir) {
2355
2142
  if (container.isRegistered(DATABASE_TOKEN)) {
2356
2143
  return;
@@ -2383,6 +2170,10 @@ var init_container = __esm({
2383
2170
  DATABASE_TOKEN = "Database";
2384
2171
  }
2385
2172
  });
2173
+
2174
+ // ../core/dist/board/providers/github-graphql.js
2175
+ import { execFile } from "child_process";
2176
+ import { promisify } from "util";
2386
2177
  async function graphql(query, variables, cwd) {
2387
2178
  const args = ["api", "graphql", "-f", `query=${query}`];
2388
2179
  for (const [key, value] of Object.entries(variables)) {
@@ -2417,8 +2208,11 @@ var init_github_graphql = __esm({
2417
2208
  execFileAsync = promisify(execFile);
2418
2209
  }
2419
2210
  });
2420
- var execFileAsync2;
2421
- var GitHubProjectsProvider;
2211
+
2212
+ // ../core/dist/board/providers/github-projects.js
2213
+ import { execFile as execFile2 } from "child_process";
2214
+ import { promisify as promisify2 } from "util";
2215
+ var execFileAsync2, GitHubProjectsProvider;
2422
2216
  var init_github_projects = __esm({
2423
2217
  "../core/dist/board/providers/github-projects.js"() {
2424
2218
  "use strict";
@@ -3114,6 +2908,8 @@ var init_github_projects = __esm({
3114
2908
  };
3115
2909
  }
3116
2910
  });
2911
+
2912
+ // ../core/dist/board/providers/local-kanban.js
3117
2913
  function toIBoardIssue(row) {
3118
2914
  return {
3119
2915
  id: String(row.number),
@@ -3177,6 +2973,8 @@ var init_local_kanban = __esm({
3177
2973
  };
3178
2974
  }
3179
2975
  });
2976
+
2977
+ // ../core/dist/board/factory.js
3180
2978
  function createBoardProvider(config, cwd) {
3181
2979
  switch (config.provider) {
3182
2980
  case "github":
@@ -3198,6 +2996,8 @@ var init_factory = __esm({
3198
2996
  init_local_kanban();
3199
2997
  }
3200
2998
  });
2999
+
3000
+ // ../core/dist/board/labels.js
3201
3001
  function isValidPriority(value) {
3202
3002
  return PRIORITY_LABELS.includes(value);
3203
3003
  }
@@ -3247,14 +3047,7 @@ function sortByPriority(issues) {
3247
3047
  return aOrder - bOrder;
3248
3048
  });
3249
3049
  }
3250
- var PRIORITY_LABELS;
3251
- var PRIORITY_LABEL_INFO;
3252
- var CATEGORY_LABELS;
3253
- var CATEGORY_LABEL_INFO;
3254
- var HORIZON_LABELS;
3255
- var HORIZON_LABEL_INFO;
3256
- var PRIORITY_COLORS;
3257
- var NIGHT_WATCH_LABELS;
3050
+ var PRIORITY_LABELS, PRIORITY_LABEL_INFO, CATEGORY_LABELS, CATEGORY_LABEL_INFO, HORIZON_LABELS, HORIZON_LABEL_INFO, PRIORITY_COLORS, NIGHT_WATCH_LABELS;
3258
3051
  var init_labels = __esm({
3259
3052
  "../core/dist/board/labels.js"() {
3260
3053
  "use strict";
@@ -3355,6 +3148,8 @@ var init_labels = __esm({
3355
3148
  ];
3356
3149
  }
3357
3150
  });
3151
+
3152
+ // ../core/dist/board/roadmap-mapping.js
3358
3153
  function getLabelsForSection(sectionName) {
3359
3154
  for (const mapping of ROADMAP_SECTION_MAPPINGS) {
3360
3155
  if (mapping.sectionPattern.test(sectionName)) {
@@ -3402,10 +3197,7 @@ function findMatchingIssue(targetTitle, issues, threshold = 0.8) {
3402
3197
  }
3403
3198
  return bestMatch;
3404
3199
  }
3405
- var HORIZON_SHORT_TERM;
3406
- var HORIZON_MEDIUM_TERM;
3407
- var HORIZON_LONG_TERM;
3408
- var ROADMAP_SECTION_MAPPINGS;
3200
+ var HORIZON_SHORT_TERM, HORIZON_MEDIUM_TERM, HORIZON_LONG_TERM, ROADMAP_SECTION_MAPPINGS;
3409
3201
  var init_roadmap_mapping = __esm({
3410
3202
  "../core/dist/board/roadmap-mapping.js"() {
3411
3203
  "use strict";
@@ -3507,11 +3299,15 @@ var init_roadmap_mapping = __esm({
3507
3299
  ];
3508
3300
  }
3509
3301
  });
3302
+
3303
+ // ../core/dist/storage/repositories/interfaces.js
3510
3304
  var init_interfaces = __esm({
3511
3305
  "../core/dist/storage/repositories/interfaces.js"() {
3512
3306
  "use strict";
3513
3307
  }
3514
3308
  });
3309
+
3310
+ // ../core/dist/storage/repositories/index.js
3515
3311
  function getRepositories() {
3516
3312
  if (isContainerInitialized()) {
3517
3313
  return {
@@ -3556,6 +3352,10 @@ var init_repositories = __esm({
3556
3352
  _initialized = false;
3557
3353
  }
3558
3354
  });
3355
+
3356
+ // ../core/dist/storage/json-state-migrator.js
3357
+ import * as fs3 from "fs";
3358
+ import * as path3 from "path";
3559
3359
  function tryReadJson(filePath) {
3560
3360
  if (!fs3.existsSync(filePath)) {
3561
3361
  return null;
@@ -3704,6 +3504,8 @@ var init_json_state_migrator = __esm({
3704
3504
  init_repositories();
3705
3505
  }
3706
3506
  });
3507
+
3508
+ // ../core/dist/agents/soul-compiler.js
3707
3509
  function compileSoul(persona, memory) {
3708
3510
  if (persona.systemPromptOverride) {
3709
3511
  return persona.systemPromptOverride;
@@ -3837,8 +3639,7 @@ function compileSoul(persona, memory) {
3837
3639
  }
3838
3640
  return lines.join("\n");
3839
3641
  }
3840
- var AIISH_WORDS_TO_AVOID;
3841
- var CANNED_CHATBOT_PHRASES;
3642
+ var AIISH_WORDS_TO_AVOID, CANNED_CHATBOT_PHRASES;
3842
3643
  var init_soul_compiler = __esm({
3843
3644
  "../core/dist/agents/soul-compiler.js"() {
3844
3645
  "use strict";
@@ -3863,6 +3664,8 @@ var init_soul_compiler = __esm({
3863
3664
  ];
3864
3665
  }
3865
3666
  });
3667
+
3668
+ // ../core/dist/utils/avatar-generator.js
3866
3669
  function extractOutputUrl(output) {
3867
3670
  if (!output)
3868
3671
  return null;
@@ -3943,10 +3746,7 @@ async function generatePersonaAvatar(personaName, personaRole, apiToken) {
3943
3746
  }
3944
3747
  throw new Error("Replicate avatar generation timed out after 3 minutes");
3945
3748
  }
3946
- var REPLICATE_MODEL;
3947
- var POLL_INTERVAL_MS;
3948
- var MAX_POLLS;
3949
- var PERSONA_PORTRAITS;
3749
+ var REPLICATE_MODEL, POLL_INTERVAL_MS, MAX_POLLS, PERSONA_PORTRAITS;
3950
3750
  var init_avatar_generator = __esm({
3951
3751
  "../core/dist/utils/avatar-generator.js"() {
3952
3752
  "use strict";
@@ -3981,6 +3781,8 @@ var init_avatar_generator = __esm({
3981
3781
  };
3982
3782
  }
3983
3783
  });
3784
+
3785
+ // ../core/dist/utils/logger.js
3984
3786
  function colorize(color, text) {
3985
3787
  return NO_COLOR ? text : `${color}${text}${ANSI.reset}`;
3986
3788
  }
@@ -4000,10 +3802,7 @@ function formatMeta(meta) {
4000
3802
  function createLogger(context) {
4001
3803
  return new Logger(context);
4002
3804
  }
4003
- var ANSI;
4004
- var NO_COLOR;
4005
- var LEVEL_STYLES;
4006
- var Logger;
3805
+ var ANSI, NO_COLOR, LEVEL_STYLES, Logger;
4007
3806
  var init_logger = __esm({
4008
3807
  "../core/dist/utils/logger.js"() {
4009
3808
  "use strict";
@@ -4060,6 +3859,8 @@ var init_logger = __esm({
4060
3859
  };
4061
3860
  }
4062
3861
  });
3862
+
3863
+ // ../core/dist/utils/prd-states.js
4063
3864
  function readPrdStates() {
4064
3865
  const { prdState } = getRepositories();
4065
3866
  return prdState.readAll();
@@ -4086,12 +3887,56 @@ var init_prd_states = __esm({
4086
3887
  init_repositories();
4087
3888
  }
4088
3889
  });
3890
+
3891
+ // ../core/dist/utils/crontab.js
3892
+ import { execSync } from "child_process";
3893
+ import * as fs4 from "fs";
3894
+ import * as os2 from "os";
3895
+ import * as path4 from "path";
3896
+ function isNightWatchEntry(line) {
3897
+ if (line.includes(CRONTAB_MARKER_PREFIX)) {
3898
+ return true;
3899
+ }
3900
+ if (line.includes("night-watch")) {
3901
+ return true;
3902
+ }
3903
+ return LEGACY_SCRIPT_NAMES.some((scriptName) => line.includes(scriptName));
3904
+ }
3905
+ function normalizePathValue(value) {
3906
+ const trimmed = value.trim();
3907
+ let unquoted = trimmed;
3908
+ if (trimmed.startsWith("'") && trimmed.endsWith("'") || trimmed.startsWith('"') && trimmed.endsWith('"')) {
3909
+ unquoted = trimmed.slice(1, -1);
3910
+ }
3911
+ return unquoted.replace(/\\ /g, " ").replace(/\/+$/, "");
3912
+ }
3913
+ function extractCdPath(line) {
3914
+ const match = line.match(/\bcd\s+((?:'[^']*'|"[^"]*"|[^;&])+?)\s*(?:&&|;)/);
3915
+ if (!match) {
3916
+ return null;
3917
+ }
3918
+ return normalizePathValue(match[1]);
3919
+ }
4089
3920
  function isEntryForProject(line, projectDir) {
4090
- if (!line.includes(CRONTAB_MARKER_PREFIX)) {
3921
+ if (!isNightWatchEntry(line)) {
4091
3922
  return false;
4092
3923
  }
4093
3924
  const normalized = projectDir.replace(/\/+$/, "");
4094
- const candidates = [`cd ${normalized}`, `cd '${normalized}'`, `cd "${normalized}"`];
3925
+ const extractedPath = extractCdPath(line);
3926
+ if (extractedPath !== null) {
3927
+ return extractedPath === normalized;
3928
+ }
3929
+ const escaped = normalized.replace(/ /g, "\\ ");
3930
+ const candidates = [
3931
+ `cd ${normalized}`,
3932
+ `cd ${normalized}/`,
3933
+ `cd '${normalized}'`,
3934
+ `cd '${normalized}/'`,
3935
+ `cd "${normalized}"`,
3936
+ `cd "${normalized}/"`,
3937
+ `cd ${escaped}`,
3938
+ `cd ${escaped}/`
3939
+ ];
4095
3940
  return candidates.some((candidate) => line.includes(candidate));
4096
3941
  }
4097
3942
  function readCrontab() {
@@ -4175,13 +4020,28 @@ function removeEntriesForProject(projectDir, marker) {
4175
4020
  }
4176
4021
  return removedCount;
4177
4022
  }
4178
- var CRONTAB_MARKER_PREFIX;
4023
+ var CRONTAB_MARKER_PREFIX, LEGACY_SCRIPT_NAMES;
4179
4024
  var init_crontab = __esm({
4180
4025
  "../core/dist/utils/crontab.js"() {
4181
4026
  "use strict";
4182
4027
  CRONTAB_MARKER_PREFIX = "# night-watch-cli:";
4028
+ LEGACY_SCRIPT_NAMES = [
4029
+ "night-watch-cron.sh",
4030
+ "night-watch-pr-reviewer-cron.sh",
4031
+ "night-watch-qa-cron.sh",
4032
+ "night-watch-audit-cron.sh",
4033
+ "night-watch-slice-cron.sh",
4034
+ "night-watch-slicer-cron.sh"
4035
+ ];
4183
4036
  }
4184
4037
  });
4038
+
4039
+ // ../core/dist/utils/status-data.js
4040
+ import { createHash } from "crypto";
4041
+ import { exec } from "child_process";
4042
+ import { promisify as promisify3 } from "util";
4043
+ import * as fs5 from "fs";
4044
+ import * as path5 from "path";
4185
4045
  function getProjectName(projectDir) {
4186
4046
  const packageJsonPath = path5.join(projectDir, "package.json");
4187
4047
  if (fs5.existsSync(packageJsonPath)) {
@@ -4637,6 +4497,9 @@ var init_status_data = __esm({
4637
4497
  execAsync = promisify3(exec);
4638
4498
  }
4639
4499
  });
4500
+
4501
+ // ../core/dist/utils/cancel.js
4502
+ import * as fs6 from "fs";
4640
4503
  function getLockFilePaths(projectDir) {
4641
4504
  const runtimeKey = projectRuntimeKey(projectDir);
4642
4505
  return {
@@ -4743,6 +4606,11 @@ var init_cancel = __esm({
4743
4606
  init_status_data();
4744
4607
  }
4745
4608
  });
4609
+
4610
+ // ../core/dist/utils/checks.js
4611
+ import * as fs7 from "fs";
4612
+ import * as path6 from "path";
4613
+ import { execSync as execSync2 } from "child_process";
4746
4614
  function checkGitRepo(cwd) {
4747
4615
  const isRepo = fs7.existsSync(path6.join(cwd, ".git"));
4748
4616
  return {
@@ -4933,6 +4801,11 @@ var init_checks = __esm({
4933
4801
  init_constants();
4934
4802
  }
4935
4803
  });
4804
+
4805
+ // ../core/dist/utils/claim-manager.js
4806
+ import * as os3 from "os";
4807
+ import * as path7 from "path";
4808
+ import * as fs8 from "fs";
4936
4809
  function claimPrd(prdDir, prdFile, pid) {
4937
4810
  const claimPath = path7.join(prdDir, prdFile + CLAIM_FILE_EXTENSION);
4938
4811
  const claimData = {
@@ -5011,6 +4884,10 @@ var init_claim_manager = __esm({
5011
4884
  init_constants();
5012
4885
  }
5013
4886
  });
4887
+
4888
+ // ../core/dist/utils/config-writer.js
4889
+ import * as fs9 from "fs";
4890
+ import * as path8 from "path";
5014
4891
  function saveConfig(projectDir, changes) {
5015
4892
  const configPath = path8.join(projectDir, CONFIG_FILE_NAME);
5016
4893
  try {
@@ -5044,6 +4921,10 @@ var init_config_writer = __esm({
5044
4921
  init_constants();
5045
4922
  }
5046
4923
  });
4924
+
4925
+ // ../core/dist/utils/execution-history.js
4926
+ import * as os4 from "os";
4927
+ import * as path9 from "path";
5047
4928
  function getHistoryPath() {
5048
4929
  const base = process.env.NIGHT_WATCH_HOME || path9.join(os4.homedir(), GLOBAL_CONFIG_DIR);
5049
4930
  return path9.join(base, HISTORY_FILE_NAME);
@@ -5094,6 +4975,9 @@ var init_execution_history = __esm({
5094
4975
  init_client();
5095
4976
  }
5096
4977
  });
4978
+
4979
+ // ../core/dist/utils/git-utils.js
4980
+ import { execFileSync } from "child_process";
5097
4981
  function getBranchTipTimestamp(projectDir, branch) {
5098
4982
  let remoteTs = null;
5099
4983
  let localTs = null;
@@ -5182,6 +5066,9 @@ var init_git_utils = __esm({
5182
5066
  "use strict";
5183
5067
  }
5184
5068
  });
5069
+
5070
+ // ../core/dist/utils/github.js
5071
+ import { execFileSync as execFileSync2 } from "child_process";
5185
5072
  function parsePrDetails(raw) {
5186
5073
  try {
5187
5074
  const details = JSON.parse(raw);
@@ -5354,8 +5241,7 @@ function extractSummary(body, maxLength = 500) {
5354
5241
  const lastSpace = truncated.lastIndexOf(" ");
5355
5242
  return (lastSpace > 0 ? truncated.slice(0, lastSpace) : truncated) + "...";
5356
5243
  }
5357
- var QA_COMMENT_MARKER;
5358
- var QA_SCREENSHOT_REGEX;
5244
+ var QA_COMMENT_MARKER, QA_SCREENSHOT_REGEX;
5359
5245
  var init_github = __esm({
5360
5246
  "../core/dist/utils/github.js"() {
5361
5247
  "use strict";
@@ -5363,6 +5249,9 @@ var init_github = __esm({
5363
5249
  QA_SCREENSHOT_REGEX = /!\[[^\]]*]\(([^)\n]*qa-artifacts\/[^)\n]+)\)/g;
5364
5250
  }
5365
5251
  });
5252
+
5253
+ // ../core/dist/utils/log-utils.js
5254
+ import * as fs10 from "fs";
5366
5255
  function rotateLog(logFile, maxSize = DEFAULT_MAX_LOG_SIZE) {
5367
5256
  if (!fs10.existsSync(logFile)) {
5368
5257
  return false;
@@ -5402,6 +5291,11 @@ var init_log_utils = __esm({
5402
5291
  init_constants();
5403
5292
  }
5404
5293
  });
5294
+
5295
+ // ../core/dist/utils/ui.js
5296
+ import chalk from "chalk";
5297
+ import ora from "ora";
5298
+ import Table from "cli-table3";
5405
5299
  function success(msg) {
5406
5300
  console.log(chalk.green("\u2714"), msg);
5407
5301
  }
@@ -5484,6 +5378,8 @@ var init_ui = __esm({
5484
5378
  "use strict";
5485
5379
  }
5486
5380
  });
5381
+
5382
+ // ../core/dist/utils/notify.js
5487
5383
  function getEventEmoji(event) {
5488
5384
  switch (event) {
5489
5385
  case "run_started":
@@ -5760,6 +5656,11 @@ var init_notify = __esm({
5760
5656
  MAX_QA_SCREENSHOTS_IN_NOTIFICATION = 3;
5761
5657
  }
5762
5658
  });
5659
+
5660
+ // ../core/dist/utils/prd-discovery.js
5661
+ import { execFileSync as execFileSync3 } from "child_process";
5662
+ import * as fs11 from "fs";
5663
+ import * as path10 from "path";
5763
5664
  function getOpenBranches(projectDir) {
5764
5665
  try {
5765
5666
  const output = execFileSync3("gh", ["pr", "list", "--state", "open", "--json", "headRefName", "--jq", ".[].headRefName"], { cwd: projectDir, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
@@ -5865,6 +5766,10 @@ var init_prd_discovery = __esm({
5865
5766
  init_status_data();
5866
5767
  }
5867
5768
  });
5769
+
5770
+ // ../core/dist/utils/prd-utils.js
5771
+ import * as fs12 from "fs";
5772
+ import * as path11 from "path";
5868
5773
  function slugify(name) {
5869
5774
  return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
5870
5775
  }
@@ -5896,6 +5801,11 @@ var init_prd_utils = __esm({
5896
5801
  "use strict";
5897
5802
  }
5898
5803
  });
5804
+
5805
+ // ../core/dist/utils/registry.js
5806
+ import * as fs13 from "fs";
5807
+ import * as os5 from "os";
5808
+ import * as path12 from "path";
5899
5809
  function getRegistryPath() {
5900
5810
  const base = process.env.NIGHT_WATCH_HOME || path12.join(os5.homedir(), GLOBAL_CONFIG_DIR);
5901
5811
  return path12.join(base, REGISTRY_FILE_NAME);
@@ -5953,6 +5863,8 @@ var init_registry = __esm({
5953
5863
  init_status_data();
5954
5864
  }
5955
5865
  });
5866
+
5867
+ // ../core/dist/utils/roadmap-context-compiler.js
5956
5868
  function isLeadRole(role) {
5957
5869
  const lower = role.toLowerCase();
5958
5870
  return LEAD_KEYWORDS.some((kw) => lower.includes(kw));
@@ -6021,10 +5933,7 @@ function buildSmartProgress(status) {
6021
5933
  }
6022
5934
  return result;
6023
5935
  }
6024
- var RAW_CONTENT_MAX;
6025
- var PROGRESS_MAX_FULL;
6026
- var PROGRESS_MAX_SUMMARY;
6027
- var LEAD_KEYWORDS;
5936
+ var RAW_CONTENT_MAX, PROGRESS_MAX_FULL, PROGRESS_MAX_SUMMARY, LEAD_KEYWORDS;
6028
5937
  var init_roadmap_context_compiler = __esm({
6029
5938
  "../core/dist/utils/roadmap-context-compiler.js"() {
6030
5939
  "use strict";
@@ -6034,6 +5943,9 @@ var init_roadmap_context_compiler = __esm({
6034
5943
  LEAD_KEYWORDS = ["lead", "architect", "product", "manager", "pm", "director"];
6035
5944
  }
6036
5945
  });
5946
+
5947
+ // ../core/dist/utils/roadmap-parser.js
5948
+ import * as crypto from "crypto";
6037
5949
  function generateItemHash(title) {
6038
5950
  const normalizedTitle = title.toLowerCase().trim();
6039
5951
  return crypto.createHash("sha256").update(normalizedTitle).digest("hex").slice(0, 8);
@@ -6128,6 +6040,10 @@ var init_roadmap_parser = __esm({
6128
6040
  "use strict";
6129
6041
  }
6130
6042
  });
6043
+
6044
+ // ../core/dist/utils/roadmap-state.js
6045
+ import * as fs14 from "fs";
6046
+ import * as path13 from "path";
6131
6047
  function getStateFilePath(prdDir) {
6132
6048
  return path13.join(prdDir, STATE_FILE_NAME);
6133
6049
  }
@@ -6208,8 +6124,7 @@ function getProcessedHashes(state) {
6208
6124
  function getStateItem(state, hash) {
6209
6125
  return state.items[hash];
6210
6126
  }
6211
- var STATE_VERSION;
6212
- var STATE_FILE_NAME;
6127
+ var STATE_VERSION, STATE_FILE_NAME;
6213
6128
  var init_roadmap_state = __esm({
6214
6129
  "../core/dist/utils/roadmap-state.js"() {
6215
6130
  "use strict";
@@ -6218,6 +6133,10 @@ var init_roadmap_state = __esm({
6218
6133
  STATE_FILE_NAME = ".roadmap-state.json";
6219
6134
  }
6220
6135
  });
6136
+
6137
+ // ../core/dist/templates/slicer-prompt.js
6138
+ import * as fs15 from "fs";
6139
+ import * as path14 from "path";
6221
6140
  function loadSlicerTemplate(templateDir) {
6222
6141
  if (cachedTemplate) {
6223
6142
  return cachedTemplate;
@@ -6253,8 +6172,7 @@ function createSlicerPromptVars(title, section, description, prdDir, prdFilename
6253
6172
  prdDir
6254
6173
  };
6255
6174
  }
6256
- var DEFAULT_SLICER_TEMPLATE;
6257
- var cachedTemplate;
6175
+ var DEFAULT_SLICER_TEMPLATE, cachedTemplate;
6258
6176
  var init_slicer_prompt = __esm({
6259
6177
  "../core/dist/templates/slicer-prompt.js"() {
6260
6178
  "use strict";
@@ -6342,6 +6260,12 @@ DO NOT forget to write the file.
6342
6260
  cachedTemplate = null;
6343
6261
  }
6344
6262
  });
6263
+
6264
+ // ../core/dist/utils/roadmap-scanner.js
6265
+ import * as fs16 from "fs";
6266
+ import * as path15 from "path";
6267
+ import { spawn } from "child_process";
6268
+ import { createHash as createHash3 } from "crypto";
6345
6269
  function normalizeAuditSeverity(raw) {
6346
6270
  const normalized = raw.trim().toLowerCase();
6347
6271
  if (normalized === "critical")
@@ -6707,6 +6631,8 @@ var init_roadmap_scanner = __esm({
6707
6631
  init_slicer_prompt();
6708
6632
  }
6709
6633
  });
6634
+
6635
+ // ../core/dist/utils/script-result.js
6710
6636
  function parseScriptResult(output) {
6711
6637
  if (!output || output.trim().length === 0) {
6712
6638
  return null;
@@ -6751,6 +6677,9 @@ var init_script_result = __esm({
6751
6677
  RESULT_PREFIX = "NIGHT_WATCH_RESULT:";
6752
6678
  }
6753
6679
  });
6680
+
6681
+ // ../core/dist/utils/shell.js
6682
+ import { spawn as spawn2 } from "child_process";
6754
6683
  async function executeScript(scriptPath, args = [], env = {}, options = {}) {
6755
6684
  const result = await executeScriptWithOutput(scriptPath, args, env, options);
6756
6685
  return result.exitCode;
@@ -6795,6 +6724,8 @@ var init_shell = __esm({
6795
6724
  "use strict";
6796
6725
  }
6797
6726
  });
6727
+
6728
+ // ../core/dist/utils/webhook-validator.js
6798
6729
  function validateWebhook(webhook) {
6799
6730
  const issues = [];
6800
6731
  if (!webhook.events || webhook.events.length === 0) {
@@ -6849,6 +6780,11 @@ var init_webhook_validator = __esm({
6849
6780
  "use strict";
6850
6781
  }
6851
6782
  });
6783
+
6784
+ // ../core/dist/utils/worktree-manager.js
6785
+ import { execFileSync as execFileSync4 } from "child_process";
6786
+ import * as fs17 from "fs";
6787
+ import * as path16 from "path";
6852
6788
  function gitExec(args, cwd, logFile) {
6853
6789
  try {
6854
6790
  const result = execFileSync4("git", args, {
@@ -7005,6 +6941,8 @@ var init_worktree_manager = __esm({
7005
6941
  init_git_utils();
7006
6942
  }
7007
6943
  });
6944
+
6945
+ // ../core/dist/templates/prd-template.js
7008
6946
  function renderDependsOn(deps) {
7009
6947
  if (deps.length === 0) {
7010
6948
  return "";
@@ -7176,6 +7114,8 @@ sequenceDiagram
7176
7114
  `;
7177
7115
  }
7178
7116
  });
7117
+
7118
+ // ../core/dist/index.js
7179
7119
  var dist_exports = {};
7180
7120
  __export(dist_exports, {
7181
7121
  AUDIT_LOG_NAME: () => AUDIT_LOG_NAME,
@@ -7479,7 +7419,22 @@ var init_dist = __esm({
7479
7419
  init_slicer_prompt();
7480
7420
  }
7481
7421
  });
7422
+
7423
+ // dist/cli.js
7424
+ import "reflect-metadata";
7425
+ import { Command as Command2 } from "commander";
7426
+ import { existsSync as existsSync30, readFileSync as readFileSync18 } from "fs";
7427
+ import { fileURLToPath as fileURLToPath4 } from "url";
7428
+ import { dirname as dirname8, join as join34 } from "path";
7429
+
7430
+ // dist/commands/init.js
7482
7431
  init_dist();
7432
+ import fs18 from "fs";
7433
+ import path17 from "path";
7434
+ import { execSync as execSync3 } from "child_process";
7435
+ import { fileURLToPath as fileURLToPath2 } from "url";
7436
+ import { dirname as dirname4, join as join16 } from "path";
7437
+ import * as readline from "readline";
7483
7438
  var __filename = fileURLToPath2(import.meta.url);
7484
7439
  var __dirname2 = dirname4(__filename);
7485
7440
  function findTemplatesDir(startDir) {
@@ -7912,7 +7867,11 @@ function initCommand(program2) {
7912
7867
  console.log();
7913
7868
  });
7914
7869
  }
7870
+
7871
+ // dist/commands/run.js
7915
7872
  init_dist();
7873
+
7874
+ // dist/commands/shared/env-builder.js
7916
7875
  init_dist();
7917
7876
  function deriveProviderLabel(config, jobType) {
7918
7877
  if (config.providerLabel)
@@ -7954,6 +7913,10 @@ function formatProviderDisplay(providerCmd, providerLabel) {
7954
7913
  function getTelegramStatusWebhooks(config) {
7955
7914
  return (config.notifications?.webhooks ?? []).filter((wh) => wh.type === "telegram" && typeof wh.botToken === "string" && wh.botToken.trim().length > 0 && typeof wh.chatId === "string" && wh.chatId.trim().length > 0).map((wh) => ({ botToken: wh.botToken, chatId: wh.chatId }));
7956
7915
  }
7916
+
7917
+ // dist/commands/run.js
7918
+ import * as fs19 from "fs";
7919
+ import * as path18 from "path";
7957
7920
  function resolveRunNotificationEvent(exitCode, scriptStatus) {
7958
7921
  if (exitCode === 124) {
7959
7922
  return "run_timeout";
@@ -8284,7 +8247,11 @@ ${stderr}`);
8284
8247
  }
8285
8248
  });
8286
8249
  }
8250
+
8251
+ // dist/commands/review.js
8287
8252
  init_dist();
8253
+ import { execFileSync as execFileSync5 } from "child_process";
8254
+ import * as path19 from "path";
8288
8255
  function shouldSendReviewNotification(scriptStatus) {
8289
8256
  if (!scriptStatus) {
8290
8257
  return true;
@@ -8545,7 +8512,10 @@ ${stderr}`);
8545
8512
  }
8546
8513
  });
8547
8514
  }
8515
+
8516
+ // dist/commands/qa.js
8548
8517
  init_dist();
8518
+ import * as path20 from "path";
8549
8519
  function shouldSendQaNotification(scriptStatus) {
8550
8520
  if (!scriptStatus) {
8551
8521
  return true;
@@ -8696,7 +8666,11 @@ ${stderr}`);
8696
8666
  }
8697
8667
  });
8698
8668
  }
8669
+
8670
+ // dist/commands/audit.js
8699
8671
  init_dist();
8672
+ import * as fs20 from "fs";
8673
+ import * as path21 from "path";
8700
8674
  function buildEnvVars4(config, options) {
8701
8675
  const env = buildBaseEnvVars(config, "audit", options.dryRun);
8702
8676
  env.NW_AUDIT_MAX_RUNTIME = String(config.audit.maxRuntime);
@@ -8792,7 +8766,12 @@ ${stderr}`);
8792
8766
  }
8793
8767
  });
8794
8768
  }
8769
+
8770
+ // dist/commands/install.js
8795
8771
  init_dist();
8772
+ import { execSync as execSync4 } from "child_process";
8773
+ import * as path22 from "path";
8774
+ import * as fs21 from "fs";
8796
8775
  function shellQuote(value) {
8797
8776
  return `'${value.replace(/'/g, `'"'"'`)}'`;
8798
8777
  }
@@ -9022,7 +9001,11 @@ function installCommand(program2) {
9022
9001
  }
9023
9002
  });
9024
9003
  }
9004
+
9005
+ // dist/commands/uninstall.js
9025
9006
  init_dist();
9007
+ import * as path23 from "path";
9008
+ import * as fs22 from "fs";
9026
9009
  function performUninstall(projectDir, options) {
9027
9010
  try {
9028
9011
  const projectName = getProjectName(projectDir);
@@ -9110,7 +9093,10 @@ function uninstallCommand(program2) {
9110
9093
  }
9111
9094
  });
9112
9095
  }
9096
+
9097
+ // dist/commands/status.js
9113
9098
  init_dist();
9099
+ import chalk2 from "chalk";
9114
9100
  function formatBytes(bytes) {
9115
9101
  if (bytes === 0)
9116
9102
  return "0 B";
@@ -9314,7 +9300,12 @@ function statusCommand(program2) {
9314
9300
  }
9315
9301
  });
9316
9302
  }
9303
+
9304
+ // dist/commands/logs.js
9317
9305
  init_dist();
9306
+ import { spawn as spawn3 } from "child_process";
9307
+ import * as path24 from "path";
9308
+ import * as fs23 from "fs";
9318
9309
  function getLastLines(filePath, lineCount) {
9319
9310
  if (!fs23.existsSync(filePath)) {
9320
9311
  return `Log file not found: ${filePath}`;
@@ -9419,7 +9410,12 @@ function logsCommand(program2) {
9419
9410
  }
9420
9411
  });
9421
9412
  }
9413
+
9414
+ // dist/commands/prd.js
9422
9415
  init_dist();
9416
+ import * as fs24 from "fs";
9417
+ import * as path25 from "path";
9418
+ import * as readline2 from "readline";
9423
9419
  function slugify2(name) {
9424
9420
  return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
9425
9421
  }
@@ -9614,8 +9610,15 @@ function prdCommand(program2) {
9614
9610
  info(`${pendingCount} pending, ${claimedCount} claimed, ${done.length} done`);
9615
9611
  });
9616
9612
  }
9613
+
9614
+ // dist/commands/dashboard.js
9617
9615
  init_dist();
9616
+ import blessed6 from "blessed";
9617
+
9618
+ // dist/commands/dashboard/tab-status.js
9618
9619
  init_dist();
9620
+ import blessed from "blessed";
9621
+ import * as fs25 from "fs";
9619
9622
  function sortPrdsByPriority2(prds, priority) {
9620
9623
  if (priority.length === 0)
9621
9624
  return prds;
@@ -10001,7 +10004,10 @@ function createStatusTab() {
10001
10004
  }
10002
10005
  };
10003
10006
  }
10007
+
10008
+ // dist/commands/dashboard/tab-config.js
10004
10009
  init_dist();
10010
+ import blessed2 from "blessed";
10005
10011
  var SENSITIVE_PATTERNS = /TOKEN|KEY|SECRET|PASSWORD/i;
10006
10012
  function promptTextbox(screen, label2, initialValue, cb) {
10007
10013
  const input = blessed2.textbox({
@@ -10820,6 +10826,10 @@ function createConfigTab() {
10820
10826
  }
10821
10827
  };
10822
10828
  }
10829
+
10830
+ // dist/commands/dashboard/tab-schedules.js
10831
+ import blessed3 from "blessed";
10832
+ import cronstrue from "cronstrue";
10823
10833
  init_dist();
10824
10834
  function cronToHuman(cron) {
10825
10835
  const trimmed = cron.trim();
@@ -11116,6 +11126,10 @@ function createSchedulesTab() {
11116
11126
  }
11117
11127
  };
11118
11128
  }
11129
+
11130
+ // dist/commands/dashboard/tab-actions.js
11131
+ import blessed4 from "blessed";
11132
+ import { spawn as spawn4 } from "child_process";
11119
11133
  function spawnAction(args, ctx, outputBox, onDone) {
11120
11134
  outputBox.setContent("{cyan-fg}Starting...{/cyan-fg}\n");
11121
11135
  ctx.screen.render();
@@ -11353,7 +11367,12 @@ function createActionsTab() {
11353
11367
  }
11354
11368
  };
11355
11369
  }
11370
+
11371
+ // dist/commands/dashboard/tab-logs.js
11356
11372
  init_dist();
11373
+ import blessed5 from "blessed";
11374
+ import * as fs26 from "fs";
11375
+ import * as path26 from "path";
11357
11376
  var LOG_NAMES = ["executor", "reviewer"];
11358
11377
  var LOG_LINES = 200;
11359
11378
  function createLogsTab() {
@@ -11543,6 +11562,8 @@ Log will appear here once the ${logName} runs.`);
11543
11562
  }
11544
11563
  };
11545
11564
  }
11565
+
11566
+ // dist/commands/dashboard.js
11546
11567
  function showMessage(screen, text, type, durationMs = 2e3) {
11547
11568
  const colors = { success: "green", error: "red", info: "cyan" };
11548
11569
  const msgBox = blessed6.box({
@@ -11738,6 +11759,8 @@ function dashboardCommand(program2) {
11738
11759
  screen.render();
11739
11760
  });
11740
11761
  }
11762
+
11763
+ // dist/commands/doctor.js
11741
11764
  init_dist();
11742
11765
  function validateWebhook2(webhook) {
11743
11766
  const issues = [];
@@ -11896,12 +11919,27 @@ function doctorCommand(program2) {
11896
11919
  }
11897
11920
  });
11898
11921
  }
11922
+
11923
+ // dist/commands/serve.js
11899
11924
  init_dist();
11925
+ import * as fs31 from "fs";
11926
+
11927
+ // ../server/dist/index.js
11900
11928
  init_dist();
11929
+ import * as fs30 from "fs";
11930
+ import * as path32 from "path";
11931
+ import { dirname as dirname7 } from "path";
11932
+ import { fileURLToPath as fileURLToPath3 } from "url";
11933
+ import cors from "cors";
11934
+ import express from "express";
11935
+
11936
+ // ../server/dist/middleware/error-handler.middleware.js
11901
11937
  function errorHandler(err, _req, res, _next) {
11902
11938
  console.error("API Error:", err);
11903
11939
  res.status(500).json({ error: err.message });
11904
11940
  }
11941
+
11942
+ // ../server/dist/middleware/graceful-shutdown.middleware.js
11905
11943
  var PRE_SHUTDOWN_TIMEOUT_MS = 5e3;
11906
11944
  var GRACEFUL_SHUTDOWN_TIMEOUT_MS = 12e3;
11907
11945
  function withTimeout(promise, timeoutMs, label2) {
@@ -11971,7 +12009,11 @@ function setupGracefulShutdown(server, beforeClose) {
11971
12009
  process.on("SIGTERM", () => shutdown("SIGTERM"));
11972
12010
  process.on("SIGINT", () => shutdown("SIGINT"));
11973
12011
  }
12012
+
12013
+ // ../server/dist/middleware/project-resolver.middleware.js
11974
12014
  init_dist();
12015
+ import * as fs27 from "fs";
12016
+ import * as path27 from "path";
11975
12017
  function resolveProject(req, res, next) {
11976
12018
  const projectId = req.params.projectId;
11977
12019
  const decodedId = decodeURIComponent(projectId).replace(/~/g, "/");
@@ -11989,6 +12031,8 @@ function resolveProject(req, res, next) {
11989
12031
  req.projectConfig = loadConfig(entry.path);
11990
12032
  next();
11991
12033
  }
12034
+
12035
+ // ../server/dist/middleware/sse.middleware.js
11992
12036
  init_dist();
11993
12037
  function broadcastSSE(clients, event, data) {
11994
12038
  const msg = `event: ${event}
@@ -12021,7 +12065,15 @@ function startSseStatusWatcher(clients, projectDir, getConfig) {
12021
12065
  });
12022
12066
  }, 2e3);
12023
12067
  }
12068
+
12069
+ // ../server/dist/routes/action.routes.js
12024
12070
  init_dist();
12071
+ import * as fs28 from "fs";
12072
+ import * as path28 from "path";
12073
+ import { execSync as execSync5, spawn as spawn5 } from "child_process";
12074
+ import { Router } from "express";
12075
+
12076
+ // ../server/dist/helpers.js
12025
12077
  init_dist();
12026
12078
  function validatePrdName(name) {
12027
12079
  return /^[a-zA-Z0-9_-]+(\.md)?$/.test(name) && !name.includes("..");
@@ -12063,6 +12115,8 @@ function getBoardProvider(config, projectDir) {
12063
12115
  }
12064
12116
  return createBoardProvider(config.boardProvider, projectDir);
12065
12117
  }
12118
+
12119
+ // ../server/dist/routes/action.routes.js
12066
12120
  function cleanOrphanedClaims(dir) {
12067
12121
  let entries;
12068
12122
  try {
@@ -12143,6 +12197,24 @@ function spawnAction2(projectDir, command, req, res, onSpawned) {
12143
12197
  });
12144
12198
  }
12145
12199
  }
12200
+ function formatCommandError(error2) {
12201
+ if (!(error2 instanceof Error)) {
12202
+ return String(error2);
12203
+ }
12204
+ const withStreams = error2;
12205
+ const stderr = typeof withStreams.stderr === "string" ? withStreams.stderr : withStreams.stderr?.toString("utf-8") ?? "";
12206
+ const stdout = typeof withStreams.stdout === "string" ? withStreams.stdout : withStreams.stdout?.toString("utf-8") ?? "";
12207
+ const output = stderr.trim() || stdout.trim();
12208
+ return output || error2.message;
12209
+ }
12210
+ function runCliCommand(projectDir, args) {
12211
+ execSync5(`night-watch ${args.join(" ")}`, {
12212
+ cwd: projectDir,
12213
+ encoding: "utf-8",
12214
+ stdio: "pipe",
12215
+ env: process.env
12216
+ });
12217
+ }
12146
12218
  function createActionRouteHandlers(ctx) {
12147
12219
  const router = Router({ mergeParams: true });
12148
12220
  const p = ctx.pathPrefix;
@@ -12165,10 +12237,23 @@ function createActionRouteHandlers(ctx) {
12165
12237
  spawnAction2(ctx.getProjectDir(req), ["planner"], req, res);
12166
12238
  });
12167
12239
  router.post(`/${p}install-cron`, (req, res) => {
12168
- spawnAction2(ctx.getProjectDir(req), ["install"], req, res);
12240
+ const projectDir = ctx.getProjectDir(req);
12241
+ try {
12242
+ runCliCommand(projectDir, ["uninstall", "--keep-logs"]);
12243
+ runCliCommand(projectDir, ["install"]);
12244
+ res.json({ started: true });
12245
+ } catch (error2) {
12246
+ res.status(500).json({ error: formatCommandError(error2) });
12247
+ }
12169
12248
  });
12170
12249
  router.post(`/${p}uninstall-cron`, (req, res) => {
12171
- spawnAction2(ctx.getProjectDir(req), ["uninstall"], req, res);
12250
+ const projectDir = ctx.getProjectDir(req);
12251
+ try {
12252
+ runCliCommand(projectDir, ["uninstall", "--keep-logs"]);
12253
+ res.json({ started: true });
12254
+ } catch (error2) {
12255
+ res.status(500).json({ error: formatCommandError(error2) });
12256
+ }
12172
12257
  });
12173
12258
  router.post(`/${p}cancel`, async (req, res) => {
12174
12259
  try {
@@ -12276,7 +12361,10 @@ function createProjectActionRoutes(deps) {
12276
12361
  pathPrefix: "actions/"
12277
12362
  });
12278
12363
  }
12364
+
12365
+ // ../server/dist/routes/agent.routes.js
12279
12366
  init_dist();
12367
+ import { Router as Router2 } from "express";
12280
12368
  function createAgentRoutes() {
12281
12369
  const router = Router2();
12282
12370
  router.post("/seed-defaults", (_req, res) => {
@@ -12376,7 +12464,10 @@ function createAgentRoutes() {
12376
12464
  });
12377
12465
  return router;
12378
12466
  }
12467
+
12468
+ // ../server/dist/routes/board.routes.js
12379
12469
  init_dist();
12470
+ import { Router as Router3 } from "express";
12380
12471
  var ERROR_BOARD_NOT_CONFIGURED = "Board not configured";
12381
12472
  function createBoardRouteHandlers(ctx) {
12382
12473
  const router = Router3({ mergeParams: true });
@@ -12557,7 +12648,10 @@ function createProjectBoardRoutes() {
12557
12648
  pathPrefix: "board/"
12558
12649
  });
12559
12650
  }
12651
+
12652
+ // ../server/dist/routes/config.routes.js
12560
12653
  init_dist();
12654
+ import { Router as Router4 } from "express";
12561
12655
  function validateConfigChanges(changes) {
12562
12656
  if (typeof changes !== "object" || changes === null) {
12563
12657
  return "Invalid request body";
@@ -12834,11 +12928,17 @@ function createProjectConfigRoutes() {
12834
12928
  });
12835
12929
  return router;
12836
12930
  }
12931
+
12932
+ // ../server/dist/routes/doctor.routes.js
12837
12933
  init_dist();
12934
+ import * as fs29 from "fs";
12935
+ import * as path29 from "path";
12936
+ import { execSync as execSync6 } from "child_process";
12937
+ import { Router as Router5 } from "express";
12838
12938
  function runDoctorChecks(projectDir, config) {
12839
12939
  const checks = [];
12840
12940
  try {
12841
- execSync5("git rev-parse --is-inside-work-tree", {
12941
+ execSync6("git rev-parse --is-inside-work-tree", {
12842
12942
  cwd: projectDir,
12843
12943
  stdio: "pipe"
12844
12944
  });
@@ -12847,7 +12947,7 @@ function runDoctorChecks(projectDir, config) {
12847
12947
  checks.push({ name: "git", status: "fail", detail: "Not a git repository" });
12848
12948
  }
12849
12949
  try {
12850
- execSync5(`which ${config.provider}`, { stdio: "pipe" });
12950
+ execSync6(`which ${config.provider}`, { stdio: "pipe" });
12851
12951
  checks.push({
12852
12952
  name: "provider",
12853
12953
  status: "pass",
@@ -12936,7 +13036,11 @@ function createProjectDoctorRoutes() {
12936
13036
  });
12937
13037
  return router;
12938
13038
  }
13039
+
13040
+ // ../server/dist/routes/log.routes.js
12939
13041
  init_dist();
13042
+ import * as path30 from "path";
13043
+ import { Router as Router6 } from "express";
12940
13044
  function createLogRoutes(deps) {
12941
13045
  const { projectDir } = deps;
12942
13046
  const router = Router6();
@@ -12989,6 +13093,9 @@ function createProjectLogRoutes() {
12989
13093
  });
12990
13094
  return router;
12991
13095
  }
13096
+
13097
+ // ../server/dist/routes/prd.routes.js
13098
+ import { Router as Router7 } from "express";
12992
13099
  function createPrdRoutes(_deps) {
12993
13100
  const router = Router7();
12994
13101
  router.get("/", (_req, res) => {
@@ -13009,7 +13116,11 @@ function createProjectPrdRoutes() {
13009
13116
  });
13010
13117
  return router;
13011
13118
  }
13119
+
13120
+ // ../server/dist/routes/roadmap.routes.js
13012
13121
  init_dist();
13122
+ import * as path31 from "path";
13123
+ import { Router as Router8 } from "express";
13013
13124
  function createRoadmapRouteHandlers(ctx) {
13014
13125
  const router = Router8({ mergeParams: true });
13015
13126
  const p = ctx.pathPrefix;
@@ -13089,7 +13200,11 @@ function createProjectRoadmapRoutes() {
13089
13200
  pathPrefix: "roadmap/"
13090
13201
  });
13091
13202
  }
13203
+
13204
+ // ../server/dist/routes/status.routes.js
13092
13205
  init_dist();
13206
+ import { Router as Router9 } from "express";
13207
+ import { CronExpressionParser } from "cron-parser";
13093
13208
  function createStatusRoutes(deps) {
13094
13209
  const { projectDir, getConfig, sseClients } = deps;
13095
13210
  const router = Router9();
@@ -13272,6 +13387,8 @@ data: ${JSON.stringify(snapshot)}
13272
13387
  });
13273
13388
  return router;
13274
13389
  }
13390
+
13391
+ // ../server/dist/index.js
13275
13392
  var __filename2 = fileURLToPath3(import.meta.url);
13276
13393
  var __dirname3 = dirname7(__filename2);
13277
13394
  function resolveWebDistPath() {
@@ -13452,6 +13569,8 @@ Night Watch Global UI`);
13452
13569
  });
13453
13570
  setupGracefulShutdown(server);
13454
13571
  }
13572
+
13573
+ // dist/commands/serve.js
13455
13574
  function getServeLockPath(mode, port) {
13456
13575
  return `${LOCK_FILE_PREFIX}serve-${mode}-${port}.lock`;
13457
13576
  }
@@ -13573,6 +13692,8 @@ function serveCommand(program2) {
13573
13692
  }
13574
13693
  });
13575
13694
  }
13695
+
13696
+ // dist/commands/history.js
13576
13697
  init_dist();
13577
13698
  var VALID_OUTCOMES = ["success", "failure", "timeout", "rate_limited"];
13578
13699
  function historyCommand(program2) {
@@ -13611,7 +13732,12 @@ function historyCommand(program2) {
13611
13732
  }
13612
13733
  });
13613
13734
  }
13735
+
13736
+ // dist/commands/update.js
13614
13737
  init_dist();
13738
+ import { spawnSync } from "child_process";
13739
+ import * as fs32 from "fs";
13740
+ import * as path33 from "path";
13615
13741
  var DEFAULT_GLOBAL_SPEC = "@jonit-dev/night-watch-cli@latest";
13616
13742
  function parseProjectDirs(projects, cwd) {
13617
13743
  if (!projects || projects.trim().length === 0) {
@@ -13620,6 +13746,9 @@ function parseProjectDirs(projects, cwd) {
13620
13746
  const dirs = projects.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0).map((entry) => path33.resolve(cwd, entry));
13621
13747
  return Array.from(new Set(dirs));
13622
13748
  }
13749
+ function shouldInstallGlobal(options) {
13750
+ return options.global !== false;
13751
+ }
13623
13752
  function runCommand2(command, args, cwd) {
13624
13753
  const result = spawnSync(command, args, {
13625
13754
  cwd,
@@ -13649,7 +13778,7 @@ function updateCommand(program2) {
13649
13778
  try {
13650
13779
  const cwd = process.cwd();
13651
13780
  const projectDirs = parseProjectDirs(options.projects, cwd);
13652
- if (!options.noGlobal) {
13781
+ if (shouldInstallGlobal(options)) {
13653
13782
  dim(`Updating global install: npm install -g ${options.globalSpec}`);
13654
13783
  runCommand2("npm", ["install", "-g", options.globalSpec]);
13655
13784
  success("Global CLI update completed.");
@@ -13672,6 +13801,8 @@ function updateCommand(program2) {
13672
13801
  }
13673
13802
  });
13674
13803
  }
13804
+
13805
+ // dist/commands/prd-state.js
13675
13806
  init_dist();
13676
13807
  function prdStateCommand(program2) {
13677
13808
  const prdState = program2.command("prd-state").description("Manage PRD state entries in ~/.night-watch/prd-states.json");
@@ -13695,7 +13826,11 @@ function prdStateCommand(program2) {
13695
13826
  }
13696
13827
  });
13697
13828
  }
13829
+
13830
+ // dist/commands/retry.js
13698
13831
  init_dist();
13832
+ import * as fs33 from "fs";
13833
+ import * as path34 from "path";
13699
13834
  function normalizePrdName(name) {
13700
13835
  if (!name.endsWith(".md")) {
13701
13836
  return `${name}.md`;
@@ -13741,7 +13876,10 @@ function retryCommand(program2) {
13741
13876
  process.exit(1);
13742
13877
  });
13743
13878
  }
13879
+
13880
+ // dist/commands/prs.js
13744
13881
  init_dist();
13882
+ import chalk3 from "chalk";
13745
13883
  function formatCiStatus(status) {
13746
13884
  switch (status) {
13747
13885
  case "pass":
@@ -13818,10 +13956,14 @@ function prsCommand(program2) {
13818
13956
  }
13819
13957
  });
13820
13958
  }
13959
+
13960
+ // dist/commands/prds.js
13821
13961
  init_dist();
13962
+ import chalk4 from "chalk";
13963
+ import { execSync as execSync7 } from "child_process";
13822
13964
  function getOpenPrBranches(projectDir) {
13823
13965
  try {
13824
- execSync6("git rev-parse --git-dir", {
13966
+ execSync7("git rev-parse --git-dir", {
13825
13967
  cwd: projectDir,
13826
13968
  encoding: "utf-8",
13827
13969
  stdio: ["pipe", "pipe", "pipe"]
@@ -13830,12 +13972,12 @@ function getOpenPrBranches(projectDir) {
13830
13972
  return /* @__PURE__ */ new Set();
13831
13973
  }
13832
13974
  try {
13833
- execSync6("which gh", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
13975
+ execSync7("which gh", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
13834
13976
  } catch {
13835
13977
  return /* @__PURE__ */ new Set();
13836
13978
  }
13837
13979
  try {
13838
- const output = execSync6("gh pr list --state open --json headRefName", {
13980
+ const output = execSync7("gh pr list --state open --json headRefName", {
13839
13981
  cwd: projectDir,
13840
13982
  encoding: "utf-8",
13841
13983
  stdio: ["pipe", "pipe", "pipe"]
@@ -13958,7 +14100,11 @@ function prdsCommand(program2) {
13958
14100
  }
13959
14101
  });
13960
14102
  }
14103
+
14104
+ // dist/commands/cancel.js
13961
14105
  init_dist();
14106
+ import * as fs34 from "fs";
14107
+ import * as readline3 from "readline";
13962
14108
  function getLockFilePaths2(projectDir) {
13963
14109
  const runtimeKey = projectRuntimeKey(projectDir);
13964
14110
  return {
@@ -14135,7 +14281,11 @@ function cancelCommand(program2) {
14135
14281
  }
14136
14282
  });
14137
14283
  }
14284
+
14285
+ // dist/commands/slice.js
14138
14286
  init_dist();
14287
+ import * as fs35 from "fs";
14288
+ import * as path35 from "path";
14139
14289
  function plannerLockPath2(projectDir) {
14140
14290
  return `${LOCK_FILE_PREFIX}slicer-${projectRuntimeKey(projectDir)}.lock`;
14141
14291
  }
@@ -14395,7 +14545,13 @@ function sliceCommand(program2) {
14395
14545
  }
14396
14546
  });
14397
14547
  }
14548
+
14549
+ // dist/commands/state.js
14398
14550
  init_dist();
14551
+ import * as os6 from "os";
14552
+ import * as path36 from "path";
14553
+ import chalk5 from "chalk";
14554
+ import { Command } from "commander";
14399
14555
  function createStateCommand() {
14400
14556
  const state = new Command("state");
14401
14557
  state.description("Manage Night Watch state");
@@ -14435,8 +14591,15 @@ function createStateCommand() {
14435
14591
  });
14436
14592
  return state;
14437
14593
  }
14594
+
14595
+ // dist/commands/board.js
14438
14596
  init_dist();
14439
14597
  init_dist();
14598
+ import { execFileSync as execFileSync6 } from "child_process";
14599
+ import * as fs36 from "fs";
14600
+ import * as path37 from "path";
14601
+ import * as readline4 from "readline";
14602
+ import chalk6 from "chalk";
14440
14603
  async function run(fn) {
14441
14604
  try {
14442
14605
  await fn();
@@ -14964,6 +15127,8 @@ function boardCommand(program2) {
14964
15127
  }
14965
15128
  }));
14966
15129
  }
15130
+
15131
+ // dist/cli.js
14967
15132
  var __filename3 = fileURLToPath4(import.meta.url);
14968
15133
  var __dirname4 = dirname8(__filename3);
14969
15134
  function findPackageRoot(dir) {