teodor-new-chat-ui 4.3.398 → 4.3.399

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 (138) hide show
  1. package/dist/features/checkpoint/components/TimelineColumn.d.ts +12 -0
  2. package/dist/features/checkpoint/components/index.d.ts +1 -0
  3. package/dist/{hooks/checkpoints → features/checkpoint/hooks}/index.d.ts +0 -1
  4. package/dist/{hooks/checkpoints → features/checkpoint/hooks}/useCheckpointIndex.d.ts +1 -1
  5. package/dist/{hooks/checkpoints → features/checkpoint/hooks}/useMessageMetadata.d.ts +2 -2
  6. package/dist/features/checkpoint/index.d.ts +4 -0
  7. package/dist/{types/checkpoints.d.ts → features/checkpoint/types.d.ts} +1 -0
  8. package/dist/{lib → features/checkpoint/utils}/attemptDetection.d.ts +1 -1
  9. package/dist/{lib → features/checkpoint/utils}/checkpointIndex.d.ts +1 -1
  10. package/dist/features/checkpoint/utils/index.d.ts +7 -0
  11. package/dist/{lib → features/checkpoint/utils}/messageMetadataResolver.d.ts +2 -2
  12. package/dist/{api/chat-api.d.ts → features/core/api/clients/chatClient.d.ts} +2 -3
  13. package/dist/features/core/api/clients/index.d.ts +2 -0
  14. package/dist/features/core/api/index.d.ts +2 -0
  15. package/dist/features/core/api/utils/index.d.ts +1 -0
  16. package/dist/{config → features/core/constants}/env.d.ts +1 -1
  17. package/dist/features/core/constants/index.d.ts +1 -0
  18. package/dist/{context → features/core/contexts}/ChatProviders.d.ts +2 -3
  19. package/dist/features/core/contexts/index.d.ts +6 -0
  20. package/dist/{context → features/core/contexts}/providers/ApiProvider.d.ts +1 -1
  21. package/dist/features/core/contexts/providers/ChatSessionProvider.d.ts +1 -0
  22. package/dist/features/core/hooks/index.d.ts +2 -0
  23. package/dist/features/core/index.d.ts +6 -0
  24. package/dist/{types → features/core/types}/context.d.ts +3 -3
  25. package/dist/features/core/types/index.d.ts +7 -0
  26. package/dist/features/core/utils/index.d.ts +1 -0
  27. package/dist/{components → features/messaging/components}/chat/ChatApp.d.ts +1 -2
  28. package/dist/{components → features/messaging/components}/chat/MessageComponent.d.ts +1 -1
  29. package/dist/{components → features/messaging/components}/chat/MessageList.d.ts +2 -2
  30. package/dist/{components → features/messaging/components}/chat/MessageRow.d.ts +2 -2
  31. package/dist/features/messaging/index.d.ts +12 -0
  32. package/dist/{context/providers/ChatSessionProvider.d.ts → features/streaming/contexts/StreamingProvider.d.ts} +9 -9
  33. package/dist/features/streaming/contexts/index.d.ts +3 -0
  34. package/dist/{context → features/streaming/contexts}/services/use-streaming-service.d.ts +3 -12
  35. package/dist/features/streaming/index.d.ts +3 -0
  36. package/dist/features/streaming/utils/index.d.ts +1 -0
  37. package/dist/features/streaming/utils/types.d.ts +109 -0
  38. package/dist/{hooks → features/thread/hooks}/useThreadHistoryState.d.ts +4 -4
  39. package/dist/{hooks → features/thread/hooks}/useThreadsState.d.ts +2 -2
  40. package/dist/features/thread/index.d.ts +2 -0
  41. package/dist/{hooks → features/ui/hooks}/use-toast.d.ts +3 -3
  42. package/dist/features/ui/index.d.ts +17 -0
  43. package/dist/features/ui/utils/index.d.ts +1 -0
  44. package/dist/index.esm.js +13985 -12997
  45. package/dist/index.umd.js +49 -48
  46. package/dist/lib/index.d.ts +8 -27
  47. package/dist/types/events.d.ts +1 -90
  48. package/dist/types/index.d.ts +1 -3
  49. package/dist/types/marked.d.ts +11 -0
  50. package/dist/types/models.d.ts +80 -104
  51. package/dist/types/requests.d.ts +1 -1
  52. package/package.json +1 -1
  53. package/dist/components/chat/message-components/artifacts/ResearchTaskArtifact.d.ts +0 -20
  54. package/dist/components/settings/ChatSettings.d.ts +0 -30
  55. package/dist/components/ui/accordion.d.ts +0 -7
  56. package/dist/components/ui/alert-dialog.d.ts +0 -20
  57. package/dist/components/ui/alert.d.ts +0 -8
  58. package/dist/components/ui/aspect-ratio.d.ts +0 -3
  59. package/dist/components/ui/avatar.d.ts +0 -6
  60. package/dist/components/ui/breadcrumb.d.ts +0 -19
  61. package/dist/components/ui/calendar.d.ts +0 -8
  62. package/dist/components/ui/carousel.d.ts +0 -18
  63. package/dist/components/ui/chart.d.ts +0 -62
  64. package/dist/components/ui/checkbox.d.ts +0 -4
  65. package/dist/components/ui/collapsible.d.ts +0 -5
  66. package/dist/components/ui/context-menu.d.ts +0 -27
  67. package/dist/components/ui/drawer.d.ts +0 -22
  68. package/dist/components/ui/form.d.ts +0 -23
  69. package/dist/components/ui/hover-card.d.ts +0 -6
  70. package/dist/components/ui/input-otp.d.ts +0 -34
  71. package/dist/components/ui/menubar.d.ts +0 -28
  72. package/dist/components/ui/navigation-menu.d.ts +0 -12
  73. package/dist/components/ui/pagination.d.ts +0 -28
  74. package/dist/components/ui/popover.d.ts +0 -6
  75. package/dist/components/ui/progress.d.ts +0 -4
  76. package/dist/components/ui/radio-group.d.ts +0 -5
  77. package/dist/components/ui/resizable.d.ts +0 -23
  78. package/dist/components/ui/sidebar.d.ts +0 -66
  79. package/dist/components/ui/skeleton.d.ts +0 -2
  80. package/dist/components/ui/slider.d.ts +0 -4
  81. package/dist/components/ui/table.d.ts +0 -10
  82. package/dist/components/ui/tabs.d.ts +0 -7
  83. package/dist/components/ui/toggle-group.d.ts +0 -12
  84. package/dist/components/ui/toggle.d.ts +0 -12
  85. package/dist/components/ui/use-toast.d.ts +0 -2
  86. package/dist/context/index.d.ts +0 -14
  87. package/dist/context/types.d.ts +0 -1
  88. package/dist/hooks/checkpoints/types.d.ts +0 -1
  89. package/dist/hooks/use-mobile.d.ts +0 -1
  90. package/dist/lib/markdown.d.ts +0 -46
  91. package/dist/types/toolStream.d.ts +0 -11
  92. package/dist/utils/env.d.ts +0 -12
  93. /package/dist/{lib → features/checkpoint/utils}/historyUtils.d.ts +0 -0
  94. /package/dist/{lib → features/checkpoint/utils}/messagePreviews.d.ts +0 -0
  95. /package/dist/{lib → features/checkpoint/utils}/schemaUtils.d.ts +0 -0
  96. /package/dist/{api/file-api.d.ts → features/core/api/clients/fileClient.d.ts} +0 -0
  97. /package/dist/{api/utils.d.ts → features/core/api/utils/http.d.ts} +0 -0
  98. /package/dist/{lib → features/core/utils}/chatUtils.d.ts +0 -0
  99. /package/dist/{components → features/messaging/components}/chat/ChatInput.d.ts +0 -0
  100. /package/dist/{components → features/messaging/components}/chat/ChatInterface.d.ts +0 -0
  101. /package/dist/{components → features/messaging/components}/chat/FileViewerModal.d.ts +0 -0
  102. /package/dist/{components → features/messaging/components}/chat/MarkdownContent.d.ts +0 -0
  103. /package/dist/{components → features/messaging/components}/chat/ThreadManager.d.ts +0 -0
  104. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/ArtifactRenderer.d.ts +0 -0
  105. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/InterruptPartRenderer.d.ts +0 -0
  106. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/SimpleJsonView.d.ts +0 -0
  107. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/StreamProgress.d.ts +0 -0
  108. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/ToolComponent.d.ts +0 -0
  109. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/UserTextContent.d.ts +0 -0
  110. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/artifacts/PlotArtifact.d.ts +0 -0
  111. /package/dist/{components/chat/message-components → features/messaging/components/chat/message/artifacts}/ResearchTaskArtifact.d.ts +0 -0
  112. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/index.d.ts +0 -0
  113. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/useFilePreview.d.ts +0 -0
  114. /package/dist/{components → features/messaging/components}/chat/threads/ThreadListItem.d.ts +0 -0
  115. /package/dist/{lib → features/messaging/utils}/messageHelpers.d.ts +0 -0
  116. /package/dist/{lib → features/messaging/utils}/messageUtils.d.ts +0 -0
  117. /package/dist/{context → features/streaming/contexts}/reducers/MessageReducer.d.ts +0 -0
  118. /package/dist/{context → features/streaming/contexts}/reducers/utils/reducerUtils.d.ts +0 -0
  119. /package/dist/{hooks → features/streaming/hooks}/use-stream.d.ts +0 -0
  120. /package/dist/{components → features/ui/components}/ui/badge.d.ts +0 -0
  121. /package/dist/{components → features/ui/components}/ui/button.d.ts +0 -0
  122. /package/dist/{components → features/ui/components}/ui/card.d.ts +0 -0
  123. /package/dist/{components → features/ui/components}/ui/command.d.ts +0 -0
  124. /package/dist/{components → features/ui/components}/ui/dialog.d.ts +0 -0
  125. /package/dist/{components → features/ui/components}/ui/dropdown-menu.d.ts +0 -0
  126. /package/dist/{components → features/ui/components}/ui/input.d.ts +0 -0
  127. /package/dist/{components → features/ui/components}/ui/label.d.ts +0 -0
  128. /package/dist/{components → features/ui/components}/ui/scroll-area.d.ts +0 -0
  129. /package/dist/{components → features/ui/components}/ui/select.d.ts +0 -0
  130. /package/dist/{components → features/ui/components}/ui/separator.d.ts +0 -0
  131. /package/dist/{components → features/ui/components}/ui/sheet.d.ts +0 -0
  132. /package/dist/{components → features/ui/components}/ui/sonner.d.ts +0 -0
  133. /package/dist/{components → features/ui/components}/ui/switch.d.ts +0 -0
  134. /package/dist/{components → features/ui/components}/ui/textarea.d.ts +0 -0
  135. /package/dist/{components → features/ui/components}/ui/toast.d.ts +0 -0
  136. /package/dist/{components → features/ui/components}/ui/toaster.d.ts +0 -0
  137. /package/dist/{components → features/ui/components}/ui/tooltip.d.ts +0 -0
  138. /package/dist/{lib/utils.d.ts → features/ui/utils/cn.d.ts} +0 -0
