UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.22 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{$l as t,au as n,eu as r,gl as i,ml as a}from"./control-ui-connection-Bfj9beF_.js";import{Dd as o,xd as s}from"./control-ui-boot-shared-DFTSUQQ0.js";function c(e){let t=o(e);if(t)return t.externalSource?`external:${t.externalSource}`:t.id?`id:${t.id}`:t.sequence==null?void 0:`seq:${t.sequence}`}function l(e,t){let n=new Set(t.map(c).filter(Boolean)),r=e.findIndex(e=>{let t=c(e);return t!==void 0&&n.has(t)});return[...e.slice(0,r<0?e.length:r),...t]}function u(){return(u=e((()=>{s()})))()}function d(e,t,r){if(typeof e==`string`)r(t,e,`primary`);else if(n(e)&&(typeof e.primary==`string`&&r(`${t}.primary`,e.primary,`primary`),Array.isArray(e.fallbacks)))for(let[n,i]of e.fallbacks.entries())typeof i==`string`&&r(`${t}.fallbacks.${n}`,i,`fallback`)}function f(e){let t=[];return d(e,``,(e,n)=>t.push(n)),t}function p(){return(p=e((()=>{})))()}function m(e){let n=t(e?.agents);if(!n)return[];let a=t(n.defaults);return i([...f(a?.model),...Object.keys(t(a?.models)??{}),...Object.values(r(n.entries)??{}).flatMap(e=>f(t(e)?.model))])}function h(){return(h=e((()=>{p(),a()})))()}function g(){return(g=e((()=>{})))()}export{l as a,u as i,h as n,m as r,g as t};