@teodorruskvi/chat-core 0.1.26 → 0.1.28
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 +1855 -1787
- 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/shared/core/api/utils/http.d.ts +8 -2
- package/dist/types/core.d.ts +2 -0
- 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
|
@@ -9,9 +9,15 @@ import { AxiosInstance, AxiosRequestConfig } from "axios";
|
|
|
9
9
|
export declare function getChatToken(): string | null;
|
|
10
10
|
export declare function setChatToken(token: string | null): void;
|
|
11
11
|
export declare function onChatTokenChanged(callback: TokenListener): () => void;
|
|
12
|
-
export declare const DEFAULT_TIMEOUT_MS =
|
|
13
|
-
export declare const HISTORY_TIMEOUT_MS =
|
|
12
|
+
export declare const DEFAULT_TIMEOUT_MS = 120000;
|
|
13
|
+
export declare const HISTORY_TIMEOUT_MS = 120000;
|
|
14
14
|
declare const httpClient: AxiosInstance;
|
|
15
|
+
export declare function setHttpTimeouts(config: {
|
|
16
|
+
requestTimeoutMs?: number;
|
|
17
|
+
historyTimeoutMs?: number;
|
|
18
|
+
}): void;
|
|
19
|
+
export declare function getRequestTimeoutMs(): number;
|
|
20
|
+
export declare function getHistoryTimeoutMs(): number;
|
|
15
21
|
export declare function get<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
16
22
|
export declare function post<T = unknown, B = unknown>(url: string, body?: B, config?: AxiosRequestConfig): Promise<T>;
|
|
17
23
|
export declare function put<T = unknown, B = unknown>(url: string, body?: B, config?: AxiosRequestConfig): Promise<T>;
|
package/dist/types/core.d.ts
CHANGED
|
@@ -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;
|