@lmzhen/dsh-tool-memory 0.1.0 → 0.2.0-rc.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/lib/index.js +8 -5
- 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@9";
|
|
28
28
|
const MEMORY_REVIEW_PROMPT = `[Auto-review — Memory]
|
|
29
29
|
Review the conversation above and consider saving to memory if appropriate.
|
|
30
30
|
|
|
@@ -55,7 +55,8 @@ Preference order — prefer the earliest action that fits, but do pick one when
|
|
|
55
55
|
• templates/<name>.<ext> — starter files meant to be copied and modified (boilerplate configs, scaffolding, a known-good example the agent can reproduce with modifications).
|
|
56
56
|
• scripts/<name>.<ext> — statically re-runnable actions the skill can invoke directly (verification scripts, fixture generators, deterministic probes, anything the agent should run rather than hand-type each time).
|
|
57
57
|
Add support files via skill_manage action=write_file with file_path starting 'references/', 'templates/', or 'scripts/'. The umbrella's SKILL.md should gain a one-line pointer to any new support file so future agents know it exists.
|
|
58
|
-
4.
|
|
58
|
+
4. RESTRUCTURE a loaded skill whose body grew log-like — rc/sha/date-dense sections, session-detail spirals, or a fat body with no support files. Use skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section (from that heading to the next heading) moves into the support file and its position becomes a pointer line. The skill's name and directory never change. Only propose headings that exist verbatim in the body; never invent one, and never restructure a healthy small skill.
|
|
59
|
+
5. CREATE A NEW CLASS-LEVEL UMBRELLA SKILL when no existing skill covers the class. The name MUST be at the class level. The name MUST NOT be a specific PR number, error string, feature codename, library-alone name, or 'fix-X / debug-Y / audit-Z-today' session artifact. If the proposed name only makes sense for today's task, it's wrong — fall back to (1), (2), or (3).
|
|
59
60
|
|
|
60
61
|
User-preference embedding (important): when the user expressed a style/format/workflow preference, the update belongs in the SKILL.md body, not just in memory. Memory captures 'who the user is and what the current situation and state of your operations are'; skills capture 'how to do this class of task for this user'. When they complain about how you handled a task, the skill that governs that task needs to carry the lesson.
|
|
61
62
|
|
|
@@ -100,7 +101,8 @@ Preference order for skills — pick the earliest that fits:
|
|
|
100
101
|
1. UPDATE A CURRENTLY-LOADED SKILL. Check what skills were loaded or read in the conversation. If one of them covers the learning, PATCH it first. It was in play; it's the right place.
|
|
101
102
|
2. UPDATE AN EXISTING UMBRELLA. Patch it.
|
|
102
103
|
3. ADD A SUPPORT FILE under an existing umbrella via skill_manage action=write_file. Three kinds: references/<topic>.md for session-specific detail OR condensed knowledge banks (quoted research, API docs excerpts, domain notes) written concise and task-focused; templates/<name>.<ext> for starter files meant to be copied and modified; scripts/<name>.<ext> for statically re-runnable actions (verification, fixture generators, probes). Add a one-line pointer in SKILL.md so future agents find them.
|
|
103
|
-
4.
|
|
104
|
+
4. RESTRUCTURE a loaded skill whose body grew log-like (rc/sha/date-dense sections, session-detail spirals, fat body with no support files) via skill_manage action=restructure with restructure: [{"heading": "<the exact ## heading text>", "to_file": "references/<topic>.md"}] — the ENTIRE ## section moves into the support file and its position becomes a pointer line; the skill's name and directory never change. Only propose headings that exist verbatim in the body.
|
|
105
|
+
5. CREATE A NEW CLASS-LEVEL UMBRELLA when nothing exists. Name at the class level — NOT a PR number, error string, codename, library-alone name, or 'fix-X / debug-Y' session artifact. If the name only fits today's task, fall back to (1), (2), or (3).
|
|
104
106
|
|
|
105
107
|
Two-tier deposition discipline (DSH addition): classify before writing — PATTERN (symptom → mechanism → fix → verification) goes in the SKILL.md body; LOG (commit SHAs, npm/profile states, this release's change list, this session's narrative) goes in a references/ file. Body density IS reuse rate; a pattern fits in 2-8 physical lines.
|
|
106
108
|
|
|
@@ -166,6 +168,7 @@ When done, write a human summary THEN the structured machine-readable block. The
|
|
|
166
168
|
\`\`\`yaml
|
|
167
169
|
consolidations:
|
|
168
170
|
- from: <old-skill-name>
|
|
171
|
+
mode: reference # optional — ONLY for a 'demote': source is narrow-but-valuable session detail, write it as references/<source>.md under the umbrella instead of appending to the body. Default is append. Place this line BEFORE into:. NEVER use reference when the source body links its own references/ templates/ scripts/ files.
|
|
169
172
|
into: <umbrella-skill-name>
|
|
170
173
|
reason: <one short sentence — why merged, not just 'similar'>
|
|
171
174
|
prunings:
|
|
@@ -203,12 +206,12 @@ function sha256(text) {
|
|
|
203
206
|
function createPromptBundle(prompts) {
|
|
204
207
|
const canonical = JSON.stringify({
|
|
205
208
|
id: PROMPT_BUNDLE_ID,
|
|
206
|
-
version:
|
|
209
|
+
version: 9,
|
|
207
210
|
prompts: Object.fromEntries(Object.entries(prompts).sort())
|
|
208
211
|
});
|
|
209
212
|
return Object.freeze({
|
|
210
213
|
id: PROMPT_BUNDLE_ID,
|
|
211
|
-
version:
|
|
214
|
+
version: 9,
|
|
212
215
|
prompts: Object.freeze({ ...prompts }),
|
|
213
216
|
sha256: sha256(canonical)
|
|
214
217
|
});
|
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.
|
|
4
|
+
"version": "0.2.0-rc.1",
|
|
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.
|
|
43
|
-
"@lmzhen/dsh-memory-files": "^0.
|
|
42
|
+
"@lmzhen/dsh-memory": "^0.2.0-rc.1",
|
|
43
|
+
"@lmzhen/dsh-memory-files": "^0.2.0-rc.1"
|
|
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.
|
|
51
|
-
"@lmzhen/dsh-memory-files": "^0.
|
|
50
|
+
"@lmzhen/dsh-memory": "^0.2.0-rc.1",
|
|
51
|
+
"@lmzhen/dsh-memory-files": "^0.2.0-rc.1"
|
|
52
52
|
}
|
|
53
53
|
}
|