UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 14.1 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Oa as t,Qt as n,Xt as r,ka as i}from"./control-ui-connection-Bfj9beF_.js";import{BA as a,dj as o,mj as s,pj as c,zA as l}from"./control-ui-boot-shared-DFTSUQQ0.js";import{B as u,C as d,F as f,O as p,Rt as m,S as h,U as g,d as _,f as v,g as y,gt as b,j as x,l as S,o as C,p as w,s as T,u as E,v as D,w as ee,x as O}from"./solid-runtime-C416s-HC.js";import{E as k}from"./route-controls-runtime-Bx6nx3QW.js";import{n as A,t as j}from"./en-plugin-management-BoZM4tY6.js";import{n as M,r as te,t as N}from"./presentation-DkGSLv08.js";import{a as P,o as ne}from"./plugin-contracts-runtime-jJB1O6bJ.js";import{d as F,h as re,p as ie,r as ae,y as oe}from"./settings-ui-Ck6BJLhD.js";import{n as se,t as ce}from"./reasoned-disabled-control-Cp7hrsX_.js";var I,L;function R(){return(R=e((()=>{i(),I={pluginConsent:{widenedTitle:`What changed`,widenedDescription:`New since your last acceptance.`,previouslyAccepted:`Previously accepted {date}.`,declaredTitle:`Declared capabilities`,declaredDescription:`From the plugin manifest. OpenClaw validates the plugin against these declarations when it loads.`,declaredEmpty:`No channels, providers, or tools declared in the manifest.`,contracts:`Contracts`,hooks:`Hooks`,runtimeHooks:`Code plugins may register hooks at runtime; their hook names are not declared in the manifest.`,mcpServers:`MCP servers`,cliCommands:`CLI commands`,cliBackends:`CLI backends`,skills:`Skills`,dangerousFlags:`Dangerous config flags`,grantsTitle:`Your grants`,grantsDescription:`Set per plugin in plugins.entries.{id}. Hooks outside these grants are blocked at load.`,promptInjection:`Prompt injection`,conversationAccess:`Conversation access`,allowed:`Allowed`,blocked:`Blocked`,on:`On`,off:`Off`,grantDefault:`(default)`,grantConfigured:`(set in config)`,externalAccessHint:`Off by default for external plugins.`,modelOverrides:`Model overrides`,subagentModelOverrides:`Subagent model overrides`,modelOverride:`Model override: {value}`,allowedModels:`Allowed models: {models}`,allowedCompletionModels:`Completion models: {models}`,authProfileOverride:`Auth profile override: {value}`,agentIdOverride:`Agent ID override: {value}`,noOverrides:`No overrides configured`,loading:`Loading capability details…`,fallback:`Capability details must be available before you can approve this plugin.`,verifiedClean:`Verified clean`,reviewRecommended:`Review recommended`,reviewRequired:`Review required`,trustBlocked:`Blocked`,scanDate:`Scanned {date}`,integrity:`Integrity`,sha256:`SHA-256`,commit:`Commit`,pinnedArtifact:`Pinned to the exact installed artifact.`,sourceClawHub:`ClawHub`,sourceNpm:`npm`,sourceGit:`Git`,sourcePath:`Local path`,sourceArchive:`Archive`,sourceMarketplace:`Marketplace`,community:`Community`,enableNamed:`Enable {name}`,installPolicy:{technicalDetails:`Technical details`,severity:{info:`Info`,warn:`Warning`,critical:`Critical`},policyScope:`Continuing approves every install-policy warning encountered during this install. Each warning is checked again before installation continues.`}}},L=Object.assign(()=>{t.pluginConsent=I.pluginConsent},{catalog:I})})))()}function z(e){let t=()=>e.variant===`install`?`installTrust`:e.variant===`bundle`?`bundleTrust`:`nativeUi`;var n=B(),r=n.firstChild,i=r.nextSibling;return _(r,()=>s(`pluginsPage.${t()}.title`)),_(i,()=>s(`pluginsPage.${t()}.description`)),S(()=>s(`pluginsPage.${t()}.title`),e=>{y(n,`aria-label`,e)}),n}var B;function V(){return(V=e((()=>{E(),j(),o(),B=O(`<aside class="plugin-native-ui-disclosure callout"><strong></strong><div class=card-sub>`),c(A)})))()}function H(e){let t=()=>e.slug,n=!1;b(()=>{let r=e.registerIcon?.(t);return()=>{n=!0,r?.()}});let[r,i]=u(t=>{let n=e.iconUrl;return t&&t.source===n?t:{source:n,status:`loading`}}),[a,o]=u(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},c=()=>M(t()),d=f(()=>te(e.name)),m=()=>s().state.status===`failed`?void 0:s().state.source,h=()=>m()?s().state.status===`loading`:!!e.loading,g=()=>e.class??`plugins-tile`,T=(t,r)=>{let i=s();n||i.state.source!==t||(i.update({...i.state,status:r}),r===`failed`&&i.package&&e.onIconError?.())};return v(()=>v(()=>!!(m()||h()))()?(()=>{var n=J();return _(n,x(p,{get when(){return m()},keyed:!0,children:e=>(()=>{var t=_e();return t.addEventListener(`error`,()=>T(e,`failed`)),t.addEventListener(`load`,()=>T(e,`ready`)),y(t,`src`,e),S(()=>h(),e=>{y(t,`hidden`,e)}),t})()})),S(()=>({e:w([g(),{"plugins-tile--white":e.whiteBackground,skeleton:h()}]),t:t()}),({e,t},r)=>{C(n,e,r?.e),t!==r?.t&&y(n,`data-plugin-icon-id`,t)}),n})():(()=>{var e=J();return _(e,(()=>{var e=v(()=>!!d());return()=>e()?(()=>{var e=ve();return _(e,d),e})():x(l,{name:`plug`})})()),S(()=>({e:w([g(),`${g()}--fallback`]),t:t(),a:c()[0],o:c()[1]}),({e:t,t:n,a:r,o:i},a)=>{C(e,t,a?.e),n!==a?.t&&y(e,`data-plugin-icon-id`,n),r!==a?.a&&D(e,`--plugins-art-a`,r),i!==a?.o&&D(e,`--plugins-art-b`,i)}),e})())}function U(e,t,n=!1){return x(F,{title:e,get control(){var e=ye();return e.firstChild,e.classList.toggle(`plugins-consent__row--warning`,!!n),_(e,t,null),e},stackedOnNarrow:!0,carapace:!0})}function W(e){var t=be();return _(t,()=>e.join(`, `)),t}function G(e,t=!1){return P.flatMap(n=>{let r=e[n];return r?.length&&(t||n!==`dangerousConfigFlags`)?[U(s(Me[n]),W(r),t)]:[]})}function le(e){let t=G(e);return x(ie,{get title(){return s(`pluginConsent.declaredTitle`)},get description(){return s(`pluginConsent.declaredDescription`)},carapace:!0,get children(){return[v(()=>v(()=>!!t.length)()?t:x(F,{get title(){return s(`pluginConsent.declaredEmpty`)},carapace:!0})),v(()=>v(()=>e.hooks.length===0)()?U(s(`pluginConsent.hooks`),s(`pluginConsent.runtimeHooks`)):void 0),v(()=>v(()=>e.dangerousConfigFlags.length>0)()?U(s(`pluginConsent.dangerousFlags`),W(e.dangerousConfigFlags),!0):void 0)]}})}function ue(e){if(!e.widened)return;let t=G(e.widened,!0);if(t.length!==0){var n=xe(),r=n.firstChild,i=r.nextSibling,a=i.firstChild,o=a.nextSibling,c=i.nextSibling;return _(r,()=>s(`pluginConsent.widenedTitle`)),_(i,()=>s(`pluginConsent.widenedDescription`),a),_(i,(()=>{var t=v(()=>!!e.acceptedAt);return()=>t()?s(`pluginConsent.previouslyAccepted`,{date:e.acceptedAt}):void 0})(),o),_(c,t),n}}function K(e,t,n){return`${s(e.effective?t:n)} ${s(e.configured===void 0?`pluginConsent.grantDefault`:`pluginConsent.grantConfigured`)}`}function q(e,t){return t===void 0?void 0:s(e,{value:s(t?`pluginConsent.allowed`:`pluginConsent.blocked`)})}function de(e){return[q(`pluginConsent.modelOverride`,e.allowModelOverride),e.allowedModels?.length?s(`pluginConsent.allowedModels`,{models:e.allowedModels.join(`, `)}):void 0,`allowedCompletionModels`in e&&e.allowedCompletionModels?.length?s(`pluginConsent.allowedCompletionModels`,{models:e.allowedCompletionModels.join(`, `)}):void 0,`allowAuthProfileOverride`in e?q(`pluginConsent.authProfileOverride`,e.allowAuthProfileOverride):void 0,`allowAgentIdOverride`in e?q(`pluginConsent.agentIdOverride`,e.allowAgentIdOverride):void 0].filter(Boolean).join(` · `)||s(`pluginConsent.noOverrides`)}function fe(e,t){let n=e.hooks.allowConversationAccess;return x(ie,{get title(){return s(`pluginConsent.grantsTitle`)},get description(){return s(`pluginConsent.grantsDescription`)},carapace:!0,get children(){return[v(()=>U(s(`pluginConsent.promptInjection`),K(e.hooks.allowPromptInjection,`pluginConsent.allowed`,`pluginConsent.blocked`))),v(()=>U(s(`pluginConsent.conversationAccess`),[v(()=>K(n,`pluginConsent.on`,`pluginConsent.off`)),v(()=>v(()=>!(n.effective||n.configured!==void 0||t===`bundled`))()?(()=>{var e=Se();return _(e,()=>s(`pluginConsent.externalAccessHint`)),e})():void 0)])),x(d,{each:[`llm`,`subagent`],children:t=>{let n=e[t];return n?U(s(t===`llm`?`pluginConsent.modelOverrides`:`pluginConsent.subagentModelOverrides`),de(n)):void 0}})]}})}function pe(e,t){if(t)return s(`pluginsPage.official`);let n=e&&Object.hasOwn(Q,e)?Q[e]:void 0;return n?s(n):e??(t===!1?s(`pluginConsent.community`):null)}function me(e){if(!e)return;let t=e.integrityKind===`sha256`?s(`pluginConsent.sha256`):e.integrityKind===`git-commit`?s(`pluginConsent.commit`):s(`pluginConsent.integrity`);return[(()=>{var n=Ce(),r=n.firstChild;return _(r,()=>[s(Ne[e.kind]),e.spec??e.packageName].filter(Boolean).join(` · `)),_(n,(()=>{var n=v(()=>!!e.integrity);return()=>n()?(()=>{var n=we(),r=n.firstChild,i=r.nextSibling,a=i.firstChild;return _(n,t,r),_(i,()=>e.integrity.slice(0,20),a),S(()=>e.integrity,e=>{y(n,`title`,e)}),n})():void 0})(),null),n})(),v(()=>v(()=>!!e.integrity)()?(()=>{var e=Y();return _(e,()=>s(`pluginConsent.pinnedArtifact`)),e})():void 0)]}function he(e){if(!e)return;let t=s(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(),i=r.firstChild,a=i.nextSibling,o=a.nextSibling;return _(r,x(re,{kind:n,label:t,carapace:!0}),i),_(r,(()=>{var t=v(()=>!!e.reasons?.length);return()=>t()?(()=>{var t=Ee();return _(t,x(d,{get each(){return e.reasons},children:e=>(()=>{var t=De();return _(t,e),t})()})),t})():void 0})(),a),_(r,(()=>{var t=v(()=>!!e.checkedAt);return()=>t()?(()=>{var t=Y();return _(t,()=>s(`pluginConsent.scanDate`,{date:e.checkedAt})),t})():void 0})(),o),r}function ge(e){let t=()=>e.consent,n=()=>e.inspection,i=f(()=>e.inspectionRead),a=()=>t().details,o=()=>n()?.plugin,c=()=>t().fallback,l=()=>n()?.source?.packageName,u=()=>t().pluginId,d=()=>o()?.name??c().name,p=()=>o()?.version??c().version,g=()=>pe(o()?.origin,c().official),b=()=>[g(),l()].filter(Boolean).join(` · `),C=()=>e.busy?s(`pluginsPage.working`):s(`pluginConsent.enableNamed`,{name:d()}),w=()=>!e.canMutate||e.busy||e.loading||!!e.error||!n();var T=Oe();T._$$click=()=>{w()||e.onConfirm()},_(T,C),S(()=>({e:w()&&!e.mutationBlockedReason,t:e.canMutate?void 0:`true`}),({e,t},n)=>{e!==n?.e&&y(T,`disabled`,e),t!==n?.t&&y(T,`aria-disabled`,t)});let E=T;function D(){let e=f(()=>i()?.result.then(e=>{if(e)throw Error(e);return null}));return[v(e),v(()=>v(()=>!!n())()?[v(()=>me(n().source)),` `,v(()=>he(n().trust)),v(()=>v(()=>!!n().overview?.hasNativeUi)()?x(z,{}):void 0),v(()=>v(()=>!!a())()?ue(a()):void 0),v(()=>le(n().declared)),v(()=>fe(n().grants,o()?.origin))]:(()=>{var e=X();return _(e,()=>s(`pluginConsent.fallback`)),e})())]}var O=ke(),k=O.firstChild,A=k.firstChild,j=A.firstChild,M=j.firstChild,te=M.firstChild,N=A.nextSibling,P=N.firstChild;return O.addEventListener(`modal-cancel`,()=>e.onCancel()),O._$owner=m(),_(A,x(H,{get registerIcon(){return e.registerIcon},get slug(){return u()},get name(){return d()},get iconUrl(){return e.iconUrl},get loading(){return e.iconLoading}}),j),_(te,d),_(M,(()=>{var e=v(()=>!!p());return()=>e()?(()=>{var e=Z();return _(e,()=>`v${p()}`),e})():void 0})(),null),_(j,(()=>{var e=v(()=>!!b());return()=>e()?(()=>{var e=X();return _(e,b),e})():void 0})(),null),_(k,x(ee,{get on(){return i()},get fallback(){var e=Ae();return _(e,()=>s(`pluginConsent.loading`)),e},get children(){return x(h,{fallback:(t,n)=>(()=>{var i=je(),a=i.firstChild;return _(a,()=>r(t())),_(i,x(ae,{type:`button`,class:`btn btn--sm oc-action oc-action-secondary`,get label(){return s(`pluginsPage.tryAgain`)},onRetry:()=>{e.onRetry(),n()}}),null),i})(),get children(){return x(D,{})}})}}),N),N._$owner=m(),P._$$click=()=>e.onCancel(),_(P,()=>s(`pluginsPage.cancel`)),_(N,x(ce,{get reason(){return e.mutationBlockedReason},children:E}),null),S(()=>({e:d(),t:t().intent.kind}),({e,t},n)=>{e!==n?.e&&y(O,`label`,e),t!==n?.t&&y(k,`data-plugin-consent`,t)}),O}var J,_e,ve,ye,be,xe,Se,Ce,we,Y,Te,Ee,De,Oe,X,ke,Z,Ae,je,Me,Ne,Q;function $(){return($=e((()=>{E(),g(),ne(),a(),k(),oe(),R(),j(),n(),o(),V(),N(),se(),J=O(`<span aria-hidden=true>`),_e=O(`<img class=plugins-icon alt loading=eager decoding=async>`,1),ve=O(`<span>`),ye=O(`<span> `),be=O(`<span class=plugins-consent__items>`),xe=O(`<section class="plugins-consent__section oc-section"><h3></h3><p class=plugins-consent__description><!><!></p><div class=plugins-consent__rows>`),Se=O(`<span class=plugins-consent__hint>`),Ce=O(`<div class=plugins-consent__provenance><span>`),we=O(`<span>: <code>…`),Y=O(`<p class=plugins-consent__hint>`),Te=O(`<section class=plugins-consent__trust><!><!><!>`),Ee=O(`<ul>`),De=O(`<li>`),Oe=O(`<button type=button class="btn primary oc-action oc-action-primary">`),X=O(`<p class=plugins-consent__description>`),ke=O(`<openclaw-modal-dialog style="--openclaw-modal-width:min(560px, calc(100vw - 32px))"><section class="plugins-consent oc-card"><header class=plugins-consent__header><div><div class=plugins-detail__title><h2></h2></div></div></header><openclaw-modal-actions class=plugins-consent__actions><button type=button class="btn oc-action oc-action-secondary">`,1),Z=O(`<span class=plugins-version>`),Ae=O(`<p class=plugins-consent__hint role=status>`),je=O(`<div class=plugins-consent__error role=alert><span>`),c(A),c(L),Me={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`},Ne={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`},T([`click`])})))()}export{V as a,z as i,$ as n,R as o,ge as r,L as s,H as t};