teodor-new-chat-ui 1.3.0 → 1.3.2

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.
@@ -68,7 +68,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
68
68
  ref?: React.Ref<HTMLDivElement>;
69
69
  } & {
70
70
  asChild?: boolean;
71
- }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "disabled" | "value" | "onSelect"> & {
71
+ }, "asChild" | "key" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "disabled" | "onSelect"> & {
72
72
  disabled?: boolean;
73
73
  onSelect?: (value: string) => void;
74
74
  value?: string;
@@ -0,0 +1,30 @@
1
+ import { ApiConfig } from '@/types/api';
2
+ export interface ChatAuthConfig {
3
+ token?: string;
4
+ getToken?: () => string | null | Promise<string | null>;
5
+ getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
6
+ onAuthError?: (error: any) => void;
7
+ }
8
+ export interface ChatFeatureFlags {
9
+ enableStreaming?: boolean;
10
+ enableBranching?: boolean;
11
+ autoPersistBranch?: boolean;
12
+ }
13
+ export interface ChatStorageAdapter {
14
+ getItem?(key: string): string | null;
15
+ setItem?(key: string, value: string): void;
16
+ removeItem?(key: string): void;
17
+ }
18
+ export interface ChatClientConfig {
19
+ baseUrl: string;
20
+ auth?: ChatAuthConfig;
21
+ features?: ChatFeatureFlags;
22
+ storage?: ChatStorageAdapter;
23
+ }
24
+ export interface NormalizedChatConfig {
25
+ baseUrl: string;
26
+ auth: Required<ChatAuthConfig>;
27
+ features: Required<ChatFeatureFlags>;
28
+ storage: Required<ChatStorageAdapter>;
29
+ }
30
+ export declare function normalizeChatConfig(input?: Partial<ChatClientConfig> | ApiConfig): NormalizedChatConfig;
@@ -0,0 +1,19 @@
1
+ import { Message } from '@/types/api';
2
+ export interface BranchMeta {
3
+ branchId: string;
4
+ parentBranchId?: string;
5
+ branchPointMessageId?: string;
6
+ branchPointSequence?: number;
7
+ messageCount: number;
8
+ lastTimestamp?: string;
9
+ }
10
+ export declare function buildBranchMeta(msgs: Message[]): Record<string, BranchMeta>;
11
+ export interface AssembleResult {
12
+ messages: Message[];
13
+ variantMap: Record<string, Record<string, Message>>;
14
+ branchMeta: Record<string, BranchMeta>;
15
+ }
16
+ export interface AssembleOptions {
17
+ variantPreferences?: Record<string, string>;
18
+ }
19
+ export declare function assembleConversation(all: Message[], targetBranchId: string, opts?: AssembleOptions): AssembleResult;