dsh-lite-memory 0.2.4 → 0.2.5
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 +2 -2
- package/TRIGGERS.md +3 -3
- package/index.js +14 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Lightweight memory for the DeepSeek Harness. Nothing in the system prompt, nothi
|
|
|
16
16
|
| 场景 | 行为 |
|
|
17
17
|
| --- | --- |
|
|
18
18
|
| **L0** 你明确要求「记住这个」 | 立即写盘,一条确认行 |
|
|
19
|
-
| **L1** 它发现有跨会话价值的经验 | 一行灰字 `memory · keep "X"
|
|
19
|
+
| **L1** 它发现有跨会话价值的经验 | 一行灰字 `memory · keep? "X" — 要记的内容` + 一个 `keep` 按钮;标题加一句话,看得懂才点,不点就永远不写,48 小时内不重复 |
|
|
20
20
|
| **L2** 常识、一次性参数、凭据的值 | 永不写入 |
|
|
21
21
|
|
|
22
22
|
触发词:`记住`、`记一下`、`上次`、`规范`、`约定`、`路径`、`凭据怎么取`。
|
|
@@ -24,7 +24,7 @@ Lightweight memory for the DeepSeek Harness. Nothing in the system prompt, nothi
|
|
|
24
24
|
| Case | Behaviour |
|
|
25
25
|
| --- | --- |
|
|
26
26
|
| **L0** you ask it to remember | written immediately, one confirmation line |
|
|
27
|
-
| **L1** it spots something worth keeping | one muted line `memory · keep "X"
|
|
27
|
+
| **L1** it spots something worth keeping | one muted line `memory · keep? "X" — what would be remembered` with a single `keep` button — readable before you click, nothing written unless you click, at most once per two days |
|
|
28
28
|
| **L2** common sense, one-off parameters, credential values | never written |
|
|
29
29
|
|
|
30
30
|
## 点一下就存 / One click, no turn
|
package/TRIGGERS.md
CHANGED
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
```
|
|
25
25
|
· memory · 2 hits · 96 chars
|
|
26
26
|
· memory · no hits
|
|
27
|
-
· memory · saved "
|
|
28
|
-
· memory · keep "
|
|
27
|
+
· memory · saved "插件市场条目字段" — 目录条目要写应用名、一句话作用、图标地址 ✕
|
|
28
|
+
· memory · keep? "发布前先跑文案检查" — 界面文字只留标签、值和动作,交付前跑脚本清零 [keep]
|
|
29
29
|
· memory · skipped
|
|
30
|
-
· memory · dropped "
|
|
30
|
+
· memory · dropped "插件市场条目字段"
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
`keep` 按钮只在建议行出现。点一下直接写盘:不产生消息、不动输入框、不占用下一轮对话,按钮变 `kept` 并禁用。同源写盘通道不通时才退回旧路——插入 `保留记忆「X」` 并排队,至少不丢这条建议。自动写入的行尾带 `✕`,点了把那一条移入归档(不删文件,可从归档取回)。不点就什么都不发生,那行过一会儿只是一段灰色历史。
|
package/index.js
CHANGED
|
@@ -111,8 +111,8 @@ function keepHandler(webServer) {
|
|
|
111
111
|
const SAVE_PARAMS = {
|
|
112
112
|
type: 'object',
|
|
113
113
|
properties: {
|
|
114
|
-
title: { type: 'string', description:
|
|
115
|
-
summary: { type: 'string', description:
|
|
114
|
+
title: { type: 'string', description: `标题:名词短语,用户一眼能认出是哪件事,不超过 ${LIMITS.titleChars} 字` },
|
|
115
|
+
summary: { type: 'string', description: `一句话说清要记的内容本身——用户只看这一行决定留不留,名词短语,不超过 ${LIMITS.summaryChars} 字` },
|
|
116
116
|
body: { type: 'string', description: '正文 markdown。只写指针与要点,不抄录长文档' },
|
|
117
117
|
kind: { type: 'string', enum: ['preference', 'convention', 'procedure', 'pointer', 'pitfall', 'credential_hint', 'note'], description: '条目类型' },
|
|
118
118
|
tags: { type: 'array', items: { type: 'string' }, description: '最多 5 个标签' },
|
|
@@ -164,20 +164,21 @@ export function apply(ctx) {
|
|
|
164
164
|
properties: {
|
|
165
165
|
id: { type: 'string' },
|
|
166
166
|
title: { type: 'string' },
|
|
167
|
+
summary: { type: 'string' },
|
|
167
168
|
merged: { type: 'boolean' },
|
|
168
169
|
},
|
|
169
|
-
required: ['id', 'title', 'merged'],
|
|
170
|
+
required: ['id', 'title', 'summary', 'merged'],
|
|
170
171
|
additionalProperties: false,
|
|
171
172
|
},
|
|
172
173
|
render: (value) => [{
|
|
173
174
|
type: 'text',
|
|
174
|
-
text: value.merged ?
|
|
175
|
+
text: `${value.merged ? 'memory · merged' : 'memory · saved'} "${value.title}"${value.summary ? ` — ${value.summary}` : ''}`,
|
|
175
176
|
}],
|
|
176
177
|
},
|
|
177
178
|
execute: async (args, execution) => {
|
|
178
179
|
const scope = scopeOf(cwdOf(execution));
|
|
179
180
|
const saved = upsert(scope, args);
|
|
180
|
-
return { id: saved.record.id, title: saved.record.title, merged: saved.merged };
|
|
181
|
+
return { id: saved.record.id, title: saved.record.title, summary: saved.record.summary, merged: saved.merged };
|
|
181
182
|
},
|
|
182
183
|
}), 'lite-memory: memory_save');
|
|
183
184
|
|
|
@@ -191,22 +192,26 @@ export function apply(ctx) {
|
|
|
191
192
|
properties: {
|
|
192
193
|
asked: { type: 'boolean' },
|
|
193
194
|
title: { type: 'string' },
|
|
195
|
+
summary: { type: 'string' },
|
|
194
196
|
reason: { type: 'string' },
|
|
195
197
|
},
|
|
196
|
-
required: ['asked', 'title'],
|
|
198
|
+
required: ['asked', 'title', 'summary'],
|
|
197
199
|
additionalProperties: false,
|
|
198
200
|
},
|
|
199
201
|
render: (value) => [{
|
|
200
202
|
type: 'text',
|
|
201
|
-
text: value.asked
|
|
203
|
+
text: value.asked
|
|
204
|
+
? `memory · keep? "${value.title}"${value.summary ? ` — ${value.summary}` : ''}`
|
|
205
|
+
: 'memory · skipped',
|
|
202
206
|
}],
|
|
203
207
|
},
|
|
204
208
|
execute: async (args, execution) => {
|
|
205
209
|
const scope = scopeOf(cwdOf(execution));
|
|
206
210
|
const gate = suggestionGate(scope, args.title);
|
|
207
|
-
|
|
211
|
+
const summary = String(args.summary ?? '');
|
|
212
|
+
if (!gate.ok) return { asked: false, title: String(args.title ?? ''), summary, reason: gate.reason };
|
|
208
213
|
noteSuggestion(scope, args, 'asked');
|
|
209
|
-
return { asked: true, title: String(args.title ?? '') };
|
|
214
|
+
return { asked: true, title: String(args.title ?? ''), summary };
|
|
210
215
|
},
|
|
211
216
|
}), 'lite-memory: memory_suggest');
|
|
212
217
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-lite-memory",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "On-demand memory for the DeepSeek Harness: nothing in the system prompt, one muted line only when something is saved, hit or suggested.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|