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{Eu as t,W as n,fu as r,ju as i,k as a,pu as o}from"./control-ui-core-BncvAZjR.js";import{Yr as s,ai as c}from"./control-ui-core-9qYjK5B2.js";import{c as l,l as u}from"./gateway-runtime-Cr51Pi7N.js";import{n as d,t as f}from"./en-update-actions-Bqyjfcr4.js";import{n as p,t as m}from"./en-settings-KEcvGj5Z.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 o=t.attempt,c=t.reconciledRecord,u=(e,t)=>[t,e].filter(Boolean).join(` · `)||i(`common.unknown`),d=[...c?[`${i(`updates.triage.observedRecord`)}: ${c.id??i(`common.unknown`)} · ${c.timestampMs===null?i(`common.unknown`):new Date(c.timestampMs).toISOString()}`]:[],...o?[`${i(`updates.page.attemptedAt`)}: ${new Date(o.timestampMs).toISOString()}`,`${i(`updates.page.attemptReason`)}: ${o.reason}`,`${i(`updates.page.beforeUpdate`)}: ${u(o.beforeVersion,o.beforeSha)}`,`${i(`updates.page.afterAttempt`)}: ${u(o.afterVersion,o.afterSha)}`,...o.failure?[`${o.failure.step}: ${o.failure.detail}`]:[]]:[t.banner.text]],f=i(t.outcome===`unknown`?`updates.triage.unknownTitle`:`updates.triage.failedTitle`),p=[...d,i(`updates.triage.hostHint`)].map(e=>a(r(e),240));g.present({id:t.id,title:f,facts:p,question:a(i(`updates.triage.question`,{outcome:f,facts:p.join(` `)}),2400),action:{label:i(`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(),o(),n(),u(),h(),p(),d()})))()}v();export{_ as presentUpdateFailureTriage};