@lmzhen/dsh-tool-memory 0.1.0-rc.59 → 0.1.0-rc.60
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/lib/index.js +6 -6
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { createHash } from "node:crypto";
|
|
|
24
24
|
* changes semantically: the bundle digest is the fail-closed signal for
|
|
25
25
|
* review workers, so a stale id across deployments must be distinguishable.
|
|
26
26
|
*/
|
|
27
|
-
const PROMPT_BUNDLE_ID = "dsh-evolution@
|
|
27
|
+
const PROMPT_BUNDLE_ID = "dsh-evolution@5";
|
|
28
28
|
const MEMORY_REVIEW_PROMPT = `[Auto-review — Memory]
|
|
29
29
|
Review the conversation above and consider saving to memory if appropriate.
|
|
30
30
|
|
|
@@ -136,7 +136,7 @@ Hard rules:
|
|
|
136
136
|
6. Before archiving a merged skill, ensure its unique content was preserved in the umbrella.
|
|
137
137
|
|
|
138
138
|
How to work:
|
|
139
|
-
1. Scan the candidate list. Identify PREFIX CLUSTERS — skills sharing a first word or domain keyword
|
|
139
|
+
1. Scan the candidate list. Identify PREFIX CLUSTERS — skills sharing a first word or domain keyword. Expected cluster count scales with the library: a large collection may show 10-25 prefix clusters, a small one often has none — a clean "nothing to consolidate" summary is the correct small-library outcome, not a shortage of ambition.
|
|
140
140
|
2. For each cluster with 2+ members, ask "what is the UMBRELLA CLASS these skills serve?" and consolidate:
|
|
141
141
|
a. MERGE INTO AN EXISTING UMBRELLA (patch a labeled section for each sibling's unique insight, then archive the siblings).
|
|
142
142
|
b. CREATE A NEW UMBRELLA SKILL.md covering the shared workflow with short labeled subsections, then archive the absorbed siblings.
|
|
@@ -200,12 +200,12 @@ function sha256(text) {
|
|
|
200
200
|
function createPromptBundle(prompts) {
|
|
201
201
|
const canonical = JSON.stringify({
|
|
202
202
|
id: PROMPT_BUNDLE_ID,
|
|
203
|
-
version:
|
|
203
|
+
version: 5,
|
|
204
204
|
prompts: Object.fromEntries(Object.entries(prompts).sort())
|
|
205
205
|
});
|
|
206
206
|
return Object.freeze({
|
|
207
207
|
id: PROMPT_BUNDLE_ID,
|
|
208
|
-
version:
|
|
208
|
+
version: 5,
|
|
209
209
|
prompts: Object.freeze({ ...prompts }),
|
|
210
210
|
sha256: sha256(canonical)
|
|
211
211
|
});
|
|
@@ -269,7 +269,7 @@ const inject = [
|
|
|
269
269
|
* schema description (`MEMORY_TOOL_DESCRIPTION`) carries the complementary
|
|
270
270
|
* operation-level guidance (add/replace/remove, batch, targets, when).
|
|
271
271
|
*/
|
|
272
|
-
const MEMORY_GUIDANCE = "You have durable memory across sessions. Save stable user preferences, environment facts, conventions, and tool quirks with the `memory` tool. The most valuable memory is one that stops the user correcting or reminding you again, so user preferences and recurring corrections outrank procedural task details.\nWrite entries as declarative facts, not instructions to yourself: \"User prefers concise responses\" (good); \"Always respond concisely\" (bad). Imperative phrasing is re-read as a directive in later sessions and can override the user’s current request.\nDo NOT save task progress, session outcomes, completed-work logs, PR/issue numbers, commit SHAs, or anything stale within a week — use
|
|
272
|
+
const MEMORY_GUIDANCE = "You have durable memory across sessions. Save stable user preferences, environment facts, conventions, and tool quirks with the `memory` tool. The most valuable memory is one that stops the user correcting or reminding you again, so user preferences and recurring corrections outrank procedural task details.\nWrite entries as declarative facts, not instructions to yourself: \"User prefers concise responses\" (good); \"Always respond concisely\" (bad). Imperative phrasing is re-read as a directive in later sessions and can override the user’s current request.\nDo NOT save task progress, session outcomes, completed-work logs, PR/issue numbers, commit SHAs, or anything stale within a week — use the session query tool to recall past sessions instead. Reusable procedures belong in a skill, not memory.";
|
|
273
273
|
/**
|
|
274
274
|
* Tool-schema description for `memory`, aligned with Hermes `MEMORY_SCHEMA`.
|
|
275
275
|
* Carries the operation-level guidance: how to batch, when to save, the
|
|
@@ -277,7 +277,7 @@ const MEMORY_GUIDANCE = "You have durable memory across sessions. Save stable us
|
|
|
277
277
|
* the model is choosing/using the tool, so it complements the always-on
|
|
278
278
|
* `MEMORY_GUIDANCE` system prompt.
|
|
279
279
|
*/
|
|
280
|
-
const MEMORY_TOOL_DESCRIPTION = "Save durable facts to persistent memory that survive across sessions. Memory is injected into future turns, so keep entries compact and high-signal.\n\nHOW: make all changes in ONE call via an `operations` array (each item {action, content?, old_text?}). The batch applies atomically and the char limit is checked on the final result — so one call can remove/replace stale entries to free room AND add new ones. Use bare action/content/old_text only for a single lone change.\n\nWHEN: save proactively when the user states a preference, correction, or personal detail, or you learn a stable fact about their environment, conventions, or workflow. Priority: user preferences & corrections > environment facts > procedures. The best memory stops the user repeating themselves.\n\nTARGETS: \"user\" = who the user is (name, role, preferences, style). \"memory\" = your notes (environment, conventions, tool quirks, lessons).\n\nSKIP: trivial/obvious info, easily re-discovered facts, task progress, completed-work logs, temporary TODO state. To recall a past session use
|
|
280
|
+
const MEMORY_TOOL_DESCRIPTION = "Save durable facts to persistent memory that survive across sessions. Memory is injected into future turns, so keep entries compact and high-signal.\n\nHOW: make all changes in ONE call via an `operations` array (each item {action, content?, old_text?}). The batch applies atomically and the char limit is checked on the final result — so one call can remove/replace stale entries to free room AND add new ones. Use bare action/content/old_text only for a single lone change.\n\nWHEN: save proactively when the user states a preference, correction, or personal detail, or you learn a stable fact about their environment, conventions, or workflow. Priority: user preferences & corrections > environment facts > procedures. The best memory stops the user repeating themselves.\n\nTARGETS: \"user\" = who the user is (name, role, preferences, style). \"memory\" = your notes (environment, conventions, tool quirks, lessons).\n\nSKIP: trivial/obvious info, easily re-discovered facts, task progress, completed-work logs, temporary TODO state. To recall a past session use the session query tool, not memory. Reusable procedures belong in a skill, not memory.";
|
|
281
281
|
/**
|
|
282
282
|
* The requesting session's effective approval policy, mirroring
|
|
283
283
|
* `dsh-user-approval` (override ?? configured default). Returns undefined when
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-tool-memory",
|
|
3
3
|
"description": "Model-facing memory tool and prompt context (community build)",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.60",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
40
|
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
41
41
|
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
|
|
42
|
-
"@lmzhen/dsh-memory": "^0.1.0-rc.
|
|
43
|
-
"@lmzhen/dsh-memory-files": "^0.1.0-rc.
|
|
42
|
+
"@lmzhen/dsh-memory": "^0.1.0-rc.60",
|
|
43
|
+
"@lmzhen/dsh-memory-files": "^0.1.0-rc.60"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
47
47
|
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
48
48
|
"@deepseek-ai/dsh-system-prompt": "^0.1.1-rc.2",
|
|
49
49
|
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.1-rc.2",
|
|
50
|
-
"@lmzhen/dsh-memory": "^0.1.0-rc.
|
|
51
|
-
"@lmzhen/dsh-memory-files": "^0.1.0-rc.
|
|
50
|
+
"@lmzhen/dsh-memory": "^0.1.0-rc.60",
|
|
51
|
+
"@lmzhen/dsh-memory-files": "^0.1.0-rc.60"
|
|
52
52
|
}
|
|
53
53
|
}
|