teodor-new-chat-ui 4.3.400 → 4.3.401

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.
Files changed (40) hide show
  1. package/dist/features/checkpoint/utils/messagePreviews.d.ts +1 -7
  2. package/dist/features/core/contexts/index.d.ts +1 -3
  3. package/dist/features/core/contexts/providers/ApiProvider.d.ts +1 -1
  4. package/dist/features/core/contexts/{ChatProviders.d.ts → providers/ChatProviders.d.ts} +3 -3
  5. package/dist/features/core/contexts/providers/index.d.ts +1 -2
  6. package/dist/features/core/hooks/index.d.ts +1 -2
  7. package/dist/features/core/hooks/useApi.d.ts +1 -0
  8. package/dist/features/messaging/components/{chat/ChatApp.d.ts → ChatApp.d.ts} +1 -1
  9. package/dist/features/messaging/index.d.ts +12 -12
  10. package/dist/features/streaming/contexts/index.d.ts +0 -1
  11. package/dist/features/streaming/contexts/types.d.ts +57 -0
  12. package/dist/features/streaming/index.d.ts +2 -1
  13. package/dist/features/streaming/utils/constants.d.ts +1 -0
  14. package/dist/index.esm.js +5868 -6108
  15. package/dist/index.umd.js +42 -42
  16. package/dist/lib/index.d.ts +2 -2
  17. package/package.json +1 -1
  18. package/dist/features/core/contexts/providers/ChatSessionProvider.d.ts +0 -1
  19. package/dist/features/settings/components/ChatSettings.d.ts +0 -30
  20. package/dist/features/streaming/contexts/services/use-streaming-service.d.ts +0 -61
  21. /package/dist/features/messaging/components/{chat/ChatInput.d.ts → ChatInput.d.ts} +0 -0
  22. /package/dist/features/messaging/components/{chat/ChatInterface.d.ts → ChatInterface.d.ts} +0 -0
  23. /package/dist/features/messaging/components/{chat/FileViewerModal.d.ts → FileViewerModal.d.ts} +0 -0
  24. /package/dist/features/messaging/components/{chat/MarkdownContent.d.ts → MarkdownContent.d.ts} +0 -0
  25. /package/dist/features/messaging/components/{chat/MessageComponent.d.ts → MessageComponent.d.ts} +0 -0
  26. /package/dist/features/messaging/components/{chat/MessageList.d.ts → MessageList.d.ts} +0 -0
  27. /package/dist/features/messaging/components/{chat/MessageRow.d.ts → MessageRow.d.ts} +0 -0
  28. /package/dist/features/messaging/components/{chat/ThreadManager.d.ts → ThreadManager.d.ts} +0 -0
  29. /package/dist/features/messaging/components/{chat/message → message}/ArtifactRenderer.d.ts +0 -0
  30. /package/dist/features/messaging/components/{chat/message → message}/InterruptPartRenderer.d.ts +0 -0
  31. /package/dist/features/messaging/components/{chat/message → message}/ResearchTaskArtifact.d.ts +0 -0
  32. /package/dist/features/messaging/components/{chat/message → message}/SimpleJsonView.d.ts +0 -0
  33. /package/dist/features/messaging/components/{chat/message → message}/StreamProgress.d.ts +0 -0
  34. /package/dist/features/messaging/components/{chat/message → message}/ToolComponent.d.ts +0 -0
  35. /package/dist/features/messaging/components/{chat/message → message}/UserTextContent.d.ts +0 -0
  36. /package/dist/features/messaging/components/{chat/message → message}/artifacts/PlotArtifact.d.ts +0 -0
  37. /package/dist/features/messaging/components/{chat/message → message}/artifacts/ResearchTaskArtifact.d.ts +0 -0
  38. /package/dist/features/messaging/components/{chat/message → message}/index.d.ts +0 -0
  39. /package/dist/features/messaging/components/{chat/message → message}/useFilePreview.d.ts +0 -0
  40. /package/dist/features/messaging/components/{chat/threads → threads}/ThreadListItem.d.ts +0 -0
@@ -1,12 +1,6 @@
1
- import type { ChatMessage } from '@/types';
2
1
  import type { HydratedCheckpointSnapshot } from '@/features/core/types';
2
+ import type { ChatMessage } from '@/types';
3
3
  export declare function getPreviewForMessage(message: ChatMessage): string;
