openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 890 B
JavaScript
import{b as uniqueStrings}from"./string-normalization-D_oBUpO3.mjs";import{p as resolvePluginMetadataSnapshot}from"./plugin-metadata-snapshot-CDKhemiT.mjs";import{t as appendUniqueEnvVarCandidates}from"./env-var-candidates-PA74Jghk.mjs";
//!src/secrets/channel-env-vars.ts
function resolveChannelEnvVars(e){const t=resolvePluginMetadataSnapshot({config:e?.config,env:e?.env??process.env});const n={};for(const e of t.plugins){const t=e.packageChannel?.id?.trim();const r=e.packageChannel?.configuredState?.env;if(!t||!r)continue;appendUniqueEnvVarCandidates(n,t,[...r.allOf??[],...r.anyOf??[]])}return n}function getChannelEnvVars(e,t){const n=resolveChannelEnvVars(t);return[...(Object.hasOwn(n,e)?n[e]:void 0)??[]]}function listKnownChannelEnvVarNames(e){return uniqueStrings(Object.values(resolveChannelEnvVars(e)).flat())}export{listKnownChannelEnvVarNames as n,getChannelEnvVars as t};