@yeaft/webchat-agent 1.0.566 → 1.0.567
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/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +2 -6
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +2 -2
- package/local-runtime/web/style.bundle.css +1 -1
- package/local-runtime/web/style.bundle.css.gz +0 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.567"}
|
|
@@ -305,7 +305,7 @@ They will restart after upgrading. {skipped} other Agent(s) will be skipped beca
|
|
|
305
305
|
</template>
|
|
306
306
|
</div>
|
|
307
307
|
</div>
|
|
308
|
-
`,setup(){let e=Ye(),t=Vue.inject("t"),s=Vue.inject("locale"),n=Vue.ref(""),r=Vue.ref(""),i=Vue.ref(""),o=Vue.ref(""),a=Vue.ref(""),l=Vue.ref(null),c=Vue.ref(null),d=Vue.ref(null),u=Vue.ref(null),g=Vue.ref(null),p=Vue.ref(null),f=Vue.ref(""),h=Vue.ref(localStorage.getItem("loginMode")==="credentials"?"credentials":"oauth");Vue.watch(h,he=>localStorage.setItem("loginMode",he));let v=Vue.ref(""),y=Vue.ref(""),m=Vue.ref(""),S=Vue.ref(""),w=Vue.ref(""),b=Vue.ref(!1),k=Vue.ref(""),P=Vue.ref(""),x=Vue.ref(""),K=Vue.ref(""),D=Vue.ref(""),j=Vue.ref(""),$=Vue.ref(!1),ne=Vue.ref(!1),L=()=>{a.value="",e.error=null,k.value="email",P.value="",K.value="",D.value="",j.value="",x.value="",ne.value=!1},C=()=>{k.value="",x.value="",ne.value=!1},M=async()=>{if(a.value="",!P.value||!/.+@.+\..+/.test(P.value)){a.value=t("login.forgot.emailInvalid");return}$.value=!0;try{let he=await e.requestPasswordReset(P.value.trim());if(!he)return;x.value=he,k.value="verify"}finally{$.value=!1}},R=async()=>{if(a.value="",!K.value){a.value=t("login.error.enterVerifyCode");return}if(!D.value||D.value.length<6){a.value=t("login.error.passwordMinLen");return}if(D.value!==j.value){a.value=t("login.error.passwordMismatch");return}$.value=!0;try{await e.verifyPasswordReset(x.value,K.value,D.value)&&(ne.value=!0,setTimeout(()=>{C(),h.value="credentials"},1500))}finally{$.value=!1}},T={alipay:'<svg viewBox="0 0 32 32" width="22" height="22" aria-hidden="true"><rect width="32" height="32" rx="6" fill="#1677FF"/><path fill="#fff" d="M25 18.6c-1.5-.5-3-1-4.6-1.7.4-.8.8-1.6 1.1-2.5h-2.9v-1h3.4v-.5h-3.4v-1.6h-1.4c-.3 0-.3.3-.3.3v1.3h-3.6v.5h3.6v1H11v.5h5.7c-.2.6-.4 1.2-.7 1.7-1.7-.5-3.4-.8-4.7-.8-2.2 0-3.7 1-3.8 2.5-.1 1.4.9 3 3.4 3 1.8 0 3.4-.9 4.7-2.5 2.2 1 4.2 2 6.6 2.9.3-.4.5-.8.7-1.2.2-.4.1-.9-.1-1.3zM11 19.7c-1.8 0-2.3-1.3-2.1-2 .1-.4.6-.9 1.4-1.1.4-.1 1.4-.1 2.4.2.9.2 1.8.5 2.7.8-.7 1.4-2.1 2.1-4.4 2.1z"/></svg>',microsoft:'<svg viewBox="0 0 21 21" width="20" height="20" aria-hidden="true"><rect x="1" y="1" width="9" height="9" fill="#f25022"/><rect x="1" y="11" width="9" height="9" fill="#00a4ef"/><rect x="11" y="1" width="9" height="9" fill="#7fba00"/><rect x="11" y="11" width="9" height="9" fill="#ffb900"/></svg>',github:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="currentColor" d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.5-1.4-1.3-1.7-1.3-1.7-1.1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.4 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.3.5-2.3 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2A11.5 11.5 0 0 1 12 5.8c1 0 2 .1 3 .4 2.3-1.5 3.3-1.2 3.3-1.2.6 1.7.2 2.9.1 3.2.7.9 1.2 1.9 1.2 3.2 0 4.6-2.8 5.7-5.5 6 .4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 .3"/></svg>',google:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"/><path fill="#FBBC05" d="M5.84 14.1A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.44.34-2.1V7.07H2.18A11 11 0 0 0 1 12c0 1.77.42 3.45 1.18 4.93l3.66-2.83z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.83C6.71 7.31 9.14 5.38 12 5.38z"/></svg>',wechat:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="#07C160" d="M9.5 4C5.36 4 2 6.91 2 10.5c0 2.07 1.13 3.91 2.86 5.09L4 18l2.7-1.41c.85.22 1.76.34 2.7.34h.51c-.13-.42-.21-.86-.21-1.32 0-3 2.91-5.43 6.5-5.43.32 0 .64.02.95.06C16.63 7.32 13.4 4 9.5 4zM7 8.5a1 1 0 110 2 1 1 0 010-2zm5 0a1 1 0 110 2 1 1 0 010-2zm4.21 3.66c-3.04 0-5.5 1.92-5.5 4.29 0 1.39.91 2.65 2.34 3.46l-.46 1.5 1.93-.95c.55.13 1.13.2 1.69.2 3.04 0 5.5-1.92 5.5-4.21 0-2.37-2.46-4.29-5.5-4.29zm-1.71 2.21a.75.75 0 110 1.5.75.75 0 010-1.5zm3.42 0a.75.75 0 110 1.5.75.75 0 010-1.5z"/></svg>'},B=Vue.computed(()=>["alipay","microsoft","github","google","wechat"].filter(le=>le==="microsoft"?e.aadEnabled:!!e.ssoProviders[le]).map(le=>({key:le,label:t(`login.${le}`),icon:T[le]}))),z=()=>{c.value&&c.value.focus()},G=()=>{h.value="credentials",Vue.nextTick(()=>{l.value&&l.value.focus()})},Y=()=>{let he=e.qrPanel;if(!he||!he.authorizeUrl)return;let le=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(he.authorizeUrl)}`;window.location.href=le},re=he=>{if(a.value="",he==="microsoft"){e.loginWithMicrosoft();return}if(he==="alipay"){Uo()?e.loginWithSso(he):pr()?e.loginWithAlipayMobile():e.startSsoQr(he).then(le=>{le&&N()});return}if(he==="wechat"){if(pr()||jo()){a.value=t("login.wechat.mobileUnsupported");return}e.startSsoQr(he).then(le=>{le&&N()});return}e.loginWithSso(he)},be=async()=>{if(!n.value){a.value=t("login.error.enterUsername");return}if(!r.value){a.value=t("login.error.enterPassword");return}a.value="",await e.login(n.value,r.value),Vue.nextTick(()=>{(e.loginStep==="totp"||e.loginStep==="totp-setup")&&u.value?u.value.focus():e.loginStep==="verification"&&d.value&&d.value.focus()})},N=()=>{if(e.qrPanel&&typeof qrcode=="function")try{let he=qrcode(0,"M");he.addData(e.qrPanel.authorizeUrl,"Byte"),he.make(),f.value=he.createDataURL(6,4)}catch{}},U=Vue.computed(()=>{let he=e.qrPanel?.provider;return t(he==="alipay"?"login.qr.titleAlipay":he==="wechat"?"login.qr.titleWechat":"login.qr.title")});Vue.watch(()=>e.qrPanel?.authorizeUrl,he=>{he?N():f.value=""});let de=async()=>{if(!o.value||o.value.length!==6){a.value=t("login.error.enter6Digit");return}a.value="",await e.verifyTotpCode(o.value)&&e.loginStep==="verification"&&(o.value="",Vue.nextTick(()=>{d.value&&d.value.focus()}))},we=async()=>{if(!o.value||o.value.length!==6){a.value=t("login.error.enter6Digit");return}a.value="",await e.completeTotpSetup(o.value)&&e.loginStep==="verification"&&(o.value="",Vue.nextTick(()=>{d.value&&d.value.focus()}))},ie=async()=>{if(a.value="",b.value=!1,!y.value||y.value.length<2){a.value=t("login.error.usernameMinLen");return}if(!m.value||m.value.length<6){a.value=t("login.error.passwordMinLen");return}if(m.value!==S.value){a.value=t("login.error.passwordMismatch");return}await e.register(y.value,m.value,w.value||void 0,v.value)&&(b.value=!0,n.value=y.value,v.value="",y.value="",m.value="",S.value="",w.value="",setTimeout(()=>e.backToCredentials(),1500))},ve=async()=>{if(!i.value){a.value=t("login.error.enterVerifyCode");return}a.value="",await e.verifyCode(i.value)};return Vue.onMounted(async()=>{await e.checkAuthMode(),B.value.length===0&&h.value==="oauth"&&(h.value="credentials"),e.loginStep==="credentials"&&h.value==="credentials"&&l.value&&l.value.focus()}),Vue.watch(()=>e.loginStep,he=>{Vue.nextTick(()=>{he==="credentials"&&h.value==="credentials"&&l.value?l.value.focus():(he==="totp"||he==="totp-setup")&&u.value?u.value.focus():he==="verification"&&d.value?d.value.focus():he==="register"&&g.value&&g.value.focus()})}),{authStore:e,currentLocale:s,toggleLang:()=>{Wr(s.value==="zh-CN"?"en":"zh-CN")},loginMode:h,switchToCredentials:G,enabledProviders:B,handleProviderClick:re,relaunchAlipayMobile:Y,qrCanvas:p,qrDataUrl:f,qrPanelTitle:U,username:n,password:r,verificationCode:i,totpCode:o,localError:a,usernameInput:l,passwordInput:c,codeInput:d,totpInput:u,regCodeInput:g,regInvitationCode:v,regUsername:y,regPassword:m,regPasswordConfirm:S,regEmail:w,registerSuccess:b,focusPassword:z,login:be,verify:ve,verifyTotp:de,setupTotp:we,doRegister:ie,forgotStep:k,forgotEmail:P,forgotResetToken:x,forgotCode:K,forgotNewPassword:D,forgotConfirm:j,forgotLoading:$,forgotSuccess:ne,enterForgotMode:L,exitForgotMode:C,submitForgotEmail:M,submitForgotReset:R}}}});var wi,ki,gk,Si,fk,Ko,Ci=V(()=>{wi=()=>({folderPickerOpen:!1,folderPickerPath:"",folderPickerDraft:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerLoaded:!1,folderPickerLoadedAgentId:null,folderPickerError:"",folderPickerErrorDetail:"",_folderPickerTimer:null,_folderPickerRequestId:null,_folderPickerRequestAgentId:null}),ki={folderPickerState(){return{path:this.folderPickerPath,draft:this.folderPickerDraft,entries:this.folderPickerEntries,loading:this.folderPickerLoading,error:this.folderPickerError,errorDetail:this.folderPickerErrorDetail,canConfirm:this.canConfirmFolderPicker()}}},gk=0,Si={openFolderPicker(){!this.folderPickerAgentId||!this.chat?.sendWsMessage||(this.folderPickerOpen=!0,this.loadFolderPickerDir(this.folderPickerInitialDir?.()||this.defaultWorkDir||""))},invalidateFolderPickerRequest(){this._folderPickerRequestId=null,this._folderPickerRequestAgentId=null,this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null},closeFolderPicker(){this.folderPickerOpen=!1,this.invalidateFolderPickerRequest()},failFolderPicker(e,t=""){this.invalidateFolderPickerRequest(),this.folderPickerLoading=!1,this.folderPickerLoaded=!1,this.folderPickerError=e,this.folderPickerErrorDetail=t},requestFolderPickerDir(e,t=!1){let s=this.folderPickerAgentId;if(this.invalidateFolderPickerRequest(),!s||!this.chat?.sendWsMessage){this.failFolderPicker("unavailable");return}let n=`folder-picker-${Date.now()}-${++gk}`;this._folderPickerRequestId=n,this._folderPickerRequestAgentId=s;try{if(this.chat.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",directoryPickerScope:"agent",requestId:n,agentId:s,dirPath:e})===!1){this.failFolderPicker("unavailable");return}}catch{this.failFolderPicker("unavailable");return}this._folderPickerTimer=setTimeout(()=>{!this.folderPickerOpen||this._folderPickerRequestId!==n||(this.folderPickerAgentId!==s?this.failFolderPicker("unavailable"):t?this.failFolderPicker("timeout"):this.requestFolderPickerDir(e,!0))},5e3)},loadFolderPickerDir(e){let t=/^[a-z]:$/i.test(e)?e+"\\":e;this.folderPickerPath=t,this.folderPickerDraft=t,this.folderPickerLoading=!0,this.folderPickerLoaded=!1,this.folderPickerLoadedAgentId=null,this.folderPickerError="",this.folderPickerErrorDetail="",this.folderPickerEntries=[],this.requestFolderPickerDir(t)},folderPickerEditPath(e){this.folderPickerDraft=e},canConfirmFolderPicker(){return!!(this.folderPickerOpen&&this.folderPickerPath&&this.folderPickerLoaded&&!this.folderPickerLoading&&!this.folderPickerError&&this.folderPickerDraft===this.folderPickerPath&&this.folderPickerLoadedAgentId===this.folderPickerAgentId)},confirmFolderPicker(){this.canConfirmFolderPicker()&&(this.folderPickerSetWorkDir?.(this.folderPickerPath),this.closeFolderPicker())},handleFolderPickerMessage(e){let t=e.detail;if(!(!t||t.type!=="directory_listing"||t.conversationId!=="_workdir_picker")&&!(!this.folderPickerOpen||!this._folderPickerRequestId||t.requestId!==this._folderPickerRequestId||this.folderPickerAgentId!==this._folderPickerRequestAgentId||t.agentId!=null&&t.agentId!==this._folderPickerRequestAgentId)){if(t.error||!Array.isArray(t.entries)||typeof t.dirPath!="string"){this.failFolderPicker("loadFailed",typeof t.error=="string"?t.error:"");return}this.invalidateFolderPickerRequest(),this.folderPickerLoading=!1,this.folderPickerLoaded=!0,this.folderPickerLoadedAgentId=this.folderPickerAgentId,this.folderPickerEntries=t.entries.filter(s=>s?.type==="directory"&&typeof s.name=="string").sort((s,n)=>s.name.localeCompare(n.name)),this.folderPickerDraft===this.folderPickerPath&&(this.folderPickerDraft=t.dirPath),this.folderPickerPath=t.dirPath}}},fk={data:wi,computed:ki,methods:Si,watch:{folderPickerAgentId(){this.closeFolderPicker()}},mounted(){window.addEventListener("workbench-message",this.handleFolderPickerMessage)},beforeUnmount(){window.removeEventListener("workbench-message",this.handleFolderPickerMessage),this.invalidateFolderPickerRequest()}},Ko=fk});function Cc(e){if(!e)return[];let t=e.match(/^[a-z]:[/\\]/i),s=e.match(/^(?:\\\\|\/\/)([^/\\]+)[/\\]([^/\\]+)(?:[/\\]|$)/),n=!!(t||s),r=n&&e.includes("\\")?"\\":"/",i=t?e.slice(0,2)+r:s?r+r+s[1]+r+s[2]+r:e.startsWith("/")?"/":"";if(!i)return[];let o=s?s[0].length:i.length,a=e.slice(o).split(n?/[/\\]/:/\//).filter(Boolean),l=[{label:i,path:i}],c=i;for(let d of a)c=c.replace(n?/[/\\]$/:/\/$/,"")+r+d,l.push({label:d,path:c});return l}function mf(e){let t=Cc(e);return t.length>1?t[t.length-2].path:e==="/"?"/":""}function vf(e,t){if(!e&&/^[a-z]:$/i.test(t))return t+"\\";let s=/^[a-z]:[/\\]/i.test(e)||/^\\\\/.test(e),n=s&&e.includes("\\")?"\\":"/";return e.replace(s?/[/\\]$/:/\/$/,"")+n+t}var yf=V(()=>{});var nn,Ii=V(()=>{yf();nn={name:"FolderPickerDialog",props:{state:{type:Object,required:!0}},emits:["navigate","edit-path","confirm","close"],computed:{breadcrumbs(){return Cc(this.state.path)},parentPath(){return mf(this.state.path)}},mounted(){this._previousFocus=document.activeElement,this.$refs.pathInput.focus(),this.$refs.pathInput.select()},beforeUnmount(){this._previousFocus?.isConnected&&this._previousFocus.focus()},methods:{navigate(e){this.$emit("navigate",e),this.$nextTick(()=>this.$refs.list?.focus())},go(){this.state.draft.trim()&&this.navigate(this.state.draft.trim())},enter(e){this.navigate(vf(this.state.path,e.name))},onKeydown(e){if(e.key==="Escape")e.preventDefault(),e.stopPropagation(),this.$emit("close");else if(e.key==="Tab"){let t=[...this.$refs.dialog.querySelectorAll('button:not(:disabled), input:not(:disabled), [tabindex="0"]')],s=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===s?(e.preventDefault(),n?.focus()):!e.shiftKey&&document.activeElement===n&&(e.preventDefault(),s?.focus())}},onListKeydown(e){let t=[...this.$refs.list.querySelectorAll(".folder-picker-item")],s=t.indexOf(document.activeElement),n;if(e.key==="ArrowDown")n=t[Math.min(s+1,t.length-1)];else if(e.key==="ArrowUp")n=t[Math.max(0,s-1)];else if(e.key==="Home")n=t[0];else if(e.key==="End")n=t[t.length-1];else if(e.key==="ArrowLeft"&&this.state.path!==this.parentPath){e.preventDefault(),this.navigate(this.parentPath);return}else return;e.preventDefault(),n?.focus()}},template:`
|
|
308
|
+
`,setup(){let e=Ye(),t=Vue.inject("t"),s=Vue.inject("locale"),n=Vue.ref(""),r=Vue.ref(""),i=Vue.ref(""),o=Vue.ref(""),a=Vue.ref(""),l=Vue.ref(null),c=Vue.ref(null),d=Vue.ref(null),u=Vue.ref(null),g=Vue.ref(null),p=Vue.ref(null),f=Vue.ref(""),h=Vue.ref(localStorage.getItem("loginMode")==="credentials"?"credentials":"oauth");Vue.watch(h,he=>localStorage.setItem("loginMode",he));let v=Vue.ref(""),y=Vue.ref(""),m=Vue.ref(""),S=Vue.ref(""),w=Vue.ref(""),b=Vue.ref(!1),k=Vue.ref(""),P=Vue.ref(""),x=Vue.ref(""),K=Vue.ref(""),D=Vue.ref(""),j=Vue.ref(""),$=Vue.ref(!1),ne=Vue.ref(!1),L=()=>{a.value="",e.error=null,k.value="email",P.value="",K.value="",D.value="",j.value="",x.value="",ne.value=!1},C=()=>{k.value="",x.value="",ne.value=!1},M=async()=>{if(a.value="",!P.value||!/.+@.+\..+/.test(P.value)){a.value=t("login.forgot.emailInvalid");return}$.value=!0;try{let he=await e.requestPasswordReset(P.value.trim());if(!he)return;x.value=he,k.value="verify"}finally{$.value=!1}},R=async()=>{if(a.value="",!K.value){a.value=t("login.error.enterVerifyCode");return}if(!D.value||D.value.length<6){a.value=t("login.error.passwordMinLen");return}if(D.value!==j.value){a.value=t("login.error.passwordMismatch");return}$.value=!0;try{await e.verifyPasswordReset(x.value,K.value,D.value)&&(ne.value=!0,setTimeout(()=>{C(),h.value="credentials"},1500))}finally{$.value=!1}},T={alipay:'<svg viewBox="0 0 32 32" width="22" height="22" aria-hidden="true"><rect width="32" height="32" rx="6" fill="#1677FF"/><path fill="#fff" d="M25 18.6c-1.5-.5-3-1-4.6-1.7.4-.8.8-1.6 1.1-2.5h-2.9v-1h3.4v-.5h-3.4v-1.6h-1.4c-.3 0-.3.3-.3.3v1.3h-3.6v.5h3.6v1H11v.5h5.7c-.2.6-.4 1.2-.7 1.7-1.7-.5-3.4-.8-4.7-.8-2.2 0-3.7 1-3.8 2.5-.1 1.4.9 3 3.4 3 1.8 0 3.4-.9 4.7-2.5 2.2 1 4.2 2 6.6 2.9.3-.4.5-.8.7-1.2.2-.4.1-.9-.1-1.3zM11 19.7c-1.8 0-2.3-1.3-2.1-2 .1-.4.6-.9 1.4-1.1.4-.1 1.4-.1 2.4.2.9.2 1.8.5 2.7.8-.7 1.4-2.1 2.1-4.4 2.1z"/></svg>',microsoft:'<svg viewBox="0 0 21 21" width="20" height="20" aria-hidden="true"><rect x="1" y="1" width="9" height="9" fill="#f25022"/><rect x="1" y="11" width="9" height="9" fill="#00a4ef"/><rect x="11" y="1" width="9" height="9" fill="#7fba00"/><rect x="11" y="11" width="9" height="9" fill="#ffb900"/></svg>',github:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="currentColor" d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.5-1.4-1.3-1.7-1.3-1.7-1.1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1.1 1.8 2.8 1.3 3.4 1 .1-.8.4-1.3.8-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.3.5-2.3 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2A11.5 11.5 0 0 1 12 5.8c1 0 2 .1 3 .4 2.3-1.5 3.3-1.2 3.3-1.2.6 1.7.2 2.9.1 3.2.7.9 1.2 1.9 1.2 3.2 0 4.6-2.8 5.7-5.5 6 .4.4.8 1.1.8 2.2v3.3c0 .3.2.7.8.6A12 12 0 0 0 12 .3"/></svg>',google:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84A11 11 0 0 0 12 23z"/><path fill="#FBBC05" d="M5.84 14.1A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.44.34-2.1V7.07H2.18A11 11 0 0 0 1 12c0 1.77.42 3.45 1.18 4.93l3.66-2.83z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1A11 11 0 0 0 2.18 7.07l3.66 2.83C6.71 7.31 9.14 5.38 12 5.38z"/></svg>',wechat:'<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true"><path fill="#07C160" d="M9.5 4C5.36 4 2 6.91 2 10.5c0 2.07 1.13 3.91 2.86 5.09L4 18l2.7-1.41c.85.22 1.76.34 2.7.34h.51c-.13-.42-.21-.86-.21-1.32 0-3 2.91-5.43 6.5-5.43.32 0 .64.02.95.06C16.63 7.32 13.4 4 9.5 4zM7 8.5a1 1 0 110 2 1 1 0 010-2zm5 0a1 1 0 110 2 1 1 0 010-2zm4.21 3.66c-3.04 0-5.5 1.92-5.5 4.29 0 1.39.91 2.65 2.34 3.46l-.46 1.5 1.93-.95c.55.13 1.13.2 1.69.2 3.04 0 5.5-1.92 5.5-4.21 0-2.37-2.46-4.29-5.5-4.29zm-1.71 2.21a.75.75 0 110 1.5.75.75 0 010-1.5zm3.42 0a.75.75 0 110 1.5.75.75 0 010-1.5z"/></svg>'},B=Vue.computed(()=>["alipay","microsoft","github","google","wechat"].filter(le=>le==="microsoft"?e.aadEnabled:!!e.ssoProviders[le]).map(le=>({key:le,label:t(`login.${le}`),icon:T[le]}))),z=()=>{c.value&&c.value.focus()},G=()=>{h.value="credentials",Vue.nextTick(()=>{l.value&&l.value.focus()})},Y=()=>{let he=e.qrPanel;if(!he||!he.authorizeUrl)return;let le=`alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent(he.authorizeUrl)}`;window.location.href=le},re=he=>{if(a.value="",he==="microsoft"){e.loginWithMicrosoft();return}if(he==="alipay"){Uo()?e.loginWithSso(he):pr()?e.loginWithAlipayMobile():e.startSsoQr(he).then(le=>{le&&N()});return}if(he==="wechat"){if(pr()||jo()){a.value=t("login.wechat.mobileUnsupported");return}e.startSsoQr(he).then(le=>{le&&N()});return}e.loginWithSso(he)},be=async()=>{if(!n.value){a.value=t("login.error.enterUsername");return}if(!r.value){a.value=t("login.error.enterPassword");return}a.value="",await e.login(n.value,r.value),Vue.nextTick(()=>{(e.loginStep==="totp"||e.loginStep==="totp-setup")&&u.value?u.value.focus():e.loginStep==="verification"&&d.value&&d.value.focus()})},N=()=>{if(e.qrPanel&&typeof qrcode=="function")try{let he=qrcode(0,"M");he.addData(e.qrPanel.authorizeUrl,"Byte"),he.make(),f.value=he.createDataURL(6,4)}catch{}},U=Vue.computed(()=>{let he=e.qrPanel?.provider;return t(he==="alipay"?"login.qr.titleAlipay":he==="wechat"?"login.qr.titleWechat":"login.qr.title")});Vue.watch(()=>e.qrPanel?.authorizeUrl,he=>{he?N():f.value=""});let de=async()=>{if(!o.value||o.value.length!==6){a.value=t("login.error.enter6Digit");return}a.value="",await e.verifyTotpCode(o.value)&&e.loginStep==="verification"&&(o.value="",Vue.nextTick(()=>{d.value&&d.value.focus()}))},we=async()=>{if(!o.value||o.value.length!==6){a.value=t("login.error.enter6Digit");return}a.value="",await e.completeTotpSetup(o.value)&&e.loginStep==="verification"&&(o.value="",Vue.nextTick(()=>{d.value&&d.value.focus()}))},ie=async()=>{if(a.value="",b.value=!1,!y.value||y.value.length<2){a.value=t("login.error.usernameMinLen");return}if(!m.value||m.value.length<6){a.value=t("login.error.passwordMinLen");return}if(m.value!==S.value){a.value=t("login.error.passwordMismatch");return}await e.register(y.value,m.value,w.value||void 0,v.value)&&(b.value=!0,n.value=y.value,v.value="",y.value="",m.value="",S.value="",w.value="",setTimeout(()=>e.backToCredentials(),1500))},ve=async()=>{if(!i.value){a.value=t("login.error.enterVerifyCode");return}a.value="",await e.verifyCode(i.value)};return Vue.onMounted(async()=>{await e.checkAuthMode(),B.value.length===0&&h.value==="oauth"&&(h.value="credentials"),e.loginStep==="credentials"&&h.value==="credentials"&&l.value&&l.value.focus()}),Vue.watch(()=>e.loginStep,he=>{Vue.nextTick(()=>{he==="credentials"&&h.value==="credentials"&&l.value?l.value.focus():(he==="totp"||he==="totp-setup")&&u.value?u.value.focus():he==="verification"&&d.value?d.value.focus():he==="register"&&g.value&&g.value.focus()})}),{authStore:e,currentLocale:s,toggleLang:()=>{Wr(s.value==="zh-CN"?"en":"zh-CN")},loginMode:h,switchToCredentials:G,enabledProviders:B,handleProviderClick:re,relaunchAlipayMobile:Y,qrCanvas:p,qrDataUrl:f,qrPanelTitle:U,username:n,password:r,verificationCode:i,totpCode:o,localError:a,usernameInput:l,passwordInput:c,codeInput:d,totpInput:u,regCodeInput:g,regInvitationCode:v,regUsername:y,regPassword:m,regPasswordConfirm:S,regEmail:w,registerSuccess:b,focusPassword:z,login:be,verify:ve,verifyTotp:de,setupTotp:we,doRegister:ie,forgotStep:k,forgotEmail:P,forgotResetToken:x,forgotCode:K,forgotNewPassword:D,forgotConfirm:j,forgotLoading:$,forgotSuccess:ne,enterForgotMode:L,exitForgotMode:C,submitForgotEmail:M,submitForgotReset:R}}}});var wi,ki,gk,Si,fk,Ko,Ci=V(()=>{wi=()=>({folderPickerOpen:!1,folderPickerPath:"",folderPickerDraft:"",folderPickerEntries:[],folderPickerLoading:!1,folderPickerLoaded:!1,folderPickerLoadedAgentId:null,folderPickerError:"",folderPickerErrorDetail:"",_folderPickerTimer:null,_folderPickerRequestId:null,_folderPickerRequestAgentId:null}),ki={folderPickerState(){return{path:this.folderPickerPath,draft:this.folderPickerDraft,entries:this.folderPickerEntries,loading:this.folderPickerLoading,error:this.folderPickerError,errorDetail:this.folderPickerErrorDetail,canConfirm:this.canConfirmFolderPicker()}}},gk=0,Si={openFolderPicker(){!this.folderPickerAgentId||!this.chat?.sendWsMessage||(this.folderPickerOpen=!0,this.loadFolderPickerDir(this.folderPickerInitialDir?.()||this.defaultWorkDir||""))},invalidateFolderPickerRequest(){this._folderPickerRequestId=null,this._folderPickerRequestAgentId=null,this._folderPickerTimer&&clearTimeout(this._folderPickerTimer),this._folderPickerTimer=null},closeFolderPicker(){this.folderPickerOpen=!1,this.invalidateFolderPickerRequest()},failFolderPicker(e,t=""){this.invalidateFolderPickerRequest(),this.folderPickerLoading=!1,this.folderPickerLoaded=!1,this.folderPickerError=e,this.folderPickerErrorDetail=t},requestFolderPickerDir(e,t=!1){let s=this.folderPickerAgentId;if(this.invalidateFolderPickerRequest(),!s||!this.chat?.sendWsMessage){this.failFolderPicker("unavailable");return}let n=`folder-picker-${Date.now()}-${++gk}`;this._folderPickerRequestId=n,this._folderPickerRequestAgentId=s;try{if(this.chat.sendWsMessage({type:"list_directory",conversationId:"_workdir_picker",directoryPickerScope:"agent",requestId:n,agentId:s,dirPath:e})===!1){this.failFolderPicker("unavailable");return}}catch{this.failFolderPicker("unavailable");return}this._folderPickerTimer=setTimeout(()=>{!this.folderPickerOpen||this._folderPickerRequestId!==n||(this.folderPickerAgentId!==s?this.failFolderPicker("unavailable"):t?this.failFolderPicker("timeout"):this.requestFolderPickerDir(e,!0))},5e3)},loadFolderPickerDir(e){let t=/^[a-z]:$/i.test(e)?e+"\\":e;this.folderPickerPath=t,this.folderPickerDraft=t,this.folderPickerLoading=!0,this.folderPickerLoaded=!1,this.folderPickerLoadedAgentId=null,this.folderPickerError="",this.folderPickerErrorDetail="",this.folderPickerEntries=[],this.requestFolderPickerDir(t)},folderPickerEditPath(e){this.folderPickerDraft=e},canConfirmFolderPicker(){return!!(this.folderPickerOpen&&this.folderPickerPath&&this.folderPickerLoaded&&!this.folderPickerLoading&&!this.folderPickerError&&this.folderPickerDraft===this.folderPickerPath&&this.folderPickerLoadedAgentId===this.folderPickerAgentId)},confirmFolderPicker(){this.canConfirmFolderPicker()&&(this.folderPickerSetWorkDir?.(this.folderPickerPath),this.closeFolderPicker())},handleFolderPickerMessage(e){let t=e.detail;if(!(!t||t.type!=="directory_listing"||t.conversationId!=="_workdir_picker")&&!(!this.folderPickerOpen||!this._folderPickerRequestId||t.requestId!==this._folderPickerRequestId||this.folderPickerAgentId!==this._folderPickerRequestAgentId||t.agentId!=null&&t.agentId!==this._folderPickerRequestAgentId)){if(t.error||!Array.isArray(t.entries)||typeof t.dirPath!="string"){this.failFolderPicker("loadFailed",typeof t.error=="string"?t.error:"");return}this.invalidateFolderPickerRequest(),this.folderPickerLoading=!1,this.folderPickerLoaded=!0,this.folderPickerLoadedAgentId=this.folderPickerAgentId,this.folderPickerEntries=t.entries.filter(s=>s?.type==="directory"&&typeof s.name=="string").sort((s,n)=>s.name.localeCompare(n.name)),this.folderPickerDraft===this.folderPickerPath&&(this.folderPickerDraft=t.dirPath),this.folderPickerPath=t.dirPath}}},fk={data:wi,computed:ki,methods:Si,watch:{folderPickerAgentId(){this.closeFolderPicker()}},mounted(){window.addEventListener("workbench-message",this.handleFolderPickerMessage)},beforeUnmount(){window.removeEventListener("workbench-message",this.handleFolderPickerMessage),this.invalidateFolderPickerRequest()}},Ko=fk});function Cc(e){if(!e)return[];let t=e.match(/^[a-z]:[/\\]/i),s=e.match(/^(?:\\\\|\/\/)([^/\\]+)[/\\]([^/\\]+)(?:[/\\]|$)/),n=!!(t||s),r=n&&e.includes("\\")?"\\":"/",i=t?e.slice(0,2)+r:s?r+r+s[1]+r+s[2]+r:e.startsWith("/")?"/":"";if(!i)return[];let o=s?s[0].length:i.length,a=e.slice(o).split(n?/[/\\]/:/\//).filter(Boolean),l=[{label:i,path:i}],c=i;for(let d of a)c=c.replace(n?/[/\\]$/:/\/$/,"")+r+d,l.push({label:d,path:c});return l}function mf(e){let t=Cc(e);return t.length>1?t[t.length-2].path:e==="/"?"/":""}function vf(e,t){if(!e&&/^[a-z]:$/i.test(t))return t+"\\";let s=/^[a-z]:[/\\]/i.test(e)||/^\\\\/.test(e),n=s&&e.includes("\\")?"\\":"/";return e.replace(s?/[/\\]$/:/\/$/,"")+n+t}var yf=V(()=>{});var nn,Ii=V(()=>{yf();nn={name:"FolderPickerDialog",props:{state:{type:Object,required:!0}},emits:["navigate","edit-path","confirm","close"],computed:{breadcrumbs(){return Cc(this.state.path)},separator(){return this.breadcrumbs[0]?.label.slice(-1)||"/"},parentPath(){return mf(this.state.path)}},mounted(){this._previousFocus=document.activeElement,this.$refs.pathInput.focus(),this.$refs.pathInput.select()},beforeUnmount(){this._previousFocus?.isConnected&&this._previousFocus.focus()},methods:{navigate(e){this.$emit("navigate",e),this.$nextTick(()=>this.$refs.list?.focus())},go(){this.state.draft.trim()&&this.navigate(this.state.draft.trim())},enter(e){this.navigate(vf(this.state.path,e.name))},onKeydown(e){if(e.key==="Escape")e.preventDefault(),e.stopPropagation(),this.$emit("close");else if(e.key==="Tab"){let t=[...this.$refs.dialog.querySelectorAll('button:not(:disabled), input:not(:disabled), [tabindex="0"]')],s=t[0],n=t[t.length-1];e.shiftKey&&document.activeElement===s?(e.preventDefault(),n?.focus()):!e.shiftKey&&document.activeElement===n&&(e.preventDefault(),s?.focus())}},onListKeydown(e){let t=[...this.$refs.list.querySelectorAll(".folder-picker-item")],s=t.indexOf(document.activeElement),n;if(e.key==="ArrowDown")n=t[Math.min(s+1,t.length-1)];else if(e.key==="ArrowUp")n=t[Math.max(0,s-1)];else if(e.key==="Home")n=t[0];else if(e.key==="End")n=t[t.length-1];else if(e.key==="ArrowLeft"&&this.state.path!==this.parentPath){e.preventDefault(),this.navigate(this.parentPath);return}else return;e.preventDefault(),n?.focus()}},template:`
|
|
309
309
|
<Teleport to="body">
|
|
310
310
|
<div class="folder-picker-overlay workdir-picker" @click.self="$emit('close')" @keydown="onKeydown">
|
|
311
311
|
<div class="folder-picker-dialog" ref="dialog" role="dialog" aria-modal="true" :aria-label="$t('modal.folderPicker.title')">
|
|
@@ -326,16 +326,12 @@ They will restart after upgrading. {skipped} other Agent(s) will be skipped beca
|
|
|
326
326
|
</button>
|
|
327
327
|
</div>
|
|
328
328
|
<div class="folder-picker-navigation">
|
|
329
|
-
<button class="btn btn-ghost folder-picker-root" type="button" @click="navigate('')">
|
|
330
|
-
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 4-3 10v5a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1v-5L19 4Z"/><path d="M2 14h20M6 17h.01M10 17h.01"/></svg>
|
|
331
|
-
{{ $t('modal.folderPicker.root') }}
|
|
332
|
-
</button>
|
|
333
329
|
<button class="btn btn-ghost folder-picker-icon" type="button" @click="navigate(parentPath)" :disabled="!state.path || state.path === parentPath" :aria-label="$t('modal.folderPicker.parentDir')" :title="$t('modal.folderPicker.parentDir')">
|
|
334
330
|
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5m-6 6 6-6 6 6"/></svg>
|
|
335
331
|
</button>
|
|
336
332
|
<nav class="folder-picker-breadcrumbs" :aria-label="$t('modal.folderPicker.ancestors')">
|
|
337
333
|
<template v-for="(crumb, index) in breadcrumbs" :key="crumb.path">
|
|
338
|
-
<span v-if="index" aria-hidden="true"
|
|
334
|
+
<span v-if="index > 1" aria-hidden="true">{{ separator }}</span>
|
|
339
335
|
<button class="btn btn-ghost" type="button" @click="navigate(crumb.path)" :aria-current="index === breadcrumbs.length - 1 ? 'location' : undefined" :title="crumb.path">{{ crumb.label }}</button>
|
|
340
336
|
</template>
|
|
341
337
|
</nav>
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Yeaft</title>
|
|
7
7
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='8' fill='%232c2c2c'/><path d='M16 22V13M16 13L10 8M16 13L22 8' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/><circle cx='10' cy='8' r='2.4' fill='white'/><circle cx='22' cy='8' r='2.4' fill='white'/><circle cx='16' cy='22' r='2.4' fill='white'/></svg>">
|
|
8
8
|
<link rel="stylesheet" href="vendor/katex/katex.min.css?v=b0d91614">
|
|
9
|
-
<link rel="stylesheet" href="style.bundle.css?v=
|
|
9
|
+
<link rel="stylesheet" href="style.bundle.css?v=60c2fbc0">
|
|
10
10
|
<script src="vendor.bundle.js?v=b4d2c175"></script>
|
|
11
11
|
<script defer src="jszip.min.js"></script>
|
|
12
12
|
<script defer src="docx-preview.min.js"></script>
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="app"></div>
|
|
20
|
-
<script type="module" src="app.bundle.js?v=
|
|
20
|
+
<script type="module" src="app.bundle.js?v=a8da30fc"></script>
|
|
21
21
|
</body>
|
|
22
22
|
</html>
|