teodor-new-chat-ui 4.3.389 → 4.3.390
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 +1 -2
- package/dist/components/ui/command.d.ts +7 -7
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/context/reducers/MessageReducer.d.ts +0 -5
- package/dist/context/reducers/utils/reducerUtils.d.ts +0 -17
- package/dist/hooks/useCheckpointMetadata.d.ts +1 -2
- package/dist/index.esm.js +5865 -6476
- package/dist/index.umd.js +46 -46
- package/dist/lib/attemptDetection.d.ts +13 -25
- package/dist/lib/historyUtils.d.ts +0 -3
- package/dist/types/models.d.ts +0 -4
- package/package.json +1 -1
- package/dist/store/toolProgressStorage.d.ts +0 -8
|
@@ -11,34 +11,22 @@
|
|
|
11
11
|
* msg3 appears in multiple checkpoints = multiple attempts/versions
|
|
12
12
|
*/
|
|
13
13
|
import type { HydratedCheckpointSnapshot } from "@/types/models";
|
|
14
|
-
|
|
15
|
-
* Groups checkpoints by their last user message ID
|
|
16
|
-
* Returns a map where key is the user message ID, value is array of checkpoints containing it
|
|
17
|
-
*/
|
|
18
|
-
export declare function groupCheckpointsByLastUserMessageId(checkpoints: HydratedCheckpointSnapshot[]): Map<string, HydratedCheckpointSnapshot[]>;
|
|
19
|
-
/**
|
|
20
|
-
* Builds attempt metadata for all checkpoints based on their last user message ID
|
|
21
|
-
* Groups checkpoints that share the same user message ID as "attempts/versions"
|
|
22
|
-
* Enriches each checkpoint with attemptIndex, attemptCount, and isLatestAttempt
|
|
23
|
-
*/
|
|
24
|
-
export declare function buildAttemptMetadataMap(checkpoints: HydratedCheckpointSnapshot[]): Map<string, {
|
|
14
|
+
export interface AttemptMetadata {
|
|
25
15
|
attemptIndex: number;
|
|
26
16
|
attemptCount: number;
|
|
27
17
|
isLatestAttempt: boolean;
|
|
28
18
|
baseUserMessageId: string | null;
|
|
29
|
-
}
|
|
19
|
+
}
|
|
30
20
|
/**
|
|
31
|
-
*
|
|
32
|
-
* This
|
|
21
|
+
* Builds attempt metadata and reverse lookup for checkpoints grouped by their last user message ID.
|
|
22
|
+
* This performs a single grouping pass followed by metadata construction, avoiding redundant storage.
|
|
33
23
|
*/
|
|
34
|
-
export declare function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
isLatestAttempt: boolean;
|
|
44
|
-
}>>;
|
|
24
|
+
export declare function buildAttemptMaps(checkpoints: HydratedCheckpointSnapshot[]): {
|
|
25
|
+
attemptMetaById: Map<string, AttemptMetadata>;
|
|
26
|
+
userMessageIdToAttempts: Map<string, Array<{
|
|
27
|
+
checkpointId: string;
|
|
28
|
+
attemptIndex: number;
|
|
29
|
+
attemptCount: number;
|
|
30
|
+
isLatestAttempt: boolean;
|
|
31
|
+
}>>;
|
|
32
|
+
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { HistoryPayload, HydratedCheckpointSnapshot, PendingInterrupt, TimelineCheckpoint } from "@/types";
|
|
2
|
-
export type HistoryPendingInterrupt = PendingInterrupt;
|
|
3
2
|
export type HistoryHydrationResult = {
|
|
4
3
|
threadId: string;
|
|
5
4
|
latest: HydratedCheckpointSnapshot | null;
|
|
6
5
|
checkpoints: HydratedCheckpointSnapshot[];
|
|
7
6
|
timeline: TimelineCheckpoint[];
|
|
8
7
|
interrupt: PendingInterrupt;
|
|
9
|
-
snapshots: Record<string, HydratedCheckpointSnapshot>;
|
|
10
8
|
};
|
|
11
|
-
export declare function buildSnapshotKey(checkpointId: string | null | undefined, checkpointNs: string | null | undefined): string;
|
|
12
9
|
export declare function hydrateHistorySnapshots(history: HistoryPayload | null | undefined): HistoryHydrationResult;
|
package/dist/types/models.d.ts
CHANGED
|
@@ -119,9 +119,6 @@ export interface HydratedCheckpointSnapshot {
|
|
|
119
119
|
createdAt: string | null;
|
|
120
120
|
parentId: string | null;
|
|
121
121
|
branchLabel: string | null;
|
|
122
|
-
lastUserMessageId: string | null;
|
|
123
|
-
messagesLen: number;
|
|
124
|
-
hasMessages: boolean;
|
|
125
122
|
messages: ChatMessage[];
|
|
126
123
|
nextCursor: string | null;
|
|
127
124
|
nextCursorNs: string | null;
|
|
@@ -131,7 +128,6 @@ export interface HydratedCheckpointSnapshot {
|
|
|
131
128
|
parentConfig?: Record<string, unknown> | null;
|
|
132
129
|
next?: unknown[] | null;
|
|
133
130
|
tasks?: PregelTask[] | null;
|
|
134
|
-
values?: Omit<CheckpointSnapshot["values"], "messages"> | null;
|
|
135
131
|
}
|
|
136
132
|
export interface HistoryPayload {
|
|
137
133
|
version: "chat-history@1";
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ToolStreamEntry } from "@/types/toolStream";
|
|
2
|
-
export declare function persistToolProgress(messageId: string, entries: ToolStreamEntry[], metadata?: {
|
|
3
|
-
checkpointId?: string | null;
|
|
4
|
-
checkpointNs?: string | null;
|
|
5
|
-
threadId?: string | null;
|
|
6
|
-
}): void;
|
|
7
|
-
export declare function loadToolProgress(messageId: string): ToolStreamEntry[] | undefined;
|
|
8
|
-
export declare function clearToolProgressCache(): void;
|