teodor-new-chat-ui 4.3.386 → 4.3.388

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 (37) hide show
  1. package/dist/api/chat-api.d.ts +2 -3
  2. package/dist/api/utils.d.ts +1 -1
  3. package/dist/components/chat/ChatInterface.d.ts +1 -1
  4. package/dist/components/chat/MessageComponent.d.ts +1 -1
  5. package/dist/components/chat/MessageList.d.ts +1 -1
  6. package/dist/components/chat/MessageRow.d.ts +1 -1
  7. package/dist/components/chat/ThreadManager.d.ts +5 -1
  8. package/dist/components/chat/message-components/ArtifactRenderer.d.ts +1 -1
  9. package/dist/components/chat/message-components/StreamProgress.d.ts +1 -1
  10. package/dist/components/chat/message-components/ToolComponent.d.ts +1 -1
  11. package/dist/components/chat/message-components/artifacts/PlotArtifact.d.ts +1 -1
  12. package/dist/components/chat/threads/ThreadListItem.d.ts +1 -1
  13. package/dist/config/env.d.ts +1 -1
  14. package/dist/context/ChatProviders.d.ts +1 -1
  15. package/dist/context/index.d.ts +1 -1
  16. package/dist/context/providers/ApiProvider.d.ts +1 -1
  17. package/dist/context/providers/ChatSessionProvider.d.ts +1 -4
  18. package/dist/context/reducers/MessageReducer.d.ts +1 -1
  19. package/dist/context/reducers/utils/reducerUtils.d.ts +1 -1
  20. package/dist/context/services/streaming/use-streaming-service.d.ts +1 -1
  21. package/dist/context/types.d.ts +1 -1
  22. package/dist/hooks/use-stream.d.ts +1 -1
  23. package/dist/hooks/useCheckpointMetadata.d.ts +1 -1
  24. package/dist/hooks/useMessageMetadata.d.ts +1 -1
  25. package/dist/hooks/useThreadHistoryState.d.ts +2 -2
  26. package/dist/hooks/useThreadsState.d.ts +1 -4
  27. package/dist/index.esm.js +5543 -5592
  28. package/dist/index.umd.js +41 -41
  29. package/dist/lib/chatUtils.d.ts +1 -1
  30. package/dist/lib/historyUtils.d.ts +1 -17
  31. package/dist/lib/index.d.ts +2 -2
  32. package/dist/lib/messageHelpers.d.ts +1 -1
  33. package/dist/lib/messagePreviews.d.ts +1 -1
  34. package/dist/types/{api.d.ts → index.d.ts} +0 -1
  35. package/dist/types/models.d.ts +10 -20
  36. package/package.json +1 -1
  37. package/dist/types/json-structures.d.ts +0 -30
@@ -1,4 +1,4 @@
1
- import type { MessagePart } from "@/types/api";
1
+ import type { MessagePart } from "@/types";
2
2
  export declare function fileToDataUrl(file: File): Promise<string>;
3
3
  export declare function fileToBase64(file: File): Promise<string>;
4
4
  export declare function uploadFileWithFallback(api: unknown, file: File, threadId?: string | null): Promise<string | null>;
@@ -1,4 +1,4 @@
1
- import type { HistoryPayload, HydratedCheckpointSnapshot, PendingInterrupt, TimelineCheckpoint } from "@/types/api";
1
+ import type { HistoryPayload, HydratedCheckpointSnapshot, PendingInterrupt, TimelineCheckpoint } from "@/types";
2
2
  export type HistoryPendingInterrupt = PendingInterrupt;
