teodor-new-chat-ui 4.3.398 → 4.3.400

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 (144) 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 +2 -2
  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/{lib → features/checkpoint/utils}/messagePreviews.d.ts +1 -1
  13. package/dist/{api/chat-api.d.ts → features/core/api/clients/chatClient.d.ts} +2 -3
  14. package/dist/features/core/api/clients/index.d.ts +2 -0
  15. package/dist/features/core/api/index.d.ts +2 -0
  16. package/dist/features/core/api/utils/index.d.ts +1 -0
  17. package/dist/{config → features/core/constants}/env.d.ts +1 -1
  18. package/dist/features/core/constants/index.d.ts +1 -0
  19. package/dist/{context → features/core/contexts}/ChatProviders.d.ts +2 -3
  20. package/dist/features/core/contexts/index.d.ts +6 -0
  21. package/dist/{context → features/core/contexts}/providers/ApiProvider.d.ts +1 -1
  22. package/dist/features/core/contexts/providers/ChatSessionProvider.d.ts +1 -0
  23. package/dist/features/core/contexts/providers/index.d.ts +2 -0
  24. package/dist/features/core/hooks/index.d.ts +2 -0
  25. package/dist/features/core/index.d.ts +6 -0
  26. package/dist/{types → features/core/types}/context.d.ts +4 -3
  27. package/dist/features/core/types/index.d.ts +8 -0
  28. package/dist/features/core/types/models.d.ts +202 -0
  29. package/dist/features/core/types/requests.d.ts +22 -0
  30. package/dist/features/core/utils/index.d.ts +1 -0
  31. package/dist/{components → features/messaging/components}/chat/ChatApp.d.ts +1 -2
  32. package/dist/{components → features/messaging/components}/chat/MessageComponent.d.ts +1 -1
  33. package/dist/{components → features/messaging/components}/chat/MessageList.d.ts +2 -2
  34. package/dist/{components → features/messaging/components}/chat/MessageRow.d.ts +2 -2
  35. package/dist/features/messaging/index.d.ts +12 -0
  36. package/dist/features/messaging/utils/markdown.worker.d.ts +1 -0
  37. package/dist/{context/providers/ChatSessionProvider.d.ts → features/streaming/contexts/StreamingProvider.d.ts} +9 -9
  38. package/dist/features/streaming/contexts/index.d.ts +3 -0
  39. package/dist/{context → features/streaming/contexts}/services/use-streaming-service.d.ts +3 -12
  40. package/dist/features/streaming/index.d.ts +3 -0
  41. package/dist/features/streaming/utils/index.d.ts +1 -0
  42. package/dist/features/streaming/utils/types.d.ts +101 -0
  43. package/dist/{hooks → features/thread/hooks}/useThreadHistoryState.d.ts +5 -5
  44. package/dist/{hooks → features/thread/hooks}/useThreadsState.d.ts +2 -2
  45. package/dist/features/thread/index.d.ts +2 -0
  46. package/dist/{components → features/ui/components}/ui/carousel.d.ts +2 -2
  47. package/dist/{components → features/ui/components}/ui/pagination.d.ts +1 -1
  48. package/dist/features/ui/components/ui/resizable.d.ts +23 -0
  49. package/dist/{components → features/ui/components}/ui/sidebar.d.ts +2 -2
  50. package/dist/features/ui/components/ui/use-toast.d.ts +2 -0
  51. package/dist/features/ui/hooks/index.d.ts +2 -0
  52. package/dist/{hooks → features/ui/hooks}/use-toast.d.ts +4 -4
  53. package/dist/features/ui/index.d.ts +17 -0
  54. package/dist/features/ui/utils/index.d.ts +1 -0
  55. package/dist/index.esm.js +13985 -12997
  56. package/dist/index.umd.js +49 -48
  57. package/dist/lib/index.d.ts +8 -27
  58. package/dist/types/events.d.ts +1 -90
  59. package/dist/types/index.d.ts +1 -3
  60. package/dist/types/models.d.ts +1 -226
  61. package/dist/types/requests.d.ts +1 -15
  62. package/package.json +1 -1
  63. package/dist/components/ui/resizable.d.ts +0 -23
  64. package/dist/components/ui/use-toast.d.ts +0 -2
  65. package/dist/context/index.d.ts +0 -14
  66. package/dist/context/types.d.ts +0 -1
  67. package/dist/hooks/checkpoints/types.d.ts +0 -1
  68. package/dist/lib/markdown.d.ts +0 -46
  69. package/dist/types/toolStream.d.ts +0 -11
  70. package/dist/utils/env.d.ts +0 -12
  71. /package/dist/{lib → features/checkpoint/utils}/historyUtils.d.ts +0 -0
  72. /package/dist/{lib → features/checkpoint/utils}/schemaUtils.d.ts +0 -0
  73. /package/dist/{api/file-api.d.ts → features/core/api/clients/fileClient.d.ts} +0 -0
  74. /package/dist/{api/utils.d.ts → features/core/api/utils/http.d.ts} +0 -0
  75. /package/dist/{lib → features/core/utils}/chatUtils.d.ts +0 -0
  76. /package/dist/{components → features/messaging/components}/chat/ChatInput.d.ts +0 -0
  77. /package/dist/{components → features/messaging/components}/chat/ChatInterface.d.ts +0 -0
  78. /package/dist/{components → features/messaging/components}/chat/FileViewerModal.d.ts +0 -0
  79. /package/dist/{components → features/messaging/components}/chat/MarkdownContent.d.ts +0 -0
  80. /package/dist/{components → features/messaging/components}/chat/ThreadManager.d.ts +0 -0
  81. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/ArtifactRenderer.d.ts +0 -0
  82. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/InterruptPartRenderer.d.ts +0 -0
  83. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/ResearchTaskArtifact.d.ts +0 -0
  84. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/SimpleJsonView.d.ts +0 -0
  85. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/StreamProgress.d.ts +0 -0
  86. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/ToolComponent.d.ts +0 -0
  87. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/UserTextContent.d.ts +0 -0
  88. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/artifacts/PlotArtifact.d.ts +0 -0
  89. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/artifacts/ResearchTaskArtifact.d.ts +0 -0
  90. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/index.d.ts +0 -0
  91. /package/dist/{components/chat/message-components → features/messaging/components/chat/message}/useFilePreview.d.ts +0 -0
  92. /package/dist/{components → features/messaging/components}/chat/threads/ThreadListItem.d.ts +0 -0
  93. /package/dist/{lib → features/messaging/utils}/messageHelpers.d.ts +0 -0
  94. /package/dist/{lib → features/messaging/utils}/messageUtils.d.ts +0 -0
  95. /package/dist/{components/settings → features/settings/components}/ChatSettings.d.ts +0 -0
  96. /package/dist/{context → features/streaming/contexts}/reducers/MessageReducer.d.ts +0 -0
  97. /package/dist/{context → features/streaming/contexts}/reducers/utils/reducerUtils.d.ts +0 -0
  98. /package/dist/{hooks → features/streaming/hooks}/use-stream.d.ts +0 -0
  99. /package/dist/{components → features/ui/components}/ui/accordion.d.ts +0 -0
  100. /package/dist/{components → features/ui/components}/ui/alert-dialog.d.ts +0 -0
  101. /package/dist/{components → features/ui/components}/ui/alert.d.ts +0 -0
  102. /package/dist/{components → features/ui/components}/ui/aspect-ratio.d.ts +0 -0
  103. /package/dist/{components → features/ui/components}/ui/avatar.d.ts +0 -0
  104. /package/dist/{components → features/ui/components}/ui/badge.d.ts +0 -0
  105. /package/dist/{components → features/ui/components}/ui/breadcrumb.d.ts +0 -0
  106. /package/dist/{components → features/ui/components}/ui/button.d.ts +0 -0
  107. /package/dist/{components → features/ui/components}/ui/calendar.d.ts +0 -0
  108. /package/dist/{components → features/ui/components}/ui/card.d.ts +0 -0
  109. /package/dist/{components → features/ui/components}/ui/chart.d.ts +0 -0
  110. /package/dist/{components → features/ui/components}/ui/checkbox.d.ts +0 -0
  111. /package/dist/{components → features/ui/components}/ui/collapsible.d.ts +0 -0
  112. /package/dist/{components → features/ui/components}/ui/command.d.ts +0 -0
  113. /package/dist/{components → features/ui/components}/ui/context-menu.d.ts +0 -0
  114. /package/dist/{components → features/ui/components}/ui/dialog.d.ts +0 -0
  115. /package/dist/{components → features/ui/components}/ui/drawer.d.ts +0 -0
  116. /package/dist/{components → features/ui/components}/ui/dropdown-menu.d.ts +0 -0
  117. /package/dist/{components → features/ui/components}/ui/form.d.ts +0 -0
  118. /package/dist/{components → features/ui/components}/ui/hover-card.d.ts +0 -0
  119. /package/dist/{components → features/ui/components}/ui/input-otp.d.ts +0 -0
  120. /package/dist/{components → features/ui/components}/ui/input.d.ts +0 -0
  121. /package/dist/{components → features/ui/components}/ui/label.d.ts +0 -0
  122. /package/dist/{components → features/ui/components}/ui/menubar.d.ts +0 -0
  123. /package/dist/{components → features/ui/components}/ui/navigation-menu.d.ts +0 -0
  124. /package/dist/{components → features/ui/components}/ui/popover.d.ts +0 -0
  125. /package/dist/{components → features/ui/components}/ui/progress.d.ts +0 -0
  126. /package/dist/{components → features/ui/components}/ui/radio-group.d.ts +0 -0
  127. /package/dist/{components → features/ui/components}/ui/scroll-area.d.ts +0 -0
  128. /package/dist/{components → features/ui/components}/ui/select.d.ts +0 -0
  129. /package/dist/{components → features/ui/components}/ui/separator.d.ts +0 -0
  130. /package/dist/{components → features/ui/components}/ui/sheet.d.ts +0 -0
  131. /package/dist/{components → features/ui/components}/ui/skeleton.d.ts +0 -0
  132. /package/dist/{components → features/ui/components}/ui/slider.d.ts +0 -0
  133. /package/dist/{components → features/ui/components}/ui/sonner.d.ts +0 -0
  134. /package/dist/{components → features/ui/components}/ui/switch.d.ts +0 -0
  135. /package/dist/{components → features/ui/components}/ui/table.d.ts +0 -0
  136. /package/dist/{components → features/ui/components}/ui/tabs.d.ts +0 -0
  137. /package/dist/{components → features/ui/components}/ui/textarea.d.ts +0 -0
  138. /package/dist/{components → features/ui/components}/ui/toast.d.ts +0 -0
  139. /package/dist/{components → features/ui/components}/ui/toaster.d.ts +0 -0
  140. /package/dist/{components → features/ui/components}/ui/toggle-group.d.ts +0 -0
  141. /package/dist/{components → features/ui/components}/ui/toggle.d.ts +0 -0
  142. /package/dist/{components → features/ui/components}/ui/tooltip.d.ts +0 -0
  143. /package/dist/{hooks → features/ui/hooks}/use-mobile.d.ts +0 -0
  144. /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
  };
