@sciol/xyzen 0.3.0 → 0.3.1
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/app/App.d.ts +5 -0
- package/dist/app/AppFullscreen.d.ts +5 -0
- package/dist/app/LlmProviders.d.ts +1 -0
- package/dist/app/Mcp.d.ts +1 -0
- package/dist/assets/LlmIcon.d.ts +6 -0
- package/dist/assets/McpIcon.d.ts +3 -0
- package/dist/assets/ProfileIcon.d.ts +3 -0
- package/dist/assets/icons/AnthropicIcon.d.ts +2 -0
- package/dist/assets/icons/AzureIcon.d.ts +2 -0
- package/dist/assets/icons/GoogleIcon.d.ts +2 -0
- package/dist/assets/icons/OpenAIIcon.d.ts +2 -0
- package/dist/assets/icons/index.d.ts +4 -0
- package/dist/components/base/Badge.d.ts +9 -0
- package/dist/components/base/EditableTitle.d.ts +9 -0
- package/dist/components/base/Input.d.ts +4 -0
- package/dist/components/base/LoadingComponents.d.ts +23 -0
- package/dist/components/base/LoadingSpinner.d.ts +7 -0
- package/dist/components/base/Modal.d.ts +10 -0
- package/dist/components/base/Switch.d.ts +9 -0
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/features/AuthStatus.d.ts +5 -0
- package/dist/components/features/LayoutToggle.d.ts +5 -0
- package/dist/components/features/SettingsButton.d.ts +5 -0
- package/dist/components/features/ThemeToggle.d.ts +5 -0
- package/dist/components/features/index.d.ts +4 -0
- package/dist/components/layouts/XyzenAgent.d.ts +14 -0
- package/dist/components/layouts/XyzenChat.d.ts +1 -0
- package/dist/components/layouts/XyzenHistory.d.ts +1 -0
- package/dist/components/layouts/XyzenNodes.d.ts +1 -0
- package/dist/components/layouts/XyzenTopics.d.ts +5 -0
- package/dist/components/layouts/components/ChatBubble.d.ts +7 -0
- package/dist/components/layouts/components/ChatInput.d.ts +9 -0
- package/dist/components/layouts/components/ChatToolbar.d.ts +6 -0
- package/dist/components/layouts/components/EmptyChat.d.ts +3 -0
- package/dist/components/layouts/components/LoadingMessage.d.ts +5 -0
- package/dist/components/layouts/components/SessionHistory.d.ts +7 -0
- package/dist/components/layouts/components/ToolCallCard.d.ts +9 -0
- package/dist/components/layouts/components/WelcomeMessage.d.ts +30 -0
- package/dist/components/modals/AddAgentModal.d.ts +7 -0
- package/dist/components/modals/AddLlmProviderModal.d.ts +1 -0
- package/dist/components/modals/AddMcpServerModal.d.ts +1 -0
- package/dist/components/modals/ConfirmationModal.d.ts +9 -0
- package/dist/components/modals/EditAgentModal.d.ts +9 -0
- package/dist/components/modals/EditMcpServerModal.d.ts +1 -0
- package/dist/components/modals/McpServerItem.d.ts +9 -0
- package/dist/components/modals/SettingsModal.d.ts +1 -0
- package/dist/components/modals/ToolTestModal.d.ts +10 -0
- package/dist/components/modals/settings/ProviderConfigForm.d.ts +1 -0
- package/dist/components/modals/settings/ProviderList.d.ts +1 -0
- package/dist/components/modals/settings/StyleSettings.d.ts +1 -0
- package/dist/components/modals/settings/ThemeSettings.d.ts +1 -0
- package/dist/components/modals/settings/UiSettings.d.ts +2 -0
- package/dist/components/modals/settings/index.d.ts +5 -0
- package/dist/configs/index.d.ts +1 -0
- package/dist/hooks/useAuth.d.ts +14 -0
- package/dist/hooks/useTheme.d.ts +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/lib/Markdown.d.ts +6 -0
- package/dist/lib/formatDate.d.ts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/service/authService.d.ts +52 -0
- package/dist/service/llmProviderService.d.ts +39 -0
- package/dist/service/mcpService.d.ts +8 -0
- package/dist/service/websocketService.d.ts +8 -0
- package/dist/service/xyzenService.d.ts +39 -0
- package/dist/store/index.d.ts +15 -0
- package/dist/store/slices/agentSlice.d.ts +16 -0
- package/dist/store/slices/authSlice.d.ts +14 -0
- package/dist/store/slices/chatSlice.d.ts +24 -0
- package/dist/store/slices/index.d.ts +8 -0
- package/dist/store/slices/loadingSlice.d.ts +28 -0
- package/dist/store/slices/mcpSlice.d.ts +21 -0
- package/dist/store/slices/mcpToolSlice.d.ts +36 -0
- package/dist/store/slices/providerSlice.d.ts +22 -0
- package/dist/store/slices/uiSlice.d.ts +37 -0
- package/dist/store/types.d.ts +61 -0
- package/dist/types/llmProvider.d.ts +49 -0
- package/dist/types/mcp.d.ts +15 -0
- package/dist/utils/providerColors.d.ts +32 -0
- package/dist/utils/toolMessageParser.d.ts +31 -0
- package/dist/vite.svg +1 -0
- package/dist/xyzen.css +1 -0
- package/dist/xyzen.es.js +71064 -0
- package/dist/xyzen.umd.js +386 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LlmProviders(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Mcp(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface BadgeProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
variant?: "default" | "blue" | "green" | "yellow" | "red" | "gray";
|
|
5
|
+
size?: "sm" | "md";
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Badge: React.FC<BadgeProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface EditableTitleProps {
|
|
2
|
+
title: string;
|
|
3
|
+
onSave: (newTitle: string) => Promise<void>;
|
|
4
|
+
className?: string;
|
|
5
|
+
textClassName?: string;
|
|
6
|
+
maxLength?: number;
|
|
7
|
+
}
|
|
8
|
+
export default function EditableTitle({ title, onSave, className, textClassName, maxLength, }: EditableTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LoadingKey } from '../../store/slices/loadingSlice';
|
|
2
|
+
interface LoadingOverlayProps {
|
|
3
|
+
loadingKey: LoadingKey | string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
spinnerSize?: "sm" | "md" | "lg";
|
|
7
|
+
overlay?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function LoadingOverlay({ loadingKey, children, className, spinnerSize, overlay, }: LoadingOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface InlineLoadingProps {
|
|
11
|
+
loadingKey: LoadingKey | string;
|
|
12
|
+
loadingText?: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
spinnerSize?: "sm" | "md" | "lg";
|
|
15
|
+
}
|
|
16
|
+
export declare function InlineLoading({ loadingKey, loadingText, children, spinnerSize, }: InlineLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
interface LoadingButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
18
|
+
loadingKey?: LoadingKey | string;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function LoadingButton({ loadingKey, loading: externalLoading, children, disabled, className, ...props }: LoadingButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface ModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
maxWidth?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Modal({ isOpen, onClose, title, children, maxWidth, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Input';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Agent = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
mcp_servers: {
|
|
7
|
+
id: string;
|
|
8
|
+
}[];
|
|
9
|
+
mcp_server_ids?: string[];
|
|
10
|
+
user_id: string;
|
|
11
|
+
require_tool_confirmation?: boolean;
|
|
12
|
+
provider_id?: string | null;
|
|
13
|
+
};
|
|
14
|
+
export default function XyzenAgent(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function XyzenChat(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function XyzenHistory(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function XyzenNodes(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface ChatInputProps {
|
|
3
|
+
onSendMessage: (message: string) => void;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
height?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const ChatInput: React.FC<ChatInputProps>;
|
|
9
|
+
export default ChatInput;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface SessionHistoryProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
onSelectTopic?: (topicId: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export default function SessionHistory({ isOpen, onClose, onSelectTopic, }: SessionHistoryProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ToolCall } from '../../../store/types';
|
|
2
|
+
interface ToolCallCardProps {
|
|
3
|
+
toolCall: ToolCall;
|
|
4
|
+
className?: string;
|
|
5
|
+
onConfirm?: (toolCallId: string) => void;
|
|
6
|
+
onCancel?: (toolCallId: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export default function ToolCallCard({ toolCall, className, onConfirm, onCancel, }: ToolCallCardProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ChatData {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
assistant?: string;
|
|
6
|
+
assistant_name?: string;
|
|
7
|
+
messages_count: number;
|
|
8
|
+
last_message?: {
|
|
9
|
+
content: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
};
|
|
12
|
+
created_at: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
is_pinned: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface Assistant {
|
|
17
|
+
id: string;
|
|
18
|
+
key?: string;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
iconType: string;
|
|
22
|
+
iconColor: string;
|
|
23
|
+
category: string;
|
|
24
|
+
chats?: ChatData[];
|
|
25
|
+
}
|
|
26
|
+
interface WelcomeMessageProps {
|
|
27
|
+
assistant?: Assistant | null;
|
|
28
|
+
}
|
|
29
|
+
declare const WelcomeMessage: React.FC<WelcomeMessageProps>;
|
|
30
|
+
export default WelcomeMessage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AddLlmProviderModal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AddMcpServerModal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Agent } from '../layouts/XyzenAgent';
|
|
3
|
+
interface EditAgentModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
agent: Agent | null;
|
|
7
|
+
}
|
|
8
|
+
declare const EditAgentModal: React.FC<EditAgentModalProps>;
|
|
9
|
+
export default EditAgentModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditMcpServerModal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { McpServer } from '../../types/mcp';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
interface McpServerItemProps {
|
|
4
|
+
mcp: McpServer;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
onSelectionChange: (selected: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const McpServerItem: React.FC<McpServerItemProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SettingsModal(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpServer } from '../../types/mcp';
|
|
2
|
+
interface ToolTestModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
server: McpServer;
|
|
6
|
+
toolName: string;
|
|
7
|
+
toolDescription?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const ToolTestModal: React.FC<ToolTestModalProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProviderConfigForm: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ProviderList: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function StyleSettings(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ThemeSettings(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_BACKEND_URL: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UserInfo, AuthState } from '../service/authService';
|
|
2
|
+
export interface UseAuthReturn {
|
|
3
|
+
authState: AuthState;
|
|
4
|
+
user: UserInfo | undefined;
|
|
5
|
+
message: string;
|
|
6
|
+
provider: string | undefined;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
isAuthenticated: boolean;
|
|
9
|
+
isConfigured: boolean;
|
|
10
|
+
login: (token: string) => Promise<void>;
|
|
11
|
+
logout: () => void;
|
|
12
|
+
checkAuth: (force?: boolean) => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare function useAuth(): UseAuthReturn;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatTime(dateString: string): string;
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface AuthStatus {
|
|
2
|
+
is_configured: boolean;
|
|
3
|
+
provider?: string;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export interface UserInfo {
|
|
7
|
+
id: string;
|
|
8
|
+
username: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
display_name?: string;
|
|
11
|
+
avatar_url?: string;
|
|
12
|
+
roles?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface AuthValidationResponse {
|
|
15
|
+
success: boolean;
|
|
16
|
+
user_info?: UserInfo;
|
|
17
|
+
error_message?: string;
|
|
18
|
+
error_code?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare enum AuthState {
|
|
21
|
+
NOT_CONFIGURED = "not_configured",
|
|
22
|
+
NOT_AUTHENTICATED = "not_authenticated",
|
|
23
|
+
AUTHENTICATED = "authenticated",
|
|
24
|
+
ERROR = "error"
|
|
25
|
+
}
|
|
26
|
+
export interface AuthResult {
|
|
27
|
+
state: AuthState;
|
|
28
|
+
user?: UserInfo;
|
|
29
|
+
message: string;
|
|
30
|
+
provider?: string;
|
|
31
|
+
}
|
|
32
|
+
declare class AuthService {
|
|
33
|
+
private static readonly TOKEN_KEY;
|
|
34
|
+
private authCheckPromise;
|
|
35
|
+
private listeners;
|
|
36
|
+
getToken(): string | null;
|
|
37
|
+
setToken(token: string): void;
|
|
38
|
+
removeToken(): void;
|
|
39
|
+
addAuthStateListener(listener: (result: AuthResult) => void): void;
|
|
40
|
+
removeAuthStateListener(listener: (result: AuthResult) => void): void;
|
|
41
|
+
private notifyListeners;
|
|
42
|
+
getAuthStatus(): Promise<AuthStatus>;
|
|
43
|
+
validateToken(token?: string): Promise<AuthValidationResponse>;
|
|
44
|
+
getCurrentUser(): Promise<UserInfo | null>;
|
|
45
|
+
checkAuthState(force?: boolean): Promise<AuthResult>;
|
|
46
|
+
private _performAuthCheck;
|
|
47
|
+
autoLogin(): Promise<AuthResult>;
|
|
48
|
+
login(token: string): Promise<AuthResult>;
|
|
49
|
+
logout(): void;
|
|
50
|
+
}
|
|
51
|
+
export declare const authService: AuthService;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LlmProviderCreate, LlmProviderResponse, LlmProviderUpdate, ProviderTemplate } from '../types/llmProvider';
|
|
2
|
+
declare class LlmProviderService {
|
|
3
|
+
private getBackendUrl;
|
|
4
|
+
private createAuthHeaders;
|
|
5
|
+
/**
|
|
6
|
+
* Get provider templates for UI
|
|
7
|
+
*/
|
|
8
|
+
getProviderTemplates(): Promise<ProviderTemplate[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Get current user's providers
|
|
11
|
+
*/
|
|
12
|
+
getMyProviders(): Promise<LlmProviderResponse[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Get current user's default provider
|
|
15
|
+
*/
|
|
16
|
+
getMyDefaultProvider(): Promise<LlmProviderResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Set a provider as default
|
|
19
|
+
*/
|
|
20
|
+
setDefaultProvider(providerId: string): Promise<LlmProviderResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Create a new provider
|
|
23
|
+
*/
|
|
24
|
+
createProvider(provider: LlmProviderCreate): Promise<LlmProviderResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a single provider by ID
|
|
27
|
+
*/
|
|
28
|
+
getProvider(id: string): Promise<LlmProviderResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Update a provider
|
|
31
|
+
*/
|
|
32
|
+
updateProvider(id: string, provider: LlmProviderUpdate): Promise<LlmProviderResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Delete a provider
|
|
35
|
+
*/
|
|
36
|
+
deleteProvider(id: string): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export declare const llmProviderService: LlmProviderService;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { McpServer, McpServerCreate, McpServerUpdate } from '../types/mcp';
|
|
2
|
+
export declare const mcpService: {
|
|
3
|
+
getMcpServers(): Promise<McpServer[]>;
|
|
4
|
+
createMcpServer(server: McpServerCreate): Promise<McpServer>;
|
|
5
|
+
updateMcpServer(id: string, server: McpServerUpdate): Promise<McpServer>;
|
|
6
|
+
deleteMcpServer(id: string): Promise<void>;
|
|
7
|
+
refreshMcpServers(): Promise<void>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Message } from '../store/types';
|
|
2
|
+
interface StatusChangePayload {
|
|
3
|
+
connected: boolean;
|
|
4
|
+
error: string | null;
|
|
5
|
+
}
|
|
6
|
+
interface MessageEvent {
|
|
7
|
+
type: "message" | "loading" | "streaming_start" | "streaming_chunk" | "streaming_end" | "message_saved" | "tool_call_request" | "tool_call_response" | "error";
|
|
8
|
+
data: Message | {
|
|
9
|
+
id: string;
|
|
10
|
+
content?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
stream_id?: string;
|
|
13
|
+
db_id?: string;
|
|
14
|
+
created_at?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
arguments?: Record<string, unknown>;
|
|
18
|
+
status?: string;
|
|
19
|
+
timestamp?: number;
|
|
20
|
+
toolCallId?: string;
|
|
21
|
+
confirmed?: boolean;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
type ServiceCallback<T> = (payload: T) => void;
|
|
25
|
+
type MessageEventCallback = (event: MessageEvent) => void;
|
|
26
|
+
declare class XyzenService {
|
|
27
|
+
private ws;
|
|
28
|
+
private onMessageCallback;
|
|
29
|
+
private onMessageEventCallback;
|
|
30
|
+
private onStatusChangeCallback;
|
|
31
|
+
private backendUrl;
|
|
32
|
+
setBackendUrl(url: string): void;
|
|
33
|
+
connect(sessionId: string, topicId: string, onMessage: ServiceCallback<Message>, onStatusChange: ServiceCallback<StatusChangePayload>, onMessageEvent?: MessageEventCallback): void;
|
|
34
|
+
sendMessage(message: string): void;
|
|
35
|
+
sendStructuredMessage(data: Record<string, unknown>): void;
|
|
36
|
+
disconnect(): void;
|
|
37
|
+
}
|
|
38
|
+
declare const xyzenService: XyzenService;
|
|
39
|
+
export default xyzenService;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { XyzenState } from './types';
|
|
2
|
+
export declare const useXyzen: import('zustand').UseBoundStore<Omit<Omit<import('zustand').StoreApi<XyzenState>, "persist"> & {
|
|
3
|
+
persist: {
|
|
4
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<XyzenState, unknown>>) => void;
|
|
5
|
+
clearStorage: () => void;
|
|
6
|
+
rehydrate: () => Promise<void> | void;
|
|
7
|
+
hasHydrated: () => boolean;
|
|
8
|
+
onHydrate: (fn: (state: XyzenState) => void) => () => void;
|
|
9
|
+
onFinishHydration: (fn: (state: XyzenState) => void) => () => void;
|
|
10
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<XyzenState, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
}, "setState"> & {
|
|
13
|
+
setState(nextStateOrUpdater: XyzenState | Partial<XyzenState> | ((state: import('immer').WritableDraft<XyzenState>) => void), shouldReplace?: false): void;
|
|
14
|
+
setState(nextStateOrUpdater: XyzenState | ((state: import('immer').WritableDraft<XyzenState>) => void), shouldReplace: true): void;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Agent } from '../../components/layouts/XyzenAgent';
|
|
2
|
+
import { StateCreator } from 'zustand';
|
|
3
|
+
import { XyzenState } from '../types';
|
|
4
|
+
export interface AgentSlice {
|
|
5
|
+
agents: Agent[];
|
|
6
|
+
agentsLoading: boolean;
|
|
7
|
+
fetchAgents: () => Promise<void>;
|
|
8
|
+
createAgent: (agent: Omit<Agent, "id">) => Promise<void>;
|
|
9
|
+
updateAgent: (agent: Agent) => Promise<void>;
|
|
10
|
+
updateAgentProvider: (agentId: string, providerId: string | null) => Promise<void>;
|
|
11
|
+
deleteAgent: (id: string) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare const createAgentSlice: StateCreator<XyzenState, [
|
|
14
|
+
["zustand/immer", never]
|
|
15
|
+
], [
|
|
16
|
+
], AgentSlice>;
|