@staff0rd/assist 0.172.1 → 0.172.3
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 +94 -100
- 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.3",
|
|
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);
|
|
@@ -1009,14 +1014,7 @@ async function next(options2) {
|
|
|
1009
1014
|
console.log(chalk7.green("All backlog items complete."));
|
|
1010
1015
|
return;
|
|
1011
1016
|
}
|
|
1012
|
-
|
|
1013
|
-
if (todo.length === 1) {
|
|
1014
|
-
const only = todo[0];
|
|
1015
|
-
console.log(chalk7.bold(`Starting #${only.id}: ${only.name}`));
|
|
1016
|
-
id = String(only.id);
|
|
1017
|
-
} else {
|
|
1018
|
-
id = await selectItem(todo);
|
|
1019
|
-
}
|
|
1017
|
+
const id = await selectItem(todo);
|
|
1020
1018
|
const completed = await run(id, options2);
|
|
1021
1019
|
if (!completed) return;
|
|
1022
1020
|
}
|
|
@@ -1423,17 +1421,17 @@ async function launchMode(slashCommand) {
|
|
|
1423
1421
|
import { execSync } from "child_process";
|
|
1424
1422
|
|
|
1425
1423
|
// src/shared/loadConfig.ts
|
|
1426
|
-
import { existsSync as
|
|
1424
|
+
import { existsSync as existsSync8, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
1427
1425
|
import { homedir } from "os";
|
|
1428
1426
|
import { basename, dirname as dirname2, join as join7 } from "path";
|
|
1429
1427
|
import chalk16 from "chalk";
|
|
1430
1428
|
import { stringify as stringifyYaml } from "yaml";
|
|
1431
1429
|
|
|
1432
1430
|
// src/shared/loadRawYaml.ts
|
|
1433
|
-
import { existsSync as
|
|
1431
|
+
import { existsSync as existsSync7, readFileSync as readFileSync6 } from "fs";
|
|
1434
1432
|
import { parse as parseYaml2 } from "yaml";
|
|
1435
1433
|
function loadRawYaml(path50) {
|
|
1436
|
-
if (!
|
|
1434
|
+
if (!existsSync7(path50)) return {};
|
|
1437
1435
|
try {
|
|
1438
1436
|
const content = readFileSync6(path50, "utf-8");
|
|
1439
1437
|
return parseYaml2(content) || {};
|
|
@@ -1566,9 +1564,9 @@ function findConfigUp(startDir) {
|
|
|
1566
1564
|
let current = startDir;
|
|
1567
1565
|
while (current !== dirname2(current)) {
|
|
1568
1566
|
const claudePath = join7(current, ".claude", "assist.yml");
|
|
1569
|
-
if (
|
|
1567
|
+
if (existsSync8(claudePath)) return claudePath;
|
|
1570
1568
|
const rootPath = join7(current, "assist.yml");
|
|
1571
|
-
if (
|
|
1569
|
+
if (existsSync8(rootPath)) return rootPath;
|
|
1572
1570
|
current = dirname2(current);
|
|
1573
1571
|
}
|
|
1574
1572
|
return null;
|
|
@@ -1606,7 +1604,7 @@ function getRepoName() {
|
|
|
1606
1604
|
return config.devlog.name;
|
|
1607
1605
|
}
|
|
1608
1606
|
const packageJsonPath = join7(process.cwd(), "package.json");
|
|
1609
|
-
if (
|
|
1607
|
+
if (existsSync8(packageJsonPath)) {
|
|
1610
1608
|
try {
|
|
1611
1609
|
const content = readFileSync7(packageJsonPath, "utf-8");
|
|
1612
1610
|
const pkg = JSON.parse(content);
|
|
@@ -2057,11 +2055,11 @@ import * as path3 from "path";
|
|
|
2057
2055
|
import chalk25 from "chalk";
|
|
2058
2056
|
|
|
2059
2057
|
// src/commands/verify/addToKnipIgnoreBinaries.ts
|
|
2060
|
-
import { existsSync as
|
|
2058
|
+
import { existsSync as existsSync10, readFileSync as readFileSync9, writeFileSync as writeFileSync6 } from "fs";
|
|
2061
2059
|
import { join as join9 } from "path";
|
|
2062
2060
|
import chalk24 from "chalk";
|
|
2063
2061
|
function loadKnipConfig(knipJsonPath) {
|
|
2064
|
-
if (
|
|
2062
|
+
if (existsSync10(knipJsonPath)) {
|
|
2065
2063
|
return JSON.parse(readFileSync9(knipJsonPath, "utf-8"));
|
|
2066
2064
|
}
|
|
2067
2065
|
return { $schema: "https://unpkg.com/knip@5/schema.json" };
|
|
@@ -2115,7 +2113,7 @@ import chalk29 from "chalk";
|
|
|
2115
2113
|
|
|
2116
2114
|
// src/commands/lint/init.ts
|
|
2117
2115
|
import { execSync as execSync5 } from "child_process";
|
|
2118
|
-
import { existsSync as
|
|
2116
|
+
import { existsSync as existsSync13, readFileSync as readFileSync11, writeFileSync as writeFileSync8 } from "fs";
|
|
2119
2117
|
import { dirname as dirname7, join as join10 } from "path";
|
|
2120
2118
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2121
2119
|
import chalk28 from "chalk";
|
|
@@ -2141,10 +2139,10 @@ async function promptConfirm(message, initial = true) {
|
|
|
2141
2139
|
|
|
2142
2140
|
// src/shared/removeEslint/index.ts
|
|
2143
2141
|
import { execSync as execSync4 } from "child_process";
|
|
2144
|
-
import { existsSync as
|
|
2142
|
+
import { existsSync as existsSync12, readFileSync as readFileSync10, writeFileSync as writeFileSync7 } from "fs";
|
|
2145
2143
|
|
|
2146
2144
|
// src/shared/removeEslint/removeEslintConfigFiles.ts
|
|
2147
|
-
import { existsSync as
|
|
2145
|
+
import { existsSync as existsSync11, unlinkSync as unlinkSync3 } from "fs";
|
|
2148
2146
|
var ESLINT_CONFIG_FILES = [
|
|
2149
2147
|
"eslint.config.js",
|
|
2150
2148
|
"eslint.config.mjs",
|
|
@@ -2160,7 +2158,7 @@ var ESLINT_CONFIG_FILES = [
|
|
|
2160
2158
|
function removeEslintConfigFiles() {
|
|
2161
2159
|
let removed = false;
|
|
2162
2160
|
for (const configFile of ESLINT_CONFIG_FILES) {
|
|
2163
|
-
if (
|
|
2161
|
+
if (existsSync11(configFile)) {
|
|
2164
2162
|
unlinkSync3(configFile);
|
|
2165
2163
|
console.log(`Removed ${configFile}`);
|
|
2166
2164
|
removed = true;
|
|
@@ -2182,7 +2180,7 @@ function removeEslint(options2 = {}) {
|
|
|
2182
2180
|
}
|
|
2183
2181
|
function removeEslintFromPackageJson(options2) {
|
|
2184
2182
|
const packageJsonPath = "package.json";
|
|
2185
|
-
if (!
|
|
2183
|
+
if (!existsSync12(packageJsonPath)) {
|
|
2186
2184
|
return false;
|
|
2187
2185
|
}
|
|
2188
2186
|
const packageJson = JSON.parse(readFileSync10(packageJsonPath, "utf-8"));
|
|
@@ -2255,11 +2253,11 @@ var __dirname2 = dirname7(fileURLToPath2(import.meta.url));
|
|
|
2255
2253
|
async function init() {
|
|
2256
2254
|
removeEslint();
|
|
2257
2255
|
const biomeConfigPath = "biome.json";
|
|
2258
|
-
if (!
|
|
2256
|
+
if (!existsSync13(biomeConfigPath)) {
|
|
2259
2257
|
console.log("Initializing Biome...");
|
|
2260
2258
|
execSync5("npx @biomejs/biome init", { stdio: "inherit" });
|
|
2261
2259
|
}
|
|
2262
|
-
if (!
|
|
2260
|
+
if (!existsSync13(biomeConfigPath)) {
|
|
2263
2261
|
console.log("No biome.json found, skipping linter config");
|
|
2264
2262
|
return;
|
|
2265
2263
|
}
|
|
@@ -3393,7 +3391,7 @@ async function newCli() {
|
|
|
3393
3391
|
|
|
3394
3392
|
// src/commands/new/registerNew/newProject.ts
|
|
3395
3393
|
import { execSync as execSync13 } from "child_process";
|
|
3396
|
-
import { existsSync as
|
|
3394
|
+
import { existsSync as existsSync17, readFileSync as readFileSync14, writeFileSync as writeFileSync13 } from "fs";
|
|
3397
3395
|
|
|
3398
3396
|
// src/commands/deploy/init/index.ts
|
|
3399
3397
|
import { execSync as execSync12 } from "child_process";
|
|
@@ -3401,14 +3399,14 @@ import chalk40 from "chalk";
|
|
|
3401
3399
|
import enquirer5 from "enquirer";
|
|
3402
3400
|
|
|
3403
3401
|
// src/commands/deploy/init/updateWorkflow.ts
|
|
3404
|
-
import { existsSync as
|
|
3402
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync4, readFileSync as readFileSync13, writeFileSync as writeFileSync12 } from "fs";
|
|
3405
3403
|
import { dirname as dirname13, join as join13 } from "path";
|
|
3406
3404
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
3407
3405
|
import chalk39 from "chalk";
|
|
3408
3406
|
var WORKFLOW_PATH = ".github/workflows/build.yml";
|
|
3409
3407
|
var __dirname3 = dirname13(fileURLToPath3(import.meta.url));
|
|
3410
3408
|
function getExistingSiteId() {
|
|
3411
|
-
if (!
|
|
3409
|
+
if (!existsSync16(WORKFLOW_PATH)) {
|
|
3412
3410
|
return null;
|
|
3413
3411
|
}
|
|
3414
3412
|
const content = readFileSync13(WORKFLOW_PATH, "utf-8");
|
|
@@ -3423,10 +3421,10 @@ function getTemplateContent(siteId) {
|
|
|
3423
3421
|
async function updateWorkflow(siteId) {
|
|
3424
3422
|
const newContent = getTemplateContent(siteId);
|
|
3425
3423
|
const workflowDir = ".github/workflows";
|
|
3426
|
-
if (!
|
|
3424
|
+
if (!existsSync16(workflowDir)) {
|
|
3427
3425
|
mkdirSync4(workflowDir, { recursive: true });
|
|
3428
3426
|
}
|
|
3429
|
-
if (
|
|
3427
|
+
if (existsSync16(WORKFLOW_PATH)) {
|
|
3430
3428
|
const oldContent = readFileSync13(WORKFLOW_PATH, "utf-8");
|
|
3431
3429
|
if (oldContent === newContent) {
|
|
3432
3430
|
console.log(chalk39.green("build.yml is already up to date"));
|
|
@@ -3521,7 +3519,7 @@ async function newProject() {
|
|
|
3521
3519
|
}
|
|
3522
3520
|
function addViteBaseConfig() {
|
|
3523
3521
|
const viteConfigPath = "vite.config.ts";
|
|
3524
|
-
if (!
|
|
3522
|
+
if (!existsSync17(viteConfigPath)) {
|
|
3525
3523
|
console.log("No vite.config.ts found, skipping base config");
|
|
3526
3524
|
return;
|
|
3527
3525
|
}
|
|
@@ -3703,7 +3701,6 @@ function registerCommentCommands(cmd) {
|
|
|
3703
3701
|
}
|
|
3704
3702
|
|
|
3705
3703
|
// src/commands/backlog/add/index.ts
|
|
3706
|
-
import { existsSync as existsSync18 } from "fs";
|
|
3707
3704
|
import chalk45 from "chalk";
|
|
3708
3705
|
|
|
3709
3706
|
// src/commands/backlog/commitBacklog.ts
|
|
@@ -3722,12 +3719,12 @@ function commitBacklog(id, name) {
|
|
|
3722
3719
|
}
|
|
3723
3720
|
|
|
3724
3721
|
// src/commands/backlog/add/parseItemFile.ts
|
|
3725
|
-
import { existsSync as
|
|
3722
|
+
import { existsSync as existsSync18, readFileSync as readFileSync15 } from "fs";
|
|
3726
3723
|
import chalk44 from "chalk";
|
|
3727
3724
|
import { ZodError } from "zod";
|
|
3728
3725
|
var addItemSchema = backlogItemSchema.omit({ id: true, status: true });
|
|
3729
3726
|
function readJsonFile(filePath) {
|
|
3730
|
-
if (!
|
|
3727
|
+
if (!existsSync18(filePath)) {
|
|
3731
3728
|
console.log(chalk44.red(`File not found: ${filePath}`));
|
|
3732
3729
|
process.exitCode = 1;
|
|
3733
3730
|
return void 0;
|
|
@@ -3871,7 +3868,7 @@ async function addInteractive() {
|
|
|
3871
3868
|
console.log(chalk45.green(`Added item #${id}: ${name}`));
|
|
3872
3869
|
}
|
|
3873
3870
|
async function add(options2) {
|
|
3874
|
-
if (!
|
|
3871
|
+
if (!backlogExists()) {
|
|
3875
3872
|
console.log(
|
|
3876
3873
|
chalk45.yellow(
|
|
3877
3874
|
"No backlog found. Run 'assist backlog init' to create one."
|
|
@@ -3887,20 +3884,17 @@ async function add(options2) {
|
|
|
3887
3884
|
}
|
|
3888
3885
|
|
|
3889
3886
|
// src/commands/backlog/init/index.ts
|
|
3890
|
-
import { existsSync as existsSync19 } from "fs";
|
|
3891
3887
|
import chalk46 from "chalk";
|
|
3892
3888
|
async function init6() {
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
console.log(chalk46.yellow("assist.backlog.yml already exists."));
|
|
3889
|
+
if (backlogExists()) {
|
|
3890
|
+
console.log(chalk46.yellow("Backlog already exists."));
|
|
3896
3891
|
return;
|
|
3897
3892
|
}
|
|
3898
3893
|
saveBacklog([]);
|
|
3899
|
-
console.log(chalk46.green("Created
|
|
3894
|
+
console.log(chalk46.green("Created backlog."));
|
|
3900
3895
|
}
|
|
3901
3896
|
|
|
3902
3897
|
// src/commands/backlog/list/index.ts
|
|
3903
|
-
import { existsSync as existsSync20 } from "fs";
|
|
3904
3898
|
import chalk47 from "chalk";
|
|
3905
3899
|
function filterItems(items, options2) {
|
|
3906
3900
|
if (options2.status) return items.filter((i) => i.status === options2.status);
|
|
@@ -3909,7 +3903,7 @@ function filterItems(items, options2) {
|
|
|
3909
3903
|
return items;
|
|
3910
3904
|
}
|
|
3911
3905
|
async function list2(options2) {
|
|
3912
|
-
if (!
|
|
3906
|
+
if (!backlogExists()) {
|
|
3913
3907
|
console.log(
|
|
3914
3908
|
chalk47.yellow(
|
|
3915
3909
|
"No backlog found. Run 'assist backlog init' to create one."
|
|
@@ -3934,7 +3928,7 @@ async function list2(options2) {
|
|
|
3934
3928
|
|
|
3935
3929
|
// src/commands/backlog/registerItemCommands.ts
|
|
3936
3930
|
function registerItemCommands(cmd) {
|
|
3937
|
-
cmd.command("init").description("Create an empty
|
|
3931
|
+
cmd.command("init").description("Create an empty backlog").action(init6);
|
|
3938
3932
|
cmd.command("list").alias("ls").description("List all backlog items").option(
|
|
3939
3933
|
"--status <type>",
|
|
3940
3934
|
"Filter by status (todo, in-progress, done, wontdo)"
|
|
@@ -4233,7 +4227,7 @@ function extractGraphqlQuery(args) {
|
|
|
4233
4227
|
}
|
|
4234
4228
|
|
|
4235
4229
|
// src/shared/loadCliReads.ts
|
|
4236
|
-
import { existsSync as
|
|
4230
|
+
import { existsSync as existsSync19, readFileSync as readFileSync17, writeFileSync as writeFileSync15 } from "fs";
|
|
4237
4231
|
import { dirname as dirname14, resolve as resolve2 } from "path";
|
|
4238
4232
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
4239
4233
|
var __filename2 = fileURLToPath4(import.meta.url);
|
|
@@ -4242,7 +4236,7 @@ function packageRoot() {
|
|
|
4242
4236
|
return __dirname4;
|
|
4243
4237
|
}
|
|
4244
4238
|
function readLines(path50) {
|
|
4245
|
-
if (!
|
|
4239
|
+
if (!existsSync19(path50)) return [];
|
|
4246
4240
|
return readFileSync17(path50, "utf-8").split("\n").filter((line) => line.trim() !== "");
|
|
4247
4241
|
}
|
|
4248
4242
|
var cachedReads;
|
|
@@ -4289,7 +4283,7 @@ function findCliWrite(command) {
|
|
|
4289
4283
|
}
|
|
4290
4284
|
|
|
4291
4285
|
// src/shared/readSettingsPerms.ts
|
|
4292
|
-
import { existsSync as
|
|
4286
|
+
import { existsSync as existsSync20, readFileSync as readFileSync18 } from "fs";
|
|
4293
4287
|
import { homedir as homedir3 } from "os";
|
|
4294
4288
|
import { join as join16 } from "path";
|
|
4295
4289
|
function readSettingsPerms(key) {
|
|
@@ -4305,7 +4299,7 @@ function readSettingsPerms(key) {
|
|
|
4305
4299
|
return entries;
|
|
4306
4300
|
}
|
|
4307
4301
|
function readPermissionArray(filePath, key) {
|
|
4308
|
-
if (!
|
|
4302
|
+
if (!existsSync20(filePath)) return [];
|
|
4309
4303
|
try {
|
|
4310
4304
|
const data = JSON.parse(readFileSync18(filePath, "utf-8"));
|
|
4311
4305
|
const arr = data?.permissions?.[key];
|
|
@@ -4592,7 +4586,7 @@ function denyRemove(pattern2) {
|
|
|
4592
4586
|
}
|
|
4593
4587
|
|
|
4594
4588
|
// src/commands/permitCliReads/index.ts
|
|
4595
|
-
import { existsSync as
|
|
4589
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync5, readFileSync as readFileSync19, writeFileSync as writeFileSync16 } from "fs";
|
|
4596
4590
|
import { homedir as homedir4 } from "os";
|
|
4597
4591
|
import { join as join17 } from "path";
|
|
4598
4592
|
|
|
@@ -4900,7 +4894,7 @@ function logPath(cli) {
|
|
|
4900
4894
|
}
|
|
4901
4895
|
function readCache(cli) {
|
|
4902
4896
|
const path50 = logPath(cli);
|
|
4903
|
-
if (!
|
|
4897
|
+
if (!existsSync21(path50)) return void 0;
|
|
4904
4898
|
return readFileSync19(path50, "utf-8");
|
|
4905
4899
|
}
|
|
4906
4900
|
function writeCache(cli, output) {
|
|
@@ -5453,7 +5447,7 @@ function registerComplexity(program2) {
|
|
|
5453
5447
|
}
|
|
5454
5448
|
|
|
5455
5449
|
// src/commands/deploy/redirect.ts
|
|
5456
|
-
import { existsSync as
|
|
5450
|
+
import { existsSync as existsSync22, readFileSync as readFileSync20, writeFileSync as writeFileSync17 } from "fs";
|
|
5457
5451
|
import chalk65 from "chalk";
|
|
5458
5452
|
var TRAILING_SLASH_SCRIPT = ` <script>
|
|
5459
5453
|
if (!window.location.pathname.endsWith('/')) {
|
|
@@ -5462,7 +5456,7 @@ var TRAILING_SLASH_SCRIPT = ` <script>
|
|
|
5462
5456
|
</script>`;
|
|
5463
5457
|
function redirect() {
|
|
5464
5458
|
const indexPath = "index.html";
|
|
5465
|
-
if (!
|
|
5459
|
+
if (!existsSync22(indexPath)) {
|
|
5466
5460
|
console.log(chalk65.yellow("No index.html found"));
|
|
5467
5461
|
return;
|
|
5468
5462
|
}
|
|
@@ -5994,12 +5988,12 @@ import { join as join21 } from "path";
|
|
|
5994
5988
|
import chalk73 from "chalk";
|
|
5995
5989
|
|
|
5996
5990
|
// src/shared/findRepoRoot.ts
|
|
5997
|
-
import { existsSync as
|
|
5991
|
+
import { existsSync as existsSync23 } from "fs";
|
|
5998
5992
|
import path21 from "path";
|
|
5999
5993
|
function findRepoRoot(dir) {
|
|
6000
5994
|
let current = dir;
|
|
6001
5995
|
while (current !== path21.dirname(current)) {
|
|
6002
|
-
if (
|
|
5996
|
+
if (existsSync23(path21.join(current, ".git"))) {
|
|
6003
5997
|
return current;
|
|
6004
5998
|
}
|
|
6005
5999
|
current = path21.dirname(current);
|
|
@@ -6210,12 +6204,12 @@ function printJson(tree, totalCount, solutions) {
|
|
|
6210
6204
|
}
|
|
6211
6205
|
|
|
6212
6206
|
// src/commands/dotnet/resolveCsproj.ts
|
|
6213
|
-
import { existsSync as
|
|
6207
|
+
import { existsSync as existsSync24 } from "fs";
|
|
6214
6208
|
import path24 from "path";
|
|
6215
6209
|
import chalk75 from "chalk";
|
|
6216
6210
|
function resolveCsproj(csprojPath) {
|
|
6217
6211
|
const resolved = path24.resolve(csprojPath);
|
|
6218
|
-
if (!
|
|
6212
|
+
if (!existsSync24(resolved)) {
|
|
6219
6213
|
console.error(chalk75.red(`File not found: ${resolved}`));
|
|
6220
6214
|
process.exit(1);
|
|
6221
6215
|
}
|
|
@@ -6383,7 +6377,7 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
|
|
|
6383
6377
|
}
|
|
6384
6378
|
|
|
6385
6379
|
// src/commands/dotnet/resolveSolution.ts
|
|
6386
|
-
import { existsSync as
|
|
6380
|
+
import { existsSync as existsSync25 } from "fs";
|
|
6387
6381
|
import path25 from "path";
|
|
6388
6382
|
import chalk79 from "chalk";
|
|
6389
6383
|
|
|
@@ -6424,7 +6418,7 @@ function findSolution() {
|
|
|
6424
6418
|
function resolveSolution(sln) {
|
|
6425
6419
|
if (sln) {
|
|
6426
6420
|
const resolved = path25.resolve(sln);
|
|
6427
|
-
if (!
|
|
6421
|
+
if (!existsSync25(resolved)) {
|
|
6428
6422
|
console.error(chalk79.red(`Solution file not found: ${resolved}`));
|
|
6429
6423
|
process.exit(1);
|
|
6430
6424
|
}
|
|
@@ -6464,7 +6458,7 @@ function parseInspectReport(json) {
|
|
|
6464
6458
|
|
|
6465
6459
|
// src/commands/dotnet/runInspectCode.ts
|
|
6466
6460
|
import { execSync as execSync23 } from "child_process";
|
|
6467
|
-
import { existsSync as
|
|
6461
|
+
import { existsSync as existsSync26, readFileSync as readFileSync24, unlinkSync as unlinkSync5 } from "fs";
|
|
6468
6462
|
import { tmpdir as tmpdir2 } from "os";
|
|
6469
6463
|
import path26 from "path";
|
|
6470
6464
|
import chalk80 from "chalk";
|
|
@@ -6495,7 +6489,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
6495
6489
|
console.error(chalk80.red("jb inspectcode failed"));
|
|
6496
6490
|
process.exit(1);
|
|
6497
6491
|
}
|
|
6498
|
-
if (!
|
|
6492
|
+
if (!existsSync26(reportPath)) {
|
|
6499
6493
|
console.error(chalk80.red("Report file not generated"));
|
|
6500
6494
|
process.exit(1);
|
|
6501
6495
|
}
|
|
@@ -6727,7 +6721,7 @@ function acceptanceCriteria(issueKey) {
|
|
|
6727
6721
|
import { execSync as execSync26 } from "child_process";
|
|
6728
6722
|
|
|
6729
6723
|
// src/shared/loadJson.ts
|
|
6730
|
-
import { existsSync as
|
|
6724
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync6, readFileSync as readFileSync25, writeFileSync as writeFileSync19 } from "fs";
|
|
6731
6725
|
import { homedir as homedir6 } from "os";
|
|
6732
6726
|
import { join as join23 } from "path";
|
|
6733
6727
|
function getStoreDir() {
|
|
@@ -6738,7 +6732,7 @@ function getStorePath(filename) {
|
|
|
6738
6732
|
}
|
|
6739
6733
|
function loadJson(filename) {
|
|
6740
6734
|
const path50 = getStorePath(filename);
|
|
6741
|
-
if (
|
|
6735
|
+
if (existsSync27(path50)) {
|
|
6742
6736
|
try {
|
|
6743
6737
|
return JSON.parse(readFileSync25(path50, "utf-8"));
|
|
6744
6738
|
} catch {
|
|
@@ -6749,7 +6743,7 @@ function loadJson(filename) {
|
|
|
6749
6743
|
}
|
|
6750
6744
|
function saveJson(filename, data) {
|
|
6751
6745
|
const dir = getStoreDir();
|
|
6752
|
-
if (!
|
|
6746
|
+
if (!existsSync27(dir)) {
|
|
6753
6747
|
mkdirSync6(dir, { recursive: true });
|
|
6754
6748
|
}
|
|
6755
6749
|
writeFileSync19(getStorePath(filename), JSON.stringify(data, null, 2));
|
|
@@ -7186,7 +7180,7 @@ import { tmpdir as tmpdir4 } from "os";
|
|
|
7186
7180
|
import { join as join26 } from "path";
|
|
7187
7181
|
|
|
7188
7182
|
// src/commands/prs/loadCommentsCache.ts
|
|
7189
|
-
import { existsSync as
|
|
7183
|
+
import { existsSync as existsSync28, readFileSync as readFileSync26, unlinkSync as unlinkSync7 } from "fs";
|
|
7190
7184
|
import { join as join25 } from "path";
|
|
7191
7185
|
import { parse as parse2 } from "yaml";
|
|
7192
7186
|
function getCachePath(prNumber) {
|
|
@@ -7194,7 +7188,7 @@ function getCachePath(prNumber) {
|
|
|
7194
7188
|
}
|
|
7195
7189
|
function loadCommentsCache(prNumber) {
|
|
7196
7190
|
const cachePath = getCachePath(prNumber);
|
|
7197
|
-
if (!
|
|
7191
|
+
if (!existsSync28(cachePath)) {
|
|
7198
7192
|
return null;
|
|
7199
7193
|
}
|
|
7200
7194
|
const content = readFileSync26(cachePath, "utf-8");
|
|
@@ -7202,7 +7196,7 @@ function loadCommentsCache(prNumber) {
|
|
|
7202
7196
|
}
|
|
7203
7197
|
function deleteCommentsCache(prNumber) {
|
|
7204
7198
|
const cachePath = getCachePath(prNumber);
|
|
7205
|
-
if (
|
|
7199
|
+
if (existsSync28(cachePath)) {
|
|
7206
7200
|
unlinkSync7(cachePath);
|
|
7207
7201
|
console.log("No more unresolved line comments. Cache dropped.");
|
|
7208
7202
|
}
|
|
@@ -7299,7 +7293,7 @@ function fixed(commentId, sha) {
|
|
|
7299
7293
|
}
|
|
7300
7294
|
|
|
7301
7295
|
// src/commands/prs/listComments/index.ts
|
|
7302
|
-
import { existsSync as
|
|
7296
|
+
import { existsSync as existsSync29, mkdirSync as mkdirSync7, writeFileSync as writeFileSync23 } from "fs";
|
|
7303
7297
|
import { join as join28 } from "path";
|
|
7304
7298
|
import { stringify } from "yaml";
|
|
7305
7299
|
|
|
@@ -7425,7 +7419,7 @@ function printComments2(result) {
|
|
|
7425
7419
|
// src/commands/prs/listComments/index.ts
|
|
7426
7420
|
function writeCommentsCache(prNumber, comments2) {
|
|
7427
7421
|
const assistDir = join28(process.cwd(), ".assist");
|
|
7428
|
-
if (!
|
|
7422
|
+
if (!existsSync29(assistDir)) {
|
|
7429
7423
|
mkdirSync7(assistDir, { recursive: true });
|
|
7430
7424
|
}
|
|
7431
7425
|
const cacheData = {
|
|
@@ -9860,7 +9854,7 @@ function registerSeq(program2) {
|
|
|
9860
9854
|
}
|
|
9861
9855
|
|
|
9862
9856
|
// src/commands/transcript/shared.ts
|
|
9863
|
-
import { existsSync as
|
|
9857
|
+
import { existsSync as existsSync30, readdirSync as readdirSync5, statSync as statSync4 } from "fs";
|
|
9864
9858
|
import { basename as basename4, join as join29, relative } from "path";
|
|
9865
9859
|
import * as readline2 from "readline";
|
|
9866
9860
|
var DATE_PREFIX_REGEX = /^\d{4}-\d{2}-\d{2}/;
|
|
@@ -9876,7 +9870,7 @@ function isValidDatePrefix(filename) {
|
|
|
9876
9870
|
return DATE_PREFIX_REGEX.test(filename);
|
|
9877
9871
|
}
|
|
9878
9872
|
function collectFiles(dir, extension) {
|
|
9879
|
-
if (!
|
|
9873
|
+
if (!existsSync30(dir)) return [];
|
|
9880
9874
|
const results = [];
|
|
9881
9875
|
for (const entry of readdirSync5(dir)) {
|
|
9882
9876
|
const fullPath = join29(dir, entry);
|
|
@@ -9973,7 +9967,7 @@ async function configure() {
|
|
|
9973
9967
|
}
|
|
9974
9968
|
|
|
9975
9969
|
// src/commands/transcript/format/index.ts
|
|
9976
|
-
import { existsSync as
|
|
9970
|
+
import { existsSync as existsSync32 } from "fs";
|
|
9977
9971
|
|
|
9978
9972
|
// src/commands/transcript/format/fixInvalidDatePrefixes/index.ts
|
|
9979
9973
|
import { dirname as dirname18, join as join31 } from "path";
|
|
@@ -10047,7 +10041,7 @@ async function fixInvalidDatePrefixes(vttFiles) {
|
|
|
10047
10041
|
}
|
|
10048
10042
|
|
|
10049
10043
|
// src/commands/transcript/format/processVttFile/index.ts
|
|
10050
|
-
import { existsSync as
|
|
10044
|
+
import { existsSync as existsSync31, mkdirSync as mkdirSync8, readFileSync as readFileSync27, writeFileSync as writeFileSync24 } from "fs";
|
|
10051
10045
|
import { basename as basename5, dirname as dirname19, join as join32 } from "path";
|
|
10052
10046
|
|
|
10053
10047
|
// src/commands/transcript/cleanText.ts
|
|
@@ -10272,7 +10266,7 @@ function logSkipped(relativeDir, mdFile) {
|
|
|
10272
10266
|
return "skipped";
|
|
10273
10267
|
}
|
|
10274
10268
|
function ensureDirectory(dir, label2) {
|
|
10275
|
-
if (!
|
|
10269
|
+
if (!existsSync31(dir)) {
|
|
10276
10270
|
mkdirSync8(dir, { recursive: true });
|
|
10277
10271
|
console.log(`Created ${label2}: ${dir}`);
|
|
10278
10272
|
}
|
|
@@ -10308,7 +10302,7 @@ function convertVttToMarkdown(inputPath, outputPath) {
|
|
|
10308
10302
|
logReduction(cues.length, chatMessages.length);
|
|
10309
10303
|
}
|
|
10310
10304
|
function tryProcessVtt(vttFile, paths) {
|
|
10311
|
-
if (
|
|
10305
|
+
if (existsSync31(paths.outputPath))
|
|
10312
10306
|
return logSkipped(paths.relativeDir, paths.mdFile);
|
|
10313
10307
|
convertVttToMarkdown(vttFile.absolutePath, paths.outputPath);
|
|
10314
10308
|
return "processed";
|
|
@@ -10334,7 +10328,7 @@ function processAllFiles(vttFiles, transcriptsDir) {
|
|
|
10334
10328
|
logSummary(counts);
|
|
10335
10329
|
}
|
|
10336
10330
|
function requireVttDir(vttDir) {
|
|
10337
|
-
if (!
|
|
10331
|
+
if (!existsSync32(vttDir)) {
|
|
10338
10332
|
console.error(`VTT directory not found: ${vttDir}`);
|
|
10339
10333
|
process.exit(1);
|
|
10340
10334
|
}
|
|
@@ -10366,12 +10360,12 @@ async function format() {
|
|
|
10366
10360
|
}
|
|
10367
10361
|
|
|
10368
10362
|
// src/commands/transcript/summarise/index.ts
|
|
10369
|
-
import { existsSync as
|
|
10363
|
+
import { existsSync as existsSync34 } from "fs";
|
|
10370
10364
|
import { basename as basename6, dirname as dirname21, join as join34, relative as relative2 } from "path";
|
|
10371
10365
|
|
|
10372
10366
|
// src/commands/transcript/summarise/processStagedFile/index.ts
|
|
10373
10367
|
import {
|
|
10374
|
-
existsSync as
|
|
10368
|
+
existsSync as existsSync33,
|
|
10375
10369
|
mkdirSync as mkdirSync9,
|
|
10376
10370
|
readFileSync as readFileSync28,
|
|
10377
10371
|
renameSync as renameSync3,
|
|
@@ -10408,7 +10402,7 @@ function validateStagedContent(filename, content) {
|
|
|
10408
10402
|
// src/commands/transcript/summarise/processStagedFile/index.ts
|
|
10409
10403
|
var STAGING_DIR = join33(process.cwd(), ".assist", "transcript");
|
|
10410
10404
|
function processStagedFile() {
|
|
10411
|
-
if (!
|
|
10405
|
+
if (!existsSync33(STAGING_DIR)) {
|
|
10412
10406
|
return false;
|
|
10413
10407
|
}
|
|
10414
10408
|
const stagedFiles = findMdFilesRecursive(STAGING_DIR);
|
|
@@ -10432,7 +10426,7 @@ function processStagedFile() {
|
|
|
10432
10426
|
}
|
|
10433
10427
|
const destPath = join33(summaryDir, matchingTranscript.relativePath);
|
|
10434
10428
|
const destDir = dirname20(destPath);
|
|
10435
|
-
if (!
|
|
10429
|
+
if (!existsSync33(destDir)) {
|
|
10436
10430
|
mkdirSync9(destDir, { recursive: true });
|
|
10437
10431
|
}
|
|
10438
10432
|
renameSync3(stagedFile.absolutePath, destPath);
|
|
@@ -10459,7 +10453,7 @@ function buildSummaryIndex(summaryDir) {
|
|
|
10459
10453
|
function summarise2() {
|
|
10460
10454
|
processStagedFile();
|
|
10461
10455
|
const { transcriptsDir, summaryDir } = getTranscriptConfig();
|
|
10462
|
-
if (!
|
|
10456
|
+
if (!existsSync34(transcriptsDir)) {
|
|
10463
10457
|
console.log("No transcripts directory found.");
|
|
10464
10458
|
return;
|
|
10465
10459
|
}
|
|
@@ -10563,9 +10557,9 @@ function devices() {
|
|
|
10563
10557
|
}
|
|
10564
10558
|
|
|
10565
10559
|
// src/commands/voice/logs.ts
|
|
10566
|
-
import { existsSync as
|
|
10560
|
+
import { existsSync as existsSync35, readFileSync as readFileSync29 } from "fs";
|
|
10567
10561
|
function logs(options2) {
|
|
10568
|
-
if (!
|
|
10562
|
+
if (!existsSync35(voicePaths.log)) {
|
|
10569
10563
|
console.log("No voice log file found");
|
|
10570
10564
|
return;
|
|
10571
10565
|
}
|
|
@@ -10597,7 +10591,7 @@ import { join as join38 } from "path";
|
|
|
10597
10591
|
|
|
10598
10592
|
// src/commands/voice/checkLockFile.ts
|
|
10599
10593
|
import { execSync as execSync37 } from "child_process";
|
|
10600
|
-
import { existsSync as
|
|
10594
|
+
import { existsSync as existsSync36, mkdirSync as mkdirSync10, readFileSync as readFileSync30, writeFileSync as writeFileSync25 } from "fs";
|
|
10601
10595
|
import { join as join37 } from "path";
|
|
10602
10596
|
function isProcessAlive2(pid) {
|
|
10603
10597
|
try {
|
|
@@ -10609,7 +10603,7 @@ function isProcessAlive2(pid) {
|
|
|
10609
10603
|
}
|
|
10610
10604
|
function checkLockFile() {
|
|
10611
10605
|
const lockFile = getLockFile();
|
|
10612
|
-
if (!
|
|
10606
|
+
if (!existsSync36(lockFile)) return;
|
|
10613
10607
|
try {
|
|
10614
10608
|
const lock = JSON.parse(readFileSync30(lockFile, "utf-8"));
|
|
10615
10609
|
if (lock.pid && isProcessAlive2(lock.pid)) {
|
|
@@ -10622,7 +10616,7 @@ function checkLockFile() {
|
|
|
10622
10616
|
}
|
|
10623
10617
|
}
|
|
10624
10618
|
function bootstrapVenv() {
|
|
10625
|
-
if (
|
|
10619
|
+
if (existsSync36(getVenvPython())) return;
|
|
10626
10620
|
console.log("Setting up Python environment...");
|
|
10627
10621
|
const pythonDir = getPythonDir();
|
|
10628
10622
|
execSync37(
|
|
@@ -10713,7 +10707,7 @@ function start2(options2) {
|
|
|
10713
10707
|
}
|
|
10714
10708
|
|
|
10715
10709
|
// src/commands/voice/status.ts
|
|
10716
|
-
import { existsSync as
|
|
10710
|
+
import { existsSync as existsSync37, readFileSync as readFileSync31 } from "fs";
|
|
10717
10711
|
function isProcessAlive3(pid) {
|
|
10718
10712
|
try {
|
|
10719
10713
|
process.kill(pid, 0);
|
|
@@ -10723,12 +10717,12 @@ function isProcessAlive3(pid) {
|
|
|
10723
10717
|
}
|
|
10724
10718
|
}
|
|
10725
10719
|
function readRecentLogs(count) {
|
|
10726
|
-
if (!
|
|
10720
|
+
if (!existsSync37(voicePaths.log)) return [];
|
|
10727
10721
|
const lines = readFileSync31(voicePaths.log, "utf-8").trim().split("\n");
|
|
10728
10722
|
return lines.slice(-count);
|
|
10729
10723
|
}
|
|
10730
10724
|
function status() {
|
|
10731
|
-
if (!
|
|
10725
|
+
if (!existsSync37(voicePaths.pid)) {
|
|
10732
10726
|
console.log("Voice daemon: not running (no PID file)");
|
|
10733
10727
|
return;
|
|
10734
10728
|
}
|
|
@@ -10751,9 +10745,9 @@ function status() {
|
|
|
10751
10745
|
}
|
|
10752
10746
|
|
|
10753
10747
|
// src/commands/voice/stop.ts
|
|
10754
|
-
import { existsSync as
|
|
10748
|
+
import { existsSync as existsSync38, readFileSync as readFileSync32, unlinkSync as unlinkSync10 } from "fs";
|
|
10755
10749
|
function stop() {
|
|
10756
|
-
if (!
|
|
10750
|
+
if (!existsSync38(voicePaths.pid)) {
|
|
10757
10751
|
console.log("Voice daemon is not running (no PID file)");
|
|
10758
10752
|
return;
|
|
10759
10753
|
}
|
|
@@ -10770,7 +10764,7 @@ function stop() {
|
|
|
10770
10764
|
}
|
|
10771
10765
|
try {
|
|
10772
10766
|
const lockFile = getLockFile();
|
|
10773
|
-
if (
|
|
10767
|
+
if (existsSync38(lockFile)) unlinkSync10(lockFile);
|
|
10774
10768
|
} catch {
|
|
10775
10769
|
}
|
|
10776
10770
|
console.log("Voice daemon stopped");
|
|
@@ -11196,7 +11190,7 @@ function run3(name, args) {
|
|
|
11196
11190
|
|
|
11197
11191
|
// src/commands/screenshot/index.ts
|
|
11198
11192
|
import { execSync as execSync40 } from "child_process";
|
|
11199
|
-
import { existsSync as
|
|
11193
|
+
import { existsSync as existsSync39, mkdirSync as mkdirSync14, unlinkSync as unlinkSync11, writeFileSync as writeFileSync28 } from "fs";
|
|
11200
11194
|
import { tmpdir as tmpdir6 } from "os";
|
|
11201
11195
|
import { join as join42, resolve as resolve5 } from "path";
|
|
11202
11196
|
import chalk121 from "chalk";
|
|
@@ -11328,7 +11322,7 @@ Write-Output $OutputPath
|
|
|
11328
11322
|
|
|
11329
11323
|
// src/commands/screenshot/index.ts
|
|
11330
11324
|
function buildOutputPath(outputDir, processName) {
|
|
11331
|
-
if (!
|
|
11325
|
+
if (!existsSync39(outputDir)) {
|
|
11332
11326
|
mkdirSync14(outputDir, { recursive: true });
|
|
11333
11327
|
}
|
|
11334
11328
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|