openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 972 B
JavaScript
import{i as normalizeArrayBackedTrimmedStringList}from"./string-normalization-D_oBUpO3.mjs";
//!src/infra/node-pairing-surface.ts
function intersectNodePermissionSurface(e){const t=[];for(const[n,r]of Object.entries(e.declared??{})){const i=e.approved?.[n];if(!r)t.push([n,false]);else if(i!==void 0)t.push([n,i])}return t.length>0?Object.fromEntries(t):void 0}function normalizeNodeApprovalSurfaceList(e){return normalizeArrayBackedTrimmedStringList(e)??[]}function sameNodeApprovalSurfaceSet(e,t){const n=new Set(normalizeNodeApprovalSurfaceList(e));const r=new Set(normalizeNodeApprovalSurfaceList(t));return n.size===r.size&&[...n].every(e=>r.has(e))}function sameNodePermissionSurface(e,t){const n=Object.entries(e??{});const r=t??{};return n.length===Object.keys(r).length&&n.every(([e,t])=>Object.hasOwn(r,e)&&r[e]===t)}export{sameNodePermissionSurface as i,normalizeNodeApprovalSurfaceList as n,sameNodeApprovalSurfaceSet as r,intersectNodePermissionSurface as t};