teodor-new-chat-ui 4.3.414 → 4.3.415

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teodor-new-chat-ui",
3
- "version": "4.3.414",
3
+ "version": "4.3.415",
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,17 +0,0 @@
1
- /**
2
- * useMessageMetadata Hook
3
- *
4
- * Thin hook wrapper around resolveMessageMetadata() that handles memoization.
5
- *
6
- * @param message - The message to resolve metadata for
7
- * @param index - The pre-built checkpoint index (contains all lookup maps)
8
- * @returns Memoized resolved metadata
9
- */
10
- import type { ChatMessage, DefaultMessage } from "@/types";
11
- import type { CheckpointIndex } from "../utils/checkpointIndex";
12
- import type { ResolvedMessageMetadata } from "../types";
13
- /**
14
- * Hook to resolve and memoize metadata for a single message.
15
- * Uses the pure resolver function and adds React memoization.
16
- */
17
- export declare function useMessageMetadata(message: ChatMessage | DefaultMessage | undefined, index: CheckpointIndex): ResolvedMessageMetadata;
@@ -1,28 +0,0 @@
1
- /**
2
- * Attempt Detection Utility
3
- *
4
- * Detects when user messages are edited/re-sent from different branch points.
5
- * This creates "versions" of a user input that should be grouped together as attempts.
6
- *
7
- * Example:
8
- * Checkpoint A: [msg1 (user), msg2 (assistant), msg3 (user)] ← msg3 added
9
- * Checkpoint B: [msg1 (user), msg2 (assistant), msg3 (user), msg4 (assistant)] ← msg3 was re-sent from earlier point
10
- *
11
- * msg3 appears in multiple checkpoints = multiple attempts/versions
12
- */
13
- import type { HydratedCheckpointSnapshot } from "@/features/checkpoint/types";
14
- import type { CheckpointAttemptInfo } from "../types";
15
- export interface AttemptMetadata {
16
- attemptIndex: number;
17
- attemptCount: number;
18
- isLatestAttempt: boolean;
19
- baseUserMessageId: string | null;
20
- }
21
- /**
22
- * Builds attempt metadata and reverse lookup for checkpoints grouped by their last user message ID.
23
- * This performs a single grouping pass followed by metadata construction, avoiding redundant storage.
24
- */
25
- export declare function buildAttemptMaps(checkpoints: HydratedCheckpointSnapshot[]): {
26
- attemptMetaById: Map<string, AttemptMetadata>;
27
- userMessageIdToAttempts: Map<string, CheckpointAttemptInfo[]>;
28
- };
@@ -1,24 +0,0 @@
1
- /**
2
- * Message Metadata Resolver
3
- *
4
- * Pure function that resolves checkpoint metadata for a single message.
5
- * Extracted from the hook for:
6
- * - Better testability (pure function)
7
- * - Reusability outside React context
8
- * - Clear separation of heuristics from memoization
9
- */
10
- import type { ChatMessage, DefaultMessage } from "@/types";
11
- import type { CheckpointIndex } from "./checkpointIndex";
12
- import type { ResolvedMessageMetadata } from "../types";
13
- /**
14
- * Resolves checkpoint metadata for a message given a checkpoint index.
15
- *
16
- * Direct lookup strategy:
17
- * - If message has explicit checkpointId: lookup and return that checkpoint + attempt metadata
18
- * - If no checkpointId: return empty candidates
19
- *
20
- * @param message - The message to resolve metadata for
21
- * @param index - The pre-built checkpoint index (consolidates all lookup maps)
22
- * @returns Resolved metadata including candidates and selected checkpoint
23
- */
24
- export declare function resolveMessageMetadata(message: ChatMessage | DefaultMessage | undefined, index: CheckpointIndex): ResolvedMessageMetadata;