@arkhera30/cli 0.3.9 → 0.3.11
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 +59 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,8 +54,12 @@ var DEFAULT_PORTS = {
|
|
|
54
54
|
ui: 8400,
|
|
55
55
|
// horus-ui — user-facing web interface
|
|
56
56
|
forge: 8200,
|
|
57
|
-
typesense: 8108
|
|
57
|
+
typesense: 8108,
|
|
58
58
|
// Typesense search engine
|
|
59
|
+
neo4j_http: 7474,
|
|
60
|
+
// Neo4j Browser / HTTP API
|
|
61
|
+
neo4j_bolt: 7687
|
|
62
|
+
// Neo4j Bolt protocol
|
|
59
63
|
};
|
|
60
64
|
var DEFAULT_DATA_DIR = join(homedir(), "Horus", "data");
|
|
61
65
|
var SERVICES = [
|
|
@@ -65,7 +69,8 @@ var SERVICES = [
|
|
|
65
69
|
"vault-mcp",
|
|
66
70
|
"forge",
|
|
67
71
|
"horus-ui",
|
|
68
|
-
"typesense"
|
|
72
|
+
"typesense",
|
|
73
|
+
"neo4j"
|
|
69
74
|
];
|
|
70
75
|
var CONFIG_VERSION = "1.0";
|
|
71
76
|
|
|
@@ -135,7 +140,9 @@ function buildConfigFromParsed(parsed) {
|
|
|
135
140
|
vault_mcp: parsedPorts?.vault_mcp ?? defaults.ports.vault_mcp,
|
|
136
141
|
vault_router: parsedPorts?.vault_router ?? defaults.ports.vault_router,
|
|
137
142
|
forge: parsedPorts?.forge ?? defaults.ports.forge,
|
|
138
|
-
typesense: parsedPorts?.typesense ?? defaults.ports.typesense
|
|
143
|
+
typesense: parsedPorts?.typesense ?? defaults.ports.typesense,
|
|
144
|
+
neo4j_http: parsedPorts?.neo4j_http ?? defaults.ports.neo4j_http,
|
|
145
|
+
neo4j_bolt: parsedPorts?.neo4j_bolt ?? defaults.ports.neo4j_bolt
|
|
139
146
|
},
|
|
140
147
|
repos: {
|
|
141
148
|
anvil_notes: repos?.anvil_notes ?? defaults.repos.anvil_notes,
|
|
@@ -649,7 +656,9 @@ var FORGE_SERVICE = ` # \u2500\u2500 Forge \u2500\u2500\u2500\u2500\u2500\u2500
|
|
|
649
656
|
- FORGE_ANVIL_URL=http://anvil:8100
|
|
650
657
|
- FORGE_VAULT_URL=http://vault-mcp:8300
|
|
651
658
|
- FORGE_HOST_WORKSPACES_PATH=\${HORUS_DATA_PATH}/workspaces
|
|
659
|
+
- FORGE_HOST_MANAGED_REPOS_PATH=\${HORUS_DATA_PATH}/repos
|
|
652
660
|
- FORGE_HOST_REPOS_PATH=\${HOST_REPOS_PATH}
|
|
661
|
+
- FORGE_HOST_MANAGED_REPOS_PATH=\${HORUS_DATA_PATH}/repos
|
|
653
662
|
- FORGE_HOST_ANVIL_URL=http://localhost:\${ANVIL_PORT:-8100}
|
|
654
663
|
- FORGE_HOST_VAULT_URL=http://localhost:\${VAULT_MCP_PORT:-8300}
|
|
655
664
|
- FORGE_HOST_FORGE_URL=http://localhost:\${FORGE_PORT:-8200}
|
|
@@ -1431,7 +1440,9 @@ var setupCommand = new Command2("setup").description("Interactive first-run setu
|
|
|
1431
1440
|
vault_mcp: vault_mcp ?? DEFAULT_PORTS.vault_mcp,
|
|
1432
1441
|
vault_router: vault_router ?? DEFAULT_PORTS.vault_router,
|
|
1433
1442
|
forge: forge ?? DEFAULT_PORTS.forge,
|
|
1434
|
-
typesense: DEFAULT_PORTS.typesense
|
|
1443
|
+
typesense: DEFAULT_PORTS.typesense,
|
|
1444
|
+
neo4j_http: DEFAULT_PORTS.neo4j_http,
|
|
1445
|
+
neo4j_bolt: DEFAULT_PORTS.neo4j_bolt
|
|
1435
1446
|
};
|
|
1436
1447
|
}
|
|
1437
1448
|
console.log("");
|
|
@@ -2478,6 +2489,45 @@ async function checkServices(runtime) {
|
|
|
2478
2489
|
}
|
|
2479
2490
|
return results;
|
|
2480
2491
|
}
|
|
2492
|
+
async function checkSyncHealth(serviceName, ports) {
|
|
2493
|
+
const portMap = { anvil: ports.anvil, forge: ports.forge };
|
|
2494
|
+
const port = portMap[serviceName];
|
|
2495
|
+
const url = `http://localhost:${port}/health`;
|
|
2496
|
+
try {
|
|
2497
|
+
const resp = await fetch(url, { signal: AbortSignal.timeout(3e3) });
|
|
2498
|
+
const body = await resp.json();
|
|
2499
|
+
const sync = body.sync;
|
|
2500
|
+
if (resp.status === 503 || body.status === "degraded") {
|
|
2501
|
+
const failures = sync?.consecutive_failures ?? "?";
|
|
2502
|
+
const lastError = typeof sync?.last_error === "string" ? sync.last_error : "unknown";
|
|
2503
|
+
const ahead = sync?.ahead ?? "?";
|
|
2504
|
+
const behind = sync?.behind ?? "?";
|
|
2505
|
+
return {
|
|
2506
|
+
status: "fail",
|
|
2507
|
+
label: `Sync: ${serviceName}`,
|
|
2508
|
+
message: `${serviceName} git sync is stuck (${failures} consecutive failures, ${ahead} ahead / ${behind} behind): ${lastError}`,
|
|
2509
|
+
hint: `Run: horus logs ${serviceName} \u2014 or manually: cd ~/Horus/data/${serviceName === "forge" ? "registry" : "notes"} && git reset --hard origin/master`
|
|
2510
|
+
};
|
|
2511
|
+
}
|
|
2512
|
+
if (sync && sync.ok === false) {
|
|
2513
|
+
const failures = sync.consecutive_failures ?? 1;
|
|
2514
|
+
return {
|
|
2515
|
+
status: "warn",
|
|
2516
|
+
label: `Sync: ${serviceName}`,
|
|
2517
|
+
message: `${serviceName} git sync had a recent failure (${failures} consecutive) \u2014 not yet stuck`,
|
|
2518
|
+
hint: `Run: horus logs ${serviceName}`
|
|
2519
|
+
};
|
|
2520
|
+
}
|
|
2521
|
+
return { status: "pass", label: `Sync: ${serviceName}`, message: `${serviceName} git sync healthy` };
|
|
2522
|
+
} catch {
|
|
2523
|
+
return {
|
|
2524
|
+
status: "warn",
|
|
2525
|
+
label: `Sync: ${serviceName}`,
|
|
2526
|
+
message: `${serviceName} health endpoint not reachable \u2014 sync status unknown`,
|
|
2527
|
+
hint: "Service may not be running"
|
|
2528
|
+
};
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2481
2531
|
var doctorCommand = new Command8("doctor").description("Diagnose common Horus issues").action(async () => {
|
|
2482
2532
|
console.log("");
|
|
2483
2533
|
console.log(chalk8.bold("Horus Doctor"));
|
|
@@ -2511,6 +2561,11 @@ var doctorCommand = new Command8("doctor").description("Diagnose common Horus is
|
|
|
2511
2561
|
});
|
|
2512
2562
|
}
|
|
2513
2563
|
}
|
|
2564
|
+
const [anvilSync, forgeSync] = await Promise.all([
|
|
2565
|
+
checkSyncHealth("anvil", ports),
|
|
2566
|
+
checkSyncHealth("forge", ports)
|
|
2567
|
+
]);
|
|
2568
|
+
allResults.push(anvilSync, forgeSync);
|
|
2514
2569
|
for (const result of allResults) {
|
|
2515
2570
|
console.log(`${symbol(result.status)}${colorMessage(result.status, result.message)}`);
|
|
2516
2571
|
}
|