@staff0rd/assist 0.149.2 → 0.149.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +348 -324
- package/package.json +1 -1
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.149.
|
|
9
|
+
version: "0.149.4",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -2411,7 +2411,7 @@ async function done(id) {
|
|
|
2411
2411
|
}
|
|
2412
2412
|
|
|
2413
2413
|
// src/commands/backlog/next.ts
|
|
2414
|
-
import
|
|
2414
|
+
import chalk34 from "chalk";
|
|
2415
2415
|
import enquirer5 from "enquirer";
|
|
2416
2416
|
|
|
2417
2417
|
// src/commands/backlog/list/shared.ts
|
|
@@ -2454,7 +2454,7 @@ function printVerboseDetails(item) {
|
|
|
2454
2454
|
}
|
|
2455
2455
|
|
|
2456
2456
|
// src/commands/backlog/run.ts
|
|
2457
|
-
import
|
|
2457
|
+
import chalk33 from "chalk";
|
|
2458
2458
|
|
|
2459
2459
|
// src/commands/backlog/buildAuthoredPhasePrompt.ts
|
|
2460
2460
|
function buildAuthoredPhasePrompt(item, phaseIndex, phase) {
|
|
@@ -2669,6 +2669,9 @@ async function executePhase(item, phaseIndex, phases, spawnOptions) {
|
|
|
2669
2669
|
return delta < 0 ? -1 : phaseIndex + delta;
|
|
2670
2670
|
}
|
|
2671
2671
|
|
|
2672
|
+
// src/commands/backlog/prepareRun.ts
|
|
2673
|
+
import chalk32 from "chalk";
|
|
2674
|
+
|
|
2672
2675
|
// src/commands/backlog/resolvePlan.ts
|
|
2673
2676
|
function resolvePlan(item) {
|
|
2674
2677
|
if (item.plan && item.plan.length > 0) {
|
|
@@ -2682,49 +2685,68 @@ function resolvePlan(item) {
|
|
|
2682
2685
|
];
|
|
2683
2686
|
}
|
|
2684
2687
|
|
|
2685
|
-
// src/commands/backlog/
|
|
2686
|
-
|
|
2688
|
+
// src/commands/backlog/prepareRun.ts
|
|
2689
|
+
function prepareRun(id) {
|
|
2687
2690
|
const result = loadAndFindItem(id);
|
|
2688
|
-
if (!result) return;
|
|
2691
|
+
if (!result) return void 0;
|
|
2689
2692
|
const { item } = result;
|
|
2690
2693
|
const plan2 = resolvePlan(item);
|
|
2691
2694
|
const startPhase = item.currentPhase ?? 0;
|
|
2695
|
+
if (item.status === "done") {
|
|
2696
|
+
console.log(chalk32.green(`Already done: #${id}: ${item.name}`));
|
|
2697
|
+
return void 0;
|
|
2698
|
+
}
|
|
2692
2699
|
if (startPhase > plan2.length) {
|
|
2693
|
-
|
|
2700
|
+
setStatus(id, "done");
|
|
2694
2701
|
console.log(
|
|
2695
2702
|
chalk32.green(`All phases already complete for #${id}: ${item.name}`)
|
|
2696
2703
|
);
|
|
2697
|
-
return;
|
|
2704
|
+
return void 0;
|
|
2698
2705
|
}
|
|
2706
|
+
return { item, plan: plan2, startPhase };
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
// src/commands/backlog/run.ts
|
|
2710
|
+
async function run2(id, spawnOptions) {
|
|
2711
|
+
const prepared = prepareRun(id);
|
|
2712
|
+
if (!prepared) return;
|
|
2713
|
+
const { item, plan: plan2, startPhase } = prepared;
|
|
2699
2714
|
setStatus(id, "in-progress");
|
|
2700
|
-
|
|
2715
|
+
logProgress(id, item.name, startPhase, plan2.length);
|
|
2716
|
+
if (!await runPhases(item, startPhase, plan2, spawnOptions)) return;
|
|
2717
|
+
if (!await runReview(item, plan2, spawnOptions)) return;
|
|
2718
|
+
setStatus(id, "done");
|
|
2719
|
+
console.log(chalk33.green(`
|
|
2720
|
+
All phases complete for #${id}: ${item.name}`));
|
|
2721
|
+
}
|
|
2722
|
+
function logProgress(id, name, startPhase, total) {
|
|
2723
|
+
console.log(chalk33.bold(`Running plan for #${id}: ${name}`));
|
|
2701
2724
|
if (startPhase > 0) {
|
|
2702
|
-
console.log(
|
|
2703
|
-
|
|
2704
|
-
`)
|
|
2705
|
-
);
|
|
2725
|
+
console.log(chalk33.dim(`Resuming from phase ${startPhase + 1}/${total}
|
|
2726
|
+
`));
|
|
2706
2727
|
} else {
|
|
2707
|
-
console.log(
|
|
2728
|
+
console.log(chalk33.dim(`${total} phase(s)
|
|
2708
2729
|
`));
|
|
2709
2730
|
}
|
|
2731
|
+
}
|
|
2732
|
+
async function runPhases(item, startPhase, plan2, spawnOptions) {
|
|
2710
2733
|
let phaseIndex = startPhase;
|
|
2711
2734
|
while (phaseIndex < plan2.length) {
|
|
2712
2735
|
phaseIndex = await executePhase(item, phaseIndex, plan2, spawnOptions);
|
|
2713
|
-
if (phaseIndex < 0) return;
|
|
2736
|
+
if (phaseIndex < 0) return false;
|
|
2714
2737
|
}
|
|
2738
|
+
return true;
|
|
2739
|
+
}
|
|
2740
|
+
async function runReview(item, plan2, spawnOptions) {
|
|
2715
2741
|
const reviewPhase = buildReviewPhase();
|
|
2716
2742
|
const allPhases = [...plan2, reviewPhase];
|
|
2717
|
-
const reviewIndex = plan2.length;
|
|
2718
2743
|
const reviewResult = await executePhase(
|
|
2719
2744
|
item,
|
|
2720
|
-
|
|
2745
|
+
plan2.length,
|
|
2721
2746
|
allPhases,
|
|
2722
2747
|
spawnOptions
|
|
2723
2748
|
);
|
|
2724
|
-
|
|
2725
|
-
if (item.status !== "done") setStatus(id, "done");
|
|
2726
|
-
console.log(chalk32.green(`
|
|
2727
|
-
All phases complete for #${id}: ${item.name}`));
|
|
2749
|
+
return reviewResult >= 0;
|
|
2728
2750
|
}
|
|
2729
2751
|
|
|
2730
2752
|
// src/commands/backlog/next.ts
|
|
@@ -2733,7 +2755,7 @@ async function next(options2) {
|
|
|
2733
2755
|
const inProgress = items.find((i) => i.status === "in-progress" && i.plan);
|
|
2734
2756
|
if (inProgress) {
|
|
2735
2757
|
console.log(
|
|
2736
|
-
|
|
2758
|
+
chalk34.bold(
|
|
2737
2759
|
`Resuming in-progress item #${inProgress.id}: ${inProgress.name}`
|
|
2738
2760
|
)
|
|
2739
2761
|
);
|
|
@@ -2742,13 +2764,13 @@ async function next(options2) {
|
|
|
2742
2764
|
}
|
|
2743
2765
|
const todo = items.filter((i) => i.status === "todo");
|
|
2744
2766
|
if (todo.length === 0) {
|
|
2745
|
-
console.log(
|
|
2767
|
+
console.log(chalk34.dim("No incomplete backlog items. Opening /draft..."));
|
|
2746
2768
|
await spawnClaude("/draft", options2);
|
|
2747
2769
|
return;
|
|
2748
2770
|
}
|
|
2749
2771
|
if (todo.length === 1) {
|
|
2750
2772
|
const only = todo[0];
|
|
2751
|
-
console.log(
|
|
2773
|
+
console.log(chalk34.bold(`Starting #${only.id}: ${only.name}`));
|
|
2752
2774
|
await run2(String(only.id), options2);
|
|
2753
2775
|
return;
|
|
2754
2776
|
}
|
|
@@ -2767,23 +2789,23 @@ async function next(options2) {
|
|
|
2767
2789
|
}
|
|
2768
2790
|
|
|
2769
2791
|
// src/commands/backlog/plan.ts
|
|
2770
|
-
import
|
|
2792
|
+
import chalk35 from "chalk";
|
|
2771
2793
|
function plan(id) {
|
|
2772
2794
|
const result = loadAndFindItem(id);
|
|
2773
2795
|
if (!result) return;
|
|
2774
2796
|
const { item } = result;
|
|
2775
2797
|
if (!item.plan || item.plan.length === 0) {
|
|
2776
|
-
console.log(
|
|
2798
|
+
console.log(chalk35.dim("No plan defined for this item."));
|
|
2777
2799
|
return;
|
|
2778
2800
|
}
|
|
2779
|
-
console.log(
|
|
2801
|
+
console.log(chalk35.bold(item.name));
|
|
2780
2802
|
console.log();
|
|
2781
2803
|
for (const [i, phase] of item.plan.entries()) {
|
|
2782
|
-
console.log(`${
|
|
2804
|
+
console.log(`${chalk35.bold(`Phase ${i + 1}:`)} ${phase.name}`);
|
|
2783
2805
|
for (const task of phase.tasks) {
|
|
2784
2806
|
console.log(` - ${task.task}`);
|
|
2785
2807
|
if (task.verify) {
|
|
2786
|
-
console.log(` ${
|
|
2808
|
+
console.log(` ${chalk35.dim(`verify: ${task.verify}`)}`);
|
|
2787
2809
|
}
|
|
2788
2810
|
}
|
|
2789
2811
|
console.log();
|
|
@@ -2791,11 +2813,11 @@ function plan(id) {
|
|
|
2791
2813
|
}
|
|
2792
2814
|
|
|
2793
2815
|
// src/commands/backlog/start/index.ts
|
|
2794
|
-
import
|
|
2816
|
+
import chalk36 from "chalk";
|
|
2795
2817
|
async function start(id) {
|
|
2796
2818
|
const name = setStatus(id, "in-progress");
|
|
2797
2819
|
if (name) {
|
|
2798
|
-
console.log(
|
|
2820
|
+
console.log(chalk36.green(`Started item #${id}: ${name}`));
|
|
2799
2821
|
}
|
|
2800
2822
|
}
|
|
2801
2823
|
|
|
@@ -2807,7 +2829,7 @@ import {
|
|
|
2807
2829
|
} from "http";
|
|
2808
2830
|
import { dirname as dirname13, join as join10 } from "path";
|
|
2809
2831
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
2810
|
-
import
|
|
2832
|
+
import chalk37 from "chalk";
|
|
2811
2833
|
function respondJson(res, status2, data) {
|
|
2812
2834
|
res.writeHead(status2, { "Content-Type": "application/json" });
|
|
2813
2835
|
res.end(JSON.stringify(data));
|
|
@@ -2851,8 +2873,8 @@ function startWebServer(label2, port, handler) {
|
|
|
2851
2873
|
handler(req, res, port);
|
|
2852
2874
|
});
|
|
2853
2875
|
server.listen(port, () => {
|
|
2854
|
-
console.log(
|
|
2855
|
-
console.log(
|
|
2876
|
+
console.log(chalk37.green(`${label2}: ${url}`));
|
|
2877
|
+
console.log(chalk37.dim("Press Ctrl+C to stop"));
|
|
2856
2878
|
exec(`open ${url}`);
|
|
2857
2879
|
});
|
|
2858
2880
|
}
|
|
@@ -3001,7 +3023,7 @@ async function web(options2) {
|
|
|
3001
3023
|
|
|
3002
3024
|
// src/commands/backlog/add/index.ts
|
|
3003
3025
|
import { existsSync as existsSync15 } from "fs";
|
|
3004
|
-
import
|
|
3026
|
+
import chalk38 from "chalk";
|
|
3005
3027
|
|
|
3006
3028
|
// src/commands/backlog/add/shared.ts
|
|
3007
3029
|
import { spawnSync } from "child_process";
|
|
@@ -3077,7 +3099,7 @@ async function promptAcceptanceCriteria() {
|
|
|
3077
3099
|
var addItemSchema = backlogItemSchema.omit({ id: true, status: true });
|
|
3078
3100
|
async function addFromJson() {
|
|
3079
3101
|
if (process.stdin.isTTY) {
|
|
3080
|
-
console.log(
|
|
3102
|
+
console.log(chalk38.red("--json requires piped input on stdin."));
|
|
3081
3103
|
return;
|
|
3082
3104
|
}
|
|
3083
3105
|
const input = await readStdin2();
|
|
@@ -3090,7 +3112,7 @@ async function addFromJson() {
|
|
|
3090
3112
|
const id = getNextId(items);
|
|
3091
3113
|
items.push({ ...data, id, status: "todo" });
|
|
3092
3114
|
saveBacklog(items);
|
|
3093
|
-
console.log(
|
|
3115
|
+
console.log(chalk38.green(`Added item #${id}: ${data.name}`));
|
|
3094
3116
|
}
|
|
3095
3117
|
async function addInteractive() {
|
|
3096
3118
|
const type = await promptType();
|
|
@@ -3108,12 +3130,12 @@ async function addInteractive() {
|
|
|
3108
3130
|
status: "todo"
|
|
3109
3131
|
});
|
|
3110
3132
|
saveBacklog(items);
|
|
3111
|
-
console.log(
|
|
3133
|
+
console.log(chalk38.green(`Added item #${id}: ${name}`));
|
|
3112
3134
|
}
|
|
3113
3135
|
async function add(options2) {
|
|
3114
3136
|
if (!existsSync15(getBacklogPath())) {
|
|
3115
3137
|
console.log(
|
|
3116
|
-
|
|
3138
|
+
chalk38.yellow(
|
|
3117
3139
|
"No backlog found. Run 'assist backlog init' to create one."
|
|
3118
3140
|
)
|
|
3119
3141
|
);
|
|
@@ -3128,20 +3150,20 @@ async function add(options2) {
|
|
|
3128
3150
|
|
|
3129
3151
|
// src/commands/backlog/init/index.ts
|
|
3130
3152
|
import { existsSync as existsSync16 } from "fs";
|
|
3131
|
-
import
|
|
3153
|
+
import chalk39 from "chalk";
|
|
3132
3154
|
async function init6() {
|
|
3133
3155
|
const backlogPath = getBacklogPath();
|
|
3134
3156
|
if (existsSync16(backlogPath)) {
|
|
3135
|
-
console.log(
|
|
3157
|
+
console.log(chalk39.yellow("assist.backlog.yml already exists."));
|
|
3136
3158
|
return;
|
|
3137
3159
|
}
|
|
3138
3160
|
saveBacklog([]);
|
|
3139
|
-
console.log(
|
|
3161
|
+
console.log(chalk39.green("Created assist.backlog.yml"));
|
|
3140
3162
|
}
|
|
3141
3163
|
|
|
3142
3164
|
// src/commands/backlog/list/index.ts
|
|
3143
3165
|
import { existsSync as existsSync17 } from "fs";
|
|
3144
|
-
import
|
|
3166
|
+
import chalk40 from "chalk";
|
|
3145
3167
|
function filterItems(items, options2) {
|
|
3146
3168
|
if (options2.status) return items.filter((i) => i.status === options2.status);
|
|
3147
3169
|
if (!options2.all) return items.filter((i) => i.status !== "done");
|
|
@@ -3150,7 +3172,7 @@ function filterItems(items, options2) {
|
|
|
3150
3172
|
async function list2(options2) {
|
|
3151
3173
|
if (!existsSync17(getBacklogPath())) {
|
|
3152
3174
|
console.log(
|
|
3153
|
-
|
|
3175
|
+
chalk40.yellow(
|
|
3154
3176
|
"No backlog found. Run 'assist backlog init' to create one."
|
|
3155
3177
|
)
|
|
3156
3178
|
);
|
|
@@ -3158,12 +3180,12 @@ async function list2(options2) {
|
|
|
3158
3180
|
}
|
|
3159
3181
|
const items = filterItems(loadBacklog(), options2);
|
|
3160
3182
|
if (items.length === 0) {
|
|
3161
|
-
console.log(
|
|
3183
|
+
console.log(chalk40.dim("Backlog is empty."));
|
|
3162
3184
|
return;
|
|
3163
3185
|
}
|
|
3164
3186
|
for (const item of items) {
|
|
3165
3187
|
console.log(
|
|
3166
|
-
`${statusIcon(item.status)} ${typeLabel(item.type)} ${
|
|
3188
|
+
`${statusIcon(item.status)} ${typeLabel(item.type)} ${chalk40.dim(`#${item.id}`)} ${item.name}${phaseLabel(item)}`
|
|
3167
3189
|
);
|
|
3168
3190
|
if (options2.verbose) {
|
|
3169
3191
|
printVerboseDetails(item);
|
|
@@ -3434,6 +3456,8 @@ function groupByOperator(tokens) {
|
|
|
3434
3456
|
if (op === void 0) {
|
|
3435
3457
|
if (typeof token !== "string") return void 0;
|
|
3436
3458
|
groups[groups.length - 1].push(token);
|
|
3459
|
+
} else if (op === "glob") {
|
|
3460
|
+
groups[groups.length - 1].push(token.pattern);
|
|
3437
3461
|
} else if (SEPARATOR_OPS.has(op)) {
|
|
3438
3462
|
groups.push([]);
|
|
3439
3463
|
} else if (UNSAFE_OPS.has(op)) {
|
|
@@ -3552,11 +3576,11 @@ function assertCliExists(cli) {
|
|
|
3552
3576
|
}
|
|
3553
3577
|
|
|
3554
3578
|
// src/commands/permitCliReads/colorize.ts
|
|
3555
|
-
import
|
|
3579
|
+
import chalk41 from "chalk";
|
|
3556
3580
|
function colorize(plainOutput) {
|
|
3557
3581
|
return plainOutput.split("\n").map((line) => {
|
|
3558
|
-
if (line.startsWith(" R ")) return
|
|
3559
|
-
if (line.startsWith(" W ")) return
|
|
3582
|
+
if (line.startsWith(" R ")) return chalk41.green(line);
|
|
3583
|
+
if (line.startsWith(" W ")) return chalk41.red(line);
|
|
3560
3584
|
return line;
|
|
3561
3585
|
}).join("\n");
|
|
3562
3586
|
}
|
|
@@ -3870,15 +3894,15 @@ function registerCliHook(program2) {
|
|
|
3870
3894
|
}
|
|
3871
3895
|
|
|
3872
3896
|
// src/commands/complexity/analyze.ts
|
|
3873
|
-
import
|
|
3897
|
+
import chalk47 from "chalk";
|
|
3874
3898
|
|
|
3875
3899
|
// src/commands/complexity/cyclomatic.ts
|
|
3876
|
-
import
|
|
3900
|
+
import chalk43 from "chalk";
|
|
3877
3901
|
|
|
3878
3902
|
// src/commands/complexity/shared/index.ts
|
|
3879
3903
|
import fs12 from "fs";
|
|
3880
3904
|
import path20 from "path";
|
|
3881
|
-
import
|
|
3905
|
+
import chalk42 from "chalk";
|
|
3882
3906
|
import ts5 from "typescript";
|
|
3883
3907
|
|
|
3884
3908
|
// src/commands/complexity/findSourceFiles.ts
|
|
@@ -4124,7 +4148,7 @@ function createSourceFromFile(filePath) {
|
|
|
4124
4148
|
function withSourceFiles(pattern2, callback) {
|
|
4125
4149
|
const files = findSourceFiles2(pattern2);
|
|
4126
4150
|
if (files.length === 0) {
|
|
4127
|
-
console.log(
|
|
4151
|
+
console.log(chalk42.yellow("No files found matching pattern"));
|
|
4128
4152
|
return void 0;
|
|
4129
4153
|
}
|
|
4130
4154
|
return callback(files);
|
|
@@ -4157,11 +4181,11 @@ async function cyclomatic(pattern2 = "**/*.ts", options2 = {}) {
|
|
|
4157
4181
|
results.sort((a, b) => b.complexity - a.complexity);
|
|
4158
4182
|
for (const { file, name, complexity } of results) {
|
|
4159
4183
|
const exceedsThreshold = options2.threshold !== void 0 && complexity > options2.threshold;
|
|
4160
|
-
const color = exceedsThreshold ?
|
|
4161
|
-
console.log(`${color(`${file}:${name}`)} \u2192 ${
|
|
4184
|
+
const color = exceedsThreshold ? chalk43.red : chalk43.white;
|
|
4185
|
+
console.log(`${color(`${file}:${name}`)} \u2192 ${chalk43.cyan(complexity)}`);
|
|
4162
4186
|
}
|
|
4163
4187
|
console.log(
|
|
4164
|
-
|
|
4188
|
+
chalk43.dim(
|
|
4165
4189
|
`
|
|
4166
4190
|
Analyzed ${results.length} functions across ${files.length} files`
|
|
4167
4191
|
)
|
|
@@ -4173,7 +4197,7 @@ Analyzed ${results.length} functions across ${files.length} files`
|
|
|
4173
4197
|
}
|
|
4174
4198
|
|
|
4175
4199
|
// src/commands/complexity/halstead.ts
|
|
4176
|
-
import
|
|
4200
|
+
import chalk44 from "chalk";
|
|
4177
4201
|
async function halstead(pattern2 = "**/*.ts", options2 = {}) {
|
|
4178
4202
|
withSourceFiles(pattern2, (files) => {
|
|
4179
4203
|
const results = [];
|
|
@@ -4188,13 +4212,13 @@ async function halstead(pattern2 = "**/*.ts", options2 = {}) {
|
|
|
4188
4212
|
results.sort((a, b) => b.metrics.effort - a.metrics.effort);
|
|
4189
4213
|
for (const { file, name, metrics } of results) {
|
|
4190
4214
|
const exceedsThreshold = options2.threshold !== void 0 && metrics.volume > options2.threshold;
|
|
4191
|
-
const color = exceedsThreshold ?
|
|
4215
|
+
const color = exceedsThreshold ? chalk44.red : chalk44.white;
|
|
4192
4216
|
console.log(
|
|
4193
|
-
`${color(`${file}:${name}`)} \u2192 volume: ${
|
|
4217
|
+
`${color(`${file}:${name}`)} \u2192 volume: ${chalk44.cyan(metrics.volume.toFixed(1))}, difficulty: ${chalk44.yellow(metrics.difficulty.toFixed(1))}, effort: ${chalk44.magenta(metrics.effort.toFixed(1))}`
|
|
4194
4218
|
);
|
|
4195
4219
|
}
|
|
4196
4220
|
console.log(
|
|
4197
|
-
|
|
4221
|
+
chalk44.dim(
|
|
4198
4222
|
`
|
|
4199
4223
|
Analyzed ${results.length} functions across ${files.length} files`
|
|
4200
4224
|
)
|
|
@@ -4209,28 +4233,28 @@ Analyzed ${results.length} functions across ${files.length} files`
|
|
|
4209
4233
|
import fs13 from "fs";
|
|
4210
4234
|
|
|
4211
4235
|
// src/commands/complexity/maintainability/displayMaintainabilityResults.ts
|
|
4212
|
-
import
|
|
4236
|
+
import chalk45 from "chalk";
|
|
4213
4237
|
function displayMaintainabilityResults(results, threshold) {
|
|
4214
4238
|
const filtered = threshold !== void 0 ? results.filter((r) => r.minMaintainability < threshold) : results;
|
|
4215
4239
|
if (threshold !== void 0 && filtered.length === 0) {
|
|
4216
|
-
console.log(
|
|
4240
|
+
console.log(chalk45.green("All files pass maintainability threshold"));
|
|
4217
4241
|
} else {
|
|
4218
4242
|
for (const { file, avgMaintainability, minMaintainability } of filtered) {
|
|
4219
|
-
const color = threshold !== void 0 ?
|
|
4243
|
+
const color = threshold !== void 0 ? chalk45.red : chalk45.white;
|
|
4220
4244
|
console.log(
|
|
4221
|
-
`${color(file)} \u2192 avg: ${
|
|
4245
|
+
`${color(file)} \u2192 avg: ${chalk45.cyan(avgMaintainability.toFixed(1))}, min: ${chalk45.yellow(minMaintainability.toFixed(1))}`
|
|
4222
4246
|
);
|
|
4223
4247
|
}
|
|
4224
4248
|
}
|
|
4225
|
-
console.log(
|
|
4249
|
+
console.log(chalk45.dim(`
|
|
4226
4250
|
Analyzed ${results.length} files`));
|
|
4227
4251
|
if (filtered.length > 0 && threshold !== void 0) {
|
|
4228
4252
|
console.error(
|
|
4229
|
-
|
|
4253
|
+
chalk45.red(
|
|
4230
4254
|
`
|
|
4231
4255
|
Fail: ${filtered.length} file(s) below threshold ${threshold}. Maintainability index (0\u2013100) is derived from Halstead volume, cyclomatic complexity, and lines of code.
|
|
4232
4256
|
|
|
4233
|
-
\u26A0\uFE0F ${
|
|
4257
|
+
\u26A0\uFE0F ${chalk45.bold("Diagnose and fix one file at a time")} \u2014 do not investigate or fix multiple files in parallel. Run 'assist complexity <file>' to see all metrics. For larger files, start by extracting responsibilities into smaller files.`
|
|
4234
4258
|
)
|
|
4235
4259
|
);
|
|
4236
4260
|
process.exit(1);
|
|
@@ -4287,7 +4311,7 @@ async function maintainability(pattern2 = "**/*.ts", options2 = {}) {
|
|
|
4287
4311
|
|
|
4288
4312
|
// src/commands/complexity/sloc.ts
|
|
4289
4313
|
import fs14 from "fs";
|
|
4290
|
-
import
|
|
4314
|
+
import chalk46 from "chalk";
|
|
4291
4315
|
async function sloc(pattern2 = "**/*.ts", options2 = {}) {
|
|
4292
4316
|
withSourceFiles(pattern2, (files) => {
|
|
4293
4317
|
const results = [];
|
|
@@ -4303,12 +4327,12 @@ async function sloc(pattern2 = "**/*.ts", options2 = {}) {
|
|
|
4303
4327
|
results.sort((a, b) => b.lines - a.lines);
|
|
4304
4328
|
for (const { file, lines } of results) {
|
|
4305
4329
|
const exceedsThreshold = options2.threshold !== void 0 && lines > options2.threshold;
|
|
4306
|
-
const color = exceedsThreshold ?
|
|
4307
|
-
console.log(`${color(file)} \u2192 ${
|
|
4330
|
+
const color = exceedsThreshold ? chalk46.red : chalk46.white;
|
|
4331
|
+
console.log(`${color(file)} \u2192 ${chalk46.cyan(lines)} lines`);
|
|
4308
4332
|
}
|
|
4309
4333
|
const total = results.reduce((sum, r) => sum + r.lines, 0);
|
|
4310
4334
|
console.log(
|
|
4311
|
-
|
|
4335
|
+
chalk46.dim(`
|
|
4312
4336
|
Total: ${total} lines across ${files.length} files`)
|
|
4313
4337
|
);
|
|
4314
4338
|
if (hasViolation) {
|
|
@@ -4322,21 +4346,21 @@ async function analyze(pattern2) {
|
|
|
4322
4346
|
const searchPattern = pattern2.includes("*") || pattern2.includes("/") ? pattern2 : `**/${pattern2}`;
|
|
4323
4347
|
const files = findSourceFiles2(searchPattern);
|
|
4324
4348
|
if (files.length === 0) {
|
|
4325
|
-
console.log(
|
|
4349
|
+
console.log(chalk47.yellow("No files found matching pattern"));
|
|
4326
4350
|
return;
|
|
4327
4351
|
}
|
|
4328
4352
|
if (files.length === 1) {
|
|
4329
4353
|
const file = files[0];
|
|
4330
|
-
console.log(
|
|
4354
|
+
console.log(chalk47.bold.underline("SLOC"));
|
|
4331
4355
|
await sloc(file);
|
|
4332
4356
|
console.log();
|
|
4333
|
-
console.log(
|
|
4357
|
+
console.log(chalk47.bold.underline("Cyclomatic Complexity"));
|
|
4334
4358
|
await cyclomatic(file);
|
|
4335
4359
|
console.log();
|
|
4336
|
-
console.log(
|
|
4360
|
+
console.log(chalk47.bold.underline("Halstead Metrics"));
|
|
4337
4361
|
await halstead(file);
|
|
4338
4362
|
console.log();
|
|
4339
|
-
console.log(
|
|
4363
|
+
console.log(chalk47.bold.underline("Maintainability Index"));
|
|
4340
4364
|
await maintainability(file);
|
|
4341
4365
|
return;
|
|
4342
4366
|
}
|
|
@@ -4364,7 +4388,7 @@ function registerComplexity(program2) {
|
|
|
4364
4388
|
|
|
4365
4389
|
// src/commands/deploy/redirect.ts
|
|
4366
4390
|
import { existsSync as existsSync21, readFileSync as readFileSync16, writeFileSync as writeFileSync16 } from "fs";
|
|
4367
|
-
import
|
|
4391
|
+
import chalk48 from "chalk";
|
|
4368
4392
|
var TRAILING_SLASH_SCRIPT = ` <script>
|
|
4369
4393
|
if (!window.location.pathname.endsWith('/')) {
|
|
4370
4394
|
window.location.href = \`\${window.location.pathname}/\${window.location.search}\${window.location.hash}\`;
|
|
@@ -4373,22 +4397,22 @@ var TRAILING_SLASH_SCRIPT = ` <script>
|
|
|
4373
4397
|
function redirect() {
|
|
4374
4398
|
const indexPath = "index.html";
|
|
4375
4399
|
if (!existsSync21(indexPath)) {
|
|
4376
|
-
console.log(
|
|
4400
|
+
console.log(chalk48.yellow("No index.html found"));
|
|
4377
4401
|
return;
|
|
4378
4402
|
}
|
|
4379
4403
|
const content = readFileSync16(indexPath, "utf-8");
|
|
4380
4404
|
if (content.includes("window.location.pathname.endsWith('/')")) {
|
|
4381
|
-
console.log(
|
|
4405
|
+
console.log(chalk48.dim("Trailing slash script already present"));
|
|
4382
4406
|
return;
|
|
4383
4407
|
}
|
|
4384
4408
|
const headCloseIndex = content.indexOf("</head>");
|
|
4385
4409
|
if (headCloseIndex === -1) {
|
|
4386
|
-
console.log(
|
|
4410
|
+
console.log(chalk48.red("Could not find </head> tag in index.html"));
|
|
4387
4411
|
return;
|
|
4388
4412
|
}
|
|
4389
4413
|
const newContent = content.slice(0, headCloseIndex) + TRAILING_SLASH_SCRIPT + "\n " + content.slice(headCloseIndex);
|
|
4390
4414
|
writeFileSync16(indexPath, newContent);
|
|
4391
|
-
console.log(
|
|
4415
|
+
console.log(chalk48.green("Added trailing slash redirect to index.html"));
|
|
4392
4416
|
}
|
|
4393
4417
|
|
|
4394
4418
|
// src/commands/registerDeploy.ts
|
|
@@ -4415,7 +4439,7 @@ function loadBlogSkipDays(repoName) {
|
|
|
4415
4439
|
|
|
4416
4440
|
// src/commands/devlog/shared.ts
|
|
4417
4441
|
import { execSync as execSync16 } from "child_process";
|
|
4418
|
-
import
|
|
4442
|
+
import chalk49 from "chalk";
|
|
4419
4443
|
|
|
4420
4444
|
// src/commands/devlog/loadDevlogEntries.ts
|
|
4421
4445
|
import { readdirSync, readFileSync as readFileSync17 } from "fs";
|
|
@@ -4502,13 +4526,13 @@ function shouldIgnoreCommit(files, ignorePaths) {
|
|
|
4502
4526
|
}
|
|
4503
4527
|
function printCommitsWithFiles(commits, ignore2, verbose) {
|
|
4504
4528
|
for (const commit2 of commits) {
|
|
4505
|
-
console.log(` ${
|
|
4529
|
+
console.log(` ${chalk49.yellow(commit2.hash)} ${commit2.message}`);
|
|
4506
4530
|
if (verbose) {
|
|
4507
4531
|
const visibleFiles = commit2.files.filter(
|
|
4508
4532
|
(file) => !ignore2.some((p) => file.startsWith(p))
|
|
4509
4533
|
);
|
|
4510
4534
|
for (const file of visibleFiles) {
|
|
4511
|
-
console.log(` ${
|
|
4535
|
+
console.log(` ${chalk49.dim(file)}`);
|
|
4512
4536
|
}
|
|
4513
4537
|
}
|
|
4514
4538
|
}
|
|
@@ -4533,15 +4557,15 @@ function parseGitLogCommits(output, ignore2, afterDate) {
|
|
|
4533
4557
|
}
|
|
4534
4558
|
|
|
4535
4559
|
// src/commands/devlog/list/printDateHeader.ts
|
|
4536
|
-
import
|
|
4560
|
+
import chalk50 from "chalk";
|
|
4537
4561
|
function printDateHeader(date, isSkipped, entries) {
|
|
4538
4562
|
if (isSkipped) {
|
|
4539
|
-
console.log(`${
|
|
4563
|
+
console.log(`${chalk50.bold.blue(date)} ${chalk50.dim("skipped")}`);
|
|
4540
4564
|
} else if (entries && entries.length > 0) {
|
|
4541
|
-
const entryInfo = entries.map((e) => `${
|
|
4542
|
-
console.log(`${
|
|
4565
|
+
const entryInfo = entries.map((e) => `${chalk50.green(e.version)} ${e.title}`).join(" | ");
|
|
4566
|
+
console.log(`${chalk50.bold.blue(date)} ${entryInfo}`);
|
|
4543
4567
|
} else {
|
|
4544
|
-
console.log(`${
|
|
4568
|
+
console.log(`${chalk50.bold.blue(date)} ${chalk50.red("\u26A0 devlog missing")}`);
|
|
4545
4569
|
}
|
|
4546
4570
|
}
|
|
4547
4571
|
|
|
@@ -4644,24 +4668,24 @@ function bumpVersion(version2, type) {
|
|
|
4644
4668
|
|
|
4645
4669
|
// src/commands/devlog/next/displayNextEntry/index.ts
|
|
4646
4670
|
import { execSync as execSync19 } from "child_process";
|
|
4647
|
-
import
|
|
4671
|
+
import chalk52 from "chalk";
|
|
4648
4672
|
|
|
4649
4673
|
// src/commands/devlog/next/displayNextEntry/displayVersion.ts
|
|
4650
|
-
import
|
|
4674
|
+
import chalk51 from "chalk";
|
|
4651
4675
|
function displayVersion(conventional, firstHash, patchVersion, minorVersion) {
|
|
4652
4676
|
if (conventional && firstHash) {
|
|
4653
4677
|
const version2 = getVersionAtCommit(firstHash);
|
|
4654
4678
|
if (version2) {
|
|
4655
|
-
console.log(`${
|
|
4679
|
+
console.log(`${chalk51.bold("version:")} ${stripToMinor(version2)}`);
|
|
4656
4680
|
} else {
|
|
4657
|
-
console.log(`${
|
|
4681
|
+
console.log(`${chalk51.bold("version:")} ${chalk51.red("unknown")}`);
|
|
4658
4682
|
}
|
|
4659
4683
|
} else if (patchVersion && minorVersion) {
|
|
4660
4684
|
console.log(
|
|
4661
|
-
`${
|
|
4685
|
+
`${chalk51.bold("version:")} ${patchVersion} (patch) or ${minorVersion} (minor)`
|
|
4662
4686
|
);
|
|
4663
4687
|
} else {
|
|
4664
|
-
console.log(`${
|
|
4688
|
+
console.log(`${chalk51.bold("version:")} v0.1 (initial)`);
|
|
4665
4689
|
}
|
|
4666
4690
|
}
|
|
4667
4691
|
|
|
@@ -4708,16 +4732,16 @@ function noCommitsMessage(hasLastInfo) {
|
|
|
4708
4732
|
return hasLastInfo ? "No commits after last versioned entry" : "No commits found";
|
|
4709
4733
|
}
|
|
4710
4734
|
function logName(repoName) {
|
|
4711
|
-
console.log(`${
|
|
4735
|
+
console.log(`${chalk52.bold("name:")} ${repoName}`);
|
|
4712
4736
|
}
|
|
4713
4737
|
function displayNextEntry(ctx, targetDate, commits) {
|
|
4714
4738
|
logName(ctx.repoName);
|
|
4715
4739
|
printVersionInfo(ctx.config, ctx.lastInfo, commits[0]?.hash);
|
|
4716
|
-
console.log(
|
|
4740
|
+
console.log(chalk52.bold.blue(targetDate));
|
|
4717
4741
|
printCommitsWithFiles(commits, ctx.ignore, ctx.verbose);
|
|
4718
4742
|
}
|
|
4719
4743
|
function logNoCommits(lastInfo) {
|
|
4720
|
-
console.log(
|
|
4744
|
+
console.log(chalk52.dim(noCommitsMessage(!!lastInfo)));
|
|
4721
4745
|
}
|
|
4722
4746
|
|
|
4723
4747
|
// src/commands/devlog/next/index.ts
|
|
@@ -4758,11 +4782,11 @@ function next2(options2) {
|
|
|
4758
4782
|
import { execSync as execSync20 } from "child_process";
|
|
4759
4783
|
|
|
4760
4784
|
// src/commands/devlog/repos/printReposTable.ts
|
|
4761
|
-
import
|
|
4785
|
+
import chalk53 from "chalk";
|
|
4762
4786
|
function colorStatus(status2) {
|
|
4763
|
-
if (status2 === "missing") return
|
|
4764
|
-
if (status2 === "outdated") return
|
|
4765
|
-
return
|
|
4787
|
+
if (status2 === "missing") return chalk53.red(status2);
|
|
4788
|
+
if (status2 === "outdated") return chalk53.yellow(status2);
|
|
4789
|
+
return chalk53.green(status2);
|
|
4766
4790
|
}
|
|
4767
4791
|
function formatRow(row, nameWidth) {
|
|
4768
4792
|
const devlog = (row.lastDevlog ?? "-").padEnd(11);
|
|
@@ -4776,8 +4800,8 @@ function printReposTable(rows) {
|
|
|
4776
4800
|
"Last Devlog".padEnd(11),
|
|
4777
4801
|
"Status"
|
|
4778
4802
|
].join(" ");
|
|
4779
|
-
console.log(
|
|
4780
|
-
console.log(
|
|
4803
|
+
console.log(chalk53.dim(header));
|
|
4804
|
+
console.log(chalk53.dim("-".repeat(header.length)));
|
|
4781
4805
|
for (const row of rows) {
|
|
4782
4806
|
console.log(formatRow(row, nameWidth));
|
|
4783
4807
|
}
|
|
@@ -4835,14 +4859,14 @@ function repos(options2) {
|
|
|
4835
4859
|
// src/commands/devlog/skip.ts
|
|
4836
4860
|
import { writeFileSync as writeFileSync17 } from "fs";
|
|
4837
4861
|
import { join as join16 } from "path";
|
|
4838
|
-
import
|
|
4862
|
+
import chalk54 from "chalk";
|
|
4839
4863
|
import { stringify as stringifyYaml4 } from "yaml";
|
|
4840
4864
|
function getBlogConfigPath() {
|
|
4841
4865
|
return join16(BLOG_REPO_ROOT, "assist.yml");
|
|
4842
4866
|
}
|
|
4843
4867
|
function skip(date) {
|
|
4844
4868
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) {
|
|
4845
|
-
console.log(
|
|
4869
|
+
console.log(chalk54.red("Invalid date format. Use YYYY-MM-DD"));
|
|
4846
4870
|
process.exit(1);
|
|
4847
4871
|
}
|
|
4848
4872
|
const repoName = getRepoName();
|
|
@@ -4853,7 +4877,7 @@ function skip(date) {
|
|
|
4853
4877
|
const skipDays = skip2[repoName] ?? [];
|
|
4854
4878
|
if (skipDays.includes(date)) {
|
|
4855
4879
|
console.log(
|
|
4856
|
-
|
|
4880
|
+
chalk54.yellow(`${date} is already in skip list for ${repoName}`)
|
|
4857
4881
|
);
|
|
4858
4882
|
return;
|
|
4859
4883
|
}
|
|
@@ -4863,20 +4887,20 @@ function skip(date) {
|
|
|
4863
4887
|
devlog.skip = skip2;
|
|
4864
4888
|
config.devlog = devlog;
|
|
4865
4889
|
writeFileSync17(configPath, stringifyYaml4(config, { lineWidth: 0 }));
|
|
4866
|
-
console.log(
|
|
4890
|
+
console.log(chalk54.green(`Added ${date} to skip list for ${repoName}`));
|
|
4867
4891
|
}
|
|
4868
4892
|
|
|
4869
4893
|
// src/commands/devlog/version.ts
|
|
4870
|
-
import
|
|
4894
|
+
import chalk55 from "chalk";
|
|
4871
4895
|
function version() {
|
|
4872
4896
|
const config = loadConfig();
|
|
4873
4897
|
const name = getRepoName();
|
|
4874
4898
|
const lastInfo = getLastVersionInfo(name, config);
|
|
4875
4899
|
const lastVersion = lastInfo?.version ?? null;
|
|
4876
4900
|
const nextVersion = lastVersion ? bumpVersion(lastVersion, "patch") : null;
|
|
4877
|
-
console.log(`${
|
|
4878
|
-
console.log(`${
|
|
4879
|
-
console.log(`${
|
|
4901
|
+
console.log(`${chalk55.bold("name:")} ${name}`);
|
|
4902
|
+
console.log(`${chalk55.bold("last:")} ${lastVersion ?? chalk55.dim("none")}`);
|
|
4903
|
+
console.log(`${chalk55.bold("next:")} ${nextVersion ?? chalk55.dim("none")}`);
|
|
4880
4904
|
}
|
|
4881
4905
|
|
|
4882
4906
|
// src/commands/registerDevlog.ts
|
|
@@ -4900,7 +4924,7 @@ function registerDevlog(program2) {
|
|
|
4900
4924
|
// src/commands/dotnet/checkBuildLocks.ts
|
|
4901
4925
|
import { closeSync, openSync, readdirSync as readdirSync2 } from "fs";
|
|
4902
4926
|
import { join as join17 } from "path";
|
|
4903
|
-
import
|
|
4927
|
+
import chalk56 from "chalk";
|
|
4904
4928
|
|
|
4905
4929
|
// src/shared/findRepoRoot.ts
|
|
4906
4930
|
import { existsSync as existsSync22 } from "fs";
|
|
@@ -4963,14 +4987,14 @@ function checkBuildLocks(startDir) {
|
|
|
4963
4987
|
const locked = findFirstLockedDll(startDir ?? getSearchRoot());
|
|
4964
4988
|
if (locked) {
|
|
4965
4989
|
console.error(
|
|
4966
|
-
|
|
4990
|
+
chalk56.red("Build output locked (is VS debugging?): ") + locked
|
|
4967
4991
|
);
|
|
4968
4992
|
process.exit(1);
|
|
4969
4993
|
}
|
|
4970
4994
|
}
|
|
4971
4995
|
async function checkBuildLocksCommand() {
|
|
4972
4996
|
checkBuildLocks();
|
|
4973
|
-
console.log(
|
|
4997
|
+
console.log(chalk56.green("No build locks detected"));
|
|
4974
4998
|
}
|
|
4975
4999
|
|
|
4976
5000
|
// src/commands/dotnet/buildTree.ts
|
|
@@ -5069,30 +5093,30 @@ function escapeRegex(s) {
|
|
|
5069
5093
|
}
|
|
5070
5094
|
|
|
5071
5095
|
// src/commands/dotnet/printTree.ts
|
|
5072
|
-
import
|
|
5096
|
+
import chalk57 from "chalk";
|
|
5073
5097
|
function printNodes(nodes, prefix2) {
|
|
5074
5098
|
for (let i = 0; i < nodes.length; i++) {
|
|
5075
5099
|
const isLast = i === nodes.length - 1;
|
|
5076
5100
|
const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
5077
5101
|
const childPrefix = isLast ? " " : "\u2502 ";
|
|
5078
5102
|
const isMissing = nodes[i].relativePath.startsWith("[MISSING]");
|
|
5079
|
-
const label2 = isMissing ?
|
|
5103
|
+
const label2 = isMissing ? chalk57.red(nodes[i].relativePath) : nodes[i].relativePath;
|
|
5080
5104
|
console.log(`${prefix2}${connector}${label2}`);
|
|
5081
5105
|
printNodes(nodes[i].children, prefix2 + childPrefix);
|
|
5082
5106
|
}
|
|
5083
5107
|
}
|
|
5084
5108
|
function printTree(tree, totalCount, solutions) {
|
|
5085
|
-
console.log(
|
|
5086
|
-
console.log(
|
|
5109
|
+
console.log(chalk57.bold("\nProject Dependency Tree"));
|
|
5110
|
+
console.log(chalk57.cyan(tree.relativePath));
|
|
5087
5111
|
printNodes(tree.children, "");
|
|
5088
|
-
console.log(
|
|
5112
|
+
console.log(chalk57.dim(`
|
|
5089
5113
|
${totalCount} projects total (including root)`));
|
|
5090
|
-
console.log(
|
|
5114
|
+
console.log(chalk57.bold("\nSolution Membership"));
|
|
5091
5115
|
if (solutions.length === 0) {
|
|
5092
|
-
console.log(
|
|
5116
|
+
console.log(chalk57.yellow(" Not found in any .sln"));
|
|
5093
5117
|
} else {
|
|
5094
5118
|
for (const sln of solutions) {
|
|
5095
|
-
console.log(` ${
|
|
5119
|
+
console.log(` ${chalk57.green(sln)}`);
|
|
5096
5120
|
}
|
|
5097
5121
|
}
|
|
5098
5122
|
console.log();
|
|
@@ -5121,16 +5145,16 @@ function printJson(tree, totalCount, solutions) {
|
|
|
5121
5145
|
// src/commands/dotnet/resolveCsproj.ts
|
|
5122
5146
|
import { existsSync as existsSync23 } from "fs";
|
|
5123
5147
|
import path24 from "path";
|
|
5124
|
-
import
|
|
5148
|
+
import chalk58 from "chalk";
|
|
5125
5149
|
function resolveCsproj(csprojPath) {
|
|
5126
5150
|
const resolved = path24.resolve(csprojPath);
|
|
5127
5151
|
if (!existsSync23(resolved)) {
|
|
5128
|
-
console.error(
|
|
5152
|
+
console.error(chalk58.red(`File not found: ${resolved}`));
|
|
5129
5153
|
process.exit(1);
|
|
5130
5154
|
}
|
|
5131
5155
|
const repoRoot = findRepoRoot(path24.dirname(resolved));
|
|
5132
5156
|
if (!repoRoot) {
|
|
5133
|
-
console.error(
|
|
5157
|
+
console.error(chalk58.red("Could not find git repository root"));
|
|
5134
5158
|
process.exit(1);
|
|
5135
5159
|
}
|
|
5136
5160
|
return { resolved, repoRoot };
|
|
@@ -5180,12 +5204,12 @@ function getChangedCsFiles(scope) {
|
|
|
5180
5204
|
}
|
|
5181
5205
|
|
|
5182
5206
|
// src/commands/dotnet/inSln.ts
|
|
5183
|
-
import
|
|
5207
|
+
import chalk59 from "chalk";
|
|
5184
5208
|
async function inSln(csprojPath) {
|
|
5185
5209
|
const { resolved, repoRoot } = resolveCsproj(csprojPath);
|
|
5186
5210
|
const solutions = findContainingSolutions(resolved, repoRoot);
|
|
5187
5211
|
if (solutions.length === 0) {
|
|
5188
|
-
console.log(
|
|
5212
|
+
console.log(chalk59.yellow("Not found in any .sln file"));
|
|
5189
5213
|
process.exit(1);
|
|
5190
5214
|
}
|
|
5191
5215
|
for (const sln of solutions) {
|
|
@@ -5194,7 +5218,7 @@ async function inSln(csprojPath) {
|
|
|
5194
5218
|
}
|
|
5195
5219
|
|
|
5196
5220
|
// src/commands/dotnet/inspect.ts
|
|
5197
|
-
import
|
|
5221
|
+
import chalk65 from "chalk";
|
|
5198
5222
|
|
|
5199
5223
|
// src/shared/formatElapsed.ts
|
|
5200
5224
|
function formatElapsed(ms) {
|
|
@@ -5206,12 +5230,12 @@ function formatElapsed(ms) {
|
|
|
5206
5230
|
}
|
|
5207
5231
|
|
|
5208
5232
|
// src/commands/dotnet/displayIssues.ts
|
|
5209
|
-
import
|
|
5233
|
+
import chalk60 from "chalk";
|
|
5210
5234
|
var SEVERITY_COLOR = {
|
|
5211
|
-
ERROR:
|
|
5212
|
-
WARNING:
|
|
5213
|
-
SUGGESTION:
|
|
5214
|
-
HINT:
|
|
5235
|
+
ERROR: chalk60.red,
|
|
5236
|
+
WARNING: chalk60.yellow,
|
|
5237
|
+
SUGGESTION: chalk60.cyan,
|
|
5238
|
+
HINT: chalk60.dim
|
|
5215
5239
|
};
|
|
5216
5240
|
function groupByFile(issues) {
|
|
5217
5241
|
const byFile = /* @__PURE__ */ new Map();
|
|
@@ -5227,15 +5251,15 @@ function groupByFile(issues) {
|
|
|
5227
5251
|
}
|
|
5228
5252
|
function displayIssues(issues) {
|
|
5229
5253
|
for (const [file, fileIssues] of groupByFile(issues)) {
|
|
5230
|
-
console.log(
|
|
5254
|
+
console.log(chalk60.bold(file));
|
|
5231
5255
|
for (const issue of fileIssues.sort((a, b) => a.line - b.line)) {
|
|
5232
|
-
const color = SEVERITY_COLOR[issue.severity] ??
|
|
5256
|
+
const color = SEVERITY_COLOR[issue.severity] ?? chalk60.white;
|
|
5233
5257
|
console.log(
|
|
5234
|
-
` ${
|
|
5258
|
+
` ${chalk60.dim(`${issue.line}:`)} ${color(issue.severity)} [${issue.typeId}] ${issue.message}`
|
|
5235
5259
|
);
|
|
5236
5260
|
}
|
|
5237
5261
|
}
|
|
5238
|
-
console.log(
|
|
5262
|
+
console.log(chalk60.dim(`
|
|
5239
5263
|
${issues.length} issue(s) found`));
|
|
5240
5264
|
}
|
|
5241
5265
|
|
|
@@ -5294,12 +5318,12 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
|
|
|
5294
5318
|
// src/commands/dotnet/resolveSolution.ts
|
|
5295
5319
|
import { existsSync as existsSync24 } from "fs";
|
|
5296
5320
|
import path25 from "path";
|
|
5297
|
-
import
|
|
5321
|
+
import chalk62 from "chalk";
|
|
5298
5322
|
|
|
5299
5323
|
// src/commands/dotnet/findSolution.ts
|
|
5300
5324
|
import { readdirSync as readdirSync4 } from "fs";
|
|
5301
5325
|
import { dirname as dirname16, join as join18 } from "path";
|
|
5302
|
-
import
|
|
5326
|
+
import chalk61 from "chalk";
|
|
5303
5327
|
function findSlnInDir(dir) {
|
|
5304
5328
|
try {
|
|
5305
5329
|
return readdirSync4(dir).filter((f) => f.endsWith(".sln")).map((f) => join18(dir, f));
|
|
@@ -5315,17 +5339,17 @@ function findSolution() {
|
|
|
5315
5339
|
const slnFiles = findSlnInDir(current);
|
|
5316
5340
|
if (slnFiles.length === 1) return slnFiles[0];
|
|
5317
5341
|
if (slnFiles.length > 1) {
|
|
5318
|
-
console.error(
|
|
5342
|
+
console.error(chalk61.red(`Multiple .sln files found in ${current}:`));
|
|
5319
5343
|
for (const f of slnFiles) console.error(` ${f}`);
|
|
5320
5344
|
console.error(
|
|
5321
|
-
|
|
5345
|
+
chalk61.yellow("Specify which one: assist dotnet inspect <sln>")
|
|
5322
5346
|
);
|
|
5323
5347
|
process.exit(1);
|
|
5324
5348
|
}
|
|
5325
5349
|
if (current === ceiling) break;
|
|
5326
5350
|
current = dirname16(current);
|
|
5327
5351
|
}
|
|
5328
|
-
console.error(
|
|
5352
|
+
console.error(chalk61.red("No .sln file found between cwd and repo root"));
|
|
5329
5353
|
process.exit(1);
|
|
5330
5354
|
}
|
|
5331
5355
|
|
|
@@ -5334,7 +5358,7 @@ function resolveSolution(sln) {
|
|
|
5334
5358
|
if (sln) {
|
|
5335
5359
|
const resolved = path25.resolve(sln);
|
|
5336
5360
|
if (!existsSync24(resolved)) {
|
|
5337
|
-
console.error(
|
|
5361
|
+
console.error(chalk62.red(`Solution file not found: ${resolved}`));
|
|
5338
5362
|
process.exit(1);
|
|
5339
5363
|
}
|
|
5340
5364
|
return resolved;
|
|
@@ -5376,14 +5400,14 @@ import { execSync as execSync22 } from "child_process";
|
|
|
5376
5400
|
import { existsSync as existsSync25, readFileSync as readFileSync20, unlinkSync as unlinkSync4 } from "fs";
|
|
5377
5401
|
import { tmpdir as tmpdir2 } from "os";
|
|
5378
5402
|
import path26 from "path";
|
|
5379
|
-
import
|
|
5403
|
+
import chalk63 from "chalk";
|
|
5380
5404
|
function assertJbInstalled() {
|
|
5381
5405
|
try {
|
|
5382
5406
|
execSync22("jb inspectcode --version", { stdio: "pipe" });
|
|
5383
5407
|
} catch {
|
|
5384
|
-
console.error(
|
|
5408
|
+
console.error(chalk63.red("jb is not installed. Install with:"));
|
|
5385
5409
|
console.error(
|
|
5386
|
-
|
|
5410
|
+
chalk63.yellow(" dotnet tool install -g JetBrains.ReSharper.GlobalTools")
|
|
5387
5411
|
);
|
|
5388
5412
|
process.exit(1);
|
|
5389
5413
|
}
|
|
@@ -5401,11 +5425,11 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
5401
5425
|
if (err && typeof err === "object" && "stderr" in err) {
|
|
5402
5426
|
process.stderr.write(err.stderr);
|
|
5403
5427
|
}
|
|
5404
|
-
console.error(
|
|
5428
|
+
console.error(chalk63.red("jb inspectcode failed"));
|
|
5405
5429
|
process.exit(1);
|
|
5406
5430
|
}
|
|
5407
5431
|
if (!existsSync25(reportPath)) {
|
|
5408
|
-
console.error(
|
|
5432
|
+
console.error(chalk63.red("Report file not generated"));
|
|
5409
5433
|
process.exit(1);
|
|
5410
5434
|
}
|
|
5411
5435
|
const xml = readFileSync20(reportPath, "utf-8");
|
|
@@ -5415,7 +5439,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
5415
5439
|
|
|
5416
5440
|
// src/commands/dotnet/runRoslynInspect.ts
|
|
5417
5441
|
import { execSync as execSync23 } from "child_process";
|
|
5418
|
-
import
|
|
5442
|
+
import chalk64 from "chalk";
|
|
5419
5443
|
function resolveMsbuildPath() {
|
|
5420
5444
|
const config = loadConfig();
|
|
5421
5445
|
const buildConfig = config.run?.find((r) => r.name === "build");
|
|
@@ -5426,9 +5450,9 @@ function assertMsbuildInstalled() {
|
|
|
5426
5450
|
try {
|
|
5427
5451
|
execSync23(`"${msbuild}" -version`, { stdio: "pipe" });
|
|
5428
5452
|
} catch {
|
|
5429
|
-
console.error(
|
|
5453
|
+
console.error(chalk64.red(`msbuild not found at: ${msbuild}`));
|
|
5430
5454
|
console.error(
|
|
5431
|
-
|
|
5455
|
+
chalk64.yellow(
|
|
5432
5456
|
"Configure it via a 'build' run entry in .claude/assist.yml or add msbuild to PATH."
|
|
5433
5457
|
)
|
|
5434
5458
|
);
|
|
@@ -5475,17 +5499,17 @@ function runEngine(resolved, changedFiles, options2) {
|
|
|
5475
5499
|
// src/commands/dotnet/inspect.ts
|
|
5476
5500
|
function logScope(changedFiles) {
|
|
5477
5501
|
if (changedFiles === null) {
|
|
5478
|
-
console.log(
|
|
5502
|
+
console.log(chalk65.dim("Inspecting full solution..."));
|
|
5479
5503
|
} else {
|
|
5480
5504
|
console.log(
|
|
5481
|
-
|
|
5505
|
+
chalk65.dim(`Inspecting ${changedFiles.length} changed file(s)...`)
|
|
5482
5506
|
);
|
|
5483
5507
|
}
|
|
5484
5508
|
}
|
|
5485
5509
|
function reportResults(issues, elapsed) {
|
|
5486
5510
|
if (issues.length > 0) displayIssues(issues);
|
|
5487
|
-
else console.log(
|
|
5488
|
-
console.log(
|
|
5511
|
+
else console.log(chalk65.green("No issues found"));
|
|
5512
|
+
console.log(chalk65.dim(`Completed in ${formatElapsed(elapsed)}`));
|
|
5489
5513
|
if (issues.length > 0) process.exit(1);
|
|
5490
5514
|
}
|
|
5491
5515
|
async function inspect(sln, options2) {
|
|
@@ -5496,7 +5520,7 @@ async function inspect(sln, options2) {
|
|
|
5496
5520
|
const scope = parseScope(options2.scope);
|
|
5497
5521
|
const changedFiles = getChangedCsFiles(scope);
|
|
5498
5522
|
if (changedFiles !== null && changedFiles.length === 0) {
|
|
5499
|
-
console.log(
|
|
5523
|
+
console.log(chalk65.green("No changed .cs files found"));
|
|
5500
5524
|
return;
|
|
5501
5525
|
}
|
|
5502
5526
|
logScope(changedFiles);
|
|
@@ -5522,7 +5546,7 @@ function registerDotnet(program2) {
|
|
|
5522
5546
|
}
|
|
5523
5547
|
|
|
5524
5548
|
// src/commands/jira/acceptanceCriteria.ts
|
|
5525
|
-
import
|
|
5549
|
+
import chalk67 from "chalk";
|
|
5526
5550
|
|
|
5527
5551
|
// src/commands/jira/adfToText.ts
|
|
5528
5552
|
function renderInline(node) {
|
|
@@ -5583,7 +5607,7 @@ function adfToText(doc) {
|
|
|
5583
5607
|
|
|
5584
5608
|
// src/commands/jira/fetchIssue.ts
|
|
5585
5609
|
import { execSync as execSync24 } from "child_process";
|
|
5586
|
-
import
|
|
5610
|
+
import chalk66 from "chalk";
|
|
5587
5611
|
function fetchIssue(issueKey, fields) {
|
|
5588
5612
|
let result;
|
|
5589
5613
|
try {
|
|
@@ -5596,15 +5620,15 @@ function fetchIssue(issueKey, fields) {
|
|
|
5596
5620
|
const stderr = error.stderr;
|
|
5597
5621
|
if (stderr.includes("unauthorized")) {
|
|
5598
5622
|
console.error(
|
|
5599
|
-
|
|
5623
|
+
chalk66.red("Jira authentication expired."),
|
|
5600
5624
|
"Run",
|
|
5601
|
-
|
|
5625
|
+
chalk66.cyan("assist jira auth"),
|
|
5602
5626
|
"to re-authenticate."
|
|
5603
5627
|
);
|
|
5604
5628
|
process.exit(1);
|
|
5605
5629
|
}
|
|
5606
5630
|
}
|
|
5607
|
-
console.error(
|
|
5631
|
+
console.error(chalk66.red(`Failed to fetch ${issueKey}.`));
|
|
5608
5632
|
process.exit(1);
|
|
5609
5633
|
}
|
|
5610
5634
|
return JSON.parse(result);
|
|
@@ -5618,7 +5642,7 @@ function acceptanceCriteria(issueKey) {
|
|
|
5618
5642
|
const parsed = fetchIssue(issueKey, field);
|
|
5619
5643
|
const acValue = parsed?.fields?.[field];
|
|
5620
5644
|
if (!acValue) {
|
|
5621
|
-
console.log(
|
|
5645
|
+
console.log(chalk67.yellow(`No acceptance criteria found on ${issueKey}.`));
|
|
5622
5646
|
return;
|
|
5623
5647
|
}
|
|
5624
5648
|
if (typeof acValue === "string") {
|
|
@@ -5713,14 +5737,14 @@ async function jiraAuth() {
|
|
|
5713
5737
|
}
|
|
5714
5738
|
|
|
5715
5739
|
// src/commands/jira/viewIssue.ts
|
|
5716
|
-
import
|
|
5740
|
+
import chalk68 from "chalk";
|
|
5717
5741
|
function viewIssue(issueKey) {
|
|
5718
5742
|
const parsed = fetchIssue(issueKey, "summary,description");
|
|
5719
5743
|
const fields = parsed?.fields;
|
|
5720
5744
|
const summary = fields?.summary;
|
|
5721
5745
|
const description = fields?.description;
|
|
5722
5746
|
if (summary) {
|
|
5723
|
-
console.log(
|
|
5747
|
+
console.log(chalk68.bold(summary));
|
|
5724
5748
|
}
|
|
5725
5749
|
if (description) {
|
|
5726
5750
|
if (summary) console.log();
|
|
@@ -5734,7 +5758,7 @@ function viewIssue(issueKey) {
|
|
|
5734
5758
|
}
|
|
5735
5759
|
if (!summary && !description) {
|
|
5736
5760
|
console.log(
|
|
5737
|
-
|
|
5761
|
+
chalk68.yellow(`No summary or description found on ${issueKey}.`)
|
|
5738
5762
|
);
|
|
5739
5763
|
}
|
|
5740
5764
|
}
|
|
@@ -5748,7 +5772,7 @@ function registerJira(program2) {
|
|
|
5748
5772
|
}
|
|
5749
5773
|
|
|
5750
5774
|
// src/commands/news/add/index.ts
|
|
5751
|
-
import
|
|
5775
|
+
import chalk69 from "chalk";
|
|
5752
5776
|
import enquirer7 from "enquirer";
|
|
5753
5777
|
async function add2(url) {
|
|
5754
5778
|
if (!url) {
|
|
@@ -5771,17 +5795,17 @@ async function add2(url) {
|
|
|
5771
5795
|
const news = config.news ?? {};
|
|
5772
5796
|
const feeds = news.feeds ?? [];
|
|
5773
5797
|
if (feeds.includes(url)) {
|
|
5774
|
-
console.log(
|
|
5798
|
+
console.log(chalk69.yellow("Feed already exists in config"));
|
|
5775
5799
|
return;
|
|
5776
5800
|
}
|
|
5777
5801
|
feeds.push(url);
|
|
5778
5802
|
config.news = { ...news, feeds };
|
|
5779
5803
|
saveGlobalConfig(config);
|
|
5780
|
-
console.log(
|
|
5804
|
+
console.log(chalk69.green(`Added feed: ${url}`));
|
|
5781
5805
|
}
|
|
5782
5806
|
|
|
5783
5807
|
// src/commands/news/web/handleRequest.ts
|
|
5784
|
-
import
|
|
5808
|
+
import chalk70 from "chalk";
|
|
5785
5809
|
|
|
5786
5810
|
// src/commands/news/web/shared.ts
|
|
5787
5811
|
import { decodeHTML } from "entities";
|
|
@@ -5917,17 +5941,17 @@ function prefetch() {
|
|
|
5917
5941
|
const config = loadConfig();
|
|
5918
5942
|
const total = config.news.feeds.length;
|
|
5919
5943
|
if (total === 0) return;
|
|
5920
|
-
process.stdout.write(
|
|
5944
|
+
process.stdout.write(chalk70.dim(`Fetching ${total} feed(s)\u2026 `));
|
|
5921
5945
|
prefetchPromise = fetchFeeds(config.news.feeds, (done2, t) => {
|
|
5922
5946
|
const width = 20;
|
|
5923
5947
|
const filled = Math.round(done2 / t * width);
|
|
5924
5948
|
const bar = `${"\u2588".repeat(filled)}${"\u2591".repeat(width - filled)}`;
|
|
5925
5949
|
process.stdout.write(
|
|
5926
|
-
`\r${
|
|
5950
|
+
`\r${chalk70.dim(`Fetching feeds ${bar} ${done2}/${t}`)}`
|
|
5927
5951
|
);
|
|
5928
5952
|
}).then((items) => {
|
|
5929
5953
|
process.stdout.write(
|
|
5930
|
-
`\r${
|
|
5954
|
+
`\r${chalk70.green(`Fetched ${items.length} items from ${total} feed(s)`)}
|
|
5931
5955
|
`
|
|
5932
5956
|
);
|
|
5933
5957
|
cachedItems = items;
|
|
@@ -6288,20 +6312,20 @@ function fetchLineComments(org, repo, prNumber, threadInfo) {
|
|
|
6288
6312
|
}
|
|
6289
6313
|
|
|
6290
6314
|
// src/commands/prs/listComments/printComments.ts
|
|
6291
|
-
import
|
|
6315
|
+
import chalk71 from "chalk";
|
|
6292
6316
|
function formatForHuman(comment2) {
|
|
6293
6317
|
if (comment2.type === "review") {
|
|
6294
|
-
const stateColor = comment2.state === "APPROVED" ?
|
|
6318
|
+
const stateColor = comment2.state === "APPROVED" ? chalk71.green : comment2.state === "CHANGES_REQUESTED" ? chalk71.red : chalk71.yellow;
|
|
6295
6319
|
return [
|
|
6296
|
-
`${
|
|
6320
|
+
`${chalk71.cyan("Review")} by ${chalk71.bold(comment2.user)} ${stateColor(`[${comment2.state}]`)}`,
|
|
6297
6321
|
comment2.body,
|
|
6298
6322
|
""
|
|
6299
6323
|
].join("\n");
|
|
6300
6324
|
}
|
|
6301
6325
|
const location = comment2.line ? `:${comment2.line}` : "";
|
|
6302
6326
|
return [
|
|
6303
|
-
`${
|
|
6304
|
-
|
|
6327
|
+
`${chalk71.cyan("Line comment")} by ${chalk71.bold(comment2.user)} on ${chalk71.dim(`${comment2.path}${location}`)}`,
|
|
6328
|
+
chalk71.dim(comment2.diff_hunk.split("\n").slice(-3).join("\n")),
|
|
6305
6329
|
comment2.body,
|
|
6306
6330
|
""
|
|
6307
6331
|
].join("\n");
|
|
@@ -6391,13 +6415,13 @@ import { execSync as execSync31 } from "child_process";
|
|
|
6391
6415
|
import enquirer8 from "enquirer";
|
|
6392
6416
|
|
|
6393
6417
|
// src/commands/prs/prs/displayPaginated/printPr.ts
|
|
6394
|
-
import
|
|
6418
|
+
import chalk72 from "chalk";
|
|
6395
6419
|
var STATUS_MAP = {
|
|
6396
|
-
MERGED: (pr) => pr.mergedAt ? { label:
|
|
6397
|
-
CLOSED: (pr) => pr.closedAt ? { label:
|
|
6420
|
+
MERGED: (pr) => pr.mergedAt ? { label: chalk72.magenta("merged"), date: pr.mergedAt } : null,
|
|
6421
|
+
CLOSED: (pr) => pr.closedAt ? { label: chalk72.red("closed"), date: pr.closedAt } : null
|
|
6398
6422
|
};
|
|
6399
6423
|
function defaultStatus(pr) {
|
|
6400
|
-
return { label:
|
|
6424
|
+
return { label: chalk72.green("opened"), date: pr.createdAt };
|
|
6401
6425
|
}
|
|
6402
6426
|
function getStatus2(pr) {
|
|
6403
6427
|
return STATUS_MAP[pr.state]?.(pr) ?? defaultStatus(pr);
|
|
@@ -6406,11 +6430,11 @@ function formatDate(dateStr) {
|
|
|
6406
6430
|
return new Date(dateStr).toISOString().split("T")[0];
|
|
6407
6431
|
}
|
|
6408
6432
|
function formatPrHeader(pr, status2) {
|
|
6409
|
-
return `${
|
|
6433
|
+
return `${chalk72.cyan(`#${pr.number}`)} ${pr.title} ${chalk72.dim(`(${pr.author.login},`)} ${status2.label} ${chalk72.dim(`${formatDate(status2.date)})`)}`;
|
|
6410
6434
|
}
|
|
6411
6435
|
function logPrDetails(pr) {
|
|
6412
6436
|
console.log(
|
|
6413
|
-
|
|
6437
|
+
chalk72.dim(` ${pr.changedFiles.toLocaleString()} files | ${pr.url}`)
|
|
6414
6438
|
);
|
|
6415
6439
|
console.log();
|
|
6416
6440
|
}
|
|
@@ -6576,10 +6600,10 @@ function registerPrs(program2) {
|
|
|
6576
6600
|
}
|
|
6577
6601
|
|
|
6578
6602
|
// src/commands/ravendb/ravendbAuth.ts
|
|
6579
|
-
import
|
|
6603
|
+
import chalk78 from "chalk";
|
|
6580
6604
|
|
|
6581
6605
|
// src/shared/createConnectionAuth.ts
|
|
6582
|
-
import
|
|
6606
|
+
import chalk73 from "chalk";
|
|
6583
6607
|
function listConnections(connections, format2) {
|
|
6584
6608
|
if (connections.length === 0) {
|
|
6585
6609
|
console.log("No connections configured.");
|
|
@@ -6592,7 +6616,7 @@ function listConnections(connections, format2) {
|
|
|
6592
6616
|
function removeConnection(connections, name, save) {
|
|
6593
6617
|
const filtered = connections.filter((c) => c.name !== name);
|
|
6594
6618
|
if (filtered.length === connections.length) {
|
|
6595
|
-
console.error(
|
|
6619
|
+
console.error(chalk73.red(`Connection "${name}" not found.`));
|
|
6596
6620
|
process.exit(1);
|
|
6597
6621
|
}
|
|
6598
6622
|
save(filtered);
|
|
@@ -6638,15 +6662,15 @@ function saveConnections(connections) {
|
|
|
6638
6662
|
}
|
|
6639
6663
|
|
|
6640
6664
|
// src/commands/ravendb/promptConnection.ts
|
|
6641
|
-
import
|
|
6665
|
+
import chalk76 from "chalk";
|
|
6642
6666
|
|
|
6643
6667
|
// src/commands/ravendb/selectOpSecret.ts
|
|
6644
|
-
import
|
|
6668
|
+
import chalk75 from "chalk";
|
|
6645
6669
|
import Enquirer2 from "enquirer";
|
|
6646
6670
|
|
|
6647
6671
|
// src/commands/ravendb/searchItems.ts
|
|
6648
6672
|
import { execSync as execSync33 } from "child_process";
|
|
6649
|
-
import
|
|
6673
|
+
import chalk74 from "chalk";
|
|
6650
6674
|
function opExec(args) {
|
|
6651
6675
|
return execSync33(`op ${args}`, {
|
|
6652
6676
|
encoding: "utf-8",
|
|
@@ -6659,7 +6683,7 @@ function searchItems(search) {
|
|
|
6659
6683
|
items = JSON.parse(opExec("item list --format=json"));
|
|
6660
6684
|
} catch {
|
|
6661
6685
|
console.error(
|
|
6662
|
-
|
|
6686
|
+
chalk74.red(
|
|
6663
6687
|
"Failed to search 1Password. Ensure the CLI is installed and you are signed in."
|
|
6664
6688
|
)
|
|
6665
6689
|
);
|
|
@@ -6673,7 +6697,7 @@ function getItemFields(itemId) {
|
|
|
6673
6697
|
const item = JSON.parse(opExec(`item get "${itemId}" --format=json`));
|
|
6674
6698
|
return item.fields.filter((f) => f.reference && f.label);
|
|
6675
6699
|
} catch {
|
|
6676
|
-
console.error(
|
|
6700
|
+
console.error(chalk74.red("Failed to get item details from 1Password."));
|
|
6677
6701
|
process.exit(1);
|
|
6678
6702
|
}
|
|
6679
6703
|
}
|
|
@@ -6692,7 +6716,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
6692
6716
|
}).run();
|
|
6693
6717
|
const items = searchItems(search);
|
|
6694
6718
|
if (items.length === 0) {
|
|
6695
|
-
console.error(
|
|
6719
|
+
console.error(chalk75.red(`No items found matching "${search}".`));
|
|
6696
6720
|
process.exit(1);
|
|
6697
6721
|
}
|
|
6698
6722
|
const itemId = await selectOne(
|
|
@@ -6701,7 +6725,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
6701
6725
|
);
|
|
6702
6726
|
const fields = getItemFields(itemId);
|
|
6703
6727
|
if (fields.length === 0) {
|
|
6704
|
-
console.error(
|
|
6728
|
+
console.error(chalk75.red("No fields with references found on this item."));
|
|
6705
6729
|
process.exit(1);
|
|
6706
6730
|
}
|
|
6707
6731
|
const ref = await selectOne(
|
|
@@ -6715,7 +6739,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
6715
6739
|
async function promptConnection(existingNames) {
|
|
6716
6740
|
const name = await promptInput("name", "Connection name:");
|
|
6717
6741
|
if (existingNames.includes(name)) {
|
|
6718
|
-
console.error(
|
|
6742
|
+
console.error(chalk76.red(`Connection "${name}" already exists.`));
|
|
6719
6743
|
process.exit(1);
|
|
6720
6744
|
}
|
|
6721
6745
|
const url = await promptInput(
|
|
@@ -6724,22 +6748,22 @@ async function promptConnection(existingNames) {
|
|
|
6724
6748
|
);
|
|
6725
6749
|
const database = await promptInput("database", "Database name:");
|
|
6726
6750
|
if (!name || !url || !database) {
|
|
6727
|
-
console.error(
|
|
6751
|
+
console.error(chalk76.red("All fields are required."));
|
|
6728
6752
|
process.exit(1);
|
|
6729
6753
|
}
|
|
6730
6754
|
const apiKeyRef = await selectOpSecret();
|
|
6731
|
-
console.log(
|
|
6755
|
+
console.log(chalk76.dim(`Using: ${apiKeyRef}`));
|
|
6732
6756
|
return { name, url, database, apiKeyRef };
|
|
6733
6757
|
}
|
|
6734
6758
|
|
|
6735
6759
|
// src/commands/ravendb/ravendbSetConnection.ts
|
|
6736
|
-
import
|
|
6760
|
+
import chalk77 from "chalk";
|
|
6737
6761
|
function ravendbSetConnection(name) {
|
|
6738
6762
|
const raw = loadGlobalConfigRaw();
|
|
6739
6763
|
const ravendb = raw.ravendb ?? {};
|
|
6740
6764
|
const connections = ravendb.connections ?? [];
|
|
6741
6765
|
if (!connections.some((c) => c.name === name)) {
|
|
6742
|
-
console.error(
|
|
6766
|
+
console.error(chalk77.red(`Connection "${name}" not found.`));
|
|
6743
6767
|
console.error(
|
|
6744
6768
|
`Available: ${connections.map((c) => c.name).join(", ") || "(none)"}`
|
|
6745
6769
|
);
|
|
@@ -6755,16 +6779,16 @@ function ravendbSetConnection(name) {
|
|
|
6755
6779
|
var ravendbAuth = createConnectionAuth({
|
|
6756
6780
|
load: loadConnections,
|
|
6757
6781
|
save: saveConnections,
|
|
6758
|
-
format: (c) => `${
|
|
6782
|
+
format: (c) => `${chalk78.bold(c.name)} ${c.url} db=${c.database} key=${c.apiKeyRef}`,
|
|
6759
6783
|
promptNew: promptConnection,
|
|
6760
6784
|
onFirst: (c) => ravendbSetConnection(c.name)
|
|
6761
6785
|
});
|
|
6762
6786
|
|
|
6763
6787
|
// src/commands/ravendb/ravendbCollections.ts
|
|
6764
|
-
import
|
|
6788
|
+
import chalk82 from "chalk";
|
|
6765
6789
|
|
|
6766
6790
|
// src/commands/ravendb/ravenFetch.ts
|
|
6767
|
-
import
|
|
6791
|
+
import chalk80 from "chalk";
|
|
6768
6792
|
|
|
6769
6793
|
// src/commands/ravendb/getAccessToken.ts
|
|
6770
6794
|
var OAUTH_URL = "https://amazon-useast-1-oauth.ravenhq.com/ApiKeys/OAuth/AccessToken";
|
|
@@ -6801,10 +6825,10 @@ ${errorText}`
|
|
|
6801
6825
|
|
|
6802
6826
|
// src/commands/ravendb/resolveOpSecret.ts
|
|
6803
6827
|
import { execSync as execSync34 } from "child_process";
|
|
6804
|
-
import
|
|
6828
|
+
import chalk79 from "chalk";
|
|
6805
6829
|
function resolveOpSecret(reference) {
|
|
6806
6830
|
if (!reference.startsWith("op://")) {
|
|
6807
|
-
console.error(
|
|
6831
|
+
console.error(chalk79.red(`Invalid secret reference: must start with op://`));
|
|
6808
6832
|
process.exit(1);
|
|
6809
6833
|
}
|
|
6810
6834
|
try {
|
|
@@ -6814,7 +6838,7 @@ function resolveOpSecret(reference) {
|
|
|
6814
6838
|
}).trim();
|
|
6815
6839
|
} catch {
|
|
6816
6840
|
console.error(
|
|
6817
|
-
|
|
6841
|
+
chalk79.red(
|
|
6818
6842
|
"Failed to resolve secret reference. Ensure 1Password CLI is installed and you are signed in."
|
|
6819
6843
|
)
|
|
6820
6844
|
);
|
|
@@ -6841,7 +6865,7 @@ async function ravenFetch(connection, path50) {
|
|
|
6841
6865
|
if (!response.ok) {
|
|
6842
6866
|
const body = await response.text();
|
|
6843
6867
|
console.error(
|
|
6844
|
-
|
|
6868
|
+
chalk80.red(`RavenDB error: ${response.status} ${response.statusText}`)
|
|
6845
6869
|
);
|
|
6846
6870
|
console.error(body.substring(0, 500));
|
|
6847
6871
|
process.exit(1);
|
|
@@ -6850,7 +6874,7 @@ async function ravenFetch(connection, path50) {
|
|
|
6850
6874
|
}
|
|
6851
6875
|
|
|
6852
6876
|
// src/commands/ravendb/resolveConnection.ts
|
|
6853
|
-
import
|
|
6877
|
+
import chalk81 from "chalk";
|
|
6854
6878
|
function loadRavendb() {
|
|
6855
6879
|
const raw = loadGlobalConfigRaw();
|
|
6856
6880
|
const ravendb = raw.ravendb;
|
|
@@ -6864,7 +6888,7 @@ function resolveConnection(name) {
|
|
|
6864
6888
|
const connectionName = name ?? defaultConnection;
|
|
6865
6889
|
if (!connectionName) {
|
|
6866
6890
|
console.error(
|
|
6867
|
-
|
|
6891
|
+
chalk81.red(
|
|
6868
6892
|
"No connection specified and no default set. Use assist ravendb set-connection <name> or pass a connection name."
|
|
6869
6893
|
)
|
|
6870
6894
|
);
|
|
@@ -6872,7 +6896,7 @@ function resolveConnection(name) {
|
|
|
6872
6896
|
}
|
|
6873
6897
|
const connection = connections.find((c) => c.name === connectionName);
|
|
6874
6898
|
if (!connection) {
|
|
6875
|
-
console.error(
|
|
6899
|
+
console.error(chalk81.red(`Connection "${connectionName}" not found.`));
|
|
6876
6900
|
console.error(
|
|
6877
6901
|
`Available: ${connections.map((c) => c.name).join(", ") || "(none)"}`
|
|
6878
6902
|
);
|
|
@@ -6903,15 +6927,15 @@ async function ravendbCollections(connectionName) {
|
|
|
6903
6927
|
return;
|
|
6904
6928
|
}
|
|
6905
6929
|
for (const c of collections) {
|
|
6906
|
-
console.log(`${
|
|
6930
|
+
console.log(`${chalk82.bold(c.Name)} ${c.CountOfDocuments} docs`);
|
|
6907
6931
|
}
|
|
6908
6932
|
}
|
|
6909
6933
|
|
|
6910
6934
|
// src/commands/ravendb/ravendbQuery.ts
|
|
6911
|
-
import
|
|
6935
|
+
import chalk84 from "chalk";
|
|
6912
6936
|
|
|
6913
6937
|
// src/commands/ravendb/fetchAllPages.ts
|
|
6914
|
-
import
|
|
6938
|
+
import chalk83 from "chalk";
|
|
6915
6939
|
|
|
6916
6940
|
// src/commands/ravendb/buildQueryPath.ts
|
|
6917
6941
|
function buildQueryPath(opts) {
|
|
@@ -6949,7 +6973,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
6949
6973
|
allResults.push(...results);
|
|
6950
6974
|
start3 += results.length;
|
|
6951
6975
|
process.stderr.write(
|
|
6952
|
-
`\r${
|
|
6976
|
+
`\r${chalk83.dim(`Fetched ${allResults.length}/${totalResults}`)}`
|
|
6953
6977
|
);
|
|
6954
6978
|
if (start3 >= totalResults) break;
|
|
6955
6979
|
if (opts.limit !== void 0 && allResults.length >= opts.limit) break;
|
|
@@ -6964,7 +6988,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
6964
6988
|
async function ravendbQuery(connectionName, collection, options2) {
|
|
6965
6989
|
const resolved = resolveArgs(connectionName, collection);
|
|
6966
6990
|
if (!resolved.collection && !options2.query) {
|
|
6967
|
-
console.error(
|
|
6991
|
+
console.error(chalk84.red("Provide a collection name or --query filter."));
|
|
6968
6992
|
process.exit(1);
|
|
6969
6993
|
}
|
|
6970
6994
|
const { collection: col } = resolved;
|
|
@@ -7002,7 +7026,7 @@ import { spawn as spawn4 } from "child_process";
|
|
|
7002
7026
|
import * as path27 from "path";
|
|
7003
7027
|
|
|
7004
7028
|
// src/commands/refactor/logViolations.ts
|
|
7005
|
-
import
|
|
7029
|
+
import chalk85 from "chalk";
|
|
7006
7030
|
var DEFAULT_MAX_LINES = 100;
|
|
7007
7031
|
function logViolations(violations, maxLines = DEFAULT_MAX_LINES) {
|
|
7008
7032
|
if (violations.length === 0) {
|
|
@@ -7011,43 +7035,43 @@ function logViolations(violations, maxLines = DEFAULT_MAX_LINES) {
|
|
|
7011
7035
|
}
|
|
7012
7036
|
return;
|
|
7013
7037
|
}
|
|
7014
|
-
console.error(
|
|
7038
|
+
console.error(chalk85.red(`
|
|
7015
7039
|
Refactor check failed:
|
|
7016
7040
|
`));
|
|
7017
|
-
console.error(
|
|
7041
|
+
console.error(chalk85.red(` The following files exceed ${maxLines} lines:
|
|
7018
7042
|
`));
|
|
7019
7043
|
for (const violation of violations) {
|
|
7020
|
-
console.error(
|
|
7044
|
+
console.error(chalk85.red(` ${violation.file} (${violation.lines} lines)`));
|
|
7021
7045
|
}
|
|
7022
7046
|
console.error(
|
|
7023
|
-
|
|
7047
|
+
chalk85.yellow(
|
|
7024
7048
|
`
|
|
7025
7049
|
Each file needs to be sensibly refactored, or if there is no sensible
|
|
7026
7050
|
way to refactor it, ignore it with:
|
|
7027
7051
|
`
|
|
7028
7052
|
)
|
|
7029
7053
|
);
|
|
7030
|
-
console.error(
|
|
7054
|
+
console.error(chalk85.gray(` assist refactor ignore <file>
|
|
7031
7055
|
`));
|
|
7032
7056
|
if (process.env.CLAUDECODE) {
|
|
7033
|
-
console.error(
|
|
7057
|
+
console.error(chalk85.cyan(`
|
|
7034
7058
|
## Extracting Code to New Files
|
|
7035
7059
|
`));
|
|
7036
7060
|
console.error(
|
|
7037
|
-
|
|
7061
|
+
chalk85.cyan(
|
|
7038
7062
|
` When extracting logic from one file to another, consider where the extracted code belongs:
|
|
7039
7063
|
`
|
|
7040
7064
|
)
|
|
7041
7065
|
);
|
|
7042
7066
|
console.error(
|
|
7043
|
-
|
|
7067
|
+
chalk85.cyan(
|
|
7044
7068
|
` 1. Keep related logic together: If the extracted code is tightly coupled to the
|
|
7045
7069
|
original file's domain, create a new folder containing both the original and extracted files.
|
|
7046
7070
|
`
|
|
7047
7071
|
)
|
|
7048
7072
|
);
|
|
7049
7073
|
console.error(
|
|
7050
|
-
|
|
7074
|
+
chalk85.cyan(
|
|
7051
7075
|
` 2. Share common utilities: If the extracted code can be reused across multiple
|
|
7052
7076
|
domains, move it to a common/shared folder.
|
|
7053
7077
|
`
|
|
@@ -7203,7 +7227,7 @@ async function check(pattern2, options2) {
|
|
|
7203
7227
|
|
|
7204
7228
|
// src/commands/refactor/extract/index.ts
|
|
7205
7229
|
import path33 from "path";
|
|
7206
|
-
import
|
|
7230
|
+
import chalk88 from "chalk";
|
|
7207
7231
|
|
|
7208
7232
|
// src/commands/refactor/extract/applyExtraction.ts
|
|
7209
7233
|
import { SyntaxKind as SyntaxKind3 } from "ts-morph";
|
|
@@ -7729,23 +7753,23 @@ function buildPlan(functionName, sourceFile, sourcePath, destPath, project) {
|
|
|
7729
7753
|
|
|
7730
7754
|
// src/commands/refactor/extract/displayPlan.ts
|
|
7731
7755
|
import path31 from "path";
|
|
7732
|
-
import
|
|
7756
|
+
import chalk86 from "chalk";
|
|
7733
7757
|
function section(title) {
|
|
7734
7758
|
return `
|
|
7735
|
-
${
|
|
7759
|
+
${chalk86.cyan(title)}`;
|
|
7736
7760
|
}
|
|
7737
7761
|
function displayImporters(plan2, cwd) {
|
|
7738
7762
|
if (plan2.importersToUpdate.length === 0) return;
|
|
7739
7763
|
console.log(section("Update importers:"));
|
|
7740
7764
|
for (const imp of plan2.importersToUpdate) {
|
|
7741
7765
|
const rel = path31.relative(cwd, imp.file.getFilePath());
|
|
7742
|
-
console.log(` ${
|
|
7766
|
+
console.log(` ${chalk86.dim(rel)}: \u2192 import from "${imp.relPath}"`);
|
|
7743
7767
|
}
|
|
7744
7768
|
}
|
|
7745
7769
|
function displayPlan(functionName, relDest, plan2, cwd) {
|
|
7746
|
-
console.log(
|
|
7770
|
+
console.log(chalk86.bold(`Extract: ${functionName} \u2192 ${relDest}
|
|
7747
7771
|
`));
|
|
7748
|
-
console.log(` ${
|
|
7772
|
+
console.log(` ${chalk86.cyan("Functions to move:")}`);
|
|
7749
7773
|
for (const name of plan2.extractedNames) {
|
|
7750
7774
|
console.log(` ${name}`);
|
|
7751
7775
|
}
|
|
@@ -7780,7 +7804,7 @@ function displayPlan(functionName, relDest, plan2, cwd) {
|
|
|
7780
7804
|
// src/commands/refactor/extract/loadProjectFile.ts
|
|
7781
7805
|
import fs17 from "fs";
|
|
7782
7806
|
import path32 from "path";
|
|
7783
|
-
import
|
|
7807
|
+
import chalk87 from "chalk";
|
|
7784
7808
|
import { Project as Project2 } from "ts-morph";
|
|
7785
7809
|
function findTsConfig(sourcePath) {
|
|
7786
7810
|
const rootConfig = path32.resolve("tsconfig.json");
|
|
@@ -7811,7 +7835,7 @@ function loadProjectFile(file) {
|
|
|
7811
7835
|
});
|
|
7812
7836
|
const sourceFile = project.getSourceFile(sourcePath);
|
|
7813
7837
|
if (!sourceFile) {
|
|
7814
|
-
console.log(
|
|
7838
|
+
console.log(chalk87.red(`File not found in project: ${file}`));
|
|
7815
7839
|
process.exit(1);
|
|
7816
7840
|
}
|
|
7817
7841
|
return { project, sourceFile };
|
|
@@ -7834,19 +7858,19 @@ async function extract(file, functionName, destination, options2 = {}) {
|
|
|
7834
7858
|
displayPlan(functionName, relDest, plan2, cwd);
|
|
7835
7859
|
if (options2.apply) {
|
|
7836
7860
|
await applyExtraction(functionName, sourceFile, destPath, plan2, project);
|
|
7837
|
-
console.log(
|
|
7861
|
+
console.log(chalk88.green("\nExtraction complete"));
|
|
7838
7862
|
} else {
|
|
7839
|
-
console.log(
|
|
7863
|
+
console.log(chalk88.dim("\nDry run. Use --apply to execute."));
|
|
7840
7864
|
}
|
|
7841
7865
|
}
|
|
7842
7866
|
|
|
7843
7867
|
// src/commands/refactor/ignore.ts
|
|
7844
7868
|
import fs18 from "fs";
|
|
7845
|
-
import
|
|
7869
|
+
import chalk89 from "chalk";
|
|
7846
7870
|
var REFACTOR_YML_PATH2 = "refactor.yml";
|
|
7847
7871
|
function ignore(file) {
|
|
7848
7872
|
if (!fs18.existsSync(file)) {
|
|
7849
|
-
console.error(
|
|
7873
|
+
console.error(chalk89.red(`Error: File does not exist: ${file}`));
|
|
7850
7874
|
process.exit(1);
|
|
7851
7875
|
}
|
|
7852
7876
|
const content = fs18.readFileSync(file, "utf-8");
|
|
@@ -7862,7 +7886,7 @@ function ignore(file) {
|
|
|
7862
7886
|
fs18.writeFileSync(REFACTOR_YML_PATH2, entry);
|
|
7863
7887
|
}
|
|
7864
7888
|
console.log(
|
|
7865
|
-
|
|
7889
|
+
chalk89.green(
|
|
7866
7890
|
`Added ${file} to refactor ignore list (max ${maxLines} lines)`
|
|
7867
7891
|
)
|
|
7868
7892
|
);
|
|
@@ -7870,26 +7894,26 @@ function ignore(file) {
|
|
|
7870
7894
|
|
|
7871
7895
|
// src/commands/refactor/rename/index.ts
|
|
7872
7896
|
import path34 from "path";
|
|
7873
|
-
import
|
|
7897
|
+
import chalk90 from "chalk";
|
|
7874
7898
|
async function rename(source, destination, options2 = {}) {
|
|
7875
7899
|
const destPath = path34.resolve(destination);
|
|
7876
7900
|
const cwd = process.cwd();
|
|
7877
7901
|
const relSource = path34.relative(cwd, path34.resolve(source));
|
|
7878
7902
|
const relDest = path34.relative(cwd, destPath);
|
|
7879
7903
|
const { project, sourceFile } = loadProjectFile(source);
|
|
7880
|
-
console.log(
|
|
7904
|
+
console.log(chalk90.bold(`Rename: ${relSource} \u2192 ${relDest}`));
|
|
7881
7905
|
if (options2.apply) {
|
|
7882
7906
|
sourceFile.move(destPath);
|
|
7883
7907
|
await project.save();
|
|
7884
|
-
console.log(
|
|
7908
|
+
console.log(chalk90.green("Done"));
|
|
7885
7909
|
} else {
|
|
7886
|
-
console.log(
|
|
7910
|
+
console.log(chalk90.dim("Dry run. Use --apply to execute."));
|
|
7887
7911
|
}
|
|
7888
7912
|
}
|
|
7889
7913
|
|
|
7890
7914
|
// src/commands/refactor/renameSymbol/index.ts
|
|
7891
7915
|
import path36 from "path";
|
|
7892
|
-
import
|
|
7916
|
+
import chalk91 from "chalk";
|
|
7893
7917
|
import { Project as Project3 } from "ts-morph";
|
|
7894
7918
|
|
|
7895
7919
|
// src/commands/refactor/renameSymbol/findSymbol.ts
|
|
@@ -7938,38 +7962,38 @@ async function renameSymbol(file, oldName, newName, options2 = {}) {
|
|
|
7938
7962
|
const project = new Project3({ tsConfigFilePath: tsConfigPath });
|
|
7939
7963
|
const sourceFile = project.getSourceFile(filePath);
|
|
7940
7964
|
if (!sourceFile) {
|
|
7941
|
-
console.log(
|
|
7965
|
+
console.log(chalk91.red(`File not found in project: ${file}`));
|
|
7942
7966
|
process.exit(1);
|
|
7943
7967
|
}
|
|
7944
7968
|
const symbol = findSymbol(sourceFile, oldName);
|
|
7945
7969
|
if (!symbol) {
|
|
7946
|
-
console.log(
|
|
7970
|
+
console.log(chalk91.red(`Symbol "${oldName}" not found in ${file}`));
|
|
7947
7971
|
process.exit(1);
|
|
7948
7972
|
}
|
|
7949
7973
|
const grouped = groupReferences(symbol, cwd);
|
|
7950
7974
|
const totalRefs = [...grouped.values()].reduce((s, l) => s + l.length, 0);
|
|
7951
7975
|
console.log(
|
|
7952
|
-
|
|
7976
|
+
chalk91.bold(`Rename: ${oldName} \u2192 ${newName} (${totalRefs} references)
|
|
7953
7977
|
`)
|
|
7954
7978
|
);
|
|
7955
7979
|
for (const [refFile, lines] of grouped) {
|
|
7956
7980
|
console.log(
|
|
7957
|
-
` ${
|
|
7981
|
+
` ${chalk91.dim(refFile)}: lines ${chalk91.cyan(lines.join(", "))}`
|
|
7958
7982
|
);
|
|
7959
7983
|
}
|
|
7960
7984
|
if (options2.apply) {
|
|
7961
7985
|
symbol.rename(newName);
|
|
7962
7986
|
await project.save();
|
|
7963
|
-
console.log(
|
|
7987
|
+
console.log(chalk91.green(`
|
|
7964
7988
|
Renamed ${oldName} \u2192 ${newName}`));
|
|
7965
7989
|
} else {
|
|
7966
|
-
console.log(
|
|
7990
|
+
console.log(chalk91.dim("\nDry run. Use --apply to execute."));
|
|
7967
7991
|
}
|
|
7968
7992
|
}
|
|
7969
7993
|
|
|
7970
7994
|
// src/commands/refactor/restructure/index.ts
|
|
7971
7995
|
import path45 from "path";
|
|
7972
|
-
import
|
|
7996
|
+
import chalk94 from "chalk";
|
|
7973
7997
|
|
|
7974
7998
|
// src/commands/refactor/restructure/buildImportGraph/index.ts
|
|
7975
7999
|
import path37 from "path";
|
|
@@ -8212,50 +8236,50 @@ function computeRewrites(moves, edges, allProjectFiles) {
|
|
|
8212
8236
|
|
|
8213
8237
|
// src/commands/refactor/restructure/displayPlan.ts
|
|
8214
8238
|
import path41 from "path";
|
|
8215
|
-
import
|
|
8239
|
+
import chalk92 from "chalk";
|
|
8216
8240
|
function relPath(filePath) {
|
|
8217
8241
|
return path41.relative(process.cwd(), filePath);
|
|
8218
8242
|
}
|
|
8219
8243
|
function displayMoves(plan2) {
|
|
8220
8244
|
if (plan2.moves.length === 0) return;
|
|
8221
|
-
console.log(
|
|
8245
|
+
console.log(chalk92.bold("\nFile moves:"));
|
|
8222
8246
|
for (const move of plan2.moves) {
|
|
8223
8247
|
console.log(
|
|
8224
|
-
` ${
|
|
8248
|
+
` ${chalk92.red(relPath(move.from))} \u2192 ${chalk92.green(relPath(move.to))}`
|
|
8225
8249
|
);
|
|
8226
|
-
console.log(
|
|
8250
|
+
console.log(chalk92.dim(` ${move.reason}`));
|
|
8227
8251
|
}
|
|
8228
8252
|
}
|
|
8229
8253
|
function displayRewrites(rewrites) {
|
|
8230
8254
|
if (rewrites.length === 0) return;
|
|
8231
8255
|
const affectedFiles = new Set(rewrites.map((r) => r.file));
|
|
8232
|
-
console.log(
|
|
8256
|
+
console.log(chalk92.bold(`
|
|
8233
8257
|
Import rewrites (${affectedFiles.size} files):`));
|
|
8234
8258
|
for (const file of affectedFiles) {
|
|
8235
|
-
console.log(` ${
|
|
8259
|
+
console.log(` ${chalk92.cyan(relPath(file))}:`);
|
|
8236
8260
|
for (const { oldSpecifier, newSpecifier } of rewrites.filter(
|
|
8237
8261
|
(r) => r.file === file
|
|
8238
8262
|
)) {
|
|
8239
8263
|
console.log(
|
|
8240
|
-
` ${
|
|
8264
|
+
` ${chalk92.red(`"${oldSpecifier}"`)} \u2192 ${chalk92.green(`"${newSpecifier}"`)}`
|
|
8241
8265
|
);
|
|
8242
8266
|
}
|
|
8243
8267
|
}
|
|
8244
8268
|
}
|
|
8245
8269
|
function displayPlan2(plan2) {
|
|
8246
8270
|
if (plan2.warnings.length > 0) {
|
|
8247
|
-
console.log(
|
|
8248
|
-
for (const w of plan2.warnings) console.log(
|
|
8271
|
+
console.log(chalk92.yellow("\nWarnings:"));
|
|
8272
|
+
for (const w of plan2.warnings) console.log(chalk92.yellow(` ${w}`));
|
|
8249
8273
|
}
|
|
8250
8274
|
if (plan2.newDirectories.length > 0) {
|
|
8251
|
-
console.log(
|
|
8275
|
+
console.log(chalk92.bold("\nNew directories:"));
|
|
8252
8276
|
for (const dir of plan2.newDirectories)
|
|
8253
|
-
console.log(
|
|
8277
|
+
console.log(chalk92.green(` ${dir}/`));
|
|
8254
8278
|
}
|
|
8255
8279
|
displayMoves(plan2);
|
|
8256
8280
|
displayRewrites(plan2.rewrites);
|
|
8257
8281
|
console.log(
|
|
8258
|
-
|
|
8282
|
+
chalk92.dim(
|
|
8259
8283
|
`
|
|
8260
8284
|
Summary: ${plan2.moves.length} file(s) moved, ${plan2.rewrites.length} imports rewritten`
|
|
8261
8285
|
)
|
|
@@ -8265,18 +8289,18 @@ Summary: ${plan2.moves.length} file(s) moved, ${plan2.rewrites.length} imports r
|
|
|
8265
8289
|
// src/commands/refactor/restructure/executePlan.ts
|
|
8266
8290
|
import fs20 from "fs";
|
|
8267
8291
|
import path42 from "path";
|
|
8268
|
-
import
|
|
8292
|
+
import chalk93 from "chalk";
|
|
8269
8293
|
function executePlan(plan2) {
|
|
8270
8294
|
const updatedContents = applyRewrites(plan2.rewrites);
|
|
8271
8295
|
for (const [file, content] of updatedContents) {
|
|
8272
8296
|
fs20.writeFileSync(file, content, "utf-8");
|
|
8273
8297
|
console.log(
|
|
8274
|
-
|
|
8298
|
+
chalk93.cyan(` Rewrote imports in ${path42.relative(process.cwd(), file)}`)
|
|
8275
8299
|
);
|
|
8276
8300
|
}
|
|
8277
8301
|
for (const dir of plan2.newDirectories) {
|
|
8278
8302
|
fs20.mkdirSync(dir, { recursive: true });
|
|
8279
|
-
console.log(
|
|
8303
|
+
console.log(chalk93.green(` Created ${path42.relative(process.cwd(), dir)}/`));
|
|
8280
8304
|
}
|
|
8281
8305
|
for (const move of plan2.moves) {
|
|
8282
8306
|
const targetDir = path42.dirname(move.to);
|
|
@@ -8285,7 +8309,7 @@ function executePlan(plan2) {
|
|
|
8285
8309
|
}
|
|
8286
8310
|
fs20.renameSync(move.from, move.to);
|
|
8287
8311
|
console.log(
|
|
8288
|
-
|
|
8312
|
+
chalk93.white(
|
|
8289
8313
|
` Moved ${path42.relative(process.cwd(), move.from)} \u2192 ${path42.relative(process.cwd(), move.to)}`
|
|
8290
8314
|
)
|
|
8291
8315
|
);
|
|
@@ -8300,7 +8324,7 @@ function removeEmptyDirectories(dirs) {
|
|
|
8300
8324
|
if (entries.length === 0) {
|
|
8301
8325
|
fs20.rmdirSync(dir);
|
|
8302
8326
|
console.log(
|
|
8303
|
-
|
|
8327
|
+
chalk93.dim(
|
|
8304
8328
|
` Removed empty directory ${path42.relative(process.cwd(), dir)}`
|
|
8305
8329
|
)
|
|
8306
8330
|
);
|
|
@@ -8433,22 +8457,22 @@ async function restructure(pattern2, options2 = {}) {
|
|
|
8433
8457
|
const targetPattern = pattern2 ?? "src";
|
|
8434
8458
|
const files = findSourceFiles2(targetPattern);
|
|
8435
8459
|
if (files.length === 0) {
|
|
8436
|
-
console.log(
|
|
8460
|
+
console.log(chalk94.yellow("No files found matching pattern"));
|
|
8437
8461
|
return;
|
|
8438
8462
|
}
|
|
8439
8463
|
const tsConfigPath = path45.resolve("tsconfig.json");
|
|
8440
8464
|
const plan2 = buildPlan2(files, tsConfigPath);
|
|
8441
8465
|
if (plan2.moves.length === 0) {
|
|
8442
|
-
console.log(
|
|
8466
|
+
console.log(chalk94.green("No restructuring needed"));
|
|
8443
8467
|
return;
|
|
8444
8468
|
}
|
|
8445
8469
|
displayPlan2(plan2);
|
|
8446
8470
|
if (options2.apply) {
|
|
8447
|
-
console.log(
|
|
8471
|
+
console.log(chalk94.bold("\nApplying changes..."));
|
|
8448
8472
|
executePlan(plan2);
|
|
8449
|
-
console.log(
|
|
8473
|
+
console.log(chalk94.green("\nRestructuring complete"));
|
|
8450
8474
|
} else {
|
|
8451
|
-
console.log(
|
|
8475
|
+
console.log(chalk94.dim("\nDry run. Use --apply to execute."));
|
|
8452
8476
|
}
|
|
8453
8477
|
}
|
|
8454
8478
|
|
|
@@ -8488,7 +8512,7 @@ function registerRefactor(program2) {
|
|
|
8488
8512
|
}
|
|
8489
8513
|
|
|
8490
8514
|
// src/commands/seq/seqAuth.ts
|
|
8491
|
-
import
|
|
8515
|
+
import chalk96 from "chalk";
|
|
8492
8516
|
|
|
8493
8517
|
// src/commands/seq/loadConnections.ts
|
|
8494
8518
|
function loadConnections2() {
|
|
@@ -8517,11 +8541,11 @@ function setDefaultConnection(name) {
|
|
|
8517
8541
|
}
|
|
8518
8542
|
|
|
8519
8543
|
// src/commands/seq/promptConnection.ts
|
|
8520
|
-
import
|
|
8544
|
+
import chalk95 from "chalk";
|
|
8521
8545
|
async function promptConnection2(existingNames) {
|
|
8522
8546
|
const name = await promptInput("name", "Connection name:", "default");
|
|
8523
8547
|
if (existingNames.includes(name)) {
|
|
8524
|
-
console.error(
|
|
8548
|
+
console.error(chalk95.red(`Connection "${name}" already exists.`));
|
|
8525
8549
|
process.exit(1);
|
|
8526
8550
|
}
|
|
8527
8551
|
const url = await promptInput("url", "Seq URL:", "http://localhost:5341");
|
|
@@ -8533,32 +8557,32 @@ async function promptConnection2(existingNames) {
|
|
|
8533
8557
|
var seqAuth = createConnectionAuth({
|
|
8534
8558
|
load: loadConnections2,
|
|
8535
8559
|
save: saveConnections2,
|
|
8536
|
-
format: (c) => `${
|
|
8560
|
+
format: (c) => `${chalk96.bold(c.name)} ${c.url}`,
|
|
8537
8561
|
promptNew: promptConnection2,
|
|
8538
8562
|
onFirst: (c) => setDefaultConnection(c.name)
|
|
8539
8563
|
});
|
|
8540
8564
|
|
|
8541
8565
|
// src/commands/seq/seqQuery.ts
|
|
8542
|
-
import
|
|
8566
|
+
import chalk99 from "chalk";
|
|
8543
8567
|
|
|
8544
8568
|
// src/commands/seq/formatEvent.ts
|
|
8545
|
-
import
|
|
8569
|
+
import chalk97 from "chalk";
|
|
8546
8570
|
function levelColor(level) {
|
|
8547
8571
|
switch (level) {
|
|
8548
8572
|
case "Fatal":
|
|
8549
|
-
return
|
|
8573
|
+
return chalk97.bgRed.white;
|
|
8550
8574
|
case "Error":
|
|
8551
|
-
return
|
|
8575
|
+
return chalk97.red;
|
|
8552
8576
|
case "Warning":
|
|
8553
|
-
return
|
|
8577
|
+
return chalk97.yellow;
|
|
8554
8578
|
case "Information":
|
|
8555
|
-
return
|
|
8579
|
+
return chalk97.cyan;
|
|
8556
8580
|
case "Debug":
|
|
8557
|
-
return
|
|
8581
|
+
return chalk97.gray;
|
|
8558
8582
|
case "Verbose":
|
|
8559
|
-
return
|
|
8583
|
+
return chalk97.dim;
|
|
8560
8584
|
default:
|
|
8561
|
-
return
|
|
8585
|
+
return chalk97.white;
|
|
8562
8586
|
}
|
|
8563
8587
|
}
|
|
8564
8588
|
function levelAbbrev(level) {
|
|
@@ -8599,31 +8623,31 @@ function formatTimestamp(iso) {
|
|
|
8599
8623
|
function formatEvent(event) {
|
|
8600
8624
|
const color = levelColor(event.Level);
|
|
8601
8625
|
const abbrev = levelAbbrev(event.Level);
|
|
8602
|
-
const ts8 =
|
|
8626
|
+
const ts8 = chalk97.dim(formatTimestamp(event.Timestamp));
|
|
8603
8627
|
const msg = renderMessage(event);
|
|
8604
8628
|
const lines = [`${ts8} ${color(`[${abbrev}]`)} ${msg}`];
|
|
8605
8629
|
if (event.Exception) {
|
|
8606
8630
|
for (const line of event.Exception.split("\n")) {
|
|
8607
|
-
lines.push(
|
|
8631
|
+
lines.push(chalk97.red(` ${line}`));
|
|
8608
8632
|
}
|
|
8609
8633
|
}
|
|
8610
8634
|
return lines.join("\n");
|
|
8611
8635
|
}
|
|
8612
8636
|
|
|
8613
8637
|
// src/commands/seq/resolveConnection.ts
|
|
8614
|
-
import
|
|
8638
|
+
import chalk98 from "chalk";
|
|
8615
8639
|
function resolveConnection2(name) {
|
|
8616
8640
|
const connections = loadConnections2();
|
|
8617
8641
|
if (connections.length === 0) {
|
|
8618
8642
|
console.error(
|
|
8619
|
-
|
|
8643
|
+
chalk98.red("No Seq connections configured. Run 'assist seq auth' first.")
|
|
8620
8644
|
);
|
|
8621
8645
|
process.exit(1);
|
|
8622
8646
|
}
|
|
8623
8647
|
const target = name ?? getDefaultConnection() ?? connections[0].name;
|
|
8624
8648
|
const connection = connections.find((c) => c.name === target);
|
|
8625
8649
|
if (!connection) {
|
|
8626
|
-
console.error(
|
|
8650
|
+
console.error(chalk98.red(`Seq connection "${target}" not found.`));
|
|
8627
8651
|
process.exit(1);
|
|
8628
8652
|
}
|
|
8629
8653
|
return connection;
|
|
@@ -8643,12 +8667,12 @@ async function seqQuery(filter, options2) {
|
|
|
8643
8667
|
});
|
|
8644
8668
|
if (!response.ok) {
|
|
8645
8669
|
const body = await response.text();
|
|
8646
|
-
console.error(
|
|
8670
|
+
console.error(chalk99.red(`Seq returned ${response.status}: ${body}`));
|
|
8647
8671
|
process.exit(1);
|
|
8648
8672
|
}
|
|
8649
8673
|
const events = await response.json();
|
|
8650
8674
|
if (events.length === 0) {
|
|
8651
|
-
console.log(
|
|
8675
|
+
console.log(chalk99.yellow("No events found."));
|
|
8652
8676
|
return;
|
|
8653
8677
|
}
|
|
8654
8678
|
if (options2.json) {
|
|
@@ -8659,11 +8683,11 @@ async function seqQuery(filter, options2) {
|
|
|
8659
8683
|
for (const event of chronological) {
|
|
8660
8684
|
console.log(formatEvent(event));
|
|
8661
8685
|
}
|
|
8662
|
-
console.log(
|
|
8686
|
+
console.log(chalk99.dim(`
|
|
8663
8687
|
${events.length} events`));
|
|
8664
8688
|
if (events.length >= count) {
|
|
8665
8689
|
console.log(
|
|
8666
|
-
|
|
8690
|
+
chalk99.yellow(
|
|
8667
8691
|
`Results limited to ${count}. Use --count to retrieve more.`
|
|
8668
8692
|
)
|
|
8669
8693
|
);
|
|
@@ -8671,11 +8695,11 @@ ${events.length} events`));
|
|
|
8671
8695
|
}
|
|
8672
8696
|
|
|
8673
8697
|
// src/commands/seq/seqSetConnection.ts
|
|
8674
|
-
import
|
|
8698
|
+
import chalk100 from "chalk";
|
|
8675
8699
|
function seqSetConnection(name) {
|
|
8676
8700
|
const connections = loadConnections2();
|
|
8677
8701
|
if (!connections.find((c) => c.name === name)) {
|
|
8678
|
-
console.error(
|
|
8702
|
+
console.error(chalk100.red(`Connection "${name}" not found.`));
|
|
8679
8703
|
process.exit(1);
|
|
8680
8704
|
}
|
|
8681
8705
|
setDefaultConnection(name);
|
|
@@ -9214,14 +9238,14 @@ import {
|
|
|
9214
9238
|
import { dirname as dirname20, join as join29 } from "path";
|
|
9215
9239
|
|
|
9216
9240
|
// src/commands/transcript/summarise/processStagedFile/validateStagedContent.ts
|
|
9217
|
-
import
|
|
9241
|
+
import chalk101 from "chalk";
|
|
9218
9242
|
var FULL_TRANSCRIPT_REGEX = /^\[Full Transcript\]\(([^)]+)\)/;
|
|
9219
9243
|
function validateStagedContent(filename, content) {
|
|
9220
9244
|
const firstLine = content.split("\n")[0];
|
|
9221
9245
|
const match = firstLine.match(FULL_TRANSCRIPT_REGEX);
|
|
9222
9246
|
if (!match) {
|
|
9223
9247
|
console.error(
|
|
9224
|
-
|
|
9248
|
+
chalk101.red(
|
|
9225
9249
|
`Staged file ${filename} missing [Full Transcript](<path>) link on first line.`
|
|
9226
9250
|
)
|
|
9227
9251
|
);
|
|
@@ -9230,7 +9254,7 @@ function validateStagedContent(filename, content) {
|
|
|
9230
9254
|
const contentAfterLink = content.slice(firstLine.length).trim();
|
|
9231
9255
|
if (!contentAfterLink) {
|
|
9232
9256
|
console.error(
|
|
9233
|
-
|
|
9257
|
+
chalk101.red(
|
|
9234
9258
|
`Staged file ${filename} has no summary content after the transcript link.`
|
|
9235
9259
|
)
|
|
9236
9260
|
);
|
|
@@ -9623,7 +9647,7 @@ function registerVoice(program2) {
|
|
|
9623
9647
|
|
|
9624
9648
|
// src/commands/roam/auth.ts
|
|
9625
9649
|
import { randomBytes } from "crypto";
|
|
9626
|
-
import
|
|
9650
|
+
import chalk102 from "chalk";
|
|
9627
9651
|
|
|
9628
9652
|
// src/lib/openBrowser.ts
|
|
9629
9653
|
import { execSync as execSync37 } from "child_process";
|
|
@@ -9798,13 +9822,13 @@ async function auth() {
|
|
|
9798
9822
|
saveGlobalConfig(config);
|
|
9799
9823
|
const state = randomBytes(16).toString("hex");
|
|
9800
9824
|
console.log(
|
|
9801
|
-
|
|
9825
|
+
chalk102.yellow("\nEnsure this Redirect URI is set in your Roam OAuth app:")
|
|
9802
9826
|
);
|
|
9803
|
-
console.log(
|
|
9804
|
-
console.log(
|
|
9805
|
-
console.log(
|
|
9827
|
+
console.log(chalk102.white("http://localhost:14523/callback\n"));
|
|
9828
|
+
console.log(chalk102.blue("Opening browser for authorization..."));
|
|
9829
|
+
console.log(chalk102.dim("Waiting for authorization callback..."));
|
|
9806
9830
|
const { code, redirectUri } = await authorizeInBrowser(clientId, state);
|
|
9807
|
-
console.log(
|
|
9831
|
+
console.log(chalk102.dim("Exchanging code for tokens..."));
|
|
9808
9832
|
const tokens = await exchangeToken({
|
|
9809
9833
|
code,
|
|
9810
9834
|
clientId,
|
|
@@ -9820,7 +9844,7 @@ async function auth() {
|
|
|
9820
9844
|
};
|
|
9821
9845
|
saveGlobalConfig(config);
|
|
9822
9846
|
console.log(
|
|
9823
|
-
|
|
9847
|
+
chalk102.green("Roam credentials and tokens saved to ~/.assist.yml")
|
|
9824
9848
|
);
|
|
9825
9849
|
}
|
|
9826
9850
|
|
|
@@ -10041,7 +10065,7 @@ import { execSync as execSync39 } from "child_process";
|
|
|
10041
10065
|
import { existsSync as existsSync38, mkdirSync as mkdirSync13, unlinkSync as unlinkSync10, writeFileSync as writeFileSync27 } from "fs";
|
|
10042
10066
|
import { tmpdir as tmpdir6 } from "os";
|
|
10043
10067
|
import { join as join38, resolve as resolve5 } from "path";
|
|
10044
|
-
import
|
|
10068
|
+
import chalk103 from "chalk";
|
|
10045
10069
|
|
|
10046
10070
|
// src/commands/screenshot/captureWindowPs1.ts
|
|
10047
10071
|
var captureWindowPs1 = `
|
|
@@ -10192,22 +10216,22 @@ function screenshot(processName) {
|
|
|
10192
10216
|
const config = loadConfig();
|
|
10193
10217
|
const outputDir = resolve5(config.screenshot.outputDir);
|
|
10194
10218
|
const outputPath = buildOutputPath(outputDir, processName);
|
|
10195
|
-
console.log(
|
|
10219
|
+
console.log(chalk103.gray(`Capturing window for process "${processName}" ...`));
|
|
10196
10220
|
try {
|
|
10197
10221
|
runPowerShellScript(processName, outputPath);
|
|
10198
|
-
console.log(
|
|
10222
|
+
console.log(chalk103.green(`Screenshot saved: ${outputPath}`));
|
|
10199
10223
|
} catch (error) {
|
|
10200
10224
|
const msg = error instanceof Error ? error.message : String(error);
|
|
10201
|
-
console.error(
|
|
10225
|
+
console.error(chalk103.red(`Failed to capture screenshot: ${msg}`));
|
|
10202
10226
|
process.exit(1);
|
|
10203
10227
|
}
|
|
10204
10228
|
}
|
|
10205
10229
|
|
|
10206
10230
|
// src/commands/statusLine.ts
|
|
10207
|
-
import
|
|
10231
|
+
import chalk105 from "chalk";
|
|
10208
10232
|
|
|
10209
10233
|
// src/commands/buildLimitsSegment.ts
|
|
10210
|
-
import
|
|
10234
|
+
import chalk104 from "chalk";
|
|
10211
10235
|
var FIVE_HOUR_SECONDS = 5 * 3600;
|
|
10212
10236
|
var SEVEN_DAY_SECONDS = 7 * 86400;
|
|
10213
10237
|
function formatTimeLeft(resetsAt) {
|
|
@@ -10230,10 +10254,10 @@ function projectUsage(pct, resetsAt, windowSeconds) {
|
|
|
10230
10254
|
function colorizeRateLimit(pct, resetsAt, windowSeconds) {
|
|
10231
10255
|
const label2 = `${Math.round(pct)}%`;
|
|
10232
10256
|
const projected = projectUsage(pct, resetsAt, windowSeconds);
|
|
10233
|
-
if (projected == null) return
|
|
10234
|
-
if (projected > 100) return
|
|
10235
|
-
if (projected > 75) return
|
|
10236
|
-
return
|
|
10257
|
+
if (projected == null) return chalk104.green(label2);
|
|
10258
|
+
if (projected > 100) return chalk104.red(label2);
|
|
10259
|
+
if (projected > 75) return chalk104.yellow(label2);
|
|
10260
|
+
return chalk104.green(label2);
|
|
10237
10261
|
}
|
|
10238
10262
|
function formatLimit(pct, resetsAt, windowSeconds, fallbackLabel) {
|
|
10239
10263
|
const timeLabel = resetsAt ? formatTimeLeft(resetsAt) : fallbackLabel;
|
|
@@ -10259,14 +10283,14 @@ function buildLimitsSegment(rateLimits) {
|
|
|
10259
10283
|
}
|
|
10260
10284
|
|
|
10261
10285
|
// src/commands/statusLine.ts
|
|
10262
|
-
|
|
10286
|
+
chalk105.level = 3;
|
|
10263
10287
|
function formatNumber(num) {
|
|
10264
10288
|
return num.toLocaleString("en-US");
|
|
10265
10289
|
}
|
|
10266
10290
|
function colorizePercent(pct) {
|
|
10267
10291
|
const label2 = `${Math.round(pct)}%`;
|
|
10268
|
-
if (pct > 80) return
|
|
10269
|
-
if (pct > 40) return
|
|
10292
|
+
if (pct > 80) return chalk105.red(label2);
|
|
10293
|
+
if (pct > 40) return chalk105.yellow(label2);
|
|
10270
10294
|
return label2;
|
|
10271
10295
|
}
|
|
10272
10296
|
async function statusLine() {
|
|
@@ -10289,7 +10313,7 @@ import { fileURLToPath as fileURLToPath7 } from "url";
|
|
|
10289
10313
|
// src/commands/sync/syncClaudeMd.ts
|
|
10290
10314
|
import * as fs23 from "fs";
|
|
10291
10315
|
import * as path46 from "path";
|
|
10292
|
-
import
|
|
10316
|
+
import chalk106 from "chalk";
|
|
10293
10317
|
async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
10294
10318
|
const source = path46.join(claudeDir, "CLAUDE.md");
|
|
10295
10319
|
const target = path46.join(targetBase, "CLAUDE.md");
|
|
@@ -10298,12 +10322,12 @@ async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
|
10298
10322
|
const targetContent = fs23.readFileSync(target, "utf-8");
|
|
10299
10323
|
if (sourceContent !== targetContent) {
|
|
10300
10324
|
console.log(
|
|
10301
|
-
|
|
10325
|
+
chalk106.yellow("\n\u26A0\uFE0F Warning: CLAUDE.md differs from existing file")
|
|
10302
10326
|
);
|
|
10303
10327
|
console.log();
|
|
10304
10328
|
printDiff(targetContent, sourceContent);
|
|
10305
10329
|
const confirm = options2?.yes || await promptConfirm(
|
|
10306
|
-
|
|
10330
|
+
chalk106.red("Overwrite existing CLAUDE.md?"),
|
|
10307
10331
|
false
|
|
10308
10332
|
);
|
|
10309
10333
|
if (!confirm) {
|
|
@@ -10319,7 +10343,7 @@ async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
|
10319
10343
|
// src/commands/sync/syncSettings.ts
|
|
10320
10344
|
import * as fs24 from "fs";
|
|
10321
10345
|
import * as path47 from "path";
|
|
10322
|
-
import
|
|
10346
|
+
import chalk107 from "chalk";
|
|
10323
10347
|
async function syncSettings(claudeDir, targetBase, options2) {
|
|
10324
10348
|
const source = path47.join(claudeDir, "settings.json");
|
|
10325
10349
|
const target = path47.join(targetBase, "settings.json");
|
|
@@ -10335,14 +10359,14 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
10335
10359
|
if (mergedContent !== normalizedTarget) {
|
|
10336
10360
|
if (!options2?.yes) {
|
|
10337
10361
|
console.log(
|
|
10338
|
-
|
|
10362
|
+
chalk107.yellow(
|
|
10339
10363
|
"\n\u26A0\uFE0F Warning: settings.json differs from existing file"
|
|
10340
10364
|
)
|
|
10341
10365
|
);
|
|
10342
10366
|
console.log();
|
|
10343
10367
|
printDiff(targetContent, mergedContent);
|
|
10344
10368
|
const confirm = await promptConfirm(
|
|
10345
|
-
|
|
10369
|
+
chalk107.red("Overwrite existing settings.json?"),
|
|
10346
10370
|
false
|
|
10347
10371
|
);
|
|
10348
10372
|
if (!confirm) {
|