import * as React from 'react'; import React__default, { ReactNode, ReactElement } from 'react'; import { J as JsonApiHydratedDataInterface } from '../ApiDataInterface-BcZeXy5X.mjs'; import { c as CompanyInterface, N as NotificationInterface, e as RoleInterface, U as UserInterface } from '../notification.interface-BWOCvKRP.mjs'; import { O as OnboardingProviderProps, a as OnboardingContextValue } from '../onboarding.interface-Djyl9qYu.mjs'; export { D as DEFAULT_ONBOARDING_LABELS, g as OnboardingCardRenderProps, f as OnboardingLabels, c as OnboardingStepConfig, b as OnboardingStepSide, d as OnboardingTourConfig, e as OnboardingTourPaths } from '../onboarding.interface-Djyl9qYu.mjs'; import { M as ModuleWithPermissions, A as Action } from '../types-Bq_UA8Lg.mjs'; import { a as HowToInterface, B as BreadcrumbItemData, d as AssistantMessageInterface } from '../AssistantMessageInterface-ddyG114R.mjs'; import { R as RbacMatrix, A as ActionType, P as PermissionValue } from '../RbacTypes-BTbr27Ew.mjs'; import { a as AssistantInterface } from '../AssistantInterface-DMh-zApr.mjs'; import { LucideIcon } from 'lucide-react'; import { u as useSocket } from '../useSocket-BZG9oX-L.mjs'; import * as jotai from 'jotai'; import * as jotai_utils from 'jotai/utils'; import '../feature.interface-CXb1-vNq.mjs'; import '../ApiRequestDataTypeInterface-CYEcRUrh.mjs'; interface AdministrationContextType { } type AdministrationProviderProps = { children: ReactNode; }; /** * Supplies the page chrome for every administration surface. * * `RoundPageContainerTitle` and the header breadcrumb both read * `useSharedContext()`, and that context is provided far up the tree by the * layout — so an administration page that provides nothing of its own silently * inherits whatever the *previously rendered* page put there (a company name, a * "Notifications" title). Wrapping in this provider replaces that value, which * is why every administration container mounts inside it. * * Mirrors CommonProvider (contexts/CommonContext.tsx), which does the same job * for the ordinary application shell. */ declare const AdministrationProvider: ({ children }: AdministrationProviderProps) => React.JSX.Element; declare const useAdministrationContext: () => AdministrationContextType; interface CompanyContextType { company: CompanyInterface | undefined; setCompany: (value: CompanyInterface | undefined) => void; } type CompanyProviderProps = { children: ReactNode; dehydratedCompany?: JsonApiHydratedDataInterface; configurationEditorSlot?: ReactNode; }; declare const CompanyProvider: ({ children, dehydratedCompany, configurationEditorSlot }: CompanyProviderProps) => React.JSX.Element; declare const useCompanyContext: () => CompanyContextType; interface NotificationContextType { notifications: NotificationInterface[]; setNotifications: (notifications: NotificationInterface[]) => void; addNotification: (notification: NotificationInterface) => void; addSocketNotifications: (socketNotifications: NotificationInterface[]) => void; loadNotifications: () => Promise; generateNotification: (notification: NotificationInterface, closePopover: () => void) => ReactElement; generateToastNotification: (notification: NotificationInterface, t: any, generateUrl: any) => { title: string; description: string | ReactElement; action?: { label: string; onClick: () => void; }; }; markNotificationsAsRead: (ids: string[]) => Promise; isLoading: boolean; error: string | null; lastLoaded: number; shouldRefresh: boolean; } type NotificationContextProviderProps = { children: React__default.ReactNode; }; declare const NotificationContextProvider: ({ children }: NotificationContextProviderProps) => React__default.JSX.Element; declare const useNotificationContext: () => NotificationContextType; declare function OnboardingProvider({ children, tours, tourPaths: _tourPaths, labels, renderCard, zIndex: _zIndex, }: OnboardingProviderProps): React.JSX.Element; declare function useOnboarding(): OnboardingContextValue; interface RoleContextType { role: RoleInterface | undefined; setRole: (value: RoleInterface | undefined) => void; } type RoleProviderProps = { children: ReactNode; dehydratedRole?: JsonApiHydratedDataInterface; }; declare const RoleProvider: ({ children, dehydratedRole }: RoleProviderProps) => React.JSX.Element; declare const useRoleContext: () => RoleContextType; interface CurrentUserContextType { currentUser: T | null; company: CompanyInterface | null; setUser: (user?: T) => void; hasPermissionToModule: (params: { module: M; action: Action; data?: any; }) => boolean; hasPermissionToModules: (params: { modules: M[]; action: Action; data?: any; }) => boolean; hasPermissionToPath: (path: string) => boolean; hasAccesToFeature: (featureIdentifier: string) => boolean; matchUrlToModule: (prarms?: { path: string; }) => ModuleWithPermissions | undefined; hasRole: (roleId: string) => boolean; refreshUser: (options?: { skipCookieUpdate?: boolean; }) => Promise; isRefreshing: boolean; } declare const CurrentUserProvider: ({ children }: { children: React__default.ReactNode; }) => React__default.JSX.Element; declare function useCurrentUserContext(): CurrentUserContextType; interface UserContextType { user: UserInterface | undefined; setUser: (value: UserInterface | undefined) => void; } type UserProviderProps = { children: ReactNode; dehydratedUser?: JsonApiHydratedDataInterface; }; declare const UserProvider: ({ children, dehydratedUser }: UserProviderProps) => React.JSX.Element; declare const useUserContext: () => UserContextType; interface HowToContextType { howTo: HowToInterface | undefined; setHowTo: (value: HowToInterface | undefined) => void; reloadHowTo: () => Promise; } type HowToProviderProps = { children: ReactNode; dehydratedHowTo?: JsonApiHydratedDataInterface; }; declare const HowToProvider: ({ children, dehydratedHowTo }: HowToProviderProps) => React.JSX.Element; declare const useHowToContext: () => HowToContextType; interface RbacContextType { matrix: RbacMatrix | null; modulePaths: Record; loading: boolean; error: string | null; saving: boolean; roleNames?: Record; moduleNames?: Record; updateCell: (moduleId: string, rowKey: "default" | string, action: ActionType, value: PermissionValue) => void; clearCell: (moduleId: string, roleId: string, action: ActionType) => void; } type RbacProviderProps = { children: ReactNode; /** UUID → PascalCase map for roles (e.g. from `@neural-erp/shared`'s `RoleId`). */ roleNames?: Record; /** UUID → PascalCase map for modules (e.g. from `@neural-erp/shared`'s `ModuleId`). */ moduleNames?: Record; /** * Output path for the serialized `permissions.ts` file. Absolute, or * relative to the API's repo root. Defaults to * `"apps/api/src/rbac/permissions.ts"`. */ outputPath?: string; }; /** * RbacProvider — owns the matrix state, the save handler, and the breadcrumb + * title wiring. Renders the "Save to permissions.ts" button into * `title.functions` so it appears in the page header, following the same * convention as CompanyContext / other context providers in this codebase. * * The child `RbacContainer` is stateless — it consumes state via * `useRbacContext()`. */ declare const RbacProvider: ({ children, roleNames, moduleNames, outputPath, }: RbacProviderProps) => React.JSX.Element; declare const useRbacContext: () => RbacContextType; interface AssistantContextValue { assistant?: AssistantInterface; messages: AssistantMessageInterface[]; threads: AssistantInterface[]; threadsLoading: boolean; sending: boolean; status?: string; failedMessageIds: Set; sendMessage(content: string, opts?: { howToMode?: boolean; limitToHowToId?: string; contentBlocks?: unknown[]; }): Promise; retrySend(tempId: string): Promise; selectThread(id: string): Promise; startNew(): void; renameThread(id: string, title: string): Promise; deleteThread(id: string): Promise; /** When true, create/append route to the operator-engine endpoints. */ operatorMode: boolean; setOperatorMode(value: boolean): void; /** Appends a message returned outside the send flow (e.g. an approve/deny resume). */ appendResolvedMessage(message: AssistantMessageInterface): void; } interface Props { children: React__default.ReactNode; dehydratedAssistant?: JsonApiHydratedDataInterface; dehydratedMessages?: JsonApiHydratedDataInterface[]; /** * When `true` (default), the provider mutates the browser URL on * create/selectThread/startNew (e.g. `/assistants/{id}`). Set to `false` * when the assistant is hosted inside a sheet / overlay so the user's * current route is preserved. */ manageUrl?: boolean; /** * Confines the provider to one bound resource (e.g. a campaign): the thread * list is filtered to that resource and newly created threads are bound to * it, so a scoped surface never shows or creates cross-scope threads. */ scope?: { type: string; id: string; }; /** * Builds the browser URL for a thread. Defaults to `/assistants/{id}` (or * `/assistants` when no thread is active), which is only correct for the * standalone assistant route; a scoped host passes its own builder. */ threadUrl?: (id?: string) => string; /** * Page heading. Defaults to the "Assistants" entity label; a scoped host * passes something meaningful for its own surface. */ titleOverride?: string; /** * Breadcrumb trail. Defaults to a single crumb pointing at the global * assistant list, which is wrong for a scoped surface. */ breadcrumbsOverride?: BreadcrumbItemData[]; } declare function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages, manageUrl, titleOverride, breadcrumbsOverride, scope, threadUrl, }: Props): React__default.JSX.Element; declare function useAssistantContext(): AssistantContextValue; interface CommonContextType { } type CommonProviderProps = { children: ReactNode; }; declare const CommonProvider: ({ children }: CommonProviderProps) => React.JSX.Element; declare const useCommonContext: () => CommonContextType; interface HeaderChildrenProviderProps { children: ReactNode; content: ReactNode; mobileContent?: ReactNode; rootLabel?: string; } /** * Provider to supply custom content to be rendered in the Header component. * Wrap your layout with this provider and pass the content you want in the header. * Optionally pass `rootLabel` to override the first breadcrumb entry (defaults to `common.home`). * * The header has far less room on mobile, so `content` is desktop-only. Pass `mobileContent` * to choose which widgets survive there; omit it and the header stays bare on mobile. */ declare function HeaderChildrenProvider({ children, content, mobileContent, rootLabel }: HeaderChildrenProviderProps): React.JSX.Element; /** * Hook to get the header children content from context. * Used internally by PageContainer to pass children to Header. */ declare function useHeaderChildren(): ReactNode | null; /** * Hook to get the header content the application wants kept on mobile. * Returns null when the application supplied none, in which case the Header shows no widgets there. */ declare function useHeaderMobileChildren(): ReactNode | null; /** * Hook to get the label of the first breadcrumb entry, when the application supplies one. * Returns null when no override was provided, in which case the Header falls back to `common.home`. */ declare function useHeaderRootLabel(): string | null; interface HeaderLeftContentProviderProps { children: ReactNode; content: ReactNode; } declare function HeaderLeftContentProvider({ children, content }: HeaderLeftContentProviderProps): React.JSX.Element; declare function useHeaderLeftContent(): ReactNode | null; interface HeaderLogoProviderProps { children: ReactNode; content: ReactNode; } declare function HeaderLogoProvider({ children, content }: HeaderLogoProviderProps): React.JSX.Element; declare function useHeaderLogo(): ReactNode | null; /** * One slot in the mobile bottom navigation bar. * * Supply exactly one of `icon` / `render`, and exactly one of `href` / `onClick`. * This is a review-time contract, not a runtime-validated one — the mistake is * immediately visible in dev, and validation code would ship to every consumer. * * `render` content MUST NOT contain an interactive element: an `href` slot is * already wrapped in a , so a nested /