openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 861 B
JavaScript
import{a as e}from"./openclaw-state-read-record-coerce-D1s3ReAs.mjs";import{p as t,s as n}from"./openclaw-state-read-schemas-CLrAtqTl.mjs";((e,t=256)=>n(e=>typeof e==`string`&&e.length>0&&e.length<=t&&e.trim()===e&&!e.includes(`\0`),{error:`INVALID_REQUEST: ${e} must be a bounded non-empty identifier`}))(`gatewayNamespace`).refine(e=>/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/u.test(e),{error:`INVALID_REQUEST: gatewayNamespace must be a safe bounded path component`});function hasExactOwnKeys(e,t,n=[]){return t.every(t=>Object.hasOwn(e,t))&&n.every(t=>Object.hasOwn(e,t)||!Reflect.has(e,t))&&Object.keys(e).every(e=>t.includes(e)||n.includes(e))}function workerProtocolObject(r){let i=[],a=[];for(let[e,t]of Object.entries(r))(t.isOptional()?a:i).push(e);return n(t=>e(t)&&hasExactOwnKeys(t,i,a)).pipe(t(r))}export{workerProtocolObject as n,hasExactOwnKeys as t};