create-egregore 0.19.15 → 0.19.16
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/assets/egregore-launcher.js +44 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// egregore-launcher-version: 0.19.
|
|
2
|
+
// egregore-launcher-version: 0.19.16
|
|
3
3
|
//
|
|
4
4
|
// egregore — launch and browse Egregore instances from your terminal.
|
|
5
5
|
// Installed by create-egregore. Reads ~/.egregore/instances.json.
|
|
@@ -33,7 +33,7 @@ const crypto = require("node:crypto");
|
|
|
33
33
|
const { spawnSync, spawn } = require("node:child_process");
|
|
34
34
|
const readline = require("node:readline");
|
|
35
35
|
|
|
36
|
-
const VERSION = "0.19.
|
|
36
|
+
const VERSION = "0.19.16";
|
|
37
37
|
const REGISTRY = path.join(os.homedir(), ".egregore", "instances.json");
|
|
38
38
|
const DEFAULT_FILE = path.join(os.homedir(), ".egregore", "default");
|
|
39
39
|
const UPDATE_CACHE_FILE = path.join(os.homedir(), ".egregore", "update-check.json");
|
|
@@ -1241,6 +1241,43 @@ function sleep(ms) {
|
|
|
1241
1241
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1242
1242
|
}
|
|
1243
1243
|
|
|
1244
|
+
function backfillCount(summary, key) {
|
|
1245
|
+
const value = Number(summary?.[key]);
|
|
1246
|
+
return Number.isInteger(value) && value >= 0 ? value : null;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
function backfillCountLabel(count, singular, plural) {
|
|
1250
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
function backfillSummaryLines(summary) {
|
|
1254
|
+
const sessions = backfillCount(summary, "sessions");
|
|
1255
|
+
const artifacts = backfillCount(summary, "artifacts");
|
|
1256
|
+
const quests = backfillCount(summary, "quests");
|
|
1257
|
+
const resolved = backfillCount(summary, "resolved");
|
|
1258
|
+
const ingestManifests = backfillCount(summary, "ingest_manifests");
|
|
1259
|
+
const lines = [];
|
|
1260
|
+
|
|
1261
|
+
if (sessions !== null && artifacts !== null && quests !== null) {
|
|
1262
|
+
if (sessions + artifacts + quests === 0) {
|
|
1263
|
+
lines.push("Graph already contained all sessions, artifacts, and quests");
|
|
1264
|
+
} else {
|
|
1265
|
+
lines.push(`Added ${[
|
|
1266
|
+
backfillCountLabel(sessions, "session", "sessions"),
|
|
1267
|
+
backfillCountLabel(artifacts, "artifact", "artifacts"),
|
|
1268
|
+
backfillCountLabel(quests, "quest", "quests"),
|
|
1269
|
+
].join(" · ")}`);
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
if (ingestManifests > 0) {
|
|
1273
|
+
lines.push(`Replayed ${backfillCountLabel(ingestManifests, "ingest manifest", "ingest manifests")}`);
|
|
1274
|
+
}
|
|
1275
|
+
if (resolved > 0) {
|
|
1276
|
+
lines.push(`Resolved ${backfillCountLabel(resolved, "handoff", "handoffs")}`);
|
|
1277
|
+
}
|
|
1278
|
+
return lines;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1244
1281
|
async function cmdConnect(args) {
|
|
1245
1282
|
const registry = readRegistry();
|
|
1246
1283
|
if (registry.length === 0) die("no egregores installed yet.\n run: npx -y create-egregore@latest");
|
|
@@ -1405,6 +1442,8 @@ async function cmdConnect(args) {
|
|
|
1405
1442
|
if (!fs.existsSync(syncScript)) {
|
|
1406
1443
|
die("bin/sync-graph.sh is missing. Update the installed Egregore version, then run egregore connect again.");
|
|
1407
1444
|
}
|
|
1445
|
+
console.log(` [5/5] ${CYAN}◦${RESET} Projecting existing memory into the graph…`);
|
|
1446
|
+
console.log(` ${DIM}Scanning sessions, artifacts, quests, and ingest history${RESET}`);
|
|
1408
1447
|
const sync = spawnSync("bash", [syncScript], {
|
|
1409
1448
|
cwd: inst.path,
|
|
1410
1449
|
encoding: "utf-8",
|
|
@@ -1438,6 +1477,9 @@ async function cmdConnect(args) {
|
|
|
1438
1477
|
backfill_summary: backfillSummary,
|
|
1439
1478
|
});
|
|
1440
1479
|
console.log(` [5/5] ${GREEN}✓${RESET} Existing memory projected into the graph`);
|
|
1480
|
+
for (const line of backfillSummaryLines(backfillSummary)) {
|
|
1481
|
+
console.log(` ${DIM}${line}${RESET}`);
|
|
1482
|
+
}
|
|
1441
1483
|
console.log("");
|
|
1442
1484
|
console.log(` ${GREEN}✓${RESET} ${BOLD}${inst.slug}${RESET} is connected. Local files remain the source of truth.`);
|
|
1443
1485
|
console.log("");
|
package/package.json
CHANGED