amalfa 1.0.11 → 1.0.12
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/package.json +1 -1
- package/src/cli.ts +30 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amalfa",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Local-first knowledge graph engine for AI agents. Transforms markdown into searchable memory with MCP protocol.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/pjsvis/amalfa#readme",
|
package/src/cli.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, statSync } from "node:fs";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
|
|
6
|
-
const VERSION = "1.0.
|
|
6
|
+
const VERSION = "1.0.12";
|
|
7
7
|
|
|
8
8
|
// Database path loaded from config (lazy loaded per command)
|
|
9
9
|
let DB_PATH: string | null = null;
|
|
@@ -26,6 +26,7 @@ Commands:
|
|
|
26
26
|
doctor Check installation and configuration
|
|
27
27
|
setup-mcp Generate MCP configuration JSON
|
|
28
28
|
daemon <action> Manage file watcher (start|stop|status|restart)
|
|
29
|
+
vector <action> Manage vector daemon (start|stop|status|restart)
|
|
29
30
|
servers [--dot] Show status of all AMALFA services (--dot for graph)
|
|
30
31
|
|
|
31
32
|
Options:
|
|
@@ -267,6 +268,28 @@ async function cmdDaemon() {
|
|
|
267
268
|
});
|
|
268
269
|
}
|
|
269
270
|
|
|
271
|
+
async function cmdVector() {
|
|
272
|
+
const action = args[1] || "status";
|
|
273
|
+
const validActions = ["start", "stop", "status", "restart"];
|
|
274
|
+
|
|
275
|
+
if (!validActions.includes(action)) {
|
|
276
|
+
console.error(`❌ Invalid action: ${action}`);
|
|
277
|
+
console.error("\nUsage: amalfa vector <start|stop|status|restart>");
|
|
278
|
+
process.exit(1);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Run vector daemon with the specified action
|
|
282
|
+
const vectorPath = join(import.meta.dir, "resonance/services/vector-daemon.ts");
|
|
283
|
+
const proc = spawn("bun", ["run", vectorPath, action], {
|
|
284
|
+
stdio: "inherit",
|
|
285
|
+
cwd: process.cwd(),
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
proc.on("exit", (code) => {
|
|
289
|
+
process.exit(code ?? 0);
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
270
293
|
async function cmdSetupMcp() {
|
|
271
294
|
const { resolve } = await import("node:path");
|
|
272
295
|
|
|
@@ -321,7 +344,7 @@ async function cmdServers() {
|
|
|
321
344
|
|
|
322
345
|
const SERVICES = [
|
|
323
346
|
{ name: "MCP Server", pidFile: ".mcp.pid", port: "stdio", id: "mcp", cmd: "amalfa serve" },
|
|
324
|
-
{ name: "Vector Daemon", pidFile: ".vector-daemon.pid", port: "3010", id: "vector", cmd: "
|
|
347
|
+
{ name: "Vector Daemon", pidFile: ".vector-daemon.pid", port: "3010", id: "vector", cmd: "amalfa vector start" },
|
|
325
348
|
{ name: "File Watcher", pidFile: ".amalfa-daemon.pid", port: "-", id: "watcher", cmd: "amalfa daemon start" },
|
|
326
349
|
];
|
|
327
350
|
|
|
@@ -435,7 +458,7 @@ async function cmdServers() {
|
|
|
435
458
|
}
|
|
436
459
|
|
|
437
460
|
console.log("─".repeat(95));
|
|
438
|
-
console.log("\n💡 Commands: amalfa serve | amalfa
|
|
461
|
+
console.log("\n💡 Commands: amalfa serve | amalfa vector start | amalfa daemon start\n");
|
|
439
462
|
}
|
|
440
463
|
|
|
441
464
|
async function cmdDoctor() {
|
|
@@ -539,6 +562,10 @@ async function main() {
|
|
|
539
562
|
await cmdDaemon();
|
|
540
563
|
break;
|
|
541
564
|
|
|
565
|
+
case "vector":
|
|
566
|
+
await cmdVector();
|
|
567
|
+
break;
|
|
568
|
+
|
|
542
569
|
case "setup-mcp":
|
|
543
570
|
await cmdSetupMcp();
|
|
544
571
|
break;
|