@glodon-aiot/agent-cli-ui 2.4.7
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.git.md +73 -0
- package/README.lib.md +135 -0
- package/dist/es/AgentClientUI.mjs +155 -0
- package/dist/es/Dialog/AgentChat/index.mjs +757 -0
- package/dist/es/Dialog/AgentChat/style.less.mjs +4 -0
- package/dist/es/Dialog/ConnectToNetwork/index.mjs +92 -0
- package/dist/es/Dialog/ConnectToNetwork/style.less.mjs +4 -0
- package/dist/es/Dialog/FileCard/doc-icons/doc.svg.mjs +4 -0
- package/dist/es/Dialog/FileCard/doc-icons/docx.svg.mjs +4 -0
- package/dist/es/Dialog/FileCard/doc-icons/pdf.svg.mjs +4 -0
- package/dist/es/Dialog/FileCard/index.mjs +142 -0
- package/dist/es/Dialog/FileCard/style.less.mjs +4 -0
- package/dist/es/Dialog/FilePreview/index.mjs +90 -0
- package/dist/es/Dialog/FilePreview/style.less.mjs +4 -0
- package/dist/es/Dialog/Greeting/index.mjs +31 -0
- package/dist/es/Dialog/Greeting/style.less.mjs +4 -0
- package/dist/es/Dialog/HistoryContent/index.mjs +14 -0
- package/dist/es/Dialog/HistoryContent/style.less.mjs +4 -0
- package/dist/es/Dialog/HistoryItem/index.mjs +355 -0
- package/dist/es/Dialog/HistoryItem/style.less.mjs +4 -0
- package/dist/es/Dialog/HistoryItem/think.svg.mjs +4 -0
- package/dist/es/Dialog/KnowledgeDoc/index.mjs +46 -0
- package/dist/es/Dialog/KnowledgeDoc/style.less.mjs +4 -0
- package/dist/es/Dialog/KnowledgeList/KnowledgeSelect/index.mjs +68 -0
- package/dist/es/Dialog/KnowledgeList/KnowledgeSelect/style.less.mjs +4 -0
- package/dist/es/Dialog/KnowledgeList/index.mjs +69 -0
- package/dist/es/Dialog/KnowledgeList/style.less.mjs +4 -0
- package/dist/es/Dialog/PromptManager/PromptList/PromptListItem.mjs +89 -0
- package/dist/es/Dialog/PromptManager/PromptList/PublicPromptList.mjs +48 -0
- package/dist/es/Dialog/PromptManager/PromptList/access/empty.svg.mjs +4 -0
- package/dist/es/Dialog/PromptManager/PromptList/style.less.mjs +4 -0
- package/dist/es/Dialog/PromptManager/index.mjs +128 -0
- package/dist/es/Dialog/PromptManager/style.less.mjs +4 -0
- package/dist/es/Dialog/PromptSetting/index.mjs +130 -0
- package/dist/es/Dialog/PromptSetting/style.less.mjs +4 -0
- package/dist/es/Dialog/Recommend/RecommendItem.mjs +96 -0
- package/dist/es/Dialog/Recommend/index.mjs +60 -0
- package/dist/es/Dialog/Recommend/style.less.mjs +4 -0
- package/dist/es/Dialog/Recommend/tip.svg.mjs +4 -0
- package/dist/es/Dialog/ReferCollapse/index.mjs +65 -0
- package/dist/es/Dialog/ReferCollapse/style.less.mjs +4 -0
- package/dist/es/Dialog/SearchReference/index.mjs +64 -0
- package/dist/es/Dialog/SearchReference/style.less.mjs +4 -0
- package/dist/es/Dialog/SessionAction/index.mjs +232 -0
- package/dist/es/Dialog/SessionAction/style.less.mjs +4 -0
- package/dist/es/Dialog/SessionList/index.mjs +197 -0
- package/dist/es/Dialog/SessionList/style.less.mjs +4 -0
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/NameEditPanel.mjs +48 -0
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/SessionItem.mjs +142 -0
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/doc-icons/doc.svg.mjs +4 -0
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/doc-icons/docx.svg.mjs +4 -0
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/doc-icons/pdf.svg.mjs +4 -0
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/index.mjs +120 -0
- package/dist/es/Dialog/SessionListDrawer/HistorySessionList/style.less.mjs +4 -0
- package/dist/es/Dialog/SessionListDrawer/index.mjs +44 -0
- package/dist/es/Dialog/SessionListDrawer/style.less.mjs +4 -0
- package/dist/es/Dialog/SessionRefer/ReferItem/index.mjs +94 -0
- package/dist/es/Dialog/SessionRefer/ReferItem/style.less.mjs +4 -0
- package/dist/es/Dialog/SessionRefer/index.mjs +86 -0
- package/dist/es/Dialog/SessionRefer/style.less.mjs +4 -0
- package/dist/es/Dialog/SessionRelated/index.mjs +43 -0
- package/dist/es/Dialog/SessionRelated/style.less.mjs +4 -0
- package/dist/es/Dialog/UploadKnowledgeFiles/ClearModal/index.mjs +51 -0
- package/dist/es/Dialog/UploadKnowledgeFiles/ClearModal/style.less.mjs +4 -0
- package/dist/es/Dialog/UploadKnowledgeFiles/index.mjs +368 -0
- package/dist/es/Dialog/UploadKnowledgeFiles/style.less.mjs +4 -0
- package/dist/es/Dialog/UploadingPrompt/index.mjs +67 -0
- package/dist/es/Dialog/UploadingPrompt/style.less.mjs +4 -0
- package/dist/es/Dialog/index.mjs +128 -0
- package/dist/es/Dialog/style.less.mjs +4 -0
- package/dist/es/FileCard/doc-icons/doc.svg.mjs +4 -0
- package/dist/es/FileCard/doc-icons/docx.svg.mjs +4 -0
- package/dist/es/FileCard/doc-icons/pdf.svg.mjs +4 -0
- package/dist/es/FileItem/index.mjs +85 -0
- package/dist/es/FileItem/style.less.mjs +4 -0
- package/dist/es/Footer/FooterWarning.mjs +25 -0
- package/dist/es/Footer/index.mjs +18 -0
- package/dist/es/Footer/style.less.mjs +4 -0
- package/dist/es/Iconfont/index.mjs +12 -0
- package/dist/es/InputProgress/index.mjs +39 -0
- package/dist/es/InputProgress/style.less.mjs +4 -0
- package/dist/es/QuillEditor/index.mjs +219 -0
- package/dist/es/QuillEditor/style.less.mjs +4 -0
- package/dist/es/_virtual/_cloneBuffer.mjs +4 -0
- package/dist/es/_virtual/_commonjsHelpers.mjs +8 -0
- package/dist/es/_virtual/_nodeUtil.mjs +4 -0
- package/dist/es/_virtual/index.mjs +4 -0
- package/dist/es/_virtual/index2.mjs +4 -0
- package/dist/es/_virtual/index3.mjs +4 -0
- package/dist/es/_virtual/index4.mjs +4 -0
- package/dist/es/_virtual/isBuffer.mjs +4 -0
- package/dist/es/_virtual/jsx-runtime.mjs +7 -0
- package/dist/es/_virtual/jsx-runtime2.mjs +4 -0
- package/dist/es/_virtual/minio-zj.mjs +4 -0
- package/dist/es/_virtual/react-jsx-runtime.production.min.mjs +4 -0
- package/dist/es/assets/brand.svg.mjs +4 -0
- package/dist/es/assets/icon.svg.mjs +4 -0
- package/dist/es/components/Copy/index.mjs +44 -0
- package/dist/es/components/Copy/style.less.mjs +4 -0
- package/dist/es/components/JsonDisplay/index.mjs +16 -0
- package/dist/es/components/JsonDisplay/style.less.mjs +4 -0
- package/dist/es/components/Markdown/Code/index.mjs +69 -0
- package/dist/es/components/Markdown/Image/index.mjs +26 -0
- package/dist/es/components/Markdown/index.mjs +48 -0
- package/dist/es/components/Markdown/style.less.mjs +4 -0
- package/dist/es/components/WebLink/index.mjs +26 -0
- package/dist/es/constant.mjs +96 -0
- package/dist/es/context.mjs +7 -0
- package/dist/es/favicon.ico +0 -0
- package/dist/es/favicon2.ico +0 -0
- package/dist/es/font/font_4108228_4w5nlhafpte.js +1 -0
- package/dist/es/font/font_4439177_0sppkcnqiqgs.js +1 -0
- package/dist/es/font/gos-font.js +64 -0
- package/dist/es/images/empty.svg +40 -0
- package/dist/es/images/loading.gif +0 -0
- package/dist/es/images/logo.png +0 -0
- package/dist/es/images/map-example.png +0 -0
- package/dist/es/images/sketch.png +0 -0
- package/dist/es/index.html +43 -0
- package/dist/es/index.mjs +325 -0
- package/dist/es/logo192.png +0 -0
- package/dist/es/logo512.png +0 -0
- package/dist/es/manifest.json +25 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/extends.mjs +13 -0
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +26485 -0
- package/dist/es/node_modules/@socket.io/component-emitter/lib/esm/index.mjs +54 -0
- package/dist/es/node_modules/ahooks/es/useKeyPress/index.mjs +221 -0
- package/dist/es/node_modules/ahooks/es/useLatest/index.mjs +8 -0
- package/dist/es/node_modules/ahooks/es/useMemoizedFn/index.mjs +19 -0
- package/dist/es/node_modules/ahooks/es/useUnmount/index.mjs +17 -0
- package/dist/es/node_modules/ahooks/es/utils/createEffectWithTarget.mjs +27 -0
- package/dist/es/node_modules/ahooks/es/utils/depsAreSame.mjs +11 -0
- package/dist/es/node_modules/ahooks/es/utils/depsEqual.mjs +7 -0
- package/dist/es/node_modules/ahooks/es/utils/domTarget.mjs +13 -0
- package/dist/es/node_modules/ahooks/es/utils/index.mjs +12 -0
- package/dist/es/node_modules/ahooks/es/utils/isAppleDevice.mjs +5 -0
- package/dist/es/node_modules/ahooks/es/utils/isBrowser.mjs +5 -0
- package/dist/es/node_modules/ahooks/es/utils/isDev.mjs +5 -0
- package/dist/es/node_modules/ahooks/es/utils/useDeepCompareWithTarget.mjs +11 -0
- package/dist/es/node_modules/ahooks/es/utils/useEffectWithTarget.mjs +7 -0
- package/dist/es/node_modules/antd/es/calendar/locale/zh_CN.mjs +4 -0
- package/dist/es/node_modules/antd/es/date-picker/locale/zh_CN.mjs +23 -0
- package/dist/es/node_modules/antd/es/locale/zh_CN.mjs +132 -0
- package/dist/es/node_modules/antd/es/time-picker/locale/zh_CN.mjs +8 -0
- package/dist/es/node_modules/base64-js/index.mjs +47 -0
- package/dist/es/node_modules/buffer/index.mjs +927 -0
- package/dist/es/node_modules/classnames/index.mjs +42 -0
- package/dist/es/node_modules/copy-to-clipboard/index.mjs +46 -0
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/has-cors.mjs +9 -0
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseqs.mjs +18 -0
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/parseuri.mjs +24 -0
- package/dist/es/node_modules/engine.io-client/build/esm/contrib/yeast.mjs +19 -0
- package/dist/es/node_modules/engine.io-client/build/esm/globalThis.browser.mjs +4 -0
- package/dist/es/node_modules/engine.io-client/build/esm/socket.mjs +317 -0
- package/dist/es/node_modules/engine.io-client/build/esm/transport.mjs +113 -0
- package/dist/es/node_modules/engine.io-client/build/esm/transports/index.mjs +11 -0
- package/dist/es/node_modules/engine.io-client/build/esm/transports/polling.mjs +273 -0
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.mjs +8 -0
- package/dist/es/node_modules/engine.io-client/build/esm/transports/websocket.mjs +87 -0
- package/dist/es/node_modules/engine.io-client/build/esm/transports/webtransport.mjs +52 -0
- package/dist/es/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.mjs +21 -0
- package/dist/es/node_modules/engine.io-client/build/esm/util.mjs +23 -0
- package/dist/es/node_modules/engine.io-parser/build/esm/commons.mjs +21 -0
- package/dist/es/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.mjs +14 -0
- package/dist/es/node_modules/engine.io-parser/build/esm/decodePacket.browser.mjs +39 -0
- package/dist/es/node_modules/engine.io-parser/build/esm/encodePacket.browser.mjs +28 -0
- package/dist/es/node_modules/engine.io-parser/build/esm/index.mjs +105 -0
- package/dist/es/node_modules/ieee754/index.mjs +28 -0
- package/dist/es/node_modules/js-base64/base64.mjs +31 -0
- package/dist/es/node_modules/lodash/_Hash.mjs +22 -0
- package/dist/es/node_modules/lodash/_ListCache.mjs +22 -0
- package/dist/es/node_modules/lodash/_Map.mjs +6 -0
- package/dist/es/node_modules/lodash/_MapCache.mjs +22 -0
- package/dist/es/node_modules/lodash/_Stack.mjs +20 -0
- package/dist/es/node_modules/lodash/_Symbol.mjs +5 -0
- package/dist/es/node_modules/lodash/_Uint8Array.mjs +5 -0
- package/dist/es/node_modules/lodash/_apply.mjs +17 -0
- package/dist/es/node_modules/lodash/_arrayLikeKeys.mjs +21 -0
- package/dist/es/node_modules/lodash/_assignMergeValue.mjs +10 -0
- package/dist/es/node_modules/lodash/_assignValue.mjs +11 -0
- package/dist/es/node_modules/lodash/_assocIndexOf.mjs +12 -0
- package/dist/es/node_modules/lodash/_baseAssignValue.mjs +14 -0
- package/dist/es/node_modules/lodash/_baseCreate.mjs +17 -0
- package/dist/es/node_modules/lodash/_baseFor.mjs +5 -0
- package/dist/es/node_modules/lodash/_baseGetTag.mjs +11 -0
- package/dist/es/node_modules/lodash/_baseIsArguments.mjs +10 -0
- package/dist/es/node_modules/lodash/_baseIsNative.mjs +15 -0
- package/dist/es/node_modules/lodash/_baseIsTypedArray.mjs +13 -0
- package/dist/es/node_modules/lodash/_baseKeysIn.mjs +16 -0
- package/dist/es/node_modules/lodash/_baseMerge.mjs +22 -0
- package/dist/es/node_modules/lodash/_baseMergeDeep.mjs +33 -0
- package/dist/es/node_modules/lodash/_baseRest.mjs +11 -0
- package/dist/es/node_modules/lodash/_baseSetToString.mjs +14 -0
- package/dist/es/node_modules/lodash/_baseTimes.mjs +9 -0
- package/dist/es/node_modules/lodash/_baseTrim.mjs +9 -0
- package/dist/es/node_modules/lodash/_baseUnary.mjs +9 -0
- package/dist/es/node_modules/lodash/_cloneArrayBuffer.mjs +10 -0
- package/dist/es/node_modules/lodash/_cloneBuffer.mjs +17 -0
- package/dist/es/node_modules/lodash/_cloneTypedArray.mjs +10 -0
- package/dist/es/node_modules/lodash/_copyArray.mjs +10 -0
- package/dist/es/node_modules/lodash/_copyObject.mjs +16 -0
- package/dist/es/node_modules/lodash/_coreJsData.mjs +5 -0
- package/dist/es/node_modules/lodash/_createAssigner.mjs +17 -0
- package/dist/es/node_modules/lodash/_createBaseFor.mjs +14 -0
- package/dist/es/node_modules/lodash/_defineProperty.mjs +11 -0
- package/dist/es/node_modules/lodash/_freeGlobal.mjs +5 -0
- package/dist/es/node_modules/lodash/_getMapData.mjs +10 -0
- package/dist/es/node_modules/lodash/_getNative.mjs +11 -0
- package/dist/es/node_modules/lodash/_getPrototype.mjs +5 -0
- package/dist/es/node_modules/lodash/_getRawTag.mjs +16 -0
- package/dist/es/node_modules/lodash/_getValue.mjs +7 -0
- package/dist/es/node_modules/lodash/_hashClear.mjs +9 -0
- package/dist/es/node_modules/lodash/_hashDelete.mjs +8 -0
- package/dist/es/node_modules/lodash/_hashGet.mjs +14 -0
- package/dist/es/node_modules/lodash/_hashHas.mjs +10 -0
- package/dist/es/node_modules/lodash/_hashSet.mjs +10 -0
- package/dist/es/node_modules/lodash/_initCloneObject.mjs +11 -0
- package/dist/es/node_modules/lodash/_isIndex.mjs +9 -0
- package/dist/es/node_modules/lodash/_isIterateeCall.mjs +15 -0
- package/dist/es/node_modules/lodash/_isKeyable.mjs +8 -0
- package/dist/es/node_modules/lodash/_isMasked.mjs +12 -0
- package/dist/es/node_modules/lodash/_isPrototype.mjs +9 -0
- package/dist/es/node_modules/lodash/_listCacheClear.mjs +7 -0
- package/dist/es/node_modules/lodash/_listCacheDelete.mjs +13 -0
- package/dist/es/node_modules/lodash/_listCacheGet.mjs +10 -0
- package/dist/es/node_modules/lodash/_listCacheHas.mjs +9 -0
- package/dist/es/node_modules/lodash/_listCacheSet.mjs +10 -0
- package/dist/es/node_modules/lodash/_mapCacheClear.mjs +15 -0
- package/dist/es/node_modules/lodash/_mapCacheDelete.mjs +10 -0
- package/dist/es/node_modules/lodash/_mapCacheGet.mjs +9 -0
- package/dist/es/node_modules/lodash/_mapCacheHas.mjs +9 -0
- package/dist/es/node_modules/lodash/_mapCacheSet.mjs +10 -0
- package/dist/es/node_modules/lodash/_nativeCreate.mjs +5 -0
- package/dist/es/node_modules/lodash/_nativeKeysIn.mjs +11 -0
- package/dist/es/node_modules/lodash/_nodeUtil.mjs +17 -0
- package/dist/es/node_modules/lodash/_objectToString.mjs +8 -0
- package/dist/es/node_modules/lodash/_overArg.mjs +9 -0
- package/dist/es/node_modules/lodash/_overRest.mjs +16 -0
- package/dist/es/node_modules/lodash/_root.mjs +5 -0
- package/dist/es/node_modules/lodash/_safeGet.mjs +8 -0
- package/dist/es/node_modules/lodash/_setToString.mjs +6 -0
- package/dist/es/node_modules/lodash/_shortOut.mjs +17 -0
- package/dist/es/node_modules/lodash/_stackClear.mjs +9 -0
- package/dist/es/node_modules/lodash/_stackDelete.mjs +8 -0
- package/dist/es/node_modules/lodash/_stackGet.mjs +7 -0
- package/dist/es/node_modules/lodash/_stackHas.mjs +7 -0
- package/dist/es/node_modules/lodash/_stackSet.mjs +18 -0
- package/dist/es/node_modules/lodash/_toSource.mjs +18 -0
- package/dist/es/node_modules/lodash/_trimmedEndIndex.mjs +10 -0
- package/dist/es/node_modules/lodash/constant.mjs +9 -0
- package/dist/es/node_modules/lodash/debounce.mjs +57 -0
- package/dist/es/node_modules/lodash/eq.mjs +7 -0
- package/dist/es/node_modules/lodash/identity.mjs +7 -0
- package/dist/es/node_modules/lodash/isArguments.mjs +10 -0
- package/dist/es/node_modules/lodash/isArray.mjs +4 -0
- package/dist/es/node_modules/lodash/isArrayLike.mjs +10 -0
- package/dist/es/node_modules/lodash/isArrayLikeObject.mjs +10 -0
- package/dist/es/node_modules/lodash/isBuffer.mjs +12 -0
- package/dist/es/node_modules/lodash/isFunction.mjs +13 -0
- package/dist/es/node_modules/lodash/isLength.mjs +8 -0
- package/dist/es/node_modules/lodash/isObject.mjs +8 -0
- package/dist/es/node_modules/lodash/isObjectLike.mjs +7 -0
- package/dist/es/node_modules/lodash/isPlainObject.mjs +17 -0
- package/dist/es/node_modules/lodash/isSymbol.mjs +10 -0
- package/dist/es/node_modules/lodash/isTypedArray.mjs +7 -0
- package/dist/es/node_modules/lodash/keysIn.mjs +11 -0
- package/dist/es/node_modules/lodash/merge.mjs +10 -0
- package/dist/es/node_modules/lodash/now.mjs +7 -0
- package/dist/es/node_modules/lodash/stubFalse.mjs +7 -0
- package/dist/es/node_modules/lodash/toNumber.mjs +23 -0
- package/dist/es/node_modules/lodash/toPlainObject.mjs +10 -0
- package/dist/es/node_modules/object-assign/index.mjs +34 -0
- package/dist/es/node_modules/rc-pagination/es/locale/zh_CN.mjs +18 -0
- package/dist/es/node_modules/rc-picker/es/locale/zh_CN.mjs +31 -0
- package/dist/es/node_modules/react/cjs/react-jsx-runtime.production.min.mjs +45 -0
- package/dist/es/node_modules/react/jsx-runtime.mjs +8 -0
- package/dist/es/node_modules/react-fast-compare/index.mjs +78 -0
- package/dist/es/node_modules/react-infinite-scroll-component/dist/index.es.mjs +188 -0
- package/dist/es/node_modules/react-quill/dist/quill.snow.css.mjs +4 -0
- package/dist/es/node_modules/socket.io-client/build/esm/contrib/backo2.mjs +26 -0
- package/dist/es/node_modules/socket.io-client/build/esm/index.mjs +25 -0
- package/dist/es/node_modules/socket.io-client/build/esm/manager.mjs +242 -0
- package/dist/es/node_modules/socket.io-client/build/esm/on.mjs +8 -0
- package/dist/es/node_modules/socket.io-client/build/esm/socket.mjs +608 -0
- package/dist/es/node_modules/socket.io-client/build/esm/url.mjs +19 -0
- package/dist/es/node_modules/socket.io-parser/build/esm/binary.mjs +52 -0
- package/dist/es/node_modules/socket.io-parser/build/esm/index.mjs +203 -0
- package/dist/es/node_modules/socket.io-parser/build/esm/is-binary.mjs +26 -0
- package/dist/es/node_modules/toggle-selection/index.mjs +25 -0
- package/dist/es/node_modules/tslib/tslib.es6.mjs +15 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +6 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +10 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +9 -0
- package/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +19 -0
- package/dist/es/packages/agent-cli-sdk/src/AgentSession.mjs +243 -0
- package/dist/es/packages/agent-cli-sdk/src/BotClient.mjs +242 -0
- package/dist/es/packages/agent-cli-sdk/src/Config.mjs +34 -0
- package/dist/es/packages/agent-cli-sdk/src/DialogSession.mjs +281 -0
- package/dist/es/packages/agent-cli-sdk/src/EventBus.mjs +64 -0
- package/dist/es/packages/agent-cli-sdk/src/Logger.mjs +31 -0
- package/dist/es/packages/agent-cli-sdk/src/PayloadTypes.mjs +4 -0
- package/dist/es/packages/agent-cli-sdk/src/Session.mjs +527 -0
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/fetch.mjs +112 -0
- package/dist/es/packages/agent-cli-sdk/src/api/fetchEventSource/parse.mjs +97 -0
- package/dist/es/packages/agent-cli-sdk/src/api/index.mjs +48 -0
- package/dist/es/packages/agent-cli-sdk/src/utils.mjs +11 -0
- package/dist/es/packages/apis/dist/es/aecpilot/cosntant.mjs +5 -0
- package/dist/es/packages/apis/dist/es/aecpilot/model.mjs +9 -0
- package/dist/es/packages/apis/dist/es/aecpilotui/index.mjs +8 -0
- package/dist/es/packages/apis/dist/es/agentcliui/index.mjs +414 -0
- package/dist/es/packages/apis/dist/es/base/index.mjs +154 -0
- package/dist/es/packages/apis/dist/es/cvforce/index.mjs +431 -0
- package/dist/es/packages/apis/dist/es/cvforce/model.mjs +6 -0
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs +6 -0
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/rng.mjs +10 -0
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs +9 -0
- package/dist/es/packages/apis/dist/es/node_modules/uuid/dist/esm-browser/v4.mjs +19 -0
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/fetch.mjs +106 -0
- package/dist/es/packages/apis/dist/es/utils/fetchEventSource/parse.mjs +97 -0
- package/dist/es/robots.txt +3 -0
- package/dist/es/style.less.mjs +4 -0
- package/dist/es/types.mjs +4 -0
- package/dist/es/utils/clipboard.mjs +38 -0
- package/dist/es/utils/index.mjs +33 -0
- package/dist/lib/favicon.ico +0 -0
- package/dist/lib/favicon2.ico +0 -0
- package/dist/lib/font/font_4108228_4w5nlhafpte.js +1 -0
- package/dist/lib/font/font_4439177_0sppkcnqiqgs.js +1 -0
- package/dist/lib/font/gos-font.js +64 -0
- package/dist/lib/images/empty.svg +40 -0
- package/dist/lib/images/loading.gif +0 -0
- package/dist/lib/images/logo.png +0 -0
- package/dist/lib/images/map-example.png +0 -0
- package/dist/lib/images/sketch.png +0 -0
- package/dist/lib/index.html +43 -0
- package/dist/lib/index.js +169 -0
- package/dist/lib/logo192.png +0 -0
- package/dist/lib/logo512.png +0 -0
- package/dist/lib/manifest.json +25 -0
- package/dist/lib/robots.txt +3 -0
- package/dist/src/AgentClientUI.d.ts +4 -0
- package/dist/src/ConnectToNetwork/index.d.ts +13 -0
- package/dist/src/Dialog/AgentChat/index.d.ts +17 -0
- package/dist/src/Dialog/ChatEmptyView/index.d.ts +6 -0
- package/dist/src/Dialog/ConnectToNetwork/index.d.ts +13 -0
- package/dist/src/Dialog/FileCard/index.d.ts +22 -0
- package/dist/src/Dialog/FilePreview/index.d.ts +20 -0
- package/dist/src/Dialog/Greeting/index.d.ts +7 -0
- package/dist/src/Dialog/HistoryContent/index.d.ts +5 -0
- package/dist/src/Dialog/HistoryItem/index.d.ts +17 -0
- package/dist/src/Dialog/KnowledgeDoc/index.d.ts +9 -0
- package/dist/src/Dialog/KnowledgeList/KnowledgeSelect/index.d.ts +12 -0
- package/dist/src/Dialog/KnowledgeList/index.d.ts +13 -0
- package/dist/src/Dialog/PromptManager/PromptList/EditPromptModal/index.d.ts +11 -0
- package/dist/src/Dialog/PromptManager/PromptList/PrivatePromptList.d.ts +12 -0
- package/dist/src/Dialog/PromptManager/PromptList/PromptListItem.d.ts +13 -0
- package/dist/src/Dialog/PromptManager/PromptList/PublicPromptList.d.ts +12 -0
- package/dist/src/Dialog/PromptManager/index.d.ts +13 -0
- package/dist/src/Dialog/PromptSetting/index.d.ts +14 -0
- package/dist/src/Dialog/Recommend/RecommendItem.d.ts +12 -0
- package/dist/src/Dialog/Recommend/index.d.ts +14 -0
- package/dist/src/Dialog/ReferCollapse/index.d.ts +8 -0
- package/dist/src/Dialog/SearchReference/index.d.ts +7 -0
- package/dist/src/Dialog/SessionAction/index.d.ts +11 -0
- package/dist/src/Dialog/SessionList/index.d.ts +20 -0
- package/dist/src/Dialog/SessionListDrawer/HistorySessionList/NameEditPanel.d.ts +9 -0
- package/dist/src/Dialog/SessionListDrawer/HistorySessionList/SessionItem.d.ts +16 -0
- package/dist/src/Dialog/SessionListDrawer/HistorySessionList/index.d.ts +9 -0
- package/dist/src/Dialog/SessionListDrawer/index.d.ts +9 -0
- package/dist/src/Dialog/SessionRefer/ReferItem/index.d.ts +9 -0
- package/dist/src/Dialog/SessionRefer/index.d.ts +8 -0
- package/dist/src/Dialog/SessionRelated/index.d.ts +9 -0
- package/dist/src/Dialog/UploadFiles/ClearModal/index.d.ts +7 -0
- package/dist/src/Dialog/UploadFiles/index.d.ts +21 -0
- package/dist/src/Dialog/UploadKnowledgeFiles/ClearModal/index.d.ts +7 -0
- package/dist/src/Dialog/UploadKnowledgeFiles/index.d.ts +22 -0
- package/dist/src/Dialog/UploadingPrompt/index.d.ts +9 -0
- package/dist/src/Dialog/index.d.ts +9 -0
- package/dist/src/FileCard/index.d.ts +21 -0
- package/dist/src/FileItem/index.d.ts +11 -0
- package/dist/src/Footer/FooterWarning.d.ts +8 -0
- package/dist/src/Footer/index.d.ts +7 -0
- package/dist/src/Greeting/index.d.ts +7 -0
- package/dist/src/Iconfont/font_4108228_8te6zfkclqu.d.ts +0 -0
- package/dist/src/Iconfont/font_4439177_7rytwlvbmjj.d.ts +0 -0
- package/dist/src/Iconfont/index.d.ts +3 -0
- package/dist/src/InputProgress/index.d.ts +7 -0
- package/dist/src/QuillEditor/index.d.ts +19 -0
- package/dist/src/components/Copy/index.d.ts +5 -0
- package/dist/src/components/Header/index.d.ts +6 -0
- package/dist/src/components/JsonDisplay/index.d.ts +6 -0
- package/dist/src/components/Markdown/Code/index.d.ts +3 -0
- package/dist/src/components/Markdown/Image/index.d.ts +3 -0
- package/dist/src/components/Markdown/index.d.ts +6 -0
- package/dist/src/components/PDFViewer/index.d.ts +7 -0
- package/dist/src/components/WebLink/index.d.ts +7 -0
- package/dist/src/constant.d.ts +11 -0
- package/dist/src/context.d.ts +5 -0
- package/dist/src/index.d.ts +33 -0
- package/dist/src/types.d.ts +183 -0
- package/dist/src/utils/clipboard.d.ts +11 -0
- package/dist/src/utils/fetchEventSource/fetch.d.ts +44 -0
- package/dist/src/utils/fetchEventSource/index.d.ts +1 -0
- package/dist/src/utils/fetchEventSource/parse.d.ts +36 -0
- package/dist/src/utils/index.d.ts +17 -0
- package/package.json +138 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
var z = (L, R, u) => new Promise((a, w) => {
|
|
2
|
+
var D = (m) => {
|
|
3
|
+
try {
|
|
4
|
+
x(u.next(m));
|
|
5
|
+
} catch (C) {
|
|
6
|
+
w(C);
|
|
7
|
+
}
|
|
8
|
+
}, A = (m) => {
|
|
9
|
+
try {
|
|
10
|
+
x(u.throw(m));
|
|
11
|
+
} catch (C) {
|
|
12
|
+
w(C);
|
|
13
|
+
}
|
|
14
|
+
}, x = (m) => m.done ? a(m.value) : Promise.resolve(m.value).then(D, A);
|
|
15
|
+
x((u = u.apply(L, R)).next());
|
|
16
|
+
});
|
|
17
|
+
import { jsx as r, Fragment as ce, jsxs as S } from "../../_virtual/jsx-runtime.mjs";
|
|
18
|
+
import { message as f, Upload as W, Button as M, Badge as ue, Spin as pe, Popover as fe, Space as me } from "antd";
|
|
19
|
+
import { forwardRef as he, useState as v, useRef as G, useContext as ge, useEffect as F, useImperativeHandle as ye } from "react";
|
|
20
|
+
import { LoadingOutlined as xe, CloseCircleFilled as Se, CloudUploadOutlined as Ne } from "@ant-design/icons";
|
|
21
|
+
import "./style.less.mjs";
|
|
22
|
+
import Ce from "../../node_modules/lodash/debounce.mjs";
|
|
23
|
+
import Fe from "../FileCard/index.mjs";
|
|
24
|
+
import "axios";
|
|
25
|
+
import "../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
26
|
+
import { IFileOrigin as we } from "../../packages/apis/dist/es/aecpilot/model.mjs";
|
|
27
|
+
import "dayjs";
|
|
28
|
+
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
|
|
29
|
+
import "../../packages/apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
|
|
30
|
+
import "../../packages/apis/dist/es/agentcliui/index.mjs";
|
|
31
|
+
import "../../packages/apis/dist/es/aecpilotui/index.mjs";
|
|
32
|
+
import be from "./ClearModal/index.mjs";
|
|
33
|
+
import j from "../../Iconfont/index.mjs";
|
|
34
|
+
import Ie from "../../context.mjs";
|
|
35
|
+
import { isValidImageUrlWithAnyExtension as Ee, extractFileName as ze, FILE_NAME_MAX_LENGTH as X, fileTypes as ve } from "../../utils/index.mjs";
|
|
36
|
+
import { MB as Ae } from "../../constant.mjs";
|
|
37
|
+
const Ue = he((L, R) => {
|
|
38
|
+
const {
|
|
39
|
+
appId: u,
|
|
40
|
+
sid: a,
|
|
41
|
+
onStatusChange: w,
|
|
42
|
+
createSession: D,
|
|
43
|
+
disabled: A = !1,
|
|
44
|
+
afterFileAdd: x,
|
|
45
|
+
afterFileDelete: m,
|
|
46
|
+
onFileListChange: C,
|
|
47
|
+
shouldContinue: P = !0,
|
|
48
|
+
afterFilesClear: K,
|
|
49
|
+
docViewerUrl: q,
|
|
50
|
+
isFirstSession: J
|
|
51
|
+
} = L, [i, p] = v([]), c = G(i), [Q, U] = v([]), [Y, T] = v(!1), [b, k] = v(""), I = G(P), [$, B] = v(!1), {
|
|
52
|
+
Dragger: Z
|
|
53
|
+
} = W, {
|
|
54
|
+
service: o,
|
|
55
|
+
popupContainer: N
|
|
56
|
+
} = ge(Ie);
|
|
57
|
+
F(() => {
|
|
58
|
+
I.current = P;
|
|
59
|
+
}, [P]), ye(R, () => ({
|
|
60
|
+
update: H,
|
|
61
|
+
clear: _
|
|
62
|
+
})), F(() => {
|
|
63
|
+
J || (U([]), p([]), H());
|
|
64
|
+
}, [a]);
|
|
65
|
+
const H = () => a ? new Promise((e, s) => {
|
|
66
|
+
o == null || o.getApplicationIdSessionKnowledgeFiles(u, a, {
|
|
67
|
+
enabled: 1
|
|
68
|
+
}).then((t) => {
|
|
69
|
+
U(t), p(t), ee(t);
|
|
70
|
+
}).finally(() => {
|
|
71
|
+
e();
|
|
72
|
+
});
|
|
73
|
+
}) : Promise.resolve(), ee = (e) => z(void 0, null, function* () {
|
|
74
|
+
a && (e == null || e.map((s) => z(void 0, null, function* () {
|
|
75
|
+
var t;
|
|
76
|
+
try {
|
|
77
|
+
if (yield o == null ? void 0 : o.checkFileReady(u, a, s.id)) {
|
|
78
|
+
const l = [...c.current], h = e.findIndex((d) => d.id === s.id);
|
|
79
|
+
h !== -1 && (l[h].status = 2), p(l), x && x(s, a);
|
|
80
|
+
}
|
|
81
|
+
} catch (n) {
|
|
82
|
+
if (((t = n.cause) == null ? void 0 : t.code) === -101) {
|
|
83
|
+
const l = [...c.current], h = e.findIndex((d) => d.id === s.id);
|
|
84
|
+
h !== -1 && (l[h].status = 3), p(l);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
})));
|
|
89
|
+
});
|
|
90
|
+
F(() => {
|
|
91
|
+
f.config({
|
|
92
|
+
getContainer: () => (N == null ? void 0 : N.current) || document.body
|
|
93
|
+
});
|
|
94
|
+
}, [N]), F(() => {
|
|
95
|
+
w && w(b);
|
|
96
|
+
}, [b]);
|
|
97
|
+
const O = (e) => z(void 0, null, function* () {
|
|
98
|
+
if (e.size <= 0)
|
|
99
|
+
return f.error("该文件为空,请重新上传文档"), !1;
|
|
100
|
+
const t = ze(e.name);
|
|
101
|
+
if (console.log(t, "filename"), t.length > X)
|
|
102
|
+
return f.error(`文件名称不能超过${X}字符`), !1;
|
|
103
|
+
if (e.size > 50 * Ae)
|
|
104
|
+
return f.error(`${e.name}文件大小不能超过 50M`), !1;
|
|
105
|
+
if (ve.some((n) => n === e.type)) {
|
|
106
|
+
const n = e;
|
|
107
|
+
n.status = 1, p((l) => l.length >= 10 ? l : [...l, n]);
|
|
108
|
+
} else
|
|
109
|
+
oe("存在文件格式不正确的文件,已自动去除");
|
|
110
|
+
return !1;
|
|
111
|
+
});
|
|
112
|
+
F(() => {
|
|
113
|
+
if (i.length < 10 ? T(!1) : T(!0), !i.length) {
|
|
114
|
+
k("");
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const e = i.find((n) => n.status === 1), s = i.find((n) => n.status === 3);
|
|
118
|
+
i.every((n) => n.status === 2) ? k("successed") : e ? k("process") : s && k("failed"), C && C(i);
|
|
119
|
+
}, [i]), F(() => {
|
|
120
|
+
c.current = i;
|
|
121
|
+
const e = i.filter((s) => !Q.includes(s));
|
|
122
|
+
re(e), U(i);
|
|
123
|
+
}, [i]);
|
|
124
|
+
const te = (e, s, t) => z(void 0, null, function* () {
|
|
125
|
+
var h;
|
|
126
|
+
const n = [...c.current], l = c.current.findIndex((d) => d === t);
|
|
127
|
+
l !== -1 && (n[l].id = s), p(n);
|
|
128
|
+
try {
|
|
129
|
+
const d = yield o == null ? void 0 : o.checkFileReady(u, e, s, () => I.current, void 0, (g) => {
|
|
130
|
+
const y = [...c.current], E = c.current.findIndex((de) => de === t);
|
|
131
|
+
y[E].url = g.url, p(y);
|
|
132
|
+
});
|
|
133
|
+
if (d) {
|
|
134
|
+
const g = [...c.current], y = c.current.findIndex((E) => E === t);
|
|
135
|
+
y !== -1 && (g[y].status = 2, g[y].url = d.url), p(g), x && x(d, e);
|
|
136
|
+
}
|
|
137
|
+
} catch (d) {
|
|
138
|
+
if (((h = d.cause) == null ? void 0 : h.code) === -101) {
|
|
139
|
+
const g = [...c.current], y = c.current.findIndex((E) => E === t);
|
|
140
|
+
y !== -1 && (g[y].status = 3), p(g);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}), ne = () => a ? Promise.resolve(a) : D(), re = (e) => {
|
|
145
|
+
e.length && ne().then((s) => {
|
|
146
|
+
e == null || e.forEach((t) => {
|
|
147
|
+
var n;
|
|
148
|
+
I.current = !0, (n = le(s, t)) == null || n.then((l) => {
|
|
149
|
+
var d;
|
|
150
|
+
if (!l)
|
|
151
|
+
return;
|
|
152
|
+
const h = {
|
|
153
|
+
url: l,
|
|
154
|
+
name: t.name,
|
|
155
|
+
size: t.size,
|
|
156
|
+
type: 1,
|
|
157
|
+
origin: we.AECPILOT
|
|
158
|
+
};
|
|
159
|
+
I.current && ((d = se(s, h)) == null || d.then((g) => te(s, g, t)));
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}, se = (e, s) => o == null ? void 0 : o.postApplicationIdSessionKnowledgeSessionFile(u, e, s), oe = Ce((e) => {
|
|
164
|
+
f.error(e);
|
|
165
|
+
}, 300), ie = (e) => {
|
|
166
|
+
a && e != null && e.id && (o == null || o.delApplicationIdSessionKnowledgeFileId(u, a, e.id).then((s) => {
|
|
167
|
+
const t = i.filter((n) => n.id !== e.id);
|
|
168
|
+
p(t), f.config({
|
|
169
|
+
getContainer: () => (N == null ? void 0 : N.current) || document.body
|
|
170
|
+
}), f.success("删除成功"), m && m(e.id);
|
|
171
|
+
}));
|
|
172
|
+
}, ae = /* @__PURE__ */ r(ce, {
|
|
173
|
+
children: /* @__PURE__ */ S("div", {
|
|
174
|
+
className: "card-title",
|
|
175
|
+
children: [/* @__PURE__ */ r("span", {
|
|
176
|
+
className: "name",
|
|
177
|
+
children: "上传列表"
|
|
178
|
+
}), /* @__PURE__ */ S("div", {
|
|
179
|
+
className: "actions",
|
|
180
|
+
children: [/* @__PURE__ */ r(W, {
|
|
181
|
+
accept: ".doc, .docx, .pdf",
|
|
182
|
+
beforeUpload: O,
|
|
183
|
+
showUploadList: !1,
|
|
184
|
+
style: {
|
|
185
|
+
margin: 0
|
|
186
|
+
},
|
|
187
|
+
multiple: !0,
|
|
188
|
+
children: /* @__PURE__ */ r(M, {
|
|
189
|
+
className: "action",
|
|
190
|
+
type: "link",
|
|
191
|
+
disabled: Y,
|
|
192
|
+
children: /* @__PURE__ */ S("div", {
|
|
193
|
+
className: "detail",
|
|
194
|
+
children: [/* @__PURE__ */ r(j, {
|
|
195
|
+
type: "icon-tianjia",
|
|
196
|
+
style: {
|
|
197
|
+
fontSize: 16
|
|
198
|
+
}
|
|
199
|
+
}), /* @__PURE__ */ r("div", {
|
|
200
|
+
children: "添加"
|
|
201
|
+
})]
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
}), /* @__PURE__ */ r(M, {
|
|
205
|
+
className: "action",
|
|
206
|
+
type: "link",
|
|
207
|
+
disabled: !i.length,
|
|
208
|
+
onClick: () => {
|
|
209
|
+
B(!0);
|
|
210
|
+
},
|
|
211
|
+
children: /* @__PURE__ */ S("div", {
|
|
212
|
+
className: "detail",
|
|
213
|
+
children: [/* @__PURE__ */ r(j, {
|
|
214
|
+
type: "icon-shanchu",
|
|
215
|
+
style: {
|
|
216
|
+
fontSize: 16
|
|
217
|
+
}
|
|
218
|
+
}), /* @__PURE__ */ r("span", {
|
|
219
|
+
children: "清空"
|
|
220
|
+
})]
|
|
221
|
+
})
|
|
222
|
+
})]
|
|
223
|
+
})]
|
|
224
|
+
})
|
|
225
|
+
}), le = (e, s) => {
|
|
226
|
+
if (!e)
|
|
227
|
+
throw Error("session is not exist.");
|
|
228
|
+
return o == null ? void 0 : o.uploadFile(e, s).catch(() => (f.error("服务异常,请稍后再试"), ""));
|
|
229
|
+
}, V = /* @__PURE__ */ r("div", {
|
|
230
|
+
className: `upload-enter ${A ? "disabled" : ""}`,
|
|
231
|
+
children: /* @__PURE__ */ r(ue, {
|
|
232
|
+
size: "small",
|
|
233
|
+
color: "#9C24F2",
|
|
234
|
+
count: b === "successed" ? i.length : b === "process" ? /* @__PURE__ */ r(pe, {
|
|
235
|
+
className: "file-action file-process",
|
|
236
|
+
indicator: /* @__PURE__ */ r(xe, {
|
|
237
|
+
style: {
|
|
238
|
+
fontSize: 14
|
|
239
|
+
},
|
|
240
|
+
spin: !0
|
|
241
|
+
})
|
|
242
|
+
}) : b === "failed" ? /* @__PURE__ */ r(Se, {
|
|
243
|
+
style: {
|
|
244
|
+
color: "#dc4446",
|
|
245
|
+
fontSize: 14
|
|
246
|
+
}
|
|
247
|
+
}) : 0,
|
|
248
|
+
children: /* @__PURE__ */ r(j, {
|
|
249
|
+
type: "icon-shangchuanwenjian",
|
|
250
|
+
style: {
|
|
251
|
+
fontSize: 24
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
})
|
|
255
|
+
}), _ = () => new Promise((e) => {
|
|
256
|
+
const s = c.current;
|
|
257
|
+
if (console.log(s), !a)
|
|
258
|
+
return e();
|
|
259
|
+
const t = [];
|
|
260
|
+
s.filter((n) => n.id).forEach((n) => t.push({
|
|
261
|
+
id: n.id,
|
|
262
|
+
status: n.status
|
|
263
|
+
})), o == null || o.delApplicationIdSessionKnowledgeFile(u, a, {
|
|
264
|
+
files: t
|
|
265
|
+
}).then(() => {
|
|
266
|
+
U([]), p([]), c.current = [], K && K(), I.current = !1, e();
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
return /* @__PURE__ */ S("div", {
|
|
270
|
+
className: "footer-upload",
|
|
271
|
+
children: [A ? V : /* @__PURE__ */ r(fe, {
|
|
272
|
+
overlayClassName: "upload-popover",
|
|
273
|
+
overlayInnerStyle: {
|
|
274
|
+
width: 264,
|
|
275
|
+
minHeight: 211,
|
|
276
|
+
maxHeight: 356,
|
|
277
|
+
borderRadius: 12,
|
|
278
|
+
zIndex: 1
|
|
279
|
+
},
|
|
280
|
+
placement: "topLeft",
|
|
281
|
+
content: /* @__PURE__ */ r("div", {
|
|
282
|
+
className: "file-upload",
|
|
283
|
+
children: i.length > 0 ? /* @__PURE__ */ r("div", {
|
|
284
|
+
className: "upload-wrapper",
|
|
285
|
+
children: /* @__PURE__ */ r("div", {
|
|
286
|
+
className: "input-files",
|
|
287
|
+
style: {
|
|
288
|
+
display: "flex",
|
|
289
|
+
flexDirection: "column"
|
|
290
|
+
},
|
|
291
|
+
children: i == null ? void 0 : i.map((e, s) => /* @__PURE__ */ r(Fe, {
|
|
292
|
+
file: e,
|
|
293
|
+
actions: {
|
|
294
|
+
preview: () => {
|
|
295
|
+
if (!(e != null && e.url))
|
|
296
|
+
return f.error("正在上传中");
|
|
297
|
+
if (!Ee(e.url))
|
|
298
|
+
return f.error("链接格式不正确");
|
|
299
|
+
window.open(`${q}#/doc?url=${encodeURIComponent(e == null ? void 0 : e.url)}`);
|
|
300
|
+
},
|
|
301
|
+
remove: () => {
|
|
302
|
+
ie(e);
|
|
303
|
+
},
|
|
304
|
+
download: () => {
|
|
305
|
+
a && (o == null || o.getApplicationIdSessionKnowledgeFileId(u, a, e.id).then((t) => {
|
|
306
|
+
if (!(t != null && t.url)) {
|
|
307
|
+
f.error("下载失败");
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
const n = document.createElement("a");
|
|
311
|
+
n.href = t.url, n.download = t.name || "", n.click();
|
|
312
|
+
}));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}, s))
|
|
316
|
+
})
|
|
317
|
+
}) : /* @__PURE__ */ S(Z, {
|
|
318
|
+
name: "file",
|
|
319
|
+
showUploadList: !1,
|
|
320
|
+
multiple: !0,
|
|
321
|
+
beforeUpload: O,
|
|
322
|
+
accept: ".pdf, .doc, .docx",
|
|
323
|
+
maxCount: 10,
|
|
324
|
+
listType: "picture",
|
|
325
|
+
children: [/* @__PURE__ */ r("span", {
|
|
326
|
+
className: "file-upload-icon",
|
|
327
|
+
children: /* @__PURE__ */ r(Ne, {})
|
|
328
|
+
}), /* @__PURE__ */ S(me, {
|
|
329
|
+
className: "file-upload-action",
|
|
330
|
+
children: ["拖拽文件至此,或者", /* @__PURE__ */ r(M, {
|
|
331
|
+
type: "link",
|
|
332
|
+
style: {
|
|
333
|
+
padding: 0
|
|
334
|
+
},
|
|
335
|
+
children: "上传文件"
|
|
336
|
+
})]
|
|
337
|
+
}), /* @__PURE__ */ S("div", {
|
|
338
|
+
className: "file-upload-desc",
|
|
339
|
+
children: [/* @__PURE__ */ r("div", {
|
|
340
|
+
className: "item-upload-desc",
|
|
341
|
+
children: /* @__PURE__ */ r("span", {
|
|
342
|
+
children: "1.支持 doc、pdf、docx 格式;"
|
|
343
|
+
})
|
|
344
|
+
}), /* @__PURE__ */ r("div", {
|
|
345
|
+
className: "item-upload-desc",
|
|
346
|
+
children: "2.单个文件不超过 50 M;"
|
|
347
|
+
}), /* @__PURE__ */ r("div", {
|
|
348
|
+
className: "item-upload-desc",
|
|
349
|
+
children: "3.最多上传 10 个文件。"
|
|
350
|
+
})]
|
|
351
|
+
})]
|
|
352
|
+
})
|
|
353
|
+
}),
|
|
354
|
+
title: ae,
|
|
355
|
+
trigger: "click",
|
|
356
|
+
children: V
|
|
357
|
+
}), $ && /* @__PURE__ */ r(be, {
|
|
358
|
+
isvisible: $,
|
|
359
|
+
onClose: (e) => {
|
|
360
|
+
e === "clear" && _(), B(!1);
|
|
361
|
+
}
|
|
362
|
+
})]
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
Ue.displayName = "UploadFiles";
|
|
366
|
+
export {
|
|
367
|
+
Ue as default
|
|
368
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as o, jsxs as p } from "../../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { ExclamationCircleFilled as f } from "@ant-design/icons";
|
|
3
|
+
import { Modal as u, Button as s } from "antd";
|
|
4
|
+
import { useContext as h } from "react";
|
|
5
|
+
import "./style.less.mjs";
|
|
6
|
+
import C from "../../context.mjs";
|
|
7
|
+
const E = (r) => {
|
|
8
|
+
const {
|
|
9
|
+
files: a,
|
|
10
|
+
sessionId: l,
|
|
11
|
+
isvisible: c,
|
|
12
|
+
onClose: t
|
|
13
|
+
} = r, {
|
|
14
|
+
service: n
|
|
15
|
+
} = h(C), d = /* @__PURE__ */ p("div", {
|
|
16
|
+
className: "title",
|
|
17
|
+
children: [/* @__PURE__ */ o(f, {
|
|
18
|
+
style: {
|
|
19
|
+
color: "#FF9326",
|
|
20
|
+
fontSize: 20
|
|
21
|
+
}
|
|
22
|
+
}), /* @__PURE__ */ o("span", {
|
|
23
|
+
children: "文件任务正在处理"
|
|
24
|
+
})]
|
|
25
|
+
}), m = () => {
|
|
26
|
+
if (!l)
|
|
27
|
+
return;
|
|
28
|
+
const i = [];
|
|
29
|
+
a.filter((e) => e.id).forEach((e) => i.push({
|
|
30
|
+
id: e.id,
|
|
31
|
+
status: e.status
|
|
32
|
+
})), n == null || n.deleteSessionKnowledgeFiles(l, {
|
|
33
|
+
files: i
|
|
34
|
+
}).then((e) => {
|
|
35
|
+
console.log(e);
|
|
36
|
+
}), t("abandon");
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ o(u, {
|
|
39
|
+
className: "prompt-modal",
|
|
40
|
+
width: 340,
|
|
41
|
+
open: c,
|
|
42
|
+
title: d,
|
|
43
|
+
centered: !0,
|
|
44
|
+
maskClosable: !1,
|
|
45
|
+
onCancel: () => t("close"),
|
|
46
|
+
getContainer: document.getElementById("dialog-modal") || !1,
|
|
47
|
+
footer: [/* @__PURE__ */ o(s, {
|
|
48
|
+
onClick: () => {
|
|
49
|
+
m();
|
|
50
|
+
},
|
|
51
|
+
children: "放弃文件"
|
|
52
|
+
}, "cancel"), /* @__PURE__ */ o(s, {
|
|
53
|
+
type: "primary",
|
|
54
|
+
onClick: () => {
|
|
55
|
+
t("continue");
|
|
56
|
+
},
|
|
57
|
+
children: "继续上传"
|
|
58
|
+
}, "confirm")],
|
|
59
|
+
children: /* @__PURE__ */ o("div", {
|
|
60
|
+
className: "content",
|
|
61
|
+
children: "你可以选择后台继续上传,也可以直接离开放弃上传中的文件。"
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
E as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
var m = (y, i, r) => new Promise((p, u) => {
|
|
2
|
+
var d = (a) => {
|
|
3
|
+
try {
|
|
4
|
+
h(r.next(a));
|
|
5
|
+
} catch (l) {
|
|
6
|
+
u(l);
|
|
7
|
+
}
|
|
8
|
+
}, o = (a) => {
|
|
9
|
+
try {
|
|
10
|
+
h(r.throw(a));
|
|
11
|
+
} catch (l) {
|
|
12
|
+
u(l);
|
|
13
|
+
}
|
|
14
|
+
}, h = (a) => a.done ? p(a.value) : Promise.resolve(a.value).then(d, o);
|
|
15
|
+
h((r = r.apply(y, i)).next());
|
|
16
|
+
});
|
|
17
|
+
import { jsx as n, jsxs as x } from "../_virtual/jsx-runtime.mjs";
|
|
18
|
+
import { useState as f, useContext as U, useRef as D, useEffect as v } from "react";
|
|
19
|
+
import O from "../context.mjs";
|
|
20
|
+
import V from "./AgentChat/index.mjs";
|
|
21
|
+
import q from "./KnowledgeList/index.mjs";
|
|
22
|
+
import z from "./SessionList/index.mjs";
|
|
23
|
+
import "./style.less.mjs";
|
|
24
|
+
const $ = (y) => {
|
|
25
|
+
const {
|
|
26
|
+
sessionId: i,
|
|
27
|
+
appId: r,
|
|
28
|
+
docViewerUrl: p,
|
|
29
|
+
bodyStyle: u
|
|
30
|
+
} = y, [d, o] = f(), {
|
|
31
|
+
service: h,
|
|
32
|
+
mode: a,
|
|
33
|
+
showHeader: l,
|
|
34
|
+
token: B,
|
|
35
|
+
agentClient: e,
|
|
36
|
+
sider: E,
|
|
37
|
+
onSessionLoad: N,
|
|
38
|
+
onSessionUnload: F,
|
|
39
|
+
footer: G,
|
|
40
|
+
transform: J,
|
|
41
|
+
depId: b
|
|
42
|
+
} = U(O), [c, L] = f(), w = D(null), [A, R] = f(""), [j, I] = f([]), [k, S] = f(!1);
|
|
43
|
+
v(() => {
|
|
44
|
+
var t, s;
|
|
45
|
+
b && ((t = d == null ? void 0 : d.data) != null && t.id ? S(!!((s = d.data) != null && s.netOpen)) : S(!1));
|
|
46
|
+
}, [b]), v(() => {
|
|
47
|
+
const t = () => m(void 0, null, function* () {
|
|
48
|
+
const s = e == null ? void 0 : e.application;
|
|
49
|
+
if (!(s != null && s.id))
|
|
50
|
+
return;
|
|
51
|
+
const g = s == null ? void 0 : s.arrange;
|
|
52
|
+
if (!(g != null && g.length))
|
|
53
|
+
return;
|
|
54
|
+
const K = g[0].embeddingService;
|
|
55
|
+
R(K), L(s);
|
|
56
|
+
});
|
|
57
|
+
return e == null || e.addEventListener("ready", () => t()), () => {
|
|
58
|
+
e == null || e.removeEventListener("ready", t);
|
|
59
|
+
};
|
|
60
|
+
}, []), v(() => {
|
|
61
|
+
e && i && (console.log("load sessionId", i), e.ready ? (console.log("agentClient is ready"), e == null || e.getSessions().then((t) => m(void 0, null, function* () {
|
|
62
|
+
o == null || o(t.find((s) => s.id === i));
|
|
63
|
+
}))) : e.addEventListener("ready", () => m(void 0, null, function* () {
|
|
64
|
+
console.log("agentClient is ready"), e == null || e.getSessions().then((t) => m(void 0, null, function* () {
|
|
65
|
+
o == null || o(t.find((s) => s.id === i));
|
|
66
|
+
}));
|
|
67
|
+
}), !0));
|
|
68
|
+
}, [e, i]), v(() => {
|
|
69
|
+
d != null && d.data && N && N({
|
|
70
|
+
applicationId: r,
|
|
71
|
+
sessionId: d.data.id,
|
|
72
|
+
session: d.data
|
|
73
|
+
});
|
|
74
|
+
}, [d]);
|
|
75
|
+
const H = (t) => {
|
|
76
|
+
var s;
|
|
77
|
+
return (s = w.current) == null ? void 0 : s.create(t);
|
|
78
|
+
};
|
|
79
|
+
return /* @__PURE__ */ n("div", {
|
|
80
|
+
className: "dialog",
|
|
81
|
+
children: /* @__PURE__ */ x("div", {
|
|
82
|
+
className: "dialog-pannel",
|
|
83
|
+
children: [/* @__PURE__ */ n("div", {
|
|
84
|
+
className: "dialog-sider",
|
|
85
|
+
children: /* @__PURE__ */ n(z, {
|
|
86
|
+
ref: w,
|
|
87
|
+
sider: E,
|
|
88
|
+
appId: r,
|
|
89
|
+
networkStatus: k,
|
|
90
|
+
currentSession: d,
|
|
91
|
+
application: c,
|
|
92
|
+
setCurrentSession: o,
|
|
93
|
+
checkKnowledges: j,
|
|
94
|
+
setCheckKnowledges: I
|
|
95
|
+
})
|
|
96
|
+
}), /* @__PURE__ */ n("div", {
|
|
97
|
+
className: "dialog-content",
|
|
98
|
+
children: /* @__PURE__ */ x("div", {
|
|
99
|
+
className: "dialog-chat",
|
|
100
|
+
children: [l && /* @__PURE__ */ n("div", {
|
|
101
|
+
className: "dialog-chat-header",
|
|
102
|
+
children: /* @__PURE__ */ n(q, {
|
|
103
|
+
setCheckKnowledges: I,
|
|
104
|
+
application: c,
|
|
105
|
+
currentSession: d,
|
|
106
|
+
setCurrentSession: o
|
|
107
|
+
})
|
|
108
|
+
}), /* @__PURE__ */ n("div", {
|
|
109
|
+
className: "dialog-chat-content",
|
|
110
|
+
children: (c == null ? void 0 : c.id) && /* @__PURE__ */ n(V, {
|
|
111
|
+
setNetworkStatus: S,
|
|
112
|
+
networkStatus: k,
|
|
113
|
+
application: c,
|
|
114
|
+
currentSession: d,
|
|
115
|
+
onCreateSession: H,
|
|
116
|
+
docViewerUrl: p,
|
|
117
|
+
embeddingService: A,
|
|
118
|
+
setCurrentSession: o
|
|
119
|
+
})
|
|
120
|
+
})]
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
$ as default
|
|
128
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const M = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwIDhDMTAgNi44OTU0MyAxMC44OTU0IDYgMTIgNkgyNy4xNzE2QzI3LjcwMiA2IDI4LjIxMDcgNi4yMTA3MSAyOC41ODU4IDYuNTg1NzlMMzcuNDE0MiAxNS40MTQyQzM3Ljc4OTMgMTUuNzg5MyAzOCAxNi4yOTggMzggMTYuODI4NFY0MEMzOCA0MS4xMDQ2IDM3LjEwNDYgNDIgMzYgNDJIMTJDMTAuODk1NCA0MiAxMCA0MS4xMDQ2IDEwIDQwVjhaIiBmaWxsPSIjNDVDQz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Lz4KPHBhdGggZD0iTTE1IDMwLjU4NTlMMTUgMzciIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0zMCAxNkgzNS43OTI5QzM2LjIzODMgMTYgMzYuNDYxNCAxNS40NjE0IDM2LjE0NjQgMTUuMTQ2NEwyOC44NTM2IDcuODUzNTVDMjguNTM4NiA3LjUzODU3IDI4IDcuNzYxNjUgMjggOC4yMDcxMVYxNEMyOCAxNS4xMDQ2IDI4Ljg5NTQgMTYgMzAgMTZaIiBmaWxsPSJ3aGl0ZSIgZmlsbC1vcGFjaXR5PSIwLjUiLz4KPC9zdmc+Cg==";
|
|
2
|
+
export {
|
|
3
|
+
M as default
|
|
4
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsxs as l, jsx as e } from "../_virtual/jsx-runtime.mjs";
|
|
2
|
+
import { useContext as w, useState as h, useEffect as N } from "react";
|
|
3
|
+
import f from "../FileCard/doc-icons/pdf.svg.mjs";
|
|
4
|
+
import v from "../FileCard/doc-icons/doc.svg.mjs";
|
|
5
|
+
import y from "../FileCard/doc-icons/docx.svg.mjs";
|
|
6
|
+
import "./style.less.mjs";
|
|
7
|
+
import { Typography as U, message as u } from "antd";
|
|
8
|
+
import { getFileExtension as x, formatFileSize as E, isValidImageUrlWithAnyExtension as j } from "../utils/index.mjs";
|
|
9
|
+
import k from "../context.mjs";
|
|
10
|
+
const z = {
|
|
11
|
+
doc: v,
|
|
12
|
+
docx: y,
|
|
13
|
+
pdf: f
|
|
14
|
+
}, b = (g) => {
|
|
15
|
+
const {
|
|
16
|
+
currentSession: i,
|
|
17
|
+
fileId: p,
|
|
18
|
+
file: r,
|
|
19
|
+
docViewerUrl: C
|
|
20
|
+
} = g, {
|
|
21
|
+
service: m
|
|
22
|
+
} = w(k), [o, t] = h(), [c, d] = h("");
|
|
23
|
+
N(() => {
|
|
24
|
+
var n;
|
|
25
|
+
if (r != null && r.id) {
|
|
26
|
+
t(r);
|
|
27
|
+
const s = x(r == null ? void 0 : r.name) || "";
|
|
28
|
+
d(s);
|
|
29
|
+
} else {
|
|
30
|
+
if (!p || !((n = i == null ? void 0 : i.data) != null && n.id))
|
|
31
|
+
return;
|
|
32
|
+
m == null || m.getSessionKnowledgeFile(i.data.id, p).then((s) => {
|
|
33
|
+
t(s);
|
|
34
|
+
const I = x(s == null ? void 0 : s.name) || "";
|
|
35
|
+
d(I);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, []);
|
|
39
|
+
const F = (n) => {
|
|
40
|
+
if (!(n != null && n.url))
|
|
41
|
+
return u.error("链接不存在");
|
|
42
|
+
if (!j(n.url))
|
|
43
|
+
return u.error("链接格式不正确");
|
|
44
|
+
window.open(`${C}#/doc?url=${encodeURIComponent(n == null ? void 0 : n.url)}`);
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ l("div", {
|
|
47
|
+
className: "file-item",
|
|
48
|
+
onClick: () => F(o),
|
|
49
|
+
children: [/* @__PURE__ */ e("div", {
|
|
50
|
+
className: "item-left",
|
|
51
|
+
children: /* @__PURE__ */ e("img", {
|
|
52
|
+
className: "file-icon",
|
|
53
|
+
src: z[c]
|
|
54
|
+
})
|
|
55
|
+
}), /* @__PURE__ */ l("div", {
|
|
56
|
+
className: "item-main",
|
|
57
|
+
children: [/* @__PURE__ */ e("div", {
|
|
58
|
+
className: "file-name",
|
|
59
|
+
children: /* @__PURE__ */ e(U.Paragraph, {
|
|
60
|
+
style: {
|
|
61
|
+
margin: 0,
|
|
62
|
+
width: "100%"
|
|
63
|
+
},
|
|
64
|
+
ellipsis: {
|
|
65
|
+
rows: 1,
|
|
66
|
+
tooltip: o == null ? void 0 : o.name
|
|
67
|
+
},
|
|
68
|
+
children: o == null ? void 0 : o.name
|
|
69
|
+
})
|
|
70
|
+
}), /* @__PURE__ */ l("div", {
|
|
71
|
+
className: "file-desc",
|
|
72
|
+
children: [/* @__PURE__ */ e("span", {
|
|
73
|
+
children: c == null ? void 0 : c.toUpperCase()
|
|
74
|
+
}), /* @__PURE__ */ e("span", {
|
|
75
|
+
children: ","
|
|
76
|
+
}), /* @__PURE__ */ e("span", {
|
|
77
|
+
children: E((o == null ? void 0 : o.size) || 0)
|
|
78
|
+
})]
|
|
79
|
+
})]
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
b as default
|
|
85
|
+
};
|