@glodon-aiot/agent-cli-ui 3.24.0-alpha.4 → 3.24.0-alpha.5
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
|
@@ -4995,7 +4995,7 @@ const tI = RN((M, N) => {
|
|
|
4995
4995
|
})]
|
|
4996
4996
|
})
|
|
4997
4997
|
});
|
|
4998
|
-
}), DI = "@glodon-aiot/agent-cli-ui", zI = "3.24.0-alpha.
|
|
4998
|
+
}), DI = "@glodon-aiot/agent-cli-ui", zI = "3.24.0-alpha.5", gI = "./dist/es/index.mjs", II = "./dist/lib/index.js", TI = "./dist/src/index.d.ts", uI = {
|
|
4999
4999
|
import: "./dist/es/index.mjs",
|
|
5000
5000
|
require: "./dist/lib/index.js",
|
|
5001
5001
|
types: "./dist/src/index.d.ts"
|
|
@@ -5017,9 +5017,9 @@ const tI = RN((M, N) => {
|
|
|
5017
5017
|
commit: "cz"
|
|
5018
5018
|
}, yI = {
|
|
5019
5019
|
"@ant-design/icons": "^5.3.4",
|
|
5020
|
-
"@glodon-aiot/apis": "^3.24.0-alpha.
|
|
5021
|
-
"@glodon-aiot/bot-client-sdk": "^3.24.0-alpha.
|
|
5022
|
-
"@glodon-aiot/react-components": "^3.24.0-alpha.
|
|
5020
|
+
"@glodon-aiot/apis": "^3.24.0-alpha.5",
|
|
5021
|
+
"@glodon-aiot/bot-client-sdk": "^3.24.0-alpha.5",
|
|
5022
|
+
"@glodon-aiot/react-components": "^3.24.0-alpha.5",
|
|
5023
5023
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
5024
5024
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
5025
5025
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|
package/dist/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
${t}`:t}if(N&&N.length>0){const D=N.filter(Boolean).map(g=>``).join(`
|
|
8
8
|
`);t=D?`${D}
|
|
9
9
|
${t}`:t}}return t},$z=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)}`},qz=z.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:g,setCurrentSession:I,networkStatus:s,setNetworkStatus:y}=M,[T,u]=z.useState([]),[A,a]=z.useState(),[c,f]=z.useState(),h=z.useRef(null),{service:R,agentClient:d,depId:U,footer:k,transform:o,defaultInput:v,onMessage:V,onHistoryLoad:NM,beforeMessageSend:Y,bodyStyle:K,disabled:x,features:O,popupContainer:b,icon:eM,sider:jM,mode:yM,silencedSeconds:RM}=z.useContext(HM),[rM,_M]=z.useState(!1),q=z.useRef(T),KM=z.useRef(void 0),PM=z.useRef(new Set),[Q,B]=z.useState(0),[LM,xM]=z.useState([]),[WM,C]=z.useState([]),[J,H]=z.useState(0),[m,_]=z.useState(!1);z.useEffect(()=>{_(J>0)},[J]);const iM=z.useRef(null),[nM,OM]=z.useState([]),[GM,w]=z.useState(!1),[l,DM]=z.useState(!1),[EM,zM]=z.useState(""),[CM,dM]=z.useState(),[kM,pM]=z.useState({}),JM=z.useRef(null),lN=z.useRef(null),QM=z.useRef(null),[YM,$M]=z.useState(!1),[FM,BM]=z.useState([]),[Ye,xe]=z.useState(!0),[lD,CD]=z.useState(!0),[it,yN]=z.useState(!1),[gj,CN]=z.useState(!1),[Dt,OD]=z.useState(!1),[sN,ie]=z.useState(typeof(O==null?void 0:O.promptVariables)=="object"?O.promptVariables.default||[]:[]),[YD,xD]=z.useState(()=>{const n=typeof(O==null?void 0:O.knowledges)=="object"&&O.knowledges.default||void 0;if(n){if(Array.isArray(n)&&n.some(G=>Array.isArray(G.fileIds)&&G.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,GN]=z.useState(!1),[gt,De]=z.useState(!1),[dD,ze]=z.useState(typeof(O==null?void 0:O.connectNetwork)=="object"&&typeof(O==null?void 0:O.connectNetwork.default)=="boolean"?O.connectNetwork.default:!1),[It,de]=z.useState(!1),[wD,mN]=z.useState(!1),[ED,QD]=z.useState(null),[we,PN]=z.useState(!1),[Tt,st]=z.useState(!1),{isSwitchingToExistingSession:ut,setIsSwitchingToExistingSession:Ee}=fj(),VN=z.useRef(null),[Ij,hD]=z.useState("");z.useEffect(()=>{if(!RM)return;let n=$z(RM);hD(n)},[RM]),z.useEffect(()=>{if(QD(t),t===null)mN(!1);else if(t===void 0)mN(!0);else{if(ED===null){if(ut){mN(!0),Ee(!1);return}mN(!1);return}t.ready?mN(!1):mN(!0)}},[t,t==null?void 0:t.ready,ut]),z.useEffect(()=>{var E,G;t&&(q.current=[]),u([]);const n=h.current;if(n&&n.scrollTo({top:0}),!((E=t==null?void 0:t.data)!=null&&E.id))return;if(CN(!1),yN(!1),(G=t.messages)!=null&&G.length){const MM=[...t.messages.filter(F=>F==null?void 0:F.messageId)].reverse();q.current=[...MM],u([...MM]),mN(!1)}const r=p=>{var MM;(MM=t==null?void 0:t.data)!=null&&MM.id&&(q.current=[...p].reverse(),u([...p].reverse()),!p||p.length<10?De(!1):De(!0),mN(!1),NM&&NM({applicationId:e.id,sessionId:t.data.id,histories:p}))};return t.addEventListener("history:loaded",r),()=>{q.current=[],u([]),t==null||t.removeEventListener("history:loaded",r)}},[t]),z.useEffect(()=>{const n=()=>{var r;(r=t==null?void 0:t.data)!=null&&r.id&&(t.promptVariables&&ie(t.promptVariables.sort((E,G)=>E.key.localeCompare(G.key))),t.knowledges&&xD(t.knowledges),y(t.netOpen))};return t==null||t.addEventListener("data:updated",n),()=>{t==null||t.removeEventListener("data:updated",n)}},[t]),z.useEffect(()=>{var r;if(!((r=t==null?void 0:t.data)!=null&&r.id))return;const n=E=>{var G;console.error(E.message,E.cause,"e.case"),L.notification.config({getContainer:()=>(b==null?void 0:b.current)||document.body,prefixCls:"gbot-notification"}),L.notification.error({message:((G=E.cause)==null?void 0:G.message)||E.message}),L.notification.config({getContainer:void 0,prefixCls:"gbot-notification"})};return t.addEventListener("error",n),()=>{t==null||t.removeEventListener("error",n)}},[t]);const SD=()=>{var E;if(!((E=t==null?void 0:t.data)!=null&&E.id)||!(e!=null&&e.id))return;const n=t.data.id,r=T[T.length-1];if(r&&r.isContext){jN("success","已开启新话题");return}else t.clear().then(()=>{const G=new RN("",n,W.IHistoryRole.System);G.isContext=!0,u([G,...T])})};z.useEffect(()=>{e!=null&&e.id&&(R==null||R.getRecommendQues(e.id).then(n=>{OM(n)}))},[U,e]);const Tj=n=>tM(exports,null,function*(){var MN,gM;if(x)return jN("error","发送功能被禁用"),!1;const r=n||A;if(!(r!=null&&r.trim()))return jN("error","请输入你想问的"),!1;if(!(sN==null?void 0:sN.every(bM=>!!(bM!=null&&bM.value)))){if(o!=null&&o.promptVariables)return jN("error","变量值不能为空"),!1;console.error("变量值不能为空",sN==null?void 0:sN.map(bM=>!!(bM!=null&&bM.value)))}if(gj)return jN("error","正在回复中"),!1;if(rM)return jN("error","等待初始化"),!1;if(!Ye)return jN("error","正在解析文件"),!1;if(m)return jN("error","正在上传图片"),!1;xM([]),C([]);const G=(MN=t==null?void 0:t.data)==null?void 0:MN.id;if(!G)return we?!1:(PN(!0),D==null||D({netOpen:s?UN.OPEN:UN.CLOSE}).then(bM=>{var TM,NN;GN(!0),y(!!((TM=bM.data)!=null&&TM.netOpen)),ze(!!((NN=bM.data)!=null&&NN.enableNetOpen)),sj(bM).then(()=>{I==null||I(bM),GN(!1),f(r)})}).catch(bM=>{PN(!1)}),!0);if(we)return!1;PN(!0),de(!0);const p=aj(r,WM,kM[G],(e==null?void 0:e.type)||0);let MM;try{Y?MM=yield Y==null?void 0:Y({applicationId:e.id,sessionId:G,message:{content:p,sessionId:G,role:W.ChatMessageRole.User,files:kM[G]}}):MM=!0}catch(bM){MM=!1}if(de(!1),MM===!1)return PN(!1),!1;let F=r;typeof MM=="object"&&(F=MM.content||r);const hM=yield(()=>new Promise(bM=>{ie(TM=>(bM(TM),TM))}))();return(yield t.setPromptVariables(hM))?(((gM=kM[G])==null?void 0:gM.length)>0?yield kD(F):yield uj(F),!0):(PN(!1),!1)}),sj=n=>new Promise((r,E)=>tM(exports,null,function*(){const MM=(n==null?void 0:n.promptVariables).filter(F=>F.type?!((F.type===W.PromptVariableType.User||F.type===void 0)&&F.key==="query")&&!((F.type===W.PromptVariableType.System||F.type===void 0)&&F.key==="datetime"):F.key!=="query").map(F=>{var hM;const mM=(hM=sN.find(X=>X.key===F.key&&X.type===F.type))==null?void 0:hM.value;return F.value=mM||"",F});ie(MM.sort((F,mM)=>F.key.localeCompare(mM.key))),yield n==null?void 0:n.setPromptVariables(MM).catch(F=>{console.error(F),jN("error",F.message)}),r()})),kD=n=>{var p,MM,F;if(xe(!1),!((p=t==null?void 0:t.data)!=null&&p.id)||!(e!=null&&e.id))return;const r=((MM=t.data)==null?void 0:MM.id)||"";let E=[],G=new Set;return(F=kM[r])==null||F.forEach(mM=>{G.has(mM.id)||(E.push(mM),G.add(mM.id))}),xe(!0),uj(n,E)};z.useEffect(()=>{if(!c||!t)return;const n=c,r=()=>tM(exports,null,function*(){de(!0);const E=aj(n,WM,kM[t.id],(e==null?void 0:e.type)||0);let G;try{Y?G=yield Y==null?void 0:Y({applicationId:e.id,sessionId:t.id,message:{content:E,sessionId:t.id,role:W.ChatMessageRole.User,files:kM[t.id]}}):G=!0}catch(p){G=!1}if(de(!1),G===!1){PN(!1);return}uj(n),f(void 0)});return t.ready?r():t.addEventListener("ready",r,!0),()=>{t==null||t.removeEventListener("ready",r)}},[c,t]);const uj=(n,r)=>tM(exports,null,function*(){var MN,gM,bM;const E=(MN=t==null?void 0:t.data)==null?void 0:MN.id;if(!E)return;CN(!0),yN(!0);const G=aj(n,WM,r,(e==null?void 0:e.type)||0);let p;if(e.type===W.ApplicationTypes.Agent)p=void 0;else if(e.type===W.ApplicationTypes.Dialog&&((gM=e.arrange)!=null&&gM.length)&&e.arrange[0].visionOpen){const TM=WM&&WM.length?WM.filter(Boolean):[];p=TM.length?TM:void 0}else p=void 0;const MM=new RN(G,E,W.IHistoryRole.User,r,p);a(void 0),dM(void 0),q.current=[MM,...T],u(q.current),e.id&&V&&V({applicationId:e.id,sessionId:E,message:MM});const F=new RN("",E,W.IHistoryRole.System);F.isWaiting=!0,q.current=[F,...q.current],u(q.current);const mM=(r==null?void 0:r.map(TM=>TM.id))||[],hM={stream:ue.configuration.stream,referenceFirst:!1};if(o!=null&&o.promptVariables){const TM=sN==null?void 0:sN.reduce((NN,ON)=>(NN[ON.key]=ON.value,NN),{});hM.formatValues=TM}if(o!=null&&o.knowledges){const TM=YD;hM.knowledges=TM}const X={text:G,fileIds:mM,files:r,uuid:MM.messageId};p&&p.length>0&&(X.imageContent=p),t.ready||(yield new Promise(TM=>{t.addEventListener("ready",()=>TM(),!0)})),yield t.send(X,hM),pM({[E]:[]}),(bM=JM.current)==null||bM.update(),xM([]),C([]),PN(!1)});z.useEffect(()=>{var hM;const n=(hM=t==null?void 0:t.data)==null?void 0:hM.id;if(!n)return;let r=null,E=null,G="";const p=()=>{r=null,E&&(u([E,...q.current]),E=null)},MM=()=>{r!==null&&(cancelAnimationFrame(r),r=null,E=null)},F=X=>{if(!X.sessionId||X.sessionId&&X.sessionId!==KM.current)return;if(X.role===W.IHistoryRole.User){if(q.current.some(ge=>ge.messageId&&ge.messageId===X.messageId))return;const NN=new RN(X.content,n,W.IHistoryRole.User,X.files,X.imageContent);NN.messageId=X.messageId||NN.messageId,NN.renderKey=NN.messageId;const ON=new RN("",n,W.IHistoryRole.System);ON.isWaiting=!0,q.current=q.current.filter(ge=>!ge.isWaiting),q.current=[ON,NN,...q.current],u(q.current),yN(!0),CN(!0),e.id&&V&&V({applicationId:e.id,sessionId:n,message:NN});return}if(X.index===-1&&X.code!==200&&X.code!==11915&&X.code!==11916&&(MM(),yN(!1),CN(!1),q.current=q.current.filter(TM=>!TM.isWaiting),u([...q.current]),q.current=[...q.current],X.content)){L.notification.config({getContainer:()=>(b==null?void 0:b.current)||document.body,prefixCls:"gbot-notification"}),L.notification.error({message:X.content}),L.notification.config({getContainer:void 0,prefixCls:"gbot-notification"});return}const MN=X.actions||[],gM=new RN(X.content,n,W.IHistoryRole.Robot);gM.reasoningContent=X.reasoningContent,gM.searchReference=X.searchReference,gM.thinkingSecs=X.thinkingSecs,gM.thinkingStatus=X.thinkingStatus,gM.actions=MN,gM.isLoading=!0,gM.searchingStatus=X.searchingStatus;const bM=q.current.some(TM=>TM.isWaiting);if(q.current=q.current.filter(TM=>!TM.isWaiting).filter(TM=>!TM.isReplying),bM&&(G=""),gM.renderKey=G||X.messageId||gM.messageId,G=gM.renderKey,gM.messageId=X.messageId||gM.renderKey,X.index===void 0){E=gM,r===null&&(r=requestAnimationFrame(p));return}if(MM(),(X.code===11915||X.code===11916)&&(yN(!1),CN(!1),gM.isLoading=!1,gM.content=X.code===11916?"尊敬的用户您好,让我们换个话题再聊聊吧。":"请您换个问题问我吧~",gM.isSensitive=!0,u([gM,...q.current])),X.index===-2&&(yN(!1),CN(!1),gM.isLoading=!1,gM.content="回答已中止~",gM.isSuspend=!0,u([gM,...q.current])),X.index===-1&&(yN(!1),CN(!1),gM.isLoading=!1,gM.reference=X.reference,u([gM,...q.current]),e.id)){const TM=gM.messageId;PM.current.has(TM)||(PM.current.add(TM),V&&V({applicationId:e.id,sessionId:n,message:gM}))}X.index===-3&&(yN(!1),CN(!1),gM.isLoading=!1,gM.reference=X.reference,gM.relatedQuesion=X.relatedQuesion,u([gM,...q.current]))},mM=()=>{t.addEventListener("message:updated",F)};return t.ready?t.addEventListener("message:updated",F):t.addEventListener("ready",mM),()=>{MM(),t==null||t.removeEventListener("message:updated",F),t==null||t.removeEventListener("ready",mM)}},[t]),z.useEffect(()=>{if(!t){_M(!1);return}const n=r=>{_M(r)};return _M(t.frozen),t.addEventListener("frozen",n),()=>{t==null||t.removeEventListener("frozen",n)}},[t]),z.useEffect(()=>{if(!d)return;const n=d.questionContextMaxLength||4e3;B(n)},[d,R]),z.useEffect(()=>{v&&dM(v.text)},[v]);const jN=(n,r,E)=>{gN(b,()=>{L.message.open({type:n,content:r,key:E})})},nt=n=>{const r=n.size;return r<=0?(jN("error","该文件为空,请重新上传"),!1):r>cj*Ge?(jN("error",`图片须小于${cj}M`),!1):(xM(E=>E.length>=ZN?(jN("warning",`图片最多上传${ZN}张`),E):[...E,n]),!1)},mD=()=>{var n;return(e.type===W.ApplicationTypes.Agent&&(o==null?void 0:o.imageUpload)||e.type===W.ApplicationTypes.Dialog&&((n=e.arrange)==null?void 0:n.length)&&!!e.arrange[0].visionOpen&&(o==null?void 0:o.imageUpload))&&!x},UD=()=>!!g&&(o==null?void 0:o.fileUpload)&&(e==null?void 0:e.id)&&!x,Lt=n=>{var gM,bM;const r=Array.from(n||[]).filter(Boolean);if(!r.length)return;const E=mD(),G=UD(),p=[],MM=[];let F=0,mM=0,hM=0;r.forEach(TM=>{var bt,vt,Gt;if(((bt=TM.type)==null?void 0:bt.startsWith("image/"))||!!Jt(TM.name)){E?p.push(TM):F++;return}const ON=(Gt=(vt=TM.name)==null?void 0:vt.split(".").pop())==null?void 0:Gt.toLowerCase();if(ai.includes(TM.type)||["pdf","doc","docx"].includes(ON||"")){G?MM.push(TM):mM++;return}hM++});const X=[],MN=F+mM+hM;if(!G&&!E)MN&&X.push(`当前不支持上传文件/图片,已忽略${MN}个文件`);else if(G&&!E){const TM=F+hM;TM&&X.push(`仅支持上传 .doc/.docx/.pdf 文件,已忽略${TM}个其他类型文件`)}else if(!G&&E){const TM=mM+hM;TM&&X.push(`仅支持上传图片(.jpg/.jpeg/.png/.bmp),已忽略${TM}个其他类型文件`)}else hM&&X.push(`存在不支持的文件类型,已忽略${hM}个文件`);if(X.length&&jN("warning",X.join(";"),"precheck-warn"),p.length){const TM=Math.max(0,ZN-LM.length),NN=p.slice(0,TM);NN.forEach(ON=>nt(ON)),p.length>NN.length&&jN("warning",`最多上传${ZN}张图片`)}MM.length&&((bM=(gM=JM.current)==null?void 0:gM.appendFiles)==null||bM.call(gM,MM))},At=n=>{var E;const r=(E=n.clipboardData)==null?void 0:E.files;r&&r.length&&(n.preventDefault(),n.stopPropagation(),Lt(r))},yt=n=>{n.preventDefault()},ct=n=>{var E;n.preventDefault(),n.stopPropagation();const r=(E=n.dataTransfer)==null?void 0:E.files;r&&r.length&&Lt(r)},at=()=>tM(exports,null,function*(){var n;return(n=t==null?void 0:t.data)!=null&&n.id?t:(VN.current||(VN.current=new Promise((r,E)=>{GN(!0),D==null||D({netOpen:s?UN.OPEN:UN.CLOSE}).then(G=>{var p,MM;I==null||I(G),GN(!1),y(!!((p=G.data)!=null&&p.netOpen)),ze(!!((MM=G.data)!=null&&MM.enableNetOpen)),sj(G),r(G)}).catch(G=>{VN.current=null,E(G)})})),VN.current)}),fD=n=>tM(exports,null,function*(){const r=yield at();return pD(r,n)}),pD=(n,r)=>{const E=Jt(r.name);return new Promise(G=>{var MM;const p={files:[`${Ve.v4()}.${E}`],isv:"minio",knowledgeId:((MM=n.data)==null?void 0:MM.id)||"",type:1};R==null||R.postTicket(p).then(F=>{R.uploadMinioFile(F.minio,r).then(()=>{var MN,gM;const mM=(MN=F.minio.endpoints)==null?void 0:MN[0],hM=F.minio.bucket,X=(gM=F.minio.fileKeys)==null?void 0:gM[0];G(`${F.minio.useSSL?"https:":location.protocol}//${mM}/${hM}/${X}`)}).catch(()=>{})}).catch(()=>{})})};z.useEffect(()=>{const n=h.current;n&&!Dt&&n.scrollTo({top:n.scrollHeight})},[T]);const rt=(n,r)=>new Promise(E=>{if(!r.file.url||!(e!=null&&e.id))return E();const G=qM(IM({},r.file),{type:1});R==null||R.postApplicationIdSessionKnowledgeSessionFile(e==null?void 0:e.id,n,G).finally(()=>{var p;(p=JM.current)==null||p.update().finally(E)})}),bD=()=>{var n;(n=t==null?void 0:t.data)!=null&&n.id&&(yN(!1),t.suspend())},vD=n=>{const r=h.current;r&&setTimeout(()=>{r.scrollTo({top:r.scrollHeight,behavior:n==null?void 0:n.behavior})},n==null?void 0:n.ms)},GD=()=>{if(!h.current)return;const n=h.current.scrollTop<=-80;OD(n)},PD=BN.useMemoizedFn(n=>{var r,E;(r=iM.current)==null||r.update(n),(E=iM.current)==null||E.focus()}),WD=BN.useMemoizedFn(n=>{Tj(n)}),RD=BN.useMemoizedFn(()=>{var r;if(!((r=t==null?void 0:t.data)!=null&&r.id))return;q.current=[...T.slice(1,T.length)],u(q.current);const n=new RN("",t.data.id,W.IHistoryRole.System);n.isWaiting=!0,q.current=[n,...q.current],u(q.current),CN(!0),yN(!0),t.answerAgain()});z.useEffect(()=>{var n,r;KM.current=(n=t==null?void 0:t.data)==null?void 0:n.id,!zt&&((r=QM.current)==null||r.clear())},[t]);const ZD=()=>{var E;if(!((E=t==null?void 0:t.data)!=null&&E.id))return;const r=T[T.length-1].messageTime;t.fetchMessages({endTime:r,pageSize:$t}).then(G=>{const p=G||[];if(!p||!(p!=null&&p.length)){De(!1);return}p.length<10?De(!1):De(!0),u([...T,...p.reverse()])})},_D=n=>tM(exports,null,function*(){var r,E;if(!((r=t==null?void 0:t.data)!=null&&r.id))y(n);else{if(yield t.setNetOpen(n),!((E=t.data)!=null&&E.id))return;y(n)}}),nj=()=>tM(exports,null,function*(){t?t.fetchData().then(n=>{var r;(r=t==null?void 0:t.data)!=null&&r.id&&(y(n.netOpen),ze(n.enableNetOpen))}):(y(typeof(O==null?void 0:O.connectNetwork)=="object"&&typeof(O==null?void 0:O.connectNetwork.default)=="boolean"?O.connectNetwork.default:!1),ze(e.arrange[0].enableNetOpen))});z.useEffect(()=>{nj()},[t]),z.useEffect(()=>{let n=null,r=null;const E=()=>{var X,MN;if(!h.current)return;const p=document.getElementById("chat-main"),MM=(X=h.current)==null?void 0:X.querySelector(".infinite-scroll-component__outerdiv"),F=(MN=h.current)==null?void 0:MN.querySelector(".infinite-scroll-component");if(!MM||!F||!p)return;const mM=p.offsetHeight;if(F.offsetHeight<=mM){if(MM.style.height==="100%")return;MM.style.height="100%"}else{if(MM.style.height==="auto")return;MM.style.height="auto"}},G=()=>{var F;if(typeof ResizeObserver=="undefined"||!h.current)return;const p=document.getElementById("chat-main"),MM=(F=h.current)==null?void 0:F.querySelector(".infinite-scroll-component");!MM||!p||(r=new ResizeObserver(()=>{E()}),r.observe(MM),r.observe(p))};return n=requestAnimationFrame(()=>{E(),G()}),()=>{n!==null&&cancelAnimationFrame(n),r==null||r.disconnect()}},[T]),z.useEffect(()=>{if(t)return;const n=()=>{const G=((d==null?void 0:d.promptVariables)||[]).filter(p=>p.type?!(p.type===W.PromptVariableType.User&&p.key==="query")&&!(p.type===W.PromptVariableType.System&&p.key==="datetime")&&p.status===1:p.key!=="query"&&p.status===1).map((p,MM)=>{var mM,hM;let F="";return typeof(O==null?void 0:O.promptVariables)=="object"&&(F=((hM=(mM=O.promptVariables.default)==null?void 0:mM.find(X=>X.key===p.key&&X.type===p.type))==null?void 0:hM.value)||""),{id:MM+"",key:p.key,name:p.name,value:F,type:p.type}});ie([...G].sort((p,MM)=>p.key.localeCompare(MM.key)))};return d!=null&&d.ready?n():d==null||d.addEventListener("ready",n),()=>{d==null||d.removeEventListener("ready",n)}},[t,d,O==null?void 0:O.promptVariables]);const ot=()=>D==null?void 0:D({netOpen:s?UN.OPEN:UN.CLOSE}).then(n=>{var r,E;return I==null||I(n),GN(!1),y(!!((r=n.data)!=null&&r.netOpen)),ze(!!((E=n.data)!=null&&E.enableNetOpen)),sj(n),n}),lt=!!T.length,Ct=z.useMemo(()=>{var n;return e.arrange&&((n=e.arrange[0])!=null&&n.openingContent)?i.jsx(li,{application:e,history:{role:1,content:e.arrange[0].openingContent,code:200,messageId:"opening-message",sessionId:"",reference:[],searchReference:[],messageTime:VM(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 z.useImperativeHandle(N,()=>({getCurrentInputText:()=>{var n;return(n=iM.current)==null?void 0:n.getCurrentText()},send:n=>tM(exports,null,function*(){if(!(yield Tj(n)))throw new Error("send was blocked")})})),z.useEffect(()=>{var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.id;n&&pM(E=>qM(IM({},E),{[n]:[]}))},[(Ot=t==null?void 0:t.data)==null?void 0:Ot.id]),i.jsxs("div",{className:"agent-chat",children:[wD?i.jsx("div",{className:"session-loading",children:i.jsx(L.Spin,{})}):i.jsxs(i.Fragment,{children:[(o==null?void 0:o.promptVariables)&&i.jsx(xi,{ref:lN,appId:e.id,currentSession:t,promptVariables:sN,setPromptVariables:ie,setCurrentSession:I}),i.jsxs("div",{className:"chat-main",id:"chat-main",style:K,children:[i.jsx("div",{className:"chat-main-wrapper",id:"scrollableDiv",style:{height:"100%",overflowY:"auto",display:"flex",flexDirection:"column-reverse"},ref:h,onScroll:GD,children:(Yt=t==null?void 0:t.data)!=null&&Yt.id&&(T!=null&&T.length)?i.jsxs(KD,{dataLength:T.length,next:ZD,style:{display:"flex",flexDirection:"column-reverse",overflowX:"hidden"},inverse:!0,endMessage:T.length>$t&&((xt=h.current)!=null&&xt.scrollTop)&&((dt=h.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:[T.map((n,r)=>i.jsx(Kz,{application:e,currentSession:t,history:n,docViewerUrl:j,isLastHistory:r===0,onRelatedClick:WD,onAgainClick:RD,onEditClick:PD,markdown:O==null?void 0:O.markdown},n.renderKey||`${n.messageId}-${r}`)),!gt&&Ct]}):i.jsxs("div",{className:"main-empty",children:[(O==null?void 0:O.greeting)!==!1&&i.jsx(Sz,{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:Kt.text,icon:O===void 0||O.greeting===!0||((Qt=O.greeting)==null?void 0:Qt.icon)===void 0?eM||Kt.icon:O.greeting.icon,children:!!nM.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(Oi,{ref:QM,sid:(ht=t==null?void 0:t.data)==null?void 0:ht.id,isRecommendClearing:GM,data:nM,layoutBreakpoints:typeof(O==null?void 0:O.greeting)=="object"?O.greeting.layoutBreakpoints:void 0,onItemClick:n=>{var E,G,p;if(a(n==null?void 0:n.question),dM(n==null?void 0:n.question),GM)return;n!=null&&n.id&&w(!0);const r=(E=t==null?void 0:t.data)==null?void 0:E.id;o!=null&&o.fileUpload?(p=(G=JM.current)==null?void 0:G.clear())==null||p.then(()=>{var MM,F;n!=null&&n.id&&(r?(MM=rt(r,n))==null||MM.finally(()=>{w(!1)}):(w(!1),GN(!0),(F=ot())==null||F.then(mM=>{var hM;(hM=rt(mM.id,n))==null||hM.finally(()=>{w(!1)})})))}):r?w(!1):(w(!1),GN(!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(uM,{type:"icon-zantinghuida",style:{fontSize:16}}),onClick:()=>bD(),children:"停止回答"})}),Dt&&(T==null?void 0:T.length)>0&&i.jsx("div",{className:"back-bottom",children:i.jsx(L.Button,{size:"small",onClick:()=>vD({behavior:"smooth"}),type:"link",icon:i.jsx(uM,{type:"icon-yijianhuidaodibu",style:{fontSize:24}})})})]}),i.jsx("div",{className:"chat-footer",children:i.jsxs("div",{className:"chat-footer-input",children:[LM.length>0&&i.jsx("div",{className:"input-files",children:LM.map((n,r)=>i.jsx(Ez,{className:"thumb-40",file:n,actions:{upload:E=>tM(exports,null,function*(){H(G=>G+1);try{return yield fD(E)}finally{H(G=>Math.max(0,G-1))}}),remove:()=>{xM(E=>E.filter((G,p)=>p!==r)),C(E=>E.filter((G,p)=>p!==r))}},onUrlChange:E=>{C(G=>{const p=[...G];return p[r]=E,p})}},r))}),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===W.ApplicationTypes.Agent&&(o==null?void 0:o.imageUpload)||e.type===W.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:LM.length>=ZN||x,accept:".jpg, .png, .jpeg,.bmp",listType:"picture-card",beforeUpload:nt,className:"footer-upload-picture",showUploadList:!1,children:LM.length<ZN?i.jsx(L.Tooltip,{placement:"topLeft",overlayClassName:"footer-upload-tooltip",title:i.jsx("div",{children:`支持上传.jpg .png .jpeg
|
|
10
|
-
.bmp格式的图片数据,单文件最大${cj}M,最多${ZN}张`}),children:i.jsx(L.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},icon:i.jsx(uM,{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(uM,{type:"icon-shangchuantupian",className:"icon-tianjia",style:{fontSize:"22px"}})})}),g&&(o!=null&&o.fileUpload)&&(e!=null&&e.id)?i.jsx(Yi,{appId:e==null?void 0:e.id,ref:JM,isFirstSession:zt,docViewerUrl:j,onStatusChange:n=>tM(exports,null,function*(){n!=="process"?(xe(!0),nj()):xe(!1)}),createSession:()=>at().then(n=>{var E;return((E=n.data)==null?void 0:E.id)||""}),sid:(kt=t==null?void 0:t.data)==null?void 0:kt.id,disabled:gj||x,afterFileAdd:(n,r)=>{r&&pM(E=>{const G=E[r]||[];return{[r]:[...G,n]}})},afterFileDelete:n=>{var E;const r=(E=t==null?void 0:t.data)==null?void 0:E.id;r&&pM(G=>{const p=G[r]||[];return{[r]:p.filter(MM=>MM.id!==n)}})},onFileListChange:n=>{BM(n)},shouldContinue:lD,afterFilesClear:()=>{var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.id;n&&(pM({[n]:[]}),nj())}}):null,(o==null?void 0:o.prompt)&&(e==null?void 0:e.id)&&i.jsx(Xz,{appId:e.id,list:[],search:l?EM:"",onPromptSelect:n=>{dM(n.context),a(n.context)},disabled:x})]}),i.jsxs(L.Space,{children:[(o==null?void 0:o.connectNetwork)&&e.type===W.ApplicationTypes.Dialog&&((mt=e.arrange)==null?void 0:mt.length)&&!!e.arrange[0].enableNetOpen&&i.jsx(_z,{sessionId:(Ut=t==null?void 0:t.data)==null?void 0:Ut.id,netStatus:s,enable:typeof(O==null?void 0:O.connectNetwork)=="object"&&typeof(O==null?void 0:O.connectNetwork.diabled)=="boolean"?!(O!=null&&O.connectNetwork.diabled):dD,disabledTip:t?void 0:"网络访问已被禁用",onNetStatusChange:n=>{_D(n)}}),(o==null?void 0:o.sessionList)&&i.jsx(Pz,{currentSessionId:(ft=t==null?void 0:t.data)==null?void 0:ft.id,onSessionChange:(n,r)=>{dM(void 0),Ee(!0),I==null||I(r)},disabled:x}),jM&&yM==="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:x,type:"text",icon:i.jsx(uM,{type:"icon-lishijilu",style:{fontSize:24}}),onClick:()=>st(!0)})})}),(o==null?void 0:o.sessionOpen)&&i.jsx(L.Button,{icon:i.jsx(SM.PlusOutlined,{}),className:"add-btn",type:"primary",disabled:it||!t||!T.length||x,onClick:()=>{var n,r;Ee(!1),I==null||I(null),VN.current=null,y(!1),(n=lN.current)==null||n.clear(),(r=QM.current)==null||r.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(Ci,{ref:iM,maxLength:Q,text:CM,networkStatus:!1,loading:It||we,disabled:rM||m||x||It||we,onTextSend:Tj,onChange:(n,r)=>{dM(n);const E=r.getText().replace(/[\n\s]+$/,"");a(E),zM(E),l||DM(!0)},clearAction:i.jsx(L.Space,{size:0,children:i.jsx(L.Button,{type:"link",disabled:gj||x,ghost:!0,icon:i.jsx(uM,{style:{fontSize:22},type:"icon-qingchujiyi"}),onClick:()=>SD()})})}),!!Ij&&i.jsxs("div",{className:"remainingSeconds-time",children:["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长",Ij]})]})]})}),i.jsx(mz,{tips:k}),YM&&i.jsx(pz,{isvisible:YM,files:FM,sessionId:(pt=t==null?void 0:t.data)==null?void 0:pt.id,onClose:n=>{$M(!1),CD(!1)}})]}),Tt&&i.jsx(Zz,{currentSession:t,application:e,networkStatus:s,setCurrentSession:I,disabled:x,isSessionHistoryVisible:Tt,setIsSessionHistoryVisible:st,onSessionChange:n=>{Ee(!0)}})]})});const Ei=M=>{const{disabled:N,checkedValues:e,currKnowledgeList:j,selectCount:t,onSelectChange:D}=M,[g,I]=z.useState(!1),s=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(T=>i.jsx(L.Col,{span:24,children:i.jsx(L.Checkbox,{value:T.id,children:T.name})},T.id))})}),y=T=>{I(T)};return i.jsx("div",{className:"knowledge-select",style:{borderColor:g?"#9C24F2":"#84868C"},children:i.jsx(L.Popover,{className:"select-popover",placement:"bottomRight",title:null,content:s,trigger:"click",overlayStyle:{width:280},onOpenChange:y,getPopupContainer:T=>T.parentNode,children:i.jsxs("div",{className:"",onClick:T=>T.preventDefault(),children:[i.jsx(uM,{className:"select-icon",type:"icon-open"}),i.jsx("span",{className:"title",children:"参考知识库"}),i.jsxs("span",{className:"content",children:["已选 ",t," 个"]})]})})})},Mg=M=>{var h,R;const{currentSession:N,application:e,setCheckKnowledges:j}=M,{mode:t,transform:D,features:g}=z.useContext(HM),[I,s]=z.useState([]),[y,T]=z.useState(typeof(g==null?void 0:g.knowledges)=="object"?((h=g.knowledges.default)==null?void 0:h.map(d=>d.id))||[]:[]),[u,A]=z.useState(0),[a,c]=z.useState(!1);z.useEffect(()=>{if(!(e!=null&&e.id))return;const d=e.arrange;if(!(d!=null&&d.length))return;const k=d[0].knowledges||[];s(k);const o=typeof(g==null?void 0:g.knowledges)=="object"&&g.knowledges.default||k;if(Array.isArray(o)&&o.some(Y=>Array.isArray(Y.fileIds)&&Y.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){T(o.map(NM=>NM.id)),A(o.length),j==null||j(o);return}const V=()=>{const NM=N.knowledges||o;A(NM.length);const Y=NM.map(K=>K.id);T(Y)};return V(),N.addEventListener("data:updated",V),()=>{N==null||N.removeEventListener("data:updated",V)}},[e,N]),z.useEffect(()=>{var U;if(!a||(c(!1),!(e!=null&&e.id)))return;const d=[];y==null||y.map(k=>{const o=I==null?void 0:I.find(v=>v.id===k);d.push(o)}),(U=N==null?void 0:N.data)!=null&&U.id&&N.setKnowledges(d)},[a]);const f=d=>{c(!0),T(d);const U=[];d==null||d.map(k=>{const o=I==null?void 0:I.find(v=>v.id===k);U.push(o)}),j==null||j(U),A(d.length)};return i.jsxs("div",{className:"chat-header",children:[i.jsxs(L.Space,{className:"header-title",children:[t==="inlay"&&((R=N==null?void 0:N.data)==null?void 0:R.name),t==="float"&&(e==null?void 0:e.name)]}),(D==null?void 0:D.knowledges)&&I.length!==0&&i.jsx(Ei,{disabled:typeof(g==null?void 0:g.knowledges)=="object"&&(g==null?void 0:g.knowledges.diabled)||!1,checkedValues:y,currKnowledgeList:I,selectCount:u,onSelectChange:f})]})};const Ng=z.forwardRef((M,N)=>{const{sessionId:e,appId:j,docViewerUrl:t}=M,[D,g]=z.useState(),{showHeader:I,agentClient:s,sider:y,onSessionLoad:T,features:u,mode:A}=z.useContext(HM),[a,c]=z.useState(),f=z.useRef(null),[h,R]=z.useState(""),[d,U]=z.useState(),k=z.useRef(null),[o,v]=z.useState(!1);z.useState([]);const{setIsSwitchingToExistingSession:V}=fj();z.useEffect(()=>{var Y;v(D?!!((Y=D.data)!=null&&Y.netOpen):typeof(u==null?void 0:u.connectNetwork)=="object"&&typeof(u==null?void 0:u.connectNetwork.default)=="boolean"?u.connectNetwork.default:!1)},[D]),z.useEffect(()=>{const Y=()=>tM(exports,null,function*(){const K=s==null?void 0:s.application;if(!(K!=null&&K.id))return;const x=K==null?void 0:K.arrange;if(!(x!=null&&x.length))return;const b=x[0].embeddingService;R(b),c(K)});if(s!=null&&s.ready){Y();return}return s==null||s.addEventListener("ready",()=>Y()),()=>{s==null||s.removeEventListener("ready",Y)}},[s]),z.useEffect(()=>{s&&e&&(s.ready?s==null||s.getSessions().then(Y=>tM(exports,null,function*(){g==null||g(Y.find(K=>K.id===e))})):s.addEventListener("ready",()=>tM(exports,null,function*(){s==null||s.getSessions().then(Y=>tM(exports,null,function*(){g==null||g(Y.find(K=>K.id===e))}))}),!0))},[s,e]),z.useEffect(()=>{if(!D){T&&T({applicationId:j,sessionId:"",session:null,sessionInstance:null});return}D.data&&T&&T({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D}),D.addEventListener("data:loaded",()=>{D!=null&&D.data&&T&&T({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D})},!0)},[D]);const NM=Y=>{var K;return(K=f.current)==null?void 0:K.create(qM(IM({},Y),{knowledges:d}))};return z.useImperativeHandle(N,()=>({createSession:Y=>NM(Y),getSessionList:()=>{var K;const Y=((K=f.current)==null?void 0:K.list())||[];return Promise.resolve(Y)},getCurrentInputText:()=>{var Y;return(Y=k.current)==null?void 0:Y.getCurrentInputText()},send:Y=>{var K;return(K=k.current)!=null&&K.send?k.current.send(Y):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:f,appId:j,networkStatus:o,currentSession:D,application:a,setCurrentSession:g,checkKnowledges:d,setCheckKnowledges:I?U:void 0,sessionId:e,afterSessionClick:Y=>{var K,x;((K=Y.data)==null?void 0:K.id)!==((x=D==null?void 0:D.data)==null?void 0:x.id)&&V(!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(Mg,{setCheckKnowledges:U,application:a,currentSession:D})}),i.jsx("div",{className:"dialog-chat-content",children:(a==null?void 0:a.id)&&i.jsx(qz,{setNetworkStatus:v,networkStatus:o,application:a,currentSession:D,onCreateSession:NM,docViewerUrl:t,embeddingService:h,setCurrentSession:g,ref:k})})]})})]})})}),eg=z.forwardRef((M,N)=>{const{className:e,triggerButton:j,size:t,theme:D,icon:g,docViewerUrl:I,token:s,debug:y,env:T,plugins:u,mcp:A,footer:a,defaultInput:c,onComment:f,onSessionLoad:h,onSessionUnload:R,onMessage:d,beforeMessageSend:U,bodyStyle:k,apiUrl:o,sessionId:v,disabled:V,transform:NM,features:Y,stream:K,agentClient:x,application:O}=M,b=z.useRef(null),[eM,jM]=z.useState(!1),[yM,RM]=z.useState(),[rM,_M]=z.useState(t),[q,KM]=z.useState(M.open),PM=z.useRef(null);z.useEffect(()=>{O&&(console.log("[AgentClientUI] token",x,O),RM(O.id))},[O]),L.ConfigProvider.config({theme:D}),z.useEffect(()=>{t&&_M(t)},[t]);const Q=(B,{element:LM,size:xM})=>{_M({width:Number(xM.width),height:xM.height})};return z.useImperativeHandle(N,()=>({createSession:B=>{var LM;return(LM=PM.current)==null?void 0:LM.createSession(B)},getSessionList:()=>{var B;return(B=PM.current)==null?void 0:B.getSessionList()},getCurrentInputText:()=>{var B;return(B=PM.current)==null?void 0:B.getCurrentInputText()},send:B=>{var LM;return(LM=PM.current)!=null&&LM.send?PM.current.send(B):Promise.reject(new Error("send is not available"))}})),i.jsx(L.ConfigProvider,{locale:ui,children:i.jsxs(Ai,{value:qM(IM({},M),{popupContainer:b,agentClient:x,footer:a,defaultInput:c,onComment:f,onSessionLoad:h,onSessionUnload:R,onMessage:d,beforeMessageSend:U,bodyStyle:k,disabled:V,transform:NM,features:Y}),children:[i.jsx(FD.Resizable,{height:(rM==null?void 0:rM.height)||"100%",width:(rM==null?void 0:rM.width)||"100%",maxConstraints:[document.body.clientWidth-45],minConstraints:[Number(t==null?void 0:t.minWidth)],onResize:Q,handle:i.jsx("span",{className:"resize-handle-ew"}),resizeHandles:e=="float"?["w"]:[],children:i.jsxs("div",{id:"dialog-modal",className:`gbot-dialog-modal ${e} ${q?"opened":"closed"}`,style:qM(IM({},t),{width:e=="float"?rM==null?void 0:rM.width:t==null?void 0:t.width,height:e==="float"?rM==null?void 0:rM.height:t==null?void 0:t.height,maxHeight:"100vh"}),ref:b,children:[eM?i.jsx("div",{className:"loading",children:i.jsx(L.Spin,{})}):yM&&x?i.jsx(Wz,{children:i.jsx(Ng,{ref:PM,appId:yM,docViewerUrl:I,bodyStyle:k,sessionId:v})}):null,(j==null?void 0:j.visible)&&i.jsx(L.Button,{className:"trigger-btn close-btn",icon:i.jsx("img",{src:g}),onClick:()=>KM(!1)})]})}),(j==null?void 0:j.visible)&&!q&&i.jsx(L.Button,{className:`${e}-trigger-btn open-btn`,style:j.style,icon:i.jsx("img",{src:g}),onClick:()=>KM(!0)})]})})}),jg="@glodon-aiot/agent-cli-ui",tg="3.24.0-alpha.4",ig="./dist/es/index.mjs",Dg="./dist/lib/index.js",zg="./dist/src/index.d.ts",gg={import:"./dist/es/index.mjs",require:"./dist/lib/index.js",types:"./dist/src/index.d.ts"},Ig=["dist"],Tg="module",sg="dist/src/index.d.ts",ug={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"},ng={"@ant-design/icons":"^5.3.4","@glodon-aiot/apis":"^3.24.0-alpha.4","@glodon-aiot/bot-client-sdk":"^3.24.0-alpha.4","@glodon-aiot/react-components":"^3.24.0-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"},Ag=[">0.2%","not dead","not op_mini all"],yg=["last 1 chrome version","last 1 firefox version","last 1 safari version"],cg={commitizen:{path:"node_modules/cz-customizable"},"cz-customizable":{config:".cz-config.cjs"}},ag={access:"public",registry:"https://registry.npmjs.org/"},rg={hooks:{"commit-msg":"validate-commit-msg"}},og={name:jg,version:tg,module:ig,main:Dg,typings:zg,exports:gg,files:Ig,type:Tg,types:sg,scripts:ug,dependencies:ng,devDependencies:Lg,"lint-staged":{"*.{js,css,md,jsx,less,ts,tsx,json}":"prettier --write"},production:Ag,development:yg,config:cg,publishConfig:ag,husky:rg};var Qi=(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))(Qi||{});//! moment.js
|
|
10
|
+
.bmp格式的图片数据,单文件最大${cj}M,最多${ZN}张`}),children:i.jsx(L.Button,{type:"text",className:"camera-out-btn",style:{width:"22px",position:"relative",bottom:"-2px"},icon:i.jsx(uM,{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(uM,{type:"icon-shangchuantupian",className:"icon-tianjia",style:{fontSize:"22px"}})})}),g&&(o!=null&&o.fileUpload)&&(e!=null&&e.id)?i.jsx(Yi,{appId:e==null?void 0:e.id,ref:JM,isFirstSession:zt,docViewerUrl:j,onStatusChange:n=>tM(exports,null,function*(){n!=="process"?(xe(!0),nj()):xe(!1)}),createSession:()=>at().then(n=>{var E;return((E=n.data)==null?void 0:E.id)||""}),sid:(kt=t==null?void 0:t.data)==null?void 0:kt.id,disabled:gj||x,afterFileAdd:(n,r)=>{r&&pM(E=>{const G=E[r]||[];return{[r]:[...G,n]}})},afterFileDelete:n=>{var E;const r=(E=t==null?void 0:t.data)==null?void 0:E.id;r&&pM(G=>{const p=G[r]||[];return{[r]:p.filter(MM=>MM.id!==n)}})},onFileListChange:n=>{BM(n)},shouldContinue:lD,afterFilesClear:()=>{var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.id;n&&(pM({[n]:[]}),nj())}}):null,(o==null?void 0:o.prompt)&&(e==null?void 0:e.id)&&i.jsx(Xz,{appId:e.id,list:[],search:l?EM:"",onPromptSelect:n=>{dM(n.context),a(n.context)},disabled:x})]}),i.jsxs(L.Space,{children:[(o==null?void 0:o.connectNetwork)&&e.type===W.ApplicationTypes.Dialog&&((mt=e.arrange)==null?void 0:mt.length)&&!!e.arrange[0].enableNetOpen&&i.jsx(_z,{sessionId:(Ut=t==null?void 0:t.data)==null?void 0:Ut.id,netStatus:s,enable:typeof(O==null?void 0:O.connectNetwork)=="object"&&typeof(O==null?void 0:O.connectNetwork.diabled)=="boolean"?!(O!=null&&O.connectNetwork.diabled):dD,disabledTip:t?void 0:"网络访问已被禁用",onNetStatusChange:n=>{_D(n)}}),(o==null?void 0:o.sessionList)&&i.jsx(Pz,{currentSessionId:(ft=t==null?void 0:t.data)==null?void 0:ft.id,onSessionChange:(n,r)=>{dM(void 0),Ee(!0),I==null||I(r)},disabled:x}),jM&&yM==="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:x,type:"text",icon:i.jsx(uM,{type:"icon-lishijilu",style:{fontSize:24}}),onClick:()=>st(!0)})})}),(o==null?void 0:o.sessionOpen)&&i.jsx(L.Button,{icon:i.jsx(SM.PlusOutlined,{}),className:"add-btn",type:"primary",disabled:it||!t||!T.length||x,onClick:()=>{var n,r;Ee(!1),I==null||I(null),VN.current=null,y(!1),(n=lN.current)==null||n.clear(),(r=QM.current)==null||r.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(Ci,{ref:iM,maxLength:Q,text:CM,networkStatus:!1,loading:It||we,disabled:rM||m||x||It||we,onTextSend:Tj,onChange:(n,r)=>{dM(n);const E=r.getText().replace(/[\n\s]+$/,"");a(E),zM(E),l||DM(!0)},clearAction:i.jsx(L.Space,{size:0,children:i.jsx(L.Button,{type:"link",disabled:gj||x,ghost:!0,icon:i.jsx(uM,{style:{fontSize:22},type:"icon-qingchujiyi"}),onClick:()=>SD()})})}),!!Ij&&i.jsxs("div",{className:"remainingSeconds-time",children:["您之前对话触发敏感词拦截,当前处于禁言状态,暂时无法发送消息,剩余禁言时长",Ij]})]})]})}),i.jsx(mz,{tips:k}),YM&&i.jsx(pz,{isvisible:YM,files:FM,sessionId:(pt=t==null?void 0:t.data)==null?void 0:pt.id,onClose:n=>{$M(!1),CD(!1)}})]}),Tt&&i.jsx(Zz,{currentSession:t,application:e,networkStatus:s,setCurrentSession:I,disabled:x,isSessionHistoryVisible:Tt,setIsSessionHistoryVisible:st,onSessionChange:n=>{Ee(!0)}})]})});const Ei=M=>{const{disabled:N,checkedValues:e,currKnowledgeList:j,selectCount:t,onSelectChange:D}=M,[g,I]=z.useState(!1),s=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(T=>i.jsx(L.Col,{span:24,children:i.jsx(L.Checkbox,{value:T.id,children:T.name})},T.id))})}),y=T=>{I(T)};return i.jsx("div",{className:"knowledge-select",style:{borderColor:g?"#9C24F2":"#84868C"},children:i.jsx(L.Popover,{className:"select-popover",placement:"bottomRight",title:null,content:s,trigger:"click",overlayStyle:{width:280},onOpenChange:y,getPopupContainer:T=>T.parentNode,children:i.jsxs("div",{className:"",onClick:T=>T.preventDefault(),children:[i.jsx(uM,{className:"select-icon",type:"icon-open"}),i.jsx("span",{className:"title",children:"参考知识库"}),i.jsxs("span",{className:"content",children:["已选 ",t," 个"]})]})})})},Mg=M=>{var h,R;const{currentSession:N,application:e,setCheckKnowledges:j}=M,{mode:t,transform:D,features:g}=z.useContext(HM),[I,s]=z.useState([]),[y,T]=z.useState(typeof(g==null?void 0:g.knowledges)=="object"?((h=g.knowledges.default)==null?void 0:h.map(d=>d.id))||[]:[]),[u,A]=z.useState(0),[a,c]=z.useState(!1);z.useEffect(()=>{if(!(e!=null&&e.id))return;const d=e.arrange;if(!(d!=null&&d.length))return;const k=d[0].knowledges||[];s(k);const o=typeof(g==null?void 0:g.knowledges)=="object"&&g.knowledges.default||k;if(Array.isArray(o)&&o.some(Y=>Array.isArray(Y.fileIds)&&Y.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){T(o.map(NM=>NM.id)),A(o.length),j==null||j(o);return}const V=()=>{const NM=N.knowledges||o;A(NM.length);const Y=NM.map(K=>K.id);T(Y)};return V(),N.addEventListener("data:updated",V),()=>{N==null||N.removeEventListener("data:updated",V)}},[e,N]),z.useEffect(()=>{var U;if(!a||(c(!1),!(e!=null&&e.id)))return;const d=[];y==null||y.map(k=>{const o=I==null?void 0:I.find(v=>v.id===k);d.push(o)}),(U=N==null?void 0:N.data)!=null&&U.id&&N.setKnowledges(d)},[a]);const f=d=>{c(!0),T(d);const U=[];d==null||d.map(k=>{const o=I==null?void 0:I.find(v=>v.id===k);U.push(o)}),j==null||j(U),A(d.length)};return i.jsxs("div",{className:"chat-header",children:[i.jsxs(L.Space,{className:"header-title",children:[t==="inlay"&&((R=N==null?void 0:N.data)==null?void 0:R.name),t==="float"&&(e==null?void 0:e.name)]}),(D==null?void 0:D.knowledges)&&I.length!==0&&i.jsx(Ei,{disabled:typeof(g==null?void 0:g.knowledges)=="object"&&(g==null?void 0:g.knowledges.diabled)||!1,checkedValues:y,currKnowledgeList:I,selectCount:u,onSelectChange:f})]})};const Ng=z.forwardRef((M,N)=>{const{sessionId:e,appId:j,docViewerUrl:t}=M,[D,g]=z.useState(),{showHeader:I,agentClient:s,sider:y,onSessionLoad:T,features:u,mode:A}=z.useContext(HM),[a,c]=z.useState(),f=z.useRef(null),[h,R]=z.useState(""),[d,U]=z.useState(),k=z.useRef(null),[o,v]=z.useState(!1);z.useState([]);const{setIsSwitchingToExistingSession:V}=fj();z.useEffect(()=>{var Y;v(D?!!((Y=D.data)!=null&&Y.netOpen):typeof(u==null?void 0:u.connectNetwork)=="object"&&typeof(u==null?void 0:u.connectNetwork.default)=="boolean"?u.connectNetwork.default:!1)},[D]),z.useEffect(()=>{const Y=()=>tM(exports,null,function*(){const K=s==null?void 0:s.application;if(!(K!=null&&K.id))return;const x=K==null?void 0:K.arrange;if(!(x!=null&&x.length))return;const b=x[0].embeddingService;R(b),c(K)});if(s!=null&&s.ready){Y();return}return s==null||s.addEventListener("ready",()=>Y()),()=>{s==null||s.removeEventListener("ready",Y)}},[s]),z.useEffect(()=>{s&&e&&(s.ready?s==null||s.getSessions().then(Y=>tM(exports,null,function*(){g==null||g(Y.find(K=>K.id===e))})):s.addEventListener("ready",()=>tM(exports,null,function*(){s==null||s.getSessions().then(Y=>tM(exports,null,function*(){g==null||g(Y.find(K=>K.id===e))}))}),!0))},[s,e]),z.useEffect(()=>{if(!D){T&&T({applicationId:j,sessionId:"",session:null,sessionInstance:null});return}D.data&&T&&T({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D}),D.addEventListener("data:loaded",()=>{D!=null&&D.data&&T&&T({applicationId:j,sessionId:D.data.id,session:D.data,sessionInstance:D})},!0)},[D]);const NM=Y=>{var K;return(K=f.current)==null?void 0:K.create(qM(IM({},Y),{knowledges:d}))};return z.useImperativeHandle(N,()=>({createSession:Y=>NM(Y),getSessionList:()=>{var K;const Y=((K=f.current)==null?void 0:K.list())||[];return Promise.resolve(Y)},getCurrentInputText:()=>{var Y;return(Y=k.current)==null?void 0:Y.getCurrentInputText()},send:Y=>{var K;return(K=k.current)!=null&&K.send?k.current.send(Y):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:f,appId:j,networkStatus:o,currentSession:D,application:a,setCurrentSession:g,checkKnowledges:d,setCheckKnowledges:I?U:void 0,sessionId:e,afterSessionClick:Y=>{var K,x;((K=Y.data)==null?void 0:K.id)!==((x=D==null?void 0:D.data)==null?void 0:x.id)&&V(!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(Mg,{setCheckKnowledges:U,application:a,currentSession:D})}),i.jsx("div",{className:"dialog-chat-content",children:(a==null?void 0:a.id)&&i.jsx(qz,{setNetworkStatus:v,networkStatus:o,application:a,currentSession:D,onCreateSession:NM,docViewerUrl:t,embeddingService:h,setCurrentSession:g,ref:k})})]})})]})})}),eg=z.forwardRef((M,N)=>{const{className:e,triggerButton:j,size:t,theme:D,icon:g,docViewerUrl:I,token:s,debug:y,env:T,plugins:u,mcp:A,footer:a,defaultInput:c,onComment:f,onSessionLoad:h,onSessionUnload:R,onMessage:d,beforeMessageSend:U,bodyStyle:k,apiUrl:o,sessionId:v,disabled:V,transform:NM,features:Y,stream:K,agentClient:x,application:O}=M,b=z.useRef(null),[eM,jM]=z.useState(!1),[yM,RM]=z.useState(),[rM,_M]=z.useState(t),[q,KM]=z.useState(M.open),PM=z.useRef(null);z.useEffect(()=>{O&&(console.log("[AgentClientUI] token",x,O),RM(O.id))},[O]),L.ConfigProvider.config({theme:D}),z.useEffect(()=>{t&&_M(t)},[t]);const Q=(B,{element:LM,size:xM})=>{_M({width:Number(xM.width),height:xM.height})};return z.useImperativeHandle(N,()=>({createSession:B=>{var LM;return(LM=PM.current)==null?void 0:LM.createSession(B)},getSessionList:()=>{var B;return(B=PM.current)==null?void 0:B.getSessionList()},getCurrentInputText:()=>{var B;return(B=PM.current)==null?void 0:B.getCurrentInputText()},send:B=>{var LM;return(LM=PM.current)!=null&&LM.send?PM.current.send(B):Promise.reject(new Error("send is not available"))}})),i.jsx(L.ConfigProvider,{locale:ui,children:i.jsxs(Ai,{value:qM(IM({},M),{popupContainer:b,agentClient:x,footer:a,defaultInput:c,onComment:f,onSessionLoad:h,onSessionUnload:R,onMessage:d,beforeMessageSend:U,bodyStyle:k,disabled:V,transform:NM,features:Y}),children:[i.jsx(FD.Resizable,{height:(rM==null?void 0:rM.height)||"100%",width:(rM==null?void 0:rM.width)||"100%",maxConstraints:[document.body.clientWidth-45],minConstraints:[Number(t==null?void 0:t.minWidth)],onResize:Q,handle:i.jsx("span",{className:"resize-handle-ew"}),resizeHandles:e=="float"?["w"]:[],children:i.jsxs("div",{id:"dialog-modal",className:`gbot-dialog-modal ${e} ${q?"opened":"closed"}`,style:qM(IM({},t),{width:e=="float"?rM==null?void 0:rM.width:t==null?void 0:t.width,height:e==="float"?rM==null?void 0:rM.height:t==null?void 0:t.height,maxHeight:"100vh"}),ref:b,children:[eM?i.jsx("div",{className:"loading",children:i.jsx(L.Spin,{})}):yM&&x?i.jsx(Wz,{children:i.jsx(Ng,{ref:PM,appId:yM,docViewerUrl:I,bodyStyle:k,sessionId:v})}):null,(j==null?void 0:j.visible)&&i.jsx(L.Button,{className:"trigger-btn close-btn",icon:i.jsx("img",{src:g}),onClick:()=>KM(!1)})]})}),(j==null?void 0:j.visible)&&!q&&i.jsx(L.Button,{className:`${e}-trigger-btn open-btn`,style:j.style,icon:i.jsx("img",{src:g}),onClick:()=>KM(!0)})]})})}),jg="@glodon-aiot/agent-cli-ui",tg="3.24.0-alpha.5",ig="./dist/es/index.mjs",Dg="./dist/lib/index.js",zg="./dist/src/index.d.ts",gg={import:"./dist/es/index.mjs",require:"./dist/lib/index.js",types:"./dist/src/index.d.ts"},Ig=["dist"],Tg="module",sg="dist/src/index.d.ts",ug={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"},ng={"@ant-design/icons":"^5.3.4","@glodon-aiot/apis":"^3.24.0-alpha.5","@glodon-aiot/bot-client-sdk":"^3.24.0-alpha.5","@glodon-aiot/react-components":"^3.24.0-alpha.5","@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"},Ag=[">0.2%","not dead","not op_mini all"],yg=["last 1 chrome version","last 1 firefox version","last 1 safari version"],cg={commitizen:{path:"node_modules/cz-customizable"},"cz-customizable":{config:".cz-config.cjs"}},ag={access:"public",registry:"https://registry.npmjs.org/"},rg={hooks:{"commit-msg":"validate-commit-msg"}},og={name:jg,version:tg,module:ig,main:Dg,typings:zg,exports:gg,files:Ig,type:Tg,types:sg,scripts:ug,dependencies:ng,devDependencies:Lg,"lint-staged":{"*.{js,css,md,jsx,less,ts,tsx,json}":"prettier --write"},production:Ag,development:yg,config:cg,publishConfig:ag,husky:rg};var Qi=(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))(Qi||{});//! moment.js
|
|
11
11
|
//! version : 2.30.1
|
|
12
12
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
13
13
|
//! license : MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glodon-aiot/agent-cli-ui",
|
|
3
|
-
"version": "3.24.0-alpha.
|
|
3
|
+
"version": "3.24.0-alpha.5",
|
|
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.24.0-alpha.
|
|
35
|
-
"@glodon-aiot/bot-client-sdk": "^3.24.0-alpha.
|
|
36
|
-
"@glodon-aiot/react-components": "^3.24.0-alpha.
|
|
34
|
+
"@glodon-aiot/apis": "^3.24.0-alpha.5",
|
|
35
|
+
"@glodon-aiot/bot-client-sdk": "^3.24.0-alpha.5",
|
|
36
|
+
"@glodon-aiot/react-components": "^3.24.0-alpha.5",
|
|
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",
|