import * as react_jsx_runtime from 'react/jsx-runtime';
import { SessionSwitcherProps, LocaleCode, WorkflowExecutionEvent, WorkflowWorkspaceProps, ManagedUser, Organization } from '@datatechsolutions/shared-domain/common';
import { ReactNode } from 'react';
import { A as AuthUser } from '../index-BoebbJ44.js';
export { PlatformAppShell, PlatformAppShellProps } from './app-shell.js';
import { N as NavigationItem } from '../navigation-BiWVffAN.js';
import { VariableValue, Workflow } from '../astrlabe/contracts.js';
import { N as NodeRunResult } from '../workflow-store-o17I6L6A.js';
import { PlatformRoleDefinition } from './rbac.js';
export { CreatePlatformRbacOptions, PlatformRbac, createPlatformRbac } from './rbac.js';
export { WorkflowCanvasShell } from './workflow-canvas-shell.js';
export { AgentsWorkspace, AgentsWorkspaceProps } from './agents-workspace.js';
export { CreateSecretInput, SecretDetail, SecretSummary, UpdateSecretInput, addOrganizationDomain, addOrganizationMember, createOrganization, createOrganizationInvitation, createPermission, createSecret, createUser, deleteOrganization, deletePermission, deleteUser, disableSecret, getSecret, getUserPermissions, listOrganizationDomains, listOrganizationInvitations, listOrganizationMembers, listOrganizations, listPermissions, listSecrets, listUsers, removeOrganizationMember, resetUserPassword, rotateSecret, setUserPermissions, setWindsockAdminClient, updateOrganization, updatePermission, updateUser, verifyOrganizationDomain } from './windsock-admin-client.js';
import { AdminUserSummary, AuthOrganization } from '@datatechsolutions/shared-domain';
export { AdminClient, AdminCreateInvitationInput, AdminCreateOrganizationInput, AdminCreatePermissionInput, AdminCreateUserInput, AdminListParams, AdminListResult, AdminOrganizationDetailProps, AdminOrganizationDetailTab, AdminOrganizationFormProps, AdminOrganizationListProps, AdminOrganizationMember, AdminPermissionListProps, AdminUpdateOrganizationInput, AdminUpdatePermissionInput, AdminUpdateUserInput, AdminUserFormProps, AdminUserListProps, AdminUserSummary, ConsentScreenProps, ForgotPasswordProps, MfaChallengeProps, MfaManageProps, MfaSetupProps, PasswordlessSignInProps, ResetPasswordProps, SignInProps, SignUpProps, SsoConnector, SsoConnectorListProps, SsoEmailFormProps, UserButtonProps, UserProfileProps, VerifyEmailProps } from '@datatechsolutions/shared-domain';
export { AuthLayout, AuthLayoutProps, BackupCodeGrid, BackupCodeGridProps, ConsentScreen, ForgotPassword, LinkedAccountsTabContent, MfaChallenge, MfaManage, MfaSetup, OtpInput, OtpInputProps, PasswordStrengthMeter, PasswordStrengthMeterProps, PasswordlessSignIn, ProfileTabContent, ResetPassword, SecurityTabContent, SessionsTabContent, SignIn, SignUp, SocialLoginButtons, SocialLoginButtonsProps, SocialProvider, SsoConnectorList, SsoEmailForm, UserButton, UserProfile, VerifyEmail } from './auth/index.js';
export { B as BillingPanel, a as BillingPanelProps } from '../billing-panel-DsHhhJqG.js';
export { UpgradePrompt, UpgradePromptProps } from './billing/index.js';
export { ImpersonationBanner, ImpersonationBannerProps } from './impersonation/index.js';
export { AdminOrganizationDetail, AdminOrganizationForm, AdminOrganizationList, AdminPermissionList, AdminUserForm, AdminUserList } from './admin/index.js';
export { PlatformSettings, PlatformSettingsProps, PlatformSettingsSection } from './settings/index.js';
import 'zustand';
import '@xyflow/react';
import '../layout-engine-YZcVr20M.js';