3
3
  export type HistoryHydrationResult = {
4
4
  threadId: string;
@@ -10,19 +10,3 @@ export type HistoryHydrationResult = {
10
10
  };
11
11
  export declare function buildSnapshotKey(checkpointId: string | null | undefined, checkpointNs: string | null | undefined): string;
12
12
  export declare function hydrateHistorySnapshots(history: HistoryPayload | null | undefined): HistoryHydrationResult;
13
- /**
14
- * Finds the checkpoint preceding a given user message ID by looking for
15
- * the last checkpoint that does NOT have the same last user message ID.
16
- *
17
- * This is used during edits to find the previous step in the conversation,
18
- * ensuring we get a checkpoint from before the current attempt group.
19
- *
20
- * Matching user message IDs across checkpoints indicate a regeneration/retry
21
- * (same user input, different assistant responses). This function finds the
22
- * checkpoint that precedes this group.
23
- *
24
- * @param checkpoints - Array of HydratedCheckpointSnapshot objects (assumed sorted newest first)
25
- * @param userMessageId - The ID of the current user message
26
- * @returns The previous checkpoint (from a different attempt group), or null if none found
27
- */
28
- export declare function findCheckpointBeforeUserMessage(checkpoints: HydratedCheckpointSnapshot[], userMessageId: string | null | undefined): HydratedCheckpointSnapshot | null;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Chat Components - Clean public API exports
3
3
  */
4
- export type { ApiContextValue, StreamContextValue, ThreadsContextValue, ThreadStateContextValue } from '@/types/api';
4
+ export type { ApiContextValue, StreamContextValue, ThreadsContextValue, ThreadStateContextValue } from '@/types';
5
5
  export { ChatProviders, useApi, useStream, useThreads, useThreadState } from '../context';
6
6
  export { ChatInput } from '../components/chat/ChatInput';
7
7
  export type { ChatInputProps } from '../components/chat/ChatInput';
@@ -23,7 +23,7 @@ export type { ChatConfig } from "@/config/env";
23
23
  export { del, get, getChatToken, onChatTokenChanged, post, put, setChatToken } from '../api/utils';
24
24
  export { ChatSettings } from '@/components/settings/ChatSettings';
25
25
  export type { ChatSettingsConfig } from '@/components/settings/ChatSettings';
26
- export type { ChatMessage, ChatRequest, CheckpointSnapshot, HistoryPayload, HydratedCheckpointSnapshot, MessagePart, PregelTask, Role, StreamEvent, TextPart, ThreadInfo, ThreadSummary, ToolEndEvent } from '@/types/api';
26
+ export type { ChatMessage, ChatRequest, CheckpointSnapshot, HistoryPayload, HydratedCheckpointSnapshot, MessagePart, PregelTask, Role, StreamEvent, TextPart, ThreadInfo, ThreadSummary, ToolEndEvent } from '@/types';
27
27
  export { buildMessagePreviewMap } from './messagePreviews';
28
28
  export type { ChatAppProps, SimpleChatProps } from '../components/chat/ChatApp';
29
29
  export type { ChatProvidersProps } from '../context/ChatProviders';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shared helper utilities for chat message rendering and metadata parsing.
3
3
  */
4
- import type { ArtifactPreview, ChatMessage, DefaultMessage, MessagePart, PlotData } from "@/types/api";
4
+ import type { ArtifactPreview, ChatMessage, DefaultMessage, MessagePart, PlotData } from "@/types";
5
5
  export declare function collectText(parts: MessagePart[]): string;
6
6
  export declare function extractToolMeta(message: ChatMessage): {
7
7
  name?: string;
@@ -1,4 +1,4 @@
1
- import type { ChatMessage } from '@/types/api';
1
+ import type { ChatMessage } from '@/types';
2
2
  import type { HydratedCheckpointSnapshot } from '@/types/models';
3
3
  /**
4
4
  * Legacy function: builds a map of message ID -> preview text.
@@ -1,6 +1,5 @@
1
1
  export * from "./context";
2
2
  export * from "./events";
3
- export * from "./json-structures";
4
3
  export * from "./models";
5
4
  export * from "./requests";
6
5
  export * from "./timeline";
@@ -171,26 +171,16 @@ export interface ThreadShareResponse {
171
171
  sharedWithUserId: string;
172
172
  sharedAt: string;
173
173
  }
174
- export interface SmartOrgUser {
175
- id?: string;
176
- user_id?: string;
177
- username?: string;
178
- email?: string;
179
- name?: string;
180
- organisation?: string;
181
- created?: string;
182
- description?: string;
183
- locked?: boolean;
184
- email_verified?: boolean;
185
- phone1?: string;
186
- admin?: {
187
- force_password_change?: boolean;
188
- };
189
- passwordAttempts?: number;
190
- active_key?: string;
191
- active_expire?: string;
192
- isFirstLogin?: boolean;
193
- modified?: string;
174
+ /**
175
+ * Generic share target for thread sharing.
176
+ * Allows host applications to define their own user model and map it here.
177
+ * ThreadManager is agnostic to the user model structure.
178
+ */
179
+ export interface ThreadShareTarget {
180
+ id: string;
181
+ label: string;
182
+ secondaryLabel?: string;
183
+ metadata?: Record<string, unknown>;
194
184
  }
195
185
  export interface ThreadInfo extends ThreadSummary {
196
186
  lastMessage?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teodor-new-chat-ui",
3
- "version": "4.3.386",
3
+ "version": "4.3.388",
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,30 +0,0 @@
1
- export interface ResearchPlan {
2
- plan_id: string;
3
- research_objective?: string;
4
- innovation_idea?: {
5
- ideaName: string;
6
- whatProblem?: string;
7
- whoBuyUse?: string;
8
- defendablePosition?: string;
9
- };
10
- target_context_areas?: string[];
11
- research_steps?: ResearchStep[];
12
- success_criteria?: string[];
13
- parallel_execution_groups?: string[][];
14
- total_estimated_duration?: string;
15
- }
16
- export interface ResearchStep {
17
- step_id: string;
18
- step_name: string;
19
- description?: string;
20
- priority?: number;
21
- estimated_duration?: string;
22
- agent_type?: string;
23
- research_queries?: string[];
24
- expected_output?: string;
25
- dependencies?: string[];
26
- }
27
- export interface JsonStructure {
28
- type: 'research_plan' | 'generic';
29
- data: any;
30
- }