@axiom-lattice/react-sdk 2.1.85 → 2.1.87

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.
package/dist/index.d.mts CHANGED
@@ -211,6 +211,18 @@ interface UseAgentStateOptions {
211
211
  }
212
212
  /**
213
213
  * Agent state hook return value
214
+ *
215
+ * @example
216
+ * ```tsx
217
+ * const { agentState, isLoading, error, startPolling, stopPolling, refresh } =
218
+ * useAgentState("assistant-123", "thread-456", { pollingInterval: 2000 });
219
+ *
220
+ * // Manual refresh
221
+ * await refresh();
222
+ *
223
+ * // Access agent messages
224
+ * const messages = agentState?.values?.messages ?? [];
225
+ * ```
214
226
  */
215
227
  interface UseAgentStateReturn {
216
228
  /**
@@ -275,6 +287,17 @@ interface UseApiOptions {
275
287
  }
276
288
  /**
277
289
  * Return type for useApi hook
290
+ *
291
+ * @example
292
+ * ```tsx
293
+ * const { get, post, put, del, isLoading, error } = useApi();
294
+ *
295
+ * // GET resources
296
+ * const threads = await get<Thread[]>("/api/threads");
297
+ *
298
+ * // POST with body
299
+ * const result = await post<ChatResponse>("/api/chat", { message: "Hello" });
300
+ * ```
278
301
  */
279
302
  interface UseApiReturn {
280
303
  /**
@@ -331,6 +354,23 @@ interface UseApiReturn {
331
354
  * @param assistantId - Assistant ID to chat with
332
355
  * @param options - Chat options
333
356
  * @returns Chat state and operations
357
+ *
358
+ * @example
359
+ * ```tsx
360
+ * const {
361
+ * messages,
362
+ * isLoading,
363
+ * sendMessage,
364
+ * stopStreaming,
365
+ * loadMessages,
366
+ * clearMessages,
367
+ * } = useChat("thread-1", "assistant-1", {
368
+ * initialMessages: [],
369
+ * enableResumeStream: true,
370
+ * });
371
+ *
372
+ * await sendMessage({ input: { message: "Hello!" } });
373
+ * ```
334
374
  */
335
375
  declare function useChat<T extends UseChatOptions>(threadId: string | null, assistantId: string, options?: T): (T["enableReturnStateWhenStreamCompleted"] extends true ? ChatStateWithAgent : ChatState) & {
336
376
  sendMessage: (data: {
@@ -378,6 +418,7 @@ declare function useChat<T extends UseChatOptions>(threadId: string | null, assi
378
418
  * - Optionally returning agent state when streaming completes
379
419
  *
380
420
  * @template T - UseChatOptions type
421
+ * @param options - Optional chat configuration including streaming, resume stream, and initial messages
381
422
  * @returns Agent thread state and operations from AgentThreadContext
382
423
  */
383
424
  declare function useAgentChat<T extends UseChatOptions>(options?: T): ChatStateWithAgent & {
@@ -448,6 +489,18 @@ declare function useAgentGraph(assistantId: string): {
448
489
  */
449
490
  declare function useApi(options?: UseApiOptions): UseApiReturn;
450
491
 
492
+ /**
493
+ * Fetches and manages evaluation projects.
494
+ *
495
+ * @returns Project list, loading state, error, and CRUD operations
496
+ *
497
+ * @example
498
+ * ```tsx
499
+ * const { projects, loading, create, update, remove, refresh } = useEvalProjects();
500
+ *
501
+ * await create({ name: "My Project" });
502
+ * ```
503
+ */
451
504
  declare function useEvalProjects(): {
452
505
  projects: unknown[];
453
506
  loading: boolean;
@@ -458,6 +511,19 @@ declare function useEvalProjects(): {
458
511
  refresh: () => Promise<void>;
459
512
  };
460
513
 
514
+ /**
515
+ * Fetches and manages evaluation suites within a project.
516
+ *
517
+ * @param projectId - The project ID to fetch suites for
518
+ * @returns Suite list, loading state, error, and CRUD operations
519
+ *
520
+ * @example
521
+ * ```tsx
522
+ * const { suites, loading, create, remove } = useEvalSuites("proj-123");
523
+ *
524
+ * await create("proj-123", { name: "Accuracy Suite" });
525
+ * ```
526
+ */
461
527
  declare function useEvalSuites(projectId: string): {
462
528
  suites: unknown[];
463
529
  loading: boolean;
@@ -468,6 +534,20 @@ declare function useEvalSuites(projectId: string): {
468
534
  refresh: () => Promise<void>;
469
535
  };
470
536
 
537
+ /**
538
+ * Fetches and manages evaluation cases within a suite.
539
+ *
540
+ * @param projectId - The project ID the suite belongs to
541
+ * @param suiteId - The suite ID to fetch cases for
542
+ * @returns Case list, loading state, error, and CRUD operations
543
+ *
544
+ * @example
545
+ * ```tsx
546
+ * const { cases, loading, create } = useEvalCases("proj-123", "suite-456");
547
+ *
548
+ * await create("proj-123", "suite-456", { question: "What is 2+2?", answer: "4" });
549
+ * ```
550
+ */
471
551
  declare function useEvalCases(projectId: string, suiteId: string): {
472
552
  cases: unknown[];
473
553
  loading: boolean;
@@ -478,6 +558,19 @@ declare function useEvalCases(projectId: string, suiteId: string): {
478
558
  refresh: () => Promise<void>;
479
559
  };
480
560
 
561
+ /**
562
+ * Fetches and manages evaluation runs, optionally scoped to a project.
563
+ *
564
+ * @param projectId - Optional project ID to filter runs by project
565
+ * @returns Run list, loading state, error, and operations (start, abort, remove)
566
+ *
567
+ * @example
568
+ * ```tsx
569
+ * const { runs, loading, start, abort } = useEvalRuns("proj-123");
570
+ *
571
+ * const result = await start("proj-123");
572
+ * ```
573
+ */
481
574
  declare function useEvalRuns(projectId?: string): {
482
575
  runs: unknown[];
483
576
  loading: boolean;
@@ -490,6 +583,18 @@ declare function useEvalRuns(projectId?: string): {
490
583
  refresh: () => Promise<void>;
491
584
  };
492
585
 
586
+ /**
587
+ * Streams real-time progress of an evaluation run via SSE.
588
+ *
589
+ * @param runId - The evaluation run ID to stream, or `null` to disable streaming
590
+ * @returns Status, progress counters, connection state, and a stop function
591
+ *
592
+ * @example
593
+ * ```tsx
594
+ * const { status, progress, connected, stopStreaming } = useEvalRunStream("run-789");
595
+ * // progress: { completed: 5, total: 10, passed: 4, failed: 1 }
596
+ * ```
597
+ */
493
598
  declare function useEvalRunStream(runId: string | null): {
494
599
  status: string;
495
600
  progress: {
@@ -581,14 +686,34 @@ interface AgentThreadProviderProps<T extends UseChatOptions> {
581
686
  onStreamCompleted?: () => void;
582
687
  }
583
688
  /**
584
- * Provider component for AgentThreadContext
585
- * Manages all agent thread state and operations
689
+ * Provider component for AgentThreadContext.
690
+ * Manages all agent thread state and operations including message streaming, interrupts,
691
+ * queue management, and agent state polling.
692
+ *
693
+ * @param props - {@link AgentThreadProviderProps}
694
+ * @param props.threadId - The ID of the thread to manage. If `null`, the provider renders nothing.
695
+ * @param props.assistantId - The assistant ID to associate with this thread. Falls back to the client's assistant ID if omitted.
696
+ * @param props.options - Configuration options for chat behavior (streaming, resume stream polling, initial messages, etc.).
697
+ * @param props.children - React children to render within the thread context.
698
+ * @param props.onToolCompleted - Callback invoked each time a tool call completes, receiving the tool name.
699
+ * @param props.onStreamCompleted - Callback invoked when the SSE stream completes for any message.
700
+ *
701
+ * @returns A React context provider wrapping children with {@link AgentThreadContext.Provider}, or `null` if no `threadId` is provided.
586
702
  */
587
703
  declare function AgentThreadProvider<T extends UseChatOptions>({ threadId, assistantId, options, children, onToolCompleted, onStreamCompleted, }: AgentThreadProviderProps<T>): react_jsx_runtime.JSX.Element | null;
588
704
  /**
589
- * Hook to access AgentThreadContext
590
- * @returns Agent thread context value
591
- * @throws Error if used outside of AgentThreadProvider
705
+ * Hook to access AgentThreadContext.
706
+ *
707
+ * @param T - The {@link UseChatOptions} type parameter, allowing typed access to options.
708
+ * @returns Agent thread context value of type {@link AgentThreadContextValue}.
709
+ * @throws {Error} If used outside of an {@link AgentThreadProvider}.
710
+ *
711
+ * @example
712
+ * ```tsx
713
+ * const { state, sendMessage, stopStreaming, abortAgent } = useAgentThreadContext();
714
+ *
715
+ * await sendMessage({ input: { message: 'Hello!' } });
716
+ * ```
592
717
  */
593
718
  declare function useAgentThreadContext<T extends UseChatOptions>(): AgentThreadContextValue<T>;
594
719
 
@@ -597,10 +722,17 @@ interface UserTenantInfo {
597
722
  role: string;
598
723
  tenant?: Tenant;
599
724
  }
725
+ interface PersonalAssistantInfo {
726
+ assistantId: string;
727
+ projectId: string;
728
+ workspaceId: string;
729
+ }
600
730
  interface AuthContextValue {
601
731
  user: User | null;
602
732
  tenants: UserTenantInfo[];
603
733
  currentTenant: Tenant | null;
734
+ personalAssistant: PersonalAssistantInfo | null;
735
+ setPersonalAssistant: (info: PersonalAssistantInfo | null) => void;
604
736
  isAuthenticated: boolean;
605
737
  isLoading: boolean;
606
738
  error: string | null;
@@ -619,6 +751,30 @@ interface AuthContextValue {
619
751
  clearError: () => void;
620
752
  changePassword: (currentPassword: string, newPassword: string) => Promise<void>;
621
753
  }
754
+ /**
755
+ * Hook to access authentication context. Must be used within an {@link AuthProvider}.
756
+ *
757
+ * @description
758
+ * Provides the full auth state and all auth operations (login, register, logout, tenant selection, etc.).
759
+ * Throws an error if no {@link AuthProvider} is found in the component tree. For optional auth,
760
+ * use {@link useAuthOptional} instead.
761
+ *
762
+ * @returns The current {@link AuthContextValue} containing user, tenants, auth state, and auth actions.
763
+ *
764
+ * @throws {Error} If used outside of an {@link AuthProvider}.
765
+ *
766
+ * @example
767
+ * ```tsx
768
+ * const { user, isAuthenticated, login, logout } = useAuth();
769
+ *
770
+ * const handleLogin = async () => {
771
+ * const result = await login('user@example.com', 'password');
772
+ * if (result.requiresTenantSelection) {
773
+ * // Show tenant picker
774
+ * }
775
+ * };
776
+ * ```
777
+ */
622
778
  declare const useAuth: () => AuthContextValue;
623
779
  /**
624
780
  * Optional version of useAuth that returns null instead of throwing when AuthProvider is not present.
@@ -632,13 +788,54 @@ declare const useAuth: () => AuthContextValue;
632
788
  * const user = useAuthOptional()?.user;
633
789
  */
634
790
  declare const useAuthOptional: () => AuthContextValue | null;
791
+ /**
792
+ * Props for {@link AuthProvider}.
793
+ */
635
794
  interface AuthProviderProps {
795
+ /** Child components that will have access to the auth context. */
636
796
  children: ReactNode;
797
+ /** Base URL of the gateway API (e.g., `http://localhost:3000`). */
637
798
  baseURL: string;
799
+ /** Called after a successful login with the user and their tenant memberships. */
638
800
  onLoginSuccess?: (user: User, tenants: UserTenantInfo[]) => void;
801
+ /** Called after a tenant is successfully selected, passing the selected tenant. */
639
802
  onTenantSelected?: (tenant: Tenant) => void;
803
+ /** Called after the user logs out. */
640
804
  onLogout?: () => void;
641
805
  }
806
+ /**
807
+ * Authentication context provider. Wraps the application to provide auth state and operations
808
+ * to all descendant components via {@link useAuth} and {@link useAuthOptional}.
809
+ *
810
+ * @description
811
+ * Manages the full authentication lifecycle including:
812
+ * - **Login / Register**: Sends credentials to the gateway API and stores the returned user, tenants, and token in `sessionStorage`.
813
+ * - **Session restoration**: On mount, reads previously stored user data from `sessionStorage` and also refreshes the tenant list to catch any admin-side role assignments.
814
+ * - **Tenant selection**: Calls the gateway API to select a tenant and stores the tenant data.
815
+ * - **Logout**: Clears all auth state and `sessionStorage`.
816
+ * - **Change password**: Proxies to the gateway password change endpoint.
817
+ * - **Token expiration**: Automatically logs out when the gateway returns a 401 with an expired token message.
818
+ *
819
+ * @param props - {@link AuthProviderProps}
820
+ * @param props.children - React children to render within the auth context.
821
+ * @param props.baseURL - Base URL of the gateway API.
822
+ * @param props.onLoginSuccess - Optional callback invoked after a successful login.
823
+ * @param props.onTenantSelected - Optional callback invoked after tenant selection.
824
+ * @param props.onLogout - Optional callback invoked on logout.
825
+ *
826
+ * @returns A React context provider wrapping children with {@link AuthContext.Provider}.
827
+ *
828
+ * @example
829
+ * ```tsx
830
+ * <AuthProvider
831
+ * baseURL="http://localhost:3000"
832
+ * onLoginSuccess={(user) => console.log('Logged in:', user.email)}
833
+ * onLogout={() => window.location.reload()}
834
+ * >
835
+ * <App />
836
+ * </AuthProvider>
837
+ * ```
838
+ */
642
839
  declare const AuthProvider: React__default.FC<AuthProviderProps>;
643
840
 
644
841
  /**
@@ -733,6 +930,22 @@ interface UseTenantsReturn {
733
930
  refresh: () => Promise<void>;
734
931
  getTenantById: (id: string) => Tenant | undefined;
735
932
  }
933
+ /**
934
+ * Fetches and manages a list of tenants from the API.
935
+ *
936
+ * @param options - Configuration options
937
+ * @param options.baseURL - The base URL of the API gateway
938
+ * @param options.token - Optional authentication token
939
+ * @returns Tenant list, loading state, error, refresh function, and lookup helper
940
+ *
941
+ * @example
942
+ * ```tsx
943
+ * const { tenants, isLoading, error, refresh, getTenantById } = useTenants({
944
+ * baseURL: "https://api.example.com",
945
+ * token: "your-auth-token",
946
+ * });
947
+ * ```
948
+ */
736
949
  declare function useTenants(options: UseTenantsOptions): UseTenantsReturn;
737
950
  interface UseUsersOptions {
738
951
  baseURL: string;
@@ -746,78 +959,256 @@ interface UseUsersReturn {
746
959
  refresh: () => Promise<void>;
747
960
  searchByEmail: (email: string) => Promise<_axiom_lattice_protocols.User | null>;
748
961
  }
962
+ /**
963
+ * Fetches and manages a list of users within a tenant.
964
+ *
965
+ * @param options - Configuration options
966
+ * @param options.baseURL - The base URL of the API gateway
967
+ * @param options.tenantId - The tenant ID to fetch users for
968
+ * @param options.token - Optional authentication token
969
+ * @returns User list, loading state, error, refresh function, and email search helper
970
+ *
971
+ * @example
972
+ * ```tsx
973
+ * const { users, isLoading, error, searchByEmail } = useUsers({
974
+ * baseURL: "https://api.example.com",
975
+ * tenantId: "tenant-123",
976
+ * });
977
+ *
978
+ * const user = await searchByEmail("user@example.com");
979
+ * ```
980
+ */
749
981
  declare function useUsers(options: UseUsersOptions): UseUsersReturn;
750
982
 
983
+ /**
984
+ * Props for the {@link Chating} component — the core chat interface.
985
+ *
986
+ * Controls appearance, sender behavior, empty-state customization, and
987
+ * optional context injection for the agent.
988
+ */
751
989
  interface ChatingProps {
990
+ /** Agent display name shown in the header. */
752
991
  name?: string;
992
+ /** Agent description shown in the header. */
753
993
  description?: string;
994
+ /** Fallback message used when the user submits only attachments without text. */
754
995
  default_submit_message?: string;
996
+ /** Avatar URL or component for the agent. */
755
997
  avatar?: string;
998
+ /** Placeholder content rendered inside the attachment upload area. */
756
999
  attachment_placeholder?: React__default.ReactNode;
1000
+ /** Custom upload endpoint URL. Defaults to the workspace or thread sandbox upload endpoint. */
757
1001
  uploadAction?: string;
1002
+ /** Quick prompt items displayed between messages. */
758
1003
  senderPromptsItems?: GetProp<typeof Prompts, "items">;
1004
+ /** Extra content rendered in the header area. */
759
1005
  extra?: React__default.ReactNode;
1006
+ /** Additional metadata items for the header. */
760
1007
  extraMeta?: Array<{
761
1008
  id: string;
762
1009
  }>;
1010
+ /** Whether to show the agent header bar. Default: true. */
763
1011
  showHeader?: boolean;
1012
+ /** Whether to show the message sender input. Default: true. */
764
1013
  showSender?: boolean;
1014
+ /** Whether to show the Human-in-the-Loop (HITL) container. Default: true. */
765
1015
  showHITL?: boolean;
1016
+ /** Whether to show a refresh button in the header. */
766
1017
  showRefreshButton?: boolean;
767
1018
  /**
768
- * Whether to show the model selector in the sender footer
769
- * When provided, overrides the shell config's enableModelSelector
1019
+ * Whether to show the model selector in the sender footer.
1020
+ * When provided, overrides the shell config's enableModelSelector.
770
1021
  */
771
1022
  showModelSelector?: boolean;
772
- /** Show database picker in sender footer. Overrides shell config enableDatabaseSlot */
1023
+ /** Show database picker in sender footer. Overrides shell config enableDatabaseSlot. */
773
1024
  showDatabaseSlot?: boolean;
774
- /** Show skill picker in sender footer. Overrides shell config enableSkillSlot */
1025
+ /** Show skill picker in sender footer. Overrides shell config enableSkillSlot. */
775
1026
  showSkillSlot?: boolean;
776
- /** Show agent picker in sender footer. Overrides shell config enableAgentSlot */
1027
+ /** Show agent picker in sender footer. Overrides shell config enableAgentSlot. */
777
1028
  showAgentSlot?: boolean;
778
- /** Show metrics data source picker in sender footer. Overrides shell config enableMetricsDataSourceSlot */
1029
+ /** Show metrics data source picker in sender footer. Overrides shell config enableMetricsDataSourceSlot. */
779
1030
  showMetricsDataSourceSlot?: boolean;
1031
+ /** Whether to show the greeting empty state when no messages exist. Default: true. */
780
1032
  showEmptyState?: boolean;
1033
+ /** Custom greeting element displayed in the empty state. */
781
1034
  emptyStateGreeting?: React__default.ReactNode;
1035
+ /** Empty state question line. Default: "Ready to turn..." */
782
1036
  emptyStateQuestion?: string;
1037
+ /** Show skill category prompts in empty state. Default: true. */
1038
+ showSkillPrompts?: boolean;
1039
+ /** Show business analysis prompts in empty state. Default: true. */
1040
+ showQuickAnalysis?: boolean;
1041
+ /** Welcome prefix text (e.g., "Hey"). */
783
1042
  welcomePrefix?: string;
784
- /** Context string injected before the first user message (e.g. workflow context) */
1043
+ /** Context string injected before the first user message (e.g. workflow context). */
785
1044
  systemContext?: string;
786
- /** Auto-send this message when agent becomes idle (thread ready, not loading) */
1045
+ /** Auto-send this message when agent becomes idle (thread ready, not loading). */
787
1046
  initialMessage?: string | null;
788
- /** Called after initialMessage has been sent */
1047
+ /** Called after initialMessage has been sent. */
789
1048
  onInitialMessageSent?: () => void;
790
1049
  }
1050
+ /**
1051
+ * Core chat interface component — manages sender input, message display,
1052
+ * and agent-streaming state for a single assistant thread.
1053
+ *
1054
+ * Features:
1055
+ * - Empty state with greeting and skill/analysis prompt categories
1056
+ * - Message sender with file attachment, skill/agent/database pickers, and model selector
1057
+ * - Typing cursor animation during streaming
1058
+ * - HITL interrupt handling and pending-message display
1059
+ * - Auto-send of {@link ChatingProps.systemContext} and {@link ChatingProps.initialMessage}
1060
+ * - Transition animations between empty and active states
1061
+ *
1062
+ * @param props - See {@link ChatingProps}.
1063
+ * @returns The full chat UI for the active thread.
1064
+ *
1065
+ * @example
1066
+ * ```tsx
1067
+ * import { Chating } from "@axiom-lattice/react-sdk";
1068
+ *
1069
+ * <Chating
1070
+ * name="Data Analyst"
1071
+ * showHeader
1072
+ * showSender
1073
+ * showModelSelector
1074
+ * emptyStateQuestion="What data would you like to analyze?"
1075
+ * systemContext="You are analyzing sales data from Q4 2024."
1076
+ * />
1077
+ * ```
1078
+ *
1079
+ * @remarks
1080
+ * - Requires the following ancestor context providers: {@link AgentThreadProvider},
1081
+ * {@link ChatUIContextProvider}, {@link LatticeChatShellContextProvider},
1082
+ * {@link ConversationContextProvider}, {@link AssistantContextProvider}.
1083
+ * - Prop-level feature toggles (e.g. `showModelSelector`) take priority over
1084
+ * shell-config-level toggles.
1085
+ * - Uses {@link useAgentChat} for all agent communication.
1086
+ */
791
1087
  declare const Chating: React__default.FC<ChatingProps>;
792
1088
 
1089
+ /**
1090
+ * Props for the {@link LatticeChat} component.
1091
+ *
1092
+ * Extends {@link ChatingProps} with thread/assistant identification
1093
+ * and optional menu/header slots.
1094
+ */
793
1095
  type AgentChatProps = {
1096
+ /** The ID of the currently active thread. If absent, a placeholder is shown prompting users to create a conversation. */
794
1097
  thread_id?: string;
1098
+ /** The assistant ID that backs the chat. Required — feeds the {@link AgentThreadProvider}. */
795
1099
  assistant_id: string;
1100
+ /** Optional menu rendered in the left sidebar column. */
796
1101
  menu?: React__default.ReactNode;
1102
+ /** Optional header rendered above the main chat area. */
797
1103
  header?: React__default.ReactNode;
1104
+ /** Optional right-side header content. Replaces the default folder toggle button. Use {@link FilePanelToggle} to include it. */
1105
+ headerRight?: React__default.ReactNode;
1106
+ /** Show workspace project selector in header. Default true. */
1107
+ showProjectSelector?: boolean;
1108
+ /** Content shown when no thread is active. Default: "Please create a conversation first". */
1109
+ emptyPlaceholder?: React__default.ReactNode;
798
1110
  } & ChatingProps;
1111
+ /**
1112
+ * Top-level chat component for a single assistant thread.
1113
+ *
1114
+ * Wraps the chat UI in:
1115
+ * - {@link AgentThreadProvider} for thread state
1116
+ * - {@link ChatUIContextProvider} for UI panel toggles
1117
+ * - A responsive {@link ColumnLayout} with menu, main chat, detail panel, and tools panel
1118
+ *
1119
+ * When `thread_id` is empty, a prompt to create a conversation is displayed.
1120
+ *
1121
+ * @example
1122
+ * ```tsx
1123
+ * import { LatticeChat } from "@axiom-lattice/react-sdk";
1124
+ *
1125
+ * <LatticeChat
1126
+ * assistant_id="asst_abc123"
1127
+ * thread_id="thread_xyz"
1128
+ * showHeader
1129
+ * showSender
1130
+ * />
1131
+ * ```
1132
+ *
1133
+ * @remarks
1134
+ * - Requires a parent `<LatticeChatShell>` for shell-level configuration (API URL, feature toggles).
1135
+ * - The `ChatingProps` are forwarded to the internal {@link Chating} component.
1136
+ */
799
1137
  declare const LatticeChat: React__default.FC<AgentChatProps>;
800
1138
 
1139
+ /**
1140
+ * Model runtime configuration passed to the agent when a model is selected.
1141
+ */
801
1142
  interface ModelConfig {
1143
+ /** The model key as registered on the server (e.g., "gpt-4o"). */
802
1144
  modelKey: string;
1145
+ /** Sampling temperature (0-2). Higher values produce more random output. */
803
1146
  temperature?: number;
1147
+ /** Maximum tokens in the generated response. */
804
1148
  maxTokens?: number;
1149
+ /** Nucleus sampling parameter (0-1). */
805
1150
  topP?: number;
1151
+ /** Penalty for repeating tokens (-2 to 2). */
806
1152
  frequencyPenalty?: number;
1153
+ /** Penalty for introducing new topics (-2 to 2). */
807
1154
  presencePenalty?: number;
808
1155
  }
1156
+ /**
1157
+ * Model metadata returned by the `/api/models` endpoint.
1158
+ */
809
1159
  interface ModelInfo {
1160
+ /** Unique model key (used as the selection value). */
810
1161
  key: string;
1162
+ /** Provider identifier (e.g., "openai", "azure"). */
811
1163
  provider: string;
1164
+ /** Model name as known by the provider (e.g., "gpt-4o"). */
812
1165
  model: string;
1166
+ /** Human-readable display name for the dropdown. */
813
1167
  displayName?: string;
814
1168
  }
1169
+ /**
1170
+ * Props for the {@link ModelSelector} component.
1171
+ */
815
1172
  interface ModelSelectorProps {
1173
+ /** Currently selected model configuration (controlled). */
816
1174
  value?: ModelConfig | null;
1175
+ /** Called when the user selects a model. */
817
1176
  onChange?: (config: ModelConfig | null) => void;
1177
+ /** Default model key used when the fetch response includes a matching model. */
818
1178
  defaultModelKey?: string;
1179
+ /** Inline styles applied to the Select element. */
819
1180
  style?: React__default.CSSProperties;
820
1181
  }
1182
+ /**
1183
+ * A borderless Ant Design `Select` dropdown for choosing the LLM model.
1184
+ *
1185
+ * Fetches available models from `/api/models` on first render and caches the result.
1186
+ * When a default model key matches a model in the list, it is auto-selected.
1187
+ * The selection is reported via the {@link ModelSelectorProps.onChange} callback,
1188
+ * which typically feeds into `updateCustomRunConfig` in the {@link Chating} component.
1189
+ *
1190
+ * @param value - Currently selected model config (controlled).
1191
+ * @param onChange - Callback when the selection changes.
1192
+ * @param defaultModelKey - Model key to auto-select if found in the model list.
1193
+ * @param style - Inline styles for the Select wrapper.
1194
+ * @returns A compact model selector with hover-highlight background.
1195
+ *
1196
+ * @example
1197
+ * ```tsx
1198
+ * import { ModelSelector } from "@axiom-lattice/react-sdk";
1199
+ *
1200
+ * <ModelSelector
1201
+ * value={modelConfig}
1202
+ * onChange={(config) => updateCustomRunConfig({ modelConfig: config })}
1203
+ * defaultModelKey="gpt-4o"
1204
+ * />
1205
+ * ```
1206
+ *
1207
+ * @remarks
1208
+ * - Supports both controlled (`value` prop) and uncontrolled (internal state) usage.
1209
+ * - Fetch is performed only once per component mount via a ref guard.
1210
+ * - The dropdown is intentionally borderless to blend into the sender footer.
1211
+ */
821
1212
  declare const ModelSelector: React__default.FC<ModelSelectorProps>;
822
1213
 
823
1214
  declare const MDResponse: React__default.MemoExoticComponent<({ content, context, embeddedLink, interactive, userData, noGenUI, }: {
@@ -832,33 +1223,95 @@ declare const MDViewFormItem: ({ value }: {
832
1223
  value?: string;
833
1224
  }) => react_jsx_runtime.JSX.Element;
834
1225
 
1226
+ /**
1227
+ * Props passed to every GenUI element component.
1228
+ *
1229
+ * Each element registered in the GenUI element registry receives these props,
1230
+ * with the `data` field carrying the element-specific payload from the agent.
1231
+ *
1232
+ * @typeParam T - The shape of the element-specific data payload
1233
+ */
835
1234
  type ElementProps<T = any> = {
1235
+ /** Key identifying which GenUI element component to render */
836
1236
  component_key: string;
1237
+ /** Optional context for the current conversation */
837
1238
  context?: {
1239
+ /** The thread ID associated with this element */
838
1240
  thread_id?: string;
1241
+ /** The assistant ID associated with this element */
839
1242
  assistant_id?: string;
840
1243
  };
1244
+ /** Element-specific data payload from the agent */
841
1245
  data: T;
1246
+ /** Whether the element supports user interaction (defaults to false) */
842
1247
  interactive?: boolean;
1248
+ /** Whether to open this element in the side app panel by default */
843
1249
  default_open_in_side_app?: boolean;
844
1250
  };
1251
+ /**
1252
+ * Metadata for a registered GenUI element.
1253
+ *
1254
+ * Defines how an element is rendered and optionally what action to perform
1255
+ * when the user interacts with it.
1256
+ */
845
1257
  interface ElementMeta {
1258
+ /** The main card-view React component for this element */
846
1259
  card_view: React.FC<ElementProps>;
1260
+ /** Optional side-app panel React component for expanded viewing */
847
1261
  side_app_view?: React.FC<ElementProps>;
1262
+ /** Optional action callback invoked when the user interacts with the element */
848
1263
  action?: (data: any) => void;
849
1264
  }
1265
+ /**
1266
+ * Data structure representing a tool call made by the agent.
1267
+ *
1268
+ * Rendered by GenUI tool card elements to display tool invocations,
1269
+ * their arguments, and their results.
1270
+ */
850
1271
  interface ToolCallData {
1272
+ /** Unique identifier for this tool call */
851
1273
  id: string;
1274
+ /** Name of the tool being called */
852
1275
  name: string;
1276
+ /** Arguments passed to the tool */
853
1277
  args: Record<string, any>;
1278
+ /** Distinguishes tool calls from other message types */
854
1279
  type: "tool_call";
1280
+ /** The tool's response, if available */
855
1281
  response?: string;
1282
+ /** Execution status of the tool call */
856
1283
  status?: "success" | "pending" | "error";
857
1284
  }
858
1285
 
859
1286
  declare const getElement: (language: string | undefined) => ElementMeta | null;
860
1287
  declare const regsiterElement: (language: string, ElementMeta: ElementMeta) => ElementMeta;
861
1288
 
1289
+ /**
1290
+ * Tabbed side-app browser that renders GenUI components in the right panel.
1291
+ *
1292
+ * Manages a tab strip of registered side-app views. When a new component is
1293
+ * selected via {@link SideAppBrowserContext}, a tab is added (or activated if
1294
+ * it already exists). Tabs are closable and switchable. An "all tabs" dropdown
1295
+ * appears when there are 2+ tabs. Uses {@link ChatUIContext} to read/write the
1296
+ * active side-app card and open/close the panel.
1297
+ *
1298
+ * @param region - Which panel region this browser is attached to.
1299
+ * `"side"` for the right detail panel (default), `"content"` for the main content area.
1300
+ * @returns The tabbed side-app viewer, or an empty state if no tabs are open.
1301
+ *
1302
+ * @example
1303
+ * ```tsx
1304
+ * import { SideAppViewBrowser } from "@axiom-lattice/react-sdk";
1305
+ *
1306
+ * <SideAppViewBrowser region="side" />
1307
+ * ```
1308
+ *
1309
+ * @remarks
1310
+ * - Internally renders {@link SideAppBrowserContext.Provider} so that child
1311
+ * components can programmatically open new side-apps via `openApp()`.
1312
+ * - Component resolution uses {@link getElement} from the GenUI element registry.
1313
+ * - Designed to work with {@link ColumnLayout} as the `detail` panel.
1314
+ */
862
1315
  declare const SideAppViewBrowser: React__default.FC<{
863
1316
  region?: "side" | "content";
864
1317
  }>;
@@ -909,9 +1362,54 @@ declare const ChatUIContext: React__default.Context<{
909
1362
  contentAppSelectedCard: PanelCard | null;
910
1363
  setContentAppSelectedCard: (card: PanelCard | null) => void;
911
1364
  }>;
1365
+ /**
1366
+ * Chat UI context provider. Manages visibility and selected cards for chat panel areas
1367
+ * (detail, tools, side app, content app) and the sidebar menu collapsed state.
1368
+ *
1369
+ * @description
1370
+ * Tracks the open/closed state and the currently selected {@link PanelCard} for each panel:
1371
+ * - **Detail panel**: A slide-out detail view that displays a chosen card's content.
1372
+ * - **Tools panel**: A tools sidebar/drawer for tool-specific cards.
1373
+ * - **Side app**: Aliases to the detail panel (shared state).
1374
+ * - **Content app**: An inline content area for embedded app cards.
1375
+ * - **Menu collapsed**: Whether the sidebar navigation menu is collapsed.
1376
+ *
1377
+ * Provides action helpers (`openDetail`, `closeDetail`, `openTools`, `toggleTools`, etc.)
1378
+ * that set both visibility and selected card atomically.
1379
+ *
1380
+ * @param props - Provider props.
1381
+ * @param props.children - React children to render within the UI context.
1382
+ *
1383
+ * @returns A React context provider wrapping children with {@link ChatUIContext.Provider}.
1384
+ *
1385
+ * @example
1386
+ * ```tsx
1387
+ * <ChatUIContextProvider>
1388
+ * <ChatLayout />
1389
+ * </ChatUIContextProvider>
1390
+ * ```
1391
+ */
912
1392
  declare const ChatUIContextProvider: ({ children, }: {
913
1393
  children: React__default.ReactNode;
914
1394
  }) => react_jsx_runtime.JSX.Element;
1395
+ /**
1396
+ * Hook to access the chat UI context. Must be used within a {@link ChatUIContextProvider}.
1397
+ *
1398
+ * @description
1399
+ * Returns panel visibility state, selected panel cards, and action functions for controlling
1400
+ * the chat interface panels (detail, tools, side app, content app) and menu collapsed state.
1401
+ *
1402
+ * @returns The current chat UI context value containing panel state and control functions.
1403
+ *
1404
+ * @example
1405
+ * ```tsx
1406
+ * const { detailVisible, openDetail, closeDetail, toggleTools, menuCollapsed } = useChatUIContext();
1407
+ *
1408
+ * const handleCardClick = (card: PanelCard) => {
1409
+ * openDetail(card);
1410
+ * };
1411
+ * ```
1412
+ */
915
1413
  declare const useChatUIContext: () => {
916
1414
  detailVisible: boolean;
917
1415
  setDetailVisible: (visible: boolean) => void;
@@ -1052,8 +1550,33 @@ interface ConversationContextProviderProps {
1052
1550
  */
1053
1551
  declare function generateLabelFromMessage(message: string): string;
1054
1552
  /**
1055
- * Provider component for ConversationContext
1056
- * Manages conversation thread state for assistants
1553
+ * Provider component for ConversationContext.
1554
+ * Manages conversation thread state for the currently selected assistant.
1555
+ *
1556
+ * @description
1557
+ * Coordinates with {@link AssistantContext} to load threads for the current assistant.
1558
+ * Key behaviors:
1559
+ * - **Thread loading**: Fetches threads from the API when the assistant changes. If no threads
1560
+ * exist, a new thread is automatically created.
1561
+ * - **Auto-selection**: Selects the most recently updated thread as the active thread when loading.
1562
+ * - **Cross-thread config**: Maintains an assistant-level `customRunConfig` shared across all threads
1563
+ * (useful for metrics datasource and other assistant-wide settings).
1564
+ * - **Thread operations**: Provides full CRUD operations (create, update, delete, list, select)
1565
+ * backed by the client SDK.
1566
+ *
1567
+ * Requires {@link AssistantContextProvider} ancestor and {@link LatticeChatShellContextProvider}.
1568
+ *
1569
+ * @param props - {@link ConversationContextProviderProps}
1570
+ * @param props.children - React children to render within the conversation context.
1571
+ *
1572
+ * @returns A React context provider wrapping children with {@link ConversationContext.Provider}.
1573
+ *
1574
+ * @example
1575
+ * ```tsx
1576
+ * <ConversationContextProvider>
1577
+ * <ThreadList />
1578
+ * </ConversationContextProvider>
1579
+ * ```
1057
1580
  */
1058
1581
  declare const ConversationContextProvider: ({ children, }: ConversationContextProviderProps) => react_jsx_runtime.JSX.Element;
1059
1582
  /**
@@ -1143,8 +1666,34 @@ interface AssistantContextProviderProps {
1143
1666
  initialAssistantId?: string | null;
1144
1667
  }
1145
1668
  /**
1146
- * Provider component for AssistantContext
1147
- * Manages assistant state and operations
1669
+ * Provider component for AssistantContext.
1670
+ * Manages assistant state and operations including CRUD, selection, and auto-loading.
1671
+ *
1672
+ * @description
1673
+ * Coordinates with the client SDK to provide assistant management:
1674
+ * - **Auto-load**: When `autoLoad` is `true` (default), fetches the assistant list on mount.
1675
+ * - **Auto-selection**: If `initialAssistantId` is provided, selects that assistant after loading.
1676
+ * Otherwise, auto-selects the first available assistant.
1677
+ * - **Re-selection**: If the currently selected assistant is removed from the list (e.g., deleted),
1678
+ * falls back to selecting the first available assistant.
1679
+ * - **CRUD operations**: Provides `createAssistant`, `updateAssistant`, `deleteAssistant`, and
1680
+ * `getAssistant` backed by the SDK, keeping local state in sync.
1681
+ *
1682
+ * Requires an {@link AxiomLatticeProvider} ancestor for the API client.
1683
+ *
1684
+ * @param props - {@link AssistantContextProviderProps}
1685
+ * @param props.children - React children to render within the assistant context.
1686
+ * @param props.autoLoad - Whether to automatically load assistants on mount. Defaults to `true`.
1687
+ * @param props.initialAssistantId - Optional assistant ID to auto-select on load.
1688
+ *
1689
+ * @returns A React context provider wrapping children with {@link AssistantContext.Provider}.
1690
+ *
1691
+ * @example
1692
+ * ```tsx
1693
+ * <AssistantContextProvider initialAssistantId="asst_123">
1694
+ * <AssistantSelector />
1695
+ * </AssistantContextProvider>
1696
+ * ```
1148
1697
  */
1149
1698
  declare const AssistantContextProvider: ({ children, autoLoad, initialAssistantId, }: AssistantContextProviderProps) => react_jsx_runtime.JSX.Element;
1150
1699
  /**
@@ -1376,6 +1925,13 @@ interface LatticeChatShellConfig {
1376
1925
  * Defaults to false
1377
1926
  */
1378
1927
  enableWorkspace?: boolean;
1928
+ /**
1929
+ * Whether to load custom menu items from the database (API /api/menu-items).
1930
+ * When enabled, WorkspaceResourceManager fetches per-tenant custom menu items
1931
+ * and merges them with built-in defaults.
1932
+ * Defaults to true.
1933
+ */
1934
+ enableCustomMenu?: boolean;
1379
1935
  /**
1380
1936
  * Resource folders configuration for workspace
1381
1937
  * Each folder represents a section in the workspace assets panel
@@ -1550,33 +2106,107 @@ declare const LatticeChatShellContextProvider: ({ children, initialConfig, persi
1550
2106
  */
1551
2107
  declare const useLatticeChatShellContext: () => LatticeChatShellContextValue;
1552
2108
 
2109
+ /**
2110
+ * Represents a single message in the chat UI.
2111
+ *
2112
+ * Used by the chat components to render messages, display thinking states,
2113
+ * and handle tool call results. Can also contain nested child messages
2114
+ * via the {@link items} property for grouped interactions.
2115
+ */
1553
2116
  interface UIMessage {
2117
+ /** Unique identifier for the message */
1554
2118
  id: string;
2119
+ /** The run ID associated with this message, if part of an agent run */
1555
2120
  run_id?: string;
2121
+ /** The text content of this message */
1556
2122
  content: string;
2123
+ /** Display name of the sender (e.g. agent name) */
1557
2124
  name?: string;
2125
+ /** Files attached to this message */
1558
2126
  files?: AttachFile[];
2127
+ /** The role of the message sender */
1559
2128
  role: "human" | "ai" | "tool";
2129
+ /** Nested child messages, used for tool call results or sub-tasks */
1560
2130
  items?: UIMessage[];
2131
+ /** The type determines how the message is rendered in the chat UI */
1561
2132
  type: "message" | "action" | "message_chunk" | "start_thinking" | "thinking_chunk" | "end_thinking";
2133
+ /** Parent message ID for nested/threaded messages */
1562
2134
  parent_id?: number | string;
2135
+ /** Current status of the message (e.g. "complete", "streaming") */
1563
2136
  status?: string;
2137
+ /** ID of the associated thinking block, if this is a thinking message */
1564
2138
  think_id?: string;
2139
+ /** Type of thinking block (e.g. "reasoning") */
1565
2140
  think_type?: string;
1566
2141
  }
2142
+ /**
2143
+ * Represents a file attachment in a chat message.
2144
+ */
1567
2145
  interface AttachFile {
2146
+ /** Display name of the attached file */
1568
2147
  name: string;
2148
+ /** Unique identifier for the attached file */
1569
2149
  id: string;
1570
2150
  }
1571
2151
 
2152
+ /**
2153
+ * Props for the {@link ColumnLayout} component.
2154
+ *
2155
+ * Defines the five content slots: menu sidebar, main chat, detail panel,
2156
+ * tools panel, logo, and header.
2157
+ */
1572
2158
  interface ColumnLayoutProps {
2159
+ /** Left sidebar menu content. Hidden when collapsed. */
1573
2160
  menu?: React__default.ReactNode;
2161
+ /** Primary content area (e.g., the chat thread). Required. */
1574
2162
  main: React__default.ReactNode;
2163
+ /** Right detail panel content (e.g., side-app viewer). */
1575
2164
  detail?: React__default.ReactNode;
2165
+ /** Right tools panel content (e.g., file browser). */
1576
2166
  tools?: React__default.ReactNode;
2167
+ /** Logo or branding rendered at the top of the menu sidebar. */
1577
2168
  logo?: React__default.ReactNode;
2169
+ /** Header bar rendered above the main content area on desktop and mobile. */
1578
2170
  header?: React__default.ReactNode;
1579
2171
  }
2172
+ /**
2173
+ * Responsive three-column (plus tools) layout for the chat interface.
2174
+ *
2175
+ * Consists of:
2176
+ * - **Menu** — collapsible left sidebar, auto-collapses on mobile or when
2177
+ * the detail panel is open.
2178
+ * - **Main content** — central chat area.
2179
+ * - **Detail panel** — right side panel for side-app views (sizable).
2180
+ * - **Tools panel** — right panel for file browsing and workspace tools.
2181
+ *
2182
+ * Panel visibility and sizing is driven by {@link useChatUIContext}. On mobile,
2183
+ * a hamburger toggle is rendered in the header to expand/collapse the menu.
2184
+ *
2185
+ * @param menu - Left sidebar menu content.
2186
+ * @param main - Primary content area (required).
2187
+ * @param detail - Right detail panel content.
2188
+ * @param tools - Right tools panel content.
2189
+ * @param logo - Logo rendered in the menu sidebar.
2190
+ * @param header - Header bar content.
2191
+ * @returns The responsive column layout element.
2192
+ *
2193
+ * @example
2194
+ * ```tsx
2195
+ * import { ColumnLayout } from "@axiom-lattice/react-sdk";
2196
+ *
2197
+ * <ColumnLayout
2198
+ * menu={<ChatSidebar />}
2199
+ * main={<Chating />}
2200
+ * detail={<SideAppViewBrowser />}
2201
+ * tools={<ToolPanelFiles />}
2202
+ * header={<AgentHeader />}
2203
+ * />
2204
+ * ```
2205
+ *
2206
+ * @remarks
2207
+ * - Must be rendered inside a {@link ChatUIContextProvider}.
2208
+ * - CSS class `fina_chat` is applied to the root div for external targeting.
2209
+ */
1580
2210
  declare const ColumnLayout: React__default.FC<ColumnLayoutProps>;
1581
2211
 
1582
2212
  interface ExplorerFile {
@@ -1594,18 +2224,47 @@ interface FileExplorerProps {
1594
2224
  }
1595
2225
  declare const FileExplorer: React__default.FC<ElementProps>;
1596
2226
 
2227
+ /**
2228
+ * Props for the {@link AgentConversations} component.
2229
+ */
1597
2230
  interface AgentConversationsProps {
1598
2231
  /**
1599
- * Whether users can create new threads from the UI
1600
- * Defaults to true
2232
+ * Whether users can create new threads from the UI.
2233
+ * Defaults to true.
1601
2234
  */
1602
2235
  enableThreadCreation?: boolean;
1603
2236
  /**
1604
- * Whether the thread list should be rendered
1605
- * Defaults to true
2237
+ * Whether the thread list should be rendered.
2238
+ * Defaults to true.
1606
2239
  */
1607
2240
  enableThreadList?: boolean;
1608
2241
  }
2242
+ /**
2243
+ * Thread list sidebar component showing conversation history for the current agent.
2244
+ *
2245
+ * Uses Ant Design X `Conversations` component to display threads fetched from
2246
+ * {@link useConversationContext}. Supports creating new threads when
2247
+ * `enableThreadCreation` is true.
2248
+ *
2249
+ * @param enableThreadCreation - Whether the "New Chat" button is shown. Default: true.
2250
+ * @param enableThreadList - Whether the thread list is rendered at all. Default: true.
2251
+ * @returns The conversations list or `null` if thread list is disabled.
2252
+ *
2253
+ * @example
2254
+ * ```tsx
2255
+ * import { AgentConversations } from "@axiom-lattice/react-sdk";
2256
+ *
2257
+ * <AgentConversations
2258
+ * enableThreadCreation={false}
2259
+ * enableThreadList
2260
+ * />
2261
+ * ```
2262
+ *
2263
+ * @remarks
2264
+ * - Requires ancestor context providers: {@link ConversationContextProvider} and
2265
+ * {@link AssistantContextProvider}.
2266
+ * - Returns `null` when `enableThreadList` is false.
2267
+ */
1609
2268
  declare const AgentConversations: React__default.FC<AgentConversationsProps>;
1610
2269
 
1611
2270
  declare const MetricsConfigDrawerContent: React__default.FC;
@@ -1613,10 +2272,10 @@ declare const MetricsConfigDrawerContent: React__default.FC;
1613
2272
  /**
1614
2273
  * Built-in default menu items for the workspace shell.
1615
2274
  *
1616
- * Contains 12 route/action items organized in groups:
2275
+ * Contains 11 route/action items organized in groups:
1617
2276
  * - Projects
1618
2277
  * - DataSource: Metrics, Database
1619
- * - Process: Automations, Runtime, Inbox, Eval
2278
+ * - Process: Workflows, Runtime, Inbox, Eval
1620
2279
  * - Settings: Assistants, Skills, MCP, Tools
1621
2280
  * - Account: Switch tenant
1622
2281
  *
@@ -1637,6 +2296,12 @@ interface WorkspaceResourceManagerProps {
1637
2296
  declare const WorkspaceResourceManager: React__default.FC<WorkspaceResourceManagerProps>;
1638
2297
  declare const WorkspaceResourceUIContext: React__default.FC<WorkspaceResourceManagerProps>;
1639
2298
 
2299
+ /**
2300
+ * Props for the {@link LatticeChatShell} component.
2301
+ *
2302
+ * Extends {@link LatticeChatShellContextProviderProps} (minus `children`) with
2303
+ * feature toggles that control chat UI surface capabilities.
2304
+ */
1640
2305
  type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "children"> & {
1641
2306
  /**
1642
2307
  * Whether users can create new assistants (default: true)
@@ -1656,14 +2321,46 @@ type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "childre
1656
2321
  enableModelSelector?: boolean;
1657
2322
  };
1658
2323
  /**
1659
- * Lattice Chat Shell component
1660
- * Provides a complete chat interface with conversation management
1661
- * Uses LatticeChatShellContext for configuration (baseURL, etc.)
2324
+ * Lattice Chat Shell — the top-level provider component for the full chat interface.
2325
+ *
2326
+ * Sets up the required context hierarchy:
2327
+ * - {@link LatticeChatShellContextProvider} — config layer (baseURL, feature toggles)
2328
+ * - Optionally {@link WorkspaceContextProvider} when `enableWorkspace` is true
2329
+ * - {@link AssistantContextProvider} — assistant loading
2330
+ * - {@link ConversationContextProvider} — thread management
2331
+ * - {@link AgentServerSetting} — server configuration modal
2332
+ *
2333
+ * Children render {@link LatticeChatView} which contains the chat sidebar and
2334
+ * the {@link LatticeChat} thread interface.
2335
+ *
2336
+ * @param props - See {@link LatticeChatShellProps}.
2337
+ * @returns A React provider tree wrapping the chat UI.
2338
+ *
2339
+ * @example
2340
+ * ```tsx
2341
+ * import { LatticeChatShell } from "@axiom-lattice/react-sdk";
2342
+ *
2343
+ * <LatticeChatShell
2344
+ * initialConfig={{ baseURL: "https://api.example.com", assistantId: "asst_1" }}
2345
+ * enableAssistantCreation={false}
2346
+ * enableWorkspace
2347
+ * enableModelSelector
2348
+ * />
2349
+ * ```
2350
+ *
2351
+ * @remarks
2352
+ * - `enableWorkspace` in props takes priority over `initialConfig.enableWorkspace`.
2353
+ * - This component should wrap all chat-related components in the application.
1662
2354
  */
1663
2355
  declare const LatticeChatShell: React__default.FC<LatticeChatShellProps>;
1664
2356
 
2357
+ /**
2358
+ * Props for the {@link ChatSidebar} component.
2359
+ */
1665
2360
  interface ChatSidebarProps {
2361
+ /** Callback invoked when the user clicks the settings menu item. */
1666
2362
  onSettingsClick?: () => void;
2363
+ /** Whether the sidebar starts collapsed. */
1667
2364
  defaultCollapsed?: boolean;
1668
2365
  /** @deprecated Use `sideMenuItems` on `LatticeChatShellConfig` instead. */
1669
2366
  customMenuItems?: SideMenuItemConfig[];
@@ -1682,20 +2379,68 @@ interface ChatSidebarProps {
1682
2379
  * Or omit `sideMenuItems` entirely to use these defaults as-is.
1683
2380
  */
1684
2381
  declare const DEFAULT_MENU_ITEMS: SideMenuItemConfig[];
2382
+ /**
2383
+ * Navigation sidebar for the chat interface.
2384
+ *
2385
+ * Renders a vertical {@link Menu} with configurable sidebar menu items
2386
+ * (defaults to {@link DEFAULT_MENU_ITEMS}) and a user avatar popover with
2387
+ * change-password and logout actions. Supports inline drawers for items like
2388
+ * thread history, and non-inline drawers rendered via Ant Design `Drawer`.
2389
+ *
2390
+ * @param props - See {@link ChatSidebarProps}.
2391
+ * @returns The sidebar element containing the menu and user-footer area.
2392
+ *
2393
+ * @example
2394
+ * ```tsx
2395
+ * import { ChatSidebar } from "@axiom-lattice/react-sdk";
2396
+ *
2397
+ * <ChatSidebar
2398
+ * onSettingsClick={() => showSettingsModal()}
2399
+ * />
2400
+ * ```
2401
+ *
2402
+ * @remarks
2403
+ * - Sidebar mode (expanded/icon), toggle visibility, and new-analysis button
2404
+ * visibility are controlled by {@link LatticeChatShellContext} config fields:
2405
+ * `sidebarMode`, `sidebarShowToggle`, `sidebarShowNewAnalysis`.
2406
+ * - Inline drawers (e.g. thread history) are handled within the {@link Menu}
2407
+ * component; non-inline drawers render as separate `Drawer` elements.
2408
+ * - User authentication comes from {@link useAuth}.
2409
+ */
1685
2410
  declare const ChatSidebar: React__default.FC<ChatSidebarProps>;
1686
2411
 
1687
2412
  declare const ChannelInstallationsDrawerContent: React__default.FC;
1688
2413
 
2414
+ /**
2415
+ * Props for the {@link ScheduleButton} component.
2416
+ */
1689
2417
  interface ScheduleButtonProps {
1690
2418
  /**
1691
- * Custom tooltip text
2419
+ * Custom tooltip text displayed on hover.
1692
2420
  */
1693
2421
  tooltipText?: string;
1694
2422
  }
1695
2423
  /**
1696
- * ScheduleButton - A button component to view scheduled tasks for the current thread
1697
- * Shows a badge with the count of active scheduled tasks
1698
- * Opens a side panel with the full schedule viewer when clicked
2424
+ * A toolbar button that shows the count of active scheduled tasks for the
2425
+ * current agent thread and opens an agenda viewer in the side panel on click.
2426
+ *
2427
+ * Fetches scheduled tasks via {@link useClient} on mount and whenever the
2428
+ * thread ID changes. The button is hidden when no tasks exist.
2429
+ *
2430
+ * @param tooltipText - Tooltip text shown on hover (default: "Agenda").
2431
+ * @returns The schedule button, or `null` if there is no thread ID or no tasks.
2432
+ *
2433
+ * @example
2434
+ * ```tsx
2435
+ * import { ScheduleButton } from "@axiom-lattice/react-sdk";
2436
+ *
2437
+ * <ScheduleButton tooltipText="Scheduled Reports" />
2438
+ * ```
2439
+ *
2440
+ * @remarks
2441
+ * - Requires ancestor context for {@link useAgentChat} and {@link ChatUIContextProvider}.
2442
+ * - Only active tasks (status PENDING or PAUSED) contribute to the badge count.
2443
+ * - Opens a side-app with `component_key: "schedule_viewer"`.
1699
2444
  */
1700
2445
  declare const ScheduleButton: React__default.FC<ScheduleButtonProps>;
1701
2446
 
@@ -1775,6 +2520,101 @@ interface SkillNodeData extends Record<string, unknown> {
1775
2520
  */
1776
2521
  declare const SkillNode: React__default.FC<NodeProps<Node<SkillNodeData>>>;
1777
2522
 
2523
+ interface DSLNode {
2524
+ id: string;
2525
+ type: "agent" | "map" | "terminal";
2526
+ name: string;
2527
+ description?: string;
2528
+ ref?: string;
2529
+ config?: Record<string, unknown>;
2530
+ input?: {
2531
+ template: string;
2532
+ };
2533
+ output?: {
2534
+ key?: string;
2535
+ schema?: Record<string, unknown>;
2536
+ };
2537
+ source?: string;
2538
+ node?: {
2539
+ type: string;
2540
+ ref: string;
2541
+ input?: {
2542
+ template: string;
2543
+ };
2544
+ };
2545
+ status?: "success" | "failed" | "cancelled";
2546
+ itemKey?: string;
2547
+ ask?: boolean;
2548
+ condition?: string;
2549
+ /** When set, this node belongs to a parallel group. */
2550
+ parentGroup?: string;
2551
+ }
2552
+ interface DSLEdge {
2553
+ from: string;
2554
+ to?: string | string[];
2555
+ }
2556
+ interface ExpandedDSL {
2557
+ version: string;
2558
+ name: string;
2559
+ nodes: DSLNode[];
2560
+ edges: DSLEdge[];
2561
+ }
2562
+
2563
+ interface RunStep {
2564
+ id: string;
2565
+ stepType: string;
2566
+ stepName: string;
2567
+ threadId?: string | null;
2568
+ edgeFrom?: string;
2569
+ edgeTo?: string;
2570
+ edgePurpose?: string;
2571
+ input?: Record<string, unknown>;
2572
+ output?: Record<string, unknown>;
2573
+ status: string;
2574
+ errorMessage?: string;
2575
+ startedAt: string;
2576
+ completedAt?: string;
2577
+ durationMs?: number;
2578
+ }
2579
+ interface WorkflowCanvasProps {
2580
+ dsl: ExpandedDSL;
2581
+ steps?: RunStep[];
2582
+ assistantId?: string;
2583
+ onNodeClick?: (nodeId: string) => void;
2584
+ height?: number | string;
2585
+ }
2586
+ declare const WorkflowCanvas: React__default.FC<WorkflowCanvasProps>;
2587
+
2588
+ interface RunState {
2589
+ status: "running" | "completed" | "failed" | "interrupted" | "skipped";
2590
+ stepType?: string;
2591
+ durationMs?: number;
2592
+ selected?: boolean;
2593
+ }
2594
+ interface WorkflowNodeData extends Record<string, unknown> {
2595
+ nodeType: "agent" | "map" | "terminal";
2596
+ name: string;
2597
+ description?: string;
2598
+ ref?: string;
2599
+ outputKey?: string;
2600
+ nodeSchema?: unknown;
2601
+ config?: Record<string, unknown>;
2602
+ status?: string;
2603
+ source?: string;
2604
+ innerRef?: string;
2605
+ reduceRef?: string;
2606
+ inputTemplate?: string;
2607
+ /** true when node has ask_user_to_clarify middleware (needs+if DSL) */
2608
+ ask?: boolean;
2609
+ /** if condition expression (shown in design view) */
2610
+ condition?: string;
2611
+ runState?: RunState;
2612
+ pending?: boolean;
2613
+ }
2614
+ declare const WorkflowNode: React__default.FC<NodeProps<Node<WorkflowNodeData>>>;
2615
+
2616
+ declare const WorkflowAutomationView: React__default.FC;
2617
+
1778
2618
  interface CreateAssistantModalProps {
1779
2619
  open: boolean;
1780
2620
  onCancel: () => void;
@@ -1782,28 +2622,138 @@ interface CreateAssistantModalProps {
1782
2622
  }
1783
2623
  declare const CreateAssistantModal: React__default.FC<CreateAssistantModalProps>;
1784
2624
 
2625
+ /**
2626
+ * Top-level evaluation panel component.
2627
+ *
2628
+ * Provides a multi-page interface for managing agent evaluation:
2629
+ * - **Dashboard**: Overview of test suites, cases, and recent runs with stats cards.
2630
+ * - **Suites**: List of test suites with options to create, view, and run all.
2631
+ * - **Suite Detail**: View and manage test cases within a single suite.
2632
+ * - **Run Results**: View detailed results of a specific evaluation run.
2633
+ *
2634
+ * Automatically selects the first project when projects load. Uses a
2635
+ * lightweight page-based navigation model (`dashboard -> suites -> suite -> run`).
2636
+ *
2637
+ * @example
2638
+ * ```tsx
2639
+ * import { EvalPanel } from "@axiom-lattice/react-sdk";
2640
+ *
2641
+ * function App() {
2642
+ * return (
2643
+ * <AxiomLatticeProvider config={config}>
2644
+ * <EvalPanel />
2645
+ * </AxiomLatticeProvider>
2646
+ * );
2647
+ * }
2648
+ * ```
2649
+ */
1785
2650
  declare const EvalPanel: React__default.FC;
1786
2651
 
2652
+ /**
2653
+ * Props for {@link EvalSuiteCardList}.
2654
+ */
1787
2655
  interface Props {
2656
+ /** The evaluation project ID to load suites from */
1788
2657
  projectId: string;
2658
+ /** Callback invoked when the user selects a suite card */
1789
2659
  onSelectSuite: (projectId: string, suiteId: string) => void;
1790
2660
  }
2661
+ /**
2662
+ * Displays evaluation test suites as a grid of cards.
2663
+ *
2664
+ * Each card shows the suite name, case count, and a delete action.
2665
+ * Handles loading, empty, and populated states.
2666
+ *
2667
+ * @example
2668
+ * ```tsx
2669
+ * <EvalSuiteCardList
2670
+ * projectId="proj-123"
2671
+ * onSelectSuite={(pid, sid) => navigate(`/suites/${sid}`)}
2672
+ * />
2673
+ * ```
2674
+ */
1791
2675
  declare const EvalSuiteCardList: React__default.FC<Props>;
1792
2676
 
2677
+ /**
2678
+ * Props for {@link EvalSuiteDetail}.
2679
+ */
1793
2680
  interface EvalSuiteDetailProps {
2681
+ /** The evaluation project ID */
1794
2682
  projectId: string;
2683
+ /** The suite ID to display */
1795
2684
  suiteId: string;
2685
+ /** Callback to navigate back to the suite list */
1796
2686
  onBack: () => void;
2687
+ /** Callback invoked when a run is started, receiving the run ID */
1797
2688
  onRun: (runId: string) => void;
1798
2689
  }
2690
+ /**
2691
+ * Detail view for a single evaluation suite.
2692
+ *
2693
+ * Displays a breadcrumb header, a table of test cases with input messages,
2694
+ * agent references, rubric counts, and delete actions. Includes a modal form
2695
+ * for adding new test cases with agent selection, output type, and expected
2696
+ * content assertion.
2697
+ *
2698
+ * @example
2699
+ * ```tsx
2700
+ * <EvalSuiteDetail
2701
+ * projectId="proj-123"
2702
+ * suiteId="suite-456"
2703
+ * onBack={() => setPage("suites")}
2704
+ * onRun={(runId) => setRunId(runId)}
2705
+ * />
2706
+ * ```
2707
+ */
1799
2708
  declare const EvalSuiteDetail: React__default.FC<EvalSuiteDetailProps>;
1800
2709
 
2710
+ /**
2711
+ * Props for {@link EvalRunResults}.
2712
+ */
1801
2713
  interface EvalRunResultsProps {
2714
+ /** The run ID whose results to display */
1802
2715
  runId: string;
2716
+ /** Callback to navigate back to the previous page */
1803
2717
  onBack: () => void;
1804
2718
  }
2719
+ /**
2720
+ * Displays detailed results for a single evaluation run.
2721
+ *
2722
+ * Shows a summary card with total/passed/failed counts, average score,
2723
+ * and pass rate. Renders an expandable table of per-case results including
2724
+ * pass/fail status, suite name, input message, judge summary, dimension
2725
+ * scores with progress bars, and overall score.
2726
+ *
2727
+ * Supports live streaming progress during active runs and a delete action.
2728
+ *
2729
+ * @example
2730
+ * ```tsx
2731
+ * <EvalRunResults
2732
+ * runId="run-789"
2733
+ * onBack={() => setPage("dashboard")}
2734
+ * />
2735
+ * ```
2736
+ */
1805
2737
  declare const EvalRunResults: React__default.FC<EvalRunResultsProps>;
1806
2738
 
2739
+ interface PersonalAssistantPageProps {
2740
+ }
2741
+ declare const PersonalAssistantPage: React__default.FC<PersonalAssistantPageProps>;
2742
+
2743
+ type LatticeAgentWorkspaceProps = AgentChatProps & {
2744
+ workspaceId?: string;
2745
+ projectId?: string;
2746
+ };
2747
+ declare const LatticeAgentWorkspace: React__default.FC<LatticeAgentWorkspaceProps>;
2748
+
2749
+ /**
2750
+ * Toggle button for the file/directory tool panel.
2751
+ *
2752
+ * Must be rendered within a {@link ChatUIContextProvider} (which
2753
+ * {@link LatticeChat} provides automatically).
2754
+ */
2755
+ declare const FilePanelToggle: React__default.FC;
2756
+
1807
2757
  interface SkillCategoryPromptsProps {
1808
2758
  senderRef: React__default.RefObject<any>;
1809
2759
  visible?: boolean;
@@ -2314,4 +3264,4 @@ type IframeMessage = {
2314
3264
  };
2315
3265
  declare function generateIframeSrcdoc(): string;
2316
3266
 
2317
- export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, ChangePasswordModal, type ChangePasswordModalProps, ChannelInstallationsDrawerContent, type ChatResponse, ChatSidebar, type ChatSidebarProps, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, DEFAULT_MENU_ITEMS, DEFAULT_MIDDLEWARE_TYPES, DEFAULT_WORKSPACE_MENU_ITEMS, type ElementMeta, type ElementProps, EvalPanel, EvalRunResults, EvalSuiteCardList, EvalSuiteDetail, type ExplorerFile, FileExplorer, type FileExplorerProps, type IframeMessage, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, type ModelConfig, type ModelInfo, ModelSelector, type ModelSelectorProps, type PanelCard, type PendingMessage, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppBrowserContext, type SideAppBrowserContextValue, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAuthOptional, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useEvalCases, useEvalProjects, useEvalRunStream, useEvalRuns, useEvalSuites, useLatticeChatShellContext, useSideAppBrowser, useSideAppOpener, useTenants, useUsers };
3267
+ export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, ChangePasswordModal, type ChangePasswordModalProps, ChannelInstallationsDrawerContent, type ChatResponse, ChatSidebar, type ChatSidebarProps, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, DEFAULT_MENU_ITEMS, DEFAULT_MIDDLEWARE_TYPES, DEFAULT_WORKSPACE_MENU_ITEMS, type ElementMeta, type ElementProps, EvalPanel, EvalRunResults, EvalSuiteCardList, EvalSuiteDetail, type ExplorerFile, FileExplorer, type FileExplorerProps, FilePanelToggle, type IframeMessage, LatticeAgentWorkspace, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, type ModelConfig, type ModelInfo, ModelSelector, type ModelSelectorProps, type PanelCard, type PendingMessage, PersonalAssistantPage, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppBrowserContext, type SideAppBrowserContextValue, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkflowAutomationView, WorkflowCanvas, type WorkflowCanvasProps, WorkflowNode, type WorkflowNodeData, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAuthOptional, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useEvalCases, useEvalProjects, useEvalRunStream, useEvalRuns, useEvalSuites, useLatticeChatShellContext, useSideAppBrowser, useSideAppOpener, useTenants, useUsers };