@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,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as ReactQuill } from 'react-quill';
|
|
3
|
+
interface QuillEditorProp {
|
|
4
|
+
text?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
maxLength?: number;
|
|
7
|
+
networkStatus: boolean;
|
|
8
|
+
onTextSend?: (value?: string) => void;
|
|
9
|
+
onChange?: (text: string, editor: ReactQuill.UnprivilegedEditor) => void;
|
|
10
|
+
clearAction?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface editorRefProps {
|
|
13
|
+
clear: () => void;
|
|
14
|
+
prevent: () => void;
|
|
15
|
+
focus: () => void;
|
|
16
|
+
update: (val?: string) => void;
|
|
17
|
+
}
|
|
18
|
+
declare const QuillEditor: React.ForwardRefExoticComponent<QuillEditorProp & React.RefAttributes<editorRefProps>>;
|
|
19
|
+
export default QuillEditor;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as icon } from './assets/icon.svg';
|
|
2
|
+
import { default as brand } from './assets/brand.svg';
|
|
3
|
+
import { AgentClientUIConfig } from './types';
|
|
4
|
+
export declare const defaultUIConfig: AgentClientUIConfig;
|
|
5
|
+
export declare const defaultApiUrl = "https://copilot.glodon.com/api/cvforcepd";
|
|
6
|
+
export declare const defaultDovViewerUrl = "https://copilot.glodon.com/portal/test/cvforcepd/fe/";
|
|
7
|
+
export { icon, brand };
|
|
8
|
+
export declare const UNNAMED_SESSION_NAME = "\u672A\u547D\u540D\u4F1A\u8BDD";
|
|
9
|
+
export declare const KB = 1024;
|
|
10
|
+
export declare const MB: number;
|
|
11
|
+
export declare const GB: number;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AgentClientDefaultProps } from './types';
|
|
3
|
+
declare const agentClientContext: React.Context<AgentClientDefaultProps>;
|
|
4
|
+
export declare const AgentClientProvider: React.Provider<AgentClientDefaultProps>;
|
|
5
|
+
export default agentClientContext;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AgentClientUIConfig, AgentClientMode, InitalData, Env } from './types';
|
|
2
|
+
import { AgentClientUIApi, ISession } from '@glodon-aiot/apis';
|
|
3
|
+
export default class AgentClientUI {
|
|
4
|
+
private _token;
|
|
5
|
+
private _activeSession;
|
|
6
|
+
private _applicationId;
|
|
7
|
+
private _defaultInputText;
|
|
8
|
+
private _defatulSessionId;
|
|
9
|
+
readonly apiUrl: string;
|
|
10
|
+
readonly docViewerUrl: string;
|
|
11
|
+
readonly env: Env;
|
|
12
|
+
service: AgentClientUIApi;
|
|
13
|
+
private rId;
|
|
14
|
+
_mode: AgentClientMode;
|
|
15
|
+
uiConfig: AgentClientUIConfig;
|
|
16
|
+
errorHandlers: {
|
|
17
|
+
token?: (error: Error) => void;
|
|
18
|
+
};
|
|
19
|
+
wrapper: HTMLElement;
|
|
20
|
+
constructor(config: InitalData);
|
|
21
|
+
get token(): string;
|
|
22
|
+
set token(v: string);
|
|
23
|
+
get mode(): AgentClientMode;
|
|
24
|
+
set mode(v: AgentClientMode);
|
|
25
|
+
get activeSession(): ISession | null;
|
|
26
|
+
get applicationId(): string;
|
|
27
|
+
setService(): AgentClientUIApi;
|
|
28
|
+
reload(): void;
|
|
29
|
+
getMessageList(sessionId?: string): Promise<import('@glodon-aiot/apis').IHistory[]>;
|
|
30
|
+
input(message: string): void;
|
|
31
|
+
render(): void;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { BotClient, AgentPluginMap } from '@glodon-aiot/agent-cli-sdk';
|
|
2
|
+
import { AgentClientUIApi, ICommentParam, ISession, IChatMessage, IHistory } from '@glodon-aiot/apis';
|
|
3
|
+
import { Theme } from 'antd/lib/config-provider/context';
|
|
4
|
+
import { CSSProperties } from 'react';
|
|
5
|
+
export type Env = 'dev' | 'test' | 'prod' | 'local';
|
|
6
|
+
export type AgentClientMode = 'float' | 'inlay';
|
|
7
|
+
export declare enum ApiUrl {
|
|
8
|
+
dev = "https://aiot-dev.glodon.com/api/cvforcepd",
|
|
9
|
+
test = "https://aiot-dev.glodon.com/api/cvforce",
|
|
10
|
+
prod = "https://copilot.glodon.com/api/cvforce",
|
|
11
|
+
local = "http://localhost:3000/api/cvforcepd"
|
|
12
|
+
}
|
|
13
|
+
export interface AgentClientUITransform {
|
|
14
|
+
greet?: boolean;
|
|
15
|
+
sessionList?: boolean;
|
|
16
|
+
sessionOpen?: boolean;
|
|
17
|
+
fileUpload?: boolean;
|
|
18
|
+
imageUpload?: boolean;
|
|
19
|
+
connectNetwork?: boolean;
|
|
20
|
+
userCopy?: boolean;
|
|
21
|
+
userEdit?: boolean;
|
|
22
|
+
userPrompt?: boolean;
|
|
23
|
+
prompt?: boolean;
|
|
24
|
+
relate?: boolean;
|
|
25
|
+
again?: boolean;
|
|
26
|
+
metadata?: boolean;
|
|
27
|
+
reference?: {
|
|
28
|
+
iconVisible?: boolean;
|
|
29
|
+
referenceFirst?: boolean;
|
|
30
|
+
isExpand?: boolean;
|
|
31
|
+
};
|
|
32
|
+
knowledges?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface MessageBoxFooterItem {
|
|
35
|
+
componentName: 'AnswerAgain' | 'Copy' | 'Comments';
|
|
36
|
+
position: 'left' | 'right';
|
|
37
|
+
visible?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface AgentFeaturesConfig {
|
|
40
|
+
greeting?: boolean;
|
|
41
|
+
sessionList?: boolean;
|
|
42
|
+
metadata?: boolean;
|
|
43
|
+
newSession?: boolean;
|
|
44
|
+
fileUpload?: boolean;
|
|
45
|
+
imageUpload?: boolean;
|
|
46
|
+
connectNetwork?: boolean;
|
|
47
|
+
userMessageBox?: {
|
|
48
|
+
copy?: boolean;
|
|
49
|
+
editAgain?: boolean;
|
|
50
|
+
};
|
|
51
|
+
botMessageBox?: {
|
|
52
|
+
referenceFirst?: boolean;
|
|
53
|
+
reference?: {
|
|
54
|
+
file?: boolean;
|
|
55
|
+
itemExpanded?: boolean;
|
|
56
|
+
};
|
|
57
|
+
relatedQuesions?: boolean;
|
|
58
|
+
footer?: {
|
|
59
|
+
items?: MessageBoxFooterItem[];
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
prompts?: boolean;
|
|
63
|
+
knowledges?: boolean | {
|
|
64
|
+
diabled: boolean;
|
|
65
|
+
visible: boolean;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
type CommentListener = (payload: {
|
|
69
|
+
applicationId: string;
|
|
70
|
+
sessionId: string;
|
|
71
|
+
comment: ICommentParam;
|
|
72
|
+
}) => void;
|
|
73
|
+
type MessageListener = (payload: {
|
|
74
|
+
applicationId: string;
|
|
75
|
+
sessionId: string;
|
|
76
|
+
message: IChatMessage;
|
|
77
|
+
}) => void;
|
|
78
|
+
type SessionLoadListener = (payload: {
|
|
79
|
+
applicationId: string;
|
|
80
|
+
sessionId: string;
|
|
81
|
+
session: ISession;
|
|
82
|
+
}) => void;
|
|
83
|
+
type SessionUnloadListener = (payload: {
|
|
84
|
+
applicationId: string;
|
|
85
|
+
sessionId: string;
|
|
86
|
+
session: ISession;
|
|
87
|
+
}) => void;
|
|
88
|
+
type HistoryLoadListener = (payload: {
|
|
89
|
+
applicationId: string;
|
|
90
|
+
sessionId: string;
|
|
91
|
+
histories: IHistory[];
|
|
92
|
+
}) => void;
|
|
93
|
+
export interface AgentClientDefaultProps {
|
|
94
|
+
env?: Env;
|
|
95
|
+
apiUrl?: string;
|
|
96
|
+
mode?: AgentClientMode;
|
|
97
|
+
showHeader?: boolean;
|
|
98
|
+
className?: string;
|
|
99
|
+
triggerButton?: {
|
|
100
|
+
style?: CSSProperties;
|
|
101
|
+
visible?: boolean;
|
|
102
|
+
};
|
|
103
|
+
open?: boolean;
|
|
104
|
+
size?: {
|
|
105
|
+
width?: number | string;
|
|
106
|
+
height?: number | string;
|
|
107
|
+
maxWidth?: number | string;
|
|
108
|
+
maxHeight?: number | string;
|
|
109
|
+
minWidth?: number | string;
|
|
110
|
+
minHeight?: number | string;
|
|
111
|
+
};
|
|
112
|
+
resizable?: boolean;
|
|
113
|
+
theme?: Theme;
|
|
114
|
+
logo?: string;
|
|
115
|
+
icon?: string;
|
|
116
|
+
greeting?: string;
|
|
117
|
+
history?: boolean;
|
|
118
|
+
service?: AgentClientUIApi;
|
|
119
|
+
popupContainer?: React.RefObject<HTMLDivElement>;
|
|
120
|
+
token?: string;
|
|
121
|
+
agentClient?: BotClient;
|
|
122
|
+
debug?: boolean;
|
|
123
|
+
plugins?: AgentPluginMap;
|
|
124
|
+
transform?: AgentClientUITransform;
|
|
125
|
+
rId?: number;
|
|
126
|
+
footer?: HTMLDivElement | string | boolean;
|
|
127
|
+
header?: HTMLDivElement | string | boolean;
|
|
128
|
+
sider?: boolean;
|
|
129
|
+
defaultInput?: {
|
|
130
|
+
text: string;
|
|
131
|
+
};
|
|
132
|
+
depId?: number;
|
|
133
|
+
onComment?: CommentListener;
|
|
134
|
+
onMessage?: MessageListener;
|
|
135
|
+
onSessionLoad?: SessionLoadListener;
|
|
136
|
+
onSessionUnload?: SessionUnloadListener;
|
|
137
|
+
onHistoryLoad?: HistoryLoadListener;
|
|
138
|
+
bodyStyle?: CSSProperties;
|
|
139
|
+
prompts?: boolean;
|
|
140
|
+
features?: AgentFeaturesConfig;
|
|
141
|
+
}
|
|
142
|
+
interface DataEventListeners {
|
|
143
|
+
comment: CommentListener;
|
|
144
|
+
message: MessageListener;
|
|
145
|
+
sessionload: SessionLoadListener;
|
|
146
|
+
sessionunload: SessionUnloadListener;
|
|
147
|
+
historyload: HistoryLoadListener;
|
|
148
|
+
}
|
|
149
|
+
interface UIEventListeners {
|
|
150
|
+
}
|
|
151
|
+
export interface AgentClientUIConfig extends AgentClientDefaultProps {
|
|
152
|
+
getContainer: () => HTMLElement;
|
|
153
|
+
eventListeners?: Partial<DataEventListeners & UIEventListeners>;
|
|
154
|
+
defaultInput?: {
|
|
155
|
+
text: string;
|
|
156
|
+
};
|
|
157
|
+
bodyStyle?: CSSProperties;
|
|
158
|
+
}
|
|
159
|
+
export interface InitalData extends AgentClientUIConfig {
|
|
160
|
+
token: string;
|
|
161
|
+
sessionId?: string;
|
|
162
|
+
apiUrl?: string;
|
|
163
|
+
docViewerUrl?: string;
|
|
164
|
+
plugins?: AgentPluginMap;
|
|
165
|
+
env?: Env;
|
|
166
|
+
debug?: boolean;
|
|
167
|
+
errorHandlers?: {
|
|
168
|
+
token?: (error: Error) => void;
|
|
169
|
+
refreshToken?: () => Promise<string>;
|
|
170
|
+
};
|
|
171
|
+
bodyStyle?: CSSProperties;
|
|
172
|
+
}
|
|
173
|
+
export interface AgentClientProps extends AgentClientDefaultProps {
|
|
174
|
+
service: AgentClientUIApi;
|
|
175
|
+
docViewerUrl: string;
|
|
176
|
+
defaultInput?: {
|
|
177
|
+
text: string;
|
|
178
|
+
};
|
|
179
|
+
bodyStyle?: CSSProperties;
|
|
180
|
+
apiUrl?: string;
|
|
181
|
+
sessionId?: string;
|
|
182
|
+
}
|
|
183
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface CopyToClipboard params
|
|
3
|
+
*/
|
|
4
|
+
interface ICopyToClipboard {
|
|
5
|
+
/** HTML reference identifier ```<div id="foo"></div>``` */
|
|
6
|
+
target?: string;
|
|
7
|
+
/** String value */
|
|
8
|
+
value?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const copyToClipboard: ({ target, value }: ICopyToClipboard) => Promise<boolean>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EventSourceMessage } from './parse';
|
|
2
|
+
export declare const EventStreamContentType = "text/event-stream";
|
|
3
|
+
export interface FetchEventSourceInit extends RequestInit {
|
|
4
|
+
/**
|
|
5
|
+
* The request headers. FetchEventSource only supports the Record<string,string> format.
|
|
6
|
+
*/
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Called when a response is received. Use this to validate that the response
|
|
10
|
+
* actually matches what you expect (and throw if it doesn't.) If not provided,
|
|
11
|
+
* will default to a basic validation to ensure the content-type is text/event-stream.
|
|
12
|
+
*/
|
|
13
|
+
onopen?: (response: Response) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Called when a message is received. NOTE: Unlike the default browser
|
|
16
|
+
* EventSource.onmessage, this callback is called for _all_ events,
|
|
17
|
+
* even ones with a custom `event` field.
|
|
18
|
+
*/
|
|
19
|
+
onmessage?: (ev: EventSourceMessage) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Called when a response finishes. If you don't expect the server to kill
|
|
22
|
+
* the connection, you can throw an exception here and retry using onerror.
|
|
23
|
+
*/
|
|
24
|
+
onclose?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Called when there is any error making the request / processing messages /
|
|
27
|
+
* handling callbacks etc. Use this to control the retry strategy: if the
|
|
28
|
+
* error is fatal, rethrow the error inside the callback to stop the entire
|
|
29
|
+
* operation. Otherwise, you can return an interval (in milliseconds) after
|
|
30
|
+
* which the request will automatically retry (with the last-event-id).
|
|
31
|
+
* If this callback is not specified, or it returns undefined, fetchEventSource
|
|
32
|
+
* will treat every error as retriable and will try again after 1 second.
|
|
33
|
+
*/
|
|
34
|
+
onerror?: (err: any) => number | null | undefined | void;
|
|
35
|
+
/**
|
|
36
|
+
* If true, will keep the request open even if the document is hidden.
|
|
37
|
+
* By default, fetchEventSource will close the request and reopen it
|
|
38
|
+
* automatically when the document becomes visible again.
|
|
39
|
+
*/
|
|
40
|
+
openWhenHidden?: boolean;
|
|
41
|
+
/** The Fetch function to use. Defaults to window.fetch */
|
|
42
|
+
fetch?: typeof fetch;
|
|
43
|
+
}
|
|
44
|
+
export declare function fetchEventSource(input: RequestInfo, { signal: inputSignal, headers: inputHeaders, onopen: inputOnOpen, onmessage, onclose, onerror, openWhenHidden, fetch: inputFetch, ...rest }: FetchEventSourceInit): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fetch';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a message sent in an event stream
|
|
3
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format
|
|
4
|
+
*/
|
|
5
|
+
export interface EventSourceMessage {
|
|
6
|
+
/** The event ID to set the EventSource object's last event ID value. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** A string identifying the type of event described. */
|
|
9
|
+
event: string;
|
|
10
|
+
/** The event data */
|
|
11
|
+
data: string;
|
|
12
|
+
/** The reconnection interval (in milliseconds) to wait before retrying the connection */
|
|
13
|
+
retry?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Converts a ReadableStream into a callback pattern.
|
|
17
|
+
* @param stream The input ReadableStream.
|
|
18
|
+
* @param onChunk A function that will be called on each new byte chunk in the stream.
|
|
19
|
+
* @returns {Promise<void>} A promise that will be resolved when the stream closes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getBytes(stream: ReadableStream<Uint8Array>, onChunk: (arr: Uint8Array) => void): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Parses arbitary byte chunks into EventSource line buffers.
|
|
24
|
+
* Each line should be of the format "field: value" and ends with \r, \n, or \r\n.
|
|
25
|
+
* @param onLine A function that will be called on each new EventSource line.
|
|
26
|
+
* @returns A function that should be called for each incoming byte chunk.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getLines(onLine: (line: Uint8Array, fieldLength: number, isWrap: boolean) => void): (arr: Uint8Array) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Parses line buffers into EventSourceMessages.
|
|
31
|
+
* @param onId A function that will be called on each `id` field.
|
|
32
|
+
* @param onRetry A function that will be called on each `retry` field.
|
|
33
|
+
* @param onMessage A function that will be called on each message.
|
|
34
|
+
* @returns A function that should be called for each incoming line buffer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getMessages(onId: (id: string) => void, onRetry: (retry: number) => void, onMessage?: (msg: EventSourceMessage) => void): (line: Uint8Array, fieldLength: number, isWrap: boolean) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const getFileExtension: (filename: string) => string | undefined;
|
|
2
|
+
export declare const getImageExtension: (url: string) => string | null;
|
|
3
|
+
export declare const removeFileExtension: (filename: string) => string | undefined;
|
|
4
|
+
export declare const formatFileSize: (fileSize: number) => string;
|
|
5
|
+
export declare const removeNewlines: (str: string) => string;
|
|
6
|
+
export declare const removeLeadingAndTrailingBackslashes: (str: string) => string;
|
|
7
|
+
export declare const extractFileName: (fileName: any) => any;
|
|
8
|
+
export declare const getBase64: (file: any) => Promise<string>;
|
|
9
|
+
export declare const JWT: (token: string) => any;
|
|
10
|
+
export declare const isExpired: (token: string) => boolean;
|
|
11
|
+
export declare enum shortCutEnum {
|
|
12
|
+
NETWORK = "\u8BF7\u4F60\u4F18\u5148\u4ECE\u7F51\u7EDC\u4E2D\u641C\u7D22",
|
|
13
|
+
DOCUMENT = "\u8BF7\u4F60\u4F18\u5148\u4ECE\u4EE5\u4E0A\u6587\u4EF6\u4E2D\u641C\u7D22"
|
|
14
|
+
}
|
|
15
|
+
export declare const FILE_NAME_MAX_LENGTH = 40;
|
|
16
|
+
export declare const isValidImageUrlWithAnyExtension: (url: string) => boolean;
|
|
17
|
+
export declare const fileTypes: string[];
|
package/package.json
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@glodon-aiot/agent-cli-ui",
|
|
3
|
+
"version": "2.4.7",
|
|
4
|
+
"module": "./dist/es/index.mjs",
|
|
5
|
+
"main": "./dist/lib/index.js",
|
|
6
|
+
"typings": "./dist/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
"import": "./dist/es/index.mjs",
|
|
9
|
+
"require": "./dist/lib/index.js",
|
|
10
|
+
"type": "./dist/src/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "vite",
|
|
18
|
+
"start": "vite",
|
|
19
|
+
"build": "tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod",
|
|
20
|
+
"build:pre": "tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod",
|
|
21
|
+
"preview": "vite preview",
|
|
22
|
+
"check": "yarn prettier --check .",
|
|
23
|
+
"write": "yarn prettier --write .",
|
|
24
|
+
"lint": "eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js",
|
|
25
|
+
"storybook": "start-storybook -p 6006 -s public",
|
|
26
|
+
"build-storybook": "build-storybook -s public",
|
|
27
|
+
"docs": "start-storybook -p 6006",
|
|
28
|
+
"commit": "cz",
|
|
29
|
+
"vpublish:major": "sh ./publish.sh major",
|
|
30
|
+
"vpublish:minor": "sh ./publish.sh minor",
|
|
31
|
+
"vpublish:patch": "sh ./publish.sh patch",
|
|
32
|
+
"vpublish:premajor": "sh ./publish.sh premajor",
|
|
33
|
+
"vpublish:preminor": "sh ./publish.sh preminor",
|
|
34
|
+
"vpublish:prepatch": "sh ./publish.sh prepatch",
|
|
35
|
+
"vpublish:prerelease": "sh ./publish.sh prerelease",
|
|
36
|
+
"vpublish": "npm publish --registry=https://packages.glodon.com/artifactory/api/npm/npm-GGM-releases/"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"webpack": "*"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@ant-design/icons": "^5.3.4",
|
|
43
|
+
"@glodon-aiot/agent-cli-sdk": "^2.4.7",
|
|
44
|
+
"@glodon-aiot/apis": "^2.4.7",
|
|
45
|
+
"antd": "4.x",
|
|
46
|
+
"axios": "0.24.0",
|
|
47
|
+
"dayjs": "^1.11.13",
|
|
48
|
+
"lodash": "^4.17.21",
|
|
49
|
+
"react": "^17.0.2",
|
|
50
|
+
"react-dom": "^17.0.2",
|
|
51
|
+
"react-infinite-scroll-component": "^6.1.0",
|
|
52
|
+
"react-markdown": "^9.0.1",
|
|
53
|
+
"react-quill": "^2.0.0",
|
|
54
|
+
"react-resizable": "^3.0.5",
|
|
55
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
56
|
+
"rehype-external-links": "^3.0.0",
|
|
57
|
+
"rehype-raw": "^7.0.0",
|
|
58
|
+
"remark-gfm": "^4.0.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@babel/core": "^7.20.12",
|
|
62
|
+
"@commitlint/cli": "^17.0.3",
|
|
63
|
+
"@commitlint/config-conventional": "^17.0.3",
|
|
64
|
+
"@rollup/plugin-commonjs": "^28.0.0",
|
|
65
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
66
|
+
"@storybook/addon-actions": "6.3.6",
|
|
67
|
+
"@storybook/addon-essentials": "6.4.9",
|
|
68
|
+
"@storybook/addon-interactions": "^6.5.16",
|
|
69
|
+
"@storybook/addon-links": "6.3.5",
|
|
70
|
+
"@storybook/addon-postcss": "2.0.0",
|
|
71
|
+
"@storybook/builder-vite": "^0.4.0",
|
|
72
|
+
"@storybook/node-logger": "6.4.9",
|
|
73
|
+
"@storybook/react": "6.4.9",
|
|
74
|
+
"@storybook/testing-library": "^0.0.13",
|
|
75
|
+
"@types/lodash": "^4",
|
|
76
|
+
"@types/react": "^17.0.44",
|
|
77
|
+
"@types/react-dom": "^17.0.17",
|
|
78
|
+
"@types/react-syntax-highlighter": "^15",
|
|
79
|
+
"@typescript-eslint/eslint-plugin": "^5.35.1",
|
|
80
|
+
"@typescript-eslint/parser": "^5.35.1",
|
|
81
|
+
"@vitejs/plugin-react": "^3.1.0",
|
|
82
|
+
"babel-loader": "^8.3.0",
|
|
83
|
+
"commitizen": "^4.3.0",
|
|
84
|
+
"css-loader": "^6.7.3",
|
|
85
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
86
|
+
"cz-customizable": "^7.0.0",
|
|
87
|
+
"eslint": "^8.0.1",
|
|
88
|
+
"eslint-config-prettier": "^8.5.0",
|
|
89
|
+
"eslint-config-standard-with-typescript": "^22.0.0",
|
|
90
|
+
"eslint-plugin-import": "^2.25.2",
|
|
91
|
+
"eslint-plugin-n": "^15.0.0",
|
|
92
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
93
|
+
"eslint-plugin-react": "^7.31.0",
|
|
94
|
+
"eslint-plugin-storybook": "^0.6.10",
|
|
95
|
+
"husky": ">=6",
|
|
96
|
+
"less": "^4.1.2",
|
|
97
|
+
"less-loader": "^11.1.0",
|
|
98
|
+
"lint-staged": ">=10",
|
|
99
|
+
"postcss-loader": "^7.2.4",
|
|
100
|
+
"prettier": "2.7.1",
|
|
101
|
+
"require-from-string": "^2.0.2",
|
|
102
|
+
"rollup-plugin-visualizer": "^5.12.0",
|
|
103
|
+
"storybook-less-loader": "^0.1.0",
|
|
104
|
+
"typescript": "*",
|
|
105
|
+
"vite": "^4.1.1",
|
|
106
|
+
"vite-plugin-css-injected-by-js": "^3.5.0",
|
|
107
|
+
"vite-plugin-dts": "^4.3.0"
|
|
108
|
+
},
|
|
109
|
+
"lint-staged": {
|
|
110
|
+
"*.{js,css,md,jsx,less,ts,tsx,json}": "prettier --write"
|
|
111
|
+
},
|
|
112
|
+
"production": [
|
|
113
|
+
">0.2%",
|
|
114
|
+
"not dead",
|
|
115
|
+
"not op_mini all"
|
|
116
|
+
],
|
|
117
|
+
"development": [
|
|
118
|
+
"last 1 chrome version",
|
|
119
|
+
"last 1 firefox version",
|
|
120
|
+
"last 1 safari version"
|
|
121
|
+
],
|
|
122
|
+
"publishConfig": {
|
|
123
|
+
"access": "public"
|
|
124
|
+
},
|
|
125
|
+
"config": {
|
|
126
|
+
"commitizen": {
|
|
127
|
+
"path": "node_modules/cz-customizable"
|
|
128
|
+
},
|
|
129
|
+
"cz-customizable": {
|
|
130
|
+
"config": ".cz-config.cjs"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"husky": {
|
|
134
|
+
"hooks": {
|
|
135
|
+
"commit-msg": "validate-commit-msg"
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|