UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 15.7 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ju as t,mi as n,pi as r}from"./_4____________________________.js";import{$w as i,AN as a,EN as o,GN as s,JN as c,Js as l,Qw as u,Ys as d,Zb as ee,_x as f,dT as te,dx as p,eT as m,fN as h,fT as g,fk as _,mk as v,ml as y,mx as ne,pN as b,pl as re,qN as x}from"./_2_____________________________.js";import{C as S,I as C,O as w,Rt as T,U as E,a as D,d as O,f as k,g as A,j,l as M,m as ie,o as N,p as ae,s as P,u as F,vt as I,x as L,yt as R}from"./_6____________________.js";import{n as z,t as oe}from"./en-devices-CUABNinu.js";import{A as B}from"./route-controls-runtime-LXiVRSj4.js";import{r as V,t as se}from"./radio-C0GmBkf4.js";function H(e){let n=t(e)?e.details:void 0;return t(n)&&n.code===U.GATEWAY_LOOPBACK_ONLY}var U;function W(){return(W=e((()=>{U={GATEWAY_LOOPBACK_ONLY:`DEVICE_PAIR_GATEWAY_LOOPBACK_ONLY`}})))()}var G,K;function q(){return(q=e((()=>{n(),G={devices:{pairing:{secureAccess:{title:`Set up secure access`,intro:`Your phone can’t reach OpenClaw yet. Right now it only accepts connections from this computer.`,tailscaleTitle:`Use Tailscale (recommended)`,tailscaleSteps:`The Gateway still listens only on this computer. Tailscale Serve gives permitted devices on your tailnet encrypted access. Install Tailscale on this computer and your phone and sign in on both. Then run this command and restart the Gateway.`,tailscaleGuide:`Tailscale setup guide`,lanTitle:`Use your home Wi‑Fi instead`,lanWarning:`Only on a network you trust. The connection isn’t encrypted, so others on the network can see it, and OpenClaw stays reachable on any network this computer joins. Phones get Limited access, which still includes chat history and approvals. Run this command, then restart the Gateway.`,lanUndo:`To undo, run {command}, restart OpenClaw, and remove devices you no longer want in Manage devices.`,afterRestart:`After the Dashboard reconnects, reopen Connect a device and choose Create setup code.`,publicTitle:`Use a public HTTPS address`,publicHint:`If you already run one, set gateway.publicOrigin to it, or set the device-pair plugin’s publicUrl.`}}}},K=Object.assign(()=>{Object.assign(r.devices.pairing,G.devices.pairing)},{catalog:G})})))()}function ce(){return[(()=>{var e=Y();return O(e,()=>c(`devices.pairing.secureAccess.intro`)),e})(),(()=>{var e=de(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling;r.firstChild;var a=r.nextSibling,o=T();return O(t,()=>c(`devices.pairing.secureAccess.tailscaleTitle`)),O(n,()=>c(`devices.pairing.secureAccess.tailscaleSteps`)),O(r,j(l,{text:Re,get idleLabel(){return c(`connection.help.copyCommand`)}}),null),A(a,`target`,u),O(a,()=>c(`devices.pairing.secureAccess.tailscaleGuide`)),M(()=>i(),e=>{A(a,`rel`,e),D(a,o)}),e})(),(()=>{var e=fe(),t=e.firstChild,n=t.firstChild,r=n.nextSibling,i=t.nextSibling,a=i.nextSibling;a.firstChild;var o=a.nextSibling;return O(t,j(h,{name:`chevronRight`}),n),O(t,()=>c(`devices.pairing.secureAccess.lanTitle`),r),O(i,()=>c(`devices.pairing.secureAccess.lanWarning`)),O(a,j(l,{text:ze,get idleLabel(){return c(`connection.help.copyCommand`)}}),null),O(o,()=>c(`devices.pairing.secureAccess.lanUndo`,{command:Be})),e})(),(()=>{var e=pe(),t=e.firstChild,n=t.firstChild,r=n.nextSibling,i=t.nextSibling;return O(t,j(h,{name:`chevronRight`}),n),O(t,()=>c(`devices.pairing.secureAccess.publicTitle`),r),O(i,()=>c(`devices.pairing.secureAccess.publicHint`)),e})(),(()=>{var e=Y();return O(e,()=>c(`devices.pairing.secureAccess.afterRestart`)),e})()]}function J(e){return e===`limited`?`devices.pairing.limitedAccess`:e===`node`?`devices.pairing.nodeAccessSummary`:`devices.pairing.fullAccessSummary`}function le(e){let t=()=>e.lifecycle.phase===`success`,n=()=>e.lifecycle.phase===`delivery-uncertain`,r=()=>e.lifecycle.phase===`success`?e.lifecycle.deviceName:void 0;var i=he(),a=i.firstChild,o=a.nextSibling;return O(a,j(h,{get name(){return k(()=>!!t())()?`badgeCheck`:n()?`alertTriangle`:`refresh`}})),O(o,(()=>{var n=k(()=>!!t());return()=>n()?r()??e.description:e.description})()),O(i,j(w,{get when(){return t()},get fallback(){return k(()=>!!n())()?(()=>{var e=Y();return O(e,()=>c(`devices.pairing.deliveryUncertainHint`)),e})():void 0},get children(){var t=me(),n=t.firstChild,i=n.nextSibling;return O(t,j(w,{get when(){return r()},get children(){return[k(()=>e.description),` `,X(),` `]}}),n),O(t,()=>c(J(e.lifecycle.access)),i),t}}),null),M(()=>({e:n()?`alert`:`status`,t:n()?void 0:`polite`,a:!!t()}),({e,t,a:n},r)=>{e!==r?.e&&A(i,`role`,e),t!==r?.t&&A(i,`aria-live`,t),n!==r?.a&&a.classList.toggle(`device-pair-setup__state-icon--success`,n)}),i}function ue(e){let[t,n]=C(!1),r=R(function*(t,r){let i=new AbortController;try{n(!0),yield Promise.race([t,I(()=>!e.open||e.lifecycle!==r,{signal:i.signal})])}finally{i.abort()}});async function a(){let t=e.lifecycle;try{let n=e.onRefresh();await Promise.resolve(),t=e.lifecycle,await r(n,t)}catch(n){e.open&&e.lifecycle===t&&v({message:c(`devices.pairing.failed`),detail:o(n),severity:`error`})}}let s=()=>e.lifecycle.phase===`waiting`?e.lifecycle.setup:void 0,d=()=>{let t=e.lifecycle;return t.phase===`success`||t.phase===`delivery-uncertain`||t.phase===`expired`?t:void 0},f=()=>e.lifecycle.phase===`error`?e.lifecycle:void 0,p=()=>c(e.lifecycle.phase===`success`?`devices.pairing.pairedTitle`:e.lifecycle.phase===`delivery-uncertain`?`devices.pairing.deliveryUncertainTitle`:e.lifecycle.phase===`expired`?`devices.pairing.expiredTitle`:`devices.pairing.subtitle`),m=()=>e.lifecycle.access===`node`,g=()=>{let e=f();return e?.source===`create`&&e.access!==`node`&&H(e.error)},_=()=>{let e=f();return e?.source===`create`?g()?void 0:{source:e.source,message:o(e.error)}:e},y=()=>e.lifecycle.phase===`selection`||f()?.source===`create`,b=()=>!t()&&y(),x=()=>c(`devices.pairing.copySetupCode`);return j(w,{get when(){return e.open},get children(){var n=xe(),r=n.firstChild.firstChild,o=r.firstChild,C=o.nextSibling,E=C.firstChild,P=r.nextSibling,F=P.firstChild,I=F.nextSibling,L=I.nextSibling,R=L.firstChild,z=L.nextSibling,oe=z.nextSibling,B=P.nextSibling,V=B.firstChild,H=V.nextSibling,U=H.nextSibling,W=U.nextSibling,G=W.nextSibling,K=T();return n.addEventListener(`modal-cancel`,()=>e.onClose()),n._$owner=T(),O(o,()=>c(`devices.pairing.title`)),A(E,`target`,u),O(E,j(h,{name:`circleQuestionMark`})),O(C,j(ne,{size:28,class:`oc-dialog__close device-pair-setup__close`,icon:`x`,get label(){return c(`common.dismiss`)},tooltip:!1,onClick:()=>e.onClose()}),null),O(r,j(w,{get when(){return!d()},get children(){var e=ge(),t=e.firstChild;return O(t,p),e}}),null),O(P,j(w,{get when(){return y()},get children(){var t=_e(),n=t.firstChild;return O(n,()=>c(`devices.pairing.accessTitle`)),O(t,j(S,{each:Ve,children:t=>j(se,{name:`device-pair-access`,get checked(){return e.lifecycle.access===t[0]},onChange:()=>e.onAccessChange(t[0]),get children(){var e=Se(),n=e.firstChild,r=n.nextSibling;return O(n,()=>c(t[1])),O(r,()=>c(t[2])),e}})}),null),M(()=>!b(),e=>{A(t,`disabled`,e)}),t}}),F),O(P,j(w,{get when(){return t()||e.lifecycle.phase===`loading`||e.lifecycle.phase===`reconciling`},get children(){var t=ve(),n=t.firstChild.nextSibling;return O(n,()=>c(e.lifecycle.phase===`loading`?`devices.pairing.generating`:`common.loading`)),t}}),I),O(P,j(w,{get when(){return _()},children:e=>j(te,{tone:`danger`,class:`device-pair-setup__error`,role:`alert`,get children(){return[(()=>{var t=Q();return O(t,()=>c(e().source===`status`?`devices.pairing.statusFailed`:`devices.pairing.failed`)),t})(),(()=>{var t=$();return O(t,()=>e().message),t})()]}})}),L),O(R,(()=>{var e=k(()=>!!g());return()=>e()?c(`devices.pairing.secureAccess.title`):``})()),O(L,j(w,{get when(){return g()},get children(){return j(ce,{})}}),null),O(P,j(w,{get when(){return s()},children:n=>{let r=()=>n().expiresAtMs<=e.nowMs,i=()=>`openclaw node run --pair "oc-pair://${n().setupCode}"`;return[j(w,{get when(){return m()},get fallback(){var e=Ae();return O(e,j(w,{get when(){return n().qrDataUrl},get fallback(){var e=je();return O(e,()=>c(`devices.pairing.qrUnavailable`)),e},children:e=>(()=>{var t=Me();return M(()=>({e:e(),t:c(`devices.pairing.qrAlt`)}),({e,t:n},r)=>{e!==r?.e&&A(t,`src`,e),n!==r?.t&&A(t,`alt`,n)}),t})()})),e},get children(){var t=we(),a=t.firstChild;return O(t,j(w,{get when(){return!r()},get children(){var e=Ce(),t=e.firstChild;return O(t,i),O(e,j(l,{get text(){return i()},get idleLabel(){return c(`connection.help.copyCommand`)}}),null),e}}),a),O(a,(()=>{var t=k(()=>!!r());return()=>t()?c(`devices.pairing.nodeExpired`):c(`devices.pairing.nodeExpiresIn`,{time:ee(n().expiresAtMs,e.nowMs)})})()),t}}),j(w,{get when(){return e.pendingCount===0},get children(){var t=Ee();return O(t,j(w,{get when(){return!m()},get fallback(){return c(`devices.pairing.nodeWaiting`)},get children(){return[k(()=>c(`devices.pairing.waiting`)),` `,(()=>{var t=Te();return t._$$click=()=>e.onGetApps(),O(t,()=>c(`devices.pairing.getApps`)),t})()]}})),t}}),(()=>{var t=De(),r=t.firstChild;return O(r,()=>`${c(J(e.lifecycle.access))} · ${n().auth}`),O(t,j(S,{get each(){return n().gatewayUrls??[n().gatewayUrl]},children:e=>(()=>{var t=Ne();return A(t,`title`,e),O(t,e),t})()}),null),t})(),j(w,{get when(){return n().accessDowngraded},get children(){return j(te,{tone:`warning`,class:`device-pair-setup__access-warning`,role:`status`,get children(){return[(()=>{var e=Q();return O(e,()=>c(`devices.pairing.transportLimitedTitle`)),e})(),(()=>{var e=$();return O(e,()=>c(`devices.pairing.transportLimitedHint`)),e})()]}})}}),(()=>{var t=Oe();return O(t,j(w,{get when(){return e.pendingCount>0},get children(){var t=$();return O(t,()=>c(`devices.pairing.pending`,{count:String(e.pendingCount)})),t}})),M(()=>ae(e.pendingCount>0?`callout warn device-pair-setup__pending`:`sr-only`),(e,n)=>{N(t,e,n)}),t})(),(()=>{var e=ke(),r=e.firstChild,i=r.firstChild,o=i.firstChild,s=o.nextSibling,l=i.nextSibling,u=r.nextSibling,d=u.firstChild,ee=d.nextSibling;return O(i,j(h,{name:`chevronRight`}),o),O(i,()=>c(`devices.pairing.showSetupCode`),s),O(l,()=>n().setupCode),u._$$click=()=>void a(),O(u,j(h,{name:`refresh`}),d),O(u,()=>c(`devices.pairing.newCode`),ee),M(()=>t(),e=>{A(u,`disabled`,e)}),e})()]}}),z),O(P,j(w,{get when(){return d()},children:e=>j(S,{get each(){return[e().phase]},children:()=>j(le,{get lifecycle(){return e()},get description(){return p()}})})}),oe),B._$owner=T(),O(B,j(w,{get when(){return!s()||e.pendingCount===0},get children(){var t=ye();return t._$$click=()=>e.onManageDevices(),O(t,()=>c(`devices.pairing.manageDevices`)),t}}),V),O(B,j(w,{get when(){return e.lifecycle.phase===`selection`},get children(){var e=Z();return e._$$click=()=>void a(),O(e,()=>c(`devices.pairing.generateCode`)),M(()=>t(),t=>{A(e,`disabled`,t)}),e}}),H),O(B,j(w,{get when(){return f()},get children(){var e=be(),n=e.firstChild,r=n.nextSibling;return e._$$click=()=>void a(),O(e,j(h,{name:`refresh`}),n),O(e,()=>c(g()?`common.retry`:`common.reload`),r),M(()=>t(),t=>{A(e,`disabled`,t)}),e}}),U),O(B,j(w,{get when(){return s()},children:t=>[j(w,{get when(){return!m()},get children(){return j(S,{get each(){return[t().setupCode]},children:t=>{let n;var r=Pe(),i=r.firstChild,a=i.nextSibling;return r._$$click=r=>{re(r,t,x(),{label:n}).then(t=>{!t&&e.open&&v({severity:`error`,message:c(`devices.pairing.copyFailed`)})})},O(r,j(h,{name:`copy`}),i),ie(()=>e=>n=e,a),O(a,x),M(()=>e.pendingCount===0,e=>{r.classList.toggle(`primary`,e)}),r}})}}),j(w,{get when(){return e.pendingCount>0},get children(){var t=Z();return t._$$click=()=>e.onManageDevices(),O(t,()=>c(`devices.pairing.review`)),t}})]}),W),O(B,j(w,{get when(){return d()},children:n=>j(S,{get each(){return[n().phase]},children:n=>(()=>{var r=Fe(),i=r.firstChild,o=i.nextSibling;return r._$$click=()=>n===`success`?e.onClose():void a(),O(r,j(w,{when:n!==`success`,get children(){return[j(h,{name:`refresh`}),` `]}}),i),O(r,()=>c(n===`success`?`devices.pairing.done`:`devices.pairing.generateNewCode`),o),M(()=>n!==`success`&&t(),e=>{A(r,`disabled`,e)}),r})()})}),G),M(()=>({e:c(`devices.pairing.title`),t:p(),a:m()?Le:Ie,o:i(),i:c(`devices.pairing.helpNewTab`),n:ae(g()?`device-pair-setup__command device-pair-setup__secure-access`:`sr-only`)}),({e,t,a:r,o:i,i:a,n:o},s)=>{e!==s?.e&&A(n,`label`,e),t!==s?.t&&A(n,`description`,t),r!==s?.a&&A(E,`href`,r),i!==s?.o&&A(E,`rel`,i),a!==s?.i&&A(E,`aria-label`,a),N(L,o,s?.n),D(E,K)}),n}})}var Y,de,fe,pe,X,me,he,ge,_e,ve,ye,Z,be,xe,Se,Q,$,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve;function He(){return(He=e((()=>{F(),E(),W(),B(),y(),d(),f(),b(),g(),V(),q(),oe(),m(),a(),p(),s(),_(),Y=L(`<p>`),de=L(`<section class=device-pair-setup__command><strong></strong><p></p><div class=login-gate__command><code>openclaw config set gateway.tailscale.mode serve</code></div><a class=device-pair-setup__link href=https://docs.openclaw.ai/gateway/tailscale>`),fe=L(`<details class=device-pair-setup__fallback><summary><!><!></summary><p></p><div class=login-gate__command><code>openclaw config set gateway.bind lan</code></div><p>`),pe=L(`<details class=device-pair-setup__fallback><summary><!><!></summary><p>`),X=L(`<span aria-hidden=true>·`),me=L(`<p><!><!>`),he=L(`<div class=device-pair-setup__state><div class=device-pair-setup__state-icon aria-hidden=true></div><h3>`),ge=L(`<div class=oc-dialog__description><p>`),_e=L(`<fieldset class=device-pair-setup__access><legend>`),ve=L(`<div class=device-pair-setup__loading role=status aria-live=polite><span class=device-pair-setup__spinner aria-hidden=true></span><span>`),ye=L(`<button class="btn btn--ghost"type=button>`),Z=L(`<button class="btn primary"type=button>`),be=L(`<button class="btn primary"type=button> <!>`),xe=L(`<openclaw-modal-dialog><section class="oc-dialog device-pair-setup"><header class=oc-dialog__header><h2 class=oc-dialog__title></h2><div class=oc-dialog__header-actions><a class="oc-icon-button oc-icon-button--28 oc-dialog__icon-button device-pair-setup__help"></a></div></header><div class="oc-dialog__body device-pair-setup__body"><!><!><div><strong aria-live=polite aria-atomic=true></strong></div><!><!></div><openclaw-modal-actions class="oc-dialog__footer device-pair-setup__footer device-pair-setup__actions"><!><!><!><!><!>`,1),Se=L(`<span><strong></strong><small>`),Q=L(`<strong>`),$=L(`<span>`),Ce=L(`<div class=login-gate__command><code>`),we=L(`<div class=device-pair-setup__command><p class=device-pair-setup__waiting role=timer aria-live=off>`),Te=L(`<button class=device-pair-setup__link type=button>`),Ee=L(`<p class=device-pair-setup__waiting>`),De=L(`<div class=device-pair-setup__meta><span>`),Oe=L(`<div role=status>`),ke=L(`<div class=device-pair-setup__code><details class=device-pair-setup__fallback><summary><!><!></summary><code></code></details><button class="btn btn--sm btn--ghost"type=button> <!>`),Ae=L(`<div class=device-pair-setup__qr-frame>`),je=L(`<div class=device-pair-setup__qr-unavailable>`),Me=L(`<img class=device-pair-setup__qr width=360 height=360 draggable=false>`),Ne=L(`<span class=device-pair-setup__gateway>`),Pe=L(`<button class=btn type=button> <span data-copy-label>`),Fe=L(`<button class="btn primary"type=button><!><!>`),x(z),x(K),Ie=`https://docs.openclaw.ai/channels/pairing#pair-from-the-control-ui-recommended`,Le=`https://docs.openclaw.ai/gateway/pairing#one-paste-node-pairing`,Re=`openclaw config set gateway.tailscale.mode serve`,ze=`openclaw config set gateway.bind lan`,Be=`openclaw config set gateway.bind loopback`,Ve=[[`full`,`devices.pairing.fullAccess`,`devices.pairing.fullAccessHint`],[`limited`,`devices.pairing.limitedAccess`,`devices.pairing.limitedAccessHint`],[`node`,`devices.pairing.nodeAccess`,`devices.pairing.nodeAccessHint`]],P([`click`])})))()}He();export{ue as DevicePairSetup};