dsh-lite-memory 0.2.2 → 0.2.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 +2 -2
- package/TRIGGERS.md +3 -3
- package/index.js +2 -2
- package/package.json +1 -1
- package/store.js +3 -3
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** 它发现有跨会话价值的经验 | 一行灰字 `可记「X」` + 一个 `保留`
|
|
19
|
+
| **L1** 它发现有跨会话价值的经验 | 一行灰字 `可记「X」` + 一个 `保留` 按钮;不写问句、不用你打字,不点就永远不写,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 `可记「X」` with a single `保留` button — nothing
|
|
27
|
+
| **L1** it spots something worth keeping | one muted line `可记「X」` with a single `保留` button — never a question, no typing, 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
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
模型不会常驻读记忆。触发全靠工具描述里的触发词,命中才调。
|
|
14
14
|
|
|
15
15
|
- 查:用户说「上次 / 之前 / 记住过 / 规范 / 约定 / 路径 / 凭据怎么取」,或要做的事像是在这个项目里做过。
|
|
16
|
-
-
|
|
17
|
-
- 建议:一条经验能跨会话复用、又只存在于用户嘴里(偏好、惯例、踩过的坑),且同一项目
|
|
16
|
+
- 写:用户明确要求;用户自己的话已经是长期规则(「以后都这样 / 别再 X」)时直接存,不先问;或用户对某条建议点了「保留」。
|
|
17
|
+
- 建议:一条经验能跨会话复用、又只存在于用户嘴里(偏好、惯例、踩过的坑),且同一项目 48 小时内没建议过。只出按钮,不写「要不要记」这种问句——问句要用户打字,按钮不要。
|
|
18
18
|
- 不写:`1+1=2` 这种常识、一次性任务参数、能从仓库直接读到的正文;凭据只记位置与调用方式。
|
|
19
19
|
|
|
20
20
|
## 触发后长什么样
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
## 频率与退让
|
|
36
36
|
|
|
37
|
-
- 建议:同一项目
|
|
37
|
+
- 建议:同一项目 48 小时一条、一次对话最多一条;同一主题存过就不再建议。
|
|
38
38
|
- 结果:搜索最多 4 条、400 字;全文只在 `memory_read` 里出现。
|
|
39
39
|
- 用户说「别记」→ `memory_forget` 归档,不删文件。
|
|
40
40
|
- 拒绝三次后仍反复建议,说明触发词太宽:收窄 `memory_suggest` 的描述,而不是加状态。
|
package/index.js
CHANGED
|
@@ -145,7 +145,7 @@ export function apply(ctx) {
|
|
|
145
145
|
|
|
146
146
|
ctx.effect(() => tools.register({
|
|
147
147
|
name: 'memory_save',
|
|
148
|
-
description:
|
|
148
|
+
description: `保存一条记忆。用户明确说「记住」时直接调用;用户自己的话已经是长期规则(「以后都这样」「别再 X」)时也直接调用,不要先问。用户点了「保留」或发「保留记忆「X」」时,用那条建议的内容调用。${NOTES}`,
|
|
149
149
|
parameters: SAVE_PARAMS,
|
|
150
150
|
output: {
|
|
151
151
|
schema: {
|
|
@@ -172,7 +172,7 @@ export function apply(ctx) {
|
|
|
172
172
|
|
|
173
173
|
ctx.effect(() => tools.register({
|
|
174
174
|
name: 'memory_suggest',
|
|
175
|
-
description:
|
|
175
|
+
description: `对一条用户没说、但跨会话还有用的经验提出保存建议。调用后对话里出现一个「保留」按钮,用户点了才保存。不要用问句征询「要不要记」,那要用户打字;按钮不打扰对话。一次对话最多建议一条,问自己「下次会话还得靠它吗」,不确定就别建议。${NOTES}`,
|
|
176
176
|
parameters: SUGGEST_PARAMS,
|
|
177
177
|
output: {
|
|
178
178
|
schema: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-lite-memory",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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",
|
package/store.js
CHANGED
|
@@ -13,7 +13,7 @@ export const LIMITS = {
|
|
|
13
13
|
totalBytes: 512 * 1024,
|
|
14
14
|
titleChars: 40,
|
|
15
15
|
summaryChars: 60,
|
|
16
|
-
suggestionWindowMs:
|
|
16
|
+
suggestionWindowMs: 48 * 60 * 60 * 1000,
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
/** Strings that mean "this is a credential", never a memory. */
|
|
@@ -220,14 +220,14 @@ export function forget(scope, id) {
|
|
|
220
220
|
return record;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
/** Why a suggestion is refused: one per
|
|
223
|
+
/** Why a suggestion is refused: one per two days per project, and never for a saved topic. */
|
|
224
224
|
export function suggestionGate(scope, title) {
|
|
225
225
|
const index = loadIndex(scope);
|
|
226
226
|
const text = normalizeText(title, LIMITS.titleChars);
|
|
227
227
|
if (index.entries.some((item) => item.title === text)) return { ok: false, reason: '这条已经存过' };
|
|
228
228
|
const now = Date.now();
|
|
229
229
|
const recent = index.suggestions.find((item) => now - Date.parse(item.at) < LIMITS.suggestionWindowMs);
|
|
230
|
-
if (recent) return { ok: false, reason:
|
|
230
|
+
if (recent) return { ok: false, reason: `48 小时内已建议过「${recent.title}」` };
|
|
231
231
|
return { ok: true };
|
|
232
232
|
}
|
|
233
233
|
|