UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.54 kB
import{p as resolveEffectivePluginActivationState,u as normalizePluginsConfig}from"./config-state-C1eV6UWf.mjs";import{n as isOpenClawIdEnabled}from"./openclaw-id-policy-CE_0QXmB.mjs"; //!src/gateway/openclaw-id/access-plugin.ts const ACCESS_PLUGIN_ID=`openclaw-id-access`;function openClawIdAccessBlockReason(e){if(!isOpenClawIdEnabled(e.gateway?.openclawId))return;const t=resolveEffectivePluginActivationState({id:ACCESS_PLUGIN_ID,origin:`bundled`,config:normalizePluginsConfig(e.plugins),rootConfig:e,enabledByDefault:true});return t.enabled?void 0:t.reason}function openClawIdAccessWarning(e){const t=openClawIdAccessBlockReason(e);if(!t)return;return`OpenClaw ID is on, but the Access page stays off: ${t===`not in allowlist`?`plugins.allow does not include openclaw-id-access. Run openclaw doctor to add it with your consent.`:t===`blocked by denylist`?`plugins.deny includes openclaw-id-access. Remove that deny entry yourself if you want the page.`:t===`disabled in config`?`plugins.entries["openclaw-id-access"].enabled is false. Change that setting yourself if you want the page.`:t===`plugins disabled`?`plugins.enabled is false. Enable plugins yourself if you want the page.`:`${t}. Review your plugin policy if you want the page.`}`}function withOpenClawIdAccessAllowed(e){if(openClawIdAccessBlockReason(e)!==`not in allowlist`)return e;return{...e,plugins:{...e.plugins,allow:[...e.plugins?.allow??[],ACCESS_PLUGIN_ID]}}}export{openClawIdAccessWarning as n,withOpenClawIdAccessAllowed as r,openClawIdAccessBlockReason as t};