@blueking/chat-helper 0.0.12-beta.10 → 0.0.12-beta.12
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/README.md +8 -2
- package/dist/agent/type.d.ts +69 -0
- package/dist/agent/type.ts.js +1 -1
- package/dist/agent/use-agent.d.ts +170 -10
- package/dist/agent/use-agent.ts.js +257 -17
- package/dist/event/ag-ui.d.ts +3 -0
- package/dist/event/ag-ui.ts.js +42 -3
- package/dist/event/type.d.ts +13 -2
- package/dist/event/type.ts.js +2 -0
- package/dist/http/index.d.ts +2 -0
- package/dist/http/module/agent.d.ts +2 -0
- package/dist/http/module/agent.ts.js +19 -2
- package/dist/http/module/index.d.ts +2 -0
- package/dist/http/module/message.ts.js +2 -2
- package/dist/http/module/session.d.ts +2 -1
- package/dist/http/module/session.ts.js +44 -7
- package/dist/http/transform/agent.d.ts +9 -1
- package/dist/http/transform/agent.ts.js +27 -0
- package/dist/http/transform/message.d.ts +6 -0
- package/dist/http/transform/message.ts.js +56 -0
- package/dist/index.d.ts +792 -6
- package/dist/message/type.d.ts +18 -3
- package/dist/message/type.ts.js +2 -0
- package/dist/message/use-message.d.ts +208 -0
- package/dist/session/type.d.ts +14 -0
- package/dist/session/use-session.d.ts +418 -1
- package/dist/session/use-session.ts.js +5 -0
- package/package.json +1 -1
package/dist/message/type.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { IFlowAgentResultCustomValue, IRunFinishedEvent } from '../event/type';
|
|
1
|
+
import type { IArtifactsGeneratedCustomValue, IFlowAgentResultCustomValue, IRunFinishedEvent } from '../event/type';
|
|
2
2
|
export declare enum ActivityType {
|
|
3
|
+
ArtifactsGenerated = "artifacts_generated",
|
|
3
4
|
FlowAgent = "flow_agent",
|
|
4
5
|
KnowledgeRag = "knowledge_rag",
|
|
5
6
|
ReferenceDocument = "reference_document",
|
|
7
|
+
Info = "info",
|
|
6
8
|
Interrupt = "interrupt"
|
|
7
9
|
}
|
|
8
10
|
export declare enum MessageRole {
|
|
@@ -54,12 +56,14 @@ export type IUserOperationPayload = {
|
|
|
54
56
|
};
|
|
55
57
|
export interface IActivityMessage extends IBaseMessage {
|
|
56
58
|
activityType: ActivityType;
|
|
57
|
-
content: IFlowAgentResultCustomValue | IKnowledgeRag | IReferenceDocument;
|
|
59
|
+
content: IArtifactsGeneratedCustomValue | IFlowAgentResultCustomValue | IKnowledgeRag | IReferenceDocument;
|
|
60
|
+
property?: IMessageProperty;
|
|
58
61
|
role: MessageRole.Activity;
|
|
59
62
|
}
|
|
60
63
|
export interface IActivityMessageApi extends IBaseMessageApi {
|
|
61
64
|
activity_type: ActivityType;
|
|
62
|
-
content: IFlowAgentResultCustomValue | IKnowledgeRagApi | IReferenceDocumentApi;
|
|
65
|
+
content: IArtifactsGeneratedCustomValue | IFlowAgentResultCustomValue | IKnowledgeRagApi | IReferenceDocumentApi;
|
|
66
|
+
property?: IMessageProperty;
|
|
63
67
|
role: MessageRole.Activity;
|
|
64
68
|
}
|
|
65
69
|
export interface IAssistantMessage extends IBaseMessage {
|
|
@@ -251,6 +255,16 @@ export interface IKnowledgeRagApi {
|
|
|
251
255
|
}
|
|
252
256
|
export type IMessage = IActivityMessage | IAssistantMessage | IDeveloperMessage | IGuideMessage | IHiddenAssistantMessage | IHiddenGuideMessage | IHiddenMessage | IHiddenSystemMessage | IHiddenUserMessage | IInfoMessage | IPauseMessage | IPlaceholderMessage | IReasoningMessage | ISystemMessage | ITemplateAssistantMessage | ITemplateGuideMessage | ITemplateHiddenMessage | ITemplateSystemMessage | ITemplateUserMessage | IToolMessage | IUserMessage | IInterruptMessage;
|
|
253
257
|
export type IMessageApi = IActivityMessageApi | IAssistantMessageApi | IDeveloperMessageApi | IGuideMessageApi | IHiddenAssistantMessageApi | IHiddenGuideMessageApi | IHiddenMessageApi | IHiddenSystemMessageApi | IHiddenUserMessageApi | IInfoMessageApi | IPauseMessageApi | IPlaceholderMessageApi | IReasoningMessageApi | ISystemMessageApi | ITemplateAssistantMessageApi | ITemplateGuideMessageApi | ITemplateHiddenMessageApi | ITemplateSystemMessageApi | ITemplateUserMessageApi | IToolMessageApi | IUserMessageApi | IInterruptMessageApi;
|
|
258
|
+
export interface IMessageArtifact {
|
|
259
|
+
name: string;
|
|
260
|
+
outputId: string;
|
|
261
|
+
size: number;
|
|
262
|
+
type: string;
|
|
263
|
+
/** 事件不再下发;仅兼容旧数据 */
|
|
264
|
+
previewUrl?: string;
|
|
265
|
+
/** 事件不再下发;仅兼容旧数据 */
|
|
266
|
+
url?: string;
|
|
267
|
+
}
|
|
254
268
|
/**
|
|
255
269
|
* 消息属性 - 用于传递引用内容或快捷键相关信息
|
|
256
270
|
* 该类型设计为灵活的结构,由外部调用方决定具体内容
|
|
@@ -258,6 +272,7 @@ export type IMessageApi = IActivityMessageApi | IAssistantMessageApi | IDevelope
|
|
|
258
272
|
export interface IMessageProperty {
|
|
259
273
|
/** 其他扩展字段 */
|
|
260
274
|
[key: string]: unknown;
|
|
275
|
+
artifacts?: IMessageArtifact[];
|
|
261
276
|
extra?: {
|
|
262
277
|
/** 其他扩展字段 */
|
|
263
278
|
[key: string]: unknown;
|
package/dist/message/type.ts.js
CHANGED
|
@@ -24,9 +24,11 @@
|
|
|
24
24
|
* IN THE SOFTWARE.
|
|
25
25
|
*/ export var ActivityType;
|
|
26
26
|
(function(ActivityType) {
|
|
27
|
+
ActivityType["ArtifactsGenerated"] = "artifacts_generated";
|
|
27
28
|
ActivityType["FlowAgent"] = "flow_agent";
|
|
28
29
|
ActivityType["KnowledgeRag"] = "knowledge_rag";
|
|
29
30
|
ActivityType["ReferenceDocument"] = "reference_document";
|
|
31
|
+
ActivityType["Info"] = "info";
|
|
30
32
|
ActivityType["Interrupt"] = "interrupt";
|
|
31
33
|
})(ActivityType || (ActivityType = {}));
|
|
32
34
|
export var MessageRole;
|
|
@@ -9,6 +9,17 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
9
9
|
list: import("vue").Ref<({
|
|
10
10
|
activityType: import("./type").ActivityType;
|
|
11
11
|
content: {
|
|
12
|
+
artifacts: {
|
|
13
|
+
name: string;
|
|
14
|
+
outputId: string;
|
|
15
|
+
size: number;
|
|
16
|
+
type: string;
|
|
17
|
+
previewUrl?: string;
|
|
18
|
+
url?: string;
|
|
19
|
+
}[];
|
|
20
|
+
runId: string;
|
|
21
|
+
status: "complete" | "empty";
|
|
22
|
+
} | {
|
|
12
23
|
nodes: Record<string, import("..").IFlowAgentNode>;
|
|
13
24
|
task_id: string;
|
|
14
25
|
task_name: string;
|
|
@@ -26,6 +37,31 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
26
37
|
originFileUrl?: string;
|
|
27
38
|
url: string;
|
|
28
39
|
}[];
|
|
40
|
+
property?: {
|
|
41
|
+
[x: string]: unknown;
|
|
42
|
+
artifacts?: {
|
|
43
|
+
name: string;
|
|
44
|
+
outputId: string;
|
|
45
|
+
size: number;
|
|
46
|
+
type: string;
|
|
47
|
+
previewUrl?: string;
|
|
48
|
+
url?: string;
|
|
49
|
+
}[];
|
|
50
|
+
extra?: {
|
|
51
|
+
[x: string]: unknown;
|
|
52
|
+
cite?: string | {
|
|
53
|
+
data: {
|
|
54
|
+
key: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}[];
|
|
57
|
+
title: string;
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
command?: string;
|
|
61
|
+
context?: Array<Record<string, unknown>>;
|
|
62
|
+
resources?: Array<Record<string, unknown>>;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
29
65
|
role: MessageRole.Activity;
|
|
30
66
|
id?: string;
|
|
31
67
|
messageId?: string;
|
|
@@ -36,6 +72,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
36
72
|
content?: string;
|
|
37
73
|
property?: {
|
|
38
74
|
[x: string]: unknown;
|
|
75
|
+
artifacts?: {
|
|
76
|
+
name: string;
|
|
77
|
+
outputId: string;
|
|
78
|
+
size: number;
|
|
79
|
+
type: string;
|
|
80
|
+
previewUrl?: string;
|
|
81
|
+
url?: string;
|
|
82
|
+
}[];
|
|
39
83
|
extra?: {
|
|
40
84
|
[x: string]: unknown;
|
|
41
85
|
cite?: string | {
|
|
@@ -859,6 +903,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
859
903
|
})[];
|
|
860
904
|
property?: {
|
|
861
905
|
[x: string]: unknown;
|
|
906
|
+
artifacts?: {
|
|
907
|
+
name: string;
|
|
908
|
+
outputId: string;
|
|
909
|
+
size: number;
|
|
910
|
+
type: string;
|
|
911
|
+
previewUrl?: string;
|
|
912
|
+
url?: string;
|
|
913
|
+
}[];
|
|
862
914
|
extra?: {
|
|
863
915
|
[x: string]: unknown;
|
|
864
916
|
cite?: string | {
|
|
@@ -883,6 +935,17 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
883
935
|
})[], IMessage[] | ({
|
|
884
936
|
activityType: import("./type").ActivityType;
|
|
885
937
|
content: {
|
|
938
|
+
artifacts: {
|
|
939
|
+
name: string;
|
|
940
|
+
outputId: string;
|
|
941
|
+
size: number;
|
|
942
|
+
type: string;
|
|
943
|
+
previewUrl?: string;
|
|
944
|
+
url?: string;
|
|
945
|
+
}[];
|
|
946
|
+
runId: string;
|
|
947
|
+
status: "complete" | "empty";
|
|
948
|
+
} | {
|
|
886
949
|
nodes: Record<string, import("..").IFlowAgentNode>;
|
|
887
950
|
task_id: string;
|
|
888
951
|
task_name: string;
|
|
@@ -900,6 +963,31 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
900
963
|
originFileUrl?: string;
|
|
901
964
|
url: string;
|
|
902
965
|
}[];
|
|
966
|
+
property?: {
|
|
967
|
+
[x: string]: unknown;
|
|
968
|
+
artifacts?: {
|
|
969
|
+
name: string;
|
|
970
|
+
outputId: string;
|
|
971
|
+
size: number;
|
|
972
|
+
type: string;
|
|
973
|
+
previewUrl?: string;
|
|
974
|
+
url?: string;
|
|
975
|
+
}[];
|
|
976
|
+
extra?: {
|
|
977
|
+
[x: string]: unknown;
|
|
978
|
+
cite?: string | {
|
|
979
|
+
data: {
|
|
980
|
+
key: string;
|
|
981
|
+
value: string;
|
|
982
|
+
}[];
|
|
983
|
+
title: string;
|
|
984
|
+
type: string;
|
|
985
|
+
};
|
|
986
|
+
command?: string;
|
|
987
|
+
context?: Array<Record<string, unknown>>;
|
|
988
|
+
resources?: Array<Record<string, unknown>>;
|
|
989
|
+
};
|
|
990
|
+
};
|
|
903
991
|
role: MessageRole.Activity;
|
|
904
992
|
id?: string;
|
|
905
993
|
messageId?: string;
|
|
@@ -910,6 +998,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
910
998
|
content?: string;
|
|
911
999
|
property?: {
|
|
912
1000
|
[x: string]: unknown;
|
|
1001
|
+
artifacts?: {
|
|
1002
|
+
name: string;
|
|
1003
|
+
outputId: string;
|
|
1004
|
+
size: number;
|
|
1005
|
+
type: string;
|
|
1006
|
+
previewUrl?: string;
|
|
1007
|
+
url?: string;
|
|
1008
|
+
}[];
|
|
913
1009
|
extra?: {
|
|
914
1010
|
[x: string]: unknown;
|
|
915
1011
|
cite?: string | {
|
|
@@ -1733,6 +1829,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
1733
1829
|
})[];
|
|
1734
1830
|
property?: {
|
|
1735
1831
|
[x: string]: unknown;
|
|
1832
|
+
artifacts?: {
|
|
1833
|
+
name: string;
|
|
1834
|
+
outputId: string;
|
|
1835
|
+
size: number;
|
|
1836
|
+
type: string;
|
|
1837
|
+
previewUrl?: string;
|
|
1838
|
+
url?: string;
|
|
1839
|
+
}[];
|
|
1736
1840
|
extra?: {
|
|
1737
1841
|
[x: string]: unknown;
|
|
1738
1842
|
cite?: string | {
|
|
@@ -1762,6 +1866,17 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
1762
1866
|
getCurrentLoadingMessage: () => {
|
|
1763
1867
|
activityType: import("./type").ActivityType;
|
|
1764
1868
|
content: {
|
|
1869
|
+
artifacts: {
|
|
1870
|
+
name: string;
|
|
1871
|
+
outputId: string;
|
|
1872
|
+
size: number;
|
|
1873
|
+
type: string;
|
|
1874
|
+
previewUrl?: string;
|
|
1875
|
+
url?: string;
|
|
1876
|
+
}[];
|
|
1877
|
+
runId: string;
|
|
1878
|
+
status: "complete" | "empty";
|
|
1879
|
+
} | {
|
|
1765
1880
|
nodes: Record<string, import("..").IFlowAgentNode>;
|
|
1766
1881
|
task_id: string;
|
|
1767
1882
|
task_name: string;
|
|
@@ -1779,6 +1894,31 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
1779
1894
|
originFileUrl?: string;
|
|
1780
1895
|
url: string;
|
|
1781
1896
|
}[];
|
|
1897
|
+
property?: {
|
|
1898
|
+
[x: string]: unknown;
|
|
1899
|
+
artifacts?: {
|
|
1900
|
+
name: string;
|
|
1901
|
+
outputId: string;
|
|
1902
|
+
size: number;
|
|
1903
|
+
type: string;
|
|
1904
|
+
previewUrl?: string;
|
|
1905
|
+
url?: string;
|
|
1906
|
+
}[];
|
|
1907
|
+
extra?: {
|
|
1908
|
+
[x: string]: unknown;
|
|
1909
|
+
cite?: string | {
|
|
1910
|
+
data: {
|
|
1911
|
+
key: string;
|
|
1912
|
+
value: string;
|
|
1913
|
+
}[];
|
|
1914
|
+
title: string;
|
|
1915
|
+
type: string;
|
|
1916
|
+
};
|
|
1917
|
+
command?: string;
|
|
1918
|
+
context?: Array<Record<string, unknown>>;
|
|
1919
|
+
resources?: Array<Record<string, unknown>>;
|
|
1920
|
+
};
|
|
1921
|
+
};
|
|
1782
1922
|
role: MessageRole.Activity;
|
|
1783
1923
|
id?: string;
|
|
1784
1924
|
messageId?: string;
|
|
@@ -1789,6 +1929,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
1789
1929
|
content?: string;
|
|
1790
1930
|
property?: {
|
|
1791
1931
|
[x: string]: unknown;
|
|
1932
|
+
artifacts?: {
|
|
1933
|
+
name: string;
|
|
1934
|
+
outputId: string;
|
|
1935
|
+
size: number;
|
|
1936
|
+
type: string;
|
|
1937
|
+
previewUrl?: string;
|
|
1938
|
+
url?: string;
|
|
1939
|
+
}[];
|
|
1792
1940
|
extra?: {
|
|
1793
1941
|
[x: string]: unknown;
|
|
1794
1942
|
cite?: string | {
|
|
@@ -2612,6 +2760,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
2612
2760
|
})[];
|
|
2613
2761
|
property?: {
|
|
2614
2762
|
[x: string]: unknown;
|
|
2763
|
+
artifacts?: {
|
|
2764
|
+
name: string;
|
|
2765
|
+
outputId: string;
|
|
2766
|
+
size: number;
|
|
2767
|
+
type: string;
|
|
2768
|
+
previewUrl?: string;
|
|
2769
|
+
url?: string;
|
|
2770
|
+
}[];
|
|
2615
2771
|
extra?: {
|
|
2616
2772
|
[x: string]: unknown;
|
|
2617
2773
|
cite?: string | {
|
|
@@ -2637,6 +2793,17 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
2637
2793
|
getMessageByMessageId: (id: string) => {
|
|
2638
2794
|
activityType: import("./type").ActivityType;
|
|
2639
2795
|
content: {
|
|
2796
|
+
artifacts: {
|
|
2797
|
+
name: string;
|
|
2798
|
+
outputId: string;
|
|
2799
|
+
size: number;
|
|
2800
|
+
type: string;
|
|
2801
|
+
previewUrl?: string;
|
|
2802
|
+
url?: string;
|
|
2803
|
+
}[];
|
|
2804
|
+
runId: string;
|
|
2805
|
+
status: "complete" | "empty";
|
|
2806
|
+
} | {
|
|
2640
2807
|
nodes: Record<string, import("..").IFlowAgentNode>;
|
|
2641
2808
|
task_id: string;
|
|
2642
2809
|
task_name: string;
|
|
@@ -2654,6 +2821,31 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
2654
2821
|
originFileUrl?: string;
|
|
2655
2822
|
url: string;
|
|
2656
2823
|
}[];
|
|
2824
|
+
property?: {
|
|
2825
|
+
[x: string]: unknown;
|
|
2826
|
+
artifacts?: {
|
|
2827
|
+
name: string;
|
|
2828
|
+
outputId: string;
|
|
2829
|
+
size: number;
|
|
2830
|
+
type: string;
|
|
2831
|
+
previewUrl?: string;
|
|
2832
|
+
url?: string;
|
|
2833
|
+
}[];
|
|
2834
|
+
extra?: {
|
|
2835
|
+
[x: string]: unknown;
|
|
2836
|
+
cite?: string | {
|
|
2837
|
+
data: {
|
|
2838
|
+
key: string;
|
|
2839
|
+
value: string;
|
|
2840
|
+
}[];
|
|
2841
|
+
title: string;
|
|
2842
|
+
type: string;
|
|
2843
|
+
};
|
|
2844
|
+
command?: string;
|
|
2845
|
+
context?: Array<Record<string, unknown>>;
|
|
2846
|
+
resources?: Array<Record<string, unknown>>;
|
|
2847
|
+
};
|
|
2848
|
+
};
|
|
2657
2849
|
role: MessageRole.Activity;
|
|
2658
2850
|
id?: string;
|
|
2659
2851
|
messageId?: string;
|
|
@@ -2664,6 +2856,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
2664
2856
|
content?: string;
|
|
2665
2857
|
property?: {
|
|
2666
2858
|
[x: string]: unknown;
|
|
2859
|
+
artifacts?: {
|
|
2860
|
+
name: string;
|
|
2861
|
+
outputId: string;
|
|
2862
|
+
size: number;
|
|
2863
|
+
type: string;
|
|
2864
|
+
previewUrl?: string;
|
|
2865
|
+
url?: string;
|
|
2866
|
+
}[];
|
|
2667
2867
|
extra?: {
|
|
2668
2868
|
[x: string]: unknown;
|
|
2669
2869
|
cite?: string | {
|
|
@@ -3487,6 +3687,14 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
3487
3687
|
})[];
|
|
3488
3688
|
property?: {
|
|
3489
3689
|
[x: string]: unknown;
|
|
3690
|
+
artifacts?: {
|
|
3691
|
+
name: string;
|
|
3692
|
+
outputId: string;
|
|
3693
|
+
size: number;
|
|
3694
|
+
type: string;
|
|
3695
|
+
previewUrl?: string;
|
|
3696
|
+
url?: string;
|
|
3697
|
+
}[];
|
|
3490
3698
|
extra?: {
|
|
3491
3699
|
[x: string]: unknown;
|
|
3492
3700
|
cite?: string | {
|
package/dist/session/type.d.ts
CHANGED
|
@@ -96,3 +96,17 @@ export interface ISessionFeedbackApi {
|
|
|
96
96
|
session_code: string;
|
|
97
97
|
session_content_ids: number[];
|
|
98
98
|
}
|
|
99
|
+
/** pv_files/download_url 响应(保持后端 snake_case) */
|
|
100
|
+
export interface IPvFileDownloadUrlResult {
|
|
101
|
+
download_url: string;
|
|
102
|
+
expires_at: string;
|
|
103
|
+
preview_url: string;
|
|
104
|
+
sha256: string;
|
|
105
|
+
size: number;
|
|
106
|
+
}
|
|
107
|
+
export interface GetPvFileDownloadUrlOptions {
|
|
108
|
+
/** 有效期秒数,默认 600,最大 3600 */
|
|
109
|
+
expiresIn?: number;
|
|
110
|
+
/** 请求超时毫秒,默认 20000 */
|
|
111
|
+
timeout?: number;
|
|
112
|
+
}
|