declare function SessionSwitcher({ organizations, users, organizationId, userEmail, onOrganizationChange, onUserChange, }: SessionSwitcherProps): react_jsx_runtime.JSX.Element;

type PlatformState = {
    currentOrganizationId: string;
    actor: AuthUser | null;
};
type PlatformStateProviderProps = {
    children: ReactNode;
    /**
     * Function that converts a JWT role claim to the app's canonical role
     * union (the same `normalizePlatformRole` produced by
     * `createPlatformRbac()` in this app). Lifted out as a prop because
     * each consuming app uses its own role enum.
     */
    normalizeRole: (input: unknown) => string;
};
declare function PlatformStateProvider({ children, normalizeRole }: PlatformStateProviderProps): react_jsx_runtime.JSX.Element;
declare function usePlatformState(): PlatformState;

type PlatformDockContainerProps = {
    /** JWT-derived actor used for permission filtering. */
    actor: AuthUser | null;
    /** App-specific navigation items (already translated). */
    navigationItems: NavigationItem[];
    /**
     * Pathname where the dock should be hidden (defaults to `/dashboard`).
     * The dashboard typically owns its own navigation chrome.
     */
    dashboardPath?: string;
    /** Path to redirect to on sign-out (defaults to `/login`). */
    signOutPath?: string;
};
/**
 * Floating dock + profile-modal trigger shared by every platform app.
 * Reads the active route from ui's router context and uses windsock for
 * preferences + sign-out, so the consumer only has to wire up navigation
 * items + an optional dashboard/sign-out path.
 */
declare function PlatformDockContainer({ actor, navigationItems, dashboardPath, signOutPath, }: PlatformDockContainerProps): react_jsx_runtime.JSX.Element | null;

/**
 * Locale + theme controls used inside the platform preferences drawer.
 * Reads the active locale from the i18n context and the theme/dock
 * preferences from windsock — both shared providers consuming apps must
 * mount above this component.
 */
declare function PreferencesControls(): react_jsx_runtime.JSX.Element;

/**
 * Locale switcher hook — reads the current locale from the i18n context and
 * pushes the user's choice through windsock so the next session inherits it.
 *
 * Lifted from astrlabe; consumers (astrlabe, kori-erp) wrap their tree in
 * `<I18nProvider>` + windsock's `<AuthProvider>` and import this directly.
 */
declare function useLocaleSwitcher(): {
    locale: LocaleCode;
    shortCode: string;
    setLocale: (newLocale: LocaleCode | string) => void;
    locales: readonly LocaleCode[];
};

declare function useWorkflowExecution(workflowId: string): {
    isRunning: boolean;
    execute: (inputVariables?: Record<string, VariableValue>) => Promise<void>;
    stop: () => void;
    runId: string | null;
    runStatus: "error" | "idle" | "completed" | "failed" | "streaming";
};

type RunEventStreamState = {
    /** All events received so far, in order */
    events: WorkflowExecutionEvent[];
    /** Whether the stream is currently connected */
    isStreaming: boolean;
    /** Terminal status once the workflow finishes */
    status: 'idle' | 'streaming' | 'completed' | 'failed' | 'error';
    /** Error message if stream errored */
    error: string | null;
};
/**
 * React hook that subscribes to real-time workflow execution events.
 *
 * Automatically selects transport:
 *   - WebSocket when VITE_WS_ENDPOINT is set (AWS production)
 *   - SSE when running locally (Kafka-backed)
 *
 * The stream auto-closes when the workflow completes or fails.
 * Reconnects automatically if the connection drops (up to 3 retries).
 */
declare function useRunEvents(workflowId: string | null, runId: string | null): RunEventStreamState;

type WorkflowRunPresentationActions = {
    clearNodeResults: () => void;
    setIsRunning: (running: boolean) => void;
    setNodeResult: (nodeId: string, result: NodeRunResult) => void;
};
declare function resetWorkflowRunPresentation(actions: WorkflowRunPresentationActions): void;
declare function applyWorkflowExecutionEventToStore(actions: WorkflowRunPresentationActions, event: WorkflowExecutionEvent): void;
declare function useWorkflowRunPresentation(events: WorkflowExecutionEvent[], status: RunEventStreamState['status']): void;

