dsh-plugin-memory 0.1.0 → 0.1.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/README.md +5 -0
- package/lib/index.js +13 -0
- package/lib/types/index.d.ts +11 -1
- package/package.json +8 -7
- package/scripts/memory.mjs +0 -0
package/README.md
CHANGED
|
@@ -57,12 +57,17 @@ pnpm add dsh-plugin-memory
|
|
|
57
57
|
- insert:
|
|
58
58
|
- id: dsh-memory
|
|
59
59
|
name: dsh-plugin-memory
|
|
60
|
+
inject:
|
|
61
|
+
- systemPrompt
|
|
62
|
+
- skills
|
|
60
63
|
config:
|
|
61
64
|
memoryDir: '~/.memory'
|
|
62
65
|
```
|
|
63
66
|
|
|
64
67
|
重启 profile(DSH Desktop 重启应用)后生效。
|
|
65
68
|
|
|
69
|
+
`inject` 两项是必须的:`systemPrompt` 用于注入记忆 boot 块,`skills` 用于注册 `memory` 技能。
|
|
70
|
+
|
|
66
71
|
## 配置
|
|
67
72
|
|
|
68
73
|
| 键 | 默认值 | 含义 |
|
package/lib/index.js
CHANGED
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
* - insert:
|
|
46
46
|
* - id: dsh-memory
|
|
47
47
|
* name: dsh-plugin-memory
|
|
48
|
+
* inject:
|
|
49
|
+
* - systemPrompt
|
|
50
|
+
* - skills
|
|
48
51
|
* config:
|
|
49
52
|
* memoryDir: '~/.memory'
|
|
50
53
|
* ```
|
|
@@ -144,6 +147,16 @@ export function apply(ctx, config = {}) {
|
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
|
|
150
|
+
// DSH's loader unwraps a package's default export before it starts the
|
|
151
|
+
// Cordis plugin. Keep the default export callable for direct consumers, but
|
|
152
|
+
// attach the Cordis metadata to that function so injected services and the
|
|
153
|
+
// config schema survive the unwrap step.
|
|
154
|
+
Object.defineProperties(apply, {
|
|
155
|
+
name: { value: name },
|
|
156
|
+
inject: { value: inject },
|
|
157
|
+
Config: { value: Config },
|
|
158
|
+
})
|
|
159
|
+
|
|
147
160
|
export default apply
|
|
148
161
|
|
|
149
162
|
export { renderBootBlock, ensureMemoryScaffold }
|
package/lib/types/index.d.ts
CHANGED
|
@@ -34,10 +34,20 @@ export const Config: import('@deepseek-ai/schemastery').default<MemoryConfig>
|
|
|
34
34
|
/** Expand `~` and resolve `dir` to an absolute path. */
|
|
35
35
|
export function resolveMemoryDir(dir: string): string
|
|
36
36
|
|
|
37
|
+
/** Callable Cordis plugin entry plus metadata consumed by the DSH loader. */
|
|
38
|
+
export interface MemoryPlugin {
|
|
39
|
+
(ctx: Context, config?: MemoryConfig): () => void
|
|
40
|
+
readonly name: 'memory'
|
|
41
|
+
readonly inject: ['systemPrompt', 'skills']
|
|
42
|
+
readonly Config: import('@deepseek-ai/schemastery').default<MemoryConfig>
|
|
43
|
+
}
|
|
44
|
+
|
|
37
45
|
/** Cordis plugin entry. Returns the effect disposer. */
|
|
38
46
|
export function apply(ctx: Context, config?: MemoryConfig): () => void
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
declare const plugin: MemoryPlugin
|
|
49
|
+
|
|
50
|
+
export default plugin
|
|
41
51
|
|
|
42
52
|
/** Render the boot memory block injected at session start. */
|
|
43
53
|
export function renderBootBlock(
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-memory",
|
|
3
3
|
"description": "Long-term memory plugin for DeepSeek Harness: persistent cross-session markdown memory with a soul/persona file, auto-injected at every session start, plus remember/recall/consolidate/forget workflows and portable migration tooling.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
"README.md",
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"test": "node scripts/memory.mjs --self-test",
|
|
29
|
+
"test:plugin": "node --test test/plugin-metadata.test.mjs",
|
|
30
|
+
"lint:memory": "node scripts/memory.mjs lint"
|
|
31
|
+
},
|
|
27
32
|
"engines": {
|
|
28
33
|
"node": ">=18"
|
|
29
34
|
},
|
|
@@ -51,9 +56,5 @@
|
|
|
51
56
|
"bugs": {
|
|
52
57
|
"url": "https://github.com/LittleBlackTong/dsh-plugin-memory/issues"
|
|
53
58
|
},
|
|
54
|
-
"homepage": "https://github.com/LittleBlackTong/dsh-plugin-memory#readme"
|
|
55
|
-
|
|
56
|
-
"test": "node scripts/memory.mjs --self-test",
|
|
57
|
-
"lint:memory": "node scripts/memory.mjs lint"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
59
|
+
"homepage": "https://github.com/LittleBlackTong/dsh-plugin-memory#readme"
|
|
60
|
+
}
|
package/scripts/memory.mjs
CHANGED
|
File without changes
|