import{createRequireasqw0}from"node:module";varsL0=Object.create;var{getPrototypeOf:eL0,defineProperty:PO,getOwnPropertyNames:$w0}=Object;varIw0=Object.prototype.hasOwnProperty;functionUw0($){returnthis[$]}varYw0,Jw0,WI=($,I,U)=>{varY=$!=null&&typeof$==="object";if(Y){varJ=I?Yw0??=newWeakMap:Jw0??=newWeakMap,Q=J.get($);if(Q)returnQ}U=$!=null?sL0(eL0($)):{};letK=I||!$||!$.__esModule?PO(U,"default",{value:$,enumerable:!0}):U;for(letqof$w0($))if(!Iw0.call(K,q))PO(K,q,{get:Uw0.bind($,q),enumerable:!0});if(Y)J.set($,K);returnK};varN=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);varQw0=($)=>$;functionKw0($,I){this[$]=Qw0.bind(null,I)}varm8=($,I)=>{for(varUinI)PO($,U,{get:I[U],enumerable:!0,configurable:!0,set:Kw0.bind(I,U)})};varr=qw0(import.meta.url);varCQ=N((Rf)=>{Object.defineProperty(Rf,"__esModule",{value:!0});Rf.regexpCode=Rf.getEsmExportName=Rf.getProperty=Rf.safeStringify=Rf.stringify=Rf.strConcat=Rf.addCodeArg=Rf.str=Rf._=Rf.nil=Rf._Code=Rf.Name=Rf.IDENTIFIER=Rf._CodeOrName=void0;classEW{}Rf._CodeOrName=EW;Rf.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;classoIextendsEW{constructor($){super();if(!Rf.IDENTIFIER.test($))throwError("CodeGen: name must be a valid identifier");this.str=$}toString(){returnthis.str}emptyStr(){return!1}getnames(){return{[this.str]:1}}}Rf.Name=oI;classf$extendsEW{constructor($){super();this._items=typeof$==="string"?[$]:$}toString(){returnthis.str}emptyStr(){if(this._items.length>1)return!1;let$=this._items[0];return$===""||$==='""'}getstr(){var$;return($=this._str)!==null&&$!==void0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}getnames(){var$;return($=this._names)!==null&&$!==void0?$:this._names=this._items.reduce((I,U)=>{if(UinstanceofoI)I[U.str]=(I[U.str]||0)+1;returnI},{})}}Rf._Code=f$;Rf.nil=newf$("");functionEf($,...I){letU=[$[0]],Y=0;while(Y<I.length)xP(U,I[Y]),U.push($[++Y]);returnnewf$(U)}Rf._=Ef;varhP=newf$("+");functionBf($,...I){letU=[vQ($[0])],Y=0;while(Y<I.length)U.push(hP),xP(U,I[Y]),U.push(hP,vQ($[++Y]));returnvF0(U),newf$(U)}Rf.str=Bf;functionxP($,I){if(Iinstanceoff$)$.push(...I._items);elseif(IinstanceofoI)$.push(I);else$.push(_F0(I))}Rf.addCodeArg=xP;functionvF0($){letI=1;while(I<$.length-1){if($[I]===hP){letU=CF0($[I-1],$[I+1]);if(U!==void0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}functionCF0($,I){if(I==='""')return$;if($==='""')returnI;if(typeof$=="string"){if(IinstanceofoI||$[$.length-1]!=='"')return;if(typeofI!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return$.slice(0,-1)+I.slice(1);return}if(typeofI=="string"&&I[0]==='"'&&!($instanceofoI))return`"${$}${I.slice(1)}`;return}functionjF0($,I){returnI.emptyStr()?$:$.emptyStr()?I:Bf`${$}${I}`}Rf.strConcat=jF0;function_F0($){returntypeof$=="number"||typeof$=="boolean"||$===null?$:vQ(Array.isArray($)?$.join(","):$)}functionSF0($){returnnewf$(vQ($))}Rf.stringify=SF0;functionvQ($){returnJSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Rf.safeStringify=vQ;functiongF0($){returntypeof$=="string"&&Rf.IDENTIFIER.test($)?newf$(`.${$}`):Ef`[${$}]`}Rf.getProperty=gF0;functionyF0($){if(typeof$=="string"&&Rf.IDENTIFIER.test($))returnnewf$(`${$}`);throwError(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Rf.getEsmExportName=yF0;functionhF0($){returnnewf$($.toString())}Rf.regexpCode=hF0});varbP=N((_f)=>{Object.defineProperty(_f,"__esModule",{value:!0});_f.ValueScope=_f.ValueScopeName=_f.Scope=_f.varKinds=_f.UsedValueState=void0;vark6=CQ();classCfextendsError{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}varRW;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(RW||(_f.UsedValueState=RW={}));_f.varKinds={const:newk6.Name("const"),let:newk6.Name("let"),var:newk6.Name("var")};classuP{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return$instanceofk6.Name?$:this.name($)}name($){returnnewk6.Name(this._newName($))}_newName($){letI=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){varI,U;if(((U=(I=this._parent)===null||I===void0?void0:I._prefixes)===null||U===void0?void0:U.has($))||this._prefixes&&!this._prefixes.has($))throwError(`CodeGen: prefix "${$}" is not allowed in this scope`);returnthis._names[$]={prefix:$,index:0}}}_f.Scope=uP;classfPextendsk6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=k6._`.${newk6.Name(I)}[${U}]`}}_f.ValueScopeName=fP;varoF0=k6._`\n`;classjfextendsuP{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?oF0:k6.nil}}get(){returnthis._scope}name($){returnnewfP($,this._newName($))}value($,I){varU;if(I.ref===void0)throwError("CodeGen: ref must be passed in value");letY=this.toName($),{prefix:J}=Y,Q=(U=I.key)!==null&&U!==void0?U:I.ref,K=this._values[J];if(K){letH=K.get(Q);if(Line truncated
import{createRequireasww0}from"node:module";varKw0=Object.create;var{getPrototypeOf:qw0,defineProperty:ED,getOwnPropertyNames:Gw0}=Object;varHw0=Object.prototype.hasOwnProperty;functionWw0($){returnthis[$]}varVw0,Zw0,VI=($,I,U)=>{varY=$!=null&&typeof$==="object";if(Y){varJ=I?Vw0??=newWeakMap:Zw0??=newWeakMap,Q=J.get($);if(Q)returnQ}U=$!=null?Kw0(qw0($)):{};letK=I||!$||!$.__esModule?ED(U,"default",{value:$,enumerable:!0}):U;for(letqofGw0($))if(!Hw0.call(K,q))ED(K,q,{get:Ww0.bind($,q),enumerable:!0});if(Y)J.set($,K);returnK};varO=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);varzw0=($)=>$;functionXw0($,I){this[$]=zw0.bind(null,I)}varm8=($,I)=>{for(varUinI)ED($,U,{get:I[U],enumerable:!0,configurable:!0,set:Xw0.bind(I,U)})};varr=ww0(import.meta.url);varjQ=O((Sf)=>{Object.defineProperty(Sf,"__esModule",{value:!0});Sf.regexpCode=Sf.getEsmExportName=Sf.getProperty=Sf.safeStringify=Sf.stringify=Sf.strConcat=Sf.addCodeArg=Sf.str=Sf._=Sf.nil=Sf._Code=Sf.Name=Sf.IDENTIFIER=Sf._CodeOrName=void0;classRW{}Sf._CodeOrName=RW;Sf.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;classrIextendsRW{constructor($){super();if(!Sf.IDENTIFIER.test($))throwError("CodeGen: name must be a valid identifier");this.str=$}toString(){returnthis.str}emptyStr(){return!1}getnames(){return{[this.str]:1}}}Sf.Name=rI;classf$extendsRW{constructor($){super();this._items=typeof$==="string"?[$]:$}toString(){returnthis.str}emptyStr(){if(this._items.length>1)return!1;let$=this._items[0];return$===""||$==='""'}getstr(){var$;return($=this._str)!==null&&$!==void0?$:this._str=this._items.reduce((I,U)=>`${I}${U}`,"")}getnames(){var$;return($=this._names)!==null&&$!==void0?$:this._names=this._items.reduce((I,U)=>{if(UinstanceofrI)I[U.str]=(I[U.str]||0)+1;returnI},{})}}Sf._Code=f$;Sf.nil=newf$("");functionjf($,...I){letU=[$[0]],Y=0;while(Y<I.length)uP(U,I[Y]),U.push($[++Y]);returnnewf$(U)}Sf._=jf;varkP=newf$("+");function_f($,...I){letU=[CQ($[0])],Y=0;while(Y<I.length)U.push(kP),uP(U,I[Y]),U.push(kP,CQ($[++Y]));returnxN0(U),newf$(U)}Sf.str=_f;functionuP($,I){if(Iinstanceoff$)$.push(...I._items);elseif(IinstanceofrI)$.push(I);else$.push(fN0(I))}Sf.addCodeArg=uP;functionxN0($){letI=1;while(I<$.length-1){if($[I]===kP){letU=kN0($[I-1],$[I+1]);if(U!==void0){$.splice(I-1,3,U);continue}$[I++]="+"}I++}}functionkN0($,I){if(I==='""')return$;if($==='""')returnI;if(typeof$=="string"){if(IinstanceofrI||$[$.length-1]!=='"')return;if(typeofI!="string")return`${$.slice(0,-1)}${I}"`;if(I[0]==='"')return$.slice(0,-1)+I.slice(1);return}if(typeofI=="string"&&I[0]==='"'&&!($instanceofrI))return`"${$}${I.slice(1)}`;return}functionuN0($,I){returnI.emptyStr()?$:$.emptyStr()?I:_f`${$}${I}`}Sf.strConcat=uN0;functionfN0($){returntypeof$=="number"||typeof$=="boolean"||$===null?$:CQ(Array.isArray($)?$.join(","):$)}functionbN0($){returnnewf$(CQ($))}Sf.stringify=bN0;functionCQ($){returnJSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Sf.safeStringify=CQ;functioniN0($){returntypeof$=="string"&&Sf.IDENTIFIER.test($)?newf$(`.${$}`):jf`[${$}]`}Sf.getProperty=iN0;functionnN0($){if(typeof$=="string"&&Sf.IDENTIFIER.test($))returnnewf$(`${$}`);throwError(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}Sf.getEsmExportName=nN0;functionpN0($){returnnewf$($.toString())}Sf.regexpCode=pN0});varnP=O((xf)=>{Object.defineProperty(xf,"__esModule",{value:!0});xf.ValueScope=xf.ValueScopeName=xf.Scope=xf.varKinds=xf.UsedValueState=void0;vark6=jQ();classyfextendsError{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}varCW;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(CW||(xf.UsedValueState=CW={}));xf.varKinds={const:newk6.Name("const"),let:newk6.Name("let"),var:newk6.Name("var")};classbP{constructor({prefixes:$,parent:I}={}){this._names={},this._prefixes=$,this._parent=I}toName($){return$instanceofk6.Name?$:this.name($)}name($){returnnewk6.Name(this._newName($))}_newName($){letI=this._names[$]||this._nameGroup($);return`${$}${I.index++}`}_nameGroup($){varI,U;if(((U=(I=this._parent)===null||I===void0?void0:I._prefixes)===null||U===void0?void0:U.has($))||this._prefixes&&!this._prefixes.has($))throwError(`CodeGen: prefix "${$}" is not allowed in this scope`);returnthis._names[$]={prefix:$,index:0}}}xf.Scope=bP;classiPextendsk6.Name{constructor($,I){super(I);this.prefix=$}setValue($,{property:I,itemIndex:U}){this.value=$,this.scopePath=k6._`.${newk6.Name(I)}[${U}]`}}xf.ValueScopeName=iP;varUF0=k6._`\n`;classhfextendsbP{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?UF0:k6.nil}}get(){returnthis._scope}name($){returnnewiP($,this._newName($))}value($,I){varU;if(I.ref===void0)throwError("CodeGen: ref must be passed in value");letY=this.toName($),{prefix:J}=Y,Q=(U=I.key)!==null&&U!==void0?U:I.ref,K=this._values[J];if(K){letH=K.get(Q);if(Line truncated
deps:${U}}`};var IB0={keyword:"dependencies",type:"object",schemaType:"object",error:lp.error,code($){let[I,U]=UB0($);dp($,I),mp($,U)}};function UB0({schema:$}){let I={},U={};for(let Y in $){if(Y==="__proto__")continue;let J=Array.isArray($[Y])?I:U;J[Y]=$[Y]}return[I,U]}function dp($,I=$.schema){let{gen:U,data:Y,it:J}=$;if(Object.keys(I).length===0)return;let Q=U.let("missing");for(let K in I){let q=I[K];if(q.length===0)continue;let G=(0,oQ.propertyInData)(U,Y,K,J.opts.ownProperties);if($.setParams({property:K,depsCount:q.length,deps:q.join(", ")}),J.allErrors)U.if(G,()=>{for(let H of q)(0,oQ.checkReportMissingProp)($,H)});else U.if(TT._`${G}&&(${(0,oQ.checkMissingProp)($,q,Q)})`),(0,oQ.reportMissingProp)($,Q),U.else()}}lp.validatePropertyDeps=dp;function mp($,I=$.schema){let{gen:U,data:Y,keyword:J,it:Q}=$,K=U.name("valid");for(let q in I){if((0,$B0.alwaysValidSchema)(Q,I[q]))continue;U.if((0,oQ.propertyInData)(U,Y,q,Q.opts.ownProperties),()=>{let G=$.subschema({keyword:J,schemaProp:q},K);$.mergeValidEvaluated(G,K)},()=>U.var(K,!0)),$.ok(K)}}lp.validateSchemaDeps=mp;lp.default=IB0});var ep=N((sp)=>{Object.defineProperty(sp,"__esModule",{value:!0});var ap=t0(),QB0=V1(),KB0={message:"property name must be valid",params:({params:$})=>ap._`{propertyName:${$.propertyName}}`},qB0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:KB0,code($){let{gen:I,schema:U,data:Y,it:J}=$;if((0,QB0.alwaysValidSchema)(J,U))return;let Q=I.name("valid");I.forIn("key",Y,(K)=>{$.setParams({propertyName:K}),$.subschema({keyword:"propertyNames",data:K,dataTypes:["string"],propertyName:K,compositeRule:!0},Q),I.if((0,ap.not)(Q),()=>{if($.error(!0),!J.allErrors)I.break()})}),$.ok(Q)}};sp.default=qB0});var ET=N(($n)=>{Object.defineProperty($n,"__esModule",{value:!0});var $V=O$(),n$=t0(),HB0=s8(),IV=V1(),WB0={message:"must NOT have additional properties",params:({params:$})=>n$._`{additionalProperty:${$.additionalProperty}}`},VB0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:WB0,code($){let{gen:I,schema:U,parentSchema:Y,data:J,errsCount:Q,it:K}=$;if(!Q)throw Error("ajv implementation error");let{allErrors:q,opts:G}=K;if(K.props=!0,G.removeAdditional!=="all"&&(0,IV.alwaysValidSchema)(K,U))return;let H=(0,$V.allSchemaProperties)(Y.properties),W=(0,$V.allSchemaProperties)(Y.patternProperties);V(),$.ok(n$._`${Q}===${HB0.default.errors}`);function V(){I.forIn("key",J,(O)=>{if(!H.length&&!W.length)w(O);else I.if(X(O),()=>w(O))})}function X(O){let F;if(H.length>8){let E=(0,IV.schemaRefOrVal)(K,Y.properties,"properties");F=(0,$V.isOwnProperty)(I,E,O)}else if(H.length)F=(0,n$.or)(...H.map((E)=>n$._`${O}===${E}`));else F=n$.nil;if(W.length)F=(0,n$.or)(F,...W.map((E)=>n$._`${(0,$V.usePattern)($,E)}.test(${O})`));return(0,n$.not)(F)}function Z(O){I.code(n$._`delete${J}[${O}]`)}function w(O){if(G.removeAdditional==="all"||G.removeAdditional&&U===!1){Z(O);return}if(U===!1){if($.setParams({additionalProperty:O}),$.error(),!q)I.break();return}if(typeof U=="object"&&!(0,IV.alwaysValidSchema)(K,U)){let F=I.name("valid");if(G.removeAdditional==="failing")D(O,F,!1),I.if((0,n$.not)(F),()=>{$.reset(),Z(O)});else if(D(O,F),!q)I.if((0,n$.not)(F),()=>I.break())}}function D(O,F,E){let A={keyword:"additionalProperties",dataProp:O,dataPropType:IV.Type.Str};if(E===!1)Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(A,F)}}};$n.default=VB0});var Jn=N((Yn)=>{Object.defineProperty(Yn,"__esModule",{value:!0});var XB0=xQ(),In=O$(),BT=V1(),Un=ET(),LB0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:Y,data:J,it:Q}=$;if(Q.opts.removeAdditional==="all"&&Y.additionalProperties===void 0)Un.default.code(new XB0.KeywordCxt(Q,Un.default,"additionalProperties"));let K=(0,In.allSchemaProperties)(U);for(let V of K)Q.definedProperties.add(V);if(Q.opts.unevaluated&&K.length&&Q.props!==!0)Q.props=BT.mergeEvaluated.props(I,(0,BT.toHash)(K),Q.props);let q=K.filter((V)=>!(0,BT.alwaysValidSchema)(Q,U[V]));if(q.length===0)return;let G=I.name("valid");for(let V of q){if(H(V))W(V);else{if(I.if((0,In.propertyInData)(I,J,V,Q.opts.ownProperties)),W(V),!Q.allErrors)I.else().var(G,!0);I.endIf()}$.it.definedProperties.add(V),$.ok(G)}function H(V){return Q.opts.useDefaults&&!Q.compositeRule&&U[V].default!==void 0}function W(V){$.subschema({keyword:"properties",schemaProp:V,dataProp:V},G)}}};Yn.default=LB0});var Hn=N((Gn)=>{Object.defineProperty(Gn,"__esModule",{value:!0});var Qn=O$(),UV=t0(),Kn=V1(),qn=V1(),DB0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:Y,parentSchema:J,it:Q}=$,{opts:K}=Q,q=(0,Qn.allSchemaProperties)(U),G=q.filter((D)=>(0,Kn.alwaysValidSchema)(Q,U[D]));if(q.length===0||G.length===q.length&&(!Q.opts.unevaluated||Q.props===!0))return;let H=K.strictSchema&&!K.allowMatchingProperties&&J.properties,W=I.name("valid");if(Q.props!==!0&&!(Q.props instanceo
Line truncated
`)}openNode($,I){let U=this.tos,Y=this._xml;if(U&&this.open)Y.push(">");this._stack.push($),Y.push("<"),Y.push($),iR(Y,I),this.leaf=!0,this.open=!0}addAttribute($,I){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(I!==void 0)is(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");iR(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(bs.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),I=this._xml;if(this.leaf)I.push("/>");else I.push("</"),I.push($),I.push(">");this.open=!1,this.leaf=!1}leafNode($,I,U){if(this.openNode($,I),U!==void 0)this.writeText(U);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}pR.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};ps.exports=pR});var nR=N((nu0)=>{var ns=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function pu0($){if(typeof $==="string")return $;if(ns)return ns.decode($);return $.toString()}nu0.bufferToString=pu0});var os=N((ds)=>{Object.defineProperty(ds,"__esModule",{value:!0});ds.CHAR=`
`;$e.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";$e.NAME_CHAR="-"+$e.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";$e.CHAR_RE=new RegExp("^["+$e.CHAR+"]$","u");$e.RESTRICTED_CHAR_RE=new RegExp("^["+$e.RESTRICTED_CHAR+"]$","u");$e.S_RE=new RegExp("^["+$e.S+"]+$","u");$e.NAME_START_CHAR_RE=new RegExp("^["+$e.NAME_START_CHAR+"]$","u");$e.NAME_CHAR_RE=new RegExp("^["+$e.NAME_CHAR+"]$","u");$e.NAME_RE=new RegExp("^["+$e.NAME_START_CHAR+"]["+$e.NAME_CHAR+"]*$","u");$e.NMTOKEN_RE=new RegExp("^["+$e.NAME_CHAR+"]+$","u");var rs=9,ts=10,as=13,ss=32;$e.S_LIST=[ss,ts,as,rs];function Qf0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}$e.isChar=Qf0;function Kf0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}$e.isRestrictedChar=Kf0;function qf0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}$e.isCharAndNotRestricted=qf0;function Gf0($){return $===ss||$===ts||$===as||$===rs}$e.isS=Gf0;function es($){return $>=65&&$<=90||$>=97&&$<=122||$===58||$===95||$===8204||$===8205||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}$e.isNameStartChar=es;function Hf0($){return es($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}$e.isNameChar=Hf0});var qe=N((Ke)=>{Object.defineProperty(Ke,"__esModule",{value:!0});Ke.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";Ke.NC_NAME_CHAR="-"+Ke.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";Ke.NC_NAME_START_CHAR_RE=new RegExp("^["+Ke.NC_NAME_START_CHAR+"]$","u");Ke.NC_NAME_CHAR_RE=new RegExp("^["+Ke.NC_NAME_CHAR+"]$","u");Ke.NC_NAME_RE=new RegExp("^["+Ke.NC_NAME_START_CHAR+"]["+Ke.NC_NAME_CHAR+"]*$","u");function Qe($){return $>=65&&$<=90||$===95||$>=97&&$<=122||$>=192&&$<=214||$>=216&&$<=246||$>=248&&$<=767||$>=880&&$<=893||$>=895&&$<=8191||$>=8204&&$<=8205||$>=8304&&$<=8591||$>=11264&&$<=12271||$>=12289&&$<=55295||$>=63744&&$<=64975||$>=65008&&$<=65533||$>=65536&&$<=983039}Ke.isNCNameStartChar=Qe;function Tf0($){return Qe($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}Ke.isNCNameChar=Tf0});var Ce=N((ve)=>{Object.defineProperty(ve,"__esModule",{value:!0});var rU=os(),jf0=Je(),qv=qe(),n6=rU.isS,_f0=rU.isChar,qK=rU.isNameStartChar,Ge=rU.isNameChar,Ae=rU.S_LIST,Sf0=rU.NAME_RE,gf0=jf0.isChar,yf0=qv.isNCNameStartChar,hf0=qv.isNCNameChar,xf0=qv.NC_NAME_RE,YX="http://www.w3.org/XML/1998/namespace",oU="http://www.w3.org/2000/xmlns/",kf0={__proto__:null,xml:YX,xmlns:oU},uf0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},J4=-1,R8=-2,He=0,ff0=1,rR=2,bf0=3,dU=4,if0=5,pf0=6,nf0=7,tR=8,cf0=9,df0=10,mf0=11,lf0=12,v6=13,sZ=14,aR=15,of0=16,sR=17,rf0=18,tf0=19,eR=20,af0=21,sf0=22,ef0=23,We=24,$v=25,eZ=26,Ve=27,$b0=28,Ib0=29,Ze=30,Ub0=31,Yb0=32,$3=33,Jb0=34,Iv=35,GK=36,Uv=37,Qb0=38,Xe=39,Le=40,Kb0=41,we=42,qb0=43,Gb0=44,Yv=9,s$=10,Jv=13,De=32,Oe=33,Pe=34,HK=38,Te=39,$X=45,IX=47,Hb0=59,C9=60,mU=61,g4=62,I6=63,Ee=91,lU=93,Ne=133,Fe=8232,UX=($)=>$===Pe||$===Te,Be=[Pe,Te],Wb0=[...Be,Ee,g4],Vb0=[...Be,C9,lU],Zb0=[mU,I6,...Ae],Xb0=[...Ae,g4,HK,C9];function Kv($,I,U){switch(I){case"xml":if(U!==YX)$.fail(`xmlprefixmustbeboundto${YX}.`);break;case"xmlns":if(U!==oU)$.fail(`xmlnsprefixmustbeboundto${oU}.`);break;default:}switch(U){case oU:$.fail(I===""?`thedefaultnamespacemaynotbesetto${U}.`:`maynotassignaprefix(even"xmlns")totheURI${oU}.`);break;case YX:switch(I){case"xml":break;case"":$.fail(`thedefaultnamespacemaynotbesetto${U}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function Lb0($,I){for(let U of Object.keys(I))Kv($,U,I[U])}var wb0=($)=>xf0.test($),Db0=($)=>Sf0.test($),I3=0,Me=1,Qv=2;ve.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var ze={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class Re{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let I=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,I){this.nameStartCheck=yf0,this.nameCheck=hf0,this.isName=wb0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},kf0);let U=this.opt.additionalNamespaces;if(U!=null)Lb0(this,U),Object.assign(this.ns,U)}else this.nameStartCheck=qK,this.nameChec
Line truncated
deps:${U}}`};var HB0={keyword:"dependencies",type:"object",schemaType:"object",error:en.error,code($){let[I,U]=WB0($);an($,I),sn($,U)}};function WB0({schema:$}){let I={},U={};for(let Y in $){if(Y==="__proto__")continue;let J=Array.isArray($[Y])?I:U;J[Y]=$[Y]}return[I,U]}function an($,I=$.schema){let{gen:U,data:Y,it:J}=$;if(Object.keys(I).length===0)return;let Q=U.let("missing");for(let K in I){let q=I[K];if(q.length===0)continue;let G=(0,rQ.propertyInData)(U,Y,K,J.opts.ownProperties);if($.setParams({property:K,depsCount:q.length,deps:q.join(", ")}),J.allErrors)U.if(G,()=>{for(let H of q)(0,rQ.checkReportMissingProp)($,H)});else U.if(BT._`${G}&&(${(0,rQ.checkMissingProp)($,q,Q)})`),(0,rQ.reportMissingProp)($,Q),U.else()}}en.validatePropertyDeps=an;function sn($,I=$.schema){let{gen:U,data:Y,keyword:J,it:Q}=$,K=U.name("valid");for(let q in I){if((0,GB0.alwaysValidSchema)(Q,I[q]))continue;U.if((0,rQ.propertyInData)(U,Y,q,Q.opts.ownProperties),()=>{let G=$.subschema({keyword:J,schemaProp:q},K);$.mergeValidEvaluated(G,K)},()=>U.var(K,!0)),$.ok(K)}}en.validateSchemaDeps=sn;en.default=HB0});var Qp=O((Jp)=>{Object.defineProperty(Jp,"__esModule",{value:!0});var Yp=t0(),zB0=V1(),XB0={message:"property name must be valid",params:({params:$})=>Yp._`{propertyName:${$.propertyName}}`},wB0={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:XB0,code($){let{gen:I,schema:U,data:Y,it:J}=$;if((0,zB0.alwaysValidSchema)(J,U))return;let Q=I.name("valid");I.forIn("key",Y,(K)=>{$.setParams({propertyName:K}),$.subschema({keyword:"propertyNames",data:K,dataTypes:["string"],propertyName:K,compositeRule:!0},Q),I.if((0,Yp.not)(Q),()=>{if($.error(!0),!J.allErrors)I.break()})}),$.ok(Q)}};Jp.default=wB0});var RT=O((Kp)=>{Object.defineProperty(Kp,"__esModule",{value:!0});var UV=D$(),p$=t0(),DB0=s8(),YV=V1(),OB0={message:"must NOT have additional properties",params:({params:$})=>p$._`{additionalProperty:${$.additionalProperty}}`},NB0={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:OB0,code($){let{gen:I,schema:U,parentSchema:Y,data:J,errsCount:Q,it:K}=$;if(!Q)throw Error("ajv implementation error");let{allErrors:q,opts:G}=K;if(K.props=!0,G.removeAdditional!=="all"&&(0,YV.alwaysValidSchema)(K,U))return;let H=(0,UV.allSchemaProperties)(Y.properties),W=(0,UV.allSchemaProperties)(Y.patternProperties);V(),$.ok(p$._`${Q}===${DB0.default.errors}`);function V(){I.forIn("key",J,(D)=>{if(!H.length&&!W.length)w(D);else I.if(z(D),()=>w(D))})}function z(D){let N;if(H.length>8){let E=(0,YV.schemaRefOrVal)(K,Y.properties,"properties");N=(0,UV.isOwnProperty)(I,E,D)}else if(H.length)N=(0,p$.or)(...H.map((E)=>p$._`${D}===${E}`));else N=p$.nil;if(W.length)N=(0,p$.or)(N,...W.map((E)=>p$._`${(0,UV.usePattern)($,E)}.test(${D})`));return(0,p$.not)(N)}function Z(D){I.code(p$._`delete${J}[${D}]`)}function w(D){if(G.removeAdditional==="all"||G.removeAdditional&&U===!1){Z(D);return}if(U===!1){if($.setParams({additionalProperty:D}),$.error(),!q)I.break();return}if(typeof U=="object"&&!(0,YV.alwaysValidSchema)(K,U)){let N=I.name("valid");if(G.removeAdditional==="failing")L(D,N,!1),I.if((0,p$.not)(N),()=>{$.reset(),Z(D)});else if(L(D,N),!q)I.if((0,p$.not)(N),()=>I.break())}}function L(D,N,E){let T={keyword:"additionalProperties",dataProp:D,dataPropType:YV.Type.Str};if(E===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(T,N)}}};Kp.default=NB0});var Wp=O((Hp)=>{Object.defineProperty(Hp,"__esModule",{value:!0});var MB0=kQ(),qp=D$(),vT=V1(),Gp=RT(),AB0={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,parentSchema:Y,data:J,it:Q}=$;if(Q.opts.removeAdditional==="all"&&Y.additionalProperties===void 0)Gp.default.code(new MB0.KeywordCxt(Q,Gp.default,"additionalProperties"));let K=(0,qp.allSchemaProperties)(U);for(let V of K)Q.definedProperties.add(V);if(Q.opts.unevaluated&&K.length&&Q.props!==!0)Q.props=vT.mergeEvaluated.props(I,(0,vT.toHash)(K),Q.props);let q=K.filter((V)=>!(0,vT.alwaysValidSchema)(Q,U[V]));if(q.length===0)return;let G=I.name("valid");for(let V of q){if(H(V))W(V);else{if(I.if((0,qp.propertyInData)(I,J,V,Q.opts.ownProperties)),W(V),!Q.allErrors)I.else().var(G,!0);I.endIf()}$.it.definedProperties.add(V),$.ok(G)}function H(V){return Q.opts.useDefaults&&!Q.compositeRule&&U[V].default!==void 0}function W(V){$.subschema({keyword:"properties",schemaProp:V,dataProp:V},G)}}};Hp.default=AB0});var wp=O((Xp)=>{Object.defineProperty(Xp,"__esModule",{value:!0});var Vp=D$(),JV=t0(),Zp=V1(),zp=V1(),TB0={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:I,schema:U,data:Y,parentSchema:J,it:Q}=$,{opts:K}=Q,q=(0,Vp.allSchemaProperties)(U),G=q.filter((L)=>(0,Zp.alwaysValidSchema)(Q,U[L]));if(q.length===0||G.length===q.length&&(!Q.opts.unevaluated||Q.props===!0))return;let H=K.strictSchema&&!K.allowMatchingProperties&&J.properties,W=I.name("valid");if(Q.props!==!0&&!(Q.props instanceo
Line truncated
`)}openNode($,I){let U=this.tos,Y=this._xml;if(U&&this.open)Y.push(">");this._stack.push($),Y.push("<"),Y.push($),mR(Y,I),this.leaf=!0,this.open=!0}addAttribute($,I){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(I!==void 0)rs(this._xml,$,I)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");mR(this._xml,$)}writeText($){let I=this._xml;if(this.open)I.push(">"),this.open=!1;this.leaf=!1,I.push(os.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),I=this._xml;if(this.leaf)I.push("/>");else I.push("</"),I.push($),I.push(">");this.open=!1,this.leaf=!1}leafNode($,I,U){if(this.openNode($,I),U!==void 0)this.writeText(U);this.closeNode()}closeAll(){while(this._stack.length)this.closeNode()}addRollback(){return this._rollbacks.push({xml:this._xml.length,stack:this._stack.length,leaf:this.leaf,open:this.open}),this.cursor}commit(){this._rollbacks.pop()}rollback(){let $=this._rollbacks.pop();if(this._xml.length>$.xml)this._xml.splice($.xml,this._xml.length-$.xml);if(this._stack.length>$.stack)this._stack.splice($.stack,this._stack.length-$.stack);this.leaf=$.leaf,this.open=$.open}get xml(){return this.closeAll(),this._xml.join("")}}lR.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};ts.exports=lR});var oR=O((au0)=>{var as=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function tu0($){if(typeof $==="string")return $;if(as)return as.decode($);return $.toString()}au0.bufferToString=tu0});var Ue=O((es)=>{Object.defineProperty(es,"__esModule",{value:!0});es.CHAR=`
`,$=this.i;break;case Hb0:{let{entityReturnState:U}=this,Y=this.entity+I.slice($,this.prevI);this.state=U;let J;if(Y==="")this.fail("empty entity name."),J="&;";else J=this.parseEntity(Y),this.entity="";if(U!==v6||this.textHandler!==void 0)this.text+=J;break $}case J4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(qK($))this.state=Jb0,this.unget(),this.xmlDeclPossible=!1;else switch($){case IX:this.state=qb0,this.xmlDeclPossible=!1;break;case Oe:this.state=of0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case I6:this.state=ef0;break;default:this.fail("disallowed character in tag name"),this.state=v6,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=eR,this.openWakaBang="";break;case"--":this.state=sR,this.openWakaBang="";break;case"DOCTYPE":if(this.state=rR,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar($X))this.state=rf0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===$X)this.state=tf0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=sR}sCommentEnded(){let $=this.getCodeNorm();if($!==g4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=sR;else this.state=v6}sCData(){if(this.captureToChar(lU))this.state=af0}sCDataEnding(){let $=this.getCodeNorm();if($===lU)this.state=sf0;else this.text+=`]${String.fromCodePoint($)}`,this.state=eR}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case g4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=v6;break}case lU:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=eR}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=We;else if($===I6||n6($))this.fail("processing instruction without a target."),this.state=$===I6?eZ:$v;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=We}sPIRest(){let{chunk:$,i:I}=this;while(!0){let U=this.getCodeNorm();if(U===J4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(U)){this.piTarget+=$.slice(I,this.prevI);let Y=U===I6;if(Y||n6(U))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=Y?$3:Ve}else this.state=Y?eZ:$v;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(U);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===I6)this.state=eZ;else if(!n6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(I6))this.state=eZ}sPIEnding(){var $;let I=this.getCodeNorm();if(I===g4){let{piTarget:U}=this;if(U.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:U,body:this.text}),this.piTarget=this.text="",this.state=v6}else if(I===I6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=$v;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===I6){this.state=$3;return}if($!==J4)this.state=$b0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(Zb0);if($===I6){this.state=$3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(n6($)||$===mU))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expectedthename${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expectedoneof${this.xmlDeclExpects.join(", ")}`)}this.state=$===mU?Ze:Ib0}sXMLDeclEq(){let $=this.getCodeNorm();if($===I6){this.state=$3,this.fail("XML declaration is incomplete.");return}if(n6($))return;if($!==mU)this.fail("value required.");this.state=Ze}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===I6){this.state=$3,this.fail("XML declaration is incomplete.");return}if(n6($))return;if(!UX($))this.fail("value must be quoted."),this.q=De;else this.q=$;this.state=Ub0}sXMLDeclValue(){let $=this.captureTo([this.q,I6]);if($===I6){this.state=$3,this.text="",this.fail("XML declaration is incomplete.");return}if($===J4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let U=I;if(this.xmlDecl.version=U,!/^1\.[0-9]+$/.test(U))this.fail("version nu
Line truncated
`,$=this.i;break;case Db0:{let{entityReturnState:U}=this,Y=this.entity+I.slice($,this.prevI);this.state=U;let J;if(Y==="")this.fail("empty entity name."),J="&;";else J=this.parseEntity(Y),this.entity="";if(U!==v6||this.textHandler!==void 0)this.text+=J;break $}case J4:this.entity+=I.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(GK($))this.state=Zb0,this.unget(),this.xmlDeclPossible=!1;else switch($){case Yz:this.state=wb0,this.xmlDeclPossible=!1;break;case Ee:this.state=Ub0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case I6:this.state=qb0;break;default:this.fail("disallowed character in tag name"),this.state=v6,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":if(!this.sawRoot&&!this.reportedTextBeforeRoot)this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0;if(this.closedRoot&&!this.reportedTextAfterRoot)this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0;this.state=Jv,this.openWakaBang="";break;case"--":this.state=Yv,this.openWakaBang="";break;case"DOCTYPE":if(this.state=$v,this.doctype||this.sawRoot)this.fail("inappropriately located doctype declaration.");this.openWakaBang="";break;default:if(this.openWakaBang.length>=7)this.fail("incorrect syntax.")}}sComment(){if(this.captureToChar(Uz))this.state=Yb0}sCommentEnding(){var $;let I=this.getCodeNorm();if(I===Uz)this.state=Jb0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(I)}`,this.state=Yv}sCommentEnded(){let $=this.getCodeNorm();if($!==g4)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=Yv;else this.state=v6}sCData(){if(this.captureToChar(oU))this.state=Qb0}sCDataEnding(){let $=this.getCodeNorm();if($===oU)this.state=Kb0;else this.text+=`]${String.fromCodePoint($)}`,this.state=Jv}sCDataEnding2(){var $;let I=this.getCodeNorm();switch(I){case g4:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=v6;break}case oU:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(I)}`,this.state=Jv}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=Oe;else if($===I6||p6($))this.fail("processing instruction without a target."),this.state=$===I6?Iz:Qv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=Oe}sPIRest(){let{chunk:$,i:I}=this;while(!0){let U=this.getCodeNorm();if(U===J4){this.piTarget+=$.slice(I);return}if(!this.nameCheck(U)){this.piTarget+=$.slice(I,this.prevI);let Y=U===I6;if(Y||p6(U))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=Y?I3:Ne}else this.state=Y?Iz:Qv;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(U);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===I6)this.state=Iz;else if(!p6($))this.text=String.fromCodePoint($)}else if(this.captureToChar(I6))this.state=Iz}sPIEnding(){var $;let I=this.getCodeNorm();if(I===g4){let{piTarget:U}=this;if(U.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:U,body:this.text}),this.piTarget=this.text="",this.state=v6}else if(I===I6)this.text+="?";else this.text+=`?${String.fromCodePoint(I)}`,this.state=Qv;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===I6){this.state=I3;return}if($!==J4)this.state=Gb0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(Fb0);if($===I6){this.state=I3,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p6($)||$===lU))return;if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expectedthename${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expectedoneof${this.xmlDeclExpects.join(", ")}`)}this.state=$===lU?Fe:Hb0}sXMLDeclEq(){let $=this.getCodeNorm();if($===I6){this.state=I3,this.fail("XML declaration is incomplete.");return}if(p6($))return;if($!==lU)this.fail("value required.");this.state=Fe}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===I6){this.state=I3,this.fail("XML declaration is incomplete.");return}if(p6($))return;if(!Jz($))this.fail("value must be quoted."),this.q=Te;else this.q=$;this.state=Wb0}sXMLDeclValue(){let $=this.captureTo([this.q,I6]);if($===I6){this.state=I3,this.text="",this.fail("XML declaration is incomplete.");return}if($===J4)return;let I=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let U=I;if(this.xmlDecl.version=U,!/^1\.[0-9]+$/.test(U))this.fail("version nu
Line truncated
See:https://github.com/isaacs/node-glob/issues/167`);return new y4($,I).found}function y4($,I){if(!$)throw Error("must provide pattern");if(typeof I==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
`+e[H0-1];break}}}var J1="a promise was created in a "+z+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+m;j._warn(J1,!0,M)}}function B0(a,M){var z=a+" is deprecated and will be removed in a future version.";if(M)z+=" Use "+M+" instead.";return w1(z)}function w1(a,M,z){if(!T0.warnings)return;var j=new J(a),x;if(M)z._attachExtraTrace(j);else if(T0.longStackTraces&&(x=$._peekContext()))x.attachExtraTrace(j);else{var s=Q4(j);j.stack=s.message+`
`+e[H0-1];break}}}var J1="a promise was created in a "+M+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+m;j._warn(J1,!0,F)}}function B0(a,F){var M=a+" is deprecated and will be removed in a future version.";if(F)M+=" Use "+F+" instead.";return w1(M)}function w1(a,F,M){if(!T0.warnings)return;var j=new J(a),x;if(F)M._attachExtraTrace(j);else if(T0.longStackTraces&&(x=$._peekContext()))x.attachExtraTrace(j);else{var s=Q4(j);j.stack=s.message+`
`)));return}}F=F._target();var E=F._bitField;if((E&50397184)===0)this._yieldedPromise=F,F._proxy(this,null);else if((E&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,F._value());else if((E&16777216)!==0)$._async.invoke(this._promiseRejected,this,F._reason());else this._promiseCancelled()}},$.coroutine=function(w,D){if(typeof w!=="function")throw new q(`generatorFunctionmustbeafunction
`)));return}}N=N._target();var E=N._bitField;if((E&50397184)===0)this._yieldedPromise=N,N._proxy(this,null);else if((E&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,N._value());else if((E&16777216)!==0)$._async.invoke(this._promiseRejected,this,N._reason());else this._promiseCancelled()}},$.coroutine=function(w,L){if(typeof w!=="function")throw new q(`generatorFunctionmustbeafunction
Seehttp://goo.gl/MqrFmX
`);var O=Object(D).yieldHandler,F=Z,E=Error().stack;return function(){var A=w.apply(this,arguments),T=new F(void 0,void 0,O,E),v=T.promise();return T._generator=A,T._promiseFulfilled(void 0),v}},$.coroutine.addYieldHandler=function(w){if(typeof w!=="function")throw new q("expecting a function but got "+G.classString(w));V.push(w)},$.spawn=function(w){if(Q.deprecated("Promise.spawn()","Promise.coroutine()"),typeof w!=="function")return I(`generatorFunctionmustbeafunction
`);var D=Object(L).yieldHandler,N=Z,E=Error().stack;return function(){var T=w.apply(this,arguments),A=new N(void 0,void 0,D,E),v=A.promise();return A._generator=T,A._promiseFulfilled(void 0),v}},$.coroutine.addYieldHandler=function(w){if(typeof w!=="function")throw new q("expecting a function but got "+G.classString(w));V.push(w)},$.spawn=function(w){if(Q.deprecated("Promise.spawn()","Promise.coroutine()"),typeof w!=="function")return I(`generatorFunctionmustbeafunction
`)},I=function(){return new S.PromiseInspection(this._target())},U=function(B){return S.reject(new V(B))};function Y(){}var J={},Q=b1(),K;if(Q.isNode)K=function(){var B=process.domain;if(B===void 0)B=null;return B};else K=function(){return null};Q.notEnumerableProp(S,"_getDomain",K);var q=g3(),G=j20(),H=new G;q.defineProperty(S,"_async",{value:H});var W=C5(),V=S.TypeError=W.TypeError;S.RangeError=W.RangeError;var X=S.CancellationError=W.CancellationError;S.TimeoutError=W.TimeoutError,S.OperationalError=W.OperationalError,S.RejectionError=W.OperationalError,S.AggregateError=W.AggregateError;var Z=function(){},w={},D={},O=h20()(S,Z),F=k20()(S,Z,O,U,Y),E=f20()(S),A=E.create,T=i20()(S,E),v=T.CapturedTrace,u=n20()(S,O),g=d20()(D),b=Kg(),C=Q.errorObj,n=Q.tryCatch;function p(B,k){if(typeof k!=="function")throw new V("expecting a function but got "+Q.classString(k));if(B.constructor!==S)throw new V(`thepromiseconstructorcannotbeinvokeddirectly
`)},I=function(){return new S.PromiseInspection(this._target())},U=function(B){return S.reject(new V(B))};function Y(){}var J={},Q=b1(),K;if(Q.isNode)K=function(){var B=process.domain;if(B===void 0)B=null;return B};else K=function(){return null};Q.notEnumerableProp(S,"_getDomain",K);var q=y3(),G=u20(),H=new G;q.defineProperty(S,"_async",{value:H});var W=C5(),V=S.TypeError=W.TypeError;S.RangeError=W.RangeError;var z=S.CancellationError=W.CancellationError;S.TimeoutError=W.TimeoutError,S.OperationalError=W.OperationalError,S.RejectionError=W.OperationalError,S.AggregateError=W.AggregateError;var Z=function(){},w={},L={},D=p20()(S,Z),N=d20()(S,Z,D,U,Y),E=l20()(S),T=E.create,A=r20()(S,E),v=A.CapturedTrace,u=a20()(S,D),g=e20()(L),b=Vg(),C=Q.errorObj,p=Q.tryCatch;function n(B,k){if(typeof k!=="function")throw new V("expecting a function but got "+Q.classString(k));if(B.constructor!==S)throw new V(`thepromiseconstructorcannotbeinvokeddirectly
Seehttp://goo.gl/MqrFmX
`)}function S(B){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,B!==Z)p(this,B),this._resolveFromExecutor(B);this._promiseCreated(),this._fireEvent("promiseCreated",this)}S.prototype.toString=function(){return"[object Promise]"},S.prototype.caught=S.prototype.catch=function(B){var k=arguments.length;if(k>1){var d=Array(k-1),t=0,K0;for(K0=0;K0<k-1;++K0){var W0=arguments[K0];if(Q.isObject(W0))d[t++]=W0;else return U("expecting an object but got A catch statement predicate "+Q.classString(W0))}return d.length=t,B=arguments[K0],this.then(void 0,g(d,B,this))}return this.then(void 0,B)},S.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},S.prototype.then=function(B,k){if(T.warnings()&&arguments.length>0&&typeof B!=="function"&&typeof k!=="function"){var d=".then() only accepts functions but was passed: "+Q.classString(B);if(arguments.length>1)d+=", "+Q.classString(k);this._warn(d)}return this._then(B,k,void 0,void 0,void 0)},S.prototype.done=function(B,k){var d=this._then(B,k,void 0,void 0,void 0);d._setIsFinal()},S.prototype.spread=function(B){if(typeof B!=="function")return U("expecting a function but got "+Q.classString(B));return this.all()._then(B,void 0,void 0,w,void 0)},S.prototype.toJSON=function(){var B={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())B.fulfillmentValue=this.value(),B.isFulfilled=!0;else if(this.isRejected())B.rejectionReason=this.reason(),B.isRejected=!0;return B},S.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new F(this).promise()},S.prototype.error=function(B){return this.caught(Q.originatesFromRejection,B)},S.getNewLibraryCopy=Gg.exports,S.is=function(B){return B instanceof S},S.fromNode=S.fromCallback=function(B){var k=new S(Z);k._captureStackTrace();var d=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,t=n(B)(b(k,d));if(t===C)k._rejectCallback(t.e,!0);if(!k._isFateSealed())k._setAsyncGuaranteed();return k},S.all=function(B){return new F(B).promise()},S.cast=function(B){var k=O(B);if(!(k instanceof S))k=new S(Z),k._captureStackTrace(),k._setFulfilled(),k._rejectionHandler0=B;return k},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(B){var k=new S(Z);return k._captureStackTrace(),k._rejectCallback(B,!0),k},S.setScheduler=function(B){if(typeof B!=="function")throw new V("expecting a function but got "+Q.classString(B));return H.setScheduler(B)},S.prototype._then=function(B,k,d,t,K0){var W0=K0!==void 0,z0=W0?K0:new S(Z),B0=this._target(),w1=B0._bitField;if(!W0){if(z0._propagateFrom(this,3),z0._captureStackTrace(),t===void 0&&(this._bitField&2097152)!==0)if((w1&50397184)!==0)t=this._boundValue();else t=B0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,z0)}var f0=K();if((w1&50397184)!==0){var G1,N0,g0=B0._settlePromiseCtx;if((w1&33554432)!==0)N0=B0._rejectionHandler0,G1=B;else if((w1&16777216)!==0)N0=B0._fulfillmentHandler0,G1=k,B0._unsetRejectionIsUnhandled();else g0=B0._settlePromiseLateCancellationObserver,N0=new X("late cancellation observer"),B0._attachExtraTrace(N0),G1=k;H.invoke(g0,B0,{handler:f0===null?G1:typeof G1==="function"&&Q.domainBind(f0,G1),promise:z0,receiver:t,value:N0})}else B0._addCallbacks(B,k,z0,t,f0);return z0},S.prototype._length=function(){return this._bitField&65535},S.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},S.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},S.prototype._setLength=function(B){this._bitField=this._bitField&-65536|B&65535},S.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},S.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},S.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},S.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},S.prototype._isFinal=function(){return(this._bitField&4194304)>0},S.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},S.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},S.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},S.prototype._setAsyncGuaranteed=function(){if(H.hasCustomScheduler())return;this._bitField=this._bitField|134217728},S.prototype._receiverAt=function(B){var k=B===0?this._receiver0:this[B*4-4+3];if(k===J)return;else if(k===void 0&&this._isBound())return this._boundValue();return k},S.prototype._promiseAt=function(B){return this[B*4-4+2]},S.prototype._fulfillmentHandlerAt=function(B){return this[B*4-4+0]},S.prototype._rejectionHandlerAt=function(B){return this[B*4-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(B){var{_bit
Line truncated
`)}function S(B){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,B!==Z)n(this,B),this._resolveFromExecutor(B);this._promiseCreated(),this._fireEvent("promiseCreated",this)}S.prototype.toString=function(){return"[object Promise]"},S.prototype.caught=S.prototype.catch=function(B){var k=arguments.length;if(k>1){var d=Array(k-1),t=0,K0;for(K0=0;K0<k-1;++K0){var W0=arguments[K0];if(Q.isObject(W0))d[t++]=W0;else return U("expecting an object but got A catch statement predicate "+Q.classString(W0))}return d.length=t,B=arguments[K0],this.then(void 0,g(d,B,this))}return this.then(void 0,B)},S.prototype.reflect=function(){return this._then(I,I,void 0,this,void 0)},S.prototype.then=function(B,k){if(A.warnings()&&arguments.length>0&&typeof B!=="function"&&typeof k!=="function"){var d=".then() only accepts functions but was passed: "+Q.classString(B);if(arguments.length>1)d+=", "+Q.classString(k);this._warn(d)}return this._then(B,k,void 0,void 0,void 0)},S.prototype.done=function(B,k){var d=this._then(B,k,void 0,void 0,void 0);d._setIsFinal()},S.prototype.spread=function(B){if(typeof B!=="function")return U("expecting a function but got "+Q.classString(B));return this.all()._then(B,void 0,void 0,w,void 0)},S.prototype.toJSON=function(){var B={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())B.fulfillmentValue=this.value(),B.isFulfilled=!0;else if(this.isRejected())B.rejectionReason=this.reason(),B.isRejected=!0;return B},S.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new N(this).promise()},S.prototype.error=function(B){return this.caught(Q.originatesFromRejection,B)},S.getNewLibraryCopy=zg.exports,S.is=function(B){return B instanceof S},S.fromNode=S.fromCallback=function(B){var k=new S(Z);k._captureStackTrace();var d=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,t=p(B)(b(k,d));if(t===C)k._rejectCallback(t.e,!0);if(!k._isFateSealed())k._setAsyncGuaranteed();return k},S.all=function(B){return new N(B).promise()},S.cast=function(B){var k=D(B);if(!(k instanceof S))k=new S(Z),k._captureStackTrace(),k._setFulfilled(),k._rejectionHandler0=B;return k},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(B){var k=new S(Z);return k._captureStackTrace(),k._rejectCallback(B,!0),k},S.setScheduler=function(B){if(typeof B!=="function")throw new V("expecting a function but got "+Q.classString(B));return H.setScheduler(B)},S.prototype._then=function(B,k,d,t,K0){var W0=K0!==void 0,M0=W0?K0:new S(Z),B0=this._target(),w1=B0._bitField;if(!W0){if(M0._propagateFrom(this,3),M0._captureStackTrace(),t===void 0&&(this._bitField&2097152)!==0)if((w1&50397184)!==0)t=this._boundValue();else t=B0===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,M0)}var f0=K();if((w1&50397184)!==0){var G1,O0,g0=B0._settlePromiseCtx;if((w1&33554432)!==0)O0=B0._rejectionHandler0,G1=B;else if((w1&16777216)!==0)O0=B0._fulfillmentHandler0,G1=k,B0._unsetRejectionIsUnhandled();else g0=B0._settlePromiseLateCancellationObserver,O0=new z("late cancellation observer"),B0._attachExtraTrace(O0),G1=k;H.invoke(g0,B0,{handler:f0===null?G1:typeof G1==="function"&&Q.domainBind(f0,G1),promise:M0,receiver:t,value:O0})}else B0._addCallbacks(B,k,M0,t,f0);return M0},S.prototype._length=function(){return this._bitField&65535},S.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},S.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},S.prototype._setLength=function(B){this._bitField=this._bitField&-65536|B&65535},S.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},S.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},S.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},S.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},S.prototype._isFinal=function(){return(this._bitField&4194304)>0},S.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},S.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},S.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},S.prototype._setAsyncGuaranteed=function(){if(H.hasCustomScheduler())return;this._bitField=this._bitField|134217728},S.prototype._receiverAt=function(B){var k=B===0?this._receiver0:this[B*4-4+3];if(k===J)return;else if(k===void 0&&this._isBound())return this._boundValue();return k},S.prototype._promiseAt=function(B){return this[B*4-4+2]},S.prototype._fulfillmentHandlerAt=function(B){return this[B*4-4+0]},S.prototype._rejectionHandlerAt=function(B){return this[B*4-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(B){var{_bit
Line truncated
`).filter((Q)=>Q),Y=Math.min(...U.map((Q)=>Q.length-Q.trimStart().length)),J=U.map((Q)=>Q.slice(Y)).map((Q)=>" ".repeat(this.indent*2)+Q);for(let Q of J)this.content.push(Q)}compile(){let $=Function,I=this?.args,Y=[...(this?.content??[""]).map((J)=>`${J}`)];return new $(...I,Y.join(`
`))}}var _N={major:4,minor:4,patch:3};var i0=o("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=_N;let Y=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Y.unshift($);for(let J of Y)for(let Q of J._zod.onattach)Q($);if(Y.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let J=(K,q,G)=>{let H=o5(K),W;for(let V of q){if(V._zod.def.when){if(hO(K))continue;if(!V._zod.def.when(K))continue}else if(H)continue;let X=K.issues.length,Z=V._zod.check(K);if(Z instanceof Promise&&G?.async===!1)throw new Q8;if(W||Z instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await Z,K.issues.length===X)return;if(!H)H=o5(K,X)});else{if(K.issues.length===X)continue;if(!H)H=o5(K,X)}}if(W)return W.then(()=>{return K});return K},Q=(K,q,G)=>{if(o5(K))return K.aborted=!0,K;let H=J(q,Y,G);if(H instanceof Promise){if(G.async===!1)throw new Q8;return H.then((W)=>$._zod.parse(W,G))}return $._zod.parse(H,G)};$._zod.run=(K,q)=>{if(q.skipChecks)return $._zod.parse(K,q);if(q.direction==="backward"){let H=$._zod.parse({value:K.value,issues:[]},{...q,skipChecks:!0});if(H instanceof Promise)return H.then((W)=>{return Q(W,K,q)});return Q(H,K,q)}let G=$._zod.parse(K,q);if(G instanceof Promise){if(q.async===!1)throw new Q8;return G.then((H)=>J(H,Y,q))}return J(G,Y,q)}}a0($,"~standard",()=>({validate:(J)=>{try{let Q=OI($,J);return Q.success?{value:Q.data}:{issues:Q.error?.issues}}catch(Q){return pJ($,J).then((K)=>K.success?{value:K.data}:{issues:K.error?.issues})}},vendor:"zod",version:1}))}),z7=o("$ZodString",($,I)=>{i0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??QN($._zod.bag),$._zod.parse=(U,Y)=>{if(I.coerce)try{U.value=String(U.value)}catch(J){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),S1=o("$ZodStringFormat",($,I)=>{FI.init($,I),z7.init($,I)}),gN=o("$ZodGUID",($,I)=>{I.pattern??(I.pattern=dO),S1.init($,I)}),yN=o("$ZodUUID",($,I)=>{if(I.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(Y===void 0)throw Error(`InvalidUUIDversion:"${I.version}"`);I.pattern??(I.pattern=M7(Y))}else I.pattern??(I.pattern=M7());S1.init($,I)}),hN=o("$ZodEmail",($,I)=>{I.pattern??(I.pattern=mO),S1.init($,I)}),xN=o("$ZodURL",($,I)=>{S1.init($,I),$._zod.check=(U)=>{try{let Y=U.value.trim();if(!I.normalize&&I.protocol?.source===$N.source){if(!/^https?:\/\//i.test(Y)){U.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:U.value,inst:$,continue:!I.abort});return}}let J=new URL(Y);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(J.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=J.href;else U.value=Y;return}catch(Y){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),kN=o("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=lO()),S1.init($,I)}),uN=o("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=nO),S1.init($,I)}),fN=o("$ZodCUID",($,I)=>{I.pattern??(I.pattern=uO),S1.init($,I)}),bN=o("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=fO),S1.init($,I)}),iN=o("$ZodULID",($,I)=>{I.pattern??(I.pattern=bO),S1.init($,I)}),pN=o("$ZodXID",($,I)=>{I.pattern??(I.pattern=iO),S1.init($,I)}),nN=o("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=pO),S1.init($,I)}),cN=o("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=JN(I)),S1.init($,I)}),dN=o("$ZodISODate",($,I)=>{I.pattern??(I.pattern=UN),S1.init($,I)}),mN=o("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=YN(I)),S1.init($,I)}),lN=o("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=cO),S1.init($,I)}),oN=o("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=oO),S1.init($,I),$._zod.bag.format="ipv4"}),rN=o("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=rO),S1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),tN=o("$ZodMAC",($,I)=>{I.pattern??(I.pattern=tO(I.delimiter)),S1.init($,I),$._zod.bag.format="mac"}),aN=o("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=aO),S1.init($,I)}),sN=o("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=sO),S1.init($,I),$._zod.check=(U)=>{let Y=U.value.split("/");try{if(Y.length!==2)throw Error();let[J,Q]=Y;if(!Q)throw Error();let K=Number(Q);if(`${K}`!==Q)throw Error();if(K<0||K>128)throw Error();new URL(`http://[${J}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function eN($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}
Line truncated
if(${T}.issues.length){
`))}}var gO={major:4,minor:4,patch:3};var i0=o("$ZodType",($,I)=>{var U;$??($={}),$._zod.def=I,$._zod.bag=$._zod.bag||{},$._zod.version=gO;let Y=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Y.unshift($);for(let J of Y)for(let Q of J._zod.onattach)Q($);if(Y.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let J=(K,q,G)=>{let H=o5(K),W;for(let V of q){if(V._zod.def.when){if(kD(K))continue;if(!V._zod.def.when(K))continue}else if(H)continue;let z=K.issues.length,Z=V._zod.check(K);if(Z instanceof Promise&&G?.async===!1)throw new Q8;if(W||Z instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await Z,K.issues.length===z)return;if(!H)H=o5(K,z)});else{if(K.issues.length===z)continue;if(!H)H=o5(K,z)}}if(W)return W.then(()=>{return K});return K},Q=(K,q,G)=>{if(o5(K))return K.aborted=!0,K;let H=J(q,Y,G);if(H instanceof Promise){if(G.async===!1)throw new Q8;return H.then((W)=>$._zod.parse(W,G))}return $._zod.parse(H,G)};$._zod.run=(K,q)=>{if(q.skipChecks)return $._zod.parse(K,q);if(q.direction==="backward"){let H=$._zod.parse({value:K.value,issues:[]},{...q,skipChecks:!0});if(H instanceof Promise)return H.then((W)=>{return Q(W,K,q)});return Q(H,K,q)}let G=$._zod.parse(K,q);if(G instanceof Promise){if(q.async===!1)throw new Q8;return G.then((H)=>J(H,Y,q))}return J(G,Y,q)}}s0($,"~standard",()=>({validate:(J)=>{try{let Q=OI($,J);return Q.success?{value:Q.data}:{issues:Q.error?.issues}}catch(Q){return pJ($,J).then((K)=>K.success?{value:K.data}:{issues:K.error?.issues})}},vendor:"zod",version:1}))}),A7=o("$ZodString",($,I)=>{i0.init($,I),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??qO($._zod.bag),$._zod.parse=(U,Y)=>{if(I.coerce)try{U.value=String(U.value)}catch(J){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),S1=o("$ZodStringFormat",($,I)=>{FI.init($,I),A7.init($,I)}),hO=o("$ZodGUID",($,I)=>{I.pattern??(I.pattern=lD),S1.init($,I)}),xO=o("$ZodUUID",($,I)=>{if(I.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[I.version];if(Y===void 0)throw Error(`InvalidUUIDversion:"${I.version}"`);I.pattern??(I.pattern=M7(Y))}else I.pattern??(I.pattern=M7());S1.init($,I)}),kO=o("$ZodEmail",($,I)=>{I.pattern??(I.pattern=oD),S1.init($,I)}),uO=o("$ZodURL",($,I)=>{S1.init($,I),$._zod.check=(U)=>{try{let Y=U.value.trim();if(!I.normalize&&I.protocol?.source===UO.source){if(!/^https?:\/\//i.test(Y)){U.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:U.value,inst:$,continue:!I.abort});return}}let J=new URL(Y);if(I.hostname){if(I.hostname.lastIndex=0,!I.hostname.test(J.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:I.hostname.source,input:U.value,inst:$,continue:!I.abort})}if(I.protocol){if(I.protocol.lastIndex=0,!I.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:I.protocol.source,input:U.value,inst:$,continue:!I.abort})}if(I.normalize)U.value=J.href;else U.value=Y;return}catch(Y){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!I.abort})}}}),fO=o("$ZodEmoji",($,I)=>{I.pattern??(I.pattern=rD()),S1.init($,I)}),bO=o("$ZodNanoID",($,I)=>{I.pattern??(I.pattern=dD),S1.init($,I)}),iO=o("$ZodCUID",($,I)=>{I.pattern??(I.pattern=bD),S1.init($,I)}),nO=o("$ZodCUID2",($,I)=>{I.pattern??(I.pattern=iD),S1.init($,I)}),pO=o("$ZodULID",($,I)=>{I.pattern??(I.pattern=nD),S1.init($,I)}),cO=o("$ZodXID",($,I)=>{I.pattern??(I.pattern=pD),S1.init($,I)}),dO=o("$ZodKSUID",($,I)=>{I.pattern??(I.pattern=cD),S1.init($,I)}),mO=o("$ZodISODateTime",($,I)=>{I.pattern??(I.pattern=KO(I)),S1.init($,I)}),lO=o("$ZodISODate",($,I)=>{I.pattern??(I.pattern=JO),S1.init($,I)}),oO=o("$ZodISOTime",($,I)=>{I.pattern??(I.pattern=QO(I)),S1.init($,I)}),rO=o("$ZodISODuration",($,I)=>{I.pattern??(I.pattern=mD),S1.init($,I)}),tO=o("$ZodIPv4",($,I)=>{I.pattern??(I.pattern=tD),S1.init($,I),$._zod.bag.format="ipv4"}),aO=o("$ZodIPv6",($,I)=>{I.pattern??(I.pattern=aD),S1.init($,I),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!I.abort})}}}),sO=o("$ZodMAC",($,I)=>{I.pattern??(I.pattern=sD(I.delimiter)),S1.init($,I),$._zod.bag.format="mac"}),eO=o("$ZodCIDRv4",($,I)=>{I.pattern??(I.pattern=eD),S1.init($,I)}),$N=o("$ZodCIDRv6",($,I)=>{I.pattern??(I.pattern=$O),S1.init($,I),$._zod.check=(U)=>{let Y=U.value.split("/");try{if(Y.length!==2)throw Error();let[J,Q]=Y;if(!Q)throw Error();let K=Number(Q);if(`${K}`!==Q)throw Error();if(K<0||K>128)throw Error();new URL(`http://[${J}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!I.abort})}}});function IN($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}
Line truncated
`)}Z.write("payload.value = newResult;"),Z.write("return payload;");let E=Z.compile();return(A,T)=>E(X,A,T)},Q,K=F7,q=!O7.jitless,H=q&&CO.value,W=I.catchall,V;$._zod.parse=(X,Z)=>{V??(V=Y.value);let w=X.value;if(!K(w))return X.issues.push({expected:"object",code:"invalid_type",input:w,inst:$}),X;if(q&&H&&Z?.async===!1&&Z.jitless!==!0){if(!Q)Q=J(I.shape);if(X=Q(X,Z),!W)return X;return kk([],w,X,Z,V,$)}return U(X,Z)}});function zk($,I,U,Y){for(let Q of $)if(Q.issues.length===0)return I.value=Q.value,I;let J=$.filter((Q)=>!o5(Q));if(J.length===1)return I.value=J[0].value,J[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((Q)=>Q.issues.map((K)=>A6(K,Y,Z4())))}),I}var lJ=o("$ZodUnion",($,I)=>{i0.init($,I),a0($._zod,"optin",()=>I.options.some((Y)=>Y._zod.optin==="optional")?"optional":void 0),a0($._zod,"optout",()=>I.options.some((Y)=>Y._zod.optout==="optional")?"optional":void 0),a0($._zod,"values",()=>{if(I.options.every((Y)=>Y._zod.values))return new Set(I.options.flatMap((Y)=>Array.from(Y._zod.values)));return}),a0($._zod,"pattern",()=>{if(I.options.every((Y)=>Y._zod.pattern)){let Y=I.options.map((J)=>J._zod.pattern);return new RegExp(`^(${Y.map((J)=>gJ(J.source)).join("|")})$`)}return});let U=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(Y,J)=>{if(U)return U(Y,J);let Q=!1,K=[];for(let q of I.options){let G=q._zod.run({value:Y.value,issues:[]},J);if(G instanceof Promise)K.push(G),Q=!0;else{if(G.issues.length===0)return G;K.push(G)}}if(!Q)return zk(K,Y,$,J);return Promise.all(K).then((q)=>{return zk(q,Y,$,J)})}});function Ak($,I,U,Y){let J=$.filter((Q)=>Q.issues.length===0);if(J.length===1)return I.value=J[0].value,I;if(J.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((Q)=>Q.issues.map((K)=>A6(K,Y,Z4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var OF=o("$ZodXor",($,I)=>{lJ.init($,I),I.inclusive=!1;let U=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(Y,J)=>{if(U)return U(Y,J);let Q=!1,K=[];for(let q of I.options){let G=q._zod.run({value:Y.value,issues:[]},J);if(G instanceof Promise)K.push(G),Q=!0;else K.push(G)}if(!Q)return Ak(K,Y,$,J);return Promise.all(K).then((q)=>{return Ak(q,Y,$,J)})}}),NF=o("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,lJ.init($,I);let U=$._zod.parse;a0($._zod,"propValues",()=>{let J={};for(let Q of I.options){let K=Q._zod.propValues;if(!K||Object.keys(K).length===0)throw Error(`Invaliddiscriminatedunionoptionatindex"${I.options.indexOf(Q)}"`);for(let[q,G]of Object.entries(K)){if(!J[q])J[q]=new Set;for(let H of G)J[q].add(H)}}return J});let Y=ZI(()=>{let J=I.options,Q=new Map;for(let K of J){let q=K._zod.propValues?.[I.discriminator];if(!q||q.size===0)throw Error(`Invaliddiscriminatedunionoptionatindex"${I.options.indexOf(K)}"`);for(let G of q){if(Q.has(G))throw Error(`Duplicatediscriminatorvalue"${String(G)}"`);Q.set(G,K)}}return Q});$._zod.parse=(J,Q)=>{let K=J.value;if(!F7(K))return J.issues.push({code:"invalid_type",expected:"object",input:K,inst:$}),J;let q=Y.value.get(K?.[I.discriminator]);if(q)return q._zod.run(J,Q);if(I.unionFallback||Q.direction==="backward")return U(J,Q);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(Y.value.keys()),input:K,path:[I.discriminator],inst:$}),J}}),FF=o("$ZodIntersection",($,I)=>{i0.init($,I),$._zod.parse=(U,Y)=>{let J=U.value,Q=I.left._zod.run({value:J,issues:[]},Y),K=I.right._zod.run({value:J,issues:[]},Y);if(Q instanceof Promise||K instanceof Promise)return Promise.all([Q,K]).then(([G,H])=>{return Pk(U,G,H)});return Pk(U,Q,K)}});function SN($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(l5($)&&l5(I)){let U=Object.keys(I),Y=Object.keys($).filter((Q)=>U.indexOf(Q)!==-1),J={...$,...I};for(let Q of Y){let K=SN($[Q],I[Q]);if(!K.valid)return{valid:!1,mergeErrorPath:[Q,...K.mergeErrorPath]};J[Q]=K.data}return{valid:!0,data:J}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let Y=0;Y<$.length;Y++){let J=$[Y],Q=I[Y],K=SN(J,Q);if(!K.valid)return{valid:!1,mergeErrorPath:[Y,...K.mergeErrorPath]};U.push(K.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function Pk($,I,U){let Y=new Map,J;for(let q of I.issues)if(q.code==="unrecognized_keys"){J??(J=q);for(let G of q.keys){if(!Y.has(G))Y.set(G,{});Y.get(G).l=!0}}else $.issues.push(q);for(let q of U.issues)if(q.code==="unrecognized_keys")for(let G of q.keys){if(!Y.has(G))Y.set(G,{});Y.get(G).r=!0}else $.issues.push(q);let Q=[...Y].filter(([,q])=>q.l&&q.r).map(([q])=>q);if(Q.length&&J)$.issues.push({...J,keys:Q});if(o5($))return $;let K=SN(I.value,U.value);if(!K.valid)throw Error(`Unmergableintersection.Errorpath:${JSON.stringify(K.mergeErrorPath)}`);return $.value=K.data,$}var IH=o("$ZodTuple",($,I)=>{i0.
Line truncated
`)}Z.write("payload.value = newResult;"),Z.write("return payload;");let E=Z.compile();return(T,A)=>E(z,T,A)},Q,K=F7,q=!O7.jitless,H=q&&_D.value,W=I.catchall,V;$._zod.parse=(z,Z)=>{V??(V=Y.value);let w=z.value;if(!K(w))return z.issues.push({expected:"object",code:"invalid_type",input:w,inst:$}),z;if(q&&H&&Z?.async===!1&&Z.jitless!==!0){if(!Q)Q=J(I.shape);if(z=Q(z,Z),!W)return z;return nk([],w,z,Z,V,$)}return U(z,Z)}});function Bk($,I,U,Y){for(let Q of $)if(Q.issues.length===0)return I.value=Q.value,I;let J=$.filter((Q)=>!o5(Q));if(J.length===1)return I.value=J[0].value,J[0];return I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((Q)=>Q.issues.map((K)=>A6(K,Y,Z4())))}),I}var oJ=o("$ZodUnion",($,I)=>{i0.init($,I),s0($._zod,"optin",()=>I.options.some((Y)=>Y._zod.optin==="optional")?"optional":void 0),s0($._zod,"optout",()=>I.options.some((Y)=>Y._zod.optout==="optional")?"optional":void 0),s0($._zod,"values",()=>{if(I.options.every((Y)=>Y._zod.values))return new Set(I.options.flatMap((Y)=>Array.from(Y._zod.values)));return}),s0($._zod,"pattern",()=>{if(I.options.every((Y)=>Y._zod.pattern)){let Y=I.options.map((J)=>J._zod.pattern);return new RegExp(`^(${Y.map((J)=>yJ(J.source)).join("|")})$`)}return});let U=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(Y,J)=>{if(U)return U(Y,J);let Q=!1,K=[];for(let q of I.options){let G=q._zod.run({value:Y.value,issues:[]},J);if(G instanceof Promise)K.push(G),Q=!0;else{if(G.issues.length===0)return G;K.push(G)}}if(!Q)return Bk(K,Y,$,J);return Promise.all(K).then((q)=>{return Bk(q,Y,$,J)})}});function Rk($,I,U,Y){let J=$.filter((Q)=>Q.issues.length===0);if(J.length===1)return I.value=J[0].value,I;if(J.length===0)I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:$.map((Q)=>Q.issues.map((K)=>A6(K,Y,Z4())))});else I.issues.push({code:"invalid_union",input:I.value,inst:U,errors:[],inclusive:!1});return I}var NN=o("$ZodXor",($,I)=>{oJ.init($,I),I.inclusive=!1;let U=I.options.length===1?I.options[0]._zod.run:null;$._zod.parse=(Y,J)=>{if(U)return U(Y,J);let Q=!1,K=[];for(let q of I.options){let G=q._zod.run({value:Y.value,issues:[]},J);if(G instanceof Promise)K.push(G),Q=!0;else K.push(G)}if(!Q)return Rk(K,Y,$,J);return Promise.all(K).then((q)=>{return Rk(q,Y,$,J)})}}),FN=o("$ZodDiscriminatedUnion",($,I)=>{I.inclusive=!1,oJ.init($,I);let U=$._zod.parse;s0($._zod,"propValues",()=>{let J={};for(let Q of I.options){let K=Q._zod.propValues;if(!K||Object.keys(K).length===0)throw Error(`Invaliddiscriminatedunionoptionatindex"${I.options.indexOf(Q)}"`);for(let[q,G]of Object.entries(K)){if(!J[q])J[q]=new Set;for(let H of G)J[q].add(H)}}return J});let Y=zI(()=>{let J=I.options,Q=new Map;for(let K of J){let q=K._zod.propValues?.[I.discriminator];if(!q||q.size===0)throw Error(`Invaliddiscriminatedunionoptionatindex"${I.options.indexOf(K)}"`);for(let G of q){if(Q.has(G))throw Error(`Duplicatediscriminatorvalue"${String(G)}"`);Q.set(G,K)}}return Q});$._zod.parse=(J,Q)=>{let K=J.value;if(!F7(K))return J.issues.push({code:"invalid_type",expected:"object",input:K,inst:$}),J;let q=Y.value.get(K?.[I.discriminator]);if(q)return q._zod.run(J,Q);if(I.unionFallback||Q.direction==="backward")return U(J,Q);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:I.discriminator,options:Array.from(Y.value.keys()),input:K,path:[I.discriminator],inst:$}),J}}),MN=o("$ZodIntersection",($,I)=>{i0.init($,I),$._zod.parse=(U,Y)=>{let J=U.value,Q=I.left._zod.run({value:J,issues:[]},Y),K=I.right._zod.run({value:J,issues:[]},Y);if(Q instanceof Promise||K instanceof Promise)return Promise.all([Q,K]).then(([G,H])=>{return vk(U,G,H)});return vk(U,Q,K)}});function yO($,I){if($===I)return{valid:!0,data:$};if($ instanceof Date&&I instanceof Date&&+$===+I)return{valid:!0,data:$};if(l5($)&&l5(I)){let U=Object.keys(I),Y=Object.keys($).filter((Q)=>U.indexOf(Q)!==-1),J={...$,...I};for(let Q of Y){let K=yO($[Q],I[Q]);if(!K.valid)return{valid:!1,mergeErrorPath:[Q,...K.mergeErrorPath]};J[Q]=K.data}return{valid:!0,data:J}}if(Array.isArray($)&&Array.isArray(I)){if($.length!==I.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let Y=0;Y<$.length;Y++){let J=$[Y],Q=I[Y],K=yO(J,Q);if(!K.valid)return{valid:!1,mergeErrorPath:[Y,...K.mergeErrorPath]};U.push(K.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function vk($,I,U){let Y=new Map,J;for(let q of I.issues)if(q.code==="unrecognized_keys"){J??(J=q);for(let G of q.keys){if(!Y.has(G))Y.set(G,{});Y.get(G).l=!0}}else $.issues.push(q);for(let q of U.issues)if(q.code==="unrecognized_keys")for(let G of q.keys){if(!Y.has(G))Y.set(G,{});Y.get(G).r=!0}else $.issues.push(q);let Q=[...Y].filter(([,q])=>q.l&&q.r).map(([q])=>q);if(Q.length&&J)$.issues.push({...J,keys:Q});if(o5($))return $;let K=yO(I.value,U.value);if(!K.valid)throw Error(`Unmergableintersection.Errorpath:${JSON.stringify(K.mergeErrorPath)}`);return $.value=K.data,$}var YH=o("$ZodTuple",($,I)=>{i0.
Line truncated
Setthe\`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(letKof$.seen.entries()){letq=K[1];if(I===K[0]){Q(K);continue}if($.external){letH=$.external.registry.get(K[0])?.id;if(I!==K[0]&&H){Q(K);continue}}if($.metadataRegistry.get(K[0])?.id){Q(K);continue}if(q.cycle){Q(K);continue}if(q.count>1){if($.reused==="ref"){Q(K);continue}}}}functione5($,I){letU=$.seen.get(I);if(!U)throwError("Unprocessed schema. This is a bug in Zod.");letY=(q)=>{letG=$.seen.get(q);if(G.ref===null)return;letH=G.def??G.schema,W={...H},V=G.ref;if(G.ref=null,V){Y(V);letZ=$.seen.get(V),w=Z.schema;if(w.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))H.allOf=H.allOf??[],H.allOf.push(w);elseObject.assign(H,w);if(Object.assign(H,W),q._zod.parent===V)for(letOinH){if(O==="$ref"||O==="allOf")continue;if(!(OinW))deleteH[O]}if(w.$ref&&Z.def)for(letOinH){if(O==="$ref"||O==="allOf")continue;if(OinZ.def&&JSON.stringify(H[O])===JSON.stringify(Z.def[O]))deleteH[O]}}letX=q._zod.parent;if(X&&X!==V){Y(X);letZ=$.seen.get(X);if(Z?.schema.$ref){if(H.$ref=Z.schema.$ref,Z.def)for(letwinH){if(w==="$ref"||w==="allOf")continue;if(winZ.def&&JSON.stringify(H[w])===JSON.stringify(Z.def[w]))deleteH[w]}}}$.override({zodSchema:q,jsonSchema:H,path:G.path??[]})};for(letqof[...$.seen.entries()].reverse())Y(q[0]);letJ={};if($.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";elseif($.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";elseif($.target==="draft-04")J.$schema="http://json-schema.org/draft-04/schema#";elseif($.target==="openapi-3.0");if($.external?.uri){letq=$.external.registry.get(I)?.id;if(!q)throwError("Schema is missing an `id` property");J.$id=$.external.uri(q)}Object.assign(J,U.def??U.schema);letQ=$.metadataRegistry.get(I)?.id;if(Q!==void0&&J.id===Q)deleteJ.id;letK=$.external?.defs??{};for(letqof$.seen.entries()){letG=q[1];if(G.def&&G.defId){if(G.def.id===G.defId)deleteG.def.id;K[G.defId]=G.def}}if($.external);elseif(Object.keys(K).length>0)if($.target==="draft-2020-12")J.$defs=K;elseJ.definitions=K;try{letq=JSON.parse(JSON.stringify(J));returnObject.defineProperty(q,"~standard",{value:{...I["~standard"],jsonSchema:{input:yI(I,"input",$.processors),output:yI(I,"output",$.processors)}},enumerable:!1,writable:!1}),q}catch(q){throwError("Error converting schema to JSON.")}}functionT6($,I){letU=I??{seen:newSet};if(U.seen.has($))return!1;U.seen.add($);letY=$._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")returnT6(Y.element,U);if(Y.type==="set")returnT6(Y.valueType,U);if(Y.type==="lazy")returnT6(Y.getter(),U);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")returnT6(Y.innerType,U);if(Y.type==="intersection")returnT6(Y.left,U)||T6(Y.right,U);if(Y.type==="record"||Y.type==="map")returnT6(Y.keyType,U)||T6(Y.valueType,U);if(Y.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;returnT6(Y.in,U)||T6(Y.out,U)}if(Y.type==="object"){for(letJinY.shape)if(T6(Y.shape[J],U))return!0;return!1}if(Y.type==="union"){for(letJofY.options)if(T6(J,U))return!0;return!1}if(Y.type==="tuple"){for(letJofY.items)if(T6(J,U))return!0;if(Y.rest&&T6(Y.rest,U))return!0;return!1}return!1}varEz=($,I={})=>(U)=>{letY=a5({...U,processors:I});returnC1($,Y),s5(Y,$),e5(Y,$)},yI=($,I,U={})=>(Y)=>{let{libraryOptions:J,target:Q}=Y??{},K=a5({...J??{},target:Q,io:I,processors:U});returnC1($,K),s5(K,$),e5(K,$)};varvO0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Bz=($,I,U,Y)=>{letJ=U;J.type="string";let{minimum:Q,maximum:K,format:q,patterns:G,contentEncoding:H}=$._zod.bag;if(typeofQ==="number")J.minLength=Q;if(typeofK==="number")J.maxLength=K;if(q){if(J.format=vO0[q]??q,J.format==="")deleteJ.format;if(q==="time")deleteJ.format}if(H)J.contentEncoding=H;if(G&&G.size>0){letW=[...G];if(W.length===1)J.pattern=W[0].source;elseif(W.length>1)J.allOf=[...W.map((V)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:V.source}))]}},Rz=($,I,U,Y)=>{letJ=U,{minimum:Q,maximum:K,format:q,multipleOf:G,exclusiveMaximum:H,exclusiveMinimum:W}=$._zod.bag;if(typeofq==="string"&&q.includes("int"))J.type="integer";elseJ.type="number";letV=typeofW==="number"&&W>=(Q??Number.NEGATIVE_INFINITY),X=typeofH==="number"&&H<=(K??Number.POSITIVE_INFINITY),Z=I.target==="draft-04"||I.target==="openapi-3.0";if(V)if(Z)J.minimum=W,J.exclusiveMinimum=!0;elseJ.exclusiveMinimum=W;elseif(typeofQ==="number")J.minimum=Q;if(X)if(Z)J.maximum=H,J.exclusiveMaximum=!0;elseJ.exclusiveMaximum=H;elseif(typeofK==="number")J.maximum=K;if(typeofG==="number")J.multipleOf=G},vz=($,I,U,Y)=>{U.type="boolean"},Cz=($,I,U,Y)=>{if(I.unrepresentable==="throw")throwError("BigInt cannot be represented in JSON Schema")},jz=($,I,U,Y)=>{if(I.unrepresentable==Line truncated
Setthe\`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(letKof$.seen.entries()){letq=K[1];if(I===K[0]){Q(K);continue}if($.external){letH=$.external.registry.get(K[0])?.id;if(I!==K[0]&&H){Q(K);continue}}if($.metadataRegistry.get(K[0])?.id){Q(K);continue}if(q.cycle){Q(K);continue}if(q.count>1){if($.reused==="ref"){Q(K);continue}}}}functione5($,I){letU=$.seen.get(I);if(!U)throwError("Unprocessed schema. This is a bug in Zod.");letY=(q)=>{letG=$.seen.get(q);if(G.ref===null)return;letH=G.def??G.schema,W={...H},V=G.ref;if(G.ref=null,V){Y(V);letZ=$.seen.get(V),w=Z.schema;if(w.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))H.allOf=H.allOf??[],H.allOf.push(w);elseObject.assign(H,w);if(Object.assign(H,W),q._zod.parent===V)for(letDinH){if(D==="$ref"||D==="allOf")continue;if(!(DinW))deleteH[D]}if(w.$ref&&Z.def)for(letDinH){if(D==="$ref"||D==="allOf")continue;if(DinZ.def&&JSON.stringify(H[D])===JSON.stringify(Z.def[D]))deleteH[D]}}letz=q._zod.parent;if(z&&z!==V){Y(z);letZ=$.seen.get(z);if(Z?.schema.$ref){if(H.$ref=Z.schema.$ref,Z.def)for(letwinH){if(w==="$ref"||w==="allOf")continue;if(winZ.def&&JSON.stringify(H[w])===JSON.stringify(Z.def[w]))deleteH[w]}}}$.override({zodSchema:q,jsonSchema:H,path:G.path??[]})};for(letqof[...$.seen.entries()].reverse())Y(q[0]);letJ={};if($.target==="draft-2020-12")J.$schema="https://json-schema.org/draft/2020-12/schema";elseif($.target==="draft-07")J.$schema="http://json-schema.org/draft-07/schema#";elseif($.target==="draft-04")J.$schema="http://json-schema.org/draft-04/schema#";elseif($.target==="openapi-3.0");if($.external?.uri){letq=$.external.registry.get(I)?.id;if(!q)throwError("Schema is missing an `id` property");J.$id=$.external.uri(q)}Object.assign(J,U.def??U.schema);letQ=$.metadataRegistry.get(I)?.id;if(Q!==void0&&J.id===Q)deleteJ.id;letK=$.external?.defs??{};for(letqof$.seen.entries()){letG=q[1];if(G.def&&G.defId){if(G.def.id===G.defId)deleteG.def.id;K[G.defId]=G.def}}if($.external);elseif(Object.keys(K).length>0)if($.target==="draft-2020-12")J.$defs=K;elseJ.definitions=K;try{letq=JSON.parse(JSON.stringify(J));returnObject.defineProperty(q,"~standard",{value:{...I["~standard"],jsonSchema:{input:hI(I,"input",$.processors),output:hI(I,"output",$.processors)}},enumerable:!1,writable:!1}),q}catch(q){throwError("Error converting schema to JSON.")}}functionT6($,I){letU=I??{seen:newSet};if(U.seen.has($))return!1;U.seen.add($);letY=$._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")returnT6(Y.element,U);if(Y.type==="set")returnT6(Y.valueType,U);if(Y.type==="lazy")returnT6(Y.getter(),U);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")returnT6(Y.innerType,U);if(Y.type==="intersection")returnT6(Y.left,U)||T6(Y.right,U);if(Y.type==="record"||Y.type==="map")returnT6(Y.keyType,U)||T6(Y.valueType,U);if(Y.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;returnT6(Y.in,U)||T6(Y.out,U)}if(Y.type==="object"){for(letJinY.shape)if(T6(Y.shape[J],U))return!0;return!1}if(Y.type==="union"){for(letJofY.options)if(T6(J,U))return!0;return!1}if(Y.type==="tuple"){for(letJofY.items)if(T6(J,U))return!0;if(Y.rest&&T6(Y.rest,U))return!0;return!1}return!1}varRM=($,I={})=>(U)=>{letY=a5({...U,processors:I});returnC1($,Y),s5(Y,$),e5(Y,$)},hI=($,I,U={})=>(Y)=>{let{libraryOptions:J,target:Q}=Y??{},K=a5({...J??{},target:Q,io:I,processors:U});returnC1($,K),s5(K,$),e5(K,$)};varxD0={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vM=($,I,U,Y)=>{letJ=U;J.type="string";let{minimum:Q,maximum:K,format:q,patterns:G,contentEncoding:H}=$._zod.bag;if(typeofQ==="number")J.minLength=Q;if(typeofK==="number")J.maxLength=K;if(q){if(J.format=xD0[q]??q,J.format==="")deleteJ.format;if(q==="time")deleteJ.format}if(H)J.contentEncoding=H;if(G&&G.size>0){letW=[...G];if(W.length===1)J.pattern=W[0].source;elseif(W.length>1)J.allOf=[...W.map((V)=>({...I.target==="draft-07"||I.target==="draft-04"||I.target==="openapi-3.0"?{type:"string"}:{},pattern:V.source}))]}},CM=($,I,U,Y)=>{letJ=U,{minimum:Q,maximum:K,format:q,multipleOf:G,exclusiveMaximum:H,exclusiveMinimum:W}=$._zod.bag;if(typeofq==="string"&&q.includes("int"))J.type="integer";elseJ.type="number";letV=typeofW==="number"&&W>=(Q??Number.NEGATIVE_INFINITY),z=typeofH==="number"&&H<=(K??Number.POSITIVE_INFINITY),Z=I.target==="draft-04"||I.target==="openapi-3.0";if(V)if(Z)J.minimum=W,J.exclusiveMinimum=!0;elseJ.exclusiveMinimum=W;elseif(typeofQ==="number")J.minimum=Q;if(z)if(Z)J.maximum=H,J.exclusiveMaximum=!0;elseJ.exclusiveMaximum=H;elseif(typeofK==="number")J.maximum=K;if(typeofG==="number")J.multipleOf=G},jM=($,I,U,Y)=>{U.type="boolean"},_M=($,I,U,Y)=>{if(I.unrepresentable==="throw")throwError("BigInt cannot be represented in JSON Schema")},SM=($,I,U,Y)=>{if(I.unrepresentable==Line truncated
`)}return{warnings:[],results:K}}function II($){return{fileBuffer:aK1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}import{existsSync as Iq1}from"node:fs";async function rD($,I,U={}){let J=D4().stateful?"stateful":"stateless",Q="ok",K,q,G;try{let A=await F$($);G={id:A.user.id,name:A.user.name,isAdmin:A.user.isAdmin},q={id:A.tenant.id,name:A.tenant.name,tenantSlug:A.tenant.tenantSlug,corporationName:A.tenant.hoseCorpConfig?.corporationName}}catch(A){Q="error",K=A instanceof Error?A.message:String(A)}let H=[];if(Q==="ok")try{H=await Z9($,I.seal.endpoints.approvalStylePreferences)}catch(A){Q="error",K=`读取Webhook配置失败:${AinstanceofError?A.message:String(A)}`}let W=H.length===1,V=H.map((A)=>({id:A.id,name:A.name,mode:A.mode,incomingDocumentWebhookUrl:A.incomingDocumentWebhook.url,outgoingResultWebhookUrl:A.outgoingResultWebhook,autoApprovalRate:A.autoApprovalRate,...W?{isDefault:!0}:{}})),X=W?{id:H[0].id,name:H[0].name,mode:H[0].mode}:null,Z;if(U.filePath)if(!Iq1(U.filePath))Z={valid:!1,filePath:U.filePath,fileName:U.filePath.split(/[\\/]/).pop()??U.filePath,documentCount:0,errors:[`文件不存在:${U.filePath}`]};else try{let A=II(U.filePath),T=await $I(A.fileBuffer,A.fileName);Z={valid:!0,filePath:U.filePath,fileName:A.fileName,documentCount:T.documents.length,warnings:T.warnings}}catch(A){Z={valid:!1,filePath:U.filePath,fileName:U.filePath.split(/[\\/]/).pop()??U.filePath,documentCount:0,errors:[A instanceof Error?A.message:String(A)]}}let w=Z?Z.valid:!0,D=Q==="ok"&&V.length>0&&w,O=J==="stateful"?"":`--corp${I.id}`,F="",E="";if(Q!=="ok")E=`凭证鉴权异常:${K}`,F=`seal-useauthdiagnose${O}`;else if(V.length===0)E="当前企业尚未配置任何 Webhook 集成通道",F=`seal-usewebhookadd--name"默认入站通道"--result-url"https://your-domain.com/callback"${O}`;else if(Z&&!Z.valid)E=`材料包预检失败:${Z.errors?.join("; ")}`,F=`seal-usewebhookmaterial-packpreview${Z.filePath}${O}`;else{E=W?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到${V.length}个Webhook通道,等待载入`;let A=Z?.filePath??"<材料包.zip>",T=W?"":`--webhook${X?X.id:"<webhookIdOrName>"}`;F=`seal-usewebhookmaterial-packpush${A}${T}${O}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:q,user:G},stateMode:J,authStatus:Q,authError:K,activeWebhooks:V,defaultWebhook:X,materialPack:Z,statusMessage:E,nextAction:F}}var YG=[{name:"seal_whoami",description:"查询当前 Seal 用户身份及租户信息",parameters:L.object({}),handler:async($)=>F$($)},{name:"seal_session_get",description:"查询当前 Seal Bearer session、用户和过期时间",parameters:L.object({}),handler:async($)=>jd($)},{name:"seal_delegation_list",description:"查询当前 Seal 租户下的授权链接 (Delegation) 列表",parameters:L.object({}),handler:async($)=>$m($)},{name:"seal_delegation_create",description:"创建新的 Seal 授权链接 (Delegation)",parameters:L.object({note:L.string().optional().describe("授权链接的备注或说明信息")}),handler:async($,I)=>XU($,I)},{name:"seal_delegation_revoke",description:"撤销/废除指定的 Seal 授权链接 (Delegation)",parameters:L.object({tokenId:L.string().describe("授权链接 ID (delegation record ID)")}),handler:async($,I)=>Im($,I.tokenId)},{name:"seal_user_create",description:"创建本地 Seal 用户,生成并返回初始随机密码",parameters:L.object({name:L.string().describe("用户姓名"),phone:L.string().describe("手机号码 (例如 13300001111 或 +8613300001111)"),permissions:L.array(L.string()).optional().describe("权限列表,默认为 []"),departmentIds:L.array(L.string()).optional().describe("关联部门 ID 数组")}),handler:async($,I)=>Um($,I)},{name:"seal_user_reset_password",description:"重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",parameters:L.object({userId:L.string().describe("用户 ID (_id)")}),handler:async($,I)=>ME($,I.userId)},{name:"seal_user_get",description:"获取指定 Seal 用户的详细信息",parameters:L.object({userId:L.string().describe("用户 ID (_id)")}),handler:async($,I)=>RV($,I.userId)},{name:"seal_user_search",description:"按姓名、手机号或邮箱搜索 Seal 成员用户列表",parameters:L.object({keyword:L.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")}),handler:async($,I)=>vV($,I.keyword??"")},{name:"seal_user_delete",description:"删除指定 Seal 本地用户",parameters:L.object({userId:L.string().describe("用户 ID (_id)")}),handler:async($,I)=>Ym($,I.userId)},{name:"seal_user_activate",description:"启用/激活已离职的 Seal 用户账号",parameters:L.object({userId:L.string().describe("用户 ID (_id)")}),handler:async($,I)=>zE($,I.userId)},{name:"seal_user_delegation_create",description:"为指定 Seal 用户(按用户ID、手机号或姓名)重置密码登录
Line truncated
`)}return{warnings:[],results:K}}function UI($){return{fileBuffer:qq1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}import{existsSync as Vq1}from"node:fs";async function aL($,I,U={}){let J=L4().stateful?"stateful":"stateless",Q="ok",K,q,G;try{let A=await N$($);G={id:A.user.id,name:A.user.name,isAdmin:A.user.isAdmin},q={id:A.tenant.id,name:A.tenant.name,tenantSlug:A.tenant.tenantSlug,corporationName:A.tenant.hoseCorpConfig?.corporationName}}catch(A){Q="error",K=A instanceof Error?A.message:String(A)}let H=[];if(Q==="ok")try{H=await Z9($,I.seal.endpoints.approvalStylePreferences)}catch(A){Q="error",K=`读取Webhook配置失败:${AinstanceofError?A.message:String(A)}`}let W=H.length===1,V=H.map((A)=>({id:A.id,name:A.name,mode:A.mode,incomingDocumentWebhookUrl:A.incomingDocumentWebhook.url,outgoingResultWebhookUrl:A.outgoingResultWebhook,autoApprovalRate:A.autoApprovalRate,...W?{isDefault:!0}:{}})),z=W?{id:H[0].id,name:H[0].name,mode:H[0].mode}:null,Z=U.webhook?z9(H,U.webhook):W?H[0]:void 0,w;if(U.filePath)if(!Vq1(U.filePath))w={valid:!1,filePath:U.filePath,fileName:U.filePath.split(/[\\/]/).pop()??U.filePath,documentCount:0,errors:[`文件不存在:${U.filePath}`]};else try{let A=UI(U.filePath),v=await II(A.fileBuffer,A.fileName,Z?.materialPackFilePolicy);w={valid:!0,filePath:U.filePath,fileName:A.fileName,documentCount:v.documents.length,warnings:v.warnings}}catch(A){w={valid:!1,filePath:U.filePath,fileName:U.filePath.split(/[\\/]/).pop()??U.filePath,documentCount:0,errors:[A instanceof Error?A.message:String(A)]}}let L=w?w.valid:!0,D=Q==="ok"&&V.length>0&&L,N=J==="stateful"?"":`--corp${I.id}`,E="",T="";if(Q!=="ok")T=`凭证鉴权异常:${K}`,E=`seal-useauthdiagnose${N}`;else if(V.length===0)T="当前企业尚未配置任何 Webhook 集成通道",E=`seal-usewebhookadd--name"默认入站通道"--result-url"https://your-domain.com/callback"${N}`;else if(w&&!w.valid)T=`材料包预检失败:${w.errors?.join("; ")}`,E=`seal-usewebhookmaterial-packpreview${w.filePath}${N}`;else{T=W?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到${V.length}个Webhook通道,等待载入`;let A=w?.filePath??"<材料包.zip>",v=W?"":`--webhook${z?z.id:"<webhookIdOrName>"}`;E=`seal-usewebhookmaterial-packpush${A}${v}${N}`}return{ready:D,corp:{id:I.id,name:I.name,sourceType:I.source.type,tenant:q,user:G},stateMode:J,authStatus:Q,authError:K,activeWebhooks:V,defaultWebhook:z,materialPack:w,statusMessage:T,nextAction:E}}var JG=[{name:"seal_whoami",description:"查询当前 Seal 用户身份及租户信息",parameters:X.object({}),handler:async($)=>N$($)},{name:"seal_session_get",description:"查询当前 Seal Bearer session、用户和过期时间",parameters:X.object({}),handler:async($)=>ud($)},{name:"seal_delegation_list",description:"查询当前 Seal 租户下的授权链接 (Delegation) 列表",parameters:X.object({}),handler:async($)=>Gm($)},{name:"seal_delegation_create",description:"创建新的 Seal 授权链接 (Delegation)",parameters:X.object({note:X.string().optional().describe("授权链接的备注或说明信息")}),handler:async($,I)=>wU($,I)},{name:"seal_delegation_revoke",description:"撤销/废除指定的 Seal 授权链接 (Delegation)",parameters:X.object({tokenId:X.string().describe("授权链接 ID (delegation record ID)")}),handler:async($,I)=>Hm($,I.tokenId)},{name:"seal_user_create",description:"创建本地 Seal 用户,生成并返回初始随机密码",parameters:X.object({name:X.string().describe("用户姓名"),phone:X.string().describe("手机号码 (例如 13300001111 或 +8613300001111)"),permissions:X.array(X.string()).optional().describe("权限列表,默认为 []"),departmentIds:X.array(X.string()).optional().describe("关联部门 ID 数组")}),handler:async($,I)=>Wm($,I)},{name:"seal_user_reset_password",description:"重置指定 Seal 用户的默认/随机密码,并返回生成的新密码",parameters:X.object({userId:X.string().describe("用户 ID (_id)")}),handler:async($,I)=>EE($,I.userId)},{name:"seal_user_get",description:"获取指定 Seal 用户的详细信息",parameters:X.object({userId:X.string().describe("用户 ID (_id)")}),handler:async($,I)=>CV($,I.userId)},{name:"seal_user_search",description:"按姓名、手机号或邮箱搜索 Seal 成员用户列表",parameters:X.object({keyword:X.string().optional().describe("搜索关键词(姓名、手机号、邮箱等),不传或传空字符串可列出租户成员")}),handler:async($,I)=>jV($,I.keyword??"")},{name:"seal_user_delete",description:"删除指定 Seal 本地用户",parameters:X.object({userId:X.string().describe("用户 ID (_id)")}),handler:async($,I)=>Vm($,I.userId)},{name:"seal_user_activate",description:"启用/激活已离职的 Seal 用户账号",parameters:X.object({userId:X.string().describe("用户 ID (_id)")}),handler:async($,I)=>BE($,I.userId)},{name:"seal_user_delegation_create",description:"为指定 S
Line truncated
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let X of V){let Z=X.outboundName??"SealAI 审批",w=X.signKey,D=X.apiOrigin??"production";console.error(`•"${Z}"(signKey:${w},环境:${D})`),console.error(`\uD83D\uDC49查看命令:seal-usedeployhosecloudget${w}--corp${J.id}
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let w of X){let D=w.outboundName??"SealAI 审批",O=w.signKey,F=w.apiOrigin??"production";console.error(`•"${D}"(signKey:${O},环境:${F})`),console.error(`\uD83D\uDC49同步命令:seal-usedeployhosecloudsync${O}--corp${J.id}
`);throw Error("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。")}await F0("seal_deploy_hosecloud_sync",Y,J,{signKey:H},O0(Q.options));return}throw Error(`Unknowndeployhosecloudaction:${q??""}.Available:requirements,list,get,status,configure,sync.`)}import{createServer as oq1}from"node:http";import{URL as dq1}from"node:url";var NX0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.13",description:`PlannedHTTPcontractfortheseal-usewrappedbackendAPI.
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let z of V){let Z=z.outboundName??"SealAI 审批",w=z.signKey,L=z.apiOrigin??"production";console.error(`•"${Z}"(signKey:${w},环境:${L})`),console.error(`\uD83D\uDC49查看命令:seal-usedeployhosecloudget${w}--corp${J.id}
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let w of z){let L=w.outboundName??"SealAI 审批",D=w.signKey,N=w.apiOrigin??"production";console.error(`•"${L}"(signKey:${D},环境:${N})`),console.error(`\uD83D\uDC49同步命令:seal-usedeployhosecloudsync${D}--corp${J.id}
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2
Line truncated
`},servers:[{url:"http://localhost:8787",description:"Reserved for a future local HTTP adapter; the current service uses MCP stdio."}],security:[{localSession:[]}],tags:[{name:"Corps",description:"Local enterprise configuration selection."},{name:"Source",description:"Source-derived Seal enterprise configuration."},{name:"Auth",description:"Wrapped authentication diagnostics and current identity."},{name:"Approval Runs",description:"Wrapped approval run history, summaries, document URLs, and trace bridge helpers."},{name:"Approval Knowledge",description:"Wrapped approval rules, documents, preferences, and search."},{name:"Simulation",description:"Wrapped simulation batch record access."}],paths:{"/v1/corps":{get:{tags:["Corps"],operationId:"listCorps",summary:"List configured enterprises",responses:{"200":{description:"Configured enterprises.",content:{"application/json":{schema:{type:"array",items:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}}},"/v1/corps/current":{get:{tags:["Corps"],operationId:"getCurrentCorp",summary:"Get current enterprise",description:"Returns the configured default enterprise in stateful mode. Stateless mode has no current enterprise and requires an explicit corpId for enterprise operations.",responses:{"200":{description:"Current enterprise.",content:{"application/json":{schema:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}}}}}}}},"/v1/corps/current/switch":{post:{tags:["Corps"],operationId:"switchCurrentCorp",summary:"Switch current enterprise",requestBody:{required:!0,content:{"application/json":{schema:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}}}}},responses:{"200":{description:"Switched enterprise.",content:{"application/json":{schema:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}}}}},"404":{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/source/config":{get:{tags:["Source"],operationId:"getSourceConfig",summary:"Resolve source-derived Seal enterprise config",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Redacted Seal enterprise config.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/auth/diagnose":{get:{tags:["Auth"],operationId:"diagnoseAuth",summary:"Diagnose wrapped source-to-Seal authentication",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Authentication stage diagnosis.",content:{"application/json":{schema:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}}}}}}}},"/v1/whoami":{get:{tags:["Auth"],operationId:"whoami",summary:"Get current wrapped Seal identity",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"200":{description:"Current Seal user and tenant.",content:{"application/json":{schema:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}}}}},"401":{description:"Local service authentication failed or downstream Seal auth failed.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}}}},"/v1/session":{get:{tags:["Auth"],operationId:"getSession",summary:"Get current wrapped Seal session metadata",parameters:[{name:"corpId",in:"query",schema:{type:"string"},description:"Local enterprise config ID. Required when global selection mode is stateless; optional in stateful mode, where the configured default enterprise is used."}],responses:{"2
Line truncated
`);J(Y)})})}async function zX0($){let I=U1($.options.port)??U1($.options.p),U=h($.options.host)??h($.options.h),Y=await HO({port:I,host:U}),J=()=>{Y.close(()=>{process.exit(0)})};process.on("SIGINT",J),process.on("SIGTERM",J),await new Promise(()=>{})}async function AX0($,I,U,Y){if($==="config"||$==="get"){await F0("seal_llm_config_get",I,U,{},O0(Y.options));return}if($==="providers"||$==="list"){await F0("seal_llm_providers_list",I,U,{},O0(Y.options));return}throw Error(`Unknownllmcommand:${$??""}.Run'seal-use help'foravailablecommands.`)}async function PX0($,I){if($==="config"||$==="json"){Ix();return}await Ux()}function Ix(){E0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function TX0($){let I=JO();E0(I,{...O0($.options),allowFull:!0})}async function EX0($,I,U,Y){if($==="available"){await F0("seal_permissions_available_list",I,U,{},O0(Y.options));return}if($==="configs"||$==="list"){await F0("seal_permissions_configs_list",I,U,{},O0(Y.options));return}throw Error(`Unknownpermissionscommand:${$??""}.Run'seal-use help'foravailablecommands.`)}import{readFileSync as BX0}from"node:fs";async function RX0($,I,U,Y,J,Q,K){if(!$||$==="get"){await F0("seal_preference_get",J,Q,{},O0(K.options));return}if($==="decision"){if(I==="update"||!I){let q=h(K.options.input),G=q?JSON.parse(BX0(q,"utf8")):t6(K.json);if(!G||Object.keys(G).length===0)throw Error(`Usage:seal-usepreferencedecisionupdate--json'{"explicitApprove":"..."}'`);await F0("seal_preference_decision_update",J,Q,G,O0(K.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let q=h(K.options.default)??h(K.options.level)??Y;if(q!=="medium"&&q!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await F0("seal_preference_thinking_depth_set",J,Q,{defaultLevel:q},O0(K.options));return}if(I==="policies"){if(U==="list"||!U){await F0("seal_preference_thinking_depth_policies_list",J,Q,{},O0(K.options));return}if(U==="upsert"){let q=h(K.options.input),G=q?JSON.parse(BX0(q,"utf8")):t6(K.json);if(!G||!G.id||!G.name)throw Error(`Usage:seal-usepreferencethinking-depthpoliciesupsert--json'{"id":"...","name":"...","level":"high"}'`);await F0("seal_preference_thinking_depth_policies_upsert",J,Q,G,O0(K.options));return}if(U==="remove"||U==="delete"){let q=Y??h(K.options.id)??h(K.options.policyId);if(!q)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await F0("seal_preference_thinking_depth_policies_remove",J,Q,{policyId:q},O0(K.options));return}}}throw Error(`Unknownpreferenceaction:${$??""}.Available:get,decisionupdate,thinking-depthset,thinking-depthpolicieslist/upsert/remove.`)}async function vX0($={}){let I=b8(),U=D4(),Y=WJ(I,{stateful:U.stateful,defaultCorpId:U.defaultCorpId,corpId:$.corpId},o3());console.log(`[probe]corp=${Y.id}source=${Y.source.type}`);let J=await zJ(Y);console.log("[probe] seal enterprise"),console.log(JSON.stringify(J,null,2));let Q=await U4(Y),K=await _V(Q,{documentLimit:20,stylePreferencesEndpoint:Y.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:K.rules.rules.length,hasPendingRuleDeletes:K.rules.hasPendingDeletes,documents:K.documents.articles.length,documentsTotal:K.documents.total,stylePreferences:K.stylePreferences.ok?"ok":`error:${K.stylePreferences.error}`},null,2))}async function CX0($,I,U){let Y=I??h(U.options.corp)??($&&$!=="--corp"?$:void 0);await vX0({corpId:Y})}async function Yx($,I,U,Y,J){if($==="count"){await F0("seal_approval_rules_list",U,Y,{countOnly:!0},O0(J.options));return}if($==="list"){if(_0(J.options.count)){await F0("seal_approval_rules_list",U,Y,{countOnly:!0},O0(J.options));return}let Q=U1(J.options.limit),K=U1(J.options.offset);if(_0(J.options.summary)){await F0("seal_approval_rules_list",U,Y,{fields:aZ0,limit:Q,offset:K},O0(J.options));return}let q=await QI("seal_approval_rules_list",U,Y,{limit:Q,offset:K});sZ0(q,_0(J.options.full)===!0),E0(q);return}if($==="clear"){let Q=_0(J.options.yes)===!0,K=_0(J.options.dryRun)??_0(J.options["dry-run"])??!Q;if(!Q&&!K)throw Error("Refusing to clear rules without --yes. Use --dry-run to preview.");let q=await QI("seal_approval_rules_clear",U,Y,{dryRun:K,recode:_0(J.options.recode)});if(!Q&&K&&q&&typeof q==="object"){E0({...q,nextCommand:`seal-userulesclear--corp${Y.id}--yes`},O0(J.options));return}E0(q,O0(J.options));return}if($==="versions"){await F0("seal_approval_rule_versions_list",U,Y,{},O0(J.options));return}if($==="version"){let Q=I??h(J.options.version);if(!Q)throw Error("Usage: seal-use rules version <versionId|versionNumber|latest>");await F0("seal_approval_rule_version_get",U,Y,QG(Q),O0(J.options));return}if($==="get"){await F0("seal_approval_rule_get",U,Y,{...tZ0(h(J.options.version)),code:h(J.options.code),runtimeId:h(J.options.runtimeId)??h(J.options["runtime-id"]),recordId:h(J.options.r
Line truncated
`).filter(Boolean),Q=J.slice(-I);return{logFile:U,lines:Q,totalLines:J.length}}async function eq1($){let I=XO($),U=Kx($),Y=WG($);gX0($.stateDir);let J=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):qO),Q=$.host??(process.env.HOST?process.env.HOST:GO);VO(I,`${process.pid}
`,{mode:384}),VO(U,JSON.stringify({pid:process.pid,port:J,host:Q,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),AJ(Y,`servicestartingonhttp://${Q}:${J} pid=${process.pid}`);let K=null;try{K=await HO({port:J,host:Q,silent:!0}),AJ(Y,`service listening pid=${process.pid}`)}catch(G){if(AJ(Y,`service failed to bind port ${J}: ${G instanceof Error?G.message:String(G)}`),ZO(I)===process.pid)n8(I,{force:!0}),n8(U,{force:!0});throw G}let q=()=>{if(K)K.close(),K=null;if(ZO(I)===process.pid)n8(I,{force:!0}),n8(U,{force:!0});AJ(Y,`stopped pid=${process.pid}`)};await new Promise((G)=>{let H=!1,W=()=>{if(H)return;H=!0,q(),process.off("SIGTERM",W),process.off("SIGINT",W),G()};process.once("SIGTERM",W),process.once("SIGINT",W)})}function jX0($){gX0($.stateDir);let I=PJ($);if(I.running)return I;let U=$.launcher??{command:process.execPath,args:[$.entryFile]},Y=[...U.args??[],"service","run"];if($.port)Y.push("--port",String($.port));if($.host)Y.push("--host",String($.host));let J=rq1(U.command,Y,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});J.unref();let Q=XO($);return VO(Q,`${J.pid}
`);J(Y)})})}async function Cz0($){let I=a0($.options.port)??a0($.options.p),U=h($.options.host)??h($.options.h),Y=await VD({port:I,host:U}),J=()=>{Y.close(()=>{process.exit(0)})};process.on("SIGINT",J),process.on("SIGTERM",J),await new Promise(()=>{})}async function jz0($,I,U,Y){if($==="config"||$==="get"){await N0("seal_llm_config_get",I,U,{},D0(Y.options));return}if($==="providers"||$==="list"){await N0("seal_llm_providers_list",I,U,{},D0(Y.options));return}throw Error(`Unknownllmcommand:${$??""}.Run'seal-use help'foravailablecommands.`)}async function _z0($,I){if($==="config"||$==="json"){Kx();return}await qx()}function Kx(){E0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}function Sz0($){let I=KD();E0(I,{...D0($.options),allowFull:!0})}async function gz0($,I,U,Y){if($==="available"){await N0("seal_permissions_available_list",I,U,{},D0(Y.options));return}if($==="configs"||$==="list"){await N0("seal_permissions_configs_list",I,U,{},D0(Y.options));return}throw Error(`Unknownpermissionscommand:${$??""}.Run'seal-use help'foravailablecommands.`)}import{readFileSync as yz0}from"node:fs";async function hz0($,I,U,Y,J,Q,K){if(!$||$==="get"){await N0("seal_preference_get",J,Q,{},D0(K.options));return}if($==="decision"){if(I==="update"||!I){let q=h(K.options.input),G=q?JSON.parse(yz0(q,"utf8")):t6(K.json);if(!G||Object.keys(G).length===0)throw Error(`Usage:seal-usepreferencedecisionupdate--json'{"explicitApprove":"..."}'`);await N0("seal_preference_decision_update",J,Q,G,D0(K.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(I==="set"){let q=h(K.options.default)??h(K.options.level)??Y;if(q!=="medium"&&q!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await N0("seal_preference_thinking_depth_set",J,Q,{defaultLevel:q},D0(K.options));return}if(I==="policies"){if(U==="list"||!U){await N0("seal_preference_thinking_depth_policies_list",J,Q,{},D0(K.options));return}if(U==="upsert"){let q=h(K.options.input),G=q?JSON.parse(yz0(q,"utf8")):t6(K.json);if(!G||!G.id||!G.name)throw Error(`Usage:seal-usepreferencethinking-depthpoliciesupsert--json'{"id":"...","name":"...","level":"high"}'`);await N0("seal_preference_thinking_depth_policies_upsert",J,Q,G,D0(K.options));return}if(U==="remove"||U==="delete"){let q=Y??h(K.options.id)??h(K.options.policyId);if(!q)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await N0("seal_preference_thinking_depth_policies_remove",J,Q,{policyId:q},D0(K.options));return}}}throw Error(`Unknownpreferenceaction:${$??""}.Available:get,decisionupdate,thinking-depthset,thinking-depthpolicieslist/upsert/remove.`)}async function xz0($={}){let I=b8(),U=L4(),Y=VJ(I,{stateful:U.stateful,defaultCorpId:U.defaultCorpId,corpId:$.corpId},r3());console.log(`[probe]corp=${Y.id}source=${Y.source.type}`);let J=await AJ(Y);console.log("[probe] seal enterprise"),console.log(JSON.stringify(J,null,2));let Q=await U4(Y),K=await gV(Q,{documentLimit:20,stylePreferencesEndpoint:Y.seal.endpoints.approvalStylePreferences});console.log("[probe] approval context summary"),console.log(JSON.stringify({rules:K.rules.rules.length,hasPendingRuleDeletes:K.rules.hasPendingDeletes,documents:K.documents.articles.length,documentsTotal:K.documents.total,stylePreferences:K.stylePreferences.ok?"ok":`error:${K.stylePreferences.error}`},null,2))}async function kz0($,I,U){let Y=I??h(U.options.corp)??($&&$!=="--corp"?$:void 0);await xz0({corpId:Y})}async function Gx($,I,U,Y,J){if($==="count"){await N0("seal_approval_rules_list",U,Y,{countOnly:!0},D0(J.options));return}if($==="list"){if(_0(J.options.count)){await N0("seal_approval_rules_list",U,Y,{countOnly:!0},D0(J.options));return}let Q=a0(J.options.limit),K=a0(J.options.offset);if(_0(J.options.summary)){await N0("seal_approval_rules_list",U,Y,{fields:Qz0,limit:Q,offset:K},D0(J.options));return}let q=await KI("seal_approval_rules_list",U,Y,{limit:Q,offset:K});Kz0(q,_0(J.options.full)===!0),E0(q);return}if($==="clear"){let Q=_0(J.options.yes)===!0,K=_0(J.options.dryRun)??_0(J.options["dry-run"])??!Q;if(!Q&&!K)throw Error("Refusing to clear rules without --yes. Use --dry-run to preview.");let q=await KI("seal_approval_rules_clear",U,Y,{dryRun:K,recode:_0(J.options.recode)});if(!Q&&K&&q&&typeof q==="object"){E0({...q,nextCommand:`seal-userulesclear--corp${Y.id}--yes`},D0(J.options));return}E0(q,D0(J.options));return}if($==="versions"){await N0("seal_approval_rule_versions_list",U,Y,{},D0(J.options));return}if($==="version"){let Q=I??h(J.options.version);if(!Q)throw Error("Usage: seal-use rules version <versionId|versionNumber|latest>");await N0("seal_approval_rule_version_get",U,Y,KG(Q),D0(J.options));return}if($==="get"){await N0("seal_approval_rule_get",U,Y,{...Jz0(h(J.options.version)),code:h(J.options.code),runtimeId:h(J.options.runtimeId)??h(J.options["runtime-id"]),recordId:h(J.options.r
Line truncated
`).filter(Boolean),Q=J.slice(-I);return{logFile:U,lines:Q,totalLines:J.length}}async function HG1($){let I=wD($),U=Vx($),Y=ZG($);iz0($.stateDir);let J=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):HD),Q=$.host??(process.env.HOST?process.env.HOST:WD);zD(I,`${process.pid}
`,{mode:384}),zD(U,JSON.stringify({pid:process.pid,port:J,host:Q,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),PJ(Y,`servicestartingonhttp://${Q}:${J} pid=${process.pid}`);let K=null;try{K=await VD({port:J,host:Q,silent:!0}),PJ(Y,`service listening pid=${process.pid}`)}catch(G){if(PJ(Y,`service failed to bind port ${J}: ${G instanceof Error?G.message:String(G)}`),XD(I)===process.pid)p8(I,{force:!0}),p8(U,{force:!0});throw G}let q=()=>{if(K)K.close(),K=null;if(XD(I)===process.pid)p8(I,{force:!0}),p8(U,{force:!0});PJ(Y,`stopped pid=${process.pid}`)};await new Promise((G)=>{let H=!1,W=()=>{if(H)return;H=!0,q(),process.off("SIGTERM",W),process.off("SIGINT",W),G()};process.once("SIGTERM",W),process.once("SIGINT",W)})}function uz0($){iz0($.stateDir);let I=TJ($);if(I.running)return I;let U=$.launcher??{command:process.execPath,args:[$.entryFile]},Y=[...U.args??[],"service","run"];if($.port)Y.push("--port",String($.port));if($.host)Y.push("--host",String($.host));let J=QG1(U.command,Y,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});J.unref();let Q=wD($);return zD(Q,`${J.pid}
`,{flag:"a",mode:384})}var Zx=ZG1(VG1(),".config","seal-use");async function zx($,I,U){let Y=U?a0(U.options.port)??a0(U.options.p):void 0,J=U?h(U.options.host)??h(U.options.h):void 0,Q=U?a0(U.options.lines)??a0(U.options.n):void 0,K=await qI($,{appRoot:I.appRoot,entryFile:I.entryFile,stateDir:Zx,version:$1,launcher:I.launcher,port:Y,host:J},{maxLines:Q});if(K!==void 0)E0(K)}import{existsSync as zG1,readFileSync as nz0}from"node:fs";async function pz0($,I,U,Y,J){if($==="batch-records"||$==="records"){let Q=I??h(J.options.batchId)??h(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation batch-records <batchId>");await N0("seal_simulation_batch_records_get",U,Y,{batchId:Q,query:h(J.options.query)},D0(J.options));return}if($==="create"||$==="run"){let Q=h(J.options.mode)??h(J.options.sourceSystem)??h(J.options["source-system"])??"hosecloud",K=Q==="material-pack"?"material_pack":Q,q=h(J.options.schemaConfig)??h(J.options["schema-config"]),G=q?JSON.parse(nz0(q,"utf8")):void 0,H=h(J.options.input),W=H?JSON.parse(nz0(H,"utf8")):t6(J.json),V=h(J.options.packageId)??h(J.options["package-id"]),z=W6(J.options.packageIds)??W6(J.options["package-ids"])??(V?[V]:void 0),Z=W6(J.options.flowIds)??W6(J.options["flow-ids"])??W6(J.options.documentSn)??W6(J.options["document-sn"]),w=h(J.options.signKey)??h(J.options["sign-key"])??h(J.options.integration);await N0("seal_simulation_batch_create",U,Y,{mode:K,sourceSystem:K,flowIds:Z,documentSn:Z,rejectNodeName:h(J.options.rejectNode)??h(J.options["reject-node"])??null,thinkingDepthOverride:h(J.options.thinkingDepth)??h(J.options["thinking-depth"]),skipInvoiceGeneration:_0(J.options.skipInvoiceGeneration)??_0(J.options["skip-invoice-generation"]),skipExpenseExtraction:_0(J.options.skipExpenseExtraction)??_0(J.options["skip-expense-extraction"]),disableAttachmentCache:_0(J.options.disableAttachmentCache)??_0(J.options["disable-attachment-cache"]),signKey:w,packageIds:z,packageId:V,templateId:h(J.options.templateId)??h(J.options["template-id"]),schemaConfig:G,requestIds:W6(J.options.requestIds)??W6(J.options["request-ids"]),workflowTypeId:h(J.options.workflowTypeId)??h(J.options["workflow-type-id"]),flowStatusList:W6(J.options.flowStatusList)?.map(Number)??W6(J.options["flow-status-list"])?.map(Number),businessCodes:W6(J.options.businessCodes)??W6(J.options["business-codes"]),documentType:h(J.options.documentType)??h(J.options["document-type"]),startTime:a0(J.options.startTime)??a0(J.options["start-time"]),endTime:a0(J.options.endTime)??a0(J.options["end-time"]),status:W6(J.options.status),limit:a0(J.options.limit),rawParams:W},D0(J.options));return}if($==="wait"){let Q=I??h(J.options.batchId)??h(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await N0("seal_simulation_batch_wait",U,Y,{batchId:Q,timeout:h(J.options.timeout),pollInterval:h(J.options.pollInterval)??h(J.options["poll-interval"])},D0(J.options));return}if($==="clean"||$==="delete"){let Q=I??h(J.options.batchId)??h(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation clean <batchId>");await N0("seal_simulation_batch_clean",U,Y,{batchId:Q},D0(J.options));return}if($==="specifications"){let Q=I??h(J.options.integration)??h(J.options.signKey)??h(J.options["sign-key"]);await N0("seal_simulation_specifications_list",U,Y,{signKey:Q},D0(J.options));return}if($==="list"){await N0("seal_simulation_batches_list",U,Y,{limit:a0(J.options.limit)},D0(J.options));return}if($==="get"){let Q=I??h(J.options.batchId)??h(J.options["batch-id"]);if(!Q)throw Error("Usage: seal-use simulation get <batchId>");await N0("seal_simulation_batch_get",U,Y,{batchId:Q},D0(J.options));return}if($==="templates"){await N0("seal_simulation_templates_get",U,Y,{},D0(J.options));return}if($==="integrations"){await N0("seal_simulation_integrations_get",U,Y,{},D0(J.options));return}if($==="package-upload"){let Q=I??h(J.options.file);if(!Q)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!zG1(Q))throw Error(`Filenotfound:${Q}`);await N0("seal_simulation_material_package_upload",U,Y,{filePath:Q},D0(J.options));return}throw Error(`Unknownsimulationcommand:${$??""}.Run'seal-use help'foravailablecommands.`)}import{existsSync as qX0}from"node:fs";import{join as LD}from"node:path";import{existsSync as Xx,mkdirSync as IX0,rmSync as EG1,writeFileSync as BG1}from"node:fs";import{homedir as UX0}from"node:os";import{dirname as RG1,join as wx}from"node:path";var cz0=`---
name:seal-use
description:"v0.10.13: Use for Seal Use first-time enterprise onboarding, Hose/合思 or Seal-native authentication, assistance links and browser cURL intake, plus tenant approval operations, diagnosis, simulation, rules, users, configuration, and search."
Rule,document,stylepreference,andpublishactionsmutateSealconfiguration.Makethetargetenterpriseexplicit,showtheintendedpayload,andverifyafterthewrite.Neversendreal\`enterprises/*.json\` files, tokens, signed URLs, or full raw documents to GitHub, tickets, logs, or chat unless the user explicitly requests a safe export.
`;var kX0=`interface:
`;var dz0=`interface:
display_name:"Seal Use"
short_description:"Diagnose approval feedback and publish minimal rule fixes"
default_prompt:"Use $seal-use to resolve a customer feedback package to the correct tenant, diagnose the approval run, propose a minimal rule diff, and publish only after explicit confirmation."
@@ -719,7 +735,7 @@ Use current search only when the question is about current draft/current knowled
##OutputDiscipline
Ifarulecommandwouldreturnmanydescriptionsormorethanabout20rules,use\`rules count\`, \`rules list --summary\`, \`fields\`, \`snippetOnly\`, or \`--output-file\`. Use \`--full\` only for deliberate exports.
`;var bX0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use<command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise `./enterprises` and `~/.config/seal-use/enterprises`aremerged.\n-User-levelconfigsoverridesame-IDlocalconfigs.\n\nEnterpriseselectionisstatelessbydefault.Commandsthataccessanenterpriserequire\n`--corp<corpId>`unlessstatefulmodeisexplicitlyenabled:\n\n```bash\nseal-useconfigmodestateful--corp<corpId>\nseal-usecorpsswitch<corpId>\nseal-useconfigmodestateless\n```\n\nTheglobalmodeisstoredin`~/.config/seal-use/config.json`;set`SEAL_USE_CONFIG_FILE`to\noverridethatpath.Thelegacy`current-corp`fileisnotread.\n\n##Stream&ExitCodeContract\n\n-**`stdout`**:Pure,deterministicJSONformachine/Agentparsing.\n-**`stderr`**:Diagnostics,probinglogs,and**Next-StepCommandSuggestions**(e.g.`👉Nextaction:...`).\n-**`ExitCode`**:`0`onsuccess,non-zero(e.g.`1`)onfailuretotriggerAgenterrorself-remediation.\n\n##Top-LevelCommands\n\n```bash\nseal-useversion\nseal-useconfigpaths\nseal-useconfigget\nseal-useconfigmode<stateful|stateless>[--corp<corpId>]\nseal-useconfigtest-dir[<path>|--clear]\nseal-useconfiglint<enable|disable|status>[--linter<name>][--min-score<score>]\nseal-userulespull[--corp<corpId>][--version<id|num|latest>][--out<file>]\nseal-useruleslint[--file<path>][--corp<corpId>][--linter<name|path>][--version<num>][--code<code>][--min-score<score>][--summary]\nseal-userulespush[--file<path>][--corp<corpId>][--publish][--version-name<name>][--dry-run|--yes]\nseal-useservice<start|stop|restart|status|logs>[--port8787][--host127.0.0.1][--lines50]\nseal-usehttp[--port8787][--host127.0.0.1]\nseal-useserve[--port8787]\nseal-useupdate\nseal-usetoolslist\nseal-usecorpslist[--corp<corpId>]\nseal-usecorpscurrent[--corp<corpId>]\nseal-usecorpsswitch<corpId>\nseal-usecorpsadd-hose--json'{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-usecorpsadd-seal--json'{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-usecorpsadd-link<https://.../web/thirdparty.html?...>[--name<customName>][--overwrite]\nseal-useauthdiagnose[--corp<corpId>]\nseal-useauthhose-link[--corp<corpId>][--expire7200]\nseal-usedelegationlist[--corp<corpId>]\nseal-usedelegationcreate[--note<note>][--from-link<url>][--corp<corpId>]\nseal-usedelegationrevoke<tokenId>[--corp<corpId>]\nseal-useuserscreate--name<name>--phone<phone>[--dept<deptId>][--corp<corpId>]\nseal-useusersreset-password<userId>[--corp<corpId>]\nseal-useusersget<userId>[--corp<corpId>]\nseal-useusersdelete<userId>[--corp<corpId>]\nseal-usellmconfig[--corp<corpId>]\nseal-usellmproviders[--corp<corpId>]\nseal-usepermissionsavailable[--corp<corpId>]\nseal-usepermissionsconfigs[--corp<corpId>]\nseal-usebillingstatus[--corp<corpId>]\nseal-usebillingplans[--corp<corpId>]\nseal-usebillingfeatures[--corp<corpId>]\nseal-usewebhooklist[--query<text>][--show-secret][--corp<corpId>]\nseal-usewebhookget|find<idOrName>[--show-secret][--corp<corpId>]\nseal-usewebhookadd--name<name>--result-url<url>[--modeassisted|semi_automatic|fully_automatic][--auto-approval-rate60][--secret<secret>][--corp<corpId>]\nseal-usewebhookupdate<idOrName>[--name<name>][--result-url<url>][--modeassisted|semi_automatic|fully_automatic][--auto-approval-rate60][--secret<secret>|--rotate-secret][--corp<corpId>]\nseal-usewebhookdelete<idOrName>--yes[--corp<corpId>]\nseal-usedeployhosecloudrequirements[--corp<corpId>]\nseal-usedeployhosecloudlist[--corp<corpId>]\nseal-usedeployhosecloudget[<sign-key>][--corp<corpId>]\nseal-usedeployhosecloudstatus[--corp<corpId>]\nseal-usedeployhosecloudconfigure--json'{...}'[--corp<corpId>]\nseal-usedeployhosecloudsync[<sign-key>][--auto][--corp<corpId>]\nseal-usepreferenceget[--corp<corpId>]\nseal-usepreferencedecisionupdate--json'{\"explicitApprove\":\"...\"}'[--corp<corpId>]\nseal-usepreferencethinking-depthset--default<medium|high>[--corp<corpId>]\nseal-usepreferencethinking-depthpolicieslist[--corp<corpId>]\nseal-usepreferencethinking-depthpoliciesupsert--json'{...}'[--corp<corpId>]\nseal-usepreferencethinking-depthpoliciesremove<policyId>[--corp<corpId>]\nseal-usesourceconfig[--corp<corpId>]\nseal-usetool<toolName>[--corp<corpId>][--json'{\"key\":\"value\"}']\nseal-useapproval-runssummary--corp<corpId>[--dateYYYY-MM-DD][--timezoneAsia/Shanghai]\nseal-useapproval-runsstats--corp<corpId>[--since3months][--dedupe-bysoLine truncated
`;var oz0="# Seal Use CLI Reference\n\nRun from any directory after installing the global CLI:\n\n```bash\nseal-use<command>\n```\n\nEnterprise config lookup:\n\n- If `SEAL_USE_ENTERPRISES_DIR` is set, only that directory is loaded.\n- Otherwise `./enterprises` and `~/.config/seal-use/enterprises`aremerged.\n-User-levelconfigsoverridesame-IDlocalconfigs.\n\nEnterpriseselectionisstatelessbydefault.Commandsthataccessanenterpriserequire\n`--corp<corpId>`unlessstatefulmodeisexplicitlyenabled:\n\n```bash\nseal-useconfigmodestateful--corp<corpId>\nseal-usecorpsswitch<corpId>\nseal-useconfigmodestateless\n```\n\nTheglobalmodeisstoredin`~/.config/seal-use/config.json`;set`SEAL_USE_CONFIG_FILE`to\noverridethatpath.Thelegacy`current-corp`fileisnotread.\n\n##Stream&ExitCodeContract\n\n-**`stdout`**:Pure,deterministicJSONformachine/Agentparsing.\n-**`stderr`**:Diagnostics,probinglogs,and**Next-StepCommandSuggestions**(e.g.`👉Nextaction:...`).\n-**`ExitCode`**:`0`onsuccess,non-zero(e.g.`1`)onfailuretotriggerAgenterrorself-remediation.\n\n##Top-LevelCommands\n\n```bash\nseal-useversion\nseal-useconfigpaths\nseal-useconfigget\nseal-useconfigmode<stateful|stateless>[--corp<corpId>]\nseal-useconfigtest-dir[<path>|--clear]\nseal-useconfiglint<enable|disable|status>[--linter<name>][--min-score<score>]\nseal-userulespull[--corp<corpId>][--version<id|num|latest>][--out<file>]\nseal-useruleslint[--file<path>][--corp<corpId>][--linter<name|path>][--version<num>][--code<code>][--min-score<score>][--summary]\nseal-userulespush[--file<path>][--corp<corpId>][--publish][--version-name<name>][--dry-run|--yes]\nseal-useservice<start|stop|restart|status|logs>[--port8787][--host127.0.0.1][--lines50]\nseal-usehttp[--port8787][--host127.0.0.1]\nseal-useserve[--port8787]\nseal-useupdate\nseal-usetoolslist\nseal-usecorpslist[--corp<corpId>]\nseal-usecorpscurrent[--corp<corpId>]\nseal-usecorpsswitch<corpId>\nseal-usecorpsadd-hose--json'{\"name\":\"企业名称\",\"domain\":\"https://app.ekuaibao.com\",\"appKey\":\"...\",\"appSecurity\":\"...\",\"proxyStaffBizId\":\"corpId:staffId\"}'\nseal-usecorpsadd-seal--json'{\"sealUrl\":\"https://tenant.sealai.cc\",\"token\":\"seal-bearer-token\"}'\nseal-usecorpsadd-link<https://.../web/thirdparty.html?...>[--name<customName>][--overwrite]\nseal-useauthdiagnose[--corp<corpId>]\nseal-useauthhose-link[--corp<corpId>][--expire7200]\nseal-usedelegationlist[--corp<corpId>]\nseal-usedelegationcreate[--note<note>][--from-link<url>][--corp<corpId>]\nseal-usedelegationrevoke<tokenId>[--corp<corpId>]\nseal-useuserscreate--name<name>--phone<phone>[--dept<deptId>][--corp<corpId>]\nseal-useusersreset-password<userId>[--corp<corpId>]\nseal-useusersget<userId>[--corp<corpId>]\nseal-useusersdelete<userId>[--corp<corpId>]\nseal-usellmconfig[--corp<corpId>]\nseal-usellmproviders[--corp<corpId>]\nseal-usepermissionsavailable[--corp<corpId>]\nseal-usepermissionsconfigs[--corp<corpId>]\nseal-usebillingstatus[--corp<corpId>]\nseal-usebillingplans[--corp<corpId>]\nseal-usebillingfeatures[--corp<corpId>]\nseal-usewebhooklist[--query<text>][--show-secret][--corp<corpId>]\nseal-usewebhookget|find<idOrName>[--show-secret][--corp<corpId>]\nseal-usewebhookadd--name<name>--result-url<url>[--modeassisted|semi_automatic|fully_automatic][--auto-approval-rate60][--secret<secret>][--min-file-size<bytes>][--max-file-size<bytes>][--allowed-extensions<.pdf,.xlsx,...>][--corp<corpId>]\nseal-usewebhookupdate<idOrName>[--name<name>][--result-url<url>][--modeassisted|semi_automatic|fully_automatic][--auto-approval-rate60][--secret<secret>|--rotate-secret][--min-file-size<bytes>][--max-file-size<bytes>][--allowed-extensions<.pdf,.xlsx,...>][--clear-max-file-size][--corp<corpId>]\nseal-usewebhookdelete<idOrName>--yes[--corp<corpId>]\nseal-usedeployhosecloudrequirements[--corp<corpId>]\nseal-usedeployhosecloudlist[--corp<corpId>]\nseal-usedeployhosecloudget[<sign-key>][--corp<corpId>]\nseal-usedeployhosecloudstatus[--corp<corpId>]\nseal-usedeployhosecloudconfigure--json'{...}'[--corp<corpId>]\nseal-usedeployhosecloudsync[<sign-key>][--auto][--corp<corpId>]\nseal-usepreferenceget[--corp<corpId>]\nseal-usepreferencedecisionupdate--json'{\"explicitApprove\":\"...\"}'[--corp<corpId>]\nseal-usepreferencethinking-depthset--default<medium|high>[--corp<corpId>]\nseal-usepreferencethinking-depthpolicieslist[--corp<corpId>]\nseal-usepreferencethinking-depthpoliciesupsert--json'{...}'[--corp<corpId>]\nseal-usepreferencethinking-depthpoliciesremove<policyId>[--corp<corpId>]\nseal-usesourceconfig[--corp<corpId>]\nseal-usetool<toolName>[--corp<corpIdLine truncated
@@ -1154,7 +1170,7 @@ Return a compact report containing:
-Newversionnumberandversionname,ifpublished
-Verificationresult
-Whetheraregressionrerunwasperformed
`;var cX0="# Enterprise Onboarding\n\nRead this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.\n\n## Start With Discovery\n\nRun this before asking for setup parameters (if `seal-use` is not installed, first run `curl-fsSLhttps://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash`):\n\n```bash\nseal-use version\nseal-use corps list\n```\n\n- If `seal-use` is not installed on the system, run the curl install script above to install it.\n- If the target enterprise is listed, match the user's human enterprise name to its returned `id` and use that value as `--corp` on every command. Do not ask the user for `corpId`.\n- If multiple configured enterprises plausibly match, show their human names and let the user choose. Keep their IDs as implementation details.\n- If none are configured, ask one plain-language question: “你现在手上有哪一种接入材料:合思开放平台 appKey/appSecurity、合思授权/协助链接、Seal 协助链接,还是从已登录的合思或 Seal 网页复制的 cURL?”\n\nDo not open with a JSON template or a list of internal fields.\n\nAll command examples in this reference are for the Agent to run. Do not hand them to the user as setup instructions. Communicate with the user in natural language and translate their answer into CLI/MCP parameters yourself.\n\n## Keep Two Concepts Separate\n\nClassify both the enterprise identity origin and how the current credential was acquired:\n\n| Enterprise identity origin | Credential material the user may have | Meaning |\n| --- | --- | --- |\n| Hose/合思-sourced Seal tenant | Hose `appKey` + `appSecurity` | Stable, refreshable standard integration |\n| Hose/合思-sourced Seal tenant | Hose authorization/assistance link | Temporary Hose authorization that can lead into the Seal SSO session |\n| Hose/合思-sourced Seal tenant | cURL copied from an authenticated Hose or Seal page | Snapshot of a signed-in browser session; it may expire |\n| Seal-native tenant | Seal assistance/delegation link | Temporary delegated access to a Seal tenant |\n| Seal-native tenant | cURL copied from an authenticated Seal page | Snapshot containing the Seal host and session authentication |\n\nCredential shape alone does not define identity origin. In particular, a Hose-sourced user eventually receives a Seal Bearer session after SSO. When `whoami` returns provider metadata, preserve it and use it to describe the tenant accurately.\n\n## Parameter Ownership\n\nAsk the user only for information that cannot be discovered safely:\n\n| Field | Owner and behavior |\n| --- | --- |\n| `appKey`, `appSecurity` | User supplies these for standard Hose OpenAPI onboarding. Explain that they come from the enterprise's 合思开放平台 application credentials. Treat both as secrets. |\n| `domain` | Probe the standard Hose SaaS domains automatically. Ask only when probing fails and the enterprise uses a private or dedicated deployment. |\n| Enterprise name and `corpId` | Discover from the credential response or Seal `whoami`. Do not ask the user to invent or locate them first. |\n| Administrator and `staffId` | Discover administrator candidates. If more than one is eligible, present name and masked phone for the user to choose; pass the selected ID internally. |\n| Seal URL, tenant ID, tenant slug | Discover from the assistance link, cURL host, and Seal `whoami`. |\n| Bearer token, cookies, signed query tokens | Extract only from user-supplied authentication material. Never print them back or include them in summaries. |\n\n## Route 1: Standard Hose Credentials\n\nThis is the preferred durable route for a Hose-sourced tenant. Read `hose-enterprise-init.md`, then use:\n\n```bash\nseal-use corps add-hose --json '{\"appKey\":\"...\",\"appSecurity\":\"...\"}'\n```\n\nThe CLI probes the standard domains, discovers the corporation, and discovers administrator candidates. If it returns multiple candidates, show only useful identifying information and ask which person should be used; retry with `staffName`, `staffPhone`, or the selected `staffId` internally. After creation, run:\n\n```bash\nseal-use auth diagnose --corp <discovered-id>\n```\n\nDo not ask for `domain`, `corpId`, or `proxyStaffBizId` up front. For a dedicated/private Hose deployment, add `domain` only after standard probing reports that it cannot find the enterprise.\n\n## Route 2: Incoming Assistance Link\n\nFirst distinguish the link by its host and purpose:\n\n- A Hose authorization/provisional link opens a Hose session and may continue through Seal SSO. It is not a Seal delegation link.\n- A Seal assistance/delegation link grants temporary delegated access on a Seal tenant. It is not a Hose OpenAPI credential.\n- `seal-use auth hose-link` and `seal-use delegation create` generat
Line truncated
`;var sz0="# Enterprise Onboarding\n\nRead this reference for first installation, zero configured enterprises, incoming credentials or assistance links, and browser-copied cURL. The goal is to identify the enterprise with the least user effort while keeping authentication material confidential.\n\n## Start With Discovery\n\nRun this before asking for setup parameters (if `seal-use` is not installed, first run `curl-fsSLhttps://git.ying-qing.cn/gitea/seal-use/raw/branch/main/scripts/install.sh | bash`):\n\n```bash\nseal-use version\nseal-use corps list\n```\n\n- If `seal-use` is not installed on the system, run the curl install script above to install it.\n- If the target enterprise is listed, match the user's human enterprise name to its returned `id` and use that value as `--corp` on every command. Do not ask the user for `corpId`.\n- If multiple configured enterprises plausibly match, show their human names and let the user choose. Keep their IDs as implementation details.\n- If none are configured, ask one plain-language question: “你现在手上有哪一种接入材料:合思开放平台 appKey/appSecurity、合思授权/协助链接、Seal 协助链接,还是从已登录的合思或 Seal 网页复制的 cURL?”\n\nDo not open with a JSON template or a list of internal fields.\n\nAll command examples in this reference are for the Agent to run. Do not hand them to the user as setup instructions. Communicate with the user in natural language and translate their answer into CLI/MCP parameters yourself.\n\n## Keep Two Concepts Separate\n\nClassify both the enterprise identity origin and how the current credential was acquired:\n\n| Enterprise identity origin | Credential material the user may have | Meaning |\n| --- | --- | --- |\n| Hose/合思-sourced Seal tenant | Hose `appKey` + `appSecurity` | Stable, refreshable standard integration |\n| Hose/合思-sourced Seal tenant | Hose authorization/assistance link | Temporary Hose authorization that can lead into the Seal SSO session |\n| Hose/合思-sourced Seal tenant | cURL copied from an authenticated Hose or Seal page | Snapshot of a signed-in browser session; it may expire |\n| Seal-native tenant | Seal assistance/delegation link | Temporary delegated access to a Seal tenant |\n| Seal-native tenant | cURL copied from an authenticated Seal page | Snapshot containing the Seal host and session authentication |\n\nCredential shape alone does not define identity origin. In particular, a Hose-sourced user eventually receives a Seal Bearer session after SSO. When `whoami` returns provider metadata, preserve it and use it to describe the tenant accurately.\n\n## Parameter Ownership\n\nAsk the user only for information that cannot be discovered safely:\n\n| Field | Owner and behavior |\n| --- | --- |\n| `appKey`, `appSecurity` | User supplies these for standard Hose OpenAPI onboarding. Explain that they come from the enterprise's 合思开放平台 application credentials. Treat both as secrets. |\n| `domain` | Probe the standard Hose SaaS domains automatically. Ask only when probing fails and the enterprise uses a private or dedicated deployment. |\n| Enterprise name and `corpId` | Discover from the credential response or Seal `whoami`. Do not ask the user to invent or locate them first. |\n| Administrator and `staffId` | Discover administrator candidates. If more than one is eligible, present name and masked phone for the user to choose; pass the selected ID internally. |\n| Seal URL, tenant ID, tenant slug | Discover from the assistance link, cURL host, and Seal `whoami`. |\n| Bearer token, cookies, signed query tokens | Extract only from user-supplied authentication material. Never print them back or include them in summaries. |\n\n## Route 1: Standard Hose Credentials\n\nThis is the preferred durable route for a Hose-sourced tenant. Read `hose-enterprise-init.md`, then use:\n\n```bash\nseal-use corps add-hose --json '{\"appKey\":\"...\",\"appSecurity\":\"...\"}'\n```\n\nThe CLI probes the standard domains, discovers the corporation, and discovers administrator candidates. If it returns multiple candidates, show only useful identifying information and ask which person should be used; retry with `staffName`, `staffPhone`, or the selected `staffId` internally. After creation, run:\n\n```bash\nseal-use auth diagnose --corp <discovered-id>\n```\n\nDo not ask for `domain`, `corpId`, or `proxyStaffBizId` up front. For a dedicated/private Hose deployment, add `domain` only after standard probing reports that it cannot find the enterprise.\n\n## Route 2: Incoming Assistance Link\n\nFirst distinguish the link by its host and purpose:\n\n- A Hose authorization/provisional link opens a Hose session and may continue through Seal SSO. It is not a Seal delegation link.\n- A Seal assistance/delegation link grants temporary delegated access on a Seal tenant. It is not a Hose OpenAPI credential.\n- `seal-use auth hose-link` and `seal-use delegation create` generat
Line truncated
-\`seal-use auth diagnose\` proves this stage works but redacts the token, so it is not enough when the user needs the actual clickable Hose link.
-**FormattingRequirement**:WhenreturningaHoseauthorizationlinktotheuser,ALWAYSprovideBOTHacodeblock(\`\`\`\`text ... \`\`\`\`) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
`);return}if($==="install"||$==="init"||$==="sync"){let Y=_0(U.options.local)||_0(U.options.workspace),J=h(U.options.dir)??h(U.options.target)??I,Q=J?J:Y?LO(process.cwd(),".agents","skills","seal-use"):VG(),K=Vx(Q);E0({installed:!0,targetDir:K.targetDir,fileCount:K.files.length,files:K.files});return}if($==="status"||$==="get"||!$){let Y=VG(),J=LO(process.cwd(),".agents","skills","seal-use");E0({global:{dir:Y,installed:eX0(LO(Y,"SKILL.md"))},local:{dir:J,installed:eX0(LO(J,"SKILL.md"))}});return}throw Error(`Unknownskillcommand:${$}.Run'seal-use help'foravailablecommands.`)}async function IL0($,I){if($==="config"){E0(await zJ(I));return}throw Error(`Unknownsourcecommand:${$??""}.Run'seal-use help'foravailablecommands.`)}async function UL0($,I,U,Y){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await F0($,I,U,t6(Y.json),O0(Y.options))}function YL0(){E0(YG.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as NG1,mkdirSync as FG1,renameSync as Xx,rmSync as MG1,unlinkSync as GL0,writeFileSync as JL0}from"node:fs";import{dirname as zG1,join as QL0}from"node:path";import{spawnSync as qI}from"node:child_process";function wO($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let U=$.toLowerCase().replace(/\\/g,"/");return!U.endsWith("/bun")&&!U.endsWith("/bun.exe")&&!U.endsWith("/node")&&!U.endsWith("/node.exe")}var HL0="yunyingk/seal-use",XG="yunyingk/seal-home";var AG1="SEAL_USE_GITHUB_REPO",PG1="SEAL_HOME_GITHUB_REPO";async function WL0($,I={}){let U={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:qx,version:e0,launcher:$.launcher},Y=I.repo||process.env[AG1]?.trim()||process.env[PG1]?.trim()||HL0,J=I.targetVersion?.trim(),Q=J&&J.toLowerCase()!=="latest"?J:void 0;if(Q){let T=Q.replace(/^v/,""),v=VL0(T,e0);if(v<0){E0({updated:!1,currentVersion:e0,targetVersion:T,mode:wO()?"binary":"source",message:`Cannotdowngradeseal-usefromv${e0}toolderversionv${T}.Updatesmustbeforward-only.`});return}if(v===0&&!I.force){E0({updated:!1,currentVersion:e0,targetVersion:T,mode:wO()?"binary":"source",message:`seal-useisalreadyatversionv${e0}.Use--forcetoreinstall.`});return}}if(I.changelogOnly){let T=await Lx(Y,I.limit??10);E0({currentVersion:e0,totalQueried:T.length,releases:T.map((v)=>({version:v.version,tagName:v.tagName,publishedAt:v.publishedAt,author:v.author,releaseNotes:v.notes,releaseUrl:v.htmlUrl,isCurrent:v.version===e0,isNewer:ZG(v.version,e0)}))});return}if(!wO()){if(I.checkOnly){let v=await Lx(Y,30),u=v[0],g=u?.version??e0,b=v.find((p)=>p.version===e0),C=ZG(g,e0),n=v.filter((p)=>ZG(p.version,e0));E0({updated:!1,updateAvailable:C,currentVersion:e0,currentVersionPublishedAt:b?.publishedAt,latestVersion:g,latestVersionPublishedAt:u?.publishedAt,behindCount:n.length,pendingReleases:n.map((p)=>({version:p.version,tagName:p.tagName,publishedAt:p.publishedAt,author:p.author,releaseNotes:p.notes,releaseUrl:p.htmlUrl})),releaseNotes:u?.notes??"",releaseUrl:u?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let T=PJ(U).running;if(T)await KI("stop",U);try{qL0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(v){console.error(`gitpullskipped:${vinstanceofError?v.message:String(v)}`)}if(qL0("bun",["install"],{cwd:$.appRoot}),T)await KI("start",U);E0({updated:!0,serviceRestarted:T,version:e0,mode:"source"});return}let K=TG1(),q=EG1(),G=await Lx(Y,30),H=Q?G.find((T)=>T.version===Q||T.tagName===Q||T.tagName===`v${Q}`)??await KL0(Y,Q):G[0]??await KL0(Y);if(!H){E0({updated:!1,currentVersion:e0,mode:"binary",message:`Failedtoqueryreleasesfromrepository'${Y}'`});return}let W=H.version,V=G.find((T)=>T.version===e0),X=ZG(W,e0),Z=X||Boolean(I.force),w=G.filter((T)=>ZG(T.version,e0));if(I.checkOnly){E0({updated:!1,updateAvailable:X,currentVersion:e0,currentVersionPublishedAt:V?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,behindCount:w.length,pendingReleases:w.map((T)=>({version:T.version,tagName:T.tagName,publishedAt:T.publishedAt,author:T.author,releaseNotes:T.notes,releaseUrl:T.htmlUrl})),releaseNotes:H.notes,releaseUrl:H.htmlUrl,mode:"binary"});return}if(!Z){E0({updated:!1,currentVersion:e0,currentVersionPublishedAt:V?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,mode:"binary",message:`seal-useisalreadyuptodate(v${e0})`});return}let D=BG1(H.assets,K,q);if(!D)throw Error(`Nocompatiblebinaryfoundfor${K}-${q}inreleasev${W}.Availableassets:${H.assets.map((T)=>T.name).join(", ")}`);let O=PJ(U).running;if(O)await KI("stop",U);let F=process.execPath,E=zG1(F),A=QL0(E,`.tmp-update-${Date.now()}`);FG1(A,{recursive:!0});try{let T=QL0(A,D.name);await RG1(D.downloadUrl,T,H.tagName,D.name);let v=T;if(D.name.endsWith(".tar.gz")||D.name.endsWith(".tgz"))v=vG1(T,A,K);else if(D.name.endsWith(".zip"))v=CG1(T,A,K);if(NG1(v,493),process.platform==="darwin")try{qI("/usr/bin/codesig
Line truncated
`)}catch{}}async function RG1($,I,U,Y){let J=wx(),Q=[],K=U?U.startsWith("v")?U:`v${U}`:void 0,q=Y||$.split("/").pop()||"";if(J!=="github"){if(K&&q)Q.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${K}/${q}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${K}/${q}`);if($.startsWith("https://git.ying-qing.cn"))Q.push($)}if(J!=="gitea")if(K&&q){let D=`https://github.com/${HL0}/releases/download/${K}/${q}`;if(!process.env.CI)Q.push(`https://ghfast.top/${D}`,`https://gh.ddlc.top/${D}`);Q.push(D)}else if($.includes("github.com")){if(!process.env.CI)Q.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Q.push($)}else Q.push($);let G=Array.from(new Set(Q)),H,W=6000,V=6000,X=307200,Z=1e4,w=180000;for(let D=0;D<G.length;D++){let O=G[D],F=new AbortController,E="",A=(g)=>{E=g;try{F.abort()}catch{}},T=setTimeout(()=>{A("Connection timed out (no response headers within 6s)")},W),v,u;try{DO(`==> [${D+1}/${G.length}] Downloading via: ${O}`);let g=await fetch(O,{signal:F.signal});if(T)clearTimeout(T),T=void 0;if(!g.ok)throw Error(`HTTP ${g.status} ${g.statusText}`);v=setTimeout(()=>{A("Overall download time exceeded 3 minutes")},w);let b=Number(g.headers.get("content-length"))||0,C=g.body?.getReader();if(!C){let i=Buffer.from(await g.arrayBuffer());if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);JL0(I,i),DO(`✓ Download succeeded (${(i.length/1024/1024).toFixed(1)} MB)`);return}let n=[],p=0,S=0;u=setTimeout(()=>{if(p<X){let i=(p/1024).toFixed(1);A(`Initial transfer too slow (${i} KB < 300 KB in 6s), switching mirror...`)}},V);while(!0){let i=C.read(),Y0,B=new Promise((K0,W0)=>{Y0=setTimeout(()=>{W0(Error("Data transfer stalled (no chunk received for 10s)"))},Z)}),k;try{k=await Promise.race([i,B])}finally{if(Y0)clearTimeout(Y0)}let{done:d,value:t}=k;if(d)break;if(t){if(n.push(t),p+=t.length,u&&p>=X)clearTimeout(u),u=void 0;let K0=Date.now();if(K0-S>200){S=K0;let W0=b?Math.round(p/b*100):0,z0=(p/1048576).toFixed(1),B0=b?(b/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${W0}% (${z0} / ${B0} MB)...`)}catch{}}}}try{process.stderr.write(`
`);return}if($==="install"||$==="init"||$==="sync"){let Y=_0(U.options.local)||_0(U.options.workspace),J=h(U.options.dir)??h(U.options.target)??I,Q=J?J:Y?LD(process.cwd(),".agents","skills","seal-use"):zG(),K=Lx(Q);E0({installed:!0,targetDir:K.targetDir,fileCount:K.files.length,files:K.files});return}if($==="status"||$==="get"||!$){let Y=zG(),J=LD(process.cwd(),".agents","skills","seal-use");E0({global:{dir:Y,installed:qX0(LD(Y,"SKILL.md"))},local:{dir:J,installed:qX0(LD(J,"SKILL.md"))}});return}throw Error(`Unknownskillcommand:${$}.Run'seal-use help'foravailablecommands.`)}async function HX0($,I){if($==="config"){E0(await AJ(I));return}throw Error(`Unknownsourcecommand:${$??""}.Run'seal-use help'foravailablecommands.`)}async function WX0($,I,U,Y){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await N0($,I,U,t6(Y.json),D0(Y.options))}function VX0(){E0(JG.map(($)=>({name:$.name,description:$.description})))}import{chmodSync as vG1,mkdirSync as CG1,renameSync as Ox,rmSync as jG1,unlinkSync as LX0,writeFileSync as ZX0}from"node:fs";import{dirname as _G1,join as zX0}from"node:path";import{spawnSync as GI}from"node:child_process";function DD($=process.execPath,I=import.meta.url){if(I.includes("/$bunfs/")||I.includes("\\$bunfs\\"))return!0;let U=$.toLowerCase().replace(/\\/g,"/");return!U.endsWith("/bun")&&!U.endsWith("/bun.exe")&&!U.endsWith("/node")&&!U.endsWith("/node.exe")}var DX0="yunyingk/seal-use",wG="yunyingk/seal-home";var SG1="SEAL_USE_GITHUB_REPO",gG1="SEAL_HOME_GITHUB_REPO";async function OX0($,I={}){let U={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Zx,version:$1,launcher:$.launcher},Y=I.repo||process.env[SG1]?.trim()||process.env[gG1]?.trim()||DX0,J=I.targetVersion?.trim(),Q=J&&J.toLowerCase()!=="latest"?J:void 0;if(Q){let A=Q.replace(/^v/,""),v=NX0(A,$1);if(v<0){E0({updated:!1,currentVersion:$1,targetVersion:A,mode:DD()?"binary":"source",message:`Cannotdowngradeseal-usefromv${$1}toolderversionv${A}.Updatesmustbeforward-only.`});return}if(v===0&&!I.force){E0({updated:!1,currentVersion:$1,targetVersion:A,mode:DD()?"binary":"source",message:`seal-useisalreadyatversionv${$1}.Use--forcetoreinstall.`});return}}if(I.changelogOnly){let A=await Nx(Y,I.limit??10);E0({currentVersion:$1,totalQueried:A.length,releases:A.map((v)=>({version:v.version,tagName:v.tagName,publishedAt:v.publishedAt,author:v.author,releaseNotes:v.notes,releaseUrl:v.htmlUrl,isCurrent:v.version===$1,isNewer:XG(v.version,$1)}))});return}if(!DD()){if(I.checkOnly){let v=await Nx(Y,30),u=v[0],g=u?.version??$1,b=v.find((n)=>n.version===$1),C=XG(g,$1),p=v.filter((n)=>XG(n.version,$1));E0({updated:!1,updateAvailable:C,currentVersion:$1,currentVersionPublishedAt:b?.publishedAt,latestVersion:g,latestVersionPublishedAt:u?.publishedAt,behindCount:p.length,pendingReleases:p.map((n)=>({version:n.version,tagName:n.tagName,publishedAt:n.publishedAt,author:n.author,releaseNotes:n.notes,releaseUrl:n.htmlUrl})),releaseNotes:u?.notes??"",releaseUrl:u?.htmlUrl??"",mode:"source",message:"Running in source development mode. Run 'seal-use update' to git pull & bun install."});return}let A=TJ(U).running;if(A)await qI("stop",U);try{wX0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(v){console.error(`gitpullskipped:${vinstanceofError?v.message:String(v)}`)}if(wX0("bun",["install"],{cwd:$.appRoot}),A)await qI("start",U);E0({updated:!0,serviceRestarted:A,version:$1,mode:"source"});return}let K=yG1(),q=hG1(),G=await Nx(Y,30),H=Q?G.find((A)=>A.version===Q||A.tagName===Q||A.tagName===`v${Q}`)??await XX0(Y,Q):G[0]??await XX0(Y);if(!H){E0({updated:!1,currentVersion:$1,mode:"binary",message:`Failedtoqueryreleasesfromrepository'${Y}'`});return}let W=H.version,V=G.find((A)=>A.version===$1),z=XG(W,$1),Z=z||Boolean(I.force),w=G.filter((A)=>XG(A.version,$1));if(I.checkOnly){E0({updated:!1,updateAvailable:z,currentVersion:$1,currentVersionPublishedAt:V?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,behindCount:w.length,pendingReleases:w.map((A)=>({version:A.version,tagName:A.tagName,publishedAt:A.publishedAt,author:A.author,releaseNotes:A.notes,releaseUrl:A.htmlUrl})),releaseNotes:H.notes,releaseUrl:H.htmlUrl,mode:"binary"});return}if(!Z){E0({updated:!1,currentVersion:$1,currentVersionPublishedAt:V?.publishedAt,latestVersion:W,latestVersionPublishedAt:H.publishedAt,mode:"binary",message:`seal-useisalreadyuptodate(v${$1})`});return}let L=xG1(H.assets,K,q);if(!L)throw Error(`Nocompatiblebinaryfoundfor${K}-${q}inreleasev${W}.Availableassets:${H.assets.map((A)=>A.name).join(", ")}`);let D=TJ(U).running;if(D)await qI("stop",U);let N=process.execPath,E=_G1(N),T=zX0(E,`.tmp-update-${Date.now()}`);CG1(T,{recursive:!0});try{let A=zX0(T,L.name);await kG1(L.downloadUrl,A,H.tagName,L.name);let v=A;if(L.name.endsWith(".tar.gz")||L.name.endsWith(".tgz"))v=uG1(A,T,K);else if(L.name.endsWith(".zip"))v=fG1(A,T,K);if(vG1(v,493),process.platform==="darwin")try{GI("/usr/bin/codesig
Line truncated
`)}catch{}}async function kG1($,I,U,Y){let J=Fx(),Q=[],K=U?U.startsWith("v")?U:`v${U}`:void 0,q=Y||$.split("/").pop()||"";if(J!=="github"){if(K&&q)Q.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${K}/${q}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${K}/${q}`);if($.startsWith("https://git.ying-qing.cn"))Q.push($)}if(J!=="gitea")if(K&&q){let L=`https://github.com/${DX0}/releases/download/${K}/${q}`;if(!process.env.CI)Q.push(`https://ghfast.top/${L}`,`https://gh.ddlc.top/${L}`);Q.push(L)}else if($.includes("github.com")){if(!process.env.CI)Q.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);Q.push($)}else Q.push($);let G=Array.from(new Set(Q)),H,W=6000,V=6000,z=307200,Z=1e4,w=180000;for(let L=0;L<G.length;L++){let D=G[L],N=new AbortController,E="",T=(g)=>{E=g;try{N.abort()}catch{}},A=setTimeout(()=>{T("Connection timed out (no response headers within 6s)")},W),v,u;try{OD(`==> [${L+1}/${G.length}] Downloading via: ${D}`);let g=await fetch(D,{signal:N.signal});if(A)clearTimeout(A),A=void 0;if(!g.ok)throw Error(`HTTP ${g.status} ${g.statusText}`);v=setTimeout(()=>{T("Overall download time exceeded 3 minutes")},w);let b=Number(g.headers.get("content-length"))||0,C=g.body?.getReader();if(!C){let i=Buffer.from(await g.arrayBuffer());if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);ZX0(I,i),OD(`✓ Download succeeded (${(i.length/1024/1024).toFixed(1)} MB)`);return}let p=[],n=0,S=0;u=setTimeout(()=>{if(n<z){let i=(n/1024).toFixed(1);T(`Initial transfer too slow (${i} KB < 300 KB in 6s), switching mirror...`)}},V);while(!0){let i=C.read(),Y0,B=new Promise((K0,W0)=>{Y0=setTimeout(()=>{W0(Error("Data transfer stalled (no chunk received for 10s)"))},Z)}),k;try{k=await Promise.race([i,B])}finally{if(Y0)clearTimeout(Y0)}let{done:d,value:t}=k;if(d)break;if(t){if(p.push(t),n+=t.length,u&&n>=z)clearTimeout(u),u=void 0;let K0=Date.now();if(K0-S>200){S=K0;let W0=b?Math.round(n/b*100):0,M0=(n/1048576).toFixed(1),B0=b?(b/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${W0}% (${M0} / ${B0} MB)...`)}catch{}}}}try{process.stderr.write(`
Webhook writes read the current AI approval config and POST the merged full config back to `api/v1/agent/ai-approval/config`, preserving non-Webhook integrations. List/get mask `secret` by default; add returns the generated secret once.
Webhook writes read the current AI approval config and POST the merged full config back to `api/v1/agent/ai-approval/config`, preserving non-Webhook integrations. List/get mask `secret` by default; add returns the generated secret once. Each Webhook can also store a mutable `materialPackFilePolicy` with `minFileSizeBytes`, optional `maxFileSizeBytes`, and `allowedExtensions`. Update is a patch: omitted policy fields are retained; `allowedExtensions` replaces the complete list; `--clear-max-file-size` removes the upper bound.
Approval runs, simulations, and Langfuse bridge:
@@ -395,7 +395,8 @@ Before pushing or previewing, the system enforces:
2.**ZIP → Excel**: Every ZIP file (excluding `信息表.xlsx`) **must** be declared in exactly one `[附件]` column. Error: `ZIP 中的文件未在 Excel 任何 [附件] 列中声明: <path>`
3.**Document Directory Scope Isolation**: All attachments declared for a document `DOC_X`**must** reside in its own root directory (`DOC_X/` or `DOC_X@annotation/`). Cross-document references are strictly forbidden. Error: `单据「X」声明了跨单据或非本单据目录的附件路径: <path>。附件必须位于该单据自己的根目录...`
4.**Strict Declaration Uniqueness**: A given ZIP file path **cannot** be declared more than once across the entire material pack (even within the same document across multiple rows or fields). If the same logical document is needed in multiple places, separate files must be placed in distinct paths. Error: `附件路径「<path>」被重复声明了 N 次...`
5.**documentId ↔ ZIP root**: Every `documentId` in the Excel main sheet must have a matching ZIP root dir (exact match or `documentId@annotation`). Errors: `Excel 会议编号「X」在 ZIP 中找不到对应的根目录...` / `ZIP 根目录对应的编号「X」在信息表中找不到对应的会议编号`
5.**Attachment file policy**: Every attachment except the root `信息表.xlsx` must satisfy the selected Webhook's minimum size, optional maximum size, and extension whitelist. The default minimum is 500 bytes; the default maximum is unlimited; the default whitelist includes common PDF, Office, text, email, and image formats. Error: `附件文件过小...` / `附件文件过大...` / `附件后缀不在白名单中...`
6.**documentId ↔ ZIP root**: Every `documentId` in the Excel main sheet must have a matching ZIP root dir (exact match or `documentId@annotation`). Errors: `Excel 会议编号「X」在 ZIP 中找不到对应的根目录...` / `ZIP 根目录对应的编号「X」在信息表中找不到对应的会议编号`
All validation errors are collected and reported together in a single `MaterialPackValidationError`.
# When there is exactly one webhook channel, --webhook can be omitted (auto-locked)
```
### Attachment file policy configuration
The policy is stored per inbound Webhook integration and is applied before any attachment upload or document push. A failed check stops the entire material-pack flow. The policy is intentionally mutable: after an authorized configuration change, retrying the same push reads the saved policy again.
`null` or an omitted `maxFileSizeBytes` means no per-file upper bound. Values are bytes; a file smaller than the minimum or larger than the maximum fails. Extensions are normalized case-insensitively and may be written with or without the leading dot. The root `信息表.xlsx` remains exempt from attachment policy checks.
```bash
# New Webhook: use the default 500-byte minimum and default extension whitelist
The saved configuration is returned by `webhook get`/`webhook list` under `materialPackFilePolicy`. The root `信息表.xlsx` is always allowed as the material-pack manifest and is not subject to the attachment policy.
### Failure recovery loop
When a push fails because of the attachment policy, the error is actionable and should be handled as a two-channel recovery loop:
1. Error channel: read `附件文件过小`, `附件文件过大`, or `附件后缀不在白名单中`, including the attachment path and the configured boundary.
2. Resolution channel: ask whether the user wants to replace/compress the file or explicitly allow the format/size by changing the target Webhook policy.
3. If configuration change is authorized, read the current policy with `webhook get`/`webhook list`, update only the necessary fields, and verify the returned configuration.
4. Retry the original `material-pack push`; it will load the latest saved policy before any upload begins.
The same loop is available through MCP: read with `seal_webhook_get`/`seal_webhook_list`, update with `seal_webhook_update` and its `materialPackFilePolicy` patch, then retry `seal_webhook_material_pack` in `push` mode. For MCP, set `maxFileSizeBytes` to `null` to clear the upper bound. `allowedExtensions` is a complete replacement list, so include existing allowed suffixes when adding one.
If the assistant lacks permission to update the Webhook or the user does not authorize relaxing the rule, report the block rather than bypassing validation. Since validation happens before the upload loop, a failed attempt does not leave a partially pushed material pack.
The direct local `material-pack preview` command and MCP preview use the default or temporary policy. They do not automatically read a selected Webhook's persisted policy. Use `webhook ready --file --webhook <idOrName>` or the actual push path when validating against the saved inbound policy.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.