fix(onboarding): hide image-only auth providers

This commit is contained in:
Vincent Koc
2026-03-21 07:42:32 -07:00
parent f10d054745
commit a3a5cad7d7
11 changed files with 158 additions and 16 deletions

View File

@@ -79,6 +79,7 @@ describe("provider wizard boundaries", () => {
choiceLabel: "OpenAI API key",
groupId: "openai",
groupLabel: "OpenAI",
onboardingScopes: ["text-inference"],
},
run: vi.fn(),
},
@@ -92,6 +93,7 @@ describe("provider wizard boundaries", () => {
label: "OpenAI API key",
groupId: "openai",
groupLabel: "OpenAI",
onboardingScopes: ["text-inference"],
},
]);
expect(
@@ -106,6 +108,39 @@ describe("provider wizard boundaries", () => {
});
});
it("preserves onboarding scopes on wizard options", () => {
const provider = makeProvider({
id: "fal",
label: "fal",
auth: [
{
id: "api-key",
label: "fal API key",
kind: "api_key",
wizard: {
choiceId: "fal-api-key",
choiceLabel: "fal API key",
groupId: "fal",
groupLabel: "fal",
onboardingScopes: ["image-generation"],
},
run: vi.fn(),
},
],
});
resolvePluginProviders.mockReturnValue([provider]);
expect(resolveProviderWizardOptions({})).toEqual([
{
value: "fal-api-key",
label: "fal API key",
groupId: "fal",
groupLabel: "fal",
onboardingScopes: ["image-generation"],
},
]);
});
it("returns method wizard metadata for canonical choices", () => {
const provider = makeProvider({
id: "anthropic",