UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines • 1.71 kB
import{n as e}from"./rolldown-runtime-8BhlS34s.js";import{Pu as t,W as n,bu as r,k as i,xu as a,zu as o}from"./control-ui-core-CBJ5efDh.js";import{ei as s,ui as c}from"./control-ui-core-DtLivg_r.js";import{c as l,l as u}from"./gateway-runtime-C77LeWZN.js";import{n as d,t as f}from"./en-update-actions-CGzQJvZs.js";import{n as p,t as m}from"./en-settings-dSQ-fDvm.js";import{r as h,t as g}from"./custodian-alert-store-DMTYYmJp.js";function _(e,t,n){if(!n.isCurrent())return;if(!l(e.gateway.snapshot,`openclaw.chat`,`operator.admin`)){e.navigate(`updates`);return}let a=t.attempt,c=t.reconciledRecord,u=(e,t)=>[t,e].filter(Boolean).join(` · `)||o(`common.unknown`),d=[...c?[`${o(`updates.triage.observedRecord`)}: ${c.id??o(`common.unknown`)} · ${c.timestampMs===null?o(`common.unknown`):new Date(c.timestampMs).toISOString()}`]:[],...a?[`${o(`updates.page.attemptedAt`)}: ${new Date(a.timestampMs).toISOString()}`,`${o(`updates.page.attemptReason`)}: ${a.reason}`,`${o(`updates.page.beforeUpdate`)}: ${u(a.beforeVersion,a.beforeSha)}`,`${o(`updates.page.afterAttempt`)}: ${u(a.afterVersion,a.afterSha)}`,...a.failure?[`${a.failure.step}: ${a.failure.detail}`]:[]]:[t.banner.text]],f=o(t.outcome===`unknown`?`updates.triage.unknownTitle`:`updates.triage.failedTitle`),p=[...d,o(`updates.triage.hostHint`)].map(e=>i(r(e),240));g.present({id:t.id,title:f,facts:p,question:i(o(`updates.triage.question`,{outcome:f,facts:p.join(` `)}),2400),action:{label:o(`updates.reviewUpdate`),target:{kind:`navigate`,routeId:`updates`}}},n),window.dispatchEvent(new CustomEvent(s,{detail:{open:!0}}))}function v(){return(v=e((()=>{c(),t(),m(),f(),a(),n(),u(),h(),p(),d()})))()}v();export{_ as presentUpdateFailureTriage};