@@ -5,13 +5,30 @@ import type { RuntimeEnv } from "../runtime.js";
55import { WizardCancelledError , type WizardPrompter } from "./prompts.js" ;
66import { runSetupModelAuthStep } from "./setup.model-auth.js" ;
77
8+ type ResolveManifestProviderAuthChoice =
9+ typeof import ( "../plugins/provider-auth-choices.js" ) . resolveManifestProviderAuthChoice ;
10+ type ResolvePluginSetupProvider =
11+ typeof import ( "../plugins/setup-registry.js" ) . resolvePluginSetupProvider ;
12+
813const applyAuthChoice = vi . hoisted ( ( ) => vi . fn ( ) ) ;
914const warnIfModelConfigLooksOff = vi . hoisted ( ( ) => vi . fn ( ) ) ;
1015const resolvePreferredProviderForAuthChoice = vi . hoisted ( ( ) => vi . fn ( ) ) ;
1116const promptDefaultModel = vi . hoisted ( ( ) => vi . fn ( ) ) ;
1217const applyPrimaryModel = vi . hoisted ( ( ) => vi . fn ( ( config : unknown ) => config ) ) ;
1318const promptAuthChoiceGrouped = vi . hoisted ( ( ) => vi . fn ( ) ) ;
1419const ensureAuthProfileStore = vi . hoisted ( ( ) => vi . fn ( ( ) => ( { profiles : { } } ) ) ) ;
20+ const resolveManifestProviderAuthChoice = vi . hoisted ( ( ) =>
21+ vi . fn < ResolveManifestProviderAuthChoice > ( ( ) => ( {
22+ pluginId : "anthropic" ,
23+ providerId : "anthropic" ,
24+ methodId : "anthropic-cli" ,
25+ choiceId : "anthropic-cli" ,
26+ choiceLabel : "Anthropic CLI" ,
27+ } ) ) ,
28+ ) ;
29+ const resolvePluginSetupProvider = vi . hoisted ( ( ) =>
30+ vi . fn < ResolvePluginSetupProvider > ( ( ) => undefined ) ,
31+ ) ;
1532
1633vi . mock ( "../commands/auth-choice.js" , ( ) => ( {
1734 applyAuthChoice,
@@ -34,6 +51,14 @@ vi.mock("../agents/auth-profiles.runtime.js", () => ({
3451 ensureAuthProfileStore,
3552} ) ) ;
3653
54+ vi . mock ( "../plugins/provider-auth-choices.js" , ( ) => ( {
55+ resolveManifestProviderAuthChoice,
56+ } ) ) ;
57+
58+ vi . mock ( "../plugins/setup-registry.js" , ( ) => ( {
59+ resolvePluginSetupProvider,
60+ } ) ) ;
61+
3762function createPrompter ( ) : WizardPrompter {
3863 return {
3964 intro : vi . fn ( ) ,
0 commit comments