dsh-engramory-recall 0.8.0 → 0.8.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/CHANGELOG.md +12 -0
- package/mcp.js +19 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
本项目的所有重要变更都记在这里。格式参照 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
|
4
4
|
版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
5
5
|
|
|
6
|
+
## [0.8.1] — 2026-10-15
|
|
7
|
+
|
|
8
|
+
### 修复
|
|
9
|
+
|
|
10
|
+
- **通过 `engramory-recall-mcp` 命令调用时服务器不回包**(0.8.0 的 bug):npm 装出来的 bin 是
|
|
11
|
+
符号链接,Node 默认解析真实路径,于是「这个文件是被当程序跑的吗」那句
|
|
12
|
+
`import.meta.url === pathToFileURL(process.argv[1])` 比对为 false,进程安静地读 stdin、
|
|
13
|
+
永不回包 —— 用户只会看到「服务器没反应」,既不报错也不退出。
|
|
14
|
+
改为两边都取 `realpath` 再比。
|
|
15
|
+
- `test/mcp.test.mjs` 补一条回归:把服务器软链成 `engramory-recall-mcp` 再起进程
|
|
16
|
+
(npm 的 bin 就是这个形状),确认 initialize 与检索都正常。
|
|
17
|
+
|
|
6
18
|
## [0.8.0] — 2026-10-15
|
|
7
19
|
|
|
8
20
|
### 新增
|
package/mcp.js
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
* 用法:`node mcp.js [--store <路径>]`,或者看 README 里各宿主的配置片段。
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { readFileSync } from 'node:fs';
|
|
19
|
+
import { readFileSync, realpathSync } from 'node:fs';
|
|
20
20
|
import { homedir } from 'node:os';
|
|
21
21
|
import { basename, join, resolve, sep } from 'node:path';
|
|
22
22
|
import { createInterface } from 'node:readline';
|
|
23
|
-
import { pathToFileURL } from 'node:url';
|
|
23
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
24
24
|
|
|
25
25
|
import { buildIndex, search } from './bm25.js';
|
|
26
26
|
import { countLines, DEFAULT_MAX_INDEX_BYTES, DEFAULT_MAX_INDEX_LINES, measureIndex } from './index-guard.js';
|
|
@@ -371,7 +371,23 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
371
371
|
return 0;
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
|
|
374
|
+
/**
|
|
375
|
+
* 「这个文件是被当程序跑的吗」不能只比 URL 字符串:npm 装出来的 bin 是个符号链接
|
|
376
|
+
* (`node_modules/.bin/engramory-recall-mcp`),Node 默认解析真实路径,
|
|
377
|
+
* `import.meta.url` 是真实路径、`process.argv[1]` 是链接路径 —— 一比就 false,
|
|
378
|
+
* 进程会安静地读 stdin 永不回包(0.8.0 就是这么坏的,用户只会看到「服务器没反应」)。
|
|
379
|
+
* 所以两边都取 realpath 再比。
|
|
380
|
+
*/
|
|
381
|
+
function isEntryPoint(entry) {
|
|
382
|
+
if (!entry) return false;
|
|
383
|
+
try {
|
|
384
|
+
return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url));
|
|
385
|
+
} catch {
|
|
386
|
+
return import.meta.url === pathToFileURL(entry).href;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if (isEntryPoint(process.argv[1])) {
|
|
375
391
|
main().then(
|
|
376
392
|
(code) => {
|
|
377
393
|
process.exitCode = code;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-engramory-recall",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Local BM25 auto-recall, fail-closed write guard, static doctor and a memory panel for the Engramory markdown store — no network, no model, no daemon.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|