openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 12.9 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{$b as t,$w as n,AN as r,EN as i,GN as a,JN as o,ON as s,Qw as c,dx as l,eT as u,fA as ee,fN as te,ml as d,pA as ne,pN as re,pl as ie,qN as ae}from"./_2_____________________________.js";import{Ct as oe,F as f,O as p,Rt as m,S as h,St as g,T as _,U as se,a as ce,d as v,f as y,g as b,j as x,k as le,l as S,m as C,s as w,u as ue,w as T,x as E}from"./_6____________________.js";import{C as D,g as de,h as fe,m as O,w as pe,y as k}from"./settings-controls-runtime-CwXZmgDo.js";import{r as me,t as he}from"./settings-disclosure-C2Lxm_wL.js";import{n as ge,t as _e}from"./en-github-connections-DbO30xwn.js";function A(e){let t=f(()=>e.request.statusCompletion);return x(h,{fallback:e=>x(k,{get kind(){return g(()=>t())?`muted`:`warn`},get label(){return y(()=>!!g(()=>t()))()?o(`githubConnections.checking`):o(`githubConnections.statusUnavailable`)}}),get children(){return x(T,{get on(){return e.request.statusCompletion},get fallback(){return x(k,{kind:`muted`,get label(){return o(`githubConnections.checking`)}})},get children(){return x(p,{get when(){return t()===void 0},get children(){return x(k,{kind:`muted`,get label(){return o(`githubConnections.notLoaded`)}})}})}})}})}function j(e){return x(p,{get when(){return e.identity},get fallback(){return x(A,{get request(){return e.request}})},children:e=>x(k,{get kind(){return Y[e().credentialState].kind},get label(){return o(Y[e().credentialState].label)}})})}function M(e){return x(p,{get when(){return e.identity},children:e=>[x(O,{get title(){return o(`agentTools.githubEffectiveAuthor`)},get control(){return x(D,{get value(){return[e().gitAuthor.name,e().gitAuthor.email].filter(Boolean).join(` · `)||o(`agentTools.githubAuthorUnset`)}})}}),x(O,{get title(){return o(`agentTools.githubEffectiveCredential`)},get control(){return x(D,{get value(){return o(X[e().credentialKind])}})}}),x(p,{get when(){return e().credentialKind===`managed-oauth`},get children(){return[x(O,{get title(){return o(`agentTools.githubEffectiveAccessExpiry`)},get control(){return x(D,{get value(){return y(()=>!!e().accessExpiresAtMs)()?t(e().accessExpiresAtMs):o(`common.na`)}})}}),x(O,{get title(){return o(`agentTools.githubEffectiveRefresh`)},get control(){return x(D,{get value(){return o(Z[e().refreshState])}})}}),x(O,{get title(){return o(`agentTools.githubEffectiveScopes`)},get control(){return x(D,{get value(){return e().oauthScopes.join(`, `)||o(`common.none`)}})}})]}})]})}function N(e){let t=()=>e.identity.read(),n=()=>t().authorization,r=()=>{let e=n();return`userCode`in e?e:void 0},i=()=>n().phase===`starting`||n().phase===`cancelling`&&!r(),a=()=>[`access_denied`,`expired`,`incorrect_device_code`,`failed`].includes(n().phase),c=()=>{let e=n();return s(e.phase===`expired`?o(`agentTools.githubExpired`):e.phase===`access_denied`?o(`agentTools.githubDenied`):e.phase===`incorrect_device_code`?o(`agentTools.githubIncorrectCode`):``)},l=()=>{let e=n();return e.phase===`failed`?e.message:void 0},u=()=>x(p,{get when(){return t().scope!==`personal`},get children(){var t=L();return t._$$click=()=>e.identity.showPatFallback(),v(t,()=>o(`agentTools.githubUsePat`)),t}});return x(le,{get children(){return[x(_,{get when(){return!t().connectionReady},get children(){return x(O,{get title(){return o(`agentTools.githubConnection`)},get control(){return x(k,{kind:`muted`,get label(){return o(`agentTools.githubDisconnected`)}})}})}}),x(_,{get when(){return!t().statusReadable},get children(){return x(O,{get title(){return x(k,{kind:`danger`,get label(){return o(`agentTools.githubAccessRequired`)}})},get description(){return o(t().scope===`personal`?`agentTools.githubReadRequired`:`agentTools.githubAdminRequired`)}})}}),x(_,{get when(){return!t().authorizable},get children(){return x(O,{get title(){return x(k,{kind:`warn`,get label(){return o(`agentTools.githubAccessRequired`)}})},get description(){return o(t().scope===`personal`?`agentTools.githubPersonalSignInRequired`:`agentTools.githubAdminRequired`)}})}}),x(_,{get when(){return i()},get children(){return x(O,{get title(){return o(`agentTools.githubAuthorization`)},get control(){return[x(k,{kind:`accent`,get label(){return y(()=>n().phase===`cancelling`)()?o(`agentTools.githubCancelling`):o(`agentTools.githubStarting`)}}),x(p,{get when(){return n().phase===`starting`},get children(){var t=L();return t._$$click=()=>void e.identity.cancelAuthorization(),v(t,()=>o(`common.cancel`)),t}})]}})}}),x(_,{get when(){return r()},children:t=>x(P,{get identity(){return e.identity},get authorization(){return t()}})}),x(_,{get when(){return!t().patVisible},get children(){return[x(O,{get title(){return y(()=>!!a())()?x(k,{kind:`danger`,get label(){return o(`agentTools.githubAuthorizationFailed`)}}):o(`agentTools.githubAuthorization`)},get description(){return y(()=>!!a())()?[x(p,{get when(){return c()},children:e=>(()=>{var t=R();return v(t,e),t})()}),x(ee,{get error(){return l()}})]:o(`agentTools.githubConnectHint`)},get control(){return[(()=>{var t=L();return t._$$click=()=>void e.identity.startAuthorization(),v(t,()=>o(`githubConnections.continue`)),t})(),x(p,{get when(){return a()},get children(){return u()}})]}}),x(p,{get when(){return y(()=>!a())()&&t().scope!==`personal`},get children(){return x(O,{get title(){return o(`agentTools.githubPatFallback`)},get description(){return o(`agentTools.githubPatFallbackHint`)},get control(){return u()}})}})]}})]}})}function P(e){return[x(O,{get title(){return o(`agentTools.githubAuthorization`)},get description(){return y(()=>e.authorization.phase===`cancel_error`)()?`${o(`agentTools.githubCancelFailedHint`)}${e.authorization.message?` ${e.authorization.message}`:``}`:o(`agentTools.githubAuthorizationHint`)},get control(){return[x(k,{get kind(){return e.authorization.phase===`network_error`||e.authorization.phase===`cancel_error`?`warn`:`accent`},get label(){return o(e.authorization.phase===`pending`&&e.authorization.slowedDown?`agentTools.githubSlowDown`:Q[e.authorization.phase])}}),(()=>{var t=V(),r=m();return b(t,`target`,c),v(t,()=>o(`agentTools.githubOpen`)),S(()=>({e:e.authorization.verificationUri,t:n()}),({e,t:n},i)=>{e!==i?.e&&b(t,`href`,e),n!==i?.t&&b(t,`rel`,n),ce(t,r)}),t})()]}}),x(O,{get title(){return o(`agentTools.githubDeviceCode`)},get description(){return o(`agentTools.githubDeviceCodeHint`)},get control(){return[(()=>{var t=H();return v(t,()=>e.authorization.userCode),t})(),x(p,{get when(){return e.authorization.userCode},keyed:!0,children:e=>{let t,n;return[(()=>{var r=U(),i=r.firstChild;return r._$$click=r=>void ie(r,e,o(`agentTools.githubCopyCode`),{label:t,announcement:n}),v(r,x(te,{name:`copy`}),i),C(()=>e=>t=e,i),v(i,()=>o(`agentTools.githubCopyCode`)),r})(),(()=>{var e=W();return C(()=>e=>n=e,e),e})()]}})]}}),x(O,{get title(){return o(`agentTools.githubExpires`)},get control(){return x(D,{get value(){return t(e.authorization.displayExpiresAtMs,{dateStyle:`medium`,timeStyle:`short`})}})}}),(()=>{var t=B(),n=t.firstChild;return v(n,x(p,{get when(){return y(()=>e.authorization.phase!==`cancelling`)()&&e.authorization.phase!==`finishing`},get children(){var t=z();return t._$$click=()=>void e.identity.cancelAuthorization(),v(t,(()=>{var t=y(()=>e.authorization.phase===`cancel_error`);return()=>t()?o(`agentTools.githubRetryCancel`):o(`common.cancel`)})()),t}})),t})()]}function F(e){return x(p,{get when(){return e.error},get children(){return x(O,{get title(){return o(`agentTools.githubErrorTitle`)},get description(){var t=G();return v(t,()=>s(e.error)),t},get control(){return e.control}})}})}function I(e){let t=f(()=>e.secondaryCompletion?Promise.all([e.completion,e.secondaryCompletion]).then(()=>void 0):e.completion);return x(p,{get when(){return e.error},get fallback(){return x(h,{fallback:t=>x(F,{get error(){return i(t())},get control(){return e.control}}),get children(){return x(T,{get on(){return oe(()=>[e.completion,e.secondaryCompletion])},fallback:null,get children(){return x(p,{get when(){return t()===void 0},children:null})}})}})},get children(){return x(F,{get error(){return e.error},get control(){return e.control}})}})}function ve(e){let t=()=>e.identity.read(),n=()=>e.identity.saving()||!t().connectionReady||!t().configurable||t().authorizationActive,r=(r,i)=>x(O,{title:i,get control(){var a=K();return a._$$input=t=>e.identity.setDraft(r,t.currentTarget.value),b(a,`aria-label`,i),S(()=>({e:t().draft[r],t:n()}),({e,t},n)=>{a.value=e??``,t!==n?.t&&b(a,`disabled`,t)}),a}});return[x(N,{get identity(){return e.identity}}),x(p,{get when(){return t().patVisible},get children(){var i=q(),a=i.firstChild,s=a.nextSibling,c=s.nextSibling,l=c.firstChild.firstChild,u=l.nextSibling;return v(i,x(O,{get title(){return o(`agentTools.githubToken`)},get description(){return o(`agentTools.githubTokenDesc`)},get control(){return x(fe,{get ariaLabel(){return o(`agentTools.githubToken`)},get value(){return t().draft.token},get visible(){return t().tokenRevealed},get disabled(){return n()},get toggleLabel(){return o(`agentTools.githubTokenToggle`)},onInput:t=>e.identity.setDraft(`token`,t),onToggle:()=>e.identity.toggleTokenVisibility()})}}),a),v(i,()=>r(`name`,o(`agentTools.githubAuthorName`)),s),v(i,()=>r(`email`,o(`agentTools.githubAuthorEmail`)),c),l._$$click=()=>e.identity.hidePatFallback(),v(l,()=>o(`common.cancel`)),u._$$click=()=>void e.identity.configure(),v(u,(()=>{var t=y(()=>!!e.identity.saving());return()=>t()?o(`common.saving`):e.saveLabel??o(`agentTools.githubConfigure`)})()),S(()=>({e:e.identity.saving(),t:n()}),({e,t},n)=>{e!==n?.e&&b(l,`disabled`,e),t!==n?.t&&b(u,`disabled`,t)}),i}})]}function ye(e){let t=()=>e.identity.read(),n=()=>t().status?.effective??null;var r=J();return r._$owner=m(),v(r,x(de,{get title(){return o(`githubConnections.agentTitle`)},get description(){return o(`githubConnections.agentDescription`)},get actions(){return x(p,{get when(){return t().statusReadable},get children(){var n=L();return n._$$click=()=>void e.identity.verify(),v(n,()=>o(`agentTools.githubVerify`)),S(()=>t().loading||t().busy||t().authorizationActive,e=>{b(n,`disabled`,e)}),n}})},get children(){return[x(he,{get detailsLabel(){return o(`githubConnections.details`)},get hasDetails(){return n()!==null},get title(){return y(()=>!!n())()?y(()=>!!n().account)()?`@`+n().account.login:o(`agentTools.githubNoAccount`):x(A,{get request(){return t()}})},get description(){return y(()=>!!n())()?y(()=>n().source===`agent-override`)()?o(`githubConnections.ownAccount`):o(`githubConnections.usesShared`):void 0},get control(){return[x(p,{get when(){return n()},get children(){return x(j,{get identity(){return n()},get request(){return t()}})}}),(()=>{var t=L();return t._$$click=()=>e.onOpenConnections(),v(t,()=>o(`githubConnections.manageCommon`)),t})()]},get children(){return x(M,{get identity(){return n()}})}}),x(I,{get error(){return t().error},get completion(){return t().completion}})]}})),r}var L,R,z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q;function $(){return($=e((()=>{ue(),se(),ne(),d(),re(),me(),pe(),_e(),u(),r(),l(),a(),L=E(`<button class="btn btn--sm">`),R=E(`<div>`),z=E(`<button type=button class="btn btn--sm">`),B=E(`<div class="settings-row settings-row--actions"><div class=settings-row__control>`),V=E(`<a class="btn btn--sm">`),H=E(`<code class="settings-row__value settings-row__value--mono github-device-code">`),U=E(`<button type=button class="btn btn--sm"><span data-copy-label>`),W=E(`<span class=sr-only role=status>`),G=E(`<span role=alert>`),K=E(`<input class=settings-input autocomplete=off>`),q=E(`<div class=settings-subrows><!><!><div class="settings-row settings-row--actions"><div class=settings-row__control><button class=btn></button><button class="btn primary">`),J=E(`<openclaw-github-identity style=display:contents>`,1),Y={available:{kind:`ok`,label:`agentTools.githubStateVerified`},unverified:{kind:`warn`,label:`agentTools.githubStateUnverified`},rate_limited:{kind:`warn`,label:`agentTools.githubStateRateLimited`},unavailable:{kind:`danger`,label:`agentTools.githubStateUnavailable`},configured_unavailable:{kind:`danger`,label:`agentTools.githubStateConfiguredUnavailable`}},X={native:`agentTools.githubKindNative`,"managed-pat":`agentTools.githubKindPat`,"managed-oauth":`agentTools.githubKindOAuth`,"app-installation":`agentTools.githubKindAppInstallation`},Z={available:`agentTools.githubRefreshAvailable`,expired:`agentTools.githubRefreshExpired`,unavailable:`agentTools.githubRefreshUnavailable`,refreshing:`agentTools.githubRefreshRefreshing`,failed:`agentTools.githubRefreshFailed`,not_applicable:`common.na`},Q={code:`agentTools.githubCodeReady`,pending:`agentTools.githubWaiting`,cancelling:`agentTools.githubCancelling`,finishing:`agentTools.githubFinishing`,cancel_error:`agentTools.githubCancelFailed`,network_error:`agentTools.githubNetworkRetry`},ae(ge),w([`click`,`input`])})))()}export{ye as a,j as i,ve as n,A as o,M as r,$ as s,I as t};