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.
@@ -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
- return JSON.parse(readFileSync(CONFIG_PATH, "utf8"));
16
+ const fileConfig = JSON.parse(readFileSync(CONFIG_PATH, "utf8"));
17
+ result.mcpUrl = fileConfig.mcpUrl;
18
+ result.mcpAuth = fileConfig.mcpAuth;
13
19
  } catch {
14
- return {};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-nocturne-memory",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Nocturne Memory extension for Pi — automated memory management with SessionStart boot protocol",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/config.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "mcpUrl": "https://nocturne-memory.slahser.com/mcp"
3
- }