@xera-ai/cli 0.11.0 → 0.11.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/dist/index.js +20 -8
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -529,7 +529,7 @@ import {
|
|
|
529
529
|
writeFileSync as writeFileSync3
|
|
530
530
|
} from "fs";
|
|
531
531
|
import { createRequire as createRequire2 } from "module";
|
|
532
|
-
import { join as join4 } from "path";
|
|
532
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
533
533
|
import * as p2 from "@clack/prompts";
|
|
534
534
|
import pc3 from "picocolors";
|
|
535
535
|
var require3 = createRequire2(import.meta.url);
|
|
@@ -558,6 +558,7 @@ async function initUpdateCommand(_opts) {
|
|
|
558
558
|
pkg.scripts["xera:graph-backfill"] = "xera-internal graph-backfill";
|
|
559
559
|
pkg.scripts["xera:graph-enrich"] = "xera-internal graph-enrich";
|
|
560
560
|
pkg.scripts["xera:graph-render"] = "xera-internal graph-render";
|
|
561
|
+
pkg.scripts["xera:coverage-prepare"] = "xera-internal coverage-prepare";
|
|
561
562
|
pkg.scripts["xera:impact-prepare"] = "xera-internal impact-prepare";
|
|
562
563
|
pkg.scripts["xera:heal-prepare"] = "xera-internal heal-prepare";
|
|
563
564
|
pkg.scripts["xera:disputes"] = "xera-internal disputes";
|
|
@@ -574,19 +575,27 @@ async function initUpdateCommand(_opts) {
|
|
|
574
575
|
}
|
|
575
576
|
const skillsSrc = require3.resolve("@xera-ai/skills/package.json");
|
|
576
577
|
const newSkillsDir = join4(skillsSrc, "..");
|
|
577
|
-
const
|
|
578
|
+
const targetDirs = [join4(cwd, ".claude/skills"), join4(cwd, ".claude/commands")];
|
|
578
579
|
for (const name of readdirSync2(newSkillsDir)) {
|
|
579
580
|
if (!name.endsWith(".md"))
|
|
580
581
|
continue;
|
|
581
582
|
const newContent = readFileSync4(join4(newSkillsDir, name), "utf8");
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
583
|
+
const localStates = targetDirs.map((dir) => {
|
|
584
|
+
const path = join4(dir, name);
|
|
585
|
+
if (!existsSync4(path))
|
|
586
|
+
return { path, state: "missing" };
|
|
587
|
+
const content = readFileSync4(path, "utf8");
|
|
588
|
+
return { path, state: content === newContent ? "same" : "diff" };
|
|
589
|
+
});
|
|
590
|
+
if (localStates.every((s) => s.state === "missing")) {
|
|
591
|
+
for (const { path } of localStates) {
|
|
592
|
+
mkdirSync2(dirname2(path), { recursive: true });
|
|
593
|
+
writeFileSync3(path, newContent);
|
|
594
|
+
}
|
|
585
595
|
p2.log.info(`+ ${name}`);
|
|
586
596
|
continue;
|
|
587
597
|
}
|
|
588
|
-
|
|
589
|
-
if (localContent === newContent) {
|
|
598
|
+
if (localStates.every((s) => s.state === "same")) {
|
|
590
599
|
p2.log.info(`= ${name}`);
|
|
591
600
|
continue;
|
|
592
601
|
}
|
|
@@ -598,7 +607,10 @@ async function initUpdateCommand(_opts) {
|
|
|
598
607
|
]
|
|
599
608
|
});
|
|
600
609
|
if (choice === "overwrite") {
|
|
601
|
-
|
|
610
|
+
for (const { path } of localStates) {
|
|
611
|
+
mkdirSync2(dirname2(path), { recursive: true });
|
|
612
|
+
writeFileSync3(path, newContent);
|
|
613
|
+
}
|
|
602
614
|
p2.log.success(`overwrote ${name}`);
|
|
603
615
|
} else {
|
|
604
616
|
p2.log.warn(`kept local ${name}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xera-ai/cli",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"xera": "./bin/xera"
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"typecheck": "tsc --noEmit"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@xera-ai/core": "^0.11.
|
|
19
|
-
"@xera-ai/skills": "^0.11.
|
|
18
|
+
"@xera-ai/core": "^0.11.2",
|
|
19
|
+
"@xera-ai/skills": "^0.11.2",
|
|
20
20
|
"@clack/prompts": "1.4.0",
|
|
21
21
|
"cac": "7.0.0",
|
|
22
22
|
"picocolors": "1.1.1"
|