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