4
- /**
5
- * Legacy function: builds a map of message ID -> preview text.
6
- * This creates a single preview per message ID, with later occurrences overwriting earlier ones.
7
- * @deprecated Use buildCheckpointPreviewMap instead for per-checkpoint previews
8
- */
9
- export declare function buildMessagePreviewMap(messages: ChatMessage[]): Map<string, string>;
10
4
  /**
11
5
  * Builds a map of checkpoint ID -> preview text.
12
6
  * Each checkpoint gets its own preview based on the latest user message in that checkpoint.
@@ -1,6 +1,4 @@
1
1
  /**
2
2
  * Public API entry point for shared contexts.
3
3
  */
4
- export { ChatProviders, type ChatProvidersProps } from './ChatProviders';
5
- export { useApi } from './providers/ApiProvider';
6
- export { useThreadState, useStream, useThreads, useHasChatSession, } from './providers/ChatSessionProvider';
4
+ export { ApiProvider } from './providers';
@@ -3,9 +3,9 @@
3
3
  */
4
4
  import type { ApiConfig, ApiContextValue } from '@/features/core/types';
5
5
  import { type ReactNode } from 'react';
6
+ export declare const ApiContext: import("react").Context<ApiContextValue | null>;
6
7
  export interface ApiProviderProps {
7
8
  children: ReactNode;
8
9
  apiConfig?: ApiConfig;
9
10
  }
10
11
  export declare function ApiProvider({ children, apiConfig }: ApiProviderProps): import("react/jsx-runtime").JSX.Element;
11
- export declare function useApi(): ApiContextValue;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Context hierarchy:
5
5
  * ApiProvider (auth token & API client)
6
- * └─ ChatSessionProvider (threads, messages, and streaming state)
6
+ * └─ StreamingProvider (threads, messages, and streaming state)
7
7
  */
8
8
  import type { ApiConfig } from '@/features/core/types';
9
9
  import type { ToolEndEvent } from '@/features/streaming';
@@ -22,5 +22,5 @@ export interface ChatProvidersProps {
22
22
  onToolEnd?: (event: ToolEndEvent) => void;
23
23
  }
24
24
  export declare function ChatProviders({ children, apiConfig, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onConnectionError, onError, onAuthError, onThreadChange, onToolEnd, }: ChatProvidersProps): import("react/jsx-runtime").JSX.Element;
25
- export { useApi } from './providers/ApiProvider';
26
- export { useStream, useThreads, useThreadState } from './providers/ChatSessionProvider';
25
+ export { useApi } from '@/features/core/hooks';
26
+ export { useStream, useThreads, useThreadState, useHasChatSession } from '@/features/streaming/contexts/StreamingProvider';
@@ -1,2 +1 @@
1
- export { ApiProvider, useApi } from "./ApiProvider";
2
- export { ChatSessionProvider, useHasChatSession, useStream, useThreads, useThreadState, } from "./ChatSessionProvider";
1
+ export { ApiProvider, ApiContext } from "./ApiProvider";
@@ -1,2 +1 @@
1
- export { useApi } from "../contexts/providers/ApiProvider";
2
- export { useHasChatSession, useStream, useThreadState, useThreads, } from "../contexts/providers/ChatSessionProvider";
1
+ export { useApi } from './useApi';
@@ -0,0 +1 @@
1
+ export declare function useApi(): import("..").ApiContextValue;
@@ -2,7 +2,7 @@
2
2
  * Chat App - Complete chat application with sidebar layout
3
3
  * Combines all chat components into a ready-to-use chat interface
4
4
  */
