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