@jonit-dev/night-watch-cli 1.7.92 → 1.7.95
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 +154 -68
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +106 -50
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +14 -0
- package/dist/commands/run.js.map +1 -1
- package/dist/web/assets/index-Bvh8XI8_.js +370 -0
- package/dist/web/assets/index-IKrZymWk.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1494,20 +1494,27 @@ function runMigrations(db) {
|
|
|
1494
1494
|
db.exec(`ALTER TABLE job_queue ADD COLUMN provider_key TEXT`);
|
|
1495
1495
|
} catch {
|
|
1496
1496
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1497
|
+
const projectsSchemaV2Done = db.prepare("SELECT value FROM schema_meta WHERE key = 'projects_schema_v2'").get();
|
|
1498
|
+
if (!projectsSchemaV2Done) {
|
|
1499
|
+
const columns = db.prepare("PRAGMA table_info(projects)").all();
|
|
1500
|
+
if (columns.some((c) => c.name === "slack_channel_id")) {
|
|
1501
|
+
db.transaction(() => {
|
|
1502
|
+
db.prepare(`
|
|
1503
|
+
CREATE TABLE projects_new (
|
|
1504
|
+
id INTEGER PRIMARY KEY,
|
|
1505
|
+
name TEXT NOT NULL,
|
|
1506
|
+
path TEXT NOT NULL UNIQUE,
|
|
1507
|
+
created_at INTEGER NOT NULL
|
|
1508
|
+
)
|
|
1509
|
+
`).run();
|
|
1510
|
+
db.prepare(`INSERT OR IGNORE INTO projects_new (id, name, path, created_at)
|
|
1511
|
+
SELECT id, name, path, created_at FROM projects`).run();
|
|
1512
|
+
db.prepare("DROP TABLE projects").run();
|
|
1513
|
+
db.prepare("ALTER TABLE projects_new RENAME TO projects").run();
|
|
1514
|
+
})();
|
|
1515
|
+
}
|
|
1516
|
+
db.prepare(`INSERT INTO schema_meta (key, value) VALUES ('projects_schema_v2', '1')
|
|
1517
|
+
ON CONFLICT(key) DO UPDATE SET value = excluded.value`).run();
|
|
1511
1518
|
}
|
|
1512
1519
|
db.prepare(`INSERT INTO schema_meta (key, value) VALUES ('schema_version', ?)
|
|
1513
1520
|
ON CONFLICT(key) DO UPDATE SET value = excluded.value`).run(SCHEMA_VERSION);
|
|
@@ -4559,6 +4566,8 @@ function getEventEmoji(event) {
|
|
|
4559
4566
|
return "\u274C";
|
|
4560
4567
|
case "run_timeout":
|
|
4561
4568
|
return "\u23F0";
|
|
4569
|
+
case "run_no_work":
|
|
4570
|
+
return "\u{1F4D6}";
|
|
4562
4571
|
case "review_completed":
|
|
4563
4572
|
return "\u{1F50D}";
|
|
4564
4573
|
case "rate_limit_fallback":
|
|
@@ -4579,6 +4588,8 @@ function getEventTitle(event) {
|
|
|
4579
4588
|
return "PRD Execution Failed";
|
|
4580
4589
|
case "run_timeout":
|
|
4581
4590
|
return "PRD Execution Timed Out";
|
|
4591
|
+
case "run_no_work":
|
|
4592
|
+
return "No Eligible Work";
|
|
4582
4593
|
case "review_completed":
|
|
4583
4594
|
return "PR Review Completed";
|
|
4584
4595
|
case "rate_limit_fallback":
|
|
@@ -4599,6 +4610,8 @@ function getEventColor(event) {
|
|
|
4599
4610
|
return 16711680;
|
|
4600
4611
|
case "run_timeout":
|
|
4601
4612
|
return 16711680;
|
|
4613
|
+
case "run_no_work":
|
|
4614
|
+
return 9807270;
|
|
4602
4615
|
case "review_completed":
|
|
4603
4616
|
return 39423;
|
|
4604
4617
|
case "rate_limit_fallback":
|
|
@@ -6202,6 +6215,11 @@ function openDb() {
|
|
|
6202
6215
|
const dbPath = getStateDbPath();
|
|
6203
6216
|
const db = new Database7(dbPath);
|
|
6204
6217
|
db.pragma("journal_mode = WAL");
|
|
6218
|
+
db.pragma("busy_timeout = 5000");
|
|
6219
|
+
if (!_migrationsApplied) {
|
|
6220
|
+
runMigrations(db);
|
|
6221
|
+
_migrationsApplied = true;
|
|
6222
|
+
}
|
|
6205
6223
|
return db;
|
|
6206
6224
|
}
|
|
6207
6225
|
function rowToEntry(row) {
|
|
@@ -6661,16 +6679,18 @@ function getJobRunsAnalytics(windowHours = 24) {
|
|
|
6661
6679
|
db.close();
|
|
6662
6680
|
}
|
|
6663
6681
|
}
|
|
6664
|
-
var logger;
|
|
6682
|
+
var logger, _migrationsApplied;
|
|
6665
6683
|
var init_job_queue = __esm({
|
|
6666
6684
|
"../core/dist/utils/job-queue.js"() {
|
|
6667
6685
|
"use strict";
|
|
6668
6686
|
init_config();
|
|
6669
6687
|
init_constants();
|
|
6688
|
+
init_migrations();
|
|
6670
6689
|
init_logger();
|
|
6671
6690
|
init_scheduling();
|
|
6672
6691
|
init_status_data();
|
|
6673
6692
|
logger = createLogger("job-queue");
|
|
6693
|
+
_migrationsApplied = false;
|
|
6674
6694
|
}
|
|
6675
6695
|
});
|
|
6676
6696
|
|
|
@@ -7270,6 +7290,33 @@ function promptYesNo(question, defaultNo = true) {
|
|
|
7270
7290
|
});
|
|
7271
7291
|
});
|
|
7272
7292
|
}
|
|
7293
|
+
function isInteractiveInitSession() {
|
|
7294
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
7295
|
+
}
|
|
7296
|
+
function chooseProviderForNonInteractive(providers) {
|
|
7297
|
+
if (providers.includes("claude")) {
|
|
7298
|
+
return "claude";
|
|
7299
|
+
}
|
|
7300
|
+
return providers[0];
|
|
7301
|
+
}
|
|
7302
|
+
function getGitHubRemoteStatus(cwd) {
|
|
7303
|
+
try {
|
|
7304
|
+
const remoteUrl = execSync3("git remote get-url origin", {
|
|
7305
|
+
cwd,
|
|
7306
|
+
encoding: "utf-8",
|
|
7307
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
7308
|
+
}).trim();
|
|
7309
|
+
return {
|
|
7310
|
+
hasGitHubRemote: remoteUrl.includes("github.com"),
|
|
7311
|
+
remoteUrl: remoteUrl || null
|
|
7312
|
+
};
|
|
7313
|
+
} catch {
|
|
7314
|
+
return {
|
|
7315
|
+
hasGitHubRemote: false,
|
|
7316
|
+
remoteUrl: null
|
|
7317
|
+
};
|
|
7318
|
+
}
|
|
7319
|
+
}
|
|
7273
7320
|
function installPlaywrightForQa(cwd) {
|
|
7274
7321
|
try {
|
|
7275
7322
|
const installCmd = resolvePlaywrightInstallCommand(cwd);
|
|
@@ -7478,10 +7525,18 @@ function initCommand(program2) {
|
|
|
7478
7525
|
const cwd = process.cwd();
|
|
7479
7526
|
const force = options.force || false;
|
|
7480
7527
|
const prdDir = options.prdDir || DEFAULT_PRD_DIR;
|
|
7481
|
-
const totalSteps =
|
|
7528
|
+
const totalSteps = 12;
|
|
7529
|
+
const interactive = isInteractiveInitSession();
|
|
7482
7530
|
console.log();
|
|
7483
7531
|
header("Night Watch CLI - Initializing");
|
|
7484
|
-
step(1, totalSteps, "Checking
|
|
7532
|
+
step(1, totalSteps, "Checking Node.js version...");
|
|
7533
|
+
const nodeCheck = checkNodeVersion(22);
|
|
7534
|
+
if (!nodeCheck.passed) {
|
|
7535
|
+
error(nodeCheck.message);
|
|
7536
|
+
process.exit(1);
|
|
7537
|
+
}
|
|
7538
|
+
success(nodeCheck.message);
|
|
7539
|
+
step(2, totalSteps, "Checking git repository...");
|
|
7485
7540
|
const gitCheck = checkGitRepo(cwd);
|
|
7486
7541
|
if (!gitCheck.passed) {
|
|
7487
7542
|
error(gitCheck.message);
|
|
@@ -7489,13 +7544,6 @@ function initCommand(program2) {
|
|
|
7489
7544
|
process.exit(1);
|
|
7490
7545
|
}
|
|
7491
7546
|
success(gitCheck.message);
|
|
7492
|
-
step(2, totalSteps, "Checking GitHub CLI (gh)...");
|
|
7493
|
-
const ghCheck = checkGhCli();
|
|
7494
|
-
if (!ghCheck.passed) {
|
|
7495
|
-
error(ghCheck.message);
|
|
7496
|
-
process.exit(1);
|
|
7497
|
-
}
|
|
7498
|
-
success(ghCheck.message);
|
|
7499
7547
|
step(3, totalSteps, "Detecting AI providers...");
|
|
7500
7548
|
let selectedProvider;
|
|
7501
7549
|
if (options.provider) {
|
|
@@ -7505,6 +7553,14 @@ function initCommand(program2) {
|
|
|
7505
7553
|
process.exit(1);
|
|
7506
7554
|
}
|
|
7507
7555
|
selectedProvider = options.provider;
|
|
7556
|
+
const providerCheck = checkProviderCli(selectedProvider);
|
|
7557
|
+
if (!providerCheck.passed) {
|
|
7558
|
+
error(providerCheck.message);
|
|
7559
|
+
console.log(
|
|
7560
|
+
`Install the ${selectedProvider} CLI or rerun with --provider ${detectProviders()[0] ?? "claude"}.`
|
|
7561
|
+
);
|
|
7562
|
+
process.exit(1);
|
|
7563
|
+
}
|
|
7508
7564
|
info(`Using provider from flag: ${selectedProvider}`);
|
|
7509
7565
|
} else {
|
|
7510
7566
|
const detectedProviders = detectProviders();
|
|
@@ -7518,17 +7574,36 @@ function initCommand(program2) {
|
|
|
7518
7574
|
selectedProvider = detectedProviders[0];
|
|
7519
7575
|
info(`Auto-detected provider: ${selectedProvider}`);
|
|
7520
7576
|
} else {
|
|
7521
|
-
|
|
7522
|
-
selectedProvider =
|
|
7523
|
-
info(
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7577
|
+
if (!interactive) {
|
|
7578
|
+
selectedProvider = chooseProviderForNonInteractive(detectedProviders);
|
|
7579
|
+
info(
|
|
7580
|
+
`Multiple providers detected in a non-interactive shell; defaulting to ${selectedProvider}. Use --provider to override.`
|
|
7581
|
+
);
|
|
7582
|
+
} else {
|
|
7583
|
+
try {
|
|
7584
|
+
selectedProvider = await promptProviderSelection(detectedProviders);
|
|
7585
|
+
info(`Selected provider: ${selectedProvider}`);
|
|
7586
|
+
} catch (err) {
|
|
7587
|
+
error(`${err instanceof Error ? err.message : String(err)}`);
|
|
7588
|
+
process.exit(1);
|
|
7589
|
+
}
|
|
7527
7590
|
}
|
|
7528
7591
|
}
|
|
7529
7592
|
}
|
|
7530
|
-
step(4, totalSteps, "
|
|
7593
|
+
step(4, totalSteps, "Checking GitHub integration prerequisites...");
|
|
7594
|
+
const remoteStatus = getGitHubRemoteStatus(cwd);
|
|
7595
|
+
const ghCheck = checkGhCli();
|
|
7596
|
+
const ghAuthenticated = ghCheck.passed;
|
|
7597
|
+
if (!remoteStatus.hasGitHubRemote) {
|
|
7598
|
+
info("No GitHub remote detected. Board setup will be skipped for now.");
|
|
7599
|
+
} else if (!ghAuthenticated) {
|
|
7600
|
+
warn(`${ghCheck.message}. Board setup will be skipped during init.`);
|
|
7601
|
+
} else {
|
|
7602
|
+
success(ghCheck.message);
|
|
7603
|
+
}
|
|
7604
|
+
step(5, totalSteps, "Detecting test frameworks...");
|
|
7531
7605
|
const playwrightDetected = detectPlaywright(cwd);
|
|
7606
|
+
let playwrightStatus = playwrightDetected ? "detected" : "not installed";
|
|
7532
7607
|
if (playwrightDetected) {
|
|
7533
7608
|
info("Playwright: detected");
|
|
7534
7609
|
} else {
|
|
@@ -7536,8 +7611,10 @@ function initCommand(program2) {
|
|
|
7536
7611
|
const installPlaywright = await promptYesNo("Install Playwright for QA now?", true);
|
|
7537
7612
|
if (installPlaywright) {
|
|
7538
7613
|
if (installPlaywrightForQa(cwd)) {
|
|
7614
|
+
playwrightStatus = "installed during init";
|
|
7539
7615
|
success("Installed Playwright test runner and Chromium browser.");
|
|
7540
7616
|
} else {
|
|
7617
|
+
playwrightStatus = "install failed";
|
|
7541
7618
|
console.warn(
|
|
7542
7619
|
" Warning: Failed to install Playwright automatically. You can install it later."
|
|
7543
7620
|
);
|
|
@@ -7560,18 +7637,18 @@ function initCommand(program2) {
|
|
|
7560
7637
|
"${PROJECT_NAME}": projectName,
|
|
7561
7638
|
"${DEFAULT_BRANCH}": defaultBranch
|
|
7562
7639
|
};
|
|
7563
|
-
step(
|
|
7640
|
+
step(6, totalSteps, "Creating PRD directory structure...");
|
|
7564
7641
|
const prdDirPath = path18.join(cwd, prdDir);
|
|
7565
7642
|
const doneDirPath = path18.join(prdDirPath, "done");
|
|
7566
7643
|
ensureDir(doneDirPath);
|
|
7567
7644
|
success(`Created ${prdDirPath}/`);
|
|
7568
7645
|
success(`Created ${doneDirPath}/`);
|
|
7569
|
-
step(
|
|
7646
|
+
step(7, totalSteps, "Creating logs directory...");
|
|
7570
7647
|
const logsPath = path18.join(cwd, LOG_DIR);
|
|
7571
7648
|
ensureDir(logsPath);
|
|
7572
7649
|
success(`Created ${logsPath}/`);
|
|
7573
7650
|
addToGitignore(cwd);
|
|
7574
|
-
step(
|
|
7651
|
+
step(8, totalSteps, "Creating instructions directory...");
|
|
7575
7652
|
const instructionsDir = path18.join(cwd, "instructions");
|
|
7576
7653
|
ensureDir(instructionsDir);
|
|
7577
7654
|
success(`Created ${instructionsDir}/`);
|
|
@@ -7633,7 +7710,7 @@ function initCommand(program2) {
|
|
|
7633
7710
|
auditResolution.source
|
|
7634
7711
|
);
|
|
7635
7712
|
templateSources.push({ name: "audit.md", source: auditResult.source });
|
|
7636
|
-
step(
|
|
7713
|
+
step(9, totalSteps, "Creating configuration file...");
|
|
7637
7714
|
const configPath = path18.join(cwd, CONFIG_FILE_NAME);
|
|
7638
7715
|
if (fs18.existsSync(configPath) && !force) {
|
|
7639
7716
|
console.log(` Skipped (exists): ${configPath}`);
|
|
@@ -7648,26 +7725,22 @@ function initCommand(program2) {
|
|
|
7648
7725
|
fs18.writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
7649
7726
|
success(`Created ${configPath}`);
|
|
7650
7727
|
}
|
|
7651
|
-
step(
|
|
7728
|
+
step(10, totalSteps, "Setting up GitHub Project board...");
|
|
7652
7729
|
const existingRaw = JSON.parse(fs18.readFileSync(configPath, "utf-8"));
|
|
7653
7730
|
const existingBoard = existingRaw.boardProvider;
|
|
7731
|
+
let boardSetupStatus = "Skipped";
|
|
7654
7732
|
if (existingBoard?.projectNumber && !force) {
|
|
7733
|
+
boardSetupStatus = `Already configured (#${existingBoard.projectNumber})`;
|
|
7655
7734
|
info(`Board already configured (#${existingBoard.projectNumber}), skipping.`);
|
|
7656
7735
|
} else {
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
const remoteUrl = execSync3("git remote get-url origin", {
|
|
7660
|
-
cwd,
|
|
7661
|
-
encoding: "utf-8",
|
|
7662
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
7663
|
-
}).trim();
|
|
7664
|
-
hasGitHubRemote = remoteUrl.includes("github.com");
|
|
7665
|
-
} catch {
|
|
7666
|
-
}
|
|
7667
|
-
if (!hasGitHubRemote) {
|
|
7736
|
+
if (!remoteStatus.hasGitHubRemote) {
|
|
7737
|
+
boardSetupStatus = "Skipped (no GitHub remote)";
|
|
7668
7738
|
info(
|
|
7669
7739
|
"No GitHub remote detected \u2014 skipping board setup. Run `night-watch board setup` manually."
|
|
7670
7740
|
);
|
|
7741
|
+
} else if (!ghAuthenticated) {
|
|
7742
|
+
boardSetupStatus = "Skipped (gh auth required)";
|
|
7743
|
+
info("GitHub CLI is not authenticated \u2014 run `gh auth login`, then `night-watch board setup`.");
|
|
7671
7744
|
} else {
|
|
7672
7745
|
try {
|
|
7673
7746
|
const provider = createBoardProvider({ enabled: true, provider: "github" }, cwd);
|
|
@@ -7680,8 +7753,10 @@ function initCommand(program2) {
|
|
|
7680
7753
|
projectNumber: board.number
|
|
7681
7754
|
};
|
|
7682
7755
|
fs18.writeFileSync(configPath, JSON.stringify(rawConfig, null, 2) + "\n");
|
|
7756
|
+
boardSetupStatus = `Created (#${board.number})`;
|
|
7683
7757
|
success(`GitHub Project board "${boardTitle}" ready (#${board.number})`);
|
|
7684
7758
|
} catch (boardErr) {
|
|
7759
|
+
boardSetupStatus = "Failed (manual setup required)";
|
|
7685
7760
|
console.warn(
|
|
7686
7761
|
` Warning: Could not set up GitHub Project board: ${boardErr instanceof Error ? boardErr.message : String(boardErr)}`
|
|
7687
7762
|
);
|
|
@@ -7689,7 +7764,7 @@ function initCommand(program2) {
|
|
|
7689
7764
|
}
|
|
7690
7765
|
}
|
|
7691
7766
|
}
|
|
7692
|
-
step(
|
|
7767
|
+
step(11, totalSteps, "Registering project in global registry...");
|
|
7693
7768
|
try {
|
|
7694
7769
|
const { registerProject: registerProject2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
|
7695
7770
|
const entry = registerProject2(cwd);
|
|
@@ -7699,7 +7774,7 @@ function initCommand(program2) {
|
|
|
7699
7774
|
` Warning: Could not register in global registry: ${regErr instanceof Error ? regErr.message : String(regErr)}`
|
|
7700
7775
|
);
|
|
7701
7776
|
}
|
|
7702
|
-
step(
|
|
7777
|
+
step(12, totalSteps, "Initialization complete!");
|
|
7703
7778
|
header("Initialization Complete");
|
|
7704
7779
|
const filesTable = createTable({ head: ["Created Files", ""] });
|
|
7705
7780
|
filesTable.push(["PRD Directory", `${prdDir}/done/`]);
|
|
@@ -7710,16 +7785,19 @@ function initCommand(program2) {
|
|
|
7710
7785
|
filesTable.push(["", `instructions/qa.md (${templateSources[3].source})`]);
|
|
7711
7786
|
filesTable.push(["", `instructions/audit.md (${templateSources[4].source})`]);
|
|
7712
7787
|
filesTable.push(["Config File", CONFIG_FILE_NAME]);
|
|
7788
|
+
filesTable.push(["Board Setup", boardSetupStatus]);
|
|
7713
7789
|
filesTable.push(["Global Registry", "~/.night-watch/projects.json"]);
|
|
7714
7790
|
console.log(filesTable.toString());
|
|
7715
7791
|
header("Configuration");
|
|
7716
7792
|
label("Provider", selectedProvider);
|
|
7717
7793
|
label("Reviewer", reviewerEnabled ? "Enabled" : "Disabled");
|
|
7794
|
+
label("Playwright", playwrightStatus);
|
|
7718
7795
|
console.log();
|
|
7719
7796
|
header("Next Steps");
|
|
7720
7797
|
info(`1. Add your PRD files to ${prdDir}/`);
|
|
7721
7798
|
info("2. Run `night-watch install` to set up cron jobs");
|
|
7722
|
-
info("3.
|
|
7799
|
+
info("3. Run `night-watch doctor` to verify the full setup");
|
|
7800
|
+
info("4. Or run `night-watch run` to execute PRDs manually");
|
|
7723
7801
|
console.log();
|
|
7724
7802
|
});
|
|
7725
7803
|
}
|
|
@@ -7810,6 +7888,9 @@ function resolveRunNotificationEvent(exitCode, scriptStatus) {
|
|
|
7810
7888
|
if (!scriptStatus || scriptStatus === "success_open_pr") {
|
|
7811
7889
|
return "run_succeeded";
|
|
7812
7890
|
}
|
|
7891
|
+
if (scriptStatus?.startsWith("skip_")) {
|
|
7892
|
+
return "run_no_work";
|
|
7893
|
+
}
|
|
7813
7894
|
return null;
|
|
7814
7895
|
}
|
|
7815
7896
|
function shouldAttemptCrossProjectFallback(options, scriptStatus) {
|
|
@@ -7981,9 +8062,12 @@ function buildEnvVars(config, options) {
|
|
|
7981
8062
|
try {
|
|
7982
8063
|
const fallbackPreset = resolvePreset(config, config.primaryFallbackPreset);
|
|
7983
8064
|
env.NW_FALLBACK_PRIMARY_PRESET_CMD = fallbackPreset.command;
|
|
7984
|
-
if (fallbackPreset.promptFlag)
|
|
7985
|
-
|
|
7986
|
-
if (fallbackPreset.
|
|
8065
|
+
if (fallbackPreset.promptFlag)
|
|
8066
|
+
env.NW_FALLBACK_PRIMARY_PRESET_PROMPT_FLAG = fallbackPreset.promptFlag;
|
|
8067
|
+
if (fallbackPreset.autoApproveFlag)
|
|
8068
|
+
env.NW_FALLBACK_PRIMARY_PRESET_AUTO_APPROVE_FLAG = fallbackPreset.autoApproveFlag;
|
|
8069
|
+
if (fallbackPreset.modelFlag)
|
|
8070
|
+
env.NW_FALLBACK_PRIMARY_PRESET_MODEL_FLAG = fallbackPreset.modelFlag;
|
|
7987
8071
|
if (fallbackPreset.model) env.NW_FALLBACK_PRIMARY_PRESET_MODEL = fallbackPreset.model;
|
|
7988
8072
|
if (fallbackPreset.envVars && Object.keys(fallbackPreset.envVars).length > 0) {
|
|
7989
8073
|
env.NW_FALLBACK_PRIMARY_PRESET_ENV = JSON.stringify(fallbackPreset.envVars);
|
|
@@ -7995,9 +8079,12 @@ function buildEnvVars(config, options) {
|
|
|
7995
8079
|
try {
|
|
7996
8080
|
const fallbackPreset = resolvePreset(config, config.secondaryFallbackPreset);
|
|
7997
8081
|
env.NW_FALLBACK_SECONDARY_PRESET_CMD = fallbackPreset.command;
|
|
7998
|
-
if (fallbackPreset.promptFlag)
|
|
7999
|
-
|
|
8000
|
-
if (fallbackPreset.
|
|
8082
|
+
if (fallbackPreset.promptFlag)
|
|
8083
|
+
env.NW_FALLBACK_SECONDARY_PRESET_PROMPT_FLAG = fallbackPreset.promptFlag;
|
|
8084
|
+
if (fallbackPreset.autoApproveFlag)
|
|
8085
|
+
env.NW_FALLBACK_SECONDARY_PRESET_AUTO_APPROVE_FLAG = fallbackPreset.autoApproveFlag;
|
|
8086
|
+
if (fallbackPreset.modelFlag)
|
|
8087
|
+
env.NW_FALLBACK_SECONDARY_PRESET_MODEL_FLAG = fallbackPreset.modelFlag;
|
|
8001
8088
|
if (fallbackPreset.model) env.NW_FALLBACK_SECONDARY_PRESET_MODEL = fallbackPreset.model;
|
|
8002
8089
|
if (fallbackPreset.envVars && Object.keys(fallbackPreset.envVars).length > 0) {
|
|
8003
8090
|
env.NW_FALLBACK_SECONDARY_PRESET_ENV = JSON.stringify(fallbackPreset.envVars);
|
|
@@ -8169,6 +8256,15 @@ function runCommand(program2) {
|
|
|
8169
8256
|
console.log();
|
|
8170
8257
|
process.exit(0);
|
|
8171
8258
|
}
|
|
8259
|
+
if (process.env.NW_CROSS_PROJECT_FALLBACK_ACTIVE !== "1") {
|
|
8260
|
+
sendNotifications(config, {
|
|
8261
|
+
event: "run_started",
|
|
8262
|
+
projectName: path19.basename(projectDir),
|
|
8263
|
+
exitCode: 0,
|
|
8264
|
+
provider: config.provider
|
|
8265
|
+
}).catch(() => {
|
|
8266
|
+
});
|
|
8267
|
+
}
|
|
8172
8268
|
const spinner = createSpinner("Running PRD executor...");
|
|
8173
8269
|
spinner.start();
|
|
8174
8270
|
try {
|
|
@@ -12195,16 +12291,6 @@ function spawnAction2(projectDir, command, req, res, onSpawned) {
|
|
|
12195
12291
|
});
|
|
12196
12292
|
child.unref();
|
|
12197
12293
|
if (child.pid !== void 0) {
|
|
12198
|
-
if (command[0] === "run") {
|
|
12199
|
-
const config = loadConfig(projectDir);
|
|
12200
|
-
sendNotifications(config, {
|
|
12201
|
-
event: "run_started",
|
|
12202
|
-
projectName: path29.basename(projectDir),
|
|
12203
|
-
exitCode: 0,
|
|
12204
|
-
provider: config.provider
|
|
12205
|
-
}).catch(() => {
|
|
12206
|
-
});
|
|
12207
|
-
}
|
|
12208
12294
|
if (onSpawned) {
|
|
12209
12295
|
onSpawned(child.pid);
|
|
12210
12296
|
}
|
|
@@ -15573,7 +15659,7 @@ function queueCommand(program2) {
|
|
|
15573
15659
|
|
|
15574
15660
|
// src/commands/notify.ts
|
|
15575
15661
|
init_dist();
|
|
15576
|
-
import { basename as
|
|
15662
|
+
import { basename as basename13 } from "path";
|
|
15577
15663
|
var VALID_EVENTS = [
|
|
15578
15664
|
"run_started",
|
|
15579
15665
|
"run_succeeded",
|
|
@@ -15597,7 +15683,7 @@ function notifyCommand(program2) {
|
|
|
15597
15683
|
const config = loadConfig(projectDir);
|
|
15598
15684
|
await sendNotifications(config, {
|
|
15599
15685
|
event,
|
|
15600
|
-
projectName:
|
|
15686
|
+
projectName: basename13(projectDir),
|
|
15601
15687
|
prdName: options.prd,
|
|
15602
15688
|
branchName: options.branch,
|
|
15603
15689
|
provider: options.provider ?? config.provider,
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -6,6 +6,13 @@ interface IGeneratedInitConfig extends Omit<INightWatchConfig, '_cliProviderOver
|
|
|
6
6
|
projectName: string;
|
|
7
7
|
providerLabel: string;
|
|
8
8
|
}
|
|
9
|
+
interface IGitHubRemoteStatus {
|
|
10
|
+
hasGitHubRemote: boolean;
|
|
11
|
+
remoteUrl: string | null;
|
|
12
|
+
}
|
|
13
|
+
export declare function isInteractiveInitSession(): boolean;
|
|
14
|
+
export declare function chooseProviderForNonInteractive(providers: Provider[]): Provider;
|
|
15
|
+
export declare function getGitHubRemoteStatus(cwd: string): IGitHubRemoteStatus;
|
|
9
16
|
/**
|
|
10
17
|
* Get the default branch name for the repository
|
|
11
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,OAAO,EAIL,iBAAiB,EAEjB,QAAQ,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,OAAO,EAIL,iBAAiB,EAEjB,QAAQ,EAkBT,MAAM,mBAAmB,CAAC;AA6B3B,UAAU,oBAAqB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,mBAAmB;IAC3B,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAiFD,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAK/E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAkBtE;AAuBD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAiEpD;AAsCD,wBAAgB,eAAe,CAAC,MAAM,EAAE;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,oBAAoB,CAkDvB;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,kBAAkB,EAAE,MAAM,GAAG,IAAI,EACjC,mBAAmB,EAAE,MAAM,GAC1B,mBAAmB,CAQrB;AA0ED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqWlD;AAED,eAAe,WAAW,CAAC"}
|