@lmzhen/dsh-evolution-skill-catalog 0.3.74 → 0.3.77
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 +2 -0
- package/lib/index.js +25 -9
- package/package.json +5 -11
- package/lib/invariant.js +0 -8
- package/lib/types/invariant.d.ts +0 -5
package/README.md
CHANGED
|
@@ -29,3 +29,5 @@ Independent of request-prefix construction. This package does not alter the asse
|
|
|
29
29
|
- **`content` is the BODY, not the file (V27 G5.3).** The published `SkillDefinition.content` is the SKILL.md text AFTER the frontmatter block, matching the upstream filesystem provider (`skill-filesystem`: `content: parsed.body.trim()`). This provider shadows that provider for the same skills, so publishing the whole file made the model load a different skill depending on which provider served it. A file whose frontmatter block cannot be read keeps its raw text (the entry stays visible; the audit reports the file through `frontmatterCatalogInvalid`).
|
|
30
30
|
- **Protection markers are best-effort per entry (A1-17, v18).** When the directory listing AND the per-marker probes fail, `SkillSummary.protectionUnknown` is true and consumers (curator, maintenance) treat the entry as protected rather than unprotected.
|
|
31
31
|
|
|
32
|
+
**Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
|
|
33
|
+
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
|
-
import { SKILL_NAME_RE,
|
|
2
|
+
import { SKILL_NAME_RE, evolutionIoAdapter, newSkillLibrary, parseFrontmatter } from "@lmzhen/dsh-evolution-core";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
//#region lib/types/index.js
|
|
5
5
|
/**
|
|
@@ -61,7 +61,10 @@ function apply(ctx, rawConfig = {}) {
|
|
|
61
61
|
userInvocable: rawConfig.userInvocable ?? true
|
|
62
62
|
};
|
|
63
63
|
const io = evolutionIoAdapter(() => ctx.evolutionIo.provider());
|
|
64
|
-
const library =
|
|
64
|
+
const library = newSkillLibrary({
|
|
65
|
+
config: rawConfig,
|
|
66
|
+
io
|
|
67
|
+
});
|
|
65
68
|
const included = new Set(rawConfig.includeSkillNames ?? []);
|
|
66
69
|
const excluded = new Set(rawConfig.excludeSkillNames ?? []);
|
|
67
70
|
const visible = (name) => (included.size === 0 || included.has(name)) && !excluded.has(name);
|
|
@@ -112,7 +115,10 @@ function apply(ctx, rawConfig = {}) {
|
|
|
112
115
|
};
|
|
113
116
|
async function summaries() {
|
|
114
117
|
const stamp = await io.mtime?.(library.root) ?? null;
|
|
115
|
-
if (summariesCache !== null && (stamp === null || summariesStamp === stamp)) return
|
|
118
|
+
if (summariesCache !== null && (stamp === null || summariesStamp === stamp)) return {
|
|
119
|
+
summaries: summariesCache,
|
|
120
|
+
complete: true
|
|
121
|
+
};
|
|
116
122
|
if (summariesCache !== null && stamp !== null) control?.invalidate();
|
|
117
123
|
const epochAtScanStart = summariesEpoch;
|
|
118
124
|
let scanned;
|
|
@@ -124,7 +130,10 @@ function apply(ctx, rawConfig = {}) {
|
|
|
124
130
|
lastScanWarn = message;
|
|
125
131
|
ctx.logger.warn(`evolution-skill-catalog: ${message}`);
|
|
126
132
|
}
|
|
127
|
-
return
|
|
133
|
+
return {
|
|
134
|
+
summaries: summariesCache ?? [],
|
|
135
|
+
complete: false
|
|
136
|
+
};
|
|
128
137
|
}
|
|
129
138
|
if (lastScanWarn !== "") {
|
|
130
139
|
control?.invalidate();
|
|
@@ -138,12 +147,15 @@ function apply(ctx, rawConfig = {}) {
|
|
|
138
147
|
if (!parsed) continue;
|
|
139
148
|
invocationMap.set(summary.name, invocationFromFrontmatter(summary.name, parsed.frontmatter));
|
|
140
149
|
}
|
|
141
|
-
invocationCache = invocationMap;
|
|
142
150
|
if (epochAtScanStart === summariesEpoch) {
|
|
143
151
|
summariesCache = scanned;
|
|
144
152
|
summariesStamp = stamp;
|
|
153
|
+
invocationCache = invocationMap;
|
|
145
154
|
}
|
|
146
|
-
return
|
|
155
|
+
return {
|
|
156
|
+
summaries: scanned,
|
|
157
|
+
complete: true
|
|
158
|
+
};
|
|
147
159
|
}
|
|
148
160
|
const dropSummariesCache = () => {
|
|
149
161
|
summariesEpoch += 1;
|
|
@@ -156,9 +168,9 @@ function apply(ctx, rawConfig = {}) {
|
|
|
156
168
|
name: "dsh-evolution",
|
|
157
169
|
async list(options) {
|
|
158
170
|
options.signal?.throwIfAborted();
|
|
159
|
-
const
|
|
171
|
+
const scan = await summaries();
|
|
160
172
|
options.signal?.throwIfAborted();
|
|
161
|
-
|
|
173
|
+
const candidates = scan.summaries.filter((summary) => {
|
|
162
174
|
if (!visible(summary.name)) return false;
|
|
163
175
|
if (!publishableSkill(summary.name, summary.description)) {
|
|
164
176
|
warnUnpublishable(summary.name, summary.description);
|
|
@@ -180,12 +192,16 @@ function apply(ctx, rawConfig = {}) {
|
|
|
180
192
|
path: summary.path
|
|
181
193
|
}
|
|
182
194
|
}));
|
|
195
|
+
return scan.complete ? candidates : {
|
|
196
|
+
candidates,
|
|
197
|
+
complete: false
|
|
198
|
+
};
|
|
183
199
|
},
|
|
184
200
|
async get(candidate, options) {
|
|
185
201
|
options?.signal?.throwIfAborted();
|
|
186
202
|
const name = candidate.name;
|
|
187
203
|
if (!visible(name)) return void 0;
|
|
188
|
-
const summary = (await summaries()).find((item) => item.name === name);
|
|
204
|
+
const summary = (await summaries()).summaries.find((item) => item.name === name);
|
|
189
205
|
if (!summary) return void 0;
|
|
190
206
|
if (!publishableSkill(summary.name, summary.description)) {
|
|
191
207
|
warnUnpublishable(summary.name, summary.description);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-skill-catalog",
|
|
3
3
|
"description": "Native ctx.skills provider for the evolution-managed skill tree (community build)",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.77",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./package.json": "./package.json"
|
|
26
22
|
},
|
|
27
23
|
"files": [
|
|
@@ -31,18 +27,16 @@
|
|
|
31
27
|
"license": "MIT",
|
|
32
28
|
"dependencies": {
|
|
33
29
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
34
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
30
|
+
"@lmzhen/dsh-evolution-core": "^0.3.77"
|
|
35
31
|
},
|
|
36
32
|
"peerDependencies": {
|
|
37
33
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
38
|
-
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
|
|
39
34
|
"@deepseek-ai/dsh-skill": "^0.1.5-rc.2",
|
|
40
|
-
"@lmzhen/dsh-evolution-io": "^0.3.
|
|
35
|
+
"@lmzhen/dsh-evolution-io": "^0.3.77"
|
|
41
36
|
},
|
|
42
37
|
"devDependencies": {
|
|
43
|
-
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
|
|
44
38
|
"@deepseek-ai/dsh-skill": "^0.1.5-rc.2",
|
|
45
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
46
|
-
"@lmzhen/dsh-evolution-io": "^0.3.
|
|
39
|
+
"@lmzhen/dsh-evolution-core": "^0.3.77",
|
|
40
|
+
"@lmzhen/dsh-evolution-io": "^0.3.77"
|
|
47
41
|
}
|
|
48
42
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
const PACKAGE_NAME = "@lmzhen/dsh-evolution-skill-catalog";
|
|
3
|
-
const name = "evolution-skill-catalog-invariant";
|
|
4
|
-
const inject = ["invariants"];
|
|
5
|
-
const install = () => {};
|
|
6
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
7
|
-
//#endregion
|
|
8
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED