@axiom-lattice/react-sdk 2.1.104 → 2.1.106
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 +1434 -1387
- package/dist/index.d.ts +1434 -1387
- package/dist/index.js +5605 -4844
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5299 -4540
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -4,11 +4,11 @@ export * from '@axiom-lattice/protocols';
|
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
5
|
import React__default, { ReactNode, Component } from 'react';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
+
import { SlotConfigType } from '@ant-design/x/es/sender/interface';
|
|
7
8
|
import { Client, Assistant, CreateAssistantOptions, UpdateAssistantOptions } from '@axiom-lattice/client-sdk';
|
|
8
9
|
import { Prompts } from '@ant-design/x';
|
|
9
10
|
import { GetProp, ThemeConfig } from 'antd';
|
|
10
11
|
export { ThemeConfig } from 'antd';
|
|
11
|
-
import { SlotConfigType } from '@ant-design/x/es/sender/interface';
|
|
12
12
|
import { NodeProps, Node } from '@xyflow/react';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -490,1649 +490,1696 @@ declare function useAgentGraph(assistantId: string): {
|
|
|
490
490
|
declare function useApi(options?: UseApiOptions): UseApiReturn;
|
|
491
491
|
|
|
492
492
|
/**
|
|
493
|
-
*
|
|
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
|
-
*/
|
|
504
|
-
declare function useEvalProjects(): {
|
|
505
|
-
projects: unknown[];
|
|
506
|
-
loading: boolean;
|
|
507
|
-
error: Error | null;
|
|
508
|
-
create: (data: Record<string, unknown>) => Promise<unknown>;
|
|
509
|
-
update: (id: string, patch: Record<string, unknown>) => Promise<void>;
|
|
510
|
-
remove: (id: string) => Promise<void>;
|
|
511
|
-
refresh: () => Promise<void>;
|
|
512
|
-
};
|
|
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
|
-
* ```
|
|
493
|
+
* Quick prompt item for quick prompt components
|
|
526
494
|
*/
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
refresh: () => Promise<void>;
|
|
535
|
-
};
|
|
536
|
-
|
|
495
|
+
interface QuickPromptItem {
|
|
496
|
+
key: string;
|
|
497
|
+
icon?: ReactNode;
|
|
498
|
+
label: string;
|
|
499
|
+
description?: string;
|
|
500
|
+
content: SlotConfigType[];
|
|
501
|
+
}
|
|
537
502
|
/**
|
|
538
|
-
*
|
|
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
|
-
* ```
|
|
503
|
+
* Quick prompt category for organizing prompt items
|
|
550
504
|
*/
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
refresh: () => Promise<void>;
|
|
559
|
-
};
|
|
560
|
-
|
|
505
|
+
interface QuickPromptCategory {
|
|
506
|
+
key: string;
|
|
507
|
+
title: string;
|
|
508
|
+
icon?: ReactNode;
|
|
509
|
+
color?: string;
|
|
510
|
+
items: QuickPromptItem[];
|
|
511
|
+
}
|
|
561
512
|
/**
|
|
562
|
-
*
|
|
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
|
-
* ```
|
|
513
|
+
* Middleware tool definition
|
|
573
514
|
*/
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
run_id: string;
|
|
580
|
-
}>;
|
|
581
|
-
abort: (runId: string) => Promise<void>;
|
|
582
|
-
remove: (runId: string) => Promise<void>;
|
|
583
|
-
refresh: () => Promise<void>;
|
|
584
|
-
};
|
|
585
|
-
|
|
515
|
+
interface MiddlewareToolDefinition {
|
|
516
|
+
id: string;
|
|
517
|
+
name: string;
|
|
518
|
+
description: string;
|
|
519
|
+
}
|
|
586
520
|
/**
|
|
587
|
-
*
|
|
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
|
-
* ```
|
|
521
|
+
* JSON Schema property definition for middleware config
|
|
597
522
|
*/
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
523
|
+
interface MiddlewareConfigSchemaProperty {
|
|
524
|
+
type: "string" | "number" | "integer" | "boolean" | "object" | "array";
|
|
525
|
+
title?: string;
|
|
526
|
+
description?: string;
|
|
527
|
+
default?: any;
|
|
528
|
+
enum?: string[];
|
|
529
|
+
enumLabels?: Record<string, string>;
|
|
530
|
+
minimum?: number;
|
|
531
|
+
maximum?: number;
|
|
532
|
+
minLength?: number;
|
|
533
|
+
maxLength?: number;
|
|
534
|
+
pattern?: string;
|
|
535
|
+
format?: string;
|
|
536
|
+
widget?: "input" | "textarea" | "select" | "segmented" | "switch" | "numberInput" | "skillSelect" | "databaseSelect" | "metricsSelect" | "topologyEdgeBuilder" | "collectionSelect" | "connectionSelect";
|
|
537
|
+
items?: {
|
|
538
|
+
type: string;
|
|
605
539
|
};
|
|
606
|
-
|
|
607
|
-
stopStreaming: () => void;
|
|
608
|
-
};
|
|
609
|
-
|
|
540
|
+
}
|
|
610
541
|
/**
|
|
611
|
-
*
|
|
612
|
-
* @param props - Provider props
|
|
613
|
-
* @returns Provider component
|
|
542
|
+
* JSON Schema for middleware configuration
|
|
614
543
|
*/
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
544
|
+
interface MiddlewareConfigSchema {
|
|
545
|
+
type: "object";
|
|
546
|
+
title?: string;
|
|
547
|
+
description?: string;
|
|
548
|
+
required?: string[];
|
|
549
|
+
properties: Record<string, MiddlewareConfigSchemaProperty>;
|
|
618
550
|
}
|
|
619
551
|
/**
|
|
620
|
-
*
|
|
621
|
-
* @param assistantId - The assistant ID
|
|
622
|
-
* @returns Client instance for the assistant
|
|
623
|
-
* @throws Error if used outside of AxiomLatticeProvider
|
|
552
|
+
* Middleware type definition
|
|
624
553
|
*/
|
|
625
|
-
|
|
554
|
+
interface MiddlewareTypeDefinition {
|
|
555
|
+
type: string;
|
|
556
|
+
name: string;
|
|
557
|
+
description: string;
|
|
558
|
+
icon?: ReactNode;
|
|
559
|
+
schema?: MiddlewareConfigSchema;
|
|
560
|
+
defaultConfig?: Record<string, any>;
|
|
561
|
+
tools?: MiddlewareToolDefinition[];
|
|
562
|
+
connectionSchema?: {
|
|
563
|
+
fields: Record<string, unknown>;
|
|
564
|
+
hasTest?: boolean;
|
|
565
|
+
hasDiscover?: boolean;
|
|
566
|
+
resourceLabel?: string;
|
|
567
|
+
};
|
|
568
|
+
}
|
|
626
569
|
/**
|
|
627
|
-
*
|
|
628
|
-
* @returns The Axiom Lattice client
|
|
629
|
-
* @throws Error if used outside of AxiomLatticeProvider
|
|
630
|
-
* @deprecated Use useClient(assistantId) instead
|
|
570
|
+
* Middleware type for configuration
|
|
631
571
|
*/
|
|
632
|
-
|
|
633
|
-
|
|
572
|
+
interface MiddlewareConfigDefinition {
|
|
573
|
+
id: string;
|
|
574
|
+
type: string;
|
|
575
|
+
name: string;
|
|
576
|
+
description: string;
|
|
577
|
+
enabled: boolean;
|
|
578
|
+
config: Record<string, any>;
|
|
579
|
+
/** 可选:限制该中间件暴露的工具列表。不配置则默认暴露所有工具 */
|
|
580
|
+
allowedTools?: string[];
|
|
581
|
+
tools?: MiddlewareToolDefinition[];
|
|
582
|
+
}
|
|
634
583
|
/**
|
|
635
|
-
*
|
|
584
|
+
* Sidebar menu item type
|
|
636
585
|
*/
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
files?: {
|
|
643
|
-
name: string;
|
|
644
|
-
id: string;
|
|
645
|
-
}[];
|
|
646
|
-
};
|
|
647
|
-
command?: {
|
|
648
|
-
resume?: {
|
|
649
|
-
action: string;
|
|
650
|
-
data: Record<string, any> & {
|
|
651
|
-
config?: {
|
|
652
|
-
thread_id?: string;
|
|
653
|
-
work_log_id?: string;
|
|
654
|
-
};
|
|
655
|
-
};
|
|
656
|
-
message: string;
|
|
657
|
-
};
|
|
658
|
-
update?: any;
|
|
659
|
-
send?: {
|
|
660
|
-
node: string;
|
|
661
|
-
input: any;
|
|
662
|
-
};
|
|
663
|
-
};
|
|
664
|
-
streaming?: boolean;
|
|
665
|
-
mode?: 'collect' | 'followup' | 'steer';
|
|
666
|
-
}) => Promise<void>;
|
|
667
|
-
stopStreaming: () => void;
|
|
668
|
-
resumeStream: (messageId?: string) => () => void;
|
|
669
|
-
loadMessages: (limit?: number) => Promise<void>;
|
|
670
|
-
clearMessages: () => void;
|
|
671
|
-
clearError: () => void;
|
|
672
|
-
customRunConfig: Record<string, any>;
|
|
673
|
-
updateCustomRunConfig: (config: Record<string, any>) => void;
|
|
674
|
-
removePendingMessage: (messageId: string) => Promise<boolean>;
|
|
675
|
-
abortAgent: () => Promise<void>;
|
|
586
|
+
type SideMenuItemType = "drawer" | "route" | "action";
|
|
587
|
+
interface ResourceFolderConfig {
|
|
588
|
+
name: string;
|
|
589
|
+
displayName?: string;
|
|
590
|
+
allowUpload: boolean;
|
|
676
591
|
}
|
|
677
592
|
/**
|
|
678
|
-
*
|
|
593
|
+
* Sidebar menu item configuration
|
|
679
594
|
*/
|
|
680
|
-
interface AgentThreadProviderProps<T extends UseChatOptions> {
|
|
681
|
-
threadId: string | null;
|
|
682
|
-
assistantId?: string;
|
|
683
|
-
options?: T;
|
|
684
|
-
children: ReactNode;
|
|
685
|
-
onToolCompleted?: (toolName: string) => void;
|
|
686
|
-
onStreamCompleted?: () => void;
|
|
687
|
-
}
|
|
688
595
|
/**
|
|
689
|
-
*
|
|
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.
|
|
702
|
-
*/
|
|
703
|
-
declare function AgentThreadProvider<T extends UseChatOptions>({ threadId, assistantId, options, children, onToolCompleted, onStreamCompleted, }: AgentThreadProviderProps<T>): react_jsx_runtime.JSX.Element | null;
|
|
704
|
-
/**
|
|
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}.
|
|
596
|
+
* Sidebar menu item configuration.
|
|
710
597
|
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
598
|
+
* Three item types:
|
|
599
|
+
* - `"action"` — clickable button, set `builtin` for predefined behaviors
|
|
600
|
+
* - `"drawer"` — opens a slide-out panel, set `content` + `title`
|
|
601
|
+
* - `"route"` — opens a GenUI-registered component in the SideApp area
|
|
714
602
|
*
|
|
715
|
-
*
|
|
603
|
+
* When providing `sideMenuItems` or `workspaceMenuItems` to `LatticeChatShellConfig`,
|
|
604
|
+
* your array **completely replaces** the defaults. Import `DEFAULT_MENU_ITEMS` or
|
|
605
|
+
* `DEFAULT_WORKSPACE_MENU_ITEMS` to selectively include built-in items:
|
|
716
606
|
* ```
|
|
717
|
-
|
|
718
|
-
declare function useAgentThreadContext<T extends UseChatOptions>(): AgentThreadContextValue<T>;
|
|
719
|
-
|
|
720
|
-
interface UserTenantInfo {
|
|
721
|
-
tenantId: string;
|
|
722
|
-
role: string;
|
|
723
|
-
tenant?: Tenant;
|
|
724
|
-
}
|
|
725
|
-
interface PersonalAssistantInfo {
|
|
726
|
-
assistantId: string;
|
|
727
|
-
projectId: string;
|
|
728
|
-
workspaceId: string;
|
|
729
|
-
/** tenantId for debugging cross-tenant leakage */
|
|
730
|
-
tenantId?: string | null;
|
|
731
|
-
}
|
|
732
|
-
interface AuthContextValue {
|
|
733
|
-
user: User | null;
|
|
734
|
-
tenants: UserTenantInfo[];
|
|
735
|
-
currentTenant: Tenant | null;
|
|
736
|
-
personalAssistant: PersonalAssistantInfo | null;
|
|
737
|
-
setPersonalAssistant: (info: PersonalAssistantInfo | null) => void;
|
|
738
|
-
isAuthenticated: boolean;
|
|
739
|
-
isLoading: boolean;
|
|
740
|
-
error: string | null;
|
|
741
|
-
login: (email: string, password: string) => Promise<{
|
|
742
|
-
requiresTenantSelection: boolean;
|
|
743
|
-
hasTenants: boolean;
|
|
744
|
-
}>;
|
|
745
|
-
register: (email: string, password: string, name: string) => Promise<{
|
|
746
|
-
message: string;
|
|
747
|
-
token?: string;
|
|
748
|
-
}>;
|
|
749
|
-
logout: () => void;
|
|
750
|
-
selectTenant: (tenantId: string) => Promise<void>;
|
|
751
|
-
fetchUserTenants: () => Promise<void>;
|
|
752
|
-
refreshUser: () => Promise<void>;
|
|
753
|
-
clearError: () => void;
|
|
754
|
-
changePassword: (currentPassword: string, newPassword: string) => Promise<void>;
|
|
755
|
-
}
|
|
756
|
-
/**
|
|
757
|
-
* Hook to access authentication context. Must be used within an {@link AuthProvider}.
|
|
758
|
-
*
|
|
759
|
-
* @description
|
|
760
|
-
* Provides the full auth state and all auth operations (login, register, logout, tenant selection, etc.).
|
|
761
|
-
* Throws an error if no {@link AuthProvider} is found in the component tree. For optional auth,
|
|
762
|
-
* use {@link useAuthOptional} instead.
|
|
763
|
-
*
|
|
764
|
-
* @returns The current {@link AuthContextValue} containing user, tenants, auth state, and auth actions.
|
|
765
|
-
*
|
|
766
|
-
* @throws {Error} If used outside of an {@link AuthProvider}.
|
|
767
|
-
*
|
|
768
|
-
* @example
|
|
769
|
-
* ```tsx
|
|
770
|
-
* const { user, isAuthenticated, login, logout } = useAuth();
|
|
771
|
-
*
|
|
772
|
-
* const handleLogin = async () => {
|
|
773
|
-
* const result = await login('user@example.com', 'password');
|
|
774
|
-
* if (result.requiresTenantSelection) {
|
|
775
|
-
* // Show tenant picker
|
|
776
|
-
* }
|
|
777
|
-
* };
|
|
607
|
+
* sideMenuItems: DEFAULT_MENU_ITEMS.filter(i => i.id === "thread-history")
|
|
778
608
|
* ```
|
|
779
609
|
*/
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
*/
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
/**
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
610
|
+
interface SideMenuItemConfig {
|
|
611
|
+
/** Unique identifier for the menu item */
|
|
612
|
+
id: string;
|
|
613
|
+
/** Type of the menu item - drawer or route (SideApp) */
|
|
614
|
+
type: SideMenuItemType;
|
|
615
|
+
/** Display name of the menu item */
|
|
616
|
+
name: string;
|
|
617
|
+
/** Icon component for the menu item */
|
|
618
|
+
icon?: ReactNode;
|
|
619
|
+
/** Order for sorting menu items (lower values first) */
|
|
620
|
+
order?: number;
|
|
621
|
+
/** Whether this is a builtin menu item (new-analysis, thread-history, assistants, skill, skills, tools, workspace, settings, database, metrics, mcp, projects, logout, switch-tenant) */
|
|
622
|
+
builtin?: "new-analysis" | "thread-history" | "assistants" | "skill" | "skills" | "tools" | "workspace" | "settings" | "database" | "metrics" | "mcp" | "projects" | "logout" | "switch-tenant" | "connections";
|
|
623
|
+
/**
|
|
624
|
+
* Menu group for organizing items
|
|
625
|
+
*/
|
|
626
|
+
group?: string;
|
|
627
|
+
/**
|
|
628
|
+
* Whether the menu item is enabled (can be toggled)
|
|
629
|
+
* Defaults to true
|
|
630
|
+
*/
|
|
631
|
+
enabled?: boolean;
|
|
632
|
+
/** Content config from DB (for custom menu items) */
|
|
633
|
+
contentConfig?: Record<string, unknown>;
|
|
634
|
+
/** Content to display inside the drawer (for drawer type) */
|
|
635
|
+
content?: ReactNode;
|
|
636
|
+
/** Drawer title (for drawer type) */
|
|
637
|
+
title?: string;
|
|
638
|
+
/** Drawer width in pixels or percentage (for drawer type) */
|
|
639
|
+
width?: string | number;
|
|
640
|
+
/**
|
|
641
|
+
* Whether to display drawer content inline in expanded sidebar mode
|
|
642
|
+
* When true, content shows below the menu item instead of in a drawer
|
|
643
|
+
* Defaults to false, but true for "workspace" builtin
|
|
644
|
+
*/
|
|
645
|
+
inline?: boolean;
|
|
646
|
+
/**
|
|
647
|
+
* Maximum height for inline drawer content in pixels
|
|
648
|
+
* Only applies when inline is true
|
|
649
|
+
* Defaults to 400
|
|
650
|
+
*/
|
|
651
|
+
inlineMaxHeight?: number;
|
|
652
|
+
/**
|
|
653
|
+
* Whether inline drawer is expanded by default
|
|
654
|
+
* Only applies when inline is true
|
|
655
|
+
* Defaults to false
|
|
656
|
+
*/
|
|
657
|
+
inlineDefaultExpanded?: boolean;
|
|
658
|
+
/** Component to render in SideApp (for route type) */
|
|
659
|
+
sideAppComponent?: ReactNode;
|
|
807
660
|
}
|
|
808
661
|
/**
|
|
809
|
-
*
|
|
810
|
-
* to all descendant components via {@link useAuth} and {@link useAuthOptional}.
|
|
811
|
-
*
|
|
812
|
-
* @description
|
|
813
|
-
* Manages the full authentication lifecycle including:
|
|
814
|
-
* - **Login / Register**: Sends credentials to the gateway API and stores the returned user, tenants, and token in `sessionStorage`.
|
|
815
|
-
* - **Session restoration**: On mount, reads previously stored user data from `sessionStorage` and also refreshes the tenant list to catch any admin-side role assignments.
|
|
816
|
-
* - **Tenant selection**: Calls the gateway API to select a tenant and stores the tenant data.
|
|
817
|
-
* - **Logout**: Clears all auth state and `sessionStorage`.
|
|
818
|
-
* - **Change password**: Proxies to the gateway password change endpoint.
|
|
819
|
-
* - **Token expiration**: Automatically logs out when the gateway returns a 401 with an expired token message.
|
|
820
|
-
*
|
|
821
|
-
* @param props - {@link AuthProviderProps}
|
|
822
|
-
* @param props.children - React children to render within the auth context.
|
|
823
|
-
* @param props.baseURL - Base URL of the gateway API.
|
|
824
|
-
* @param props.onLoginSuccess - Optional callback invoked after a successful login.
|
|
825
|
-
* @param props.onTenantSelected - Optional callback invoked after tenant selection.
|
|
826
|
-
* @param props.onLogout - Optional callback invoked on logout.
|
|
827
|
-
*
|
|
828
|
-
* @returns A React context provider wrapping children with {@link AuthContext.Provider}.
|
|
829
|
-
*
|
|
830
|
-
* @example
|
|
831
|
-
* ```tsx
|
|
832
|
-
* <AuthProvider
|
|
833
|
-
* baseURL="http://localhost:3000"
|
|
834
|
-
* onLoginSuccess={(user) => console.log('Logged in:', user.email)}
|
|
835
|
-
* onLogout={() => window.location.reload()}
|
|
836
|
-
* >
|
|
837
|
-
* <App />
|
|
838
|
-
* </AuthProvider>
|
|
839
|
-
* ```
|
|
840
|
-
*/
|
|
841
|
-
declare const AuthProvider: React__default.FC<AuthProviderProps>;
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* Login Form Components
|
|
845
|
-
* Uses base styles from design system
|
|
662
|
+
* Lattice Chat Shell configuration interface
|
|
846
663
|
*/
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
664
|
+
interface LatticeChatShellConfig {
|
|
665
|
+
/**
|
|
666
|
+
* Base URL for the API
|
|
667
|
+
*/
|
|
668
|
+
baseURL: string;
|
|
669
|
+
/**
|
|
670
|
+
* API key for authentication (optional)
|
|
671
|
+
*/
|
|
672
|
+
apiKey?: string;
|
|
673
|
+
/**
|
|
674
|
+
* Transport method (Server-Sent Events or WebSocket)
|
|
675
|
+
*/
|
|
676
|
+
transport?: "sse" | "ws";
|
|
677
|
+
/**
|
|
678
|
+
* Request timeout in milliseconds (optional)
|
|
679
|
+
*/
|
|
680
|
+
timeout?: number;
|
|
681
|
+
/**
|
|
682
|
+
* Additional headers to include in requests (optional)
|
|
683
|
+
*/
|
|
684
|
+
headers?: Record<string, string>;
|
|
685
|
+
/**
|
|
686
|
+
* Whether users can create new threads from the UI
|
|
687
|
+
* Defaults to true
|
|
688
|
+
*/
|
|
689
|
+
enableThreadCreation?: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Whether users can view the thread list in the sidebar
|
|
692
|
+
* Defaults to true
|
|
693
|
+
*/
|
|
694
|
+
enableThreadList?: boolean;
|
|
695
|
+
assistantId?: string;
|
|
696
|
+
showSideMenu?: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* URL of the global shared sandbox, this is used to access the global shared sandbox
|
|
699
|
+
* if not provided, sandbox will be created in the agent's sandbox
|
|
700
|
+
*/
|
|
701
|
+
globalSharedSandboxURL?: string;
|
|
702
|
+
/**
|
|
703
|
+
* Available middleware types that can be configured for agents
|
|
704
|
+
* Each middleware type defines its name, description, and default configuration
|
|
705
|
+
* If not provided, default middleware types will be used
|
|
706
|
+
*/
|
|
707
|
+
availableMiddlewareTypes?: MiddlewareTypeDefinition[];
|
|
708
|
+
/**
|
|
709
|
+
* Whether users can create new assistants
|
|
710
|
+
* Defaults to true
|
|
711
|
+
*/
|
|
712
|
+
enableAssistantCreation?: boolean;
|
|
713
|
+
/**
|
|
714
|
+
* Whether users can edit existing assistants
|
|
715
|
+
* Defaults to true
|
|
716
|
+
*/
|
|
717
|
+
enableAssistantEditing?: boolean;
|
|
718
|
+
/**
|
|
719
|
+
* Whether to enable workspace and project management
|
|
720
|
+
* When enabled, shows workspace selector in header and file browser
|
|
721
|
+
* Defaults to false
|
|
722
|
+
*/
|
|
723
|
+
enableWorkspace?: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* Whether to load custom menu items from the database (API /api/menu-items).
|
|
726
|
+
* When enabled, WorkspaceResourceManager fetches per-tenant custom menu items
|
|
727
|
+
* and merges them with built-in defaults.
|
|
728
|
+
* Defaults to true.
|
|
729
|
+
*/
|
|
730
|
+
enableCustomMenu?: boolean;
|
|
731
|
+
/**
|
|
732
|
+
* Resource folders configuration for workspace
|
|
733
|
+
* Each folder represents a section in the workspace assets panel
|
|
734
|
+
* If not provided, defaults to a single root folder with upload enabled
|
|
735
|
+
*/
|
|
736
|
+
resourceFolders?: ResourceFolderConfig[];
|
|
737
|
+
/**
|
|
738
|
+
* Chat sidebar menu items. When provided, completely replaces the
|
|
739
|
+
* default built-in items (New Analysis, History).
|
|
740
|
+
*
|
|
741
|
+
* To selectively include built-in items, import and filter `DEFAULT_MENU_ITEMS`:
|
|
742
|
+
* ```
|
|
743
|
+
* sideMenuItems: DEFAULT_MENU_ITEMS.filter(i => i.id === "thread-history")
|
|
744
|
+
* ```
|
|
745
|
+
* Omit this field to use all defaults.
|
|
746
|
+
*/
|
|
747
|
+
sideMenuItems?: SideMenuItemConfig[];
|
|
748
|
+
/**
|
|
749
|
+
* Workspace menu items. When provided, completely replaces the
|
|
750
|
+
* default workspace items (Projects, Metrics, Database, etc.).
|
|
751
|
+
*
|
|
752
|
+
* To selectively include built-in items, import and filter `DEFAULT_WORKSPACE_MENU_ITEMS`:
|
|
753
|
+
* ```
|
|
754
|
+
* workspaceMenuItems: DEFAULT_WORKSPACE_MENU_ITEMS.filter(
|
|
755
|
+
* i => ["workspace_projects", "assistants"].includes(i.id)
|
|
756
|
+
* )
|
|
757
|
+
* ```
|
|
758
|
+
* Omit this field to use all defaults.
|
|
759
|
+
*/
|
|
760
|
+
workspaceMenuItems?: SideMenuItemConfig[];
|
|
761
|
+
/**
|
|
762
|
+
* Whether to enable the database picker slot in the chat sender
|
|
763
|
+
* When enabled, shows a database selection button in the sender footer
|
|
764
|
+
* Defaults to true
|
|
765
|
+
*/
|
|
766
|
+
enableDatabaseSlot?: boolean;
|
|
767
|
+
/**
|
|
768
|
+
* Whether to enable the skill picker slot in the chat sender
|
|
769
|
+
* When enabled, shows a skill selection button in the sender footer
|
|
770
|
+
* Defaults to true
|
|
771
|
+
*/
|
|
772
|
+
enableSkillSlot?: boolean;
|
|
773
|
+
/**
|
|
774
|
+
* Whether to enable the agent picker slot in the chat sender
|
|
775
|
+
* When enabled, shows an agent selection button in the sender footer
|
|
776
|
+
* Defaults to true
|
|
777
|
+
*/
|
|
778
|
+
enableAgentSlot?: boolean;
|
|
779
|
+
/**
|
|
780
|
+
* Whether to enable the metrics datasource picker slot in the chat sender
|
|
781
|
+
* When enabled, shows a metrics datasource selection button in the sender footer
|
|
782
|
+
* Defaults to true
|
|
783
|
+
*/
|
|
784
|
+
enableMetricsDataSourceSlot?: boolean;
|
|
785
|
+
/**
|
|
786
|
+
* Whether to enable the model selector in the chat sender
|
|
787
|
+
* When enabled, shows a model selection dropdown in the sender footer
|
|
788
|
+
* Defaults to false
|
|
789
|
+
*/
|
|
790
|
+
enableModelSelector?: boolean;
|
|
791
|
+
/**
|
|
792
|
+
* Sidebar display mode
|
|
793
|
+
* - "icon": Show only icons (default)
|
|
794
|
+
* - "expanded": Show icons with labels and groups
|
|
795
|
+
* Defaults to "icon"
|
|
796
|
+
*/
|
|
797
|
+
sidebarMode?: "icon" | "expanded";
|
|
798
|
+
/**
|
|
799
|
+
* Whether sidebar is expanded by default (only applies when sidebarMode is "expanded")
|
|
800
|
+
* Defaults to true
|
|
801
|
+
*/
|
|
802
|
+
sidebarDefaultExpanded?: boolean;
|
|
803
|
+
/**
|
|
804
|
+
* Whether workspace menu is expanded by default
|
|
805
|
+
* Defaults to true
|
|
806
|
+
*/
|
|
807
|
+
workspaceMenuDefaultExpanded?: boolean;
|
|
808
|
+
/**
|
|
809
|
+
* Whether to show the expand/collapse toggle button
|
|
810
|
+
* Defaults to true
|
|
811
|
+
*/
|
|
812
|
+
sidebarShowToggle?: boolean;
|
|
813
|
+
/**
|
|
814
|
+
* Whether to show the "New Analysis" button in expanded sidebar
|
|
815
|
+
* Defaults to true
|
|
816
|
+
*/
|
|
817
|
+
sidebarShowNewAnalysis?: boolean;
|
|
818
|
+
/**
|
|
819
|
+
* Endpoint for fetching middleware type definitions from API.
|
|
820
|
+
* Falls back to DEFAULT_MIDDLEWARE_TYPES on failure.
|
|
821
|
+
*/
|
|
822
|
+
middlewareTypesEndpoint?: string;
|
|
823
|
+
/**
|
|
824
|
+
* Logo text displayed in expanded sidebar
|
|
825
|
+
* Defaults to "Lattice"
|
|
826
|
+
*/
|
|
827
|
+
sidebarLogoText?: string;
|
|
828
|
+
/**
|
|
829
|
+
* Custom logo icon component
|
|
830
|
+
* If not provided, defaults to Cpu icon
|
|
831
|
+
*/
|
|
832
|
+
sidebarLogoIcon?: React__default.ReactNode;
|
|
833
|
+
/**
|
|
834
|
+
* Custom quick prompts data for quick prompt components
|
|
835
|
+
* Allows registering custom prompt categories and items via shell config
|
|
836
|
+
* If not provided, default prompt data will be used
|
|
837
|
+
*/
|
|
838
|
+
quickPromptsData?: QuickPromptCategory[];
|
|
867
839
|
}
|
|
868
|
-
declare const RegisterForm: React__default.FC<RegisterFormProps>;
|
|
869
|
-
|
|
870
840
|
/**
|
|
871
|
-
*
|
|
872
|
-
* Using Axiom Theme with Ant Design
|
|
841
|
+
* Lattice Chat Shell context value interface
|
|
873
842
|
*/
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
843
|
+
interface LatticeChatShellContextValue {
|
|
844
|
+
/**
|
|
845
|
+
* Current configuration
|
|
846
|
+
*/
|
|
847
|
+
config: LatticeChatShellConfig;
|
|
848
|
+
/**
|
|
849
|
+
* Update the entire configuration
|
|
850
|
+
*/
|
|
851
|
+
updateConfig: (config: Partial<LatticeChatShellConfig>) => void;
|
|
852
|
+
/**
|
|
853
|
+
* Update a specific configuration value
|
|
854
|
+
*/
|
|
855
|
+
updateConfigValue: <K extends keyof LatticeChatShellConfig>(key: K, value: LatticeChatShellConfig[K]) => void;
|
|
856
|
+
/**
|
|
857
|
+
* Reset configuration to defaults
|
|
858
|
+
*/
|
|
859
|
+
resetConfig: () => void;
|
|
860
|
+
/**
|
|
861
|
+
* Whether the settings modal is open
|
|
862
|
+
*/
|
|
863
|
+
settingsModalOpen: boolean;
|
|
864
|
+
/**
|
|
865
|
+
* Set the settings modal open state
|
|
866
|
+
*/
|
|
867
|
+
setSettingsModalOpen: (open: boolean) => void;
|
|
882
868
|
}
|
|
883
869
|
/**
|
|
884
|
-
*
|
|
870
|
+
* Default middleware type definitions with JSON Schema for configuration
|
|
885
871
|
*/
|
|
886
|
-
declare const
|
|
887
|
-
interface ProtectedRouteProps {
|
|
888
|
-
children: React__default.ReactNode;
|
|
889
|
-
/** Component to show when not authenticated */
|
|
890
|
-
fallback?: React__default.ReactNode;
|
|
891
|
-
/** Redirect URL (if using react-router) */
|
|
892
|
-
redirectTo?: string;
|
|
893
|
-
}
|
|
872
|
+
declare const DEFAULT_MIDDLEWARE_TYPES: MiddlewareTypeDefinition[];
|
|
894
873
|
/**
|
|
895
|
-
*
|
|
896
|
-
* Shows loading state, redirects, or fallback when not authenticated
|
|
874
|
+
* Lattice Chat Shell context
|
|
897
875
|
*/
|
|
898
|
-
declare const
|
|
899
|
-
|
|
876
|
+
declare const LatticeChatShellContext: React__default.Context<LatticeChatShellContextValue>;
|
|
900
877
|
/**
|
|
901
|
-
*
|
|
902
|
-
* Uses unified auth styles from design system
|
|
878
|
+
* Props for LatticeChatShellContextProvider
|
|
903
879
|
*/
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
880
|
+
interface LatticeChatShellContextProviderProps {
|
|
881
|
+
/**
|
|
882
|
+
* Children components
|
|
883
|
+
*/
|
|
884
|
+
children: ReactNode;
|
|
885
|
+
/**
|
|
886
|
+
* Initial configuration (optional)
|
|
887
|
+
*/
|
|
888
|
+
initialConfig?: Partial<LatticeChatShellConfig>;
|
|
889
|
+
/**
|
|
890
|
+
* Whether to persist configuration to localStorage (optional, default: false)
|
|
891
|
+
*/
|
|
892
|
+
persistToLocalStorage?: boolean;
|
|
893
|
+
/**
|
|
894
|
+
* LocalStorage key for persisting configuration (optional, default: "lattice_chat_shell_config")
|
|
895
|
+
*/
|
|
896
|
+
localStorageKey?: string;
|
|
921
897
|
}
|
|
922
|
-
|
|
898
|
+
/**
|
|
899
|
+
* Provider component for LatticeChatShellContext
|
|
900
|
+
* Manages Lattice Chat Shell configuration
|
|
901
|
+
*/
|
|
902
|
+
declare const LatticeChatShellContextProvider: ({ children, initialConfig, persistToLocalStorage, localStorageKey, }: LatticeChatShellContextProviderProps) => react_jsx_runtime.JSX.Element;
|
|
903
|
+
/**
|
|
904
|
+
* Hook to access LatticeChatShellContext
|
|
905
|
+
* @returns Lattice Chat Shell context value
|
|
906
|
+
* @throws Error if used outside of LatticeChatShellContextProvider
|
|
907
|
+
*/
|
|
908
|
+
declare const useLatticeChatShellContext: () => LatticeChatShellContextValue;
|
|
923
909
|
|
|
924
|
-
interface
|
|
925
|
-
|
|
926
|
-
token?: string;
|
|
927
|
-
}
|
|
928
|
-
interface UseTenantsReturn {
|
|
929
|
-
tenants: Tenant[];
|
|
910
|
+
interface UseMiddlewareTypesResult {
|
|
911
|
+
middlewareTypes: MiddlewareTypeDefinition[];
|
|
930
912
|
isLoading: boolean;
|
|
931
|
-
|
|
932
|
-
refresh: () => Promise<void>;
|
|
933
|
-
getTenantById: (id: string) => Tenant | undefined;
|
|
913
|
+
isFallback: boolean;
|
|
934
914
|
}
|
|
935
915
|
/**
|
|
936
|
-
*
|
|
916
|
+
* Fetch middleware types from API, fallback to DEFAULT_MIDDLEWARE_TYPES on failure.
|
|
917
|
+
*/
|
|
918
|
+
declare function useMiddlewareTypes(endpoint?: string): UseMiddlewareTypesResult;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Fetches and manages evaluation projects.
|
|
937
922
|
*
|
|
938
|
-
* @
|
|
939
|
-
* @param options.baseURL - The base URL of the API gateway
|
|
940
|
-
* @param options.token - Optional authentication token
|
|
941
|
-
* @returns Tenant list, loading state, error, refresh function, and lookup helper
|
|
923
|
+
* @returns Project list, loading state, error, and CRUD operations
|
|
942
924
|
*
|
|
943
925
|
* @example
|
|
944
926
|
* ```tsx
|
|
945
|
-
* const {
|
|
946
|
-
*
|
|
947
|
-
*
|
|
948
|
-
* });
|
|
927
|
+
* const { projects, loading, create, update, remove, refresh } = useEvalProjects();
|
|
928
|
+
*
|
|
929
|
+
* await create({ name: "My Project" });
|
|
949
930
|
* ```
|
|
950
931
|
*/
|
|
951
|
-
declare function
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
users: _axiom_lattice_protocols.User[];
|
|
959
|
-
isLoading: boolean;
|
|
960
|
-
error: string | null;
|
|
932
|
+
declare function useEvalProjects(): {
|
|
933
|
+
projects: unknown[];
|
|
934
|
+
loading: boolean;
|
|
935
|
+
error: Error | null;
|
|
936
|
+
create: (data: Record<string, unknown>) => Promise<unknown>;
|
|
937
|
+
update: (id: string, patch: Record<string, unknown>) => Promise<void>;
|
|
938
|
+
remove: (id: string) => Promise<void>;
|
|
961
939
|
refresh: () => Promise<void>;
|
|
962
|
-
|
|
963
|
-
|
|
940
|
+
};
|
|
941
|
+
|
|
964
942
|
/**
|
|
965
|
-
* Fetches and manages
|
|
943
|
+
* Fetches and manages evaluation suites within a project.
|
|
966
944
|
*
|
|
967
|
-
* @param
|
|
968
|
-
* @
|
|
969
|
-
* @param options.tenantId - The tenant ID to fetch users for
|
|
970
|
-
* @param options.token - Optional authentication token
|
|
971
|
-
* @returns User list, loading state, error, refresh function, and email search helper
|
|
945
|
+
* @param projectId - The project ID to fetch suites for
|
|
946
|
+
* @returns Suite list, loading state, error, and CRUD operations
|
|
972
947
|
*
|
|
973
948
|
* @example
|
|
974
949
|
* ```tsx
|
|
975
|
-
* const {
|
|
976
|
-
* baseURL: "https://api.example.com",
|
|
977
|
-
* tenantId: "tenant-123",
|
|
978
|
-
* });
|
|
950
|
+
* const { suites, loading, create, remove } = useEvalSuites("proj-123");
|
|
979
951
|
*
|
|
980
|
-
*
|
|
952
|
+
* await create("proj-123", { name: "Accuracy Suite" });
|
|
981
953
|
* ```
|
|
982
954
|
*/
|
|
983
|
-
declare function
|
|
955
|
+
declare function useEvalSuites(projectId: string): {
|
|
956
|
+
suites: unknown[];
|
|
957
|
+
loading: boolean;
|
|
958
|
+
error: Error | null;
|
|
959
|
+
create: (pid: string, data: Record<string, unknown>) => Promise<unknown>;
|
|
960
|
+
update: (pid: string, id: string, patch: Record<string, unknown>) => Promise<void>;
|
|
961
|
+
remove: (pid: string, id: string) => Promise<void>;
|
|
962
|
+
refresh: () => Promise<void>;
|
|
963
|
+
};
|
|
984
964
|
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
965
|
+
/**
|
|
966
|
+
* Fetches and manages evaluation cases within a suite.
|
|
967
|
+
*
|
|
968
|
+
* @param projectId - The project ID the suite belongs to
|
|
969
|
+
* @param suiteId - The suite ID to fetch cases for
|
|
970
|
+
* @returns Case list, loading state, error, and CRUD operations
|
|
971
|
+
*
|
|
972
|
+
* @example
|
|
973
|
+
* ```tsx
|
|
974
|
+
* const { cases, loading, create } = useEvalCases("proj-123", "suite-456");
|
|
975
|
+
*
|
|
976
|
+
* await create("proj-123", "suite-456", { question: "What is 2+2?", answer: "4" });
|
|
977
|
+
* ```
|
|
978
|
+
*/
|
|
979
|
+
declare function useEvalCases(projectId: string, suiteId: string): {
|
|
980
|
+
cases: unknown[];
|
|
981
|
+
loading: boolean;
|
|
994
982
|
error: Error | null;
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
static getDerivedStateFromError(error: Error): Partial<ChatErrorBoundaryState>;
|
|
1001
|
-
componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
|
|
1002
|
-
handleRetry: () => void;
|
|
1003
|
-
handleCopyError: () => void;
|
|
1004
|
-
render(): React__default.ReactNode;
|
|
1005
|
-
}
|
|
983
|
+
create: (pid: string, sid: string, data: Record<string, unknown>) => Promise<unknown>;
|
|
984
|
+
update: (pid: string, sid: string, id: string, patch: Record<string, unknown>) => Promise<void>;
|
|
985
|
+
remove: (pid: string, sid: string, id: string) => Promise<void>;
|
|
986
|
+
refresh: () => Promise<void>;
|
|
987
|
+
};
|
|
1006
988
|
|
|
1007
989
|
/**
|
|
1008
|
-
*
|
|
990
|
+
* Fetches and manages evaluation runs, optionally scoped to a project.
|
|
1009
991
|
*
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
992
|
+
* @param projectId - Optional project ID to filter runs by project
|
|
993
|
+
* @returns Run list, loading state, error, and operations (start, abort, remove)
|
|
994
|
+
*
|
|
995
|
+
* @example
|
|
996
|
+
* ```tsx
|
|
997
|
+
* const { runs, loading, start, abort } = useEvalRuns("proj-123");
|
|
998
|
+
*
|
|
999
|
+
* const result = await start("proj-123");
|
|
1000
|
+
* ```
|
|
1012
1001
|
*/
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
default_submit_message?: string;
|
|
1020
|
-
/** Avatar URL or component for the agent. */
|
|
1021
|
-
avatar?: string;
|
|
1022
|
-
/** Placeholder content rendered inside the attachment upload area. */
|
|
1023
|
-
attachment_placeholder?: React__default.ReactNode;
|
|
1024
|
-
/** Custom upload endpoint URL. Defaults to the workspace or thread sandbox upload endpoint. */
|
|
1025
|
-
uploadAction?: string;
|
|
1026
|
-
/** Quick prompt items displayed between messages. */
|
|
1027
|
-
senderPromptsItems?: GetProp<typeof Prompts, "items">;
|
|
1028
|
-
/** Extra content rendered in the header area. */
|
|
1029
|
-
extra?: React__default.ReactNode;
|
|
1030
|
-
/** Additional metadata items for the header. */
|
|
1031
|
-
extraMeta?: Array<{
|
|
1032
|
-
id: string;
|
|
1002
|
+
declare function useEvalRuns(projectId?: string): {
|
|
1003
|
+
runs: unknown[];
|
|
1004
|
+
loading: boolean;
|
|
1005
|
+
error: Error | null;
|
|
1006
|
+
start: (pid: string) => Promise<{
|
|
1007
|
+
run_id: string;
|
|
1033
1008
|
}>;
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1009
|
+
abort: (runId: string) => Promise<void>;
|
|
1010
|
+
remove: (runId: string) => Promise<void>;
|
|
1011
|
+
refresh: () => Promise<void>;
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* Streams real-time progress of an evaluation run via SSE.
|
|
1016
|
+
*
|
|
1017
|
+
* @param runId - The evaluation run ID to stream, or `null` to disable streaming
|
|
1018
|
+
* @returns Status, progress counters, connection state, and a stop function
|
|
1019
|
+
*
|
|
1020
|
+
* @example
|
|
1021
|
+
* ```tsx
|
|
1022
|
+
* const { status, progress, connected, stopStreaming } = useEvalRunStream("run-789");
|
|
1023
|
+
* // progress: { completed: 5, total: 10, passed: 4, failed: 1 }
|
|
1024
|
+
* ```
|
|
1025
|
+
*/
|
|
1026
|
+
declare function useEvalRunStream(runId: string | null): {
|
|
1027
|
+
status: string;
|
|
1028
|
+
progress: {
|
|
1029
|
+
completed: number;
|
|
1030
|
+
total: number;
|
|
1031
|
+
passed: number;
|
|
1032
|
+
failed: number;
|
|
1033
|
+
};
|
|
1034
|
+
connected: boolean;
|
|
1035
|
+
stopStreaming: () => void;
|
|
1036
|
+
};
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Provider component for the Axiom Lattice client
|
|
1040
|
+
* @param props - Provider props
|
|
1041
|
+
* @returns Provider component
|
|
1042
|
+
*/
|
|
1043
|
+
declare function AxiomLatticeProvider({ config, onUnauthorized, children, }: AxiomLatticeProviderProps): react_jsx_runtime.JSX.Element;
|
|
1044
|
+
interface UseAxiomLatticeOptions {
|
|
1045
|
+
assistantId?: string | null;
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Hook to get a client for a specific assistant
|
|
1049
|
+
* @param assistantId - The assistant ID
|
|
1050
|
+
* @returns Client instance for the assistant
|
|
1051
|
+
* @throws Error if used outside of AxiomLatticeProvider
|
|
1052
|
+
*/
|
|
1053
|
+
declare function useClient(assistantId: string): Client;
|
|
1054
|
+
/**
|
|
1055
|
+
* Hook to access the Axiom Lattice client
|
|
1056
|
+
* @returns The Axiom Lattice client
|
|
1057
|
+
* @throws Error if used outside of AxiomLatticeProvider
|
|
1058
|
+
* @deprecated Use useClient(assistantId) instead
|
|
1059
|
+
*/
|
|
1060
|
+
declare function useAxiomLattice({ assistantId, }?: UseAxiomLatticeOptions): Client;
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Context value for AgentThreadContext
|
|
1064
|
+
*/
|
|
1065
|
+
interface AgentThreadContextValue<T extends UseChatOptions> {
|
|
1066
|
+
state: ChatStateWithAgent;
|
|
1067
|
+
sendMessage: (data: {
|
|
1068
|
+
input?: {
|
|
1069
|
+
message: string;
|
|
1070
|
+
files?: {
|
|
1071
|
+
name: string;
|
|
1072
|
+
id: string;
|
|
1073
|
+
}[];
|
|
1074
|
+
};
|
|
1075
|
+
command?: {
|
|
1076
|
+
resume?: {
|
|
1077
|
+
action: string;
|
|
1078
|
+
data: Record<string, any> & {
|
|
1079
|
+
config?: {
|
|
1080
|
+
thread_id?: string;
|
|
1081
|
+
work_log_id?: string;
|
|
1082
|
+
};
|
|
1083
|
+
};
|
|
1084
|
+
message: string;
|
|
1085
|
+
};
|
|
1086
|
+
update?: any;
|
|
1087
|
+
send?: {
|
|
1088
|
+
node: string;
|
|
1089
|
+
input: any;
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
streaming?: boolean;
|
|
1093
|
+
mode?: 'collect' | 'followup' | 'steer';
|
|
1094
|
+
}) => Promise<void>;
|
|
1095
|
+
stopStreaming: () => void;
|
|
1096
|
+
resumeStream: (messageId?: string) => () => void;
|
|
1097
|
+
loadMessages: (limit?: number) => Promise<void>;
|
|
1098
|
+
clearMessages: () => void;
|
|
1099
|
+
clearError: () => void;
|
|
1100
|
+
customRunConfig: Record<string, any>;
|
|
1101
|
+
updateCustomRunConfig: (config: Record<string, any>) => void;
|
|
1102
|
+
removePendingMessage: (messageId: string) => Promise<boolean>;
|
|
1103
|
+
abortAgent: () => Promise<void>;
|
|
1073
1104
|
}
|
|
1074
1105
|
/**
|
|
1075
|
-
*
|
|
1076
|
-
|
|
1106
|
+
* Props for AgentThreadProvider
|
|
1107
|
+
*/
|
|
1108
|
+
interface AgentThreadProviderProps<T extends UseChatOptions> {
|
|
1109
|
+
threadId: string | null;
|
|
1110
|
+
assistantId?: string;
|
|
1111
|
+
options?: T;
|
|
1112
|
+
children: ReactNode;
|
|
1113
|
+
onToolCompleted?: (toolName: string) => void;
|
|
1114
|
+
onStreamCompleted?: () => void;
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Provider component for AgentThreadContext.
|
|
1118
|
+
* Manages all agent thread state and operations including message streaming, interrupts,
|
|
1119
|
+
* queue management, and agent state polling.
|
|
1077
1120
|
*
|
|
1078
|
-
*
|
|
1079
|
-
* -
|
|
1080
|
-
* -
|
|
1081
|
-
* -
|
|
1082
|
-
* -
|
|
1083
|
-
*
|
|
1084
|
-
* -
|
|
1121
|
+
* @param props - {@link AgentThreadProviderProps}
|
|
1122
|
+
* @param props.threadId - The ID of the thread to manage. If `null`, the provider renders nothing.
|
|
1123
|
+
* @param props.assistantId - The assistant ID to associate with this thread. Falls back to the client's assistant ID if omitted.
|
|
1124
|
+
* @param props.options - Configuration options for chat behavior (streaming, resume stream polling, initial messages, etc.).
|
|
1125
|
+
* @param props.children - React children to render within the thread context.
|
|
1126
|
+
* @param props.onToolCompleted - Callback invoked each time a tool call completes, receiving the tool name.
|
|
1127
|
+
* @param props.onStreamCompleted - Callback invoked when the SSE stream completes for any message.
|
|
1085
1128
|
*
|
|
1086
|
-
* @
|
|
1087
|
-
|
|
1129
|
+
* @returns A React context provider wrapping children with {@link AgentThreadContext.Provider}, or `null` if no `threadId` is provided.
|
|
1130
|
+
*/
|
|
1131
|
+
declare function AgentThreadProvider<T extends UseChatOptions>({ threadId, assistantId, options, children, onToolCompleted, onStreamCompleted, }: AgentThreadProviderProps<T>): react_jsx_runtime.JSX.Element | null;
|
|
1132
|
+
/**
|
|
1133
|
+
* Hook to access AgentThreadContext.
|
|
1134
|
+
*
|
|
1135
|
+
* @param T - The {@link UseChatOptions} type parameter, allowing typed access to options.
|
|
1136
|
+
* @returns Agent thread context value of type {@link AgentThreadContextValue}.
|
|
1137
|
+
* @throws {Error} If used outside of an {@link AgentThreadProvider}.
|
|
1088
1138
|
*
|
|
1089
1139
|
* @example
|
|
1090
1140
|
* ```tsx
|
|
1091
|
-
*
|
|
1141
|
+
* const { state, sendMessage, stopStreaming, abortAgent } = useAgentThreadContext();
|
|
1092
1142
|
*
|
|
1093
|
-
*
|
|
1094
|
-
* name="Data Analyst"
|
|
1095
|
-
* showHeader
|
|
1096
|
-
* showSender
|
|
1097
|
-
* showModelSelector
|
|
1098
|
-
* emptyStateQuestion="What data would you like to analyze?"
|
|
1099
|
-
* systemContext="You are analyzing sales data from Q4 2024."
|
|
1100
|
-
* />
|
|
1143
|
+
* await sendMessage({ input: { message: 'Hello!' } });
|
|
1101
1144
|
* ```
|
|
1102
|
-
*
|
|
1103
|
-
* @remarks
|
|
1104
|
-
* - Requires the following ancestor context providers: {@link AgentThreadProvider},
|
|
1105
|
-
* {@link ChatUIContextProvider}, {@link LatticeChatShellContextProvider},
|
|
1106
|
-
* {@link ConversationContextProvider}, {@link AssistantContextProvider}.
|
|
1107
|
-
* - Prop-level feature toggles (e.g. `showModelSelector`) take priority over
|
|
1108
|
-
* shell-config-level toggles.
|
|
1109
|
-
* - Uses {@link useAgentChat} for all agent communication.
|
|
1110
1145
|
*/
|
|
1111
|
-
declare
|
|
1146
|
+
declare function useAgentThreadContext<T extends UseChatOptions>(): AgentThreadContextValue<T>;
|
|
1112
1147
|
|
|
1148
|
+
interface UserTenantInfo {
|
|
1149
|
+
tenantId: string;
|
|
1150
|
+
role: string;
|
|
1151
|
+
tenant?: Tenant;
|
|
1152
|
+
}
|
|
1153
|
+
interface PersonalAssistantInfo {
|
|
1154
|
+
assistantId: string;
|
|
1155
|
+
projectId: string;
|
|
1156
|
+
workspaceId: string;
|
|
1157
|
+
/** tenantId for debugging cross-tenant leakage */
|
|
1158
|
+
tenantId?: string | null;
|
|
1159
|
+
}
|
|
1160
|
+
interface AuthContextValue {
|
|
1161
|
+
user: User | null;
|
|
1162
|
+
tenants: UserTenantInfo[];
|
|
1163
|
+
currentTenant: Tenant | null;
|
|
1164
|
+
personalAssistant: PersonalAssistantInfo | null;
|
|
1165
|
+
setPersonalAssistant: (info: PersonalAssistantInfo | null) => void;
|
|
1166
|
+
isAuthenticated: boolean;
|
|
1167
|
+
isLoading: boolean;
|
|
1168
|
+
error: string | null;
|
|
1169
|
+
login: (email: string, password: string) => Promise<{
|
|
1170
|
+
requiresTenantSelection: boolean;
|
|
1171
|
+
hasTenants: boolean;
|
|
1172
|
+
}>;
|
|
1173
|
+
register: (email: string, password: string, name: string) => Promise<{
|
|
1174
|
+
message: string;
|
|
1175
|
+
token?: string;
|
|
1176
|
+
}>;
|
|
1177
|
+
logout: () => void;
|
|
1178
|
+
selectTenant: (tenantId: string) => Promise<void>;
|
|
1179
|
+
fetchUserTenants: () => Promise<void>;
|
|
1180
|
+
refreshUser: () => Promise<void>;
|
|
1181
|
+
clearError: () => void;
|
|
1182
|
+
changePassword: (currentPassword: string, newPassword: string) => Promise<void>;
|
|
1183
|
+
}
|
|
1113
1184
|
/**
|
|
1114
|
-
*
|
|
1185
|
+
* Hook to access authentication context. Must be used within an {@link AuthProvider}.
|
|
1115
1186
|
*
|
|
1116
|
-
*
|
|
1117
|
-
* and
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
/** The ID of the currently active thread. If absent, a placeholder is shown prompting users to create a conversation. */
|
|
1121
|
-
thread_id?: string;
|
|
1122
|
-
/** The assistant ID that backs the chat. Required — feeds the {@link AgentThreadProvider}. */
|
|
1123
|
-
assistant_id: string;
|
|
1124
|
-
/** Optional menu rendered in the left sidebar column. */
|
|
1125
|
-
menu?: React__default.ReactNode;
|
|
1126
|
-
/** Optional header rendered above the main chat area. */
|
|
1127
|
-
header?: React__default.ReactNode;
|
|
1128
|
-
/** Optional right-side header content. Replaces the default folder toggle button. Use {@link FilePanelToggle} to include it. */
|
|
1129
|
-
headerRight?: React__default.ReactNode;
|
|
1130
|
-
/** Show workspace project selector in header. Default true. */
|
|
1131
|
-
showProjectSelector?: boolean;
|
|
1132
|
-
/** Content shown when no thread is active. Default: "Please create a conversation first". */
|
|
1133
|
-
emptyPlaceholder?: React__default.ReactNode;
|
|
1134
|
-
} & ChatingProps;
|
|
1135
|
-
/**
|
|
1136
|
-
* Top-level chat component for a single assistant thread.
|
|
1187
|
+
* @description
|
|
1188
|
+
* Provides the full auth state and all auth operations (login, register, logout, tenant selection, etc.).
|
|
1189
|
+
* Throws an error if no {@link AuthProvider} is found in the component tree. For optional auth,
|
|
1190
|
+
* use {@link useAuthOptional} instead.
|
|
1137
1191
|
*
|
|
1138
|
-
*
|
|
1139
|
-
* - {@link AgentThreadProvider} for thread state
|
|
1140
|
-
* - {@link ChatUIContextProvider} for UI panel toggles
|
|
1141
|
-
* - A responsive {@link ColumnLayout} with menu, main chat, detail panel, and tools panel
|
|
1192
|
+
* @returns The current {@link AuthContextValue} containing user, tenants, auth state, and auth actions.
|
|
1142
1193
|
*
|
|
1143
|
-
*
|
|
1194
|
+
* @throws {Error} If used outside of an {@link AuthProvider}.
|
|
1144
1195
|
*
|
|
1145
1196
|
* @example
|
|
1146
1197
|
* ```tsx
|
|
1147
|
-
*
|
|
1198
|
+
* const { user, isAuthenticated, login, logout } = useAuth();
|
|
1148
1199
|
*
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
*
|
|
1154
|
-
*
|
|
1200
|
+
* const handleLogin = async () => {
|
|
1201
|
+
* const result = await login('user@example.com', 'password');
|
|
1202
|
+
* if (result.requiresTenantSelection) {
|
|
1203
|
+
* // Show tenant picker
|
|
1204
|
+
* }
|
|
1205
|
+
* };
|
|
1155
1206
|
* ```
|
|
1156
|
-
*
|
|
1157
|
-
* @remarks
|
|
1158
|
-
* - Requires a parent `<LatticeChatShell>` for shell-level configuration (API URL, feature toggles).
|
|
1159
|
-
* - The `ChatingProps` are forwarded to the internal {@link Chating} component.
|
|
1160
|
-
*/
|
|
1161
|
-
declare const LatticeChat: React__default.FC<AgentChatProps>;
|
|
1162
|
-
|
|
1163
|
-
/**
|
|
1164
|
-
* Model runtime configuration passed to the agent when a model is selected.
|
|
1165
1207
|
*/
|
|
1166
|
-
|
|
1167
|
-
/** The model key as registered on the server (e.g., "gpt-4o"). */
|
|
1168
|
-
modelKey: string;
|
|
1169
|
-
/** Sampling temperature (0-2). Higher values produce more random output. */
|
|
1170
|
-
temperature?: number;
|
|
1171
|
-
/** Maximum tokens in the generated response. */
|
|
1172
|
-
maxTokens?: number;
|
|
1173
|
-
/** Nucleus sampling parameter (0-1). */
|
|
1174
|
-
topP?: number;
|
|
1175
|
-
/** Penalty for repeating tokens (-2 to 2). */
|
|
1176
|
-
frequencyPenalty?: number;
|
|
1177
|
-
/** Penalty for introducing new topics (-2 to 2). */
|
|
1178
|
-
presencePenalty?: number;
|
|
1179
|
-
}
|
|
1208
|
+
declare const useAuth: () => AuthContextValue;
|
|
1180
1209
|
/**
|
|
1181
|
-
*
|
|
1210
|
+
* Optional version of useAuth that returns null instead of throwing when AuthProvider is not present.
|
|
1211
|
+
* Use this when authentication is optional for the component.
|
|
1212
|
+
*
|
|
1213
|
+
* @example
|
|
1214
|
+
* // For required auth - throws if no provider
|
|
1215
|
+
* const { user } = useAuth();
|
|
1216
|
+
*
|
|
1217
|
+
* // For optional auth - returns null if no provider
|
|
1218
|
+
* const user = useAuthOptional()?.user;
|
|
1182
1219
|
*/
|
|
1183
|
-
|
|
1184
|
-
/** Unique model key (used as the selection value). */
|
|
1185
|
-
key: string;
|
|
1186
|
-
/** Provider identifier (e.g., "openai", "azure"). */
|
|
1187
|
-
provider: string;
|
|
1188
|
-
/** Model name as known by the provider (e.g., "gpt-4o"). */
|
|
1189
|
-
model: string;
|
|
1190
|
-
/** Human-readable display name for the dropdown. */
|
|
1191
|
-
displayName?: string;
|
|
1192
|
-
}
|
|
1220
|
+
declare const useAuthOptional: () => AuthContextValue | null;
|
|
1193
1221
|
/**
|
|
1194
|
-
* Props for
|
|
1222
|
+
* Props for {@link AuthProvider}.
|
|
1195
1223
|
*/
|
|
1196
|
-
interface
|
|
1197
|
-
/**
|
|
1198
|
-
|
|
1199
|
-
/**
|
|
1200
|
-
|
|
1201
|
-
/**
|
|
1202
|
-
|
|
1203
|
-
/**
|
|
1204
|
-
|
|
1224
|
+
interface AuthProviderProps {
|
|
1225
|
+
/** Child components that will have access to the auth context. */
|
|
1226
|
+
children: ReactNode;
|
|
1227
|
+
/** Base URL of the gateway API (e.g., `http://localhost:3000`). */
|
|
1228
|
+
baseURL: string;
|
|
1229
|
+
/** Called after a successful login with the user and their tenant memberships. */
|
|
1230
|
+
onLoginSuccess?: (user: User, tenants: UserTenantInfo[]) => void;
|
|
1231
|
+
/** Called after a tenant is successfully selected, passing the selected tenant. */
|
|
1232
|
+
onTenantSelected?: (tenant: Tenant) => void;
|
|
1233
|
+
/** Called after the user logs out. */
|
|
1234
|
+
onLogout?: () => void;
|
|
1205
1235
|
}
|
|
1206
1236
|
/**
|
|
1207
|
-
*
|
|
1237
|
+
* Authentication context provider. Wraps the application to provide auth state and operations
|
|
1238
|
+
* to all descendant components via {@link useAuth} and {@link useAuthOptional}.
|
|
1208
1239
|
*
|
|
1209
|
-
*
|
|
1210
|
-
*
|
|
1211
|
-
*
|
|
1212
|
-
*
|
|
1240
|
+
* @description
|
|
1241
|
+
* Manages the full authentication lifecycle including:
|
|
1242
|
+
* - **Login / Register**: Sends credentials to the gateway API and stores the returned user, tenants, and token in `sessionStorage`.
|
|
1243
|
+
* - **Session restoration**: On mount, reads previously stored user data from `sessionStorage` and also refreshes the tenant list to catch any admin-side role assignments.
|
|
1244
|
+
* - **Tenant selection**: Calls the gateway API to select a tenant and stores the tenant data.
|
|
1245
|
+
* - **Logout**: Clears all auth state and `sessionStorage`.
|
|
1246
|
+
* - **Change password**: Proxies to the gateway password change endpoint.
|
|
1247
|
+
* - **Token expiration**: Automatically logs out when the gateway returns a 401 with an expired token message.
|
|
1213
1248
|
*
|
|
1214
|
-
* @param
|
|
1215
|
-
* @param
|
|
1216
|
-
* @param
|
|
1217
|
-
* @param
|
|
1218
|
-
* @
|
|
1249
|
+
* @param props - {@link AuthProviderProps}
|
|
1250
|
+
* @param props.children - React children to render within the auth context.
|
|
1251
|
+
* @param props.baseURL - Base URL of the gateway API.
|
|
1252
|
+
* @param props.onLoginSuccess - Optional callback invoked after a successful login.
|
|
1253
|
+
* @param props.onTenantSelected - Optional callback invoked after tenant selection.
|
|
1254
|
+
* @param props.onLogout - Optional callback invoked on logout.
|
|
1255
|
+
*
|
|
1256
|
+
* @returns A React context provider wrapping children with {@link AuthContext.Provider}.
|
|
1219
1257
|
*
|
|
1220
1258
|
* @example
|
|
1221
1259
|
* ```tsx
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1225
|
-
*
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
1228
|
-
*
|
|
1260
|
+
* <AuthProvider
|
|
1261
|
+
* baseURL="http://localhost:3000"
|
|
1262
|
+
* onLoginSuccess={(user) => console.log('Logged in:', user.email)}
|
|
1263
|
+
* onLogout={() => window.location.reload()}
|
|
1264
|
+
* >
|
|
1265
|
+
* <App />
|
|
1266
|
+
* </AuthProvider>
|
|
1229
1267
|
* ```
|
|
1230
|
-
*
|
|
1231
|
-
* @remarks
|
|
1232
|
-
* - Supports both controlled (`value` prop) and uncontrolled (internal state) usage.
|
|
1233
|
-
* - Fetch is performed only once per component mount via a ref guard.
|
|
1234
|
-
* - The dropdown is intentionally borderless to blend into the sender footer.
|
|
1235
1268
|
*/
|
|
1236
|
-
declare const
|
|
1237
|
-
|
|
1238
|
-
declare const MDResponse: React__default.MemoExoticComponent<({ content, context, embeddedLink, interactive, userData, noGenUI, }: {
|
|
1239
|
-
context?: any;
|
|
1240
|
-
content: string;
|
|
1241
|
-
embeddedLink?: boolean;
|
|
1242
|
-
interactive?: boolean;
|
|
1243
|
-
userData?: any;
|
|
1244
|
-
noGenUI?: boolean;
|
|
1245
|
-
}) => react_jsx_runtime.JSX.Element>;
|
|
1246
|
-
declare const MDViewFormItem: ({ value }: {
|
|
1247
|
-
value?: string;
|
|
1248
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
1269
|
+
declare const AuthProvider: React__default.FC<AuthProviderProps>;
|
|
1249
1270
|
|
|
1250
1271
|
/**
|
|
1251
|
-
*
|
|
1252
|
-
*
|
|
1253
|
-
* Each element registered in the GenUI element registry receives these props,
|
|
1254
|
-
* with the `data` field carrying the element-specific payload from the agent.
|
|
1255
|
-
*
|
|
1256
|
-
* @typeParam T - The shape of the element-specific data payload
|
|
1272
|
+
* Login Form Components
|
|
1273
|
+
* Uses base styles from design system
|
|
1257
1274
|
*/
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
+
|
|
1276
|
+
interface LoginFormProps {
|
|
1277
|
+
onSuccess?: () => void;
|
|
1278
|
+
onCancel?: () => void;
|
|
1279
|
+
logo?: React__default.ReactNode;
|
|
1280
|
+
title?: string;
|
|
1281
|
+
subtitle?: string;
|
|
1282
|
+
footer?: React__default.ReactNode;
|
|
1283
|
+
className?: string;
|
|
1284
|
+
}
|
|
1285
|
+
declare const LoginForm: React__default.FC<LoginFormProps>;
|
|
1286
|
+
declare const LoginPage: React__default.FC<any>;
|
|
1287
|
+
interface RegisterFormProps {
|
|
1288
|
+
onSuccess?: () => void;
|
|
1289
|
+
onCancel?: () => void;
|
|
1290
|
+
logo?: React__default.ReactNode;
|
|
1291
|
+
title?: string;
|
|
1292
|
+
subtitle?: string;
|
|
1293
|
+
footer?: React__default.ReactNode;
|
|
1294
|
+
className?: string;
|
|
1295
|
+
}
|
|
1296
|
+
declare const RegisterForm: React__default.FC<RegisterFormProps>;
|
|
1297
|
+
|
|
1275
1298
|
/**
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
* Defines how an element is rendered and optionally what action to perform
|
|
1279
|
-
* when the user interacts with it.
|
|
1299
|
+
* User Profile Components
|
|
1300
|
+
* Using Axiom Theme with Ant Design
|
|
1280
1301
|
*/
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1302
|
+
|
|
1303
|
+
interface UserProfileProps {
|
|
1304
|
+
/** Called when user clicks logout */
|
|
1305
|
+
onLogout?: () => void;
|
|
1306
|
+
/** Show tenant information */
|
|
1307
|
+
showTenantSwitcher?: boolean;
|
|
1308
|
+
/** Custom class name */
|
|
1309
|
+
className?: string;
|
|
1288
1310
|
}
|
|
1289
1311
|
/**
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1292
|
-
* Rendered by GenUI tool card elements to display tool invocations,
|
|
1293
|
-
* their arguments, and their results.
|
|
1312
|
+
* User Profile Component
|
|
1294
1313
|
*/
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
/**
|
|
1299
|
-
|
|
1300
|
-
/**
|
|
1301
|
-
|
|
1302
|
-
/** Distinguishes tool calls from other message types */
|
|
1303
|
-
type: "tool_call";
|
|
1304
|
-
/** The tool's response, if available */
|
|
1305
|
-
response?: string;
|
|
1306
|
-
/** Execution status of the tool call */
|
|
1307
|
-
status?: "success" | "pending" | "error";
|
|
1314
|
+
declare const UserProfile: React__default.FC<UserProfileProps>;
|
|
1315
|
+
interface ProtectedRouteProps {
|
|
1316
|
+
children: React__default.ReactNode;
|
|
1317
|
+
/** Component to show when not authenticated */
|
|
1318
|
+
fallback?: React__default.ReactNode;
|
|
1319
|
+
/** Redirect URL (if using react-router) */
|
|
1320
|
+
redirectTo?: string;
|
|
1308
1321
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1322
|
+
/**
|
|
1323
|
+
* Protected Route Component
|
|
1324
|
+
* Shows loading state, redirects, or fallback when not authenticated
|
|
1325
|
+
*/
|
|
1326
|
+
declare const ProtectedRoute: React__default.FC<ProtectedRouteProps>;
|
|
1312
1327
|
|
|
1313
1328
|
/**
|
|
1314
|
-
*
|
|
1315
|
-
*
|
|
1316
|
-
* Manages a tab strip of registered side-app views. When a new component is
|
|
1317
|
-
* selected via {@link SideAppBrowserContext}, a tab is added (or activated if
|
|
1318
|
-
* it already exists). Tabs are closable and switchable. An "all tabs" dropdown
|
|
1319
|
-
* appears when there are 2+ tabs. Uses {@link ChatUIContext} to read/write the
|
|
1320
|
-
* active side-app card and open/close the panel.
|
|
1321
|
-
*
|
|
1322
|
-
* @param region - Which panel region this browser is attached to.
|
|
1323
|
-
* `"side"` for the right detail panel (default), `"content"` for the main content area.
|
|
1324
|
-
* @returns The tabbed side-app viewer, or an empty state if no tabs are open.
|
|
1325
|
-
*
|
|
1326
|
-
* @example
|
|
1327
|
-
* ```tsx
|
|
1328
|
-
* import { SideAppViewBrowser } from "@axiom-lattice/react-sdk";
|
|
1329
|
-
*
|
|
1330
|
-
* <SideAppViewBrowser region="side" />
|
|
1331
|
-
* ```
|
|
1332
|
-
*
|
|
1333
|
-
* @remarks
|
|
1334
|
-
* - Internally renders {@link SideAppBrowserContext.Provider} so that child
|
|
1335
|
-
* components can programmatically open new side-apps via `openApp()`.
|
|
1336
|
-
* - Component resolution uses {@link getElement} from the GenUI element registry.
|
|
1337
|
-
* - Designed to work with {@link ColumnLayout} as the `detail` panel.
|
|
1329
|
+
* Tenant Selector Components
|
|
1330
|
+
* Uses unified auth styles from design system
|
|
1338
1331
|
*/
|
|
1339
|
-
declare const SideAppViewBrowser: React__default.FC<{
|
|
1340
|
-
region?: "side" | "content";
|
|
1341
|
-
}>;
|
|
1342
1332
|
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
setSideAppVisible: (visible: boolean) => void;
|
|
1374
|
-
sideAppSize: "small" | "middle" | "large" | "full";
|
|
1375
|
-
setSideAppSize: (size: "small" | "middle" | "large" | "full") => void;
|
|
1376
|
-
sideAppSelectedCard: PanelCard | null;
|
|
1377
|
-
setSideAppSelectedCard: (card: PanelCard | null) => void;
|
|
1378
|
-
openSideApp: (card: PanelCard) => void;
|
|
1379
|
-
closeSideApp: () => void;
|
|
1380
|
-
menuCollapsed: boolean | undefined;
|
|
1381
|
-
setMenuCollapsed: (collapsed: boolean) => void;
|
|
1382
|
-
openContentApp: (card: PanelCard) => void;
|
|
1383
|
-
closeContentApp: () => void;
|
|
1384
|
-
contentAppVisible: boolean;
|
|
1385
|
-
setcontentAppVisible: (visible: boolean) => void;
|
|
1386
|
-
contentAppSelectedCard: PanelCard | null;
|
|
1387
|
-
setContentAppSelectedCard: (card: PanelCard | null) => void;
|
|
1388
|
-
}>;
|
|
1333
|
+
interface TenantSelectorProps {
|
|
1334
|
+
tenants: Tenant[];
|
|
1335
|
+
currentTenantId?: string | null;
|
|
1336
|
+
onSelect: (tenant: Tenant) => void;
|
|
1337
|
+
onLogout?: () => void;
|
|
1338
|
+
isLoading?: boolean;
|
|
1339
|
+
className?: string;
|
|
1340
|
+
title?: string;
|
|
1341
|
+
description?: string;
|
|
1342
|
+
}
|
|
1343
|
+
declare const TenantSelector: React__default.FC<TenantSelectorProps>;
|
|
1344
|
+
|
|
1345
|
+
interface ChangePasswordModalProps {
|
|
1346
|
+
open: boolean;
|
|
1347
|
+
onClose: () => void;
|
|
1348
|
+
onSuccess?: () => void;
|
|
1349
|
+
}
|
|
1350
|
+
declare const ChangePasswordModal: React__default.FC<ChangePasswordModalProps>;
|
|
1351
|
+
|
|
1352
|
+
interface UseTenantsOptions {
|
|
1353
|
+
baseURL: string;
|
|
1354
|
+
token?: string;
|
|
1355
|
+
}
|
|
1356
|
+
interface UseTenantsReturn {
|
|
1357
|
+
tenants: Tenant[];
|
|
1358
|
+
isLoading: boolean;
|
|
1359
|
+
error: string | null;
|
|
1360
|
+
refresh: () => Promise<void>;
|
|
1361
|
+
getTenantById: (id: string) => Tenant | undefined;
|
|
1362
|
+
}
|
|
1389
1363
|
/**
|
|
1390
|
-
*
|
|
1391
|
-
* (detail, tools, side app, content app) and the sidebar menu collapsed state.
|
|
1392
|
-
*
|
|
1393
|
-
* @description
|
|
1394
|
-
* Tracks the open/closed state and the currently selected {@link PanelCard} for each panel:
|
|
1395
|
-
* - **Detail panel**: A slide-out detail view that displays a chosen card's content.
|
|
1396
|
-
* - **Tools panel**: A tools sidebar/drawer for tool-specific cards.
|
|
1397
|
-
* - **Side app**: Aliases to the detail panel (shared state).
|
|
1398
|
-
* - **Content app**: An inline content area for embedded app cards.
|
|
1399
|
-
* - **Menu collapsed**: Whether the sidebar navigation menu is collapsed.
|
|
1400
|
-
*
|
|
1401
|
-
* Provides action helpers (`openDetail`, `closeDetail`, `openTools`, `toggleTools`, etc.)
|
|
1402
|
-
* that set both visibility and selected card atomically.
|
|
1403
|
-
*
|
|
1404
|
-
* @param props - Provider props.
|
|
1405
|
-
* @param props.children - React children to render within the UI context.
|
|
1364
|
+
* Fetches and manages a list of tenants from the API.
|
|
1406
1365
|
*
|
|
1407
|
-
* @
|
|
1366
|
+
* @param options - Configuration options
|
|
1367
|
+
* @param options.baseURL - The base URL of the API gateway
|
|
1368
|
+
* @param options.token - Optional authentication token
|
|
1369
|
+
* @returns Tenant list, loading state, error, refresh function, and lookup helper
|
|
1408
1370
|
*
|
|
1409
1371
|
* @example
|
|
1410
1372
|
* ```tsx
|
|
1411
|
-
*
|
|
1412
|
-
*
|
|
1413
|
-
*
|
|
1373
|
+
* const { tenants, isLoading, error, refresh, getTenantById } = useTenants({
|
|
1374
|
+
* baseURL: "https://api.example.com",
|
|
1375
|
+
* token: "your-auth-token",
|
|
1376
|
+
* });
|
|
1414
1377
|
* ```
|
|
1415
1378
|
*/
|
|
1416
|
-
declare
|
|
1417
|
-
|
|
1418
|
-
|
|
1379
|
+
declare function useTenants(options: UseTenantsOptions): UseTenantsReturn;
|
|
1380
|
+
interface UseUsersOptions {
|
|
1381
|
+
baseURL: string;
|
|
1382
|
+
tenantId: string;
|
|
1383
|
+
token?: string;
|
|
1384
|
+
}
|
|
1385
|
+
interface UseUsersReturn {
|
|
1386
|
+
users: _axiom_lattice_protocols.User[];
|
|
1387
|
+
isLoading: boolean;
|
|
1388
|
+
error: string | null;
|
|
1389
|
+
refresh: () => Promise<void>;
|
|
1390
|
+
searchByEmail: (email: string) => Promise<_axiom_lattice_protocols.User | null>;
|
|
1391
|
+
}
|
|
1419
1392
|
/**
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1422
|
-
* @description
|
|
1423
|
-
* Returns panel visibility state, selected panel cards, and action functions for controlling
|
|
1424
|
-
* the chat interface panels (detail, tools, side app, content app) and menu collapsed state.
|
|
1393
|
+
* Fetches and manages a list of users within a tenant.
|
|
1425
1394
|
*
|
|
1426
|
-
* @
|
|
1395
|
+
* @param options - Configuration options
|
|
1396
|
+
* @param options.baseURL - The base URL of the API gateway
|
|
1397
|
+
* @param options.tenantId - The tenant ID to fetch users for
|
|
1398
|
+
* @param options.token - Optional authentication token
|
|
1399
|
+
* @returns User list, loading state, error, refresh function, and email search helper
|
|
1427
1400
|
*
|
|
1428
1401
|
* @example
|
|
1429
1402
|
* ```tsx
|
|
1430
|
-
* const {
|
|
1403
|
+
* const { users, isLoading, error, searchByEmail } = useUsers({
|
|
1404
|
+
* baseURL: "https://api.example.com",
|
|
1405
|
+
* tenantId: "tenant-123",
|
|
1406
|
+
* });
|
|
1431
1407
|
*
|
|
1432
|
-
* const
|
|
1433
|
-
* openDetail(card);
|
|
1434
|
-
* };
|
|
1408
|
+
* const user = await searchByEmail("user@example.com");
|
|
1435
1409
|
* ```
|
|
1436
1410
|
*/
|
|
1437
|
-
declare
|
|
1438
|
-
detailVisible: boolean;
|
|
1439
|
-
setDetailVisible: (visible: boolean) => void;
|
|
1440
|
-
detailSize: "small" | "middle" | "large" | "full";
|
|
1441
|
-
setDetailSize: (size: "small" | "middle" | "large" | "full") => void;
|
|
1442
|
-
detailSelectedCard: PanelCard | null;
|
|
1443
|
-
setDetailSelectedCard: (card: PanelCard | null) => void;
|
|
1444
|
-
openDetail: (card: PanelCard) => void;
|
|
1445
|
-
closeDetail: () => void;
|
|
1446
|
-
toolsVisible: boolean;
|
|
1447
|
-
setToolsVisible: (visible: boolean) => void;
|
|
1448
|
-
toggleTools: () => void;
|
|
1449
|
-
toolSelectedCard: PanelCard | null;
|
|
1450
|
-
setToolSelectedCard: (card: PanelCard | null) => void;
|
|
1451
|
-
openTools: (card: PanelCard) => void;
|
|
1452
|
-
closeTools: () => void;
|
|
1453
|
-
sideAppVisible: boolean;
|
|
1454
|
-
setSideAppVisible: (visible: boolean) => void;
|
|
1455
|
-
sideAppSize: "small" | "middle" | "large" | "full";
|
|
1456
|
-
setSideAppSize: (size: "small" | "middle" | "large" | "full") => void;
|
|
1457
|
-
sideAppSelectedCard: PanelCard | null;
|
|
1458
|
-
setSideAppSelectedCard: (card: PanelCard | null) => void;
|
|
1459
|
-
openSideApp: (card: PanelCard) => void;
|
|
1460
|
-
closeSideApp: () => void;
|
|
1461
|
-
menuCollapsed: boolean | undefined;
|
|
1462
|
-
setMenuCollapsed: (collapsed: boolean) => void;
|
|
1463
|
-
openContentApp: (card: PanelCard) => void;
|
|
1464
|
-
closeContentApp: () => void;
|
|
1465
|
-
contentAppVisible: boolean;
|
|
1466
|
-
setcontentAppVisible: (visible: boolean) => void;
|
|
1467
|
-
contentAppSelectedCard: PanelCard | null;
|
|
1468
|
-
setContentAppSelectedCard: (card: PanelCard | null) => void;
|
|
1469
|
-
};
|
|
1411
|
+
declare function useUsers(options: UseUsersOptions): UseUsersReturn;
|
|
1470
1412
|
|
|
1471
|
-
interface
|
|
1472
|
-
|
|
1413
|
+
interface ChatErrorBoundaryProps {
|
|
1414
|
+
/** Display name for this boundary (shown in error messages) */
|
|
1415
|
+
name?: string;
|
|
1416
|
+
children: React__default.ReactNode;
|
|
1417
|
+
fallback?: React__default.ReactNode;
|
|
1418
|
+
onError?: (error: Error, errorInfo: React__default.ErrorInfo) => void;
|
|
1473
1419
|
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1420
|
+
interface ChatErrorBoundaryState {
|
|
1421
|
+
hasError: boolean;
|
|
1422
|
+
error: Error | null;
|
|
1423
|
+
errorInfo: React__default.ErrorInfo | null;
|
|
1424
|
+
retryKey: number;
|
|
1425
|
+
}
|
|
1426
|
+
declare class ChatErrorBoundary extends Component<ChatErrorBoundaryProps, ChatErrorBoundaryState> {
|
|
1427
|
+
constructor(props: ChatErrorBoundaryProps);
|
|
1428
|
+
static getDerivedStateFromError(error: Error): Partial<ChatErrorBoundaryState>;
|
|
1429
|
+
componentDidCatch(error: Error, errorInfo: React__default.ErrorInfo): void;
|
|
1430
|
+
handleRetry: () => void;
|
|
1431
|
+
handleCopyError: () => void;
|
|
1432
|
+
render(): React__default.ReactNode;
|
|
1486
1433
|
}
|
|
1434
|
+
|
|
1487
1435
|
/**
|
|
1488
|
-
*
|
|
1436
|
+
* Props for the {@link Chating} component — the core chat interface.
|
|
1437
|
+
*
|
|
1438
|
+
* Controls appearance, sender behavior, empty-state customization, and
|
|
1439
|
+
* optional context injection for the agent.
|
|
1489
1440
|
*/
|
|
1490
|
-
interface
|
|
1491
|
-
/**
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
/**
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
/**
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
/**
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
/**
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
/**
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
/**
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
/**
|
|
1520
|
-
* Select a thread by ID
|
|
1521
|
-
*/
|
|
1522
|
-
selectThread: (threadId: string) => void;
|
|
1523
|
-
/**
|
|
1524
|
-
* Create a new thread for the current assistant
|
|
1525
|
-
*/
|
|
1526
|
-
createThread: (label?: string) => Promise<ConversationThread>;
|
|
1527
|
-
/**
|
|
1528
|
-
* List all threads for the current assistant
|
|
1529
|
-
*/
|
|
1530
|
-
listThreads: () => Promise<ConversationThread[]>;
|
|
1531
|
-
/**
|
|
1532
|
-
* Update thread for the current assistant
|
|
1533
|
-
*/
|
|
1534
|
-
updateThread: (thread: ConversationThread) => Promise<void>;
|
|
1535
|
-
/**
|
|
1536
|
-
* Get thread by ID
|
|
1537
|
-
*/
|
|
1538
|
-
getThreadById: (threadId: string) => ConversationThread | null;
|
|
1539
|
-
/**
|
|
1540
|
-
* Delete a thread by ID
|
|
1541
|
-
*/
|
|
1542
|
-
deleteThread: (threadId: string) => Promise<void>;
|
|
1543
|
-
/**
|
|
1544
|
-
* Clear the current thread
|
|
1545
|
-
*/
|
|
1546
|
-
clearThread: () => void;
|
|
1547
|
-
/**
|
|
1548
|
-
* Refresh threads for the current assistant
|
|
1549
|
-
*/
|
|
1550
|
-
refresh: () => Promise<void>;
|
|
1551
|
-
/**
|
|
1552
|
-
* Custom run configuration (cross-thread, assistant-level)
|
|
1553
|
-
* Used for metrics datasource and other assistant-wide settings
|
|
1554
|
-
*/
|
|
1555
|
-
customRunConfig: Record<string, any>;
|
|
1441
|
+
interface ChatingProps {
|
|
1442
|
+
/** Agent display name shown in the header. */
|
|
1443
|
+
name?: string;
|
|
1444
|
+
/** Agent description shown in the header. */
|
|
1445
|
+
description?: string;
|
|
1446
|
+
/** Fallback message used when the user submits only attachments without text. */
|
|
1447
|
+
default_submit_message?: string;
|
|
1448
|
+
/** Avatar URL or component for the agent. */
|
|
1449
|
+
avatar?: string;
|
|
1450
|
+
/** Placeholder content rendered inside the attachment upload area. */
|
|
1451
|
+
attachment_placeholder?: React__default.ReactNode;
|
|
1452
|
+
/** Custom upload endpoint URL. Defaults to the workspace or thread sandbox upload endpoint. */
|
|
1453
|
+
uploadAction?: string;
|
|
1454
|
+
/** Quick prompt items displayed between messages. */
|
|
1455
|
+
senderPromptsItems?: GetProp<typeof Prompts, "items">;
|
|
1456
|
+
/** Extra content rendered in the header area. */
|
|
1457
|
+
extra?: React__default.ReactNode;
|
|
1458
|
+
/** Additional metadata items for the header. */
|
|
1459
|
+
extraMeta?: Array<{
|
|
1460
|
+
id: string;
|
|
1461
|
+
}>;
|
|
1462
|
+
/** Whether to show the agent header bar. Default: true. */
|
|
1463
|
+
showHeader?: boolean;
|
|
1464
|
+
/** Whether to show the message sender input. Default: true. */
|
|
1465
|
+
showSender?: boolean;
|
|
1466
|
+
/** Whether to show the Human-in-the-Loop (HITL) container. Default: true. */
|
|
1467
|
+
showHITL?: boolean;
|
|
1468
|
+
/** Whether to show a refresh button in the header. */
|
|
1469
|
+
showRefreshButton?: boolean;
|
|
1556
1470
|
/**
|
|
1557
|
-
*
|
|
1471
|
+
* Whether to show the model selector in the sender footer.
|
|
1472
|
+
* When provided, overrides the shell config's enableModelSelector.
|
|
1558
1473
|
*/
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1474
|
+
showModelSelector?: boolean;
|
|
1475
|
+
/** Show database picker in sender footer. Overrides shell config enableDatabaseSlot. */
|
|
1476
|
+
showDatabaseSlot?: boolean;
|
|
1477
|
+
/** Show skill picker in sender footer. Overrides shell config enableSkillSlot. */
|
|
1478
|
+
showSkillSlot?: boolean;
|
|
1479
|
+
/** Show agent picker in sender footer. Overrides shell config enableAgentSlot. */
|
|
1480
|
+
showAgentSlot?: boolean;
|
|
1481
|
+
/** Show metrics data source picker in sender footer. Overrides shell config enableMetricsDataSourceSlot. */
|
|
1482
|
+
showMetricsDataSourceSlot?: boolean;
|
|
1483
|
+
/** Whether to show the greeting empty state when no messages exist. Default: true. */
|
|
1484
|
+
showEmptyState?: boolean;
|
|
1485
|
+
/** Custom greeting element displayed in the empty state. */
|
|
1486
|
+
emptyStateGreeting?: React__default.ReactNode;
|
|
1487
|
+
/** Empty state question line. Default: "Ready to turn..." */
|
|
1488
|
+
emptyStateQuestion?: string;
|
|
1489
|
+
/** Show skill category prompts in empty state. Default: true. */
|
|
1490
|
+
showSkillPrompts?: boolean;
|
|
1491
|
+
/** Show business analysis prompts in empty state. Default: true. */
|
|
1492
|
+
showQuickAnalysis?: boolean;
|
|
1493
|
+
/** Welcome prefix text (e.g., "Hey"). */
|
|
1494
|
+
welcomePrefix?: string;
|
|
1495
|
+
/** Context string injected before the first user message (e.g. workflow context). */
|
|
1496
|
+
systemContext?: string;
|
|
1497
|
+
/** Auto-send this message when agent becomes idle (thread ready, not loading). */
|
|
1498
|
+
initialMessage?: string | null;
|
|
1499
|
+
/** Called after initialMessage has been sent. */
|
|
1500
|
+
onInitialMessageSent?: () => void;
|
|
1570
1501
|
}
|
|
1571
1502
|
/**
|
|
1572
|
-
*
|
|
1573
|
-
*
|
|
1574
|
-
*/
|
|
1575
|
-
declare function generateLabelFromMessage(message: string): string;
|
|
1576
|
-
/**
|
|
1577
|
-
* Provider component for ConversationContext.
|
|
1578
|
-
* Manages conversation thread state for the currently selected assistant.
|
|
1579
|
-
*
|
|
1580
|
-
* @description
|
|
1581
|
-
* Coordinates with {@link AssistantContext} to load threads for the current assistant.
|
|
1582
|
-
* Key behaviors:
|
|
1583
|
-
* - **Thread loading**: Fetches threads from the API when the assistant changes. If no threads
|
|
1584
|
-
* exist, a new thread is automatically created.
|
|
1585
|
-
* - **Auto-selection**: Selects the most recently updated thread as the active thread when loading.
|
|
1586
|
-
* - **Cross-thread config**: Maintains an assistant-level `customRunConfig` shared across all threads
|
|
1587
|
-
* (useful for metrics datasource and other assistant-wide settings).
|
|
1588
|
-
* - **Thread operations**: Provides full CRUD operations (create, update, delete, list, select)
|
|
1589
|
-
* backed by the client SDK.
|
|
1590
|
-
*
|
|
1591
|
-
* Requires {@link AssistantContextProvider} ancestor and {@link LatticeChatShellContextProvider}.
|
|
1503
|
+
* Core chat interface component — manages sender input, message display,
|
|
1504
|
+
* and agent-streaming state for a single assistant thread.
|
|
1592
1505
|
*
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1506
|
+
* Features:
|
|
1507
|
+
* - Empty state with greeting and skill/analysis prompt categories
|
|
1508
|
+
* - Message sender with file attachment, skill/agent/database pickers, and model selector
|
|
1509
|
+
* - Typing cursor animation during streaming
|
|
1510
|
+
* - HITL interrupt handling and pending-message display
|
|
1511
|
+
* - Auto-send of {@link ChatingProps.systemContext} and {@link ChatingProps.initialMessage}
|
|
1512
|
+
* - Transition animations between empty and active states
|
|
1595
1513
|
*
|
|
1596
|
-
* @
|
|
1514
|
+
* @param props - See {@link ChatingProps}.
|
|
1515
|
+
* @returns The full chat UI for the active thread.
|
|
1597
1516
|
*
|
|
1598
1517
|
* @example
|
|
1599
1518
|
* ```tsx
|
|
1600
|
-
*
|
|
1601
|
-
*
|
|
1602
|
-
*
|
|
1519
|
+
* import { Chating } from "@axiom-lattice/react-sdk";
|
|
1520
|
+
*
|
|
1521
|
+
* <Chating
|
|
1522
|
+
* name="Data Analyst"
|
|
1523
|
+
* showHeader
|
|
1524
|
+
* showSender
|
|
1525
|
+
* showModelSelector
|
|
1526
|
+
* emptyStateQuestion="What data would you like to analyze?"
|
|
1527
|
+
* systemContext="You are analyzing sales data from Q4 2024."
|
|
1528
|
+
* />
|
|
1603
1529
|
* ```
|
|
1530
|
+
*
|
|
1531
|
+
* @remarks
|
|
1532
|
+
* - Requires the following ancestor context providers: {@link AgentThreadProvider},
|
|
1533
|
+
* {@link ChatUIContextProvider}, {@link LatticeChatShellContextProvider},
|
|
1534
|
+
* {@link ConversationContextProvider}, {@link AssistantContextProvider}.
|
|
1535
|
+
* - Prop-level feature toggles (e.g. `showModelSelector`) take priority over
|
|
1536
|
+
* shell-config-level toggles.
|
|
1537
|
+
* - Uses {@link useAgentChat} for all agent communication.
|
|
1604
1538
|
*/
|
|
1605
|
-
declare const
|
|
1606
|
-
/**
|
|
1607
|
-
* Hook to access ConversationContext
|
|
1608
|
-
* @returns Conversation context value
|
|
1609
|
-
* @throws Error if used outside of ConversationContextProvider
|
|
1610
|
-
*/
|
|
1611
|
-
declare const useConversationContext: () => ConversationContextValue;
|
|
1539
|
+
declare const Chating: React__default.FC<ChatingProps>;
|
|
1612
1540
|
|
|
1613
1541
|
/**
|
|
1614
|
-
*
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
* List of all assistants
|
|
1619
|
-
*/
|
|
1620
|
-
assistants: Assistant[];
|
|
1621
|
-
/**
|
|
1622
|
-
* Currently selected assistant
|
|
1623
|
-
*/
|
|
1624
|
-
currentAssistant: Assistant | null;
|
|
1625
|
-
/**
|
|
1626
|
-
* Whether data is being loaded
|
|
1627
|
-
*/
|
|
1628
|
-
isLoading: boolean;
|
|
1629
|
-
/**
|
|
1630
|
-
* Error message if any
|
|
1631
|
-
*/
|
|
1632
|
-
error: Error | null;
|
|
1633
|
-
}
|
|
1634
|
-
/**
|
|
1635
|
-
* Assistant context value interface
|
|
1636
|
-
*/
|
|
1637
|
-
interface AssistantContextValue extends AssistantState {
|
|
1638
|
-
/**
|
|
1639
|
-
* List all assistants
|
|
1640
|
-
*/
|
|
1641
|
-
listAssistants: () => Promise<void>;
|
|
1642
|
-
/**
|
|
1643
|
-
* Get a single assistant by ID
|
|
1644
|
-
*/
|
|
1645
|
-
getAssistant: (id: string) => Promise<Assistant>;
|
|
1646
|
-
/**
|
|
1647
|
-
* Create a new assistant
|
|
1648
|
-
*/
|
|
1649
|
-
createAssistant: (options: CreateAssistantOptions) => Promise<Assistant>;
|
|
1650
|
-
/**
|
|
1651
|
-
* Update an existing assistant
|
|
1652
|
-
*/
|
|
1653
|
-
updateAssistant: (id: string, options: UpdateAssistantOptions) => Promise<Assistant>;
|
|
1654
|
-
/**
|
|
1655
|
-
* Delete an assistant
|
|
1656
|
-
*/
|
|
1657
|
-
deleteAssistant: (id: string) => Promise<void>;
|
|
1658
|
-
/**
|
|
1659
|
-
* Select an assistant as current
|
|
1660
|
-
*/
|
|
1661
|
-
selectAssistant: (id: string) => Promise<void>;
|
|
1662
|
-
/**
|
|
1663
|
-
* Clear the current assistant selection
|
|
1664
|
-
*/
|
|
1665
|
-
clearCurrentAssistant: () => void;
|
|
1666
|
-
/**
|
|
1667
|
-
* Refresh the assistant list
|
|
1668
|
-
*/
|
|
1669
|
-
refresh: () => Promise<void>;
|
|
1670
|
-
}
|
|
1671
|
-
/**
|
|
1672
|
-
* Assistant context
|
|
1673
|
-
*/
|
|
1674
|
-
declare const AssistantContext: React$1.Context<AssistantContextValue>;
|
|
1675
|
-
/**
|
|
1676
|
-
* Props for AssistantContextProvider
|
|
1542
|
+
* Props for the {@link LatticeChat} component.
|
|
1543
|
+
*
|
|
1544
|
+
* Extends {@link ChatingProps} with thread/assistant identification
|
|
1545
|
+
* and optional menu/header slots.
|
|
1677
1546
|
*/
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
/**
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
/**
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1547
|
+
type AgentChatProps = {
|
|
1548
|
+
/** The ID of the currently active thread. If absent, a placeholder is shown prompting users to create a conversation. */
|
|
1549
|
+
thread_id?: string;
|
|
1550
|
+
/** The assistant ID that backs the chat. Required — feeds the {@link AgentThreadProvider}. */
|
|
1551
|
+
assistant_id: string;
|
|
1552
|
+
/** Optional menu rendered in the left sidebar column. */
|
|
1553
|
+
menu?: React__default.ReactNode;
|
|
1554
|
+
/** Optional header rendered above the main chat area. */
|
|
1555
|
+
header?: React__default.ReactNode;
|
|
1556
|
+
/** Optional right-side header content. Replaces the default folder toggle button. Use {@link FilePanelToggle} to include it. */
|
|
1557
|
+
headerRight?: React__default.ReactNode;
|
|
1558
|
+
/** Show workspace project selector in header. Default true. */
|
|
1559
|
+
showProjectSelector?: boolean;
|
|
1560
|
+
/** Content shown when no thread is active. Default: "Please create a conversation first". */
|
|
1561
|
+
emptyPlaceholder?: React__default.ReactNode;
|
|
1562
|
+
} & ChatingProps;
|
|
1692
1563
|
/**
|
|
1693
|
-
*
|
|
1694
|
-
* Manages assistant state and operations including CRUD, selection, and auto-loading.
|
|
1695
|
-
*
|
|
1696
|
-
* @description
|
|
1697
|
-
* Coordinates with the client SDK to provide assistant management:
|
|
1698
|
-
* - **Auto-load**: When `autoLoad` is `true` (default), fetches the assistant list on mount.
|
|
1699
|
-
* - **Auto-selection**: If `initialAssistantId` is provided, selects that assistant after loading.
|
|
1700
|
-
* Otherwise, auto-selects the first available assistant.
|
|
1701
|
-
* - **Re-selection**: If the currently selected assistant is removed from the list (e.g., deleted),
|
|
1702
|
-
* falls back to selecting the first available assistant.
|
|
1703
|
-
* - **CRUD operations**: Provides `createAssistant`, `updateAssistant`, `deleteAssistant`, and
|
|
1704
|
-
* `getAssistant` backed by the SDK, keeping local state in sync.
|
|
1705
|
-
*
|
|
1706
|
-
* Requires an {@link AxiomLatticeProvider} ancestor for the API client.
|
|
1564
|
+
* Top-level chat component for a single assistant thread.
|
|
1707
1565
|
*
|
|
1708
|
-
*
|
|
1709
|
-
*
|
|
1710
|
-
*
|
|
1711
|
-
* @
|
|
1566
|
+
* Wraps the chat UI in:
|
|
1567
|
+
* - {@link AgentThreadProvider} for thread state
|
|
1568
|
+
* - {@link ChatUIContextProvider} for UI panel toggles
|
|
1569
|
+
* - A responsive {@link ColumnLayout} with menu, main chat, detail panel, and tools panel
|
|
1712
1570
|
*
|
|
1713
|
-
*
|
|
1571
|
+
* When `thread_id` is empty, a prompt to create a conversation is displayed.
|
|
1714
1572
|
*
|
|
1715
1573
|
* @example
|
|
1716
1574
|
* ```tsx
|
|
1717
|
-
*
|
|
1718
|
-
*
|
|
1719
|
-
*
|
|
1575
|
+
* import { LatticeChat } from "@axiom-lattice/react-sdk";
|
|
1576
|
+
*
|
|
1577
|
+
* <LatticeChat
|
|
1578
|
+
* assistant_id="asst_abc123"
|
|
1579
|
+
* thread_id="thread_xyz"
|
|
1580
|
+
* showHeader
|
|
1581
|
+
* showSender
|
|
1582
|
+
* />
|
|
1720
1583
|
* ```
|
|
1584
|
+
*
|
|
1585
|
+
* @remarks
|
|
1586
|
+
* - Requires a parent `<LatticeChatShell>` for shell-level configuration (API URL, feature toggles).
|
|
1587
|
+
* - The `ChatingProps` are forwarded to the internal {@link Chating} component.
|
|
1721
1588
|
*/
|
|
1722
|
-
declare const
|
|
1723
|
-
/**
|
|
1724
|
-
* Hook to access AssistantContext
|
|
1725
|
-
* @returns Assistant context value
|
|
1726
|
-
* @throws Error if used outside of AssistantContextProvider
|
|
1727
|
-
*/
|
|
1728
|
-
declare const useAssistantContext: () => AssistantContextValue;
|
|
1589
|
+
declare const LatticeChat: React__default.FC<AgentChatProps>;
|
|
1729
1590
|
|
|
1730
|
-
/**
|
|
1731
|
-
*
|
|
1732
|
-
*/
|
|
1733
|
-
interface
|
|
1734
|
-
key
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1591
|
+
/**
|
|
1592
|
+
* Model runtime configuration passed to the agent when a model is selected.
|
|
1593
|
+
*/
|
|
1594
|
+
interface ModelConfig {
|
|
1595
|
+
/** The model key as registered on the server (e.g., "gpt-4o"). */
|
|
1596
|
+
modelKey: string;
|
|
1597
|
+
/** Sampling temperature (0-2). Higher values produce more random output. */
|
|
1598
|
+
temperature?: number;
|
|
1599
|
+
/** Maximum tokens in the generated response. */
|
|
1600
|
+
maxTokens?: number;
|
|
1601
|
+
/** Nucleus sampling parameter (0-1). */
|
|
1602
|
+
topP?: number;
|
|
1603
|
+
/** Penalty for repeating tokens (-2 to 2). */
|
|
1604
|
+
frequencyPenalty?: number;
|
|
1605
|
+
/** Penalty for introducing new topics (-2 to 2). */
|
|
1606
|
+
presencePenalty?: number;
|
|
1739
1607
|
}
|
|
1740
1608
|
/**
|
|
1741
|
-
*
|
|
1609
|
+
* Model metadata returned by the `/api/models` endpoint.
|
|
1742
1610
|
*/
|
|
1743
|
-
interface
|
|
1611
|
+
interface ModelInfo {
|
|
1612
|
+
/** Unique model key (used as the selection value). */
|
|
1744
1613
|
key: string;
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1614
|
+
/** Provider identifier (e.g., "openai", "azure"). */
|
|
1615
|
+
provider: string;
|
|
1616
|
+
/** Model name as known by the provider (e.g., "gpt-4o"). */
|
|
1617
|
+
model: string;
|
|
1618
|
+
/** Human-readable display name for the dropdown. */
|
|
1619
|
+
displayName?: string;
|
|
1749
1620
|
}
|
|
1750
1621
|
/**
|
|
1751
|
-
*
|
|
1622
|
+
* Props for the {@link ModelSelector} component.
|
|
1752
1623
|
*/
|
|
1753
|
-
interface
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1624
|
+
interface ModelSelectorProps {
|
|
1625
|
+
/** Currently selected model configuration (controlled). */
|
|
1626
|
+
value?: ModelConfig | null;
|
|
1627
|
+
/** Called when the user selects a model. */
|
|
1628
|
+
onChange?: (config: ModelConfig | null) => void;
|
|
1629
|
+
/** Default model key used when the fetch response includes a matching model. */
|
|
1630
|
+
defaultModelKey?: string;
|
|
1631
|
+
/** Inline styles applied to the Select element. */
|
|
1632
|
+
style?: React__default.CSSProperties;
|
|
1757
1633
|
}
|
|
1758
1634
|
/**
|
|
1759
|
-
*
|
|
1635
|
+
* A borderless Ant Design `Select` dropdown for choosing the LLM model.
|
|
1636
|
+
*
|
|
1637
|
+
* Fetches available models from `/api/models` on first render and caches the result.
|
|
1638
|
+
* When a default model key matches a model in the list, it is auto-selected.
|
|
1639
|
+
* The selection is reported via the {@link ModelSelectorProps.onChange} callback,
|
|
1640
|
+
* which typically feeds into `updateCustomRunConfig` in the {@link Chating} component.
|
|
1641
|
+
*
|
|
1642
|
+
* @param value - Currently selected model config (controlled).
|
|
1643
|
+
* @param onChange - Callback when the selection changes.
|
|
1644
|
+
* @param defaultModelKey - Model key to auto-select if found in the model list.
|
|
1645
|
+
* @param style - Inline styles for the Select wrapper.
|
|
1646
|
+
* @returns A compact model selector with hover-highlight background.
|
|
1647
|
+
*
|
|
1648
|
+
* @example
|
|
1649
|
+
* ```tsx
|
|
1650
|
+
* import { ModelSelector } from "@axiom-lattice/react-sdk";
|
|
1651
|
+
*
|
|
1652
|
+
* <ModelSelector
|
|
1653
|
+
* value={modelConfig}
|
|
1654
|
+
* onChange={(config) => updateCustomRunConfig({ modelConfig: config })}
|
|
1655
|
+
* defaultModelKey="gpt-4o"
|
|
1656
|
+
* />
|
|
1657
|
+
* ```
|
|
1658
|
+
*
|
|
1659
|
+
* @remarks
|
|
1660
|
+
* - Supports both controlled (`value` prop) and uncontrolled (internal state) usage.
|
|
1661
|
+
* - Fetch is performed only once per component mount via a ref guard.
|
|
1662
|
+
* - The dropdown is intentionally borderless to blend into the sender footer.
|
|
1760
1663
|
*/
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
items?: {
|
|
1776
|
-
type: string;
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1664
|
+
declare const ModelSelector: React__default.FC<ModelSelectorProps>;
|
|
1665
|
+
|
|
1666
|
+
declare const MDResponse: React__default.MemoExoticComponent<({ content, context, embeddedLink, interactive, userData, noGenUI, }: {
|
|
1667
|
+
context?: any;
|
|
1668
|
+
content: string;
|
|
1669
|
+
embeddedLink?: boolean;
|
|
1670
|
+
interactive?: boolean;
|
|
1671
|
+
userData?: any;
|
|
1672
|
+
noGenUI?: boolean;
|
|
1673
|
+
}) => react_jsx_runtime.JSX.Element>;
|
|
1674
|
+
declare const MDViewFormItem: ({ value }: {
|
|
1675
|
+
value?: string;
|
|
1676
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1677
|
+
|
|
1779
1678
|
/**
|
|
1780
|
-
*
|
|
1679
|
+
* Props passed to every GenUI element component.
|
|
1680
|
+
*
|
|
1681
|
+
* Each element registered in the GenUI element registry receives these props,
|
|
1682
|
+
* with the `data` field carrying the element-specific payload from the agent.
|
|
1683
|
+
*
|
|
1684
|
+
* @typeParam T - The shape of the element-specific data payload
|
|
1781
1685
|
*/
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1686
|
+
type ElementProps<T = any> = {
|
|
1687
|
+
/** Key identifying which GenUI element component to render */
|
|
1688
|
+
component_key: string;
|
|
1689
|
+
/** Optional context for the current conversation */
|
|
1690
|
+
context?: {
|
|
1691
|
+
/** The thread ID associated with this element */
|
|
1692
|
+
thread_id?: string;
|
|
1693
|
+
/** The assistant ID associated with this element */
|
|
1694
|
+
assistant_id?: string;
|
|
1695
|
+
};
|
|
1696
|
+
/** Element-specific data payload from the agent */
|
|
1697
|
+
data: T;
|
|
1698
|
+
/** Whether the element supports user interaction (defaults to false) */
|
|
1699
|
+
interactive?: boolean;
|
|
1700
|
+
/** Whether to open this element in the side app panel by default */
|
|
1701
|
+
default_open_in_side_app?: boolean;
|
|
1702
|
+
};
|
|
1789
1703
|
/**
|
|
1790
|
-
*
|
|
1704
|
+
* Metadata for a registered GenUI element.
|
|
1705
|
+
*
|
|
1706
|
+
* Defines how an element is rendered and optionally what action to perform
|
|
1707
|
+
* when the user interacts with it.
|
|
1791
1708
|
*/
|
|
1792
|
-
interface
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
tools?: MiddlewareToolDefinition[];
|
|
1709
|
+
interface ElementMeta {
|
|
1710
|
+
/** The main card-view React component for this element */
|
|
1711
|
+
card_view: React.FC<ElementProps>;
|
|
1712
|
+
/** Optional side-app panel React component for expanded viewing */
|
|
1713
|
+
side_app_view?: React.FC<ElementProps>;
|
|
1714
|
+
/** Optional action callback invoked when the user interacts with the element */
|
|
1715
|
+
action?: (data: any) => void;
|
|
1800
1716
|
}
|
|
1801
1717
|
/**
|
|
1802
|
-
*
|
|
1718
|
+
* Data structure representing a tool call made by the agent.
|
|
1719
|
+
*
|
|
1720
|
+
* Rendered by GenUI tool card elements to display tool invocations,
|
|
1721
|
+
* their arguments, and their results.
|
|
1803
1722
|
*/
|
|
1804
|
-
interface
|
|
1723
|
+
interface ToolCallData {
|
|
1724
|
+
/** Unique identifier for this tool call */
|
|
1805
1725
|
id: string;
|
|
1806
|
-
|
|
1726
|
+
/** Name of the tool being called */
|
|
1807
1727
|
name: string;
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1728
|
+
/** Arguments passed to the tool */
|
|
1729
|
+
args: Record<string, any>;
|
|
1730
|
+
/** Distinguishes tool calls from other message types */
|
|
1731
|
+
type: "tool_call";
|
|
1732
|
+
/** The tool's response, if available */
|
|
1733
|
+
response?: string;
|
|
1734
|
+
/** Execution status of the tool call */
|
|
1735
|
+
status?: "success" | "pending" | "error";
|
|
1814
1736
|
}
|
|
1737
|
+
|
|
1738
|
+
declare const getElement: (language: string | undefined) => ElementMeta | null;
|
|
1739
|
+
declare const regsiterElement: (language: string, ElementMeta: ElementMeta) => ElementMeta;
|
|
1740
|
+
|
|
1815
1741
|
/**
|
|
1816
|
-
*
|
|
1742
|
+
* Tabbed side-app browser that renders GenUI components in the right panel.
|
|
1743
|
+
*
|
|
1744
|
+
* Manages a tab strip of registered side-app views. When a new component is
|
|
1745
|
+
* selected via {@link SideAppBrowserContext}, a tab is added (or activated if
|
|
1746
|
+
* it already exists). Tabs are closable and switchable. An "all tabs" dropdown
|
|
1747
|
+
* appears when there are 2+ tabs. Uses {@link ChatUIContext} to read/write the
|
|
1748
|
+
* active side-app card and open/close the panel.
|
|
1749
|
+
*
|
|
1750
|
+
* @param region - Which panel region this browser is attached to.
|
|
1751
|
+
* `"side"` for the right detail panel (default), `"content"` for the main content area.
|
|
1752
|
+
* @returns The tabbed side-app viewer, or an empty state if no tabs are open.
|
|
1753
|
+
*
|
|
1754
|
+
* @example
|
|
1755
|
+
* ```tsx
|
|
1756
|
+
* import { SideAppViewBrowser } from "@axiom-lattice/react-sdk";
|
|
1757
|
+
*
|
|
1758
|
+
* <SideAppViewBrowser region="side" />
|
|
1759
|
+
* ```
|
|
1760
|
+
*
|
|
1761
|
+
* @remarks
|
|
1762
|
+
* - Internally renders {@link SideAppBrowserContext.Provider} so that child
|
|
1763
|
+
* components can programmatically open new side-apps via `openApp()`.
|
|
1764
|
+
* - Component resolution uses {@link getElement} from the GenUI element registry.
|
|
1765
|
+
* - Designed to work with {@link ColumnLayout} as the `detail` panel.
|
|
1817
1766
|
*/
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1767
|
+
declare const SideAppViewBrowser: React__default.FC<{
|
|
1768
|
+
region?: "side" | "content";
|
|
1769
|
+
}>;
|
|
1770
|
+
|
|
1771
|
+
type PanelCardData = Record<string, unknown> & {
|
|
1772
|
+
component?: ReactNode;
|
|
1773
|
+
message?: string;
|
|
1774
|
+
};
|
|
1775
|
+
type PanelCard = {
|
|
1776
|
+
component_key: string;
|
|
1777
|
+
data: PanelCardData;
|
|
1778
|
+
message?: string;
|
|
1779
|
+
context?: {
|
|
1780
|
+
thread_id?: string;
|
|
1781
|
+
assistant_id?: string;
|
|
1782
|
+
};
|
|
1783
|
+
};
|
|
1784
|
+
declare const ChatUIContext: React__default.Context<{
|
|
1785
|
+
detailVisible: boolean;
|
|
1786
|
+
setDetailVisible: (visible: boolean) => void;
|
|
1787
|
+
detailSize: "small" | "middle" | "large" | "full";
|
|
1788
|
+
setDetailSize: (size: "small" | "middle" | "large" | "full") => void;
|
|
1789
|
+
detailSelectedCard: PanelCard | null;
|
|
1790
|
+
setDetailSelectedCard: (card: PanelCard | null) => void;
|
|
1791
|
+
openDetail: (card: PanelCard) => void;
|
|
1792
|
+
closeDetail: () => void;
|
|
1793
|
+
toolsVisible: boolean;
|
|
1794
|
+
setToolsVisible: (visible: boolean) => void;
|
|
1795
|
+
toggleTools: () => void;
|
|
1796
|
+
toolSelectedCard: PanelCard | null;
|
|
1797
|
+
setToolSelectedCard: (card: PanelCard | null) => void;
|
|
1798
|
+
openTools: (card: PanelCard) => void;
|
|
1799
|
+
closeTools: () => void;
|
|
1800
|
+
sideAppVisible: boolean;
|
|
1801
|
+
setSideAppVisible: (visible: boolean) => void;
|
|
1802
|
+
sideAppSize: "small" | "middle" | "large" | "full";
|
|
1803
|
+
setSideAppSize: (size: "small" | "middle" | "large" | "full") => void;
|
|
1804
|
+
sideAppSelectedCard: PanelCard | null;
|
|
1805
|
+
setSideAppSelectedCard: (card: PanelCard | null) => void;
|
|
1806
|
+
openSideApp: (card: PanelCard) => void;
|
|
1807
|
+
closeSideApp: () => void;
|
|
1808
|
+
menuCollapsed: boolean | undefined;
|
|
1809
|
+
setMenuCollapsed: (collapsed: boolean) => void;
|
|
1810
|
+
openContentApp: (card: PanelCard) => void;
|
|
1811
|
+
closeContentApp: () => void;
|
|
1812
|
+
contentAppVisible: boolean;
|
|
1813
|
+
setcontentAppVisible: (visible: boolean) => void;
|
|
1814
|
+
contentAppSelectedCard: PanelCard | null;
|
|
1815
|
+
setContentAppSelectedCard: (card: PanelCard | null) => void;
|
|
1816
|
+
}>;
|
|
1824
1817
|
/**
|
|
1825
|
-
*
|
|
1818
|
+
* Chat UI context provider. Manages visibility and selected cards for chat panel areas
|
|
1819
|
+
* (detail, tools, side app, content app) and the sidebar menu collapsed state.
|
|
1820
|
+
*
|
|
1821
|
+
* @description
|
|
1822
|
+
* Tracks the open/closed state and the currently selected {@link PanelCard} for each panel:
|
|
1823
|
+
* - **Detail panel**: A slide-out detail view that displays a chosen card's content.
|
|
1824
|
+
* - **Tools panel**: A tools sidebar/drawer for tool-specific cards.
|
|
1825
|
+
* - **Side app**: Aliases to the detail panel (shared state).
|
|
1826
|
+
* - **Content app**: An inline content area for embedded app cards.
|
|
1827
|
+
* - **Menu collapsed**: Whether the sidebar navigation menu is collapsed.
|
|
1828
|
+
*
|
|
1829
|
+
* Provides action helpers (`openDetail`, `closeDetail`, `openTools`, `toggleTools`, etc.)
|
|
1830
|
+
* that set both visibility and selected card atomically.
|
|
1831
|
+
*
|
|
1832
|
+
* @param props - Provider props.
|
|
1833
|
+
* @param props.children - React children to render within the UI context.
|
|
1834
|
+
*
|
|
1835
|
+
* @returns A React context provider wrapping children with {@link ChatUIContext.Provider}.
|
|
1836
|
+
*
|
|
1837
|
+
* @example
|
|
1838
|
+
* ```tsx
|
|
1839
|
+
* <ChatUIContextProvider>
|
|
1840
|
+
* <ChatLayout />
|
|
1841
|
+
* </ChatUIContextProvider>
|
|
1842
|
+
* ```
|
|
1826
1843
|
*/
|
|
1844
|
+
declare const ChatUIContextProvider: ({ children, }: {
|
|
1845
|
+
children: React__default.ReactNode;
|
|
1846
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
1827
1847
|
/**
|
|
1828
|
-
*
|
|
1848
|
+
* Hook to access the chat UI context. Must be used within a {@link ChatUIContextProvider}.
|
|
1829
1849
|
*
|
|
1830
|
-
*
|
|
1831
|
-
*
|
|
1832
|
-
*
|
|
1833
|
-
* - `"route"` — opens a GenUI-registered component in the SideApp area
|
|
1850
|
+
* @description
|
|
1851
|
+
* Returns panel visibility state, selected panel cards, and action functions for controlling
|
|
1852
|
+
* the chat interface panels (detail, tools, side app, content app) and menu collapsed state.
|
|
1834
1853
|
*
|
|
1835
|
-
*
|
|
1836
|
-
*
|
|
1837
|
-
*
|
|
1838
|
-
* ```
|
|
1839
|
-
*
|
|
1854
|
+
* @returns The current chat UI context value containing panel state and control functions.
|
|
1855
|
+
*
|
|
1856
|
+
* @example
|
|
1857
|
+
* ```tsx
|
|
1858
|
+
* const { detailVisible, openDetail, closeDetail, toggleTools, menuCollapsed } = useChatUIContext();
|
|
1859
|
+
*
|
|
1860
|
+
* const handleCardClick = (card: PanelCard) => {
|
|
1861
|
+
* openDetail(card);
|
|
1862
|
+
* };
|
|
1840
1863
|
* ```
|
|
1841
1864
|
*/
|
|
1842
|
-
|
|
1843
|
-
|
|
1865
|
+
declare const useChatUIContext: () => {
|
|
1866
|
+
detailVisible: boolean;
|
|
1867
|
+
setDetailVisible: (visible: boolean) => void;
|
|
1868
|
+
detailSize: "small" | "middle" | "large" | "full";
|
|
1869
|
+
setDetailSize: (size: "small" | "middle" | "large" | "full") => void;
|
|
1870
|
+
detailSelectedCard: PanelCard | null;
|
|
1871
|
+
setDetailSelectedCard: (card: PanelCard | null) => void;
|
|
1872
|
+
openDetail: (card: PanelCard) => void;
|
|
1873
|
+
closeDetail: () => void;
|
|
1874
|
+
toolsVisible: boolean;
|
|
1875
|
+
setToolsVisible: (visible: boolean) => void;
|
|
1876
|
+
toggleTools: () => void;
|
|
1877
|
+
toolSelectedCard: PanelCard | null;
|
|
1878
|
+
setToolSelectedCard: (card: PanelCard | null) => void;
|
|
1879
|
+
openTools: (card: PanelCard) => void;
|
|
1880
|
+
closeTools: () => void;
|
|
1881
|
+
sideAppVisible: boolean;
|
|
1882
|
+
setSideAppVisible: (visible: boolean) => void;
|
|
1883
|
+
sideAppSize: "small" | "middle" | "large" | "full";
|
|
1884
|
+
setSideAppSize: (size: "small" | "middle" | "large" | "full") => void;
|
|
1885
|
+
sideAppSelectedCard: PanelCard | null;
|
|
1886
|
+
setSideAppSelectedCard: (card: PanelCard | null) => void;
|
|
1887
|
+
openSideApp: (card: PanelCard) => void;
|
|
1888
|
+
closeSideApp: () => void;
|
|
1889
|
+
menuCollapsed: boolean | undefined;
|
|
1890
|
+
setMenuCollapsed: (collapsed: boolean) => void;
|
|
1891
|
+
openContentApp: (card: PanelCard) => void;
|
|
1892
|
+
closeContentApp: () => void;
|
|
1893
|
+
contentAppVisible: boolean;
|
|
1894
|
+
setcontentAppVisible: (visible: boolean) => void;
|
|
1895
|
+
contentAppSelectedCard: PanelCard | null;
|
|
1896
|
+
setContentAppSelectedCard: (card: PanelCard | null) => void;
|
|
1897
|
+
};
|
|
1898
|
+
|
|
1899
|
+
interface SideAppBrowserContextValue {
|
|
1900
|
+
openApp: (card: PanelCard) => void;
|
|
1901
|
+
}
|
|
1902
|
+
declare const SideAppBrowserContext: React$1.Context<SideAppBrowserContextValue | null>;
|
|
1903
|
+
declare const useSideAppBrowser: () => SideAppBrowserContextValue | null;
|
|
1904
|
+
declare const useSideAppOpener: () => ((card: PanelCard) => void);
|
|
1905
|
+
|
|
1906
|
+
/**
|
|
1907
|
+
* Thread information for a conversation
|
|
1908
|
+
*/
|
|
1909
|
+
interface ConversationThread {
|
|
1844
1910
|
id: string;
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
name: string;
|
|
1849
|
-
/** Icon component for the menu item */
|
|
1850
|
-
icon?: ReactNode;
|
|
1851
|
-
/** Order for sorting menu items (lower values first) */
|
|
1852
|
-
order?: number;
|
|
1853
|
-
/** Whether this is a builtin menu item (new-analysis, thread-history, assistants, skill, skills, tools, workspace, settings, database, metrics, mcp, projects, logout, switch-tenant) */
|
|
1854
|
-
builtin?: "new-analysis" | "thread-history" | "assistants" | "skill" | "skills" | "tools" | "workspace" | "settings" | "database" | "metrics" | "mcp" | "projects" | "logout" | "switch-tenant";
|
|
1855
|
-
/**
|
|
1856
|
-
* Menu group for organizing items
|
|
1857
|
-
*/
|
|
1858
|
-
group?: string;
|
|
1859
|
-
/**
|
|
1860
|
-
* Whether the menu item is enabled (can be toggled)
|
|
1861
|
-
* Defaults to true
|
|
1862
|
-
*/
|
|
1863
|
-
enabled?: boolean;
|
|
1864
|
-
/** Content config from DB (for custom menu items) */
|
|
1865
|
-
contentConfig?: Record<string, unknown>;
|
|
1866
|
-
/** Content to display inside the drawer (for drawer type) */
|
|
1867
|
-
content?: ReactNode;
|
|
1868
|
-
/** Drawer title (for drawer type) */
|
|
1869
|
-
title?: string;
|
|
1870
|
-
/** Drawer width in pixels or percentage (for drawer type) */
|
|
1871
|
-
width?: string | number;
|
|
1872
|
-
/**
|
|
1873
|
-
* Whether to display drawer content inline in expanded sidebar mode
|
|
1874
|
-
* When true, content shows below the menu item instead of in a drawer
|
|
1875
|
-
* Defaults to false, but true for "workspace" builtin
|
|
1876
|
-
*/
|
|
1877
|
-
inline?: boolean;
|
|
1878
|
-
/**
|
|
1879
|
-
* Maximum height for inline drawer content in pixels
|
|
1880
|
-
* Only applies when inline is true
|
|
1881
|
-
* Defaults to 400
|
|
1882
|
-
*/
|
|
1883
|
-
inlineMaxHeight?: number;
|
|
1884
|
-
/**
|
|
1885
|
-
* Whether inline drawer is expanded by default
|
|
1886
|
-
* Only applies when inline is true
|
|
1887
|
-
* Defaults to false
|
|
1888
|
-
*/
|
|
1889
|
-
inlineDefaultExpanded?: boolean;
|
|
1890
|
-
/** Component to render in SideApp (for route type) */
|
|
1891
|
-
sideAppComponent?: ReactNode;
|
|
1911
|
+
label: string;
|
|
1912
|
+
createdAt?: string;
|
|
1913
|
+
updatedAt?: string;
|
|
1892
1914
|
}
|
|
1893
1915
|
/**
|
|
1894
|
-
*
|
|
1916
|
+
* Conversation context value
|
|
1895
1917
|
*/
|
|
1896
|
-
interface
|
|
1897
|
-
/**
|
|
1898
|
-
* Base URL for the API
|
|
1899
|
-
*/
|
|
1900
|
-
baseURL: string;
|
|
1901
|
-
/**
|
|
1902
|
-
* API key for authentication (optional)
|
|
1903
|
-
*/
|
|
1904
|
-
apiKey?: string;
|
|
1905
|
-
/**
|
|
1906
|
-
* Transport method (Server-Sent Events or WebSocket)
|
|
1907
|
-
*/
|
|
1908
|
-
transport?: "sse" | "ws";
|
|
1909
|
-
/**
|
|
1910
|
-
* Request timeout in milliseconds (optional)
|
|
1911
|
-
*/
|
|
1912
|
-
timeout?: number;
|
|
1913
|
-
/**
|
|
1914
|
-
* Additional headers to include in requests (optional)
|
|
1915
|
-
*/
|
|
1916
|
-
headers?: Record<string, string>;
|
|
1917
|
-
/**
|
|
1918
|
-
* Whether users can create new threads from the UI
|
|
1919
|
-
* Defaults to true
|
|
1920
|
-
*/
|
|
1921
|
-
enableThreadCreation?: boolean;
|
|
1918
|
+
interface ConversationContextValue {
|
|
1922
1919
|
/**
|
|
1923
|
-
*
|
|
1924
|
-
* Defaults to true
|
|
1920
|
+
* Current assistant ID
|
|
1925
1921
|
*/
|
|
1926
|
-
|
|
1927
|
-
assistantId?: string;
|
|
1928
|
-
showSideMenu?: boolean;
|
|
1929
|
-
/**
|
|
1930
|
-
* URL of the global shared sandbox, this is used to access the global shared sandbox
|
|
1931
|
-
* if not provided, sandbox will be created in the agent's sandbox
|
|
1932
|
-
*/
|
|
1933
|
-
globalSharedSandboxURL?: string;
|
|
1934
|
-
/**
|
|
1935
|
-
* Available middleware types that can be configured for agents
|
|
1936
|
-
* Each middleware type defines its name, description, and default configuration
|
|
1937
|
-
* If not provided, default middleware types will be used
|
|
1938
|
-
*/
|
|
1939
|
-
availableMiddlewareTypes?: MiddlewareTypeDefinition[];
|
|
1922
|
+
assistantId: string | null;
|
|
1940
1923
|
/**
|
|
1941
|
-
*
|
|
1942
|
-
* Defaults to true
|
|
1924
|
+
* Current thread for the assistant
|
|
1943
1925
|
*/
|
|
1944
|
-
|
|
1945
|
-
/**
|
|
1946
|
-
* Whether users can edit existing assistants
|
|
1947
|
-
* Defaults to true
|
|
1948
|
-
*/
|
|
1949
|
-
enableAssistantEditing?: boolean;
|
|
1926
|
+
thread: ConversationThread | null;
|
|
1950
1927
|
/**
|
|
1951
|
-
*
|
|
1952
|
-
* When enabled, shows workspace selector in header and file browser
|
|
1953
|
-
* Defaults to false
|
|
1928
|
+
* Current thread ID
|
|
1954
1929
|
*/
|
|
1955
|
-
|
|
1930
|
+
threadId: string | null;
|
|
1956
1931
|
/**
|
|
1957
|
-
*
|
|
1958
|
-
* When enabled, WorkspaceResourceManager fetches per-tenant custom menu items
|
|
1959
|
-
* and merges them with built-in defaults.
|
|
1960
|
-
* Defaults to true.
|
|
1932
|
+
* List of threads for the current assistant
|
|
1961
1933
|
*/
|
|
1962
|
-
|
|
1934
|
+
threads: ConversationThread[];
|
|
1963
1935
|
/**
|
|
1964
|
-
*
|
|
1965
|
-
* Each folder represents a section in the workspace assets panel
|
|
1966
|
-
* If not provided, defaults to a single root folder with upload enabled
|
|
1936
|
+
* Whether threads are being loaded
|
|
1967
1937
|
*/
|
|
1968
|
-
|
|
1969
|
-
/**
|
|
1970
|
-
* Chat sidebar menu items. When provided, completely replaces the
|
|
1971
|
-
* default built-in items (New Analysis, History).
|
|
1972
|
-
*
|
|
1973
|
-
* To selectively include built-in items, import and filter `DEFAULT_MENU_ITEMS`:
|
|
1974
|
-
* ```
|
|
1975
|
-
* sideMenuItems: DEFAULT_MENU_ITEMS.filter(i => i.id === "thread-history")
|
|
1976
|
-
* ```
|
|
1977
|
-
* Omit this field to use all defaults.
|
|
1978
|
-
*/
|
|
1979
|
-
sideMenuItems?: SideMenuItemConfig[];
|
|
1938
|
+
isLoading: boolean;
|
|
1980
1939
|
/**
|
|
1981
|
-
*
|
|
1982
|
-
* default workspace items (Projects, Metrics, Database, etc.).
|
|
1983
|
-
*
|
|
1984
|
-
* To selectively include built-in items, import and filter `DEFAULT_WORKSPACE_MENU_ITEMS`:
|
|
1985
|
-
* ```
|
|
1986
|
-
* workspaceMenuItems: DEFAULT_WORKSPACE_MENU_ITEMS.filter(
|
|
1987
|
-
* i => ["workspace_projects", "assistants"].includes(i.id)
|
|
1988
|
-
* )
|
|
1989
|
-
* ```
|
|
1990
|
-
* Omit this field to use all defaults.
|
|
1940
|
+
* Error message if any
|
|
1991
1941
|
*/
|
|
1992
|
-
|
|
1942
|
+
error: Error | null;
|
|
1993
1943
|
/**
|
|
1994
|
-
|
|
1995
|
-
* When enabled, shows a database selection button in the sender footer
|
|
1996
|
-
* Defaults to true
|
|
1944
|
+
* Set the current thread
|
|
1997
1945
|
*/
|
|
1998
|
-
|
|
1946
|
+
setThread: (thread: ConversationThread | null) => void;
|
|
1999
1947
|
/**
|
|
2000
|
-
*
|
|
2001
|
-
* When enabled, shows a skill selection button in the sender footer
|
|
2002
|
-
* Defaults to true
|
|
1948
|
+
* Select a thread by ID
|
|
2003
1949
|
*/
|
|
2004
|
-
|
|
1950
|
+
selectThread: (threadId: string) => void;
|
|
2005
1951
|
/**
|
|
2006
|
-
*
|
|
2007
|
-
* When enabled, shows an agent selection button in the sender footer
|
|
2008
|
-
* Defaults to true
|
|
1952
|
+
* Create a new thread for the current assistant
|
|
2009
1953
|
*/
|
|
2010
|
-
|
|
1954
|
+
createThread: (label?: string) => Promise<ConversationThread>;
|
|
2011
1955
|
/**
|
|
2012
|
-
*
|
|
2013
|
-
* When enabled, shows a metrics datasource selection button in the sender footer
|
|
2014
|
-
* Defaults to true
|
|
1956
|
+
* List all threads for the current assistant
|
|
2015
1957
|
*/
|
|
2016
|
-
|
|
1958
|
+
listThreads: () => Promise<ConversationThread[]>;
|
|
2017
1959
|
/**
|
|
2018
|
-
*
|
|
2019
|
-
* When enabled, shows a model selection dropdown in the sender footer
|
|
2020
|
-
* Defaults to false
|
|
1960
|
+
* Update thread for the current assistant
|
|
2021
1961
|
*/
|
|
2022
|
-
|
|
1962
|
+
updateThread: (thread: ConversationThread) => Promise<void>;
|
|
2023
1963
|
/**
|
|
2024
|
-
*
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
* Defaults to "icon"
|
|
2028
|
-
*/
|
|
2029
|
-
sidebarMode?: "icon" | "expanded";
|
|
1964
|
+
* Get thread by ID
|
|
1965
|
+
*/
|
|
1966
|
+
getThreadById: (threadId: string) => ConversationThread | null;
|
|
2030
1967
|
/**
|
|
2031
|
-
*
|
|
2032
|
-
* Defaults to true
|
|
1968
|
+
* Delete a thread by ID
|
|
2033
1969
|
*/
|
|
2034
|
-
|
|
1970
|
+
deleteThread: (threadId: string) => Promise<void>;
|
|
2035
1971
|
/**
|
|
2036
|
-
*
|
|
2037
|
-
* Defaults to true
|
|
1972
|
+
* Clear the current thread
|
|
2038
1973
|
*/
|
|
2039
|
-
|
|
1974
|
+
clearThread: () => void;
|
|
2040
1975
|
/**
|
|
2041
|
-
*
|
|
2042
|
-
* Defaults to true
|
|
1976
|
+
* Refresh threads for the current assistant
|
|
2043
1977
|
*/
|
|
2044
|
-
|
|
1978
|
+
refresh: () => Promise<void>;
|
|
2045
1979
|
/**
|
|
2046
|
-
*
|
|
2047
|
-
*
|
|
1980
|
+
* Custom run configuration (cross-thread, assistant-level)
|
|
1981
|
+
* Used for metrics datasource and other assistant-wide settings
|
|
2048
1982
|
*/
|
|
2049
|
-
|
|
1983
|
+
customRunConfig: Record<string, any>;
|
|
2050
1984
|
/**
|
|
2051
|
-
*
|
|
2052
|
-
* Defaults to "Lattice"
|
|
1985
|
+
* Update custom run configuration
|
|
2053
1986
|
*/
|
|
2054
|
-
|
|
1987
|
+
updateCustomRunConfig: (config: Record<string, any>) => void;
|
|
1988
|
+
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Conversation context
|
|
1991
|
+
*/
|
|
1992
|
+
declare const ConversationContext: React$1.Context<ConversationContextValue>;
|
|
1993
|
+
/**
|
|
1994
|
+
* Props for ConversationContextProvider
|
|
1995
|
+
*/
|
|
1996
|
+
interface ConversationContextProviderProps {
|
|
1997
|
+
children: React.ReactNode;
|
|
1998
|
+
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Generate a thread label from the first message content
|
|
2001
|
+
* Extracts first 15 characters of text content, excluding attachments
|
|
2002
|
+
*/
|
|
2003
|
+
declare function generateLabelFromMessage(message: string): string;
|
|
2004
|
+
/**
|
|
2005
|
+
* Provider component for ConversationContext.
|
|
2006
|
+
* Manages conversation thread state for the currently selected assistant.
|
|
2007
|
+
*
|
|
2008
|
+
* @description
|
|
2009
|
+
* Coordinates with {@link AssistantContext} to load threads for the current assistant.
|
|
2010
|
+
* Key behaviors:
|
|
2011
|
+
* - **Thread loading**: Fetches threads from the API when the assistant changes. If no threads
|
|
2012
|
+
* exist, a new thread is automatically created.
|
|
2013
|
+
* - **Auto-selection**: Selects the most recently updated thread as the active thread when loading.
|
|
2014
|
+
* - **Cross-thread config**: Maintains an assistant-level `customRunConfig` shared across all threads
|
|
2015
|
+
* (useful for metrics datasource and other assistant-wide settings).
|
|
2016
|
+
* - **Thread operations**: Provides full CRUD operations (create, update, delete, list, select)
|
|
2017
|
+
* backed by the client SDK.
|
|
2018
|
+
*
|
|
2019
|
+
* Requires {@link AssistantContextProvider} ancestor and {@link LatticeChatShellContextProvider}.
|
|
2020
|
+
*
|
|
2021
|
+
* @param props - {@link ConversationContextProviderProps}
|
|
2022
|
+
* @param props.children - React children to render within the conversation context.
|
|
2023
|
+
*
|
|
2024
|
+
* @returns A React context provider wrapping children with {@link ConversationContext.Provider}.
|
|
2025
|
+
*
|
|
2026
|
+
* @example
|
|
2027
|
+
* ```tsx
|
|
2028
|
+
* <ConversationContextProvider>
|
|
2029
|
+
* <ThreadList />
|
|
2030
|
+
* </ConversationContextProvider>
|
|
2031
|
+
* ```
|
|
2032
|
+
*/
|
|
2033
|
+
declare const ConversationContextProvider: ({ children, }: ConversationContextProviderProps) => react_jsx_runtime.JSX.Element;
|
|
2034
|
+
/**
|
|
2035
|
+
* Hook to access ConversationContext
|
|
2036
|
+
* @returns Conversation context value
|
|
2037
|
+
* @throws Error if used outside of ConversationContextProvider
|
|
2038
|
+
*/
|
|
2039
|
+
declare const useConversationContext: () => ConversationContextValue;
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* Assistant state interface
|
|
2043
|
+
*/
|
|
2044
|
+
interface AssistantState {
|
|
2055
2045
|
/**
|
|
2056
|
-
*
|
|
2057
|
-
* If not provided, defaults to Cpu icon
|
|
2046
|
+
* List of all assistants
|
|
2058
2047
|
*/
|
|
2059
|
-
|
|
2048
|
+
assistants: Assistant[];
|
|
2060
2049
|
/**
|
|
2061
|
-
*
|
|
2062
|
-
* Allows registering custom prompt categories and items via shell config
|
|
2063
|
-
* If not provided, default prompt data will be used
|
|
2050
|
+
* Currently selected assistant
|
|
2064
2051
|
*/
|
|
2065
|
-
|
|
2052
|
+
currentAssistant: Assistant | null;
|
|
2053
|
+
/**
|
|
2054
|
+
* Whether data is being loaded
|
|
2055
|
+
*/
|
|
2056
|
+
isLoading: boolean;
|
|
2057
|
+
/**
|
|
2058
|
+
* Error message if any
|
|
2059
|
+
*/
|
|
2060
|
+
error: Error | null;
|
|
2066
2061
|
}
|
|
2067
2062
|
/**
|
|
2068
|
-
*
|
|
2063
|
+
* Assistant context value interface
|
|
2069
2064
|
*/
|
|
2070
|
-
interface
|
|
2065
|
+
interface AssistantContextValue extends AssistantState {
|
|
2071
2066
|
/**
|
|
2072
|
-
*
|
|
2067
|
+
* List all assistants
|
|
2073
2068
|
*/
|
|
2074
|
-
|
|
2069
|
+
listAssistants: () => Promise<void>;
|
|
2075
2070
|
/**
|
|
2076
|
-
*
|
|
2071
|
+
* Get a single assistant by ID
|
|
2077
2072
|
*/
|
|
2078
|
-
|
|
2073
|
+
getAssistant: (id: string) => Promise<Assistant>;
|
|
2079
2074
|
/**
|
|
2080
|
-
*
|
|
2075
|
+
* Create a new assistant
|
|
2081
2076
|
*/
|
|
2082
|
-
|
|
2077
|
+
createAssistant: (options: CreateAssistantOptions) => Promise<Assistant>;
|
|
2083
2078
|
/**
|
|
2084
|
-
*
|
|
2079
|
+
* Update an existing assistant
|
|
2085
2080
|
*/
|
|
2086
|
-
|
|
2081
|
+
updateAssistant: (id: string, options: UpdateAssistantOptions) => Promise<Assistant>;
|
|
2087
2082
|
/**
|
|
2088
|
-
*
|
|
2083
|
+
* Delete an assistant
|
|
2089
2084
|
*/
|
|
2090
|
-
|
|
2085
|
+
deleteAssistant: (id: string) => Promise<void>;
|
|
2091
2086
|
/**
|
|
2092
|
-
*
|
|
2087
|
+
* Select an assistant as current
|
|
2093
2088
|
*/
|
|
2094
|
-
|
|
2089
|
+
selectAssistant: (id: string) => Promise<void>;
|
|
2090
|
+
/**
|
|
2091
|
+
* Clear the current assistant selection
|
|
2092
|
+
*/
|
|
2093
|
+
clearCurrentAssistant: () => void;
|
|
2094
|
+
/**
|
|
2095
|
+
* Refresh the assistant list
|
|
2096
|
+
*/
|
|
2097
|
+
refresh: () => Promise<void>;
|
|
2095
2098
|
}
|
|
2096
2099
|
/**
|
|
2097
|
-
*
|
|
2098
|
-
*/
|
|
2099
|
-
declare const DEFAULT_MIDDLEWARE_TYPES: MiddlewareTypeDefinition[];
|
|
2100
|
-
/**
|
|
2101
|
-
* Lattice Chat Shell context
|
|
2100
|
+
* Assistant context
|
|
2102
2101
|
*/
|
|
2103
|
-
declare const
|
|
2102
|
+
declare const AssistantContext: React$1.Context<AssistantContextValue>;
|
|
2104
2103
|
/**
|
|
2105
|
-
* Props for
|
|
2104
|
+
* Props for AssistantContextProvider
|
|
2106
2105
|
*/
|
|
2107
|
-
interface
|
|
2106
|
+
interface AssistantContextProviderProps {
|
|
2108
2107
|
/**
|
|
2109
2108
|
* Children components
|
|
2110
2109
|
*/
|
|
2111
|
-
children: ReactNode;
|
|
2112
|
-
/**
|
|
2113
|
-
* Initial configuration (optional)
|
|
2114
|
-
*/
|
|
2115
|
-
initialConfig?: Partial<LatticeChatShellConfig>;
|
|
2110
|
+
children: React.ReactNode;
|
|
2116
2111
|
/**
|
|
2117
|
-
* Whether to
|
|
2112
|
+
* Whether to automatically load assistants on mount
|
|
2118
2113
|
*/
|
|
2119
|
-
|
|
2114
|
+
autoLoad?: boolean;
|
|
2120
2115
|
/**
|
|
2121
|
-
*
|
|
2116
|
+
* Initial assistant ID to select
|
|
2122
2117
|
*/
|
|
2123
|
-
|
|
2118
|
+
initialAssistantId?: string | null;
|
|
2124
2119
|
}
|
|
2125
2120
|
/**
|
|
2126
|
-
* Provider component for
|
|
2127
|
-
* Manages
|
|
2121
|
+
* Provider component for AssistantContext.
|
|
2122
|
+
* Manages assistant state and operations including CRUD, selection, and auto-loading.
|
|
2123
|
+
*
|
|
2124
|
+
* @description
|
|
2125
|
+
* Coordinates with the client SDK to provide assistant management:
|
|
2126
|
+
* - **Auto-load**: When `autoLoad` is `true` (default), fetches the assistant list on mount.
|
|
2127
|
+
* - **Auto-selection**: If `initialAssistantId` is provided, selects that assistant after loading.
|
|
2128
|
+
* Otherwise, auto-selects the first available assistant.
|
|
2129
|
+
* - **Re-selection**: If the currently selected assistant is removed from the list (e.g., deleted),
|
|
2130
|
+
* falls back to selecting the first available assistant.
|
|
2131
|
+
* - **CRUD operations**: Provides `createAssistant`, `updateAssistant`, `deleteAssistant`, and
|
|
2132
|
+
* `getAssistant` backed by the SDK, keeping local state in sync.
|
|
2133
|
+
*
|
|
2134
|
+
* Requires an {@link AxiomLatticeProvider} ancestor for the API client.
|
|
2135
|
+
*
|
|
2136
|
+
* @param props - {@link AssistantContextProviderProps}
|
|
2137
|
+
* @param props.children - React children to render within the assistant context.
|
|
2138
|
+
* @param props.autoLoad - Whether to automatically load assistants on mount. Defaults to `true`.
|
|
2139
|
+
* @param props.initialAssistantId - Optional assistant ID to auto-select on load.
|
|
2140
|
+
*
|
|
2141
|
+
* @returns A React context provider wrapping children with {@link AssistantContext.Provider}.
|
|
2142
|
+
*
|
|
2143
|
+
* @example
|
|
2144
|
+
* ```tsx
|
|
2145
|
+
* <AssistantContextProvider initialAssistantId="asst_123">
|
|
2146
|
+
* <AssistantSelector />
|
|
2147
|
+
* </AssistantContextProvider>
|
|
2148
|
+
* ```
|
|
2128
2149
|
*/
|
|
2129
|
-
declare const
|
|
2150
|
+
declare const AssistantContextProvider: ({ children, autoLoad, initialAssistantId, }: AssistantContextProviderProps) => react_jsx_runtime.JSX.Element;
|
|
2130
2151
|
/**
|
|
2131
|
-
* Hook to access
|
|
2132
|
-
* @returns
|
|
2133
|
-
* @throws Error if used outside of
|
|
2152
|
+
* Hook to access AssistantContext
|
|
2153
|
+
* @returns Assistant context value
|
|
2154
|
+
* @throws Error if used outside of AssistantContextProvider
|
|
2134
2155
|
*/
|
|
2135
|
-
declare const
|
|
2156
|
+
declare const useAssistantContext: () => AssistantContextValue;
|
|
2157
|
+
|
|
2158
|
+
interface Props$1 {
|
|
2159
|
+
connectionType: string;
|
|
2160
|
+
value?: string[];
|
|
2161
|
+
onChange: (keys: string[]) => void;
|
|
2162
|
+
}
|
|
2163
|
+
declare const ConnectionListField: React__default.FC<Props$1>;
|
|
2164
|
+
|
|
2165
|
+
interface ConnectionConfigDrawerContentProps {
|
|
2166
|
+
connectionType: string;
|
|
2167
|
+
title?: string;
|
|
2168
|
+
onBack?: () => void;
|
|
2169
|
+
}
|
|
2170
|
+
declare const ConnectionConfigDrawerContent: React__default.FC<ConnectionConfigDrawerContentProps>;
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* Connections Hub
|
|
2174
|
+
*
|
|
2175
|
+
* Lists all available connection types (from /api/middleware-types filtered by connectionSchema)
|
|
2176
|
+
* and delegates to ConnectionConfigDrawerContent for the selected type.
|
|
2177
|
+
*/
|
|
2178
|
+
|
|
2179
|
+
interface ConnectionsHubProps {
|
|
2180
|
+
tenantId?: string;
|
|
2181
|
+
}
|
|
2182
|
+
declare const ConnectionsHub: React__default.FC<ConnectionsHubProps>;
|
|
2136
2183
|
|
|
2137
2184
|
/**
|
|
2138
2185
|
* Represents a single message in the chat UI.
|
|
@@ -3417,4 +3464,4 @@ type IframeMessage = {
|
|
|
3417
3464
|
};
|
|
3418
3465
|
declare function generateIframeSrcdoc(): string;
|
|
3419
3466
|
|
|
3420
|
-
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, ChatErrorBoundary, type ChatErrorBoundaryProps, 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, type EntityAction, EntityCard, EntityCreateTrigger, EntityListShell, EntityListView, EntityRow, 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, PersonalAssistantChannelModal, 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, type ViewMode, ViewToggle, 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 };
|
|
3467
|
+
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, ChatErrorBoundary, type ChatErrorBoundaryProps, type ChatResponse, ChatSidebar, type ChatSidebarProps, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConnectionConfigDrawerContent, ConnectionListField, ConnectionsHub, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, DEFAULT_MENU_ITEMS, DEFAULT_MIDDLEWARE_TYPES, DEFAULT_WORKSPACE_MENU_ITEMS, type ElementMeta, type ElementProps, type EntityAction, EntityCard, EntityCreateTrigger, EntityListShell, EntityListView, EntityRow, 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, PersonalAssistantChannelModal, 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, type ViewMode, ViewToggle, 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, useMiddlewareTypes, useSideAppBrowser, useSideAppOpener, useTenants, useUsers };
|