@infinilabs/chat-message 0.0.7 → 0.0.9

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.
@@ -13,6 +13,7 @@ interface DeepResearchDrawerProps {
13
13
  searchHits?: StepSearchHit[];
14
14
  formatUrl?: (data: any) => string;
15
15
  theme?: "light" | "dark";
16
+ showReportOnly?: boolean;
16
17
  }
17
- export declare const DeepResearchDrawer: ({ open, onClose, defaultActiveTab, steps, plannerStatus, executionStatus, reportStatus, reportData, reportContent, searchHits, formatUrl, theme, }: DeepResearchDrawerProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const DeepResearchDrawer: ({ open, onClose, defaultActiveTab, steps, plannerStatus, executionStatus, reportStatus, reportData, reportContent, searchHits, formatUrl, theme, showReportOnly, }: DeepResearchDrawerProps) => import("react/jsx-runtime").JSX.Element;
18
19
  export {};
@@ -9,4 +9,4 @@ export interface ResearchReportContentProps {
9
9
  data?: ResearchReportData;
10
10
  formatUrl?: (data: any) => string;
11
11
  }
12
- export declare const ResearchReportContent: ({ content, data, formatUrl }: ResearchReportContentProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const ResearchReportContent: ({ content, data, formatUrl, }: ResearchReportContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,19 @@
1
+ /**
2
+ * 步骤状态类型定义
3
+ * done: 已完成
4
+ * in_progress: 进行中
5
+ * pending: 等待中
6
+ */
1
7
  export type StepStatus = "done" | "in_progress" | "pending";
8
+ /**
9
+ * 搜索状态类型定义
10
+ * done: 搜索完成
11
+ * searching: 正在搜索
12
+ */
2
13
  export type StepSearchStatus = "done" | "searching";
14
+ /**
15
+ * 搜索结果条目接口
16
+ */
3
17
  export interface StepSearchHit {
4
18
  source?: string;
5
19
  title: string;
@@ -7,6 +21,9 @@ export interface StepSearchHit {
7
21
  content?: string;
8
22
  score?: number;
9
23
  }
24
+ /**
25
+ * 搜索任务接口
26
+ */
10
27
  export interface StepSearch {
11
28
  id: string;
12
29
  query: string;
@@ -15,6 +32,9 @@ export interface StepSearch {
15
32
  note?: string;
16
33
  hits?: StepSearchHit[];
17
34
  }
35
+ /**
36
+ * 研究步骤条目接口
37
+ */
18
38
  export interface StepItem {
19
39
  id: string;
20
40
  title: string;
@@ -29,5 +49,9 @@ interface ResearchStepsContentProps {
29
49
  executionStatus?: StepStatus;
30
50
  reportStatus?: StepStatus;
31
51
  }
52
+ /**
53
+ * 深层研究步骤内容组件
54
+ * 展示研究计划、执行步骤和报告生成的全过程状态
55
+ */
32
56
  export declare const ResearchStepsContent: ({ steps, plannerStatus, executionStatus, reportStatus, }: ResearchStepsContentProps) => import("react/jsx-runtime").JSX.Element;
33
57
  export {};
@@ -1,21 +1,9 @@
1
- import { StepItem, StepStatus, StepSearchHit } from './ResearchStepsContent';
2
- import { ResearchReportData } from './ResearchReportContent';
1
+ import { IChunkData } from '../../types/chat';
3
2
  interface DeepResearchProps {
4
- stepTitle: string;
5
- description?: string;
6
- query: string;
7
- statusText?: string;
8
- resultCount?: number;
9
- progress?: number;
10
- steps?: StepItem[];
11
- plannerStatus?: StepStatus;
12
- executionStatus?: StepStatus;
13
- reportStatus?: StepStatus;
14
- reportData?: ResearchReportData;
15
- reportContent?: string;
16
- searchHits?: StepSearchHit[];
3
+ ChunkData?: IChunkData[];
4
+ question?: string;
17
5
  formatUrl?: (data: any) => string;
18
6
  theme?: "light" | "dark";
19
7
  }
20
- export declare const DeepResearch: ({ stepTitle, description, query, statusText, resultCount, progress, steps, plannerStatus, executionStatus, reportStatus, reportData, reportContent, searchHits, formatUrl, theme, }: DeepResearchProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const DeepResearch: ({ ChunkData, question, formatUrl, theme, }: DeepResearchProps) => import("react/jsx-runtime").JSX.Element | null;
21
9
  export {};
@@ -3,6 +3,8 @@ interface PayloadCardProps {
3
3
  title?: string;
4
4
  url?: string;
5
5
  created?: string | number;
6
+ type?: string;
7
+ content?: string;
6
8
  [key: string]: any;
7
9
  };
8
10
  formatUrl?: (data: any) => string;
@@ -1,6 +1,4 @@
1
1
  import { IChatMessage, IChunkData } from '../types/chat';
2
- import { StepSearchHit } from './DeepResearch/ResearchStepsContent';
3
- import { ResearchReportData } from './DeepResearch/ResearchReportContent';
4
2
  export type { IChatMessage, IChunkData };
5
3
  export interface ChatMessageProps {
6
4
  message: IChatMessage;
@@ -14,30 +12,9 @@ export interface ChatMessageProps {
14
12
  formatUrl?: (data: IChunkData) => string;
15
13
  theme?: "light" | "dark" | "system";
16
14
  locale?: string;
17
- query_intent?: IChunkData;
18
- tools?: IChunkData;
19
- fetch_source?: IChunkData;
20
- pick_source?: IChunkData;
21
- deep_read?: IChunkData;
22
- think?: IChunkData;
23
- response?: IChunkData;
24
15
  report_content?: string;
25
- currentAssistant?: any;
26
16
  assistantList?: any[];
27
- loadingStep?: Record<string, boolean>;
28
- deepResearchPlans?: string[];
29
- deepResearchCurrentStepIndex?: number;
30
- deepResearchQuery?: string;
31
- deepResearchResultCount?: number;
32
- deepResearchResearcherStarted?: boolean;
33
- deepResearchReporterStarted?: boolean;
34
- deepResearchReporterFinished?: boolean;
35
- deepResearchReportData?: ResearchReportData;
36
- deepResearchSearchMap?: Record<string, {
37
- query?: string;
38
- resultCount?: number;
39
- hits?: StepSearchHit[];
40
- }>;
17
+ currentAssistant?: any;
41
18
  }
42
19
  export interface ChatMessageRef {
43
20
  addChunk: (chunk: IChunkData) => void;
@@ -8,6 +8,7 @@ export default function useMessageChunkData(): {
8
8
  deep_read: IChunkData | undefined;
9
9
  think: IChunkData | undefined;
10
10
  response: IChunkData | undefined;
11
+ deepResearch: IChunkData[];
11
12
  };
12
13
  handlers: {
13
14
  deal_query_intent: (data: IChunkData) => void;
@@ -17,6 +18,7 @@ export default function useMessageChunkData(): {
17
18
  deal_deep_read: (data: IChunkData) => void;
18
19
  deal_think: (data: IChunkData) => void;
19
20
  deal_response: (data: IChunkData) => void;
21
+ deal_deep_research: (data: IChunkData) => void;
20
22
  };
21
23
  clearAllChunkData: () => Promise<void>;
22
24
  };
@@ -0,0 +1,25 @@
1
+ import { IChunkData } from './types/chat';
2
+ export declare const realDataInitialMessages: {
3
+ _id: string;
4
+ _source: {
5
+ id: string;
6
+ created: string;
7
+ updated: string;
8
+ _system: {
9
+ owner_id: string;
10
+ tenant_id: string;
11
+ };
12
+ type: string;
13
+ session_id: string;
14
+ from: string;
15
+ message: string;
16
+ details: null;
17
+ up_vote: number;
18
+ down_vote: number;
19
+ assistant_id: string;
20
+ payload: null;
21
+ };
22
+ result: string;
23
+ }[];
24
+ export declare const realDataChunks: IChunkData[];
25
+ export declare const realDataChunks2: IChunkData[];
@@ -12,6 +12,7 @@ export interface ISource {
12
12
  details?: any[] | null;
13
13
  assistant_id?: string;
14
14
  assistant_item?: any;
15
+ deep_research_chunks?: IChunkData[];
15
16
  [key: string]: any;
16
17
  }
17
18
  export interface IChatMessage {
@@ -1,3 +1,4 @@
1
1
  export declare const copyToClipboard: (text: string) => Promise<void>;
2
2
  export declare const OpenURLWithBrowser: (url: string) => void;
3
3
  export declare const filesize: (size: number) => string;
4
+ export declare const formatDate: (date: string | number) => string;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "dist",
9
9
  "README.md"
10
10
  ],
11
- "version": "0.0.7",
11
+ "version": "0.0.9",
12
12
  "license": "MIT",
13
13
  "type": "module",
14
14
  "main": "dist/ChatMessage.cjs",
@@ -28,6 +28,7 @@
28
28
  "preview": "vite preview"
29
29
  },
30
30
  "peerDependencies": {
31
+ "antd": "^6.1.3",
31
32
  "react": "^18.3.1",
32
33
  "react-dom": "^18.3.1",
33
34
  "react-i18next": ">=11.0.0"
@@ -37,13 +38,13 @@
37
38
  "@infinilabs/markdown": "^0.0.2",
38
39
  "@infinilabs/search-results": "^0.0.16",
39
40
  "ahooks": "^3.9.6",
40
- "antd": "^6.1.4",
41
41
  "clsx": "^2.1.1",
42
42
  "i18next": "^25.7.3",
43
43
  "lucide-react": "^0.461.0",
44
44
  "motion": "^12.25.0"
45
45
  },
46
46
  "devDependencies": {
47
+ "antd": "^6.1.3",
47
48
  "@eslint/js": "^9.33.0",
48
49
  "@tailwindcss/vite": "^4.1.18",
49
50
  "@types/react": "18.3.3",