type UsersSettingsSectionProps = {
    /**
     * Role normalizer produced by each app's `createPlatformRbac()` call.
     * Used to coerce JWT role strings into the app's canonical role enum.
     */
    normalizeRole: (input: unknown) => string;
};
type RolesSettingsSectionProps = UsersSettingsSectionProps & {
    /** App-defined role definitions (from `createPlatformRbac`). */
    roleDefinitions: Record<string, PlatformRoleDefinition<string>>;
    /** Display options for the role-assignment select. */
    roleOptions: Array<{
        value: string;
        label: string;
    }>;
};
declare function UsersSettingsSection({ normalizeRole }: UsersSettingsSectionProps): react_jsx_runtime.JSX.Element;
declare function RolesSettingsSection({ roleDefinitions, roleOptions, normalizeRole }: RolesSettingsSectionProps): react_jsx_runtime.JSX.Element;

interface Props {
    open: boolean;
    onClose: () => void;
    onGenerated: (workflow: Workflow) => void;
}
/**
 * Minimal NL → graph generator surface. Lets the user pick one of the
 * org's model provider connections, enter a prompt, and produces a
 * Workflow row whose `graph` is the LLM's output. The caller navigates
 * the editor to the new workflow once generation succeeds — validation
 * issues are surfaced as notifications so the user can iterate.
 */
declare function AiWorkflowGenerateModal({ open, onClose, onGenerated }: Props): react_jsx_runtime.JSX.Element;

interface WorkflowTemplateModalProps {
    open: boolean;
    onClose: () => void;
    onCreated: (workflow: Workflow) => void;
}
declare function WorkflowTemplateModal({ open, onClose, onCreated }: WorkflowTemplateModalProps): react_jsx_runtime.JSX.Element;

/**
 * Thin wrapper that forwards a workflow graph into the visual canvas while
 * threading the active locale from the i18n context. The graph type from
 * `shared-domain` is structurally identical to ui's contract type — the
 * cast keeps callers from having to import both.
 */
declare function WorkflowWorkspace({ graph }: WorkflowWorkspaceProps): react_jsx_runtime.JSX.Element;

/** Maps a windsock AuthOrganization to the app-level Organization shape used by UI pages. */
declare function mapAuthOrg(raw: AuthOrganization): Organization;
/**
 * Maps a windsock AdminUserSummary to the app-level ManagedUser shape.
 * Takes `normalizeRole` as a parameter so each consuming app can plug in
 * the role normalizer produced by its own `createPlatformRbac()` call —
 * we deliberately don't hardcode an app-specific role enum here.
 */
declare function mapAdminUser(row: AdminUserSummary, normalizeRole: (input: unknown) => string): ManagedUser;
/** Maps an app-level UserRole to a windsock AuthOrganizationRole. */
declare const ORG_ROLE_MAP: Record<string, 'owner' | 'admin' | 'member' | 'viewer'>;
declare function mapRoleToOrgRole(role: string): 'owner' | 'admin' | 'member' | 'viewer';

export { AiWorkflowGenerateModal, ORG_ROLE_MAP, PlatformDockContainer, type PlatformDockContainerProps, PlatformRoleDefinition, PlatformStateProvider, type PlatformStateProviderProps, PreferencesControls, RolesSettingsSection, type RolesSettingsSectionProps, type RunEventStreamState, SessionSwitcher, UsersSettingsSection, type UsersSettingsSectionProps, WorkflowTemplateModal, type WorkflowTemplateModalProps, WorkflowWorkspace, applyWorkflowExecutionEventToStore, mapAdminUser, mapAuthOrg, mapRoleToOrgRole, resetWorkflowRunPresentation, useLocaleSwitcher, usePlatformState, useRunEvents, useWorkflowExecution, useWorkflowRunPresentation };
