Add stable-ID rule version diff
This commit is contained in:
1 parent
c4428efd19
commit
a8a28623df
9 files changed
+599
-158
No files matched your search
Vendored
+156
-152
@@ -1,7 +1,7 @@
|
||||
import{createRequire as wy0}from"node:module";var Gy0=Object.create;var{getPrototypeOf:Wy0,defineProperty:aT,getOwnPropertyNames:Hy0}=Object;var Xy0=Object.prototype.hasOwnProperty;function Zy0($){return this[$]}var qy0,Vy0,J6=($,Y,z)=>{var U=$!=null&&typeof $==="object";if(U){var Q=Y?qy0??=new WeakMap:Vy0??=new WeakMap,J=Q.get($);if(J)return J}z=$!=null?Gy0(Wy0($)):{};let K=Y||!$||!$.__esModule?aT(z,"default",{value:$,enumerable:!0}):z;for(let I of Hy0($))if(!Xy0.call(K,I))aT(K,I,{get:Zy0.bind($,I),enumerable:!0});if(U)Q.set($,K);return K};var E=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports);var Ly0=($)=>$;function Fy0($,Y){this[$]=Ly0.bind(null,Y)}var N8=($,Y)=>{for(var z in Y)aT($,z,{get:Y[z],enumerable:!0,configurable:!0,set:Fy0.bind(Y,z)})};var o=($,Y)=>()=>($&&(Y=$($=0)),Y);var K0=wy0(import.meta.url);var My0,nq,Oy0,Ny0,Dy0,Ay0,R0=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports),oo=($,Y)=>{let z={};for(var U in $)nq(z,U,{get:$[U],enumerable:!0});if(Y)nq(z,Symbol.toStringTag,{value:"Module"});return z},By0=($,Y,z,U)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var Q=Ny0(Y),J=0,K=Q.length,I;J<K;J++)if(I=Q[J],!Ay0.call($,I)&&I!==z)nq($,I,{get:((G)=>Y[G]).bind(null,I),enumerable:!(U=Oy0(Y,I))||U.enumerable})}return $},pq=($,Y,z)=>(z=$!=null?My0(Dy0($)):{},By0(Y||!$||!$.__esModule?nq(z,"default",{value:$,enumerable:!0}):z,$));var tT=o(()=>{My0=Object.create,nq=Object.defineProperty,Oy0=Object.getOwnPropertyDescriptor,Ny0=Object.getOwnPropertyNames,Dy0=Object.getPrototypeOf,Ay0=Object.prototype.hasOwnProperty});function so($){return typeof $==="string"&&ro.has($.replace(/#$/,""))}function ao($,Y){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let z=$.$schema.replace(/#$/,"");if(Py0.has(z))return"2020-12";if(ro.has(z))return"2019-09";if(Ty0.has(z)||jy0.has(z))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${Y}`)}var Py0,ro,Ty0,jy0;var eT=o(()=>{Py0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),ro=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Ty0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),jy0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function W0($,Y,z){function U(I,G){if(!I._zod)Object.defineProperty(I,"_zod",{value:{def:G,constr:K,traits:new Set},enumerable:!1});if(I._zod.traits.has($))return;I._zod.traits.add($),Y(I,G);let W=K.prototype,H=Object.keys(W);for(let X=0;X<H.length;X++){let Z=H[X];if(!(Z in I))I[Z]=W[Z].bind(I)}}let Q=z?.Parent??Object;class J extends Q{}Object.defineProperty(J,"name",{value:$});function K(I){var G;let W=z?.Parent?new J:this;U(W,I),(G=W._zod).deferred??(G.deferred=[]);for(let H of W._zod.deferred)H();return W}return Object.defineProperty(K,"init",{value:U}),Object.defineProperty(K,Symbol.hasInstance,{value:(I)=>{if(z?.Parent&&I instanceof z.Parent)return!0;return I?._zod?.traits?.has($)}}),Object.defineProperty(K,"name",{value:$}),K}function a4($){if($)Object.assign(TY,$);return TY}var to,oI,$j,i5,jY,TY;var EY=o(()=>{oI=Object.freeze({status:"aborted"});$j=Symbol("zod_brand");i5=class i5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};jY=class jY extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(to=globalThis).__zod_globalConfig??(to.__zod_globalConfig={});TY=globalThis.__zod_globalConfig});var y0={};N8(y0,{unwrapMessage:()=>rI,uint8ArrayToHex:()=>ay0,uint8ArrayToBase64url:()=>ry0,uint8ArrayToBase64:()=>Yr,stringifyPrimitive:()=>v0,slugify:()=>Uj,shallowClone:()=>Jj,safeExtend:()=>ny0,required:()=>my0,randomString:()=>ky0,propertyKeyTypes:()=>tI,promiseAllObject:()=>yy0,primitiveTypes:()=>Kj,prefixIssues:()=>x8,pick:()=>by0,partial:()=>dy0,parsedType:()=>S0,optionalKeys:()=>Ij,omit:()=>iy0,objectClone:()=>hy0,numKeys:()=>xy0,nullish:()=>G7,normalizeParams:()=>x0,mergeDefs:()=>p9,merge:()=>py0,jsonStringifyReplacer:()=>nU,joinValues:()=>O0,issue:()=>dU,isPlainObject:()=>H7,isObject:()=>CY,hexToUint8Array:()=>sy0,getSizableOrigin:()=>eI,getParsedType:()=>fy0,getLengthableOrigin:()=>$G,getEnumValues:()=>sI,getElementAtPath:()=>gy0,floatSafeRemainder:()=>zj,finalizeIssue:()=>A8,extend:()=>cy0,explicitlyAborted:()=>Hj,escapeRegex:()=>N$,esc:()=>dq,defineLazy:()=>E1,createTransparentProxy:()=>uy0,cloneDef:()=>Sy0,clone:()=>D8,cleanRegex:()=>aI,cleanEnum:()=>ly0,captureStackTrace:()=>mq,cached:()=>pU,base64urlToUint8Array:()=>oy0,base64ToUint8Array:()=>$r,assignProp:()=>W7,assertNotEqual:()=>Cy0,assertNever:()=>_y0,assertIs:()=>Ry0,assertEqual:()=>Ey0,assert:()=>vy0,allowsEval:()=>Qj,aborted:()=>X7,NUMBER_FORMAT_RANGES:()=>Gj,Class:()=>zrLine truncated
|
||||
`)}var Ur=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,nU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},YG,f8;var qj=o(()=>{EY();$1();YG=W0("$ZodError",Ur),f8=W0("$ZodError",Ur,{Parent:Error})});var mU=($)=>(Y,z,U,Q)=>{let J=U?{...U,async:!1}:{async:!1},K=Y._zod.run({value:z,issues:[]},J);if(K instanceof Promise)throw new i5;if(K.issues.length){let I=new(Q?.Err??$)(K.issues.map((G)=>A8(G,J,a4())));throw mq(I,Q?.callee),I}return K.value},lq,lU=($)=>async(Y,z,U,Q)=>{let J=U?{...U,async:!0}:{async:!0},K=Y._zod.run({value:z,issues:[]},J);if(K instanceof Promise)K=await K;if(K.issues.length){let I=new(Q?.Err??$)(K.issues.map((G)=>A8(G,J,a4())));throw mq(I,Q?.callee),I}return K.value},oq,oU=($)=>(Y,z,U)=>{let Q=U?{...U,async:!1}:{async:!1},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)throw new i5;return J.issues.length?{success:!1,error:new($??YG)(J.issues.map((K)=>A8(K,Q,a4())))}:{success:!0,data:J.value}},Vj,rU=($)=>async(Y,z,U)=>{let Q=U?{...U,async:!0}:{async:!0},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((K)=>A8(K,Q,a4())))}:{success:!0,data:J.value}},Lj,rq=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return mU($)(Y,z,Q)},ey0,sq=($)=>(Y,z,U)=>{return mU($)(Y,z,U)},$k0,aq=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return lU($)(Y,z,Q)},Yk0,tq=($)=>async(Y,z,U)=>{return lU($)(Y,z,U)},zk0,eq=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return oU($)(Y,z,Q)},Uk0,$V=($)=>(Y,z,U)=>{return oU($)(Y,z,U)},Qk0,YV=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return rU($)(Y,z,Q)},Jk0,zV=($)=>async(Y,z,U)=>{return rU($)(Y,z,U)},Kk0;var Fj=o(()=>{EY();qj();$1();lq=mU(f8),oq=lU(f8),Vj=oU(f8),Lj=rU(f8),ey0=rq(f8),$k0=sq(f8),Yk0=aq(f8),zk0=tq(f8),Uk0=eq(f8),Qk0=$V(f8),Jk0=YV(f8),Kk0=zV(f8)});var $$={};N8($$,{xid:()=>Nj,uuid7:()=>Hk0,uuid6:()=>Wk0,uuid4:()=>Gk0,uuid:()=>RY,uppercase:()=>dj,unicodeEmail:()=>Jr,undefined:()=>nj,ulid:()=>Oj,time:()=>kj,string:()=>fj,sha512_hex:()=>vk0,sha512_base64url:()=>Sk0,sha512_base64:()=>hk0,sha384_hex:()=>Ck0,sha384_base64url:()=>_k0,sha384_base64:()=>Rk0,sha256_hex:()=>Tk0,sha256_base64url:()=>Ek0,sha256_base64:()=>jk0,sha1_hex:()=>Ak0,sha1_base64url:()=>Pk0,sha1_base64:()=>Bk0,rfc5322Email:()=>Zk0,number:()=>QG,null:()=>cj,nanoid:()=>Aj,md5_hex:()=>Ok0,md5_base64url:()=>Dk0,md5_base64:()=>Nk0,mac:()=>Rj,lowercase:()=>pj,ksuid:()=>Dj,ipv6:()=>Cj,ipv4:()=>Ej,integer:()=>bj,idnEmail:()=>qk0,httpProtocol:()=>Sj,html5Email:()=>Xk0,hostname:()=>Fk0,hex:()=>Mk0,guid:()=>Pj,extendedDuration:()=>Ik0,emoji:()=>jj,email:()=>Tj,e164:()=>gj,duration:()=>Bj,domain:()=>wk0,datetime:()=>xj,date:()=>yj,cuid2:()=>Mj,cuid:()=>wj,cidrv6:()=>vj,cidrv4:()=>_j,browserEmail:()=>Vk0,boolean:()=>ij,bigint:()=>uj,base64url:()=>UV,base64:()=>hj});function jj(){return new RegExp(Lk0,"u")}function Ir($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function kj($){return new RegExp(`^${Ir($)}$`)}function xj($){let Y=Ir({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${Y}(?:${z.join("|")})`;return new RegExp(`^${Kr}T(?:${U})$`)}function JG($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function KG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var wj,Mj,Oj,Nj,Dj,Aj,Bj,Ik0,Pj,RY=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Gk0,Wk0,Hk0,Tj,Xk0,Zk0,Jr,qk0,Vk0,Lk0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ej,Cj,Rj=($)=>{let Y=N$($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},_j,vj,hj,UV,Fk0,wk0,Sj,gj,Kr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",yj,fj=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},uj,bj,QG,ij,cj,nj,pj,dj,Mk0,Ok0,Nk0,Dk0,Ak0,Bk0,Pk0,Tk0,jk0,Ek0,Ck0,Rk0,_k0,vk0,hk0,Sk0;var QV=o(()=>{$1();wj=/^[cC][0-9a-z]{6,}$/,Mj=/^[0-9a-z]+$/,Oj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Nj=/^[0-9a-vA-V]{20}$/,Dj=/^[A-Za-z0-9]{27}$/,Aj=/^[a-zA-Z0-9_-]{21}$/,Bj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
|
||||
import{createRequire as Ey0}from"node:module";var wy0=Object.create;var{getPrototypeOf:Oy0,defineProperty:tT,getOwnPropertyNames:Ny0}=Object;var Dy0=Object.prototype.hasOwnProperty;function Ay0($){return this[$]}var By0,Py0,J6=($,Y,z)=>{var U=$!=null&&typeof $==="object";if(U){var Q=Y?By0??=new WeakMap:Py0??=new WeakMap,J=Q.get($);if(J)return J}z=$!=null?wy0(Oy0($)):{};let K=Y||!$||!$.__esModule?tT(z,"default",{value:$,enumerable:!0}):z;for(let I of Ny0($))if(!Dy0.call(K,I))tT(K,I,{get:Ay0.bind($,I),enumerable:!0});if(U)Q.set($,K);return K};var E=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports);var Ty0=($)=>$;function jy0($,Y){this[$]=Ty0.bind(null,Y)}var N8=($,Y)=>{for(var z in Y)tT($,z,{get:Y[z],enumerable:!0,configurable:!0,set:jy0.bind(Y,z)})};var m=($,Y)=>()=>($&&(Y=$($=0)),Y);var K0=Ey0(import.meta.url);var Cy0,pq,Ry0,_y0,vy0,hy0,R0=($,Y)=>()=>(Y||$((Y={exports:{}}).exports,Y),Y.exports),ao=($,Y)=>{let z={};for(var U in $)pq(z,U,{get:$[U],enumerable:!0});if(Y)pq(z,Symbol.toStringTag,{value:"Module"});return z},Sy0=($,Y,z,U)=>{if(Y&&typeof Y==="object"||typeof Y==="function"){for(var Q=_y0(Y),J=0,K=Q.length,I;J<K;J++)if(I=Q[J],!hy0.call($,I)&&I!==z)pq($,I,{get:((G)=>Y[G]).bind(null,I),enumerable:!(U=Ry0(Y,I))||U.enumerable})}return $},dq=($,Y,z)=>(z=$!=null?Cy0(vy0($)):{},Sy0(Y||!$||!$.__esModule?pq(z,"default",{value:$,enumerable:!0}):z,$));var eT=m(()=>{Cy0=Object.create,pq=Object.defineProperty,Ry0=Object.getOwnPropertyDescriptor,_y0=Object.getOwnPropertyNames,vy0=Object.getPrototypeOf,hy0=Object.prototype.hasOwnProperty});function eo($){return typeof $==="string"&&to.has($.replace(/#$/,""))}function $r($,Y){if(!("$schema"in $)||typeof $.$schema!=="string")return"2020-12";let z=$.$schema.replace(/#$/,"");if(gy0.has(z))return"2020-12";if(to.has(z))return"2019-09";if(yy0.has(z)||ky0.has(z))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${$.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${Y}`)}var gy0,to,yy0,ky0;var $j=m(()=>{gy0=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),to=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),yy0=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),ky0=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"])});function W0($,Y,z){function U(I,G){if(!I._zod)Object.defineProperty(I,"_zod",{value:{def:G,constr:K,traits:new Set},enumerable:!1});if(I._zod.traits.has($))return;I._zod.traits.add($),Y(I,G);let W=K.prototype,H=Object.keys(W);for(let X=0;X<H.length;X++){let Z=H[X];if(!(Z in I))I[Z]=W[Z].bind(I)}}let Q=z?.Parent??Object;class J extends Q{}Object.defineProperty(J,"name",{value:$});function K(I){var G;let W=z?.Parent?new J:this;U(W,I),(G=W._zod).deferred??(G.deferred=[]);for(let H of W._zod.deferred)H();return W}return Object.defineProperty(K,"init",{value:U}),Object.defineProperty(K,Symbol.hasInstance,{value:(I)=>{if(z?.Parent&&I instanceof z.Parent)return!0;return I?._zod?.traits?.has($)}}),Object.defineProperty(K,"name",{value:$}),K}function a4($){if($)Object.assign(jY,$);return jY}var Yr,rI,Yj,i5,EY,jY;var CY=m(()=>{rI=Object.freeze({status:"aborted"});Yj=Symbol("zod_brand");i5=class i5 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};EY=class EY extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}};(Yr=globalThis).__zod_globalConfig??(Yr.__zod_globalConfig={});jY=globalThis.__zod_globalConfig});var y0={};N8(y0,{unwrapMessage:()=>sI,uint8ArrayToHex:()=>Ik0,uint8ArrayToBase64url:()=>Jk0,uint8ArrayToBase64:()=>Qr,stringifyPrimitive:()=>v0,slugify:()=>Qj,shallowClone:()=>Kj,safeExtend:()=>ey0,required:()=>zk0,randomString:()=>my0,propertyKeyTypes:()=>eI,promiseAllObject:()=>dy0,primitiveTypes:()=>Ij,prefixIssues:()=>x8,pick:()=>sy0,partial:()=>Yk0,parsedType:()=>S0,optionalKeys:()=>Gj,omit:()=>ay0,objectClone:()=>cy0,numKeys:()=>ly0,nullish:()=>G7,normalizeParams:()=>x0,mergeDefs:()=>p9,merge:()=>$k0,jsonStringifyReplacer:()=>pU,joinValues:()=>O0,issue:()=>mU,isPlainObject:()=>H7,isObject:()=>RY,hexToUint8Array:()=>Kk0,getSizableOrigin:()=>$G,getParsedType:()=>oy0,getLengthableOrigin:()=>YG,getEnumValues:()=>aI,getElementAtPath:()=>py0,floatSafeRemainder:()=>Uj,finalizeIssue:()=>A8,extend:()=>ty0,explicitlyAborted:()=>Xj,escapeRegex:()=>D$,esc:()=>mq,defineLazy:()=>E1,createTransparentProxy:()=>ry0,cloneDef:()=>ny0,clone:()=>D8,cleanRegex:()=>tI,cleanEnum:()=>Uk0,captureStackTrace:()=>lq,cached:()=>dU,base64urlToUint8Array:()=>Qk0,base64ToUint8Array:()=>Ur,assignProp:()=>W7,assertNotEqual:()=>fy0,assertNever:()=>by0,assertIs:()=>uy0,assertEqual:()=>xy0,assert:()=>iy0,allowsEval:()=>Jj,aborted:()=>X7,NUMBER_FORMAT_RANGES:()=>Wj,Class:()=>JrLine truncated
|
||||
`)}var Kr=($,Y)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:Y,enumerable:!1}),$.message=JSON.stringify(Y,pU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},zG,f8;var Vj=m(()=>{CY();$1();zG=W0("$ZodError",Kr),f8=W0("$ZodError",Kr,{Parent:Error})});var lU=($)=>(Y,z,U,Q)=>{let J=U?{...U,async:!1}:{async:!1},K=Y._zod.run({value:z,issues:[]},J);if(K instanceof Promise)throw new i5;if(K.issues.length){let I=new(Q?.Err??$)(K.issues.map((G)=>A8(G,J,a4())));throw lq(I,Q?.callee),I}return K.value},oq,oU=($)=>async(Y,z,U,Q)=>{let J=U?{...U,async:!0}:{async:!0},K=Y._zod.run({value:z,issues:[]},J);if(K instanceof Promise)K=await K;if(K.issues.length){let I=new(Q?.Err??$)(K.issues.map((G)=>A8(G,J,a4())));throw lq(I,Q?.callee),I}return K.value},rq,rU=($)=>(Y,z,U)=>{let Q=U?{...U,async:!1}:{async:!1},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)throw new i5;return J.issues.length?{success:!1,error:new($??zG)(J.issues.map((K)=>A8(K,Q,a4())))}:{success:!0,data:J.value}},Lj,sU=($)=>async(Y,z,U)=>{let Q=U?{...U,async:!0}:{async:!0},J=Y._zod.run({value:z,issues:[]},Q);if(J instanceof Promise)J=await J;return J.issues.length?{success:!1,error:new $(J.issues.map((K)=>A8(K,Q,a4())))}:{success:!0,data:J.value}},Fj,sq=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return lU($)(Y,z,Q)},Wk0,aq=($)=>(Y,z,U)=>{return lU($)(Y,z,U)},Hk0,tq=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return oU($)(Y,z,Q)},Xk0,eq=($)=>async(Y,z,U)=>{return oU($)(Y,z,U)},Zk0,$V=($)=>(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return rU($)(Y,z,Q)},qk0,YV=($)=>(Y,z,U)=>{return rU($)(Y,z,U)},Vk0,zV=($)=>async(Y,z,U)=>{let Q=U?{...U,direction:"backward"}:{direction:"backward"};return sU($)(Y,z,Q)},Lk0,UV=($)=>async(Y,z,U)=>{return sU($)(Y,z,U)},Fk0;var Mj=m(()=>{CY();Vj();$1();oq=lU(f8),rq=oU(f8),Lj=rU(f8),Fj=sU(f8),Wk0=sq(f8),Hk0=aq(f8),Xk0=tq(f8),Zk0=eq(f8),qk0=$V(f8),Vk0=YV(f8),Lk0=zV(f8),Fk0=UV(f8)});var Y$={};N8(Y$,{xid:()=>Dj,uuid7:()=>Nk0,uuid6:()=>Ok0,uuid4:()=>wk0,uuid:()=>_Y,uppercase:()=>mj,unicodeEmail:()=>Gr,undefined:()=>pj,ulid:()=>Nj,time:()=>xj,string:()=>uj,sha512_hex:()=>ik0,sha512_base64url:()=>nk0,sha512_base64:()=>ck0,sha384_hex:()=>fk0,sha384_base64url:()=>bk0,sha384_base64:()=>uk0,sha256_hex:()=>yk0,sha256_base64url:()=>xk0,sha256_base64:()=>kk0,sha1_hex:()=>hk0,sha1_base64url:()=>gk0,sha1_base64:()=>Sk0,rfc5322Email:()=>Ak0,number:()=>JG,null:()=>nj,nanoid:()=>Bj,md5_hex:()=>Rk0,md5_base64url:()=>vk0,md5_base64:()=>_k0,mac:()=>_j,lowercase:()=>dj,ksuid:()=>Aj,ipv6:()=>Rj,ipv4:()=>Cj,integer:()=>ij,idnEmail:()=>Bk0,httpProtocol:()=>gj,html5Email:()=>Dk0,hostname:()=>jk0,hex:()=>Ck0,guid:()=>Tj,extendedDuration:()=>Mk0,emoji:()=>Ej,email:()=>jj,e164:()=>yj,duration:()=>Pj,domain:()=>Ek0,datetime:()=>fj,date:()=>kj,cuid2:()=>Oj,cuid:()=>wj,cidrv6:()=>hj,cidrv4:()=>vj,browserEmail:()=>Pk0,boolean:()=>cj,bigint:()=>bj,base64url:()=>QV,base64:()=>Sj});function Ej(){return new RegExp(Tk0,"u")}function Hr($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function xj($){return new RegExp(`^${Hr($)}$`)}function fj($){let Y=Hr({precision:$.precision}),z=["Z"];if($.local)z.push("");if($.offset)z.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let U=`${Y}(?:${z.join("|")})`;return new RegExp(`^${Wr}T(?:${U})$`)}function KG($,Y){return new RegExp(`^[A-Za-z0-9+/]{${$}}${Y}$`)}function IG($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var wj,Oj,Nj,Dj,Aj,Bj,Pj,Mk0,Tj,_Y=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},wk0,Ok0,Nk0,jj,Dk0,Ak0,Gr,Bk0,Pk0,Tk0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Cj,Rj,_j=($)=>{let Y=D$($??":");return new RegExp(`^(?:[0-9A-F]{2}${Y}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${Y}){5}[0-9a-f]{2}$`)},vj,hj,Sj,QV,jk0,Ek0,gj,yj,Wr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",kj,uj=($)=>{let Y=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${Y}$`)},bj,ij,JG,cj,nj,pj,dj,mj,Ck0,Rk0,_k0,vk0,hk0,Sk0,gk0,yk0,kk0,xk0,fk0,uk0,bk0,ik0,ck0,nk0;var JV=m(()=>{$1();wj=/^[cC][0-9a-z]{6,}$/,Oj=/^[0-9a-z]+$/,Nj=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Dj=/^[0-9a-vA-V]{20}$/,Aj=/^[A-Za-z0-9]{27}$/,Bj=/^[a-zA-Z0-9_-]{21}$/,Pj=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\dLine truncated
|
||||
`).filter((J)=>J),U=Math.min(...z.map((J)=>J.length-J.trimStart().length)),Q=z.map((J)=>J.slice(U)).map((J)=>" ".repeat(this.indent*2)+J);for(let J of Q)this.content.push(J)}compile(){let $=Function,Y=this?.args,U=[...(this?.content??[""]).map((Q)=>` ${Q}`)];return new $(...Y,U.join(`
|
||||
`))}}var HE;var XE=o(()=>{HE={major:4,minor:4,patch:3}});function SE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Tr($){if(!UV.test($))return!1;let Y=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),z=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return SE(z)}function jr($,Y=null){try{let z=$.split(".");if(z.length!==3)return!1;let[U]=z;if(!U)return!1;let Q=JSON.parse(atob(U));if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(Y&&(!("alg"in Q)||Q.alg!==Y))return!1;return!0}catch{return!1}}function Xr($,Y,z){if($.issues.length)Y.issues.push(...x8(z,$.issues));Y.value[z]=$.value}function ZV($,Y,z,U,Q,J){let K=z in U;if($.issues.length){if(Q&&J&&!K)return;Y.issues.push(...x8(z,$.issues))}if(!K&&!Q){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(K)Y.value[z]=void 0}else Y.value[z]=$.value}function Er($){let Y=Object.keys($.shape);for(let U of Y)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let z=Ij($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(z)}}function Cr($,Y,z,U,Q,J){let K=[],I=Q.keySet,G=Q.catchall._zod,W=G.def.type,H=G.optin==="optional",X=G.optout==="optional";for(let Z in Y){if(Z==="__proto__")continue;if(I.has(Z))continue;if(W==="never"){K.push(Z);continue}let q=G.run({value:Y[Z],issues:[]},U);if(q instanceof Promise)$.push(q.then((V)=>ZV(V,z,Z,Y,H,X)));else ZV(q,z,Z,Y,H,X)}if(K.length)z.issues.push({code:"unrecognized_keys",keys:K,input:Y,inst:J});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function Zr($,Y,z,U){for(let J of $)if(J.issues.length===0)return Y.value=J.value,Y;let Q=$.filter((J)=>!X7(J));if(Q.length===1)return Y.value=Q[0].value,Q[0];return Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((K)=>A8(K,U,a4())))}),Y}function qr($,Y,z,U){let Q=$.filter((J)=>J.issues.length===0);if(Q.length===1)return Y.value=Q[0].value,Y;if(Q.length===0)Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((K)=>A8(K,U,a4())))});else Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:[],inclusive:!1});return Y}function ZE($,Y){if($===Y)return{valid:!0,data:$};if($ instanceof Date&&Y instanceof Date&&+$===+Y)return{valid:!0,data:$};if(H7($)&&H7(Y)){let z=Object.keys(Y),U=Object.keys($).filter((J)=>z.indexOf(J)!==-1),Q={...$,...Y};for(let J of U){let K=ZE($[J],Y[J]);if(!K.valid)return{valid:!1,mergeErrorPath:[J,...K.mergeErrorPath]};Q[J]=K.data}return{valid:!0,data:Q}}if(Array.isArray($)&&Array.isArray(Y)){if($.length!==Y.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let U=0;U<$.length;U++){let Q=$[U],J=Y[U],K=ZE(Q,J);if(!K.valid)return{valid:!1,mergeErrorPath:[U,...K.mergeErrorPath]};z.push(K.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function Vr($,Y,z){let U=new Map,Q;for(let I of Y.issues)if(I.code==="unrecognized_keys"){Q??(Q=I);for(let G of I.keys){if(!U.has(G))U.set(G,{});U.get(G).l=!0}}else $.issues.push(I);for(let I of z.issues)if(I.code==="unrecognized_keys")for(let G of I.keys){if(!U.has(G))U.set(G,{});U.get(G).r=!0}else $.issues.push(I);let J=[...U].filter(([,I])=>I.l&&I.r).map(([I])=>I);if(J.length&&Q)$.issues.push({...Q,keys:J});if(X7($))return $;let K=ZE(Y.value,z.value);if(!K.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(K.mergeErrorPath)}`);return $.value=K.data,$}function Lr($,Y){for(let z=$.length-1;z>=0;z--)if($[z]._zod[Y]!=="optional")return z+1;return 0}function Fr($,Y,z){if($.issues.length)Y.issues.push(...x8(z,$.issues));Y.value[z]=$.value}function wr($,Y,z,U,Q){for(let J=0;J<z.length;J++){let K=$[J],I=J<U.length;if(K.issues.length){if(!I&&J>=Q){Y.value.length=J;break}Y.issues.push(...x8(J,K.issues))}Y.value[J]=K.value}for(let J=Y.value.length-1;J>=U.length;J--)if(z[J]._zod.optout==="optional"&&Y.value[J]===void 0)Y.value.length=J;else break;return Y}function Mr($,Y,z,U,Q,J,K){if($.issues.length)if(tI.has(typeof U))z.issues.push(...x8(U,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:Q,inst:J,issues:$.issues.map((I)=>A8(I,K,a4()))});if(Y.issues.length)if(tI.has(typeof U))z.issues.push(...x8(U,Y.issues));else z.issues.push({origin:"map",code:"invalid_element",input:Q,inst:J,key:U,issues:Y.issues.map((I)=>A8(I,K,a4()))});z.value.set($.value,Y.value)}function Or($,Y){if($.issues.length)Y.issues.push(...$.issues);Y.value.add($.value)}function Nr($,Y){if(Y===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Dr($,Y){if($.value===void 0)$.value=Y.defaultValue;return $}function Ar($,Y){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:Y});return $}function WV($,Y,z){if($.issues.length)return $.aborted=!0,$;return Y._zod.run({value:$.value,issues:$.issues,fa
Line truncated
|
||||
`))}}var XE;var ZE=m(()=>{XE={major:4,minor:4,patch:3}});function gE($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}function Cr($){if(!QV.test($))return!1;let Y=$.replace(/[-_]/g,(U)=>U==="-"?"+":"/"),z=Y.padEnd(Math.ceil(Y.length/4)*4,"=");return gE(z)}function Rr($,Y=null){try{let z=$.split(".");if(z.length!==3)return!1;let[U]=z;if(!U)return!1;let Q=JSON.parse(atob(U));if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(Y&&(!("alg"in Q)||Q.alg!==Y))return!1;return!0}catch{return!1}}function Vr($,Y,z){if($.issues.length)Y.issues.push(...x8(z,$.issues));Y.value[z]=$.value}function qV($,Y,z,U,Q,J){let K=z in U;if($.issues.length){if(Q&&J&&!K)return;Y.issues.push(...x8(z,$.issues))}if(!K&&!Q){if(!$.issues.length)Y.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[z]});return}if($.value===void 0){if(K)Y.value[z]=void 0}else Y.value[z]=$.value}function _r($){let Y=Object.keys($.shape);for(let U of Y)if(!$.shape?.[U]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${U}": expected a Zod schema`);let z=Gj($.shape);return{...$,keys:Y,keySet:new Set(Y),numKeys:Y.length,optionalKeys:new Set(z)}}function vr($,Y,z,U,Q,J){let K=[],I=Q.keySet,G=Q.catchall._zod,W=G.def.type,H=G.optin==="optional",X=G.optout==="optional";for(let Z in Y){if(Z==="__proto__")continue;if(I.has(Z))continue;if(W==="never"){K.push(Z);continue}let q=G.run({value:Y[Z],issues:[]},U);if(q instanceof Promise)$.push(q.then((V)=>qV(V,z,Z,Y,H,X)));else qV(q,z,Z,Y,H,X)}if(K.length)z.issues.push({code:"unrecognized_keys",keys:K,input:Y,inst:J});if(!$.length)return z;return Promise.all($).then(()=>{return z})}function Lr($,Y,z,U){for(let J of $)if(J.issues.length===0)return Y.value=J.value,Y;let Q=$.filter((J)=>!X7(J));if(Q.length===1)return Y.value=Q[0].value,Q[0];return Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((K)=>A8(K,U,a4())))}),Y}function Fr($,Y,z,U){let Q=$.filter((J)=>J.issues.length===0);if(Q.length===1)return Y.value=Q[0].value,Y;if(Q.length===0)Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:$.map((J)=>J.issues.map((K)=>A8(K,U,a4())))});else Y.issues.push({code:"invalid_union",input:Y.value,inst:z,errors:[],inclusive:!1});return Y}function qE($,Y){if($===Y)return{valid:!0,data:$};if($ instanceof Date&&Y instanceof Date&&+$===+Y)return{valid:!0,data:$};if(H7($)&&H7(Y)){let z=Object.keys(Y),U=Object.keys($).filter((J)=>z.indexOf(J)!==-1),Q={...$,...Y};for(let J of U){let K=qE($[J],Y[J]);if(!K.valid)return{valid:!1,mergeErrorPath:[J,...K.mergeErrorPath]};Q[J]=K.data}return{valid:!0,data:Q}}if(Array.isArray($)&&Array.isArray(Y)){if($.length!==Y.length)return{valid:!1,mergeErrorPath:[]};let z=[];for(let U=0;U<$.length;U++){let Q=$[U],J=Y[U],K=qE(Q,J);if(!K.valid)return{valid:!1,mergeErrorPath:[U,...K.mergeErrorPath]};z.push(K.data)}return{valid:!0,data:z}}return{valid:!1,mergeErrorPath:[]}}function Mr($,Y,z){let U=new Map,Q;for(let I of Y.issues)if(I.code==="unrecognized_keys"){Q??(Q=I);for(let G of I.keys){if(!U.has(G))U.set(G,{});U.get(G).l=!0}}else $.issues.push(I);for(let I of z.issues)if(I.code==="unrecognized_keys")for(let G of I.keys){if(!U.has(G))U.set(G,{});U.get(G).r=!0}else $.issues.push(I);let J=[...U].filter(([,I])=>I.l&&I.r).map(([I])=>I);if(J.length&&Q)$.issues.push({...Q,keys:J});if(X7($))return $;let K=qE(Y.value,z.value);if(!K.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(K.mergeErrorPath)}`);return $.value=K.data,$}function wr($,Y){for(let z=$.length-1;z>=0;z--)if($[z]._zod[Y]!=="optional")return z+1;return 0}function Or($,Y,z){if($.issues.length)Y.issues.push(...x8(z,$.issues));Y.value[z]=$.value}function Nr($,Y,z,U,Q){for(let J=0;J<z.length;J++){let K=$[J],I=J<U.length;if(K.issues.length){if(!I&&J>=Q){Y.value.length=J;break}Y.issues.push(...x8(J,K.issues))}Y.value[J]=K.value}for(let J=Y.value.length-1;J>=U.length;J--)if(z[J]._zod.optout==="optional"&&Y.value[J]===void 0)Y.value.length=J;else break;return Y}function Dr($,Y,z,U,Q,J,K){if($.issues.length)if(eI.has(typeof U))z.issues.push(...x8(U,$.issues));else z.issues.push({code:"invalid_key",origin:"map",input:Q,inst:J,issues:$.issues.map((I)=>A8(I,K,a4()))});if(Y.issues.length)if(eI.has(typeof U))z.issues.push(...x8(U,Y.issues));else z.issues.push({origin:"map",code:"invalid_element",input:Q,inst:J,key:U,issues:Y.issues.map((I)=>A8(I,K,a4()))});z.value.set($.value,Y.value)}function Ar($,Y){if($.issues.length)Y.issues.push(...$.issues);Y.value.add($.value)}function Br($,Y){if(Y===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}function Pr($,Y){if($.value===void 0)$.value=Y.defaultValue;return $}function Tr($,Y){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:Y});return $}function HV($,Y,z){if($.issues.length)return $.aborted=!0,$;return Y._zod.run({value:$.value,issues:$.issues,fa
Line truncated
|
||||
if (${D}.issues.length) {
|
||||
if (${P} in input) {
|
||||
payload.issues = payload.issues.concat(${D}.issues.map(iss => ({
|
||||
@@ -60,108 +60,108 @@ import{createRequire as wy0}from"node:module";var Gy0=Object.create;var{getProto
|
||||
newResult[${P}] = ${D}.value;
|
||||
}
|
||||
|
||||
`)}q.write("payload.value = newResult;"),q.write("return payload;");let N=q.compile();return(O,D)=>N(Z,O,D)},J,K=CY,I=!TY.jitless,W=I&&Qj.value,H=Y.catchall,X;$._zod.parse=(Z,q)=>{X??(X=U.value);let V=Z.value;if(!K(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(I&&W&&q?.async===!1&&q.jitless!==!0){if(!J)J=Q(Y.shape);if(Z=J(Z,q),!H)return Z;return Cr([],V,Z,q,X,$)}return z(Z,q)}});GG=W0("$ZodUnion",($,Y)=>{V1.init($,Y),E1($._zod,"optin",()=>Y.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),E1($._zod,"optout",()=>Y.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),E1($._zod,"values",()=>{if(Y.options.every((U)=>U._zod.values))return new Set(Y.options.flatMap((U)=>Array.from(U._zod.values)));return}),E1($._zod,"pattern",()=>{if(Y.options.every((U)=>U._zod.pattern)){let U=Y.options.map((Q)=>Q._zod.pattern);return new RegExp(`^(${U.map((Q)=>aI(Q.source)).join("|")})$`)}return});let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,K=[];for(let I of Y.options){let G=I._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)K.push(G),J=!0;else{if(G.issues.length===0)return G;K.push(G)}}if(!J)return Zr(K,U,$,Q);return Promise.all(K).then((I)=>{return Zr(I,U,$,Q)})}});aE=W0("$ZodXor",($,Y)=>{GG.init($,Y),Y.inclusive=!1;let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,K=[];for(let I of Y.options){let G=I._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)K.push(G),J=!0;else K.push(G)}if(!J)return qr(K,U,$,Q);return Promise.all(K).then((I)=>{return qr(I,U,$,Q)})}}),tE=W0("$ZodDiscriminatedUnion",($,Y)=>{Y.inclusive=!1,GG.init($,Y);let z=$._zod.parse;E1($._zod,"propValues",()=>{let Q={};for(let J of Y.options){let K=J._zod.propValues;if(!K||Object.keys(K).length===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(J)}"`);for(let[I,G]of Object.entries(K)){if(!Q[I])Q[I]=new Set;for(let W of G)Q[I].add(W)}}return Q});let U=pU(()=>{let Q=Y.options,J=new Map;for(let K of Q){let I=K._zod.propValues?.[Y.discriminator];if(!I||I.size===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(K)}"`);for(let G of I){if(J.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);J.set(G,K)}}return J});$._zod.parse=(Q,J)=>{let K=Q.value;if(!CY(K))return Q.issues.push({code:"invalid_type",expected:"object",input:K,inst:$}),Q;let I=U.value.get(K?.[Y.discriminator]);if(I)return I._zod.run(Q,J);if(Y.unionFallback||J.direction==="backward")return z(Q,J);return Q.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Y.discriminator,options:Array.from(U.value.keys()),input:K,path:[Y.discriminator],inst:$}),Q}}),eE=W0("$ZodIntersection",($,Y)=>{V1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value,J=Y.left._zod.run({value:Q,issues:[]},U),K=Y.right._zod.run({value:Q,issues:[]},U);if(J instanceof Promise||K instanceof Promise)return Promise.all([J,K]).then(([G,W])=>{return Vr(z,G,W)});return Vr(z,J,K)}});LV=W0("$ZodTuple",($,Y)=>{V1.init($,Y);let z=Y.items;$._zod.parse=(U,Q)=>{let J=U.value;if(!Array.isArray(J))return U.issues.push({input:J,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let K=[],I=Lr(z,"optin"),G=Lr(z,"optout");if(!Y.rest){if(J.length<I)return U.issues.push({code:"too_small",minimum:I,inclusive:!0,input:J,inst:$,origin:"array"}),U;if(J.length>z.length)U.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:J,inst:$,origin:"array"})}let W=Array(z.length);for(let H=0;H<z.length;H++){let X=z[H]._zod.run({value:J[H],issues:[]},Q);if(X instanceof Promise)K.push(X.then((Z)=>{W[H]=Z}));else W[H]=X}if(Y.rest){let H=z.length-1,X=J.slice(z.length);for(let Z of X){H++;let q=Y.rest._zod.run({value:Z,issues:[]},Q);if(q instanceof Promise)K.push(q.then((V)=>Fr(V,U,H)));else Fr(q,U,H)}}if(K.length)return Promise.all(K).then(()=>wr(W,U,z,J,G));return wr(W,U,z,J,G)}});$C=W0("$ZodRecord",($,Y)=>{V1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value;if(!H7(Q))return z.issues.push({expected:"record",code:"invalid_type",input:Q,inst:$}),z;let J=[],K=Y.keyType._zod.values;if(K){z.value={};let I=new Set;for(let W of K)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){I.add(typeof W==="number"?W.toString():W);let H=Y.keyType._zod.run({value:W,issues:[]},U);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map((q)=>A8(q,U,a4())),input:W,path:[W],inst:$});continue}let X=H.value,Z=Y.valueType._zod.run({value:Q[W],issues:[]},U);if(Z instanceof Promise)J.push(Z.then((q)=>{if(q.issues.length)z.issues.push(...x8(W,q.issues));z.value[X]=q.value}));else{if(Z.issues.length)z.issues.push(...x8(W,Z.issues));z.value[X]=Z.value}}let G;for(let W in Q)if(!I.has(W))G=G??[],G.push(W);if(G&&G.length>0)z.issues.push({code:"unrec
Line truncated
|
||||
`)}q.write("payload.value = newResult;"),q.write("return payload;");let O=q.compile();return(N,D)=>O(Z,N,D)},J,K=RY,I=!jY.jitless,W=I&&Jj.value,H=Y.catchall,X;$._zod.parse=(Z,q)=>{X??(X=U.value);let V=Z.value;if(!K(V))return Z.issues.push({expected:"object",code:"invalid_type",input:V,inst:$}),Z;if(I&&W&&q?.async===!1&&q.jitless!==!0){if(!J)J=Q(Y.shape);if(Z=J(Z,q),!H)return Z;return vr([],V,Z,q,X,$)}return z(Z,q)}});WG=W0("$ZodUnion",($,Y)=>{V1.init($,Y),E1($._zod,"optin",()=>Y.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),E1($._zod,"optout",()=>Y.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),E1($._zod,"values",()=>{if(Y.options.every((U)=>U._zod.values))return new Set(Y.options.flatMap((U)=>Array.from(U._zod.values)));return}),E1($._zod,"pattern",()=>{if(Y.options.every((U)=>U._zod.pattern)){let U=Y.options.map((Q)=>Q._zod.pattern);return new RegExp(`^(${U.map((Q)=>tI(Q.source)).join("|")})$`)}return});let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,K=[];for(let I of Y.options){let G=I._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)K.push(G),J=!0;else{if(G.issues.length===0)return G;K.push(G)}}if(!J)return Lr(K,U,$,Q);return Promise.all(K).then((I)=>{return Lr(I,U,$,Q)})}});tE=W0("$ZodXor",($,Y)=>{WG.init($,Y),Y.inclusive=!1;let z=Y.options.length===1?Y.options[0]._zod.run:null;$._zod.parse=(U,Q)=>{if(z)return z(U,Q);let J=!1,K=[];for(let I of Y.options){let G=I._zod.run({value:U.value,issues:[]},Q);if(G instanceof Promise)K.push(G),J=!0;else K.push(G)}if(!J)return Fr(K,U,$,Q);return Promise.all(K).then((I)=>{return Fr(I,U,$,Q)})}}),eE=W0("$ZodDiscriminatedUnion",($,Y)=>{Y.inclusive=!1,WG.init($,Y);let z=$._zod.parse;E1($._zod,"propValues",()=>{let Q={};for(let J of Y.options){let K=J._zod.propValues;if(!K||Object.keys(K).length===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(J)}"`);for(let[I,G]of Object.entries(K)){if(!Q[I])Q[I]=new Set;for(let W of G)Q[I].add(W)}}return Q});let U=dU(()=>{let Q=Y.options,J=new Map;for(let K of Q){let I=K._zod.propValues?.[Y.discriminator];if(!I||I.size===0)throw Error(`Invalid discriminated union option at index "${Y.options.indexOf(K)}"`);for(let G of I){if(J.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);J.set(G,K)}}return J});$._zod.parse=(Q,J)=>{let K=Q.value;if(!RY(K))return Q.issues.push({code:"invalid_type",expected:"object",input:K,inst:$}),Q;let I=U.value.get(K?.[Y.discriminator]);if(I)return I._zod.run(Q,J);if(Y.unionFallback||J.direction==="backward")return z(Q,J);return Q.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:Y.discriminator,options:Array.from(U.value.keys()),input:K,path:[Y.discriminator],inst:$}),Q}}),$C=W0("$ZodIntersection",($,Y)=>{V1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value,J=Y.left._zod.run({value:Q,issues:[]},U),K=Y.right._zod.run({value:Q,issues:[]},U);if(J instanceof Promise||K instanceof Promise)return Promise.all([J,K]).then(([G,W])=>{return Mr(z,G,W)});return Mr(z,J,K)}});FV=W0("$ZodTuple",($,Y)=>{V1.init($,Y);let z=Y.items;$._zod.parse=(U,Q)=>{let J=U.value;if(!Array.isArray(J))return U.issues.push({input:J,inst:$,expected:"tuple",code:"invalid_type"}),U;U.value=[];let K=[],I=wr(z,"optin"),G=wr(z,"optout");if(!Y.rest){if(J.length<I)return U.issues.push({code:"too_small",minimum:I,inclusive:!0,input:J,inst:$,origin:"array"}),U;if(J.length>z.length)U.issues.push({code:"too_big",maximum:z.length,inclusive:!0,input:J,inst:$,origin:"array"})}let W=Array(z.length);for(let H=0;H<z.length;H++){let X=z[H]._zod.run({value:J[H],issues:[]},Q);if(X instanceof Promise)K.push(X.then((Z)=>{W[H]=Z}));else W[H]=X}if(Y.rest){let H=z.length-1,X=J.slice(z.length);for(let Z of X){H++;let q=Y.rest._zod.run({value:Z,issues:[]},Q);if(q instanceof Promise)K.push(q.then((V)=>Or(V,U,H)));else Or(q,U,H)}}if(K.length)return Promise.all(K).then(()=>Nr(W,U,z,J,G));return Nr(W,U,z,J,G)}});YC=W0("$ZodRecord",($,Y)=>{V1.init($,Y),$._zod.parse=(z,U)=>{let Q=z.value;if(!H7(Q))return z.issues.push({expected:"record",code:"invalid_type",input:Q,inst:$}),z;let J=[],K=Y.keyType._zod.values;if(K){z.value={};let I=new Set;for(let W of K)if(typeof W==="string"||typeof W==="number"||typeof W==="symbol"){I.add(typeof W==="number"?W.toString():W);let H=Y.keyType._zod.run({value:W,issues:[]},U);if(H instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(H.issues.length){z.issues.push({code:"invalid_key",origin:"record",issues:H.issues.map((q)=>A8(q,U,a4())),input:W,path:[W],inst:$});continue}let X=H.value,Z=Y.valueType._zod.run({value:Q[W],issues:[]},U);if(Z instanceof Promise)J.push(Z.then((q)=>{if(q.issues.length)z.issues.push(...x8(W,q.issues));z.value[X]=q.value}));else{if(Z.issues.length)z.issues.push(...x8(W,Z.issues));z.value[X]=Z.value}}let G;for(let W in Q)if(!I.has(W))G=G??[],G.push(W);if(G&&G.length>0)z.issues.push({code:"unrec
Line truncated
|
||||
|
||||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let K of $.seen.entries()){let I=K[1];if(Y===K[0]){J(K);continue}if($.external){let W=$.external.registry.get(K[0])?.id;if(Y!==K[0]&&W){J(K);continue}}if($.metadataRegistry.get(K[0])?.id){J(K);continue}if(I.cycle){J(K);continue}if(I.count>1){if($.reused==="ref"){J(K);continue}}}}function F7($,Y){let z=$.seen.get(Y);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(I)=>{let G=$.seen.get(I);if(G.ref===null)return;let W=G.def??G.schema,H={...W},X=G.ref;if(G.ref=null,X){U(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(V);else Object.assign(W,V);if(Object.assign(W,H),I._zod.parent===X)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(!(M in H))delete W[M]}if(V.$ref&&q.def)for(let M in W){if(M==="$ref"||M==="allOf")continue;if(M in q.def&&JSON.stringify(W[M])===JSON.stringify(q.def[M]))delete W[M]}}let Z=I._zod.parent;if(Z&&Z!==X){U(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(W.$ref=q.schema.$ref,q.def)for(let V in W){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(W[V])===JSON.stringify(q.def[V]))delete W[V]}}}$.override({zodSchema:I,jsonSchema:W,path:G.path??[]})};for(let I of[...$.seen.entries()].reverse())U(I[0]);let Q={};if($.target==="draft-2020-12")Q.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Q.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Q.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let I=$.external.registry.get(Y)?.id;if(!I)throw Error("Schema is missing an `id` property");Q.$id=$.external.uri(I)}Object.assign(Q,z.def??z.schema);let J=$.metadataRegistry.get(Y)?.id;if(J!==void 0&&Q.id===J)delete Q.id;let K=$.external?.defs??{};for(let I of $.seen.entries()){let G=I[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;K[G.defId]=G.def}}if($.external);else if(Object.keys(K).length>0)if($.target==="draft-2020-12")Q.$defs=K;else Q.definitions=K;try{let I=JSON.parse(JSON.stringify(Q));return Object.defineProperty(I,"~standard",{value:{...Y["~standard"],jsonSchema:{input:XQ(Y,"input",$.processors),output:XQ(Y,"output",$.processors)}},enumerable:!1,writable:!1}),I}catch(I){throw Error("Error converting schema to JSON.")}}function P8($,Y){let z=Y??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return P8(U.element,z);if(U.type==="set")return P8(U.valueType,z);if(U.type==="lazy")return P8(U.getter(),z);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return P8(U.innerType,z);if(U.type==="intersection")return P8(U.left,z)||P8(U.right,z);if(U.type==="record"||U.type==="map")return P8(U.keyType,z)||P8(U.valueType,z);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return P8(U.in,z)||P8(U.out,z)}if(U.type==="object"){for(let Q in U.shape)if(P8(U.shape[Q],z))return!0;return!1}if(U.type==="union"){for(let Q of U.options)if(P8(Q,z))return!0;return!1}if(U.type==="tuple"){for(let Q of U.items)if(P8(Q,z))return!0;if(U.rest&&P8(U.rest,z))return!0;return!1}return!1}var H_=($,Y={})=>(z)=>{let U=V7({...z,processors:Y});return J4($,U),L7(U,$),F7(U,$)},XQ=($,Y,z={})=>(U)=>{let{libraryOptions:Q,target:J}=U??{},K=V7({...Q??{},target:J,io:Y,processors:z});return J4($,K),L7(K,$),F7(K,$)};var MG=o(()=>{LG()});function gY($,Y){if("_idmap"in $){let U=$,Q=V7({...Y,processors:pV}),J={};for(let G of U._idmap.entries()){let[W,H]=G;J4(H,Q)}let K={},I={registry:U,uri:Y?.uri,defs:J};Q.external=I;for(let G of U._idmap.entries()){let[W,H]=G;L7(Q,H),K[W]=F7(Q,H)}if(Object.keys(J).length>0){let G=Q.target==="draft-2020-12"?"$defs":"definitions";K.__shared={[G]:J}}return{schemas:K}}let z=V7({...Y,processors:pV});return J4($,z),L7(z,$),F7(z,$)}var Yf0,X_=($,Y,z,U)=>{let Q=z;Q.type="string";let{minimum:J,maximum:K,format:I,patterns:G,contentEncoding:W}=$._zod.bag;if(typeof J==="number")Q.minLength=J;if(typeof K==="number")Q.maxLength=K;if(I){if(Q.format=Yf0[I]??I,Q.format==="")delete Q.format;if(I==="time")delete Q.format}if(W)Q.contentEncoding=W;if(G&&G.size>0){let H=[...G];if(H.length===1)Q.pattern=H[0].source;else if(H.length>1)Q.allOf=[...H.map((X)=>({...Y.target==="draft-07"||Y.target==="draft-04"||Y.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},Z_=($,Y,z,U)=>{let Q=z,{minimum:J,maximum:K,format:I,multipleOf:G,exclusiveMaximum:W,exclusiveMinimum:H}=$._zod.bag;if(typeof I==="string"&&I.includes("int"))Q.type="integer";else Q.type="number";let X=typeof H==="number"&&H>=(J??Number.NEGATIVE_INFINITY),Z=typeof W==="number"&&W<=(K??Number.POSITIVE_INFINITY),q=Y.target==="draft-04"||Y.target==="openapi-3.0";if(X)if(q)Q.minimum=H,Q.exclusiveMinimum=!0;else Q.exclusiveMinimuLine truncated
|
||||
`}function yu0($){let Y=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))Y.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))Y.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))Y.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))Y.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!gu0.test($)){let z=[...$].filter((U)=>!/[A-Za-z0-9._-]/.test(U)).filter((U,Q,J)=>J.indexOf(U)===Q);return Y.push(`Tool name contains invalid characters: ${z.map((U)=>`"${U}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:Y}}return{isValid:!0,warnings:Y}}function ku0($,Y){if(Y.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let z of Y)console.warn(` - ${z}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function IS($){let Y=yu0($);return ku0($,Y.warnings),Y.isValid}function xu0($){return typeof $==="object"&&$!==null&&"_zod"in $}function fu0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function uu0($){if(typeof $!=="object"||$===null)return!1;if(gQ($))return!1;let Y=Object.getPrototypeOf($);if(Y!==Object.prototype&&Y!==null)return!1;return Object.values($).every((z)=>xu0(z))}function _w($){if($===void 0)return;if(uu0($))return z0($);if(typeof $==="object"&&$!==null&&!gQ($)&&Object.values($).some((Y)=>fu0(Y)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!gQ($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var yh,wf0,B1,L1,Mf0,At="2026-07-28",R7,Tt,Df0,Af0,Bf0,Ct,Rt,Tf0,Vw,Wu1,Hu1,Ht,nh,vf0,hf0,hQ,n0,J1,Bw,ht,kQ,Pw,yf0=0,kf0="private",xf0,df0,Fw,lh,yt,Xu1,Zu1,af0,tf0,oh,ww,qW="2026-07-28",ft,Yu0,D$=($)=>uG.safeParse($).success,_7=($)=>bG.safeParse($).success,XW=($)=>DQ.safeParse($).success,Cw=($)=>AQ.safeParse($).success,t9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",Lt="x-mcp-header",zu0,Uu0,Qu0,Ju0,Nw=-32020,qu1,Ku0,Ft=!1,xh="draft-2020-12",Wu0,Vu0,Lu0,wt,Fu0,Au0,it=250,Bu0,Pu0,dt,mt,Tu0,ju0,ot=60000,Cu0,Ru0,_u0,rt,US,Su0,Vu1,st=10485760,JS=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??st}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
|
||||
`);if($===-1)return null;let Y=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return at(Y)}catch(z){if(z instanceof SyntaxError)continue;throw z}}return null}clear(){this._buffer=void 0}},gu0;var vw=o(()=>{tT();eT();It();$h();yh=Symbol.for("mcp.sdk.errorBrands");wf0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](Y){return SQ(this,Y)}static isInstance(Y){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return SQ(this,Y)}constructor(Y,z,U){super(z);this.code=Y,this.errorUri=U,this.name="OAuthError",uh(this,new.target)}toResponseObject(){let Y={error:this.code,error_description:this.message};if(this.errorUri)Y.error_uri=this.errorUri;return Y}static fromResponse(Y){return new $(Y.error,Y.error_description??Y.error,Y.error_uri)}},B1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),L1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return SQ(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return SQ(this,$)}constructor($,Y,z){super(Y);this.code=$,this.data=z,this.name="SdkError",uh(this,new.target)}},Mf0=class extends L1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,Y,z){super($,Y,z);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};R7=[At];Tt=["task","inputRequests","requestState"];Af0=new Set(["const","enum","default","examples"]),Bf0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);Ct={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Rt={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Tf0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};Wu1=Object.keys(Ct),Hu1=Object.keys(Rt);Ht={ok:!1,reason:"not-in-era"};nh={era:"2025-11-25",hasRequestMethod:_t,hasNotificationMethod:vt,validateRequest:($,Y)=>Lw(Cf0($),Y),validateResult:($,Y)=>Lw(Ef0($),Y),validateNotification:($,Y)=>Lw(Rf0($),Y),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Ht,validateInputResponse:()=>Ht,samplingResultVariant:($,Y)=>{let z=jt();return Lw($?z.CreateMessageResultWithToolsSchema:z.CreateMessageResultSchema,Y)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,Y){let z=Pt($),U=z.structuredContent;if(U===void 0)return z;let Q=typeof U!=="object"||U===null||Array.isArray(U),J=Y!==void 0&&Et(Y);if(!Q&&!J)return z;return{...z,structuredContent:{result:U}}},decodeResult($,Y){if(kh(Y)&&"resultType"in Y){let z={...Y};return delete z.resultType,{kind:"complete",result:Zt(z)}}return{kind:"complete",result:Zt(Y)}},encodeResult($,Y){if($!=="tools/list")return Y;l
Line truncated
|
||||
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let K of $.seen.entries()){let I=K[1];if(Y===K[0]){J(K);continue}if($.external){let W=$.external.registry.get(K[0])?.id;if(Y!==K[0]&&W){J(K);continue}}if($.metadataRegistry.get(K[0])?.id){J(K);continue}if(I.cycle){J(K);continue}if(I.count>1){if($.reused==="ref"){J(K);continue}}}}function F7($,Y){let z=$.seen.get(Y);if(!z)throw Error("Unprocessed schema. This is a bug in Zod.");let U=(I)=>{let G=$.seen.get(I);if(G.ref===null)return;let W=G.def??G.schema,H={...W},X=G.ref;if(G.ref=null,X){U(X);let q=$.seen.get(X),V=q.schema;if(V.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))W.allOf=W.allOf??[],W.allOf.push(V);else Object.assign(W,V);if(Object.assign(W,H),I._zod.parent===X)for(let w in W){if(w==="$ref"||w==="allOf")continue;if(!(w in H))delete W[w]}if(V.$ref&&q.def)for(let w in W){if(w==="$ref"||w==="allOf")continue;if(w in q.def&&JSON.stringify(W[w])===JSON.stringify(q.def[w]))delete W[w]}}let Z=I._zod.parent;if(Z&&Z!==X){U(Z);let q=$.seen.get(Z);if(q?.schema.$ref){if(W.$ref=q.schema.$ref,q.def)for(let V in W){if(V==="$ref"||V==="allOf")continue;if(V in q.def&&JSON.stringify(W[V])===JSON.stringify(q.def[V]))delete W[V]}}}$.override({zodSchema:I,jsonSchema:W,path:G.path??[]})};for(let I of[...$.seen.entries()].reverse())U(I[0]);let Q={};if($.target==="draft-2020-12")Q.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")Q.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")Q.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let I=$.external.registry.get(Y)?.id;if(!I)throw Error("Schema is missing an `id` property");Q.$id=$.external.uri(I)}Object.assign(Q,z.def??z.schema);let J=$.metadataRegistry.get(Y)?.id;if(J!==void 0&&Q.id===J)delete Q.id;let K=$.external?.defs??{};for(let I of $.seen.entries()){let G=I[1];if(G.def&&G.defId){if(G.def.id===G.defId)delete G.def.id;K[G.defId]=G.def}}if($.external);else if(Object.keys(K).length>0)if($.target==="draft-2020-12")Q.$defs=K;else Q.definitions=K;try{let I=JSON.parse(JSON.stringify(Q));return Object.defineProperty(I,"~standard",{value:{...Y["~standard"],jsonSchema:{input:ZQ(Y,"input",$.processors),output:ZQ(Y,"output",$.processors)}},enumerable:!1,writable:!1}),I}catch(I){throw Error("Error converting schema to JSON.")}}function P8($,Y){let z=Y??{seen:new Set};if(z.seen.has($))return!1;z.seen.add($);let U=$._zod.def;if(U.type==="transform")return!0;if(U.type==="array")return P8(U.element,z);if(U.type==="set")return P8(U.valueType,z);if(U.type==="lazy")return P8(U.getter(),z);if(U.type==="promise"||U.type==="optional"||U.type==="nonoptional"||U.type==="nullable"||U.type==="readonly"||U.type==="default"||U.type==="prefault")return P8(U.innerType,z);if(U.type==="intersection")return P8(U.left,z)||P8(U.right,z);if(U.type==="record"||U.type==="map")return P8(U.keyType,z)||P8(U.valueType,z);if(U.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return P8(U.in,z)||P8(U.out,z)}if(U.type==="object"){for(let Q in U.shape)if(P8(U.shape[Q],z))return!0;return!1}if(U.type==="union"){for(let Q of U.options)if(P8(Q,z))return!0;return!1}if(U.type==="tuple"){for(let Q of U.items)if(P8(Q,z))return!0;if(U.rest&&P8(U.rest,z))return!0;return!1}return!1}var X_=($,Y={})=>(z)=>{let U=V7({...z,processors:Y});return J4($,U),L7(U,$),F7(U,$)},ZQ=($,Y,z={})=>(U)=>{let{libraryOptions:Q,target:J}=U??{},K=V7({...Q??{},target:J,io:Y,processors:z});return J4($,K),L7(K,$),F7(K,$)};var OG=m(()=>{FG()});function yY($,Y){if("_idmap"in $){let U=$,Q=V7({...Y,processors:dV}),J={};for(let G of U._idmap.entries()){let[W,H]=G;J4(H,Q)}let K={},I={registry:U,uri:Y?.uri,defs:J};Q.external=I;for(let G of U._idmap.entries()){let[W,H]=G;L7(Q,H),K[W]=F7(Q,H)}if(Object.keys(J).length>0){let G=Q.target==="draft-2020-12"?"$defs":"definitions";K.__shared={[G]:J}}return{schemas:K}}let z=V7({...Y,processors:dV});return J4($,z),L7(z,$),F7(z,$)}var Xf0,Z_=($,Y,z,U)=>{let Q=z;Q.type="string";let{minimum:J,maximum:K,format:I,patterns:G,contentEncoding:W}=$._zod.bag;if(typeof J==="number")Q.minLength=J;if(typeof K==="number")Q.maxLength=K;if(I){if(Q.format=Xf0[I]??I,Q.format==="")delete Q.format;if(I==="time")delete Q.format}if(W)Q.contentEncoding=W;if(G&&G.size>0){let H=[...G];if(H.length===1)Q.pattern=H[0].source;else if(H.length>1)Q.allOf=[...H.map((X)=>({...Y.target==="draft-07"||Y.target==="draft-04"||Y.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}},q_=($,Y,z,U)=>{let Q=z,{minimum:J,maximum:K,format:I,multipleOf:G,exclusiveMaximum:W,exclusiveMinimum:H}=$._zod.bag;if(typeof I==="string"&&I.includes("int"))Q.type="integer";else Q.type="number";let X=typeof H==="number"&&H>=(J??Number.NEGATIVE_INFINITY),Z=typeof W==="number"&&W<=(K??Number.POSITIVE_INFINITY),q=Y.target==="draft-04"||Y.target==="openapi-3.0";if(X)if(q)Q.minimum=H,Q.exclusiveMinimum=!0;else Q.exclusiveMinimuLine truncated
|
||||
`}function du0($){let Y=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))Y.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))Y.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))Y.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))Y.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!pu0.test($)){let z=[...$].filter((U)=>!/[A-Za-z0-9._-]/.test(U)).filter((U,Q,J)=>J.indexOf(U)===Q);return Y.push(`Tool name contains invalid characters: ${z.map((U)=>`"${U}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:Y}}return{isValid:!0,warnings:Y}}function mu0($,Y){if(Y.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let z of Y)console.warn(` - ${z}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function GS($){let Y=du0($);return mu0($,Y.warnings),Y.isValid}function lu0($){return typeof $==="object"&&$!==null&&"_zod"in $}function ou0($){return typeof $==="object"&&$!==null&&!("_zod"in $)&&"_def"in $&&typeof $._def?.typeName==="string"}function ru0($){if(typeof $!=="object"||$===null)return!1;if(yQ($))return!1;let Y=Object.getPrototypeOf($);if(Y!==Object.prototype&&Y!==null)return!1;return Object.values($).every((z)=>lu0(z))}function vM($){if($===void 0)return;if(ru0($))return z0($);if(typeof $==="object"&&$!==null&&!yQ($)&&Object.values($).some((Y)=>ou0(Y)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!yQ($))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return $}var kh,Ef0,B1,L1,Cf0,Tt="2026-07-28",R7,Ct,vf0,hf0,Sf0,vt,ht,yf0,LM,Bu1,Pu1,qt,ph,if0,cf0,SQ,n0,J1,PM,yt,xQ,TM,df0=0,mf0="private",lf0,Yu0,MM,oh,ft,Tu1,ju1,Iu0,Gu0,rh,wM,VW="2026-07-28",it,Xu0,A$=($)=>bG.safeParse($).success,_7=($)=>iG.safeParse($).success,ZW=($)=>AQ.safeParse($).success,RM=($)=>BQ.safeParse($).success,t9=($)=>typeof $==="object"&&$!==null&&!Array.isArray($)&&$.resultType==="input_required",wt="x-mcp-header",Zu0,qu0,Vu0,Lu0,DM=-32020,Eu1,Fu0,Ot=!1,fh="draft-2020-12",Ou0,Pu0,Tu0,Nt,ju0,hu0,pt=250,Su0,gu0,ot,rt,yu0,ku0,at=60000,fu0,uu0,bu0,tt,QS,nu0,Cu1,et=10485760,KS=class{_buffer;_maxBufferSize;constructor($){this._maxBufferSize=$?.maxBufferSize??et}append($){if((this._buffer?.length??0)+$.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){while(this._buffer){let $=this._buffer.indexOf(`
|
||||
`);if($===-1)return null;let Y=this._buffer.toString("utf8",0,$).replace(/\r$/,"");this._buffer=this._buffer.subarray($+1);try{return $e(Y)}catch(z){if(z instanceof SyntaxError)continue;throw z}}return null}clear(){this._buffer=void 0}},pu0;var hM=m(()=>{eT();$j();Ht();Yh();kh=Symbol.for("mcp.sdk.errorBrands");Ef0=class $ extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](Y){return gQ(this,Y)}static isInstance(Y){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return gQ(this,Y)}constructor(Y,z,U){super(z);this.code=Y,this.errorUri=U,this.name="OAuthError",bh(this,new.target)}toResponseObject(){let Y={error:this.code,error_description:this.message};if(this.errorUri)Y.error_uri=this.errorUri;return Y}static fromResponse(Y){return new $(Y.error,Y.error_description??Y.error,Y.error_uri)}},B1=function($){return $.NotConnected="NOT_CONNECTED",$.AlreadyConnected="ALREADY_CONNECTED",$.NotInitialized="NOT_INITIALIZED",$.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",$.RequestTimeout="REQUEST_TIMEOUT",$.ConnectionClosed="CONNECTION_CLOSED",$.SendFailed="SEND_FAILED",$.InvalidResult="INVALID_RESULT",$.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",$.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",$.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",$.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",$.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",$.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",$.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",$.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",$.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",$.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",$.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",$}({}),L1=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance]($){return gQ(this,$)}static isInstance($){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return gQ(this,$)}constructor($,Y,z){super(Y);this.code=$,this.data=z,this.name="SdkError",bh(this,new.target)}},Cf0=class extends L1{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor($,Y,z){super($,Y,z);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};R7=[Tt];Ct=["task","inputRequests","requestState"];hf0=new Set(["const","enum","default","examples"]),Sf0=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);vt={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ht={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},yf0={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null};Bu1=Object.keys(vt),Pu1=Object.keys(ht);qt={ok:!1,reason:"not-in-era"};ph={era:"2025-11-25",hasRequestMethod:St,hasNotificationMethod:gt,validateRequest:($,Y)=>FM(ff0($),Y),validateResult:($,Y)=>FM(xf0($),Y),validateNotification:($,Y)=>FM(uf0($),Y),hasInputRequestMethod:()=>!1,validateInputRequest:()=>qt,validateInputResponse:()=>qt,samplingResultVariant:($,Y)=>{let z=Rt();return FM($?z.CreateMessageResultWithToolsSchema:z.CreateMessageResultSchema,Y)},outboundEnvelope:($)=>{return},validateEnvelopeMeta:($)=>[],projectCallToolResult($,Y){let z=Et($),U=z.structuredContent;if(U===void 0)return z;let Q=typeof U!=="object"||U===null||Array.isArray(U),J=Y!==void 0&&_t(Y);if(!Q&&!J)return z;return{...z,structuredContent:{result:U}}},decodeResult($,Y){if(xh(Y)&&"resultType"in Y){let z={...Y};return delete z.resultType,{kind:"complete",result:Lt(z)}}return{kind:"complete",result:Lt(Y)}},encodeResult($,Y){if($!=="tools/list")return Y;l
Line truncated
|
||||
* content-type
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/Su0=R0(($)=>{var Y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,z=/\\([\u000b\u0020-\u00ff])/g,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=Q;function Q(I){if(!I)throw TypeError("argument string is required");var G=typeof I==="object"?J(I):I;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var W=G.indexOf(";"),H=W!==-1?G.slice(0,W).trim():G.trim();if(!U.test(H))throw TypeError("invalid media type");var X=new K(H.toLowerCase());if(W!==-1){var Z,q,V;Y.lastIndex=W;while(q=Y.exec(G)){if(q.index!==W)throw TypeError("invalid parameter format");if(W+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(z,"$1")}X.parameters[Z]=V}if(W!==G.length)throw TypeError("invalid parameter format")}return X}function J(I){var G;if(typeof I.getHeader==="function")G=I.getHeader("content-type");else if(typeof I.headers==="object")G=I.headers&&I.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function K(I){this.parameters=Object.create(null),this.type=I}}),Vu1=pq(Su0(),1);gu0=/^[A-Za-z0-9._-]{1,128}$/});function GS($){let Y=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Yi0(Y),Y}var hw,tt,F1,v1,U5,gw,bu0,et,$e,Sw,iu0,Q5,cu0,nu0,Ye,pu0,yw,xQ,LW,fQ,kw,du0,ze,mu0,lu0,ou0,WS,ru0,HS,Ue,su0,au0,tu0,eu0,$b0,Yb0,zb0,Ub0,XS,Qb0,Jb0,Kb0,Qe,Je,Ke,Ib0,Gb0,Wb0,ZS,Hb0,Ie,Xb0,Zb0,qb0,Vb0,Lb0,Fb0,wb0,Mb0,Ge,Ob0,We,He,Xe,Nb0,qS,Db0,Ze,qe,Ve,Ab0,Bb0,Le,Pb0,Tb0,jb0,Fe,Eb0,Cb0,we,Rb0,_b0,vb0,hb0,Sb0,gb0,yb0,kb0,xb0,fb0,ub0,bb0,ib0,cb0,nb0,pb0,db0,mb0,lb0,ob0,rb0,sb0,ab0,Me,tb0,eb0,$i0,Yi0,xw=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=GS(eb0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let Y=ao($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(Y==="2020-12")return this.ajv;if(Y==="2019-09")return this._ajv2019??=GS(tb0.Ajv2019);return this._ajvDraft7??=GS(Me.Ajv)}getValidator($){let Y=this._engineFor($),z="$id"in $&&typeof $.$id==="string"?Y.getSchema($.$id)??Y.compile($):Y.compile($);return(U)=>{return z(U)?{valid:!0,data:U,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:Y.errorsText(z.errors)}}}},ju1;var Oe=o(()=>{tT();eT();hw=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var Y=class{};$._CodeOrName=Y,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var z=class extends Y{constructor(w){super();if(!$.IDENTIFIER.test(w))throw Error("CodeGen: name must be a valid identifier");this.str=w}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=z;var U=class extends Y{constructor(w){super();this._items=typeof w==="string"?[w]:w}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let w=this._items[0];return w===""||w==='""'}get str(){var w;return(w=this._str)!==null&&w!==void 0?w:this._str=this._items.reduce((N,O)=>`${N}${O}`,"")}get names(){var w;return(w=this._names)!==null&&w!==void 0?w:this._names=this._items.reduce((N,O)=>{if(O instanceof z)N[O.str]=(N[O.str]||0)+1;return N},{})}};$._Code=U,$.nil=new U("");function Q(w,...N){let O=[w[0]],D=0;while(D<N.length)I(O,N[D]),O.push(w[++D]);return new U(O)}$._=Q;let J=new U("+");function K(w,...N){let O=[q(w[0])],D=0;while(D<N.length)O.push(J),I(O,N[D]),O.push(J,q(w[++D]));return G(O),new U(O)}$.str=K;function I(w,N){if(N instanceof U)w.push(...N._items);else if(N instanceof z)w.push(N);else w.push(X(N))}$.addCodeArg=I;function G(w){let N=1;while(N<w.length-1){if(w[N]===J){let O=W(w[N-1],w[N+1]);if(O!==void 0){w.splice(N-1,3,O);continue}w[N++]="+"}N++}}function W(w,N){if(N==='""')return w;if(w==='""')return N;if(typeof w=="string"){if(N instanceof z||w[w.length-1]!=='"')return;if(typeof N!="string")return`${w.slice(0,-1)}${N}"`;if(N[0]==='"')return w.slice(0,-1)+N.slice(1);return}if(typeof N=="string"&&N[0]==='"'&&!(w instanceof z))return`"${w}${N.slice(1)}`}function H(w,N){return N.emptyStr()?w:w.emptyStr()?N:K`${w}${N}`}$.strConcat=H;function X(w){return typeof w=="number"||typeof w=="boolean"||w===null?w:q(Array.isArray(w)?w.join(","):w)}function Z(w){return new U(q(w))}$.stringify=Z;function q(w){return JSON.stringify(w).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(w){return typeof w=="string"&&$.IDENTIFIER.test(w)?new U(`.${w}`):Q`[${w}]`}$.getProperty=V;function F(w){if(typeof w=="string"&&$.IDENTIFIER.test(w))return new U(`${w}`);throw Error(`CodeGen: invalid export name: ${w}, use explicit $id name mapping`)}$.getEsmExportName=F;function M(w){return new U(w.toStringLine truncated
|
||||
`:""},this._extScope=y,this._scope=new z.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let Y0=this._extScope.value(y,s);return(this._values[Y0.prefix]||(this._values[Y0.prefix]=new Set)).add(Y0),Y0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,Y0,N0){let E0=this._scope.toName(s);if(Y0!==void 0&&N0)this._constants[E0.str]=Y0;return this._leafNode(new K(y,E0,Y0)),E0}const(y,s,Y0){return this._def(z.varKinds.const,y,s,Y0)}let(y,s,Y0){return this._def(z.varKinds.let,y,s,Y0)}var(y,s,Y0){return this._def(z.varKinds.var,y,s,Y0)}assign(y,s,Y0){return this._leafNode(new I(y,s,Y0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==Y.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[Y0,N0]of y){if(s.length>1)s.push(",");if(s.push(Y0),Y0!==N0||this.opts.es5)s.push(":"),(0,Y.addCodeArg)(s,N0)}return s.push("}"),new Y._Code(s)}if(y,s,Y0){if(this._blockNode(new w(y)),s&&Y0)this.code(s).else().code(Y0).endIf();else if(s)this.code(s).endIf();else if(Y0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new w(y))}else(){return this._elseNode(new M)}endIf(){return this._endBlockNode(w,M)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new O(y),s)}forRange(y,s,Y0,N0,E0=this.opts.es5?z.varKinds.var:z.varKinds.let){let G0=this._scope.toName(y);return this._for(new D(E0,G0,s,Y0),()=>N0(G0))}forOf(y,s,Y0,N0=z.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof Y.Name?s:this.var("_arr",s);return this.forRange("_i",0,Y._`${G0}.length`,(T0)=>{this.var(E0,Y._`${G0}[${T0}]`),Y0(E0)})}return this._for(new P("of",N0,E0,s),()=>Y0(E0))}forIn(y,s,Y0,N0=this.opts.es5?z.varKinds.var:z.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,Y._`Object.keys(${s})`,Y0);let E0=this._scope.toName(y);return this._for(new P("in",N0,E0,s),()=>Y0(E0))}endFor(){return this._endBlockNode(N)}label(y){return this._leafNode(new W(y))}break(y){return this._leafNode(new H(y))}return(y){let s=new A;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(y,s,Y0){if(!s&&!Y0)throw Error('CodeGen: "try" without "catch" and "finally"');let N0=new j;if(this._blockNode(N0),this.code(y),s){let E0=this.name("e");this._currNode=N0.catch=new C(E0),s(E0)}if(Y0)this._currNode=N0.finally=new b,this.code(Y0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let Y0=this._nodes.length-s;if(Y0<0||y!==void 0&&Y0!==y)throw Error(`CodeGen: wrong number of nodes: ${Y0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=Y.nil,Y0,N0){if(this._blockNode(new T(y,s,Y0)),N0)this.code(N0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let Y0=this._currNode;if(Y0 instanceof y||s&&Y0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof w))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=x;function S(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)+(s[Y0]||0);return y}function i(y,s){return s instanceof Y._CodeOrName?S(y,s.names):y}function c(y,s,Y0){if(y instanceof Y.Name)return N0(y);if(!E0(y))return y;return new Y._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof Y.Name)T0=N0(T0);if(T0 instanceof Y._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function N0(G0){let T0=Y0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof Y._Code&&G0._items.some((T0)=>T0 instanceof Y.Name&&s[T0.str]===1&&Y0[T0.str]!==void 0)}}function U0(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)-(s[Y0]||0)}function k(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:Y._`!${e(y)}`}$.not=k;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,Y0)=>s===Y.nil?Y0:Y0===Y.nil?s:Y._`${e(s)} ${y} ${e(Y0)}`}function
Line truncated
|
||||
*/nu0=R0(($)=>{var Y=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,z=/\\([\u000b\u0020-\u00ff])/g,U=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;$.parse=Q;function Q(I){if(!I)throw TypeError("argument string is required");var G=typeof I==="object"?J(I):I;if(typeof G!=="string")throw TypeError("argument string is required to be a string");var W=G.indexOf(";"),H=W!==-1?G.slice(0,W).trim():G.trim();if(!U.test(H))throw TypeError("invalid media type");var X=new K(H.toLowerCase());if(W!==-1){var Z,q,V;Y.lastIndex=W;while(q=Y.exec(G)){if(q.index!==W)throw TypeError("invalid parameter format");if(W+=q[0].length,Z=q[1].toLowerCase(),V=q[2],V.charCodeAt(0)===34){if(V=V.slice(1,-1),V.indexOf("\\")!==-1)V=V.replace(z,"$1")}X.parameters[Z]=V}if(W!==G.length)throw TypeError("invalid parameter format")}return X}function J(I){var G;if(typeof I.getHeader==="function")G=I.getHeader("content-type");else if(typeof I.headers==="object")G=I.headers&&I.headers["content-type"];if(typeof G!=="string")throw TypeError("content-type header is missing from object");return G}function K(I){this.parameters=Object.create(null),this.type=I}}),Cu1=dq(nu0(),1);pu0=/^[A-Za-z0-9._-]{1,128}$/});function WS($){let Y=new $({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Xi0(Y),Y}var SM,Ye,F1,v1,U5,yM,su0,ze,Ue,gM,au0,Q5,tu0,eu0,Qe,$b0,kM,fQ,FW,uQ,xM,Yb0,Je,zb0,Ub0,Qb0,HS,Jb0,XS,Ke,Kb0,Ib0,Gb0,Wb0,Hb0,Xb0,Zb0,qb0,ZS,Vb0,Lb0,Fb0,Ie,Ge,We,Mb0,wb0,Ob0,qS,Nb0,He,Db0,Ab0,Bb0,Pb0,Tb0,jb0,Eb0,Cb0,Xe,Rb0,Ze,qe,Ve,_b0,VS,vb0,Le,Fe,Me,hb0,Sb0,we,gb0,yb0,kb0,Oe,xb0,fb0,Ne,ub0,bb0,ib0,cb0,nb0,pb0,db0,mb0,lb0,ob0,rb0,sb0,ab0,tb0,eb0,$i0,Yi0,zi0,Ui0,Qi0,Ji0,Ki0,Ii0,De,Gi0,Wi0,Hi0,Xi0,fM=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor($){this._userAjv=$!==void 0,this._ajv=$}get ajv(){return this._ajv??=WS(Wi0.Ajv2020)}_engineFor($){if(this._userAjv)return this.ajv;let Y=$r($,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(Y==="2020-12")return this.ajv;if(Y==="2019-09")return this._ajv2019??=WS(Gi0.Ajv2019);return this._ajvDraft7??=WS(De.Ajv)}getValidator($){let Y=this._engineFor($),z="$id"in $&&typeof $.$id==="string"?Y.getSchema($.$id)??Y.compile($):Y.compile($);return(U)=>{return z(U)?{valid:!0,data:U,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:Y.errorsText(z.errors)}}}},bu1;var Ae=m(()=>{eT();$j();SM=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.regexpCode=$.getEsmExportName=$.getProperty=$.safeStringify=$.stringify=$.strConcat=$.addCodeArg=$.str=$._=$.nil=$._Code=$.Name=$.IDENTIFIER=$._CodeOrName=void 0;var Y=class{};$._CodeOrName=Y,$.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var z=class extends Y{constructor(M){super();if(!$.IDENTIFIER.test(M))throw Error("CodeGen: name must be a valid identifier");this.str=M}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};$.Name=z;var U=class extends Y{constructor(M){super();this._items=typeof M==="string"?[M]:M}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let M=this._items[0];return M===""||M==='""'}get str(){var M;return(M=this._str)!==null&&M!==void 0?M:this._str=this._items.reduce((O,N)=>`${O}${N}`,"")}get names(){var M;return(M=this._names)!==null&&M!==void 0?M:this._names=this._items.reduce((O,N)=>{if(N instanceof z)O[N.str]=(O[N.str]||0)+1;return O},{})}};$._Code=U,$.nil=new U("");function Q(M,...O){let N=[M[0]],D=0;while(D<O.length)I(N,O[D]),N.push(M[++D]);return new U(N)}$._=Q;let J=new U("+");function K(M,...O){let N=[q(M[0])],D=0;while(D<O.length)N.push(J),I(N,O[D]),N.push(J,q(M[++D]));return G(N),new U(N)}$.str=K;function I(M,O){if(O instanceof U)M.push(...O._items);else if(O instanceof z)M.push(O);else M.push(X(O))}$.addCodeArg=I;function G(M){let O=1;while(O<M.length-1){if(M[O]===J){let N=W(M[O-1],M[O+1]);if(N!==void 0){M.splice(O-1,3,N);continue}M[O++]="+"}O++}}function W(M,O){if(O==='""')return M;if(M==='""')return O;if(typeof M=="string"){if(O instanceof z||M[M.length-1]!=='"')return;if(typeof O!="string")return`${M.slice(0,-1)}${O}"`;if(O[0]==='"')return M.slice(0,-1)+O.slice(1);return}if(typeof O=="string"&&O[0]==='"'&&!(M instanceof z))return`"${M}${O.slice(1)}`}function H(M,O){return O.emptyStr()?M:M.emptyStr()?O:K`${M}${O}`}$.strConcat=H;function X(M){return typeof M=="number"||typeof M=="boolean"||M===null?M:q(Array.isArray(M)?M.join(","):M)}function Z(M){return new U(q(M))}$.stringify=Z;function q(M){return JSON.stringify(M).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}$.safeStringify=q;function V(M){return typeof M=="string"&&$.IDENTIFIER.test(M)?new U(`.${M}`):Q`[${M}]`}$.getProperty=V;function F(M){if(typeof M=="string"&&$.IDENTIFIER.test(M))return new U(`${M}`);throw Error(`CodeGen: invalid export name: ${M}, use explicit $id name mapping`)}$.getEsmExportName=F;function w(M){return new U(M.toStringLine truncated
|
||||
`:""},this._extScope=y,this._scope=new z.Scope({parent:y}),this._nodes=[new F]}toString(){return this._root.render(this.opts)}name(y){return this._scope.name(y)}scopeName(y){return this._extScope.name(y)}scopeValue(y,s){let Y0=this._extScope.value(y,s);return(this._values[Y0.prefix]||(this._values[Y0.prefix]=new Set)).add(Y0),Y0}getScopeValue(y,s){return this._extScope.getValue(y,s)}scopeRefs(y){return this._extScope.scopeRefs(y,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(y,s,Y0,N0){let E0=this._scope.toName(s);if(Y0!==void 0&&N0)this._constants[E0.str]=Y0;return this._leafNode(new K(y,E0,Y0)),E0}const(y,s,Y0){return this._def(z.varKinds.const,y,s,Y0)}let(y,s,Y0){return this._def(z.varKinds.let,y,s,Y0)}var(y,s,Y0){return this._def(z.varKinds.var,y,s,Y0)}assign(y,s,Y0){return this._leafNode(new I(y,s,Y0))}add(y,s){return this._leafNode(new G(y,$.operators.ADD,s))}code(y){if(typeof y=="function")y();else if(y!==Y.nil)this._leafNode(new Z(y));return this}object(...y){let s=["{"];for(let[Y0,N0]of y){if(s.length>1)s.push(",");if(s.push(Y0),Y0!==N0||this.opts.es5)s.push(":"),(0,Y.addCodeArg)(s,N0)}return s.push("}"),new Y._Code(s)}if(y,s,Y0){if(this._blockNode(new M(y)),s&&Y0)this.code(s).else().code(Y0).endIf();else if(s)this.code(s).endIf();else if(Y0)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(y){return this._elseNode(new M(y))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(M,w)}_for(y,s){if(this._blockNode(y),s)this.code(s).endFor();return this}for(y,s){return this._for(new N(y),s)}forRange(y,s,Y0,N0,E0=this.opts.es5?z.varKinds.var:z.varKinds.let){let G0=this._scope.toName(y);return this._for(new D(E0,G0,s,Y0),()=>N0(G0))}forOf(y,s,Y0,N0=z.varKinds.const){let E0=this._scope.toName(y);if(this.opts.es5){let G0=s instanceof Y.Name?s:this.var("_arr",s);return this.forRange("_i",0,Y._`${G0}.length`,(T0)=>{this.var(E0,Y._`${G0}[${T0}]`),Y0(E0)})}return this._for(new P("of",N0,E0,s),()=>Y0(E0))}forIn(y,s,Y0,N0=this.opts.es5?z.varKinds.var:z.varKinds.const){if(this.opts.ownProperties)return this.forOf(y,Y._`Object.keys(${s})`,Y0);let E0=this._scope.toName(y);return this._for(new P("in",N0,E0,s),()=>Y0(E0))}endFor(){return this._endBlockNode(O)}label(y){return this._leafNode(new W(y))}break(y){return this._leafNode(new H(y))}return(y){let s=new A;if(this._blockNode(s),this.code(y),s.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(y,s,Y0){if(!s&&!Y0)throw Error('CodeGen: "try" without "catch" and "finally"');let N0=new j;if(this._blockNode(N0),this.code(y),s){let E0=this.name("e");this._currNode=N0.catch=new C(E0),s(E0)}if(Y0)this._currNode=N0.finally=new b,this.code(Y0);return this._endBlockNode(C,b)}throw(y){return this._leafNode(new X(y))}block(y,s){if(this._blockStarts.push(this._nodes.length),y)this.code(y).endBlock(s);return this}endBlock(y){let s=this._blockStarts.pop();if(s===void 0)throw Error("CodeGen: not in self-balancing block");let Y0=this._nodes.length-s;if(Y0<0||y!==void 0&&Y0!==y)throw Error(`CodeGen: wrong number of nodes: ${Y0} vs ${y} expected`);return this._nodes.length=s,this}func(y,s=Y.nil,Y0,N0){if(this._blockNode(new T(y,s,Y0)),N0)this.code(N0).endFunc();return this}endFunc(){return this._endBlockNode(T)}optimize(y=1){while(y-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(y){return this._currNode.nodes.push(y),this}_blockNode(y){this._currNode.nodes.push(y),this._nodes.push(y)}_endBlockNode(y,s){let Y0=this._currNode;if(Y0 instanceof y||s&&Y0 instanceof s)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${s?`${y.kind}/${s.kind}`:y.kind}"`)}_elseNode(y){let s=this._currNode;if(!(s instanceof M))throw Error('CodeGen: "else" without "if"');return this._currNode=s.else=y,this}get _root(){return this._nodes[0]}get _currNode(){let y=this._nodes;return y[y.length-1]}set _currNode(y){let s=this._nodes;s[s.length-1]=y}};$.CodeGen=x;function S(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)+(s[Y0]||0);return y}function i(y,s){return s instanceof Y._CodeOrName?S(y,s.names):y}function c(y,s,Y0){if(y instanceof Y.Name)return N0(y);if(!E0(y))return y;return new Y._Code(y._items.reduce((G0,T0)=>{if(T0 instanceof Y.Name)T0=N0(T0);if(T0 instanceof Y._Code)G0.push(...T0._items);else G0.push(T0);return G0},[]));function N0(G0){let T0=Y0[G0.str];if(T0===void 0||s[G0.str]!==1)return G0;return delete s[G0.str],T0}function E0(G0){return G0 instanceof Y._Code&&G0._items.some((T0)=>T0 instanceof Y.Name&&s[T0.str]===1&&Y0[T0.str]!==void 0)}}function U0(y,s){for(let Y0 in s)y[Y0]=(y[Y0]||0)-(s[Y0]||0)}function k(y){return typeof y=="boolean"||typeof y=="number"||y===null?!y:Y._`!${e(y)}`}$.not=k;let d=p($.operators.AND);function t(...y){return y.reduce(d)}$.and=t;let $0=p($.operators.OR);function g(...y){return y.reduce($0)}$.or=g;function p(y){return(s,Y0)=>s===Y.nil?Y0:Y0===Y.nil?s:Y._`${e(s)} ${y} ${e(Y0)}`}function
Line truncated
|
||||
|| (${C} == "string" && ${A} && ${A} == +${A})`).assign(b,Q._`+${A}`);return;case"integer":T.elseIf(Q._`${C} === "boolean" || ${A} === null
|
||||
|| (${C} === "string" && ${A} && ${A} == +${A} && !(${A} % 1))`).assign(b,Q._`+${A}`);return;case"boolean":T.elseIf(Q._`${A} === "false" || ${A} === 0 || ${A} === null`).assign(b,!1).elseIf(Q._`${A} === "true" || ${A} === 1`).assign(b,!0);return;case"null":T.elseIf(Q._`${A} === "" || ${A} === 0 || ${A} === false`),T.assign(b,null);return;case"array":T.elseIf(Q._`${C} === "string" || ${C} === "number"
|
||||
|| ${C} === "boolean" || ${A} === null`).assign(b,Q._`[${A}]`)}}}function q({gen:O,parentData:D,parentDataProperty:P},T){O.if(Q._`${D} !== undefined`,()=>O.assign(Q._`${D}[${P}]`,T))}function V(O,D,P,T=K.Correct){let A=T===K.Correct?Q.operators.EQ:Q.operators.NEQ,j;switch(O){case"null":return Q._`${D} ${A} null`;case"array":j=Q._`Array.isArray(${D})`;break;case"object":j=Q._`${D} && typeof ${D} == "object" && !Array.isArray(${D})`;break;case"integer":j=C(Q._`!(${D} % 1) && !isNaN(${D})`);break;case"number":j=C();break;default:return Q._`typeof ${D} ${A} ${O}`}return T===K.Correct?j:(0,Q.not)(j);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${D} == "number"`,b,P?Q._`isFinite(${D})`:Q.nil)}}$.checkDataType=V;function F(O,D,P,T){if(O.length===1)return V(O[0],D,P,T);let A,j=(0,J.toHash)(O);if(j.array&&j.object){let C=Q._`typeof ${D} != "object"`;A=j.null?C:Q._`!${D} || ${C}`,delete j.null,delete j.array,delete j.object}else A=Q.nil;if(j.number)delete j.integer;for(let C in j)A=(0,Q.and)(A,V(C,D,P,T));return A}$.checkDataTypes=F;let M={message:({schema:O})=>`must be ${O}`,params:({schema:O,schemaValue:D})=>typeof O=="string"?Q._`{type: ${O}}`:Q._`{type: ${D}}`};function w(O){let D=N(O);(0,U.reportError)(D,M)}$.reportTypeError=w;function N(O){let{gen:D,data:P,schema:T}=O,A=(0,J.schemaRefOrVal)(O,T,"type");return{gen:D,keyword:"type",data:P,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:O}}}),iu0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=F1(),z=v1();function U(J,K){let{properties:I,items:G}=J.schema;if(K==="object"&&I)for(let W in I)Q(J,W,I[W].default);else if(K==="array"&&Array.isArray(G))G.forEach((W,H)=>Q(J,H,W.default))}$.assignDefaults=U;function Q(J,K,I){let{gen:G,compositeRule:W,data:H,opts:X}=J;if(I===void 0)return;let Z=Y._`${H}${(0,Y.getProperty)(K)}`;if(W){(0,z.checkStrictMode)(J,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(I)}`)}}),Q5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=F1(),z=v1(),U=U5(),Q=v1();function J(O,D){let{gen:P,data:T,it:A}=O;P.if(X(P,T,D,A.opts.ownProperties),()=>{O.setParams({missingProperty:Y._`${D}`},!0),O.error()})}$.checkReportMissingProp=J;function K({gen:O,data:D,it:{opts:P}},T,A){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(O,D,j,P.ownProperties),Y._`${A} = ${j}`)))}$.checkMissingProp=K;function I(O,D){O.setParams({missingProperty:D},!0),O.error()}$.reportMissingProp=I;function G(O){return O.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function W(O,D,P){return Y._`${G(O)}.call(${D}, ${P})`}$.isOwnProperty=W;function H(O,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} !== undefined`;return T?Y._`${A} && ${W(O,D,P)}`:A}$.propertyInData=H;function X(O,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} === undefined`;return T?(0,Y.or)(A,(0,Y.not)(W(O,D,P))):A}$.noPropertyInData=X;function Z(O){return O?Object.keys(O).filter((D)=>D!=="__proto__"):[]}$.allSchemaProperties=Z;function q(O,D){return Z(D).filter((P)=>!(0,z.alwaysValidSchema)(O,D[P]))}$.schemaProperties=q;function V({schemaCode:O,data:D,it:{gen:P,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,x,S){let i=S?Y._`${O}, ${D}, ${T}${A}`:D,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${P.object(...c)}`;return x!==Y.nil?Y._`${b}.call(${x}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function M({gen:O,it:{opts:D}},P){let T=D.unicodeRegExp?"u":"",{regExp:A}=D.code,j=A(P,T);return O.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${A.code==="new RegExp"?F:(0,Q.useFunc)(O,A)}(${P}, ${T})`})}$.usePattern=M;function w(O){let{gen:D,data:P,keyword:T,it:A}=O,j=D.name("valid");if(A.allErrors){let b=D.let("valid",!0);return C(()=>D.assign(b,!1)),b}return D.var(j,!0),C(()=>D.break()),j;function C(b){let x=D.const("len",Y._`${P}.length`);D.forRange("i",0,x,(S)=>{O.subschema({keyword:T,dataProp:S,dataPropType:z.Type.Num},j),D.if((0,Y.not)(j),b)})}}$.validateArray=w;function N(O){let{gen:D,schema:P,keyword:T,it:A}=O;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((b)=>(0,z.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=D.let("valid",!1),C=D.name("_valid");D.block(()=>P.forEach((b,x)=>{let S=O.subschema({keyword:T,schemaProp:x,compositeRule:!0},C);if(D.assign(j,Y._`${j} || ${C}`),!O.mergeValidEvaluated(S,C)
Line truncated
|
||||
|| ${C} === "boolean" || ${A} === null`).assign(b,Q._`[${A}]`)}}}function q({gen:N,parentData:D,parentDataProperty:P},T){N.if(Q._`${D} !== undefined`,()=>N.assign(Q._`${D}[${P}]`,T))}function V(N,D,P,T=K.Correct){let A=T===K.Correct?Q.operators.EQ:Q.operators.NEQ,j;switch(N){case"null":return Q._`${D} ${A} null`;case"array":j=Q._`Array.isArray(${D})`;break;case"object":j=Q._`${D} && typeof ${D} == "object" && !Array.isArray(${D})`;break;case"integer":j=C(Q._`!(${D} % 1) && !isNaN(${D})`);break;case"number":j=C();break;default:return Q._`typeof ${D} ${A} ${N}`}return T===K.Correct?j:(0,Q.not)(j);function C(b=Q.nil){return(0,Q.and)(Q._`typeof ${D} == "number"`,b,P?Q._`isFinite(${D})`:Q.nil)}}$.checkDataType=V;function F(N,D,P,T){if(N.length===1)return V(N[0],D,P,T);let A,j=(0,J.toHash)(N);if(j.array&&j.object){let C=Q._`typeof ${D} != "object"`;A=j.null?C:Q._`!${D} || ${C}`,delete j.null,delete j.array,delete j.object}else A=Q.nil;if(j.number)delete j.integer;for(let C in j)A=(0,Q.and)(A,V(C,D,P,T));return A}$.checkDataTypes=F;let w={message:({schema:N})=>`must be ${N}`,params:({schema:N,schemaValue:D})=>typeof N=="string"?Q._`{type: ${N}}`:Q._`{type: ${D}}`};function M(N){let D=O(N);(0,U.reportError)(D,w)}$.reportTypeError=M;function O(N){let{gen:D,data:P,schema:T}=N,A=(0,J.schemaRefOrVal)(N,T,"type");return{gen:D,keyword:"type",data:P,schema:T.type,schemaCode:A,schemaValue:A,parentSchema:T,params:{},it:N}}}),au0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.assignDefaults=void 0;let Y=F1(),z=v1();function U(J,K){let{properties:I,items:G}=J.schema;if(K==="object"&&I)for(let W in I)Q(J,W,I[W].default);else if(K==="array"&&Array.isArray(G))G.forEach((W,H)=>Q(J,H,W.default))}$.assignDefaults=U;function Q(J,K,I){let{gen:G,compositeRule:W,data:H,opts:X}=J;if(I===void 0)return;let Z=Y._`${H}${(0,Y.getProperty)(K)}`;if(W){(0,z.checkStrictMode)(J,`default is ignored for: ${Z}`);return}let q=Y._`${Z} === undefined`;if(X.useDefaults==="empty")q=Y._`${q} || ${Z} === null || ${Z} === ""`;G.if(q,Y._`${Z} = ${(0,Y.stringify)(I)}`)}}),Q5=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0}),$.validateUnion=$.validateArray=$.usePattern=$.callValidateCode=$.schemaProperties=$.allSchemaProperties=$.noPropertyInData=$.propertyInData=$.isOwnProperty=$.hasPropFunc=$.reportMissingProp=$.checkMissingProp=$.checkReportMissingProp=void 0;let Y=F1(),z=v1(),U=U5(),Q=v1();function J(N,D){let{gen:P,data:T,it:A}=N;P.if(X(P,T,D,A.opts.ownProperties),()=>{N.setParams({missingProperty:Y._`${D}`},!0),N.error()})}$.checkReportMissingProp=J;function K({gen:N,data:D,it:{opts:P}},T,A){return(0,Y.or)(...T.map((j)=>(0,Y.and)(X(N,D,j,P.ownProperties),Y._`${A} = ${j}`)))}$.checkMissingProp=K;function I(N,D){N.setParams({missingProperty:D},!0),N.error()}$.reportMissingProp=I;function G(N){return N.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}$.hasPropFunc=G;function W(N,D,P){return Y._`${G(N)}.call(${D}, ${P})`}$.isOwnProperty=W;function H(N,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} !== undefined`;return T?Y._`${A} && ${W(N,D,P)}`:A}$.propertyInData=H;function X(N,D,P,T){let A=Y._`${D}${(0,Y.getProperty)(P)} === undefined`;return T?(0,Y.or)(A,(0,Y.not)(W(N,D,P))):A}$.noPropertyInData=X;function Z(N){return N?Object.keys(N).filter((D)=>D!=="__proto__"):[]}$.allSchemaProperties=Z;function q(N,D){return Z(D).filter((P)=>!(0,z.alwaysValidSchema)(N,D[P]))}$.schemaProperties=q;function V({schemaCode:N,data:D,it:{gen:P,topSchemaRef:T,schemaPath:A,errorPath:j},it:C},b,x,S){let i=S?Y._`${N}, ${D}, ${T}${A}`:D,c=[[U.default.instancePath,(0,Y.strConcat)(U.default.instancePath,j)],[U.default.parentData,C.parentData],[U.default.parentDataProperty,C.parentDataProperty],[U.default.rootData,U.default.rootData]];if(C.opts.dynamicRef)c.push([U.default.dynamicAnchors,U.default.dynamicAnchors]);let U0=Y._`${i}, ${P.object(...c)}`;return x!==Y.nil?Y._`${b}.call(${x}, ${U0})`:Y._`${b}(${U0})`}$.callValidateCode=V;let F=Y._`new RegExp`;function w({gen:N,it:{opts:D}},P){let T=D.unicodeRegExp?"u":"",{regExp:A}=D.code,j=A(P,T);return N.scopeValue("pattern",{key:j.toString(),ref:j,code:Y._`${A.code==="new RegExp"?F:(0,Q.useFunc)(N,A)}(${P}, ${T})`})}$.usePattern=w;function M(N){let{gen:D,data:P,keyword:T,it:A}=N,j=D.name("valid");if(A.allErrors){let b=D.let("valid",!0);return C(()=>D.assign(b,!1)),b}return D.var(j,!0),C(()=>D.break()),j;function C(b){let x=D.const("len",Y._`${P}.length`);D.forRange("i",0,x,(S)=>{N.subschema({keyword:T,dataProp:S,dataPropType:z.Type.Num},j),D.if((0,Y.not)(j),b)})}}$.validateArray=M;function O(N){let{gen:D,schema:P,keyword:T,it:A}=N;if(!Array.isArray(P))throw Error("ajv implementation error");if(P.some((b)=>(0,z.alwaysValidSchema)(A,b))&&!A.opts.unevaluated)return;let j=D.let("valid",!1),C=D.name("_valid");D.block(()=>P.forEach((b,x)=>{let S=N.subschema({keyword:T,schemaProp:x,compositeRule:!0},C);if(D.assign(j,Y._`${j} || ${C}`),!N.mergeValidEvaluated(S,C)
Line truncated
|
||||
missingProperty: ${X},
|
||||
depsCount: ${W},
|
||||
deps: ${H}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[W,H]=J(G);K(G,W),I(G,H)}};function J({schema:G}){let W={},H={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?W:H;Z[X]=G[X]}return[W,H]}function K(G,W=G.schema){let{gen:H,data:X,it:Z}=G;if(Object.keys(W).length===0)return;let q=H.let("missing");for(let V in W){let F=W[V];if(F.length===0)continue;let M=(0,U.propertyInData)(H,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)H.if(M,()=>{for(let w of F)(0,U.checkReportMissingProp)(G,w)});else H.if(Y._`${M} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.reportMissingProp)(G,q),H.else()}}$.validatePropertyDeps=K;function I(G,W=G.schema){let{gen:H,data:X,keyword:Z,it:q}=G,V=H.name("valid");for(let F in W){if((0,z.alwaysValidSchema)(q,W[F]))continue;H.if((0,U.propertyInData)(H,X,F,q.opts.ownProperties),()=>{let M=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(M,V)},()=>H.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=I,$.default=Q}),Hb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>Y._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:K,data:I,it:G}=Q;if((0,z.alwaysValidSchema)(G,K))return;let W=J.name("valid");J.forIn("key",I,(H)=>{Q.setParams({propertyName:H}),Q.subschema({keyword:"propertyNames",data:H,dataTypes:["string"],propertyName:H,compositeRule:!0},W),J.if((0,Y.not)(W),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(W)}};$.default=U}),Ie=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=F1(),U=U5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:K})=>z._`{additionalProperty: ${K.additionalProperty}}`},code(K){let{gen:I,schema:G,parentSchema:W,data:H,errsCount:X,it:Z}=K;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(W.properties),M=(0,Y.allSchemaProperties)(W.patternProperties);w(),K.ok(z._`${X} === ${U.default.errors}`);function w(){I.forIn("key",H,(T)=>{if(!F.length&&!M.length)D(T);else I.if(N(T),()=>D(T))})}function N(T){let A;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,W.properties,"properties");A=(0,Y.isOwnProperty)(I,j,T)}else if(F.length)A=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else A=z.nil;if(M.length)A=(0,z.or)(A,...M.map((j)=>z._`${(0,Y.usePattern)(K,j)}.test(${T})`));return(0,z.not)(A)}function O(T){I.code(z._`delete ${H}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){O(T);return}if(G===!1){if(K.setParams({additionalProperty:T}),K.error(),!q)I.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let A=I.name("valid");if(V.removeAdditional==="failing")P(T,A,!1),I.if((0,z.not)(A),()=>{K.reset(),O(T)});else if(P(T,A),!q)I.if((0,z.not)(A),()=>I.break())}}function P(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});K.subschema(C,A)}}};$.default=J}),Xb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=xQ(),z=Q5(),U=v1(),Q=Ie(),J={keyword:"properties",type:"object",schemaType:"object",code(K){let{gen:I,schema:G,parentSchema:W,data:H,it:X}=K;if(X.opts.removeAdditional==="all"&&W.additionalProperties===void 0)Q.default.code(new Y.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,z.allSchemaProperties)(G);for(let w of Z)X.definedProperties.add(w);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(I,(0,U.toHash)(Z),X.props);let q=Z.filter((w)=>!(0,U.alwaysValidSchema)(X,G[w]));if(q.length===0)return;let V=I.name("valid");for(let w of q){if(F(w))M(w);else{if(I.if((0,z.propertyInData)(I,H,w,X.opts.ownProperties)),M(w),!X.allErrors)I.else().var(V,!0);I.endIf()}K.it.definedProperties.add(w),K.ok(V)}function F(w){return X.opts.useDefaults&&!X.compositeRule&&G[w].default!==void 0}function M(w){K.subschema({keyword:"properties",schemaProp:w,dataProp:w},V)}}};$.default=J}),Zb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=F1(),U=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(K){let{gen:I,schema:G,data:W,parentSchema:H,it:X}=K,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((P)=>(0,U.alwaysValidSchema)(X,G[P]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&H.properties,M=I.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,Q.evaluatedPropsToName)(I,X.props);let{props:w}=X;N();function N(){for(let P of q){if(F)O(P);if(X.allErrors)
Line truncated
|
||||
\x00`,x+=O4(j,2),x+=I.magic,x+=O4(M,2),x+=O4(w,2),x+=O4(A.crc32,4),x+=O4(A.compressedSize,4),x+=O4(A.uncompressedSize,4),x+=O4(W.length,2),x+=O4(N.length,2);var S=NO.LOCAL_FILE_HEADER+x+W+N,i=NO.CENTRAL_FILE_HEADER+O4(b,2)+x+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+W+N+Z;return{fileRecord:S,dirRecord:i}},Lr0=function($,Y,z,U,Q){var J="",K=MJ.transformTo("string",Q(U));return J=NO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(K.length,2)+K,J},Fr0=function($){var Y="";return Y=NO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){OJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}MJ.inherits(X5,OJ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,OJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=u50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=u50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:Fr0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y<this.dirRecords.length;Y++)this.push({data:this.dirRecords[Y],meta:{percent:100}});var z=this.bytesWritten-$,U=Lr0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var Y=this;return $.on("data",function(z){Y.processChunk(z)}),$.on("end",function(){if(Y.closedSource(Y.previous.streamInfo),Y._sources.length)Y.prepareNextSource();else Y.end()}),$.on("error",function(z){Y.error(z)}),this};X5.prototype.resume=function(){if(!OJ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var Y=this._sources;if(!OJ.prototype.error.call(this,$))return!1;for(var z=0;z<Y.length;z++)try{Y[z].error($)}catch(U){}return!0};X5.prototype.lock=function(){OJ.prototype.lock.call(this);var $=this._sources;for(var Y=0;Y<$.length;Y++)$[Y].lock()};b50.exports=X5});var c50=E((Nr0)=>{var wr0=ny(),Mr0=i50(),Or0=function($,Y){var z=$||Y,U=wr0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};Nr0.generateWorker=function($,Y,z){var U=new Mr0(Y.streamFiles,z,Y.platform,Y.encodeFileName),Q=0;try{$.forEach(function(J,K){Q++;var I=Or0(K.options.compression,Y.compression),G=K.options.compressionOptions||Y.compressionOptions||{},W=K.dir,H=K.date;K._compressWorker(I,G).withStreamInfo("file",{name:J,dir:W,date:H,comment:K.comment||"",unixPermissions:K.unixPermissions,dosPermissions:K.dosPermissions}).pipe(U)}),U.entriesCount=Q}catch(J){U.error(J)}return U}});var p50=E((Fd1,n50)=>{var Ar0=n4(),DO=K$();function wH($,Y){DO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}Ar0.inherits(wH,DO);wH.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};wH.prototype.pause=function(){if(!DO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};wH.prototype.resume=function(){if(!DO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};n50.exports=wH});var $90=E((wd1,e50)=>{var Br0=GJ(),MH=n4(),o50=K$(),Pr0=rg(),r50=sg(),d50=zO(),Tr0=m80(),jr0=c50(),m50=sW(),Er0=p50(),s50=function($,Y,z){var U=MH.getTypeOf(Y),Q,J=MH.extend(z||{},r50);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermission
Line truncated
|
||||
`)}openNode($,Y){let z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),jk(U,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)p30(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");jk(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(n30.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("</"),Y.push($),Y.push(">");this.open=!1,this.leaf=!1}leafNode($,Y,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);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("")}}Ek.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};d30.exports=Ek});var Ck=E((Mt0)=>{var m30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function wt0($){if(typeof $==="string")return $;if(m30)return m30.decode($);return $.toString()}Mt0.bufferToString=wt0});var a30=E((o30)=>{Object.defineProperty(o30,"__esModule",{value:!0});o30.CHAR=`
|
||||
\r --�\uD800\uDC00-\uDBFF\uDFFF`;o30.S=` \r
|
||||
`;o30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";o30.NAME_CHAR="-"+o30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";o30.CHAR_RE=new RegExp("^["+o30.CHAR+"]$","u");o30.S_RE=new RegExp("^["+o30.S+"]+$","u");o30.NAME_START_CHAR_RE=new RegExp("^["+o30.NAME_START_CHAR+"]$","u");o30.NAME_CHAR_RE=new RegExp("^["+o30.NAME_CHAR+"]$","u");o30.NAME_RE=new RegExp("^["+o30.NAME_START_CHAR+"]["+o30.NAME_CHAR+"]*$","u");o30.NMTOKEN_RE=new RegExp("^["+o30.NAME_CHAR+"]+$","u");var Rk=9,_k=10,vk=13,hk=32;o30.S_LIST=[hk,_k,vk,Rk];function Nt0($){return $>=hk&&$<=55295||$===_k||$===vk||$===Rk||$>=57344&&$<=65533||$>=65536&&$<=1114111}o30.isChar=Nt0;function Dt0($){return $===hk||$===_k||$===vk||$===Rk}o30.isS=Dt0;function l30($){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}o30.isNameStartChar=l30;function At0($){return l30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}o30.isNameChar=At0});var I70=E((U70)=>{Object.defineProperty(U70,"__esModule",{value:!0});U70.CHAR="\x01--�\uD800\uDC00-\uDBFF\uDFFF";U70.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F--";U70.S=` \r
|
||||
`;U70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";U70.NAME_CHAR="-"+U70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";U70.CHAR_RE=new RegExp("^["+U70.CHAR+"]$","u");U70.RESTRICTED_CHAR_RE=new RegExp("^["+U70.RESTRICTED_CHAR+"]$","u");U70.S_RE=new RegExp("^["+U70.S+"]+$","u");U70.NAME_START_CHAR_RE=new RegExp("^["+U70.NAME_START_CHAR+"]$","u");U70.NAME_CHAR_RE=new RegExp("^["+U70.NAME_CHAR+"]$","u");U70.NAME_RE=new RegExp("^["+U70.NAME_START_CHAR+"]["+U70.NAME_CHAR+"]*$","u");U70.NMTOKEN_RE=new RegExp("^["+U70.NAME_CHAR+"]+$","u");var t30=9,e30=10,$70=13,Y70=32;U70.S_LIST=[Y70,e30,$70,t30];function gt0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}U70.isChar=gt0;function yt0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}U70.isRestrictedChar=yt0;function kt0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}U70.isCharAndNotRestricted=kt0;function xt0($){return $===Y70||$===e30||$===$70||$===t30}U70.isS=xt0;function z70($){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}U70.isNameStartChar=z70;function ft0($){return z70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}U70.isNameChar=ft0});var H70=E((W70)=>{Object.defineProperty(W70,"__esModule",{value:!0});W70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";W70.NC_NAME_CHAR="-"+W70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";W70.NC_NAME_START_CHAR_RE=new RegExp("^["+W70.NC_NAME_START_CHAR+"]$","u");W70.NC_NAME_CHAR_RE=new RegExp("^["+W70.NC_NAME_CHAR+"]$","u");W70.NC_NAME_RE=new RegExp("^["+W70.NC_NAME_START_CHAR+"]["+W70.NC_NAME_CHAR+"]*$","u");function G70($){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}W70.isNCNameStartChar=G70;function et0($){return G70($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}W70.isNCNameChar=et0});var h70=E((v70)=>{Object.defineProperty(v70,"__esModule",{value:!0});var vJ=a30(),Je0=I70(),mk=H70(),n8=vJ.isS,Ke0=vJ.isChar,vH=vJ.isNameStartChar,X70=vJ.isNameChar,T70=vJ.S_LIST,Ie0=vJ.NAME_RE,Ge0=Je0.isChar,We0=mk.isNCNameStartChar,He0=mk.isNCNameChar,Xe0=mk.NC_NAME_RE,sO="http://www.w3.org/XML/1998/namespace",_J="http://www.w3.org/2000/xmlns/",Ze0={__proto__:null,xml:sO,xmlns:_J},qe0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,G9=-2,Z70=0,Ve0=1,gk=2,Le0=3,EJ=4,Fe0=5,we0=6,Me0=7,yk=8,Oe0=9,Ne0=10,De0=11,Ae0=12,C8=13,dO=14,kk=15,Be0=16,xk=17,Pe0=18,Te0=19,fk=20,je0=21,Ee0=22,Ce0=23,q70=24,uk=25,mO=26,V70=27,Re0=28,_e0=29,L70=30,ve0=31,he0=32,Zz=33,Se0=34,bk=35,hH=36,ik=37,ge0=38,F70=39,w70=40,ye0=41,M70=42,ke0=43,xe0=44,ck=9,q5=10,nk=13,O70=32,N70=33,j70=34,SH=38,E70=39,lO=45,oO=47,fe0=59,$2=60,CJ=61,P6=62,o6=63,C70=91,RJ=93,D70=133,A70=8232,rO=($)=>$===j70||$===E70,R70=[j70,E70],ue0=[...R70,C70,P6],be0=[...R70,$2,RJ],ie0=[CJ,o6,...T70],ce0=[...T70,P6,SH,$2];function dk($,Y,z){switch(Y){case"xml":if(z!==sO)$.fail(`xml prefix must be bound to ${sO}.`);break;case"xmlns":if(z!==_J)$.fail(`xmlns prefix must be bound to ${_J}.`);break;default:}switch(z){case _J:$.fail(Y===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${_J}.`);break;case sO:switch(Y){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function ne0($,Y){for(let z of Object.keys(Y))dk($,z,Y[z])}var pe0=($)=>Xe0.test($),de0=($)=>Ie0.test($),qz=0,B70=1,pk=2;v70.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var P70={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 _70{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let Y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,Y){this.nameStartCheck=We0,this.nameCheck=He0,this.isName=pe0,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Ze0);let z=this.opt.additionalNamesp
Line truncated
|
||||
deps: ${H}}`};let Q={keyword:"dependencies",type:"object",schemaType:"object",error:$.error,code(G){let[W,H]=J(G);K(G,W),I(G,H)}};function J({schema:G}){let W={},H={};for(let X in G){if(X==="__proto__")continue;let Z=Array.isArray(G[X])?W:H;Z[X]=G[X]}return[W,H]}function K(G,W=G.schema){let{gen:H,data:X,it:Z}=G;if(Object.keys(W).length===0)return;let q=H.let("missing");for(let V in W){let F=W[V];if(F.length===0)continue;let w=(0,U.propertyInData)(H,X,V,Z.opts.ownProperties);if(G.setParams({property:V,depsCount:F.length,deps:F.join(", ")}),Z.allErrors)H.if(w,()=>{for(let M of F)(0,U.checkReportMissingProp)(G,M)});else H.if(Y._`${w} && (${(0,U.checkMissingProp)(G,F,q)})`),(0,U.reportMissingProp)(G,q),H.else()}}$.validatePropertyDeps=K;function I(G,W=G.schema){let{gen:H,data:X,keyword:Z,it:q}=G,V=H.name("valid");for(let F in W){if((0,z.alwaysValidSchema)(q,W[F]))continue;H.if((0,U.propertyInData)(H,X,F,q.opts.ownProperties),()=>{let w=G.subschema({keyword:Z,schemaProp:F},V);G.mergeValidEvaluated(w,V)},()=>H.var(V,!0)),G.ok(V)}}$.validateSchemaDeps=I,$.default=Q}),Nb0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=F1(),z=v1(),U={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:Q})=>Y._`{propertyName: ${Q.propertyName}}`},code(Q){let{gen:J,schema:K,data:I,it:G}=Q;if((0,z.alwaysValidSchema)(G,K))return;let W=J.name("valid");J.forIn("key",I,(H)=>{Q.setParams({propertyName:H}),Q.subschema({keyword:"propertyNames",data:H,dataTypes:["string"],propertyName:H,compositeRule:!0},W),J.if((0,Y.not)(W),()=>{if(Q.error(!0),!G.allErrors)J.break()})}),Q.ok(W)}};$.default=U}),He=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=F1(),U=U5(),Q=v1(),J={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:K})=>z._`{additionalProperty: ${K.additionalProperty}}`},code(K){let{gen:I,schema:G,parentSchema:W,data:H,errsCount:X,it:Z}=K;if(!X)throw Error("ajv implementation error");let{allErrors:q,opts:V}=Z;if(Z.props=!0,V.removeAdditional!=="all"&&(0,Q.alwaysValidSchema)(Z,G))return;let F=(0,Y.allSchemaProperties)(W.properties),w=(0,Y.allSchemaProperties)(W.patternProperties);M(),K.ok(z._`${X} === ${U.default.errors}`);function M(){I.forIn("key",H,(T)=>{if(!F.length&&!w.length)D(T);else I.if(O(T),()=>D(T))})}function O(T){let A;if(F.length>8){let j=(0,Q.schemaRefOrVal)(Z,W.properties,"properties");A=(0,Y.isOwnProperty)(I,j,T)}else if(F.length)A=(0,z.or)(...F.map((j)=>z._`${T} === ${j}`));else A=z.nil;if(w.length)A=(0,z.or)(A,...w.map((j)=>z._`${(0,Y.usePattern)(K,j)}.test(${T})`));return(0,z.not)(A)}function N(T){I.code(z._`delete ${H}[${T}]`)}function D(T){if(V.removeAdditional==="all"||V.removeAdditional&&G===!1){N(T);return}if(G===!1){if(K.setParams({additionalProperty:T}),K.error(),!q)I.break();return}if(typeof G=="object"&&!(0,Q.alwaysValidSchema)(Z,G)){let A=I.name("valid");if(V.removeAdditional==="failing")P(T,A,!1),I.if((0,z.not)(A),()=>{K.reset(),N(T)});else if(P(T,A),!q)I.if((0,z.not)(A),()=>I.break())}}function P(T,A,j){let C={keyword:"additionalProperties",dataProp:T,dataPropType:Q.Type.Str};if(j===!1)Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1});K.subschema(C,A)}}};$.default=J}),Db0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=fQ(),z=Q5(),U=v1(),Q=He(),J={keyword:"properties",type:"object",schemaType:"object",code(K){let{gen:I,schema:G,parentSchema:W,data:H,it:X}=K;if(X.opts.removeAdditional==="all"&&W.additionalProperties===void 0)Q.default.code(new Y.KeywordCxt(X,Q.default,"additionalProperties"));let Z=(0,z.allSchemaProperties)(G);for(let M of Z)X.definedProperties.add(M);if(X.opts.unevaluated&&Z.length&&X.props!==!0)X.props=U.mergeEvaluated.props(I,(0,U.toHash)(Z),X.props);let q=Z.filter((M)=>!(0,U.alwaysValidSchema)(X,G[M]));if(q.length===0)return;let V=I.name("valid");for(let M of q){if(F(M))w(M);else{if(I.if((0,z.propertyInData)(I,H,M,X.opts.ownProperties)),w(M),!X.allErrors)I.else().var(V,!0);I.endIf()}K.it.definedProperties.add(M),K.ok(V)}function F(M){return X.opts.useDefaults&&!X.compositeRule&&G[M].default!==void 0}function w(M){K.subschema({keyword:"properties",schemaProp:M,dataProp:M},V)}}};$.default=J}),Ab0=R0(($)=>{Object.defineProperty($,"__esModule",{value:!0});let Y=Q5(),z=F1(),U=v1(),Q=v1(),J={keyword:"patternProperties",type:"object",schemaType:"object",code(K){let{gen:I,schema:G,data:W,parentSchema:H,it:X}=K,{opts:Z}=X,q=(0,Y.allSchemaProperties)(G),V=q.filter((P)=>(0,U.alwaysValidSchema)(X,G[P]));if(q.length===0||V.length===q.length&&(!X.opts.unevaluated||X.props===!0))return;let F=Z.strictSchema&&!Z.allowMatchingProperties&&H.properties,w=I.name("valid");if(X.props!==!0&&!(X.props instanceof z.Name))X.props=(0,Q.evaluatedPropsToName)(I,X.props);let{props:M}=X;O();function O(){for(let P of q){if(F)N(P);if(X.allErrors)
Line truncated
|
||||
\x00`,x+=O4(j,2),x+=I.magic,x+=O4(w,2),x+=O4(M,2),x+=O4(A.crc32,4),x+=O4(A.compressedSize,4),x+=O4(A.uncompressedSize,4),x+=O4(W.length,2),x+=O4(O.length,2);var S=DO.LOCAL_FILE_HEADER+x+W+O,i=DO.CENTRAL_FILE_HEADER+O4(b,2)+x+O4(Z.length,2)+"\x00\x00\x00\x00"+O4(C,4)+O4(U,4)+W+O+Z;return{fileRecord:S,dirRecord:i}},Tr0=function($,Y,z,U,Q){var J="",K=OJ.transformTo("string",Q(U));return J=DO.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+O4($,2)+O4($,2)+O4(Y,4)+O4(z,4)+O4(K.length,2)+K,J},jr0=function($){var Y="";return Y=DO.DATA_DESCRIPTOR+O4($.crc32,4)+O4($.compressedSize,4)+O4($.uncompressedSize,4),Y};function X5($,Y,z,U){NJ.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=Y,this.zipPlatform=z,this.encodeFileName=U,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}OJ.inherits(X5,NJ);X5.prototype.push=function($){var Y=$.meta.percent||0,z=this.entriesCount,U=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,NJ.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:z?(Y+100*(z-U-1))/z:100}})};X5.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var Y=this.streamFiles&&!$.file.dir;if(Y){var z=c50($,Y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:z.fileRecord,meta:{percent:0}})}else this.accumulate=!0};X5.prototype.closedSource=function($){this.accumulate=!1;var Y=this.streamFiles&&!$.file.dir,z=c50($,Y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(z.dirRecord),Y)this.push({data:jr0($),meta:{percent:100}});else{this.push({data:z.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};X5.prototype.flush=function(){var $=this.bytesWritten;for(var Y=0;Y<this.dirRecords.length;Y++)this.push({data:this.dirRecords[Y],meta:{percent:100}});var z=this.bytesWritten-$,U=Tr0(this.dirRecords.length,z,$,this.zipComment,this.encodeFileName);this.push({data:U,meta:{percent:100}})};X5.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};X5.prototype.registerPrevious=function($){this._sources.push($);var Y=this;return $.on("data",function(z){Y.processChunk(z)}),$.on("end",function(){if(Y.closedSource(Y.previous.streamInfo),Y._sources.length)Y.prepareNextSource();else Y.end()}),$.on("error",function(z){Y.error(z)}),this};X5.prototype.resume=function(){if(!NJ.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};X5.prototype.error=function($){var Y=this._sources;if(!NJ.prototype.error.call(this,$))return!1;for(var z=0;z<Y.length;z++)try{Y[z].error($)}catch(U){}return!0};X5.prototype.lock=function(){NJ.prototype.lock.call(this);var $=this._sources;for(var Y=0;Y<$.length;Y++)$[Y].lock()};n50.exports=X5});var d50=E((_r0)=>{var Er0=py(),Cr0=p50(),Rr0=function($,Y){var z=$||Y,U=Er0[z];if(!U)throw Error(z+" is not a valid compression method !");return U};_r0.generateWorker=function($,Y,z){var U=new Cr0(Y.streamFiles,z,Y.platform,Y.encodeFileName),Q=0;try{$.forEach(function(J,K){Q++;var I=Rr0(K.options.compression,Y.compression),G=K.options.compressionOptions||Y.compressionOptions||{},W=K.dir,H=K.date;K._compressWorker(I,G).withStreamInfo("file",{name:J,dir:W,date:H,comment:K.comment||"",unixPermissions:K.unixPermissions,dosPermissions:K.dosPermissions}).pipe(U)}),U.entriesCount=Q}catch(J){U.error(J)}return U}});var l50=E((_d1,m50)=>{var hr0=n4(),AO=I$();function MH($,Y){AO.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(Y)}hr0.inherits(MH,AO);MH.prototype._bindStream=function($){var Y=this;this._stream=$,$.pause(),$.on("data",function(z){Y.push({data:z,meta:{percent:0}})}).on("error",function(z){if(Y.isPaused)this.generatedError=z;else Y.error(z)}).on("end",function(){if(Y.isPaused)Y._upstreamEnded=!0;else Y.end()})};MH.prototype.pause=function(){if(!AO.prototype.pause.call(this))return!1;return this._stream.pause(),!0};MH.prototype.resume=function(){if(!AO.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};m50.exports=MH});var U90=E((vd1,z90)=>{var Sr0=WJ(),wH=n4(),a50=I$(),gr0=sg(),t50=ag(),o50=UO(),yr0=r80(),kr0=d50(),r50=sW(),xr0=l50(),e50=function($,Y,z){var U=wH.getTypeOf(Y),Q,J=wH.extend(z||{},t50);if(J.date=J.date||new Date,J.compression!==null)J.compression=J.compression.toUpperCase();if(typeof J.unixPermissions==="string")J.unixPermissions=parseInt(J.unixPermissions,8);if(J.unixPermissions&&J.unixPermissions&16384)J.dir=!0;if(J.dosPermissions&&J.dosPermission
Line truncated
|
||||
`)}openNode($,Y){let z=this.tos,U=this._xml;if(z&&this.open)U.push(">");this._stack.push($),U.push("<"),U.push($),Ek(U,Y),this.leaf=!0,this.open=!0}addAttribute($,Y){if(!this.open)throw Error("Cannot write attributes to node if it is not open");if(Y!==void 0)l30(this._xml,$,Y)}addAttributes($){if(!this.open)throw Error("Cannot write attributes to node if it is not open");Ek(this._xml,$)}writeText($){let Y=this._xml;if(this.open)Y.push(">"),this.open=!1;this.leaf=!1,Y.push(m30.xmlEncode($.toString()))}writeXml($){if(this.open)this._xml.push(">"),this.open=!1;this.leaf=!1,this._xml.push($)}closeNode(){let $=this._stack.pop(),Y=this._xml;if(this.leaf)Y.push("/>");else Y.push("</"),Y.push($),Y.push(">");this.open=!1,this.leaf=!1}leafNode($,Y,z){if(this.openNode($,Y),z!==void 0)this.writeText(z);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("")}}Ck.StdDocAttributes={version:"1.0",encoding:"UTF-8",standalone:"yes"};o30.exports=Ck});var Rk=E((Ct0)=>{var r30=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function Et0($){if(typeof $==="string")return $;if(r30)return r30.decode($);return $.toString()}Ct0.bufferToString=Et0});var $70=E((a30)=>{Object.defineProperty(a30,"__esModule",{value:!0});a30.CHAR=`
|
||||
\r --�\uD800\uDC00-\uDBFF\uDFFF`;a30.S=` \r
|
||||
`;a30.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";a30.NAME_CHAR="-"+a30.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";a30.CHAR_RE=new RegExp("^["+a30.CHAR+"]$","u");a30.S_RE=new RegExp("^["+a30.S+"]+$","u");a30.NAME_START_CHAR_RE=new RegExp("^["+a30.NAME_START_CHAR+"]$","u");a30.NAME_CHAR_RE=new RegExp("^["+a30.NAME_CHAR+"]$","u");a30.NAME_RE=new RegExp("^["+a30.NAME_START_CHAR+"]["+a30.NAME_CHAR+"]*$","u");a30.NMTOKEN_RE=new RegExp("^["+a30.NAME_CHAR+"]+$","u");var _k=9,vk=10,hk=13,Sk=32;a30.S_LIST=[Sk,vk,hk,_k];function _t0($){return $>=Sk&&$<=55295||$===vk||$===hk||$===_k||$>=57344&&$<=65533||$>=65536&&$<=1114111}a30.isChar=_t0;function vt0($){return $===Sk||$===vk||$===hk||$===_k}a30.isS=vt0;function s30($){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}a30.isNameStartChar=s30;function ht0($){return s30($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}a30.isNameChar=ht0});var H70=E((K70)=>{Object.defineProperty(K70,"__esModule",{value:!0});K70.CHAR="\x01--�\uD800\uDC00-\uDBFF\uDFFF";K70.RESTRICTED_CHAR="\x01-\b\v\f\x0E-\x1F--";K70.S=` \r
|
||||
`;K70.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";K70.NAME_CHAR="-"+K70.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";K70.CHAR_RE=new RegExp("^["+K70.CHAR+"]$","u");K70.RESTRICTED_CHAR_RE=new RegExp("^["+K70.RESTRICTED_CHAR+"]$","u");K70.S_RE=new RegExp("^["+K70.S+"]+$","u");K70.NAME_START_CHAR_RE=new RegExp("^["+K70.NAME_START_CHAR+"]$","u");K70.NAME_CHAR_RE=new RegExp("^["+K70.NAME_CHAR+"]$","u");K70.NAME_RE=new RegExp("^["+K70.NAME_START_CHAR+"]["+K70.NAME_CHAR+"]*$","u");K70.NMTOKEN_RE=new RegExp("^["+K70.NAME_CHAR+"]+$","u");var Y70=9,z70=10,U70=13,Q70=32;K70.S_LIST=[Q70,z70,U70,Y70];function pt0($){return $>=1&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}K70.isChar=pt0;function dt0($){return $>=1&&$<=8||$===11||$===12||$>=14&&$<=31||$>=127&&$<=132||$>=134&&$<=159}K70.isRestrictedChar=dt0;function mt0($){return $===9||$===10||$===13||$>31&&$<127||$===133||$>159&&$<=55295||$>=57344&&$<=65533||$>=65536&&$<=1114111}K70.isCharAndNotRestricted=mt0;function lt0($){return $===Q70||$===z70||$===U70||$===Y70}K70.isS=lt0;function J70($){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}K70.isNameStartChar=J70;function ot0($){return J70($)||$>=48&&$<=57||$===45||$===46||$===183||$>=768&&$<=879||$>=8255&&$<=8256}K70.isNameChar=ot0});var q70=E((Z70)=>{Object.defineProperty(Z70,"__esModule",{value:!0});Z70.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�\uD800\uDC00-\uDB7F\uDFFF";Z70.NC_NAME_CHAR="-"+Z70.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀";Z70.NC_NAME_START_CHAR_RE=new RegExp("^["+Z70.NC_NAME_START_CHAR+"]$","u");Z70.NC_NAME_CHAR_RE=new RegExp("^["+Z70.NC_NAME_CHAR+"]$","u");Z70.NC_NAME_RE=new RegExp("^["+Z70.NC_NAME_START_CHAR+"]["+Z70.NC_NAME_CHAR+"]*$","u");function X70($){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}Z70.isNCNameStartChar=X70;function We0($){return X70($)||($===45||$===46||$>=48&&$<=57||$===183||$>=768&&$<=879||$>=8255&&$<=8256)}Z70.isNCNameChar=We0});var y70=E((g70)=>{Object.defineProperty(g70,"__esModule",{value:!0});var hJ=$70(),Le0=H70(),lk=q70(),p8=hJ.isS,Fe0=hJ.isChar,vH=hJ.isNameStartChar,V70=hJ.isNameChar,C70=hJ.S_LIST,Me0=hJ.NAME_RE,we0=Le0.isChar,Oe0=lk.isNCNameStartChar,Ne0=lk.isNCNameChar,De0=lk.NC_NAME_RE,aO="http://www.w3.org/XML/1998/namespace",vJ="http://www.w3.org/2000/xmlns/",Ae0={__proto__:null,xml:aO,xmlns:vJ},Be0={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},k4=-1,G9=-2,L70=0,Pe0=1,yk=2,Te0=3,CJ=4,je0=5,Ee0=6,Ce0=7,kk=8,Re0=9,_e0=10,ve0=11,he0=12,C8=13,mO=14,xk=15,Se0=16,fk=17,ge0=18,ye0=19,uk=20,ke0=21,xe0=22,fe0=23,F70=24,bk=25,lO=26,M70=27,ue0=28,be0=29,w70=30,ie0=31,ce0=32,qz=33,ne0=34,ik=35,hH=36,ck=37,pe0=38,O70=39,N70=40,de0=41,D70=42,me0=43,le0=44,nk=9,q5=10,pk=13,A70=32,B70=33,R70=34,SH=38,_70=39,oO=45,rO=47,oe0=59,Y2=60,RJ=61,P6=62,o6=63,v70=91,_J=93,P70=133,T70=8232,sO=($)=>$===R70||$===_70,h70=[R70,_70],re0=[...h70,v70,P6],se0=[...h70,Y2,_J],ae0=[RJ,o6,...C70],te0=[...C70,P6,SH,Y2];function mk($,Y,z){switch(Y){case"xml":if(z!==aO)$.fail(`xml prefix must be bound to ${aO}.`);break;case"xmlns":if(z!==vJ)$.fail(`xmlns prefix must be bound to ${vJ}.`);break;default:}switch(z){case vJ:$.fail(Y===""?`the default namespace may not be set to ${z}.`:`may not assign a prefix (even "xmlns") to the URI ${vJ}.`);break;case aO:switch(Y){case"xml":break;case"":$.fail(`the default namespace may not be set to ${z}.`);break;default:$.fail("may not assign the xml namespace to another prefix.")}break;default:}}function ee0($,Y){for(let z of Object.keys(Y))mk($,z,Y[z])}var $01=($)=>De0.test($),Y01=($)=>Me0.test($),Vz=0,j70=1,dk=2;g70.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var E70={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 S70{constructor($){this.opt=$!==null&&$!==void 0?$:{},this.fragmentOpt=!!this.opt.fragment;let Y=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,Y){this.nameStartCheck=Oe0,this.nameCheck=Ne0,this.isName=$01,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},Ae0);let z=this.opt.additionalNamesp
Line truncated
|
||||
`,Y=this.i}}captureToChar($){let{i:Y}=this,{chunk:z}=this;while(!0){let U=this.getCode();switch(U){case G9:this.text+=`${z.slice(Y,this.prevI)}
|
||||
`,Y=this.i,U=q5;break;case k4:return this.text+=z.slice(Y),!1;default:}if(U===$)return this.text+=z.slice(Y,this.prevI),!0}}captureNameChars(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCode();if(z===k4)return this.name+=$.slice(Y),k4;if(!X70(z))return this.name+=$.slice(Y,this.prevI),z===G9?q5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!n8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=Ke0,this.getCode=this.getCode10;else this.isChar=Ge0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Ve0}sBeginWhitespace(){let $=this.i,Y=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(Y){case $2:if(this.state=kk,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let Y=this.captureTo(ue0);switch(Y){case P6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(Y),Y===C70)this.state=EJ;else if(rO(Y))this.state=Le0,this.q=Y}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=gk}sDTD(){let $=this.captureTo(be0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===RJ)this.state=gk;else if($===$2)this.state=we0;else if(rO($))this.state=Fe0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=EJ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case N70:this.state=Me0,this.openWakaBang="";break;case o6:this.state=De0;break;default:this.state=EJ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),Y=this.openWakaBang+=$;if(this.text+=$,Y!=="-")this.state=Y==="--"?yk:EJ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(lO))this.text+="-",this.state=Oe0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===lO?Ne0:yk}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===P6)this.state=EJ;else this.fail("malformed comment."),this.state=yk}sDTDPI(){if(this.captureToChar(o6))this.text+="?",this.state=Ae0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===P6)this.state=EJ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:Y}=this;$:while(!0)switch(this.getCode()){case G9:this.entity+=`${Y.slice($,this.prevI)}
|
||||
`,$=this.i;break;case fe0:{let{entityReturnState:z}=this,U=this.entity+Y.slice($,this.prevI);this.state=z;let Q;if(U==="")this.fail("empty entity name."),Q="&;";else Q=this.parseEntity(U),this.entity="";if(z!==C8||this.textHandler!==void 0)this.text+=Q;break $}case k4:this.entity+=Y.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(vH($))this.state=Se0,this.unget(),this.xmlDeclPossible=!1;else switch($){case oO:this.state=ke0,this.xmlDeclPossible=!1;break;case N70:this.state=Be0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case o6:this.state=Ce0;break;default:this.fail("disallowed character in tag name"),this.state=C8,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=fk,this.openWakaBang="";break;case"--":this.state=xk,this.openWakaBang="";break;case"DOCTYPE":if(this.state=gk,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(lO))this.state=Pe0}sCommentEnding(){var $;let Y=this.getCodeNorm();if(Y===lO)this.state=Te0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(Y)}`,this.state=xk}sCommentEnded(){let $=this.getCodeNorm();if($!==P6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=xk;else this.state=C8}sCData(){if(this.captureToChar(RJ))this.state=je0}sCDataEnding(){let $=this.getCodeNorm();if($===RJ)this.state=Ee0;else this.text+=`]${String.fromCodePoint($)}`,this.state=fk}sCDataEnding2(){var $;let Y=this.getCodeNorm();switch(Y){case P6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case RJ:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(Y)}`,this.state=fk}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=q70;else if($===o6||n8($))this.fail("processing instruction without a target."),this.state=$===o6?mO:uk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=q70}sPIRest(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCodeNorm();if(z===k4){this.piTarget+=$.slice(Y);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(Y,this.prevI);let U=z===o6;if(U||n8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?Zz:V70}else this.state=U?mO:uk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===o6)this.state=mO;else if(!n8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(o6))this.state=mO}sPIEnding(){var $;let Y=this.getCodeNorm();if(Y===P6){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(Y===o6)this.text+="?";else this.text+=`?${String.fromCodePoint(Y)}`,this.state=uk;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===o6){this.state=Zz;return}if($!==k4)this.state=Re0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(ie0);if($===o6){this.state=Zz,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(n8($)||$===CJ))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(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===CJ?L70:_e0}sXMLDeclEq(){let $=this.getCodeNorm();if($===o6){this.state=Zz,this.fail("XML declaration is incomplete.");return}if(n8($))return;if($!==CJ)this.fail("value required.");this.state=L70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===o6){this.state=Zz,this.fail("XML declaration is incomplete.");return}if(n8($))return;if(!rO($))this.fail("value must be quoted."),this.q=O70;else this.q=$;this.state=ve0}sXMLDeclValue(){let $=this.captureTo([this.q,o6]);if($===o6){this.state=Zz,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let Y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=Y;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver
Line truncated
|
||||
`;$=this.i,Y=qz;break;case k4:if(U!==void 0)this.text+=z.slice($);break $;default:Y=qz}this.forbiddenState=Y}handleTextOutsideRoot(){let{i:$}=this,{chunk:Y,textHandler:z}=this,U=!1;$:while(!0){let Q=this.getCode();switch(Q){case $2:{if(this.state=kk,z!==void 0){let{text:J}=this,K=Y.slice($,this.prevI);if(J.length!==0)z(J+K),this.text="";else if(K.length!==0)z(K)}break $}case SH:if(this.state=dO,this.entityReturnState=C8,z!==void 0)this.text+=Y.slice($,this.prevI);U=!0;break $;case G9:if(z!==void 0)this.text+=`${Y.slice($,this.prevI)}
|
||||
`;$=this.i;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:if(!n8(Q))U=!0}}if(!U)return;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}pushAttribNS($,Y){var z;let{prefix:U,local:Q}=this.qname($),J={name:$,prefix:U,local:Q,value:Y};if(this.attribList.push(J),(z=this.attributeHandler)===null||z===void 0||z.call(this,J),U==="xmlns"){let K=Y.trim();if(this.currentXMLVersion==="1.0"&&K==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Q]=K,dk(this,Q,K)}else if($==="xmlns"){let K=Y.trim();this.topNS[""]=K,dk(this,"",K)}}pushAttribPlain($,Y){var z;let U={name:$,value:Y};this.attribList.push(U),(z=this.attributeHandler)===null||z===void 0||z.call(this,U)}end(){var $,Y;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let Q=z.pop();this.fail(`unclosed tag: ${Q.name}`)}if(this.state!==Z70&&this.state!==C8)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(Y=this.endHandler)===null||Y===void 0||Y.call(this),this._init(),this}resolve($){var Y,z;let U=this.topNS[$];if(U!==void 0)return U;let{tags:Q}=this;for(let J=Q.length-1;J>=0;J--)if(U=Q[J].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(z=(Y=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(Y,$)}qname($){let Y=$.indexOf(":");if(Y===-1)return{prefix:"",local:$};let z=$.slice(Y+1),U=$.slice(0,Y);if(U===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:z}}processAttribsNS(){var $;let{attribList:Y}=this,z=this.tag;{let{prefix:J,local:K}=this.qname(z.name);z.prefix=J,z.local=K;let I=z.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(I==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),z.uri=J}}if(Y.length===0)return;let{attributes:U}=z,Q=new Set;for(let J of Y){let{name:K,prefix:I,local:G}=J,W,H;if(I==="")W=K==="xmlns"?_J:"",H=K;else{if(W=this.resolve(I),W===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(I)}.`),W=I;H=`{${W}}${G}`}if(Q.has(H))this.fail(`duplicate attribute: ${H}.`);Q.add(H),J.uri=W,U[K]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,Y=this.tag.attributes;for(let{name:z,value:U}of $){if(Y[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);Y[z]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:Y}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),Y.push(z),this.state=C8,this.name=""}openSelfClosingTag(){var $,Y,z;this.processAttribs();let{tags:U}=this,Q=this.tag;if(Q.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Q),(Y=this.closeTagHandler)===null||Y===void 0||Y.call(this,Q),(this.tag=(z=U[U.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:Y}=this;if(this.state=C8,this.name="",Y===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,U=$.length;while(U-- >0){let Q=this.tag=$.pop();if(this.topNS=Q.ns,z===null||z===void 0||z(Q),Q.name===Y)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${Y}.`),this.text+=`</${Y}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let Y=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))Y=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))Y=parseInt($.slice(1),10);if(!this.isChar(Y))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(Y)}}v70.SaxesParser=_70});var gH=E(($m1,S70)=>{var{SaxesParser:oe0}=h70(),{PassThrough:re0}=E8(),{bufferToString:se0}=Ck();S70.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new re0);let Y=new oe0,z;Y.on("error",(Q)=>{z=Q});let U=[];Y.on("opentag",(Q)=>U.push({eventType:"opentag",value:Q})),Y.on("text",(Q)=>U.push({eventType:"text",value:Q})),Y.on("closetag",(Q)=>U.push({eventType:"closetag",value:Q}));for await(let Q of $){if(Y.write(se0(Q)),z)throw z;yield U,U=[]}}});var g0=E((Ym1,g70)=>{var ae0=gH(),te0=l6();class hJ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,Y){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof hJ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let Y of $)for(let{eventType:z,value:U}of Y)if(z==="opentag")this.parseOpen(U);else if(z==="text")this.parseText(U);else if(z==="closetag"){if(!this.parseClose(U.name))return thLine truncated
|
||||
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
|
||||
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((Y=$.writeHeaders)!==null&&Y!==void 0?Y:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}HK0.FormatterOptions=WK0});var RN=E((jo1,LK0)=>{var G51="[object AsyncFunction]",W51="[object Function]",H51="[object GeneratorFunction]",X51="[object Null]",Z51="[object Proxy]",q51="[object Undefined]",V51=typeof global=="object"&&global&&global.Object===Object&&global,L51=typeof self=="object"&&self&&self.Object===Object&&self,F51=V51||L51||Function("return this")(),qK0=Object.prototype,w51=qK0.hasOwnProperty,VK0=qK0.toString,ZK0=F51.Symbol,Nz=ZK0?ZK0.toStringTag:void 0;function M51($){if($==null)return $===void 0?q51:X51;return Nz&&Nz in Object($)?O51($):N51($)}function O51($){var Y=w51.call($,Nz),z=$[Nz];try{$[Nz]=void 0;var U=!0}catch(J){}var Q=VK0.call($);if(U)if(Y)$[Nz]=z;else delete $[Nz];return Q}function N51($){return VK0.call($)}function D51($){if(!A51($))return!1;var Y=M51($);return Y==W51||Y==H51||Y==G51||Y==Z51}function A51($){var Y=typeof $;return $!=null&&(Y=="object"||Y=="function")}LK0.exports=D51});var sK0=E((_N,cJ)=>{var B51=200,Lf="__lodash_hash_undefined__",fN=1,EK0=2,CK0=9007199254740991,vN="[object Arguments]",Gf="[object Array]",P51="[object AsyncFunction]",RK0="[object Boolean]",_K0="[object Date]",vK0="[object Error]",hK0="[object Function]",T51="[object GeneratorFunction]",hN="[object Map]",SK0="[object Number]",j51="[object Null]",iJ="[object Object]",FK0="[object Promise]",E51="[object Proxy]",gK0="[object RegExp]",SN="[object Set]",yK0="[object String]",C51="[object Symbol]",R51="[object Undefined]",Wf="[object WeakMap]",kK0="[object ArrayBuffer]",gN="[object DataView]",_51="[object Float32Array]",v51="[object Float64Array]",h51="[object Int8Array]",S51="[object Int16Array]",g51="[object Int32Array]",y51="[object Uint8Array]",k51="[object Uint8ClampedArray]",x51="[object Uint16Array]",f51="[object Uint32Array]",u51=/[\\^$.*+?()[\]{}|]/g,b51=/^\[object .+?Constructor\]$/,i51=/^(?:0|[1-9]\d*)$/,P4={};P4[_51]=P4[v51]=P4[h51]=P4[S51]=P4[g51]=P4[y51]=P4[k51]=P4[x51]=P4[f51]=!0;P4[vN]=P4[Gf]=P4[kK0]=P4[RK0]=P4[gN]=P4[_K0]=P4[vK0]=P4[hK0]=P4[hN]=P4[SK0]=P4[iJ]=P4[gK0]=P4[SN]=P4[yK0]=P4[Wf]=!1;var xK0=typeof global=="object"&&global&&global.Object===Object&&global,c51=typeof self=="object"&&self&&self.Object===Object&&self,V3=xK0||c51||Function("return this")(),fK0=typeof _N=="object"&&_N&&!_N.nodeType&&_N,wK0=fK0&&typeof cJ=="object"&&cJ&&!cJ.nodeType&&cJ,uK0=wK0&&wK0.exports===fK0,Jf=uK0&&xK0.process,MK0=function(){try{return Jf&&Jf.binding&&Jf.binding("util")}catch($){}}(),OK0=MK0&&MK0.isTypedArray;function n51($,Y){var z=-1,U=$==null?0:$.length,Q=0,J=[];while(++z<U){var K=$[z];if(Y(K,z,$))J[Q++]=K}return J}function p51($,Y){var z=-1,U=Y.length,Q=$.length;while(++z<U)$[Q+z]=Y[z];return $}function d51($,Y){var z=-1,U=$==null?0:$.length;while(++z<U)if(Y($[z],z,$))return!0;return!1}function m51($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}function l51($){return function(Y){return $(Y)}}function o51($,Y){return $.has(Y)}function r51($,Y){return $==null?void 0:$[Y]}function s51($){var Y=-1,z=Array($.size);return $.forEach(function(U,Q){z[++Y]=[Q,U]}),z}function a51($,Y){return function(z){return $(Y(z))}}function t51($){var Y=-1,z=Array($.size);return $.forEach(function(U){z[++Y]=U}),z}var e51=Array.prototype,$91=Function.prototype,uN=Object.prototype,Kf=V3["__core-js_shared__"],bK0=$91.toString,H9=uN.hasOwnProperty,NK0=function(){var $=/[^.]+$/.exec(Kf&&Kf.keys&&Kf.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),iK0=uN.toString,Y91=RegExp("^"+bK0.call(H9).replace(u51,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),DK0=uK0?V3.Buffer:void 0,yN=V3.Symbol,AK0=V3.Uint8Array,cK0=uN.propertyIsEnumerable,z91=e51.splice,Dz=yN?yN.toStringTag:void 0,BK0=Object.getOwnPropertySymbols,U91=DK0?DK0.isBuffer:void 0,Q91=a51(Object.keys,Object),Hf=nJ(V3,"DataView"),iH=nJ(V3,"Map"),Xf=nJ(V3,"Promise"),Zf=nJ(V3,"Set"),qf=nJ(V3,"WeakMap"),cH=nJ(Object,"create"),J91=Pz(Hf),K91=Pz(iH),I91=Pz(Xf),G91=Pz(Zf),W91=Pz(qf),PK0=yN?yN.prototype:void 0,If=PK0?PK0.valueOf:void 0;function Az($){var Y=-1,z=$==null?0:$.length;this.clear();while(++Y<z){var U=$[Y];this.set(U[0],U[1])}}function H91(){this.__data__=cH?cH(null):{},this.size=0}function X91($){var Y=this.has($)&&delete this.__data__[$];return this.size-=Y?1:0,Y}function Z91($){var Y=this.__data
Line truncated
|
||||
]`;this.ESCAPE_REGEXP=new RegExp(Y)}set headers($){this._headers=$}shouldQuote($,Y){let z=Y?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(M31.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,Y,z){let U=`${O31.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Q}=this;if(Q.quote!==""){if(U.indexOf(Q.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,Q.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(Y,z))return this.quoteField(U);return U}quoteField($){let{quote:Y}=this.formatterOptions;return`${Y}${$}${Y}`}}pJ.FieldFormatter=JI0});var Nf=E((KI0)=>{Object.defineProperty(KI0,"__esModule",{value:!0});KI0.isSyncTransform=void 0;KI0.isSyncTransform=($)=>$.length===1});var WI0=E((dJ)=>{var GI0=dJ&&dJ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(dJ,"__esModule",{value:!0});dJ.RowFormatter=void 0;var D31=GI0(RN()),A31=GI0(sK0()),B31=Of(),P31=Nf();class Tz{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new B31.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(Tz.isRowHashArray($))return $.map((Y)=>Y[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(P31.isSyncTransform($))return(Y,z)=>{let U=null;try{U=$(Y)}catch(Q){return z(Q)}return z(null,U)};return(Y,z)=>{$(Y,z)}}set rowTransform($){if(!D31.default($))throw TypeError("The transform should be a function");this._rowTransform=Tz.createTransform($)}format($,Y){this.callTransformer($,(z,U)=>{if(z)return Y(z);if(!$)return Y(null);let Q=[];if(U){let{shouldFormatColumns:J,headers:K}=this.checkHeaders(U);if(this.shouldWriteHeaders&&K&&!this.hasWrittenHeaders)Q.push(this.formatColumns(K,!0)),this.hasWrittenHeaders=!0;if(J){let I=this.gatherColumns(U);Q.push(this.formatColumns(I,!1))}}return Y(null,Q)})}finish($){let Y=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));Y.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)Y.push(this.formatterOptions.rowDelimiter);return $(null,Y)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let Y=Tz.gatherHeaders($);if(this.headers=Y,this.fieldFormatter.headers=Y,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!A31.default(Y,$),headers:Y}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((Y)=>$[Y]);if(Tz.isRowHashArray($))return this.headers.map((Y,z)=>{let U=$[z];if(U)return U[1];return""});if(Tz.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((Y,z)=>$[z])}callTransformer($,Y){if(!this._rowTransform)return Y(null,$);return this._rowTransform($,Y)}formatColumns($,Y){let z=$.map((Q,J)=>this.fieldFormatter.format(Q,J,Y)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,z].join("");return z}}dJ.RowFormatter=Tz});var HI0=E((cN)=>{Object.defineProperty(cN,"__esModule",{value:!0});cN.FieldFormatter=cN.RowFormatter=void 0;var T31=WI0();Object.defineProperty(cN,"RowFormatter",{enumerable:!0,get:function(){return T31.RowFormatter}});var j31=Of();Object.defineProperty(cN,"FieldFormatter",{enumerable:!0,get:function(){return j31.FieldFormatter}})});var Df=E((ZI0)=>{Object.defineProperty(ZI0,"__esModule",{value:!0});ZI0.CsvFormatterStream=void 0;var C31=K0("stream"),R31=HI0();class XI0 extends C31.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new R31.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,Y,z){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Q,J)=>{if(Q)return U=!0,z(Q);if(J)J.forEach((K)=>{this.push(Buffer.from(K,"utf8"))});return U=!0,z()})}catch(Q){if(U)throw Q;z(Q)}}_flush($){this.rowFormatter.finish((Y,z)=>{if(Y)return $(Y);if(z)z.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}ZI0.CsvFormatterStream=XI0});var LI0=E((s1)=>{var VI0=s1&&s1.__createBinding||(Object.create?function($,Y,z,U){if(U===void 0)U=z;Object.defineProperty($,U,{enumerable:!0,get:function(){return Y[z]}})}:function($,Y,z,U){if(U===void 0)U=z;$[U]=Y[z]}),_31=s1&&s1.__setModuleDefault||(Object.create?function($,Y){O
Line truncated
|
||||
`,Y=this.i,U=q5;break;case k4:return this.text+=z.slice(Y),!1;default:}if(U===$)return this.text+=z.slice(Y,this.prevI),!0}}captureNameChars(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCode();if(z===k4)return this.name+=$.slice(Y),k4;if(!V70(z))return this.name+=$.slice(Y,this.prevI),z===G9?q5:z}}skipSpaces(){while(!0){let $=this.getCodeNorm();if($===k4||!p8($))return $}}setXMLVersion($){if(this.currentXMLVersion=$,$==="1.0")this.isChar=Fe0,this.getCode=this.getCode10;else this.isChar=we0,this.getCode=this.getCode11}sBegin(){if(this.chunk.charCodeAt(0)===65279)this.i++,this.column++;this.state=Pe0}sBeginWhitespace(){let $=this.i,Y=this.skipSpaces();if(this.prevI!==$)this.xmlDeclPossible=!1;switch(Y){case Y2:if(this.state=xk,this.text.length!==0)throw Error("no-empty text at start");break;case k4:break;default:this.unget(),this.state=C8,this.xmlDeclPossible=!1}}sDoctype(){var $;let Y=this.captureTo(re0);switch(Y){case P6:{($=this.doctypeHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8,this.doctype=!0;break}case k4:break;default:if(this.text+=String.fromCodePoint(Y),Y===v70)this.state=CJ;else if(sO(Y))this.state=Te0,this.q=Y}}sDoctypeQuote(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.q=null,this.state=yk}sDTD(){let $=this.captureTo(se0);if($===k4)return;if(this.text+=String.fromCodePoint($),$===_J)this.state=yk;else if($===Y2)this.state=Ee0;else if(sO($))this.state=je0,this.q=$}sDTDQuoted(){let $=this.q;if(this.captureToChar($))this.text+=String.fromCodePoint($),this.state=CJ,this.q=null}sDTDOpenWaka(){let $=this.getCodeNorm();switch(this.text+=String.fromCodePoint($),$){case B70:this.state=Ce0,this.openWakaBang="";break;case o6:this.state=ve0;break;default:this.state=CJ}}sDTDOpenWakaBang(){let $=String.fromCodePoint(this.getCodeNorm()),Y=this.openWakaBang+=$;if(this.text+=$,Y!=="-")this.state=Y==="--"?kk:CJ,this.openWakaBang=""}sDTDComment(){if(this.captureToChar(oO))this.text+="-",this.state=Re0}sDTDCommentEnding(){let $=this.getCodeNorm();this.text+=String.fromCodePoint($),this.state=$===oO?_e0:kk}sDTDCommentEnded(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===P6)this.state=CJ;else this.fail("malformed comment."),this.state=kk}sDTDPI(){if(this.captureToChar(o6))this.text+="?",this.state=he0}sDTDPIEnding(){let $=this.getCodeNorm();if(this.text+=String.fromCodePoint($),$===P6)this.state=CJ}sText(){if(this.tags.length!==0)this.handleTextInRoot();else this.handleTextOutsideRoot()}sEntity(){let{i:$}=this,{chunk:Y}=this;$:while(!0)switch(this.getCode()){case G9:this.entity+=`${Y.slice($,this.prevI)}
|
||||
`,$=this.i;break;case oe0:{let{entityReturnState:z}=this,U=this.entity+Y.slice($,this.prevI);this.state=z;let Q;if(U==="")this.fail("empty entity name."),Q="&;";else Q=this.parseEntity(U),this.entity="";if(z!==C8||this.textHandler!==void 0)this.text+=Q;break $}case k4:this.entity+=Y.slice($);break $;default:}}sOpenWaka(){let $=this.getCode();if(vH($))this.state=ne0,this.unget(),this.xmlDeclPossible=!1;else switch($){case rO:this.state=me0,this.xmlDeclPossible=!1;break;case B70:this.state=Se0,this.openWakaBang="",this.xmlDeclPossible=!1;break;case o6:this.state=fe0;break;default:this.fail("disallowed character in tag name"),this.state=C8,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=uk,this.openWakaBang="";break;case"--":this.state=fk,this.openWakaBang="";break;case"DOCTYPE":if(this.state=yk,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(oO))this.state=ge0}sCommentEnding(){var $;let Y=this.getCodeNorm();if(Y===oO)this.state=ye0,($=this.commentHandler)===null||$===void 0||$.call(this,this.text),this.text="";else this.text+=`-${String.fromCodePoint(Y)}`,this.state=fk}sCommentEnded(){let $=this.getCodeNorm();if($!==P6)this.fail("malformed comment."),this.text+=`--${String.fromCodePoint($)}`,this.state=fk;else this.state=C8}sCData(){if(this.captureToChar(_J))this.state=ke0}sCDataEnding(){let $=this.getCodeNorm();if($===_J)this.state=xe0;else this.text+=`]${String.fromCodePoint($)}`,this.state=uk}sCDataEnding2(){var $;let Y=this.getCodeNorm();switch(Y){case P6:{($=this.cdataHandler)===null||$===void 0||$.call(this,this.text),this.text="",this.state=C8;break}case _J:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(Y)}`,this.state=uk}}sPIFirstChar(){let $=this.getCodeNorm();if(this.nameStartCheck($))this.piTarget+=String.fromCodePoint($),this.state=F70;else if($===o6||p8($))this.fail("processing instruction without a target."),this.state=$===o6?lO:bk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint($),this.state=F70}sPIRest(){let{chunk:$,i:Y}=this;while(!0){let z=this.getCodeNorm();if(z===k4){this.piTarget+=$.slice(Y);return}if(!this.nameCheck(z)){this.piTarget+=$.slice(Y,this.prevI);let U=z===o6;if(U||p8(z))if(this.piTarget==="xml"){if(!this.xmlDeclPossible)this.fail("an XML declaration must be at the start of the document.");this.state=U?qz:M70}else this.state=U?lO:bk;else this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(z);break}}}sPIBody(){if(this.text.length===0){let $=this.getCodeNorm();if($===o6)this.state=lO;else if(!p8($))this.text=String.fromCodePoint($)}else if(this.captureToChar(o6))this.state=lO}sPIEnding(){var $;let Y=this.getCodeNorm();if(Y===P6){let{piTarget:z}=this;if(z.toLowerCase()==="xml")this.fail("the XML declaration must appear at the start of the document.");($=this.piHandler)===null||$===void 0||$.call(this,{target:z,body:this.text}),this.piTarget=this.text="",this.state=C8}else if(Y===o6)this.text+="?";else this.text+=`?${String.fromCodePoint(Y)}`,this.state=bk;this.xmlDeclPossible=!1}sXMLDeclNameStart(){let $=this.skipSpaces();if($===o6){this.state=qz;return}if($!==k4)this.state=ue0,this.name=String.fromCodePoint($)}sXMLDeclName(){let $=this.captureTo(ae0);if($===o6){this.state=qz,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(!(p8($)||$===RJ))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(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=$===RJ?w70:be0}sXMLDeclEq(){let $=this.getCodeNorm();if($===o6){this.state=qz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if($!==RJ)this.fail("value required.");this.state=w70}sXMLDeclValueStart(){let $=this.getCodeNorm();if($===o6){this.state=qz,this.fail("XML declaration is incomplete.");return}if(p8($))return;if(!sO($))this.fail("value must be quoted."),this.q=A70;else this.q=$;this.state=ie0}sXMLDeclValue(){let $=this.captureTo([this.q,o6]);if($===o6){this.state=qz,this.text="",this.fail("XML declaration is incomplete.");return}if($===k4)return;let Y=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let z=Y;if(this.xmlDecl.version=z,!/^1\.[0-9]+$/.test(z))this.fail("ver
Line truncated
|
||||
`;$=this.i,Y=Vz;break;case k4:if(U!==void 0)this.text+=z.slice($);break $;default:Y=Vz}this.forbiddenState=Y}handleTextOutsideRoot(){let{i:$}=this,{chunk:Y,textHandler:z}=this,U=!1;$:while(!0){let Q=this.getCode();switch(Q){case Y2:{if(this.state=xk,z!==void 0){let{text:J}=this,K=Y.slice($,this.prevI);if(J.length!==0)z(J+K),this.text="";else if(K.length!==0)z(K)}break $}case SH:if(this.state=mO,this.entityReturnState=C8,z!==void 0)this.text+=Y.slice($,this.prevI);U=!0;break $;case G9:if(z!==void 0)this.text+=`${Y.slice($,this.prevI)}
|
||||
`;$=this.i;break;case k4:if(z!==void 0)this.text+=Y.slice($);break $;default:if(!p8(Q))U=!0}}if(!U)return;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}pushAttribNS($,Y){var z;let{prefix:U,local:Q}=this.qname($),J={name:$,prefix:U,local:Q,value:Y};if(this.attribList.push(J),(z=this.attributeHandler)===null||z===void 0||z.call(this,J),U==="xmlns"){let K=Y.trim();if(this.currentXMLVersion==="1.0"&&K==="")this.fail("invalid attempt to undefine prefix in XML 1.0");this.topNS[Q]=K,mk(this,Q,K)}else if($==="xmlns"){let K=Y.trim();this.topNS[""]=K,mk(this,"",K)}}pushAttribPlain($,Y){var z;let U={name:$,value:Y};this.attribList.push(U),(z=this.attributeHandler)===null||z===void 0||z.call(this,U)}end(){var $,Y;if(!this.sawRoot)this.fail("document must contain a root element.");let{tags:z}=this;while(z.length>0){let Q=z.pop();this.fail(`unclosed tag: ${Q.name}`)}if(this.state!==L70&&this.state!==C8)this.fail("unexpected end.");let{text:U}=this;if(U.length!==0)($=this.textHandler)===null||$===void 0||$.call(this,U),this.text="";return this._closed=!0,(Y=this.endHandler)===null||Y===void 0||Y.call(this),this._init(),this}resolve($){var Y,z;let U=this.topNS[$];if(U!==void 0)return U;let{tags:Q}=this;for(let J=Q.length-1;J>=0;J--)if(U=Q[J].ns[$],U!==void 0)return U;if(U=this.ns[$],U!==void 0)return U;return(z=(Y=this.opt).resolvePrefix)===null||z===void 0?void 0:z.call(Y,$)}qname($){let Y=$.indexOf(":");if(Y===-1)return{prefix:"",local:$};let z=$.slice(Y+1),U=$.slice(0,Y);if(U===""||z===""||z.includes(":"))this.fail(`malformed name: ${$}.`);return{prefix:U,local:z}}processAttribsNS(){var $;let{attribList:Y}=this,z=this.tag;{let{prefix:J,local:K}=this.qname(z.name);z.prefix=J,z.local=K;let I=z.uri=($=this.resolve(J))!==null&&$!==void 0?$:"";if(J!==""){if(J==="xmlns")this.fail('tags may not have "xmlns" as prefix.');if(I==="")this.fail(`unbound namespace prefix: ${JSON.stringify(J)}.`),z.uri=J}}if(Y.length===0)return;let{attributes:U}=z,Q=new Set;for(let J of Y){let{name:K,prefix:I,local:G}=J,W,H;if(I==="")W=K==="xmlns"?vJ:"",H=K;else{if(W=this.resolve(I),W===void 0)this.fail(`unbound namespace prefix: ${JSON.stringify(I)}.`),W=I;H=`{${W}}${G}`}if(Q.has(H))this.fail(`duplicate attribute: ${H}.`);Q.add(H),J.uri=W,U[K]=J}this.attribList=[]}processAttribsPlain(){let{attribList:$}=this,Y=this.tag.attributes;for(let{name:z,value:U}of $){if(Y[z]!==void 0)this.fail(`duplicate attribute: ${z}.`);Y[z]=U}this.attribList=[]}openTag(){var $;this.processAttribs();let{tags:Y}=this,z=this.tag;z.isSelfClosing=!1,($=this.openTagHandler)===null||$===void 0||$.call(this,z),Y.push(z),this.state=C8,this.name=""}openSelfClosingTag(){var $,Y,z;this.processAttribs();let{tags:U}=this,Q=this.tag;if(Q.isSelfClosing=!0,($=this.openTagHandler)===null||$===void 0||$.call(this,Q),(Y=this.closeTagHandler)===null||Y===void 0||Y.call(this,Q),(this.tag=(z=U[U.length-1])!==null&&z!==void 0?z:null)===null)this.closedRoot=!0;this.state=C8,this.name=""}closeTag(){let{tags:$,name:Y}=this;if(this.state=C8,this.name="",Y===""){this.fail("weird empty close tag."),this.text+="</>";return}let z=this.closeTagHandler,U=$.length;while(U-- >0){let Q=this.tag=$.pop();if(this.topNS=Q.ns,z===null||z===void 0||z(Q),Q.name===Y)break;this.fail("unexpected close tag.")}if(U===0)this.closedRoot=!0;else if(U<0)this.fail(`unmatched closing tag: ${Y}.`),this.text+=`</${Y}>`}parseEntity($){if($[0]!=="#"){let z=this.ENTITIES[$];if(z!==void 0)return z;return this.fail(this.isName($)?"undefined entity.":"disallowed character in entity name."),`&${$};`}let Y=NaN;if($[1]==="x"&&/^#x[0-9a-f]+$/i.test($))Y=parseInt($.slice(2),16);else if(/^#[0-9]+$/.test($))Y=parseInt($.slice(1),10);if(!this.isChar(Y))return this.fail("malformed character entity."),`&${$};`;return String.fromCodePoint(Y)}}g70.SaxesParser=S70});var gH=E((Vm1,k70)=>{var{SaxesParser:Q01}=y70(),{PassThrough:J01}=E8(),{bufferToString:K01}=Rk();k70.exports=async function*($){if($.pipe&&!$[Symbol.asyncIterator])$=$.pipe(new J01);let Y=new Q01,z;Y.on("error",(Q)=>{z=Q});let U=[];Y.on("opentag",(Q)=>U.push({eventType:"opentag",value:Q})),Y.on("text",(Q)=>U.push({eventType:"text",value:Q})),Y.on("closetag",(Q)=>U.push({eventType:"closetag",value:Q}));for await(let Q of $){if(Y.write(K01(Q)),z)throw z;yield U,U=[]}}});var g0=E((Lm1,x70)=>{var I01=gH(),G01=l6();class SJ{prepare(){}render(){}parseOpen($){}parseText($){}parseClose($){}reconcile($,Y){}reset(){if(this.model=null,this.map)Object.values(this.map).forEach(($)=>{if($ instanceof SJ)$.reset();else if($.xform)$.xform.reset()})}mergeModel($){this.model=Object.assign(this.model||{},$)}async parse($){for await(let Y of $)for(let{eventType:z,value:U}of Y)if(z==="opentag")this.parseOpen(U);else if(z==="text")this.parseText(U);else if(z==="closetag"){if(!this.parseClose(U.name))return thLine truncated
|
||||
<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"> <a:themeElements> <a:clrScheme name="Office"> <a:dk1> <a:sysClr val="windowText" lastClr="000000"/> </a:dk1> <a:lt1> <a:sysClr val="window" lastClr="FFFFFF"/> </a:lt1> <a:dk2> <a:srgbClr val="1F497D"/> </a:dk2> <a:lt2> <a:srgbClr val="EEECE1"/> </a:lt2> <a:accent1> <a:srgbClr val="4F81BD"/> </a:accent1> <a:accent2> <a:srgbClr val="C0504D"/> </a:accent2> <a:accent3> <a:srgbClr val="9BBB59"/> </a:accent3> <a:accent4> <a:srgbClr val="8064A2"/> </a:accent4> <a:accent5> <a:srgbClr val="4BACC6"/> </a:accent5> <a:accent6> <a:srgbClr val="F79646"/> </a:accent6> <a:hlink> <a:srgbClr val="0000FF"/> </a:hlink> <a:folHlink> <a:srgbClr val="800080"/> </a:folHlink> </a:clrScheme> <a:fontScheme name="Office"> <a:majorFont> <a:latin typeface="Cambria"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Times New Roman"/> <a:font script="Hebr" typeface="Times New Roman"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="MoolBoran"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Times New Roman"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:majorFont> <a:minorFont> <a:latin typeface="Calibri"/> <a:ea typeface=""/> <a:cs typeface=""/> <a:font script="Jpan" typeface="MS Pゴシック"/> <a:font script="Hang" typeface="맑은 고딕"/> <a:font script="Hans" typeface="宋体"/> <a:font script="Hant" typeface="新細明體"/> <a:font script="Arab" typeface="Arial"/> <a:font script="Hebr" typeface="Arial"/> <a:font script="Thai" typeface="Tahoma"/> <a:font script="Ethi" typeface="Nyala"/> <a:font script="Beng" typeface="Vrinda"/> <a:font script="Gujr" typeface="Shruti"/> <a:font script="Khmr" typeface="DaunPenh"/> <a:font script="Knda" typeface="Tunga"/> <a:font script="Guru" typeface="Raavi"/> <a:font script="Cans" typeface="Euphemia"/> <a:font script="Cher" typeface="Plantagenet Cherokee"/> <a:font script="Yiii" typeface="Microsoft Yi Baiti"/> <a:font script="Tibt" typeface="Microsoft Himalaya"/> <a:font script="Thaa" typeface="MV Boli"/> <a:font script="Deva" typeface="Mangal"/> <a:font script="Telu" typeface="Gautami"/> <a:font script="Taml" typeface="Latha"/> <a:font script="Syrc" typeface="Estrangelo Edessa"/> <a:font script="Orya" typeface="Kalinga"/> <a:font script="Mlym" typeface="Kartika"/> <a:font script="Laoo" typeface="DokChampa"/> <a:font script="Sinh" typeface="Iskoola Pota"/> <a:font script="Mong" typeface="Mongolian Baiti"/> <a:font script="Viet" typeface="Arial"/> <a:font script="Uigh" typeface="Microsoft Uighur"/> <a:font script="Geor" typeface="Sylfaen"/> </a:minorFont> </a:fontScheme> <a:fmtScheme name="Office"> <a:fillStyleLst> <a:solidFill> <a:schemeClr val="phClr"/> </a:solidFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="35000"> <a:schemeClr val="phClr"> <a:tint val="37000"/> <a:satMod val="300000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="15000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="1"/> </a:gradFill> <a:gradFill rotWithShape="1"> <a:gsLst> <a:gs pos="0"> <a:schemeClr val="phClr"> <a:tint val="100000"/> <a:shade val="100000"/> <a:satMod val="130000"/> </a:schemeClr> </a:gs> <a:gs pos="100000"> <a:schemeClr val="phClr"> <a:tint val="50000"/> <a:shade val="100000"/> <a:satMod val="350000"/> </a:schemeClr> </a:gs> </a:gsLst> <a:lin ang="16200000" scaled="0"/> </a:gradFill> </a:fillStyleLst> <a:lnStyleLst> <a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:schemeClr val="phClr"> <a:shade val="95000"/> <a:satMod val="105000"/> </a:schemeClr> </a:solidFill> <a:prstDash val="solid"/> </a:ln> <a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"> <a:solidFill> <a:Line truncated
|
||||
`,this.quote='"',this.escape=this.quote,this.quoteColumns=!1,this.quoteHeaders=this.quoteColumns,this.headers=null,this.includeEndRowDelimiter=!1,this.writeBOM=!1,this.BOM="\uFEFF",this.alwaysWriteHeaders=!1,Object.assign(this,$||{}),typeof($===null||$===void 0?void 0:$.quoteHeaders)>"u")this.quoteHeaders=this.quoteColumns;if(($===null||$===void 0?void 0:$.quote)===!0)this.quote='"';else if(($===null||$===void 0?void 0:$.quote)===!1)this.quote="";if(typeof($===null||$===void 0?void 0:$.escape)!=="string")this.escape=this.quote;this.shouldWriteHeaders=!!this.headers&&((Y=$.writeHeaders)!==null&&Y!==void 0?Y:!0),this.headers=Array.isArray(this.headers)?this.headers:null,this.escapedQuote=`${this.escape}${this.quote}`}}qK0.FormatterOptions=ZK0});var _N=E((bo1,wK0)=>{var w51="[object AsyncFunction]",O51="[object Function]",N51="[object GeneratorFunction]",D51="[object Null]",A51="[object Proxy]",B51="[object Undefined]",P51=typeof global=="object"&&global&&global.Object===Object&&global,T51=typeof self=="object"&&self&&self.Object===Object&&self,j51=P51||T51||Function("return this")(),FK0=Object.prototype,E51=FK0.hasOwnProperty,MK0=FK0.toString,LK0=j51.Symbol,Dz=LK0?LK0.toStringTag:void 0;function C51($){if($==null)return $===void 0?B51:D51;return Dz&&Dz in Object($)?R51($):_51($)}function R51($){var Y=E51.call($,Dz),z=$[Dz];try{$[Dz]=void 0;var U=!0}catch(J){}var Q=MK0.call($);if(U)if(Y)$[Dz]=z;else delete $[Dz];return Q}function _51($){return MK0.call($)}function v51($){if(!h51($))return!1;var Y=C51($);return Y==O51||Y==N51||Y==w51||Y==A51}function h51($){var Y=typeof $;return $!=null&&(Y=="object"||Y=="function")}wK0.exports=v51});var eK0=E((vN,nJ)=>{var S51=200,Ff="__lodash_hash_undefined__",uN=1,_K0=2,vK0=9007199254740991,hN="[object Arguments]",Wf="[object Array]",g51="[object AsyncFunction]",hK0="[object Boolean]",SK0="[object Date]",gK0="[object Error]",yK0="[object Function]",y51="[object GeneratorFunction]",SN="[object Map]",kK0="[object Number]",k51="[object Null]",cJ="[object Object]",OK0="[object Promise]",x51="[object Proxy]",xK0="[object RegExp]",gN="[object Set]",fK0="[object String]",f51="[object Symbol]",u51="[object Undefined]",Hf="[object WeakMap]",uK0="[object ArrayBuffer]",yN="[object DataView]",b51="[object Float32Array]",i51="[object Float64Array]",c51="[object Int8Array]",n51="[object Int16Array]",p51="[object Int32Array]",d51="[object Uint8Array]",m51="[object Uint8ClampedArray]",l51="[object Uint16Array]",o51="[object Uint32Array]",r51=/[\\^$.*+?()[\]{}|]/g,s51=/^\[object .+?Constructor\]$/,a51=/^(?:0|[1-9]\d*)$/,P4={};P4[b51]=P4[i51]=P4[c51]=P4[n51]=P4[p51]=P4[d51]=P4[m51]=P4[l51]=P4[o51]=!0;P4[hN]=P4[Wf]=P4[uK0]=P4[hK0]=P4[yN]=P4[SK0]=P4[gK0]=P4[yK0]=P4[SN]=P4[kK0]=P4[cJ]=P4[xK0]=P4[gN]=P4[fK0]=P4[Hf]=!1;var bK0=typeof global=="object"&&global&&global.Object===Object&&global,t51=typeof self=="object"&&self&&self.Object===Object&&self,V3=bK0||t51||Function("return this")(),iK0=typeof vN=="object"&&vN&&!vN.nodeType&&vN,NK0=iK0&&typeof nJ=="object"&&nJ&&!nJ.nodeType&&nJ,cK0=NK0&&NK0.exports===iK0,Kf=cK0&&bK0.process,DK0=function(){try{return Kf&&Kf.binding&&Kf.binding("util")}catch($){}}(),AK0=DK0&&DK0.isTypedArray;function e51($,Y){var z=-1,U=$==null?0:$.length,Q=0,J=[];while(++z<U){var K=$[z];if(Y(K,z,$))J[Q++]=K}return J}function $91($,Y){var z=-1,U=Y.length,Q=$.length;while(++z<U)$[Q+z]=Y[z];return $}function Y91($,Y){var z=-1,U=$==null?0:$.length;while(++z<U)if(Y($[z],z,$))return!0;return!1}function z91($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}function U91($){return function(Y){return $(Y)}}function Q91($,Y){return $.has(Y)}function J91($,Y){return $==null?void 0:$[Y]}function K91($){var Y=-1,z=Array($.size);return $.forEach(function(U,Q){z[++Y]=[Q,U]}),z}function I91($,Y){return function(z){return $(Y(z))}}function G91($){var Y=-1,z=Array($.size);return $.forEach(function(U){z[++Y]=U}),z}var W91=Array.prototype,H91=Function.prototype,bN=Object.prototype,If=V3["__core-js_shared__"],nK0=H91.toString,H9=bN.hasOwnProperty,BK0=function(){var $=/[^.]+$/.exec(If&&If.keys&&If.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),pK0=bN.toString,X91=RegExp("^"+nK0.call(H9).replace(r51,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),PK0=cK0?V3.Buffer:void 0,kN=V3.Symbol,TK0=V3.Uint8Array,dK0=bN.propertyIsEnumerable,Z91=W91.splice,Az=kN?kN.toStringTag:void 0,jK0=Object.getOwnPropertySymbols,q91=PK0?PK0.isBuffer:void 0,V91=I91(Object.keys,Object),Xf=pJ(V3,"DataView"),iH=pJ(V3,"Map"),Zf=pJ(V3,"Promise"),qf=pJ(V3,"Set"),Vf=pJ(V3,"WeakMap"),cH=pJ(Object,"create"),L91=Tz(Xf),F91=Tz(iH),M91=Tz(Zf),w91=Tz(qf),O91=Tz(Vf),EK0=kN?kN.prototype:void 0,Gf=EK0?EK0.valueOf:void 0;function Bz($){var Y=-1,z=$==null?0:$.length;this.clear();while(++Y<z){var U=$[Y];this.set(U[0],U[1])}}function N91(){this.__data__=cH?cH(null):{},this.size=0}function D91($){var Y=this.has($)&&delete this.__data__[$];return this.size-=Y?1:0,Y}function A91($){var Y=this.__data
Line truncated
|
||||
]`;this.ESCAPE_REGEXP=new RegExp(Y)}set headers($){this._headers=$}shouldQuote($,Y){let z=Y?this.formatterOptions.quoteHeaders:this.formatterOptions.quoteColumns;if(C31.default(z))return z;if(Array.isArray(z))return z[$];if(this._headers!==null)return z[this._headers[$]];return!1}format($,Y,z){let U=`${R31.default($)?"":$}`.replace(/\0/g,""),{formatterOptions:Q}=this;if(Q.quote!==""){if(U.indexOf(Q.quote)!==-1)return this.quoteField(U.replace(this.REPLACE_REGEXP,Q.escapedQuote))}if(U.search(this.ESCAPE_REGEXP)!==-1||this.shouldQuote(Y,z))return this.quoteField(U);return U}quoteField($){let{quote:Y}=this.formatterOptions;return`${Y}${$}${Y}`}}dJ.FieldFormatter=GI0});var Df=E((WI0)=>{Object.defineProperty(WI0,"__esModule",{value:!0});WI0.isSyncTransform=void 0;WI0.isSyncTransform=($)=>$.length===1});var ZI0=E((mJ)=>{var XI0=mJ&&mJ.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(mJ,"__esModule",{value:!0});mJ.RowFormatter=void 0;var v31=XI0(_N()),h31=XI0(eK0()),S31=Nf(),g31=Df();class jz{constructor($){if(this.rowCount=0,this.formatterOptions=$,this.fieldFormatter=new S31.FieldFormatter($),this.headers=$.headers,this.shouldWriteHeaders=$.shouldWriteHeaders,this.hasWrittenHeaders=!1,this.headers!==null)this.fieldFormatter.headers=this.headers;if($.transform)this.rowTransform=$.transform}static isRowHashArray($){if(Array.isArray($))return Array.isArray($[0])&&$[0].length===2;return!1}static isRowArray($){return Array.isArray($)&&!this.isRowHashArray($)}static gatherHeaders($){if(jz.isRowHashArray($))return $.map((Y)=>Y[0]);if(Array.isArray($))return $;return Object.keys($)}static createTransform($){if(g31.isSyncTransform($))return(Y,z)=>{let U=null;try{U=$(Y)}catch(Q){return z(Q)}return z(null,U)};return(Y,z)=>{$(Y,z)}}set rowTransform($){if(!v31.default($))throw TypeError("The transform should be a function");this._rowTransform=jz.createTransform($)}format($,Y){this.callTransformer($,(z,U)=>{if(z)return Y(z);if(!$)return Y(null);let Q=[];if(U){let{shouldFormatColumns:J,headers:K}=this.checkHeaders(U);if(this.shouldWriteHeaders&&K&&!this.hasWrittenHeaders)Q.push(this.formatColumns(K,!0)),this.hasWrittenHeaders=!0;if(J){let I=this.gatherColumns(U);Q.push(this.formatColumns(I,!1))}}return Y(null,Q)})}finish($){let Y=[];if(this.formatterOptions.alwaysWriteHeaders&&this.rowCount===0){if(!this.headers)return $(Error("`alwaysWriteHeaders` option is set to true but `headers` option not provided."));Y.push(this.formatColumns(this.headers,!0))}if(this.formatterOptions.includeEndRowDelimiter)Y.push(this.formatterOptions.rowDelimiter);return $(null,Y)}checkHeaders($){if(this.headers)return{shouldFormatColumns:!0,headers:this.headers};let Y=jz.gatherHeaders($);if(this.headers=Y,this.fieldFormatter.headers=Y,!this.shouldWriteHeaders)return{shouldFormatColumns:!0,headers:null};return{shouldFormatColumns:!h31.default(Y,$),headers:Y}}gatherColumns($){if(this.headers===null)throw Error("Headers is currently null");if(!Array.isArray($))return this.headers.map((Y)=>$[Y]);if(jz.isRowHashArray($))return this.headers.map((Y,z)=>{let U=$[z];if(U)return U[1];return""});if(jz.isRowArray($)&&!this.shouldWriteHeaders)return $;return this.headers.map((Y,z)=>$[z])}callTransformer($,Y){if(!this._rowTransform)return Y(null,$);return this._rowTransform($,Y)}formatColumns($,Y){let z=$.map((Q,J)=>this.fieldFormatter.format(Q,J,Y)).join(this.formatterOptions.delimiter),{rowCount:U}=this;if(this.rowCount+=1,U)return[this.formatterOptions.rowDelimiter,z].join("");return z}}mJ.RowFormatter=jz});var qI0=E((nN)=>{Object.defineProperty(nN,"__esModule",{value:!0});nN.FieldFormatter=nN.RowFormatter=void 0;var y31=ZI0();Object.defineProperty(nN,"RowFormatter",{enumerable:!0,get:function(){return y31.RowFormatter}});var k31=Nf();Object.defineProperty(nN,"FieldFormatter",{enumerable:!0,get:function(){return k31.FieldFormatter}})});var Af=E((LI0)=>{Object.defineProperty(LI0,"__esModule",{value:!0});LI0.CsvFormatterStream=void 0;var f31=K0("stream"),u31=qI0();class VI0 extends f31.Transform{constructor($){super({writableObjectMode:$.objectMode});this.hasWrittenBOM=!1,this.formatterOptions=$,this.rowFormatter=new u31.RowFormatter($),this.hasWrittenBOM=!$.writeBOM}transform($){return this.rowFormatter.rowTransform=$,this}_transform($,Y,z){let U=!1;try{if(!this.hasWrittenBOM)this.push(this.formatterOptions.BOM),this.hasWrittenBOM=!0;this.rowFormatter.format($,(Q,J)=>{if(Q)return U=!0,z(Q);if(J)J.forEach((K)=>{this.push(Buffer.from(K,"utf8"))});return U=!0,z()})}catch(Q){if(U)throw Q;z(Q)}}_flush($){this.rowFormatter.finish((Y,z)=>{if(Y)return $(Y);if(z)z.forEach((U)=>{this.push(Buffer.from(U,"utf8"))});return $()})}}LI0.CsvFormatterStream=VI0});var wI0=E((s1)=>{var MI0=s1&&s1.__createBinding||(Object.create?function($,Y,z,U){if(U===void 0)U=z;Object.defineProperty($,U,{enumerable:!0,get:function(){return Y[z]}})}:function($,Y,z,U){if(U===void 0)U=z;$[U]=Y[z]}),b31=s1&&s1.__setModuleDefault||(Object.create?function($,Y){O
Line truncated
|
||||
`||Y===`\r
|
||||
`}static isTokenCarriageReturn($,Y){return $.token===Y.carriageReturn}static isTokenComment($,Y){return Y.supportsComments&&!!$&&$.token===Y.comment}static isTokenEscapeCharacter($,Y){return $.token===Y.escapeChar}static isTokenQuote($,Y){return $.token===Y.quote}static isTokenDelimiter($,Y){return $.token===Y.delimiter}}FG0.Token=LG0});var mf=E((NG0)=>{Object.defineProperty(NG0,"__esModule",{value:!0});NG0.Scanner=void 0;var MG0=X2(),fY1=/((?:\r\n)|\n|\r)/;class OG0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,Y=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(Y)===-1)return null;let z=Y.exec($);if(z==null)return null;let U=z[1],Q=this.cursor+(z.index||0);return new MG0.Token({token:U,startCursor:Q,endCursor:Q+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:Y}=this;if(Y<=$)return null;return new MG0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=fY1.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}NG0.Scanner=OG0});var XD=E((BG0)=>{Object.defineProperty(BG0,"__esModule",{value:!0});BG0.ColumnFormatter=void 0;class AG0{constructor($){if($.trim)this.format=(Y)=>Y.trim();else if($.ltrim)this.format=(Y)=>Y.trimLeft();else if($.rtrim)this.format=(Y)=>Y.trimRight();else this.format=(Y)=>Y}}BG0.ColumnFormatter=AG0});var lf=E((EG0)=>{Object.defineProperty(EG0,"__esModule",{value:!0});EG0.NonQuotedColumnParser=void 0;var uY1=XD(),TG0=X2();class jG0{constructor($){this.parserOptions=$,this.columnFormatter=new uY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:Y}=this,z=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(TG0.Token.isTokenDelimiter(U,Y)||TG0.Token.isTokenRowDelimiter(U))break;z.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(z.join(""))}}EG0.NonQuotedColumnParser=jG0});var of=E((_G0)=>{Object.defineProperty(_G0,"__esModule",{value:!0});_G0.QuotedColumnParser=void 0;var bY1=XD(),zK=X2();class RG0{constructor($){this.parserOptions=$,this.columnFormatter=new bY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let Y=$.cursor,{foundClosingQuote:z,col:U}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(Y),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:Y}=this,z=!1,U=!1,Q=[],J=$.nextCharacterToken;for(;!U&&J!==null;J=$.nextCharacterToken){let K=zK.Token.isTokenQuote(J,Y);if(!z&&K)z=!0;else if(z)if(zK.Token.isTokenEscapeCharacter(J,Y)){$.advancePastToken(J);let I=$.nextCharacterToken;if(I!==null&&(zK.Token.isTokenQuote(I,Y)||zK.Token.isTokenEscapeCharacter(I,Y)))Q.push(I.token),J=I;else if(K)U=!0;else Q.push(J.token)}else if(K)U=!0;else Q.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Q.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:Y}=this,{nextNonSpaceToken:z}=$;if(z){let U=zK.Token.isTokenDelimiter(z,Y),Q=zK.Token.isTokenRowDelimiter(z);if(!(U||Q)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${Y.escapedDelimiter}' OR new line got: '${z.token}'. at '${J}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}_G0.QuotedColumnParser=RG0});var yG0=E((SG0)=>{Object.defineProperty(SG0,"__esModule",{value:!0});SG0.ColumnParser=void 0;var iY1=lf(),cY1=of(),nY1=X2();class hG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new cY1.QuotedColumnParser($),this.nonQuotedColumnParser=new iY1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:Y}=$;if(Y!==null&&nY1.Token.isTokenQuote(Y,this.parserOptions))return $.advanceToToken(Y),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}SG0.ColumnParser=hG0});var rf=E((UK)=>{Object.defineProperty(UK,"__esModule",{value:!0});UK.ColumnFormatter=UK.QuotedColumnParser=UK.NonQuotedColumnParser=UK.ColumnParser=void 0;var pY1=yG0();Object.defineProperty(UK,"ColumnParser",{enumerable:!0,get:function(){return pY1.ColumnParser}});var dY1=lf();Object.defineProperty(UK,"NonQuotedColumnParser",{enumerable:!0,get:function(){return dY1.NonQuotedColumnParser}});var mY1=of();Object.defineProperty(UK,"QuotedColumnParser",{enumerable:!0,get:function(){re
Line truncated
|
||||
%s`,T,T,q,U);let A=q.type==="*"?Hu:q.type==="?"?qu:"\\"+q.type;Q=!0,U=U.slice(0,q.reStart)+A+"\\("+T}if(O(),J)U+="\\\\";let D=xz1[U.charAt(0)];for(let T=I.length-1;T>-1;T--){let A=I[T],j=U.slice(0,A.reStart),C=U.slice(A.reStart,A.reEnd-8),b=U.slice(A.reEnd),x=U.slice(A.reEnd-8,A.reEnd)+b,S=j.split(")").length,i=j.split("(").length-S,c=b;for(let k=0;k<i;k++)c=c.replace(/\)[+*?]?/,"");b=c;let U0=b===""&&Y!==Xu?"(?:$|\\/)":"";U=j+C+b+U0+x}if(U!==""&&Q)U="(?=.)"+U;if(D)U=w()+U;if(Y===Xu)return[U,Q];if(z.nocase&&!Q)Q=$.toUpperCase()!==$.toLowerCase();if(!Q)return uz1($);let P=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",P),{_glob:$,_src:U})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,z=Y.noglobstar?Hu:Y.dot?yz1:kz1,U=Y.nocase?"i":"",Q=$.map((J)=>{return J=J.map((K)=>typeof K==="string"?iz1(K):K===R8?R8:K._src).reduce((K,I)=>{if(!(K[K.length-1]===R8&&I===R8))K.push(I);return K},[]),J.forEach((K,I)=>{if(K!==R8||J[I-1]===R8)return;if(I===0)if(J.length>1)J[I+1]="(?:\\/|"+z+"\\/)?"+J[I+1];else J[I]=z;else if(I===J.length-1)J[I-1]+="(?:\\/|"+z+")?";else J[I-1]+="(?:\\/|\\/"+z+"\\/)"+J[I+1],J[I+1]=R8}),J.filter((K)=>K!==R8).join("/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let z=this.options;if(Zu.sep!=="/")$=$.split(Zu.sep).join("/");$=$.split(CW0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let Q;for(let J=$.length-1;J>=0;J--)if(Q=$[J],Q)break;for(let J=0;J<U.length;J++){let K=U[J],I=$;if(z.matchBase&&K.length===1)I=[Q];if(this.matchOne(I,K,Y)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return W$.defaults($).Minimatch}}W$.Minimatch=sH});var kW0=E((yr1,yW0)=>{yW0.exports=gW0;var Fu=K0("fs"),{EventEmitter:nz1}=K0("events"),{Minimatch:Lu}=vW0(),{resolve:pz1}=K0("path");function dz1($,Y){return new Promise((z,U)=>{Fu.readdir($,{withFileTypes:!0},(Q,J)=>{if(Q)switch(Q.code){case"ENOTDIR":if(Y)U(Q);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:U(Q);break}else z(J)})})}function hW0($,Y){return new Promise((z,U)=>{(Y?Fu.stat:Fu.lstat)($,(J,K)=>{if(J)switch(J.code){case"ENOENT":if(Y)z(hW0($,!1));else z(null);break;default:z(null);break}else z(K)})})}async function*SW0($,Y,z,U,Q,J){let K=await dz1(Y+$,J);for(let I of K){let G=I.name;if(G===void 0)G=I,U=!0;let W=$+"/"+G,H=W.slice(1),X=Y+"/"+H,Z=null;if(U||z)Z=await hW0(X,z);if(!Z&&I.name!==void 0)Z=I;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!Q(H))yield{relative:H,absolute:X,stats:Z},yield*SW0(W,Y,z,U,Q,!1)}else yield{relative:H,absolute:X,stats:Z}}}async function*mz1($,Y,z,U){yield*SW0("",$,Y,z,U,!0)}function lz1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class wu extends nz1{constructor($,Y,z){super();if(typeof Y==="function")z=Y,Y=null;if(this.options=lz1(Y||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((Q)=>new Lu(Q,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((Q)=>new Lu(Q,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((Q)=>new Lu(Q,{dot:!0}))}if(this.iterator=mz1(pz1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>z(U)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((Y)=>Y.match($))}_fileMatches($,Y){let z=$+(Y?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(z)))&&!this.ignoreMatchers.some((U)=>U.match(z))&&(!this.options.nodir||!Y)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let Y=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,Y)){let z=$.value.relative,U=$.value.absolute;if(this.options.mark&&Y)z+="/",U+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:U,stat:$.value.stats});else this.emit("match",{relative:z
Line truncated
|
||||
`,m);m=w0===-1?f.length:w0}else if(I0!==-1&&f[m]==="/"&&f[m+1]==="*"){let w0=f.indexOf("*/",m);if(w0!==-1)m=w0+2,I0=f.indexOf("*/",m);else n+=f[m],m++}else n+=f[m],m++;return n}function c0(f){let n=b0(f.toString()),m=n.match(a);if(!m)m=n.match(H0);if(!m)throw Error(`could not parse args in autoInject
|
||||
`}static isTokenCarriageReturn($,Y){return $.token===Y.carriageReturn}static isTokenComment($,Y){return Y.supportsComments&&!!$&&$.token===Y.comment}static isTokenEscapeCharacter($,Y){return $.token===Y.escapeChar}static isTokenQuote($,Y){return $.token===Y.quote}static isTokenDelimiter($,Y){return $.token===Y.delimiter}}OG0.Token=wG0});var lf=E((BG0)=>{Object.defineProperty(BG0,"__esModule",{value:!0});BG0.Scanner=void 0;var DG0=Z2(),oY1=/((?:\r\n)|\n|\r)/;class AG0{constructor($){this.cursor=0,this.line=$.line,this.lineLength=this.line.length,this.parserOptions=$.parserOptions,this.hasMoreData=$.hasMoreData,this.cursor=$.cursor||0}get hasMoreCharacters(){return this.lineLength>this.cursor}get nextNonSpaceToken(){let{lineFromCursor:$}=this,Y=this.parserOptions.NEXT_TOKEN_REGEXP;if($.search(Y)===-1)return null;let z=Y.exec($);if(z==null)return null;let U=z[1],Q=this.cursor+(z.index||0);return new DG0.Token({token:U,startCursor:Q,endCursor:Q+U.length-1})}get nextCharacterToken(){let{cursor:$,lineLength:Y}=this;if(Y<=$)return null;return new DG0.Token({token:this.line[$],startCursor:$,endCursor:$})}get lineFromCursor(){return this.line.substr(this.cursor)}advancePastLine(){let $=oY1.exec(this.lineFromCursor);if(!$){if(this.hasMoreData)return null;return this.cursor=this.lineLength,this}return this.cursor+=($.index||0)+$[0].length,this}advanceTo($){return this.cursor=$,this}advanceToToken($){return this.cursor=$.startCursor,this}advancePastToken($){return this.cursor=$.endCursor+1,this}truncateToCursor(){return this.line=this.lineFromCursor,this.lineLength=this.line.length,this.cursor=0,this}}BG0.Scanner=AG0});var ZD=E((jG0)=>{Object.defineProperty(jG0,"__esModule",{value:!0});jG0.ColumnFormatter=void 0;class TG0{constructor($){if($.trim)this.format=(Y)=>Y.trim();else if($.ltrim)this.format=(Y)=>Y.trimLeft();else if($.rtrim)this.format=(Y)=>Y.trimRight();else this.format=(Y)=>Y}}jG0.ColumnFormatter=TG0});var of=E((_G0)=>{Object.defineProperty(_G0,"__esModule",{value:!0});_G0.NonQuotedColumnParser=void 0;var rY1=ZD(),CG0=Z2();class RG0{constructor($){this.parserOptions=$,this.columnFormatter=new rY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let{parserOptions:Y}=this,z=[],U=$.nextCharacterToken;for(;U;U=$.nextCharacterToken){if(CG0.Token.isTokenDelimiter(U,Y)||CG0.Token.isTokenRowDelimiter(U))break;z.push(U.token),$.advancePastToken(U)}return this.columnFormatter.format(z.join(""))}}_G0.NonQuotedColumnParser=RG0});var rf=E((SG0)=>{Object.defineProperty(SG0,"__esModule",{value:!0});SG0.QuotedColumnParser=void 0;var sY1=ZD(),UK=Z2();class hG0{constructor($){this.parserOptions=$,this.columnFormatter=new sY1.ColumnFormatter($)}parse($){if(!$.hasMoreCharacters)return null;let Y=$.cursor,{foundClosingQuote:z,col:U}=this.gatherDataBetweenQuotes($);if(!z){if($.advanceTo(Y),!$.hasMoreData)throw Error(`Parse Error: missing closing: '${this.parserOptions.quote||""}' in line: at '${$.lineFromCursor.replace(/[\r\n]/g,"\\n'")}'`);return null}return this.checkForMalformedColumn($),U}gatherDataBetweenQuotes($){let{parserOptions:Y}=this,z=!1,U=!1,Q=[],J=$.nextCharacterToken;for(;!U&&J!==null;J=$.nextCharacterToken){let K=UK.Token.isTokenQuote(J,Y);if(!z&&K)z=!0;else if(z)if(UK.Token.isTokenEscapeCharacter(J,Y)){$.advancePastToken(J);let I=$.nextCharacterToken;if(I!==null&&(UK.Token.isTokenQuote(I,Y)||UK.Token.isTokenEscapeCharacter(I,Y)))Q.push(I.token),J=I;else if(K)U=!0;else Q.push(J.token)}else if(K)U=!0;else Q.push(J.token);$.advancePastToken(J)}return{col:this.columnFormatter.format(Q.join("")),foundClosingQuote:U}}checkForMalformedColumn($){let{parserOptions:Y}=this,{nextNonSpaceToken:z}=$;if(z){let U=UK.Token.isTokenDelimiter(z,Y),Q=UK.Token.isTokenRowDelimiter(z);if(!(U||Q)){let J=$.lineFromCursor.substr(0,10).replace(/[\r\n]/g,"\\n'");throw Error(`Parse Error: expected: '${Y.escapedDelimiter}' OR new line got: '${z.token}'. at '${J}`)}$.advanceToToken(z)}else if(!$.hasMoreData)$.advancePastLine()}}SG0.QuotedColumnParser=hG0});var fG0=E((kG0)=>{Object.defineProperty(kG0,"__esModule",{value:!0});kG0.ColumnParser=void 0;var aY1=of(),tY1=rf(),eY1=Z2();class yG0{constructor($){this.parserOptions=$,this.quotedColumnParser=new tY1.QuotedColumnParser($),this.nonQuotedColumnParser=new aY1.NonQuotedColumnParser($)}parse($){let{nextNonSpaceToken:Y}=$;if(Y!==null&&eY1.Token.isTokenQuote(Y,this.parserOptions))return $.advanceToToken(Y),this.quotedColumnParser.parse($);return this.nonQuotedColumnParser.parse($)}}kG0.ColumnParser=yG0});var sf=E((QK)=>{Object.defineProperty(QK,"__esModule",{value:!0});QK.ColumnFormatter=QK.QuotedColumnParser=QK.NonQuotedColumnParser=QK.ColumnParser=void 0;var $z1=fG0();Object.defineProperty(QK,"ColumnParser",{enumerable:!0,get:function(){return $z1.ColumnParser}});var Yz1=of();Object.defineProperty(QK,"NonQuotedColumnParser",{enumerable:!0,get:function(){return Yz1.NonQuotedColumnParser}});var zz1=rf();Object.defineProperty(QK,"QuotedColumnParser",{enumerable:!0,get:function(){re
Line truncated
|
||||
%s`,T,T,q,U);let A=q.type==="*"?Xu:q.type==="?"?Vu:"\\"+q.type;Q=!0,U=U.slice(0,q.reStart)+A+"\\("+T}if(N(),J)U+="\\\\";let D=lz1[U.charAt(0)];for(let T=I.length-1;T>-1;T--){let A=I[T],j=U.slice(0,A.reStart),C=U.slice(A.reStart,A.reEnd-8),b=U.slice(A.reEnd),x=U.slice(A.reEnd-8,A.reEnd)+b,S=j.split(")").length,i=j.split("(").length-S,c=b;for(let k=0;k<i;k++)c=c.replace(/\)[+*?]?/,"");b=c;let U0=b===""&&Y!==Zu?"(?:$|\\/)":"";U=j+C+b+U0+x}if(U!==""&&Q)U="(?=.)"+U;if(D)U=M()+U;if(Y===Zu)return[U,Q];if(z.nocase&&!Q)Q=$.toUpperCase()!==$.toLowerCase();if(!Q)return rz1($);let P=z.nocase?"i":"";try{return Object.assign(new RegExp("^"+U+"$",P),{_glob:$,_src:U})}catch(T){return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let $=this.set;if(!$.length)return this.regexp=!1,this.regexp;let Y=this.options,z=Y.noglobstar?Xu:Y.dot?dz1:mz1,U=Y.nocase?"i":"",Q=$.map((J)=>{return J=J.map((K)=>typeof K==="string"?az1(K):K===R8?R8:K._src).reduce((K,I)=>{if(!(K[K.length-1]===R8&&I===R8))K.push(I);return K},[]),J.forEach((K,I)=>{if(K!==R8||J[I-1]===R8)return;if(I===0)if(J.length>1)J[I+1]="(?:\\/|"+z+"\\/)?"+J[I+1];else J[I]=z;else if(I===J.length-1)J[I-1]+="(?:\\/|"+z+")?";else J[I-1]+="(?:\\/|\\/"+z+"\\/)"+J[I+1],J[I+1]=R8}),J.filter((K)=>K!==R8).join("/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}match($,Y=this.partial){if(this.debug("match",$,this.pattern),this.comment)return!1;if(this.empty)return $==="";if($==="/"&&Y)return!0;let z=this.options;if(qu.sep!=="/")$=$.split(qu.sep).join("/");$=$.split(vW0),this.debug(this.pattern,"split",$);let U=this.set;this.debug(this.pattern,"set",U);let Q;for(let J=$.length-1;J>=0;J--)if(Q=$[J],Q)break;for(let J=0;J<U.length;J++){let K=U[J],I=$;if(z.matchBase&&K.length===1)I=[Q];if(this.matchOne(I,K,Y)){if(z.flipNegate)return!0;return!this.negate}}if(z.flipNegate)return!1;return this.negate}static defaults($){return H$.defaults($).Minimatch}}H$.Minimatch=sH});var uW0=E((rr1,fW0)=>{fW0.exports=xW0;var Mu=K0("fs"),{EventEmitter:ez1}=K0("events"),{Minimatch:Fu}=gW0(),{resolve:$U1}=K0("path");function YU1($,Y){return new Promise((z,U)=>{Mu.readdir($,{withFileTypes:!0},(Q,J)=>{if(Q)switch(Q.code){case"ENOTDIR":if(Y)U(Q);else z([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":z([]);break;case"ELOOP":default:U(Q);break}else z(J)})})}function yW0($,Y){return new Promise((z,U)=>{(Y?Mu.stat:Mu.lstat)($,(J,K)=>{if(J)switch(J.code){case"ENOENT":if(Y)z(yW0($,!1));else z(null);break;default:z(null);break}else z(K)})})}async function*kW0($,Y,z,U,Q,J){let K=await YU1(Y+$,J);for(let I of K){let G=I.name;if(G===void 0)G=I,U=!0;let W=$+"/"+G,H=W.slice(1),X=Y+"/"+H,Z=null;if(U||z)Z=await yW0(X,z);if(!Z&&I.name!==void 0)Z=I;if(Z===null)Z={isDirectory:()=>!1};if(Z.isDirectory()){if(!Q(H))yield{relative:H,absolute:X,stats:Z},yield*kW0(W,Y,z,U,Q,!1)}else yield{relative:H,absolute:X,stats:Z}}}async function*zU1($,Y,z,U){yield*kW0("",$,Y,z,U,!0)}function UU1($){return{pattern:$.pattern,dot:!!$.dot,noglobstar:!!$.noglobstar,matchBase:!!$.matchBase,nocase:!!$.nocase,ignore:$.ignore,skip:$.skip,follow:!!$.follow,stat:!!$.stat,nodir:!!$.nodir,mark:!!$.mark,silent:!!$.silent,absolute:!!$.absolute}}class wu extends ez1{constructor($,Y,z){super();if(typeof Y==="function")z=Y,Y=null;if(this.options=UU1(Y||{}),this.matchers=[],this.options.pattern){let U=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=U.map((Q)=>new Fu(Q,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){let U=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=U.map((Q)=>new Fu(Q,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){let U=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=U.map((Q)=>new Fu(Q,{dot:!0}))}if(this.iterator=zU1($U1($||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,z)this._matches=[],this.on("match",(U)=>this._matches.push(this.options.absolute?U.absolute:U.relative)),this.on("error",(U)=>z(U)),this.on("end",()=>z(null,this._matches));setTimeout(()=>this._next(),0)}_shouldSkipDirectory($){return this.skipMatchers.some((Y)=>Y.match($))}_fileMatches($,Y){let z=$+(Y?"/":"");return(this.matchers.length===0||this.matchers.some((U)=>U.match(z)))&&!this.ignoreMatchers.some((U)=>U.match(z))&&(!this.options.nodir||!Y)}_next(){if(!this.paused&&!this.aborted)this.iterator.next().then(($)=>{if(!$.done){let Y=$.value.stats.isDirectory();if(this._fileMatches($.value.relative,Y)){let z=$.value.relative,U=$.value.absolute;if(this.options.mark&&Y)z+="/",U+="/";if(this.options.stat)this.emit("match",{relative:z,absolute:U,stat:$.value.stats});else this.emit("match",{relative:z
Line truncated
|
||||
`,o);o=M0===-1?f.length:M0}else if(I0!==-1&&f[o]==="/"&&f[o+1]==="*"){let M0=f.indexOf("*/",o);if(M0!==-1)o=M0+2,I0=f.indexOf("*/",o);else n+=f[o],o++}else n+=f[o],o++;return n}function c0(f){let n=b0(f.toString()),o=n.match(a);if(!o)o=n.match(H0);if(!o)throw Error(`could not parse args in autoInject
|
||||
Source:
|
||||
`+n);let[,I0]=m;return I0.replace(/\s/g,"").split(F0).map((w0)=>w0.replace(u0,"").trim())}function A1(f,n){var m={};return Object.keys(f).forEach((I0)=>{var w0=f[I0],D0,P0=q(w0),j0=!P0&&w0.length===1||P0&&w0.length===0;if(Array.isArray(w0))D0=[...w0],w0=D0.pop(),m[I0]=D0.concat(D0.length>0?h0:w0);else if(j0)m[I0]=w0;else{if(D0=c0(w0),w0.length===0&&!P0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!P0)D0.pop();m[I0]=D0.concat(h0)}function h0(z1,x1){var m1=D0.map((i1)=>z1[i1]);m1.push(x1),M(w0)(...m1)}}),Y1(m,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:m}=n;if(f(n))this.removeLink(n);n=m}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,m){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var I0=M(f),w0=0,D0=[];let P0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){P0[G1].push(e0)}function h0(G1,e0){let W1=(...c1)=>{z1(G1,W1),e0(...c1)};P0[G1].push(W1)}function z1(G1,e0){if(!G1)return Object.keys(P0).forEach((W1)=>P0[W1]=[]);if(!e0)return P0[G1]=[];P0[G1]=P0[G1].filter((W1)=>W1!==e0)}function x1(G1,...e0){P0[G1].forEach((W1)=>W1(...e0))}var m1=!1;function i1(G1,e0,W1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function O$(PY,...lI){if(PY)return W1?v6(PY):g4();if(lI.length<=1)return g4(lI[0]);g4(lI)}var cU=l1._createTaskItem(G1,W1?O$:c1||O$);if(e0)l1._tasks.unshift(cU);else l1._tasks.push(cU);if(!m1)m1=!0,W(()=>{m1=!1,l1.process()});if(W1||!c1)return new Promise((PY,lI)=>{g4=PY,v6=lI})}function M$(G1){return function(e0,...W1){w0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],O$=D0.indexOf(v6);if(O$===0)D0.shift();else if(O$>0)D0.splice(O$,1);if(v6.callback(e0,...W1),e0!=null)x1("error",e0,v6.data)}if(w0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function iU(G1){if(G1.length===0&&l1.idle())return W(()=>x1("drain")),!0;return!1}let BY=(G1)=>(e0)=>{if(!e0)return new Promise((W1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);W1(v6)})});z1(G1),j0(G1,e0)};var mI=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:m,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(iU(G1))return;return G1.map((W1)=>i1(W1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(iU(G1))return;return G1.map((W1)=>i1(W1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){z1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(iU(G1))return;return G1.map((W1)=>i1(W1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(iU(G1))return;return G1.map((W1)=>i1(W1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(mI)return;mI=!0;while(!l1.paused&&w0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],W1=l1._tasks.length;if(l1.payload)W1=Math.min(W1,l1.payload);for(var c1=0;c1<W1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(w0+=1,l1._tasks.length===0)x1("empty");if(w0===l1.concurrency)x1("saturated");var v6=S(M$(G1));I0(e0,v6)}mI=!1},length(){return l1._tasks.length},running(){return w0},workersList(){return D0},idle(){return l1._tasks.length+w0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,W(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:BY("saturated")},unsaturated:{writable:!1,value:BY("unsaturated")},empty:{writable:!1,value:BY("empty")},drain:{writable:!1,value:BY("drain")},error:{writable:!1,value:BY("error")}}),l1}function A0(f,n){return b1(f,1,n)}function Q0(f,n,m){return b1(f,n,m)}function B(f,n,m,I0){I0=T(I0);var w0=M(m);return Y0(f,(D0,P0,j0)=>{w0(n,D0,(h0,z1)=>{n=z1,j0(h0)})},(D0)=>I0(D0,n))}var v=w(B,4);function u(...f){var n=f.map(M);return function(...m){var I0=this,w0=m[m.length-1];if(typeof w0=="function")m.pop();else w0=i0();return v(n,m,(D0,P0,j0)=>{P0.apply(I0,D0.concat((h0,...z1)=>{j0(h0,z1)}))},(D0,P0)=>w0(D0,...P0)),w0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,m,I0){return O(c(n),f,m,I0)}var J
Line truncated
|
||||
GFS4: `),console.error($)};if(!d4[s6]){if(Ou=global[s6]||[],mW0(d4,Ou),d4.close=function($){function Y(z,U){return $.call(d4,z,function(Q){if(!Q)dW0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(Y,DD,{value:$}),Y}(d4.close),d4.closeSync=function($){function Y(z){$.apply(d4,arguments),dW0()}return Object.defineProperty(Y,DD,{value:$}),Y}(d4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){Rz(d4[s6]),K0("assert").equal(d4[s6].length,0)})}var Ou;if(!global[s6])mW0(global,d4[s6]);Au.exports=Nu(zU1(d4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!d4.__patched)Au.exports=Nu(d4),d4.__patched=!0;function Nu($){$U1($),$.gracefulify=Nu,$.createReadStream=P,$.createWriteStream=T;var Y=$.readFile;$.readFile=z;function z(C,b,x){if(typeof b==="function")x=b,b=null;return S(C,b,x);function S(i,c,U0,k){return Y(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))KK([S,[i,c,U0],d,k||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=Q;function Q(C,b,x,S){if(typeof x==="function")S=x,x=null;return i(C,b,x,S);function i(c,U0,k,d,t){return U(c,U0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))KK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=K;function K(C,b,x,S){if(typeof x==="function")S=x,x=null;return i(C,b,x,S);function i(c,U0,k,d,t){return J(c,U0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))KK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var I=$.copyFile;if(I)$.copyFile=G;function G(C,b,x,S){if(typeof x==="function")S=x,x=0;return i(C,b,x,S);function i(c,U0,k,d,t){return I(c,U0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))KK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var W=$.readdir;$.readdir=X;var H=/^v[0-5]\./;function X(C,b,x){if(typeof b==="function")x=b,b=null;var S=H.test(process.version)?function(U0,k,d,t){return W(U0,i(U0,k,d,t))}:function(U0,k,d,t){return W(U0,k,i(U0,k,d,t))};return S(C,b,x);function i(c,U0,k,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))KK([S,[c,U0,k],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof k==="function")k.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=YU1($);w=Z.ReadStream,O=Z.WriteStream}var q=$.ReadStream;if(q)w.prototype=Object.create(q.prototype),w.prototype.open=N;var V=$.WriteStream;if(V)O.prototype=Object.create(V.prototype),O.prototype.open=D;Object.defineProperty($,"ReadStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return O},set:function(C){O=C},enumerable:!0,configurable:!0});var F=w;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var M=O;Object.defineProperty($,"FileWriteStream",{get:function(){return M},set:function(C){M=C},enumerable:!0,configurable:!0});function w(C,b){if(this instanceof w)return q.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function N(){var C=this;j(C.path,C.flags,C.mode,function(b,x){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=x,C.emit("open",x),C.read()})}function O(C,b){if(this instanceof O)return V.apply(this,arguments),this;else return O.apply(Object.create(O.prototype),arguments)}function D(){var C=this;j(C.path,C.flags,C.mode,function(b,x){if(b)C.destroy(),C.emit("error",b);else C.fd=x,C.emit("open",x)})}function P(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var A=$.open;$.open=j;function j(C,b,x,S){if(typeof x==="function")S=x,x=null;return i(C,b,x,S);function i(c,U0,k,d,t){return A(c,U0,k,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))KK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function KK($){Rz("ENQUEUE",$[0].name,$[1]),d4[s6].push($),Du()}var ND;function dW0(){var $=Date.now();for(var Y=0;Y<d4[s6].length;++Y)if(d4[s6][Y].length>2)d4[s6][Y][3]=$,d4[s6][Y][4]=$;Du()}function Du(){if(clearTimeout(ND),ND=void 0,d4[s6].length===0)return;var $=d4[s6].shift(),Y=$[0],z=$[1],U=$[2],Q=$[3],J=$[4];if(Q===void 0)Rz("RETRY",Y.name,z),Y.apply(null,z);else if(Date.now()-Q>=60000){Rz("TIMEOUT",Y.name,z);var K=z.pop();if(typeof K==="function")K.call(null,U)}else{var I=Date.now()-J,G=Math.max(J-Q,1),W=Math.min(G*1.2,100);if(I>=W)Rz("RETRY",Y.name,z),Y.apply(null,z.concat([Q]));else d4[s6].push($)}if(ND===void 0)ND=setTimeout(Du,0)}});var oW0=E((br1,Bu)=>{function QU1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var lW0=I6().Buffer,aH=K0("util");function JU1($,Y,z){$.copy(Y,z)}Bu.exports=function(){function $(){QU1(this,$),this.h
Line truncated
|
||||
`+n);let[,I0]=o;return I0.replace(/\s/g,"").split(F0).map((M0)=>M0.replace(u0,"").trim())}function A1(f,n){var o={};return Object.keys(f).forEach((I0)=>{var M0=f[I0],D0,P0=q(M0),j0=!P0&&M0.length===1||P0&&M0.length===0;if(Array.isArray(M0))D0=[...M0],M0=D0.pop(),o[I0]=D0.concat(D0.length>0?h0:M0);else if(j0)o[I0]=M0;else{if(D0=c0(M0),M0.length===0&&!P0&&D0.length===0)throw Error("autoInject task functions require explicit parameters.");if(!P0)D0.pop();o[I0]=D0.concat(h0)}function h0(z1,x1){var m1=D0.map((i1)=>z1[i1]);m1.push(x1),w(M0)(...m1)}}),Y1(o,n)}class k1{constructor(){this.head=this.tail=null,this.length=0}removeLink(f){if(f.prev)f.prev.next=f.next;else this.head=f.next;if(f.next)f.next.prev=f.prev;else this.tail=f.prev;return f.prev=f.next=null,this.length-=1,f}empty(){while(this.head)this.shift();return this}insertAfter(f,n){if(n.prev=f,n.next=f.next,f.next)f.next.prev=n;else this.tail=n;f.next=n,this.length+=1}insertBefore(f,n){if(n.prev=f.prev,n.next=f,f.prev)f.prev.next=n;else this.head=n;f.prev=n,this.length+=1}unshift(f){if(this.head)this.insertBefore(this.head,f);else u1(this,f)}push(f){if(this.tail)this.insertAfter(this.tail,f);else u1(this,f)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){var f=this.head;while(f)yield f.data,f=f.next}remove(f){var n=this.head;while(n){var{next:o}=n;if(f(n))this.removeLink(n);n=o}return this}}function u1(f,n){f.length=1,f.head=f.tail=n}function b1(f,n,o){if(n==null)n=1;else if(n===0)throw RangeError("Concurrency must not be zero");var I0=w(f),M0=0,D0=[];let P0={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function j0(G1,e0){P0[G1].push(e0)}function h0(G1,e0){let W1=(...c1)=>{z1(G1,W1),e0(...c1)};P0[G1].push(W1)}function z1(G1,e0){if(!G1)return Object.keys(P0).forEach((W1)=>P0[W1]=[]);if(!e0)return P0[G1]=[];P0[G1]=P0[G1].filter((W1)=>W1!==e0)}function x1(G1,...e0){P0[G1].forEach((W1)=>W1(...e0))}var m1=!1;function i1(G1,e0,W1,c1){if(c1!=null&&typeof c1!=="function")throw Error("task callback must be a function");l1.started=!0;var g4,v6;function N$(TY,...oI){if(TY)return W1?v6(TY):g4();if(oI.length<=1)return g4(oI[0]);g4(oI)}var nU=l1._createTaskItem(G1,W1?N$:c1||N$);if(e0)l1._tasks.unshift(nU);else l1._tasks.push(nU);if(!m1)m1=!0,W(()=>{m1=!1,l1.process()});if(W1||!c1)return new Promise((TY,oI)=>{g4=TY,v6=oI})}function O$(G1){return function(e0,...W1){M0-=1;for(var c1=0,g4=G1.length;c1<g4;c1++){var v6=G1[c1],N$=D0.indexOf(v6);if(N$===0)D0.shift();else if(N$>0)D0.splice(N$,1);if(v6.callback(e0,...W1),e0!=null)x1("error",e0,v6.data)}if(M0<=l1.concurrency-l1.buffer)x1("unsaturated");if(l1.idle())x1("drain");l1.process()}}function cU(G1){if(G1.length===0&&l1.idle())return W(()=>x1("drain")),!0;return!1}let PY=(G1)=>(e0)=>{if(!e0)return new Promise((W1,c1)=>{h0(G1,(g4,v6)=>{if(g4)return c1(g4);W1(v6)})});z1(G1),j0(G1,e0)};var lI=!1,l1={_tasks:new k1,_createTaskItem(G1,e0){return{data:G1,callback:e0}},*[Symbol.iterator](){yield*l1._tasks[Symbol.iterator]()},concurrency:n,payload:o,buffer:n/4,started:!1,paused:!1,push(G1,e0){if(Array.isArray(G1)){if(cU(G1))return;return G1.map((W1)=>i1(W1,!1,!1,e0))}return i1(G1,!1,!1,e0)},pushAsync(G1,e0){if(Array.isArray(G1)){if(cU(G1))return;return G1.map((W1)=>i1(W1,!1,!0,e0))}return i1(G1,!1,!0,e0)},kill(){z1(),l1._tasks.empty()},unshift(G1,e0){if(Array.isArray(G1)){if(cU(G1))return;return G1.map((W1)=>i1(W1,!0,!1,e0))}return i1(G1,!0,!1,e0)},unshiftAsync(G1,e0){if(Array.isArray(G1)){if(cU(G1))return;return G1.map((W1)=>i1(W1,!0,!0,e0))}return i1(G1,!0,!0,e0)},remove(G1){l1._tasks.remove(G1)},process(){if(lI)return;lI=!0;while(!l1.paused&&M0<l1.concurrency&&l1._tasks.length){var G1=[],e0=[],W1=l1._tasks.length;if(l1.payload)W1=Math.min(W1,l1.payload);for(var c1=0;c1<W1;c1++){var g4=l1._tasks.shift();G1.push(g4),D0.push(g4),e0.push(g4.data)}if(M0+=1,l1._tasks.length===0)x1("empty");if(M0===l1.concurrency)x1("saturated");var v6=S(O$(G1));I0(e0,v6)}lI=!1},length(){return l1._tasks.length},running(){return M0},workersList(){return D0},idle(){return l1._tasks.length+M0===0},pause(){l1.paused=!0},resume(){if(l1.paused===!1)return;l1.paused=!1,W(l1.process)}};return Object.defineProperties(l1,{saturated:{writable:!1,value:PY("saturated")},unsaturated:{writable:!1,value:PY("unsaturated")},empty:{writable:!1,value:PY("empty")},drain:{writable:!1,value:PY("drain")},error:{writable:!1,value:PY("error")}}),l1}function A0(f,n){return b1(f,1,n)}function Q0(f,n,o){return b1(f,n,o)}function B(f,n,o,I0){I0=T(I0);var M0=w(o);return Y0(f,(D0,P0,j0)=>{M0(n,D0,(h0,z1)=>{n=z1,j0(h0)})},(D0)=>I0(D0,n))}var v=M(B,4);function u(...f){var n=f.map(w);return function(...o){var I0=this,M0=o[o.length-1];if(typeof M0=="function")o.pop();else M0=i0();return v(n,o,(D0,P0,j0)=>{P0.apply(I0,D0.concat((h0,...z1)=>{j0(h0,z1)}))},(D0,P0)=>M0(D0,...P0)),M0[T0]}}function r(...f){return u(...f.reverse())}function X0(f,n,o,I0){return N(c(n),f,o,I0)}var J
Line truncated
|
||||
GFS4: `),console.error($)};if(!d4[s6]){if(Nu=global[s6]||[],rW0(d4,Nu),d4.close=function($){function Y(z,U){return $.call(d4,z,function(Q){if(!Q)oW0();if(typeof U==="function")U.apply(this,arguments)})}return Object.defineProperty(Y,AD,{value:$}),Y}(d4.close),d4.closeSync=function($){function Y(z){$.apply(d4,arguments),oW0()}return Object.defineProperty(Y,AD,{value:$}),Y}(d4.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){_z(d4[s6]),K0("assert").equal(d4[s6].length,0)})}var Nu;if(!global[s6])rW0(global,d4[s6]);Bu.exports=Du(ZU1(d4));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!d4.__patched)Bu.exports=Du(d4),d4.__patched=!0;function Du($){HU1($),$.gracefulify=Du,$.createReadStream=P,$.createWriteStream=T;var Y=$.readFile;$.readFile=z;function z(C,b,x){if(typeof b==="function")x=b,b=null;return S(C,b,x);function S(i,c,U0,k){return Y(i,c,function(d){if(d&&(d.code==="EMFILE"||d.code==="ENFILE"))IK([S,[i,c,U0],d,k||Date.now(),Date.now()]);else if(typeof U0==="function")U0.apply(this,arguments)})}}var U=$.writeFile;$.writeFile=Q;function Q(C,b,x,S){if(typeof x==="function")S=x,x=null;return i(C,b,x,S);function i(c,U0,k,d,t){return U(c,U0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))IK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var J=$.appendFile;if(J)$.appendFile=K;function K(C,b,x,S){if(typeof x==="function")S=x,x=null;return i(C,b,x,S);function i(c,U0,k,d,t){return J(c,U0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))IK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var I=$.copyFile;if(I)$.copyFile=G;function G(C,b,x,S){if(typeof x==="function")S=x,x=0;return i(C,b,x,S);function i(c,U0,k,d,t){return I(c,U0,k,function($0){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))IK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}var W=$.readdir;$.readdir=X;var H=/^v[0-5]\./;function X(C,b,x){if(typeof b==="function")x=b,b=null;var S=H.test(process.version)?function(U0,k,d,t){return W(U0,i(U0,k,d,t))}:function(U0,k,d,t){return W(U0,k,i(U0,k,d,t))};return S(C,b,x);function i(c,U0,k,d){return function(t,$0){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))IK([S,[c,U0,k],t,d||Date.now(),Date.now()]);else{if($0&&$0.sort)$0.sort();if(typeof k==="function")k.call(this,t,$0)}}}}if(process.version.substr(0,4)==="v0.8"){var Z=XU1($);M=Z.ReadStream,N=Z.WriteStream}var q=$.ReadStream;if(q)M.prototype=Object.create(q.prototype),M.prototype.open=O;var V=$.WriteStream;if(V)N.prototype=Object.create(V.prototype),N.prototype.open=D;Object.defineProperty($,"ReadStream",{get:function(){return M},set:function(C){M=C},enumerable:!0,configurable:!0}),Object.defineProperty($,"WriteStream",{get:function(){return N},set:function(C){N=C},enumerable:!0,configurable:!0});var F=M;Object.defineProperty($,"FileReadStream",{get:function(){return F},set:function(C){F=C},enumerable:!0,configurable:!0});var w=N;Object.defineProperty($,"FileWriteStream",{get:function(){return w},set:function(C){w=C},enumerable:!0,configurable:!0});function M(C,b){if(this instanceof M)return q.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function O(){var C=this;j(C.path,C.flags,C.mode,function(b,x){if(b){if(C.autoClose)C.destroy();C.emit("error",b)}else C.fd=x,C.emit("open",x),C.read()})}function N(C,b){if(this instanceof N)return V.apply(this,arguments),this;else return N.apply(Object.create(N.prototype),arguments)}function D(){var C=this;j(C.path,C.flags,C.mode,function(b,x){if(b)C.destroy(),C.emit("error",b);else C.fd=x,C.emit("open",x)})}function P(C,b){return new $.ReadStream(C,b)}function T(C,b){return new $.WriteStream(C,b)}var A=$.open;$.open=j;function j(C,b,x,S){if(typeof x==="function")S=x,x=null;return i(C,b,x,S);function i(c,U0,k,d,t){return A(c,U0,k,function($0,g){if($0&&($0.code==="EMFILE"||$0.code==="ENFILE"))IK([i,[c,U0,k,d],$0,t||Date.now(),Date.now()]);else if(typeof d==="function")d.apply(this,arguments)})}}return $}function IK($){_z("ENQUEUE",$[0].name,$[1]),d4[s6].push($),Au()}var DD;function oW0(){var $=Date.now();for(var Y=0;Y<d4[s6].length;++Y)if(d4[s6][Y].length>2)d4[s6][Y][3]=$,d4[s6][Y][4]=$;Au()}function Au(){if(clearTimeout(DD),DD=void 0,d4[s6].length===0)return;var $=d4[s6].shift(),Y=$[0],z=$[1],U=$[2],Q=$[3],J=$[4];if(Q===void 0)_z("RETRY",Y.name,z),Y.apply(null,z);else if(Date.now()-Q>=60000){_z("TIMEOUT",Y.name,z);var K=z.pop();if(typeof K==="function")K.call(null,U)}else{var I=Date.now()-J,G=Math.max(J-Q,1),W=Math.min(G*1.2,100);if(I>=W)_z("RETRY",Y.name,z),Y.apply(null,z.concat([Q]));else d4[s6].push($)}if(DD===void 0)DD=setTimeout(Au,0)}});var aW0=E(($s1,Pu)=>{function VU1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var sW0=I6().Buffer,aH=K0("util");function LU1($,Y,z){$.copy(Y,z)}Pu.exports=function(){function $(){VU1(this,$),this.h
Line truncated
|
||||
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
||||
*
|
||||
* Copyright (c) 2014-2018, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/gH0.exports=function($,Y){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var U="";if(z>4&&$[3]==="\\"){var Q=$[2];if((Q==="?"||Q===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var J=$.split(/[/\\]+/);if(Y!==!1&&J[J.length-1]==="")J.pop();return U+J.join("/")}});var cu=E((tr1,iH0)=>{var kH0=9007199254740991,XQ1="[object Arguments]",ZQ1="[object Function]",qQ1="[object GeneratorFunction]",VQ1=/^(?:0|[1-9]\d*)$/;function xH0($,Y,z){switch(z.length){case 0:return $.call(Y);case 1:return $.call(Y,z[0]);case 2:return $.call(Y,z[0],z[1]);case 3:return $.call(Y,z[0],z[1],z[2])}return $.apply(Y,z)}function LQ1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}var KX=Object.prototype,IX=KX.hasOwnProperty,fH0=KX.toString,FQ1=KX.propertyIsEnumerable,yH0=Math.max;function wQ1($,Y){var z=EQ1($)||jQ1($)?LQ1($.length,String):[],U=z.length,Q=!!U;for(var J in $)if((Y||IX.call($,J))&&!(Q&&(J=="length"||bH0(J,U))))z.push(J);return z}function MQ1($,Y,z,U){if($===void 0||uu($,KX[z])&&!IX.call(U,z))return Y;return $}function OQ1($,Y,z){var U=$[Y];if(!(IX.call($,Y)&&uu(U,z))||z===void 0&&!(Y in $))$[Y]=z}function NQ1($){if(!iu($))return TQ1($);var Y=PQ1($),z=[];for(var U in $)if(!(U=="constructor"&&(Y||!IX.call($,U))))z.push(U);return z}function uH0($,Y){return Y=yH0(Y===void 0?$.length-1:Y,0),function(){var z=arguments,U=-1,Q=yH0(z.length-Y,0),J=Array(Q);while(++U<Q)J[U]=z[Y+U];U=-1;var K=Array(Y+1);while(++U<Y)K[U]=z[U];return K[Y]=J,xH0($,this,K)}}function DQ1($,Y,z,U){z||(z={});var Q=-1,J=Y.length;while(++Q<J){var K=Y[Q],I=U?U(z[K],$[K],K,z,$):void 0;OQ1(z,K,I===void 0?$[K]:I)}return z}function AQ1($){return uH0(function(Y,z){var U=-1,Q=z.length,J=Q>1?z[Q-1]:void 0,K=Q>2?z[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Q--,J):void 0,K&&BQ1(z[0],z[1],K))J=Q<3?void 0:J,Q=1;Y=Object(Y);while(++U<Q){var I=z[U];if(I)$(Y,I,U,J)}return Y})}function bH0($,Y){return Y=Y==null?kH0:Y,!!Y&&(typeof $=="number"||VQ1.test($))&&($>-1&&$%1==0&&$<Y)}function BQ1($,Y,z){if(!iu(z))return!1;var U=typeof Y;if(U=="number"?bu(z)&&bH0(Y,z.length):U=="string"&&(Y in z))return uu(z[Y],$);return!1}function PQ1($){var Y=$&&$.constructor,z=typeof Y=="function"&&Y.prototype||KX;return $===z}function TQ1($){var Y=[];if($!=null)for(var z in Object($))Y.push(z);return Y}function uu($,Y){return $===Y||$!==$&&Y!==Y}function jQ1($){return CQ1($)&&IX.call($,"callee")&&(!FQ1.call($,"callee")||fH0.call($)==XQ1)}var EQ1=Array.isArray;function bu($){return $!=null&&_Q1($.length)&&!RQ1($)}function CQ1($){return vQ1($)&&bu($)}function RQ1($){var Y=iu($)?fH0.call($):"";return Y==ZQ1||Y==qQ1}function _Q1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=kH0}function iu($){var Y=typeof $;return!!$&&(Y=="object"||Y=="function")}function vQ1($){return!!$&&typeof $=="object"}var hQ1=AQ1(function($,Y,z,U){DQ1(Y,gQ1(Y),$,U)}),SQ1=uH0(function($){return $.push(void 0,MQ1),xH0(hQ1,void 0,$)});function gQ1($){return bu($)?wQ1($,!0):NQ1($)}iH0.exports=SQ1});var nH0=E((er1,nu)=>{function yQ1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var cH0=I6().Buffer,GX=K0("util");function kQ1($,Y,z){$.copy(Y,z)}nu.exports=function(){function $(){yQ1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,Q=""+U.data;while(U=U.next)Q+=z+U.data;return Q},$.prototype.concat=function(z){if(this.length===0)return cH0.alloc(0);var U=cH0.allocUnsafe(z>>>0),Q=this.head,J=0;while(Q)kQ1(Q.data,U,J),J+=Q.data.length,Q=Q.next;return U},$}();if(GX&&GX.inspect&&GX.inspect.custom)nu.exports.prototype[GX.inspect.custom]=function(){var $=GX.inspect({length:this.length});return this.constructor.name+" "+$}});var pu=E(($s1,pH0)=>{var gD=K6();function xQ1($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(U||Q){if(Y)Y($);else if($){if(!this._writableState)gD.nextTick(yD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,gD.nextTick(yD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!Y&&J){if(!z._writableState)gD.nextTick(yD,z,J);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,gD.nextTick(yD,z,J)}else if(Y)Y(J)}),this}function fQ1(){if(this._readableState)this._readabl
Line truncated
|
||||
%s`,P,P,N,U);var T=N.type==="*"?Cb:N.type==="?"?Eb:"\\"+N.type;Q=!0,U=U.slice(0,N.reStart)+T+"\\("+P}if(V(),J)U+="\\\\";var A=!1;switch(U.charAt(0)){case"[":case".":case"(":A=!0}for(var j=I.length-1;j>-1;j--){var C=I[j],b=U.slice(0,C.reStart),x=U.slice(C.reStart,C.reEnd-8),S=U.slice(C.reEnd-8,C.reEnd),i=U.slice(C.reEnd);S+=i;var c=b.split("(").length-1,U0=i;for(F=0;F<c;F++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var k="";if(i===""&&Y!==aD)k="$";var d=b+x+i+k+S;U=d}if(U!==""&&Q)U="(?=.)"+U;if(A)U=Z+U;if(Y===aD)return[U,Q];if(!Q)return UW1($);var t=z.nocase?"i":"";try{var $0=new RegExp("^"+U+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=U,$0}H$.makeRe=function($,Y){return new V6($,Y||{}).makeRe()};V6.prototype.makeRe=zW1;function zW1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var Y=this.options,z=Y.noglobstar?Cb:Y.dot?oG1:rG1,U=Y.nocase?"i":"",Q=$.map(function(J){return J.map(function(K){return K===fz?z:typeof K==="string"?QW1(K):K._src}).join("\\/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}H$.match=function($,Y,z){z=z||{};var U=new V6(Y,z);if($=$.filter(function(Q){return U.match(Q)}),U.options.nonull&&!$.length)$.push(Y);return $};V6.prototype.match=function(Y,z){if(typeof z>"u")z=this.partial;if(this.debug("match",Y,this.pattern),this.comment)return!1;if(this.empty)return Y==="";if(Y==="/"&&z)return!0;var U=this.options;if(NX.sep!=="/")Y=Y.split(NX.sep).join("/");Y=Y.split(BZ0),this.debug(this.pattern,"split",Y);var Q=this.set;this.debug(this.pattern,"set",Q);var J,K;for(K=Y.length-1;K>=0;K--)if(J=Y[K],J)break;for(K=0;K<Q.length;K++){var I=Q[K],G=Y;if(U.matchBase&&I.length===1)G=[J];var W=this.matchOne(G,I,z);if(W){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};V6.prototype.matchOne=function($,Y,z){if(Y.indexOf(fz)!==-1)return this._matchGlobstar($,Y,z,0,0);return this._matchOne($,Y,z,0,0)};V6.prototype._matchGlobstar=function($,Y,z,U,Q){var J,K=-1;for(J=Q;J<Y.length;J++)if(Y[J]===fz){K=J;break}var I=-1;for(J=Y.length-1;J>=0;J--)if(Y[J]===fz){I=J;break}var G=Y.slice(Q,K),W=z?Y.slice(K+1):Y.slice(K+1,I),H=z?[]:Y.slice(I+1);if(G.length){var X=$.slice(U,U+G.length);if(!this._matchOne(X,G,z,0,0))return!1;U+=G.length}var Z=0;if(H.length){if(H.length+U>$.length)return!1;var q=$.length-H.length;if(this._matchOne($,H,z,q,0))Z=H.length;else{if($[$.length-1]!==""||U+H.length===$.length)return!1;if(q--,!this._matchOne($,H,z,q,0))return!1;Z=H.length+1}}if(!W.length){var V=!!Z;for(J=U;J<$.length-Z;J++){var F=String($[J]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return z||V}var M=[[[],0]],w=M[0],N=0,O=[0];for(var D=0;D<W.length;D++){var P=W[D];if(P===fz)O.push(N),w=[[],0],M.push(w);else w[0].push(P),N++}var T=M.length-1,A=$.length-Z;for(var j=0;j<M.length;j++)M[j][1]=A-(O[T--]+M[j][0].length);return!!this._matchGlobStarBodySections($,M,U,0,z,0,!!Z)};V6.prototype._matchGlobStarBodySections=function($,Y,z,U,Q,J,K){var I=Y[U];if(!I){for(var G=z;G<$.length;G++){K=!0;var W=$[G];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1}return K}var H=I[0],X=I[1];while(z<=X){var Z=this._matchOne($.slice(0,z+H.length),H,Q,z,0);if(Z&&J<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,Y,z+H.length,U+1,Q,J+1,K);if(q!==!1)return q}var W=$[z];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1;z++}return Q||null};V6.prototype._matchOne=function($,Y,z,U,Q){var J,K,I,G;for(J=U,K=Q,I=$.length,G=Y.length;J<I&&K<G;J++,K++){this.debug("matchOne loop");var W=Y[K],H=$[J];if(this.debug(Y,W,H),W===!1||W===fz)return!1;var X;if(typeof W==="string")X=H===W,this.debug("string match",W,H,X);else X=H.match(W),this.debug("pattern match",W,H,X);if(!X)return!1}if(J===I&&K===G)return!0;else if(J===I)return z;else if(K===G)return J===I-1&&$[J]==="";throw Error("wtf?")};function UW1($){return $.replace(/\\(.)/g,"$1")}function QW1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var YA=E((Ns1,$A)=>{function jZ0($){return $.charAt(0)==="/"}function EZ0($){var Y=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=Y.exec($),U=z[1]||"",Q=Boolean(U&&U.charAt(1)!==":");return Boolean(z[2]||Q)}$A.exports=process.platform==="win32"?EZ0:jZ0;$A.exports.posix=jZ0;$A.exports.win32=EZ0});var _b=E((VW1)=>{VW1.setopts=HW1;VW1.ownProp=CZ0;VW1.makeAbs=DX;VW1.finish=XW1;VW1.mark=ZW1;VW1.isIgnored=_Z0;VW1.childrenIgnored=qW1;function CZ0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}var JW1=K0("fs"),OK=K0("path"),KW1=eD(),RZ0=YA(),Rb=KW1.Minimatch;function IW1($,Y){return $.localeCompare(Y,"en")}function GW1($,Y){if($.ignore=Y.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(WW1)}function WW1($){var Y=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");Y=new Rb(z,{dot:!0})}return{ma
Line truncated
|
||||
*/xH0.exports=function($,Y){if(typeof $!=="string")throw TypeError("expected path to be a string");if($==="\\"||$==="/")return"/";var z=$.length;if(z<=1)return $;var U="";if(z>4&&$[3]==="\\"){var Q=$[2];if((Q==="?"||Q===".")&&$.slice(0,2)==="\\\\")$=$.slice(2),U="//"}var J=$.split(/[/\\]+/);if(Y!==!1&&J[J.length-1]==="")J.pop();return U+J.join("/")}});var nu=E((Zs1,pH0)=>{var uH0=9007199254740991,DQ1="[object Arguments]",AQ1="[object Function]",BQ1="[object GeneratorFunction]",PQ1=/^(?:0|[1-9]\d*)$/;function bH0($,Y,z){switch(z.length){case 0:return $.call(Y);case 1:return $.call(Y,z[0]);case 2:return $.call(Y,z[0],z[1]);case 3:return $.call(Y,z[0],z[1],z[2])}return $.apply(Y,z)}function TQ1($,Y){var z=-1,U=Array($);while(++z<$)U[z]=Y(z);return U}var KX=Object.prototype,IX=KX.hasOwnProperty,iH0=KX.toString,jQ1=KX.propertyIsEnumerable,fH0=Math.max;function EQ1($,Y){var z=xQ1($)||kQ1($)?TQ1($.length,String):[],U=z.length,Q=!!U;for(var J in $)if((Y||IX.call($,J))&&!(Q&&(J=="length"||nH0(J,U))))z.push(J);return z}function CQ1($,Y,z,U){if($===void 0||bu($,KX[z])&&!IX.call(U,z))return Y;return $}function RQ1($,Y,z){var U=$[Y];if(!(IX.call($,Y)&&bu(U,z))||z===void 0&&!(Y in $))$[Y]=z}function _Q1($){if(!cu($))return yQ1($);var Y=gQ1($),z=[];for(var U in $)if(!(U=="constructor"&&(Y||!IX.call($,U))))z.push(U);return z}function cH0($,Y){return Y=fH0(Y===void 0?$.length-1:Y,0),function(){var z=arguments,U=-1,Q=fH0(z.length-Y,0),J=Array(Q);while(++U<Q)J[U]=z[Y+U];U=-1;var K=Array(Y+1);while(++U<Y)K[U]=z[U];return K[Y]=J,bH0($,this,K)}}function vQ1($,Y,z,U){z||(z={});var Q=-1,J=Y.length;while(++Q<J){var K=Y[Q],I=U?U(z[K],$[K],K,z,$):void 0;RQ1(z,K,I===void 0?$[K]:I)}return z}function hQ1($){return cH0(function(Y,z){var U=-1,Q=z.length,J=Q>1?z[Q-1]:void 0,K=Q>2?z[2]:void 0;if(J=$.length>3&&typeof J=="function"?(Q--,J):void 0,K&&SQ1(z[0],z[1],K))J=Q<3?void 0:J,Q=1;Y=Object(Y);while(++U<Q){var I=z[U];if(I)$(Y,I,U,J)}return Y})}function nH0($,Y){return Y=Y==null?uH0:Y,!!Y&&(typeof $=="number"||PQ1.test($))&&($>-1&&$%1==0&&$<Y)}function SQ1($,Y,z){if(!cu(z))return!1;var U=typeof Y;if(U=="number"?iu(z)&&nH0(Y,z.length):U=="string"&&(Y in z))return bu(z[Y],$);return!1}function gQ1($){var Y=$&&$.constructor,z=typeof Y=="function"&&Y.prototype||KX;return $===z}function yQ1($){var Y=[];if($!=null)for(var z in Object($))Y.push(z);return Y}function bu($,Y){return $===Y||$!==$&&Y!==Y}function kQ1($){return fQ1($)&&IX.call($,"callee")&&(!jQ1.call($,"callee")||iH0.call($)==DQ1)}var xQ1=Array.isArray;function iu($){return $!=null&&bQ1($.length)&&!uQ1($)}function fQ1($){return iQ1($)&&iu($)}function uQ1($){var Y=cu($)?iH0.call($):"";return Y==AQ1||Y==BQ1}function bQ1($){return typeof $=="number"&&$>-1&&$%1==0&&$<=uH0}function cu($){var Y=typeof $;return!!$&&(Y=="object"||Y=="function")}function iQ1($){return!!$&&typeof $=="object"}var cQ1=hQ1(function($,Y,z,U){vQ1(Y,pQ1(Y),$,U)}),nQ1=cH0(function($){return $.push(void 0,CQ1),bH0(cQ1,void 0,$)});function pQ1($){return iu($)?EQ1($,!0):_Q1($)}pH0.exports=nQ1});var mH0=E((qs1,pu)=>{function dQ1($,Y){if(!($ instanceof Y))throw TypeError("Cannot call a class as a function")}var dH0=I6().Buffer,GX=K0("util");function mQ1($,Y,z){$.copy(Y,z)}pu.exports=function(){function $(){dQ1(this,$),this.head=null,this.tail=null,this.length=0}return $.prototype.push=function(z){var U={data:z,next:null};if(this.length>0)this.tail.next=U;else this.head=U;this.tail=U,++this.length},$.prototype.unshift=function(z){var U={data:z,next:this.head};if(this.length===0)this.tail=U;this.head=U,++this.length},$.prototype.shift=function(){if(this.length===0)return;var z=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,z},$.prototype.clear=function(){this.head=this.tail=null,this.length=0},$.prototype.join=function(z){if(this.length===0)return"";var U=this.head,Q=""+U.data;while(U=U.next)Q+=z+U.data;return Q},$.prototype.concat=function(z){if(this.length===0)return dH0.alloc(0);var U=dH0.allocUnsafe(z>>>0),Q=this.head,J=0;while(Q)mQ1(Q.data,U,J),J+=Q.data.length,Q=Q.next;return U},$}();if(GX&&GX.inspect&&GX.inspect.custom)pu.exports.prototype[GX.inspect.custom]=function(){var $=GX.inspect({length:this.length});return this.constructor.name+" "+$}});var du=E((Vs1,lH0)=>{var yD=K6();function lQ1($,Y){var z=this,U=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(U||Q){if(Y)Y($);else if($){if(!this._writableState)yD.nextTick(kD,this,$);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,yD.nextTick(kD,this,$)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy($||null,function(J){if(!Y&&J){if(!z._writableState)yD.nextTick(kD,z,J);else if(!z._writableState.errorEmitted)z._writableState.errorEmitted=!0,yD.nextTick(kD,z,J)}else if(Y)Y(J)}),this}function oQ1(){if(this._readableState)this._readabl
Line truncated
|
||||
%s`,P,P,O,U);var T=O.type==="*"?Rb:O.type==="?"?Cb:"\\"+O.type;Q=!0,U=U.slice(0,O.reStart)+T+"\\("+P}if(V(),J)U+="\\\\";var A=!1;switch(U.charAt(0)){case"[":case".":case"(":A=!0}for(var j=I.length-1;j>-1;j--){var C=I[j],b=U.slice(0,C.reStart),x=U.slice(C.reStart,C.reEnd-8),S=U.slice(C.reEnd-8,C.reEnd),i=U.slice(C.reEnd);S+=i;var c=b.split("(").length-1,U0=i;for(F=0;F<c;F++)U0=U0.replace(/\)[+*?]?/,"");i=U0;var k="";if(i===""&&Y!==tD)k="$";var d=b+x+i+k+S;U=d}if(U!==""&&Q)U="(?=.)"+U;if(A)U=Z+U;if(Y===tD)return[U,Q];if(!Q)return qW1($);var t=z.nocase?"i":"";try{var $0=new RegExp("^"+U+"$",t)}catch(g){return new RegExp("$.")}return $0._glob=$,$0._src=U,$0}X$.makeRe=function($,Y){return new V6($,Y||{}).makeRe()};V6.prototype.makeRe=ZW1;function ZW1(){if(this.regexp||this.regexp===!1)return this.regexp;var $=this.set;if(!$.length)return this.regexp=!1,this.regexp;var Y=this.options,z=Y.noglobstar?Rb:Y.dot?QW1:JW1,U=Y.nocase?"i":"",Q=$.map(function(J){return J.map(function(K){return K===uz?z:typeof K==="string"?VW1(K):K._src}).join("\\/")}).join("|");if(Q="^(?:"+Q+")$",this.negate)Q="^(?!"+Q+").*$";try{this.regexp=new RegExp(Q,U)}catch(J){this.regexp=!1}return this.regexp}X$.match=function($,Y,z){z=z||{};var U=new V6(Y,z);if($=$.filter(function(Q){return U.match(Q)}),U.options.nonull&&!$.length)$.push(Y);return $};V6.prototype.match=function(Y,z){if(typeof z>"u")z=this.partial;if(this.debug("match",Y,this.pattern),this.comment)return!1;if(this.empty)return Y==="";if(Y==="/"&&z)return!0;var U=this.options;if(NX.sep!=="/")Y=Y.split(NX.sep).join("/");Y=Y.split(jZ0),this.debug(this.pattern,"split",Y);var Q=this.set;this.debug(this.pattern,"set",Q);var J,K;for(K=Y.length-1;K>=0;K--)if(J=Y[K],J)break;for(K=0;K<Q.length;K++){var I=Q[K],G=Y;if(U.matchBase&&I.length===1)G=[J];var W=this.matchOne(G,I,z);if(W){if(U.flipNegate)return!0;return!this.negate}}if(U.flipNegate)return!1;return this.negate};V6.prototype.matchOne=function($,Y,z){if(Y.indexOf(uz)!==-1)return this._matchGlobstar($,Y,z,0,0);return this._matchOne($,Y,z,0,0)};V6.prototype._matchGlobstar=function($,Y,z,U,Q){var J,K=-1;for(J=Q;J<Y.length;J++)if(Y[J]===uz){K=J;break}var I=-1;for(J=Y.length-1;J>=0;J--)if(Y[J]===uz){I=J;break}var G=Y.slice(Q,K),W=z?Y.slice(K+1):Y.slice(K+1,I),H=z?[]:Y.slice(I+1);if(G.length){var X=$.slice(U,U+G.length);if(!this._matchOne(X,G,z,0,0))return!1;U+=G.length}var Z=0;if(H.length){if(H.length+U>$.length)return!1;var q=$.length-H.length;if(this._matchOne($,H,z,q,0))Z=H.length;else{if($[$.length-1]!==""||U+H.length===$.length)return!1;if(q--,!this._matchOne($,H,z,q,0))return!1;Z=H.length+1}}if(!W.length){var V=!!Z;for(J=U;J<$.length-Z;J++){var F=String($[J]);if(V=!0,F==="."||F===".."||!this.options.dot&&F.charAt(0)===".")return!1}return z||V}var w=[[[],0]],M=w[0],O=0,N=[0];for(var D=0;D<W.length;D++){var P=W[D];if(P===uz)N.push(O),M=[[],0],w.push(M);else M[0].push(P),O++}var T=w.length-1,A=$.length-Z;for(var j=0;j<w.length;j++)w[j][1]=A-(N[T--]+w[j][0].length);return!!this._matchGlobStarBodySections($,w,U,0,z,0,!!Z)};V6.prototype._matchGlobStarBodySections=function($,Y,z,U,Q,J,K){var I=Y[U];if(!I){for(var G=z;G<$.length;G++){K=!0;var W=$[G];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1}return K}var H=I[0],X=I[1];while(z<=X){var Z=this._matchOne($.slice(0,z+H.length),H,Q,z,0);if(Z&&J<this.maxGlobstarRecursion){var q=this._matchGlobStarBodySections($,Y,z+H.length,U+1,Q,J+1,K);if(q!==!1)return q}var W=$[z];if(W==="."||W===".."||!this.options.dot&&W.charAt(0)===".")return!1;z++}return Q||null};V6.prototype._matchOne=function($,Y,z,U,Q){var J,K,I,G;for(J=U,K=Q,I=$.length,G=Y.length;J<I&&K<G;J++,K++){this.debug("matchOne loop");var W=Y[K],H=$[J];if(this.debug(Y,W,H),W===!1||W===uz)return!1;var X;if(typeof W==="string")X=H===W,this.debug("string match",W,H,X);else X=H.match(W),this.debug("pattern match",W,H,X);if(!X)return!1}if(J===I&&K===G)return!0;else if(J===I)return z;else if(K===G)return J===I-1&&$[J]==="";throw Error("wtf?")};function qW1($){return $.replace(/\\(.)/g,"$1")}function VW1($){return $.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var zA=E((gs1,YA)=>{function RZ0($){return $.charAt(0)==="/"}function _Z0($){var Y=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,z=Y.exec($),U=z[1]||"",Q=Boolean(U&&U.charAt(1)!==":");return Boolean(z[2]||Q)}YA.exports=process.platform==="win32"?_Z0:RZ0;YA.exports.posix=RZ0;YA.exports.win32=_Z0});var vb=E((PW1)=>{PW1.setopts=NW1;PW1.ownProp=vZ0;PW1.makeAbs=DX;PW1.finish=DW1;PW1.mark=AW1;PW1.isIgnored=SZ0;PW1.childrenIgnored=BW1;function vZ0($,Y){return Object.prototype.hasOwnProperty.call($,Y)}var LW1=K0("fs"),NK=K0("path"),FW1=$A(),hZ0=zA(),_b=FW1.Minimatch;function MW1($,Y){return $.localeCompare(Y,"en")}function wW1($,Y){if($.ignore=Y.ignore||[],!Array.isArray($.ignore))$.ignore=[$.ignore];if($.ignore.length)$.ignore=$.ignore.map(OW1)}function OW1($){var Y=null;if($.slice(-3)==="/**"){var z=$.replace(/(\/\*\*)+$/,"");Y=new _b(z,{dot:!0})}return{ma
Line truncated
|
||||
See: https://github.com/isaacs/node-glob/issues/167`);return new T6($,Y).found}function T6($,Y){if(!$)throw Error("must provide pattern");if(typeof Y==="function"||arguments.length===3)throw TypeError(`callback provided to sync glob
|
||||
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,Y);if(BW1(this,$,Y),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var U=0;U<z;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}T6.prototype._finish=function(){if(hZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(Y,z){var U=$.matches[z]=Object.create(null);for(var Q in Y)try{Q=$._makeAbs(Q);var J=AW1.realpathSync(Q,$.realpathCache);U[J]=!0}catch(K){if(K.syscall==="stat")U[$._makeAbs(Q)]=!0;else throw K}})}uz.finish(this)};T6.prototype._process=function($,Y,z){hZ0.ok(this instanceof T6);var U=0;while(typeof $[U]==="string")U++;var Q;switch(U){case $.length:this._processSimple($.join("/"),Y);return;case 0:Q=null;break;default:Q=$.slice(0,U).join("/");break}var J=$.slice(U),K;if(Q===null)K=".";else if(zA(Q)||zA($.map(function(W){return typeof W==="string"?W:"[*]"}).join("/"))){if(!Q||!zA(Q))Q="/"+Q;K=Q}else K=Q;var I=this._makeAbs(K);if(PW1(this,K))return;var G=J[0]===vZ0.GLOBSTAR;if(G)this._processGlobStar(Q,K,I,J,Y,z);else this._processReaddir(Q,K,I,J,Y,z)};T6.prototype._processReaddir=function($,Y,z,U,Q,J){var K=this._readdir(z,J);if(!K)return;var I=U[0],G=!!this.minimatch.negate,W=I._glob,H=this.dot||W.charAt(0)===".",X=[];for(var Z=0;Z<K.length;Z++){var q=K[Z];if(q.charAt(0)!=="."||H){var V;if(G&&!$)V=!q.match(I);else V=q.match(I);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[Q])this.matches[Q]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=vb.join(this.root,q);this._emitMatch(Q,q)}return}U.shift();for(var Z=0;Z<F;Z++){var q=X[Z],M;if($)M=[$,q];else M=[q];this._process(M.concat(U),Q,J)}};T6.prototype._emitMatch=function($,Y){if(TW1(this,Y))return;var z=this._makeAbs(Y);if(this.mark)Y=this._mark(Y);if(this.absolute)Y=z;if(this.matches[$][Y])return;if(this.nodir){var U=this.cache[z];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][Y]=!0,this.stat)this._stat(Y)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var Y,z,U;try{z=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Q=z&&z.isSymbolicLink();if(this.symlinks[$]=Q,!Q&&z&&!z.isDirectory())this.cache[$]="FILE";else Y=this._readdir($,!1);return Y};T6.prototype._readdir=function($,Y){var z;if(Y&&!hb(this.symlinks,$))return this._readdirInGlobStar($);if(hb(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Q){return this._readdirError($,Q),null}};T6.prototype._readdirEntries=function($,Y){if(!this.mark&&!this.stat)for(var z=0;z<Y.length;z++){var U=Y[z];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=Y,Y};T6.prototype._readdirError=function($,Y){switch(Y.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var U=Error(Y.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=Y.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw Y;if(!this.silent)console.error("glob error",Y);break}};T6.prototype._processGlobStar=function($,Y,z,U,Q,J){var K=this._readdir(z,J);if(!K)return;var I=U.slice(1),G=$?[$]:[],W=G.concat(I);this._process(W,Q,!1);var H=K.length,X=this.symlinks[z];if(X&&J)return;for(var Z=0;Z<H;Z++){var q=K[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(K[Z],I);this._process(V,Q,!0);var F=G.concat(K[Z],U);this._process(F,Q,!0)}};T6.prototype._processSimple=function($,Y){var z=this._stat($);if(!this.matches[Y])this.matches[Y]=Object.create(null);if(!z)return;if($&&zA($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=vb.join(this.root,$);else if($=vb.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(Y,$)};T6.prototype._stat=function($){var Y=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&hb(this.cache,Y)){var K=this.cache[Y];if(Array.isArray(K))K="DIR";if(!z||K==="DIR")return K;if(z&&K==="FILE")return!1}var U,Q=this.statCache[Y];if(!Q){var J;try{J=this.fs.lstatSync(Y)}catch(I){if(I&&(I.code==="ENOENT"||I.code==="ENOTDIR"))return this.statCache[Y]=!1,!1}if(J&&J.isSymbolicLink())try{Q=this.fs.statSync(Y)}catch(I){Q=J}else Q=J}this.statCache[Y]=Q;var K=!0;if(Q)K=Q.isDirectory()?"DIR":"FILE";if(this.cache[Y]=this.cache[Y]||K,z&&K==="FILE")return!1;return K};T6.prototype._mark=function($){return uz.mark(this,$)};T6.prototype._makeAbs=function($){return uz.makeAbs(this,$)}});var Sb=E((js1,xZ0)=>{xZ0.exports=kZ0;function kZ0($,Y){if($&&Y)return kZ0($)(Y);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){z[U]=$[U]}),z;f
Line truncated
|
||||
`);if($.linkname)Y+=vi(" linkpath="+$.linkname+`
|
||||
`);var z=$.pax;if(z)for(var U in z)Y+=vi(" "+U+"="+z[U]+`
|
||||
`);return Buffer.from(Y)};yZ1.decodePax=function($){var Y={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var U=parseInt($.slice(0,z).toString(),10);if(!U)return Y;var Q=$.slice(z+1,U-1).toString(),J=Q.indexOf("=");if(J===-1)return Y;Y[Q.slice(0,J)]=Q.slice(J+1),$=$.slice(U)}return Y};yZ1.encode=function($){var Y=PZ1(512),z=$.name,U="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var Q=z.indexOf("/");if(Q===-1)return null;U+=U?"/"+z.slice(0,Q):z.slice(0,Q),z=z.slice(Q+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(Y.write(z),Y.write(j2($.mode&_Z1,6),100),Y.write(j2($.uid,6),108),Y.write(j2($.gid,6),116),Y.write(j2($.size,11),124),Y.write(j2($.mtime.getTime()/1000|0,11),136),Y[156]=aV0+SZ1($.type),$.linkname)Y.write($.linkname,157);if(tV0.copy(Y,xX),EZ1.copy(Y,hi),$.uname)Y.write($.uname,265);if($.gname)Y.write($.gname,297);if(Y.write(j2($.devmajor||0,6),329),Y.write(j2($.devminor||0,6),337),U)Y.write(U,345);return Y.write(j2($L0(Y),6),148),Y};yZ1.decode=function($,Y,z){var U=$[156]===0?0:$[156]-aV0,Q=CK($,0,100,Y),J=E2($,100,8),K=E2($,108,8),I=E2($,116,8),G=E2($,124,12),W=E2($,136,12),H=hZ1(U),X=$[157]===0?null:CK($,157,100,Y),Z=CK($,265,32),q=CK($,297,32),V=E2($,329,8),F=E2($,337,8),M=$L0($);if(M===256)return null;if(M!==E2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(tV0.compare($,xX,xX+6)===0){if($[345])Q=CK($,345,155,Y)+"/"+Q}else if(CZ1.compare($,xX,xX+6)===0&&RZ1.compare($,hi,hi+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(U===0&&Q&&Q[Q.length-1]==="/")U=5;return{name:Q,mode:J,uid:K,gid:I,size:G,mtime:new Date(1000*W),type:H,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var IL0=E((Na1,KL0)=>{var zL0=K0("util"),iZ1=sV0(),fX=Si(),UL0=E8().Writable,QL0=E8().PassThrough,JL0=function(){},YL0=function($){return $&=511,$&&512-$},cZ1=function($,Y){var z=new AA($,Y);return z.end(),z},nZ1=function($,Y){if(Y.path)$.name=Y.path;if(Y.linkpath)$.linkname=Y.linkpath;if(Y.size)$.size=parseInt(Y.size,10);return $.pax=Y,$},AA=function($,Y){this._parent=$,this.offset=Y,QL0.call(this,{autoDestroy:!1})};zL0.inherits(AA,QL0);AA.prototype.destroy=function($){this._parent.destroy($)};var T3=function($){if(!(this instanceof T3))return new T3($);UL0.call(this,$),$=$||{},this._offset=0,this._buffer=iZ1(),this._missing=0,this._partial=!1,this._onparse=JL0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var Y=this,z=Y._buffer,U=function(){Y._continue()},Q=function(Z){if(Y._locked=!1,Z)return Y.destroy(Z);if(!Y._stream)U()},J=function(){Y._stream=null;var Z=YL0(Y._header.size);if(Z)Y._parse(Z,K);else Y._parse(512,X);if(!Y._locked)U()},K=function(){Y._buffer.consume(YL0(Y._header.size)),Y._parse(512,X),U()},I=function(){var Z=Y._header.size;Y._paxGlobal=fX.decodePax(z.slice(0,Z)),z.consume(Z),J()},G=function(){var Z=Y._header.size;if(Y._pax=fX.decodePax(z.slice(0,Z)),Y._paxGlobal)Y._pax=Object.assign({},Y._paxGlobal,Y._pax);z.consume(Z),J()},W=function(){var Z=Y._header.size;this._gnuLongPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},H=function(){var Z=Y._header.size;this._gnuLongLinkPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},X=function(){var Z=Y._offset,q;try{q=Y._header=fX.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){Y.emit("error",V)}if(z.consume(512),!q){Y._parse(512,X),U();return}if(q.type==="gnu-long-path"){Y._parse(q.size,W),U();return}if(q.type==="gnu-long-link-path"){Y._parse(q.size,H),U();return}if(q.type==="pax-global-header"){Y._parse(q.size,I),U();return}if(q.type==="pax-header"){Y._parse(q.size,G),U();return}if(Y._gnuLongPath)q.name=Y._gnuLongPath,Y._gnuLongPath=null;if(Y._gnuLongLinkPath)q.linkname=Y._gnuLongLinkPath,Y._gnuLongLinkPath=null;if(Y._pax)Y._header=q=nZ1(q,Y._pax),Y._pax=null;if(Y._locked=!0,!q.size||q.type==="directory"){Y._parse(512,X),Y.emit("entry",q,cZ1(Y,Z),Q);return}Y._stream=new AA(Y,Z),Y.emit("entry",q,Y._stream,Q),Y._parse(q.size,J),U()};this._onheader=X,this._parse(512,X)};zL0.inherits(T3,UL0);T3.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};T3.prototype._parse=function($,Y){if(this._destroyed)return;if(this._offset+=$,this._missing=$,Y===this._onheader)this._partial=!1;this._onparse=Y};T3.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=JL0,this._overflow)this._write(this._overflow,void 0,$);else $()};T3.prototype._write=function($,Y,z){if(this._destroyed)return;var U=this._stream,Q=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J)
Line truncated
|
||||
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let Y=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${Gq1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${$.Target}"/>`);return Y}_writeClose(){this.stream.write("</Relationships>")}}SL0.exports=hL0});var uL0=E((_a1,fL0)=>{var yL0=l6(),kL0=Q2(),Hq1=c4(),Xq1=mx(),Zq1=ox();class xL0{constructor($,Y,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=Y}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:kL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let Y={Type:kL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(Y)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,Y){let z=new Xq1,U=new yL0;z.render(U,$),this.commentsStream.write(U.xml);let Q=new Zq1,J=new yL0;Q.render(J,$,Y),this.vmlStream.write(J.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((Y)=>{Y.refAddress=Hq1.decodeAddress(Y.ref)}),$.forEach((Y)=>{this._writeComment(Y,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}fL0.exports=xL0});var dL0=E((va1,pL0)=>{var qq1=Y6(),Vq1=Q2(),ki=c4(),bL0=Xg(),iL0=z3(),Lq1=Tk(),cL0=EM(),xi=RM(),Fq1=gL0(),wq1=uL0(),Mq1=Wg(),y6=new Lq1,fi=Y2(),Oq1=Nx(),Nq1=Dx(),Dq1=Ax(),Aq1=Fx(),Bq1=Vx(),Pq1=wx(),Tq1=Bx(),jq1=Px(),Eq1=Tx(),Cq1=jx(),Rq1=Ex(),_q1=Cx(),vq1=Sx(),hq1=_x(),Sq1=Rx(),k6={dataValidations:new Oq1,sheetProperties:new Nq1,sheetFormatProperties:new Dq1,columns:new fi({tag:"cols",length:!1,childXform:new Aq1}),row:new Bq1,hyperlinks:new fi({tag:"hyperlinks",length:!1,childXform:new Pq1}),sheetViews:new fi({tag:"sheetViews",length:!1,childXform:new Tq1}),sheetProtection:new jq1,pageMargins:new Eq1,pageSeteup:new Cq1,autoFilter:new Rq1,picture:new _q1,conditionalFormattings:new vq1,headerFooter:new hq1,rowBreaks:new Sq1};class nL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new Fq1($),this._sheetCommentsWriter=new wq1(this,this._sheetRelsWriter,$),this._dimensions=new iL0,this._rowZero=1,this.committed=!1,this.dataValidations=new Mq1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get
Line truncated
|
||||
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))return new T6($,Y);if(SW1(this,$,Y),this.noprocess)return this;var z=this.minimatch.set.length;this.matches=Array(z);for(var U=0;U<z;U++)this._process(this.minimatch.set[U],U,!1);this._finish()}T6.prototype._finish=function(){if(yZ0.ok(this instanceof T6),this.realpath){var $=this;this.matches.forEach(function(Y,z){var U=$.matches[z]=Object.create(null);for(var Q in Y)try{Q=$._makeAbs(Q);var J=hW1.realpathSync(Q,$.realpathCache);U[J]=!0}catch(K){if(K.syscall==="stat")U[$._makeAbs(Q)]=!0;else throw K}})}bz.finish(this)};T6.prototype._process=function($,Y,z){yZ0.ok(this instanceof T6);var U=0;while(typeof $[U]==="string")U++;var Q;switch(U){case $.length:this._processSimple($.join("/"),Y);return;case 0:Q=null;break;default:Q=$.slice(0,U).join("/");break}var J=$.slice(U),K;if(Q===null)K=".";else if(UA(Q)||UA($.map(function(W){return typeof W==="string"?W:"[*]"}).join("/"))){if(!Q||!UA(Q))Q="/"+Q;K=Q}else K=Q;var I=this._makeAbs(K);if(gW1(this,K))return;var G=J[0]===gZ0.GLOBSTAR;if(G)this._processGlobStar(Q,K,I,J,Y,z);else this._processReaddir(Q,K,I,J,Y,z)};T6.prototype._processReaddir=function($,Y,z,U,Q,J){var K=this._readdir(z,J);if(!K)return;var I=U[0],G=!!this.minimatch.negate,W=I._glob,H=this.dot||W.charAt(0)===".",X=[];for(var Z=0;Z<K.length;Z++){var q=K[Z];if(q.charAt(0)!=="."||H){var V;if(G&&!$)V=!q.match(I);else V=q.match(I);if(V)X.push(q)}}var F=X.length;if(F===0)return;if(U.length===1&&!this.mark&&!this.stat){if(!this.matches[Q])this.matches[Q]=Object.create(null);for(var Z=0;Z<F;Z++){var q=X[Z];if($)if($.slice(-1)!=="/")q=$+"/"+q;else q=$+q;if(q.charAt(0)==="/"&&!this.nomount)q=hb.join(this.root,q);this._emitMatch(Q,q)}return}U.shift();for(var Z=0;Z<F;Z++){var q=X[Z],w;if($)w=[$,q];else w=[q];this._process(w.concat(U),Q,J)}};T6.prototype._emitMatch=function($,Y){if(yW1(this,Y))return;var z=this._makeAbs(Y);if(this.mark)Y=this._mark(Y);if(this.absolute)Y=z;if(this.matches[$][Y])return;if(this.nodir){var U=this.cache[z];if(U==="DIR"||Array.isArray(U))return}if(this.matches[$][Y]=!0,this.stat)this._stat(Y)};T6.prototype._readdirInGlobStar=function($){if(this.follow)return this._readdir($,!1);var Y,z,U;try{z=this.fs.lstatSync($)}catch(J){if(J.code==="ENOENT")return null}var Q=z&&z.isSymbolicLink();if(this.symlinks[$]=Q,!Q&&z&&!z.isDirectory())this.cache[$]="FILE";else Y=this._readdir($,!1);return Y};T6.prototype._readdir=function($,Y){var z;if(Y&&!Sb(this.symlinks,$))return this._readdirInGlobStar($);if(Sb(this.cache,$)){var U=this.cache[$];if(!U||U==="FILE")return null;if(Array.isArray(U))return U}try{return this._readdirEntries($,this.fs.readdirSync($))}catch(Q){return this._readdirError($,Q),null}};T6.prototype._readdirEntries=function($,Y){if(!this.mark&&!this.stat)for(var z=0;z<Y.length;z++){var U=Y[z];if($==="/")U=$+U;else U=$+"/"+U;this.cache[U]=!0}return this.cache[$]=Y,Y};T6.prototype._readdirError=function($,Y){switch(Y.code){case"ENOTSUP":case"ENOTDIR":var z=this._makeAbs($);if(this.cache[z]="FILE",z===this.cwdAbs){var U=Error(Y.code+" invalid cwd "+this.cwd);throw U.path=this.cwd,U.code=Y.code,U}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs($)]=!1;break;default:if(this.cache[this._makeAbs($)]=!1,this.strict)throw Y;if(!this.silent)console.error("glob error",Y);break}};T6.prototype._processGlobStar=function($,Y,z,U,Q,J){var K=this._readdir(z,J);if(!K)return;var I=U.slice(1),G=$?[$]:[],W=G.concat(I);this._process(W,Q,!1);var H=K.length,X=this.symlinks[z];if(X&&J)return;for(var Z=0;Z<H;Z++){var q=K[Z];if(q.charAt(0)==="."&&!this.dot)continue;var V=G.concat(K[Z],I);this._process(V,Q,!0);var F=G.concat(K[Z],U);this._process(F,Q,!0)}};T6.prototype._processSimple=function($,Y){var z=this._stat($);if(!this.matches[Y])this.matches[Y]=Object.create(null);if(!z)return;if($&&UA($)&&!this.nomount){var U=/[\/\\]$/.test($);if($.charAt(0)==="/")$=hb.join(this.root,$);else if($=hb.resolve(this.root,$),U)$+="/"}if(process.platform==="win32")$=$.replace(/\\/g,"/");this._emitMatch(Y,$)};T6.prototype._stat=function($){var Y=this._makeAbs($),z=$.slice(-1)==="/";if($.length>this.maxLength)return!1;if(!this.stat&&Sb(this.cache,Y)){var K=this.cache[Y];if(Array.isArray(K))K="DIR";if(!z||K==="DIR")return K;if(z&&K==="FILE")return!1}var U,Q=this.statCache[Y];if(!Q){var J;try{J=this.fs.lstatSync(Y)}catch(I){if(I&&(I.code==="ENOENT"||I.code==="ENOTDIR"))return this.statCache[Y]=!1,!1}if(J&&J.isSymbolicLink())try{Q=this.fs.statSync(Y)}catch(I){Q=J}else Q=J}this.statCache[Y]=Q;var K=!0;if(Q)K=Q.isDirectory()?"DIR":"FILE";if(this.cache[Y]=this.cache[Y]||K,z&&K==="FILE")return!1;return K};T6.prototype._mark=function($){return bz.mark(this,$)};T6.prototype._makeAbs=function($){return bz.makeAbs(this,$)}});var gb=E((bs1,bZ0)=>{bZ0.exports=uZ0;function uZ0($,Y){if($&&Y)return uZ0($)(Y);if(typeof $!=="function")throw TypeError("need wrapper function");return Object.keys($).forEach(function(U){z[U]=$[U]}),z;f
Line truncated
|
||||
`);if($.linkname)Y+=hi(" linkpath="+$.linkname+`
|
||||
`);var z=$.pax;if(z)for(var U in z)Y+=hi(" "+U+"="+z[U]+`
|
||||
`);return Buffer.from(Y)};dZ1.decodePax=function($){var Y={};while($.length){var z=0;while(z<$.length&&$[z]!==32)z++;var U=parseInt($.slice(0,z).toString(),10);if(!U)return Y;var Q=$.slice(z+1,U-1).toString(),J=Q.indexOf("=");if(J===-1)return Y;Y[Q.slice(0,J)]=Q.slice(J+1),$=$.slice(U)}return Y};dZ1.encode=function($){var Y=gZ1(512),z=$.name,U="";if($.typeflag===5&&z[z.length-1]!=="/")z+="/";if(Buffer.byteLength(z)!==z.length)return null;while(Buffer.byteLength(z)>100){var Q=z.indexOf("/");if(Q===-1)return null;U+=U?"/"+z.slice(0,Q):z.slice(0,Q),z=z.slice(Q+1)}if(Buffer.byteLength(z)>100||Buffer.byteLength(U)>155)return null;if($.linkname&&Buffer.byteLength($.linkname)>100)return null;if(Y.write(z),Y.write(E2($.mode&bZ1,6),100),Y.write(E2($.uid,6),108),Y.write(E2($.gid,6),116),Y.write(E2($.size,11),124),Y.write(E2($.mtime.getTime()/1000|0,11),136),Y[156]=$L0+nZ1($.type),$.linkname)Y.write($.linkname,157);if(YL0.copy(Y,xX),xZ1.copy(Y,Si),$.uname)Y.write($.uname,265);if($.gname)Y.write($.gname,297);if(Y.write(E2($.devmajor||0,6),329),Y.write(E2($.devminor||0,6),337),U)Y.write(U,345);return Y.write(E2(UL0(Y),6),148),Y};dZ1.decode=function($,Y,z){var U=$[156]===0?0:$[156]-$L0,Q=RK($,0,100,Y),J=C2($,100,8),K=C2($,108,8),I=C2($,116,8),G=C2($,124,12),W=C2($,136,12),H=cZ1(U),X=$[157]===0?null:RK($,157,100,Y),Z=RK($,265,32),q=RK($,297,32),V=C2($,329,8),F=C2($,337,8),w=UL0($);if(w===256)return null;if(w!==C2($,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(YL0.compare($,xX,xX+6)===0){if($[345])Q=RK($,345,155,Y)+"/"+Q}else if(fZ1.compare($,xX,xX+6)===0&&uZ1.compare($,Si,Si+2)===0);else if(!z)throw Error("Invalid tar header: unknown format.");if(U===0&&Q&&Q[Q.length-1]==="/")U=5;return{name:Q,mode:J,uid:K,gid:I,size:G,mtime:new Date(1000*W),type:H,linkname:X,uname:Z,gname:q,devmajor:V,devminor:F}}});var HL0=E((ga1,WL0)=>{var JL0=K0("util"),aZ1=eV0(),fX=gi(),KL0=E8().Writable,IL0=E8().PassThrough,GL0=function(){},QL0=function($){return $&=511,$&&512-$},tZ1=function($,Y){var z=new BA($,Y);return z.end(),z},eZ1=function($,Y){if(Y.path)$.name=Y.path;if(Y.linkpath)$.linkname=Y.linkpath;if(Y.size)$.size=parseInt(Y.size,10);return $.pax=Y,$},BA=function($,Y){this._parent=$,this.offset=Y,IL0.call(this,{autoDestroy:!1})};JL0.inherits(BA,IL0);BA.prototype.destroy=function($){this._parent.destroy($)};var T3=function($){if(!(this instanceof T3))return new T3($);KL0.call(this,$),$=$||{},this._offset=0,this._buffer=aZ1(),this._missing=0,this._partial=!1,this._onparse=GL0,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var Y=this,z=Y._buffer,U=function(){Y._continue()},Q=function(Z){if(Y._locked=!1,Z)return Y.destroy(Z);if(!Y._stream)U()},J=function(){Y._stream=null;var Z=QL0(Y._header.size);if(Z)Y._parse(Z,K);else Y._parse(512,X);if(!Y._locked)U()},K=function(){Y._buffer.consume(QL0(Y._header.size)),Y._parse(512,X),U()},I=function(){var Z=Y._header.size;Y._paxGlobal=fX.decodePax(z.slice(0,Z)),z.consume(Z),J()},G=function(){var Z=Y._header.size;if(Y._pax=fX.decodePax(z.slice(0,Z)),Y._paxGlobal)Y._pax=Object.assign({},Y._paxGlobal,Y._pax);z.consume(Z),J()},W=function(){var Z=Y._header.size;this._gnuLongPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},H=function(){var Z=Y._header.size;this._gnuLongLinkPath=fX.decodeLongPath(z.slice(0,Z),$.filenameEncoding),z.consume(Z),J()},X=function(){var Z=Y._offset,q;try{q=Y._header=fX.decode(z.slice(0,512),$.filenameEncoding,$.allowUnknownFormat)}catch(V){Y.emit("error",V)}if(z.consume(512),!q){Y._parse(512,X),U();return}if(q.type==="gnu-long-path"){Y._parse(q.size,W),U();return}if(q.type==="gnu-long-link-path"){Y._parse(q.size,H),U();return}if(q.type==="pax-global-header"){Y._parse(q.size,I),U();return}if(q.type==="pax-header"){Y._parse(q.size,G),U();return}if(Y._gnuLongPath)q.name=Y._gnuLongPath,Y._gnuLongPath=null;if(Y._gnuLongLinkPath)q.linkname=Y._gnuLongLinkPath,Y._gnuLongLinkPath=null;if(Y._pax)Y._header=q=eZ1(q,Y._pax),Y._pax=null;if(Y._locked=!0,!q.size||q.type==="directory"){Y._parse(512,X),Y.emit("entry",q,tZ1(Y,Z),Q);return}Y._stream=new BA(Y,Z),Y.emit("entry",q,Y._stream,Q),Y._parse(q.size,J),U()};this._onheader=X,this._parse(512,X)};JL0.inherits(T3,KL0);T3.prototype.destroy=function($){if(this._destroyed)return;if(this._destroyed=!0,$)this.emit("error",$);if(this.emit("close"),this._stream)this._stream.emit("close")};T3.prototype._parse=function($,Y){if(this._destroyed)return;if(this._offset+=$,this._missing=$,Y===this._onheader)this._partial=!1;this._onparse=Y};T3.prototype._continue=function(){if(this._destroyed)return;var $=this._cb;if(this._cb=GL0,this._overflow)this._write(this._overflow,void 0,$);else $()};T3.prototype._write=function($,Y,z){if(this._destroyed)return;var U=this._stream,Q=this._buffer,J=this._missing;if($.length)this._partial=!0;if($.length<J)
Line truncated
|
||||
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`)}_writeRelationship($){if(!this.count)this._writeOpen();let Y=`rId${++this.count}`;if($.TargetMode)this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${wq1.xmlEncode($.Target)}" TargetMode="${$.TargetMode}"/>`);else this.stream.write(`<Relationship Id="${Y}" Type="${$.Type}" Target="${$.Target}"/>`);return Y}_writeClose(){this.stream.write("</Relationships>")}}kL0.exports=yL0});var cL0=E((pa1,iL0)=>{var fL0=l6(),uL0=J2(),Nq1=c4(),Dq1=lx(),Aq1=rx();class bL0{constructor($,Y,z){this.id=z.id,this.count=0,this._worksheet=$,this._workbook=z.workbook,this._sheetRelsWriter=Y}get commentsStream(){if(!this._commentsStream)this._commentsStream=this._workbook._openStream(`/xl/comments${this.id}.xml`);return this._commentsStream}get vmlStream(){if(!this._vmlStream)this._vmlStream=this._workbook._openStream(`xl/drawings/vmlDrawing${this.id}.vml`);return this._vmlStream}_addRelationships(){let $={Type:uL0.Comments,Target:`../comments${this.id}.xml`};this._sheetRelsWriter.addRelationship($);let Y={Type:uL0.VmlDrawing,Target:`../drawings/vmlDrawing${this.id}.vml`};this.vmlRelId=this._sheetRelsWriter.addRelationship(Y)}_addCommentRefs(){this._workbook.commentRefs.push({commentName:`comments${this.id}`,vmlDrawing:`vmlDrawing${this.id}`})}_writeOpen(){this.commentsStream.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?><comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><authors><author>Author</author></authors><commentList>'),this.vmlStream.write('<?xml version="1.0" encoding="UTF-8"?><xml xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1" /></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter" /><v:path gradientshapeok="t" o:connecttype="rect" /></v:shapetype>')}_writeComment($,Y){let z=new Dq1,U=new fL0;z.render(U,$),this.commentsStream.write(U.xml);let Q=new Aq1,J=new fL0;Q.render(J,$,Y),this.vmlStream.write(J.xml)}_writeClose(){this.commentsStream.write("</commentList></comments>"),this.vmlStream.write("</xml>")}addComments($){if($&&$.length){if(!this.startedData)this._worksheet.comments=[],this._writeOpen(),this._addRelationships(),this._addCommentRefs(),this.startedData=!0;$.forEach((Y)=>{Y.refAddress=Nq1.decodeAddress(Y.ref)}),$.forEach((Y)=>{this._writeComment(Y,this.count),this.count+=1})}}commit(){if(this.count)this._writeClose(),this.commentsStream.end(),this.vmlStream.end()}}iL0.exports=bL0});var oL0=E((da1,lL0)=>{var Bq1=Y6(),Pq1=J2(),xi=c4(),nL0=Zg(),pL0=z3(),Tq1=jk(),dL0=Cw(),fi=_w(),jq1=xL0(),Eq1=cL0(),Cq1=Hg(),y6=new Tq1,ui=z2(),Rq1=Dx(),_q1=Ax(),vq1=Bx(),hq1=Mx(),Sq1=Lx(),gq1=wx(),yq1=Px(),kq1=Tx(),xq1=jx(),fq1=Ex(),uq1=Cx(),bq1=Rx(),iq1=gx(),cq1=vx(),nq1=_x(),k6={dataValidations:new Rq1,sheetProperties:new _q1,sheetFormatProperties:new vq1,columns:new ui({tag:"cols",length:!1,childXform:new hq1}),row:new Sq1,hyperlinks:new ui({tag:"hyperlinks",length:!1,childXform:new gq1}),sheetViews:new ui({tag:"sheetViews",length:!1,childXform:new yq1}),sheetProtection:new kq1,pageMargins:new xq1,pageSeteup:new fq1,autoFilter:new uq1,picture:new bq1,conditionalFormattings:new iq1,headerFooter:new cq1,rowBreaks:new nq1};class mL0{constructor($){this.id=$.id,this.name=$.name||`Sheet${this.id}`,this.state=$.state||"visible",this._rows=[],this._columns=null,this._keys={},this._merges=[],this._merges.add=function(){},this._sheetRelsWriter=new jq1($),this._sheetCommentsWriter=new Eq1(this,this._sheetRelsWriter,$),this._dimensions=new pL0,this._rowZero=1,this.committed=!1,this.dataValidations=new Cq1,this._formulae={},this._siFormulae=0,this.conditionalFormatting=[],this.rowBreaks=[],this.properties=Object.assign({},{defaultRowHeight:15,dyDescent:55,outlineLevelCol:0,outlineLevelRow:0},$.properties),this.headerFooter=Object.assign({},{differentFirst:!1,differentOddEven:!1,oddHeader:null,oddFooter:null,evenHeader:null,evenFooter:null,firstHeader:null,firstFooter:null},$.headerFooter),this.pageSetup=Object.assign({},{margins:{left:0.7,right:0.7,top:0.75,bottom:0.75,header:0.3,footer:0.3},orientation:"portrait",horizontalDpi:4294967295,verticalDpi:4294967295,fitToPage:!!($.pageSetup&&($.pageSetup.fitToWidth||$.pageSetup.fitToHeight)&&!$.pageSetup.scale),pageOrder:"downThenOver",blackAndWhite:!1,draft:!1,cellComments:"None",errors:"displayed",scale:100,fitToWidth:1,fitToHeight:1,paperSize:void 0,showRowColHeaders:!1,showGridLines:!1,horizontalCentered:!1,verticalCentered:!1,rowBreaks:null,colBreaks:null},$.pageSetup),this.useSharedStrings=$.useSharedStrings||!1,this._workbook=$.workbook,this.hasComments=!1,this._views=$.views||[],this.autoFilter=$.autoFilter||null,this._media=[],this.sheetProtection=null,this._writeOpenWorksheet(),this.startedData=!1}get
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)},zc=Uc.getNativePromise();if(Uc.isNode&&typeof MutationObserver>"u")Qc=global.setImmediate,Jc=process.nextTick,az=Uc.isRecentNode?function($){Qc.call(global,$)}:function($){Jc.call(process,$)};else if(typeof zc==="function"&&typeof zc.resolve==="function")Kc=zc.resolve(),az=function($){Kc.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))az=function(){var $=document.createElement("div"),Y={attributes:!0},z=!1,U=document.createElement("div"),Q=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});Q.observe(U,Y);var J=function(){if(z)return;z=!0,U.classList.toggle("foo")};return function(I){var G=new MutationObserver(function(){G.disconnect(),I()});G.observe($,Y),J()}}();else if(typeof setImmediate<"u")az=function($){setImmediate($)};else if(typeof setTimeout<"u")az=function($){setTimeout($,0)};else az=PV1;var Qc,Jc,Kc;PF0.exports=az});var EF0=E((na1,jF0)=>{function TV1($,Y,z,U,Q){for(var J=0;J<Q;++J)z[J+U]=$[J+Y],$[J+Y]=void 0}function _2($){this._capacity=$,this._length=0,this._front=0}_2.prototype._willBeOverCapacity=function($){return this._capacity<$};_2.prototype._pushOne=function($){var Y=this.length();this._checkCapacity(Y+1);var z=this._front+Y&this._capacity-1;this[z]=$,this._length=Y+1};_2.prototype.push=function($,Y,z){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(Y),this._pushOne(z);return}var Q=this._front+U-3;this._checkCapacity(U);var J=this._capacity-1;this[Q+0&J]=$,this[Q+1&J]=Y,this[Q+2&J]=z,this._length=U};_2.prototype.shift=function(){var $=this._front,Y=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,Y};_2.prototype.length=function(){return this._length};_2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};_2.prototype._resizeTo=function($){var Y=this._capacity;this._capacity=$;var z=this._front,U=this._length,Q=z+U&Y-1;TV1(this,0,this,Y,Q)};jF0.exports=_2});var gF0=E((pa1,Ic)=>{var hF0;try{throw Error()}catch($){hF0=$}var jV1=TF0(),CF0=EF0(),SF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new CF0(16),this._normalQueue=new CF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=jV1}x6.prototype.setScheduler=function($){var Y=this._schedule;return this._schedule=$,this._customScheduler=!0,Y};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(SF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,Y){if(Y)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
|
||||
`)},Uc=Qc.getNativePromise();if(Qc.isNode&&typeof MutationObserver>"u")Jc=global.setImmediate,Kc=process.nextTick,tz=Qc.isRecentNode?function($){Jc.call(global,$)}:function($){Kc.call(process,$)};else if(typeof Uc==="function"&&typeof Uc.resolve==="function")Ic=Uc.resolve(),tz=function($){Ic.then($)};else if(typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova)))tz=function(){var $=document.createElement("div"),Y={attributes:!0},z=!1,U=document.createElement("div"),Q=new MutationObserver(function(){$.classList.toggle("foo"),z=!1});Q.observe(U,Y);var J=function(){if(z)return;z=!0,U.classList.toggle("foo")};return function(I){var G=new MutationObserver(function(){G.disconnect(),I()});G.observe($,Y),J()}}();else if(typeof setImmediate<"u")tz=function($){setImmediate($)};else if(typeof setTimeout<"u")tz=function($){setTimeout($,0)};else tz=gV1;var Jc,Kc,Ic;EF0.exports=tz});var _F0=E((Ut1,RF0)=>{function yV1($,Y,z,U,Q){for(var J=0;J<Q;++J)z[J+U]=$[J+Y],$[J+Y]=void 0}function v2($){this._capacity=$,this._length=0,this._front=0}v2.prototype._willBeOverCapacity=function($){return this._capacity<$};v2.prototype._pushOne=function($){var Y=this.length();this._checkCapacity(Y+1);var z=this._front+Y&this._capacity-1;this[z]=$,this._length=Y+1};v2.prototype.push=function($,Y,z){var U=this.length()+3;if(this._willBeOverCapacity(U)){this._pushOne($),this._pushOne(Y),this._pushOne(z);return}var Q=this._front+U-3;this._checkCapacity(U);var J=this._capacity-1;this[Q+0&J]=$,this[Q+1&J]=Y,this[Q+2&J]=z,this._length=U};v2.prototype.shift=function(){var $=this._front,Y=this[$];return this[$]=void 0,this._front=$+1&this._capacity-1,this._length--,Y};v2.prototype.length=function(){return this._length};v2.prototype._checkCapacity=function($){if(this._capacity<$)this._resizeTo(this._capacity<<1)};v2.prototype._resizeTo=function($){var Y=this._capacity;this._capacity=$;var z=this._front,U=this._length,Q=z+U&Y-1;yV1(this,0,this,Y,Q)};RF0.exports=v2});var xF0=E((Qt1,Gc)=>{var yF0;try{throw Error()}catch($){yF0=$}var kV1=CF0(),vF0=_F0(),kF0=F4();function x6(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new vF0(16),this._normalQueue=new vF0(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var $=this;this.drainQueues=function(){$._drainQueues()},this._schedule=kV1}x6.prototype.setScheduler=function($){var Y=this._schedule;return this._schedule=$,this._customScheduler=!0,Y};x6.prototype.hasCustomScheduler=function(){return this._customScheduler};x6.prototype.enableTrampoline=function(){this._trampolineEnabled=!0};x6.prototype.disableTrampolineIfNecessary=function(){if(kF0.hasDevTools)this._trampolineEnabled=!1};x6.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues};x6.prototype.fatalError=function($,Y){if(Y)process.stderr.write("Fatal "+($ instanceof Error?$.stack:$)+`
|
||||
`),process.exit(2);else this.throwLater($)};x6.prototype.throwLater=function($,Y){if(arguments.length===1)Y=$,$=function(){throw Y};if(typeof setTimeout<"u")setTimeout(function(){$(Y)},0);else try{this._schedule(function(){$(Y)})}catch(z){throw Error(`No async scheduler available
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)}};function RF0($,Y,z){this._lateQueue.push($,Y,z),this._queueTick()}function _F0($,Y,z){this._normalQueue.push($,Y,z),this._queueTick()}function vF0($){this._normalQueue._pushOne($),this._queueTick()}if(!SF0.hasDevTools)x6.prototype.invokeLater=RF0,x6.prototype.invoke=_F0,x6.prototype.settlePromises=vF0;else x6.prototype.invokeLater=function($,Y,z){if(this._trampolineEnabled)RF0.call(this,$,Y,z);else this._schedule(function(){setTimeout(function(){$.call(Y,z)},100)})},x6.prototype.invoke=function($,Y,z){if(this._trampolineEnabled)_F0.call(this,$,Y,z);else this._schedule(function(){$.call(Y,z)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)vF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var Y=$.shift();if(typeof Y!=="function"){Y._settlePromises();continue}var z=$.shift(),U=$.shift();Y.call(z,U)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};Ic.exports=x6;Ic.exports.firstLineError=hF0});var E3=E((da1,xF0)=>{var Hc=sz(),EV1=Hc.freeze,yF0=F4(),kF0=yF0.inherits,SK=yF0.notEnumerableProp;function gK($,Y){function z(U){if(!(this instanceof z))return new z(U);if(SK(this,"message",typeof U==="string"?U:Y),SK(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return kF0(z,Error),z}var Gc,Wc,CV1=gK("Warning","warning"),RV1=gK("CancellationError","cancellation error"),_V1=gK("TimeoutError","timeout error"),pX=gK("AggregateError","aggregate error");try{Gc=TypeError,Wc=RangeError}catch($){Gc=gK("TypeError","type error"),Wc=gK("RangeError","range error")}var vA="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(tz=0;tz<vA.length;++tz)if(typeof Array.prototype[vA[tz]]==="function")pX.prototype[vA[tz]]=Array.prototype[vA[tz]];var tz;Hc.defineProperty(pX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});pX.prototype.isOperational=!0;var hA=0;pX.prototype.toString=function(){var $=Array(hA*4+1).join(" "),Y=`
|
||||
`)}};function hF0($,Y,z){this._lateQueue.push($,Y,z),this._queueTick()}function SF0($,Y,z){this._normalQueue.push($,Y,z),this._queueTick()}function gF0($){this._normalQueue._pushOne($),this._queueTick()}if(!kF0.hasDevTools)x6.prototype.invokeLater=hF0,x6.prototype.invoke=SF0,x6.prototype.settlePromises=gF0;else x6.prototype.invokeLater=function($,Y,z){if(this._trampolineEnabled)hF0.call(this,$,Y,z);else this._schedule(function(){setTimeout(function(){$.call(Y,z)},100)})},x6.prototype.invoke=function($,Y,z){if(this._trampolineEnabled)SF0.call(this,$,Y,z);else this._schedule(function(){$.call(Y,z)})},x6.prototype.settlePromises=function($){if(this._trampolineEnabled)gF0.call(this,$);else this._schedule(function(){$._settlePromises()})};x6.prototype._drainQueue=function($){while($.length()>0){var Y=$.shift();if(typeof Y!=="function"){Y._settlePromises();continue}var z=$.shift(),U=$.shift();Y.call(z,U)}};x6.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)};x6.prototype._queueTick=function(){if(!this._isTickUsed)this._isTickUsed=!0,this._schedule(this.drainQueues)};x6.prototype._reset=function(){this._isTickUsed=!1};Gc.exports=x6;Gc.exports.firstLineError=yF0});var E3=E((Jt1,bF0)=>{var Xc=az(),xV1=Xc.freeze,fF0=F4(),uF0=fF0.inherits,gK=fF0.notEnumerableProp;function yK($,Y){function z(U){if(!(this instanceof z))return new z(U);if(gK(this,"message",typeof U==="string"?U:Y),gK(this,"name",$),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else Error.call(this)}return uF0(z,Error),z}var Wc,Hc,fV1=yK("Warning","warning"),uV1=yK("CancellationError","cancellation error"),bV1=yK("TimeoutError","timeout error"),pX=yK("AggregateError","aggregate error");try{Wc=TypeError,Hc=RangeError}catch($){Wc=yK("TypeError","type error"),Hc=yK("RangeError","range error")}var hA="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" ");for(ez=0;ez<hA.length;++ez)if(typeof Array.prototype[hA[ez]]==="function")pX.prototype[hA[ez]]=Array.prototype[hA[ez]];var ez;Xc.defineProperty(pX.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0});pX.prototype.isOperational=!0;var SA=0;pX.prototype.toString=function(){var $=Array(SA*4+1).join(" "),Y=`
|
||||
`+$+`AggregateError of:
|
||||
`;hA++,$=Array(hA*4+1).join(" ");for(var z=0;z<this.length;++z){var U=this[z]===this?"[Circular AggregateError]":this[z]+"",Q=U.split(`
|
||||
`;SA++,$=Array(SA*4+1).join(" ");for(var z=0;z<this.length;++z){var U=this[z]===this?"[Circular AggregateError]":this[z]+"",Q=U.split(`
|
||||
`);for(var J=0;J<Q.length;++J)Q[J]=$+Q[J];U=Q.join(`
|
||||
`),Y+=U+`
|
||||
`}return hA--,Y};function nX($){if(!(this instanceof nX))return new nX($);if(SK(this,"name","OperationalError"),SK(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)SK(this,"message",$.message),SK(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}kF0(nX,Error);var ez=Error.__BluebirdErrorTypes__;if(!ez)ez=EV1({CancellationError:RV1,TimeoutError:_V1,OperationalError:nX,RejectionError:nX,AggregateError:pX}),Hc.defineProperty(Error,"__BluebirdErrorTypes__",{value:ez,writable:!1,enumerable:!1,configurable:!1});xF0.exports={Error,TypeError:Gc,RangeError:Wc,CancellationError:ez.CancellationError,OperationalError:ez.OperationalError,TimeoutError:ez.TimeoutError,AggregateError:ez.AggregateError,Warning:CV1}});var uF0=E((ma1,fF0)=>{fF0.exports=function($,Y){var z=F4(),U=z.errorObj,Q=z.isObject;function J(X,Z){if(Q(X)){if(X instanceof $)return X;var q=I(X);if(q===U){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(W(X)){var V=new $(Y);return X._then(V._fulfill,V._reject,void 0,V,null),V}return H(X,q,Z)}}return X}function K(X){return X.then}function I(X){try{return K(X)}catch(Z){return U.e=Z,U}}var G={}.hasOwnProperty;function W(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function H(X,Z,q){var V=new $(Y),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var M=!0,w=z.tryCatch(Z).call(X,N,O);if(M=!1,V&&w===U)V._rejectCallback(w.e,!0,!0),V=null;function N(D){if(!V)return;V._resolveCallback(D),V=null}function O(D){if(!V)return;V._rejectCallback(D,M,!0),V=null}return F}return J}});var iF0=E((la1,bF0)=>{bF0.exports=function($,Y,z,U,Q){var J=F4(),K=J.isArray;function I(W){switch(W){case-2:return[];case-3:return{}}}function G(W){var H=this._promise=new $(Y);if(W instanceof $)H._propagateFrom(W,3);H._setOnCancel(this),this._values=W,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(G,Q),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function W(H,X){var Z=z(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(W,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=J.asArray(Z),Z===null){var V=U("expecting an array or an iterable object but got "+J.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(I(X));return}this._iterate(Z)},G.prototype._iterate=function(W){var H=this.getActualLength(W.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<H;++V){var F=z(W[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(W){this._values=null,this._promise._fulfill(W)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(W){this._values=null,this._promise._rejectCallback(W,!1)},G.prototype._promiseFulfilled=function(W,H){this._values[H]=W;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(W){return this._totalResolved++,this._reject(W),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var W=this._values;if(this._cancel(),W instanceof $)W.cancel();else for(var H=0;H<W.length;++H)if(W[H]instanceof $)W[H].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(W){return W},G}});var nF0=E((oa1,cF0)=>{cF0.exports=function($){var Y=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(J())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var K=z.pop(),I=K._promiseCreated;return K._promiseCreated=null,I}return null};function Q(){if(Y)return new U}function J(){var K=z.length-1;if(K>=0)return z[K];return}return U.CapturedTrace=null,U.create=Q,U.deactivateLong
Line truncated
|
||||
`}return SA--,Y};function nX($){if(!(this instanceof nX))return new nX($);if(gK(this,"name","OperationalError"),gK(this,"message",$),this.cause=$,this.isOperational=!0,$ instanceof Error)gK(this,"message",$.message),gK(this,"stack",$.stack);else if(Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}uF0(nX,Error);var $U=Error.__BluebirdErrorTypes__;if(!$U)$U=xV1({CancellationError:uV1,TimeoutError:bV1,OperationalError:nX,RejectionError:nX,AggregateError:pX}),Xc.defineProperty(Error,"__BluebirdErrorTypes__",{value:$U,writable:!1,enumerable:!1,configurable:!1});bF0.exports={Error,TypeError:Wc,RangeError:Hc,CancellationError:$U.CancellationError,OperationalError:$U.OperationalError,TimeoutError:$U.TimeoutError,AggregateError:$U.AggregateError,Warning:fV1}});var cF0=E((Kt1,iF0)=>{iF0.exports=function($,Y){var z=F4(),U=z.errorObj,Q=z.isObject;function J(X,Z){if(Q(X)){if(X instanceof $)return X;var q=I(X);if(q===U){if(Z)Z._pushContext();var V=$.reject(q.e);if(Z)Z._popContext();return V}else if(typeof q==="function"){if(W(X)){var V=new $(Y);return X._then(V._fulfill,V._reject,void 0,V,null),V}return H(X,q,Z)}}return X}function K(X){return X.then}function I(X){try{return K(X)}catch(Z){return U.e=Z,U}}var G={}.hasOwnProperty;function W(X){try{return G.call(X,"_promise0")}catch(Z){return!1}}function H(X,Z,q){var V=new $(Y),F=V;if(q)q._pushContext();if(V._captureStackTrace(),q)q._popContext();var w=!0,M=z.tryCatch(Z).call(X,O,N);if(w=!1,V&&M===U)V._rejectCallback(M.e,!0,!0),V=null;function O(D){if(!V)return;V._resolveCallback(D),V=null}function N(D){if(!V)return;V._rejectCallback(D,w,!0),V=null}return F}return J}});var pF0=E((It1,nF0)=>{nF0.exports=function($,Y,z,U,Q){var J=F4(),K=J.isArray;function I(W){switch(W){case-2:return[];case-3:return{}}}function G(W){var H=this._promise=new $(Y);if(W instanceof $)H._propagateFrom(W,3);H._setOnCancel(this),this._values=W,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return J.inherits(G,Q),G.prototype.length=function(){return this._length},G.prototype.promise=function(){return this._promise},G.prototype._init=function W(H,X){var Z=z(this._values,this._promise);if(Z instanceof $){Z=Z._target();var q=Z._bitField;if(this._values=Z,(q&50397184)===0)return this._promise._setAsyncGuaranteed(),Z._then(W,this._reject,void 0,this,X);else if((q&33554432)!==0)Z=Z._value();else if((q&16777216)!==0)return this._reject(Z._reason());else return this._cancel()}if(Z=J.asArray(Z),Z===null){var V=U("expecting an array or an iterable object but got "+J.classString(Z)).reason();this._promise._rejectCallback(V,!1);return}if(Z.length===0){if(X===-5)this._resolveEmptyArray();else this._resolve(I(X));return}this._iterate(Z)},G.prototype._iterate=function(W){var H=this.getActualLength(W.length);this._length=H,this._values=this.shouldCopyValues()?Array(H):this._values;var X=this._promise,Z=!1,q=null;for(var V=0;V<H;++V){var F=z(W[V],X);if(F instanceof $)F=F._target(),q=F._bitField;else q=null;if(Z){if(q!==null)F.suppressUnhandledRejections()}else if(q!==null)if((q&50397184)===0)F._proxy(this,V),this._values[V]=F;else if((q&33554432)!==0)Z=this._promiseFulfilled(F._value(),V);else if((q&16777216)!==0)Z=this._promiseRejected(F._reason(),V);else Z=this._promiseCancelled(V);else Z=this._promiseFulfilled(F,V)}if(!Z)X._setAsyncGuaranteed()},G.prototype._isResolved=function(){return this._values===null},G.prototype._resolve=function(W){this._values=null,this._promise._fulfill(W)},G.prototype._cancel=function(){if(this._isResolved()||!this._promise._isCancellable())return;this._values=null,this._promise._cancel()},G.prototype._reject=function(W){this._values=null,this._promise._rejectCallback(W,!1)},G.prototype._promiseFulfilled=function(W,H){this._values[H]=W;var X=++this._totalResolved;if(X>=this._length)return this._resolve(this._values),!0;return!1},G.prototype._promiseCancelled=function(){return this._cancel(),!0},G.prototype._promiseRejected=function(W){return this._totalResolved++,this._reject(W),!0},G.prototype._resultCancelled=function(){if(this._isResolved())return;var W=this._values;if(this._cancel(),W instanceof $)W.cancel();else for(var H=0;H<W.length;++H)if(W[H]instanceof $)W[H].cancel()},G.prototype.shouldCopyValues=function(){return!0},G.prototype.getActualLength=function(W){return W},G}});var mF0=E((Gt1,dF0)=>{dF0.exports=function($){var Y=!1,z=[];$.prototype._promiseCreated=function(){},$.prototype._pushContext=function(){},$.prototype._popContext=function(){return null},$._peekContext=$.prototype._peekContext=function(){};function U(){this._trace=new U.CapturedTrace(J())}U.prototype._pushContext=function(){if(this._trace!==void 0)this._trace._promiseCreated=null,z.push(this._trace)},U.prototype._popContext=function(){if(this._trace!==void 0){var K=z.pop(),I=K._promiseCreated;return K._promiseCreated=null,I}return null};function Q(){if(Y)return new U}function J(){var K=z.length-1;if(K>=0)return z[K];return}return U.CapturedTrace=null,U.create=Q,U.deactivateLong
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);if(!A0.longStackTraces&&u0()){var Q0=$.prototype._captureStackTrace,B=$.prototype._attachExtraTrace;A0.longStackTraces=!0,D=function(){if(U.haveItemsQueued()&&!A0.longStackTraces)throw Error(`cannot enable long stack traces after promises have been created
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);$.prototype._captureStackTrace=Q0,$.prototype._attachExtraTrace=B,Y.deactivateLongStackTraces(),U.enableTrampoline(),A0.longStackTraces=!1},$.prototype._captureStackTrace=g,$.prototype._attachExtraTrace=p,Y.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return A0.longStackTraces&&u0()};var P=function(){try{if(typeof CustomEvent==="function"){var Q0=new CustomEvent("CustomEvent");return J.global.dispatchEvent(Q0),function(B,v){var u=new CustomEvent(B.toLowerCase(),{detail:v,cancelable:!0});return!J.global.dispatchEvent(u)}}else if(typeof Event==="function"){var Q0=new Event("CustomEvent");return J.global.dispatchEvent(Q0),function(v,u){var r=new Event(v.toLowerCase(),{cancelable:!0});return r.detail=u,!J.global.dispatchEvent(r)}}else{var Q0=document.createEvent("CustomEvent");return Q0.initCustomEvent("testingtheevent",!1,!0,{}),J.global.dispatchEvent(Q0),function(v,u){var r=document.createEvent("CustomEvent");return r.initCustomEvent(v.toLowerCase(),!1,!0,u),!J.global.dispatchEvent(r)}}}catch(B){}return function(){return!1}}(),T=function(){if(J.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!J.global)return function(){return!1};return function(Q0){var B="on"+Q0.toLowerCase(),v=J.global[B];if(!v)return!1;return v.apply(J.global,[].slice.call(arguments,1)),!0}}}();function A(Q0,B){return{promise:B}}var j={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(Q0,B,v){return{promise:B,child:v}},warning:function(Q0,B){return{warning:B}},unhandledRejection:function(Q0,B,v){return{reason:B,promise:v}},rejectionHandled:A},C=function(Q0){var B=!1;try{B=T.apply(null,arguments)}catch(u){U.throwLater(u),B=!0}var v=!1;try{v=P(Q0,j[Q0].apply(null,arguments))}catch(u){U.throwLater(u),v=!0}return v||B};$.config=function(Q0){if(Q0=Object(Q0),"longStackTraces"in Q0){if(Q0.longStackTraces)$.longStackTraces();else if(!Q0.longStackTraces&&$.hasLongStackTraces())D()}if("warnings"in Q0){var B=Q0.warnings;if(A0.warnings=!!B,O=A0.warnings,J.isObject(B)){if("wForgottenReturn"in B)O=!!B.wForgottenReturn}}if("cancellation"in Q0&&Q0.cancellation&&!A0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=U0,$.prototype._propagateFrom=k,$.prototype._onCancel=i,$.prototype._setOnCancel=c,$.prototype._attachCancellationCallback=S,$.prototype._execute=x,t=k,A0.cancellation=!0}if("monitoring"in Q0){if(Q0.monitoring&&!A0.monitoring)A0.monitoring=!0,$.prototype._fireEvent=C;else if(!Q0.monitoring&&A0.monitoring)A0.monitoring=!1,$.prototype._fireEvent=b}return $};function b(){return!1}$.prototype._fireEvent=b,$.prototype._execute=function(Q0,B,v){try{Q0(B,v)}catch(u){return u}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(Q0){},$.prototype._attachCancellationCallback=function(Q0){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(Q0,B){};function x(Q0,B,v){var u=this;try{Q0(B,v,function(r){if(typeof r!=="function")throw TypeError("onCancel must be a function, got: "+J.toString(r));u._attachCancellationCallback(r)})}catch(r){return r}}function S(Q0){if(!this._isCancellable())return this;var B=this._onCancel();if(B!==void 0)if(J.isArray(B))B.push(Q0);else this._setOnCancel([B,Q0]);else this._setOnCancel(Q0)}function i(){return this._onCancelField}function c(Q0){this._onCancelField=Q0}function U0(){this._cancellationParent=void 0,this._onCancelField=void 0}function k(Q0,B){if((B&1)!==0){this._cancellationParent=Q0;var v=Q0._branchesRemainingToCancel;if(v===void 0)v=0;Q0._branchesRemainingToCancel=v+1}if((B&2)!==0&&Q0._isBound())this._setBoundTo(Q0._boundTo)}function d(Q0,B){if((B&2)!==0&&Q0._isBound())this._setBoundTo(Q0._boundTo)}var t=d;function $0(){var Q0=this._boundTo;if(Q0!==void 0){if(Q0 instanceof $)if(Q0.isFulfilled())return Q0.value();else return}return Q0}function g(){this._trace=new u1(this._peekContext())}function p(Q0,B){if(K(Q0)){var v=this._trace;if(v!==void 0){if(B)v=v._parent}if(v!==void 0)v.attachExtraTrace(Q0);else if(!Q0.__stackCleaned__){var u=i0(Q0);J.notEnumerableProp(Q0,"stack",u.message+`
|
||||
`);$.prototype._captureStackTrace=Q0,$.prototype._attachExtraTrace=B,Y.deactivateLongStackTraces(),U.enableTrampoline(),A0.longStackTraces=!1},$.prototype._captureStackTrace=g,$.prototype._attachExtraTrace=p,Y.activateLongStackTraces(),U.disableTrampolineIfNecessary()}},$.hasLongStackTraces=function(){return A0.longStackTraces&&u0()};var P=function(){try{if(typeof CustomEvent==="function"){var Q0=new CustomEvent("CustomEvent");return J.global.dispatchEvent(Q0),function(B,v){var u=new CustomEvent(B.toLowerCase(),{detail:v,cancelable:!0});return!J.global.dispatchEvent(u)}}else if(typeof Event==="function"){var Q0=new Event("CustomEvent");return J.global.dispatchEvent(Q0),function(v,u){var r=new Event(v.toLowerCase(),{cancelable:!0});return r.detail=u,!J.global.dispatchEvent(r)}}else{var Q0=document.createEvent("CustomEvent");return Q0.initCustomEvent("testingtheevent",!1,!0,{}),J.global.dispatchEvent(Q0),function(v,u){var r=document.createEvent("CustomEvent");return r.initCustomEvent(v.toLowerCase(),!1,!0,u),!J.global.dispatchEvent(r)}}}catch(B){}return function(){return!1}}(),T=function(){if(J.isNode)return function(){return process.emit.apply(process,arguments)};else{if(!J.global)return function(){return!1};return function(Q0){var B="on"+Q0.toLowerCase(),v=J.global[B];if(!v)return!1;return v.apply(J.global,[].slice.call(arguments,1)),!0}}}();function A(Q0,B){return{promise:B}}var j={promiseCreated:A,promiseFulfilled:A,promiseRejected:A,promiseResolved:A,promiseCancelled:A,promiseChained:function(Q0,B,v){return{promise:B,child:v}},warning:function(Q0,B){return{warning:B}},unhandledRejection:function(Q0,B,v){return{reason:B,promise:v}},rejectionHandled:A},C=function(Q0){var B=!1;try{B=T.apply(null,arguments)}catch(u){U.throwLater(u),B=!0}var v=!1;try{v=P(Q0,j[Q0].apply(null,arguments))}catch(u){U.throwLater(u),v=!0}return v||B};$.config=function(Q0){if(Q0=Object(Q0),"longStackTraces"in Q0){if(Q0.longStackTraces)$.longStackTraces();else if(!Q0.longStackTraces&&$.hasLongStackTraces())D()}if("warnings"in Q0){var B=Q0.warnings;if(A0.warnings=!!B,N=A0.warnings,J.isObject(B)){if("wForgottenReturn"in B)N=!!B.wForgottenReturn}}if("cancellation"in Q0&&Q0.cancellation&&!A0.cancellation){if(U.haveItemsQueued())throw Error("cannot enable cancellation after promises are in use");$.prototype._clearCancellationData=U0,$.prototype._propagateFrom=k,$.prototype._onCancel=i,$.prototype._setOnCancel=c,$.prototype._attachCancellationCallback=S,$.prototype._execute=x,t=k,A0.cancellation=!0}if("monitoring"in Q0){if(Q0.monitoring&&!A0.monitoring)A0.monitoring=!0,$.prototype._fireEvent=C;else if(!Q0.monitoring&&A0.monitoring)A0.monitoring=!1,$.prototype._fireEvent=b}return $};function b(){return!1}$.prototype._fireEvent=b,$.prototype._execute=function(Q0,B,v){try{Q0(B,v)}catch(u){return u}},$.prototype._onCancel=function(){},$.prototype._setOnCancel=function(Q0){},$.prototype._attachCancellationCallback=function(Q0){},$.prototype._captureStackTrace=function(){},$.prototype._attachExtraTrace=function(){},$.prototype._clearCancellationData=function(){},$.prototype._propagateFrom=function(Q0,B){};function x(Q0,B,v){var u=this;try{Q0(B,v,function(r){if(typeof r!=="function")throw TypeError("onCancel must be a function, got: "+J.toString(r));u._attachCancellationCallback(r)})}catch(r){return r}}function S(Q0){if(!this._isCancellable())return this;var B=this._onCancel();if(B!==void 0)if(J.isArray(B))B.push(Q0);else this._setOnCancel([B,Q0]);else this._setOnCancel(Q0)}function i(){return this._onCancelField}function c(Q0){this._onCancelField=Q0}function U0(){this._cancellationParent=void 0,this._onCancelField=void 0}function k(Q0,B){if((B&1)!==0){this._cancellationParent=Q0;var v=Q0._branchesRemainingToCancel;if(v===void 0)v=0;Q0._branchesRemainingToCancel=v+1}if((B&2)!==0&&Q0._isBound())this._setBoundTo(Q0._boundTo)}function d(Q0,B){if((B&2)!==0&&Q0._isBound())this._setBoundTo(Q0._boundTo)}var t=d;function $0(){var Q0=this._boundTo;if(Q0!==void 0){if(Q0 instanceof $)if(Q0.isFulfilled())return Q0.value();else return}return Q0}function g(){this._trace=new u1(this._peekContext())}function p(Q0,B){if(K(Q0)){var v=this._trace;if(v!==void 0){if(B)v=v._parent}if(v!==void 0)v.attachExtraTrace(Q0);else if(!Q0.__stackCleaned__){var u=i0(Q0);J.notEnumerableProp(Q0,"stack",u.message+`
|
||||
`+u.stack.join(`
|
||||
`)),J.notEnumerableProp(Q0,"__stackCleaned__",!0)}}}function e(Q0,B,v,u,r){if(Q0===void 0&&B!==null&&O){if(r!==void 0&&r._returnedNonUndefined())return;if((u._bitField&65535)===0)return;if(v)v=v+" ";var X0="",J0="";if(B._trace){var q0=B._trace.stack.split(`
|
||||
`),M0=G0(q0);for(var B0=M0.length-1;B0>=0;--B0){var r0=M0[B0];if(!H.test(r0)){var K1=r0.match(X);if(K1)X0="at "+K1[1]+":"+K1[2]+":"+K1[3]+" ";break}}if(M0.length>0){var U1=M0[0];for(var B0=0;B0<q0.length;++B0)if(q0[B0]===U1){if(B0>0)J0=`
|
||||
`)),J.notEnumerableProp(Q0,"__stackCleaned__",!0)}}}function e(Q0,B,v,u,r){if(Q0===void 0&&B!==null&&N){if(r!==void 0&&r._returnedNonUndefined())return;if((u._bitField&65535)===0)return;if(v)v=v+" ";var X0="",J0="";if(B._trace){var q0=B._trace.stack.split(`
|
||||
`),w0=G0(q0);for(var B0=w0.length-1;B0>=0;--B0){var r0=w0[B0];if(!H.test(r0)){var K1=r0.match(X);if(K1)X0="at "+K1[1]+":"+K1[2]+":"+K1[3]+" ";break}}if(w0.length>0){var U1=w0[0];for(var B0=0;B0<q0.length;++B0)if(q0[B0]===U1){if(B0>0)J0=`
|
||||
`+q0[B0-1];break}}}var D1="a promise was created in a "+v+"handler "+X0+"but was not returned from it, see http://goo.gl/rRqMUw"+J0;u._warn(D1,!0,B)}}function y(Q0,B){var v=Q0+" is deprecated and will be removed in a future version.";if(B)v+=" Use "+B+" instead.";return s(v)}function s(Q0,B,v){if(!A0.warnings)return;var u=new Q(Q0),r;if(B)v._attachExtraTrace(u);else if(A0.longStackTraces&&(r=$._peekContext()))r.attachExtraTrace(u);else{var X0=i0(u);u.stack=X0.message+`
|
||||
`+X0.stack.join(`
|
||||
`)}if(!C("warning",u))Y1(u,"",!0)}function Y0(Q0,B){for(var v=0;v<B.length-1;++v)B[v].push("From previous event:"),B[v]=B[v].join(`
|
||||
`);if(v<B.length)B[v]=B[v].join(`
|
||||
`);return Q0+`
|
||||
`+B.join(`
|
||||
`)}function N0(Q0){for(var B=0;B<Q0.length;++B)if(Q0[B].length===0||B+1<Q0.length&&Q0[B][0]===Q0[B+1][0])Q0.splice(B,1),B--}function E0(Q0){var B=Q0[0];for(var v=1;v<Q0.length;++v){var u=Q0[v],r=B.length-1,X0=B[r],J0=-1;for(var q0=u.length-1;q0>=0;--q0)if(u[q0]===X0){J0=q0;break}for(var q0=J0;q0>=0;--q0){var M0=u[q0];if(B[r]===M0)B.pop(),r--;else break}B=u}}function G0(Q0){var B=[];for(var v=0;v<Q0.length;++v){var u=Q0[v],r=u===" (No stack trace)"||Z.test(u),X0=r&&b0(u);if(r&&!X0){if(V&&u.charAt(0)!==" ")u=" "+u;B.push(u)}}return B}function T0(Q0){var B=Q0.stack.replace(/\s+$/g,"").split(`
|
||||
`)}function N0(Q0){for(var B=0;B<Q0.length;++B)if(Q0[B].length===0||B+1<Q0.length&&Q0[B][0]===Q0[B+1][0])Q0.splice(B,1),B--}function E0(Q0){var B=Q0[0];for(var v=1;v<Q0.length;++v){var u=Q0[v],r=B.length-1,X0=B[r],J0=-1;for(var q0=u.length-1;q0>=0;--q0)if(u[q0]===X0){J0=q0;break}for(var q0=J0;q0>=0;--q0){var w0=u[q0];if(B[r]===w0)B.pop(),r--;else break}B=u}}function G0(Q0){var B=[];for(var v=0;v<Q0.length;++v){var u=Q0[v],r=u===" (No stack trace)"||Z.test(u),X0=r&&b0(u);if(r&&!X0){if(V&&u.charAt(0)!==" ")u=" "+u;B.push(u)}}return B}function T0(Q0){var B=Q0.stack.replace(/\s+$/g,"").split(`
|
||||
`);for(var v=0;v<B.length;++v){var u=B[v];if(u===" (No stack trace)"||Z.test(u))break}if(v>0&&Q0.name!="SyntaxError")B=B.slice(v);return B}function i0(Q0){var B=Q0.stack,v=Q0.toString();return B=typeof B==="string"&&B.length>0?T0(Q0):[" (No stack trace)"],{message:v,stack:Q0.name=="SyntaxError"?B:G0(B)}}function Y1(Q0,B,v){if(typeof console<"u"){var u;if(J.isObject(Q0)){var r=Q0.stack;u=B+q(r,Q0)}else u=B+String(Q0);if(typeof F==="function")F(u,v);else if(typeof console.log==="function"||typeof console.log==="object")console.log(u)}}function a(Q0,B,v,u){var r=!1;try{if(typeof B==="function")if(r=!0,Q0==="rejectionHandled")B(u);else B(v,u)}catch(X0){U.throwLater(X0)}if(Q0==="unhandledRejection"){if(!C(Q0,v,u)&&!r)Y1(v,"Unhandled rejection ")}else C(Q0,u)}function H0(Q0){var B;if(typeof Q0==="function")B="[function "+(Q0.name||"anonymous")+"]";else{B=Q0&&typeof Q0.toString==="function"?Q0.toString():J.toString(Q0);var v=/\[object [a-zA-Z0-9$_]+\]/;if(v.test(B))try{var u=JSON.stringify(Q0);B=u}catch(r){}if(B.length===0)B="(empty array)"}return"(<"+F0(B)+">, no stack trace)"}function F0(Q0){var B=41;if(Q0.length<B)return Q0;return Q0.substr(0,B-3)+"..."}function u0(){return typeof b1==="function"}var b0=function(){return!1},c0=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function A1(Q0){var B=Q0.match(c0);if(B)return{fileName:B[1],line:parseInt(B[2],10)}}function k1(Q0,B){if(!u0())return;var v=Q0.stack.split(`
|
||||
`),u=B.stack.split(`
|
||||
`),r=-1,X0=-1,J0,q0;for(var M0=0;M0<v.length;++M0){var B0=A1(v[M0]);if(B0){J0=B0.fileName,r=B0.line;break}}for(var M0=0;M0<u.length;++M0){var B0=A1(u[M0]);if(B0){q0=B0.fileName,X0=B0.line;break}}if(r<0||X0<0||!J0||!q0||J0!==q0||r>=X0)return;b0=function(r0){if(W.test(r0))return!0;var K1=A1(r0);if(K1){if(K1.fileName===J0&&(r<=K1.line&&K1.line<=X0))return!0}return!1}}function u1(Q0){this._parent=Q0,this._promisesCreated=0;var B=this._length=1+(Q0===void 0?0:Q0._length);if(b1(this,u1),B>32)this.uncycle()}J.inherits(u1,Error),Y.CapturedTrace=u1,u1.prototype.uncycle=function(){var Q0=this._length;if(Q0<2)return;var B=[],v={};for(var u=0,r=this;r!==void 0;++u)B.push(r),r=r._parent;Q0=this._length=u;for(var u=Q0-1;u>=0;--u){var X0=B[u].stack;if(v[X0]===void 0)v[X0]=u}for(var u=0;u<Q0;++u){var J0=B[u].stack,q0=v[J0];if(q0!==void 0&&q0!==u){if(q0>0)B[q0-1]._parent=void 0,B[q0-1]._length=1;B[u]._parent=void 0,B[u]._length=1;var M0=u>0?B[u-1]:this;if(q0<Q0-1)M0._parent=B[q0+1],M0._parent.uncycle(),M0._length=M0._parent._length+1;else M0._parent=void 0,M0._length=1;var B0=M0._length+1;for(var r0=u-2;r0>=0;--r0)B[r0]._length=B0,B0++;return}}},u1.prototype.attachExtraTrace=function(Q0){if(Q0.__stackCleaned__)return;this.uncycle();var B=i0(Q0),v=B.message,u=[B.stack],r=this;while(r!==void 0)u.push(G0(r.stack.split(`
|
||||
`),r=-1,X0=-1,J0,q0;for(var w0=0;w0<v.length;++w0){var B0=A1(v[w0]);if(B0){J0=B0.fileName,r=B0.line;break}}for(var w0=0;w0<u.length;++w0){var B0=A1(u[w0]);if(B0){q0=B0.fileName,X0=B0.line;break}}if(r<0||X0<0||!J0||!q0||J0!==q0||r>=X0)return;b0=function(r0){if(W.test(r0))return!0;var K1=A1(r0);if(K1){if(K1.fileName===J0&&(r<=K1.line&&K1.line<=X0))return!0}return!1}}function u1(Q0){this._parent=Q0,this._promisesCreated=0;var B=this._length=1+(Q0===void 0?0:Q0._length);if(b1(this,u1),B>32)this.uncycle()}J.inherits(u1,Error),Y.CapturedTrace=u1,u1.prototype.uncycle=function(){var Q0=this._length;if(Q0<2)return;var B=[],v={};for(var u=0,r=this;r!==void 0;++u)B.push(r),r=r._parent;Q0=this._length=u;for(var u=Q0-1;u>=0;--u){var X0=B[u].stack;if(v[X0]===void 0)v[X0]=u}for(var u=0;u<Q0;++u){var J0=B[u].stack,q0=v[J0];if(q0!==void 0&&q0!==u){if(q0>0)B[q0-1]._parent=void 0,B[q0-1]._length=1;B[u]._parent=void 0,B[u]._length=1;var w0=u>0?B[u-1]:this;if(q0<Q0-1)w0._parent=B[q0+1],w0._parent.uncycle(),w0._length=w0._parent._length+1;else w0._parent=void 0,w0._length=1;var B0=w0._length+1;for(var r0=u-2;r0>=0;--r0)B[r0]._length=B0,B0++;return}}},u1.prototype.attachExtraTrace=function(Q0){if(Q0.__stackCleaned__)return;this.uncycle();var B=i0(Q0),v=B.message,u=[B.stack],r=this;while(r!==void 0)u.push(G0(r.stack.split(`
|
||||
`))),r=r._parent;E0(u),N0(u),J.notEnumerableProp(Q0,"stack",Y0(v,u)),J.notEnumerableProp(Q0,"__stackCleaned__",!0)};var b1=function(){var B=/^\s*at\s*/,v=function(J0,q0){if(typeof J0==="string")return J0;if(q0.name!==void 0&&q0.message!==void 0)return q0.toString();return H0(q0)};if(typeof Error.stackTraceLimit==="number"&&typeof Error.captureStackTrace==="function"){Error.stackTraceLimit+=6,Z=B,q=v;var u=Error.captureStackTrace;return b0=function(J0){return W.test(J0)},function(J0,q0){Error.stackTraceLimit+=6,u(J0,q0),Error.stackTraceLimit-=6}}var r=Error();if(typeof r.stack==="string"&&r.stack.split(`
|
||||
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,q=v,V=!0,function(q0){q0.stack=Error().stack};var X0;try{throw Error()}catch(J0){X0="stack"in J0}if(!("stack"in r)&&X0&&typeof Error.stackTraceLimit==="number")return Z=B,q=v,function(q0){Error.stackTraceLimit+=6;try{throw Error()}catch(M0){q0.stack=M0.stack}Error.stackTraceLimit-=6};return q=function(J0,q0){if(typeof J0==="string")return J0;if((typeof q0==="object"||typeof q0==="function")&&q0.name!==void 0&&q0.message!==void 0)return q0.toString();return H0(q0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(F=function(Q0){console.warn(Q0)},J.isNode&&process.stderr.isTTY)F=function(Q0,B){var v=B?"\x1B[33m":"\x1B[31m";console.warn(v+Q0+`\x1B[0m
|
||||
`)};else if(!J.isNode&&typeof Error().stack==="string")F=function(Q0,B){console.warn("%c"+Q0,B?"color: darkorange":"color: red")}}var A0={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1};if(N)$.longStackTraces();return{longStackTraces:function(){return A0.longStackTraces},warnings:function(){return A0.warnings},cancellation:function(){return A0.cancellation},monitoring:function(){return A0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:P,fireGlobalEvent:T}}});var lF0=E((sa1,mF0)=>{mF0.exports=function($,Y){var z=F4(),U=$.CancellationError,Q=z.errorObj;function J(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function K(X){this.finallyHandler=X}K.prototype._resultCancelled=function(){I(this.finallyHandler)};function I(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return H.call(this,this.promise._target()._settledValue())}function W(X){if(I(this,X))return;return Q.e=X,Q}function H(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=Y(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var M=new U("late cancellation observer");return Z._attachExtraTrace(M),Q.e=M,Q}else if(F.isPending())F._attachCancellationCallback(new K(this))}return F._then(G,W,void 0,this,void 0)}}}if(Z.isRejected())return I(this),Q.e=X,Q;else return I(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new J(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,H,H)},$.prototype.tap=function(X){return this._passThrough(X,1,H)},J}});var rF0=E((aa1,oF0)=>{oF0.exports=function($){var Y=F4(),z=sz().keys,U=Y.tryCatch,Q=Y.errorObj;function J(K,I,G){return function(W){var H=G._boundValue();$:for(var X=0;X<K.length;++X){var Z=K[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(W instanceof Z)return U(I).call(H,W)}else if(typeof Z==="function"){var q=U(Z).call(H,W);if(q===Q)return q;else if(q)return U(I).call(H,W)}else if(Y.isObject(W)){var V=z(Z);for(var F=0;F<V.length;++F){var M=V[F];if(Z[M]!=W[M])continue $}return U(I).call(H,W)}}return $}}return J}});var Xc=E((ta1,tF0)=>{var sF0=F4(),vV1=sF0.maybeWrapAsError,hV1=E3(),SV1=hV1.OperationalError,aF0=sz();function gV1($){return $ instanceof Error&&aF0.getPrototypeOf($)===Error.prototype}var yV1=/^(?:name|message|stack|cause)$/;function kV1($){var Y;if(gV1($)){Y=new SV1($),Y.name=$.name,Y.message=$.message,Y.stack=$.stack;var z=aF0.keys($);for(var U=0;U<z.length;++U){var Q=z[U];if(!yV1.test(Q))Y[Q]=$[Q]}return Y}return sF0.markAsOriginatingFromRejection($),$}function xV1($,Y){return function(z,U){if($===null)return;if(z){var Q=kV1(vV1(z));$._attachExtraTrace(Q),$._reject(Q)}else if(!Y)$._fulfill(U);else{var J=arguments.length,K=Array(Math.max(J-1,0));for(var I=1;I<J;++I)K[I-1]=arguments[I];$._fulfill(K)}$=null}}tF0.exports=xV1});var $w0=E((ea1,eF0)=>{eF0.exports=function($,Y,z,U,Q){var J=F4(),K=J.tryCatch;$.method=function(I){if(typeof I!=="function")throw new $.TypeError("expecting a function but got "+J.classString(I));return function(){var G=new $(Y);G._captureStackTrace(),G._pushContext();var W=K(I).apply(this,arguments),H=G._popContext();return Q.checkForgottenReturns(W,H,"Promise.method",G),G._resolveFromSyncValue(W),G}},$.attempt=$.try=function(I){if(typeof I!=="function")return U("expecting a function but got "+J.classString(I));var G=new $(Y);G._captureStackTrace(),G._pushContext();var W;if(arguments.length>1){Q.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],X=arguments[2];W=J.isArray(H)?K(I).apply(X,H):K(I).call(X,H)}else W=K(I)();var Z=G._popContext();return Q.checkForgottenReturns(W,Z,"Promise.try",G),G._resolveFromSyncValue(W),G},$.prototype._resolveFromSyncValue=function(I){if(I===J.errorObj)this._rejectCallback(I.e,!1);else this._resolveCallback(I,!0)}}});var zw0=E(($t1,Yw0)=>{Yw0.exports=function($,Y,z,U){var Q=!1,J=function(W,H){this._reject(H)},K=function(W,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(J,J,null,this,W)},I=function(W,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},G=function(W,H){if(!H.promiseRejectionQueued)this._reject(W)};$.prototype.bind=function(W){if(!Q)Q=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var H=z(W),X=new $(Y);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(H),H instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:H};Z._then(Y,K,voi
Line truncated
|
||||
`)[0].indexOf("stackDetection@")>=0)return Z=/@/,q=v,V=!0,function(q0){q0.stack=Error().stack};var X0;try{throw Error()}catch(J0){X0="stack"in J0}if(!("stack"in r)&&X0&&typeof Error.stackTraceLimit==="number")return Z=B,q=v,function(q0){Error.stackTraceLimit+=6;try{throw Error()}catch(w0){q0.stack=w0.stack}Error.stackTraceLimit-=6};return q=function(J0,q0){if(typeof J0==="string")return J0;if((typeof q0==="object"||typeof q0==="function")&&q0.name!==void 0&&q0.message!==void 0)return q0.toString();return H0(q0)},null}([]);if(typeof console<"u"&&typeof console.warn<"u"){if(F=function(Q0){console.warn(Q0)},J.isNode&&process.stderr.isTTY)F=function(Q0,B){var v=B?"\x1B[33m":"\x1B[31m";console.warn(v+Q0+`\x1B[0m
|
||||
`)};else if(!J.isNode&&typeof Error().stack==="string")F=function(Q0,B){console.warn("%c"+Q0,B?"color: darkorange":"color: red")}}var A0={warnings:M,longStackTraces:!1,cancellation:!1,monitoring:!1};if(O)$.longStackTraces();return{longStackTraces:function(){return A0.longStackTraces},warnings:function(){return A0.warnings},cancellation:function(){return A0.cancellation},monitoring:function(){return A0.monitoring},propagateFromFunction:function(){return t},boundValueFunction:function(){return $0},checkForgottenReturns:e,setBounds:k1,warn:s,deprecated:y,CapturedTrace:u1,fireDomEvent:P,fireGlobalEvent:T}}});var sF0=E((Ht1,rF0)=>{rF0.exports=function($,Y){var z=F4(),U=$.CancellationError,Q=z.errorObj;function J(X,Z,q){this.promise=X,this.type=Z,this.handler=q,this.called=!1,this.cancelPromise=null}J.prototype.isFinallyHandler=function(){return this.type===0};function K(X){this.finallyHandler=X}K.prototype._resultCancelled=function(){I(this.finallyHandler)};function I(X,Z){if(X.cancelPromise!=null){if(arguments.length>1)X.cancelPromise._reject(Z);else X.cancelPromise._cancel();return X.cancelPromise=null,!0}return!1}function G(){return H.call(this,this.promise._target()._settledValue())}function W(X){if(I(this,X))return;return Q.e=X,Q}function H(X){var Z=this.promise,q=this.handler;if(!this.called){this.called=!0;var V=this.isFinallyHandler()?q.call(Z._boundValue()):q.call(Z._boundValue(),X);if(V!==void 0){Z._setReturnedNonUndefined();var F=Y(V,Z);if(F instanceof $){if(this.cancelPromise!=null){if(F._isCancelled()){var w=new U("late cancellation observer");return Z._attachExtraTrace(w),Q.e=w,Q}else if(F.isPending())F._attachCancellationCallback(new K(this))}return F._then(G,W,void 0,this,void 0)}}}if(Z.isRejected())return I(this),Q.e=X,Q;else return I(this),X}return $.prototype._passThrough=function(X,Z,q,V){if(typeof X!=="function")return this.then();return this._then(q,V,void 0,new J(this,Z,X),void 0)},$.prototype.lastly=$.prototype.finally=function(X){return this._passThrough(X,0,H,H)},$.prototype.tap=function(X){return this._passThrough(X,1,H)},J}});var tF0=E((Xt1,aF0)=>{aF0.exports=function($){var Y=F4(),z=az().keys,U=Y.tryCatch,Q=Y.errorObj;function J(K,I,G){return function(W){var H=G._boundValue();$:for(var X=0;X<K.length;++X){var Z=K[X];if(Z===Error||Z!=null&&Z.prototype instanceof Error){if(W instanceof Z)return U(I).call(H,W)}else if(typeof Z==="function"){var q=U(Z).call(H,W);if(q===Q)return q;else if(q)return U(I).call(H,W)}else if(Y.isObject(W)){var V=z(Z);for(var F=0;F<V.length;++F){var w=V[F];if(Z[w]!=W[w])continue $}return U(I).call(H,W)}}return $}}return J}});var Zc=E((Zt1,YM0)=>{var eF0=F4(),iV1=eF0.maybeWrapAsError,cV1=E3(),nV1=cV1.OperationalError,$M0=az();function pV1($){return $ instanceof Error&&$M0.getPrototypeOf($)===Error.prototype}var dV1=/^(?:name|message|stack|cause)$/;function mV1($){var Y;if(pV1($)){Y=new nV1($),Y.name=$.name,Y.message=$.message,Y.stack=$.stack;var z=$M0.keys($);for(var U=0;U<z.length;++U){var Q=z[U];if(!dV1.test(Q))Y[Q]=$[Q]}return Y}return eF0.markAsOriginatingFromRejection($),$}function lV1($,Y){return function(z,U){if($===null)return;if(z){var Q=mV1(iV1(z));$._attachExtraTrace(Q),$._reject(Q)}else if(!Y)$._fulfill(U);else{var J=arguments.length,K=Array(Math.max(J-1,0));for(var I=1;I<J;++I)K[I-1]=arguments[I];$._fulfill(K)}$=null}}YM0.exports=lV1});var UM0=E((qt1,zM0)=>{zM0.exports=function($,Y,z,U,Q){var J=F4(),K=J.tryCatch;$.method=function(I){if(typeof I!=="function")throw new $.TypeError("expecting a function but got "+J.classString(I));return function(){var G=new $(Y);G._captureStackTrace(),G._pushContext();var W=K(I).apply(this,arguments),H=G._popContext();return Q.checkForgottenReturns(W,H,"Promise.method",G),G._resolveFromSyncValue(W),G}},$.attempt=$.try=function(I){if(typeof I!=="function")return U("expecting a function but got "+J.classString(I));var G=new $(Y);G._captureStackTrace(),G._pushContext();var W;if(arguments.length>1){Q.deprecated("calling Promise.try with more than 1 argument");var H=arguments[1],X=arguments[2];W=J.isArray(H)?K(I).apply(X,H):K(I).call(X,H)}else W=K(I)();var Z=G._popContext();return Q.checkForgottenReturns(W,Z,"Promise.try",G),G._resolveFromSyncValue(W),G},$.prototype._resolveFromSyncValue=function(I){if(I===J.errorObj)this._rejectCallback(I.e,!1);else this._resolveCallback(I,!0)}}});var JM0=E((Vt1,QM0)=>{QM0.exports=function($,Y,z,U){var Q=!1,J=function(W,H){this._reject(H)},K=function(W,H){H.promiseRejectionQueued=!0,H.bindingPromise._then(J,J,null,this,W)},I=function(W,H){if((this._bitField&50397184)===0)this._resolveCallback(H.target)},G=function(W,H){if(!H.promiseRejectionQueued)this._reject(W)};$.prototype.bind=function(W){if(!Q)Q=!0,$.prototype._propagateFrom=U.propagateFromFunction(),$.prototype._boundValue=U.boundValueFunction();var H=z(W),X=new $(Y);X._propagateFrom(this,1);var Z=this._target();if(X._setBoundTo(H),H instanceof $){var q={promiseRejectionQueued:!1,promise:X,target:Z,bindingPromise:H};Z._then(Y,K,voi
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);return this._settledValue()},U=Y.prototype.error=Y.prototype.reason=function(){if(!this.isRejected())throw TypeError(`cannot get rejection reason of a non-rejected promise
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);return this._settledValue()},Q=Y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=Y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},K=Y.prototype.isPending=function(){return(this._bitField&50397184)===0},I=Y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};Y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return K.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Q.call(this._target())},$.prototype.isResolved=function(){return I.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),U.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=Y}});var Hw0=E((Qt1,Ww0)=>{Ww0.exports=function($,Y,z,U,Q,J){var K=F4(),I=K.canEvaluate,G=K.tryCatch,W=K.errorObj,H;if(I){var X=function(N){return Function("value","holder",`
|
||||
`);return this._settledValue()},Q=Y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},J=Y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},K=Y.prototype.isPending=function(){return(this._bitField&50397184)===0},I=Y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};Y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},$.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},$.prototype._isCancelled=function(){return this._target().__isCancelled()},$.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},$.prototype.isPending=function(){return K.call(this._target())},$.prototype.isRejected=function(){return J.call(this._target())},$.prototype.isFulfilled=function(){return Q.call(this._target())},$.prototype.isResolved=function(){return I.call(this._target())},$.prototype.value=function(){return z.call(this._target())},$.prototype.reason=function(){var G=this._target();return G._unsetRejectionIsUnhandled(),U.call(G)},$.prototype._value=function(){return this._settledValue()},$.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},$.PromiseInspection=Y}});var qM0=E((wt1,ZM0)=>{ZM0.exports=function($,Y,z,U,Q,J){var K=F4(),I=K.canEvaluate,G=K.tryCatch,W=K.errorObj,H;if(I){var X=function(O){return Function("value","holder",`
|
||||
'use strict';
|
||||
holder.pIndex = value;
|
||||
holder.checkFulfillment(this);
|
||||
`.replace(/Index/g,N))},Z=function(N){return Function("promise","holder",`
|
||||
`.replace(/Index/g,O))},Z=function(O){return Function("promise","holder",`
|
||||
'use strict';
|
||||
holder.pIndex = promise;
|
||||
`.replace(/Index/g,N))},q=function(N){var O=Array(N);for(var D=0;D<O.length;++D)O[D]="this.p"+(D+1);var P=O.join(" = ")+" = null;",T=`var promise;
|
||||
`+O.map(function(b){return`
|
||||
`.replace(/Index/g,O))},q=function(O){var N=Array(O);for(var D=0;D<N.length;++D)N[D]="this.p"+(D+1);var P=N.join(" = ")+" = null;",T=`var promise;
|
||||
`+N.map(function(b){return`
|
||||
promise = `+b+`;
|
||||
if (promise instanceof Promise) {
|
||||
promise.cancel();
|
||||
}
|
||||
`}).join(`
|
||||
`),A=O.join(", "),j="Holder$"+N,C=`return function(tryCatch, errorObj, Promise, async) {
|
||||
`),A=N.join(", "),j="Holder$"+O,C=`return function(tryCatch, errorObj, Promise, async) {
|
||||
'use strict';
|
||||
function [TheName](fn) {
|
||||
[TheProperties]
|
||||
@@ -199,7 +199,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
|
||||
return [TheName];
|
||||
}(tryCatch, errorObj, Promise, async);
|
||||
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,N).replace(/\[ThePassedArguments\]/g,A).replace(/\[TheProperties\]/g,P).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,W,$,Q)},V=[],F=[],M=[];for(var w=0;w<8;++w)V.push(q(w+1)),F.push(X(w+1)),M.push(Z(w+1));H=function(N){this._reject(N)}}$.join=function(){var N=arguments.length-1,O;if(N>0&&typeof arguments[N]==="function"){if(O=arguments[N],N<=8&&I){var c=new $(U);c._captureStackTrace();var D=V[N-1],P=new D(O),T=F;for(var A=0;A<N;++A){var j=z(arguments[A],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[A],H,void 0,c,P),M[A](j,P),P.asyncNeeded=!1;else if((C&33554432)!==0)T[A].call(c,j._value(),P);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[A].call(c,j,P)}if(!c._isFateSealed()){if(P.asyncNeeded){var b=J();if(b!==null)P.fn=K.domainBind(b,P.fn)}c._setAsyncGuaranteed(),c._setOnCancel(P)}return c}}var x=arguments.length,S=Array(x);for(var i=0;i<x;++i)S[i]=arguments[i];if(O)S.pop();var c=new Y(S).promise();return O!==void 0?c.spread(O):c}}});var Zw0=E((Jt1,Xw0)=>{Xw0.exports=function($,Y,z,U,Q,J){var K=$._getDomain,I=F4(),G=I.tryCatch,W=I.errorObj,H=$._async;function X(q,V,F,M){this.constructor$(q),this._promise._captureStackTrace();var w=K();this._callback=w===null?V:I.domainBind(w,V),this._preservedValues=M===Q?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}I.inherits(X,Y),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,M=this.length(),w=this._preservedValues,N=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,N>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(N>=1&&this._inFlight>=N)return F[V]=q,this._queue.push(V),!1;if(w!==null)w[V]=q;var O=this._promise,D=this._callback,P=O._boundValue();O._pushContext();var T=G(D).call(P,q,V,M),A=O._popContext();if(J.checkForgottenReturns(T,A,w!==null?"Promise.filter":"Promise.map",O),T===W)return this._reject(T.e),!0;var j=U(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(N>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=M){if(w!==null)this._filter(F,w);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var M=q.pop();this._promiseFulfilled(F[M],M)}},X.prototype._filter=function(q,V){var F=V.length,M=Array(F),w=0;for(var N=0;N<F;++N)if(q[N])M[w++]=V[N];M.length=w,this._resolve(M)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,M){if(typeof V!=="function")return z("expecting a function but got "+I.classString(V));var w=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+I.classString(F.concurrency)));w=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+I.classString(F)));return w=typeof w==="number"&&isFinite(w)&&w>=1?w:0,new X(q,V,w,M).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,M){return Z(q,V,F,M)}}});var Vw0=E((Kt1,qw0)=>{var Zc=Object.create;if(Zc)SA=Zc(null),gA=Zc(null),SA[" size"]=gA[" size"]=0;var SA,gA;qw0.exports=function($){var Y=F4(),z=Y.canEvaluate,U=Y.isIdentifier,Q,J,K=function(q){return Function("ensureMethod",`
|
||||
`;return C=C.replace(/\[TheName\]/g,j).replace(/\[TheTotal\]/g,O).replace(/\[ThePassedArguments\]/g,A).replace(/\[TheProperties\]/g,P).replace(/\[CancellationCode\]/g,T),Function("tryCatch","errorObj","Promise","async",C)(G,W,$,Q)},V=[],F=[],w=[];for(var M=0;M<8;++M)V.push(q(M+1)),F.push(X(M+1)),w.push(Z(M+1));H=function(O){this._reject(O)}}$.join=function(){var O=arguments.length-1,N;if(O>0&&typeof arguments[O]==="function"){if(N=arguments[O],O<=8&&I){var c=new $(U);c._captureStackTrace();var D=V[O-1],P=new D(N),T=F;for(var A=0;A<O;++A){var j=z(arguments[A],c);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0)j._then(T[A],H,void 0,c,P),w[A](j,P),P.asyncNeeded=!1;else if((C&33554432)!==0)T[A].call(c,j._value(),P);else if((C&16777216)!==0)c._reject(j._reason());else c._cancel()}else T[A].call(c,j,P)}if(!c._isFateSealed()){if(P.asyncNeeded){var b=J();if(b!==null)P.fn=K.domainBind(b,P.fn)}c._setAsyncGuaranteed(),c._setOnCancel(P)}return c}}var x=arguments.length,S=Array(x);for(var i=0;i<x;++i)S[i]=arguments[i];if(N)S.pop();var c=new Y(S).promise();return N!==void 0?c.spread(N):c}}});var LM0=E((Ot1,VM0)=>{VM0.exports=function($,Y,z,U,Q,J){var K=$._getDomain,I=F4(),G=I.tryCatch,W=I.errorObj,H=$._async;function X(q,V,F,w){this.constructor$(q),this._promise._captureStackTrace();var M=K();this._callback=M===null?V:I.domainBind(M,V),this._preservedValues=w===Q?Array(this.length()):null,this._limit=F,this._inFlight=0,this._queue=[],H.invoke(this._asyncInit,this,void 0)}I.inherits(X,Y),X.prototype._asyncInit=function(){this._init$(void 0,-2)},X.prototype._init=function(){},X.prototype._promiseFulfilled=function(q,V){var F=this._values,w=this.length(),M=this._preservedValues,O=this._limit;if(V<0){if(V=V*-1-1,F[V]=q,O>=1){if(this._inFlight--,this._drainQueue(),this._isResolved())return!0}}else{if(O>=1&&this._inFlight>=O)return F[V]=q,this._queue.push(V),!1;if(M!==null)M[V]=q;var N=this._promise,D=this._callback,P=N._boundValue();N._pushContext();var T=G(D).call(P,q,V,w),A=N._popContext();if(J.checkForgottenReturns(T,A,M!==null?"Promise.filter":"Promise.map",N),T===W)return this._reject(T.e),!0;var j=U(T,this._promise);if(j instanceof $){j=j._target();var C=j._bitField;if((C&50397184)===0){if(O>=1)this._inFlight++;return F[V]=j,j._proxy(this,(V+1)*-1),!1}else if((C&33554432)!==0)T=j._value();else if((C&16777216)!==0)return this._reject(j._reason()),!0;else return this._cancel(),!0}F[V]=T}var b=++this._totalResolved;if(b>=w){if(M!==null)this._filter(F,M);else this._resolve(F);return!0}return!1},X.prototype._drainQueue=function(){var q=this._queue,V=this._limit,F=this._values;while(q.length>0&&this._inFlight<V){if(this._isResolved())return;var w=q.pop();this._promiseFulfilled(F[w],w)}},X.prototype._filter=function(q,V){var F=V.length,w=Array(F),M=0;for(var O=0;O<F;++O)if(q[O])w[M++]=V[O];w.length=M,this._resolve(w)},X.prototype.preservedValues=function(){return this._preservedValues};function Z(q,V,F,w){if(typeof V!=="function")return z("expecting a function but got "+I.classString(V));var M=0;if(F!==void 0)if(typeof F==="object"&&F!==null){if(typeof F.concurrency!=="number")return $.reject(TypeError("'concurrency' must be a number but it is "+I.classString(F.concurrency)));M=F.concurrency}else return $.reject(TypeError("options argument must be an object but it is "+I.classString(F)));return M=typeof M==="number"&&isFinite(M)&&M>=1?M:0,new X(q,V,M,w).promise()}$.prototype.map=function(q,V){return Z(this,q,V,null)},$.map=function(q,V,F,w){return Z(q,V,F,w)}}});var MM0=E((Nt1,FM0)=>{var qc=Object.create;if(qc)gA=qc(null),yA=qc(null),gA[" size"]=yA[" size"]=0;var gA,yA;FM0.exports=function($){var Y=F4(),z=Y.canEvaluate,U=Y.isIdentifier,Q,J,K=function(q){return Function("ensureMethod",`
|
||||
return function(obj) {
|
||||
'use strict'
|
||||
var len = this.length;
|
||||
@@ -216,23 +216,23 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
`.replace(/methodName/g,q))(W)},I=function(q){return Function("obj",`
|
||||
'use strict';
|
||||
return obj.propertyName;
|
||||
`.replace("propertyName",q))},G=function(q,V,F){var M=F[q];if(typeof M!=="function"){if(!U(q))return null;if(M=V(q),F[q]=M,F[" size"]++,F[" size"]>512){var w=Object.keys(F);for(var N=0;N<256;++N)delete F[w[N]];F[" size"]=w.length-256}}return M};Q=function(q){return G(q,K,SA)},J=function(q){return G(q,I,gA)};function W(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var M="Object "+Y.classString(q)+" has no method '"+Y.toString(V)+"'";throw new $.TypeError(M)}return F}function H(q){var V=this.pop(),F=W(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var M=1;M<V;++M)F[M-1]=arguments[M];if(z){var w=Q(q);if(w!==null)return this._then(w,void 0,void 0,F,void 0)}return F.push(q),this._then(H,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(z){var M=J(q);F=M!==null?M:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var Fw0=E((It1,Lw0)=>{Lw0.exports=function($,Y,z,U,Q,J){var K=F4(),I=E3().TypeError,G=F4().inherits,W=K.errorObj,H=K.tryCatch,X={};function Z(O){setTimeout(function(){throw O},0)}function q(O){var D=z(O);if(D!==O&&typeof O._isDisposable==="function"&&typeof O._getDisposer==="function"&&O._isDisposable())D._setDisposable(O._getDisposer());return D}function V(O,D){var P=0,T=O.length,A=new $(Q);function j(){if(P>=T)return A._fulfill();var C=q(O[P++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(D),O.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),A}function F(O,D,P){this._data=O,this._promise=D,this._context=P}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(O){var D=this.resource(),P=this._context;if(P!==void 0)P._pushContext();var T=D!==X?this.doDispose(D,O):null;if(P!==void 0)P._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(O){return O!=null&&typeof O.resource==="function"&&typeof O.tryDispose==="function"};function M(O,D,P){this.constructor$(O,D,P)}G(M,F),M.prototype.doDispose=function(O,D){var P=this.data();return P.call(O,O,D)};function w(O){if(F.isDisposer(O))return this.resources[this.index]._setDisposable(O),O.promise();return O}function N(O){this.length=O,this.promise=null,this[O-1]=null}N.prototype._resultCancelled=function(){var O=this.length;for(var D=0;D<O;++D){var P=this[D];if(P instanceof $)P.cancel()}},$.using=function(){var O=arguments.length;if(O<2)return Y("you must pass at least 2 arguments to Promise.using");var D=arguments[O-1];if(typeof D!=="function")return Y("expecting a function but got "+K.classString(D));var P,T=!0;if(O===2&&Array.isArray(arguments[0]))P=arguments[0],O=P.length,T=!1;else P=arguments,O--;var A=new N(O);for(var j=0;j<O;++j){var C=P[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var x=z(C);if(x instanceof $)C=x._then(w,null,null,{resources:A,index:j},void 0)}A[j]=C}var S=Array(A.length);for(var j=0;j<S.length;++j)S[j]=$.resolve(A[j]).reflect();var i=$.all(S).then(function(U0){for(var k=0;k<U0.length;++k){var d=U0[k];if(d.isRejected())return W.e=d.error(),W;else if(!d.isFulfilled()){i.cancel();return}U0[k]=d.value()}c._pushContext(),D=H(D);var t=T?D.apply(void 0,U0):D(U0),$0=c._popContext();return J.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var U0=new $.PromiseInspection(i);return V(A,U0)});return A.promise=c,c._setOnCancel(A),c},$.prototype._setDisposable=function(O){this._bitField=this._bitField|131072,this._disposer=O},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(O){if(typeof O==="function")return new M(O,this,U());throw new I}}});var Mw0=E((Gt1,ww0)=>{ww0.exports=function($,Y,z){var U=F4(),Q=$.TimeoutError;function J(X){this.handle=X}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var K=function(X){return I(+this).thenReturn(X)},I=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(K,null,null,X,void 0),z.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(Y),V=setTimeout(function(){q._fulfill()},+X),z.cancellation())q._setOnCancel(new J(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return I(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new Q("operation timed out");else V=new Q(Z);if(U.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function W(X){return clearTimeout(this.handle),X
Line truncated
|
||||
`.replace("propertyName",q))},G=function(q,V,F){var w=F[q];if(typeof w!=="function"){if(!U(q))return null;if(w=V(q),F[q]=w,F[" size"]++,F[" size"]>512){var M=Object.keys(F);for(var O=0;O<256;++O)delete F[M[O]];F[" size"]=M.length-256}}return w};Q=function(q){return G(q,K,gA)},J=function(q){return G(q,I,yA)};function W(q,V){var F;if(q!=null)F=q[V];if(typeof F!=="function"){var w="Object "+Y.classString(q)+" has no method '"+Y.toString(V)+"'";throw new $.TypeError(w)}return F}function H(q){var V=this.pop(),F=W(q,V);return F.apply(q,this)}$.prototype.call=function(q){var V=arguments.length,F=Array(Math.max(V-1,0));for(var w=1;w<V;++w)F[w-1]=arguments[w];if(z){var M=Q(q);if(M!==null)return this._then(M,void 0,void 0,F,void 0)}return F.push(q),this._then(H,void 0,void 0,F,void 0)};function X(q){return q[this]}function Z(q){var V=+this;if(V<0)V=Math.max(0,V+q.length);return q[V]}$.prototype.get=function(q){var V=typeof q==="number",F;if(!V)if(z){var w=J(q);F=w!==null?w:X}else F=X;else F=Z;return this._then(F,void 0,void 0,q,void 0)}}});var OM0=E((Dt1,wM0)=>{wM0.exports=function($,Y,z,U,Q,J){var K=F4(),I=E3().TypeError,G=F4().inherits,W=K.errorObj,H=K.tryCatch,X={};function Z(N){setTimeout(function(){throw N},0)}function q(N){var D=z(N);if(D!==N&&typeof N._isDisposable==="function"&&typeof N._getDisposer==="function"&&N._isDisposable())D._setDisposable(N._getDisposer());return D}function V(N,D){var P=0,T=N.length,A=new $(Q);function j(){if(P>=T)return A._fulfill();var C=q(N[P++]);if(C instanceof $&&C._isDisposable()){try{C=z(C._getDisposer().tryDispose(D),N.promise)}catch(b){return Z(b)}if(C instanceof $)return C._then(j,Z,null,null,null)}j()}return j(),A}function F(N,D,P){this._data=N,this._promise=D,this._context=P}F.prototype.data=function(){return this._data},F.prototype.promise=function(){return this._promise},F.prototype.resource=function(){if(this.promise().isFulfilled())return this.promise().value();return X},F.prototype.tryDispose=function(N){var D=this.resource(),P=this._context;if(P!==void 0)P._pushContext();var T=D!==X?this.doDispose(D,N):null;if(P!==void 0)P._popContext();return this._promise._unsetDisposable(),this._data=null,T},F.isDisposer=function(N){return N!=null&&typeof N.resource==="function"&&typeof N.tryDispose==="function"};function w(N,D,P){this.constructor$(N,D,P)}G(w,F),w.prototype.doDispose=function(N,D){var P=this.data();return P.call(N,N,D)};function M(N){if(F.isDisposer(N))return this.resources[this.index]._setDisposable(N),N.promise();return N}function O(N){this.length=N,this.promise=null,this[N-1]=null}O.prototype._resultCancelled=function(){var N=this.length;for(var D=0;D<N;++D){var P=this[D];if(P instanceof $)P.cancel()}},$.using=function(){var N=arguments.length;if(N<2)return Y("you must pass at least 2 arguments to Promise.using");var D=arguments[N-1];if(typeof D!=="function")return Y("expecting a function but got "+K.classString(D));var P,T=!0;if(N===2&&Array.isArray(arguments[0]))P=arguments[0],N=P.length,T=!1;else P=arguments,N--;var A=new O(N);for(var j=0;j<N;++j){var C=P[j];if(F.isDisposer(C)){var b=C;C=C.promise(),C._setDisposable(b)}else{var x=z(C);if(x instanceof $)C=x._then(M,null,null,{resources:A,index:j},void 0)}A[j]=C}var S=Array(A.length);for(var j=0;j<S.length;++j)S[j]=$.resolve(A[j]).reflect();var i=$.all(S).then(function(U0){for(var k=0;k<U0.length;++k){var d=U0[k];if(d.isRejected())return W.e=d.error(),W;else if(!d.isFulfilled()){i.cancel();return}U0[k]=d.value()}c._pushContext(),D=H(D);var t=T?D.apply(void 0,U0):D(U0),$0=c._popContext();return J.checkForgottenReturns(t,$0,"Promise.using",c),t}),c=i.lastly(function(){var U0=new $.PromiseInspection(i);return V(A,U0)});return A.promise=c,c._setOnCancel(A),c},$.prototype._setDisposable=function(N){this._bitField=this._bitField|131072,this._disposer=N},$.prototype._isDisposable=function(){return(this._bitField&131072)>0},$.prototype._getDisposer=function(){return this._disposer},$.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},$.prototype.disposer=function(N){if(typeof N==="function")return new w(N,this,U());throw new I}}});var DM0=E((At1,NM0)=>{NM0.exports=function($,Y,z){var U=F4(),Q=$.TimeoutError;function J(X){this.handle=X}J.prototype._resultCancelled=function(){clearTimeout(this.handle)};var K=function(X){return I(+this).thenReturn(X)},I=$.delay=function(X,Z){var q,V;if(Z!==void 0){if(q=$.resolve(Z)._then(K,null,null,X,void 0),z.cancellation()&&Z instanceof $)q._setOnCancel(Z)}else{if(q=new $(Y),V=setTimeout(function(){q._fulfill()},+X),z.cancellation())q._setOnCancel(new J(V));q._captureStackTrace()}return q._setAsyncGuaranteed(),q};$.prototype.delay=function(X){return I(X,this)};var G=function(X,Z,q){var V;if(typeof Z!=="string")if(Z instanceof Error)V=Z;else V=new Q("operation timed out");else V=new Q(Z);if(U.markAsOriginatingFromRejection(V),X._attachExtraTrace(V),X._reject(V),q!=null)q.cancel()};function W(X){return clearTimeout(this.handle),X
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
|
||||
`.replace("%s",M)+`From coroutine:
|
||||
`.replace("%s",w)+`From coroutine:
|
||||
`+this._stack.split(`
|
||||
`).slice(1,-7).join(`
|
||||
`)));return}}w=w._target();var N=w._bitField;if((N&50397184)===0)this._yieldedPromise=w,w._proxy(this,null);else if((N&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,w._value());else if((N&16777216)!==0)$._async.invoke(this._promiseRejected,this,w._reason());else this._promiseCancelled()}},$.coroutine=function(V,F){if(typeof V!=="function")throw new I(`generatorFunction must be a function
|
||||
`)));return}}M=M._target();var O=M._bitField;if((O&50397184)===0)this._yieldedPromise=M,M._proxy(this,null);else if((O&33554432)!==0)$._async.invoke(this._promiseFulfilled,this,M._value());else if((O&16777216)!==0)$._async.invoke(this._promiseRejected,this,M._reason());else this._promiseCancelled()}},$.coroutine=function(V,F){if(typeof V!=="function")throw new I(`generatorFunction must be a function
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var M=Object(F).yieldHandler,w=q,N=Error().stack;return function(){var O=V.apply(this,arguments),D=new w(void 0,void 0,M,N),P=D.promise();return D._generator=O,D._promiseFulfilled(void 0),P}},$.coroutine.addYieldHandler=function(V){if(typeof V!=="function")throw new I("expecting a function but got "+G.classString(V));X.push(V)},$.spawn=function(V){if(J.deprecated("Promise.spawn()","Promise.coroutine()"),typeof V!=="function")return Y(`generatorFunction must be a function
|
||||
`);var w=Object(F).yieldHandler,M=q,O=Error().stack;return function(){var N=V.apply(this,arguments),D=new M(void 0,void 0,w,O),P=D.promise();return D._generator=N,D._promiseFulfilled(void 0),P}},$.coroutine.addYieldHandler=function(V){if(typeof V!=="function")throw new I("expecting a function but got "+G.classString(V));X.push(V)},$.spawn=function(V){if(J.deprecated("Promise.spawn()","Promise.coroutine()"),typeof V!=="function")return Y(`generatorFunction must be a function
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var F=new q(V,this),M=F.promise();return F._run($.spawn),M}}});var Aw0=E((Ht1,Dw0)=>{Dw0.exports=function($){var Y=F4(),z=$._async,U=Y.tryCatch,Q=Y.errorObj;function J(G,W){var H=this;if(!Y.isArray(G))return K.call(H,G,W);var X=U(W).apply(H._boundValue(),[null].concat(G));if(X===Q)z.throwLater(X.e)}function K(G,W){var H=this,X=H._boundValue(),Z=G===void 0?U(W).call(X,null):U(W).call(X,null,G);if(Z===Q)z.throwLater(Z.e)}function I(G,W){var H=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=U(W).call(H._boundValue(),G);if(Z===Q)z.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,W){if(typeof G=="function"){var H=K;if(W!==void 0&&Object(W).spread)H=J;this._then(H,I,void 0,this,G)}return this}}});var Pw0=E((Xt1,Bw0)=>{Bw0.exports=function($,Y){var z={},U=F4(),Q=Xc(),J=U.withAppended,K=U.maybeWrapAsError,I=U.canEvaluate,G=E3().TypeError,W="Async",H={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return U.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function M(i,c,U0){var k=U.getDataPropertyOrDefault(i,c+U0,H);return k?F(k):!1}function w(i,c,U0){for(var k=0;k<i.length;k+=2){var d=i[k];if(U0.test(d)){var t=d.replace(U0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
|
||||
`);var F=new q(V,this),w=F.promise();return F._run($.spawn),w}}});var TM0=E((Pt1,PM0)=>{PM0.exports=function($){var Y=F4(),z=$._async,U=Y.tryCatch,Q=Y.errorObj;function J(G,W){var H=this;if(!Y.isArray(G))return K.call(H,G,W);var X=U(W).apply(H._boundValue(),[null].concat(G));if(X===Q)z.throwLater(X.e)}function K(G,W){var H=this,X=H._boundValue(),Z=G===void 0?U(W).call(X,null):U(W).call(X,null,G);if(Z===Q)z.throwLater(Z.e)}function I(G,W){var H=this;if(!G){var X=Error(G+"");X.cause=G,G=X}var Z=U(W).call(H._boundValue(),G);if(Z===Q)z.throwLater(Z.e)}$.prototype.asCallback=$.prototype.nodeify=function(G,W){if(typeof G=="function"){var H=K;if(W!==void 0&&Object(W).spread)H=J;this._then(H,I,void 0,this,G)}return this}}});var EM0=E((Tt1,jM0)=>{jM0.exports=function($,Y){var z={},U=F4(),Q=Zc(),J=U.withAppended,K=U.maybeWrapAsError,I=U.canEvaluate,G=E3().TypeError,W="Async",H={__isPromisified__:!0},X=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],Z=new RegExp("^(?:"+X.join("|")+")$"),q=function(i){return U.isIdentifier(i)&&i.charAt(0)!=="_"&&i!=="constructor"};function V(i){return!Z.test(i)}function F(i){try{return i.__isPromisified__===!0}catch(c){return!1}}function w(i,c,U0){var k=U.getDataPropertyOrDefault(i,c+U0,H);return k?F(k):!1}function M(i,c,U0){for(var k=0;k<i.length;k+=2){var d=i[k];if(U0.test(d)){var t=d.replace(U0,"");for(var $0=0;$0<i.length;$0+=2)if(i[$0]===t)throw new G(`Cannot promisify an API that has normal methods with '%s'-suffix
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`.replace("%s",c))}}}function N(i,c,U0,k){var d=U.inheritedDataKeys(i),t=[];for(var $0=0;$0<d.length;++$0){var g=d[$0],p=i[g],e=k===q?!0:q(g,p,i);if(typeof p==="function"&&!F(p)&&!M(i,g,c)&&k(g,p,i,e))t.push(g,p)}return w(t,c,U0),t}var O=function(i){return i.replace(/([$])/,"\\$")},D,P=function(i){var c=[i],U0=Math.max(0,i-1-3);for(var k=i-1;k>=U0;--k)c.push(k);for(var k=i+1;k<=3;++k)c.push(k);return c},T=function(i){return U.filledRange(i,"_arg","")},A=function(i){return U.filledRange(Math.max(i,3),"_arg","")},j=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};D=function(i,c,U0,k,d,t){var $0=Math.max(0,j(k)-1),g=P($0),p=typeof i==="string"||c===z;function e(N0){var E0=T(N0).join(", "),G0=N0>0?", ":"",T0;if(p)T0=`ret = callback.call(this, {{args}}, nodeback); break;
|
||||
`.replace("%s",c))}}}function O(i,c,U0,k){var d=U.inheritedDataKeys(i),t=[];for(var $0=0;$0<d.length;++$0){var g=d[$0],p=i[g],e=k===q?!0:q(g,p,i);if(typeof p==="function"&&!F(p)&&!w(i,g,c)&&k(g,p,i,e))t.push(g,p)}return M(t,c,U0),t}var N=function(i){return i.replace(/([$])/,"\\$")},D,P=function(i){var c=[i],U0=Math.max(0,i-1-3);for(var k=i-1;k>=U0;--k)c.push(k);for(var k=i+1;k<=3;++k)c.push(k);return c},T=function(i){return U.filledRange(i,"_arg","")},A=function(i){return U.filledRange(Math.max(i,3),"_arg","")},j=function(i){if(typeof i.length==="number")return Math.max(Math.min(i.length,1024),0);return 0};D=function(i,c,U0,k,d,t){var $0=Math.max(0,j(k)-1),g=P($0),p=typeof i==="string"||c===z;function e(N0){var E0=T(N0).join(", "),G0=N0>0?", ":"",T0;if(p)T0=`ret = callback.call(this, {{args}}, nodeback); break;
|
||||
`;else T0=c===void 0?`ret = callback({{args}}, nodeback); break;
|
||||
`:`ret = callback.call(receiver, {{args}}, nodeback); break;
|
||||
`;return T0.replace("{{args}}",E0).replace(", ",G0)}function y(){var N0="";for(var E0=0;E0<g.length;++E0)N0+="case "+g[E0]+":"+e(g[E0]);return N0+=`
|
||||
@@ -267,25 +267,25 @@ See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof T6))r
|
||||
};
|
||||
notEnumerableProp(ret, '__isPromisified__', true);
|
||||
return ret;
|
||||
`.replace("[CodeForSwitchCase]",y()).replace("[GetFunctionCode]",s);return Y0=Y0.replace("Parameters",A($0)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",Y0)($,k,c,J,K,Q,U.tryCatch,U.errorObj,U.notEnumerableProp,Y)};function C(i,c,U0,k,d,t){var $0=function(){return this}(),g=i;if(typeof g==="string")i=k;function p(){var e=c;if(c===z)e=this;var y=new $(Y);y._captureStackTrace();var s=typeof g==="string"&&this!==$0?this[g]:i,Y0=Q(y,t);try{s.apply(e,J(arguments,Y0))}catch(N0){y._rejectCallback(K(N0),!0,!0)}if(!y._isFateSealed())y._setAsyncGuaranteed();return y}return U.notEnumerableProp(p,"__isPromisified__",!0),p}var b=I?D:C;function x(i,c,U0,k,d){var t=new RegExp(O(c)+"$"),$0=N(i,c,t,U0);for(var g=0,p=$0.length;g<p;g+=2){var e=$0[g],y=$0[g+1],s=e+c;if(k===b)i[s]=b(e,z,e,y,c,d);else{var Y0=k(y,function(){return b(e,z,e,y,c,d)});U.notEnumerableProp(Y0,"__isPromisified__",!0),i[s]=Y0}}return U.toFastProperties(i),i}function S(i,c,U0){return b(i,c,void 0,i,null,U0)}$.promisify=function(i,c){if(typeof i!=="function")throw new G("expecting a function but got "+U.classString(i));if(F(i))return i;c=Object(c);var U0=c.context===void 0?z:c.context,k=!!c.multiArgs,d=S(i,U0,k);return U.copyDescriptors(i,d,V),d},$.promisifyAll=function(i,c){if(typeof i!=="function"&&typeof i!=="object")throw new G(`the target of promisifyAll must be an object or a function
|
||||
`.replace("[CodeForSwitchCase]",y()).replace("[GetFunctionCode]",s);return Y0=Y0.replace("Parameters",A($0)),Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",Y0)($,k,c,J,K,Q,U.tryCatch,U.errorObj,U.notEnumerableProp,Y)};function C(i,c,U0,k,d,t){var $0=function(){return this}(),g=i;if(typeof g==="string")i=k;function p(){var e=c;if(c===z)e=this;var y=new $(Y);y._captureStackTrace();var s=typeof g==="string"&&this!==$0?this[g]:i,Y0=Q(y,t);try{s.apply(e,J(arguments,Y0))}catch(N0){y._rejectCallback(K(N0),!0,!0)}if(!y._isFateSealed())y._setAsyncGuaranteed();return y}return U.notEnumerableProp(p,"__isPromisified__",!0),p}var b=I?D:C;function x(i,c,U0,k,d){var t=new RegExp(N(c)+"$"),$0=O(i,c,t,U0);for(var g=0,p=$0.length;g<p;g+=2){var e=$0[g],y=$0[g+1],s=e+c;if(k===b)i[s]=b(e,z,e,y,c,d);else{var Y0=k(y,function(){return b(e,z,e,y,c,d)});U.notEnumerableProp(Y0,"__isPromisified__",!0),i[s]=Y0}}return U.toFastProperties(i),i}function S(i,c,U0){return b(i,c,void 0,i,null,U0)}$.promisify=function(i,c){if(typeof i!=="function")throw new G("expecting a function but got "+U.classString(i));if(F(i))return i;c=Object(c);var U0=c.context===void 0?z:c.context,k=!!c.multiArgs,d=S(i,U0,k);return U.copyDescriptors(i,d,V),d},$.promisifyAll=function(i,c){if(typeof i!=="function"&&typeof i!=="object")throw new G(`the target of promisifyAll must be an object or a function
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);c=Object(c);var U0=!!c.multiArgs,k=c.suffix;if(typeof k!=="string")k=W;var d=c.filter;if(typeof d!=="function")d=q;var t=c.promisifier;if(typeof t!=="function")t=b;if(!U.isIdentifier(k))throw RangeError(`suffix must be a valid identifier
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var $0=U.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&U.isClass(p))x(p.prototype,k,d,t,U0),x(p,k,d,t,U0)}return x(i,k,d,t,U0)}}});var jw0=E((Zt1,Tw0)=>{Tw0.exports=function($,Y,z,U){var Q=F4(),J=Q.isObject,K=sz(),I;if(typeof Map==="function")I=Map;var G=function(){var Z=0,q=0;function V(F,M){this[Z]=F,this[Z+q]=M,Z++}return function(M){q=M.size,Z=0;var w=Array(M.size*2);return M.forEach(V,w),w}}(),W=function(Z){var q=new I,V=Z.length/2|0;for(var F=0;F<V;++F){var M=Z[V+F],w=Z[F];q.set(M,w)}return q};function H(Z){var q=!1,V;if(I!==void 0&&Z instanceof I)V=G(Z),q=!0;else{var F=K.keys(Z),M=F.length;V=Array(M*2);for(var w=0;w<M;++w){var N=F[w];V[w]=Z[N],V[w+M]=N}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}Q.inherits(H,Y),H.prototype._init=function(){},H.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=W(this._values);else{F={};var M=this.length();for(var w=0,N=this.length();w<N;++w)F[this._values[w+M]]=this._values[w]}return this._resolve(F),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=z(Z);if(!J(V))return U(`cannot await properties of a non-object
|
||||
`);var $0=U.inheritedDataKeys(i);for(var g=0;g<$0.length;++g){var p=i[$0[g]];if($0[g]!=="constructor"&&U.isClass(p))x(p.prototype,k,d,t,U0),x(p,k,d,t,U0)}return x(i,k,d,t,U0)}}});var RM0=E((jt1,CM0)=>{CM0.exports=function($,Y,z,U){var Q=F4(),J=Q.isObject,K=az(),I;if(typeof Map==="function")I=Map;var G=function(){var Z=0,q=0;function V(F,w){this[Z]=F,this[Z+q]=w,Z++}return function(w){q=w.size,Z=0;var M=Array(w.size*2);return w.forEach(V,M),M}}(),W=function(Z){var q=new I,V=Z.length/2|0;for(var F=0;F<V;++F){var w=Z[V+F],M=Z[F];q.set(w,M)}return q};function H(Z){var q=!1,V;if(I!==void 0&&Z instanceof I)V=G(Z),q=!0;else{var F=K.keys(Z),w=F.length;V=Array(w*2);for(var M=0;M<w;++M){var O=F[M];V[M]=Z[O],V[M+w]=O}}this.constructor$(V),this._isMap=q,this._init$(void 0,-3)}Q.inherits(H,Y),H.prototype._init=function(){},H.prototype._promiseFulfilled=function(Z,q){this._values[q]=Z;var V=++this._totalResolved;if(V>=this._length){var F;if(this._isMap)F=W(this._values);else{F={};var w=this.length();for(var M=0,O=this.length();M<O;++M)F[this._values[M+w]]=this._values[M]}return this._resolve(F),!0}return!1},H.prototype.shouldCopyValues=function(){return!1},H.prototype.getActualLength=function(Z){return Z>>1};function X(Z){var q,V=z(Z);if(!J(V))return U(`cannot await properties of a non-object
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new H(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var Cw0=E((qt1,Ew0)=>{Ew0.exports=function($,Y,z,U){var Q=F4(),J=function(I){return I.then(function(G){return K(G,I)})};function K(I,G){var W=z(I);if(W instanceof $)return J(W);else if(I=Q.asArray(I),I===null)return U("expecting an array or an iterable object but got "+Q.classString(I));var H=new $(Y);if(G!==void 0)H._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=H;for(var q=0,V=I.length;q<V;++q){var F=I[q];if(F===void 0&&!(q in I))continue;$.cast(F)._then(X,Z,void 0,H,null)}return H}$.race=function(I){return K(I,void 0)},$.prototype.race=function(){return K(this,void 0)}}});var _w0=E((Vt1,Rw0)=>{Rw0.exports=function($,Y,z,U,Q,J){var K=$._getDomain,I=F4(),G=I.tryCatch;function W(V,F,M,w){this.constructor$(V);var N=K();if(this._fn=N===null?F:I.domainBind(N,F),M!==void 0)M=$.resolve(M),M._attachCancellationCallback(this);if(this._initialValue=M,this._currentCancellable=null,w===Q)this._eachValues=Array(this._length);else if(w===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}I.inherits(W,Y),W.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==Q)this._eachValues.push(V)},W.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},W.prototype._init=function(){},W.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},W.prototype.shouldCopyValues=function(){return!1},W.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},W.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},W.prototype._iterate=function(V){this._values=V;var F,M,w=V.length;if(this._initialValue!==void 0)F=this._initialValue,M=0;else F=$.resolve(V[0]),M=1;if(this._currentCancellable=F,!F.isRejected())for(;M<w;++M){var N={accum:null,value:V[M],index:M,length:w,array:this};F=F._then(Z,void 0,void 0,N,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(H,H,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,M,w){return X(V,F,M,w)};function H(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,M,w){if(typeof F!=="function")return z("expecting a function but got "+I.classString(F));var N=new W(V,F,M,w);return N.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=U(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,M=F._promise,w=G(F._fn);M._pushContext();var N;if(F._eachValues!==void 0)N=w.call(M._boundValue(),V,this.index,this.length);else N=w.call(M._boundValue(),this.accum,V,this.index,this.length);if(N instanceof $)F._currentCancellable=N;var O=M._popContext();return J.checkForgottenReturns(N,O,F._eachValues!==void 0?"Promise.each":"Promise.reduce",M),N}}});var hw0=E((Lt1,vw0)=>{vw0.exports=function($,Y,z){var U=$.PromiseInspection,Q=F4();function J(K){this.constructor$(K)}Q.inherits(J,Y),J.prototype._promiseResolved=function(K,I){this._values[K]=I;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(K,I){var G=new U;return G._bitField=33554432,G._settledValueField=K,this._promiseResolved(I,G)},J.prototype._promiseRejected=function(K,I){var G=new U;return G._bitField=16777216,G._settledValueField=K,this._promiseResolved(I,G)},$.settle=function(K){return z.deprecated(".settle()",".reflect()"),new J(K).promise()},$.prototype.settle=function(){return $.settle(this)}}});var gw0=E((Ft1,Sw0)=>{Sw0.exports=function($,Y,z){var U=F4(),Q=E3().RangeError,J=E3().AggregateError,K=U.isArray,I={};function G(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(G,Y),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var H=K(this._values);if(!this._isResolved()&&H&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(H){this._howMany=H},G.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()=
Line truncated
|
||||
`);else if(V instanceof $)q=V._then($.props,void 0,void 0,void 0,void 0);else q=new H(V).promise();if(V instanceof $)q._propagateFrom(V,2);return q}$.prototype.props=function(){return X(this)},$.props=function(Z){return X(Z)}}});var vM0=E((Et1,_M0)=>{_M0.exports=function($,Y,z,U){var Q=F4(),J=function(I){return I.then(function(G){return K(G,I)})};function K(I,G){var W=z(I);if(W instanceof $)return J(W);else if(I=Q.asArray(I),I===null)return U("expecting an array or an iterable object but got "+Q.classString(I));var H=new $(Y);if(G!==void 0)H._propagateFrom(G,3);var{_fulfill:X,_reject:Z}=H;for(var q=0,V=I.length;q<V;++q){var F=I[q];if(F===void 0&&!(q in I))continue;$.cast(F)._then(X,Z,void 0,H,null)}return H}$.race=function(I){return K(I,void 0)},$.prototype.race=function(){return K(this,void 0)}}});var SM0=E((Ct1,hM0)=>{hM0.exports=function($,Y,z,U,Q,J){var K=$._getDomain,I=F4(),G=I.tryCatch;function W(V,F,w,M){this.constructor$(V);var O=K();if(this._fn=O===null?F:I.domainBind(O,F),w!==void 0)w=$.resolve(w),w._attachCancellationCallback(this);if(this._initialValue=w,this._currentCancellable=null,M===Q)this._eachValues=Array(this._length);else if(M===0)this._eachValues=null;else this._eachValues=void 0;this._promise._captureStackTrace(),this._init$(void 0,-5)}I.inherits(W,Y),W.prototype._gotAccum=function(V){if(this._eachValues!==void 0&&this._eachValues!==null&&V!==Q)this._eachValues.push(V)},W.prototype._eachComplete=function(V){if(this._eachValues!==null)this._eachValues.push(V);return this._eachValues},W.prototype._init=function(){},W.prototype._resolveEmptyArray=function(){this._resolve(this._eachValues!==void 0?this._eachValues:this._initialValue)},W.prototype.shouldCopyValues=function(){return!1},W.prototype._resolve=function(V){this._promise._resolveCallback(V),this._values=null},W.prototype._resultCancelled=function(V){if(V===this._initialValue)return this._cancel();if(this._isResolved())return;if(this._resultCancelled$(),this._currentCancellable instanceof $)this._currentCancellable.cancel();if(this._initialValue instanceof $)this._initialValue.cancel()},W.prototype._iterate=function(V){this._values=V;var F,w,M=V.length;if(this._initialValue!==void 0)F=this._initialValue,w=0;else F=$.resolve(V[0]),w=1;if(this._currentCancellable=F,!F.isRejected())for(;w<M;++w){var O={accum:null,value:V[w],index:w,length:M,array:this};F=F._then(Z,void 0,void 0,O,void 0)}if(this._eachValues!==void 0)F=F._then(this._eachComplete,void 0,void 0,this,void 0);F._then(H,H,void 0,F,this)},$.prototype.reduce=function(V,F){return X(this,V,F,null)},$.reduce=function(V,F,w,M){return X(V,F,w,M)};function H(V,F){if(this.isFulfilled())F._resolve(V);else F._reject(V)}function X(V,F,w,M){if(typeof F!=="function")return z("expecting a function but got "+I.classString(F));var O=new W(V,F,w,M);return O.promise()}function Z(V){this.accum=V,this.array._gotAccum(V);var F=U(this.value,this.array._promise);if(F instanceof $)return this.array._currentCancellable=F,F._then(q,void 0,void 0,this,void 0);else return q.call(this,F)}function q(V){var F=this.array,w=F._promise,M=G(F._fn);w._pushContext();var O;if(F._eachValues!==void 0)O=M.call(w._boundValue(),V,this.index,this.length);else O=M.call(w._boundValue(),this.accum,V,this.index,this.length);if(O instanceof $)F._currentCancellable=O;var N=w._popContext();return J.checkForgottenReturns(O,N,F._eachValues!==void 0?"Promise.each":"Promise.reduce",w),O}}});var yM0=E((Rt1,gM0)=>{gM0.exports=function($,Y,z){var U=$.PromiseInspection,Q=F4();function J(K){this.constructor$(K)}Q.inherits(J,Y),J.prototype._promiseResolved=function(K,I){this._values[K]=I;var G=++this._totalResolved;if(G>=this._length)return this._resolve(this._values),!0;return!1},J.prototype._promiseFulfilled=function(K,I){var G=new U;return G._bitField=33554432,G._settledValueField=K,this._promiseResolved(I,G)},J.prototype._promiseRejected=function(K,I){var G=new U;return G._bitField=16777216,G._settledValueField=K,this._promiseResolved(I,G)},$.settle=function(K){return z.deprecated(".settle()",".reflect()"),new J(K).promise()},$.prototype.settle=function(){return $.settle(this)}}});var xM0=E((_t1,kM0)=>{kM0.exports=function($,Y,z){var U=F4(),Q=E3().RangeError,J=E3().AggregateError,K=U.isArray,I={};function G(H){this.constructor$(H),this._howMany=0,this._unwrap=!1,this._initialized=!1}U.inherits(G,Y),G.prototype._init=function(){if(!this._initialized)return;if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var H=K(this._values);if(!this._isResolved()&&H&&this._howMany>this._canPossiblyFulfill())this._reject(this._getRangeError(this.length()))},G.prototype.init=function(){this._initialized=!0,this._init()},G.prototype.setUnwrap=function(){this._unwrap=!0},G.prototype.howMany=function(){return this._howMany},G.prototype.setHowMany=function(H){this._howMany=H},G.prototype._promiseFulfilled=function(H){if(this._addFulfilled(H),this._fulfilled()===this.howMany()){if(this._values.length=this.howMany(),this.howMany()=
Line truncated
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`);var Z=new G(H),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(H,X){return W(H,X)},$.prototype.some=function(H){return W(this,H)},$._SomePromiseArray=G}});var kw0=E((wt1,yw0)=>{yw0.exports=function($,Y){var z=$.map;$.prototype.filter=function(U,Q){return z(this,U,Q,Y)},$.filter=function(U,Q,J){return z(U,Q,J,Y)}}});var fw0=E((Mt1,xw0)=>{xw0.exports=function($,Y){var{reduce:z,all:U}=$;function Q(){return U(this)}function J(K,I){return z(K,I,Y,Y)}$.prototype.each=function(K){return z(this,K,Y,0)._then(Q,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(K){return z(this,K,Y,Y)},$.each=function(K,I){return z(K,I,Y,0)._then(Q,void 0,void 0,K,void 0)},$.mapSeries=J}});var bw0=E((Ot1,uw0)=>{uw0.exports=function($){var Y=$._SomePromiseArray;function z(U){var Q=new Y(U),J=Q.promise();return Q.setHowMany(1),Q.setUnwrap(),Q.init(),J}$.any=function(U){return z(U)},$.prototype.any=function(){return z(this)}}});var iw0=E((Nt1,qc)=>{qc.exports=function(){var $=function(){return new X(`circular promise resolution chain
|
||||
`);var Z=new G(H),q=Z.promise();return Z.setHowMany(X),Z.init(),q}$.some=function(H,X){return W(H,X)},$.prototype.some=function(H){return W(this,H)},$._SomePromiseArray=G}});var uM0=E((vt1,fM0)=>{fM0.exports=function($,Y){var z=$.map;$.prototype.filter=function(U,Q){return z(this,U,Q,Y)},$.filter=function(U,Q,J){return z(U,Q,J,Y)}}});var iM0=E((ht1,bM0)=>{bM0.exports=function($,Y){var{reduce:z,all:U}=$;function Q(){return U(this)}function J(K,I){return z(K,I,Y,Y)}$.prototype.each=function(K){return z(this,K,Y,0)._then(Q,void 0,void 0,this,void 0)},$.prototype.mapSeries=function(K){return z(this,K,Y,Y)},$.each=function(K,I){return z(K,I,Y,0)._then(Q,void 0,void 0,K,void 0)},$.mapSeries=J}});var nM0=E((St1,cM0)=>{cM0.exports=function($){var Y=$._SomePromiseArray;function z(U){var Q=new Y(U),J=Q.promise();return Q.setHowMany(1),Q.setUnwrap(),Q.init(),J}$.any=function(U){return z(U)},$.prototype.any=function(){return z(this)}}});var pM0=E((gt1,Vc)=>{Vc.exports=function(){var $=function(){return new X(`circular promise resolution chain
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)},Y=function(){return new S.PromiseInspection(this._target())},z=function(k){return S.reject(new X(k))};function U(){}var Q={},J=F4(),K;if(J.isNode)K=function(){var k=process.domain;if(k===void 0)k=null;return k};else K=function(){return null};J.notEnumerableProp(S,"_getDomain",K);var I=sz(),G=gF0(),W=new G;I.defineProperty(S,"_async",{value:W});var H=E3(),X=S.TypeError=H.TypeError;S.RangeError=H.RangeError;var Z=S.CancellationError=H.CancellationError;S.TimeoutError=H.TimeoutError,S.OperationalError=H.OperationalError,S.RejectionError=H.OperationalError,S.AggregateError=H.AggregateError;var q=function(){},V={},F={},M=uF0()(S,q),w=iF0()(S,q,M,z,U),N=nF0()(S),O=N.create,D=dF0()(S,N),P=D.CapturedTrace,T=lF0()(S,M),A=rF0()(F),j=Xc(),C=J.errorObj,b=J.tryCatch;function x(k,d){if(typeof d!=="function")throw new X("expecting a function but got "+J.classString(d));if(k.constructor!==S)throw new X(`the promise constructor cannot be invoked directly
|
||||
`)},Y=function(){return new S.PromiseInspection(this._target())},z=function(k){return S.reject(new X(k))};function U(){}var Q={},J=F4(),K;if(J.isNode)K=function(){var k=process.domain;if(k===void 0)k=null;return k};else K=function(){return null};J.notEnumerableProp(S,"_getDomain",K);var I=az(),G=xF0(),W=new G;I.defineProperty(S,"_async",{value:W});var H=E3(),X=S.TypeError=H.TypeError;S.RangeError=H.RangeError;var Z=S.CancellationError=H.CancellationError;S.TimeoutError=H.TimeoutError,S.OperationalError=H.OperationalError,S.RejectionError=H.OperationalError,S.AggregateError=H.AggregateError;var q=function(){},V={},F={},w=cF0()(S,q),M=pF0()(S,q,w,z,U),O=mF0()(S),N=O.create,D=oF0()(S,O),P=D.CapturedTrace,T=sF0()(S,w),A=tF0()(F),j=Zc(),C=J.errorObj,b=J.tryCatch;function x(k,d){if(typeof d!=="function")throw new X("expecting a function but got "+J.classString(d));if(k.constructor!==S)throw new X(`the promise constructor cannot be invoked directly
|
||||
|
||||
See http://goo.gl/MqrFmX
|
||||
`)}function S(k){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,k!==q)x(this,k),this._resolveFromExecutor(k);this._promiseCreated(),this._fireEvent("promiseCreated",this)}S.prototype.toString=function(){return"[object Promise]"},S.prototype.caught=S.prototype.catch=function(k){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(J.isObject(p))t[$0++]=p;else return z("expecting an object but got A catch statement predicate "+J.classString(p))}return t.length=$0,k=arguments[g],this.then(void 0,A(t,k,this))}return this.then(void 0,k)},S.prototype.reflect=function(){return this._then(Y,Y,void 0,this,void 0)},S.prototype.then=function(k,d){if(D.warnings()&&arguments.length>0&&typeof k!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+J.classString(k);if(arguments.length>1)t+=", "+J.classString(d);this._warn(t)}return this._then(k,d,void 0,void 0,void 0)},S.prototype.done=function(k,d){var t=this._then(k,d,void 0,void 0,void 0);t._setIsFinal()},S.prototype.spread=function(k){if(typeof k!=="function")return z("expecting a function but got "+J.classString(k));return this.all()._then(k,void 0,void 0,V,void 0)},S.prototype.toJSON=function(){var k={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())k.fulfillmentValue=this.value(),k.isFulfilled=!0;else if(this.isRejected())k.rejectionReason=this.reason(),k.isRejected=!0;return k},S.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new w(this).promise()},S.prototype.error=function(k){return this.caught(J.originatesFromRejection,k)},S.getNewLibraryCopy=qc.exports,S.is=function(k){return k instanceof S},S.fromNode=S.fromCallback=function(k){var d=new S(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(k)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},S.all=function(k){return new w(k).promise()},S.cast=function(k){var d=M(k);if(!(d instanceof S))d=new S(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=k;return d},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(k){var d=new S(q);return d._captureStackTrace(),d._rejectCallback(k,!0),d},S.setScheduler=function(k){if(typeof k!=="function")throw new X("expecting a function but got "+J.classString(k));return W.setScheduler(k)},S.prototype._then=function(k,d,t,$0,g){var p=g!==void 0,e=p?g:new S(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var Y0=K();if((s&50397184)!==0){var N0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,N0=k;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,N0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),N0=d;W.invoke(G0,y,{handler:Y0===null?N0:typeof N0==="function"&&J.domainBind(Y0,N0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(k,d,e,$0,Y0);return e},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(k){this._bitField=this._bitField&-65536|k&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(W.hasCustomScheduler())return;this._bitField=this._bitField|134217728},S.prototype._receiverAt=function(k){var d=k===0?this._receiver0:this[k*4-4+3];if(d===Q)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},S.prototype._promiseAt=function(k){return this[k*4-4+2]},S.prototype._fulfillmentHandlerAt=function(k){return this[k*4-4+0]},S.prototype._rejectionHandlerAt=function(k){return this[k*4-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(k){var{_bitField:d,_fulfillmentHandler
Line truncated
|
||||
`)}function S(k){if(this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,k!==q)x(this,k),this._resolveFromExecutor(k);this._promiseCreated(),this._fireEvent("promiseCreated",this)}S.prototype.toString=function(){return"[object Promise]"},S.prototype.caught=S.prototype.catch=function(k){var d=arguments.length;if(d>1){var t=Array(d-1),$0=0,g;for(g=0;g<d-1;++g){var p=arguments[g];if(J.isObject(p))t[$0++]=p;else return z("expecting an object but got A catch statement predicate "+J.classString(p))}return t.length=$0,k=arguments[g],this.then(void 0,A(t,k,this))}return this.then(void 0,k)},S.prototype.reflect=function(){return this._then(Y,Y,void 0,this,void 0)},S.prototype.then=function(k,d){if(D.warnings()&&arguments.length>0&&typeof k!=="function"&&typeof d!=="function"){var t=".then() only accepts functions but was passed: "+J.classString(k);if(arguments.length>1)t+=", "+J.classString(d);this._warn(t)}return this._then(k,d,void 0,void 0,void 0)},S.prototype.done=function(k,d){var t=this._then(k,d,void 0,void 0,void 0);t._setIsFinal()},S.prototype.spread=function(k){if(typeof k!=="function")return z("expecting a function but got "+J.classString(k));return this.all()._then(k,void 0,void 0,V,void 0)},S.prototype.toJSON=function(){var k={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};if(this.isFulfilled())k.fulfillmentValue=this.value(),k.isFulfilled=!0;else if(this.isRejected())k.rejectionReason=this.reason(),k.isRejected=!0;return k},S.prototype.all=function(){if(arguments.length>0)this._warn(".all() was passed arguments but it does not take any");return new M(this).promise()},S.prototype.error=function(k){return this.caught(J.originatesFromRejection,k)},S.getNewLibraryCopy=Vc.exports,S.is=function(k){return k instanceof S},S.fromNode=S.fromCallback=function(k){var d=new S(q);d._captureStackTrace();var t=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,$0=b(k)(j(d,t));if($0===C)d._rejectCallback($0.e,!0);if(!d._isFateSealed())d._setAsyncGuaranteed();return d},S.all=function(k){return new M(k).promise()},S.cast=function(k){var d=w(k);if(!(d instanceof S))d=new S(q),d._captureStackTrace(),d._setFulfilled(),d._rejectionHandler0=k;return d},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(k){var d=new S(q);return d._captureStackTrace(),d._rejectCallback(k,!0),d},S.setScheduler=function(k){if(typeof k!=="function")throw new X("expecting a function but got "+J.classString(k));return W.setScheduler(k)},S.prototype._then=function(k,d,t,$0,g){var p=g!==void 0,e=p?g:new S(q),y=this._target(),s=y._bitField;if(!p){if(e._propagateFrom(this,3),e._captureStackTrace(),$0===void 0&&(this._bitField&2097152)!==0)if((s&50397184)!==0)$0=this._boundValue();else $0=y===this?void 0:this._boundTo;this._fireEvent("promiseChained",this,e)}var Y0=K();if((s&50397184)!==0){var N0,E0,G0=y._settlePromiseCtx;if((s&33554432)!==0)E0=y._rejectionHandler0,N0=k;else if((s&16777216)!==0)E0=y._fulfillmentHandler0,N0=d,y._unsetRejectionIsUnhandled();else G0=y._settlePromiseLateCancellationObserver,E0=new Z("late cancellation observer"),y._attachExtraTrace(E0),N0=d;W.invoke(G0,y,{handler:Y0===null?N0:typeof N0==="function"&&J.domainBind(Y0,N0),promise:e,receiver:$0,value:E0})}else y._addCallbacks(k,d,e,$0,Y0);return e},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(k){this._bitField=this._bitField&-65536|k&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(W.hasCustomScheduler())return;this._bitField=this._bitField|134217728},S.prototype._receiverAt=function(k){var d=k===0?this._receiver0:this[k*4-4+3];if(d===Q)return;else if(d===void 0&&this._isBound())return this._boundValue();return d},S.prototype._promiseAt=function(k){return this[k*4-4+2]},S.prototype._fulfillmentHandlerAt=function(k){return this[k*4-4+0]},S.prototype._rejectionHandlerAt=function(k){return this[k*4-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(k){var{_bitField:d,_fulfillmentHandler
Line truncated
|
||||
path = %s
|
||||
syscall = %s
|
||||
fstream_type = %s
|
||||
@@ -295,25 +295,28 @@ fstream_class = %s
|
||||
fstream_stack =
|
||||
%s
|
||||
`,Y||"UNKNOWN",U.stack,U.path,U.syscall,U.fstream_type,U.fstream_path,U.fstream_unc_path,U.fstream_class,U.fstream_stack.join(`
|
||||
`));else z.emit("warn",U)};S2.prototype.info=function($,Y){this.emit("info",$,Y)};S2.prototype.error=function($,Y,z){var U=NO0($,Y,this);if(z)throw U;else this.emit("error",U)};function NO0($,Y,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||Y,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var qZ=E((st1,AO0)=>{AO0.exports=Fw1;function Fw1($){var Y=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&Y.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,Q=Y.length;U<Q;U++){z=Y[U];var J=$[z]||$["is"+z];if(typeof J==="function")J=J.call($);if(J)return $[z]=!0,$.type=z,z}return null}});var ec=E((at1,BO0)=>{BO0.exports=VZ;var ww1=m8(),Mw1=X1(),tc=JU();Mw1(VZ,tc);function VZ($){var Y=this;if(!(Y instanceof VZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);tc.call(Y,$)}VZ.prototype._stat=function($){var Y=this;ww1.readlink(Y._path,function(z,U){if(z)return Y.error(z);Y.linkpath=Y.props.linkpath=U,Y.emit("linkpath",U),tc.prototype._stat.call(Y,$)})};VZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Yn=E((tt1,jO0)=>{jO0.exports=N9;var TO0=m8(),Ow1=X1(),LZ=K0("path"),$n=JU(),PO0=K0("assert").ok;Ow1(N9,$n);function N9($){var Y=this;if(!(Y instanceof N9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(Y.entries=null,Y._index=-1,Y._paused=!1,Y._length=-1,$.sort)this.sort=$.sort;$n.call(this,$)}N9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,TO0.readdir($._path,function(Y,z){if(Y)return $.error(Y);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};N9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var Y=LZ.resolve($._path,$.entries[$._index]);PO0(Y!==$._path),PO0($.entries[$._index]),$._currentEntry=Y,TO0[$.props.follow?"stat":"lstat"](Y,function(z,U){if(z)return $.error(z);var Q=$._proxy||$;U.path=Y,U.basename=LZ.basename(Y),U.dirname=LZ.dirname(Y);var J=$.getChildProps.call(Q,U);J.path=Y,J.basename=LZ.basename(Y),J.dirname=LZ.dirname(Y);var K=$n(J,U);$._currentEntry=K,K.on("pause",function(W){if(!$._paused&&!K._disowned)$.pause(W)}),K.on("resume",function(W){if($._paused&&!K._disowned)$.resume(W)}),K.on("stat",function(W){if($.emit("_entryStat",K,W),K._aborted)return;if(K._paused)K.once("resume",function(){$.emit("entryStat",K,W)});else $.emit("entryStat",K,W)}),K.on("ready",function W(){if($._paused)return K.pause($),$.once("resume",W);if(K.type==="Socket")$.emit("socket",K);else $.emitEntry(K)});var I=!1;K.on("close",G),K.on("disown",G);function G(){if(I)return;if(I=!0,$.emit("childEnd",K),$.emit("entryEnd",K),$._currentEntry=null,!$._paused)$._read()}K.on("error",function(W){if(K._swallowErrors)$.warn(W),K.emit("end"),K.emit("close");else $.emit("error",W)}),["child","childEnd","warn"].forEach(function(W){K.on(W,$.emit.bind($,W))})})};N9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};N9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};N9.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._currentEntry&&Y._currentEntry.pause)Y._currentEntry.pause($);Y.emit("pause",$)};N9.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y._paused=!1,Y.emit("resume",$),Y._paused)return;if(Y._currentEntry){if(Y._currentEntry.resume)Y._currentEntry.resume($)}else Y._read()};N9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var zn=E((et1,_O0)=>{_O0.exports=KU;var Nw1=m8(),Dw1=X1(),EO0=JU(),CO0={EOF:!0},RO0={CLOSE:!0};Dw1(KU,EO0);function KU($){var Y=this;if(!(Y instanceof KU))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);Y._buffer=[],Y._bytesEmitted=0,EO0.call(Y,$)}KU.prototype._getStream=function(){var $=this,Y=$._stream=Nw1.createReadStream($._path,$.p
Line truncated
|
||||
`));else z.emit("warn",U)};g2.prototype.info=function($,Y){this.emit("info",$,Y)};g2.prototype.error=function($,Y,z){var U=BO0($,Y,this);if(z)throw U;else this.emit("error",U)};function BO0($,Y,z){if(!($ instanceof Error))$=Error($);if($.code=$.code||Y,$.path=$.path||z.path,$.fstream_type=$.fstream_type||z.type,$.fstream_path=$.fstream_path||z.path,z._path!==z.path)$.fstream_unc_path=$.fstream_unc_path||z._path;if(z.linkpath)$.fstream_linkpath=$.fstream_linkpath||z.linkpath;return $.fstream_class=$.fstream_class||z.constructor.name,$.fstream_stack=$.fstream_stack||Error().stack.split(/\n/).slice(3).map(function(U){return U.replace(/^ {4}at /,"")}),$}});var qZ=E((He1,TO0)=>{TO0.exports=jM1;function jM1($){var Y=["Directory","File","SymbolicLink","Link","BlockDevice","CharacterDevice","FIFO","Socket"],z;if($.type&&Y.indexOf($.type)!==-1)return $[$.type]=!0,$.type;for(var U=0,Q=Y.length;U<Q;U++){z=Y[U];var J=$[z]||$["is"+z];if(typeof J==="function")J=J.call($);if(J)return $[z]=!0,$.type=z,z}return null}});var $n=E((Xe1,jO0)=>{jO0.exports=VZ;var EM1=l8(),CM1=X1(),ec=KU();CM1(VZ,ec);function VZ($){var Y=this;if(!(Y instanceof VZ))throw Error("LinkReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="SymbolicLink"&&$.SymbolicLink))throw Error("Non-link type "+$.type);ec.call(Y,$)}VZ.prototype._stat=function($){var Y=this;EM1.readlink(Y._path,function(z,U){if(z)return Y.error(z);Y.linkpath=Y.props.linkpath=U,Y.emit("linkpath",U),ec.prototype._stat.call(Y,$)})};VZ.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var zn=E((Ze1,RO0)=>{RO0.exports=N9;var CO0=l8(),RM1=X1(),LZ=K0("path"),Yn=KU(),EO0=K0("assert").ok;RM1(N9,Yn);function N9($){var Y=this;if(!(Y instanceof N9))throw Error("DirReader must be called as constructor.");if($.type!=="Directory"||!$.Directory)throw Error("Non-directory type "+$.type);if(Y.entries=null,Y._index=-1,Y._paused=!1,Y._length=-1,$.sort)this.sort=$.sort;Yn.call(this,$)}N9.prototype._getEntries=function(){var $=this;if($._gotEntries)return;$._gotEntries=!0,CO0.readdir($._path,function(Y,z){if(Y)return $.error(Y);if($.entries=z,$.emit("entries",z),$._paused)$.once("resume",U);else U();function U(){if($._length=$.entries.length,typeof $.sort==="function")$.entries=$.entries.sort($.sort.bind($));$._read()}})};N9.prototype._read=function(){var $=this;if(!$.entries)return $._getEntries();if($._paused||$._currentEntry||$._aborted)return;if($._index++,$._index>=$.entries.length){if(!$._ended)$._ended=!0,$.emit("end"),$.emit("close");return}var Y=LZ.resolve($._path,$.entries[$._index]);EO0(Y!==$._path),EO0($.entries[$._index]),$._currentEntry=Y,CO0[$.props.follow?"stat":"lstat"](Y,function(z,U){if(z)return $.error(z);var Q=$._proxy||$;U.path=Y,U.basename=LZ.basename(Y),U.dirname=LZ.dirname(Y);var J=$.getChildProps.call(Q,U);J.path=Y,J.basename=LZ.basename(Y),J.dirname=LZ.dirname(Y);var K=Yn(J,U);$._currentEntry=K,K.on("pause",function(W){if(!$._paused&&!K._disowned)$.pause(W)}),K.on("resume",function(W){if($._paused&&!K._disowned)$.resume(W)}),K.on("stat",function(W){if($.emit("_entryStat",K,W),K._aborted)return;if(K._paused)K.once("resume",function(){$.emit("entryStat",K,W)});else $.emit("entryStat",K,W)}),K.on("ready",function W(){if($._paused)return K.pause($),$.once("resume",W);if(K.type==="Socket")$.emit("socket",K);else $.emitEntry(K)});var I=!1;K.on("close",G),K.on("disown",G);function G(){if(I)return;if(I=!0,$.emit("childEnd",K),$.emit("entryEnd",K),$._currentEntry=null,!$._paused)$._read()}K.on("error",function(W){if(K._swallowErrors)$.warn(W),K.emit("end"),K.emit("close");else $.emit("error",W)}),["child","childEnd","warn"].forEach(function(W){K.on(W,$.emit.bind($,W))})})};N9.prototype.disown=function($){if($.emit("beforeDisown"),$._disowned=!0,$.parent=$.root=null,$===this._currentEntry)this._currentEntry=null;$.emit("disown")};N9.prototype.getChildProps=function(){return{depth:this.depth+1,root:this.root||this,parent:this,follow:this.follow,filter:this.filter,sort:this.props.sort,hardlinks:this.props.hardlinks}};N9.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._currentEntry&&Y._currentEntry.pause)Y._currentEntry.pause($);Y.emit("pause",$)};N9.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y._paused=!1,Y.emit("resume",$),Y._paused)return;if(Y._currentEntry){if(Y._currentEntry.resume)Y._currentEntry.resume($)}else Y._read()};N9.prototype.emitEntry=function($){this.emit("entry",$),this.emit("child",$)}});var Un=E((qe1,SO0)=>{SO0.exports=IU;var _M1=l8(),vM1=X1(),_O0=KU(),vO0={EOF:!0},hO0={CLOSE:!0};vM1(IU,_O0);function IU($){var Y=this;if(!(Y instanceof IU))throw Error("FileReader must be called as constructor.");if(!($.type==="Link"&&$.Link||$.type==="File"&&$.File))throw Error("Non-file type "+$.type);Y._buffer=[],Y._bytesEmitted=0,_O0.call(Y,$)}IU.prototype._getStream=function(){var $=this,Y=$._stream=_M1.createReadStream($._path,$.p
Line truncated
|
||||
expect: `+$.props.size+`
|
||||
actual: `+$._bytesEmitted)}),Y.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(RO0),$._read();else $.emit("close")}),Y.on("error",function(z){$.emit("error",z)}),$._read()};KU.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var Y=$._buffer;for(var z=0,U=Y.length;z<U;z++){var Q=Y[z];if(Q===CO0)$.emit("end");else if(Q===RO0)$.emit("close");else $.emit("data",Q);if($._paused){$._buffer=Y.slice(z);return}}$._buffer.length=0}};KU.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._stream)Y._stream.pause();Y.emit("pause",$)};KU.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y.emit("resume",$),Y._paused=!1,Y._stream)Y._stream.resume();Y._read()}});var SO0=E(($e1,hO0)=>{hO0.exports=KB;var Aw1=X1(),vO0=JU();Aw1(KB,vO0);function KB($){var Y=this;if(!(Y instanceof KB))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);vO0.call(Y,$)}KB.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Qn=E((Ye1,gO0)=>{gO0.exports=IU;var Un=JU(),Bw1=qZ(),Pw1=X1(),Tw1=m8();Pw1(IU,Un);function IU($){var Y=this;if(!(Y instanceof IU))throw Error("ProxyReader must be called as constructor.");Y.props=$,Y._buffer=[],Y.ready=!1,Un.call(Y,$)}IU.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";Tw1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=Bw1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(Un(Y,Q))})};IU.prototype._addProxy=function($){var Y=this;if(Y._proxyTarget)return Y.error("proxy already set");Y._proxyTarget=$,$._proxy=Y,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$),$.on("ready",function(){Y.ready=!0,Y.emit("ready")});var z=Y._buffer;Y._buffer.length=0,z.forEach(function(U){$[U[0]].apply($,U[1])})};IU.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};IU.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var JU=E((ze1,xO0)=>{xO0.exports=O5;var jw1=m8(),Ew1=K0("stream").Stream,Cw1=X1(),Jn=K0("path"),Kn=qZ(),IB=O5.hardLinks={},yO0=JB();Cw1(O5,yO0);var kO0=ec();function O5($,Y){var z=this;if(!(z instanceof O5))return new O5($,Y);if(typeof $==="string")$={path:$};var U,Q;if($.type&&typeof $.type==="function")U=$.type,Q=U;else U=Kn($),Q=O5;if(Y&&!U)U=Kn(Y),$[U]=!0,$.type=U;switch(U){case"Directory":Q=Yn();break;case"Link":case"File":Q=zn();break;case"SymbolicLink":Q=kO0;break;case"Socket":Q=SO0();break;case null:Q=Qn();break}if(!(z instanceof Q))return new Q($);if(yO0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=U,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=Jn.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=Jn.basename(z.path),z.dirname=$.dirname=Jn.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=Rw1;z._stat(Y)}function Rw1($,Y){return $===Y?0:$.toLowerCase()>Y.toLowerCase()?1:$.toLowerCase()<Y.toLowerCase()?-1:$>Y?1:-1}O5.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat";if($)process.nextTick(Q.bind(null,null,$));else jw1[U](Y._path,Q);function Q(J,K){if(J)return Y.error(J);if(Object.keys(K).forEach(function(q){z[q]=K[q]}),Y.size!==void 0&&z.size!==Y.size)return Y.error("incorrect size");Y.size=z.size;var I=Kn(z),G=z.hardlinks!==!1;if(G&&I!=="Directory"&&z.nlink&&z.nlink>1){var W=z.dev+":"+z.ino;if(IB[W]===Y._path||!IB[W])IB[W]=Y._path;else I=Y.type=Y.props.type="Link",Y.Link=Y.props.Link=!0,Y.linkpath=Y.props.linkpath=IB[W],Y._stat=Y._read=kO0.prototype._read}if(Y.type&&Y.type!==I)Y.error("Unexpected type: "+I);if(Y.filter){var H=Y._proxy||Y;if(!Y.filter.call(H,H,z)){if(!Y._disowned)Y.abort(),Y.emit("end"),Y.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(Y._aborted){Y.emit("end"),Y.emit("close");return}if(Y._paused&&Y.type!=="Directory"){Y.once("resume",q);return}var V=X[Z++];if(!V)return Y._read();Y.emit(V,z),q()})()}};O5.prototype.pipe=function($){var Y=this;if(typeof $.add==="function")Y.on("entry",function(z){var U=$.add(z);if(U===!1)Y.pause()});return Ew1.prototype.pipe.apply(this,arguments)};O5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};O5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};O5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Hn=E((Ue1,dO0)=>
Line truncated
|
||||
actual: `+$._bytesEmitted)}),Y.on("close",function(){if($._paused||$._buffer.length)$._buffer.push(hO0),$._read();else $.emit("close")}),Y.on("error",function(z){$.emit("error",z)}),$._read()};IU.prototype._read=function(){var $=this;if($._paused)return;if(!$._stream)return $._getStream();if($._buffer.length){var Y=$._buffer;for(var z=0,U=Y.length;z<U;z++){var Q=Y[z];if(Q===vO0)$.emit("end");else if(Q===hO0)$.emit("close");else $.emit("data",Q);if($._paused){$._buffer=Y.slice(z);return}}$._buffer.length=0}};IU.prototype.pause=function($){var Y=this;if(Y._paused)return;if($=$||Y,Y._paused=!0,Y._stream)Y._stream.pause();Y.emit("pause",$)};IU.prototype.resume=function($){var Y=this;if(!Y._paused)return;if($=$||Y,Y.emit("resume",$),Y._paused=!1,Y._stream)Y._stream.resume();Y._read()}});var kO0=E((Ve1,yO0)=>{yO0.exports=IB;var hM1=X1(),gO0=KU();hM1(IB,gO0);function IB($){var Y=this;if(!(Y instanceof IB))throw Error("SocketReader must be called as constructor.");if(!($.type==="Socket"&&$.Socket))throw Error("Non-socket type "+$.type);gO0.call(Y,$)}IB.prototype._read=function(){var $=this;if($._paused)return;if(!$._ended)$.emit("end"),$.emit("close"),$._ended=!0}});var Jn=E((Le1,xO0)=>{xO0.exports=GU;var Qn=KU(),SM1=qZ(),gM1=X1(),yM1=l8();gM1(GU,Qn);function GU($){var Y=this;if(!(Y instanceof GU))throw Error("ProxyReader must be called as constructor.");Y.props=$,Y._buffer=[],Y.ready=!1,Qn.call(Y,$)}GU.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";yM1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=SM1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(Qn(Y,Q))})};GU.prototype._addProxy=function($){var Y=this;if(Y._proxyTarget)return Y.error("proxy already set");Y._proxyTarget=$,$._proxy=Y,["error","data","end","close","linkpath","entry","entryEnd","child","childEnd","warn","stat"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$),$.on("ready",function(){Y.ready=!0,Y.emit("ready")});var z=Y._buffer;Y._buffer.length=0,z.forEach(function(U){$[U[0]].apply($,U[1])})};GU.prototype.pause=function(){return this._proxyTarget?this._proxyTarget.pause():!1};GU.prototype.resume=function(){return this._proxyTarget?this._proxyTarget.resume():!1}});var KU=E((Fe1,bO0)=>{bO0.exports=O5;var kM1=l8(),xM1=K0("stream").Stream,fM1=X1(),Kn=K0("path"),In=qZ(),GB=O5.hardLinks={},fO0=KB();fM1(O5,fO0);var uO0=$n();function O5($,Y){var z=this;if(!(z instanceof O5))return new O5($,Y);if(typeof $==="string")$={path:$};var U,Q;if($.type&&typeof $.type==="function")U=$.type,Q=U;else U=In($),Q=O5;if(Y&&!U)U=In(Y),$[U]=!0,$.type=U;switch(U){case"Directory":Q=zn();break;case"Link":case"File":Q=Un();break;case"SymbolicLink":Q=uO0;break;case"Socket":Q=kO0();break;case null:Q=Jn();break}if(!(z instanceof Q))return new Q($);if(fO0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.readable=!0,z.writable=!1,z.type=U,z.props=$,z.depth=$.depth=$.depth||0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=Kn.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=$.basename=Kn.basename(z.path),z.dirname=$.dirname=Kn.dirname(z.path),$.parent=$.root=null,z.size=$.size,z.filter=typeof $.filter==="function"?$.filter:null,$.sort==="alpha")$.sort=uM1;z._stat(Y)}function uM1($,Y){return $===Y?0:$.toLowerCase()>Y.toLowerCase()?1:$.toLowerCase()<Y.toLowerCase()?-1:$>Y?1:-1}O5.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat";if($)process.nextTick(Q.bind(null,null,$));else kM1[U](Y._path,Q);function Q(J,K){if(J)return Y.error(J);if(Object.keys(K).forEach(function(q){z[q]=K[q]}),Y.size!==void 0&&z.size!==Y.size)return Y.error("incorrect size");Y.size=z.size;var I=In(z),G=z.hardlinks!==!1;if(G&&I!=="Directory"&&z.nlink&&z.nlink>1){var W=z.dev+":"+z.ino;if(GB[W]===Y._path||!GB[W])GB[W]=Y._path;else I=Y.type=Y.props.type="Link",Y.Link=Y.props.Link=!0,Y.linkpath=Y.props.linkpath=GB[W],Y._stat=Y._read=uO0.prototype._read}if(Y.type&&Y.type!==I)Y.error("Unexpected type: "+I);if(Y.filter){var H=Y._proxy||Y;if(!Y.filter.call(H,H,z)){if(!Y._disowned)Y.abort(),Y.emit("end"),Y.emit("close");return}}var X=["_stat","stat","ready"],Z=0;(function q(){if(Y._aborted){Y.emit("end"),Y.emit("close");return}if(Y._paused&&Y.type!=="Directory"){Y.once("resume",q);return}var V=X[Z++];if(!V)return Y._read();Y.emit(V,z),q()})()}};O5.prototype.pipe=function($){var Y=this;if(typeof $.add==="function")Y.on("entry",function(z){var U=$.add(z);if(U===!1)Y.pause()});return xM1.prototype.pipe.apply(this,arguments)};O5.prototype.pause=function($){if(this._paused=!0,$=$||this,this.emit("pause",$),this._stream)this._stream.pause($)};O5.prototype.resume=function($){if(this._paused=!1,$=$||this,this.emit("resume",$),this._stream)this._stream.resume($);this._read()};O5.prototype._read=function(){this.error("Cannot read unknown type: "+this.type)}});var Xn=E((Me1,oO0)=>
Line truncated
|
||||
expect: `+$.size+`
|
||||
actual: `+$._bytesWritten);MB.prototype._finish.call($)}});var Dn=E((De1,gN0)=>{gN0.exports=f2;var Nn=mK(),zM1=qZ(),UM1=X1(),QM1=FB(),JM1=K0("fs");UM1(f2,Nn);function f2($){var Y=this;if(!(Y instanceof f2))throw Error("ProxyWriter must be called as constructor.");Y.props=$,Y._needDrain=!1,Nn.call(Y,$)}f2.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";JM1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=zM1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(Nn(Y,Q))})};f2.prototype._addProxy=function($){var Y=this;if(Y._proxy)return Y.error("proxy already set");Y._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$);var z=Y._buffer;if(z.forEach(function(U){$[U[0]].apply($,U[1])}),Y._buffer.length=0,Y._needsDrain)Y.emit("drain")};f2.prototype.add=function($){if(QM1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};f2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};f2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var mK=E((Ae1,nN0)=>{nN0.exports=f$;var x$=m8(),KM1=X1(),IM1=Hn(),GM1=Ln(),OZ=K0("path"),kN0=process.platform==="win32"?0:process.umask(),xN0=qZ(),fN0=JB();KM1(f$,fN0);f$.dirmode=parseInt("0777",8)&~kN0;f$.filemode=parseInt("0666",8)&~kN0;var WM1=wn(),HM1=Mn(),XM1=On(),ZM1=Dn();function f$($,Y){var z=this;if(typeof $==="string")$={path:$};var U=xN0($),Q=f$;switch(U){case"Directory":Q=WM1;break;case"File":Q=XM1;break;case"Link":case"SymbolicLink":Q=HM1;break;case null:default:Q=ZM1;break}if(!(z instanceof Q))return new Q($);if(fN0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=OZ.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=OZ.basename($.path),z.dirname=OZ.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(Y)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(Y){if(Y)return $.warn("Cannot create "+$._path+`
|
||||
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat",Q=Y._proxy||Y;if($)J(null,$);else x$[U](Y._path,J);function J(K,I){if(Y.filter&&!Y.filter.call(Q,Q,I)){Y._aborted=!0,Y.emit("end"),Y.emit("close");return}if(K||!I)return An(Y);Y._old=I;var G=xN0(I);if(G!==Y.type||Y.type==="File"&&I.nlink>1)return IM1(Y._path,function(W){if(W)return Y.error(W);Y._old=null,An(Y)});An(Y)}};function An($){GM1(OZ.dirname($._path),f$.dirmode,function(Y,z){if(Y)return $.error(Y);return $._madeDir=z,$._create()})}function uN0($,Y,z,U,Q){var J=Y.mode,K=Y.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[K])return Q();if(typeof J!=="number")return Q();var I=z.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===I)return Q();x$[K](U,J,Q)}function bN0($,Y,z,U,Q){if(process.platform==="win32")return Q();if(!process.getuid||process.getuid()!==0)return Q();if(typeof Y.uid!=="number"&&typeof Y.gid!=="number")return Q();if(z.uid===Y.uid&&z.gid===Y.gid)return Q();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[J])return Q();if(typeof Y.uid!=="number")Y.uid=z.uid;if(typeof Y.gid!=="number")Y.gid=z.gid;x$[J](U,Y.uid,Y.gid,Q)}function iN0($,Y,z,U,Q){if(!x$.utimes||process.platform==="win32")return Q();var J=Y.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!x$[J])J="utimes";if(!x$[J])return Q();var{atime:K,mtime:I}=z,G=Y.atime,W=Y.mtime;if(G===void 0)G=K;if(W===void 0)W=I;if(!yN0(G))G=new Date(G);if(!yN0(W))G=new Date(W);if(G.getTime()===K.getTime()&&W.getTime()===I.getTime())return Q();x$[J](U,G,W,Q)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var Y=0,z=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Q=$.props.follow?"stat":"lstat";x$[Q]($._path,function(I,G){if(I)if(I.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(I);J($._old=G)})}return;function J(I){Y+=3,uN0($,$.props,I,$._path,K("chmod")),bN0($,$.props,I,$._path,K("chown")),iN0($,$.props,I,$._path,K("utimes"))}function K(I){return function(G){if(z)return;if(G)return G.fstream_finish_call=I,$.error(z=G);if(--Y>0)return;if(U)return;if(U=!0,!$._madeDir)return W();else cN0($,$._path,W);function W(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function cN0($,Y,z){var U=$._madeDir,Q=OZ.dirname(Y);qM1($,Q,function(J){if(J)return z(J);if(Q===U)return z();cN0($,Q,z)})}function qM1($,Y,z){var U={};Object.keys($.props).forEach(function(I){if(U[I]=$.props[I],I==="mode"&&$.type!=="Directory")U[I]=U[I]|parseInt("0111",8)});var Q=3,J=null;x$.stat(Y,function(I,G){if(I)return z(J=I);uN0($,U,G,Y,K),bN0($,U,G,Y,K),iN0($,U,G,Y,K)});function K(I){if(J)return;if(I)return z(J=I);if(--Q===0)return z()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function VM1($){return Object.prototype.toString.call($)}function yN0($){return typeof $==="object"&&VM1($)==="[object Date]"}});var En=E((LM1)=>{LM1.Abstract=JB();LM1.Reader=JU();LM1.Writer=mK();LM1.File={Reader:zn(),Writer:On()};LM1.Dir={Reader:Yn(),Writer:wn()};LM1.Link={Reader:ec(),Writer:Mn()};LM1.Proxy={Reader:Qn(),Writer:Dn()};LM1.Reader.Dir=LM1.DirReader=LM1.Dir.Reader;LM1.Reader.File=LM1.FileReader=LM1.File.Reader;LM1.Reader.Link=LM1.LinkReader=LM1.Link.Reader;LM1.Reader.Proxy=LM1.ProxyReader=LM1.Proxy.Reader;LM1.Writer.Dir=LM1.DirWriter=LM1.Dir.Writer;LM1.Writer.File=LM1.FileWriter=LM1.File.Writer;LM1.Writer.Link=LM1.LinkWriter=LM1.Link.Writer;LM1.Writer.Proxy=LM1.ProxyWriter=LM1.Proxy.Writer;LM1.collect=FB()});var dN0=E((he1,pN0)=>{pN0.exports=BM1;var MM1=sA(),OM1=En().Writer,Cn=K0("path"),NM1=K0("stream"),DM1=sc(),AM1=v2();function BM1($){$.path=Cn.resolve(Cn.normalize($.path));var Y=new MM1($),z=new NM1.Writable({objectMode:!0});z._write=function(Q,J,K){if(Q.type=="Directory")return K();var I=Cn.join($.path,Q.path);if(I.indexOf($.path)!=0)return K();let G=$.getWriter?$.getWriter({path:I}):OM1({path:I});Q.pipe(G).on("error",K).on("close",K)};var U=DM1(Y,z);return Y.once("crx-header",function(Q){U.crxHeader=Q}),Y.pipe(z).on("finish",function(){U.emit("close")}),U.promise=function(){return new AM1(function(Q,J){U.on("close",Q),U.on("error",J)})},U}});var mN0=E((Se1,OB)=>{var j6=function($){var Y=1e7,z=7,U=9007199254740992,Q=Z(U),J="0123456789abcdefghijklmnopqrstuvwxyz",K=typeof BigInt==="function";function I(B,v,u,r){if(typeof B>"u")return I[0];if(typeof v<"u")return+v===10&&!u?A0(B):u0(B,v,u,r);return A0(B)}function G(B,v){this.value=B,this.sign=v,this.isSmall=!1}G.prototype=Object.create(I.prototype);function W(B){this.value=B,this.sign=B<0,this.isSmall=!0}W.prototype=Object.create(I.prototype);function H(B){
Line truncated
|
||||
actual: `+$._bytesWritten);OB.prototype._finish.call($)}});var An=E((ye1,xN0)=>{xN0.exports=u2;var Dn=lK(),Zw1=qZ(),qw1=X1(),Vw1=MB(),Lw1=K0("fs");qw1(u2,Dn);function u2($){var Y=this;if(!(Y instanceof u2))throw Error("ProxyWriter must be called as constructor.");Y.props=$,Y._needDrain=!1,Dn.call(Y,$)}u2.prototype._stat=function(){var $=this,Y=$.props,z=Y.follow?"stat":"lstat";Lw1[z](Y.path,function(U,Q){var J;if(U||!Q)J="File";else J=Zw1(Q);Y[J]=!0,Y.type=$.type=J,$._old=Q,$._addProxy(Dn(Y,Q))})};u2.prototype._addProxy=function($){var Y=this;if(Y._proxy)return Y.error("proxy already set");Y._proxy=$,["ready","error","close","pipe","drain","warn"].forEach(function(U){$.on(U,Y.emit.bind(Y,U))}),Y.emit("proxy",$);var z=Y._buffer;if(z.forEach(function(U){$[U[0]].apply($,U[1])}),Y._buffer.length=0,Y._needsDrain)Y.emit("drain")};u2.prototype.add=function($){if(Vw1($),!this._proxy)return this._buffer.push(["add",[$]]),this._needDrain=!0,!1;return this._proxy.add($)};u2.prototype.write=function($){if(!this._proxy)return this._buffer.push(["write",[$]]),this._needDrain=!0,!1;return this._proxy.write($)};u2.prototype.end=function($){if(!this._proxy)return this._buffer.push(["end",[$]]),!1;return this._proxy.end($)}});var lK=E((ke1,mN0)=>{mN0.exports=f$;var x$=l8(),Fw1=X1(),Mw1=Xn(),ww1=Fn(),OZ=K0("path"),uN0=process.platform==="win32"?0:process.umask(),bN0=qZ(),iN0=KB();Fw1(f$,iN0);f$.dirmode=parseInt("0777",8)&~uN0;f$.filemode=parseInt("0666",8)&~uN0;var Ow1=wn(),Nw1=On(),Dw1=Nn(),Aw1=An();function f$($,Y){var z=this;if(typeof $==="string")$={path:$};var U=bN0($),Q=f$;switch(U){case"Directory":Q=Ow1;break;case"File":Q=Dw1;break;case"Link":case"SymbolicLink":Q=Nw1;break;case null:default:Q=Aw1;break}if(!(z instanceof Q))return new Q($);if(iN0.call(z),!$.path)z.error("Must provide a path",null,!0);if(z.type=$.type,z.props=$,z.depth=$.depth||0,z.clobber=$.clobber===!1?$.clobber:!0,z.parent=$.parent||null,z.root=$.root||$.parent&&$.parent.root||z,z._path=z.path=OZ.resolve($.path),process.platform==="win32"){if(z.path=z._path=z.path.replace(/\?/g,"_"),z._path.length>=260)z._swallowErrors=!0,z._path="\\\\?\\"+z.path.replace(/\//g,"\\")}if(z.basename=OZ.basename($.path),z.dirname=OZ.dirname($.path),z.linkpath=$.linkpath||null,$.parent=$.root=null,z.size=$.size,typeof $.mode==="string")$.mode=parseInt($.mode,8);z.readable=!1,z.writable=!0,z._buffer=[],z.ready=!1,z.filter=typeof $.filter==="function"?$.filter:null,z._stat(Y)}f$.prototype._create=function(){var $=this;x$[$.props.follow?"stat":"lstat"]($._path,function(Y){if(Y)return $.warn("Cannot create "+$._path+`
|
||||
Unsupported type: `+$.type,"ENOTSUP");$._finish()})};f$.prototype._stat=function($){var Y=this,z=Y.props,U=z.follow?"stat":"lstat",Q=Y._proxy||Y;if($)J(null,$);else x$[U](Y._path,J);function J(K,I){if(Y.filter&&!Y.filter.call(Q,Q,I)){Y._aborted=!0,Y.emit("end"),Y.emit("close");return}if(K||!I)return Bn(Y);Y._old=I;var G=bN0(I);if(G!==Y.type||Y.type==="File"&&I.nlink>1)return Mw1(Y._path,function(W){if(W)return Y.error(W);Y._old=null,Bn(Y)});Bn(Y)}};function Bn($){ww1(OZ.dirname($._path),f$.dirmode,function(Y,z){if(Y)return $.error(Y);return $._madeDir=z,$._create()})}function cN0($,Y,z,U,Q){var J=Y.mode,K=Y.follow||$.type!=="SymbolicLink"?"chmod":"lchmod";if(!x$[K])return Q();if(typeof J!=="number")return Q();var I=z.mode&parseInt("0777",8);if(J=J&parseInt("0777",8),J===I)return Q();x$[K](U,J,Q)}function nN0($,Y,z,U,Q){if(process.platform==="win32")return Q();if(!process.getuid||process.getuid()!==0)return Q();if(typeof Y.uid!=="number"&&typeof Y.gid!=="number")return Q();if(z.uid===Y.uid&&z.gid===Y.gid)return Q();var J=$.props.follow||$.type!=="SymbolicLink"?"chown":"lchown";if(!x$[J])return Q();if(typeof Y.uid!=="number")Y.uid=z.uid;if(typeof Y.gid!=="number")Y.gid=z.gid;x$[J](U,Y.uid,Y.gid,Q)}function pN0($,Y,z,U,Q){if(!x$.utimes||process.platform==="win32")return Q();var J=Y.follow||$.type!=="SymbolicLink"?"utimes":"lutimes";if(J==="lutimes"&&!x$[J])J="utimes";if(!x$[J])return Q();var{atime:K,mtime:I}=z,G=Y.atime,W=Y.mtime;if(G===void 0)G=K;if(W===void 0)W=I;if(!fN0(G))G=new Date(G);if(!fN0(W))G=new Date(W);if(G.getTime()===K.getTime()&&W.getTime()===I.getTime())return Q();x$[J](U,G,W,Q)}f$.prototype._finish=function(){var $=this;if($._finishing)return;$._finishing=!0;var Y=0,z=null,U=!1;if($._old)$._old.atime=new Date(0),$._old.mtime=new Date(0),J($._old);else{var Q=$.props.follow?"stat":"lstat";x$[Q]($._path,function(I,G){if(I)if(I.code==="ENOENT"&&($.type==="Link"||$.type==="SymbolicLink")&&process.platform==="win32"){$.ready=!0,$.emit("ready"),$.emit("end"),$.emit("close"),$.end=$._finish=function(){};return}else return $.error(I);J($._old=G)})}return;function J(I){Y+=3,cN0($,$.props,I,$._path,K("chmod")),nN0($,$.props,I,$._path,K("chown")),pN0($,$.props,I,$._path,K("utimes"))}function K(I){return function(G){if(z)return;if(G)return G.fstream_finish_call=I,$.error(z=G);if(--Y>0)return;if(U)return;if(U=!0,!$._madeDir)return W();else dN0($,$._path,W);function W(H){if(H)return H.fstream_finish_call="setupMadeDir",$.error(H);$.emit("end"),$.emit("close")}}}};function dN0($,Y,z){var U=$._madeDir,Q=OZ.dirname(Y);Bw1($,Q,function(J){if(J)return z(J);if(Q===U)return z();dN0($,Q,z)})}function Bw1($,Y,z){var U={};Object.keys($.props).forEach(function(I){if(U[I]=$.props[I],I==="mode"&&$.type!=="Directory")U[I]=U[I]|parseInt("0111",8)});var Q=3,J=null;x$.stat(Y,function(I,G){if(I)return z(J=I);cN0($,U,G,Y,K),nN0($,U,G,Y,K),pN0($,U,G,Y,K)});function K(I){if(J)return;if(I)return z(J=I);if(--Q===0)return z()}}f$.prototype.pipe=function(){this.error("Can't pipe from writable stream")};f$.prototype.add=function(){this.error("Can't add to non-Directory type")};f$.prototype.write=function(){return!0};function Pw1($){return Object.prototype.toString.call($)}function fN0($){return typeof $==="object"&&Pw1($)==="[object Date]"}});var Cn=E((Tw1)=>{Tw1.Abstract=KB();Tw1.Reader=KU();Tw1.Writer=lK();Tw1.File={Reader:Un(),Writer:Nn()};Tw1.Dir={Reader:zn(),Writer:wn()};Tw1.Link={Reader:$n(),Writer:On()};Tw1.Proxy={Reader:Jn(),Writer:An()};Tw1.Reader.Dir=Tw1.DirReader=Tw1.Dir.Reader;Tw1.Reader.File=Tw1.FileReader=Tw1.File.Reader;Tw1.Reader.Link=Tw1.LinkReader=Tw1.Link.Reader;Tw1.Reader.Proxy=Tw1.ProxyReader=Tw1.Proxy.Reader;Tw1.Writer.Dir=Tw1.DirWriter=Tw1.Dir.Writer;Tw1.Writer.File=Tw1.FileWriter=Tw1.File.Writer;Tw1.Writer.Link=Tw1.LinkWriter=Tw1.Link.Writer;Tw1.Writer.Proxy=Tw1.ProxyWriter=Tw1.Proxy.Writer;Tw1.collect=MB()});var oN0=E((me1,lN0)=>{lN0.exports=Sw1;var Cw1=aA(),Rw1=Cn().Writer,Rn=K0("path"),_w1=K0("stream"),vw1=ac(),hw1=h2();function Sw1($){$.path=Rn.resolve(Rn.normalize($.path));var Y=new Cw1($),z=new _w1.Writable({objectMode:!0});z._write=function(Q,J,K){if(Q.type=="Directory")return K();var I=Rn.join($.path,Q.path);if(I.indexOf($.path)!=0)return K();let G=$.getWriter?$.getWriter({path:I}):Rw1({path:I});Q.pipe(G).on("error",K).on("close",K)};var U=vw1(Y,z);return Y.once("crx-header",function(Q){U.crxHeader=Q}),Y.pipe(z).on("finish",function(){U.emit("close")}),U.promise=function(){return new hw1(function(Q,J){U.on("close",Q),U.on("error",J)})},U}});var rN0=E((le1,NB)=>{var j6=function($){var Y=1e7,z=7,U=9007199254740992,Q=Z(U),J="0123456789abcdefghijklmnopqrstuvwxyz",K=typeof BigInt==="function";function I(B,v,u,r){if(typeof B>"u")return I[0];if(typeof v<"u")return+v===10&&!u?A0(B):u0(B,v,u,r);return A0(B)}function G(B,v){this.value=B,this.sign=v,this.isSmall=!1}G.prototype=Object.create(I.prototype);function W(B){this.value=B,this.sign=B<0,this.isSmall=!0}W.prototype=Object.create(I.prototype);function H(B){
Line truncated
|
||||
* Tmp
|
||||
*
|
||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||||
*
|
||||
* MIT Licensed
|
||||
*/var V4=K0("fs"),TB=K0("os"),E6=K0("path"),JD0=K0("crypto"),D9={fs:V4.constants,os:TB.constants},WD0=/XXXXXX/,HD0=(D9.O_CREAT||D9.fs.O_CREAT)|(D9.O_EXCL||D9.fs.O_EXCL)|(D9.O_RDWR||D9.fs.O_RDWR),lM1=TB.platform()==="win32",oM1=D9.EBADF||D9.os.errno.EBADF,rM1=D9.ENOENT||D9.os.errno.ENOENT,oK=[],XD0=V4.rmdirSync.bind(V4),ZD0=!1;function sM1($,Y){return V4.rm($,{recursive:!0},Y)}function qD0($){return V4.rmSync($,{recursive:!0})}function Sn($,Y){let z=rK($,Y),U=z[0],Q=z[1];KO1(U,function(J,K){if(J)return Q(J);let I=K.tries;(function G(){try{let W=LD0(K);V4.stat(W,function(H){if(!H){if(I-- >0)return G();return Q(Error("Could not get a unique tmp filename, max tries reached "+W))}Q(null,W)})}catch(W){Q(W)}})()})}function gn($){let Y=rK($),z=Y[0],U=IO1(z),Q=U.tries;do{let J=LD0(U);try{V4.statSync(J)}catch(K){return J}}while(Q-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function aM1($,Y){let z=rK($,Y),U=z[0],Q=z[1];Sn(U,function(K,I){if(K)return Q(K);V4.open(I,HD0,U.mode||384,function(W,H){if(W)return Q(W);if(U.discardDescriptor)return V4.close(H,function(Z){return Q(Z,I,void 0,vn(I,-1,U,!1))});else{let X=U.discardDescriptor||U.detachDescriptor;Q(null,I,H,vn(I,X?-1:H,U,!1))}})})}function tM1($){let Y=rK($),z=Y[0],U=z.discardDescriptor||z.detachDescriptor,Q=gn(z),J=V4.openSync(Q,HD0,z.mode||384);if(z.discardDescriptor)V4.closeSync(J),J=void 0;return{name:Q,fd:J,removeCallback:vn(Q,U?-1:J,z,!0)}}function eM1($,Y){let z=rK($,Y),U=z[0],Q=z[1];Sn(U,function(K,I){if(K)return Q(K);V4.mkdir(I,U.mode||448,function(W){if(W)return Q(W);Q(null,I,VD0(I,U,!1))})})}function $O1($){let Y=rK($),z=Y[0],U=gn(z);return V4.mkdirSync(U,z.mode||448),{name:U,removeCallback:VD0(U,z,!0)}}function YO1($,Y){let z=function(U){if(U&&!hn(U))return Y(U);Y()};if(0<=$[0])V4.close($[0],function(){V4.unlink($[1],z)});else V4.unlink($[1],z)}function zO1($){let Y=null;try{if(0<=$[0])V4.closeSync($[0])}catch(z){if(!GO1(z)&&!hn(z))throw z}finally{try{V4.unlinkSync($[1])}catch(z){if(!hn(z))Y=z}}if(Y!==null)throw Y}function vn($,Y,z,U){let Q=PB(zO1,[Y,$],U),J=PB(YO1,[Y,$],U,Q);if(!z.keep)oK.unshift(Q);return U?Q:J}function VD0($,Y,z){let U=Y.unsafeCleanup?sM1:V4.rmdir.bind(V4),Q=Y.unsafeCleanup?qD0:XD0,J=PB(Q,$,z),K=PB(U,$,z,J);if(!Y.keep)oK.unshift(J);return z?J:K}function PB($,Y,z,U){let Q=!1;return function J(K){if(!Q){let I=U||J,G=oK.indexOf(I);if(G>=0)oK.splice(G,1);if(Q=!0,z||$===XD0||$===qD0)return $(Y);else return $(Y,K||function(){})}}}function UO1(){if(!ZD0)return;while(oK.length)try{oK[0]()}catch($){}}function KD0($){let Y=[],z=null;try{z=JD0.randomBytes($)}catch(U){z=JD0.pseudoRandomBytes($)}for(let U=0;U<$;U++)Y.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[U]%62]);return Y.join("")}function o8($){return typeof $>"u"}function rK($,Y){if(typeof $==="function")return[{},$];if(o8($))return[{},Y];let z={};for(let U of Object.getOwnPropertyNames($))z[U]=$[U];return[z,Y]}function QO1($,Y,z){let U=E6.isAbsolute($)?$:E6.join(Y,$);V4.stat(U,function(Q){if(Q)V4.realpath(E6.dirname(U),function(J,K){if(J)return z(J);z(null,E6.join(K,E6.basename(U)))});else V4.realpath(U,z)})}function JO1($,Y){let z=E6.isAbsolute($)?$:E6.join(Y,$);try{return V4.statSync(z),V4.realpathSync(z)}catch(U){let Q=V4.realpathSync(E6.dirname(z));return E6.join(Q,E6.basename(z))}}function LD0($){let Y=$.tmpdir;if(!o8($.name))return E6.join(Y,$.dir,$.name);if(!o8($.template))return E6.join(Y,$.dir,$.template).replace(WD0,KD0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",KD0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(Y,$.dir,z)}function _n($,Y){if(typeof Y!=="string")throw Error(`${$} option must be a string, got "${typeof Y}".`);if(Y.includes(".."))throw Error("Relative value not allowed");return Y}function FD0($){if(!o8($.name)){let Y=$.name;if(E6.isAbsolute(Y))throw Error(`name option must not contain an absolute path, found "${Y}".`);let z=E6.basename(Y);if(z===".."||z==="."||z!==Y)throw Error(`name option must not contain a path, found "${Y}".`)}if(!o8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(WD0))throw Error(`Invalid template, found "${$.template}".`)}if(!o8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=o8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=o8($.prefix)?"":_n("prefix",$.prefix),$.postfix=o8($.postfix)?"":_n("postfix",$.postfix),$.template=o8($.template)?void 0:_n("template",$.template)}function ID0($,Y,z,U){if(o8(Y))return U(null);QO1(Y,z,function(Q,J){if(Q)return U(Q);let K=E6.relative(z,J);if(K.startsWith("..")||E6.isAbsolute(K))return U(Error(`${$} option must be relative to "${z}", found "${K}".`));U(null,K)})}function GD0($,Y,z){if(o8(Y))return;let U=JO1(Y,z),Q=E6.relative(z,U);if(Q.startsWith("..")||E6.isAbsolute(Q))thrLine truncated
|
||||
*/var V4=K0("fs"),jB=K0("os"),E6=K0("path"),GD0=K0("crypto"),D9={fs:V4.constants,os:jB.constants},ZD0=/XXXXXX/,qD0=(D9.O_CREAT||D9.fs.O_CREAT)|(D9.O_EXCL||D9.fs.O_EXCL)|(D9.O_RDWR||D9.fs.O_RDWR),UO1=jB.platform()==="win32",QO1=D9.EBADF||D9.os.errno.EBADF,JO1=D9.ENOENT||D9.os.errno.ENOENT,rK=[],VD0=V4.rmdirSync.bind(V4),LD0=!1;function KO1($,Y){return V4.rm($,{recursive:!0},Y)}function FD0($){return V4.rmSync($,{recursive:!0})}function gn($,Y){let z=sK($,Y),U=z[0],Q=z[1];FO1(U,function(J,K){if(J)return Q(J);let I=K.tries;(function G(){try{let W=wD0(K);V4.stat(W,function(H){if(!H){if(I-- >0)return G();return Q(Error("Could not get a unique tmp filename, max tries reached "+W))}Q(null,W)})}catch(W){Q(W)}})()})}function yn($){let Y=sK($),z=Y[0],U=MO1(z),Q=U.tries;do{let J=wD0(U);try{V4.statSync(J)}catch(K){return J}}while(Q-- >0);throw Error("Could not get a unique tmp filename, max tries reached")}function IO1($,Y){let z=sK($,Y),U=z[0],Q=z[1];gn(U,function(K,I){if(K)return Q(K);V4.open(I,qD0,U.mode||384,function(W,H){if(W)return Q(W);if(U.discardDescriptor)return V4.close(H,function(Z){return Q(Z,I,void 0,hn(I,-1,U,!1))});else{let X=U.discardDescriptor||U.detachDescriptor;Q(null,I,H,hn(I,X?-1:H,U,!1))}})})}function GO1($){let Y=sK($),z=Y[0],U=z.discardDescriptor||z.detachDescriptor,Q=yn(z),J=V4.openSync(Q,qD0,z.mode||384);if(z.discardDescriptor)V4.closeSync(J),J=void 0;return{name:Q,fd:J,removeCallback:hn(Q,U?-1:J,z,!0)}}function WO1($,Y){let z=sK($,Y),U=z[0],Q=z[1];gn(U,function(K,I){if(K)return Q(K);V4.mkdir(I,U.mode||448,function(W){if(W)return Q(W);Q(null,I,MD0(I,U,!1))})})}function HO1($){let Y=sK($),z=Y[0],U=yn(z);return V4.mkdirSync(U,z.mode||448),{name:U,removeCallback:MD0(U,z,!0)}}function XO1($,Y){let z=function(U){if(U&&!Sn(U))return Y(U);Y()};if(0<=$[0])V4.close($[0],function(){V4.unlink($[1],z)});else V4.unlink($[1],z)}function ZO1($){let Y=null;try{if(0<=$[0])V4.closeSync($[0])}catch(z){if(!wO1(z)&&!Sn(z))throw z}finally{try{V4.unlinkSync($[1])}catch(z){if(!Sn(z))Y=z}}if(Y!==null)throw Y}function hn($,Y,z,U){let Q=TB(ZO1,[Y,$],U),J=TB(XO1,[Y,$],U,Q);if(!z.keep)rK.unshift(Q);return U?Q:J}function MD0($,Y,z){let U=Y.unsafeCleanup?KO1:V4.rmdir.bind(V4),Q=Y.unsafeCleanup?FD0:VD0,J=TB(Q,$,z),K=TB(U,$,z,J);if(!Y.keep)rK.unshift(J);return z?J:K}function TB($,Y,z,U){let Q=!1;return function J(K){if(!Q){let I=U||J,G=rK.indexOf(I);if(G>=0)rK.splice(G,1);if(Q=!0,z||$===VD0||$===FD0)return $(Y);else return $(Y,K||function(){})}}}function qO1(){if(!LD0)return;while(rK.length)try{rK[0]()}catch($){}}function WD0($){let Y=[],z=null;try{z=GD0.randomBytes($)}catch(U){z=GD0.pseudoRandomBytes($)}for(let U=0;U<$;U++)Y.push("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"[z[U]%62]);return Y.join("")}function r8($){return typeof $>"u"}function sK($,Y){if(typeof $==="function")return[{},$];if(r8($))return[{},Y];let z={};for(let U of Object.getOwnPropertyNames($))z[U]=$[U];return[z,Y]}function VO1($,Y,z){let U=E6.isAbsolute($)?$:E6.join(Y,$);V4.stat(U,function(Q){if(Q)V4.realpath(E6.dirname(U),function(J,K){if(J)return z(J);z(null,E6.join(K,E6.basename(U)))});else V4.realpath(U,z)})}function LO1($,Y){let z=E6.isAbsolute($)?$:E6.join(Y,$);try{return V4.statSync(z),V4.realpathSync(z)}catch(U){let Q=V4.realpathSync(E6.dirname(z));return E6.join(Q,E6.basename(z))}}function wD0($){let Y=$.tmpdir;if(!r8($.name))return E6.join(Y,$.dir,$.name);if(!r8($.template))return E6.join(Y,$.dir,$.template).replace(ZD0,WD0(6));let z=[$.prefix?$.prefix:"tmp","-",process.pid,"-",WD0(12),$.postfix?"-"+$.postfix:""].join("");return E6.join(Y,$.dir,z)}function vn($,Y){if(typeof Y!=="string")throw Error(`${$} option must be a string, got "${typeof Y}".`);if(Y.includes(".."))throw Error("Relative value not allowed");return Y}function OD0($){if(!r8($.name)){let Y=$.name;if(E6.isAbsolute(Y))throw Error(`name option must not contain an absolute path, found "${Y}".`);let z=E6.basename(Y);if(z===".."||z==="."||z!==Y)throw Error(`name option must not contain a path, found "${Y}".`)}if(!r8($.template)){if(typeof $.template!=="string")throw Error(`template option must be a string, got "${typeof $.template}".`);if(!$.template.match(ZD0))throw Error(`Invalid template, found "${$.template}".`)}if(!r8($.tries)&&isNaN($.tries)||$.tries<0)throw Error(`Invalid tries, found "${$.tries}".`);$.tries=r8($.name)?$.tries||3:1,$.keep=!!$.keep,$.detachDescriptor=!!$.detachDescriptor,$.discardDescriptor=!!$.discardDescriptor,$.unsafeCleanup=!!$.unsafeCleanup,$.prefix=r8($.prefix)?"":vn("prefix",$.prefix),$.postfix=r8($.postfix)?"":vn("postfix",$.postfix),$.template=r8($.template)?void 0:vn("template",$.template)}function HD0($,Y,z,U){if(r8(Y))return U(null);VO1(Y,z,function(Q,J){if(Q)return U(Q);let K=E6.relative(z,J);if(K.startsWith("..")||E6.isAbsolute(K))return U(Error(`${$} option must be relative to "${z}", found "${K}".`));U(null,K)})}function XD0($,Y,z){if(r8(Y))return;let U=LO1(Y,z),Q=E6.relative(z,U);if(Q.startsWith("..")||E6.isAbsolute(Q))thrLine truncated
|
||||
`)}let U=[];Y.forEach((Q,J)=>{let K=$.length+J+1,I=J===0?"⏳ ":"";U.push(`${I}${K}. ${Q}`)});for(let Q=$.length-1;Q>=0;Q--){let J=Q+1;U.push(`${J}. ${$[Q]}`)}return U.join(`
|
||||
`)}function mn($,Y,z,U,Q){let J=$?.operator||Y?.operator||z?.operator,K=J?.name||J?.id||z?.operatorName||"",I=($?.nodeName||Y?.fromNodeName||Y?.nodeName||z?.nodeName||"").trim();if(I==="合思审批节点"||I==="外部审批节点"||I.includes("合思审批")||I.includes("外部审批"))I="";if((!I||I==="提交人"||I==="审批节点")&&K&&U){let M=U.find((w)=>w.operator?.name===K&&w.nodeName&&w.nodeName.trim()!=="提交人"&&!w.isEbot&&w.rawAction!=="freeflow.reject");if(M?.nodeName)I=M.nodeName.trim()}let W=$?.comment||Y?.reason||z?.rejectComment||"修改";if(W.includes(":")){let M=W.split(":");if(M.length>1)W=M.slice(1).join(":").trim()}let H=W;if(I&&K)H=`${I}(${K}) ❌: ${W}`;else if(K)H=`${K} ❌: ${W}`;else if(I)H=`${I} ❌: ${W}`;else H=W;let X=$?.rejectTargetNodeName||Y?.targetNodeName||"提交人",Z=$?.rejectTargetOperator?.name||Y?.targetOperator?.name||Q?.submitter?.name,q=Z?`${X}(${Z})`:X,V=$?.resubmitRuleText||Y?.resubmitRuleText||(K?`重新提交后由${K}继续审批`:"重新提交后继续审批");return{comment:`${H}
|
||||
`)}function ln($,Y,z,U,Q){let J=$?.operator||Y?.operator||z?.operator,K=J?.name||J?.id||z?.operatorName||"",I=($?.nodeName||Y?.fromNodeName||Y?.nodeName||z?.nodeName||"").trim();if(I==="合思审批节点"||I==="外部审批节点"||I.includes("合思审批")||I.includes("外部审批"))I="";if((!I||I==="提交人"||I==="审批节点")&&K&&U){let w=U.find((M)=>M.operator?.name===K&&M.nodeName&&M.nodeName.trim()!=="提交人"&&!M.isEbot&&M.rawAction!=="freeflow.reject");if(w?.nodeName)I=w.nodeName.trim()}let W=$?.comment||Y?.reason||z?.rejectComment||"修改";if(W.includes(":")){let w=W.split(":");if(w.length>1)W=w.slice(1).join(":").trim()}let H=W;if(I&&K)H=`${I}(${K}) ❌: ${W}`;else if(K)H=`${K} ❌: ${W}`;else if(I)H=`${I} ❌: ${W}`;else H=W;let X=$?.rejectTargetNodeName||Y?.targetNodeName||"提交人",Z=$?.rejectTargetOperator?.name||Y?.targetOperator?.name||Q?.submitter?.name,q=Z?`${X}(${Z})`:X,V=$?.resubmitRuleText||Y?.resubmitRuleText||(K?`重新提交后由${K}继续审批`:"重新提交后继续审批");return{comment:`${H}
|
||||
↳ 驳回至: ${q}
|
||||
↳ ${V}`,operator:J}}function eD0($){if(!$)return[];let Y=$.pending||[],z=String($.rawState||"").toUpperCase(),U=String($.state||"").toUpperCase(),Q=[];if(Y.length>0)for(let J of Y){let K=J.approver?.name||J.approver?.id||"待定",I=(J.name||$.currentNode||"").trim(),G=I?`${I}(${K})`:K,H=J.type?.toUpperCase()==="PAYING"||I.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${G}: ${H}`)}else if($.currentNode?.trim()){let K=$.currentNode.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${$.currentNode.trim()}: ${K}`)}return Q}function HU($,Y){let z=new Map;if(!$||$.length===0)return z;if(!Y){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";z.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:tD0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return z}let U=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),Q=Y.history||[],J=String(Y.rawState||"").toUpperCase(),K=String(Y.state||"").toUpperCase(),I=J==="DRAFT"||J==="REVOKED"||J==="CANCELED"||J==="CANCELLED"||K==="草稿"||K==="已撤回"||K==="已取消",G=J==="REJECTED"||J==="TERMINATED"||K==="审批驳回"||K==="已驳回",W=!I&&!G&&(J==="PAID"||K==="已支付"||Q.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),H=!I&&!G&&!W&&(J==="PAYING"||K==="支付中"||(Y.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||Y.currentNode?.includes("支付")===!0),Z=W||!I&&!G&&!H&&(J==="COMPLETED"||J==="APPROVED"||K==="已完成"||K==="审批通过");for(let q=0;q<U.length;q++){let V=U[q];if(!V)continue;let F=Number(V.createdAt)||0,M=V.document||{},w=V.manualApprovalRecord||V.result?.manualApprovalRecord||M.manualApprovalRecord||{},N=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,O=typeof w.nodeId==="string"?String(w.nodeId):void 0,D=O?decodeURIComponent(O).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,P=N||D,T=P?Q.find((A0)=>A0.nodeId&&(A0.nodeId===P||P.includes(A0.nodeId))):void 0,A=T?.time??F,j=U[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===U.length-1,x=Q.find((A0)=>(A0.time??0)>A+5000&&A0.isEbot&&(A0.nodeName?.includes("智能")||A0.nodeName?.includes("AI")||A0.action?.includes("智能")||A0.comment?.includes("AI")||A0.comment?.includes("approval-result"))&&!A0.nodeName?.includes("费用标准检查")&&!A0.nodeName?.includes("标准检查")&&!A0.nodeName?.includes("预算"));if(x){if(b=!1,(x.time??1/0)<C)C=x.time}let S=V.result||{},i=S.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",U0=c.toUpperCase(),k=U0==="REJECT"||U0==="驳回",d=U0==="APPROVE"||U0==="通过",t=U0==="EXEMPT_APPROVE"||U0==="免审通过"||U0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(k)e=p?"驳回":"添加评论";else if(U0==="REVIEW"||U0==="转交复核")e="转交复核";let y=typeof w.status==="object"&&w.status!==null?String(w.status.type||w.status.label||"").toUpperCase():"",s=typeof w.status==="object"&&w.status!==null?String(w.status.sourceStatus||""):"",Y0=M.manualApprovalStatus||S.manualApprovalStatus||V.manualApprovalStatus,N0=typeof Y0==="string"?Y0.toUpperCase():"",E0=N0==="CANCELLED"||N0==="CANCELED"||N0==="已取消"||N0==="已撤回"||N0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=N0==="APPROVED"||N0==="已支付/审批完成"||N0==="已通过"||N0==="已完成"||N0==="已支付"||y==="APPROVED",i0=!(s.includes("补偿")||s.includes("已支付"))&&(N0==="TERMINATED"||N0==="REJECTED"||N0==="REJECT"||N0==="已驳回"||N0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),Y1=T?1000:60000,a=Q.filter((A0)=>{let Q0=A0.time??0;return Q0>=A-Y1&&Q0<C}),H0="-",F0="-",u0=!1,b0,c0,A1=d||t,k1=Q.filter((A0)=>(A0.time??0)>A+5000),u1=k1.some((A0)=>A0.rawAction==="freeflow.retract"||A0.action==="单据撤回"),b1=k1.some((A0)=>A0.rawAction==="freeflow.submit"||A0.action==="提交送审");if(A1&&b&&(u1||b1))u0=!0,b0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&k)H0="无操作",F0="-";else{let A0=a.filter((v)=>(v.time??0)>=A-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),Q0=A0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),B=A0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(B||!Y&&i0){H0="审批驳回",u0=!1,b0=void 0;let v=mn(B,void 0,w,Q,Y);F0=v.commen
Line truncated
|
||||
`,{mode:384}),Y}function Kp($){let Y=MA0();for(let z of Y){if(!V$(z))continue;for(let U of fB(z).filter((Q)=>Q.endsWith(".json")).filter((Q)=>!Q.startsWith("example."))){let Q=B9(z,U);try{let J=bB(Q,"utf-8"),K=JSON.parse(J);if(K&&typeof K==="object"&&K.id===$)return Q}catch{}}}return}function y3($,Y){let z=Kp($);if(!z)throw Error(`Enterprise config not found: ${$}`);let Q={...JSON.parse(bB(z,"utf-8")),...Y};for(let K of Object.keys(Y))if(Y[K]===void 0)delete Q[K];let J=zp.parse(Q);return ZA0(z,`${JSON.stringify(J,null,2)}
|
||||
`,"utf-8"),J}var Qp="SEAL_USE_ENTERPRISES_DIR",qA0="SEAL_HOME_ENTERPRISES_DIR",VA0="SEAL_USE_USER_ENTERPRISES_DIR",LA0="SEAL_HOME_USER_ENTERPRISES_DIR",FA0="SEAL_USE_CONFIG_FILE",wA0="SEAL_HOME_CONFIG_FILE",eK,uB,xB,HA0;var k3=o(()=>{Up();eK=B9(iB(),".config","seal-use","enterprises"),uB=B9(iB(),".config","seal-home","enterprises"),xB=B9(iB(),".config","seal-use","config.json"),HA0=B9(iB(),".config","seal-home","config.json")});function c2($,Y,z=[]){let U=Y.corpId?.trim()||void 0,Q=Y.stateful?Y.defaultCorpId?.trim()||void 0:void 0,J=U??Q;if(J){let I=$.find((H)=>H.id===J);if(I)return I;let G=$.find((H)=>H.id.toLowerCase()===J.toLowerCase());if(G)return G;let W=$.find((H)=>H.name.toLowerCase()===J.toLowerCase());if(W)return W;throw Error(`No enterprise config found for ${J}`)}if(!Y.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-use config mode stateful` to enable a default enterprise.");let K=$[0];if(K)return K;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{existsSync as Ip,mkdirSync as cN1,readFileSync as nN1,renameSync as pN1,unlinkSync as dN1,writeFileSync as mN1}from"node:fs";import{homedir as lN1}from"node:os";import{dirname as oN1,join as rN1}from"node:path";function _Z(){let $=process.env[sN1]?.trim();if($)return $;return aN1}function OA0($=new Date){return $.toISOString().slice(0,10)}function NA0($=Gp,Y=new Date){let z=Y.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function DA0($=_Z()){if(!Ip($))return{};try{let Y=nN1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function tN1($,Y){let z={};for(let[U,Q]of Object.entries($)){if(!Q||typeof Q!=="object")continue;let J={},K=!1;for(let[I,G]of Object.entries(Q))if(typeof G==="number"&&G>0&&I>=Y)J[I]=G,K=!0;if(K)z[U]=J}return z}function eN1($,Y=_Z()){let z=oN1(Y);if(!Ip(z))cN1(z,{recursive:!0,mode:448});let U=`${Y}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{mN1(U,JSON.stringify($,null,2),{encoding:"utf-8",mode:384}),pN1(U,Y)}catch(Q){try{if(Ip(U))dN1(U)}catch{}throw Q}}function AA0($,Y=new Date){if(!$||typeof $!=="string")return;try{let z=_Z(),U=DA0(z),Q=OA0(Y),J=NA0(Gp,Y),K=tN1(U,J);K[$]=K[$]||{},K[$][Q]=(K[$][Q]??0)+1,eN1(K,z)}catch{}}function $D1($,Y=Gp,z=new Date){let U=new Map;try{let Q=DA0(),J=NA0(Y,z),K=OA0(z),I=$??Object.keys(Q);for(let G of I){let W=Q[G];if(!W){U.set(G,0);continue}let H=0;for(let[X,Z]of Object.entries(W))if(X>=J&&X<=K&&typeof Z==="number")H+=Z;U.set(G,H)}}catch{if($)for(let Q of $)U.set(Q,0)}return U}function BA0($,Y,z){let U=z??$D1($.map((Q)=>Q.id));return[...$].sort((Q,J)=>{if(Y){if(Q.id===Y&&J.id!==Y)return-1;if(J.id===Y&&Q.id!==Y)return 1}let K=U.get(Q.id)??0,I=U.get(J.id)??0;if(K!==I)return I-K;let G=Q.name??Q.id,W=J.name??J.id,H=G.localeCompare(W,"zh-CN");if(H!==0)return H;return Q.id.localeCompare(J.id)})}var sN1="SEAL_USE_USAGE_FILE",aN1,Gp=7;var cB=o(()=>{aN1=rN1(lN1(),".config","seal-use","usage.json")});function YD1($,Y){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>Y?z:z.toLowerCase())}function zD1($,Y){return Y?$:$.toLowerCase()}function UD1($,Y,z,U){let Q=zD1($,U),J=Y.filter((K)=>Q.includes(K));if(z==="all"&&J.length!==Y.length)return[];return J}function QD1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function JD1($,Y){if(Y.fields&&!Y.fields.has($.field))return[];let z=QD1($.value),U=[];return z.forEach((Q,J)=>{let K=UD1(Q,Y.keywords,Y.matchMode,Y.caseSensitive);if(K.length===0)return;let I=Math.max(0,J-Y.contextLines),G=Math.min(z.length,J+Y.contextLines+1),W={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:J+1,matchedKeywords:K,matchedText:nB(Q,Y.maxChars),context:{before:Y.snippetOnly?[]:z.slice(I,J).map((H)=>nB(H,Y.maxChars)),line:nB(Q,Y.maxChars),after:Y.snippetOnly?[]:z.slice(J+1,G).map((H)=>nB(H,Y.maxChars))},metadata:$.metadata};if(Y.snippetOnly)W.context={before:[],line:W.context.line,after:[]};U.push(W)}),U}function nB($,Y){if(!Y||$.length<=Y)return $;return`${$.slice(0,Math.max(0,Y))}...`}function KD1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function TA0($){return $.rules.flatMap((Y,z)=>{let U=`${$.id}:${Y.description.slice(0,32)}`,Q={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:Y.scope,strictness:Y.strictness,code:"code"in Y?Y.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:U,title:`${$.versionName} / ${Y.scope}`,field:"hi
Line truncated
|
||||
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==U.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:U}}async function Xp($,Y,z){let U=Y.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",Q=await J$($,U);if(z||Q.length>0)return _A0(Q,z,Y.id);if(Y.environment==="test"||Y.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${Y.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let J=(Y.seal.url??Y.source?.sealUrl??`https://${Y.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await wM($,J,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${J}/api/v1/integrations/webhook/replay-mock-callback`},Y.seal.endpoints.approvalStylePreferences)}throw new w4(`当前租户「${Y.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`)}async function $I($){let{query:Y,sourceClient:z,targetClient:U,sourceCorp:Q,targetCorp:J,webhookSelector:K,snPrefix:I,snSuffix:G,docIdPrefix:W,docIdSuffix:H,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(Y.recordId){let P=await W4(z,Y.recordId);q.push(P)}else if(Y.recordIds&&Y.recordIds.length>0)for(let P of Y.recordIds)q.push(await W4(z,P));else if(Y.sn){let T=(await i4(z,{search:Y.sn,sourceDocumentSN:Y.sn,limit:20})).records.find((A)=>A.sourceDocumentSN===Y.sn||A.sourceDocumentId===Y.sn||A.document?.sourceDocumentSN===Y.sn||A.document?.sn===Y.sn);if(!T)throw Error(`在企业「${Q.name}」中未找到单据编号为「${Y.sn}」的审批记录。`);q.push(T)}else if(Y.sns&&Y.sns.length>0)for(let P of Y.sns){let A=(await i4(z,{search:P,sourceDocumentSN:P,limit:20})).records.find((j)=>j.sourceDocumentSN===P||j.sourceDocumentId===P||j.document?.sourceDocumentSN===P||j.document?.sn===P);if(!A)throw Error(`在企业「${Q.name}」中未找到单据编号为「${P}」的审批记录。`);q.push(A)}else if(Y.limit!==void 0){let P=await i4(z,{limit:Y.limit,status:Y.status,startDate:Y.startDate,endDate:Y.endDate});if(!P.records.length)throw Error(`在企业「${Q.name}」中未检索到符合条件的审批记录。`);q=P.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((P)=>({run:P,doc:Wp(P,{snPrefix:I,snSuffix:G,docIdPrefix:W,docIdSuffix:H})}));if(X){let P={id:"preview-webhook",name:K??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${J.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await J$(U,J.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=_A0(j,K,J.id);P={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),A=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:P,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:A?T[0].originalRecord:void 0,document:A?T[0].document:void 0,records:T}}let F=await Xp(U,J,K),M={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},w=[],N=0,O=0;for(let{run:P,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let A=await Hp(F.incomingDocumentWebhook.url,F.secret,T,Z,D6(J.seal));w.push({originalRecord:{id:P.id,sourceSystem:P.sourceSystem,sourceDocumentSN:P.sourceDocumentSN,sourceDocumentId:P.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:A,success:!0}),N+=1}catch(A){let j=A instanceof Error?A.message:String(A);w.push({originalRecord:{id:P.id,sourceSystem:P.sourceSystem,sourceDocumentSN:P.sourceDocumentSN,sourceDocumentId:P.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),O+=1}}let D=w.length===1;return{success:O===0,dryRun:!1,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:M,totalCount:w.length,successCount:N,failureCount:O,originalRecord:D?w[0].originalRecord:void 0,replayedDocument:D?w[0].replayedDocument:void 0,pushResult:D?w[0].pushResult:void 0,records:w}}var FD1;var SZ=o(()=>{pB();L$();A6();FD1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var vA0,N14,MD1,D14;var hA0=o(()=>{A$();vA0=L.object({level:L.enum(["error","warning"
Line truncated
|
||||
↳ ${V}`,operator:J}}function zA0($){if(!$)return[];let Y=$.pending||[],z=String($.rawState||"").toUpperCase(),U=String($.state||"").toUpperCase(),Q=[];if(Y.length>0)for(let J of Y){let K=J.approver?.name||J.approver?.id||"待定",I=(J.name||$.currentNode||"").trim(),G=I?`${I}(${K})`:K,H=J.type?.toUpperCase()==="PAYING"||I.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${G}: ${H}`)}else if($.currentNode?.trim()){let K=$.currentNode.includes("支付")||z==="PAYING"||U==="支付中"?"待支付":"待审批";Q.push(`${$.currentNode.trim()}: ${K}`)}return Q}function XU($,Y){let z=new Map;if(!$||$.length===0)return z;if(!Y){for(let q of $){let F=(q.result||{}).decision||q.aiDecision||"-";z.set(q.id,{recordId:q.id,sourceDocumentSN:q.sourceDocumentSN,taskMode:q.taskMode,aiDecision:YA0(typeof F==="string"?F:"-"),aiAction:"-",eHumanAction:"-",eHumanComment:"-",auditDrift:!1})}return z}let U=[...$].sort((q,V)=>(Number(q.createdAt)||0)-(Number(V.createdAt)||0)),Q=Y.history||[],J=String(Y.rawState||"").toUpperCase(),K=String(Y.state||"").toUpperCase(),I=J==="DRAFT"||J==="REVOKED"||J==="CANCELED"||J==="CANCELLED"||K==="草稿"||K==="已撤回"||K==="已取消",G=J==="REJECTED"||J==="TERMINATED"||K==="审批驳回"||K==="已驳回",W=!I&&!G&&(J==="PAID"||K==="已支付"||Q.some((q)=>!q.isEbot&&(q.rawAction==="freeflow.pay"||q.action==="支付成功"||q.action==="支付完成"))),H=!I&&!G&&!W&&(J==="PAYING"||K==="支付中"||(Y.pending||[]).some((q)=>q.isCurrent&&(q.type?.toUpperCase()==="PAYING"||q.name?.includes("支付")))||Y.currentNode?.includes("支付")===!0),Z=W||!I&&!G&&!H&&(J==="COMPLETED"||J==="APPROVED"||K==="已完成"||K==="审批通过");for(let q=0;q<U.length;q++){let V=U[q];if(!V)continue;let F=Number(V.createdAt)||0,w=V.document||{},M=V.manualApprovalRecord||V.result?.manualApprovalRecord||w.manualApprovalRecord||{},O=typeof V.sourceExtendData?.nodeId==="string"?String(V.sourceExtendData.nodeId):void 0,N=typeof M.nodeId==="string"?String(M.nodeId):void 0,D=N?decodeURIComponent(N).replace(/^hcnode_/,"").replace(/_r\d+$/,""):void 0,P=O||D,T=P?Q.find((A0)=>A0.nodeId&&(A0.nodeId===P||P.includes(A0.nodeId))):void 0,A=T?.time??F,j=U[q+1],C=j?Number(j.createdAt)||1/0:1/0,b=q===U.length-1,x=Q.find((A0)=>(A0.time??0)>A+5000&&A0.isEbot&&(A0.nodeName?.includes("智能")||A0.nodeName?.includes("AI")||A0.action?.includes("智能")||A0.comment?.includes("AI")||A0.comment?.includes("approval-result"))&&!A0.nodeName?.includes("费用标准检查")&&!A0.nodeName?.includes("标准检查")&&!A0.nodeName?.includes("预算"));if(x){if(b=!1,(x.time??1/0)<C)C=x.time}let S=V.result||{},i=S.decision||V.aiDecision||"-",c=typeof i==="string"?i:"-",U0=c.toUpperCase(),k=U0==="REJECT"||U0==="驳回",d=U0==="APPROVE"||U0==="通过",t=U0==="EXEMPT_APPROVE"||U0==="免审通过"||U0==="备注通过",$0=V.taskMode||V.finalExecutionMode||"",p=String($0).toLowerCase().includes("auto")||V.finalExecutionMode==="automatic"||$0==="automatic"||$0==="fully_automatic",e="-";if(d||t)e="添加评论";else if(k)e=p?"驳回":"添加评论";else if(U0==="REVIEW"||U0==="转交复核")e="转交复核";let y=typeof M.status==="object"&&M.status!==null?String(M.status.type||M.status.label||"").toUpperCase():"",s=typeof M.status==="object"&&M.status!==null?String(M.status.sourceStatus||""):"",Y0=w.manualApprovalStatus||S.manualApprovalStatus||V.manualApprovalStatus,N0=typeof Y0==="string"?Y0.toUpperCase():"",E0=N0==="CANCELLED"||N0==="CANCELED"||N0==="已取消"||N0==="已撤回"||N0==="REVOKED"||y==="CANCELLED"||y==="CANCELED"||s.includes("撤回")||s.includes("取消"),G0=N0==="APPROVED"||N0==="已支付/审批完成"||N0==="已通过"||N0==="已完成"||N0==="已支付"||y==="APPROVED",i0=!(s.includes("补偿")||s.includes("已支付"))&&(N0==="TERMINATED"||N0==="REJECTED"||N0==="REJECT"||N0==="已驳回"||N0==="被驳回"||y==="TERMINATED"||y==="REJECTED"||y==="已驳回"||y==="被驳回"),Y1=T?1000:60000,a=Q.filter((A0)=>{let Q0=A0.time??0;return Q0>=A-Y1&&Q0<C}),H0="-",F0="-",u0=!1,b0,c0,A1=d||t,k1=Q.filter((A0)=>(A0.time??0)>A+5000),u1=k1.some((A0)=>A0.rawAction==="freeflow.retract"||A0.action==="单据撤回"),b1=k1.some((A0)=>A0.rawAction==="freeflow.submit"||A0.action==="提交送审");if(A1&&b&&(u1||b1))u0=!0,b0="AI通过后单据发生撤回/修改重提,后续未经AI复审";if(p&&k)H0="无操作",F0="-";else{let A0=a.filter((v)=>(v.time??0)>=A-1000&&!v.isEbot&&v.rawAction!=="freeflow.submit"&&v.action!=="提交送审"&&!((v.rawAction==="freeflow.comment"||v.action==="发表评论")&&!v.comment)&&!((v.rawAction==="freeflow.print"||v.action==="打印提醒")&&!v.comment)&&!(v.rawAction==="freeflow.carbonCopy"||v.rawAction==="freeflow.cc"||v.action==="抄送通知")),Q0=A0.find((v)=>v.rawAction==="freeflow.retract"||v.action==="单据撤回"),B=A0.find((v)=>v.rawAction==="freeflow.reject"||v.action==="审批驳回");if(!b)if(B||!Y&&i0){H0="审批驳回",u0=!1,b0=void 0;let v=ln(B,void 0,M,Q,Y);F0=v.commen
Line truncated
|
||||
`,{mode:384}),Y}function Ip($){let Y=DA0();for(let z of Y){if(!L$(z))continue;for(let U of uB(z).filter((Q)=>Q.endsWith(".json")).filter((Q)=>!Q.startsWith("example."))){let Q=B9(z,U);try{let J=iB(Q,"utf-8"),K=JSON.parse(J);if(K&&typeof K==="object"&&K.id===$)return Q}catch{}}}return}function y3($,Y){let z=Ip($);if(!z)throw Error(`Enterprise config not found: ${$}`);let Q={...JSON.parse(iB(z,"utf-8")),...Y};for(let K of Object.keys(Y))if(Y[K]===void 0)delete Q[K];let J=Up.parse(Q);return LA0(z,`${JSON.stringify(J,null,2)}
|
||||
`,"utf-8"),J}var Jp="SEAL_USE_ENTERPRISES_DIR",FA0="SEAL_HOME_ENTERPRISES_DIR",MA0="SEAL_USE_USER_ENTERPRISES_DIR",wA0="SEAL_HOME_USER_ENTERPRISES_DIR",OA0="SEAL_USE_CONFIG_FILE",NA0="SEAL_HOME_CONFIG_FILE",$I,bB,fB,qA0;var k3=m(()=>{Qp();$I=B9(cB(),".config","seal-use","enterprises"),bB=B9(cB(),".config","seal-home","enterprises"),fB=B9(cB(),".config","seal-use","config.json"),qA0=B9(cB(),".config","seal-home","config.json")});function n2($,Y,z=[]){let U=Y.corpId?.trim()||void 0,Q=Y.stateful?Y.defaultCorpId?.trim()||void 0:void 0,J=U??Q;if(J){let I=$.find((H)=>H.id===J);if(I)return I;let G=$.find((H)=>H.id.toLowerCase()===J.toLowerCase());if(G)return G;let W=$.find((H)=>H.name.toLowerCase()===J.toLowerCase());if(W)return W;throw Error(`No enterprise config found for ${J}`)}if(!Y.stateful)throw Error("Stateless mode is enabled. Every enterprise command requires --corp <corpId>. Use `seal-use config mode stateful` to enable a default enterprise.");let K=$[0];if(K)return K;throw Error("No enterprise config found. Add a non-example JSON file under one of: "+(z.length?z.join(", "):"the configured enterprise directories"))}import{existsSync as Gp,mkdirSync as tN1,readFileSync as eN1,renameSync as $D1,unlinkSync as YD1,writeFileSync as zD1}from"node:fs";import{homedir as UD1}from"node:os";import{dirname as QD1,join as JD1}from"node:path";function _Z(){let $=process.env[KD1]?.trim();if($)return $;return ID1}function AA0($=new Date){return $.toISOString().slice(0,10)}function BA0($=Wp,Y=new Date){let z=Y.getTime()-Math.max(0,$-1)*86400000;return new Date(z).toISOString().slice(0,10)}function PA0($=_Z()){if(!Gp($))return{};try{let Y=eN1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&!Array.isArray(z))return z;return{}}catch{return{}}}function GD1($,Y){let z={};for(let[U,Q]of Object.entries($)){if(!Q||typeof Q!=="object")continue;let J={},K=!1;for(let[I,G]of Object.entries(Q))if(typeof G==="number"&&G>0&&I>=Y)J[I]=G,K=!0;if(K)z[U]=J}return z}function WD1($,Y=_Z()){let z=QD1(Y);if(!Gp(z))tN1(z,{recursive:!0,mode:448});let U=`${Y}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2,8)}.tmp`;try{zD1(U,JSON.stringify($,null,2),{encoding:"utf-8",mode:384}),$D1(U,Y)}catch(Q){try{if(Gp(U))YD1(U)}catch{}throw Q}}function TA0($,Y=new Date){if(!$||typeof $!=="string")return;try{let z=_Z(),U=PA0(z),Q=AA0(Y),J=BA0(Wp,Y),K=GD1(U,J);K[$]=K[$]||{},K[$][Q]=(K[$][Q]??0)+1,WD1(K,z)}catch{}}function HD1($,Y=Wp,z=new Date){let U=new Map;try{let Q=PA0(),J=BA0(Y,z),K=AA0(z),I=$??Object.keys(Q);for(let G of I){let W=Q[G];if(!W){U.set(G,0);continue}let H=0;for(let[X,Z]of Object.entries(W))if(X>=J&&X<=K&&typeof Z==="number")H+=Z;U.set(G,H)}}catch{if($)for(let Q of $)U.set(Q,0)}return U}function jA0($,Y,z){let U=z??HD1($.map((Q)=>Q.id));return[...$].sort((Q,J)=>{if(Y){if(Q.id===Y&&J.id!==Y)return-1;if(J.id===Y&&Q.id!==Y)return 1}let K=U.get(Q.id)??0,I=U.get(J.id)??0;if(K!==I)return I-K;let G=Q.name??Q.id,W=J.name??J.id,H=G.localeCompare(W,"zh-CN");if(H!==0)return H;return Q.id.localeCompare(J.id)})}var KD1="SEAL_USE_USAGE_FILE",ID1,Wp=7;var nB=m(()=>{ID1=JD1(UD1(),".config","seal-use","usage.json")});function XD1($,Y){return $.map((z)=>z.trim()).filter(Boolean).map((z)=>Y?z:z.toLowerCase())}function ZD1($,Y){return Y?$:$.toLowerCase()}function qD1($,Y,z,U){let Q=ZD1($,U),J=Y.filter((K)=>Q.includes(K));if(z==="all"&&J.length!==Y.length)return[];return J}function VD1($){if(typeof $==="string")return $.split(/\r?\n/);return JSON.stringify($,null,2).split(/\r?\n/)}function LD1($,Y){if(Y.fields&&!Y.fields.has($.field))return[];let z=VD1($.value),U=[];return z.forEach((Q,J)=>{let K=qD1(Q,Y.keywords,Y.matchMode,Y.caseSensitive);if(K.length===0)return;let I=Math.max(0,J-Y.contextLines),G=Math.min(z.length,J+Y.contextLines+1),W={area:$.area,entityType:$.entityType,entityId:$.entityId,title:$.title,field:$.field,lineNumber:J+1,matchedKeywords:K,matchedText:pB(Q,Y.maxChars),context:{before:Y.snippetOnly?[]:z.slice(I,J).map((H)=>pB(H,Y.maxChars)),line:pB(Q,Y.maxChars),after:Y.snippetOnly?[]:z.slice(J+1,G).map((H)=>pB(H,Y.maxChars))},metadata:$.metadata};if(Y.snippetOnly)W.context={before:[],line:W.context.line,after:[]};U.push(W)}),U}function pB($,Y){if(!Y||$.length<=Y)return $;return`${$.slice(0,Math.max(0,Y))}...`}function FD1($){return[{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"description",value:$.description,metadata:{scope:$.scope,strictness:$.strictness,status:$.status}},{area:"rules",entityType:"rule",entityId:$.id,title:$.scope,field:"scope",value:$.scope,metadata:{strictness:$.strictness,status:$.status}}]}function CA0($){return $.rules.flatMap((Y,z)=>{let U=`${$.id}:${Y.description.slice(0,32)}`,Q={versionId:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedByName:$.publishedByName,publishedAt:$.publishedAt,scope:Y.scope,strictness:Y.strictness,code:"code"in Y?Y.code:void 0,index:z};return[{area:"rules",entityType:"rule",entityId:U,title:`${$.versionName} / ${Y.scope}`,field:"hi
Line truncated
|
||||
`):[]}function PD1($,Y){let z=Array.from({length:$.length+1},()=>Array(Y.length+1).fill(0));for(let K=$.length-1;K>=0;K-=1)for(let I=Y.length-1;I>=0;I-=1)z[K][I]=$[K]===Y[I]?z[K+1][I+1]+1:Math.max(z[K+1][I],z[K][I+1]);let U=[],Q=0,J=0;while(Q<$.length&&J<Y.length)if($[Q]===Y[J])U.push(` ${$[Q]}`),Q+=1,J+=1;else if(z[Q+1][J]>=z[Q][J+1])U.push(`-${$[Q]}`),Q+=1;else U.push(`+${Y[J]}`),J+=1;while(Q<$.length)U.push(`-${$[Q++]}`);while(J<Y.length)U.push(`+${Y[J++]}`);return U}function TD1($,Y,z,U,Q){let J=hA0(U),K=hA0(Q),I=`v${Y.versionNumber}`,G=`v${z.versionNumber}`,W=U?`a/rules/${$}`:"/dev/null",H=Q?`b/rules/${$}`:"/dev/null",X=J.length,Z=K.length,q=X?1:0,V=Z?1:0;return[`diff --git a/rules/${$} b/rules/${$}`,`--- ${W} ${I}`,`+++ ${H} ${G}`,`@@ -${q},${X} +${V},${Z} @@`,...PD1(J,K)].join(`
|
||||
`)}function SA0($){return{id:$.id,versionNumber:$.versionNumber,versionName:$.versionName,publishedAt:$.publishedAt}}function gA0($){let Y=new Map;for(let z of $.rules){let U=Xp(z),Q=BD1(U);if(!Q)throw Error(`Rule version ${$.versionNumber} contains a rule without a stable rule ID. Cross-version diff refuses to match by code or position.`);if(Y.has(Q))throw Error(`Rule version ${$.versionNumber} contains duplicate stable rule ID: ${Q}`);Y.set(Q,U)}return Y}function kA0($,Y,z={}){let U=gA0($),Q=gA0(Y),J=[...new Set([...U.keys(),...Q.keys()])],K=[],I={added:0,removed:0,modified:0,unchanged:0},G=SA0($),W=SA0(Y);for(let X of J){let Z=U.get(X),q=Q.get(X),V;if(!Z)V="added";else if(!q)V="removed";else if(JSON.stringify(vZ(Z))!==JSON.stringify(vZ(q)))V="modified";else V="unchanged";if(I[V]+=1,V==="unchanged"&&!z.includeUnchanged)continue;let F=Z?vZ(Z):void 0,w=q?vZ(q):void 0,M=V==="modified"?[...new Set([...Object.keys(F??{}),...Object.keys(w??{})])].filter((O)=>JSON.stringify(F?.[O])!==JSON.stringify(w?.[O])):void 0;K.push({status:V,ruleId:X,...Z?{before:Z}:{},...q?{after:q}:{},...M?.length?{changedFields:M}:{},...V!=="unchanged"?{diff:TD1(X,G,W,Z,q)}:{}})}let H=K.filter((X)=>X.diff).map((X)=>X.diff).join(`
|
||||
`);return{from:G,to:W,counts:I,changes:K,unifiedDiff:H}}var yA0,AD1;var xA0=m(()=>{yA0=["id","ruleId","stableId"],AD1=new Set([...yA0,"code","ruleCode","tenantId","createdAt","updatedAt","versionId","versionNumber"])});import{createHmac as jD1,randomBytes as ED1}from"node:crypto";function CD1($,Y,z,U){return jD1("sha256",U).update(`${$}.${Y}.${JSON.stringify(z)}`).digest("hex")}function hZ($,Y){let z=Math.floor(Date.now()/1000),U=ED1(16).toString("hex");return{Authorization:`Bearer ${Y}`,"x-webhook-signature":CD1(z,U,$,Y),"x-webhook-timestamp":String(z),"x-webhook-nonce":U}}var dB=()=>{};function m4($,Y){return new M4($,2,Y)}function P9($,Y){return new M4($,10,Y)}function SZ($){if($ instanceof M4)return{exitCode:$.exitCode,nextAction:$.nextAction};let Y=$ instanceof Error?$.message:String($),z=RD1($);if(z===401||z===403||/(?:^|\s)(?:token|bearer|session) (?:expired|missing|invalid)/i.test(Y))return{exitCode:11};if(/^(?:Usage:|Unknown (?:[a-z0-9_-]+ )?command|Invalid (?:number|boolean|command)|--json must|Missing required JSON field)/i.test(Y))return{exitCode:2};if(/^Refusing to (?:clear|delete)|without --yes|without confirm=true/i.test(Y))return{exitCode:10};return{exitCode:1}}function RD1($){if(!$||typeof $!=="object")return;let Y=$.response;if(!Y||typeof Y!=="object")return;let z=Y.status;return typeof z==="number"?z:void 0}var M4,mB;var F$=m(()=>{M4=class M4 extends Error{exitCode;nextAction;constructor($,Y,z){super($);this.name="CliError",this.exitCode=Y,this.nextAction=z}};mB=class mB extends M4{constructor($,Y){super($,12,Y);this.name="PayloadTooLargeError"}}});function fA0($,Y){let z=$&&typeof $==="object"?$:{},U=typeof z.type==="string"?z.type.toUpperCase().trim():"",Q=typeof z.key==="string"&&z.key.trim()?z.key.trim():typeof z.label==="string"&&z.label.trim()?z.label.trim():`field_${Y}`,J=typeof z.label==="string"&&z.label.trim()?z.label.trim():Q,K=z.value!==void 0?z.value:null;if(U==="LIST"&&Array.isArray(K))K=K.map((G)=>{if(Array.isArray(G))return G.map((W,H)=>fA0(W,H));return G});let I=U;if(!_D1.has(I))if(Array.isArray(K))I="LIST";else if(K&&typeof K==="object")I="OBJECT";else if(typeof K==="number")I="NUMBER";else I="TEXT";return{key:Q,label:J,type:I,value:K}}function Zp($,Y={}){let z=$.document,U=$.sourceDocumentSN??(typeof z?.sn==="string"?z.sn:void 0)??(typeof z?.sourceDocumentSN==="string"?z.sourceDocumentSN:void 0)??$.id,Q=$.sourceDocumentId??(typeof z?.id==="string"?z.id:void 0)??(typeof z?.sourceDocumentId==="string"?z.sourceDocumentId:void 0)??$.documentId??$.id,J=Y.snPrefix??"",K=Y.snSuffix??"",I=Y.docIdPrefix??J,G=Y.docIdSuffix??K,W=`${J}${U}${K}`,H=`${I}${Q}${G}`,X=typeof z?.sourceStartTime==="number"?z.sourceStartTime:typeof $.createdAt==="number"?Math.floor($.createdAt/1000):null,q=(Array.isArray(z?.fields)?z.fields:[]).map((V,F)=>fA0(V,F));return{type:"document",documentId:H,documentSN:W,startTime:X,fields:q}}function vD1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error(`Webhook URL 必须包含 /webhook/{webhookId}/document,收到: ${$}`);let U=z[1],Q=`${Y.protocol}//${Y.host}`,J=`${Q}/api/v1/integrations/webhook/${encodeURIComponent(U)}/document`;return{baseUrl:Q,webhookId:U,documentEndpoint:J}}async function qp($,Y,z,U=fetch,Q={}){let{webhookId:J,documentEndpoint:K}=vD1($),I={...Q,"Content-Type":"application/json",...hZ({webhookId:J,...z},Y)},G=await U(K,{method:"POST",headers:I,body:JSON.stringify(z)});if(!G.ok){let W=await G.text();throw Error(`Webhook 单据推送失败 (${G.status}): ${W}`)}return G.json()}function uA0($,Y,z){if(Y){let U=Y.trim().toLowerCase(),Q=$.find((J)=>J.id.toLowerCase()===U||J.name.toLowerCase()===U||J.incomingDocumentWebhook.id.toLowerCase()===U);if(!Q){let J=$.map((K)=>`"${K.name}" (${K.id})`).join(", ");throw Error(`未找到匹配 "${Y}" 的 Webhook 集成通道。可用通道: [${J}]`)}return Q}if($.length===1)return $[0];if($.length>1){let U=$.find((J)=>J.name.includes("回放")||J.name.toLowerCase().includes("replay"));if(U)return U;let Q=$.map((J)=>`"${J.name}" (${J.id})`).join(", ");throw Error(`当前租户存在多个 Webhook 通道 [${Q}],请通过 --webhook <idOrName> 指定目标通道。`)}throw new M4("当前租户未配置任何 Webhook 集成通道。",1,`seal-use webhook add --name <name> --result-url <url>${z?` --corp ${z}`:""}`)}function lB($,Y){let z,U,{sourceCorpId:Q,targetCorpId:J,activeCorp:K,force:I}=$;if(Q&&J)z=Y(Q),U=Y(J);else if(Q&&!J)if(z=Y(Q),z.testCorpId)U=Y(z.testCorpId);else if(K.id!==z.id&&K.environment==="test")U=K;else U=K;else if(!Q&&J)if(U=Y(J),U.prodCorpId)z=Y(U.prodCorpId);else if(K.id!==U.id)z=K;else z=K;else if(K.environment==="test")if(U=K,K.prodCorpId)z=Y(K.prodCorpId);else z=K;else if(K.environment==="production")if(z=K,K.testCorpId)U=Y(K.testCorpId);else U=K;else z=K,U=K;if(U.environment==="production"&&!I)throw new M4(`目标企业「${U.name}」(${U.id}) 标记为生产正式环境 (production)。
|
||||
`+"为防止测试单据污染生产审批流,禁止向生产环境重放单据。请指定测试企业 (--target-corp <testCorpId>),或在确有需要时添加 --force。",1,`seal-use webhook replay --target-corp <testCorpId>${z.id!==U.id?` --source-corp ${z.id}`:""}`);return{sourceCorp:z,targetCorp:U}}async function Vp($,Y,z){let U=Y.seal?.endpoints?.approvalStylePreferences??"api/v1/agent/ai-approval/config",Q=await K$($,U);if(z||Q.length>0)return uA0(Q,z,Y.id);if(Y.environment==="test"||Y.id.toLowerCase().includes("test")){console.error(`[webhook-replay] 测试企业「${Y.name}」未配置 Webhook 通道,正在自动创建「(Seal测-回放通道)」...`);let J=(Y.seal.url??Y.source?.sealUrl??`https://${Y.id.toLowerCase()}.sealai.cc`).replace(/\/+$/,"");return await ww($,J,{name:"(Seal测-回放通道)",mode:"assisted",outgoingResultWebhook:`${J}/api/v1/integrations/webhook/replay-mock-callback`},Y.seal.endpoints.approvalStylePreferences)}throw new M4(`当前租户「${Y.name}」未配置任何 Webhook 集成通道。`,1,`seal-use webhook add --name <name> --result-url <url> --corp ${Y.id}`)}async function YI($){let{query:Y,sourceClient:z,targetClient:U,sourceCorp:Q,targetCorp:J,webhookSelector:K,snPrefix:I,snSuffix:G,docIdPrefix:W,docIdSuffix:H,dryRun:X,fetchFn:Z=fetch}=$,q=[];if(Y.recordId){let P=await W4(z,Y.recordId);q.push(P)}else if(Y.recordIds&&Y.recordIds.length>0)for(let P of Y.recordIds)q.push(await W4(z,P));else if(Y.sn){let T=(await i4(z,{search:Y.sn,sourceDocumentSN:Y.sn,limit:20})).records.find((A)=>A.sourceDocumentSN===Y.sn||A.sourceDocumentId===Y.sn||A.document?.sourceDocumentSN===Y.sn||A.document?.sn===Y.sn);if(!T)throw Error(`在企业「${Q.name}」中未找到单据编号为「${Y.sn}」的审批记录。`);q.push(T)}else if(Y.sns&&Y.sns.length>0)for(let P of Y.sns){let A=(await i4(z,{search:P,sourceDocumentSN:P,limit:20})).records.find((j)=>j.sourceDocumentSN===P||j.sourceDocumentId===P||j.document?.sourceDocumentSN===P||j.document?.sn===P);if(!A)throw Error(`在企业「${Q.name}」中未找到单据编号为「${P}」的审批记录。`);q.push(A)}else if(Y.limit!==void 0){let P=await i4(z,{limit:Y.limit,status:Y.status,startDate:Y.startDate,endDate:Y.endDate});if(!P.records.length)throw Error(`在企业「${Q.name}」中未检索到符合条件的审批记录。`);q=P.records}else throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let V=q.map((P)=>({run:P,doc:Zp(P,{snPrefix:I,snSuffix:G,docIdPrefix:W,docIdSuffix:H})}));if(X){let P={id:"preview-webhook",name:K??"预览目标通道",mode:"assisted",incomingDocumentWebhookUrl:`${J.seal.url}/api/v1/integrations/webhook/preview`};try{let j=await K$(U,J.seal.endpoints.approvalStylePreferences);if(j.length>0){let C=uA0(j,K,J.id);P={id:C.id,name:C.name,mode:C.mode,incomingDocumentWebhookUrl:C.incomingDocumentWebhook.url}}}catch{}let T=V.map(({run:j,doc:C})=>({originalRecord:{id:j.id,sourceSystem:j.sourceSystem,sourceDocumentSN:j.sourceDocumentSN,sourceDocumentId:j.sourceDocumentId},document:C,success:!0})),A=T.length===1;return{dryRun:!0,success:!0,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:P,totalCount:T.length,successCount:T.length,failureCount:0,originalRecord:A?T[0].originalRecord:void 0,document:A?T[0].document:void 0,records:T}}let F=await Vp(U,J,K),w={id:F.id,name:F.name,mode:F.mode,incomingDocumentWebhookUrl:F.incomingDocumentWebhook.url},M=[],O=0,N=0;for(let{run:P,doc:T}of V){console.error(`[webhook-replay] 正在向 Webhook 通道「${F.name}」推送单据: ${T.documentSN}...`);try{let A=await qp(F.incomingDocumentWebhook.url,F.secret,T,Z,D6(J.seal));M.push({originalRecord:{id:P.id,sourceSystem:P.sourceSystem,sourceDocumentSN:P.sourceDocumentSN,sourceDocumentId:P.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},pushResult:A,success:!0}),O+=1}catch(A){let j=A instanceof Error?A.message:String(A);M.push({originalRecord:{id:P.id,sourceSystem:P.sourceSystem,sourceDocumentSN:P.sourceDocumentSN,sourceDocumentId:P.sourceDocumentId},replayedDocument:{documentSN:T.documentSN,documentId:T.documentId,fieldCount:T.fields.length},error:j,success:!1}),N+=1}}let D=M.length===1;return{success:N===0,dryRun:!1,sourceCorp:{id:Q.id,name:Q.name,environment:Q.environment},targetCorp:{id:J.id,name:J.name,environment:J.environment},targetWebhook:w,totalCount:M.length,successCount:O,failureCount:N,originalRecord:D?M[0].originalRecord:void 0,replayedDocument:D?M[0].replayedDocument:void 0,pushResult:D?M[0].pushResult:void 0,records:M}}var _D1;var gZ=m(()=>{dB();F$();A6();_D1=new Set(["TEXT","NUMBER","DATE","AMOUNT","PERSON","ATTACHMENT","DATE_RANGE","DEPARTMENT","LIST","CITY","OBJECT"])});var bA0,y14,hD1,k14;var iA0=m(()=>{B$();bA0=L.object({level:L.enum(["error","warning"
Line truncated
|
||||
* ==============================================================================
|
||||
* Seal 官方标准规则校验器 (Official Standard Rule Linter)
|
||||
* ==============================================================================
|
||||
@@ -876,47 +879,48 @@ export function lintRule(rule: RuleLintTarget): RuleLintResult {
|
||||
}
|
||||
|
||||
export default lintRule;
|
||||
`}});import{existsSync as qU,mkdirSync as hD1,readFileSync as SD1,readdirSync as xA0,rmSync as gD1,unlinkSync as yD1,writeFileSync as kD1}from"node:fs";import{homedir as xD1}from"node:os";import{isAbsolute as fD1,join as f6,resolve as uD1}from"node:path";import{pathToFileURL as yA0}from"node:url";function fA0($=i$){let Y=[],z=[];try{if(!qU($))hD1($,{recursive:!0});let U=Object.keys(Lp);for(let[J,K]of Object.entries(Lp)){let I=f6($,J),G=!0;if(qU(I))try{if(SD1(I,"utf8")===K)G=!1}catch{G=!0}if(G)kD1(I,K,"utf8");Y.push(J)}let Q=xA0($,{withFileTypes:!0});for(let J of Q)if(!U.includes(J.name)){let K=f6($,J.name);try{if(J.isDirectory())gD1(K,{recursive:!0,force:!0});else yD1(K);z.push(J.name)}catch{}}}catch{}return{synced:Y,pruned:z}}function uA0($={syncOfficial:!0}){if($.syncOfficial!==!1)fA0();let Y=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[b$,lB];for(let U of z)if(qU(U))try{let Q=xA0(U,{withFileTypes:!0});for(let J of Q){if(J.isDirectory())continue;let K=J.name;if(K.endsWith(".ts")||K.endsWith(".js")||K.endsWith(".mjs")){let I=K.replace(/\.(ts|js|mjs)$/,"");if(!Y.some((G)=>G.name===I))Y.push({name:I,type:"custom",path:f6(U,K),description:`用户自定义规则校验器 (${K})`})}}}catch{}return Y}function iD1($){let Y=($||"").trim();if(!Y||Y==="builtin"||Y==="default"||Y==="official/builtin"||Y==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(Y==="strict"||Y==="official/strict"||Y==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(Y==="hlab"||Y==="hlab-sop"||Y==="hlab-rules"||Y==="hlab-standard"||Y==="official/hlab"||Y==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(fD1(Y)||Y.startsWith("./")||Y.startsWith("../")){let U=uD1(Y);if(qU(U))return{path:U};for(let Q of[".ts",".js",".mjs"])if(qU(`${U}${Q}`))return{path:`${U}${Q}`}}let z=[f6(b$,`${Y}.ts`),f6(b$,`${Y}.js`),f6(b$,`${Y}.mjs`),f6(lB,`${Y}.ts`),f6(lB,`${Y}.js`),f6(lB,`${Y}.mjs`)];for(let U of z)if(qU(U))return{path:U};return{}}async function wp($){fA0();let Y=iD1($??"builtin");if(Y.isOfficial){let U=Y.officialKind==="strict"?SA0:Y.officialKind==="hlab"?gA0:YI,Q=Y.officialKind==="builtin"?"builtin":"official",J=Y.path;if(J&&qU(J))try{let I=await import(yA0(J).href),G=I.default??I.lintRule??I.linter??I.lint;if(typeof G==="function")return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:kA0(G,U)}}catch{}return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:U}}let z=Y.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:YI};try{let Q=await import(yA0(z).href),J=Q.default??Q.lintRule??Q.linter??Q.lint;if(typeof J!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:YI};return{name:$??"custom",type:"custom",filePath:z,linter:kA0(J,YI)}}catch(U){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${U?.message??U}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:YI}}}function kA0($,Y){return async(z,U)=>{try{let Q=await $(z,U);if(Q&&typeof Q==="object"&&typeof Q.score==="number"&&Array.isArray(Q.issues))return Q;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),Y(z,U)}catch(Q){return console.error("⚠️ [linter] 自定义校验器执行异常:",Q),Y(z,U)}}}var b$,bD1="official",i$,lB;var Mp=o(()=>{Zp();Vp();Fp();qp();b$=f6(xD1(),".config","seal-use","linters"),i$=f6(b$,bD1),lB=f6(process.cwd(),"linters")});async function Op($,Y,z){let U=await Y.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:U.score,passed:U.passed,issues:U.issues,description:$.description}}async function bA0($,Y,z,U){let Q=U?.minScore??0,J=U?.level??"all",K=[],I=0;for(let q of $){let V=await Op(q,Y,z);I+=V.score;let F=V.issues;if(J==="error")F=V.issues.filter((w)=>w.level==="error");else if(J==="warning")F=V.issues.filter((w)=>w.level==="warning"||w.level==="error");let M=F.every((w)=>w.level!=="error");if(U?.summary){if(F.length>0)K.push({...V,passed:M,issues:F})}else K.push({...V,passed:M,issues:F})}let G=$.length,W=G===0?100:Math.round(I/G),H=K.filter((q)=>q.issues.length>0).length,X=G-Line truncated
|
||||
`,"utf8"),z}function pA0($){return $.map((Y,z)=>{let U;if(typeof Y.code==="number")U=`#${String(Y.code).padStart(4,"0")}`;else if(typeof Y.code==="string")U=Y.code.startsWith("#")?Y.code:`#${Y.code}`;else U=`#${String(z+1).padStart(4,"0")}`;return{id:Y.id,code:U,name:Y.name,description:Y.description,scope:Y.scope,strictness:Y.strictness}})}var dA0=()=>{};var mA0,D5;var zI=o(()=>{mA0=class mA0 extends Error{errors;warnings;constructor($,Y=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
|
||||
`));this.errors=$;this.warnings=Y;this.name="ResourcePackValidationError"}};D5=mA0});var sA0=E((r14,rA0)=>{rA0.exports=oB;function oB(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}oB.prototype.go=function($){if(this.pending<this.max)oA0(this,$);else this.waiting.push($)};oB.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};oB.prototype.hold=function(){return lA0(this)};function lA0($){$.pending+=1;var Y=!1;return z;function z(Q){if(Y)throw Error("callback called twice");if(Y=!0,$.error=$.error||Q,$.pending-=1,$.waiting.length>0&&$.pending<$.max)oA0($,$.waiting.shift());else if($.pending===0){var J=$.listeners;$.listeners=[],J.forEach(U)}}function U(Q){Q($.error)}}function oA0($,Y){Y(lA0($))}});var eA0=E((sD1)=>{var Ap=K0("fs"),Bp=K0("util"),aA0=K0("stream"),tA0=aA0.Readable,oD1=aA0.PassThrough,rD1=sA0(),rB=K0("events").EventEmitter;sD1.BufferSlicer=QI;sD1.FdSlicer=UI;Bp.inherits(UI,rB);function UI($){rB.call(this),this.fd=$,this.pend=new rD1,this.pend.max=1,this.refCount=0}UI.prototype.read=function($,Y,z,U,Q){var J=this;J.pend.go(function(K){Ap.read(J.fd,$,Y,z,U,function(I,G,W){K(),Q(I,G,W)})})};UI.prototype.createReadStream=function($){return new gZ(this,$)};UI.prototype.ref=function(){this.refCount+=1};UI.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Ap.close($.fd,Y);function Y(z){if(z)$.emit("error",z);else $.emit("close")}};Bp.inherits(gZ,tA0);function gZ($,Y){Y=Y||{},tA0.call(this,Y),this.context=$,this.context.ref(),this.start=Y.start||0,this.endOffset=Y.end,this.pos=this.start}gZ.prototype._read=function($){var Y=this,z=Math.min(Y._readableState.highWaterMark,$);if(Y.endOffset!=null)z=Math.min(z,Y.endOffset-Y.pos);if(z<=0){Y.push(null),this._cleanup();return}Y.context.pend.go(function(U){var Q=Buffer.allocUnsafe(z);Ap.read(Y.context.fd,Q,0,z,Y.pos,function(J,K){if(J)Y.destroy(J);else if(K===0)Y.push(null),Y._cleanup();else Y.pos+=K,Y.push(Q.slice(0,K));U()})})};gZ.prototype._destroy=function($,Y){this._cleanup(),Y($)};gZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};Bp.inherits(QI,rB);function QI($){rB.call(this),this.refCount=0,this.buffer=$}QI.prototype.read=function($,Y,z,U,Q){if(!(0<=Y&&Y<=$.length))throw RangeError("offset outside buffer: 0 <= "+Y+" <= "+$.length);if(U<0)throw RangeError("position is negative: "+U);if(Y+z>$.length)z=$.length-Y;if(U+z>this.buffer.length)z=this.buffer.length-U;if(z<=0){setImmediate(function(){Q(null,0)});return}this.buffer.copy($,Y,U,U+z),setImmediate(function(){Q(null,z)})};QI.prototype.createReadStream=function($){$=$||{};var Y=new oD1($);Y.start=$.start||0,Y.endOffset=$.end,Y.pos=Y.endOffset||this.buffer.length;var z=this.buffer.slice(Y.start,Y.pos),U=65536,Q=0;while(!0){var J=Q+U;if(J>=z.length){if(Q<z.length)Y.write(z.slice(Q,z.length));break}Y.write(z.slice(Q,J)),Q=J}return Y.end(),Y};QI.prototype.ref=function(){this.refCount+=1};QI.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var YB0=E((a14,$B0)=>{var eD1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,
Line truncated
|
||||
`}});import{existsSync as VU,mkdirSync as mD1,readFileSync as lD1,readdirSync as mA0,rmSync as oD1,unlinkSync as rD1,writeFileSync as sD1}from"node:fs";import{homedir as aD1}from"node:os";import{isAbsolute as tD1,join as f6,resolve as eD1}from"node:path";import{pathToFileURL as pA0}from"node:url";function lA0($=i$){let Y=[],z=[];try{if(!VU($))mD1($,{recursive:!0});let U=Object.keys(wp);for(let[J,K]of Object.entries(wp)){let I=f6($,J),G=!0;if(VU(I))try{if(lD1(I,"utf8")===K)G=!1}catch{G=!0}if(G)sD1(I,K,"utf8");Y.push(J)}let Q=mA0($,{withFileTypes:!0});for(let J of Q)if(!U.includes(J.name)){let K=f6($,J.name);try{if(J.isDirectory())oD1(K,{recursive:!0,force:!0});else rD1(K);z.push(J.name)}catch{}}}catch{}return{synced:Y,pruned:z}}function oA0($={syncOfficial:!0}){if($.syncOfficial!==!1)lA0();let Y=[{name:"builtin",type:"builtin",path:f6(i$,"builtin.ts"),description:"Seal 官方标准校验器 (拦截过短描述、主观模糊词与悬空例外条款)"},{name:"strict",type:"official",path:f6(i$,"strict.ts"),description:"Seal 官方严格风控校验器 (强校验字数、刚性定量约束、凭证依据与具体审批人角色)"},{name:"hlab",type:"official",path:f6(i$,"hlab.ts"),description:"合思实验室 (HLab) 结构化规则校验器 (SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判)"}],z=[b$,oB];for(let U of z)if(VU(U))try{let Q=mA0(U,{withFileTypes:!0});for(let J of Q){if(J.isDirectory())continue;let K=J.name;if(K.endsWith(".ts")||K.endsWith(".js")||K.endsWith(".mjs")){let I=K.replace(/\.(ts|js|mjs)$/,"");if(!Y.some((G)=>G.name===I))Y.push({name:I,type:"custom",path:f6(U,K),description:`用户自定义规则校验器 (${K})`})}}}catch{}return Y}function YA1($){let Y=($||"").trim();if(!Y||Y==="builtin"||Y==="default"||Y==="official/builtin"||Y==="official/builtin.ts")return{path:f6(i$,"builtin.ts"),isOfficial:!0,officialKind:"builtin"};if(Y==="strict"||Y==="official/strict"||Y==="official/strict.ts")return{path:f6(i$,"strict.ts"),isOfficial:!0,officialKind:"strict"};if(Y==="hlab"||Y==="hlab-sop"||Y==="hlab-rules"||Y==="hlab-standard"||Y==="official/hlab"||Y==="official/hlab.ts")return{path:f6(i$,"hlab.ts"),isOfficial:!0,officialKind:"hlab"};if(tD1(Y)||Y.startsWith("./")||Y.startsWith("../")){let U=eD1(Y);if(VU(U))return{path:U};for(let Q of[".ts",".js",".mjs"])if(VU(`${U}${Q}`))return{path:`${U}${Q}`}}let z=[f6(b$,`${Y}.ts`),f6(b$,`${Y}.js`),f6(b$,`${Y}.mjs`),f6(oB,`${Y}.ts`),f6(oB,`${Y}.js`),f6(oB,`${Y}.mjs`)];for(let U of z)if(VU(U))return{path:U};return{}}async function Np($){lA0();let Y=YA1($??"builtin");if(Y.isOfficial){let U=Y.officialKind==="strict"?cA0:Y.officialKind==="hlab"?nA0:zI,Q=Y.officialKind==="builtin"?"builtin":"official",J=Y.path;if(J&&VU(J))try{let I=await import(pA0(J).href),G=I.default??I.lintRule??I.linter??I.lint;if(typeof G==="function")return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:dA0(G,U)}}catch{}return{name:Y.officialKind??"builtin",type:Q,filePath:J,linter:U}}let z=Y.path;if(!z)return console.error(`⚠️ [linter] 未找到自定义校验器 "${$}",已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:zI};try{let Q=await import(pA0(z).href),J=Q.default??Q.lintRule??Q.linter??Q.lint;if(typeof J!=="function")return console.error(`⚠️ [linter] 自定义校验器 "${z}" 未导出标准函数 (default / lintRule),已安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:zI};return{name:$??"custom",type:"custom",filePath:z,linter:dA0(J,zI)}}catch(U){return console.error(`⚠️ [linter] 加载自定义校验器脚本 "${z}" 失败(语法错误或依赖缺失: ${U?.message??U}),已自动安全降级至内置标准校验器。`),{name:"builtin",type:"builtin",linter:zI}}}function dA0($,Y){return async(z,U)=>{try{let Q=await $(z,U);if(Q&&typeof Q==="object"&&typeof Q.score==="number"&&Array.isArray(Q.issues))return Q;return console.error("⚠️ [linter] 自定义校验器返回值格式不符合 RuleLintResult 契约,已回退至内置结果。"),Y(z,U)}catch(Q){return console.error("⚠️ [linter] 自定义校验器执行异常:",Q),Y(z,U)}}}var b$,$A1="official",i$,oB;var Dp=m(()=>{Lp();Mp();Op();Fp();b$=f6(aD1(),".config","seal-use","linters"),i$=f6(b$,$A1),oB=f6(process.cwd(),"linters")});async function Ap($,Y,z){let U=await Y.linter($,z);return{ruleId:$.id,ruleCode:$.code,ruleName:$.name,score:U.score,passed:U.passed,issues:U.issues,description:$.description}}async function rA0($,Y,z,U){let Q=U?.minScore??0,J=U?.level??"all",K=[],I=0;for(let q of $){let V=await Ap(q,Y,z);I+=V.score;let F=V.issues;if(J==="error")F=V.issues.filter((M)=>M.level==="error");else if(J==="warning")F=V.issues.filter((M)=>M.level==="warning"||M.level==="error");let w=F.every((M)=>M.level!=="error");if(U?.summary){if(F.length>0)K.push({...V,passed:w,issues:F})}else K.push({...V,passed:w,issues:F})}let G=$.length,W=G===0?100:Math.round(I/G),H=K.filter((q)=>q.issues.length>0).length,X=G-Line truncated
|
||||
`,"utf8"),z}function eA0($){return $.map((Y,z)=>{let U;if(typeof Y.code==="number")U=`#${String(Y.code).padStart(4,"0")}`;else if(typeof Y.code==="string")U=Y.code.startsWith("#")?Y.code:`#${Y.code}`;else U=`#${String(z+1).padStart(4,"0")}`;return{id:Y.id,code:U,name:Y.name,description:Y.description,scope:Y.scope,strictness:Y.strictness}})}var $B0=()=>{};var YB0,D5;var UI=m(()=>{YB0=class YB0 extends Error{errors;warnings;constructor($,Y=[]){super([`webhook 资源包校验失败:${$.length} 个错误`,...$.map((z)=>`- ${z}`)].join(`
|
||||
`));this.errors=$;this.warnings=Y;this.name="ResourcePackValidationError"}};D5=YB0});var JB0=E((H44,QB0)=>{QB0.exports=rB;function rB(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}rB.prototype.go=function($){if(this.pending<this.max)UB0(this,$);else this.waiting.push($)};rB.prototype.wait=function($){if(this.pending===0)$(this.error);else this.listeners.push($)};rB.prototype.hold=function(){return zB0(this)};function zB0($){$.pending+=1;var Y=!1;return z;function z(Q){if(Y)throw Error("callback called twice");if(Y=!0,$.error=$.error||Q,$.pending-=1,$.waiting.length>0&&$.pending<$.max)UB0($,$.waiting.shift());else if($.pending===0){var J=$.listeners;$.listeners=[],J.forEach(U)}}function U(Q){Q($.error)}}function UB0($,Y){Y(zB0($))}});var GB0=E((HA1)=>{var Tp=K0("fs"),jp=K0("util"),KB0=K0("stream"),IB0=KB0.Readable,GA1=KB0.PassThrough,WA1=JB0(),sB=K0("events").EventEmitter;HA1.BufferSlicer=JI;HA1.FdSlicer=QI;jp.inherits(QI,sB);function QI($){sB.call(this),this.fd=$,this.pend=new WA1,this.pend.max=1,this.refCount=0}QI.prototype.read=function($,Y,z,U,Q){var J=this;J.pend.go(function(K){Tp.read(J.fd,$,Y,z,U,function(I,G,W){K(),Q(I,G,W)})})};QI.prototype.createReadStream=function($){return new yZ(this,$)};QI.prototype.ref=function(){this.refCount+=1};QI.prototype.unref=function(){var $=this;if($.refCount-=1,$.refCount<0)throw Error("invalid unref");if($.refCount>0)return;Tp.close($.fd,Y);function Y(z){if(z)$.emit("error",z);else $.emit("close")}};jp.inherits(yZ,IB0);function yZ($,Y){Y=Y||{},IB0.call(this,Y),this.context=$,this.context.ref(),this.start=Y.start||0,this.endOffset=Y.end,this.pos=this.start}yZ.prototype._read=function($){var Y=this,z=Math.min(Y._readableState.highWaterMark,$);if(Y.endOffset!=null)z=Math.min(z,Y.endOffset-Y.pos);if(z<=0){Y.push(null),this._cleanup();return}Y.context.pend.go(function(U){var Q=Buffer.allocUnsafe(z);Tp.read(Y.context.fd,Q,0,z,Y.pos,function(J,K){if(J)Y.destroy(J);else if(K===0)Y.push(null),Y._cleanup();else Y.pos+=K,Y.push(Q.slice(0,K));U()})})};yZ.prototype._destroy=function($,Y){this._cleanup(),Y($)};yZ.prototype._cleanup=function(){if(this.context!=null)this.context.unref(),this.context=null};jp.inherits(JI,sB);function JI($){sB.call(this),this.refCount=0,this.buffer=$}JI.prototype.read=function($,Y,z,U,Q){if(!(0<=Y&&Y<=$.length))throw RangeError("offset outside buffer: 0 <= "+Y+" <= "+$.length);if(U<0)throw RangeError("position is negative: "+U);if(Y+z>$.length)z=$.length-Y;if(U+z>this.buffer.length)z=this.buffer.length-U;if(z<=0){setImmediate(function(){Q(null,0)});return}this.buffer.copy($,Y,U,U+z),setImmediate(function(){Q(null,z)})};JI.prototype.createReadStream=function($){$=$||{};var Y=new GA1($);Y.start=$.start||0,Y.endOffset=$.end,Y.pos=Y.endOffset||this.buffer.length;var z=this.buffer.slice(Y.start,Y.pos),U=65536,Q=0;while(!0){var J=Q+U;if(J>=z.length){if(Q<z.length)Y.write(z.slice(Q,z.length));break}Y.write(z.slice(Q,J)),Q=J}return Y.end(),Y};JI.prototype.ref=function(){this.refCount+=1};JI.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw Error("invalid unref")}});var HB0=E((Z44,WB0)=>{var qA1=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,
Line truncated
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"
¡¢£¤¥¦§¨©ª«¬®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"
ЁЂҐЄЅІЇЈЉЊЋЌЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"
¡¢£¤¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"
ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€…‘’“”•–— กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"
¡¢£€¥¦§œ©ª«¬®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csiLine truncated
|
||||
\v\f\r\x0E\x0F\x10ỨỰỲỶỸÝỴ\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ`},georgianacademy:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:`\x00\x01Ẳ\x03\x04ẴẪ\x07\b
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13Ỷ\x15\x16\x17\x18Ỹ\x1A\x1B\x1C\x1DỴ\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ`},iso646cn:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},iso646jp:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"
ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var SB0=E((aA1)=>{var Jd=f3().Buffer;aA1._dbcs=b3;var z8=-1,hB0=-2,p$=-10,h8=-1000,XI=Array(256),xZ=-1;for(kZ=0;kZ<256;kZ++)XI[kZ]=z8;var kZ;function b3($,Y){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=XI.slice(0),this.decodeTableSeq=[];for(var U=0;U<z.length;U++)this._addDecodeChunk(z[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Q=this.decodeTables.length;this.decodeTables.push(XI.slice(0));var J=this.decodeTables.length;this.decodeTables.push(XI.slice(0));var K=this.decodeTables[0];for(var U=129;U<=254;U++){var I=this.decodeTables[h8-K[U]];for(var G=48;G<=57;G++){if(I[G]===z8)I[G]=h8-Q;else if(I[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var W=this.decodeTables[h8-I[G]];for(var H=129;H<=254;H++){if(W[H]===z8)W[H]=h8-J;else if(W[H]===h8-J)continue;else if(W[H]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-W[H]];for(var Z=48;Z<=57;Z++)if(X[Z]===z8)X[Z]=hB0}}}}this.defaultCharUnicode=Y.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var V=$.encodeSkipVals[U];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][Y.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===z8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===z8)this.defCharSB=63}b3.prototype.encoder=GP;b3.prototype.decoder=Kd;b3.prototype._getDecodeTrieNode=function($){var Y=[];for(;$>0;$>>>=8)Y.push($&255);if(Y.length==0)Y.push(0);var z=this.decodeTables[0];for(var U=Y.length-1;U>0;U--){var Q=z[Y[U]];if(Q==z8)z[Y[U]]=h8-this.decodeTables.length,this.decodeTables.push(z=XI.slice(0));else if(Q<=h8)z=this.decodeTables[h8-Q];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};b3.prototype._addDecodeChunk=function($){var Y=parseInt($[0],16),z=this._getDecodeTrieNode(Y);Y=Y&255;for(var U=1;U<$.length;U++){var Q=$[U];if(typeof Q==="string")for(var J=0;J<Q.length;){var K=Q.charCodeAt(J++);if(K>=55296&&K<56320){var I=Q.charCodeAt(J++);if(I>=56320&&I<57344)z[Y++]=65536+(K-55296)*1024+(I-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(K>4080&&K<=4095){var G=4095-K+2,W=[];for(var H=0;H<G;H++)W.push(Q.charCodeAt(J++));z[Y++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(W)}else z[Y++]=K}else if(typeof Q==="number"){var X=z[Y-1]+1;for(var J=0;J<Q;J++)z[Y++]=X++}else throw Error("Incorrect type '"+typeof Q+"' given in "+this.encodingName+" at chunk "+$[0])}if(Y>255)throw Error("Incorrect chunk in "+this.encoLine truncated
|
||||
`;super(Y);this.name="AggregateError",this.errors=$}}cP0.exports={AggregateError:iP0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,Y){return $.includes(Y)},ArrayPrototypeIndexOf($,Y){return $.indexOf(Y)},ArrayPrototypeJoin($,Y){return $.join(Y)},ArrayPrototypeMap($,Y){return $.map(Y)},ArrayPrototypePop($,Y){return $.pop(Y)},ArrayPrototypePush($,Y){return $.push(Y)},ArrayPrototypeSlice($,Y,z){return $.slice(Y,z)},Error,FunctionPrototypeCall($,Y,...z){return $.call(Y,...z)},FunctionPrototypeSymbolHasInstance($,Y){return Function.prototype[Symbol.hasInstance].call($,Y)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,Y){return Object.defineProperties($,Y)},ObjectDefineProperty($,Y,z){return Object.defineProperty($,Y,z)},ObjectGetOwnPropertyDescriptor($,Y){return Object.getOwnPropertyDescriptor($,Y)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,Y){return Object.setPrototypeOf($,Y)},Promise,PromisePrototypeCatch($,Y){return $.catch(Y)},PromisePrototypeThen($,Y,z){return $.then(Y,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,Y){return $.test(Y)},SafeSet:Set,String,StringPrototypeSlice($,Y,z){return $.slice(Y,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,Y,z){return $.set(Y,z)},Boolean,Uint8Array}});var Rd=E((Y64,nP0)=>{nP0.exports={format($,...Y){return $.replace(/%([sdifj])/g,function(...[z,U]){let Q=Y.shift();if(U==="f")return Q.toFixed(6);else if(U==="j")return JSON.stringify(Q);else if(U==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var w8=E((z64,lP0)=>{var{format:pP1,inspect:VP}=Rd(),{AggregateError:dP1}=x4(),mP1=globalThis.AggregateError||dP1,lP1=Symbol("kIsNodeError"),oP1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],rP1=/^([A-Z][a-z0-9]*)+$/,LP={};function FU($,Y){if(!$)throw new LP.ERR_INTERNAL_ASSERTION(Y)}function pP0($){let Y="",z=$.length,U=$[0]==="-"?1:0;for(;z>=U+4;z-=3)Y=`_${$.slice(z-3,z)}${Y}`;return`${$.slice(0,z)}${Y}`}function sP1($,Y,z){if(typeof Y==="function")return FU(Y.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${Y.length}).`),Y(...z);let U=(Y.match(/%[dfijoOs]/g)||[]).length;if(FU(U===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${U}).`),z.length===0)return Y;return pP1(Y,...z)}function U8($,Y,z){if(!z)z=Error;class U extends z{constructor(...Q){super(sP1($,Y,Q))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(U.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),U.prototype.code=$,U.prototype[lP1]=!0,LP[$]=U}function dP0($){let Y="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:Y}),$}function aP1($,Y){if($&&Y&&$!==Y){if(Array.isArray(Y.errors))return Y.errors.push($),Y;let z=new mP1([Y,$],Y.message);return z.code=Y.code,z}return $||Y}class mP0 extends Error{constructor($="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw new LP.ERR_INVALID_ARG_TYPE("options","Object",Y);super($,Y);this.code="ABORT_ERR",this.name="AbortError"}}U8("ERR_ASSERTION","%s",Error);U8("ERR_INVALID_ARG_TYPE",($,Y,z)=>{if(FU(typeof $==="string","'name' must be a string"),!Array.isArray(Y))Y=[Y];let U="The ";if($.endsWith(" argument"))U+=`${$} `;else U+=`"${$}" ${$.includes(".")?"property":"argument"} `;U+="must be ";let Q=[],J=[],K=[];for(let G of Y)if(FU(typeof G==="string","All expected entries have to be of type string"),oP1.includes(G))Q.push(G.toLowerCase());else if(rP1.test(G))J.push(G);else FU(G!=="object",'The value "object" should be written as "Object"'),K.push(G);if(J.length>0){let G=Q.indexOf("object");if(G!==-1)Q.splice(Q,G,1),J.push("Object")}if(Q.length>0){switch(Q.length){case 1:U+=`of type ${Q[Line truncated
|
||||
`);if(Y.linkname)z+=Jl(" linkpath="+Y.linkname+`
|
||||
`);let U=Y.pax;if(U)for(let Q in U)z+=Jl(" "+Q+"="+U[Q]+`
|
||||
`);return n1.from(z)};ov1.decodePax=function(Y){let z={};while(Y.length){let U=0;while(U<Y.length&&Y[U]!==32)U++;let Q=parseInt(n1.toString(Y.subarray(0,U)),10);if(!Q)return z;let J=n1.toString(Y.subarray(U+1,Q-1)),K=J.indexOf("=");if(K===-1)return z;z[J.slice(0,K)]=J.slice(K+1),Y=Y.subarray(Q)}return z};ov1.encode=function(Y){let z=n1.alloc(512),U=Y.name,Q="";if(Y.typeflag===5&&U[U.length-1]!=="/")U+="/";if(n1.byteLength(U)!==U.length)return null;while(n1.byteLength(U)>100){let J=U.indexOf("/");if(J===-1)return null;Q+=Q?"/"+U.slice(0,J):U.slice(0,J),U=U.slice(J+1)}if(n1.byteLength(U)>100||n1.byteLength(Q)>155)return null;if(Y.linkname&&n1.byteLength(Y.linkname)>100)return null;if(n1.write(z,U),n1.write(z,s2(Y.mode&4095,6),100),n1.write(z,s2(Y.uid,6),108),n1.write(z,s2(Y.gid,6),116),mv1(Y.size,z,124),n1.write(z,s2(Y.mtime.getTime()/1000|0,11),136),z[156]=48+pv1(Y.type),Y.linkname)n1.write(z,Y.linkname,157);if(n1.copy(wR0,z,257),n1.copy(xv1,z,263),Y.uname)n1.write(z,Y.uname,265);if(Y.gname)n1.write(z,Y.gname,297);if(n1.write(z,s2(Y.devmajor||0,6),329),n1.write(z,s2(Y.devminor||0,6),337),Q)n1.write(z,Q,345);return n1.write(z,s2(OR0(z),6),148),z};ov1.decode=function(Y,z,U){let Q=Y[156]===0?0:Y[156]-48,J=vI(Y,0,100,z),K=r2(Y,100,8),I=r2(Y,108,8),G=r2(Y,116,8),W=r2(Y,124,12),H=r2(Y,136,12),X=nv1(Q),Z=Y[157]===0?null:vI(Y,157,100,z),q=vI(Y,265,32),V=vI(Y,297,32),F=r2(Y,329,8),M=r2(Y,337,8),w=OR0(Y);if(w===256)return null;if(w!==r2(Y,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(bv1(Y)){if(Y[345])J=vI(Y,345,155,z)+"/"+J}else if(iv1(Y));else if(!U)throw Error("Invalid tar header: unknown format.");if(Q===0&&J&&J[J.length-1]==="/")Q=5;return{name:J,mode:K,uid:I,gid:G,size:W,byteOffset:0,mtime:new Date(1000*H),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:M,pax:null}};function bv1($){return n1.equals(wR0,$.subarray(257,263))}function iv1($){return n1.equals(fv1,$.subarray(257,263))&&n1.equals(uv1,$.subarray(263,265))}function cv1($,Y,z){if(typeof $!=="number")return z;if($=~~$,$>=Y)return Y;if($>=0)return $;if($+=Y,$>=0)return $;return 0}function nv1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function pv1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function MR0($,Y,z,U){for(;z<U;z++)if($[z]===Y)return z;return U}function OR0($){let Y=256;for(let z=0;z<148;z++)Y+=$[z];for(let z=156;z<512;z++)Y+=$[z];return Y}function s2($,Y){if($=$.toString(8),$.length>Y)return"7777777777777777777".slice(0,Y)+" ";return"0000000000000000000".slice(0,Y-$.length)+$+" "}function dv1($,Y,z){Y[z]=128;for(let U=11;U>0;U--)Y[z+U]=$&255,$=Math.floor($/256)}function mv1($,Y,z){if($.toString(8).length>11)dv1($,Y,z);else n1.write(Y,s2($,11),z)}function lv1($){let Y;if($[0]===128)Y=!0;else if($[0]===255)Y=!1;else return null;let z=[],U;for(U=$.length-1;U>0;U--){let K=$[U];if(Y)z.push(K);else z.push(255-K)}let Q=0,J=z.length;for(U=0;U<J;U++)Q+=z[U]*Math.pow(256,U);return Y?Q:-1*Q}function r2($,Y,z){if($=$.subarray(Y,Y+z),Y=0,$[Y]&128)return lv1($);else{while(Y<$.length&&$[Y]===32)Y++;let U=cv1(MR0($,32,Y,$.length),$.length,$.length);while(Y<U&&$[Y]===0)Y++;if(U===Y)return 0;return parseInt(n1.toString($.subarray(Y,U)),8)}}function vI($,Y,z,U){return n1.toString($.subarray(Y,MR0($,0,Y,Y+z)),U)}function Jl($){let Y=n1.byteLength($),z=Math.floor(Math.log(Y)/Math.log(10))+1;if(Y+z>=Math.pow(10,z))z++;return Y+z+$}});var ER0=E((m84,jR0)=>{var{Writable:$h1,Readable:Yh1,getStreamError:NR0}=Ql(),zh1=sm(),DR0=_I(),hI=Kl(),Uh1=DR0.alloc(0);class AR0{constructor(){this.buffered=0,this.shifted=0,this.queue=new zh1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return Uh1;let Y=this._next($);if($===Y.byteLength)return Y;let z=[Y];while(($-=Y.byteLength)>0)Y=this._next($),z.push(Y);return DR0.concat(z)}_next($){let Y=this.queue.peek(),z=Y.byteLength-this._offset;if($>=z){let U=this._offset?Y.subarray(this._offset,Y.byteLength):Y;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,U}return this.buffered-=$,this.shifted+=$,Y.subarray(this._offset,this._offset+=$)}}class BR0 extends Yh1{constructor($,Y,z){super();this.header=Y,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(NR0(this))}_detach(){if(this._parent._stream=
Line truncated
|
||||
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������`},hproman8:{type:"_sbcs",chars:"
ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}});var cB0=E((XB1)=>{var Gd=f3().Buffer;XB1._dbcs=b3;var z8=-1,iB0=-2,p$=-10,h8=-1000,ZI=Array(256),fZ=-1;for(xZ=0;xZ<256;xZ++)ZI[xZ]=z8;var xZ;function b3($,Y){if(this.encodingName=$.encodingName,!$)throw Error("DBCS codec is called without the data.");if(!$.table)throw Error("Encoding '"+this.encodingName+"' has no data.");var z=$.table();this.decodeTables=[],this.decodeTables[0]=ZI.slice(0),this.decodeTableSeq=[];for(var U=0;U<z.length;U++)this._addDecodeChunk(z[U]);if(typeof $.gb18030==="function"){this.gb18030=$.gb18030();var Q=this.decodeTables.length;this.decodeTables.push(ZI.slice(0));var J=this.decodeTables.length;this.decodeTables.push(ZI.slice(0));var K=this.decodeTables[0];for(var U=129;U<=254;U++){var I=this.decodeTables[h8-K[U]];for(var G=48;G<=57;G++){if(I[G]===z8)I[G]=h8-Q;else if(I[G]>h8)throw Error("gb18030 decode tables conflict at byte 2");var W=this.decodeTables[h8-I[G]];for(var H=129;H<=254;H++){if(W[H]===z8)W[H]=h8-J;else if(W[H]===h8-J)continue;else if(W[H]>h8)throw Error("gb18030 decode tables conflict at byte 3");var X=this.decodeTables[h8-W[H]];for(var Z=48;Z<=57;Z++)if(X[Z]===z8)X[Z]=iB0}}}}this.defaultCharUnicode=Y.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var q={};if($.encodeSkipVals)for(var U=0;U<$.encodeSkipVals.length;U++){var V=$.encodeSkipVals[U];if(typeof V==="number")q[V]=!0;else for(var G=V.from;G<=V.to;G++)q[G]=!0}if(this._fillEncodeTable(0,0,q),$.encodeAdd){for(var F in $.encodeAdd)if(Object.prototype.hasOwnProperty.call($.encodeAdd,F))this._setEncodeChar(F.charCodeAt(0),$.encodeAdd[F])}if(this.defCharSB=this.encodeTable[0][Y.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===z8)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===z8)this.defCharSB=63}b3.prototype.encoder=WP;b3.prototype.decoder=Wd;b3.prototype._getDecodeTrieNode=function($){var Y=[];for(;$>0;$>>>=8)Y.push($&255);if(Y.length==0)Y.push(0);var z=this.decodeTables[0];for(var U=Y.length-1;U>0;U--){var Q=z[Y[U]];if(Q==z8)z[Y[U]]=h8-this.decodeTables.length,this.decodeTables.push(z=ZI.slice(0));else if(Q<=h8)z=this.decodeTables[h8-Q];else throw Error("Overwrite byte in "+this.encodingName+", addr: "+$.toString(16))}return z};b3.prototype._addDecodeChunk=function($){var Y=parseInt($[0],16),z=this._getDecodeTrieNode(Y);Y=Y&255;for(var U=1;U<$.length;U++){var Q=$[U];if(typeof Q==="string")for(var J=0;J<Q.length;){var K=Q.charCodeAt(J++);if(K>=55296&&K<56320){var I=Q.charCodeAt(J++);if(I>=56320&&I<57344)z[Y++]=65536+(K-55296)*1024+(I-56320);else throw Error("Incorrect surrogate pair in "+this.encodingName+" at chunk "+$[0])}else if(K>4080&&K<=4095){var G=4095-K+2,W=[];for(var H=0;H<G;H++)W.push(Q.charCodeAt(J++));z[Y++]=p$-this.decodeTableSeq.length,this.decodeTableSeq.push(W)}else z[Y++]=K}else if(typeof Q==="number"){var X=z[Y-1]+1;for(var J=0;J<Q;J++)z[Y++]=X++}else throw Error("Incorrect type '"+typeof Q+"' given in "+this.encodingName+" at chunk "+$[0])}if(Y>255)throw Error("Incorrect chunk in "+this.encoLine truncated
|
||||
`;super(Y);this.name="AggregateError",this.errors=$}}aP0.exports={AggregateError:sP0,ArrayIsArray($){return Array.isArray($)},ArrayPrototypeIncludes($,Y){return $.includes(Y)},ArrayPrototypeIndexOf($,Y){return $.indexOf(Y)},ArrayPrototypeJoin($,Y){return $.join(Y)},ArrayPrototypeMap($,Y){return $.map(Y)},ArrayPrototypePop($,Y){return $.pop(Y)},ArrayPrototypePush($,Y){return $.push(Y)},ArrayPrototypeSlice($,Y,z){return $.slice(Y,z)},Error,FunctionPrototypeCall($,Y,...z){return $.call(Y,...z)},FunctionPrototypeSymbolHasInstance($,Y){return Function.prototype[Symbol.hasInstance].call($,Y)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties($,Y){return Object.defineProperties($,Y)},ObjectDefineProperty($,Y,z){return Object.defineProperty($,Y,z)},ObjectGetOwnPropertyDescriptor($,Y){return Object.getOwnPropertyDescriptor($,Y)},ObjectKeys($){return Object.keys($)},ObjectSetPrototypeOf($,Y){return Object.setPrototypeOf($,Y)},Promise,PromisePrototypeCatch($,Y){return $.catch(Y)},PromisePrototypeThen($,Y,z){return $.then(Y,z)},PromiseReject($){return Promise.reject($)},PromiseResolve($){return Promise.resolve($)},ReflectApply:Reflect.apply,RegExpPrototypeTest($,Y){return $.test(Y)},SafeSet:Set,String,StringPrototypeSlice($,Y,z){return $.slice(Y,z)},StringPrototypeToLowerCase($){return $.toLowerCase()},StringPrototypeToUpperCase($){return $.toUpperCase()},StringPrototypeTrim($){return $.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet($,Y,z){return $.set(Y,z)},Boolean,Uint8Array}});var hd=E((F64,tP0)=>{tP0.exports={format($,...Y){return $.replace(/%([sdifj])/g,function(...[z,U]){let Q=Y.shift();if(U==="f")return Q.toFixed(6);else if(U==="j")return JSON.stringify(Q);else if(U==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect($){switch(typeof $){case"string":if($.includes("'")){if(!$.includes('"'))return`"${$}"`;else if(!$.includes("`")&&!$.includes("${"))return`\`${$}\``}return`'${$}'`;case"number":if(isNaN($))return"NaN";else if(Object.is($,-0))return String($);return $;case"bigint":return`${String($)}n`;case"boolean":case"undefined":return String($);case"object":return"{}"}}}});var M8=E((M64,zT0)=>{var{format:QT1,inspect:LP}=hd(),{AggregateError:JT1}=x4(),KT1=globalThis.AggregateError||JT1,IT1=Symbol("kIsNodeError"),GT1=["string","function","number","object","Function","Object","boolean","bigint","symbol"],WT1=/^([A-Z][a-z0-9]*)+$/,FP={};function MU($,Y){if(!$)throw new FP.ERR_INTERNAL_ASSERTION(Y)}function eP0($){let Y="",z=$.length,U=$[0]==="-"?1:0;for(;z>=U+4;z-=3)Y=`_${$.slice(z-3,z)}${Y}`;return`${$.slice(0,z)}${Y}`}function HT1($,Y,z){if(typeof Y==="function")return MU(Y.length<=z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${Y.length}).`),Y(...z);let U=(Y.match(/%[dfijoOs]/g)||[]).length;if(MU(U===z.length,`Code: ${$}; The provided arguments length (${z.length}) does not match the required ones (${U}).`),z.length===0)return Y;return QT1(Y,...z)}function U8($,Y,z){if(!z)z=Error;class U extends z{constructor(...Q){super(HT1($,Y,Q))}toString(){return`${this.name} [${$}]: ${this.message}`}}Object.defineProperties(U.prototype,{name:{value:z.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${$}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),U.prototype.code=$,U.prototype[IT1]=!0,FP[$]=U}function $T0($){let Y="__node_internal_"+$.name;return Object.defineProperty($,"name",{value:Y}),$}function XT1($,Y){if($&&Y&&$!==Y){if(Array.isArray(Y.errors))return Y.errors.push($),Y;let z=new KT1([Y,$],Y.message);return z.code=Y.code,z}return $||Y}class YT0 extends Error{constructor($="The operation was aborted",Y=void 0){if(Y!==void 0&&typeof Y!=="object")throw new FP.ERR_INVALID_ARG_TYPE("options","Object",Y);super($,Y);this.code="ABORT_ERR",this.name="AbortError"}}U8("ERR_ASSERTION","%s",Error);U8("ERR_INVALID_ARG_TYPE",($,Y,z)=>{if(MU(typeof $==="string","'name' must be a string"),!Array.isArray(Y))Y=[Y];let U="The ";if($.endsWith(" argument"))U+=`${$} `;else U+=`"${$}" ${$.includes(".")?"property":"argument"} `;U+="must be ";let Q=[],J=[],K=[];for(let G of Y)if(MU(typeof G==="string","All expected entries have to be of type string"),GT1.includes(G))Q.push(G.toLowerCase());else if(WT1.test(G))J.push(G);else MU(G!=="object",'The value "object" should be written as "Object"'),K.push(G);if(J.length>0){let G=Q.indexOf("object");if(G!==-1)Q.splice(Q,G,1),J.push("Object")}if(Q.length>0){switch(Q.length){case 1:U+=`of type ${Q[Line truncated
|
||||
`);if(Y.linkname)z+=Gl(" linkpath="+Y.linkname+`
|
||||
`);let U=Y.pax;if(U)for(let Q in U)z+=Gl(" "+Q+"="+U[Q]+`
|
||||
`);return n1.from(z)};Gh1.decodePax=function(Y){let z={};while(Y.length){let U=0;while(U<Y.length&&Y[U]!==32)U++;let Q=parseInt(n1.toString(Y.subarray(0,U)),10);if(!Q)return z;let J=n1.toString(Y.subarray(U+1,Q-1)),K=J.indexOf("=");if(K===-1)return z;z[J.slice(0,K)]=J.slice(K+1),Y=Y.subarray(Q)}return z};Gh1.encode=function(Y){let z=n1.alloc(512),U=Y.name,Q="";if(Y.typeflag===5&&U[U.length-1]!=="/")U+="/";if(n1.byteLength(U)!==U.length)return null;while(n1.byteLength(U)>100){let J=U.indexOf("/");if(J===-1)return null;Q+=Q?"/"+U.slice(0,J):U.slice(0,J),U=U.slice(J+1)}if(n1.byteLength(U)>100||n1.byteLength(Q)>155)return null;if(Y.linkname&&n1.byteLength(Y.linkname)>100)return null;if(n1.write(z,U),n1.write(z,a2(Y.mode&4095,6),100),n1.write(z,a2(Y.uid,6),108),n1.write(z,a2(Y.gid,6),116),Kh1(Y.size,z,124),n1.write(z,a2(Y.mtime.getTime()/1000|0,11),136),z[156]=48+Qh1(Y.type),Y.linkname)n1.write(z,Y.linkname,157);if(n1.copy(jR0,z,257),n1.copy(av1,z,263),Y.uname)n1.write(z,Y.uname,265);if(Y.gname)n1.write(z,Y.gname,297);if(n1.write(z,a2(Y.devmajor||0,6),329),n1.write(z,a2(Y.devminor||0,6),337),Q)n1.write(z,Q,345);return n1.write(z,a2(CR0(z),6),148),z};Gh1.decode=function(Y,z,U){let Q=Y[156]===0?0:Y[156]-48,J=hI(Y,0,100,z),K=s2(Y,100,8),I=s2(Y,108,8),G=s2(Y,116,8),W=s2(Y,124,12),H=s2(Y,136,12),X=Uh1(Q),Z=Y[157]===0?null:hI(Y,157,100,z),q=hI(Y,265,32),V=hI(Y,297,32),F=s2(Y,329,8),w=s2(Y,337,8),M=CR0(Y);if(M===256)return null;if(M!==s2(Y,148,8))throw Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if($h1(Y)){if(Y[345])J=hI(Y,345,155,z)+"/"+J}else if(Yh1(Y));else if(!U)throw Error("Invalid tar header: unknown format.");if(Q===0&&J&&J[J.length-1]==="/")Q=5;return{name:J,mode:K,uid:I,gid:G,size:W,byteOffset:0,mtime:new Date(1000*H),type:X,linkname:Z,uname:q,gname:V,devmajor:F,devminor:w,pax:null}};function $h1($){return n1.equals(jR0,$.subarray(257,263))}function Yh1($){return n1.equals(tv1,$.subarray(257,263))&&n1.equals(ev1,$.subarray(263,265))}function zh1($,Y,z){if(typeof $!=="number")return z;if($=~~$,$>=Y)return Y;if($>=0)return $;if($+=Y,$>=0)return $;return 0}function Uh1($){switch($){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}function Qh1($){switch($){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}function ER0($,Y,z,U){for(;z<U;z++)if($[z]===Y)return z;return U}function CR0($){let Y=256;for(let z=0;z<148;z++)Y+=$[z];for(let z=156;z<512;z++)Y+=$[z];return Y}function a2($,Y){if($=$.toString(8),$.length>Y)return"7777777777777777777".slice(0,Y)+" ";return"0000000000000000000".slice(0,Y-$.length)+$+" "}function Jh1($,Y,z){Y[z]=128;for(let U=11;U>0;U--)Y[z+U]=$&255,$=Math.floor($/256)}function Kh1($,Y,z){if($.toString(8).length>11)Jh1($,Y,z);else n1.write(Y,a2($,11),z)}function Ih1($){let Y;if($[0]===128)Y=!0;else if($[0]===255)Y=!1;else return null;let z=[],U;for(U=$.length-1;U>0;U--){let K=$[U];if(Y)z.push(K);else z.push(255-K)}let Q=0,J=z.length;for(U=0;U<J;U++)Q+=z[U]*Math.pow(256,U);return Y?Q:-1*Q}function s2($,Y,z){if($=$.subarray(Y,Y+z),Y=0,$[Y]&128)return Ih1($);else{while(Y<$.length&&$[Y]===32)Y++;let U=zh1(ER0($,32,Y,$.length),$.length,$.length);while(Y<U&&$[Y]===0)Y++;if(U===Y)return 0;return parseInt(n1.toString($.subarray(Y,U)),8)}}function hI($,Y,z,U){return n1.toString($.subarray(Y,ER0($,0,Y,Y+z)),U)}function Gl($){let Y=n1.byteLength($),z=Math.floor(Math.log(Y)/Math.log(10))+1;if(Y+z>=Math.pow(10,z))z++;return Y+z+$}});var kR0=E((I$4,yR0)=>{var{Writable:Vh1,Readable:Lh1,getStreamError:RR0}=Il(),Fh1=em(),_R0=vI(),SI=Wl(),Mh1=_R0.alloc(0);class vR0{constructor(){this.buffered=0,this.shifted=0,this.queue=new Fh1,this._offset=0}push($){this.buffered+=$.byteLength,this.queue.push($)}shiftFirst($){return this.buffered===0?null:this._next($)}shift($){if($>this.buffered)return null;if($===0)return Mh1;let Y=this._next($);if($===Y.byteLength)return Y;let z=[Y];while(($-=Y.byteLength)>0)Y=this._next($),z.push(Y);return _R0.concat(z)}_next($){let Y=this.queue.peek(),z=Y.byteLength-this._offset;if($>=z){let U=this._offset?Y.subarray(this._offset,Y.byteLength):Y;return this.queue.shift(),this._offset=0,this.buffered-=z,this.shifted+=z,U}return this.buffered-=$,this.shifted+=$,Y.subarray(this._offset,this._offset+=$)}}class hR0 extends Lh1{constructor($,Y,z){super();this.header=Y,this.offset=z,this._parent=$}_read($){if(this.header.size===0)this.push(null);if(this._parent._stream===this)this._parent._update();$(null)}_predestroy(){this._parent.destroy(RR0(this))}_detach(){if(this._parent._stream=
Line truncated
|
||||
`),U=[await W4($,z.recordId)];else if(z.recordIds&&z.recordIds.length>0)process.stderr.write(`\uD83D\uDD0D 批量查询 ${z.recordIds.length} 条单据记录...
|
||||
`),U=await Promise.all(z.recordIds.map((w)=>W4($,w)));else{let w=z.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${Y.name}」(${Y.id}) 的线上审核记录 (限制 ${w} 条)...
|
||||
`);let O=(await i4($,{limit:w,status:z.status,startDate:z.startDate!==void 0?String(z.startDate):void 0,endDate:z.endDate!==void 0?String(z.endDate):void 0})).records??[];if(O.length===0)throw Error("未检索到符合条件的线上审核记录,无法导出 webhook 资源包。");process.stderr.write(`\uD83D\uDCE5 正在拉取 ${O.length} 条审核记录完整详情...
|
||||
`),U=await Promise.all(O.map((D)=>W4($,D.id)))}let Q=new Map,J=0;for(let w of U){let N=w.document,O=w.sourceDocumentId??(typeof N?.id==="string"?N.id:void 0)??(typeof N?.sourceDocumentId==="string"?N.sourceDocumentId:void 0)??w.documentId??w.id,D=`${z.docIdPrefix??""}${O}${z.docIdSuffix??""}`,P=[];if(z.includeAttachments!==!1){let A=i2(w,{summary:!1}).attachments,j=new Set;for(let C of A){let b=C.ossSignedUrl??C.url;if(!b)continue;let x=C.fileName??C.fileId??"attachment",S=en(x),i=S,c=S.lastIndexOf("."),U0=c>0?S.slice(0,c):S,k=c>0?S.slice(c):"",d=1;while(j.has(i.toLowerCase()))i=`${U0}_${d}${k}`,d++;j.add(i.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${D}」附件: ${x}...
|
||||
`),U=await Promise.all(z.recordIds.map((M)=>W4($,M)));else{let M=z.limit??10;process.stderr.write(`\uD83D\uDD0D 检索企业「${Y.name}」(${Y.id}) 的线上审核记录 (限制 ${M} 条)...
|
||||
`);let N=(await i4($,{limit:M,status:z.status,startDate:z.startDate!==void 0?String(z.startDate):void 0,endDate:z.endDate!==void 0?String(z.endDate):void 0})).records??[];if(N.length===0)throw Error("未检索到符合条件的线上审核记录,无法导出 webhook 资源包。");process.stderr.write(`\uD83D\uDCE5 正在拉取 ${N.length} 条审核记录完整详情...
|
||||
`),U=await Promise.all(N.map((D)=>W4($,D.id)))}let Q=new Map,J=0;for(let M of U){let O=M.document,N=M.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??M.documentId??M.id,D=`${z.docIdPrefix??""}${N}${z.docIdSuffix??""}`,P=[];if(z.includeAttachments!==!1){let A=c2(M,{summary:!1}).attachments,j=new Set;for(let C of A){let b=C.ossSignedUrl??C.url;if(!b)continue;let x=C.fileName??C.fileId??"attachment",S=$p(x),i=S,c=S.lastIndexOf("."),U0=c>0?S.slice(0,c):S,k=c>0?S.slice(c):"",d=1;while(j.has(i.toLowerCase()))i=`${U0}_${d}${k}`,d++;j.add(i.toLowerCase());try{process.stderr.write(`⬇ 下载单据「${D}」附件: ${x}...
|
||||
`);let t=await fetch(b);if(t.ok){let $0=await t.arrayBuffer(),g=Buffer.from($0);P.push({fileName:i,zipPath:`${D}/${i}`,buffer:g,sourceField:C.sourceField??"附件"}),J++}}catch(t){process.stderr.write(`⚠️ [跳过附件] 下载失败 ${x}: ${t}
|
||||
`)}}}Q.set(D,P)}let K=new dR0.default.Workbook;K.creator="seal-use",K.created=new Date;let I=new Set;for(let w of Q.values())for(let N of w)I.add(N.sourceField);if(I.size===0)I.add("附件");let G=new Set;for(let w of U){let N=w.document,O=Array.isArray(N?.fields)?N.fields:[];for(let D of O)if(D&&typeof D==="object"){let P=D,T=typeof P.label==="string"?P.label.trim():typeof P.key==="string"?P.key.trim():"",A=typeof P.type==="string"?P.type.toUpperCase():"";if(T&&A!=="ATTACHMENT"&&A!=="LIST")G.add(T)}}let W=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],H=Array.from(G).filter((w)=>!W.includes(w)&&w!=="单据编号"&&w!=="单号"),X=Array.from(I).map((w)=>`[附件]${w}`),Z=[...W,...H,...X],q=K.addWorksheet("主表");q.addRow(Z),q.getRow(1).font={bold:!0};for(let w of U){let N=w.document,O=w.sourceDocumentSN??(typeof N?.sn==="string"?N.sn:void 0)??(typeof N?.sourceDocumentSN==="string"?N.sourceDocumentSN:void 0)??w.id,D=w.sourceDocumentId??(typeof N?.id==="string"?N.id:void 0)??(typeof N?.sourceDocumentId==="string"?N.sourceDocumentId:void 0)??w.documentId??w.id,P=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,T=`${z.docIdPrefix??""}${O}${z.docIdSuffix??""}`,A=(typeof N?.title==="string"?N.title:void 0)??(typeof N?.name==="string"?N.name:void 0)??T,j="";if(typeof N?.sourceStartTime==="number")j=new Date(N.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="number")j=new Date(w.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof w.createdAt==="string")j=w.createdAt.slice(0,10);let C=new Map,b=Array.isArray(N?.fields)?N.fields:[];for(let U0 of b)if(U0&&typeof U0==="object"){let k=U0,d=typeof k.label==="string"?k.label.trim():typeof k.key==="string"?k.key.trim():"";if(d)C.set(d,k.value)}let x,S=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof S==="number")x=S;else if(S&&typeof S==="object"&&"amount"in S&&typeof S.amount==="number")x=S.amount;let i=[];i.push(P),i.push(A),i.push(w.status??"已审批"),i.push(x??""),i.push(C.get("报销事由")??C.get("事由")??A),i.push(j);for(let U0 of H){let k=C.get(U0);if(k===void 0||k===null)i.push("");else if(typeof k==="object")if("amount"in k)i.push(k.amount);else i.push(JSON.stringify(k));else i.push(k)}let c=Q.get(P)??[];for(let U0 of I){let k=c.filter((d)=>d.sourceField===U0||I.size===1);if(k.length>0)i.push(k.map((d)=>d.zipPath).join(`
|
||||
`));else i.push("")}q.addRow(i)}let V=Ah1(z,Y);wh1(Nh1(V),{recursive:!0});let F=await K.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
|
||||
`),await new Promise((w,N)=>{let O=Fh1(V),D=new Xl({zlib:{level:9}});O.on("close",()=>w()),D.on("error",(P)=>N(P)),D.pipe(O),D.append(Buffer.from(F),{name:"信息表.xlsx"});for(let P of Q.values())for(let T of P)D.append(T.buffer,{name:T.zipPath});D.finalize()});let M=Mh1(V);return{filePath:V,corpId:Y.id,corpName:Y.name,recordCount:U.length,attachmentCount:J,fileSizeBytes:M.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var dR0;var Zl=o(()=>{nR0();A6();yB();dR0=J6(EZ(),1)});import{readFileSync as Bh1}from"node:fs";function Ph1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${Y.protocol}//${Y.host}`,webhookId:z[1]}}function Th1($,Y){return Y.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!Y.toLowerCase().endsWith(".xlsx")}function jh1($,Y){if(!$.length)return;let z=new Set($.map((J)=>{let K=J.fileName.split("/")[0],I=K.indexOf("@");return I>=0?K.slice(0,I):K}).filter((J)=>J!=="信息表.xlsx")),U=[];for(let J of Y){let K=J.document.documentId;if((J.documentAttachments.length>0||Object.values(J.expenseAttachments).some((G)=>G.length>0)||Object.values(J.personAttachments).some((G)=>G.length>0))&&!z.has(K))U.push(`Excel 会议编号「${K}」声明了附件,但在 ZIP 中找不到对应的根目录「${K}/」或「${K}@.../」。`)}let Q=new Set(Y.map((J)=>J.document.documentId));for(let J of z)if(!Q.has(J))U.push(`ZIP 根目录对应的编号「${J}」在信息表中找不到对应的会议编号。`);if(U.length)throw new D5(U)}async function mR0($,Y,z){let U=[],Q=$;if(Th1($,Y)){U=await zP0($),QP0(U,z);let G=U.find((W)=>W.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");Q=await Zd($,G)}let J=await XP0(Q);jh1(U,J);let K=ZP0(U,J),I=J.map((G)=>G.document);return{entries:U,parsed:J,plans:K,documents:I,fileBuffer:$}}async function gU($,Y,z){let U=await mR0($,Y,z),Q=U.parsed.map((J,K)=>Md(J.document,U.plans[K],new Map));return{warnings:[],documents:Q,attachmentPlan:U.plans}}async function QT($,Y,z){let U=await mR0($,Y,z.materialPackFilePolicy),{baseUrl:Q,webhookId:J}=Ph1(z.webhookUrl),K=[];for(let I=0;I<U.parsed.length;I+=1){let G=U.parsed[I],W=U.plans[I],H=new Map,X=[...W.categoryFields,...Object.values(W.personAttachments).flat(),...Object.values(W.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(H.has(F))continue;let M=U.entries.find((T)=>T.fileName===F);if(!M)continue;process.stderr.write(`⬆ 上传附件: ${F}
|
||||
`);let w=new FormData,N=await Zd(U.fileBuffer,M),O=F.split("/").pop()??F;w.append("files",new File([new Uint8Array(N)],O));let D=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...vZ({},z.secret)},body:w});if(!D.ok)throw Error(`附件上传失败 ${D.status}: ${await D.text()}`);let P=await D.json();H.set(F,P.attachments?.map((T)=>T.data)??(P.data===void 0?[]:[P.data])),process.stderr.write(`✓ 附件上传成功: ${F}
|
||||
`)}}}Q.set(D,P)}let K=new $_0.default.Workbook;K.creator="seal-use",K.created=new Date;let I=new Set;for(let M of Q.values())for(let O of M)I.add(O.sourceField);if(I.size===0)I.add("附件");let G=new Set;for(let M of U){let O=M.document,N=Array.isArray(O?.fields)?O.fields:[];for(let D of N)if(D&&typeof D==="object"){let P=D,T=typeof P.label==="string"?P.label.trim():typeof P.key==="string"?P.key.trim():"",A=typeof P.type==="string"?P.type.toUpperCase():"";if(T&&A!=="ATTACHMENT"&&A!=="LIST")G.add(T)}}let W=["会议编号","会议名称","状态","总金额","报销事由","申请日期"],H=Array.from(G).filter((M)=>!W.includes(M)&&M!=="单据编号"&&M!=="单号"),X=Array.from(I).map((M)=>`[附件]${M}`),Z=[...W,...H,...X],q=K.addWorksheet("主表");q.addRow(Z),q.getRow(1).font={bold:!0};for(let M of U){let O=M.document,N=M.sourceDocumentSN??(typeof O?.sn==="string"?O.sn:void 0)??(typeof O?.sourceDocumentSN==="string"?O.sourceDocumentSN:void 0)??M.id,D=M.sourceDocumentId??(typeof O?.id==="string"?O.id:void 0)??(typeof O?.sourceDocumentId==="string"?O.sourceDocumentId:void 0)??M.documentId??M.id,P=`${z.docIdPrefix??""}${D}${z.docIdSuffix??""}`,T=`${z.docIdPrefix??""}${N}${z.docIdSuffix??""}`,A=(typeof O?.title==="string"?O.title:void 0)??(typeof O?.name==="string"?O.name:void 0)??T,j="";if(typeof O?.sourceStartTime==="number")j=new Date(O.sourceStartTime*1000).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof M.createdAt==="number")j=new Date(M.createdAt).toLocaleDateString("en-CA",{timeZone:"Asia/Shanghai"});else if(typeof M.createdAt==="string")j=M.createdAt.slice(0,10);let C=new Map,b=Array.isArray(O?.fields)?O.fields:[];for(let U0 of b)if(U0&&typeof U0==="object"){let k=U0,d=typeof k.label==="string"?k.label.trim():typeof k.key==="string"?k.key.trim():"";if(d)C.set(d,k.value)}let x,S=C.get("总金额")??C.get("报销金额")??C.get("total_amount");if(typeof S==="number")x=S;else if(S&&typeof S==="object"&&"amount"in S&&typeof S.amount==="number")x=S.amount;let i=[];i.push(P),i.push(A),i.push(M.status??"已审批"),i.push(x??""),i.push(C.get("报销事由")??C.get("事由")??A),i.push(j);for(let U0 of H){let k=C.get(U0);if(k===void 0||k===null)i.push("");else if(typeof k==="object")if("amount"in k)i.push(k.amount);else i.push(JSON.stringify(k));else i.push(k)}let c=Q.get(P)??[];for(let U0 of I){let k=c.filter((d)=>d.sourceField===U0||I.size===1);if(k.length>0)i.push(k.map((d)=>d.zipPath).join(`
|
||||
`));else i.push("")}q.addRow(i)}let V=kh1(z,Y);vh1(gh1(V),{recursive:!0});let F=await K.xlsx.writeBuffer();process.stderr.write(`\uD83D\uDCE6 正在压缩生成 Webhook 资源包: ${V}...
|
||||
`),await new Promise((M,O)=>{let N=_h1(V),D=new Vl({zlib:{level:9}});N.on("close",()=>M()),D.on("error",(P)=>O(P)),D.pipe(N),D.append(Buffer.from(F),{name:"信息表.xlsx"});for(let P of Q.values())for(let T of P)D.append(T.buffer,{name:T.zipPath});D.finalize()});let w=hh1(V);return{filePath:V,corpId:Y.id,corpName:Y.name,recordCount:U.length,attachmentCount:J,fileSizeBytes:w.size,exportedAt:new Date().toISOString(),nextAction:`seal-use webhook resource-pack push ${V} --corp <targetCorpId>`}}var $_0;var Ll=m(()=>{tR0();A6();kB();$_0=J6(EZ(),1)});import{readFileSync as xh1}from"node:fs";function fh1($){let Y=new URL($),z=Y.pathname.match(/\/webhook\/([^/]+)/);if(!z)throw Error("Webhook URL 必须包含 /webhook/{webhookId}/document");return{baseUrl:`${Y.protocol}//${Y.host}`,webhookId:z[1]}}function uh1($,Y){return Y.toLowerCase().endsWith(".zip")||$[0]===80&&$[1]===75&&!Y.toLowerCase().endsWith(".xlsx")}function bh1($,Y){if(!$.length)return;let z=new Set($.map((J)=>{let K=J.fileName.split("/")[0],I=K.indexOf("@");return I>=0?K.slice(0,I):K}).filter((J)=>J!=="信息表.xlsx")),U=[];for(let J of Y){let K=J.document.documentId;if((J.documentAttachments.length>0||Object.values(J.expenseAttachments).some((G)=>G.length>0)||Object.values(J.personAttachments).some((G)=>G.length>0))&&!z.has(K))U.push(`Excel 会议编号「${K}」声明了附件,但在 ZIP 中找不到对应的根目录「${K}/」或「${K}@.../」。`)}let Q=new Set(Y.map((J)=>J.document.documentId));for(let J of z)if(!Q.has(J))U.push(`ZIP 根目录对应的编号「${J}」在信息表中找不到对应的会议编号。`);if(U.length)throw new D5(U)}async function Y_0($,Y,z){let U=[],Q=$;if(uh1($,Y)){U=await XP0($),qP0(U,z);let G=U.find((W)=>W.fileName==="信息表.xlsx");if(!G)throw Error("ZIP 根目录缺少信息表.xlsx");Q=await Ld($,G)}let J=await NP0(Q);bh1(U,J);let K=DP0(U,J),I=J.map((G)=>G.document);return{entries:U,parsed:J,plans:K,documents:I,fileBuffer:$}}async function yU($,Y,z){let U=await Y_0($,Y,z),Q=U.parsed.map((J,K)=>Dd(J.document,U.plans[K],new Map));return{warnings:[],documents:Q,attachmentPlan:U.plans}}async function JT($,Y,z){let U=await Y_0($,Y,z.materialPackFilePolicy),{baseUrl:Q,webhookId:J}=fh1(z.webhookUrl),K=[];for(let I=0;I<U.parsed.length;I+=1){let G=U.parsed[I],W=U.plans[I],H=new Map,X=[...W.categoryFields,...Object.values(W.personAttachments).flat(),...Object.values(W.expenseAttachments).flat()];for(let V of X)for(let F of V.paths){if(H.has(F))continue;let w=U.entries.find((T)=>T.fileName===F);if(!w)continue;process.stderr.write(`⬆ 上传附件: ${F}
|
||||
`);let M=new FormData,O=await Ld(U.fileBuffer,w),N=F.split("/").pop()??F;M.append("files",new File([new Uint8Array(O)],N));let D=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/attachments`,{method:"POST",headers:{...z.customHeaders??{},...hZ({},z.secret)},body:M});if(!D.ok)throw Error(`附件上传失败 ${D.status}: ${await D.text()}`);let P=await D.json();H.set(F,P.attachments?.map((T)=>T.data)??(P.data===void 0?[]:[P.data])),process.stderr.write(`✓ 附件上传成功: ${F}
|
||||
`)}process.stderr.write(`\uD83D\uDCE4 推送单据: ${G.document.documentId}
|
||||
`);let Z=Md(G.document,W,H),q=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...vZ({webhookId:J,...Z},z.secret)},body:JSON.stringify(Z)});if(!q.ok)throw Error(`Webhook 单据推送失败 ${q.status}: ${await q.text()}`);K.push({documentId:Z.documentId,document:Z,pushResult:await q.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
|
||||
`)}return{warnings:[],results:K}}function yU($){return{fileBuffer:Bh1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var ql=o(()=>{pB();Od();wd();qd();zI();Zl()});import{existsSync as Eh1}from"node:fs";async function JT($,Y,z={}){let Q=_4().stateful?"stateful":"stateless",J="ok",K,I,G;try{let D=await T8($);G={id:D.user.id,name:D.user.name,isAdmin:D.user.isAdmin},I={id:D.tenant.id,name:D.tenant.name,tenantSlug:D.tenant.tenantSlug,corporationName:D.tenant.hoseCorpConfig?.corporationName}}catch(D){J="error",K=D instanceof Error?D.message:String(D)}let W=[];if(J==="ok")try{W=await J$($,Y.seal.endpoints.approvalStylePreferences)}catch(D){J="error",K=`读取 Webhook 配置失败: ${D instanceof Error?D.message:String(D)}`}let H=W.length===1,X=W.map((D)=>({id:D.id,name:D.name,mode:D.mode,incomingDocumentWebhookUrl:D.incomingDocumentWebhook.url,outgoingResultWebhookUrl:D.outgoingResultWebhook,autoApprovalRate:D.autoApprovalRate,...H?{isDefault:!0}:{}})),Z=H?{id:W[0].id,name:W[0].name,mode:W[0].mode}:null,q=z.webhook?k7(W,z.webhook):H?W[0]:void 0,V;if(z.filePath)if(!Eh1(z.filePath))V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let D=yU(z.filePath),P=await gU(D.fileBuffer,D.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:z.filePath,fileName:D.fileName,documentCount:P.documents.length,warnings:P.warnings}}catch(D){V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[D instanceof Error?D.message:String(D)]}}let F=V?V.valid:!0,M=J==="ok"&&X.length>0&&F,w=Q==="stateful"?"":` --corp ${Y.id}`,N="",O="";if(J!=="ok")O=`凭证鉴权异常: ${K}`,N=`seal-use auth diagnose${w}`;else if(X.length===0)O="当前企业尚未配置任何 Webhook 集成通道",N=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${w}`;else if(V&&!V.valid)O=`资源包预检失败: ${V.errors?.join("; ")}`,N=`seal-use webhook resource-pack preview ${V.filePath}${w}`;else{O=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let D=V?.filePath??"<资源包.zip>",P=H?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;N=`seal-use webhook resource-pack push ${D}${P}${w}`}return{ready:M,corp:{id:Y.id,name:Y.name,sourceType:Y.source.type,tenant:I,user:G},stateMode:Q,authStatus:J,authError:K,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:O,nextAction:N}}var lR0=o(()=>{k3();A6();ql()});var Vl=o(()=>{zI();oQ();pB();qd();wd();Od();ql();lR0();Zl()});import{existsSync as oR0,mkdirSync as rR0,statSync as Ch1}from"node:fs";import{homedir as Rh1}from"node:os";import{dirname as _h1,resolve as KT}from"node:path";function vh1($){if($.outputFile){let K=KT($.outputFile),I=_h1(K);if(!oR0(I))rR0(I,{recursive:!0});return K}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",U=$.dateTag||new Date().toISOString().slice(0,10),Q=`${z}_智能洞察报告_${U}.xlsx`,J;if($.toDownloads)J=KT(Rh1(),"Downloads");else J=KT(process.cwd(),"exports");if(!oR0(J))rR0(J,{recursive:!0});return KT(J,Q)}async function IT($,Y,z={}){let U=Y.name||Y.id,Q=sn({startDate:z.startDate,endDate:z.endDate,force:z.force}),J=new Date().toISOString(),[K,I]=await Promise.all([AM($,{startDate:Q.startDateStr,endDate:Q.endDateStr,limit:z.limit??100}),PM($,{startDate:Q.startDateStr,endDate:Q.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=K.tagStats||[],W=[],H=Math.min(G.length,z.limit??50);for(let C=0;C<H;C++){let b=G[C];if(!b?.tagId)continue;try{let x=await BM($,{tagId:b.tagId,startDate:Q.startDateStr,endDate:Q.endDateStr});for(let S of x.risks||[])W.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:S.documentSN||"-",documentType:S.documentType||"-",riskLevel:S.riskLevel||"warning",confidence:S.confidence??0,riskDetails:S.riskDetails||"-",reasoning:S.reasoning||"-",sourceDocumentURL:S.sourceDocumentURL,createdAt:S.createdAt})}catch{}}let X=new sR0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let M=I.metrics||{},w=[{c
Line truncated
|
||||
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:gI({id:Y?.id,sn:Y?.sn??Y?.sourceDocumentSN??$.sourceDocumentSN,title:Y?.title??Y?.name,template:qT(Y,["template.name","templateName","form.name","formName","formTitle"]),amount:WT(z,["金额","报销金额","付款金额","合计","价税合计"])??qT(Y,["amount","totalAmount","expenseAmount"]),expenseType:WT(z,["费用类型","费用类别","报销类型"]),costCompany:WT(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:WT(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:rh1($),attachments:i2($,{summary:!0}).attachments,aiResult:LT($),manualResult:xU($)?.value,hints:gI({amountMentions:$_0(U,["金额","合计","税率"],8),partyMentions:$_0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function dh1($){let Y=[["result.citedRules",m3($,"result.citedRules")],["result.matchedRules",m3($,"result.matchedRules")],["result.ruleResults",m3($,"result.ruleResults")],["result.rules",m3($,"result.rules")],["pipelineData.citedRules",m3($,"pipelineData.citedRules")],["pipelineData.matchedRules",m3($,"pipelineData.matchedRules")]],z=[],U=new Set;for(let[Q,J]of Y)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((I,G)=>{let W=Fq(I);if(!W)return;let H=S4(W.runtimeRuleId)??S4(W.runtimeId)??S4(W.id)??S4(W.ruleId),X=S4(W.ruleCode)??S4(W.code)??(H?th1(H):void 0),Z=gI({runtimeRuleId:H,ruleCode:X,versionNumber:lh1(W.versionNumber)??$.ruleSetVersionNumber,scope:S4(W.scope),strictness:S4(W.strictness),appliedAnalysis:W.appliedAnalysis??W.analysis??W.reasoning,checkResult:W.checkResult??W.result??W.decision,findings:W.findings??W.riskPoints??W.evidence,sourcePath:`${Q}.${G}`}),q=JSON.stringify(Z);if(!U.has(q))U.add(q),z.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function qT($,Y){if(!$)return;for(let z of Y){let U=m3($,z);if(U!==void 0)return U}return}function eR0($,Y){if(!$)return 0;for(let z of Y){let U=m3($,z);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function m3($,Y){return Y.split(".").reduce((z,U)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let Q=Number(U);return Number.isInteger(Q)?z[Q]:void 0}if(typeof z==="object")return z[U];return},$)}function mh1($,Y,z){let U=Y.split("."),Q=$;for(let J of U.slice(0,-1)){let K=Q[J];if(!K||typeof K!=="object"||Array.isArray(K))Q[J]={};Q=Q[J]}Q[U[U.length-1]??Y]=z}function gI($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}function Fq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function lh1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function oh1($){let Y=[];return Ml($,"document",Y),Y}function Ml($,Y,z){if(Array.isArray($)){$.forEach((K,I)=>Ml(K,`${Y}.${I}`,z));return}let U=Fq($);if(!U)return;let Q=S4(U.label)??S4(U.name)??S4(U.title)??S4(U.fieldName),J=U.value??U.displayValue??U.text??U.content;if(Q&&J!==void 0&&typeof J!=="object")z.push(gI({path:Y,label:Q,value:J,type:S4(U.type)??S4(U.fieldType)}));for(let[K,I]of Object.entries(U)){if(K==="attachments")continue;Ml(I,`${Y}.${K}`,z)}}function WT($,Y){return $.find((U)=>{let Q=S4(U.label)??"";return Y.some((J)=>Q.includes(J))})?.value}function rh1($){let Y=[];return VT($.result,"result",Y),VT($.document,"document",Y),Y.slice(0,20)}function VT($,Y,z){if(Array.isArray($)){$.forEach((Q,J)=>VT(Q,`${Y}.${J}`,z));return}let U=Fq($);if(!U)return;if(/invoice|发票/i.test(Y))z.push(gI({path:Y,fileName:S4(U.fileName)??S4(U.filename)??S4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[Q,J]of Object.entries(U))VT(J,`${Y}.${Q}`,z)}function $_0($,Y,z){return $.split(/\r?\n/).filter((U)=>Y.some((Q)=>U.includes(Q))).slice(0,z)}function HT($){return $.map((Y)=>{let z=kU(Y);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Fl($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function sh1($,Y){if(Y.recordId&&!Y.versionId&&!Y.versionNumber&&!Y.latest){let z=await W4($,Y.recordId);if(!z.ruleSetVersionNumber)throw Er
Line truncated
|
||||
`);let Z=Dd(G.document,W,H),q=await fetch(`${Q}/api/v1/integrations/webhook/${encodeURIComponent(J)}/document`,{method:"POST",headers:{...z.customHeaders??{},"Content-Type":"application/json",...hZ({webhookId:J,...Z},z.secret)},body:JSON.stringify(Z)});if(!q.ok)throw Error(`Webhook 单据推送失败 ${q.status}: ${await q.text()}`);K.push({documentId:Z.documentId,document:Z,pushResult:await q.json()}),process.stderr.write(`✓ 单据推送成功: ${Z.documentId}
|
||||
`)}return{warnings:[],results:K}}function kU($){return{fileBuffer:xh1($),fileName:$.split(/[\\\/]/).pop()??"material-pack.zip"}}var Fl=m(()=>{dB();Ad();Nd();Fd();UI();Ll()});import{existsSync as ih1}from"node:fs";async function KT($,Y,z={}){let Q=_4().stateful?"stateful":"stateless",J="ok",K,I,G;try{let D=await T8($);G={id:D.user.id,name:D.user.name,isAdmin:D.user.isAdmin},I={id:D.tenant.id,name:D.tenant.name,tenantSlug:D.tenant.tenantSlug,corporationName:D.tenant.hoseCorpConfig?.corporationName}}catch(D){J="error",K=D instanceof Error?D.message:String(D)}let W=[];if(J==="ok")try{W=await K$($,Y.seal.endpoints.approvalStylePreferences)}catch(D){J="error",K=`读取 Webhook 配置失败: ${D instanceof Error?D.message:String(D)}`}let H=W.length===1,X=W.map((D)=>({id:D.id,name:D.name,mode:D.mode,incomingDocumentWebhookUrl:D.incomingDocumentWebhook.url,outgoingResultWebhookUrl:D.outgoingResultWebhook,autoApprovalRate:D.autoApprovalRate,...H?{isDefault:!0}:{}})),Z=H?{id:W[0].id,name:W[0].name,mode:W[0].mode}:null,q=z.webhook?x7(W,z.webhook):H?W[0]:void 0,V;if(z.filePath)if(!ih1(z.filePath))V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[`文件不存在: ${z.filePath}`]};else try{let D=kU(z.filePath),P=await yU(D.fileBuffer,D.fileName,q?.materialPackFilePolicy);V={valid:!0,filePath:z.filePath,fileName:D.fileName,documentCount:P.documents.length,warnings:P.warnings}}catch(D){V={valid:!1,filePath:z.filePath,fileName:z.filePath.split(/[\\/]/).pop()??z.filePath,documentCount:0,errors:[D instanceof Error?D.message:String(D)]}}let F=V?V.valid:!0,w=J==="ok"&&X.length>0&&F,M=Q==="stateful"?"":` --corp ${Y.id}`,O="",N="";if(J!=="ok")N=`凭证鉴权异常: ${K}`,O=`seal-use auth diagnose${M}`;else if(X.length===0)N="当前企业尚未配置任何 Webhook 集成通道",O=`seal-use webhook add --name "默认入站通道" --result-url "https://your-domain.com/callback"${M}`;else if(V&&!V.valid)N=`资源包预检失败: ${V.errors?.join("; ")}`,O=`seal-use webhook resource-pack preview ${V.filePath}${M}`;else{N=H?"所有通道正常,已自动锁定唯一 Webhook 通道,等待载入":`所有通道正常,检测到 ${X.length} 个 Webhook 通道,等待载入`;let D=V?.filePath??"<资源包.zip>",P=H?"":` --webhook ${Z?Z.id:"<webhookIdOrName>"}`;O=`seal-use webhook resource-pack push ${D}${P}${M}`}return{ready:w,corp:{id:Y.id,name:Y.name,sourceType:Y.source.type,tenant:I,user:G},stateMode:Q,authStatus:J,authError:K,activeWebhooks:X,defaultWebhook:Z,resourcePack:V,materialPack:V,statusMessage:N,nextAction:O}}var z_0=m(()=>{k3();A6();Fl()});var Ml=m(()=>{UI();rQ();dB();Fd();Nd();Ad();Fl();z_0();Ll()});import{existsSync as U_0,mkdirSync as Q_0,statSync as ch1}from"node:fs";import{homedir as nh1}from"node:os";import{dirname as ph1,resolve as IT}from"node:path";function dh1($){if($.outputFile){let K=IT($.outputFile),I=ph1(K);if(!U_0(I))Q_0(I,{recursive:!0});return K}let z=($.corpName||$.corpId||"企业").replace(/[/\\?%*:|"<>]/g,"_").trim()||"企业",U=$.dateTag||new Date().toISOString().slice(0,10),Q=`${z}_智能洞察报告_${U}.xlsx`,J;if($.toDownloads)J=IT(nh1(),"Downloads");else J=IT(process.cwd(),"exports");if(!U_0(J))Q_0(J,{recursive:!0});return IT(J,Q)}async function GT($,Y,z={}){let U=Y.name||Y.id,Q=an({startDate:z.startDate,endDate:z.endDate,force:z.force}),J=new Date().toISOString(),[K,I]=await Promise.all([Bw($,{startDate:Q.startDateStr,endDate:Q.endDateStr,limit:z.limit??100}),Tw($,{startDate:Q.startDateStr,endDate:Q.endDateStr}).catch(()=>({metrics:{},sankeyData:{nodes:[],links:[]}}))]),G=K.tagStats||[],W=[],H=Math.min(G.length,z.limit??50);for(let C=0;C<H;C++){let b=G[C];if(!b?.tagId)continue;try{let x=await Pw($,{tagId:b.tagId,startDate:Q.startDateStr,endDate:Q.endDateStr});for(let S of x.risks||[])W.push({tagId:b.tagId,tagName:b.tagName||b.tagId,documentSN:S.documentSN||"-",documentType:S.documentType||"-",riskLevel:S.riskLevel||"warning",confidence:S.confidence??0,riskDetails:S.riskDetails||"-",reasoning:S.reasoning||"-",sourceDocumentURL:S.sourceDocumentURL,createdAt:S.createdAt})}catch{}}let X=new J_0.default.Workbook;X.creator="seal-use",X.lastModifiedBy="seal-use",X.created=new Date,X.modified=new Date;let Z={type:"pattern",pattern:"solid",fgColor:{argb:"FF1E293B"}},q={name:"Microsoft YaHei",size:11,bold:!0,color:{argb:"FFFFFFFF"}},V={top:{style:"thin",color:{argb:"FFE2E8F0"}},bottom:{style:"thin",color:{argb:"FFE2E8F0"}},left:{style:"thin",color:{argb:"FFE2E8F0"}},right:{style:"thin",color:{argb:"FFE2E8F0"}}},F=X.addWorksheet("审核效能与决策流向",{views:[{showGridLines:!0}]});F.columns=[{header:"分类",key:"category",width:20},{header:"指标名称",key:"name",width:28},{header:"数值",key:"val",width:22},{header:"环比/趋势",key:"trend",width:18},{header:"说明",key:"desc",width:36}],F.getRow(1).height=28,F.getRow(1).font=q,F.getRow(1).fill=Z,F.getRow(1).alignment={vertical:"middle",horizontal:"center"};let w=I.metrics||{},M=[{c
Line truncated
|
||||
`);return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,document:yI({id:Y?.id,sn:Y?.sn??Y?.sourceDocumentSN??$.sourceDocumentSN,title:Y?.title??Y?.name,template:VT(Y,["template.name","templateName","form.name","formName","formTitle"]),amount:HT(z,["金额","报销金额","付款金额","合计","价税合计"])??VT(Y,["amount","totalAmount","expenseAmount"]),expenseType:HT(z,["费用类型","费用类别","报销类型"]),costCompany:HT(z,["费用承担公司","承担公司","成本中心","费用归属"]),payee:HT(z,["收款方","收款账户","收款信息","开户名","银行账号"]),keyFields:z.slice(0,30)}),invoices:WS1($),attachments:c2($,{summary:!0}).attachments,aiResult:FT($),manualResult:fU($)?.value,hints:yI({amountMentions:W_0(U,["金额","合计","税率"],8),partyMentions:W_0(U,["买方","卖方","甲方","乙方","收款"],8)})}}function JS1($){let Y=[["result.citedRules",m3($,"result.citedRules")],["result.matchedRules",m3($,"result.matchedRules")],["result.ruleResults",m3($,"result.ruleResults")],["result.rules",m3($,"result.rules")],["pipelineData.citedRules",m3($,"pipelineData.citedRules")],["pipelineData.matchedRules",m3($,"pipelineData.matchedRules")]],z=[],U=new Set;for(let[Q,J]of Y)(Array.isArray(J)?J:J&&typeof J==="object"?Object.values(J):[]).forEach((I,G)=>{let W=Mq(I);if(!W)return;let H=S4(W.runtimeRuleId)??S4(W.runtimeId)??S4(W.id)??S4(W.ruleId),X=S4(W.ruleCode)??S4(W.code)??(H?ZS1(H):void 0),Z=yI({runtimeRuleId:H,ruleCode:X,versionNumber:IS1(W.versionNumber)??$.ruleSetVersionNumber,scope:S4(W.scope),strictness:S4(W.strictness),appliedAnalysis:W.appliedAnalysis??W.analysis??W.reasoning,checkResult:W.checkResult??W.result??W.decision,findings:W.findings??W.riskPoints??W.evidence,sourcePath:`${Q}.${G}`}),q=JSON.stringify(Z);if(!U.has(q))U.add(q),z.push(Z)});return{recordId:$.id,sourceDocumentSN:$.sourceDocumentSN,sourceDocumentId:$.sourceDocumentId,ruleSetVersionNumber:$.ruleSetVersionNumber,count:z.length,rules:z}}function VT($,Y){if(!$)return;for(let z of Y){let U=m3($,z);if(U!==void 0)return U}return}function G_0($,Y){if(!$)return 0;for(let z of Y){let U=m3($,z);if(Array.isArray(U))return U.length;if(U&&typeof U==="object")return Object.keys(U).length;if(typeof U==="number")return U}return 0}function m3($,Y){return Y.split(".").reduce((z,U)=>{if(z===void 0||z===null)return;if(Array.isArray(z)){let Q=Number(U);return Number.isInteger(Q)?z[Q]:void 0}if(typeof z==="object")return z[U];return},$)}function KS1($,Y,z){let U=Y.split("."),Q=$;for(let J of U.slice(0,-1)){let K=Q[J];if(!K||typeof K!=="object"||Array.isArray(K))Q[J]={};Q=Q[J]}Q[U[U.length-1]??Y]=z}function yI($){return Object.fromEntries(Object.entries($).filter(([,Y])=>Y!==void 0))}function Mq($){return $&&typeof $==="object"&&!Array.isArray($)?$:void 0}function IS1($){return typeof $==="number"&&Number.isFinite($)?$:void 0}function GS1($){let Y=[];return Dl($,"document",Y),Y}function Dl($,Y,z){if(Array.isArray($)){$.forEach((K,I)=>Dl(K,`${Y}.${I}`,z));return}let U=Mq($);if(!U)return;let Q=S4(U.label)??S4(U.name)??S4(U.title)??S4(U.fieldName),J=U.value??U.displayValue??U.text??U.content;if(Q&&J!==void 0&&typeof J!=="object")z.push(yI({path:Y,label:Q,value:J,type:S4(U.type)??S4(U.fieldType)}));for(let[K,I]of Object.entries(U)){if(K==="attachments")continue;Dl(I,`${Y}.${K}`,z)}}function HT($,Y){return $.find((U)=>{let Q=S4(U.label)??"";return Y.some((J)=>Q.includes(J))})?.value}function WS1($){let Y=[];return LT($.result,"result",Y),LT($.document,"document",Y),Y.slice(0,20)}function LT($,Y,z){if(Array.isArray($)){$.forEach((Q,J)=>LT(Q,`${Y}.${J}`,z));return}let U=Mq($);if(!U)return;if(/invoice|发票/i.test(Y))z.push(yI({path:Y,fileName:S4(U.fileName)??S4(U.filename)??S4(U.name),buyer:U.buyer??U.buyerName??U.purchaserName,seller:U.seller??U.sellerName,amount:U.amount??U.totalAmount??U.total,taxRate:U.taxRate,category:U.category??U.type}));for(let[Q,J]of Object.entries(U))LT(J,`${Y}.${Q}`,z)}function W_0($,Y,z){return $.split(/\r?\n/).filter((U)=>Y.some((Q)=>U.includes(Q))).slice(0,z)}function XT($){return $.map((Y)=>{let z=xU(Y);return{recordId:z.id,tenantId:z.tenantId,agentId:z.agentId,sourceDocumentSN:z.sourceDocumentSN,sourceDocumentId:z.sourceDocumentId,simulationBatchId:z.simulationBatchId,langfuseTraceId:z.langfuseTraceId,langfuseSessionFallback:z.langfuseSessionFallback,ruleSetVersionNumber:z.ruleSetVersionNumber,ruleSetPublishedAt:z.ruleSetPublishedAt,ruleSetPublishedByName:z.ruleSetPublishedByName,resolution:z.langfuseTraceId?"trace":z.langfuseSessionFallback?"session-fallback":"unresolved"}})}function Ol($){return{id:$.id,tenantId:$.tenantId,versionNumber:$.versionNumber,versionName:$.versionName,publishedBy:$.publishedBy,publishedByName:$.publishedByName,rulesCount:$.rules.length,publishedAt:$.publishedAt,createdAt:$.createdAt}}async function HS1($,Y){if(Y.recordId&&!Y.versionId&&!Y.versionNumber&&!Y.latest){let z=await W4($,Y.recordId);if(!z.ruleSetVersionNumber)throw Er
Line truncated
|
||||
`),format:Y.format??"unified"}}},{name:"seal_approval_rule_version_publish",description:"发布 Seal 草稿审批规则为新版本",parameters:L.object({versionName:L.string().describe("版本名称")}),handler:async($,Y)=>gW($,Y.versionName)},{name:"seal_approval_rule_get",description:"按版本号/code/runtime-id/record-id 定位单条规则;code 只在选定的版本编号体系内有效,避免拉取整版规则快照",parameters:L.object({versionId:L.string().optional().describe("规则版本 ID"),versionNumber:L.number().int().positive().optional().describe("规则版本号"),latest:L.boolean().optional().describe("为 true 时取最新版本"),code:L.string().optional().describe("规则展示编号,如 #0038;没有后端 code 时按版本内序号匹配"),runtimeId:L.string().optional().describe("运行时规则 ID,如 rule-205;按版本内序号匹配"),recordId:L.string().optional().describe("从运行记录推断 ruleSetVersionNumber")}),handler:async($,Y)=>{let z=await HS1($,Y),U=XS1(z,{code:Y.code,runtimeId:Y.runtimeId});if(!U)throw Error(`Rule not found in version ${z.versionNumber}`);return U}},{name:"seal_approval_rules_lint",description:"对 Seal 本地规则文件、草稿审批规则或指定发布版本规则进行质量与可执行性检查(模糊词、悬空例外检测)",parameters:L.object({file:L.string().optional().describe("指定本地规则文件路径进行离线质检(支持 .json),0网络请求、不污染远端草稿"),linter:L.string().optional().describe("指定使用的校验器名称或脚本路径(如 builtin、strict、./my-linter.ts)"),version:L.string().optional().describe("指定要质检的历史发布版本号或 ID(如 16 或 latest),不传默认质检当前草稿"),code:L.string().optional().describe("按规则展示编号过滤(如 #0038)"),ruleId:L.string().optional().describe("按规则 ID 过滤"),minScore:L.number().optional().describe("最低合格质量分阈值(0~100),低于该分值抛出错误以返回非零退出码"),level:L.enum(["all","error","warning"]).default("all").describe("问题报告等级过滤"),summary:L.boolean().optional().describe("为 true 时仅返回存在瑕疵/扣分的规则")}),handler:async($,Y,z)=>{let U=[],Q;if(Y.file){let W=Pp(Y.file);U=eA0(W.rules),Q=W.meta.versionNumber}else if(Y.version){let W=await c8($),H=Number(Y.version),X=isNaN(H)?Y.version==="latest"?W[0]:W.find((Z)=>Z.id===Y.version):W.find((Z)=>Z.versionNumber===H);if(!X)throw Error(`未找到指定的规则版本: ${Y.version}`);Q=X.versionNumber,U=(X.rules??[]).map((Z,q)=>({id:Z.id??Z.runtimeId,code:Z.code??`#${String(q+1).padStart(4,"0")}`,name:Z.name??Z.title,description:Z.description??"",scope:Z.scope,strictness:Z.strictness}))}else U=((await p6($)).rules??[]).map((H,X)=>({id:H.id,code:H.code??`#${String(X+1).padStart(4,"0")}`,name:H.name??H.title,description:H.description??"",scope:H.scope,strictness:H.strictness}));if(Y.code)U=U.filter((W)=>W.code===Y.code||W.code?.replace(/[#\s]/g,"")===Y.code?.replace(/[#\s]/g,""));if(Y.ruleId)U=U.filter((W)=>W.id===Y.ruleId||W.code===Y.ruleId);let J=_4(),K=Y.linter??J.lint?.activeLinter??"builtin",I=await Np(K),G=await rA0(U,I,{corpId:z?.corp?.id,versionNumber:Q,allRules:U},{minScore:Y.minScore,level:Y.level,summary:Y.summary});if(Y.minScore&&G.overallScore<Y.minScore)throw Error(`[Linter 质量门禁未通过] 综合评分 ${G.overallScore} 低于要求的最低分 ${Y.minScore} 分 (共发现 ${G.issueCount} 条问题规则)。`);return G}},{name:"seal_approval_rules_pull",description:"从 Seal 远端拉取草稿或指定版本规则,保存至本地规则文件(支持离线编辑与本地 Lint,绝不污染远端草稿)",parameters:L.object({version:L.string().optional().describe("指定拉取的历史发布版本号或 ID(如 16 或 latest),不传默认拉取当前草稿规则"),out:L.string().optional().describe("保存的目标本地文件路径,默认为 ./rules.local.json")}),handler:async($,Y,z)=>{let U=Y.out??"./rules.local.json",Q=[],J="draft",K;if(Y.version){let G=await c8($),W=Number(Y.version),H=isNaN(W)?Y.version==="latest"?G[0]:G.find((X)=>X.id===Y.version):G.find((X)=>X.versionNumber===W);if(!H)throw Error(`未找到指定的规则版本: ${Y.version}`);K=H.versionNumber,J=`version:${K}`,Q=(H.rules??[]).map((X,Z)=>({code:X.code?Number(String(X.code).replace(/^#/,""))||Z+1:Z+1,name:X.name??X.title,description:X.description??"",scope:X.scope??"ALL",strictness:X.strictness??"MUST_FOLLOW"}))}else Q=((await p6($)).rules??[]).map((W,H)=>({id:W.id,code:W.code??H+1,name:W.name??W.title,description:W.description??"",scope:W.scope??"ALL",strictness:W.strictness??"MUST_FOLLOW",status:W.status}));return{saved:!0,path:tA0(U,{corpId:z.corp.id,source:J,versionNumber:K,exportedAt:new Date().toISOString(),rulesCount:Q.length,rules:Q}),rulesCount:Q.length,corpId:z.corp.id,source:J,versionNumber:K}}},{name:"seal_approval_rules_push",description:"将本地规则文件
Line truncated
|
||||
`+`• 身份主体:${T}${A}
|
||||
`+`• 权限范围:持有该链接者在 Seal AI 中拥有该用户的完整操作权限(含系统设置与规则编辑)
|
||||
`+`• 时效性:换票凭证有效时间 ${q} 秒(${Math.round(q/60)} 分钟),在浏览器打开后将保留 30 天会话
|
||||
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:H?K:Z?V:G,type:X,mode:Z?"auto_login":"direct",sealResultUrl:G,hoseDocumentUrl:K,documentUrl:K,ssoUrl:V,expiresIn:Z?q:void 0,identity:F,warning:M,hoseDomain:J.type==="hose"?zS1(J.domain):void 0,recordId:Q.id,sourceDocumentSN:Q.sourceDocumentSN,sourceDocumentId:Q.sourceDocumentId,sourceSystem:Q.sourceSystem,missing:{hoseDocumentUrl:!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,Y,z)=>{let U=Y.sn??Y.query;if(!U)throw Error("query or sn is required");let Q=await US1($,{query:U,sn:Y.sn,batchId:Y.batchId,latest:Y.latest,limit:Y.latest?1:Y.limit??20,maxScan:Y.maxScan??1000}),J=await Promise.all(Q.records.map((X)=>W4($,X.id))),K=tR0(Y.fields),I=J.map((X)=>eh1(X,K)),G=J.find((X)=>X.ruleSetVersionNumber!==void 0)?.ruleSetVersionNumber,W=G===void 0?"latest":String(G),H=G===void 0?'"latestRuleVersion":true':`"ruleVersionNumber":${G}`;return{query:U,sourceDocumentSN:Y.sn,simulationBatchId:Y.batchId,latest:Y.latest??!1,total:Q.total,scanned:Q.scanned,matched:I.length,records:I,next:{getSummary:`seal-use approval-runs get <recordId> --summary --corp ${z.corp.id}`,getRuleVersion:`seal-use rules version ${W} --corp ${z.corp.id}`,searchRuleVersion:`seal-use tool seal_approval_search --corp ${z.corp.id} --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version",${H}}'`,getVersionContext:`seal-use tool seal_approval_context_get --corp ${z.corp.id} --json '{${H}}'`},...Y.includeBridge?{bridge:HT(J)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,Y)=>{let z=Bl(await zg($,Y.batchId),Y.query);return{batchId:Y.batchId,count:z.length,records:z.map(kU),bridge:HT(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,Y)=>{let z=Y.mode??"hosecloud",U=Y.signKey;if(z==="hosecloud"&&!U){if(U=(await Qg($)).find((I)=>I.signKey)?.signKey,!U)throw Error("
Line truncated
|
||||
`)}function qS1($){let Y=[];if(Y.push(`seal-use ${$.area} - ${$.title}`),$.description)Y.push($.description);Y.push(""),Y.push("Usage:");for(let z of $.commands)for(let U of z.usage)Y.push(` ${U}`);if($.commands.some((z)=>z.name))Y.push(""),Y.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return Y.join(`
|
||||
`)}function w_0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let Y of M_0)for(let z of Y.commands)for(let U of z.usage)$.push(` ${U}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
|
||||
`)}var M_0;var _l=o(()=>{L$();M_0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"rename",summary:"Rename an enterprise display name",usage:["seal-use corps rename <corpId> --name <newName>"],options:[{flag:"--name <newName>",description:"New human-readable enterprise name (required)"}],description:"Safely updates the display name of a configured enterprise without modifying underlying files manually."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",des
Line truncated
|
||||
`+"• 安全边界:该凭证绝不包含且无法访问合思 (Hose) 主系统;仅限内部排查,严禁在外部公开分享!")}return{url:H?K:Z?V:G,type:X,mode:Z?"auto_login":"direct",sealResultUrl:G,hoseDocumentUrl:K,documentUrl:K,ssoUrl:V,expiresIn:Z?q:void 0,identity:F,warning:w,hoseDomain:J.type==="hose"?FS1(J.domain):void 0,recordId:Q.id,sourceDocumentSN:Q.sourceDocumentSN,sourceDocumentId:Q.sourceDocumentId,sourceSystem:Q.sourceSystem,missing:{hoseDocumentUrl:!K?"sourceExtendData.hosecloudViewUrl is absent from the approval run detail.":void 0}}}},{name:"seal_approval_run_pick",description:"按合思单号或关键字查询运行记录,返回候选记录及其当时使用的规则版本,便于再取详情或查版本规则",parameters:L.object({query:L.string().optional().describe("合思单号、源单据 ID、运行记录 ID 或 trace 关键字"),sn:L.string().optional().describe("合思/易快报单号;优先作为精确 sourceDocumentSN 查询"),batchId:L.string().optional().describe("模拟批次 ID"),latest:L.boolean().optional().describe("只返回最新一条匹配记录"),fields:L.union([L.string(),L.array(L.string())]).optional().describe("限制返回字段"),limit:L.number().int().positive().max(100).optional(),maxScan:L.number().int().positive().max(5000).optional().describe("最多扫描多少条运行记录用于本地匹配,默认 1000"),includeBridge:L.boolean().optional()}),handler:async($,Y,z)=>{let U=Y.sn??Y.query;if(!U)throw Error("query or sn is required");let Q=await MS1($,{query:U,sn:Y.sn,batchId:Y.batchId,latest:Y.latest,limit:Y.latest?1:Y.limit??20,maxScan:Y.maxScan??1000}),J=await Promise.all(Q.records.map((X)=>W4($,X.id))),K=I_0(Y.fields),I=J.map((X)=>qS1(X,K)),G=J.find((X)=>X.ruleSetVersionNumber!==void 0)?.ruleSetVersionNumber,W=G===void 0?"latest":String(G),H=G===void 0?'"latestRuleVersion":true':`"ruleVersionNumber":${G}`;return{query:U,sourceDocumentSN:Y.sn,simulationBatchId:Y.batchId,latest:Y.latest??!1,total:Q.total,scanned:Q.scanned,matched:I.length,records:I,next:{getSummary:`seal-use approval-runs get <recordId> --summary --corp ${z.corp.id}`,getRuleVersion:`seal-use rules version ${W} --corp ${z.corp.id}`,searchRuleVersion:`seal-use tool seal_approval_search --corp ${z.corp.id} --json '{"keywords":["关键词"],"areas":["rules"],"ruleVersionScope":"version",${H}}'`,getVersionContext:`seal-use tool seal_approval_context_get --corp ${z.corp.id} --json '{${H}}'`},...Y.includeBridge?{bridge:XT(J)}:{}}}},{name:"seal_simulation_batch_records_get",description:"获取某一次 Seal 模拟批次的运行记录,并整理对应 Langfuse trace/session 桥接字段",parameters:L.object({batchId:L.string().describe("simulation batch ID"),query:L.string().optional().describe("在 id、sourceDocumentSN、sourceDocumentId、documentId、Langfuse traceId 中做本地包含匹配")}),handler:async($,Y)=>{let z=jl(await Ug($,Y.batchId),Y.query);return{batchId:Y.batchId,count:z.length,records:z.map(xU),bridge:XT(z)}}},{name:"seal_simulation_batch_create",description:"创建 Seal 模拟测试批次。支持合思指定单号(hosecloud)与材料包导入(material_pack)两种模式;其他取数模式通过 rawParams 预留透传。",parameters:L.object({mode:L.enum(["hosecloud","material_pack"]).default("hosecloud").describe("来源模式: hosecloud=合思指定单号; material_pack=材料包导入"),flowIds:L.array(L.string()).max(100).optional().describe("合思模式: 单据流水号列表"),rejectNodeName:L.string().nullable().optional().describe("仅关注特定节点: 节点名称, 不设为 null 表示不限制"),thinkingDepthOverride:L.enum(["default","medium","high"]).optional().describe("思考深度: default=按偏好设置, medium=标准, high=深度推理"),skipInvoiceGeneration:L.boolean().optional().describe("跳过发票生成, 默认 true"),skipExpenseExtraction:L.boolean().optional().describe("跳过费用提取, 默认 true"),disableAttachmentCache:L.boolean().optional().describe("不使用附件缓存, 默认 false"),signKey:L.string().optional().describe("合思集成标识; 缺省时自动取第一个合思集成"),packageIds:L.array(L.string()).optional().describe("材料包模式: 材料包 id 列表(来自 material-packages upload 响应)"),templateId:L.string().optional().describe("材料包模板 id, 例如 conference_reimbursement_v1; 缺省取 schemaConfig.id"),schemaConfig:L.record(L.string(),L.unknown()).optional().describe("材料包字段映射(确认参数), 建议使用 material-packages upload 返回的 schemaConfig"),noWait:L.boolean().optional().describe("创建后立即返回异步票据,不等待批次完成"),rawParams:L.record(L.string(),L.unknown()).optional().describe("预留: 其他取数模式(如时间范围 startTime/endTime)透传参数, 覆盖上述构建结果")}),handler:async($,Y)=>{let z=Y.mode??"hosecloud",U=Y.signKey;if(z==="hosecloud"&&!U){if(U=(await Jg($)).find((I)=>I.signKey)?.signKey,!U)throw Error("
Line truncated
|
||||
`)}function ES1($){let Y=[];if(Y.push(`seal-use ${$.area} - ${$.title}`),$.description)Y.push($.description);Y.push(""),Y.push("Usage:");for(let z of $.commands)for(let U of z.usage)Y.push(` ${U}`);if($.commands.some((z)=>z.name))Y.push(""),Y.push(`Run 'seal-use ${$.area} <command> --help' for details on a specific command.`);return Y.join(`
|
||||
`)}function E_0(){let $=[];$.push("seal-use CLI"),$.push(""),$.push("Usage:"),$.push(" seal-use version");for(let Y of C_0)for(let z of Y.commands)for(let U of z.usage)$.push(` ${U}`);return $.push(""),$.push("Run 'seal-use <command> --help' for details on a specific command."),$.join(`
|
||||
`)}var C_0;var Sl=m(()=>{F$();C_0=[{area:"corps",title:"Enterprise and tenant management",description:"Manage enterprise configurations, environment modes, test bindings, and syncing.",commands:[{name:"list",summary:"List configured enterprises sorted by 7-day usage frequency",usage:["seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]"],options:[{flag:"--all",description:"Display all configured enterprises without the default 10-item limit"},{flag:"--limit <n>",description:"Maximum number of enterprises to display (defaults to 10)"},{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}]},{name:"search",aliases:["find"],summary:"Search configured enterprises with intelligent soft fuzzy matching",usage:["seal-use corps search <query> [--env <production|test>] [--strict]"],options:[{flag:"--env <production|test>",description:"Filter enterprises by environment ('production' or 'test')"},{flag:"--strict",description:"Use strict exact substring matching instead of default soft fuzzy search"}],description:"Searches enterprise ID, name, staff ID, domain, tenant slug, environment, or bindings. Uses soft search by default (case-insensitive, Chinese homophones, front/back nasal vowels, initials, typo/missing letter tolerance)."},{name:"get",aliases:["show"],summary:"Get rich details and configuration of an enterprise",usage:["seal-use corps get <corpId>"],description:"Retrieves complete enterprise details (URLs, tenant slugs, custom headers/cookies, staff IDs, relations, config file path) with sensitive secrets safely redacted."},{name:"current",summary:"Show active enterprise in stateful mode",usage:["seal-use corps current [--corp <corpId>]"]},{name:"switch",summary:"Switch default active enterprise",usage:["seal-use corps switch <corpId>"]},{name:"mark",summary:"Mark enterprise environment as production or test",usage:["seal-use corps mark <corpId> --env <production|test> [--confirm]"],options:[{flag:"--env <production|test>",description:"Target environment: 'production' or 'test' (required)"},{flag:"--confirm",description:"Confirm the environment update (required)"}],description:"Explicitly updates an enterprise's environment tag. Requires --confirm to prevent accidental changes."},{name:"rename",summary:"Rename an enterprise display name",usage:["seal-use corps rename <corpId> --name <newName>"],options:[{flag:"--name <newName>",description:"New human-readable enterprise name (required)"}],description:"Safely updates the display name of a configured enterprise without modifying underlying files manually."},{name:"bind-test",summary:"Bind a production enterprise to a test enterprise (1-to-1 association)",usage:["seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]","seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]"],options:[{flag:"--confirm",description:"Explicitly confirm binding and tag test environment (required)"},{flag:"--force",description:"Force re-binding if the production enterprise is already bound"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Establishes a strict 1-to-1 association between a production enterprise and a test enterprise. Automatically marks the test enterprise with environment 'test'."},{name:"unbind-test",summary:"Unbind a production and test enterprise association",usage:["seal-use corps unbind-test [<corpId>] [--confirm]"],options:[{flag:"--confirm",description:"Explicitly confirm unbinding both sides (required)"},{flag:"--corp <corpId>",description:"Specify enterprise ID or name"}],description:"Removes the 1-to-1 test association from both the production enterprise and the test enterprise."},{name:"sync-test",summary:"Synchronize rules and preferences from production to test enterprise",usage:["seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]"],options:[{flag:"--dry-run",description:"Preview sync diff without making network mutations (default)"},{flag:"--yes",description:"Execute synchronization and publish new rule version on test enterprise"},{flag:"--version-name <name>",description:"Custom version name for published test rule version"},{flag:"--corp <corpId>",description:"Specify production enterprise ID or name"}],description:"Overwrites test enterprise decision preferences with production preferences, syncs production draft rules to test enterprise, and immediately publishes a new version on the test enterprise. Production rules remain safe in draft state."},{name:"replay-test",summary:"Replay approval records from production enterprise to bound test enterprise via Webhook",usage:["seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--webhook <idOrName>] [--dry-run]"],options:[{flag:"<prodCorpId>",des
Line truncated
|
||||
`)}
|
||||
`}function Nq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function f0($,Y={}){MS1($,Y);let z=`${JSON.stringify($,null,2)}
|
||||
`;if(Y.outputFile){VS1(Y.outputFile,z),console.log(JSON.stringify({outputFile:Y.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function MS1($,Y={}){if(Y.allowFull||Y.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>wS1)throw new dB(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function A_0($,Y){if(Y)return;let z=$&&typeof $==="object"?$:{},U=typeof z.count==="number"?z.count:void 0,Q=Array.isArray(z.rules)?z.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),K=U??Q??0;if(K>LS1||J>FS1)throw new dB(`Rule list is large (${K} rules, ${J} bytes). Use "seal-use rules list --summary", "seal-use rules count", or --output-file; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:Z0($.full)===!0,outputFile:h($.outputFile)??h($["output-file"])}}function B_0($=[]){console.log(N_0($))}var LS1=100,FS1=120000,D_0,wS1=200000;var I4=o(()=>{D4();L$();_l();D_0=["code","status","strictness","scope","updatedAt"]});var hl={};N8(hl,{selectCorp:()=>j1,runToolResult:()=>T5,runTool:()=>k0,globalConfigSummary:()=>a2});function j1($){let Y=r8(),z=_4(),U=c2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},g3());return AA0(U.id),U}function a2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:XU()}}async function k0($,Y,z,U,Q={}){f0(await T5($,Y,z,U),Q)}async function T5($,Y,z,U){let Q=Lq.find((I)=>I.name===$);if(!Q)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(U).filter(([,I])=>I!==void 0)),K=Q.handler;return K(Y,J,{corp:z})}var f4=o(()=>{k3();cB();wq();I4()});import{existsSync as P_0}from"node:fs";async function T_0($,Y){if(!P_0($))throw Error(`File not found: ${$}`);let z=yU($);console.log(JSON.stringify(await gU(z.fileBuffer,z.fileName,Y),null,2))}async function NT($,Y,z,U,Q){if($==="ready"||$==="status"){let J=Y??h(Q.options.file)??h(Q.options.input),K=await JT(z,U,{filePath:J,webhook:h(Q.options.webhook)??h(Q.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${K.corp.name} (${K.corp.id}) [${K.stateMode}]`),K.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${K.corp.tenant.name} (${K.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${K.authStatus==="ok"?"OK":`异常 (${K.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${K.activeWebhooks.length} 个可用`);for(let I of K.activeWebhooks){let G=I.isDefault?" [默认通道]":"";console.error(` - ${I.name} (${I.id}) mode=${I.mode}${G}`)}if(K.materialPack)console.error(`[webhook-ready] 材料包预检: ${K.materialPack.valid?`通过 (${K.materialPack.documentCount} 单)`:`失败 (${K.materialPack.errors?.join("; ")})`}`);if(K.ready)console.error(`\uD83D\uDFE2 ${K.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${K.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${K.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${K.nextAction}`);console.log(JSON.stringify(K,null,2));return}if($==="replay"){let J=Y??h(Q.options.recordId)??h(Q.options["record-id"])??h(Q.options.id),K=h(Q.options.recordIds)??h(Q.options["record-ids"]),I=K?K.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=h(Q.options.sn)??h(Q.options.documentSn)??h(Q.options["document-sn"]),W=h(Q.options.sns)??h(Q.options["document-sns"]),H=W?W.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(Q.options.limit),Z=h(Q.options.status),q=h(Q.options.startDate)??h(Q.options["start-date"]),V=h(Q.options.endDate)??h(Q.options["end-date"]);if(!J&&!I&&!G&&!H&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=h(Q.options.sourceCorp)??h(Q.options["source-corp"])??h(Q.options.prodCorp)??h(Q.options["prod-corp"]),M=h(Q.options.targetCorp)??h(Q.options["target-corp"])??h(Q.options.testCorp)??h(Q.options["test-corp"]),w=Z0(Q.options.force)===!0,{sourceCorp:N,targetCorp:O}=mB({sourceCorpId:F,targetCorpId:M,activeCorp:U,force:w},j1),D=N.id===U.id?z:await P1(N),P=O.id===U.id?z:await P1(O),T=h(Q.options.webhook)??h(Q.options.selector),A=h(Q.options.snSuffix)??h(Q.options["sn-suffix"]),j=h(Q.options.snPrefix)??h(Q.options["sn-prefix"]),C=h(Q.options.docIdSuffix)??h(Q.options["doc-id-suffix"]),b=h(Q.options.docIdPrefix)??h(Q.options["doc-id-prefix"]),x=Z0(Q.options.dryRun)??Z0(Q.options["dry-run"]),i=await $I({query:{recordId:J,recordIds:I,sn:G,sns:H,limit:X,status:Z,startDate:q,endDate:V},sourceClient:D,targetClient:P,sourceCorp:N,targetCorp:O,webhookSelector:T,snPrefix:j,snSuffix:A,docIdPrefix:b,docIdSuffix:C,dr
Line truncated
|
||||
`}function Dq($){return $.replace(/([?&](?:accessToken|token|returnToken)=)[^&\s]+/gi,"$1<redacted>").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]+/gi,"$1<redacted>")}function f0($,Y={}){hS1($,Y);let z=`${JSON.stringify($,null,2)}
|
||||
`;if(Y.outputFile){CS1(Y.outputFile,z),console.log(JSON.stringify({outputFile:Y.outputFile,bytes:Buffer.byteLength(z,"utf-8")},null,2));return}console.log(z.trimEnd())}function hS1($,Y={}){if(Y.allowFull||Y.outputFile)return;let z=Buffer.byteLength(JSON.stringify($),"utf-8");if(z>vS1)throw new mB(`Output is large (${z} bytes). Use --summary, --fields, --count, or --output-file; pass --full only when you really need the full response.`)}function h_0($,Y){if(Y)return;let z=$&&typeof $==="object"?$:{},U=typeof z.count==="number"?z.count:void 0,Q=Array.isArray(z.rules)?z.rules.length:void 0,J=Buffer.byteLength(JSON.stringify($),"utf-8"),K=U??Q??0;if(K>RS1||J>_S1)throw new mB(`Rule list is large (${K} rules, ${J} bytes). Use "seal-use rules list --summary", "seal-use rules count", or --output-file; pass --full only when you really need full descriptions.`,"seal-use rules list --summary")}function C0($){return{allowFull:Z0($.full)===!0,outputFile:h($.outputFile)??h($["output-file"])}}function S_0($=[]){console.log(__0($))}var RS1=100,_S1=120000,v_0,vS1=200000;var I4=m(()=>{D4();F$();Sl();v_0=["code","status","strictness","scope","updatedAt"]});var yl={};N8(yl,{selectCorp:()=>j1,runToolResult:()=>T5,runTool:()=>k0,globalConfigSummary:()=>t2});function j1($){let Y=s8(),z=_4(),U=n2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$},g3());return TA0(U.id),U}function t2($=_4()){return{mode:$.stateful?"stateful":"stateless",stateful:$.stateful,...$.stateful&&$.defaultCorpId?{defaultCorpId:$.defaultCorpId}:{},...$.testEnterprisesDir?{testEnterprisesDir:$.testEnterprisesDir}:{},lint:$.lint,configFile:ZU()}}async function k0($,Y,z,U,Q={}){f0(await T5($,Y,z,U),Q)}async function T5($,Y,z,U){let Q=Fq.find((I)=>I.name===$);if(!Q)throw Error(`Unknown Seal tool: ${$}`);let J=Object.fromEntries(Object.entries(U).filter(([,I])=>I!==void 0)),K=Q.handler;return K(Y,J,{corp:z})}var f4=m(()=>{k3();nB();wq();I4()});import{existsSync as g_0}from"node:fs";async function y_0($,Y){if(!g_0($))throw Error(`File not found: ${$}`);let z=kU($);console.log(JSON.stringify(await yU(z.fileBuffer,z.fileName,Y),null,2))}async function DT($,Y,z,U,Q){if($==="ready"||$==="status"){let J=Y??h(Q.options.file)??h(Q.options.input),K=await KT(z,U,{filePath:J,webhook:h(Q.options.webhook)??h(Q.options.selector)});if(console.error(`[webhook-ready] 企业环境: ${K.corp.name} (${K.corp.id}) [${K.stateMode}]`),K.corp.tenant?.name)console.error(`[webhook-ready] 租户信息: ${K.corp.tenant.name} (${K.corp.tenant.id})`);console.error(`[webhook-ready] 凭证状态: ${K.authStatus==="ok"?"OK":`异常 (${K.authError})`}`),console.error(`[webhook-ready] Webhook 通道: ${K.activeWebhooks.length} 个可用`);for(let I of K.activeWebhooks){let G=I.isDefault?" [默认通道]":"";console.error(` - ${I.name} (${I.id}) mode=${I.mode}${G}`)}if(K.materialPack)console.error(`[webhook-ready] 材料包预检: ${K.materialPack.valid?`通过 (${K.materialPack.documentCount} 单)`:`失败 (${K.materialPack.errors?.join("; ")})`}`);if(K.ready)console.error(`\uD83D\uDFE2 ${K.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${K.nextAction}`);else console.error(`\uD83D\uDD34 准备阶段未通过: ${K.statusMessage}`),console.error(`\uD83D\uDC49 Next action: ${K.nextAction}`);console.log(JSON.stringify(K,null,2));return}if($==="replay"){let J=Y??h(Q.options.recordId)??h(Q.options["record-id"])??h(Q.options.id),K=h(Q.options.recordIds)??h(Q.options["record-ids"]),I=K?K.split(",").map((c)=>c.trim()).filter(Boolean):void 0,G=h(Q.options.sn)??h(Q.options.documentSn)??h(Q.options["document-sn"]),W=h(Q.options.sns)??h(Q.options["document-sns"]),H=W?W.split(",").map((c)=>c.trim()).filter(Boolean):void 0,X=s0(Q.options.limit),Z=h(Q.options.status),q=h(Q.options.startDate)??h(Q.options["start-date"]),V=h(Q.options.endDate)??h(Q.options["end-date"]);if(!J&&!I&&!G&&!H&&X===void 0)throw Error("Usage: seal-use webhook replay <recordId> [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--dry-run]");let F=h(Q.options.sourceCorp)??h(Q.options["source-corp"])??h(Q.options.prodCorp)??h(Q.options["prod-corp"]),w=h(Q.options.targetCorp)??h(Q.options["target-corp"])??h(Q.options.testCorp)??h(Q.options["test-corp"]),M=Z0(Q.options.force)===!0,{sourceCorp:O,targetCorp:N}=lB({sourceCorpId:F,targetCorpId:w,activeCorp:U,force:M},j1),D=O.id===U.id?z:await P1(O),P=N.id===U.id?z:await P1(N),T=h(Q.options.webhook)??h(Q.options.selector),A=h(Q.options.snSuffix)??h(Q.options["sn-suffix"]),j=h(Q.options.snPrefix)??h(Q.options["sn-prefix"]),C=h(Q.options.docIdSuffix)??h(Q.options["doc-id-suffix"]),b=h(Q.options.docIdPrefix)??h(Q.options["doc-id-prefix"]),x=Z0(Q.options.dryRun)??Z0(Q.options["dry-run"]),i=await YI({query:{recordId:J,recordIds:I,sn:G,sns:H,limit:X,status:Z,startDate:q,endDate:V},sourceClient:D,targetClient:P,sourceCorp:O,targetCorp:N,webhookSelector:T,snPrefix:j,snSuffix:A,docIdPrefix:b,docIdSuffix:C,dr
Line truncated
|
||||
`+`\uD83D\uDC49 查看全部请添加: seal-use corps list --all
|
||||
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}f0(w.map((N)=>({id:N.id,name:N.name,environment:N.environment??"production",sourceType:N.source.type,provider:N.source.provider??N.source.type,staffId:N.source.staffId,testCorpId:N.testCorpId,prodCorpId:N.prodCorpId,current:N.id===W})));return}if($==="get"||$==="show"){let U=Y??h(z.options.corp);if(!U)throw m4("Usage: seal-use corps get <corpId>");let Q=j1(U),J=Kp(Q.id),K=lS1(Q);f0({id:Q.id,name:Q.name,environment:Q.environment??"production",configFile:J,seal:{url:K,tenantSlug:Q.seal.tenantSlug??Q.source.tenantSlug,customHeaderNames:Q.seal.headers?Object.keys(Q.seal.headers):[],customCookieNames:Q.seal.cookies?Object.keys(Q.seal.cookies):[],endpoints:Q.seal.endpoints},source:oS1(Q.source),relations:{testCorpId:Q.testCorpId,prodCorpId:Q.prodCorpId},auth:{refreshTtl:Q.auth.refreshTtl}});return}if($==="current"){let U=j1(h(z.options.corp));f0({id:U.id,name:U.name,environment:U.environment??"production",sourceType:U.source.type,provider:U.source.provider??U.source.type,staffId:U.source.staffId,testCorpId:U.testCorpId,prodCorpId:U.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let U=Y??h(z.options.corp);if(!U)throw m4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let Q=j1(U),J=$==="mark-test"?"test":$==="mark-prod"?"production":h(z.options.env)??h(z.options.environment);if(J!=="production"&&J!=="test")throw m4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(Z0(z.options.confirm)===!0||Z0(z.options.yes)===!0))throw P9(`Refusing to change environment tag of enterprise '${Q.name}' (${Q.id}) to '${J}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${Q.id} --env ${J} --confirm`);let I=y3(Q.id,{environment:J});f0({id:I.id,name:I.name,environment:I.environment,testCorpId:I.testCorpId,prodCorpId:I.prodCorpId});return}if($==="rename"){let U=Y??h(z.options.corp)??h(z.options.id),Q=h(z.options.name)??h(z.options.to)??(z.command[3]&&!z.command[3].startsWith("-")?z.command[3]:void 0);if(!U||!Q)throw Error("Usage: seal-use corps rename <corpId> --name <newName>");let J=j1(U),K=y3(J.id,{name:Q});f0({success:!0,id:K.id,name:K.name,previousName:J.name});return}if($==="bind-test"){let U,Q;if(Y&&z.command[3])U=Y,Q=z.command[3];else if(Y){let X=h(z.options.corp),Z=h(z.options["test-corp"])??h(z.options.testCorp);if(X)U=X,Q=Y;else if(Z)U=Y,Q=Z}if(!U||!Q)throw m4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
|
||||
`+"\uD83D\uDC49 检索指定企业请使用: seal-use corps search <keyword>")}f0(M.map((O)=>({id:O.id,name:O.name,environment:O.environment??"production",sourceType:O.source.type,provider:O.source.provider??O.source.type,staffId:O.source.staffId,testCorpId:O.testCorpId,prodCorpId:O.prodCorpId,current:O.id===W})));return}if($==="get"||$==="show"){let U=Y??h(z.options.corp);if(!U)throw m4("Usage: seal-use corps get <corpId>");let Q=j1(U),J=Ip(Q.id),K=Ig1(Q);f0({id:Q.id,name:Q.name,environment:Q.environment??"production",configFile:J,seal:{url:K,tenantSlug:Q.seal.tenantSlug??Q.source.tenantSlug,customHeaderNames:Q.seal.headers?Object.keys(Q.seal.headers):[],customCookieNames:Q.seal.cookies?Object.keys(Q.seal.cookies):[],endpoints:Q.seal.endpoints},source:Gg1(Q.source),relations:{testCorpId:Q.testCorpId,prodCorpId:Q.prodCorpId},auth:{refreshTtl:Q.auth.refreshTtl}});return}if($==="current"){let U=j1(h(z.options.corp));f0({id:U.id,name:U.name,environment:U.environment??"production",sourceType:U.source.type,provider:U.source.provider??U.source.type,staffId:U.source.staffId,testCorpId:U.testCorpId,prodCorpId:U.prodCorpId});return}if($==="mark"||$==="mark-test"||$==="mark-prod"){let U=Y??h(z.options.corp);if(!U)throw m4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");let Q=j1(U),J=$==="mark-test"?"test":$==="mark-prod"?"production":h(z.options.env)??h(z.options.environment);if(J!=="production"&&J!=="test")throw m4("Usage: seal-use corps mark <corpId> --env <production|test> [--confirm]");if(!(Z0(z.options.confirm)===!0||Z0(z.options.yes)===!0))throw P9(`Refusing to change environment tag of enterprise '${Q.name}' (${Q.id}) to '${J}' without --confirm. Marking alters synchronization safety guards.`,`seal-use corps mark ${Q.id} --env ${J} --confirm`);let I=y3(Q.id,{environment:J});f0({id:I.id,name:I.name,environment:I.environment,testCorpId:I.testCorpId,prodCorpId:I.prodCorpId});return}if($==="rename"){let U=Y??h(z.options.corp)??h(z.options.id),Q=h(z.options.name)??h(z.options.to)??(z.command[3]&&!z.command[3].startsWith("-")?z.command[3]:void 0);if(!U||!Q)throw Error("Usage: seal-use corps rename <corpId> --name <newName>");let J=j1(U),K=y3(J.id,{name:Q});f0({success:!0,id:K.id,name:K.name,previousName:J.name});return}if($==="bind-test"){let U,Q;if(Y&&z.command[3])U=Y,Q=z.command[3];else if(Y){let X=h(z.options.corp),Z=h(z.options["test-corp"])??h(z.options.testCorp);if(X)U=X,Q=Y;else if(Z)U=Y,Q=Z}if(!U||!Q)throw m4(`Usage: seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
|
||||
or: seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]`);let J=j1(U),K=j1(Q);if(J.id===K.id)throw m4(`Cannot bind enterprise '${J.id}' to itself.`);if(J.prodCorpId&&J.prodCorpId!==K.id)throw m4(`Cannot use '${J.id}' as a production enterprise because it is already registered as a test enterprise for '${J.prodCorpId}'. Multi-tier chaining is not permitted.`);if(K.testCorpId&&K.testCorpId!==J.id)throw m4(`Cannot bind '${K.id}' as a test enterprise because it already has a bound test enterprise '${K.testCorpId}'. Multi-tier chaining is not permitted.`);let I=Z0(z.options.force)===!0;if(J.testCorpId&&J.testCorpId!==K.id||K.prodCorpId&&K.prodCorpId!==J.id){if(!I)throw P9(`Enterprise binding conflict: production enterprise '${J.id}' is bound to '${J.testCorpId??"none"}', and test enterprise '${K.id}' is bound to '${K.prodCorpId??"none"}'. Overwriting an existing binding requires --force and --confirm.`,`seal-use corps bind-test ${J.id} ${K.id} --confirm --force`)}if(!(Z0(z.options.confirm)===!0||Z0(z.options.yes)===!0)){let X=I?" --force":"";throw P9(`Refusing to bind test enterprise '${K.name}' (${K.id}) to production enterprise '${J.name}' (${J.id}) without --confirm. Enterprise binding establishes 1-to-1 sync pairing and marks '${K.id}' as a test environment.`,`seal-use corps bind-test ${J.id} ${K.id} --confirm${X}`)}if(J.testCorpId&&J.testCorpId!==K.id)try{y3(J.testCorpId,{prodCorpId:void 0})}catch{}if(K.prodCorpId&&K.prodCorpId!==J.id)try{y3(K.prodCorpId,{testCorpId:void 0})}catch{}let W=y3(J.id,{environment:"production",testCorpId:K.id}),H=y3(K.id,{environment:"test",prodCorpId:J.id});f0({success:!0,productionEnterprise:{id:W.id,name:W.name,environment:W.environment,testCorpId:W.testCorpId},testEnterprise:{id:H.id,name:H.name,environment:H.environment,prodCorpId:H.prodCorpId}});return}if($==="unbind-test"){let U=Y??h(z.options.corp),Q=j1(U);if(!Q.testCorpId&&!Q.prodCorpId){f0({unbound:!1,message:`Enterprise '${Q.name}' (${Q.id}) does not have an active test enterprise binding.`});return}let J=Q.testCorpId?Q.id:Q.prodCorpId,K=Q.testCorpId?Q.testCorpId:Q.id;if(!(Z0(z.options.confirm)===!0||Z0(z.options.yes)===!0))throw P9(`Refusing to unbind production enterprise '${J}' and test enterprise '${K}' without --confirm.`,`seal-use corps unbind-test ${Q.id} --confirm`);y3(J,{testCorpId:void 0});try{y3(K,{prodCorpId:void 0})}catch{}f0({success:!0,unboundProduction:J,unboundTest:K});return}if($==="sync-test"){let U=Y??h(z.options.corp),Q=j1(U);if(!Q.testCorpId)throw m4(`Production enterprise '${Q.name}' (${Q.id}) has no bound test enterprise.
|
||||
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let J=j1(Q.testCorpId);if(J.environment!=="test")throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let K=await P1(Q),I=await P1(J),[G,W,H,X,Z,q,V,F]=await Promise.all([o1(K,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(I,J.seal.endpoints.approvalStylePreferences).catch(()=>({})),p6(K),p6(I),P$(K).catch(()=>[]),P$(I).catch(()=>[]),y7(K,{limit:100}).catch(()=>({articles:[]})),y7(I,{limit:100}).catch(()=>({articles:[]}))]),M=(V.articles||[]).filter((G0)=>!G0.isDeleted),w=(F.articles||[]).filter((G0)=>!G0.isDeleted),N=new Map(w.map((G0)=>[G0.title.trim(),G0])),O=[],D=[],P=new Set(M.map((G0)=>G0.title.trim()));for(let G0 of M){let T0=G0.title.trim(),i0=N.get(T0);if(!i0)O.push(G0);else{let Y1=i0.content!==G0.content,a=(i0.purpose??"")!==(G0.purpose??""),H0=i0.enabled!==G0.enabled,F0=i0.contentType!==G0.contentType,u0=(i0.status??"")!==(G0.status??""),b0=JSON.stringify([...i0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),c0=JSON.stringify([...i0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(Y1||a||H0||F0||u0||b0||c0)D.push({testId:i0.id,prodDoc:G0,reasons:[...Y1?["content"]:[],...a?["purpose"]:[],...H0?["enabled"]:[],...F0?["contentType"]:[],...u0?["status"]:[],...b0?["scenarios"]:[],...c0?["tags"]:[]]})}}let T=w.filter((G0)=>!P.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,x=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,S=av0(Q.name,C,q),c=h(z.options["version-name"])??h(z.options.versionName)??tv0(Q.name,C,S,x),U0={...W,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(Z0(z.options["dry-run"])===!0||Z0(z.options.dryRun)===!0){f0({dryRun:!0,source:{id:Q.id,name:Q.name,environment:Q.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:M.length},target:{id:J.id,name:J.name,environment:J.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:x,targetTestPublishVersionName:c,iteration:S},preferencesDiff:{decisionPreferences:{before:W.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:W.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:M.length,targetExistingDocumentCount:w.length,toCreateCount:O.length,toCreate:O.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:D.length,toUpdate:D.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:J.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(Q.source.type!=="hose")return{sourceType:Q.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((Y1)=>Y1.type==="hosecloud"),T0=new Set,i0=G0.filter((Y1)=>{let a=Y1.corporationId??Q.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:Qh0(Q.name),targetMode:"assisted",integrationsCount:i0.length,integrations:i0.map((Y1)=>({corporationId:Y1.corporationId,apiOrigin:Y1.apiOrigin,customApiUrl:Y1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(Z0(z.options.yes)===!0||Z0(z.options.confirm)===!0))throw P9(`Refusing to overwrite test enterprise '${J.name}' (${J.id}) with preferences, ${H.rules.length} draft rules, and ${M.length} knowledge documents from production enterprise '${Q.name}' (${Q.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${Q.id} --yes`);await r5(I,U0,J.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await FM(I,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of D)await LM(I,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled,
Line truncated
|
||||
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association.`);let J=j1(Q.testCorpId);if(J.environment!=="test")throw Error(`Target enterprise '${J.name}' (${J.id}) is marked as '${J.environment}', NOT 'test'. Aborting sync to protect non-test environments.`);let K=await P1(Q),I=await P1(J),[G,W,H,X,Z,q,V,F]=await Promise.all([o1(K,Q.seal.endpoints.approvalStylePreferences).catch(()=>({})),o1(I,J.seal.endpoints.approvalStylePreferences).catch(()=>({})),p6(K),p6(I),c8(K).catch(()=>[]),c8(I).catch(()=>[]),k7(K,{limit:100}).catch(()=>({articles:[]})),k7(I,{limit:100}).catch(()=>({articles:[]}))]),w=(V.articles||[]).filter((G0)=>!G0.isDeleted),M=(F.articles||[]).filter((G0)=>!G0.isDeleted),O=new Map(M.map((G0)=>[G0.title.trim(),G0])),N=[],D=[],P=new Set(w.map((G0)=>G0.title.trim()));for(let G0 of w){let T0=G0.title.trim(),i0=O.get(T0);if(!i0)N.push(G0);else{let Y1=i0.content!==G0.content,a=(i0.purpose??"")!==(G0.purpose??""),H0=i0.enabled!==G0.enabled,F0=i0.contentType!==G0.contentType,u0=(i0.status??"")!==(G0.status??""),b0=JSON.stringify([...i0.scenarios??[]].sort())!==JSON.stringify([...G0.scenarios??[]].sort()),c0=JSON.stringify([...i0.tags??[]].sort())!==JSON.stringify([...G0.tags??[]].sort());if(Y1||a||H0||F0||u0||b0||c0)D.push({testId:i0.id,prodDoc:G0,reasons:[...Y1?["content"]:[],...a?["purpose"]:[],...H0?["enabled"]:[],...F0?["contentType"]:[],...u0?["status"]:[],...b0?["scenarios"]:[],...c0?["tags"]:[]]})}}let T=M.filter((G0)=>!P.has(G0.title.trim())),j=[...Z].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0],C=j?.versionNumber,x=([...q].sort((G0,T0)=>T0.versionNumber-G0.versionNumber)[0]?.versionNumber??0)+1,S=Ih0(Q.name,C,q),c=h(z.options["version-name"])??h(z.options.versionName)??Gh0(Q.name,C,S,x),U0={...W,tone:G.tone,language:G.language,detailLevel:G.detailLevel,outputFormat:G.outputFormat,examples:G.examples??[],prohibitedPhrases:G.prohibitedPhrases??[],customInstructions:G.customInstructions,decisionPreferences:G.decisionPreferences,thinkingDepthPreference:G.thinkingDepthPreference};if(Z0(z.options["dry-run"])===!0||Z0(z.options.dryRun)===!0){f0({dryRun:!0,source:{id:Q.id,name:Q.name,environment:Q.environment,latestPublishedVersion:j?{versionNumber:j.versionNumber,versionName:j.versionName}:null,documentsCount:w.length},target:{id:J.id,name:J.name,environment:J.environment},versionMappingPlan:{sourceProdVersionNumber:C??null,sourceProdVersionName:j?.versionName??null,targetTestExpectedVersionNumber:x,targetTestPublishVersionName:c,iteration:S},preferencesDiff:{decisionPreferences:{before:W.decisionPreferences,after:G.decisionPreferences},thinkingDepthPreference:{before:W.thinkingDepthPreference,after:G.thinkingDepthPreference}},rulesPlan:{sourceDraftRuleCount:H.rules.length,targetExistingDraftRuleCount:X.rules.length,toDeleteCount:X.rules.length,toCreateCount:H.rules.length,rulesToSync:H.rules.map((G0,T0)=>({index:T0+1,sourceRuleId:G0.id,sourceRuleCode:G0.code??T0+1,expectedTargetCode:`rule-${T0+1}`,description:G0.description,scope:G0.scope,strictness:G0.strictness}))},documentsPlan:{sourceDocumentCount:w.length,targetExistingDocumentCount:M.length,toCreateCount:N.length,toCreate:N.map((G0)=>({title:G0.title,purpose:G0.purpose,contentType:G0.contentType,scenarios:G0.scenarios})),toUpdateCount:D.length,toUpdate:D.map((G0)=>({targetDocumentId:G0.testId,title:G0.prodDoc.title,reasons:G0.reasons})),toDeleteCount:T.length,toDelete:T.map((G0)=>({targetDocumentId:G0.id,title:G0.title}))},publishingPlan:{targetCorpId:J.id,publishVersionName:c,publishTarget:"test"},hosecloudSyncPlan:(()=>{if(Q.source.type!=="hose")return{sourceType:Q.source.type,skipped:!0,reason:"prod source is not hose; no hosecloud credentials available"};let G0=(G.integrations??[]).filter((Y1)=>Y1.type==="hosecloud"),T0=new Set,i0=G0.filter((Y1)=>{let a=Y1.corporationId??Q.id;if(T0.has(a))return!1;return T0.add(a),!0});return{sourceType:"hose",outboundName:Vh0(Q.name),targetMode:"assisted",integrationsCount:i0.length,integrations:i0.map((Y1)=>({corporationId:Y1.corporationId,apiOrigin:Y1.apiOrigin,customApiUrl:Y1.customApiUrl}))}})(),productionGuarantees:{prodRulesStayDraft:!0,prodVersionPublished:!1}});return}if(!(Z0(z.options.yes)===!0||Z0(z.options.confirm)===!0))throw P9(`Refusing to overwrite test enterprise '${J.name}' (${J.id}) with preferences, ${H.rules.length} draft rules, and ${w.length} knowledge documents from production enterprise '${Q.name}' (${Q.id}) without --yes. This will replace test draft rules, synchronize knowledge documents, and publish a new version on the test enterprise.`,`seal-use corps sync-test ${Q.id} --yes`);await r5(I,U0,J.seal.endpoints.approvalStylePreferences);let t=[];for(let G0 of T)await Mw(I,G0.id),t.push({id:G0.id,title:G0.title});let $0=[];for(let G0 of D)await Fw(I,G0.testId,{title:G0.prodDoc.title,purpose:G0.prodDoc.purpose,content:G0.prodDoc.content,contentType:G0.prodDoc.contentType,status:G0.prodDoc.status,enabled:G0.prodDoc.enabled,
Line truncated
|
||||
Run 'seal-use corps bind-test ${Q.id} <testCorpId> --confirm' first to establish a verified 1-to-1 association,
|
||||
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);K=Q}else if(K=j1(Q.testCorpId),K.environment!=="test"&&!J)throw Error(`Target enterprise '${K.name}' (${K.id}) is marked as '${K.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let I=h(z.options.recordId)??h(z.options["record-id"])??h(z.options.id),G=h(z.options.recordIds)??h(z.options["record-ids"]),W=G?G.split(",").map((x)=>x.trim()).filter(Boolean):void 0,H=h(z.options.sn)??h(z.options.documentSn)??h(z.options["document-sn"]),X=h(z.options.sns)??h(z.options["document-sns"]),Z=X?X.split(",").map((x)=>x.trim()).filter(Boolean):void 0,q=s0(z.options.limit)??(!I&&!W&&!H&&!Z?1:void 0),V=h(z.options.status),F=h(z.options.startDate)??h(z.options["start-date"]),M=h(z.options.endDate)??h(z.options["end-date"]),w=await P1(Q),N=Q.id===K.id?w:await P1(K),O=h(z.options.webhook)??h(z.options.selector),D=h(z.options.snSuffix)??h(z.options["sn-suffix"]),P=h(z.options.snPrefix)??h(z.options["sn-prefix"]),T=h(z.options.docIdSuffix)??h(z.options["doc-id-suffix"]),A=h(z.options.docIdPrefix)??h(z.options["doc-id-prefix"]),j=Z0(z.options.dryRun)??Z0(z.options["dry-run"]),C={recordId:I,recordIds:W,sn:H,sns:Z,limit:q,status:V,startDate:F,endDate:M};console.error(`[corps-replay-test] 正式企业「${Q.name}」(${Q.id}) -> 测试企业「${K.name}」(${K.id})`);let b=await $I({query:C,sourceClient:w,targetClient:N,sourceCorp:Q,targetCorp:K,webhookSelector:O,snPrefix:P,snSuffix:D,docIdPrefix:A,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${Q.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${K.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${Q.name}」)至「${K.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${K.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${K.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let U=Y;if(!U)throw Error("Usage: seal-use corps switch <corpId>");let Q=_4();if(!Q.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let J=j1(U);ZU({...Q,stateful:!0,defaultCorpId:J.id}),f0({current:!0,id:J.id,name:J.name});return}if($==="probe-hose"){await aS1(y8(z.json));return}if($==="hose-staffs"){await tS1(y8(z.json));return}if($==="add-hose"){let Q={...y8(z.json),...z.options.staffName?{staffName:h(z.options.staffName)}:{},...z.options["staff-name"]?{staffName:h(z.options["staff-name"])}:{},...z.options.staffPhone?{staffPhone:h(z.options.staffPhone)}:{},...z.options["staff-phone"]?{staffPhone:h(z.options["staff-phone"])}:{},...z.options.name?{name:h(z.options.name)}:{},...z.options.domain?{domain:h(z.options.domain)}:{},...z.options.corpId?{corpId:h(z.options.corpId)}:{},...z.options["corp-id"]?{corpId:h(z.options["corp-id"])}:{},...z.options.appKey?{appKey:h(z.options.appKey)}:{},...z.options["app-key"]?{appKey:h(z.options["app-key"])}:{},...z.options.appSecurity?{appSecurity:h(z.options.appSecurity)}:{},...z.options["app-security"]?{appSecurity:h(z.options["app-security"])}:{},...z.options.force!==void 0?{force:Z0(z.options.force)}:{},...z.options.overwrite!==void 0?{overwrite:Z0(z.options.overwrite)}:{}};await ol(Q);return}if($==="add-seal"){let Q={...y8(z.json),...z.options.name?{name:h(z.options.name)}:{},...z.options.token?{token:h(z.options.token)}:{},...z.options.sealUrl?{sealUrl:h(z.options.sealUrl)}:{},...z.options.url?{sealUrl:h(z.options.url)}:{},...z.options.force!==void 0?{force:Z0(z.options.force)}:{},...z.options.overwrite!==void 0?{overwrite:Z0(z.options.overwrite)}:{}};await eS1(Q);return}if($==="add-link"){let U=Y??h(z.options.link)??h(z.options.url);if(!U)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(Z0(z.options["as-hose"])===!0||Z0(z.options.hose)===!0){await Yg1(U,h(z.options.name),Z0(z.options.overwrite)===!0,Z0(z.options.force)===!0,{appKey:h(z.options["app-key"])??h(z.options.appKey),keyId:h(z.options["key-id"])??h(z.options.keyId)});return}await $g1(U,h(z.options.name),Z0(z.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let U=Y??h(z.options.link)??h(z.options.url);if(!U)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-i
Line truncated
|
||||
or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you explicitly intend to replay directly within production.`);K=Q}else if(K=j1(Q.testCorpId),K.environment!=="test"&&!J)throw Error(`Target enterprise '${K.name}' (${K.id}) is marked as '${K.environment}', NOT 'test'. Aborting replay to protect non-test environments (use --force to override).`);let I=h(z.options.recordId)??h(z.options["record-id"])??h(z.options.id),G=h(z.options.recordIds)??h(z.options["record-ids"]),W=G?G.split(",").map((x)=>x.trim()).filter(Boolean):void 0,H=h(z.options.sn)??h(z.options.documentSn)??h(z.options["document-sn"]),X=h(z.options.sns)??h(z.options["document-sns"]),Z=X?X.split(",").map((x)=>x.trim()).filter(Boolean):void 0,q=s0(z.options.limit)??(!I&&!W&&!H&&!Z?1:void 0),V=h(z.options.status),F=h(z.options.startDate)??h(z.options["start-date"]),w=h(z.options.endDate)??h(z.options["end-date"]),M=await P1(Q),O=Q.id===K.id?M:await P1(K),N=h(z.options.webhook)??h(z.options.selector),D=h(z.options.snSuffix)??h(z.options["sn-suffix"]),P=h(z.options.snPrefix)??h(z.options["sn-prefix"]),T=h(z.options.docIdSuffix)??h(z.options["doc-id-suffix"]),A=h(z.options.docIdPrefix)??h(z.options["doc-id-prefix"]),j=Z0(z.options.dryRun)??Z0(z.options["dry-run"]),C={recordId:I,recordIds:W,sn:H,sns:Z,limit:q,status:V,startDate:F,endDate:w};console.error(`[corps-replay-test] 正式企业「${Q.name}」(${Q.id}) -> 测试企业「${K.name}」(${K.id})`);let b=await YI({query:C,sourceClient:M,targetClient:O,sourceCorp:Q,targetCorp:K,webhookSelector:N,snPrefix:P,snSuffix:D,docIdPrefix:A,docIdSuffix:T,dryRun:j});if(j){console.error(`[corps-replay-test] 预览模式:已成功从 ${Q.name} 提取单据并转换为 Webhook Payload(未实际推送)。`),console.log(JSON.stringify(b,null,2));return}if(b.success)if(b.totalCount===1&&b.replayedDocument)console.error(`\uD83D\uDFE2 成功重放单据「${b.replayedDocument.documentSN}」至 ${K.name} (${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDFE2 成功重放 ${b.successCount} 条单据(来自「${Q.name}」)至「${K.name}」(${b.targetWebhook?.name??"Webhook 通道"})`);else console.error(`\uD83D\uDD34 单据重放部分或全部失败(成功 ${b.successCount} 条,失败 ${b.failureCount} 条)至「${K.name}」`);if(console.error(`\uD83D\uDC49 Next action: seal-use approval-runs list --corp ${K.id} --limit ${b.totalCount}`),console.log(JSON.stringify(b,null,2)),!b.success)process.exitCode=1;return}if($==="switch"){let U=Y;if(!U)throw Error("Usage: seal-use corps switch <corpId>");let Q=_4();if(!Q.stateful)throw Error("Cannot switch the default enterprise while stateless mode is enabled. Use `seal-use config mode stateful` first.");let J=j1(U);qU({...Q,stateful:!0,defaultCorpId:J.id}),f0({current:!0,id:J.id,name:J.name});return}if($==="probe-hose"){await Xg1(y8(z.json));return}if($==="hose-staffs"){await Zg1(y8(z.json));return}if($==="add-hose"){let Q={...y8(z.json),...z.options.staffName?{staffName:h(z.options.staffName)}:{},...z.options["staff-name"]?{staffName:h(z.options["staff-name"])}:{},...z.options.staffPhone?{staffPhone:h(z.options.staffPhone)}:{},...z.options["staff-phone"]?{staffPhone:h(z.options["staff-phone"])}:{},...z.options.name?{name:h(z.options.name)}:{},...z.options.domain?{domain:h(z.options.domain)}:{},...z.options.corpId?{corpId:h(z.options.corpId)}:{},...z.options["corp-id"]?{corpId:h(z.options["corp-id"])}:{},...z.options.appKey?{appKey:h(z.options.appKey)}:{},...z.options["app-key"]?{appKey:h(z.options["app-key"])}:{},...z.options.appSecurity?{appSecurity:h(z.options.appSecurity)}:{},...z.options["app-security"]?{appSecurity:h(z.options["app-security"])}:{},...z.options.force!==void 0?{force:Z0(z.options.force)}:{},...z.options.overwrite!==void 0?{overwrite:Z0(z.options.overwrite)}:{}};await al(Q);return}if($==="add-seal"){let Q={...y8(z.json),...z.options.name?{name:h(z.options.name)}:{},...z.options.token?{token:h(z.options.token)}:{},...z.options.sealUrl?{sealUrl:h(z.options.sealUrl)}:{},...z.options.url?{sealUrl:h(z.options.url)}:{},...z.options.force!==void 0?{force:Z0(z.options.force)}:{},...z.options.overwrite!==void 0?{overwrite:Z0(z.options.overwrite)}:{}};await qg1(Q);return}if($==="add-link"){let U=Y??h(z.options.link)??h(z.options.url);if(!U)throw Error("Usage: seal-use corps add-link <https://.../web/thirdparty.html?...> [--name <customName>] [--as-hose] [--overwrite]");if(Z0(z.options["as-hose"])===!0||Z0(z.options.hose)===!0){await Lg1(U,h(z.options.name),Z0(z.options.overwrite)===!0,Z0(z.options.force)===!0,{appKey:h(z.options["app-key"])??h(z.options.appKey),keyId:h(z.options["key-id"])??h(z.options.keyId)});return}await Vg1(U,h(z.options.name),Z0(z.options.overwrite)===!0);return}if($==="extract-keys"||$==="extract-key"){let U=Y??h(z.options.link)??h(z.options.url);if(!U)throw Error("Usage: seal-use corps extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--app-key <key>] [--key-i
Line truncated
|
||||
`);throw Error(`Missing required parameter: staffId. 当前企业共配置了 ${C.length} 位管理员账号(手机号已脱敏):
|
||||
|
||||
`+`${b}
|
||||
@@ -924,19 +928,19 @@ or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you ex
|
||||
`+`\uD83D\uDC49 请指定要作为审计身份绑定的管理员:
|
||||
`+` • 按姓名选择:追加 --staffName <姓名>(支持关键字,如: --staffName 谢子豪)
|
||||
`+` • 按手机选择:追加 --staffPhone <手机号>(支持手机后4位,如: --staffPhone 5678)
|
||||
`+" • 或传 force:true / --force 自动使用默认首位管理员。")}}}if(!F)if(!H&&J)F=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let M=X4($,"id")??Z,w=Y??q??Z,N=X4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,O={id:M,name:w,environment:"production",seal:{url:N,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:z,appSecurity:U,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(H){tw(M);let T=await uI(O);if((!Y||Y===Z)&&T.tenantName&&T.tenantName!==Z)w=T.tenantName,O.name=T.tenantName}let D=Jp();$h0(D,{recursive:!0,mode:448});let P=zh0(D,`${FT(M)}.json`);if(ev0(P)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${P}。如需覆盖已有配置,请在命令行追加 --overwrite 或在 JSON 参数中添加 "overwrite": true。`);Yh0(P,`${JSON.stringify(O,null,2)}
|
||||
`,{mode:384}),f0({id:M,name:w,corpId:Z,domain:X,staffId:F,verified:H,path:P})}async function eS1($){let Y=l3($,"token"),z=(X4($,"sealUrl")??X4($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let U=Pl($,"expiresIn")??2592000,Q=$.force===!0||$.verify===!1?!1:!0,J=Jh0($),K=Q?await zg1(z,Y,D6(J)):void 0;Ih0($,{token:Y,sealUrl:z,expiresIn:U,verify:Q,remote:K,custom:J})}function Jh0($){return{headers:$p.parse($.headers),cookies:Yp.parse($.cookies)}}async function $g1($,Y,z){let U=await ew($),Q=b8(U.sealUrl,U.token),J=await T8(Q),K={user:J.user,tenant:J.tenant};$M(U.corpId,K.tenant),Ih0({id:U.corpId,corpId:U.corpId,name:Y,provider:"hosecloud",overwrite:z},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:K})}function Kh0($,Y,z,U){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${Y}] 的 OpenAPI 密钥凭据。
|
||||
`+" • 或传 force:true / --force 自动使用默认首位管理员。")}}}if(!F)if(!H&&J)F=J;else throw Error("Missing required parameter: staffId (or proxyStaffBizId). Run 'seal-use corps hose-staffs' to discover available administrators.");let w=X4($,"id")??Z,M=Y??q??Z,O=X4($,"sealUrl")??`https://${Z.toLowerCase()}.sealai.cc`,N={id:w,name:M,environment:"production",seal:{url:O,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"hose",domain:X,appKey:z,appSecurity:U,corpId:Z,staffId:F},auth:{refreshTtl:300}};if(H){eM(w);let T=await bI(N);if((!Y||Y===Z)&&T.tenantName&&T.tenantName!==Z)M=T.tenantName,N.name=T.tenantName}let D=Kp();Hh0(D,{recursive:!0,mode:448});let P=Zh0(D,`${MT(w)}.json`);if(Wh0(P)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${P}。如需覆盖已有配置,请在命令行追加 --overwrite 或在 JSON 参数中添加 "overwrite": true。`);Xh0(P,`${JSON.stringify(N,null,2)}
|
||||
`,{mode:384}),f0({id:w,name:M,corpId:Z,domain:X,staffId:F,verified:H,path:P})}async function qg1($){let Y=l3($,"token"),z=(X4($,"sealUrl")??X4($,"url")??"").replace(/\/+$/,"");if(!z)throw Error("Missing required JSON field: sealUrl");let U=El($,"expiresIn")??2592000,Q=$.force===!0||$.verify===!1?!1:!0,J=Lh0($),K=Q?await Fg1(z,Y,D6(J)):void 0;Mh0($,{token:Y,sealUrl:z,expiresIn:U,verify:Q,remote:K,custom:J})}function Lh0($){return{headers:Yp.parse($.headers),cookies:zp.parse($.cookies)}}async function Vg1($,Y,z){let U=await $w($),Q=b8(U.sealUrl,U.token),J=await T8(Q),K={user:J.user,tenant:J.tenant};Yw(U.corpId,K.tenant),Mh0({id:U.corpId,corpId:U.corpId,name:Y,provider:"hosecloud",overwrite:z},{token:U.token,sealUrl:U.sealUrl,expiresIn:U.expiresIn,verify:!0,remote:K})}function Fh0($,Y,z,U){if($.length===0)throw Error(`[合思子域提权] 未能从协助链接中提取到合思企业 [${Y}] 的 OpenAPI 密钥凭据。
|
||||
`+"\uD83D\uDCA1 说明:此能力专属于合思 (Hose) 子域,用于将临时会话提权为标准 OpenAPI 开发者接入。需要企业管理员已在合思开放平台创建应用并生成 appKey/appSecurity。");if(z.keyId||z.appKey){let Q=$.find((J)=>z.keyId&&J.id===z.keyId||z.appKey&&J.appKey===z.appKey);if(!Q){console.error(`
|
||||
❌ 未找到指定的合思 OpenAPI 密钥 (${z.appKey??z.keyId})。`),console.error(`ℹ️ 该合思企业当前存在以下 ${$.length} 套候选密钥:`);for(let J of $){let K=J.active?"\uD83D\uDFE2 启用":"⚪ 停用";console.error(` • "${J.name||"未命名应用"}" (appKey: ${J.appKey}, keyId: ${J.id}, 状态: ${K})`)}throw new w4("指定的合思密钥不存在,请从上述候选列表中选择正确的 appKey 或 keyId。",2,`${U} --app-key ${$[0].appKey}`)}return Q}if($.length===1)return $[0];console.error(`
|
||||
❌ 未找到指定的合思 OpenAPI 密钥 (${z.appKey??z.keyId})。`),console.error(`ℹ️ 该合思企业当前存在以下 ${$.length} 套候选密钥:`);for(let J of $){let K=J.active?"\uD83D\uDFE2 启用":"⚪ 停用";console.error(` • "${J.name||"未命名应用"}" (appKey: ${J.appKey}, keyId: ${J.id}, 状态: ${K})`)}throw new M4("指定的合思密钥不存在,请从上述候选列表中选择正确的 appKey 或 keyId。",2,`${U} --app-key ${$[0].appKey}`)}return Q}if($.length===1)return $[0];console.error(`
|
||||
ℹ️ [合思子域提权] 合思企业 [${Y}] 存在多套 (${$.length} 套) OpenAPI 应用密钥凭据:`);for(let Q=0;Q<$.length;Q++){let J=$[Q],K=J.active?"\uD83D\uDFE2 启用":"⚪ 停用",I=J.name||"未命名应用";console.error(` [${Q+1}] "${I}" (appKey: ${J.appKey}, keyId: ${J.id}, 状态: ${K})`)}throw console.error(`
|
||||
\uD83D\uDC49 为确保权限提权绑定正确的业务应用,请显式指定要使用的密钥套件:`),console.error(` 在命令后追加 --app-key <key> 或 --key-id <id> 参数。
|
||||
`),new w4(`合思企业 [${Y}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${U} --app-key ${$[0].appKey}`)}async function Yg1($,Y,z,U=!1,Q){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let J=await uS($),K=Kh0(J.keys,J.corpId,Q??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${K.appKey}, 应用: "${K.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await ol({domain:J.baseUrl,appKey:K.appKey,appSecurity:K.appSecurity,corpId:J.corpId,name:Y??J.corpName,staffId:J.staffId,overwrite:z,force:U})}async function _T($,Y){let z=await uS($),U=Y.reveal===!0;if(Y.save){let Q=Kh0(z.keys,z.corpId,{appKey:Y.appKey,keyId:Y.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${Q.appKey}, 应用: "${Q.name||"未命名应用"}") 保存为标准合思企业配置...`),await ol({domain:z.baseUrl,appKey:Q.appKey,appSecurity:Q.appSecurity,corpId:z.corpId,name:Y.name??z.corpName,staffId:z.staffId,overwrite:Y.overwrite,force:Y.force});return}if(!U)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
|
||||
`),new M4(`合思企业 [${Y}] 存在多套 OpenAPI 密钥,必须指定 --app-key 或 --key-id 明确选择要绑定的密钥。`,2,`${U} --app-key ${$[0].appKey}`)}async function Lg1($,Y,z,U=!1,Q){console.error("ℹ️ [合思子域提权] 正在通过合思协助链接提取 OpenAPI 开发者密钥并提升企业权限等级...");let J=await bS($),K=Fh0(J.keys,J.corpId,Q??{},'seal-use corps add-link "<url>" --as-hose');console.error(`ℹ️ [合思子域提权] 已选定合思 OpenAPI 凭据 (appKey: ${K.appKey}, 应用: "${K.name||"未命名应用"}"),正在初始化为长期合思标准配置...`),await al({domain:J.baseUrl,appKey:K.appKey,appSecurity:K.appSecurity,corpId:J.corpId,name:Y??J.corpName,staffId:J.staffId,overwrite:z,force:U})}async function vT($,Y){let z=await bS($),U=Y.reveal===!0;if(Y.save){let Q=Fh0(z.keys,z.corpId,{appKey:Y.appKey,keyId:Y.keyId},'seal-use corps extract-keys "<url>" --save');console.error(`ℹ️ [合思子域提权] 正在将选定的合思 OpenAPI 密钥 (appKey: ${Q.appKey}, 应用: "${Q.name||"未命名应用"}") 保存为标准合思企业配置...`),await al({domain:z.baseUrl,appKey:Q.appKey,appSecurity:Q.appSecurity,corpId:z.corpId,name:Y.name??z.corpName,staffId:z.staffId,overwrite:Y.overwrite,force:Y.force});return}if(!U)console.error(`ℹ️ [合思子域提权] 成功提取合思 (Hose) OpenAPI 密钥。接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文;附加 --save 可将临时会话提权并持久化为标准合思企业。
|
||||
`);else console.error(`⚠️ [合思子域提权] 正在以明文展示合思 (Hose) appSecurity 接入密码,请妥善保管敏感凭据。
|
||||
`);f0({provider:"hose",capability:"privilege-elevation",corpId:z.corpId,corpName:z.corpName??z.corpId,baseUrl:z.baseUrl,staffId:z.staffId,keyCount:z.keys.length,keys:z.keys.map((Q)=>({id:Q.id,name:Q.name||"-",appKey:Q.appKey,appSecurity:U?Q.appSecurity:fS(Q.appSecurity),active:Q.active,createTime:Q.createTime,updateTime:Q.updateTime}))})}async function rl($,Y){let z=j1($),U=Y.reveal===!0;if(z.source.type!=="hose")throw new w4(`【合思子域专享能力】当前企业「${z.name}」(id: ${z.id}) 为原生 Seal (${z.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。
|
||||
`);f0({provider:"hose",capability:"privilege-elevation",corpId:z.corpId,corpName:z.corpName??z.corpId,baseUrl:z.baseUrl,staffId:z.staffId,keyCount:z.keys.length,keys:z.keys.map((Q)=>({id:Q.id,name:Q.name||"-",appKey:Q.appKey,appSecurity:U?Q.appSecurity:uS(Q.appSecurity),active:Q.active,createTime:Q.createTime,updateTime:Q.updateTime}))})}async function tl($,Y){let z=j1($),U=Y.reveal===!0;if(z.source.type!=="hose")throw new M4(`【合思子域专享能力】当前企业「${z.name}」(id: ${z.id}) 为原生 Seal (${z.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。
|
||||
`+"OpenAPI 密钥查询与提权能力专属于合思生态租户(用于从合思协助链接或合思凭据中提取开发者密钥提升权限等级),非合思渠道企业不支持此能力。",2);let Q=z.source.appKey??z.source.key,J=z.source.appSecurity??z.source.password;if(!U)console.error(`\uD83D\uDCA1 [合思子域] 接入密码默认脱敏,附加 --reveal (或 -r) 可查看完整 appSecurity 明文。
|
||||
`);else console.error(`⚠️ [合思子域] 正在以明文展示合思 appSecurity 接入密码,请妥善保管敏感凭据。
|
||||
`);f0({provider:"hose",capability:"privilege-elevation",corpId:z.id,corpName:z.name,domain:z.source.domain,staffId:z.source.staffId,appKey:Q??"-",appSecurity:J?U?J:fS(J):"-",active:!0})}function Ih0($,Y){let{token:z,sealUrl:U,expiresIn:Q,verify:J,remote:K}=Y,I=Y.custom??Jh0($),G=K?.user,W=K?.tenant,H=X4($,"tenantSlug")??e2(W?.tenantSlug),X=X4($,"tenantId")??e2(W?.id),Z=X4($,"tenantName")??e2(W?.name),q=X4($,"id")??H??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=X4($,"staffId")??e2(G?.providerUserId)??e2(G?.id)??"seal",F=X4($,"provider")??e2(G?.provider)??e2(W?.providerConfig?.provider),M=X4($,"corpId")??H??X??q,w={id:q,name:X4($,"name")??Z??q,environment:"production",seal:{url:U,tenantSlug:H,headers:I.headers,cookies:I.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:U,expiresIn:Q,staffId:V,corpId:M,tenantId:X,tenantSlug:H,tenantName:Z,providerUserId:e2(G?.providerUserId),provider:F},auth:{refreshTtl:300}},N=Jp();$h0(N,{recursive:!0,mode:448});let O=zh0(N,`${FT(q)}.json`);if(ev0(O)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${O}. Pass "overwrite": true to replace it.`);Yh0(O,`${JSON.stringify(w,null,2)}
|
||||
`,{mode:384}),f0({id:q,name:w.name,tenantId:X,tenantSlug:H,verified:J,path:O})}async function zg1($,Y,z={}){let U=b8($,Y,z),Q=await T8(U);return{user:Q.user??{},tenant:Q.tenant??{}}}function e2($){return typeof $==="string"&&$?$:void 0}var sl=o(()=>{g7();jW();Q$();k3();dv0();cB();Up();A6();A6();ml();SZ();RT();f4();L$();D4();I4()});var Hh0={};N8(Hh0,{handleAuthExtractKeysCommand:()=>el,handleAuthCommand:()=>hT,formatBeijingIso:()=>tl});async function el($,Y){let z=$??h(Y.options.link)??h(Y.options.url);if(!z)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let U=Z0(Y.options.reveal)===!0||Z0(Y.options.r)===!0||Z0(Y.options.plain)===!0,Q=Z0(Y.options.save)===!0||Z0(Y.options.add)===!0;await _T(z,{reveal:U,save:Q,name:h(Y.options.name),overwrite:Z0(Y.options.overwrite)===!0,force:Z0(Y.options.force)===!0,appKey:h(Y.options["app-key"])??h(Y.options.appKey),keyId:h(Y.options["key-id"])??h(Y.options.keyId)})}async function hT($,Y,z){if($==="check"||$==="diagnose"||$==="status"||$==="test"||$==="doctor"){f0(await Ug1(Y));return}if($==="seal-link"||$==="link"||$==="hose-link"&&Y?.source?.type==="seal"){let U=z.command[2]?.toLowerCase(),Q=h(z.options["from-link"])??(U==="from-link"?z.command[3]:void 0);if(Q){let X=h(z.options.note),Z=await ew(Q),q=b8(Z.sealUrl,Z.token),V=await T8(q);$M(Z.corpId,V.tenant);let F=await rQ(q,{note:X});f0({tenant:{id:V.tenant.id,name:V.tenant.name,tenantSlug:V.tenant.tenantSlug,corpId:Z.corpId},user:{id:V.user.id,name:V.user.name,providerUserId:V.user.providerUserId,isAdmin:V.user.isAdmin},delegation:F,expiresIn:Z.expiresIn});return}let J=await P1(Y);if(U==="list"){await k0("seal_delegation_list",J,Y,{},C0(z.options));return}if(U==="revoke"){let X=z.command[3]??h(z.options.tokenId)??h(z.options.id);if(!X)throw Error("Usage: seal-use auth link revoke <tokenId>");await k0("seal_delegation_revoke",J,Y,{tokenId:X},C0(z.options));return}let K=h(z.options.note)??"CLI generated provisional access link",I=await T5("seal_delegation_create",J,Y,{note:K});if($==="hose-link")console.error(`\uD83D\uDC49 提示: 企业「${Y.name}」源类型为 Seal 原生测试环境,已自动为您生成委托免登直达链接。`);let G=I,W="staffName"in Y.source&&typeof Y.source.staffName==="string"?Y.source.staffName:void 0,H=tl(Date.now()+86400000);f0({id:G.id,corpId:Y.source.corpId??Y.id,corpName:Y.name,staffId:Y.source.staffId,...W?{staffName:W}:{},link:G.link,expiresAt:H,token:G.token});return}if($==="hose-link"){let U=z.options.expire,Q=U!==void 0?s0(U):7200;if(Q===void 0||Q<=0)throw Error(`Invalid --expire: ${String(U)}. Must be a positive number of seconds (e.g. --expire 7200 or --expire 86400).`);let J=Z0(z.options.force)===!0||Z0(z.options.refresh)===!0||Z0(z.options.f)===!0,K=await h00(Y,Q,{force:J}),I="staffName"in Y.source&&typeof Y.source.staffName==="string"?Y.source.staffName:void 0,G=tl(Date.now()+Q*1000);f0({corpId:Y.source.corpId??Y.id,corpName:Y.name,staffId:Y.source.staffId,...I?{staffName:I}:{},link:K.url,expiresAt:G,token:K.token});return}if($==="keys"){let U=Z0(z.options.reveal)===!0||Z0(z.options.r)===!0||Z0(z.options.plain)===!0;await rl(Y.id,{reveal:U});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function Ug1($){if($.source.type!=="hose"){let F=await P1($),M=await T8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:M.user,tenant:M.tenant}]}}tw($.id);let Y=$.source,z=Y.appKey??Y.key,U=Y.appSecurity??Y.password,Q=($.seal.url??Y.sealUrl??`https://${Y.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),J=Y.staffId.includes(":")?Y.staffId:`${Y.corpId}:${Y.staffId}`,K=[];if(!z||!U)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let I=await vT("hose.openapi",async()=>{let F=await Gh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:z,appSecurity:U}),M=o3(F.value),w=b6(M.accessToken)??b6(F.accessToken)??b6(F.token);if(!w)throw Error("Hose login did not return an access token");return{token:w,public:{corporationId:b6(M.corporationId)??b6(o3(M.corporation).id),expireTime:Tq(M.expireTime)}}});K.push(I.public);let G=I.private?.token,W=G?await vT("hose.provisional",async()=>{let F=await Gh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:J,pageType:"home",expireDate:7200}),M=b6(o3(F.value).message);if(!M)throw Error("Hose CloseAPI did not return a provisional auth URL");let w=new URL(M).searchParams.get("accessToken");if(!w)throw Error("Hose provisional auth URL did not include accessToken");return{token:w,public:{uid:J,enterpriseUrl:Nq(M)}}}):al("hose.provisional");K.push(W.public);let H=D6($.seal),X=W.private?.token,Z=X?await vT("seal.sso",async()=>{let M=await b8(Q,
Line truncated
|
||||
`);f0({provider:"hose",capability:"privilege-elevation",corpId:z.id,corpName:z.name,domain:z.source.domain,staffId:z.source.staffId,appKey:Q??"-",appSecurity:J?U?J:uS(J):"-",active:!0})}function Mh0($,Y){let{token:z,sealUrl:U,expiresIn:Q,verify:J,remote:K}=Y,I=Y.custom??Lh0($),G=K?.user,W=K?.tenant,H=X4($,"tenantSlug")??$Y(W?.tenantSlug),X=X4($,"tenantId")??$Y(W?.id),Z=X4($,"tenantName")??$Y(W?.name),q=X4($,"id")??H??X;if(!q)throw Error("Missing required JSON field: id. Seal whoami did not return tenantSlug or tenantId.");let V=X4($,"staffId")??$Y(G?.providerUserId)??$Y(G?.id)??"seal",F=X4($,"provider")??$Y(G?.provider)??$Y(W?.providerConfig?.provider),w=X4($,"corpId")??H??X??q,M={id:q,name:X4($,"name")??Z??q,environment:"production",seal:{url:U,tenantSlug:H,headers:I.headers,cookies:I.cookies,endpoints:{approvalStylePreferences:"api/v1/agent/ai-approval/config"}},source:{type:"seal",token:z,sealUrl:U,expiresIn:Q,staffId:V,corpId:w,tenantId:X,tenantSlug:H,tenantName:Z,providerUserId:$Y(G?.providerUserId),provider:F},auth:{refreshTtl:300}},O=Kp();Hh0(O,{recursive:!0,mode:448});let N=Zh0(O,`${MT(q)}.json`);if(Wh0(N)&&$.overwrite!==!0)throw Error(`Enterprise config already exists: ${N}. Pass "overwrite": true to replace it.`);Xh0(N,`${JSON.stringify(M,null,2)}
|
||||
`,{mode:384}),f0({id:q,name:M.name,tenantId:X,tenantSlug:H,verified:J,path:N})}async function Fg1($,Y,z={}){let U=b8($,Y,z),Q=await T8(U);return{user:Q.user??{},tenant:Q.tenant??{}}}function $Y($){return typeof $==="string"&&$?$:void 0}var el=m(()=>{g7();EW();J$();k3();Yh0();nB();Qp();A6();A6();rl();gZ();_T();f4();F$();D4();I4()});var Nh0={};N8(Nh0,{handleAuthExtractKeysCommand:()=>zo,handleAuthCommand:()=>ST,formatBeijingIso:()=>Yo});async function zo($,Y){let z=$??h(Y.options.link)??h(Y.options.url);if(!z)throw Error("Usage: seal-use auth extract-keys <https://.../web/thirdparty.html?...> [--reveal] [--save] [--name <customName>] [--overwrite]");let U=Z0(Y.options.reveal)===!0||Z0(Y.options.r)===!0||Z0(Y.options.plain)===!0,Q=Z0(Y.options.save)===!0||Z0(Y.options.add)===!0;await vT(z,{reveal:U,save:Q,name:h(Y.options.name),overwrite:Z0(Y.options.overwrite)===!0,force:Z0(Y.options.force)===!0,appKey:h(Y.options["app-key"])??h(Y.options.appKey),keyId:h(Y.options["key-id"])??h(Y.options.keyId)})}async function ST($,Y,z){if($==="check"||$==="diagnose"||$==="status"||$==="test"||$==="doctor"){f0(await Mg1(Y));return}if($==="seal-link"||$==="link"||$==="hose-link"&&Y?.source?.type==="seal"){let U=z.command[2]?.toLowerCase(),Q=h(z.options["from-link"])??(U==="from-link"?z.command[3]:void 0);if(Q){let X=h(z.options.note),Z=await $w(Q),q=b8(Z.sealUrl,Z.token),V=await T8(q);Yw(Z.corpId,V.tenant);let F=await sQ(q,{note:X});f0({tenant:{id:V.tenant.id,name:V.tenant.name,tenantSlug:V.tenant.tenantSlug,corpId:Z.corpId},user:{id:V.user.id,name:V.user.name,providerUserId:V.user.providerUserId,isAdmin:V.user.isAdmin},delegation:F,expiresIn:Z.expiresIn});return}let J=await P1(Y);if(U==="list"){await k0("seal_delegation_list",J,Y,{},C0(z.options));return}if(U==="revoke"){let X=z.command[3]??h(z.options.tokenId)??h(z.options.id);if(!X)throw Error("Usage: seal-use auth link revoke <tokenId>");await k0("seal_delegation_revoke",J,Y,{tokenId:X},C0(z.options));return}let K=h(z.options.note)??"CLI generated provisional access link",I=await T5("seal_delegation_create",J,Y,{note:K});if($==="hose-link")console.error(`\uD83D\uDC49 提示: 企业「${Y.name}」源类型为 Seal 原生测试环境,已自动为您生成委托免登直达链接。`);let G=I,W="staffName"in Y.source&&typeof Y.source.staffName==="string"?Y.source.staffName:void 0,H=Yo(Date.now()+86400000);f0({id:G.id,corpId:Y.source.corpId??Y.id,corpName:Y.name,staffId:Y.source.staffId,...W?{staffName:W}:{},link:G.link,expiresAt:H,token:G.token});return}if($==="hose-link"){let U=z.options.expire,Q=U!==void 0?s0(U):7200;if(Q===void 0||Q<=0)throw Error(`Invalid --expire: ${String(U)}. Must be a positive number of seconds (e.g. --expire 7200 or --expire 86400).`);let J=Z0(z.options.force)===!0||Z0(z.options.refresh)===!0||Z0(z.options.f)===!0,K=await y00(Y,Q,{force:J}),I="staffName"in Y.source&&typeof Y.source.staffName==="string"?Y.source.staffName:void 0,G=Yo(Date.now()+Q*1000);f0({corpId:Y.source.corpId??Y.id,corpName:Y.name,staffId:Y.source.staffId,...I?{staffName:I}:{},link:K.url,expiresAt:G,token:K.token});return}if($==="keys"){let U=Z0(z.options.reveal)===!0||Z0(z.options.r)===!0||Z0(z.options.plain)===!0;await tl(Y.id,{reveal:U});return}throw Error(`Unknown auth command: ${$??""}. Run 'seal-use help' for available commands.`)}async function Mg1($){if($.source.type!=="hose"){let F=await P1($),w=await T8(F);return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!0,stages:[{name:"seal.whoami",ok:!0,user:w.user,tenant:w.tenant}]}}eM($.id);let Y=$.source,z=Y.appKey??Y.key,U=Y.appSecurity??Y.password,Q=($.seal.url??Y.sealUrl??`https://${Y.corpId.toLowerCase()}.sealai.cc`).replace(/\/+$/,""),J=Y.staffId.includes(":")?Y.staffId:`${Y.corpId}:${Y.staffId}`,K=[];if(!z||!U)return{corp:{id:$.id,name:$.name,sourceType:$.source.type},ok:!1,stages:[{name:"hose.openapi",ok:!1,error:"Hose source requires appKey/key and appSecurity/password"}]};let I=await hT("hose.openapi",async()=>{let F=await wh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1/auth/getAccessToken`,{appKey:z,appSecurity:U}),w=o3(F.value),M=b6(w.accessToken)??b6(F.accessToken)??b6(F.token);if(!M)throw Error("Hose login did not return an access token");return{token:M,public:{corporationId:b6(w.corporationId)??b6(o3(w.corporation).id),expireTime:jq(w.expireTime)}}});K.push(I.public);let G=I.private?.token,W=G?await hT("hose.provisional",async()=>{let F=await wh0(`${Y.domain.replace(/\/+$/,"")}/api/openapi/v1.1/provisional/getProvisionalAuth?accessToken=${encodeURIComponent(G)}`,{uid:J,pageType:"home",expireDate:7200}),w=b6(o3(F.value).message);if(!w)throw Error("Hose CloseAPI did not return a provisional auth URL");let M=new URL(w).searchParams.get("accessToken");if(!M)throw Error("Hose provisional auth URL did not include accessToken");return{token:M,public:{uid:J,enterpriseUrl:Dq(w)}}}):$o("hose.provisional");K.push(W.public);let H=D6($.seal),X=W.private?.token,Z=X?await hT("seal.sso",async()=>{let w=await b8(Q,
Line truncated
|
||||
|
||||
`+`支持的审批系统与发布目标:
|
||||
`+` • hosecloud (合思费控): seal-use deploy hosecloud <requirements|list|get|status|configure|sync> --corp <corpId>
|
||||
@@ -947,15 +951,15 @@ or add '--force' (or use 'seal-use webhook replay <recordId> --force') if you ex
|
||||
`+" • maycur (每刻报销): 建议使用 Webhook 模式对接");if($==="webhook"||$==="webhooks")throw Error("Webhook 审批流发布请直接使用专有命令:seal-use webhook <list|get|add|update|delete> --corp <corpId>");if($==="feishu"||$==="lark")throw Error("飞书审批发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '飞书审批' --result-url <url> --corp <corpId>");if($==="weaver")throw Error("泛微 OA 发布:建议使用 Webhook 通用发布模式对接。命令:seal-use webhook add --name '泛微OA' --result-url <url> --corp <corpId>");if($==="maycur"||$==="helios"){let W=$==="maycur"?"每刻报销":"汇联易";throw Error(`${W}发布:目前可通过 Webhook 模式接入。命令:seal-use webhook add --name '${W}' --result-url <url> --corp <corpId>`)}let K=$==="hosecloud",I=$==="hosecloud"?Y:$,G=$==="hosecloud"?z:Y;if(!K)throw Error(`未知的发布目标系统: ${$}。当前支持: hosecloud (合思费控) 与 webhook (通用回调)。`);if(I==="requirements"){await k0("seal_deploy_hosecloud_requirements",U,Q,{},C0(J.options));return}if(I==="list"){await k0("seal_deploy_hosecloud_list",U,Q,{},C0(J.options));return}if(I==="get"){let W=G??h(J.options.signKey)??h(J.options["sign-key"]);if(!W){let X=((await o1(U)).integrations??[]).filter((Z)=>Z.type==="hosecloud");if(X.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
|
||||
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Q.id}`);console.error(`Usage: seal-use deploy hosecloud get <sign-key> [--corp ${Q.id}]
|
||||
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let Z of X){let q=Z.outboundName??"SealAI 审批",V=Z.signKey,F=Z.apiOrigin??"production";console.error(` • "${q}" (signKey: ${V}, 环境: ${F})`),console.error(` \uD83D\uDC49 查看命令: seal-use deploy hosecloud get ${V} --corp ${Q.id}
|
||||
`)}throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_get",U,Q,{signKey:W},C0(J.options));return}if(I==="status"){await k0("seal_deploy_hosecloud_status",U,Q,{},C0(J.options));return}if(I==="configure"){let W=h(J.options.input),H=W?JSON.parse(Ig1(W,"utf8")):y8(J.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",U,Q,{...H,dryRun:Z0(J.options.dryRun)??Z0(J.options["dry-run"])},C0(J.options));return}if(I==="sync"){let W=G??h(J.options.signKey)??h(J.options["sign-key"]),H=Z0(J.options.auto)??Z0(J.options.yes);if(!W){let Z=((await o1(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
|
||||
`)}throw new M4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey。",2,X.length===1?`seal-use deploy hosecloud get ${X[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_get",U,Q,{signKey:W},C0(J.options));return}if(I==="status"){await k0("seal_deploy_hosecloud_status",U,Q,{},C0(J.options));return}if(I==="configure"){let W=h(J.options.input),H=W?JSON.parse(Dg1(W,"utf8")):y8(J.json);if(!H||Object.keys(H).length===0)throw Error("Usage: seal-use deploy hosecloud configure --json '{...}' or --input <file>");await k0("seal_deploy_hosecloud_configure",U,Q,{...H,dryRun:Z0(J.options.dryRun)??Z0(J.options["dry-run"])},C0(J.options));return}if(I==="sync"){let W=G??h(J.options.signKey)??h(J.options["sign-key"]),H=Z0(J.options.auto)??Z0(J.options.yes);if(!W){let Z=((await o1(U)).integrations??[]).filter((V)=>V.type==="hosecloud");if(Z.length===0)throw Error(`当前企业 (${Q.name}) 尚未添加合思发布配置。
|
||||
`+`\uD83D\uDC49 请先运行配置命令:seal-use deploy hosecloud configure --json '{...}' --corp ${Q.id}`);let q=Z[0];if(q&&Z.length===1&&H){let V=q.signKey;console.error(`ℹ️ [auto] 检测到企业仅有 1 个合思配置,已自动选择 (signKey: ${V})`),await k0("seal_deploy_hosecloud_sync",U,Q,{signKey:V},C0(J.options));return}console.error(`Usage: seal-use deploy hosecloud sync <sign-key> [--corp ${Q.id}]
|
||||
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of Z){let F=V.outboundName??"SealAI 审批",M=V.signKey,w=V.apiOrigin??"production";console.error(` • "${F}" (signKey: ${M}, 环境: ${w})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${M} --corp ${Q.id}
|
||||
`),console.error("ℹ️ 当前企业发现以下可用的合思配置卡片:");for(let V of Z){let F=V.outboundName??"SealAI 审批",w=V.signKey,M=V.apiOrigin??"production";console.error(` • "${F}" (signKey: ${w}, 环境: ${M})`),console.error(` \uD83D\uDC49 同步命令: seal-use deploy hosecloud sync ${w} --corp ${Q.id}
|
||||
`)}if(Z.length===1)console.error(`\uD83D\uDCA1 提示:若希望单配置自动同步,可附加 --auto 参数:seal-use deploy hosecloud sync --auto --corp ${Q.id}
|
||||
`);throw new w4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,Q,{signKey:W},C0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${I??""}. Available: requirements, list, get, status, configure, sync.`)}var Ah0=o(()=>{f4();D4();I4();A6();L$()});var Ph0=`interface:
|
||||
`);throw new M4("缺少必需参数 <sign-key>。请从上述候选列表中选择并指定 signKey 执行同步。",2,Z.length===1?`seal-use deploy hosecloud sync ${Z[0].signKey} --corp ${Q.id}`:void 0)}await k0("seal_deploy_hosecloud_sync",U,Q,{signKey:W},C0(J.options));return}throw Error(`Unknown deploy hosecloud action: ${I??""}. Available: requirements, list, get, status, configure, sync.`)}var hh0=m(()=>{f4();D4();I4();A6();F$()});var gh0=`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."
|
||||
`;var Bh0=()=>{};var jh0=`# Approval Attachment Trace Investigation
|
||||
`;var Sh0=()=>{};var kh0=`# Approval Attachment Trace Investigation
|
||||
|
||||
Use this workflow when a customer disputes an AI approval finding about an attachment, invoice, receipt, OCR result, or a UI-highlighted audit result.
|
||||
|
||||
@@ -1176,7 +1180,7 @@ Manual image check:
|
||||
- The customer's objection that they were receipts rather than invoices was reasonable.
|
||||
|
||||
However, the final rejection also had an independent rule-37 reason: payment screenshots totaled 699.48 while reimbursement was 700.00.
|
||||
`;var Th0=()=>{};var Ch0=`# Approval Bad Case Catalog
|
||||
`;var yh0=()=>{};var fh0=`# Approval Bad Case Catalog
|
||||
|
||||
Use this file only as a comparison catalog after inspecting the current trace. Do not treat any case below as a default diagnosis.
|
||||
|
||||
@@ -1226,7 +1230,7 @@ Important nuance:
|
||||
|
||||
- This is a bad-case pattern, not a general rule that every amount-total dispute is caused by \`pre_analysis\`.
|
||||
- Use it when the current trace shows recognized amounts being excluded downstream or duplicate attachments producing inconsistent conclusions.
|
||||
`;var Eh0=()=>{};var _h0="# Approval Run Lightweight Queries\n\nUse this reference when the user gives a 合思/易快报单号, source document SN, record ID, simulation batch ID, or asks for an approval decision without needing the full raw run payload.\n\n## Locate A Run By Document Number\n\nPrefer `pick` before broad search + bridge + get.\n\n```bash\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --batch <batchId> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest --fields recordId,sourceDocumentSN,status,aiDecision,aiSummary\n```\n\nDefault output is intentionally small: `recordId`, `sourceDocumentSN`, `sourceDocumentId`, `simulationBatchId`, `status`, `taskMode`, `ruleSetVersionNumber`, `langfuseTraceId`, `manualResult`, `aiDecision`, and `aiSummary`.\n\nIf there are multiple candidates and `--latest` was not used, report the candidates and ask which one to inspect.\n\n## Read Compact Run Detail\n\nUse `--summary` for most diagnosis and support questions.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --summary\n```\n\nUse `--fields` when the user needs a particular slice.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --fields metadata\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.fields,result.summary\nseal-use approval-runs get <recordId> --corp <corpId> --fields result.summary,result.decision,result.riskPoints\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.keyFields,result,manualApprovalRecord,ruleSetVersionNumber\n```\n\nAvoid full `approval-runs get <recordId>` unless the user specifically needs raw document fields, pipeline logs, invoice rawData, or signed URLs. Prefer `--output-file` for full payloads.\n\n## Understand The Case First\n\nBefore pulling the full document, use:\n\n```bash\nseal-use approval-runs document-summary <recordId> --corp <corpId>\n```\n\nThis is for quick case reading: template/title, key fields, amount, expense type, cost company, payee, invoice summary, attachment names, AI result, and manual result.\n\n## Extract AI-Cited Rules\n\nUse this when the user asks \"AI 用了哪条规则\", \"为什么命中这条\", or needs the rule evidence for a specific run.\n\n```bash\nseal-use approval-runs cited-rules <recordId> --corp <corpId>\n```\n\nReturn and discuss `runtimeRuleId`, `ruleCode`, `versionNumber`, `scope`, `strictness`, `appliedAnalysis`, `checkResult`, and `findings` when present.\n\nIf the user then wants the full text of one cited rule, use `rules get --record-id <recordId> --runtime-id rule-205` from `rule-lightweight.md`.\n\n## Attachments Without Raw Payloads\n\nUse:\n\n```bash\n# 查看附件列表摘要(包含文件名、类型、大小及直链可用性)\nseal-use approval-runs attachments <recordId> --corp <corpId> --summary\n\n# 下载全部附件到本地目录(优先使用 ossSignedUrl 签名直链)\nseal-use approval-runs attachments download <recordId> --all --out-dir ./downloads --corp <corpId>\n\n# 按名称或 fileId 过滤下载单个附件\nseal-use approval-runs attachments download <recordId> --name 发票 --corp <corpId>\n```\n\nThis should be enough for file names, file IDs, mime types, positions, invoice/attachment grouping, and links when available. For customer disputes about OCR, receipt/invoice classification, or image content, switch to `approval-attachment-trace.md`.\n\n## Result Summary\n\nUse:\n\n```bash\nseal-use approval-runs result <recordId> --corp <corpId> --summary\n```\n\nThis is for decision, summary, risk point count, matched rule count, trace ID, and record ID.\n\n## Approval Run Web Links & Auto-Login Links\n\nUse this when the user asks for a link to an approval run or wants to open the run directly in their browser:\n\n```bash\n# 默认推荐:生成 Seal AI 审核详情直达链接(无凭证、无越权风险,用户在已有登录状态的浏览器中直接打开)\nseal-use approval-runs link <recordId> --corp <corpId>\nseal-use approval-runs link --sn <sourceDocumentSN> --corp <corpId>\n\n# 生成合思主系统原始单据页面链接\nseal-use approval-runs link <recordId> --type hose-document --corp <corpId>\n\n# 仅当用户明确要求免密/跨浏览器/无登录直达且确认知晓安全风险时:生成携带合思单次临时票据的免登直达链接\nseal-use approval-runs link <recordId> --auto-login [--expire 7200] --corp <corpId>\n```\n\n### 返回字段说明与语义规范\n- `sealResultUrl`: Seal AI 单据智能审核结果页\n- `hoseDocumentUrl`: 合思费控主系统原始报销/借款单详情页\n- `type`: 链接类型,默认为 `seal_result`,指定时可为 `hose_document`\n- `mode`: 鉴权模式,`direct`(原生直接打开)或 `auto_login`(免密换票)\n\n### 免登链接安全与声明规范\n当向用户返回 `--auto-login` 链接时
Line truncated
|
||||
`;var xh0=()=>{};var bh0="# Approval Run Lightweight Queries\n\nUse this reference when the user gives a 合思/易快报单号, source document SN, record ID, simulation batch ID, or asks for an approval decision without needing the full raw run payload.\n\n## Locate A Run By Document Number\n\nPrefer `pick` before broad search + bridge + get.\n\n```bash\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --batch <batchId> --latest\nseal-use approval-runs pick --corp <corpId> --sn <sourceDocumentSN> --latest --fields recordId,sourceDocumentSN,status,aiDecision,aiSummary\n```\n\nDefault output is intentionally small: `recordId`, `sourceDocumentSN`, `sourceDocumentId`, `simulationBatchId`, `status`, `taskMode`, `ruleSetVersionNumber`, `langfuseTraceId`, `manualResult`, `aiDecision`, and `aiSummary`.\n\nIf there are multiple candidates and `--latest` was not used, report the candidates and ask which one to inspect.\n\n## Read Compact Run Detail\n\nUse `--summary` for most diagnosis and support questions.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --summary\n```\n\nUse `--fields` when the user needs a particular slice.\n\n```bash\nseal-use approval-runs get <recordId> --corp <corpId> --fields metadata\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.fields,result.summary\nseal-use approval-runs get <recordId> --corp <corpId> --fields result.summary,result.decision,result.riskPoints\nseal-use approval-runs get <recordId> --corp <corpId> --fields document.keyFields,result,manualApprovalRecord,ruleSetVersionNumber\n```\n\nAvoid full `approval-runs get <recordId>` unless the user specifically needs raw document fields, pipeline logs, invoice rawData, or signed URLs. Prefer `--output-file` for full payloads.\n\n## Understand The Case First\n\nBefore pulling the full document, use:\n\n```bash\nseal-use approval-runs document-summary <recordId> --corp <corpId>\n```\n\nThis is for quick case reading: template/title, key fields, amount, expense type, cost company, payee, invoice summary, attachment names, AI result, and manual result.\n\n## Extract AI-Cited Rules\n\nUse this when the user asks \"AI 用了哪条规则\", \"为什么命中这条\", or needs the rule evidence for a specific run.\n\n```bash\nseal-use approval-runs cited-rules <recordId> --corp <corpId>\n```\n\nReturn and discuss `runtimeRuleId`, `ruleCode`, `versionNumber`, `scope`, `strictness`, `appliedAnalysis`, `checkResult`, and `findings` when present.\n\nIf the user then wants the full text of one cited rule, use `rules get --record-id <recordId> --runtime-id rule-205` from `rule-lightweight.md`.\n\n## Attachments Without Raw Payloads\n\nUse:\n\n```bash\n# 查看附件列表摘要(包含文件名、类型、大小及直链可用性)\nseal-use approval-runs attachments <recordId> --corp <corpId> --summary\n\n# 下载全部附件到本地目录(优先使用 ossSignedUrl 签名直链)\nseal-use approval-runs attachments download <recordId> --all --out-dir ./downloads --corp <corpId>\n\n# 按名称或 fileId 过滤下载单个附件\nseal-use approval-runs attachments download <recordId> --name 发票 --corp <corpId>\n```\n\nThis should be enough for file names, file IDs, mime types, positions, invoice/attachment grouping, and links when available. For customer disputes about OCR, receipt/invoice classification, or image content, switch to `approval-attachment-trace.md`.\n\n## Result Summary\n\nUse:\n\n```bash\nseal-use approval-runs result <recordId> --corp <corpId> --summary\n```\n\nThis is for decision, summary, risk point count, matched rule count, trace ID, and record ID.\n\n## Approval Run Web Links & Auto-Login Links\n\nUse this when the user asks for a link to an approval run or wants to open the run directly in their browser:\n\n```bash\n# 默认推荐:生成 Seal AI 审核详情直达链接(无凭证、无越权风险,用户在已有登录状态的浏览器中直接打开)\nseal-use approval-runs link <recordId> --corp <corpId>\nseal-use approval-runs link --sn <sourceDocumentSN> --corp <corpId>\n\n# 生成合思主系统原始单据页面链接\nseal-use approval-runs link <recordId> --type hose-document --corp <corpId>\n\n# 仅当用户明确要求免密/跨浏览器/无登录直达且确认知晓安全风险时:生成携带合思单次临时票据的免登直达链接\nseal-use approval-runs link <recordId> --auto-login [--expire 7200] --corp <corpId>\n```\n\n### 返回字段说明与语义规范\n- `sealResultUrl`: Seal AI 单据智能审核结果页\n- `hoseDocumentUrl`: 合思费控主系统原始报销/借款单详情页\n- `type`: 链接类型,默认为 `seal_result`,指定时可为 `hose_document`\n- `mode`: 鉴权模式,`direct`(原生直接打开)或 `auto_login`(免密换票)\n\n### 免登链接安全与声明规范\n当向用户返回 `--auto-login` 链接时
Line truncated
|
||||
|
||||
Use this low-freedom workflow when the user provides packaged customer feedback from WeChat, screenshots, rejection notifications, a document number, or expected business behavior and wants diagnosis or an approval-rule change.
|
||||
|
||||
@@ -1494,7 +1498,7 @@ Do not automatically rerun or resubmit the customer's production document. Run a
|
||||
- **系统调用凭证账号**:显式说明“周晚容(系统调用凭证账号,由智能助手代执行)”
|
||||
- **全量规则总数**:核对总数是否变化
|
||||
- **规则一致性校验**:确认目标规则文本与确认内容 100% 逐字吻合
|
||||
`;var Sh0=()=>{};var kh0=`# Enterprise Onboarding
|
||||
`;var nh0=()=>{};var mh0=`# Enterprise Onboarding
|
||||
|
||||
> 💡 **新手接入指引分工**:
|
||||
> - 若是引导无技术背景的用户找凭证材料、找按钮,**必须直接使用 \`references/first-time-user.md\` 并渲染其中的指引截图**;
|
||||
@@ -1684,7 +1688,7 @@ seal-use auth check --corp <discovered-id> # Hose source
|
||||
Report the human enterprise name, identity provider, credential method, and whether verification succeeded. Do not expose internal IDs unless they help with troubleshooting. Do not perform approval, rule, document, simulation, publishing, or other business mutations just because onboarding succeeded; continue only with the user's requested task and its normal confirmation rules.
|
||||
|
||||
If a temporary assistance-link or browser session expires, explain that it must be renewed or recaptured. Recommend standard Hose app credentials when the user needs durable unattended access.
|
||||
`;var yh0=()=>{};var fh0=`# 第一次接入:看图找到材料
|
||||
`;var dh0=()=>{};var oh0=`# 第一次接入:看图找到材料
|
||||
|
||||
> **【Agent 呈现铁律(Mandatory Image Rule)】**:
|
||||
> 当向用户提供接入指引或引导用户获取材料时,**Agent 必须将本文档中对应的截图主动按顺序渲染到 Markdown 对话中**(使用图片语法 \`\`),**绝不允许只讲纯文字步骤!** 真实业务用户必须对照图片界面才能准确找到按钮。
|
||||
@@ -1769,7 +1773,7 @@ macOS 也可以使用 \`Option + Command + I\`;Windows 常见快捷键是 \`F1
|
||||
## 安全提醒
|
||||
|
||||
协助平台、网页登录、SSO 和浏览器 cURL 都可能携带当前用户的访问权限。只把材料交给正在处理本机接入的可信助手,并在接入完成后关闭或刷新该网页会话。不要把原始 cURL、接入密码或完整截图发送到外部渠道。
|
||||
`;var xh0=()=>{};var bh0=`# Hose Enterprise Auth
|
||||
`;var lh0=()=>{};var sh0=`# Hose Enterprise Auth
|
||||
|
||||
Use this reference for Hose/合思 enterprise configuration and user-facing Hose authorization links.
|
||||
|
||||
@@ -1838,7 +1842,7 @@ Important:
|
||||
3. BOTH a code block (\` \`\`\`text ... \`\`\` \`) for easy copying without accidental default browser redirection, AND a clickable hyperlink.
|
||||
- **Dedicated CLI Command**: Use \`seal-use auth hose-link --corp <corpId> [--expire <seconds>] [--force]\`. This command directly generates an independent provisional auth link without reading or mutating internal CLI session cache. It supports \`--expire\` (default 7200, e.g. 86400 for 1 day).
|
||||
- **Seal AI Platform Direct Link**: Use \`seal-use auth link --corp <corpId> [--note <note>]\`. This generates a 24-hour provisional delegation link for the Seal AI audit platform (\`https://*.sealai.cc\`).
|
||||
`;var uh0=()=>{};var ch0=`# Seal AI 智能审核发布到合思费控 (HoseCloud Deployment)
|
||||
`;var rh0=()=>{};var th0=`# Seal AI 智能审核发布到合思费控 (HoseCloud Deployment)
|
||||
|
||||
Use this reference when configuring, deploying, or troubleshooting Seal AI smart approval integrations with Hose/合思费控 (界面路径:【智能审核】 $\\to$ 【发布】 $\\to$ 【合思费控】).
|
||||
|
||||
@@ -1936,7 +1940,7 @@ seal-use deploy hosecloud status --corp <corpId>
|
||||
| \`signKey\` | string | 否 | 随机生成 | 集成配置卡片唯一标识,编辑时传入以更新对应配置 |
|
||||
| \`apiOrigin\` | string | 否 | 自动探测 | \`production\` / \`custom\` |
|
||||
| \`customApiUrl\` | string | 否 | - | 专属私有云 API 地址(当 \`apiOrigin=custom\` 时必填) |
|
||||
`;var ih0=()=>{};var ph0=`# Hose Enterprise Initialization & Automated Discovery
|
||||
`;var ah0=()=>{};var $S0=`# Hose Enterprise Initialization & Automated Discovery
|
||||
|
||||
Use this reference for automated Hose/合思 enterprise onboarding, multi-domain probing (including dedicated private cloud domains like 美年大健康), OpenAPI role and staff discovery, and non-TUI safe administrator selection.
|
||||
|
||||
@@ -2042,7 +2046,7 @@ seal-use corps hose-staffs --json '{
|
||||
}'
|
||||
\`\`\`
|
||||
* 直接使用指定 ID 完成接入并进行连通性验证。
|
||||
`;var nh0=()=>{};var mh0=`# Rule Lightweight Queries
|
||||
`;var eh0=()=>{};var zS0=`# Rule Lightweight Queries
|
||||
|
||||
Use this reference when the user wants rule counts, compact rule lists, one rule from a historical version, or approval knowledge search without dumping hundreds of rule descriptions.
|
||||
|
||||
@@ -2153,7 +2157,7 @@ Use current search only when the question is about current draft/current knowled
|
||||
## Output Discipline
|
||||
|
||||
If a rule command would return many descriptions or more than about 20 rules, use \`rules count\`, \`rules list --summary\`, \`fields\`, \`snippetOnly\`, or \`--output-file\`. Use \`--full\` only for deliberate exports.
|
||||
`;var dh0=()=>{};var oh0="# Seal Approval Rule Linter & Quality Validation\n\nUse this reference when analyzing, validating, or linting Seal AI approval rules to detect vague phrasing, missing exception evidence, or formatting defects before publishing.\n\n## Key Principles\n\n- **Default State**: Linter is **disabled by default** in global configuration (`lint.enabled: false`) to avoid unsolicited noise during standard operations.\n- **Doctor Visibility**: `seal-use doctor` audits the rule linter configuration state and active linter name in its health checks, and surfaces a one-click hint (`seal-use config lint enable`) when disabled.\n- **Explicit Triggering**: `seal-use rules lint` always runs regardless of global configuration.\n- **Draft Hook**: When `seal-use config lint enable` is set, `seal_approval_rule_update` outputs real-time diagnostic warnings to `stderr` without mutating `stdout` payloads.\n- **Fault-Tolerant Fallback**: If a custom `.ts` linter file has syntax errors, runtime exceptions, or is missing, the engine logs a warning to `stderr` and **silently falls back to the built-in heuristic linter without failing**.\n\n## CLI Commands\n\n### 1. Lint Current Draft Rules (Whole-RuleSet Scan)\n\n```bash\nseal-use rules lint --corp <corpId>\n```\n\n### 2. Lint Specific Historical Version or Single Rule\n\n```bash\n# Lint rules in published version 16\nseal-use rules lint --version 16 --corp <corpId>\n\n# Lint a specific rule by code (#0038)\nseal-use rules lint --code '#0038' --corp <corpId>\n\n# Summary mode (only show rules with issues)\nseal-use rules lint --summary --corp <corpId>\n```\n\n### 3. Quality Gate for CI / Release\n\n```bash\n# If overall score is below 85, terminates with exit code 1\nseal-use rules lint --min-score 85 --level error --corp <corpId>\n```\n\n### 4. Configure Global Linter Settings\n\n```bash\n# Check status\nseal-use config lint status\n\n# Enable auto lint on rule updates\nseal-use config lint enable --linter builtin --min-score 80\n\n# Disable auto lint\nseal-use config lint disable\n```\n\n## Official Linters\n\n| Linter Name | Scope & Purpose | Aliases |\n| :--- | :--- | :--- |\n| `builtin` | Seal 官方标准校验器:拦截过短描述、主观模糊词与悬空例外条款。 | `default`, `official/builtin` |\n| `strict` | Seal 官方严格风控校验器:强校验字数、刚性定量约束、凭证依据与具体审批人角色。 | `official/strict` |\n| `hlab` | 合思实验室 (HLab) 结构化规则校验器:SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判。 | `hlab-sop`, `hlab-rules`, `hlab-standard`, `official/hlab` |\n\n```bash\n# Inspect available linters\nseal-use rules linters\n\n# Lint rules using HLab SOP standard\nseal-use rules lint --linter hlab --corp <corpId>\n\n# Lint local rule workspace offline with HLab standard\nseal-use rules lint --linter hlab --file ./rules.local.json\n```\n\n## Built-In Detection Rules (`builtin`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `TOO_SHORT` | `error` | Rule description is under 5 characters. | Add concrete conditions and criteria. |\n| `VAGUE_WORD` | `error` | Contains subjective/fuzziness words (`原则上`, `尽量`, `适当`, `酌情`, `一般情况下`, `合理控制`). | Replace with rigid thresholds, enums, or criteria. |\n| `HANGING_EXCEPTION` | `warning` | Exception trigger found (`除非`, `特殊情况`, `经批准`) without verifiable evidence keyword (`备注`, `附件`, `证明`, `邮件`, `截图`). | Specify exact evidence source in invoice/document. |\n\n## HLab SOP Detection Rules (`hlab`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `MISSING_CHECK_METHOD` | `error` | Missing `**检查方法**` section in rule description. | Add `**检查方法**:` specifying fields, vouchers, and normalization logic. |\n| `MISSING_EVAL_STANDARD` | `error` | Missing `**判定标准**` section in rule description. | Add `**判定标准**:` with standard branches. |\n| `INCOMPLETE_TERNARY_BRANCH` | `error` | Incomplete ternary branch under evaluation criteria (missing `PASS`, `FAIL`, or `证据不足`). | Provide complete ternary closure: `- PASS:`, `- FAIL:`, `- 证据不足:`. |\n| `INSUFFICIENT_WITHOUT_MANUAL_REVIEW` | `warning` | `证据不足` branch does not specify escalating to `人工复核`. | Add `转人工复核` at the end of `证据不足` branch. |\n| `DISPOSAL_ACTION_LEAK` | `warning` | Contains whole-bill workflow disposal actions (`驳回单据`, `直接驳回`, `进行提醒`, `退回单据`). | Decouple disposal actions from rule text; rely on rule strictness or platform workflow. |\n| `SCOPE_FALSE_SKIP_PRONE` | `warning` | Scope contains material upload conditions (`若上传了`, `若提供了`, `附件需上传`). | Keep scope pure to business triggers; handle missing materials explicitly in FAIL branch to prevent silent SKIP. |\n| `RISK_SUPPRESSION` | `erroLine truncated
|
||||
`;var YS0=()=>{};var QS0="# Seal Approval Rule Linter & Quality Validation\n\nUse this reference when analyzing, validating, or linting Seal AI approval rules to detect vague phrasing, missing exception evidence, or formatting defects before publishing.\n\n## Key Principles\n\n- **Default State**: Linter is **disabled by default** in global configuration (`lint.enabled: false`) to avoid unsolicited noise during standard operations.\n- **Doctor Visibility**: `seal-use doctor` audits the rule linter configuration state and active linter name in its health checks, and surfaces a one-click hint (`seal-use config lint enable`) when disabled.\n- **Explicit Triggering**: `seal-use rules lint` always runs regardless of global configuration.\n- **Draft Hook**: When `seal-use config lint enable` is set, `seal_approval_rule_update` outputs real-time diagnostic warnings to `stderr` without mutating `stdout` payloads.\n- **Fault-Tolerant Fallback**: If a custom `.ts` linter file has syntax errors, runtime exceptions, or is missing, the engine logs a warning to `stderr` and **silently falls back to the built-in heuristic linter without failing**.\n\n## CLI Commands\n\n### 1. Lint Current Draft Rules (Whole-RuleSet Scan)\n\n```bash\nseal-use rules lint --corp <corpId>\n```\n\n### 2. Lint Specific Historical Version or Single Rule\n\n```bash\n# Lint rules in published version 16\nseal-use rules lint --version 16 --corp <corpId>\n\n# Lint a specific rule by code (#0038)\nseal-use rules lint --code '#0038' --corp <corpId>\n\n# Summary mode (only show rules with issues)\nseal-use rules lint --summary --corp <corpId>\n```\n\n### 3. Quality Gate for CI / Release\n\n```bash\n# If overall score is below 85, terminates with exit code 1\nseal-use rules lint --min-score 85 --level error --corp <corpId>\n```\n\n### 4. Configure Global Linter Settings\n\n```bash\n# Check status\nseal-use config lint status\n\n# Enable auto lint on rule updates\nseal-use config lint enable --linter builtin --min-score 80\n\n# Disable auto lint\nseal-use config lint disable\n```\n\n## Official Linters\n\n| Linter Name | Scope & Purpose | Aliases |\n| :--- | :--- | :--- |\n| `builtin` | Seal 官方标准校验器:拦截过短描述、主观模糊词与悬空例外条款。 | `default`, `official/builtin` |\n| `strict` | Seal 官方严格风控校验器:强校验字数、刚性定量约束、凭证依据与具体审批人角色。 | `official/strict` |\n| `hlab` | 合思实验室 (HLab) 结构化规则校验器:SOP 四段论结构、三元闭环判定、剥离处置动作与防漏判。 | `hlab-sop`, `hlab-rules`, `hlab-standard`, `official/hlab` |\n\n```bash\n# Inspect available linters\nseal-use rules linters\n\n# Lint rules using HLab SOP standard\nseal-use rules lint --linter hlab --corp <corpId>\n\n# Lint local rule workspace offline with HLab standard\nseal-use rules lint --linter hlab --file ./rules.local.json\n```\n\n## Built-In Detection Rules (`builtin`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `TOO_SHORT` | `error` | Rule description is under 5 characters. | Add concrete conditions and criteria. |\n| `VAGUE_WORD` | `error` | Contains subjective/fuzziness words (`原则上`, `尽量`, `适当`, `酌情`, `一般情况下`, `合理控制`). | Replace with rigid thresholds, enums, or criteria. |\n| `HANGING_EXCEPTION` | `warning` | Exception trigger found (`除非`, `特殊情况`, `经批准`) without verifiable evidence keyword (`备注`, `附件`, `证明`, `邮件`, `截图`). | Specify exact evidence source in invoice/document. |\n\n## HLab SOP Detection Rules (`hlab`)\n\n| Code | Level | Description | Recommendation |\n| :--- | :---: | :--- | :--- |\n| `MISSING_CHECK_METHOD` | `error` | Missing `**检查方法**` section in rule description. | Add `**检查方法**:` specifying fields, vouchers, and normalization logic. |\n| `MISSING_EVAL_STANDARD` | `error` | Missing `**判定标准**` section in rule description. | Add `**判定标准**:` with standard branches. |\n| `INCOMPLETE_TERNARY_BRANCH` | `error` | Incomplete ternary branch under evaluation criteria (missing `PASS`, `FAIL`, or `证据不足`). | Provide complete ternary closure: `- PASS:`, `- FAIL:`, `- 证据不足:`. |\n| `INSUFFICIENT_WITHOUT_MANUAL_REVIEW` | `warning` | `证据不足` branch does not specify escalating to `人工复核`. | Add `转人工复核` at the end of `证据不足` branch. |\n| `DISPOSAL_ACTION_LEAK` | `warning` | Contains whole-bill workflow disposal actions (`驳回单据`, `直接驳回`, `进行提醒`, `退回单据`). | Decouple disposal actions from rule text; rely on rule strictness or platform workflow. |\n| `SCOPE_FALSE_SKIP_PRONE` | `warning` | Scope contains material upload conditions (`若上传了`, `若提供了`, `附件需上传`). | Keep scope pure to business triggers; handle missing materials explicitly in FAIL branch to prevent silent SKIP. |\n| `RISK_SUPPRESSION` | `erroLine truncated
|
||||
|
||||
本文档面向 AI Agent 与运维人员,规范从**生产/测试环境搭配接入**、**配置与合思集成自动同步**、**测试环境单据模拟验证**,到**生产规则安全投产**的端到端标准工作流。
|
||||
|
||||
@@ -2362,7 +2366,7 @@ flowchart TD
|
||||
seal-use tool seal_approval_rules_publish --corp <prodCorpId> --json '{"versionName":"审核规则 版本N"}'
|
||||
\`\`\`
|
||||
发布后核实版本状态,完成业务安全闭环。
|
||||
`;var rh0=()=>{};var th0=`---
|
||||
`;var JS0=()=>{};var GS0=`---
|
||||
name: seal-use
|
||||
description: "v0.10.35: 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."
|
||||
metadata:
|
||||
@@ -2496,10 +2500,10 @@ metadata:
|
||||
- 返回授权、协助或委托链接时,必须同时提供代码块(便于复制)与可点击链接;
|
||||
- 审批单链接默认提供只读 Deep Link(\`type: 'deep_link'\`);仅在用户明确需要免密时才使用 \`--sso\` 并声明四项安全告知。
|
||||
- **高危写操作防线**:规则推送或发布(\`rules push --publish\`)、清空(\`rules clear\`)等破坏性写操作必须先通过 \`--dry-run\` 预览 diff 并获得用户明确批准后方可执行。
|
||||
`;var ah0=()=>{};var Bg1="iVBORw0KGgoAAAANSUhEUgAADVgAAAdwCAYAAACUWcTmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAANWKADAAQAAAABAAAHcAAAAAD4n9OGAABAAElEQVR4AeydB4AdVfX/z246pNAD0hK6dOki0rsU+dMJJVIFRYoUFUFAQUCqgHSkxx8gTRCpFkB6CU06SQi9BEhC+u7/fu7b83J3dt7bt33f5nuStzNz5947M583c+fOvPO9p6Y+mMlEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4kUDsHHrMOWQREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQigd7jxo8TChEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYIwkogtUc+bXroEVABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCBQUx9MKERABERABERABERABERABERABERABERABERABERABERABERABESgqwiMHz/eBgwY0FWb13ZFQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQATmcAKKYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwn0npMPXscuAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAj2RwP8+n26vfjbd3vpyho2fPN0+mjLTJs+qs/qaOhvYp8YWGtDLFh/U25YZ3NdWnr+/rTDvgJ6IQcckAhURqKkPVlFOZRIBERABERABERABERABERABERABERABERABERABERABERABERCBDiAwfvx4GzBAP9p2AFpVKQIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiMIcR+GhSnT347lT713tT7eOpM4OYqj5+LEzNEFdZ+MyKU5Zr4jLp9fat/r1ss28NtM0WG2KLzN1nDiOnw53TCUhgNaefATp+ERABERABERABERABERABERABERABERABERABERABERABEehiAhJYdfEXoM2LgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAhUPYFJ08z+7+Updsc7U8OxFARURKqyIKAqCKnqbVYQUdU2CK7iOiuIr4oirLBcgxArfHZZcrDttcwCNnefXlXPRgcgApUQkMCqEkrKIwIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0GEEJLDqMLSqWAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4g8MR7M+2Cp6fY5JmFSFQhRlUQStUVBVUsF0VUCKiSSFZEsKqLkawa5yH/oN5mP195qK0/dPAcQFGHOKcTkMBqTj8DdPwiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0MUEJLDq4i+gCzY/ZcqUuNUBAwZ0wda1SREQAREQAREQAREQAREQAREQAREQAREQAREQARHoHAKd8S501AszbNT/psXIUwWhVDi2IK6qj5GriGRVEE4RlSoVWlUayYry+w2fx0Yst1DnQNNWRKCLCAQ9oUwEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKCaCFz035n20JgZ1stqQowqs9qaWmJVBR1VbRBZkdLLakN0qiCzCtMGgVXMURfW1YQsTHsFEdasMC0UCSWjOIvcbte++6V9MX2mHb7ytzypS6e/+93v7H//+1/uPuy888727W9/O35yMyhRBEoQ4NyXiYAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiECPIXDbbbfZiBEjGh0PP7aSxif90dXzks68G3k8P2VTYznNm67TvAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BoGLHp1lD74zM6qh6kK4qprwqW+YMl9TR1pYHcRWtUFHhZaqLi6TFsJbhflCOYRVtbG818H6+KGOhnr+9v4ku/DlDzrj0Mpug/fz6Xv+bOa//vWvxkcmAi0loAhWLSWm/CIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAt2WAD+sdvQPp/xwy0cjYHbb00A7JgIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAI9msCo5+rt4XdDVKoaIlfVxChVHHCMPtXoyIO4KuSoy0ayqifOFeWJUxVqSCJZfW/hwfbox1/FuqiKHF4zIqt5+39qey+zYEztij/pbwC8p0/NhVc+TddpXgSaIyCBVXOEtF4EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKBqCLz66qudtq/8iPvrX/+607aX3VBniMluvPHG7Ga1LAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiUIJAzT+vi2vqN9m3RA4li0DbCTw5xuyWl+qMIFQWIk8Rpqo+Cq1YDlKokL7m4v2D7IrFOgurwvqwoiaEsIpyKebNHv9wki+FdERaSKlq7fytlrEj73vLHvvoq7gNUkM4q1BPKBTque7tCbbUoH62/tDBrOkyQ1yVfUf/u9/9rmx0qy7b2VZu2H8H4FhXXHFF+3//7/+1siYVq4RATX2wSjIqjwiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BIHx48fbgAEDOqLqHlun/6ja0QfYUQKrKVOmxF3X997R36DqFwEREAEREAEREAEREAEREAEREAEREAER6EwCs074btxcr9Me78zNalvdmEB7vwudNM3ssFvNJs2oi0KqWUE0FQVUUUiF6KreLtx5QVtt0X5lqYz+cIodevfYkKcg1KpHfBXKHvadobbvdxay0R9NsgPveyOsD3KTWiQniLjCNHyYDgqhfq7bcCmbu0+vsttpy0rEUlgqLErfje+8885NBEepwMrXE83Ko16ldbVl3zqjbHqsvj0EZdmoXb5O07YTUASrtjNUDSIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiLQqQQ6M1JXpx5YD96Yj3sZR3ntwcdZyaHNmDHDPv74Y1t00UULo95WUqiL8syaNct69eo4J5EuOqwu3Szff58+fZrsg66RJkiU0MkEGJ4YhzSZCHQmAdpEjHtNbW0Ydb4djHvX9OnTNYBBA0ucWfv169dufNvhK+oxVUydOtXq6upsrrnm6jHHpAMRAREQAREQgbYS8OhV1FN/1VFWc8B5ba2yWJ6+45gxY+ytt96y/v3729JLL22LLbZYbj+H9y4u6ilWUGJm7rnntgUXXDCu/frrr+2LL74okbNxMv3XJZZYonFia5fGjLaad0e3tnSx3JwSNezmZ2ts8vQQTSr8C9KoOA2Sp8ChJvyttQPXG9SsuMqh1VEslIviqTBdf5G5o7iK1NUWHmg/XW1Ru/iF960+aK8QVbE1j2SFwOumtz6zg749lOztbqlQygVSCIuYL2cIqDwPoirepfsy5ZgnLRv5qlydXbUu73cAjqka9h1mCMSw1kbdamv5uPEW/pHAqoXAlF0EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEuppA+oNwR0WZ6upj7Enbf+ONN+yUU06Jh3Tsscfa6quv3pMOLx7Lhx9+aMcff3yc33vvvW3LLbfMPcZbbrnF7rjjjrjuF7/4ha2yyiq5+dLEyZMn24QJE2zhhRe23r1720svvWTnn39+zPLLX/7SlllmmTR77jyORb/61a/iuv3339++973v5eZLE99++2076aSTbNlll7UtttiiojJp+WqZHz16dBQ84XziNnPmTPv00099sUVTHLMGDx6cW2bcuHHRAWSzzTazHXfc0eaZZ56Y7/HHH7eLLroozh933HG21FJL2Zlnnmm77LJLm6+Xb775xr766qvc/ckmzjvvvNFJLZveluWzzz7b3nrzTVty2DDjfG2JTZs2ze677z7bZpttGonSvvzyy4od5bLb4zqqJqHnxxNmWcHZK3skLV/u16fG5huUL2B5cPRUO
Line truncated
|
||||
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"created"};let Q={};try{Q=JSON.parse(YS0(z,"utf8"))}catch{Q={entries:[]}}if(!Array.isArray(Q.entries))Q.entries=[];if(Q.entries.findIndex((I)=>I&&typeof I.path==="string"&&I.path===Y)!==-1)return{detected:U,configured:!0,configPath:z,targetDir:Y,action:"already_present"};let K=Q.entries.findIndex((I)=>I&&typeof I.path==="string"&&(I.path==="~/.agents/skills"||I.path==="~/.agents/skills/"));if(K!==-1)return Q.entries[K]={...Q.entries[K],path:Y},zo(z,JSON.stringify(Q,null,2)+`
|
||||
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"updated_tilde"};return Q.entries.unshift({path:Y}),zo(z,JSON.stringify(Q,null,2)+`
|
||||
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"prepended"}}function Jo($){let Y=$?.targetSkillsDir??zS0(),z=$?.configFile??US0(),U=QS0(),Q=!1;if(jq(z))try{let J=JSON.parse(YS0(z,"utf8"));if(Array.isArray(J?.entries))Q=J.entries.some((K)=>K?.path===Y)}catch{}return{detected:U,configured:Q,configPath:z,targetDir:Y}}var Ko=()=>{};import{cpSync as vg1,existsSync as bI,lstatSync as KS0,mkdirSync as hg1,realpathSync as $Y,rmSync as Sg1,symlinkSync as gg1,unlinkSync as JS0}from"node:fs";import{homedir as IS0}from"node:os";import{dirname as GS0,join as YY}from"node:path";function yg1($,Y){let z=Y?.baseHomeDir??IS0(),U=YY(z,$.rootDirName),Q=Y?.sourceSkillDir??YY(z,".agents","skills","seal-use"),J=GS0(Q),K=YY(U,"skills"),I=YY(K,"seal-use");if(!bI(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"skipped_not_detected"};if(bI(K)&&bI(J))try{if($Y(K)===$Y(J))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:K}}catch{}hg1(K,{recursive:!0});let G;try{G=KS0(I)}catch{G=void 0}let W=!1;if(G)if(G.isSymbolicLink()){try{if($Y(I)===$Y(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"already_linked",targetPath:I}}catch{}try{JS0(I)}catch{}}else if(G.isDirectory())Sg1(I,{recursive:!0,force:!0}),W=!0;else JS0(I);let H=process.platform==="win32"?"junction":"dir";try{return gg1(Q,I,H),{id:$.id,name:$.name,detected:!0,configured:!0,mode:W?"replaced_real_dir":"linked",targetPath:I}}catch{try{return vg1(Q,I,{recursive:!0}),{id:$.id,name:$.name,detected:!0,configured:!0,mode:"fallback_copied",targetPath:I}}catch(X){return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"error",targetPath:I,error:X?.message||String(X)}}}}function kg1($,Y){let z=Y?.baseHomeDir??IS0(),U=YY(z,$.rootDirName),Q=Y?.sourceSkillDir??YY(z,".agents","skills","seal-use"),J=GS0(Q),K=YY(U,"skills"),I=YY(K,"seal-use");if(!bI(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"not_detected"};if(bI(K)&&bI(J))try{if($Y(K)===$Y(J))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:K}}catch{}let G;try{G=KS0(I)}catch{G=void 0}if(G){if(G.isSymbolicLink())try{if($Y(I)===$Y(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"single_symlinked",targetPath:I}}catch{}else if(G.isDirectory())return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"real_directory",targetPath:I}}return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"not_configured",targetPath:I}}function Io($){return WS0.map((Y)=>yg1(Y,$))}function Go($){return WS0.map((Y)=>kg1(Y,$))}var WS0;var Wo=o(()=>{WS0=[{id:"workbuddy",name:"WorkBuddy",rootDirName:".workbuddy"},{id:"claude",name:"Claude",rootDirName:".claude"},{id:"qoder",name:"Qoder",rootDirName:".qoder"}]});var Ho=o(()=>{Ko();Wo();Ko();Wo()});import{existsSync as xg1,mkdirSync as Xo,readFileSync as fg1,rmSync as ug1,writeFileSync as HS0}from"node:fs";import{homedir as ZS0}from"node:os";import{dirname as XS0,join as Cq}from"node:path";function Zo(){return qS0["SKILL.md"]||""}function VS0($){return $.match(/^\s*version:\s*(\S+)\s*$/m)?.[1]}function LS0($=Cq(fU(),"SKILL.md")){try{return VS0(fg1($,"utf8"))}catch{return}}function fU(){return Cq(ZS0(),".agents","skills","seal-use")}function ig1(){return Cq(ZS0(),".agents","skills","seal-home")}function cg1(){let $=ig1();if(xg1($))try{return ug1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function FS0($=fU()){cg1(),Xo($,{recursive:!0});let Y=[];for(let[z,U]of Object.entries(qS0)){let Q=Cq($,z);Xo(XS0(Q),{recursive:!0}),HS0(Q,U,"utf8"),Y.push(z)}for(let[z,U]of Object.entries(bg1)){let Q=Cq($,z);Xo(XS0(Q),{recursive:!0}),HS0(Q,U),Y.push(z)}return{targetDir:$,files:Y}}var qS0,bg1,i24;var Rq=o(()=>{Yo();Yo();Ho();qS0=eh0,bg1=Object.fromEntries(Object.entries($S0).map(([$,Y])=>[$,Buffer.from(Y,"base64")]));i24=VS0(Zo())});function wS0(){return`# Seal Use 系统架构与运行规范白皮书
|
||||
`;var IS0=()=>{};var xg1="iVBORw0KGgoAAAANSUhEUgAADVgAAAdwCAYAAACUWcTmAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAANWKADAAQAAAABAAAHcAAAAAD4n9OGAABAAElEQVR4AeydB4AdVfX/z246pNAD0hK6dOki0rsU+dMJJVIFRYoUFUFAQUCqgHSkxx8gTRCpFkB6CU06SQi9BEhC+u7/fu7b83J3dt7bt33f5nuStzNz5947M583c+fOvPO9p6Y+mMlEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4kUDsHHrMOWQREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAQigd7jxo8TChEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYIwkogtUc+bXroEVABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABERABCBQUx9MKERABERABERABERABERABERABERABERABERABERABERABERABESgqwiMHz/eBgwY0FWb13ZFQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQATmcAKKYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwlIYDUnf/s6dhEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYwwlIYDWHnwA6fBEQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQAREQARGYkwn0npMPXscuAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAj2RwP8+n26vfjbd3vpyho2fPN0+mjLTJs+qs/qaOhvYp8YWGtDLFh/U25YZ3NdWnr+/rTDvgJ6IQcckAhURqKkPVlFOZRIBERABERABERABERABERABERABERABERABERABERABERABERCBDiAwfvx4GzBAP9p2AFpVKQIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiMIcR+GhSnT347lT713tT7eOpM4OYqj5+LEzNEFdZ+MyKU5Zr4jLp9fat/r1ss28NtM0WG2KLzN1nDiOnw53TCUhgNaefATp+ERABERABERABERABERABERABERABERABERABERABERABEehiAhJYdfEXoM2LgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAhUPYFJ08z+7+Updsc7U8OxFARURKqyIKAqCKnqbVYQUdU2CK7iOiuIr4oirLBcgxArfHZZcrDttcwCNnefXlXPRgcgApUQkMCqEkrKIwIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0GEEJLDqMLSqWAREQAREQAREQAREQAREQAREQAREQAREQAREQAREYA4g8MR7M+2Cp6fY5JmFSFQhRlUQStUVBVUsF0VUCKiSSFZEsKqLkawa5yH/oN5mP195qK0/dPAcQFGHOKcTkMBqTj8DdPwiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIi0MUEJLDq4i+gCzY/ZcqUuNUBAwZ0wda1SREQAREQAREQAREQAREQAREQAREQAREQAREQARHoHAKd8S501AszbNT/psXIUwWhVDi2IK6qj5GriGRVEE4RlSoVWlUayYry+w2fx0Yst1DnQNNWRKCLCAQ9oUwEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKCaCFz035n20JgZ1stqQowqs9qaWmJVBR1VbRBZkdLLakN0qiCzCtMGgVXMURfW1YQsTHsFEdasMC0UCSWjOIvcbte++6V9MX2mHb7ytzypS6e/+93v7H//+1/uPuy888727W9/O35yMyhRBEoQ4NyXiYAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiECPIXDbbbfZiBEjGh0PP7aSxif90dXzks68G3k8P2VTYznNm67TvAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BoGLHp1lD74zM6qh6kK4qprwqW+YMl9TR1pYHcRWtUFHhZaqLi6TFsJbhflCOYRVtbG818H6+KGOhnr+9v4ku/DlDzrj0Mpug/fz6Xv+bOa//vWvxkcmAi0loAhWLSWm/CIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAt2WAD+sdvQPp/xwy0cjYHbb00A7JgIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAI9msCo5+rt4XdDVKoaIlfVxChVHHCMPtXoyIO4KuSoy0ayqifOFeWJUxVqSCJZfW/hwfbox1/FuqiKHF4zIqt5+39qey+zYEztij/pbwC8p0/NhVc+TddpXgSaIyCBVXOEtF4EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAERKBqCLz66qudtq/8iPvrX/+607aX3VBniMluvPHG7Ga1LAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiIAIiUIJAzT+vi2vqN9m3RA4li0DbCTw5xuyWl+qMIFQWIk8Rpqo+Cq1YDlKokL7m4v2D7IrFOgurwvqwoiaEsIpyKebNHv9wki+FdERaSKlq7fytlrEj73vLHvvoq7gNUkM4q1BPKBTque7tCbbUoH62/tDBrOkyQ1yVfUf/u9/9rmx0qy7b2VZu2H8H4FhXXHFF+3//7/+1siYVq4RATX2wSjIqjwiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAh0BIHx48fbgAEDOqLqHlun/6ja0QfYUQKrKVOmxF3X997R36DqFwEREAEREAEREAEREAEREAEREAEREAER6EwCs074btxcr9Me78zNalvdmEB7vwudNM3ssFvNJs2oi0KqWUE0FQVUUUiF6KreLtx5QVtt0X5lqYz+cIodevfYkKcg1KpHfBXKHvadobbvdxay0R9NsgPveyOsD3KTWiQniLjCNHyYDgqhfq7bcCmbu0+vsttpy0rEUlgqLErfje+8885NBEepwMrXE83Ko16ldbVl3zqjbHqsvj0EZdmoXb5O07YTUASrtjNUDSIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiIgAiLQqQQ6M1JXpx5YD96Yj3sZR3ntwcdZyaHNmDHDPv74Y1t00UULo95WUqiL8syaNct69eo4J5EuOqwu3Szff58+fZrsg66RJkiU0MkEGJ4YhzSZCHQmAdpEjHtNbW0Ydb4djHvX9OnTNYBBA0ucWfv169dufNvhK+oxVUydOtXq6upsrrnm6jHHpAMRAREQAREQgbYS8OhV1FN/1VFWc8B5ba2yWJ6+45gxY+ytt96y/v3729JLL22LLbZYbj+H9y4u6ilWUGJm7rnntgUXXDCu/frrr+2LL74okbNxMv3XJZZYonFia5fGjLaad0e3tnSx3JwSNezmZ2ts8vQQTSr8C9KoOA2Sp8ChJvyttQPXG9SsuMqh1VEslIviqTBdf5G5o7iK1NUWHmg/XW1Ru/iF960+aK8QVbE1j2SFwOumtz6zg749lOztbqlQygVSCIuYL2cIqDwPoirepfsy5ZgnLRv5qlydXbUu73cAjqka9h1mCMSw1kbdamv5uPEW/pHAqoXAlF0EREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEREAEuppA+oNwR0WZ6upj7Enbf+ONN+yUU06Jh3Tsscfa6quv3pMOLx7Lhx9+aMcff3yc33vvvW3LLbfMPcZbbrnF7rjjjrjuF7/4ha2yyiq5+dLEyZMn24QJE2zhhRe23r1720svvWTnn39+zPLLX/7SlllmmTR77jyORb/61a/iuv3339++973v5eZLE99++2076aSTbNlll7UtttiiojJp+WqZHz16dBQ84XziNnPmTPv00099sUVTHLMGDx6cW2bcuHHRAWSzzTazHXfc0eaZZ56Y7/HHH7eLLroozh933HG21FJL2Zlnnmm77LJLm6+Xb775xr766qvc/ckmzjvvvNFJLZveluWzzz7b3nrzTVty2DDjfG2JTZs2ze677z7bZpttGonSvvzyy4od5bLb4zqqJqHnxxNmWcHZK3skLV/u16fG5huUL2B5cPRUO
Line truncated
|
||||
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"created"};let Q={};try{Q=JSON.parse(XS0(z,"utf8"))}catch{Q={entries:[]}}if(!Array.isArray(Q.entries))Q.entries=[];if(Q.entries.findIndex((I)=>I&&typeof I.path==="string"&&I.path===Y)!==-1)return{detected:U,configured:!0,configPath:z,targetDir:Y,action:"already_present"};let K=Q.entries.findIndex((I)=>I&&typeof I.path==="string"&&(I.path==="~/.agents/skills"||I.path==="~/.agents/skills/"));if(K!==-1)return Q.entries[K]={...Q.entries[K],path:Y},Jo(z,JSON.stringify(Q,null,2)+`
|
||||
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"updated_tilde"};return Q.entries.unshift({path:Y}),Jo(z,JSON.stringify(Q,null,2)+`
|
||||
`,"utf8"),{detected:U,configured:!0,configPath:z,targetDir:Y,action:"prepended"}}function Go($){let Y=$?.targetSkillsDir??ZS0(),z=$?.configFile??qS0(),U=VS0(),Q=!1;if(Eq(z))try{let J=JSON.parse(XS0(z,"utf8"));if(Array.isArray(J?.entries))Q=J.entries.some((K)=>K?.path===Y)}catch{}return{detected:U,configured:Q,configPath:z,targetDir:Y}}var Wo=()=>{};import{cpSync as dg1,existsSync as iI,lstatSync as FS0,mkdirSync as mg1,realpathSync as YY,rmSync as lg1,symlinkSync as og1,unlinkSync as LS0}from"node:fs";import{homedir as MS0}from"node:os";import{dirname as wS0,join as zY}from"node:path";function rg1($,Y){let z=Y?.baseHomeDir??MS0(),U=zY(z,$.rootDirName),Q=Y?.sourceSkillDir??zY(z,".agents","skills","seal-use"),J=wS0(Q),K=zY(U,"skills"),I=zY(K,"seal-use");if(!iI(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"skipped_not_detected"};if(iI(K)&&iI(J))try{if(YY(K)===YY(J))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:K}}catch{}mg1(K,{recursive:!0});let G;try{G=FS0(I)}catch{G=void 0}let W=!1;if(G)if(G.isSymbolicLink()){try{if(YY(I)===YY(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"already_linked",targetPath:I}}catch{}try{LS0(I)}catch{}}else if(G.isDirectory())lg1(I,{recursive:!0,force:!0}),W=!0;else LS0(I);let H=process.platform==="win32"?"junction":"dir";try{return og1(Q,I,H),{id:$.id,name:$.name,detected:!0,configured:!0,mode:W?"replaced_real_dir":"linked",targetPath:I}}catch{try{return dg1(Q,I,{recursive:!0}),{id:$.id,name:$.name,detected:!0,configured:!0,mode:"fallback_copied",targetPath:I}}catch(X){return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"error",targetPath:I,error:X?.message||String(X)}}}}function sg1($,Y){let z=Y?.baseHomeDir??MS0(),U=zY(z,$.rootDirName),Q=Y?.sourceSkillDir??zY(z,".agents","skills","seal-use"),J=wS0(Q),K=zY(U,"skills"),I=zY(K,"seal-use");if(!iI(U))return{id:$.id,name:$.name,detected:!1,configured:!1,mode:"not_detected"};if(iI(K)&&iI(J))try{if(YY(K)===YY(J))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"parent_symlinked",targetPath:K}}catch{}let G;try{G=FS0(I)}catch{G=void 0}if(G){if(G.isSymbolicLink())try{if(YY(I)===YY(Q))return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"single_symlinked",targetPath:I}}catch{}else if(G.isDirectory())return{id:$.id,name:$.name,detected:!0,configured:!0,mode:"real_directory",targetPath:I}}return{id:$.id,name:$.name,detected:!0,configured:!1,mode:"not_configured",targetPath:I}}function Ho($){return OS0.map((Y)=>rg1(Y,$))}function Xo($){return OS0.map((Y)=>sg1(Y,$))}var OS0;var Zo=m(()=>{OS0=[{id:"workbuddy",name:"WorkBuddy",rootDirName:".workbuddy"},{id:"claude",name:"Claude",rootDirName:".claude"},{id:"qoder",name:"Qoder",rootDirName:".qoder"}]});var qo=m(()=>{Wo();Zo();Wo();Zo()});import{existsSync as ag1,mkdirSync as Vo,readFileSync as tg1,rmSync as eg1,writeFileSync as NS0}from"node:fs";import{homedir as AS0}from"node:os";import{dirname as DS0,join as Rq}from"node:path";function Lo(){return BS0["SKILL.md"]||""}function PS0($){return $.match(/^\s*version:\s*(\S+)\s*$/m)?.[1]}function TS0($=Rq(uU(),"SKILL.md")){try{return PS0(tg1($,"utf8"))}catch{return}}function uU(){return Rq(AS0(),".agents","skills","seal-use")}function Yy1(){return Rq(AS0(),".agents","skills","seal-home")}function zy1(){let $=Yy1();if(ag1($))try{return eg1($,{recursive:!0,force:!0}),!0}catch{return!1}return!1}function jS0($=uU()){zy1(),Vo($,{recursive:!0});let Y=[];for(let[z,U]of Object.entries(BS0)){let Q=Rq($,z);Vo(DS0(Q),{recursive:!0}),NS0(Q,U,"utf8"),Y.push(z)}for(let[z,U]of Object.entries($y1)){let Q=Rq($,z);Vo(DS0(Q),{recursive:!0}),NS0(Q,U),Y.push(z)}return{targetDir:$,files:Y}}var BS0,$y1,UY4;var _q=m(()=>{Qo();Qo();qo();BS0=WS0,$y1=Object.fromEntries(Object.entries(HS0).map(([$,Y])=>[$,Buffer.from(Y,"base64")]));UY4=PS0(Lo())});function ES0(){return`# Seal Use 系统架构与运行规范白皮书
|
||||
|
||||
> 本文档由 \`seal-use\` 单文件二进制程序内嵌提供,纯内存只读,未向用户电脑写入任何临时文件。
|
||||
|
||||
@@ -2522,14 +2526,14 @@ metadata:
|
||||
|
||||
| 目录名称 | 类别 | 规范路径 | 作用与生命周期 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
${qo.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
|
||||
${Fo.map(($)=>`| **${$.name}** | \`${$.category}\` | \`${$.standardPath}\` | ${$.purpose} (${$.retention}) |`).join(`
|
||||
`)}
|
||||
|
||||
---
|
||||
|
||||
## 3. 安全与数据隐私保证
|
||||
|
||||
${Vo.map(($,Y)=>`### 3.${Y+1} ${$.topic}
|
||||
${Mo.map(($,Y)=>`### 3.${Y+1} ${$.topic}
|
||||
- **安全承诺**:${$.guarantee}
|
||||
- **实现约束**:${$.enforcement}
|
||||
`).join(`
|
||||
@@ -2539,7 +2543,7 @@ ${Vo.map(($,Y)=>`### 3.${Y+1} ${$.topic}
|
||||
|
||||
## 4. 业务域能力图谱
|
||||
|
||||
${Lo.map(($)=>`### \`seal-use ${$.domain}\`
|
||||
${wo.map(($)=>`### \`seal-use ${$.domain}\`
|
||||
* **能力定位**:${$.summary}
|
||||
* **核心命令**:${$.primaryCommands.map((Y)=>`\`seal-use ${Y}\``).join("、")}
|
||||
`).join(`
|
||||
@@ -2552,14 +2556,14 @@ ${Lo.map(($)=>`### \`seal-use ${$.domain}\`
|
||||
- **环境自检**:运行 \`seal-use doctor\`,一键检查当前运行时版本、本地目录健康度、企业资产接入数量以及守护服务状态。
|
||||
- **查看企业配置源文件**:运行 \`seal-use corps get <corpId>\`,可直接查看指定企业的本地 JSON 存储绝对路径。
|
||||
- **查阅完整操作手册**:运行 \`seal-use doctor guide\` 随时在离线状态下查看本文档。
|
||||
`}var qo,Vo,Lo;var Fo=o(()=>{qo=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;旧版 seal-home 命令仅保留解析兼容,不再新建全局别名。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Vo=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],Lo=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、单据直达链接与免登",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs link"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合
Line truncated
|
||||
`)}var AS0=o(()=>{Mp();$3();k3();Rq();cB();Fo()});var BS0={};N8(BS0,{formatTenantDoctorDashboard:()=>rg1,diagnoseTenantContract:()=>og1});async function og1($,Y){let z=[],U=Y.environment==="test"?"test":"production",Q=U==="test"?Y.prodCorpId:Y.testCorpId,J=U==="test"?"prodParent":"testTarget",K=Q?U==="test"?"已绑定生产母企业 (上游配置与样本源)":"已绑定测试靶场 (下游隔离演练环境)":void 0,I=null,G=null;try{let w=await T8($);if(I=w.user,G=w.tenant,Boolean(I?.isAdmin||I?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${I.name??"未知"}」(${I.id??""}),具备完整操作权限`,details:{userId:I.id,userName:I.name,isAdmin:!0,permissionLevel:"超级管理员(具备完整操作权限)",tenantName:G?.name,tenantSlug:G?.tenantSlug,permissions:I.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${I.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:I.id,userName:I.name,isAdmin:!1,permissionLevel:"普通用户(部分管理配置受限)",tenantName:G?.name,permissions:I.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(w){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let W={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},H={used:0,remaining:0};try{let w=await mY($),N=Array.isArray(w.features)?w.features:[],O=N.find((P)=>P?.code==="ai-approval");if(O){let P=typeof O.balance==="number"?O.balance:0,T=typeof O.deductionAmount==="number"&&O.deductionAmount>0?O.deductionAmount:120,A=Math.floor(P/T);if(W.balance=P,W.deductionAmount=T,W.estimatedRuns=A,P<=0)W.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`请前往后台充值补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else if(A<10)W.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${P} 点 (单笔扣除 ${T} 点),仅可支持约 ${A} 笔审核`,details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`建议补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else W.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${P} 点,预估可支持 ${A} 笔审核单据`,details:{balance:P,deductionAmount:T,estimatedRuns:A}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:N.map((P)=>P?.code)}});let D=N.find((P)=>P?.code==="approval-rules");if(D)H.used=typeof D.used==="number"?D.used:0,H.remaining=typeof D.remaining==="number"?D.remaining:0}catch(w){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let X={totalCount:0,activeCount:0,quotaUsed:H.used,quotaRemaining:H.remaining};try{let w=await p6($),N=Array.isArray(w.rules)?w.rules:[];if(X.totalCount=N.length,X.activeCount=N.filter((O)=>O.status==="ACTIVE").length,N.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${X.totalCount} 条规则,其中生效活跃 ${X.activeCount} 条`,details:{totalCount:X.totalCount,activeCount:X.activeCount,quotaUsed:H.used,quotaRemaining:H.remaining}})}catch(w){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${w instanceof Error?w.message:String(w)}`,details:{error:String(w)}})}let Z={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let w=await J$($);Z.integrationCount=w.length;let N=w.find((O)=>O.name.includes("回放")||O.name.toLowerCase().includes("replay"));if(Z.hasReplayChannel=Boolean(N),Z.activeWebhookId=N?.id??w[0]?.id,w.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:"未配置任何 Webhook 集成通道 (日常审批无影响;若需自动化系统推流或单据重放将
Line truncated
|
||||
`)}var PS0=o(()=>{A6()});async function TS0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
|
||||
`),console.log(wS0());return}if(U==="paths"||U==="dirs"||U==="directories"){let K=wo();f0(K.directories);return}if(U==="auth"){let{selectCorp:K}=await Promise.resolve().then(() => (f4(),hl)),{stringOption:I}=await Promise.resolve().then(() => (D4(),Rl)),{handleAuthCommand:G}=await Promise.resolve().then(() => ($o(),Hh0)),W=I(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),H=K(W);await G("check",H,z);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:K}=await Promise.resolve().then(() => (f4(),hl)),{createSealClient:I}=await Promise.resolve().then(() => (Q$(),f00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),Rl)),{diagnoseTenantContract:W,formatTenantDoctorDashboard:H}=await Promise.resolve().then(() => (PS0(),BS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=K(X),q=await I(Z),V=await W(q,Z);if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(H(V));f0(V);return}let Q=wo();if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(DS0(Q));f0(Q)}var jS0=o(()=>{AS0();Fo();D4();I4()});var CS0;var ES0=o(()=>{CS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.35",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],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","x-implementation-status":"implemented",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","x-implementation-status":"planned",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","x-implementation-status":"planned",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","x-implementation-status":"planned",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 sta
Line truncated
|
||||
`}var Fo,Mo,wo;var Oo=m(()=>{Fo=[{name:"配置与状态根目录",category:"config",standardPath:"~/.config/seal-use",purpose:"用户本地持久化配置根目录,存放企业连接元数据、会话缓存与全局状态。",accessMode:"read-write",retention:"persistent"},{name:"企业配置文件目录",category:"config",standardPath:"~/.config/seal-use/enterprises",purpose:"存放各已添加企业的配置 JSON 文件(如 xiezihao.json),存储企业域名、脱敏 Token、员工绑定关系等。",accessMode:"read-write",retention:"persistent"},{name:"全局配置文件",category:"config",standardPath:"~/.config/seal-use/config.json",purpose:"维护全局工作模式(stateful/stateless)、默认激活企业 defaultCorpId 以及 Lint 偏好。",accessMode:"read-write",retention:"persistent"},{name:"会话凭据安全缓存",category:"config",standardPath:"~/.config/seal-use/seal_tokens.json",purpose:"缓存已认证租户的 Bearer Token 与过期时间戳,避免高频调用上游 OAuth 换票接口。",accessMode:"read-write",retention:"cache"},{name:"规则版本映射快照",category:"config",standardPath:"~/.config/seal-use/mappings",purpose:"存储 corps sync-test 生成的生产与测试规则版本/编号对照映射快照,供 rules map 离线毫秒级速查。",accessMode:"read-write",retention:"persistent"},{name:"后台守护服务日志",category:"config",standardPath:"~/.config/seal-use/service.log",purpose:"常驻后台 HTTP 服务守护进程运行输出日志。",accessMode:"read-write",retention:"persistent"},{name:"全局命令行程序",category:"binary",standardPath:"/opt/homebrew/bin/seal-use",purpose:"macOS / Linux 全局独立单文件二进制程序;旧版 seal-home 命令仅保留解析兼容,不再新建全局别名。",accessMode:"executable",retention:"persistent"},{name:"AI Agent 技能主目录",category:"skill",standardPath:"~/.agents/skills/seal-use",purpose:"面向 Antigravity、Codex 等 AI 智能体的标准技能目录,包含 SKILL.md、参考文档与操作规程。",accessMode:"read-write",retention:"persistent"},{name:"报表默认导出目录",category:"export",standardPath:"~/Downloads",purpose:"执行 approval-runs export 等大盘报表命令且未指定 --out 时,默认写入的 Excel 文件路径。",accessMode:"read-write",retention:"persistent"},{name:"系统隔离临时目录",category:"temp",standardPath:"/tmp 或 /var/folders/.../T",purpose:"自动化测试(bun test)生成的隔离工作副本,执行完毕后通过 afterEach 钩子彻底删除,零残留。",accessMode:"transient",retention:"ephemeral"}],Mo=[{topic:"敏感凭据脱敏保护",guarantee:"appSecurity、password 等高危密钥永不回显在 stdout,Session Token 采用掩码处理(如 5oUL...Y%3D)。",enforcement:"CLI 所有展示接口(corps get、corps list、probe 等)均经 formatSafeSourceDetail 脱敏过滤。"},{topic:"正式环境与测试环境严格隔离",guarantee:"正式企业与测试企业必须严格 1 对 1 下挂,禁止多层级级联绑定;环境标记需显式 --confirm 确认。",enforcement:"corps bind-test 与 mark 强制要求 --confirm,缺少时阻断并返回退出码 10(confirmationRequired)。"},{topic:"跨环境规则同步安全基线",guarantee:"corps sync-test 仅将正式企业偏好与规则覆盖同步至测试企业并自动发布,正式企业规则严格维持草稿态永不发布。",enforcement:"规则同步流水线由 sync-test 独占受控,正式环境端仅执行拉取草稿读取操作,零发版变更。"},{topic:"只读诊断无副作用原则",guarantee:"doctor、search、get、list、context、probe 等命令为严格只读操作,不修改用户本地文件系统,零写入污染。",enforcement:"核心领域函数严格分离 Mutation 操作与 Query 操作,Query 路径杜绝写文件与环境篡改。"}],wo=[{domain:"corps (企业管理)",summary:"多租户接入、智能软搜索、富属性查看、环境标记、测试绑定与配置规则同步",primaryCommands:["corps list","corps search <query>","corps get <corpId>","corps mark","corps bind-test","corps sync-test"]},{domain:"approval-runs (审核大盘)",summary:"AI 审核单据检索、统计分析、引证规则查看、附件全链路追踪、Excel 报表导出、单据直达链接与免登",primaryCommands:["approval-runs list","approval-runs stats","approval-runs get","approval-runs export","approval-runs link"]},{domain:"rules (规则治理)",summary:"审核规则拉取、本地 Lint 质量检查、增量差量推送、离线版本与编号对照映射速查",primaryCommands:["rules pull","rules lint","rules push","rules map","rules count"]},{domain:"preference (决策偏好)",summary:"AI 审核偏好读取与更新、全局与分品类思考深度策略(medium/high)配置",primaryCommands:["preference get","preference decision update","preference thinking-depth set"]},{domain:"simulation (模拟演练)",summary:"合
Line truncated
|
||||
`)}var hS0=m(()=>{Dp();$3();k3();_q();nB();Oo()});var SS0={};N8(SS0,{formatTenantDoctorDashboard:()=>Wy1,diagnoseTenantContract:()=>Gy1});async function Gy1($,Y){let z=[],U=Y.environment==="test"?"test":"production",Q=U==="test"?Y.prodCorpId:Y.testCorpId,J=U==="test"?"prodParent":"testTarget",K=Q?U==="test"?"已绑定生产母企业 (上游配置与样本源)":"已绑定测试靶场 (下游隔离演练环境)":void 0,I=null,G=null;try{let M=await T8($);if(I=M.user,G=M.tenant,Boolean(I?.isAdmin||I?.permissions?.includes("*")))z.push({id:"auth_identity",name:"身份与权限契约",status:"pass",summary:`已认证为管理员「${I.name??"未知"}」(${I.id??""}),具备完整操作权限`,details:{userId:I.id,userName:I.name,isAdmin:!0,permissionLevel:"超级管理员(具备完整操作权限)",tenantName:G?.name,tenantSlug:G?.tenantSlug,permissions:I.permissions}});else z.push({id:"auth_identity",name:"身份与权限契约",status:"warn",summary:`已认证为普通用户「${I.name??"未知"}」,非超级管理员,部分配置操作可能受限`,details:{userId:I.id,userName:I.name,isAdmin:!1,permissionLevel:"普通用户(部分管理配置受限)",tenantName:G?.name,permissions:I.permissions},recommendation:"建议使用具有管理权限的企业主账号执行规则修改与集成发布"})}catch(M){z.push({id:"auth_identity",name:"身份与权限契约",status:"fail",summary:`鉴权握手失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)},recommendation:`请执行 seal-use auth login --corp ${Y.id} 重新登录或更新 Token`})}let W={featureCode:"ai-approval",balance:0,deductionAmount:120,estimatedRuns:0,status:"exhausted"},H={used:0,remaining:0};try{let M=await lY($),O=Array.isArray(M.features)?M.features:[],N=O.find((P)=>P?.code==="ai-approval");if(N){let P=typeof N.balance==="number"?N.balance:0,T=typeof N.deductionAmount==="number"&&N.deductionAmount>0?N.deductionAmount:120,A=Math.floor(P/T);if(W.balance=P,W.deductionAmount=T,W.estimatedRuns=A,P<=0)W.status="exhausted",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"fail",summary:"当前额度已耗尽 (余量 0 点),无法执行审批模拟或回归测试",details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`请前往后台充值补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else if(A<10)W.status="low",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`额度偏低:剩余 ${P} 点 (单笔扣除 ${T} 点),仅可支持约 ${A} 笔审核`,details:{balance:P,deductionAmount:T,estimatedRuns:A},recommendation:`建议补充额度 (可通过 seal-use auth link --corp ${Y.id} 免密直达)`});else W.status="sufficient",z.push({id:"billing_quota",name:"AI 审批额度余量",status:"pass",summary:`额度充裕:剩余 ${P} 点,预估可支持 ${A} 笔审核单据`,details:{balance:P,deductionAmount:T,estimatedRuns:A}})}else z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:"未检索到「ai-approval」功能包额度明细,按默认通道运行",details:{features:O.map((P)=>P?.code)}});let D=O.find((P)=>P?.code==="approval-rules");if(D)H.used=typeof D.used==="number"?D.used:0,H.remaining=typeof D.remaining==="number"?D.remaining:0}catch(M){z.push({id:"billing_quota",name:"AI 审批额度余量",status:"warn",summary:`读取计费状态失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let X={totalCount:0,activeCount:0,quotaUsed:H.used,quotaRemaining:H.remaining};try{let M=await p6($),O=Array.isArray(M.rules)?M.rules:[];if(X.totalCount=O.length,X.activeCount=O.filter((N)=>N.status==="ACTIVE").length,O.length===0)z.push({id:"rules_status",name:"审核规则状态",status:"warn",summary:"当前租户未配置任何审核规则 (规则数为 0)",details:{totalCount:0,activeCount:0},recommendation:U==="test"&&Q?`可运行 seal-use corps sync-test --corp ${Q} 从生产企业同步规则`:"可运行 seal-use rules add 创建基础规则"});else z.push({id:"rules_status",name:"审核规则状态",status:"pass",summary:`审核规则健康:共 ${X.totalCount} 条规则,其中生效活跃 ${X.activeCount} 条`,details:{totalCount:X.totalCount,activeCount:X.activeCount,quotaUsed:H.used,quotaRemaining:H.remaining}})}catch(M){z.push({id:"rules_status",name:"审核规则状态",status:"fail",summary:`拉取规则列表失败:${M instanceof Error?M.message:String(M)}`,details:{error:String(M)}})}let Z={integrationCount:0,hasReplayChannel:!1,activeWebhookId:void 0};try{let M=await K$($);Z.integrationCount=M.length;let O=M.find((N)=>N.name.includes("回放")||N.name.toLowerCase().includes("replay"));if(Z.hasReplayChannel=Boolean(O),Z.activeWebhookId=O?.id??M[0]?.id,M.length===0)z.push({id:"webhook_integrations",name:"单据推送 Webhook 通道",status:"pass",summary:"未配置任何 Webhook 集成通道 (日常审批无影响;若需自动化系统推流或单据重放将
Line truncated
|
||||
`)}var gS0=m(()=>{A6()});async function yS0($,Y,z){let U=($??Y??"").toLowerCase();if(U==="guide"||U==="doc"||U==="knowledge"||U==="book"){console.error(`\uD83D\uDCD6 [Seal Use Doctor] 正在读取内嵌系统规范白皮书(纯内存只读)...
|
||||
`),console.log(ES0());return}if(U==="paths"||U==="dirs"||U==="directories"){let K=No();f0(K.directories);return}if(U==="auth"){let{selectCorp:K}=await Promise.resolve().then(() => (f4(),yl)),{stringOption:I}=await Promise.resolve().then(() => (D4(),hl)),{handleAuthCommand:G}=await Promise.resolve().then(() => (Uo(),Nh0)),W=I(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),H=K(W);await G("check",H,z);return}if(U==="tenant"||U==="corp"||U==="enterprise"){let{selectCorp:K}=await Promise.resolve().then(() => (f4(),yl)),{createSealClient:I}=await Promise.resolve().then(() => (J$(),i00)),{stringOption:G}=await Promise.resolve().then(() => (D4(),hl)),{diagnoseTenantContract:W,formatTenantDoctorDashboard:H}=await Promise.resolve().then(() => (gS0(),SS0)),X=G(z.options.corp)??(Y&&Y!==U?Y:void 0)??(z.command[2]&&z.command[2]!==U?z.command[2]:void 0),Z=K(X),q=await I(Z),V=await W(q,Z);if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(H(V));f0(V);return}let Q=No();if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(vS0(Q));f0(Q)}var kS0=m(()=>{hS0();Oo();D4();I4()});var fS0;var xS0=m(()=>{fS0={openapi:"3.1.0",info:{title:"seal-use Wrapped API",version:"0.10.35",description:"HTTP contract for the seal-use wrapped backend API, served by the local HTTP adapter\n(`seal-use http`, or the `seal-use service start` daemon; default http://127.0.0.1:8787).\n\nThese endpoints describe the stable wrapped API for frontend developers and agents. They are\nnot the raw downstream Seal endpoints: seal-use is responsible for enterprise selection,\nsource authentication, response compaction, and diagnostics-friendly fields.\n\nEvery operation declares `x-implementation-status`, so a caller can tell what the running\nadapter actually serves:\n\n- `implemented` — routed by `src/http/routes.ts` today. `src/http/openapi-implementation.test.ts`\n fails when an `implemented` operation has no matching route.\n- `planned` — contract-only, designed but not routed yet. Calling it returns 404.\n\nThe same capabilities are reachable through the CLI, and through the optional MCP server when\nit is enabled.\n"},servers:[{url:"http://localhost:8787",description:"Local HTTP adapter (`seal-use http`, or the `seal-use service start` daemon). Loopback-only by default."}],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","x-implementation-status":"implemented",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","x-implementation-status":"planned",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","x-implementation-status":"planned",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","x-implementation-status":"planned",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 sta
Line truncated
|
||||
the credentials already stored on this machine for the selected enterprise. Keep it bound
|
||||
to loopback (\`--host 127.0.0.1\`) and do not expose the port to a network or an origin you
|
||||
do not control.
|
||||
`}},parameters:{CorpId:{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."},Offset:{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},Limit:{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},RuleId:{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."},VersionId:{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."},DocumentId:{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."},RecordId:{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."},BatchId:{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}},responses:{BadRequest:{description:"Invalid request.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},Unauthorized:{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:{}}}}}},NotFound:{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}},schemas:{ErrorResponse:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}},CorpSummary:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}},SwitchCorpRequest:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}},SwitchCorpResponse:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}},SourceConfig:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."},AuthStage:{type:"object",additionalProperties:!0,required:["name","ok"],properties:{name:{type:"string",examples:["hose.openapi","hose.provisional","seal.sso","seal.whoami"]},ok:{type:"boolean"},error:{type:"string"}}},AuthDiagnosis:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}},SealUser:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},tenantId:{type:"string"},name:{type:"string"},isAdmin:{type:"boolean"},permissions:{type:"array",items:{type:"string"}}}},SealTenant:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},name:{type:"string"},tenantSlug:{type:"string"}}},WhoamiResponse:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}},SessionResponse:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}},ApprovalRule:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}},ApprovalRuleInput:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulePatch:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulesResponse:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}},RuleSetVersion:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}},PublishRuleVersionRequest:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}},ApprovalDocument:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},t
Line truncated
|
||||
`}},parameters:{CorpId:{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."},Offset:{name:"offset",in:"query",schema:{type:"integer",minimum:0,default:0},description:"Zero-based pagination offset."},Limit:{name:"limit",in:"query",schema:{type:"integer",minimum:1,maximum:100,default:50},description:"Maximum number of records to return."},RuleId:{name:"ruleId",in:"path",required:!0,schema:{type:"string"},description:"Approval rule ID."},VersionId:{name:"versionId",in:"path",required:!0,schema:{type:"string"},description:"Published rule version ID."},DocumentId:{name:"documentId",in:"path",required:!0,schema:{type:"string"},description:"Approval knowledge document ID."},RecordId:{name:"recordId",in:"path",required:!0,schema:{type:"string"},description:"seal-use approval run record ID."},BatchId:{name:"batchId",in:"path",required:!0,schema:{type:"string"},description:"Simulation batch ID."}},responses:{BadRequest:{description:"Invalid request.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}},Unauthorized:{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:{}}}}}},NotFound:{description:"Requested resource was not found.",content:{"application/json":{schema:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}}}}}},schemas:{ErrorResponse:{type:"object",additionalProperties:!0,required:["error"],properties:{error:{type:"string"},message:{type:"string"},details:{}}},CorpSummary:{type:"object",required:["id","name","sourceType","current"],properties:{id:{type:"string"},name:{type:"string"},sourceType:{type:"string",enum:["hose","direct","seal"]},current:{type:"boolean"}}},SwitchCorpRequest:{type:"object",required:["corpId"],properties:{corpId:{type:"string"}}},SwitchCorpResponse:{type:"object",required:["current","id","name"],properties:{current:{type:"boolean"},id:{type:"string"},name:{type:"string"}}},SourceConfig:{type:"object",additionalProperties:!0,description:"Redacted Seal enterprise config resolved from the configured source."},AuthStage:{type:"object",additionalProperties:!0,required:["name","ok"],properties:{name:{type:"string",examples:["hose.openapi","hose.provisional","seal.sso","seal.whoami"]},ok:{type:"boolean"},error:{type:"string"}}},AuthDiagnosis:{type:"object",required:["stages"],properties:{stages:{type:"array",items:{$ref:"#/components/schemas/AuthStage"}}}},SealUser:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},tenantId:{type:"string"},name:{type:"string"},isAdmin:{type:"boolean"},permissions:{type:"array",items:{type:"string"}}}},SealTenant:{type:"object",additionalProperties:!0,required:["id","name"],properties:{id:{type:"string"},name:{type:"string"},tenantSlug:{type:"string"}}},WhoamiResponse:{type:"object",required:["user","tenant"],properties:{user:{$ref:"#/components/schemas/SealUser"},tenant:{$ref:"#/components/schemas/SealTenant"}}},SessionResponse:{type:"object",additionalProperties:!0,required:["user","session"],properties:{user:{$ref:"#/components/schemas/SealUser"},session:{type:"object",additionalProperties:!0}}},ApprovalRule:{type:"object",additionalProperties:!0,required:["id","description","scope","strictness"],properties:{id:{type:"string"},description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]},status:{type:"string"}}},ApprovalRuleInput:{type:"object",required:["description","scope","strictness"],properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulePatch:{type:"object",additionalProperties:!1,properties:{description:{type:"string"},scope:{type:"string"},strictness:{type:"string",enum:["MUST_FOLLOW","SHOULD_FOLLOW","SUGGESTION"]}}},ApprovalRulesResponse:{type:"object",required:["rules"],properties:{rules:{type:"array",items:{$ref:"#/components/schemas/ApprovalRule"}},hasPendingDeletes:{type:"boolean"}}},RuleSetVersion:{type:"object",additionalProperties:!0,required:["id","versionNumber","versionName","rules"],properties:{id:{type:"string"},versionNumber:{type:"integer"},versionName:{type:"string"},publishedByName:{type:"string"},rules:{type:"array",items:{type:"object",additionalProperties:!0}}}},PublishRuleVersionRequest:{type:"object",required:["versionName"],properties:{versionName:{type:"string"}}},ApprovalDocument:{type:"object",additionalProperties:!0,required:["id","title","content"],properties:{id:{type:"string"},t
Line truncated
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
@@ -2583,23 +2587,23 @@ do not control.
|
||||
src="https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.101/dist/browser/standalone.js"
|
||||
></script>
|
||||
</body>
|
||||
</html>`}var vS0=o(()=>{$3()});import{URL as ag1}from"node:url";async function _6($,Y,z,U){let Q=$.handler;return Q(Y,z,{corp:U})}async function hS0($,Y){if(Y.setHeader("Access-Control-Allow-Origin","*"),Y.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),Y.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){Y.writeHead(204),Y.end();return}let z=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",Q=new ag1($.url||"/",`${U}://${z}`),J=Q.pathname.replace(/\/+$/,"")||"/",K=($.method||"GET").toUpperCase();try{if(K==="GET"&&J==="/"){A4(Y,200,{name:"seal-use",version:Z1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(K==="GET"&&J==="/docs"){eg1(Y,200,_S0());return}if(K==="GET"&&J==="/openapi.json"){A4(Y,200,gT());return}if(K==="GET"&&J==="/health"){A4(Y,200,{status:"ok",version:Z1,name:"seal-use",timestamp:new Date().toISOString()});return}if(K==="POST"&&(J==="/shutdown"||J==="/api/shutdown")){A4(Y,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(K==="POST"&&J==="/api/cli"){let I=await kT($),G=(typeof I?.command==="string"?I.command:"").trim();if(!G){yT(Y,400,"Missing 'command' property in request body");return}let W=_q(G),H=W[0]==="seal-use"||W[0]==="seal-home"||W[0]?.endsWith("/seal-use")||W[0]?.endsWith("/seal-home")?W.slice(1):W,X=await vq(H),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}A4(Y,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(K==="POST"&&J.startsWith("/api/tool/")){let I=J.slice(10).trim(),G=w6(I);if(!G){yT(Y,404,`Tool not found: '${I}'`);return}let W=await kT($)||{},H=k8($,Q,W),X=j1(H),Z=await P1(X),q={...W};delete q.corp;let V=await _6(G,Z,q,X);A4(Y,200,V);return}if(J.startsWith("/v1/")){if(await tg1($,Y,K,J,Q))return}yT(Y,404,`Cannot ${K} ${J}. Visit /docs for available endpoints.`)}catch(I){let G=I instanceof Error?I.message:String(I);yT(Y,500,G)}}async function tg1($,Y,z,U,Q){let J=Object.fromEntries(Q.searchParams.entries());if(z==="GET"&&U==="/v1/corps"){let K=r8(),I=_4();return A4(Y,200,{count:K.length,mode:I.stateful?"stateful":"stateless",defaultCorpId:I.defaultCorpId,corps:K.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(z==="GET"&&U==="/v1/whoami"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_whoami"),H=await _6(W,G,{},I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/session"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_session_get"),H=await _6(W,G,{},I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/summary"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_approval_runs_summary"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/stats"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_approval_runs_stats"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/pick"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_approval_run_pick"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/url"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_approval_run_url_get"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(U.startsWith("/v1/approval-runs/")){let K=U.slice(18).split("/"),I=K[0],G=K[1];if(I&&!["summary","pick","stats","url","bridge"].includes(I)){let W=k8($,Q,J),H=j1(W),X=await P1(H);if(!G){let Z=w6("seal_approval_run_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="attachments"){let Z=w6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="cited-rules"){let Z=w6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="document-summary"){let Z=w6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="result"){let Z=w6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}}}if(z==="GET"&&U==="/v1/approval-runs"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_approval_runs_search"),H=await _6(W,G,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval/rules"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_approval_rules_list"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/simulation/batches"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=w6("seal_simulation_batches_list"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="POST"&&U==="/v1/simulation/create-batchLine truncated
|
||||
</html>`}var iS0=m(()=>{$3()});import{URL as Xy1}from"node:url";async function _6($,Y,z,U){let Q=$.handler;return Q(Y,z,{corp:U})}async function cS0($,Y){if(Y.setHeader("Access-Control-Allow-Origin","*"),Y.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, PATCH"),Y.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization, X-Seal-Corp, X-Seal-Home-Session"),$.method==="OPTIONS"){Y.writeHead(204),Y.end();return}let z=$.headers.host||"localhost",U=$.headers["x-forwarded-proto"]||"http",Q=new Xy1($.url||"/",`${U}://${z}`),J=Q.pathname.replace(/\/+$/,"")||"/",K=($.method||"GET").toUpperCase();try{if(K==="GET"&&J==="/"){A4(Y,200,{name:"seal-use",version:Z1,description:"Seal tenant operations and approval automation HTTP API",docs:"/docs",openapi:"/openapi.json",health:"/health",endpoints:{cli:"POST /api/cli",tools:"GET /api/tools",toolInvoke:"POST /api/tool/:name",restV1:"GET/POST /v1/*"}});return}if(K==="GET"&&J==="/docs"){qy1(Y,200,bS0());return}if(K==="GET"&&J==="/openapi.json"){A4(Y,200,yT());return}if(K==="GET"&&J==="/health"){A4(Y,200,{status:"ok",version:Z1,name:"seal-use",timestamp:new Date().toISOString()});return}if(K==="POST"&&(J==="/shutdown"||J==="/api/shutdown")){A4(Y,200,{success:!0,message:"Shutting down seal-use background daemon",pid:process.pid}),setTimeout(()=>{process.kill(process.pid,"SIGTERM")},50);return}if(K==="POST"&&J==="/api/cli"){let I=await xT($),G=(typeof I?.command==="string"?I.command:"").trim();if(!G){kT(Y,400,"Missing 'command' property in request body");return}let W=vq(G),H=W[0]==="seal-use"||W[0]==="seal-home"||W[0]?.endsWith("/seal-use")||W[0]?.endsWith("/seal-home")?W.slice(1):W,X=await hq(H),Z=void 0;try{if(X.stdout.trim().startsWith("{")||X.stdout.trim().startsWith("["))Z=JSON.parse(X.stdout)}catch{}A4(Y,X.isError?400:200,{success:!X.isError,stdout:X.stdout,stderr:X.stderr,exitCode:X.exitCode,data:Z});return}if(K==="POST"&&J.startsWith("/api/tool/")){let I=J.slice(10).trim(),G=M6(I);if(!G){kT(Y,404,`Tool not found: '${I}'`);return}let W=await xT($)||{},H=k8($,Q,W),X=j1(H),Z=await P1(X),q={...W};delete q.corp;let V=await _6(G,Z,q,X);A4(Y,200,V);return}if(J.startsWith("/v1/")){if(await Zy1($,Y,K,J,Q))return}kT(Y,404,`Cannot ${K} ${J}. Visit /docs for available endpoints.`)}catch(I){let G=I instanceof Error?I.message:String(I);kT(Y,500,G)}}async function Zy1($,Y,z,U,Q){let J=Object.fromEntries(Q.searchParams.entries());if(z==="GET"&&U==="/v1/corps"){let K=s8(),I=_4();return A4(Y,200,{count:K.length,mode:I.stateful?"stateful":"stateless",defaultCorpId:I.defaultCorpId,corps:K.map((G)=>({id:G.id,name:G.name,sourceType:G.source.type,sealUrl:G.seal?.url}))}),!0}if(z==="GET"&&U==="/v1/whoami"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_whoami"),H=await _6(W,G,{},I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/session"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_session_get"),H=await _6(W,G,{},I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/summary"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_approval_runs_summary"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/stats"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_approval_runs_stats"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/pick"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_approval_run_pick"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval-runs/url"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_approval_run_url_get"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(U.startsWith("/v1/approval-runs/")){let K=U.slice(18).split("/"),I=K[0],G=K[1];if(I&&!["summary","pick","stats","url","bridge"].includes(I)){let W=k8($,Q,J),H=j1(W),X=await P1(H);if(!G){let Z=M6("seal_approval_run_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="attachments"){let Z=M6("seal_approval_run_attachments_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="cited-rules"){let Z=M6("seal_approval_run_cited_rules_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="document-summary"){let Z=M6("seal_approval_run_document_summary_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}if(G==="result"){let Z=M6("seal_approval_run_result_get"),q=await _6(Z,X,{recordId:I,...J},H);return A4(Y,200,q),!0}}}if(z==="GET"&&U==="/v1/approval-runs"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_approval_runs_search"),H=await _6(W,G,{...J,limit:J.limit?Number(J.limit):void 0,offset:J.offset?Number(J.offset):void 0,includeBridge:J.includeBridge==="true"},I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/approval/rules"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_approval_rules_list"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="GET"&&U==="/v1/simulation/batches"){let K=k8($,Q,J),I=j1(K),G=await P1(I),W=M6("seal_simulation_batches_list"),H=await _6(W,G,J,I);return A4(Y,200,H),!0}if(z==="POST"&&U==="/v1/simulation/create-batchLine truncated
|
||||
\uD83D\uDE80 seal-use HTTP Server (v${Z1}) started`),console.error(` URL: http://${z}:${Y}`),console.error(` Docs: http://${z}:${Y}/docs`),console.error(` OpenAPI: http://${z}:${Y}/openapi.json`),console.error(` CLI Exec: POST http://${z}:${Y}/api/cli`),console.error(` REST API: http://${z}:${Y}/v1/...
|
||||
`);Q(U)})})}var xT=8787,fT="127.0.0.1";var No=o(()=>{SS0();$3()});async function gS0($){let Y=s0($.options.port)??s0($.options.p),z=h($.options.host)??h($.options.h),U=await uT({port:Y,host:z}),Q=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",Q),process.on("SIGTERM",Q),await new Promise(()=>{})}var yS0=o(()=>{D4();No()});async function kS0($,Y,z,U){if($==="config"||$==="get"){await k0("seal_llm_config_get",Y,z,{},C0(U.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",Y,z,{},C0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var xS0=o(()=>{f4();I4()});async function fS0($,Y){if($==="config"||$==="json"){Do();return}let{startServer:z}=await iS0().then(() => bS0);z()}function Do(){f0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var uS0=o(()=>{I4()});function cS0($){let Y=gT();f0(Y,{...C0($.options),allowFull:!0})}var nS0=o(()=>{Mo();I4()});async function pS0($,Y,z,U){if($==="available"){await k0("seal_permissions_available_list",Y,z,{},C0(U.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",Y,z,{},C0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var dS0=o(()=>{f4();I4()});import{readFileSync as mS0}from"node:fs";async function lS0($,Y,z,U,Q,J,K){if(!$||$==="get"){await k0("seal_preference_get",Q,J,{},C0(K.options));return}if($==="decision"){if(Y==="update"||!Y){let I=h(K.options.input),G=I?JSON.parse(mS0(I,"utf8")):y8(K.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",Q,J,{...G,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(Y==="set"){let I=h(K.options.default)??h(K.options.level)??U;if(I!=="medium"&&I!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",Q,J,{defaultLevel:I,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}if(Y==="policies"){if(z==="list"||!z){await k0("seal_preference_thinking_depth_policies_list",Q,J,{},C0(K.options));return}if(z==="upsert"){let I=h(K.options.input),G=I?JSON.parse(mS0(I,"utf8")):y8(K.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",Q,J,{...G,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}if(z==="remove"||z==="delete"){let I=U??h(K.options.id)??h(K.options.policyId);if(!I)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",Q,J,{policyId:I,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var oS0=o(()=>{f4();D4();I4()});async function rS0($={}){let Y=r8(),z=_4(),U=c2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},g3());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let Q=await uI(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Q,null,2));let J=await P1(U),K=await NM(J,{documentLimit:20,stylePreferencesEndpoint:U.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))}var sS0=o(()=>{k3();Q$();RT();A6()});async function aS0($,Y,z){let U=Y??h(z.options.corp)??($&&$!=="--corp"?$:void 0);await rS0({corpId:U})}var tS0=o(()=>{sS0();D4()});async function Ao($,Y,z,U,Q){if($==="count"){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}if($==="list"){if(Z0(Q.options.count)){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}let J=s0(Q.options.limit),K=s0(Q.options.offset);if(Z0(Q.options.summary)){await k0("seal_approval_rules_list",z,U,{fields:D_0,limit:J,offset:K},C0(Q.options));return}let I=await T5("seal_approval_rules_list",z,U,{limit:J,offset:K}),G=C0(Q.options);A_0(I,G.allowFull===!0||Boolean(G.outputFile)),f0(I,G);return}if($==="clear"){let J=Z0(Q.options.yes)===!0,K=Z0(Q.options.dryRun)??Z0(Q.options["dry-run"])??!J;if(!J&&!K)throw P9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${U.id} --dry-run`);let I=await T5("seal_approval_rules_clear",z,U,{dryRun:K,recode:Z0(Q.options.recode)});if(!J&&K&
Line truncated
|
||||
`).filter(Boolean),J=Q.slice(-Y);return{logFile:z,lines:J,totalLines:Q.length}}async function Jy1($){let Y=nT($),z=To($),U=hq($);Ug0($.stateDir);let Q=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):xT),J=$.host??(process.env.HOST?process.env.HOST:fT);iT(Y,`${process.pid}
|
||||
`,{mode:384}),iT(z,JSON.stringify({pid:process.pid,port:Q,host:J,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),iI(U,`service starting on http://${J}:${Q} pid=${process.pid}`);let K=null;try{K=await uT({port:Q,host:J,silent:!0}),iI(U,`service listening pid=${process.pid}`)}catch(G){if(iI(U,`service failed to bind port ${Q}: ${G instanceof Error?G.message:String(G)}`),cT(Y)===process.pid)g9(Y,{force:!0}),g9(z,{force:!0});throw G}let I=()=>{if(K)K.close(),K=null;if(cT(Y)===process.pid)g9(Y,{force:!0}),g9(z,{force:!0});iI(U,`stopped pid=${process.pid}`)};await new Promise((G)=>{let W=!1,H=()=>{if(W)return;W=!0,I(),process.off("SIGTERM",H),process.off("SIGINT",H),G()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function $g0($){Ug0($.stateDir);let Y=uU($);if(Y.running)return Y;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...z.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let Q=Yy1(z.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});Q.unref();let J=nT($);return iT(J,`${Q.pid}
|
||||
`,{mode:384}),iI(hq($),`started pid=${Q.pid}`),{started:!0,...uU($)}}function Yg0($,Y={}){let z=nT($),U=To($),Q=cT(z);if(!Q||!zg0(Q,$.appRoot))return g9(z,{force:!0}),g9(U,{force:!0}),Y.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(Q,"SIGTERM"),g9(z,{force:!0}),g9(U,{force:!0}),iI(hq($),`stop requested pid=${Q}`),Y.quiet?void 0:{stopped:!0,pid:Q}}function zg0($,Y){if(!Ky1($))return!1;try{let z=zy1("ps",["-p",String($),"-o","command="],{encoding:"utf8"}),U=z.trim().split(/\s+/).filter(Boolean),Q=U.indexOf("service"),J=Q!==-1&&U[Q+1]==="run",K=z.includes(Y)||U.some((I)=>/(^|[\\/])(seal-use|seal-home)(\.exe)?$/.test(I));return J&&K}catch{return!1}}function Ky1($){try{return process.kill($,0),!0}catch{return!1}}function nT($){return Po($.stateDir,"service.pid")}function To($){return Po($.stateDir,"service.json")}function hq($){return Po($.stateDir,"service.log")}function cT($){if(!bT($))return;let Y=Number(Bo($,"utf8").trim());return Number.isInteger(Y)&&Y>0?Y:void 0}function Ug0($){Uy1($,{recursive:!0,mode:448})}function iI($,Y){iT($,`${new Date().toISOString()} ${Y}
|
||||
`,{flag:"a",mode:384})}var jo=o(()=>{No()});import{homedir as Iy1}from"node:os";import{join as Gy1}from"node:path";async function Co($,Y,z){let U=z?s0(z.options.port)??s0(z.options.p):void 0,Q=z?h(z.options.host)??h(z.options.h):void 0,J=z?s0(z.options.lines)??s0(z.options.n):void 0,K=await r3($,{appRoot:Y.appRoot,entryFile:Y.entryFile,stateDir:Eo,version:Z1,launcher:Y.launcher,port:U,host:Q},{maxLines:J});if(K!==void 0)f0(K)}var Eo;var Ro=o(()=>{$3();jo();I4();D4();Eo=Gy1(Iy1(),".config","seal-use")});import{existsSync as Wy1,readFileSync as Qg0}from"node:fs";async function Jg0($,Y,z,U,Q){if($==="batch-records"||$==="records"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",z,U,{batchId:J,query:h(Q.options.query)},C0(Q.options));return}if($==="create"||$==="run"){let J=h(Q.options.mode)??h(Q.options.sourceSystem)??h(Q.options["source-system"])??"hosecloud",K=J==="material-pack"?"material_pack":J,I=h(Q.options.schemaConfig)??h(Q.options["schema-config"]),G=I?JSON.parse(Qg0(I,"utf8")):void 0,W=h(Q.options.input),H=W?JSON.parse(Qg0(W,"utf8")):y8(Q.json),X=h(Q.options.packageId)??h(Q.options["package-id"]),Z=u6(Q.options.packageIds)??u6(Q.options["package-ids"])??(X?[X]:void 0),q=u6(Q.options.flowIds)??u6(Q.options["flow-ids"])??u6(Q.options.documentSn)??u6(Q.options["document-sn"]),V=h(Q.options.signKey)??h(Q.options["sign-key"])??h(Q.options.integration),F=Z0(Q.options.noWait)??Z0(Q.options["no-wait"]);await k0("seal_simulation_batch_create",z,U,{mode:K,sourceSystem:K,flowIds:q,documentSn:q,rejectNodeName:h(Q.options.rejectNode)??h(Q.options["reject-node"])??null,thinkingDepthOverride:h(Q.options.thinkingDepth)??h(Q.options["thinking-depth"]),skipInvoiceGeneration:Z0(Q.options.skipInvoiceGeneration)??Z0(Q.options["skip-invoice-generation"]),skipExpenseExtraction:Z0(Q.options.skipExpenseExtraction)??Z0(Q.options["skip-expense-extraction"]),disableAttachmentCache:Z0(Q.options.disableAttachmentCache)??Z0(Q.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:h(Q.options.templateId)??h(Q.options["template-id"]),schemaConfig:G,requestIds:u6(Q.options.requestIds)??u6(Q.options["request-ids"]),workflowTypeId:h(Q.options.workflowTypeId)??h(Q.options["workflow-type-id"]),flowStatusList:u6(Q.options.flowStatusList)?.map(Number)??u6(Q.options["flow-status-list"])?.map(Number),businessCodes:u6(Q.options.businessCodes)??u6(Q.options["business-codes"]),documentType:h(Q.options.documentType)??h(Q.options["document-type"]),startTime:s0(Q.options.startTime)??s0(Q.options["start-time"]),endTime:s0(Q.options.endTime)??s0(Q.options["end-time"]),status:u6(Q.options.status),limit:s0(Q.options.limit),noWait:F,rawParams:H},C0(Q.options));return}if($==="wait"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",z,U,{batchId:J,timeout:h(Q.options.timeout),pollInterval:h(Q.options.pollInterval)??h(Q.options["poll-interval"])},C0(Q.options));return}if($==="status"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",z,U,{batchId:J},C0(Q.options));return}if($==="clean"||$==="delete"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",z,U,{batchId:J},C0(Q.options));return}if($==="specifications"){let J=Y??h(Q.options.integration)??h(Q.options.signKey)??h(Q.options["sign-key"]);await k0("seal_simulation_specifications_list",z,U,{signKey:J},C0(Q.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",z,U,{},C0(Q.options));return}if($==="list"){await k0("seal_simulation_batches_list",z,U,{limit:s0(Q.options.limit)},C0(Q.options));return}if($==="get"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",z,U,{batchId:J},C0(Q.options));return}if($==="templates"){await k0("seal_simulation_templates_get",z,U,{},C0(Q.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",z,U,{},C0(Q.options));return}if($==="package-upload"){let J=Y??h(Q.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!Wy1(J))throw Error(`File not found: ${J}`);await k0("seal_simulation_material_package_upload",z,U,{filePath:J},C0(Q.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var Kg0=o(()=>{f4();D4();I4()});import{existsSync as Ig0}from"node:fs";import{join as pT}from"node:path";function Gg0($,Y,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${ZoLine truncated
|
||||
`);return}if($==="install"||$==="init"||$==="sync"){let U=Z0(z.options.local)||Z0(z.options.workspace),Q=h(z.options.dir)??h(z.options.target)??Y,J=Q?Q:U?pT(process.cwd(),".agents","skills","seal-use"):fU(),K=FS0(J),I=!U&&!Q,G=I?Qo():void 0,W=I?Io():void 0;f0({installed:!0,targetDir:K.targetDir,fileCount:K.files.length,files:K.files,...G?{antigravity:G}:{},...W?{hosts:W}:{}});return}if($==="status"||$==="get"||!$){let U=fU(),Q=pT(process.cwd(),".agents","skills","seal-use"),J=Jo(),K=Go();f0({global:{dir:U,installed:Ig0(pT(U,"SKILL.md"))},local:{dir:Q,installed:Ig0(pT(Q,"SKILL.md"))},antigravity:J,hosts:K});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var Wg0=o(()=>{Ho();Rq();D4();I4()});async function Hg0($,Y){if($==="config"){f0(await uI(Y));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var Xg0=o(()=>{RT();I4()});function _o($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let Y=$.toUpperCase().trim();if(Y==="APPROVE"||Y==="PASS")return"APPROVE";if(Y==="REJECT"||Y==="DENIED")return"REJECT";if(Y==="MANUAL"||Y==="ASSISTED")return"MANUAL";if(Y==="ERROR"||Y==="FAILED")return"ERROR";return Y}async function Zg0($){let{sourceCorp:Y,targetCorp:z,sourceClient:U,targetClient:Q,samples:J=10,dryRun:K=!1,pollIntervalMs:I=2000,timeoutMs:G=45000,snPrefix:W="REG_",fetchFn:H=fetch}=$;if(z.environment!=="test")throw new w4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
|
||||
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);let X=await mY(Q),q=(Array.isArray(X.features)?X.features:[]).find((d)=>d?.code==="ai-approval"),V=typeof q?.balance==="number"?q.balance:0,F=typeof q?.deductionAmount==="number"&&q.deductionAmount>0?q.deductionAmount:120,M=J*F;if(V<M)throw new w4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${V} 点,本次回归抽样 ${J} 笔需要约 ${M} 点。
|
||||
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let w=await i4(U,{limit:J,status:"completed"}),N=Array.isArray(w.records)?w.records:[];if(N.length===0){let d=await i4(U,{limit:J});N=Array.isArray(d.records)?d.records:[]}if(N.length===0)throw new w4(`在母企业「${Y.name}」(${Y.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(N=N.slice(0,J),K){let d=N.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=_o(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let O=await Xp(Q,z,$.webhookSelector),D=[];for(let d of N){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=_o(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await W4(U,d.id),y=`${W}${$0}`,s=Wp(e,{snPrefix:W,docIdPrefix:W});await Hp(O.incomingDocumentWebhook.url,O.secret,s,H,D6(z.seal));let Y0=null,N0=Date.now();while(Date.now()-N0<G){await new Promise((H0)=>setTimeout(H0,I));let a=await i4(Q,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let H0=a.records[0];if(H0.status==="completed"||H0.status==="failed"){Y0=H0;break}}}if(!Y0){D.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=_o(Y0?.result?.decision??Y0.aiDecision??Y0?.decision??(Y0.status==="completed"?"APPROVE":"ERROR")),G0=Y0?.result?.summary??Y0.aiSummary,T0=g===E0,i0=T0?"MATCHED":"FLIPPED",Y1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:Y0.id,testDecision:E0,testSummary:G0,status:i0,durationMs:Date.now()-t};if(!T0)Y1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};D.push(Y1)}catch(e){D.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let P=D.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=D.filter((d)=>d.status==="MATCHED"),A=D.filter((d)=>d.status==="FLIPPED"),j=D.filter((d)=>d.status==="FAILED").length,C=T.length,b=A.length,x=C+b,S=x>0?C/x:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",U0=!i&&j===0,k;try{let d=await mY(Q),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")k=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:U0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:M,balanceAfter:k},metrics:{sampleCount:D.length,successCount:P.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(S.toFixed(4))},flips:A,records:D}}function qg0($){let{sourceCorp:Y,targetCorp:z,verdict:U,safeToPublish:Q,metrics:J,quota:K,flips:I,records:G}=$,W=U==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":U==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",H=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${Y.name}」-> 测试靶场「${z.name}」`,` 判定: ${W} · 准许发布: ${Q?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${J.sampleCount} | 一致通过: ${J.matchCount} | 决策翻转: ${J.flipCount} | 异常失败: ${J.failureCount}`,` 一致率: ${(J.concordanceRate*100).toFixed(1)}% | 消耗预估: ${K.estimatedRequired} 点 (余量: ${K.balanceBefore}${K.balanceAfter!==void 0?` -> ${K.balanceAfter}`:""})`," "+"─".repeat(65)];if(I.length>0){H.push(` ⚠️ 决策翻转清单 (${I.length} 笔单据在新规则下结果改变):`);for(let X of I)if(H.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)H.push(` 理由差异: ${X.diff.reasonDiff}`);H.push(" "+"─".repeat(65)),H.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(U==="CLEAN")H.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100
Line truncated
|
||||
`)}var Vg0=o(()=>{L$();A6();SZ()});async function vo($,Y,z){let U=($??Y??"regression").toLowerCase();if(U==="regression"||U==="regress"||U==="matrix"){let Q=h(z.options.corp)??(Y&&Y!==U?Y:void 0),J=j1(Q),K=J,I=J;if(J.environment==="test"){I=J;let O=h(z.options["prod-corp"])??h(z.options.prod)??J.prodCorpId;if(!O)throw new w4(`测试企业「${J.name}」(${J.id}) 未绑定生产母企业,无法拉取历史样本。
|
||||
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${J.id}`);K=j1(O)}else{K=J;let O=h(z.options["test-corp"])??h(z.options.test)??J.testCorpId;if(!O)throw new w4(`生产企业「${J.name}」(${J.id}) 未绑定测试靶场企业。
|
||||
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${J.id} <testCorpId>`);I=j1(O)}let G=await P1(K),W=await P1(I),H=s0(z.options.samples)??s0(z.options.limit)??s0(z.options.n)??10,X=Z0(z.options["dry-run"]),Z=Z0(z.options["fail-on-flips"]),q=s0(z.options["poll-interval"])??2000,V=s0(z.options.timeout)??45000,F=h(z.options["sn-prefix"])??"REG_",M=h(z.options.webhook)??h(z.options.selector),w=await Zg0({sourceCorp:K,targetCorp:I,sourceClient:G,targetClient:W,samples:H,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z,webhookSelector:M});if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(qg0(w));if(f0(w),Z&&!w.ok)throw new w4(`回归测试发现 ${w.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new w4(`未知的 test 子命令: "${U}"。
|
||||
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var Lg0=o(()=>{L$();f4();D4();I4();Q$();Vg0()});async function Fg0($,Y,z,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,Y,z,y8(U.json),C0(U.options))}var wg0=o(()=>{f4();D4();I4()});function Mg0(){f0(Lq.map(($)=>({name:$.name,description:$.description})))}var Og0=o(()=>{wq();I4()});function dT($=process.execPath,Y=import.meta.url){if(Y.includes("/$bunfs/")||Y.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var Ng0=o(()=>{Rq()});import{existsSync as Hy1,mkdirSync as Xy1,readFileSync as Zy1,renameSync as qy1,writeFileSync as Vy1}from"node:fs";import{homedir as Ly1}from"node:os";import{dirname as Fy1,join as wy1}from"node:path";import{spawn as My1}from"node:child_process";function Dg0(){let $=process.env[Oy1]?.trim();if($)return $;return Dy1}function Ag0($=Dg0()){if(!Hy1($))return null;try{let Y=Zy1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&typeof z.latestVersion==="string"&&typeof z.checkedAt==="string")return z;return null}catch{return null}}function Sq($,Y=Dg0()){try{let z=Fy1(Y);Xy1(z,{recursive:!0,mode:448});let U={checkedAt:$.checkedAt??new Date().toISOString(),latestVersion:$.latestVersion,publishedAt:$.publishedAt,releaseUrl:$.releaseUrl},Q=`${Y}.tmp.${Date.now()}.${Math.random().toString(36).slice(2,8)}`;Vy1(Q,JSON.stringify(U,null,2),{mode:384}),qy1(Q,Y)}catch{}}function Bg0($,Y=Ny1){if(!$||!$.checkedAt)return!0;let z=new Date($.checkedAt).getTime();if(Number.isNaN(z))return!0;return Date.now()-z>Y}function Pg0($){if(process.env.SEAL_DISABLE_BG_UPDATE==="1"||!1||process.env.CI)return!1;if(!$||!$.command)return!1;try{let Y=$.command,z=[...$.args??[],"update","check","--bg-save"];return My1(Y,z,{detached:!0,stdio:"ignore",env:{...process.env,SEAL_DISABLE_BG_UPDATE:"1"}}).unref(),!0}catch{return!1}}var Oy1="SEAL_USE_UPDATE_CACHE_FILE",Ny1=86400000,Dy1;var ho=o(()=>{Dy1=wy1(Ly1(),".config","seal-use","update-cache.json")});import{chmodSync as Ay1,mkdirSync as By1,readdirSync as Py1,realpathSync as Tg0,renameSync as So,rmSync as Ty1,unlinkSync as Rg0,writeFileSync as jg0}from"node:fs";import{basename as jy1,dirname as Ey1,isAbsolute as Cy1,join as oT,relative as Ry1}from"node:path";import{spawnSync as R5}from"node:child_process";async function vg0($,Y={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:Eo,version:Z1,launcher:$.launcher},U=Y.repo||process.env[_y1]?.trim()||process.env[vy1]?.trim()||_g0,Q=Y.targetVersion?.trim(),J=Q&&Q.toLowerCase()!=="latest"?Q:void 0;if(J){let D=J.replace(/^v/,""),P=yg0(D,Z1);if(P<0)if(!cS&&Y.force);else{f0({updated:!1,currentVersion:Z1,targetVersion:D,mode:dT()?"binary":"source",message:!cS?`Cannot downgrade seal-use from dev build v${Z1} to release v${D}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${Z1} to older version v${D}. Updates must be forward-only.`});return}if(P===0&&!Y.force){f0({updated:!1,currentVersion:Z1,targetVersion:D,mode:dT()?"binary":"source",message:`seal-use is already at version v${Z1}. Use --force to reinstall.`});return}}if(Y.changelogOnly){let D=await lT(U,Y.limit??10);f0({currentVersion:Z1,totalQueried:D.length,releases:D.map((P)=>({version:P.version,tagName:P.tagName,publishedAt:P.publishedAt,author:P.author,releaseNotes:P.notes,releaseUrl:P.htmlUrl,isCurrent:P.version===Z1,isNewer:C5(P.version,Z1)}))});return}if(!dT()){if(Y.checkOnly){let P=await lT(U,30),T=P[0],A=T?.version??Z1,j=P.find((x)=>x.version===Z1),C=C5(A,Z1),b=P.filter((x)=>C5(x.version,Z1));if(T?.version)Sq({latestVersion:T.version,publishedAt:T.publishedAt,releaseUrl:T.htmlUrl});if(Y.bgSave)return;f0({updated:!1,updateAvailable:C,currentVersion:Z1,currentVersionPublishedAt:j?.publishedAt,latestVersion:A,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((x)=>({version:x.version,tagName:x.tagName,publishedAt:x.publishedAt,author:x.author,releaseNotes:x.notes,releaseUrl:x.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"当前运行的是开发版。正式用户请安装正式版后使用 seal-use update。"});return}let D=uU(z).running;if(D)await r3("stop",z);try{Cg0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(P){console.error(`⚠️ 开发版更新同步失败,继续刷新本地依赖: ${P instanceof Error?P.message:String(P)}`)}if(Cg0("bun",["install"],{cwd:$.appRoot}),D)await r3("start",z);f0({updated:!0,serviceRestarted:D,version:Z1,mode:"source"});return}if(ky1())try{await xy1($,Y,z,U,J);return}catch(D){console.error(`⚠️ Homebrew 自动更新失败,回退至原生二进制更新: ${D instanceof Error?D.message:String(D)}`)}let K=Sy1(),I=gy1(),G=await lT(U,30),W=J?G.find((D)=>D.version===J||D.tagName===J||D.tagName===`v${J}`)??await rT(U,J):G[0]??await rT(U);if(!W){f0({updated:!1,
Line truncated
|
||||
`)}catch{}}async function by1($,Y,z,U){let Q=go(),J=[],K=z?z.startsWith("v")?z:`v${z}`:void 0,I=U||$.split("/").pop()||"";if(Q!=="github"){if(K&&I)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${K}/${I}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${K}/${I}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Q!=="gitea")if(K&&I){let F=`https://github.com/${_g0}/releases/download/${K}/${I}`;if(!process.env.CI)J.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);J.push(F)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let G=Array.from(new Set(J)),W,H=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let M=G[F],w=new AbortController,N="",O=(A)=>{N=A;try{w.abort()}catch{}},D=setTimeout(()=>{O("Connection timed out (no response headers within 6s)")},H),P,T;try{mT(`==> [${F+1}/${G.length}] Downloading via: ${M}`);let A=await fetch(M,{signal:w.signal});if(D)clearTimeout(D),D=void 0;if(!A.ok)throw Error(`HTTP ${A.status} ${A.statusText}`);P=setTimeout(()=>{O("Overall download time exceeded 3 minutes")},V);let j=Number(A.headers.get("content-length"))||0,C=A.body?.getReader();if(!C){let c=Buffer.from(await A.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);jg0(Y,c),mT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],x=0,S=0;T=setTimeout(()=>{if(x<Z){let c=(x/1024).toFixed(1);O(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),U0,k=new Promise((g,p)=>{U0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,k])}finally{if(U0)clearTimeout(U0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),x+=$0.length,T&&x>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-S>200){S=g;let p=j?Math.round(x/j*100):0,e=(x/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
|
||||
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);jg0(Y,i),mT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(A){if(D)clearTimeout(D);if(T)clearTimeout(T);if(P)clearTimeout(P);let j=N||(A instanceof Error?A.message:String(A));W=Error(j),mT(`
|
||||
↳ Mirror failed: ${W.message}`)}finally{if(D)clearTimeout(D);if(T)clearTimeout(T);if(P)clearTimeout(P)}}throw Error(`Failed to download asset from all mirrors: ${W?.message}`)}function Sg0($){let Y;try{Y=Py1($,{withFileTypes:!0})}catch{return[]}let z=[];for(let U of Y){let Q=oT($,U.name);if(U.isDirectory())z.push(...Sg0(Q));else if(U.isFile())z.push(Q)}return z}function gg0($,Y,z){let U=Y==="windows"?"seal-use.exe":"seal-use",Q=Sg0($);return Q.find((J)=>jy1(J)===U)??Q[0]??z}function iy1($,Y,z){let U=R5("tar",["-xzf",$,"-C",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);return Rg0($),gg0(Y,z,$)}function cy1($,Y,z){let U=R5("unzip",["-q","-o",$,"-d",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);return Rg0($),gg0(Y,z,$)}function yg0($,Y){let z=$.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0),U=Y.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0);for(let Q=0;Q<Math.max(z.length,U.length);Q++){let J=z[Q]??0,K=U[Q]??0;if(J>K)return 1;if(J<K)return-1}return 0}function C5($,Y){return yg0($,Y)>0}function Cg0($,Y,z={}){let U=R5($,Y,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${Y.join(" ")} failed with status ${U.status}`)}var _g0="yunyingk/seal-use",gq="yunyingk/seal-home",_y1="SEAL_USE_GITHUB_REPO",vy1="SEAL_HOME_GITHUB_REPO";var kg0=o(()=>{Ng0();Rq();ho();$3();jo();I4();Ro()});async function xg0($,Y,z,U,Q){if($==="create"){let J=h(Q.options.name)??Y,K=h(Q.options.phone);if(!J||!K)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let I=h(Q.options.dept)??h(Q.options.departmentId);await k0("seal_user_create",z,U,{name:J,phone:K,departmentIds:I?[I]:void 0},C0(Q.options));return}if($==="reset-password"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",z,U,{userId:J},C0(Q.options));return}if($==="search"||$==="list"){let J=Y??h(Q.options.keyword)??h(Q.options.query)??"";await k0("seal_user_search",z,U,{keyword:J},C0(Q.options));return}if($==="get"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",z,U,{userId:J},C0(Q.options));return}if($==="delete"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",z,U,{userId:J},C0(Q.options));return}if($==="activate"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",z,U,{userId:J},C0(Q.options));return}if($==="delegation"||$==="impersonate"){let J=Y??h(Q.options.userId)??h(Q.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let K=h(Q.options.note);await k0("seal_user_delegation_create",z,U,{userIdOrPhone:J,note:K},C0(Q.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var fg0=o(()=>{f4();D4();I4()});import{dirname as yo,join as ny1}from"node:path";import{fileURLToPath as py1}from"node:url";function oy1($){if(!$.length)return!1;let Y=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(Y&&ly1.has(Y))return!0;if((Y==="service"||Y==="daemon")&&z==="run")return!0;return!1}function vq($,Y={}){if(oy1($))return ig0($,Y);let z=bg0.then(()=>ig0($,Y));return bg0=z.then(()=>{return},()=>{return}),z}async function ig0($,Y){let z=[],U=[],Q=console.log,J=console.error,K={appRoot:Y.appRoot??ug0,entryFile:Y.entryFile??ny1(Y.appRoot??ug0,"src","cli.ts"),launcher:Y.launcher};console.log=(...I)=>{z.push(vl(I))},console.error=(...I)=>{U.push(vl(I))};try{return await ry1($,K),{stdout:Oq(z),stderr:Oq(U),isError:!1,exitCode:0}}catch(I){let G=Nq(I instanceof Error?I.message:String(I)),W=hZ(I);if(U.push(G),W.nextAction&&!G.includes("Next action:"))U.push(`\uD83D\uDC49 Next action: ${W.nextAction}`);return{stdout:Oq(z),stderr:Oq(U),isError:!0,exitCode:W.exitCode}}finally{console.log=Q,console.error=J}}async function ry1($,Y){let z=Mq($),[U,Q,J]=z.command,K=U?.toLowerCase(),I=K?dy1.has(K):!1,G=I?"update":K;if(G==="version"||G==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){let Z=Ag0(),q=Z?.latestVersion?C5(Z.latestVersion,dY.version):!1,V={...dY,...Z?.latestVersion?{latestVersion:Z.latestVersion,updateAvailable:q,lastCheckedAt:Z.checkedAt}:{}};if(q&&Z?.latestVersion)console.error(`\uD83D\uDCA1 发现新版本可用: v${dY.version} -> v${Z.latestVersion}`),console.error(`\uD83D\uDC49 Next action: seal-use update
|
||||
`);if(f0(V),Bg0(Z))Pg0(Y.launcher);return}let W=O_0(z);if(W.isHelp){B_0(W.target);return}if(!G||!my1.has(G))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(G==="webhook"&&(Q==="resource-pack"||Q==="pack"||Q==="material-pack")&&J==="preview"){let Z=z.command[3]??h(z.options.file)??h(z.options.input);if(!Z)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await T_0(Z,kI(z.options));return}if(G==="openapi"){cS0(z);return}if(G==="mcp-config"){Do();return}if(G==="skill"){Gg0(Q,J,z);return}if(G==="mcp"||G==="server"){await fS0(Q,z);return}if(G==="probe"){await aS0(Q,J,z);return}if(G==="doctor"){await TS0(Q,J,z);return}if(G==="test"){await vo(Q,J,z);return}if(G==="config"){qh0(Q,J,z);return}if(G==="service"){await Co(Q,Y,z);return}if(G==="stop"){await Co("stop",Y,z);return}if(G==="http"||G==="serve"){await gS0(z);return}if(I||G==="changelog"){if(I&&U!=="update")console.error(`⚠️ Notice: '${U}' is an alias for 'seal-use update'. Please use 'seal-use update' instead.`);let Z=Q?.toLowerCase(),q=G==="changelog"||Z==="changelog"||Z==="log"||Z==="history"||Z0(z.options.changelog)===!0,V=Z==="check"||Z0(z.options.check)===!0||Z0(z.options["check-only"])===!0,F=Z0(z.options["bg-save"])===!0||Z0(z.options["silent-save"])===!0,M=h(z.options.version)??h(z.options.tag)??(!q&&!V&&!F&&Q&&!Q.startsWith("-")?Q:void 0);await vg0(Y,{checkOnly:V||F,changelogOnly:q,limit:s0(z.options.limit),force:Z0(z.options.force),targetVersion:M,repo:h(z.options.repo),bgSave:F});return}if(G==="tools"&&Q==="list"){Mg0();return}if(G==="corps"||G==="corp"){if(Q==="regression"||Q==="test-regression"){await vo("regression",J,z);return}await Uh0(Q,J,z);return}if(G==="rules"&&Q==="lint"&&(("file"in z.options)||("f"in z.options))){let Z;try{Z=j1(h(z.options.corp))}catch{Z={id:"local",name:"Local Workspace",source:{type:"native"}}}await Ao(Q,J,null,Z,z);return}if(G==="auth"&&(Q==="extract-keys"||Q==="extract-key")){await el(J,z);return}if(G==="auth"&&(Q==="link"||Q==="seal-link")&&(("from-link"in z.options)||J==="from-link")){await hT(Q,null,z);return}let H=j1(h(z.options.corp));if(G==="source"){await Hg0(Q,H);return}if(G==="auth"){await hT(Q,H,z);return}let X=await P1(H);if(G==="users"){await xg0(Q,J,X,H,z);return}if(G==="contacts"){await Lh0(Q,J,X,H,z);return}if(G==="data"){await wh0(Q,X,H,z);return}if(G==="llm"){await kS0(Q,X,H,z);return}if(G==="permissions"){await pS0(Q,X,H,z);return}if(G==="billing"){await Xh0(Q,X,H,z);return}if(G==="webhook"||G==="webhooks"){await NT(Q,J,X,H,z);return}if(G==="context"){await Oh0(X,H,z);return}if(G==="rules"){await Ao(Q,J,X,H,z);return}if(G==="approval-runs"){await j_0(Q,J,X,H,z);return}if(G==="analytics"){await C_0(Q,J,X,H,z);return}if(G==="simulation"){await Jg0(Q,J,X,H,z);return}if(G==="deploy"){await Dh0(Q,J,z.command[3],X,H,z);return}if(G==="preference"||G==="preferences"){await lS0(Q,J,z.command[3],z.command[4],X,H,z);return}if(G==="tool"){await Fg0(Q,X,H,z);return}throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`)}var ug0,dy1,my1,ly1,bg0;var Oo=o(()=>{Q$();$3();E_0();R_0();$o();Zh0();Vh0();Fh0();Mh0();Nh0();sl();Ah0();jS0();yS0();xS0();uS0();nS0();dS0();oS0();tS0();eS0();Ro();Kg0();Wg0();Xg0();Lg0();wg0();Og0();kg0();ho();fg0();Sl();L$();f4();D4();_l();I4();ug0=yo(yo(yo(py1(import.meta.url)))),dy1=new Set(["update","upgrade","up","self-update","selfupdate"]),my1=new Set(["config","service","stop","http","serve","update","tools","corps","corp","tool","source","auth","users","contacts","data","llm","permissions","billing","webhook","webhooks","context","rules","approval-runs","analytics","simulation","deploy","preference","preferences","mcp","server","mcp-config","skill","openapi","probe","doctor","changelog","test"]),ly1=new Set(["http","server","web","mcp"]);bg0=Promise.resolve()});function ey1($){let{command:Y}=Mq($),z=(Y[0]??"").toLowerCase();return{area:sy1[z]??z,actionTokens:Y.slice(1).map((U)=>U.toLowerCase())}}function cg0($){let Y,z;try{({area:Y,actionTokens:z}=ey1($))}catch{return!1}if(z.length===0&&ty1.has(Y))return!0;if(Y==="tool"){let Q=z[0];return Q!==void 0&&I_0(Q)}let U=ay1[Y];if(!U)return!1;return U.some((Q)=>{let J=Q.split(" ").filter(Boolean);if(J.length===0)return z.length===0;if(J.length>z.length)return!1;return J.every((K,I)=>K===z[I])})}var sy1,ay1,ty1;var ng0=o(()=>{wq();D4();sy1={corp:"corps",webhooks:"webhook",preferences:"preference"},ay1={corps:["list","search","get","current"],rules:["count","list","versions","version","get","search","lint","linters","pull","map"],webhook:["ready","status","list","get","resource-pack export","resource-pack preview"],"approval-runs":["summary","stats","count","export","flow","list","search","pick","bridge","get","cited-rules","document-summary","attachments","result","link","url"],simulation:["batch-records","status","wait","specifications","approval-definitions","list","get","templates","integrations"],deploy:["hosecl
Line truncated
|
||||
`);Q(U)})})}var fT=8787,uT="127.0.0.1";var Bo=m(()=>{nS0();$3()});async function pS0($){let Y=s0($.options.port)??s0($.options.p),z=h($.options.host)??h($.options.h),U=await bT({port:Y,host:z}),Q=()=>{U.close(()=>{process.exit(0)})};process.on("SIGINT",Q),process.on("SIGTERM",Q),await new Promise(()=>{})}var dS0=m(()=>{D4();Bo()});async function mS0($,Y,z,U){if($==="config"||$==="get"){await k0("seal_llm_config_get",Y,z,{},C0(U.options));return}if($==="providers"||$==="list"){await k0("seal_llm_providers_list",Y,z,{},C0(U.options));return}throw Error(`Unknown llm command: ${$??""}. Run 'seal-use help' for available commands.`)}var lS0=m(()=>{f4();I4()});async function oS0($,Y){if($==="config"||$==="json"){Po();return}let{startServer:z}=await aS0().then(() => sS0);z()}function Po(){f0({mcpServers:{"seal-use":{type:"stdio",command:"seal-use",args:["mcp"],env:{SEAL_USE_MCP_ENABLED:"true"}}}})}var rS0=m(()=>{I4()});function tS0($){let Y=yT();f0(Y,{...C0($.options),allowFull:!0})}var eS0=m(()=>{Do();I4()});async function $g0($,Y,z,U){if($==="available"){await k0("seal_permissions_available_list",Y,z,{},C0(U.options));return}if($==="configs"||$==="list"){await k0("seal_permissions_configs_list",Y,z,{},C0(U.options));return}throw Error(`Unknown permissions command: ${$??""}. Run 'seal-use help' for available commands.`)}var Yg0=m(()=>{f4();I4()});import{readFileSync as zg0}from"node:fs";async function Ug0($,Y,z,U,Q,J,K){if(!$||$==="get"){await k0("seal_preference_get",Q,J,{},C0(K.options));return}if($==="decision"){if(Y==="update"||!Y){let I=h(K.options.input),G=I?JSON.parse(zg0(I,"utf8")):y8(K.json);if(!G||Object.keys(G).length===0)throw Error(`Usage: seal-use preference decision update --json '{"explicitApprove":"..."}'`);await k0("seal_preference_decision_update",Q,J,{...G,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}}if($==="thinking-depth"||$==="thinkingDepth"){if(Y==="set"){let I=h(K.options.default)??h(K.options.level)??U;if(I!=="medium"&&I!=="high")throw Error("Usage: seal-use preference thinking-depth set --default <medium|high>");await k0("seal_preference_thinking_depth_set",Q,J,{defaultLevel:I,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}if(Y==="policies"){if(z==="list"||!z){await k0("seal_preference_thinking_depth_policies_list",Q,J,{},C0(K.options));return}if(z==="upsert"){let I=h(K.options.input),G=I?JSON.parse(zg0(I,"utf8")):y8(K.json);if(!G||!G.id||!G.name)throw Error(`Usage: seal-use preference thinking-depth policies upsert --json '{"id":"...","name":"...","level":"high"}'`);await k0("seal_preference_thinking_depth_policies_upsert",Q,J,{...G,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}if(z==="remove"||z==="delete"){let I=U??h(K.options.id)??h(K.options.policyId);if(!I)throw Error("Usage: seal-use preference thinking-depth policies remove <policyId>");await k0("seal_preference_thinking_depth_policies_remove",Q,J,{policyId:I,dryRun:Z0(K.options.dryRun)??Z0(K.options["dry-run"])},C0(K.options));return}}}throw Error(`Unknown preference action: ${$??""}. Available: get, decision update, thinking-depth set, thinking-depth policies list/upsert/remove.`)}var Qg0=m(()=>{f4();D4();I4()});async function Jg0($={}){let Y=s8(),z=_4(),U=n2(Y,{stateful:z.stateful,defaultCorpId:z.defaultCorpId,corpId:$.corpId},g3());console.log(`[probe] corp=${U.id} source=${U.source.type}`);let Q=await bI(U);console.log("[probe] seal enterprise"),console.log(JSON.stringify(Q,null,2));let J=await P1(U),K=await Dw(J,{documentLimit:20,stylePreferencesEndpoint:U.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))}var Kg0=m(()=>{k3();J$();_T();A6()});async function Ig0($,Y,z){let U=Y??h(z.options.corp)??($&&$!=="--corp"?$:void 0);await Jg0({corpId:U})}var Gg0=m(()=>{Kg0();D4()});async function To($,Y,z,U,Q){if($==="count"){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}if($==="list"){if(Z0(Q.options.count)){await k0("seal_approval_rules_list",z,U,{countOnly:!0},C0(Q.options));return}let J=s0(Q.options.limit),K=s0(Q.options.offset);if(Z0(Q.options.summary)){await k0("seal_approval_rules_list",z,U,{fields:v_0,limit:J,offset:K},C0(Q.options));return}let I=await T5("seal_approval_rules_list",z,U,{limit:J,offset:K}),G=C0(Q.options);h_0(I,G.allowFull===!0||Boolean(G.outputFile)),f0(I,G);return}if($==="clear"){let J=Z0(Q.options.yes)===!0,K=Z0(Q.options.dryRun)??Z0(Q.options["dry-run"])??!J;if(!J&&!K)throw P9("Refusing to clear rules without --yes. Use --dry-run to preview.",`seal-use rules clear --corp ${U.id} --dry-run`);let I=await T5("seal_approval_rules_clear",z,U,{dryRun:K,recode:Z0(Q.options.recode)});if(!J&&K&
Line truncated
|
||||
`).filter(Boolean),J=Q.slice(-Y);return{logFile:z,lines:J,totalLines:Q.length}}async function Oy1($){let Y=pT($),z=Co($),U=Sq($);qg0($.stateDir);let Q=$.port??(process.env.PORT?Number.parseInt(process.env.PORT,10):fT),J=$.host??(process.env.HOST?process.env.HOST:uT);cT(Y,`${process.pid}
|
||||
`,{mode:384}),cT(z,JSON.stringify({pid:process.pid,port:Q,host:J,version:$.version,startedAt:new Date().toISOString()},null,2),{mode:384}),cI(U,`service starting on http://${J}:${Q} pid=${process.pid}`);let K=null;try{K=await bT({port:Q,host:J,silent:!0}),cI(U,`service listening pid=${process.pid}`)}catch(G){if(cI(U,`service failed to bind port ${Q}: ${G instanceof Error?G.message:String(G)}`),nT(Y)===process.pid)g9(Y,{force:!0}),g9(z,{force:!0});throw G}let I=()=>{if(K)K.close(),K=null;if(nT(Y)===process.pid)g9(Y,{force:!0}),g9(z,{force:!0});cI(U,`stopped pid=${process.pid}`)};await new Promise((G)=>{let W=!1,H=()=>{if(W)return;W=!0,I(),process.off("SIGTERM",H),process.off("SIGINT",H),G()};process.once("SIGTERM",H),process.once("SIGINT",H)})}function Hg0($){qg0($.stateDir);let Y=bU($);if(Y.running)return Y;let z=$.launcher??{command:process.execPath,args:[$.entryFile]},U=[...z.args??[],"service","run"];if($.port)U.push("--port",String($.port));if($.host)U.push("--host",String($.host));let Q=Ly1(z.command,U,{cwd:$.appRoot,detached:!0,stdio:["ignore","ignore","ignore"],env:process.env});Q.unref();let J=pT($);return cT(J,`${Q.pid}
|
||||
`,{mode:384}),cI(Sq($),`started pid=${Q.pid}`),{started:!0,...bU($)}}function Xg0($,Y={}){let z=pT($),U=Co($),Q=nT(z);if(!Q||!Zg0(Q,$.appRoot))return g9(z,{force:!0}),g9(U,{force:!0}),Y.quiet?void 0:{stopped:!1,reason:"not running"};return process.kill(Q,"SIGTERM"),g9(z,{force:!0}),g9(U,{force:!0}),cI(Sq($),`stop requested pid=${Q}`),Y.quiet?void 0:{stopped:!0,pid:Q}}function Zg0($,Y){if(!Ny1($))return!1;try{let z=Fy1("ps",["-p",String($),"-o","command="],{encoding:"utf8"}),U=z.trim().split(/\s+/).filter(Boolean),Q=U.indexOf("service"),J=Q!==-1&&U[Q+1]==="run",K=z.includes(Y)||U.some((I)=>/(^|[\\/])(seal-use|seal-home)(\.exe)?$/.test(I));return J&&K}catch{return!1}}function Ny1($){try{return process.kill($,0),!0}catch{return!1}}function pT($){return Eo($.stateDir,"service.pid")}function Co($){return Eo($.stateDir,"service.json")}function Sq($){return Eo($.stateDir,"service.log")}function nT($){if(!iT($))return;let Y=Number(jo($,"utf8").trim());return Number.isInteger(Y)&&Y>0?Y:void 0}function qg0($){My1($,{recursive:!0,mode:448})}function cI($,Y){cT($,`${new Date().toISOString()} ${Y}
|
||||
`,{flag:"a",mode:384})}var Ro=m(()=>{Bo()});import{homedir as Dy1}from"node:os";import{join as Ay1}from"node:path";async function vo($,Y,z){let U=z?s0(z.options.port)??s0(z.options.p):void 0,Q=z?h(z.options.host)??h(z.options.h):void 0,J=z?s0(z.options.lines)??s0(z.options.n):void 0,K=await r3($,{appRoot:Y.appRoot,entryFile:Y.entryFile,stateDir:_o,version:Z1,launcher:Y.launcher,port:U,host:Q},{maxLines:J});if(K!==void 0)f0(K)}var _o;var ho=m(()=>{$3();Ro();I4();D4();_o=Ay1(Dy1(),".config","seal-use")});import{existsSync as By1,readFileSync as Vg0}from"node:fs";async function Lg0($,Y,z,U,Q){if($==="batch-records"||$==="records"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation batch-records <batchId>");await k0("seal_simulation_batch_records_get",z,U,{batchId:J,query:h(Q.options.query)},C0(Q.options));return}if($==="create"||$==="run"){let J=h(Q.options.mode)??h(Q.options.sourceSystem)??h(Q.options["source-system"])??"hosecloud",K=J==="material-pack"?"material_pack":J,I=h(Q.options.schemaConfig)??h(Q.options["schema-config"]),G=I?JSON.parse(Vg0(I,"utf8")):void 0,W=h(Q.options.input),H=W?JSON.parse(Vg0(W,"utf8")):y8(Q.json),X=h(Q.options.packageId)??h(Q.options["package-id"]),Z=u6(Q.options.packageIds)??u6(Q.options["package-ids"])??(X?[X]:void 0),q=u6(Q.options.flowIds)??u6(Q.options["flow-ids"])??u6(Q.options.documentSn)??u6(Q.options["document-sn"]),V=h(Q.options.signKey)??h(Q.options["sign-key"])??h(Q.options.integration),F=Z0(Q.options.noWait)??Z0(Q.options["no-wait"]);await k0("seal_simulation_batch_create",z,U,{mode:K,sourceSystem:K,flowIds:q,documentSn:q,rejectNodeName:h(Q.options.rejectNode)??h(Q.options["reject-node"])??null,thinkingDepthOverride:h(Q.options.thinkingDepth)??h(Q.options["thinking-depth"]),skipInvoiceGeneration:Z0(Q.options.skipInvoiceGeneration)??Z0(Q.options["skip-invoice-generation"]),skipExpenseExtraction:Z0(Q.options.skipExpenseExtraction)??Z0(Q.options["skip-expense-extraction"]),disableAttachmentCache:Z0(Q.options.disableAttachmentCache)??Z0(Q.options["disable-attachment-cache"]),signKey:V,packageIds:Z,packageId:X,templateId:h(Q.options.templateId)??h(Q.options["template-id"]),schemaConfig:G,requestIds:u6(Q.options.requestIds)??u6(Q.options["request-ids"]),workflowTypeId:h(Q.options.workflowTypeId)??h(Q.options["workflow-type-id"]),flowStatusList:u6(Q.options.flowStatusList)?.map(Number)??u6(Q.options["flow-status-list"])?.map(Number),businessCodes:u6(Q.options.businessCodes)??u6(Q.options["business-codes"]),documentType:h(Q.options.documentType)??h(Q.options["document-type"]),startTime:s0(Q.options.startTime)??s0(Q.options["start-time"]),endTime:s0(Q.options.endTime)??s0(Q.options["end-time"]),status:u6(Q.options.status),limit:s0(Q.options.limit),noWait:F,rawParams:H},C0(Q.options));return}if($==="wait"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s]");await k0("seal_simulation_batch_wait",z,U,{batchId:J,timeout:h(Q.options.timeout),pollInterval:h(Q.options.pollInterval)??h(Q.options["poll-interval"])},C0(Q.options));return}if($==="status"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation status <batchId>");await k0("seal_simulation_batch_status",z,U,{batchId:J},C0(Q.options));return}if($==="clean"||$==="delete"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation clean <batchId>");await k0("seal_simulation_batch_clean",z,U,{batchId:J},C0(Q.options));return}if($==="specifications"){let J=Y??h(Q.options.integration)??h(Q.options.signKey)??h(Q.options["sign-key"]);await k0("seal_simulation_specifications_list",z,U,{signKey:J},C0(Q.options));return}if($==="approval-definitions"||$==="definitions"){await k0("seal_simulation_feishu_approval_definitions_list",z,U,{},C0(Q.options));return}if($==="list"){await k0("seal_simulation_batches_list",z,U,{limit:s0(Q.options.limit)},C0(Q.options));return}if($==="get"){let J=Y??h(Q.options.batchId)??h(Q.options["batch-id"]);if(!J)throw Error("Usage: seal-use simulation get <batchId>");await k0("seal_simulation_batch_get",z,U,{batchId:J},C0(Q.options));return}if($==="templates"){await k0("seal_simulation_templates_get",z,U,{},C0(Q.options));return}if($==="integrations"){await k0("seal_simulation_integrations_get",z,U,{},C0(Q.options));return}if($==="package-upload"){let J=Y??h(Q.options.file);if(!J)throw Error("Usage: seal-use simulation package-upload <材料包.zip>");if(!By1(J))throw Error(`File not found: ${J}`);await k0("seal_simulation_material_package_upload",z,U,{filePath:J},C0(Q.options));return}throw Error(`Unknown simulation command: ${$??""}. Run 'seal-use help' for available commands.`)}var Fg0=m(()=>{f4();D4();I4()});import{existsSync as Mg0}from"node:fs";import{join as dT}from"node:path";function wg0($,Y,z){if($==="dump"||$==="cat"||$==="show"){process.stdout.write(`${LoLine truncated
|
||||
`);return}if($==="install"||$==="init"||$==="sync"){let U=Z0(z.options.local)||Z0(z.options.workspace),Q=h(z.options.dir)??h(z.options.target)??Y,J=Q?Q:U?dT(process.cwd(),".agents","skills","seal-use"):uU(),K=jS0(J),I=!U&&!Q,G=I?Io():void 0,W=I?Ho():void 0;f0({installed:!0,targetDir:K.targetDir,fileCount:K.files.length,files:K.files,...G?{antigravity:G}:{},...W?{hosts:W}:{}});return}if($==="status"||$==="get"||!$){let U=uU(),Q=dT(process.cwd(),".agents","skills","seal-use"),J=Go(),K=Xo();f0({global:{dir:U,installed:Mg0(dT(U,"SKILL.md"))},local:{dir:Q,installed:Mg0(dT(Q,"SKILL.md"))},antigravity:J,hosts:K});return}throw Error(`Unknown skill command: ${$}. Run 'seal-use help' for available commands.`)}var Og0=m(()=>{qo();_q();D4();I4()});async function Ng0($,Y){if($==="config"){f0(await bI(Y));return}throw Error(`Unknown source command: ${$??""}. Run 'seal-use help' for available commands.`)}var Dg0=m(()=>{_T();I4()});function So($){if(typeof $!=="string"||!$.trim())return"UNKNOWN";let Y=$.toUpperCase().trim();if(Y==="APPROVE"||Y==="PASS")return"APPROVE";if(Y==="REJECT"||Y==="DENIED")return"REJECT";if(Y==="MANUAL"||Y==="ASSISTED")return"MANUAL";if(Y==="ERROR"||Y==="FAILED")return"ERROR";return Y}async function Ag0($){let{sourceCorp:Y,targetCorp:z,sourceClient:U,targetClient:Q,samples:J=10,dryRun:K=!1,pollIntervalMs:I=2000,timeoutMs:G=45000,snPrefix:W="REG_",fetchFn:H=fetch}=$;if(z.environment!=="test")throw new M4(`重放目标企业「${z.name}」(${z.id}) 的环境为「${z.environment}」,非测试环境!
|
||||
`+"硬性安全规定:自动化回归测试矩阵严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${Y.id} <testCorpId>`);let X=await lY(Q),q=(Array.isArray(X.features)?X.features:[]).find((d)=>d?.code==="ai-approval"),V=typeof q?.balance==="number"?q.balance:0,F=typeof q?.deductionAmount==="number"&&q.deductionAmount>0?q.deductionAmount:120,w=J*F;if(V<w)throw new M4(`测试企业「${z.name}」AI 审批额度不足:当前剩余 ${V} 点,本次回归抽样 ${J} 笔需要约 ${w} 点。
|
||||
`+"为防止测试环境额度耗尽中断业务,已硬性拦截并拒绝发起测试单据注入。",2,`请为测试企业「${z.id}」充值 AI 审批额度,或降低抽样笔数 (--samples ${Math.max(1,Math.floor(V/F))})`);let M=await i4(U,{limit:J,status:"completed"}),O=Array.isArray(M.records)?M.records:[];if(O.length===0){let d=await i4(U,{limit:J});O=Array.isArray(d.records)?d.records:[]}if(O.length===0)throw new M4(`在母企业「${Y.name}」(${Y.id}) 中未检索到任何历史审批单据,无法抽取回归样本。`,2);if(O=O.slice(0,J),K){let d=O.map((t)=>{let $0=t.sourceDocumentSN??t.id,g=t?.result?.decision??t.aiDecision??t?.decision,p=So(g),e=t?.result?.summary??t.aiSummary;return{sn:$0,sourceRecordId:t.id,prodDecision:p,prodSummary:e,status:"DRY_RUN"}});return{ok:!0,verdict:"DRY_RUN",safeToPublish:!0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:w},metrics:{sampleCount:d.length,successCount:d.length,failureCount:0,matchCount:d.length,flipCount:0,concordanceRate:1},flips:[],records:d}}let N=await Vp(Q,z,$.webhookSelector),D=[];for(let d of O){let t=Date.now(),$0=d.sourceDocumentSN??d.id,g=So(d?.result?.decision??d.aiDecision??d?.decision),p=d?.result?.summary??d.aiSummary;try{let e=await W4(U,d.id),y=`${W}${$0}`,s=Zp(e,{snPrefix:W,docIdPrefix:W});await qp(N.incomingDocumentWebhook.url,N.secret,s,H,D6(z.seal));let Y0=null,N0=Date.now();while(Date.now()-N0<G){await new Promise((H0)=>setTimeout(H0,I));let a=await i4(Q,{sourceDocumentSN:y,limit:1});if(a.records&&a.records.length>0){let H0=a.records[0];if(H0.status==="completed"||H0.status==="failed"){Y0=H0;break}}}if(!Y0){D.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:`测试租户单据审核超时 (${Math.round(G/1000)}s 未完成)`,durationMs:Date.now()-t});continue}let E0=So(Y0?.result?.decision??Y0.aiDecision??Y0?.decision??(Y0.status==="completed"?"APPROVE":"ERROR")),G0=Y0?.result?.summary??Y0.aiSummary,T0=g===E0,i0=T0?"MATCHED":"FLIPPED",Y1={sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,testRecordId:Y0.id,testDecision:E0,testSummary:G0,status:i0,durationMs:Date.now()-t};if(!T0)Y1.diff={from:g,to:E0,reasonDiff:G0&&p&&G0!==p?`生产: ${p.slice(0,60)}... -> 测试: ${G0.slice(0,60)}...`:void 0};D.push(Y1)}catch(e){D.push({sn:$0,sourceRecordId:d.id,prodDecision:g,prodSummary:p,status:"FAILED",error:e instanceof Error?e.message:String(e),durationMs:Date.now()-t})}}let P=D.filter((d)=>d.status==="MATCHED"||d.status==="FLIPPED"),T=D.filter((d)=>d.status==="MATCHED"),A=D.filter((d)=>d.status==="FLIPPED"),j=D.filter((d)=>d.status==="FAILED").length,C=T.length,b=A.length,x=C+b,S=x>0?C/x:0,i=b>0,c=i?"REGRESSIONS_DETECTED":"CLEAN",U0=!i&&j===0,k;try{let d=await lY(Q),$0=(Array.isArray(d.features)?d.features:[]).find((g)=>g?.code==="ai-approval");if(typeof $0?.balance==="number")k=$0.balance}catch{}return{ok:!i&&j===0,verdict:c,safeToPublish:U0,timestamp:new Date().toISOString(),sourceCorp:{id:Y.id,name:Y.name,environment:Y.environment??"production"},targetCorp:{id:z.id,name:z.name,environment:z.environment??"test"},quota:{featureCode:"ai-approval",balanceBefore:V,deductionAmount:F,estimatedRequired:w,balanceAfter:k},metrics:{sampleCount:D.length,successCount:P.length,failureCount:j,matchCount:C,flipCount:b,concordanceRate:Number(S.toFixed(4))},flips:A,records:D}}function Bg0($){let{sourceCorp:Y,targetCorp:z,verdict:U,safeToPublish:Q,metrics:J,quota:K,flips:I,records:G}=$,W=U==="CLEAN"?"\uD83D\uDFE2 决策完全一致 (CLEAN - 无回归)":U==="DRY_RUN"?"⚪ 预演模式 (DRY-RUN)":"\uD83D\uDD34 发现决策翻转 (REGRESSIONS_DETECTED)",H=["",`\uD83E\uDDEA [Seal Use Test] 规则回归测试矩阵: 生产「${Y.name}」-> 测试靶场「${z.name}」`,` 判定: ${W} · 准许发布: ${Q?"YES (可安全上线)":"NO (存在行为偏离/待复核)"}`," "+"─".repeat(65),` 样本总数: ${J.sampleCount} | 一致通过: ${J.matchCount} | 决策翻转: ${J.flipCount} | 异常失败: ${J.failureCount}`,` 一致率: ${(J.concordanceRate*100).toFixed(1)}% | 消耗预估: ${K.estimatedRequired} 点 (余量: ${K.balanceBefore}${K.balanceAfter!==void 0?` -> ${K.balanceAfter}`:""})`," "+"─".repeat(65)];if(I.length>0){H.push(` ⚠️ 决策翻转清单 (${I.length} 笔单据在新规则下结果改变):`);for(let X of I)if(H.push(` • 单据 [${X.sn}]: 原生产判定「${X.prodDecision}」 ➔ 测试新判定「${X.testDecision}」`),X.diff?.reasonDiff)H.push(` 理由差异: ${X.diff.reasonDiff}`);H.push(" "+"─".repeat(65)),H.push(" \uD83D\uDC49 建议: 请检查上述翻转单据是否符合预期修正。若为意外误杀,请调整测试环境规则后再次回归。")}else if(U==="CLEAN")H.push(" ✓ 全部样本在新规则下的审核决策与生产历史 100
Line truncated
|
||||
`)}var Pg0=m(()=>{F$();A6();gZ()});async function go($,Y,z){let U=($??Y??"regression").toLowerCase();if(U==="regression"||U==="regress"||U==="matrix"){let Q=h(z.options.corp)??(Y&&Y!==U?Y:void 0),J=j1(Q),K=J,I=J;if(J.environment==="test"){I=J;let N=h(z.options["prod-corp"])??h(z.options.prod)??J.prodCorpId;if(!N)throw new M4(`测试企业「${J.name}」(${J.id}) 未绑定生产母企业,无法拉取历史样本。
|
||||
`+"请建立绑定或通过 --prod-corp 参数指定生产企业来源。",2,`seal-use corps bind-test <prodCorpId> ${J.id}`);K=j1(N)}else{K=J;let N=h(z.options["test-corp"])??h(z.options.test)??J.testCorpId;if(!N)throw new M4(`生产企业「${J.name}」(${J.id}) 未绑定测试靶场企业。
|
||||
`+"硬性规定:回归测试严禁在生产环境直接运行。必须绑定并指定测试环境(testCorp)。",2,`seal-use corps bind-test ${J.id} <testCorpId>`);I=j1(N)}let G=await P1(K),W=await P1(I),H=s0(z.options.samples)??s0(z.options.limit)??s0(z.options.n)??10,X=Z0(z.options["dry-run"]),Z=Z0(z.options["fail-on-flips"]),q=s0(z.options["poll-interval"])??2000,V=s0(z.options.timeout)??45000,F=h(z.options["sn-prefix"])??"REG_",w=h(z.options.webhook)??h(z.options.selector),M=await Ag0({sourceCorp:K,targetCorp:I,sourceClient:G,targetClient:W,samples:H,dryRun:X,pollIntervalMs:q,timeoutMs:V,snPrefix:F,failOnFlips:Z,webhookSelector:w});if(!(Z0(z.options.quiet)||Z0(z.options.silent)))console.error(Bg0(M));if(f0(M),Z&&!M.ok)throw new M4(`回归测试发现 ${M.metrics.flipCount} 笔单据决策翻转,已按 --fail-on-flips 策略非零终止。`,1);return}throw new M4(`未知的 test 子命令: "${U}"。
|
||||
可用子命令: seal-use test regression [--corp <id>] [--samples <N>] [--dry-run]`,2,"seal-use test regression --help")}var Tg0=m(()=>{F$();f4();D4();I4();J$();Pg0()});async function jg0($,Y,z,U){if(!$)throw Error("Usage: seal-use tool <toolName> [--json '{...}']");await k0($,Y,z,y8(U.json),C0(U.options))}var Eg0=m(()=>{f4();D4();I4()});function Cg0(){f0(Fq.map(($)=>({name:$.name,description:$.description})))}var Rg0=m(()=>{wq();I4()});function mT($=process.execPath,Y=import.meta.url){if(Y.includes("/$bunfs/")||Y.includes("\\$bunfs\\"))return!0;let z=$.toLowerCase().replace(/\\/g,"/");return!z.endsWith("/bun")&&!z.endsWith("/bun.exe")&&!z.endsWith("/node")&&!z.endsWith("/node.exe")}var _g0=m(()=>{_q()});import{existsSync as Py1,mkdirSync as Ty1,readFileSync as jy1,renameSync as Ey1,writeFileSync as Cy1}from"node:fs";import{homedir as Ry1}from"node:os";import{dirname as _y1,join as vy1}from"node:path";import{spawn as hy1}from"node:child_process";function vg0(){let $=process.env[Sy1]?.trim();if($)return $;return yy1}function hg0($=vg0()){if(!Py1($))return null;try{let Y=jy1($,"utf-8"),z=JSON.parse(Y);if(z&&typeof z==="object"&&typeof z.latestVersion==="string"&&typeof z.checkedAt==="string")return z;return null}catch{return null}}function gq($,Y=vg0()){try{let z=_y1(Y);Ty1(z,{recursive:!0,mode:448});let U={checkedAt:$.checkedAt??new Date().toISOString(),latestVersion:$.latestVersion,publishedAt:$.publishedAt,releaseUrl:$.releaseUrl},Q=`${Y}.tmp.${Date.now()}.${Math.random().toString(36).slice(2,8)}`;Cy1(Q,JSON.stringify(U,null,2),{mode:384}),Ey1(Q,Y)}catch{}}function Sg0($,Y=gy1){if(!$||!$.checkedAt)return!0;let z=new Date($.checkedAt).getTime();if(Number.isNaN(z))return!0;return Date.now()-z>Y}function gg0($){if(process.env.SEAL_DISABLE_BG_UPDATE==="1"||!1||process.env.CI)return!1;if(!$||!$.command)return!1;try{let Y=$.command,z=[...$.args??[],"update","check","--bg-save"];return hy1(Y,z,{detached:!0,stdio:"ignore",env:{...process.env,SEAL_DISABLE_BG_UPDATE:"1"}}).unref(),!0}catch{return!1}}var Sy1="SEAL_USE_UPDATE_CACHE_FILE",gy1=86400000,yy1;var yo=m(()=>{yy1=vy1(Ry1(),".config","seal-use","update-cache.json")});import{chmodSync as ky1,mkdirSync as xy1,readdirSync as fy1,realpathSync as yg0,renameSync as ko,rmSync as uy1,unlinkSync as ug0,writeFileSync as kg0}from"node:fs";import{basename as by1,dirname as iy1,isAbsolute as cy1,join as rT,relative as ny1}from"node:path";import{spawnSync as R5}from"node:child_process";async function ig0($,Y={}){let z={appRoot:$.appRoot,entryFile:$.entryFile,stateDir:_o,version:Z1,launcher:$.launcher},U=Y.repo||process.env[py1]?.trim()||process.env[dy1]?.trim()||bg0,Q=Y.targetVersion?.trim(),J=Q&&Q.toLowerCase()!=="latest"?Q:void 0;if(J){let D=J.replace(/^v/,""),P=dg0(D,Z1);if(P<0)if(!nS&&Y.force);else{f0({updated:!1,currentVersion:Z1,targetVersion:D,mode:mT()?"binary":"source",message:!nS?`Cannot downgrade seal-use from dev build v${Z1} to release v${D}. Use --force to overwrite.`:`Cannot downgrade seal-use from v${Z1} to older version v${D}. Updates must be forward-only.`});return}if(P===0&&!Y.force){f0({updated:!1,currentVersion:Z1,targetVersion:D,mode:mT()?"binary":"source",message:`seal-use is already at version v${Z1}. Use --force to reinstall.`});return}}if(Y.changelogOnly){let D=await oT(U,Y.limit??10);f0({currentVersion:Z1,totalQueried:D.length,releases:D.map((P)=>({version:P.version,tagName:P.tagName,publishedAt:P.publishedAt,author:P.author,releaseNotes:P.notes,releaseUrl:P.htmlUrl,isCurrent:P.version===Z1,isNewer:C5(P.version,Z1)}))});return}if(!mT()){if(Y.checkOnly){let P=await oT(U,30),T=P[0],A=T?.version??Z1,j=P.find((x)=>x.version===Z1),C=C5(A,Z1),b=P.filter((x)=>C5(x.version,Z1));if(T?.version)gq({latestVersion:T.version,publishedAt:T.publishedAt,releaseUrl:T.htmlUrl});if(Y.bgSave)return;f0({updated:!1,updateAvailable:C,currentVersion:Z1,currentVersionPublishedAt:j?.publishedAt,latestVersion:A,latestVersionPublishedAt:T?.publishedAt,behindCount:b.length,pendingReleases:b.map((x)=>({version:x.version,tagName:x.tagName,publishedAt:x.publishedAt,author:x.author,releaseNotes:x.notes,releaseUrl:x.htmlUrl})),releaseNotes:T?.notes??"",releaseUrl:T?.htmlUrl??"",mode:"source",message:"当前运行的是开发版。正式用户请安装正式版后使用 seal-use update。"});return}let D=bU(z).running;if(D)await r3("stop",z);try{fg0("git",["-C",$.appRoot,"pull","--ff-only"])}catch(P){console.error(`⚠️ 开发版更新同步失败,继续刷新本地依赖: ${P instanceof Error?P.message:String(P)}`)}if(fg0("bun",["install"],{cwd:$.appRoot}),D)await r3("start",z);f0({updated:!0,serviceRestarted:D,version:Z1,mode:"source"});return}if(sy1())try{await ay1($,Y,z,U,J);return}catch(D){console.error(`⚠️ Homebrew 自动更新失败,回退至原生二进制更新: ${D instanceof Error?D.message:String(D)}`)}let K=ly1(),I=oy1(),G=await oT(U,30),W=J?G.find((D)=>D.version===J||D.tagName===J||D.tagName===`v${J}`)??await sT(U,J):G[0]??await sT(U);if(!W){f0({updated:!1,
Line truncated
|
||||
`)}catch{}}async function $k1($,Y,z,U){let Q=xo(),J=[],K=z?z.startsWith("v")?z:`v${z}`:void 0,I=U||$.split("/").pop()||"";if(Q!=="github"){if(K&&I)J.push(`https://git.ying-qing.cn/gitea/seal-use/releases/download/${K}/${I}`,`https://git.ying-qing.cn/gitea/seal-home/releases/download/${K}/${I}`);if($.startsWith("https://git.ying-qing.cn"))J.push($)}if(Q!=="gitea")if(K&&I){let F=`https://github.com/${bg0}/releases/download/${K}/${I}`;if(!process.env.CI)J.push(`https://ghfast.top/${F}`,`https://gh.ddlc.top/${F}`);J.push(F)}else if($.includes("github.com")){if(!process.env.CI)J.push(`https://ghfast.top/${$}`,`https://gh.ddlc.top/${$}`);J.push($)}else J.push($);let G=Array.from(new Set(J)),W,H=6000,X=6000,Z=307200,q=1e4,V=180000;for(let F=0;F<G.length;F++){let w=G[F],M=new AbortController,O="",N=(A)=>{O=A;try{M.abort()}catch{}},D=setTimeout(()=>{N("Connection timed out (no response headers within 6s)")},H),P,T;try{lT(`==> [${F+1}/${G.length}] Downloading via: ${w}`);let A=await fetch(w,{signal:M.signal});if(D)clearTimeout(D),D=void 0;if(!A.ok)throw Error(`HTTP ${A.status} ${A.statusText}`);P=setTimeout(()=>{N("Overall download time exceeded 3 minutes")},V);let j=Number(A.headers.get("content-length"))||0,C=A.body?.getReader();if(!C){let c=Buffer.from(await A.arrayBuffer());if(c.length<1000)throw Error(`Downloaded content is suspiciously small (${c.length} bytes)`);kg0(Y,c),lT(`✓ Download succeeded (${(c.length/1024/1024).toFixed(1)} MB)`);return}let b=[],x=0,S=0;T=setTimeout(()=>{if(x<Z){let c=(x/1024).toFixed(1);N(`Initial transfer too slow (${c} KB < 300 KB in 6s), switching mirror...`)}},X);while(!0){let c=C.read(),U0,k=new Promise((g,p)=>{U0=setTimeout(()=>{p(Error("Data transfer stalled (no chunk received for 10s)"))},q)}),d;try{d=await Promise.race([c,k])}finally{if(U0)clearTimeout(U0)}let{done:t,value:$0}=d;if(t)break;if($0){if(b.push($0),x+=$0.length,T&&x>=Z)clearTimeout(T),T=void 0;let g=Date.now();if(g-S>200){S=g;let p=j?Math.round(x/j*100):0,e=(x/1048576).toFixed(1),y=j?(j/1048576).toFixed(1):"?";try{process.stderr.write(`\r ↳ Progress: ${p}% (${e} / ${y} MB)...`)}catch{}}}}try{process.stderr.write(`
|
||||
`)}catch{}let i=Buffer.concat(b);if(i.length<1000)throw Error(`Downloaded content is suspiciously small (${i.length} bytes)`);kg0(Y,i),lT(`✓ Download completed successfully (${(i.length/1024/1024).toFixed(1)} MB)`);return}catch(A){if(D)clearTimeout(D);if(T)clearTimeout(T);if(P)clearTimeout(P);let j=O||(A instanceof Error?A.message:String(A));W=Error(j),lT(`
|
||||
↳ Mirror failed: ${W.message}`)}finally{if(D)clearTimeout(D);if(T)clearTimeout(T);if(P)clearTimeout(P)}}throw Error(`Failed to download asset from all mirrors: ${W?.message}`)}function ng0($){let Y;try{Y=fy1($,{withFileTypes:!0})}catch{return[]}let z=[];for(let U of Y){let Q=rT($,U.name);if(U.isDirectory())z.push(...ng0(Q));else if(U.isFile())z.push(Q)}return z}function pg0($,Y,z){let U=Y==="windows"?"seal-use.exe":"seal-use",Q=ng0($);return Q.find((J)=>by1(J)===U)??Q[0]??z}function Yk1($,Y,z){let U=R5("tar",["-xzf",$,"-C",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract tar archive: ${U.stderr.toString()}`);return ug0($),pg0(Y,z,$)}function zk1($,Y,z){let U=R5("unzip",["-q","-o",$,"-d",Y],{stdio:"pipe"});if(U.status!==0)throw Error(`Failed to extract zip archive: ${U.stderr.toString()}`);return ug0($),pg0(Y,z,$)}function dg0($,Y){let z=$.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0),U=Y.replace(/^v/,"").split(".").map((Q)=>Number.parseInt(Q,10)||0);for(let Q=0;Q<Math.max(z.length,U.length);Q++){let J=z[Q]??0,K=U[Q]??0;if(J>K)return 1;if(J<K)return-1}return 0}function C5($,Y){return dg0($,Y)>0}function fg0($,Y,z={}){let U=R5($,Y,{cwd:z.cwd,encoding:"utf8",stdio:["ignore","pipe","pipe"]});if(U.stdout)console.error(U.stdout.trimEnd());if(U.stderr)console.error(U.stderr.trimEnd());if(U.status!==0)throw Error(`${$} ${Y.join(" ")} failed with status ${U.status}`)}var bg0="yunyingk/seal-use",yq="yunyingk/seal-home",py1="SEAL_USE_GITHUB_REPO",dy1="SEAL_HOME_GITHUB_REPO";var mg0=m(()=>{_g0();_q();yo();$3();Ro();I4();ho()});async function lg0($,Y,z,U,Q){if($==="create"){let J=h(Q.options.name)??Y,K=h(Q.options.phone);if(!J||!K)throw Error("Usage: seal-use users create --name <name> --phone <phone> [--dept <deptId>]");let I=h(Q.options.dept)??h(Q.options.departmentId);await k0("seal_user_create",z,U,{name:J,phone:K,departmentIds:I?[I]:void 0},C0(Q.options));return}if($==="reset-password"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users reset-password <userId>");await k0("seal_user_reset_password",z,U,{userId:J},C0(Q.options));return}if($==="search"||$==="list"){let J=Y??h(Q.options.keyword)??h(Q.options.query)??"";await k0("seal_user_search",z,U,{keyword:J},C0(Q.options));return}if($==="get"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users get <userId>");await k0("seal_user_get",z,U,{userId:J},C0(Q.options));return}if($==="delete"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users delete <userId>");await k0("seal_user_delete",z,U,{userId:J},C0(Q.options));return}if($==="activate"){let J=Y??h(Q.options.userId);if(!J)throw Error("Usage: seal-use users activate <userId>");await k0("seal_user_activate",z,U,{userId:J},C0(Q.options));return}if($==="delegation"||$==="impersonate"){let J=Y??h(Q.options.userId)??h(Q.options.phone);if(!J)throw Error("Usage: seal-use users delegation <userIdOrPhone> [--note <note>]");let K=h(Q.options.note);await k0("seal_user_delegation_create",z,U,{userIdOrPhone:J,note:K},C0(Q.options));return}throw Error(`Unknown users command: ${$??""}. Run 'seal-use help' for available commands.`)}var og0=m(()=>{f4();D4();I4()});import{dirname as fo,join as Uk1}from"node:path";import{fileURLToPath as Qk1}from"node:url";function Gk1($){if(!$.length)return!1;let Y=$[0]?.toLowerCase(),z=$[1]?.toLowerCase();if(Y&&Ik1.has(Y))return!0;if((Y==="service"||Y==="daemon")&&z==="run")return!0;return!1}function hq($,Y={}){if(Gk1($))return ag0($,Y);let z=sg0.then(()=>ag0($,Y));return sg0=z.then(()=>{return},()=>{return}),z}async function ag0($,Y){let z=[],U=[],Q=console.log,J=console.error,K={appRoot:Y.appRoot??rg0,entryFile:Y.entryFile??Uk1(Y.appRoot??rg0,"src","cli.ts"),launcher:Y.launcher};console.log=(...I)=>{z.push(gl(I))},console.error=(...I)=>{U.push(gl(I))};try{return await Wk1($,K),{stdout:Nq(z),stderr:Nq(U),isError:!1,exitCode:0}}catch(I){let G=Dq(I instanceof Error?I.message:String(I)),W=SZ(I);if(U.push(G),W.nextAction&&!G.includes("Next action:"))U.push(`\uD83D\uDC49 Next action: ${W.nextAction}`);return{stdout:Nq(z),stderr:Nq(U),isError:!0,exitCode:W.exitCode}}finally{console.log=Q,console.error=J}}async function Wk1($,Y){let z=Oq($),[U,Q,J]=z.command,K=U?.toLowerCase(),I=K?Jk1.has(K):!1,G=I?"update":K;if(G==="version"||G==="v"||Boolean(z.options.version)||Boolean(z.options.v)||Boolean(z.options.V)){let Z=hg0(),q=Z?.latestVersion?C5(Z.latestVersion,mY.version):!1,V={...mY,...Z?.latestVersion?{latestVersion:Z.latestVersion,updateAvailable:q,lastCheckedAt:Z.checkedAt}:{}};if(q&&Z?.latestVersion)console.error(`\uD83D\uDCA1 发现新版本可用: v${mY.version} -> v${Z.latestVersion}`),console.error(`\uD83D\uDC49 Next action: seal-use update
|
||||
`);if(f0(V),Sg0(Z))gg0(Y.launcher);return}let W=R_0(z);if(W.isHelp){S_0(W.target);return}if(!G||!Kk1.has(G))throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`);if(G==="webhook"&&(Q==="resource-pack"||Q==="pack"||Q==="material-pack")&&J==="preview"){let Z=z.command[3]??h(z.options.file)??h(z.options.input);if(!Z)throw Error("Usage: seal-use webhook resource-pack preview <资源包.zip>");await y_0(Z,xI(z.options));return}if(G==="openapi"){tS0(z);return}if(G==="mcp-config"){Po();return}if(G==="skill"){wg0(Q,J,z);return}if(G==="mcp"||G==="server"){await oS0(Q,z);return}if(G==="probe"){await Ig0(Q,J,z);return}if(G==="doctor"){await yS0(Q,J,z);return}if(G==="test"){await go(Q,J,z);return}if(G==="config"){Bh0(Q,J,z);return}if(G==="service"){await vo(Q,Y,z);return}if(G==="stop"){await vo("stop",Y,z);return}if(G==="http"||G==="serve"){await pS0(z);return}if(I||G==="changelog"){if(I&&U!=="update")console.error(`⚠️ Notice: '${U}' is an alias for 'seal-use update'. Please use 'seal-use update' instead.`);let Z=Q?.toLowerCase(),q=G==="changelog"||Z==="changelog"||Z==="log"||Z==="history"||Z0(z.options.changelog)===!0,V=Z==="check"||Z0(z.options.check)===!0||Z0(z.options["check-only"])===!0,F=Z0(z.options["bg-save"])===!0||Z0(z.options["silent-save"])===!0,w=h(z.options.version)??h(z.options.tag)??(!q&&!V&&!F&&Q&&!Q.startsWith("-")?Q:void 0);await ig0(Y,{checkOnly:V||F,changelogOnly:q,limit:s0(z.options.limit),force:Z0(z.options.force),targetVersion:w,repo:h(z.options.repo),bgSave:F});return}if(G==="tools"&&Q==="list"){Cg0();return}if(G==="corps"||G==="corp"){if(Q==="regression"||Q==="test-regression"){await go("regression",J,z);return}await qh0(Q,J,z);return}if(G==="rules"&&Q==="lint"&&(("file"in z.options)||("f"in z.options))){let Z;try{Z=j1(h(z.options.corp))}catch{Z={id:"local",name:"Local Workspace",source:{type:"native"}}}await To(Q,J,null,Z,z);return}if(G==="auth"&&(Q==="extract-keys"||Q==="extract-key")){await zo(J,z);return}if(G==="auth"&&(Q==="link"||Q==="seal-link")&&(("from-link"in z.options)||J==="from-link")){await ST(Q,null,z);return}let H=j1(h(z.options.corp));if(G==="source"){await Ng0(Q,H);return}if(G==="auth"){await ST(Q,H,z);return}let X=await P1(H);if(G==="users"){await lg0(Q,J,X,H,z);return}if(G==="contacts"){await Th0(Q,J,X,H,z);return}if(G==="data"){await Eh0(Q,X,H,z);return}if(G==="llm"){await mS0(Q,X,H,z);return}if(G==="permissions"){await $g0(Q,X,H,z);return}if(G==="billing"){await Dh0(Q,X,H,z);return}if(G==="webhook"||G==="webhooks"){await DT(Q,J,X,H,z);return}if(G==="context"){await Rh0(X,H,z);return}if(G==="rules"){await To(Q,J,X,H,z);return}if(G==="approval-runs"){await k_0(Q,J,X,H,z);return}if(G==="analytics"){await f_0(Q,J,X,H,z);return}if(G==="simulation"){await Lg0(Q,J,X,H,z);return}if(G==="deploy"){await vh0(Q,J,z.command[3],X,H,z);return}if(G==="preference"||G==="preferences"){await Ug0(Q,J,z.command[3],z.command[4],X,H,z);return}if(G==="tool"){await jg0(Q,X,H,z);return}throw Error(`Unknown command: ${z.command.join(" ")}. Run 'seal-use help' for available commands.`)}var rg0,Jk1,Kk1,Ik1,sg0;var Ao=m(()=>{J$();$3();x_0();u_0();Uo();Ah0();Ph0();jh0();Ch0();_h0();el();hh0();kS0();dS0();lS0();rS0();eS0();Yg0();Qg0();Gg0();Wg0();ho();Fg0();Og0();Dg0();Tg0();Eg0();Rg0();mg0();yo();og0();kl();F$();f4();D4();Sl();I4();rg0=fo(fo(fo(Qk1(import.meta.url)))),Jk1=new Set(["update","upgrade","up","self-update","selfupdate"]),Kk1=new Set(["config","service","stop","http","serve","update","tools","corps","corp","tool","source","auth","users","contacts","data","llm","permissions","billing","webhook","webhooks","context","rules","approval-runs","analytics","simulation","deploy","preference","preferences","mcp","server","mcp-config","skill","openapi","probe","doctor","changelog","test"]),Ik1=new Set(["http","server","web","mcp"]);sg0=Promise.resolve()});function qk1($){let{command:Y}=Oq($),z=(Y[0]??"").toLowerCase();return{area:Hk1[z]??z,actionTokens:Y.slice(1).map((U)=>U.toLowerCase())}}function tg0($){let Y,z;try{({area:Y,actionTokens:z}=qk1($))}catch{return!1}if(z.length===0&&Zk1.has(Y))return!0;if(Y==="tool"){let Q=z[0];return Q!==void 0&&M_0(Q)}let U=Xk1[Y];if(!U)return!1;return U.some((Q)=>{let J=Q.split(" ").filter(Boolean);if(J.length===0)return z.length===0;if(J.length>z.length)return!1;return J.every((K,I)=>K===z[I])})}var Hk1,Xk1,Zk1;var eg0=m(()=>{wq();D4();Hk1={corp:"corps",webhooks:"webhook",preferences:"preference"},Xk1={corps:["list","search","get","current"],rules:["count","list","versions","version","diff","get","search","lint","linters","pull","map"],webhook:["ready","status","list","get","resource-pack export","resource-pack preview"],"approval-runs":["summary","stats","count","export","flow","list","search","pick","bridge","get","cited-rules","document-summary","attachments","result","link","url"],simulation:["batch-records","status","wait","specifications","approval-definitions","list","get","templates","integrations"],deploy:[
Line truncated
|
||||
`)?"":`
|
||||
`}`);process.exitCode=$.exitCode}var s3,mg0,sT="seal_cli",xq="seal_cli_write",lg0="SEAL_USE_MCP_ENABLED",og0="SEAL_HOME_MCP_ENABLED",zk1;var iS0=o(async()=>{ge();xe();A$();Oo();ng0();L$();$3();s3=$k1(import.meta.url),mg0=s3.includes("/dist/mcp/")||s3.includes("\\dist\\mcp\\")?yq(yq(yq(s3))):yq(yq(s3));zk1=Boolean(K0.main==K0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&pg0(process.argv[1])===pg0(s3));if(zk1)if(process.argv[2]==="--seal-use-cli")await Yk1();else try{ag0()}catch($){console.error($),process.exitCode=1}});await iS0();export{_q as tokenizeCommand,ag0 as startServer,rg0 as resolveMcpEnabled,sg0 as createServer,lg0 as SEAL_MCP_ENABLED_ENV,xq as SEAL_CLI_WRITE_TOOL_NAME,sT as SEAL_CLI_TOOL_NAME,og0 as LEGACY_SEAL_MCP_ENABLED_ENV};
|
||||
`}`);process.exitCode=$.exitCode}var s3,zy0,aT="seal_cli",fq="seal_cli_write",Uy0="SEAL_USE_MCP_ENABLED",Qy0="SEAL_HOME_MCP_ENABLED",Fk1;var aS0=m(async()=>{xe();be();B$();Ao();eg0();F$();$3();s3=Vk1(import.meta.url),zy0=s3.includes("/dist/mcp/")||s3.includes("\\dist\\mcp\\")?kq(kq(kq(s3))):kq(kq(s3));Fk1=Boolean(K0.main==K0.module||!import.meta.url.includes("$bunfs")&&process.argv[1]&&$y0(process.argv[1])===$y0(s3));if(Fk1)if(process.argv[2]==="--seal-use-cli")await Lk1();else try{Iy0()}catch($){console.error($),process.exitCode=1}});await aS0();export{vq as tokenizeCommand,Iy0 as startServer,Jy0 as resolveMcpEnabled,Ky0 as createServer,Uy0 as SEAL_MCP_ENABLED_ENV,fq as SEAL_CLI_WRITE_TOOL_NAME,aT as SEAL_CLI_TOOL_NAME,Qy0 as LEGACY_SEAL_MCP_ENABLED_ENV};
|
||||
@@ -47,6 +47,7 @@ seal-use rules list [--summary] [--count] [--limit 20] [--offset 0] [--corp <cor
|
||||
seal-use rules clear [--corp <corpId>] [--dry-run|--yes]
|
||||
seal-use rules versions [--corp <corpId>]
|
||||
seal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]
|
||||
seal-use rules diff <fromVersion> <toVersion> [--rule-id <stableRuleId>] [--include-unchanged] [--format unified|json] [--corp <corpId>]
|
||||
seal-use rules get --corp <corpId> --version <number|latest> --code '#0038'
|
||||
seal-use rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205
|
||||
seal-use rules search <keyword> [--version <versionId|versionNumber|latest>] [--maxResults 20] [--corp <corpId>]
|
||||
@@ -261,6 +262,7 @@ Approval rule maintenance:
|
||||
|
||||
- `seal-use rules count [--corp <corpId>]`
|
||||
- `seal-use rules list --summary [--corp <corpId>]`
|
||||
- `seal-use rules diff <fromVersion> <toVersion> [--rule-id <stableRuleId>] [--include-unchanged] [--format unified|json] [--corp <corpId>]` (compares published snapshots by stable rule ID and returns structured changes plus a Git-style `unifiedDiff`; it refuses to match by code or position)
|
||||
- `seal-use rules map [--corp <corpId>] [--version <id|num|latest>] [--code <code>]` (reads local sync rule mapping snapshot)
|
||||
- `seal-use rules pull [--corp <corpId>] [--version <id|num|latest>] [--out <file>]`
|
||||
- `seal-use rules lint [--file <path>] [--corp <corpId>] [--linter <name|path>] [--version <num>] [--code <code>] [--min-score <score>] [--summary]`
|
||||
@@ -272,7 +274,7 @@ Rule identity and versioning:
|
||||
|
||||
- `rules list` and `rules pull` read the current **draft** rule set. Their `code` values belong to the draft code space.
|
||||
- A published version has its own snapshot and code space. Publishing can recode rules, so a published `code` may differ from the draft `code`, and codes can shift again after later edits and publishes.
|
||||
- Do not use a draft `#NN` as a cross-version identifier. For current draft work, prefer the stable rule `id`; for historical behavior, select the published `version` and locate the rule by its text/context or runtime rule ID from the approval run.
|
||||
- Do not use a draft `#NN` as a cross-version identifier. `rules diff` matches only the stable rule ID returned in each published snapshot. If the API response lacks that ID, the command fails instead of guessing from code or array position.
|
||||
- `rules get --version ... --code ...` interprets `code` inside that selected published version, while `rules get --record-id ... --runtime-id ...` resolves the version recorded on the run.
|
||||
|
||||
Approval run lightweight queries:
|
||||
|
||||
@@ -112,6 +112,28 @@ export async function handleRulesCommand(
|
||||
return;
|
||||
}
|
||||
|
||||
if (action === "diff") {
|
||||
const from = stringOption(args.options.from) ?? maybeName;
|
||||
const to = stringOption(args.options.to) ?? args.command[3];
|
||||
if (!from || !to) {
|
||||
throw new Error("Usage: seal-use rules diff <fromVersion> <toVersion> [--rule-id <stableRuleId>]");
|
||||
}
|
||||
await runTool(
|
||||
"seal_approval_rule_version_diff",
|
||||
client,
|
||||
corp,
|
||||
{
|
||||
from,
|
||||
to,
|
||||
ruleId: stringOption(args.options.ruleId) ?? stringOption(args.options["rule-id"]),
|
||||
includeUnchanged: booleanOption(args.options.includeUnchanged) ?? booleanOption(args.options["include-unchanged"]),
|
||||
format: stringOption(args.options.format)
|
||||
},
|
||||
outputOptions(args.options)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (action === "get") {
|
||||
await runTool(
|
||||
"seal_approval_rule_get",
|
||||
@@ -260,5 +282,5 @@ export async function handleRulesCommand(
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown rules command: ${action ?? ""}. Available: count, list, clear, versions, version, get, search, lint, linters, pull, push, map. Run 'seal-use help' for available commands.`);
|
||||
throw new Error(`Unknown rules command: ${action ?? ""}. Available: count, list, clear, versions, version, diff, get, search, lint, linters, pull, push, map. Run 'seal-use help' for available commands.`);
|
||||
}
|
||||
@@ -243,6 +243,17 @@ export const HELP_REGISTRY: AreaHelp[] = [
|
||||
summary: "Inspect a specific rule version",
|
||||
usage: ["seal-use rules version <versionId|versionNumber|latest> [--corp <corpId>]"]
|
||||
},
|
||||
{
|
||||
name: "diff",
|
||||
summary: "Compare two published rule versions by stable rule ID",
|
||||
usage: ["seal-use rules diff <fromVersion> <toVersion> [--rule-id <stableRuleId>] [--include-unchanged] [--format unified|json] [--corp <corpId>]"],
|
||||
options: [
|
||||
{ flag: "--rule-id <id>", description: "Compare only one stable rule ID; never fall back to code or position" },
|
||||
{ flag: "--include-unchanged", description: "Include unchanged rules in the structured changes list" },
|
||||
{ flag: "--format unified|json", description: "Return unified diff text together with structured metadata" }
|
||||
],
|
||||
description: "Compares published snapshots with stable rule IDs. The command refuses to guess when a snapshot lacks an ID, so code reordering cannot create a false match."
|
||||
},
|
||||
{
|
||||
name: "get",
|
||||
summary: "Get single rule by code or record ID",
|
||||
|
||||
@@ -28,7 +28,7 @@ const AREA_ALIASES: Record<string, string> = {
|
||||
*/
|
||||
const READ_ONLY_COMMANDS: Record<string, string[]> = {
|
||||
corps: ["list", "search", "get", "current"],
|
||||
rules: ["count", "list", "versions", "version", "get", "search", "lint", "linters", "pull", "map"],
|
||||
rules: ["count", "list", "versions", "version", "diff", "get", "search", "lint", "linters", "pull", "map"],
|
||||
webhook: ["ready", "status", "list", "get", "resource-pack export", "resource-pack preview"],
|
||||
"approval-runs": [
|
||||
"summary",
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { diffRuleVersions } from "./rule-diff.js";
|
||||
import { PublishedRuleSnapshotSchema, RuleSetVersionSchema, type RuleSetVersion } from "./types.js";
|
||||
|
||||
function version(versionNumber: number, rules: Array<Record<string, unknown>>): RuleSetVersion {
|
||||
return {
|
||||
id: `version-${versionNumber}`,
|
||||
versionNumber,
|
||||
versionName: `v${versionNumber}`,
|
||||
rules
|
||||
} as RuleSetVersion;
|
||||
}
|
||||
|
||||
describe("published rule version diff", () => {
|
||||
test("preserves unknown snapshot fields and matches reordered rules by stable ID", () => {
|
||||
const from = version(1, [
|
||||
{
|
||||
id: "rule-a",
|
||||
code: "#0001",
|
||||
description: "Original travel policy",
|
||||
scope: "travel",
|
||||
strictness: "MUST_FOLLOW",
|
||||
backendMetadata: { owner: "finance" }
|
||||
},
|
||||
{
|
||||
id: "rule-b",
|
||||
code: "#0002",
|
||||
description: "Meal policy",
|
||||
scope: "meal",
|
||||
strictness: "SHOULD_FOLLOW"
|
||||
}
|
||||
]);
|
||||
const to = version(2, [
|
||||
{
|
||||
id: "rule-b",
|
||||
code: "#0001",
|
||||
description: "Meal policy",
|
||||
scope: "meal",
|
||||
strictness: "SHOULD_FOLLOW"
|
||||
},
|
||||
{
|
||||
id: "rule-a",
|
||||
code: "#0002",
|
||||
description: "Updated travel policy",
|
||||
scope: "travel",
|
||||
strictness: "MUST_FOLLOW",
|
||||
backendMetadata: { owner: "finance" }
|
||||
},
|
||||
{
|
||||
id: "rule-c",
|
||||
code: "#0003",
|
||||
description: "New invoice policy",
|
||||
scope: "invoice",
|
||||
strictness: "SUGGESTION"
|
||||
}
|
||||
]);
|
||||
|
||||
const result = diffRuleVersions(from, to);
|
||||
|
||||
expect(result.counts).toEqual({ added: 1, removed: 0, modified: 1, unchanged: 1 });
|
||||
expect(result.changes.map((change) => [change.ruleId, change.status])).toEqual([
|
||||
["rule-a", "modified"],
|
||||
["rule-c", "added"]
|
||||
]);
|
||||
expect(result.changes[0]?.changedFields).toEqual(["description"]);
|
||||
expect(result.changes[0]?.diff).toContain("diff --git a/rules/rule-a b/rules/rule-a");
|
||||
expect(result.changes[0]?.diff).toContain("- \"description\": \"Original travel policy\"");
|
||||
expect(result.changes[0]?.diff).toContain("+ \"description\": \"Updated travel policy\"");
|
||||
expect(result.changes[0]?.before?.backendMetadata).toEqual({ owner: "finance" });
|
||||
});
|
||||
|
||||
test("refuses to match snapshots without a stable ID", () => {
|
||||
const from = version(1, [{
|
||||
code: "#0001",
|
||||
description: "Policy",
|
||||
scope: "travel",
|
||||
strictness: "MUST_FOLLOW"
|
||||
}]);
|
||||
const to = version(2, [{
|
||||
code: "#0001",
|
||||
description: "Policy changed",
|
||||
scope: "travel",
|
||||
strictness: "MUST_FOLLOW"
|
||||
}]);
|
||||
|
||||
expect(() => diffRuleVersions(from, to)).toThrow("refuses to match by code or position");
|
||||
});
|
||||
|
||||
test("rejects duplicate stable IDs within one version", () => {
|
||||
const rules = [
|
||||
{ id: "rule-a", description: "A", scope: "travel", strictness: "MUST_FOLLOW" },
|
||||
{ id: "rule-a", description: "B", scope: "meal", strictness: "SHOULD_FOLLOW" }
|
||||
];
|
||||
|
||||
expect(() => diffRuleVersions(version(1, rules), version(2, []))).toThrow("duplicate stable rule ID: rule-a");
|
||||
});
|
||||
|
||||
test("parses and retains backend fields omitted from the original snapshot model", () => {
|
||||
const parsed = PublishedRuleSnapshotSchema.parse({
|
||||
id: "rule-a",
|
||||
code: "#0001",
|
||||
description: "Policy",
|
||||
scope: "travel",
|
||||
strictness: "MUST_FOLLOW",
|
||||
backendMetadata: { source: "published" }
|
||||
});
|
||||
|
||||
expect(parsed).toMatchObject({
|
||||
id: "rule-a",
|
||||
backendMetadata: { source: "published" }
|
||||
});
|
||||
|
||||
const versionWithExtraField = RuleSetVersionSchema.parse({
|
||||
id: "version-1",
|
||||
versionNumber: 1,
|
||||
rules: [parsed],
|
||||
backendVersionMetadata: { source: "published" }
|
||||
});
|
||||
expect(versionWithExtraField.backendVersionMetadata).toEqual({ source: "published" });
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,214 @@
|
||||
import type { RuleSetVersion } from "./types.js";
|
||||
|
||||
export type RuleDiffStatus = "added" | "removed" | "modified" | "unchanged";
|
||||
|
||||
export type RuleDiffChange = {
|
||||
status: RuleDiffStatus;
|
||||
ruleId: string;
|
||||
before?: Record<string, unknown>;
|
||||
after?: Record<string, unknown>;
|
||||
changedFields?: string[];
|
||||
diff?: string;
|
||||
};
|
||||
|
||||
export type RuleVersionDiff = {
|
||||
from: RuleVersionRef;
|
||||
to: RuleVersionRef;
|
||||
counts: Record<RuleDiffStatus, number>;
|
||||
changes: RuleDiffChange[];
|
||||
unifiedDiff: string;
|
||||
};
|
||||
|
||||
export type RuleVersionRef = {
|
||||
id: string;
|
||||
versionNumber: number;
|
||||
versionName?: string | null;
|
||||
publishedAt?: number;
|
||||
};
|
||||
|
||||
// Runtime IDs are version-local in this API and may be derived from the rule's position.
|
||||
// They must never become an implicit cross-version identity.
|
||||
const ID_FIELDS = ["id", "ruleId", "stableId"] as const;
|
||||
const IGNORED_FIELDS = new Set([
|
||||
...ID_FIELDS,
|
||||
"code",
|
||||
"ruleCode",
|
||||
"tenantId",
|
||||
"createdAt",
|
||||
"updatedAt",
|
||||
"versionId",
|
||||
"versionNumber"
|
||||
]);
|
||||
|
||||
function asRecord(value: unknown): Record<string, unknown> {
|
||||
return value && typeof value === "object" && !Array.isArray(value)
|
||||
? value as Record<string, unknown>
|
||||
: {};
|
||||
}
|
||||
|
||||
export function stableRuleId(rule: unknown): string | undefined {
|
||||
const object = asRecord(rule);
|
||||
for (const field of ID_FIELDS) {
|
||||
const value = object[field];
|
||||
if (typeof value === "string" && value.trim()) return value.trim();
|
||||
if (typeof value === "number" && Number.isFinite(value)) return String(value);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function sortValue(value: unknown): unknown {
|
||||
if (Array.isArray(value)) return value.map(sortValue);
|
||||
if (!value || typeof value !== "object") return value;
|
||||
return Object.fromEntries(
|
||||
Object.entries(value as Record<string, unknown>)
|
||||
.sort(([left], [right]) => left.localeCompare(right))
|
||||
.map(([key, item]) => [key, sortValue(item)])
|
||||
);
|
||||
}
|
||||
|
||||
function comparableRule(rule: unknown): Record<string, unknown> {
|
||||
const object = asRecord(rule);
|
||||
return sortValue(
|
||||
Object.fromEntries(
|
||||
Object.entries(object).filter(([key]) => !IGNORED_FIELDS.has(key))
|
||||
)
|
||||
) as Record<string, unknown>;
|
||||
}
|
||||
|
||||
function ruleLines(rule: Record<string, unknown> | undefined): string[] {
|
||||
return rule ? JSON.stringify(comparableRule(rule), null, 2).split("\n") : [];
|
||||
}
|
||||
|
||||
function lineDiff(before: string[], after: string[]): string[] {
|
||||
const rows = Array.from({ length: before.length + 1 }, () => Array<number>(after.length + 1).fill(0));
|
||||
for (let i = before.length - 1; i >= 0; i -= 1) {
|
||||
for (let j = after.length - 1; j >= 0; j -= 1) {
|
||||
rows[i]![j] = before[i] === after[j]
|
||||
? rows[i + 1]![j + 1]! + 1
|
||||
: Math.max(rows[i + 1]![j]!, rows[i]![j + 1]!);
|
||||
}
|
||||
}
|
||||
|
||||
const output: string[] = [];
|
||||
let i = 0;
|
||||
let j = 0;
|
||||
while (i < before.length && j < after.length) {
|
||||
if (before[i] === after[j]) {
|
||||
output.push(` ${before[i]}`);
|
||||
i += 1;
|
||||
j += 1;
|
||||
} else if (rows[i + 1]![j]! >= rows[i]![j + 1]!) {
|
||||
output.push(`-${before[i]}`);
|
||||
i += 1;
|
||||
} else {
|
||||
output.push(`+${after[j]}`);
|
||||
j += 1;
|
||||
}
|
||||
}
|
||||
while (i < before.length) output.push(`-${before[i++]}`);
|
||||
while (j < after.length) output.push(`+${after[j++]}`);
|
||||
return output;
|
||||
}
|
||||
|
||||
function formatPatch(
|
||||
ruleId: string,
|
||||
from: RuleVersionRef,
|
||||
to: RuleVersionRef,
|
||||
before: Record<string, unknown> | undefined,
|
||||
after: Record<string, unknown> | undefined
|
||||
): string {
|
||||
const beforeLines = ruleLines(before);
|
||||
const afterLines = ruleLines(after);
|
||||
const fromLabel = `v${from.versionNumber}`;
|
||||
const toLabel = `v${to.versionNumber}`;
|
||||
const oldPath = before ? `a/rules/${ruleId}` : "/dev/null";
|
||||
const newPath = after ? `b/rules/${ruleId}` : "/dev/null";
|
||||
const oldCount = beforeLines.length;
|
||||
const newCount = afterLines.length;
|
||||
const oldStart = oldCount ? 1 : 0;
|
||||
const newStart = newCount ? 1 : 0;
|
||||
|
||||
return [
|
||||
`diff --git a/rules/${ruleId} b/rules/${ruleId}`,
|
||||
`--- ${oldPath}\t${fromLabel}`,
|
||||
`+++ ${newPath}\t${toLabel}`,
|
||||
`@@ -${oldStart},${oldCount} +${newStart},${newCount} @@`,
|
||||
...lineDiff(beforeLines, afterLines)
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
function versionRef(version: RuleSetVersion): RuleVersionRef {
|
||||
return {
|
||||
id: version.id,
|
||||
versionNumber: version.versionNumber,
|
||||
versionName: version.versionName,
|
||||
publishedAt: version.publishedAt
|
||||
};
|
||||
}
|
||||
|
||||
function indexRules(version: RuleSetVersion): Map<string, Record<string, unknown>> {
|
||||
const indexed = new Map<string, Record<string, unknown>>();
|
||||
for (const rule of version.rules) {
|
||||
const object = asRecord(rule);
|
||||
const id = stableRuleId(object);
|
||||
if (!id) {
|
||||
throw new Error(
|
||||
`Rule version ${version.versionNumber} contains a rule without a stable rule ID. ` +
|
||||
"Cross-version diff refuses to match by code or position."
|
||||
);
|
||||
}
|
||||
if (indexed.has(id)) throw new Error(`Rule version ${version.versionNumber} contains duplicate stable rule ID: ${id}`);
|
||||
indexed.set(id, object);
|
||||
}
|
||||
return indexed;
|
||||
}
|
||||
|
||||
export function diffRuleVersions(
|
||||
fromVersion: RuleSetVersion,
|
||||
toVersion: RuleSetVersion,
|
||||
options: { includeUnchanged?: boolean } = {}
|
||||
): RuleVersionDiff {
|
||||
const before = indexRules(fromVersion);
|
||||
const after = indexRules(toVersion);
|
||||
const ids = [...new Set([...before.keys(), ...after.keys()])];
|
||||
const changes: RuleDiffChange[] = [];
|
||||
const counts: Record<RuleDiffStatus, number> = { added: 0, removed: 0, modified: 0, unchanged: 0 };
|
||||
const from = versionRef(fromVersion);
|
||||
const to = versionRef(toVersion);
|
||||
|
||||
for (const ruleId of ids) {
|
||||
const beforeRule = before.get(ruleId);
|
||||
const afterRule = after.get(ruleId);
|
||||
let status: RuleDiffStatus;
|
||||
if (!beforeRule) status = "added";
|
||||
else if (!afterRule) status = "removed";
|
||||
else if (JSON.stringify(comparableRule(beforeRule)) !== JSON.stringify(comparableRule(afterRule))) status = "modified";
|
||||
else status = "unchanged";
|
||||
|
||||
counts[status] += 1;
|
||||
if (status === "unchanged" && !options.includeUnchanged) continue;
|
||||
|
||||
const beforeComparable = beforeRule ? comparableRule(beforeRule) : undefined;
|
||||
const afterComparable = afterRule ? comparableRule(afterRule) : undefined;
|
||||
const changedFields = status === "modified"
|
||||
? [...new Set([...Object.keys(beforeComparable ?? {}), ...Object.keys(afterComparable ?? {})])]
|
||||
.filter((key) => JSON.stringify(beforeComparable?.[key]) !== JSON.stringify(afterComparable?.[key]))
|
||||
: undefined;
|
||||
|
||||
changes.push({
|
||||
status,
|
||||
ruleId,
|
||||
...(beforeRule ? { before: beforeRule } : {}),
|
||||
...(afterRule ? { after: afterRule } : {}),
|
||||
...(changedFields?.length ? { changedFields } : {}),
|
||||
...(status !== "unchanged" ? { diff: formatPatch(ruleId, from, to, beforeRule, afterRule) } : {})
|
||||
});
|
||||
}
|
||||
|
||||
const unifiedDiff = changes
|
||||
.filter((change) => change.diff)
|
||||
.map((change) => change.diff)
|
||||
.join("\n");
|
||||
|
||||
return { from, to, counts, changes, unifiedDiff };
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import { resolveCorpConfig } from "../../core/config/manager.js";
|
||||
import { createSealClient, createSealClientForToken } from "../../core/http/factory.js";
|
||||
import { resolveSealCustomHeaders } from "../../core/http/request-headers.js";
|
||||
import { searchApprovalContent } from "./search.js";
|
||||
import { diffRuleVersions } from "./rule-diff.js";
|
||||
import { executeApprovalRunsReplay, resolveReplayCorpPair } from "./webhook-replay.js";
|
||||
import { loadRuleLinter, lintRuleBatch, lintSingleRule, type RuleLintTarget } from "./linter/index.js";
|
||||
import {
|
||||
@@ -560,6 +561,45 @@ export const sealTools = [
|
||||
return version;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_version_diff",
|
||||
description: "按稳定规则 ID 对比两个已发布审批规则版本,返回新增、删除、修改和 Unified Diff",
|
||||
parameters: z.object({
|
||||
from: z.string().min(1).describe("起始规则版本号、版本 ID 或 latest"),
|
||||
to: z.string().min(1).describe("目标规则版本号、版本 ID 或 latest"),
|
||||
ruleId: z.string().optional().describe("只对比指定稳定规则 ID"),
|
||||
includeUnchanged: z.boolean().optional().describe("是否返回未变化规则,默认 false"),
|
||||
format: z.enum(["unified", "json"]).default("unified").describe("输出格式;unified 将 diff 文本放入 unifiedDiff 字段")
|
||||
}),
|
||||
handler: async (
|
||||
client: KyInstance,
|
||||
params: {
|
||||
from: string;
|
||||
to: string;
|
||||
ruleId?: string;
|
||||
includeUnchanged?: boolean;
|
||||
format?: "unified" | "json";
|
||||
}
|
||||
) => {
|
||||
const fromVersion = await resolveRuleVersionSelector(client, params.from);
|
||||
const toVersion = await resolveRuleVersionSelector(client, params.to);
|
||||
const result = diffRuleVersions(fromVersion, toVersion, {
|
||||
includeUnchanged: params.includeUnchanged
|
||||
});
|
||||
if (!params.ruleId) return { ...result, format: params.format ?? "unified" };
|
||||
|
||||
const changes = result.changes.filter((change) => change.ruleId === params.ruleId);
|
||||
const counts = { added: 0, removed: 0, modified: 0, unchanged: 0 };
|
||||
for (const change of changes) counts[change.status] += 1;
|
||||
return {
|
||||
...result,
|
||||
counts,
|
||||
changes,
|
||||
unifiedDiff: changes.map((change) => change.diff).filter(Boolean).join("\n"),
|
||||
format: params.format ?? "unified"
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "seal_approval_rule_version_publish",
|
||||
description: "发布 Seal 草稿审批规则为新版本",
|
||||
@@ -2732,6 +2772,7 @@ export const SEAL_READ_ONLY_TOOLS: ReadonlySet<string> = new Set([
|
||||
"seal_approval_document_get",
|
||||
"seal_approval_documents_list",
|
||||
"seal_approval_rule_get",
|
||||
"seal_approval_rule_version_diff",
|
||||
"seal_approval_rule_version_get",
|
||||
"seal_approval_rule_versions_list",
|
||||
"seal_approval_rules_lint",
|
||||
@@ -3842,6 +3883,27 @@ async function resolveRuleVersion(
|
||||
return version;
|
||||
}
|
||||
|
||||
async function resolveRuleVersionSelector(client: KyInstance, selector: string): Promise<RuleSetVersion> {
|
||||
const normalized = selector.trim();
|
||||
if (!normalized) throw new Error("Rule version selector cannot be empty");
|
||||
if (normalized === "latest") {
|
||||
const versions = await api.listApprovalRuleVersions(client);
|
||||
const latest = versions[0];
|
||||
if (!latest) throw new Error("No rule versions found");
|
||||
return api.getApprovalRuleVersion(client, latest.id);
|
||||
}
|
||||
|
||||
const versionNumber = Number(normalized);
|
||||
if (Number.isInteger(versionNumber) && versionNumber > 0) {
|
||||
const versions = await api.listApprovalRuleVersions(client);
|
||||
const version = versions.find((item) => item.versionNumber === versionNumber);
|
||||
if (!version) throw new Error(`Rule version not found: ${versionNumber}`);
|
||||
return api.getApprovalRuleVersion(client, version.id);
|
||||
}
|
||||
|
||||
return api.getApprovalRuleVersion(client, normalized);
|
||||
}
|
||||
|
||||
function filterRuns(records: ApprovalRun[], query?: string): ApprovalRun[] {
|
||||
const normalized = query?.trim().toLowerCase();
|
||||
if (!normalized) return records;
|
||||
|
||||
@@ -89,11 +89,16 @@ export const ApprovalRulesDataSchema = z.object({
|
||||
});
|
||||
|
||||
export const PublishedRuleSnapshotSchema = z.object({
|
||||
code: z.string().optional(),
|
||||
id: z.union([z.string(), z.number()]).optional(),
|
||||
ruleId: z.union([z.string(), z.number()]).optional(),
|
||||
stableId: z.union([z.string(), z.number()]).optional(),
|
||||
runtimeRuleId: z.union([z.string(), z.number()]).optional(),
|
||||
runtimeId: z.union([z.string(), z.number()]).optional(),
|
||||
code: z.union([z.string(), z.number()]).optional(),
|
||||
description: z.string(),
|
||||
scope: z.string(),
|
||||
strictness: z.string()
|
||||
});
|
||||
}).passthrough();
|
||||
|
||||
export const RuleSetVersionSchema = z.object({
|
||||
id: z.string(),
|
||||
@@ -105,7 +110,7 @@ export const RuleSetVersionSchema = z.object({
|
||||
rules: z.array(PublishedRuleSnapshotSchema).default([]),
|
||||
publishedAt: z.number().optional(),
|
||||
createdAt: z.number().optional()
|
||||
});
|
||||
}).passthrough();
|
||||
|
||||
export const PublishVersionDataSchema = z.object({
|
||||
version: RuleSetVersionSchema,
|
||||
|
||||
Reference in new issue
Block a user