vault-cortex 0.2.4 → 0.2.5

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/dist/init.js CHANGED
@@ -4,7 +4,7 @@ import { buildLocalConnectMessage, buildRemoteConnectMessage, } from "./messages
4
4
  import { OBSIDIAN_SYNC_IMAGE, pollHealth } from "./docker.js";
5
5
  import { buildFilesToWrite, readEnvPort, writeFiles, } from "./scaffold.js";
6
6
  import { generateToken } from "./token.js";
7
- import { validateVaultPath } from "./vault.js";
7
+ import { expandTilde, validateVaultPath } from "./vault.js";
8
8
  const DEFAULT_TARGET_DIR = "./vault-cortex";
9
9
  const isMode = (value) => value === "local" || value === "remote";
10
10
  const askMode = async (prompts) => {
@@ -169,13 +169,15 @@ const runLocalInit = async (flags, deps) => {
169
169
  const vaultPath = vaultPathResult !== undefined && vaultPathResult.kind !== "error"
170
170
  ? vaultPathResult.path
171
171
  : await askVaultPath(prompts);
172
- const targetDir = resolve(flags.dir ??
172
+ // expandTilde before resolve: resolve() treats a leading `~` as a literal
173
+ // path segment, so a quoted "~/path" would create a directory named "~".
174
+ const targetDir = resolve(expandTilde(flags.dir ??
173
175
  (flags.yes
174
176
  ? DEFAULT_TARGET_DIR
175
177
  : await prompts.text("Where should I put the config files?", {
176
178
  defaultValue: DEFAULT_TARGET_DIR,
177
179
  placeholder: DEFAULT_TARGET_DIR,
178
- })));
180
+ }))));
179
181
  const token = generateToken();
180
182
  // Conflict policy: identical existing files are skipped silently;
181
183
  // differing ones prompt per file (default keep). --yes never overwrites —
@@ -211,11 +213,13 @@ const runLocalInit = async (flags, deps) => {
211
213
  // instructions. Always interactive — the sync-token step can't be defaulted.
212
214
  const runRemoteInit = async (flags, deps) => {
213
215
  const { prompts, docker } = deps;
214
- const targetDir = resolve(flags.dir ??
216
+ // expandTilde before resolve: resolve() treats a leading `~` as a literal
217
+ // path segment, so a quoted "~/path" would create a directory named "~".
218
+ const targetDir = resolve(expandTilde(flags.dir ??
215
219
  (await prompts.text("Where should I put the config files?", {
216
220
  defaultValue: DEFAULT_TARGET_DIR,
217
221
  placeholder: DEFAULT_TARGET_DIR,
218
- })));
222
+ }))));
219
223
  const publicUrl = await askPublicUrl(prompts);
220
224
  const vaultName = await askVaultName(prompts);
221
225
  // The Obsidian Sync token comes from an interactive docker run (the
package/dist/messages.js CHANGED
@@ -37,7 +37,9 @@ Connect your MCP client:
37
37
  ${tokenLine}
38
38
 
39
39
  Claude Code:
40
- 1. claude mcp add --transport http vault-cortex http://localhost:${port}/mcp
40
+ 1. claude mcp add --scope user --transport http vault-cortex http://localhost:${port}/mcp
41
+ (--scope user registers it for every project; drop it to scope
42
+ the server to the current directory only)
41
43
  2. Approve the browser consent page with the token above
42
44
  3. Done. The client holds auto-refreshing access tokens; the
43
45
  token never sits in client config
@@ -92,7 +94,7 @@ export const buildRemoteConnectMessage = (params) => {
92
94
  Note: claude.ai and Claude Desktop only accept https URLs — set up
93
95
  HTTPS when you're ready for those clients (see the HTTPS section in
94
96
  the remote guide). Claude Code works with http:
95
- claude mcp add --transport http vault-cortex ${publicUrl}/mcp`;
97
+ claude mcp add --scope user --transport http vault-cortex ${publicUrl}/mcp`;
96
98
  // Flush-left on purpose: template literals keep leading whitespace, so
97
99
  // indenting these lines would indent the rendered output.
98
100
  const connectMessage = `${startLine}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vault-cortex",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Set up a Vault Cortex MCP server for your Obsidian vault in one command: npx vault-cortex init",
5
5
  "license": "MIT",
6
6
  "type": "module",