style(skills): align formatting cleanup for dedupe changes
This commit is contained in:
@@ -147,10 +147,8 @@ describe("listSkillCommandsForAgents", () => {
|
||||
},
|
||||
});
|
||||
const names = commands.map((entry) => entry.name);
|
||||
// demo-skill appears in both workspaces; only the first registration (demo_skill) survives.
|
||||
expect(names).toContain("demo_skill");
|
||||
expect(names).not.toContain("demo_skill_2");
|
||||
// extra-skill is unique to the research workspace and should be present.
|
||||
expect(names).toContain("extra_skill");
|
||||
});
|
||||
|
||||
|
||||
@@ -46,10 +46,6 @@ export function listSkillCommandsForWorkspace(params: {
|
||||
});
|
||||
}
|
||||
|
||||
// Deduplicate skill commands by skillName, keeping the first registration.
|
||||
// When multiple agents have a skill with the same name (e.g. one with a
|
||||
// workspace override and one from bundled), the suffix-renamed entries
|
||||
// (github_2, github_3…) are dropped so every interface sees a clean list.
|
||||
function dedupeBySkillName(commands: SkillCommandSpec[]): SkillCommandSpec[] {
|
||||
const seen = new Set<string>();
|
||||
const out: SkillCommandSpec[] = [];
|
||||
@@ -129,9 +125,6 @@ export function listSkillCommandsForAgents(params: {
|
||||
entries.push(command);
|
||||
}
|
||||
}
|
||||
// Dedupe by skillName across workspaces so every interface (Discord, TUI,
|
||||
// Slack, text) sees a consistent command list without platform-specific
|
||||
// workarounds.
|
||||
return dedupeBySkillName(entries);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ function formatThreadBindingDurationForConfigLabel(durationMs: number): string {
|
||||
return label === "disabled" ? "off" : label;
|
||||
}
|
||||
|
||||
|
||||
function appendPluginCommandSpecs(params: {
|
||||
commandSpecs: NativeCommandSpec[];
|
||||
runtime: RuntimeEnv;
|
||||
|
||||
Reference in New Issue
Block a user