amalfa 1.0.10 ā 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/README.md +14 -4
- package/package.json +8 -7
- package/src/cli.ts +37 -8
package/README.md
CHANGED
|
@@ -270,20 +270,30 @@ bun run dev
|
|
|
270
270
|
### Commands
|
|
271
271
|
|
|
272
272
|
```bash
|
|
273
|
-
# CLI commands (
|
|
273
|
+
# CLI commands (after global install: bun install -g amalfa)
|
|
274
274
|
amalfa init # Initialize database from markdown
|
|
275
275
|
amalfa serve # Start MCP server (stdio)
|
|
276
276
|
amalfa stats # Show database statistics
|
|
277
277
|
amalfa doctor # Health check
|
|
278
|
-
amalfa servers # Show all service status
|
|
278
|
+
amalfa servers # Show all service status (with commands!)
|
|
279
|
+
amalfa servers --dot # Generate DOT diagram
|
|
279
280
|
amalfa daemon start # Start file watcher daemon
|
|
280
281
|
amalfa daemon stop # Stop file watcher daemon
|
|
281
282
|
amalfa daemon status # Check daemon status
|
|
282
283
|
amalfa setup-mcp # Generate MCP config
|
|
284
|
+
amalfa --help # Show help
|
|
283
285
|
|
|
284
|
-
#
|
|
286
|
+
# Local development scripts (bun run <script>)
|
|
287
|
+
bun run servers # Test servers command
|
|
288
|
+
bun run servers:dot # Test DOT diagram
|
|
289
|
+
bun run stats # Test stats
|
|
290
|
+
bun run doctor # Test doctor
|
|
291
|
+
bun run help # Show CLI help
|
|
292
|
+
|
|
293
|
+
# Code quality
|
|
285
294
|
bun test # Run tests
|
|
286
|
-
bun run
|
|
295
|
+
bun run check # Biome check
|
|
296
|
+
bun run format # Biome format
|
|
287
297
|
```
|
|
288
298
|
|
|
289
299
|
---
|
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",
|
|
@@ -44,12 +44,13 @@
|
|
|
44
44
|
"precommit": "bun run scripts/maintenance/pre-commit.ts",
|
|
45
45
|
"check": "biome check .",
|
|
46
46
|
"format": "biome format --write .",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
47
|
+
"amalfa": "bun run src/cli.ts",
|
|
48
|
+
"servers": "bun run src/cli.ts servers",
|
|
49
|
+
"servers:dot": "bun run src/cli.ts servers --dot",
|
|
50
|
+
"stats": "bun run src/cli.ts stats",
|
|
51
|
+
"doctor": "bun run src/cli.ts doctor",
|
|
52
|
+
"daemon": "bun run src/cli.ts daemon status",
|
|
53
|
+
"help": "bun run src/cli.ts --help"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
56
|
"@modelcontextprotocol/sdk": "1.25.0",
|
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
|
|
|
@@ -320,9 +343,9 @@ async function cmdServers() {
|
|
|
320
343
|
const showDot = args.includes("--dot");
|
|
321
344
|
|
|
322
345
|
const SERVICES = [
|
|
323
|
-
{ name: "MCP Server", pidFile: ".mcp.pid", port: "stdio", id: "mcp" },
|
|
324
|
-
{ name: "Vector Daemon", pidFile: ".vector-daemon.pid", port: "3010", id: "vector" },
|
|
325
|
-
{ name: "File Watcher", pidFile: ".amalfa-daemon.pid", port: "-", id: "watcher" },
|
|
346
|
+
{ name: "MCP Server", pidFile: ".mcp.pid", port: "stdio", id: "mcp", cmd: "amalfa serve" },
|
|
347
|
+
{ name: "Vector Daemon", pidFile: ".vector-daemon.pid", port: "3010", id: "vector", cmd: "amalfa vector start" },
|
|
348
|
+
{ name: "File Watcher", pidFile: ".amalfa-daemon.pid", port: "-", id: "watcher", cmd: "amalfa daemon start" },
|
|
326
349
|
];
|
|
327
350
|
|
|
328
351
|
async function isRunning(pid: number): Promise<boolean> {
|
|
@@ -393,14 +416,15 @@ async function cmdServers() {
|
|
|
393
416
|
}
|
|
394
417
|
|
|
395
418
|
console.log("\nš” AMALFA Service Status\n");
|
|
396
|
-
console.log("ā".repeat(
|
|
419
|
+
console.log("ā".repeat(95));
|
|
397
420
|
console.log(
|
|
398
421
|
"SERVICE".padEnd(18) +
|
|
422
|
+
"COMMAND".padEnd(25) +
|
|
399
423
|
"PORT".padEnd(12) +
|
|
400
424
|
"STATUS".padEnd(15) +
|
|
401
425
|
"PID".padEnd(10)
|
|
402
426
|
);
|
|
403
|
-
console.log("ā".repeat(
|
|
427
|
+
console.log("ā".repeat(95));
|
|
404
428
|
|
|
405
429
|
for (const svc of SERVICES) {
|
|
406
430
|
const { readFileSync } = await import("node:fs");
|
|
@@ -426,14 +450,15 @@ async function cmdServers() {
|
|
|
426
450
|
|
|
427
451
|
console.log(
|
|
428
452
|
svc.name.padEnd(18) +
|
|
453
|
+
svc.cmd.padEnd(25) +
|
|
429
454
|
svc.port.padEnd(12) +
|
|
430
455
|
status.padEnd(15) +
|
|
431
456
|
pidStr.padEnd(10)
|
|
432
457
|
);
|
|
433
458
|
}
|
|
434
459
|
|
|
435
|
-
console.log("ā".repeat(
|
|
436
|
-
console.log("\nš”
|
|
460
|
+
console.log("ā".repeat(95));
|
|
461
|
+
console.log("\nš” Commands: amalfa serve | amalfa vector start | amalfa daemon start\n");
|
|
437
462
|
}
|
|
438
463
|
|
|
439
464
|
async function cmdDoctor() {
|
|
@@ -537,6 +562,10 @@ async function main() {
|
|
|
537
562
|
await cmdDaemon();
|
|
538
563
|
break;
|
|
539
564
|
|
|
565
|
+
case "vector":
|
|
566
|
+
await cmdVector();
|
|
567
|
+
break;
|
|
568
|
+
|
|
540
569
|
case "setup-mcp":
|
|
541
570
|
await cmdSetupMcp();
|
|
542
571
|
break;
|