@staff0rd/assist 0.1008.0 → 0.1009.0
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/claude/commands/bug.md +5 -3
- package/claude/commands/devlog.md +41 -54
- package/claude/commands/draft.md +5 -3
- package/claude/commands/refine.md +2 -2
- package/dist/commands/sessions/web/bundle.js +389 -389
- package/dist/index.js +823 -705
- 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.
|
|
9
|
+
version: "0.1009.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -6083,8 +6083,8 @@ var devlogConfigHelp = [
|
|
|
6083
6083
|
},
|
|
6084
6084
|
{
|
|
6085
6085
|
key: "devlog.skip",
|
|
6086
|
-
setter: "assist devlog skip 2026-
|
|
6087
|
-
note: "
|
|
6086
|
+
setter: "assist devlog skip 2026-W33",
|
|
6087
|
+
note: "ISO weeks (per repo) omitted from devlog output"
|
|
6088
6088
|
}
|
|
6089
6089
|
];
|
|
6090
6090
|
|
|
@@ -18873,6 +18873,7 @@ var activitySchema = z12.object({
|
|
|
18873
18873
|
name: z12.string().optional(),
|
|
18874
18874
|
itemId: z12.number().optional(),
|
|
18875
18875
|
itemName: z12.string().optional(),
|
|
18876
|
+
itemIds: z12.array(z12.number()).optional(),
|
|
18876
18877
|
phase: z12.number().optional(),
|
|
18877
18878
|
phaseName: z12.string().optional(),
|
|
18878
18879
|
totalPhases: z12.number().optional(),
|
|
@@ -19326,23 +19327,35 @@ import { randomUUID as randomUUID9 } from "crypto";
|
|
|
19326
19327
|
// src/commands/backlog/handleLaunchSignal.ts
|
|
19327
19328
|
import chalk85 from "chalk";
|
|
19328
19329
|
|
|
19329
|
-
// src/commands/backlog/
|
|
19330
|
-
|
|
19331
|
-
|
|
19332
|
-
|
|
19333
|
-
|
|
19334
|
-
|
|
19335
|
-
|
|
19336
|
-
|
|
19330
|
+
// src/commands/backlog/surfaceCreatedItems.ts
|
|
19331
|
+
function parseValidIds(ids) {
|
|
19332
|
+
const parsed = [];
|
|
19333
|
+
for (const id of ids) {
|
|
19334
|
+
try {
|
|
19335
|
+
parsed.push(parseItemId(id));
|
|
19336
|
+
} catch (error) {
|
|
19337
|
+
if (!(error instanceof InvalidItemIdError)) throw error;
|
|
19338
|
+
}
|
|
19337
19339
|
}
|
|
19340
|
+
return [...new Set(parsed)];
|
|
19341
|
+
}
|
|
19342
|
+
async function surfaceCreatedItems(slashCommand, ids) {
|
|
19343
|
+
const numericIds = parseValidIds(ids);
|
|
19344
|
+
if (numericIds.length === 0) return;
|
|
19338
19345
|
const { orm } = await getReady();
|
|
19339
|
-
const
|
|
19340
|
-
|
|
19346
|
+
const items2 = [];
|
|
19347
|
+
for (const id of numericIds) {
|
|
19348
|
+
const item = await loadItem(orm, id);
|
|
19349
|
+
if (item) items2.push(item);
|
|
19350
|
+
}
|
|
19351
|
+
const [first] = items2;
|
|
19352
|
+
if (!first) return;
|
|
19341
19353
|
emitActivity({
|
|
19342
19354
|
kind: "command",
|
|
19343
19355
|
name: slashCommand,
|
|
19344
|
-
itemId:
|
|
19345
|
-
itemName:
|
|
19356
|
+
itemId: first.id,
|
|
19357
|
+
itemName: first.name,
|
|
19358
|
+
...items2.length > 1 && { itemIds: items2.map((item) => item.id) }
|
|
19346
19359
|
});
|
|
19347
19360
|
}
|
|
19348
19361
|
|
|
@@ -19380,12 +19393,17 @@ Running backlog item ${label}...
|
|
|
19380
19393
|
}
|
|
19381
19394
|
|
|
19382
19395
|
// src/commands/backlog/handleLaunchSignal.ts
|
|
19396
|
+
function createdIds(signal) {
|
|
19397
|
+
const ids = Array.isArray(signal.ids) ? signal.ids : [signal.id];
|
|
19398
|
+
return ids.filter((id) => typeof id === "string" && !!id);
|
|
19399
|
+
}
|
|
19383
19400
|
async function handleLaunchSignal(slashCommand, once) {
|
|
19384
19401
|
const signal = readSignal();
|
|
19385
19402
|
cleanupSignal();
|
|
19386
19403
|
try {
|
|
19387
|
-
if (signal?.event === "done"
|
|
19388
|
-
|
|
19404
|
+
if (signal?.event === "done") {
|
|
19405
|
+
const ids = createdIds(signal);
|
|
19406
|
+
if (ids.length > 0) await surfaceCreatedItems(slashCommand, ids);
|
|
19389
19407
|
}
|
|
19390
19408
|
if (signal?.event === "next") {
|
|
19391
19409
|
if (typeof signal.id === "string" && signal.id) {
|
|
@@ -25431,6 +25449,68 @@ function list2(options2) {
|
|
|
25431
25449
|
}
|
|
25432
25450
|
}
|
|
25433
25451
|
|
|
25452
|
+
// src/commands/devlog/isoWeek.ts
|
|
25453
|
+
var DAY_MS = 864e5;
|
|
25454
|
+
var WEEK_ID_PATTERN = /^(\d{4})-W(\d{2})$/;
|
|
25455
|
+
function toUtc(date) {
|
|
25456
|
+
return /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
|
|
25457
|
+
}
|
|
25458
|
+
function formatDate(date) {
|
|
25459
|
+
return date.toISOString().slice(0, 10);
|
|
25460
|
+
}
|
|
25461
|
+
function isoWeek(date) {
|
|
25462
|
+
const d = toUtc(date);
|
|
25463
|
+
const dayOfWeek = d.getUTCDay() || 7;
|
|
25464
|
+
const thursday = new Date(d.getTime() + (4 - dayOfWeek) * DAY_MS);
|
|
25465
|
+
const year = thursday.getUTCFullYear();
|
|
25466
|
+
const yearStart = Date.UTC(year, 0, 1);
|
|
25467
|
+
const week = Math.ceil(((thursday.getTime() - yearStart) / DAY_MS + 1) / 7);
|
|
25468
|
+
return `${year}-W${String(week).padStart(2, "0")}`;
|
|
25469
|
+
}
|
|
25470
|
+
function isoWeekRange(weekId) {
|
|
25471
|
+
const match = weekId.match(WEEK_ID_PATTERN);
|
|
25472
|
+
if (!match) throw new Error(`Invalid week id: ${weekId}`);
|
|
25473
|
+
const year = Number(match[1]);
|
|
25474
|
+
const week = Number(match[2]);
|
|
25475
|
+
const jan4 = new Date(Date.UTC(year, 0, 4));
|
|
25476
|
+
const jan4Day = jan4.getUTCDay() || 7;
|
|
25477
|
+
const week1Monday = jan4.getTime() - (jan4Day - 1) * DAY_MS;
|
|
25478
|
+
const start2 = new Date(week1Monday + (week - 1) * 7 * DAY_MS);
|
|
25479
|
+
const end = new Date(start2.getTime() + 6 * DAY_MS);
|
|
25480
|
+
return { start: formatDate(start2), end: formatDate(end) };
|
|
25481
|
+
}
|
|
25482
|
+
function isValidWeek(weekId) {
|
|
25483
|
+
const match = weekId.match(WEEK_ID_PATTERN);
|
|
25484
|
+
if (!match || Number(match[2]) < 1) return false;
|
|
25485
|
+
return isoWeek(isoWeekRange(weekId).start) === weekId;
|
|
25486
|
+
}
|
|
25487
|
+
function isCompletedWeek(weekId, today) {
|
|
25488
|
+
return isoWeekRange(weekId).end < today;
|
|
25489
|
+
}
|
|
25490
|
+
|
|
25491
|
+
// src/commands/devlog/loadDevWeeks.ts
|
|
25492
|
+
import { readdirSync as readdirSync9 } from "fs";
|
|
25493
|
+
import { join as join68 } from "path";
|
|
25494
|
+
var DEV_DIR = join68(BLOG_REPO_ROOT, "src/content/dev");
|
|
25495
|
+
var DEV_FILENAME_PATTERN = /^(\d{4})-w(\d{2})\.md$/;
|
|
25496
|
+
function parseDevWeekFilename(filename) {
|
|
25497
|
+
const match = filename.match(DEV_FILENAME_PATTERN);
|
|
25498
|
+
return match ? `${match[1]}-W${match[2]}` : null;
|
|
25499
|
+
}
|
|
25500
|
+
function readFilenames(dir) {
|
|
25501
|
+
try {
|
|
25502
|
+
return readdirSync9(dir);
|
|
25503
|
+
} catch {
|
|
25504
|
+
return [];
|
|
25505
|
+
}
|
|
25506
|
+
}
|
|
25507
|
+
function loadDevWeeks(repoName, devDir = DEV_DIR) {
|
|
25508
|
+
return readFilenames(join68(devDir, repoName)).map(parseDevWeekFilename).filter((week) => week !== null).sort();
|
|
25509
|
+
}
|
|
25510
|
+
|
|
25511
|
+
// src/commands/devlog/next/displayNextEntry.ts
|
|
25512
|
+
import chalk160 from "chalk";
|
|
25513
|
+
|
|
25434
25514
|
// src/commands/devlog/getLastVersionInfo.ts
|
|
25435
25515
|
import { execFileSync as execFileSync8, execSync as execSync34 } from "child_process";
|
|
25436
25516
|
import semver2 from "semver";
|
|
@@ -25496,127 +25576,161 @@ function bumpVersion(version2, type) {
|
|
|
25496
25576
|
}
|
|
25497
25577
|
|
|
25498
25578
|
// src/commands/devlog/next/displayNextEntry.ts
|
|
25499
|
-
|
|
25500
|
-
|
|
25501
|
-
|
|
25502
|
-
|
|
25503
|
-
|
|
25504
|
-
|
|
25505
|
-
|
|
25506
|
-
|
|
25507
|
-
|
|
25508
|
-
|
|
25509
|
-
|
|
25510
|
-
|
|
25511
|
-
|
|
25512
|
-
|
|
25579
|
+
function withVersions(commits2) {
|
|
25580
|
+
return commits2.map((commit2) => {
|
|
25581
|
+
const version2 = getVersionAtCommit(commit2.hash);
|
|
25582
|
+
return { ...commit2, version: version2 ? stripToMinor(version2) : null };
|
|
25583
|
+
});
|
|
25584
|
+
}
|
|
25585
|
+
function versionRange(commits2) {
|
|
25586
|
+
const versions = commits2.map((c) => c.version).filter((v) => v !== null);
|
|
25587
|
+
if (versions.length === 0) return null;
|
|
25588
|
+
const first = versions[0];
|
|
25589
|
+
const last = versions[versions.length - 1];
|
|
25590
|
+
return first === last ? first : `${first} \u2013 ${last}`;
|
|
25591
|
+
}
|
|
25592
|
+
function printField(label, value) {
|
|
25593
|
+
console.log(`${chalk160.bold(`${label}:`)} ${value}`);
|
|
25594
|
+
}
|
|
25595
|
+
function printCommits(commits2, ignore3, verbose) {
|
|
25596
|
+
for (const commit2 of commits2) {
|
|
25597
|
+
const version2 = commit2.version ? ` ${chalk160.cyan(commit2.version)}` : "";
|
|
25513
25598
|
console.log(
|
|
25514
|
-
|
|
25599
|
+
` ${chalk160.dim(commit2.date)} ${chalk160.yellow(commit2.hash)}${version2} ${commit2.message}`
|
|
25515
25600
|
);
|
|
25516
|
-
|
|
25517
|
-
|
|
25601
|
+
if (!verbose) continue;
|
|
25602
|
+
for (const file of commit2.files) {
|
|
25603
|
+
if (!ignore3.some((p) => file.startsWith(p))) {
|
|
25604
|
+
console.log(` ${chalk160.dim(file)}`);
|
|
25605
|
+
}
|
|
25606
|
+
}
|
|
25518
25607
|
}
|
|
25519
25608
|
}
|
|
25609
|
+
function displayNextEntry(ctx, week, commits2) {
|
|
25610
|
+
const versioned = withVersions(commits2);
|
|
25611
|
+
const { start: start2, end } = isoWeekRange(week);
|
|
25612
|
+
printField("name", ctx.repoName);
|
|
25613
|
+
printField("week", chalk160.bold.blue(week));
|
|
25614
|
+
printField("range", `${start2} \u2013 ${end}`);
|
|
25615
|
+
const versions = versionRange(versioned);
|
|
25616
|
+
if (versions) printField("versions", versions);
|
|
25617
|
+
printCommits(versioned, ctx.ignore, ctx.verbose);
|
|
25618
|
+
}
|
|
25619
|
+
function logNoCommits(lastWeek) {
|
|
25620
|
+
console.log(
|
|
25621
|
+
chalk160.dim(
|
|
25622
|
+
lastWeek ? `No completed weeks with commits after ${lastWeek}` : "No completed weeks with commits found"
|
|
25623
|
+
)
|
|
25624
|
+
);
|
|
25625
|
+
}
|
|
25520
25626
|
|
|
25521
|
-
// src/commands/devlog/next/
|
|
25522
|
-
|
|
25523
|
-
|
|
25627
|
+
// src/commands/devlog/next/fetchCommitsAfter.ts
|
|
25628
|
+
import { execFileSync as execFileSync9 } from "child_process";
|
|
25629
|
+
var RECORD_SEPARATOR = "";
|
|
25630
|
+
function parseRecord(record) {
|
|
25631
|
+
const [header, ...fileLines] = record.trim().split("\n");
|
|
25632
|
+
if (!header) return null;
|
|
25633
|
+
const [date, hash, ...messageParts] = header.split("|");
|
|
25634
|
+
if (!date || !hash) return null;
|
|
25524
25635
|
return {
|
|
25525
|
-
|
|
25526
|
-
|
|
25636
|
+
date,
|
|
25637
|
+
hash,
|
|
25638
|
+
message: messageParts.join("|"),
|
|
25639
|
+
files: fileLines.filter(Boolean)
|
|
25527
25640
|
};
|
|
25528
25641
|
}
|
|
25529
|
-
function
|
|
25530
|
-
|
|
25642
|
+
function isIgnored(commit2, ignore3) {
|
|
25643
|
+
if (ignore3.length === 0 || commit2.files.length === 0) return false;
|
|
25644
|
+
return commit2.files.every((file) => ignore3.some((p) => file.startsWith(p)));
|
|
25645
|
+
}
|
|
25646
|
+
function parseNameOnlyLog(output, ignore3, afterDate) {
|
|
25647
|
+
const byDate = /* @__PURE__ */ new Map();
|
|
25648
|
+
for (const record of output.split(RECORD_SEPARATOR)) {
|
|
25649
|
+
const commit2 = parseRecord(record);
|
|
25650
|
+
if (!commit2 || afterDate && commit2.date <= afterDate) continue;
|
|
25651
|
+
if (isIgnored(commit2, ignore3)) continue;
|
|
25652
|
+
byDate.set(commit2.date, [...byDate.get(commit2.date) ?? [], commit2]);
|
|
25653
|
+
}
|
|
25654
|
+
return byDate;
|
|
25531
25655
|
}
|
|
25532
|
-
function
|
|
25656
|
+
function fetchCommitsAfter(ignore3, afterDate) {
|
|
25657
|
+
const range = afterDate ? [`--since=${afterDate}T00:00:00`] : ["-n", "500"];
|
|
25533
25658
|
const output = execFileSync9(
|
|
25534
25659
|
"git",
|
|
25535
|
-
[
|
|
25536
|
-
|
|
25537
|
-
|
|
25538
|
-
|
|
25539
|
-
|
|
25540
|
-
|
|
25541
|
-
|
|
25542
|
-
|
|
25543
|
-
!!config.commit?.conventional,
|
|
25544
|
-
firstHash,
|
|
25545
|
-
versions.patch,
|
|
25546
|
-
versions.minor
|
|
25660
|
+
[
|
|
25661
|
+
"log",
|
|
25662
|
+
"--name-only",
|
|
25663
|
+
`--pretty=format:${RECORD_SEPARATOR}%ad|%h|%s`,
|
|
25664
|
+
"--date=short",
|
|
25665
|
+
...range
|
|
25666
|
+
],
|
|
25667
|
+
{ encoding: "utf8", maxBuffer: 256 * 1024 * 1024 }
|
|
25547
25668
|
);
|
|
25669
|
+
return parseNameOnlyLog(output, ignore3, afterDate);
|
|
25548
25670
|
}
|
|
25549
|
-
|
|
25550
|
-
|
|
25551
|
-
|
|
25552
|
-
|
|
25553
|
-
|
|
25554
|
-
|
|
25555
|
-
|
|
25556
|
-
|
|
25557
|
-
|
|
25558
|
-
|
|
25559
|
-
|
|
25560
|
-
}
|
|
25561
|
-
|
|
25562
|
-
return hasLastInfo ? "No commits after last versioned entry" : "No commits found";
|
|
25563
|
-
}
|
|
25564
|
-
function logName(repoName) {
|
|
25565
|
-
console.log(`${chalk161.bold("name:")} ${repoName}`);
|
|
25566
|
-
}
|
|
25567
|
-
function displayNextEntry(ctx, targetDate, commits2) {
|
|
25568
|
-
logName(ctx.repoName);
|
|
25569
|
-
printVersionInfo(ctx.config, ctx.lastInfo, commits2[0]?.hash);
|
|
25570
|
-
console.log(chalk161.bold.blue(targetDate));
|
|
25571
|
-
printCommitsWithFiles(commits2, ctx.ignore, ctx.verbose);
|
|
25671
|
+
|
|
25672
|
+
// src/commands/devlog/next/findTargetWeek.ts
|
|
25673
|
+
function groupCommitsByWeek(commitsByDate) {
|
|
25674
|
+
const byWeek = /* @__PURE__ */ new Map();
|
|
25675
|
+
const dates = Array.from(commitsByDate.keys()).sort();
|
|
25676
|
+
for (const date of dates) {
|
|
25677
|
+
const week = isoWeek(date);
|
|
25678
|
+
const existing = byWeek.get(week) ?? [];
|
|
25679
|
+
const newestFirst2 = commitsByDate.get(date) ?? [];
|
|
25680
|
+
existing.push(...[...newestFirst2].reverse());
|
|
25681
|
+
byWeek.set(week, existing);
|
|
25682
|
+
}
|
|
25683
|
+
return byWeek;
|
|
25572
25684
|
}
|
|
25573
|
-
function
|
|
25574
|
-
|
|
25685
|
+
function findTargetWeek(weeks, { lastWeek, skip: skip3, today }) {
|
|
25686
|
+
return Array.from(weeks).filter((week) => !lastWeek || week > lastWeek).filter((week) => !skip3.has(week)).filter((week) => isCompletedWeek(week, today)).sort()[0];
|
|
25575
25687
|
}
|
|
25576
25688
|
|
|
25577
25689
|
// src/commands/devlog/next.ts
|
|
25578
|
-
function
|
|
25579
|
-
const
|
|
25580
|
-
const
|
|
25581
|
-
return {
|
|
25690
|
+
function localToday() {
|
|
25691
|
+
const now = /* @__PURE__ */ new Date();
|
|
25692
|
+
const pad3 = (n) => String(n).padStart(2, "0");
|
|
25693
|
+
return `${now.getFullYear()}-${pad3(now.getMonth() + 1)}-${pad3(now.getDate())}`;
|
|
25582
25694
|
}
|
|
25583
|
-
function
|
|
25584
|
-
|
|
25585
|
-
const data = resolveContextData(config, options2);
|
|
25586
|
-
return { config, ...data, verbose: options2.verbose ?? false };
|
|
25695
|
+
function lastDailyDevlogDate(repoName) {
|
|
25696
|
+
return Array.from(loadDevlogEntries(repoName).keys()).sort().at(-1) ?? null;
|
|
25587
25697
|
}
|
|
25588
|
-
function
|
|
25589
|
-
|
|
25590
|
-
|
|
25591
|
-
getLastDate(ctx.lastInfo)
|
|
25592
|
-
);
|
|
25593
|
-
const targetDate = findTargetDate(
|
|
25594
|
-
commitsByDate,
|
|
25595
|
-
resolveSkipDays(ctx.repoName)
|
|
25596
|
-
);
|
|
25597
|
-
return targetDate ? { targetDate, commits: getCommitsForDate(commitsByDate, targetDate) } : null;
|
|
25698
|
+
function resolveAfterDate(repoName, lastWeek) {
|
|
25699
|
+
if (lastWeek) return isoWeekRange(lastWeek).end;
|
|
25700
|
+
return lastDailyDevlogDate(repoName);
|
|
25598
25701
|
}
|
|
25599
|
-
function
|
|
25600
|
-
|
|
25601
|
-
|
|
25702
|
+
function next2(options2) {
|
|
25703
|
+
const config = loadConfig();
|
|
25704
|
+
const repoName = getRepoName();
|
|
25705
|
+
const ignore3 = options2.ignore ?? config.devlog?.ignore ?? [];
|
|
25706
|
+
const lastWeek = loadDevWeeks(repoName).at(-1) ?? null;
|
|
25707
|
+
const afterDate = resolveAfterDate(repoName, lastWeek);
|
|
25708
|
+
const byWeek = groupCommitsByWeek(fetchCommitsAfter(ignore3, afterDate));
|
|
25709
|
+
const week = findTargetWeek(byWeek.keys(), {
|
|
25710
|
+
lastWeek,
|
|
25711
|
+
skip: loadBlogSkipDays(repoName),
|
|
25712
|
+
today: localToday()
|
|
25713
|
+
});
|
|
25714
|
+
if (!week) {
|
|
25715
|
+
logNoCommits(lastWeek);
|
|
25602
25716
|
return;
|
|
25603
25717
|
}
|
|
25604
|
-
displayNextEntry(
|
|
25605
|
-
}
|
|
25606
|
-
|
|
25607
|
-
|
|
25608
|
-
|
|
25718
|
+
displayNextEntry(
|
|
25719
|
+
{ repoName, ignore: ignore3, verbose: options2.verbose ?? false },
|
|
25720
|
+
week,
|
|
25721
|
+
byWeek.get(week) ?? []
|
|
25722
|
+
);
|
|
25609
25723
|
}
|
|
25610
25724
|
|
|
25611
25725
|
// src/commands/devlog/repos.ts
|
|
25612
25726
|
import { execSync as execSync35 } from "child_process";
|
|
25613
25727
|
|
|
25614
25728
|
// src/commands/devlog/repos/printReposTable.ts
|
|
25615
|
-
import
|
|
25729
|
+
import chalk161 from "chalk";
|
|
25616
25730
|
function colorStatus(status2) {
|
|
25617
|
-
if (status2 === "missing") return
|
|
25618
|
-
if (status2 === "outdated") return
|
|
25619
|
-
return
|
|
25731
|
+
if (status2 === "missing") return chalk161.red(status2);
|
|
25732
|
+
if (status2 === "outdated") return chalk161.yellow(status2);
|
|
25733
|
+
return chalk161.green(status2);
|
|
25620
25734
|
}
|
|
25621
25735
|
function formatRow(row3, nameWidth) {
|
|
25622
25736
|
const devlog = (row3.lastDevlog ?? "-").padEnd(11);
|
|
@@ -25630,8 +25744,8 @@ function printReposTable(rows) {
|
|
|
25630
25744
|
"Last Devlog".padEnd(11),
|
|
25631
25745
|
"Status"
|
|
25632
25746
|
].join(" ");
|
|
25633
|
-
console.log(
|
|
25634
|
-
console.log(
|
|
25747
|
+
console.log(chalk161.dim(header));
|
|
25748
|
+
console.log(chalk161.dim("-".repeat(header.length)));
|
|
25635
25749
|
for (const row3 of rows) {
|
|
25636
25750
|
console.log(formatRow(row3, nameWidth));
|
|
25637
25751
|
}
|
|
@@ -25688,15 +25802,15 @@ function repos(options2) {
|
|
|
25688
25802
|
|
|
25689
25803
|
// src/commands/devlog/skip.ts
|
|
25690
25804
|
import { writeFileSync as writeFileSync32 } from "fs";
|
|
25691
|
-
import { join as
|
|
25692
|
-
import
|
|
25805
|
+
import { join as join69 } from "path";
|
|
25806
|
+
import chalk162 from "chalk";
|
|
25693
25807
|
import { stringify as stringifyYaml3 } from "yaml";
|
|
25694
25808
|
function getBlogConfigPath() {
|
|
25695
|
-
return
|
|
25809
|
+
return join69(BLOG_REPO_ROOT, "assist.yml");
|
|
25696
25810
|
}
|
|
25697
|
-
function skip2(
|
|
25698
|
-
if (
|
|
25699
|
-
console.log(
|
|
25811
|
+
function skip2(week) {
|
|
25812
|
+
if (!isValidWeek(week)) {
|
|
25813
|
+
console.log(chalk162.red("Invalid week. Use YYYY-Www (e.g. 2026-W33)"));
|
|
25700
25814
|
process.exit(1);
|
|
25701
25815
|
}
|
|
25702
25816
|
const repoName = getRepoName();
|
|
@@ -25704,33 +25818,33 @@ function skip2(date) {
|
|
|
25704
25818
|
const config = loadRawYaml(configPath);
|
|
25705
25819
|
const devlog = config.devlog ?? {};
|
|
25706
25820
|
const skip3 = devlog.skip ?? {};
|
|
25707
|
-
const
|
|
25708
|
-
if (
|
|
25821
|
+
const skipWeeks = skip3[repoName] ?? [];
|
|
25822
|
+
if (skipWeeks.includes(week)) {
|
|
25709
25823
|
console.log(
|
|
25710
|
-
|
|
25824
|
+
chalk162.yellow(`${week} is already in skip list for ${repoName}`)
|
|
25711
25825
|
);
|
|
25712
25826
|
return;
|
|
25713
25827
|
}
|
|
25714
|
-
|
|
25715
|
-
|
|
25716
|
-
skip3[repoName] =
|
|
25828
|
+
skipWeeks.push(week);
|
|
25829
|
+
skipWeeks.sort();
|
|
25830
|
+
skip3[repoName] = skipWeeks;
|
|
25717
25831
|
devlog.skip = skip3;
|
|
25718
25832
|
config.devlog = devlog;
|
|
25719
25833
|
writeFileSync32(configPath, stringifyYaml3(config, { lineWidth: 0 }));
|
|
25720
|
-
console.log(
|
|
25834
|
+
console.log(chalk162.green(`Added ${week} to skip list for ${repoName}`));
|
|
25721
25835
|
}
|
|
25722
25836
|
|
|
25723
25837
|
// src/commands/devlog/version.ts
|
|
25724
|
-
import
|
|
25838
|
+
import chalk163 from "chalk";
|
|
25725
25839
|
function version() {
|
|
25726
25840
|
const config = loadConfig();
|
|
25727
25841
|
const name = getRepoName();
|
|
25728
25842
|
const lastInfo = getLastVersionInfo(name, config);
|
|
25729
25843
|
const lastVersion = lastInfo?.version ?? null;
|
|
25730
25844
|
const nextVersion = lastVersion ? bumpVersion(lastVersion, "patch") : null;
|
|
25731
|
-
console.log(`${
|
|
25732
|
-
console.log(`${
|
|
25733
|
-
console.log(`${
|
|
25845
|
+
console.log(`${chalk163.bold("name:")} ${name}`);
|
|
25846
|
+
console.log(`${chalk163.bold("last:")} ${lastVersion ?? chalk163.dim("none")}`);
|
|
25847
|
+
console.log(`${chalk163.bold("next:")} ${nextVersion ?? chalk163.dim("none")}`);
|
|
25734
25848
|
}
|
|
25735
25849
|
|
|
25736
25850
|
// src/commands/registerDevlog.ts
|
|
@@ -25742,8 +25856,10 @@ function registerDevlog(program) {
|
|
|
25742
25856
|
Number.parseInt
|
|
25743
25857
|
).option("--since <date>", "Only show commits since this date (YYYY-MM-DD)").option("-r, --reverse", "Show earliest commits first").option("-v, --verbose", "Show file names for each commit").action(list2);
|
|
25744
25858
|
devlogCommand.command("version").description("Show current repo name and version info").action(version);
|
|
25745
|
-
devlogCommand.command("next").description(
|
|
25746
|
-
|
|
25859
|
+
devlogCommand.command("next").description(
|
|
25860
|
+
"Show commits for the next completed ISO week after the last dev entry"
|
|
25861
|
+
).option("-v, --verbose", "Show file names for each commit").action(next2);
|
|
25862
|
+
devlogCommand.command("skip <week>").description("Add an ISO week (YYYY-Www) to the skip list").action(skip2);
|
|
25747
25863
|
devlogCommand.command("repos").description("Show repos missing devlog entries").option(
|
|
25748
25864
|
"--days <number>",
|
|
25749
25865
|
"Only show repos pushed within N days (default: 30)",
|
|
@@ -25753,7 +25869,7 @@ function registerDevlog(program) {
|
|
|
25753
25869
|
}
|
|
25754
25870
|
|
|
25755
25871
|
// src/commands/docs/docsConfirm.ts
|
|
25756
|
-
import
|
|
25872
|
+
import chalk164 from "chalk";
|
|
25757
25873
|
|
|
25758
25874
|
// src/commands/notify/forwardPinConfirm.ts
|
|
25759
25875
|
import { randomUUID as randomUUID11 } from "crypto";
|
|
@@ -25773,9 +25889,9 @@ async function forwardPinConfirm(area, pin2) {
|
|
|
25773
25889
|
import { unlinkSync as unlinkSync10 } from "fs";
|
|
25774
25890
|
|
|
25775
25891
|
// src/commands/docs/getDocsUnlockPinPath.ts
|
|
25776
|
-
import { join as
|
|
25892
|
+
import { join as join70 } from "path";
|
|
25777
25893
|
function getDocsUnlockPinPath(pin2) {
|
|
25778
|
-
return
|
|
25894
|
+
return join70(getRestrictedDir(), `docs-unlock-pin-${pin2}.json`);
|
|
25779
25895
|
}
|
|
25780
25896
|
|
|
25781
25897
|
// src/commands/docs/readDocsUnlockPinState.ts
|
|
@@ -25840,22 +25956,22 @@ async function approveDocsUnlock(pin2) {
|
|
|
25840
25956
|
async function docsConfirm(pin2) {
|
|
25841
25957
|
const result = await approveDocsUnlock(pin2) ?? await forwardPinConfirm("docs", pin2);
|
|
25842
25958
|
if (!result) {
|
|
25843
|
-
console.error(
|
|
25959
|
+
console.error(chalk164.red(`No pending docs unlock for pin: ${pin2}`));
|
|
25844
25960
|
process.exitCode = 1;
|
|
25845
25961
|
return;
|
|
25846
25962
|
}
|
|
25847
25963
|
if (result.ok) {
|
|
25848
|
-
console.log(
|
|
25964
|
+
console.log(chalk164.green(result.message));
|
|
25849
25965
|
return;
|
|
25850
25966
|
}
|
|
25851
|
-
console.error(
|
|
25967
|
+
console.error(chalk164.red(result.message));
|
|
25852
25968
|
process.exitCode = 1;
|
|
25853
25969
|
}
|
|
25854
25970
|
|
|
25855
25971
|
// src/commands/docs/docsUnlock.ts
|
|
25856
25972
|
import { randomInt as randomInt3 } from "crypto";
|
|
25857
25973
|
import { mkdirSync as mkdirSync20, unlinkSync as unlinkSync11, writeFileSync as writeFileSync33 } from "fs";
|
|
25858
|
-
import
|
|
25974
|
+
import chalk165 from "chalk";
|
|
25859
25975
|
|
|
25860
25976
|
// src/commands/notify/deliverPinNotification.ts
|
|
25861
25977
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
@@ -25881,7 +25997,7 @@ async function deliverPinNotification(notification) {
|
|
|
25881
25997
|
|
|
25882
25998
|
// src/commands/docs/docsUnlock.ts
|
|
25883
25999
|
function fail7(message3) {
|
|
25884
|
-
console.error(
|
|
26000
|
+
console.error(chalk165.red(message3));
|
|
25885
26001
|
process.exitCode = 1;
|
|
25886
26002
|
}
|
|
25887
26003
|
async function docsUnlock() {
|
|
@@ -25920,7 +26036,7 @@ async function docsUnlock() {
|
|
|
25920
26036
|
console.log(
|
|
25921
26037
|
`A confirmation pin was sent to the user's desktop notifications${node ? ` on ${node}, the node controlling this session` : ""}.
|
|
25922
26038
|
To let this phase of ${label} edit docs pages and screenshots, the user runs${node ? ` on ${node}` : ""}:
|
|
25923
|
-
${
|
|
26039
|
+
${chalk165.cyan(" assist docs confirm <PIN>")}
|
|
25924
26040
|
Wait for the user to confirm before editing docs.`
|
|
25925
26041
|
);
|
|
25926
26042
|
}
|
|
@@ -25946,20 +26062,20 @@ function registerDocs(parent) {
|
|
|
25946
26062
|
}
|
|
25947
26063
|
|
|
25948
26064
|
// src/commands/dotnet/checkBuildLocks.ts
|
|
25949
|
-
import { closeSync as closeSync4, openSync as openSync5, readdirSync as
|
|
25950
|
-
import { join as
|
|
25951
|
-
import
|
|
26065
|
+
import { closeSync as closeSync4, openSync as openSync5, readdirSync as readdirSync10 } from "fs";
|
|
26066
|
+
import { join as join71 } from "path";
|
|
26067
|
+
import chalk166 from "chalk";
|
|
25952
26068
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "packages"]);
|
|
25953
26069
|
function isLockedDll(debugDir) {
|
|
25954
26070
|
let files;
|
|
25955
26071
|
try {
|
|
25956
|
-
files =
|
|
26072
|
+
files = readdirSync10(debugDir, { recursive: true });
|
|
25957
26073
|
} catch {
|
|
25958
26074
|
return null;
|
|
25959
26075
|
}
|
|
25960
26076
|
for (const file of files) {
|
|
25961
26077
|
if (!file.toLowerCase().endsWith(".dll")) continue;
|
|
25962
|
-
const dllPath =
|
|
26078
|
+
const dllPath = join71(debugDir, file);
|
|
25963
26079
|
try {
|
|
25964
26080
|
const fd = openSync5(dllPath, "r+");
|
|
25965
26081
|
closeSync4(fd);
|
|
@@ -25972,18 +26088,18 @@ function isLockedDll(debugDir) {
|
|
|
25972
26088
|
function findFirstLockedDll(dir) {
|
|
25973
26089
|
let entries;
|
|
25974
26090
|
try {
|
|
25975
|
-
entries =
|
|
26091
|
+
entries = readdirSync10(dir);
|
|
25976
26092
|
} catch {
|
|
25977
26093
|
return null;
|
|
25978
26094
|
}
|
|
25979
26095
|
if (entries.includes("bin")) {
|
|
25980
|
-
const locked = isLockedDll(
|
|
26096
|
+
const locked = isLockedDll(join71(dir, "bin", "Debug"));
|
|
25981
26097
|
if (locked) return locked;
|
|
25982
26098
|
}
|
|
25983
26099
|
for (const entry of entries) {
|
|
25984
26100
|
if (SKIP_DIRS.has(entry) || entry === "bin" || entry.startsWith("."))
|
|
25985
26101
|
continue;
|
|
25986
|
-
const found = findFirstLockedDll(
|
|
26102
|
+
const found = findFirstLockedDll(join71(dir, entry));
|
|
25987
26103
|
if (found) return found;
|
|
25988
26104
|
}
|
|
25989
26105
|
return null;
|
|
@@ -25995,14 +26111,14 @@ function checkBuildLocks(startDir) {
|
|
|
25995
26111
|
const locked = findFirstLockedDll(startDir ?? getSearchRoot());
|
|
25996
26112
|
if (locked) {
|
|
25997
26113
|
console.error(
|
|
25998
|
-
|
|
26114
|
+
chalk166.red("Build output locked (is VS debugging?): ") + locked
|
|
25999
26115
|
);
|
|
26000
26116
|
process.exit(1);
|
|
26001
26117
|
}
|
|
26002
26118
|
}
|
|
26003
26119
|
async function checkBuildLocksCommand() {
|
|
26004
26120
|
checkBuildLocks();
|
|
26005
|
-
console.log(
|
|
26121
|
+
console.log(chalk166.green("No build locks detected"));
|
|
26006
26122
|
}
|
|
26007
26123
|
|
|
26008
26124
|
// src/commands/dotnet/buildTree.ts
|
|
@@ -26052,14 +26168,14 @@ function collectAllDeps(node) {
|
|
|
26052
26168
|
}
|
|
26053
26169
|
|
|
26054
26170
|
// src/commands/dotnet/findContainingSolutions.ts
|
|
26055
|
-
import { readdirSync as
|
|
26171
|
+
import { readdirSync as readdirSync11, readFileSync as readFileSync41, statSync as statSync8 } from "fs";
|
|
26056
26172
|
import path36 from "path";
|
|
26057
26173
|
function findSlnFiles(dir, maxDepth, depth = 0) {
|
|
26058
26174
|
if (depth > maxDepth) return [];
|
|
26059
26175
|
const results = [];
|
|
26060
26176
|
let entries;
|
|
26061
26177
|
try {
|
|
26062
|
-
entries =
|
|
26178
|
+
entries = readdirSync11(dir);
|
|
26063
26179
|
} catch {
|
|
26064
26180
|
return results;
|
|
26065
26181
|
}
|
|
@@ -26101,30 +26217,30 @@ function escapeRegex(s) {
|
|
|
26101
26217
|
}
|
|
26102
26218
|
|
|
26103
26219
|
// src/commands/dotnet/printTree.ts
|
|
26104
|
-
import
|
|
26220
|
+
import chalk167 from "chalk";
|
|
26105
26221
|
function printNodes(nodes, prefix2) {
|
|
26106
26222
|
for (let i = 0; i < nodes.length; i++) {
|
|
26107
26223
|
const isLast = i === nodes.length - 1;
|
|
26108
26224
|
const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
26109
26225
|
const childPrefix = isLast ? " " : "\u2502 ";
|
|
26110
26226
|
const isMissing = nodes[i].relativePath.startsWith("[MISSING]");
|
|
26111
|
-
const label = isMissing ?
|
|
26227
|
+
const label = isMissing ? chalk167.red(nodes[i].relativePath) : nodes[i].relativePath;
|
|
26112
26228
|
console.log(`${prefix2}${connector}${label}`);
|
|
26113
26229
|
printNodes(nodes[i].children, prefix2 + childPrefix);
|
|
26114
26230
|
}
|
|
26115
26231
|
}
|
|
26116
26232
|
function printTree(tree, totalCount, solutions) {
|
|
26117
|
-
console.log(
|
|
26118
|
-
console.log(
|
|
26233
|
+
console.log(chalk167.bold("\nProject Dependency Tree"));
|
|
26234
|
+
console.log(chalk167.cyan(tree.relativePath));
|
|
26119
26235
|
printNodes(tree.children, "");
|
|
26120
|
-
console.log(
|
|
26236
|
+
console.log(chalk167.dim(`
|
|
26121
26237
|
${totalCount} projects total (including root)`));
|
|
26122
|
-
console.log(
|
|
26238
|
+
console.log(chalk167.bold("\nSolution Membership"));
|
|
26123
26239
|
if (solutions.length === 0) {
|
|
26124
|
-
console.log(
|
|
26240
|
+
console.log(chalk167.yellow(" Not found in any .sln"));
|
|
26125
26241
|
} else {
|
|
26126
26242
|
for (const sln of solutions) {
|
|
26127
|
-
console.log(` ${
|
|
26243
|
+
console.log(` ${chalk167.green(sln)}`);
|
|
26128
26244
|
}
|
|
26129
26245
|
}
|
|
26130
26246
|
console.log();
|
|
@@ -26153,16 +26269,16 @@ function printJson(tree, totalCount, solutions) {
|
|
|
26153
26269
|
// src/commands/dotnet/resolveCsproj.ts
|
|
26154
26270
|
import { existsSync as existsSync56 } from "fs";
|
|
26155
26271
|
import path37 from "path";
|
|
26156
|
-
import
|
|
26272
|
+
import chalk168 from "chalk";
|
|
26157
26273
|
function resolveCsproj(csprojPath) {
|
|
26158
26274
|
const resolved = path37.resolve(csprojPath);
|
|
26159
26275
|
if (!existsSync56(resolved)) {
|
|
26160
|
-
console.error(
|
|
26276
|
+
console.error(chalk168.red(`File not found: ${resolved}`));
|
|
26161
26277
|
process.exit(1);
|
|
26162
26278
|
}
|
|
26163
26279
|
const repoRoot2 = findRepoRoot(path37.dirname(resolved));
|
|
26164
26280
|
if (!repoRoot2) {
|
|
26165
|
-
console.error(
|
|
26281
|
+
console.error(chalk168.red("Could not find git repository root"));
|
|
26166
26282
|
process.exit(1);
|
|
26167
26283
|
}
|
|
26168
26284
|
return { resolved, repoRoot: repoRoot2 };
|
|
@@ -26212,12 +26328,12 @@ function getChangedCsFiles(scope) {
|
|
|
26212
26328
|
}
|
|
26213
26329
|
|
|
26214
26330
|
// src/commands/dotnet/inSln.ts
|
|
26215
|
-
import
|
|
26331
|
+
import chalk169 from "chalk";
|
|
26216
26332
|
async function inSln(csprojPath) {
|
|
26217
26333
|
const { resolved, repoRoot: repoRoot2 } = resolveCsproj(csprojPath);
|
|
26218
26334
|
const solutions = findContainingSolutions(resolved, repoRoot2);
|
|
26219
26335
|
if (solutions.length === 0) {
|
|
26220
|
-
console.log(
|
|
26336
|
+
console.log(chalk169.yellow("Not found in any .sln file"));
|
|
26221
26337
|
process.exit(1);
|
|
26222
26338
|
}
|
|
26223
26339
|
for (const sln of solutions) {
|
|
@@ -26226,7 +26342,7 @@ async function inSln(csprojPath) {
|
|
|
26226
26342
|
}
|
|
26227
26343
|
|
|
26228
26344
|
// src/commands/dotnet/inspect.ts
|
|
26229
|
-
import
|
|
26345
|
+
import chalk175 from "chalk";
|
|
26230
26346
|
|
|
26231
26347
|
// src/shared/formatElapsed.ts
|
|
26232
26348
|
function formatElapsed(ms) {
|
|
@@ -26238,12 +26354,12 @@ function formatElapsed(ms) {
|
|
|
26238
26354
|
}
|
|
26239
26355
|
|
|
26240
26356
|
// src/commands/dotnet/displayIssues.ts
|
|
26241
|
-
import
|
|
26357
|
+
import chalk170 from "chalk";
|
|
26242
26358
|
var SEVERITY_COLOR = {
|
|
26243
|
-
ERROR:
|
|
26244
|
-
WARNING:
|
|
26245
|
-
SUGGESTION:
|
|
26246
|
-
HINT:
|
|
26359
|
+
ERROR: chalk170.red,
|
|
26360
|
+
WARNING: chalk170.yellow,
|
|
26361
|
+
SUGGESTION: chalk170.cyan,
|
|
26362
|
+
HINT: chalk170.dim
|
|
26247
26363
|
};
|
|
26248
26364
|
function groupByFile(issues) {
|
|
26249
26365
|
const byFile = /* @__PURE__ */ new Map();
|
|
@@ -26259,15 +26375,15 @@ function groupByFile(issues) {
|
|
|
26259
26375
|
}
|
|
26260
26376
|
function displayIssues(issues) {
|
|
26261
26377
|
for (const [file, fileIssues] of groupByFile(issues)) {
|
|
26262
|
-
console.log(
|
|
26378
|
+
console.log(chalk170.bold(file));
|
|
26263
26379
|
for (const issue of fileIssues.sort((a, b) => a.line - b.line)) {
|
|
26264
|
-
const color = SEVERITY_COLOR[issue.severity] ??
|
|
26380
|
+
const color = SEVERITY_COLOR[issue.severity] ?? chalk170.white;
|
|
26265
26381
|
console.log(
|
|
26266
|
-
` ${
|
|
26382
|
+
` ${chalk170.dim(`${issue.line}:`)} ${color(issue.severity)} [${issue.typeId}] ${issue.message}`
|
|
26267
26383
|
);
|
|
26268
26384
|
}
|
|
26269
26385
|
}
|
|
26270
|
-
console.log(
|
|
26386
|
+
console.log(chalk170.dim(`
|
|
26271
26387
|
${issues.length} issue(s) found`));
|
|
26272
26388
|
}
|
|
26273
26389
|
|
|
@@ -26326,15 +26442,15 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
|
|
|
26326
26442
|
// src/commands/dotnet/resolveSolution.ts
|
|
26327
26443
|
import { existsSync as existsSync57 } from "fs";
|
|
26328
26444
|
import path38 from "path";
|
|
26329
|
-
import
|
|
26445
|
+
import chalk172 from "chalk";
|
|
26330
26446
|
|
|
26331
26447
|
// src/commands/dotnet/findSolution.ts
|
|
26332
|
-
import { readdirSync as
|
|
26333
|
-
import { dirname as dirname31, join as
|
|
26334
|
-
import
|
|
26448
|
+
import { readdirSync as readdirSync12 } from "fs";
|
|
26449
|
+
import { dirname as dirname31, join as join72 } from "path";
|
|
26450
|
+
import chalk171 from "chalk";
|
|
26335
26451
|
function findSlnInDir(dir) {
|
|
26336
26452
|
try {
|
|
26337
|
-
return
|
|
26453
|
+
return readdirSync12(dir).filter((f) => f.endsWith(".sln")).map((f) => join72(dir, f));
|
|
26338
26454
|
} catch {
|
|
26339
26455
|
return [];
|
|
26340
26456
|
}
|
|
@@ -26347,17 +26463,17 @@ function findSolution() {
|
|
|
26347
26463
|
const slnFiles = findSlnInDir(current);
|
|
26348
26464
|
if (slnFiles.length === 1) return slnFiles[0];
|
|
26349
26465
|
if (slnFiles.length > 1) {
|
|
26350
|
-
console.error(
|
|
26466
|
+
console.error(chalk171.red(`Multiple .sln files found in ${current}:`));
|
|
26351
26467
|
for (const f of slnFiles) console.error(` ${f}`);
|
|
26352
26468
|
console.error(
|
|
26353
|
-
|
|
26469
|
+
chalk171.yellow("Specify which one: assist dotnet inspect <sln>")
|
|
26354
26470
|
);
|
|
26355
26471
|
process.exit(1);
|
|
26356
26472
|
}
|
|
26357
26473
|
if (current === ceiling) break;
|
|
26358
26474
|
current = dirname31(current);
|
|
26359
26475
|
}
|
|
26360
|
-
console.error(
|
|
26476
|
+
console.error(chalk171.red("No .sln file found between cwd and repo root"));
|
|
26361
26477
|
process.exit(1);
|
|
26362
26478
|
}
|
|
26363
26479
|
|
|
@@ -26366,7 +26482,7 @@ function resolveSolution(sln) {
|
|
|
26366
26482
|
if (sln) {
|
|
26367
26483
|
const resolved = path38.resolve(sln);
|
|
26368
26484
|
if (!existsSync57(resolved)) {
|
|
26369
|
-
console.error(
|
|
26485
|
+
console.error(chalk172.red(`Solution file not found: ${resolved}`));
|
|
26370
26486
|
process.exit(1);
|
|
26371
26487
|
}
|
|
26372
26488
|
return resolved;
|
|
@@ -26408,14 +26524,14 @@ import { execSync as execSync37 } from "child_process";
|
|
|
26408
26524
|
import { existsSync as existsSync58, readFileSync as readFileSync42, unlinkSync as unlinkSync12 } from "fs";
|
|
26409
26525
|
import { tmpdir as tmpdir4 } from "os";
|
|
26410
26526
|
import path39 from "path";
|
|
26411
|
-
import
|
|
26527
|
+
import chalk173 from "chalk";
|
|
26412
26528
|
function assertJbInstalled() {
|
|
26413
26529
|
try {
|
|
26414
26530
|
execSync37("jb inspectcode --version", { stdio: "pipe" });
|
|
26415
26531
|
} catch {
|
|
26416
|
-
console.error(
|
|
26532
|
+
console.error(chalk173.red("jb is not installed. Install with:"));
|
|
26417
26533
|
console.error(
|
|
26418
|
-
|
|
26534
|
+
chalk173.yellow(" dotnet tool install -g JetBrains.ReSharper.GlobalTools")
|
|
26419
26535
|
);
|
|
26420
26536
|
process.exit(1);
|
|
26421
26537
|
}
|
|
@@ -26433,11 +26549,11 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
26433
26549
|
if (error && typeof error === "object" && "stderr" in error) {
|
|
26434
26550
|
process.stderr.write(error.stderr);
|
|
26435
26551
|
}
|
|
26436
|
-
console.error(
|
|
26552
|
+
console.error(chalk173.red("jb inspectcode failed"));
|
|
26437
26553
|
process.exit(1);
|
|
26438
26554
|
}
|
|
26439
26555
|
if (!existsSync58(reportPath)) {
|
|
26440
|
-
console.error(
|
|
26556
|
+
console.error(chalk173.red("Report file not generated"));
|
|
26441
26557
|
process.exit(1);
|
|
26442
26558
|
}
|
|
26443
26559
|
const xml = readFileSync42(reportPath, "utf8");
|
|
@@ -26447,7 +26563,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
26447
26563
|
|
|
26448
26564
|
// src/commands/dotnet/runRoslynInspect.ts
|
|
26449
26565
|
import { execSync as execSync38 } from "child_process";
|
|
26450
|
-
import
|
|
26566
|
+
import chalk174 from "chalk";
|
|
26451
26567
|
function resolveMsbuildPath() {
|
|
26452
26568
|
const { run: run4 } = loadConfig();
|
|
26453
26569
|
const configs = resolveRunConfigs(run4, runConfigBaseDir());
|
|
@@ -26459,9 +26575,9 @@ function assertMsbuildInstalled() {
|
|
|
26459
26575
|
try {
|
|
26460
26576
|
execSync38(`"${msbuild}" -version`, { stdio: "pipe" });
|
|
26461
26577
|
} catch {
|
|
26462
|
-
console.error(
|
|
26578
|
+
console.error(chalk174.red(`msbuild not found at: ${msbuild}`));
|
|
26463
26579
|
console.error(
|
|
26464
|
-
|
|
26580
|
+
chalk174.yellow(
|
|
26465
26581
|
"Configure it via a 'build' run entry in .claude/assist.yml or add msbuild to PATH."
|
|
26466
26582
|
)
|
|
26467
26583
|
);
|
|
@@ -26508,17 +26624,17 @@ function runEngine(resolved, changedFiles2, options2) {
|
|
|
26508
26624
|
// src/commands/dotnet/inspect.ts
|
|
26509
26625
|
function logScope(changedFiles2) {
|
|
26510
26626
|
if (changedFiles2 === null) {
|
|
26511
|
-
console.log(
|
|
26627
|
+
console.log(chalk175.dim("Inspecting full solution..."));
|
|
26512
26628
|
} else {
|
|
26513
26629
|
console.log(
|
|
26514
|
-
|
|
26630
|
+
chalk175.dim(`Inspecting ${changedFiles2.length} changed file(s)...`)
|
|
26515
26631
|
);
|
|
26516
26632
|
}
|
|
26517
26633
|
}
|
|
26518
26634
|
function reportResults(issues, elapsed) {
|
|
26519
26635
|
if (issues.length > 0) displayIssues(issues);
|
|
26520
|
-
else console.log(
|
|
26521
|
-
console.log(
|
|
26636
|
+
else console.log(chalk175.green("No issues found"));
|
|
26637
|
+
console.log(chalk175.dim(`Completed in ${formatElapsed(elapsed)}`));
|
|
26522
26638
|
if (issues.length > 0) process.exit(1);
|
|
26523
26639
|
}
|
|
26524
26640
|
async function inspect(sln, options2) {
|
|
@@ -26529,7 +26645,7 @@ async function inspect(sln, options2) {
|
|
|
26529
26645
|
const scope = parseScope(options2.scope);
|
|
26530
26646
|
const changedFiles2 = getChangedCsFiles(scope);
|
|
26531
26647
|
if (changedFiles2 !== null && changedFiles2.length === 0) {
|
|
26532
|
-
console.log(
|
|
26648
|
+
console.log(chalk175.green("No changed .cs files found"));
|
|
26533
26649
|
return;
|
|
26534
26650
|
}
|
|
26535
26651
|
logScope(changedFiles2);
|
|
@@ -27342,7 +27458,7 @@ function aggregateCommitters(authorLists) {
|
|
|
27342
27458
|
import { spawnSync as spawnSync6 } from "child_process";
|
|
27343
27459
|
import { unlinkSync as unlinkSync14, writeFileSync as writeFileSync34 } from "fs";
|
|
27344
27460
|
import { tmpdir as tmpdir5 } from "os";
|
|
27345
|
-
import { join as
|
|
27461
|
+
import { join as join73 } from "path";
|
|
27346
27462
|
function buildArgs2(queryFile, vars) {
|
|
27347
27463
|
const args = ["api", "graphql", "-F", `query=@${queryFile}`];
|
|
27348
27464
|
for (const [key, value] of Object.entries(vars)) {
|
|
@@ -27352,7 +27468,7 @@ function buildArgs2(queryFile, vars) {
|
|
|
27352
27468
|
return args;
|
|
27353
27469
|
}
|
|
27354
27470
|
function runGhGraphql(mutation, vars) {
|
|
27355
|
-
const queryFile =
|
|
27471
|
+
const queryFile = join73(tmpdir5(), `gh-query-${Date.now()}.graphql`);
|
|
27356
27472
|
writeFileSync34(queryFile, mutation);
|
|
27357
27473
|
try {
|
|
27358
27474
|
const result = spawnSync6("gh", buildArgs2(queryFile, vars), {
|
|
@@ -27417,25 +27533,25 @@ function fetchRepoCommitAuthors(org, repo, since) {
|
|
|
27417
27533
|
}
|
|
27418
27534
|
|
|
27419
27535
|
// src/commands/github/printCountTable.ts
|
|
27420
|
-
import
|
|
27536
|
+
import chalk176 from "chalk";
|
|
27421
27537
|
function printCountTable(labelHeader, rows) {
|
|
27422
27538
|
const labelWidth = Math.max(
|
|
27423
27539
|
labelHeader.length,
|
|
27424
27540
|
...rows.map((row3) => row3.label.length)
|
|
27425
27541
|
);
|
|
27426
27542
|
const header = `${labelHeader.padEnd(labelWidth)} Commits`;
|
|
27427
|
-
console.log(
|
|
27428
|
-
console.log(
|
|
27543
|
+
console.log(chalk176.dim(header));
|
|
27544
|
+
console.log(chalk176.dim("-".repeat(header.length)));
|
|
27429
27545
|
for (const row3 of rows) {
|
|
27430
27546
|
console.log(`${row3.label.padEnd(labelWidth)} ${row3.count}`);
|
|
27431
27547
|
}
|
|
27432
27548
|
}
|
|
27433
27549
|
|
|
27434
27550
|
// src/commands/github/printRepoAuthorBreakdown.ts
|
|
27435
|
-
import
|
|
27551
|
+
import chalk177 from "chalk";
|
|
27436
27552
|
function printRepoAuthorBreakdown(repos2) {
|
|
27437
27553
|
for (const repo of repos2) {
|
|
27438
|
-
console.log(
|
|
27554
|
+
console.log(chalk177.bold(repo.name));
|
|
27439
27555
|
const authorWidth = Math.max(
|
|
27440
27556
|
0,
|
|
27441
27557
|
...repo.authors.map((a) => a.author.length)
|
|
@@ -27509,10 +27625,10 @@ function parseSinceDate(value) {
|
|
|
27509
27625
|
}
|
|
27510
27626
|
|
|
27511
27627
|
// src/commands/github/issue/fixStructure/applyAndVerifySubtree.ts
|
|
27512
|
-
import
|
|
27628
|
+
import chalk179 from "chalk";
|
|
27513
27629
|
|
|
27514
27630
|
// src/commands/github/issue/fixStructure/applyFixStructurePlan.ts
|
|
27515
|
-
import
|
|
27631
|
+
import chalk178 from "chalk";
|
|
27516
27632
|
|
|
27517
27633
|
// src/commands/github/issue/fixStructure/removeIssueLabels.ts
|
|
27518
27634
|
var MUTATION2 = `mutation($labelableId: ID!, $labelIds: [ID!]!) {
|
|
@@ -27549,7 +27665,7 @@ function writeLineNow(line) {
|
|
|
27549
27665
|
// src/commands/github/issue/fixStructure/applyFixStructurePlan.ts
|
|
27550
27666
|
function applyFixStructurePlan(plan2) {
|
|
27551
27667
|
for (const entry of plan2.entries) {
|
|
27552
|
-
const where =
|
|
27668
|
+
const where = chalk178.cyan(`${entry.issue.repo}#${entry.issue.number}`);
|
|
27553
27669
|
const { typeChange, labelRemovals } = entry;
|
|
27554
27670
|
if (typeChange) {
|
|
27555
27671
|
writeLineNow(
|
|
@@ -27819,12 +27935,12 @@ function planSubtree(root2, context) {
|
|
|
27819
27935
|
function applyAndVerifySubtree(target, plan2, context) {
|
|
27820
27936
|
if (plan2.typeChangeCount === 0 && plan2.labelRemovalCount === 0) return;
|
|
27821
27937
|
applyFixStructurePlan(plan2);
|
|
27822
|
-
writeLineNow(
|
|
27938
|
+
writeLineNow(chalk179.dim("Re-walking the subtree to confirm"));
|
|
27823
27939
|
assertNoResidualDrift(
|
|
27824
27940
|
planSubtree(fetchRootIssue(target), context),
|
|
27825
27941
|
context.chain
|
|
27826
27942
|
);
|
|
27827
|
-
writeLineNow(
|
|
27943
|
+
writeLineNow(chalk179.green("Subtree normalised"));
|
|
27828
27944
|
}
|
|
27829
27945
|
|
|
27830
27946
|
// src/commands/github/issue/fixStructure/assertChainTypesExist.ts
|
|
@@ -27860,22 +27976,22 @@ function parseTypeChain(value) {
|
|
|
27860
27976
|
}
|
|
27861
27977
|
|
|
27862
27978
|
// src/commands/github/issue/fixStructure/printFixStructurePlan.ts
|
|
27863
|
-
import
|
|
27979
|
+
import chalk180 from "chalk";
|
|
27864
27980
|
function annotate(entry) {
|
|
27865
27981
|
const notes = [];
|
|
27866
27982
|
if (entry.level === null) {
|
|
27867
|
-
notes.push(
|
|
27983
|
+
notes.push(chalk180.red("deeper than the leaf level"));
|
|
27868
27984
|
} else if (entry.typeChange) {
|
|
27869
27985
|
notes.push(
|
|
27870
|
-
|
|
27986
|
+
chalk180.yellow(
|
|
27871
27987
|
`${entry.typeChange.from ?? "no type"} -> ${entry.typeChange.to}`
|
|
27872
27988
|
)
|
|
27873
27989
|
);
|
|
27874
27990
|
} else {
|
|
27875
|
-
notes.push(
|
|
27991
|
+
notes.push(chalk180.dim(entry.issue.typeName ?? "no type"));
|
|
27876
27992
|
}
|
|
27877
27993
|
for (const label of entry.labelRemovals) {
|
|
27878
|
-
notes.push(
|
|
27994
|
+
notes.push(chalk180.yellow(`-${label.name}`));
|
|
27879
27995
|
}
|
|
27880
27996
|
return notes;
|
|
27881
27997
|
}
|
|
@@ -27883,22 +27999,22 @@ function formatCount(count10, noun) {
|
|
|
27883
27999
|
return `${count10} ${noun}${count10 === 1 ? "" : "s"}`;
|
|
27884
28000
|
}
|
|
27885
28001
|
function printFixStructurePlan(plan2, chain2, apply) {
|
|
27886
|
-
writeLineNow(
|
|
28002
|
+
writeLineNow(chalk180.dim(`chain: ${chain2.join(" > ")}`));
|
|
27887
28003
|
for (const entry of plan2.entries) {
|
|
27888
28004
|
const indent4 = " ".repeat(entry.issue.depth);
|
|
27889
|
-
const name =
|
|
28005
|
+
const name = chalk180.cyan(`${entry.issue.repo}#${entry.issue.number}`);
|
|
27890
28006
|
writeLineNow(
|
|
27891
28007
|
`${indent4}${name} ${entry.issue.title} [${annotate(entry).join(", ")}]`
|
|
27892
28008
|
);
|
|
27893
28009
|
}
|
|
27894
28010
|
if (plan2.typeChangeCount === 0 && plan2.labelRemovalCount === 0) {
|
|
27895
|
-
writeLineNow(
|
|
28011
|
+
writeLineNow(chalk180.green("Nothing to change"));
|
|
27896
28012
|
return;
|
|
27897
28013
|
}
|
|
27898
28014
|
writeLineNow(
|
|
27899
28015
|
`${formatCount(plan2.typeChangeCount, "type change")}, ${formatCount(plan2.labelRemovalCount, "label removal")} planned`
|
|
27900
28016
|
);
|
|
27901
|
-
if (!apply) writeLineNow(
|
|
28017
|
+
if (!apply) writeLineNow(chalk180.dim("Dry run \u2014 nothing written"));
|
|
27902
28018
|
}
|
|
27903
28019
|
|
|
27904
28020
|
// src/commands/github/issue/parseRepoSlug.ts
|
|
@@ -28803,14 +28919,14 @@ function slugFromUrl(url) {
|
|
|
28803
28919
|
import { mkdirSync as mkdirSync21, writeFileSync as writeFileSync35 } from "fs";
|
|
28804
28920
|
|
|
28805
28921
|
// src/commands/github/issue/issueWorkingFile.ts
|
|
28806
|
-
import { join as
|
|
28922
|
+
import { join as join74 } from "path";
|
|
28807
28923
|
function issueWorkingFile(slug2, number) {
|
|
28808
28924
|
const [owner = "unknown", repo = "unknown"] = slug2.split("/");
|
|
28809
|
-
const dir =
|
|
28925
|
+
const dir = join74(getStoreDir(), "github-issues", owner, repo);
|
|
28810
28926
|
return {
|
|
28811
28927
|
dir,
|
|
28812
|
-
bodyPath:
|
|
28813
|
-
metaPath:
|
|
28928
|
+
bodyPath: join74(dir, `${number}.md`),
|
|
28929
|
+
metaPath: join74(dir, `${number}.json`)
|
|
28814
28930
|
};
|
|
28815
28931
|
}
|
|
28816
28932
|
|
|
@@ -29305,25 +29421,25 @@ function registerGithub(program) {
|
|
|
29305
29421
|
}
|
|
29306
29422
|
|
|
29307
29423
|
// src/commands/inbox/list.ts
|
|
29308
|
-
import
|
|
29424
|
+
import chalk181 from "chalk";
|
|
29309
29425
|
async function list3() {
|
|
29310
29426
|
const messages = await listInboxMessages(await getDb());
|
|
29311
29427
|
if (messages.length === 0) {
|
|
29312
|
-
console.log(
|
|
29428
|
+
console.log(chalk181.dim("No flagged messages; run assist inbox scan"));
|
|
29313
29429
|
return;
|
|
29314
29430
|
}
|
|
29315
29431
|
for (const message3 of messages) {
|
|
29316
29432
|
const when = (message3.receivedAt ?? message3.flaggedAt).toISOString();
|
|
29317
29433
|
console.log(
|
|
29318
|
-
`${
|
|
29434
|
+
`${chalk181.dim(when)} ${chalk181.cyan(message3.source)} ${chalk181.bold(message3.sender)}`
|
|
29319
29435
|
);
|
|
29320
29436
|
console.log(` ${message3.summary}`);
|
|
29321
|
-
console.log(` ${
|
|
29437
|
+
console.log(` ${chalk181.dim(message3.link)}`);
|
|
29322
29438
|
}
|
|
29323
29439
|
}
|
|
29324
29440
|
|
|
29325
29441
|
// src/commands/inbox/scan.ts
|
|
29326
|
-
import
|
|
29442
|
+
import chalk182 from "chalk";
|
|
29327
29443
|
|
|
29328
29444
|
// src/shared/formatTokens.ts
|
|
29329
29445
|
function formatTokens(n) {
|
|
@@ -29735,7 +29851,7 @@ async function scan() {
|
|
|
29735
29851
|
)
|
|
29736
29852
|
});
|
|
29737
29853
|
console.log(
|
|
29738
|
-
`Flagged ${flagged} message(s) needing a reply, ${
|
|
29854
|
+
`Flagged ${flagged} message(s) needing a reply, ${chalk182.bold(added)} new. ${chalk182.dim(formatScanUsage(usage))}`
|
|
29739
29855
|
);
|
|
29740
29856
|
}
|
|
29741
29857
|
|
|
@@ -29750,7 +29866,7 @@ function registerInbox(program) {
|
|
|
29750
29866
|
}
|
|
29751
29867
|
|
|
29752
29868
|
// src/commands/jira/acceptanceCriteria.ts
|
|
29753
|
-
import
|
|
29869
|
+
import chalk183 from "chalk";
|
|
29754
29870
|
|
|
29755
29871
|
// src/commands/jira/adfToText.ts
|
|
29756
29872
|
function renderInline(node) {
|
|
@@ -29817,7 +29933,7 @@ function acceptanceCriteria(issueKey) {
|
|
|
29817
29933
|
const parsed = fetchIssue(issueKey, field);
|
|
29818
29934
|
const acValue = parsed?.fields?.[field];
|
|
29819
29935
|
if (!acValue) {
|
|
29820
|
-
console.log(
|
|
29936
|
+
console.log(chalk183.yellow(`No acceptance criteria found on ${issueKey}.`));
|
|
29821
29937
|
return;
|
|
29822
29938
|
}
|
|
29823
29939
|
if (typeof acValue === "string") {
|
|
@@ -29883,14 +29999,14 @@ async function jiraAuth() {
|
|
|
29883
29999
|
}
|
|
29884
30000
|
|
|
29885
30001
|
// src/commands/jira/viewIssue.ts
|
|
29886
|
-
import
|
|
30002
|
+
import chalk184 from "chalk";
|
|
29887
30003
|
function viewIssue2(issueKey) {
|
|
29888
30004
|
const parsed = fetchIssue(issueKey, "summary,description");
|
|
29889
30005
|
const fields = parsed?.fields;
|
|
29890
30006
|
const summary = fields?.summary;
|
|
29891
30007
|
const description = fields?.description;
|
|
29892
30008
|
if (summary) {
|
|
29893
|
-
console.log(
|
|
30009
|
+
console.log(chalk184.bold(summary));
|
|
29894
30010
|
}
|
|
29895
30011
|
if (description) {
|
|
29896
30012
|
if (summary) console.log();
|
|
@@ -29904,7 +30020,7 @@ function viewIssue2(issueKey) {
|
|
|
29904
30020
|
}
|
|
29905
30021
|
if (!summary && !description) {
|
|
29906
30022
|
console.log(
|
|
29907
|
-
|
|
30023
|
+
chalk184.yellow(`No summary or description found on ${issueKey}.`)
|
|
29908
30024
|
);
|
|
29909
30025
|
}
|
|
29910
30026
|
}
|
|
@@ -29998,11 +30114,11 @@ import { existsSync as existsSync61 } from "fs";
|
|
|
29998
30114
|
import { basename as basename21, dirname as dirname33 } from "path";
|
|
29999
30115
|
|
|
30000
30116
|
// src/commands/sessions/daemon/worktree/nextWorktreePath.ts
|
|
30001
|
-
import { basename as basename20, join as
|
|
30117
|
+
import { basename as basename20, join as join75 } from "path";
|
|
30002
30118
|
function nextWorktreePath(clone, base, isTaken) {
|
|
30003
30119
|
const name = basename20(clone);
|
|
30004
30120
|
for (let n = 2; n < 1e3; n++) {
|
|
30005
|
-
const candidate =
|
|
30121
|
+
const candidate = join75(base, `${name}-${n}`);
|
|
30006
30122
|
if (!isTaken(candidate)) return candidate;
|
|
30007
30123
|
}
|
|
30008
30124
|
throw new Error(`no free worktree suffix for ${clone}`);
|
|
@@ -30265,20 +30381,20 @@ function persistedTreeRoots() {
|
|
|
30265
30381
|
|
|
30266
30382
|
// src/commands/sessions/daemon/worktree/seedWorktree.ts
|
|
30267
30383
|
import { copyFileSync, existsSync as existsSync63, mkdirSync as mkdirSync22 } from "fs";
|
|
30268
|
-
import { dirname as dirname34, join as
|
|
30384
|
+
import { dirname as dirname34, join as join77 } from "path";
|
|
30269
30385
|
|
|
30270
30386
|
// src/commands/sessions/daemon/worktree/runInstall.ts
|
|
30271
30387
|
import { resolve as resolve19 } from "path";
|
|
30272
30388
|
|
|
30273
30389
|
// src/commands/sessions/daemon/worktree/detectInstallCommand.ts
|
|
30274
30390
|
import { existsSync as existsSync62 } from "fs";
|
|
30275
|
-
import { join as
|
|
30391
|
+
import { join as join76 } from "path";
|
|
30276
30392
|
function detectInstallCommand(dir) {
|
|
30277
|
-
if (!existsSync62(
|
|
30278
|
-
if (existsSync62(
|
|
30279
|
-
if (existsSync62(
|
|
30280
|
-
if (existsSync62(
|
|
30281
|
-
if (existsSync62(
|
|
30393
|
+
if (!existsSync62(join76(dir, "package.json"))) return null;
|
|
30394
|
+
if (existsSync62(join76(dir, "pnpm-lock.yaml"))) return "pnpm install";
|
|
30395
|
+
if (existsSync62(join76(dir, "yarn.lock"))) return "yarn install";
|
|
30396
|
+
if (existsSync62(join76(dir, "bun.lockb"))) return "bun install";
|
|
30397
|
+
if (existsSync62(join76(dir, "package-lock.json"))) return "npm ci";
|
|
30282
30398
|
return "npm install";
|
|
30283
30399
|
}
|
|
30284
30400
|
|
|
@@ -30443,9 +30559,9 @@ function seedWorktree(worktreePath, clone, onSeeded = () => {
|
|
|
30443
30559
|
}
|
|
30444
30560
|
function copyConfigFiles(worktreePath, clone, copy) {
|
|
30445
30561
|
for (const rel of copy) {
|
|
30446
|
-
const src =
|
|
30562
|
+
const src = join77(clone, rel);
|
|
30447
30563
|
if (!existsSync63(src)) continue;
|
|
30448
|
-
const dest =
|
|
30564
|
+
const dest = join77(worktreePath, rel);
|
|
30449
30565
|
try {
|
|
30450
30566
|
mkdirSync22(dirname34(dest), { recursive: true });
|
|
30451
30567
|
copyFileSync(src, dest);
|
|
@@ -30611,7 +30727,7 @@ function worktreeHoldingBranch(cwd, branch2) {
|
|
|
30611
30727
|
}
|
|
30612
30728
|
|
|
30613
30729
|
// src/commands/review/failCheckout.ts
|
|
30614
|
-
import
|
|
30730
|
+
import chalk185 from "chalk";
|
|
30615
30731
|
|
|
30616
30732
|
// src/commands/review/azCliProblem.ts
|
|
30617
30733
|
import { execFileSync as execFileSync17 } from "child_process";
|
|
@@ -30664,14 +30780,14 @@ function failCheckout(number, headRef, stale, from, checkout) {
|
|
|
30664
30780
|
gitSyncOrNull(process.cwd(), ["checkout", "--quiet", from]);
|
|
30665
30781
|
if (headRef && stale === "local-work")
|
|
30666
30782
|
console.error(
|
|
30667
|
-
|
|
30783
|
+
chalk185.red(
|
|
30668
30784
|
`Local branch ${headRef} has commits that are not on the remote and cannot fast-forward to PR #${number}'s head; push or reset ${headRef}, then retry.`
|
|
30669
30785
|
)
|
|
30670
30786
|
);
|
|
30671
30787
|
const problem = checkout.file === "az" ? azCliProblem() : null;
|
|
30672
|
-
if (problem) console.error(
|
|
30788
|
+
if (problem) console.error(chalk185.red(problem));
|
|
30673
30789
|
console.error(
|
|
30674
|
-
|
|
30790
|
+
chalk185.red(`${checkout.file} ${checkout.args.join(" ")} failed; aborting.`)
|
|
30675
30791
|
);
|
|
30676
30792
|
process.exit(1);
|
|
30677
30793
|
}
|
|
@@ -30864,18 +30980,18 @@ function registerList(program) {
|
|
|
30864
30980
|
}
|
|
30865
30981
|
|
|
30866
30982
|
// src/commands/litellm/listModels.ts
|
|
30867
|
-
import
|
|
30983
|
+
import chalk187 from "chalk";
|
|
30868
30984
|
|
|
30869
30985
|
// src/commands/litellm/resolveLitellmConfig.ts
|
|
30870
|
-
import
|
|
30986
|
+
import chalk186 from "chalk";
|
|
30871
30987
|
function resolveLitellmConfig() {
|
|
30872
30988
|
const { config, missing } = readLitellmConfig();
|
|
30873
30989
|
if (!config) {
|
|
30874
|
-
console.error(
|
|
30990
|
+
console.error(chalk186.red("LiteLLM is not configured"));
|
|
30875
30991
|
for (const key of missing) {
|
|
30876
30992
|
const entry = litellmConfigHelp.find((help) => help.key === key);
|
|
30877
30993
|
console.error(
|
|
30878
|
-
|
|
30994
|
+
chalk186.red(` ${key} is not set. Set it with: ${entry?.setter}`)
|
|
30879
30995
|
);
|
|
30880
30996
|
}
|
|
30881
30997
|
process.exit(1);
|
|
@@ -30901,13 +31017,13 @@ async function listModels(options2) {
|
|
|
30901
31017
|
} catch (error) {
|
|
30902
31018
|
const reason4 = error instanceof Error ? error.message : String(error);
|
|
30903
31019
|
console.error(
|
|
30904
|
-
|
|
31020
|
+
chalk187.red(`Failed to reach LiteLLM at ${baseUrl}: ${reason4}`)
|
|
30905
31021
|
);
|
|
30906
31022
|
process.exit(1);
|
|
30907
31023
|
}
|
|
30908
31024
|
const body = await response.text();
|
|
30909
31025
|
if (!response.ok) {
|
|
30910
|
-
console.error(
|
|
31026
|
+
console.error(chalk187.red(`LiteLLM returned ${response.status}: ${body}`));
|
|
30911
31027
|
process.exit(1);
|
|
30912
31028
|
}
|
|
30913
31029
|
if (options2.json) {
|
|
@@ -30925,17 +31041,17 @@ function registerLitellm(program) {
|
|
|
30925
31041
|
}
|
|
30926
31042
|
|
|
30927
31043
|
// src/commands/mermaidExport.ts
|
|
30928
|
-
import { mkdirSync as mkdirSync23, readdirSync as
|
|
31044
|
+
import { mkdirSync as mkdirSync23, readdirSync as readdirSync13 } from "fs";
|
|
30929
31045
|
import { resolve as resolve21 } from "path";
|
|
30930
|
-
import
|
|
31046
|
+
import chalk190 from "chalk";
|
|
30931
31047
|
|
|
30932
31048
|
// src/commands/mermaid/exportFile.ts
|
|
30933
31049
|
import { readFileSync as readFileSync44, writeFileSync as writeFileSync36 } from "fs";
|
|
30934
31050
|
import { basename as basename22, extname as extname4, resolve as resolve20 } from "path";
|
|
30935
|
-
import
|
|
31051
|
+
import chalk189 from "chalk";
|
|
30936
31052
|
|
|
30937
31053
|
// src/commands/mermaid/renderBlock.ts
|
|
30938
|
-
import
|
|
31054
|
+
import chalk188 from "chalk";
|
|
30939
31055
|
async function renderBlock(krokiUrl, source) {
|
|
30940
31056
|
const response = await fetch(`${krokiUrl}/mermaid/svg`, {
|
|
30941
31057
|
method: "POST",
|
|
@@ -30944,7 +31060,7 @@ async function renderBlock(krokiUrl, source) {
|
|
|
30944
31060
|
});
|
|
30945
31061
|
if (!response.ok) {
|
|
30946
31062
|
console.error(
|
|
30947
|
-
|
|
31063
|
+
chalk188.red(
|
|
30948
31064
|
`Kroki request failed: ${response.status} ${response.statusText}`
|
|
30949
31065
|
)
|
|
30950
31066
|
);
|
|
@@ -30962,19 +31078,19 @@ async function exportFile(file, outDir, krokiUrl, onlyIndex) {
|
|
|
30962
31078
|
if (onlyIndex !== void 0) {
|
|
30963
31079
|
if (onlyIndex < 1 || onlyIndex > blocks.length) {
|
|
30964
31080
|
console.error(
|
|
30965
|
-
|
|
31081
|
+
chalk189.red(
|
|
30966
31082
|
`${file}: --index ${onlyIndex} out of range (file has ${blocks.length} diagram(s))`
|
|
30967
31083
|
)
|
|
30968
31084
|
);
|
|
30969
31085
|
process.exit(1);
|
|
30970
31086
|
}
|
|
30971
31087
|
console.log(
|
|
30972
|
-
|
|
31088
|
+
chalk189.gray(
|
|
30973
31089
|
`${file} \u2014 rendering diagram ${onlyIndex} of ${blocks.length}`
|
|
30974
31090
|
)
|
|
30975
31091
|
);
|
|
30976
31092
|
} else {
|
|
30977
|
-
console.log(
|
|
31093
|
+
console.log(chalk189.gray(`${file} \u2014 ${blocks.length} diagram(s)`));
|
|
30978
31094
|
}
|
|
30979
31095
|
for (const [i, source] of blocks.entries()) {
|
|
30980
31096
|
const idx = i + 1;
|
|
@@ -30982,7 +31098,7 @@ async function exportFile(file, outDir, krokiUrl, onlyIndex) {
|
|
|
30982
31098
|
const outPath = resolve20(outDir, `${stem}-${idx}.svg`);
|
|
30983
31099
|
const svg = await renderBlock(krokiUrl, source);
|
|
30984
31100
|
writeFileSync36(outPath, svg, "utf8");
|
|
30985
|
-
console.log(
|
|
31101
|
+
console.log(chalk189.green(` \u2192 ${outPath}`));
|
|
30986
31102
|
}
|
|
30987
31103
|
}
|
|
30988
31104
|
function extractMermaidBlocks(markdown) {
|
|
@@ -30998,18 +31114,18 @@ async function mermaidExport(file, options2 = {}) {
|
|
|
30998
31114
|
if (options2.index !== void 0) {
|
|
30999
31115
|
if (!Number.isInteger(options2.index) || options2.index < 1) {
|
|
31000
31116
|
console.error(
|
|
31001
|
-
|
|
31117
|
+
chalk190.red(`--index must be a positive integer (got ${options2.index})`)
|
|
31002
31118
|
);
|
|
31003
31119
|
process.exit(1);
|
|
31004
31120
|
}
|
|
31005
31121
|
if (!file) {
|
|
31006
|
-
console.error(
|
|
31122
|
+
console.error(chalk190.red("--index requires a file argument"));
|
|
31007
31123
|
process.exit(1);
|
|
31008
31124
|
}
|
|
31009
31125
|
}
|
|
31010
|
-
const files = file ? [file] :
|
|
31126
|
+
const files = file ? [file] : readdirSync13(process.cwd()).filter((name) => name.toLowerCase().endsWith(".md")).sort();
|
|
31011
31127
|
if (files.length === 0) {
|
|
31012
|
-
console.log(
|
|
31128
|
+
console.log(chalk190.gray("No markdown files found in current directory."));
|
|
31013
31129
|
return;
|
|
31014
31130
|
}
|
|
31015
31131
|
for (const f of files) {
|
|
@@ -31155,7 +31271,7 @@ function extractToSave(details, cwd = process.cwd()) {
|
|
|
31155
31271
|
}
|
|
31156
31272
|
|
|
31157
31273
|
// src/commands/miro/keptTexts.ts
|
|
31158
|
-
import
|
|
31274
|
+
import chalk191 from "chalk";
|
|
31159
31275
|
|
|
31160
31276
|
// src/commands/miro/applyIgnore.ts
|
|
31161
31277
|
function applyIgnore(texts, ignore3) {
|
|
@@ -31194,7 +31310,7 @@ function warnUnmatched(file, unmatched) {
|
|
|
31194
31310
|
if (unmatched.length === 0) return;
|
|
31195
31311
|
const entries = unmatched.map((entry) => ` - ${entry}`).join("\n");
|
|
31196
31312
|
console.error(
|
|
31197
|
-
|
|
31313
|
+
chalk191.yellow(
|
|
31198
31314
|
`${unmatched.length} ${unmatched.length === 1 ? "entry" : "entries"} in ${file} matched no box text:
|
|
31199
31315
|
${entries}`
|
|
31200
31316
|
)
|
|
@@ -31395,7 +31511,7 @@ function readMiroItems(file) {
|
|
|
31395
31511
|
}
|
|
31396
31512
|
|
|
31397
31513
|
// src/commands/miro/resolveExtractOptions.ts
|
|
31398
|
-
import
|
|
31514
|
+
import chalk192 from "chalk";
|
|
31399
31515
|
|
|
31400
31516
|
// src/commands/miro/extractLayers.ts
|
|
31401
31517
|
function extractsIn(layer) {
|
|
@@ -31473,7 +31589,7 @@ function resolveExtractOptions(name, options2, paths) {
|
|
|
31473
31589
|
paths.cwd,
|
|
31474
31590
|
paths.globalConfigPath
|
|
31475
31591
|
);
|
|
31476
|
-
console.error(
|
|
31592
|
+
console.error(chalk192.dim(`Extract "${name}" from ${resolved.from}`));
|
|
31477
31593
|
return resolved.options;
|
|
31478
31594
|
}
|
|
31479
31595
|
|
|
@@ -31578,7 +31694,7 @@ function registerMiro(program) {
|
|
|
31578
31694
|
import { mkdir as mkdir6 } from "fs/promises";
|
|
31579
31695
|
import { createServer as createServer2 } from "http";
|
|
31580
31696
|
import { dirname as dirname37 } from "path";
|
|
31581
|
-
import
|
|
31697
|
+
import chalk194 from "chalk";
|
|
31582
31698
|
|
|
31583
31699
|
// src/commands/netcap/corsHeaders.ts
|
|
31584
31700
|
var corsHeaders = {
|
|
@@ -31656,15 +31772,15 @@ function createNetcapHandler(options2) {
|
|
|
31656
31772
|
// src/commands/netcap/prepareExtensionForLoad.ts
|
|
31657
31773
|
import { cp as cp4, readFile as readFile7, writeFile as writeFile6 } from "fs/promises";
|
|
31658
31774
|
import { networkInterfaces } from "os";
|
|
31659
|
-
import { join as
|
|
31660
|
-
import
|
|
31775
|
+
import { join as join79 } from "path";
|
|
31776
|
+
import chalk193 from "chalk";
|
|
31661
31777
|
|
|
31662
31778
|
// src/commands/netcap/netcapExtensionDir.ts
|
|
31663
|
-
import { dirname as dirname36, join as
|
|
31779
|
+
import { dirname as dirname36, join as join78 } from "path";
|
|
31664
31780
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
31665
31781
|
var moduleDir2 = dirname36(fileURLToPath7(import.meta.url));
|
|
31666
31782
|
function netcapExtensionDir() {
|
|
31667
|
-
return
|
|
31783
|
+
return join78(moduleDir2, "commands", "netcap", "netcap-extension");
|
|
31668
31784
|
}
|
|
31669
31785
|
|
|
31670
31786
|
// src/commands/netcap/prepareExtensionForLoad.ts
|
|
@@ -31679,7 +31795,7 @@ function lanIPv4() {
|
|
|
31679
31795
|
return void 0;
|
|
31680
31796
|
}
|
|
31681
31797
|
async function configureBackground(dir, host, port, filter) {
|
|
31682
|
-
const file =
|
|
31798
|
+
const file = join79(dir, "background.js");
|
|
31683
31799
|
const source = await readFile7(file, "utf8");
|
|
31684
31800
|
await writeFile6(
|
|
31685
31801
|
file,
|
|
@@ -31701,7 +31817,7 @@ async function prepareExtensionForLoad(port, filter = "") {
|
|
|
31701
31817
|
const host = lanIPv4();
|
|
31702
31818
|
if (!host) {
|
|
31703
31819
|
console.log(
|
|
31704
|
-
|
|
31820
|
+
chalk193.yellow("could not determine the WSL IP for the extension")
|
|
31705
31821
|
);
|
|
31706
31822
|
await configureBackground(source, "127.0.0.1", port, filter);
|
|
31707
31823
|
return source;
|
|
@@ -31712,27 +31828,27 @@ async function prepareExtensionForLoad(port, filter = "") {
|
|
|
31712
31828
|
return WSL_WINDOWS_PATH3;
|
|
31713
31829
|
} catch {
|
|
31714
31830
|
console.log(
|
|
31715
|
-
|
|
31831
|
+
chalk193.yellow(`could not copy extension to ${WSL_WINDOWS_PATH3}`)
|
|
31716
31832
|
);
|
|
31717
31833
|
return source;
|
|
31718
31834
|
}
|
|
31719
31835
|
}
|
|
31720
31836
|
|
|
31721
31837
|
// src/commands/netcap/resolveNetcapOutPath.ts
|
|
31722
|
-
import { isAbsolute as isAbsolute5, join as
|
|
31838
|
+
import { isAbsolute as isAbsolute5, join as join81, resolve as resolve23 } from "path";
|
|
31723
31839
|
|
|
31724
31840
|
// src/commands/netcap/defaultCapturePath.ts
|
|
31725
31841
|
import { homedir as homedir25 } from "os";
|
|
31726
|
-
import { join as
|
|
31842
|
+
import { join as join80 } from "path";
|
|
31727
31843
|
function defaultCapturePath() {
|
|
31728
|
-
return
|
|
31844
|
+
return join80(homedir25(), ".assist", "netcap", "capture.jsonl");
|
|
31729
31845
|
}
|
|
31730
31846
|
|
|
31731
31847
|
// src/commands/netcap/resolveNetcapOutPath.ts
|
|
31732
31848
|
function resolveNetcapOutPath(out) {
|
|
31733
31849
|
if (!out) return defaultCapturePath();
|
|
31734
31850
|
const dir = isAbsolute5(out) ? out : resolve23(process.cwd(), out);
|
|
31735
|
-
return
|
|
31851
|
+
return join81(dir, "capture.jsonl");
|
|
31736
31852
|
}
|
|
31737
31853
|
|
|
31738
31854
|
// src/commands/netcap/netcap.ts
|
|
@@ -31745,30 +31861,30 @@ async function netcap(options2) {
|
|
|
31745
31861
|
let count10 = 0;
|
|
31746
31862
|
const handler = createNetcapHandler({
|
|
31747
31863
|
outPath,
|
|
31748
|
-
onPing: () => console.log(
|
|
31864
|
+
onPing: () => console.log(chalk194.dim("ping from extension")),
|
|
31749
31865
|
onCapture: (entry) => {
|
|
31750
31866
|
count10 += 1;
|
|
31751
31867
|
console.log(
|
|
31752
|
-
|
|
31753
|
-
|
|
31868
|
+
chalk194.green(`captured #${count10}`),
|
|
31869
|
+
chalk194.dim(`${entry.method ?? "?"} ${entry.url ?? "?"}`)
|
|
31754
31870
|
);
|
|
31755
31871
|
}
|
|
31756
31872
|
});
|
|
31757
31873
|
const server = createServer2(handler);
|
|
31758
31874
|
server.listen(port, () => {
|
|
31759
31875
|
console.log(
|
|
31760
|
-
|
|
31876
|
+
chalk194.bold(`netcap receiver listening on http://127.0.0.1:${port}`)
|
|
31761
31877
|
);
|
|
31762
|
-
console.log(
|
|
31878
|
+
console.log(chalk194.dim(`appending captures to ${outPath}`));
|
|
31763
31879
|
if (filter)
|
|
31764
|
-
console.log(
|
|
31765
|
-
console.log(
|
|
31766
|
-
console.log(
|
|
31880
|
+
console.log(chalk194.dim(`forwarding only URLs matching "${filter}"`));
|
|
31881
|
+
console.log(chalk194.dim(`load the unpacked extension from ${extensionPath}`));
|
|
31882
|
+
console.log(chalk194.dim("press Ctrl-C to stop"));
|
|
31767
31883
|
});
|
|
31768
31884
|
process.on("SIGINT", () => {
|
|
31769
31885
|
server.close();
|
|
31770
31886
|
console.log(
|
|
31771
|
-
|
|
31887
|
+
chalk194.bold(
|
|
31772
31888
|
`
|
|
31773
31889
|
netcap stopped \u2014 captured ${count10} ${count10 === 1 ? "entry" : "entries"} to ${outPath}`
|
|
31774
31890
|
)
|
|
@@ -31779,8 +31895,8 @@ netcap stopped \u2014 captured ${count10} ${count10 === 1 ? "entry" : "entries"}
|
|
|
31779
31895
|
|
|
31780
31896
|
// src/commands/netcap/netcapExtract.ts
|
|
31781
31897
|
import { writeFileSync as writeFileSync38 } from "fs";
|
|
31782
|
-
import { join as
|
|
31783
|
-
import
|
|
31898
|
+
import { join as join82 } from "path";
|
|
31899
|
+
import chalk195 from "chalk";
|
|
31784
31900
|
|
|
31785
31901
|
// src/commands/netcap/extractPostsFromCapture.ts
|
|
31786
31902
|
import { readFileSync as readFileSync47 } from "fs";
|
|
@@ -32224,12 +32340,12 @@ function extractPostsFromCapture(captureFile) {
|
|
|
32224
32340
|
function netcapExtract(file) {
|
|
32225
32341
|
const captureFile = file ?? defaultCapturePath();
|
|
32226
32342
|
const posts = extractPostsFromCapture(captureFile);
|
|
32227
|
-
const outFile =
|
|
32343
|
+
const outFile = join82(captureFile, "..", "posts.json");
|
|
32228
32344
|
writeFileSync38(outFile, `${JSON.stringify(posts, null, 2)}
|
|
32229
32345
|
`);
|
|
32230
32346
|
console.log(
|
|
32231
|
-
|
|
32232
|
-
|
|
32347
|
+
chalk195.green(`extracted ${posts.length} posts`),
|
|
32348
|
+
chalk195.dim(`-> ${outFile}`)
|
|
32233
32349
|
);
|
|
32234
32350
|
}
|
|
32235
32351
|
|
|
@@ -32250,7 +32366,7 @@ function registerNetcap(program) {
|
|
|
32250
32366
|
}
|
|
32251
32367
|
|
|
32252
32368
|
// src/commands/news/add.ts
|
|
32253
|
-
import
|
|
32369
|
+
import chalk196 from "chalk";
|
|
32254
32370
|
import enquirer8 from "enquirer";
|
|
32255
32371
|
async function add2(url) {
|
|
32256
32372
|
if (!url) {
|
|
@@ -32271,25 +32387,25 @@ async function add2(url) {
|
|
|
32271
32387
|
}
|
|
32272
32388
|
const added = await addFeed(await getDb(), url);
|
|
32273
32389
|
if (!added) {
|
|
32274
|
-
console.log(
|
|
32390
|
+
console.log(chalk196.yellow("Feed already exists"));
|
|
32275
32391
|
return;
|
|
32276
32392
|
}
|
|
32277
|
-
console.log(
|
|
32393
|
+
console.log(chalk196.green(`Added feed: ${url}`));
|
|
32278
32394
|
}
|
|
32279
32395
|
|
|
32280
32396
|
// src/commands/news/list.ts
|
|
32281
|
-
import
|
|
32397
|
+
import chalk197 from "chalk";
|
|
32282
32398
|
async function list4() {
|
|
32283
32399
|
const urls = await listFeeds(await getDb());
|
|
32284
32400
|
if (urls.length === 0) {
|
|
32285
|
-
console.log(
|
|
32401
|
+
console.log(chalk197.dim("No feeds; add one with assist news add <url>"));
|
|
32286
32402
|
return;
|
|
32287
32403
|
}
|
|
32288
32404
|
for (const url of urls) console.log(url);
|
|
32289
32405
|
}
|
|
32290
32406
|
|
|
32291
32407
|
// src/commands/news/remove.ts
|
|
32292
|
-
import
|
|
32408
|
+
import chalk198 from "chalk";
|
|
32293
32409
|
|
|
32294
32410
|
// src/commands/backlog/removeFeed.ts
|
|
32295
32411
|
import { eq as eq50 } from "drizzle-orm";
|
|
@@ -32302,10 +32418,10 @@ async function removeFeed(db, url) {
|
|
|
32302
32418
|
async function remove(url) {
|
|
32303
32419
|
const removed = await removeFeed(await getDb(), url);
|
|
32304
32420
|
if (!removed) {
|
|
32305
|
-
console.log(
|
|
32421
|
+
console.log(chalk198.yellow(`No feed matches ${url}`));
|
|
32306
32422
|
return;
|
|
32307
32423
|
}
|
|
32308
|
-
console.log(
|
|
32424
|
+
console.log(chalk198.green(`Removed feed: ${url}`));
|
|
32309
32425
|
}
|
|
32310
32426
|
|
|
32311
32427
|
// src/commands/registerNews.ts
|
|
@@ -32358,7 +32474,7 @@ function registerPiHook(program) {
|
|
|
32358
32474
|
}
|
|
32359
32475
|
|
|
32360
32476
|
// src/commands/prompts/printPromptsTable.ts
|
|
32361
|
-
import
|
|
32477
|
+
import chalk199 from "chalk";
|
|
32362
32478
|
function truncate2(str, max) {
|
|
32363
32479
|
if (str.length <= max) return str;
|
|
32364
32480
|
return `${str.slice(0, max - 1)}\u2026`;
|
|
@@ -32376,14 +32492,14 @@ function printPromptsTable(rows) {
|
|
|
32376
32492
|
"Command".padEnd(commandWidth),
|
|
32377
32493
|
"Repos"
|
|
32378
32494
|
].join(" ");
|
|
32379
|
-
console.log(
|
|
32380
|
-
console.log(
|
|
32495
|
+
console.log(chalk199.dim(header));
|
|
32496
|
+
console.log(chalk199.dim("-".repeat(header.length)));
|
|
32381
32497
|
for (const row3 of rows) {
|
|
32382
32498
|
const count10 = String(row3.count).padStart(countWidth);
|
|
32383
32499
|
const tool = row3.tool.padEnd(toolWidth);
|
|
32384
32500
|
const command = truncate2(row3.command, 60).padEnd(commandWidth);
|
|
32385
32501
|
console.log(
|
|
32386
|
-
`${
|
|
32502
|
+
`${chalk199.yellow(count10)} ${tool} ${command} ${chalk199.dim(row3.repos)}`
|
|
32387
32503
|
);
|
|
32388
32504
|
}
|
|
32389
32505
|
}
|
|
@@ -32421,26 +32537,26 @@ import { execSync as execSync41 } from "child_process";
|
|
|
32421
32537
|
import enquirer9 from "enquirer";
|
|
32422
32538
|
|
|
32423
32539
|
// src/commands/prs/prs/displayPaginated/printPr.ts
|
|
32424
|
-
import
|
|
32540
|
+
import chalk200 from "chalk";
|
|
32425
32541
|
var STATUS_MAP = {
|
|
32426
|
-
MERGED: (pr) => pr.mergedAt ? { label:
|
|
32427
|
-
CLOSED: (pr) => pr.closedAt ? { label:
|
|
32542
|
+
MERGED: (pr) => pr.mergedAt ? { label: chalk200.magenta("merged"), date: pr.mergedAt } : null,
|
|
32543
|
+
CLOSED: (pr) => pr.closedAt ? { label: chalk200.red("closed"), date: pr.closedAt } : null
|
|
32428
32544
|
};
|
|
32429
32545
|
function defaultStatus(pr) {
|
|
32430
|
-
return { label:
|
|
32546
|
+
return { label: chalk200.green("opened"), date: pr.createdAt };
|
|
32431
32547
|
}
|
|
32432
32548
|
function getStatus2(pr) {
|
|
32433
32549
|
return STATUS_MAP[pr.state]?.(pr) ?? defaultStatus(pr);
|
|
32434
32550
|
}
|
|
32435
|
-
function
|
|
32551
|
+
function formatDate2(dateStr) {
|
|
32436
32552
|
return new Date(dateStr).toISOString().split("T")[0];
|
|
32437
32553
|
}
|
|
32438
32554
|
function formatPrHeader(pr, status2) {
|
|
32439
|
-
return `${
|
|
32555
|
+
return `${chalk200.cyan(`#${pr.number}`)} ${pr.title} ${chalk200.dim(`(${pr.author.login},`)} ${status2.label} ${chalk200.dim(`${formatDate2(status2.date)})`)}`;
|
|
32440
32556
|
}
|
|
32441
32557
|
function logPrDetails(pr) {
|
|
32442
32558
|
console.log(
|
|
32443
|
-
|
|
32559
|
+
chalk200.dim(` ${pr.changedFiles.toLocaleString()} files | ${pr.url}`)
|
|
32444
32560
|
);
|
|
32445
32561
|
console.log();
|
|
32446
32562
|
}
|
|
@@ -32620,9 +32736,9 @@ async function comment2(path109, line, body, options2 = {}) {
|
|
|
32620
32736
|
|
|
32621
32737
|
// src/commands/prs/commentsCachePath.ts
|
|
32622
32738
|
import { homedir as homedir26 } from "os";
|
|
32623
|
-
import { join as
|
|
32739
|
+
import { join as join83 } from "path";
|
|
32624
32740
|
function commentsCachePath(org, repo, prNumber) {
|
|
32625
|
-
return
|
|
32741
|
+
return join83(
|
|
32626
32742
|
homedir26(),
|
|
32627
32743
|
".assist",
|
|
32628
32744
|
"pr-comments",
|
|
@@ -32657,19 +32773,19 @@ function deleteCommentsCache(org, repo, prNumber) {
|
|
|
32657
32773
|
}
|
|
32658
32774
|
|
|
32659
32775
|
// src/commands/prs/removeStaleCommentsCaches.ts
|
|
32660
|
-
import { readdirSync as
|
|
32661
|
-
import { join as
|
|
32776
|
+
import { readdirSync as readdirSync14, unlinkSync as unlinkSync16 } from "fs";
|
|
32777
|
+
import { join as join84 } from "path";
|
|
32662
32778
|
var STALE_PATTERN = /^pr-\d+-comments\.yaml$/;
|
|
32663
32779
|
function removeStaleCommentsCaches(cwd = process.cwd()) {
|
|
32664
|
-
const dir =
|
|
32780
|
+
const dir = join84(cwd, ".assist");
|
|
32665
32781
|
let entries;
|
|
32666
32782
|
try {
|
|
32667
|
-
entries =
|
|
32783
|
+
entries = readdirSync14(dir);
|
|
32668
32784
|
} catch {
|
|
32669
32785
|
return;
|
|
32670
32786
|
}
|
|
32671
32787
|
for (const entry of entries.filter((e) => STALE_PATTERN.test(e))) {
|
|
32672
|
-
unlinkSync16(
|
|
32788
|
+
unlinkSync16(join84(dir, entry));
|
|
32673
32789
|
}
|
|
32674
32790
|
}
|
|
32675
32791
|
|
|
@@ -32787,7 +32903,7 @@ function failAzureDevops(error) {
|
|
|
32787
32903
|
import { execFileSync as execFileSync20 } from "child_process";
|
|
32788
32904
|
import { mkdtempSync as mkdtempSync2, rmSync as rmSync6, writeFileSync as writeFileSync40 } from "fs";
|
|
32789
32905
|
import { tmpdir as tmpdir6 } from "os";
|
|
32790
|
-
import { join as
|
|
32906
|
+
import { join as join85 } from "path";
|
|
32791
32907
|
function azDevopsInvokeArgs(request, inFile) {
|
|
32792
32908
|
return [
|
|
32793
32909
|
"devops",
|
|
@@ -32822,8 +32938,8 @@ function runAz2(args) {
|
|
|
32822
32938
|
}
|
|
32823
32939
|
function invokeAzDevops(request) {
|
|
32824
32940
|
if (request.body === void 0) return runAz2(azDevopsInvokeArgs(request));
|
|
32825
|
-
const dir = mkdtempSync2(
|
|
32826
|
-
const inFile =
|
|
32941
|
+
const dir = mkdtempSync2(join85(tmpdir6(), "assist-az-"));
|
|
32942
|
+
const inFile = join85(dir, "body.json");
|
|
32827
32943
|
try {
|
|
32828
32944
|
writeFileSync40(inFile, JSON.stringify(request.body));
|
|
32829
32945
|
return runAz2(azDevopsInvokeArgs(request, inFile));
|
|
@@ -33009,13 +33125,13 @@ function agentFooter(unresolvedCount) {
|
|
|
33009
33125
|
}
|
|
33010
33126
|
|
|
33011
33127
|
// src/commands/prs/listComments/commentStyle.ts
|
|
33012
|
-
import
|
|
33128
|
+
import chalk201 from "chalk";
|
|
33013
33129
|
var plain = (text18) => text18;
|
|
33014
33130
|
function colouredState(state) {
|
|
33015
33131
|
const label = `[${state}]`;
|
|
33016
|
-
if (state === "APPROVED") return
|
|
33017
|
-
if (state === "CHANGES_REQUESTED") return
|
|
33018
|
-
return
|
|
33132
|
+
if (state === "APPROVED") return chalk201.green(label);
|
|
33133
|
+
if (state === "CHANGES_REQUESTED") return chalk201.red(label);
|
|
33134
|
+
return chalk201.yellow(label);
|
|
33019
33135
|
}
|
|
33020
33136
|
function commentStyle() {
|
|
33021
33137
|
if (isClaudeCode()) {
|
|
@@ -33029,9 +33145,9 @@ function commentStyle() {
|
|
|
33029
33145
|
};
|
|
33030
33146
|
}
|
|
33031
33147
|
return {
|
|
33032
|
-
cyan:
|
|
33033
|
-
bold:
|
|
33034
|
-
dim:
|
|
33148
|
+
cyan: chalk201.cyan,
|
|
33149
|
+
bold: chalk201.bold,
|
|
33150
|
+
dim: chalk201.dim,
|
|
33035
33151
|
state: colouredState,
|
|
33036
33152
|
diffHunk: true,
|
|
33037
33153
|
agent: false
|
|
@@ -34505,16 +34621,16 @@ function buildPrsStatusReport(repoArguments, now = Date.now()) {
|
|
|
34505
34621
|
}
|
|
34506
34622
|
|
|
34507
34623
|
// src/commands/prs/status/printPrsStatus.ts
|
|
34508
|
-
import
|
|
34624
|
+
import chalk203 from "chalk";
|
|
34509
34625
|
|
|
34510
34626
|
// src/commands/prs/status/printPrStatus.ts
|
|
34511
|
-
import
|
|
34627
|
+
import chalk202 from "chalk";
|
|
34512
34628
|
function flags(pr) {
|
|
34513
34629
|
const markers = [];
|
|
34514
34630
|
if (pr.isDraft) markers.push("draft");
|
|
34515
34631
|
if (pr.isDoNotMerge) markers.push("do not merge");
|
|
34516
34632
|
if (pr.isBot) markers.push("bot");
|
|
34517
|
-
return markers.length ? ` ${
|
|
34633
|
+
return markers.length ? ` ${chalk202.yellow(`[${markers.join(", ")}]`)}` : "";
|
|
34518
34634
|
}
|
|
34519
34635
|
function updated(pr) {
|
|
34520
34636
|
return pr.ageHours === null ? "updated unknown" : `updated ${pr.age} ago`;
|
|
@@ -34528,35 +34644,35 @@ function reviewLine(pr) {
|
|
|
34528
34644
|
function checkLines(pr) {
|
|
34529
34645
|
const lines2 = [];
|
|
34530
34646
|
if (pr.checks.failing.length) {
|
|
34531
|
-
lines2.push(
|
|
34647
|
+
lines2.push(chalk202.red(`failing: ${pr.checks.failing.join(", ")}`));
|
|
34532
34648
|
}
|
|
34533
34649
|
if (pr.checks.pending.length) {
|
|
34534
|
-
lines2.push(
|
|
34650
|
+
lines2.push(chalk202.yellow(`pending: ${pr.checks.pending.join(", ")}`));
|
|
34535
34651
|
}
|
|
34536
34652
|
return lines2;
|
|
34537
34653
|
}
|
|
34538
34654
|
function threadsLine(pr) {
|
|
34539
34655
|
if (pr.unresolvedThreads === null) {
|
|
34540
|
-
return
|
|
34656
|
+
return chalk202.dim("unresolved comments: unknown");
|
|
34541
34657
|
}
|
|
34542
34658
|
if (pr.unresolvedThreads === 0) return null;
|
|
34543
|
-
return
|
|
34659
|
+
return chalk202.yellow(`unresolved comments: ${pr.unresolvedThreads}`);
|
|
34544
34660
|
}
|
|
34545
34661
|
function mergeableLine(pr) {
|
|
34546
|
-
if (pr.mergeable === "CONFLICTING") return
|
|
34662
|
+
if (pr.mergeable === "CONFLICTING") return chalk202.red("conflicting");
|
|
34547
34663
|
if (pr.mergeable === "MERGEABLE") return null;
|
|
34548
|
-
return
|
|
34664
|
+
return chalk202.dim(`mergeable: ${pr.mergeable.toLowerCase()}`);
|
|
34549
34665
|
}
|
|
34550
34666
|
function printPrStatus(pr) {
|
|
34551
34667
|
console.log(
|
|
34552
|
-
` ${
|
|
34668
|
+
` ${chalk202.cyan(`#${pr.number}`)} ${pr.title} ${chalk202.dim(`(${pr.author}, ${updated(pr)})`)}${flags(pr)}`
|
|
34553
34669
|
);
|
|
34554
34670
|
const details = [
|
|
34555
34671
|
reviewLine(pr),
|
|
34556
34672
|
...checkLines(pr),
|
|
34557
34673
|
threadsLine(pr),
|
|
34558
34674
|
mergeableLine(pr),
|
|
34559
|
-
|
|
34675
|
+
chalk202.dim(pr.url)
|
|
34560
34676
|
];
|
|
34561
34677
|
for (const detail of details) {
|
|
34562
34678
|
if (detail) console.log(` ${detail}`);
|
|
@@ -34567,17 +34683,17 @@ function printPrStatus(pr) {
|
|
|
34567
34683
|
function printPrsStatus(report) {
|
|
34568
34684
|
for (const repo of report.repos) {
|
|
34569
34685
|
const count10 = repo.pullRequests.length;
|
|
34570
|
-
console.log(`${
|
|
34686
|
+
console.log(`${chalk203.bold(repo.repo)} ${chalk203.dim(`(${count10} open)`)}`);
|
|
34571
34687
|
for (const pr of repo.pullRequests) {
|
|
34572
34688
|
printPrStatus(pr);
|
|
34573
34689
|
}
|
|
34574
|
-
if (count10 === 0) console.log(
|
|
34690
|
+
if (count10 === 0) console.log(chalk203.dim(" no open pull requests"));
|
|
34575
34691
|
console.log();
|
|
34576
34692
|
}
|
|
34577
34693
|
if (report.errors.length === 0) return;
|
|
34578
|
-
console.log(
|
|
34694
|
+
console.log(chalk203.bold("Errors"));
|
|
34579
34695
|
for (const failure of report.errors) {
|
|
34580
|
-
console.log(` ${
|
|
34696
|
+
console.log(` ${chalk203.red(failure.repo)}: ${failure.error}`);
|
|
34581
34697
|
}
|
|
34582
34698
|
console.log();
|
|
34583
34699
|
}
|
|
@@ -34805,10 +34921,10 @@ function registerPrs(program) {
|
|
|
34805
34921
|
}
|
|
34806
34922
|
|
|
34807
34923
|
// src/commands/ravendb/ravendbAuth.ts
|
|
34808
|
-
import
|
|
34924
|
+
import chalk209 from "chalk";
|
|
34809
34925
|
|
|
34810
34926
|
// src/shared/createConnectionAuth.ts
|
|
34811
|
-
import
|
|
34927
|
+
import chalk204 from "chalk";
|
|
34812
34928
|
function listConnections(connections, format3) {
|
|
34813
34929
|
if (connections.length === 0) {
|
|
34814
34930
|
console.log("No connections configured.");
|
|
@@ -34821,7 +34937,7 @@ function listConnections(connections, format3) {
|
|
|
34821
34937
|
function removeConnection(connections, name, save) {
|
|
34822
34938
|
const filtered = connections.filter((c) => c.name !== name);
|
|
34823
34939
|
if (filtered.length === connections.length) {
|
|
34824
|
-
console.error(
|
|
34940
|
+
console.error(chalk204.red(`Connection "${name}" not found.`));
|
|
34825
34941
|
process.exit(1);
|
|
34826
34942
|
}
|
|
34827
34943
|
save(filtered);
|
|
@@ -34867,15 +34983,15 @@ function saveConnections(connections) {
|
|
|
34867
34983
|
}
|
|
34868
34984
|
|
|
34869
34985
|
// src/commands/ravendb/promptConnection.ts
|
|
34870
|
-
import
|
|
34986
|
+
import chalk207 from "chalk";
|
|
34871
34987
|
|
|
34872
34988
|
// src/commands/ravendb/selectOpSecret.ts
|
|
34873
|
-
import
|
|
34989
|
+
import chalk206 from "chalk";
|
|
34874
34990
|
import Enquirer2 from "enquirer";
|
|
34875
34991
|
|
|
34876
34992
|
// src/commands/ravendb/searchItems.ts
|
|
34877
34993
|
import { execSync as execSync48 } from "child_process";
|
|
34878
|
-
import
|
|
34994
|
+
import chalk205 from "chalk";
|
|
34879
34995
|
function opExec(args) {
|
|
34880
34996
|
return execSync48(`op ${args}`, {
|
|
34881
34997
|
encoding: "utf8",
|
|
@@ -34888,7 +35004,7 @@ function searchItems(search2) {
|
|
|
34888
35004
|
items2 = JSON.parse(opExec("item list --format=json"));
|
|
34889
35005
|
} catch {
|
|
34890
35006
|
console.error(
|
|
34891
|
-
|
|
35007
|
+
chalk205.red(
|
|
34892
35008
|
"Failed to search 1Password. Ensure the CLI is installed and you are signed in."
|
|
34893
35009
|
)
|
|
34894
35010
|
);
|
|
@@ -34902,7 +35018,7 @@ function getItemFields(itemId2) {
|
|
|
34902
35018
|
const item = JSON.parse(opExec(`item get "${itemId2}" --format=json`));
|
|
34903
35019
|
return item.fields.filter((f) => f.reference && f.label);
|
|
34904
35020
|
} catch {
|
|
34905
|
-
console.error(
|
|
35021
|
+
console.error(chalk205.red("Failed to get item details from 1Password."));
|
|
34906
35022
|
process.exit(1);
|
|
34907
35023
|
}
|
|
34908
35024
|
}
|
|
@@ -34921,7 +35037,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
34921
35037
|
}).run();
|
|
34922
35038
|
const items2 = searchItems(search2);
|
|
34923
35039
|
if (items2.length === 0) {
|
|
34924
|
-
console.error(
|
|
35040
|
+
console.error(chalk206.red(`No items found matching "${search2}".`));
|
|
34925
35041
|
process.exit(1);
|
|
34926
35042
|
}
|
|
34927
35043
|
const itemId2 = await selectOne(
|
|
@@ -34930,7 +35046,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
34930
35046
|
);
|
|
34931
35047
|
const fields = getItemFields(itemId2);
|
|
34932
35048
|
if (fields.length === 0) {
|
|
34933
|
-
console.error(
|
|
35049
|
+
console.error(chalk206.red("No fields with references found on this item."));
|
|
34934
35050
|
process.exit(1);
|
|
34935
35051
|
}
|
|
34936
35052
|
const ref = await selectOne(
|
|
@@ -34944,7 +35060,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
34944
35060
|
async function promptConnection(existingNames) {
|
|
34945
35061
|
const name = await promptInput("name", "Connection name:");
|
|
34946
35062
|
if (existingNames.includes(name)) {
|
|
34947
|
-
console.error(
|
|
35063
|
+
console.error(chalk207.red(`Connection "${name}" already exists.`));
|
|
34948
35064
|
process.exit(1);
|
|
34949
35065
|
}
|
|
34950
35066
|
const url = await promptInput(
|
|
@@ -34953,22 +35069,22 @@ async function promptConnection(existingNames) {
|
|
|
34953
35069
|
);
|
|
34954
35070
|
const database = await promptInput("database", "Database name:");
|
|
34955
35071
|
if (!name || !url || !database) {
|
|
34956
|
-
console.error(
|
|
35072
|
+
console.error(chalk207.red("All fields are required."));
|
|
34957
35073
|
process.exit(1);
|
|
34958
35074
|
}
|
|
34959
35075
|
const apiKeyRef = await selectOpSecret();
|
|
34960
|
-
console.log(
|
|
35076
|
+
console.log(chalk207.dim(`Using: ${apiKeyRef}`));
|
|
34961
35077
|
return { name, url, database, apiKeyRef };
|
|
34962
35078
|
}
|
|
34963
35079
|
|
|
34964
35080
|
// src/commands/ravendb/ravendbSetConnection.ts
|
|
34965
|
-
import
|
|
35081
|
+
import chalk208 from "chalk";
|
|
34966
35082
|
function ravendbSetConnection(name) {
|
|
34967
35083
|
const raw = loadGlobalConfigRaw();
|
|
34968
35084
|
const ravendb = raw.ravendb ?? {};
|
|
34969
35085
|
const connections = ravendb.connections ?? [];
|
|
34970
35086
|
if (!connections.some((c) => c.name === name)) {
|
|
34971
|
-
console.error(
|
|
35087
|
+
console.error(chalk208.red(`Connection "${name}" not found.`));
|
|
34972
35088
|
console.error(
|
|
34973
35089
|
`Available: ${connections.map((c) => c.name).join(", ") || "(none)"}`
|
|
34974
35090
|
);
|
|
@@ -34984,16 +35100,16 @@ function ravendbSetConnection(name) {
|
|
|
34984
35100
|
var ravendbAuth = createConnectionAuth({
|
|
34985
35101
|
load: loadConnections,
|
|
34986
35102
|
save: saveConnections,
|
|
34987
|
-
format: (c) => `${
|
|
35103
|
+
format: (c) => `${chalk209.bold(c.name)} ${c.url} db=${c.database} key=${c.apiKeyRef}`,
|
|
34988
35104
|
promptNew: promptConnection,
|
|
34989
35105
|
onFirst: (c) => ravendbSetConnection(c.name)
|
|
34990
35106
|
});
|
|
34991
35107
|
|
|
34992
35108
|
// src/commands/ravendb/ravendbCollections.ts
|
|
34993
|
-
import
|
|
35109
|
+
import chalk213 from "chalk";
|
|
34994
35110
|
|
|
34995
35111
|
// src/commands/ravendb/ravenFetch.ts
|
|
34996
|
-
import
|
|
35112
|
+
import chalk211 from "chalk";
|
|
34997
35113
|
|
|
34998
35114
|
// src/commands/ravendb/getAccessToken.ts
|
|
34999
35115
|
var OAUTH_URL = "https://amazon-useast-1-oauth.ravenhq.com/ApiKeys/OAuth/AccessToken";
|
|
@@ -35030,10 +35146,10 @@ ${errorText}`
|
|
|
35030
35146
|
|
|
35031
35147
|
// src/commands/ravendb/resolveOpSecret.ts
|
|
35032
35148
|
import { execSync as execSync49 } from "child_process";
|
|
35033
|
-
import
|
|
35149
|
+
import chalk210 from "chalk";
|
|
35034
35150
|
function resolveOpSecret(reference) {
|
|
35035
35151
|
if (!reference.startsWith("op://")) {
|
|
35036
|
-
console.error(
|
|
35152
|
+
console.error(chalk210.red(`Invalid secret reference: must start with op://`));
|
|
35037
35153
|
process.exit(1);
|
|
35038
35154
|
}
|
|
35039
35155
|
try {
|
|
@@ -35043,7 +35159,7 @@ function resolveOpSecret(reference) {
|
|
|
35043
35159
|
}).trim();
|
|
35044
35160
|
} catch {
|
|
35045
35161
|
console.error(
|
|
35046
|
-
|
|
35162
|
+
chalk210.red(
|
|
35047
35163
|
"Failed to resolve secret reference. Ensure 1Password CLI is installed and you are signed in."
|
|
35048
35164
|
)
|
|
35049
35165
|
);
|
|
@@ -35070,7 +35186,7 @@ async function ravenFetch(connection, path109) {
|
|
|
35070
35186
|
if (!response.ok) {
|
|
35071
35187
|
const body = await response.text();
|
|
35072
35188
|
console.error(
|
|
35073
|
-
|
|
35189
|
+
chalk211.red(`RavenDB error: ${response.status} ${response.statusText}`)
|
|
35074
35190
|
);
|
|
35075
35191
|
console.error(body.substring(0, 500));
|
|
35076
35192
|
process.exit(1);
|
|
@@ -35079,7 +35195,7 @@ async function ravenFetch(connection, path109) {
|
|
|
35079
35195
|
}
|
|
35080
35196
|
|
|
35081
35197
|
// src/commands/ravendb/resolveConnection.ts
|
|
35082
|
-
import
|
|
35198
|
+
import chalk212 from "chalk";
|
|
35083
35199
|
function loadRavendb() {
|
|
35084
35200
|
const raw = loadGlobalConfigRaw();
|
|
35085
35201
|
const ravendb = raw.ravendb;
|
|
@@ -35093,7 +35209,7 @@ function resolveConnection(name) {
|
|
|
35093
35209
|
const connectionName = name ?? defaultConnection;
|
|
35094
35210
|
if (!connectionName) {
|
|
35095
35211
|
console.error(
|
|
35096
|
-
|
|
35212
|
+
chalk212.red(
|
|
35097
35213
|
"No connection specified and no default set. Use assist ravendb set-connection <name> or pass a connection name."
|
|
35098
35214
|
)
|
|
35099
35215
|
);
|
|
@@ -35101,7 +35217,7 @@ function resolveConnection(name) {
|
|
|
35101
35217
|
}
|
|
35102
35218
|
const connection = connections.find((c) => c.name === connectionName);
|
|
35103
35219
|
if (!connection) {
|
|
35104
|
-
console.error(
|
|
35220
|
+
console.error(chalk212.red(`Connection "${connectionName}" not found.`));
|
|
35105
35221
|
console.error(
|
|
35106
35222
|
`Available: ${connections.map((c) => c.name).join(", ") || "(none)"}`
|
|
35107
35223
|
);
|
|
@@ -35132,15 +35248,15 @@ async function ravendbCollections(connectionName) {
|
|
|
35132
35248
|
return;
|
|
35133
35249
|
}
|
|
35134
35250
|
for (const c of collections) {
|
|
35135
|
-
console.log(`${
|
|
35251
|
+
console.log(`${chalk213.bold(c.Name)} ${c.CountOfDocuments} docs`);
|
|
35136
35252
|
}
|
|
35137
35253
|
}
|
|
35138
35254
|
|
|
35139
35255
|
// src/commands/ravendb/ravendbQuery.ts
|
|
35140
|
-
import
|
|
35256
|
+
import chalk215 from "chalk";
|
|
35141
35257
|
|
|
35142
35258
|
// src/commands/ravendb/fetchAllPages.ts
|
|
35143
|
-
import
|
|
35259
|
+
import chalk214 from "chalk";
|
|
35144
35260
|
|
|
35145
35261
|
// src/commands/ravendb/buildQueryPath.ts
|
|
35146
35262
|
function buildQueryPath(opts) {
|
|
@@ -35178,7 +35294,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
35178
35294
|
allResults.push(...results);
|
|
35179
35295
|
start2 += results.length;
|
|
35180
35296
|
process.stderr.write(
|
|
35181
|
-
`\r${
|
|
35297
|
+
`\r${chalk214.dim(`Fetched ${allResults.length}/${totalResults}`)}`
|
|
35182
35298
|
);
|
|
35183
35299
|
if (start2 >= totalResults) break;
|
|
35184
35300
|
if (opts.limit !== void 0 && allResults.length >= opts.limit) break;
|
|
@@ -35193,7 +35309,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
35193
35309
|
async function ravendbQuery(connectionName, collection, options2) {
|
|
35194
35310
|
const resolved = resolveArgs(connectionName, collection);
|
|
35195
35311
|
if (!resolved.collection && !options2.query) {
|
|
35196
|
-
console.error(
|
|
35312
|
+
console.error(chalk215.red("Provide a collection name or --query filter."));
|
|
35197
35313
|
process.exit(1);
|
|
35198
35314
|
}
|
|
35199
35315
|
const { collection: col } = resolved;
|
|
@@ -35228,7 +35344,7 @@ function registerRavendb(program) {
|
|
|
35228
35344
|
}
|
|
35229
35345
|
|
|
35230
35346
|
// src/commands/releases/releasesConfigure.ts
|
|
35231
|
-
import
|
|
35347
|
+
import chalk217 from "chalk";
|
|
35232
35348
|
|
|
35233
35349
|
// src/commands/config/parseRepoScopeFlag.ts
|
|
35234
35350
|
var REPO_SCOPE_FLAGS = {
|
|
@@ -35299,26 +35415,26 @@ function readStreamsInput(source) {
|
|
|
35299
35415
|
}
|
|
35300
35416
|
|
|
35301
35417
|
// src/commands/releases/reportDerivedStreams.ts
|
|
35302
|
-
import
|
|
35418
|
+
import chalk216 from "chalk";
|
|
35303
35419
|
function printDerived(stream) {
|
|
35304
35420
|
const environments = stream.nodes.flatMap((n) => n.environment ?? []);
|
|
35305
35421
|
const steps = stream.nodes.filter((n) => !n.environment);
|
|
35306
35422
|
console.log(
|
|
35307
|
-
`${
|
|
35423
|
+
`${chalk216.bold(stream.name)} ${chalk216.dim(`${stream.repo} \xB7 ${stream.workflow}`)}`
|
|
35308
35424
|
);
|
|
35309
35425
|
console.log(
|
|
35310
|
-
` environments: ${environments.join(", ") ||
|
|
35426
|
+
` environments: ${environments.join(", ") || chalk216.dim("none")}`
|
|
35311
35427
|
);
|
|
35312
35428
|
if (steps.length > 0)
|
|
35313
35429
|
console.log(
|
|
35314
35430
|
` steps: ${steps.map((n) => `${n.id} [${n.kind ?? "step"}]`).join(", ")}`
|
|
35315
35431
|
);
|
|
35316
35432
|
const edges = stream.edges.map(([from, to]) => `${from} \u2192 ${to}`);
|
|
35317
|
-
console.log(` edges: ${edges.join(", ") ||
|
|
35433
|
+
console.log(` edges: ${edges.join(", ") || chalk216.dim("none")}`);
|
|
35318
35434
|
}
|
|
35319
35435
|
function reportDerivedStreams(streams, target) {
|
|
35320
35436
|
for (const stream of streams) printDerived(stream);
|
|
35321
|
-
console.log(
|
|
35437
|
+
console.log(chalk216.dim(`Written to ${target}`));
|
|
35322
35438
|
}
|
|
35323
35439
|
|
|
35324
35440
|
// src/commands/releases/withCurrentRepo.ts
|
|
@@ -35409,8 +35525,8 @@ async function writeReleaseStreams(incoming, scope) {
|
|
|
35409
35525
|
|
|
35410
35526
|
// src/commands/releases/releasesConfigure.ts
|
|
35411
35527
|
function fail8(message3, details = []) {
|
|
35412
|
-
console.error(
|
|
35413
|
-
for (const detail of details) console.error(
|
|
35528
|
+
console.error(chalk217.red(message3));
|
|
35529
|
+
for (const detail of details) console.error(chalk217.red(` ${detail}`));
|
|
35414
35530
|
process.exitCode = 1;
|
|
35415
35531
|
}
|
|
35416
35532
|
function reportWritten(incoming, target) {
|
|
@@ -35443,23 +35559,23 @@ async function releasesConfigure(options2 = {}) {
|
|
|
35443
35559
|
}
|
|
35444
35560
|
|
|
35445
35561
|
// src/commands/releases/releasesList.ts
|
|
35446
|
-
import
|
|
35562
|
+
import chalk218 from "chalk";
|
|
35447
35563
|
function describeNode(node) {
|
|
35448
35564
|
if (node.environment) return `${node.id} \u2192 ${node.environment}`;
|
|
35449
35565
|
return `${node.id} (${node.kind ?? "step"})`;
|
|
35450
35566
|
}
|
|
35451
35567
|
function printStream(stream) {
|
|
35452
|
-
console.log(`${
|
|
35453
|
-
console.log(
|
|
35568
|
+
console.log(`${chalk218.bold(stream.name)} ${chalk218.dim(stream.repo)}`);
|
|
35569
|
+
console.log(chalk218.dim(` workflow: ${stream.workflow}`));
|
|
35454
35570
|
for (const node of stream.nodes) console.log(` ${describeNode(node)}`);
|
|
35455
35571
|
for (const [from, to] of stream.edges)
|
|
35456
|
-
console.log(
|
|
35572
|
+
console.log(chalk218.dim(` ${from} \u2192 ${to}`));
|
|
35457
35573
|
}
|
|
35458
35574
|
function releasesList() {
|
|
35459
35575
|
const streams = loadConfig().releases?.streams ?? [];
|
|
35460
35576
|
if (streams.length === 0) {
|
|
35461
35577
|
console.log(
|
|
35462
|
-
|
|
35578
|
+
chalk218.dim("No release streams configured under releases.streams.")
|
|
35463
35579
|
);
|
|
35464
35580
|
return;
|
|
35465
35581
|
}
|
|
@@ -35507,7 +35623,7 @@ function coverage() {
|
|
|
35507
35623
|
|
|
35508
35624
|
// src/commands/lint/lint/runFileNameCheck.ts
|
|
35509
35625
|
import path45 from "path";
|
|
35510
|
-
import
|
|
35626
|
+
import chalk220 from "chalk";
|
|
35511
35627
|
|
|
35512
35628
|
// src/commands/lint/lint/checkFileNames.ts
|
|
35513
35629
|
import fs23 from "fs";
|
|
@@ -35587,7 +35703,7 @@ function checkFileNames() {
|
|
|
35587
35703
|
}
|
|
35588
35704
|
|
|
35589
35705
|
// src/commands/lint/lint/fixFileNameViolations.ts
|
|
35590
|
-
import
|
|
35706
|
+
import chalk219 from "chalk";
|
|
35591
35707
|
|
|
35592
35708
|
// src/commands/lint/lint/applyMoves.ts
|
|
35593
35709
|
import fs24 from "fs";
|
|
@@ -35672,25 +35788,25 @@ function fixFileNameViolations(moves) {
|
|
|
35672
35788
|
const start2 = performance.now();
|
|
35673
35789
|
const project = createLintProject();
|
|
35674
35790
|
const cwd = process.cwd();
|
|
35675
|
-
applyMoves(project, moves, cwd, (line) => console.log(
|
|
35791
|
+
applyMoves(project, moves, cwd, (line) => console.log(chalk219.green(line)));
|
|
35676
35792
|
const ms = (performance.now() - start2).toFixed(0);
|
|
35677
|
-
console.log(
|
|
35793
|
+
console.log(chalk219.dim(` Done in ${ms}ms`));
|
|
35678
35794
|
}
|
|
35679
35795
|
|
|
35680
35796
|
// src/commands/lint/lint/runFileNameCheck.ts
|
|
35681
35797
|
function reportViolations(violations) {
|
|
35682
|
-
console.error(
|
|
35798
|
+
console.error(chalk220.red("\nFile name check failed:\n"));
|
|
35683
35799
|
console.error(
|
|
35684
|
-
|
|
35800
|
+
chalk220.red(
|
|
35685
35801
|
" Files without classes or React components should not start with a capital letter.\n"
|
|
35686
35802
|
)
|
|
35687
35803
|
);
|
|
35688
35804
|
for (const violation of violations) {
|
|
35689
|
-
console.error(
|
|
35690
|
-
console.error(
|
|
35805
|
+
console.error(chalk220.red(` ${violation.filePath}`));
|
|
35806
|
+
console.error(chalk220.gray(` Rename to: ${violation.suggestedName}
|
|
35691
35807
|
`));
|
|
35692
35808
|
}
|
|
35693
|
-
console.error(
|
|
35809
|
+
console.error(chalk220.dim(" Run with -f to auto-fix.\n"));
|
|
35694
35810
|
}
|
|
35695
35811
|
function runFileNameCheck(fix = false) {
|
|
35696
35812
|
const violations = checkFileNames();
|
|
@@ -35719,17 +35835,17 @@ function runFileNameCheck(fix = false) {
|
|
|
35719
35835
|
import fs26 from "fs";
|
|
35720
35836
|
|
|
35721
35837
|
// src/commands/lint/shared.ts
|
|
35722
|
-
import
|
|
35838
|
+
import chalk221 from "chalk";
|
|
35723
35839
|
function reportViolations2(violations, checkName2, errorMessage3, successMessage) {
|
|
35724
35840
|
if (violations.length > 0) {
|
|
35725
|
-
console.error(
|
|
35841
|
+
console.error(chalk221.red(`
|
|
35726
35842
|
${checkName2} failed:
|
|
35727
35843
|
`));
|
|
35728
|
-
console.error(
|
|
35844
|
+
console.error(chalk221.red(` ${errorMessage3}
|
|
35729
35845
|
`));
|
|
35730
35846
|
for (const violation of violations) {
|
|
35731
|
-
console.error(
|
|
35732
|
-
console.error(
|
|
35847
|
+
console.error(chalk221.red(` ${violation.filePath}:${violation.line}`));
|
|
35848
|
+
console.error(chalk221.gray(` ${violation.content}
|
|
35733
35849
|
`));
|
|
35734
35850
|
}
|
|
35735
35851
|
return false;
|
|
@@ -35953,8 +36069,8 @@ async function notify() {
|
|
|
35953
36069
|
import { execSync as execSync51 } from "child_process";
|
|
35954
36070
|
import { existsSync as existsSync66, mkdirSync as mkdirSync26, unlinkSync as unlinkSync17, writeFileSync as writeFileSync41 } from "fs";
|
|
35955
36071
|
import { tmpdir as tmpdir7 } from "os";
|
|
35956
|
-
import { join as
|
|
35957
|
-
import
|
|
36072
|
+
import { join as join86, resolve as resolve25 } from "path";
|
|
36073
|
+
import chalk222 from "chalk";
|
|
35958
36074
|
|
|
35959
36075
|
// src/commands/screenshot/captureWindowPs1.ts
|
|
35960
36076
|
var captureWindowPs1 = `
|
|
@@ -36090,7 +36206,7 @@ function buildOutputPath(outputDir, processName) {
|
|
|
36090
36206
|
return resolve25(outputDir, `${processName}-${timestamp8}.png`);
|
|
36091
36207
|
}
|
|
36092
36208
|
function runPowerShellScript(processName, outputPath) {
|
|
36093
|
-
const scriptPath =
|
|
36209
|
+
const scriptPath = join86(tmpdir7(), `assist-screenshot-${Date.now()}.ps1`);
|
|
36094
36210
|
writeFileSync41(scriptPath, captureWindowPs1, "utf8");
|
|
36095
36211
|
try {
|
|
36096
36212
|
execSync51(
|
|
@@ -36105,22 +36221,22 @@ function screenshot(processName) {
|
|
|
36105
36221
|
const config = loadConfig();
|
|
36106
36222
|
const outputDir = resolve25(config.screenshot.outputDir);
|
|
36107
36223
|
const outputPath = buildOutputPath(outputDir, processName);
|
|
36108
|
-
console.log(
|
|
36224
|
+
console.log(chalk222.gray(`Capturing window for process "${processName}" ...`));
|
|
36109
36225
|
try {
|
|
36110
36226
|
runPowerShellScript(processName, outputPath);
|
|
36111
|
-
console.log(
|
|
36227
|
+
console.log(chalk222.green(`Screenshot saved: ${outputPath}`));
|
|
36112
36228
|
} catch (error) {
|
|
36113
36229
|
const msg = error instanceof Error ? error.message : String(error);
|
|
36114
|
-
console.error(
|
|
36230
|
+
console.error(chalk222.red(`Failed to capture screenshot: ${msg}`));
|
|
36115
36231
|
process.exit(1);
|
|
36116
36232
|
}
|
|
36117
36233
|
}
|
|
36118
36234
|
|
|
36119
36235
|
// src/commands/statusLine.ts
|
|
36120
|
-
import
|
|
36236
|
+
import chalk225 from "chalk";
|
|
36121
36237
|
|
|
36122
36238
|
// src/commands/buildLimitsSegment.ts
|
|
36123
|
-
import
|
|
36239
|
+
import chalk223 from "chalk";
|
|
36124
36240
|
|
|
36125
36241
|
// src/shared/rateLimitLevel.ts
|
|
36126
36242
|
var FIVE_HOUR_SECONDS = 5 * 3600;
|
|
@@ -36158,9 +36274,9 @@ function rateLimitLevel(pct, resetsAt, windowSeconds, now) {
|
|
|
36158
36274
|
|
|
36159
36275
|
// src/commands/buildLimitsSegment.ts
|
|
36160
36276
|
var LEVEL_COLOR = {
|
|
36161
|
-
ok:
|
|
36162
|
-
warn:
|
|
36163
|
-
over:
|
|
36277
|
+
ok: chalk223.green,
|
|
36278
|
+
warn: chalk223.yellow,
|
|
36279
|
+
over: chalk223.red
|
|
36164
36280
|
};
|
|
36165
36281
|
function formatLimit(pct, resetsAt, windowSeconds, fallbackLabel, now) {
|
|
36166
36282
|
const level = rateLimitLevel(pct, resetsAt, windowSeconds, now);
|
|
@@ -36192,9 +36308,9 @@ function buildLimitsSegment(rateLimits) {
|
|
|
36192
36308
|
|
|
36193
36309
|
// src/commands/readGitBranch.ts
|
|
36194
36310
|
import { readFileSync as readFileSync51, statSync as statSync10 } from "fs";
|
|
36195
|
-
import { isAbsolute as isAbsolute6, join as
|
|
36311
|
+
import { isAbsolute as isAbsolute6, join as join87, resolve as resolve26 } from "path";
|
|
36196
36312
|
function resolveGitDir(cwd) {
|
|
36197
|
-
const dotGit =
|
|
36313
|
+
const dotGit = join87(cwd, ".git");
|
|
36198
36314
|
let stat5;
|
|
36199
36315
|
try {
|
|
36200
36316
|
stat5 = statSync10(dotGit);
|
|
@@ -36224,7 +36340,7 @@ function readGitBranch(cwd) {
|
|
|
36224
36340
|
}
|
|
36225
36341
|
let head;
|
|
36226
36342
|
try {
|
|
36227
|
-
head = readFileSync51(
|
|
36343
|
+
head = readFileSync51(join87(gitDir, "HEAD"), "utf8");
|
|
36228
36344
|
} catch {
|
|
36229
36345
|
return null;
|
|
36230
36346
|
}
|
|
@@ -36256,7 +36372,7 @@ async function relayUsage(claudeSessionId, transcriptPath2, usedPct) {
|
|
|
36256
36372
|
}
|
|
36257
36373
|
|
|
36258
36374
|
// src/commands/colorizePercent.ts
|
|
36259
|
-
import
|
|
36375
|
+
import chalk224 from "chalk";
|
|
36260
36376
|
|
|
36261
36377
|
// src/shared/contextLevel.ts
|
|
36262
36378
|
var THRESHOLDS = {
|
|
@@ -36276,16 +36392,16 @@ function colorizePercent(pct) {
|
|
|
36276
36392
|
const label = `${Math.round(pct)}%`;
|
|
36277
36393
|
switch (contextLevel(pct)) {
|
|
36278
36394
|
case "red":
|
|
36279
|
-
return
|
|
36395
|
+
return chalk224.red(label);
|
|
36280
36396
|
case "yellow":
|
|
36281
|
-
return
|
|
36397
|
+
return chalk224.yellow(label);
|
|
36282
36398
|
default:
|
|
36283
36399
|
return label;
|
|
36284
36400
|
}
|
|
36285
36401
|
}
|
|
36286
36402
|
|
|
36287
36403
|
// src/commands/statusLine.ts
|
|
36288
|
-
|
|
36404
|
+
chalk225.level = 3;
|
|
36289
36405
|
function formatNumber(num) {
|
|
36290
36406
|
return num.toLocaleString("en-US");
|
|
36291
36407
|
}
|
|
@@ -36297,7 +36413,7 @@ async function statusLine() {
|
|
|
36297
36413
|
const usedPct = data.context_window.used_percentage ?? 0;
|
|
36298
36414
|
const dir = data.workspace?.current_dir ?? data.cwd;
|
|
36299
36415
|
const branch2 = dir ? readGitBranch(dir) : null;
|
|
36300
|
-
const branchSegment = branch2 ? `\u{1F33F}\uFE0F ${
|
|
36416
|
+
const branchSegment = branch2 ? `\u{1F33F}\uFE0F ${chalk225.cyan(branch2)} | ` : "";
|
|
36301
36417
|
const limitsSegment = process.env.ASSIST_SESSION === "1" ? "" : buildLimitsSegment(data.rate_limits);
|
|
36302
36418
|
console.log(
|
|
36303
36419
|
`${branchSegment}${model} | Tokens - ${formatNumber(totalIn)} \u2191 : ${formatNumber(totalOut)} \u2193 | Context - ${colorizePercent(usedPct)}${limitsSegment}`
|
|
@@ -36405,7 +36521,7 @@ import { spawn as spawn8 } from "child_process";
|
|
|
36405
36521
|
import * as path48 from "path";
|
|
36406
36522
|
|
|
36407
36523
|
// src/commands/refactor/logViolations.ts
|
|
36408
|
-
import
|
|
36524
|
+
import chalk226 from "chalk";
|
|
36409
36525
|
var DEFAULT_MAX_LINES2 = 100;
|
|
36410
36526
|
function logViolations(violations, maxLines = DEFAULT_MAX_LINES2) {
|
|
36411
36527
|
if (violations.length === 0) {
|
|
@@ -36414,43 +36530,43 @@ function logViolations(violations, maxLines = DEFAULT_MAX_LINES2) {
|
|
|
36414
36530
|
}
|
|
36415
36531
|
return;
|
|
36416
36532
|
}
|
|
36417
|
-
console.error(
|
|
36533
|
+
console.error(chalk226.red(`
|
|
36418
36534
|
Refactor check failed:
|
|
36419
36535
|
`));
|
|
36420
|
-
console.error(
|
|
36536
|
+
console.error(chalk226.red(` The following files exceed ${maxLines} lines:
|
|
36421
36537
|
`));
|
|
36422
36538
|
for (const violation of violations) {
|
|
36423
|
-
console.error(
|
|
36539
|
+
console.error(chalk226.red(` ${violation.file} (${violation.lines} lines)`));
|
|
36424
36540
|
}
|
|
36425
36541
|
console.error(
|
|
36426
|
-
|
|
36542
|
+
chalk226.yellow(
|
|
36427
36543
|
`
|
|
36428
36544
|
Each file needs to be sensibly refactored, or if there is no sensible
|
|
36429
36545
|
way to refactor it, ignore it with:
|
|
36430
36546
|
`
|
|
36431
36547
|
)
|
|
36432
36548
|
);
|
|
36433
|
-
console.error(
|
|
36549
|
+
console.error(chalk226.gray(` assist refactor ignore <file>
|
|
36434
36550
|
`));
|
|
36435
36551
|
if (process.env.CLAUDECODE) {
|
|
36436
|
-
console.error(
|
|
36552
|
+
console.error(chalk226.cyan(`
|
|
36437
36553
|
## Extracting Code to New Files
|
|
36438
36554
|
`));
|
|
36439
36555
|
console.error(
|
|
36440
|
-
|
|
36556
|
+
chalk226.cyan(
|
|
36441
36557
|
` When extracting logic from one file to another, consider where the extracted code belongs:
|
|
36442
36558
|
`
|
|
36443
36559
|
)
|
|
36444
36560
|
);
|
|
36445
36561
|
console.error(
|
|
36446
|
-
|
|
36562
|
+
chalk226.cyan(
|
|
36447
36563
|
` 1. Keep related logic together: If the extracted code is tightly coupled to the
|
|
36448
36564
|
original file's domain, create a new folder containing both the original and extracted files.
|
|
36449
36565
|
`
|
|
36450
36566
|
)
|
|
36451
36567
|
);
|
|
36452
36568
|
console.error(
|
|
36453
|
-
|
|
36569
|
+
chalk226.cyan(
|
|
36454
36570
|
` 2. Share common utilities: If the extracted code can be reused across multiple
|
|
36455
36571
|
domains, move it to a common/shared folder.
|
|
36456
36572
|
`
|
|
@@ -36606,7 +36722,7 @@ async function check(pattern2, options2) {
|
|
|
36606
36722
|
|
|
36607
36723
|
// src/commands/refactor/extract.ts
|
|
36608
36724
|
import path56 from "path";
|
|
36609
|
-
import
|
|
36725
|
+
import chalk229 from "chalk";
|
|
36610
36726
|
|
|
36611
36727
|
// src/commands/refactor/extract/applyExtraction.ts
|
|
36612
36728
|
import { SyntaxKind as SyntaxKind8 } from "ts-morph";
|
|
@@ -37214,23 +37330,23 @@ function buildPlan2(functionName, sourceFile, sourcePath, destPath, project) {
|
|
|
37214
37330
|
|
|
37215
37331
|
// src/commands/refactor/extract/displayPlan.ts
|
|
37216
37332
|
import path52 from "path";
|
|
37217
|
-
import
|
|
37333
|
+
import chalk227 from "chalk";
|
|
37218
37334
|
function section(title) {
|
|
37219
37335
|
return `
|
|
37220
|
-
${
|
|
37336
|
+
${chalk227.cyan(title)}`;
|
|
37221
37337
|
}
|
|
37222
37338
|
function displayImporters(plan2, cwd) {
|
|
37223
37339
|
if (plan2.importersToUpdate.length === 0) return;
|
|
37224
37340
|
console.log(section("Update importers:"));
|
|
37225
37341
|
for (const imp of plan2.importersToUpdate) {
|
|
37226
37342
|
const rel = path52.relative(cwd, imp.file.getFilePath());
|
|
37227
|
-
console.log(` ${
|
|
37343
|
+
console.log(` ${chalk227.dim(rel)}: \u2192 import from "${imp.relPath}"`);
|
|
37228
37344
|
}
|
|
37229
37345
|
}
|
|
37230
37346
|
function displayPlan(functionName, relDest, plan2, cwd) {
|
|
37231
|
-
console.log(
|
|
37347
|
+
console.log(chalk227.bold(`Extract: ${functionName} \u2192 ${relDest}
|
|
37232
37348
|
`));
|
|
37233
|
-
console.log(` ${
|
|
37349
|
+
console.log(` ${chalk227.cyan("Functions to move:")}`);
|
|
37234
37350
|
for (const name of plan2.extractedNames) {
|
|
37235
37351
|
console.log(` ${name}`);
|
|
37236
37352
|
}
|
|
@@ -37264,7 +37380,7 @@ function displayPlan(functionName, relDest, plan2, cwd) {
|
|
|
37264
37380
|
|
|
37265
37381
|
// src/commands/refactor/extract/loadProjectFile.ts
|
|
37266
37382
|
import path55 from "path";
|
|
37267
|
-
import
|
|
37383
|
+
import chalk228 from "chalk";
|
|
37268
37384
|
import { Project as Project4 } from "ts-morph";
|
|
37269
37385
|
|
|
37270
37386
|
// src/commands/refactor/extract/findTsConfig.ts
|
|
@@ -37356,7 +37472,7 @@ function loadProjectFile(file) {
|
|
|
37356
37472
|
});
|
|
37357
37473
|
const sourceFile = project.getSourceFile(sourcePath);
|
|
37358
37474
|
if (!sourceFile) {
|
|
37359
|
-
console.log(
|
|
37475
|
+
console.log(chalk228.red(`File not found in project: ${file}`));
|
|
37360
37476
|
process.exit(1);
|
|
37361
37477
|
}
|
|
37362
37478
|
return { project, sourceFile };
|
|
@@ -37379,19 +37495,19 @@ async function extract(file, functionName, destination, options2 = {}) {
|
|
|
37379
37495
|
displayPlan(functionName, relDest, plan2, cwd);
|
|
37380
37496
|
if (options2.apply) {
|
|
37381
37497
|
await applyExtraction(functionName, sourceFile, destPath, plan2, project);
|
|
37382
|
-
console.log(
|
|
37498
|
+
console.log(chalk229.green("\nExtraction complete"));
|
|
37383
37499
|
} else {
|
|
37384
|
-
console.log(
|
|
37500
|
+
console.log(chalk229.dim("\nDry run. Use --apply to execute."));
|
|
37385
37501
|
}
|
|
37386
37502
|
}
|
|
37387
37503
|
|
|
37388
37504
|
// src/commands/refactor/ignore.ts
|
|
37389
37505
|
import fs33 from "fs";
|
|
37390
|
-
import
|
|
37506
|
+
import chalk230 from "chalk";
|
|
37391
37507
|
var REFACTOR_YML_PATH2 = "refactor.yml";
|
|
37392
37508
|
function ignore2(file) {
|
|
37393
37509
|
if (!fs33.existsSync(file)) {
|
|
37394
|
-
console.error(
|
|
37510
|
+
console.error(chalk230.red(`Error: File does not exist: ${file}`));
|
|
37395
37511
|
process.exit(1);
|
|
37396
37512
|
}
|
|
37397
37513
|
const content = fs33.readFileSync(file, "utf8");
|
|
@@ -37407,7 +37523,7 @@ function ignore2(file) {
|
|
|
37407
37523
|
fs33.writeFileSync(REFACTOR_YML_PATH2, entry);
|
|
37408
37524
|
}
|
|
37409
37525
|
console.log(
|
|
37410
|
-
|
|
37526
|
+
chalk230.green(
|
|
37411
37527
|
`Added ${file} to refactor ignore list (max ${maxLines} lines)`
|
|
37412
37528
|
)
|
|
37413
37529
|
);
|
|
@@ -37416,12 +37532,12 @@ function ignore2(file) {
|
|
|
37416
37532
|
// src/commands/refactor/rename.ts
|
|
37417
37533
|
import fs36 from "fs";
|
|
37418
37534
|
import path62 from "path";
|
|
37419
|
-
import
|
|
37535
|
+
import chalk233 from "chalk";
|
|
37420
37536
|
|
|
37421
37537
|
// src/commands/refactor/rename/applyRename.ts
|
|
37422
37538
|
import fs35 from "fs";
|
|
37423
37539
|
import path58 from "path";
|
|
37424
|
-
import
|
|
37540
|
+
import chalk231 from "chalk";
|
|
37425
37541
|
|
|
37426
37542
|
// src/commands/refactor/restructure/computeRewrites.ts
|
|
37427
37543
|
import path57 from "path";
|
|
@@ -37527,13 +37643,13 @@ function applyRename(rewrites, sourcePath, destPath, cwd) {
|
|
|
37527
37643
|
const updatedContents = applyRewrites(rewrites);
|
|
37528
37644
|
for (const [file, content] of updatedContents) {
|
|
37529
37645
|
fs35.writeFileSync(file, content, "utf8");
|
|
37530
|
-
console.log(
|
|
37646
|
+
console.log(chalk231.cyan(` Updated imports in ${path58.relative(cwd, file)}`));
|
|
37531
37647
|
}
|
|
37532
37648
|
const destDir = path58.dirname(destPath);
|
|
37533
37649
|
if (!fs35.existsSync(destDir)) fs35.mkdirSync(destDir, { recursive: true });
|
|
37534
37650
|
fs35.renameSync(sourcePath, destPath);
|
|
37535
37651
|
console.log(
|
|
37536
|
-
|
|
37652
|
+
chalk231.white(
|
|
37537
37653
|
` Moved ${path58.relative(cwd, sourcePath)} \u2192 ${path58.relative(cwd, destPath)}`
|
|
37538
37654
|
)
|
|
37539
37655
|
);
|
|
@@ -37683,16 +37799,16 @@ function computeRenameRewrites(sourcePath, destPath) {
|
|
|
37683
37799
|
|
|
37684
37800
|
// src/commands/refactor/rename/printRenamePreview.ts
|
|
37685
37801
|
import path61 from "path";
|
|
37686
|
-
import
|
|
37802
|
+
import chalk232 from "chalk";
|
|
37687
37803
|
function printRenamePreview(rewrites, cwd) {
|
|
37688
37804
|
for (const rewrite of rewrites) {
|
|
37689
37805
|
console.log(
|
|
37690
|
-
|
|
37806
|
+
chalk232.dim(
|
|
37691
37807
|
` ${path61.relative(cwd, rewrite.file)}: ${rewrite.oldSpecifier} \u2192 ${rewrite.newSpecifier}`
|
|
37692
37808
|
)
|
|
37693
37809
|
);
|
|
37694
37810
|
}
|
|
37695
|
-
console.log(
|
|
37811
|
+
console.log(chalk232.dim("Dry run. Use --apply to execute."));
|
|
37696
37812
|
}
|
|
37697
37813
|
|
|
37698
37814
|
// src/commands/refactor/rename.ts
|
|
@@ -37703,20 +37819,20 @@ async function rename(source, destination, options2 = {}) {
|
|
|
37703
37819
|
const relSource = path62.relative(cwd, sourcePath);
|
|
37704
37820
|
const relDest = path62.relative(cwd, destPath);
|
|
37705
37821
|
if (!fs36.existsSync(sourcePath)) {
|
|
37706
|
-
console.log(
|
|
37822
|
+
console.log(chalk233.red(`File not found: ${source}`));
|
|
37707
37823
|
process.exit(1);
|
|
37708
37824
|
}
|
|
37709
37825
|
if (destPath !== sourcePath && fs36.existsSync(destPath)) {
|
|
37710
|
-
console.log(
|
|
37826
|
+
console.log(chalk233.red(`Destination already exists: ${destination}`));
|
|
37711
37827
|
process.exit(1);
|
|
37712
37828
|
}
|
|
37713
|
-
console.log(
|
|
37714
|
-
console.log(
|
|
37715
|
-
console.log(
|
|
37829
|
+
console.log(chalk233.bold(`Rename: ${relSource} \u2192 ${relDest}`));
|
|
37830
|
+
console.log(chalk233.dim("Loading project..."));
|
|
37831
|
+
console.log(chalk233.dim("Scanning imports across the project..."));
|
|
37716
37832
|
const rewrites = computeRenameRewrites(sourcePath, destPath);
|
|
37717
37833
|
const affectedFiles = new Set(rewrites.map((r) => r.file)).size;
|
|
37718
37834
|
console.log(
|
|
37719
|
-
|
|
37835
|
+
chalk233.dim(
|
|
37720
37836
|
`${rewrites.length} import path(s) to update across ${affectedFiles} file(s)`
|
|
37721
37837
|
)
|
|
37722
37838
|
);
|
|
@@ -37725,11 +37841,11 @@ async function rename(source, destination, options2 = {}) {
|
|
|
37725
37841
|
return;
|
|
37726
37842
|
}
|
|
37727
37843
|
applyRename(rewrites, sourcePath, destPath, cwd);
|
|
37728
|
-
console.log(
|
|
37844
|
+
console.log(chalk233.green("Done"));
|
|
37729
37845
|
}
|
|
37730
37846
|
|
|
37731
37847
|
// src/commands/refactor/renameSymbol.ts
|
|
37732
|
-
import
|
|
37848
|
+
import chalk234 from "chalk";
|
|
37733
37849
|
|
|
37734
37850
|
// src/commands/refactor/renameSymbol/findSymbol.ts
|
|
37735
37851
|
import { SyntaxKind as SyntaxKind19 } from "ts-morph";
|
|
@@ -37775,34 +37891,34 @@ async function renameSymbol(file, oldName, newName, options2 = {}) {
|
|
|
37775
37891
|
const { project, sourceFile } = loadProjectFile(file);
|
|
37776
37892
|
const symbol = findSymbol(sourceFile, oldName);
|
|
37777
37893
|
if (!symbol) {
|
|
37778
|
-
console.log(
|
|
37894
|
+
console.log(chalk234.red(`Symbol "${oldName}" not found in ${file}`));
|
|
37779
37895
|
process.exit(1);
|
|
37780
37896
|
}
|
|
37781
37897
|
const grouped = groupReferences(symbol, cwd);
|
|
37782
37898
|
const totalRefs = [...grouped.values()].reduce((s, l) => s + l.length, 0);
|
|
37783
37899
|
console.log(
|
|
37784
|
-
|
|
37900
|
+
chalk234.bold(`Rename: ${oldName} \u2192 ${newName} (${totalRefs} references)
|
|
37785
37901
|
`)
|
|
37786
37902
|
);
|
|
37787
37903
|
for (const [refFile, lines2] of grouped) {
|
|
37788
37904
|
console.log(
|
|
37789
|
-
` ${
|
|
37905
|
+
` ${chalk234.dim(refFile)}: lines ${chalk234.cyan(lines2.join(", "))}`
|
|
37790
37906
|
);
|
|
37791
37907
|
}
|
|
37792
37908
|
if (options2.apply) {
|
|
37793
37909
|
symbol.rename(newName);
|
|
37794
37910
|
await project.save();
|
|
37795
|
-
console.log(
|
|
37911
|
+
console.log(chalk234.green(`
|
|
37796
37912
|
Renamed ${oldName} \u2192 ${newName}`));
|
|
37797
37913
|
} else {
|
|
37798
|
-
console.log(
|
|
37914
|
+
console.log(chalk234.dim("\nDry run. Use --apply to execute."));
|
|
37799
37915
|
}
|
|
37800
37916
|
}
|
|
37801
37917
|
|
|
37802
37918
|
// src/commands/refactor/restructure.ts
|
|
37803
37919
|
import fs38 from "fs";
|
|
37804
37920
|
import path83 from "path";
|
|
37805
|
-
import
|
|
37921
|
+
import chalk244 from "chalk";
|
|
37806
37922
|
|
|
37807
37923
|
// src/commands/refactor/restructure/buildPlan.ts
|
|
37808
37924
|
import path73 from "path";
|
|
@@ -38139,7 +38255,7 @@ function buildPlan3(scopeRoot, files, ignored = [], pinnedModules = []) {
|
|
|
38139
38255
|
}
|
|
38140
38256
|
|
|
38141
38257
|
// src/commands/refactor/restructure/checkPlan.ts
|
|
38142
|
-
import
|
|
38258
|
+
import chalk239 from "chalk";
|
|
38143
38259
|
|
|
38144
38260
|
// src/commands/refactor/restructure/applyCommand.ts
|
|
38145
38261
|
import path74 from "path";
|
|
@@ -38150,13 +38266,13 @@ function applyCommand(scopeRoot) {
|
|
|
38150
38266
|
|
|
38151
38267
|
// src/commands/refactor/restructure/displayDrift.ts
|
|
38152
38268
|
import path75 from "path";
|
|
38153
|
-
import
|
|
38269
|
+
import chalk235 from "chalk";
|
|
38154
38270
|
var shownMoves = 20;
|
|
38155
38271
|
function displayDrift(plan2, listMoves) {
|
|
38156
38272
|
const rel = (file) => path75.relative(process.cwd(), file);
|
|
38157
38273
|
if (plan2.moves.length > 0) {
|
|
38158
38274
|
console.log(
|
|
38159
|
-
|
|
38275
|
+
chalk235.red(
|
|
38160
38276
|
`${plan2.moves.length} file(s) drift from the plan${listMoves ? ":" : "."}`
|
|
38161
38277
|
)
|
|
38162
38278
|
);
|
|
@@ -38164,17 +38280,17 @@ function displayDrift(plan2, listMoves) {
|
|
|
38164
38280
|
for (const move2 of plan2.moves.slice(0, shownMoves))
|
|
38165
38281
|
console.log(` ${rel(move2.from)} \u2192 ${rel(move2.to)}`);
|
|
38166
38282
|
if (plan2.moves.length > shownMoves)
|
|
38167
|
-
console.log(
|
|
38283
|
+
console.log(chalk235.dim(` \u2026and ${plan2.moves.length - shownMoves} more`));
|
|
38168
38284
|
}
|
|
38169
38285
|
}
|
|
38170
|
-
for (const error of plan2.errors) console.log(
|
|
38286
|
+
for (const error of plan2.errors) console.log(chalk235.red(error));
|
|
38171
38287
|
}
|
|
38172
38288
|
|
|
38173
38289
|
// src/commands/refactor/restructure/displayLayoutLimits.ts
|
|
38174
|
-
import
|
|
38290
|
+
import chalk238 from "chalk";
|
|
38175
38291
|
|
|
38176
38292
|
// src/commands/refactor/restructure/displayDeepChains.ts
|
|
38177
|
-
import
|
|
38293
|
+
import chalk236 from "chalk";
|
|
38178
38294
|
var shownChains = 10;
|
|
38179
38295
|
function formatChain(chain2) {
|
|
38180
38296
|
const folders = chain2.folders.map((f) => `${f.name} (${f.files})`).join(" > ");
|
|
@@ -38184,28 +38300,28 @@ function displayDeepChains(chains, maxDepth) {
|
|
|
38184
38300
|
if (chains.length === 0) return;
|
|
38185
38301
|
const tooDeep = chains.reduce((sum3, c) => sum3 + c.tooDeep, 0);
|
|
38186
38302
|
console.log(
|
|
38187
|
-
|
|
38303
|
+
chalk236.red(
|
|
38188
38304
|
`
|
|
38189
38305
|
Plan exceeds restructure.maxDepth ${maxDepth}: ${tooDeep} file(s) deeper.`
|
|
38190
38306
|
)
|
|
38191
38307
|
);
|
|
38192
38308
|
console.log(
|
|
38193
|
-
|
|
38309
|
+
chalk236.bold(
|
|
38194
38310
|
"Deep chains, as folder (files beneath), most files too deep first:"
|
|
38195
38311
|
)
|
|
38196
38312
|
);
|
|
38197
38313
|
for (const chain2 of chains.slice(0, shownChains))
|
|
38198
38314
|
console.log(formatChain(chain2));
|
|
38199
38315
|
if (chains.length > shownChains)
|
|
38200
|
-
console.log(
|
|
38316
|
+
console.log(chalk236.dim(` \u2026and ${chains.length - shownChains} more`));
|
|
38201
38317
|
}
|
|
38202
38318
|
|
|
38203
38319
|
// src/commands/refactor/restructure/displayLongPaths.ts
|
|
38204
|
-
import
|
|
38320
|
+
import chalk237 from "chalk";
|
|
38205
38321
|
function displayLongPaths(longPaths, maxPathLength) {
|
|
38206
38322
|
if (longPaths.length === 0) return;
|
|
38207
38323
|
console.log(
|
|
38208
|
-
|
|
38324
|
+
chalk237.red(
|
|
38209
38325
|
`
|
|
38210
38326
|
Plan exceeds restructure.maxPathLength ${maxPathLength}: ${longPaths.length} repo-relative path(s) longer.`
|
|
38211
38327
|
)
|
|
@@ -38233,7 +38349,7 @@ function displayLayoutLimits(limits, apply) {
|
|
|
38233
38349
|
displayDeepChains(limits.chains, limits.maxDepth);
|
|
38234
38350
|
displayLongPaths(limits.longPaths, limits.maxPathLength);
|
|
38235
38351
|
console.log("");
|
|
38236
|
-
for (const line of pinSteps(apply)) console.log(
|
|
38352
|
+
for (const line of pinSteps(apply)) console.log(chalk238.yellow(line));
|
|
38237
38353
|
}
|
|
38238
38354
|
|
|
38239
38355
|
// src/commands/refactor/restructure/checkPlan.ts
|
|
@@ -38245,14 +38361,14 @@ function checkPlan(plan2, limits) {
|
|
|
38245
38361
|
if (exceeds || plan2.errors.length > 0) process.exit(1);
|
|
38246
38362
|
if (plan2.moves.length > 0) {
|
|
38247
38363
|
console.log(
|
|
38248
|
-
|
|
38364
|
+
chalk239.yellow(
|
|
38249
38365
|
`
|
|
38250
38366
|
Run \`${apply}\` to move the files and rewrite their imports.`
|
|
38251
38367
|
)
|
|
38252
38368
|
);
|
|
38253
38369
|
process.exit(1);
|
|
38254
38370
|
}
|
|
38255
|
-
console.log(
|
|
38371
|
+
console.log(chalk239.green("Layout matches the restructure plan"));
|
|
38256
38372
|
}
|
|
38257
38373
|
|
|
38258
38374
|
// src/commands/refactor/restructure/findDeepChains.ts
|
|
@@ -38314,23 +38430,23 @@ import path78 from "path";
|
|
|
38314
38430
|
import { minimatch as minimatch4 } from "minimatch";
|
|
38315
38431
|
function partitionIgnored(files) {
|
|
38316
38432
|
const globs = loadConfig().restructure?.ignore ?? [];
|
|
38317
|
-
const
|
|
38433
|
+
const isIgnored2 = (file) => globs.some((glob) => minimatch4(path78.relative(process.cwd(), file), glob));
|
|
38318
38434
|
return {
|
|
38319
|
-
scoped: files.filter((f) => !
|
|
38320
|
-
ignored: files.filter(
|
|
38435
|
+
scoped: files.filter((f) => !isIgnored2(f)),
|
|
38436
|
+
ignored: files.filter(isIgnored2)
|
|
38321
38437
|
};
|
|
38322
38438
|
}
|
|
38323
38439
|
|
|
38324
38440
|
// src/commands/refactor/restructure/runPlan.ts
|
|
38325
|
-
import
|
|
38441
|
+
import chalk243 from "chalk";
|
|
38326
38442
|
|
|
38327
38443
|
// src/commands/refactor/restructure/applyPlan.ts
|
|
38328
|
-
import
|
|
38444
|
+
import chalk241 from "chalk";
|
|
38329
38445
|
|
|
38330
38446
|
// src/commands/refactor/restructure/executePlan.ts
|
|
38331
38447
|
import fs37 from "fs";
|
|
38332
38448
|
import path79 from "path";
|
|
38333
|
-
import
|
|
38449
|
+
import chalk240 from "chalk";
|
|
38334
38450
|
function relPath(file) {
|
|
38335
38451
|
return path79.relative(process.cwd(), file);
|
|
38336
38452
|
}
|
|
@@ -38347,14 +38463,14 @@ function moveFiles(moves) {
|
|
|
38347
38463
|
fs37.mkdirSync(path79.dirname(move2.to), { recursive: true });
|
|
38348
38464
|
fs37.renameSync(staging, move2.to);
|
|
38349
38465
|
console.log(
|
|
38350
|
-
|
|
38466
|
+
chalk240.white(` Moved ${relPath(move2.from)} \u2192 ${relPath(move2.to)}`)
|
|
38351
38467
|
);
|
|
38352
38468
|
}
|
|
38353
38469
|
}
|
|
38354
38470
|
function removeIfEmpty(dir) {
|
|
38355
38471
|
if (!fs37.existsSync(dir) || fs37.readdirSync(dir).length > 0) return false;
|
|
38356
38472
|
fs37.rmdirSync(dir);
|
|
38357
|
-
console.log(
|
|
38473
|
+
console.log(chalk240.dim(` Removed empty directory ${relPath(dir)}`));
|
|
38358
38474
|
return true;
|
|
38359
38475
|
}
|
|
38360
38476
|
function removeEmptyDirectories(dirs, scopeRoot) {
|
|
@@ -38367,7 +38483,7 @@ function removeEmptyDirectories(dirs, scopeRoot) {
|
|
|
38367
38483
|
function executePlan(plan2) {
|
|
38368
38484
|
for (const [file, content] of applyRewrites(plan2.rewrites)) {
|
|
38369
38485
|
fs37.writeFileSync(file, content, "utf8");
|
|
38370
|
-
console.log(
|
|
38486
|
+
console.log(chalk240.cyan(` Rewrote imports in ${relPath(file)}`));
|
|
38371
38487
|
}
|
|
38372
38488
|
moveFiles(plan2.moves);
|
|
38373
38489
|
removeEmptyDirectories(
|
|
@@ -38379,17 +38495,17 @@ function executePlan(plan2) {
|
|
|
38379
38495
|
// src/commands/refactor/restructure/applyPlan.ts
|
|
38380
38496
|
function applyPlan(plan2) {
|
|
38381
38497
|
if (plan2.errors.length > 0) {
|
|
38382
|
-
console.log(
|
|
38498
|
+
console.log(chalk241.red("\nResolve the errors above before applying."));
|
|
38383
38499
|
process.exit(1);
|
|
38384
38500
|
}
|
|
38385
|
-
console.log(
|
|
38501
|
+
console.log(chalk241.bold("\nApplying changes..."));
|
|
38386
38502
|
executePlan(plan2);
|
|
38387
|
-
console.log(
|
|
38503
|
+
console.log(chalk241.green("\nRestructuring complete"));
|
|
38388
38504
|
}
|
|
38389
38505
|
|
|
38390
38506
|
// src/commands/refactor/restructure/displayPlan.ts
|
|
38391
38507
|
import path82 from "path";
|
|
38392
|
-
import
|
|
38508
|
+
import chalk242 from "chalk";
|
|
38393
38509
|
|
|
38394
38510
|
// src/commands/refactor/restructure/computeDepthStats.ts
|
|
38395
38511
|
import path80 from "path";
|
|
@@ -38440,17 +38556,17 @@ function relPath2(filePath) {
|
|
|
38440
38556
|
}
|
|
38441
38557
|
function displayMoves(plan2) {
|
|
38442
38558
|
if (plan2.moves.length === 0) return;
|
|
38443
|
-
console.log(
|
|
38559
|
+
console.log(chalk242.bold("\nFile moves:"));
|
|
38444
38560
|
for (const move2 of plan2.moves) {
|
|
38445
38561
|
console.log(
|
|
38446
|
-
` ${
|
|
38562
|
+
` ${chalk242.red(relPath2(move2.from))} \u2192 ${chalk242.green(relPath2(move2.to))}`
|
|
38447
38563
|
);
|
|
38448
|
-
console.log(
|
|
38564
|
+
console.log(chalk242.dim(` ${move2.reason}`));
|
|
38449
38565
|
}
|
|
38450
38566
|
}
|
|
38451
38567
|
function displayTree(plan2) {
|
|
38452
38568
|
console.log(
|
|
38453
|
-
|
|
38569
|
+
chalk242.bold(`
|
|
38454
38570
|
Resulting tree (${relPath2(plan2.scopeRoot) || "."}/):`)
|
|
38455
38571
|
);
|
|
38456
38572
|
for (const line of formatTree(plan2.targets.values(), plan2.scopeRoot))
|
|
@@ -38461,15 +38577,15 @@ function displayDepthStats(plan2) {
|
|
|
38461
38577
|
plan2.targets.values(),
|
|
38462
38578
|
plan2.scopeRoot
|
|
38463
38579
|
);
|
|
38464
|
-
console.log(
|
|
38580
|
+
console.log(chalk242.bold(`
|
|
38465
38581
|
Depth (max ${max}):`));
|
|
38466
38582
|
for (const depth of [...distribution.keys()].sort((a, b) => a - b))
|
|
38467
38583
|
console.log(` ${depth}: ${distribution.get(depth)} file(s)`);
|
|
38468
38584
|
}
|
|
38469
38585
|
function displayErrors(errors) {
|
|
38470
38586
|
if (errors.length === 0) return;
|
|
38471
|
-
console.log(
|
|
38472
|
-
for (const error of errors) console.log(
|
|
38587
|
+
console.log(chalk242.red("\nErrors:"));
|
|
38588
|
+
for (const error of errors) console.log(chalk242.red(` ${error}`));
|
|
38473
38589
|
}
|
|
38474
38590
|
function displayPlan2(plan2) {
|
|
38475
38591
|
displayMoves(plan2);
|
|
@@ -38478,7 +38594,7 @@ function displayPlan2(plan2) {
|
|
|
38478
38594
|
displayErrors(plan2.errors);
|
|
38479
38595
|
const rewrittenFiles = new Set(plan2.rewrites.map((r) => r.file)).size;
|
|
38480
38596
|
console.log(
|
|
38481
|
-
|
|
38597
|
+
chalk242.dim(
|
|
38482
38598
|
`
|
|
38483
38599
|
Summary: ${plan2.moves.length} file(s) moved, ${plan2.rewrites.length} imports rewritten across ${rewrittenFiles} file(s), ${plan2.errors.length} error(s)`
|
|
38484
38600
|
)
|
|
@@ -38490,11 +38606,11 @@ function runPlan(plan2, limits, apply) {
|
|
|
38490
38606
|
displayPlan2(plan2);
|
|
38491
38607
|
displayLayoutLimits(limits, applyCommand(plan2.scopeRoot));
|
|
38492
38608
|
if (plan2.moves.length === 0 && plan2.errors.length === 0) {
|
|
38493
|
-
console.log(
|
|
38609
|
+
console.log(chalk243.green("No restructuring needed"));
|
|
38494
38610
|
return;
|
|
38495
38611
|
}
|
|
38496
38612
|
if (!apply) {
|
|
38497
|
-
console.log(
|
|
38613
|
+
console.log(chalk243.dim("\nDry run. Use --apply to execute."));
|
|
38498
38614
|
return;
|
|
38499
38615
|
}
|
|
38500
38616
|
applyPlan(plan2);
|
|
@@ -38504,14 +38620,14 @@ function runPlan(plan2, limits, apply) {
|
|
|
38504
38620
|
async function restructure(root2, options2 = {}) {
|
|
38505
38621
|
const scopeRoot = path83.resolve(root2 ?? "src");
|
|
38506
38622
|
if (!fs38.existsSync(scopeRoot) || !fs38.statSync(scopeRoot).isDirectory()) {
|
|
38507
|
-
console.log(
|
|
38623
|
+
console.log(chalk244.red(`Not a directory: ${root2 ?? "src"}`));
|
|
38508
38624
|
process.exit(1);
|
|
38509
38625
|
}
|
|
38510
38626
|
const found = [];
|
|
38511
38627
|
walkSourceFiles(scopeRoot, found);
|
|
38512
38628
|
const { scoped, ignored } = partitionIgnored(found);
|
|
38513
38629
|
if (scoped.length === 0) {
|
|
38514
|
-
console.log(
|
|
38630
|
+
console.log(chalk244.yellow("No files found under root"));
|
|
38515
38631
|
return;
|
|
38516
38632
|
}
|
|
38517
38633
|
const {
|
|
@@ -38582,7 +38698,7 @@ async function checkoutPrSession(number, prompt = "") {
|
|
|
38582
38698
|
}
|
|
38583
38699
|
|
|
38584
38700
|
// src/commands/review/highLevel/configureHighLevelReview.ts
|
|
38585
|
-
import
|
|
38701
|
+
import chalk248 from "chalk";
|
|
38586
38702
|
|
|
38587
38703
|
// src/commands/config/promptConfigScope.ts
|
|
38588
38704
|
import Enquirer3 from "enquirer";
|
|
@@ -38608,7 +38724,7 @@ async function promptConfigScope() {
|
|
|
38608
38724
|
}
|
|
38609
38725
|
|
|
38610
38726
|
// src/commands/config/resolveConfigKeyAnswer.ts
|
|
38611
|
-
import
|
|
38727
|
+
import chalk245 from "chalk";
|
|
38612
38728
|
async function resolveConfigKeyAnswer(question, supplied) {
|
|
38613
38729
|
if (supplied !== void 0) return coerceSupplied(question.key, supplied);
|
|
38614
38730
|
for (; ; ) {
|
|
@@ -38616,7 +38732,7 @@ async function resolveConfigKeyAnswer(question, supplied) {
|
|
|
38616
38732
|
if (answer === "") return void 0;
|
|
38617
38733
|
const coercion = coerceCliConfigValue(question.key, answer);
|
|
38618
38734
|
if (coercion.ok) return coercion.value;
|
|
38619
|
-
console.error(
|
|
38735
|
+
console.error(chalk245.red(coercion.error));
|
|
38620
38736
|
}
|
|
38621
38737
|
}
|
|
38622
38738
|
function coerceSupplied(key, supplied) {
|
|
@@ -38696,7 +38812,7 @@ function suggestGlobs(current, proposed) {
|
|
|
38696
38812
|
}
|
|
38697
38813
|
|
|
38698
38814
|
// src/commands/review/highLevel/parseConfigureAnswers.ts
|
|
38699
|
-
import
|
|
38815
|
+
import chalk246 from "chalk";
|
|
38700
38816
|
function parseConfigureAnswers(answers) {
|
|
38701
38817
|
const known = Object.values(highLevelConfigKeys);
|
|
38702
38818
|
const parsed = {};
|
|
@@ -38714,13 +38830,13 @@ function answersCoverEveryKey(answers) {
|
|
|
38714
38830
|
return Object.values(highLevelConfigKeys).every((key) => key in answers);
|
|
38715
38831
|
}
|
|
38716
38832
|
function exitWith(message3) {
|
|
38717
|
-
console.error(
|
|
38833
|
+
console.error(chalk246.red(`Error: ${message3}.`));
|
|
38718
38834
|
process.exit(1);
|
|
38719
38835
|
}
|
|
38720
38836
|
|
|
38721
38837
|
// src/commands/review/highLevel/proposeHighLevelGlobs.ts
|
|
38722
38838
|
import { execFileSync as execFileSync27 } from "child_process";
|
|
38723
|
-
import
|
|
38839
|
+
import chalk247 from "chalk";
|
|
38724
38840
|
|
|
38725
38841
|
// src/commands/review/highLevel/buildGlobProposalPrompt.ts
|
|
38726
38842
|
function buildGlobProposalPrompt(tree) {
|
|
@@ -38814,12 +38930,12 @@ function proposeHighLevelGlobs(cwd = process.cwd()) {
|
|
|
38814
38930
|
const tree = summariseRepoTree(cwd);
|
|
38815
38931
|
if (tree === "") return NOTHING_PROPOSED;
|
|
38816
38932
|
console.log(
|
|
38817
|
-
|
|
38933
|
+
chalk247.dim("Asking Claude to propose globs from the repo's own tree...")
|
|
38818
38934
|
);
|
|
38819
38935
|
const output = askClaude(buildGlobProposalPrompt(tree), cwd);
|
|
38820
38936
|
if (output === void 0) {
|
|
38821
38937
|
console.log(
|
|
38822
|
-
|
|
38938
|
+
chalk247.yellow(
|
|
38823
38939
|
"Claude proposed nothing; answer each key from its current value."
|
|
38824
38940
|
)
|
|
38825
38941
|
);
|
|
@@ -38879,14 +38995,14 @@ async function configureHighLevelReview(options2 = {}) {
|
|
|
38879
38995
|
function reportConfigured(result) {
|
|
38880
38996
|
for (const write of result.written)
|
|
38881
38997
|
console.log(
|
|
38882
|
-
|
|
38998
|
+
chalk248.green(`Set ${write.key} = ${JSON.stringify(write.value)}`)
|
|
38883
38999
|
);
|
|
38884
|
-
for (const key of result.skipped) console.log(
|
|
38885
|
-
console.log(
|
|
39000
|
+
for (const key of result.skipped) console.log(chalk248.dim(`Left ${key} unset`));
|
|
39001
|
+
console.log(chalk248.dim(`Written to ${result.target}`));
|
|
38886
39002
|
}
|
|
38887
39003
|
|
|
38888
39004
|
// src/commands/review/highLevel/announceSavedReview.ts
|
|
38889
|
-
import
|
|
39005
|
+
import chalk249 from "chalk";
|
|
38890
39006
|
function savedMessage(subject) {
|
|
38891
39007
|
const head = subject.headSha.slice(0, 7);
|
|
38892
39008
|
if (subject.draft)
|
|
@@ -38897,10 +39013,10 @@ function savedMessage(subject) {
|
|
|
38897
39013
|
}
|
|
38898
39014
|
function announceSavedReview(subject, force) {
|
|
38899
39015
|
const message3 = savedMessage(subject);
|
|
38900
|
-
if (message3) console.log(
|
|
39016
|
+
if (message3) console.log(chalk249.dim(message3));
|
|
38901
39017
|
else if (force)
|
|
38902
39018
|
console.log(
|
|
38903
|
-
|
|
39019
|
+
chalk249.dim(
|
|
38904
39020
|
`Discarding any review saved for ${subject.headSha.slice(0, 7)} and starting fresh (--force).`
|
|
38905
39021
|
)
|
|
38906
39022
|
);
|
|
@@ -39571,12 +39687,12 @@ function fetchHighLevelPr(prNumber, repo) {
|
|
|
39571
39687
|
}
|
|
39572
39688
|
|
|
39573
39689
|
// src/commands/review/highLevel/highLevelReviewPath.ts
|
|
39574
|
-
import { join as
|
|
39690
|
+
import { join as join88 } from "path";
|
|
39575
39691
|
function slug(value) {
|
|
39576
39692
|
return value.replace(/[^\w.-]+/g, "-");
|
|
39577
39693
|
}
|
|
39578
39694
|
function highLevelReviewPath(repo, headRef, headSha) {
|
|
39579
|
-
return
|
|
39695
|
+
return join88(
|
|
39580
39696
|
getStoreDir(),
|
|
39581
39697
|
"high-level-reviews",
|
|
39582
39698
|
slug(repo),
|
|
@@ -40041,55 +40157,55 @@ async function openHighLevelOverlay(sessionId, subject) {
|
|
|
40041
40157
|
}
|
|
40042
40158
|
|
|
40043
40159
|
// src/commands/review/highLevel/printHighLevelChecklist.ts
|
|
40044
|
-
import
|
|
40160
|
+
import chalk254 from "chalk";
|
|
40045
40161
|
|
|
40046
40162
|
// src/commands/review/highLevel/formatCriticalDiffs.ts
|
|
40047
|
-
import
|
|
40163
|
+
import chalk250 from "chalk";
|
|
40048
40164
|
var PATCH_LINE_COLOURS = {
|
|
40049
|
-
"+":
|
|
40050
|
-
"-":
|
|
40051
|
-
"@":
|
|
40165
|
+
"+": chalk250.green,
|
|
40166
|
+
"-": chalk250.red,
|
|
40167
|
+
"@": chalk250.cyan
|
|
40052
40168
|
};
|
|
40053
40169
|
function formatPatch(patch2) {
|
|
40054
40170
|
return patch2.split("\n").map(
|
|
40055
|
-
(line) => ` ${(PATCH_LINE_COLOURS[line[0] ?? ""] ??
|
|
40171
|
+
(line) => ` ${(PATCH_LINE_COLOURS[line[0] ?? ""] ?? chalk250.dim)(line)}`
|
|
40056
40172
|
);
|
|
40057
40173
|
}
|
|
40058
40174
|
function formatDiff(diff3) {
|
|
40059
40175
|
return [
|
|
40060
40176
|
"",
|
|
40061
|
-
` ${
|
|
40062
|
-
...diff3.patch === null ? [` ${
|
|
40177
|
+
` ${chalk250.bold(diff3.path)} ${chalk250.dim(`(${diff3.status})`)} ${chalk250.green(`+${diff3.additions}`)} ${chalk250.red(`-${diff3.deletions}`)}`,
|
|
40178
|
+
...diff3.patch === null ? [` ${chalk250.dim(`no diff available; see ${diff3.diffUrl}`)}`] : formatPatch(diff3.patch)
|
|
40063
40179
|
];
|
|
40064
40180
|
}
|
|
40065
40181
|
function formatCriticalDiffs(diffs, criticalPaths) {
|
|
40066
40182
|
if (criticalPaths.length === 0)
|
|
40067
|
-
return `${
|
|
40068
|
-
${
|
|
40183
|
+
return `${chalk250.bold.underline("Critical diffs")}
|
|
40184
|
+
${chalk250.dim("review.highLevel.criticalPaths is empty, so no diffs are shown")}`;
|
|
40069
40185
|
if (diffs.length === 0)
|
|
40070
|
-
return `${
|
|
40071
|
-
${
|
|
40186
|
+
return `${chalk250.bold.underline("Critical diffs")}
|
|
40187
|
+
${chalk250.dim(`no changed file matches ${criticalPaths.join(", ")}`)}`;
|
|
40072
40188
|
return [
|
|
40073
|
-
|
|
40189
|
+
chalk250.bold.underline("Critical diffs"),
|
|
40074
40190
|
...diffs.flatMap(formatDiff)
|
|
40075
40191
|
].join("\n");
|
|
40076
40192
|
}
|
|
40077
40193
|
|
|
40078
40194
|
// src/commands/review/highLevel/formatHighLevelChecklist.ts
|
|
40079
|
-
import
|
|
40195
|
+
import chalk251 from "chalk";
|
|
40080
40196
|
var MARKERS = {
|
|
40081
|
-
pass: () =>
|
|
40082
|
-
fail: () =>
|
|
40083
|
-
manual: () =>
|
|
40197
|
+
pass: () => chalk251.green("\u2714"),
|
|
40198
|
+
fail: () => chalk251.red("\u2718"),
|
|
40199
|
+
manual: () => chalk251.yellow("\u25A1")
|
|
40084
40200
|
};
|
|
40085
40201
|
function formatCheck(check2) {
|
|
40086
|
-
const title = check2.status === "fail" ?
|
|
40202
|
+
const title = check2.status === "fail" ? chalk251.red(check2.title) : chalk251.bold(check2.title);
|
|
40087
40203
|
return ` ${MARKERS[check2.status]()} ${title}
|
|
40088
|
-
${
|
|
40204
|
+
${chalk251.dim(check2.reason)}`;
|
|
40089
40205
|
}
|
|
40090
40206
|
function formatGroup(heading2, checks2) {
|
|
40091
40207
|
if (checks2.length === 0) return [];
|
|
40092
|
-
return ["",
|
|
40208
|
+
return ["", chalk251.bold.underline(heading2), ...checks2.map(formatCheck)];
|
|
40093
40209
|
}
|
|
40094
40210
|
function formatHighLevelChecklist(checks2) {
|
|
40095
40211
|
const deterministic = checks2.filter(
|
|
@@ -40098,7 +40214,7 @@ function formatHighLevelChecklist(checks2) {
|
|
|
40098
40214
|
const failed3 = deterministic.filter(
|
|
40099
40215
|
(check2) => check2.status === "fail"
|
|
40100
40216
|
).length;
|
|
40101
|
-
const summary = failed3 === 0 ?
|
|
40217
|
+
const summary = failed3 === 0 ? chalk251.green(`All ${deterministic.length} deterministic checks pass`) : chalk251.red(
|
|
40102
40218
|
`${failed3} of ${deterministic.length} deterministic checks fail`
|
|
40103
40219
|
);
|
|
40104
40220
|
return [
|
|
@@ -40113,37 +40229,37 @@ function formatHighLevelChecklist(checks2) {
|
|
|
40113
40229
|
}
|
|
40114
40230
|
|
|
40115
40231
|
// src/commands/review/highLevel/formatHighLevelStructure.ts
|
|
40116
|
-
import
|
|
40232
|
+
import chalk252 from "chalk";
|
|
40117
40233
|
var STATUS_MARKERS = {
|
|
40118
|
-
added: () =>
|
|
40119
|
-
removed: () =>
|
|
40120
|
-
modified: () =>
|
|
40234
|
+
added: () => chalk252.green("A"),
|
|
40235
|
+
removed: () => chalk252.red("D"),
|
|
40236
|
+
modified: () => chalk252.yellow("M")
|
|
40121
40237
|
};
|
|
40122
40238
|
function counts(additions, deletions) {
|
|
40123
|
-
return `${
|
|
40239
|
+
return `${chalk252.green(`+${additions}`)} ${chalk252.red(`-${deletions}`)}`;
|
|
40124
40240
|
}
|
|
40125
40241
|
function formatNode(node, indent4) {
|
|
40126
40242
|
if (node.kind === "file")
|
|
40127
40243
|
return [
|
|
40128
|
-
`${indent4}${STATUS_MARKERS[node.status]()} ${node.name} ${
|
|
40244
|
+
`${indent4}${STATUS_MARKERS[node.status]()} ${node.name} ${chalk252.dim(counts(node.additions, node.deletions))}`
|
|
40129
40245
|
];
|
|
40130
40246
|
const dir = node;
|
|
40131
40247
|
return [
|
|
40132
|
-
`${indent4}${
|
|
40248
|
+
`${indent4}${chalk252.bold(`${dir.name}/`)} ${chalk252.dim(counts(dir.additions, dir.deletions))}`,
|
|
40133
40249
|
...dir.children.flatMap((child) => formatNode(child, `${indent4} `))
|
|
40134
40250
|
];
|
|
40135
40251
|
}
|
|
40136
40252
|
function formatHighLevelStructure(structure) {
|
|
40137
40253
|
const summary = `${structure.added} added \xB7 ${structure.removed} deleted \xB7 ${structure.modified} modified \xB7 ${counts(structure.additions, structure.deletions)}`;
|
|
40138
40254
|
return [
|
|
40139
|
-
|
|
40255
|
+
chalk252.bold.underline("Structure"),
|
|
40140
40256
|
` ${summary}`,
|
|
40141
40257
|
...structure.tree.flatMap((node) => formatNode(node, " "))
|
|
40142
40258
|
].join("\n");
|
|
40143
40259
|
}
|
|
40144
40260
|
|
|
40145
40261
|
// src/commands/review/highLevel/formatHighLevelTests.ts
|
|
40146
|
-
import
|
|
40262
|
+
import chalk253 from "chalk";
|
|
40147
40263
|
function changeMarker(change) {
|
|
40148
40264
|
if (change === "added") return "A";
|
|
40149
40265
|
if (change === "modified") return "M";
|
|
@@ -40152,22 +40268,22 @@ function changeMarker(change) {
|
|
|
40152
40268
|
function formatNode2(node, depth) {
|
|
40153
40269
|
const indent4 = " ".repeat(depth + 2);
|
|
40154
40270
|
if (node.kind === "it")
|
|
40155
|
-
return [`${indent4}${
|
|
40271
|
+
return [`${indent4}${chalk253.dim(changeMarker(node.change))} ${node.name}`];
|
|
40156
40272
|
return [
|
|
40157
|
-
`${indent4}${
|
|
40273
|
+
`${indent4}${chalk253.bold(node.name)}`,
|
|
40158
40274
|
...node.children.flatMap((child) => formatNode2(child, depth + 1))
|
|
40159
40275
|
];
|
|
40160
40276
|
}
|
|
40161
40277
|
function formatHighLevelTests(files, testPaths) {
|
|
40162
|
-
const heading2 =
|
|
40278
|
+
const heading2 = chalk253.bold.underline("Changed tests");
|
|
40163
40279
|
if (files.length === 0)
|
|
40164
40280
|
return `${heading2}
|
|
40165
|
-
${
|
|
40281
|
+
${chalk253.dim(`no changed test in files matching ${testPaths.join(", ")}`)}`;
|
|
40166
40282
|
return [
|
|
40167
40283
|
heading2,
|
|
40168
40284
|
...files.flatMap((file) => [
|
|
40169
40285
|
"",
|
|
40170
|
-
` ${
|
|
40286
|
+
` ${chalk253.bold(file.path)} ${chalk253.dim(`(${file.status})`)}`,
|
|
40171
40287
|
...file.tests.flatMap((node) => formatNode2(node, 0))
|
|
40172
40288
|
])
|
|
40173
40289
|
].join("\n");
|
|
@@ -40181,10 +40297,10 @@ function highLevelChangedFileCount(structure) {
|
|
|
40181
40297
|
// src/commands/review/highLevel/printHighLevelChecklist.ts
|
|
40182
40298
|
function printHighLevelChecklist(subject) {
|
|
40183
40299
|
console.log(
|
|
40184
|
-
|
|
40300
|
+
chalk254.bold(
|
|
40185
40301
|
`High-level review of ${subject.repo}#${subject.prNumber} \u2014 ${subject.title}`
|
|
40186
40302
|
),
|
|
40187
|
-
|
|
40303
|
+
chalk254.dim(
|
|
40188
40304
|
`\xB7 ${highLevelChangedFileCount(subject.structure)} changed files`
|
|
40189
40305
|
)
|
|
40190
40306
|
);
|
|
@@ -40198,12 +40314,12 @@ function printHighLevelChecklist(subject) {
|
|
|
40198
40314
|
console.log("");
|
|
40199
40315
|
console.log(formatHighLevelTests(subject.tests, subject.testPaths));
|
|
40200
40316
|
console.log(
|
|
40201
|
-
|
|
40317
|
+
chalk254.dim(
|
|
40202
40318
|
"\nManual items are for the reviewer to judge; see docs/high-level-review.md."
|
|
40203
40319
|
)
|
|
40204
40320
|
);
|
|
40205
40321
|
console.log(
|
|
40206
|
-
|
|
40322
|
+
chalk254.dim(
|
|
40207
40323
|
"Run this inside an assist session to step through the checklist in the web overlay."
|
|
40208
40324
|
)
|
|
40209
40325
|
);
|
|
@@ -40489,18 +40605,18 @@ function partitionFindingsByDiff(findings, index2) {
|
|
|
40489
40605
|
}
|
|
40490
40606
|
|
|
40491
40607
|
// src/commands/review/warnOutOfDiff.ts
|
|
40492
|
-
import
|
|
40608
|
+
import chalk255 from "chalk";
|
|
40493
40609
|
function warnOutOfDiff(outOfDiff) {
|
|
40494
40610
|
if (outOfDiff.length === 0) return;
|
|
40495
40611
|
console.warn(
|
|
40496
|
-
|
|
40612
|
+
chalk255.yellow(
|
|
40497
40613
|
`Moved ${outOfDiff.length} finding(s) whose lines fall outside the PR diff into the review body (GitHub cannot anchor a comment on these):`
|
|
40498
40614
|
)
|
|
40499
40615
|
);
|
|
40500
40616
|
for (const finding of outOfDiff) {
|
|
40501
40617
|
const range = finding.startLine !== void 0 ? `${finding.startLine}-${finding.line}` : `${finding.line}`;
|
|
40502
40618
|
console.warn(
|
|
40503
|
-
` ${
|
|
40619
|
+
` ${chalk255.yellow("\xB7")} ${finding.title} ${chalk255.dim(
|
|
40504
40620
|
`(${finding.file}:${range})`
|
|
40505
40621
|
)}`
|
|
40506
40622
|
);
|
|
@@ -40527,18 +40643,18 @@ function selectInDiffFindings(lineBound, prDiff) {
|
|
|
40527
40643
|
}
|
|
40528
40644
|
|
|
40529
40645
|
// src/commands/review/warnUnlocated.ts
|
|
40530
|
-
import
|
|
40646
|
+
import chalk256 from "chalk";
|
|
40531
40647
|
function warnUnlocated(unlocated) {
|
|
40532
40648
|
if (unlocated.length === 0) return;
|
|
40533
40649
|
console.warn(
|
|
40534
|
-
|
|
40650
|
+
chalk256.yellow(
|
|
40535
40651
|
`Moved ${unlocated.length} finding(s) without a parseable file:line into the review body:`
|
|
40536
40652
|
)
|
|
40537
40653
|
);
|
|
40538
40654
|
for (const finding of unlocated) {
|
|
40539
|
-
const where = finding.location ||
|
|
40655
|
+
const where = finding.location || chalk256.dim("missing");
|
|
40540
40656
|
console.warn(
|
|
40541
|
-
` ${
|
|
40657
|
+
` ${chalk256.yellow("\xB7")} ${finding.title} ${chalk256.dim(`(${where})`)}`
|
|
40542
40658
|
);
|
|
40543
40659
|
}
|
|
40544
40660
|
}
|
|
@@ -40741,7 +40857,7 @@ import { format as format2 } from "util";
|
|
|
40741
40857
|
|
|
40742
40858
|
// src/commands/review/createReviewLogSink.ts
|
|
40743
40859
|
import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync28 } from "fs";
|
|
40744
|
-
import { join as
|
|
40860
|
+
import { join as join89 } from "path";
|
|
40745
40861
|
var LOG_FILE = "review.log";
|
|
40746
40862
|
function createReviewLogSink() {
|
|
40747
40863
|
let logPath2;
|
|
@@ -40758,7 +40874,7 @@ function createReviewLogSink() {
|
|
|
40758
40874
|
},
|
|
40759
40875
|
attach(reviewDir) {
|
|
40760
40876
|
mkdirSync28(reviewDir, { recursive: true });
|
|
40761
|
-
logPath2 =
|
|
40877
|
+
logPath2 = join89(reviewDir, LOG_FILE);
|
|
40762
40878
|
const lines2 = [
|
|
40763
40879
|
"",
|
|
40764
40880
|
`=== ${(/* @__PURE__ */ new Date()).toISOString()} ===`,
|
|
@@ -41918,9 +42034,9 @@ ${annotateDiffWithLineNumbers(context.diff.trimEnd())}
|
|
|
41918
42034
|
|
|
41919
42035
|
// src/commands/review/buildReviewPaths.ts
|
|
41920
42036
|
import { homedir as homedir27 } from "os";
|
|
41921
|
-
import { basename as basename26, join as
|
|
42037
|
+
import { basename as basename26, join as join90 } from "path";
|
|
41922
42038
|
function buildReviewPaths(repoRoot2, key) {
|
|
41923
|
-
const reviewDir =
|
|
42039
|
+
const reviewDir = join90(
|
|
41924
42040
|
homedir27(),
|
|
41925
42041
|
".assist",
|
|
41926
42042
|
"reviews",
|
|
@@ -41929,10 +42045,10 @@ function buildReviewPaths(repoRoot2, key) {
|
|
|
41929
42045
|
);
|
|
41930
42046
|
return {
|
|
41931
42047
|
reviewDir,
|
|
41932
|
-
requestPath:
|
|
41933
|
-
claudePath:
|
|
41934
|
-
codexPath:
|
|
41935
|
-
synthesisPath:
|
|
42048
|
+
requestPath: join90(reviewDir, "request.md"),
|
|
42049
|
+
claudePath: join90(reviewDir, "claude.md"),
|
|
42050
|
+
codexPath: join90(reviewDir, "codex.md"),
|
|
42051
|
+
synthesisPath: join90(reviewDir, "synthesis.md")
|
|
41936
42052
|
};
|
|
41937
42053
|
}
|
|
41938
42054
|
|
|
@@ -42628,7 +42744,7 @@ function registerReview(program) {
|
|
|
42628
42744
|
|
|
42629
42745
|
// src/commands/rules/indexRules.ts
|
|
42630
42746
|
import path87 from "path";
|
|
42631
|
-
import
|
|
42747
|
+
import chalk257 from "chalk";
|
|
42632
42748
|
|
|
42633
42749
|
// src/commands/rules/updateScopedRulesIndex.ts
|
|
42634
42750
|
import { existsSync as existsSync71, readFileSync as readFileSync57, writeFileSync as writeFileSync45 } from "fs";
|
|
@@ -42639,12 +42755,12 @@ import { readFileSync as readFileSync56 } from "fs";
|
|
|
42639
42755
|
import path85 from "path";
|
|
42640
42756
|
|
|
42641
42757
|
// src/commands/rules/findClaudeFiles.ts
|
|
42642
|
-
import { readdirSync as
|
|
42758
|
+
import { readdirSync as readdirSync15 } from "fs";
|
|
42643
42759
|
import path84 from "path";
|
|
42644
42760
|
var SKIP_DIRECTORIES = /* @__PURE__ */ new Set(["node_modules", "dist", "build", "coverage"]);
|
|
42645
42761
|
function findClaudeFiles(dir) {
|
|
42646
42762
|
const results = [];
|
|
42647
|
-
for (const entry of
|
|
42763
|
+
for (const entry of readdirSync15(dir, { withFileTypes: true })) {
|
|
42648
42764
|
if (entry.isDirectory()) {
|
|
42649
42765
|
if (entry.name.startsWith(".") || SKIP_DIRECTORIES.has(entry.name))
|
|
42650
42766
|
continue;
|
|
@@ -42715,24 +42831,24 @@ function indexRules() {
|
|
|
42715
42831
|
const rootFile = path87.relative(process.cwd(), path87.join(root2, "CLAUDE.md"));
|
|
42716
42832
|
if (directories.length === 0) {
|
|
42717
42833
|
console.log(
|
|
42718
|
-
|
|
42834
|
+
chalk257.gray(`No directories carry their own \`## Rules\` under ${root2}`)
|
|
42719
42835
|
);
|
|
42720
42836
|
return;
|
|
42721
42837
|
}
|
|
42722
42838
|
console.log(`Recorded in ${rootFile || "CLAUDE.md"}`);
|
|
42723
42839
|
for (const directory of directories)
|
|
42724
|
-
console.log(` ${
|
|
42840
|
+
console.log(` ${chalk257.cyan(directory)}`);
|
|
42725
42841
|
}
|
|
42726
42842
|
|
|
42727
42843
|
// src/commands/rules/listRules.ts
|
|
42728
42844
|
import path88 from "path";
|
|
42729
|
-
import
|
|
42845
|
+
import chalk258 from "chalk";
|
|
42730
42846
|
function listRules(target, options2 = {}) {
|
|
42731
42847
|
const resolved = path88.resolve(target ?? process.cwd());
|
|
42732
42848
|
const rules2 = readScopedRules(resolved);
|
|
42733
42849
|
if (rules2.length === 0) {
|
|
42734
42850
|
const label = path88.relative(process.cwd(), resolved) || ".";
|
|
42735
|
-
console.log(
|
|
42851
|
+
console.log(chalk258.gray(`No rules in scope for ${label}`));
|
|
42736
42852
|
return;
|
|
42737
42853
|
}
|
|
42738
42854
|
const base = findRepoRoot(scopeDirectory(resolved));
|
|
@@ -42742,21 +42858,21 @@ function listRules(target, options2 = {}) {
|
|
|
42742
42858
|
if (rule.source !== shown) {
|
|
42743
42859
|
shown = rule.source;
|
|
42744
42860
|
console.log(
|
|
42745
|
-
|
|
42861
|
+
chalk258.dim(base ? path88.relative(base, rule.source) : rule.source)
|
|
42746
42862
|
);
|
|
42747
42863
|
}
|
|
42748
42864
|
console.log(
|
|
42749
|
-
` ${
|
|
42865
|
+
` ${chalk258.cyan(rule.code.padEnd(width2))} ${rule.title ?? rule.text}`
|
|
42750
42866
|
);
|
|
42751
42867
|
if (options2.full && rule.title)
|
|
42752
|
-
console.log(` ${" ".repeat(width2)} ${
|
|
42868
|
+
console.log(` ${" ".repeat(width2)} ${chalk258.dim(rule.text)}`);
|
|
42753
42869
|
}
|
|
42754
42870
|
}
|
|
42755
42871
|
|
|
42756
42872
|
// src/commands/rules/addRule.ts
|
|
42757
42873
|
import { existsSync as existsSync73, readFileSync as readFileSync59, writeFileSync as writeFileSync46 } from "fs";
|
|
42758
42874
|
import path90 from "path";
|
|
42759
|
-
import
|
|
42875
|
+
import chalk259 from "chalk";
|
|
42760
42876
|
|
|
42761
42877
|
// src/commands/rules/insertRuleBullet.ts
|
|
42762
42878
|
function ruleBullet({ code, title, text: text18 }) {
|
|
@@ -42815,7 +42931,7 @@ function read2(file) {
|
|
|
42815
42931
|
function addRule(text18, options2) {
|
|
42816
42932
|
const rule = text18.trim();
|
|
42817
42933
|
if (rule === "") {
|
|
42818
|
-
console.error(
|
|
42934
|
+
console.error(chalk259.red("Rule text is required"));
|
|
42819
42935
|
process.exitCode = 1;
|
|
42820
42936
|
return;
|
|
42821
42937
|
}
|
|
@@ -42833,14 +42949,14 @@ function addRule(text18, options2) {
|
|
|
42833
42949
|
);
|
|
42834
42950
|
updateScopedRulesIndex(root2);
|
|
42835
42951
|
console.log(
|
|
42836
|
-
`Added ${
|
|
42952
|
+
`Added ${chalk259.cyan(code)} to ${path90.relative(process.cwd(), target) || target}`
|
|
42837
42953
|
);
|
|
42838
42954
|
}
|
|
42839
42955
|
|
|
42840
42956
|
// src/commands/rules/addUserRule.ts
|
|
42841
|
-
import
|
|
42957
|
+
import chalk260 from "chalk";
|
|
42842
42958
|
function fail9(message3) {
|
|
42843
|
-
console.error(
|
|
42959
|
+
console.error(chalk260.red(message3));
|
|
42844
42960
|
process.exitCode = 1;
|
|
42845
42961
|
}
|
|
42846
42962
|
function asRules(value) {
|
|
@@ -42859,7 +42975,7 @@ async function addToUserDb(rule) {
|
|
|
42859
42975
|
rule
|
|
42860
42976
|
]);
|
|
42861
42977
|
if (!result.ok) return fail9(result.errors.join("\n"));
|
|
42862
|
-
console.log(`Added ${
|
|
42978
|
+
console.log(`Added ${chalk260.cyan(rule.title)} to advice.rules in user (db)`);
|
|
42863
42979
|
}
|
|
42864
42980
|
function addToUserNode(rule, globalConfigPath) {
|
|
42865
42981
|
const advice = loadGlobalConfigRaw(globalConfigPath).advice;
|
|
@@ -42872,7 +42988,7 @@ function addToUserNode(rule, globalConfigPath) {
|
|
|
42872
42988
|
);
|
|
42873
42989
|
if (!result.ok) return fail9(result.errors.join("\n"));
|
|
42874
42990
|
console.log(
|
|
42875
|
-
`Added ${
|
|
42991
|
+
`Added ${chalk260.cyan(rule.title)} to advice.rules in user (node) (${globalConfigFileLabel(globalConfigPath)})`
|
|
42876
42992
|
);
|
|
42877
42993
|
}
|
|
42878
42994
|
async function addUserRule(text18, options2, globalConfigPath = getGlobalConfigPath()) {
|
|
@@ -42927,7 +43043,7 @@ function registerRules(program) {
|
|
|
42927
43043
|
}
|
|
42928
43044
|
|
|
42929
43045
|
// src/commands/seq/seqAuth.ts
|
|
42930
|
-
import
|
|
43046
|
+
import chalk262 from "chalk";
|
|
42931
43047
|
|
|
42932
43048
|
// src/commands/seq/loadConnections.ts
|
|
42933
43049
|
function loadConnections2() {
|
|
@@ -42956,10 +43072,10 @@ function setDefaultConnection(name) {
|
|
|
42956
43072
|
}
|
|
42957
43073
|
|
|
42958
43074
|
// src/shared/assertUniqueName.ts
|
|
42959
|
-
import
|
|
43075
|
+
import chalk261 from "chalk";
|
|
42960
43076
|
function assertUniqueName(existingNames, name) {
|
|
42961
43077
|
if (existingNames.includes(name)) {
|
|
42962
|
-
console.error(
|
|
43078
|
+
console.error(chalk261.red(`Connection "${name}" already exists.`));
|
|
42963
43079
|
process.exit(1);
|
|
42964
43080
|
}
|
|
42965
43081
|
}
|
|
@@ -42977,16 +43093,16 @@ async function promptConnection2(existingNames) {
|
|
|
42977
43093
|
var seqAuth = createConnectionAuth({
|
|
42978
43094
|
load: loadConnections2,
|
|
42979
43095
|
save: saveConnections2,
|
|
42980
|
-
format: (c) => `${
|
|
43096
|
+
format: (c) => `${chalk262.bold(c.name)} ${c.url}`,
|
|
42981
43097
|
promptNew: promptConnection2,
|
|
42982
43098
|
onFirst: (c) => setDefaultConnection(c.name)
|
|
42983
43099
|
});
|
|
42984
43100
|
|
|
42985
43101
|
// src/commands/seq/seqQuery.ts
|
|
42986
|
-
import
|
|
43102
|
+
import chalk266 from "chalk";
|
|
42987
43103
|
|
|
42988
43104
|
// src/commands/seq/fetchSeq.ts
|
|
42989
|
-
import
|
|
43105
|
+
import chalk263 from "chalk";
|
|
42990
43106
|
async function fetchSeq(conn, path109, params) {
|
|
42991
43107
|
const url = `${conn.url}${path109}?${params}`;
|
|
42992
43108
|
const response = await fetch(url, {
|
|
@@ -42997,7 +43113,7 @@ async function fetchSeq(conn, path109, params) {
|
|
|
42997
43113
|
});
|
|
42998
43114
|
if (!response.ok) {
|
|
42999
43115
|
const body = await response.text();
|
|
43000
|
-
console.error(
|
|
43116
|
+
console.error(chalk263.red(`Seq returned ${response.status}: ${body}`));
|
|
43001
43117
|
process.exit(1);
|
|
43002
43118
|
}
|
|
43003
43119
|
return response;
|
|
@@ -43056,23 +43172,23 @@ async function fetchSeqEvents(conn, params) {
|
|
|
43056
43172
|
}
|
|
43057
43173
|
|
|
43058
43174
|
// src/commands/seq/formatEvent.ts
|
|
43059
|
-
import
|
|
43175
|
+
import chalk264 from "chalk";
|
|
43060
43176
|
function levelColor(level) {
|
|
43061
43177
|
switch (level) {
|
|
43062
43178
|
case "Fatal":
|
|
43063
|
-
return
|
|
43179
|
+
return chalk264.bgRed.white;
|
|
43064
43180
|
case "Error":
|
|
43065
|
-
return
|
|
43181
|
+
return chalk264.red;
|
|
43066
43182
|
case "Warning":
|
|
43067
|
-
return
|
|
43183
|
+
return chalk264.yellow;
|
|
43068
43184
|
case "Information":
|
|
43069
|
-
return
|
|
43185
|
+
return chalk264.cyan;
|
|
43070
43186
|
case "Debug":
|
|
43071
|
-
return
|
|
43187
|
+
return chalk264.gray;
|
|
43072
43188
|
case "Verbose":
|
|
43073
|
-
return
|
|
43189
|
+
return chalk264.dim;
|
|
43074
43190
|
default:
|
|
43075
|
-
return
|
|
43191
|
+
return chalk264.white;
|
|
43076
43192
|
}
|
|
43077
43193
|
}
|
|
43078
43194
|
function levelAbbrev(level) {
|
|
@@ -43113,12 +43229,12 @@ function formatTimestamp(iso) {
|
|
|
43113
43229
|
function formatEvent(event) {
|
|
43114
43230
|
const color = levelColor(event.Level);
|
|
43115
43231
|
const abbrev = levelAbbrev(event.Level);
|
|
43116
|
-
const ts10 =
|
|
43232
|
+
const ts10 = chalk264.dim(formatTimestamp(event.Timestamp));
|
|
43117
43233
|
const msg = renderMessage(event);
|
|
43118
43234
|
const lines2 = [`${ts10} ${color(`[${abbrev}]`)} ${msg}`];
|
|
43119
43235
|
if (event.Exception) {
|
|
43120
43236
|
for (const line of event.Exception.split("\n")) {
|
|
43121
|
-
lines2.push(
|
|
43237
|
+
lines2.push(chalk264.red(` ${line}`));
|
|
43122
43238
|
}
|
|
43123
43239
|
}
|
|
43124
43240
|
return lines2.join("\n");
|
|
@@ -43151,11 +43267,11 @@ function rejectTimestampFilter(filter) {
|
|
|
43151
43267
|
}
|
|
43152
43268
|
|
|
43153
43269
|
// src/shared/resolveNamedConnection.ts
|
|
43154
|
-
import
|
|
43270
|
+
import chalk265 from "chalk";
|
|
43155
43271
|
function resolveNamedConnection(connections, requested, defaultName, kind, authCommand) {
|
|
43156
43272
|
if (connections.length === 0) {
|
|
43157
43273
|
console.error(
|
|
43158
|
-
|
|
43274
|
+
chalk265.red(
|
|
43159
43275
|
`No ${kind} connections configured. Run '${authCommand}' first.`
|
|
43160
43276
|
)
|
|
43161
43277
|
);
|
|
@@ -43164,7 +43280,7 @@ function resolveNamedConnection(connections, requested, defaultName, kind, authC
|
|
|
43164
43280
|
const target = requested ?? defaultName ?? connections[0].name;
|
|
43165
43281
|
const connection = connections.find((c) => c.name === target);
|
|
43166
43282
|
if (!connection) {
|
|
43167
|
-
console.error(
|
|
43283
|
+
console.error(chalk265.red(`${kind} connection "${target}" not found.`));
|
|
43168
43284
|
process.exit(1);
|
|
43169
43285
|
}
|
|
43170
43286
|
return connection;
|
|
@@ -43193,7 +43309,7 @@ async function seqQuery(filter, options2) {
|
|
|
43193
43309
|
new URLSearchParams({ filter, count: String(count10) })
|
|
43194
43310
|
);
|
|
43195
43311
|
if (events.length === 0) {
|
|
43196
|
-
console.log(
|
|
43312
|
+
console.log(chalk266.yellow("No events found."));
|
|
43197
43313
|
return;
|
|
43198
43314
|
}
|
|
43199
43315
|
if (options2.json) {
|
|
@@ -43204,11 +43320,11 @@ async function seqQuery(filter, options2) {
|
|
|
43204
43320
|
for (const event of chronological) {
|
|
43205
43321
|
console.log(formatEvent(event));
|
|
43206
43322
|
}
|
|
43207
|
-
console.log(
|
|
43323
|
+
console.log(chalk266.dim(`
|
|
43208
43324
|
${events.length} events`));
|
|
43209
43325
|
if (events.length >= count10) {
|
|
43210
43326
|
console.log(
|
|
43211
|
-
|
|
43327
|
+
chalk266.yellow(
|
|
43212
43328
|
`Results limited to ${count10}. Use --count to retrieve more.`
|
|
43213
43329
|
)
|
|
43214
43330
|
);
|
|
@@ -43216,10 +43332,10 @@ ${events.length} events`));
|
|
|
43216
43332
|
}
|
|
43217
43333
|
|
|
43218
43334
|
// src/shared/setNamedDefaultConnection.ts
|
|
43219
|
-
import
|
|
43335
|
+
import chalk267 from "chalk";
|
|
43220
43336
|
function setNamedDefaultConnection(connections, name, setDefault, kind) {
|
|
43221
43337
|
if (!connections.find((c) => c.name === name)) {
|
|
43222
|
-
console.error(
|
|
43338
|
+
console.error(chalk267.red(`Connection "${name}" not found.`));
|
|
43223
43339
|
process.exit(1);
|
|
43224
43340
|
}
|
|
43225
43341
|
setDefault(name);
|
|
@@ -43339,8 +43455,10 @@ function registerSignal(program) {
|
|
|
43339
43455
|
"/next"
|
|
43340
43456
|
);
|
|
43341
43457
|
internalCommand(
|
|
43342
|
-
signalCommand.command("done").argument("[
|
|
43343
|
-
|
|
43458
|
+
signalCommand.command("done").argument("[ids...]", "Backlog item IDs created by the session").description(
|
|
43459
|
+
"Write a done signal to end a --once launch session, once every item it set out to create exists"
|
|
43460
|
+
).action((ids) => {
|
|
43461
|
+
writeSignal("done", ids.length > 0 ? { ids } : void 0);
|
|
43344
43462
|
console.log("Signal written.");
|
|
43345
43463
|
}),
|
|
43346
43464
|
"/draft, /bug, /refine"
|
|
@@ -43414,12 +43532,12 @@ async function reviewProposedSlackMessage(target, body, workingPath) {
|
|
|
43414
43532
|
}
|
|
43415
43533
|
|
|
43416
43534
|
// src/commands/slack/slackWorkingFile.ts
|
|
43417
|
-
import { join as
|
|
43535
|
+
import { join as join91 } from "path";
|
|
43418
43536
|
function slackWorkingFile(channel, partIndex) {
|
|
43419
43537
|
const slug2 = channel.replace(/^[#@]/, "").toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "channel";
|
|
43420
|
-
const dir =
|
|
43538
|
+
const dir = join91(getStoreDir(), "slack");
|
|
43421
43539
|
const name = partIndex === void 0 ? slug2 : `${slug2}-${partIndex}`;
|
|
43422
|
-
return { dir, bodyPath:
|
|
43540
|
+
return { dir, bodyPath: join91(dir, `${name}.md`) };
|
|
43423
43541
|
}
|
|
43424
43542
|
|
|
43425
43543
|
// src/commands/slack/previewSlackThreadParts.ts
|
|
@@ -43521,7 +43639,7 @@ function registerSlack(program) {
|
|
|
43521
43639
|
}
|
|
43522
43640
|
|
|
43523
43641
|
// src/commands/sql/sqlAuth.ts
|
|
43524
|
-
import
|
|
43642
|
+
import chalk269 from "chalk";
|
|
43525
43643
|
|
|
43526
43644
|
// src/commands/sql/loadConnections.ts
|
|
43527
43645
|
function loadConnections3() {
|
|
@@ -43550,7 +43668,7 @@ function setDefaultConnection2(name) {
|
|
|
43550
43668
|
}
|
|
43551
43669
|
|
|
43552
43670
|
// src/commands/sql/promptConnection.ts
|
|
43553
|
-
import
|
|
43671
|
+
import chalk268 from "chalk";
|
|
43554
43672
|
async function promptConnection3(existingNames) {
|
|
43555
43673
|
const name = await promptInput("name", "Connection name:", "default");
|
|
43556
43674
|
assertUniqueName(existingNames, name);
|
|
@@ -43558,7 +43676,7 @@ async function promptConnection3(existingNames) {
|
|
|
43558
43676
|
const portStr = await promptInput("port", "Port:", "1433");
|
|
43559
43677
|
const port = Number.parseInt(portStr, 10);
|
|
43560
43678
|
if (!Number.isFinite(port)) {
|
|
43561
|
-
console.error(
|
|
43679
|
+
console.error(chalk268.red(`Invalid port "${portStr}".`));
|
|
43562
43680
|
process.exit(1);
|
|
43563
43681
|
}
|
|
43564
43682
|
const user = await promptInput("user", "User:");
|
|
@@ -43571,13 +43689,13 @@ async function promptConnection3(existingNames) {
|
|
|
43571
43689
|
var sqlAuth = createConnectionAuth({
|
|
43572
43690
|
load: loadConnections3,
|
|
43573
43691
|
save: saveConnections3,
|
|
43574
|
-
format: (c) => `${
|
|
43692
|
+
format: (c) => `${chalk269.bold(c.name)} ${c.server}:${c.port}/${c.database} (${c.user})`,
|
|
43575
43693
|
promptNew: promptConnection3,
|
|
43576
43694
|
onFirst: (c) => setDefaultConnection2(c.name)
|
|
43577
43695
|
});
|
|
43578
43696
|
|
|
43579
43697
|
// src/commands/sql/printTable.ts
|
|
43580
|
-
import
|
|
43698
|
+
import chalk270 from "chalk";
|
|
43581
43699
|
function formatCell(value) {
|
|
43582
43700
|
if (value === null || value === void 0) return "";
|
|
43583
43701
|
if (value instanceof Date) return value.toISOString();
|
|
@@ -43586,7 +43704,7 @@ function formatCell(value) {
|
|
|
43586
43704
|
}
|
|
43587
43705
|
function printTable(rows) {
|
|
43588
43706
|
if (rows.length === 0) {
|
|
43589
|
-
console.log(
|
|
43707
|
+
console.log(chalk270.yellow("(no rows)"));
|
|
43590
43708
|
return;
|
|
43591
43709
|
}
|
|
43592
43710
|
const columns = Object.keys(rows[0]);
|
|
@@ -43594,13 +43712,13 @@ function printTable(rows) {
|
|
|
43594
43712
|
(col) => Math.max(col.length, ...rows.map((r) => formatCell(r[col]).length))
|
|
43595
43713
|
);
|
|
43596
43714
|
const header = columns.map((c, i) => c.padEnd(widths[i])).join(" ");
|
|
43597
|
-
console.log(
|
|
43598
|
-
console.log(
|
|
43715
|
+
console.log(chalk270.dim(header));
|
|
43716
|
+
console.log(chalk270.dim("-".repeat(header.length)));
|
|
43599
43717
|
for (const row3 of rows) {
|
|
43600
43718
|
const line = columns.map((c, i) => formatCell(row3[c]).padEnd(widths[i])).join(" ");
|
|
43601
43719
|
console.log(line);
|
|
43602
43720
|
}
|
|
43603
|
-
console.log(
|
|
43721
|
+
console.log(chalk270.dim(`
|
|
43604
43722
|
${rows.length} row${rows.length === 1 ? "" : "s"}`));
|
|
43605
43723
|
}
|
|
43606
43724
|
|
|
@@ -43660,7 +43778,7 @@ async function sqlColumns(table, connectionName) {
|
|
|
43660
43778
|
}
|
|
43661
43779
|
|
|
43662
43780
|
// src/commands/sql/sqlMutate.ts
|
|
43663
|
-
import
|
|
43781
|
+
import chalk271 from "chalk";
|
|
43664
43782
|
|
|
43665
43783
|
// src/commands/sql/isMutation.ts
|
|
43666
43784
|
var MUTATION_KEYWORDS = [
|
|
@@ -43694,7 +43812,7 @@ function isMutation(sql31) {
|
|
|
43694
43812
|
async function sqlMutate(query, connectionName) {
|
|
43695
43813
|
if (!isMutation(query)) {
|
|
43696
43814
|
console.error(
|
|
43697
|
-
|
|
43815
|
+
chalk271.red(
|
|
43698
43816
|
"assist sql mutate refuses non-mutating statements. Use `assist sql query` instead."
|
|
43699
43817
|
)
|
|
43700
43818
|
);
|
|
@@ -43704,18 +43822,18 @@ async function sqlMutate(query, connectionName) {
|
|
|
43704
43822
|
const pool = await sqlConnect(conn);
|
|
43705
43823
|
try {
|
|
43706
43824
|
const result = await pool.request().query(query);
|
|
43707
|
-
console.log(
|
|
43825
|
+
console.log(chalk271.dim(`${result.rowsAffected.join(", ")} row(s) affected`));
|
|
43708
43826
|
} finally {
|
|
43709
43827
|
await pool.close();
|
|
43710
43828
|
}
|
|
43711
43829
|
}
|
|
43712
43830
|
|
|
43713
43831
|
// src/commands/sql/sqlQuery.ts
|
|
43714
|
-
import
|
|
43832
|
+
import chalk272 from "chalk";
|
|
43715
43833
|
async function sqlQuery(query, connectionName) {
|
|
43716
43834
|
if (isMutation(query)) {
|
|
43717
43835
|
console.error(
|
|
43718
|
-
|
|
43836
|
+
chalk272.red(
|
|
43719
43837
|
"assist sql query refuses mutating statements. Use `assist sql mutate` instead."
|
|
43720
43838
|
)
|
|
43721
43839
|
);
|
|
@@ -43730,7 +43848,7 @@ async function sqlQuery(query, connectionName) {
|
|
|
43730
43848
|
printTable(rows);
|
|
43731
43849
|
} else {
|
|
43732
43850
|
console.log(
|
|
43733
|
-
|
|
43851
|
+
chalk272.dim(`${result.rowsAffected.join(", ")} row(s) affected`)
|
|
43734
43852
|
);
|
|
43735
43853
|
}
|
|
43736
43854
|
} finally {
|
|
@@ -44145,7 +44263,7 @@ function syncPi(claudeDir, options2) {
|
|
|
44145
44263
|
// src/commands/sync/syncSettings.ts
|
|
44146
44264
|
import * as fs47 from "fs";
|
|
44147
44265
|
import * as path101 from "path";
|
|
44148
|
-
import
|
|
44266
|
+
import chalk273 from "chalk";
|
|
44149
44267
|
async function syncSettings(claudeDir, targetBase, options2) {
|
|
44150
44268
|
const source = path101.join(claudeDir, "settings.json");
|
|
44151
44269
|
const target = path101.join(targetBase, "settings.json");
|
|
@@ -44164,7 +44282,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
44164
44282
|
if (mergedContent !== normalizedTarget) {
|
|
44165
44283
|
if (!options2?.yes) {
|
|
44166
44284
|
console.log(
|
|
44167
|
-
|
|
44285
|
+
chalk273.yellow(
|
|
44168
44286
|
"\n\u26A0\uFE0F Warning: settings.json differs from existing file"
|
|
44169
44287
|
)
|
|
44170
44288
|
);
|
|
@@ -44172,7 +44290,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
44172
44290
|
printDiff(targetContent, mergedContent);
|
|
44173
44291
|
printAutoConfirmHint();
|
|
44174
44292
|
const confirm = await promptConfirm(
|
|
44175
|
-
|
|
44293
|
+
chalk273.red("Overwrite existing settings.json?"),
|
|
44176
44294
|
false
|
|
44177
44295
|
);
|
|
44178
44296
|
if (!confirm) {
|
|
@@ -44601,21 +44719,21 @@ async function configure() {
|
|
|
44601
44719
|
}
|
|
44602
44720
|
|
|
44603
44721
|
// src/commands/transcript/list.ts
|
|
44604
|
-
import { existsSync as existsSync79, readdirSync as
|
|
44605
|
-
import { join as
|
|
44722
|
+
import { existsSync as existsSync79, readdirSync as readdirSync22, statSync as statSync12 } from "fs";
|
|
44723
|
+
import { join as join103 } from "path";
|
|
44606
44724
|
function list5() {
|
|
44607
44725
|
const { vttDir } = getTranscriptConfig();
|
|
44608
44726
|
if (!existsSync79(vttDir)) return;
|
|
44609
|
-
for (const entry of
|
|
44727
|
+
for (const entry of readdirSync22(vttDir)) {
|
|
44610
44728
|
if (!entry.endsWith(".vtt")) continue;
|
|
44611
|
-
if (statSync12(
|
|
44729
|
+
if (statSync12(join103(vttDir, entry)).isDirectory()) continue;
|
|
44612
44730
|
console.log(entry);
|
|
44613
44731
|
}
|
|
44614
44732
|
}
|
|
44615
44733
|
|
|
44616
44734
|
// src/commands/transcript/move.ts
|
|
44617
44735
|
import { existsSync as existsSync80, mkdirSync as mkdirSync37, renameSync as renameSync5, writeFileSync as writeFileSync53 } from "fs";
|
|
44618
|
-
import { basename as basename29, join as
|
|
44736
|
+
import { basename as basename29, join as join104 } from "path";
|
|
44619
44737
|
|
|
44620
44738
|
// src/commands/transcript/convertVttToMarkdown.ts
|
|
44621
44739
|
function convertVttToMarkdown(inputPath) {
|
|
@@ -44625,9 +44743,9 @@ function convertVttToMarkdown(inputPath) {
|
|
|
44625
44743
|
// src/commands/transcript/move.ts
|
|
44626
44744
|
var DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
44627
44745
|
function archiveRawVtt(vttDir, sourcePath, filename) {
|
|
44628
|
-
const processedDir =
|
|
44746
|
+
const processedDir = join104(vttDir, "processed");
|
|
44629
44747
|
mkdirSync37(processedDir, { recursive: true });
|
|
44630
|
-
renameSync5(sourcePath,
|
|
44748
|
+
renameSync5(sourcePath, join104(processedDir, filename));
|
|
44631
44749
|
}
|
|
44632
44750
|
function move(file, options2) {
|
|
44633
44751
|
const { date, client } = options2;
|
|
@@ -44637,19 +44755,19 @@ function move(file, options2) {
|
|
|
44637
44755
|
}
|
|
44638
44756
|
const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
|
|
44639
44757
|
const filename = basename29(file);
|
|
44640
|
-
const sourcePath =
|
|
44758
|
+
const sourcePath = join104(vttDir, filename);
|
|
44641
44759
|
if (!existsSync80(sourcePath)) {
|
|
44642
44760
|
console.error(`Error: VTT file not found: ${sourcePath}`);
|
|
44643
44761
|
process.exit(1);
|
|
44644
44762
|
}
|
|
44645
44763
|
const base = basename29(filename, ".vtt").replace(/ Transcription$/, "");
|
|
44646
44764
|
const outputName = `${date} ${base}.md`;
|
|
44647
|
-
const formattedDir =
|
|
44765
|
+
const formattedDir = join104(transcriptsDir, client);
|
|
44648
44766
|
mkdirSync37(formattedDir, { recursive: true });
|
|
44649
|
-
const formattedPath =
|
|
44767
|
+
const formattedPath = join104(formattedDir, outputName);
|
|
44650
44768
|
writeFileSync53(formattedPath, convertVttToMarkdown(sourcePath), "utf8");
|
|
44651
44769
|
archiveRawVtt(vttDir, sourcePath, filename);
|
|
44652
|
-
const summaryPath =
|
|
44770
|
+
const summaryPath = join104(summaryDir, client, outputName);
|
|
44653
44771
|
console.log(`Formatted transcript: ${formattedPath}`);
|
|
44654
44772
|
console.log(`Summary target: ${summaryPath}`);
|
|
44655
44773
|
}
|
|
@@ -45463,10 +45581,10 @@ function checkSequential(migrations3, files) {
|
|
|
45463
45581
|
}
|
|
45464
45582
|
|
|
45465
45583
|
// src/commands/verify/migrations/listMigrationFiles.ts
|
|
45466
|
-
import { readdirSync as
|
|
45584
|
+
import { readdirSync as readdirSync23 } from "fs";
|
|
45467
45585
|
var MIGRATION_FILE2 = /^migration\d+[A-Za-z0-9]*\.ts$/;
|
|
45468
45586
|
function listMigrationFiles(dir) {
|
|
45469
|
-
return
|
|
45587
|
+
return readdirSync23(dir).filter((file) => MIGRATION_FILE2.test(file));
|
|
45470
45588
|
}
|
|
45471
45589
|
|
|
45472
45590
|
// src/commands/verify/migrations/readBaselineMigrations.ts
|
|
@@ -46428,17 +46546,17 @@ function registerWatch(program) {
|
|
|
46428
46546
|
|
|
46429
46547
|
// src/commands/roam/postRoamActivity.ts
|
|
46430
46548
|
import { execFileSync as execFileSync32 } from "child_process";
|
|
46431
|
-
import { readdirSync as
|
|
46432
|
-
import { join as
|
|
46549
|
+
import { readdirSync as readdirSync24, readFileSync as readFileSync68, statSync as statSync13 } from "fs";
|
|
46550
|
+
import { join as join105 } from "path";
|
|
46433
46551
|
function findPortFile(roamDir) {
|
|
46434
46552
|
let entries;
|
|
46435
46553
|
try {
|
|
46436
|
-
entries =
|
|
46554
|
+
entries = readdirSync24(roamDir);
|
|
46437
46555
|
} catch {
|
|
46438
46556
|
return void 0;
|
|
46439
46557
|
}
|
|
46440
46558
|
const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
|
|
46441
|
-
const path109 =
|
|
46559
|
+
const path109 = join105(roamDir, name);
|
|
46442
46560
|
try {
|
|
46443
46561
|
return { path: path109, mtimeMs: statSync13(path109).mtimeMs };
|
|
46444
46562
|
} catch {
|
|
@@ -46455,7 +46573,7 @@ var PID_BY_APP = {
|
|
|
46455
46573
|
function postRoamActivity(app, event) {
|
|
46456
46574
|
const appData = process.env.APPDATA;
|
|
46457
46575
|
if (!appData) return;
|
|
46458
|
-
const portFile = findPortFile(
|
|
46576
|
+
const portFile = findPortFile(join105(appData, "Roam"));
|
|
46459
46577
|
if (!portFile) return;
|
|
46460
46578
|
let port;
|
|
46461
46579
|
try {
|
|
@@ -46798,11 +46916,11 @@ function requireParsedArgs() {
|
|
|
46798
46916
|
}
|
|
46799
46917
|
|
|
46800
46918
|
// src/commands/run/runCommandFilePath.ts
|
|
46801
|
-
import { join as
|
|
46919
|
+
import { join as join106 } from "path";
|
|
46802
46920
|
function runCommandFilePath(name) {
|
|
46803
46921
|
const segments = name.split(":");
|
|
46804
46922
|
const file = `${segments.pop()}.md`;
|
|
46805
|
-
return
|
|
46923
|
+
return join106(".claude", "commands", ...segments, file);
|
|
46806
46924
|
}
|
|
46807
46925
|
|
|
46808
46926
|
// src/commands/run/add.ts
|
|
@@ -46930,8 +47048,8 @@ function registerRunAdd(runCommand) {
|
|
|
46930
47048
|
}
|
|
46931
47049
|
|
|
46932
47050
|
// src/commands/run/remove.ts
|
|
46933
|
-
import { existsSync as existsSync85, readdirSync as
|
|
46934
|
-
import { dirname as dirname46, join as
|
|
47051
|
+
import { existsSync as existsSync85, readdirSync as readdirSync25, rmdirSync, unlinkSync as unlinkSync21 } from "fs";
|
|
47052
|
+
import { dirname as dirname46, join as join107 } from "path";
|
|
46935
47053
|
|
|
46936
47054
|
// src/commands/run/removeRepoRunConfig.ts
|
|
46937
47055
|
function isNamed(entry, name) {
|
|
@@ -46949,15 +47067,15 @@ function removeRepoRunConfig(name, repoName, cwd = process.cwd()) {
|
|
|
46949
47067
|
|
|
46950
47068
|
// src/commands/run/remove.ts
|
|
46951
47069
|
function removeEmptyNamespaceDirs(filePath) {
|
|
46952
|
-
const root2 =
|
|
47070
|
+
const root2 = join107(".claude", "commands");
|
|
46953
47071
|
for (let dir = dirname46(filePath); dir !== root2; dir = dirname46(dir)) {
|
|
46954
|
-
if (!existsSync85(dir) ||
|
|
47072
|
+
if (!existsSync85(dir) || readdirSync25(dir).length > 0) return;
|
|
46955
47073
|
rmdirSync(dir);
|
|
46956
47074
|
}
|
|
46957
47075
|
}
|
|
46958
47076
|
function deleteCommandFile(name) {
|
|
46959
47077
|
const filePath = runCommandFilePath(name);
|
|
46960
|
-
const legacyPath =
|
|
47078
|
+
const legacyPath = join107(".claude", "commands", `${name}.md`);
|
|
46961
47079
|
for (const path109 of /* @__PURE__ */ new Set([filePath, legacyPath])) {
|
|
46962
47080
|
if (existsSync85(path109)) {
|
|
46963
47081
|
unlinkSync21(path109);
|
|
@@ -47014,18 +47132,18 @@ function registerRun(program) {
|
|
|
47014
47132
|
}
|
|
47015
47133
|
|
|
47016
47134
|
// src/commands/sessions/nodes/formatLink.ts
|
|
47017
|
-
import
|
|
47135
|
+
import chalk274 from "chalk";
|
|
47018
47136
|
var STATE_COLOURS = {
|
|
47019
|
-
connected:
|
|
47020
|
-
connecting:
|
|
47021
|
-
disconnected:
|
|
47022
|
-
"version-blocked":
|
|
47137
|
+
connected: chalk274.green,
|
|
47138
|
+
connecting: chalk274.yellow,
|
|
47139
|
+
disconnected: chalk274.red,
|
|
47140
|
+
"version-blocked": chalk274.red
|
|
47023
47141
|
};
|
|
47024
47142
|
function formatLink(link3) {
|
|
47025
|
-
const colour = STATE_COLOURS[link3.state] ??
|
|
47143
|
+
const colour = STATE_COLOURS[link3.state] ?? chalk274.white;
|
|
47026
47144
|
const peer = link3.peerVersion ? ` peer ${link3.peerVersion}` : "";
|
|
47027
47145
|
const error = link3.error ? `
|
|
47028
|
-
${
|
|
47146
|
+
${chalk274.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
|
|
47029
47147
|
return ` ${link3.name} ${colour(link3.state)} ${link3.url}${peer}${error}`;
|
|
47030
47148
|
}
|
|
47031
47149
|
|
|
@@ -47749,7 +47867,7 @@ function broadcastSessions(sessions, clients, linkedSessions = [], active) {
|
|
|
47749
47867
|
|
|
47750
47868
|
// src/commands/sessions/daemon/findServerParents.ts
|
|
47751
47869
|
import { existsSync as existsSync87 } from "fs";
|
|
47752
|
-
import { join as
|
|
47870
|
+
import { join as join108, resolve as resolve30 } from "path";
|
|
47753
47871
|
function isLive(session) {
|
|
47754
47872
|
return !!session.pty && session.status !== "done" && session.status !== "error";
|
|
47755
47873
|
}
|
|
@@ -47758,7 +47876,7 @@ function isLiveAgent(session) {
|
|
|
47758
47876
|
}
|
|
47759
47877
|
function serverRunDirs(sessions, file) {
|
|
47760
47878
|
return new Set(
|
|
47761
|
-
sessions.filter((s) => s.server && s.cwd && isLive(s)).map((s) => resolve30(s.cwd)).filter((dir) => existsSync87(
|
|
47879
|
+
sessions.filter((s) => s.server && s.cwd && isLive(s)).map((s) => resolve30(s.cwd)).filter((dir) => existsSync87(join108(dir, file)))
|
|
47762
47880
|
);
|
|
47763
47881
|
}
|
|
47764
47882
|
function findServerParents(sessions, file) {
|
|
@@ -49283,12 +49401,12 @@ import { basename as basename32 } from "path";
|
|
|
49283
49401
|
|
|
49284
49402
|
// src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
|
|
49285
49403
|
import { existsSync as existsSync93 } from "fs";
|
|
49286
|
-
import { join as
|
|
49404
|
+
import { join as join112 } from "path";
|
|
49287
49405
|
|
|
49288
49406
|
// src/commands/sessions/daemon/worktree/deleteTreeDirectly.ts
|
|
49289
49407
|
import { statSync as statSync15 } from "fs";
|
|
49290
49408
|
import { rm as rm3 } from "fs/promises";
|
|
49291
|
-
import { join as
|
|
49409
|
+
import { join as join111 } from "path";
|
|
49292
49410
|
async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
49293
49411
|
if (holdsAGitDirectoryRatherThanALink(worktreePath)) {
|
|
49294
49412
|
const refusal = "it is a clone of its own, not a linked worktree";
|
|
@@ -49316,7 +49434,7 @@ async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
|
49316
49434
|
return { removed: true };
|
|
49317
49435
|
}
|
|
49318
49436
|
function holdsAGitDirectoryRatherThanALink(worktreePath) {
|
|
49319
|
-
return statSync15(
|
|
49437
|
+
return statSync15(join111(worktreePath, ".git"), {
|
|
49320
49438
|
throwIfNoEntry: false
|
|
49321
49439
|
})?.isDirectory() === true;
|
|
49322
49440
|
}
|
|
@@ -49352,7 +49470,7 @@ async function deleteStrandedTree(clone, worktreePath, cause) {
|
|
|
49352
49470
|
);
|
|
49353
49471
|
}
|
|
49354
49472
|
function strandedReason(worktreePath, cause) {
|
|
49355
|
-
if (!existsSync93(
|
|
49473
|
+
if (!existsSync93(join112(worktreePath, ".git")))
|
|
49356
49474
|
return "its .git link is already gone";
|
|
49357
49475
|
if (/not a working tree|not a git repository/i.test(reason2(cause)))
|
|
49358
49476
|
return "git no longer recognises it as a working tree";
|
|
@@ -49585,12 +49703,12 @@ function closeGateApplies(sessions, session) {
|
|
|
49585
49703
|
}
|
|
49586
49704
|
|
|
49587
49705
|
// src/commands/sessions/daemon/worktree/liveProcessesInTree.ts
|
|
49588
|
-
import { readdirSync as
|
|
49706
|
+
import { readdirSync as readdirSync27, readlinkSync } from "fs";
|
|
49589
49707
|
import { sep as sep4 } from "path";
|
|
49590
49708
|
function liveProcessesInTree(treePath, procRoot = "/proc") {
|
|
49591
49709
|
let entries;
|
|
49592
49710
|
try {
|
|
49593
|
-
entries =
|
|
49711
|
+
entries = readdirSync27(procRoot);
|
|
49594
49712
|
} catch {
|
|
49595
49713
|
return [];
|
|
49596
49714
|
}
|
|
@@ -53902,7 +54020,7 @@ import { existsSync as existsSync101 } from "fs";
|
|
|
53902
54020
|
|
|
53903
54021
|
// src/commands/sessions/daemon/worktree/carryTranscriptToTree.ts
|
|
53904
54022
|
import { copyFileSync as copyFileSync4, existsSync as existsSync100, mkdirSync as mkdirSync42 } from "fs";
|
|
53905
|
-
import { join as
|
|
54023
|
+
import { join as join113 } from "path";
|
|
53906
54024
|
function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
|
|
53907
54025
|
const dir = projectDirForCwd(toCwd);
|
|
53908
54026
|
if (dir === projectDirForCwd(fromCwd)) {
|
|
@@ -53911,7 +54029,7 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
|
|
|
53911
54029
|
);
|
|
53912
54030
|
return;
|
|
53913
54031
|
}
|
|
53914
|
-
const dest =
|
|
54032
|
+
const dest = join113(dir, `${claudeSessionId}.jsonl`);
|
|
53915
54033
|
if (existsSync100(dest)) {
|
|
53916
54034
|
daemonLog(`transcript ${claudeSessionId} already present in ${dir}`);
|
|
53917
54035
|
return;
|
|
@@ -55479,7 +55597,7 @@ async function closeSession2() {
|
|
|
55479
55597
|
}
|
|
55480
55598
|
|
|
55481
55599
|
// src/commands/sessions/nodes/listNodes.ts
|
|
55482
|
-
import
|
|
55600
|
+
import chalk275 from "chalk";
|
|
55483
55601
|
async function nodesReport() {
|
|
55484
55602
|
const live = await queryNodes();
|
|
55485
55603
|
if (live)
|
|
@@ -55496,10 +55614,10 @@ async function listNodes(options2) {
|
|
|
55496
55614
|
console.log(JSON.stringify(report, null, 2));
|
|
55497
55615
|
return;
|
|
55498
55616
|
}
|
|
55499
|
-
console.log(`${report.local} ${
|
|
55617
|
+
console.log(`${report.local} ${chalk275.dim("(this node)")}`);
|
|
55500
55618
|
if (!report.daemonRunning)
|
|
55501
|
-
console.log(
|
|
55502
|
-
if (report.links.length === 0) console.log(
|
|
55619
|
+
console.log(chalk275.dim(" daemon not running; showing configured links"));
|
|
55620
|
+
if (report.links.length === 0) console.log(chalk275.dim(" no links"));
|
|
55503
55621
|
for (const link3 of report.links) console.log(formatLink(link3));
|
|
55504
55622
|
}
|
|
55505
55623
|
|
|
@@ -55521,7 +55639,7 @@ async function findUnlinkedWindowsNode(health2, platform = detectPlatform()) {
|
|
|
55521
55639
|
}
|
|
55522
55640
|
|
|
55523
55641
|
// src/commands/sessions/nodes/printReport.ts
|
|
55524
|
-
import
|
|
55642
|
+
import chalk276 from "chalk";
|
|
55525
55643
|
function printReport(report) {
|
|
55526
55644
|
if (report.links.length === 0) {
|
|
55527
55645
|
console.log(`${report.local} has no links`);
|
|
@@ -55535,11 +55653,11 @@ function printReport(report) {
|
|
|
55535
55653
|
for (const diagnosis of report.links) printDiagnosis(diagnosis);
|
|
55536
55654
|
}
|
|
55537
55655
|
function printDiagnosis(diagnosis) {
|
|
55538
|
-
console.log(`${
|
|
55656
|
+
console.log(`${chalk276.bold(diagnosis.name)} ${chalk276.dim(diagnosis.url)}`);
|
|
55539
55657
|
for (const hop of diagnosis.hops) {
|
|
55540
|
-
const mark = hop.ok ?
|
|
55658
|
+
const mark = hop.ok ? chalk276.green("\u2713") : chalk276.red("\u2717");
|
|
55541
55659
|
console.log(` ${mark} ${hop.hop.padEnd(9)} ${hop.detail ?? hop.error}`);
|
|
55542
|
-
if (hop.remediation) console.log(` ${
|
|
55660
|
+
if (hop.remediation) console.log(` ${chalk276.yellow(hop.remediation)}`);
|
|
55543
55661
|
}
|
|
55544
55662
|
}
|
|
55545
55663
|
|
|
@@ -55611,14 +55729,14 @@ function registerDiagnoseCommands(nodes, calledBy5) {
|
|
|
55611
55729
|
}
|
|
55612
55730
|
|
|
55613
55731
|
// src/commands/sessions/nodes/linkNode.ts
|
|
55614
|
-
import
|
|
55732
|
+
import chalk279 from "chalk";
|
|
55615
55733
|
|
|
55616
55734
|
// src/commands/sessions/nodes/notifyDaemonLinks.ts
|
|
55617
|
-
import
|
|
55735
|
+
import chalk277 from "chalk";
|
|
55618
55736
|
async function notifyDaemonLinks() {
|
|
55619
55737
|
if (!await isDaemonRunning()) {
|
|
55620
55738
|
console.log(
|
|
55621
|
-
|
|
55739
|
+
chalk277.yellow(
|
|
55622
55740
|
"The sessions daemon is not running; it loads the links when it starts."
|
|
55623
55741
|
)
|
|
55624
55742
|
);
|
|
@@ -55626,11 +55744,11 @@ async function notifyDaemonLinks() {
|
|
|
55626
55744
|
}
|
|
55627
55745
|
try {
|
|
55628
55746
|
await sendToDaemonAwaitAck({ type: "reload-links" });
|
|
55629
|
-
console.log(
|
|
55747
|
+
console.log(chalk277.dim("The sessions daemon reloaded its links."));
|
|
55630
55748
|
} catch (error) {
|
|
55631
55749
|
const message3 = error instanceof Error ? error.message : String(error);
|
|
55632
55750
|
console.log(
|
|
55633
|
-
|
|
55751
|
+
chalk277.yellow(
|
|
55634
55752
|
`Could not notify the sessions daemon (${message3}); run \`assist daemon restart\` to apply the change.`
|
|
55635
55753
|
)
|
|
55636
55754
|
);
|
|
@@ -55638,7 +55756,7 @@ async function notifyDaemonLinks() {
|
|
|
55638
55756
|
}
|
|
55639
55757
|
|
|
55640
55758
|
// src/commands/sessions/nodes/readLinks.ts
|
|
55641
|
-
import
|
|
55759
|
+
import chalk278 from "chalk";
|
|
55642
55760
|
|
|
55643
55761
|
// src/commands/sessions/nodes/writeLinks.ts
|
|
55644
55762
|
async function writeLinks(links2) {
|
|
@@ -55661,7 +55779,7 @@ async function readLinks() {
|
|
|
55661
55779
|
await writeLinks(links2);
|
|
55662
55780
|
const dropped = stored.filter((link3) => !link3.url).map((link3) => link3.name);
|
|
55663
55781
|
console.log(
|
|
55664
|
-
|
|
55782
|
+
chalk278.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
|
|
55665
55783
|
);
|
|
55666
55784
|
return links2;
|
|
55667
55785
|
}
|
|
@@ -55717,7 +55835,7 @@ async function linkNode(name, url, options2) {
|
|
|
55717
55835
|
throw new Error(`${name} is this node; link to a different node`);
|
|
55718
55836
|
const link3 = await buildLink(name, url, options2);
|
|
55719
55837
|
await writeLinks([...others, link3]);
|
|
55720
|
-
console.log(
|
|
55838
|
+
console.log(chalk279.green(`Linked ${name} (${link3.url})`));
|
|
55721
55839
|
await notifyDaemonLinks();
|
|
55722
55840
|
}
|
|
55723
55841
|
|
|
@@ -55900,16 +56018,16 @@ function registerPeerActionCommands(nodes, calledBy5) {
|
|
|
55900
56018
|
}
|
|
55901
56019
|
|
|
55902
56020
|
// src/commands/sessions/nodes/unlinkNode.ts
|
|
55903
|
-
import
|
|
56021
|
+
import chalk280 from "chalk";
|
|
55904
56022
|
async function unlinkNode(name) {
|
|
55905
56023
|
const links2 = await readLinks();
|
|
55906
56024
|
const remaining = links2.filter((link3) => link3.name !== name);
|
|
55907
56025
|
if (remaining.length === links2.length) {
|
|
55908
|
-
console.log(
|
|
56026
|
+
console.log(chalk280.yellow(`No link named ${name}`));
|
|
55909
56027
|
return;
|
|
55910
56028
|
}
|
|
55911
56029
|
await writeLinks(remaining);
|
|
55912
|
-
console.log(
|
|
56030
|
+
console.log(chalk280.green(`Unlinked ${name}`));
|
|
55913
56031
|
await notifyDaemonLinks();
|
|
55914
56032
|
}
|
|
55915
56033
|
|
|
@@ -56147,10 +56265,10 @@ function createProgram() {
|
|
|
56147
56265
|
}
|
|
56148
56266
|
|
|
56149
56267
|
// src/reportCliError.ts
|
|
56150
|
-
import
|
|
56268
|
+
import chalk281 from "chalk";
|
|
56151
56269
|
function reportCliError(error) {
|
|
56152
56270
|
if (error instanceof InvalidItemIdError || error instanceof AmbiguousRepoConfigError || error instanceof UnknownRepoConfigError || error instanceof MissingRunCwdError || error instanceof MiroExtractError || error instanceof MissingDatabaseUrlError) {
|
|
56153
|
-
console.error(
|
|
56271
|
+
console.error(chalk281.red(error.message));
|
|
56154
56272
|
} else {
|
|
56155
56273
|
console.error(error);
|
|
56156
56274
|
}
|