@sciol/xyzen 0.3.0 → 0.3.2
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 +13 -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/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/NotificationModal.d.ts +11 -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 +7 -0
- package/dist/lib/formatDate.d.ts +1 -0
- package/dist/main.d.ts +0 -0
- package/dist/service/authService.d.ts +54 -0
- package/dist/service/llmProviderService.d.ts +31 -0
- package/dist/service/mcpService.d.ts +9 -0
- package/dist/service/websocketService.d.ts +8 -0
- package/dist/service/xyzenService.d.ts +44 -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 +35 -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 +24 -0
- package/dist/store/slices/mcpToolSlice.d.ts +36 -0
- package/dist/store/slices/providerSlice.d.ts +26 -0
- package/dist/store/slices/uiSlice.d.ts +37 -0
- package/dist/store/types.d.ts +62 -0
- package/dist/types/llmProvider.d.ts +49 -0
- package/dist/types/mcp.d.ts +24 -0
- package/dist/utils/providerColors.d.ts +32 -0
- package/dist/utils/providerPreferences.d.ts +63 -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 +71832 -0
- package/dist/xyzen.umd.js +385 -0
- package/package.json +1 -1
|
@@ -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>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StateCreator } from 'zustand';
|
|
2
|
+
import { User, XyzenState } from '../types';
|
|
3
|
+
export interface AuthSlice {
|
|
4
|
+
user: User | null;
|
|
5
|
+
token: string | null;
|
|
6
|
+
status: "idle" | "loading" | "succeeded" | "failed";
|
|
7
|
+
login: (token: string) => Promise<void>;
|
|
8
|
+
logout: () => void;
|
|
9
|
+
fetchUserByToken: () => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const createAuthSlice: StateCreator<XyzenState, [
|
|
12
|
+
["zustand/immer", never]
|
|
13
|
+
], [
|
|
14
|
+
], AuthSlice>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { StateCreator } from 'zustand';
|
|
2
|
+
import { ChatChannel, ChatHistoryItem, XyzenState } from '../types';
|
|
3
|
+
export interface ChatSlice {
|
|
4
|
+
activeChatChannel: string | null;
|
|
5
|
+
chatHistory: ChatHistoryItem[];
|
|
6
|
+
chatHistoryLoading: boolean;
|
|
7
|
+
channels: Record<string, ChatChannel>;
|
|
8
|
+
notification: {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
title: string;
|
|
11
|
+
message: string;
|
|
12
|
+
type: "info" | "warning" | "error" | "success";
|
|
13
|
+
actionLabel?: string;
|
|
14
|
+
onAction?: () => void;
|
|
15
|
+
} | null;
|
|
16
|
+
setActiveChatChannel: (channelUUID: string | null) => void;
|
|
17
|
+
fetchChatHistory: () => Promise<void>;
|
|
18
|
+
togglePinChat: (chatId: string) => void;
|
|
19
|
+
activateChannel: (topicId: string) => Promise<void>;
|
|
20
|
+
connectToChannel: (sessionId: string, topicId: string) => void;
|
|
21
|
+
disconnectFromChannel: () => void;
|
|
22
|
+
sendMessage: (message: string) => void;
|
|
23
|
+
createDefaultChannel: (agentId?: string) => Promise<void>;
|
|
24
|
+
updateTopicName: (topicId: string, newName: string) => Promise<void>;
|
|
25
|
+
deleteTopic: (topicId: string) => Promise<void>;
|
|
26
|
+
clearSessionTopics: (sessionId: string) => Promise<void>;
|
|
27
|
+
confirmToolCall: (channelId: string, toolCallId: string) => void;
|
|
28
|
+
cancelToolCall: (channelId: string, toolCallId: string) => void;
|
|
29
|
+
showNotification: (title: string, message: string, type?: "info" | "warning" | "error" | "success", actionLabel?: string, onAction?: () => void) => void;
|
|
30
|
+
closeNotification: () => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const createChatSlice: StateCreator<XyzenState, [
|
|
33
|
+
["zustand/immer", never]
|
|
34
|
+
], [
|
|
35
|
+
], ChatSlice>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StateCreator } from 'zustand';
|
|
2
|
+
import { XyzenState } from '../types';
|
|
3
|
+
export interface LoadingSlice {
|
|
4
|
+
loadingStates: Record<string, boolean>;
|
|
5
|
+
setLoading: (key: string, loading: boolean) => void;
|
|
6
|
+
getLoading: (key: string) => boolean;
|
|
7
|
+
clearAllLoading: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const createLoadingSlice: StateCreator<XyzenState, [
|
|
10
|
+
["zustand/immer", never]
|
|
11
|
+
], [
|
|
12
|
+
], LoadingSlice>;
|
|
13
|
+
export declare const LoadingKeys: {
|
|
14
|
+
readonly CHAT_HISTORY: "chatHistory";
|
|
15
|
+
readonly AGENTS_LIST: "agentsList";
|
|
16
|
+
readonly TOPIC_MESSAGES: "topicMessages";
|
|
17
|
+
readonly USER_AUTH: "userAuth";
|
|
18
|
+
readonly CREATE_SESSION: "createSession";
|
|
19
|
+
readonly UPDATE_TOPIC: "updateTopic";
|
|
20
|
+
readonly AGENT_CREATE: "agentCreate";
|
|
21
|
+
readonly AGENT_UPDATE: "agentUpdate";
|
|
22
|
+
readonly AGENT_DELETE: "agentDelete";
|
|
23
|
+
readonly MCP_SERVERS: "mcpServers";
|
|
24
|
+
readonly MCP_SERVER_CREATE: "mcpServerCreate";
|
|
25
|
+
readonly MCP_SERVER_UPDATE: "mcpServerUpdate";
|
|
26
|
+
readonly MCP_SERVER_DELETE: "mcpServerDelete";
|
|
27
|
+
};
|
|
28
|
+
export type LoadingKey = (typeof LoadingKeys)[keyof typeof LoadingKeys];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BuiltinMcpServer, McpServer, McpServerCreate, McpServerUpdate } from '../../types/mcp';
|
|
2
|
+
import { StateCreator } from 'zustand';
|
|
3
|
+
import { XyzenState } from '../types';
|
|
4
|
+
export interface McpSlice {
|
|
5
|
+
mcpServers: McpServer[];
|
|
6
|
+
builtinMcpServers: BuiltinMcpServer[];
|
|
7
|
+
lastFetchTime: number;
|
|
8
|
+
isEditMcpServerModalOpen: boolean;
|
|
9
|
+
editingMcpServer: McpServer | null;
|
|
10
|
+
fetchMcpServers: () => Promise<void>;
|
|
11
|
+
fetchBuiltinMcpServers: () => Promise<void>;
|
|
12
|
+
refreshMcpServers: () => Promise<void>;
|
|
13
|
+
addMcpServer: (server: McpServerCreate) => Promise<void>;
|
|
14
|
+
quickAddBuiltinServer: (server: BuiltinMcpServer) => Promise<void>;
|
|
15
|
+
editMcpServer: (id: string, server: McpServerUpdate) => Promise<void>;
|
|
16
|
+
removeMcpServer: (id: string) => Promise<void>;
|
|
17
|
+
updateMcpServerInList: (server: McpServer) => void;
|
|
18
|
+
openEditMcpServerModal: (server: McpServer) => void;
|
|
19
|
+
closeEditMcpServerModal: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const createMcpSlice: StateCreator<XyzenState, [
|
|
22
|
+
["zustand/immer", never]
|
|
23
|
+
], [
|
|
24
|
+
], McpSlice>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { McpServer } from '../../types/mcp';
|
|
2
|
+
import { StateCreator } from 'zustand';
|
|
3
|
+
import { XyzenState } from '../types';
|
|
4
|
+
export interface McpToolState {
|
|
5
|
+
toolTestModal: {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
server?: McpServer;
|
|
8
|
+
toolName?: string;
|
|
9
|
+
toolDescription?: string;
|
|
10
|
+
};
|
|
11
|
+
toolExecutionHistory: ToolExecution[];
|
|
12
|
+
}
|
|
13
|
+
export interface ToolExecution {
|
|
14
|
+
id: string;
|
|
15
|
+
serverId: string;
|
|
16
|
+
toolName: string;
|
|
17
|
+
parameters: Record<string, unknown>;
|
|
18
|
+
result?: unknown;
|
|
19
|
+
success: boolean;
|
|
20
|
+
error?: string;
|
|
21
|
+
executionTime: number;
|
|
22
|
+
timestamp: Date;
|
|
23
|
+
}
|
|
24
|
+
export interface McpToolActions {
|
|
25
|
+
openToolTestModal: (server: McpServer, toolName: string, toolDescription?: string) => void;
|
|
26
|
+
closeToolTestModal: () => void;
|
|
27
|
+
addToolExecution: (execution: Omit<ToolExecution, "id" | "timestamp">) => void;
|
|
28
|
+
clearToolExecutionHistory: () => void;
|
|
29
|
+
getToolExecutionHistory: (serverId?: string, toolName?: string) => ToolExecution[];
|
|
30
|
+
}
|
|
31
|
+
export interface McpToolSlice extends McpToolState, McpToolActions {
|
|
32
|
+
}
|
|
33
|
+
export declare const createMcpToolSlice: StateCreator<XyzenState, [
|
|
34
|
+
["zustand/immer", never]
|
|
35
|
+
], [
|
|
36
|
+
], McpToolSlice>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LlmProviderCreate, LlmProviderResponse, LlmProviderUpdate, ProviderTemplate } from '../../types/llmProvider';
|
|
2
|
+
import { StateCreator } from 'zustand';
|
|
3
|
+
import { XyzenState } from '../types';
|
|
4
|
+
export interface ProviderSlice {
|
|
5
|
+
llmProviders: LlmProviderResponse[];
|
|
6
|
+
llmProvidersLoading: boolean;
|
|
7
|
+
providerTemplates: ProviderTemplate[];
|
|
8
|
+
templatesLoading: boolean;
|
|
9
|
+
userDefaultProviderId: string | null;
|
|
10
|
+
fetchProviderTemplates: () => Promise<void>;
|
|
11
|
+
fetchMyProviders: () => Promise<void>;
|
|
12
|
+
addProvider: (provider: LlmProviderCreate) => Promise<void>;
|
|
13
|
+
updateProvider: (id: string, provider: LlmProviderUpdate) => Promise<void>;
|
|
14
|
+
removeProvider: (id: string) => Promise<void>;
|
|
15
|
+
initializeProviderPreferences: () => void;
|
|
16
|
+
setUserDefaultProvider: (providerId: string | null) => void;
|
|
17
|
+
getUserDefaultProvider: () => LlmProviderResponse | null;
|
|
18
|
+
resolveProviderForAgent: (agent: {
|
|
19
|
+
id: string;
|
|
20
|
+
provider_id?: string | null;
|
|
21
|
+
} | null) => LlmProviderResponse | null;
|
|
22
|
+
}
|
|
23
|
+
export declare const createProviderSlice: StateCreator<XyzenState, [
|
|
24
|
+
["zustand/immer", never]
|
|
25
|
+
], [
|
|
26
|
+
], ProviderSlice>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StateCreator } from 'zustand';
|
|
2
|
+
import { Theme, XyzenState, LayoutStyle, UiSettingType } from '../types';
|
|
3
|
+
export interface UiSlice {
|
|
4
|
+
backendUrl: string;
|
|
5
|
+
isXyzenOpen: boolean;
|
|
6
|
+
panelWidth: number;
|
|
7
|
+
activeTabIndex: number;
|
|
8
|
+
theme: Theme;
|
|
9
|
+
layoutStyle: LayoutStyle;
|
|
10
|
+
isAddMcpServerModalOpen: boolean;
|
|
11
|
+
isAddLlmProviderModalOpen: boolean;
|
|
12
|
+
isSettingsModalOpen: boolean;
|
|
13
|
+
activeSettingsCategory: string;
|
|
14
|
+
activeUiSetting: UiSettingType;
|
|
15
|
+
selectedProviderId: string | null;
|
|
16
|
+
toggleXyzen: () => void;
|
|
17
|
+
openXyzen: () => void;
|
|
18
|
+
closeXyzen: () => void;
|
|
19
|
+
setPanelWidth: (width: number) => void;
|
|
20
|
+
setTabIndex: (index: number) => void;
|
|
21
|
+
setTheme: (theme: Theme) => void;
|
|
22
|
+
setLayoutStyle: (style: LayoutStyle) => void;
|
|
23
|
+
setBackendUrl: (url: string) => void;
|
|
24
|
+
openAddMcpServerModal: () => void;
|
|
25
|
+
closeAddMcpServerModal: () => void;
|
|
26
|
+
openAddLlmProviderModal: () => void;
|
|
27
|
+
closeAddLlmProviderModal: () => void;
|
|
28
|
+
openSettingsModal: (category?: string) => void;
|
|
29
|
+
closeSettingsModal: () => void;
|
|
30
|
+
setActiveSettingsCategory: (category: string) => void;
|
|
31
|
+
setActiveUiSetting: (setting: UiSettingType) => void;
|
|
32
|
+
setSelectedProvider: (id: string | null) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const createUiSlice: StateCreator<XyzenState, [
|
|
35
|
+
["zustand/immer", never]
|
|
36
|
+
], [
|
|
37
|
+
], UiSlice>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AgentSlice, AuthSlice, ChatSlice, LoadingSlice, McpSlice, McpToolSlice, ProviderSlice, UiSlice } from './slices';
|
|
2
|
+
export interface ToolCall {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
arguments: Record<string, unknown>;
|
|
7
|
+
status: "pending" | "waiting_confirmation" | "executing" | "completed" | "failed";
|
|
8
|
+
result?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Message {
|
|
13
|
+
id: string;
|
|
14
|
+
content: string;
|
|
15
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
16
|
+
created_at: string;
|
|
17
|
+
sender?: "user" | "assistant" | "system";
|
|
18
|
+
timestamp?: string;
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
isStreaming?: boolean;
|
|
21
|
+
toolCalls?: ToolCall[];
|
|
22
|
+
isToolCalling?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ChatChannel {
|
|
25
|
+
id: string;
|
|
26
|
+
sessionId: string;
|
|
27
|
+
title: string;
|
|
28
|
+
messages: Message[];
|
|
29
|
+
agentId?: string;
|
|
30
|
+
connected: boolean;
|
|
31
|
+
error: string | null;
|
|
32
|
+
responding?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface ChatHistoryItem {
|
|
35
|
+
id: string;
|
|
36
|
+
title: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
assistantTitle: string;
|
|
39
|
+
lastMessage?: string;
|
|
40
|
+
isPinned: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface User {
|
|
43
|
+
id?: string;
|
|
44
|
+
username: string;
|
|
45
|
+
avatar: string;
|
|
46
|
+
}
|
|
47
|
+
export type Theme = "light" | "dark" | "system";
|
|
48
|
+
export type LayoutStyle = "sidebar" | "fullscreen";
|
|
49
|
+
export type UiSettingType = "theme" | "style";
|
|
50
|
+
export interface TopicResponse {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
updated_at: string;
|
|
54
|
+
}
|
|
55
|
+
export interface SessionResponse {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
user_id: string;
|
|
59
|
+
agent_id?: string;
|
|
60
|
+
topics: TopicResponse[];
|
|
61
|
+
}
|
|
62
|
+
export type XyzenState = UiSlice & ChatSlice & AgentSlice & McpSlice & McpToolSlice & ProviderSlice & AuthSlice & LoadingSlice;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface LlmProvider {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
api: string;
|
|
5
|
+
key: string;
|
|
6
|
+
model: string;
|
|
7
|
+
provider_type: string;
|
|
8
|
+
max_tokens: number;
|
|
9
|
+
temperature: number;
|
|
10
|
+
timeout: number;
|
|
11
|
+
is_default: boolean;
|
|
12
|
+
is_system: boolean;
|
|
13
|
+
user_id: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LlmProviderCreate {
|
|
16
|
+
name: string;
|
|
17
|
+
api: string;
|
|
18
|
+
key: string;
|
|
19
|
+
model: string;
|
|
20
|
+
provider_type: string;
|
|
21
|
+
max_tokens?: number;
|
|
22
|
+
temperature?: number;
|
|
23
|
+
timeout?: number;
|
|
24
|
+
user_id: string;
|
|
25
|
+
is_default?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface LlmProviderUpdate {
|
|
28
|
+
name?: string;
|
|
29
|
+
api?: string;
|
|
30
|
+
key?: string;
|
|
31
|
+
model?: string;
|
|
32
|
+
provider_type?: string;
|
|
33
|
+
max_tokens?: number;
|
|
34
|
+
temperature?: number;
|
|
35
|
+
timeout?: number;
|
|
36
|
+
is_default?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export type LlmProviderResponse = LlmProvider;
|
|
39
|
+
export interface SetDefaultProviderRequest {
|
|
40
|
+
provider_id: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ProviderTemplate {
|
|
43
|
+
type: string;
|
|
44
|
+
display_name: string;
|
|
45
|
+
description: string;
|
|
46
|
+
required_fields: string[];
|
|
47
|
+
optional_fields: string[];
|
|
48
|
+
default_config: Record<string, string | number | boolean>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface McpServer {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
url: string;
|
|
6
|
+
token: string;
|
|
7
|
+
status: "online" | "offline" | string;
|
|
8
|
+
tools?: {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}[];
|
|
12
|
+
user_id: string;
|
|
13
|
+
}
|
|
14
|
+
export interface BuiltinMcpServer {
|
|
15
|
+
name: string;
|
|
16
|
+
module_name: string;
|
|
17
|
+
mount_path: string;
|
|
18
|
+
description: string;
|
|
19
|
+
is_builtin: boolean;
|
|
20
|
+
requires_auth: boolean;
|
|
21
|
+
is_default?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type McpServerCreate = Omit<McpServer, "id" | "status" | "tools" | "user_id">;
|
|
24
|
+
export type McpServerUpdate = Partial<Omit<McpServer, "id" | "tools" | "user_id">>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple color scheme for provider selection
|
|
3
|
+
* Blue for selected, grey for unselected
|
|
4
|
+
*/
|
|
5
|
+
export declare const PROVIDER_COLORS: {
|
|
6
|
+
readonly selected: {
|
|
7
|
+
readonly bg: "bg-blue-100 dark:bg-blue-900/30";
|
|
8
|
+
readonly text: "text-blue-700 dark:text-blue-400";
|
|
9
|
+
readonly icon: "text-blue-600 dark:text-blue-500";
|
|
10
|
+
readonly badge: "bg-blue-500";
|
|
11
|
+
};
|
|
12
|
+
readonly unselected: {
|
|
13
|
+
readonly bg: "bg-neutral-100 dark:bg-neutral-800/30";
|
|
14
|
+
readonly text: "text-neutral-700 dark:text-neutral-400";
|
|
15
|
+
readonly icon: "text-neutral-600 dark:text-neutral-500";
|
|
16
|
+
readonly badge: "bg-neutral-500";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Get color classes based on selection state
|
|
21
|
+
*/
|
|
22
|
+
export declare function getProviderColor(isSelected: boolean): {
|
|
23
|
+
readonly bg: "bg-blue-100 dark:bg-blue-900/30";
|
|
24
|
+
readonly text: "text-blue-700 dark:text-blue-400";
|
|
25
|
+
readonly icon: "text-blue-600 dark:text-blue-500";
|
|
26
|
+
readonly badge: "bg-blue-500";
|
|
27
|
+
} | {
|
|
28
|
+
readonly bg: "bg-neutral-100 dark:bg-neutral-800/30";
|
|
29
|
+
readonly text: "text-neutral-700 dark:text-neutral-400";
|
|
30
|
+
readonly icon: "text-neutral-600 dark:text-neutral-500";
|
|
31
|
+
readonly badge: "bg-neutral-500";
|
|
32
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LlmProviderResponse } from '../types/llmProvider';
|
|
2
|
+
interface UserProviderPreferences {
|
|
3
|
+
defaultProviderId: string | null;
|
|
4
|
+
lastUsedProviders: Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Manager for client-side provider preferences using localStorage
|
|
8
|
+
*/
|
|
9
|
+
export declare class ProviderPreferencesManager {
|
|
10
|
+
private static STORAGE_KEY;
|
|
11
|
+
/**
|
|
12
|
+
* Get user's provider preferences from localStorage
|
|
13
|
+
*/
|
|
14
|
+
static getPreferences(): UserProviderPreferences;
|
|
15
|
+
/**
|
|
16
|
+
* Save user's provider preferences to localStorage
|
|
17
|
+
*/
|
|
18
|
+
private static savePreferences;
|
|
19
|
+
/**
|
|
20
|
+
* Set the user's global default provider
|
|
21
|
+
*/
|
|
22
|
+
static setDefaultProvider(providerId: string | null): void;
|
|
23
|
+
/**
|
|
24
|
+
* Get the user's global default provider ID
|
|
25
|
+
*/
|
|
26
|
+
static getDefaultProviderId(): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Get the user's global default provider from available providers
|
|
29
|
+
*/
|
|
30
|
+
static getDefaultProvider(availableProviders: LlmProviderResponse[]): LlmProviderResponse | null;
|
|
31
|
+
/**
|
|
32
|
+
* Set the last used provider for a specific agent
|
|
33
|
+
*/
|
|
34
|
+
static setLastUsedProviderForAgent(agentId: string, providerId: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Get the last used provider for a specific agent
|
|
37
|
+
*/
|
|
38
|
+
static getLastUsedProviderForAgent(agentId: string): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Clear all preferences (useful for logout or reset)
|
|
41
|
+
*/
|
|
42
|
+
static clearPreferences(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Migrate from database-based defaults (temporary migration helper)
|
|
45
|
+
* Call this once when providers are first loaded
|
|
46
|
+
*/
|
|
47
|
+
static migrateFromDatabaseDefault(providers: LlmProviderResponse[]): void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Provider resolution logic with clear hierarchy
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveProviderForAgent(agent: {
|
|
53
|
+
id: string;
|
|
54
|
+
provider_id?: string | null;
|
|
55
|
+
} | null, availableProviders: LlmProviderResponse[]): LlmProviderResponse | null;
|
|
56
|
+
/**
|
|
57
|
+
* Get a human-readable description of where the provider comes from
|
|
58
|
+
*/
|
|
59
|
+
export declare function getProviderSourceDescription(agent: {
|
|
60
|
+
id: string;
|
|
61
|
+
provider_id?: string | null;
|
|
62
|
+
} | null, provider: LlmProviderResponse | null, availableProviders: LlmProviderResponse[]): string;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ToolCall } from '../store/types';
|
|
2
|
+
/**
|
|
3
|
+
* Parsed tool event from backend message content
|
|
4
|
+
*/
|
|
5
|
+
interface ParsedToolEvent {
|
|
6
|
+
event: "tool_call_request" | "tool_call_response";
|
|
7
|
+
id?: string;
|
|
8
|
+
toolCallId?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
arguments?: Record<string, unknown>;
|
|
12
|
+
status?: string;
|
|
13
|
+
result?: unknown;
|
|
14
|
+
error?: string;
|
|
15
|
+
timestamp?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse JSON content from a tool message
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseToolMessage(content: string): ParsedToolEvent | null;
|
|
21
|
+
/**
|
|
22
|
+
* Convert parsed tool event to ToolCall interface
|
|
23
|
+
*/
|
|
24
|
+
export declare function toolEventToToolCall(event: ParsedToolEvent): ToolCall | null;
|
|
25
|
+
/**
|
|
26
|
+
* Group tool messages to merge request/response pairs
|
|
27
|
+
* Returns a map of toolCallId -> merged ToolCall
|
|
28
|
+
* For history display, tool calls are shown as completed with arguments and results together
|
|
29
|
+
*/
|
|
30
|
+
export declare function groupToolEvents(events: ParsedToolEvent[]): Map<string, ToolCall>;
|
|
31
|
+
export {};
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|