dsh-memory-eternal 0.5.0 → 0.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/bin/dsh-memory.mjs +4 -9
- package/package.json +1 -1
package/bin/dsh-memory.mjs
CHANGED
|
@@ -29,12 +29,11 @@ const has = (name) => argv.includes(name)
|
|
|
29
29
|
|
|
30
30
|
/** 取位置参数(跳过子命令、flag 与 flag 的值) */
|
|
31
31
|
const positional = () => {
|
|
32
|
-
const
|
|
32
|
+
const isFlag = (s) => typeof s === 'string' && s.startsWith('--')
|
|
33
33
|
const out = []
|
|
34
34
|
for (let i = 1; i < argv.length; i++) {
|
|
35
35
|
const a = argv[i]
|
|
36
|
-
if (
|
|
37
|
-
if (a.startsWith('--')) continue
|
|
36
|
+
if (isFlag(a)) { i++; continue } // 跳过 flag + 它的值(任意 flag 都吃掉下一项)
|
|
38
37
|
out.push(a)
|
|
39
38
|
}
|
|
40
39
|
return out
|
|
@@ -60,12 +59,8 @@ async function main() {
|
|
|
60
59
|
const raw = positional().join(' ')
|
|
61
60
|
let text = raw
|
|
62
61
|
if (raw === '-' || (!raw && !process.stdin.isTTY)) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
process.stdin.setEncoding('utf8')
|
|
66
|
-
process.stdin.on('data', (c) => { buf += c })
|
|
67
|
-
process.stdin.on('end', () => resolve(buf))
|
|
68
|
-
})
|
|
62
|
+
// 同步读 stdin(管道数据可能在 'data' 监听注册前到达;readFileSync(0) 一次性读完整)
|
|
63
|
+
try { text = require('node:fs').readFileSync(0, 'utf8') } catch { text = '' }
|
|
69
64
|
}
|
|
70
65
|
const { runStandaloneCapture, defaultVaultDir } = await import('../lib/capture-run.js')
|
|
71
66
|
const root = path.resolve(defaultVaultDir())
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-memory-eternal",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "记忆核心(Memory Eternal):自研的 DeepSeek Harness 记忆插件,不移植任何既有记忆框架——对话结束后自动沉淀知识卡到本地 Markdown Vault(自研去重、自研 CJK 检索、可 git 管理),设置页提供图形化知识库(统计 / 搜索 / 知识图谱 + 侧边栏一键弹窗),Agent 通过 memory_recall 工具按需召回历史上下文。零人工干预。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|