@lmzhen/dsh-evolution-skill-catalog 0.3.71 → 0.3.73
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 +47 -2
- package/lib/types/index.d.ts +7 -2
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -76,6 +76,40 @@ function apply(ctx, rawConfig = {}) {
|
|
|
76
76
|
let summariesStamp = null;
|
|
77
77
|
let summariesEpoch = 0;
|
|
78
78
|
let lastScanWarn = "";
|
|
79
|
+
let invocationCache = null;
|
|
80
|
+
const warnedFrontmatter = /* @__PURE__ */ new Set();
|
|
81
|
+
const warnFrontmatterOnce = (name, key, detail) => {
|
|
82
|
+
const slot = `${name}:${key}`;
|
|
83
|
+
if (warnedFrontmatter.has(slot)) return;
|
|
84
|
+
warnedFrontmatter.add(slot);
|
|
85
|
+
ctx.logger.warn(`evolution-skill-catalog: "${name}" frontmatter ${detail}`);
|
|
86
|
+
};
|
|
87
|
+
const frontmatterBool = (name, data, key) => {
|
|
88
|
+
if (!Object.hasOwn(data, key)) return void 0;
|
|
89
|
+
const value = data[key];
|
|
90
|
+
if (typeof value === "boolean") return value;
|
|
91
|
+
if (value === 1 || value === "1") return true;
|
|
92
|
+
if (value === 0 || value === "0") return false;
|
|
93
|
+
if (typeof value === "string") {
|
|
94
|
+
const lowered = value.toLowerCase();
|
|
95
|
+
if (lowered === "true" || lowered === "yes" || lowered === "on") return true;
|
|
96
|
+
if (lowered === "false" || lowered === "no" || lowered === "off") return false;
|
|
97
|
+
}
|
|
98
|
+
warnFrontmatterOnce(name, key, `"${key}" must be a boolean; the row-level default applies until fixed`);
|
|
99
|
+
};
|
|
100
|
+
const invocationFromFrontmatter = (name, data) => {
|
|
101
|
+
for (const legacy of [
|
|
102
|
+
"disableModelInvocation",
|
|
103
|
+
"modelInvocable",
|
|
104
|
+
"userInvocable"
|
|
105
|
+
]) if (Object.hasOwn(data, legacy)) warnFrontmatterOnce(name, legacy, `field "${legacy}" is not accepted by the upstream registry; use the canonical kebab key`);
|
|
106
|
+
const disableModel = frontmatterBool(name, data, "disable-model-invocation");
|
|
107
|
+
const user = frontmatterBool(name, data, "user-invocable");
|
|
108
|
+
return {
|
|
109
|
+
modelInvocable: disableModel !== void 0 ? !disableModel : invocation.modelInvocable,
|
|
110
|
+
userInvocable: user !== void 0 ? user : invocation.userInvocable
|
|
111
|
+
};
|
|
112
|
+
};
|
|
79
113
|
async function summaries() {
|
|
80
114
|
const stamp = await io.mtime?.(library.root) ?? null;
|
|
81
115
|
if (summariesCache !== null && (stamp === null || summariesStamp === stamp)) return summariesCache;
|
|
@@ -96,6 +130,15 @@ function apply(ctx, rawConfig = {}) {
|
|
|
96
130
|
control?.invalidate();
|
|
97
131
|
lastScanWarn = "";
|
|
98
132
|
}
|
|
133
|
+
const invocationMap = /* @__PURE__ */ new Map();
|
|
134
|
+
for (const summary of scanned) {
|
|
135
|
+
const raw = await io.readText(join(summary.path, "SKILL.md")).catch(() => null);
|
|
136
|
+
if (raw === null) continue;
|
|
137
|
+
const parsed = parseFrontmatter(raw);
|
|
138
|
+
if (!parsed) continue;
|
|
139
|
+
invocationMap.set(summary.name, invocationFromFrontmatter(summary.name, parsed.frontmatter));
|
|
140
|
+
}
|
|
141
|
+
invocationCache = invocationMap;
|
|
99
142
|
if (epochAtScanStart === summariesEpoch) {
|
|
100
143
|
summariesCache = scanned;
|
|
101
144
|
summariesStamp = stamp;
|
|
@@ -105,8 +148,10 @@ function apply(ctx, rawConfig = {}) {
|
|
|
105
148
|
const dropSummariesCache = () => {
|
|
106
149
|
summariesEpoch += 1;
|
|
107
150
|
summariesCache = null;
|
|
151
|
+
invocationCache = null;
|
|
108
152
|
control?.invalidate();
|
|
109
153
|
};
|
|
154
|
+
const invocationFor = (name) => invocationCache?.get(name) ?? invocation;
|
|
110
155
|
const provider = {
|
|
111
156
|
name: "dsh-evolution",
|
|
112
157
|
async list(options) {
|
|
@@ -124,7 +169,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
124
169
|
name: summary.name,
|
|
125
170
|
description: summary.description,
|
|
126
171
|
...summary.whenToUse !== void 0 ? { whenToUse: summary.whenToUse } : {},
|
|
127
|
-
invocation,
|
|
172
|
+
invocation: invocationFor(summary.name),
|
|
128
173
|
source: "user-dsh",
|
|
129
174
|
provider: "dsh-evolution",
|
|
130
175
|
rank: EVOLUTION_SKILL_RANK,
|
|
@@ -153,7 +198,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
153
198
|
name,
|
|
154
199
|
description: summary.description,
|
|
155
200
|
...summary.whenToUse !== void 0 ? { whenToUse: summary.whenToUse } : {},
|
|
156
|
-
invocation,
|
|
201
|
+
invocation: invocationFor(name),
|
|
157
202
|
source: "user-dsh",
|
|
158
203
|
provider: "dsh-evolution",
|
|
159
204
|
resourceBase: {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,9 +13,14 @@ export declare const name = "evolution-skill-catalog";
|
|
|
13
13
|
export declare const inject: string[];
|
|
14
14
|
export interface Config {
|
|
15
15
|
root?: string;
|
|
16
|
-
/**
|
|
16
|
+
/** Row-level DEFAULT invocation policy. OPT-10 (2026-09): a skill's own
|
|
17
|
+
* SKILL.md frontmatter (`disable-model-invocation` / `user-invocable`) now
|
|
18
|
+
* overrides this per skill — before, the row default was stamped onto every
|
|
19
|
+
* candidate and a user's `disable-model-invocation: true` in the shared
|
|
20
|
+
* tree was silently re-advertised as model-invocable. */
|
|
17
21
|
modelInvocable?: boolean;
|
|
18
|
-
/** Whether catalog skills are advertised/loadable from user surfaces
|
|
22
|
+
/** Whether catalog skills are advertised/loadable from user surfaces
|
|
23
|
+
* (per-skill `user-invocable` frontmatter overrides — see modelInvocable). */
|
|
19
24
|
userInvocable?: boolean;
|
|
20
25
|
/** Restrict the published catalog to these skill names (empty = all). */
|
|
21
26
|
includeSkillNames?: string[];
|
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.73",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
34
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
34
|
+
"@lmzhen/dsh-evolution-core": "^0.3.73"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
38
38
|
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
|
|
39
39
|
"@deepseek-ai/dsh-skill": "^0.1.5-rc.2",
|
|
40
|
-
"@lmzhen/dsh-evolution-io": "^0.3.
|
|
40
|
+
"@lmzhen/dsh-evolution-io": "^0.3.73"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@deepseek-ai/dsh-invariants": "^0.1.5-rc.2",
|
|
44
44
|
"@deepseek-ai/dsh-skill": "^0.1.5-rc.2",
|
|
45
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
46
|
-
"@lmzhen/dsh-evolution-io": "^0.3.
|
|
45
|
+
"@lmzhen/dsh-evolution-core": "^0.3.73",
|
|
46
|
+
"@lmzhen/dsh-evolution-io": "^0.3.73"
|
|
47
47
|
}
|
|
48
48
|
}
|