UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 17.9 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{GN as t,JN as n,XM as r,_C as i,fN as a,iv as o,ov as s,pN as c,rA as l,tA as u,vC as d}from"./_2_____________________________.js";import{$ as f,B as p,Ct as m,F as h,H as ee,I as te,O as g,Rt as _,S as v,U as y,_t as ne,a as b,d as x,f as S,g as C,gt as re,j as w,l as T,m as E,o as ie,p as ae,s as oe,u as se,w as D,x as O,yt as ce}from"./_6____________________.js";import{n as le,t as ue}from"./_1____________________________________.js";import{U as de,W as fe}from"./control-ui-boot-chat-styles-DMRbEm40.js";import{gt as k,ht as A,mt as pe}from"./control-ui-boot-chat-CqvkfPXD.js";import{n as me,t as he}from"./en-github-BjHf_X6d.js";function j(e){let[t,n]=p();var r=N();return x(r,w(g,{get when(){return S(()=>e.url!==t())()&&e.url},get fallback(){return d({username:e.login}).initials},children:t=>(()=>{var r=P();return r.addEventListener(`error`,()=>n(e.url)),T(()=>t(),e=>{C(r,`src`,e)}),r})()})),r}function M(e){return h(()=>e.choices.map(t=>({id:t.source,label:`@${t.login}${e.mobile||e.duplicateLogin?` · ${t.label}`:``}`,class:`session-menu__item`,type:`radio`,checked:e.selected===t.source,disabled:e.busy,content:e.mobile?(()=>{var e=F(),n=e.firstChild,r=n.firstChild,i=r.nextSibling;return i.firstChild,x(e,w(j,{get login(){return t.login},get url(){return t.avatarUrl}}),n),x(r,()=>t.label),x(i,()=>t.login,null),e})():e.accountLabels?(()=>{var e=I(),n=e.firstChild,r=n.nextSibling;return r.firstChild,x(n,()=>t.label),x(r,()=>t.login,null),e})():(()=>{var n=L(),r=n.firstChild.nextSibling,i=r.nextSibling;return x(n,()=>t.login,r),x(n,(()=>{var n=S(()=>!!e.duplicateLogin);return()=>n()?` · ${t.label}`:void 0})(),i),n})(),details:e.trailingCheck===!1?void 0:(()=>{var n=R();return x(n,(()=>{var n=S(()=>e.selected===t.source);return()=>n()&&w(a,{name:`check`})})()),n})()})))}function ge(e){let t=ee(),r=e.controls?.ref(),i=h(()=>fe(e.presented)),s=()=>e.choices.find(t=>t.source===e.selected),c=()=>{let t=e.mobile?s():void 0;return t?`${n(`githubPublication.account`)}: ${t.label}, @${t.login}`:n(`githubPublication.account`)},l=M(e);return w(o,{ref:e=>{e.overlay.trigger&&r?.(e.overlay.trigger)},id:`github-publication-${t}`,get class(){return e.mobile?`github-publication-mobile__accounts`:`chat-pr__accounts`},get panelClass(){return e.mobile?`github-publication-mobile__accounts-panel`:`chat-pr__accounts-panel`},placement:`top-end`,get label(){return c()},get disabled(){return e.busy},get triggerAttributes(){return{"data-form-control":e.menuControls?``:void 0}},get triggerClass(){return e.mobile?`github-publication-mobile__account-trigger`:`btn btn--ghost btn--icon chat-icon-btn`},get trigger(){return w(g,{get when(){return e.trigger},get fallback(){return w(a,{name:`chevronDown`})},get children(){return e.trigger}})},get items(){return l()},get open(){return i().read()?void 0:!1},onBeforeShow:e=>{i().read()||e.preventDefault()},onSelect:t=>{(t.id===`shared`||t.id===`personal`)&&e.onSelect(t.id)}})}var N,P,F,I,L,R;function z(){return(z=e((()=>{se(),y(),c(),s(),i(),t(),de(),N=O(`<span class=github-publication-mobile__avatar aria-hidden=true>`),P=O(`<img alt referrerpolicy=no-referrer>`),F=O(`<span class=github-publication-mobile__choice><span class=github-publication-mobile__choice-text><span></span><span class=github-publication-mobile__choice-login>@`),I=O(`<span class=chat-pr-account-choice><span></span><span class=chat-pr-account-choice__login>@`),L=O(`<span class=session-menu__text>@<!><!>`),R=O(`<span class=session-menu__icon aria-hidden=true>`)})))()}function B(e){let t=h(()=>({retired:e().readiness.retired}),{equals:(e,t)=>e.retired===t.retired}),n=h(()=>{let{retired:e}=t(),[n,r]=te(!1);return{retired:e,busy:n,setBusy:r}}),[r,i]=p(null),a=h(()=>{let{read:t,retired:n}=e().readiness;return t?Promise.race([t,n]):null}),o=h(()=>{let e=r();return e?.retired===t().retired?e.completion:null}),s=ce(function*(e,t){e===n()&&(e.setBusy(!0),f(a)),(yield Promise.race([t.then(()=>!0),e.retired.then(()=>!1)]))&&e===n()&&(yield ne(a))});return{scope:t,read:a,outcome:o,error:(e,t)=>w(u,{get error(){return e()},onRetry:()=>{i(null),t()},inline:!0}),busy:()=>n().busy()||e().activity!==null,run(e){let t=n(),r=e?.();r&&re(()=>{let e=s(t,r);e.catch(()=>{}),i({retired:t.retired,completion:e})})}}}function V(e){return n(e===`personal`?`githubPublication.personal`:e===`agent-override`?`githubPublication.agent`:`githubPublication.system`)}function H(e){return e.selection??(e.options?.shared?null:A(e.options))}function _e(e,t){let n=t.source===`personal`?`personal`:`shared`;return(n===`personal`?e?.personal?.account:e?.shared)?.accountId===t.accountId?e?.avatarUrls?.[n]:void 0}function U(e){let t=A(e.options),n=e.options?.shared;return e.result||e.locked||e.optionsUnavailable||!e.onSelect||!n||!t?void 0:{accounts:[{source:`shared`,login:n.login,label:V(n.source),avatarUrl:e.options?.avatarUrls?.shared},{source:`personal`,login:t.account.login,label:V(`personal`),avatarUrl:e.options?.avatarUrls?.personal}],duplicateLogin:n.login===t.account.login}}function W(e){let t=h(()=>U(e.publication)),r=()=>e.publication.result?e.publication.result.publisher:k(H(e.publication)),i=()=>(()=>{var i=Y(),o=i.firstChild,s=o.nextSibling,c=s.nextSibling;return x(o,()=>n(`githubPublication.publishAsLabel`)),x(i,w(g,{get when(){return r()},children:t=>(()=>{var n=X(),r=n.firstChild;r.firstChild,x(n,w(j,{get login(){return t().login},get url(){return _e(e.publication.options,t())}}),r);var i=ue(()=>t().login);return(typeof i==`function`||Array.isArray(i))&&E(()=>i,r),x(r,()=>t().login,null),T(()=>({e:`@${t().login}`,t:`@${t().login}`}),({e,t},n)=>{e!==n?.e&&C(r,`aria-label`,e),t!==n?.t&&C(r,`title`,t)}),n})()}),s),x(i,w(g,{get when(){return t()},get children(){return w(a,{name:`chevronsUpDown`})}}),c),i})();return w(g,{get when(){return t()},get fallback(){return S(()=>!!(e.mobile&&r()))()?i():void 0},children:t=>w(ge,{get choices(){return t().accounts},get selected(){return e.publication.selection?.source},get duplicateLogin(){return t().duplicateLogin},get busy(){return e.publication.activity!==null},get presented(){return e.presented??!0},get mobile(){return e.mobile},get menuControls(){return e.menuControls},get controls(){return e.controls},get trigger(){return S(()=>!!e.mobile)()?i():void 0},onSelect:t=>e.publication.onSelect?.(t)})})}function ve(e){let t=B(()=>e.publication),r=e.controls?.ref(),i=e.controls?.ref(),o=()=>{let t=e.publication.result;return t?.status===`published`?t:void 0};return w(v,{get fallback(){return t.error},get children(){return w(g,{get when(){return o()},get fallback(){return w(g,{get when(){return e.publication.optionsUnavailable},get fallback(){return[w(ye,{get publication(){return e.publication},get controls(){return e.controls},get publishLabel(){return e.publishLabel},get pendingLabel(){return e.pendingLabel}}),w(g,{get when(){return S(()=>!e.mobile)()&&e.accountSelector!==!1},get children(){return w(W,{get publication(){return e.publication},get presented(){return e.presented},get menuControls(){return e.menuControls},get controls(){return e.controls}})}})]},get children(){return w(G,{get publication(){return e.publication},get tooltip(){return`${n(`githubPublication.statusUnavailable`)}: ${e.publication.error}`},get labelled(){return e.mobile},get hideTooltip(){return e.mobile},get controls(){return e.controls}})}})},children:o=>[(()=>{var e=Z(),t=_();return E(()=>e=>r?.(e),e),x(e,()=>n(`chat.pullRequests.openPublishedPr`)),T(()=>o().url,n=>{C(e,`href`,n),b(e,t)}),e})(),w(g,{get when(){return e.publication.onNewAction},get children(){var r=Te();return r._$$click=()=>t.run(e.publication.onNewAction),E(()=>e=>i?.(e),r),x(r,w(D,{get on(){return t.scope()},get fallback(){return w(a,{name:`x`})},get children(){return m(t.read),m(t.outcome),w(a,{name:`x`})}})),T(()=>({e:n(`common.dismiss`),t:t.busy()}),({e,t},n)=>{e!==n?.e&&C(r,`aria-label`,e),t!==n?.t&&C(r,`disabled`,t)}),r}})]})}})}function ye(e){let t=e.controls?.ref(),r=B(()=>e.publication),i=h(()=>{let t=e.publication,i=t.result,a=H(t),o=r.busy(),s=t.activity===`read`?n(`common.loading`):e.pendingLabel??n(`chat.pullRequests.publishing`);return i?.status===`failed`?{click:t.onNewAction,label:n(t.canPublishShared||t.canPublishPersonal?`githubPublication.newAction`:`common.dismiss`),disabled:o}:i?.status===`needs_confirmation`?{click:t.onConfirm,label:n(`githubPublication.confirm`),disabled:o||!t.personalReady}:i?.status===`publishing`||i?.status===`requested`?{click:t.onRefresh,label:o?s:n(`githubPublication.check`),disabled:o}:{click:t.onPublish,disabled:o||!a||a.source===`personal`&&!t.personalReady,label:o?s:t.locked?n(`chat.pullRequests.retryPublication`):!t.selection&&a?.source===`personal`?n(`githubPublication.publishAs`,{account:a.account.login}):e.publishLabel??n(`chat.pullRequests.publishPr`)}});return w(v,{get fallback(){return r.error},get children(){return w(g,{get when(){return i().click||e.publication.result?.status===`publishing`||e.publication.result?.status===`requested`},get children(){var e=De(),n=e.firstChild,a=n.nextSibling,o=a.nextSibling;return e._$$click=()=>r.run(i().click),E(()=>e=>t?.(e),e),x(e,w(g,{get when(){return r.busy()},get children(){return Ee()}}),n),x(e,()=>i().label,a),x(e,w(D,{get on(){return r.scope()},fallback:null,get children(){return m(r.read),m(r.outcome),null}}),o),T(()=>({e:r.busy()?`true`:void 0,t:i().disabled}),({e:t,t:n},r)=>{t!==r?.e&&C(e,`aria-busy`,t),n!==r?.t&&C(e,`disabled`,n)}),e}})}})}function be(e){let t=()=>e.publication.result?e.publication.result.publisher:k(e.publication.selection);return w(g,{get when(){return t()},children:t=>(()=>{var r=Oe(),i=r.firstChild,a=i.nextSibling;return x(r,w(g,{get when(){return!e.mobile},get children(){return[S(()=>n(`githubPublication.publishAs`,{account:t().login})),` ·`,` `]}}),i),x(r,()=>V(t().source),a),r})()})}function G(e){let t=e.controls?.ref(),r=B(()=>e.publication);return w(v,{get fallback(){return r.error},get children(){var i=Q(),o=i.firstChild,s=o.firstChild,c=s.nextSibling;return i._$owner=_(),o._$$click=()=>r.run(e.publication.onRefresh),E(()=>e=>t?.(e),o),x(o,w(D,{get on(){return r.scope()},get fallback(){return w(a,{name:`refresh`})},get children(){return m(r.read),m(r.outcome),w(a,{name:`refresh`})}}),s),x(o,w(g,{get when(){return e.labelled},get children(){return n(`githubPublication.refresh`)}}),c),T(()=>({e:e.tooltip??``,t:e.hideTooltip||!e.tooltip,a:ae(e.labelled?`chat-pr__create`:`btn btn--ghost btn--icon chat-icon-btn chat-pr__publication-refresh`),o:n(`githubPublication.refresh`),i:r.busy()}),({e,t,a:n,o:r,i:a},s)=>{e!==s?.e&&C(i,`content`,e),t!==s?.t&&(i.disabled=t),ie(o,n,s?.a),r!==s?.o&&C(o,`aria-label`,r),a!==s?.i&&C(o,`disabled`,a)}),i}})}function xe(e){let t=e.controls?.ref();return w(g,{get when(){return e.effect},children:e=>(()=>{var r=ke(),i=r.firstChild,a=i.nextSibling,o=a.nextSibling;return x(r,()=>n(e().status===`dispatched`?`githubPublication.dispatched`:`githubPublication.observed`,{kind:n(e().kind===`push`?`githubPublication.effectPush`:`githubPublication.effectPullRequest`)}),i),x(r,w(g,{get when(){return e().headCommit},children:e=>(()=>{var t=Ae();return x(t,e),t})()}),a),x(r,w(g,{get when(){return e().url},children:e=>(()=>{var r=je(),i=_();return E(()=>e=>t?.(e),r),x(r,()=>n(`githubPublication.effectLink`)),T(()=>e(),e=>{C(r,`href`,e),b(r,i)}),r})()}),o),r})()})}function K(e){return e.error?`unavailable`:e.result?.status??(e.locked?e.activity===null?`unknown`:`active`:void 0)}function Se(e){switch(K(e)){case`unavailable`:return{text:n(`githubPublication.statusUnavailable`),alert:!0};case`failed`:return{text:n(`githubPublication.statusFailed`),alert:!0};case`needs_confirmation`:return{text:n(`githubPublication.statusConfirm`),alert:!1};case`active`:case`publishing`:return{text:n(`githubPublication.statusPublishing`),alert:!1};case`requested`:return{text:n(`githubPublication.statusRequested`),alert:!1};case`unknown`:return{text:n(`githubPublication.statusUnknown`),alert:!0};default:return null}}function q(e){let{options:t,result:n,locked:r}=e;return!(!t||t.shared||A(t)||H(e)||n||r||e.activity!==null||!e.canPublishShared&&!e.canPublishPersonal)}function Ce(e){let t=()=>e.publication.activity===null&&(e.publication.optionsUnavailable||e.publication.error||q(e.publication)||e.publication.result?.status===`failed`||e.publication.result?.status===`needs_confirmation`&&!e.publication.onConfirm);return w(g,{get when(){return t()},get children(){return w(G,{get publication(){return e.publication},hideTooltip:!0})}})}function we(e){let t=e.controls?.ref(),r=e.controls?.ref(),i=()=>e.publication.activity!==null,o=()=>H(e.publication)?.source===`personal`&&!e.publication.personalReady,s=()=>q(e.publication),c=()=>{let{result:t,confirmation:n,error:r,locked:i,optionsUnavailable:a}=e.publication;return!(t?.status===`published`&&!r)&&!a&&!!(t||n||r||i||o()||s())},l=()=>Se(e.publication),u=()=>!i()&&(e.publication.error||s()||e.publication.result?.status===`failed`||e.publication.result?.status===`needs_confirmation`&&!e.publication.onConfirm);return w(g,{get when(){return c()},get children(){var c=Pe(),d=c.firstChild,f=d.nextSibling,p=f.nextSibling,m=p.nextSibling,h=m.nextSibling;return x(c,w(g,{get when(){return e.inline},get fallback(){return w(g,{get when(){return l()},children:n=>(()=>{var r=Fe(),o=r.firstChild,s=o.firstChild,c=s.nextSibling;return E(()=>e=>t?.(e),o),x(s,()=>n().text),x(c,w(a,{name:`chevronDown`})),x(r,w(J,{get publication(){return e.publication},get busy(){return i()},get mobile(){return e.mobile},get controls(){return e.controls}}),null),T(()=>({e:e.menuControls?``:void 0,t:n().alert?`alert`:`status`}),({e,t},n)=>{e!==n?.e&&C(o,`data-form-control`,e),t!==n?.t&&C(s,`role`,t)}),r})()})},get children(){return w(J,{get publication(){return e.publication},get busy(){return i()},get mobile(){return e.mobile},get controls(){return e.controls}})}}),d),x(c,w(g,{get when(){return S(()=>!e.mobile)()&&u()},get children(){return w(G,{get publication(){return e.publication},get hideTooltip(){return e.mobile},get controls(){return e.controls}})}}),f),x(c,w(g,{get when(){return s()},get children(){var t=Me(),r=t.firstChild,i=r.nextSibling;return x(t,()=>n(`githubPublication.sharedUnavailable.${e.publication.options?.sharedUnavailableReason??`unknown`}`),r),x(t,(()=>{var t=S(()=>e.publication.options?.personal===null);return()=>t()?`${e.mobile?` `:``}${n(`githubPublication.unidentified`)}`:null})(),i),t}}),p),x(c,w(g,{get when(){return e.publication.confirmation},children:t=>(()=>{var i=Ie(),a=i.firstChild,o=a.nextSibling,s=o.nextSibling.firstChild,c=s.nextSibling,l=c.firstChild,u=l.nextSibling,d=c.nextSibling,f=d.firstChild,p=f.nextSibling,m=d.nextSibling,h=m.firstChild,ee=h.nextSibling;return x(a,()=>n(`githubPublication.target`,{repository:t().repository,base:t().baseBranch})),x(o,()=>n(`githubPublication.pushTarget`,{repository:t().pushRepository,branch:t().branch})),E(()=>e=>r?.(e),s),x(s,()=>n(`githubPublication.snapshot`)),x(c,()=>n(`githubPublication.head`),l),x(u,()=>t().sourceHeadCommit),x(d,()=>n(`githubPublication.index`),f),x(p,()=>t().sourceIndexTree),x(m,()=>n(`githubPublication.workspace`),h),x(ee,()=>t().workspaceTree),T(()=>e.menuControls?``:void 0,e=>{C(s,`data-form-control`,e)}),i})()}),m),x(c,w(g,{get when(){return o()},get children(){var e=Ne();return x(e,()=>n(`githubPublication.personalWorkspace`)),e}}),h),T(()=>e.publication.result?.status??`selection`,e=>{C(c,`data-state`,e)}),c}})}function J(e){let t=()=>{let t=e.publication.result;return t&&t.status!==`published`?t.status===`failed`?t.nextAction:t.message:void 0};return w(g,{get when(){return e.publication.result||e.publication.locked||e.publication.error},get children(){var r=Le(),i=r.firstChild,a=i.nextSibling,o=a.nextSibling,s=o.nextSibling,c=s.nextSibling;return x(r,w(be,{get publication(){return e.publication},get mobile(){return e.mobile}}),i),x(r,w(g,{get when(){return t()},children:e=>(()=>{var t=$();return x(t,e),t})()}),a),x(r,w(g,{get when(){return e.publication.error},children:e=>(()=>{var t=$();return x(t,e),t})()}),o),x(r,w(g,{get when(){return S(()=>!(!e.publication.locked||e.publication.result))()?!e.busy:e.publication.locked&&!e.publication.result},get children(){var e=$();return x(e,()=>n(`githubPublication.unknown`)),e}}),s),x(r,w(xe,{get effect(){return e.publication.result?.effect},get controls(){return e.controls}}),c),r}})}var Y,X,Z,Te,Ee,De,Oe,Q,ke,Ae,je,Me,Ne,Pe,Fe,Ie,$,Le;function Re(){return(Re=e((()=>{se(),y(),c(),l(),le(),he(),r(),t(),pe(),z(),Y=O(`<span class=github-publication-mobile__account-row><span></span><!><!>`),X=O(`<span class=github-publication-mobile__account-identity><span class=github-publication-mobile__login>@`),Z=O(`<a class=chat-pr__create target=_blank rel="noopener noreferrer">`),Te=O(`<button class=chat-pr__dismiss type=button>`),Ee=O(`<span class=btn__spinner aria-hidden=true>`),De=O(`<button class=chat-pr__create type=button><!><!><!>`),Oe=O(`<span data-publication-account><!><!>`),Q=O(`<openclaw-tooltip><button type=button><!><!>`,1),ke=O(`<span><!><!><!>`),Ae=O(`<code>`),je=O(`<a target=_blank rel="noopener noreferrer">`),Me=O(`<span class=chat-pr__publication-note><!><!>`),Ne=O(`<span class=chat-pr__publication-note>`),Pe=O(`<div class=chat-pr__publication-outcome><!><!><!><!><!>`),Fe=O(`<details class=chat-pr__publication-status><summary><span class=chat-pr__publication-headline></span><span class=chat-pr__publication-chevron aria-hidden=true>`),Ie=O(`<div class=chat-pr__publication-note><div></div><div></div><details><summary></summary><div>: <code></code></div><div>: <code></code></div><div>: <code>`),$=O(`<span>`),Le=O(`<div class=chat-pr__publication-more><!><!><!><!><!>`),me(),oe([`click`])})))()}export{U as a,M as c,Ce as i,z as l,ve as n,K as o,we as r,Re as s,W as t};