teodor-new-chat-ui 4.3.413 → 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.
@@ -7,4 +7,8 @@ export { useStream as useStreamingHook } from "../features/streaming";
7
7
  export * from "../features/thread";
8
8
  export * from "../features/ui";
9
9
  export * from "../features/core";
10
- export type { ChatMessage, ChatRequest, HistoryPayload, HydratedCheckpointSnapshot, MessagePart, PregelTask, Role, StateSnapshot, StreamEvent, TextPart, ThreadInfo, ThreadShareTarget, ThreadSummary, ToolEndEvent } from '@/types';
10
+ export * from "../features/core/types/models";
11
+ export * from "../features/messaging/types/models";
12
+ export * from "../features/checkpoint/types/models";
13
+ export * from "../features/thread/types/models";
14
+ export type { ChatRequest, StreamEvent, ToolEndEvent } from '@/types';
@@ -1 +1,4 @@
1
1
  export * from "@/features/core/types/models";
2
+ export * from "@/features/messaging/types/models";
3
+ export * from "@/features/checkpoint/types/models";
4
+ export * from "@/features/thread/types/models";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teodor-new-chat-ui",
3
- "version": "4.3.413",
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,18 +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 "../utils/messageMetadataResolver";
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;
18
- export type { 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/core/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,32 +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 { CheckpointMeta } from "../types";
13
- export interface ResolvedMessageMetadata {
14
- checkpointCandidates: CheckpointMeta[];
15
- defaultCheckpointId: string | null;
16
- resolvedStep: number | null;
17
- resolvedSource: string | null;
18
- }
19
- /**
20
- * Resolves checkpoint metadata for a message given a checkpoint index.
21
- *
22
- * Handles:
23
- * - Multi-source step/source fallback (additionalKwargs > responseMetadata > index)
24
- * - Checkpoint candidate lookup by step:source key
25
- * - Attempt filtering for edited/multi-version messages
26
- * - Attempt metadata enrichment
27
- *
28
- * @param message - The message to resolve metadata for
29
- * @param index - The pre-built checkpoint index (consolidates all lookup maps)
30
- * @returns Resolved metadata including candidates and resolved step/source
31
- */
32
- export declare function resolveMessageMetadata(message: ChatMessage | DefaultMessage | undefined, index: CheckpointIndex): ResolvedMessageMetadata;