@glodon-aiot/agent-cli-ui 3.25.1-alpha.3 → 3.25.1-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.mjs +4 -4
- package/dist/lib/index.js +1 -1
- package/package.json +4 -4
package/dist/es/index.mjs
CHANGED
|
@@ -5125,7 +5125,7 @@ const uI = RN((M, N) => {
|
|
|
5125
5125
|
})]
|
|
5126
5126
|
})
|
|
5127
5127
|
});
|
|
5128
|
-
}), nI = "@glodon-aiot/agent-cli-ui", LI = "3.25.1-alpha.
|
|
5128
|
+
}), nI = "@glodon-aiot/agent-cli-ui", LI = "3.25.1-alpha.4", AI = "./dist/es/index.mjs", yI = "./dist/lib/index.js", cI = "./dist/src/index.d.ts", aI = {
|
|
5129
5129
|
import: "./dist/es/index.mjs",
|
|
5130
5130
|
require: "./dist/lib/index.js",
|
|
5131
5131
|
types: "./dist/src/index.d.ts"
|
|
@@ -5147,9 +5147,9 @@ const uI = RN((M, N) => {
|
|
|
5147
5147
|
commit: "cz"
|
|
5148
5148
|
}, OI = {
|
|
5149
5149
|
"@ant-design/icons": "^5.3.4",
|
|
5150
|
-
"@glodon-aiot/apis": "^3.25.1-alpha.
|
|
5151
|
-
"@glodon-aiot/bot-client-sdk": "^3.25.1-alpha.
|
|
5152
|
-
"@glodon-aiot/react-components": "^3.25.1-alpha.
|
|
5150
|
+
"@glodon-aiot/apis": "^3.25.1-alpha.4",
|
|
5151
|
+
"@glodon-aiot/bot-client-sdk": "^3.25.1-alpha.4",
|
|
5152
|
+
"@glodon-aiot/react-components": "^3.25.1-alpha.4",
|
|
5153
5153
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
5154
5154
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
5155
5155
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|
package/dist/lib/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
${t}`:t}if(N&&N.length>0){const D=N.filter(Boolean).map(z=>``).join(`
|
|
10
10
|
`);t=D?`${D}
|
|
11
11
|
${t}`:t}}return t},ig=M=>{const N=Math.floor(M/3600),e=Math.floor(M%3600/60),j=M%60,t=D=>String(D).padStart(2,"0");return`${t(N)}:${t(e)}:${t(j)}`},Dg=g.forwardRef((M,N)=>{var Ot,Yt,xt,dt,wt,Et,Qt,ht,St,kt,mt,Ut,ft,pt;const{application:e,docViewerUrl:j="",currentSession:t,onCreateSession:D,embeddingService:z,setCurrentSession:I,networkStatus:u,setNetworkStatus:y}=M,[s,T]=g.useState([]),[A,c]=g.useState(),[a,S]=g.useState(),w=g.useRef(null),{service:m,agentClient:Q,depId:k,footer:U,transform:O,defaultInput:Z,onMessage:B,onHistoryLoad:$,beforeMessageSend:x,bodyStyle:q,disabled:p,features:o,popupContainer:b,icon:NM,sider:LM,mode:AM,silencedSeconds:lM}=g.useContext(FM),[dM,vM]=g.useState(!1),iM=g.useRef(s),WM=g.useRef(void 0),ZM=g.useRef(new Set),[E,V]=g.useState(0),[cM,hM]=g.useState([]),[_M,F]=g.useState([]),[CM,wM]=g.useState(0),[X,C]=g.useState(!1);g.useEffect(()=>{C(CM>0)},[CM]);const G=g.useRef(null),[_,H]=g.useState([]),[gM,Y]=g.useState(!1),[f,r]=g.useState(!1),[IM,tM]=g.useState(""),[aM,rM]=g.useState(),[QM,GM]=g.useState({}),BM=g.useRef(null),lN=g.useRef(null),mM=g.useRef(null),[EM,$M]=g.useState(!1),[VM,GN]=g.useState([]),[HM,we]=g.useState(!0),[OD,YD]=g.useState(!0),[it,yN]=g.useState(!1),[gj,CN]=g.useState(!1),[Dt,xD]=g.useState(!1),[uN,ze]=g.useState(typeof(o==null?void 0:o.promptVariables)=="object"?o.promptVariables.default||[]:[]),[dD,wD]=g.useState(()=>{const n=typeof(o==null?void 0:o.knowledges)=="object"&&o.knowledges.default||void 0;if(n){if(Array.isArray(n)&&n.some(P=>Array.isArray(P.fileIds)&&P.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(We(n)>fN)throw Error(`knowledges and fileIds total count cannot exceed ${fN}`)}return n}),[zt,PN]=g.useState(!1),[gt,ge]=g.useState(!1),[ED,Ie]=g.useState(typeof(o==null?void 0:o.connectNetwork)=="object"&&typeof(o==null?void 0:o.connectNetwork.default)=="boolean"?o.connectNetwork.default:!1),[It,Ee]=g.useState(!1),[QD,mN]=g.useState(!1),[hD,SD]=g.useState(null),[Qe,RN]=g.useState(!1),[st,ut]=g.useState(!1),{isSwitchingToExistingSession:Tt,setIsSwitchingToExistingSession:he}=fj(),XN=g.useRef(null),[Ij,kD]=g.useState("");g.useEffect(()=>{if(!lM)return;let n=ig(lM);kD(n)},[lM]),g.useEffect(()=>{if(SD(t),t===null)mN(!1);else if(t===void 0)mN(!0);else{if(hD===null){if(Tt){mN(!0),he(!1);return}mN(!1);return}t.ready?mN(!1):mN(!0)}},[t,t==null?void 0:t.ready,Tt]),g.useEffect(()=>{var d,P;t&&(iM.current=[]),T([]);const n=w.current;if(n&&n.scrollTo({top:0}),!((d=t==null?void 0:t.data)!=null&&d.id))return;if(CN(!1),yN(!1),(P=t.messages)!=null&&P.length){const eM=[...t.messages.filter(K=>K==null?void 0:K.messageId)].reverse();iM.current=[...eM],T([...eM]),mN(!1)}const l=v=>{var eM;(eM=t==null?void 0:t.data)!=null&&eM.id&&(iM.current=[...v].reverse(),T([...v].reverse()),!v||v.length<10?ge(!1):ge(!0),mN(!1),$&&$({applicationId:e.id,sessionId:t.data.id,histories:v}))};return t.addEventListener("history:loaded",l),()=>{iM.current=[],T([]),t==null||t.removeEventListener("history:loaded",l)}},[t]),g.useEffect(()=>{const n=()=>{var l;(l=t==null?void 0:t.data)!=null&&l.id&&(t.promptVariables&&ze(t.promptVariables.sort((d,P)=>d.key.localeCompare(P.key))),t.knowledges&&wD(t.knowledges),y(t.netOpen))};return t==null||t.addEventListener("data:updated",n),()=>{t==null||t.removeEventListener("data:updated",n)}},[t]),g.useEffect(()=>{var l;if(!((l=t==null?void 0:t.data)!=null&&l.id))return;const n=d=>{var P;console.error(d.message,d.cause,"e.case"),L.notification.config({getContainer:()=>(b==null?void 0:b.current)||document.body,prefixCls:"gbot-notification"}),L.notification.error({message:((P=d.cause)==null?void 0:P.message)||d.message}),L.notification.config({getContainer:void 0,prefixCls:"gbot-notification"})};return t.addEventListener("error",n),()=>{t==null||t.removeEventListener("error",n)}},[t]);const mD=()=>{var d;if(!((d=t==null?void 0:t.data)!=null&&d.id)||!(e!=null&&e.id))return;const n=t.data.id,l=s[s.length-1];if(l&&l.isContext){jN("success","已开启新话题");return}else t.clear().then(()=>{const P=new ZN("",n,R.IHistoryRole.System);P.isContext=!0,T([P,...s])})};g.useEffect(()=>{e!=null&&e.id&&(m==null||m.getRecommendQues(e.id).then(n=>{H(n)}))},[k,e]);const sj=n=>zM(exports,null,function*(){var MN,sM;if(p)return jN("error","发送功能被禁用"),!1;const l=n||A;if(!(l!=null&&l.trim()))return jN("error","请输入你想问的"),!1;if(!(uN==null?void 0:uN.every(PM=>!!(PM!=null&&PM.value)))){if(O!=null&&O.promptVariables)return jN("error","变量值不能为空"),!1;console.error("变量值不能为空",uN==null?void 0:uN.map(PM=>!!(PM!=null&&PM.value)))}if(gj)return jN("error","正在回复中"),!1;if(dM)return jN("error","等待初始化"),!1;if(!HM)return jN("error","正在解析文件"),!1;if(X)return jN("error","正在上传图片"),!1;hM([]),F([]);const P=(MN=t==null?void 0:t.data)==null?void 0:MN.id;if(!P)return Qe?!1:(RN(!0),D==null||D({netOpen:u?UN.OPEN:UN.CLOSE}).then(PM=>{var DM,NN;PN(!0),y(!!((DM=PM.data)!=null&&DM.netOpen)),Ie(!!((NN=PM.data)!=null&&NN.enableNetOpen)),uj(PM).then(()=>{I==null||I(PM),PN(!1),S(l)})}).catch(PM=>{RN(!1)}),!0);if(Qe)return!1;RN(!0),Ee(!0);const v=aj(l,_M,QM[P],(e==null?void 0:e.type)||0);let eM;try{x?eM=yield x==null?void 0:x({applicationId:e.id,sessionId:P,message:{content:v,sessionId:P,role:R.ChatMessageRole.User,files:QM[P]}}):eM=!0}catch(PM){eM=!1}if(Ee(!1),eM===!1)return RN(!1),!1;let K=l;typeof eM=="object"&&(K=eM.content||l);const SM=yield(()=>new Promise(PM=>{ze(DM=>(PM(DM),DM))}))();return(yield t.setPromptVariables(SM))?(((sM=QM[P])==null?void 0:sM.length)>0?yield UD(K):yield Tj(K),!0):(RN(!1),!1)}),uj=n=>new Promise((l,d)=>zM(exports,null,function*(){const eM=(n==null?void 0:n.promptVariables).filter(K=>K.type?!((K.type===R.PromptVariableType.User||K.type===void 0)&&K.key==="query")&&!((K.type===R.PromptVariableType.System||K.type===void 0)&&K.key==="datetime"):K.key!=="query").map(K=>{var SM;const fM=(SM=uN.find(MM=>MM.key===K.key&&MM.type===K.type))==null?void 0:SM.value;return K.value=fM||"",K});ze(eM.sort((K,fM)=>K.key.localeCompare(fM.key))),yield n==null?void 0:n.setPromptVariables(eM).catch(K=>{console.error(K),jN("error",K.message)}),l()})),UD=n=>{var v,eM,K;if(we(!1),!((v=t==null?void 0:t.data)!=null&&v.id)||!(e!=null&&e.id))return;const l=((eM=t.data)==null?void 0:eM.id)||"";let d=[],P=new Set;return(K=QM[l])==null||K.forEach(fM=>{P.has(fM.id)||(d.push(fM),P.add(fM.id))}),we(!0),Tj(n,d)};g.useEffect(()=>{if(!a||!t)return;const n=a,l=()=>zM(exports,null,function*(){Ee(!0);const d=aj(n,_M,QM[t.id],(e==null?void 0:e.type)||0);let P;try{x?P=yield x==null?void 0:x({applicationId:e.id,sessionId:t.id,message:{content:d,sessionId:t.id,role:R.ChatMessageRole.User,files:QM[t.id]}}):P=!0}catch(v){P=!1}if(Ee(!1),P===!1){RN(!1);return}Tj(n),S(void 0)});return t.ready?l():t.addEventListener("ready",l,!0),()=>{t==null||t.removeEventListener("ready",l)}},[a,t]);const Tj=(n,l)=>zM(exports,null,function*(){var MN,sM,PM;const d=(MN=t==null?void 0:t.data)==null?void 0:MN.id;if(!d)return;CN(!0),yN(!0);const P=aj(n,_M,l,(e==null?void 0:e.type)||0);let v;if(e.type===R.ApplicationTypes.Agent)v=void 0;else if(e.type===R.ApplicationTypes.Dialog&&((sM=e.arrange)!=null&&sM.length)&&e.arrange[0].visionOpen){const DM=_M&&_M.length?_M.filter(Boolean):[];v=DM.length?DM:void 0}else v=void 0;const eM=new ZN(P,d,R.IHistoryRole.User,l,v);c(void 0),rM(void 0),iM.current=[eM,...s],T(iM.current),e.id&&B&&B({applicationId:e.id,sessionId:d,message:eM});const K=new ZN("",d,R.IHistoryRole.System);K.isWaiting=!0,iM.current=[K,...iM.current],T(iM.current);const fM=(l==null?void 0:l.filter(DM=>!DM.localAttachment).map(DM=>DM.id))||[],SM={stream:Le.configuration.stream,referenceFirst:!1};if(O!=null&&O.promptVariables){const DM=uN==null?void 0:uN.reduce((NN,ON)=>(NN[ON.key]=ON.value,NN),{});SM.formatValues=DM}if(O!=null&&O.knowledges){const DM=dD;SM.knowledges=DM}const MM={text:P,fileIds:fM,files:l,uuid:eM.messageId};v&&v.length>0&&(MM.imageContent=v),t.ready||(yield new Promise(DM=>{t.addEventListener("ready",()=>DM(),!0)})),yield t.send(MM,SM),GM({[d]:[]}),(PM=BM.current)==null||PM.update({keepLocalAttachments:!1}),hM([]),F([]),RN(!1)});g.useEffect(()=>{var SM;const n=(SM=t==null?void 0:t.data)==null?void 0:SM.id;if(!n)return;let l=null,d=null,P="";const v=()=>{l=null,d&&(T([d,...iM.current]),d=null)},eM=()=>{l!==null&&(cancelAnimationFrame(l),l=null,d=null)},K=MM=>{if(!MM.sessionId||MM.sessionId&&MM.sessionId!==WM.current)return;if(MM.role===R.IHistoryRole.User){if(iM.current.some(se=>se.messageId&&se.messageId===MM.messageId))return;const NN=new ZN(MM.content,n,R.IHistoryRole.User,MM.files,MM.imageContent);NN.messageId=MM.messageId||NN.messageId,NN.renderKey=NN.messageId;const ON=new ZN("",n,R.IHistoryRole.System);ON.isWaiting=!0,iM.current=iM.current.filter(se=>!se.isWaiting),iM.current=[ON,NN,...iM.current],T(iM.current),yN(!0),CN(!0),e.id&&B&&B({applicationId:e.id,sessionId:n,message:NN});return}if(MM.index===-1&&MM.code!==200&&MM.code!==11915&&MM.code!==11916&&(eM(),yN(!1),CN(!1),iM.current=iM.current.filter(DM=>!DM.isWaiting),T([...iM.current]),iM.current=[...iM.current],MM.content)){L.notification.config({getContainer:()=>(b==null?void 0:b.current)||document.body,prefixCls:"gbot-notification"}),L.notification.error({message:MM.content}),L.notification.config({getContainer:void 0,prefixCls:"gbot-notification"});return}const MN=MM.actions||[],sM=new ZN(MM.content,n,R.IHistoryRole.Robot);sM.reasoningContent=MM.reasoningContent,sM.searchReference=MM.searchReference,sM.thinkingSecs=MM.thinkingSecs,sM.thinkingStatus=MM.thinkingStatus,sM.actions=MN,sM.isLoading=!0,sM.searchingStatus=MM.searchingStatus;const PM=iM.current.some(DM=>DM.isWaiting);if(iM.current=iM.current.filter(DM=>!DM.isWaiting).filter(DM=>!DM.isReplying),PM&&(P=""),sM.renderKey=P||MM.messageId||sM.messageId,P=sM.renderKey,sM.messageId=MM.messageId||sM.renderKey,MM.index===void 0){d=sM,l===null&&(l=requestAnimationFrame(v));return}if(eM(),(MM.code===11915||MM.code===11916)&&(yN(!1),CN(!1),sM.isLoading=!1,sM.content=MM.code===11916?"尊敬的用户您好,让我们换个话题再聊聊吧。":"请您换个问题问我吧~",sM.isSensitive=!0,T([sM,...iM.current])),MM.index===-2&&(yN(!1),CN(!1),sM.isLoading=!1,sM.content="回答已中止~",sM.isSuspend=!0,T([sM,...iM.current])),MM.index===-1&&(yN(!1),CN(!1),sM.isLoading=!1,sM.reference=MM.reference,T([sM,...iM.current]),e.id)){const DM=sM.messageId;ZM.current.has(DM)||(ZM.current.add(DM),B&&B({applicationId:e.id,sessionId:n,message:sM}))}MM.index===-3&&(yN(!1),CN(!1),sM.isLoading=!1,sM.reference=MM.reference,sM.relatedQuesion=MM.relatedQuesion,T([sM,...iM.current]))},fM=()=>{t.addEventListener("message:updated",K)};return t.ready?t.addEventListener("message:updated",K):t.addEventListener("ready",fM),()=>{eM(),t==null||t.removeEventListener("message:updated",K),t==null||t.removeEventListener("ready",fM)}},[t]),g.useEffect(()=>{if(!t){vM(!1);return}const n=l=>{vM(l)};return vM(t.frozen),t.addEventListener("frozen",n),()=>{t==null||t.removeEventListener("frozen",n)}},[t]),g.useEffect(()=>{if(!Q)return;const n=Q.questionContextMaxLength||4e3;V(n)},[Q,m]),g.useEffect(()=>{Z&&rM(Z.text)},[Z]);const jN=(n,l,d)=>{gN(b,()=>{L.message.open({type:n,content:l,key:d})})},nt=n=>{const l=n.size;return l<=0?(jN("error","该文件为空,请重新上传"),!1):l>cj*Re?(jN("error",`图片须小于${cj}M`),!1):(hM(d=>d.length>=_N?(jN("warning",`图片最多上传${_N}张`),d):[...d,n]),!1)},fD=()=>{var n;return(e.type===R.ApplicationTypes.Agent&&(O==null?void 0:O.imageUpload)||e.type===R.ApplicationTypes.Dialog&&((n=e.arrange)==null?void 0:n.length)&&!!e.arrange[0].visionOpen&&(O==null?void 0:O.imageUpload))&&!p},pD=()=>!!z&&(O==null?void 0:O.fileUpload)&&(e==null?void 0:e.id)&&!p,Lt=n=>{var sM,PM;const l=Array.from(n||[]).filter(Boolean);if(!l.length)return;const d=fD(),P=pD(),v=[],eM=[];let K=0,fM=0,SM=0;l.forEach(DM=>{var bt,vt,Gt;if(((bt=DM.type)==null?void 0:bt.startsWith("image/"))||!!Bt(DM.name)){d?v.push(DM):K++;return}const ON=(Gt=(vt=DM.name)==null?void 0:vt.split(".").pop())==null?void 0:Gt.toLowerCase();if(oi(DM)){P&&e.type===R.ApplicationTypes.Agent?eM.push(DM):SM++;return}if(ri.includes(DM.type)||["pdf","doc","docx"].includes(ON||"")){P?eM.push(DM):fM++;return}SM++});const MM=[],MN=K+fM+SM;if(!P&&!d)MN&&MM.push(`当前不支持上传文件/图片,已忽略${MN}个文件`);else if(P&&!d){const DM=K+SM;DM&&MM.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${DM}个其他类型文件`)}else if(!P&&d){const DM=fM+SM;DM&&MM.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${DM}个其他类型文件`)}else SM&&MM.push(`存在不支持的文件类型,已忽略${SM}个文件`);if(MM.length&&jN("warning",MM.join(";"),"precheck-warn"),v.length){const DM=Math.max(0,_N-cM.length),NN=v.slice(0,DM);NN.forEach(ON=>nt(ON)),v.length>NN.length&&jN("warning",`最多上传${_N}张图片`)}eM.length&&((PM=(sM=BM.current)==null?void 0:sM.appendFiles)==null||PM.call(sM,eM))},At=n=>{var d;const l=(d=n.clipboardData)==null?void 0:d.files;l&&l.length&&(n.preventDefault(),n.stopPropagation(),Lt(l))},yt=n=>{n.preventDefault()},ct=n=>{var d;n.preventDefault(),n.stopPropagation();const l=(d=n.dataTransfer)==null?void 0:d.files;l&&l.length&&Lt(l)},at=()=>zM(exports,null,function*(){var n;return(n=t==null?void 0:t.data)!=null&&n.id?t:(XN.current||(XN.current=new Promise((l,d)=>{PN(!0),D==null||D({netOpen:u?UN.OPEN:UN.CLOSE}).then(P=>{var v,eM;I==null||I(P),PN(!1),y(!!((v=P.data)!=null&&v.netOpen)),Ie(!!((eM=P.data)!=null&&eM.enableNetOpen)),uj(P),l(P)}).catch(P=>{XN.current=null,d(P)})})),XN.current)}),bD=n=>zM(exports,null,function*(){const l=yield at();return vD(l,n)}),vD=(n,l)=>{const d=Bt(l.name);return new Promise(P=>{var eM;const v={files:[`${je.v4()}.${d}`],isv:"minio",knowledgeId:((eM=n.data)==null?void 0:eM.id)||"",type:1};m==null||m.postTicket(v).then(K=>{m.uploadMinioFile(K.minio,l).then(()=>{var MN,sM;const fM=(MN=K.minio.endpoints)==null?void 0:MN[0],SM=K.minio.bucket,MM=(sM=K.minio.fileKeys)==null?void 0:sM[0];P(`${K.minio.useSSL?"https:":location.protocol}//${fM}/${SM}/${MM}`)}).catch(()=>{})}).catch(()=>{})})};g.useEffect(()=>{const n=w.current;n&&!Dt&&n.scrollTo({top:n.scrollHeight})},[s]);const rt=(n,l)=>new Promise(d=>{if(!l.file.url||!(e!=null&&e.id))return d();const P=qM(uM({},l.file),{type:1});m==null||m.postApplicationIdSessionKnowledgeSessionFile(e==null?void 0:e.id,n,P).finally(()=>{var v;(v=BM.current)==null||v.update().finally(d)})}),GD=()=>{var n;(n=t==null?void 0:t.data)!=null&&n.id&&(yN(!1),t.suspend())},PD=n=>{const l=w.current;l&&setTimeout(()=>{l.scrollTo({top:l.scrollHeight,behavior:n==null?void 0:n.behavior})},n==null?void 0:n.ms)},RD=()=>{if(!w.current)return;const n=w.current.scrollTop<=-80;xD(n)},WD=HN.useMemoizedFn(n=>{var l,d;(l=G.current)==null||l.update(n),(d=G.current)==null||d.focus()}),ZD=HN.useMemoizedFn(n=>{sj(n)}),_D=HN.useMemoizedFn(()=>{var l;if(!((l=t==null?void 0:t.data)!=null&&l.id))return;iM.current=[...s.slice(1,s.length)],T(iM.current);const n=new ZN("",t.data.id,R.IHistoryRole.System);n.isWaiting=!0,iM.current=[n,...iM.current],T(iM.current),CN(!0),yN(!0),t.answerAgain()});g.useEffect(()=>{var n,l;WM.current=(n=t==null?void 0:t.data)==null?void 0:n.id,!zt&&((l=mM.current)==null||l.clear())},[t]);const JD=()=>{var d;if(!((d=t==null?void 0:t.data)!=null&&d.id))return;const l=s[s.length-1].messageTime;t.fetchMessages({endTime:l,pageSize:qt}).then(P=>{const v=P||[];if(!v||!(v!=null&&v.length)){ge(!1);return}v.length<10?ge(!1):ge(!0),T([...s,...v.reverse()])})},BD=n=>zM(exports,null,function*(){var l,d;if(!((l=t==null?void 0:t.data)!=null&&l.id))y(n);else{if(yield t.setNetOpen(n),!((d=t.data)!=null&&d.id))return;y(n)}}),nj=()=>zM(exports,null,function*(){t?t.fetchData().then(n=>{var l;(l=t==null?void 0:t.data)!=null&&l.id&&(y(n.netOpen),Ie(n.enableNetOpen))}):(y(typeof(o==null?void 0:o.connectNetwork)=="object"&&typeof(o==null?void 0:o.connectNetwork.default)=="boolean"?o.connectNetwork.default:!1),Ie(e.arrange[0].enableNetOpen))});g.useEffect(()=>{nj()},[t]),g.useEffect(()=>{let n=null,l=null;const d=()=>{var MM,MN;if(!w.current)return;const v=document.getElementById("chat-main"),eM=(MM=w.current)==null?void 0:MM.querySelector(".infinite-scroll-component__outerdiv"),K=(MN=w.current)==null?void 0:MN.querySelector(".infinite-scroll-component");if(!eM||!K||!v)return;const fM=v.offsetHeight;if(K.offsetHeight<=fM){if(eM.style.height==="100%")return;eM.style.height="100%"}else{if(eM.style.height==="auto")return;eM.style.height="auto"}},P=()=>{var K;if(typeof ResizeObserver=="undefined"||!w.current)return;const v=document.getElementById("chat-main"),eM=(K=w.current)==null?void 0:K.querySelector(".infinite-scroll-component");!eM||!v||(l=new ResizeObserver(()=>{d()}),l.observe(eM),l.observe(v))};return n=requestAnimationFrame(()=>{d(),P()}),()=>{n!==null&&cancelAnimationFrame(n),l==null||l.disconnect()}},[s]),g.useEffect(()=>{if(t)return;const n=()=>{const P=((Q==null?void 0:Q.promptVariables)||[]).filter(v=>v.type?!(v.type===R.PromptVariableType.User&&v.key==="query")&&!(v.type===R.PromptVariableType.System&&v.key==="datetime")&&v.status===1:v.key!=="query"&&v.status===1).map((v,eM)=>{var fM,SM;let K="";return typeof(o==null?void 0:o.promptVariables)=="object"&&(K=((SM=(fM=o.promptVariables.default)==null?void 0:fM.find(MM=>MM.key===v.key&&MM.type===v.type))==null?void 0:SM.value)||""),{id:eM+"",key:v.key,name:v.name,value:K,type:v.type}});ze([...P].sort((v,eM)=>v.key.localeCompare(eM.key)))};return Q!=null&&Q.ready?n():Q==null||Q.addEventListener("ready",n),()=>{Q==null||Q.removeEventListener("ready",n)}},[t,Q,o==null?void 0:o.promptVariables]);const ot=()=>D==null?void 0:D({netOpen:u?UN.OPEN:UN.CLOSE}).then(n=>{var l,d;return I==null||I(n),PN(!1),y(!!((l=n.data)!=null&&l.netOpen)),Ie(!!((d=n.data)!=null&&d.enableNetOpen)),uj(n),n}),lt=!!s.length,Ct=g.useMemo(()=>{var n;return e.arrange&&((n=e.arrange[0])!=null&&n.openingContent)?i.jsx(Oi,{application:e,history:{role:1,content:e.arrange[0].openingContent,code:200,messageId:"opening-message",sessionId:"",reference:[],searchReference:[],messageTime:XM(Date.now()).format("YYYY-MM-DD HH:mm:ss"),actions:[],isLoading:!1},actions:lt,markdown:o==null?void 0:o.markdown}):null},[e==null?void 0:e.arrange,lt]);return g.useImperativeHandle(N,()=>({getCurrentInputText:()=>{var n;return(n=G.current)==null?void 0:n.getCurrentText()},send:n=>zM(exports,null,function*(){if(!(yield sj(n)))throw new Error("send was blocked")})})),g.useEffect(()=>{var l;const n=(l=t==null?void 0:t.data)==null?void 0:l.id;n&&GM(d=>qM(uM({},d),{[n]:[]}))},[(Ot=t==null?void 0:t.data)==null?void 0:Ot.id]),i.jsxs("div",{className:"agent-chat",children:[QD?i.jsx("div",{className:"session-loading",children:i.jsx(L.Spin,{})}):i.jsxs(i.Fragment,{children:[(O==null?void 0:O.promptVariables)&&i.jsx(wi,{ref:lN,appId:e.id,currentSession:t,promptVariables:uN,setPromptVariables:ze,setCurrentSession:I}),i.jsxs("div",{className:"chat-main",id:"chat-main",style:q,children:[i.jsx("div",{className:"chat-main-wrapper",id:"scrollableDiv",style:{height:"100%",overflowY:"auto",display:"flex",flexDirection:"column-reverse"},ref:w,onScroll:RD,children:(Yt=t==null?void 0:t.data)!=null&&Yt.id&&(s!=null&&s.length)?i.jsxs(qD,{dataLength:s.length,next:JD,style:{display:"flex",flexDirection:"column-reverse",overflowX:"hidden"},inverse:!0,endMessage:s.length>qt&&((xt=w.current)!=null&&xt.scrollTop)&&((dt=w.current)==null?void 0:dt.scrollTop)<-10?i.jsx(L.Divider,{plain:!0,children:"没有更多数据了"}):null,hasMore:gt,loader:i.jsx("div",{style:{height:"50px",textAlign:"center",overflow:"hidden"},children:i.jsx(L.Spin,{})}),scrollableTarget:"scrollableDiv",children:[s.map((n,l)=>i.jsx(tg,{application:e,currentSession:t,history:n,docViewerUrl:j,isLastHistory:l===0,onRelatedClick:ZD,onAgainClick:_D,onEditClick:WD,markdown:o==null?void 0:o.markdown},n.renderKey||`${n.messageId}-${l}`)),!gt&&Ct]}):i.jsxs("div",{className:"main-empty",children:[(o==null?void 0:o.greeting)!==!1&&i.jsx(vz,{text:o!=null&&o.greeting&&typeof o.greeting=="object"&&o.greeting.text!==void 0?o.greeting.text:(wt=e.arrange)!=null&&wt.length&&((Et=e.arrange[0])!=null&&Et.greetings)?e.arrange[0].greetings:$t.text,icon:o===void 0||o.greeting===!0||((Qt=o.greeting)==null?void 0:Qt.icon)===void 0?NM||$t.icon:o.greeting.icon,children:!!_.length&&(((o==null?void 0:o.greeting)===void 0||(o==null?void 0:o.greeting))===!0||typeof(o==null?void 0:o.greeting)=="object"&&o.greeting.questions!==!1)&&i.jsx(xi,{ref:mM,sid:(ht=t==null?void 0:t.data)==null?void 0:ht.id,isRecommendClearing:gM,data:_,layoutBreakpoints:typeof(o==null?void 0:o.greeting)=="object"?o.greeting.layoutBreakpoints:void 0,onItemClick:n=>{var d,P,v;if(c(n==null?void 0:n.question),rM(n==null?void 0:n.question),gM)return;n!=null&&n.id&&Y(!0);const l=(d=t==null?void 0:t.data)==null?void 0:d.id;O!=null&&O.fileUpload?(v=(P=BM.current)==null?void 0:P.clear())==null||v.then(()=>{var eM,K;n!=null&&n.id&&(l?(eM=rt(l,n))==null||eM.finally(()=>{Y(!1)}):(Y(!1),PN(!0),(K=ot())==null||K.then(fM=>{var SM;(SM=rt(fM.id,n))==null||SM.finally(()=>{Y(!1)})})))}):l?Y(!1):(Y(!1),PN(!0),ot())}})}),Ct]})}),it&&i.jsx("div",{className:"session-stop",children:i.jsx(L.Button,{type:"primary",style:{background:"white"},ghost:!0,size:"small",icon:i.jsx(nM,{type:"icon-zantinghuida",style:{fontSize:16}}),onClick:()=>GD(),children:"停止回答"})}),Dt&&(s==null?void 0:s.length)>0&&i.jsx("div",{className:"back-bottom",children:i.jsx(L.Button,{size:"small",onClick:()=>PD({behavior:"smooth"}),type:"link",icon:i.jsx(nM,{type:"icon-yijianhuidaodibu",style:{fontSize:24}})})})]}),i.jsx("div",{className:"chat-footer",children:i.jsxs("div",{className:"chat-footer-input",children:[cM.length>0&&i.jsx("div",{className:"input-files",children:cM.map((n,l)=>i.jsx(fz,{className:"thumb-40",file:n,actions:{upload:d=>zM(exports,null,function*(){wM(P=>P+1);try{return yield bD(d)}finally{wM(P=>Math.max(0,P-1))}}),remove:()=>{hM(d=>d.filter((P,v)=>v!==l)),F(d=>d.filter((P,v)=>v!==l))}},onUrlChange:d=>{F(P=>{const v=[...P];return v[l]=d,v})}},l))}),i.jsxs("div",{className:"footer-upload-action-wrapper",children:[i.jsxs(L.Space,{className:"footer-upload-action",onClick:n=>n.preventDefault(),children:[i.jsxs(L.Space,{children:[(e.type===R.ApplicationTypes.Agent&&(O==null?void 0:O.imageUpload)||e.type===R.ApplicationTypes.Dialog&&((St=e.arrange)==null?void 0:St.length)&&!!e.arrange[0].visionOpen&&(O==null?void 0:O.imageUpload))&&i.jsx(L.Upload,{multiple:!0,disabled:cM.length>=_N||p,accept:".jpg, .png, .jpeg,.bmp",listType:"picture-card",beforeUpload:nt,className:"footer-upload-picture",showUploadList:!1,children:cM.length<_N?i.jsx(L.Tooltip,{placement:"topLeft",overlayClassName:"footer-upload-tooltip",title:i.jsx("div",{children:`支持上传.jpg .png .jpeg
|
|
12
|
-
.bmp格式的图片数据,单文件最大${cj}M,最多${_N}张`}),children:i.jsx(L.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},icon:i.jsx(nM,{type:"icon-shangchuantupian",className:"icon-tianjia",style:{fontSize:"22px"}})})}):i.jsx(L.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},disabled:!0,icon:i.jsx(nM,{type:"icon-shangchuantupian",className:"icon-tianjia",style:{fontSize:"22px"}})})}),z&&(O!=null&&O.fileUpload)&&(e!=null&&e.id)?i.jsx(di,{appId:e==null?void 0:e.id,allowExcelAttachment:e.type===R.ApplicationTypes.Agent,ref:BM,isFirstSession:zt,docViewerUrl:j,onStatusChange:n=>zM(exports,null,function*(){n!=="process"?(we(!0),nj()):we(!1)}),createSession:()=>at().then(n=>{var d;return((d=n.data)==null?void 0:d.id)||""}),sid:(kt=t==null?void 0:t.data)==null?void 0:kt.id,disabled:gj||p,afterFileAdd:(n,l)=>{l&&GM(d=>{const P=d[l]||[];return{[l]:[...P,n]}})},afterFileDelete:n=>{var d;const l=(d=t==null?void 0:t.data)==null?void 0:d.id;l&&GM(P=>{const v=P[l]||[];return{[l]:v.filter(eM=>eM.id!==n)}})},onFileListChange:n=>{GN(n)},shouldContinue:OD,afterFilesClear:()=>{var l;const n=(l=t==null?void 0:t.data)==null?void 0:l.id;n&&(GM({[n]:[]}),nj())}}):null,(O==null?void 0:O.prompt)&&(e==null?void 0:e.id)&&i.jsx(jg,{appId:e.id,list:[],search:f?IM:"",onPromptSelect:n=>{rM(n.context),c(n.context)},disabled:p})]}),i.jsxs(L.Space,{children:[(O==null?void 0:O.connectNetwork)&&e.type===R.ApplicationTypes.Dialog&&((mt=e.arrange)==null?void 0:mt.length)&&!!e.arrange[0].enableNetOpen&&i.jsx(Kz,{sessionId:(Ut=t==null?void 0:t.data)==null?void 0:Ut.id,netStatus:u,enable:typeof(o==null?void 0:o.connectNetwork)=="object"&&typeof(o==null?void 0:o.connectNetwork.diabled)=="boolean"?!(o!=null&&o.connectNetwork.diabled):ED,disabledTip:t?void 0:"网络访问已被禁用",onNetStatusChange:n=>{BD(n)}}),(O==null?void 0:O.sessionList)&&i.jsx(Hz,{currentSessionId:(ft=t==null?void 0:t.data)==null?void 0:ft.id,onSessionChange:(n,l)=>{rM(void 0),he(!0),I==null||I(l)},disabled:p}),LM&&AM==="float"&&i.jsx("div",{className:"session-history-drawer-component",children:i.jsx(L.Popover,{placement:"topRight",showArrow:!1,overlayClassName:"session-history-overlay",overlayStyle:{padding:"4px"},getPopupContainer:n=>n.parentNode,content:"会话历史记录",children:i.jsx(L.Button,{className:"history-overlay-action",disabled:p,type:"text",icon:i.jsx(nM,{type:"icon-lishijilu",style:{fontSize:24}}),onClick:()=>ut(!0)})})}),(O==null?void 0:O.sessionOpen)&&i.jsx(L.Button,{icon:i.jsx(UM.PlusOutlined,{}),className:"add-btn",type:"primary",disabled:it||!t||!s.length||p,onClick:()=>{var n,l;he(!1),I==null||I(null),XN.current=null,y(!1),(n=lN.current)==null||n.clear(),(l=mM.current)==null||l.clear()},children:"新会话"})]})]}),!!Ij&&i.jsx("div",{className:"remainingSeconds-mark"})]}),i.jsxs("div",{className:"footer-textarea",onPaste:At,onPasteCapture:At,onDrop:ct,onDropCapture:ct,onDragOver:yt,onDragOverCapture:yt,children:[i.jsx(Yi,{ref:G,maxLength:E,text:aM,networkStatus:!1,loading:It||Qe,disabled:dM||X||p||It||Qe,onTextSend:sj,onChange:(n,l)=>{rM(n);const d=l.getText().replace(/[\n\s]+$/,"");c(d),tM(d),f||r(!0)},clearAction:i.jsx(L.Space,{size:0,children:i.jsx(L.Button,{type:"link",disabled:gj||p,ghost:!0,icon:i.jsx(nM,{style:{fontSize:22},type:"icon-qingchujiyi"}),onClick:()=>mD()})})}),!!Ij&&i.jsxs("div",{className:"remainingSeconds-time",children:["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长",Ij]})]})]})}),i.jsx(Pz,{tips:U}),EM&&i.jsx(Zz,{isvisible:EM,files:VM,sessionId:(pt=t==null?void 0:t.data)==null?void 0:pt.id,onClose:n=>{$M(!1),YD(!1)}})]}),st&&i.jsx(Xz,{currentSession:t,application:e,networkStatus:u,setCurrentSession:I,disabled:p,isSessionHistoryVisible:st,setIsSessionHistoryVisible:ut,onSessionChange:n=>{he(!0)}})]})});const hi=M=>{const{disabled:N,checkedValues:e,currKnowledgeList:j,selectCount:t,onSelectChange:D}=M,[z,I]=g.useState(!1),u=i.jsx(L.Checkbox.Group,{style:{width:"100%"},onChange:D,value:e,disabled:N,children:i.jsx(L.Row,{gutter:[20,12],children:j==null?void 0:j.map(s=>i.jsx(L.Col,{span:24,children:i.jsx(L.Checkbox,{value:s.id,children:s.name})},s.id))})}),y=s=>{I(s)};return i.jsx("div",{className:"knowledge-select",style:{borderColor:z?"#9C24F2":"#84868C"},children:i.jsx(L.Popover,{className:"select-popover",placement:"bottomRight",title:null,content:u,trigger:"click",overlayStyle:{width:280},onOpenChange:y,getPopupContainer:s=>s.parentNode,children:i.jsxs("div",{className:"",onClick:s=>s.preventDefault(),children:[i.jsx(nM,{className:"select-icon",type:"icon-open"}),i.jsx("span",{className:"title",children:"参考知识库"}),i.jsxs("span",{className:"content",children:["已选 ",t," 个"]})]})})})},zg=M=>{var w,m;const{currentSession:N,application:e,setCheckKnowledges:j}=M,{mode:t,transform:D,features:z}=g.useContext(FM),[I,u]=g.useState([]),[y,s]=g.useState(typeof(z==null?void 0:z.knowledges)=="object"?((w=z.knowledges.default)==null?void 0:w.map(Q=>Q.id))||[]:[]),[T,A]=g.useState(0),[c,a]=g.useState(!1);g.useEffect(()=>{if(!(e!=null&&e.id))return;const Q=e.arrange;if(!(Q!=null&&Q.length))return;const U=Q[0].knowledges||[];u(U);const O=typeof(z==null?void 0:z.knowledges)=="object"&&z.knowledges.default||U;if(Array.isArray(O)&&O.some(x=>Array.isArray(x.fileIds)&&x.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(We(O||[])>fN)throw Error(`knowledges and fileIds total count cannot exceed ${fN}`);if(!N){s(O.map($=>$.id)),A(O.length),j==null||j(O);return}const B=()=>{const $=N.knowledges||O;A($.length);const x=$.map(q=>q.id);s(x)};return B(),N.addEventListener("data:updated",B),()=>{N==null||N.removeEventListener("data:updated",B)}},[e,N]),g.useEffect(()=>{var k;if(!c||(a(!1),!(e!=null&&e.id)))return;const Q=[];y==null||y.map(U=>{const O=I==null?void 0:I.find(Z=>Z.id===U);Q.push(O)}),(k=N==null?void 0:N.data)!=null&&k.id&&N.setKnowledges(Q)},[c]);const S=Q=>{a(!0),s(Q);const k=[];Q==null||Q.map(U=>{const O=I==null?void 0:I.find(Z=>Z.id===U);k.push(O)}),j==null||j(k),A(Q.length)};return i.jsxs("div",{className:"chat-header",children:[i.jsxs(L.Space,{className:"header-title",children:[t==="inlay"&&((m=N==null?void 0:N.data)==null?void 0:m.name),t==="float"&&(e==null?void 0:e.name)]}),(D==null?void 0:D.knowledges)&&I.length!==0&&i.jsx(hi,{disabled:typeof(z==null?void 0:z.knowledges)=="object"&&(z==null?void 0:z.knowledges.diabled)||!1,checkedValues:y,currKnowledgeList:I,selectCount:T,onSelectChange:S})]})};const gg=g.forwardRef((M,N)=>{const{sessionId:e,appId:j,docViewerUrl:t}=M,[D,z]=g.useState(),{showHeader:I,agentClient:u,sider:y,onSessionLoad:s,features:T,mode:A}=g.useContext(FM),[c,a]=g.useState(),S=g.useRef(null),[w,m]=g.useState(""),[Q,k]=g.useState(),U=g.useRef(null),[O,Z]=g.useState(!1);g.useState([]);const{setIsSwitchingToExistingSession:B}=fj();g.useEffect(()=>{var x;Z(D?!!((x=D.data)!=null&&x.netOpen):typeof(T==null?void 0:T.connectNetwork)=="object"&&typeof(T==null?void 0:T.connectNetwork.default)=="boolean"?T.connectNetwork.default:!1)},[D]),g.useEffect(()=>{const x=()=>zM(exports,null,function*(){const q=u==null?void 0:u.application;if(!(q!=null&&q.id))return;const p=q==null?void 0:q.arrange;if(!(p!=null&&p.length))return;const b=p[0].embeddingService;m(b),a(q)});if(u!=null&&u.ready){x();return}return u==null||u.addEventListener("ready",()=>x()),()=>{u==null||u.removeEventListener("ready",x)}},[u]),g.useEffect(()=>{u&&e&&(u.ready?u==null||u.getSessions().then(x=>zM(exports,null,function*(){z==null||z(x.find(q=>q.id===e))})):u.addEventListener("ready",()=>zM(exports,null,function*(){u==null||u.getSessions().then(x=>zM(exports,null,function*(){z==null||z(x.find(q=>q.id===e))}))}),!0))},[u,e]),g.useEffect(()=>{if(!D){s&&s({applicationId:j,sessionId:"",session:null,sessionInstance:null});return}D.data&&s&&s({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D}),D.addEventListener("data:loaded",()=>{D!=null&&D.data&&s&&s({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D})},!0)},[D]);const $=x=>{var q;return(q=S.current)==null?void 0:q.create(qM(uM({},x),{knowledges:Q}))};return g.useImperativeHandle(N,()=>({createSession:x=>$(x),getSessionList:()=>{var q;const x=((q=S.current)==null?void 0:q.list())||[];return Promise.resolve(x)},getCurrentInputText:()=>{var x;return(x=U.current)==null?void 0:x.getCurrentInputText()},send:x=>{var q;return(q=U.current)!=null&&q.send?U.current.send(x):Promise.reject(new Error("send is not available"))}})),i.jsx("div",{className:"dialog",children:i.jsxs("div",{className:"dialog-pannel",children:[i.jsx("div",{className:"dialog-sider",style:{display:y&&A==="inlay"?"block":"none"},children:i.jsx(pj,{ref:S,appId:j,networkStatus:O,currentSession:D,application:c,setCurrentSession:z,checkKnowledges:Q,setCheckKnowledges:I?k:void 0,sessionId:e,afterSessionClick:x=>{var q,p;((q=x.data)==null?void 0:q.id)!==((p=D==null?void 0:D.data)==null?void 0:p.id)&&B(!0)}})}),i.jsx("div",{className:"dialog-content",children:i.jsxs("div",{className:"dialog-chat",children:[I&&i.jsx("div",{className:"dialog-chat-header",children:i.jsx(zg,{setCheckKnowledges:k,application:c,currentSession:D})}),i.jsx("div",{className:"dialog-chat-content",children:(c==null?void 0:c.id)&&i.jsx(Dg,{setNetworkStatus:Z,networkStatus:O,application:c,currentSession:D,onCreateSession:$,docViewerUrl:t,embeddingService:w,setCurrentSession:z,ref:U})})]})})]})})}),Ig=g.forwardRef((M,N)=>{const{className:e,triggerButton:j,size:t,theme:D,icon:z,docViewerUrl:I,token:u,debug:y,env:s,plugins:T,mcp:A,footer:c,defaultInput:a,onComment:S,onSessionLoad:w,onSessionUnload:m,onMessage:Q,beforeMessageSend:k,bodyStyle:U,apiUrl:O,sessionId:Z,disabled:B,transform:$,features:x,stream:q,agentClient:p,application:o}=M,b=g.useRef(null),[NM,LM]=g.useState(!1),[AM,lM]=g.useState(),[dM,vM]=g.useState(t),[iM,WM]=g.useState(M.open),ZM=g.useRef(null);g.useEffect(()=>{o&&(console.log("[AgentClientUI] token",p,o),lM(o.id))},[o]),L.ConfigProvider.config({theme:D}),g.useEffect(()=>{t&&vM(t)},[t]);const E=(V,{element:cM,size:hM})=>{vM({width:Number(hM.width),height:hM.height})};return g.useImperativeHandle(N,()=>({createSession:V=>{var cM;return(cM=ZM.current)==null?void 0:cM.createSession(V)},getSessionList:()=>{var V;return(V=ZM.current)==null?void 0:V.getSessionList()},getCurrentInputText:()=>{var V;return(V=ZM.current)==null?void 0:V.getCurrentInputText()},send:V=>{var cM;return(cM=ZM.current)!=null&&cM.send?ZM.current.send(V):Promise.reject(new Error("send is not available"))}})),i.jsx(L.ConfigProvider,{locale:ni,children:i.jsxs(yi,{value:qM(uM({},M),{popupContainer:b,agentClient:p,footer:c,defaultInput:a,onComment:S,onSessionLoad:w,onSessionUnload:m,onMessage:Q,beforeMessageSend:k,bodyStyle:U,disabled:B,transform:$,features:x}),children:[i.jsx(XD.Resizable,{height:(dM==null?void 0:dM.height)||"100%",width:(dM==null?void 0:dM.width)||"100%",maxConstraints:[document.body.clientWidth-45],minConstraints:[Number(t==null?void 0:t.minWidth)],onResize:E,handle:i.jsx("span",{className:"resize-handle-ew"}),resizeHandles:e=="float"?["w"]:[],children:i.jsxs("div",{id:"dialog-modal",className:`gbot-dialog-modal ${e} ${iM?"opened":"closed"}`,style:qM(uM({},t),{width:e=="float"?dM==null?void 0:dM.width:t==null?void 0:t.width,height:e==="float"?dM==null?void 0:dM.height:t==null?void 0:t.height,maxHeight:"100vh"}),ref:b,children:[NM?i.jsx("div",{className:"loading",children:i.jsx(L.Spin,{})}):AM&&p?i.jsx(Fz,{children:i.jsx(gg,{ref:ZM,appId:AM,docViewerUrl:I,bodyStyle:U,sessionId:Z})}):null,(j==null?void 0:j.visible)&&i.jsx(L.Button,{className:"trigger-btn close-btn",icon:i.jsx("img",{src:z}),onClick:()=>WM(!1)})]})}),(j==null?void 0:j.visible)&&!iM&&i.jsx(L.Button,{className:`${e}-trigger-btn open-btn`,style:j.style,icon:i.jsx("img",{src:z}),onClick:()=>WM(!0)})]})})}),sg="@glodon-aiot/agent-cli-ui",ug="3.25.1-alpha.3",Tg="./dist/es/index.mjs",ng="./dist/lib/index.js",Lg="./dist/src/index.d.ts",Ag={import:"./dist/es/index.mjs",require:"./dist/lib/index.js",types:"./dist/src/index.d.ts"},yg=["dist"],cg="module",ag="dist/src/index.d.ts",rg={dev:"vite",start:"vite",build:"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod && yarn build:cdn","build:pre":"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod","build:cdn":"tsc && vite build --mode prod --config ./vite.config.cdn.ts",preview:"vite preview",check:"yarn prettier --check .",write:"yarn prettier --write .",lint:"eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js",storybook:"start-storybook -p 6006 -s public","build-storybook":"build-storybook -s public",docs:"start-storybook -p 6006",commit:"cz"},og={"@ant-design/icons":"^5.3.4","@glodon-aiot/apis":"^3.25.1-alpha.3","@glodon-aiot/bot-client-sdk":"^3.25.1-alpha.3","@glodon-aiot/react-components":"^3.25.1-alpha.3","@matejmazur/react-mathjax":"^0.1.10","@react-pdf-viewer/core":"^3.12.0","@react-pdf-viewer/default-layout":"^3.12.0","@react-pdf-viewer/locales":"^1.0.0","@react-pdf-viewer/toolbar":"^3.12.0",ahooks:"^3.8.5",antd:"^4.24.16",axios:"0.24.0",classnames:"^2.5.1","copy-to-clipboard":"^3.3.3",dayjs:"^1.11.13",lodash:"^4.17.21","pdfjs-dist":"^3.0.279","quill-delta":"^5.1.0",react:">=17.0.0 <19.0.0","react-dom":">=17.0.0 <19.0.0","react-infinite-scroll-component":"^6.1.0","react-quill-new":"^3.6.0","react-resizable":"^3.0.5",uuid:"^11.1.0"},lg={"@babel/core":"^7.20.12","@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^11.1.6","@storybook/addon-actions":"6.3.6","@storybook/addon-essentials":"6.4.9","@storybook/addon-interactions":"^6.5.16","@storybook/addon-links":"6.3.5","@storybook/addon-postcss":"2.0.0","@storybook/builder-vite":"^0.4.0","@storybook/node-logger":"6.4.9","@storybook/react":"6.4.9","@storybook/testing-library":"^0.0.13","@types/lodash":"^4","@types/react":"^18","@types/react-dom":"^18","@typescript-eslint/eslint-plugin":"^5.35.1","@typescript-eslint/parser":"^5.35.1","@vitejs/plugin-react":"^3.1.0",antd:"^4.24.0","babel-loader":"^8.3.0","babel-plugin-import":"^1.13.8",commitizen:"^4.3.0","css-loader":"^6.7.3","cz-conventional-changelog":"^3.3.0","cz-customizable":"^7.0.0",eslint:"^8.0.1","eslint-config-prettier":"^8.5.0","eslint-config-standard-with-typescript":"^22.0.0","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0","eslint-plugin-promise":"^6.0.0","eslint-plugin-react":"^7.31.0","eslint-plugin-storybook":"^0.6.10",husky:">=6",less:"^4.1.2","less-loader":"^11.1.0","lint-staged":">=10","postcss-loader":"^7.2.4",prettier:"2.7.1","require-from-string":"^2.0.2","rollup-plugin-visualizer":"^6.0.1","storybook-less-loader":"^0.1.0",typescript:"*",vite:"^4.1.1","vite-plugin-css-injected-by-js":"^3.5.0","vite-plugin-dts":"^4.3.0","vite-plugin-externalize-deps":"^0.9.0"},Cg=[">0.2%","not dead","not op_mini all"],Og=["last 1 chrome version","last 1 firefox version","last 1 safari version"],Yg={commitizen:{path:"node_modules/cz-customizable"},"cz-customizable":{config:".cz-config.cjs"}},xg={access:"public",registry:"https://registry.npmjs.org/"},dg={hooks:{"commit-msg":"validate-commit-msg"}},wg={name:sg,version:ug,module:Tg,main:ng,typings:Lg,exports:Ag,files:yg,type:cg,types:ag,scripts:rg,dependencies:og,devDependencies:lg,"lint-staged":{"*.{js,css,md,jsx,less,ts,tsx,json}":"prettier --write"},production:Cg,development:Og,config:Yg,publishConfig:xg,husky:dg};var Si=(M=>(M.dev="https://aiot-dev.glodon.com/api/cvforcepd",M.test="https://aiot-dev.glodon.com/api/cvforce",M.prod="https://copilot.glodon.com/api/cvforce",M.local="http://localhost:3000/api/cvforcepd",M))(Si||{});//! moment.js
|
|
12
|
+
.bmp格式的图片数据,单文件最大${cj}M,最多${_N}张`}),children:i.jsx(L.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},icon:i.jsx(nM,{type:"icon-shangchuantupian",className:"icon-tianjia",style:{fontSize:"22px"}})})}):i.jsx(L.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},disabled:!0,icon:i.jsx(nM,{type:"icon-shangchuantupian",className:"icon-tianjia",style:{fontSize:"22px"}})})}),z&&(O!=null&&O.fileUpload)&&(e!=null&&e.id)?i.jsx(di,{appId:e==null?void 0:e.id,allowExcelAttachment:e.type===R.ApplicationTypes.Agent,ref:BM,isFirstSession:zt,docViewerUrl:j,onStatusChange:n=>zM(exports,null,function*(){n!=="process"?(we(!0),nj()):we(!1)}),createSession:()=>at().then(n=>{var d;return((d=n.data)==null?void 0:d.id)||""}),sid:(kt=t==null?void 0:t.data)==null?void 0:kt.id,disabled:gj||p,afterFileAdd:(n,l)=>{l&&GM(d=>{const P=d[l]||[];return{[l]:[...P,n]}})},afterFileDelete:n=>{var d;const l=(d=t==null?void 0:t.data)==null?void 0:d.id;l&&GM(P=>{const v=P[l]||[];return{[l]:v.filter(eM=>eM.id!==n)}})},onFileListChange:n=>{GN(n)},shouldContinue:OD,afterFilesClear:()=>{var l;const n=(l=t==null?void 0:t.data)==null?void 0:l.id;n&&(GM({[n]:[]}),nj())}}):null,(O==null?void 0:O.prompt)&&(e==null?void 0:e.id)&&i.jsx(jg,{appId:e.id,list:[],search:f?IM:"",onPromptSelect:n=>{rM(n.context),c(n.context)},disabled:p})]}),i.jsxs(L.Space,{children:[(O==null?void 0:O.connectNetwork)&&e.type===R.ApplicationTypes.Dialog&&((mt=e.arrange)==null?void 0:mt.length)&&!!e.arrange[0].enableNetOpen&&i.jsx(Kz,{sessionId:(Ut=t==null?void 0:t.data)==null?void 0:Ut.id,netStatus:u,enable:typeof(o==null?void 0:o.connectNetwork)=="object"&&typeof(o==null?void 0:o.connectNetwork.diabled)=="boolean"?!(o!=null&&o.connectNetwork.diabled):ED,disabledTip:t?void 0:"网络访问已被禁用",onNetStatusChange:n=>{BD(n)}}),(O==null?void 0:O.sessionList)&&i.jsx(Hz,{currentSessionId:(ft=t==null?void 0:t.data)==null?void 0:ft.id,onSessionChange:(n,l)=>{rM(void 0),he(!0),I==null||I(l)},disabled:p}),LM&&AM==="float"&&i.jsx("div",{className:"session-history-drawer-component",children:i.jsx(L.Popover,{placement:"topRight",showArrow:!1,overlayClassName:"session-history-overlay",overlayStyle:{padding:"4px"},getPopupContainer:n=>n.parentNode,content:"会话历史记录",children:i.jsx(L.Button,{className:"history-overlay-action",disabled:p,type:"text",icon:i.jsx(nM,{type:"icon-lishijilu",style:{fontSize:24}}),onClick:()=>ut(!0)})})}),(O==null?void 0:O.sessionOpen)&&i.jsx(L.Button,{icon:i.jsx(UM.PlusOutlined,{}),className:"add-btn",type:"primary",disabled:it||!t||!s.length||p,onClick:()=>{var n,l;he(!1),I==null||I(null),XN.current=null,y(!1),(n=lN.current)==null||n.clear(),(l=mM.current)==null||l.clear()},children:"新会话"})]})]}),!!Ij&&i.jsx("div",{className:"remainingSeconds-mark"})]}),i.jsxs("div",{className:"footer-textarea",onPaste:At,onPasteCapture:At,onDrop:ct,onDropCapture:ct,onDragOver:yt,onDragOverCapture:yt,children:[i.jsx(Yi,{ref:G,maxLength:E,text:aM,networkStatus:!1,loading:It||Qe,disabled:dM||X||p||It||Qe,onTextSend:sj,onChange:(n,l)=>{rM(n);const d=l.getText().replace(/[\n\s]+$/,"");c(d),tM(d),f||r(!0)},clearAction:i.jsx(L.Space,{size:0,children:i.jsx(L.Button,{type:"link",disabled:gj||p,ghost:!0,icon:i.jsx(nM,{style:{fontSize:22},type:"icon-qingchujiyi"}),onClick:()=>mD()})})}),!!Ij&&i.jsxs("div",{className:"remainingSeconds-time",children:["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长",Ij]})]})]})}),i.jsx(Pz,{tips:U}),EM&&i.jsx(Zz,{isvisible:EM,files:VM,sessionId:(pt=t==null?void 0:t.data)==null?void 0:pt.id,onClose:n=>{$M(!1),YD(!1)}})]}),st&&i.jsx(Xz,{currentSession:t,application:e,networkStatus:u,setCurrentSession:I,disabled:p,isSessionHistoryVisible:st,setIsSessionHistoryVisible:ut,onSessionChange:n=>{he(!0)}})]})});const hi=M=>{const{disabled:N,checkedValues:e,currKnowledgeList:j,selectCount:t,onSelectChange:D}=M,[z,I]=g.useState(!1),u=i.jsx(L.Checkbox.Group,{style:{width:"100%"},onChange:D,value:e,disabled:N,children:i.jsx(L.Row,{gutter:[20,12],children:j==null?void 0:j.map(s=>i.jsx(L.Col,{span:24,children:i.jsx(L.Checkbox,{value:s.id,children:s.name})},s.id))})}),y=s=>{I(s)};return i.jsx("div",{className:"knowledge-select",style:{borderColor:z?"#9C24F2":"#84868C"},children:i.jsx(L.Popover,{className:"select-popover",placement:"bottomRight",title:null,content:u,trigger:"click",overlayStyle:{width:280},onOpenChange:y,getPopupContainer:s=>s.parentNode,children:i.jsxs("div",{className:"",onClick:s=>s.preventDefault(),children:[i.jsx(nM,{className:"select-icon",type:"icon-open"}),i.jsx("span",{className:"title",children:"参考知识库"}),i.jsxs("span",{className:"content",children:["已选 ",t," 个"]})]})})})},zg=M=>{var w,m;const{currentSession:N,application:e,setCheckKnowledges:j}=M,{mode:t,transform:D,features:z}=g.useContext(FM),[I,u]=g.useState([]),[y,s]=g.useState(typeof(z==null?void 0:z.knowledges)=="object"?((w=z.knowledges.default)==null?void 0:w.map(Q=>Q.id))||[]:[]),[T,A]=g.useState(0),[c,a]=g.useState(!1);g.useEffect(()=>{if(!(e!=null&&e.id))return;const Q=e.arrange;if(!(Q!=null&&Q.length))return;const U=Q[0].knowledges||[];u(U);const O=typeof(z==null?void 0:z.knowledges)=="object"&&z.knowledges.default||U;if(Array.isArray(O)&&O.some(x=>Array.isArray(x.fileIds)&&x.fileIds.length===0))throw Error("fileIds cannot be an empty array");if(We(O||[])>fN)throw Error(`knowledges and fileIds total count cannot exceed ${fN}`);if(!N){s(O.map($=>$.id)),A(O.length),j==null||j(O);return}const B=()=>{const $=N.knowledges||O;A($.length);const x=$.map(q=>q.id);s(x)};return B(),N.addEventListener("data:updated",B),()=>{N==null||N.removeEventListener("data:updated",B)}},[e,N]),g.useEffect(()=>{var k;if(!c||(a(!1),!(e!=null&&e.id)))return;const Q=[];y==null||y.map(U=>{const O=I==null?void 0:I.find(Z=>Z.id===U);Q.push(O)}),(k=N==null?void 0:N.data)!=null&&k.id&&N.setKnowledges(Q)},[c]);const S=Q=>{a(!0),s(Q);const k=[];Q==null||Q.map(U=>{const O=I==null?void 0:I.find(Z=>Z.id===U);k.push(O)}),j==null||j(k),A(Q.length)};return i.jsxs("div",{className:"chat-header",children:[i.jsxs(L.Space,{className:"header-title",children:[t==="inlay"&&((m=N==null?void 0:N.data)==null?void 0:m.name),t==="float"&&(e==null?void 0:e.name)]}),(D==null?void 0:D.knowledges)&&I.length!==0&&i.jsx(hi,{disabled:typeof(z==null?void 0:z.knowledges)=="object"&&(z==null?void 0:z.knowledges.diabled)||!1,checkedValues:y,currKnowledgeList:I,selectCount:T,onSelectChange:S})]})};const gg=g.forwardRef((M,N)=>{const{sessionId:e,appId:j,docViewerUrl:t}=M,[D,z]=g.useState(),{showHeader:I,agentClient:u,sider:y,onSessionLoad:s,features:T,mode:A}=g.useContext(FM),[c,a]=g.useState(),S=g.useRef(null),[w,m]=g.useState(""),[Q,k]=g.useState(),U=g.useRef(null),[O,Z]=g.useState(!1);g.useState([]);const{setIsSwitchingToExistingSession:B}=fj();g.useEffect(()=>{var x;Z(D?!!((x=D.data)!=null&&x.netOpen):typeof(T==null?void 0:T.connectNetwork)=="object"&&typeof(T==null?void 0:T.connectNetwork.default)=="boolean"?T.connectNetwork.default:!1)},[D]),g.useEffect(()=>{const x=()=>zM(exports,null,function*(){const q=u==null?void 0:u.application;if(!(q!=null&&q.id))return;const p=q==null?void 0:q.arrange;if(!(p!=null&&p.length))return;const b=p[0].embeddingService;m(b),a(q)});if(u!=null&&u.ready){x();return}return u==null||u.addEventListener("ready",()=>x()),()=>{u==null||u.removeEventListener("ready",x)}},[u]),g.useEffect(()=>{u&&e&&(u.ready?u==null||u.getSessions().then(x=>zM(exports,null,function*(){z==null||z(x.find(q=>q.id===e))})):u.addEventListener("ready",()=>zM(exports,null,function*(){u==null||u.getSessions().then(x=>zM(exports,null,function*(){z==null||z(x.find(q=>q.id===e))}))}),!0))},[u,e]),g.useEffect(()=>{if(!D){s&&s({applicationId:j,sessionId:"",session:null,sessionInstance:null});return}D.data&&s&&s({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D}),D.addEventListener("data:loaded",()=>{D!=null&&D.data&&s&&s({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D})},!0)},[D]);const $=x=>{var q;return(q=S.current)==null?void 0:q.create(qM(uM({},x),{knowledges:Q}))};return g.useImperativeHandle(N,()=>({createSession:x=>$(x),getSessionList:()=>{var q;const x=((q=S.current)==null?void 0:q.list())||[];return Promise.resolve(x)},getCurrentInputText:()=>{var x;return(x=U.current)==null?void 0:x.getCurrentInputText()},send:x=>{var q;return(q=U.current)!=null&&q.send?U.current.send(x):Promise.reject(new Error("send is not available"))}})),i.jsx("div",{className:"dialog",children:i.jsxs("div",{className:"dialog-pannel",children:[i.jsx("div",{className:"dialog-sider",style:{display:y&&A==="inlay"?"block":"none"},children:i.jsx(pj,{ref:S,appId:j,networkStatus:O,currentSession:D,application:c,setCurrentSession:z,checkKnowledges:Q,setCheckKnowledges:I?k:void 0,sessionId:e,afterSessionClick:x=>{var q,p;((q=x.data)==null?void 0:q.id)!==((p=D==null?void 0:D.data)==null?void 0:p.id)&&B(!0)}})}),i.jsx("div",{className:"dialog-content",children:i.jsxs("div",{className:"dialog-chat",children:[I&&i.jsx("div",{className:"dialog-chat-header",children:i.jsx(zg,{setCheckKnowledges:k,application:c,currentSession:D})}),i.jsx("div",{className:"dialog-chat-content",children:(c==null?void 0:c.id)&&i.jsx(Dg,{setNetworkStatus:Z,networkStatus:O,application:c,currentSession:D,onCreateSession:$,docViewerUrl:t,embeddingService:w,setCurrentSession:z,ref:U})})]})})]})})}),Ig=g.forwardRef((M,N)=>{const{className:e,triggerButton:j,size:t,theme:D,icon:z,docViewerUrl:I,token:u,debug:y,env:s,plugins:T,mcp:A,footer:c,defaultInput:a,onComment:S,onSessionLoad:w,onSessionUnload:m,onMessage:Q,beforeMessageSend:k,bodyStyle:U,apiUrl:O,sessionId:Z,disabled:B,transform:$,features:x,stream:q,agentClient:p,application:o}=M,b=g.useRef(null),[NM,LM]=g.useState(!1),[AM,lM]=g.useState(),[dM,vM]=g.useState(t),[iM,WM]=g.useState(M.open),ZM=g.useRef(null);g.useEffect(()=>{o&&(console.log("[AgentClientUI] token",p,o),lM(o.id))},[o]),L.ConfigProvider.config({theme:D}),g.useEffect(()=>{t&&vM(t)},[t]);const E=(V,{element:cM,size:hM})=>{vM({width:Number(hM.width),height:hM.height})};return g.useImperativeHandle(N,()=>({createSession:V=>{var cM;return(cM=ZM.current)==null?void 0:cM.createSession(V)},getSessionList:()=>{var V;return(V=ZM.current)==null?void 0:V.getSessionList()},getCurrentInputText:()=>{var V;return(V=ZM.current)==null?void 0:V.getCurrentInputText()},send:V=>{var cM;return(cM=ZM.current)!=null&&cM.send?ZM.current.send(V):Promise.reject(new Error("send is not available"))}})),i.jsx(L.ConfigProvider,{locale:ni,children:i.jsxs(yi,{value:qM(uM({},M),{popupContainer:b,agentClient:p,footer:c,defaultInput:a,onComment:S,onSessionLoad:w,onSessionUnload:m,onMessage:Q,beforeMessageSend:k,bodyStyle:U,disabled:B,transform:$,features:x}),children:[i.jsx(XD.Resizable,{height:(dM==null?void 0:dM.height)||"100%",width:(dM==null?void 0:dM.width)||"100%",maxConstraints:[document.body.clientWidth-45],minConstraints:[Number(t==null?void 0:t.minWidth)],onResize:E,handle:i.jsx("span",{className:"resize-handle-ew"}),resizeHandles:e=="float"?["w"]:[],children:i.jsxs("div",{id:"dialog-modal",className:`gbot-dialog-modal ${e} ${iM?"opened":"closed"}`,style:qM(uM({},t),{width:e=="float"?dM==null?void 0:dM.width:t==null?void 0:t.width,height:e==="float"?dM==null?void 0:dM.height:t==null?void 0:t.height,maxHeight:"100vh"}),ref:b,children:[NM?i.jsx("div",{className:"loading",children:i.jsx(L.Spin,{})}):AM&&p?i.jsx(Fz,{children:i.jsx(gg,{ref:ZM,appId:AM,docViewerUrl:I,bodyStyle:U,sessionId:Z})}):null,(j==null?void 0:j.visible)&&i.jsx(L.Button,{className:"trigger-btn close-btn",icon:i.jsx("img",{src:z}),onClick:()=>WM(!1)})]})}),(j==null?void 0:j.visible)&&!iM&&i.jsx(L.Button,{className:`${e}-trigger-btn open-btn`,style:j.style,icon:i.jsx("img",{src:z}),onClick:()=>WM(!0)})]})})}),sg="@glodon-aiot/agent-cli-ui",ug="3.25.1-alpha.4",Tg="./dist/es/index.mjs",ng="./dist/lib/index.js",Lg="./dist/src/index.d.ts",Ag={import:"./dist/es/index.mjs",require:"./dist/lib/index.js",types:"./dist/src/index.d.ts"},yg=["dist"],cg="module",ag="dist/src/index.d.ts",rg={dev:"vite",start:"vite",build:"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod && yarn build:cdn","build:pre":"tsc && node --max-old-space-size=4096 ./node_modules/vite/bin/vite.js build --mode prod","build:cdn":"tsc && vite build --mode prod --config ./vite.config.cdn.ts",preview:"vite preview",check:"yarn prettier --check .",write:"yarn prettier --write .",lint:"eslint --ext .tsx,.ts --fix ./example -c .eslintrc.js",storybook:"start-storybook -p 6006 -s public","build-storybook":"build-storybook -s public",docs:"start-storybook -p 6006",commit:"cz"},og={"@ant-design/icons":"^5.3.4","@glodon-aiot/apis":"^3.25.1-alpha.4","@glodon-aiot/bot-client-sdk":"^3.25.1-alpha.4","@glodon-aiot/react-components":"^3.25.1-alpha.4","@matejmazur/react-mathjax":"^0.1.10","@react-pdf-viewer/core":"^3.12.0","@react-pdf-viewer/default-layout":"^3.12.0","@react-pdf-viewer/locales":"^1.0.0","@react-pdf-viewer/toolbar":"^3.12.0",ahooks:"^3.8.5",antd:"^4.24.16",axios:"0.24.0",classnames:"^2.5.1","copy-to-clipboard":"^3.3.3",dayjs:"^1.11.13",lodash:"^4.17.21","pdfjs-dist":"^3.0.279","quill-delta":"^5.1.0",react:">=17.0.0 <19.0.0","react-dom":">=17.0.0 <19.0.0","react-infinite-scroll-component":"^6.1.0","react-quill-new":"^3.6.0","react-resizable":"^3.0.5",uuid:"^11.1.0"},lg={"@babel/core":"^7.20.12","@commitlint/cli":"^17.0.3","@commitlint/config-conventional":"^17.0.3","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-typescript":"^11.1.6","@storybook/addon-actions":"6.3.6","@storybook/addon-essentials":"6.4.9","@storybook/addon-interactions":"^6.5.16","@storybook/addon-links":"6.3.5","@storybook/addon-postcss":"2.0.0","@storybook/builder-vite":"^0.4.0","@storybook/node-logger":"6.4.9","@storybook/react":"6.4.9","@storybook/testing-library":"^0.0.13","@types/lodash":"^4","@types/react":"^18","@types/react-dom":"^18","@typescript-eslint/eslint-plugin":"^5.35.1","@typescript-eslint/parser":"^5.35.1","@vitejs/plugin-react":"^3.1.0",antd:"^4.24.0","babel-loader":"^8.3.0","babel-plugin-import":"^1.13.8",commitizen:"^4.3.0","css-loader":"^6.7.3","cz-conventional-changelog":"^3.3.0","cz-customizable":"^7.0.0",eslint:"^8.0.1","eslint-config-prettier":"^8.5.0","eslint-config-standard-with-typescript":"^22.0.0","eslint-plugin-import":"^2.25.2","eslint-plugin-n":"^15.0.0","eslint-plugin-promise":"^6.0.0","eslint-plugin-react":"^7.31.0","eslint-plugin-storybook":"^0.6.10",husky:">=6",less:"^4.1.2","less-loader":"^11.1.0","lint-staged":">=10","postcss-loader":"^7.2.4",prettier:"2.7.1","require-from-string":"^2.0.2","rollup-plugin-visualizer":"^6.0.1","storybook-less-loader":"^0.1.0",typescript:"*",vite:"^4.1.1","vite-plugin-css-injected-by-js":"^3.5.0","vite-plugin-dts":"^4.3.0","vite-plugin-externalize-deps":"^0.9.0"},Cg=[">0.2%","not dead","not op_mini all"],Og=["last 1 chrome version","last 1 firefox version","last 1 safari version"],Yg={commitizen:{path:"node_modules/cz-customizable"},"cz-customizable":{config:".cz-config.cjs"}},xg={access:"public",registry:"https://registry.npmjs.org/"},dg={hooks:{"commit-msg":"validate-commit-msg"}},wg={name:sg,version:ug,module:Tg,main:ng,typings:Lg,exports:Ag,files:yg,type:cg,types:ag,scripts:rg,dependencies:og,devDependencies:lg,"lint-staged":{"*.{js,css,md,jsx,less,ts,tsx,json}":"prettier --write"},production:Cg,development:Og,config:Yg,publishConfig:xg,husky:dg};var Si=(M=>(M.dev="https://aiot-dev.glodon.com/api/cvforcepd",M.test="https://aiot-dev.glodon.com/api/cvforce",M.prod="https://copilot.glodon.com/api/cvforce",M.local="http://localhost:3000/api/cvforcepd",M))(Si||{});//! moment.js
|
|
13
13
|
//! version : 2.30.1
|
|
14
14
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
15
15
|
//! license : MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/agent-cli-ui",
|
|
3
|
-
"version": "3.25.1-alpha.
|
|
3
|
+
"version": "3.25.1-alpha.4",
|
|
4
4
|
"module": "./dist/es/index.mjs",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"typings": "./dist/src/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ant-design/icons": "^5.3.4",
|
|
34
|
-
"@glodon-aiot/apis": "^3.25.1-alpha.
|
|
35
|
-
"@glodon-aiot/bot-client-sdk": "^3.25.1-alpha.
|
|
36
|
-
"@glodon-aiot/react-components": "^3.25.1-alpha.
|
|
34
|
+
"@glodon-aiot/apis": "^3.25.1-alpha.4",
|
|
35
|
+
"@glodon-aiot/bot-client-sdk": "^3.25.1-alpha.4",
|
|
36
|
+
"@glodon-aiot/react-components": "^3.25.1-alpha.4",
|
|
37
37
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
38
38
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
39
39
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|