export { B as Button, a as ButtonColor } from './button-C9cq2nm3.cjs'; export { A as AVATAR_PRIMARY_FALLBACK_CLASS, a as Avatar, b as AvatarFallback, c as AvatarImage, d as AvatarVariant, B as Banner, e as BannerProps, f as BannerSize, g as BannerTone, h as BannerVariant, K as Kanban, i as KanbanCardData, j as KanbanCardVariant, k as KanbanColumnData, l as KanbanDensity, m as KanbanDragHandleProps, n as KanbanLocation, o as KanbanMoveEvent, p as KanbanProps, q as KanbanRenderCardContext, r as KanbanTone, T as Timeline, s as TimelineItem, t as TimelineProps, u as TimelineSize, U as UntitledButton, v as UntitledButtonColor, w as UntitledButtonProps, x as UntitledButtonSize, y as avatarChartVariantClass, z as untitledButtonVariants } from './kanban-BdbkopVJ.cjs'; export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, AvatarGroup, AvatarGroupProps, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, CONTROL_SIZE, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, CircularProgressProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxAnchor, ComboboxCommand, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxList, ComboboxSeparator, ComboboxShortcut, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ControlClassOptions, ControlShape, ControlSize, CopyButton, CopyButtonProps, DatePicker, DatePickerButton, DatePickerCalendar, DatePickerContent, DatePickerTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Form, FormControl, FormField, FormItem, FormLabel, FormMessage, FormSubmit, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputOTP, InputOTPGroup, InputOTPHiddenInput, InputOTPSeparator, InputOTPSlot, Kbd, KbdGroup, Label, MemoPillSegmentedTabs, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberField, NumberFieldProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PillSegmentedTab, PillSegmentedTabs, PillSegmentedTabsProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, Rating, RatingProps, RatingTone, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Shimmer, Skeleton, Slider, Snippet, SnippetProps, SnippetSize, SnippetVariant, Spinner, Stepper, StepperProps, StepperStep, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TagInput, TagInputProps, TagInputSize, TextShimmerProps, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, ToolbarLink, ToolbarSeparator, ToolbarToggleGroup, ToolbarToggleItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, alertVariants, badgeVariants, controlClass, controlSurfaceClass, formatPickerDate, navigationMenuTriggerStyle, overlayAnimationClass, overlayItemClass, overlayListPanelClass, overlaySurfaceClass, toast, toggleVariants, useChart, useToast } from './ui.cjs'; import { U as UiArtifact, a as UiNode, A as AnyArtifact, Q as QuestionArtifact, H as HtmlArtifact, J as JsonArtifact, T as TableArtifact } from './chat-rMlckAQG.cjs'; export { b as ArtifactRegistry, c as ArtifactRegistryProvider, d as ArtifactRenderer, e as ArtifactRendererProps, f as ArtifactView, C as ChartArtifact, g as ChartSeriesConfig, h as ChatAttachment, i as ChatMessage, j as Composer, k as ComposerProps, l as ContentPart, m as CreateDefaultAttachmentAdapterOptions, n as CreateUploadAttachmentAdapterOptions, D as DEFAULT_UPLOAD_ACCEPT, o as QuestionOption, R as ResolveAttachmentAdapterOptions, S as SendOptions, p as Suggestions, q as SuggestionsComponent, r as SuggestionsSlotProps, s as SuggestionsSource, t as TextContentPart, u as ThinkingContentPart, v as Thread, w as ThreadArtifactsConfig, x as ThreadComponents, y as ThreadProps, z as ThreadSuggestion, B as ThreadSuggestionsProps, E as ThreadVariant, F as ThreadWelcomeConfig, G as ThreadWelcomeProps, I as TimbalArtifact, K as TimbalAttachmentsConfig, L as TimbalAttachmentsProp, M as TimbalChat, N as TimbalChatProps, O as TimbalRuntimeProvider, P as TimbalRuntimeProviderProps, V as TimbalStreamApi, W as ToolCallContentPart, X as UiAction, Y as UiBadgeNode, Z as UiBindable, _ as UiBoxNode, $ as UiButtonNode, a0 as UiCustomNode, a1 as UiCustomNodeProps, a2 as UiCustomNodeRegistryProvider, a3 as UiCustomNodeRenderer, a4 as UiDraggableNode, a5 as UiEventEnvelope, a6 as UiEventProvider, a7 as UiHeadingNode, a8 as UiSliderNode, a9 as UiState, aa as UiStateAction, ab as UiStateProvider, ac as UiTextNode, ad as UiToggleNode, ae as UiTooltipNode, af as UploadFetchFn, ag as UseTimbalStreamOptions, ah as createDefaultAttachmentAdapter, ai as createUploadAttachmentAdapter, aj as defaultArtifactRenderers, ak as getPath, al as isArtifact, am as isUiBinding, an as resolveAttachmentAdapter, ao as resolveBindable, ap as setPath, aq as uiStateReducer, ar as useArtifactRegistry, as as useResolvedSuggestions, at as useTimbalRuntime, au as useTimbalStream, av as useUiCustomNodeRegistry, aw as useUiDispatch, ax as useUiEventEmitter, ay as useUiState } from './chat-rMlckAQG.cjs'; export { ComposerAddAttachment, ComposerAttachments, GetRunParams, ListRunsParams, ListRunsResult, MarkdownText, RunDetail, RunPreview, RunSortBy, RunSortOrder, RunStatus, RunTraceToMessagesOptions, RunUser, RunWorkforce, THREAD_DEFAULT_MAX_WIDTH, ToolFallback, TooltipIconButton, TooltipIconButtonProps, TooltipIconButtonVariant, TraceSpan, UseConversationOptions, UseConversationResult, UseConversationsOptions, UseConversationsResult, UserMessageAttachments, WorkforceSelector, WorkforceSelectorProps, assistantMessageContentClass, assistantMessageRootClass, conversationRunsToMessages, getRun, isRootRun, listRuns, normalizeContentToText, orderRunsForThread, runParentId, runTraceToMessages, threadMessageColumnClass, useConversation, useConversations, useToolRunning, userMessageRootClass } from './chat.cjs'; export { ModeToggle, ModeToggleProps, ModeToggleTheme, STUDIO_NAV_MODE, StudioModeSwitch, StudioModeSwitchProps, StudioNavMode, StudioSidebar, StudioSidebarBackdrop, StudioSidebarItem, StudioSidebarProps, StudioSidebarVariant, StudioWelcome, StudioWelcomeProps, TimbalChatShell, TimbalChatShellProps, TimbalMark, TimbalMarkProps, TimbalStudioShell, TimbalStudioShellProps } from './studio.cjs'; export { APP_DENSITY_CHART_HEIGHT, APP_DENSITY_CLASSES, APP_KIT_AGENT_INSTRUCTIONS, APP_KIT_CATALOG, AlertCard, AlertCardProps, BreadcrumbItem as AppBreadcrumbItem, AppChatPanel, AppChatPanelProps, AppConfirmDialog, AppConfirmDialogProps, AppChatPanel as AppCopilot, AppCopilotContextValue, AppChatPanelProps as AppCopilotProps, AppCopilotProvider, AppCopilotProviderProps, AppDensity, AppDensityClassKey, AppDensityProvider, AppDensityProviderProps, AppPageWidth, AppShell, AppShellChatControls, AppShellChatTrigger, AppShellChatTriggerProps, AppShellNavControls, AppShellProps, AppShellSidebarTrigger, AppShellSidebarTriggerProps, BreadcrumbEntry, Breadcrumbs, BreadcrumbsProps, CHART_PALETTE, COLOR_UTILITY_PREFIXES, CatalogCard, CatalogCardProps, CatalogEntry, CatalogImportPath, CatalogKind, ChartArtifactView, ChartLayout, ChartMargin, ChartPanel, ChartPanelProps, ChartSeries, ChartTooltipIndicator, ChartVariant, ConnectionRow, ConnectionRowList, ConnectionRowListProps, ConnectionRowProps, CopilotControls, CopilotOverlay, CopilotOverlayProps, CopilotPanel, CopilotPanelProps, CopilotProvider, CopilotProviderProps, CopilotTriggerPosition, DENSITY_SPECS, DNA_COMPILER_VERSION, DangerZone, DangerZoneAction, DangerZoneActionProps, DangerZoneProps, DataTable, DataTableColumn, DataTableProps, DataTableSort, DataTableSortDirection, DensitySpec, DescriptionItem, DescriptionList, DescriptionListProps, DesignDna, DnaChartRecipeId, DnaColor, DnaCompileReport, DnaCompileResult, DnaControlShape, DnaDensity, DnaElevation, DnaElevationLevel, DnaElevationStrategy, DnaFinish, DnaLayout, DnaMeta, DnaMode, DnaMotion, DnaMotionPreset, DnaOverrides, DnaPersonality, DnaReference, DnaShape, DnaSpacing, DnaStatusSetId, DnaSurfaceStrategy, DnaTypography, DnaValidationError, DnaVoice, ELEVATION_LADDERS, ElevationLadder, EmptyState, EmptyStateProps, ExpandableSection, ExpandableSectionProps, FONT_PAIRINGS, Field, FieldInput, FieldInputProps, FieldProps, FieldRow, FieldRowProps, FieldSelect, FieldSelectProps, FieldSwitch, FieldSwitchProps, FieldTextarea, FieldTextareaProps, FilterBar, FilterBarProps, FilterCompareValue, FilterDatePreset, FilterDateRangeValue, FilterDropdown, FilterDropdownProps, FilterField, FilterFieldDef, FilterFieldProps, FilterFieldType, FilterNumericOperatorOption, FilterNumericValue, FilterSelectOption, FilterValue, FilterValues, FilteredDataTable, FilteredDataTableProps, FloatingUnsavedChangesBar, FloatingUnsavedChangesBarProps, FontPairing, FormSection, FormSectionProps, HOUSE_RULES, HouseRule, INTEGRATION_CATALOG_CARD_HEIGHT_CLASS, InfoCard, InfoCardProps, InfoCardTone, IntegrationCard, IntegrationCardProps, IntegrationCardStatus, IntegrationsEmptyState, IntegrationsEmptyStateProps, IntegrationsGrid, IntegrationsGridItem, IntegrationsGridProps, LineAreaChart, LineAreaChartProps, LintFinding, LintOptions, LintResult, LintSeverity, MOTION_PRESETS, MetricChartCard, MetricChartCardProps, MetricChartMetric, MetricRow, MetricRowItem, MetricRowProps, MetricTile, MetricTileProps, MotionSpec, NumericOperator, Page, PageHeader, PageHeaderProps, PageProps, PieChart, PieChartProps, PlanBadge, PlanBadgeProps, PlanBadgeTone, RESERVED_GRADIENT_TOKENS, RadarChart, RadarChartProps, RadialChart, RadialChartProps, ResourceCard, ResourceCardProps, ResourceGallery, ResourceGalleryItem, ResourceGalleryProps, ReviewResult, SEMANTIC_COLOR_TOKENS, SLOP_BUDGETS, STATUS_SETS, SearchInput, SearchInputProps, Section, SectionProps, SemanticColorToken, SettingsLayout, SettingsLayoutProps, SettingsLayoutSection, SettingsSection, SettingsSectionHeader, SettingsSectionHeaderProps, SettingsSectionProps, SiriWave, SiriWaveProps, SiriWaveVariant, Sparkline, SparklineProps, Stack, StackAlign, StackGap, StackJustify, StackProps, StatGrid, StatGridItem, StatGridProps, StatTile, StatTileProps, StatTileTone, StatusBadge, StatusBadgeProps, StatusBadgeTone, StatusDot, StatusDotProps, StatusDotTone, StatusSet, SubNav, SubNavItem, SubNavProps, SurfaceCard, SurfaceCardProps, SurfaceCardTone, SurfaceCardVariant, TAILWIND_PALETTE_COLORS, THEME_AGENT_INSTRUCTIONS, TIMBAL_THEME_PRESETS, ThemeShadow, ThemeToCssOptions, ThemeTokenMap, TimbalThemeIntent, TimbalThemePreset, TimbalThemePresetId, TimbalThemeStyle, TimbalThemeStyleProps, TimbalThemeTokens, TimbalThemeTypography, UI_REVIEW_AGENT_INSTRUCTIONS, UseLiveQueryOptions, UseLiveQueryResult, appDensityClass, appFilterBarClass, appPageColumnClass, appSearchInputClass, appShellInsetTopClass, appShellTopbarInsetClass, appStatTileClass, appSurfaceCardClass, applyThemePreset, applyTimbalTheme, clearTimbalTheme, compileDna, connectionRowListClass, createTimbalTheme, ensureThemeFontLink, flushBarCategoryGap, flushLineAreaEdgeToEdge, formatLintReport, getCatalogEntry, getElevationLadder, getFontPairing, getMotionPreset, getStatusSet, getStoredThemePreset, getThemePreset, lintGeneratedUi, parseDna, resolveChartMargin, resolveTooltipCategory, reviewGeneratedUi, themeToCss, useAppCopilotContext, useAppDensity, useAppDensityClass, useAppShellChat, useAppShellNav, useCopilot, useInterval, useLiveQuery } from './app.cjs'; export { DURATION, EASE, Magnetic, MagneticProps, Marquee, MarqueeProps, Parallax, ParallaxProps, Reveal, RevealProps, RevealVariant, SITE_AGENT_INSTRUCTIONS, SPRING, TextReveal, TextRevealProps } from './site.cjs'; import React__default, { FC, ReactNode } from 'react'; import { ToolCallMessagePartComponent } from '@assistant-ui/react'; export { ActionBarPrimitive, AssistantRuntimeProvider, AttachmentAdapter, AuiIf, ComposerPrimitive, MessagePrimitive, ThreadPrimitive, useComposerRuntime, useMessageRuntime, useThread, useThreadRuntime } from '@assistant-ui/react'; import { WorkforceItem, Session } from '@timbal-ai/timbal-sdk'; export { parseSSELine } from '@timbal-ai/timbal-sdk'; import { ClassValue } from 'clsx'; import 'class-variance-authority/types'; import 'class-variance-authority'; import 'react/jsx-runtime'; import 'radix-ui'; import '@dnd-kit/core'; import 'cmdk'; import 'react-day-picker'; import 'recharts'; /** * Copy-paste this into a workforce agent system prompt (or append it to your * blueprint's tool-result instructions) so the model knows which artifact * payloads the chat UI can render. * * @example * ```ts * import { ARTIFACT_AGENT_INSTRUCTIONS } from "@timbal-ai/timbal-react"; * * const systemPrompt = `${basePrompt}\n\n${ARTIFACT_AGENT_INSTRUCTIONS}`; * ``` */ declare const ARTIFACT_AGENT_INSTRUCTIONS: string; /** * Render a `ui` artifact. Each instance gets its own local state seeded from * `artifact.initialState`. Toggles, sliders, and `set` actions mutate this * state via the reducer; bindings (`{ $bind: "path" }`) read from it. * * Host apps subscribe to `emit` actions via `` from the * registry module and extend the node palette via * ``. */ declare const UiArtifactView: FC<{ artifact: UiArtifact; }>; declare const UiNodeView: FC<{ node: UiNode; }>; /** * Markdown fence languages we treat as artifact payloads. `timbal-artifact` * is the canonical form; `timbal` is accepted as an alias because most * frontier models drop the suffix when generating fenced blocks. */ declare const ARTIFACT_FENCE_LANGUAGES: ReadonlySet; /** * Returns true if the given fenced-code-block language should be rendered * as an artifact instead of as a code block. */ declare function isArtifactFenceLanguage(language: string | undefined | null): boolean; /** * Parse a tool result into an artifact, if possible. Strings are tried as * JSON first. Timbal often wraps tool return values as * `{ type: "text", text: "" }` — we unwrap those before checking * `type`. Returns `null` for results that don't look like artifacts. */ declare function parseArtifactFromToolResult(result: unknown): AnyArtifact | null; interface MarkdownArtifactMatch { /** The artifact payload. */ artifact: AnyArtifact; /** The raw fenced block, including its ``` fences. */ raw: string; /** Start offset in the source string. */ start: number; /** End offset (exclusive). */ end: number; } /** * Find every `timbal-artifact` fenced block in a markdown string and return * each parsed payload along with its source offset. Use the offsets to splice * a renderer in place of the fence — see `splitMarkdownByArtifacts`. */ declare function findMarkdownArtifacts(markdown: string): MarkdownArtifactMatch[]; type MarkdownSegment = { kind: "text"; text: string; } | { kind: "artifact"; artifact: AnyArtifact; }; /** * Split a markdown string into alternating text/artifact segments, preserving * order. Useful when rendering markdown with inline artifact placeholders — * render each segment with the appropriate component. */ declare function splitMarkdownByArtifacts(markdown: string): MarkdownSegment[]; /** * Default `tools.Override` for assistant messages. * * Renders the tool result as a registered artifact when possible; otherwise * falls back to the timeline `ToolFallback`. Wraps the artifact in * `ToolMotion` so it shares the same rise-from-below polish as the rest of * the chat surface. */ declare const ToolArtifactFallback: ToolCallMessagePartComponent; /** * Shared chrome for built-in artifact renderers. Custom renderers don't have * to use this — it's just a small visual baseline so charts, tables, and * question widgets feel like a coherent set. */ declare const ArtifactCard: FC<{ title?: string; kind?: string; className?: string; bodyClassName?: string; toolbar?: ReactNode; children: ReactNode; }>; /** * In-thread choice widget. Single-select submits immediately on click; * multi-select shows a confirm button. The answer is sent as a regular * user message via the assistant-ui runtime so the agent treats it like * any other reply. */ declare const QuestionArtifactView: FC<{ artifact: QuestionArtifact; }>; /** * Renders HTML inside an iframe. When `sandboxed` is true (default), scripts * and forms run in an isolated sandbox. Set `sandboxed: false` for fully * unrestricted inline HTML — trusted content only. */ declare const HtmlArtifactView: FC<{ artifact: HtmlArtifact; }>; /** * Default renderer used both for `{ type: "json" }` artifacts and as the * fallback when no renderer is registered for a given type. Pretty-prints * any JSON-serializable value. */ declare const JsonArtifactView: FC<{ artifact: JsonArtifact | AnyArtifact; }>; declare const TableArtifactView: FC<{ artifact: TableArtifact; }>; type FetchFn = (url: string, options?: RequestInit) => Promise; interface UseWorkforcesOptions { /** Base URL for API calls. Default: `/api`. */ baseUrl?: string; /** Custom fetch (defaults to `authFetch` for token-auth flows). */ fetch?: FetchFn; /** * Pick the initial selected workforce. By default we prefer the first * `type === "agent"` entry, falling back to the first item. Pass a custom * resolver to override (e.g. remember the user's last choice). */ pickInitial?: (items: WorkforceItem[]) => WorkforceItem | undefined; /** When false, the hook returns an empty list and skips the network fetch. */ enabled?: boolean; } interface UseWorkforcesResult { workforces: WorkforceItem[]; /** Currently selected workforce identifier (id ?? uid ?? name). */ selectedId: string; setSelectedId: (id: string) => void; /** The full `WorkforceItem` for `selectedId`, if any. */ selected: WorkforceItem | undefined; isLoading: boolean; error: Error | null; /** Re-fetch the list. Resets `error`. */ refresh: () => Promise; } /** * Fetch the list of workforces exposed by the blueprint API and track a * selection. Used to power `` but exported separately * so apps can drive their own UI (e.g. a sidebar tree). */ declare function useWorkforces(options?: UseWorkforcesOptions): UseWorkforcesResult; type AuthProvider = "email" | "google" | "microsoft" | "github"; declare const AUTH_PROVIDERS: readonly AuthProvider[]; interface ProjectInfo { id: string; name: string; } interface AuthConfig { /** `true` = users must log in; `false` = open project (no login at all). */ required: boolean; /** The only login methods that should be rendered. Authoritative. */ providers: AuthProvider[]; /** Present only when SSO connections exist. Details are never exposed. */ sso?: { enabled: boolean; }; } interface ProjectConfig { project: ProjectInfo; auth: AuthConfig; } type ConfigResult = { status: "ok"; config: ProjectConfig; } /** `/config` route not mounted (app not in platform mode) — legacy fallback. */ | { status: "not-platform"; } /** Platform unreachable after retries — do NOT fall open or closed. */ | { status: "unavailable"; }; interface FetchProjectConfigOptions { /** Base path the config + auth routes are mounted under. Default `/api`. */ baseUrl?: string; /** Number of retry attempts on 503 / network error. Default `3`. */ retries?: number; /** Base backoff in ms (doubles each attempt). Default `300`. */ retryDelayMs?: number; /** Custom fetch implementation (defaults to global `fetch`). */ fetch?: typeof fetch; signal?: AbortSignal; } /** * Normalize an untrusted `/config` payload into a {@link ProjectConfig}. * * Fail-safe semantics: if `auth.required` is missing or not a boolean it is * coerced to `true` (login required) so a malformed payload can never * accidentally open a project. */ declare function normalizeProjectConfig(raw: unknown): ProjectConfig; /** * Fetch `GET {baseUrl}/config`. * * - `200` → `{ status: "ok", config }` (normalized, fail-safe). * - `404` → `{ status: "not-platform" }` (route not mounted → legacy fallback). * - `503` / network error → retried with exponential backoff; after the retry * budget is exhausted resolves to `{ status: "unavailable" }`. * * Aborts (via `signal`) reject so callers can distinguish teardown from a real * failure. */ declare function fetchProjectConfig({ baseUrl, retries, retryDelayMs, fetch: fetchFn, signal, }?: FetchProjectConfigOptions): Promise; /** * Resolution state of the `GET {baseUrl}/config` call: * - `loading` — request in flight (or not yet started). * - `ok` — platform mode; `config` is populated. * - `not-platform` — `/config` 404'd; the app runs in legacy mode. * - `unavailable` — platform unreachable after retries; do NOT assume open or * authenticated. Render neither the app nor login until it resolves. */ type ConfigStatus = "loading" | "ok" | "not-platform" | "unavailable"; interface SessionContextType { user: Session | null; loading: boolean; isAuthenticated: boolean; isEmbedded: boolean; logout: () => void; /** Normalized `/config` payload, or `null` outside platform mode. */ config: ProjectConfig | null; /** Resolution state of the config fetch. */ configStatus: ConfigStatus; /** Whether end users must log in. Fail-safe `true` until proven otherwise. */ authRequired: boolean; /** The only login methods that should be rendered (server-driven). */ authProviders: AuthProvider[]; /** Whether SSO connections exist (no details exposed). */ ssoEnabled: boolean; /** `true` only when config loaded and `auth.required === false`. */ isOpenProject: boolean; } declare const useSession: () => SessionContextType; /** * Read the session without throwing when no `SessionProvider` is present. * Returns `null` when auth is not wired into the tree — useful for surfaces * (e.g. sidebar footers) that should gracefully render without auth. */ declare const useOptionalSession: () => SessionContextType | null; interface SessionProviderProps { children: React__default.ReactNode; /** When false, session is always null and loading is false. Default: true */ enabled?: boolean; /** * Base path the config + auth routes are mounted under. Default `/api` * (so `/config` → `/api/config`, `/auth/login` → `/api/auth/login`). Also * applied to {@link setAuthBaseUrl} so token helpers stay in sync. */ baseUrl?: string; } declare const SessionProvider: React__default.FC; interface AuthGuardProps { children: React__default.ReactNode; /** * Force the login gate even in legacy mode. In platform mode the gate is * driven by the project's `auth.required` flag, so this is usually * unnecessary. Default: false. */ requireAuth?: boolean; /** When false, renders children unconditionally. Default: true */ enabled?: boolean; /** * Optional custom login UI rendered in place of the default redirect to the * server login page (e.g. ``). Only shown when the * project requires auth and no user is signed in. */ renderLogin?: React__default.ReactNode; } declare const AuthGuard: React__default.FC; interface TimbalLoginScreenProps { /** * Login methods to render. Defaults to the server-driven `authProviders` * from the surrounding `SessionProvider`. Only the methods in this list are * rendered — the server rejects disabled methods with 400 regardless. */ providers?: AuthProvider[]; /** Whether to surface the SSO affordance. Defaults to the session's `ssoEnabled`. */ ssoEnabled?: boolean; /** Base path for auth routes. Defaults to the configured auth base (`/api`). */ baseUrl?: string; /** Where the user should land after login (passed as `?redirect_uri=`). */ redirectUri?: string; title?: React__default.ReactNode; description?: React__default.ReactNode; className?: string; /** Called after a magic link has been successfully requested. */ onMagicLinkSent?: (email: string) => void; } /** * Data-driven login screen. Renders exactly the providers reported by * `GET /config` (via `SessionProvider`): OAuth providers become redirect * buttons to `{baseUrl}/auth/{provider}`, and `email` renders a magic-link * form that POSTs to `{baseUrl}/auth/magic-link`. * * Pass `` to `AuthGuard`'s `renderLogin` prop, or render * it directly on a custom login route. */ declare const TimbalLoginScreen: React__default.FC; /** Set the base path used to build `/auth/*` and `/me` URLs. Default `/api`. */ declare const setAuthBaseUrl: (url: string) => void; /** Read the base path currently used for auth + identity routes. */ declare const getAuthBaseUrl: () => string; declare const getAccessToken: () => string | null; declare const setAccessToken: (token: string) => void; declare const getRefreshToken: () => string | null; declare const setRefreshToken: (token: string) => void; declare const clearTokens: () => void; declare const refreshAccessToken: () => Promise; declare const authFetch: (url: string, options?: RequestInit) => Promise; declare const fetchCurrentUser: () => Promise; declare function cn(...inputs: ClassValue[]): string; export { ARTIFACT_AGENT_INSTRUCTIONS, ARTIFACT_FENCE_LANGUAGES, AUTH_PROVIDERS, AnyArtifact, ArtifactCard, type AuthConfig, AuthGuard, type AuthProvider, type ConfigResult, type ConfigStatus, type FetchProjectConfigOptions, HtmlArtifact, HtmlArtifactView, JsonArtifact, JsonArtifactView, type MarkdownArtifactMatch, type MarkdownSegment, type ProjectConfig, type ProjectInfo, QuestionArtifact, QuestionArtifactView, SessionProvider, TableArtifact, TableArtifactView, TimbalLoginScreen, type TimbalLoginScreenProps, ToolArtifactFallback, UiArtifact, UiArtifactView, UiNode, UiNodeView, type UseWorkforcesOptions, type UseWorkforcesResult, authFetch, clearTokens, cn, fetchCurrentUser, fetchProjectConfig, findMarkdownArtifacts, getAccessToken, getAuthBaseUrl, getRefreshToken, isArtifactFenceLanguage, normalizeProjectConfig, parseArtifactFromToolResult, refreshAccessToken, setAccessToken, setAuthBaseUrl, setRefreshToken, splitMarkdownByArtifacts, useOptionalSession, useSession, useWorkforces };