@infinilabs/chat-message 0.0.7 → 0.0.8
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.
- package/dist/ChatMessage.cjs +14 -14
- package/dist/ChatMessage.iife.js +14 -14
- package/dist/ChatMessage.js +2498 -2472
- package/dist/ChatMessage.umd.cjs +14 -14
- package/dist/components/DeepResearch/DeepResearchDrawer.d.ts +2 -1
- package/dist/components/DeepResearch/ResearchStepsContent.d.ts +24 -0
- package/dist/components/PayloadCard.d.ts +2 -0
- package/dist/components/index.d.ts +1 -24
- package/dist/hooks/useMessageChunkData.d.ts +2 -0
- package/dist/mockRealData.d.ts +24 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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 {};
|
|
@@ -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,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
|
-
|
|
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 | undefined;
|
|
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,24 @@
|
|
|
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[];
|
package/dist/utils/index.d.ts
CHANGED