@lmzhen/dsh-evolution-core 0.1.0-rc.29 → 0.1.0-rc.30
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 +11 -17
- package/lib/types/curator.d.ts +4 -1
- package/lib/types/memory-store.d.ts +0 -8
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -257,7 +257,10 @@ const DEFAULT_SKILL_CONTENT_CHARS = 1e5;
|
|
|
257
257
|
//#region lib/types/curator.js
|
|
258
258
|
/**
|
|
259
259
|
* Deterministic skill curator: active → stale → archived transitions.
|
|
260
|
-
* Pure function
|
|
260
|
+
* Pure function with one deliberate side effect: records in the passed
|
|
261
|
+
* `usage` map are MUTATED (state/archived_at) to carry the transition — the
|
|
262
|
+
* caller owns the map and decides whether to clone first (dry-run) or persist
|
|
263
|
+
* after. File moves are performed by SkillLibrary.
|
|
261
264
|
*/
|
|
262
265
|
function buildCuratorRunReport(input) {
|
|
263
266
|
return {
|
|
@@ -1265,17 +1268,6 @@ var MemoryStore = class {
|
|
|
1265
1268
|
}
|
|
1266
1269
|
return parts.join("\n\n");
|
|
1267
1270
|
}
|
|
1268
|
-
async snapshot() {
|
|
1269
|
-
const [memory, user] = await Promise.all([this.read("memory"), this.read("user")]);
|
|
1270
|
-
return {
|
|
1271
|
-
memory,
|
|
1272
|
-
user
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
1275
|
-
async restoreSnapshot(snapshot) {
|
|
1276
|
-
await this.write("memory", snapshot.memory);
|
|
1277
|
-
await this.write("user", snapshot.user);
|
|
1278
|
-
}
|
|
1279
1271
|
/**
|
|
1280
1272
|
* Detect on-disk drift: true when the file is not in the canonical
|
|
1281
1273
|
* `render(normalizeEntries(raw))` form. This catches structural anomalies
|
|
@@ -1622,11 +1614,13 @@ function validateSupportPath(filePath) {
|
|
|
1622
1614
|
/**
|
|
1623
1615
|
* Index of `pattern` inside `content`, treating whitespace runs (spaces/tabs)
|
|
1624
1616
|
* as flexible and literal escape sequences (`\n`, `\t`, `\r`) as their real
|
|
1625
|
-
* characters: a whitespace run
|
|
1626
|
-
*
|
|
1627
|
-
*
|
|
1628
|
-
*
|
|
1629
|
-
*
|
|
1617
|
+
* characters: a PATTERN whitespace run matches any content run of any length
|
|
1618
|
+
* (even empty), while extra whitespace that only exists in the content is not
|
|
1619
|
+
* skipped — the flexibility is one-sided on the pattern, and a backslash-
|
|
1620
|
+
* escaped char in the pattern matches the real char in the content
|
|
1621
|
+
* (model-copy drift). Returns the [start, end) range in the ORIGINAL content
|
|
1622
|
+
* so a patch can replace exactly the matched span and keep every other byte
|
|
1623
|
+
* intact. Returns null when no fuzzy match exists.
|
|
1630
1624
|
*/
|
|
1631
1625
|
function fuzzyIndexOf(content, pattern) {
|
|
1632
1626
|
const isSpace = (char) => char !== void 0 && /[ \t]/.test(char);
|
package/lib/types/curator.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Deterministic skill curator: active → stale → archived transitions.
|
|
3
|
-
* Pure function
|
|
3
|
+
* Pure function with one deliberate side effect: records in the passed
|
|
4
|
+
* `usage` map are MUTATED (state/archived_at) to carry the transition — the
|
|
5
|
+
* caller owns the map and decides whether to clone first (dry-run) or persist
|
|
6
|
+
* after. File moves are performed by SkillLibrary.
|
|
4
7
|
*/
|
|
5
8
|
import type { UsageMap, UsageRecord } from './usage.ts';
|
|
6
9
|
export { PROTECTED_BUILTIN_SKILLS } from './constants.ts';
|
|
@@ -76,14 +76,6 @@ export declare class MemoryStore {
|
|
|
76
76
|
private mutate;
|
|
77
77
|
applyBatch(target: MemoryTarget, operations: MemoryOperation[]): Promise<MemoryApplyResult>;
|
|
78
78
|
renderContext(): Promise<string>;
|
|
79
|
-
snapshot(): Promise<{
|
|
80
|
-
memory: string[];
|
|
81
|
-
user: string[];
|
|
82
|
-
}>;
|
|
83
|
-
restoreSnapshot(snapshot: {
|
|
84
|
-
memory: string[];
|
|
85
|
-
user: string[];
|
|
86
|
-
}): Promise<void>;
|
|
87
79
|
/**
|
|
88
80
|
* Detect on-disk drift: true when the file is not in the canonical
|
|
89
81
|
* `render(normalizeEntries(raw))` form. This catches structural anomalies
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-core",
|
|
3
3
|
"description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.30",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|