paul-ai-assistant 1.0.3 → 1.0.4
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/es/AssistantChat/AssistantChatApp/const.js +1 -1
- package/es/AssistantChat/AssistantChatApp/index.js +1 -1
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TraceComponent.js +4 -4
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/index.js +4 -5
- package/es/AssistantChat/AssistantChatCard/LlmGenerateCard/index.js +2 -2
- package/es/AssistantChat/AssistantChatCard/LlmGenerateCardV5/index.js +1 -1
- package/es/AssistantChat/AssistantChatCard/OperationCard/Copy/index.js +1 -1
- package/es/AssistantChat/AssistantChatCard/OperationCard/CopyRequestId/index.js +1 -1
- package/es/AssistantChat/AssistantChatCard/OperationCard/FeedBack/index.js +1 -1
- package/es/AssistantChat/AssistantChatCard/OperationCard/ShareButton/index.js +1 -1
- package/es/AssistantChat/AssistantChatCard/OperationCard/index.js +1 -1
- package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/AttachmentsRender.js +3 -3
- package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/ImageRender.js +5 -5
- package/es/AssistantChat/AssistantChatInput/index.js +7 -5
- package/es/common/registerAssistChatForm.js +8 -5
- package/es/components/AgentCardSubmit/index.js +0 -1
- package/es/components/AgentResult/index.js +1 -1
- package/es/components/AgentSchemaForm/ScreenshotView.js +1 -1
- package/es/components/AgentSchemaForm/index.js +5 -5
- package/es/components/ArrayInput/index.js +1 -1
- package/es/components/InspectionCard/index.js +1 -1
- package/es/components/LlmMarkDown/MdAmarkGuess/index.js +1 -1
- package/es/components/LlmMarkDown/MdAmarkReference/index.js +3 -3
- package/es/components/LlmMarkDown/index.js +1 -1
- package/es/components/LlmModelChange/index.js +2 -2
- package/es/components/LlmReference/index.js +9 -9
- package/es/components/LlmTraceComponents/Disassemble/index.js +2 -2
- package/es/components/LlmTraceComponents/Rewrite/index.js +2 -2
- package/es/components/MarkDown/index.js +42 -13
- package/es/components/ModelSelect/ModeDropdown.js +1 -1
- package/es/components/ModelSelect/const.js +3 -3
- package/es/components/PaulButtonGroup/Select.js +1 -1
- package/es/components/PaulButtonGroup/index.js +1 -1
- package/es/components/PopAuth/index.js +1 -1
- package/es/components/SchemaInput/SchemaInputCore/index.js +1 -1
- package/es/components/SchemaInput/SimpleJSONEditor/index.js +1 -1
- package/es/components/SelectBlurry/index.js +1 -1
- package/es/components/ShareModal/index.js +1 -1
- package/es/components/ShareOperationBar/index.js +1 -1
- package/es/components/TextContent/index.js +3 -3
- package/es/components/TraceWithAgent/index.js +4 -9
- package/es/context/index.js +2 -1
- package/es/context/utils/messages.js +1 -1
- package/es/context/utils/send.js +2 -2
- package/es/context/utils/tool.js +1 -1
- package/es/utils/CSEIconTool.js +1 -1
- package/es/utils/apushAssistant.js +1 -2
- package/es/utils/common.js +17 -0
- package/es/utils/event.js +87 -0
- package/es/utils/formDataFormat.js +1 -1
- package/es/utils/formatData.js +1 -1
- package/es/utils/helpers.js +78 -0
- package/es/utils/log.js +1 -1
- package/package.json +6 -16
- package/es/AssistantChat/AssistantChatApp/CardMatchRender/index.d.ts +0 -8
- package/es/AssistantChat/AssistantChatApp/OperationMatchRender/index.d.ts +0 -9
- package/es/AssistantChat/AssistantChatApp/const.d.ts +0 -51
- package/es/AssistantChat/AssistantChatApp/index.d.ts +0 -4
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/TemplateCard.d.ts +0 -3
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/common/types.d.ts +0 -3
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateHeader.d.ts +0 -5
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateHtml.d.ts +0 -7
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateParagraph.d.ts +0 -3
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TemplateTitle.d.ts +0 -3
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/component/TraceComponent.d.ts +0 -3
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/context/index.d.ts +0 -29
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/index.d.ts +0 -4
- package/es/AssistantChat/AssistantChatCard/AgentCardRender/utils.d.ts +0 -2
- package/es/AssistantChat/AssistantChatCard/AgentCommonCard/index.d.ts +0 -4
- package/es/AssistantChat/AssistantChatCard/AgentExecutionCard/index.d.ts +0 -16
- package/es/AssistantChat/AssistantChatCard/LlmGenerateCard/index.d.ts +0 -14
- package/es/AssistantChat/AssistantChatCard/LlmGenerateCardV5/index.d.ts +0 -78
- package/es/AssistantChat/AssistantChatCard/OperationCard/AigcTipsRender/index.d.ts +0 -7
- package/es/AssistantChat/AssistantChatCard/OperationCard/Copy/index.d.ts +0 -7
- package/es/AssistantChat/AssistantChatCard/OperationCard/CopyRequestId/index.d.ts +0 -3
- package/es/AssistantChat/AssistantChatCard/OperationCard/FeedBack/index.d.ts +0 -11
- package/es/AssistantChat/AssistantChatCard/OperationCard/ShareButton/index.d.ts +0 -3
- package/es/AssistantChat/AssistantChatCard/OperationCard/index.d.ts +0 -4
- package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/AttachmentsRender.d.ts +0 -21
- package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/ImageRender.d.ts +0 -7
- package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/index.d.ts +0 -8
- package/es/AssistantChat/AssistantChatCard/index.d.ts +0 -5
- package/es/AssistantChat/AssistantChatInput/index.d.ts +0 -5
- package/es/AssistantChat/AssistantToolApp/const.d.ts +0 -12
- package/es/AssistantChat/AssistantToolApp/index.d.ts +0 -4
- package/es/AssistantChat/AssistantToolExecutionApp/const.d.ts +0 -7
- package/es/AssistantChat/AssistantToolExecutionApp/index.d.ts +0 -4
- package/es/AssistantChat/AssistentError/index.d.ts +0 -5
- package/es/AssistantChat/index.d.ts +0 -6
- package/es/AssistantChat/logCallback/aTagLog.d.ts +0 -1
- package/es/AssistantChat/logCallback/copyLog.d.ts +0 -3
- package/es/ErrorBoundary/ErrorBoundaryFallback/index.d.ts +0 -5
- package/es/ErrorBoundary/index.d.ts +0 -22
- package/es/common/registerAssistChatForm.d.ts +0 -2
- package/es/components/AgentCardSubmit/index.d.ts +0 -20
- package/es/components/AgentResult/index.d.ts +0 -8
- package/es/components/AgentSchemaForm/ScreenshotView.d.ts +0 -12
- package/es/components/AgentSchemaForm/_interface.d.ts +0 -37
- package/es/components/AgentSchemaForm/index.d.ts +0 -9
- package/es/components/AgentText/index.d.ts +0 -4
- package/es/components/AigcTips/index.d.ts +0 -9
- package/es/components/ArrayInput/index.d.ts +0 -3
- package/es/components/AssistantDrawer/index.d.ts +0 -22
- package/es/components/EmptyIcon/index.d.ts +0 -3
- package/es/components/HeaderSvgIcon/index.d.ts +0 -3
- package/es/components/InspectionCard/index.d.ts +0 -66
- package/es/components/InspectionCard/result.d.ts +0 -13
- package/es/components/LlmMarkDown/MdAmarkGuess/index.d.ts +0 -16
- package/es/components/LlmMarkDown/MdAmarkReference/index.d.ts +0 -21
- package/es/components/LlmMarkDown/index.d.ts +0 -30
- package/es/components/LlmModelChange/index.d.ts +0 -57
- package/es/components/LlmReference/index.d.ts +0 -25
- package/es/components/LlmTitle/index.d.ts +0 -14
- package/es/components/LlmTrace/index.d.ts +0 -17
- package/es/components/LlmTraceComponents/Disassemble/index.d.ts +0 -24
- package/es/components/LlmTraceComponents/ReadResource/index.d.ts +0 -24
- package/es/components/LlmTraceComponents/Rewrite/index.d.ts +0 -23
- package/es/components/LlmTraceComponents/TraceMarkDown/index.d.ts +0 -22
- package/es/components/LlmTraceComponents/const.d.ts +0 -25
- package/es/components/LlmTraceV2/index.d.ts +0 -56
- package/es/components/LlmTraceV3/components/TraceContentComponents/BusinessFlow/index.d.ts +0 -13
- package/es/components/LlmTraceV3/components/TraceContentComponents/CodeBlock/index.d.ts +0 -18
- package/es/components/LlmTraceV3/components/TraceContentComponents/DeepThinking/index.d.ts +0 -13
- package/es/components/LlmTraceV3/components/TraceContentComponents/InfoMissing/index.d.ts +0 -13
- package/es/components/LlmTraceV3/components/TraceContentComponents/LinkList/index.d.ts +0 -20
- package/es/components/LlmTraceV3/components/TraceContentComponents/SearchResults/index.d.ts +0 -13
- package/es/components/LlmTraceV3/components/TraceContentComponents/TaskPlanning/index.d.ts +0 -12
- package/es/components/LlmTraceV3/components/TraceContentComponents/ToolCall/index.d.ts +0 -13
- package/es/components/LlmTraceV3/components/TraceContentComponents/ToolResult/index.d.ts +0 -13
- package/es/components/LlmTraceV3/components/TraceContentComponents/const.d.ts +0 -32
- package/es/components/LlmTraceV3/components/TraceGroup/index.d.ts +0 -8
- package/es/components/LlmTraceV3/components/TraceHeader/index.d.ts +0 -8
- package/es/components/LlmTraceV3/components/TraceItem/index.d.ts +0 -8
- package/es/components/LlmTraceV3/components/TraceSlide/index.d.ts +0 -30
- package/es/components/LlmTraceV3/components/TraceStatusIcon/index.d.ts +0 -8
- package/es/components/LlmTraceV3/hooks/useGroupCollapse.d.ts +0 -18
- package/es/components/LlmTraceV3/hooks/useItemCollapse.d.ts +0 -18
- package/es/components/LlmTraceV3/hooks/useTraceAnimation.d.ts +0 -15
- package/es/components/LlmTraceV3/hooks/useTraceCollapse.d.ts +0 -17
- package/es/components/LlmTraceV3/index.d.ts +0 -11
- package/es/components/LlmTraceV3/types.d.ts +0 -263
- package/es/components/LlmTraceV3/utils/collapseLogic.d.ts +0 -26
- package/es/components/LlmTraceV3/utils/traceHelpers.d.ts +0 -42
- package/es/components/MarkDown/index.d.ts +0 -11
- package/es/components/ModelSelect/ModeDropdown.d.ts +0 -8
- package/es/components/ModelSelect/const.d.ts +0 -30
- package/es/components/ModelSelect/index.d.ts +0 -4
- package/es/components/PaulButtonGroup/Select.d.ts +0 -3
- package/es/components/PaulButtonGroup/index.d.ts +0 -16
- package/es/components/PopAuth/index.d.ts +0 -4
- package/es/components/ReferenceInfoItem/index.d.ts +0 -49
- package/es/components/ReferenceTag/index.d.ts +0 -11
- package/es/components/SchemaInput/SchemaInputCore/index.d.ts +0 -4
- package/es/components/SchemaInput/SchemaInputCore/utils.d.ts +0 -1
- package/es/components/SchemaInput/SimpleJSONEditor/index.d.ts +0 -4
- package/es/components/SchemaInput/index.d.ts +0 -8
- package/es/components/SelectBlurry/index.d.ts +0 -3
- package/es/components/SendMessageSvgIcon/index.d.ts +0 -3
- package/es/components/ShareContent/index.d.ts +0 -21
- package/es/components/ShareModal/index.d.ts +0 -15
- package/es/components/ShareOperationBar/index.d.ts +0 -4
- package/es/components/TextContent/index.d.ts +0 -14
- package/es/components/TraceMarkdownWithCard/index.d.ts +0 -6
- package/es/components/TraceWithAgent/index.d.ts +0 -23
- package/es/constants/assistChatEvent.d.ts +0 -33
- package/es/constants/common.d.ts +0 -71
- package/es/constants/logTrace.d.ts +0 -3
- package/es/constants/reference.d.ts +0 -109
- package/es/constants/traceDataStatus.d.ts +0 -34
- package/es/context/index.d.ts +0 -13
- package/es/context/utils/messages.d.ts +0 -33
- package/es/context/utils/send.d.ts +0 -29
- package/es/context/utils/tool.d.ts +0 -19
- package/es/index.d.ts +0 -37
- package/es/interface/IAgent.d.ts +0 -12
- package/es/interface/IChatBottom.d.ts +0 -69
- package/es/interface/IChatCard.d.ts +0 -40
- package/es/interface/IChatContext.d.ts +0 -59
- package/es/interface/IChatRef.d.ts +0 -75
- package/es/interface/IGuessQuestion.d.ts +0 -43
- package/es/interface/IMessage.d.ts +0 -17
- package/es/interface/ISend.d.ts +0 -19
- package/es/interface/index.d.ts +0 -272
- package/es/utils/CSEIconTool.d.ts +0 -8
- package/es/utils/apushAssistant.d.ts +0 -73
- package/es/utils/clientPlugin.d.ts +0 -3
- package/es/utils/common.d.ts +0 -10
- package/es/utils/copyToClipboard.d.ts +0 -2
- package/es/utils/formDataFormat.d.ts +0 -3
- package/es/utils/formatData.d.ts +0 -14
- package/es/utils/log.d.ts +0 -18
- package/es/utils/parseUrl.d.ts +0 -9
- package/es/utils/request.d.ts +0 -15
- package/es/utils/screenshot.d.ts +0 -45
- package/es/utils/send.d.ts +0 -10
- package/es/utils/uploadImage.d.ts +0 -9
- package/es/utils/websocketLogger.d.ts +0 -176
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["query", "dataApi", "fieldNames", "method"];
|
|
6
6
|
import React, { useEffect, useState } from 'react';
|
|
7
|
-
import { message, Select } from '
|
|
7
|
+
import { message, Select } from 'antd';
|
|
8
8
|
import { customRequest } from "../../utils/request";
|
|
9
9
|
import { debounce } from 'lodash';
|
|
10
10
|
var SelectBlurry = function SelectBlurry(props) {
|
|
@@ -2,7 +2,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import React, { useContext, useState } from 'react';
|
|
5
|
-
import { Button, Input, message, Modal, Select } from '
|
|
5
|
+
import { Button, Input, message, Modal, Select } from 'antd';
|
|
6
6
|
import { customRequest } from "../../utils/request";
|
|
7
7
|
import { AssistantChatContext } from "../../context";
|
|
8
8
|
import { CSECustomIcon } from "../../utils/CSEIconTool";
|
|
@@ -2,7 +2,7 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import React, { useContext, useState } from 'react';
|
|
5
|
-
import { Button, message } from '
|
|
5
|
+
import { Button, message } from 'antd';
|
|
6
6
|
import { customRequest } from "../../utils/request";
|
|
7
7
|
import { AssistantChatContext } from "../../context";
|
|
8
8
|
import { CSECustomIcon } from "../../utils/CSEIconTool";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import { Button } from '
|
|
4
|
-
import {
|
|
3
|
+
import { Button } from 'antd';
|
|
4
|
+
import { DownOutlined, UpOutlined } from '@ant-design/icons';
|
|
5
5
|
import { formatTextContentHtml } from "../../utils/formatData";
|
|
6
6
|
import "./index.scss";
|
|
7
7
|
/**
|
|
@@ -32,6 +32,6 @@ var TextContent = function TextContent(props) {
|
|
|
32
32
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
33
33
|
type: "link",
|
|
34
34
|
onClick: toggleCollapse
|
|
35
|
-
}, collapse ? '查看更多' : '收起', collapse ? /*#__PURE__*/React.createElement(
|
|
35
|
+
}, collapse ? '查看更多' : '收起', collapse ? /*#__PURE__*/React.createElement(DownOutlined, null) : /*#__PURE__*/React.createElement(UpOutlined, null))));
|
|
36
36
|
};
|
|
37
37
|
export default TextContent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { TeamOutlined } from '@ant-design/icons';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import InspectionCard from "../InspectionCard";
|
|
7
7
|
import MarkDown from "../MarkDown";
|
|
@@ -69,15 +69,10 @@ var TraceWithAgent = function TraceWithAgent(props) {
|
|
|
69
69
|
className: "agent-content-item"
|
|
70
70
|
}, /*#__PURE__*/React.createElement("div", {
|
|
71
71
|
className: "agent-icon-tips"
|
|
72
|
-
},
|
|
73
|
-
size: "small",
|
|
72
|
+
}, /*#__PURE__*/React.createElement(TeamOutlined, {
|
|
74
73
|
style: {
|
|
75
|
-
marginRight: 3
|
|
76
|
-
|
|
77
|
-
}) : /*#__PURE__*/React.createElement(TeamF, {
|
|
78
|
-
size: "small",
|
|
79
|
-
style: {
|
|
80
|
-
marginRight: 3
|
|
74
|
+
marginRight: 3,
|
|
75
|
+
fontSize: 12
|
|
81
76
|
}
|
|
82
77
|
}), subItem.type === 'tool' ? '工具调用' : '业务流调用'), /*#__PURE__*/React.createElement("div", {
|
|
83
78
|
className: "agent-content-item-name"
|
package/es/context/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
7
7
|
var _excluded = ["children", "bizId", "bizDomain", "locateAfterSingleMessageUpdate", "dataSource", "interruptLlmMessageScroll", "toolConfig", "placeholder", "messageCardWidth", "enableWsConnectCallback", "onSend", "assistantChat", "log", "logTrace", "messagesMaxLength", "mode", "activeToken", "onStopMessage", "imConnectCallback", "chatTitle", "isAssistant", "isThirdEmbed", "getApiHost"],
|
|
8
8
|
_excluded2 = ["chatType", "onSuccessCallback"];
|
|
9
9
|
import React, { createContext, useEffect, useRef, useState } from 'react';
|
|
10
|
-
import { event
|
|
10
|
+
import { event } from "../utils/event";
|
|
11
|
+
import { getWorkId } from "../utils/helpers";
|
|
11
12
|
import { FEATURE_MODE_TYPE_KEY } from "../components/ModelSelect/const";
|
|
12
13
|
import { ASSIST_CHAT_EVENT } from "../constants/assistChatEvent";
|
|
13
14
|
import { CHAT_TYPE, ChatTypeEnum, COPILOT_TOOL_TYPE_ENUM, initPlaceholder } from "../constants/common";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import { event } from
|
|
3
|
+
import { event } from "../../utils/event";
|
|
4
4
|
import { customRequest } from "../../utils/request";
|
|
5
5
|
import { ASSIST_CHAT_EVENT } from "../../constants/assistChatEvent";
|
|
6
6
|
import { REQUEST_SUCCESS_CODE } from "../../constants/common";
|
package/es/context/utils/send.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import { message } from '
|
|
3
|
+
import { message } from 'antd';
|
|
4
4
|
import { customRequest } from "../../utils/request";
|
|
5
|
-
import { getWorkId } from
|
|
5
|
+
import { getWorkId } from "../../utils/helpers";
|
|
6
6
|
import { AGENT_TPYE, CHAT_TYPE, REQUEST_SUCCESS_CODE, SEARCH_TYPE } from "../../constants/common";
|
|
7
7
|
import { LOG_TRACE_TYPE_ENUMS } from "../../constants/logTrace";
|
|
8
8
|
export var sendMessageRequest = function sendMessageRequest(_ref) {
|
package/es/context/utils/tool.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import { message } from '
|
|
3
|
+
import { message } from 'antd';
|
|
4
4
|
import { customRequest } from "../../utils/request";
|
|
5
5
|
import { REQUEST_SUCCESS_CODE } from "../../constants/common";
|
|
6
6
|
|
package/es/utils/CSEIconTool.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _window;
|
|
2
|
-
import { createFromIconfontCN } from '@
|
|
2
|
+
import { createFromIconfontCN } from '@ant-design/icons';
|
|
3
3
|
var CSECustomIcon = createFromIconfontCN({
|
|
4
4
|
scriptUrl: ((_window = window) === null || _window === void 0 ? void 0 : _window.uniqueIconfontSymbolUrl) || '//at.alicdn.com/t/a/font_2186508_s77dlziunf.js'
|
|
5
5
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { event } from
|
|
3
|
-
import IM from '@alife/magic-chat-im';
|
|
2
|
+
import { event } from "./event";
|
|
4
3
|
import { customRequest } from "./request";
|
|
5
4
|
import { JsonParse } from "./formatData";
|
|
6
5
|
import { AesCustomLogEventEnum } from "./log";
|
package/es/utils/common.js
CHANGED
|
@@ -6,6 +6,23 @@ export var getSelectedText = function getSelectedText() {
|
|
|
6
6
|
return (_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.toString();
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* 预览图片
|
|
11
|
+
* @param url 图片URL
|
|
12
|
+
*/
|
|
13
|
+
export var previewImg = function previewImg(url) {
|
|
14
|
+
if (!url) return;
|
|
15
|
+
var img = new Image();
|
|
16
|
+
img.src = url;
|
|
17
|
+
var newWindow = window.open('');
|
|
18
|
+
if (newWindow) {
|
|
19
|
+
newWindow.document.body.appendChild(img);
|
|
20
|
+
newWindow.document.title = '图片预览';
|
|
21
|
+
newWindow.document.body.style.cssText = 'margin: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f0f0f0;';
|
|
22
|
+
img.style.cssText = 'max-width: 100%; max-height: 100vh; object-fit: contain;';
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
9
26
|
// 滚动到指定消息
|
|
10
27
|
export var locateToDialogId = function locateToDialogId(dialogId) {
|
|
11
28
|
var element = document.getElementById(dialogId);
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
/**
|
|
5
|
+
* @description 事件发布订阅工具,替代 @alife/goc-utils 的 event
|
|
6
|
+
*/
|
|
7
|
+
var EventEmitter = /*#__PURE__*/function () {
|
|
8
|
+
function EventEmitter() {
|
|
9
|
+
_classCallCheck(this, EventEmitter);
|
|
10
|
+
_defineProperty(this, "events", new Map());
|
|
11
|
+
}
|
|
12
|
+
_createClass(EventEmitter, [{
|
|
13
|
+
key: "on",
|
|
14
|
+
value:
|
|
15
|
+
/**
|
|
16
|
+
* 订阅事件
|
|
17
|
+
*/
|
|
18
|
+
function on(eventName, callback) {
|
|
19
|
+
if (!this.events.has(eventName)) {
|
|
20
|
+
this.events.set(eventName, new Set());
|
|
21
|
+
}
|
|
22
|
+
this.events.get(eventName).add(callback);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 取消订阅
|
|
27
|
+
*/
|
|
28
|
+
}, {
|
|
29
|
+
key: "off",
|
|
30
|
+
value: function off(eventName, callback) {
|
|
31
|
+
var callbacks = this.events.get(eventName);
|
|
32
|
+
if (callbacks) {
|
|
33
|
+
callbacks.delete(callback);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 发布事件
|
|
39
|
+
*/
|
|
40
|
+
}, {
|
|
41
|
+
key: "emit",
|
|
42
|
+
value: function emit(eventName) {
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
44
|
+
args[_key - 1] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
var callbacks = this.events.get(eventName);
|
|
47
|
+
if (callbacks) {
|
|
48
|
+
callbacks.forEach(function (callback) {
|
|
49
|
+
try {
|
|
50
|
+
callback.apply(void 0, args);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error("Event callback error for \"".concat(eventName, "\":"), error);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 一次性订阅
|
|
60
|
+
*/
|
|
61
|
+
}, {
|
|
62
|
+
key: "once",
|
|
63
|
+
value: function once(eventName, callback) {
|
|
64
|
+
var _this = this;
|
|
65
|
+
var onceCallback = function onceCallback() {
|
|
66
|
+
callback.apply(void 0, arguments);
|
|
67
|
+
_this.off(eventName, onceCallback);
|
|
68
|
+
};
|
|
69
|
+
this.on(eventName, onceCallback);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* 移除某个事件的所有监听器
|
|
74
|
+
*/
|
|
75
|
+
}, {
|
|
76
|
+
key: "removeAllListeners",
|
|
77
|
+
value: function removeAllListeners(eventName) {
|
|
78
|
+
if (eventName) {
|
|
79
|
+
this.events.delete(eventName);
|
|
80
|
+
} else {
|
|
81
|
+
this.events.clear();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}]);
|
|
85
|
+
return EventEmitter;
|
|
86
|
+
}(); // 导出单例
|
|
87
|
+
export var event = new EventEmitter();
|
package/es/utils/formatData.js
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 工具函数集合,替代 @alife/goc-utils
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 生成唯一ID
|
|
7
|
+
* 替代 getWorkId
|
|
8
|
+
*/
|
|
9
|
+
export var getWorkId = function getWorkId() {
|
|
10
|
+
return "".concat(Date.now(), "-").concat(Math.random().toString(36).substring(2, 11));
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 预览图片
|
|
15
|
+
* 替代 previewImg
|
|
16
|
+
*/
|
|
17
|
+
export var previewImg = function previewImg(url) {
|
|
18
|
+
if (!url) return;
|
|
19
|
+
|
|
20
|
+
// 创建预览容器
|
|
21
|
+
var overlay = document.createElement('div');
|
|
22
|
+
overlay.style.cssText = "\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n cursor: zoom-out;\n ";
|
|
23
|
+
var img = document.createElement('img');
|
|
24
|
+
img.src = url;
|
|
25
|
+
img.style.cssText = "\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n ";
|
|
26
|
+
overlay.appendChild(img);
|
|
27
|
+
document.body.appendChild(overlay);
|
|
28
|
+
|
|
29
|
+
// 点击关闭
|
|
30
|
+
overlay.addEventListener('click', function () {
|
|
31
|
+
document.body.removeChild(overlay);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// ESC 关闭
|
|
35
|
+
var handleKeydown = function handleKeydown(e) {
|
|
36
|
+
if (e.key === 'Escape') {
|
|
37
|
+
document.body.removeChild(overlay);
|
|
38
|
+
document.removeEventListener('keydown', handleKeydown);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
document.addEventListener('keydown', handleKeydown);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 将 URL 转换为链接
|
|
46
|
+
* 替代 urlToLink
|
|
47
|
+
*/
|
|
48
|
+
export var urlToLink = function urlToLink(text) {
|
|
49
|
+
if (!text) return '';
|
|
50
|
+
var urlRegex = /(https?:\/\/[^\s<>"{}|\\^`[\]]+)/g;
|
|
51
|
+
return text.replace(urlRegex, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>');
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 检查是否为函数
|
|
56
|
+
* 替代 isFunc
|
|
57
|
+
*/
|
|
58
|
+
export var isFunc = function isFunc(fn) {
|
|
59
|
+
return typeof fn === 'function';
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 获取环境变量
|
|
64
|
+
* 替代 getEnv
|
|
65
|
+
*/
|
|
66
|
+
export var getEnv = function getEnv() {
|
|
67
|
+
var host = window.location.host;
|
|
68
|
+
if (host.includes('localhost') || host.includes('127.0.0.1')) {
|
|
69
|
+
return 'local';
|
|
70
|
+
}
|
|
71
|
+
if (host.includes('pre-') || host.includes('pre.')) {
|
|
72
|
+
return 'pre';
|
|
73
|
+
}
|
|
74
|
+
if (host.includes('daily') || host.includes('dev')) {
|
|
75
|
+
return 'daily';
|
|
76
|
+
}
|
|
77
|
+
return 'prod';
|
|
78
|
+
};
|
package/es/utils/log.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import { isFunc } from
|
|
2
|
+
import { isFunc } from "./helpers";
|
|
3
3
|
export var AesCustomLogEventEnum = /*#__PURE__*/function (AesCustomLogEventEnum) {
|
|
4
4
|
AesCustomLogEventEnum["APUSH_MSG"] = "apush-msg";
|
|
5
5
|
AesCustomLogEventEnum["APUSH_CONNECT"] = "apush-connect";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paul-ai-assistant",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Paul AI 智能辅助组件",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Magic Workbench",
|
|
@@ -89,28 +89,20 @@
|
|
|
89
89
|
"stylelint": "^15.6.0"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@
|
|
93
|
-
"@alife/goc-request": "^2.0.0",
|
|
94
|
-
"@alife/goc-utils": "^1.36.0",
|
|
95
|
-
"@alife/magic-basic": "^4.1.11",
|
|
96
|
-
"@alife/magic-chat-im": "^2.5.3",
|
|
97
|
-
"@alife/magic-chat-ui": "^3.18.3",
|
|
98
|
-
"@alife/magic-f2a": "^0.0.2",
|
|
99
|
-
"@alife/magic-fields": "^2.2.56",
|
|
100
|
-
"@alife/magic-icons": "^2.3.9",
|
|
101
|
-
"@alife/magic-pro": "^2.5.7",
|
|
102
|
-
"@alife/theme-135688": "^0.3.9",
|
|
92
|
+
"@ant-design/icons": "^4.8.0",
|
|
103
93
|
"@babel/runtime": "^7.24.0",
|
|
104
94
|
"@formily/antd": "1.3.17",
|
|
105
95
|
"ahooks": "^3.8.4",
|
|
96
|
+
"antd": "^4.24.0",
|
|
106
97
|
"classnames": "^2.2.6",
|
|
107
98
|
"katex": "^0.16.25",
|
|
108
99
|
"lodash": "^4.17.21",
|
|
109
100
|
"mermaid": "^11.12.1",
|
|
110
101
|
"moment": "^2.24.0",
|
|
111
102
|
"parse-entities": "^4.0.2",
|
|
112
|
-
"react": "
|
|
113
|
-
"react-dom": "
|
|
103
|
+
"react": ">=16.9.0",
|
|
104
|
+
"react-dom": ">=16.9.0",
|
|
105
|
+
"react-markdown": "^8.0.7",
|
|
114
106
|
"rehype-highlight": "6",
|
|
115
107
|
"rehype-katex": "6",
|
|
116
108
|
"rehype-raw": "6",
|
|
@@ -119,8 +111,6 @@
|
|
|
119
111
|
"stringify-entities": "^4.0.4"
|
|
120
112
|
},
|
|
121
113
|
"devDependencies": {
|
|
122
|
-
"@ali/eslint-config-att": "^1.0.6",
|
|
123
|
-
"@alife/magic-lint": "^3.1.8",
|
|
124
114
|
"@babel/preset-env": "^7.24.0",
|
|
125
115
|
"@babel/preset-react": "^7.23.3",
|
|
126
116
|
"@babel/preset-typescript": "^7.23.3",
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export declare const enum ROLE_TYPE {
|
|
4
|
-
SYSTEM = 1,// 系统消息
|
|
5
|
-
WORKER = 2,// 小二消息
|
|
6
|
-
LLM = 3,// 大模型消息
|
|
7
|
-
CUSTOMER = 4
|
|
8
|
-
}
|
|
9
|
-
export declare const enum MESSAGE_TYPE {
|
|
10
|
-
CARD = 1,// 卡片CARD 通过schema描述渲染对应表单文本内容,将读取schema字段的内容
|
|
11
|
-
TEXT = 2,// 普通文本TEXT 纯文本描述,将读取content内容
|
|
12
|
-
RICHTEXT = 3,// 富文本RICHTEXT 纯富文本内容渲染(目前这种类型基本没用,富文本现在用schema描述处理掉了)
|
|
13
|
-
AUTH = 4,// AUTH 同卡片CARD内容渲染
|
|
14
|
-
MARKDOWN = 5,// MARKDOWN
|
|
15
|
-
SECRET = 21,// 加密信息SECRET 文本内容默认隐藏,将读取content内容
|
|
16
|
-
MICRO_APP = 99,// 微应用工具
|
|
17
|
-
ANSWER_CARD = 100,// 答案卡片
|
|
18
|
-
INTERACTIVE_CARD = 101
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 判断右边消息
|
|
22
|
-
* @param role
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export declare const isRightMessage: (role: number) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* 判断是否为紫色卡片
|
|
28
|
-
* @param role
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export declare const isPurpleMessageCard: (role: number) => boolean;
|
|
32
|
-
/**
|
|
33
|
-
* 判断是否为宽度100%卡片
|
|
34
|
-
* @param role
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
export declare const isWidth100MessageCard: (role: number) => boolean;
|
|
38
|
-
export declare const TagShow: (tagTypeProps: any) => React.JSX.Element;
|
|
39
|
-
/**
|
|
40
|
-
* 展示卡片标签
|
|
41
|
-
* @param message
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
export declare const showCardTag: (message: any, noColor?: boolean) => React.JSX.Element;
|
|
45
|
-
/**
|
|
46
|
-
* 获取元素底部距离的方法。
|
|
47
|
-
*
|
|
48
|
-
* @param el 目标元素。
|
|
49
|
-
* @returns 返回元素底部距离的像素值。
|
|
50
|
-
*/
|
|
51
|
-
export declare function getToBottom(el: HTMLElement): number;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IBaseAgentSchemaFormProps } from '../../../../components/AgentSchemaForm/_interface';
|
|
3
|
-
import type { ICardRenderProps } from '../common/types';
|
|
4
|
-
export interface IBaseAgentCardRenderProps extends IBaseAgentSchemaFormProps {
|
|
5
|
-
summary?: string;
|
|
6
|
-
cardType?: 'FORM' | 'TEMPLATE' | 'ALFA';
|
|
7
|
-
}
|
|
8
|
-
export interface AgentCardRenderProps extends IBaseAgentCardRenderProps {
|
|
9
|
-
classname?: string;
|
|
10
|
-
onSubmitConfig?: {
|
|
11
|
-
url?: string;
|
|
12
|
-
text?: string;
|
|
13
|
-
style?: any;
|
|
14
|
-
onSubmit?: (v: any, enableSubmit?: () => void) => void;
|
|
15
|
-
};
|
|
16
|
-
templateExternalRenderType?: any;
|
|
17
|
-
formComponentMap?: any;
|
|
18
|
-
MemoryMicroComponent?: any;
|
|
19
|
-
enableCard?: boolean;
|
|
20
|
-
config?: {
|
|
21
|
-
schema: any;
|
|
22
|
-
type: 'FORM' | 'TEMPLATE' | 'ALFA';
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export interface AgentCardRenderProviderProps extends AgentCardRenderProps {
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
}
|
|
28
|
-
export declare const AgentCardRenderContext: React.Context<ICardRenderProps>;
|
|
29
|
-
export declare const AgentCardRenderProvider: (props: AgentCardRenderProviderProps) => React.JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const AGENT_EXECUTION_STATUS: {
|
|
2
|
-
SUCCESS: string;
|
|
3
|
-
ERROR: string;
|
|
4
|
-
RUNNING: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const AGENT_EXECUTION_STATUS_TYPE: {
|
|
7
|
-
[x: string]: {
|
|
8
|
-
icon: string;
|
|
9
|
-
color: string;
|
|
10
|
-
className?: undefined;
|
|
11
|
-
} | {
|
|
12
|
-
icon: string;
|
|
13
|
-
color: string;
|
|
14
|
-
className: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export declare const GUESS_URL = "https://an.aliyun-inc.com/guess";
|
|
4
|
-
export interface ILlmProps {
|
|
5
|
-
content?: string;
|
|
6
|
-
references?: any[];
|
|
7
|
-
finished?: boolean;
|
|
8
|
-
ctx?: any;
|
|
9
|
-
showQuestion?: any;
|
|
10
|
-
headerTips?: any;
|
|
11
|
-
onClickReference?: (reference: any, type: 'item' | 'url') => void;
|
|
12
|
-
}
|
|
13
|
-
declare const LlmGenerateCard: (props: ILlmProps) => React.JSX.Element;
|
|
14
|
-
export default LlmGenerateCard;
|