diff --git a/packages/core/src/agent/skills/eligibility.test.ts b/packages/core/src/agent/skills/eligibility.test.ts index 08af1db1..8d888abb 100644 --- a/packages/core/src/agent/skills/eligibility.test.ts +++ b/packages/core/src/agent/skills/eligibility.test.ts @@ -284,56 +284,6 @@ describe("eligibility", () => { expect(result.reasons?.length).toBe(2); }); - it("should be eligible when env var provided via skillConfig", () => { - delete process.env.API_KEY; - - const skill = createSkill("test", { - name: "Test Skill", - metadata: { - requires: { - env: ["API_KEY"], - }, - }, - }); - - const result = checkEligibility(skill, { - platform: "darwin", - config: { - entries: { - test: { - env: { API_KEY: "secret" }, - }, - }, - }, - }); - expect(result.eligible).toBe(true); - }); - - it("should be eligible when env var provided via apiKey + primaryEnv", () => { - delete process.env.GEMINI_API_KEY; - - const skill = createSkill("test", { - name: "Test Skill", - metadata: { - primaryEnv: "GEMINI_API_KEY", - requires: { - env: ["GEMINI_API_KEY"], - }, - }, - }); - - const result = checkEligibility(skill, { - platform: "darwin", - config: { - entries: { - test: { - apiKey: "my-api-key", - }, - }, - }, - }); - expect(result.eligible).toBe(true); - }); }); describe("always flag", () => { diff --git a/packages/core/src/agent/skills/eligibility.ts b/packages/core/src/agent/skills/eligibility.ts index 62d96da5..3e1025fc 100644 --- a/packages/core/src/agent/skills/eligibility.ts +++ b/packages/core/src/agent/skills/eligibility.ts @@ -308,12 +308,6 @@ export function checkEligibilityDetailed( // Check if env var exists if (envExists(envVar)) continue; - // Check if provided via skill config env - if (skillConfig?.env?.[envVar]) continue; - - // Check if provided via apiKey + primaryEnv match - if (skillConfig?.apiKey && metadata?.primaryEnv === envVar) continue; - missingEnvVars.push(envVar); reasons.push(`Required environment variable not set: ${envVar}`); } @@ -443,9 +437,8 @@ function getBinaryInstallHint(binary: string, platform: NodeJS.Platform): string /** * Generate hints for missing environment variables */ -function generateEnvHint(envVars: string[], skill: Skill): string { +function generateEnvHint(envVars: string[], _skill: Skill): string { const hints: string[] = []; - const skillKey = getSkillKey(skill); for (const envVar of envVars) { // Check for well-known API key patterns @@ -463,9 +456,6 @@ function generateEnvHint(envVars: string[], skill: Skill): string { } } - // Also suggest config-based approach - hints.push(`Or configure via: skills.${skillKey}.env.${envVars[0]}`); - return hints.slice(0, 3).join(" OR "); } diff --git a/packages/core/src/agent/skills/types.ts b/packages/core/src/agent/skills/types.ts index a679f039..0369a491 100644 --- a/packages/core/src/agent/skills/types.ts +++ b/packages/core/src/agent/skills/types.ts @@ -66,8 +66,6 @@ export interface SkillMetadata { always?: boolean | undefined; /** Custom key for config lookup (defaults to skill id) */ skillKey?: string | undefined; - /** Primary environment variable for API key injection */ - primaryEnv?: string | undefined; /** Emoji for display (e.g., "📝") */ emoji?: string | undefined; /** Homepage URL for documentation */ @@ -162,10 +160,6 @@ export interface Skill { export interface SkillConfig { /** Explicitly enable/disable this skill */ enabled?: boolean | undefined; - /** API key for skills with primaryEnv set */ - apiKey?: string | undefined; - /** Environment variables to inject */ - env?: Record | undefined; /** Custom per-skill configuration */ config?: Record | undefined; }