import { EventBus, CoreEventMap } from './event-bus'; import { PluginContext, CommandContribution, RouteContribution, PanelContribution, StatusBarContribution, SettingsContribution, WidgetContribution, ToolbarContribution, ContextMenuContribution } from './types'; import { ContributionRegistryStore } from './registries/createContributionRegistry'; import { NavItem } from '../hooks/shell/useNavRegistry'; import { FooterItem, FooterSection } from '../hooks/shell/useFooterRegistry'; /** * Identity surface exposed to plugins by `getAuth()`. * * SECURITY: Plugins are untrusted code surfaces. Shells MUST NOT pass raw * access tokens, refresh tokens, or any other bearer credential through this * channel. Only stable, non-sensitive identity fields belong here. Plugins * that need to call backend APIs should go through the shell's gateway * clients (which inject auth at the network boundary), not by reading a * token out of `shell.getAuth()`. * * The optional `token` field is retained ONLY as a deprecated, redacted * placeholder for backward compatibility — implementations should leave it * `undefined`. It will be removed in a future major. */ export interface PluginAuthSnapshot { /** Opaque user identity object (id, email, displayName) — no credentials. */ user?: unknown; /** * @deprecated Always `undefined`. Plugins must not receive bearer tokens. * Use the shell's gateway clients for authenticated requests. */ token?: undefined; } /** * Active product context exposed to plugins. * * `projectId` is included so plugins that operate on project-scoped state * (panels, status-bar items, widgets) can read the current project without * having to subscribe to shell-internal stores. */ export interface PluginActiveContext { workspaceId?: string; tenantId?: string; projectId?: string; } export interface ShellServices { navigate: (path: string) => void; showToast: (message: string, type?: 'info' | 'success' | 'warning' | 'error') => void; getActiveContext: () => PluginActiveContext; getAuth: () => PluginAuthSnapshot; getTheme: () => { colorMode: 'light' | 'dark'; }; } export interface RegistryRefs { navRegister: (item: NavItem) => void; navUnregister: (id: string) => void; footerRegister: (section: FooterSection, item: FooterItem) => void; footerUnregister: (id: string) => void; commands: ContributionRegistryStore; routes: ContributionRegistryStore; panels: ContributionRegistryStore; statusBar: ContributionRegistryStore; settings: ContributionRegistryStore; widgets: ContributionRegistryStore; toolbar: ContributionRegistryStore; contextMenus: ContributionRegistryStore; } export declare function createPluginContext(pluginId: string, eventBus: EventBus, registries: RegistryRefs, shell: ShellServices): PluginContext; //# sourceMappingURL=context.d.ts.map