@staff0rd/assist 0.172.1 → 0.172.2
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/README.md +1 -1
- package/dist/index.js +93 -92
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ After installation, the `assist` command will be available globally. You can als
|
|
|
80
80
|
- `assist news add [url]` - Add an RSS feed URL to the config
|
|
81
81
|
- `assist news web [-p, --port <number>]` - Start a web view of the news feeds (default port 3001)
|
|
82
82
|
- `assist backlog [--dir <path>]` - Start the backlog web UI (same as `backlog web`). `--dir` overrides the directory for backlog file discovery
|
|
83
|
-
- `assist backlog init` - Create an empty
|
|
83
|
+
- `assist backlog init` - Create an empty backlog
|
|
84
84
|
- `assist backlog list [--status <type>] [-v]` - List all backlog items with status icons
|
|
85
85
|
- `assist backlog add` - Add a new backlog item interactively (prompts for type: story/bug)
|
|
86
86
|
- `assist backlog add --file <path>` - Add a backlog item from a JSON file (used by `/draft`)
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.172.
|
|
9
|
+
version: "0.172.2",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -99,10 +99,11 @@ async function exitOnCancel(promise) {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
// src/commands/backlog/acquireLock.ts
|
|
102
|
-
import { existsSync as
|
|
102
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
103
103
|
import { join as join4 } from "path";
|
|
104
104
|
|
|
105
105
|
// src/commands/backlog/shared.ts
|
|
106
|
+
import { existsSync as existsSync2 } from "fs";
|
|
106
107
|
import { join as join3 } from "path";
|
|
107
108
|
import chalk from "chalk";
|
|
108
109
|
|
|
@@ -491,6 +492,10 @@ function getBacklogDir() {
|
|
|
491
492
|
function getBacklogPath() {
|
|
492
493
|
return join3(getBacklogDir(), "assist.backlog.yml");
|
|
493
494
|
}
|
|
495
|
+
function backlogExists() {
|
|
496
|
+
const dir = getBacklogDir();
|
|
497
|
+
return existsSync2(join3(dir, ".assist", "backlog.db")) || existsSync2(join3(dir, ".assist", "backlog.jsonl")) || existsSync2(join3(dir, "assist.backlog.yml"));
|
|
498
|
+
}
|
|
494
499
|
function getDb() {
|
|
495
500
|
const dir = getBacklogDir();
|
|
496
501
|
const db = openDb(dir);
|
|
@@ -562,7 +567,7 @@ function isProcessAlive(pid) {
|
|
|
562
567
|
}
|
|
563
568
|
function isLockedByOther(itemId) {
|
|
564
569
|
const lockPath = getLockPath(itemId);
|
|
565
|
-
if (!
|
|
570
|
+
if (!existsSync3(lockPath)) return false;
|
|
566
571
|
try {
|
|
567
572
|
const lock = JSON.parse(readFileSync3(lockPath, "utf-8"));
|
|
568
573
|
if (lock.pid === process.pid) return false;
|
|
@@ -754,7 +759,7 @@ function buildReviewPhase() {
|
|
|
754
759
|
import chalk4 from "chalk";
|
|
755
760
|
|
|
756
761
|
// src/commands/backlog/resolvePhaseResult.ts
|
|
757
|
-
import { existsSync as
|
|
762
|
+
import { existsSync as existsSync4, unlinkSync as unlinkSync2 } from "fs";
|
|
758
763
|
import chalk3 from "chalk";
|
|
759
764
|
|
|
760
765
|
// src/commands/backlog/handleIncompletePhase.ts
|
|
@@ -789,7 +794,7 @@ function writeSignal(event, data) {
|
|
|
789
794
|
// src/commands/backlog/resolvePhaseResult.ts
|
|
790
795
|
function cleanupSignal() {
|
|
791
796
|
const statusPath = getSignalPath();
|
|
792
|
-
if (
|
|
797
|
+
if (existsSync4(statusPath)) {
|
|
793
798
|
unlinkSync2(statusPath);
|
|
794
799
|
}
|
|
795
800
|
}
|
|
@@ -799,7 +804,7 @@ function isTerminalStatus(itemId) {
|
|
|
799
804
|
return item?.status === "done" || item?.status === "wontdo";
|
|
800
805
|
}
|
|
801
806
|
async function resolvePhaseResult(phaseIndex, itemId) {
|
|
802
|
-
if (!
|
|
807
|
+
if (!existsSync4(getSignalPath())) {
|
|
803
808
|
if (isTerminalStatus(itemId)) return -1;
|
|
804
809
|
const action = await handleIncompletePhase();
|
|
805
810
|
if (action === "abort") return -1;
|
|
@@ -829,13 +834,13 @@ function spawnClaude(prompt, options2 = {}) {
|
|
|
829
834
|
}
|
|
830
835
|
|
|
831
836
|
// src/commands/backlog/watchForMarker.ts
|
|
832
|
-
import { existsSync as
|
|
837
|
+
import { existsSync as existsSync6, unwatchFile, watchFile } from "fs";
|
|
833
838
|
|
|
834
839
|
// src/commands/backlog/readSignal.ts
|
|
835
|
-
import { existsSync as
|
|
840
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
|
|
836
841
|
function readSignal() {
|
|
837
842
|
const path50 = getSignalPath();
|
|
838
|
-
if (!
|
|
843
|
+
if (!existsSync5(path50)) return void 0;
|
|
839
844
|
try {
|
|
840
845
|
return JSON.parse(readFileSync4(path50, "utf-8"));
|
|
841
846
|
} catch {
|
|
@@ -848,7 +853,7 @@ function watchForMarker(child) {
|
|
|
848
853
|
const statusPath = getSignalPath();
|
|
849
854
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
850
855
|
watchFile(statusPath, { interval: 1e3 }, () => {
|
|
851
|
-
if (!
|
|
856
|
+
if (!existsSync6(statusPath)) return;
|
|
852
857
|
const signal = readSignal();
|
|
853
858
|
if (signal && (!signal.sessionId || signal.sessionId === sessionId)) {
|
|
854
859
|
unwatchFile(statusPath);
|
|
@@ -1423,17 +1428,17 @@ async function launchMode(slashCommand) {
|
|
|
1423
1428
|
import { execSync } from "child_process";
|
|
1424
1429
|
|
|
1425
1430
|
// src/shared/loadConfig.ts
|
|
1426
|
-
import { existsSync as
|
|
1431
|
+
import { existsSync as existsSync8, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
1427
1432
|
import { homedir } from "os";
|
|
1428
1433
|
import { basename, dirname as dirname2, join as join7 } from "path";
|
|
1429
1434
|
import chalk16 from "chalk";
|
|
1430
1435
|
import { stringify as stringifyYaml } from "yaml";
|
|
1431
1436
|
|
|
1432
1437
|
// src/shared/loadRawYaml.ts
|
|
1433
|
-
import { existsSync as
|
|
1438
|
+
import { existsSync as existsSync7, readFileSync as readFileSync6 } from "fs";
|
|
1434
1439
|
import { parse as parseYaml2 } from "yaml";
|
|
1435
1440
|
function loadRawYaml(path50) {
|
|
1436
|
-
if (!
|
|
1441
|
+
if (!existsSync7(path50)) return {};
|
|
1437
1442
|
try {
|
|
1438
1443
|
const content = readFileSync6(path50, "utf-8");
|
|
1439
1444
|
return parseYaml2(content) || {};
|
|
@@ -1566,9 +1571,9 @@ function findConfigUp(startDir) {
|
|
|
1566
1571
|
let current = startDir;
|
|
1567
1572
|
while (current !== dirname2(current)) {
|
|
1568
1573
|
const claudePath = join7(current, ".claude", "assist.yml");
|
|
1569
|
-
if (
|
|
1574
|
+
if (existsSync8(claudePath)) return claudePath;
|
|
1570
1575
|
const rootPath = join7(current, "assist.yml");
|
|
1571
|
-
if (
|
|
1576
|
+
if (existsSync8(rootPath)) return rootPath;
|
|
1572
1577
|
current = dirname2(current);
|
|
1573
1578
|
}
|
|
1574
1579
|
return null;
|
|
@@ -1606,7 +1611,7 @@ function getRepoName() {
|
|
|
1606
1611
|
return config.devlog.name;
|
|
1607
1612
|
}
|
|
1608
1613
|
const packageJsonPath = join7(process.cwd(), "package.json");
|
|
1609
|
-
if (
|
|
1614
|
+
if (existsSync8(packageJsonPath)) {
|
|
1610
1615
|
try {
|
|
1611
1616
|
const content = readFileSync7(packageJsonPath, "utf-8");
|
|
1612
1617
|
const pkg = JSON.parse(content);
|
|
@@ -2057,11 +2062,11 @@ import * as path3 from "path";
|
|
|
2057
2062
|
import chalk25 from "chalk";
|
|
2058
2063
|
|
|
2059
2064
|
// src/commands/verify/addToKnipIgnoreBinaries.ts
|
|
2060
|
-
import { existsSync as
|
|
2065
|
+
import { existsSync as existsSync10, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "fs";
|
|
2061
2066
|
import { join as join9 } from "path";
|
|
2062
2067
|
import chalk24 from "chalk";
|
|
2063
2068
|
function loadKnipConfig(knipJsonPath) {
|
|
2064
|
-
if (
|
|
2069
|
+
if (existsSync10(knipJsonPath)) {
|
|
2065
2070
|
return JSON.parse(readFileSync9(knipJsonPath, "utf-8"));
|
|
2066
2071
|
}
|
|
2067
2072
|
return { $schema: "https://unpkg.com/knip@5/schema.json" };
|
|
@@ -2115,7 +2120,7 @@ import chalk29 from "chalk";
|
|
|
2115
2120
|
|
|
2116
2121
|
// src/commands/lint/init.ts
|
|
2117
2122
|
import { execSync as execSync5 } from "child_process";
|
|
2118
|
-
import { existsSync as
|
|
2123
|
+
import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync8 } from "fs";
|
|
2119
2124
|
import { dirname as dirname7, join as join10 } from "path";
|
|
2120
2125
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2121
2126
|
import chalk28 from "chalk";
|
|
@@ -2141,10 +2146,10 @@ async function promptConfirm(message, initial = true) {
|
|
|
2141
2146
|
|
|
2142
2147
|
// src/shared/removeEslint/index.ts
|
|
2143
2148
|
import { execSync as execSync4 } from "child_process";
|
|
2144
|
-
import { existsSync as
|
|
2149
|
+
import { existsSync as existsSync12, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "fs";
|
|
2145
2150
|
|
|
2146
2151
|
// src/shared/removeEslint/removeEslintConfigFiles.ts
|
|
2147
|
-
import { existsSync as
|
|
2152
|
+
import { existsSync as existsSync11, unlinkSync as unlinkSync3 } from "fs";
|
|
2148
2153
|
var ESLINT_CONFIG_FILES = [
|
|
2149
2154
|
"eslint.config.js",
|
|
2150
2155
|
"eslint.config.mjs",
|
|
@@ -2160,7 +2165,7 @@ var ESLINT_CONFIG_FILES = [
|
|
|
2160
2165
|
function removeEslintConfigFiles() {
|
|
2161
2166
|
let removed = false;
|
|
2162
2167
|
for (const configFile of ESLINT_CONFIG_FILES) {
|
|
2163
|
-
if (
|
|
2168
|
+
if (existsSync11(configFile)) {
|
|
2164
2169
|
unlinkSync3(configFile);
|
|
2165
2170
|
console.log(`Removed ${configFile}`);
|
|
2166
2171
|
removed = true;
|
|
@@ -2182,7 +2187,7 @@ function removeEslint(options2 = {}) {
|
|
|
2182
2187
|
}
|
|
2183
2188
|
function removeEslintFromPackageJson(options2) {
|
|
2184
2189
|
const packageJsonPath = "package.json";
|
|
2185
|
-
if (!
|
|
2190
|
+
if (!existsSync12(packageJsonPath)) {
|
|
2186
2191
|
return false;
|
|
2187
2192
|
}
|
|
2188
2193
|
const packageJson = JSON.parse(readFileSync10(packageJsonPath, "utf-8"));
|
|
@@ -2255,11 +2260,11 @@ var __dirname2 = dirname7(fileURLToPath2(import.meta.url));
|
|
|
2255
2260
|
async function init() {
|
|
2256
2261
|
removeEslint();
|
|
2257
2262
|
const biomeConfigPath = "biome.json";
|
|
2258
|
-
if (!
|
|
2263
|
+
if (!existsSync13(biomeConfigPath)) {
|
|
2259
2264
|
console.log("Initializing Biome...");
|
|
2260
2265
|
execSync5("npx @biomejs/biome init", { stdio: "inherit" });
|
|
2261
2266
|
}
|
|
2262
|
-
if (!
|
|
2267
|
+
if (!existsSync13(biomeConfigPath)) {
|
|
2263
2268
|
console.log("No biome.json found, skipping linter config");
|
|
2264
2269
|
return;
|
|
2265
2270
|
}
|
|
@@ -3393,7 +3398,7 @@ async function newCli() {
|
|
|
3393
3398
|
|
|
3394
3399
|
// src/commands/new/registerNew/newProject.ts
|
|
3395
3400
|
import { execSync as execSync13 } from "child_process";
|
|
3396
|
-
import { existsSync as
|
|
3401
|
+
import { existsSync as existsSync17, readFileSync as readFileSync14, writeFileSync as writeFileSync13 } from "fs";
|
|
3397
3402
|
|
|
3398
3403
|
// src/commands/deploy/init/index.ts
|
|
3399
3404
|
import { execSync as execSync12 } from "child_process";
|
|
@@ -3401,14 +3406,14 @@ import chalk40 from "chalk";
|
|
|
3401
3406
|
import enquirer5 from "enquirer";
|
|
3402
3407
|
|
|
3403
3408
|
// src/commands/deploy/init/updateWorkflow.ts
|
|
3404
|
-
import { existsSync as
|
|
3409
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync4, readFileSync as readFileSync13, writeFileSync as writeFileSync12 } from "fs";
|
|
3405
3410
|
import { dirname as dirname13, join as join13 } from "path";
|
|
3406
3411
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
3407
3412
|
import chalk39 from "chalk";
|
|
3408
3413
|
var WORKFLOW_PATH = ".github/workflows/build.yml";
|
|
3409
3414
|
var __dirname3 = dirname13(fileURLToPath3(import.meta.url));
|
|
3410
3415
|
function getExistingSiteId() {
|
|
3411
|
-
if (!
|
|
3416
|
+
if (!existsSync16(WORKFLOW_PATH)) {
|
|
3412
3417
|
return null;
|
|
3413
3418
|
}
|
|
3414
3419
|
const content = readFileSync13(WORKFLOW_PATH, "utf-8");
|
|
@@ -3423,10 +3428,10 @@ function getTemplateContent(siteId) {
|
|
|
3423
3428
|
async function updateWorkflow(siteId) {
|
|
3424
3429
|
const newContent = getTemplateContent(siteId);
|
|
3425
3430
|
const workflowDir = ".github/workflows";
|
|
3426
|
-
if (!
|
|
3431
|
+
if (!existsSync16(workflowDir)) {
|
|
3427
3432
|
mkdirSync4(workflowDir, { recursive: true });
|
|
3428
3433
|
}
|
|
3429
|
-
if (
|
|
3434
|
+
if (existsSync16(WORKFLOW_PATH)) {
|
|
3430
3435
|
const oldContent = readFileSync13(WORKFLOW_PATH, "utf-8");
|
|
3431
3436
|
if (oldContent === newContent) {
|
|
3432
3437
|
console.log(chalk39.green("build.yml is already up to date"));
|
|
@@ -3521,7 +3526,7 @@ async function newProject() {
|
|
|
3521
3526
|
}
|
|
3522
3527
|
function addViteBaseConfig() {
|
|
3523
3528
|
const viteConfigPath = "vite.config.ts";
|
|
3524
|
-
if (!
|
|
3529
|
+
if (!existsSync17(viteConfigPath)) {
|
|
3525
3530
|
console.log("No vite.config.ts found, skipping base config");
|
|
3526
3531
|
return;
|
|
3527
3532
|
}
|
|
@@ -3703,7 +3708,6 @@ function registerCommentCommands(cmd) {
|
|
|
3703
3708
|
}
|
|
3704
3709
|
|
|
3705
3710
|
// src/commands/backlog/add/index.ts
|
|
3706
|
-
import { existsSync as existsSync18 } from "fs";
|
|
3707
3711
|
import chalk45 from "chalk";
|
|
3708
3712
|
|
|
3709
3713
|
// src/commands/backlog/commitBacklog.ts
|
|
@@ -3722,12 +3726,12 @@ function commitBacklog(id, name) {
|
|
|
3722
3726
|
}
|
|
3723
3727
|
|
|
3724
3728
|
// src/commands/backlog/add/parseItemFile.ts
|
|
3725
|
-
import { existsSync as
|
|
3729
|
+
import { existsSync as existsSync18, readFileSync as readFileSync15 } from "fs";
|
|
3726
3730
|
import chalk44 from "chalk";
|
|
3727
3731
|
import { ZodError } from "zod";
|
|
3728
3732
|
var addItemSchema = backlogItemSchema.omit({ id: true, status: true });
|
|
3729
3733
|
function readJsonFile(filePath) {
|
|
3730
|
-
if (!
|
|
3734
|
+
if (!existsSync18(filePath)) {
|
|
3731
3735
|
console.log(chalk44.red(`File not found: ${filePath}`));
|
|
3732
3736
|
process.exitCode = 1;
|
|
3733
3737
|
return void 0;
|
|
@@ -3871,7 +3875,7 @@ async function addInteractive() {
|
|
|
3871
3875
|
console.log(chalk45.green(`Added item #${id}: ${name}`));
|
|
3872
3876
|
}
|
|
3873
3877
|
async function add(options2) {
|
|
3874
|
-
if (!
|
|
3878
|
+
if (!backlogExists()) {
|
|
3875
3879
|
console.log(
|
|
3876
3880
|
chalk45.yellow(
|
|
3877
3881
|
"No backlog found. Run 'assist backlog init' to create one."
|
|
@@ -3887,20 +3891,17 @@ async function add(options2) {
|
|
|
3887
3891
|
}
|
|
3888
3892
|
|
|
3889
3893
|
// src/commands/backlog/init/index.ts
|
|
3890
|
-
import { existsSync as existsSync19 } from "fs";
|
|
3891
3894
|
import chalk46 from "chalk";
|
|
3892
3895
|
async function init6() {
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
console.log(chalk46.yellow("assist.backlog.yml already exists."));
|
|
3896
|
+
if (backlogExists()) {
|
|
3897
|
+
console.log(chalk46.yellow("Backlog already exists."));
|
|
3896
3898
|
return;
|
|
3897
3899
|
}
|
|
3898
3900
|
saveBacklog([]);
|
|
3899
|
-
console.log(chalk46.green("Created
|
|
3901
|
+
console.log(chalk46.green("Created backlog."));
|
|
3900
3902
|
}
|
|
3901
3903
|
|
|
3902
3904
|
// src/commands/backlog/list/index.ts
|
|
3903
|
-
import { existsSync as existsSync20 } from "fs";
|
|
3904
3905
|
import chalk47 from "chalk";
|
|
3905
3906
|
function filterItems(items, options2) {
|
|
3906
3907
|
if (options2.status) return items.filter((i) => i.status === options2.status);
|
|
@@ -3909,7 +3910,7 @@ function filterItems(items, options2) {
|
|
|
3909
3910
|
return items;
|
|
3910
3911
|
}
|
|
3911
3912
|
async function list2(options2) {
|
|
3912
|
-
if (!
|
|
3913
|
+
if (!backlogExists()) {
|
|
3913
3914
|
console.log(
|
|
3914
3915
|
chalk47.yellow(
|
|
3915
3916
|
"No backlog found. Run 'assist backlog init' to create one."
|
|
@@ -3934,7 +3935,7 @@ async function list2(options2) {
|
|
|
3934
3935
|
|
|
3935
3936
|
// src/commands/backlog/registerItemCommands.ts
|
|
3936
3937
|
function registerItemCommands(cmd) {
|
|
3937
|
-
cmd.command("init").description("Create an empty
|
|
3938
|
+
cmd.command("init").description("Create an empty backlog").action(init6);
|
|
3938
3939
|
cmd.command("list").alias("ls").description("List all backlog items").option(
|
|
3939
3940
|
"--status <type>",
|
|
3940
3941
|
"Filter by status (todo, in-progress, done, wontdo)"
|
|
@@ -4233,7 +4234,7 @@ function extractGraphqlQuery(args) {
|
|
|
4233
4234
|
}
|
|
4234
4235
|
|
|
4235
4236
|
// src/shared/loadCliReads.ts
|
|
4236
|
-
import { existsSync as
|
|
4237
|
+
import { existsSync as existsSync19, readFileSync as readFileSync17, writeFileSync as writeFileSync15 } from "fs";
|
|
4237
4238
|
import { dirname as dirname14, resolve as resolve2 } from "path";
|
|
4238
4239
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
4239
4240
|
var __filename2 = fileURLToPath4(import.meta.url);
|
|
@@ -4242,7 +4243,7 @@ function packageRoot() {
|
|
|
4242
4243
|
return __dirname4;
|
|
4243
4244
|
}
|
|
4244
4245
|
function readLines(path50) {
|
|
4245
|
-
if (!
|
|
4246
|
+
if (!existsSync19(path50)) return [];
|
|
4246
4247
|
return readFileSync17(path50, "utf-8").split("\n").filter((line) => line.trim() !== "");
|
|
4247
4248
|
}
|
|
4248
4249
|
var cachedReads;
|
|
@@ -4289,7 +4290,7 @@ function findCliWrite(command) {
|
|
|
4289
4290
|
}
|
|
4290
4291
|
|
|
4291
4292
|
// src/shared/readSettingsPerms.ts
|
|
4292
|
-
import { existsSync as
|
|
4293
|
+
import { existsSync as existsSync20, readFileSync as readFileSync18 } from "fs";
|
|
4293
4294
|
import { homedir as homedir3 } from "os";
|
|
4294
4295
|
import { join as join16 } from "path";
|
|
4295
4296
|
function readSettingsPerms(key) {
|
|
@@ -4305,7 +4306,7 @@ function readSettingsPerms(key) {
|
|
|
4305
4306
|
return entries;
|
|
4306
4307
|
}
|
|
4307
4308
|
function readPermissionArray(filePath, key) {
|
|
4308
|
-
if (!
|
|
4309
|
+
if (!existsSync20(filePath)) return [];
|
|
4309
4310
|
try {
|
|
4310
4311
|
const data = JSON.parse(readFileSync18(filePath, "utf-8"));
|
|
4311
4312
|
const arr = data?.permissions?.[key];
|
|
@@ -4592,7 +4593,7 @@ function denyRemove(pattern2) {
|
|
|
4592
4593
|
}
|
|
4593
4594
|
|
|
4594
4595
|
// src/commands/permitCliReads/index.ts
|
|
4595
|
-
import { existsSync as
|
|
4596
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync5, readFileSync as readFileSync19, writeFileSync as writeFileSync16 } from "fs";
|
|
4596
4597
|
import { homedir as homedir4 } from "os";
|
|
4597
4598
|
import { join as join17 } from "path";
|
|
4598
4599
|
|
|
@@ -4900,7 +4901,7 @@ function logPath(cli) {
|
|
|
4900
4901
|
}
|
|
4901
4902
|
function readCache(cli) {
|
|
4902
4903
|
const path50 = logPath(cli);
|
|
4903
|
-
if (!
|
|
4904
|
+
if (!existsSync21(path50)) return void 0;
|
|
4904
4905
|
return readFileSync19(path50, "utf-8");
|
|
4905
4906
|
}
|
|
4906
4907
|
function writeCache(cli, output) {
|
|
@@ -5453,7 +5454,7 @@ function registerComplexity(program2) {
|
|
|
5453
5454
|
}
|
|
5454
5455
|
|
|
5455
5456
|
// src/commands/deploy/redirect.ts
|
|
5456
|
-
import { existsSync as
|
|
5457
|
+
import { existsSync as existsSync22, readFileSync as readFileSync20, writeFileSync as writeFileSync17 } from "fs";
|
|
5457
5458
|
import chalk65 from "chalk";
|
|
5458
5459
|
var TRAILING_SLASH_SCRIPT = ` <script>
|
|
5459
5460
|
if (!window.location.pathname.endsWith('/')) {
|
|
@@ -5462,7 +5463,7 @@ var TRAILING_SLASH_SCRIPT = ` <script>
|
|
|
5462
5463
|
</script>`;
|
|
5463
5464
|
function redirect() {
|
|
5464
5465
|
const indexPath = "index.html";
|
|
5465
|
-
if (!
|
|
5466
|
+
if (!existsSync22(indexPath)) {
|
|
5466
5467
|
console.log(chalk65.yellow("No index.html found"));
|
|
5467
5468
|
return;
|
|
5468
5469
|
}
|
|
@@ -5994,12 +5995,12 @@ import { join as join21 } from "path";
|
|
|
5994
5995
|
import chalk73 from "chalk";
|
|
5995
5996
|
|
|
5996
5997
|
// src/shared/findRepoRoot.ts
|
|
5997
|
-
import { existsSync as
|
|
5998
|
+
import { existsSync as existsSync23 } from "fs";
|
|
5998
5999
|
import path21 from "path";
|
|
5999
6000
|
function findRepoRoot(dir) {
|
|
6000
6001
|
let current = dir;
|
|
6001
6002
|
while (current !== path21.dirname(current)) {
|
|
6002
|
-
if (
|
|
6003
|
+
if (existsSync23(path21.join(current, ".git"))) {
|
|
6003
6004
|
return current;
|
|
6004
6005
|
}
|
|
6005
6006
|
current = path21.dirname(current);
|
|
@@ -6210,12 +6211,12 @@ function printJson(tree, totalCount, solutions) {
|
|
|
6210
6211
|
}
|
|
6211
6212
|
|
|
6212
6213
|
// src/commands/dotnet/resolveCsproj.ts
|
|
6213
|
-
import { existsSync as
|
|
6214
|
+
import { existsSync as existsSync24 } from "fs";
|
|
6214
6215
|
import path24 from "path";
|
|
6215
6216
|
import chalk75 from "chalk";
|
|
6216
6217
|
function resolveCsproj(csprojPath) {
|
|
6217
6218
|
const resolved = path24.resolve(csprojPath);
|
|
6218
|
-
if (!
|
|
6219
|
+
if (!existsSync24(resolved)) {
|
|
6219
6220
|
console.error(chalk75.red(`File not found: ${resolved}`));
|
|
6220
6221
|
process.exit(1);
|
|
6221
6222
|
}
|
|
@@ -6383,7 +6384,7 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
|
|
|
6383
6384
|
}
|
|
6384
6385
|
|
|
6385
6386
|
// src/commands/dotnet/resolveSolution.ts
|
|
6386
|
-
import { existsSync as
|
|
6387
|
+
import { existsSync as existsSync25 } from "fs";
|
|
6387
6388
|
import path25 from "path";
|
|
6388
6389
|
import chalk79 from "chalk";
|
|
6389
6390
|
|
|
@@ -6424,7 +6425,7 @@ function findSolution() {
|
|
|
6424
6425
|
function resolveSolution(sln) {
|
|
6425
6426
|
if (sln) {
|
|
6426
6427
|
const resolved = path25.resolve(sln);
|
|
6427
|
-
if (!
|
|
6428
|
+
if (!existsSync25(resolved)) {
|
|
6428
6429
|
console.error(chalk79.red(`Solution file not found: ${resolved}`));
|
|
6429
6430
|
process.exit(1);
|
|
6430
6431
|
}
|
|
@@ -6464,7 +6465,7 @@ function parseInspectReport(json) {
|
|
|
6464
6465
|
|
|
6465
6466
|
// src/commands/dotnet/runInspectCode.ts
|
|
6466
6467
|
import { execSync as execSync23 } from "child_process";
|
|
6467
|
-
import { existsSync as
|
|
6468
|
+
import { existsSync as existsSync26, readFileSync as readFileSync24, unlinkSync as unlinkSync5 } from "fs";
|
|
6468
6469
|
import { tmpdir as tmpdir2 } from "os";
|
|
6469
6470
|
import path26 from "path";
|
|
6470
6471
|
import chalk80 from "chalk";
|
|
@@ -6495,7 +6496,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
6495
6496
|
console.error(chalk80.red("jb inspectcode failed"));
|
|
6496
6497
|
process.exit(1);
|
|
6497
6498
|
}
|
|
6498
|
-
if (!
|
|
6499
|
+
if (!existsSync26(reportPath)) {
|
|
6499
6500
|
console.error(chalk80.red("Report file not generated"));
|
|
6500
6501
|
process.exit(1);
|
|
6501
6502
|
}
|
|
@@ -6727,7 +6728,7 @@ function acceptanceCriteria(issueKey) {
|
|
|
6727
6728
|
import { execSync as execSync26 } from "child_process";
|
|
6728
6729
|
|
|
6729
6730
|
// src/shared/loadJson.ts
|
|
6730
|
-
import { existsSync as
|
|
6731
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync6, readFileSync as readFileSync25, writeFileSync as writeFileSync19 } from "fs";
|
|
6731
6732
|
import { homedir as homedir6 } from "os";
|
|
6732
6733
|
import { join as join23 } from "path";
|
|
6733
6734
|
function getStoreDir() {
|
|
@@ -6738,7 +6739,7 @@ function getStorePath(filename) {
|
|
|
6738
6739
|
}
|
|
6739
6740
|
function loadJson(filename) {
|
|
6740
6741
|
const path50 = getStorePath(filename);
|
|
6741
|
-
if (
|
|
6742
|
+
if (existsSync27(path50)) {
|
|
6742
6743
|
try {
|
|
6743
6744
|
return JSON.parse(readFileSync25(path50, "utf-8"));
|
|
6744
6745
|
} catch {
|
|
@@ -6749,7 +6750,7 @@ function loadJson(filename) {
|
|
|
6749
6750
|
}
|
|
6750
6751
|
function saveJson(filename, data) {
|
|
6751
6752
|
const dir = getStoreDir();
|
|
6752
|
-
if (!
|
|
6753
|
+
if (!existsSync27(dir)) {
|
|
6753
6754
|
mkdirSync6(dir, { recursive: true });
|
|
6754
6755
|
}
|
|
6755
6756
|
writeFileSync19(getStorePath(filename), JSON.stringify(data, null, 2));
|
|
@@ -7186,7 +7187,7 @@ import { tmpdir as tmpdir4 } from "os";
|
|
|
7186
7187
|
import { join as join26 } from "path";
|
|
7187
7188
|
|
|
7188
7189
|
// src/commands/prs/loadCommentsCache.ts
|
|
7189
|
-
import { existsSync as
|
|
7190
|
+
import { existsSync as existsSync28, readFileSync as readFileSync26, unlinkSync as unlinkSync7 } from "fs";
|
|
7190
7191
|
import { join as join25 } from "path";
|
|
7191
7192
|
import { parse as parse2 } from "yaml";
|
|
7192
7193
|
function getCachePath(prNumber) {
|
|
@@ -7194,7 +7195,7 @@ function getCachePath(prNumber) {
|
|
|
7194
7195
|
}
|
|
7195
7196
|
function loadCommentsCache(prNumber) {
|
|
7196
7197
|
const cachePath = getCachePath(prNumber);
|
|
7197
|
-
if (!
|
|
7198
|
+
if (!existsSync28(cachePath)) {
|
|
7198
7199
|
return null;
|
|
7199
7200
|
}
|
|
7200
7201
|
const content = readFileSync26(cachePath, "utf-8");
|
|
@@ -7202,7 +7203,7 @@ function loadCommentsCache(prNumber) {
|
|
|
7202
7203
|
}
|
|
7203
7204
|
function deleteCommentsCache(prNumber) {
|
|
7204
7205
|
const cachePath = getCachePath(prNumber);
|
|
7205
|
-
if (
|
|
7206
|
+
if (existsSync28(cachePath)) {
|
|
7206
7207
|
unlinkSync7(cachePath);
|
|
7207
7208
|
console.log("No more unresolved line comments. Cache dropped.");
|
|
7208
7209
|
}
|
|
@@ -7299,7 +7300,7 @@ function fixed(commentId, sha) {
|
|
|
7299
7300
|
}
|
|
7300
7301
|
|
|
7301
7302
|
// src/commands/prs/listComments/index.ts
|
|
7302
|
-
import { existsSync as
|
|
7303
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync7, writeFileSync as writeFileSync23 } from "fs";
|
|
7303
7304
|
import { join as join28 } from "path";
|
|
7304
7305
|
import { stringify } from "yaml";
|
|
7305
7306
|
|
|
@@ -7425,7 +7426,7 @@ function printComments2(result) {
|
|
|
7425
7426
|
// src/commands/prs/listComments/index.ts
|
|
7426
7427
|
function writeCommentsCache(prNumber, comments2) {
|
|
7427
7428
|
const assistDir = join28(process.cwd(), ".assist");
|
|
7428
|
-
if (!
|
|
7429
|
+
if (!existsSync29(assistDir)) {
|
|
7429
7430
|
mkdirSync7(assistDir, { recursive: true });
|
|
7430
7431
|
}
|
|
7431
7432
|
const cacheData = {
|
|
@@ -9860,7 +9861,7 @@ function registerSeq(program2) {
|
|
|
9860
9861
|
}
|
|
9861
9862
|
|
|
9862
9863
|
// src/commands/transcript/shared.ts
|
|
9863
|
-
import { existsSync as
|
|
9864
|
+
import { existsSync as existsSync30, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
9864
9865
|
import { basename as basename4, join as join29, relative } from "path";
|
|
9865
9866
|
import * as readline2 from "readline";
|
|
9866
9867
|
var DATE_PREFIX_REGEX = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -9876,7 +9877,7 @@ function isValidDatePrefix(filename) {
|
|
|
9876
9877
|
return DATE_PREFIX_REGEX.test(filename);
|
|
9877
9878
|
}
|
|
9878
9879
|
function collectFiles(dir, extension) {
|
|
9879
|
-
if (!
|
|
9880
|
+
if (!existsSync30(dir)) return [];
|
|
9880
9881
|
const results = [];
|
|
9881
9882
|
for (const entry of readdirSync5(dir)) {
|
|
9882
9883
|
const fullPath = join29(dir, entry);
|
|
@@ -9973,7 +9974,7 @@ async function configure() {
|
|
|
9973
9974
|
}
|
|
9974
9975
|
|
|
9975
9976
|
// src/commands/transcript/format/index.ts
|
|
9976
|
-
import { existsSync as
|
|
9977
|
+
import { existsSync as existsSync32 } from "fs";
|
|
9977
9978
|
|
|
9978
9979
|
// src/commands/transcript/format/fixInvalidDatePrefixes/index.ts
|
|
9979
9980
|
import { dirname as dirname18, join as join31 } from "path";
|
|
@@ -10047,7 +10048,7 @@ async function fixInvalidDatePrefixes(vttFiles) {
|
|
|
10047
10048
|
}
|
|
10048
10049
|
|
|
10049
10050
|
// src/commands/transcript/format/processVttFile/index.ts
|
|
10050
|
-
import { existsSync as
|
|
10051
|
+
import { existsSync as existsSync31, mkdirSync as mkdirSync8, readFileSync as readFileSync27, writeFileSync as writeFileSync24 } from "fs";
|
|
10051
10052
|
import { basename as basename5, dirname as dirname19, join as join32 } from "path";
|
|
10052
10053
|
|
|
10053
10054
|
// src/commands/transcript/cleanText.ts
|
|
@@ -10272,7 +10273,7 @@ function logSkipped(relativeDir, mdFile) {
|
|
|
10272
10273
|
return "skipped";
|
|
10273
10274
|
}
|
|
10274
10275
|
function ensureDirectory(dir, label2) {
|
|
10275
|
-
if (!
|
|
10276
|
+
if (!existsSync31(dir)) {
|
|
10276
10277
|
mkdirSync8(dir, { recursive: true });
|
|
10277
10278
|
console.log(`Created ${label2}: ${dir}`);
|
|
10278
10279
|
}
|
|
@@ -10308,7 +10309,7 @@ function convertVttToMarkdown(inputPath, outputPath) {
|
|
|
10308
10309
|
logReduction(cues.length, chatMessages.length);
|
|
10309
10310
|
}
|
|
10310
10311
|
function tryProcessVtt(vttFile, paths) {
|
|
10311
|
-
if (
|
|
10312
|
+
if (existsSync31(paths.outputPath))
|
|
10312
10313
|
return logSkipped(paths.relativeDir, paths.mdFile);
|
|
10313
10314
|
convertVttToMarkdown(vttFile.absolutePath, paths.outputPath);
|
|
10314
10315
|
return "processed";
|
|
@@ -10334,7 +10335,7 @@ function processAllFiles(vttFiles, transcriptsDir) {
|
|
|
10334
10335
|
logSummary(counts);
|
|
10335
10336
|
}
|
|
10336
10337
|
function requireVttDir(vttDir) {
|
|
10337
|
-
if (!
|
|
10338
|
+
if (!existsSync32(vttDir)) {
|
|
10338
10339
|
console.error(`VTT directory not found: ${vttDir}`);
|
|
10339
10340
|
process.exit(1);
|
|
10340
10341
|
}
|
|
@@ -10366,12 +10367,12 @@ async function format() {
|
|
|
10366
10367
|
}
|
|
10367
10368
|
|
|
10368
10369
|
// src/commands/transcript/summarise/index.ts
|
|
10369
|
-
import { existsSync as
|
|
10370
|
+
import { existsSync as existsSync34 } from "fs";
|
|
10370
10371
|
import { basename as basename6, dirname as dirname21, join as join34, relative as relative2 } from "path";
|
|
10371
10372
|
|
|
10372
10373
|
// src/commands/transcript/summarise/processStagedFile/index.ts
|
|
10373
10374
|
import {
|
|
10374
|
-
existsSync as
|
|
10375
|
+
existsSync as existsSync33,
|
|
10375
10376
|
mkdirSync as mkdirSync9,
|
|
10376
10377
|
readFileSync as readFileSync28,
|
|
10377
10378
|
renameSync as renameSync3,
|
|
@@ -10408,7 +10409,7 @@ function validateStagedContent(filename, content) {
|
|
|
10408
10409
|
// src/commands/transcript/summarise/processStagedFile/index.ts
|
|
10409
10410
|
var STAGING_DIR = join33(process.cwd(), ".assist", "transcript");
|
|
10410
10411
|
function processStagedFile() {
|
|
10411
|
-
if (!
|
|
10412
|
+
if (!existsSync33(STAGING_DIR)) {
|
|
10412
10413
|
return false;
|
|
10413
10414
|
}
|
|
10414
10415
|
const stagedFiles = findMdFilesRecursive(STAGING_DIR);
|
|
@@ -10432,7 +10433,7 @@ function processStagedFile() {
|
|
|
10432
10433
|
}
|
|
10433
10434
|
const destPath = join33(summaryDir, matchingTranscript.relativePath);
|
|
10434
10435
|
const destDir = dirname20(destPath);
|
|
10435
|
-
if (!
|
|
10436
|
+
if (!existsSync33(destDir)) {
|
|
10436
10437
|
mkdirSync9(destDir, { recursive: true });
|
|
10437
10438
|
}
|
|
10438
10439
|
renameSync3(stagedFile.absolutePath, destPath);
|
|
@@ -10459,7 +10460,7 @@ function buildSummaryIndex(summaryDir) {
|
|
|
10459
10460
|
function summarise2() {
|
|
10460
10461
|
processStagedFile();
|
|
10461
10462
|
const { transcriptsDir, summaryDir } = getTranscriptConfig();
|
|
10462
|
-
if (!
|
|
10463
|
+
if (!existsSync34(transcriptsDir)) {
|
|
10463
10464
|
console.log("No transcripts directory found.");
|
|
10464
10465
|
return;
|
|
10465
10466
|
}
|
|
@@ -10563,9 +10564,9 @@ function devices() {
|
|
|
10563
10564
|
}
|
|
10564
10565
|
|
|
10565
10566
|
// src/commands/voice/logs.ts
|
|
10566
|
-
import { existsSync as
|
|
10567
|
+
import { existsSync as existsSync35, readFileSync as readFileSync29 } from "fs";
|
|
10567
10568
|
function logs(options2) {
|
|
10568
|
-
if (!
|
|
10569
|
+
if (!existsSync35(voicePaths.log)) {
|
|
10569
10570
|
console.log("No voice log file found");
|
|
10570
10571
|
return;
|
|
10571
10572
|
}
|
|
@@ -10597,7 +10598,7 @@ import { join as join38 } from "path";
|
|
|
10597
10598
|
|
|
10598
10599
|
// src/commands/voice/checkLockFile.ts
|
|
10599
10600
|
import { execSync as execSync37 } from "child_process";
|
|
10600
|
-
import { existsSync as
|
|
10601
|
+
import { existsSync as existsSync36, mkdirSync as mkdirSync10, readFileSync as readFileSync30, writeFileSync as writeFileSync25 } from "fs";
|
|
10601
10602
|
import { join as join37 } from "path";
|
|
10602
10603
|
function isProcessAlive2(pid) {
|
|
10603
10604
|
try {
|
|
@@ -10609,7 +10610,7 @@ function isProcessAlive2(pid) {
|
|
|
10609
10610
|
}
|
|
10610
10611
|
function checkLockFile() {
|
|
10611
10612
|
const lockFile = getLockFile();
|
|
10612
|
-
if (!
|
|
10613
|
+
if (!existsSync36(lockFile)) return;
|
|
10613
10614
|
try {
|
|
10614
10615
|
const lock = JSON.parse(readFileSync30(lockFile, "utf-8"));
|
|
10615
10616
|
if (lock.pid && isProcessAlive2(lock.pid)) {
|
|
@@ -10622,7 +10623,7 @@ function checkLockFile() {
|
|
|
10622
10623
|
}
|
|
10623
10624
|
}
|
|
10624
10625
|
function bootstrapVenv() {
|
|
10625
|
-
if (
|
|
10626
|
+
if (existsSync36(getVenvPython())) return;
|
|
10626
10627
|
console.log("Setting up Python environment...");
|
|
10627
10628
|
const pythonDir = getPythonDir();
|
|
10628
10629
|
execSync37(
|
|
@@ -10713,7 +10714,7 @@ function start2(options2) {
|
|
|
10713
10714
|
}
|
|
10714
10715
|
|
|
10715
10716
|
// src/commands/voice/status.ts
|
|
10716
|
-
import { existsSync as
|
|
10717
|
+
import { existsSync as existsSync37, readFileSync as readFileSync31 } from "fs";
|
|
10717
10718
|
function isProcessAlive3(pid) {
|
|
10718
10719
|
try {
|
|
10719
10720
|
process.kill(pid, 0);
|
|
@@ -10723,12 +10724,12 @@ function isProcessAlive3(pid) {
|
|
|
10723
10724
|
}
|
|
10724
10725
|
}
|
|
10725
10726
|
function readRecentLogs(count) {
|
|
10726
|
-
if (!
|
|
10727
|
+
if (!existsSync37(voicePaths.log)) return [];
|
|
10727
10728
|
const lines = readFileSync31(voicePaths.log, "utf-8").trim().split("\n");
|
|
10728
10729
|
return lines.slice(-count);
|
|
10729
10730
|
}
|
|
10730
10731
|
function status() {
|
|
10731
|
-
if (!
|
|
10732
|
+
if (!existsSync37(voicePaths.pid)) {
|
|
10732
10733
|
console.log("Voice daemon: not running (no PID file)");
|
|
10733
10734
|
return;
|
|
10734
10735
|
}
|
|
@@ -10751,9 +10752,9 @@ function status() {
|
|
|
10751
10752
|
}
|
|
10752
10753
|
|
|
10753
10754
|
// src/commands/voice/stop.ts
|
|
10754
|
-
import { existsSync as
|
|
10755
|
+
import { existsSync as existsSync38, readFileSync as readFileSync32, unlinkSync as unlinkSync10 } from "fs";
|
|
10755
10756
|
function stop() {
|
|
10756
|
-
if (!
|
|
10757
|
+
if (!existsSync38(voicePaths.pid)) {
|
|
10757
10758
|
console.log("Voice daemon is not running (no PID file)");
|
|
10758
10759
|
return;
|
|
10759
10760
|
}
|
|
@@ -10770,7 +10771,7 @@ function stop() {
|
|
|
10770
10771
|
}
|
|
10771
10772
|
try {
|
|
10772
10773
|
const lockFile = getLockFile();
|
|
10773
|
-
if (
|
|
10774
|
+
if (existsSync38(lockFile)) unlinkSync10(lockFile);
|
|
10774
10775
|
} catch {
|
|
10775
10776
|
}
|
|
10776
10777
|
console.log("Voice daemon stopped");
|
|
@@ -11196,7 +11197,7 @@ function run3(name, args) {
|
|
|
11196
11197
|
|
|
11197
11198
|
// src/commands/screenshot/index.ts
|
|
11198
11199
|
import { execSync as execSync40 } from "child_process";
|
|
11199
|
-
import { existsSync as
|
|
11200
|
+
import { existsSync as existsSync39, mkdirSync as mkdirSync14, unlinkSync as unlinkSync11, writeFileSync as writeFileSync28 } from "fs";
|
|
11200
11201
|
import { tmpdir as tmpdir6 } from "os";
|
|
11201
11202
|
import { join as join42, resolve as resolve5 } from "path";
|
|
11202
11203
|
import chalk121 from "chalk";
|
|
@@ -11328,7 +11329,7 @@ Write-Output $OutputPath
|
|
|
11328
11329
|
|
|
11329
11330
|
// src/commands/screenshot/index.ts
|
|
11330
11331
|
function buildOutputPath(outputDir, processName) {
|
|
11331
|
-
if (!
|
|
11332
|
+
if (!existsSync39(outputDir)) {
|
|
11332
11333
|
mkdirSync14(outputDir, { recursive: true });
|
|
11333
11334
|
}
|
|
11334
11335
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|