@sciol/xyzen 0.2.1 → 0.2.3
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/components/layouts/XyzenAgent.d.ts +1 -0
- package/dist/components/layouts/components/ChatBubble.d.ts +1 -8
- package/dist/components/layouts/components/LoadingMessage.d.ts +5 -0
- package/dist/components/layouts/components/ToolCallCard.d.ts +9 -0
- package/dist/configs/index.d.ts +1 -1
- package/dist/service/mcpService.d.ts +1 -0
- package/dist/service/xyzenService.d.ts +22 -1
- package/dist/store/slices/chatSlice.d.ts +2 -0
- package/dist/store/slices/mcpSlice.d.ts +1 -0
- package/dist/store/types.d.ts +14 -0
- package/dist/xyzen.es.js +11155 -10524
- package/dist/xyzen.umd.js +67 -63
- package/package.json +2 -1
|
@@ -1,12 +1,5 @@
|
|
|
1
|
+
import { Message } from '../../../store/types';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
|
-
export interface Message {
|
|
3
|
-
id: string;
|
|
4
|
-
role: "user" | "assistant" | "system" | "tool";
|
|
5
|
-
content: string;
|
|
6
|
-
created_at: string;
|
|
7
|
-
avatar?: string;
|
|
8
|
-
isCurrentUser?: boolean;
|
|
9
|
-
}
|
|
10
3
|
interface ChatBubbleProps {
|
|
11
4
|
message: Message;
|
|
12
5
|
}
|
|
@@ -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 {};
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DEFAULT_BACKEND_URL
|
|
1
|
+
export declare const DEFAULT_BACKEND_URL: any;
|
|
@@ -3,15 +3,36 @@ interface StatusChangePayload {
|
|
|
3
3
|
connected: boolean;
|
|
4
4
|
error: string | null;
|
|
5
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
|
+
}
|
|
6
24
|
type ServiceCallback<T> = (payload: T) => void;
|
|
25
|
+
type MessageEventCallback = (event: MessageEvent) => void;
|
|
7
26
|
declare class XyzenService {
|
|
8
27
|
private ws;
|
|
9
28
|
private onMessageCallback;
|
|
29
|
+
private onMessageEventCallback;
|
|
10
30
|
private onStatusChangeCallback;
|
|
11
31
|
private backendUrl;
|
|
12
32
|
setBackendUrl(url: string): void;
|
|
13
|
-
connect(sessionId: string, topicId: string, onMessage: ServiceCallback<Message>, onStatusChange: ServiceCallback<StatusChangePayload
|
|
33
|
+
connect(sessionId: string, topicId: string, onMessage: ServiceCallback<Message>, onStatusChange: ServiceCallback<StatusChangePayload>, onMessageEvent?: MessageEventCallback): void;
|
|
14
34
|
sendMessage(message: string): void;
|
|
35
|
+
sendStructuredMessage(data: Record<string, unknown>): void;
|
|
15
36
|
disconnect(): void;
|
|
16
37
|
}
|
|
17
38
|
declare const xyzenService: XyzenService;
|
|
@@ -14,6 +14,8 @@ export interface ChatSlice {
|
|
|
14
14
|
sendMessage: (message: string) => void;
|
|
15
15
|
createDefaultChannel: (agentId?: string) => Promise<void>;
|
|
16
16
|
updateTopicName: (topicId: string, newName: string) => Promise<void>;
|
|
17
|
+
confirmToolCall: (channelId: string, toolCallId: string) => void;
|
|
18
|
+
cancelToolCall: (channelId: string, toolCallId: string) => void;
|
|
17
19
|
}
|
|
18
20
|
export declare const createChatSlice: StateCreator<XyzenState, [
|
|
19
21
|
["zustand/immer", never]
|
|
@@ -4,6 +4,7 @@ import { XyzenState } from '../types';
|
|
|
4
4
|
export interface McpSlice {
|
|
5
5
|
mcpServers: McpServer[];
|
|
6
6
|
fetchMcpServers: () => Promise<void>;
|
|
7
|
+
refreshMcpServers: () => Promise<void>;
|
|
7
8
|
addMcpServer: (server: McpServerCreate) => Promise<void>;
|
|
8
9
|
editMcpServer: (id: string, server: Partial<McpServerCreate>) => Promise<void>;
|
|
9
10
|
removeMcpServer: (id: string) => Promise<void>;
|
package/dist/store/types.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
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
|
+
}
|
|
2
12
|
export interface Message {
|
|
3
13
|
id: string;
|
|
4
14
|
content: string;
|
|
@@ -6,6 +16,10 @@ export interface Message {
|
|
|
6
16
|
created_at: string;
|
|
7
17
|
sender?: "user" | "assistant" | "system";
|
|
8
18
|
timestamp?: string;
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
isStreaming?: boolean;
|
|
21
|
+
toolCalls?: ToolCall[];
|
|
22
|
+
isToolCalling?: boolean;
|
|
9
23
|
}
|
|
10
24
|
export interface ChatChannel {
|
|
11
25
|
id: string;
|