@compilr-dev/sdk 0.25.0 → 0.25.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/dist/skills/resolver.d.ts +5 -4
- package/dist/skills/resolver.js +20 -5
- package/package.json +1 -1
|
@@ -62,10 +62,11 @@ export declare function resolveSkillsForAgent(skills: CustomSkill[], context: Sk
|
|
|
62
62
|
* than once. Every judgement lives here: which fields of the agent matter, and what an absent
|
|
63
63
|
* allowlist means.
|
|
64
64
|
*
|
|
65
|
-
* ⚠️ `enabledSkills
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
65
|
+
* ⚠️ `enabledSkills` DOES NOT FOLLOW THE MCP GRANT CONTRACT, and must not be made to. There,
|
|
66
|
+
* `[]` means "granted nothing" because the field was new. Here both `undefined` and `[]` mean
|
|
67
|
+
* "unrestricted": the field predates choosable skills, `createCustomAgentDefinition` normalises
|
|
68
|
+
* `undefined` to `[]`, and every UI that collects it says empty means all. Only a NON-EMPTY list
|
|
69
|
+
* filters.
|
|
69
70
|
*
|
|
70
71
|
* @param pool every skill installed for this machine/project, unfiltered
|
|
71
72
|
* @param agent the agent being built — role, id and its allowlist come from here
|
package/dist/skills/resolver.js
CHANGED
|
@@ -46,7 +46,21 @@ export function resolveLayeredSkills(layers) {
|
|
|
46
46
|
*/
|
|
47
47
|
export function resolveSkillsForAgent(skills, context) {
|
|
48
48
|
const toolSet = context.toolNames instanceof Set ? context.toolNames : new Set(context.toolNames ?? []);
|
|
49
|
-
|
|
49
|
+
/*
|
|
50
|
+
⚠️ AN EMPTY ALLOWLIST MEANS "UNRESTRICTED", NOT "NOTHING" — the opposite of the MCP grant
|
|
51
|
+
contract, and deliberately so. `enabledSkills` predates model-choosable skills and already had
|
|
52
|
+
a meaning, stated in three places: `CustomAgentDefinition.enabledSkills` is documented "Empty =
|
|
53
|
+
all skills, non-empty = filtered", `createCustomAgentDefinition` normalises `undefined` to `[]`
|
|
54
|
+
with the same comment, and Desktop's spawn dialog tells the user "Empty = all skills enabled".
|
|
55
|
+
|
|
56
|
+
0.25.0 copied the MCP reading (`[]` = granted nothing) onto this field and inverted it. Because
|
|
57
|
+
the definition normalises to `[]`, EVERY custom agent ever created carries one — so every one
|
|
58
|
+
of them silently got no skills at all, having been told empty meant everything.
|
|
59
|
+
|
|
60
|
+
MCP grants could afford the stricter reading because they were new and nothing had a prior
|
|
61
|
+
meaning. This field is not new. Honour what the UI has been promising.
|
|
62
|
+
*/
|
|
63
|
+
const allowlist = context.enabledSkills?.length ? new Set(context.enabledSkills) : null;
|
|
50
64
|
return skills.filter((skill) => {
|
|
51
65
|
if (skill.enabled === false)
|
|
52
66
|
return false;
|
|
@@ -87,10 +101,11 @@ export function resolveSkillsForAgent(skills, context) {
|
|
|
87
101
|
* than once. Every judgement lives here: which fields of the agent matter, and what an absent
|
|
88
102
|
* allowlist means.
|
|
89
103
|
*
|
|
90
|
-
* ⚠️ `enabledSkills
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
104
|
+
* ⚠️ `enabledSkills` DOES NOT FOLLOW THE MCP GRANT CONTRACT, and must not be made to. There,
|
|
105
|
+
* `[]` means "granted nothing" because the field was new. Here both `undefined` and `[]` mean
|
|
106
|
+
* "unrestricted": the field predates choosable skills, `createCustomAgentDefinition` normalises
|
|
107
|
+
* `undefined` to `[]`, and every UI that collects it says empty means all. Only a NON-EMPTY list
|
|
108
|
+
* filters.
|
|
94
109
|
*
|
|
95
110
|
* @param pool every skill installed for this machine/project, unfiltered
|
|
96
111
|
* @param agent the agent being built — role, id and its allowlist come from here
|