openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 4.28 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{li as t,oi as n,or as r}from"./_4____________________________.js";import{GN as i,GP as a,Hb as o,JN as s,Mb as c,UP as l,Vb as u,WP as d,jb as f,qN as p}from"./_2_____________________________.js";import{a as m,n as h,o as g,r as _,t as v}from"./update-run-report-vAIYUOHn.js";import{F as y,O as b,Rt as x,U as S,a as C,d as w,g as T,j as E,l as D,m as O,u as k,x as A}from"./_6____________________.js";import{n as j,t as M}from"./en-update-actions-DQoZlnG9.js";function N(e){let t=y(()=>u(e.schedule,e.updateAvailable));return E(b,{get when(){return t()},children:t=>(()=>{var n=P(),r=n.firstChild,i=r.firstChild;return w(r,E(b,{get when(){return t().currentSha},children:e=>[(()=>{var t=F();return w(t,()=>e().slice(0,8)),D(()=>e(),e=>{T(t,`title`,e)}),t})(),I()]}),i),w(i,()=>t().targetSha.slice(0,8)),w(n,E(b,{get when(){return t().compareUrl},children:t=>(()=>{var n=L(),r=n.firstChild,i=x(),a=e.compareLinkRef;return typeof a==`function`||Array.isArray(a)?O(()=>a,n):e.compareLinkRef=n,w(n,()=>s(`updates.target.viewChanges`),r),D(()=>t(),e=>{T(n,`href`,e),C(n,i)}),n})()}),null),D(()=>t().targetSha,e=>{T(i,`title`,e)}),n})()})}var P,F,I,L;function R(){return(R=e((()=>{k(),S(),o(),M(),i(),P=A(`<div class=update-git-revisions><span class=update-git-revisions__range dir=ltr><code>`),F=A(`<code>`),I=A(`<span aria-hidden=true>→`),L=A(`<a target=_blank rel="noopener noreferrer"> <span aria-hidden=true>↗`),p(j)})))()}function z(e){return e.replace(/^(?:diagnostic|warning):(.+?)(?::\d+)?$/u,`$1`)}function B(e,{version:t,buildId:n}){let{reason:r,before:i,after:a,target:o,verification:s}=e,c=s.rollbackOutcome?.status;return r!==`post-update-failed`&&r!==`version-mismatch`&&r!==`build-id-mismatch`||c===`succeeded`||c===`failed`||s.recovery?.packageRollbackVerified||a.version&&a.version!==t||o.version&&o.version!==t||o.sha&&o.sha!==a.sha?!1:a.buildId?n===a.buildId&&n!==i.buildId&&n!==s.runningBuildId:r!==`build-id-mismatch`&&o.kind===`package`&&!!(t&&o.version===t&&s.runningVersion&&t!==s.runningVersion&&t!==i.version)}function V(e,n=!0,i){let o=e.status!==`running`,s=a(e),l=e.target.installationMethod===`ocm`,u=n?c(e,i):null,f=u&&i&&B(e,i)?t(`updates.run.servingTarget`):null,p=u?{headline:u,lines:f?[f]:[],markdown:f?`${u}\n\n${f}`:u}:h(e),g=m.indexOf(e.phase),v=m.flatMap((n,r)=>{let i=e.steps.find(e=>e.step===n);if(!i&&n!==e.phase&&(n===`repairing`||s&&n!==`finished`))return[];let a=i?.status??`pending`;return i||(n===`finished`&&o?a=e.status===`succeeded`?`completed`:e.status===`skipped`?`skipped`:`failed`:n===e.phase?a=`in_progress`:(o||r<g)&&(a=`skipped`)),[{step:n,status:a,label:t(`updates.run.phase.${n}`)}]}),y=e.steps.filter(e=>!e.step.startsWith(`notice:`)&&!e.step.startsWith(`diagnostic:`)&&!m.some(t=>t===e.step)),b=y.findLast(e=>e.status===`in_progress`)??e.steps.findLast(e=>e.status===`in_progress`&&e.detail)??e.steps.findLast(e=>e.detail),x=new Map;for(let t of e.steps){if(!t.detail)continue;let e=z(t.step),n=x.get(e)??[];n.push(t.detail),x.set(e,n)}let S=new Map(Array.from(x,([e,t])=>[e,r(t.join(`
`),-4096).split(/\r?\n/u).slice(-80).join(`
`)])),C=b?S.get(z(b.step))??``:``,w=e.verification,T=_(w,e.after),E=e=>e===void 0?o?`warn`:`pending`:e?`pass`:`fail`,D=[{name:`service`,state:E(w.serviceRunning)},{name:`version`,state:T.kind===`unavailable`?`warn`:E(T.kind===`unobserved`?void 0:T.kind===`verified`)},{name:`plugins`,state:E(w.pluginErrors===void 0?void 0:w.pluginErrors.length===0)},{name:`channels`,state:E(w.channelsReady)}],O=v.filter(e=>e.status===`completed`).length,k=v.filter(e=>e.status!==`skipped`).length;return{report:p,terminal:o,reconciled:d(e),headline:!n&&!o&&(e.phase===`activating`||e.phase===`restarting`||e.phase===`verifying`)?t(`updates.run.restarting`):p.headline,compactLabel:l?``:t(`updates.run.progress`,{completed:String(O),total:String(k)}),phases:l?[]:v.map(({step:e,status:t,label:n})=>({step:e,status:t,label:n,detail:S.get(e)})),steps:y.map(({step:e,status:t})=>({step:e,status:t,detail:S.get(z(e))})),detailStep:b?.step,details:C,historicalVerificationLabel:u?t(`updates.run.recordedVerification`):void 0,oracles:l?[]:D}}function H(){return(H=e((()=>{g(),f(),l(),v(),n(),M(),j()})))()}export{R as a,N as i,V as n,z as r,H as t};