dsh-plugin-memory 0.11.0 → 0.13.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/CHANGELOG.md +32 -0
- package/README.md +25 -2
- package/README.zh.md +25 -2
- package/docs/PROACTIVE-PROTOCOL.md +81 -0
- package/lib/boot.js +22 -3
- package/lib/client.js +169 -5
- package/lib/config-store.js +19 -1
- package/lib/digest-guard.js +35 -1
- package/lib/growth.js +201 -0
- package/lib/index.js +116 -4
- package/lib/proactive-lock.js +122 -0
- package/lib/recall-nudge.js +179 -2
- package/lib/schema.js +10 -0
- package/lib/tone.js +86 -0
- package/lib/types/index.d.ts +44 -0
- package/package.json +3 -2
package/lib/types/index.d.ts
CHANGED
|
@@ -57,6 +57,20 @@ export interface MemoryConfig {
|
|
|
57
57
|
recallIntervalMaxMinutes?: number
|
|
58
58
|
/** Max recall nudges per session. Default `3`. */
|
|
59
59
|
recallMaxPerSession?: number
|
|
60
|
+
/**
|
|
61
|
+
* Shared proactive-speech cooldown (seconds) with dsh-plugin-heartbeat,
|
|
62
|
+
* via `<dshHome>/proactive-cooldown.json`. `0` turns arbitration off.
|
|
63
|
+
* Default `180`.
|
|
64
|
+
*/
|
|
65
|
+
proactiveCooldownSeconds?: number
|
|
66
|
+
/** Inject the context-sensitive tone section after SOUL. Default `true`. */
|
|
67
|
+
toneGuideEnabled?: boolean
|
|
68
|
+
/** Tone intensity: `low` (default) / `medium` / `off` (pure engineering voice). */
|
|
69
|
+
toneIntensity?: 'low' | 'medium' | 'off'
|
|
70
|
+
/** Deliver a weekly first-person growth recap on the recall channel. Default `true`. */
|
|
71
|
+
growthRecapEnabled?: boolean
|
|
72
|
+
/** Days between growth recaps. Default `7`. */
|
|
73
|
+
growthRecapIntervalDays?: number
|
|
60
74
|
/** Auto-commit the store's git history after a quiet period. Default `true`. */
|
|
61
75
|
autoCommit?: boolean
|
|
62
76
|
/** Seconds of quiet before an auto-commit. Default `60`. */
|
|
@@ -86,6 +100,11 @@ export interface MemorySettings {
|
|
|
86
100
|
recallIntervalMinMinutes?: number
|
|
87
101
|
recallIntervalMaxMinutes?: number
|
|
88
102
|
recallMaxPerSession?: number
|
|
103
|
+
proactiveCooldownSeconds?: number
|
|
104
|
+
toneGuideEnabled?: boolean
|
|
105
|
+
toneIntensity?: 'low' | 'medium' | 'off'
|
|
106
|
+
growthRecapEnabled?: boolean
|
|
107
|
+
growthRecapIntervalDays?: number
|
|
89
108
|
}
|
|
90
109
|
|
|
91
110
|
/** Schemastery schema for {@link MemorySettings}. */
|
|
@@ -229,3 +248,28 @@ export function collectInsights(memoryDir: string): MemoryInsights
|
|
|
229
248
|
|
|
230
249
|
/** Newest-first `log.md` headlines for the dashboard. */
|
|
231
250
|
export function readRecentLog(memoryDir: string, count?: number): string[]
|
|
251
|
+
|
|
252
|
+
/** Render the tone section injected after SOUL ('' when intensity is off). */
|
|
253
|
+
export function buildToneGuide(options?: {
|
|
254
|
+
intensity?: 'low' | 'medium' | 'off'
|
|
255
|
+
language?: 'zh' | 'en'
|
|
256
|
+
}): string
|
|
257
|
+
|
|
258
|
+
/** Shared proactive-speech cooldown values. */
|
|
259
|
+
export const TONE_INTENSITIES: ReadonlyArray<'low' | 'medium' | 'off'>
|
|
260
|
+
|
|
261
|
+
/** Claim the shared proactive-speech lock (see lib/proactive-lock.js). */
|
|
262
|
+
export function claimProactiveLock(options?: {
|
|
263
|
+
path?: string
|
|
264
|
+
speaker?: string
|
|
265
|
+
cooldownSeconds?: number
|
|
266
|
+
now?: number
|
|
267
|
+
}): { ok: true; disabled?: true } | { ok: false; deferredBy: string }
|
|
268
|
+
|
|
269
|
+
/** Read the shared proactive-speech lock, or undefined when missing/corrupt. */
|
|
270
|
+
export function readProactiveLock(path: string):
|
|
271
|
+
| { version: number; speaker: string; at: number }
|
|
272
|
+
| undefined
|
|
273
|
+
|
|
274
|
+
/** Default lock path: `${DSH_HOME||~/.dsh}/proactive-cooldown.json`. */
|
|
275
|
+
export function defaultProactiveCooldownPath(): string
|
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.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"lint:memory": "node scripts/memory.mjs lint"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
|
-
"node": ">=18"
|
|
45
|
+
"node": ">=18",
|
|
46
|
+
"dsh": "^0.2.1-rc.5"
|
|
46
47
|
},
|
|
47
48
|
"keywords": [
|
|
48
49
|
"deepseek-harness",
|