openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 13.7 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Qt as t,Xt as n,Zt as r}from"./control-ui-connection-Bfj9beF_.js";import{BA as i,Cc as a,QC as o,Sc as s,XC as c,ZC as l,bb as u,dj as ee,kb as te,mj as d,pj as ne,zA as re}from"./control-ui-boot-shared-DFTSUQQ0.js";import{Ct as ie,F as f,O as p,Rt as m,S as h,St as g,T as _,U as ae,a as oe,d as v,f as y,g as b,j as x,k as se,l as S,m as C,s as ce,u as le,w,x as T}from"./solid-runtime-C416s-HC.js";import{d as E,f as ue,h as D,p as de,v as O,y as fe}from"./settings-ui-Ck6BJLhD.js";import{n as pe,t as me}from"./en-github-connections-Bhx11Hwa.js";function k(e){let t=f(()=>e.request.statusCompletion);return x(h,{fallback:e=>x(D,{get kind(){return g(()=>t())?`muted`:`warn`},get label(){return y(()=>!!g(()=>t()))()?d(`githubConnections.checking`):d(`githubConnections.statusUnavailable`)}}),get children(){return x(w,{get on(){return e.request.statusCompletion},get fallback(){return x(D,{kind:`muted`,get label(){return d(`githubConnections.checking`)}})},get children(){return x(p,{get when(){return t()===void 0},get children(){return x(D,{kind:`muted`,get label(){return d(`githubConnections.notLoaded`)}})}})}})}})}function A(e){return x(p,{get when(){return e.identity},get fallback(){return x(k,{get request(){return e.request}})},children:e=>x(D,{get kind(){return Y[e().credentialState].kind},get label(){return d(Y[e().credentialState].label)}})})}function j(e){return x(p,{get when(){return e.identity},children:e=>(()=>{var t=I(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,a=i.nextSibling,o=a.nextSibling;return v(n,()=>d(`githubConnections.details`)),v(r,x(E,{get title(){return d(`agentTools.githubEffectiveAuthor`)},get control(){return x(O,{get value(){return[e().gitAuthor.name,e().gitAuthor.email].filter(Boolean).join(` · `)||d(`agentTools.githubAuthorUnset`)}})}}),i),v(r,x(E,{get title(){return d(`agentTools.githubEffectiveCredential`)},get control(){return x(O,{get value(){return d(X[e().credentialKind])}})}}),a),v(r,x(p,{get when(){return e().credentialKind===`managed-oauth`},get children(){return[x(E,{get title(){return d(`agentTools.githubEffectiveAccessExpiry`)},get control(){return x(O,{get value(){return y(()=>!!e().accessExpiresAtMs)()?u(e().accessExpiresAtMs):d(`common.na`)}})}}),x(E,{get title(){return d(`agentTools.githubEffectiveRefresh`)},get control(){return x(O,{get value(){return d(Z[e().refreshState])}})}}),x(E,{get title(){return d(`agentTools.githubEffectiveScopes`)},get control(){return x(O,{get value(){return e().oauthScopes.join(`, `)||d(`common.none`)}})}})]}}),o),t})()})}function M(e){let t=()=>e.identity.read(),n=()=>t().authorization,i=()=>{let e=n();return`userCode`in e?e:void 0},a=()=>n().phase===`starting`||n().phase===`cancelling`&&!i(),o=()=>[`access_denied`,`expired`,`incorrect_device_code`,`failed`].includes(n().phase),s=()=>{let e=n();return r(e.phase===`expired`?d(`agentTools.githubExpired`):e.phase===`access_denied`?d(`agentTools.githubDenied`):e.phase===`incorrect_device_code`?d(`agentTools.githubIncorrectCode`):e.phase===`failed`?e.message??d(`agentTools.githubAuthorizationFailed`):d(`agentTools.githubAuthorizationFailed`))},c=()=>x(p,{get when(){return t().scope!==`personal`},get children(){var t=L();return t._$$click=()=>e.identity.showPatFallback(),v(t,()=>d(`agentTools.githubUsePat`)),t}});return x(se,{get children(){return[x(_,{get when(){return!t().connectionReady},get children(){return x(E,{get title(){return d(`agentTools.githubConnection`)},get control(){return x(D,{kind:`muted`,get label(){return d(`agentTools.githubDisconnected`)}})}})}}),x(_,{get when(){return!t().statusReadable},get children(){return x(E,{get title(){return x(D,{kind:`danger`,get label(){return d(`agentTools.githubAccessRequired`)}})},get description(){return d(`agentTools.githubReadRequired`)}})}}),x(_,{get when(){return!t().authorizable},get children(){return x(E,{get title(){return x(D,{kind:`warn`,get label(){return d(`agentTools.githubAccessRequired`)}})},get description(){return d(`agentTools.githubAdminRequired`)}})}}),x(_,{get when(){return a()},get children(){return x(E,{get title(){return d(`agentTools.githubAuthorization`)},get control(){return[x(D,{kind:`accent`,get label(){return y(()=>n().phase===`cancelling`)()?d(`agentTools.githubCancelling`):d(`agentTools.githubStarting`)}}),x(p,{get when(){return n().phase===`starting`},get children(){var t=R();return t._$$click=()=>void e.identity.cancelAuthorization(),v(t,()=>d(`common.cancel`)),t}})]}})}}),x(_,{get when(){return i()},children:t=>x(he,{get identity(){return e.identity},get authorization(){return t()}})}),x(_,{get when(){return!t().patVisible},get children(){return[x(E,{get title(){return y(()=>!!o())()?x(D,{kind:`danger`,get label(){return d(`agentTools.githubAuthorizationFailed`)}}):d(`agentTools.githubAuthorization`)},get description(){return y(()=>!!o())()?s():d(`agentTools.githubConnectHint`)},get control(){return[(()=>{var t=L();return t._$$click=()=>void e.identity.startAuthorization(),v(t,()=>d(`githubConnections.continue`)),t})(),x(p,{get when(){return o()},get children(){return c()}})]}}),x(p,{get when(){return y(()=>!o())()&&t().scope!==`personal`},get children(){return x(E,{get title(){return d(`agentTools.githubPatFallback`)},get description(){return d(`agentTools.githubPatFallbackHint`)},get control(){return c()}})}})]}})]}})}function he(e){return[x(E,{get title(){return d(`agentTools.githubAuthorization`)},get description(){return y(()=>e.authorization.phase===`cancel_error`)()?`${d(`agentTools.githubCancelFailedHint`)}${e.authorization.message?` ${e.authorization.message}`:``}`:d(`agentTools.githubAuthorizationHint`)},get control(){return[x(D,{get kind(){return e.authorization.phase===`network_error`||e.authorization.phase===`cancel_error`?`warn`:`accent`},get label(){return d(e.authorization.phase===`pending`&&e.authorization.slowedDown?`agentTools.githubSlowDown`:Q[e.authorization.phase])}}),(()=>{var t=V(),n=m();return b(t,`target`,c),v(t,()=>d(`agentTools.githubOpen`)),S(()=>({e:e.authorization.verificationUri,t:l()}),({e,t:r},i)=>{e!==i?.e&&b(t,`href`,e),r!==i?.t&&b(t,`rel`,r),oe(t,n)}),t})()]}}),x(E,{get title(){return d(`agentTools.githubDeviceCode`)},get description(){return d(`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 s(r,e,d(`agentTools.githubCopyCode`),{label:t,announcement:n}),v(r,x(re,{name:`copy`}),i),C(()=>e=>t=e,i),v(i,()=>d(`agentTools.githubCopyCode`)),r})(),(()=>{var e=W();return C(()=>e=>n=e,e),e})()]}})]}}),x(E,{get title(){return d(`agentTools.githubExpires`)},get control(){return x(O,{get value(){return u(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()?d(`agentTools.githubRetryCancel`):d(`common.cancel`)})()),t}})),t})()]}function N(e){return x(p,{get when(){return e.error},get children(){return x(E,{get title(){return d(`agentTools.githubErrorTitle`)},get description(){var t=G();return v(t,()=>r(e.error)),t},get control(){return e.control}})}})}function P(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(N,{get error(){return n(t())},get control(){return e.control}}),get children(){return x(w,{get on(){return ie(()=>[e.completion,e.secondaryCompletion])},fallback:null,get children(){return x(p,{get when(){return t()===void 0},children:null})}})}})},get children(){return x(N,{get error(){return e.error},get control(){return e.control}})}})}function F(e){let t=()=>e.identity.read(),n=()=>e.identity.saving()||!t().connectionReady||!t().configurable||t().authorizationActive,r=(r,i)=>x(E,{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(M,{get identity(){return e.identity}}),x(p,{get when(){return t().patVisible},get children(){var i=q(),a=i.firstChild,o=a.nextSibling,s=o.nextSibling,c=s.firstChild.firstChild,l=c.nextSibling;return v(i,x(E,{get title(){return d(`agentTools.githubToken`)},get description(){return d(`agentTools.githubTokenDesc`)},get control(){return x(ue,{get ariaLabel(){return d(`agentTools.githubToken`)},get value(){return t().draft.token},get visible(){return t().tokenRevealed},get disabled(){return n()},get showLabel(){return d(`configForm.revealValue`)},get hideLabel(){return d(`configForm.hideValue`)},get toggleLabel(){return d(`agentTools.githubTokenToggle`)},onInput:t=>e.identity.setDraft(`token`,t),onToggle:()=>e.identity.toggleTokenVisibility()})}}),a),v(i,()=>r(`name`,d(`agentTools.githubAuthorName`)),o),v(i,()=>r(`email`,d(`agentTools.githubAuthorEmail`)),s),c._$$click=()=>e.identity.hidePatFallback(),v(c,()=>d(`common.cancel`)),l._$$click=()=>void e.identity.configure(),v(l,(()=>{var t=y(()=>!!e.identity.saving());return()=>t()?d(`common.saving`):d(`agentTools.githubConfigure`)})()),S(()=>({e:e.identity.saving(),t:n()}),({e,t},n)=>{e!==n?.e&&b(c,`disabled`,e),t!==n?.t&&b(l,`disabled`,t)}),i}})]}function ge(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 d(`githubConnections.agentTitle`)},get description(){return d(`githubConnections.agentDescription`)},get actions(){return x(p,{get when(){return t().statusReadable},get children(){var n=R();return n._$$click=()=>void e.identity.verify(),v(n,()=>d(`agentTools.githubVerify`)),S(()=>t().loading||t().busy||t().authorizationActive,e=>{b(n,`disabled`,e)}),n}})},get children(){return[x(E,{get title(){return y(()=>!!n()?.account)()?`@${n().account.login}`:d(`agentTools.githubNoAccount`)},get description(){return y(()=>n()?.source===`agent-override`)()?d(`githubConnections.agentOverride`):d(`githubConnections.system`)},get control(){return[x(A,{get identity(){return n()},get request(){return t()}}),(()=>{var t=R();return t._$$click=()=>e.onOpenConnections(),v(t,()=>d(`githubConnections.manageCommon`)),t})()]}}),x(P,{get error(){return t().error},get completion(){return t().completion}}),x(p,{get when(){return t().configurable},get children(){var n=I(),r=n.firstChild,i=r.nextSibling,a=i.firstChild,o=a.nextSibling,s=o.nextSibling;return v(r,()=>d(`githubConnections.advancedOverride`)),v(i,x(E,{get title(){return d(`githubConnections.agentOverride`)},get description(){return y(()=>!!t().status?.selected.configured)()?d(`agentTools.githubConfiguredHere`):d(`agentTools.githubInheritedHere`)}}),a),v(i,x(F,{get identity(){return e.identity}}),o),v(i,x(p,{get when(){return t().status?.selected.configured},get children(){return x(E,{get title(){return d(`agentTools.githubUseSystemNewRuns`)},get description(){return d(`agentTools.githubAgentMutationHint`)},get control(){var n=L();return n._$$click=()=>void e.identity.inherit(),v(n,()=>d(`agentTools.githubUseSystemNewRuns`)),S(()=>t().busy||t().authorizationActive,e=>{b(n,`disabled`,e)}),n}})}}),s),n}}),x(j,{get identity(){return n()}})]}})),r}var I,L,R,z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q;function $(){return($=e((()=>{le(),ae(),a(),i(),fe(),me(),o(),t(),te(),ee(),I=T(`<details class="settings-row settings-row--stacked"><summary class=settings-row__title></summary><div class=settings-subrows><!><!><!>`),L=T(`<button class=btn>`),R=T(`<button class="btn btn--sm">`),z=T(`<button type=button class=btn>`),B=T(`<div class="settings-row settings-row--actions"><div class=settings-row__control>`),V=T(`<a class=btn>`),H=T(`<code class="settings-row__value settings-row__value--mono github-device-code">`),U=T(`<button type=button class="btn btn--sm"><span data-copy-label>`),W=T(`<span class=sr-only role=status>`),G=T(`<span role=alert>`),K=T(`<input class=settings-input autocomplete=off>`),q=T(`<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=T(`<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`},ne(pe),ce([`click`,`input`])})))()}export{ge as a,A as i,F as n,k as o,j as r,$ as s,P as t};