UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1 kB
import{n as e}from"./rolldown-runtime-8BhlS34s.js";import{_a as t}from"./ui-DuRgK6kL.js";function n(e){return l.test(e)}function r(e){return!t(e)||Object.keys(e).length!==3?!1:(e.source===`env`||e.source===`file`||e.source===`exec`||e.source===`store`)&&typeof e.provider==`string`&&e.provider.trim().length>0&&typeof e.id==`string`&&e.id.trim().length>0}function i(e){return e===`value`?!0:e.startsWith(`/`)?e.slice(1).split(`/`).every(e=>u.test(e)):!1}function a(e){return d.test(e)}function o(e){if(!f.test(e))return{ok:!1,reason:`pattern`};for(let t of e.split(`/`))if(t===`.`||t===`..`)return{ok:!1,reason:`traversal-segment`};return{ok:!0}}function s(e){return o(e).ok}function c(e){return!r(e)||!a(e.provider)?!1:e.source===`env`?n(e.id):e.source===`file`?i(e.id):e.source===`store`?n(e.id):s(e.id)}var l,u,d,f;function p(){return(p=e((()=>{l=/^[A-Z][A-Z0-9_]{0,127}$/,u=/^(?:[^~]|~0|~1)*$/,d=/^[a-z][a-z0-9_-]{0,63}$/,f=/^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,255}$/})))()}export{c as i,p as n,r,l as t};