@teodorruskvi/chat-core 0.1.26 → 0.1.27
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/features/conversation/hooks/useChatSession.d.ts +1 -0
- package/dist/features/streaming/contexts/types.d.ts +1 -0
- package/dist/index.esm.js +1844 -1791
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/types/domain/chat.d.ts +1 -0
- package/dist/types/domain/messages.d.ts +1 -0
- package/dist/types/domain/streaming.d.ts +17 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ChatMessage, PendingInterrupt, StreamEvent } from "@/types";
|
|
2
2
|
export interface MessagesState {
|
|
3
3
|
messages: ChatMessage[];
|
|
4
|
+
taskMessagesByScope: Record<string, ChatMessage[]>;
|
|
4
5
|
assemblingId: string | null;
|
|
5
6
|
lastCheckpointId: string | null;
|
|
6
7
|
lastCheckpointNs: string | null;
|
|
@@ -58,6 +58,10 @@ export type ActiveRunContext = {
|
|
|
58
58
|
isStreaming: boolean;
|
|
59
59
|
headers?: Record<string, string>;
|
|
60
60
|
};
|
|
61
|
+
export type StreamEventMeta = {
|
|
62
|
+
origin?: "agent" | "task";
|
|
63
|
+
scope?: string;
|
|
64
|
+
};
|
|
61
65
|
export type StreamFinishInfo = {
|
|
62
66
|
lastSeq: number;
|
|
63
67
|
lastCheckpointId: string | null;
|
|
@@ -107,6 +111,13 @@ export type ArtifactUpdateEvent = {
|
|
|
107
111
|
error?: string;
|
|
108
112
|
};
|
|
109
113
|
export type ToolStreamEvent = ToolStartEvent | ToolEndEvent | ArtifactUpdateEvent;
|
|
114
|
+
export type TaskStartEvent = {
|
|
115
|
+
type: "task.start";
|
|
116
|
+
id?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
subagentType?: string;
|
|
119
|
+
seq?: number;
|
|
120
|
+
} & StreamEventMeta;
|
|
110
121
|
export type MessageStreamEvent = ToolProgressEvent | {
|
|
111
122
|
type: "messages/partial";
|
|
112
123
|
messages: Array<{
|
|
@@ -177,6 +188,11 @@ export type SystemStreamEvent = {
|
|
|
177
188
|
} | {
|
|
178
189
|
type: "token";
|
|
179
190
|
token: string;
|
|
191
|
+
} | {
|
|
192
|
+
type: "status";
|
|
193
|
+
status: "completed" | "interrupted" | "error";
|
|
194
|
+
message?: string;
|
|
195
|
+
seq?: number;
|
|
180
196
|
};
|
|
181
197
|
export type HeartbeatEvent = Extract<SystemStreamEvent, {
|
|
182
198
|
type: "heartbeat";
|
|
@@ -184,7 +200,7 @@ export type HeartbeatEvent = Extract<SystemStreamEvent, {
|
|
|
184
200
|
export type ValuesEvent = Extract<SystemStreamEvent, {
|
|
185
201
|
type: "values";
|
|
186
202
|
}>;
|
|
187
|
-
export type StreamEvent = MessageStreamEvent | ToolStreamEvent | ThreadStreamEvent | SystemStreamEvent;
|
|
203
|
+
export type StreamEvent = (MessageStreamEvent | ToolStreamEvent | ThreadStreamEvent | SystemStreamEvent | TaskStartEvent) & StreamEventMeta;
|
|
188
204
|
export interface StreamEventHandlers {
|
|
189
205
|
onConnectionError?: (error: string) => void;
|
|
190
206
|
onError?: (error: string) => void;
|