UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 978 B
import{l as normalizeOptionalString}from"./string-coerce-CpTFcSwY.mjs";import{r as defaultRuntime}from"./runtime-DIcLIHcp.mjs";import{t as readSecretFromFile}from"./secret-file-oKJz4DFN.mjs"; //!src/cli/gateway-secret-options.ts function resolveGatewaySecretOption(e,t,n){const r=normalizeOptionalString(e);const i=normalizeOptionalString(t);if(r&&i)throw new Error(`Use either --${n} or --${n}-file for Gateway ${n}.`);return i?readSecretFromFile(i,`Gateway ${n}`):r}function warnGatewaySecretCliFlag(e){defaultRuntime.error(`Warning: ${e} can be exposed via process listings. Prefer ${e}-file or environment variables.`)}function resolveGatewayAuthOptions(e){const t=resolveGatewaySecretOption(e.token,e.tokenFile,`token`);const n=resolveGatewaySecretOption(e.password,e.passwordFile,`password`);if(e.token)warnGatewaySecretCliFlag(`--token`);if(e.password)warnGatewaySecretCliFlag(`--password`);return{gatewayToken:t,gatewayPassword:n}}export{resolveGatewayAuthOptions as t};