UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

7 lines • 1.86 kB
import{c as literal,g as string,h as strictObject,o as discriminatedUnion,v as union,x as registry}from"./schemas-Bt_o0OU8.js";import{c as formatExecSecretRefIdValidationMessage,l as isValidExecSecretRefId,o as ENV_SECRET_REF_ID_RE,s as SECRET_PROVIDER_ALIAS_PATTERN,u as isValidFileSecretRefId}from"./types.secrets-CpaxAqFj.js"; //!src/config/zod-schema.secret-input.ts const SecretRefProviderSchema=string().regex(SECRET_PROVIDER_ALIAS_PATTERN,`Secret reference provider must match /^[a-z][a-z0-9_-]{0,63}$/ (example: "default").`);function createSecretRefSchema(e,t){return strictObject({source:literal(e),provider:SecretRefProviderSchema,id:t})}const SecretRefSchema=discriminatedUnion(`source`,[createSecretRefSchema(`env`,string().regex(ENV_SECRET_REF_ID_RE,`Env secret reference id must match /^[A-Z][A-Z0-9_]{0,127}$/ (example: "OPENAI_API_KEY").`)),createSecretRefSchema(`file`,string().refine(isValidFileSecretRefId,`File secret reference id must be an absolute JSON pointer (example: "/providers/openai/apiKey"), or "value" for singleValue mode.`)),createSecretRefSchema(`exec`,string().refine(isValidExecSecretRefId,formatExecSecretRefIdValidationMessage())),createSecretRefSchema(`store`,string().regex(ENV_SECRET_REF_ID_RE,`Store secret reference id must match /^[A-Z][A-Z0-9_]{0,127}$/ (example: "OPENAI_API_KEY").`))]);const SecretInputSchema=union([string(),SecretRefSchema]); //!src/config/zod-schema.sensitive.ts const sensitive=registry();const configUiMetadata=registry(); //!src/plugin-sdk/secret-input-schema.ts function buildSecretInputSchema(){return secretInputSchema}const[envRef,fileRef,execRef,storeRef]=SecretRefSchema.options;const secretInputSchema=union([string(),discriminatedUnion(`source`,[envRef,storeRef,fileRef,execRef])]).register(sensitive);export{sensitive as n,SecretInputSchema as r,buildSecretInputSchema as t};