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{fu as t,pu as n}from"./control-ui-core-BncvAZjR.js";function r(e,t){return{phase:`ready`,result:t===`utility`?{...e,utilityModel:void 0,setupModel:void 0}:{...e,configuredModel:void 0,setupComplete:!1}}}function i(e,t){return t.phase===`idle`?{stepId:null,value:void 0}:t.phase===`step`&&t.step.id!==e.stepId?{stepId:t.step.id,value:u(t.step)}:e}function a(e){return e===`provider-auth`?15e5:p}function o(e,t){return`${e}\u0000${t}`}function s(e){let{result:n}=e;if(n.ok&&n.modelRef){let t=[n.gatewayRestartRequired?e.restartWarning:null,e.refreshWarning].filter(Boolean).join(` `);return{phase:`success`,modelRef:n.modelRef,...n.modelTarget?{modelTarget:n.modelTarget}:{},...typeof n.latencyMs==`number`?{latencyMs:n.latencyMs}:{},...t?{warning:t}:{}}}return{phase:`failure`,targetId:e.targetId,status:n.status&&n.status!==`ok`?n.status:`unknown`,error:t(n.error,e.fallbackError)}}function c(e){return e.ok?{phase:`ok`,modelRef:e.modelRef,...e.modelTarget?{modelTarget:e.modelTarget}:{},...typeof e.latencyMs==`number`?{latencyMs:e.latencyMs}:{}}:{phase:`failed`,status:e.status,error:t(e.error)}}function l(e,n,r){return!n.done&&n.step?{phase:`step`,authChoice:e,step:n.step,busy:!1,validationError:n.error?.trim()?t(n.error):null}:n.done&&n.status===`done`?{phase:`done`}:n.status===`cancelled`?{phase:`cancelled`,message:t(n.error,r)}:{phase:`error`,message:t(n.error,r)}}function u(e){return e.type===`multiselect`?Array.isArray(e.initialValue)?[...e.initialValue]:[]:e.initialValue}var d,f,p,m;function h(){return(h=e((()=>{n(),d=4e4,f=15e4,p=48e4,m=3e4})))()}export{a,s as c,i as d,l as f,o as i,c as l,d as n,h as o,f as r,u as s,m as t,r as u};