@fleek-platform/agents-ui
Version:
The Fleek Platform Agents UI provides a simple interface for deploying, monitoring, and configuring your agents––making management straightforward
70 lines (69 loc) • 2.2 kB
TypeScript
import { type SenderRole } from '@utils/chat';
export type ChatMessage = {
id: string;
content: string;
senderId: string;
senderRole: SenderRole;
timestamp: number;
status: 'pending' | 'streaming' | 'success' | 'error';
};
type AgentUI = {
mode: 'chat' | 'form';
chatMessages?: ChatMessage[];
hasSwitchedToForm?: boolean;
leadMessage?: string;
};
type AgentUIState = {
agents: Record<string, AgentUI>;
getAgentState: (args: {
agentId: string;
}) => AgentUI | undefined;
getMessages: (args: {
agentId: string;
}) => ChatMessage[] | undefined;
getMessageById: (args: {
agentId: string;
messageId: string;
}) => ChatMessage | undefined;
getMessageByIndex: (args: {
agentId: string;
messageIndex: number;
}) => ChatMessage | undefined;
getLastAgentMessage: (args: {
agentId: string;
}) => ChatMessage | undefined;
getLastUserMessage: (args: {
agentId: string;
}) => ChatMessage | undefined;
getSuccessMessages: (args: {
agentId: string;
}) => ChatMessage[] | undefined;
setAgentState: (args: {
id: string;
data: Partial<AgentUI>;
}) => void;
clearAgentState: (args: {
agentId: string;
}) => void;
appendMessage: (args: {
agentId: string;
message: ChatMessage;
}) => void;
updateMessageById: (args: {
agentId: string;
messageId: string;
data: Partial<ChatMessage>;
}) => void;
};
export declare const useAgentDraftStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<AgentUIState>, "persist"> & {
persist: {
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AgentUIState, unknown>>) => void;
clearStorage: () => void;
rehydrate: () => Promise<void> | void;
hasHydrated: () => boolean;
onHydrate: (fn: (state: AgentUIState) => void) => () => void;
onFinishHydration: (fn: (state: AgentUIState) => void) => () => void;
getOptions: () => Partial<import("zustand/middleware").PersistOptions<AgentUIState, unknown>>;
};
}>;
export {};