vault-cortex 0.14.0 → 0.15.1

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 CHANGED
@@ -15,7 +15,7 @@ and data files — see the
15
15
  The server runs as a Docker container; this CLI scaffolds the config and
16
16
  manages the container so you don't have to.
17
17
 
18
- ![npx vault-cortex@latest init — the interactive setup wizard picks a mode, finds your vault, offers the optional settings, generates the config, and starts the server](https://raw.githubusercontent.com/aliasunder/vault-cortex/main/assets/demo-cli-init.gif)
18
+ <p align="center"><img src="https://raw.githubusercontent.com/aliasunder/vault-cortex/main/assets/demo-cli-init.gif" width="720" alt="npx vault-cortex@latest init — the interactive setup wizard picks a mode, finds your vault, offers the optional settings, generates the config, and starts the server"></p>
19
19
 
20
20
  ## Commands
21
21
 
package/dist/env.js CHANGED
@@ -34,6 +34,15 @@ MAX_IMAGE_OUTPUT_BYTES=49152
34
34
  # divided evenly across the rendered pages. Fewer pages = higher quality each.
35
35
  MAX_PDF_RENDER_PAGES=5
36
36
 
37
+ # Days a note deleted under Obsidian's default "Move to system trash" setting
38
+ # stays in the vault's .trash folder before the server cleans it up
39
+ # (default: 30). Set none to keep those notes forever. Only notes this server
40
+ # moved to .trash under that setting are cleaned up — notes you or Obsidian
41
+ # put there are never touched. The server tracks its trashed notes even while
42
+ # this is none, so switching none to a number cleans up the older backlog on
43
+ # the next restart.
44
+ TRASH_RETENTION_DAYS=30
45
+
37
46
  # Your IANA timezone — affects daily note resolution and memory timestamps.
38
47
  # TZ=America/New_York
39
48
 
package/dist/init.js CHANGED
@@ -86,7 +86,7 @@ const parseHttpUrl = (value) => {
86
86
  return null;
87
87
  }
88
88
  };
89
- /** Validates a PUBLIC_URL value: must be http(s), no credentials, no /mcp suffix. */
89
+ /** Validates a PUBLIC_URL value: must be a bare http(s) origin — no path, credentials, query, or fragment. */
90
90
  export const validatePublicUrl = (input) => {
91
91
  const trimmed = input.trim();
92
92
  const url = parseHttpUrl(trimmed);
@@ -108,7 +108,7 @@ export const validatePublicUrl = (input) => {
108
108
  if (trimmed.includes("?") || trimmed.includes("#")) {
109
109
  return {
110
110
  kind: "error",
111
- message: "PUBLIC_URL must be a bare origin or path — no query string (?...) or fragment (#...).",
111
+ message: "PUBLIC_URL must be a bare origin — no query string (?...) or fragment (#...).",
112
112
  };
113
113
  }
114
114
  if (TRAILING_MCP_PATH.test(url.pathname)) {
@@ -117,8 +117,14 @@ export const validatePublicUrl = (input) => {
117
117
  message: "Leave /mcp off PUBLIC_URL — it's the base URL and the server adds /mcp itself (e.g. https://vault.example.com).",
118
118
  };
119
119
  }
120
+ if (url.pathname.replace(/\/+$/, "") !== "") {
121
+ return {
122
+ kind: "error",
123
+ message: "PUBLIC_URL must be a bare origin — no path (e.g. https://vault.example.com, not https://vault.example.com/vault/).",
124
+ };
125
+ }
120
126
  // Trim trailing slashes so the connect URL is `${base}/mcp`, never
121
- // `${base}//mcp` — URL.href/.origin don't round-trip reverse-proxy subpaths.
127
+ // `${base}//mcp`.
122
128
  return { kind: "ok", url: trimmed.replace(/\/+$/, "") };
123
129
  };
124
130
  /** Re-prompts until the answer is a valid base http(s) URL (no /mcp path). */
package/dist/prompts.js CHANGED
@@ -1,9 +1,11 @@
1
1
  import * as clack from "@clack/prompts";
2
2
  // User pressed ctrl-C mid-prompt: 130 = 128 + SIGINT, the shell convention.
3
- // clack.isCancel is a type guard (value is symbol), so after the early exit
4
- // TypeScript narrows `value` to `T` — no assertion needed.
3
+ // Guard on typeof, not clack.isCancel: since @clack/prompts 1.8.0 isCancel
4
+ // narrows to its unique CANCEL_SYMBOL, which cannot remove the broad `symbol`
5
+ // from the `T | symbol` the prompt functions return — a typeof check does,
6
+ // and the cancel sentinel is the only symbol a prompt ever resolves with.
5
7
  const exitOnCancel = (value) => {
6
- if (clack.isCancel(value)) {
8
+ if (typeof value === "symbol") {
7
9
  clack.cancel("Cancelled.");
8
10
  process.exit(130);
9
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vault-cortex",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "Set up a Vault Cortex MCP server for your Obsidian vault in one command: npx vault-cortex@latest init",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,7 +48,7 @@
48
48
  "cli"
49
49
  ],
50
50
  "dependencies": {
51
- "@clack/prompts": "1.7.0",
52
- "commander": "14.0.3"
51
+ "@clack/prompts": "1.8.0",
52
+ "commander": "15.0.0"
53
53
  }
54
54
  }