/** * Resource-profile & external-source menu controller. * * Extracted verbatim from interactive-mode.ts (god-file decomposition). Owns the /profiles command * and the resource-hub menu tree: active-profile selection, profile create/delete/persist, the * library (per-profile resource grants) editor, and external-source root management. It holds NO * state of its own — every profile/source fact lives in settingsManager / the profile registry / * the session resourceLoader — so it takes narrow deps (a live session accessor plus a UI callback * surface, including the editor-overlay-backed showSelector) rather than the whole InteractiveMode * instance. */ import type { Api, Model } from "@caupulican/pi-ai"; import type { Component, SelectItem, TUI } from "@caupulican/pi-tui"; import type { AgentSession } from "../../core/agent-session.ts"; export declare const NO_ACTIVE_PROFILE_DESCRIPTION = "Baseline resources; inline SDK extensions load, discovered extensions stay withheld"; export interface ProfileMenuControllerUi { showSelector(create: (done: () => void) => { component: Component; focus: Component; onSuperseded?: () => void; }): void; showStatus(message: string): void; showError(message: string): void; showWarning(message: string): void; requestRender(): void; readonly tui: TUI; readonly footerDataProvider: { setExtensionStatus(key: string, text: string | undefined): void; }; invalidateFooter(): void; updateEditorBorderColor(): void; openEditorForPath(filePath: string): Promise; handleReloadCommand(): Promise; maybeWarnAboutAnthropicSubscriptionAuth(model?: Model): void; checkDaxnutsEasterEgg(model: { provider: string; id: string; }): void; showSettingsSelector(): void; getAutoLearnModelOptions(): SelectItem[]; } export interface ProfileMenuControllerDeps { getSession(): AgentSession; ui: ProfileMenuControllerUi; } export declare function getProfileExtensionDisplayLabel(filePath: string, description?: string): string; export declare class ProfileMenuController { private readonly deps; constructor(deps: ProfileMenuControllerDeps); private get session(); private get sessionManager(); private get settingsManager(); private get ui(); handleResourcesHubAction(action: string): Promise; private openActiveProfileSelector; private openManageProfilesFlow; private openEditProfileModelSelector; private editProfileModel; private openPersistProfileSelector; private openDeleteProfileSelector; private openSourcesManagerFlow; private openLibraryManagerFlow; private createProfileAndOpenLibraryFlow; private selectProfileAndOpenLibraryFlow; private getProfileResourceKinds; private editProfileResource; private openLibraryEditorForProfile; private saveProfileResources; private rollbackValidatedProfileMutation; private reportProfileMutationFailure; private promptScopeChangeForProfile; handleProfilesCommand(profileName?: string): Promise; private applyProfile; /** Map where a profile currently lives to the scope we should write it back to. */ private scopeForProfileSource; refreshAfterProfileMutation(profileName: string): Promise; private createProfileFlow; private selectProfileModel; private openNewProfileEditor; private persistActiveProfile; private deleteProfileFromSource; private addExternalResourceRootFlow; private removeExternalResourceRootFlow; } //# sourceMappingURL=profile-menu-controller.d.ts.map