gimc-ai-agent 1.0.30 → 1.0.31

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.
@@ -1914,7 +1914,7 @@ eE.interceptors.response.use(
1914
1914
  return Promise.resolve(U);
1915
1915
  if (V.code === 403 && V.body) {
1916
1916
  const l = location.host;
1917
- return V.body.includes && !V.body.includes(l) && localStorage.removeItem("gimc-ai-agent-token"), location.href = V.body, Promise.reject(U);
1917
+ return V.body.includes && !V.body.includes(l) && localStorage.removeItem("gimc-ai-agent-token"), Promise.reject(U);
1918
1918
  }
1919
1919
  return JR({
1920
1920
  message: V.message,
@@ -3,7 +3,7 @@ var yh=Object.defineProperty;var Kh=(SV,M,zV)=>M in SV?yh(SV,M,{enumerable:!0,co
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(V){return V instanceof this?V:new this(V)}static concat(V,...R){const N=new this(V);return R.forEach(l=>N.set(l)),N}static accessor(V){const N=(this[mE]=this[mE]={accessors:{}}).accessors,l=this.prototype;function Z(d){const E=HR(d);N[E]||(oW(l,d),N[E]=!0)}return k.isArray(V)?V.forEach(Z):Z(V),this}}EU.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),k.reduceDescriptors(EU.prototype,({value:U},V)=>{let R=V[0].toUpperCase()+V.slice(1);return{get:()=>U,set(N){this[R]=N}}}),k.freezeMethods(EU);const TR=EU;function uU(U,V){const R=this||XU,N=V||R,l=TR.from(N.headers);let Z=N.data;return k.forEach(U,function(E){Z=E.call(R,Z,l.normalize(),V?V.status:void 0)}),l.normalize(),Z}function kE(U){return!!(U&&U.__CANCEL__)}function sR(U,V,R){NV.call(this,U??"canceled",NV.ERR_CANCELED,V,R),this.name="CanceledError"}k.inherits(sR,NV,{__CANCEL__:!0});function iE(U,V,R){const N=R.config.validateStatus;!R.status||!N||N(R.status)?U(R):V(new NV("Request failed with status code "+R.status,[NV.ERR_BAD_REQUEST,NV.ERR_BAD_RESPONSE][Math.floor(R.status/100)-4],R.config,R.request,R))}function GW(U){const V=/^([-+\w]{1,25})(:?\/\/|:)/.exec(U);return V&&V[1]||""}function IW(U,V){U=U||10;const R=new Array(U),N=new Array(U);let l=0,Z=0,d;return V=V!==void 0?V:1e3,function(T){const e=Date.now(),a=N[Z];d||(d=e),R[l]=T,N[l]=e;let F=Z,Q=0;for(;F!==l;)Q+=R[F++],F=F%U;if(l=(l+1)%U,l===Z&&(Z=(Z+1)%U),e-d<V)return;const c=a&&e-a;return c?Math.round(Q*1e3/c):void 0}}function rW(U,V){let R=0,N=1e3/V,l,Z;const d=(e,a=Date.now())=>{R=a,l=null,Z&&(clearTimeout(Z),Z=null),U(...e)};return[(...e)=>{const a=Date.now(),F=a-R;F>=N?d(e,a):(l=e,Z||(Z=setTimeout(()=>{Z=null,d(l)},N-F)))},()=>l&&d(l)]}const eU=(U,V,R=3)=>{let N=0;const l=IW(50,250);return rW(Z=>{const d=Z.loaded,E=Z.lengthComputable?Z.total:void 0,T=d-N,e=l(T),a=d<=E;N=d;const F={loaded:d,total:E,progress:E?d/E:void 0,bytes:T,rate:e||void 0,estimated:e&&E&&a?(E-d)/e:void 0,event:Z,lengthComputable:E!=null,[V?"download":"upload"]:!0};U(F)},R)},YE=(U,V)=>{const R=U!=null;return[N=>V[0]({lengthComputable:R,total:U,loaded:N}),V[1]]},BE=U=>(...V)=>k.asap(()=>U(...V)),JW=xV.hasStandardBrowserEnv?((U,V)=>R=>(R=new URL(R,xV.origin),U.protocol===R.protocol&&U.host===R.host&&(V||U.port===R.port)))(new URL(xV.origin),xV.navigator&&/(msie|trident)/i.test(xV.navigator.userAgent)):()=>!0,pW=xV.hasStandardBrowserEnv?{write(U,V,R,N,l,Z,d){if(typeof document>"u")return;const E=[`${U}=${encodeURIComponent(V)}`];k.isNumber(R)&&E.push(`expires=${new Date(R).toUTCString()}`),k.isString(N)&&E.push(`path=${N}`),k.isString(l)&&E.push(`domain=${l}`),Z===!0&&E.push("secure"),k.isString(d)&&E.push(`SameSite=${d}`),document.cookie=E.join("; ")},read(U){if(typeof document>"u")return null;const V=document.cookie.match(new RegExp("(?:^|; )"+U+"=([^;]*)"));return V?decodeURIComponent(V[1]):null},remove(U){this.write(U,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function DW(U){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(U)}function zW(U,V){return V?U.replace(/\/?\/$/,"")+"/"+V.replace(/^\/+/,""):U}function oE(U,V,R){let N=!DW(V);return U&&(N||R==!1)?zW(U,V):V}const GE=U=>U instanceof TR?{...U}:U;function GR(U,V){V=V||{};const R={};function N(e,a,F,Q){return k.isPlainObject(e)&&k.isPlainObject(a)?k.merge.call({caseless:Q},e,a):k.isPlainObject(a)?k.merge({},a):k.isArray(a)?a.slice():a}function l(e,a,F,Q){if(k.isUndefined(a)){if(!k.isUndefined(e))return N(void 0,e,F,Q)}else return N(e,a,F,Q)}function Z(e,a){if(!k.isUndefined(a))return N(void 0,a)}function d(e,a){if(k.isUndefined(a)){if(!k.isUndefined(e))return N(void 0,e)}else return N(void 0,a)}function E(e,a,F){if(F in V)return N(e,a);if(F in U)return N(void 0,e)}const T={url:Z,method:Z,data:Z,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:E,headers:(e,a,F)=>l(GE(e),GE(a),F,!0)};return k.forEach(Object.keys({...U,...V}),function(a){const F=T[a]||l,Q=F(U[a],V[a],a);k.isUndefined(Q)&&F!==E||(R[a]=Q)}),R}const IE=U=>{const V=GR({},U);let{data:R,withXSRFToken:N,xsrfHeaderName:l,xsrfCookieName:Z,headers:d,auth:E}=V;if(V.headers=d=TR.from(d),V.url=tE(oE(V.baseURL,V.url,V.allowAbsoluteUrls),U.params,U.paramsSerializer),E&&d.set("Authorization","Basic "+btoa((E.username||"")+":"+(E.password?unescape(encodeURIComponent(E.password)):""))),k.isFormData(R)){if(xV.hasStandardBrowserEnv||xV.hasStandardBrowserWebWorkerEnv)d.setContentType(void 0);else if(k.isFunction(R.getHeaders)){const T=R.getHeaders(),e=["content-type","content-length"];Object.entries(T).forEach(([a,F])=>{e.includes(a.toLowerCase())&&d.set(a,F)})}}if(xV.hasStandardBrowserEnv&&(N&&k.isFunction(N)&&(N=N(V)),N||N!==!1&&JW(V.url))){const T=l&&Z&&pW.read(Z);T&&d.set(l,T)}return V},sW=typeof XMLHttpRequest<"u"&&function(U){return new Promise(function(R,N){const l=IE(U);let Z=l.data;const d=TR.from(l.headers).normalize();let{responseType:E,onUploadProgress:T,onDownloadProgress:e}=l,a,F,Q,c,W;function t(){c&&c(),W&&W(),l.cancelToken&&l.cancelToken.unsubscribe(a),l.signal&&l.signal.removeEventListener("abort",a)}let A=new XMLHttpRequest;A.open(l.method.toUpperCase(),l.url,!0),A.timeout=l.timeout;function m(){if(!A)return;const h=TR.from("getAllResponseHeaders"in A&&A.getAllResponseHeaders()),G={data:!E||E==="text"||E==="json"?A.responseText:A.response,status:A.status,statusText:A.statusText,headers:h,config:U,request:A};iE(function(g){R(g),t()},function(g){N(g),t()},G),A=null}"onloadend"in A?A.onloadend=m:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(m)},A.onabort=function(){A&&(N(new NV("Request aborted",NV.ECONNABORTED,U,A)),A=null)},A.onerror=function(i){const G=i&&i.message?i.message:"Network Error",o=new NV(G,NV.ERR_NETWORK,U,A);o.event=i||null,N(o),A=null},A.ontimeout=function(){let i=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const G=l.transitional||SE;l.timeoutErrorMessage&&(i=l.timeoutErrorMessage),N(new NV(i,G.clarifyTimeoutError?NV.ETIMEDOUT:NV.ECONNABORTED,U,A)),A=null},Z===void 0&&d.setContentType(null),"setRequestHeader"in A&&k.forEach(d.toJSON(),function(i,G){A.setRequestHeader(G,i)}),k.isUndefined(l.withCredentials)||(A.withCredentials=!!l.withCredentials),E&&E!=="json"&&(A.responseType=l.responseType),e&&([Q,W]=eU(e,!0),A.addEventListener("progress",Q)),T&&A.upload&&([F,c]=eU(T),A.upload.addEventListener("progress",F),A.upload.addEventListener("loadend",c)),(l.cancelToken||l.signal)&&(a=h=>{A&&(N(!h||h.type?new sR(null,U,A):h),A.abort(),A=null)},l.cancelToken&&l.cancelToken.subscribe(a),l.signal&&(l.signal.aborted?a():l.signal.addEventListener("abort",a)));const Y=GW(l.url);if(Y&&xV.protocols.indexOf(Y)===-1){N(new NV("Unsupported protocol "+Y+":",NV.ERR_BAD_REQUEST,U));return}A.send(Z||null)})},gW=(U,V)=>{const{length:R}=U=U?U.filter(Boolean):[];if(V||R){let N=new AbortController,l;const Z=function(e){if(!l){l=!0,E();const a=e instanceof Error?e:this.reason;N.abort(a instanceof NV?a:new sR(a instanceof Error?a.message:a))}};let d=V&&setTimeout(()=>{d=null,Z(new NV(`timeout ${V} of ms exceeded`,NV.ETIMEDOUT))},V);const E=()=>{U&&(d&&clearTimeout(d),d=null,U.forEach(e=>{e.unsubscribe?e.unsubscribe(Z):e.removeEventListener("abort",Z)}),U=null)};U.forEach(e=>e.addEventListener("abort",Z));const{signal:T}=N;return T.unsubscribe=()=>k.asap(E),T}},CW=function*(U,V){let R=U.byteLength;if(!V||R<V){yield U;return}let N=0,l;for(;N<R;)l=N+V,yield U.slice(N,l),N=l},OW=async function*(U,V){for await(const R of bW(U))yield*CW(R,V)},bW=async function*(U){if(U[Symbol.asyncIterator]){yield*U;return}const V=U.getReader();try{for(;;){const{done:R,value:N}=await V.read();if(R)break;yield N}}finally{await V.cancel()}},rE=(U,V,R,N)=>{const l=OW(U,V);let Z=0,d,E=T=>{d||(d=!0,N&&N(T))};return new ReadableStream({async pull(T){try{const{done:e,value:a}=await l.next();if(e){E(),T.close();return}let F=a.byteLength;if(R){let Q=Z+=F;R(Q)}T.enqueue(new Uint8Array(a))}catch(e){throw E(e),e}},cancel(T){return E(T),l.return()}},{highWaterMark:2})},JE=64*1024,{isFunction:TU}=k,wW=(({Request:U,Response:V})=>({Request:U,Response:V}))(k.global),{ReadableStream:pE,TextEncoder:DE}=k.global,zE=(U,...V)=>{try{return!!U(...V)}catch{return!1}},jW=U=>{U=k.merge.call({skipUndefined:!0},wW,U);const{fetch:V,Request:R,Response:N}=U,l=V?TU(V):typeof fetch=="function",Z=TU(R),d=TU(N);if(!l)return!1;const E=l&&TU(pE),T=l&&(typeof DE=="function"?(W=>t=>W.encode(t))(new DE):async W=>new Uint8Array(await new R(W).arrayBuffer())),e=Z&&E&&zE(()=>{let W=!1;const t=new R(xV.origin,{body:new pE,method:"POST",get duplex(){return W=!0,"half"}}).headers.has("Content-Type");return W&&!t}),a=d&&E&&zE(()=>k.isReadableStream(new N("").body)),F={stream:a&&(W=>W.body)};l&&["text","arrayBuffer","blob","formData","stream"].forEach(W=>{!F[W]&&(F[W]=(t,A)=>{let m=t&&t[W];if(m)return m.call(t);throw new NV(`Response type '${W}' is not supported`,NV.ERR_NOT_SUPPORT,A)})});const Q=async W=>{if(W==null)return 0;if(k.isBlob(W))return W.size;if(k.isSpecCompliantForm(W))return(await new R(xV.origin,{method:"POST",body:W}).arrayBuffer()).byteLength;if(k.isArrayBufferView(W)||k.isArrayBuffer(W))return W.byteLength;if(k.isURLSearchParams(W)&&(W=W+""),k.isString(W))return(await T(W)).byteLength},c=async(W,t)=>{const A=k.toFiniteNumber(W.getContentLength());return A??Q(t)};return async W=>{let{url:t,method:A,data:m,signal:Y,cancelToken:h,timeout:i,onDownloadProgress:G,onUploadProgress:o,responseType:g,headers:C,withCredentials:j="same-origin",fetchOptions:x}=IE(W),D=V||fetch;g=g?(g+"").toLowerCase():"text";let f=gW([Y,h&&h.toAbortSignal()],i),H=null;const ZV=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let VV;try{if(o&&e&&A!=="get"&&A!=="head"&&(VV=await c(C,m))!==0){let u=new R(t,{method:"POST",body:m,duplex:"half"}),QV;if(k.isFormData(m)&&(QV=u.headers.get("content-type"))&&C.setContentType(QV),u.body){const[lV,EV]=YE(VV,eU(BE(o)));m=rE(u.body,JE,lV,EV)}}k.isString(j)||(j=j?"include":"omit");const B=Z&&"credentials"in R.prototype,J={...x,signal:f,method:A.toUpperCase(),headers:C.normalize().toJSON(),body:m,duplex:"half",credentials:B?j:void 0};H=Z&&new R(t,J);let O=await(Z?D(H,x):D(t,J));const X=a&&(g==="stream"||g==="response");if(a&&(G||X&&ZV)){const u={};["status","statusText","headers"].forEach(v=>{u[v]=O[v]});const QV=k.toFiniteNumber(O.headers.get("content-length")),[lV,EV]=G&&YE(QV,eU(BE(G),!0))||[];O=new N(rE(O.body,JE,lV,()=>{EV&&EV(),ZV&&ZV()}),u)}g=g||"text";let UV=await F[k.findKey(F,g)||"text"](O,W);return!X&&ZV&&ZV(),await new Promise((u,QV)=>{iE(u,QV,{data:UV,headers:TR.from(O.headers),status:O.status,statusText:O.statusText,config:W,request:H})})}catch(B){throw ZV&&ZV(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new NV("Network Error",NV.ERR_NETWORK,W,H),{cause:B.cause||B}):NV.from(B,B&&B.code,W,H)}}},xW=new Map,sE=U=>{let V=U&&U.env||{};const{fetch:R,Request:N,Response:l}=V,Z=[N,l,R];let d=Z.length,E=d,T,e,a=xW;for(;E--;)T=Z[E],e=a.get(T),e===void 0&&a.set(T,e=E?new Map:jW(V)),a=e;return e};sE();const vU={http:eW,xhr:sW,fetch:{get:sE}};k.forEach(vU,(U,V)=>{if(U){try{Object.defineProperty(U,"name",{value:V})}catch{}Object.defineProperty(U,"adapterName",{value:V})}});const gE=U=>`- ${U}`,HW=U=>k.isFunction(U)||U===null||U===!1;function yW(U,V){U=k.isArray(U)?U:[U];const{length:R}=U;let N,l;const Z={};for(let d=0;d<R;d++){N=U[d];let E;if(l=N,!HW(N)&&(l=vU[(E=String(N)).toLowerCase()],l===void 0))throw new NV(`Unknown adapter '${E}'`);if(l&&(k.isFunction(l)||(l=l.get(V))))break;Z[E||"#"+d]=l}if(!l){const d=Object.entries(Z).map(([T,e])=>`adapter ${T} `+(e===!1?"is not supported by the environment":"is not available in the build"));let E=R?d.length>1?`since :
4
4
  `+d.map(gE).join(`
5
5
  `):" "+gE(d[0]):"as no adapter specified";throw new NV("There is no suitable adapter to dispatch the request "+E,"ERR_NOT_SUPPORT")}return l}const CE={getAdapter:yW,adapters:vU};function qU(U){if(U.cancelToken&&U.cancelToken.throwIfRequested(),U.signal&&U.signal.aborted)throw new sR(null,U)}function OE(U){return qU(U),U.headers=TR.from(U.headers),U.data=uU.call(U,U.transformRequest),["post","put","patch"].indexOf(U.method)!==-1&&U.headers.setContentType("application/x-www-form-urlencoded",!1),CE.getAdapter(U.adapter||XU.adapter,U)(U).then(function(N){return qU(U),N.data=uU.call(U,U.transformResponse,N),N.headers=TR.from(N.headers),N},function(N){return kE(N)||(qU(U),N&&N.response&&(N.response.data=uU.call(U,U.transformResponse,N.response),N.response.headers=TR.from(N.response.headers))),Promise.reject(N)})}const bE="1.13.2",aU={};["object","boolean","number","function","string","symbol"].forEach((U,V)=>{aU[U]=function(N){return typeof N===U||"a"+(V<1?"n ":" ")+U}});const wE={};aU.transitional=function(V,R,N){function l(Z,d){return"[Axios v"+bE+"] Transitional option '"+Z+"'"+d+(N?". "+N:"")}return(Z,d,E)=>{if(V===!1)throw new NV(l(d," has been removed"+(R?" in "+R:"")),NV.ERR_DEPRECATED);return R&&!wE[d]&&(wE[d]=!0,console.warn(l(d," has been deprecated since v"+R+" and will be removed in the near future"))),V?V(Z,d,E):!0}},aU.spelling=function(V){return(R,N)=>(console.warn(`${N} is likely a misspelling of ${V}`),!0)};function KW(U,V,R){if(typeof U!="object")throw new NV("options must be an object",NV.ERR_BAD_OPTION_VALUE);const N=Object.keys(U);let l=N.length;for(;l-- >0;){const Z=N[l],d=V[Z];if(d){const E=U[Z],T=E===void 0||d(E,Z,U);if(T!==!0)throw new NV("option "+Z+" must be "+T,NV.ERR_BAD_OPTION_VALUE);continue}if(R!==!0)throw new NV("Unknown option "+Z,NV.ERR_BAD_OPTION)}}const MU={assertOptions:KW,validators:aU},cR=MU.validators;class FU{constructor(V){this.defaults=V||{},this.interceptors={request:new nE,response:new nE}}async request(V,R){try{return await this._request(V,R)}catch(N){if(N instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const Z=l.stack?l.stack.replace(/^.+\n/,""):"";try{N.stack?Z&&!String(N.stack).endsWith(Z.replace(/^.+\n.+\n/,""))&&(N.stack+=`
6
- `+Z):N.stack=Z}catch{}}throw N}}_request(V,R){typeof V=="string"?(R=R||{},R.url=V):R=V||{},R=GR(this.defaults,R);const{transitional:N,paramsSerializer:l,headers:Z}=R;N!==void 0&&MU.assertOptions(N,{silentJSONParsing:cR.transitional(cR.boolean),forcedJSONParsing:cR.transitional(cR.boolean),clarifyTimeoutError:cR.transitional(cR.boolean)},!1),l!=null&&(k.isFunction(l)?R.paramsSerializer={serialize:l}:MU.assertOptions(l,{encode:cR.function,serialize:cR.function},!0)),R.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?R.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:R.allowAbsoluteUrls=!0),MU.assertOptions(R,{baseUrl:cR.spelling("baseURL"),withXsrfToken:cR.spelling("withXSRFToken")},!0),R.method=(R.method||this.defaults.method||"get").toLowerCase();let d=Z&&k.merge(Z.common,Z[R.method]);Z&&k.forEach(["delete","get","head","post","put","patch","common"],W=>{delete Z[W]}),R.headers=TR.concat(d,Z);const E=[];let T=!0;this.interceptors.request.forEach(function(t){typeof t.runWhen=="function"&&t.runWhen(R)===!1||(T=T&&t.synchronous,E.unshift(t.fulfilled,t.rejected))});const e=[];this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});let a,F=0,Q;if(!T){const W=[OE.bind(this),void 0];for(W.unshift(...E),W.push(...e),Q=W.length,a=Promise.resolve(R);F<Q;)a=a.then(W[F++],W[F++]);return a}Q=E.length;let c=R;for(;F<Q;){const W=E[F++],t=E[F++];try{c=W(c)}catch(A){t.call(this,A);break}}try{a=OE.call(this,c)}catch(W){return Promise.reject(W)}for(F=0,Q=e.length;F<Q;)a=a.then(e[F++],e[F++]);return a}getUri(V){V=GR(this.defaults,V);const R=oE(V.baseURL,V.url,V.allowAbsoluteUrls);return tE(R,V.params,V.paramsSerializer)}}k.forEach(["delete","get","head","options"],function(V){FU.prototype[V]=function(R,N){return this.request(GR(N||{},{method:V,url:R,data:(N||{}).data}))}}),k.forEach(["post","put","patch"],function(V){function R(N){return function(Z,d,E){return this.request(GR(E||{},{method:V,headers:N?{"Content-Type":"multipart/form-data"}:{},url:Z,data:d}))}}FU.prototype[V]=R(),FU.prototype[V+"Form"]=R(!0)});const WU=FU;class PU{constructor(V){if(typeof V!="function")throw new TypeError("executor must be a function.");let R;this.promise=new Promise(function(Z){R=Z});const N=this;this.promise.then(l=>{if(!N._listeners)return;let Z=N._listeners.length;for(;Z-- >0;)N._listeners[Z](l);N._listeners=null}),this.promise.then=l=>{let Z;const d=new Promise(E=>{N.subscribe(E),Z=E}).then(l);return d.cancel=function(){N.unsubscribe(Z)},d},V(function(Z,d,E){N.reason||(N.reason=new sR(Z,d,E),R(N.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(V){if(this.reason){V(this.reason);return}this._listeners?this._listeners.push(V):this._listeners=[V]}unsubscribe(V){if(!this._listeners)return;const R=this._listeners.indexOf(V);R!==-1&&this._listeners.splice(R,1)}toAbortSignal(){const V=new AbortController,R=N=>{V.abort(N)};return this.subscribe(R),V.signal.unsubscribe=()=>this.unsubscribe(R),V.signal}static source(){let V;return{token:new PU(function(l){V=l}),cancel:V}}}const XW=PU;function LW(U){return function(R){return U.apply(null,R)}}function uW(U){return k.isObject(U)&&U.isAxiosError===!0}const fU={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fU).forEach(([U,V])=>{fU[V]=U});const vW=fU;function jE(U){const V=new WU(U),R=UE(WU.prototype.request,V);return k.extend(R,WU.prototype,V,{allOwnKeys:!0}),k.extend(R,V,null,{allOwnKeys:!0}),R.create=function(l){return jE(GR(U,l))},R}const sV=jE(XU);sV.Axios=WU,sV.CanceledError=sR,sV.CancelToken=XW,sV.isCancel=kE,sV.VERSION=bE,sV.toFormData=ZU,sV.AxiosError=NV,sV.Cancel=sV.CanceledError,sV.all=function(V){return Promise.all(V)},sV.spread=LW,sV.isAxiosError=uW,sV.mergeConfig=GR,sV.AxiosHeaders=TR,sV.formToJSON=U=>hE(k.isHTMLForm(U)?new FormData(U):U),sV.getAdapter=CE.getAdapter,sV.HttpStatusCode=vW,sV.default=sV;const xE=sV,HE={development:{apiUrl:"http://dev-api.gw.gimccloud.com:32619/lxai-web-api",apiUrlLoginout:"http://dev-api.gw.gimccloud.com:32619",projectName:"省广智能客服",tokenName:"gimc-ai-agent",registrationId:"gimc-lxai-admin-oidc",jumpToLogin:!0},production:{apiUrl:"https://api.gimccloud.com/lxai-web-api/",apiUrlLoginout:"https://api.gimccloud.com",projectName:"灵犀AI后台管理",tokenName:"gimc-lxai-admin-front",registrationId:"gimc-lxai-admin-oidc",jumpToLogin:!0}};class qW{constructor(){jV(this,"currentEnv","production");jV(this,"currentConfig",HE.production)}setEnvironment(V){this.currentEnv=V,this.currentConfig=HE[V]}getEnvironment(){return this.currentEnv}getConfig(){return this.currentConfig}getApiUrl(){return this.currentConfig.apiUrl}getApiUrlLoginout(){return this.currentConfig.apiUrlLoginout}getProjectName(){return this.currentConfig.projectName}getTokenName(){return this.currentConfig.tokenName}getRegistrationId(){return this.currentConfig.registrationId}shouldJumpToLogin(){return this.currentConfig.jumpToLogin}}const gR=new qW,_U=xE.create({timeout:6e4,withCredentials:!0,headers:{"Cache-Control":"no-cache","If-Modified-Since":"0"}});_U.interceptors.request.use(U=>{U.baseURL=gR.getApiUrl();const V=BR.getToken()||localStorage.getItem("gimc-ai-agent-token");return V&&U.url&&!U.url.includes("oauth2")&&(U.headers.Authorization=`bearer ${V}`),U},U=>Promise.reject(U)),_U.interceptors.response.use(async U=>{var R,N;const V=U.data;if(V instanceof Blob)return Promise.resolve(U);if((N=(R=U==null?void 0:U.config)==null?void 0:R.url)!=null&&N.includes("/logout")&&V.code===400||(V==null?void 0:V.code)===401)return localStorage.removeItem("gimc-ai-agent-token"),Promise.reject(U);if((V==null?void 0:V.code)===200)return Promise.resolve(U);if(V.code===403&&V.body){const l=location.host;return V.body.includes&&!V.body.includes(l)&&localStorage.removeItem("gimc-ai-agent-token"),location.href=V.body,Promise.reject(U)}return hR.ElMessage({message:V.message,type:"error",duration:1e3}),Promise.reject(U)},U=>xE.isCancel(U)?new Promise(()=>{}):(hR.ElMessage({message:U.message,type:"error",duration:1e3}),Promise.reject(U)));const QU=U=>{const V=U;return new Promise((R,N)=>{_U.request(V).then(l=>{if(l.data instanceof Blob)R(l);else{const{data:{body:Z}}=l;R(Z)}}).catch(l=>{N(l)})})};function yR(U){return QU({...U,method:"GET"})}function yE(U){return QU({...U,method:"POST"})}function KE(U){return QU({...U,method:"PUT"})}function PW(U){return QU({...U,method:"DELETE"})}class fW{askStream(V,R,N,l){const Z=gR.getApiUrl();if(!(BR.getToken()||localStorage.getItem("gimc-ai-agent-token")))return console.error("Token not found"),N==null||N({message:"Token not found"}),null;const E=new URLSearchParams;V.sid&&E.append("sid",V.sid.toString()),E.append("q",V.q),E.append("ragKnowledgeId",V.ragKnowledgeId.toString()),V.contractFileUrl&&E.append("contractFileUrl",V.contractFileUrl),V.contractFileUrlList&&V.contractFileUrlList.forEach(a=>E.append("contractFileUrlList",a));const T=`${Z}/rag/knowledge/ask/stream?${E.toString()}`,e=new EventSource(T,{withCredentials:!0});return e.onmessage=a=>{try{const F=JSON.parse(a.data);F.success&&F.body&&(R(F.body),F.body.endFlag&&(e.close(),l==null||l()))}catch(F){console.error("Parse SSE message error:",F),N==null||N(F)}},e.onerror=a=>{console.error("SSE error:",a),e.close(),N==null||N(a)},e}async askStreamWithFetch(V,R,N,l){var T;const Z=gR.getApiUrl(),d=BR.getToken()||localStorage.getItem("gimc-ai-agent-token"),E=new AbortController;try{const e=await fetch(`${Z}/rag/knowledge/ask/stream`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`,"Cache-Control":"no-cache",Accept:"text/event-stream"},body:JSON.stringify(V),credentials:"include",signal:E.signal});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const a=(T=e.body)==null?void 0:T.getReader(),F=new TextDecoder;let Q="";if(!a)throw new Error("Response body is null");(async()=>{try{for(;;){const{done:W,value:t}=await a.read();if(W){if(Q.trim()){const Y=Q.split(`
6
+ `+Z):N.stack=Z}catch{}}throw N}}_request(V,R){typeof V=="string"?(R=R||{},R.url=V):R=V||{},R=GR(this.defaults,R);const{transitional:N,paramsSerializer:l,headers:Z}=R;N!==void 0&&MU.assertOptions(N,{silentJSONParsing:cR.transitional(cR.boolean),forcedJSONParsing:cR.transitional(cR.boolean),clarifyTimeoutError:cR.transitional(cR.boolean)},!1),l!=null&&(k.isFunction(l)?R.paramsSerializer={serialize:l}:MU.assertOptions(l,{encode:cR.function,serialize:cR.function},!0)),R.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?R.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:R.allowAbsoluteUrls=!0),MU.assertOptions(R,{baseUrl:cR.spelling("baseURL"),withXsrfToken:cR.spelling("withXSRFToken")},!0),R.method=(R.method||this.defaults.method||"get").toLowerCase();let d=Z&&k.merge(Z.common,Z[R.method]);Z&&k.forEach(["delete","get","head","post","put","patch","common"],W=>{delete Z[W]}),R.headers=TR.concat(d,Z);const E=[];let T=!0;this.interceptors.request.forEach(function(t){typeof t.runWhen=="function"&&t.runWhen(R)===!1||(T=T&&t.synchronous,E.unshift(t.fulfilled,t.rejected))});const e=[];this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});let a,F=0,Q;if(!T){const W=[OE.bind(this),void 0];for(W.unshift(...E),W.push(...e),Q=W.length,a=Promise.resolve(R);F<Q;)a=a.then(W[F++],W[F++]);return a}Q=E.length;let c=R;for(;F<Q;){const W=E[F++],t=E[F++];try{c=W(c)}catch(A){t.call(this,A);break}}try{a=OE.call(this,c)}catch(W){return Promise.reject(W)}for(F=0,Q=e.length;F<Q;)a=a.then(e[F++],e[F++]);return a}getUri(V){V=GR(this.defaults,V);const R=oE(V.baseURL,V.url,V.allowAbsoluteUrls);return tE(R,V.params,V.paramsSerializer)}}k.forEach(["delete","get","head","options"],function(V){FU.prototype[V]=function(R,N){return this.request(GR(N||{},{method:V,url:R,data:(N||{}).data}))}}),k.forEach(["post","put","patch"],function(V){function R(N){return function(Z,d,E){return this.request(GR(E||{},{method:V,headers:N?{"Content-Type":"multipart/form-data"}:{},url:Z,data:d}))}}FU.prototype[V]=R(),FU.prototype[V+"Form"]=R(!0)});const WU=FU;class PU{constructor(V){if(typeof V!="function")throw new TypeError("executor must be a function.");let R;this.promise=new Promise(function(Z){R=Z});const N=this;this.promise.then(l=>{if(!N._listeners)return;let Z=N._listeners.length;for(;Z-- >0;)N._listeners[Z](l);N._listeners=null}),this.promise.then=l=>{let Z;const d=new Promise(E=>{N.subscribe(E),Z=E}).then(l);return d.cancel=function(){N.unsubscribe(Z)},d},V(function(Z,d,E){N.reason||(N.reason=new sR(Z,d,E),R(N.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(V){if(this.reason){V(this.reason);return}this._listeners?this._listeners.push(V):this._listeners=[V]}unsubscribe(V){if(!this._listeners)return;const R=this._listeners.indexOf(V);R!==-1&&this._listeners.splice(R,1)}toAbortSignal(){const V=new AbortController,R=N=>{V.abort(N)};return this.subscribe(R),V.signal.unsubscribe=()=>this.unsubscribe(R),V.signal}static source(){let V;return{token:new PU(function(l){V=l}),cancel:V}}}const XW=PU;function LW(U){return function(R){return U.apply(null,R)}}function uW(U){return k.isObject(U)&&U.isAxiosError===!0}const fU={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fU).forEach(([U,V])=>{fU[V]=U});const vW=fU;function jE(U){const V=new WU(U),R=UE(WU.prototype.request,V);return k.extend(R,WU.prototype,V,{allOwnKeys:!0}),k.extend(R,V,null,{allOwnKeys:!0}),R.create=function(l){return jE(GR(U,l))},R}const sV=jE(XU);sV.Axios=WU,sV.CanceledError=sR,sV.CancelToken=XW,sV.isCancel=kE,sV.VERSION=bE,sV.toFormData=ZU,sV.AxiosError=NV,sV.Cancel=sV.CanceledError,sV.all=function(V){return Promise.all(V)},sV.spread=LW,sV.isAxiosError=uW,sV.mergeConfig=GR,sV.AxiosHeaders=TR,sV.formToJSON=U=>hE(k.isHTMLForm(U)?new FormData(U):U),sV.getAdapter=CE.getAdapter,sV.HttpStatusCode=vW,sV.default=sV;const xE=sV,HE={development:{apiUrl:"http://dev-api.gw.gimccloud.com:32619/lxai-web-api",apiUrlLoginout:"http://dev-api.gw.gimccloud.com:32619",projectName:"省广智能客服",tokenName:"gimc-ai-agent",registrationId:"gimc-lxai-admin-oidc",jumpToLogin:!0},production:{apiUrl:"https://api.gimccloud.com/lxai-web-api/",apiUrlLoginout:"https://api.gimccloud.com",projectName:"灵犀AI后台管理",tokenName:"gimc-lxai-admin-front",registrationId:"gimc-lxai-admin-oidc",jumpToLogin:!0}};class qW{constructor(){jV(this,"currentEnv","production");jV(this,"currentConfig",HE.production)}setEnvironment(V){this.currentEnv=V,this.currentConfig=HE[V]}getEnvironment(){return this.currentEnv}getConfig(){return this.currentConfig}getApiUrl(){return this.currentConfig.apiUrl}getApiUrlLoginout(){return this.currentConfig.apiUrlLoginout}getProjectName(){return this.currentConfig.projectName}getTokenName(){return this.currentConfig.tokenName}getRegistrationId(){return this.currentConfig.registrationId}shouldJumpToLogin(){return this.currentConfig.jumpToLogin}}const gR=new qW,_U=xE.create({timeout:6e4,withCredentials:!0,headers:{"Cache-Control":"no-cache","If-Modified-Since":"0"}});_U.interceptors.request.use(U=>{U.baseURL=gR.getApiUrl();const V=BR.getToken()||localStorage.getItem("gimc-ai-agent-token");return V&&U.url&&!U.url.includes("oauth2")&&(U.headers.Authorization=`bearer ${V}`),U},U=>Promise.reject(U)),_U.interceptors.response.use(async U=>{var R,N;const V=U.data;if(V instanceof Blob)return Promise.resolve(U);if((N=(R=U==null?void 0:U.config)==null?void 0:R.url)!=null&&N.includes("/logout")&&V.code===400||(V==null?void 0:V.code)===401)return localStorage.removeItem("gimc-ai-agent-token"),Promise.reject(U);if((V==null?void 0:V.code)===200)return Promise.resolve(U);if(V.code===403&&V.body){const l=location.host;return V.body.includes&&!V.body.includes(l)&&localStorage.removeItem("gimc-ai-agent-token"),Promise.reject(U)}return hR.ElMessage({message:V.message,type:"error",duration:1e3}),Promise.reject(U)},U=>xE.isCancel(U)?new Promise(()=>{}):(hR.ElMessage({message:U.message,type:"error",duration:1e3}),Promise.reject(U)));const QU=U=>{const V=U;return new Promise((R,N)=>{_U.request(V).then(l=>{if(l.data instanceof Blob)R(l);else{const{data:{body:Z}}=l;R(Z)}}).catch(l=>{N(l)})})};function yR(U){return QU({...U,method:"GET"})}function yE(U){return QU({...U,method:"POST"})}function KE(U){return QU({...U,method:"PUT"})}function PW(U){return QU({...U,method:"DELETE"})}class fW{askStream(V,R,N,l){const Z=gR.getApiUrl();if(!(BR.getToken()||localStorage.getItem("gimc-ai-agent-token")))return console.error("Token not found"),N==null||N({message:"Token not found"}),null;const E=new URLSearchParams;V.sid&&E.append("sid",V.sid.toString()),E.append("q",V.q),E.append("ragKnowledgeId",V.ragKnowledgeId.toString()),V.contractFileUrl&&E.append("contractFileUrl",V.contractFileUrl),V.contractFileUrlList&&V.contractFileUrlList.forEach(a=>E.append("contractFileUrlList",a));const T=`${Z}/rag/knowledge/ask/stream?${E.toString()}`,e=new EventSource(T,{withCredentials:!0});return e.onmessage=a=>{try{const F=JSON.parse(a.data);F.success&&F.body&&(R(F.body),F.body.endFlag&&(e.close(),l==null||l()))}catch(F){console.error("Parse SSE message error:",F),N==null||N(F)}},e.onerror=a=>{console.error("SSE error:",a),e.close(),N==null||N(a)},e}async askStreamWithFetch(V,R,N,l){var T;const Z=gR.getApiUrl(),d=BR.getToken()||localStorage.getItem("gimc-ai-agent-token"),E=new AbortController;try{const e=await fetch(`${Z}/rag/knowledge/ask/stream`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${d}`,"Cache-Control":"no-cache",Accept:"text/event-stream"},body:JSON.stringify(V),credentials:"include",signal:E.signal});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const a=(T=e.body)==null?void 0:T.getReader(),F=new TextDecoder;let Q="";if(!a)throw new Error("Response body is null");(async()=>{try{for(;;){const{done:W,value:t}=await a.read();if(W){if(Q.trim()){const Y=Q.split(`
7
7
  `);for(const h of Y)if(h.startsWith("data:"))try{const i=h.substring(5).trim();if(i){const G=JSON.parse(i);G.success&&G.body?R(G.body):G.success===!1&&(console.error("API error response in final buffer:",G),N==null||N({message:G.message||"Unknown error",code:G.code,data:G}))}}catch(i){console.error("Parse final SSE buffer error:",i,h)}}l==null||l();break}const A=F.decode(t,{stream:!0});Q+=A;const m=Q.split(`
8
8
 
9
9
  `);Q=m.pop()||"";for(const Y of m){if(!Y.trim())continue;const h=Y.split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gimc-ai-agent",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "GIMC 智能客服(Vue3版)",
5
5
  "author": "GIMC",
6
6
  "license": "MIT",