@iota-uz/sdk 0.3.4 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/applet/core.cjs +251 -0
  2. package/dist/applet/core.cjs.map +1 -0
  3. package/dist/applet/core.d.cts +172 -0
  4. package/dist/applet/core.d.ts +172 -0
  5. package/dist/applet/core.mjs +237 -0
  6. package/dist/applet/core.mjs.map +1 -0
  7. package/dist/applet/devtools.cjs +131 -0
  8. package/dist/applet/devtools.cjs.map +1 -0
  9. package/dist/applet/devtools.d.cts +7 -0
  10. package/dist/applet/devtools.d.ts +7 -0
  11. package/dist/applet/devtools.mjs +128 -0
  12. package/dist/applet/devtools.mjs.map +1 -0
  13. package/dist/applet/host.cjs +256 -0
  14. package/dist/applet/host.cjs.map +1 -0
  15. package/dist/applet/host.d.cts +62 -0
  16. package/dist/applet/host.d.ts +62 -0
  17. package/dist/applet/host.mjs +251 -0
  18. package/dist/applet/host.mjs.map +1 -0
  19. package/dist/bichat/index.cjs +352 -409
  20. package/dist/bichat/index.cjs.map +1 -1
  21. package/dist/bichat/index.d.cts +8 -116
  22. package/dist/bichat/index.d.ts +8 -116
  23. package/dist/bichat/index.mjs +354 -403
  24. package/dist/bichat/index.mjs.map +1 -1
  25. package/dist/fonts/Actay/Actay-Regular.otf +0 -0
  26. package/dist/fonts/Actay/Actay-RegularItalic.otf +0 -0
  27. package/dist/fonts/Actay/ActayCondensed-Thin.otf +0 -0
  28. package/dist/fonts/Actay/ActayCondensed-ThinItalic.otf +0 -0
  29. package/dist/fonts/Actay/ActayWide-Bold.otf +0 -0
  30. package/dist/fonts/Actay/ActayWide-BoldItalic.otf +0 -0
  31. package/dist/fonts/Gilroy/Gilroy-Black.woff2 +0 -0
  32. package/dist/fonts/Gilroy/Gilroy-BlackItalic.woff2 +0 -0
  33. package/dist/fonts/Gilroy/Gilroy-Bold.woff2 +0 -0
  34. package/dist/fonts/Gilroy/Gilroy-BoldItalic.woff2 +0 -0
  35. package/dist/fonts/Gilroy/Gilroy-Extrabold.woff2 +0 -0
  36. package/dist/fonts/Gilroy/Gilroy-ExtraboldItalic.woff2 +0 -0
  37. package/dist/fonts/Gilroy/Gilroy-Heavy.woff2 +0 -0
  38. package/dist/fonts/Gilroy/Gilroy-HeavyItalic.woff2 +0 -0
  39. package/dist/fonts/Gilroy/Gilroy-Light.woff2 +0 -0
  40. package/dist/fonts/Gilroy/Gilroy-LightItalic.woff2 +0 -0
  41. package/dist/fonts/Gilroy/Gilroy-Medium.woff2 +0 -0
  42. package/dist/fonts/Gilroy/Gilroy-MediumItalic.woff2 +0 -0
  43. package/dist/fonts/Gilroy/Gilroy-Regular.woff2 +0 -0
  44. package/dist/fonts/Gilroy/Gilroy-RegularItalic.woff2 +0 -0
  45. package/dist/fonts/Gilroy/Gilroy-Semibold.woff2 +0 -0
  46. package/dist/fonts/Gilroy/Gilroy-SemiboldItalic.woff2 +0 -0
  47. package/dist/fonts/Gilroy/Gilroy-Thin.woff2 +0 -0
  48. package/dist/fonts/Gilroy/Gilroy-ThinItalic.woff2 +0 -0
  49. package/dist/fonts/Gilroy/Gilroy-UltraLight.woff2 +0 -0
  50. package/dist/fonts/Gilroy/Gilroy-UltraLightItalic.woff2 +0 -0
  51. package/dist/fonts/Inter.var.woff2 +0 -0
  52. package/dist/{index-B73-BCi-.d.cts → index-Cs_xWkhC.d.cts} +1 -1
  53. package/dist/{index-B73-BCi-.d.ts → index-Cs_xWkhC.d.ts} +1 -1
  54. package/dist/index.cjs +52 -4
  55. package/dist/index.cjs.map +1 -1
  56. package/dist/index.d.cts +6 -232
  57. package/dist/index.d.ts +6 -232
  58. package/dist/index.mjs +52 -4
  59. package/dist/index.mjs.map +1 -1
  60. package/package.json +44 -13
  61. package/tailwind/compiled.css +1 -1
  62. package/tailwind/create-config.cjs +16 -135
  63. package/tailwind/sdk-theme.cjs +99 -0
  64. package/LICENSE +0 -201
  65. package/README.MD +0 -166
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import react__default, { ReactNode, Component, ErrorInfo, FC, HTMLAttributes, ReactElement, ImgHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
4
- import { I as InitialContext, A as AppConfig$1, L as LocaleContext$1, c as TenantContext$1, U as UserContext$1 } from '../index-B73-BCi-.cjs';
4
+ import { I as InitialContext, A as AppConfig$1, L as LocaleContext$1, T as TenantContext$1, U as UserContext$1 } from '../index-Cs_xWkhC.cjs';
5
5
  import { File as File$1 } from '@phosphor-icons/react';
6
6
 
7
7
  /**
@@ -40,7 +40,7 @@ interface UserTurn$1 {
40
40
  */
41
41
  interface AssistantTurn$1 {
42
42
  id: string;
43
- role?: MessageRole;
43
+ role: MessageRole;
44
44
  content: string;
45
45
  explanation?: string;
46
46
  citations: Citation$1[];
@@ -88,11 +88,10 @@ interface Citation$1 {
88
88
  endIndex: number;
89
89
  /** Optional excerpt from the source */
90
90
  excerpt?: string;
91
- /** Legacy: source name (for backward compatibility) */
92
- source?: string;
93
91
  }
94
92
  interface Attachment$1 {
95
93
  id?: string;
94
+ clientKey: string;
96
95
  filename: string;
97
96
  mimeType: string;
98
97
  sizeBytes: number;
@@ -2511,15 +2510,16 @@ interface ChatSessionProviderProps {
2511
2510
  dataSource: ChatDataSource;
2512
2511
  sessionId?: string;
2513
2512
  rateLimiter?: RateLimiter;
2513
+ /** Configuration for the built-in rate limiter (ignored when rateLimiter is provided). */
2514
+ rateLimitConfig?: RateLimiterConfig;
2514
2515
  children: ReactNode;
2515
2516
  }
2516
- declare function ChatSessionProvider({ dataSource, sessionId, rateLimiter: externalRateLimiter, children }: ChatSessionProviderProps): react_jsx_runtime.JSX.Element;
2517
+ declare function ChatSessionProvider({ dataSource, sessionId, rateLimiter: externalRateLimiter, rateLimitConfig, children }: ChatSessionProviderProps): react_jsx_runtime.JSX.Element;
2517
2518
  declare function useChatSession(): ChatSessionStateValue;
2518
2519
  declare function useChatMessaging(): ChatMessagingStateValue;
2519
2520
  /** Returns messaging context or null when outside ChatSessionProvider. Use when component can receive values via props (e.g. SessionArtifactsPanel with artifactsInvalidationTrigger prop). */
2520
2521
  declare function useOptionalChatMessaging(): ChatMessagingStateValue | null;
2521
2522
  declare function useChatInput(): ChatInputStateValue;
2522
- declare function useChat(): ChatSessionContextValue;
2523
2523
 
2524
2524
  /**
2525
2525
  * BiChat context types layered on top of canonical applet-core context contracts.
@@ -2600,7 +2600,7 @@ declare function useIotaContext(): IotaContext;
2600
2600
  /**
2601
2601
  * Check if user has a specific permission
2602
2602
  */
2603
- declare function hasPermission$1(permission: string): boolean;
2603
+ declare function hasPermission(permission: string): boolean;
2604
2604
 
2605
2605
  interface BiChatConfig {
2606
2606
  user: {
@@ -2648,10 +2648,6 @@ declare function useConfig(): BiChatConfig | null;
2648
2648
  * Throws an error if configuration is not available
2649
2649
  */
2650
2650
  declare function useRequiredConfig(): BiChatConfig;
2651
- /**
2652
- * Check if user has a specific permission
2653
- */
2654
- declare function hasPermission(config: BiChatConfig | null, permission: string): boolean;
2655
2651
 
2656
2652
  /**
2657
2653
  * Theme system type definitions
@@ -2981,7 +2977,6 @@ interface Citation {
2981
2977
  startIndex: number;
2982
2978
  endIndex: number;
2983
2979
  excerpt?: string;
2984
- source?: string;
2985
2980
  }
2986
2981
  interface CodeOutput {
2987
2982
  type: string;
@@ -3184,73 +3179,6 @@ declare function getFileVisual(mimeType?: string, filename?: string): FileVisual
3184
3179
  /** Chart-specific visual (not mime-based, used for artifact type = 'chart') */
3185
3180
  declare const CHART_VISUAL: FileVisual;
3186
3181
 
3187
- /**
3188
- * Citation Processing Utility
3189
- *
3190
- * Transforms OpenAI citations from raw markers (e.g., ≡cite≡turn0search2≡)
3191
- * to formatted inline citation markers (e.g., [1], [2]).
3192
- *
3193
- * Process:
3194
- * 1. Sort citations by startIndex (descending) to process from end to start
3195
- * 2. Replace character ranges [startIndex, endIndex] with numbered markers
3196
- * 3. Return processed content with clean inline citation references
3197
- */
3198
-
3199
- interface ProcessedContent {
3200
- /** Content with citation markers replaced by [1], [2], etc. */
3201
- content: string;
3202
- /** Citations array with their display indices */
3203
- citations: Array<Citation$1 & {
3204
- displayIndex: number;
3205
- }>;
3206
- }
3207
- /**
3208
- * Process message content to replace raw citation markers with formatted inline citations
3209
- *
3210
- * @param content - Raw message content with potential citation markers
3211
- * @param citations - Array of citations with startIndex/endIndex positions
3212
- * @returns Processed content with clean citation markers and indexed citations
3213
- *
3214
- * @example
3215
- * ```ts
3216
- * const result = processCitations(
3217
- * "Tesla reported $28B ≡cite≡turn0search2≡ revenue",
3218
- * [{ startIndex: 20, endIndex: 42, title: "...", url: "...", type: "url_citation" }]
3219
- * )
3220
- * // result.content = "Tesla reported $28B [1] revenue"
3221
- * // result.citations = [{ ..., displayIndex: 1 }]
3222
- * ```
3223
- */
3224
- declare function processCitations(content: string, citations: Citation$1[] | null | undefined): ProcessedContent;
3225
-
3226
- /**
3227
- * Normalizes partially-streamed markdown so that react-markdown
3228
- * can render it without layout artifacts (e.g. an unclosed code fence
3229
- * turning the rest of the message into a code block).
3230
- *
3231
- * Called on every streaming content update — kept intentionally cheap (O(lines)).
3232
- */
3233
- declare function normalizeStreamingMarkdown(text: string): string;
3234
-
3235
- /**
3236
- * SSE stream parser for consuming Server-Sent Events.
3237
- */
3238
- interface SSEEvent {
3239
- type: string;
3240
- content?: string;
3241
- error?: string;
3242
- sessionId?: string;
3243
- toolName?: string;
3244
- toolCallId?: string;
3245
- durationMs?: number;
3246
- success?: boolean;
3247
- [key: string]: unknown;
3248
- }
3249
- /**
3250
- * Parses an SSE stream and yields parsed JSON events.
3251
- */
3252
- declare function parseSSEStream(reader: ReadableStreamDefaultReader<Uint8Array>): AsyncGenerator<SSEEvent, void, unknown>;
3253
-
3254
3182
  /**
3255
3183
  * Groups chat sessions by date relative to today
3256
3184
  * Categories: Today, Yesterday, Last 7 Days, Last 30 Days, Older
@@ -3258,40 +3186,4 @@ declare function parseSSEStream(reader: ReadableStreamDefaultReader<Uint8Array>)
3258
3186
  */
3259
3187
  declare function groupSessionsByDate(sessions: Session$1[], t?: (key: string) => string): SessionGroup[];
3260
3188
 
3261
- /**
3262
- * Date formatting utilities using date-fns
3263
- */
3264
- /**
3265
- * Format a date as relative time (e.g., "5m ago", "2h ago")
3266
- * Falls back to HH:mm format for dates older than 24 hours
3267
- *
3268
- * Accepts an optional `t` function for i18n. Translation keys used:
3269
- * - relativeTime.justNow
3270
- * - relativeTime.minutesAgo (receives `{count}`)
3271
- * - relativeTime.hoursAgo (receives `{count}`)
3272
- * - relativeTime.daysAgo (receives `{count}`)
3273
- *
3274
- * If no `t` function is provided, falls back to English defaults.
3275
- */
3276
- declare function formatRelativeTime(date: string | Date, t?: (key: string, params?: Record<string, string | number>) => string): string;
3277
-
3278
- /**
3279
- * Shared validation utilities for QuestionForm components
3280
- */
3281
-
3282
- /**
3283
- * Checks if a question has been answered.
3284
- * A question is answered if it has at least one selected option OR custom text.
3285
- */
3286
- declare function isQuestionAnswered(data: QuestionAnswerData | undefined): boolean;
3287
- /**
3288
- * Validates that all questions are answered and custom text is valid.
3289
- * Returns null if valid, or an error message string if invalid.
3290
- *
3291
- * @param questions - Array of questions to validate
3292
- * @param answers - Map of question IDs to answer data
3293
- * @param t - Optional translation function for error messages
3294
- */
3295
- declare function validateAnswers(questions: Question[], answers: QuestionAnswers, t?: (key: string, params?: Record<string, any>) => string): string | null;
3296
-
3297
- export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, type BiChatConfig, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type ProcessedContent, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, RateLimiter, type RateLimiterConfig, RetryActionArea, type SSEEvent, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, SessionSkeleton, type SessionUser, type ShortcutConfig, Sidebar, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, SourcesPanel, type StreamChunk, StreamError, StreamingCursor, SystemMessage, MemoizedTabBar as TabBar, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, formatRelativeTime, getCSRFToken, getFileVisual, getValidChildren, groupSessionsByDate, hasPermission as hasConfigPermission, hasPermission$1 as hasPermission, isImageMimeType, isQuestionAnswered, lightTheme, listItemVariants, messageContainerVariants, messageVariants, normalizeStreamingMarkdown, parseSSEStream, processCitations, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toastVariants, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBubbleContext, useChat, useChatInput, useChatMessaging, useChatSession, useConfig, useFocusTrap, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAnswers, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
3189
+ export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, type BiChatConfig, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, RateLimiter, type RateLimiterConfig, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, SessionSkeleton, type SessionUser, type ShortcutConfig, Sidebar, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, SourcesPanel, type StreamChunk, StreamError, StreamingCursor, SystemMessage, MemoizedTabBar as TabBar, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getValidChildren, groupSessionsByDate, hasPermission, isImageMimeType, lightTheme, listItemVariants, messageContainerVariants, messageVariants, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toastVariants, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useFocusTrap, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import react__default, { ReactNode, Component, ErrorInfo, FC, HTMLAttributes, ReactElement, ImgHTMLAttributes, ButtonHTMLAttributes, RefObject } from 'react';
4
- import { I as InitialContext, A as AppConfig$1, L as LocaleContext$1, c as TenantContext$1, U as UserContext$1 } from '../index-B73-BCi-.js';
4
+ import { I as InitialContext, A as AppConfig$1, L as LocaleContext$1, T as TenantContext$1, U as UserContext$1 } from '../index-Cs_xWkhC.js';
5
5
  import { File as File$1 } from '@phosphor-icons/react';
6
6
 
7
7
  /**
@@ -40,7 +40,7 @@ interface UserTurn$1 {
40
40
  */
41
41
  interface AssistantTurn$1 {
42
42
  id: string;
43
- role?: MessageRole;
43
+ role: MessageRole;
44
44
  content: string;
45
45
  explanation?: string;
46
46
  citations: Citation$1[];
@@ -88,11 +88,10 @@ interface Citation$1 {
88
88
  endIndex: number;
89
89
  /** Optional excerpt from the source */
90
90
  excerpt?: string;
91
- /** Legacy: source name (for backward compatibility) */
92
- source?: string;
93
91
  }
94
92
  interface Attachment$1 {
95
93
  id?: string;
94
+ clientKey: string;
96
95
  filename: string;
97
96
  mimeType: string;
98
97
  sizeBytes: number;
@@ -2511,15 +2510,16 @@ interface ChatSessionProviderProps {
2511
2510
  dataSource: ChatDataSource;
2512
2511
  sessionId?: string;
2513
2512
  rateLimiter?: RateLimiter;
2513
+ /** Configuration for the built-in rate limiter (ignored when rateLimiter is provided). */
2514
+ rateLimitConfig?: RateLimiterConfig;
2514
2515
  children: ReactNode;
2515
2516
  }
2516
- declare function ChatSessionProvider({ dataSource, sessionId, rateLimiter: externalRateLimiter, children }: ChatSessionProviderProps): react_jsx_runtime.JSX.Element;
2517
+ declare function ChatSessionProvider({ dataSource, sessionId, rateLimiter: externalRateLimiter, rateLimitConfig, children }: ChatSessionProviderProps): react_jsx_runtime.JSX.Element;
2517
2518
  declare function useChatSession(): ChatSessionStateValue;
2518
2519
  declare function useChatMessaging(): ChatMessagingStateValue;
2519
2520
  /** Returns messaging context or null when outside ChatSessionProvider. Use when component can receive values via props (e.g. SessionArtifactsPanel with artifactsInvalidationTrigger prop). */
2520
2521
  declare function useOptionalChatMessaging(): ChatMessagingStateValue | null;
2521
2522
  declare function useChatInput(): ChatInputStateValue;
2522
- declare function useChat(): ChatSessionContextValue;
2523
2523
 
2524
2524
  /**
2525
2525
  * BiChat context types layered on top of canonical applet-core context contracts.
@@ -2600,7 +2600,7 @@ declare function useIotaContext(): IotaContext;
2600
2600
  /**
2601
2601
  * Check if user has a specific permission
2602
2602
  */
2603
- declare function hasPermission$1(permission: string): boolean;
2603
+ declare function hasPermission(permission: string): boolean;
2604
2604
 
2605
2605
  interface BiChatConfig {
2606
2606
  user: {
@@ -2648,10 +2648,6 @@ declare function useConfig(): BiChatConfig | null;
2648
2648
  * Throws an error if configuration is not available
2649
2649
  */
2650
2650
  declare function useRequiredConfig(): BiChatConfig;
2651
- /**
2652
- * Check if user has a specific permission
2653
- */
2654
- declare function hasPermission(config: BiChatConfig | null, permission: string): boolean;
2655
2651
 
2656
2652
  /**
2657
2653
  * Theme system type definitions
@@ -2981,7 +2977,6 @@ interface Citation {
2981
2977
  startIndex: number;
2982
2978
  endIndex: number;
2983
2979
  excerpt?: string;
2984
- source?: string;
2985
2980
  }
2986
2981
  interface CodeOutput {
2987
2982
  type: string;
@@ -3184,73 +3179,6 @@ declare function getFileVisual(mimeType?: string, filename?: string): FileVisual
3184
3179
  /** Chart-specific visual (not mime-based, used for artifact type = 'chart') */
3185
3180
  declare const CHART_VISUAL: FileVisual;
3186
3181
 
3187
- /**
3188
- * Citation Processing Utility
3189
- *
3190
- * Transforms OpenAI citations from raw markers (e.g., ≡cite≡turn0search2≡)
3191
- * to formatted inline citation markers (e.g., [1], [2]).
3192
- *
3193
- * Process:
3194
- * 1. Sort citations by startIndex (descending) to process from end to start
3195
- * 2. Replace character ranges [startIndex, endIndex] with numbered markers
3196
- * 3. Return processed content with clean inline citation references
3197
- */
3198
-
3199
- interface ProcessedContent {
3200
- /** Content with citation markers replaced by [1], [2], etc. */
3201
- content: string;
3202
- /** Citations array with their display indices */
3203
- citations: Array<Citation$1 & {
3204
- displayIndex: number;
3205
- }>;
3206
- }
3207
- /**
3208
- * Process message content to replace raw citation markers with formatted inline citations
3209
- *
3210
- * @param content - Raw message content with potential citation markers
3211
- * @param citations - Array of citations with startIndex/endIndex positions
3212
- * @returns Processed content with clean citation markers and indexed citations
3213
- *
3214
- * @example
3215
- * ```ts
3216
- * const result = processCitations(
3217
- * "Tesla reported $28B ≡cite≡turn0search2≡ revenue",
3218
- * [{ startIndex: 20, endIndex: 42, title: "...", url: "...", type: "url_citation" }]
3219
- * )
3220
- * // result.content = "Tesla reported $28B [1] revenue"
3221
- * // result.citations = [{ ..., displayIndex: 1 }]
3222
- * ```
3223
- */
3224
- declare function processCitations(content: string, citations: Citation$1[] | null | undefined): ProcessedContent;
3225
-
3226
- /**
3227
- * Normalizes partially-streamed markdown so that react-markdown
3228
- * can render it without layout artifacts (e.g. an unclosed code fence
3229
- * turning the rest of the message into a code block).
3230
- *
3231
- * Called on every streaming content update — kept intentionally cheap (O(lines)).
3232
- */
3233
- declare function normalizeStreamingMarkdown(text: string): string;
3234
-
3235
- /**
3236
- * SSE stream parser for consuming Server-Sent Events.
3237
- */
3238
- interface SSEEvent {
3239
- type: string;
3240
- content?: string;
3241
- error?: string;
3242
- sessionId?: string;
3243
- toolName?: string;
3244
- toolCallId?: string;
3245
- durationMs?: number;
3246
- success?: boolean;
3247
- [key: string]: unknown;
3248
- }
3249
- /**
3250
- * Parses an SSE stream and yields parsed JSON events.
3251
- */
3252
- declare function parseSSEStream(reader: ReadableStreamDefaultReader<Uint8Array>): AsyncGenerator<SSEEvent, void, unknown>;
3253
-
3254
3182
  /**
3255
3183
  * Groups chat sessions by date relative to today
3256
3184
  * Categories: Today, Yesterday, Last 7 Days, Last 30 Days, Older
@@ -3258,40 +3186,4 @@ declare function parseSSEStream(reader: ReadableStreamDefaultReader<Uint8Array>)
3258
3186
  */
3259
3187
  declare function groupSessionsByDate(sessions: Session$1[], t?: (key: string) => string): SessionGroup[];
3260
3188
 
3261
- /**
3262
- * Date formatting utilities using date-fns
3263
- */
3264
- /**
3265
- * Format a date as relative time (e.g., "5m ago", "2h ago")
3266
- * Falls back to HH:mm format for dates older than 24 hours
3267
- *
3268
- * Accepts an optional `t` function for i18n. Translation keys used:
3269
- * - relativeTime.justNow
3270
- * - relativeTime.minutesAgo (receives `{count}`)
3271
- * - relativeTime.hoursAgo (receives `{count}`)
3272
- * - relativeTime.daysAgo (receives `{count}`)
3273
- *
3274
- * If no `t` function is provided, falls back to English defaults.
3275
- */
3276
- declare function formatRelativeTime(date: string | Date, t?: (key: string, params?: Record<string, string | number>) => string): string;
3277
-
3278
- /**
3279
- * Shared validation utilities for QuestionForm components
3280
- */
3281
-
3282
- /**
3283
- * Checks if a question has been answered.
3284
- * A question is answered if it has at least one selected option OR custom text.
3285
- */
3286
- declare function isQuestionAnswered(data: QuestionAnswerData | undefined): boolean;
3287
- /**
3288
- * Validates that all questions are answered and custom text is valid.
3289
- * Returns null if valid, or an error message string if invalid.
3290
- *
3291
- * @param questions - Array of questions to validate
3292
- * @param answers - Map of question IDs to answer data
3293
- * @param t - Optional translation function for error messages
3294
- */
3295
- declare function validateAnswers(questions: Question[], answers: QuestionAnswers, t?: (key: string, params?: Record<string, any>) => string): string | null;
3296
-
3297
- export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, type BiChatConfig, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type ProcessedContent, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, RateLimiter, type RateLimiterConfig, RetryActionArea, type SSEEvent, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, SessionSkeleton, type SessionUser, type ShortcutConfig, Sidebar, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, SourcesPanel, type StreamChunk, StreamError, StreamingCursor, SystemMessage, MemoizedTabBar as TabBar, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, formatRelativeTime, getCSRFToken, getFileVisual, getValidChildren, groupSessionsByDate, hasPermission as hasConfigPermission, hasPermission$1 as hasPermission, isImageMimeType, isQuestionAnswered, lightTheme, listItemVariants, messageContainerVariants, messageVariants, normalizeStreamingMarkdown, parseSSEStream, processCitations, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toastVariants, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBubbleContext, useChat, useChatInput, useChatMessaging, useChatSession, useConfig, useFocusTrap, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAnswers, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
3189
+ export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, type BiChatConfig, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, ChatSessionProvider, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, RateLimiter, type RateLimiterConfig, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, SessionSkeleton, type SessionUser, type ShortcutConfig, Sidebar, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, SourcesPanel, type StreamChunk, StreamError, StreamingCursor, SystemMessage, MemoizedTabBar as TabBar, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getValidChildren, groupSessionsByDate, hasPermission, isImageMimeType, lightTheme, listItemVariants, messageContainerVariants, messageVariants, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toastVariants, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useFocusTrap, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };