openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.3 kB
JavaScript
import{n as e,r as t}from"./rolldown-runtime-CNOWq4Kh.js";import{n,o as r,t as i}from"./account-BSv2LwQC.js";import{A as a,T as o,j as s,r as c,t as l}from"./src-UIxrOiBg.js";var u=t({publishWithLinkCode:()=>m});async function d(e){let{client:t}=e,n=i(e.signedIn);n();let a=await o(e.kitText).catch(()=>null);if(!a)return{ok:!1,code:`bad_kit`};a.fill(0);let s=await r(t,e.signedIn),l=await t.request(`openclawId.authority`,{action:`rebind_prepare`,code:s});n();let u=await c(l,e.kitText);if(n(),!u.ok)return u;let d={assertCurrent:n,hostname:l.hostname,code:s,binding:u.binding,root:await h(l.root_pub),bindingSeq:{from:l.current.binding_seq,to:u.binding.body.binding_seq},endpoint:{from:await h(l.current.k_srv),to:await h(l.k_srv)},gateway:{from:await h(l.current.k_gw),to:await h(l.k_gw)}};return n(),{ok:!0,plan:d}}async function f(e,t){return t.assertCurrent(),await e.request(`openclawId.authority`,{action:`rebind_commit`,binding:t.binding,code:t.code})}async function p(e){await e.request(`openclawId.authority`,{action:`rebind_cancel`})}async function m(e,t){let n=i(t),a=await r(e,t);return n(),await e.request(`openclawId.authority`,{action:`publish`,enrollmentCode:a})}var h;function g(){return(g=e((()=>{l(),n(),h=async e=>a(await s(e))})))()}export{u as a,d as i,f as n,g as r,p as t};