amalfa 1.0.30 → 1.0.31
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 +3 -3
- package/src/cli.ts +21 -0
- package/tsconfig.json +48 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amalfa",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
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",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"type": "module",
|
|
17
17
|
"files": [
|
|
18
18
|
"src",
|
|
19
|
+
"tsconfig.json",
|
|
19
20
|
"README.md",
|
|
20
21
|
"LICENSE"
|
|
21
22
|
],
|
|
@@ -58,8 +59,7 @@
|
|
|
58
59
|
"stats": "bun run src/cli.ts stats",
|
|
59
60
|
"doctor": "bun run src/cli.ts doctor",
|
|
60
61
|
"daemon": "bun run src/cli.ts daemon status",
|
|
61
|
-
"help": "bun run src/cli.ts --help"
|
|
62
|
-
"publish": "npm publish"
|
|
62
|
+
"help": "bun run src/cli.ts --help"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@modelcontextprotocol/sdk": "1.25.2",
|
package/src/cli.ts
CHANGED
|
@@ -13,6 +13,26 @@ let DB_PATH: string | null = null;
|
|
|
13
13
|
const args = process.argv.slice(2);
|
|
14
14
|
const command = args[0];
|
|
15
15
|
|
|
16
|
+
// FIX: If running from system root (common in some MCP clients), try to find project root
|
|
17
|
+
if (process.cwd() === "/") {
|
|
18
|
+
const { resolve, join } = await import("node:path");
|
|
19
|
+
const { existsSync } = await import("node:fs");
|
|
20
|
+
|
|
21
|
+
// Try to find package.json relative to this script
|
|
22
|
+
// src/cli.ts -> .. -> project root
|
|
23
|
+
const scriptBasedRoot = resolve(import.meta.dir, "..");
|
|
24
|
+
if (existsSync(join(scriptBasedRoot, "package.json"))) {
|
|
25
|
+
try {
|
|
26
|
+
console.error(
|
|
27
|
+
`⚠️ Detected CWD as system root. Switching to: ${scriptBasedRoot}`,
|
|
28
|
+
);
|
|
29
|
+
process.chdir(scriptBasedRoot);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.error("Failed to switch CWD:", e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
16
36
|
function showHelp() {
|
|
17
37
|
console.log(`
|
|
18
38
|
AMALFA v${VERSION} - A Memory Layer For Agents
|
|
@@ -69,6 +89,7 @@ async function checkDatabase(): Promise<boolean> {
|
|
|
69
89
|
if (!existsSync(dbPath)) {
|
|
70
90
|
console.error(`
|
|
71
91
|
❌ Database not found at: ${dbPath}
|
|
92
|
+
(CWD: ${process.cwd()})
|
|
72
93
|
|
|
73
94
|
To initialize AMALFA:
|
|
74
95
|
1. Create markdown files in ./docs/ (or your preferred location)
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Best practices
|
|
18
|
+
"strict": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"noImplicitOverride": true,
|
|
23
|
+
|
|
24
|
+
// Some stricter flags (disabled by default)
|
|
25
|
+
"noUnusedLocals": false,
|
|
26
|
+
"noUnusedParameters": false,
|
|
27
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
28
|
+
"baseUrl": ".",
|
|
29
|
+
"paths": {
|
|
30
|
+
"@src/*": ["./src/*"],
|
|
31
|
+
"@scripts/*": ["./scripts/*"],
|
|
32
|
+
"@resonance/*": ["./src/resonance/*"],
|
|
33
|
+
"@/*": ["./*"]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"exclude": [
|
|
37
|
+
"public/docs",
|
|
38
|
+
"docs/webdocs",
|
|
39
|
+
"node_modules",
|
|
40
|
+
"dist",
|
|
41
|
+
".resonance",
|
|
42
|
+
"briefs",
|
|
43
|
+
"examples",
|
|
44
|
+
"experiments",
|
|
45
|
+
"scripts/lab",
|
|
46
|
+
"scripts/legacy"
|
|
47
|
+
]
|
|
48
|
+
}
|