@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,203 @@
|
|
|
1
|
+
import { Emitter as h } from "../../../@socket.io/component-emitter/lib/esm/index.mjs";
|
|
2
|
+
import { deconstructPacket as f, reconstructPacket as N } from "./binary.mjs";
|
|
3
|
+
import { hasBinary as E, isBinary as d } from "./is-binary.mjs";
|
|
4
|
+
const A = [
|
|
5
|
+
"connect",
|
|
6
|
+
"connect_error",
|
|
7
|
+
"disconnect",
|
|
8
|
+
"disconnecting",
|
|
9
|
+
"newListener",
|
|
10
|
+
"removeListener"
|
|
11
|
+
// used by the Node.js EventEmitter
|
|
12
|
+
], y = 5;
|
|
13
|
+
var r;
|
|
14
|
+
(function(n) {
|
|
15
|
+
n[n.CONNECT = 0] = "CONNECT", n[n.DISCONNECT = 1] = "DISCONNECT", n[n.EVENT = 2] = "EVENT", n[n.ACK = 3] = "ACK", n[n.CONNECT_ERROR = 4] = "CONNECT_ERROR", n[n.BINARY_EVENT = 5] = "BINARY_EVENT", n[n.BINARY_ACK = 6] = "BINARY_ACK";
|
|
16
|
+
})(r || (r = {}));
|
|
17
|
+
class g {
|
|
18
|
+
/**
|
|
19
|
+
* Encoder constructor
|
|
20
|
+
*
|
|
21
|
+
* @param {function} replacer - custom replacer to pass down to JSON.parse
|
|
22
|
+
*/
|
|
23
|
+
constructor(t) {
|
|
24
|
+
this.replacer = t;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Encode a packet as a single string if non-binary, or as a
|
|
28
|
+
* buffer sequence, depending on packet type.
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} obj - packet object
|
|
31
|
+
*/
|
|
32
|
+
encode(t) {
|
|
33
|
+
return (t.type === r.EVENT || t.type === r.ACK) && E(t) ? this.encodeAsBinary({
|
|
34
|
+
type: t.type === r.EVENT ? r.BINARY_EVENT : r.BINARY_ACK,
|
|
35
|
+
nsp: t.nsp,
|
|
36
|
+
data: t.data,
|
|
37
|
+
id: t.id
|
|
38
|
+
}) : [this.encodeAsString(t)];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Encode packet as string.
|
|
42
|
+
*/
|
|
43
|
+
encodeAsString(t) {
|
|
44
|
+
let e = "" + t.type;
|
|
45
|
+
return (t.type === r.BINARY_EVENT || t.type === r.BINARY_ACK) && (e += t.attachments + "-"), t.nsp && t.nsp !== "/" && (e += t.nsp + ","), t.id != null && (e += t.id), t.data != null && (e += JSON.stringify(t.data, this.replacer)), e;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Encode packet as 'buffer sequence' by removing blobs, and
|
|
49
|
+
* deconstructing packet into object with placeholders and
|
|
50
|
+
* a list of buffers.
|
|
51
|
+
*/
|
|
52
|
+
encodeAsBinary(t) {
|
|
53
|
+
const e = f(t), s = this.encodeAsString(e.packet), o = e.buffers;
|
|
54
|
+
return o.unshift(s), o;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function a(n) {
|
|
58
|
+
return Object.prototype.toString.call(n) === "[object Object]";
|
|
59
|
+
}
|
|
60
|
+
class u extends h {
|
|
61
|
+
/**
|
|
62
|
+
* Decoder constructor
|
|
63
|
+
*
|
|
64
|
+
* @param {function} reviver - custom reviver to pass down to JSON.stringify
|
|
65
|
+
*/
|
|
66
|
+
constructor(t) {
|
|
67
|
+
super(), this.reviver = t;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Decodes an encoded packet string into packet JSON.
|
|
71
|
+
*
|
|
72
|
+
* @param {String} obj - encoded packet
|
|
73
|
+
*/
|
|
74
|
+
add(t) {
|
|
75
|
+
let e;
|
|
76
|
+
if (typeof t == "string") {
|
|
77
|
+
if (this.reconstructor)
|
|
78
|
+
throw new Error("got plaintext data when reconstructing a packet");
|
|
79
|
+
e = this.decodeString(t);
|
|
80
|
+
const s = e.type === r.BINARY_EVENT;
|
|
81
|
+
s || e.type === r.BINARY_ACK ? (e.type = s ? r.EVENT : r.ACK, this.reconstructor = new l(e), e.attachments === 0 && super.emitReserved("decoded", e)) : super.emitReserved("decoded", e);
|
|
82
|
+
} else if (d(t) || t.base64)
|
|
83
|
+
if (this.reconstructor)
|
|
84
|
+
e = this.reconstructor.takeBinaryData(t), e && (this.reconstructor = null, super.emitReserved("decoded", e));
|
|
85
|
+
else
|
|
86
|
+
throw new Error("got binary data when not reconstructing a packet");
|
|
87
|
+
else
|
|
88
|
+
throw new Error("Unknown type: " + t);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Decode a packet String (JSON data)
|
|
92
|
+
*
|
|
93
|
+
* @param {String} str
|
|
94
|
+
* @return {Object} packet
|
|
95
|
+
*/
|
|
96
|
+
decodeString(t) {
|
|
97
|
+
let e = 0;
|
|
98
|
+
const s = {
|
|
99
|
+
type: Number(t.charAt(0))
|
|
100
|
+
};
|
|
101
|
+
if (r[s.type] === void 0)
|
|
102
|
+
throw new Error("unknown packet type " + s.type);
|
|
103
|
+
if (s.type === r.BINARY_EVENT || s.type === r.BINARY_ACK) {
|
|
104
|
+
const i = e + 1;
|
|
105
|
+
for (; t.charAt(++e) !== "-" && e != t.length; )
|
|
106
|
+
;
|
|
107
|
+
const c = t.substring(i, e);
|
|
108
|
+
if (c != Number(c) || t.charAt(e) !== "-")
|
|
109
|
+
throw new Error("Illegal attachments");
|
|
110
|
+
s.attachments = Number(c);
|
|
111
|
+
}
|
|
112
|
+
if (t.charAt(e + 1) === "/") {
|
|
113
|
+
const i = e + 1;
|
|
114
|
+
for (; ++e && !(t.charAt(e) === "," || e === t.length); )
|
|
115
|
+
;
|
|
116
|
+
s.nsp = t.substring(i, e);
|
|
117
|
+
} else
|
|
118
|
+
s.nsp = "/";
|
|
119
|
+
const o = t.charAt(e + 1);
|
|
120
|
+
if (o !== "" && Number(o) == o) {
|
|
121
|
+
const i = e + 1;
|
|
122
|
+
for (; ++e; ) {
|
|
123
|
+
const c = t.charAt(e);
|
|
124
|
+
if (c == null || Number(c) != c) {
|
|
125
|
+
--e;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
if (e === t.length)
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
s.id = Number(t.substring(i, e + 1));
|
|
132
|
+
}
|
|
133
|
+
if (t.charAt(++e)) {
|
|
134
|
+
const i = this.tryParse(t.substr(e));
|
|
135
|
+
if (u.isPayloadValid(s.type, i))
|
|
136
|
+
s.data = i;
|
|
137
|
+
else
|
|
138
|
+
throw new Error("invalid payload");
|
|
139
|
+
}
|
|
140
|
+
return s;
|
|
141
|
+
}
|
|
142
|
+
tryParse(t) {
|
|
143
|
+
try {
|
|
144
|
+
return JSON.parse(t, this.reviver);
|
|
145
|
+
} catch (e) {
|
|
146
|
+
return !1;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
static isPayloadValid(t, e) {
|
|
150
|
+
switch (t) {
|
|
151
|
+
case r.CONNECT:
|
|
152
|
+
return a(e);
|
|
153
|
+
case r.DISCONNECT:
|
|
154
|
+
return e === void 0;
|
|
155
|
+
case r.CONNECT_ERROR:
|
|
156
|
+
return typeof e == "string" || a(e);
|
|
157
|
+
case r.EVENT:
|
|
158
|
+
case r.BINARY_EVENT:
|
|
159
|
+
return Array.isArray(e) && (typeof e[0] == "number" || typeof e[0] == "string" && A.indexOf(e[0]) === -1);
|
|
160
|
+
case r.ACK:
|
|
161
|
+
case r.BINARY_ACK:
|
|
162
|
+
return Array.isArray(e);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Deallocates a parser's resources
|
|
167
|
+
*/
|
|
168
|
+
destroy() {
|
|
169
|
+
this.reconstructor && (this.reconstructor.finishedReconstruction(), this.reconstructor = null);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
class l {
|
|
173
|
+
constructor(t) {
|
|
174
|
+
this.packet = t, this.buffers = [], this.reconPack = t;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Method to be called when binary data received from connection
|
|
178
|
+
* after a BINARY_EVENT packet.
|
|
179
|
+
*
|
|
180
|
+
* @param {Buffer | ArrayBuffer} binData - the raw binary data received
|
|
181
|
+
* @return {null | Object} returns null if more binary data is expected or
|
|
182
|
+
* a reconstructed packet object if all buffers have been received.
|
|
183
|
+
*/
|
|
184
|
+
takeBinaryData(t) {
|
|
185
|
+
if (this.buffers.push(t), this.buffers.length === this.reconPack.attachments) {
|
|
186
|
+
const e = N(this.reconPack, this.buffers);
|
|
187
|
+
return this.finishedReconstruction(), e;
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Cleans up binary packet reconstruction variables.
|
|
193
|
+
*/
|
|
194
|
+
finishedReconstruction() {
|
|
195
|
+
this.reconPack = null, this.buffers = [];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
export {
|
|
199
|
+
u as Decoder,
|
|
200
|
+
g as Encoder,
|
|
201
|
+
r as PacketType,
|
|
202
|
+
y as protocol
|
|
203
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const i = typeof ArrayBuffer == "function", o = (t) => typeof ArrayBuffer.isView == "function" ? ArrayBuffer.isView(t) : t.buffer instanceof ArrayBuffer, n = Object.prototype.toString, u = typeof Blob == "function" || typeof Blob != "undefined" && n.call(Blob) === "[object BlobConstructor]", c = typeof File == "function" || typeof File != "undefined" && n.call(File) === "[object FileConstructor]";
|
|
2
|
+
function a(t) {
|
|
3
|
+
return i && (t instanceof ArrayBuffer || o(t)) || u && t instanceof Blob || c && t instanceof File;
|
|
4
|
+
}
|
|
5
|
+
function r(t, l) {
|
|
6
|
+
if (!t || typeof t != "object")
|
|
7
|
+
return !1;
|
|
8
|
+
if (Array.isArray(t)) {
|
|
9
|
+
for (let e = 0, f = t.length; e < f; e++)
|
|
10
|
+
if (r(t[e]))
|
|
11
|
+
return !0;
|
|
12
|
+
return !1;
|
|
13
|
+
}
|
|
14
|
+
if (a(t))
|
|
15
|
+
return !0;
|
|
16
|
+
if (t.toJSON && typeof t.toJSON == "function" && arguments.length === 1)
|
|
17
|
+
return r(t.toJSON(), !0);
|
|
18
|
+
for (const e in t)
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(t, e) && r(t[e]))
|
|
20
|
+
return !0;
|
|
21
|
+
return !1;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
r as hasBinary,
|
|
25
|
+
a as isBinary
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var o = function() {
|
|
2
|
+
var e = document.getSelection();
|
|
3
|
+
if (!e.rangeCount)
|
|
4
|
+
return function() {
|
|
5
|
+
};
|
|
6
|
+
for (var t = document.activeElement, a = [], n = 0; n < e.rangeCount; n++)
|
|
7
|
+
a.push(e.getRangeAt(n));
|
|
8
|
+
switch (t.tagName.toUpperCase()) {
|
|
9
|
+
case "INPUT":
|
|
10
|
+
case "TEXTAREA":
|
|
11
|
+
t.blur();
|
|
12
|
+
break;
|
|
13
|
+
default:
|
|
14
|
+
t = null;
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
return e.removeAllRanges(), function() {
|
|
18
|
+
e.type === "Caret" && e.removeAllRanges(), e.rangeCount || a.forEach(function(r) {
|
|
19
|
+
e.addRange(r);
|
|
20
|
+
}), t && t.focus();
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
o as t
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function i(r) {
|
|
2
|
+
var e = typeof Symbol == "function" && Symbol.iterator, n = e && r[e], t = 0;
|
|
3
|
+
if (n)
|
|
4
|
+
return n.call(r);
|
|
5
|
+
if (r && typeof r.length == "number")
|
|
6
|
+
return {
|
|
7
|
+
next: function() {
|
|
8
|
+
return r && t >= r.length && (r = void 0), { value: r && r[t++], done: !r };
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
i as __values
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
let t;
|
|
2
|
+
const e = new Uint8Array(16);
|
|
3
|
+
function o() {
|
|
4
|
+
if (!t && (t = typeof crypto != "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !t))
|
|
5
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
6
|
+
return t(e);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
o as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const i = [];
|
|
2
|
+
for (let n = 0; n < 256; ++n)
|
|
3
|
+
i.push((n + 256).toString(16).slice(1));
|
|
4
|
+
function c(n, u = 0) {
|
|
5
|
+
return i[n[u + 0]] + i[n[u + 1]] + i[n[u + 2]] + i[n[u + 3]] + "-" + i[n[u + 4]] + i[n[u + 5]] + "-" + i[n[u + 6]] + i[n[u + 7]] + "-" + i[n[u + 8]] + i[n[u + 9]] + "-" + i[n[u + 10]] + i[n[u + 11]] + i[n[u + 12]] + i[n[u + 13]] + i[n[u + 14]] + i[n[u + 15]];
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
c as unsafeStringify
|
|
9
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import e from "./native.mjs";
|
|
2
|
+
import i from "./rng.mjs";
|
|
3
|
+
import { unsafeStringify as d } from "./stringify.mjs";
|
|
4
|
+
function g(n, m, t) {
|
|
5
|
+
if (e.randomUUID && !m && !n)
|
|
6
|
+
return e.randomUUID();
|
|
7
|
+
n = n || {};
|
|
8
|
+
const r = n.random || (n.rng || i)();
|
|
9
|
+
if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, m) {
|
|
10
|
+
t = t || 0;
|
|
11
|
+
for (let a = 0; a < 16; ++a)
|
|
12
|
+
m[t + a] = r[a];
|
|
13
|
+
return m;
|
|
14
|
+
}
|
|
15
|
+
return d(r);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
g as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
var C = Object.defineProperty, E = Object.defineProperties;
|
|
2
|
+
var S = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var R = Object.getOwnPropertySymbols;
|
|
4
|
+
var b = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var A = (a, t, i) => t in a ? C(a, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : a[t] = i, l = (a, t) => {
|
|
6
|
+
for (var i in t || (t = {}))
|
|
7
|
+
b.call(t, i) && A(a, i, t[i]);
|
|
8
|
+
if (R)
|
|
9
|
+
for (var i of R(t))
|
|
10
|
+
x.call(t, i) && A(a, i, t[i]);
|
|
11
|
+
return a;
|
|
12
|
+
}, y = (a, t) => E(a, S(t));
|
|
13
|
+
var p = (a, t, i) => new Promise((h, n) => {
|
|
14
|
+
var s = (c) => {
|
|
15
|
+
try {
|
|
16
|
+
r(i.next(c));
|
|
17
|
+
} catch (m) {
|
|
18
|
+
n(m);
|
|
19
|
+
}
|
|
20
|
+
}, e = (c) => {
|
|
21
|
+
try {
|
|
22
|
+
r(i.throw(c));
|
|
23
|
+
} catch (m) {
|
|
24
|
+
n(m);
|
|
25
|
+
}
|
|
26
|
+
}, r = (c) => c.done ? h(c.value) : Promise.resolve(c.value).then(s, e);
|
|
27
|
+
r((i = i.apply(a, t)).next());
|
|
28
|
+
});
|
|
29
|
+
import "axios";
|
|
30
|
+
import "../../../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
31
|
+
import "dayjs";
|
|
32
|
+
import "../../apis/dist/es/node_modules/uuid/dist/esm-browser/native.mjs";
|
|
33
|
+
import "../../apis/dist/es/node_modules/uuid/dist/esm-browser/stringify.mjs";
|
|
34
|
+
import "../../apis/dist/es/agentcliui/index.mjs";
|
|
35
|
+
import "../../apis/dist/es/aecpilotui/index.mjs";
|
|
36
|
+
import { ChatMessageRole as k } from "../../apis/dist/es/cvforce/model.mjs";
|
|
37
|
+
import L from "./Logger.mjs";
|
|
38
|
+
import { configuration as w } from "./Config.mjs";
|
|
39
|
+
import { io as U } from "../../../node_modules/socket.io-client/build/esm/index.mjs";
|
|
40
|
+
import { UserMode as v } from "./PayloadTypes.mjs";
|
|
41
|
+
import q, { SessionErrors as I } from "./Session.mjs";
|
|
42
|
+
const u = new L("[AgentClient] ");
|
|
43
|
+
class j extends q {
|
|
44
|
+
constructor(t, i = "", h, n) {
|
|
45
|
+
super(t, i, h, n);
|
|
46
|
+
}
|
|
47
|
+
prepareConnection() {
|
|
48
|
+
return new Promise((t) => p(this, null, function* () {
|
|
49
|
+
this.socket && t(!0);
|
|
50
|
+
const i = {
|
|
51
|
+
version: "1.0",
|
|
52
|
+
stream: "false",
|
|
53
|
+
appId: this._applicationId,
|
|
54
|
+
sessionId: this._id,
|
|
55
|
+
Authorization: `${this.token}`,
|
|
56
|
+
userMode: w.debug ? v.Debug : v.Normal
|
|
57
|
+
}, h = new URL(w.apiRoot), n = yield U(h.origin, {
|
|
58
|
+
path: h.pathname.replace("api", "socketio") + "/copilot",
|
|
59
|
+
query: i,
|
|
60
|
+
transports: ["websocket"]
|
|
61
|
+
});
|
|
62
|
+
n.on("connect", () => {
|
|
63
|
+
u.log("socket:connect"), this.event.emit("socket:connect"), n.emit("init");
|
|
64
|
+
}), n.on("disconnect", () => {
|
|
65
|
+
u.log("socket:disconnect"), this.event.emit("socket:disconnect");
|
|
66
|
+
}), n.on("ready", (s) => {
|
|
67
|
+
if (s.code === 200) {
|
|
68
|
+
u.log("ready");
|
|
69
|
+
const e = w.debug ? v.Debug : v.Normal;
|
|
70
|
+
e === v.Debug && e !== s.userMode && console.warn(I.UserModeError), this._ready || (this._ready = !0, this.event.emit("ready")), this.frozen = !1, t(!0);
|
|
71
|
+
} else {
|
|
72
|
+
this._ready && (this._ready = !1);
|
|
73
|
+
const e = new Error(
|
|
74
|
+
I.SocketConnectionFailed
|
|
75
|
+
// , {
|
|
76
|
+
// cause: data,
|
|
77
|
+
// }
|
|
78
|
+
);
|
|
79
|
+
u.error("error", e), this.event.emit("error", e), t(!1);
|
|
80
|
+
}
|
|
81
|
+
}), n.on("action", (s, e) => p(this, null, function* () {
|
|
82
|
+
if (this._stopAnswer || !this._id)
|
|
83
|
+
return;
|
|
84
|
+
const {
|
|
85
|
+
type: r,
|
|
86
|
+
data: {
|
|
87
|
+
runnerIsClient: c,
|
|
88
|
+
pluginCode: m,
|
|
89
|
+
funcCode: g,
|
|
90
|
+
parameters: o,
|
|
91
|
+
requestBody: N
|
|
92
|
+
}
|
|
93
|
+
} = s, d = this.messages[this.messages.length - 1];
|
|
94
|
+
if (!d.messageId)
|
|
95
|
+
d.actions || (d.actions = []), d.actions[s.data.step - 1] || (d.actions[s.data.step - 1] = []), d.actions[s.data.step - 1].push(s), this.event.emit("message:action", {
|
|
96
|
+
messageId: d.messageId,
|
|
97
|
+
action: s
|
|
98
|
+
}), this.event.emit("message:updated", d);
|
|
99
|
+
else {
|
|
100
|
+
const f = {
|
|
101
|
+
messageId: "",
|
|
102
|
+
content: "",
|
|
103
|
+
role: k.Robot,
|
|
104
|
+
sessionId: this._id,
|
|
105
|
+
reference: [],
|
|
106
|
+
searchReference: [],
|
|
107
|
+
isLoading: !0,
|
|
108
|
+
messageTime: "",
|
|
109
|
+
actions: [[s]]
|
|
110
|
+
};
|
|
111
|
+
this.pushMessage(f), this.event.emit("message:action", {
|
|
112
|
+
messageId: f.messageId,
|
|
113
|
+
action: s
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (this.inactivating) {
|
|
117
|
+
const f = new Error(
|
|
118
|
+
I.Inactive
|
|
119
|
+
// {
|
|
120
|
+
// cause: {
|
|
121
|
+
// code: -1,
|
|
122
|
+
// message:
|
|
123
|
+
// 'session is inactive, skipping plugin client function call',
|
|
124
|
+
// },
|
|
125
|
+
// }
|
|
126
|
+
);
|
|
127
|
+
u.warn("error", f), this.event.emit("error", f);
|
|
128
|
+
} else if (r === "FUNCTION_CALL" && c) {
|
|
129
|
+
if (u.log(`calling function ${g} of plugin ${m} with argument:
|
|
130
|
+
${JSON.stringify(o)}`), !w.plugins[m]) {
|
|
131
|
+
e({
|
|
132
|
+
code: 404,
|
|
133
|
+
message: "对不起,没有找到插件。"
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const f = w.plugins[m].functions[g];
|
|
138
|
+
typeof f != "function" && e({
|
|
139
|
+
code: 404,
|
|
140
|
+
message: "对不起,没有找到插件方法。"
|
|
141
|
+
});
|
|
142
|
+
let _ = o == null ? void 0 : o.query;
|
|
143
|
+
try {
|
|
144
|
+
_ = JSON.parse(o == null ? void 0 : o.query);
|
|
145
|
+
} catch (M) {
|
|
146
|
+
}
|
|
147
|
+
f(_, (...M) => {
|
|
148
|
+
this._stopAnswer || e(...M);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
})), n.on("answer", (s) => {
|
|
152
|
+
if (!this._stopAnswer)
|
|
153
|
+
if (s.data.code !== 200 && (s.data.index = -1, this.event.emit("error", s.data)), s.data.index === -1) {
|
|
154
|
+
let e = this.messages[this.messages.length - 1];
|
|
155
|
+
if (e && !e.messageId)
|
|
156
|
+
e = l(l({}, e), s.data), this.event.emit("message:content", e), this.event.emit("message:updated", e), this.event.emit("answer:finish", e);
|
|
157
|
+
else {
|
|
158
|
+
const r = l({
|
|
159
|
+
messageId: "",
|
|
160
|
+
content: "",
|
|
161
|
+
role: k.Robot,
|
|
162
|
+
sessionId: this._id,
|
|
163
|
+
reference: [],
|
|
164
|
+
searchReference: [],
|
|
165
|
+
isLoading: !1,
|
|
166
|
+
messageTime: "",
|
|
167
|
+
actions: []
|
|
168
|
+
}, s.data);
|
|
169
|
+
this.event.emit("message:content", r), this.pushMessage(r), this.event.emit("answer:finish", r);
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
let e = this.messages[this.messages.length - 1];
|
|
173
|
+
e && !e.messageId ? (e = l(l({}, e), s.data), this.messages[this.messages.length - 1] = e, this.event.emit("message:content", e), this.event.emit("message:updated", e)) : (this.pushMessage(s.data), this.event.emit("message:content", s.data));
|
|
174
|
+
}
|
|
175
|
+
}), n.on("reference", (s) => p(this, null, function* () {
|
|
176
|
+
if (this._stopAnswer)
|
|
177
|
+
return;
|
|
178
|
+
if (!this._id) {
|
|
179
|
+
const o = new Error(
|
|
180
|
+
I.IdUndefined
|
|
181
|
+
// {
|
|
182
|
+
// cause: SESSION_ERROR_CAUSE[SessionErrors.IdUndefined],
|
|
183
|
+
// }
|
|
184
|
+
);
|
|
185
|
+
u.error(o), this.event.emit("error", o), this.frozen = !1;
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
const {
|
|
189
|
+
type: e,
|
|
190
|
+
data: r,
|
|
191
|
+
requestId: c
|
|
192
|
+
} = s, m = this.messages.findIndex((o) => o.messageId === c && o.role === k.User);
|
|
193
|
+
if (m < 0)
|
|
194
|
+
return;
|
|
195
|
+
const g = m + 1;
|
|
196
|
+
if (g >= this.messages.length) {
|
|
197
|
+
const o = {
|
|
198
|
+
messageId: "",
|
|
199
|
+
content: "",
|
|
200
|
+
role: k.Robot,
|
|
201
|
+
sessionId: this._id,
|
|
202
|
+
reference: [],
|
|
203
|
+
searchReference: [],
|
|
204
|
+
isLoading: !0,
|
|
205
|
+
messageTime: "",
|
|
206
|
+
actions: []
|
|
207
|
+
};
|
|
208
|
+
this.pushMessage(o);
|
|
209
|
+
}
|
|
210
|
+
e === "KG" ? (this.messages[g] = y(l({}, this.messages[g]), {
|
|
211
|
+
reference: r.knowledgeReference
|
|
212
|
+
}), yield this.fillMessageReference(this.messages[g]), this.event.emit("message:reference", r.knowledgeReference), this.event.emit("message:updated", this.messages[g])) : e === "WEB_SEARCH" && (this.messages[g] = y(l({}, this.messages[g]), {
|
|
213
|
+
searchReference: r.knowledgeReference
|
|
214
|
+
}), this.event.emit("message:searchreference", r.searchReference), this.event.emit("message:updated", this.messages[g]));
|
|
215
|
+
})), this.socket = n, n.open();
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
sendQuestion(t, i) {
|
|
219
|
+
return p(this, null, function* () {
|
|
220
|
+
var h, n;
|
|
221
|
+
if (!this.active) {
|
|
222
|
+
if (yield this.activate(), !this.socket) {
|
|
223
|
+
const s = new Error(
|
|
224
|
+
I.SocketConnectionFailed
|
|
225
|
+
// {
|
|
226
|
+
// cause: { code: -1, message: 'socket is null' },
|
|
227
|
+
// }
|
|
228
|
+
);
|
|
229
|
+
return u.warn("error", s), this.event.emit("error", s), !1;
|
|
230
|
+
}
|
|
231
|
+
(h = this.socket) == null || h.emit("question", t);
|
|
232
|
+
}
|
|
233
|
+
(n = this.socket) == null || n.emit("question", t);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
stopAnswer() {
|
|
237
|
+
var t;
|
|
238
|
+
(t = this.socket) == null || t.emit("stop_answer");
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
j as default
|
|
243
|
+
};
|