diff --git a/src/lib/agentSkills/schemas.ts b/src/lib/agentSkills/schemas.ts index f6538a1f9092..0f77d66ba3a2 100644 --- a/src/lib/agentSkills/schemas.ts +++ b/src/lib/agentSkills/schemas.ts @@ -34,8 +34,3 @@ export const GenerateBodySchema = z.object({ prune: z.boolean().default(false), onlyIds: z.array(z.string()).optional(), }); - -export type AgentSkillT = z.infer; -export type SkillCoverageT = z.infer; -export type ListQueryT = z.infer; -export type GenerateBodyT = z.infer; diff --git a/tests/unit/agentSkills-schemas.test.ts b/tests/unit/agentSkills-schemas.test.ts index 7172f3e7aa7a..7d6cf38fc8dd 100644 --- a/tests/unit/agentSkills-schemas.test.ts +++ b/tests/unit/agentSkills-schemas.test.ts @@ -4,6 +4,20 @@ import assert from "node:assert/strict"; const { AgentSkillSchema, SkillCoverageSchema, ListQuerySchema, GenerateBodySchema } = await import("../../src/lib/agentSkills/schemas.ts"); +test("agent skills schemas module exposes runtime validators", async () => { + const schemas = await import("../../src/lib/agentSkills/schemas.ts"); + + for (const key of [ + "AgentSkillSchema", + "GenerateBodySchema", + "ListQuerySchema", + "SkillCategorySchema", + "SkillCoverageSchema", + ]) { + assert.equal(typeof schemas[key].safeParse, "function", `${key} should stay exported`); + } +}); + // ─── AgentSkillSchema ───────────────────────────────────────────────────────── test("AgentSkillSchema — valid api skill parses successfully", () => { @@ -105,7 +119,15 @@ test("AgentSkillSchema — optional fields absent parses successfully", () => { test("AgentSkillSchema — .parse throws on invalid input", () => { assert.throws(() => { - AgentSkillSchema.parse({ id: "bad id", name: "", description: "", category: "api", area: "x", rawUrl: "x", githubUrl: "x" }); + AgentSkillSchema.parse({ + id: "bad id", + name: "", + description: "", + category: "api", + area: "x", + rawUrl: "x", + githubUrl: "x", + }); }); });