openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.62 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ju as t}from"./_4____________________________.js";import{Lj as n,jj as r}from"./_2_____________________________.js";import{g as i,h as a}from"./config-form-utils-runtime-CqcGJa6w.js";function o(e){return typeof e.source==`string`&&typeof e.id==`string`}function s(){return(s=e((()=>{})))()}function c(e){let n=[e];for(;n.length>0;){let e=n.pop();if(Array.isArray(e))n.push(...e);else if(t(e)){if(Object.hasOwn(e,m))return!0;n.push(...Object.values(e))}}return!1}function l(e,n){let r=e;for(let e of n)if(Array.isArray(r)){if(typeof e!=`number`||!Object.hasOwn(r,e))return null;r=r[e]}else if(t(r)){let t=String(e);if(Object.hasOwn(r,m)||o(r)||!Object.hasOwn(r,t))return null;r=r[t]}else return null;return{value:r}}function u(e){return e.reduce((e,t)=>typeof t==`number`?`${e}[${t}]`:/^[A-Za-z_$][A-Za-z0-9_$:-]*$/.test(t)?e?`${e}.${t}`:t:`${e}[${JSON.stringify(t)}]`,``)}function d(e,t){let n=u(t);return(e.warnings??[]).some(({path:e})=>{if(typeof e!=`string`||e===``)return!1;let t=(e,t)=>t===e||t.startsWith(`${e}.`)||t.startsWith(`${e}[`);return t(e,n)||t(n,e)})}function f(e,t){if(!e||e.valid===!1)return p;let r=l(e.parsed,t);if(!r)return p;if(typeof r.value==`string`&&i(r.value)){let e=r.value.trim().slice(2,-1);return e?{kind:`environment`,name:e}:p}return r.value!==`__OPENCLAW_REDACTED__`||typeof e.raw!=`string`||c(e.parsed)||(e.includedPaths?.length??0)>0||d(e,t)?p:l(n(e),t)?.value===`__OPENCLAW_REDACTED__`?{kind:`literal`}:p}var p,m;function h(){return(h=e((()=>{a(),r(),p={kind:`reference`},m=`$include`})))()}export{o as i,f as n,s as r,h as t};