@@ -0,0 +1,12 @@
1
+ import type { TimelineCheckpoint } from "../types";
2
+ export interface TimelineColumnProps {
3
+ timelineEntries: TimelineCheckpoint[];
4
+ activeCheckpointId?: string | null;
5
+ onSelectCheckpoint?: (checkpointId: string | null) => Promise<void> | void;
6
+ messagePreviews?: Map<string, string>;
7
+ className?: string;
8
+ onHoverStart?: () => void;
9
+ onHoverEnd?: () => void;
10
+ }
11
+ export declare const TimelineColumn: ({ timelineEntries, activeCheckpointId, onSelectCheckpoint, messagePreviews, className, onHoverStart, onHoverEnd, }: TimelineColumnProps) => import("react/jsx-runtime").JSX.Element | null;
12
+ export default TimelineColumn;
@@ -0,0 +1 @@
1
+ export { default as TimelineColumn } from "./TimelineColumn";
@@ -1,3 +1,2 @@
1
- export * from "./types";
2
1
  export * from "./useMessageMetadata";
3
2
  export * from "./useCheckpointIndex";
@@ -1,2 +1,2 @@
1
1
  import type { HydratedCheckpointSnapshot } from "@/types";
2
- export declare function useCheckpointIndex(checkpoints: HydratedCheckpointSnapshot[]): import("@/lib/checkpointIndex").CheckpointIndex;
2
+ export declare function useCheckpointIndex(checkpoints: HydratedCheckpointSnapshot[]): import("../utils/checkpointIndex").CheckpointIndex;
@@ -8,8 +8,8 @@
8
8
  * @returns Memoized resolved metadata
