xtrm-tools 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/dist/index.cjs +58 -16
- package/cli/dist/index.cjs.map +1 -1
- package/cli/package.json +1 -1
- package/package.json +1 -1
package/cli/dist/index.cjs
CHANGED
|
@@ -41031,7 +41031,7 @@ function renderPlanTable(allChanges) {
|
|
|
41031
41031
|
const missing = Object.values(changeSet).reduce((s, c) => s + c.missing.length, 0);
|
|
41032
41032
|
const outdated = Object.values(changeSet).reduce((s, c) => s + c.outdated.length, 0);
|
|
41033
41033
|
table.push([
|
|
41034
|
-
kleur_default.white(
|
|
41034
|
+
kleur_default.white(formatTargetLabel(target)),
|
|
41035
41035
|
missing > 0 ? kleur_default.green(String(missing)) : t.label("\u2014"),
|
|
41036
41036
|
outdated > 0 ? kleur_default.yellow(String(outdated)) : t.label("\u2014"),
|
|
41037
41037
|
kleur_default.bold().white(String(totalChanges))
|
|
@@ -41060,6 +41060,12 @@ async function renderSummaryCard(allChanges, totalCount, allSkipped, isDryRun) {
|
|
|
41060
41060
|
}) + "\n");
|
|
41061
41061
|
}
|
|
41062
41062
|
var BEADS_HOOK_PATTERN = /^beads-/;
|
|
41063
|
+
function formatTargetLabel(target) {
|
|
41064
|
+
const normalized = target.replace(/\\/g, "/").toLowerCase();
|
|
41065
|
+
if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
|
|
41066
|
+
if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
|
|
41067
|
+
return import_path11.default.basename(target);
|
|
41068
|
+
}
|
|
41063
41069
|
function filterBeadsFromChangeSet(changeSet) {
|
|
41064
41070
|
return {
|
|
41065
41071
|
...changeSet,
|
|
@@ -41164,7 +41170,7 @@ async function runGlobalInstall(flags, installOpts = {}) {
|
|
|
41164
41170
|
}
|
|
41165
41171
|
const diffTasks = new Listr(
|
|
41166
41172
|
targets.map((target) => ({
|
|
41167
|
-
title:
|
|
41173
|
+
title: formatTargetLabel(target),
|
|
41168
41174
|
task: async (listCtx, task) => {
|
|
41169
41175
|
try {
|
|
41170
41176
|
let changeSet = await calculateDiff(repoRoot, target, false);
|
|
@@ -41179,13 +41185,13 @@ async function runGlobalInstall(flags, installOpts = {}) {
|
|
|
41179
41185
|
(sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
|
|
41180
41186
|
0
|
|
41181
41187
|
);
|
|
41182
|
-
task.title = `${
|
|
41188
|
+
task.title = `${formatTargetLabel(target)}${t.muted(` \u2014 ${totalChanges} change${totalChanges !== 1 ? "s" : ""}`)}`;
|
|
41183
41189
|
if (totalChanges > 0) {
|
|
41184
41190
|
listCtx.allChanges.push({ target, changeSet, totalChanges, skippedDrifted: [] });
|
|
41185
41191
|
}
|
|
41186
41192
|
} catch (err) {
|
|
41187
41193
|
if (err instanceof PruneModeReadError) {
|
|
41188
|
-
task.title = `${
|
|
41194
|
+
task.title = `${formatTargetLabel(target)} ${kleur_default.red("(skipped \u2014 cannot read in prune mode)")}`;
|
|
41189
41195
|
} else {
|
|
41190
41196
|
throw err;
|
|
41191
41197
|
}
|
|
@@ -41221,7 +41227,7 @@ async function runGlobalInstall(flags, installOpts = {}) {
|
|
|
41221
41227
|
let totalCount = 0;
|
|
41222
41228
|
for (const { target, changeSet, skippedDrifted } of allChanges) {
|
|
41223
41229
|
console.log(t.bold(`
|
|
41224
|
-
${sym.arrow} ${
|
|
41230
|
+
${sym.arrow} ${formatTargetLabel(target)}`));
|
|
41225
41231
|
const count = await executeSync(repoRoot, target, changeSet, syncMode, "sync", dryRun, void 0, {
|
|
41226
41232
|
skipMcp: noMcp,
|
|
41227
41233
|
force
|
|
@@ -41315,7 +41321,7 @@ function createInstallCommand() {
|
|
|
41315
41321
|
}
|
|
41316
41322
|
const diffTasks = new Listr(
|
|
41317
41323
|
targets.map((target) => ({
|
|
41318
|
-
title:
|
|
41324
|
+
title: formatTargetLabel(target),
|
|
41319
41325
|
task: async (listCtx, task) => {
|
|
41320
41326
|
try {
|
|
41321
41327
|
let changeSet = await calculateDiff(repoRoot, target, prune);
|
|
@@ -41332,13 +41338,13 @@ function createInstallCommand() {
|
|
|
41332
41338
|
(sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
|
|
41333
41339
|
0
|
|
41334
41340
|
);
|
|
41335
|
-
task.title = `${
|
|
41341
|
+
task.title = `${formatTargetLabel(target)}${t.muted(` \u2014 ${totalChanges} change${totalChanges !== 1 ? "s" : ""}`)}`;
|
|
41336
41342
|
if (totalChanges > 0) {
|
|
41337
41343
|
listCtx.allChanges.push({ target, changeSet, totalChanges, skippedDrifted: [] });
|
|
41338
41344
|
}
|
|
41339
41345
|
} catch (err) {
|
|
41340
41346
|
if (err instanceof PruneModeReadError) {
|
|
41341
|
-
task.title = `${
|
|
41347
|
+
task.title = `${formatTargetLabel(target)} ${kleur_default.red("(skipped \u2014 cannot read in prune mode)")}`;
|
|
41342
41348
|
} else {
|
|
41343
41349
|
throw err;
|
|
41344
41350
|
}
|
|
@@ -41360,7 +41366,7 @@ function createInstallCommand() {
|
|
|
41360
41366
|
};
|
|
41361
41367
|
for (const target of targets) {
|
|
41362
41368
|
console.log(t.bold(`
|
|
41363
|
-
${sym.arrow} ${
|
|
41369
|
+
${sym.arrow} ${formatTargetLabel(target)}`));
|
|
41364
41370
|
await executeSync(repoRoot, target, emptyChangeSet, syncMode, "sync", false);
|
|
41365
41371
|
}
|
|
41366
41372
|
}
|
|
@@ -41389,7 +41395,7 @@ function createInstallCommand() {
|
|
|
41389
41395
|
let totalCount = 0;
|
|
41390
41396
|
for (const { target, changeSet, skippedDrifted } of allChanges) {
|
|
41391
41397
|
console.log(t.bold(`
|
|
41392
|
-
${sym.arrow} ${
|
|
41398
|
+
${sym.arrow} ${formatTargetLabel(target)}`));
|
|
41393
41399
|
const count = await executeSync(repoRoot, target, changeSet, syncMode, syncType, dryRun);
|
|
41394
41400
|
totalCount += count;
|
|
41395
41401
|
for (const [category, cat] of Object.entries(changeSet)) {
|
|
@@ -55230,6 +55236,12 @@ function getManifestPath(projectDir) {
|
|
|
55230
55236
|
// src/commands/status.ts
|
|
55231
55237
|
var import_fs_extra12 = __toESM(require_lib2(), 1);
|
|
55232
55238
|
var import_path13 = __toESM(require("path"), 1);
|
|
55239
|
+
function formatTargetLabel2(target) {
|
|
55240
|
+
const normalized = target.replace(/\\/g, "/").toLowerCase();
|
|
55241
|
+
if (normalized.endsWith("/.agents/skills") || normalized.includes("/.agents/skills/")) return "~/.agents/skills";
|
|
55242
|
+
if (normalized.endsWith("/.claude") || normalized.includes("/.claude/")) return "~/.claude";
|
|
55243
|
+
return import_path13.default.basename(target);
|
|
55244
|
+
}
|
|
55233
55245
|
function formatRelativeTime(timestamp) {
|
|
55234
55246
|
const now = Date.now();
|
|
55235
55247
|
const diff = now - timestamp;
|
|
@@ -55270,7 +55282,7 @@ function createStatusCommand() {
|
|
|
55270
55282
|
(sum, c) => sum + c.missing.length + c.outdated.length + c.drifted.length,
|
|
55271
55283
|
0
|
|
55272
55284
|
);
|
|
55273
|
-
results.push({ path: target, name:
|
|
55285
|
+
results.push({ path: target, name: formatTargetLabel2(target), lastSync, changes: changeSet, totalChanges });
|
|
55274
55286
|
}
|
|
55275
55287
|
if (json2) {
|
|
55276
55288
|
console.log(JSON.stringify({ targets: results }, null, 2));
|
|
@@ -55380,6 +55392,32 @@ async function readSkillsFromDir(dir) {
|
|
|
55380
55392
|
}
|
|
55381
55393
|
return skills;
|
|
55382
55394
|
}
|
|
55395
|
+
async function readProjectSkillsFromDir(dir) {
|
|
55396
|
+
if (!await import_fs_extra13.default.pathExists(dir)) return [];
|
|
55397
|
+
const entries = await import_fs_extra13.default.readdir(dir);
|
|
55398
|
+
const skills = [];
|
|
55399
|
+
for (const name of entries.sort()) {
|
|
55400
|
+
const readme = import_path14.default.join(dir, name, "README.md");
|
|
55401
|
+
if (!await import_fs_extra13.default.pathExists(readme)) continue;
|
|
55402
|
+
const content = await import_fs_extra13.default.readFile(readme, "utf8");
|
|
55403
|
+
const descLine = content.split("\n").find((line) => {
|
|
55404
|
+
const trimmed = line.trim();
|
|
55405
|
+
return Boolean(trimmed) && !trimmed.startsWith("#") && !trimmed.startsWith("[") && !trimmed.startsWith("<");
|
|
55406
|
+
}) || "";
|
|
55407
|
+
skills.push({ name, desc: descLine.replace(/[*_`]/g, "").trim() });
|
|
55408
|
+
}
|
|
55409
|
+
return skills;
|
|
55410
|
+
}
|
|
55411
|
+
function resolvePkgRootFallback() {
|
|
55412
|
+
const candidates = [
|
|
55413
|
+
import_path14.default.resolve(__dirname, "../.."),
|
|
55414
|
+
import_path14.default.resolve(__dirname, "../../..")
|
|
55415
|
+
];
|
|
55416
|
+
const match = candidates.find(
|
|
55417
|
+
(candidate) => import_fs_extra13.default.existsSync(import_path14.default.join(candidate, "skills")) || import_fs_extra13.default.existsSync(import_path14.default.join(candidate, "project-skills"))
|
|
55418
|
+
);
|
|
55419
|
+
return match || null;
|
|
55420
|
+
}
|
|
55383
55421
|
function col(s, width) {
|
|
55384
55422
|
return s.length >= width ? s.slice(0, width - 1) + "\u2026" : s.padEnd(width);
|
|
55385
55423
|
}
|
|
@@ -55391,8 +55429,11 @@ function createHelpCommand() {
|
|
|
55391
55429
|
} catch {
|
|
55392
55430
|
repoRoot = "";
|
|
55393
55431
|
}
|
|
55394
|
-
const
|
|
55395
|
-
const
|
|
55432
|
+
const pkgRoot = resolvePkgRootFallback();
|
|
55433
|
+
const skillsRoot = repoRoot || pkgRoot || "";
|
|
55434
|
+
const projectSkillsRoot = repoRoot || pkgRoot || "";
|
|
55435
|
+
const skills = skillsRoot ? await readSkillsFromDir(import_path14.default.join(skillsRoot, "skills")) : [];
|
|
55436
|
+
const projectSkills = projectSkillsRoot ? await readProjectSkillsFromDir(import_path14.default.join(projectSkillsRoot, "project-skills")) : [];
|
|
55396
55437
|
const W = 80;
|
|
55397
55438
|
const hr = kleur_default.dim("-".repeat(W));
|
|
55398
55439
|
const section = (title) => `
|
|
@@ -55448,11 +55489,12 @@ ${hr}`;
|
|
|
55448
55489
|
(s) => ` ${kleur_default.white(col(s.name, 30))}${kleur_default.dim(s.desc)}`
|
|
55449
55490
|
).join("\n");
|
|
55450
55491
|
const psSection = [
|
|
55451
|
-
section("PROJECT SKILLS"),
|
|
55492
|
+
section("PROJECT SKILLS + HOOKS"),
|
|
55452
55493
|
"",
|
|
55453
|
-
projectSkills.length ? psRows : kleur_default.dim(" (none found)"),
|
|
55494
|
+
projectSkills.length ? psRows : kleur_default.dim(" (none found in package)"),
|
|
55454
55495
|
"",
|
|
55455
|
-
` ${kleur_default.dim("Install: xtrm install project <name> | xtrm install project list")}
|
|
55496
|
+
` ${kleur_default.dim("Install: xtrm install project <name> | xtrm install project list")}`,
|
|
55497
|
+
` ${kleur_default.dim("Each project skill can install .claude/skills plus project hooks/settings.")}`
|
|
55456
55498
|
].join("\n");
|
|
55457
55499
|
const otherSection = [
|
|
55458
55500
|
section("OTHER COMMANDS"),
|