memory-eternal 0.9.17 → 0.10.0
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/README.en.md +15 -2
- package/README.md +24 -2
- package/examples/mcp-memory/memory-eternal.cordis.yml +59 -0
- package/index.js +54 -3
- package/lib/api.js +558 -483
- package/lib/capture-run.js +134 -126
- package/lib/capture.js +166 -7
- package/lib/client.js +20 -17
- package/lib/config-sync.js +90 -0
- package/lib/db.js +150 -3
- package/lib/sse.js +51 -0
- package/lib/vault.js +325 -101
- package/lib/web.js +13 -2
- package/package.json +3 -2
- package/web/app.js +22 -19
package/lib/web.js
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
// 直接运行:node lib/web.js --port 7999 [--vault <dir>]
|
|
12
12
|
|
|
13
13
|
import http from 'node:http'
|
|
14
|
-
import { promises as fs, readFileSync } from 'node:fs'
|
|
14
|
+
import { promises as fs, readFileSync, watch } from 'node:fs'
|
|
15
15
|
import path from 'node:path'
|
|
16
16
|
import { fileURLToPath } from 'node:url'
|
|
17
|
-
import { createApi, API_PREFIX, encodeBody } from './api.js'
|
|
17
|
+
import { createApi, API_PREFIX, encodeBody, broadcast } from './api.js'
|
|
18
18
|
import { defaultVaultDir, configFilePath } from './capture-run.js'
|
|
19
19
|
import { readCaptureLog, deriveHealth } from './capture-log.js'
|
|
20
20
|
import { nodeBinary, childEnv } from './node-bin.js'
|
|
@@ -39,6 +39,17 @@ export function startWebServer({ port = DEFAULT_WEB_PORT, vaultRoot = defaultVau
|
|
|
39
39
|
getCaptureHealth: async () => deriveHealth(await readCaptureLog(50, process.env)),
|
|
40
40
|
})
|
|
41
41
|
|
|
42
|
+
// 共享配置文件变化 → 即时推给已打开的独立页(DSH 端一保存,这边不用刷新就能看到)
|
|
43
|
+
try {
|
|
44
|
+
// 监听**文件本身**而不是父目录(同 lib/config-sync.js 的说明):
|
|
45
|
+
// 父目录被删除时 Windows 上 libuv 会断言崩溃,监听文件只会得到 ENOENT。
|
|
46
|
+
const cfgFile = configFilePath(process.env)
|
|
47
|
+
const w = watch(cfgFile, () => {
|
|
48
|
+
broadcast('config', { at: Date.now(), source: 'file' })
|
|
49
|
+
})
|
|
50
|
+
if (typeof w.unref === 'function') w.unref()
|
|
51
|
+
} catch { /* 监听失败不影响服务;客户端仍会在操作时重新拉取 */ }
|
|
52
|
+
|
|
42
53
|
const server = http.createServer(async (req, res) => {
|
|
43
54
|
try {
|
|
44
55
|
const url = new URL(req.url, 'http://localhost')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memory-eternal",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "记忆核心(Memory Eternal):自研的 DeepSeek Harness 记忆插件,不移植任何既有记忆框架——对话结束后自动沉淀知识卡到本地 Markdown Vault(自研去重、自研 CJK 检索、可 git 管理),设置页提供图形化知识库(统计 / 搜索 / 知识图谱 + 侧边栏一键弹窗),Agent 通过 memory_recall 工具按需召回历史上下文。零人工干预。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
".cursor-plugin",
|
|
36
36
|
".mcp.json",
|
|
37
37
|
"cordis.patch.yml",
|
|
38
|
+
"examples",
|
|
38
39
|
"README.md",
|
|
39
40
|
"README.en.md",
|
|
40
41
|
"LICENSE"
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"build": "node build.mjs",
|
|
61
62
|
"build:client": "node build.mjs",
|
|
62
63
|
"prepublishOnly": "node build.mjs",
|
|
63
|
-
"test": "node build.mjs && node tests/vault.test.mjs && node tests/capture.test.mjs && node tests/capture-route.test.mjs && node tests/stall.test.mjs && node tests/vault-path.test.mjs && node tests/vault-resolve.test.mjs && node tests/minhash.test.mjs && node tests/settings-save.test.mjs && node tests/config-coverage.test.mjs && node tests/api.test.mjs && node tests/graph-perf.test.mjs && node tests/settings-compat.test.mjs && node tests/node-bin.test.mjs && node tests/watchdog-lock.test.mjs && node tests/markdown.test.mjs && node tests/feedback.test.mjs && node tests/graph-lod.test.mjs && node tests/ssr.test.mjs"
|
|
64
|
+
"test": "node build.mjs && node tests/vault.test.mjs && node tests/capture.test.mjs && node tests/capture-route.test.mjs && node tests/stall.test.mjs && node tests/vault-path.test.mjs && node tests/vault-resolve.test.mjs && node tests/minhash.test.mjs && node tests/settings-save.test.mjs && node tests/config-coverage.test.mjs && node tests/config-sync.test.mjs && node tests/config-merge.test.mjs && node tests/sse.test.mjs && node tests/api.test.mjs && node tests/graph-perf.test.mjs && node tests/settings-compat.test.mjs && node tests/node-bin.test.mjs && node tests/watchdog-lock.test.mjs && node tests/markdown.test.mjs && node tests/feedback.test.mjs && node tests/graph-lod.test.mjs && node tests/ssr.test.mjs && node tests/two-store.test.mjs && node tests/noise-gate.test.mjs && node tests/e2e-recall.test.mjs"
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"@deepseek-ai/schemastery": "^3.18.1"
|