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.
@@ -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
- * Creates a reverse lookup map: userMessageId -> array of attempt checkpoints
32
- * This allows looking up all the attempt versions by the user message ID
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 buildUserMessageIdToAttemptsMap(attemptMetaById: Map<string, {
35
- attemptIndex: number;
36
- attemptCount: number;
37
- isLatestAttempt: boolean;
38
- baseUserMessageId: string | null;
39
- }>): Map<string, Array<{
40
- checkpointId: string;
41
- attemptIndex: number;
42
- attemptCount: number;
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;
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "teodor-new-chat-ui",
3
- "version": "4.3.389",
3
+ "version": "4.3.390",
4
4
  "description": "React chat UI components with streaming support, tool calls, and modern design",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.esm.js",
@@ -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;