teodor-new-chat-ui 4.3.356 → 4.3.358
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/api/chat-api.d.ts +7 -1
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/context/providers/ChatSessionProvider.d.ts +6 -1
- package/dist/hooks/useThreadHistoryState.d.ts +43 -0
- package/dist/index.esm.js +6470 -6260
- package/dist/index.umd.js +48 -48
- package/dist/types/events.d.ts +1 -1
- package/dist/types/models.d.ts +12 -0
- package/dist/types/toolStream.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/lib/{message-utils.d.ts → messageUtils.d.ts} +0 -0
- /package/dist/{lib → store}/toolProgressStorage.d.ts +0 -0
package/dist/api/chat-api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentDetail, AgentSchemaInfo, AgentSummary, CheckpointList, CheckpointSnapshot, HistoryPayload, ThreadInfo, ThreadSummary } from "@/types/api";
|
|
1
|
+
import type { AgentDetail, AgentSchemaInfo, AgentSummary, CheckpointList, CheckpointSnapshot, HistoryPayload, SharedThreadSummary, ThreadInfo, ThreadShareResponse, ThreadSummary } from "@/types/api";
|
|
2
2
|
import type { TokenListener } from "../types/api";
|
|
3
3
|
import { getChatToken, onChatTokenChanged, setChatToken } from "./utils";
|
|
4
4
|
export declare class ChatApi {
|
|
@@ -11,12 +11,14 @@ export declare class ChatApi {
|
|
|
11
11
|
setAuthToken(token: string | null): void;
|
|
12
12
|
onTokenChange(callback: TokenListener): () => void;
|
|
13
13
|
listThreads(): Promise<ThreadSummary[]>;
|
|
14
|
+
listSharedThreads(): Promise<SharedThreadSummary[]>;
|
|
14
15
|
createThread(title?: string): Promise<ThreadInfo>;
|
|
15
16
|
updateThread(threadId: string, title: string): Promise<ThreadInfo>;
|
|
16
17
|
deleteThread(threadId: string): Promise<{
|
|
17
18
|
ok: boolean;
|
|
18
19
|
threadId: string;
|
|
19
20
|
}>;
|
|
21
|
+
shareThread(threadId: string, sharedWithUserId: string): Promise<ThreadShareResponse>;
|
|
20
22
|
threadInfo(threadId: string): Promise<ThreadInfo>;
|
|
21
23
|
listAgents(): Promise<AgentSummary[]>;
|
|
22
24
|
getAgent(agentId: string): Promise<AgentDetail>;
|
|
@@ -35,6 +37,10 @@ export declare class ChatApi {
|
|
|
35
37
|
status: string;
|
|
36
38
|
}>;
|
|
37
39
|
listCheckpointSummaries(threadId: string): Promise<CheckpointList["items"]>;
|
|
40
|
+
unshareThread(threadId: string, shareId: string): Promise<{
|
|
41
|
+
ok: boolean;
|
|
42
|
+
shareId: string;
|
|
43
|
+
}>;
|
|
38
44
|
}
|
|
39
45
|
export declare const chatApiClient: ChatApi;
|
|
40
46
|
export default chatApiClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
2
2
|
declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLTextAreaElement | HTMLFormElement | HTMLDivElement | HTMLObjectElement |
|
|
3
|
+
declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLTextAreaElement | HTMLFormElement | HTMLDivElement | HTMLObjectElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLBodyElement | HTMLMapElement | HTMLMetaElement | HTMLLabelElement | HTMLSourceElement | HTMLOutputElement | HTMLSlotElement | HTMLStyleElement | HTMLTitleElement | HTMLDialogElement | HTMLImageElement | HTMLOptionElement | HTMLTableElement | HTMLAnchorElement | HTMLHeadingElement | HTMLInputElement | HTMLLIElement | HTMLOListElement | HTMLParagraphElement | HTMLSelectElement | HTMLSpanElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLMeterElement | HTMLOptGroupElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLMenuElement | HTMLTableCaptionElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
4
4
|
className?: string | undefined;
|
|
5
5
|
collapsedSize?: number | undefined;
|
|
6
6
|
collapsible?: boolean | undefined;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
*
|
|
32
32
|
* RESULT: Much easier to debug, faster development, no stale cache issues
|
|
33
33
|
*/
|
|
34
|
-
import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, StreamContextValue, ThreadSummary, TimelineCheckpoint } from '@/types/api';
|
|
34
|
+
import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, SharedThreadSummary, StreamContextValue, ThreadSummary, TimelineCheckpoint } from '@/types/api';
|
|
35
35
|
import type { ThreadStateMetadata } from '@/types/context';
|
|
36
36
|
import { type ReactNode } from 'react';
|
|
37
37
|
interface ThreadsContextValue {
|
|
@@ -40,11 +40,16 @@ interface ThreadsContextValue {
|
|
|
40
40
|
setCurrentThreadId: (id: string | null) => void;
|
|
41
41
|
isLoading: boolean;
|
|
42
42
|
error: string | null;
|
|
43
|
+
sharedThreads: SharedThreadSummary[];
|
|
44
|
+
isLoadingSharedThreads: boolean;
|
|
43
45
|
actions: {
|
|
44
46
|
createThread: (title?: string) => Promise<string | null>;
|
|
45
47
|
deleteThread: (threadId: string) => Promise<void>;
|
|
46
48
|
renameThread: (threadId: string, title: string) => Promise<void>;
|
|
47
49
|
refreshThreads: () => Promise<void>;
|
|
50
|
+
refreshSharedThreads: () => Promise<void>;
|
|
51
|
+
shareThread: (threadId: string, sharedWithUserId: string) => Promise<void>;
|
|
52
|
+
unshareThread: (threadId: string, shareId: string) => Promise<void>;
|
|
48
53
|
};
|
|
49
54
|
}
|
|
50
55
|
interface ThreadStateContextValue {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ChatApi } from "@/api/chat-api";
|
|
2
|
+
import type { ChatMessage, HydratedCheckpointSnapshot, TimelineCheckpoint } from "@/types/api";
|
|
3
|
+
import type { PendingInterrupt } from "@/types/models";
|
|
4
|
+
import type { StateHistoryEvent } from "@/context/services/streaming/use-streaming-service";
|
|
5
|
+
interface UseThreadHistoryStateOptions {
|
|
6
|
+
api: ChatApi;
|
|
7
|
+
seed: (messages: ChatMessage[], opts?: {
|
|
8
|
+
checkpointId?: string | null;
|
|
9
|
+
checkpointNs?: string | null;
|
|
10
|
+
pendingInterrupt?: PendingInterrupt;
|
|
11
|
+
}) => void;
|
|
12
|
+
prepend: (messages: ChatMessage[]) => void;
|
|
13
|
+
onError?: (msg: string) => void;
|
|
14
|
+
currentThreadId: string | null;
|
|
15
|
+
initialThreadId?: string | null;
|
|
16
|
+
initialCheckpointId?: string | null;
|
|
17
|
+
initialCheckpointNs?: string | null;
|
|
18
|
+
autoLoadInitial?: boolean;
|
|
19
|
+
isStreaming: boolean;
|
|
20
|
+
getMessages: () => ChatMessage[];
|
|
21
|
+
}
|
|
22
|
+
interface ThreadHistoryResult {
|
|
23
|
+
threadCheckpoints: HydratedCheckpointSnapshot[];
|
|
24
|
+
threadTimeline: TimelineCheckpoint[];
|
|
25
|
+
isLoadingThread: boolean;
|
|
26
|
+
isHistoryLoading: boolean;
|
|
27
|
+
isLoadingCheckpoint: boolean;
|
|
28
|
+
threadStateError: string | null;
|
|
29
|
+
hasMoreHistory: boolean;
|
|
30
|
+
loadThread: (threadId: string, checkpointId?: string, options?: {
|
|
31
|
+
clearProgress?: boolean;
|
|
32
|
+
}) => Promise<void>;
|
|
33
|
+
navigateToCheckpoint: (checkpointId: string, checkpointNs?: string | null) => Promise<void>;
|
|
34
|
+
loadOlderMessages: () => Promise<void>;
|
|
35
|
+
setCurrentCheckpointId: (checkpointId: string | null, checkpointNs?: string | null) => void;
|
|
36
|
+
returnToLatest: () => Promise<void>;
|
|
37
|
+
handleStateHistoryEvent: (event: StateHistoryEvent) => void;
|
|
38
|
+
markSkipNextLoad: (threadId: string | null) => void;
|
|
39
|
+
markStreamPendingThread: (threadId: string | null) => void;
|
|
40
|
+
resetHistoryState: () => void;
|
|
41
|
+
}
|
|
42
|
+
export declare function useThreadHistoryState({ api, seed, prepend, onError, currentThreadId, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, isStreaming, getMessages, }: UseThreadHistoryStateOptions): ThreadHistoryResult;
|
|
43
|
+
export {};
|