@axiom-lattice/react-sdk 2.1.84 → 2.1.86

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
 
@@ -619,6 +744,30 @@ interface AuthContextValue {
619
744
  clearError: () => void;
620
745
  changePassword: (currentPassword: string, newPassword: string) => Promise<void>;
621
746
  }
747
+ /**
748
+ * Hook to access authentication context. Must be used within an {@link AuthProvider}.
749
+ *
750
+ * @description
751
+ * Provides the full auth state and all auth operations (login, register, logout, tenant selection, etc.).
752
+ * Throws an error if no {@link AuthProvider} is found in the component tree. For optional auth,
753
+ * use {@link useAuthOptional} instead.
754
+ *
755
+ * @returns The current {@link AuthContextValue} containing user, tenants, auth state, and auth actions.
756
+ *
757
+ * @throws {Error} If used outside of an {@link AuthProvider}.
758
+ *
759
+ * @example
760
+ * ```tsx
761
+ * const { user, isAuthenticated, login, logout } = useAuth();
762
+ *
763
+ * const handleLogin = async () => {
764
+ * const result = await login('user@example.com', 'password');
765
+ * if (result.requiresTenantSelection) {
766
+ * // Show tenant picker
767
+ * }
768
+ * };
769
+ * ```
770
+ */
622
771
  declare const useAuth: () => AuthContextValue;
623
772
  /**
624
773
  * Optional version of useAuth that returns null instead of throwing when AuthProvider is not present.
@@ -632,13 +781,54 @@ declare const useAuth: () => AuthContextValue;
632
781
  * const user = useAuthOptional()?.user;
633
782
  */
634
783
  declare const useAuthOptional: () => AuthContextValue | null;
784
+ /**
785
+ * Props for {@link AuthProvider}.
786
+ */
635
787
  interface AuthProviderProps {
788
+ /** Child components that will have access to the auth context. */
636
789
  children: ReactNode;
790
+ /** Base URL of the gateway API (e.g., `http://localhost:3000`). */
637
791
  baseURL: string;
792
+ /** Called after a successful login with the user and their tenant memberships. */
638
793
  onLoginSuccess?: (user: User, tenants: UserTenantInfo[]) => void;
794
+ /** Called after a tenant is successfully selected, passing the selected tenant. */
639
795
  onTenantSelected?: (tenant: Tenant) => void;
796
+ /** Called after the user logs out. */
640
797
  onLogout?: () => void;
641
798
  }
799
+ /**
800
+ * Authentication context provider. Wraps the application to provide auth state and operations
801
+ * to all descendant components via {@link useAuth} and {@link useAuthOptional}.
802
+ *
803
+ * @description
804
+ * Manages the full authentication lifecycle including:
805
+ * - **Login / Register**: Sends credentials to the gateway API and stores the returned user, tenants, and token in `sessionStorage`.
806
+ * - **Session restoration**: On mount, reads previously stored user data from `sessionStorage` and also refreshes the tenant list to catch any admin-side role assignments.
807
+ * - **Tenant selection**: Calls the gateway API to select a tenant and stores the tenant data.
808
+ * - **Logout**: Clears all auth state and `sessionStorage`.
809
+ * - **Change password**: Proxies to the gateway password change endpoint.
810
+ * - **Token expiration**: Automatically logs out when the gateway returns a 401 with an expired token message.
811
+ *
812
+ * @param props - {@link AuthProviderProps}
813
+ * @param props.children - React children to render within the auth context.
814
+ * @param props.baseURL - Base URL of the gateway API.
815
+ * @param props.onLoginSuccess - Optional callback invoked after a successful login.
816
+ * @param props.onTenantSelected - Optional callback invoked after tenant selection.
817
+ * @param props.onLogout - Optional callback invoked on logout.
818
+ *
819
+ * @returns A React context provider wrapping children with {@link AuthContext.Provider}.
820
+ *
821
+ * @example
822
+ * ```tsx
823
+ * <AuthProvider
824
+ * baseURL="http://localhost:3000"
825
+ * onLoginSuccess={(user) => console.log('Logged in:', user.email)}
826
+ * onLogout={() => window.location.reload()}
827
+ * >
828
+ * <App />
829
+ * </AuthProvider>
830
+ * ```
831
+ */
642
832
  declare const AuthProvider: React__default.FC<AuthProviderProps>;
643
833
 
644
834
  /**
@@ -733,6 +923,22 @@ interface UseTenantsReturn {
733
923
  refresh: () => Promise<void>;
734
924
  getTenantById: (id: string) => Tenant | undefined;
735
925
  }
926
+ /**
927
+ * Fetches and manages a list of tenants from the API.
928
+ *
929
+ * @param options - Configuration options
930
+ * @param options.baseURL - The base URL of the API gateway
931
+ * @param options.token - Optional authentication token
932
+ * @returns Tenant list, loading state, error, refresh function, and lookup helper
933
+ *
934
+ * @example
935
+ * ```tsx
936
+ * const { tenants, isLoading, error, refresh, getTenantById } = useTenants({
937
+ * baseURL: "https://api.example.com",
938
+ * token: "your-auth-token",
939
+ * });
940
+ * ```
941
+ */
736
942
  declare function useTenants(options: UseTenantsOptions): UseTenantsReturn;
