@jacklika/dsh-memory-mcp 0.1.1 → 0.1.3

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
@@ -12,7 +12,7 @@ node packages/memory-mcp/src/server.mjs --vault /path/to/vault
12
12
  npx dsh-memory-mcp --vault /path/to/vault
13
13
  ```
14
14
 
15
- `--vault` defaults to `<cwd>/.dsh/memory/`; `--max-link-depth N` controls `wiki_read` link following (default 1).
15
+ `--vault` defaults to `<cwd>/.plugins/memory/` to match the dsh-memory Bundle default; `--max-link-depth N` controls `wiki_read` link following (default 1).
16
16
 
17
17
  ## Surface
18
18
 
package/README.zh.md CHANGED
@@ -12,7 +12,7 @@ node packages/memory-mcp/src/server.mjs --vault /path/to/vault
12
12
  npx dsh-memory-mcp --vault /path/to/vault
13
13
  ```
14
14
 
15
- `--vault` 默认为 `<cwd>/.dsh/memory/`;`--max-link-depth N` 控制 `wiki_read` 的链接展开深度(默认 1)。
15
+ `--vault` 默认为 `<cwd>/.plugins/memory/`,与 dsh-memory Bundle 默认保持一致;`--max-link-depth N` 控制 `wiki_read` 的链接展开深度(默认 1)。
16
16
 
17
17
  ## 暴露面
18
18
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jacklika/dsh-memory-mcp",
3
3
  "description": "Zero-dependency MCP stdio server exposing the memory vault to any MCP client — one process owns all writes.",
4
- "version": "0.1.1",
4
+ "version": "0.1.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,5 +29,8 @@
29
29
  "README.md",
30
30
  "README.zh.md"
31
31
  ],
32
+ "dependencies": {
33
+ "@jacklika/dsh-memory-time": "^0.1.0-alpha.0"
34
+ },
32
35
  "license": "MIT"
33
36
  }
package/src/server.mjs CHANGED
@@ -5,13 +5,14 @@
5
5
  * serialize through the server instead of negotiating filesystem locks.
6
6
  *
7
7
  * Usage: dsh-memory-mcp [--vault <path>] [--max-link-depth N]
8
- * --vault defaults to <cwd>/.dsh/memory/
8
+ * --vault defaults to <cwd>/.plugins/memory/ to match the Bundle default.
9
9
  */
10
10
  import { createHash, randomUUID } from 'node:crypto'
11
11
  import { mkdir, readdir, readFile, realpath, rename, rm, writeFile } from 'node:fs/promises'
12
12
  import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'
13
13
  import process from 'node:process'
14
14
  import readline from 'node:readline'
15
+ import { formatBeijingTime } from '@jacklika/dsh-memory-time'
15
16
 
16
17
  const PROTOCOL_VERSION = '2024-11-05'
17
18
  const SERVER_INFO = { name: 'dsh-memory-mcp', version: '0.1.0' }
@@ -23,7 +24,7 @@ function argValue(flag, fallback) {
23
24
  const i = args.indexOf(flag)
24
25
  return i >= 0 && args[i + 1] !== undefined ? args[i + 1] : fallback
25
26
  }
26
- const VAULT = resolve(argValue('--vault', join(process.cwd(), '.dsh', 'memory')))
27
+ const VAULT = resolve(argValue('--vault', join(process.cwd(), '.plugins', 'memory')))
27
28
  const MAX_LINK_DEPTH = Number(argValue('--max-link-depth', '1'))
28
29
  const EXTENSIONS = ['.md']
29
30
  const EXCLUDE_DIRS = new Set(['.git', 'node_modules', '.obsidian'])
@@ -183,7 +184,7 @@ async function writeNote(id, content, mode = 'append', baseVersion) {
183
184
  const fm = Object.keys(frontmatter).length > 0
184
185
  ? `---\n${Object.entries(frontmatter).map(([k, v]) => `${k}: ${v}`).join('\n')}\n---\n\n`
185
186
  : ''
186
- finalBody = `${fm}${body}\n\n## ${new Date().toISOString()}\n\n${content}\n`
187
+ finalBody = `${fm}${body}\n\n## ${formatBeijingTime(new Date())}\n\n${content}\n`
187
188
  }
188
189
  const tmp = `${absolutePath}.tmp-${process.pid}-${randomUUID()}`
189
190
  try {