xtrm-tools 0.5.44 → 0.5.45
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
CHANGED
|
@@ -57743,7 +57743,7 @@ function createMemoryCommand() {
|
|
|
57743
57743
|
return new Command("memory").description("Manage project memory (.xtrm/memory.md)").addCommand(createMemoryUpdateCommand());
|
|
57744
57744
|
}
|
|
57745
57745
|
function createMemoryUpdateCommand() {
|
|
57746
|
-
return new Command("update").description("Run memory-processor specialist to synthesize bd memories into .xtrm/memory.md").option("--dry-run", "Report only \u2014 do not modify memories or write memory.md", false).option("--no-beads", "Skip creating a tracking bead for this run", false).action((opts) => {
|
|
57746
|
+
return new Command("update").description("Run memory-processor specialist to synthesize bd memories into .xtrm/memory.md").option("--dry-run", "Report only \u2014 do not modify memories or write memory.md", false).option("--no-beads", "Skip creating a tracking bead for this run", false).action(async (opts) => {
|
|
57747
57747
|
const cwd = process.cwd();
|
|
57748
57748
|
const check2 = (0, import_node_child_process12.spawnSync)("specialists", ["--version"], { encoding: "utf8", stdio: "pipe" });
|
|
57749
57749
|
if (check2.status !== 0) {
|
|
@@ -57768,17 +57768,28 @@ function createMemoryUpdateCommand() {
|
|
|
57768
57768
|
const prompt = opts.dryRun ? "Dry run: classify all memories and show the full report. Do not call bd forget or write .xtrm/memory.md." : "Run the full memory processor workflow.";
|
|
57769
57769
|
const args = ["run", "memory-processor", "--prompt", prompt];
|
|
57770
57770
|
if (!opts.beads) args.push("--no-beads");
|
|
57771
|
+
const memPath = (0, import_node_path7.join)(cwd, ".xtrm", "memory.md");
|
|
57772
|
+
const spinnerText = opts.dryRun ? "Analyzing memories..." : `${(0, import_node_fs6.existsSync)(memPath) ? "Updating" : "Creating"} .xtrm/memory.md...`;
|
|
57771
57773
|
console.log(kleur_default.bold(`
|
|
57772
57774
|
xt memory update${opts.dryRun ? " (dry run)" : ""}
|
|
57773
57775
|
`));
|
|
57774
|
-
|
|
57775
|
-
|
|
57776
|
-
|
|
57777
|
-
|
|
57778
|
-
|
|
57776
|
+
const spinner = ora({ text: spinnerText, color: "cyan" }).start();
|
|
57777
|
+
const chunks = [];
|
|
57778
|
+
const exitCode = await new Promise((resolve2) => {
|
|
57779
|
+
const proc = (0, import_node_child_process12.spawn)("specialists", args, { cwd, stdio: ["inherit", "pipe", "pipe"] });
|
|
57780
|
+
proc.stdout.on("data", (d) => chunks.push(d.toString()));
|
|
57781
|
+
proc.stderr.on("data", (d) => chunks.push(d.toString()));
|
|
57782
|
+
proc.on("close", (code) => resolve2(code ?? 0));
|
|
57783
|
+
});
|
|
57784
|
+
if (exitCode === 0) {
|
|
57785
|
+
spinner.succeed(opts.dryRun ? "Analysis complete." : ".xtrm/memory.md written.");
|
|
57786
|
+
} else {
|
|
57787
|
+
spinner.fail("memory-processor failed.");
|
|
57779
57788
|
}
|
|
57780
|
-
const
|
|
57781
|
-
|
|
57789
|
+
const lines = chunks.join("").split("\n").filter((l) => l.trim());
|
|
57790
|
+
const tail = lines.slice(-10).map((l) => kleur_default.dim(" " + l)).join("\n");
|
|
57791
|
+
if (tail) console.log("\n" + tail + "\n");
|
|
57792
|
+
process.exit(exitCode);
|
|
57782
57793
|
});
|
|
57783
57794
|
}
|
|
57784
57795
|
|