openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 4.37 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ct as t,Et as n,G as r,I as i,N as ee,Nt as a,Q as o,a as te,et as s,i as ne,n as c,r as l,rt as u,t as re,z as d}from"./string-literal-union-XE10pie5.js";import{r as ie,t as f}from"./primitives-ob2SrhpZ.js";import{a as ae,i as oe,n as se,o as ce,r as le,t as p}from"./protocol-validator-CqgnR8zo.js";function m(e,t){return Object.assign(t,{"x-openclaw-since":e}),t}var h;function g(){return(g=e((()=>{h=`^(?!\\.{1,2}$)(?:[^\\uD800-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])+$`})))()}var ue,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,de,L,R,z,B,V,H,U,W,G,K,q,J,Y,X,fe,Z,pe,me;function Q(){return(Q=e((()=>{te(),g(),ne(),ie(),re(),ue=d({minLength:1,pattern:h,description:`Exact full approval id encoded safely in deep-link paths.`}),_=c([`exec`,`plugin`,`system-agent`]),v=c([`allow-once`,`allow-always`,`deny`]),y=c([`allow-once`,`allow-always`]),c([`user`,`timeout`,`malformed-verdict`,`no-route`,`run-aborted`,`gateway-restart`,`storage-corrupt`]),b=i([o(`user`)]),x=c([`user`,`malformed-verdict`,`no-route`,`storage-corrupt`]),S=i([o(`timeout`)]),C=c([`run-aborted`,`gateway-restart`]),w=c([`info`,`warning`,`critical`]),T=l({kind:o(`message-send`),target:d({minLength:1,maxLength:128}),recipientCount:s({minimum:1,maximum:1e6}),recipients:n(a(d({minLength:1,maxLength:128}),{maxItems:5})),audience:n(c([`internal`,`external`]))}),E=l({kind:o(`payment`),amount:d({minLength:1,maxLength:40}),currency:d({minLength:1,maxLength:12}),target:d({minLength:1,maxLength:128})}),D=l({kind:o(`external-post`),target:d({minLength:1,maxLength:128}),visibility:c([`public`,`restricted`])}),O=l({kind:o(`standing-grant`),automation:d({minLength:1,maxLength:128}),command:d({minLength:1,maxLength:256}),expiresInDays:n(s({minimum:1,maximum:3650}))}),k=i([T,E,D,O]),A=l({label:d({minLength:1,maxLength:80}),decisions:a(y,{minItems:1,maxItems:2,uniqueItems:!0})}),j=a(v,{minItems:1,maxItems:3,uniqueItems:!0,contains:o(`deny`),description:`Available reviewer decisions. Deny is always available so malformed or unsafe input can be rejected.`}),M=ee([o(`allow-once`),o(`deny`)]),N=l({jobId:f,name:f,operation:i([o(`add`),o(`update`)])}),P=t({kind:o(`exec`),commandText:f,commandPreview:n(i([d(),r()])),warningText:n(i([d(),r()])),streamProposal:n(N),host:n(i([d(),r()])),nodeId:n(i([f,r()])),agentId:n(i([f,r()])),scope:n(k),allowedDecisions:j},{additionalProperties:!1,description:`Reviewer-safe exec presentation. Runtime cwd, environment, system-run binding, and execution plan are intentionally excluded.`}),F=l({kind:o(`plugin`),title:d({minLength:1,maxLength:80}),description:d({minLength:1,maxLength:512}),detail:n(d({minLength:1,maxLength:16384})),severity:w,pluginId:n(i([f,r()])),toolName:n(i([f,r()])),agentId:n(i([f,r()])),scope:n(k),allowedDecisions:j,externalResolution:n(A)}),I=l({kind:o(`system-agent`),title:d({minLength:1,maxLength:80}),description:d({minLength:1,maxLength:512}),proposalHash:d({pattern:`^[a-f0-9]{64}$`}),agentId:n(i([f,r()])),allowedDecisions:M}),de=i([P,F,I]),L={id:ue,urlPath:f,createdAtMs:s({minimum:0}),expiresAtMs:s({minimum:0}),presentation:de},R=l({agentId:n(f),sessionKey:n(f)}),z=l({kind:c([`device`,`channel`,`runtime`,`system`]),id:n(f)}),B={resolvedAtMs:s({minimum:0}),source:n(R),resolver:n(z)},V=l({...L,status:o(`pending`),sourceSessionKey:n(f)}),H=l({...L,...B,status:o(`allowed`),decision:y,reason:b}),U=l({...L,...B,status:o(`denied`),decision:o(`deny`),reason:x}),W=l({...L,...B,status:o(`expired`),reason:S}),G=l({...L,...B,status:o(`cancelled`),reason:C}),K=i([V,H,U,W,G]),q=i([H,U,W,G]),l({id:L.id}),J=l({approval:K}),l({cursor:n(d({minLength:1,maxLength:512})),limit:n(s({minimum:1,maximum:100})),kind:n(_)}),Y=l({items:a(q),nextCursor:n(d({minLength:1,maxLength:512}))}),X=l({channel:f,accountId:f,senderId:f}),l({id:L.id,kind:_,decision:v,reviewer:n(X),grantExpiresInDays:n(s({minimum:1,maximum:3650}))}),fe=l({applied:u(),approval:q}),Z={sessionKey:f,sourceSessionKey:n(f),updatedAtMs:s({minimum:0})},pe=m(`2026.7`,l({...Z,phase:o(`pending`),approval:V})),me=m(`2026.7`,l({...Z,phase:o(`terminal`),approval:q})),m(`2026.7`,i([pe,me])),m(`2026.7`,l({sessionKey:f,updatedAtMs:s({minimum:0}),approvals:a(V),truncated:u()}))})))()}var he,ge,_e;function $(){return($=e((()=>{le(),se(),Q(),he=p(J,oe),ge=p(Y,ae),_e=p(fe,ce)})))()}export{_e as i,he as n,ge as r,$ as t};