pi-nocturne-memory 1.0.12 → 1.0.13
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/extensions/index.ts +20 -4
- package/package.json +1 -1
- package/config.json +0 -3
package/extensions/index.ts
CHANGED
|
@@ -8,21 +8,37 @@ import { homedir } from "node:os";
|
|
|
8
8
|
const CONFIG_PATH = join(homedir(), ".pi", "agent", "extensions", "pi-nocturne-memory", "config.json");
|
|
9
9
|
|
|
10
10
|
function loadConfig(): { mcpUrl?: string; mcpAuth?: string } {
|
|
11
|
+
const env = process.env;
|
|
12
|
+
const result: { mcpUrl?: string; mcpAuth?: string } = {};
|
|
13
|
+
|
|
14
|
+
// Config file takes priority
|
|
11
15
|
try {
|
|
12
|
-
|
|
16
|
+
const fileConfig = JSON.parse(readFileSync(CONFIG_PATH, "utf8"));
|
|
17
|
+
result.mcpUrl = fileConfig.mcpUrl;
|
|
18
|
+
result.mcpAuth = fileConfig.mcpAuth;
|
|
13
19
|
} catch {
|
|
14
|
-
|
|
20
|
+
// use defaults
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Env vars as fallback
|
|
24
|
+
if (!result.mcpUrl && env.NOCTURNE_MCP_URL) {
|
|
25
|
+
result.mcpUrl = env.NOCTURNE_MCP_URL;
|
|
15
26
|
}
|
|
27
|
+
if (!result.mcpAuth && env.NOCTURNE_MCP_AUTH) {
|
|
28
|
+
result.mcpAuth = env.NOCTURNE_MCP_AUTH;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return result;
|
|
16
32
|
}
|
|
17
33
|
|
|
18
34
|
const config = loadConfig();
|
|
19
35
|
const MCP_URL = config.mcpUrl;
|
|
20
36
|
const MCP_AUTH = config.mcpAuth;
|
|
21
37
|
if (!MCP_URL) {
|
|
22
|
-
throw new Error("mcpUrl is required in config.json");
|
|
38
|
+
throw new Error("mcpUrl is required (set in config.json or NOCTURNE_MCP_URL env)");
|
|
23
39
|
}
|
|
24
40
|
if (!MCP_AUTH) {
|
|
25
|
-
throw new Error("mcpAuth is required in config.json");
|
|
41
|
+
throw new Error("mcpAuth is required (set in config.json or NOCTURNE_MCP_AUTH env)");
|
|
26
42
|
}
|
|
27
43
|
|
|
28
44
|
const BOOT_URIS = ["system://boot", "system://recent/5", "system://glossary"];
|
package/package.json
CHANGED
package/config.json
DELETED