@@ -10,8 +10,8 @@
10
10
  *
11
11
  * msg3 appears in multiple checkpoints = multiple attempts/versions
12
12
  */
13
- import type { HydratedCheckpointSnapshot } from "@/types/models";
14
- import type { CheckpointAttemptInfo } from "@/types/checkpoints";
13
+ import type { HydratedCheckpointSnapshot } from "@/features/core/types";
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,5 +1,5 @@
1
1
  import type { ChatMessage } from '@/types';
2
- import type { HydratedCheckpointSnapshot } from '@/types/models';
2
+ import type { HydratedCheckpointSnapshot } from '@/features/core/types';
3
3
  export declare function getPreviewForMessage(message: ChatMessage): string;
4
4
  /**
5
5
  * Legacy function: builds a map of message ID -> preview text.
@@ -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 { ApiProvider, useApi } from "./ApiProvider";
2
+ export { ChatSessionProvider, useHasChatSession, useStream, useThreads, useThreadState, } from "./ChatSessionProvider";
@@ -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,6 @@
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, StreamEvent, SystemStreamEvent, ThreadStreamEvent, ToolStreamEvent } from "@/features/streaming";
3
+ import type { StreamCommand } from "./requests";
3
4
  export interface ApiConfig {
4
5
  baseUrl?: string;
5
6
  apiKey?: string;
@@ -22,7 +23,7 @@ export interface ApiContextValue {
22
23
  token: string | null;
23
24
  setToken: (token: string | null) => void;
24
25
  baseUrl: string;
25
- api: import("@/api/chat-api").ChatApi;
26
+ api: import("@/features/core").ChatApi;
26
27
  }
27
28
  export interface ThreadsContextValue {
28
29
  threads: ThreadSummary[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Core Infrastructure Types
3
+ *
4
+ * Re-export the core domain contracts used by features and hosts.
5
+ */
6
+ export * from "./context";
7
+ export * from "./models";
8
+ export * from "./requests";
@@ -0,0 +1,202 @@
1
+ export type Role = "system" | "user" | "assistant" | "tool";
2
+ export type TextPart = {
3
+ type: "text";
4
+ text: string;
5
+ };
6
+ export type ImagePart = {
7
+ type: "image_url";
8
+ url: string;
9
+ mimeType?: string;
10
+ alt?: string;
11
+ };
12
+ export type FilePart = {
13
+ type: "file";
14
+ url: string;
15
+ mimeType?: string;
16
+ name?: string;
17
+ size?: number;
18
+ sourceType?: string;
19
+ };
20
+ export type ToolCallPart = {
21
+ type: "tool_call";
22
+ id: string;
23
+ name: string;
24
+ args: Record<string, unknown>;
25
+ };
26
+ export type InterruptPart = {
27
+ type: "interrupt";
28
+ value?: any;
29
+ [key: string]: unknown;
30
+ };
31
+ export type MessagePart = TextPart | ImagePart | FilePart | ToolCallPart | InterruptPart;
32
+ export type PlotData = {
33
+ format?: string;
34
+ content_base64?: string;
35
+ url?: string;
36
+ mimeType?: string;
37
+ mime_type?: string;
38
+ plotId?: string;
39
+ artifactId?: string;
40
+ [key: string]: unknown;
41
+ };
42
+ export interface MessageArtifact {
43
+ [key: string]: unknown;
44
+ }
45
+ export type ArtifactPreview = {
46
+ src: string;
47
+ alt: string;
48
+ label?: string;
49
+ };
50
+ export interface ChatMessage {
51
+ id: string;
52
+ threadId?: string;
53
+ role: Role;
54
+ content: MessagePart[];
55
+ createdAt: string;
56
+ artifacts?: MessageArtifact[];
57
+ artifactPreviews?: Record<string, ArtifactPreview>;
58
+ edited?: boolean;
59
+ checkpointId?: string | null;
60
+ checkpointNs?: string | null;
61
+ branchLabel?: string;
62
+ toolCalls?: Array<{
63
+ id: string;
64
+ name: string;
65
+ args: Record<string, unknown>;
66
+ }>;
67
+ artifact?: MessageArtifact;
68
+ name?: string;
69
+ model?: string;
70
+ additionalKwargs?: Record<string, unknown>;
71
+ responseMetadata?: Record<string, unknown>;
72
+ __syntheticStreaming?: boolean;
73
+ }
74
+ export interface DefaultMessage {
75
+ type?: "default_message";
76
+ id?: string;
77
+ threadId?: string;
78
+ role: Role;
79
+ content: string;
80
+ createdAt?: string;
81
+ }
82
+ export interface PregelTask {
83
+ [key: string]: unknown;
84
+ }
85
+ export type PendingInterrupt = {
86
+ id: string;
87
+ value: unknown;
88
+ } | null;
89
+ export interface StateSnapshot {
90
+ values: Record<string, unknown>;
91
+ next?: string[];
92
+ config?: Record<string, unknown>;
93
+ metadata?: {
94
+ source?: string;
95
+ step?: number;
96
+ writes?: Record<string, unknown>;
97
+ execution_time?: number;
98
+ };
99
+ tasks?: PregelTask[];
100
+ created_at?: string;
101
+ createdAt?: string;
102
+ parentConfig?: Record<string, unknown>;
103
+ parent_config?: Record<string, unknown>;
104
+ }
105
+ export interface HydratedCheckpointSnapshot {
106
+ checkpointId: string | null;
107
+ checkpointNs: string | null;
108
+ parentId: string | null;
109
+ createdAt: string;
110
+ messages: ChatMessage[];
111
+ nextCursor: string | null;
112
+ nextCursorNs: string | null;
113
+ interrupt: PendingInterrupt;
114
+ metadata: {
115
+ step: number;
116
+ source: string | null;
117
+ [key: string]: unknown;
118
+ };
119
+ config: Record<string, unknown> | null;
120
+ parentConfig: Record<string, unknown> | null;
121
+ next: string[] | null;
122
+ tasks: Record<string, unknown>[] | null;
123
+ }
124
+ export interface HistoryPayload {
125
+ version: string;
126
+ threadId: string;
127
+ checkpoints: StateSnapshot[];
128
+ }
129
+ export interface CheckpointList {
130
+ checkpoints: Array<{
131
+ checkpoint_id: string;
132
+ checkpoint_ns: string | null;
133
+ checkpoint_config: Record<string, unknown> | null;
134
+ }>;
135
+ }
136
+ export interface StatePayload {
137
+ [key: string]: unknown;
138
+ }
139
+ export interface Envelope<T = unknown> {
140
+ type?: string;
141
+ data?: T;
142
+ error?: string;
143
+ metadata?: Record<string, unknown>;
144
+ }
145
+ export interface ThreadSummary {
146
+ threadId: string;
147
+ title: string;
148
+ createdAt: string;
149
+ updatedAt: string;
150
+ messageCount: number;
151
+ lastMessage?: string | null;
152
+ created?: boolean | null;
153
+ ready?: boolean | null;
154
+ }
155
+ export interface SharedThreadSummary extends ThreadSummary {
156
+ sharedAt: string;
157
+ sharedBy?: string;
158
+ sharedByUserId?: string;
159
+ }
160
+ export interface ThreadShareResponse {
161
+ success: boolean;
162
+ threadId: string;
163
+ shareUrl?: string;
164
+ message?: string;
165
+ }
166
+ export interface ThreadShareTarget {
167
+ type: "email" | "link" | "user";
168
+ value: string;
169
+ id?: string;
170
+ label?: string;
171
+ secondaryLabel?: string;
172
+ sharedByUserId?: string;
173
+ }
174
+ export interface ThreadInfo extends ThreadSummary {
175
+ description?: string;
176
+ isArchived?: boolean;
177
+ tags?: string[];
178
+ }
179
+ export interface AgentSummary {
180
+ id: string;
181
+ name: string;
182
+ createdAt: string;
183
+ updatedAt: string;
184
+ }
185
+ export interface AgentDetail extends AgentSummary {
186
+ description?: string;
187
+ schema?: Record<string, unknown>;
188
+ uiDefaultMessage?: string;
189
+ [key: string]: unknown;
190
+ }
191
+ export interface AgentList {
192
+ items?: AgentDetail[];
193
+ [key: string]: unknown;
194
+ }
195
+ export interface AgentSchemaInfo {
196
+ schema?: Record<string, unknown>;
197
+ [key: string]: unknown;
198
+ }
199
+ export type TokenListener = (token: string | null) => void;
200
+ export interface ExcelUploadResponse {
201
+ [key: string]: unknown;
202
+ }
@@ -0,0 +1,22 @@
1
+ export type StreamCommand = {
2
+ kind: "resume";
3
+ value: unknown;
4
+ } | {
5
+ kind: "goto";
6
+ node: string;
7
+ value?: unknown;
8
+ };
9
+ import type { TimelineCheckpoint } from "@/features/checkpoint/types";
10
+ export interface ChatRequest {
11
+ threadId?: string | null;
12
+ payload?: Record<string, unknown>;
13
+ checkpointId?: string | null;
14
+ checkpointNs?: string | null;
15
+ nodeFilter?: string | string[] | null;
16
+ config?: Record<string, unknown>;
17
+ edit?: boolean;
18
+ branchLabel?: string;
19
+ active_agent?: string;
20
+ command?: StreamCommand | null;
21
+ timelineCheckpoints?: TimelineCheckpoint[];
22
+ }
@@ -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";
@@ -0,0 +1 @@
1
+ export {};
@@ -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";