@staff0rd/assist 0.778.0 → 0.779.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/README.md +2 -1
- package/claude/skills/review-ci/scripts/review.mjs +1 -1
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +695 -580
- 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.779.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -619,7 +619,7 @@ function warnYmlRepoOverride(key) {
|
|
|
619
619
|
warnedYmlKeys.add(key);
|
|
620
620
|
console.error(
|
|
621
621
|
chalk4.yellow(
|
|
622
|
-
`repos.${key} in ~/.assist.yml is not in the shared db, so other nodes don't see it.
|
|
622
|
+
`repos.${key} in ~/.assist.yml is not in the shared db, so other nodes don't see it. Run 'assist config import-repos' to share it.`
|
|
623
623
|
)
|
|
624
624
|
);
|
|
625
625
|
}
|
|
@@ -21441,18 +21441,178 @@ function unsetLines(key) {
|
|
|
21441
21441
|
return lines2;
|
|
21442
21442
|
}
|
|
21443
21443
|
|
|
21444
|
-
// src/commands/config/
|
|
21444
|
+
// src/commands/config/configImportRepos.ts
|
|
21445
|
+
import chalk136 from "chalk";
|
|
21446
|
+
|
|
21447
|
+
// src/shared/db/listRepoConfigs.ts
|
|
21448
|
+
async function listRepoConfigs(orm) {
|
|
21449
|
+
const rows = await orm.select().from(repoConfigs);
|
|
21450
|
+
return Object.fromEntries(rows.map((row) => [row.repoKey, row.config]));
|
|
21451
|
+
}
|
|
21452
|
+
|
|
21453
|
+
// src/shared/db/saveRepoConfig.ts
|
|
21454
|
+
import { eq as eq45 } from "drizzle-orm";
|
|
21455
|
+
async function saveRepoConfig(orm, repoKey, config) {
|
|
21456
|
+
if (Object.keys(config).length === 0) {
|
|
21457
|
+
await orm.delete(repoConfigs).where(eq45(repoConfigs.repoKey, repoKey));
|
|
21458
|
+
return;
|
|
21459
|
+
}
|
|
21460
|
+
await orm.insert(repoConfigs).values({ repoKey, config }).onConflictDoUpdate({
|
|
21461
|
+
target: repoConfigs.repoKey,
|
|
21462
|
+
set: { config, updatedAt: /* @__PURE__ */ new Date() }
|
|
21463
|
+
});
|
|
21464
|
+
}
|
|
21465
|
+
|
|
21466
|
+
// src/shared/writeRepoConfigCache.ts
|
|
21467
|
+
import { mkdirSync as mkdirSync15, renameSync as renameSync2, writeFileSync as writeFileSync26 } from "fs";
|
|
21468
|
+
import { dirname as dirname26 } from "path";
|
|
21469
|
+
function writeRepoConfigCache(repos2) {
|
|
21470
|
+
const path106 = repoConfigCachePath();
|
|
21471
|
+
mkdirSync15(dirname26(path106), { recursive: true });
|
|
21472
|
+
const cache6 = {
|
|
21473
|
+
refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
21474
|
+
repos: repos2
|
|
21475
|
+
};
|
|
21476
|
+
const tmp = `${path106}.${process.pid}.tmp`;
|
|
21477
|
+
writeFileSync26(tmp, JSON.stringify(cache6, null, 2));
|
|
21478
|
+
renameSync2(tmp, path106);
|
|
21479
|
+
}
|
|
21480
|
+
|
|
21481
|
+
// src/shared/refreshRepoConfigCache.ts
|
|
21482
|
+
async function refreshRepoConfigCache(orm) {
|
|
21483
|
+
const repos2 = await listRepoConfigs(orm ?? await getDb());
|
|
21484
|
+
writeRepoConfigCache(repos2);
|
|
21485
|
+
return Object.keys(repos2).length;
|
|
21486
|
+
}
|
|
21487
|
+
|
|
21488
|
+
// src/commands/config/exitWithConfigErrors.ts
|
|
21445
21489
|
import chalk134 from "chalk";
|
|
21490
|
+
function exitWithConfigErrors(errors) {
|
|
21491
|
+
for (const error of errors) console.error(chalk134.red(error));
|
|
21492
|
+
process.exit(1);
|
|
21493
|
+
}
|
|
21494
|
+
|
|
21495
|
+
// src/commands/config/diffRepoConfigLeaves.ts
|
|
21496
|
+
import { isDeepStrictEqual } from "util";
|
|
21497
|
+
function diffRepoConfigLeaves(current, incoming) {
|
|
21498
|
+
const existing = new Map(leaves(current));
|
|
21499
|
+
return leaves(incoming).flatMap(([key, to]) => {
|
|
21500
|
+
if (!existing.has(key)) return [{ key, to }];
|
|
21501
|
+
const from = existing.get(key);
|
|
21502
|
+
return isDeepStrictEqual(from, to) ? [] : [{ key, from, to }];
|
|
21503
|
+
});
|
|
21504
|
+
}
|
|
21505
|
+
function leaves(node, prefix2 = "") {
|
|
21506
|
+
return Object.entries(node).flatMap(([key, value]) => {
|
|
21507
|
+
const path106 = prefix2 ? `${prefix2}.${key}` : key;
|
|
21508
|
+
return isPlainObject5(value) && Object.keys(value).length > 0 ? leaves(value, path106) : [[path106, value]];
|
|
21509
|
+
});
|
|
21510
|
+
}
|
|
21511
|
+
function isPlainObject5(value) {
|
|
21512
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
21513
|
+
}
|
|
21514
|
+
|
|
21515
|
+
// src/commands/config/planRepoConfigImport.ts
|
|
21516
|
+
function planRepoConfigImport(ymlRepos, dbRepos) {
|
|
21517
|
+
return Object.entries(ymlRepos).map(([ymlKey, block]) => {
|
|
21518
|
+
const dbKey = matchDbKey(dbRepos, ymlKey) ?? ymlKey;
|
|
21519
|
+
const current = dbRepos[dbKey] ?? {};
|
|
21520
|
+
const incoming = isPlainObject6(block) ? block : {};
|
|
21521
|
+
const changes = diffRepoConfigLeaves(current, incoming);
|
|
21522
|
+
const merged = changes.reduce(
|
|
21523
|
+
(acc, change) => setNestedValue(acc, change.key, change.to),
|
|
21524
|
+
current
|
|
21525
|
+
);
|
|
21526
|
+
const validation = validateConfig(merged, ymlKey, repoConfigSchema);
|
|
21527
|
+
const errors = validation.ok ? [] : validation.errors.map((error) => `repos.${ymlKey}.${error}`);
|
|
21528
|
+
return { ymlKey, dbKey, changes, merged, errors };
|
|
21529
|
+
});
|
|
21530
|
+
}
|
|
21531
|
+
function matchDbKey(dbRepos, ymlKey) {
|
|
21532
|
+
const ymlCandidates = originKeyCandidates(ymlKey);
|
|
21533
|
+
const matches = Object.keys(dbRepos).filter(
|
|
21534
|
+
(key) => ymlCandidates.has(key) || originKeyCandidates(key).has(ymlKey)
|
|
21535
|
+
);
|
|
21536
|
+
if (matches.length > 1)
|
|
21537
|
+
throw new AmbiguousRepoConfigError(
|
|
21538
|
+
`Ambiguous repos config in ${SHARED_REPO_CONFIG_SOURCE}: keys ${matches.map((m) => `"${m}"`).join(", ")} all match "${ymlKey}". Keep a single key per repository.`
|
|
21539
|
+
);
|
|
21540
|
+
return matches[0];
|
|
21541
|
+
}
|
|
21542
|
+
function isPlainObject6(value) {
|
|
21543
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
21544
|
+
}
|
|
21545
|
+
|
|
21546
|
+
// src/commands/config/printRepoConfigImportPlan.ts
|
|
21547
|
+
import chalk135 from "chalk";
|
|
21548
|
+
function printRepoConfigImportPlan(plans) {
|
|
21549
|
+
for (const plan2 of plans) {
|
|
21550
|
+
const target = plan2.dbKey === plan2.ymlKey ? "" : chalk135.dim(` \u2192 ${plan2.dbKey}`);
|
|
21551
|
+
console.log(chalk135.bold(`repos.${plan2.ymlKey}${target}`));
|
|
21552
|
+
if (plan2.changes.length === 0)
|
|
21553
|
+
console.log(chalk135.dim(" already in the shared db"));
|
|
21554
|
+
for (const change of plan2.changes) {
|
|
21555
|
+
const to = show2(change.key, change.to);
|
|
21556
|
+
console.log(
|
|
21557
|
+
"from" in change ? chalk135.yellow(
|
|
21558
|
+
` ~ ${change.key}: ${show2(change.key, change.from)} \u2192 ${to}`
|
|
21559
|
+
) : chalk135.green(` + ${change.key}: ${to}`)
|
|
21560
|
+
);
|
|
21561
|
+
}
|
|
21562
|
+
}
|
|
21563
|
+
}
|
|
21564
|
+
function show2(key, value) {
|
|
21565
|
+
return JSON.stringify(maskConfigKeySecrets(key, value));
|
|
21566
|
+
}
|
|
21567
|
+
|
|
21568
|
+
// src/commands/config/configImportRepos.ts
|
|
21569
|
+
async function configImportRepos() {
|
|
21570
|
+
const { repos: ymlRepos, ...rest } = loadGlobalConfigRaw();
|
|
21571
|
+
if (!isPlainObject7(ymlRepos) || Object.keys(ymlRepos).length === 0) {
|
|
21572
|
+
console.log("No repos: in ~/.assist.yml to import.");
|
|
21573
|
+
return;
|
|
21574
|
+
}
|
|
21575
|
+
const orm = await getDb();
|
|
21576
|
+
const plans = planRepoConfigImport(ymlRepos, await listRepoConfigs(orm));
|
|
21577
|
+
printRepoConfigImportPlan(plans);
|
|
21578
|
+
const errors = plans.flatMap((plan2) => plan2.errors);
|
|
21579
|
+
if (errors.length > 0) exitWithConfigErrors(errors);
|
|
21580
|
+
const confirmed = await promptConfirm(
|
|
21581
|
+
"Write these keys to the shared db and remove repos: from ~/.assist.yml?",
|
|
21582
|
+
false
|
|
21583
|
+
);
|
|
21584
|
+
if (!confirmed) {
|
|
21585
|
+
console.log("Nothing imported.");
|
|
21586
|
+
return;
|
|
21587
|
+
}
|
|
21588
|
+
const changed = plans.filter((plan2) => plan2.changes.length > 0);
|
|
21589
|
+
for (const plan2 of changed)
|
|
21590
|
+
await saveRepoConfig(orm, plan2.dbKey, plan2.merged);
|
|
21591
|
+
await refreshRepoConfigCache(orm);
|
|
21592
|
+
saveGlobalConfig(rest);
|
|
21593
|
+
const keys = changed.reduce((n, plan2) => n + plan2.changes.length, 0);
|
|
21594
|
+
console.log(
|
|
21595
|
+
chalk136.green(
|
|
21596
|
+
`Imported ${keys} key(s) across ${changed.length} repo(s) and removed repos: from ~/.assist.yml`
|
|
21597
|
+
)
|
|
21598
|
+
);
|
|
21599
|
+
}
|
|
21600
|
+
function isPlainObject7(value) {
|
|
21601
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
21602
|
+
}
|
|
21603
|
+
|
|
21604
|
+
// src/commands/config/configKeys.ts
|
|
21605
|
+
import chalk137 from "chalk";
|
|
21446
21606
|
function configKeys(filter) {
|
|
21447
|
-
const
|
|
21448
|
-
const matches = filter ?
|
|
21607
|
+
const leaves2 = describeConfigLeaves(assistConfigSchema);
|
|
21608
|
+
const matches = filter ? leaves2.filter(matching(filter)) : leaves2;
|
|
21449
21609
|
if (matches.length === 0) {
|
|
21450
|
-
console.error(
|
|
21610
|
+
console.error(chalk137.red(`No config key matches "${filter}"`));
|
|
21451
21611
|
process.exit(1);
|
|
21452
21612
|
}
|
|
21453
|
-
console.log(headline(matches.length,
|
|
21613
|
+
console.log(headline(matches.length, leaves2.length, filter));
|
|
21454
21614
|
console.log(
|
|
21455
|
-
|
|
21615
|
+
chalk137.dim(
|
|
21456
21616
|
"Defaults come from the schema; assist config list shows what is set."
|
|
21457
21617
|
)
|
|
21458
21618
|
);
|
|
@@ -21468,13 +21628,13 @@ function matching(filter) {
|
|
|
21468
21628
|
return (leaf) => leaf.key.toLowerCase().includes(needle);
|
|
21469
21629
|
}
|
|
21470
21630
|
function headline(shown, total, filter) {
|
|
21471
|
-
return filter ?
|
|
21631
|
+
return filter ? chalk137.bold(`${shown} of ${total} config keys matching "${filter}"`) : chalk137.bold(`${total} config keys`);
|
|
21472
21632
|
}
|
|
21473
21633
|
function formatLeaf(leaf, help) {
|
|
21474
21634
|
const meta = [typeText(leaf), `default: ${formatConfigDefault(leaf)}`];
|
|
21475
21635
|
if (leaf.secret) meta.push("secret");
|
|
21476
|
-
const lines2 = [`${
|
|
21477
|
-
if (help) lines2.push(` ${help.note}`, ` ${
|
|
21636
|
+
const lines2 = [`${chalk137.cyan(leaf.key)} ${chalk137.dim(meta.join(" "))}`];
|
|
21637
|
+
if (help) lines2.push(` ${help.note}`, ` ${chalk137.green(help.setter)}`);
|
|
21478
21638
|
return lines2;
|
|
21479
21639
|
}
|
|
21480
21640
|
function typeText(leaf) {
|
|
@@ -21485,13 +21645,7 @@ function typeText(leaf) {
|
|
|
21485
21645
|
}
|
|
21486
21646
|
|
|
21487
21647
|
// src/commands/config/configSet.ts
|
|
21488
|
-
import
|
|
21489
|
-
|
|
21490
|
-
// src/shared/db/listRepoConfigs.ts
|
|
21491
|
-
async function listRepoConfigs(orm) {
|
|
21492
|
-
const rows = await orm.select().from(repoConfigs);
|
|
21493
|
-
return Object.fromEntries(rows.map((row) => [row.repoKey, row.config]));
|
|
21494
|
-
}
|
|
21648
|
+
import chalk138 from "chalk";
|
|
21495
21649
|
|
|
21496
21650
|
// src/commands/config/resolveSharedRepoBlock.ts
|
|
21497
21651
|
async function resolveSharedRepoBlock(orm, repoName, cwd) {
|
|
@@ -21503,41 +21657,6 @@ function currentRepoLabel(shared, origin) {
|
|
|
21503
21657
|
return matchRepoConfigKey(shared, origin, SHARED_REPO_CONFIG_SOURCE) ?? origin;
|
|
21504
21658
|
}
|
|
21505
21659
|
|
|
21506
|
-
// src/shared/db/saveRepoConfig.ts
|
|
21507
|
-
import { eq as eq45 } from "drizzle-orm";
|
|
21508
|
-
async function saveRepoConfig(orm, repoKey, config) {
|
|
21509
|
-
if (Object.keys(config).length === 0) {
|
|
21510
|
-
await orm.delete(repoConfigs).where(eq45(repoConfigs.repoKey, repoKey));
|
|
21511
|
-
return;
|
|
21512
|
-
}
|
|
21513
|
-
await orm.insert(repoConfigs).values({ repoKey, config }).onConflictDoUpdate({
|
|
21514
|
-
target: repoConfigs.repoKey,
|
|
21515
|
-
set: { config, updatedAt: /* @__PURE__ */ new Date() }
|
|
21516
|
-
});
|
|
21517
|
-
}
|
|
21518
|
-
|
|
21519
|
-
// src/shared/writeRepoConfigCache.ts
|
|
21520
|
-
import { mkdirSync as mkdirSync15, renameSync as renameSync2, writeFileSync as writeFileSync26 } from "fs";
|
|
21521
|
-
import { dirname as dirname26 } from "path";
|
|
21522
|
-
function writeRepoConfigCache(repos2) {
|
|
21523
|
-
const path106 = repoConfigCachePath();
|
|
21524
|
-
mkdirSync15(dirname26(path106), { recursive: true });
|
|
21525
|
-
const cache6 = {
|
|
21526
|
-
refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
21527
|
-
repos: repos2
|
|
21528
|
-
};
|
|
21529
|
-
const tmp = `${path106}.${process.pid}.tmp`;
|
|
21530
|
-
writeFileSync26(tmp, JSON.stringify(cache6, null, 2));
|
|
21531
|
-
renameSync2(tmp, path106);
|
|
21532
|
-
}
|
|
21533
|
-
|
|
21534
|
-
// src/shared/refreshRepoConfigCache.ts
|
|
21535
|
-
async function refreshRepoConfigCache(orm) {
|
|
21536
|
-
const repos2 = await listRepoConfigs(orm ?? await getDb());
|
|
21537
|
-
writeRepoConfigCache(repos2);
|
|
21538
|
-
return Object.keys(repos2).length;
|
|
21539
|
-
}
|
|
21540
|
-
|
|
21541
21660
|
// src/commands/config/saveSharedRepoBlock.ts
|
|
21542
21661
|
async function saveSharedRepoBlock(orm, label2, block) {
|
|
21543
21662
|
await saveRepoConfig(orm, label2, block);
|
|
@@ -21575,13 +21694,6 @@ function coerceWithoutSchemaLeaf(raw) {
|
|
|
21575
21694
|
return raw;
|
|
21576
21695
|
}
|
|
21577
21696
|
|
|
21578
|
-
// src/commands/config/exitWithConfigErrors.ts
|
|
21579
|
-
import chalk135 from "chalk";
|
|
21580
|
-
function exitWithConfigErrors(errors) {
|
|
21581
|
-
for (const error of errors) console.error(chalk135.red(error));
|
|
21582
|
-
process.exit(1);
|
|
21583
|
-
}
|
|
21584
|
-
|
|
21585
21697
|
// src/commands/config/resolveRepoTarget.ts
|
|
21586
21698
|
function resolveRepoTarget(key, value, repo) {
|
|
21587
21699
|
if (typeof repo === "string") {
|
|
@@ -21597,13 +21709,13 @@ function resolveRepoTarget(key, value, repo) {
|
|
|
21597
21709
|
async function configSet(key, value, options2 = {}) {
|
|
21598
21710
|
if (options2.repo !== void 0 && !options2.global) {
|
|
21599
21711
|
console.error(
|
|
21600
|
-
|
|
21712
|
+
chalk138.red("--repo writes to the global config; add -g (e.g. -g --repo)")
|
|
21601
21713
|
);
|
|
21602
21714
|
process.exit(1);
|
|
21603
21715
|
}
|
|
21604
21716
|
const resolved = resolveRepoTarget(key, value, options2.repo);
|
|
21605
21717
|
if (resolved.value === void 0) {
|
|
21606
|
-
console.error(
|
|
21718
|
+
console.error(chalk138.red(`Missing required argument for '${resolved.key}'`));
|
|
21607
21719
|
process.exit(1);
|
|
21608
21720
|
}
|
|
21609
21721
|
const coercion = coerceCliConfigValue(resolved.key, resolved.value);
|
|
@@ -21611,7 +21723,7 @@ async function configSet(key, value, options2 = {}) {
|
|
|
21611
21723
|
const coerced = coercion.value;
|
|
21612
21724
|
const target = resolved.useRepo ? `repo: ${await applyRepoOrExit(resolved.key, coerced, resolved.repoName)}` : applyOrExit(resolved.key, coerced, options2.global ?? false);
|
|
21613
21725
|
const shown = JSON.stringify(maskConfigKeySecrets(resolved.key, coerced));
|
|
21614
|
-
console.log(
|
|
21726
|
+
console.log(chalk138.green(`Set ${resolved.key} = ${shown} (${target})`));
|
|
21615
21727
|
}
|
|
21616
21728
|
function applyOrExit(key, coerced, global) {
|
|
21617
21729
|
const result = applyConfigSet(key, coerced, global);
|
|
@@ -21625,7 +21737,7 @@ async function applyRepoOrExit(key, coerced, repoName) {
|
|
|
21625
21737
|
}
|
|
21626
21738
|
|
|
21627
21739
|
// src/commands/config/configUnset.ts
|
|
21628
|
-
import
|
|
21740
|
+
import chalk139 from "chalk";
|
|
21629
21741
|
|
|
21630
21742
|
// src/commands/config/applySharedRepoConfigUnset.ts
|
|
21631
21743
|
async function applySharedRepoConfigUnset(key, repoName, cwd = process.cwd()) {
|
|
@@ -21653,7 +21765,7 @@ function resolveRepoUnsetTarget(key, repo) {
|
|
|
21653
21765
|
async function configUnset(key, options2 = {}) {
|
|
21654
21766
|
if (options2.repo !== void 0 && !options2.global) {
|
|
21655
21767
|
console.error(
|
|
21656
|
-
|
|
21768
|
+
chalk139.red(
|
|
21657
21769
|
"--repo removes from the global config; add -g (e.g. -g --repo)"
|
|
21658
21770
|
)
|
|
21659
21771
|
);
|
|
@@ -21661,7 +21773,7 @@ async function configUnset(key, options2 = {}) {
|
|
|
21661
21773
|
}
|
|
21662
21774
|
const resolved = resolveRepoUnsetTarget(key, options2.repo);
|
|
21663
21775
|
if (resolved.key === void 0) {
|
|
21664
|
-
console.error(
|
|
21776
|
+
console.error(chalk139.red("Missing required argument 'key'"));
|
|
21665
21777
|
process.exit(1);
|
|
21666
21778
|
return;
|
|
21667
21779
|
}
|
|
@@ -21669,11 +21781,11 @@ async function configUnset(key, options2 = {}) {
|
|
|
21669
21781
|
if (!result.ok) exitWithConfigErrors(result.errors);
|
|
21670
21782
|
if (!result.removed) {
|
|
21671
21783
|
console.log(
|
|
21672
|
-
|
|
21784
|
+
chalk139.yellow(`${resolved.key} is not set in ${whereLabel(result)}`)
|
|
21673
21785
|
);
|
|
21674
21786
|
return;
|
|
21675
21787
|
}
|
|
21676
|
-
console.log(
|
|
21788
|
+
console.log(chalk139.green(`Unset ${resolved.key} (${targetLabel(result)})`));
|
|
21677
21789
|
}
|
|
21678
21790
|
function whereLabel(result) {
|
|
21679
21791
|
return result.target === "repo" ? `repos.${result.label}` : `the ${result.target} config`;
|
|
@@ -21697,6 +21809,9 @@ function registerConfig(program2) {
|
|
|
21697
21809
|
"-r, --repo [name]",
|
|
21698
21810
|
"Requires -g: remove the key from a repo's shared db override (defaults to the current repo)"
|
|
21699
21811
|
).action((key, options2) => configUnset(key, options2));
|
|
21812
|
+
configCommand.command("import-repos").description(
|
|
21813
|
+
"Move this machine's ~/.assist.yml repos: overrides into the shared db, showing a per-key diff and asking first"
|
|
21814
|
+
).action(configImportRepos);
|
|
21700
21815
|
configCommand.command("get <key>").description("Get a config value (secrets print as <hidden>)").option("--reveal", "Print the raw value of a secret, undecorated").action((key, options2) => configGet(key, options2));
|
|
21701
21816
|
configCommand.command("list").description(
|
|
21702
21817
|
"List the config values that are set (secrets print as <hidden>); see 'config keys' for every key"
|
|
@@ -21708,7 +21823,7 @@ function registerConfig(program2) {
|
|
|
21708
21823
|
|
|
21709
21824
|
// src/commands/criteriaExtension/criteriaExtension.ts
|
|
21710
21825
|
import { cp } from "fs/promises";
|
|
21711
|
-
import
|
|
21826
|
+
import chalk140 from "chalk";
|
|
21712
21827
|
|
|
21713
21828
|
// src/commands/criteriaExtension/criteriaExtensionDir.ts
|
|
21714
21829
|
import { existsSync as existsSync47 } from "fs";
|
|
@@ -21736,7 +21851,7 @@ async function loadPath(source) {
|
|
|
21736
21851
|
return WSL_WINDOWS_PATH;
|
|
21737
21852
|
} catch {
|
|
21738
21853
|
console.log(
|
|
21739
|
-
|
|
21854
|
+
chalk140.yellow(`could not copy extension to ${WSL_WINDOWS_PATH}`)
|
|
21740
21855
|
);
|
|
21741
21856
|
return source;
|
|
21742
21857
|
}
|
|
@@ -21744,15 +21859,15 @@ async function loadPath(source) {
|
|
|
21744
21859
|
async function criteriaExtension() {
|
|
21745
21860
|
const path106 = await loadPath(criteriaExtensionDir());
|
|
21746
21861
|
console.log(
|
|
21747
|
-
|
|
21862
|
+
chalk140.bold("acceptance criteria outliner \u2014 GitHub browser extension")
|
|
21748
21863
|
);
|
|
21749
|
-
console.log(
|
|
21864
|
+
console.log(chalk140.dim(`load the unpacked extension from ${path106}`));
|
|
21750
21865
|
}
|
|
21751
21866
|
|
|
21752
21867
|
// src/commands/criteriaExtension/printCriteriaExtensionUrl.ts
|
|
21753
21868
|
import { readFile as readFile4 } from "fs/promises";
|
|
21754
21869
|
import { join as join52 } from "path";
|
|
21755
|
-
import
|
|
21870
|
+
import chalk141 from "chalk";
|
|
21756
21871
|
|
|
21757
21872
|
// src/commands/criteriaExtension/latestUpdate.ts
|
|
21758
21873
|
function latestUpdate(manifest, updates2) {
|
|
@@ -21775,7 +21890,7 @@ async function printCriteriaExtensionUrl() {
|
|
|
21775
21890
|
const response = await fetch(update_url);
|
|
21776
21891
|
const link3 = response.ok ? latestUpdateLink(manifest, await response.text()) : void 0;
|
|
21777
21892
|
if (!link3) {
|
|
21778
|
-
console.log(
|
|
21893
|
+
console.log(chalk141.red(`no signed build found in ${update_url}`));
|
|
21779
21894
|
process.exitCode = 1;
|
|
21780
21895
|
return;
|
|
21781
21896
|
}
|
|
@@ -21786,7 +21901,7 @@ async function printCriteriaExtensionUrl() {
|
|
|
21786
21901
|
import { rm as rm2 } from "fs/promises";
|
|
21787
21902
|
import { homedir as homedir21, tmpdir as tmpdir3 } from "os";
|
|
21788
21903
|
import { join as join58 } from "path";
|
|
21789
|
-
import
|
|
21904
|
+
import chalk143 from "chalk";
|
|
21790
21905
|
|
|
21791
21906
|
// src/commands/criteriaExtension/copySignedXpi.ts
|
|
21792
21907
|
import { copyFile } from "fs/promises";
|
|
@@ -21811,7 +21926,7 @@ async function findSignedXpi(dir) {
|
|
|
21811
21926
|
|
|
21812
21927
|
// src/commands/criteriaExtension/signedAddonInstallPath.ts
|
|
21813
21928
|
import { cp as cp2 } from "fs/promises";
|
|
21814
|
-
import
|
|
21929
|
+
import chalk142 from "chalk";
|
|
21815
21930
|
var WSL_WINDOWS_XPI = "/mnt/c/tools/criteria-extension.xpi";
|
|
21816
21931
|
var WSL_WINDOWS_PATH2 = String.raw`C:\tools\criteria-extension.xpi`;
|
|
21817
21932
|
async function signedAddonInstallPath(xpi) {
|
|
@@ -21821,7 +21936,7 @@ async function signedAddonInstallPath(xpi) {
|
|
|
21821
21936
|
return WSL_WINDOWS_PATH2;
|
|
21822
21937
|
} catch {
|
|
21823
21938
|
console.log(
|
|
21824
|
-
|
|
21939
|
+
chalk142.yellow(`could not copy the add-on to ${WSL_WINDOWS_PATH2}`)
|
|
21825
21940
|
);
|
|
21826
21941
|
return xpi;
|
|
21827
21942
|
}
|
|
@@ -21914,15 +22029,15 @@ async function signCriteriaExtension() {
|
|
|
21914
22029
|
const source = criteriaExtensionDir();
|
|
21915
22030
|
const problem = signPreflightProblem(source);
|
|
21916
22031
|
if (problem) {
|
|
21917
|
-
console.log(
|
|
21918
|
-
console.log(
|
|
22032
|
+
console.log(chalk143.red(problem.message));
|
|
22033
|
+
console.log(chalk143.dim(problem.hint));
|
|
21919
22034
|
process.exitCode = 1;
|
|
21920
22035
|
return;
|
|
21921
22036
|
}
|
|
21922
22037
|
const { version: version2 } = package_default;
|
|
21923
22038
|
await stageCriteriaExtension(source, STAGING_DIR, version2);
|
|
21924
22039
|
await rm2(ARTIFACTS_DIR, { recursive: true, force: true });
|
|
21925
|
-
console.log(
|
|
22040
|
+
console.log(chalk143.bold(`signing version ${version2} for self-distribution`));
|
|
21926
22041
|
const { done: done2 } = spawnInherit("npx", [
|
|
21927
22042
|
"--yes",
|
|
21928
22043
|
"web-ext",
|
|
@@ -21932,13 +22047,13 @@ async function signCriteriaExtension() {
|
|
|
21932
22047
|
"--channel=unlisted"
|
|
21933
22048
|
]);
|
|
21934
22049
|
if (await done2 !== 0) {
|
|
21935
|
-
console.log(
|
|
22050
|
+
console.log(chalk143.red("web-ext sign failed"));
|
|
21936
22051
|
process.exitCode = 1;
|
|
21937
22052
|
return;
|
|
21938
22053
|
}
|
|
21939
22054
|
const xpi = await findSignedXpi(ARTIFACTS_DIR);
|
|
21940
22055
|
if (!xpi) {
|
|
21941
|
-
console.log(
|
|
22056
|
+
console.log(chalk143.red(`web-ext wrote no .xpi into ${ARTIFACTS_DIR}`));
|
|
21942
22057
|
process.exitCode = 1;
|
|
21943
22058
|
return;
|
|
21944
22059
|
}
|
|
@@ -21946,7 +22061,7 @@ async function signCriteriaExtension() {
|
|
|
21946
22061
|
const path106 = await signedAddonInstallPath(
|
|
21947
22062
|
await copySignedXpi(xpi, ARTIFACTS_DIR)
|
|
21948
22063
|
);
|
|
21949
|
-
console.log(
|
|
22064
|
+
console.log(chalk143.dim(`install the signed add-on from ${path106}`));
|
|
21950
22065
|
}
|
|
21951
22066
|
|
|
21952
22067
|
// src/commands/registerCriteriaExtension.ts
|
|
@@ -22007,11 +22122,11 @@ async function dropRetiredTables(exec3) {
|
|
|
22007
22122
|
}
|
|
22008
22123
|
|
|
22009
22124
|
// src/commands/db/reportRetiredTables.ts
|
|
22010
|
-
import
|
|
22125
|
+
import chalk144 from "chalk";
|
|
22011
22126
|
function reportRetiredTables(tables) {
|
|
22012
22127
|
for (const table of tables) {
|
|
22013
22128
|
console.error(
|
|
22014
|
-
|
|
22129
|
+
chalk144.yellow(
|
|
22015
22130
|
`Retired table ${table.name} still exists (${table.rows} rows). Run \`assist db drop-retired\` to drop it.`
|
|
22016
22131
|
)
|
|
22017
22132
|
);
|
|
@@ -22019,40 +22134,40 @@ function reportRetiredTables(tables) {
|
|
|
22019
22134
|
}
|
|
22020
22135
|
|
|
22021
22136
|
// src/commands/db/reportMigrationStatus.ts
|
|
22022
|
-
import
|
|
22137
|
+
import chalk145 from "chalk";
|
|
22023
22138
|
function reportApplied(applied) {
|
|
22024
22139
|
if (applied.length === 0) {
|
|
22025
|
-
console.error(
|
|
22140
|
+
console.error(chalk145.green("Database is up to date; nothing to apply."));
|
|
22026
22141
|
return;
|
|
22027
22142
|
}
|
|
22028
22143
|
for (const migration of applied) {
|
|
22029
22144
|
console.error(
|
|
22030
|
-
|
|
22145
|
+
chalk145.green(`Applied migration ${migration.id} (${migration.name}).`)
|
|
22031
22146
|
);
|
|
22032
22147
|
}
|
|
22033
22148
|
}
|
|
22034
22149
|
function reportMigrationStatus(status2) {
|
|
22035
22150
|
if (status2.state === "in-sync") {
|
|
22036
22151
|
console.error(
|
|
22037
|
-
|
|
22152
|
+
chalk145.green(`In sync at migration ${status2.version} (latest).`)
|
|
22038
22153
|
);
|
|
22039
22154
|
return;
|
|
22040
22155
|
}
|
|
22041
22156
|
if (status2.state === "behind") {
|
|
22042
22157
|
console.error(
|
|
22043
|
-
|
|
22158
|
+
chalk145.yellow(
|
|
22044
22159
|
`Behind: applied ${status2.applied}, build expects ${status2.expected}.`
|
|
22045
22160
|
)
|
|
22046
22161
|
);
|
|
22047
22162
|
console.error(
|
|
22048
|
-
|
|
22163
|
+
chalk145.yellow(
|
|
22049
22164
|
`Pending: ${status2.pending.join(", ")}. Run \`assist db migrate\`.`
|
|
22050
22165
|
)
|
|
22051
22166
|
);
|
|
22052
22167
|
return;
|
|
22053
22168
|
}
|
|
22054
22169
|
console.error(
|
|
22055
|
-
|
|
22170
|
+
chalk145.red(
|
|
22056
22171
|
`Ahead: applied ${status2.applied}, build knows ${status2.expected}. Update assist.`
|
|
22057
22172
|
)
|
|
22058
22173
|
);
|
|
@@ -22094,7 +22209,7 @@ function registerDb(program2) {
|
|
|
22094
22209
|
|
|
22095
22210
|
// src/commands/dbMigration/dbMigrationConfirm.ts
|
|
22096
22211
|
import { unlinkSync as unlinkSync9, writeFileSync as writeFileSync27 } from "fs";
|
|
22097
|
-
import
|
|
22212
|
+
import chalk146 from "chalk";
|
|
22098
22213
|
|
|
22099
22214
|
// src/commands/dbMigration/getMigrationPinPath.ts
|
|
22100
22215
|
import { join as join59 } from "path";
|
|
@@ -22125,7 +22240,7 @@ function dbMigrationConfirm(pin2) {
|
|
|
22125
22240
|
sweepRestrictedDir();
|
|
22126
22241
|
const state = readMigrationPinState(pin2);
|
|
22127
22242
|
if (!state) {
|
|
22128
|
-
console.error(
|
|
22243
|
+
console.error(chalk146.red(`No pending migration unlock for pin: ${pin2}`));
|
|
22129
22244
|
process.exitCode = 1;
|
|
22130
22245
|
return;
|
|
22131
22246
|
}
|
|
@@ -22135,7 +22250,7 @@ function dbMigrationConfirm(pin2) {
|
|
|
22135
22250
|
);
|
|
22136
22251
|
unlinkSync9(getMigrationPinPath(pin2));
|
|
22137
22252
|
console.log(
|
|
22138
|
-
|
|
22253
|
+
chalk146.green(
|
|
22139
22254
|
`Approved creation of migration ${state.migrationId}. The next write of that migration module will be allowed once.`
|
|
22140
22255
|
)
|
|
22141
22256
|
);
|
|
@@ -22144,7 +22259,7 @@ function dbMigrationConfirm(pin2) {
|
|
|
22144
22259
|
// src/commands/dbMigration/dbMigrationUnlock.ts
|
|
22145
22260
|
import { mkdirSync as mkdirSync16, writeFileSync as writeFileSync28 } from "fs";
|
|
22146
22261
|
import { randomInt as randomInt2 } from "crypto";
|
|
22147
|
-
import
|
|
22262
|
+
import chalk147 from "chalk";
|
|
22148
22263
|
|
|
22149
22264
|
// src/commands/dbMigration/nextMigrationId.ts
|
|
22150
22265
|
function nextMigrationId() {
|
|
@@ -22159,7 +22274,7 @@ function dbMigrationUnlock() {
|
|
|
22159
22274
|
sweepRestrictedDir();
|
|
22160
22275
|
writeFileSync28(getMigrationPinPath(pin2), JSON.stringify({ pin: pin2, migrationId }));
|
|
22161
22276
|
console.error(
|
|
22162
|
-
|
|
22277
|
+
chalk147.yellow.bold(
|
|
22163
22278
|
"THIS IS YOUR LAST CHANCE TO RECONSIDER BEFORE INVOLVING A HUMAN.\nRequesting this pin pages a real person to approve a new database migration.\nA schema change is hard to reverse once shipped. You had BETTER have confirmed\nthe change with the user and be certain this migration is genuinely necessary."
|
|
22164
22279
|
)
|
|
22165
22280
|
);
|
|
@@ -22169,7 +22284,7 @@ function dbMigrationUnlock() {
|
|
|
22169
22284
|
});
|
|
22170
22285
|
if (!delivered) {
|
|
22171
22286
|
console.error(
|
|
22172
|
-
|
|
22287
|
+
chalk147.red(
|
|
22173
22288
|
"Could not deliver the confirmation pin via notification.\nThe migration cannot be approved until the notification channel works."
|
|
22174
22289
|
)
|
|
22175
22290
|
);
|
|
@@ -22179,7 +22294,7 @@ function dbMigrationUnlock() {
|
|
|
22179
22294
|
console.log(
|
|
22180
22295
|
`A confirmation pin was sent to your desktop notifications.
|
|
22181
22296
|
To approve creating migration ${migrationId}, run:
|
|
22182
|
-
${
|
|
22297
|
+
${chalk147.cyan(" assist db-migration confirm <PIN>")}
|
|
22183
22298
|
using the pin from that notification.`
|
|
22184
22299
|
);
|
|
22185
22300
|
}
|
|
@@ -22199,7 +22314,7 @@ function registerDbMigration(parent) {
|
|
|
22199
22314
|
|
|
22200
22315
|
// src/commands/deploy/redirect.ts
|
|
22201
22316
|
import { existsSync as existsSync51, readFileSync as readFileSync33, writeFileSync as writeFileSync29 } from "fs";
|
|
22202
|
-
import
|
|
22317
|
+
import chalk148 from "chalk";
|
|
22203
22318
|
var TRAILING_SLASH_SCRIPT = ` <script>
|
|
22204
22319
|
if (!window.location.pathname.endsWith('/')) {
|
|
22205
22320
|
window.location.href = \`\${window.location.pathname}/\${window.location.search}\${window.location.hash}\`;
|
|
@@ -22208,23 +22323,23 @@ var TRAILING_SLASH_SCRIPT = ` <script>
|
|
|
22208
22323
|
function redirect() {
|
|
22209
22324
|
const indexPath = "index.html";
|
|
22210
22325
|
if (!existsSync51(indexPath)) {
|
|
22211
|
-
console.log(
|
|
22326
|
+
console.log(chalk148.yellow("No index.html found"));
|
|
22212
22327
|
return;
|
|
22213
22328
|
}
|
|
22214
22329
|
const content = readFileSync33(indexPath, "utf8");
|
|
22215
22330
|
if (content.includes("window.location.pathname.endsWith('/')")) {
|
|
22216
|
-
console.log(
|
|
22331
|
+
console.log(chalk148.dim("Trailing slash script already present"));
|
|
22217
22332
|
return;
|
|
22218
22333
|
}
|
|
22219
22334
|
const headCloseIndex = content.indexOf("</head>");
|
|
22220
22335
|
if (headCloseIndex === -1) {
|
|
22221
|
-
console.log(
|
|
22336
|
+
console.log(chalk148.red("Could not find </head> tag in index.html"));
|
|
22222
22337
|
return;
|
|
22223
22338
|
}
|
|
22224
22339
|
const newContent = `${content.slice(0, headCloseIndex) + TRAILING_SLASH_SCRIPT}
|
|
22225
22340
|
${content.slice(headCloseIndex)}`;
|
|
22226
22341
|
writeFileSync29(indexPath, newContent);
|
|
22227
|
-
console.log(
|
|
22342
|
+
console.log(chalk148.green("Added trailing slash redirect to index.html"));
|
|
22228
22343
|
}
|
|
22229
22344
|
|
|
22230
22345
|
// src/commands/registerDeploy.ts
|
|
@@ -22251,7 +22366,7 @@ function loadBlogSkipDays(repoName) {
|
|
|
22251
22366
|
|
|
22252
22367
|
// src/commands/devlog/shared.ts
|
|
22253
22368
|
import { execSync as execSync31 } from "child_process";
|
|
22254
|
-
import
|
|
22369
|
+
import chalk149 from "chalk";
|
|
22255
22370
|
|
|
22256
22371
|
// src/shared/getRepoName.ts
|
|
22257
22372
|
import { existsSync as existsSync52, readFileSync as readFileSync34 } from "fs";
|
|
@@ -22360,13 +22475,13 @@ function shouldIgnoreCommit(files, ignorePaths) {
|
|
|
22360
22475
|
}
|
|
22361
22476
|
function printCommitsWithFiles(commits2, ignore3, verbose) {
|
|
22362
22477
|
for (const commit2 of commits2) {
|
|
22363
|
-
console.log(` ${
|
|
22478
|
+
console.log(` ${chalk149.yellow(commit2.hash)} ${commit2.message}`);
|
|
22364
22479
|
if (verbose) {
|
|
22365
22480
|
const visibleFiles = commit2.files.filter(
|
|
22366
22481
|
(file) => !ignore3.some((p) => file.startsWith(p))
|
|
22367
22482
|
);
|
|
22368
22483
|
for (const file of visibleFiles) {
|
|
22369
|
-
console.log(` ${
|
|
22484
|
+
console.log(` ${chalk149.dim(file)}`);
|
|
22370
22485
|
}
|
|
22371
22486
|
}
|
|
22372
22487
|
}
|
|
@@ -22391,15 +22506,15 @@ function parseGitLogCommits(output, ignore3, afterDate) {
|
|
|
22391
22506
|
}
|
|
22392
22507
|
|
|
22393
22508
|
// src/commands/devlog/list/printDateHeader.ts
|
|
22394
|
-
import
|
|
22509
|
+
import chalk150 from "chalk";
|
|
22395
22510
|
function printDateHeader(date, isSkipped, entries) {
|
|
22396
22511
|
if (isSkipped) {
|
|
22397
|
-
console.log(`${
|
|
22512
|
+
console.log(`${chalk150.bold.blue(date)} ${chalk150.dim("skipped")}`);
|
|
22398
22513
|
} else if (entries && entries.length > 0) {
|
|
22399
|
-
const entryInfo = entries.map((e) => `${
|
|
22400
|
-
console.log(`${
|
|
22514
|
+
const entryInfo = entries.map((e) => `${chalk150.green(e.version)} ${e.title}`).join(" | ");
|
|
22515
|
+
console.log(`${chalk150.bold.blue(date)} ${entryInfo}`);
|
|
22401
22516
|
} else {
|
|
22402
|
-
console.log(`${
|
|
22517
|
+
console.log(`${chalk150.bold.blue(date)} ${chalk150.red("\u26A0 devlog missing")}`);
|
|
22403
22518
|
}
|
|
22404
22519
|
}
|
|
22405
22520
|
|
|
@@ -22503,24 +22618,24 @@ function bumpVersion(version2, type) {
|
|
|
22503
22618
|
|
|
22504
22619
|
// src/commands/devlog/next/displayNextEntry.ts
|
|
22505
22620
|
import { execFileSync as execFileSync8 } from "child_process";
|
|
22506
|
-
import
|
|
22621
|
+
import chalk152 from "chalk";
|
|
22507
22622
|
|
|
22508
22623
|
// src/commands/devlog/next/displayNextEntry/displayVersion.ts
|
|
22509
|
-
import
|
|
22624
|
+
import chalk151 from "chalk";
|
|
22510
22625
|
function displayVersion(conventional, firstHash, patchVersion, minorVersion) {
|
|
22511
22626
|
if (conventional && firstHash) {
|
|
22512
22627
|
const version2 = getVersionAtCommit(firstHash);
|
|
22513
22628
|
if (version2) {
|
|
22514
|
-
console.log(`${
|
|
22629
|
+
console.log(`${chalk151.bold("version:")} ${stripToMinor(version2)}`);
|
|
22515
22630
|
} else {
|
|
22516
|
-
console.log(`${
|
|
22631
|
+
console.log(`${chalk151.bold("version:")} ${chalk151.red("unknown")}`);
|
|
22517
22632
|
}
|
|
22518
22633
|
} else if (patchVersion && minorVersion) {
|
|
22519
22634
|
console.log(
|
|
22520
|
-
`${
|
|
22635
|
+
`${chalk151.bold("version:")} ${patchVersion} (patch) or ${minorVersion} (minor)`
|
|
22521
22636
|
);
|
|
22522
22637
|
} else {
|
|
22523
|
-
console.log(`${
|
|
22638
|
+
console.log(`${chalk151.bold("version:")} v0.1 (initial)`);
|
|
22524
22639
|
}
|
|
22525
22640
|
}
|
|
22526
22641
|
|
|
@@ -22568,16 +22683,16 @@ function noCommitsMessage(hasLastInfo) {
|
|
|
22568
22683
|
return hasLastInfo ? "No commits after last versioned entry" : "No commits found";
|
|
22569
22684
|
}
|
|
22570
22685
|
function logName(repoName) {
|
|
22571
|
-
console.log(`${
|
|
22686
|
+
console.log(`${chalk152.bold("name:")} ${repoName}`);
|
|
22572
22687
|
}
|
|
22573
22688
|
function displayNextEntry(ctx, targetDate, commits2) {
|
|
22574
22689
|
logName(ctx.repoName);
|
|
22575
22690
|
printVersionInfo(ctx.config, ctx.lastInfo, commits2[0]?.hash);
|
|
22576
|
-
console.log(
|
|
22691
|
+
console.log(chalk152.bold.blue(targetDate));
|
|
22577
22692
|
printCommitsWithFiles(commits2, ctx.ignore, ctx.verbose);
|
|
22578
22693
|
}
|
|
22579
22694
|
function logNoCommits(lastInfo) {
|
|
22580
|
-
console.log(
|
|
22695
|
+
console.log(chalk152.dim(noCommitsMessage(!!lastInfo)));
|
|
22581
22696
|
}
|
|
22582
22697
|
|
|
22583
22698
|
// src/commands/devlog/next.ts
|
|
@@ -22618,11 +22733,11 @@ function next2(options2) {
|
|
|
22618
22733
|
import { execSync as execSync33 } from "child_process";
|
|
22619
22734
|
|
|
22620
22735
|
// src/commands/devlog/repos/printReposTable.ts
|
|
22621
|
-
import
|
|
22736
|
+
import chalk153 from "chalk";
|
|
22622
22737
|
function colorStatus(status2) {
|
|
22623
|
-
if (status2 === "missing") return
|
|
22624
|
-
if (status2 === "outdated") return
|
|
22625
|
-
return
|
|
22738
|
+
if (status2 === "missing") return chalk153.red(status2);
|
|
22739
|
+
if (status2 === "outdated") return chalk153.yellow(status2);
|
|
22740
|
+
return chalk153.green(status2);
|
|
22626
22741
|
}
|
|
22627
22742
|
function formatRow(row, nameWidth) {
|
|
22628
22743
|
const devlog = (row.lastDevlog ?? "-").padEnd(11);
|
|
@@ -22636,8 +22751,8 @@ function printReposTable(rows) {
|
|
|
22636
22751
|
"Last Devlog".padEnd(11),
|
|
22637
22752
|
"Status"
|
|
22638
22753
|
].join(" ");
|
|
22639
|
-
console.log(
|
|
22640
|
-
console.log(
|
|
22754
|
+
console.log(chalk153.dim(header));
|
|
22755
|
+
console.log(chalk153.dim("-".repeat(header.length)));
|
|
22641
22756
|
for (const row of rows) {
|
|
22642
22757
|
console.log(formatRow(row, nameWidth));
|
|
22643
22758
|
}
|
|
@@ -22695,14 +22810,14 @@ function repos(options2) {
|
|
|
22695
22810
|
// src/commands/devlog/skip.ts
|
|
22696
22811
|
import { writeFileSync as writeFileSync30 } from "fs";
|
|
22697
22812
|
import { join as join63 } from "path";
|
|
22698
|
-
import
|
|
22813
|
+
import chalk154 from "chalk";
|
|
22699
22814
|
import { stringify as stringifyYaml3 } from "yaml";
|
|
22700
22815
|
function getBlogConfigPath() {
|
|
22701
22816
|
return join63(BLOG_REPO_ROOT, "assist.yml");
|
|
22702
22817
|
}
|
|
22703
22818
|
function skip(date) {
|
|
22704
22819
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) {
|
|
22705
|
-
console.log(
|
|
22820
|
+
console.log(chalk154.red("Invalid date format. Use YYYY-MM-DD"));
|
|
22706
22821
|
process.exit(1);
|
|
22707
22822
|
}
|
|
22708
22823
|
const repoName = getRepoName();
|
|
@@ -22713,7 +22828,7 @@ function skip(date) {
|
|
|
22713
22828
|
const skipDays = skip2[repoName] ?? [];
|
|
22714
22829
|
if (skipDays.includes(date)) {
|
|
22715
22830
|
console.log(
|
|
22716
|
-
|
|
22831
|
+
chalk154.yellow(`${date} is already in skip list for ${repoName}`)
|
|
22717
22832
|
);
|
|
22718
22833
|
return;
|
|
22719
22834
|
}
|
|
@@ -22723,20 +22838,20 @@ function skip(date) {
|
|
|
22723
22838
|
devlog.skip = skip2;
|
|
22724
22839
|
config.devlog = devlog;
|
|
22725
22840
|
writeFileSync30(configPath, stringifyYaml3(config, { lineWidth: 0 }));
|
|
22726
|
-
console.log(
|
|
22841
|
+
console.log(chalk154.green(`Added ${date} to skip list for ${repoName}`));
|
|
22727
22842
|
}
|
|
22728
22843
|
|
|
22729
22844
|
// src/commands/devlog/version.ts
|
|
22730
|
-
import
|
|
22845
|
+
import chalk155 from "chalk";
|
|
22731
22846
|
function version() {
|
|
22732
22847
|
const config = loadConfig();
|
|
22733
22848
|
const name = getRepoName();
|
|
22734
22849
|
const lastInfo = getLastVersionInfo(name, config);
|
|
22735
22850
|
const lastVersion = lastInfo?.version ?? null;
|
|
22736
22851
|
const nextVersion = lastVersion ? bumpVersion(lastVersion, "patch") : null;
|
|
22737
|
-
console.log(`${
|
|
22738
|
-
console.log(`${
|
|
22739
|
-
console.log(`${
|
|
22852
|
+
console.log(`${chalk155.bold("name:")} ${name}`);
|
|
22853
|
+
console.log(`${chalk155.bold("last:")} ${lastVersion ?? chalk155.dim("none")}`);
|
|
22854
|
+
console.log(`${chalk155.bold("next:")} ${nextVersion ?? chalk155.dim("none")}`);
|
|
22740
22855
|
}
|
|
22741
22856
|
|
|
22742
22857
|
// src/commands/registerDevlog.ts
|
|
@@ -22761,7 +22876,7 @@ function registerDevlog(program2) {
|
|
|
22761
22876
|
// src/commands/dotnet/checkBuildLocks.ts
|
|
22762
22877
|
import { closeSync as closeSync4, openSync as openSync5, readdirSync as readdirSync8 } from "fs";
|
|
22763
22878
|
import { join as join64 } from "path";
|
|
22764
|
-
import
|
|
22879
|
+
import chalk156 from "chalk";
|
|
22765
22880
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "packages"]);
|
|
22766
22881
|
function isLockedDll(debugDir) {
|
|
22767
22882
|
let files;
|
|
@@ -22808,14 +22923,14 @@ function checkBuildLocks(startDir) {
|
|
|
22808
22923
|
const locked = findFirstLockedDll(startDir ?? getSearchRoot());
|
|
22809
22924
|
if (locked) {
|
|
22810
22925
|
console.error(
|
|
22811
|
-
|
|
22926
|
+
chalk156.red("Build output locked (is VS debugging?): ") + locked
|
|
22812
22927
|
);
|
|
22813
22928
|
process.exit(1);
|
|
22814
22929
|
}
|
|
22815
22930
|
}
|
|
22816
22931
|
async function checkBuildLocksCommand() {
|
|
22817
22932
|
checkBuildLocks();
|
|
22818
|
-
console.log(
|
|
22933
|
+
console.log(chalk156.green("No build locks detected"));
|
|
22819
22934
|
}
|
|
22820
22935
|
|
|
22821
22936
|
// src/commands/dotnet/buildTree.ts
|
|
@@ -22914,30 +23029,30 @@ function escapeRegex(s) {
|
|
|
22914
23029
|
}
|
|
22915
23030
|
|
|
22916
23031
|
// src/commands/dotnet/printTree.ts
|
|
22917
|
-
import
|
|
23032
|
+
import chalk157 from "chalk";
|
|
22918
23033
|
function printNodes(nodes, prefix2) {
|
|
22919
23034
|
for (let i = 0; i < nodes.length; i++) {
|
|
22920
23035
|
const isLast = i === nodes.length - 1;
|
|
22921
23036
|
const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
22922
23037
|
const childPrefix = isLast ? " " : "\u2502 ";
|
|
22923
23038
|
const isMissing = nodes[i].relativePath.startsWith("[MISSING]");
|
|
22924
|
-
const label2 = isMissing ?
|
|
23039
|
+
const label2 = isMissing ? chalk157.red(nodes[i].relativePath) : nodes[i].relativePath;
|
|
22925
23040
|
console.log(`${prefix2}${connector}${label2}`);
|
|
22926
23041
|
printNodes(nodes[i].children, prefix2 + childPrefix);
|
|
22927
23042
|
}
|
|
22928
23043
|
}
|
|
22929
23044
|
function printTree(tree, totalCount, solutions) {
|
|
22930
|
-
console.log(
|
|
22931
|
-
console.log(
|
|
23045
|
+
console.log(chalk157.bold("\nProject Dependency Tree"));
|
|
23046
|
+
console.log(chalk157.cyan(tree.relativePath));
|
|
22932
23047
|
printNodes(tree.children, "");
|
|
22933
|
-
console.log(
|
|
23048
|
+
console.log(chalk157.dim(`
|
|
22934
23049
|
${totalCount} projects total (including root)`));
|
|
22935
|
-
console.log(
|
|
23050
|
+
console.log(chalk157.bold("\nSolution Membership"));
|
|
22936
23051
|
if (solutions.length === 0) {
|
|
22937
|
-
console.log(
|
|
23052
|
+
console.log(chalk157.yellow(" Not found in any .sln"));
|
|
22938
23053
|
} else {
|
|
22939
23054
|
for (const sln of solutions) {
|
|
22940
|
-
console.log(` ${
|
|
23055
|
+
console.log(` ${chalk157.green(sln)}`);
|
|
22941
23056
|
}
|
|
22942
23057
|
}
|
|
22943
23058
|
console.log();
|
|
@@ -22966,16 +23081,16 @@ function printJson(tree, totalCount, solutions) {
|
|
|
22966
23081
|
// src/commands/dotnet/resolveCsproj.ts
|
|
22967
23082
|
import { existsSync as existsSync53 } from "fs";
|
|
22968
23083
|
import path36 from "path";
|
|
22969
|
-
import
|
|
23084
|
+
import chalk158 from "chalk";
|
|
22970
23085
|
function resolveCsproj(csprojPath) {
|
|
22971
23086
|
const resolved = path36.resolve(csprojPath);
|
|
22972
23087
|
if (!existsSync53(resolved)) {
|
|
22973
|
-
console.error(
|
|
23088
|
+
console.error(chalk158.red(`File not found: ${resolved}`));
|
|
22974
23089
|
process.exit(1);
|
|
22975
23090
|
}
|
|
22976
23091
|
const repoRoot2 = findRepoRoot(path36.dirname(resolved));
|
|
22977
23092
|
if (!repoRoot2) {
|
|
22978
|
-
console.error(
|
|
23093
|
+
console.error(chalk158.red("Could not find git repository root"));
|
|
22979
23094
|
process.exit(1);
|
|
22980
23095
|
}
|
|
22981
23096
|
return { resolved, repoRoot: repoRoot2 };
|
|
@@ -23025,12 +23140,12 @@ function getChangedCsFiles(scope) {
|
|
|
23025
23140
|
}
|
|
23026
23141
|
|
|
23027
23142
|
// src/commands/dotnet/inSln.ts
|
|
23028
|
-
import
|
|
23143
|
+
import chalk159 from "chalk";
|
|
23029
23144
|
async function inSln(csprojPath) {
|
|
23030
23145
|
const { resolved, repoRoot: repoRoot2 } = resolveCsproj(csprojPath);
|
|
23031
23146
|
const solutions = findContainingSolutions(resolved, repoRoot2);
|
|
23032
23147
|
if (solutions.length === 0) {
|
|
23033
|
-
console.log(
|
|
23148
|
+
console.log(chalk159.yellow("Not found in any .sln file"));
|
|
23034
23149
|
process.exit(1);
|
|
23035
23150
|
}
|
|
23036
23151
|
for (const sln of solutions) {
|
|
@@ -23039,7 +23154,7 @@ async function inSln(csprojPath) {
|
|
|
23039
23154
|
}
|
|
23040
23155
|
|
|
23041
23156
|
// src/commands/dotnet/inspect.ts
|
|
23042
|
-
import
|
|
23157
|
+
import chalk165 from "chalk";
|
|
23043
23158
|
|
|
23044
23159
|
// src/shared/formatElapsed.ts
|
|
23045
23160
|
function formatElapsed(ms) {
|
|
@@ -23051,12 +23166,12 @@ function formatElapsed(ms) {
|
|
|
23051
23166
|
}
|
|
23052
23167
|
|
|
23053
23168
|
// src/commands/dotnet/displayIssues.ts
|
|
23054
|
-
import
|
|
23169
|
+
import chalk160 from "chalk";
|
|
23055
23170
|
var SEVERITY_COLOR = {
|
|
23056
|
-
ERROR:
|
|
23057
|
-
WARNING:
|
|
23058
|
-
SUGGESTION:
|
|
23059
|
-
HINT:
|
|
23171
|
+
ERROR: chalk160.red,
|
|
23172
|
+
WARNING: chalk160.yellow,
|
|
23173
|
+
SUGGESTION: chalk160.cyan,
|
|
23174
|
+
HINT: chalk160.dim
|
|
23060
23175
|
};
|
|
23061
23176
|
function groupByFile(issues) {
|
|
23062
23177
|
const byFile = /* @__PURE__ */ new Map();
|
|
@@ -23072,15 +23187,15 @@ function groupByFile(issues) {
|
|
|
23072
23187
|
}
|
|
23073
23188
|
function displayIssues(issues) {
|
|
23074
23189
|
for (const [file, fileIssues] of groupByFile(issues)) {
|
|
23075
|
-
console.log(
|
|
23190
|
+
console.log(chalk160.bold(file));
|
|
23076
23191
|
for (const issue of fileIssues.sort((a, b) => a.line - b.line)) {
|
|
23077
|
-
const color = SEVERITY_COLOR[issue.severity] ??
|
|
23192
|
+
const color = SEVERITY_COLOR[issue.severity] ?? chalk160.white;
|
|
23078
23193
|
console.log(
|
|
23079
|
-
` ${
|
|
23194
|
+
` ${chalk160.dim(`${issue.line}:`)} ${color(issue.severity)} [${issue.typeId}] ${issue.message}`
|
|
23080
23195
|
);
|
|
23081
23196
|
}
|
|
23082
23197
|
}
|
|
23083
|
-
console.log(
|
|
23198
|
+
console.log(chalk160.dim(`
|
|
23084
23199
|
${issues.length} issue(s) found`));
|
|
23085
23200
|
}
|
|
23086
23201
|
|
|
@@ -23139,12 +23254,12 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
|
|
|
23139
23254
|
// src/commands/dotnet/resolveSolution.ts
|
|
23140
23255
|
import { existsSync as existsSync54 } from "fs";
|
|
23141
23256
|
import path37 from "path";
|
|
23142
|
-
import
|
|
23257
|
+
import chalk162 from "chalk";
|
|
23143
23258
|
|
|
23144
23259
|
// src/commands/dotnet/findSolution.ts
|
|
23145
23260
|
import { readdirSync as readdirSync10 } from "fs";
|
|
23146
23261
|
import { dirname as dirname28, join as join65 } from "path";
|
|
23147
|
-
import
|
|
23262
|
+
import chalk161 from "chalk";
|
|
23148
23263
|
function findSlnInDir(dir) {
|
|
23149
23264
|
try {
|
|
23150
23265
|
return readdirSync10(dir).filter((f) => f.endsWith(".sln")).map((f) => join65(dir, f));
|
|
@@ -23160,17 +23275,17 @@ function findSolution() {
|
|
|
23160
23275
|
const slnFiles = findSlnInDir(current);
|
|
23161
23276
|
if (slnFiles.length === 1) return slnFiles[0];
|
|
23162
23277
|
if (slnFiles.length > 1) {
|
|
23163
|
-
console.error(
|
|
23278
|
+
console.error(chalk161.red(`Multiple .sln files found in ${current}:`));
|
|
23164
23279
|
for (const f of slnFiles) console.error(` ${f}`);
|
|
23165
23280
|
console.error(
|
|
23166
|
-
|
|
23281
|
+
chalk161.yellow("Specify which one: assist dotnet inspect <sln>")
|
|
23167
23282
|
);
|
|
23168
23283
|
process.exit(1);
|
|
23169
23284
|
}
|
|
23170
23285
|
if (current === ceiling) break;
|
|
23171
23286
|
current = dirname28(current);
|
|
23172
23287
|
}
|
|
23173
|
-
console.error(
|
|
23288
|
+
console.error(chalk161.red("No .sln file found between cwd and repo root"));
|
|
23174
23289
|
process.exit(1);
|
|
23175
23290
|
}
|
|
23176
23291
|
|
|
@@ -23179,7 +23294,7 @@ function resolveSolution(sln) {
|
|
|
23179
23294
|
if (sln) {
|
|
23180
23295
|
const resolved = path37.resolve(sln);
|
|
23181
23296
|
if (!existsSync54(resolved)) {
|
|
23182
|
-
console.error(
|
|
23297
|
+
console.error(chalk162.red(`Solution file not found: ${resolved}`));
|
|
23183
23298
|
process.exit(1);
|
|
23184
23299
|
}
|
|
23185
23300
|
return resolved;
|
|
@@ -23221,14 +23336,14 @@ import { execSync as execSync35 } from "child_process";
|
|
|
23221
23336
|
import { existsSync as existsSync55, readFileSync as readFileSync38, unlinkSync as unlinkSync10 } from "fs";
|
|
23222
23337
|
import { tmpdir as tmpdir4 } from "os";
|
|
23223
23338
|
import path38 from "path";
|
|
23224
|
-
import
|
|
23339
|
+
import chalk163 from "chalk";
|
|
23225
23340
|
function assertJbInstalled() {
|
|
23226
23341
|
try {
|
|
23227
23342
|
execSync35("jb inspectcode --version", { stdio: "pipe" });
|
|
23228
23343
|
} catch {
|
|
23229
|
-
console.error(
|
|
23344
|
+
console.error(chalk163.red("jb is not installed. Install with:"));
|
|
23230
23345
|
console.error(
|
|
23231
|
-
|
|
23346
|
+
chalk163.yellow(" dotnet tool install -g JetBrains.ReSharper.GlobalTools")
|
|
23232
23347
|
);
|
|
23233
23348
|
process.exit(1);
|
|
23234
23349
|
}
|
|
@@ -23246,11 +23361,11 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
23246
23361
|
if (error && typeof error === "object" && "stderr" in error) {
|
|
23247
23362
|
process.stderr.write(error.stderr);
|
|
23248
23363
|
}
|
|
23249
|
-
console.error(
|
|
23364
|
+
console.error(chalk163.red("jb inspectcode failed"));
|
|
23250
23365
|
process.exit(1);
|
|
23251
23366
|
}
|
|
23252
23367
|
if (!existsSync55(reportPath)) {
|
|
23253
|
-
console.error(
|
|
23368
|
+
console.error(chalk163.red("Report file not generated"));
|
|
23254
23369
|
process.exit(1);
|
|
23255
23370
|
}
|
|
23256
23371
|
const xml = readFileSync38(reportPath, "utf8");
|
|
@@ -23260,7 +23375,7 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
23260
23375
|
|
|
23261
23376
|
// src/commands/dotnet/runRoslynInspect.ts
|
|
23262
23377
|
import { execSync as execSync36 } from "child_process";
|
|
23263
|
-
import
|
|
23378
|
+
import chalk164 from "chalk";
|
|
23264
23379
|
function resolveMsbuildPath() {
|
|
23265
23380
|
const { run: run4 } = loadConfig();
|
|
23266
23381
|
const configs = resolveRunConfigs(run4, runConfigBaseDir());
|
|
@@ -23272,9 +23387,9 @@ function assertMsbuildInstalled() {
|
|
|
23272
23387
|
try {
|
|
23273
23388
|
execSync36(`"${msbuild}" -version`, { stdio: "pipe" });
|
|
23274
23389
|
} catch {
|
|
23275
|
-
console.error(
|
|
23390
|
+
console.error(chalk164.red(`msbuild not found at: ${msbuild}`));
|
|
23276
23391
|
console.error(
|
|
23277
|
-
|
|
23392
|
+
chalk164.yellow(
|
|
23278
23393
|
"Configure it via a 'build' run entry in .claude/assist.yml or add msbuild to PATH."
|
|
23279
23394
|
)
|
|
23280
23395
|
);
|
|
@@ -23321,17 +23436,17 @@ function runEngine(resolved, changedFiles2, options2) {
|
|
|
23321
23436
|
// src/commands/dotnet/inspect.ts
|
|
23322
23437
|
function logScope(changedFiles2) {
|
|
23323
23438
|
if (changedFiles2 === null) {
|
|
23324
|
-
console.log(
|
|
23439
|
+
console.log(chalk165.dim("Inspecting full solution..."));
|
|
23325
23440
|
} else {
|
|
23326
23441
|
console.log(
|
|
23327
|
-
|
|
23442
|
+
chalk165.dim(`Inspecting ${changedFiles2.length} changed file(s)...`)
|
|
23328
23443
|
);
|
|
23329
23444
|
}
|
|
23330
23445
|
}
|
|
23331
23446
|
function reportResults(issues, elapsed) {
|
|
23332
23447
|
if (issues.length > 0) displayIssues(issues);
|
|
23333
|
-
else console.log(
|
|
23334
|
-
console.log(
|
|
23448
|
+
else console.log(chalk165.green("No issues found"));
|
|
23449
|
+
console.log(chalk165.dim(`Completed in ${formatElapsed(elapsed)}`));
|
|
23335
23450
|
if (issues.length > 0) process.exit(1);
|
|
23336
23451
|
}
|
|
23337
23452
|
async function inspect(sln, options2) {
|
|
@@ -23342,7 +23457,7 @@ async function inspect(sln, options2) {
|
|
|
23342
23457
|
const scope = parseScope(options2.scope);
|
|
23343
23458
|
const changedFiles2 = getChangedCsFiles(scope);
|
|
23344
23459
|
if (changedFiles2 !== null && changedFiles2.length === 0) {
|
|
23345
|
-
console.log(
|
|
23460
|
+
console.log(chalk165.green("No changed .cs files found"));
|
|
23346
23461
|
return;
|
|
23347
23462
|
}
|
|
23348
23463
|
logScope(changedFiles2);
|
|
@@ -24217,25 +24332,25 @@ function fetchRepoCommitAuthors(org, repo, since) {
|
|
|
24217
24332
|
}
|
|
24218
24333
|
|
|
24219
24334
|
// src/commands/github/printCountTable.ts
|
|
24220
|
-
import
|
|
24335
|
+
import chalk166 from "chalk";
|
|
24221
24336
|
function printCountTable(labelHeader, rows) {
|
|
24222
24337
|
const labelWidth = Math.max(
|
|
24223
24338
|
labelHeader.length,
|
|
24224
24339
|
...rows.map((row) => row.label.length)
|
|
24225
24340
|
);
|
|
24226
24341
|
const header = `${labelHeader.padEnd(labelWidth)} Commits`;
|
|
24227
|
-
console.log(
|
|
24228
|
-
console.log(
|
|
24342
|
+
console.log(chalk166.dim(header));
|
|
24343
|
+
console.log(chalk166.dim("-".repeat(header.length)));
|
|
24229
24344
|
for (const row of rows) {
|
|
24230
24345
|
console.log(`${row.label.padEnd(labelWidth)} ${row.count}`);
|
|
24231
24346
|
}
|
|
24232
24347
|
}
|
|
24233
24348
|
|
|
24234
24349
|
// src/commands/github/printRepoAuthorBreakdown.ts
|
|
24235
|
-
import
|
|
24350
|
+
import chalk167 from "chalk";
|
|
24236
24351
|
function printRepoAuthorBreakdown(repos2) {
|
|
24237
24352
|
for (const repo of repos2) {
|
|
24238
|
-
console.log(
|
|
24353
|
+
console.log(chalk167.bold(repo.name));
|
|
24239
24354
|
const authorWidth = Math.max(
|
|
24240
24355
|
0,
|
|
24241
24356
|
...repo.authors.map((a) => a.author.length)
|
|
@@ -24318,10 +24433,10 @@ function parseTopCount(value) {
|
|
|
24318
24433
|
}
|
|
24319
24434
|
|
|
24320
24435
|
// src/commands/github/issue/fixStructure/applyAndVerifySubtree.ts
|
|
24321
|
-
import
|
|
24436
|
+
import chalk169 from "chalk";
|
|
24322
24437
|
|
|
24323
24438
|
// src/commands/github/issue/fixStructure/applyFixStructurePlan.ts
|
|
24324
|
-
import
|
|
24439
|
+
import chalk168 from "chalk";
|
|
24325
24440
|
|
|
24326
24441
|
// src/commands/github/issue/fixStructure/removeIssueLabels.ts
|
|
24327
24442
|
var MUTATION2 = `mutation($labelableId: ID!, $labelIds: [ID!]!) {
|
|
@@ -24358,7 +24473,7 @@ function writeLineNow(line) {
|
|
|
24358
24473
|
// src/commands/github/issue/fixStructure/applyFixStructurePlan.ts
|
|
24359
24474
|
function applyFixStructurePlan(plan2) {
|
|
24360
24475
|
for (const entry of plan2.entries) {
|
|
24361
|
-
const where =
|
|
24476
|
+
const where = chalk168.cyan(`${entry.issue.repo}#${entry.issue.number}`);
|
|
24362
24477
|
const { typeChange, labelRemovals } = entry;
|
|
24363
24478
|
if (typeChange) {
|
|
24364
24479
|
writeLineNow(
|
|
@@ -24628,12 +24743,12 @@ function planSubtree(root2, context) {
|
|
|
24628
24743
|
function applyAndVerifySubtree(target, plan2, context) {
|
|
24629
24744
|
if (plan2.typeChangeCount === 0 && plan2.labelRemovalCount === 0) return;
|
|
24630
24745
|
applyFixStructurePlan(plan2);
|
|
24631
|
-
writeLineNow(
|
|
24746
|
+
writeLineNow(chalk169.dim("Re-walking the subtree to confirm"));
|
|
24632
24747
|
assertNoResidualDrift(
|
|
24633
24748
|
planSubtree(fetchRootIssue(target), context),
|
|
24634
24749
|
context.chain
|
|
24635
24750
|
);
|
|
24636
|
-
writeLineNow(
|
|
24751
|
+
writeLineNow(chalk169.green("Subtree normalised"));
|
|
24637
24752
|
}
|
|
24638
24753
|
|
|
24639
24754
|
// src/commands/github/issue/fixStructure/assertChainTypesExist.ts
|
|
@@ -24669,22 +24784,22 @@ function parseTypeChain(value) {
|
|
|
24669
24784
|
}
|
|
24670
24785
|
|
|
24671
24786
|
// src/commands/github/issue/fixStructure/printFixStructurePlan.ts
|
|
24672
|
-
import
|
|
24787
|
+
import chalk170 from "chalk";
|
|
24673
24788
|
function annotate(entry) {
|
|
24674
24789
|
const notes = [];
|
|
24675
24790
|
if (entry.level === null) {
|
|
24676
|
-
notes.push(
|
|
24791
|
+
notes.push(chalk170.red("deeper than the leaf level"));
|
|
24677
24792
|
} else if (entry.typeChange) {
|
|
24678
24793
|
notes.push(
|
|
24679
|
-
|
|
24794
|
+
chalk170.yellow(
|
|
24680
24795
|
`${entry.typeChange.from ?? "no type"} -> ${entry.typeChange.to}`
|
|
24681
24796
|
)
|
|
24682
24797
|
);
|
|
24683
24798
|
} else {
|
|
24684
|
-
notes.push(
|
|
24799
|
+
notes.push(chalk170.dim(entry.issue.typeName ?? "no type"));
|
|
24685
24800
|
}
|
|
24686
24801
|
for (const label2 of entry.labelRemovals) {
|
|
24687
|
-
notes.push(
|
|
24802
|
+
notes.push(chalk170.yellow(`-${label2.name}`));
|
|
24688
24803
|
}
|
|
24689
24804
|
return notes;
|
|
24690
24805
|
}
|
|
@@ -24692,22 +24807,22 @@ function formatCount(count8, noun) {
|
|
|
24692
24807
|
return `${count8} ${noun}${count8 === 1 ? "" : "s"}`;
|
|
24693
24808
|
}
|
|
24694
24809
|
function printFixStructurePlan(plan2, chain2, apply) {
|
|
24695
|
-
writeLineNow(
|
|
24810
|
+
writeLineNow(chalk170.dim(`chain: ${chain2.join(" > ")}`));
|
|
24696
24811
|
for (const entry of plan2.entries) {
|
|
24697
24812
|
const indent3 = " ".repeat(entry.issue.depth);
|
|
24698
|
-
const name =
|
|
24813
|
+
const name = chalk170.cyan(`${entry.issue.repo}#${entry.issue.number}`);
|
|
24699
24814
|
writeLineNow(
|
|
24700
24815
|
`${indent3}${name} ${entry.issue.title} [${annotate(entry).join(", ")}]`
|
|
24701
24816
|
);
|
|
24702
24817
|
}
|
|
24703
24818
|
if (plan2.typeChangeCount === 0 && plan2.labelRemovalCount === 0) {
|
|
24704
|
-
writeLineNow(
|
|
24819
|
+
writeLineNow(chalk170.green("Nothing to change"));
|
|
24705
24820
|
return;
|
|
24706
24821
|
}
|
|
24707
24822
|
writeLineNow(
|
|
24708
24823
|
`${formatCount(plan2.typeChangeCount, "type change")}, ${formatCount(plan2.labelRemovalCount, "label removal")} planned`
|
|
24709
24824
|
);
|
|
24710
|
-
if (!apply) writeLineNow(
|
|
24825
|
+
if (!apply) writeLineNow(chalk170.dim("Dry run \u2014 nothing written"));
|
|
24711
24826
|
}
|
|
24712
24827
|
|
|
24713
24828
|
// src/commands/github/issue/parseRepoSlug.ts
|
|
@@ -25917,7 +26032,7 @@ function registerGithub(program2) {
|
|
|
25917
26032
|
}
|
|
25918
26033
|
|
|
25919
26034
|
// src/commands/jira/acceptanceCriteria.ts
|
|
25920
|
-
import
|
|
26035
|
+
import chalk171 from "chalk";
|
|
25921
26036
|
|
|
25922
26037
|
// src/commands/jira/adfToText.ts
|
|
25923
26038
|
function renderInline(node) {
|
|
@@ -25984,7 +26099,7 @@ function acceptanceCriteria(issueKey) {
|
|
|
25984
26099
|
const parsed = fetchIssue(issueKey, field);
|
|
25985
26100
|
const acValue = parsed?.fields?.[field];
|
|
25986
26101
|
if (!acValue) {
|
|
25987
|
-
console.log(
|
|
26102
|
+
console.log(chalk171.yellow(`No acceptance criteria found on ${issueKey}.`));
|
|
25988
26103
|
return;
|
|
25989
26104
|
}
|
|
25990
26105
|
if (typeof acValue === "string") {
|
|
@@ -26050,14 +26165,14 @@ async function jiraAuth() {
|
|
|
26050
26165
|
}
|
|
26051
26166
|
|
|
26052
26167
|
// src/commands/jira/viewIssue.ts
|
|
26053
|
-
import
|
|
26168
|
+
import chalk172 from "chalk";
|
|
26054
26169
|
function viewIssue2(issueKey) {
|
|
26055
26170
|
const parsed = fetchIssue(issueKey, "summary,description");
|
|
26056
26171
|
const fields = parsed?.fields;
|
|
26057
26172
|
const summary = fields?.summary;
|
|
26058
26173
|
const description = fields?.description;
|
|
26059
26174
|
if (summary) {
|
|
26060
|
-
console.log(
|
|
26175
|
+
console.log(chalk172.bold(summary));
|
|
26061
26176
|
}
|
|
26062
26177
|
if (description) {
|
|
26063
26178
|
if (summary) console.log();
|
|
@@ -26071,7 +26186,7 @@ function viewIssue2(issueKey) {
|
|
|
26071
26186
|
}
|
|
26072
26187
|
if (!summary && !description) {
|
|
26073
26188
|
console.log(
|
|
26074
|
-
|
|
26189
|
+
chalk172.yellow(`No summary or description found on ${issueKey}.`)
|
|
26075
26190
|
);
|
|
26076
26191
|
}
|
|
26077
26192
|
}
|
|
@@ -26106,7 +26221,7 @@ import { randomUUID as randomUUID12 } from "crypto";
|
|
|
26106
26221
|
|
|
26107
26222
|
// src/commands/review/checkoutPr.ts
|
|
26108
26223
|
import { execFileSync as execFileSync16 } from "child_process";
|
|
26109
|
-
import
|
|
26224
|
+
import chalk173 from "chalk";
|
|
26110
26225
|
|
|
26111
26226
|
// src/commands/sessions/daemon/daemonLog.ts
|
|
26112
26227
|
var RING_CAPACITY = 1e3;
|
|
@@ -26779,7 +26894,7 @@ async function checkoutPr(number) {
|
|
|
26779
26894
|
try {
|
|
26780
26895
|
execFileSync16("gh", ["pr", "checkout", number], { stdio: "inherit" });
|
|
26781
26896
|
} catch {
|
|
26782
|
-
console.error(
|
|
26897
|
+
console.error(chalk173.red(`gh pr checkout ${number} failed; aborting.`));
|
|
26783
26898
|
process.exit(1);
|
|
26784
26899
|
}
|
|
26785
26900
|
}
|
|
@@ -26914,18 +27029,18 @@ function registerList(program2) {
|
|
|
26914
27029
|
}
|
|
26915
27030
|
|
|
26916
27031
|
// src/commands/litellm/listModels.ts
|
|
26917
|
-
import
|
|
27032
|
+
import chalk175 from "chalk";
|
|
26918
27033
|
|
|
26919
27034
|
// src/commands/litellm/resolveLitellmConfig.ts
|
|
26920
|
-
import
|
|
27035
|
+
import chalk174 from "chalk";
|
|
26921
27036
|
function resolveLitellmConfig() {
|
|
26922
27037
|
const { config, missing } = readLitellmConfig();
|
|
26923
27038
|
if (!config) {
|
|
26924
|
-
console.error(
|
|
27039
|
+
console.error(chalk174.red("LiteLLM is not configured"));
|
|
26925
27040
|
for (const key of missing) {
|
|
26926
27041
|
const entry = litellmConfigHelp.find((help) => help.key === key);
|
|
26927
27042
|
console.error(
|
|
26928
|
-
|
|
27043
|
+
chalk174.red(` ${key} is not set. Set it with: ${entry?.setter}`)
|
|
26929
27044
|
);
|
|
26930
27045
|
}
|
|
26931
27046
|
process.exit(1);
|
|
@@ -26951,13 +27066,13 @@ async function listModels(options2) {
|
|
|
26951
27066
|
} catch (error) {
|
|
26952
27067
|
const reason4 = error instanceof Error ? error.message : String(error);
|
|
26953
27068
|
console.error(
|
|
26954
|
-
|
|
27069
|
+
chalk175.red(`Failed to reach LiteLLM at ${baseUrl}: ${reason4}`)
|
|
26955
27070
|
);
|
|
26956
27071
|
process.exit(1);
|
|
26957
27072
|
}
|
|
26958
27073
|
const body = await response.text();
|
|
26959
27074
|
if (!response.ok) {
|
|
26960
|
-
console.error(
|
|
27075
|
+
console.error(chalk175.red(`LiteLLM returned ${response.status}: ${body}`));
|
|
26961
27076
|
process.exit(1);
|
|
26962
27077
|
}
|
|
26963
27078
|
if (options2.json) {
|
|
@@ -26977,15 +27092,15 @@ function registerLitellm(program2) {
|
|
|
26977
27092
|
// src/commands/mermaidExport.ts
|
|
26978
27093
|
import { mkdirSync as mkdirSync19, readdirSync as readdirSync11 } from "fs";
|
|
26979
27094
|
import { resolve as resolve19 } from "path";
|
|
26980
|
-
import
|
|
27095
|
+
import chalk178 from "chalk";
|
|
26981
27096
|
|
|
26982
27097
|
// src/commands/mermaid/exportFile.ts
|
|
26983
27098
|
import { readFileSync as readFileSync40, writeFileSync as writeFileSync33 } from "fs";
|
|
26984
27099
|
import { basename as basename21, extname as extname3, resolve as resolve18 } from "path";
|
|
26985
|
-
import
|
|
27100
|
+
import chalk177 from "chalk";
|
|
26986
27101
|
|
|
26987
27102
|
// src/commands/mermaid/renderBlock.ts
|
|
26988
|
-
import
|
|
27103
|
+
import chalk176 from "chalk";
|
|
26989
27104
|
async function renderBlock(krokiUrl, source) {
|
|
26990
27105
|
const response = await fetch(`${krokiUrl}/mermaid/svg`, {
|
|
26991
27106
|
method: "POST",
|
|
@@ -26994,7 +27109,7 @@ async function renderBlock(krokiUrl, source) {
|
|
|
26994
27109
|
});
|
|
26995
27110
|
if (!response.ok) {
|
|
26996
27111
|
console.error(
|
|
26997
|
-
|
|
27112
|
+
chalk176.red(
|
|
26998
27113
|
`Kroki request failed: ${response.status} ${response.statusText}`
|
|
26999
27114
|
)
|
|
27000
27115
|
);
|
|
@@ -27012,19 +27127,19 @@ async function exportFile(file, outDir, krokiUrl, onlyIndex) {
|
|
|
27012
27127
|
if (onlyIndex !== void 0) {
|
|
27013
27128
|
if (onlyIndex < 1 || onlyIndex > blocks.length) {
|
|
27014
27129
|
console.error(
|
|
27015
|
-
|
|
27130
|
+
chalk177.red(
|
|
27016
27131
|
`${file}: --index ${onlyIndex} out of range (file has ${blocks.length} diagram(s))`
|
|
27017
27132
|
)
|
|
27018
27133
|
);
|
|
27019
27134
|
process.exit(1);
|
|
27020
27135
|
}
|
|
27021
27136
|
console.log(
|
|
27022
|
-
|
|
27137
|
+
chalk177.gray(
|
|
27023
27138
|
`${file} \u2014 rendering diagram ${onlyIndex} of ${blocks.length}`
|
|
27024
27139
|
)
|
|
27025
27140
|
);
|
|
27026
27141
|
} else {
|
|
27027
|
-
console.log(
|
|
27142
|
+
console.log(chalk177.gray(`${file} \u2014 ${blocks.length} diagram(s)`));
|
|
27028
27143
|
}
|
|
27029
27144
|
for (const [i, source] of blocks.entries()) {
|
|
27030
27145
|
const idx = i + 1;
|
|
@@ -27032,7 +27147,7 @@ async function exportFile(file, outDir, krokiUrl, onlyIndex) {
|
|
|
27032
27147
|
const outPath = resolve18(outDir, `${stem}-${idx}.svg`);
|
|
27033
27148
|
const svg = await renderBlock(krokiUrl, source);
|
|
27034
27149
|
writeFileSync33(outPath, svg, "utf8");
|
|
27035
|
-
console.log(
|
|
27150
|
+
console.log(chalk177.green(` \u2192 ${outPath}`));
|
|
27036
27151
|
}
|
|
27037
27152
|
}
|
|
27038
27153
|
function extractMermaidBlocks(markdown) {
|
|
@@ -27048,18 +27163,18 @@ async function mermaidExport(file, options2 = {}) {
|
|
|
27048
27163
|
if (options2.index !== void 0) {
|
|
27049
27164
|
if (!Number.isInteger(options2.index) || options2.index < 1) {
|
|
27050
27165
|
console.error(
|
|
27051
|
-
|
|
27166
|
+
chalk178.red(`--index must be a positive integer (got ${options2.index})`)
|
|
27052
27167
|
);
|
|
27053
27168
|
process.exit(1);
|
|
27054
27169
|
}
|
|
27055
27170
|
if (!file) {
|
|
27056
|
-
console.error(
|
|
27171
|
+
console.error(chalk178.red("--index requires a file argument"));
|
|
27057
27172
|
process.exit(1);
|
|
27058
27173
|
}
|
|
27059
27174
|
}
|
|
27060
27175
|
const files = file ? [file] : readdirSync11(process.cwd()).filter((name) => name.toLowerCase().endsWith(".md")).sort();
|
|
27061
27176
|
if (files.length === 0) {
|
|
27062
|
-
console.log(
|
|
27177
|
+
console.log(chalk178.gray("No markdown files found in current directory."));
|
|
27063
27178
|
return;
|
|
27064
27179
|
}
|
|
27065
27180
|
for (const f of files) {
|
|
@@ -27205,7 +27320,7 @@ function extractToSave(details, cwd = process.cwd()) {
|
|
|
27205
27320
|
}
|
|
27206
27321
|
|
|
27207
27322
|
// src/commands/miro/keptTexts.ts
|
|
27208
|
-
import
|
|
27323
|
+
import chalk179 from "chalk";
|
|
27209
27324
|
|
|
27210
27325
|
// src/commands/miro/applyIgnore.ts
|
|
27211
27326
|
function applyIgnore(texts, ignore3) {
|
|
@@ -27244,7 +27359,7 @@ function warnUnmatched(file, unmatched) {
|
|
|
27244
27359
|
if (unmatched.length === 0) return;
|
|
27245
27360
|
const entries = unmatched.map((entry) => ` - ${entry}`).join("\n");
|
|
27246
27361
|
console.error(
|
|
27247
|
-
|
|
27362
|
+
chalk179.yellow(
|
|
27248
27363
|
`${unmatched.length} ${unmatched.length === 1 ? "entry" : "entries"} in ${file} matched no box text:
|
|
27249
27364
|
${entries}`
|
|
27250
27365
|
)
|
|
@@ -27447,7 +27562,7 @@ function readMiroItems(file) {
|
|
|
27447
27562
|
}
|
|
27448
27563
|
|
|
27449
27564
|
// src/commands/miro/resolveExtractOptions.ts
|
|
27450
|
-
import
|
|
27565
|
+
import chalk180 from "chalk";
|
|
27451
27566
|
|
|
27452
27567
|
// src/commands/miro/extractLayers.ts
|
|
27453
27568
|
function extractsIn(layer) {
|
|
@@ -27525,7 +27640,7 @@ function resolveExtractOptions(name, options2, paths) {
|
|
|
27525
27640
|
paths.cwd,
|
|
27526
27641
|
paths.globalConfigPath
|
|
27527
27642
|
);
|
|
27528
|
-
console.error(
|
|
27643
|
+
console.error(chalk180.dim(`Extract "${name}" from ${resolved.from}`));
|
|
27529
27644
|
return resolved.options;
|
|
27530
27645
|
}
|
|
27531
27646
|
|
|
@@ -27627,7 +27742,7 @@ function registerMiro(program2) {
|
|
|
27627
27742
|
import { mkdir as mkdir6 } from "fs/promises";
|
|
27628
27743
|
import { createServer as createServer2 } from "http";
|
|
27629
27744
|
import { dirname as dirname34 } from "path";
|
|
27630
|
-
import
|
|
27745
|
+
import chalk182 from "chalk";
|
|
27631
27746
|
|
|
27632
27747
|
// src/commands/netcap/corsHeaders.ts
|
|
27633
27748
|
var corsHeaders = {
|
|
@@ -27706,7 +27821,7 @@ function createNetcapHandler(options2) {
|
|
|
27706
27821
|
import { cp as cp4, readFile as readFile7, writeFile as writeFile6 } from "fs/promises";
|
|
27707
27822
|
import { networkInterfaces } from "os";
|
|
27708
27823
|
import { join as join72 } from "path";
|
|
27709
|
-
import
|
|
27824
|
+
import chalk181 from "chalk";
|
|
27710
27825
|
|
|
27711
27826
|
// src/commands/netcap/netcapExtensionDir.ts
|
|
27712
27827
|
import { dirname as dirname33, join as join71 } from "path";
|
|
@@ -27750,7 +27865,7 @@ async function prepareExtensionForLoad(port, filter = "") {
|
|
|
27750
27865
|
const host = lanIPv4();
|
|
27751
27866
|
if (!host) {
|
|
27752
27867
|
console.log(
|
|
27753
|
-
|
|
27868
|
+
chalk181.yellow("could not determine the WSL IP for the extension")
|
|
27754
27869
|
);
|
|
27755
27870
|
await configureBackground(source, "127.0.0.1", port, filter);
|
|
27756
27871
|
return source;
|
|
@@ -27761,7 +27876,7 @@ async function prepareExtensionForLoad(port, filter = "") {
|
|
|
27761
27876
|
return WSL_WINDOWS_PATH3;
|
|
27762
27877
|
} catch {
|
|
27763
27878
|
console.log(
|
|
27764
|
-
|
|
27879
|
+
chalk181.yellow(`could not copy extension to ${WSL_WINDOWS_PATH3}`)
|
|
27765
27880
|
);
|
|
27766
27881
|
return source;
|
|
27767
27882
|
}
|
|
@@ -27794,30 +27909,30 @@ async function netcap(options2) {
|
|
|
27794
27909
|
let count8 = 0;
|
|
27795
27910
|
const handler = createNetcapHandler({
|
|
27796
27911
|
outPath,
|
|
27797
|
-
onPing: () => console.log(
|
|
27912
|
+
onPing: () => console.log(chalk182.dim("ping from extension")),
|
|
27798
27913
|
onCapture: (entry) => {
|
|
27799
27914
|
count8 += 1;
|
|
27800
27915
|
console.log(
|
|
27801
|
-
|
|
27802
|
-
|
|
27916
|
+
chalk182.green(`captured #${count8}`),
|
|
27917
|
+
chalk182.dim(`${entry.method ?? "?"} ${entry.url ?? "?"}`)
|
|
27803
27918
|
);
|
|
27804
27919
|
}
|
|
27805
27920
|
});
|
|
27806
27921
|
const server = createServer2(handler);
|
|
27807
27922
|
server.listen(port, () => {
|
|
27808
27923
|
console.log(
|
|
27809
|
-
|
|
27924
|
+
chalk182.bold(`netcap receiver listening on http://127.0.0.1:${port}`)
|
|
27810
27925
|
);
|
|
27811
|
-
console.log(
|
|
27926
|
+
console.log(chalk182.dim(`appending captures to ${outPath}`));
|
|
27812
27927
|
if (filter)
|
|
27813
|
-
console.log(
|
|
27814
|
-
console.log(
|
|
27815
|
-
console.log(
|
|
27928
|
+
console.log(chalk182.dim(`forwarding only URLs matching "${filter}"`));
|
|
27929
|
+
console.log(chalk182.dim(`load the unpacked extension from ${extensionPath}`));
|
|
27930
|
+
console.log(chalk182.dim("press Ctrl-C to stop"));
|
|
27816
27931
|
});
|
|
27817
27932
|
process.on("SIGINT", () => {
|
|
27818
27933
|
server.close();
|
|
27819
27934
|
console.log(
|
|
27820
|
-
|
|
27935
|
+
chalk182.bold(
|
|
27821
27936
|
`
|
|
27822
27937
|
netcap stopped \u2014 captured ${count8} ${count8 === 1 ? "entry" : "entries"} to ${outPath}`
|
|
27823
27938
|
)
|
|
@@ -27829,7 +27944,7 @@ netcap stopped \u2014 captured ${count8} ${count8 === 1 ? "entry" : "entries"} t
|
|
|
27829
27944
|
// src/commands/netcap/netcapExtract.ts
|
|
27830
27945
|
import { writeFileSync as writeFileSync35 } from "fs";
|
|
27831
27946
|
import { join as join75 } from "path";
|
|
27832
|
-
import
|
|
27947
|
+
import chalk183 from "chalk";
|
|
27833
27948
|
|
|
27834
27949
|
// src/commands/netcap/extractPostsFromCapture.ts
|
|
27835
27950
|
import { readFileSync as readFileSync43 } from "fs";
|
|
@@ -28277,8 +28392,8 @@ function netcapExtract(file) {
|
|
|
28277
28392
|
writeFileSync35(outFile, `${JSON.stringify(posts, null, 2)}
|
|
28278
28393
|
`);
|
|
28279
28394
|
console.log(
|
|
28280
|
-
|
|
28281
|
-
|
|
28395
|
+
chalk183.green(`extracted ${posts.length} posts`),
|
|
28396
|
+
chalk183.dim(`-> ${outFile}`)
|
|
28282
28397
|
);
|
|
28283
28398
|
}
|
|
28284
28399
|
|
|
@@ -28299,7 +28414,7 @@ function registerNetcap(program2) {
|
|
|
28299
28414
|
}
|
|
28300
28415
|
|
|
28301
28416
|
// src/commands/news/add.ts
|
|
28302
|
-
import
|
|
28417
|
+
import chalk184 from "chalk";
|
|
28303
28418
|
import enquirer8 from "enquirer";
|
|
28304
28419
|
async function add2(url) {
|
|
28305
28420
|
if (!url) {
|
|
@@ -28321,10 +28436,10 @@ async function add2(url) {
|
|
|
28321
28436
|
const { orm } = await getReady();
|
|
28322
28437
|
const added = await addFeed(orm, url);
|
|
28323
28438
|
if (!added) {
|
|
28324
|
-
console.log(
|
|
28439
|
+
console.log(chalk184.yellow("Feed already exists"));
|
|
28325
28440
|
return;
|
|
28326
28441
|
}
|
|
28327
|
-
console.log(
|
|
28442
|
+
console.log(chalk184.green(`Added feed: ${url}`));
|
|
28328
28443
|
}
|
|
28329
28444
|
|
|
28330
28445
|
// src/commands/registerNews.ts
|
|
@@ -28372,7 +28487,7 @@ function registerPiHook(program2) {
|
|
|
28372
28487
|
}
|
|
28373
28488
|
|
|
28374
28489
|
// src/commands/prompts/printPromptsTable.ts
|
|
28375
|
-
import
|
|
28490
|
+
import chalk185 from "chalk";
|
|
28376
28491
|
function truncate(str, max) {
|
|
28377
28492
|
if (str.length <= max) return str;
|
|
28378
28493
|
return `${str.slice(0, max - 1)}\u2026`;
|
|
@@ -28390,14 +28505,14 @@ function printPromptsTable(rows) {
|
|
|
28390
28505
|
"Command".padEnd(commandWidth),
|
|
28391
28506
|
"Repos"
|
|
28392
28507
|
].join(" ");
|
|
28393
|
-
console.log(
|
|
28394
|
-
console.log(
|
|
28508
|
+
console.log(chalk185.dim(header));
|
|
28509
|
+
console.log(chalk185.dim("-".repeat(header.length)));
|
|
28395
28510
|
for (const row of rows) {
|
|
28396
28511
|
const count8 = String(row.count).padStart(countWidth);
|
|
28397
28512
|
const tool = row.tool.padEnd(toolWidth);
|
|
28398
28513
|
const command = truncate(row.command, 60).padEnd(commandWidth);
|
|
28399
28514
|
console.log(
|
|
28400
|
-
`${
|
|
28515
|
+
`${chalk185.yellow(count8)} ${tool} ${command} ${chalk185.dim(row.repos)}`
|
|
28401
28516
|
);
|
|
28402
28517
|
}
|
|
28403
28518
|
}
|
|
@@ -28432,13 +28547,13 @@ import { execSync as execSync39 } from "child_process";
|
|
|
28432
28547
|
import enquirer9 from "enquirer";
|
|
28433
28548
|
|
|
28434
28549
|
// src/commands/prs/prs/displayPaginated/printPr.ts
|
|
28435
|
-
import
|
|
28550
|
+
import chalk186 from "chalk";
|
|
28436
28551
|
var STATUS_MAP = {
|
|
28437
|
-
MERGED: (pr) => pr.mergedAt ? { label:
|
|
28438
|
-
CLOSED: (pr) => pr.closedAt ? { label:
|
|
28552
|
+
MERGED: (pr) => pr.mergedAt ? { label: chalk186.magenta("merged"), date: pr.mergedAt } : null,
|
|
28553
|
+
CLOSED: (pr) => pr.closedAt ? { label: chalk186.red("closed"), date: pr.closedAt } : null
|
|
28439
28554
|
};
|
|
28440
28555
|
function defaultStatus(pr) {
|
|
28441
|
-
return { label:
|
|
28556
|
+
return { label: chalk186.green("opened"), date: pr.createdAt };
|
|
28442
28557
|
}
|
|
28443
28558
|
function getStatus2(pr) {
|
|
28444
28559
|
return STATUS_MAP[pr.state]?.(pr) ?? defaultStatus(pr);
|
|
@@ -28447,11 +28562,11 @@ function formatDate(dateStr) {
|
|
|
28447
28562
|
return new Date(dateStr).toISOString().split("T")[0];
|
|
28448
28563
|
}
|
|
28449
28564
|
function formatPrHeader(pr, status2) {
|
|
28450
|
-
return `${
|
|
28565
|
+
return `${chalk186.cyan(`#${pr.number}`)} ${pr.title} ${chalk186.dim(`(${pr.author.login},`)} ${status2.label} ${chalk186.dim(`${formatDate(status2.date)})`)}`;
|
|
28451
28566
|
}
|
|
28452
28567
|
function logPrDetails(pr) {
|
|
28453
28568
|
console.log(
|
|
28454
|
-
|
|
28569
|
+
chalk186.dim(` ${pr.changedFiles.toLocaleString()} files | ${pr.url}`)
|
|
28455
28570
|
);
|
|
28456
28571
|
console.log();
|
|
28457
28572
|
}
|
|
@@ -28941,13 +29056,13 @@ function agentFooter(unresolvedCount) {
|
|
|
28941
29056
|
}
|
|
28942
29057
|
|
|
28943
29058
|
// src/commands/prs/listComments/commentStyle.ts
|
|
28944
|
-
import
|
|
29059
|
+
import chalk187 from "chalk";
|
|
28945
29060
|
var plain = (text18) => text18;
|
|
28946
29061
|
function colouredState(state) {
|
|
28947
29062
|
const label2 = `[${state}]`;
|
|
28948
|
-
if (state === "APPROVED") return
|
|
28949
|
-
if (state === "CHANGES_REQUESTED") return
|
|
28950
|
-
return
|
|
29063
|
+
if (state === "APPROVED") return chalk187.green(label2);
|
|
29064
|
+
if (state === "CHANGES_REQUESTED") return chalk187.red(label2);
|
|
29065
|
+
return chalk187.yellow(label2);
|
|
28951
29066
|
}
|
|
28952
29067
|
function commentStyle() {
|
|
28953
29068
|
if (isClaudeCode()) {
|
|
@@ -28961,9 +29076,9 @@ function commentStyle() {
|
|
|
28961
29076
|
};
|
|
28962
29077
|
}
|
|
28963
29078
|
return {
|
|
28964
|
-
cyan:
|
|
28965
|
-
bold:
|
|
28966
|
-
dim:
|
|
29079
|
+
cyan: chalk187.cyan,
|
|
29080
|
+
bold: chalk187.bold,
|
|
29081
|
+
dim: chalk187.dim,
|
|
28967
29082
|
state: colouredState,
|
|
28968
29083
|
diffHunk: true,
|
|
28969
29084
|
agent: false
|
|
@@ -30175,16 +30290,16 @@ function buildPrsStatusReport(repoArguments, now = Date.now()) {
|
|
|
30175
30290
|
}
|
|
30176
30291
|
|
|
30177
30292
|
// src/commands/prs/status/printPrsStatus.ts
|
|
30178
|
-
import
|
|
30293
|
+
import chalk189 from "chalk";
|
|
30179
30294
|
|
|
30180
30295
|
// src/commands/prs/status/printPrStatus.ts
|
|
30181
|
-
import
|
|
30296
|
+
import chalk188 from "chalk";
|
|
30182
30297
|
function flags(pr) {
|
|
30183
30298
|
const markers = [];
|
|
30184
30299
|
if (pr.isDraft) markers.push("draft");
|
|
30185
30300
|
if (pr.isDoNotMerge) markers.push("do not merge");
|
|
30186
30301
|
if (pr.isBot) markers.push("bot");
|
|
30187
|
-
return markers.length ? ` ${
|
|
30302
|
+
return markers.length ? ` ${chalk188.yellow(`[${markers.join(", ")}]`)}` : "";
|
|
30188
30303
|
}
|
|
30189
30304
|
function updated(pr) {
|
|
30190
30305
|
return pr.ageHours === null ? "updated unknown" : `updated ${pr.age} ago`;
|
|
@@ -30198,35 +30313,35 @@ function reviewLine(pr) {
|
|
|
30198
30313
|
function checkLines(pr) {
|
|
30199
30314
|
const lines2 = [];
|
|
30200
30315
|
if (pr.checks.failing.length) {
|
|
30201
|
-
lines2.push(
|
|
30316
|
+
lines2.push(chalk188.red(`failing: ${pr.checks.failing.join(", ")}`));
|
|
30202
30317
|
}
|
|
30203
30318
|
if (pr.checks.pending.length) {
|
|
30204
|
-
lines2.push(
|
|
30319
|
+
lines2.push(chalk188.yellow(`pending: ${pr.checks.pending.join(", ")}`));
|
|
30205
30320
|
}
|
|
30206
30321
|
return lines2;
|
|
30207
30322
|
}
|
|
30208
30323
|
function threadsLine(pr) {
|
|
30209
30324
|
if (pr.unresolvedThreads === null) {
|
|
30210
|
-
return
|
|
30325
|
+
return chalk188.dim("unresolved comments: unknown");
|
|
30211
30326
|
}
|
|
30212
30327
|
if (pr.unresolvedThreads === 0) return null;
|
|
30213
|
-
return
|
|
30328
|
+
return chalk188.yellow(`unresolved comments: ${pr.unresolvedThreads}`);
|
|
30214
30329
|
}
|
|
30215
30330
|
function mergeableLine(pr) {
|
|
30216
|
-
if (pr.mergeable === "CONFLICTING") return
|
|
30331
|
+
if (pr.mergeable === "CONFLICTING") return chalk188.red("conflicting");
|
|
30217
30332
|
if (pr.mergeable === "MERGEABLE") return null;
|
|
30218
|
-
return
|
|
30333
|
+
return chalk188.dim(`mergeable: ${pr.mergeable.toLowerCase()}`);
|
|
30219
30334
|
}
|
|
30220
30335
|
function printPrStatus(pr) {
|
|
30221
30336
|
console.log(
|
|
30222
|
-
` ${
|
|
30337
|
+
` ${chalk188.cyan(`#${pr.number}`)} ${pr.title} ${chalk188.dim(`(${pr.author}, ${updated(pr)})`)}${flags(pr)}`
|
|
30223
30338
|
);
|
|
30224
30339
|
const details = [
|
|
30225
30340
|
reviewLine(pr),
|
|
30226
30341
|
...checkLines(pr),
|
|
30227
30342
|
threadsLine(pr),
|
|
30228
30343
|
mergeableLine(pr),
|
|
30229
|
-
|
|
30344
|
+
chalk188.dim(pr.url)
|
|
30230
30345
|
];
|
|
30231
30346
|
for (const detail of details) {
|
|
30232
30347
|
if (detail) console.log(` ${detail}`);
|
|
@@ -30237,17 +30352,17 @@ function printPrStatus(pr) {
|
|
|
30237
30352
|
function printPrsStatus(report) {
|
|
30238
30353
|
for (const repo of report.repos) {
|
|
30239
30354
|
const count8 = repo.pullRequests.length;
|
|
30240
|
-
console.log(`${
|
|
30355
|
+
console.log(`${chalk189.bold(repo.repo)} ${chalk189.dim(`(${count8} open)`)}`);
|
|
30241
30356
|
for (const pr of repo.pullRequests) {
|
|
30242
30357
|
printPrStatus(pr);
|
|
30243
30358
|
}
|
|
30244
|
-
if (count8 === 0) console.log(
|
|
30359
|
+
if (count8 === 0) console.log(chalk189.dim(" no open pull requests"));
|
|
30245
30360
|
console.log();
|
|
30246
30361
|
}
|
|
30247
30362
|
if (report.errors.length === 0) return;
|
|
30248
|
-
console.log(
|
|
30363
|
+
console.log(chalk189.bold("Errors"));
|
|
30249
30364
|
for (const failure of report.errors) {
|
|
30250
|
-
console.log(` ${
|
|
30365
|
+
console.log(` ${chalk189.red(failure.repo)}: ${failure.error}`);
|
|
30251
30366
|
}
|
|
30252
30367
|
console.log();
|
|
30253
30368
|
}
|
|
@@ -30466,10 +30581,10 @@ function registerPrs(program2) {
|
|
|
30466
30581
|
}
|
|
30467
30582
|
|
|
30468
30583
|
// src/commands/ravendb/ravendbAuth.ts
|
|
30469
|
-
import
|
|
30584
|
+
import chalk195 from "chalk";
|
|
30470
30585
|
|
|
30471
30586
|
// src/shared/createConnectionAuth.ts
|
|
30472
|
-
import
|
|
30587
|
+
import chalk190 from "chalk";
|
|
30473
30588
|
function listConnections(connections, format2) {
|
|
30474
30589
|
if (connections.length === 0) {
|
|
30475
30590
|
console.log("No connections configured.");
|
|
@@ -30482,7 +30597,7 @@ function listConnections(connections, format2) {
|
|
|
30482
30597
|
function removeConnection(connections, name, save) {
|
|
30483
30598
|
const filtered = connections.filter((c) => c.name !== name);
|
|
30484
30599
|
if (filtered.length === connections.length) {
|
|
30485
|
-
console.error(
|
|
30600
|
+
console.error(chalk190.red(`Connection "${name}" not found.`));
|
|
30486
30601
|
process.exit(1);
|
|
30487
30602
|
}
|
|
30488
30603
|
save(filtered);
|
|
@@ -30528,15 +30643,15 @@ function saveConnections(connections) {
|
|
|
30528
30643
|
}
|
|
30529
30644
|
|
|
30530
30645
|
// src/commands/ravendb/promptConnection.ts
|
|
30531
|
-
import
|
|
30646
|
+
import chalk193 from "chalk";
|
|
30532
30647
|
|
|
30533
30648
|
// src/commands/ravendb/selectOpSecret.ts
|
|
30534
|
-
import
|
|
30649
|
+
import chalk192 from "chalk";
|
|
30535
30650
|
import Enquirer2 from "enquirer";
|
|
30536
30651
|
|
|
30537
30652
|
// src/commands/ravendb/searchItems.ts
|
|
30538
30653
|
import { execSync as execSync49 } from "child_process";
|
|
30539
|
-
import
|
|
30654
|
+
import chalk191 from "chalk";
|
|
30540
30655
|
function opExec(args) {
|
|
30541
30656
|
return execSync49(`op ${args}`, {
|
|
30542
30657
|
encoding: "utf8",
|
|
@@ -30549,7 +30664,7 @@ function searchItems(search2) {
|
|
|
30549
30664
|
items2 = JSON.parse(opExec("item list --format=json"));
|
|
30550
30665
|
} catch {
|
|
30551
30666
|
console.error(
|
|
30552
|
-
|
|
30667
|
+
chalk191.red(
|
|
30553
30668
|
"Failed to search 1Password. Ensure the CLI is installed and you are signed in."
|
|
30554
30669
|
)
|
|
30555
30670
|
);
|
|
@@ -30563,7 +30678,7 @@ function getItemFields(itemId2) {
|
|
|
30563
30678
|
const item = JSON.parse(opExec(`item get "${itemId2}" --format=json`));
|
|
30564
30679
|
return item.fields.filter((f) => f.reference && f.label);
|
|
30565
30680
|
} catch {
|
|
30566
|
-
console.error(
|
|
30681
|
+
console.error(chalk191.red("Failed to get item details from 1Password."));
|
|
30567
30682
|
process.exit(1);
|
|
30568
30683
|
}
|
|
30569
30684
|
}
|
|
@@ -30582,7 +30697,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
30582
30697
|
}).run();
|
|
30583
30698
|
const items2 = searchItems(search2);
|
|
30584
30699
|
if (items2.length === 0) {
|
|
30585
|
-
console.error(
|
|
30700
|
+
console.error(chalk192.red(`No items found matching "${search2}".`));
|
|
30586
30701
|
process.exit(1);
|
|
30587
30702
|
}
|
|
30588
30703
|
const itemId2 = await selectOne(
|
|
@@ -30591,7 +30706,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
30591
30706
|
);
|
|
30592
30707
|
const fields = getItemFields(itemId2);
|
|
30593
30708
|
if (fields.length === 0) {
|
|
30594
|
-
console.error(
|
|
30709
|
+
console.error(chalk192.red("No fields with references found on this item."));
|
|
30595
30710
|
process.exit(1);
|
|
30596
30711
|
}
|
|
30597
30712
|
const ref = await selectOne(
|
|
@@ -30605,7 +30720,7 @@ async function selectOpSecret(searchTerm) {
|
|
|
30605
30720
|
async function promptConnection(existingNames) {
|
|
30606
30721
|
const name = await promptInput("name", "Connection name:");
|
|
30607
30722
|
if (existingNames.includes(name)) {
|
|
30608
|
-
console.error(
|
|
30723
|
+
console.error(chalk193.red(`Connection "${name}" already exists.`));
|
|
30609
30724
|
process.exit(1);
|
|
30610
30725
|
}
|
|
30611
30726
|
const url = await promptInput(
|
|
@@ -30614,22 +30729,22 @@ async function promptConnection(existingNames) {
|
|
|
30614
30729
|
);
|
|
30615
30730
|
const database = await promptInput("database", "Database name:");
|
|
30616
30731
|
if (!name || !url || !database) {
|
|
30617
|
-
console.error(
|
|
30732
|
+
console.error(chalk193.red("All fields are required."));
|
|
30618
30733
|
process.exit(1);
|
|
30619
30734
|
}
|
|
30620
30735
|
const apiKeyRef = await selectOpSecret();
|
|
30621
|
-
console.log(
|
|
30736
|
+
console.log(chalk193.dim(`Using: ${apiKeyRef}`));
|
|
30622
30737
|
return { name, url, database, apiKeyRef };
|
|
30623
30738
|
}
|
|
30624
30739
|
|
|
30625
30740
|
// src/commands/ravendb/ravendbSetConnection.ts
|
|
30626
|
-
import
|
|
30741
|
+
import chalk194 from "chalk";
|
|
30627
30742
|
function ravendbSetConnection(name) {
|
|
30628
30743
|
const raw = loadGlobalConfigRaw();
|
|
30629
30744
|
const ravendb = raw.ravendb ?? {};
|
|
30630
30745
|
const connections = ravendb.connections ?? [];
|
|
30631
30746
|
if (!connections.some((c) => c.name === name)) {
|
|
30632
|
-
console.error(
|
|
30747
|
+
console.error(chalk194.red(`Connection "${name}" not found.`));
|
|
30633
30748
|
console.error(
|
|
30634
30749
|
`Available: ${connections.map((c) => c.name).join(", ") || "(none)"}`
|
|
30635
30750
|
);
|
|
@@ -30645,16 +30760,16 @@ function ravendbSetConnection(name) {
|
|
|
30645
30760
|
var ravendbAuth = createConnectionAuth({
|
|
30646
30761
|
load: loadConnections,
|
|
30647
30762
|
save: saveConnections,
|
|
30648
|
-
format: (c) => `${
|
|
30763
|
+
format: (c) => `${chalk195.bold(c.name)} ${c.url} db=${c.database} key=${c.apiKeyRef}`,
|
|
30649
30764
|
promptNew: promptConnection,
|
|
30650
30765
|
onFirst: (c) => ravendbSetConnection(c.name)
|
|
30651
30766
|
});
|
|
30652
30767
|
|
|
30653
30768
|
// src/commands/ravendb/ravendbCollections.ts
|
|
30654
|
-
import
|
|
30769
|
+
import chalk199 from "chalk";
|
|
30655
30770
|
|
|
30656
30771
|
// src/commands/ravendb/ravenFetch.ts
|
|
30657
|
-
import
|
|
30772
|
+
import chalk197 from "chalk";
|
|
30658
30773
|
|
|
30659
30774
|
// src/commands/ravendb/getAccessToken.ts
|
|
30660
30775
|
var OAUTH_URL = "https://amazon-useast-1-oauth.ravenhq.com/ApiKeys/OAuth/AccessToken";
|
|
@@ -30691,10 +30806,10 @@ ${errorText}`
|
|
|
30691
30806
|
|
|
30692
30807
|
// src/commands/ravendb/resolveOpSecret.ts
|
|
30693
30808
|
import { execSync as execSync50 } from "child_process";
|
|
30694
|
-
import
|
|
30809
|
+
import chalk196 from "chalk";
|
|
30695
30810
|
function resolveOpSecret(reference2) {
|
|
30696
30811
|
if (!reference2.startsWith("op://")) {
|
|
30697
|
-
console.error(
|
|
30812
|
+
console.error(chalk196.red(`Invalid secret reference: must start with op://`));
|
|
30698
30813
|
process.exit(1);
|
|
30699
30814
|
}
|
|
30700
30815
|
try {
|
|
@@ -30704,7 +30819,7 @@ function resolveOpSecret(reference2) {
|
|
|
30704
30819
|
}).trim();
|
|
30705
30820
|
} catch {
|
|
30706
30821
|
console.error(
|
|
30707
|
-
|
|
30822
|
+
chalk196.red(
|
|
30708
30823
|
"Failed to resolve secret reference. Ensure 1Password CLI is installed and you are signed in."
|
|
30709
30824
|
)
|
|
30710
30825
|
);
|
|
@@ -30731,7 +30846,7 @@ async function ravenFetch(connection, path106) {
|
|
|
30731
30846
|
if (!response.ok) {
|
|
30732
30847
|
const body = await response.text();
|
|
30733
30848
|
console.error(
|
|
30734
|
-
|
|
30849
|
+
chalk197.red(`RavenDB error: ${response.status} ${response.statusText}`)
|
|
30735
30850
|
);
|
|
30736
30851
|
console.error(body.substring(0, 500));
|
|
30737
30852
|
process.exit(1);
|
|
@@ -30740,7 +30855,7 @@ async function ravenFetch(connection, path106) {
|
|
|
30740
30855
|
}
|
|
30741
30856
|
|
|
30742
30857
|
// src/commands/ravendb/resolveConnection.ts
|
|
30743
|
-
import
|
|
30858
|
+
import chalk198 from "chalk";
|
|
30744
30859
|
function loadRavendb() {
|
|
30745
30860
|
const raw = loadGlobalConfigRaw();
|
|
30746
30861
|
const ravendb = raw.ravendb;
|
|
@@ -30754,7 +30869,7 @@ function resolveConnection(name) {
|
|
|
30754
30869
|
const connectionName = name ?? defaultConnection;
|
|
30755
30870
|
if (!connectionName) {
|
|
30756
30871
|
console.error(
|
|
30757
|
-
|
|
30872
|
+
chalk198.red(
|
|
30758
30873
|
"No connection specified and no default set. Use assist ravendb set-connection <name> or pass a connection name."
|
|
30759
30874
|
)
|
|
30760
30875
|
);
|
|
@@ -30762,7 +30877,7 @@ function resolveConnection(name) {
|
|
|
30762
30877
|
}
|
|
30763
30878
|
const connection = connections.find((c) => c.name === connectionName);
|
|
30764
30879
|
if (!connection) {
|
|
30765
|
-
console.error(
|
|
30880
|
+
console.error(chalk198.red(`Connection "${connectionName}" not found.`));
|
|
30766
30881
|
console.error(
|
|
30767
30882
|
`Available: ${connections.map((c) => c.name).join(", ") || "(none)"}`
|
|
30768
30883
|
);
|
|
@@ -30793,15 +30908,15 @@ async function ravendbCollections(connectionName) {
|
|
|
30793
30908
|
return;
|
|
30794
30909
|
}
|
|
30795
30910
|
for (const c of collections) {
|
|
30796
|
-
console.log(`${
|
|
30911
|
+
console.log(`${chalk199.bold(c.Name)} ${c.CountOfDocuments} docs`);
|
|
30797
30912
|
}
|
|
30798
30913
|
}
|
|
30799
30914
|
|
|
30800
30915
|
// src/commands/ravendb/ravendbQuery.ts
|
|
30801
|
-
import
|
|
30916
|
+
import chalk201 from "chalk";
|
|
30802
30917
|
|
|
30803
30918
|
// src/commands/ravendb/fetchAllPages.ts
|
|
30804
|
-
import
|
|
30919
|
+
import chalk200 from "chalk";
|
|
30805
30920
|
|
|
30806
30921
|
// src/commands/ravendb/buildQueryPath.ts
|
|
30807
30922
|
function buildQueryPath(opts) {
|
|
@@ -30839,7 +30954,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
30839
30954
|
allResults.push(...results);
|
|
30840
30955
|
start2 += results.length;
|
|
30841
30956
|
process.stderr.write(
|
|
30842
|
-
`\r${
|
|
30957
|
+
`\r${chalk200.dim(`Fetched ${allResults.length}/${totalResults}`)}`
|
|
30843
30958
|
);
|
|
30844
30959
|
if (start2 >= totalResults) break;
|
|
30845
30960
|
if (opts.limit !== void 0 && allResults.length >= opts.limit) break;
|
|
@@ -30854,7 +30969,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
30854
30969
|
async function ravendbQuery(connectionName, collection, options2) {
|
|
30855
30970
|
const resolved = resolveArgs(connectionName, collection);
|
|
30856
30971
|
if (!resolved.collection && !options2.query) {
|
|
30857
|
-
console.error(
|
|
30972
|
+
console.error(chalk201.red("Provide a collection name or --query filter."));
|
|
30858
30973
|
process.exit(1);
|
|
30859
30974
|
}
|
|
30860
30975
|
const { collection: col } = resolved;
|
|
@@ -30889,7 +31004,7 @@ function registerRavendb(program2) {
|
|
|
30889
31004
|
}
|
|
30890
31005
|
|
|
30891
31006
|
// src/commands/releases/releasesConfigure.ts
|
|
30892
|
-
import
|
|
31007
|
+
import chalk203 from "chalk";
|
|
30893
31008
|
|
|
30894
31009
|
// src/commands/releases/checkStreamGraph.ts
|
|
30895
31010
|
function nodeIds(stream) {
|
|
@@ -30951,26 +31066,26 @@ function readStreamsInput(source) {
|
|
|
30951
31066
|
}
|
|
30952
31067
|
|
|
30953
31068
|
// src/commands/releases/reportDerivedStreams.ts
|
|
30954
|
-
import
|
|
31069
|
+
import chalk202 from "chalk";
|
|
30955
31070
|
function printDerived(stream) {
|
|
30956
31071
|
const environments = stream.nodes.flatMap((n) => n.environment ?? []);
|
|
30957
31072
|
const steps = stream.nodes.filter((n) => !n.environment);
|
|
30958
31073
|
console.log(
|
|
30959
|
-
`${
|
|
31074
|
+
`${chalk202.bold(stream.name)} ${chalk202.dim(`${stream.repo} \xB7 ${stream.workflow}`)}`
|
|
30960
31075
|
);
|
|
30961
31076
|
console.log(
|
|
30962
|
-
` environments: ${environments.join(", ") ||
|
|
31077
|
+
` environments: ${environments.join(", ") || chalk202.dim("none")}`
|
|
30963
31078
|
);
|
|
30964
31079
|
if (steps.length > 0)
|
|
30965
31080
|
console.log(
|
|
30966
31081
|
` steps: ${steps.map((n) => `${n.id} [${n.kind ?? "step"}]`).join(", ")}`
|
|
30967
31082
|
);
|
|
30968
31083
|
const edges = stream.edges.map(([from, to]) => `${from} \u2192 ${to}`);
|
|
30969
|
-
console.log(` edges: ${edges.join(", ") ||
|
|
31084
|
+
console.log(` edges: ${edges.join(", ") || chalk202.dim("none")}`);
|
|
30970
31085
|
}
|
|
30971
31086
|
function reportDerivedStreams(streams, target) {
|
|
30972
31087
|
for (const stream of streams) printDerived(stream);
|
|
30973
|
-
console.log(
|
|
31088
|
+
console.log(chalk202.dim(`Written to ${target}`));
|
|
30974
31089
|
}
|
|
30975
31090
|
|
|
30976
31091
|
// src/commands/releases/withCurrentRepo.ts
|
|
@@ -31062,8 +31177,8 @@ function writeReleaseStreams(incoming, scope) {
|
|
|
31062
31177
|
|
|
31063
31178
|
// src/commands/releases/releasesConfigure.ts
|
|
31064
31179
|
function fail6(message3, details = []) {
|
|
31065
|
-
console.error(
|
|
31066
|
-
for (const detail of details) console.error(
|
|
31180
|
+
console.error(chalk203.red(message3));
|
|
31181
|
+
for (const detail of details) console.error(chalk203.red(` ${detail}`));
|
|
31067
31182
|
process.exitCode = 1;
|
|
31068
31183
|
}
|
|
31069
31184
|
function reportWritten(incoming, target) {
|
|
@@ -31095,23 +31210,23 @@ function releasesConfigure(options2 = {}) {
|
|
|
31095
31210
|
}
|
|
31096
31211
|
|
|
31097
31212
|
// src/commands/releases/releasesList.ts
|
|
31098
|
-
import
|
|
31213
|
+
import chalk204 from "chalk";
|
|
31099
31214
|
function describeNode(node) {
|
|
31100
31215
|
if (node.environment) return `${node.id} \u2192 ${node.environment}`;
|
|
31101
31216
|
return `${node.id} (${node.kind ?? "step"})`;
|
|
31102
31217
|
}
|
|
31103
31218
|
function printStream(stream) {
|
|
31104
|
-
console.log(`${
|
|
31105
|
-
console.log(
|
|
31219
|
+
console.log(`${chalk204.bold(stream.name)} ${chalk204.dim(stream.repo)}`);
|
|
31220
|
+
console.log(chalk204.dim(` workflow: ${stream.workflow}`));
|
|
31106
31221
|
for (const node of stream.nodes) console.log(` ${describeNode(node)}`);
|
|
31107
31222
|
for (const [from, to] of stream.edges)
|
|
31108
|
-
console.log(
|
|
31223
|
+
console.log(chalk204.dim(` ${from} \u2192 ${to}`));
|
|
31109
31224
|
}
|
|
31110
31225
|
function releasesList() {
|
|
31111
31226
|
const streams = loadConfig().releases?.streams ?? [];
|
|
31112
31227
|
if (streams.length === 0) {
|
|
31113
31228
|
console.log(
|
|
31114
|
-
|
|
31229
|
+
chalk204.dim("No release streams configured under releases.streams.")
|
|
31115
31230
|
);
|
|
31116
31231
|
return;
|
|
31117
31232
|
}
|
|
@@ -31156,7 +31271,7 @@ function coverage() {
|
|
|
31156
31271
|
|
|
31157
31272
|
// src/commands/lint/lint/runFileNameCheck.ts
|
|
31158
31273
|
import path44 from "path";
|
|
31159
|
-
import
|
|
31274
|
+
import chalk206 from "chalk";
|
|
31160
31275
|
|
|
31161
31276
|
// src/commands/lint/lint/checkFileNames.ts
|
|
31162
31277
|
import fs24 from "fs";
|
|
@@ -31236,7 +31351,7 @@ function checkFileNames() {
|
|
|
31236
31351
|
}
|
|
31237
31352
|
|
|
31238
31353
|
// src/commands/lint/lint/fixFileNameViolations.ts
|
|
31239
|
-
import
|
|
31354
|
+
import chalk205 from "chalk";
|
|
31240
31355
|
|
|
31241
31356
|
// src/commands/lint/lint/applyMoves.ts
|
|
31242
31357
|
import fs25 from "fs";
|
|
@@ -31321,25 +31436,25 @@ function fixFileNameViolations(moves) {
|
|
|
31321
31436
|
const start2 = performance.now();
|
|
31322
31437
|
const project = createLintProject();
|
|
31323
31438
|
const cwd = process.cwd();
|
|
31324
|
-
applyMoves(project, moves, cwd, (line) => console.log(
|
|
31439
|
+
applyMoves(project, moves, cwd, (line) => console.log(chalk205.green(line)));
|
|
31325
31440
|
const ms = (performance.now() - start2).toFixed(0);
|
|
31326
|
-
console.log(
|
|
31441
|
+
console.log(chalk205.dim(` Done in ${ms}ms`));
|
|
31327
31442
|
}
|
|
31328
31443
|
|
|
31329
31444
|
// src/commands/lint/lint/runFileNameCheck.ts
|
|
31330
31445
|
function reportViolations(violations) {
|
|
31331
|
-
console.error(
|
|
31446
|
+
console.error(chalk206.red("\nFile name check failed:\n"));
|
|
31332
31447
|
console.error(
|
|
31333
|
-
|
|
31448
|
+
chalk206.red(
|
|
31334
31449
|
" Files without classes or React components should not start with a capital letter.\n"
|
|
31335
31450
|
)
|
|
31336
31451
|
);
|
|
31337
31452
|
for (const violation of violations) {
|
|
31338
|
-
console.error(
|
|
31339
|
-
console.error(
|
|
31453
|
+
console.error(chalk206.red(` ${violation.filePath}`));
|
|
31454
|
+
console.error(chalk206.gray(` Rename to: ${violation.suggestedName}
|
|
31340
31455
|
`));
|
|
31341
31456
|
}
|
|
31342
|
-
console.error(
|
|
31457
|
+
console.error(chalk206.dim(" Run with -f to auto-fix.\n"));
|
|
31343
31458
|
}
|
|
31344
31459
|
function runFileNameCheck(fix = false) {
|
|
31345
31460
|
const violations = checkFileNames();
|
|
@@ -31368,17 +31483,17 @@ function runFileNameCheck(fix = false) {
|
|
|
31368
31483
|
import fs27 from "fs";
|
|
31369
31484
|
|
|
31370
31485
|
// src/commands/lint/shared.ts
|
|
31371
|
-
import
|
|
31486
|
+
import chalk207 from "chalk";
|
|
31372
31487
|
function reportViolations2(violations, checkName2, errorMessage2, successMessage) {
|
|
31373
31488
|
if (violations.length > 0) {
|
|
31374
|
-
console.error(
|
|
31489
|
+
console.error(chalk207.red(`
|
|
31375
31490
|
${checkName2} failed:
|
|
31376
31491
|
`));
|
|
31377
|
-
console.error(
|
|
31492
|
+
console.error(chalk207.red(` ${errorMessage2}
|
|
31378
31493
|
`));
|
|
31379
31494
|
for (const violation of violations) {
|
|
31380
|
-
console.error(
|
|
31381
|
-
console.error(
|
|
31495
|
+
console.error(chalk207.red(` ${violation.filePath}:${violation.line}`));
|
|
31496
|
+
console.error(chalk207.gray(` ${violation.content}
|
|
31382
31497
|
`));
|
|
31383
31498
|
}
|
|
31384
31499
|
return false;
|
|
@@ -31509,7 +31624,7 @@ import { execSync as execSync52 } from "child_process";
|
|
|
31509
31624
|
import { existsSync as existsSync64, mkdirSync as mkdirSync22, unlinkSync as unlinkSync17, writeFileSync as writeFileSync39 } from "fs";
|
|
31510
31625
|
import { tmpdir as tmpdir8 } from "os";
|
|
31511
31626
|
import { join as join80, resolve as resolve22 } from "path";
|
|
31512
|
-
import
|
|
31627
|
+
import chalk208 from "chalk";
|
|
31513
31628
|
|
|
31514
31629
|
// src/commands/screenshot/captureWindowPs1.ts
|
|
31515
31630
|
var captureWindowPs1 = `
|
|
@@ -31660,19 +31775,19 @@ function screenshot(processName) {
|
|
|
31660
31775
|
const config = loadConfig();
|
|
31661
31776
|
const outputDir = resolve22(config.screenshot.outputDir);
|
|
31662
31777
|
const outputPath = buildOutputPath(outputDir, processName);
|
|
31663
|
-
console.log(
|
|
31778
|
+
console.log(chalk208.gray(`Capturing window for process "${processName}" ...`));
|
|
31664
31779
|
try {
|
|
31665
31780
|
runPowerShellScript(processName, outputPath);
|
|
31666
|
-
console.log(
|
|
31781
|
+
console.log(chalk208.green(`Screenshot saved: ${outputPath}`));
|
|
31667
31782
|
} catch (error) {
|
|
31668
31783
|
const msg = error instanceof Error ? error.message : String(error);
|
|
31669
|
-
console.error(
|
|
31784
|
+
console.error(chalk208.red(`Failed to capture screenshot: ${msg}`));
|
|
31670
31785
|
process.exit(1);
|
|
31671
31786
|
}
|
|
31672
31787
|
}
|
|
31673
31788
|
|
|
31674
31789
|
// src/commands/statusLine.ts
|
|
31675
|
-
import
|
|
31790
|
+
import chalk210 from "chalk";
|
|
31676
31791
|
|
|
31677
31792
|
// src/shared/contextLevel.ts
|
|
31678
31793
|
var THRESHOLDS = {
|
|
@@ -31688,7 +31803,7 @@ function contextLevel(pct, harness) {
|
|
|
31688
31803
|
}
|
|
31689
31804
|
|
|
31690
31805
|
// src/commands/buildLimitsSegment.ts
|
|
31691
|
-
import
|
|
31806
|
+
import chalk209 from "chalk";
|
|
31692
31807
|
|
|
31693
31808
|
// src/shared/rateLimitLevel.ts
|
|
31694
31809
|
var FIVE_HOUR_SECONDS = 5 * 3600;
|
|
@@ -31726,9 +31841,9 @@ function rateLimitLevel(pct, resetsAt, windowSeconds, now) {
|
|
|
31726
31841
|
|
|
31727
31842
|
// src/commands/buildLimitsSegment.ts
|
|
31728
31843
|
var LEVEL_COLOR = {
|
|
31729
|
-
ok:
|
|
31730
|
-
warn:
|
|
31731
|
-
over:
|
|
31844
|
+
ok: chalk209.green,
|
|
31845
|
+
warn: chalk209.yellow,
|
|
31846
|
+
over: chalk209.red
|
|
31732
31847
|
};
|
|
31733
31848
|
function formatLimit(pct, resetsAt, windowSeconds, fallbackLabel, now) {
|
|
31734
31849
|
const level = rateLimitLevel(pct, resetsAt, windowSeconds, now);
|
|
@@ -31824,7 +31939,7 @@ async function relayUsage(claudeSessionId, transcriptPath2, usedPct) {
|
|
|
31824
31939
|
}
|
|
31825
31940
|
|
|
31826
31941
|
// src/commands/statusLine.ts
|
|
31827
|
-
|
|
31942
|
+
chalk210.level = 3;
|
|
31828
31943
|
function formatNumber(num) {
|
|
31829
31944
|
return num.toLocaleString("en-US");
|
|
31830
31945
|
}
|
|
@@ -31832,9 +31947,9 @@ function colorizePercent(pct) {
|
|
|
31832
31947
|
const label2 = `${Math.round(pct)}%`;
|
|
31833
31948
|
switch (contextLevel(pct)) {
|
|
31834
31949
|
case "red":
|
|
31835
|
-
return
|
|
31950
|
+
return chalk210.red(label2);
|
|
31836
31951
|
case "yellow":
|
|
31837
|
-
return
|
|
31952
|
+
return chalk210.yellow(label2);
|
|
31838
31953
|
default:
|
|
31839
31954
|
return label2;
|
|
31840
31955
|
}
|
|
@@ -31847,7 +31962,7 @@ async function statusLine() {
|
|
|
31847
31962
|
const usedPct = data.context_window.used_percentage ?? 0;
|
|
31848
31963
|
const dir = data.workspace?.current_dir ?? data.cwd;
|
|
31849
31964
|
const branch2 = dir ? readGitBranch(dir) : null;
|
|
31850
|
-
const branchSegment = branch2 ? `\u{1F33F}\uFE0F ${
|
|
31965
|
+
const branchSegment = branch2 ? `\u{1F33F}\uFE0F ${chalk210.cyan(branch2)} | ` : "";
|
|
31851
31966
|
console.log(
|
|
31852
31967
|
`${branchSegment}${model} | Tokens - ${formatNumber(totalIn)} \u2191 : ${formatNumber(totalOut)} \u2193 | Context - ${colorizePercent(usedPct)}${buildLimitsSegment(data.rate_limits)}`
|
|
31853
31968
|
);
|
|
@@ -31950,7 +32065,7 @@ import { spawn as spawn7 } from "child_process";
|
|
|
31950
32065
|
import * as path46 from "path";
|
|
31951
32066
|
|
|
31952
32067
|
// src/commands/refactor/logViolations.ts
|
|
31953
|
-
import
|
|
32068
|
+
import chalk211 from "chalk";
|
|
31954
32069
|
var DEFAULT_MAX_LINES2 = 100;
|
|
31955
32070
|
function logViolations(violations, maxLines = DEFAULT_MAX_LINES2) {
|
|
31956
32071
|
if (violations.length === 0) {
|
|
@@ -31959,43 +32074,43 @@ function logViolations(violations, maxLines = DEFAULT_MAX_LINES2) {
|
|
|
31959
32074
|
}
|
|
31960
32075
|
return;
|
|
31961
32076
|
}
|
|
31962
|
-
console.error(
|
|
32077
|
+
console.error(chalk211.red(`
|
|
31963
32078
|
Refactor check failed:
|
|
31964
32079
|
`));
|
|
31965
|
-
console.error(
|
|
32080
|
+
console.error(chalk211.red(` The following files exceed ${maxLines} lines:
|
|
31966
32081
|
`));
|
|
31967
32082
|
for (const violation of violations) {
|
|
31968
|
-
console.error(
|
|
32083
|
+
console.error(chalk211.red(` ${violation.file} (${violation.lines} lines)`));
|
|
31969
32084
|
}
|
|
31970
32085
|
console.error(
|
|
31971
|
-
|
|
32086
|
+
chalk211.yellow(
|
|
31972
32087
|
`
|
|
31973
32088
|
Each file needs to be sensibly refactored, or if there is no sensible
|
|
31974
32089
|
way to refactor it, ignore it with:
|
|
31975
32090
|
`
|
|
31976
32091
|
)
|
|
31977
32092
|
);
|
|
31978
|
-
console.error(
|
|
32093
|
+
console.error(chalk211.gray(` assist refactor ignore <file>
|
|
31979
32094
|
`));
|
|
31980
32095
|
if (process.env.CLAUDECODE) {
|
|
31981
|
-
console.error(
|
|
32096
|
+
console.error(chalk211.cyan(`
|
|
31982
32097
|
## Extracting Code to New Files
|
|
31983
32098
|
`));
|
|
31984
32099
|
console.error(
|
|
31985
|
-
|
|
32100
|
+
chalk211.cyan(
|
|
31986
32101
|
` When extracting logic from one file to another, consider where the extracted code belongs:
|
|
31987
32102
|
`
|
|
31988
32103
|
)
|
|
31989
32104
|
);
|
|
31990
32105
|
console.error(
|
|
31991
|
-
|
|
32106
|
+
chalk211.cyan(
|
|
31992
32107
|
` 1. Keep related logic together: If the extracted code is tightly coupled to the
|
|
31993
32108
|
original file's domain, create a new folder containing both the original and extracted files.
|
|
31994
32109
|
`
|
|
31995
32110
|
)
|
|
31996
32111
|
);
|
|
31997
32112
|
console.error(
|
|
31998
|
-
|
|
32113
|
+
chalk211.cyan(
|
|
31999
32114
|
` 2. Share common utilities: If the extracted code can be reused across multiple
|
|
32000
32115
|
domains, move it to a common/shared folder.
|
|
32001
32116
|
`
|
|
@@ -32151,7 +32266,7 @@ async function check(pattern2, options2) {
|
|
|
32151
32266
|
|
|
32152
32267
|
// src/commands/refactor/extract.ts
|
|
32153
32268
|
import path54 from "path";
|
|
32154
|
-
import
|
|
32269
|
+
import chalk214 from "chalk";
|
|
32155
32270
|
|
|
32156
32271
|
// src/commands/refactor/extract/applyExtraction.ts
|
|
32157
32272
|
import { SyntaxKind as SyntaxKind4 } from "ts-morph";
|
|
@@ -32759,23 +32874,23 @@ function buildPlan2(functionName, sourceFile, sourcePath, destPath, project) {
|
|
|
32759
32874
|
|
|
32760
32875
|
// src/commands/refactor/extract/displayPlan.ts
|
|
32761
32876
|
import path50 from "path";
|
|
32762
|
-
import
|
|
32877
|
+
import chalk212 from "chalk";
|
|
32763
32878
|
function section(title) {
|
|
32764
32879
|
return `
|
|
32765
|
-
${
|
|
32880
|
+
${chalk212.cyan(title)}`;
|
|
32766
32881
|
}
|
|
32767
32882
|
function displayImporters(plan2, cwd) {
|
|
32768
32883
|
if (plan2.importersToUpdate.length === 0) return;
|
|
32769
32884
|
console.log(section("Update importers:"));
|
|
32770
32885
|
for (const imp of plan2.importersToUpdate) {
|
|
32771
32886
|
const rel = path50.relative(cwd, imp.file.getFilePath());
|
|
32772
|
-
console.log(` ${
|
|
32887
|
+
console.log(` ${chalk212.dim(rel)}: \u2192 import from "${imp.relPath}"`);
|
|
32773
32888
|
}
|
|
32774
32889
|
}
|
|
32775
32890
|
function displayPlan(functionName, relDest, plan2, cwd) {
|
|
32776
|
-
console.log(
|
|
32891
|
+
console.log(chalk212.bold(`Extract: ${functionName} \u2192 ${relDest}
|
|
32777
32892
|
`));
|
|
32778
|
-
console.log(` ${
|
|
32893
|
+
console.log(` ${chalk212.cyan("Functions to move:")}`);
|
|
32779
32894
|
for (const name of plan2.extractedNames) {
|
|
32780
32895
|
console.log(` ${name}`);
|
|
32781
32896
|
}
|
|
@@ -32809,7 +32924,7 @@ function displayPlan(functionName, relDest, plan2, cwd) {
|
|
|
32809
32924
|
|
|
32810
32925
|
// src/commands/refactor/extract/loadProjectFile.ts
|
|
32811
32926
|
import path53 from "path";
|
|
32812
|
-
import
|
|
32927
|
+
import chalk213 from "chalk";
|
|
32813
32928
|
import { Project as Project3 } from "ts-morph";
|
|
32814
32929
|
|
|
32815
32930
|
// src/commands/refactor/extract/findTsConfig.ts
|
|
@@ -32901,7 +33016,7 @@ function loadProjectFile(file) {
|
|
|
32901
33016
|
});
|
|
32902
33017
|
const sourceFile = project.getSourceFile(sourcePath);
|
|
32903
33018
|
if (!sourceFile) {
|
|
32904
|
-
console.log(
|
|
33019
|
+
console.log(chalk213.red(`File not found in project: ${file}`));
|
|
32905
33020
|
process.exit(1);
|
|
32906
33021
|
}
|
|
32907
33022
|
return { project, sourceFile };
|
|
@@ -32924,19 +33039,19 @@ async function extract(file, functionName, destination, options2 = {}) {
|
|
|
32924
33039
|
displayPlan(functionName, relDest, plan2, cwd);
|
|
32925
33040
|
if (options2.apply) {
|
|
32926
33041
|
await applyExtraction(functionName, sourceFile, destPath, plan2, project);
|
|
32927
|
-
console.log(
|
|
33042
|
+
console.log(chalk214.green("\nExtraction complete"));
|
|
32928
33043
|
} else {
|
|
32929
|
-
console.log(
|
|
33044
|
+
console.log(chalk214.dim("\nDry run. Use --apply to execute."));
|
|
32930
33045
|
}
|
|
32931
33046
|
}
|
|
32932
33047
|
|
|
32933
33048
|
// src/commands/refactor/ignore.ts
|
|
32934
33049
|
import fs33 from "fs";
|
|
32935
|
-
import
|
|
33050
|
+
import chalk215 from "chalk";
|
|
32936
33051
|
var REFACTOR_YML_PATH2 = "refactor.yml";
|
|
32937
33052
|
function ignore2(file) {
|
|
32938
33053
|
if (!fs33.existsSync(file)) {
|
|
32939
|
-
console.error(
|
|
33054
|
+
console.error(chalk215.red(`Error: File does not exist: ${file}`));
|
|
32940
33055
|
process.exit(1);
|
|
32941
33056
|
}
|
|
32942
33057
|
const content = fs33.readFileSync(file, "utf8");
|
|
@@ -32952,7 +33067,7 @@ function ignore2(file) {
|
|
|
32952
33067
|
fs33.writeFileSync(REFACTOR_YML_PATH2, entry);
|
|
32953
33068
|
}
|
|
32954
33069
|
console.log(
|
|
32955
|
-
|
|
33070
|
+
chalk215.green(
|
|
32956
33071
|
`Added ${file} to refactor ignore list (max ${maxLines} lines)`
|
|
32957
33072
|
)
|
|
32958
33073
|
);
|
|
@@ -32961,12 +33076,12 @@ function ignore2(file) {
|
|
|
32961
33076
|
// src/commands/refactor/rename.ts
|
|
32962
33077
|
import fs36 from "fs";
|
|
32963
33078
|
import path60 from "path";
|
|
32964
|
-
import
|
|
33079
|
+
import chalk218 from "chalk";
|
|
32965
33080
|
|
|
32966
33081
|
// src/commands/refactor/rename/applyRename.ts
|
|
32967
33082
|
import fs35 from "fs";
|
|
32968
33083
|
import path56 from "path";
|
|
32969
|
-
import
|
|
33084
|
+
import chalk216 from "chalk";
|
|
32970
33085
|
|
|
32971
33086
|
// src/commands/refactor/restructure/computeRewrites.ts
|
|
32972
33087
|
import path55 from "path";
|
|
@@ -33072,13 +33187,13 @@ function applyRename(rewrites, sourcePath, destPath, cwd) {
|
|
|
33072
33187
|
const updatedContents = applyRewrites(rewrites);
|
|
33073
33188
|
for (const [file, content] of updatedContents) {
|
|
33074
33189
|
fs35.writeFileSync(file, content, "utf8");
|
|
33075
|
-
console.log(
|
|
33190
|
+
console.log(chalk216.cyan(` Updated imports in ${path56.relative(cwd, file)}`));
|
|
33076
33191
|
}
|
|
33077
33192
|
const destDir = path56.dirname(destPath);
|
|
33078
33193
|
if (!fs35.existsSync(destDir)) fs35.mkdirSync(destDir, { recursive: true });
|
|
33079
33194
|
fs35.renameSync(sourcePath, destPath);
|
|
33080
33195
|
console.log(
|
|
33081
|
-
|
|
33196
|
+
chalk216.white(
|
|
33082
33197
|
` Moved ${path56.relative(cwd, sourcePath)} \u2192 ${path56.relative(cwd, destPath)}`
|
|
33083
33198
|
)
|
|
33084
33199
|
);
|
|
@@ -33228,16 +33343,16 @@ function computeRenameRewrites(sourcePath, destPath) {
|
|
|
33228
33343
|
|
|
33229
33344
|
// src/commands/refactor/rename/printRenamePreview.ts
|
|
33230
33345
|
import path59 from "path";
|
|
33231
|
-
import
|
|
33346
|
+
import chalk217 from "chalk";
|
|
33232
33347
|
function printRenamePreview(rewrites, cwd) {
|
|
33233
33348
|
for (const rewrite of rewrites) {
|
|
33234
33349
|
console.log(
|
|
33235
|
-
|
|
33350
|
+
chalk217.dim(
|
|
33236
33351
|
` ${path59.relative(cwd, rewrite.file)}: ${rewrite.oldSpecifier} \u2192 ${rewrite.newSpecifier}`
|
|
33237
33352
|
)
|
|
33238
33353
|
);
|
|
33239
33354
|
}
|
|
33240
|
-
console.log(
|
|
33355
|
+
console.log(chalk217.dim("Dry run. Use --apply to execute."));
|
|
33241
33356
|
}
|
|
33242
33357
|
|
|
33243
33358
|
// src/commands/refactor/rename.ts
|
|
@@ -33248,20 +33363,20 @@ async function rename(source, destination, options2 = {}) {
|
|
|
33248
33363
|
const relSource = path60.relative(cwd, sourcePath);
|
|
33249
33364
|
const relDest = path60.relative(cwd, destPath);
|
|
33250
33365
|
if (!fs36.existsSync(sourcePath)) {
|
|
33251
|
-
console.log(
|
|
33366
|
+
console.log(chalk218.red(`File not found: ${source}`));
|
|
33252
33367
|
process.exit(1);
|
|
33253
33368
|
}
|
|
33254
33369
|
if (destPath !== sourcePath && fs36.existsSync(destPath)) {
|
|
33255
|
-
console.log(
|
|
33370
|
+
console.log(chalk218.red(`Destination already exists: ${destination}`));
|
|
33256
33371
|
process.exit(1);
|
|
33257
33372
|
}
|
|
33258
|
-
console.log(
|
|
33259
|
-
console.log(
|
|
33260
|
-
console.log(
|
|
33373
|
+
console.log(chalk218.bold(`Rename: ${relSource} \u2192 ${relDest}`));
|
|
33374
|
+
console.log(chalk218.dim("Loading project..."));
|
|
33375
|
+
console.log(chalk218.dim("Scanning imports across the project..."));
|
|
33261
33376
|
const rewrites = computeRenameRewrites(sourcePath, destPath);
|
|
33262
33377
|
const affectedFiles = new Set(rewrites.map((r) => r.file)).size;
|
|
33263
33378
|
console.log(
|
|
33264
|
-
|
|
33379
|
+
chalk218.dim(
|
|
33265
33380
|
`${rewrites.length} import path(s) to update across ${affectedFiles} file(s)`
|
|
33266
33381
|
)
|
|
33267
33382
|
);
|
|
@@ -33270,11 +33385,11 @@ async function rename(source, destination, options2 = {}) {
|
|
|
33270
33385
|
return;
|
|
33271
33386
|
}
|
|
33272
33387
|
applyRename(rewrites, sourcePath, destPath, cwd);
|
|
33273
|
-
console.log(
|
|
33388
|
+
console.log(chalk218.green("Done"));
|
|
33274
33389
|
}
|
|
33275
33390
|
|
|
33276
33391
|
// src/commands/refactor/renameSymbol.ts
|
|
33277
|
-
import
|
|
33392
|
+
import chalk219 from "chalk";
|
|
33278
33393
|
|
|
33279
33394
|
// src/commands/refactor/renameSymbol/findSymbol.ts
|
|
33280
33395
|
import { SyntaxKind as SyntaxKind15 } from "ts-morph";
|
|
@@ -33320,34 +33435,34 @@ async function renameSymbol(file, oldName, newName, options2 = {}) {
|
|
|
33320
33435
|
const { project, sourceFile } = loadProjectFile(file);
|
|
33321
33436
|
const symbol = findSymbol(sourceFile, oldName);
|
|
33322
33437
|
if (!symbol) {
|
|
33323
|
-
console.log(
|
|
33438
|
+
console.log(chalk219.red(`Symbol "${oldName}" not found in ${file}`));
|
|
33324
33439
|
process.exit(1);
|
|
33325
33440
|
}
|
|
33326
33441
|
const grouped = groupReferences(symbol, cwd);
|
|
33327
33442
|
const totalRefs = [...grouped.values()].reduce((s, l) => s + l.length, 0);
|
|
33328
33443
|
console.log(
|
|
33329
|
-
|
|
33444
|
+
chalk219.bold(`Rename: ${oldName} \u2192 ${newName} (${totalRefs} references)
|
|
33330
33445
|
`)
|
|
33331
33446
|
);
|
|
33332
33447
|
for (const [refFile, lines2] of grouped) {
|
|
33333
33448
|
console.log(
|
|
33334
|
-
` ${
|
|
33449
|
+
` ${chalk219.dim(refFile)}: lines ${chalk219.cyan(lines2.join(", "))}`
|
|
33335
33450
|
);
|
|
33336
33451
|
}
|
|
33337
33452
|
if (options2.apply) {
|
|
33338
33453
|
symbol.rename(newName);
|
|
33339
33454
|
await project.save();
|
|
33340
|
-
console.log(
|
|
33455
|
+
console.log(chalk219.green(`
|
|
33341
33456
|
Renamed ${oldName} \u2192 ${newName}`));
|
|
33342
33457
|
} else {
|
|
33343
|
-
console.log(
|
|
33458
|
+
console.log(chalk219.dim("\nDry run. Use --apply to execute."));
|
|
33344
33459
|
}
|
|
33345
33460
|
}
|
|
33346
33461
|
|
|
33347
33462
|
// src/commands/refactor/restructure.ts
|
|
33348
33463
|
import fs38 from "fs";
|
|
33349
33464
|
import path80 from "path";
|
|
33350
|
-
import
|
|
33465
|
+
import chalk228 from "chalk";
|
|
33351
33466
|
|
|
33352
33467
|
// src/commands/refactor/restructure/buildPlan.ts
|
|
33353
33468
|
import path71 from "path";
|
|
@@ -33684,7 +33799,7 @@ function buildPlan3(scopeRoot, files, ignored = [], pinnedModules = []) {
|
|
|
33684
33799
|
}
|
|
33685
33800
|
|
|
33686
33801
|
// src/commands/refactor/restructure/checkPlan.ts
|
|
33687
|
-
import
|
|
33802
|
+
import chalk223 from "chalk";
|
|
33688
33803
|
|
|
33689
33804
|
// src/commands/refactor/restructure/applyCommand.ts
|
|
33690
33805
|
import path72 from "path";
|
|
@@ -33695,13 +33810,13 @@ function applyCommand(scopeRoot) {
|
|
|
33695
33810
|
|
|
33696
33811
|
// src/commands/refactor/restructure/displayDrift.ts
|
|
33697
33812
|
import path73 from "path";
|
|
33698
|
-
import
|
|
33813
|
+
import chalk220 from "chalk";
|
|
33699
33814
|
var shownMoves = 20;
|
|
33700
33815
|
function displayDrift(plan2, listMoves) {
|
|
33701
33816
|
const rel = (file) => path73.relative(process.cwd(), file);
|
|
33702
33817
|
if (plan2.moves.length > 0) {
|
|
33703
33818
|
console.log(
|
|
33704
|
-
|
|
33819
|
+
chalk220.red(
|
|
33705
33820
|
`${plan2.moves.length} file(s) drift from the plan${listMoves ? ":" : "."}`
|
|
33706
33821
|
)
|
|
33707
33822
|
);
|
|
@@ -33709,17 +33824,17 @@ function displayDrift(plan2, listMoves) {
|
|
|
33709
33824
|
for (const move2 of plan2.moves.slice(0, shownMoves))
|
|
33710
33825
|
console.log(` ${rel(move2.from)} \u2192 ${rel(move2.to)}`);
|
|
33711
33826
|
if (plan2.moves.length > shownMoves)
|
|
33712
|
-
console.log(
|
|
33827
|
+
console.log(chalk220.dim(` \u2026and ${plan2.moves.length - shownMoves} more`));
|
|
33713
33828
|
}
|
|
33714
33829
|
}
|
|
33715
|
-
for (const error of plan2.errors) console.log(
|
|
33830
|
+
for (const error of plan2.errors) console.log(chalk220.red(error));
|
|
33716
33831
|
}
|
|
33717
33832
|
|
|
33718
33833
|
// src/commands/refactor/restructure/displayLayoutLimits.ts
|
|
33719
|
-
import
|
|
33834
|
+
import chalk222 from "chalk";
|
|
33720
33835
|
|
|
33721
33836
|
// src/commands/refactor/restructure/displayDeepChains.ts
|
|
33722
|
-
import
|
|
33837
|
+
import chalk221 from "chalk";
|
|
33723
33838
|
var shownChains = 10;
|
|
33724
33839
|
function formatChain(chain2) {
|
|
33725
33840
|
const folders = chain2.folders.map((f) => `${f.name} (${f.files})`).join(" > ");
|
|
@@ -33729,20 +33844,20 @@ function displayDeepChains(chains, maxDepth) {
|
|
|
33729
33844
|
if (chains.length === 0) return;
|
|
33730
33845
|
const tooDeep = chains.reduce((sum3, c) => sum3 + c.tooDeep, 0);
|
|
33731
33846
|
console.log(
|
|
33732
|
-
|
|
33847
|
+
chalk221.red(
|
|
33733
33848
|
`
|
|
33734
33849
|
Plan exceeds restructure.maxDepth ${maxDepth}: ${tooDeep} file(s) deeper.`
|
|
33735
33850
|
)
|
|
33736
33851
|
);
|
|
33737
33852
|
console.log(
|
|
33738
|
-
|
|
33853
|
+
chalk221.bold(
|
|
33739
33854
|
"Deep chains, as folder (files beneath), most files too deep first:"
|
|
33740
33855
|
)
|
|
33741
33856
|
);
|
|
33742
33857
|
for (const chain2 of chains.slice(0, shownChains))
|
|
33743
33858
|
console.log(formatChain(chain2));
|
|
33744
33859
|
if (chains.length > shownChains)
|
|
33745
|
-
console.log(
|
|
33860
|
+
console.log(chalk221.dim(` \u2026and ${chains.length - shownChains} more`));
|
|
33746
33861
|
}
|
|
33747
33862
|
|
|
33748
33863
|
// src/commands/refactor/restructure/displayLayoutLimits.ts
|
|
@@ -33763,7 +33878,7 @@ function displayLayoutLimits(limits, apply) {
|
|
|
33763
33878
|
if (!exceedsLayoutLimits(limits)) return;
|
|
33764
33879
|
displayDeepChains(limits.chains, limits.maxDepth);
|
|
33765
33880
|
console.log("");
|
|
33766
|
-
for (const line of pinSteps(apply)) console.log(
|
|
33881
|
+
for (const line of pinSteps(apply)) console.log(chalk222.yellow(line));
|
|
33767
33882
|
}
|
|
33768
33883
|
|
|
33769
33884
|
// src/commands/refactor/restructure/checkPlan.ts
|
|
@@ -33775,14 +33890,14 @@ function checkPlan(plan2, limits) {
|
|
|
33775
33890
|
if (exceeds || plan2.errors.length > 0) process.exit(1);
|
|
33776
33891
|
if (plan2.moves.length > 0) {
|
|
33777
33892
|
console.log(
|
|
33778
|
-
|
|
33893
|
+
chalk223.yellow(
|
|
33779
33894
|
`
|
|
33780
33895
|
Run \`${apply}\` to move the files and rewrite their imports.`
|
|
33781
33896
|
)
|
|
33782
33897
|
);
|
|
33783
33898
|
process.exit(1);
|
|
33784
33899
|
}
|
|
33785
|
-
console.log(
|
|
33900
|
+
console.log(chalk223.green("Layout matches the restructure plan"));
|
|
33786
33901
|
}
|
|
33787
33902
|
|
|
33788
33903
|
// src/commands/refactor/restructure/findDeepChains.ts
|
|
@@ -33844,15 +33959,15 @@ function partitionIgnored(files) {
|
|
|
33844
33959
|
}
|
|
33845
33960
|
|
|
33846
33961
|
// src/commands/refactor/restructure/runPlan.ts
|
|
33847
|
-
import
|
|
33962
|
+
import chalk227 from "chalk";
|
|
33848
33963
|
|
|
33849
33964
|
// src/commands/refactor/restructure/applyPlan.ts
|
|
33850
|
-
import
|
|
33965
|
+
import chalk225 from "chalk";
|
|
33851
33966
|
|
|
33852
33967
|
// src/commands/refactor/restructure/executePlan.ts
|
|
33853
33968
|
import fs37 from "fs";
|
|
33854
33969
|
import path76 from "path";
|
|
33855
|
-
import
|
|
33970
|
+
import chalk224 from "chalk";
|
|
33856
33971
|
function relPath(file) {
|
|
33857
33972
|
return path76.relative(process.cwd(), file);
|
|
33858
33973
|
}
|
|
@@ -33869,14 +33984,14 @@ function moveFiles(moves) {
|
|
|
33869
33984
|
fs37.mkdirSync(path76.dirname(move2.to), { recursive: true });
|
|
33870
33985
|
fs37.renameSync(staging, move2.to);
|
|
33871
33986
|
console.log(
|
|
33872
|
-
|
|
33987
|
+
chalk224.white(` Moved ${relPath(move2.from)} \u2192 ${relPath(move2.to)}`)
|
|
33873
33988
|
);
|
|
33874
33989
|
}
|
|
33875
33990
|
}
|
|
33876
33991
|
function removeIfEmpty(dir) {
|
|
33877
33992
|
if (!fs37.existsSync(dir) || fs37.readdirSync(dir).length > 0) return false;
|
|
33878
33993
|
fs37.rmdirSync(dir);
|
|
33879
|
-
console.log(
|
|
33994
|
+
console.log(chalk224.dim(` Removed empty directory ${relPath(dir)}`));
|
|
33880
33995
|
return true;
|
|
33881
33996
|
}
|
|
33882
33997
|
function removeEmptyDirectories(dirs, scopeRoot) {
|
|
@@ -33889,7 +34004,7 @@ function removeEmptyDirectories(dirs, scopeRoot) {
|
|
|
33889
34004
|
function executePlan(plan2) {
|
|
33890
34005
|
for (const [file, content] of applyRewrites(plan2.rewrites)) {
|
|
33891
34006
|
fs37.writeFileSync(file, content, "utf8");
|
|
33892
|
-
console.log(
|
|
34007
|
+
console.log(chalk224.cyan(` Rewrote imports in ${relPath(file)}`));
|
|
33893
34008
|
}
|
|
33894
34009
|
moveFiles(plan2.moves);
|
|
33895
34010
|
removeEmptyDirectories(
|
|
@@ -33901,17 +34016,17 @@ function executePlan(plan2) {
|
|
|
33901
34016
|
// src/commands/refactor/restructure/applyPlan.ts
|
|
33902
34017
|
function applyPlan(plan2) {
|
|
33903
34018
|
if (plan2.errors.length > 0) {
|
|
33904
|
-
console.log(
|
|
34019
|
+
console.log(chalk225.red("\nResolve the errors above before applying."));
|
|
33905
34020
|
process.exit(1);
|
|
33906
34021
|
}
|
|
33907
|
-
console.log(
|
|
34022
|
+
console.log(chalk225.bold("\nApplying changes..."));
|
|
33908
34023
|
executePlan(plan2);
|
|
33909
|
-
console.log(
|
|
34024
|
+
console.log(chalk225.green("\nRestructuring complete"));
|
|
33910
34025
|
}
|
|
33911
34026
|
|
|
33912
34027
|
// src/commands/refactor/restructure/displayPlan.ts
|
|
33913
34028
|
import path79 from "path";
|
|
33914
|
-
import
|
|
34029
|
+
import chalk226 from "chalk";
|
|
33915
34030
|
|
|
33916
34031
|
// src/commands/refactor/restructure/computeDepthStats.ts
|
|
33917
34032
|
import path77 from "path";
|
|
@@ -33962,17 +34077,17 @@ function relPath2(filePath) {
|
|
|
33962
34077
|
}
|
|
33963
34078
|
function displayMoves(plan2) {
|
|
33964
34079
|
if (plan2.moves.length === 0) return;
|
|
33965
|
-
console.log(
|
|
34080
|
+
console.log(chalk226.bold("\nFile moves:"));
|
|
33966
34081
|
for (const move2 of plan2.moves) {
|
|
33967
34082
|
console.log(
|
|
33968
|
-
` ${
|
|
34083
|
+
` ${chalk226.red(relPath2(move2.from))} \u2192 ${chalk226.green(relPath2(move2.to))}`
|
|
33969
34084
|
);
|
|
33970
|
-
console.log(
|
|
34085
|
+
console.log(chalk226.dim(` ${move2.reason}`));
|
|
33971
34086
|
}
|
|
33972
34087
|
}
|
|
33973
34088
|
function displayTree(plan2) {
|
|
33974
34089
|
console.log(
|
|
33975
|
-
|
|
34090
|
+
chalk226.bold(`
|
|
33976
34091
|
Resulting tree (${relPath2(plan2.scopeRoot) || "."}/):`)
|
|
33977
34092
|
);
|
|
33978
34093
|
for (const line of formatTree(plan2.targets.values(), plan2.scopeRoot))
|
|
@@ -33983,15 +34098,15 @@ function displayDepthStats(plan2) {
|
|
|
33983
34098
|
plan2.targets.values(),
|
|
33984
34099
|
plan2.scopeRoot
|
|
33985
34100
|
);
|
|
33986
|
-
console.log(
|
|
34101
|
+
console.log(chalk226.bold(`
|
|
33987
34102
|
Depth (max ${max}):`));
|
|
33988
34103
|
for (const depth of [...distribution.keys()].sort((a, b) => a - b))
|
|
33989
34104
|
console.log(` ${depth}: ${distribution.get(depth)} file(s)`);
|
|
33990
34105
|
}
|
|
33991
34106
|
function displayErrors(errors) {
|
|
33992
34107
|
if (errors.length === 0) return;
|
|
33993
|
-
console.log(
|
|
33994
|
-
for (const error of errors) console.log(
|
|
34108
|
+
console.log(chalk226.red("\nErrors:"));
|
|
34109
|
+
for (const error of errors) console.log(chalk226.red(` ${error}`));
|
|
33995
34110
|
}
|
|
33996
34111
|
function displayPlan2(plan2) {
|
|
33997
34112
|
displayMoves(plan2);
|
|
@@ -34000,7 +34115,7 @@ function displayPlan2(plan2) {
|
|
|
34000
34115
|
displayErrors(plan2.errors);
|
|
34001
34116
|
const rewrittenFiles = new Set(plan2.rewrites.map((r) => r.file)).size;
|
|
34002
34117
|
console.log(
|
|
34003
|
-
|
|
34118
|
+
chalk226.dim(
|
|
34004
34119
|
`
|
|
34005
34120
|
Summary: ${plan2.moves.length} file(s) moved, ${plan2.rewrites.length} imports rewritten across ${rewrittenFiles} file(s), ${plan2.errors.length} error(s)`
|
|
34006
34121
|
)
|
|
@@ -34012,11 +34127,11 @@ function runPlan(plan2, limits, apply) {
|
|
|
34012
34127
|
displayPlan2(plan2);
|
|
34013
34128
|
displayLayoutLimits(limits, applyCommand(plan2.scopeRoot));
|
|
34014
34129
|
if (plan2.moves.length === 0 && plan2.errors.length === 0) {
|
|
34015
|
-
console.log(
|
|
34130
|
+
console.log(chalk227.green("No restructuring needed"));
|
|
34016
34131
|
return;
|
|
34017
34132
|
}
|
|
34018
34133
|
if (!apply) {
|
|
34019
|
-
console.log(
|
|
34134
|
+
console.log(chalk227.dim("\nDry run. Use --apply to execute."));
|
|
34020
34135
|
return;
|
|
34021
34136
|
}
|
|
34022
34137
|
applyPlan(plan2);
|
|
@@ -34026,14 +34141,14 @@ function runPlan(plan2, limits, apply) {
|
|
|
34026
34141
|
async function restructure(root2, options2 = {}) {
|
|
34027
34142
|
const scopeRoot = path80.resolve(root2 ?? "src");
|
|
34028
34143
|
if (!fs38.existsSync(scopeRoot) || !fs38.statSync(scopeRoot).isDirectory()) {
|
|
34029
|
-
console.log(
|
|
34144
|
+
console.log(chalk228.red(`Not a directory: ${root2 ?? "src"}`));
|
|
34030
34145
|
process.exit(1);
|
|
34031
34146
|
}
|
|
34032
34147
|
const found = [];
|
|
34033
34148
|
walkSourceFiles(scopeRoot, found);
|
|
34034
34149
|
const { scoped, ignored } = partitionIgnored(found);
|
|
34035
34150
|
if (scoped.length === 0) {
|
|
34036
|
-
console.log(
|
|
34151
|
+
console.log(chalk228.yellow("No files found under root"));
|
|
34037
34152
|
return;
|
|
34038
34153
|
}
|
|
34039
34154
|
const { pin: pin2 = [], maxDepth = 10 } = loadConfig().restructure ?? {};
|
|
@@ -34095,7 +34210,7 @@ async function checkoutOnlySession(number) {
|
|
|
34095
34210
|
}
|
|
34096
34211
|
|
|
34097
34212
|
// src/commands/review/highLevel/configureHighLevelReview.ts
|
|
34098
|
-
import
|
|
34213
|
+
import chalk232 from "chalk";
|
|
34099
34214
|
|
|
34100
34215
|
// src/commands/config/promptConfigScope.ts
|
|
34101
34216
|
import Enquirer3 from "enquirer";
|
|
@@ -34121,7 +34236,7 @@ async function promptConfigScope() {
|
|
|
34121
34236
|
}
|
|
34122
34237
|
|
|
34123
34238
|
// src/commands/config/resolveConfigKeyAnswer.ts
|
|
34124
|
-
import
|
|
34239
|
+
import chalk229 from "chalk";
|
|
34125
34240
|
async function resolveConfigKeyAnswer(question, supplied) {
|
|
34126
34241
|
if (supplied !== void 0) return coerceSupplied(question.key, supplied);
|
|
34127
34242
|
for (; ; ) {
|
|
@@ -34129,7 +34244,7 @@ async function resolveConfigKeyAnswer(question, supplied) {
|
|
|
34129
34244
|
if (answer === "") return void 0;
|
|
34130
34245
|
const coercion = coerceCliConfigValue(question.key, answer);
|
|
34131
34246
|
if (coercion.ok) return coercion.value;
|
|
34132
|
-
console.error(
|
|
34247
|
+
console.error(chalk229.red(coercion.error));
|
|
34133
34248
|
}
|
|
34134
34249
|
}
|
|
34135
34250
|
function coerceSupplied(key, supplied) {
|
|
@@ -34190,7 +34305,7 @@ function suggestGlobs(current, proposed) {
|
|
|
34190
34305
|
}
|
|
34191
34306
|
|
|
34192
34307
|
// src/commands/review/highLevel/parseConfigureAnswers.ts
|
|
34193
|
-
import
|
|
34308
|
+
import chalk230 from "chalk";
|
|
34194
34309
|
function parseConfigureAnswers(answers) {
|
|
34195
34310
|
const known = Object.values(highLevelConfigKeys);
|
|
34196
34311
|
const parsed = {};
|
|
@@ -34208,13 +34323,13 @@ function answersCoverEveryKey(answers) {
|
|
|
34208
34323
|
return Object.values(highLevelConfigKeys).every((key) => key in answers);
|
|
34209
34324
|
}
|
|
34210
34325
|
function exitWith(message3) {
|
|
34211
|
-
console.error(
|
|
34326
|
+
console.error(chalk230.red(`Error: ${message3}.`));
|
|
34212
34327
|
process.exit(1);
|
|
34213
34328
|
}
|
|
34214
34329
|
|
|
34215
34330
|
// src/commands/review/highLevel/proposeHighLevelGlobs.ts
|
|
34216
34331
|
import { execFileSync as execFileSync20 } from "child_process";
|
|
34217
|
-
import
|
|
34332
|
+
import chalk231 from "chalk";
|
|
34218
34333
|
|
|
34219
34334
|
// src/commands/review/highLevel/buildGlobProposalPrompt.ts
|
|
34220
34335
|
function buildGlobProposalPrompt(tree) {
|
|
@@ -34307,12 +34422,12 @@ function proposeHighLevelGlobs(cwd = process.cwd()) {
|
|
|
34307
34422
|
const tree = summariseRepoTree(cwd);
|
|
34308
34423
|
if (tree === "") return NOTHING_PROPOSED;
|
|
34309
34424
|
console.log(
|
|
34310
|
-
|
|
34425
|
+
chalk231.dim("Asking Claude to propose globs from the repo's own tree...")
|
|
34311
34426
|
);
|
|
34312
34427
|
const output = askClaude(buildGlobProposalPrompt(tree), cwd);
|
|
34313
34428
|
if (output === void 0) {
|
|
34314
34429
|
console.log(
|
|
34315
|
-
|
|
34430
|
+
chalk231.yellow(
|
|
34316
34431
|
"Claude proposed nothing; answer each key from its current value."
|
|
34317
34432
|
)
|
|
34318
34433
|
);
|
|
@@ -34368,25 +34483,25 @@ function asConfigKeyScope(value) {
|
|
|
34368
34483
|
function reportConfigured(result) {
|
|
34369
34484
|
for (const write of result.written)
|
|
34370
34485
|
console.log(
|
|
34371
|
-
|
|
34486
|
+
chalk232.green(`Set ${write.key} = ${JSON.stringify(write.value)}`)
|
|
34372
34487
|
);
|
|
34373
|
-
for (const key of result.skipped) console.log(
|
|
34374
|
-
console.log(
|
|
34488
|
+
for (const key of result.skipped) console.log(chalk232.dim(`Left ${key} unset`));
|
|
34489
|
+
console.log(chalk232.dim(`Written to ${result.target}`));
|
|
34375
34490
|
}
|
|
34376
34491
|
|
|
34377
34492
|
// src/commands/review/highLevel/announceSavedReview.ts
|
|
34378
|
-
import
|
|
34493
|
+
import chalk233 from "chalk";
|
|
34379
34494
|
function announceSavedReview(subject, force) {
|
|
34380
34495
|
const head = subject.headSha.slice(0, 7);
|
|
34381
34496
|
if (subject.saved)
|
|
34382
34497
|
console.log(
|
|
34383
|
-
|
|
34498
|
+
chalk233.dim(
|
|
34384
34499
|
`Reopening the review saved for ${head} at ${subject.saved.reviewedAt} (${subject.saved.verdict}); pass --force to start fresh.`
|
|
34385
34500
|
)
|
|
34386
34501
|
);
|
|
34387
34502
|
else if (force)
|
|
34388
34503
|
console.log(
|
|
34389
|
-
|
|
34504
|
+
chalk233.dim(
|
|
34390
34505
|
`Discarding any review saved for ${head} and starting fresh (--force).`
|
|
34391
34506
|
)
|
|
34392
34507
|
);
|
|
@@ -34927,55 +35042,55 @@ async function openHighLevelOverlay(sessionId, subject) {
|
|
|
34927
35042
|
}
|
|
34928
35043
|
|
|
34929
35044
|
// src/commands/review/highLevel/printHighLevelChecklist.ts
|
|
34930
|
-
import
|
|
35045
|
+
import chalk237 from "chalk";
|
|
34931
35046
|
|
|
34932
35047
|
// src/commands/review/highLevel/formatCriticalDiffs.ts
|
|
34933
|
-
import
|
|
35048
|
+
import chalk234 from "chalk";
|
|
34934
35049
|
var PATCH_LINE_COLOURS = {
|
|
34935
|
-
"+":
|
|
34936
|
-
"-":
|
|
34937
|
-
"@":
|
|
35050
|
+
"+": chalk234.green,
|
|
35051
|
+
"-": chalk234.red,
|
|
35052
|
+
"@": chalk234.cyan
|
|
34938
35053
|
};
|
|
34939
35054
|
function formatPatch(patch2) {
|
|
34940
35055
|
return patch2.split("\n").map(
|
|
34941
|
-
(line) => ` ${(PATCH_LINE_COLOURS[line[0] ?? ""] ??
|
|
35056
|
+
(line) => ` ${(PATCH_LINE_COLOURS[line[0] ?? ""] ?? chalk234.dim)(line)}`
|
|
34942
35057
|
);
|
|
34943
35058
|
}
|
|
34944
35059
|
function formatDiff(diff3) {
|
|
34945
35060
|
return [
|
|
34946
35061
|
"",
|
|
34947
|
-
` ${
|
|
34948
|
-
...diff3.patch === null ? [` ${
|
|
35062
|
+
` ${chalk234.bold(diff3.path)} ${chalk234.dim(`(${diff3.status})`)} ${chalk234.green(`+${diff3.additions}`)} ${chalk234.red(`-${diff3.deletions}`)}`,
|
|
35063
|
+
...diff3.patch === null ? [` ${chalk234.dim(`no diff available; see ${diff3.diffUrl}`)}`] : formatPatch(diff3.patch)
|
|
34949
35064
|
];
|
|
34950
35065
|
}
|
|
34951
35066
|
function formatCriticalDiffs(diffs, criticalPaths) {
|
|
34952
35067
|
if (criticalPaths.length === 0)
|
|
34953
|
-
return `${
|
|
34954
|
-
${
|
|
35068
|
+
return `${chalk234.bold.underline("Critical diffs")}
|
|
35069
|
+
${chalk234.dim("review.highLevel.criticalPaths is unset, so no diffs are shown")}`;
|
|
34955
35070
|
if (diffs.length === 0)
|
|
34956
|
-
return `${
|
|
34957
|
-
${
|
|
35071
|
+
return `${chalk234.bold.underline("Critical diffs")}
|
|
35072
|
+
${chalk234.dim(`no changed file matches ${criticalPaths.join(", ")}`)}`;
|
|
34958
35073
|
return [
|
|
34959
|
-
|
|
35074
|
+
chalk234.bold.underline("Critical diffs"),
|
|
34960
35075
|
...diffs.flatMap(formatDiff)
|
|
34961
35076
|
].join("\n");
|
|
34962
35077
|
}
|
|
34963
35078
|
|
|
34964
35079
|
// src/commands/review/highLevel/formatHighLevelChecklist.ts
|
|
34965
|
-
import
|
|
35080
|
+
import chalk235 from "chalk";
|
|
34966
35081
|
var MARKERS = {
|
|
34967
|
-
pass: () =>
|
|
34968
|
-
fail: () =>
|
|
34969
|
-
manual: () =>
|
|
35082
|
+
pass: () => chalk235.green("\u2714"),
|
|
35083
|
+
fail: () => chalk235.red("\u2718"),
|
|
35084
|
+
manual: () => chalk235.yellow("\u25A1")
|
|
34970
35085
|
};
|
|
34971
35086
|
function formatCheck(check2) {
|
|
34972
|
-
const title = check2.status === "fail" ?
|
|
35087
|
+
const title = check2.status === "fail" ? chalk235.red(check2.title) : chalk235.bold(check2.title);
|
|
34973
35088
|
return ` ${MARKERS[check2.status]()} ${title}
|
|
34974
|
-
${
|
|
35089
|
+
${chalk235.dim(check2.reason)}`;
|
|
34975
35090
|
}
|
|
34976
35091
|
function formatGroup(heading2, checks2) {
|
|
34977
35092
|
if (checks2.length === 0) return [];
|
|
34978
|
-
return ["",
|
|
35093
|
+
return ["", chalk235.bold.underline(heading2), ...checks2.map(formatCheck)];
|
|
34979
35094
|
}
|
|
34980
35095
|
function formatHighLevelChecklist(checks2) {
|
|
34981
35096
|
const deterministic = checks2.filter(
|
|
@@ -34984,7 +35099,7 @@ function formatHighLevelChecklist(checks2) {
|
|
|
34984
35099
|
const failed3 = deterministic.filter(
|
|
34985
35100
|
(check2) => check2.status === "fail"
|
|
34986
35101
|
).length;
|
|
34987
|
-
const summary = failed3 === 0 ?
|
|
35102
|
+
const summary = failed3 === 0 ? chalk235.green(`All ${deterministic.length} deterministic checks pass`) : chalk235.red(
|
|
34988
35103
|
`${failed3} of ${deterministic.length} deterministic checks fail`
|
|
34989
35104
|
);
|
|
34990
35105
|
return [
|
|
@@ -34999,30 +35114,30 @@ function formatHighLevelChecklist(checks2) {
|
|
|
34999
35114
|
}
|
|
35000
35115
|
|
|
35001
35116
|
// src/commands/review/highLevel/formatHighLevelStructure.ts
|
|
35002
|
-
import
|
|
35117
|
+
import chalk236 from "chalk";
|
|
35003
35118
|
var STATUS_MARKERS = {
|
|
35004
|
-
added: () =>
|
|
35005
|
-
removed: () =>
|
|
35006
|
-
modified: () =>
|
|
35119
|
+
added: () => chalk236.green("A"),
|
|
35120
|
+
removed: () => chalk236.red("D"),
|
|
35121
|
+
modified: () => chalk236.yellow("M")
|
|
35007
35122
|
};
|
|
35008
35123
|
function counts(additions, deletions) {
|
|
35009
|
-
return `${
|
|
35124
|
+
return `${chalk236.green(`+${additions}`)} ${chalk236.red(`-${deletions}`)}`;
|
|
35010
35125
|
}
|
|
35011
35126
|
function formatNode(node, indent3) {
|
|
35012
35127
|
if (node.kind === "file")
|
|
35013
35128
|
return [
|
|
35014
|
-
`${indent3}${STATUS_MARKERS[node.status]()} ${node.name} ${
|
|
35129
|
+
`${indent3}${STATUS_MARKERS[node.status]()} ${node.name} ${chalk236.dim(counts(node.additions, node.deletions))}`
|
|
35015
35130
|
];
|
|
35016
35131
|
const dir = node;
|
|
35017
35132
|
return [
|
|
35018
|
-
`${indent3}${
|
|
35133
|
+
`${indent3}${chalk236.bold(`${dir.name}/`)} ${chalk236.dim(counts(dir.additions, dir.deletions))}`,
|
|
35019
35134
|
...dir.children.flatMap((child) => formatNode(child, `${indent3} `))
|
|
35020
35135
|
];
|
|
35021
35136
|
}
|
|
35022
35137
|
function formatHighLevelStructure(structure) {
|
|
35023
35138
|
const summary = `${structure.added} added \xB7 ${structure.removed} deleted \xB7 ${structure.modified} modified \xB7 ${counts(structure.additions, structure.deletions)}`;
|
|
35024
35139
|
return [
|
|
35025
|
-
|
|
35140
|
+
chalk236.bold.underline("Structure"),
|
|
35026
35141
|
` ${summary}`,
|
|
35027
35142
|
...structure.tree.flatMap((node) => formatNode(node, " "))
|
|
35028
35143
|
].join("\n");
|
|
@@ -35031,10 +35146,10 @@ function formatHighLevelStructure(structure) {
|
|
|
35031
35146
|
// src/commands/review/highLevel/printHighLevelChecklist.ts
|
|
35032
35147
|
function printHighLevelChecklist(subject) {
|
|
35033
35148
|
console.log(
|
|
35034
|
-
|
|
35149
|
+
chalk237.bold(
|
|
35035
35150
|
`High-level review of ${subject.repo}#${subject.prNumber} \u2014 ${subject.title}`
|
|
35036
35151
|
),
|
|
35037
|
-
|
|
35152
|
+
chalk237.dim(
|
|
35038
35153
|
`\xB7 ${highLevelChangedFileCount(subject.structure)} changed files`
|
|
35039
35154
|
)
|
|
35040
35155
|
);
|
|
@@ -35046,12 +35161,12 @@ function printHighLevelChecklist(subject) {
|
|
|
35046
35161
|
formatCriticalDiffs(subject.criticalDiffs, subject.criticalPaths)
|
|
35047
35162
|
);
|
|
35048
35163
|
console.log(
|
|
35049
|
-
|
|
35164
|
+
chalk237.dim(
|
|
35050
35165
|
"\nManual items are for the reviewer to judge; see docs/high-level-review.md."
|
|
35051
35166
|
)
|
|
35052
35167
|
);
|
|
35053
35168
|
console.log(
|
|
35054
|
-
|
|
35169
|
+
chalk237.dim(
|
|
35055
35170
|
"Run this inside an assist session to step through the checklist in the web overlay."
|
|
35056
35171
|
)
|
|
35057
35172
|
);
|
|
@@ -35531,18 +35646,18 @@ function partitionFindingsByDiff(findings, index2) {
|
|
|
35531
35646
|
}
|
|
35532
35647
|
|
|
35533
35648
|
// src/commands/review/warnOutOfDiff.ts
|
|
35534
|
-
import
|
|
35649
|
+
import chalk238 from "chalk";
|
|
35535
35650
|
function warnOutOfDiff(outOfDiff) {
|
|
35536
35651
|
if (outOfDiff.length === 0) return;
|
|
35537
35652
|
console.warn(
|
|
35538
|
-
|
|
35653
|
+
chalk238.yellow(
|
|
35539
35654
|
`Moved ${outOfDiff.length} finding(s) whose lines fall outside the PR diff into the review body (GitHub cannot anchor a comment on these):`
|
|
35540
35655
|
)
|
|
35541
35656
|
);
|
|
35542
35657
|
for (const finding of outOfDiff) {
|
|
35543
35658
|
const range = finding.startLine !== void 0 ? `${finding.startLine}-${finding.line}` : `${finding.line}`;
|
|
35544
35659
|
console.warn(
|
|
35545
|
-
` ${
|
|
35660
|
+
` ${chalk238.yellow("\xB7")} ${finding.title} ${chalk238.dim(
|
|
35546
35661
|
`(${finding.file}:${range})`
|
|
35547
35662
|
)}`
|
|
35548
35663
|
);
|
|
@@ -35566,18 +35681,18 @@ function selectInDiffFindings(lineBound, prDiff) {
|
|
|
35566
35681
|
}
|
|
35567
35682
|
|
|
35568
35683
|
// src/commands/review/warnUnlocated.ts
|
|
35569
|
-
import
|
|
35684
|
+
import chalk239 from "chalk";
|
|
35570
35685
|
function warnUnlocated(unlocated) {
|
|
35571
35686
|
if (unlocated.length === 0) return;
|
|
35572
35687
|
console.warn(
|
|
35573
|
-
|
|
35688
|
+
chalk239.yellow(
|
|
35574
35689
|
`Moved ${unlocated.length} finding(s) without a parseable file:line into the review body:`
|
|
35575
35690
|
)
|
|
35576
35691
|
);
|
|
35577
35692
|
for (const finding of unlocated) {
|
|
35578
|
-
const where = finding.location ||
|
|
35693
|
+
const where = finding.location || chalk239.dim("missing");
|
|
35579
35694
|
console.warn(
|
|
35580
|
-
` ${
|
|
35695
|
+
` ${chalk239.yellow("\xB7")} ${finding.title} ${chalk239.dim(`(${where})`)}`
|
|
35581
35696
|
);
|
|
35582
35697
|
}
|
|
35583
35698
|
}
|
|
@@ -37217,7 +37332,7 @@ function registerReview(program2) {
|
|
|
37217
37332
|
// src/commands/rules/addRule.ts
|
|
37218
37333
|
import { existsSync as existsSync71, readFileSync as readFileSync54, writeFileSync as writeFileSync44 } from "fs";
|
|
37219
37334
|
import path85 from "path";
|
|
37220
|
-
import
|
|
37335
|
+
import chalk240 from "chalk";
|
|
37221
37336
|
|
|
37222
37337
|
// src/commands/rules/insertRuleBullet.ts
|
|
37223
37338
|
function ruleBullet({ code, title, text: text18 }) {
|
|
@@ -37353,7 +37468,7 @@ function read2(file) {
|
|
|
37353
37468
|
function addRule(text18, options2) {
|
|
37354
37469
|
const rule = text18.trim();
|
|
37355
37470
|
if (rule === "") {
|
|
37356
|
-
console.error(
|
|
37471
|
+
console.error(chalk240.red("Rule text is required"));
|
|
37357
37472
|
process.exitCode = 1;
|
|
37358
37473
|
return;
|
|
37359
37474
|
}
|
|
@@ -37371,13 +37486,13 @@ function addRule(text18, options2) {
|
|
|
37371
37486
|
);
|
|
37372
37487
|
updateScopedRulesIndex(root2);
|
|
37373
37488
|
console.log(
|
|
37374
|
-
`Added ${
|
|
37489
|
+
`Added ${chalk240.cyan(code)} to ${path85.relative(process.cwd(), target) || target}`
|
|
37375
37490
|
);
|
|
37376
37491
|
}
|
|
37377
37492
|
|
|
37378
37493
|
// src/commands/rules/indexRules.ts
|
|
37379
37494
|
import path86 from "path";
|
|
37380
|
-
import
|
|
37495
|
+
import chalk241 from "chalk";
|
|
37381
37496
|
function indexRules() {
|
|
37382
37497
|
const startDir = scopeDirectory(process.cwd());
|
|
37383
37498
|
const root2 = findRepoRoot(startDir) ?? startDir;
|
|
@@ -37385,24 +37500,24 @@ function indexRules() {
|
|
|
37385
37500
|
const rootFile = path86.relative(process.cwd(), path86.join(root2, "CLAUDE.md"));
|
|
37386
37501
|
if (directories.length === 0) {
|
|
37387
37502
|
console.log(
|
|
37388
|
-
|
|
37503
|
+
chalk241.gray(`No directories carry their own \`## Rules\` under ${root2}`)
|
|
37389
37504
|
);
|
|
37390
37505
|
return;
|
|
37391
37506
|
}
|
|
37392
37507
|
console.log(`Recorded in ${rootFile || "CLAUDE.md"}`);
|
|
37393
37508
|
for (const directory of directories)
|
|
37394
|
-
console.log(` ${
|
|
37509
|
+
console.log(` ${chalk241.cyan(directory)}`);
|
|
37395
37510
|
}
|
|
37396
37511
|
|
|
37397
37512
|
// src/commands/rules/listRules.ts
|
|
37398
37513
|
import path87 from "path";
|
|
37399
|
-
import
|
|
37514
|
+
import chalk242 from "chalk";
|
|
37400
37515
|
function listRules(target, options2 = {}) {
|
|
37401
37516
|
const resolved = path87.resolve(target ?? process.cwd());
|
|
37402
37517
|
const rules2 = readScopedRules(resolved);
|
|
37403
37518
|
if (rules2.length === 0) {
|
|
37404
37519
|
const label2 = path87.relative(process.cwd(), resolved) || ".";
|
|
37405
|
-
console.log(
|
|
37520
|
+
console.log(chalk242.gray(`No rules in scope for ${label2}`));
|
|
37406
37521
|
return;
|
|
37407
37522
|
}
|
|
37408
37523
|
const base = findRepoRoot(scopeDirectory(resolved));
|
|
@@ -37412,14 +37527,14 @@ function listRules(target, options2 = {}) {
|
|
|
37412
37527
|
if (rule.source !== shown) {
|
|
37413
37528
|
shown = rule.source;
|
|
37414
37529
|
console.log(
|
|
37415
|
-
|
|
37530
|
+
chalk242.dim(base ? path87.relative(base, rule.source) : rule.source)
|
|
37416
37531
|
);
|
|
37417
37532
|
}
|
|
37418
37533
|
console.log(
|
|
37419
|
-
` ${
|
|
37534
|
+
` ${chalk242.cyan(rule.code.padEnd(width))} ${rule.title ?? rule.text}`
|
|
37420
37535
|
);
|
|
37421
37536
|
if (options2.full && rule.title)
|
|
37422
|
-
console.log(` ${" ".repeat(width)} ${
|
|
37537
|
+
console.log(` ${" ".repeat(width)} ${chalk242.dim(rule.text)}`);
|
|
37423
37538
|
}
|
|
37424
37539
|
}
|
|
37425
37540
|
|
|
@@ -37448,7 +37563,7 @@ function registerRules(program2) {
|
|
|
37448
37563
|
}
|
|
37449
37564
|
|
|
37450
37565
|
// src/commands/seq/seqAuth.ts
|
|
37451
|
-
import
|
|
37566
|
+
import chalk244 from "chalk";
|
|
37452
37567
|
|
|
37453
37568
|
// src/commands/seq/loadConnections.ts
|
|
37454
37569
|
function loadConnections2() {
|
|
@@ -37477,10 +37592,10 @@ function setDefaultConnection(name) {
|
|
|
37477
37592
|
}
|
|
37478
37593
|
|
|
37479
37594
|
// src/shared/assertUniqueName.ts
|
|
37480
|
-
import
|
|
37595
|
+
import chalk243 from "chalk";
|
|
37481
37596
|
function assertUniqueName(existingNames, name) {
|
|
37482
37597
|
if (existingNames.includes(name)) {
|
|
37483
|
-
console.error(
|
|
37598
|
+
console.error(chalk243.red(`Connection "${name}" already exists.`));
|
|
37484
37599
|
process.exit(1);
|
|
37485
37600
|
}
|
|
37486
37601
|
}
|
|
@@ -37498,16 +37613,16 @@ async function promptConnection2(existingNames) {
|
|
|
37498
37613
|
var seqAuth = createConnectionAuth({
|
|
37499
37614
|
load: loadConnections2,
|
|
37500
37615
|
save: saveConnections2,
|
|
37501
|
-
format: (c) => `${
|
|
37616
|
+
format: (c) => `${chalk244.bold(c.name)} ${c.url}`,
|
|
37502
37617
|
promptNew: promptConnection2,
|
|
37503
37618
|
onFirst: (c) => setDefaultConnection(c.name)
|
|
37504
37619
|
});
|
|
37505
37620
|
|
|
37506
37621
|
// src/commands/seq/seqQuery.ts
|
|
37507
|
-
import
|
|
37622
|
+
import chalk248 from "chalk";
|
|
37508
37623
|
|
|
37509
37624
|
// src/commands/seq/fetchSeq.ts
|
|
37510
|
-
import
|
|
37625
|
+
import chalk245 from "chalk";
|
|
37511
37626
|
async function fetchSeq(conn, path106, params) {
|
|
37512
37627
|
const url = `${conn.url}${path106}?${params}`;
|
|
37513
37628
|
const response = await fetch(url, {
|
|
@@ -37518,7 +37633,7 @@ async function fetchSeq(conn, path106, params) {
|
|
|
37518
37633
|
});
|
|
37519
37634
|
if (!response.ok) {
|
|
37520
37635
|
const body = await response.text();
|
|
37521
|
-
console.error(
|
|
37636
|
+
console.error(chalk245.red(`Seq returned ${response.status}: ${body}`));
|
|
37522
37637
|
process.exit(1);
|
|
37523
37638
|
}
|
|
37524
37639
|
return response;
|
|
@@ -37577,23 +37692,23 @@ async function fetchSeqEvents(conn, params) {
|
|
|
37577
37692
|
}
|
|
37578
37693
|
|
|
37579
37694
|
// src/commands/seq/formatEvent.ts
|
|
37580
|
-
import
|
|
37695
|
+
import chalk246 from "chalk";
|
|
37581
37696
|
function levelColor(level) {
|
|
37582
37697
|
switch (level) {
|
|
37583
37698
|
case "Fatal":
|
|
37584
|
-
return
|
|
37699
|
+
return chalk246.bgRed.white;
|
|
37585
37700
|
case "Error":
|
|
37586
|
-
return
|
|
37701
|
+
return chalk246.red;
|
|
37587
37702
|
case "Warning":
|
|
37588
|
-
return
|
|
37703
|
+
return chalk246.yellow;
|
|
37589
37704
|
case "Information":
|
|
37590
|
-
return
|
|
37705
|
+
return chalk246.cyan;
|
|
37591
37706
|
case "Debug":
|
|
37592
|
-
return
|
|
37707
|
+
return chalk246.gray;
|
|
37593
37708
|
case "Verbose":
|
|
37594
|
-
return
|
|
37709
|
+
return chalk246.dim;
|
|
37595
37710
|
default:
|
|
37596
|
-
return
|
|
37711
|
+
return chalk246.white;
|
|
37597
37712
|
}
|
|
37598
37713
|
}
|
|
37599
37714
|
function levelAbbrev(level) {
|
|
@@ -37634,12 +37749,12 @@ function formatTimestamp(iso) {
|
|
|
37634
37749
|
function formatEvent(event) {
|
|
37635
37750
|
const color = levelColor(event.Level);
|
|
37636
37751
|
const abbrev = levelAbbrev(event.Level);
|
|
37637
|
-
const ts10 =
|
|
37752
|
+
const ts10 = chalk246.dim(formatTimestamp(event.Timestamp));
|
|
37638
37753
|
const msg = renderMessage(event);
|
|
37639
37754
|
const lines2 = [`${ts10} ${color(`[${abbrev}]`)} ${msg}`];
|
|
37640
37755
|
if (event.Exception) {
|
|
37641
37756
|
for (const line of event.Exception.split("\n")) {
|
|
37642
|
-
lines2.push(
|
|
37757
|
+
lines2.push(chalk246.red(` ${line}`));
|
|
37643
37758
|
}
|
|
37644
37759
|
}
|
|
37645
37760
|
return lines2.join("\n");
|
|
@@ -37672,11 +37787,11 @@ function rejectTimestampFilter(filter) {
|
|
|
37672
37787
|
}
|
|
37673
37788
|
|
|
37674
37789
|
// src/shared/resolveNamedConnection.ts
|
|
37675
|
-
import
|
|
37790
|
+
import chalk247 from "chalk";
|
|
37676
37791
|
function resolveNamedConnection(connections, requested, defaultName, kind, authCommand) {
|
|
37677
37792
|
if (connections.length === 0) {
|
|
37678
37793
|
console.error(
|
|
37679
|
-
|
|
37794
|
+
chalk247.red(
|
|
37680
37795
|
`No ${kind} connections configured. Run '${authCommand}' first.`
|
|
37681
37796
|
)
|
|
37682
37797
|
);
|
|
@@ -37685,7 +37800,7 @@ function resolveNamedConnection(connections, requested, defaultName, kind, authC
|
|
|
37685
37800
|
const target = requested ?? defaultName ?? connections[0].name;
|
|
37686
37801
|
const connection = connections.find((c) => c.name === target);
|
|
37687
37802
|
if (!connection) {
|
|
37688
|
-
console.error(
|
|
37803
|
+
console.error(chalk247.red(`${kind} connection "${target}" not found.`));
|
|
37689
37804
|
process.exit(1);
|
|
37690
37805
|
}
|
|
37691
37806
|
return connection;
|
|
@@ -37714,7 +37829,7 @@ async function seqQuery(filter, options2) {
|
|
|
37714
37829
|
new URLSearchParams({ filter, count: String(count8) })
|
|
37715
37830
|
);
|
|
37716
37831
|
if (events.length === 0) {
|
|
37717
|
-
console.log(
|
|
37832
|
+
console.log(chalk248.yellow("No events found."));
|
|
37718
37833
|
return;
|
|
37719
37834
|
}
|
|
37720
37835
|
if (options2.json) {
|
|
@@ -37725,11 +37840,11 @@ async function seqQuery(filter, options2) {
|
|
|
37725
37840
|
for (const event of chronological) {
|
|
37726
37841
|
console.log(formatEvent(event));
|
|
37727
37842
|
}
|
|
37728
|
-
console.log(
|
|
37843
|
+
console.log(chalk248.dim(`
|
|
37729
37844
|
${events.length} events`));
|
|
37730
37845
|
if (events.length >= count8) {
|
|
37731
37846
|
console.log(
|
|
37732
|
-
|
|
37847
|
+
chalk248.yellow(
|
|
37733
37848
|
`Results limited to ${count8}. Use --count to retrieve more.`
|
|
37734
37849
|
)
|
|
37735
37850
|
);
|
|
@@ -37737,10 +37852,10 @@ ${events.length} events`));
|
|
|
37737
37852
|
}
|
|
37738
37853
|
|
|
37739
37854
|
// src/shared/setNamedDefaultConnection.ts
|
|
37740
|
-
import
|
|
37855
|
+
import chalk249 from "chalk";
|
|
37741
37856
|
function setNamedDefaultConnection(connections, name, setDefault, kind) {
|
|
37742
37857
|
if (!connections.find((c) => c.name === name)) {
|
|
37743
|
-
console.error(
|
|
37858
|
+
console.error(chalk249.red(`Connection "${name}" not found.`));
|
|
37744
37859
|
process.exit(1);
|
|
37745
37860
|
}
|
|
37746
37861
|
setDefault(name);
|
|
@@ -37814,7 +37929,7 @@ function parseReply(line) {
|
|
|
37814
37929
|
}
|
|
37815
37930
|
|
|
37816
37931
|
// src/commands/show.ts
|
|
37817
|
-
async function
|
|
37932
|
+
async function show3(options2) {
|
|
37818
37933
|
const body = await readBodyArgument(options2.body);
|
|
37819
37934
|
if (body.trim().length === 0) {
|
|
37820
37935
|
console.error("Error: --body is empty; there is nothing to show.");
|
|
@@ -37843,7 +37958,7 @@ async function show2(options2) {
|
|
|
37843
37958
|
function registerShow(program2) {
|
|
37844
37959
|
program2.command("show").description(
|
|
37845
37960
|
"Open markdown in the session's web preview pane so long links, paths and snippets can be clicked and copied unbroken; prints it outside a web session"
|
|
37846
|
-
).option("--title <title>", "Pane title").requiredOption("--body <markdown|->", "Markdown to show, or - for stdin").action(
|
|
37961
|
+
).option("--title <title>", "Pane title").requiredOption("--body <markdown|->", "Markdown to show, or - for stdin").action(show3);
|
|
37847
37962
|
}
|
|
37848
37963
|
|
|
37849
37964
|
// src/commands/registerSignal.ts
|
|
@@ -38032,7 +38147,7 @@ function registerSlack(program2) {
|
|
|
38032
38147
|
}
|
|
38033
38148
|
|
|
38034
38149
|
// src/commands/sql/sqlAuth.ts
|
|
38035
|
-
import
|
|
38150
|
+
import chalk251 from "chalk";
|
|
38036
38151
|
|
|
38037
38152
|
// src/commands/sql/loadConnections.ts
|
|
38038
38153
|
function loadConnections3() {
|
|
@@ -38061,7 +38176,7 @@ function setDefaultConnection2(name) {
|
|
|
38061
38176
|
}
|
|
38062
38177
|
|
|
38063
38178
|
// src/commands/sql/promptConnection.ts
|
|
38064
|
-
import
|
|
38179
|
+
import chalk250 from "chalk";
|
|
38065
38180
|
async function promptConnection3(existingNames) {
|
|
38066
38181
|
const name = await promptInput("name", "Connection name:", "default");
|
|
38067
38182
|
assertUniqueName(existingNames, name);
|
|
@@ -38069,7 +38184,7 @@ async function promptConnection3(existingNames) {
|
|
|
38069
38184
|
const portStr = await promptInput("port", "Port:", "1433");
|
|
38070
38185
|
const port = Number.parseInt(portStr, 10);
|
|
38071
38186
|
if (!Number.isFinite(port)) {
|
|
38072
|
-
console.error(
|
|
38187
|
+
console.error(chalk250.red(`Invalid port "${portStr}".`));
|
|
38073
38188
|
process.exit(1);
|
|
38074
38189
|
}
|
|
38075
38190
|
const user = await promptInput("user", "User:");
|
|
@@ -38082,13 +38197,13 @@ async function promptConnection3(existingNames) {
|
|
|
38082
38197
|
var sqlAuth = createConnectionAuth({
|
|
38083
38198
|
load: loadConnections3,
|
|
38084
38199
|
save: saveConnections3,
|
|
38085
|
-
format: (c) => `${
|
|
38200
|
+
format: (c) => `${chalk251.bold(c.name)} ${c.server}:${c.port}/${c.database} (${c.user})`,
|
|
38086
38201
|
promptNew: promptConnection3,
|
|
38087
38202
|
onFirst: (c) => setDefaultConnection2(c.name)
|
|
38088
38203
|
});
|
|
38089
38204
|
|
|
38090
38205
|
// src/commands/sql/printTable.ts
|
|
38091
|
-
import
|
|
38206
|
+
import chalk252 from "chalk";
|
|
38092
38207
|
function formatCell(value) {
|
|
38093
38208
|
if (value === null || value === void 0) return "";
|
|
38094
38209
|
if (value instanceof Date) return value.toISOString();
|
|
@@ -38097,7 +38212,7 @@ function formatCell(value) {
|
|
|
38097
38212
|
}
|
|
38098
38213
|
function printTable(rows) {
|
|
38099
38214
|
if (rows.length === 0) {
|
|
38100
|
-
console.log(
|
|
38215
|
+
console.log(chalk252.yellow("(no rows)"));
|
|
38101
38216
|
return;
|
|
38102
38217
|
}
|
|
38103
38218
|
const columns = Object.keys(rows[0]);
|
|
@@ -38105,13 +38220,13 @@ function printTable(rows) {
|
|
|
38105
38220
|
(col) => Math.max(col.length, ...rows.map((r) => formatCell(r[col]).length))
|
|
38106
38221
|
);
|
|
38107
38222
|
const header = columns.map((c, i) => c.padEnd(widths[i])).join(" ");
|
|
38108
|
-
console.log(
|
|
38109
|
-
console.log(
|
|
38223
|
+
console.log(chalk252.dim(header));
|
|
38224
|
+
console.log(chalk252.dim("-".repeat(header.length)));
|
|
38110
38225
|
for (const row of rows) {
|
|
38111
38226
|
const line = columns.map((c, i) => formatCell(row[c]).padEnd(widths[i])).join(" ");
|
|
38112
38227
|
console.log(line);
|
|
38113
38228
|
}
|
|
38114
|
-
console.log(
|
|
38229
|
+
console.log(chalk252.dim(`
|
|
38115
38230
|
${rows.length} row${rows.length === 1 ? "" : "s"}`));
|
|
38116
38231
|
}
|
|
38117
38232
|
|
|
@@ -38171,7 +38286,7 @@ async function sqlColumns(table, connectionName) {
|
|
|
38171
38286
|
}
|
|
38172
38287
|
|
|
38173
38288
|
// src/commands/sql/sqlMutate.ts
|
|
38174
|
-
import
|
|
38289
|
+
import chalk253 from "chalk";
|
|
38175
38290
|
|
|
38176
38291
|
// src/commands/sql/isMutation.ts
|
|
38177
38292
|
var MUTATION_KEYWORDS = [
|
|
@@ -38205,7 +38320,7 @@ function isMutation(sql29) {
|
|
|
38205
38320
|
async function sqlMutate(query, connectionName) {
|
|
38206
38321
|
if (!isMutation(query)) {
|
|
38207
38322
|
console.error(
|
|
38208
|
-
|
|
38323
|
+
chalk253.red(
|
|
38209
38324
|
"assist sql mutate refuses non-mutating statements. Use `assist sql query` instead."
|
|
38210
38325
|
)
|
|
38211
38326
|
);
|
|
@@ -38215,18 +38330,18 @@ async function sqlMutate(query, connectionName) {
|
|
|
38215
38330
|
const pool = await sqlConnect(conn);
|
|
38216
38331
|
try {
|
|
38217
38332
|
const result = await pool.request().query(query);
|
|
38218
|
-
console.log(
|
|
38333
|
+
console.log(chalk253.dim(`${result.rowsAffected.join(", ")} row(s) affected`));
|
|
38219
38334
|
} finally {
|
|
38220
38335
|
await pool.close();
|
|
38221
38336
|
}
|
|
38222
38337
|
}
|
|
38223
38338
|
|
|
38224
38339
|
// src/commands/sql/sqlQuery.ts
|
|
38225
|
-
import
|
|
38340
|
+
import chalk254 from "chalk";
|
|
38226
38341
|
async function sqlQuery(query, connectionName) {
|
|
38227
38342
|
if (isMutation(query)) {
|
|
38228
38343
|
console.error(
|
|
38229
|
-
|
|
38344
|
+
chalk254.red(
|
|
38230
38345
|
"assist sql query refuses mutating statements. Use `assist sql mutate` instead."
|
|
38231
38346
|
)
|
|
38232
38347
|
);
|
|
@@ -38241,7 +38356,7 @@ async function sqlQuery(query, connectionName) {
|
|
|
38241
38356
|
printTable(rows);
|
|
38242
38357
|
} else {
|
|
38243
38358
|
console.log(
|
|
38244
|
-
|
|
38359
|
+
chalk254.dim(`${result.rowsAffected.join(", ")} row(s) affected`)
|
|
38245
38360
|
);
|
|
38246
38361
|
}
|
|
38247
38362
|
} finally {
|
|
@@ -38662,7 +38777,7 @@ function syncPi(claudeDir, options2) {
|
|
|
38662
38777
|
// src/commands/sync/syncSettings.ts
|
|
38663
38778
|
import * as fs47 from "fs";
|
|
38664
38779
|
import * as path98 from "path";
|
|
38665
|
-
import
|
|
38780
|
+
import chalk255 from "chalk";
|
|
38666
38781
|
async function syncSettings(claudeDir, targetBase, options2) {
|
|
38667
38782
|
const source = path98.join(claudeDir, "settings.json");
|
|
38668
38783
|
const target = path98.join(targetBase, "settings.json");
|
|
@@ -38681,7 +38796,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
38681
38796
|
if (mergedContent !== normalizedTarget) {
|
|
38682
38797
|
if (!options2?.yes) {
|
|
38683
38798
|
console.log(
|
|
38684
|
-
|
|
38799
|
+
chalk255.yellow(
|
|
38685
38800
|
"\n\u26A0\uFE0F Warning: settings.json differs from existing file"
|
|
38686
38801
|
)
|
|
38687
38802
|
);
|
|
@@ -38689,7 +38804,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
38689
38804
|
printDiff(targetContent, mergedContent);
|
|
38690
38805
|
printAutoConfirmHint();
|
|
38691
38806
|
const confirm = await promptConfirm(
|
|
38692
|
-
|
|
38807
|
+
chalk255.red("Overwrite existing settings.json?"),
|
|
38693
38808
|
false
|
|
38694
38809
|
);
|
|
38695
38810
|
if (!confirm) {
|
|
@@ -40920,7 +41035,7 @@ function registerWatch(program2) {
|
|
|
40920
41035
|
|
|
40921
41036
|
// src/commands/roam/auth.ts
|
|
40922
41037
|
import { randomBytes } from "crypto";
|
|
40923
|
-
import
|
|
41038
|
+
import chalk256 from "chalk";
|
|
40924
41039
|
|
|
40925
41040
|
// src/commands/roam/waitForCallback.ts
|
|
40926
41041
|
import { createServer as createServer3 } from "http";
|
|
@@ -41051,13 +41166,13 @@ async function auth() {
|
|
|
41051
41166
|
saveGlobalConfig(config);
|
|
41052
41167
|
const state = randomBytes(16).toString("hex");
|
|
41053
41168
|
console.log(
|
|
41054
|
-
|
|
41169
|
+
chalk256.yellow("\nEnsure this Redirect URI is set in your Roam OAuth app:")
|
|
41055
41170
|
);
|
|
41056
|
-
console.log(
|
|
41057
|
-
console.log(
|
|
41058
|
-
console.log(
|
|
41171
|
+
console.log(chalk256.white("http://localhost:14523/callback\n"));
|
|
41172
|
+
console.log(chalk256.blue("Opening browser for authorization..."));
|
|
41173
|
+
console.log(chalk256.dim("Waiting for authorization callback..."));
|
|
41059
41174
|
const { code, redirectUri } = await authorizeInBrowser(clientId, state);
|
|
41060
|
-
console.log(
|
|
41175
|
+
console.log(chalk256.dim("Exchanging code for tokens..."));
|
|
41061
41176
|
const tokens = await exchangeToken({
|
|
41062
41177
|
code,
|
|
41063
41178
|
clientId,
|
|
@@ -41073,7 +41188,7 @@ async function auth() {
|
|
|
41073
41188
|
};
|
|
41074
41189
|
saveGlobalConfig(config);
|
|
41075
41190
|
console.log(
|
|
41076
|
-
|
|
41191
|
+
chalk256.green("Roam credentials and tokens saved to ~/.assist.yml")
|
|
41077
41192
|
);
|
|
41078
41193
|
}
|
|
41079
41194
|
|
|
@@ -41428,18 +41543,18 @@ function registerRun(program2) {
|
|
|
41428
41543
|
}
|
|
41429
41544
|
|
|
41430
41545
|
// src/commands/sessions/nodes/formatLink.ts
|
|
41431
|
-
import
|
|
41546
|
+
import chalk257 from "chalk";
|
|
41432
41547
|
var STATE_COLOURS = {
|
|
41433
|
-
connected:
|
|
41434
|
-
connecting:
|
|
41435
|
-
disconnected:
|
|
41436
|
-
"version-blocked":
|
|
41548
|
+
connected: chalk257.green,
|
|
41549
|
+
connecting: chalk257.yellow,
|
|
41550
|
+
disconnected: chalk257.red,
|
|
41551
|
+
"version-blocked": chalk257.red
|
|
41437
41552
|
};
|
|
41438
41553
|
function formatLink(link3) {
|
|
41439
|
-
const colour = STATE_COLOURS[link3.state] ??
|
|
41554
|
+
const colour = STATE_COLOURS[link3.state] ?? chalk257.white;
|
|
41440
41555
|
const peer = link3.peerVersion ? ` peer ${link3.peerVersion}` : "";
|
|
41441
41556
|
const error = link3.error ? `
|
|
41442
|
-
${
|
|
41557
|
+
${chalk257.dim(`last error${link3.errorAt ? ` ${link3.errorAt}` : ""}: ${link3.error}`)}` : "";
|
|
41443
41558
|
return ` ${link3.name} ${colour(link3.state)} ${link3.url}${peer}${error}`;
|
|
41444
41559
|
}
|
|
41445
41560
|
|
|
@@ -48288,7 +48403,7 @@ async function findUnlinkedWindowsNode(health2, platform = detectPlatform()) {
|
|
|
48288
48403
|
}
|
|
48289
48404
|
|
|
48290
48405
|
// src/commands/sessions/nodes/printReport.ts
|
|
48291
|
-
import
|
|
48406
|
+
import chalk258 from "chalk";
|
|
48292
48407
|
function printReport(report) {
|
|
48293
48408
|
if (report.links.length === 0) {
|
|
48294
48409
|
console.log(`${report.local} has no links`);
|
|
@@ -48302,11 +48417,11 @@ function printReport(report) {
|
|
|
48302
48417
|
for (const diagnosis of report.links) printDiagnosis(diagnosis);
|
|
48303
48418
|
}
|
|
48304
48419
|
function printDiagnosis(diagnosis) {
|
|
48305
|
-
console.log(`${
|
|
48420
|
+
console.log(`${chalk258.bold(diagnosis.name)} ${chalk258.dim(diagnosis.url)}`);
|
|
48306
48421
|
for (const hop of diagnosis.hops) {
|
|
48307
|
-
const mark = hop.ok ?
|
|
48422
|
+
const mark = hop.ok ? chalk258.green("\u2713") : chalk258.red("\u2717");
|
|
48308
48423
|
console.log(` ${mark} ${hop.hop.padEnd(9)} ${hop.detail ?? hop.error}`);
|
|
48309
|
-
if (hop.remediation) console.log(` ${
|
|
48424
|
+
if (hop.remediation) console.log(` ${chalk258.yellow(hop.remediation)}`);
|
|
48310
48425
|
}
|
|
48311
48426
|
}
|
|
48312
48427
|
|
|
@@ -48326,7 +48441,7 @@ async function doctorNodes(name, options2) {
|
|
|
48326
48441
|
}
|
|
48327
48442
|
|
|
48328
48443
|
// src/commands/sessions/nodes/listNodes.ts
|
|
48329
|
-
import
|
|
48444
|
+
import chalk259 from "chalk";
|
|
48330
48445
|
async function nodesReport() {
|
|
48331
48446
|
const live = await queryNodes();
|
|
48332
48447
|
if (live)
|
|
@@ -48343,10 +48458,10 @@ async function listNodes(options2) {
|
|
|
48343
48458
|
console.log(JSON.stringify(report, null, 2));
|
|
48344
48459
|
return;
|
|
48345
48460
|
}
|
|
48346
|
-
console.log(`${report.local} ${
|
|
48461
|
+
console.log(`${report.local} ${chalk259.dim("(this node)")}`);
|
|
48347
48462
|
if (!report.daemonRunning)
|
|
48348
|
-
console.log(
|
|
48349
|
-
if (report.links.length === 0) console.log(
|
|
48463
|
+
console.log(chalk259.dim(" daemon not running; showing configured links"));
|
|
48464
|
+
if (report.links.length === 0) console.log(chalk259.dim(" no links"));
|
|
48350
48465
|
for (const link3 of report.links) console.log(formatLink(link3));
|
|
48351
48466
|
}
|
|
48352
48467
|
|
|
@@ -48385,14 +48500,14 @@ async function nodeLogs(name, options2) {
|
|
|
48385
48500
|
}
|
|
48386
48501
|
|
|
48387
48502
|
// src/commands/sessions/nodes/linkNode.ts
|
|
48388
|
-
import
|
|
48503
|
+
import chalk262 from "chalk";
|
|
48389
48504
|
|
|
48390
48505
|
// src/commands/sessions/nodes/notifyDaemonLinks.ts
|
|
48391
|
-
import
|
|
48506
|
+
import chalk260 from "chalk";
|
|
48392
48507
|
async function notifyDaemonLinks() {
|
|
48393
48508
|
if (!await isDaemonRunning()) {
|
|
48394
48509
|
console.log(
|
|
48395
|
-
|
|
48510
|
+
chalk260.yellow(
|
|
48396
48511
|
"The sessions daemon is not running; it loads the links when it starts."
|
|
48397
48512
|
)
|
|
48398
48513
|
);
|
|
@@ -48400,11 +48515,11 @@ async function notifyDaemonLinks() {
|
|
|
48400
48515
|
}
|
|
48401
48516
|
try {
|
|
48402
48517
|
await sendToDaemonAwaitAck({ type: "reload-links" });
|
|
48403
|
-
console.log(
|
|
48518
|
+
console.log(chalk260.dim("The sessions daemon reloaded its links."));
|
|
48404
48519
|
} catch (error) {
|
|
48405
48520
|
const message3 = error instanceof Error ? error.message : String(error);
|
|
48406
48521
|
console.log(
|
|
48407
|
-
|
|
48522
|
+
chalk260.yellow(
|
|
48408
48523
|
`Could not notify the sessions daemon (${message3}); run \`assist daemon restart\` to apply the change.`
|
|
48409
48524
|
)
|
|
48410
48525
|
);
|
|
@@ -48412,7 +48527,7 @@ async function notifyDaemonLinks() {
|
|
|
48412
48527
|
}
|
|
48413
48528
|
|
|
48414
48529
|
// src/commands/sessions/nodes/readLinks.ts
|
|
48415
|
-
import
|
|
48530
|
+
import chalk261 from "chalk";
|
|
48416
48531
|
|
|
48417
48532
|
// src/commands/sessions/nodes/writeLinks.ts
|
|
48418
48533
|
async function writeLinks(links2) {
|
|
@@ -48435,7 +48550,7 @@ async function readLinks() {
|
|
|
48435
48550
|
await writeLinks(links2);
|
|
48436
48551
|
const dropped = stored.filter((link3) => !link3.url).map((link3) => link3.name);
|
|
48437
48552
|
console.log(
|
|
48438
|
-
|
|
48553
|
+
chalk261.yellow(`Removed ${dropped.join(", ")}: ${SSH_LINK_RETIRED}`)
|
|
48439
48554
|
);
|
|
48440
48555
|
return links2;
|
|
48441
48556
|
}
|
|
@@ -48491,7 +48606,7 @@ async function linkNode(name, url, options2) {
|
|
|
48491
48606
|
throw new Error(`${name} is this node; link to a different node`);
|
|
48492
48607
|
const link3 = await buildLink(name, url, options2);
|
|
48493
48608
|
await writeLinks([...others, link3]);
|
|
48494
|
-
console.log(
|
|
48609
|
+
console.log(chalk262.green(`Linked ${name} (${link3.url})`));
|
|
48495
48610
|
await notifyDaemonLinks();
|
|
48496
48611
|
}
|
|
48497
48612
|
|
|
@@ -48596,16 +48711,16 @@ async function restartNode(name, options2) {
|
|
|
48596
48711
|
}
|
|
48597
48712
|
|
|
48598
48713
|
// src/commands/sessions/nodes/unlinkNode.ts
|
|
48599
|
-
import
|
|
48714
|
+
import chalk263 from "chalk";
|
|
48600
48715
|
async function unlinkNode(name) {
|
|
48601
48716
|
const links2 = await readLinks();
|
|
48602
48717
|
const remaining = links2.filter((link3) => link3.name !== name);
|
|
48603
48718
|
if (remaining.length === links2.length) {
|
|
48604
|
-
console.log(
|
|
48719
|
+
console.log(chalk263.yellow(`No link named ${name}`));
|
|
48605
48720
|
return;
|
|
48606
48721
|
}
|
|
48607
48722
|
await writeLinks(remaining);
|
|
48608
|
-
console.log(
|
|
48723
|
+
console.log(chalk263.green(`Unlinked ${name}`));
|
|
48609
48724
|
await notifyDaemonLinks();
|
|
48610
48725
|
}
|
|
48611
48726
|
|
|
@@ -48804,7 +48919,7 @@ async function renameSession(title) {
|
|
|
48804
48919
|
|
|
48805
48920
|
// src/commands/sessions/summarise.ts
|
|
48806
48921
|
import * as fs58 from "fs";
|
|
48807
|
-
import
|
|
48922
|
+
import chalk264 from "chalk";
|
|
48808
48923
|
|
|
48809
48924
|
// src/commands/sessions/summarise/shared.ts
|
|
48810
48925
|
import * as fs57 from "fs";
|
|
@@ -48863,22 +48978,22 @@ ${firstMessage}`);
|
|
|
48863
48978
|
async function summarise2(options2) {
|
|
48864
48979
|
const files = await discoverSessionFiles();
|
|
48865
48980
|
if (files.length === 0) {
|
|
48866
|
-
console.log(
|
|
48981
|
+
console.log(chalk264.yellow("No sessions found."));
|
|
48867
48982
|
return;
|
|
48868
48983
|
}
|
|
48869
48984
|
const toProcess = selectCandidates(files, options2);
|
|
48870
48985
|
if (toProcess.length === 0) {
|
|
48871
|
-
console.log(
|
|
48986
|
+
console.log(chalk264.green("All sessions already summarised."));
|
|
48872
48987
|
return;
|
|
48873
48988
|
}
|
|
48874
48989
|
console.log(
|
|
48875
|
-
|
|
48990
|
+
chalk264.cyan(
|
|
48876
48991
|
`Summarising ${toProcess.length} session(s) (${files.length} total)\u2026`
|
|
48877
48992
|
)
|
|
48878
48993
|
);
|
|
48879
48994
|
const { succeeded, failed: failed3 } = processSessions(toProcess);
|
|
48880
48995
|
console.log(
|
|
48881
|
-
|
|
48996
|
+
chalk264.green(`Done: ${succeeded} summarised`) + (failed3 > 0 ? chalk264.yellow(`, ${failed3} skipped`) : "")
|
|
48882
48997
|
);
|
|
48883
48998
|
}
|
|
48884
48999
|
function selectCandidates(files, options2) {
|
|
@@ -48898,16 +49013,16 @@ function processSessions(files) {
|
|
|
48898
49013
|
let failed3 = 0;
|
|
48899
49014
|
for (let i = 0; i < files.length; i++) {
|
|
48900
49015
|
const file = files[i];
|
|
48901
|
-
process.stdout.write(
|
|
49016
|
+
process.stdout.write(chalk264.dim(` [${i + 1}/${files.length}] `));
|
|
48902
49017
|
const summary = summariseSession(file);
|
|
48903
49018
|
if (summary) {
|
|
48904
49019
|
writeSummary(file, summary);
|
|
48905
49020
|
succeeded++;
|
|
48906
|
-
process.stdout.write(`${
|
|
49021
|
+
process.stdout.write(`${chalk264.green("\u2713")} ${summary}
|
|
48907
49022
|
`);
|
|
48908
49023
|
} else {
|
|
48909
49024
|
failed3++;
|
|
48910
|
-
process.stdout.write(` ${
|
|
49025
|
+
process.stdout.write(` ${chalk264.yellow("skip")}
|
|
48911
49026
|
`);
|
|
48912
49027
|
}
|
|
48913
49028
|
}
|
|
@@ -48941,10 +49056,10 @@ function registerSessions(program2) {
|
|
|
48941
49056
|
}
|
|
48942
49057
|
|
|
48943
49058
|
// src/reportCliError.ts
|
|
48944
|
-
import
|
|
49059
|
+
import chalk265 from "chalk";
|
|
48945
49060
|
function reportCliError(error) {
|
|
48946
49061
|
if (error instanceof InvalidItemIdError || error instanceof AmbiguousRepoConfigError || error instanceof UnknownRepoConfigError || error instanceof MissingRunCwdError || error instanceof MiroExtractError) {
|
|
48947
|
-
console.error(
|
|
49062
|
+
console.error(chalk265.red(error.message));
|
|
48948
49063
|
} else {
|
|
48949
49064
|
console.error(error);
|
|
48950
49065
|
}
|