@yeaft/webchat-agent 1.0.482 → 1.0.483

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.
@@ -1 +1 @@
1
- {"version":"1.0.482"}
1
+ {"version":"1.0.483"}
@@ -2983,7 +2983,7 @@ ${String(e||"").trim()}
2983
2983
  `,setup(e){let t=qi(),s=Vue.ref(null),n=Vue.ref(null),r=Vue.ref(!1),i=Vue.ref(!1),o=Vue.ref(!1),a=Vue.ref(!1),l=Vue.ref(!1),c=Vue.ref(!1),d=Vue.ref(""),u=Vue.ref(""),p=Vue.ref(""),f=Vue.ref(null),g=null,m=!1,h=_w(ne=>t.sendControl(e.agentId,f.value,ne)),y=Ew(h);t.installMessageListener();let v=Vue.computed(()=>t.runtimeStatus[e.agentId]||(e.runtimeReady?{supported:!0,installed:!0,enabled:!0,ready:!0,state:"ready"}:null)),S=Vue.computed(()=>t.installProgress[e.agentId]||null),w=Vue.computed(()=>i.value||v.value?.state==="installing"),b=Vue.computed(()=>w.value||o.value||v.value?.state==="probing"),C=Vue.computed(()=>ic(v.value?.downloadBytes)),k=Vue.computed(()=>{let ne=Number(S.value?.downloadedBytes??v.value?.downloadedBytes)||0,ce=Number(S.value?.totalBytes??v.value?.totalBytes??v.value?.downloadBytes)||0;return ce<=0?0:Math.min(100,Math.max(0,Math.round(ne*100/ce)))}),M=Vue.computed(()=>{let ne=Number(S.value?.downloadedBytes??v.value?.downloadedBytes)||0,ce=Number(S.value?.totalBytes??v.value?.totalBytes??v.value?.downloadBytes)||0;return Pe("workbench.browserInstallProgress",{downloaded:ic(ne),total:ic(ce)})}),W=Vue.computed(()=>`${e.agentId||""}\0${f.value||""}`),U=Vue.computed(()=>f.value&&t.sessions[W.value]||null),j=Vue.computed(()=>f.value&&t.peers[W.value]||null),E=Vue.computed(()=>j.value?.state==="connected"),$=Vue.computed(()=>{let ne=t.errorCodes[W.value];return ne==="browser_ice_servers_missing"?Pe("workbench.browserIceServersMissing"):ne==="browser_ice_connection_failed"?Pe("workbench.browserIceConnectionFailed"):ne==="browser_peer_attach_timeout"?Pe("workbench.browserPeerAttachTimeout"):t.errors[W.value]||""}),P=Vue.computed(()=>{let ne=t.peerDiagnostics[W.value];if(!ne||E.value||!U.value)return"";let ce=ne.iceConnectionState||ne.connectionState||"new",Ae=Number(ne.candidateErrors)||0;return Ae>0?`${ce} \xB7 ICE ${Ae}`:ce}),T=Vue.computed(()=>p.value||$.value),D=Vue.computed(()=>E.value?"connected":T.value||u.value||v.value?.safeError?"failed":"connecting"),q=Vue.computed(()=>U.value?.activeUrl||""),L=Vue.computed(()=>w.value?Pe("workbench.browserStatusInstalling"):o.value||v.value?.state==="probing"?Pe("workbench.browserStatusProbing"):T.value?T.value:E.value?f.value?"WebRTC":"":U.value?Pe("workbench.browserStatusConnecting"):""),G=()=>e.runtimeProvider==="yeaft"&&e.sessionId?{kind:"yeaft-session",sessionId:e.sessionId}:e.sessionId?{kind:"chat-conversation",conversationId:e.sessionId}:null,le=()=>{clearTimeout(g),g=null},ie=()=>{le(),!(m||i.value||!["installing","probing"].includes(v.value?.state))&&(g=setTimeout(()=>{_({startWhenReady:!0})},2e3))},te=async()=>{!f.value||!s.value||(t.detach(e.agentId,f.value,{notify:!0}),await t.attach({agentId:e.agentId,browserSessionId:f.value,videoElement:s.value}))},z=async(ne=null)=>{if(!(a.value||!e.agentId||v.value?.ready!==!0)){a.value=!0,p.value="";try{let ce=G(),Re=(await t.listSessions(e.agentId)).find(Oe=>Oe.state==="ready"&&Dw(Oe,ce))||null;if(Re||(Re=await t.createSession({agentId:e.agentId,sourceRef:ce,initialUrl:ne||"about:blank",locale:document.documentElement.lang||"en-US",viewport:{width:1280,height:720,deviceScaleFactor:1}})),f.value=Re.browserSessionId,d.value=ne||(Re.activeUrl==="about:blank"?"":Re.activeUrl),a.value=!1,await Vue.nextTick(),await te(),ne&&Re.activeUrl!==ne){let Oe=Date.now()+1e4;for(;!t.interactiveReady(e.agentId,Re.browserSessionId);){if(Date.now()>=Oe)throw new Error(Pe("workbench.browserInteractionUnavailable"));await new Promise(Ge=>setTimeout(Ge,50))}t.sendControl(e.agentId,Re.browserSessionId,{type:"navigate",url:ne})}}catch(ce){p.value=ce?.message||String(ce)}finally{a.value=!1}}},Q=async()=>{let ne=Pw(d.value);if(!ne){p.value=Pe("workbench.browserAddressInvalid");return}if(p.value="",!U.value){await z(ne);return}c.value=!0;try{if(!t.sendControl(e.agentId,f.value,{type:"navigate",url:ne}))throw new Error(Pe("workbench.browserInteractionUnavailable"));d.value=ne}catch(ce){p.value=ce?.message||String(ce)}finally{c.value=!1}},O=ne=>Rw(ne,s.value,U.value?.viewport),se=ne=>{let ce=O(ne);ce&&t.sendPointer(e.agentId,f.value,{type:"pointerMove",...ce})},oe=ne=>["left","middle","right"][ne]||"left",me=ne=>{let ce=O(ne);ce&&(n.value?.focus?.({preventScroll:!0}),s.value?.setPointerCapture?.(ne.pointerId),h.pointerDown(oe(ne.button),ce))},Se=ne=>{h.pointerUp(oe(ne.button),O(ne))},fe=ne=>t.sendControl(e.agentId,f.value,{type:"wheel",deltaX:ne.deltaX,deltaY:ne.deltaY}),Te=ne=>{h.keyDown(ne)&&ne.preventDefault()},de=ne=>{h.keyUp(ne.key)&&ne.preventDefault()},X=y.compositionstart,R=y.compositionend,I=y.input,B=()=>h.reset(),_=async({startWhenReady:ne=!1,preserveError:ce=!1}={})=>{if(!(r.value||!e.agentId||t.protocolSupported!==!0)){r.value=!0,ce||(u.value="");try{let Ae=await t.getRuntimeStatus(e.agentId);if(m)return;["installing","probing"].includes(Ae.state)?ie():le(),ne&&Ae.ready===!0&&U.value&&await te()}catch(Ae){(!ce||!u.value)&&(u.value=Ae?.message||String(Ae))}finally{r.value=!1}}},K=async()=>{let ne=v.value;if(b.value||!ne)return;!ne.installed?i.value=!0:o.value=!0,u.value="",le();try{await t.setupRuntime(e.agentId,ne)}catch(Ae){u.value=Ae?.message||String(Ae),await _({preserveError:!0})}finally{i.value=!1,o.value=!1,ie()}},ae=async()=>{if(!U.value||l.value)return;l.value=!0,p.value="";let ne=f.value;try{t.detach(e.agentId,ne,{notify:!1}),await t.closeSession(e.agentId,ne,U.value.revision),f.value=null}catch(ce){p.value=ce?.message||String(ce)}finally{l.value=!1}},ue=()=>B(),xe=()=>{document.visibilityState==="hidden"&&B()};return Vue.onMounted(()=>{window.addEventListener("blur",ue),document.addEventListener("visibilitychange",xe),t.protocolSupported===!0&&_()}),Vue.watch(()=>t.protocolSupported,(ne,ce)=>{ne===!0&&ce!==!0&&_(),ne===!1&&(u.value=Pe("workbench.browserProtocolUnavailable"))}),Vue.watch(()=>e.runtimeReady,(ne,ce)=>{!ne||ce===!0||m||(delete t.runtimeStatus[e.agentId],_())}),Vue.watch(()=>v.value?.state,ne=>{["installing","probing"].includes(ne)?ie():le()}),Vue.watch(q,ne=>{ne&&ne!=="about:blank"&&document.activeElement?.closest?.(".browser-location")==null&&(d.value=ne)}),Vue.onUnmounted(()=>{m=!0,le(),window.removeEventListener("blur",ue),document.removeEventListener("visibilitychange",xe),B(),f.value&&t.detach(e.agentId,f.value,{notify:!0})}),{video:s,inputSink:n,runtimeLoading:r,installing:i,enabling:o,viewerLoading:a,closing:l,navigating:c,address:d,setupError:u,displayError:T,peerDiagnosticText:P,runtimeStatus:v,runtimeInstalling:w,setupInProgress:b,downloadSize:C,progressPercent:k,progressText:M,snapshot:U,connected:E,connectionClass:D,displayUrl:q,statusText:L,refreshRuntime:_,setupRuntime:K,attach:te,startViewer:z,navigate:Q,onPointerMove:se,onPointerDown:me,onPointerUp:Se,onWheel:fe,onKeyDown:Te,onKeyUp:de,onCompositionStart:X,onCompositionEnd:R,onTextInput:I,releaseInput:B,closeBrowser:ae}}}});var Io,oc=H(()=>{eh();sh();Pn();Io={name:"WorkbenchPanel",components:{WorkbenchCapabilityHost:Jg,BrowserPanel:th},template:`
2984
2984
  <div ref="panelRoot" class="workbench-panel" :class="{ expanded: store.workbenchExpanded, maximized: store.workbenchMaximized }" :style="panelStyle">
2985
2985
  <div class="workbench-content" v-show="store.workbenchExpanded">
2986
- <header class="workbench-header">
2986
+ <header class="workbench-header" :class="{ 'workbench-files-header': activeCapability === 'files' }">
2987
2987
  <button
2988
2988
  v-if="activeCapability"
2989
2989
  ref="capabilityCloseButton"
Binary file
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
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
- <link rel="stylesheet" href="style.bundle.css?v=6892f589">
8
+ <link rel="stylesheet" href="style.bundle.css?v=b023854e">
9
9
  <script src="vendor.bundle.js?v=103fd8e7"></script>
10
10
  <script defer src="jszip.min.js"></script>
11
11
  <script defer src="docx-preview.min.js"></script>
@@ -16,6 +16,6 @@
16
16
  </head>
17
17
  <body>
18
18
  <div id="app"></div>
19
- <script type="module" src="app.bundle.js?v=7a547f7f"></script>
19
+ <script type="module" src="app.bundle.js?v=a4bb53db"></script>
20
20
  </body>
21
21
  </html>