UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.95 kB
import{f as resolveEffectiveEnableState,u as normalizePluginsConfig}from"./config-state-C1eV6UWf.mjs";import{a as loadInstalledPluginIndex}from"./installed-plugin-index-B04a42mO.mjs";import{n as createPluginInstallRecordMap,s as setPluginInstallRecordMapEntry}from"./plugin-install-record-map-BULaY3LO.mjs";import{o as resolveTrustedSourceLinkedOfficialClawHubInstall,s as resolveTrustedSourceLinkedOfficialNpmInstall}from"./official-external-install-records-CVYKmVDj.mjs";import{t as createInstalledPluginOwnershipResolver}from"./installed-plugin-package-ownership-Dw9mtnM_.mjs";import{o as resolveSourceCheckoutBundledPluginIds}from"./bundled-sources-imFFFyl2.mjs";import{r as runPluginPayloadSmokeCheck}from"./payload-verification-i9MjbP-q.mjs"; //!src/plugins/active-payload-verification.ts async function runActivePluginPayloadSmokeCheck(e){return await runPluginPayloadSmokeCheck({records:filterRecordsToActive(e),env:e.env})}function filterRecordsToActive(e){const t=e.env??process.env;const n=normalizePluginsConfig(e.cfg.plugins);const r=e.cfg.plugins?.load?.paths?.length?createInstalledPluginOwnershipResolver(loadInstalledPluginIndex({config:e.cfg,installRecords:e.records,env:t}),t):void 0;const i=resolveSourceCheckoutBundledPluginIds({config:e.cfg,installRecords:e.records,env:t});const a=createPluginInstallRecordMap();for(const[t,o]of Object.entries(e.records)){if(!o||typeof o!==`object`)continue;const s=r?.resolveUpdate(t);if(i.has(t)||s?.ok&&s.value.kind===`operator-managed`)continue;if(resolveEffectiveEnableState({id:t,origin:`global`,config:n,rootConfig:e.cfg}).enabled){setPluginInstallRecordMapEntry(a,t,o);continue}const c=resolveTrustedSourceLinkedOfficialNpmInstall({pluginId:t,record:o})?.npmSpec;const l=resolveTrustedSourceLinkedOfficialClawHubInstall({pluginId:t,record:o})?.clawhubSpec;if(c||l)setPluginInstallRecordMapEntry(a,t,o)}return a}export{runActivePluginPayloadSmokeCheck as n,filterRecordsToActive as t};