teodor-new-chat-ui 4.3.390 → 4.3.392
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 +2 -2
- package/dist/components/chat/MessageComponent.d.ts +2 -14
- package/dist/components/chat/MessageList.d.ts +1 -1
- package/dist/components/chat/MessageRow.d.ts +1 -1
- package/dist/components/chat/TimelineColumn.d.ts +1 -1
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/context/providers/ChatSessionProvider.d.ts +2 -1
- package/dist/hooks/useCheckpointMetadata.d.ts +1 -1
- package/dist/hooks/useCheckpointSelectors.d.ts +36 -0
- package/dist/hooks/useMessageMetadata.d.ts +1 -1
- package/dist/hooks/useThreadHistoryState.d.ts +2 -1
- package/dist/index.esm.js +5806 -5857
- package/dist/index.umd.js +41 -41
- package/dist/lib/chatUtils.d.ts +1 -3
- package/dist/lib/historyUtils.d.ts +1 -2
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/schemaUtils.d.ts +6 -0
- package/dist/lib/validation.d.ts +0 -4
- package/dist/types/index.d.ts +0 -1
- package/dist/types/models.d.ts +28 -24
- package/dist/types/requests.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/chat/checkpoint/dropdown.d.ts +0 -13
- package/dist/types/timeline.d.ts +0 -28
package/dist/lib/chatUtils.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { MessagePart } from "@/types";
|
|
2
|
-
export declare function fileToDataUrl(file: File): Promise<string>;
|
|
3
2
|
export declare function fileToBase64(file: File): Promise<string>;
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function processAttachments(api: unknown, files?: File[], uploadPath?: string, enableFileAgentRouting?: boolean, fileAgentId?: string, threadId?: string | null): Promise<{
|
|
3
|
+
export declare function processAttachments(files?: File[]): Promise<{
|
|
6
4
|
contentParts: MessagePart[];
|
|
7
5
|
filesInfo: Array<{
|
|
8
6
|
filename: string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { HistoryPayload, HydratedCheckpointSnapshot, PendingInterrupt
|
|
1
|
+
import type { HistoryPayload, HydratedCheckpointSnapshot, PendingInterrupt } from "@/types";
|
|
2
2
|
export type HistoryHydrationResult = {
|
|
3
3
|
threadId: string;
|
|
4
4
|
latest: HydratedCheckpointSnapshot | null;
|
|
5
5
|
checkpoints: HydratedCheckpointSnapshot[];
|
|
6
|
-
timeline: TimelineCheckpoint[];
|
|
7
6
|
interrupt: PendingInterrupt;
|
|
8
7
|
};
|
|
9
8
|
export declare function hydrateHistorySnapshots(history: HistoryPayload | null | undefined): HistoryHydrationResult;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type { ChatConfig } from "@/config/env";
|
|
|
23
23
|
export { del, get, getChatToken, onChatTokenChanged, post, put, setChatToken } from '../api/utils';
|
|
24
24
|
export { ChatSettings } from '@/components/settings/ChatSettings';
|
|
25
25
|
export type { ChatSettingsConfig } from '@/components/settings/ChatSettings';
|
|
26
|
-
export type { ChatMessage, ChatRequest,
|
|
26
|
+
export type { ChatMessage, ChatRequest, StateSnapshot, HistoryPayload, HydratedCheckpointSnapshot, MessagePart, PregelTask, Role, StreamEvent, TextPart, ThreadInfo, ThreadShareTarget, ThreadSummary, ToolEndEvent } from '@/types';
|
|
27
27
|
export { buildMessagePreviewMap } from './messagePreviews';
|
|
28
28
|
export type { ChatAppProps, SimpleChatProps } from '../components/chat/ChatApp';
|
|
29
29
|
export type { ChatProvidersProps } from '../context/ChatProviders';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type PlainObject = Record<string, unknown>;
|
|
2
|
+
export declare function toPlainObject(value: unknown): PlainObject | undefined;
|
|
3
|
+
export declare function readString(source: PlainObject | undefined, keys: string[]): string | undefined;
|
|
4
|
+
export declare function readNumber(source: PlainObject | undefined, keys: string[]): number | null;
|
|
5
|
+
export declare function extractConfigFields(source: unknown): PlainObject | undefined;
|
|
6
|
+
export {};
|
package/dist/lib/validation.d.ts
CHANGED
|
@@ -34,7 +34,3 @@ export declare function validateAndSanitizeTitle(title: string): string;
|
|
|
34
34
|
* Safe JSON parse with validation
|
|
35
35
|
*/
|
|
36
36
|
export declare function safeJsonParse(jsonString: string): unknown;
|
|
37
|
-
/**
|
|
38
|
-
* Input validation wrapper for React components
|
|
39
|
-
*/
|
|
40
|
-
export declare function withInputValidation<T extends (...args: unknown[]) => unknown>(fn: T, validator: (input: string) => string): T;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/models.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { TimelineCheckpoint } from "./timeline";
|
|
2
1
|
export type Role = "system" | "user" | "assistant" | "tool";
|
|
3
2
|
export type TextPart = {
|
|
4
3
|
type: "text";
|
|
@@ -94,46 +93,51 @@ export interface PregelTask {
|
|
|
94
93
|
state?: unknown;
|
|
95
94
|
[key: string]: unknown;
|
|
96
95
|
}
|
|
97
|
-
export interface CheckpointSnapshot {
|
|
98
|
-
createdAt?: string | null;
|
|
99
|
-
config?: Record<string, unknown> | null;
|
|
100
|
-
metadata?: Record<string, unknown> | null;
|
|
101
|
-
values: {
|
|
102
|
-
messages: ChatMessage[];
|
|
103
|
-
results?: unknown[];
|
|
104
|
-
active_agent?: string | null;
|
|
105
|
-
research_summary?: string | null;
|
|
106
|
-
[key: string]: unknown;
|
|
107
|
-
};
|
|
108
|
-
next: unknown[];
|
|
109
|
-
parentConfig?: Record<string, unknown> | null;
|
|
110
|
-
tasks?: PregelTask[] | null;
|
|
111
|
-
}
|
|
112
96
|
export type PendingInterrupt = {
|
|
113
97
|
id: string;
|
|
114
98
|
value: unknown;
|
|
115
99
|
} | null;
|
|
100
|
+
export interface StateSnapshot {
|
|
101
|
+
values: Record<string, unknown>;
|
|
102
|
+
next: string[];
|
|
103
|
+
config?: {
|
|
104
|
+
configurable?: Record<string, unknown>;
|
|
105
|
+
} | null;
|
|
106
|
+
metadata?: Record<string, unknown> | null;
|
|
107
|
+
created_at?: string;
|
|
108
|
+
createdAt?: string;
|
|
109
|
+
parent_config?: {
|
|
110
|
+
configurable?: Record<string, unknown>;
|
|
111
|
+
} | null;
|
|
112
|
+
parentConfig?: {
|
|
113
|
+
configurable?: Record<string, unknown>;
|
|
114
|
+
} | null;
|
|
115
|
+
tasks?: PregelTask[] | null;
|
|
116
|
+
interrupts?: unknown[] | null;
|
|
117
|
+
}
|
|
116
118
|
export interface HydratedCheckpointSnapshot {
|
|
119
|
+
messages: ChatMessage[];
|
|
117
120
|
checkpointId: string | null;
|
|
118
121
|
checkpointNs: string | null;
|
|
119
|
-
createdAt: string
|
|
122
|
+
createdAt: string;
|
|
120
123
|
parentId: string | null;
|
|
121
|
-
branchLabel: string | null;
|
|
122
|
-
messages: ChatMessage[];
|
|
123
|
-
nextCursor: string | null;
|
|
124
|
-
nextCursorNs: string | null;
|
|
125
124
|
interrupt: PendingInterrupt;
|
|
126
|
-
metadata
|
|
125
|
+
metadata: {
|
|
126
|
+
step: number;
|
|
127
|
+
source: string | null;
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
};
|
|
127
130
|
config?: Record<string, unknown> | null;
|
|
128
131
|
parentConfig?: Record<string, unknown> | null;
|
|
129
132
|
next?: unknown[] | null;
|
|
130
133
|
tasks?: PregelTask[] | null;
|
|
134
|
+
nextCursor?: string | null;
|
|
135
|
+
nextCursorNs?: string | null;
|
|
131
136
|
}
|
|
132
137
|
export interface HistoryPayload {
|
|
133
138
|
version: "chat-history@1";
|
|
134
139
|
threadId: string;
|
|
135
|
-
checkpoints:
|
|
136
|
-
timeline?: TimelineCheckpoint[];
|
|
140
|
+
checkpoints: StateSnapshot[];
|
|
137
141
|
}
|
|
138
142
|
export interface CheckpointList {
|
|
139
143
|
thread_id: string;
|
package/dist/types/requests.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StreamCommand } from "./events";
|
|
2
|
-
import type { TimelineCheckpoint } from "
|
|
2
|
+
import type { TimelineCheckpoint } from "@/hooks/useCheckpointSelectors";
|
|
3
3
|
export interface ChatRequest {
|
|
4
4
|
threadId?: string | null;
|
|
5
5
|
payload?: Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CheckpointMeta } from "@/types/timeline";
|
|
2
|
-
type CheckpointOption = {
|
|
3
|
-
checkpointId: string | null;
|
|
4
|
-
};
|
|
5
|
-
type CheckpointDropdownProps = {
|
|
6
|
-
currentThreadId: string | null;
|
|
7
|
-
checkpointOptionsSorted: CheckpointOption[];
|
|
8
|
-
checkpointMetaById: Map<string, CheckpointMeta>;
|
|
9
|
-
lastCheckpointId: string | null;
|
|
10
|
-
goToCheckpoint: (checkpointId: string | null) => Promise<void>;
|
|
11
|
-
};
|
|
12
|
-
export default function CheckpointDropdown({ currentThreadId, checkpointOptionsSorted, checkpointMetaById, lastCheckpointId, goToCheckpoint, }: CheckpointDropdownProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
-
export {};
|
package/dist/types/timeline.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export type EditMeta = {
|
|
2
|
-
checkpointId?: string | null;
|
|
3
|
-
checkpointNs?: string | null;
|
|
4
|
-
};
|
|
5
|
-
export type TimelineCheckpoint = {
|
|
6
|
-
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
messageId: string | null;
|
|
9
|
-
step: number | null;
|
|
10
|
-
source: string | null;
|
|
11
|
-
createdAt: string | null;
|
|
12
|
-
next?: string | null;
|
|
13
|
-
parentConfig?: Record<string, unknown> | null;
|
|
14
|
-
};
|
|
15
|
-
export type CheckpointMeta = {
|
|
16
|
-
id: string;
|
|
17
|
-
step: number | null;
|
|
18
|
-
source: string | null;
|
|
19
|
-
createdAt: string | null;
|
|
20
|
-
namespace: string | null;
|
|
21
|
-
parentId: string | null;
|
|
22
|
-
};
|
|
23
|
-
export type CheckpointMetaWithAttempts = CheckpointMeta & {
|
|
24
|
-
attemptIndex: number;
|
|
25
|
-
attemptCount: number;
|
|
26
|
-
isLatestAttempt: boolean;
|
|
27
|
-
baseUserMessageId: string | null;
|
|
28
|
-
};
|