teodor-new-chat-ui 4.3.354 → 4.3.356
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/ui/resizable.d.ts +1 -1
- package/dist/context/providers/ChatSessionProvider.d.ts +3 -1
- package/dist/context/reducers/MessageReducer.d.ts +1 -20
- package/dist/context/reducers/utils/reducerUtils.d.ts +37 -0
- package/dist/index.esm.js +2792 -2749
- package/dist/index.umd.js +34 -34
- package/dist/lib/toolProgressStorage.d.ts +8 -0
- package/dist/types/context.d.ts +0 -2
- package/dist/types/events.d.ts +0 -9
- package/dist/types/toolStream.d.ts +11 -0
- package/package.json +1 -1
|
@@ -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 | HTMLProgressElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLBodyElement | HTMLMapElement | HTMLMetaElement | HTMLLabelElement | HTMLSourceElement | HTMLOutputElement |
|
|
3
|
+
declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLTextAreaElement | HTMLFormElement | HTMLDivElement | HTMLObjectElement | HTMLProgressElement | 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 | 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;
|
|
@@ -68,7 +68,9 @@ interface ThreadStateContextValue {
|
|
|
68
68
|
navigateToCheckpoint: (checkpointId: string, checkpointNs?: string | null) => Promise<void>;
|
|
69
69
|
setCurrentCheckpointId: (checkpointId: string | null, checkpointNs?: string | null) => void;
|
|
70
70
|
returnToLatest: () => Promise<void>;
|
|
71
|
-
loadThread: (threadId: string, checkpointId?: string,
|
|
71
|
+
loadThread: (threadId: string, checkpointId?: string, options?: {
|
|
72
|
+
clearProgress?: boolean;
|
|
73
|
+
}) => Promise<void>;
|
|
72
74
|
clearThread: () => Promise<void>;
|
|
73
75
|
respondToInterrupt: (interruptId: string, approved: boolean, value?: unknown) => Promise<void>;
|
|
74
76
|
messagePreviews: Map<string, string>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChatMessage, PendingInterrupt, StreamEvent } from "@/types/api";
|
|
2
|
+
import type { ToolStreamEntry } from "@/types/toolStream";
|
|
2
3
|
export interface MessagesState {
|
|
3
4
|
messages: ChatMessage[];
|
|
4
5
|
assemblingId: string | null;
|
|
@@ -7,9 +8,6 @@ export interface MessagesState {
|
|
|
7
8
|
toolIndex: Record<string, string>;
|
|
8
9
|
toolStreamingMessageId: string | null;
|
|
9
10
|
toolStreamingStack: string[];
|
|
10
|
-
lastBranch: Extract<StreamEvent, {
|
|
11
|
-
type: "branch";
|
|
12
|
-
}> | null;
|
|
13
11
|
pendingInterrupt: PendingInterrupt;
|
|
14
12
|
toolTimelines: Record<string, ToolStreamEntry[]>;
|
|
15
13
|
messagesStreamMeta?: Record<string, {
|
|
@@ -74,20 +72,3 @@ export declare function useMessagesReducer(initial?: ChatMessage[]): {
|
|
|
74
72
|
readonly state: MessagesState;
|
|
75
73
|
readonly dispatch: import("react").Dispatch<MessagesAction>;
|
|
76
74
|
};
|
|
77
|
-
type ToolStreamEntryType = "tool.start" | "tool.call" | "progress" | "custom" | "tool.end";
|
|
78
|
-
interface ToolStreamEntry {
|
|
79
|
-
id: string;
|
|
80
|
-
idx: number;
|
|
81
|
-
type: ToolStreamEntryType;
|
|
82
|
-
toolId?: string;
|
|
83
|
-
toolName?: string;
|
|
84
|
-
step?: string | null;
|
|
85
|
-
title?: string | null;
|
|
86
|
-
content?: string | null;
|
|
87
|
-
factsFound?: number | null;
|
|
88
|
-
isSufficient?: boolean | null;
|
|
89
|
-
metadata?: Record<string, unknown>;
|
|
90
|
-
timestamp: string;
|
|
91
|
-
}
|
|
92
|
-
export declare function computeSuffix(existing: string, incoming: string): string;
|
|
93
|
-
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ChatMessage, MessagePart } from "@/types/api";
|
|
2
|
+
import type { ToolStreamEntry } from "@/types/toolStream";
|
|
3
|
+
export declare function sanitizeHistory(messages: ChatMessage[]): ChatMessage[];
|
|
4
|
+
export declare function replaceMessageAtIndex(messages: ChatMessage[], index: number, message: ChatMessage): ChatMessage[];
|
|
5
|
+
export declare function stripInterruptParts(messages: ChatMessage[]): ChatMessage[];
|
|
6
|
+
export declare function findLastAssistantId(messages: ChatMessage[]): string | null;
|
|
7
|
+
export declare function collectToolEventIds(ev: {
|
|
8
|
+
id?: unknown;
|
|
9
|
+
call_id?: unknown;
|
|
10
|
+
callId?: unknown;
|
|
11
|
+
}): string[];
|
|
12
|
+
export declare function gatherIdsForMapping(message: ChatMessage | null, candidates: string[]): string[];
|
|
13
|
+
export declare function mapToolIdsToMessage(toolIndex: Record<string, string>, messageId: string, ids: string[]): Record<string, string>;
|
|
14
|
+
export declare function mergeToolMetadata(existing: ChatMessage | undefined, toolCallIds: string[], toolName: string, toolArgs?: Record<string, unknown>): Record<string, unknown>;
|
|
15
|
+
export declare function appendToolTimelineEntry(messages: ChatMessage[], messageId: string, entry: Omit<ToolStreamEntry, "id" | "timestamp" | "idx">): ChatMessage[];
|
|
16
|
+
export declare function pushToolToStack(stack: string[], toolId: string): string[];
|
|
17
|
+
export declare function removeToolFromStack(stack: string[], toolId: string): string[];
|
|
18
|
+
export declare function syncToolTimelines(messages: ChatMessage[], existing: Record<string, ToolStreamEntry[]>): {
|
|
19
|
+
messages: ChatMessage[];
|
|
20
|
+
toolTimelines: Record<string, ToolStreamEntry[]>;
|
|
21
|
+
};
|
|
22
|
+
export declare function getFullTextFromParts(parts: MessagePart[]): string;
|
|
23
|
+
export declare function mergePartsWithMeta(baseParts: MessagePart[], deltaParts: MessagePart[], metaIn: {
|
|
24
|
+
lastSeq?: number | null;
|
|
25
|
+
lastText?: string;
|
|
26
|
+
}, seq: number | null): {
|
|
27
|
+
newParts: MessagePart[];
|
|
28
|
+
newMeta: {
|
|
29
|
+
lastSeq?: number | null;
|
|
30
|
+
lastText?: string;
|
|
31
|
+
};
|
|
32
|
+
changed: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare function computeSuffix(existing: string, incoming: string): string;
|
|
35
|
+
export declare function stampLastAssistantCheckpoint(messages: ChatMessage[], checkpointId: string, checkpointNs?: string | null): ChatMessage[];
|
|
36
|
+
export declare function nameFromModel(model?: string): string | null;
|
|
37
|
+
export declare function getToolProgress(message: ChatMessage): ToolStreamEntry[];
|