MCPcopy Create free account
hub / github.com/cli/cli / unexpectedSkills

Function unexpectedSkills

evals/src/core/observer.ts:171–187  ·  view source on GitHub ↗
(events: unknown[], expected: string[])

Source from the content-addressed store, hash-verified

169
170/** Returns enabled skills the runtime offered the agent beyond those the trial intends. */
171export function unexpectedSkills(events: unknown[], expected: string[]): string[] {
172 const offered = new Set<string>();
173 for (const value of events) {
174 if (typeof value !== "object" || value === null) continue;
175 const event = value as Record<string, unknown>;
176 if (event.type !== "session.skills_loaded") continue;
177 const skills = (event.data as Record<string, unknown> | undefined)?.skills;
178 if (!Array.isArray(skills)) continue;
179 for (const skill of skills) {
180 if (typeof skill === "object" && skill !== null && (skill as Record<string, unknown>).enabled !== false) {
181 const name = (skill as Record<string, unknown>).name;
182 if (typeof name === "string") offered.add(name);
183 }
184 }
185 }
186 return [...offered].filter(name => !expected.includes(name)).sort();
187}

Callers 1

trialMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected