@blueking/chat-helper 0.0.10-beta.4 → 0.0.12-beta.1
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/agent/use-agent.d.ts +2 -1272
- package/dist/agent/use-agent.ts.js +9 -90
- package/dist/event/ag-ui.d.ts +1 -9
- package/dist/event/ag-ui.ts.js +3 -46
- package/dist/event/type.d.ts +24 -87
- package/dist/event/type.ts.js +16 -43
- package/dist/http/index.d.ts +2 -6
- package/dist/http/module/index.d.ts +2 -6
- package/dist/http/module/message.d.ts +3 -6
- package/dist/http/module/message.ts.js +1 -18
- package/dist/http/module/session.d.ts +0 -1
- package/dist/http/module/session.ts.js +1 -4
- package/dist/http/transform/message.ts.js +0 -10
- package/dist/index.d.ts +2 -8835
- package/dist/message/type.d.ts +4 -24
- package/dist/message/type.ts.js +0 -7
- package/dist/message/use-message.d.ts +0 -2520
- package/dist/session/use-session.d.ts +0 -5040
- package/dist/session/use-session.ts.js +11 -6
- package/package.json +4 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IFlowAgentTaskNodeInfo, IMessage
|
|
1
|
+
import type { IFlowAgentTaskNodeInfo, IMessage } from '../../message/type';
|
|
2
2
|
import type { FetchClient, IRequestConfig } from '../fetch';
|
|
3
3
|
/**
|
|
4
4
|
* 分享消息接口返回数据
|
|
@@ -20,15 +20,12 @@ export interface IShareMessagesResponse {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const useMessage: (fetchClient: FetchClient) => {
|
|
22
22
|
getMessages: (sessionCode: string, limit?: number, config?: IRequestConfig) => Promise<IMessage[]>;
|
|
23
|
-
plusMessage: (data: IMessage, config?: IRequestConfig) => Promise<import("../../message/type").IActivityMessage | import("../../message/type").IAssistantMessage | import("../../message/type").IDeveloperMessage | import("../../message/type").
|
|
24
|
-
modifyMessage: (data: IMessage, config?: IRequestConfig) => Promise<import("../../message/type").IActivityMessage | import("../../message/type").IAssistantMessage | import("../../message/type").IDeveloperMessage | import("../../message/type").
|
|
23
|
+
plusMessage: (data: IMessage, config?: IRequestConfig) => Promise<import("../../message/type").IActivityMessage | import("../../message/type").IAssistantMessage | import("../../message/type").IDeveloperMessage | import("../../message/type").IGuideMessage | import("../../message/type").IHiddenAssistantMessage | import("../../message/type").IHiddenGuideMessage | import("../../message/type").IHiddenMessage | import("../../message/type").IHiddenSystemMessage | import("../../message/type").IHiddenUserMessage | import("../../message/type").IInfoMessage | import("../../message/type").IPauseMessage | import("../../message/type").IPlaceholderMessage | import("../../message/type").IReasoningMessage | import("../../message/type").ISystemMessage | import("../../message/type").ITemplateAssistantMessage | import("../../message/type").ITemplateGuideMessage | import("../../message/type").ITemplateHiddenMessage | import("../../message/type").ITemplateSystemMessage | import("../../message/type").ITemplateUserMessage | import("../../message/type").IToolMessage | import("../../message/type").IUserMessage>;
|
|
24
|
+
modifyMessage: (data: IMessage, config?: IRequestConfig) => Promise<import("../../message/type").IActivityMessage | import("../../message/type").IAssistantMessage | import("../../message/type").IDeveloperMessage | import("../../message/type").IGuideMessage | import("../../message/type").IHiddenAssistantMessage | import("../../message/type").IHiddenGuideMessage | import("../../message/type").IHiddenMessage | import("../../message/type").IHiddenSystemMessage | import("../../message/type").IHiddenUserMessage | import("../../message/type").IInfoMessage | import("../../message/type").IPauseMessage | import("../../message/type").IPlaceholderMessage | import("../../message/type").IReasoningMessage | import("../../message/type").ISystemMessage | import("../../message/type").ITemplateAssistantMessage | import("../../message/type").ITemplateGuideMessage | import("../../message/type").ITemplateHiddenMessage | import("../../message/type").ITemplateSystemMessage | import("../../message/type").ITemplateUserMessage | import("../../message/type").IToolMessage | import("../../message/type").IUserMessage>;
|
|
25
25
|
deleteMessage: (id: string, config?: IRequestConfig) => Promise<IMessage>;
|
|
26
26
|
batchDeleteMessages: (ids: string[], config?: IRequestConfig) => Promise<number>;
|
|
27
27
|
shareMessages: (sessionCode: string, contentIds: string[], expiredAt?: number, config?: IRequestConfig) => Promise<IShareMessagesResponse>;
|
|
28
28
|
stopChat: (sessionCode: string, config?: IRequestConfig) => Promise<void>;
|
|
29
29
|
getFlowAgentTaskInfo: (taskId: number, config?: IRequestConfig) => Promise<unknown>;
|
|
30
30
|
getFlowAgentTaskNodeInfo: (taskId: number, nodeId: string, config?: IRequestConfig) => Promise<IFlowAgentTaskNodeInfo>;
|
|
31
|
-
retryFlowAgentTaskNode: (sessionCode: string, nodeId: string, taskId: number, config?: IRequestConfig) => Promise<void>;
|
|
32
|
-
skipFlowAgentTaskNode: (sessionCode: string, nodeId: string, taskId: number, config?: IRequestConfig) => Promise<void>;
|
|
33
|
-
userOperation: (sessionCode: string, operation: UserOperation, payload: IUserOperationPayload, config?: IRequestConfig) => Promise<void>;
|
|
34
31
|
};
|
|
@@ -86,20 +86,6 @@ import { transferMessage2MessageApi, transferMessageApi2Message } from '../trans
|
|
|
86
86
|
const getFlowAgentTaskInfo = (taskId, config)=>fetchClient.get(`flow_agent/${taskId}/task_info/`, undefined, config);
|
|
87
87
|
// 获取流程引擎任务节点详情
|
|
88
88
|
const getFlowAgentTaskNodeInfo = (taskId, nodeId, config)=>fetchClient.get(`flow_agent/${taskId}/task_node_info/${nodeId}/`, undefined, config);
|
|
89
|
-
// 重试流程引擎任务节点
|
|
90
|
-
const retryFlowAgentTaskNode = (sessionCode, nodeId, taskId, config)=>fetchClient.post(`flow_agent/${sessionCode}/node/${nodeId}/retry/`, {
|
|
91
|
-
task_id: taskId
|
|
92
|
-
}, config);
|
|
93
|
-
// 跳过流程引擎任务节点
|
|
94
|
-
const skipFlowAgentTaskNode = (sessionCode, nodeId, taskId, config)=>fetchClient.post(`flow_agent/${sessionCode}/node/${nodeId}/skip/`, {
|
|
95
|
-
task_id: taskId
|
|
96
|
-
}, config);
|
|
97
|
-
// 用户操作
|
|
98
|
-
const userOperation = (sessionCode, operation, payload, config)=>fetchClient.post(`plugin_api/user_operation/`, {
|
|
99
|
-
session_code: sessionCode,
|
|
100
|
-
operation,
|
|
101
|
-
payload
|
|
102
|
-
}, config);
|
|
103
89
|
return {
|
|
104
90
|
getMessages,
|
|
105
91
|
plusMessage,
|
|
@@ -109,9 +95,6 @@ import { transferMessage2MessageApi, transferMessageApi2Message } from '../trans
|
|
|
109
95
|
shareMessages,
|
|
110
96
|
stopChat,
|
|
111
97
|
getFlowAgentTaskInfo,
|
|
112
|
-
getFlowAgentTaskNodeInfo
|
|
113
|
-
retryFlowAgentTaskNode,
|
|
114
|
-
skipFlowAgentTaskNode,
|
|
115
|
-
userOperation
|
|
98
|
+
getFlowAgentTaskNodeInfo
|
|
116
99
|
};
|
|
117
100
|
};
|
|
@@ -25,5 +25,4 @@ export declare const useSession: (fetchClient: FetchClient) => {
|
|
|
25
25
|
uploadFile: (sessionCode: string, file: File, config?: IRequestConfig) => Promise<{
|
|
26
26
|
download_url?: string;
|
|
27
27
|
}>;
|
|
28
|
-
isResumeSession: (sessionCode: string, config?: IRequestConfig) => Promise<boolean>;
|
|
29
28
|
};
|
|
@@ -113,8 +113,6 @@ import { transferSession2SessionApi, transferSessionApi2Session, transferSession
|
|
|
113
113
|
}
|
|
114
114
|
})));
|
|
115
115
|
};
|
|
116
|
-
// 轮询接口,判断是否可以继续聊天
|
|
117
|
-
const isResumeSession = (sessionCode, config)=>fetchClient.get(`session/${sessionCode}/is_resume/`, undefined, config);
|
|
118
116
|
return {
|
|
119
117
|
clearSession,
|
|
120
118
|
getSessions,
|
|
@@ -126,7 +124,6 @@ import { transferSession2SessionApi, transferSessionApi2Session, transferSession
|
|
|
126
124
|
postSessionFeedback,
|
|
127
125
|
getSessionFeedbackReasons,
|
|
128
126
|
renameSession,
|
|
129
|
-
uploadFile
|
|
130
|
-
isResumeSession
|
|
127
|
+
uploadFile
|
|
131
128
|
};
|
|
132
129
|
};
|
|
@@ -337,11 +337,6 @@ import { ActivityType, MessageRole, MessageType } from '../../message/type.ts.js
|
|
|
337
337
|
});
|
|
338
338
|
return result;
|
|
339
339
|
}
|
|
340
|
-
case MessageRole.Interrupt:
|
|
341
|
-
{
|
|
342
|
-
const result = _object_spread({}, baseMessage, data);
|
|
343
|
-
return result;
|
|
344
|
-
}
|
|
345
340
|
}
|
|
346
341
|
};
|
|
347
342
|
/**
|
|
@@ -606,10 +601,5 @@ import { ActivityType, MessageRole, MessageType } from '../../message/type.ts.js
|
|
|
606
601
|
});
|
|
607
602
|
return result;
|
|
608
603
|
}
|
|
609
|
-
case MessageRole.Interrupt:
|
|
610
|
-
{
|
|
611
|
-
const result = _object_spread({}, baseMessage, data);
|
|
612
|
-
return result;
|
|
613
|
-
}
|
|
614
604
|
}
|
|
615
605
|
};
|