5
- import { type ChatProvidersProps } from "@/features/core";
5
+ import { type ChatProvidersProps } from "@/features/streaming";
6
6
  export interface ChatAppProps extends Omit<ChatProvidersProps, 'children'> {
7
7
  layout?: 'sidebar' | 'fullscreen' | 'tabs';
8
8
  layoutSize?: 'phone' | 'tablet' | 'desktop' | 'half-screen';
@@ -1,12 +1,12 @@
1
- export * from "./components/chat/ChatApp";
2
- export { ChatInput } from "./components/chat/ChatInput";
3
- export type { ChatInputProps } from "./components/chat/ChatInput";
4
- export { ChatInterface } from "./components/chat/ChatInterface";
5
- export type { ChatInterfaceProps } from "./components/chat/ChatInterface";
6
- export { MessageComponent } from "./components/chat/MessageComponent";
7
- export type { MessageComponentProps } from "./components/chat/MessageComponent";
8
- export { MessageList } from "./components/chat/MessageList";
9
- export type { MessageListProps } from "./components/chat/MessageList";
10
- export { MarkdownContent } from "./components/chat/MarkdownContent";
11
- export { FileViewerModal } from "./components/chat/FileViewerModal";
12
- export { ThreadManager } from "./components/chat/ThreadManager";
1
+ export * from "./components/ChatApp";
2
+ export { ChatInput } from "./components/ChatInput";
3
+ export type { ChatInputProps } from "./components/ChatInput";
4
+ export { ChatInterface } from "./components/ChatInterface";
5
+ export type { ChatInterfaceProps } from "./components/ChatInterface";
6
+ export { MessageComponent } from "./components/MessageComponent";
7
+ export type { MessageComponentProps } from "./components/MessageComponent";
8
+ export { MessageList } from "./components/MessageList";
9
+ export type { MessageListProps } from "./components/MessageList";
10
+ export { MarkdownContent } from "./components/MarkdownContent";
11
+ export { FileViewerModal } from "./components/FileViewerModal";
12
+ export { ThreadManager } from "./components/ThreadManager";
@@ -1,3 +1,2 @@
1
1
  export { StreamingProvider } from "./StreamingProvider";
2
2
  export { useStream, useThreads, useThreadState, useHasChatSession } from "./StreamingProvider";
3
- export { useChatStreamingService } from "./services/use-streaming-service";
@@ -0,0 +1,57 @@
1
+ import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, SharedThreadSummary, ThreadSummary } from "@/types";
2
+ import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
3
+ import type { TimelineCheckpoint } from "@/features/checkpoint/types";
4
+ import type { StreamContextValue, ThreadStateMetadata } from "@/features/core/types";
5
+ export interface ThreadsContextValue {
6
+ threads: ThreadSummary[];
7
+ currentThreadId: string | null;
8
+ setCurrentThreadId: (id: string | null) => void;
9
+ isLoading: boolean;
10
+ error: string | null;
11
+ sharedThreads: SharedThreadSummary[];
12
+ isLoadingSharedThreads: boolean;
13
+ actions: {
14
+ createThread: (title?: string) => Promise<string | null>;
15
+ deleteThread: (threadId: string) => Promise<void>;
16
+ renameThread: (threadId: string, title: string) => Promise<void>;
17
+ refreshThreads: () => Promise<void>;
18
+ refreshSharedThreads: () => Promise<void>;
19
+ shareThread: (threadId: string, sharedWithUserId: string) => Promise<void>;
20
+ unshareThread: (threadId: string, shareId: string) => Promise<void>;
21
+ };
22
+ shareInFlight: boolean;
23
+ shareStatus: string | null;
24
+ clearShareStatus: () => void;
25
+ }
26
+ export interface ThreadStateContextValue {
27
+ threadId: string | null;
28
+ messages: ChatMessage[];
29
+ interrupt: PendingInterrupt;
30
+ checkpoint: {
31
+ id: string | null;
32
+ namespace: string | null;
33
+ };
34
+ checkpoints: HydratedCheckpointSnapshot[];
35
+ checkpointIndex: CheckpointIndex;
36
+ timelineCheckpoints: TimelineCheckpoint[];
37
+ metadata: ThreadStateMetadata | null;
38
+ isLoading: boolean;
39
+ isHistoryLoading: boolean;
40
+ isLoadingCheckpoint: boolean;
41
+ error: string | null;
42
+ hasMore: boolean;
43
+ loadOlder: () => Promise<void>;
44
+ clearState: () => void;
45
+ navigateToCheckpoint: (checkpointId: string, checkpointNs?: string | null) => Promise<void>;
46
+ setCurrentCheckpointId: (checkpointId: string | null, checkpointNs?: string | null) => void;
47
+ returnToLatest: () => Promise<void>;
48
+ loadThread: (threadId: string, checkpointId?: string, options?: {
49
+ clearProgress?: boolean;
50
+ }) => Promise<void>;
51
+ clearThread: () => Promise<void>;
52
+ respondToInterrupt: (interruptId: string, approved: boolean, value?: unknown) => Promise<void>;
53
+ messagePreviews: Map<string, string>;
54
+ }
55
+ export declare const ThreadContext: import("react").Context<ThreadsContextValue | null>;
56
+ export declare const ThreadStateContext: import("react").Context<ThreadStateContextValue | null>;
57
+ export declare const StreamContext: import("react").Context<StreamContextValue | null>;
@@ -1,3 +1,4 @@
1
1
  export * from "./utils";
2
2
  export * from "./contexts";
3
- export { useStream } from "./hooks/use-stream";
3
+ export { useStream as useStreamingHook, type UseStreamApi, type UseChatStreamOptions } from "./hooks/use-stream";
4
+ export { ChatProviders, type ChatProvidersProps } from "../core/contexts/providers/ChatProviders";
@@ -0,0 +1 @@
1
+ export declare const MAX_BUFFERED_EVENTS = 200;