UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 12 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{AN as t,EN as n,GN as r,JN as i,XM as a,_x as o,dT as s,fN as c,fT as l,mx as u,pN as d,qN as f}from"./_2_____________________________.js";import{a as p,o as m}from"./plugin-contracts-runtime-DdmZDqWI.js";import{B as h,C as g,F as _,O as v,Rt as y,S as ee,U as b,b as te,d as x,f as S,g as C,gt as w,j as T,l as E,o as D,p as O,s as k,u as A,w as ne,x as j}from"./_6____________________.js";import{A as M}from"./route-controls-runtime-LXiVRSj4.js";import{n as N,t as P}from"./en-plugin-management-D2xHjJYC.js";import{n as F,r as I,t as re}from"./presentation-DumN14oJ.js";import{g as ie,m as L,s as ae,w as oe,y as se}from"./settings-controls-runtime-CwXZmgDo.js";import{n as ce,t as le}from"./en-plugin-consent-Dd9Te7_9.js";function R(e){return S(()=>S(()=>!!e.reason)()?(()=>{var t=z();return t._$owner=y(),x(t,()=>e.children),E(()=>({e:e.reason,t:e.descriptionTarget}),({e,t:n},r)=>{e!==r?.e&&(t.content=e),n!==r?.t&&(t.descriptionTarget=n)}),t})():e.children)}var z;function B(){return(B=e((()=>{A(),a(),z=j(`<openclaw-tooltip open-on-click>`,1)})))()}function V(e){let t=()=>e.slug,n=!1;w(()=>{let r=e.registerIcon?.(t);return()=>{n=!0,r?.()}});let[r,i]=h(t=>{let n=e.iconUrl;return t&&t.source===n?t:{source:n,status:`loading`}}),[a,o]=h(t=>{let n=e.authorIconUrl;return t&&t.source===n?t:{source:n,status:`loading`}}),s=()=>r().source&&r().status!==`failed`?{state:r(),update:i,package:!0}:{state:a(),update:o,package:!1},l=()=>F(t()),u=_(()=>I(e.name)),d=()=>s().state.status===`failed`?void 0:s().state.source,f=()=>d()?s().state.status===`loading`:!!e.loading,p=()=>e.class??`plugins-tile`,m=(t,r)=>{let i=s();n||i.state.source!==t||(i.update({...i.state,status:r}),r===`failed`&&i.package&&e.onIconError?.())};return S(()=>S(()=>!!(d()||f()))()?(()=>{var n=q();return x(n,T(v,{get when(){return d()},keyed:!0,children:e=>(()=>{var t=ve();return t.addEventListener(`error`,()=>m(e,`failed`)),t.addEventListener(`load`,()=>m(e,`ready`)),C(t,`src`,e),E(()=>f(),e=>{C(t,`hidden`,e)}),t})()})),E(()=>({e:O([p(),{"plugins-tile--white":e.whiteBackground,skeleton:f()}]),t:t()}),({e,t},r)=>{D(n,e,r?.e),t!==r?.t&&C(n,`data-plugin-icon-id`,t)}),n})():(()=>{var e=q();return x(e,(()=>{var e=S(()=>!!u());return()=>e()?(()=>{var e=J();return x(e,u),e})():T(c,{name:`plug`})})()),E(()=>({e:O([p(),`${p()}--fallback`]),t:t(),a:O(p()===`plugins-tile`?{background:`linear-gradient(135deg, ${l()[0]}, ${l()[1]})`}:void 0)}),({e:t,t:n,a:r},i)=>{D(e,t,i?.e),n!==i?.t&&C(e,`data-plugin-icon-id`,n),te(e,r,i?.a)}),e})())}function H(e,t,n=!1){return T(L,{title:e,get control(){var e=ye();return e.firstChild,e.classList.toggle(`plugins-consent__row--warning`,!!n),x(e,t,null),e},stackedOnNarrow:!0,carapace:!0})}function U(e){var t=be();return x(t,()=>e.join(`, `)),t}function W(e,t=!1){return p.flatMap(n=>{let r=e[n];return r?.length&&(t||n!==`dangerousConfigFlags`)?[H(i(je[n]),U(r),t)]:[]})}function ue(e){let t=W(e);return T(ie,{get title(){return i(`pluginConsent.declaredTitle`)},get description(){return i(`pluginConsent.declaredDescription`)},carapace:!0,get children(){return[S(()=>S(()=>!!t.length)()?t:T(L,{get title(){return i(`pluginConsent.declaredEmpty`)},carapace:!0})),S(()=>S(()=>e.hooks.length===0)()?H(i(`pluginConsent.hooks`),i(`pluginConsent.runtimeHooks`)):void 0),S(()=>S(()=>e.dangerousConfigFlags.length>0)()?H(i(`pluginConsent.dangerousFlags`),U(e.dangerousConfigFlags),!0):void 0)]}})}function de(e){if(!e.widened)return;let t=W(e.widened,!0);if(t.length!==0){var n=xe(),r=n.firstChild,a=r.nextSibling,o=a.firstChild,s=o.nextSibling,c=a.nextSibling;return x(r,()=>i(`pluginConsent.widenedTitle`)),x(a,()=>i(`pluginConsent.widenedDescription`),o),x(a,(()=>{var t=S(()=>!!e.acceptedAt);return()=>t()?i(`pluginConsent.previouslyAccepted`,{date:e.acceptedAt}):void 0})(),s),x(c,t),n}}function G(e,t,n){return`${i(e.effective?t:n)} ${i(e.configured===void 0?`pluginConsent.grantDefault`:`pluginConsent.grantConfigured`)}`}function K(e,t){return t===void 0?void 0:i(e,{value:i(t?`pluginConsent.allowed`:`pluginConsent.blocked`)})}function fe(e){return[K(`pluginConsent.modelOverride`,e.allowModelOverride),e.allowedModels?.length?i(`pluginConsent.allowedModels`,{models:e.allowedModels.join(`, `)}):void 0,`allowedCompletionModels`in e&&e.allowedCompletionModels?.length?i(`pluginConsent.allowedCompletionModels`,{models:e.allowedCompletionModels.join(`, `)}):void 0,`allowAuthProfileOverride`in e?K(`pluginConsent.authProfileOverride`,e.allowAuthProfileOverride):void 0,`allowAgentIdOverride`in e?K(`pluginConsent.agentIdOverride`,e.allowAgentIdOverride):void 0].filter(Boolean).join(` · `)||i(`pluginConsent.noOverrides`)}function pe(e,t){let n=e.hooks.allowConversationAccess;return T(ie,{get title(){return i(`pluginConsent.grantsTitle`)},get description(){return i(`pluginConsent.grantsDescription`)},carapace:!0,get children(){return[T(L,{get title(){return i(`pluginConsent.promptInjection`)},get description(){return i(`pluginConsent.promptInjectionDescription`)},get control(){var t=J();return x(t,()=>G(e.hooks.allowPromptInjection,`pluginConsent.allowed`,`pluginConsent.blocked`)),t},stackedOnNarrow:!0,carapace:!0}),S(()=>H(i(`pluginConsent.conversationAccess`),[S(()=>G(n,`pluginConsent.on`,`pluginConsent.off`)),S(()=>S(()=>!(n.effective||n.configured!==void 0||t===`bundled`))()?(()=>{var e=Se();return x(e,()=>i(`pluginConsent.externalAccessHint`)),e})():void 0)])),T(g,{each:[`llm`,`subagent`],children:t=>{let n=e[t];return n?H(i(t===`llm`?`pluginConsent.modelOverrides`:`pluginConsent.subagentModelOverrides`),fe(n)):void 0}})]}})}function me(e,t){if(t)return i(`pluginsPage.official`);let n=e&&Object.hasOwn(Q,e)?Q[e]:void 0;return n?i(n):e??(t===!1?i(`pluginConsent.community`):null)}function he(e){let t=e?.spec&&e.spec!==e.packageName?e.spec:void 0;if(!e||!t&&!e.integrity)return;let n=e.integrityKind===`sha256`?i(`pluginConsent.sha256`):e.integrityKind===`git-commit`?i(`pluginConsent.commit`):i(`pluginConsent.integrity`);return[(()=>{var r=Ce(),i=r.firstChild,a=i.nextSibling;return x(r,t?(()=>{var e=J();return x(e,t),e})():void 0,i),x(r,(()=>{var t=S(()=>!!e.integrity);return()=>t()?(()=>{var t=we(),r=t.firstChild,i=r.nextSibling,a=i.firstChild;return x(t,n,r),x(i,()=>e.integrity.slice(0,20),a),E(()=>e.integrity,e=>{C(t,`title`,e)}),t})():void 0})(),a),r})(),S(()=>S(()=>!!e.integrity)()?(()=>{var e=Y();return x(e,()=>i(`pluginConsent.pinnedArtifact`)),e})():void 0)]}function ge(e){if(!e)return;let t=i(e.disposition===`clean`?`pluginConsent.verifiedClean`:e.disposition===`review-recommended`?`pluginConsent.reviewRecommended`:e.disposition===`review-required`?`pluginConsent.reviewRequired`:`pluginConsent.trustBlocked`),n=e.disposition===`clean`?`ok`:e.disposition===`blocked`?`danger`:`warn`;var r=Te(),a=r.firstChild,o=a.nextSibling,s=o.nextSibling;return x(r,T(se,{kind:n,label:t,carapace:!0}),a),x(r,(()=>{var t=S(()=>!!e.reasons?.length);return()=>t()?(()=>{var t=Ee();return x(t,T(g,{get each(){return e.reasons},children:e=>(()=>{var t=X();return x(t,e),t})()})),t})():void 0})(),o),x(r,(()=>{var t=S(()=>!!e.checkedAt);return()=>t()?(()=>{var t=Y();return x(t,()=>i(`pluginConsent.scanDate`,{date:e.checkedAt})),t})():void 0})(),s),r}function _e(e){let t=()=>e.consent,r=()=>e.inspection,a=_(()=>e.inspectionRead),o=()=>t().details,c=()=>r()?.plugin,l=()=>t().fallback,d=()=>t().pluginId,f=()=>c()?.name??l().name,p=()=>c()?.version??l().version,m=()=>me(c()?.origin,l().official),h=()=>{let e=r()?.source,t=[m(),e?i(Me[e.kind]):void 0,e?.packageName];return[...new Set(t.filter(Boolean))].join(` · `)},g=()=>e.busy?i(`pluginsPage.working`):i(`pluginConsent.enableNamed`,{name:f()}),v=()=>!e.canMutate||e.busy||e.loading||!!e.error||!r();var b=De();b._$$click=()=>{v()||e.onConfirm()},x(b,g),E(()=>({e:v()&&!e.mutationBlockedReason,t:e.canMutate?void 0:`true`}),({e,t},n)=>{e!==n?.e&&C(b,`disabled`,e),t!==n?.t&&C(b,`aria-disabled`,t)});let te=b;function w(){let e=_(()=>a()?.result.then(e=>{if(e)throw Error(e);return null}));return[S(e),S(()=>S(()=>!!r())()?[S(()=>he(r().source)),` `,S(()=>ge(r().trust)),S(()=>S(()=>!!o())()?de(o()):void 0),S(()=>ue(r().declared)),S(()=>pe(r().grants,c()?.origin))]:(()=>{var e=Z();return x(e,()=>i(`pluginConsent.fallback`)),e})())]}var D=Oe(),O=D.firstChild,k=O.firstChild,A=k.firstChild,j=A.firstChild,M=j.firstChild,N=A.nextSibling,P=k.nextSibling,F=P.nextSibling,I=F.firstChild;return D.addEventListener(`modal-cancel`,()=>e.onCancel()),D._$owner=y(),x(k,T(V,{get registerIcon(){return e.registerIcon},get slug(){return d()},get name(){return f()},get iconUrl(){return e.iconUrl},get loading(){return e.iconLoading}}),A),x(M,f),x(j,(()=>{var e=S(()=>!!p());return()=>e()?(()=>{var e=ke();return x(e,()=>`v${p()}`),e})():void 0})(),null),x(A,(()=>{var e=S(()=>!!h());return()=>e()?(()=>{var e=Z();return x(e,h),e})():void 0})(),null),x(k,T(u,{size:28,class:`oc-dialog__close`,icon:`x`,get label(){return i(`common.close`)},tooltip:!1,onClick:()=>e.onCancel()}),N),x(P,T(ne,{get on(){return a()},get fallback(){var e=Ae();return x(e,()=>i(`pluginConsent.loading`)),e},get children(){return T(ee,{fallback:(t,r)=>T(s,{tone:`danger`,class:`plugins-consent__error`,role:`alert`,get children(){return[(()=>{var e=J();return x(e,()=>n(t())),e})(),T(ae,{type:`button`,class:`btn btn--sm oc-action oc-action-secondary`,get label(){return i(`pluginsPage.tryAgain`)},onRetry:()=>{e.onRetry(),r()}})]}}),get children(){return T(w,{})}})}})),F._$owner=y(),I._$$click=()=>e.onCancel(),x(I,()=>i(`pluginsPage.cancel`)),x(F,T(R,{get reason(){return e.mutationBlockedReason},children:te}),null),E(()=>({e:f(),t:t().intent.kind}),({e,t},n)=>{e!==n?.e&&C(D,`label`,e),t!==n?.t&&C(O,`data-plugin-consent`,t)}),D}var q,ve,J,ye,be,xe,Se,Ce,we,Y,Te,Ee,X,De,Z,Oe,ke,Ae,je,Me,Q;function $(){return($=e((()=>{A(),b(),m(),o(),d(),M(),l(),oe(),le(),P(),t(),r(),re(),B(),q=j(`<span aria-hidden=true>`),ve=j(`<img class=plugins-icon alt loading=eager decoding=async>`,1),J=j(`<span>`),ye=j(`<span> `),be=j(`<span class=plugins-consent__items>`),xe=j(`<section class="plugins-consent__section oc-section"><h3></h3><p class=plugins-consent__description> <!></p><div class=plugins-consent__rows>`),Se=j(`<span class=plugins-consent__hint>`),Ce=j(`<div class=plugins-consent__provenance><!><!>`),we=j(`<span>: <code>…`),Y=j(`<p class=plugins-consent__hint>`),Te=j(`<section class=plugins-consent__trust><!><!><!>`),Ee=j(`<ul>`),X=j(`<li>`),De=j(`<button type=button class="btn primary">`),Z=j(`<p class=plugins-consent__description>`),Oe=j(`<openclaw-modal-dialog style="--openclaw-modal-width:min(560px, calc(100vw - 32px))"><section class="oc-dialog plugins-consent"><header class="oc-dialog__header plugins-consent__header"><div class=plugins-consent__identity><div class=plugins-detail__title><h2></h2></div></div><!></header><div class=oc-dialog__body></div><openclaw-modal-actions class="oc-dialog__footer plugins-consent__actions"><button type=button class="btn oc-action oc-action-secondary">`,1),ke=j(`<span class=plugins-version>`),Ae=j(`<p class=plugins-consent__hint role=status>`),f(N),f(ce),je={channels:`pluginsPage.categoryChannels`,providers:`pluginsPage.categoryProviders`,tools:`pluginsPage.categoryTools`,contracts:`pluginConsent.contracts`,hooks:`pluginConsent.hooks`,mcpServers:`pluginConsent.mcpServers`,cliCommands:`pluginConsent.cliCommands`,cliBackends:`pluginConsent.cliBackends`,skills:`pluginConsent.skills`,dangerousConfigFlags:`pluginConsent.dangerousFlags`},Me={bundled:`pluginsPage.included`,"official-catalog":`pluginsPage.official`,clawhub:`pluginConsent.sourceClawHub`,npm:`pluginConsent.sourceNpm`,git:`pluginConsent.sourceGit`,path:`pluginConsent.sourcePath`,archive:`pluginConsent.sourceArchive`,marketplace:`pluginConsent.sourceMarketplace`},Q={bundled:`pluginsPage.included`,global:`pluginsPage.global`,workspace:`pluginsPage.workspace`,config:`pluginsPage.config`,official:`pluginsPage.official`},k([`click`])})))()}export{B as a,R as i,$ as n,_e as r,V as t};