9
9
  */
10
10
  import type { ChatMessage, DefaultMessage } from "@/types";
11
- import type { CheckpointIndex } from "@/lib/checkpointIndex";
12
- import { type ResolvedMessageMetadata } from "@/lib/messageMetadataResolver";
11
+ import type { CheckpointIndex } from "../utils/checkpointIndex";
12
+ import { type ResolvedMessageMetadata } from "../utils/messageMetadataResolver";
13
13
  /**
14
14
  * Hook to resolve and memoize metadata for a single message.
15
15
  * Uses the pure resolver function and adds React memoization.
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+ export * from "./hooks";
3
+ export * from "./utils";
4
+ export * from "./components";
@@ -30,4 +30,5 @@ export type TimelineCheckpoint = {
30
30
  createdAt: string | null;
31
31
  next?: string | null;
32
32
  parentConfig?: Record<string, unknown> | null;
33
+ label?: string | null;
33
34
  };
@@ -11,7 +11,7 @@
11
11
  * msg3 appears in multiple checkpoints = multiple attempts/versions
12
12
  */
13
13
  import type { HydratedCheckpointSnapshot } from "@/types/models";
14
- import type { CheckpointAttemptInfo } from "@/types/checkpoints";
14
+ import type { CheckpointAttemptInfo } from "../types";
15
15
  export interface AttemptMetadata {
16
16
  attemptIndex: number;
17
17
  attemptCount: number;
@@ -1,5 +1,5 @@
1
1
  import type { HydratedCheckpointSnapshot } from "@/types";
2
- import type { CheckpointAttemptInfo, CheckpointMeta, CheckpointMetaWithAttempts, TimelineCheckpoint } from "@/types/checkpoints";
2
+ import type { CheckpointAttemptInfo, CheckpointMeta, CheckpointMetaWithAttempts, TimelineCheckpoint } from "../types";
3
3
  export interface CheckpointIndex {
4
4
  checkpoints: HydratedCheckpointSnapshot[];
5
5
  checkpointMetaById: Map<string, CheckpointMeta>;
@@ -0,0 +1,7 @@
1
+ export * from "./checkpointIndex";
2
+ export * from "./attemptDetection";
3
+ export * from "./historyUtils";
4
+ export * from "./messageMetadataResolver";
5
+ export * from "./messagePreviews";
6
+ export * from "./schemaUtils";
7
+ export * from "../types";
@@ -8,8 +8,8 @@
8
8
  * - Clear separation of heuristics from memoization
9
9
  */
10
10
  import type { ChatMessage, DefaultMessage } from "@/types";
11
- import type { CheckpointIndex } from "@/lib/checkpointIndex";
12
- import type { CheckpointMeta } from "@/types/checkpoints";
11
+ import type { CheckpointIndex } from "./checkpointIndex";
12
+ import type { CheckpointMeta } from "../types";
13
13
  export interface ResolvedMessageMetadata {
14
14
  checkpointCandidates: CheckpointMeta[];
15
15
  defaultCheckpointId: string | null;
@@ -1,6 +1,5 @@
1
- import type { AgentDetail, AgentSchemaInfo, AgentSummary, HistoryPayload, SharedThreadSummary, StateSnapshot, ThreadInfo, ThreadShareResponse, ThreadSummary } from "@/types";
2
- import type { TokenListener } from "../types";
3
- import { getChatToken, onChatTokenChanged, setChatToken } from "./utils";
1
+ import type { AgentDetail, AgentSchemaInfo, AgentSummary, HistoryPayload, SharedThreadSummary, StateSnapshot, ThreadInfo, ThreadShareResponse, ThreadSummary, TokenListener } from "@/types";
2
+ import { getChatToken, onChatTokenChanged, setChatToken } from "../utils";
4
3
  export declare class ChatApi {
5
4
  get baseUrl(): string;
6
5
  updateConfig(config: {
@@ -0,0 +1,2 @@
1
+ export * from "./chatClient";
2
+ export * from "./fileClient";
@@ -0,0 +1,2 @@
1
+ export * from "./clients";
2
+ export * from "./utils";
@@ -0,0 +1 @@
1
+ export * from "./http";
@@ -1,4 +1,4 @@
1
- import type { ApiConfig } from "@/types";
1
+ import type { ApiConfig } from "@/features/core/types";
2
2
  /**
3
3
  * Get the default API configuration from runtime globals (if provided)
4
4
  */
@@ -0,0 +1 @@
1
+ export * from "./env";
@@ -5,8 +5,8 @@
5
5
  * ApiProvider (auth token & API client)
6
6
  * └─ ChatSessionProvider (threads, messages, and streaming state)
7
7
  */
8
- import type { ApiConfig } from '@/types';
9
- import type { ToolEndEvent } from '@/types/events';
8
+ import type { ApiConfig } from '@/features/core/types';
9
+ import type { ToolEndEvent } from '@/features/streaming';
10
10
  import { type ReactNode } from 'react';
11
11
  export interface ChatProvidersProps {
12
12
  children: ReactNode;
@@ -24,4 +24,3 @@ export interface ChatProvidersProps {
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
25
  export { useApi } from './providers/ApiProvider';
26
26
  export { useStream, useThreads, useThreadState } from './providers/ChatSessionProvider';
27
- export type { ApiContextValue, SendOptions, StreamContextValue, ThreadsContextValue, ThreadStateContextValue } from './types';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Public API entry point for shared contexts.
3
+ */
4
+ export { ChatProviders, type ChatProvidersProps } from './ChatProviders';
5
+ export { useApi } from './providers/ApiProvider';
6
+ export { useThreadState, useStream, useThreads, useHasChatSession, } from './providers/ChatSessionProvider';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * ApiProvider - Lowest level context providing API client and auth token
3
3
  */
4
- import type { ApiConfig, ApiContextValue } from '@/types';
4
+ import type { ApiConfig, ApiContextValue } from '@/features/core/types';
5
5
  import { type ReactNode } from 'react';
6
6
  export interface ApiProviderProps {
7
7
  children: ReactNode;
@@ -0,0 +1 @@
1
+ export { StreamingProvider as ChatSessionProvider, useStream, useThreads, useThreadState, useHasChatSession, } from "@/features/streaming/contexts";
@@ -0,0 +1,2 @@
1
+ export { useApi } from "../contexts/providers/ApiProvider";
2
+ export { useHasChatSession, useStream, useThreadState, useThreads, } from "../contexts/providers/ChatSessionProvider";
@@ -0,0 +1,6 @@
1
+ export * from "./api";
2
+ export * from "./contexts";
3
+ export * from "./hooks";
4
+ export * from "./types";
5
+ export * from "./utils";
6
+ export * from "./constants";
@@ -1,5 +1,5 @@
1
- import type { MessageStreamEvent, StreamCommand, StreamEvent, SystemStreamEvent, ThreadStreamEvent, ToolStreamEvent } from "./events";
2
- import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, ThreadSummary } from "./models";
1
+ import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, ThreadSummary } from "@/types";
2
+ import type { MessageStreamEvent, StreamCommand, StreamEvent, SystemStreamEvent, ThreadStreamEvent, ToolStreamEvent } from "@/features/streaming";
3
3
  export interface ApiConfig {
4
4
  baseUrl?: string;
5
5
  apiKey?: string;
@@ -22,7 +22,7 @@ export interface ApiContextValue {
22
22
  token: string | null;
23
23
  setToken: (token: string | null) => void;
24
24
  baseUrl: string;
25
- api: import("@/api/chat-api").ChatApi;
25
+ api: import("@/features/core").ChatApi;
26
26
  }
27
27
  export interface ThreadsContextValue {
28
28
  threads: ThreadSummary[];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Core Infrastructure Types
3
+ *
4
+ * Re-exports global types from @/types for convenience.
5
+ * Don't add feature-specific types here - keep them in their feature folders.
6
+ */
7
+ export * from "./context";
@@ -0,0 +1 @@
1
+ export * from "./chatUtils";
@@ -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 '@/context/ChatProviders';
5
+ import { type ChatProvidersProps } from "@/features/core";
6
6
  export interface ChatAppProps extends Omit<ChatProvidersProps, 'children'> {
7
7
  layout?: 'sidebar' | 'fullscreen' | 'tabs';
8
8
  layoutSize?: 'phone' | 'tablet' | 'desktop' | 'half-screen';
@@ -21,7 +21,6 @@ export interface SimpleChatProps {
21
21
  onError?: (error: string) => void;
22
22
  }
23
23
  export declare function SimpleChat({ apiConfig, className, onError }: SimpleChatProps): import("react/jsx-runtime").JSX.Element;
24
- export * from '@/context';
25
24
  export * from './ChatInterface';
26
25
  export * from './ThreadManager';
27
26
  export * from './MessageComponent';
@@ -2,7 +2,7 @@
2
2
  * Message Component - With truncatable tool messages and responsive design
3
3
  */
4
4
  import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
5
- import type { CheckpointMeta, EditMeta } from "@/hooks/checkpoints";
5
+ import type { CheckpointMeta, EditMeta } from "@/features/checkpoint/types";
6
6
  export interface MessageComponentProps {
7
7
  message: ChatMessage | DefaultMessage;
8
8
  messageIndex: number;
@@ -1,6 +1,6 @@
1
1
  import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
2
- import type { EditMeta, TimelineCheckpoint } from "@/hooks/checkpoints";
3
- import type { CheckpointIndex } from "@/lib/checkpointIndex";
2
+ import type { EditMeta, TimelineCheckpoint } from "@/features/checkpoint/types";
3
+ import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
4
4
  import React from "react";
5
5
  export interface MessageListProps {
6
6
  messages: (ChatMessage | DefaultMessage)[];
@@ -1,6 +1,6 @@
1
1
  import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
2
- import type { EditMeta } from "@/hooks/checkpoints";
3
- import type { CheckpointIndex } from "@/lib/checkpointIndex";
2
+ import type { EditMeta } from "@/features/checkpoint/types";
3
+ import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
4
4
  import React from "react";
5
5
  export declare const getMessageDomKey: (message: ChatMessage | DefaultMessage | undefined, index: number) => string;
6
6
  export interface MessageRowProps {
@@ -0,0 +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,5 +1,5 @@
1
1
  /**
2
- * DEMO-SIMPLIFIED ChatSessionProvider
2
+ * DEMO-SIMPLIFIED StreamingProvider
3
3
  *
4
4
  * This is a reduced version optimized for demo/development with ~50% fewer lines.
5
5
  *
@@ -31,11 +31,11 @@
31
31
  *
32
32
  * RESULT: Much easier to debug, faster development, no stale cache issues
33
33
  */
34
- import type { CheckpointIndex } from '@/lib/checkpointIndex';
35
- import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, SharedThreadSummary, StreamContextValue, ThreadSummary } from '@/types';
36
- import type { TimelineCheckpoint } from "@/hooks/checkpoints";
37
- import type { ThreadStateMetadata } from '@/types/context';
38
- import type { ToolEndEvent } from '@/types/events';
34
+ import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
35
+ import type { TimelineCheckpoint } from "@/features/checkpoint/types";
36
+ import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, SharedThreadSummary, ThreadSummary } from '@/types';
37
+ import type { StreamContextValue, ThreadStateMetadata } from '@/features/core/types';
38
+ import type { ToolEndEvent } from "@/features/streaming";
39
39
  import { type ReactNode } from 'react';
40
40
  interface ThreadsContextValue {
41
41
  threads: ThreadSummary[];
@@ -87,7 +87,7 @@ interface ThreadStateContextValue {
87
87
  respondToInterrupt: (interruptId: string, approved: boolean, value?: unknown) => Promise<void>;
88
88
  messagePreviews: Map<string, string>;
89
89
  }
90
- interface ChatSessionProviderProps {
90
+ interface StreamingProviderProps {
91
91
  children: ReactNode;
92
92
  initialThreadId?: string | null;
93
93
  initialCheckpointId?: string | null;
@@ -99,9 +99,9 @@ interface ChatSessionProviderProps {
99
99
  onConnectionError?: (error: string) => void;
100
100
  onToolEnd?: (event: ToolEndEvent) => void;
101
101
  }
102
- export declare function ChatSessionProvider({ children, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange, onConnectionError, onToolEnd, }: ChatSessionProviderProps): import("react/jsx-runtime").JSX.Element;
102
+ export declare function StreamingProvider({ children, initialThreadId, initialCheckpointId, initialCheckpointNs, autoLoadInitial, onError, onAuthError, onThreadChange, onConnectionError, onToolEnd, }: StreamingProviderProps): import("react/jsx-runtime").JSX.Element;
103
103
  /**
104
- * Hook to check if the current component is within a ChatSessionProvider
104
+ * Hook to check if the current component is within a StreamingProvider
105
105
  */
106
106
  export declare function useHasChatSession(): boolean;
107
107
  export declare function useThreads(): ThreadsContextValue;
@@ -0,0 +1,3 @@
1
+ export { StreamingProvider } from "./StreamingProvider";
2
+ export { useStream, useThreads, useThreadState, useHasChatSession } from "./StreamingProvider";
3
+ export { useChatStreamingService } from "./services/use-streaming-service";
@@ -1,14 +1,5 @@
1
- import type { ChatRequest, HistoryPayload, StreamEvent } from '@/types';
2
- export type ThreadInfoEvent = Extract<StreamEvent, {
3
- type: 'thread_info';
4
- }>;
5
- type HeartbeatEvent = Extract<StreamEvent, {
6
- type: 'heartbeat';
7
- }>;
8
- export type StateHistoryEvent = HistoryPayload & {
9
- type: 'state_history';
10
- seq?: number;
11
- };
1
+ import type { ChatRequest, HistoryPayload } from '@/types';
2
+ import { type HeartbeatEvent, type StateHistoryEvent, type StreamEvent, type ThreadInfoEvent } from "@/features/streaming";
12
3
  export interface StreamClosedInfo {
13
4
  reason: 'complete' | 'aborted' | 'error';
14
5
  lastSeq: number;
@@ -55,7 +46,7 @@ interface StartStreamCallbacks {
55
46
  }
56
47
  /**
57
48
  * Thin integration layer that adapts the public `useStream` hook to the
58
- * coordination callbacks expected by `ChatSessionProvider`. Keeping this logic
49
+ * coordination callbacks expected by `StreamingProvider`. Keeping this logic
59
50
  * here means we continue to rely on the well-tested streaming hook for all SSE
60
51
  * behaviour while the provider focuses purely on state updates.
61
52
  */
@@ -0,0 +1,3 @@
1
+ export * from "./utils";
2
+ export * from "./contexts";
3
+ export { useStream } from "./hooks/use-stream";
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -0,0 +1,109 @@
1
+ import type { MessagePart, HistoryPayload } from "@/types";
2
+ export type StreamCommand = {
3
+ kind: "resume";
4
+ value: unknown;
5
+ } | {
6
+ kind: "goto";
7
+ node: string;
8
+ value?: unknown;
9
+ };
10
+ type ToolEventIdentity = {
11
+ id: string;
12
+ call_id?: string;
13
+ } | {
14
+ call_id: string;
15
+ id?: string;
16
+ };
17
+ export type ToolStartEvent = {
18
+ type: "tool.start";
19
+ args: Record<string, unknown>;
20
+ name?: string;
21
+ tool?: string;
22
+ seq?: number;
23
+ } & ToolEventIdentity;
24
+ export type ToolEndEvent = {
25
+ type: "tool.end";
26
+ output: unknown;
27
+ artifact?: unknown;
28
+ error?: string;
29
+ name?: string;
30
+ tool?: string;
31
+ seq?: number;
32
+ } & ToolEventIdentity;
33
+ export type ToolProgressEvent = {
34
+ type: "tool.progress";
35
+ content?: string;
36
+ seq?: number;
37
+ };
38
+ export type ToolStreamEvent = ToolStartEvent | ToolEndEvent;
39
+ export type MessageStreamEvent = {
40
+ type: "message.start";
41
+ role: "assistant";
42
+ id: string;
43
+ model?: string;
44
+ } | {
45
+ type: "message.delta";
46
+ delta: MessagePart[];
47
+ } | {
48
+ type: "message.end";
49
+ } | ToolProgressEvent;
50
+ export type ThreadStreamEvent = {
51
+ type: "thread_info";
52
+ threadId: string;
53
+ title: string;
54
+ createdAt: string;
55
+ updatedAt: string;
56
+ messageCount: number;
57
+ lastMessage?: string | null;
58
+ created?: boolean | null;
59
+ ready?: boolean | null;
60
+ seq?: number | null;
61
+ } | {
62
+ type: "checkpoint";
63
+ checkpointId: string;
64
+ checkpointNs?: string | null;
65
+ };
66
+ export type SystemStreamEvent = {
67
+ type: "error";
68
+ message: string;
69
+ error_type?: string;
70
+ code?: string;
71
+ } | {
72
+ type: "interrupt";
73
+ id: string;
74
+ value: any;
75
+ seq: number;
76
+ } | {
77
+ type: "heartbeat";
78
+ timestamp: number;
79
+ seq: number;
80
+ } | {
81
+ type: "cancelled";
82
+ reason?: string;
83
+ seq?: number;
84
+ } | ({
85
+ type: "state_history";
86
+ seq?: number;
87
+ } & HistoryPayload);
88
+ export type ThreadInfoEvent = Extract<ThreadStreamEvent, {
89
+ type: "thread_info";
90
+ }>;
91
+ export type HeartbeatEvent = Extract<SystemStreamEvent, {
92
+ type: "heartbeat";
93
+ }>;
94
+ export type StateHistoryEvent = Extract<SystemStreamEvent, {
95
+ type: "state_history";
96
+ }>;
97
+ /**
98
+ * Complete LangGraph streaming event union type.
99
+ * All SSE messages from backend must be one of these types.
100
+ */
101
+ export type StreamEvent = MessageStreamEvent | ToolStreamEvent | ThreadStreamEvent | SystemStreamEvent;
102
+ export declare function isStreamEvent(obj: any): obj is StreamEvent;
103
+ export declare function isToolEvent(obj: any): obj is ToolStreamEvent;
104
+ export declare function isToolStartEvent(obj: any): obj is ToolStartEvent;
105
+ export declare function isToolEndEvent(obj: any): obj is ToolEndEvent;
106
+ export declare function isMessageStreamEvent(obj: any): obj is MessageStreamEvent;
107
+ export declare function isThreadStreamEvent(obj: any): obj is ThreadStreamEvent;
108
+ export declare function isSystemStreamEvent(obj: any): obj is SystemStreamEvent;
109
+ export {};
@@ -1,9 +1,9 @@
1
- import type { ChatApi } from "@/api/chat-api";
2
- import type { StateHistoryEvent } from "@/context/services/use-streaming-service";
1
+ import type { ChatApi } from "@/features/core";
2
+ import type { StateHistoryEvent } from "@/features/streaming";
3
3
  import type { ChatMessage, HydratedCheckpointSnapshot } from "@/types";
4
- import type { TimelineCheckpoint } from "@/types/checkpoints";
4
+ import type { TimelineCheckpoint } from "@/features/checkpoint/types";
5
5
  import type { PendingInterrupt } from "@/types/models";
6
- import type { CheckpointIndex } from "@/lib/checkpointIndex";
6
+ import type { CheckpointIndex } from "@/features/checkpoint/utils/checkpointIndex";
7
7
  interface UseThreadHistoryStateOptions {
8
8
  api: ChatApi;
9
9
  seed: (messages: ChatMessage[], opts?: {
@@ -1,6 +1,6 @@
1
1
  import { type MutableRefObject } from 'react';
2
- import type { ChatApi } from '@/api/chat-api';
3
- import type { ThreadInfoEvent } from '@/context/services/use-streaming-service';
2
+ import type { ChatApi } from "@/features/core";
3
+ import type { ThreadInfoEvent } from '@/features/streaming';
4
4
  import type { SharedThreadSummary, ThreadSummary } from '@/types';
5
5
  interface ThreadActions {
6
6
  createThread: (title?: string) => Promise<string | null>;
@@ -0,0 +1,2 @@
1
+ export { useThreadsState } from "./hooks/useThreadsState";
2
+ export { useThreadHistoryState } from "./hooks/useThreadHistoryState";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import type { ToastActionElement, ToastProps } from "../components/ui/toast";
2
+ import { type ToastActionElement, type ToastProps } from "../components/ui/toast";
3
3
  type ToasterToast = ToastProps & {
4
4
  id: string;
5
5
  title?: React.ReactNode;
@@ -36,9 +36,9 @@ declare function toast({ ...props }: Toast): {
36
36
  dismiss: () => void;
37
37
  update: (props: ToasterToast) => void;
38
38
  };
39
- declare function useToast(): {
39
+ export declare function useToast(): {
40
40
  toast: typeof toast;
41
41
  dismiss: (toastId?: string) => void;
42
42
  toasts: ToasterToast[];
43
43
  };
44
- export { useToast, toast };
44
+ export {};
@@ -0,0 +1,17 @@
1
+ export { Button } from "./components/ui/button";
2
+ export { Badge } from "./components/ui/badge";
3
+ export { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./components/ui/card";
4
+ export { Dialog, DialogContent, DialogHeader, DialogTitle } from "./components/ui/dialog";
5
+ export { Input } from "./components/ui/input";
6
+ export { Textarea } from "./components/ui/textarea";
7
+ export { Label } from "./components/ui/label";
8
+ export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./components/ui/select";
9
+ export { Separator } from "./components/ui/separator";
10
+ export { Switch } from "./components/ui/switch";
11
+ export { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from "./components/ui/sheet";
12
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip";
13
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./components/ui/dropdown-menu";
14
+ export { ScrollArea } from "./components/ui/scroll-area";
15
+ export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "./components/ui/command";
16
+ export { Toaster } from "./components/ui/toaster";
17
+ export { Toaster as Sonner } from "./components/ui/sonner";
@@ -0,0 +1 @@
1
+ export { cn } from "./cn";