pkm-mcp-server 1.5.0 → 1.5.2

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/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.5.1] - 2026-03-21
10
+
11
+ ### Fixed
12
+ - Init wizard failed to copy `stop-sweep.js` — hook file references still pointed to the old `stop-sweep.sh` filename from before the v1.5.0 bash-to-Node conversion. Updated all references and removed stop-sweep from shell patching (it auto-detects MCP config).
13
+
9
14
  ## [1.5.0] - 2026-03-21
10
15
 
11
16
  ### Changed
@@ -35,13 +35,20 @@ if [ -z "$CAPTURE_TYPE" ] || [ -z "$CAPTURE_TITLE" ] || [ -z "$CAPTURE_CONTENT"
35
35
  exit 0
36
36
  fi
37
37
 
38
- # MCP config for obsidian-pkm server
38
+ # MCP config auto-detect repo (../index.js exists) vs installed (use npx)
39
39
  SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd -P)
40
40
  MCP_CONFIG=$(node -e "
41
+ const { existsSync } = require('fs');
42
+ const path = require('path');
43
+ const localIndex = path.join(process.argv[1], '..', 'index.js');
44
+ const useLocal = existsSync(localIndex);
41
45
  const env = { VAULT_PATH: process.argv[2] };
42
46
  if (process.env.OPENAI_API_KEY) env.OPENAI_API_KEY = process.env.OPENAI_API_KEY;
43
- console.log(JSON.stringify({ mcpServers: { 'obsidian-pkm': { command: 'node', args: [process.argv[1]], env } } }));
44
- " "$SCRIPT_DIR/../index.js" "${VAULT_PATH:-$HOME/Documents/PKM}")
47
+ const server = useLocal
48
+ ? { command: 'node', args: [localIndex], env }
49
+ : { command: 'npx', args: ['-y', 'pkm-mcp-server@latest'], env };
50
+ console.log(JSON.stringify({ mcpServers: { 'obsidian-pkm': server } }));
51
+ " "$SCRIPT_DIR" "${VAULT_PATH:-$HOME/Documents/PKM}")
45
52
 
46
53
  # Build prompt via Node.js to avoid shell injection from user content
47
54
  PROMPT_FILE=$(mktemp)
package/init.js CHANGED
@@ -212,7 +212,7 @@ export function patchMcpConfig(scriptContent, installType) {
212
212
  return patched.join("\n");
213
213
  }
214
214
 
215
- const PKM_HOOK_BASENAMES = new Set(["session-start.js", "stop-sweep.sh", "capture-handler.sh"]);
215
+ const PKM_HOOK_BASENAMES = new Set(["session-start.js", "stop-sweep.js", "capture-handler.sh"]);
216
216
 
217
217
  /**
218
218
  * Detect if a hook entry is a PKM hook (by path substring or script basename).
@@ -257,7 +257,7 @@ export function buildHookEntries(vaultPath, hooksDir, enabledHooks) {
257
257
  entries.Stop = [{
258
258
  hooks: [{
259
259
  type: "command",
260
- command: `VAULT_PATH="${vaultPath}" ${path.join(hooksDir, "stop-sweep.sh")}`,
260
+ command: `VAULT_PATH="${vaultPath}" node ${path.join(hooksDir, "stop-sweep.js")}`,
261
261
  async: true,
262
262
  timeout: 10,
263
263
  }],
@@ -326,8 +326,8 @@ export async function mergeHooksIntoSettings(settingsPath, hookEntries, disabled
326
326
  return {};
327
327
  }
328
328
 
329
- const HOOK_FILES = ["session-start.js", "resolve-project.js", "load-context.js", "stop-sweep.sh", "capture-handler.sh"];
330
- const SHELL_HOOKS = new Set(["stop-sweep.sh", "capture-handler.sh"]);
329
+ const HOOK_FILES = ["session-start.js", "resolve-project.js", "load-context.js", "stop-sweep.js", "capture-handler.sh"];
330
+ const SHELL_HOOKS = new Set(["capture-handler.sh"]);
331
331
 
332
332
  /**
333
333
  * Copy hook scripts to destination, patching shell scripts with correct MCP config.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkm-mcp-server",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "MCP server for Obsidian vault integration with Claude Code — 19 tools for notes, search, and graph traversal",
5
5
  "main": "cli.js",
6
6
  "exports": {