737
943
  interface UseUsersOptions {
738
944
  baseURL: string;
@@ -746,78 +952,246 @@ interface UseUsersReturn {
746
952
  refresh: () => Promise<void>;
747
953
  searchByEmail: (email: string) => Promise<_axiom_lattice_protocols.User | null>;
748
954
  }
955
+ /**
956
+ * Fetches and manages a list of users within a tenant.
957
+ *
958
+ * @param options - Configuration options
959
+ * @param options.baseURL - The base URL of the API gateway
960
+ * @param options.tenantId - The tenant ID to fetch users for
961
+ * @param options.token - Optional authentication token
962
+ * @returns User list, loading state, error, refresh function, and email search helper
963
+ *
964
+ * @example
965
+ * ```tsx
966
+ * const { users, isLoading, error, searchByEmail } = useUsers({
967
+ * baseURL: "https://api.example.com",
968
+ * tenantId: "tenant-123",
969
+ * });
970
+ *
971
+ * const user = await searchByEmail("user@example.com");
972
+ * ```
973
+ */
749
974
  declare function useUsers(options: UseUsersOptions): UseUsersReturn;
750
975
 
976
+ /**
977
+ * Props for the {@link Chating} component — the core chat interface.
978
+ *
979
+ * Controls appearance, sender behavior, empty-state customization, and
980
+ * optional context injection for the agent.
981
+ */
751
982
  interface ChatingProps {
983
+ /** Agent display name shown in the header. */
752
984
  name?: string;
985
+ /** Agent description shown in the header. */
753
986
  description?: string;
987
+ /** Fallback message used when the user submits only attachments without text. */
754
988
  default_submit_message?: string;
989
+ /** Avatar URL or component for the agent. */
755
990
  avatar?: string;
991
+ /** Placeholder content rendered inside the attachment upload area. */
756
992
  attachment_placeholder?: React__default.ReactNode;
993
+ /** Custom upload endpoint URL. Defaults to the workspace or thread sandbox upload endpoint. */
757
994
  uploadAction?: string;
995
+ /** Quick prompt items displayed between messages. */
758
996
  senderPromptsItems?: GetProp<typeof Prompts, "items">;
997
+ /** Extra content rendered in the header area. */
759
998
  extra?: React__default.ReactNode;
999
+ /** Additional metadata items for the header. */
760
1000
  extraMeta?: Array<{
761
1001
  id: string;
762
1002
  }>;
1003
+ /** Whether to show the agent header bar. Default: true. */
763
1004
  showHeader?: boolean;
1005
+ /** Whether to show the message sender input. Default: true. */
764
1006
  showSender?: boolean;
1007
+ /** Whether to show the Human-in-the-Loop (HITL) container. Default: true. */
765
1008
  showHITL?: boolean;
1009
+ /** Whether to show a refresh button in the header. */
766
1010
  showRefreshButton?: boolean;
767
1011
  /**
768
- * Whether to show the model selector in the sender footer
769
- * When provided, overrides the shell config's enableModelSelector
1012
+ * Whether to show the model selector in the sender footer.
1013
+ * When provided, overrides the shell config's enableModelSelector.
770
1014
  */
771
1015
  showModelSelector?: boolean;
772
- /** Show database picker in sender footer. Overrides shell config enableDatabaseSlot */
1016
+ /** Show database picker in sender footer. Overrides shell config enableDatabaseSlot. */
773
1017
  showDatabaseSlot?: boolean;
774
- /** Show skill picker in sender footer. Overrides shell config enableSkillSlot */
1018
+ /** Show skill picker in sender footer. Overrides shell config enableSkillSlot. */
775
1019
  showSkillSlot?: boolean;
776
- /** Show agent picker in sender footer. Overrides shell config enableAgentSlot */
1020
+ /** Show agent picker in sender footer. Overrides shell config enableAgentSlot. */
777
1021
  showAgentSlot?: boolean;
778
- /** Show metrics data source picker in sender footer. Overrides shell config enableMetricsDataSourceSlot */
1022
+ /** Show metrics data source picker in sender footer. Overrides shell config enableMetricsDataSourceSlot. */
779
1023
  showMetricsDataSourceSlot?: boolean;
1024
+ /** Whether to show the greeting empty state when no messages exist. Default: true. */
780
1025
  showEmptyState?: boolean;
1026
+ /** Custom greeting element displayed in the empty state. */
781
1027
  emptyStateGreeting?: React__default.ReactNode;
1028
+ /** Question text shown in the empty state. */
782
1029
  emptyStateQuestion?: string;
1030
+ /** Welcome prefix text (e.g., "Hey"). */
783
1031
  welcomePrefix?: string;
784
- /** Context string injected before the first user message (e.g. workflow context) */
1032
+ /** Context string injected before the first user message (e.g. workflow context). */
785
1033
  systemContext?: string;
786
- /** Auto-send this message when agent becomes idle (thread ready, not loading) */
1034
+ /** Auto-send this message when agent becomes idle (thread ready, not loading). */
787
1035
  initialMessage?: string | null;
788
- /** Called after initialMessage has been sent */
1036
+ /** Called after initialMessage has been sent. */
789
1037
  onInitialMessageSent?: () => void;
790
1038
  }
1039
+ /**
1040
+ * Core chat interface component — manages sender input, message display,
1041
+ * and agent-streaming state for a single assistant thread.
1042
+ *
1043
+ * Features:
1044
+ * - Empty state with greeting and skill/analysis prompt categories
1045
+ * - Message sender with file attachment, skill/agent/database pickers, and model selector
1046
+ * - Typing cursor animation during streaming
1047
+ * - HITL interrupt handling and pending-message display
1048
+ * - Auto-send of {@link ChatingProps.systemContext} and {@link ChatingProps.initialMessage}
1049
+ * - Transition animations between empty and active states
1050
+ *
1051
+ * @param props - See {@link ChatingProps}.
1052
+ * @returns The full chat UI for the active thread.
1053
+ *
1054
+ * @example
1055
+ * ```tsx
1056
+ * import { Chating } from "@axiom-lattice/react-sdk";
1057
+ *
1058
+ * <Chating
1059
+ * name="Data Analyst"
1060
+ * showHeader
1061
+ * showSender
1062
+ * showModelSelector
1063
+ * emptyStateQuestion="What data would you like to analyze?"
1064
+ * systemContext="You are analyzing sales data from Q4 2024."
1065
+ * />
1066
+ * ```
1067
+ *
1068
+ * @remarks
1069
+ * - Requires the following ancestor context providers: {@link AgentThreadProvider},
1070
+ * {@link ChatUIContextProvider}, {@link LatticeChatShellContextProvider},
1071
+ * {@link ConversationContextProvider}, {@link AssistantContextProvider}.
1072
+ * - Prop-level feature toggles (e.g. `showModelSelector`) take priority over
1073
+ * shell-config-level toggles.
1074
+ * - Uses {@link useAgentChat} for all agent communication.
1075
+ */
791
1076
  declare const Chating: React__default.FC<ChatingProps>;
792
1077
 
1078
+ /**
1079
+ * Props for the {@link LatticeChat} component.
1080
+ *
1081
+ * Extends {@link ChatingProps} with thread/assistant identification
1082
+ * and optional menu/header slots.
1083
+ */
793
1084
  type AgentChatProps = {
1085
+ /** The ID of the currently active thread. If absent, a placeholder is shown prompting users to create a conversation. */
794
1086
  thread_id?: string;
1087
+ /** The assistant ID that backs the chat. Required — feeds the {@link AgentThreadProvider}. */
795
1088
  assistant_id: string;
1089
+ /** Optional menu rendered in the left sidebar column. */
796
1090
  menu?: React__default.ReactNode;
1091
+ /** Optional header rendered above the main chat area. */
797
1092
  header?: React__default.ReactNode;
798
1093
  } & ChatingProps;
1094
+ /**
1095
+ * Top-level chat component for a single assistant thread.
1096
+ *
1097
+ * Wraps the chat UI in:
1098
+ * - {@link AgentThreadProvider} for thread state
1099
+ * - {@link ChatUIContextProvider} for UI panel toggles
1100
+ * - A responsive {@link ColumnLayout} with menu, main chat, detail panel, and tools panel
1101
+ *
1102
+ * When `thread_id` is empty, a prompt to create a conversation is displayed.
1103
+ *
1104
+ * @example
1105
+ * ```tsx
1106
+ * import { LatticeChat } from "@axiom-lattice/react-sdk";
1107
+ *
1108
+ * <LatticeChat
1109
+ * assistant_id="asst_abc123"
1110
+ * thread_id="thread_xyz"
1111
+ * showHeader
1112
+ * showSender
1113
+ * />
1114
+ * ```
1115
+ *
1116
+ * @remarks
1117
+ * - Requires a parent `<LatticeChatShell>` for shell-level configuration (API URL, feature toggles).
1118
+ * - The `ChatingProps` are forwarded to the internal {@link Chating} component.
1119
+ */
799
1120
  declare const LatticeChat: React__default.FC<AgentChatProps>;
800
1121
 
1122
+ /**
1123
+ * Model runtime configuration passed to the agent when a model is selected.
1124
+ */
801
1125
  interface ModelConfig {
1126
+ /** The model key as registered on the server (e.g., "gpt-4o"). */
802
1127
  modelKey: string;
1128
+ /** Sampling temperature (0-2). Higher values produce more random output. */
803
1129
  temperature?: number;
1130
+ /** Maximum tokens in the generated response. */
804
1131
  maxTokens?: number;
1132
+ /** Nucleus sampling parameter (0-1). */
805
1133
  topP?: number;
1134
+ /** Penalty for repeating tokens (-2 to 2). */
806
1135
  frequencyPenalty?: number;
1136
+ /** Penalty for introducing new topics (-2 to 2). */
807
1137
  presencePenalty?: number;
808
1138
  }
1139
+ /**
1140
+ * Model metadata returned by the `/api/models` endpoint.
1141
+ */
809
1142
  interface ModelInfo {
1143
+ /** Unique model key (used as the selection value). */
810
1144
  key: string;
1145
+ /** Provider identifier (e.g., "openai", "azure"). */
811
1146
  provider: string;
1147
+ /** Model name as known by the provider (e.g., "gpt-4o"). */
812
1148
  model: string;
1149
+ /** Human-readable display name for the dropdown. */
813
1150
  displayName?: string;
814
1151
  }
1152
+ /**
1153
+ * Props for the {@link ModelSelector} component.
1154
+ */
815
1155
  interface ModelSelectorProps {
1156
+ /** Currently selected model configuration (controlled). */
816
1157
  value?: ModelConfig | null;
1158
+ /** Called when the user selects a model. */
817
1159
  onChange?: (config: ModelConfig | null) => void;
1160
+ /** Default model key used when the fetch response includes a matching model. */
818
1161
  defaultModelKey?: string;
1162
+ /** Inline styles applied to the Select element. */
819
1163
  style?: React__default.CSSProperties;
820
1164
  }
1165
+ /**
1166
+ * A borderless Ant Design `Select` dropdown for choosing the LLM model.
1167
+ *
1168
+ * Fetches available models from `/api/models` on first render and caches the result.
1169
+ * When a default model key matches a model in the list, it is auto-selected.
1170
+ * The selection is reported via the {@link ModelSelectorProps.onChange} callback,
1171
+ * which typically feeds into `updateCustomRunConfig` in the {@link Chating} component.
1172
+ *
1173
+ * @param value - Currently selected model config (controlled).
1174
+ * @param onChange - Callback when the selection changes.
1175
+ * @param defaultModelKey - Model key to auto-select if found in the model list.
1176
+ * @param style - Inline styles for the Select wrapper.
1177
+ * @returns A compact model selector with hover-highlight background.
1178
+ *
1179
+ * @example
1180
+ * ```tsx
1181
+ * import { ModelSelector } from "@axiom-lattice/react-sdk";
1182
+ *
1183
+ * <ModelSelector
1184
+ * value={modelConfig}
1185
+ * onChange={(config) => updateCustomRunConfig({ modelConfig: config })}
1186
+ * defaultModelKey="gpt-4o"
1187
+ * />
1188
+ * ```
1189
+ *
1190
+ * @remarks
1191
+ * - Supports both controlled (`value` prop) and uncontrolled (internal state) usage.
1192
+ * - Fetch is performed only once per component mount via a ref guard.
1193
+ * - The dropdown is intentionally borderless to blend into the sender footer.
1194
+ */
821
1195
  declare const ModelSelector: React__default.FC<ModelSelectorProps>;
822
1196
 
823
1197
  declare const MDResponse: React__default.MemoExoticComponent<({ content, context, embeddedLink, interactive, userData, noGenUI, }: {
@@ -832,33 +1206,95 @@ declare const MDViewFormItem: ({ value }: {
832
1206
  value?: string;
833
1207
  }) => react_jsx_runtime.JSX.Element;
834
1208
 
1209
+ /**
1210
+ * Props passed to every GenUI element component.
1211
+ *
1212
+ * Each element registered in the GenUI element registry receives these props,
1213
+ * with the `data` field carrying the element-specific payload from the agent.
1214
+ *
1215
+ * @typeParam T - The shape of the element-specific data payload
1216
+ */
835
1217
  type ElementProps<T = any> = {
1218
+ /** Key identifying which GenUI element component to render */
836
1219
  component_key: string;
1220
+ /** Optional context for the current conversation */
837
1221
  context?: {
1222
+ /** The thread ID associated with this element */
838
1223
  thread_id?: string;
1224
+ /** The assistant ID associated with this element */
839
1225
  assistant_id?: string;
840
1226
  };
1227
+ /** Element-specific data payload from the agent */
841
1228
  data: T;
1229
+ /** Whether the element supports user interaction (defaults to false) */
842
1230
  interactive?: boolean;
1231
+ /** Whether to open this element in the side app panel by default */
843
1232
  default_open_in_side_app?: boolean;
844
1233
  };
1234
+ /**
1235
+ * Metadata for a registered GenUI element.
1236
+ *
1237
+ * Defines how an element is rendered and optionally what action to perform
1238
+ * when the user interacts with it.
1239
+ */
845
1240
  interface ElementMeta {
1241
+ /** The main card-view React component for this element */
846
1242
  card_view: React.FC<ElementProps>;
1243
+ /** Optional side-app panel React component for expanded viewing */
847
1244
  side_app_view?: React.FC<ElementProps>;
1245
+ /** Optional action callback invoked when the user interacts with the element */
848
1246
  action?: (data: any) => void;
849
1247
  }
1248
+ /**
1249
+ * Data structure representing a tool call made by the agent.
1250
+ *
1251
+ * Rendered by GenUI tool card elements to display tool invocations,
1252
+ * their arguments, and their results.
1253
+ */
850
1254
  interface ToolCallData {
1255
+ /** Unique identifier for this tool call */
851
1256
  id: string;
1257
+ /** Name of the tool being called */
852
1258
  name: string;
1259
+ /** Arguments passed to the tool */
853
1260
  args: Record<string, any>;
1261
+ /** Distinguishes tool calls from other message types */
854
1262
  type: "tool_call";
1263
+ /** The tool's response, if available */
855
1264
  response?: string;
1265
+ /** Execution status of the tool call */
856
1266
  status?: "success" | "pending" | "error";
857
1267
  }
858
1268
 
859
1269
  declare const getElement: (language: string | undefined) => ElementMeta | null;
860
1270
  declare const regsiterElement: (language: string, ElementMeta: ElementMeta) => ElementMeta;
861
1271
 
1272
+ /**
1273
+ * Tabbed side-app browser that renders GenUI components in the right panel.
1274
+ *
1275
+ * Manages a tab strip of registered side-app views. When a new component is
1276
+ * selected via {@link SideAppBrowserContext}, a tab is added (or activated if
1277
+ * it already exists). Tabs are closable and switchable. An "all tabs" dropdown
1278
+ * appears when there are 2+ tabs. Uses {@link ChatUIContext} to read/write the
1279
+ * active side-app card and open/close the panel.
1280
+ *
1281
+ * @param region - Which panel region this browser is attached to.
1282
+ * `"side"` for the right detail panel (default), `"content"` for the main content area.
1283
+ * @returns The tabbed side-app viewer, or an empty state if no tabs are open.
1284
+ *
1285
+ * @example
1286
+ * ```tsx
1287
+ * import { SideAppViewBrowser } from "@axiom-lattice/react-sdk";
1288
+ *
1289
+ * <SideAppViewBrowser region="side" />
1290
+ * ```
1291
+ *
1292
+ * @remarks
1293
+ * - Internally renders {@link SideAppBrowserContext.Provider} so that child
1294
+ * components can programmatically open new side-apps via `openApp()`.
1295
+ * - Component resolution uses {@link getElement} from the GenUI element registry.
1296
+ * - Designed to work with {@link ColumnLayout} as the `detail` panel.
1297
+ */
862
1298
  declare const SideAppViewBrowser: React__default.FC<{
863
1299
  region?: "side" | "content";
864
1300
  }>;
@@ -909,9 +1345,54 @@ declare const ChatUIContext: React__default.Context<{
909
1345
  contentAppSelectedCard: PanelCard | null;
910
1346
  setContentAppSelectedCard: (card: PanelCard | null) => void;
911
1347
  }>;
1348
+ /**
1349
+ * Chat UI context provider. Manages visibility and selected cards for chat panel areas
1350
+ * (detail, tools, side app, content app) and the sidebar menu collapsed state.
1351
+ *
1352
+ * @description
1353
+ * Tracks the open/closed state and the currently selected {@link PanelCard} for each panel:
1354
+ * - **Detail panel**: A slide-out detail view that displays a chosen card's content.
1355
+ * - **Tools panel**: A tools sidebar/drawer for tool-specific cards.
1356
+ * - **Side app**: Aliases to the detail panel (shared state).
1357
+ * - **Content app**: An inline content area for embedded app cards.
1358
+ * - **Menu collapsed**: Whether the sidebar navigation menu is collapsed.
1359
+ *
1360
+ * Provides action helpers (`openDetail`, `closeDetail`, `openTools`, `toggleTools`, etc.)
1361
+ * that set both visibility and selected card atomically.
1362
+ *
1363
+ * @param props - Provider props.
1364
+ * @param props.children - React children to render within the UI context.
1365
+ *
1366
+ * @returns A React context provider wrapping children with {@link ChatUIContext.Provider}.
1367
+ *
1368
+ * @example
1369
+ * ```tsx
1370
+ * <ChatUIContextProvider>
1371
+ * <ChatLayout />
1372
+ * </ChatUIContextProvider>
1373
+ * ```
1374
+ */
912
1375
  declare const ChatUIContextProvider: ({ children, }: {
913
1376
  children: React__default.ReactNode;
914
1377
  }) => react_jsx_runtime.JSX.Element;
1378
+ /**
1379
+ * Hook to access the chat UI context. Must be used within a {@link ChatUIContextProvider}.
1380
+ *
1381
+ * @description
1382
+ * Returns panel visibility state, selected panel cards, and action functions for controlling
1383
+ * the chat interface panels (detail, tools, side app, content app) and menu collapsed state.
1384
+ *
1385
+ * @returns The current chat UI context value containing panel state and control functions.
1386
+ *
1387
+ * @example
1388
+ * ```tsx
1389
+ * const { detailVisible, openDetail, closeDetail, toggleTools, menuCollapsed } = useChatUIContext();
1390
+ *
1391
+ * const handleCardClick = (card: PanelCard) => {
1392
+ * openDetail(card);
1393
+ * };
1394
+ * ```
1395
+ */
915
1396
  declare const useChatUIContext: () => {
916
1397
  detailVisible: boolean;
917
1398
  setDetailVisible: (visible: boolean) => void;
@@ -1052,8 +1533,33 @@ interface ConversationContextProviderProps {
1052
1533
  */
1053
1534
  declare function generateLabelFromMessage(message: string): string;
1054
1535
  /**
1055
- * Provider component for ConversationContext
1056
- * Manages conversation thread state for assistants
1536
+ * Provider component for ConversationContext.
1537
+ * Manages conversation thread state for the currently selected assistant.
1538
+ *
1539
+ * @description
1540
+ * Coordinates with {@link AssistantContext} to load threads for the current assistant.
1541
+ * Key behaviors:
1542
+ * - **Thread loading**: Fetches threads from the API when the assistant changes. If no threads
1543
+ * exist, a new thread is automatically created.
1544
+ * - **Auto-selection**: Selects the most recently updated thread as the active thread when loading.
1545
+ * - **Cross-thread config**: Maintains an assistant-level `customRunConfig` shared across all threads
1546
+ * (useful for metrics datasource and other assistant-wide settings).
1547
+ * - **Thread operations**: Provides full CRUD operations (create, update, delete, list, select)
1548
+ * backed by the client SDK.
1549
+ *
1550
+ * Requires {@link AssistantContextProvider} ancestor and {@link LatticeChatShellContextProvider}.
1551
+ *
1552
+ * @param props - {@link ConversationContextProviderProps}
1553
+ * @param props.children - React children to render within the conversation context.
1554
+ *
1555
+ * @returns A React context provider wrapping children with {@link ConversationContext.Provider}.
1556
+ *
1557
+ * @example
1558
+ * ```tsx
1559
+ * <ConversationContextProvider>
1560
+ * <ThreadList />
1561
+ * </ConversationContextProvider>
1562
+ * ```
1057
1563
  */
1058
1564
  declare const ConversationContextProvider: ({ children, }: ConversationContextProviderProps) => react_jsx_runtime.JSX.Element;
1059
1565
  /**
@@ -1143,8 +1649,34 @@ interface AssistantContextProviderProps {
1143
1649
  initialAssistantId?: string | null;
1144
1650
  }
1145
1651
  /**
1146
- * Provider component for AssistantContext
1147
- * Manages assistant state and operations
1652
+ * Provider component for AssistantContext.
1653
+ * Manages assistant state and operations including CRUD, selection, and auto-loading.
1654
+ *
1655
+ * @description
1656
+ * Coordinates with the client SDK to provide assistant management:
1657
+ * - **Auto-load**: When `autoLoad` is `true` (default), fetches the assistant list on mount.
1658
+ * - **Auto-selection**: If `initialAssistantId` is provided, selects that assistant after loading.
1659
+ * Otherwise, auto-selects the first available assistant.
1660
+ * - **Re-selection**: If the currently selected assistant is removed from the list (e.g., deleted),
1661
+ * falls back to selecting the first available assistant.
1662
+ * - **CRUD operations**: Provides `createAssistant`, `updateAssistant`, `deleteAssistant`, and
1663
+ * `getAssistant` backed by the SDK, keeping local state in sync.
1664
+ *
1665
+ * Requires an {@link AxiomLatticeProvider} ancestor for the API client.
1666
+ *
1667
+ * @param props - {@link AssistantContextProviderProps}
1668
+ * @param props.children - React children to render within the assistant context.
1669
+ * @param props.autoLoad - Whether to automatically load assistants on mount. Defaults to `true`.
1670
+ * @param props.initialAssistantId - Optional assistant ID to auto-select on load.
1671
+ *
1672
+ * @returns A React context provider wrapping children with {@link AssistantContext.Provider}.
1673
+ *
1674
+ * @example
1675
+ * ```tsx
1676
+ * <AssistantContextProvider initialAssistantId="asst_123">
1677
+ * <AssistantSelector />
1678
+ * </AssistantContextProvider>
1679
+ * ```
1148
1680
  */
1149
1681
  declare const AssistantContextProvider: ({ children, autoLoad, initialAssistantId, }: AssistantContextProviderProps) => react_jsx_runtime.JSX.Element;
1150
1682
  /**
@@ -1550,33 +2082,107 @@ declare const LatticeChatShellContextProvider: ({ children, initialConfig, persi
1550
2082
  */
1551
2083
  declare const useLatticeChatShellContext: () => LatticeChatShellContextValue;
1552
2084
 
2085
+ /**
2086
+ * Represents a single message in the chat UI.
2087
+ *
2088
+ * Used by the chat components to render messages, display thinking states,
2089
+ * and handle tool call results. Can also contain nested child messages
2090
+ * via the {@link items} property for grouped interactions.
2091
+ */
1553
2092
  interface UIMessage {
2093
+ /** Unique identifier for the message */
1554
2094
  id: string;
2095
+ /** The run ID associated with this message, if part of an agent run */
1555
2096
  run_id?: string;
2097
+ /** The text content of this message */
1556
2098
  content: string;
2099
+ /** Display name of the sender (e.g. agent name) */
1557
2100
  name?: string;
2101
+ /** Files attached to this message */
1558
2102
  files?: AttachFile[];
2103
+ /** The role of the message sender */
1559
2104
  role: "human" | "ai" | "tool";
2105
+ /** Nested child messages, used for tool call results or sub-tasks */
1560
2106
  items?: UIMessage[];
2107
+ /** The type determines how the message is rendered in the chat UI */
1561
2108
  type: "message" | "action" | "message_chunk" | "start_thinking" | "thinking_chunk" | "end_thinking";
2109
+ /** Parent message ID for nested/threaded messages */
1562
2110
  parent_id?: number | string;
2111
+ /** Current status of the message (e.g. "complete", "streaming") */
1563
2112
  status?: string;
2113
+ /** ID of the associated thinking block, if this is a thinking message */
1564
2114
  think_id?: string;
2115
+ /** Type of thinking block (e.g. "reasoning") */
1565
2116
  think_type?: string;
1566
2117
  }
2118
+ /**
2119
+ * Represents a file attachment in a chat message.
2120
+ */
1567
2121
  interface AttachFile {
2122
+ /** Display name of the attached file */
1568
2123
  name: string;
2124
+ /** Unique identifier for the attached file */
1569
2125
  id: string;
1570
2126
  }
1571
2127
 
2128
+ /**
2129
+ * Props for the {@link ColumnLayout} component.
2130
+ *
2131
+ * Defines the five content slots: menu sidebar, main chat, detail panel,
2132
+ * tools panel, logo, and header.
2133
+ */
1572
2134
  interface ColumnLayoutProps {
2135
+ /** Left sidebar menu content. Hidden when collapsed. */
1573
2136
  menu?: React__default.ReactNode;
2137
+ /** Primary content area (e.g., the chat thread). Required. */
1574
2138
  main: React__default.ReactNode;
2139
+ /** Right detail panel content (e.g., side-app viewer). */
1575
2140
  detail?: React__default.ReactNode;
2141
+ /** Right tools panel content (e.g., file browser). */
1576
2142
  tools?: React__default.ReactNode;
2143
+ /** Logo or branding rendered at the top of the menu sidebar. */
1577
2144
  logo?: React__default.ReactNode;
2145
+ /** Header bar rendered above the main content area on desktop and mobile. */
1578
2146
  header?: React__default.ReactNode;
1579
2147
  }
2148
+ /**
2149
+ * Responsive three-column (plus tools) layout for the chat interface.
2150
+ *
2151
+ * Consists of:
2152
+ * - **Menu** — collapsible left sidebar, auto-collapses on mobile or when
2153
+ * the detail panel is open.
2154
+ * - **Main content** — central chat area.
2155
+ * - **Detail panel** — right side panel for side-app views (sizable).
2156
+ * - **Tools panel** — right panel for file browsing and workspace tools.
2157
+ *
2158
+ * Panel visibility and sizing is driven by {@link useChatUIContext}. On mobile,
2159
+ * a hamburger toggle is rendered in the header to expand/collapse the menu.
2160
+ *
2161
+ * @param menu - Left sidebar menu content.
2162
+ * @param main - Primary content area (required).
2163
+ * @param detail - Right detail panel content.
2164
+ * @param tools - Right tools panel content.
2165
+ * @param logo - Logo rendered in the menu sidebar.
2166
+ * @param header - Header bar content.
2167
+ * @returns The responsive column layout element.
2168
+ *
2169
+ * @example
2170
+ * ```tsx
2171
+ * import { ColumnLayout } from "@axiom-lattice/react-sdk";
2172
+ *
2173
+ * <ColumnLayout
2174
+ * menu={<ChatSidebar />}
2175
+ * main={<Chating />}
2176
+ * detail={<SideAppViewBrowser />}
2177
+ * tools={<ToolPanelFiles />}
2178
+ * header={<AgentHeader />}
2179
+ * />
2180
+ * ```
2181
+ *
2182
+ * @remarks
2183
+ * - Must be rendered inside a {@link ChatUIContextProvider}.
2184
+ * - CSS class `fina_chat` is applied to the root div for external targeting.
2185
+ */
1580
2186
  declare const ColumnLayout: React__default.FC<ColumnLayoutProps>;
1581
2187
 
1582
2188
  interface ExplorerFile {
@@ -1594,18 +2200,47 @@ interface FileExplorerProps {
1594
2200
  }
1595
2201
  declare const FileExplorer: React__default.FC<ElementProps>;
1596
2202
 
2203
+ /**
2204
+ * Props for the {@link AgentConversations} component.
2205
+ */
1597
2206
  interface AgentConversationsProps {
1598
2207
  /**
1599
- * Whether users can create new threads from the UI
1600
- * Defaults to true
2208
+ * Whether users can create new threads from the UI.
2209
+ * Defaults to true.
1601
2210
  */
1602
2211
  enableThreadCreation?: boolean;
1603
2212
  /**
1604
- * Whether the thread list should be rendered
1605
- * Defaults to true
2213
+ * Whether the thread list should be rendered.
2214
+ * Defaults to true.
1606
2215
  */
1607
2216
  enableThreadList?: boolean;
1608
2217
  }
2218
+ /**
2219
+ * Thread list sidebar component showing conversation history for the current agent.
2220
+ *
2221
+ * Uses Ant Design X `Conversations` component to display threads fetched from
2222
+ * {@link useConversationContext}. Supports creating new threads when
2223
+ * `enableThreadCreation` is true.
2224
+ *
2225
+ * @param enableThreadCreation - Whether the "New Chat" button is shown. Default: true.
2226
+ * @param enableThreadList - Whether the thread list is rendered at all. Default: true.
2227
+ * @returns The conversations list or `null` if thread list is disabled.
2228
+ *
2229
+ * @example
2230
+ * ```tsx
2231
+ * import { AgentConversations } from "@axiom-lattice/react-sdk";
2232
+ *
2233
+ * <AgentConversations
2234
+ * enableThreadCreation={false}
2235
+ * enableThreadList
2236
+ * />
2237
+ * ```
2238
+ *
2239
+ * @remarks
2240
+ * - Requires ancestor context providers: {@link ConversationContextProvider} and
2241
+ * {@link AssistantContextProvider}.
2242
+ * - Returns `null` when `enableThreadList` is false.
2243
+ */
1609
2244
  declare const AgentConversations: React__default.FC<AgentConversationsProps>;
1610
2245
 
1611
2246
  declare const MetricsConfigDrawerContent: React__default.FC;
@@ -1637,6 +2272,12 @@ interface WorkspaceResourceManagerProps {
1637
2272
  declare const WorkspaceResourceManager: React__default.FC<WorkspaceResourceManagerProps>;
1638
2273
  declare const WorkspaceResourceUIContext: React__default.FC<WorkspaceResourceManagerProps>;
1639
2274
 
2275
+ /**
2276
+ * Props for the {@link LatticeChatShell} component.
2277
+ *
2278
+ * Extends {@link LatticeChatShellContextProviderProps} (minus `children`) with
2279
+ * feature toggles that control chat UI surface capabilities.
2280
+ */
1640
2281
  type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "children"> & {
1641
2282
  /**
1642
2283
  * Whether users can create new assistants (default: true)
@@ -1656,14 +2297,46 @@ type LatticeChatShellProps = Omit<LatticeChatShellContextProviderProps, "childre
1656
2297
  enableModelSelector?: boolean;
1657
2298
  };
1658
2299
  /**
1659
- * Lattice Chat Shell component
1660
- * Provides a complete chat interface with conversation management
1661
- * Uses LatticeChatShellContext for configuration (baseURL, etc.)
2300
+ * Lattice Chat Shell — the top-level provider component for the full chat interface.
2301
+ *
2302
+ * Sets up the required context hierarchy:
2303
+ * - {@link LatticeChatShellContextProvider} — config layer (baseURL, feature toggles)
2304
+ * - Optionally {@link WorkspaceContextProvider} when `enableWorkspace` is true
2305
+ * - {@link AssistantContextProvider} — assistant loading
2306
+ * - {@link ConversationContextProvider} — thread management
2307
+ * - {@link AgentServerSetting} — server configuration modal
2308
+ *
2309
+ * Children render {@link LatticeChatView} which contains the chat sidebar and
2310
+ * the {@link LatticeChat} thread interface.
2311
+ *
2312
+ * @param props - See {@link LatticeChatShellProps}.
2313
+ * @returns A React provider tree wrapping the chat UI.
2314
+ *
2315
+ * @example
2316
+ * ```tsx
2317
+ * import { LatticeChatShell } from "@axiom-lattice/react-sdk";
2318
+ *
2319
+ * <LatticeChatShell
2320
+ * initialConfig={{ baseURL: "https://api.example.com", assistantId: "asst_1" }}
2321
+ * enableAssistantCreation={false}
2322
+ * enableWorkspace
2323
+ * enableModelSelector
2324
+ * />
2325
+ * ```
2326
+ *
2327
+ * @remarks
2328
+ * - `enableWorkspace` in props takes priority over `initialConfig.enableWorkspace`.
2329
+ * - This component should wrap all chat-related components in the application.
1662
2330
  */
1663
2331
  declare const LatticeChatShell: React__default.FC<LatticeChatShellProps>;
1664
2332
 
2333
+ /**
2334
+ * Props for the {@link ChatSidebar} component.
2335
+ */
1665
2336
  interface ChatSidebarProps {
2337
+ /** Callback invoked when the user clicks the settings menu item. */
1666
2338
  onSettingsClick?: () => void;
2339
+ /** Whether the sidebar starts collapsed. */
1667
2340
  defaultCollapsed?: boolean;
1668
2341
  /** @deprecated Use `sideMenuItems` on `LatticeChatShellConfig` instead. */
1669
2342
  customMenuItems?: SideMenuItemConfig[];
@@ -1682,20 +2355,68 @@ interface ChatSidebarProps {
1682
2355
  * Or omit `sideMenuItems` entirely to use these defaults as-is.
1683
2356
  */
1684
2357
  declare const DEFAULT_MENU_ITEMS: SideMenuItemConfig[];
2358
+ /**
2359
+ * Navigation sidebar for the chat interface.
2360
+ *
2361
+ * Renders a vertical {@link Menu} with configurable sidebar menu items
2362
+ * (defaults to {@link DEFAULT_MENU_ITEMS}) and a user avatar popover with
2363
+ * change-password and logout actions. Supports inline drawers for items like
2364
+ * thread history, and non-inline drawers rendered via Ant Design `Drawer`.
2365
+ *
2366
+ * @param props - See {@link ChatSidebarProps}.
2367
+ * @returns The sidebar element containing the menu and user-footer area.
2368
+ *
2369
+ * @example
2370
+ * ```tsx
2371
+ * import { ChatSidebar } from "@axiom-lattice/react-sdk";
2372
+ *
2373
+ * <ChatSidebar
2374
+ * onSettingsClick={() => showSettingsModal()}
2375
+ * />
2376
+ * ```
2377
+ *
2378
+ * @remarks
2379
+ * - Sidebar mode (expanded/icon), toggle visibility, and new-analysis button
2380
+ * visibility are controlled by {@link LatticeChatShellContext} config fields:
2381
+ * `sidebarMode`, `sidebarShowToggle`, `sidebarShowNewAnalysis`.
2382
+ * - Inline drawers (e.g. thread history) are handled within the {@link Menu}
2383
+ * component; non-inline drawers render as separate `Drawer` elements.
2384
+ * - User authentication comes from {@link useAuth}.
2385
+ */
1685
2386
  declare const ChatSidebar: React__default.FC<ChatSidebarProps>;
1686
2387
 
1687
2388
  declare const ChannelInstallationsDrawerContent: React__default.FC;
1688
2389
 
2390
+ /**
2391
+ * Props for the {@link ScheduleButton} component.
2392
+ */
1689
2393
  interface ScheduleButtonProps {
1690
2394
  /**
1691
- * Custom tooltip text
2395
+ * Custom tooltip text displayed on hover.
1692
2396
  */
1693
2397
  tooltipText?: string;
1694
2398
  }
1695
2399
  /**
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
2400
+ * A toolbar button that shows the count of active scheduled tasks for the
2401
+ * current agent thread and opens an agenda viewer in the side panel on click.
2402
+ *
2403
+ * Fetches scheduled tasks via {@link useClient} on mount and whenever the
2404
+ * thread ID changes. The button is hidden when no tasks exist.
2405
+ *
2406
+ * @param tooltipText - Tooltip text shown on hover (default: "Agenda").
2407
+ * @returns The schedule button, or `null` if there is no thread ID or no tasks.
2408
+ *
2409
+ * @example
2410
+ * ```tsx
2411
+ * import { ScheduleButton } from "@axiom-lattice/react-sdk";
2412
+ *
2413
+ * <ScheduleButton tooltipText="Scheduled Reports" />
2414
+ * ```
2415
+ *
2416
+ * @remarks
2417
+ * - Requires ancestor context for {@link useAgentChat} and {@link ChatUIContextProvider}.
2418
+ * - Only active tasks (status PENDING or PAUSED) contribute to the badge count.
2419
+ * - Opens a side-app with `component_key: "schedule_viewer"`.
1699
2420
  */
1700
2421
  declare const ScheduleButton: React__default.FC<ScheduleButtonProps>;
1701
2422
 
@@ -1775,6 +2496,113 @@ interface SkillNodeData extends Record<string, unknown> {
1775
2496
  */
1776
2497
  declare const SkillNode: React__default.FC<NodeProps<Node<SkillNodeData>>>;
1777
2498
 
2499
+ interface DSLNode {
2500
+ id: string;
2501
+ type: "agent" | "human_feedback" | "map" | "terminal";
2502
+ name: string;
2503
+ description?: string;
2504
+ ref?: string;
2505
+ config?: Record<string, unknown>;
2506
+ input?: {
2507
+ template: string;
2508
+ };
2509
+ output?: {
2510
+ key?: string;
2511
+ schema?: Record<string, unknown>;
2512
+ };
2513
+ source?: string;
2514
+ node?: {
2515
+ type: string;
2516
+ ref: string;
2517
+ input?: {
2518
+ template: string;
2519
+ };
2520
+ };
2521
+ reduce?: {
2522
+ ref: string;
2523
+ input?: {
2524
+ template: string;
2525
+ };
2526
+ };
2527
+ status?: "success" | "failed" | "cancelled";
2528
+ itemKey?: string;
2529
+ schema?: unknown;
2530
+ }
2531
+ interface DSLEdge {
2532
+ from: string;
2533
+ to?: string | string[];
2534
+ type?: "normal" | "conditional";
2535
+ rule?: {
2536
+ type: "state_field" | "expression";
2537
+ field?: string;
2538
+ code?: string;
2539
+ mapping: Record<string, string>;
2540
+ };
2541
+ }
2542
+ interface ExpandedDSL {
2543
+ version: string;
2544
+ name: string;
2545
+ nodes: DSLNode[];
2546
+ edges: DSLEdge[];
2547
+ }
2548
+
2549
+ interface RunStep {
2550
+ id: string;
2551
+ stepType: string;
2552
+ stepName: string;
2553
+ edgeFrom?: string;
2554
+ edgeTo?: string;
2555
+ edgePurpose?: string;
2556
+ input?: Record<string, unknown>;
2557
+ output?: Record<string, unknown>;
2558
+ status: string;
2559
+ errorMessage?: string;
2560
+ startedAt: string;
2561
+ completedAt?: string;
2562
+ durationMs?: number;
2563
+ }
2564
+ interface WorkflowCanvasProps {
2565
+ dsl: ExpandedDSL;
2566
+ steps?: RunStep[];
2567
+ onNodeClick?: (nodeId: string) => void;
2568
+ height?: number | string;
2569
+ }
2570
+ declare const WorkflowCanvas: React__default.FC<WorkflowCanvasProps>;
2571
+
2572
+ interface RunState {
2573
+ status: "running" | "completed" | "failed" | "interrupted";
2574
+ stepType?: string;
2575
+ durationMs?: number;
2576
+ selected?: boolean;
2577
+ }
2578
+ interface WorkflowNodeData extends Record<string, unknown> {
2579
+ nodeType: "agent" | "human_feedback" | "map" | "terminal";
2580
+ name: string;
2581
+ description?: string;
2582
+ ref?: string;
2583
+ outputKey?: string;
2584
+ /** node JSON Schema definition */
2585
+ nodeSchema?: unknown;
2586
+ config?: Record<string, unknown>;
2587
+ /** terminal status */
2588
+ status?: string;
2589
+ /** map: source array path */
2590
+ source?: string;
2591
+ /** map: inner agent ref */
2592
+ innerRef?: string;
2593
+ /** map: reduce agent ref */
2594
+ reduceRef?: string;
2595
+ /** node's input template (prompt) */
2596
+ inputTemplate?: string;
2597
+ /** runtime execution state */
2598
+ runState?: RunState;
2599
+ /** true when this is a runtime node that hasn't been executed yet */
2600
+ pending?: boolean;
2601
+ }
2602
+ declare const WorkflowNode: React__default.FC<NodeProps<Node<WorkflowNodeData>>>;
2603
+
2604
+ declare const WorkflowAutomationView: React__default.FC;
2605
+
1778
2606
  interface CreateAssistantModalProps {
1779
2607
  open: boolean;
1780
2608
  onCancel: () => void;
@@ -1782,26 +2610,118 @@ interface CreateAssistantModalProps {
1782
2610
  }
1783
2611
  declare const CreateAssistantModal: React__default.FC<CreateAssistantModalProps>;
1784
2612
 
2613
+ /**
2614
+ * Top-level evaluation panel component.
2615
+ *
2616
+ * Provides a multi-page interface for managing agent evaluation:
2617
+ * - **Dashboard**: Overview of test suites, cases, and recent runs with stats cards.
2618
+ * - **Suites**: List of test suites with options to create, view, and run all.
2619
+ * - **Suite Detail**: View and manage test cases within a single suite.
2620
+ * - **Run Results**: View detailed results of a specific evaluation run.
2621
+ *
2622
+ * Automatically selects the first project when projects load. Uses a
2623
+ * lightweight page-based navigation model (`dashboard -> suites -> suite -> run`).
2624
+ *
2625
+ * @example
2626
+ * ```tsx
2627
+ * import { EvalPanel } from "@axiom-lattice/react-sdk";
2628
+ *
2629
+ * function App() {
2630
+ * return (
2631
+ * <AxiomLatticeProvider config={config}>
2632
+ * <EvalPanel />
2633
+ * </AxiomLatticeProvider>
2634
+ * );
2635
+ * }
2636
+ * ```
2637
+ */
1785
2638
  declare const EvalPanel: React__default.FC;
1786
2639
 
2640
+ /**
2641
+ * Props for {@link EvalSuiteCardList}.
2642
+ */
1787
2643
  interface Props {
2644
+ /** The evaluation project ID to load suites from */
1788
2645
  projectId: string;
2646
+ /** Callback invoked when the user selects a suite card */
1789
2647
  onSelectSuite: (projectId: string, suiteId: string) => void;
1790
2648
  }
2649
+ /**
2650
+ * Displays evaluation test suites as a grid of cards.
2651
+ *
2652
+ * Each card shows the suite name, case count, and a delete action.
2653
+ * Handles loading, empty, and populated states.
2654
+ *
2655
+ * @example
2656
+ * ```tsx
2657
+ * <EvalSuiteCardList
2658
+ * projectId="proj-123"
2659
+ * onSelectSuite={(pid, sid) => navigate(`/suites/${sid}`)}
2660
+ * />
2661
+ * ```
2662
+ */
1791
2663
  declare const EvalSuiteCardList: React__default.FC<Props>;
1792
2664
 
2665
+ /**
2666
+ * Props for {@link EvalSuiteDetail}.
2667
+ */
1793
2668
  interface EvalSuiteDetailProps {
2669
+ /** The evaluation project ID */
1794
2670
  projectId: string;
2671
+ /** The suite ID to display */
1795
2672
  suiteId: string;
2673
+ /** Callback to navigate back to the suite list */
1796
2674
  onBack: () => void;
2675
+ /** Callback invoked when a run is started, receiving the run ID */
1797
2676
  onRun: (runId: string) => void;
1798
2677
  }
2678
+ /**
2679
+ * Detail view for a single evaluation suite.
2680
+ *
2681
+ * Displays a breadcrumb header, a table of test cases with input messages,
2682
+ * agent references, rubric counts, and delete actions. Includes a modal form
2683
+ * for adding new test cases with agent selection, output type, and expected
2684
+ * content assertion.
2685
+ *
2686
+ * @example
2687
+ * ```tsx
2688
+ * <EvalSuiteDetail
2689
+ * projectId="proj-123"
2690
+ * suiteId="suite-456"
2691
+ * onBack={() => setPage("suites")}
2692
+ * onRun={(runId) => setRunId(runId)}
2693
+ * />
2694
+ * ```
2695
+ */
1799
2696
  declare const EvalSuiteDetail: React__default.FC<EvalSuiteDetailProps>;
1800
2697
 
2698
+ /**
2699
+ * Props for {@link EvalRunResults}.
2700
+ */
1801
2701
  interface EvalRunResultsProps {
2702
+ /** The run ID whose results to display */
1802
2703
  runId: string;
2704
+ /** Callback to navigate back to the previous page */
1803
2705
  onBack: () => void;
1804
2706
  }
2707
+ /**
2708
+ * Displays detailed results for a single evaluation run.
2709
+ *
2710
+ * Shows a summary card with total/passed/failed counts, average score,
2711
+ * and pass rate. Renders an expandable table of per-case results including
2712
+ * pass/fail status, suite name, input message, judge summary, dimension
2713
+ * scores with progress bars, and overall score.
2714
+ *
2715
+ * Supports live streaming progress during active runs and a delete action.
2716
+ *
2717
+ * @example
2718
+ * ```tsx
2719
+ * <EvalRunResults
2720
+ * runId="run-789"
2721
+ * onBack={() => setPage("dashboard")}
2722
+ * />
2723
+ * ```
2724
+ */
1805
2725
  declare const EvalRunResults: React__default.FC<EvalRunResultsProps>;
1806
2726
 
1807
2727
  interface SkillCategoryPromptsProps {
@@ -2314,4 +3234,4 @@ type IframeMessage = {
2314
3234
  };
2315
3235
  declare function generateIframeSrcdoc(): string;
2316
3236
 
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 };
3237
+ 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, 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 };