improve(setup): clarify local provider actions

This commit is contained in:
Vincent Koc
2026-08-01 00:26:40 +08:00
parent 73aa80a632
commit 0e24d596c0
22 changed files with 89 additions and 35 deletions
+2
View File
@@ -1258,6 +1258,7 @@ describe("loadPluginManifestRegistry", () => {
assistantPriority: 10,
assistantVisibility: "visible",
appGuidedSecret: true,
appGuidedActionLabel: "Connect account",
appGuidedDiscovery: true,
},
],
@@ -1326,6 +1327,7 @@ describe("loadPluginManifestRegistry", () => {
assistantPriority: 10,
assistantVisibility: "visible",
appGuidedSecret: true,
appGuidedActionLabel: "Connect account",
appGuidedDiscovery: true,
},
]);
@@ -321,6 +321,7 @@ export function normalizeProviderAuthChoices(
const cliOption = normalizeOptionalString(entry.cliOption) ?? "";
const cliDescription = normalizeOptionalString(entry.cliDescription) ?? "";
const appGuidedSecret = entry.appGuidedSecret === true;
const appGuidedActionLabel = normalizeOptionalString(entry.appGuidedActionLabel) ?? "";
const appGuidedAuth =
entry.appGuidedAuth === "oauth" || entry.appGuidedAuth === "device-code"
? entry.appGuidedAuth
@@ -351,6 +352,7 @@ export function normalizeProviderAuthChoices(
...(cliOption ? { cliOption } : {}),
...(cliDescription ? { cliDescription } : {}),
...(appGuidedSecret ? { appGuidedSecret: true } : {}),
...(appGuidedActionLabel ? { appGuidedActionLabel } : {}),
...(appGuidedAuth ? { appGuidedAuth } : {}),
...(onboardingScopes.length > 0 ? { onboardingScopes } : {}),
});
+2
View File
@@ -550,6 +550,8 @@ export type PluginManifestProviderAuthChoice = {
cliDescription?: string;
/** One pasted secret plus provider defaults is sufficient for app-guided setup. */
appGuidedSecret?: boolean;
/** Short provider-owned command label for starting app-guided setup. */
appGuidedActionLabel?: string;
/** Provider-owned interactive login that native setup clients can render generically. */
appGuidedAuth?: "oauth" | "device-code";
/**
@@ -322,6 +322,7 @@ describe("provider auth choice manifest helpers", () => {
cliFlag: "--openai-api-key",
cliOption: "--openai-api-key <key>",
appGuidedSecret: true,
appGuidedActionLabel: "Connect account",
appGuidedDiscovery: true,
},
],
@@ -368,6 +369,7 @@ describe("provider auth choice manifest helpers", () => {
cliFlag: "--openai-api-key",
cliOption: "--openai-api-key <key>",
appGuidedSecret: true,
appGuidedActionLabel: "Connect account",
appGuidedDiscovery: true,
},
]);
+2
View File
@@ -31,6 +31,7 @@ export type ProviderAuthChoiceMetadata = {
cliOption?: string;
cliDescription?: string;
appGuidedSecret?: boolean;
appGuidedActionLabel?: string;
appGuidedDiscovery?: boolean;
appGuidedAuth?: "oauth" | "device-code";
onboardingScopes?: ("text-inference" | "image-generation" | "music-generation")[];
@@ -113,6 +114,7 @@ function toProviderAuthChoiceCandidate(params: {
...(choice.cliOption ? { cliOption: choice.cliOption } : {}),
...(choice.cliDescription ? { cliDescription: choice.cliDescription } : {}),
...(choice.appGuidedSecret ? { appGuidedSecret: true } : {}),
...(choice.appGuidedActionLabel ? { appGuidedActionLabel: choice.appGuidedActionLabel } : {}),
...(choice.appGuidedDiscovery ? { appGuidedDiscovery: true } : {}),
...(choice.appGuidedAuth ? { appGuidedAuth: choice.appGuidedAuth } : {}),
...(choice.onboardingScopes ? { onboardingScopes: choice.onboardingScopes } : {}),