agent-contracts-runtime 0.35.0 → 0.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -246,14 +246,14 @@ Expecting `+k.join(", ")+", got '"+(this.terminals_[I]||I)+"'":A="Parse error on
246
246
  return undefined
247
247
  }
248
248
  `.trim()},blockValue:function(e){var r=this.aliasable("container.hooks.blockHelperMissing"),i=[this.contextName(0)];this.setupHelperArgs(e,0,i);var n=this.popStack();i.splice(1,0,n),this.push(this.source.functionCall(r,"call",i))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var i=this.topStack();r.splice(1,0,i),this.pushSource(["if (!",this.lastHelper,") { ",i," = ",this.source.functionCall(e,"call",r),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,r,i,n){var a=0;!n&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[a++])):this.pushContext(),this.resolvePath("context",e,a,r,i)},lookupBlockParam:function(e,r){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(e,r,i){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,i)},resolvePath:function(e,r,i,n,a){var o=this;if(this.options.strict||this.options.assumeObjects){this.push(Eoe(this.options.strict&&a,this,r,i,e));return}for(var s=r.length,l=function(c){o.replaceStack(function(d){var f=o.nameLookup(d,r[c],e);return n?[" && ",f]:[" != null ? ",f," : ",d]})},u=i;u<s;u++)l(u)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof e=="string"?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,r){var i=this.nameLookup("decorators",r,"decorator"),n=this.setupHelperArgs(r,e);this.decorators.push(["var decorator = ",i,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+r+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",n])," || fn;"])},invokeHelper:function(e,r,i){var n=this.popStack(),a=this.setupHelper(e,r),o=[];i&&o.push(a.name),o.push(n),this.options.strict||o.push(this.aliasable("container.hooks.helperMissing"));var s=["(",this.itemsSeparatedBy(o,"||"),")"],l=this.source.functionCall(s,"call",a.callParams);this.push(l)},itemsSeparatedBy:function(e,r){var i=[];i.push(e[0]);for(var n=1;n<e.length;n++)i.push(r,e[n]);return i},invokeKnownHelper:function(e,r){var i=this.setupHelper(e,r);this.push(this.source.functionCall(i.name,"call",i.callParams))},invokeAmbiguous:function(e,r){this.useRegister("helper");var i=this.popStack();this.emptyHash();var n=this.setupHelper(0,e,r),a=this.lastHelper=this.nameLookup("helpers",e,"helper"),o=["(","(helper = ",a," || ",i,")"];this.options.strict||(o[0]="(helper = ",o.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",o,n.paramsInit?["),(",n.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",n.callParams)," : helper))"])},invokePartial:function(e,r,i){var n=[],a=this.setupParams(r,1,n);e&&(r=this.popStack(),delete a.name),i&&(a.indent=JSON.stringify(i)),a.helpers="helpers",a.partials="partials",a.decorators="container.decorators",e?n.unshift(r):n.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(a.depths="depths"),a=this.objectLiteral(a),n.push(a),this.push(this.source.functionCall("container.invokePartial","",n))},assignToHash:function(e){var r=this.popStack(),i=void 0,n=void 0,a=void 0;this.trackIds&&(a=this.popStack()),this.stringParams&&(n=this.popStack(),i=this.popStack());var o=this.hash;i&&(o.contexts[e]=i),n&&(o.types[e]=n),a&&(o.ids[e]=a),o.values[e]=r},pushId:function(e,r,i){e==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(i?" + "+JSON.stringify("."+i):"")):e==="PathExpression"?this.pushString(r):e==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:Wu,compileChildren:function(e,r){for(var i=e.children,n=void 0,a=void 0,o=0,s=i.length;o<s;o++){n=i[o],a=new this.compiler;var l=this.matchExistingProgram(n);if(l==null){var u=this.context.programs.push("")-1;n.index=u,n.name="program"+u,this.context.programs[u]=a.compile(n,r,this.context,!this.precompile),this.context.decorators[u]=a.decorators,this.context.environments[u]=n,this.useDepths=this.useDepths||a.useDepths,this.useBlockParams=this.useBlockParams||a.useBlockParams,n.useDepths=this.useDepths,n.useBlockParams=this.useBlockParams}else n.index=l.index,n.name="program"+l.index,this.useDepths=this.useDepths||l.useDepths,this.useBlockParams=this.useBlockParams||l.useBlockParams}},matchExistingProgram:function(e){for(var r=0,i=this.context.environments.length;r<i;r++){var n=this.context.environments[r];if(n&&n.equals(e))return n}},programExpression:function(e){var r=this.environment.children[e],i=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&i.push("blockParams"),this.useDepths&&i.push("depths"),"container.program("+i.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof Gu||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new Gu(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var r=["("],i=void 0,n=void 0,a=void 0;if(!this.isInline())throw new H8.default("replaceStack on non-inline");var o=this.popStack(!0);if(o instanceof Gu)i=[o.value],r=["(",i],a=!0;else{n=!0;var s=this.incrStack();r=["((",this.push(s)," = ",o,")"],i=this.topStack()}var l=e.call(this,i);a||this.popStack(),n&&this.stackSlot--,this.push(r.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var r=0,i=e.length;r<i;r++){var n=e[r];if(n instanceof Gu)this.compileStack.push(n);else{var a=this.incrStack();this.pushSource([a," = ",n,";"]),this.compileStack.push(a)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var r=this.isInline(),i=(r?this.inlineStack:this.compileStack).pop();if(!e&&i instanceof Gu)return i.value;if(!r){if(!this.stackSlot)throw new H8.default("Invalid stack pop");this.stackSlot--}return i},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,r=e[e.length-1];return r instanceof Gu?r.value:r},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var r=this.aliases[e];return r?(r.referenceCount++,r):(r=this.aliases[e]=this.source.wrap(e),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(e,r,i){var n=[],a=this.setupHelperArgs(r,e,n,i),o=this.nameLookup("helpers",r,"helper"),s=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:n,paramsInit:a,name:o,callParams:[s].concat(n)}},setupParams:function(e,r,i){var n={},a=[],o=[],s=[],l=!i,u=void 0;l&&(i=[]),n.name=this.quotedString(e),n.hash=this.popStack(),this.trackIds&&(n.hashIds=this.popStack()),this.stringParams&&(n.hashTypes=this.popStack(),n.hashContexts=this.popStack());var c=this.popStack(),d=this.popStack();(d||c)&&(n.fn=d||"container.noop",n.inverse=c||"container.noop");for(var f=r;f--;)u=this.popStack(),i[f]=u,this.trackIds&&(s[f]=this.popStack()),this.stringParams&&(o[f]=this.popStack(),a[f]=this.popStack());return l&&(n.args=this.source.generateArray(i)),this.trackIds&&(n.ids=this.source.generateArray(s)),this.stringParams&&(n.types=this.source.generateArray(o),n.contexts=this.source.generateArray(a)),this.options.data&&(n.data="data"),this.useBlockParams&&(n.blockParams="blockParams"),n},setupHelperArgs:function(e,r,i,n){var a=this.setupParams(e,r,i);return a.loc=JSON.stringify(this.source.currentLocation),a=this.objectLiteral(a),n?(this.useRegister("options"),i.push("options"),["options=",a]):i?(i.push(a),""):a}};(function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=Wu.RESERVED_WORDS={},r=0,i=t.length;r<i;r++)e[t[r]]=!0})();Wu.isValidJavaScriptVariableName=function(t){return!Wu.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)};function Eoe(t,e,r,i,n){var a=e.popStack(),o=r.length;t&&o--;for(var s=i;s<o;s++)a=e.nameLookup(a,r[s],n);return t?[e.aliasable("container.strict"),"(",a,", ",e.quotedString(r[o]),", ",JSON.stringify(e.source.currentLocation)," )"]:a}Cg.default=Wu;VT.exports=Cg.default});var HT=be((jg,WT)=>{"use strict";jg.__esModule=!0;function vp(t){return t&&t.__esModule?t:{default:t}}var Aoe=Zj(),Poe=vp(Aoe),Ooe=S8(),Ioe=vp(Ooe),K8=sT(),Z8=dT(),Coe=BT(),joe=vp(Coe),Toe=Sg(),Roe=vp(Toe),Doe=y8(),Noe=vp(Doe),Loe=Poe.default.create;function GT(){var t=Loe();return t.compile=function(e,r){return Z8.compile(e,r,t)},t.precompile=function(e,r){return Z8.precompile(e,r,t)},t.AST=Ioe.default,t.Compiler=Z8.Compiler,t.JavaScriptCompiler=joe.default,t.Parser=K8.parser,t.parse=K8.parse,t.parseWithoutProcessing=K8.parseWithoutProcessing,t}var Hu=GT();Hu.create=GT;Noe.default(Hu);Hu.Visitor=Roe.default;Hu.default=Hu;jg.default=Hu;WT.exports=jg.default});var KT=be(Tg=>{"use strict";Tg.__esModule=!0;Tg.print=Foe;Tg.PrintVisitor=Wr;function Moe(t){return t&&t.__esModule?t:{default:t}}var zoe=Sg(),qoe=Moe(zoe);function Foe(t){return new Wr().accept(t)}function Wr(){this.padding=0}Wr.prototype=new qoe.default;Wr.prototype.pad=function(t){for(var e="",r=0,i=this.padding;r<i;r++)e+=" ";return e+=t+`
249
- `,e};Wr.prototype.Program=function(t){var e="",r=t.body,i=void 0,n=void 0;if(t.blockParams){var a="BLOCK PARAMS: [";for(i=0,n=t.blockParams.length;i<n;i++)a+=" "+t.blockParams[i];a+=" ]",e+=this.pad(a)}for(i=0,n=r.length;i<n;i++)e+=this.accept(r[i]);return this.padding--,e};Wr.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")};Wr.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")};Wr.prototype.BlockStatement=Wr.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e};Wr.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")};Wr.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")};Wr.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")};Wr.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")};Wr.prototype.SubExpression=function(t){for(var e=t.params,r=[],i=void 0,n=0,a=e.length;n<a;n++)r.push(this.accept(e[n]));return e="["+r.join(", ")+"]",i=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+i};Wr.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e};Wr.prototype.StringLiteral=function(t){return'"'+t.value+'"'};Wr.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"};Wr.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"};Wr.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Wr.prototype.NullLiteral=function(){return"NULL"};Wr.prototype.Hash=function(t){for(var e=t.pairs,r=[],i=0,n=e.length;i<n;i++)r.push(this.accept(e[i]));return"HASH{"+r.join(", ")+"}"};Wr.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)}});var Dg=be((Zbe,YT)=>{var Rg=HT().default,JT=KT();Rg.PrintVisitor=JT.PrintVisitor;Rg.print=JT.print;YT.exports=Rg;function ZT(t,e){var r=Un("fs"),i=r.readFileSync(e,"utf8");t.exports=Rg.compile(i)}typeof Un<"u"&&Un.extensions&&(Un.extensions[".handlebars"]=ZT,Un.extensions[".hbs"]=ZT)});var wp=be(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.regexpCode=pr.getEsmExportName=pr.getProperty=pr.safeStringify=pr.stringify=pr.strConcat=pr.addCodeArg=pr.str=pr._=pr.nil=pr._Code=pr.Name=pr.IDENTIFIER=pr._CodeOrName=void 0;var yp=class{};pr._CodeOrName=yp;pr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ul=class extends yp{constructor(e){if(super(),!pr.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};pr.Name=ul;var Hi=class extends yp{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,i)=>`${r}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,i)=>(i instanceof ul&&(r[i.str]=(r[i.str]||0)+1),r),{})}};pr._Code=Hi;pr.nil=new Hi("");function nR(t,...e){let r=[t[0]],i=0;for(;i<e.length;)ew(r,e[i]),r.push(t[++i]);return new Hi(r)}pr._=nR;var X8=new Hi("+");function iR(t,...e){let r=[_p(t[0])],i=0;for(;i<e.length;)r.push(X8),ew(r,e[i]),r.push(X8,_p(t[++i]));return Joe(r),new Hi(r)}pr.str=iR;function ew(t,e){e instanceof Hi?t.push(...e._items):e instanceof ul?t.push(e):t.push(Xoe(e))}pr.addCodeArg=ew;function Joe(t){let e=1;for(;e<t.length-1;){if(t[e]===X8){let r=Yoe(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Yoe(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ul||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ul))return`"${t}${e.slice(1)}`}function Qoe(t,e){return e.emptyStr()?t:t.emptyStr()?e:iR`${t}${e}`}pr.strConcat=Qoe;function Xoe(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:_p(Array.isArray(t)?t.join(","):t)}function ese(t){return new Hi(_p(t))}pr.stringify=ese;function _p(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}pr.safeStringify=_p;function tse(t){return typeof t=="string"&&pr.IDENTIFIER.test(t)?new Hi(`.${t}`):nR`[${t}]`}pr.getProperty=tse;function rse(t){if(typeof t=="string"&&pr.IDENTIFIER.test(t))return new Hi(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}pr.getEsmExportName=rse;function nse(t){return new Hi(t.toString())}pr.regexpCode=nse});var nw=be(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.ValueScope=li.ValueScopeName=li.Scope=li.varKinds=li.UsedValueState=void 0;var si=wp(),tw=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},zg;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(zg||(li.UsedValueState=zg={}));li.varKinds={const:new si.Name("const"),let:new si.Name("let"),var:new si.Name("var")};var qg=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof si.Name?e:this.name(e)}name(e){return new si.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};li.Scope=qg;var Fg=class extends si.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:i}){this.value=e,this.scopePath=(0,si._)`.${new si.Name(r)}[${i}]`}};li.ValueScopeName=Fg;var ise=(0,si._)`\n`,rw=class extends qg{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ise:si.nil}}get(){return this._scope}name(e){return new Fg(e,this._newName(e))}value(e,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:a}=n,o=(i=r.key)!==null&&i!==void 0?i:r.ref,s=this._values[a];if(s){let c=s.get(o);if(c)return c}else s=this._values[a]=new Map;s.set(o,n);let l=this._scope[a]||(this._scope[a]=[]),u=l.length;return l[u]=r.ref,n.setValue(r,{property:a,itemIndex:u}),n}getValue(e,r){let i=this._values[e];if(i)return i.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,si._)`${e}${i.scopePath}`})}scopeCode(e=this._values,r,i){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,i)}_reduceValues(e,r,i={},n){let a=si.nil;for(let o in e){let s=e[o];if(!s)continue;let l=i[o]=i[o]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,zg.Started);let c=r(u);if(c){let d=this.opts.es5?li.varKinds.var:li.varKinds.const;a=(0,si._)`${a}${d} ${u} = ${c};${this.opts._n}`}else if(c=n?.(u))a=(0,si._)`${a}${c}${this.opts._n}`;else throw new tw(u);l.set(u,zg.Completed)})}return a}};li.ValueScope=rw});var rr=be(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.or=tr.and=tr.not=tr.CodeGen=tr.operators=tr.varKinds=tr.ValueScopeName=tr.ValueScope=tr.Scope=tr.Name=tr.regexpCode=tr.stringify=tr.getProperty=tr.nil=tr.strConcat=tr.str=tr._=void 0;var lr=wp(),pa=nw(),cs=wp();Object.defineProperty(tr,"_",{enumerable:!0,get:function(){return cs._}});Object.defineProperty(tr,"str",{enumerable:!0,get:function(){return cs.str}});Object.defineProperty(tr,"strConcat",{enumerable:!0,get:function(){return cs.strConcat}});Object.defineProperty(tr,"nil",{enumerable:!0,get:function(){return cs.nil}});Object.defineProperty(tr,"getProperty",{enumerable:!0,get:function(){return cs.getProperty}});Object.defineProperty(tr,"stringify",{enumerable:!0,get:function(){return cs.stringify}});Object.defineProperty(tr,"regexpCode",{enumerable:!0,get:function(){return cs.regexpCode}});Object.defineProperty(tr,"Name",{enumerable:!0,get:function(){return cs.Name}});var Gg=nw();Object.defineProperty(tr,"Scope",{enumerable:!0,get:function(){return Gg.Scope}});Object.defineProperty(tr,"ValueScope",{enumerable:!0,get:function(){return Gg.ValueScope}});Object.defineProperty(tr,"ValueScopeName",{enumerable:!0,get:function(){return Gg.ValueScopeName}});Object.defineProperty(tr,"varKinds",{enumerable:!0,get:function(){return Gg.varKinds}});tr.operators={GT:new lr._Code(">"),GTE:new lr._Code(">="),LT:new lr._Code("<"),LTE:new lr._Code("<="),EQ:new lr._Code("==="),NEQ:new lr._Code("!=="),NOT:new lr._Code("!"),OR:new lr._Code("||"),AND:new lr._Code("&&"),ADD:new lr._Code("+")};var po=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},iw=class extends po{constructor(e,r,i){super(),this.varKind=e,this.name=r,this.rhs=i}render({es5:e,_n:r}){let i=e?pa.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Zu(this.rhs,e,r)),this}get names(){return this.rhs instanceof lr._CodeOrName?this.rhs.names:{}}},Ug=class extends po{constructor(e,r,i){super(),this.lhs=e,this.rhs=r,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof lr.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zu(this.rhs,e,r),this}get names(){let e=this.lhs instanceof lr.Name?{}:{...this.lhs.names};return Bg(e,this.rhs)}},aw=class extends Ug{constructor(e,r,i,n){super(e,i,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},ow=class extends po{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},sw=class extends po{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},lw=class extends po{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},uw=class extends po{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Zu(this.code,e,r),this}get names(){return this.code instanceof lr._CodeOrName?this.code.names:{}}},bp=class extends po{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,i)=>r+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let i=e[r].optimizeNodes();Array.isArray(i)?e.splice(r,1,...i):i?e[r]=i:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:i}=this,n=i.length;for(;n--;){let a=i[n];a.optimizeNames(e,r)||(ase(e,a.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>pl(e,r.names),{})}},fo=class extends bp{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},cw=class extends bp{},Ku=class extends fo{};Ku.kind="else";var cl=class t extends fo{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let i=r.optimizeNodes();r=this.else=Array.isArray(i)?new Ku(i):i}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(aR(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Zu(this.condition,e,r),this}get names(){let e=super.names;return Bg(e,this.condition),this.else&&pl(e,this.else.names),e}};cl.kind="if";var dl=class extends fo{};dl.kind="for";var dw=class extends dl{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Zu(this.iteration,e,r),this}get names(){return pl(super.names,this.iteration.names)}},pw=class extends dl{constructor(e,r,i,n){super(),this.varKind=e,this.name=r,this.from=i,this.to=n}render(e){let r=e.es5?pa.varKinds.var:this.varKind,{name:i,from:n,to:a}=this;return`for(${r} ${i}=${n}; ${i}<${a}; ${i}++)`+super.render(e)}get names(){let e=Bg(super.names,this.from);return Bg(e,this.to)}},Vg=class extends dl{constructor(e,r,i,n){super(),this.loop=e,this.varKind=r,this.name=i,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Zu(this.iterable,e,r),this}get names(){return pl(super.names,this.iterable.names)}},Sp=class extends fo{constructor(e,r,i){super(),this.name=e,this.args=r,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Sp.kind="func";var kp=class extends bp{render(e){return"return "+super.render(e)}};kp.kind="return";var fw=class extends fo{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var i,n;return super.optimizeNames(e,r),(i=this.catch)===null||i===void 0||i.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&pl(e,this.catch.names),this.finally&&pl(e,this.finally.names),e}},xp=class extends fo{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};xp.kind="catch";var $p=class extends fo{render(e){return"finally"+super.render(e)}};$p.kind="finally";var mw=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
249
+ `,e};Wr.prototype.Program=function(t){var e="",r=t.body,i=void 0,n=void 0;if(t.blockParams){var a="BLOCK PARAMS: [";for(i=0,n=t.blockParams.length;i<n;i++)a+=" "+t.blockParams[i];a+=" ]",e+=this.pad(a)}for(i=0,n=r.length;i<n;i++)e+=this.accept(r[i]);return this.padding--,e};Wr.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")};Wr.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")};Wr.prototype.BlockStatement=Wr.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e};Wr.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")};Wr.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")};Wr.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")};Wr.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")};Wr.prototype.SubExpression=function(t){for(var e=t.params,r=[],i=void 0,n=0,a=e.length;n<a;n++)r.push(this.accept(e[n]));return e="["+r.join(", ")+"]",i=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+i};Wr.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e};Wr.prototype.StringLiteral=function(t){return'"'+t.value+'"'};Wr.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"};Wr.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"};Wr.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Wr.prototype.NullLiteral=function(){return"NULL"};Wr.prototype.Hash=function(t){for(var e=t.pairs,r=[],i=0,n=e.length;i<n;i++)r.push(this.accept(e[i]));return"HASH{"+r.join(", ")+"}"};Wr.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)}});var Dg=be((Qbe,YT)=>{var Rg=HT().default,JT=KT();Rg.PrintVisitor=JT.PrintVisitor;Rg.print=JT.print;YT.exports=Rg;function ZT(t,e){var r=Un("fs"),i=r.readFileSync(e,"utf8");t.exports=Rg.compile(i)}typeof Un<"u"&&Un.extensions&&(Un.extensions[".handlebars"]=ZT,Un.extensions[".hbs"]=ZT)});var wp=be(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.regexpCode=pr.getEsmExportName=pr.getProperty=pr.safeStringify=pr.stringify=pr.strConcat=pr.addCodeArg=pr.str=pr._=pr.nil=pr._Code=pr.Name=pr.IDENTIFIER=pr._CodeOrName=void 0;var yp=class{};pr._CodeOrName=yp;pr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var ul=class extends yp{constructor(e){if(super(),!pr.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};pr.Name=ul;var Hi=class extends yp{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,i)=>`${r}${i}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,i)=>(i instanceof ul&&(r[i.str]=(r[i.str]||0)+1),r),{})}};pr._Code=Hi;pr.nil=new Hi("");function nR(t,...e){let r=[t[0]],i=0;for(;i<e.length;)ew(r,e[i]),r.push(t[++i]);return new Hi(r)}pr._=nR;var X8=new Hi("+");function iR(t,...e){let r=[_p(t[0])],i=0;for(;i<e.length;)r.push(X8),ew(r,e[i]),r.push(X8,_p(t[++i]));return Joe(r),new Hi(r)}pr.str=iR;function ew(t,e){e instanceof Hi?t.push(...e._items):e instanceof ul?t.push(e):t.push(Xoe(e))}pr.addCodeArg=ew;function Joe(t){let e=1;for(;e<t.length-1;){if(t[e]===X8){let r=Yoe(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Yoe(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof ul||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof ul))return`"${t}${e.slice(1)}`}function Qoe(t,e){return e.emptyStr()?t:t.emptyStr()?e:iR`${t}${e}`}pr.strConcat=Qoe;function Xoe(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:_p(Array.isArray(t)?t.join(","):t)}function ese(t){return new Hi(_p(t))}pr.stringify=ese;function _p(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}pr.safeStringify=_p;function tse(t){return typeof t=="string"&&pr.IDENTIFIER.test(t)?new Hi(`.${t}`):nR`[${t}]`}pr.getProperty=tse;function rse(t){if(typeof t=="string"&&pr.IDENTIFIER.test(t))return new Hi(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}pr.getEsmExportName=rse;function nse(t){return new Hi(t.toString())}pr.regexpCode=nse});var nw=be(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.ValueScope=li.ValueScopeName=li.Scope=li.varKinds=li.UsedValueState=void 0;var si=wp(),tw=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},zg;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(zg||(li.UsedValueState=zg={}));li.varKinds={const:new si.Name("const"),let:new si.Name("let"),var:new si.Name("var")};var qg=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof si.Name?e:this.name(e)}name(e){return new si.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,i;if(!((i=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||i===void 0)&&i.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};li.Scope=qg;var Fg=class extends si.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:i}){this.value=e,this.scopePath=(0,si._)`.${new si.Name(r)}[${i}]`}};li.ValueScopeName=Fg;var ise=(0,si._)`\n`,rw=class extends qg{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ise:si.nil}}get(){return this._scope}name(e){return new Fg(e,this._newName(e))}value(e,r){var i;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:a}=n,o=(i=r.key)!==null&&i!==void 0?i:r.ref,s=this._values[a];if(s){let c=s.get(o);if(c)return c}else s=this._values[a]=new Map;s.set(o,n);let l=this._scope[a]||(this._scope[a]=[]),u=l.length;return l[u]=r.ref,n.setValue(r,{property:a,itemIndex:u}),n}getValue(e,r){let i=this._values[e];if(i)return i.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,si._)`${e}${i.scopePath}`})}scopeCode(e=this._values,r,i){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,i)}_reduceValues(e,r,i={},n){let a=si.nil;for(let o in e){let s=e[o];if(!s)continue;let l=i[o]=i[o]||new Map;s.forEach(u=>{if(l.has(u))return;l.set(u,zg.Started);let c=r(u);if(c){let d=this.opts.es5?li.varKinds.var:li.varKinds.const;a=(0,si._)`${a}${d} ${u} = ${c};${this.opts._n}`}else if(c=n?.(u))a=(0,si._)`${a}${c}${this.opts._n}`;else throw new tw(u);l.set(u,zg.Completed)})}return a}};li.ValueScope=rw});var rr=be(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.or=tr.and=tr.not=tr.CodeGen=tr.operators=tr.varKinds=tr.ValueScopeName=tr.ValueScope=tr.Scope=tr.Name=tr.regexpCode=tr.stringify=tr.getProperty=tr.nil=tr.strConcat=tr.str=tr._=void 0;var lr=wp(),pa=nw(),cs=wp();Object.defineProperty(tr,"_",{enumerable:!0,get:function(){return cs._}});Object.defineProperty(tr,"str",{enumerable:!0,get:function(){return cs.str}});Object.defineProperty(tr,"strConcat",{enumerable:!0,get:function(){return cs.strConcat}});Object.defineProperty(tr,"nil",{enumerable:!0,get:function(){return cs.nil}});Object.defineProperty(tr,"getProperty",{enumerable:!0,get:function(){return cs.getProperty}});Object.defineProperty(tr,"stringify",{enumerable:!0,get:function(){return cs.stringify}});Object.defineProperty(tr,"regexpCode",{enumerable:!0,get:function(){return cs.regexpCode}});Object.defineProperty(tr,"Name",{enumerable:!0,get:function(){return cs.Name}});var Gg=nw();Object.defineProperty(tr,"Scope",{enumerable:!0,get:function(){return Gg.Scope}});Object.defineProperty(tr,"ValueScope",{enumerable:!0,get:function(){return Gg.ValueScope}});Object.defineProperty(tr,"ValueScopeName",{enumerable:!0,get:function(){return Gg.ValueScopeName}});Object.defineProperty(tr,"varKinds",{enumerable:!0,get:function(){return Gg.varKinds}});tr.operators={GT:new lr._Code(">"),GTE:new lr._Code(">="),LT:new lr._Code("<"),LTE:new lr._Code("<="),EQ:new lr._Code("==="),NEQ:new lr._Code("!=="),NOT:new lr._Code("!"),OR:new lr._Code("||"),AND:new lr._Code("&&"),ADD:new lr._Code("+")};var po=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},iw=class extends po{constructor(e,r,i){super(),this.varKind=e,this.name=r,this.rhs=i}render({es5:e,_n:r}){let i=e?pa.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Zu(this.rhs,e,r)),this}get names(){return this.rhs instanceof lr._CodeOrName?this.rhs.names:{}}},Ug=class extends po{constructor(e,r,i){super(),this.lhs=e,this.rhs=r,this.sideEffects=i}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof lr.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Zu(this.rhs,e,r),this}get names(){let e=this.lhs instanceof lr.Name?{}:{...this.lhs.names};return Bg(e,this.rhs)}},aw=class extends Ug{constructor(e,r,i,n){super(e,i,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},ow=class extends po{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},sw=class extends po{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},lw=class extends po{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},uw=class extends po{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Zu(this.code,e,r),this}get names(){return this.code instanceof lr._CodeOrName?this.code.names:{}}},bp=class extends po{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,i)=>r+i.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let i=e[r].optimizeNodes();Array.isArray(i)?e.splice(r,1,...i):i?e[r]=i:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:i}=this,n=i.length;for(;n--;){let a=i[n];a.optimizeNames(e,r)||(ase(e,a.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>pl(e,r.names),{})}},fo=class extends bp{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},cw=class extends bp{},Ku=class extends fo{};Ku.kind="else";var cl=class t extends fo{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let i=r.optimizeNodes();r=this.else=Array.isArray(i)?new Ku(i):i}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(aR(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var i;if(this.else=(i=this.else)===null||i===void 0?void 0:i.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Zu(this.condition,e,r),this}get names(){let e=super.names;return Bg(e,this.condition),this.else&&pl(e,this.else.names),e}};cl.kind="if";var dl=class extends fo{};dl.kind="for";var dw=class extends dl{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Zu(this.iteration,e,r),this}get names(){return pl(super.names,this.iteration.names)}},pw=class extends dl{constructor(e,r,i,n){super(),this.varKind=e,this.name=r,this.from=i,this.to=n}render(e){let r=e.es5?pa.varKinds.var:this.varKind,{name:i,from:n,to:a}=this;return`for(${r} ${i}=${n}; ${i}<${a}; ${i}++)`+super.render(e)}get names(){let e=Bg(super.names,this.from);return Bg(e,this.to)}},Vg=class extends dl{constructor(e,r,i,n){super(),this.loop=e,this.varKind=r,this.name=i,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Zu(this.iterable,e,r),this}get names(){return pl(super.names,this.iterable.names)}},Sp=class extends fo{constructor(e,r,i){super(),this.name=e,this.args=r,this.async=i}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Sp.kind="func";var kp=class extends bp{render(e){return"return "+super.render(e)}};kp.kind="return";var fw=class extends fo{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var i,n;return super.optimizeNames(e,r),(i=this.catch)===null||i===void 0||i.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&pl(e,this.catch.names),this.finally&&pl(e,this.finally.names),e}},xp=class extends fo{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};xp.kind="catch";var $p=class extends fo{render(e){return"finally"+super.render(e)}};$p.kind="finally";var mw=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
250
250
  `:""},this._extScope=e,this._scope=new pa.Scope({parent:e}),this._nodes=[new cw]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let i=this._extScope.value(e,r);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,i,n){let a=this._scope.toName(r);return i!==void 0&&n&&(this._constants[a.str]=i),this._leafNode(new iw(e,a,i)),a}const(e,r,i){return this._def(pa.varKinds.const,e,r,i)}let(e,r,i){return this._def(pa.varKinds.let,e,r,i)}var(e,r,i){return this._def(pa.varKinds.var,e,r,i)}assign(e,r,i){return this._leafNode(new Ug(e,r,i))}add(e,r){return this._leafNode(new aw(e,tr.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==lr.nil&&this._leafNode(new uw(e)),this}object(...e){let r=["{"];for(let[i,n]of e)r.length>1&&r.push(","),r.push(i),(i!==n||this.opts.es5)&&(r.push(":"),(0,lr.addCodeArg)(r,n));return r.push("}"),new lr._Code(r)}if(e,r,i){if(this._blockNode(new cl(e)),r&&i)this.code(r).else().code(i).endIf();else if(r)this.code(r).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new cl(e))}else(){return this._elseNode(new Ku)}endIf(){return this._endBlockNode(cl,Ku)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new dw(e),r)}forRange(e,r,i,n,a=this.opts.es5?pa.varKinds.var:pa.varKinds.let){let o=this._scope.toName(e);return this._for(new pw(a,o,r,i),()=>n(o))}forOf(e,r,i,n=pa.varKinds.const){let a=this._scope.toName(e);if(this.opts.es5){let o=r instanceof lr.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,lr._)`${o}.length`,s=>{this.var(a,(0,lr._)`${o}[${s}]`),i(a)})}return this._for(new Vg("of",n,a,r),()=>i(a))}forIn(e,r,i,n=this.opts.es5?pa.varKinds.var:pa.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,lr._)`Object.keys(${r})`,i);let a=this._scope.toName(e);return this._for(new Vg("in",n,a,r),()=>i(a))}endFor(){return this._endBlockNode(dl)}label(e){return this._leafNode(new ow(e))}break(e){return this._leafNode(new sw(e))}return(e){let r=new kp;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(kp)}try(e,r,i){if(!r&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new fw;if(this._blockNode(n),this.code(e),r){let a=this.name("e");this._currNode=n.catch=new xp(a),r(a)}return i&&(this._currNode=n.finally=new $p,this.code(i)),this._endBlockNode(xp,$p)}throw(e){return this._leafNode(new lw(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-r;if(i<0||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=lr.nil,i,n){return this._blockNode(new Sp(e,r,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Sp)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let i=this._currNode;if(i instanceof e||r&&i instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof cl))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};tr.CodeGen=mw;function pl(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Bg(t,e){return e instanceof lr._CodeOrName?pl(t,e.names):t}function Zu(t,e,r){if(t instanceof lr.Name)return i(t);if(!n(t))return t;return new lr._Code(t._items.reduce((a,o)=>(o instanceof lr.Name&&(o=i(o)),o instanceof lr._Code?a.push(...o._items):a.push(o),a),[]));function i(a){let o=r[a.str];return o===void 0||e[a.str]!==1?a:(delete e[a.str],o)}function n(a){return a instanceof lr._Code&&a._items.some(o=>o instanceof lr.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function ase(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function aR(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,lr._)`!${hw(t)}`}tr.not=aR;var ose=oR(tr.operators.AND);function sse(...t){return t.reduce(ose)}tr.and=sse;var lse=oR(tr.operators.OR);function use(...t){return t.reduce(lse)}tr.or=use;function oR(t){return(e,r)=>e===lr.nil?r:r===lr.nil?e:(0,lr._)`${hw(e)} ${t} ${hw(r)}`}function hw(t){return t instanceof lr.Name?t:(0,lr._)`(${t})`}});var cr=be(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.checkStrictMode=nr.getErrorPath=nr.Type=nr.useFunc=nr.setEvaluated=nr.evaluatedPropsToName=nr.mergeEvaluated=nr.eachItem=nr.unescapeJsonPointer=nr.escapeJsonPointer=nr.escapeFragment=nr.unescapeFragment=nr.schemaRefOrVal=nr.schemaHasRulesButRef=nr.schemaHasRules=nr.checkUnknownRules=nr.alwaysValidSchema=nr.toHash=void 0;var Pr=rr(),cse=wp();function dse(t){let e={};for(let r of t)e[r]=!0;return e}nr.toHash=dse;function pse(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(uR(t,e),!cR(e,t.self.RULES.all))}nr.alwaysValidSchema=pse;function uR(t,e=t.schema){let{opts:r,self:i}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=i.RULES.keywords;for(let a in e)n[a]||fR(t,`unknown keyword: "${a}"`)}nr.checkUnknownRules=uR;function cR(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}nr.schemaHasRules=cR;function fse(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}nr.schemaHasRulesButRef=fse;function mse({topSchemaRef:t,schemaPath:e},r,i,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,Pr._)`${r}`}return(0,Pr._)`${t}${e}${(0,Pr.getProperty)(i)}`}nr.schemaRefOrVal=mse;function hse(t){return dR(decodeURIComponent(t))}nr.unescapeFragment=hse;function gse(t){return encodeURIComponent(vw(t))}nr.escapeFragment=gse;function vw(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}nr.escapeJsonPointer=vw;function dR(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}nr.unescapeJsonPointer=dR;function vse(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}nr.eachItem=vse;function sR({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:i}){return(n,a,o,s)=>{let l=o===void 0?a:o instanceof Pr.Name?(a instanceof Pr.Name?t(n,a,o):e(n,a,o),o):a instanceof Pr.Name?(e(n,o,a),a):r(a,o);return s===Pr.Name&&!(l instanceof Pr.Name)?i(n,l):l}}nr.mergeEvaluated={props:sR({mergeNames:(t,e,r)=>t.if((0,Pr._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,Pr._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,Pr._)`${r} || {}`).code((0,Pr._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,Pr._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,Pr._)`${r} || {}`),yw(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:pR}),items:sR({mergeNames:(t,e,r)=>t.if((0,Pr._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,Pr._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,Pr._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,Pr._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function pR(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,Pr._)`{}`);return e!==void 0&&yw(t,r,e),r}nr.evaluatedPropsToName=pR;function yw(t,e,r){Object.keys(r).forEach(i=>t.assign((0,Pr._)`${e}${(0,Pr.getProperty)(i)}`,!0))}nr.setEvaluated=yw;var lR={};function yse(t,e){return t.scopeValue("func",{ref:e,code:lR[e.code]||(lR[e.code]=new cse._Code(e.code))})}nr.useFunc=yse;var gw;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(gw||(nr.Type=gw={}));function _se(t,e,r){if(t instanceof Pr.Name){let i=e===gw.Num;return r?i?(0,Pr._)`"[" + ${t} + "]"`:(0,Pr._)`"['" + ${t} + "']"`:i?(0,Pr._)`"/" + ${t}`:(0,Pr._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,Pr.getProperty)(t).toString():"/"+vw(t)}nr.getErrorPath=_se;function fR(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}nr.checkStrictMode=fR});var mo=be(_w=>{"use strict";Object.defineProperty(_w,"__esModule",{value:!0});var Rn=rr(),wse={data:new Rn.Name("data"),valCxt:new Rn.Name("valCxt"),instancePath:new Rn.Name("instancePath"),parentData:new Rn.Name("parentData"),parentDataProperty:new Rn.Name("parentDataProperty"),rootData:new Rn.Name("rootData"),dynamicAnchors:new Rn.Name("dynamicAnchors"),vErrors:new Rn.Name("vErrors"),errors:new Rn.Name("errors"),this:new Rn.Name("this"),self:new Rn.Name("self"),scope:new Rn.Name("scope"),json:new Rn.Name("json"),jsonPos:new Rn.Name("jsonPos"),jsonLen:new Rn.Name("jsonLen"),jsonPart:new Rn.Name("jsonPart")};_w.default=wse});var Ep=be(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.extendErrors=Dn.resetErrorsCount=Dn.reportExtraError=Dn.reportError=Dn.keyword$DataError=Dn.keywordError=void 0;var dr=rr(),Wg=cr(),Kn=mo();Dn.keywordError={message:({keyword:t})=>(0,dr.str)`must pass "${t}" keyword validation`};Dn.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,dr.str)`"${t}" keyword must be ${e} ($data)`:(0,dr.str)`"${t}" keyword is invalid ($data)`};function bse(t,e=Dn.keywordError,r,i){let{it:n}=t,{gen:a,compositeRule:o,allErrors:s}=n,l=gR(t,e,r);i??(o||s)?mR(a,l):hR(n,(0,dr._)`[${l}]`)}Dn.reportError=bse;function Sse(t,e=Dn.keywordError,r){let{it:i}=t,{gen:n,compositeRule:a,allErrors:o}=i,s=gR(t,e,r);mR(n,s),a||o||hR(i,Kn.default.vErrors)}Dn.reportExtraError=Sse;function kse(t,e){t.assign(Kn.default.errors,e),t.if((0,dr._)`${Kn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,dr._)`${Kn.default.vErrors}.length`,e),()=>t.assign(Kn.default.vErrors,null)))}Dn.resetErrorsCount=kse;function xse({gen:t,keyword:e,schemaValue:r,data:i,errsCount:n,it:a}){if(n===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",n,Kn.default.errors,s=>{t.const(o,(0,dr._)`${Kn.default.vErrors}[${s}]`),t.if((0,dr._)`${o}.instancePath === undefined`,()=>t.assign((0,dr._)`${o}.instancePath`,(0,dr.strConcat)(Kn.default.instancePath,a.errorPath))),t.assign((0,dr._)`${o}.schemaPath`,(0,dr.str)`${a.errSchemaPath}/${e}`),a.opts.verbose&&(t.assign((0,dr._)`${o}.schema`,r),t.assign((0,dr._)`${o}.data`,i))})}Dn.extendErrors=xse;function mR(t,e){let r=t.const("err",e);t.if((0,dr._)`${Kn.default.vErrors} === null`,()=>t.assign(Kn.default.vErrors,(0,dr._)`[${r}]`),(0,dr._)`${Kn.default.vErrors}.push(${r})`),t.code((0,dr._)`${Kn.default.errors}++`)}function hR(t,e){let{gen:r,validateName:i,schemaEnv:n}=t;n.$async?r.throw((0,dr._)`new ${t.ValidationError}(${e})`):(r.assign((0,dr._)`${i}.errors`,e),r.return(!1))}var fl={keyword:new dr.Name("keyword"),schemaPath:new dr.Name("schemaPath"),params:new dr.Name("params"),propertyName:new dr.Name("propertyName"),message:new dr.Name("message"),schema:new dr.Name("schema"),parentSchema:new dr.Name("parentSchema")};function gR(t,e,r){let{createErrors:i}=t.it;return i===!1?(0,dr._)`{}`:$se(t,e,r)}function $se(t,e,r={}){let{gen:i,it:n}=t,a=[Ese(n,r),Ase(t,r)];return Pse(t,e,a),i.object(...a)}function Ese({errorPath:t},{instancePath:e}){let r=e?(0,dr.str)`${t}${(0,Wg.getErrorPath)(e,Wg.Type.Str)}`:t;return[Kn.default.instancePath,(0,dr.strConcat)(Kn.default.instancePath,r)]}function Ase({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:i}){let n=i?e:(0,dr.str)`${e}/${t}`;return r&&(n=(0,dr.str)`${n}${(0,Wg.getErrorPath)(r,Wg.Type.Str)}`),[fl.schemaPath,n]}function Pse(t,{params:e,message:r},i){let{keyword:n,data:a,schemaValue:o,it:s}=t,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:d}=s;i.push([fl.keyword,n],[fl.params,typeof e=="function"?e(t):e||(0,dr._)`{}`]),l.messages&&i.push([fl.message,typeof r=="function"?r(t):r]),l.verbose&&i.push([fl.schema,o],[fl.parentSchema,(0,dr._)`${c}${d}`],[Kn.default.data,a]),u&&i.push([fl.propertyName,u])}});var yR=be(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.boolOrEmptySchema=Ju.topBoolOrEmptySchema=void 0;var Ose=Ep(),Ise=rr(),Cse=mo(),jse={message:"boolean schema is false"};function Tse(t){let{gen:e,schema:r,validateName:i}=t;r===!1?vR(t,!1):typeof r=="object"&&r.$async===!0?e.return(Cse.default.data):(e.assign((0,Ise._)`${i}.errors`,null),e.return(!0))}Ju.topBoolOrEmptySchema=Tse;function Rse(t,e){let{gen:r,schema:i}=t;i===!1?(r.var(e,!1),vR(t)):r.var(e,!0)}Ju.boolOrEmptySchema=Rse;function vR(t,e){let{gen:r,data:i}=t,n={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,Ose.reportError)(n,jse,void 0,e)}});var ww=be(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.getRules=Yu.isJSONType=void 0;var Dse=["string","number","integer","boolean","null","object","array"],Nse=new Set(Dse);function Lse(t){return typeof t=="string"&&Nse.has(t)}Yu.isJSONType=Lse;function Mse(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Yu.getRules=Mse});var bw=be(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.shouldUseRule=ds.shouldUseGroup=ds.schemaHasRulesForType=void 0;function zse({schema:t,self:e},r){let i=e.RULES.types[r];return i&&i!==!0&&_R(t,i)}ds.schemaHasRulesForType=zse;function _R(t,e){return e.rules.some(r=>wR(t,r))}ds.shouldUseGroup=_R;function wR(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(i=>t[i]!==void 0))}ds.shouldUseRule=wR});var Ap=be(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.reportTypeError=Nn.checkDataTypes=Nn.checkDataType=Nn.coerceAndCheckDataType=Nn.getJSONTypes=Nn.getSchemaTypes=Nn.DataType=void 0;var qse=ww(),Fse=bw(),Use=Ep(),Zt=rr(),bR=cr(),Qu;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Qu||(Nn.DataType=Qu={}));function Vse(t){let e=SR(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Nn.getSchemaTypes=Vse;function SR(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(qse.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Nn.getJSONTypes=SR;function Bse(t,e){let{gen:r,data:i,opts:n}=t,a=Gse(e,n.coerceTypes),o=e.length>0&&!(a.length===0&&e.length===1&&(0,Fse.schemaHasRulesForType)(t,e[0]));if(o){let s=kw(e,i,n.strictNumbers,Qu.Wrong);r.if(s,()=>{a.length?Wse(t,e,a):xw(t)})}return o}Nn.coerceAndCheckDataType=Bse;var kR=new Set(["string","number","integer","boolean","null"]);function Gse(t,e){return e?t.filter(r=>kR.has(r)||e==="array"&&r==="array"):[]}function Wse(t,e,r){let{gen:i,data:n,opts:a}=t,o=i.let("dataType",(0,Zt._)`typeof ${n}`),s=i.let("coerced",(0,Zt._)`undefined`);a.coerceTypes==="array"&&i.if((0,Zt._)`${o} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,Zt._)`${n}[0]`).assign(o,(0,Zt._)`typeof ${n}`).if(kw(e,n,a.strictNumbers),()=>i.assign(s,n))),i.if((0,Zt._)`${s} !== undefined`);for(let u of r)(kR.has(u)||u==="array"&&a.coerceTypes==="array")&&l(u);i.else(),xw(t),i.endIf(),i.if((0,Zt._)`${s} !== undefined`,()=>{i.assign(n,s),Hse(t,s)});function l(u){switch(u){case"string":i.elseIf((0,Zt._)`${o} == "number" || ${o} == "boolean"`).assign(s,(0,Zt._)`"" + ${n}`).elseIf((0,Zt._)`${n} === null`).assign(s,(0,Zt._)`""`);return;case"number":i.elseIf((0,Zt._)`${o} == "boolean" || ${n} === null
251
251
  || (${o} == "string" && ${n} && ${n} == +${n})`).assign(s,(0,Zt._)`+${n}`);return;case"integer":i.elseIf((0,Zt._)`${o} === "boolean" || ${n} === null
252
252
  || (${o} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(s,(0,Zt._)`+${n}`);return;case"boolean":i.elseIf((0,Zt._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(s,!1).elseIf((0,Zt._)`${n} === "true" || ${n} === 1`).assign(s,!0);return;case"null":i.elseIf((0,Zt._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(s,null);return;case"array":i.elseIf((0,Zt._)`${o} === "string" || ${o} === "number"
253
- || ${o} === "boolean" || ${n} === null`).assign(s,(0,Zt._)`[${n}]`)}}}function Hse({gen:t,parentData:e,parentDataProperty:r},i){t.if((0,Zt._)`${e} !== undefined`,()=>t.assign((0,Zt._)`${e}[${r}]`,i))}function Sw(t,e,r,i=Qu.Correct){let n=i===Qu.Correct?Zt.operators.EQ:Zt.operators.NEQ,a;switch(t){case"null":return(0,Zt._)`${e} ${n} null`;case"array":a=(0,Zt._)`Array.isArray(${e})`;break;case"object":a=(0,Zt._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":a=o((0,Zt._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":a=o();break;default:return(0,Zt._)`typeof ${e} ${n} ${t}`}return i===Qu.Correct?a:(0,Zt.not)(a);function o(s=Zt.nil){return(0,Zt.and)((0,Zt._)`typeof ${e} == "number"`,s,r?(0,Zt._)`isFinite(${e})`:Zt.nil)}}Nn.checkDataType=Sw;function kw(t,e,r,i){if(t.length===1)return Sw(t[0],e,r,i);let n,a=(0,bR.toHash)(t);if(a.array&&a.object){let o=(0,Zt._)`typeof ${e} != "object"`;n=a.null?o:(0,Zt._)`!${e} || ${o}`,delete a.null,delete a.array,delete a.object}else n=Zt.nil;a.number&&delete a.integer;for(let o in a)n=(0,Zt.and)(n,Sw(o,e,r,i));return n}Nn.checkDataTypes=kw;var Kse={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Zt._)`{type: ${t}}`:(0,Zt._)`{type: ${e}}`};function xw(t){let e=Zse(t);(0,Use.reportError)(e,Kse)}Nn.reportTypeError=xw;function Zse(t){let{gen:e,data:r,schema:i}=t,n=(0,bR.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:t}}});var $R=be(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});Hg.assignDefaults=void 0;var Xu=rr(),Jse=cr();function Yse(t,e){let{properties:r,items:i}=t.schema;if(e==="object"&&r)for(let n in r)xR(t,n,r[n].default);else e==="array"&&Array.isArray(i)&&i.forEach((n,a)=>xR(t,a,n.default))}Hg.assignDefaults=Yse;function xR(t,e,r){let{gen:i,compositeRule:n,data:a,opts:o}=t;if(r===void 0)return;let s=(0,Xu._)`${a}${(0,Xu.getProperty)(e)}`;if(n){(0,Jse.checkStrictMode)(t,`default is ignored for: ${s}`);return}let l=(0,Xu._)`${s} === undefined`;o.useDefaults==="empty"&&(l=(0,Xu._)`${l} || ${s} === null || ${s} === ""`),i.if(l,(0,Xu._)`${s} = ${(0,Xu.stringify)(r)}`)}});var Ki=be($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.validateUnion=$r.validateArray=$r.usePattern=$r.callValidateCode=$r.schemaProperties=$r.allSchemaProperties=$r.noPropertyInData=$r.propertyInData=$r.isOwnProperty=$r.hasPropFunc=$r.reportMissingProp=$r.checkMissingProp=$r.checkReportMissingProp=void 0;var Dr=rr(),$w=cr(),ps=mo(),Qse=cr();function Xse(t,e){let{gen:r,data:i,it:n}=t;r.if(Aw(r,i,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Dr._)`${e}`},!0),t.error()})}$r.checkReportMissingProp=Xse;function ele({gen:t,data:e,it:{opts:r}},i,n){return(0,Dr.or)(...i.map(a=>(0,Dr.and)(Aw(t,e,a,r.ownProperties),(0,Dr._)`${n} = ${a}`)))}$r.checkMissingProp=ele;function tle(t,e){t.setParams({missingProperty:e},!0),t.error()}$r.reportMissingProp=tle;function ER(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Dr._)`Object.prototype.hasOwnProperty`})}$r.hasPropFunc=ER;function Ew(t,e,r){return(0,Dr._)`${ER(t)}.call(${e}, ${r})`}$r.isOwnProperty=Ew;function rle(t,e,r,i){let n=(0,Dr._)`${e}${(0,Dr.getProperty)(r)} !== undefined`;return i?(0,Dr._)`${n} && ${Ew(t,e,r)}`:n}$r.propertyInData=rle;function Aw(t,e,r,i){let n=(0,Dr._)`${e}${(0,Dr.getProperty)(r)} === undefined`;return i?(0,Dr.or)(n,(0,Dr.not)(Ew(t,e,r))):n}$r.noPropertyInData=Aw;function AR(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}$r.allSchemaProperties=AR;function nle(t,e){return AR(e).filter(r=>!(0,$w.alwaysValidSchema)(t,e[r]))}$r.schemaProperties=nle;function ile({schemaCode:t,data:e,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:a},it:o},s,l,u){let c=u?(0,Dr._)`${t}, ${e}, ${i}${n}`:e,d=[[ps.default.instancePath,(0,Dr.strConcat)(ps.default.instancePath,a)],[ps.default.parentData,o.parentData],[ps.default.parentDataProperty,o.parentDataProperty],[ps.default.rootData,ps.default.rootData]];o.opts.dynamicRef&&d.push([ps.default.dynamicAnchors,ps.default.dynamicAnchors]);let f=(0,Dr._)`${c}, ${r.object(...d)}`;return l!==Dr.nil?(0,Dr._)`${s}.call(${l}, ${f})`:(0,Dr._)`${s}(${f})`}$r.callValidateCode=ile;var ale=(0,Dr._)`new RegExp`;function ole({gen:t,it:{opts:e}},r){let i=e.unicodeRegExp?"u":"",{regExp:n}=e.code,a=n(r,i);return t.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,Dr._)`${n.code==="new RegExp"?ale:(0,Qse.useFunc)(t,n)}(${r}, ${i})`})}$r.usePattern=ole;function sle(t){let{gen:e,data:r,keyword:i,it:n}=t,a=e.name("valid");if(n.allErrors){let s=e.let("valid",!0);return o(()=>e.assign(s,!1)),s}return e.var(a,!0),o(()=>e.break()),a;function o(s){let l=e.const("len",(0,Dr._)`${r}.length`);e.forRange("i",0,l,u=>{t.subschema({keyword:i,dataProp:u,dataPropType:$w.Type.Num},a),e.if((0,Dr.not)(a),s)})}}$r.validateArray=sle;function lle(t){let{gen:e,schema:r,keyword:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,$w.alwaysValidSchema)(n,l))&&!n.opts.unevaluated)return;let o=e.let("valid",!1),s=e.name("_valid");e.block(()=>r.forEach((l,u)=>{let c=t.subschema({keyword:i,schemaProp:u,compositeRule:!0},s);e.assign(o,(0,Dr._)`${o} || ${s}`),t.mergeValidEvaluated(c,s)||e.if((0,Dr.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}$r.validateUnion=lle});var IR=be(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.validateKeywordUsage=Da.validSchemaType=Da.funcKeywordCode=Da.macroKeywordCode=void 0;var Zn=rr(),ml=mo(),ule=Ki(),cle=Ep();function dle(t,e){let{gen:r,keyword:i,schema:n,parentSchema:a,it:o}=t,s=e.macro.call(o.self,n,a,o),l=OR(r,i,s);o.opts.validateSchema!==!1&&o.self.validateSchema(s,!0);let u=r.name("valid");t.subschema({schema:s,schemaPath:Zn.nil,errSchemaPath:`${o.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Da.macroKeywordCode=dle;function ple(t,e){var r;let{gen:i,keyword:n,schema:a,parentSchema:o,$data:s,it:l}=t;mle(l,e);let u=!s&&e.compile?e.compile.call(l.self,a,o,l):e.validate,c=OR(i,n,u),d=i.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)v(),e.modifying&&PR(t),y(()=>t.error());else{let w=e.async?h():g();e.modifying&&PR(t),y(()=>fle(t,w))}}function h(){let w=i.let("ruleErrs",null);return i.try(()=>v((0,Zn._)`await `),$=>i.assign(d,!1).if((0,Zn._)`${$} instanceof ${l.ValidationError}`,()=>i.assign(w,(0,Zn._)`${$}.errors`),()=>i.throw($))),w}function g(){let w=(0,Zn._)`${c}.errors`;return i.assign(w,null),v(Zn.nil),w}function v(w=e.async?(0,Zn._)`await `:Zn.nil){let $=l.opts.passContext?ml.default.this:ml.default.self,E=!("compile"in e&&!s||e.schema===!1);i.assign(d,(0,Zn._)`${w}${(0,ule.callValidateCode)(t,c,$,E)}`,e.modifying)}function y(w){var $;i.if((0,Zn.not)(($=e.valid)!==null&&$!==void 0?$:d),w)}}Da.funcKeywordCode=ple;function PR(t){let{gen:e,data:r,it:i}=t;e.if(i.parentData,()=>e.assign(r,(0,Zn._)`${i.parentData}[${i.parentDataProperty}]`))}function fle(t,e){let{gen:r}=t;r.if((0,Zn._)`Array.isArray(${e})`,()=>{r.assign(ml.default.vErrors,(0,Zn._)`${ml.default.vErrors} === null ? ${e} : ${ml.default.vErrors}.concat(${e})`).assign(ml.default.errors,(0,Zn._)`${ml.default.vErrors}.length`),(0,cle.extendErrors)(t)},()=>t.error())}function mle({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function OR(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Zn.stringify)(r)})}function hle(t,e,r=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||r&&typeof t>"u")}Da.validSchemaType=hle;function gle({schema:t,opts:e,self:r,errSchemaPath:i},n,a){if(Array.isArray(n.keyword)?!n.keyword.includes(a):n.keyword!==a)throw new Error("ajv implementation error");let o=n.dependencies;if(o?.some(s=>!Object.prototype.hasOwnProperty.call(t,s)))throw new Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[a])){let l=`keyword "${a}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}Da.validateKeywordUsage=gle});var jR=be(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.extendSubschemaMode=fs.extendSubschemaData=fs.getSubschema=void 0;var Na=rr(),CR=cr();function vle(t,{keyword:e,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:a,topSchemaRef:o}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let s=t.schema[e];return r===void 0?{schema:s,schemaPath:(0,Na._)`${t.schemaPath}${(0,Na.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:s[r],schemaPath:(0,Na._)`${t.schemaPath}${(0,Na.getProperty)(e)}${(0,Na.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,CR.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||a===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:o,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}fs.getSubschema=vle;function yle(t,e,{dataProp:r,dataPropType:i,data:n,dataTypes:a,propertyName:o}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=e;if(r!==void 0){let{errorPath:u,dataPathArr:c,opts:d}=e,f=s.let("data",(0,Na._)`${e.data}${(0,Na.getProperty)(r)}`,!0);l(f),t.errorPath=(0,Na.str)`${u}${(0,CR.getErrorPath)(r,i,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Na._)`${r}`,t.dataPathArr=[...c,t.parentDataProperty]}if(n!==void 0){let u=n instanceof Na.Name?n:s.let("data",n,!0);l(u),o!==void 0&&(t.propertyName=o)}a&&(t.dataTypes=a);function l(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}fs.extendSubschemaData=yle;function _le(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:a}){i!==void 0&&(t.compositeRule=i),n!==void 0&&(t.createErrors=n),a!==void 0&&(t.allErrors=a),t.jtdDiscriminator=e,t.jtdMetadata=r}fs.extendSubschemaMode=_le});var Pw=be((y7e,TR)=>{"use strict";TR.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,a;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),i=a.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=i;n--!==0;){var o=a[n];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var DR=be((_7e,RR)=>{"use strict";var ms=RR.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Kg(e,i,n,t,"",t)};ms.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ms.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ms.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ms.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Kg(t,e,r,i,n,a,o,s,l,u){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,n,a,o,s,l,u);for(var c in i){var d=i[c];if(Array.isArray(d)){if(c in ms.arrayKeywords)for(var f=0;f<d.length;f++)Kg(t,e,r,d[f],n+"/"+c+"/"+f,a,n,c,i,f)}else if(c in ms.propsKeywords){if(d&&typeof d=="object")for(var h in d)Kg(t,e,r,d[h],n+"/"+c+"/"+wle(h),a,n,c,i,h)}else(c in ms.keywords||t.allKeys&&!(c in ms.skipKeywords))&&Kg(t,e,r,d,n+"/"+c,a,n,c,i)}r(i,n,a,o,s,l,u)}}function wle(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Pp=be(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.getSchemaRefs=ui.resolveUrl=ui.normalizeId=ui._getFullPath=ui.getFullPath=ui.inlineRef=void 0;var ble=cr(),Sle=Pw(),kle=DR(),xle=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function $le(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ow(t):e?NR(t)<=e:!1}ui.inlineRef=$le;var Ele=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ow(t){for(let e in t){if(Ele.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Ow)||typeof r=="object"&&Ow(r))return!0}return!1}function NR(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!xle.has(r)&&(typeof t[r]=="object"&&(0,ble.eachItem)(t[r],i=>e+=NR(i)),e===1/0))return 1/0}return e}function LR(t,e="",r){r!==!1&&(e=ec(e));let i=t.parse(e);return MR(t,i)}ui.getFullPath=LR;function MR(t,e){return t.serialize(e).split("#")[0]+"#"}ui._getFullPath=MR;var Ale=/#\/?$/;function ec(t){return t?t.replace(Ale,""):""}ui.normalizeId=ec;function Ple(t,e,r){return r=ec(r),t.resolve(e,r)}ui.resolveUrl=Ple;var Ole=/^[a-z_][-a-z0-9._]*$/i;function Ile(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=ec(t[r]||e),a={"":n},o=LR(i,n,!1),s={},l=new Set;return kle(t,{allKeys:!0},(d,f,h,g)=>{if(g===void 0)return;let v=o+f,y=a[g];typeof d[r]=="string"&&(y=w.call(this,d[r])),$.call(this,d.$anchor),$.call(this,d.$dynamicAnchor),a[f]=y;function w(E){let I=this.opts.uriResolver.resolve;if(E=ec(y?I(y,E):E),l.has(E))throw c(E);l.add(E);let R=this.refs[E];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?u(d,R.schema,E):E!==ec(v)&&(E[0]==="#"?(u(d,s[E],E),s[E]=d):this.refs[E]=v),E}function $(E){if(typeof E=="string"){if(!Ole.test(E))throw new Error(`invalid anchor "${E}"`);w.call(this,`#${E}`)}}}),s;function u(d,f,h){if(f!==void 0&&!Sle(d,f))throw c(h)}function c(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ui.getSchemaRefs=Ile});var Cp=be(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.getData=hs.KeywordCxt=hs.validateFunctionCode=void 0;var VR=yR(),zR=Ap(),Cw=bw(),Zg=Ap(),Cle=$R(),Ip=IR(),Iw=jR(),Ot=rr(),Ft=mo(),jle=Pp(),ho=cr(),Op=Ep();function Tle(t){if(WR(t)&&(HR(t),GR(t))){Nle(t);return}BR(t,()=>(0,VR.topBoolOrEmptySchema)(t))}hs.validateFunctionCode=Tle;function BR({gen:t,validateName:e,schema:r,schemaEnv:i,opts:n},a){n.code.es5?t.func(e,(0,Ot._)`${Ft.default.data}, ${Ft.default.valCxt}`,i.$async,()=>{t.code((0,Ot._)`"use strict"; ${qR(r,n)}`),Dle(t,n),t.code(a)}):t.func(e,(0,Ot._)`${Ft.default.data}, ${Rle(n)}`,i.$async,()=>t.code(qR(r,n)).code(a))}function Rle(t){return(0,Ot._)`{${Ft.default.instancePath}="", ${Ft.default.parentData}, ${Ft.default.parentDataProperty}, ${Ft.default.rootData}=${Ft.default.data}${t.dynamicRef?(0,Ot._)`, ${Ft.default.dynamicAnchors}={}`:Ot.nil}}={}`}function Dle(t,e){t.if(Ft.default.valCxt,()=>{t.var(Ft.default.instancePath,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.instancePath}`),t.var(Ft.default.parentData,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.parentData}`),t.var(Ft.default.parentDataProperty,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.parentDataProperty}`),t.var(Ft.default.rootData,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.rootData}`),e.dynamicRef&&t.var(Ft.default.dynamicAnchors,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.dynamicAnchors}`)},()=>{t.var(Ft.default.instancePath,(0,Ot._)`""`),t.var(Ft.default.parentData,(0,Ot._)`undefined`),t.var(Ft.default.parentDataProperty,(0,Ot._)`undefined`),t.var(Ft.default.rootData,Ft.default.data),e.dynamicRef&&t.var(Ft.default.dynamicAnchors,(0,Ot._)`{}`)})}function Nle(t){let{schema:e,opts:r,gen:i}=t;BR(t,()=>{r.$comment&&e.$comment&&ZR(t),Fle(t),i.let(Ft.default.vErrors,null),i.let(Ft.default.errors,0),r.unevaluated&&Lle(t),KR(t),Ble(t)})}function Lle(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,Ot._)`${r}.evaluated`),e.if((0,Ot._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Ot._)`${t.evaluated}.props`,(0,Ot._)`undefined`)),e.if((0,Ot._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Ot._)`${t.evaluated}.items`,(0,Ot._)`undefined`))}function qR(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,Ot._)`/*# sourceURL=${r} */`:Ot.nil}function Mle(t,e){if(WR(t)&&(HR(t),GR(t))){zle(t,e);return}(0,VR.boolOrEmptySchema)(t,e)}function GR({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function WR(t){return typeof t.schema!="boolean"}function zle(t,e){let{schema:r,gen:i,opts:n}=t;n.$comment&&r.$comment&&ZR(t),Ule(t),Vle(t);let a=i.const("_errs",Ft.default.errors);KR(t,a),i.var(e,(0,Ot._)`${a} === ${Ft.default.errors}`)}function HR(t){(0,ho.checkUnknownRules)(t),qle(t)}function KR(t,e){if(t.opts.jtd)return FR(t,[],!1,e);let r=(0,zR.getSchemaTypes)(t.schema),i=(0,zR.coerceAndCheckDataType)(t,r);FR(t,r,!i,e)}function qle(t){let{schema:e,errSchemaPath:r,opts:i,self:n}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,ho.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Fle(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ho.checkStrictMode)(t,"default is ignored in the schema root")}function Ule(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,jle.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Vle(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ZR({gen:t,schemaEnv:e,schema:r,errSchemaPath:i,opts:n}){let a=r.$comment;if(n.$comment===!0)t.code((0,Ot._)`${Ft.default.self}.logger.log(${a})`);else if(typeof n.$comment=="function"){let o=(0,Ot.str)`${i}/$comment`,s=t.scopeValue("root",{ref:e.root});t.code((0,Ot._)`${Ft.default.self}.opts.$comment(${a}, ${o}, ${s}.schema)`)}}function Ble(t){let{gen:e,schemaEnv:r,validateName:i,ValidationError:n,opts:a}=t;r.$async?e.if((0,Ot._)`${Ft.default.errors} === 0`,()=>e.return(Ft.default.data),()=>e.throw((0,Ot._)`new ${n}(${Ft.default.vErrors})`)):(e.assign((0,Ot._)`${i}.errors`,Ft.default.vErrors),a.unevaluated&&Gle(t),e.return((0,Ot._)`${Ft.default.errors} === 0`))}function Gle({gen:t,evaluated:e,props:r,items:i}){r instanceof Ot.Name&&t.assign((0,Ot._)`${e}.props`,r),i instanceof Ot.Name&&t.assign((0,Ot._)`${e}.items`,i)}function FR(t,e,r,i){let{gen:n,schema:a,data:o,allErrors:s,opts:l,self:u}=t,{RULES:c}=u;if(a.$ref&&(l.ignoreKeywordsWithRef||!(0,ho.schemaHasRulesButRef)(a,c))){n.block(()=>YR(t,"$ref",c.all.$ref.definition));return}l.jtd||Wle(t,e),n.block(()=>{for(let f of c.rules)d(f);d(c.post)});function d(f){(0,Cw.shouldUseGroup)(a,f)&&(f.type?(n.if((0,Zg.checkDataType)(f.type,o,l.strictNumbers)),UR(t,f),e.length===1&&e[0]===f.type&&r&&(n.else(),(0,Zg.reportTypeError)(t)),n.endIf()):UR(t,f),s||n.if((0,Ot._)`${Ft.default.errors} === ${i||0}`))}}function UR(t,e){let{gen:r,schema:i,opts:{useDefaults:n}}=t;n&&(0,Cle.assignDefaults)(t,e.type),r.block(()=>{for(let a of e.rules)(0,Cw.shouldUseRule)(i,a)&&YR(t,a.keyword,a.definition,e.type)})}function Wle(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Hle(t,e),t.opts.allowUnionTypes||Kle(t,e),Zle(t,t.dataTypes))}function Hle(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{JR(t.dataTypes,r)||jw(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Yle(t,e)}}function Kle(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&jw(t,"use allowUnionTypes to allow union type keyword")}function Zle(t,e){let r=t.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,Cw.shouldUseRule)(t.schema,n)){let{type:a}=n.definition;a.length&&!a.some(o=>Jle(e,o))&&jw(t,`missing type "${a.join(",")}" for keyword "${i}"`)}}}function Jle(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function JR(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Yle(t,e){let r=[];for(let i of t.dataTypes)JR(e,i)?r.push(i):e.includes("integer")&&i==="number"&&r.push("integer");t.dataTypes=r}function jw(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ho.checkStrictMode)(t,e,t.opts.strictTypes)}var Jg=class{constructor(e,r,i){if((0,Ip.validateKeywordUsage)(e,r,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ho.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",QR(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ip.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Ft.default.errors))}result(e,r,i){this.failResult((0,Ot.not)(e),r,i)}failResult(e,r,i){this.gen.if(e),i?i():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,Ot.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,Ot._)`${r} !== undefined && (${(0,Ot.or)(this.invalid$data(),e)})`)}error(e,r,i){if(r){this.setParams(r),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,r){(e?Op.reportExtraError:Op.reportError)(this,this.def.error,r)}$dataError(){(0,Op.reportError)(this,this.def.$dataError||Op.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Op.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,i=Ot.nil){this.gen.block(()=>{this.check$data(e,i),r()})}check$data(e=Ot.nil,r=Ot.nil){if(!this.$data)return;let{gen:i,schemaCode:n,schemaType:a,def:o}=this;i.if((0,Ot.or)((0,Ot._)`${n} === undefined`,r)),e!==Ot.nil&&i.assign(e,!0),(a.length||o.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==Ot.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:i,def:n,it:a}=this;return(0,Ot.or)(o(),s());function o(){if(i.length){if(!(r instanceof Ot.Name))throw new Error("ajv implementation error");let l=Array.isArray(i)?i:[i];return(0,Ot._)`${(0,Zg.checkDataTypes)(l,r,a.opts.strictNumbers,Zg.DataType.Wrong)}`}return Ot.nil}function s(){if(n.validateSchema){let l=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,Ot._)`!${l}(${r})`}return Ot.nil}}subschema(e,r){let i=(0,Iw.getSubschema)(this.it,e);(0,Iw.extendSubschemaData)(i,this.it,e),(0,Iw.extendSubschemaMode)(i,e);let n={...this.it,...i,items:void 0,props:void 0};return Mle(n,r),n}mergeEvaluated(e,r){let{it:i,gen:n}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=ho.mergeEvaluated.props(n,e.props,i.props,r)),i.items!==!0&&e.items!==void 0&&(i.items=ho.mergeEvaluated.items(n,e.items,i.items,r)))}mergeValidEvaluated(e,r){let{it:i,gen:n}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,Ot.Name)),!0}};hs.KeywordCxt=Jg;function YR(t,e,r,i){let n=new Jg(t,r,e);"code"in r?r.code(n,i):n.$data&&r.validate?(0,Ip.funcKeywordCode)(n,r):"macro"in r?(0,Ip.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Ip.funcKeywordCode)(n,r)}var Qle=/^\/(?:[^~]|~0|~1)*$/,Xle=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function QR(t,{dataLevel:e,dataNames:r,dataPathArr:i}){let n,a;if(t==="")return Ft.default.rootData;if(t[0]==="/"){if(!Qle.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,a=Ft.default.rootData}else{let u=Xle.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let c=+u[1];if(n=u[2],n==="#"){if(c>=e)throw new Error(l("property/index",c));return i[e-c]}if(c>e)throw new Error(l("data",c));if(a=r[e-c],!n)return a}let o=a,s=n.split("/");for(let u of s)u&&(a=(0,Ot._)`${a}${(0,Ot.getProperty)((0,ho.unescapeJsonPointer)(u))}`,o=(0,Ot._)`${o} && ${a}`);return o;function l(u,c){return`Cannot access ${u} ${c} levels up, current level is ${e}`}}hs.getData=QR});var Yg=be(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var Tw=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Rw.default=Tw});var jp=be(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var Dw=Pp(),Nw=class extends Error{constructor(e,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,Dw.resolveUrl)(e,r,i),this.missingSchema=(0,Dw.normalizeId)((0,Dw.getFullPath)(e,this.missingRef))}};Lw.default=Nw});var Xg=be(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.resolveSchema=Zi.getCompilingSchema=Zi.resolveRef=Zi.compileSchema=Zi.SchemaEnv=void 0;var fa=rr(),eue=Yg(),hl=mo(),ma=Pp(),XR=cr(),tue=Cp(),tc=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,ma.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};Zi.SchemaEnv=tc;function zw(t){let e=eD.call(this,t);if(e)return e;let r=(0,ma.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:a}=this.opts,o=new fa.CodeGen(this.scope,{es5:i,lines:n,ownProperties:a}),s;t.$async&&(s=o.scopeValue("Error",{ref:eue.default,code:(0,fa._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");t.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:hl.default.data,parentData:hl.default.parentData,parentDataProperty:hl.default.parentDataProperty,dataNames:[hl.default.data],dataPathArr:[fa.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,fa.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:fa.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,fa._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(t),(0,tue.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let d=o.toString();c=`${o.scopeRefs(hl.default.scope)}return ${d}`,this.opts.code.process&&(c=this.opts.code.process(c,t));let h=new Function(`${hl.default.self}`,`${hl.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:g,items:v}=u;h.evaluated={props:g instanceof fa.Name?void 0:g,items:v instanceof fa.Name?void 0:v,dynamicProps:g instanceof fa.Name,dynamicItems:v instanceof fa.Name},h.source&&(h.source.evaluated=(0,fa.stringify)(h.evaluated))}return t.validate=h,t}catch(d){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),d}finally{this._compilations.delete(t)}}Zi.compileSchema=zw;function rue(t,e,r){var i;r=(0,ma.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let a=aue.call(this,t,r);if(a===void 0){let o=(i=t.localRefs)===null||i===void 0?void 0:i[r],{schemaId:s}=this.opts;o&&(a=new tc({schema:o,schemaId:s,root:t,baseId:e}))}if(a!==void 0)return t.refs[r]=nue.call(this,a)}Zi.resolveRef=rue;function nue(t){return(0,ma.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:zw.call(this,t)}function eD(t){for(let e of this._compilations)if(iue(e,t))return e}Zi.getCompilingSchema=eD;function iue(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function aue(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Qg.call(this,t,e)}function Qg(t,e){let r=this.opts.uriResolver.parse(e),i=(0,ma._getFullPath)(this.opts.uriResolver,r),n=(0,ma.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===n)return Mw.call(this,r,t);let a=(0,ma.normalizeId)(i),o=this.refs[a]||this.schemas[a];if(typeof o=="string"){let s=Qg.call(this,t,o);return typeof s?.schema!="object"?void 0:Mw.call(this,r,s)}if(typeof o?.schema=="object"){if(o.validate||zw.call(this,o),a===(0,ma.normalizeId)(e)){let{schema:s}=o,{schemaId:l}=this.opts,u=s[l];return u&&(n=(0,ma.resolveUrl)(this.opts.uriResolver,n,u)),new tc({schema:s,schemaId:l,root:t,baseId:n})}return Mw.call(this,r,o)}}Zi.resolveSchema=Qg;var oue=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Mw(t,{baseId:e,schema:r,root:i}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let s of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,XR.unescapeFragment)(s)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!oue.has(s)&&u&&(e=(0,ma.resolveUrl)(this.opts.uriResolver,e,u))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,XR.schemaHasRulesButRef)(r,this.RULES)){let s=(0,ma.resolveUrl)(this.opts.uriResolver,e,r.$ref);a=Qg.call(this,i,s)}let{schemaId:o}=this.opts;if(a=a||new tc({schema:r,schemaId:o,root:i,baseId:e}),a.schema!==a.root.schema)return a}});var tD=be(($7e,sue)=>{sue.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Uw=be((E7e,sD)=>{"use strict";var lue=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),nD=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),qw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),iD=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),uue=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Fw(t){let e="",r=0,i=0;for(i=0;i<t.length;i++)if(r=t[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(r=t[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i]}return e}var cue=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function rD(t){return t.length=0,!0}function due(t,e,r){if(t.length){let i=Fw(t);if(i!=="")e.push(i);else return r.error=!0,!1;t.length=0}return!0}function pue(t){let e=0,r={error:!1,address:"",zone:""},i=[],n=[],a=!1,o=!1,s=due;for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(a===!0&&(o=!0),!s(n,i,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(a=!0),i.push(":");continue}else if(u==="%"){if(!s(n,i,r))break;s=rD}else{n.push(u);continue}}return n.length&&(s===rD?r.zone=n.join(""):o?i.push(n.join("")):i.push(Fw(n))),r.address=i.join(""),r}function aD(t){if(fue(t,":")<2)return{host:t,isIPV6:!1};let e=pue(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,i=e.address;return e.zone&&(r+="%"+e.zone,i+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:i}}}function fue(t,e){let r=0;for(let i=0;i<t.length;i++)t[i]===e&&r++;return r}function mue(t){let e=t,r=[],i=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((i=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,i)),e=e.slice(i)}return r.join("")}var hue={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},gue=/[@/?#:]/g,vue=/[@/?#]/g;function oD(t,e){let r=e?vue:gue;return r.lastIndex=0,t.replace(r,i=>hue[i])}function yue(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let n=t.slice(i+1,i+3);if(qw(n)){let a=n.toUpperCase(),o=String.fromCharCode(parseInt(a,16));e&&iD(o)?r+=o:r+="%"+a,i+=2;continue}}r+=t[i]}return r}function _ue(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let i=t.slice(r+1,r+3);if(qw(i)){let n=i.toUpperCase(),a=String.fromCharCode(parseInt(n,16));a!=="."&&iD(a)?e+=a:e+="%"+n,r+=2;continue}}uue(t[r])?e+=t[r]:e+=escape(t[r])}return e}function wue(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let i=t.slice(r+1,r+3);if(qw(i)){e+="%"+i.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function bue(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!nD(r)){let i=aD(r);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=oD(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}sD.exports={nonSimpleDomain:cue,recomposeAuthority:bue,reescapeHostDelimiters:oD,normalizePercentEncoding:yue,normalizePathEncoding:_ue,escapePreservingEscapes:wue,removeDotSegments:mue,isIPv4:nD,isUUID:lue,normalizeIPv6:aD,stringArrayToHexStripped:Fw}});var pD=be((A7e,dD)=>{"use strict";var{isUUID:Sue}=Uw(),kue=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xue=["http","https","ws","wss","urn","urn:uuid"];function $ue(t){return xue.indexOf(t)!==-1}function Vw(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function lD(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function uD(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Eue(t){return t.secure=Vw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Aue(t){if((t.port===(Vw(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function Pue(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(kue);if(r){let i=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${i}:${e.nid||t.nid}`,a=Bw(n);t.path=void 0,a&&(t=a.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Oue(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),n=`${r}:${e.nid||i}`,a=Bw(n);a&&(t=a.serialize(t,e));let o=t,s=t.nss;return o.path=`${i||e.nid}:${s}`,e.skipEscape=!0,o}function Iue(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Sue(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Cue(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var cD={scheme:"http",domainHost:!0,parse:lD,serialize:uD},jue={scheme:"https",domainHost:cD.domainHost,parse:lD,serialize:uD},e0={scheme:"ws",domainHost:!0,parse:Eue,serialize:Aue},Tue={scheme:"wss",domainHost:e0.domainHost,parse:e0.parse,serialize:e0.serialize},Rue={scheme:"urn",parse:Pue,serialize:Oue,skipNormalize:!0},Due={scheme:"urn:uuid",parse:Iue,serialize:Cue,skipNormalize:!0},t0={http:cD,https:jue,ws:e0,wss:Tue,urn:Rue,"urn:uuid":Due};Object.setPrototypeOf(t0,null);function Bw(t){return t&&(t0[t]||t0[t.toLowerCase()])||void 0}dD.exports={wsIsSecure:Vw,SCHEMES:t0,isValidSchemeName:$ue,getSchemeHandler:Bw}});var yD=be((P7e,r0)=>{"use strict";var{normalizeIPv6:Nue,removeDotSegments:Tp,recomposeAuthority:Lue,normalizePercentEncoding:Mue,normalizePathEncoding:zue,escapePreservingEscapes:que,reescapeHostDelimiters:Fue,isIPv4:Uue,nonSimpleDomain:Vue}=Uw(),{SCHEMES:Bue,getSchemeHandler:mD}=pD();function Gue(t,e){return typeof t=="string"?t=Jue(t,e):typeof t=="object"&&(t=rc(gl(t,e),e)),t}function Wue(t,e,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=hD(rc(t,i),rc(e,i),i,!0);return i.skipEscape=!0,gl(n,i)}function hD(t,e,r,i){let n={};return i||(t=rc(gl(t,r),r),e=rc(gl(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Tp(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Tp(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Tp(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Tp(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function Hue(t,e,r){let i=fD(t,r),n=fD(e,r);return i!==void 0&&n!==void 0&&i.toLowerCase()===n.toLowerCase()}function gl(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),n=[],a=mD(i.scheme||r.scheme);a&&a.serialize&&a.serialize(r,i),r.path!==void 0&&(i.skipEscape?r.path=Mue(r.path):(r.path=que(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),i.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let o=Lue(r);if(o!==void 0&&(i.reference!=="suffix"&&n.push("//"),n.push(o),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let s=r.path;!i.absolutePath&&(!a||!a.absolutePath)&&(s=Tp(s)),o===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),n.push(s)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var Kue=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Zue(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function gD(t,e){let r=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,a=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let o=t.match(Kue);if(o){i.scheme=o[1],i.userinfo=o[3],i.host=o[4],i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=o[7],i.fragment=o[8],isNaN(i.port)&&(i.port=o[5]);let s=Zue(i,o);if(s!==void 0&&(i.error=i.error||s,n=!0),i.host)if(Uue(i.host)===!1){let c=Nue(i.host);i.host=c.host.toLowerCase(),a=c.isIPV6}else a=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let l=mD(r.scheme||i.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&i.host&&(r.domainHost||l&&l.domainHost)&&a===!1&&Vue(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(u){i.error=i.error||"Host's domain name can not be converted to ASCII: "+u}if((!l||l&&!l.skipNormalize)&&(t.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=Fue(unescape(i.host),a))),i.path&&(i.path=zue(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}l&&l.parse&&l.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:n}}function rc(t,e){return gD(t,e).parsed}function Jue(t,e){return vD(t,e).normalized}function vD(t,e){let{parsed:r,malformedAuthorityOrPort:i}=gD(t,e);return{normalized:i?t:gl(r,e),malformedAuthorityOrPort:i}}function fD(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:i}=vD(t,e);return i?void 0:r}if(typeof t=="object")return gl(t,e)}var Gw={SCHEMES:Bue,normalize:Gue,resolve:Wue,resolveComponent:hD,equal:Hue,serialize:gl,parse:rc};r0.exports=Gw;r0.exports.default=Gw;r0.exports.fastUri=Gw});var wD=be(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var _D=yD();_D.code='require("ajv/dist/runtime/uri").default';Ww.default=_D});var PD=be(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.CodeGen=xn.Name=xn.nil=xn.stringify=xn.str=xn._=xn.KeywordCxt=void 0;var Yue=Cp();Object.defineProperty(xn,"KeywordCxt",{enumerable:!0,get:function(){return Yue.KeywordCxt}});var nc=rr();Object.defineProperty(xn,"_",{enumerable:!0,get:function(){return nc._}});Object.defineProperty(xn,"str",{enumerable:!0,get:function(){return nc.str}});Object.defineProperty(xn,"stringify",{enumerable:!0,get:function(){return nc.stringify}});Object.defineProperty(xn,"nil",{enumerable:!0,get:function(){return nc.nil}});Object.defineProperty(xn,"Name",{enumerable:!0,get:function(){return nc.Name}});Object.defineProperty(xn,"CodeGen",{enumerable:!0,get:function(){return nc.CodeGen}});var Que=Yg(),$D=jp(),Xue=ww(),Rp=Xg(),ece=rr(),Dp=Pp(),n0=Ap(),Kw=cr(),bD=tD(),tce=wD(),ED=(t,e)=>new RegExp(t,e);ED.code="new RegExp";var rce=["removeAdditional","useDefaults","coerceTypes"],nce=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),ice={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},ace={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},SD=200;function oce(t){var e,r,i,n,a,o,s,l,u,c,d,f,h,g,v,y,w,$,E,I,R,M,T,O,N;let j=t.strict,x=(e=t.code)===null||e===void 0?void 0:e.optimize,b=x===!0||x===void 0?1:x||0,U=(i=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:ED,k=(n=t.uriResolver)!==null&&n!==void 0?n:tce.default;return{strictSchema:(o=(a=t.strictSchema)!==null&&a!==void 0?a:j)!==null&&o!==void 0?o:!0,strictNumbers:(l=(s=t.strictNumbers)!==null&&s!==void 0?s:j)!==null&&l!==void 0?l:!0,strictTypes:(c=(u=t.strictTypes)!==null&&u!==void 0?u:j)!==null&&c!==void 0?c:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:j)!==null&&f!==void 0?f:"log",strictRequired:(g=(h=t.strictRequired)!==null&&h!==void 0?h:j)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:b,regExp:U}:{optimize:b,regExp:U},loopRequired:(v=t.loopRequired)!==null&&v!==void 0?v:SD,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:SD,meta:(w=t.meta)!==null&&w!==void 0?w:!0,messages:($=t.messages)!==null&&$!==void 0?$:!0,inlineRefs:(E=t.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(I=t.schemaId)!==null&&I!==void 0?I:"$id",addUsedSchema:(R=t.addUsedSchema)!==null&&R!==void 0?R:!0,validateSchema:(M=t.validateSchema)!==null&&M!==void 0?M:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(O=t.unicodeRegExp)!==null&&O!==void 0?O:!0,int32range:(N=t.int32range)!==null&&N!==void 0?N:!0,uriResolver:k}}var Np=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...oce(e)};let{es5:r,lines:i}=this.opts.code;this.scope=new ece.ValueScope({scope:{},prefixes:nce,es5:r,lines:i}),this.logger=pce(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Xue.getRules)(),kD.call(this,ice,e,"NOT SUPPORTED"),kD.call(this,ace,e,"DEPRECATED","warn"),this._metaOpts=cce.call(this),e.formats&&lce.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&uce.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),sce.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:i}=this.opts,n=bD;i==="id"&&(n={...bD},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let n=i(r);return"$async"in i||(this.errors=i.errors),n}compile(e,r){let i=this._addSchema(e,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return n.call(this,e,r);async function n(c,d){await a.call(this,c.$schema);let f=this._addSchema(c,d);return f.validate||o.call(this,f)}async function a(c){c&&!this.getSchema(c)&&await n.call(this,{$ref:c},!0)}async function o(c){try{return this._compileSchemaEnv(c)}catch(d){if(!(d instanceof $D.default))throw d;return s.call(this,d),await l.call(this,d.missingSchema),o.call(this,c)}}function s({missingSchema:c,missingRef:d}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${d} cannot be resolved`)}async function l(c){let d=await u.call(this,c);this.refs[c]||await a.call(this,d.$schema),this.refs[c]||this.addSchema(d,c,r)}async function u(c){let d=this._loading[c];if(d)return d;try{return await(this._loading[c]=i(c))}finally{delete this._loading[c]}}}addSchema(e,r,i,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,i,n);return this}let a;if(typeof e=="object"){let{schemaId:o}=this.opts;if(a=e[o],a!==void 0&&typeof a!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Dp.normalizeId)(r||a),this._checkUnique(r),this.schemas[r]=this._addSchema(e,i,r,n,!0),this}addMetaSchema(e,r,i=this.opts.validateSchema){return this.addSchema(e,r,!0,i),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let i;if(i=e.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(i,e);if(!n&&r){let a="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(a);else throw new Error(a)}return n}getSchema(e){let r;for(;typeof(r=xD.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Rp.SchemaEnv({schema:{},schemaId:i});if(r=Rp.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=xD.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let i=e[this.opts.schemaId];return i&&(i=(0,Dp.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let i;if(typeof e=="string")i=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof e=="object"&&r===void 0){if(r=e,i=r.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(mce.call(this,i,r),!r)return(0,Kw.eachItem)(i,a=>Hw.call(this,a)),this;gce.call(this,r);let n={...r,type:(0,n0.getJSONTypes)(r.type),schemaType:(0,n0.getJSONTypes)(r.schemaType)};return(0,Kw.eachItem)(i,n.type.length===0?a=>Hw.call(this,a,n):a=>n.type.forEach(o=>Hw.call(this,a,n,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let i of r.rules){let n=i.rules.findIndex(a=>a.keyword===e);n>=0&&i.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${i}${n.instancePath} ${n.message}`).reduce((n,a)=>n+r+a)}$dataMetaSchema(e,r){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let a=n.split("/").slice(1),o=e;for(let s of a)o=o[s];for(let s in i){let l=i[s];if(typeof l!="object")continue;let{$data:u}=l.definition,c=o[s];u&&c&&(o[s]=AD(c))}}return e}_removeAllSchemas(e,r){for(let i in e){let n=e[i];(!r||r.test(i))&&(typeof n=="string"?delete e[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[i]))}}_addSchema(e,r,i,n=this.opts.validateSchema,a=this.opts.addUsedSchema){let o,{schemaId:s}=this.opts;if(typeof e=="object")o=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;i=(0,Dp.normalizeId)(o||i);let u=Dp.getSchemaRefs.call(this,e,i);return l=new Rp.SchemaEnv({schema:e,schemaId:s,meta:r,baseId:i,localRefs:u}),this._cache.set(l.schema,l),a&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=l),n&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Rp.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Rp.compileSchema.call(this,e)}finally{this.opts=r}}};Np.ValidationError=Que.default;Np.MissingRefError=$D.default;xn.default=Np;function kD(t,e,r,i="error"){for(let n in t){let a=n;a in e&&this.logger[i](`${r}: option ${n}. ${t[a]}`)}}function xD(t){return t=(0,Dp.normalizeId)(t),this.schemas[t]||this.refs[t]}function sce(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function lce(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function uce(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function cce(){let t={...this.opts};for(let e of rce)delete t[e];return t}var dce={log(){},warn(){},error(){}};function pce(t){if(t===!1)return dce;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var fce=/^[a-z_$][a-z0-9_$:-]*$/i;function mce(t,e){let{RULES:r}=this;if((0,Kw.eachItem)(t,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!fce.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Hw(t,e,r){var i;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,o=n?a.post:a.rules.find(({type:l})=>l===r);if(o||(o={type:r,rules:[]},a.rules.push(o)),a.keywords[t]=!0,!e)return;let s={keyword:t,definition:{...e,type:(0,n0.getJSONTypes)(e.type),schemaType:(0,n0.getJSONTypes)(e.schemaType)}};e.before?hce.call(this,o,s,e.before):o.rules.push(s),a.all[t]=s,(i=e.implements)===null||i===void 0||i.forEach(l=>this.addKeyword(l))}function hce(t,e,r){let i=t.rules.findIndex(n=>n.keyword===r);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function gce(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=AD(e)),t.validateSchema=this.compile(e,!0))}var vce={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function AD(t){return{anyOf:[t,vce]}}});var OD=be(Zw=>{"use strict";Object.defineProperty(Zw,"__esModule",{value:!0});var yce={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Zw.default=yce});var TD=be(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.callRef=vl.getValidate=void 0;var _ce=jp(),ID=Ki(),ci=rr(),ic=mo(),CD=Xg(),i0=cr(),wce={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:i}=t,{baseId:n,schemaEnv:a,validateName:o,opts:s,self:l}=i,{root:u}=a;if((r==="#"||r==="#/")&&n===u.baseId)return d();let c=CD.resolveRef.call(l,u,n,r);if(c===void 0)throw new _ce.default(i.opts.uriResolver,n,r);if(c instanceof CD.SchemaEnv)return f(c);return h(c);function d(){if(a===u)return a0(t,o,a,a.$async);let g=e.scopeValue("root",{ref:u});return a0(t,(0,ci._)`${g}.validate`,u,u.$async)}function f(g){let v=jD(t,g);a0(t,v,g,g.$async)}function h(g){let v=e.scopeValue("schema",s.code.source===!0?{ref:g,code:(0,ci.stringify)(g)}:{ref:g}),y=e.name("valid"),w=t.subschema({schema:g,dataTypes:[],schemaPath:ci.nil,topSchemaRef:v,errSchemaPath:r},y);t.mergeEvaluated(w),t.ok(y)}}};function jD(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ci._)`${r.scopeValue("wrapper",{ref:e})}.validate`}vl.getValidate=jD;function a0(t,e,r,i){let{gen:n,it:a}=t,{allErrors:o,schemaEnv:s,opts:l}=a,u=l.passContext?ic.default.this:ci.nil;i?c():d();function c(){if(!s.$async)throw new Error("async schema referenced by sync schema");let g=n.let("valid");n.try(()=>{n.code((0,ci._)`await ${(0,ID.callValidateCode)(t,e,u)}`),h(e),o||n.assign(g,!0)},v=>{n.if((0,ci._)`!(${v} instanceof ${a.ValidationError})`,()=>n.throw(v)),f(v),o||n.assign(g,!1)}),t.ok(g)}function d(){t.result((0,ID.callValidateCode)(t,e,u),()=>h(e),()=>f(e))}function f(g){let v=(0,ci._)`${g}.errors`;n.assign(ic.default.vErrors,(0,ci._)`${ic.default.vErrors} === null ? ${v} : ${ic.default.vErrors}.concat(${v})`),n.assign(ic.default.errors,(0,ci._)`${ic.default.vErrors}.length`)}function h(g){var v;if(!a.opts.unevaluated)return;let y=(v=r?.validate)===null||v===void 0?void 0:v.evaluated;if(a.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(a.props=i0.mergeEvaluated.props(n,y.props,a.props));else{let w=n.var("props",(0,ci._)`${g}.evaluated.props`);a.props=i0.mergeEvaluated.props(n,w,a.props,ci.Name)}if(a.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(a.items=i0.mergeEvaluated.items(n,y.items,a.items));else{let w=n.var("items",(0,ci._)`${g}.evaluated.items`);a.items=i0.mergeEvaluated.items(n,w,a.items,ci.Name)}}}vl.callRef=a0;vl.default=wce});var RD=be(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var bce=OD(),Sce=TD(),kce=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",bce.default,Sce.default];Jw.default=kce});var DD=be(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});var o0=rr(),gs=o0.operators,s0={maximum:{okStr:"<=",ok:gs.LTE,fail:gs.GT},minimum:{okStr:">=",ok:gs.GTE,fail:gs.LT},exclusiveMaximum:{okStr:"<",ok:gs.LT,fail:gs.GTE},exclusiveMinimum:{okStr:">",ok:gs.GT,fail:gs.LTE}},xce={message:({keyword:t,schemaCode:e})=>(0,o0.str)`must be ${s0[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,o0._)`{comparison: ${s0[t].okStr}, limit: ${e}}`},$ce={keyword:Object.keys(s0),type:"number",schemaType:"number",$data:!0,error:xce,code(t){let{keyword:e,data:r,schemaCode:i}=t;t.fail$data((0,o0._)`${r} ${s0[e].fail} ${i} || isNaN(${r})`)}};Yw.default=$ce});var ND=be(Qw=>{"use strict";Object.defineProperty(Qw,"__esModule",{value:!0});var Lp=rr(),Ece={message:({schemaCode:t})=>(0,Lp.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Lp._)`{multipleOf: ${t}}`},Ace={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ece,code(t){let{gen:e,data:r,schemaCode:i,it:n}=t,a=n.opts.multipleOfPrecision,o=e.let("res"),s=a?(0,Lp._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${a}`:(0,Lp._)`${o} !== parseInt(${o})`;t.fail$data((0,Lp._)`(${i} === 0 || (${o} = ${r}/${i}, ${s}))`)}};Qw.default=Ace});var MD=be(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});function LD(t){let e=t.length,r=0,i=0,n;for(;i<e;)r++,n=t.charCodeAt(i++),n>=55296&&n<=56319&&i<e&&(n=t.charCodeAt(i),(n&64512)===56320&&i++);return r}Xw.default=LD;LD.code='require("ajv/dist/runtime/ucs2length").default'});var zD=be(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var yl=rr(),Pce=cr(),Oce=MD(),Ice={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,yl.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,yl._)`{limit: ${t}}`},Cce={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ice,code(t){let{keyword:e,data:r,schemaCode:i,it:n}=t,a=e==="maxLength"?yl.operators.GT:yl.operators.LT,o=n.opts.unicode===!1?(0,yl._)`${r}.length`:(0,yl._)`${(0,Pce.useFunc)(t.gen,Oce.default)}(${r})`;t.fail$data((0,yl._)`${o} ${a} ${i}`)}};eb.default=Cce});var qD=be(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var jce=Ki(),Tce=cr(),ac=rr(),Rce={message:({schemaCode:t})=>(0,ac.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ac._)`{pattern: ${t}}`},Dce={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Rce,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:a,it:o}=t,s=o.opts.unicodeRegExp?"u":"";if(i){let{regExp:l}=o.opts.code,u=l.code==="new RegExp"?(0,ac._)`new RegExp`:(0,Tce.useFunc)(e,l),c=e.let("valid");e.try(()=>e.assign(c,(0,ac._)`${u}(${a}, ${s}).test(${r})`),()=>e.assign(c,!1)),t.fail$data((0,ac._)`!${c}`)}else{let l=(0,jce.usePattern)(t,n);t.fail$data((0,ac._)`!${l}.test(${r})`)}}};tb.default=Dce});var FD=be(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var Mp=rr(),Nce={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Mp.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Mp._)`{limit: ${t}}`},Lce={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Nce,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxProperties"?Mp.operators.GT:Mp.operators.LT;t.fail$data((0,Mp._)`Object.keys(${r}).length ${n} ${i}`)}};rb.default=Lce});var UD=be(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var zp=Ki(),qp=rr(),Mce=cr(),zce={message:({params:{missingProperty:t}})=>(0,qp.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,qp._)`{missingProperty: ${t}}`},qce={keyword:"required",type:"object",schemaType:"array",$data:!0,error:zce,code(t){let{gen:e,schema:r,schemaCode:i,data:n,$data:a,it:o}=t,{opts:s}=o;if(!a&&r.length===0)return;let l=r.length>=s.loopRequired;if(o.allErrors?u():c(),s.strictRequired){let h=t.parentSchema.properties,{definedProperties:g}=t.it;for(let v of r)if(h?.[v]===void 0&&!g.has(v)){let y=o.schemaEnv.baseId+o.errSchemaPath,w=`required property "${v}" is not defined at "${y}" (strictRequired)`;(0,Mce.checkStrictMode)(o,w,o.opts.strictRequired)}}function u(){if(l||a)t.block$data(qp.nil,d);else for(let h of r)(0,zp.checkReportMissingProp)(t,h)}function c(){let h=e.let("missing");if(l||a){let g=e.let("valid",!0);t.block$data(g,()=>f(h,g)),t.ok(g)}else e.if((0,zp.checkMissingProp)(t,r,h)),(0,zp.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",i,h=>{t.setParams({missingProperty:h}),e.if((0,zp.noPropertyInData)(e,n,h,s.ownProperties),()=>t.error())})}function f(h,g){t.setParams({missingProperty:h}),e.forOf(h,i,()=>{e.assign(g,(0,zp.propertyInData)(e,n,h,s.ownProperties)),e.if((0,qp.not)(g),()=>{t.error(),e.break()})},qp.nil)}}};nb.default=qce});var VD=be(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var Fp=rr(),Fce={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Fp.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Fp._)`{limit: ${t}}`},Uce={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Fce,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxItems"?Fp.operators.GT:Fp.operators.LT;t.fail$data((0,Fp._)`${r}.length ${n} ${i}`)}};ib.default=Uce});var l0=be(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var BD=Pw();BD.code='require("ajv/dist/runtime/equal").default';ab.default=BD});var GD=be(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var ob=Ap(),$n=rr(),Vce=cr(),Bce=l0(),Gce={message:({params:{i:t,j:e}})=>(0,$n.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,$n._)`{i: ${t}, j: ${e}}`},Wce={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Gce,code(t){let{gen:e,data:r,$data:i,schema:n,parentSchema:a,schemaCode:o,it:s}=t;if(!i&&!n)return;let l=e.let("valid"),u=a.items?(0,ob.getSchemaTypes)(a.items):[];t.block$data(l,c,(0,$n._)`${o} === false`),t.ok(l);function c(){let g=e.let("i",(0,$n._)`${r}.length`),v=e.let("j");t.setParams({i:g,j:v}),e.assign(l,!0),e.if((0,$n._)`${g} > 1`,()=>(d()?f:h)(g,v))}function d(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function f(g,v){let y=e.name("item"),w=(0,ob.checkDataTypes)(u,y,s.opts.strictNumbers,ob.DataType.Wrong),$=e.const("indices",(0,$n._)`{}`);e.for((0,$n._)`;${g}--;`,()=>{e.let(y,(0,$n._)`${r}[${g}]`),e.if(w,(0,$n._)`continue`),u.length>1&&e.if((0,$n._)`typeof ${y} == "string"`,(0,$n._)`${y} += "_"`),e.if((0,$n._)`typeof ${$}[${y}] == "number"`,()=>{e.assign(v,(0,$n._)`${$}[${y}]`),t.error(),e.assign(l,!1).break()}).code((0,$n._)`${$}[${y}] = ${g}`)})}function h(g,v){let y=(0,Vce.useFunc)(e,Bce.default),w=e.name("outer");e.label(w).for((0,$n._)`;${g}--;`,()=>e.for((0,$n._)`${v} = ${g}; ${v}--;`,()=>e.if((0,$n._)`${y}(${r}[${g}], ${r}[${v}])`,()=>{t.error(),e.assign(l,!1).break(w)})))}}};sb.default=Wce});var WD=be(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var lb=rr(),Hce=cr(),Kce=l0(),Zce={message:"must be equal to constant",params:({schemaCode:t})=>(0,lb._)`{allowedValue: ${t}}`},Jce={keyword:"const",$data:!0,error:Zce,code(t){let{gen:e,data:r,$data:i,schemaCode:n,schema:a}=t;i||a&&typeof a=="object"?t.fail$data((0,lb._)`!${(0,Hce.useFunc)(e,Kce.default)}(${r}, ${n})`):t.fail((0,lb._)`${a} !== ${r}`)}};ub.default=Jce});var HD=be(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var Up=rr(),Yce=cr(),Qce=l0(),Xce={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Up._)`{allowedValues: ${t}}`},ede={keyword:"enum",schemaType:"array",$data:!0,error:Xce,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:a,it:o}=t;if(!i&&n.length===0)throw new Error("enum must have non-empty array");let s=n.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,Yce.useFunc)(e,Qce.default)),c;if(s||i)c=e.let("valid"),t.block$data(c,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let h=e.const("vSchema",a);c=(0,Up.or)(...n.map((g,v)=>f(h,v)))}t.pass(c);function d(){e.assign(c,!1),e.forOf("v",a,h=>e.if((0,Up._)`${u()}(${r}, ${h})`,()=>e.assign(c,!0).break()))}function f(h,g){let v=n[g];return typeof v=="object"&&v!==null?(0,Up._)`${u()}(${r}, ${h}[${g}])`:(0,Up._)`${r} === ${v}`}}};cb.default=ede});var KD=be(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var tde=DD(),rde=ND(),nde=zD(),ide=qD(),ade=FD(),ode=UD(),sde=VD(),lde=GD(),ude=WD(),cde=HD(),dde=[tde.default,rde.default,nde.default,ide.default,ade.default,ode.default,sde.default,lde.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ude.default,cde.default];db.default=dde});var fb=be(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.validateAdditionalItems=void 0;var _l=rr(),pb=cr(),pde={message:({params:{len:t}})=>(0,_l.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,_l._)`{limit: ${t}}`},fde={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:pde,code(t){let{parentSchema:e,it:r}=t,{items:i}=e;if(!Array.isArray(i)){(0,pb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ZD(t,i)}};function ZD(t,e){let{gen:r,schema:i,data:n,keyword:a,it:o}=t;o.items=!0;let s=r.const("len",(0,_l._)`${n}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,_l._)`${s} <= ${e.length}`);else if(typeof i=="object"&&!(0,pb.alwaysValidSchema)(o,i)){let u=r.var("valid",(0,_l._)`${s} <= ${e.length}`);r.if((0,_l.not)(u),()=>l(u)),t.ok(u)}function l(u){r.forRange("i",e.length,s,c=>{t.subschema({keyword:a,dataProp:c,dataPropType:pb.Type.Num},u),o.allErrors||r.if((0,_l.not)(u),()=>r.break())})}}Vp.validateAdditionalItems=ZD;Vp.default=fde});var mb=be(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.validateTuple=void 0;var JD=rr(),u0=cr(),mde=Ki(),hde={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return YD(t,"additionalItems",e);r.items=!0,!(0,u0.alwaysValidSchema)(r,e)&&t.ok((0,mde.validateArray)(t))}};function YD(t,e,r=t.schema){let{gen:i,parentSchema:n,data:a,keyword:o,it:s}=t;c(n),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=u0.mergeEvaluated.items(i,r.length,s.items));let l=i.name("valid"),u=i.const("len",(0,JD._)`${a}.length`);r.forEach((d,f)=>{(0,u0.alwaysValidSchema)(s,d)||(i.if((0,JD._)`${u} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},l)),t.ok(l))});function c(d){let{opts:f,errSchemaPath:h}=s,g=r.length,v=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(f.strictTuples&&!v){let y=`"${o}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,u0.checkStrictMode)(s,y,f.strictTuples)}}}Bp.validateTuple=YD;Bp.default=hde});var QD=be(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var gde=mb(),vde={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,gde.validateTuple)(t,"items")};hb.default=vde});var eN=be(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var XD=rr(),yde=cr(),_de=Ki(),wde=fb(),bde={message:({params:{len:t}})=>(0,XD.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,XD._)`{limit: ${t}}`},Sde={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:bde,code(t){let{schema:e,parentSchema:r,it:i}=t,{prefixItems:n}=r;i.items=!0,!(0,yde.alwaysValidSchema)(i,e)&&(n?(0,wde.validateAdditionalItems)(t,n):t.ok((0,_de.validateArray)(t)))}};gb.default=Sde});var tN=be(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var Ji=rr(),c0=cr(),kde={message:({params:{min:t,max:e}})=>e===void 0?(0,Ji.str)`must contain at least ${t} valid item(s)`:(0,Ji.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Ji._)`{minContains: ${t}}`:(0,Ji._)`{minContains: ${t}, maxContains: ${e}}`},xde={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:kde,code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:a}=t,o,s,{minContains:l,maxContains:u}=i;a.opts.next?(o=l===void 0?1:l,s=u):o=1;let c=e.const("len",(0,Ji._)`${n}.length`);if(t.setParams({min:o,max:s}),s===void 0&&o===0){(0,c0.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&o>s){(0,c0.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,c0.alwaysValidSchema)(a,r)){let v=(0,Ji._)`${c} >= ${o}`;s!==void 0&&(v=(0,Ji._)`${v} && ${c} <= ${s}`),t.pass(v);return}a.items=!0;let d=e.name("valid");s===void 0&&o===1?h(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),s!==void 0&&e.if((0,Ji._)`${n}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let v=e.name("_valid"),y=e.let("count",0);h(v,()=>e.if(v,()=>g(y)))}function h(v,y){e.forRange("i",0,c,w=>{t.subschema({keyword:"contains",dataProp:w,dataPropType:c0.Type.Num,compositeRule:!0},v),y()})}function g(v){e.code((0,Ji._)`${v}++`),s===void 0?e.if((0,Ji._)`${v} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Ji._)`${v} > ${s}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Ji._)`${v} >= ${o}`,()=>e.assign(d,!0)))}}};vb.default=xde});var iN=be(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.validateSchemaDeps=La.validatePropertyDeps=La.error=void 0;var yb=rr(),$de=cr(),Gp=Ki();La.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let i=e===1?"property":"properties";return(0,yb.str)`must have ${i} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:i}})=>(0,yb._)`{property: ${t},
253
+ || ${o} === "boolean" || ${n} === null`).assign(s,(0,Zt._)`[${n}]`)}}}function Hse({gen:t,parentData:e,parentDataProperty:r},i){t.if((0,Zt._)`${e} !== undefined`,()=>t.assign((0,Zt._)`${e}[${r}]`,i))}function Sw(t,e,r,i=Qu.Correct){let n=i===Qu.Correct?Zt.operators.EQ:Zt.operators.NEQ,a;switch(t){case"null":return(0,Zt._)`${e} ${n} null`;case"array":a=(0,Zt._)`Array.isArray(${e})`;break;case"object":a=(0,Zt._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":a=o((0,Zt._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":a=o();break;default:return(0,Zt._)`typeof ${e} ${n} ${t}`}return i===Qu.Correct?a:(0,Zt.not)(a);function o(s=Zt.nil){return(0,Zt.and)((0,Zt._)`typeof ${e} == "number"`,s,r?(0,Zt._)`isFinite(${e})`:Zt.nil)}}Nn.checkDataType=Sw;function kw(t,e,r,i){if(t.length===1)return Sw(t[0],e,r,i);let n,a=(0,bR.toHash)(t);if(a.array&&a.object){let o=(0,Zt._)`typeof ${e} != "object"`;n=a.null?o:(0,Zt._)`!${e} || ${o}`,delete a.null,delete a.array,delete a.object}else n=Zt.nil;a.number&&delete a.integer;for(let o in a)n=(0,Zt.and)(n,Sw(o,e,r,i));return n}Nn.checkDataTypes=kw;var Kse={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Zt._)`{type: ${t}}`:(0,Zt._)`{type: ${e}}`};function xw(t){let e=Zse(t);(0,Use.reportError)(e,Kse)}Nn.reportTypeError=xw;function Zse(t){let{gen:e,data:r,schema:i}=t,n=(0,bR.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:r,schema:i.type,schemaCode:n,schemaValue:n,parentSchema:i,params:{},it:t}}});var $R=be(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});Hg.assignDefaults=void 0;var Xu=rr(),Jse=cr();function Yse(t,e){let{properties:r,items:i}=t.schema;if(e==="object"&&r)for(let n in r)xR(t,n,r[n].default);else e==="array"&&Array.isArray(i)&&i.forEach((n,a)=>xR(t,a,n.default))}Hg.assignDefaults=Yse;function xR(t,e,r){let{gen:i,compositeRule:n,data:a,opts:o}=t;if(r===void 0)return;let s=(0,Xu._)`${a}${(0,Xu.getProperty)(e)}`;if(n){(0,Jse.checkStrictMode)(t,`default is ignored for: ${s}`);return}let l=(0,Xu._)`${s} === undefined`;o.useDefaults==="empty"&&(l=(0,Xu._)`${l} || ${s} === null || ${s} === ""`),i.if(l,(0,Xu._)`${s} = ${(0,Xu.stringify)(r)}`)}});var Ki=be($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.validateUnion=$r.validateArray=$r.usePattern=$r.callValidateCode=$r.schemaProperties=$r.allSchemaProperties=$r.noPropertyInData=$r.propertyInData=$r.isOwnProperty=$r.hasPropFunc=$r.reportMissingProp=$r.checkMissingProp=$r.checkReportMissingProp=void 0;var Dr=rr(),$w=cr(),ps=mo(),Qse=cr();function Xse(t,e){let{gen:r,data:i,it:n}=t;r.if(Aw(r,i,e,n.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Dr._)`${e}`},!0),t.error()})}$r.checkReportMissingProp=Xse;function ele({gen:t,data:e,it:{opts:r}},i,n){return(0,Dr.or)(...i.map(a=>(0,Dr.and)(Aw(t,e,a,r.ownProperties),(0,Dr._)`${n} = ${a}`)))}$r.checkMissingProp=ele;function tle(t,e){t.setParams({missingProperty:e},!0),t.error()}$r.reportMissingProp=tle;function ER(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Dr._)`Object.prototype.hasOwnProperty`})}$r.hasPropFunc=ER;function Ew(t,e,r){return(0,Dr._)`${ER(t)}.call(${e}, ${r})`}$r.isOwnProperty=Ew;function rle(t,e,r,i){let n=(0,Dr._)`${e}${(0,Dr.getProperty)(r)} !== undefined`;return i?(0,Dr._)`${n} && ${Ew(t,e,r)}`:n}$r.propertyInData=rle;function Aw(t,e,r,i){let n=(0,Dr._)`${e}${(0,Dr.getProperty)(r)} === undefined`;return i?(0,Dr.or)(n,(0,Dr.not)(Ew(t,e,r))):n}$r.noPropertyInData=Aw;function AR(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}$r.allSchemaProperties=AR;function nle(t,e){return AR(e).filter(r=>!(0,$w.alwaysValidSchema)(t,e[r]))}$r.schemaProperties=nle;function ile({schemaCode:t,data:e,it:{gen:r,topSchemaRef:i,schemaPath:n,errorPath:a},it:o},s,l,u){let c=u?(0,Dr._)`${t}, ${e}, ${i}${n}`:e,d=[[ps.default.instancePath,(0,Dr.strConcat)(ps.default.instancePath,a)],[ps.default.parentData,o.parentData],[ps.default.parentDataProperty,o.parentDataProperty],[ps.default.rootData,ps.default.rootData]];o.opts.dynamicRef&&d.push([ps.default.dynamicAnchors,ps.default.dynamicAnchors]);let f=(0,Dr._)`${c}, ${r.object(...d)}`;return l!==Dr.nil?(0,Dr._)`${s}.call(${l}, ${f})`:(0,Dr._)`${s}(${f})`}$r.callValidateCode=ile;var ale=(0,Dr._)`new RegExp`;function ole({gen:t,it:{opts:e}},r){let i=e.unicodeRegExp?"u":"",{regExp:n}=e.code,a=n(r,i);return t.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,Dr._)`${n.code==="new RegExp"?ale:(0,Qse.useFunc)(t,n)}(${r}, ${i})`})}$r.usePattern=ole;function sle(t){let{gen:e,data:r,keyword:i,it:n}=t,a=e.name("valid");if(n.allErrors){let s=e.let("valid",!0);return o(()=>e.assign(s,!1)),s}return e.var(a,!0),o(()=>e.break()),a;function o(s){let l=e.const("len",(0,Dr._)`${r}.length`);e.forRange("i",0,l,u=>{t.subschema({keyword:i,dataProp:u,dataPropType:$w.Type.Num},a),e.if((0,Dr.not)(a),s)})}}$r.validateArray=sle;function lle(t){let{gen:e,schema:r,keyword:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(l=>(0,$w.alwaysValidSchema)(n,l))&&!n.opts.unevaluated)return;let o=e.let("valid",!1),s=e.name("_valid");e.block(()=>r.forEach((l,u)=>{let c=t.subschema({keyword:i,schemaProp:u,compositeRule:!0},s);e.assign(o,(0,Dr._)`${o} || ${s}`),t.mergeValidEvaluated(c,s)||e.if((0,Dr.not)(o))})),t.result(o,()=>t.reset(),()=>t.error(!0))}$r.validateUnion=lle});var IR=be(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.validateKeywordUsage=Da.validSchemaType=Da.funcKeywordCode=Da.macroKeywordCode=void 0;var Zn=rr(),ml=mo(),ule=Ki(),cle=Ep();function dle(t,e){let{gen:r,keyword:i,schema:n,parentSchema:a,it:o}=t,s=e.macro.call(o.self,n,a,o),l=OR(r,i,s);o.opts.validateSchema!==!1&&o.self.validateSchema(s,!0);let u=r.name("valid");t.subschema({schema:s,schemaPath:Zn.nil,errSchemaPath:`${o.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Da.macroKeywordCode=dle;function ple(t,e){var r;let{gen:i,keyword:n,schema:a,parentSchema:o,$data:s,it:l}=t;mle(l,e);let u=!s&&e.compile?e.compile.call(l.self,a,o,l):e.validate,c=OR(i,n,u),d=i.let("valid");t.block$data(d,f),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function f(){if(e.errors===!1)v(),e.modifying&&PR(t),y(()=>t.error());else{let w=e.async?h():g();e.modifying&&PR(t),y(()=>fle(t,w))}}function h(){let w=i.let("ruleErrs",null);return i.try(()=>v((0,Zn._)`await `),$=>i.assign(d,!1).if((0,Zn._)`${$} instanceof ${l.ValidationError}`,()=>i.assign(w,(0,Zn._)`${$}.errors`),()=>i.throw($))),w}function g(){let w=(0,Zn._)`${c}.errors`;return i.assign(w,null),v(Zn.nil),w}function v(w=e.async?(0,Zn._)`await `:Zn.nil){let $=l.opts.passContext?ml.default.this:ml.default.self,E=!("compile"in e&&!s||e.schema===!1);i.assign(d,(0,Zn._)`${w}${(0,ule.callValidateCode)(t,c,$,E)}`,e.modifying)}function y(w){var $;i.if((0,Zn.not)(($=e.valid)!==null&&$!==void 0?$:d),w)}}Da.funcKeywordCode=ple;function PR(t){let{gen:e,data:r,it:i}=t;e.if(i.parentData,()=>e.assign(r,(0,Zn._)`${i.parentData}[${i.parentDataProperty}]`))}function fle(t,e){let{gen:r}=t;r.if((0,Zn._)`Array.isArray(${e})`,()=>{r.assign(ml.default.vErrors,(0,Zn._)`${ml.default.vErrors} === null ? ${e} : ${ml.default.vErrors}.concat(${e})`).assign(ml.default.errors,(0,Zn._)`${ml.default.vErrors}.length`),(0,cle.extendErrors)(t)},()=>t.error())}function mle({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function OR(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Zn.stringify)(r)})}function hle(t,e,r=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||r&&typeof t>"u")}Da.validSchemaType=hle;function gle({schema:t,opts:e,self:r,errSchemaPath:i},n,a){if(Array.isArray(n.keyword)?!n.keyword.includes(a):n.keyword!==a)throw new Error("ajv implementation error");let o=n.dependencies;if(o?.some(s=>!Object.prototype.hasOwnProperty.call(t,s)))throw new Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[a])){let l=`keyword "${a}" value is invalid at path "${i}": `+r.errorsText(n.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(l);else throw new Error(l)}}Da.validateKeywordUsage=gle});var jR=be(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.extendSubschemaMode=fs.extendSubschemaData=fs.getSubschema=void 0;var Na=rr(),CR=cr();function vle(t,{keyword:e,schemaProp:r,schema:i,schemaPath:n,errSchemaPath:a,topSchemaRef:o}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let s=t.schema[e];return r===void 0?{schema:s,schemaPath:(0,Na._)`${t.schemaPath}${(0,Na.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:s[r],schemaPath:(0,Na._)`${t.schemaPath}${(0,Na.getProperty)(e)}${(0,Na.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,CR.escapeFragment)(r)}`}}if(i!==void 0){if(n===void 0||a===void 0||o===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:n,topSchemaRef:o,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}fs.getSubschema=vle;function yle(t,e,{dataProp:r,dataPropType:i,data:n,dataTypes:a,propertyName:o}){if(n!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=e;if(r!==void 0){let{errorPath:u,dataPathArr:c,opts:d}=e,f=s.let("data",(0,Na._)`${e.data}${(0,Na.getProperty)(r)}`,!0);l(f),t.errorPath=(0,Na.str)`${u}${(0,CR.getErrorPath)(r,i,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Na._)`${r}`,t.dataPathArr=[...c,t.parentDataProperty]}if(n!==void 0){let u=n instanceof Na.Name?n:s.let("data",n,!0);l(u),o!==void 0&&(t.propertyName=o)}a&&(t.dataTypes=a);function l(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}fs.extendSubschemaData=yle;function _le(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:i,createErrors:n,allErrors:a}){i!==void 0&&(t.compositeRule=i),n!==void 0&&(t.createErrors=n),a!==void 0&&(t.allErrors=a),t.jtdDiscriminator=e,t.jtdMetadata=r}fs.extendSubschemaMode=_le});var Pw=be((b7e,TR)=>{"use strict";TR.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var i,n,a;if(Array.isArray(e)){if(i=e.length,i!=r.length)return!1;for(n=i;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),i=a.length,i!==Object.keys(r).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=i;n--!==0;){var o=a[n];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r}});var DR=be((S7e,RR)=>{"use strict";var ms=RR.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var i=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};Kg(e,i,n,t,"",t)};ms.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ms.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ms.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ms.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Kg(t,e,r,i,n,a,o,s,l,u){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,n,a,o,s,l,u);for(var c in i){var d=i[c];if(Array.isArray(d)){if(c in ms.arrayKeywords)for(var f=0;f<d.length;f++)Kg(t,e,r,d[f],n+"/"+c+"/"+f,a,n,c,i,f)}else if(c in ms.propsKeywords){if(d&&typeof d=="object")for(var h in d)Kg(t,e,r,d[h],n+"/"+c+"/"+wle(h),a,n,c,i,h)}else(c in ms.keywords||t.allKeys&&!(c in ms.skipKeywords))&&Kg(t,e,r,d,n+"/"+c,a,n,c,i)}r(i,n,a,o,s,l,u)}}function wle(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Pp=be(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.getSchemaRefs=ui.resolveUrl=ui.normalizeId=ui._getFullPath=ui.getFullPath=ui.inlineRef=void 0;var ble=cr(),Sle=Pw(),kle=DR(),xle=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function $le(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ow(t):e?NR(t)<=e:!1}ui.inlineRef=$le;var Ele=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ow(t){for(let e in t){if(Ele.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Ow)||typeof r=="object"&&Ow(r))return!0}return!1}function NR(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!xle.has(r)&&(typeof t[r]=="object"&&(0,ble.eachItem)(t[r],i=>e+=NR(i)),e===1/0))return 1/0}return e}function LR(t,e="",r){r!==!1&&(e=ec(e));let i=t.parse(e);return MR(t,i)}ui.getFullPath=LR;function MR(t,e){return t.serialize(e).split("#")[0]+"#"}ui._getFullPath=MR;var Ale=/#\/?$/;function ec(t){return t?t.replace(Ale,""):""}ui.normalizeId=ec;function Ple(t,e,r){return r=ec(r),t.resolve(e,r)}ui.resolveUrl=Ple;var Ole=/^[a-z_][-a-z0-9._]*$/i;function Ile(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:i}=this.opts,n=ec(t[r]||e),a={"":n},o=LR(i,n,!1),s={},l=new Set;return kle(t,{allKeys:!0},(d,f,h,g)=>{if(g===void 0)return;let v=o+f,y=a[g];typeof d[r]=="string"&&(y=w.call(this,d[r])),$.call(this,d.$anchor),$.call(this,d.$dynamicAnchor),a[f]=y;function w(E){let I=this.opts.uriResolver.resolve;if(E=ec(y?I(y,E):E),l.has(E))throw c(E);l.add(E);let R=this.refs[E];return typeof R=="string"&&(R=this.refs[R]),typeof R=="object"?u(d,R.schema,E):E!==ec(v)&&(E[0]==="#"?(u(d,s[E],E),s[E]=d):this.refs[E]=v),E}function $(E){if(typeof E=="string"){if(!Ole.test(E))throw new Error(`invalid anchor "${E}"`);w.call(this,`#${E}`)}}}),s;function u(d,f,h){if(f!==void 0&&!Sle(d,f))throw c(h)}function c(d){return new Error(`reference "${d}" resolves to more than one schema`)}}ui.getSchemaRefs=Ile});var Cp=be(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.getData=hs.KeywordCxt=hs.validateFunctionCode=void 0;var VR=yR(),zR=Ap(),Cw=bw(),Zg=Ap(),Cle=$R(),Ip=IR(),Iw=jR(),Ot=rr(),Ft=mo(),jle=Pp(),ho=cr(),Op=Ep();function Tle(t){if(WR(t)&&(HR(t),GR(t))){Nle(t);return}BR(t,()=>(0,VR.topBoolOrEmptySchema)(t))}hs.validateFunctionCode=Tle;function BR({gen:t,validateName:e,schema:r,schemaEnv:i,opts:n},a){n.code.es5?t.func(e,(0,Ot._)`${Ft.default.data}, ${Ft.default.valCxt}`,i.$async,()=>{t.code((0,Ot._)`"use strict"; ${qR(r,n)}`),Dle(t,n),t.code(a)}):t.func(e,(0,Ot._)`${Ft.default.data}, ${Rle(n)}`,i.$async,()=>t.code(qR(r,n)).code(a))}function Rle(t){return(0,Ot._)`{${Ft.default.instancePath}="", ${Ft.default.parentData}, ${Ft.default.parentDataProperty}, ${Ft.default.rootData}=${Ft.default.data}${t.dynamicRef?(0,Ot._)`, ${Ft.default.dynamicAnchors}={}`:Ot.nil}}={}`}function Dle(t,e){t.if(Ft.default.valCxt,()=>{t.var(Ft.default.instancePath,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.instancePath}`),t.var(Ft.default.parentData,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.parentData}`),t.var(Ft.default.parentDataProperty,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.parentDataProperty}`),t.var(Ft.default.rootData,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.rootData}`),e.dynamicRef&&t.var(Ft.default.dynamicAnchors,(0,Ot._)`${Ft.default.valCxt}.${Ft.default.dynamicAnchors}`)},()=>{t.var(Ft.default.instancePath,(0,Ot._)`""`),t.var(Ft.default.parentData,(0,Ot._)`undefined`),t.var(Ft.default.parentDataProperty,(0,Ot._)`undefined`),t.var(Ft.default.rootData,Ft.default.data),e.dynamicRef&&t.var(Ft.default.dynamicAnchors,(0,Ot._)`{}`)})}function Nle(t){let{schema:e,opts:r,gen:i}=t;BR(t,()=>{r.$comment&&e.$comment&&ZR(t),Fle(t),i.let(Ft.default.vErrors,null),i.let(Ft.default.errors,0),r.unevaluated&&Lle(t),KR(t),Ble(t)})}function Lle(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,Ot._)`${r}.evaluated`),e.if((0,Ot._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,Ot._)`${t.evaluated}.props`,(0,Ot._)`undefined`)),e.if((0,Ot._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,Ot._)`${t.evaluated}.items`,(0,Ot._)`undefined`))}function qR(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,Ot._)`/*# sourceURL=${r} */`:Ot.nil}function Mle(t,e){if(WR(t)&&(HR(t),GR(t))){zle(t,e);return}(0,VR.boolOrEmptySchema)(t,e)}function GR({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function WR(t){return typeof t.schema!="boolean"}function zle(t,e){let{schema:r,gen:i,opts:n}=t;n.$comment&&r.$comment&&ZR(t),Ule(t),Vle(t);let a=i.const("_errs",Ft.default.errors);KR(t,a),i.var(e,(0,Ot._)`${a} === ${Ft.default.errors}`)}function HR(t){(0,ho.checkUnknownRules)(t),qle(t)}function KR(t,e){if(t.opts.jtd)return FR(t,[],!1,e);let r=(0,zR.getSchemaTypes)(t.schema),i=(0,zR.coerceAndCheckDataType)(t,r);FR(t,r,!i,e)}function qle(t){let{schema:e,errSchemaPath:r,opts:i,self:n}=t;e.$ref&&i.ignoreKeywordsWithRef&&(0,ho.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Fle(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,ho.checkStrictMode)(t,"default is ignored in the schema root")}function Ule(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,jle.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function Vle(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ZR({gen:t,schemaEnv:e,schema:r,errSchemaPath:i,opts:n}){let a=r.$comment;if(n.$comment===!0)t.code((0,Ot._)`${Ft.default.self}.logger.log(${a})`);else if(typeof n.$comment=="function"){let o=(0,Ot.str)`${i}/$comment`,s=t.scopeValue("root",{ref:e.root});t.code((0,Ot._)`${Ft.default.self}.opts.$comment(${a}, ${o}, ${s}.schema)`)}}function Ble(t){let{gen:e,schemaEnv:r,validateName:i,ValidationError:n,opts:a}=t;r.$async?e.if((0,Ot._)`${Ft.default.errors} === 0`,()=>e.return(Ft.default.data),()=>e.throw((0,Ot._)`new ${n}(${Ft.default.vErrors})`)):(e.assign((0,Ot._)`${i}.errors`,Ft.default.vErrors),a.unevaluated&&Gle(t),e.return((0,Ot._)`${Ft.default.errors} === 0`))}function Gle({gen:t,evaluated:e,props:r,items:i}){r instanceof Ot.Name&&t.assign((0,Ot._)`${e}.props`,r),i instanceof Ot.Name&&t.assign((0,Ot._)`${e}.items`,i)}function FR(t,e,r,i){let{gen:n,schema:a,data:o,allErrors:s,opts:l,self:u}=t,{RULES:c}=u;if(a.$ref&&(l.ignoreKeywordsWithRef||!(0,ho.schemaHasRulesButRef)(a,c))){n.block(()=>YR(t,"$ref",c.all.$ref.definition));return}l.jtd||Wle(t,e),n.block(()=>{for(let f of c.rules)d(f);d(c.post)});function d(f){(0,Cw.shouldUseGroup)(a,f)&&(f.type?(n.if((0,Zg.checkDataType)(f.type,o,l.strictNumbers)),UR(t,f),e.length===1&&e[0]===f.type&&r&&(n.else(),(0,Zg.reportTypeError)(t)),n.endIf()):UR(t,f),s||n.if((0,Ot._)`${Ft.default.errors} === ${i||0}`))}}function UR(t,e){let{gen:r,schema:i,opts:{useDefaults:n}}=t;n&&(0,Cle.assignDefaults)(t,e.type),r.block(()=>{for(let a of e.rules)(0,Cw.shouldUseRule)(i,a)&&YR(t,a.keyword,a.definition,e.type)})}function Wle(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(Hle(t,e),t.opts.allowUnionTypes||Kle(t,e),Zle(t,t.dataTypes))}function Hle(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{JR(t.dataTypes,r)||jw(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),Yle(t,e)}}function Kle(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&jw(t,"use allowUnionTypes to allow union type keyword")}function Zle(t,e){let r=t.self.RULES.all;for(let i in r){let n=r[i];if(typeof n=="object"&&(0,Cw.shouldUseRule)(t.schema,n)){let{type:a}=n.definition;a.length&&!a.some(o=>Jle(e,o))&&jw(t,`missing type "${a.join(",")}" for keyword "${i}"`)}}}function Jle(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function JR(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function Yle(t,e){let r=[];for(let i of t.dataTypes)JR(e,i)?r.push(i):e.includes("integer")&&i==="number"&&r.push("integer");t.dataTypes=r}function jw(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,ho.checkStrictMode)(t,e,t.opts.strictTypes)}var Jg=class{constructor(e,r,i){if((0,Ip.validateKeywordUsage)(e,r,i),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=i,this.data=e.data,this.schema=e.schema[i],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ho.schemaRefOrVal)(e,this.schema,i,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",QR(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ip.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",Ft.default.errors))}result(e,r,i){this.failResult((0,Ot.not)(e),r,i)}failResult(e,r,i){this.gen.if(e),i?i():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,Ot.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,Ot._)`${r} !== undefined && (${(0,Ot.or)(this.invalid$data(),e)})`)}error(e,r,i){if(r){this.setParams(r),this._error(e,i),this.setParams({});return}this._error(e,i)}_error(e,r){(e?Op.reportExtraError:Op.reportError)(this,this.def.error,r)}$dataError(){(0,Op.reportError)(this,this.def.$dataError||Op.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Op.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,i=Ot.nil){this.gen.block(()=>{this.check$data(e,i),r()})}check$data(e=Ot.nil,r=Ot.nil){if(!this.$data)return;let{gen:i,schemaCode:n,schemaType:a,def:o}=this;i.if((0,Ot.or)((0,Ot._)`${n} === undefined`,r)),e!==Ot.nil&&i.assign(e,!0),(a.length||o.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),e!==Ot.nil&&i.assign(e,!1)),i.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:i,def:n,it:a}=this;return(0,Ot.or)(o(),s());function o(){if(i.length){if(!(r instanceof Ot.Name))throw new Error("ajv implementation error");let l=Array.isArray(i)?i:[i];return(0,Ot._)`${(0,Zg.checkDataTypes)(l,r,a.opts.strictNumbers,Zg.DataType.Wrong)}`}return Ot.nil}function s(){if(n.validateSchema){let l=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,Ot._)`!${l}(${r})`}return Ot.nil}}subschema(e,r){let i=(0,Iw.getSubschema)(this.it,e);(0,Iw.extendSubschemaData)(i,this.it,e),(0,Iw.extendSubschemaMode)(i,e);let n={...this.it,...i,items:void 0,props:void 0};return Mle(n,r),n}mergeEvaluated(e,r){let{it:i,gen:n}=this;i.opts.unevaluated&&(i.props!==!0&&e.props!==void 0&&(i.props=ho.mergeEvaluated.props(n,e.props,i.props,r)),i.items!==!0&&e.items!==void 0&&(i.items=ho.mergeEvaluated.items(n,e.items,i.items,r)))}mergeValidEvaluated(e,r){let{it:i,gen:n}=this;if(i.opts.unevaluated&&(i.props!==!0||i.items!==!0))return n.if(r,()=>this.mergeEvaluated(e,Ot.Name)),!0}};hs.KeywordCxt=Jg;function YR(t,e,r,i){let n=new Jg(t,r,e);"code"in r?r.code(n,i):n.$data&&r.validate?(0,Ip.funcKeywordCode)(n,r):"macro"in r?(0,Ip.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,Ip.funcKeywordCode)(n,r)}var Qle=/^\/(?:[^~]|~0|~1)*$/,Xle=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function QR(t,{dataLevel:e,dataNames:r,dataPathArr:i}){let n,a;if(t==="")return Ft.default.rootData;if(t[0]==="/"){if(!Qle.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,a=Ft.default.rootData}else{let u=Xle.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let c=+u[1];if(n=u[2],n==="#"){if(c>=e)throw new Error(l("property/index",c));return i[e-c]}if(c>e)throw new Error(l("data",c));if(a=r[e-c],!n)return a}let o=a,s=n.split("/");for(let u of s)u&&(a=(0,Ot._)`${a}${(0,Ot.getProperty)((0,ho.unescapeJsonPointer)(u))}`,o=(0,Ot._)`${o} && ${a}`);return o;function l(u,c){return`Cannot access ${u} ${c} levels up, current level is ${e}`}}hs.getData=QR});var Yg=be(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var Tw=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Rw.default=Tw});var jp=be(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});var Dw=Pp(),Nw=class extends Error{constructor(e,r,i,n){super(n||`can't resolve reference ${i} from id ${r}`),this.missingRef=(0,Dw.resolveUrl)(e,r,i),this.missingSchema=(0,Dw.normalizeId)((0,Dw.getFullPath)(e,this.missingRef))}};Lw.default=Nw});var Xg=be(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.resolveSchema=Zi.getCompilingSchema=Zi.resolveRef=Zi.compileSchema=Zi.SchemaEnv=void 0;var fa=rr(),eue=Yg(),hl=mo(),ma=Pp(),XR=cr(),tue=Cp(),tc=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let i;typeof e.schema=="object"&&(i=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,ma.normalizeId)(i?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=i?.$async,this.refs={}}};Zi.SchemaEnv=tc;function zw(t){let e=eD.call(this,t);if(e)return e;let r=(0,ma.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:i,lines:n}=this.opts.code,{ownProperties:a}=this.opts,o=new fa.CodeGen(this.scope,{es5:i,lines:n,ownProperties:a}),s;t.$async&&(s=o.scopeValue("Error",{ref:eue.default,code:(0,fa._)`require("ajv/dist/runtime/validation_error").default`}));let l=o.scopeName("validate");t.validateName=l;let u={gen:o,allErrors:this.opts.allErrors,data:hl.default.data,parentData:hl.default.parentData,parentDataProperty:hl.default.parentDataProperty,dataNames:[hl.default.data],dataPathArr:[fa.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:o.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,fa.stringify)(t.schema)}:{ref:t.schema}),validateName:l,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:fa.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,fa._)`""`,opts:this.opts,self:this},c;try{this._compilations.add(t),(0,tue.validateFunctionCode)(u),o.optimize(this.opts.code.optimize);let d=o.toString();c=`${o.scopeRefs(hl.default.scope)}return ${d}`,this.opts.code.process&&(c=this.opts.code.process(c,t));let h=new Function(`${hl.default.self}`,`${hl.default.scope}`,c)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=t.schema,h.schemaEnv=t,t.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:d,scopeValues:o._values}),this.opts.unevaluated){let{props:g,items:v}=u;h.evaluated={props:g instanceof fa.Name?void 0:g,items:v instanceof fa.Name?void 0:v,dynamicProps:g instanceof fa.Name,dynamicItems:v instanceof fa.Name},h.source&&(h.source.evaluated=(0,fa.stringify)(h.evaluated))}return t.validate=h,t}catch(d){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),d}finally{this._compilations.delete(t)}}Zi.compileSchema=zw;function rue(t,e,r){var i;r=(0,ma.resolveUrl)(this.opts.uriResolver,e,r);let n=t.refs[r];if(n)return n;let a=aue.call(this,t,r);if(a===void 0){let o=(i=t.localRefs)===null||i===void 0?void 0:i[r],{schemaId:s}=this.opts;o&&(a=new tc({schema:o,schemaId:s,root:t,baseId:e}))}if(a!==void 0)return t.refs[r]=nue.call(this,a)}Zi.resolveRef=rue;function nue(t){return(0,ma.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:zw.call(this,t)}function eD(t){for(let e of this._compilations)if(iue(e,t))return e}Zi.getCompilingSchema=eD;function iue(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function aue(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Qg.call(this,t,e)}function Qg(t,e){let r=this.opts.uriResolver.parse(e),i=(0,ma._getFullPath)(this.opts.uriResolver,r),n=(0,ma.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&i===n)return Mw.call(this,r,t);let a=(0,ma.normalizeId)(i),o=this.refs[a]||this.schemas[a];if(typeof o=="string"){let s=Qg.call(this,t,o);return typeof s?.schema!="object"?void 0:Mw.call(this,r,s)}if(typeof o?.schema=="object"){if(o.validate||zw.call(this,o),a===(0,ma.normalizeId)(e)){let{schema:s}=o,{schemaId:l}=this.opts,u=s[l];return u&&(n=(0,ma.resolveUrl)(this.opts.uriResolver,n,u)),new tc({schema:s,schemaId:l,root:t,baseId:n})}return Mw.call(this,r,o)}}Zi.resolveSchema=Qg;var oue=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Mw(t,{baseId:e,schema:r,root:i}){var n;if(((n=t.fragment)===null||n===void 0?void 0:n[0])!=="/")return;for(let s of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let l=r[(0,XR.unescapeFragment)(s)];if(l===void 0)return;r=l;let u=typeof r=="object"&&r[this.opts.schemaId];!oue.has(s)&&u&&(e=(0,ma.resolveUrl)(this.opts.uriResolver,e,u))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,XR.schemaHasRulesButRef)(r,this.RULES)){let s=(0,ma.resolveUrl)(this.opts.uriResolver,e,r.$ref);a=Qg.call(this,i,s)}let{schemaId:o}=this.opts;if(a=a||new tc({schema:r,schemaId:o,root:i,baseId:e}),a.schema!==a.root.schema)return a}});var tD=be((P7e,sue)=>{sue.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Uw=be((O7e,sD)=>{"use strict";var lue=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),nD=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),qw=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),iD=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),uue=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Fw(t){let e="",r=0,i=0;for(i=0;i<t.length;i++)if(r=t[i].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i];break}for(i+=1;i<t.length;i++){if(r=t[i].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[i]}return e}var cue=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function rD(t){return t.length=0,!0}function due(t,e,r){if(t.length){let i=Fw(t);if(i!=="")e.push(i);else return r.error=!0,!1;t.length=0}return!0}function pue(t){let e=0,r={error:!1,address:"",zone:""},i=[],n=[],a=!1,o=!1,s=due;for(let l=0;l<t.length;l++){let u=t[l];if(!(u==="["||u==="]"))if(u===":"){if(a===!0&&(o=!0),!s(n,i,r))break;if(++e>7){r.error=!0;break}l>0&&t[l-1]===":"&&(a=!0),i.push(":");continue}else if(u==="%"){if(!s(n,i,r))break;s=rD}else{n.push(u);continue}}return n.length&&(s===rD?r.zone=n.join(""):o?i.push(n.join("")):i.push(Fw(n))),r.address=i.join(""),r}function aD(t){if(fue(t,":")<2)return{host:t,isIPV6:!1};let e=pue(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,i=e.address;return e.zone&&(r+="%"+e.zone,i+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:i}}}function fue(t,e){let r=0;for(let i=0;i<t.length;i++)t[i]===e&&r++;return r}function mue(t){let e=t,r=[],i=-1,n=0;for(;n=e.length;){if(n===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(n===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(n===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((i=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,i)),e=e.slice(i)}return r.join("")}var hue={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},gue=/[@/?#:]/g,vue=/[@/?#]/g;function oD(t,e){let r=e?vue:gue;return r.lastIndex=0,t.replace(r,i=>hue[i])}function yue(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let i=0;i<t.length;i++){if(t[i]==="%"&&i+2<t.length){let n=t.slice(i+1,i+3);if(qw(n)){let a=n.toUpperCase(),o=String.fromCharCode(parseInt(a,16));e&&iD(o)?r+=o:r+="%"+a,i+=2;continue}}r+=t[i]}return r}function _ue(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let i=t.slice(r+1,r+3);if(qw(i)){let n=i.toUpperCase(),a=String.fromCharCode(parseInt(n,16));a!=="."&&iD(a)?e+=a:e+="%"+n,r+=2;continue}}uue(t[r])?e+=t[r]:e+=escape(t[r])}return e}function wue(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let i=t.slice(r+1,r+3);if(qw(i)){e+="%"+i.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function bue(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!nD(r)){let i=aD(r);i.isIPV6===!0?r=`[${i.escapedHost}]`:r=oD(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}sD.exports={nonSimpleDomain:cue,recomposeAuthority:bue,reescapeHostDelimiters:oD,normalizePercentEncoding:yue,normalizePathEncoding:_ue,escapePreservingEscapes:wue,removeDotSegments:mue,isIPv4:nD,isUUID:lue,normalizeIPv6:aD,stringArrayToHexStripped:Fw}});var pD=be((I7e,dD)=>{"use strict";var{isUUID:Sue}=Uw(),kue=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xue=["http","https","ws","wss","urn","urn:uuid"];function $ue(t){return xue.indexOf(t)!==-1}function Vw(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function lD(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function uD(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function Eue(t){return t.secure=Vw(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function Aue(t){if((t.port===(Vw(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function Pue(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(kue);if(r){let i=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let n=`${i}:${e.nid||t.nid}`,a=Bw(n);t.path=void 0,a&&(t=a.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function Oue(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",i=t.nid.toLowerCase(),n=`${r}:${e.nid||i}`,a=Bw(n);a&&(t=a.serialize(t,e));let o=t,s=t.nss;return o.path=`${i||e.nid}:${s}`,e.skipEscape=!0,o}function Iue(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!Sue(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function Cue(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var cD={scheme:"http",domainHost:!0,parse:lD,serialize:uD},jue={scheme:"https",domainHost:cD.domainHost,parse:lD,serialize:uD},e0={scheme:"ws",domainHost:!0,parse:Eue,serialize:Aue},Tue={scheme:"wss",domainHost:e0.domainHost,parse:e0.parse,serialize:e0.serialize},Rue={scheme:"urn",parse:Pue,serialize:Oue,skipNormalize:!0},Due={scheme:"urn:uuid",parse:Iue,serialize:Cue,skipNormalize:!0},t0={http:cD,https:jue,ws:e0,wss:Tue,urn:Rue,"urn:uuid":Due};Object.setPrototypeOf(t0,null);function Bw(t){return t&&(t0[t]||t0[t.toLowerCase()])||void 0}dD.exports={wsIsSecure:Vw,SCHEMES:t0,isValidSchemeName:$ue,getSchemeHandler:Bw}});var yD=be((C7e,r0)=>{"use strict";var{normalizeIPv6:Nue,removeDotSegments:Tp,recomposeAuthority:Lue,normalizePercentEncoding:Mue,normalizePathEncoding:zue,escapePreservingEscapes:que,reescapeHostDelimiters:Fue,isIPv4:Uue,nonSimpleDomain:Vue}=Uw(),{SCHEMES:Bue,getSchemeHandler:mD}=pD();function Gue(t,e){return typeof t=="string"?t=Jue(t,e):typeof t=="object"&&(t=rc(gl(t,e),e)),t}function Wue(t,e,r){let i=r?Object.assign({scheme:"null"},r):{scheme:"null"},n=hD(rc(t,i),rc(e,i),i,!0);return i.skipEscape=!0,gl(n,i)}function hD(t,e,r,i){let n={};return i||(t=rc(gl(t,r),r),e=rc(gl(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Tp(e.path||""),n.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=Tp(e.path||""),n.query=e.query):(e.path?(e.path[0]==="/"?n.path=Tp(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?n.path="/"+e.path:t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path,n.path=Tp(n.path)),n.query=e.query):(n.path=t.path,e.query!==void 0?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function Hue(t,e,r){let i=fD(t,r),n=fD(e,r);return i!==void 0&&n!==void 0&&i.toLowerCase()===n.toLowerCase()}function gl(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},i=Object.assign({},e),n=[],a=mD(i.scheme||r.scheme);a&&a.serialize&&a.serialize(r,i),r.path!==void 0&&(i.skipEscape?r.path=Mue(r.path):(r.path=que(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),i.reference!=="suffix"&&r.scheme&&n.push(r.scheme,":");let o=Lue(r);if(o!==void 0&&(i.reference!=="suffix"&&n.push("//"),n.push(o),r.path&&r.path[0]!=="/"&&n.push("/")),r.path!==void 0){let s=r.path;!i.absolutePath&&(!a||!a.absolutePath)&&(s=Tp(s)),o===void 0&&s[0]==="/"&&s[1]==="/"&&(s="/%2F"+s.slice(2)),n.push(s)}return r.query!==void 0&&n.push("?",r.query),r.fragment!==void 0&&n.push("#",r.fragment),n.join("")}var Kue=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Zue(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function gD(t,e){let r=Object.assign({},e),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},n=!1,a=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let o=t.match(Kue);if(o){i.scheme=o[1],i.userinfo=o[3],i.host=o[4],i.port=parseInt(o[5],10),i.path=o[6]||"",i.query=o[7],i.fragment=o[8],isNaN(i.port)&&(i.port=o[5]);let s=Zue(i,o);if(s!==void 0&&(i.error=i.error||s,n=!0),i.host)if(Uue(i.host)===!1){let c=Nue(i.host);i.host=c.host.toLowerCase(),a=c.isIPV6}else a=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference="same-document":i.scheme===void 0?i.reference="relative":i.fragment===void 0?i.reference="absolute":i.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let l=mD(r.scheme||i.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&i.host&&(r.domainHost||l&&l.domainHost)&&a===!1&&Vue(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(u){i.error=i.error||"Host's domain name can not be converted to ASCII: "+u}if((!l||l&&!l.skipNormalize)&&(t.indexOf("%")!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=Fue(unescape(i.host),a))),i.path&&(i.path=zue(i.path)),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||"URI malformed"}l&&l.parse&&l.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return{parsed:i,malformedAuthorityOrPort:n}}function rc(t,e){return gD(t,e).parsed}function Jue(t,e){return vD(t,e).normalized}function vD(t,e){let{parsed:r,malformedAuthorityOrPort:i}=gD(t,e);return{normalized:i?t:gl(r,e),malformedAuthorityOrPort:i}}function fD(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:i}=vD(t,e);return i?void 0:r}if(typeof t=="object")return gl(t,e)}var Gw={SCHEMES:Bue,normalize:Gue,resolve:Wue,resolveComponent:hD,equal:Hue,serialize:gl,parse:rc};r0.exports=Gw;r0.exports.default=Gw;r0.exports.fastUri=Gw});var wD=be(Ww=>{"use strict";Object.defineProperty(Ww,"__esModule",{value:!0});var _D=yD();_D.code='require("ajv/dist/runtime/uri").default';Ww.default=_D});var PD=be(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.CodeGen=xn.Name=xn.nil=xn.stringify=xn.str=xn._=xn.KeywordCxt=void 0;var Yue=Cp();Object.defineProperty(xn,"KeywordCxt",{enumerable:!0,get:function(){return Yue.KeywordCxt}});var nc=rr();Object.defineProperty(xn,"_",{enumerable:!0,get:function(){return nc._}});Object.defineProperty(xn,"str",{enumerable:!0,get:function(){return nc.str}});Object.defineProperty(xn,"stringify",{enumerable:!0,get:function(){return nc.stringify}});Object.defineProperty(xn,"nil",{enumerable:!0,get:function(){return nc.nil}});Object.defineProperty(xn,"Name",{enumerable:!0,get:function(){return nc.Name}});Object.defineProperty(xn,"CodeGen",{enumerable:!0,get:function(){return nc.CodeGen}});var Que=Yg(),$D=jp(),Xue=ww(),Rp=Xg(),ece=rr(),Dp=Pp(),n0=Ap(),Kw=cr(),bD=tD(),tce=wD(),ED=(t,e)=>new RegExp(t,e);ED.code="new RegExp";var rce=["removeAdditional","useDefaults","coerceTypes"],nce=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),ice={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},ace={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},SD=200;function oce(t){var e,r,i,n,a,o,s,l,u,c,d,f,h,g,v,y,w,$,E,I,R,M,T,O,N;let j=t.strict,x=(e=t.code)===null||e===void 0?void 0:e.optimize,b=x===!0||x===void 0?1:x||0,U=(i=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&i!==void 0?i:ED,k=(n=t.uriResolver)!==null&&n!==void 0?n:tce.default;return{strictSchema:(o=(a=t.strictSchema)!==null&&a!==void 0?a:j)!==null&&o!==void 0?o:!0,strictNumbers:(l=(s=t.strictNumbers)!==null&&s!==void 0?s:j)!==null&&l!==void 0?l:!0,strictTypes:(c=(u=t.strictTypes)!==null&&u!==void 0?u:j)!==null&&c!==void 0?c:"log",strictTuples:(f=(d=t.strictTuples)!==null&&d!==void 0?d:j)!==null&&f!==void 0?f:"log",strictRequired:(g=(h=t.strictRequired)!==null&&h!==void 0?h:j)!==null&&g!==void 0?g:!1,code:t.code?{...t.code,optimize:b,regExp:U}:{optimize:b,regExp:U},loopRequired:(v=t.loopRequired)!==null&&v!==void 0?v:SD,loopEnum:(y=t.loopEnum)!==null&&y!==void 0?y:SD,meta:(w=t.meta)!==null&&w!==void 0?w:!0,messages:($=t.messages)!==null&&$!==void 0?$:!0,inlineRefs:(E=t.inlineRefs)!==null&&E!==void 0?E:!0,schemaId:(I=t.schemaId)!==null&&I!==void 0?I:"$id",addUsedSchema:(R=t.addUsedSchema)!==null&&R!==void 0?R:!0,validateSchema:(M=t.validateSchema)!==null&&M!==void 0?M:!0,validateFormats:(T=t.validateFormats)!==null&&T!==void 0?T:!0,unicodeRegExp:(O=t.unicodeRegExp)!==null&&O!==void 0?O:!0,int32range:(N=t.int32range)!==null&&N!==void 0?N:!0,uriResolver:k}}var Np=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...oce(e)};let{es5:r,lines:i}=this.opts.code;this.scope=new ece.ValueScope({scope:{},prefixes:nce,es5:r,lines:i}),this.logger=pce(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,Xue.getRules)(),kD.call(this,ice,e,"NOT SUPPORTED"),kD.call(this,ace,e,"DEPRECATED","warn"),this._metaOpts=cce.call(this),e.formats&&lce.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&uce.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),sce.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:i}=this.opts,n=bD;i==="id"&&(n={...bD},n.id=n.$id,delete n.$id),r&&e&&this.addMetaSchema(n,n[i],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let i;if(typeof e=="string"){if(i=this.getSchema(e),!i)throw new Error(`no schema with key or ref "${e}"`)}else i=this.compile(e);let n=i(r);return"$async"in i||(this.errors=i.errors),n}compile(e,r){let i=this._addSchema(e,r);return i.validate||this._compileSchemaEnv(i)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:i}=this.opts;return n.call(this,e,r);async function n(c,d){await a.call(this,c.$schema);let f=this._addSchema(c,d);return f.validate||o.call(this,f)}async function a(c){c&&!this.getSchema(c)&&await n.call(this,{$ref:c},!0)}async function o(c){try{return this._compileSchemaEnv(c)}catch(d){if(!(d instanceof $D.default))throw d;return s.call(this,d),await l.call(this,d.missingSchema),o.call(this,c)}}function s({missingSchema:c,missingRef:d}){if(this.refs[c])throw new Error(`AnySchema ${c} is loaded but ${d} cannot be resolved`)}async function l(c){let d=await u.call(this,c);this.refs[c]||await a.call(this,d.$schema),this.refs[c]||this.addSchema(d,c,r)}async function u(c){let d=this._loading[c];if(d)return d;try{return await(this._loading[c]=i(c))}finally{delete this._loading[c]}}}addSchema(e,r,i,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,i,n);return this}let a;if(typeof e=="object"){let{schemaId:o}=this.opts;if(a=e[o],a!==void 0&&typeof a!="string")throw new Error(`schema ${o} must be string`)}return r=(0,Dp.normalizeId)(r||a),this._checkUnique(r),this.schemas[r]=this._addSchema(e,i,r,n,!0),this}addMetaSchema(e,r,i=this.opts.validateSchema){return this.addSchema(e,r,!0,i),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let i;if(i=e.$schema,i!==void 0&&typeof i!="string")throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(i,e);if(!n&&r){let a="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(a);else throw new Error(a)}return n}getSchema(e){let r;for(;typeof(r=xD.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:i}=this.opts,n=new Rp.SchemaEnv({schema:{},schemaId:i});if(r=Rp.resolveSchema.call(this,n,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=xD.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let i=e[this.opts.schemaId];return i&&(i=(0,Dp.normalizeId)(i),delete this.schemas[i],delete this.refs[i]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let i;if(typeof e=="string")i=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=i);else if(typeof e=="object"&&r===void 0){if(r=e,i=r.keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(mce.call(this,i,r),!r)return(0,Kw.eachItem)(i,a=>Hw.call(this,a)),this;gce.call(this,r);let n={...r,type:(0,n0.getJSONTypes)(r.type),schemaType:(0,n0.getJSONTypes)(r.schemaType)};return(0,Kw.eachItem)(i,n.type.length===0?a=>Hw.call(this,a,n):a=>n.type.forEach(o=>Hw.call(this,a,n,o))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let i of r.rules){let n=i.rules.findIndex(a=>a.keyword===e);n>=0&&i.rules.splice(n,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:i="data"}={}){return!e||e.length===0?"No errors":e.map(n=>`${i}${n.instancePath} ${n.message}`).reduce((n,a)=>n+r+a)}$dataMetaSchema(e,r){let i=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of r){let a=n.split("/").slice(1),o=e;for(let s of a)o=o[s];for(let s in i){let l=i[s];if(typeof l!="object")continue;let{$data:u}=l.definition,c=o[s];u&&c&&(o[s]=AD(c))}}return e}_removeAllSchemas(e,r){for(let i in e){let n=e[i];(!r||r.test(i))&&(typeof n=="string"?delete e[i]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[i]))}}_addSchema(e,r,i,n=this.opts.validateSchema,a=this.opts.addUsedSchema){let o,{schemaId:s}=this.opts;if(typeof e=="object")o=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(l!==void 0)return l;i=(0,Dp.normalizeId)(o||i);let u=Dp.getSchemaRefs.call(this,e,i);return l=new Rp.SchemaEnv({schema:e,schemaId:s,meta:r,baseId:i,localRefs:u}),this._cache.set(l.schema,l),a&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=l),n&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):Rp.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{Rp.compileSchema.call(this,e)}finally{this.opts=r}}};Np.ValidationError=Que.default;Np.MissingRefError=$D.default;xn.default=Np;function kD(t,e,r,i="error"){for(let n in t){let a=n;a in e&&this.logger[i](`${r}: option ${n}. ${t[a]}`)}}function xD(t){return t=(0,Dp.normalizeId)(t),this.schemas[t]||this.refs[t]}function sce(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function lce(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function uce(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function cce(){let t={...this.opts};for(let e of rce)delete t[e];return t}var dce={log(){},warn(){},error(){}};function pce(t){if(t===!1)return dce;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var fce=/^[a-z_$][a-z0-9_$:-]*$/i;function mce(t,e){let{RULES:r}=this;if((0,Kw.eachItem)(t,i=>{if(r.keywords[i])throw new Error(`Keyword ${i} is already defined`);if(!fce.test(i))throw new Error(`Keyword ${i} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function Hw(t,e,r){var i;let n=e?.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:a}=this,o=n?a.post:a.rules.find(({type:l})=>l===r);if(o||(o={type:r,rules:[]},a.rules.push(o)),a.keywords[t]=!0,!e)return;let s={keyword:t,definition:{...e,type:(0,n0.getJSONTypes)(e.type),schemaType:(0,n0.getJSONTypes)(e.schemaType)}};e.before?hce.call(this,o,s,e.before):o.rules.push(s),a.all[t]=s,(i=e.implements)===null||i===void 0||i.forEach(l=>this.addKeyword(l))}function hce(t,e,r){let i=t.rules.findIndex(n=>n.keyword===r);i>=0?t.rules.splice(i,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function gce(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=AD(e)),t.validateSchema=this.compile(e,!0))}var vce={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function AD(t){return{anyOf:[t,vce]}}});var OD=be(Zw=>{"use strict";Object.defineProperty(Zw,"__esModule",{value:!0});var yce={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Zw.default=yce});var TD=be(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.callRef=vl.getValidate=void 0;var _ce=jp(),ID=Ki(),ci=rr(),ic=mo(),CD=Xg(),i0=cr(),wce={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:i}=t,{baseId:n,schemaEnv:a,validateName:o,opts:s,self:l}=i,{root:u}=a;if((r==="#"||r==="#/")&&n===u.baseId)return d();let c=CD.resolveRef.call(l,u,n,r);if(c===void 0)throw new _ce.default(i.opts.uriResolver,n,r);if(c instanceof CD.SchemaEnv)return f(c);return h(c);function d(){if(a===u)return a0(t,o,a,a.$async);let g=e.scopeValue("root",{ref:u});return a0(t,(0,ci._)`${g}.validate`,u,u.$async)}function f(g){let v=jD(t,g);a0(t,v,g,g.$async)}function h(g){let v=e.scopeValue("schema",s.code.source===!0?{ref:g,code:(0,ci.stringify)(g)}:{ref:g}),y=e.name("valid"),w=t.subschema({schema:g,dataTypes:[],schemaPath:ci.nil,topSchemaRef:v,errSchemaPath:r},y);t.mergeEvaluated(w),t.ok(y)}}};function jD(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,ci._)`${r.scopeValue("wrapper",{ref:e})}.validate`}vl.getValidate=jD;function a0(t,e,r,i){let{gen:n,it:a}=t,{allErrors:o,schemaEnv:s,opts:l}=a,u=l.passContext?ic.default.this:ci.nil;i?c():d();function c(){if(!s.$async)throw new Error("async schema referenced by sync schema");let g=n.let("valid");n.try(()=>{n.code((0,ci._)`await ${(0,ID.callValidateCode)(t,e,u)}`),h(e),o||n.assign(g,!0)},v=>{n.if((0,ci._)`!(${v} instanceof ${a.ValidationError})`,()=>n.throw(v)),f(v),o||n.assign(g,!1)}),t.ok(g)}function d(){t.result((0,ID.callValidateCode)(t,e,u),()=>h(e),()=>f(e))}function f(g){let v=(0,ci._)`${g}.errors`;n.assign(ic.default.vErrors,(0,ci._)`${ic.default.vErrors} === null ? ${v} : ${ic.default.vErrors}.concat(${v})`),n.assign(ic.default.errors,(0,ci._)`${ic.default.vErrors}.length`)}function h(g){var v;if(!a.opts.unevaluated)return;let y=(v=r?.validate)===null||v===void 0?void 0:v.evaluated;if(a.props!==!0)if(y&&!y.dynamicProps)y.props!==void 0&&(a.props=i0.mergeEvaluated.props(n,y.props,a.props));else{let w=n.var("props",(0,ci._)`${g}.evaluated.props`);a.props=i0.mergeEvaluated.props(n,w,a.props,ci.Name)}if(a.items!==!0)if(y&&!y.dynamicItems)y.items!==void 0&&(a.items=i0.mergeEvaluated.items(n,y.items,a.items));else{let w=n.var("items",(0,ci._)`${g}.evaluated.items`);a.items=i0.mergeEvaluated.items(n,w,a.items,ci.Name)}}}vl.callRef=a0;vl.default=wce});var RD=be(Jw=>{"use strict";Object.defineProperty(Jw,"__esModule",{value:!0});var bce=OD(),Sce=TD(),kce=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",bce.default,Sce.default];Jw.default=kce});var DD=be(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});var o0=rr(),gs=o0.operators,s0={maximum:{okStr:"<=",ok:gs.LTE,fail:gs.GT},minimum:{okStr:">=",ok:gs.GTE,fail:gs.LT},exclusiveMaximum:{okStr:"<",ok:gs.LT,fail:gs.GTE},exclusiveMinimum:{okStr:">",ok:gs.GT,fail:gs.LTE}},xce={message:({keyword:t,schemaCode:e})=>(0,o0.str)`must be ${s0[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,o0._)`{comparison: ${s0[t].okStr}, limit: ${e}}`},$ce={keyword:Object.keys(s0),type:"number",schemaType:"number",$data:!0,error:xce,code(t){let{keyword:e,data:r,schemaCode:i}=t;t.fail$data((0,o0._)`${r} ${s0[e].fail} ${i} || isNaN(${r})`)}};Yw.default=$ce});var ND=be(Qw=>{"use strict";Object.defineProperty(Qw,"__esModule",{value:!0});var Lp=rr(),Ece={message:({schemaCode:t})=>(0,Lp.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Lp._)`{multipleOf: ${t}}`},Ace={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Ece,code(t){let{gen:e,data:r,schemaCode:i,it:n}=t,a=n.opts.multipleOfPrecision,o=e.let("res"),s=a?(0,Lp._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${a}`:(0,Lp._)`${o} !== parseInt(${o})`;t.fail$data((0,Lp._)`(${i} === 0 || (${o} = ${r}/${i}, ${s}))`)}};Qw.default=Ace});var MD=be(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});function LD(t){let e=t.length,r=0,i=0,n;for(;i<e;)r++,n=t.charCodeAt(i++),n>=55296&&n<=56319&&i<e&&(n=t.charCodeAt(i),(n&64512)===56320&&i++);return r}Xw.default=LD;LD.code='require("ajv/dist/runtime/ucs2length").default'});var zD=be(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var yl=rr(),Pce=cr(),Oce=MD(),Ice={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,yl.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,yl._)`{limit: ${t}}`},Cce={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ice,code(t){let{keyword:e,data:r,schemaCode:i,it:n}=t,a=e==="maxLength"?yl.operators.GT:yl.operators.LT,o=n.opts.unicode===!1?(0,yl._)`${r}.length`:(0,yl._)`${(0,Pce.useFunc)(t.gen,Oce.default)}(${r})`;t.fail$data((0,yl._)`${o} ${a} ${i}`)}};eb.default=Cce});var qD=be(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var jce=Ki(),Tce=cr(),ac=rr(),Rce={message:({schemaCode:t})=>(0,ac.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,ac._)`{pattern: ${t}}`},Dce={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Rce,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:a,it:o}=t,s=o.opts.unicodeRegExp?"u":"";if(i){let{regExp:l}=o.opts.code,u=l.code==="new RegExp"?(0,ac._)`new RegExp`:(0,Tce.useFunc)(e,l),c=e.let("valid");e.try(()=>e.assign(c,(0,ac._)`${u}(${a}, ${s}).test(${r})`),()=>e.assign(c,!1)),t.fail$data((0,ac._)`!${c}`)}else{let l=(0,jce.usePattern)(t,n);t.fail$data((0,ac._)`!${l}.test(${r})`)}}};tb.default=Dce});var FD=be(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0});var Mp=rr(),Nce={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Mp.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Mp._)`{limit: ${t}}`},Lce={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Nce,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxProperties"?Mp.operators.GT:Mp.operators.LT;t.fail$data((0,Mp._)`Object.keys(${r}).length ${n} ${i}`)}};rb.default=Lce});var UD=be(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var zp=Ki(),qp=rr(),Mce=cr(),zce={message:({params:{missingProperty:t}})=>(0,qp.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,qp._)`{missingProperty: ${t}}`},qce={keyword:"required",type:"object",schemaType:"array",$data:!0,error:zce,code(t){let{gen:e,schema:r,schemaCode:i,data:n,$data:a,it:o}=t,{opts:s}=o;if(!a&&r.length===0)return;let l=r.length>=s.loopRequired;if(o.allErrors?u():c(),s.strictRequired){let h=t.parentSchema.properties,{definedProperties:g}=t.it;for(let v of r)if(h?.[v]===void 0&&!g.has(v)){let y=o.schemaEnv.baseId+o.errSchemaPath,w=`required property "${v}" is not defined at "${y}" (strictRequired)`;(0,Mce.checkStrictMode)(o,w,o.opts.strictRequired)}}function u(){if(l||a)t.block$data(qp.nil,d);else for(let h of r)(0,zp.checkReportMissingProp)(t,h)}function c(){let h=e.let("missing");if(l||a){let g=e.let("valid",!0);t.block$data(g,()=>f(h,g)),t.ok(g)}else e.if((0,zp.checkMissingProp)(t,r,h)),(0,zp.reportMissingProp)(t,h),e.else()}function d(){e.forOf("prop",i,h=>{t.setParams({missingProperty:h}),e.if((0,zp.noPropertyInData)(e,n,h,s.ownProperties),()=>t.error())})}function f(h,g){t.setParams({missingProperty:h}),e.forOf(h,i,()=>{e.assign(g,(0,zp.propertyInData)(e,n,h,s.ownProperties)),e.if((0,qp.not)(g),()=>{t.error(),e.break()})},qp.nil)}}};nb.default=qce});var VD=be(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var Fp=rr(),Fce={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Fp.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Fp._)`{limit: ${t}}`},Uce={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Fce,code(t){let{keyword:e,data:r,schemaCode:i}=t,n=e==="maxItems"?Fp.operators.GT:Fp.operators.LT;t.fail$data((0,Fp._)`${r}.length ${n} ${i}`)}};ib.default=Uce});var l0=be(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var BD=Pw();BD.code='require("ajv/dist/runtime/equal").default';ab.default=BD});var GD=be(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var ob=Ap(),$n=rr(),Vce=cr(),Bce=l0(),Gce={message:({params:{i:t,j:e}})=>(0,$n.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,$n._)`{i: ${t}, j: ${e}}`},Wce={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Gce,code(t){let{gen:e,data:r,$data:i,schema:n,parentSchema:a,schemaCode:o,it:s}=t;if(!i&&!n)return;let l=e.let("valid"),u=a.items?(0,ob.getSchemaTypes)(a.items):[];t.block$data(l,c,(0,$n._)`${o} === false`),t.ok(l);function c(){let g=e.let("i",(0,$n._)`${r}.length`),v=e.let("j");t.setParams({i:g,j:v}),e.assign(l,!0),e.if((0,$n._)`${g} > 1`,()=>(d()?f:h)(g,v))}function d(){return u.length>0&&!u.some(g=>g==="object"||g==="array")}function f(g,v){let y=e.name("item"),w=(0,ob.checkDataTypes)(u,y,s.opts.strictNumbers,ob.DataType.Wrong),$=e.const("indices",(0,$n._)`{}`);e.for((0,$n._)`;${g}--;`,()=>{e.let(y,(0,$n._)`${r}[${g}]`),e.if(w,(0,$n._)`continue`),u.length>1&&e.if((0,$n._)`typeof ${y} == "string"`,(0,$n._)`${y} += "_"`),e.if((0,$n._)`typeof ${$}[${y}] == "number"`,()=>{e.assign(v,(0,$n._)`${$}[${y}]`),t.error(),e.assign(l,!1).break()}).code((0,$n._)`${$}[${y}] = ${g}`)})}function h(g,v){let y=(0,Vce.useFunc)(e,Bce.default),w=e.name("outer");e.label(w).for((0,$n._)`;${g}--;`,()=>e.for((0,$n._)`${v} = ${g}; ${v}--;`,()=>e.if((0,$n._)`${y}(${r}[${g}], ${r}[${v}])`,()=>{t.error(),e.assign(l,!1).break(w)})))}}};sb.default=Wce});var WD=be(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var lb=rr(),Hce=cr(),Kce=l0(),Zce={message:"must be equal to constant",params:({schemaCode:t})=>(0,lb._)`{allowedValue: ${t}}`},Jce={keyword:"const",$data:!0,error:Zce,code(t){let{gen:e,data:r,$data:i,schemaCode:n,schema:a}=t;i||a&&typeof a=="object"?t.fail$data((0,lb._)`!${(0,Hce.useFunc)(e,Kce.default)}(${r}, ${n})`):t.fail((0,lb._)`${a} !== ${r}`)}};ub.default=Jce});var HD=be(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var Up=rr(),Yce=cr(),Qce=l0(),Xce={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Up._)`{allowedValues: ${t}}`},ede={keyword:"enum",schemaType:"array",$data:!0,error:Xce,code(t){let{gen:e,data:r,$data:i,schema:n,schemaCode:a,it:o}=t;if(!i&&n.length===0)throw new Error("enum must have non-empty array");let s=n.length>=o.opts.loopEnum,l,u=()=>l??(l=(0,Yce.useFunc)(e,Qce.default)),c;if(s||i)c=e.let("valid"),t.block$data(c,d);else{if(!Array.isArray(n))throw new Error("ajv implementation error");let h=e.const("vSchema",a);c=(0,Up.or)(...n.map((g,v)=>f(h,v)))}t.pass(c);function d(){e.assign(c,!1),e.forOf("v",a,h=>e.if((0,Up._)`${u()}(${r}, ${h})`,()=>e.assign(c,!0).break()))}function f(h,g){let v=n[g];return typeof v=="object"&&v!==null?(0,Up._)`${u()}(${r}, ${h}[${g}])`:(0,Up._)`${r} === ${v}`}}};cb.default=ede});var KD=be(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var tde=DD(),rde=ND(),nde=zD(),ide=qD(),ade=FD(),ode=UD(),sde=VD(),lde=GD(),ude=WD(),cde=HD(),dde=[tde.default,rde.default,nde.default,ide.default,ade.default,ode.default,sde.default,lde.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},ude.default,cde.default];db.default=dde});var fb=be(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.validateAdditionalItems=void 0;var _l=rr(),pb=cr(),pde={message:({params:{len:t}})=>(0,_l.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,_l._)`{limit: ${t}}`},fde={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:pde,code(t){let{parentSchema:e,it:r}=t,{items:i}=e;if(!Array.isArray(i)){(0,pb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ZD(t,i)}};function ZD(t,e){let{gen:r,schema:i,data:n,keyword:a,it:o}=t;o.items=!0;let s=r.const("len",(0,_l._)`${n}.length`);if(i===!1)t.setParams({len:e.length}),t.pass((0,_l._)`${s} <= ${e.length}`);else if(typeof i=="object"&&!(0,pb.alwaysValidSchema)(o,i)){let u=r.var("valid",(0,_l._)`${s} <= ${e.length}`);r.if((0,_l.not)(u),()=>l(u)),t.ok(u)}function l(u){r.forRange("i",e.length,s,c=>{t.subschema({keyword:a,dataProp:c,dataPropType:pb.Type.Num},u),o.allErrors||r.if((0,_l.not)(u),()=>r.break())})}}Vp.validateAdditionalItems=ZD;Vp.default=fde});var mb=be(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.validateTuple=void 0;var JD=rr(),u0=cr(),mde=Ki(),hde={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return YD(t,"additionalItems",e);r.items=!0,!(0,u0.alwaysValidSchema)(r,e)&&t.ok((0,mde.validateArray)(t))}};function YD(t,e,r=t.schema){let{gen:i,parentSchema:n,data:a,keyword:o,it:s}=t;c(n),s.opts.unevaluated&&r.length&&s.items!==!0&&(s.items=u0.mergeEvaluated.items(i,r.length,s.items));let l=i.name("valid"),u=i.const("len",(0,JD._)`${a}.length`);r.forEach((d,f)=>{(0,u0.alwaysValidSchema)(s,d)||(i.if((0,JD._)`${u} > ${f}`,()=>t.subschema({keyword:o,schemaProp:f,dataProp:f},l)),t.ok(l))});function c(d){let{opts:f,errSchemaPath:h}=s,g=r.length,v=g===d.minItems&&(g===d.maxItems||d[e]===!1);if(f.strictTuples&&!v){let y=`"${o}" is ${g}-tuple, but minItems or maxItems/${e} are not specified or different at path "${h}"`;(0,u0.checkStrictMode)(s,y,f.strictTuples)}}}Bp.validateTuple=YD;Bp.default=hde});var QD=be(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var gde=mb(),vde={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,gde.validateTuple)(t,"items")};hb.default=vde});var eN=be(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var XD=rr(),yde=cr(),_de=Ki(),wde=fb(),bde={message:({params:{len:t}})=>(0,XD.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,XD._)`{limit: ${t}}`},Sde={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:bde,code(t){let{schema:e,parentSchema:r,it:i}=t,{prefixItems:n}=r;i.items=!0,!(0,yde.alwaysValidSchema)(i,e)&&(n?(0,wde.validateAdditionalItems)(t,n):t.ok((0,_de.validateArray)(t)))}};gb.default=Sde});var tN=be(vb=>{"use strict";Object.defineProperty(vb,"__esModule",{value:!0});var Ji=rr(),c0=cr(),kde={message:({params:{min:t,max:e}})=>e===void 0?(0,Ji.str)`must contain at least ${t} valid item(s)`:(0,Ji.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,Ji._)`{minContains: ${t}}`:(0,Ji._)`{minContains: ${t}, maxContains: ${e}}`},xde={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:kde,code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:a}=t,o,s,{minContains:l,maxContains:u}=i;a.opts.next?(o=l===void 0?1:l,s=u):o=1;let c=e.const("len",(0,Ji._)`${n}.length`);if(t.setParams({min:o,max:s}),s===void 0&&o===0){(0,c0.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&o>s){(0,c0.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,c0.alwaysValidSchema)(a,r)){let v=(0,Ji._)`${c} >= ${o}`;s!==void 0&&(v=(0,Ji._)`${v} && ${c} <= ${s}`),t.pass(v);return}a.items=!0;let d=e.name("valid");s===void 0&&o===1?h(d,()=>e.if(d,()=>e.break())):o===0?(e.let(d,!0),s!==void 0&&e.if((0,Ji._)`${n}.length > 0`,f)):(e.let(d,!1),f()),t.result(d,()=>t.reset());function f(){let v=e.name("_valid"),y=e.let("count",0);h(v,()=>e.if(v,()=>g(y)))}function h(v,y){e.forRange("i",0,c,w=>{t.subschema({keyword:"contains",dataProp:w,dataPropType:c0.Type.Num,compositeRule:!0},v),y()})}function g(v){e.code((0,Ji._)`${v}++`),s===void 0?e.if((0,Ji._)`${v} >= ${o}`,()=>e.assign(d,!0).break()):(e.if((0,Ji._)`${v} > ${s}`,()=>e.assign(d,!1).break()),o===1?e.assign(d,!0):e.if((0,Ji._)`${v} >= ${o}`,()=>e.assign(d,!0)))}}};vb.default=xde});var iN=be(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.validateSchemaDeps=La.validatePropertyDeps=La.error=void 0;var yb=rr(),$de=cr(),Gp=Ki();La.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let i=e===1?"property":"properties";return(0,yb.str)`must have ${i} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:i}})=>(0,yb._)`{property: ${t},
254
254
  missingProperty: ${i},
255
255
  depsCount: ${e},
256
- deps: ${r}}`};var Ede={keyword:"dependencies",type:"object",schemaType:"object",error:La.error,code(t){let[e,r]=Ade(t);rN(t,e),nN(t,r)}};function Ade({schema:t}){let e={},r={};for(let i in t){if(i==="__proto__")continue;let n=Array.isArray(t[i])?e:r;n[i]=t[i]}return[e,r]}function rN(t,e=t.schema){let{gen:r,data:i,it:n}=t;if(Object.keys(e).length===0)return;let a=r.let("missing");for(let o in e){let s=e[o];if(s.length===0)continue;let l=(0,Gp.propertyInData)(r,i,o,n.opts.ownProperties);t.setParams({property:o,depsCount:s.length,deps:s.join(", ")}),n.allErrors?r.if(l,()=>{for(let u of s)(0,Gp.checkReportMissingProp)(t,u)}):(r.if((0,yb._)`${l} && (${(0,Gp.checkMissingProp)(t,s,a)})`),(0,Gp.reportMissingProp)(t,a),r.else())}}La.validatePropertyDeps=rN;function nN(t,e=t.schema){let{gen:r,data:i,keyword:n,it:a}=t,o=r.name("valid");for(let s in e)(0,$de.alwaysValidSchema)(a,e[s])||(r.if((0,Gp.propertyInData)(r,i,s,a.opts.ownProperties),()=>{let l=t.subschema({keyword:n,schemaProp:s},o);t.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),t.ok(o))}La.validateSchemaDeps=nN;La.default=Ede});var oN=be(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var aN=rr(),Pde=cr(),Ode={message:"property name must be valid",params:({params:t})=>(0,aN._)`{propertyName: ${t.propertyName}}`},Ide={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Ode,code(t){let{gen:e,schema:r,data:i,it:n}=t;if((0,Pde.alwaysValidSchema)(n,r))return;let a=e.name("valid");e.forIn("key",i,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},a),e.if((0,aN.not)(a),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(a)}};_b.default=Ide});var bb=be(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var d0=Ki(),ha=rr(),Cde=mo(),p0=cr(),jde={message:"must NOT have additional properties",params:({params:t})=>(0,ha._)`{additionalProperty: ${t.additionalProperty}}`},Tde={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jde,code(t){let{gen:e,schema:r,parentSchema:i,data:n,errsCount:a,it:o}=t;if(!a)throw new Error("ajv implementation error");let{allErrors:s,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,p0.alwaysValidSchema)(o,r))return;let u=(0,d0.allSchemaProperties)(i.properties),c=(0,d0.allSchemaProperties)(i.patternProperties);d(),t.ok((0,ha._)`${a} === ${Cde.default.errors}`);function d(){e.forIn("key",n,y=>{!u.length&&!c.length?g(y):e.if(f(y),()=>g(y))})}function f(y){let w;if(u.length>8){let $=(0,p0.schemaRefOrVal)(o,i.properties,"properties");w=(0,d0.isOwnProperty)(e,$,y)}else u.length?w=(0,ha.or)(...u.map($=>(0,ha._)`${y} === ${$}`)):w=ha.nil;return c.length&&(w=(0,ha.or)(w,...c.map($=>(0,ha._)`${(0,d0.usePattern)(t,$)}.test(${y})`))),(0,ha.not)(w)}function h(y){e.code((0,ha._)`delete ${n}[${y}]`)}function g(y){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),s||e.break();return}if(typeof r=="object"&&!(0,p0.alwaysValidSchema)(o,r)){let w=e.name("valid");l.removeAdditional==="failing"?(v(y,w,!1),e.if((0,ha.not)(w),()=>{t.reset(),h(y)})):(v(y,w),s||e.if((0,ha.not)(w),()=>e.break()))}}function v(y,w,$){let E={keyword:"additionalProperties",dataProp:y,dataPropType:p0.Type.Str};$===!1&&Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(E,w)}}};wb.default=Tde});var uN=be(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var Rde=Cp(),sN=Ki(),Sb=cr(),lN=bb(),Dde={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:a}=t;a.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&lN.default.code(new Rde.KeywordCxt(a,lN.default,"additionalProperties"));let o=(0,sN.allSchemaProperties)(r);for(let d of o)a.definedProperties.add(d);a.opts.unevaluated&&o.length&&a.props!==!0&&(a.props=Sb.mergeEvaluated.props(e,(0,Sb.toHash)(o),a.props));let s=o.filter(d=>!(0,Sb.alwaysValidSchema)(a,r[d]));if(s.length===0)return;let l=e.name("valid");for(let d of s)u(d)?c(d):(e.if((0,sN.propertyInData)(e,n,d,a.opts.ownProperties)),c(d),a.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(l);function u(d){return a.opts.useDefaults&&!a.compositeRule&&r[d].default!==void 0}function c(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},l)}}};kb.default=Dde});var fN=be(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var cN=Ki(),f0=rr(),dN=cr(),pN=cr(),Nde={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:i,parentSchema:n,it:a}=t,{opts:o}=a,s=(0,cN.allSchemaProperties)(r),l=s.filter(v=>(0,dN.alwaysValidSchema)(a,r[v]));if(s.length===0||l.length===s.length&&(!a.opts.unevaluated||a.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&n.properties,c=e.name("valid");a.props!==!0&&!(a.props instanceof f0.Name)&&(a.props=(0,pN.evaluatedPropsToName)(e,a.props));let{props:d}=a;f();function f(){for(let v of s)u&&h(v),a.allErrors?g(v):(e.var(c,!0),g(v),e.if(c))}function h(v){for(let y in u)new RegExp(v).test(y)&&(0,dN.checkStrictMode)(a,`property ${y} matches pattern ${v} (use allowMatchingProperties)`)}function g(v){e.forIn("key",i,y=>{e.if((0,f0._)`${(0,cN.usePattern)(t,v)}.test(${y})`,()=>{let w=l.includes(v);w||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:y,dataPropType:pN.Type.Str},c),a.opts.unevaluated&&d!==!0?e.assign((0,f0._)`${d}[${y}]`,!0):!w&&!a.allErrors&&e.if((0,f0.not)(c),()=>e.break())})})}}};xb.default=Nde});var mN=be($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Lde=cr(),Mde={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:i}=t;if((0,Lde.alwaysValidSchema)(i,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};$b.default=Mde});var hN=be(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var zde=Ki(),qde={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:zde.validateUnion,error:{message:"must match a schema in anyOf"}};Eb.default=qde});var gN=be(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var m0=rr(),Fde=cr(),Ude={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,m0._)`{passingSchemas: ${t.passing}}`},Vde={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ude,code(t){let{gen:e,schema:r,parentSchema:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let a=r,o=e.let("valid",!1),s=e.let("passing",null),l=e.name("_valid");t.setParams({passing:s}),e.block(u),t.result(o,()=>t.reset(),()=>t.error(!0));function u(){a.forEach((c,d)=>{let f;(0,Fde.alwaysValidSchema)(n,c)?e.var(l,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},l),d>0&&e.if((0,m0._)`${l} && ${o}`).assign(o,!1).assign(s,(0,m0._)`[${s}, ${d}]`).else(),e.if(l,()=>{e.assign(o,!0),e.assign(s,d),f&&t.mergeEvaluated(f,m0.Name)})})}}};Ab.default=Vde});var vN=be(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var Bde=cr(),Gde={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((a,o)=>{if((0,Bde.alwaysValidSchema)(i,a))return;let s=t.subschema({keyword:"allOf",schemaProp:o},n);t.ok(n),t.mergeEvaluated(s)})}};Pb.default=Gde});var wN=be(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var h0=rr(),_N=cr(),Wde={message:({params:t})=>(0,h0.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,h0._)`{failingKeyword: ${t.ifClause}}`},Hde={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Wde,code(t){let{gen:e,parentSchema:r,it:i}=t;r.then===void 0&&r.else===void 0&&(0,_N.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=yN(i,"then"),a=yN(i,"else");if(!n&&!a)return;let o=e.let("valid",!0),s=e.name("_valid");if(l(),t.reset(),n&&a){let c=e.let("ifClause");t.setParams({ifClause:c}),e.if(s,u("then",c),u("else",c))}else n?e.if(s,u("then")):e.if((0,h0.not)(s),u("else"));t.pass(o,()=>t.error(!0));function l(){let c=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);t.mergeEvaluated(c)}function u(c,d){return()=>{let f=t.subschema({keyword:c},s);e.assign(o,s),t.mergeValidEvaluated(f,o),d?e.assign(d,(0,h0._)`${c}`):t.setParams({ifClause:c})}}}};function yN(t,e){let r=t.schema[e];return r!==void 0&&!(0,_N.alwaysValidSchema)(t,r)}Ob.default=Hde});var bN=be(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var Kde=cr(),Zde={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Kde.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Ib.default=Zde});var SN=be(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var Jde=fb(),Yde=QD(),Qde=mb(),Xde=eN(),epe=tN(),tpe=iN(),rpe=oN(),npe=bb(),ipe=uN(),ape=fN(),ope=mN(),spe=hN(),lpe=gN(),upe=vN(),cpe=wN(),dpe=bN();function ppe(t=!1){let e=[ope.default,spe.default,lpe.default,upe.default,cpe.default,dpe.default,rpe.default,npe.default,tpe.default,ipe.default,ape.default];return t?e.push(Yde.default,Xde.default):e.push(Jde.default,Qde.default),e.push(epe.default),e}Cb.default=ppe});var kN=be(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var Qr=rr(),fpe={message:({schemaCode:t})=>(0,Qr.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Qr._)`{format: ${t}}`},mpe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fpe,code(t,e){let{gen:r,data:i,$data:n,schema:a,schemaCode:o,it:s}=t,{opts:l,errSchemaPath:u,schemaEnv:c,self:d}=s;if(!l.validateFormats)return;n?f():h();function f(){let g=r.scopeValue("formats",{ref:d.formats,code:l.code.formats}),v=r.const("fDef",(0,Qr._)`${g}[${o}]`),y=r.let("fType"),w=r.let("format");r.if((0,Qr._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign(y,(0,Qr._)`${v}.type || "string"`).assign(w,(0,Qr._)`${v}.validate`),()=>r.assign(y,(0,Qr._)`"string"`).assign(w,v)),t.fail$data((0,Qr.or)($(),E()));function $(){return l.strictSchema===!1?Qr.nil:(0,Qr._)`${o} && !${w}`}function E(){let I=c.$async?(0,Qr._)`(${v}.async ? await ${w}(${i}) : ${w}(${i}))`:(0,Qr._)`${w}(${i})`,R=(0,Qr._)`(typeof ${w} == "function" ? ${I} : ${w}.test(${i}))`;return(0,Qr._)`${w} && ${w} !== true && ${y} === ${e} && !${R}`}}function h(){let g=d.formats[a];if(!g){$();return}if(g===!0)return;let[v,y,w]=E(g);v===e&&t.pass(I());function $(){if(l.strictSchema===!1){d.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${a}" ignored in schema at path "${u}"`}}function E(R){let M=R instanceof RegExp?(0,Qr.regexpCode)(R):l.code.formats?(0,Qr._)`${l.code.formats}${(0,Qr.getProperty)(a)}`:void 0,T=r.scopeValue("formats",{key:a,ref:R,code:M});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,Qr._)`${T}.validate`]:["string",R,T]}function I(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Qr._)`await ${w}(${i})`}return typeof y=="function"?(0,Qr._)`${w}(${i})`:(0,Qr._)`${w}.test(${i})`}}}};jb.default=mpe});var xN=be(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var hpe=kN(),gpe=[hpe.default];Tb.default=gpe});var $N=be(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.contentVocabulary=oc.metadataVocabulary=void 0;oc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];oc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var AN=be(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var vpe=RD(),ype=KD(),_pe=SN(),wpe=xN(),EN=$N(),bpe=[vpe.default,ype.default,(0,_pe.default)(),wpe.default,EN.metadataVocabulary,EN.contentVocabulary];Rb.default=bpe});var ON=be(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});g0.DiscrError=void 0;var PN;(function(t){t.Tag="tag",t.Mapping="mapping"})(PN||(g0.DiscrError=PN={}))});var CN=be(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var sc=rr(),Db=ON(),IN=Xg(),Spe=jp(),kpe=cr(),xpe={message:({params:{discrError:t,tagName:e}})=>t===Db.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,sc._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},$pe={keyword:"discriminator",type:"object",schemaType:"object",error:xpe,code(t){let{gen:e,data:r,schema:i,parentSchema:n,it:a}=t,{oneOf:o}=n;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=i.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),u=e.const("tag",(0,sc._)`${r}${(0,sc.getProperty)(s)}`);e.if((0,sc._)`typeof ${u} == "string"`,()=>c(),()=>t.error(!1,{discrError:Db.DiscrError.Tag,tag:u,tagName:s})),t.ok(l);function c(){let h=f();e.if(!1);for(let g in h)e.elseIf((0,sc._)`${u} === ${g}`),e.assign(l,d(h[g]));e.else(),t.error(!1,{discrError:Db.DiscrError.Mapping,tag:u,tagName:s}),e.endIf()}function d(h){let g=e.name("valid"),v=t.subschema({keyword:"oneOf",schemaProp:h},g);return t.mergeEvaluated(v,sc.Name),g}function f(){var h;let g={},v=w(n),y=!0;for(let I=0;I<o.length;I++){let R=o[I];if(R?.$ref&&!(0,kpe.schemaHasRulesButRef)(R,a.self.RULES)){let T=R.$ref;if(R=IN.resolveRef.call(a.self,a.schemaEnv.root,a.baseId,T),R instanceof IN.SchemaEnv&&(R=R.schema),R===void 0)throw new Spe.default(a.opts.uriResolver,a.baseId,T)}let M=(h=R?.properties)===null||h===void 0?void 0:h[s];if(typeof M!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);y=y&&(v||w(R)),$(M,I)}if(!y)throw new Error(`discriminator: "${s}" must be required`);return g;function w({required:I}){return Array.isArray(I)&&I.includes(s)}function $(I,R){if(I.const)E(I.const,R);else if(I.enum)for(let M of I.enum)E(M,R);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function E(I,R){if(typeof I!="string"||I in g)throw new Error(`discriminator: "${s}" values must be unique strings`);g[I]=R}}}};Nb.default=$pe});var jN=be((gSe,Epe)=>{Epe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Mb=be((Nr,Lb)=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.MissingRefError=Nr.ValidationError=Nr.CodeGen=Nr.Name=Nr.nil=Nr.stringify=Nr.str=Nr._=Nr.KeywordCxt=Nr.Ajv=void 0;var Ape=PD(),Ppe=AN(),Ope=CN(),TN=jN(),Ipe=["/properties"],v0="http://json-schema.org/draft-07/schema",lc=class extends Ape.default{_addVocabularies(){super._addVocabularies(),Ppe.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Ope.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(TN,Ipe):TN;this.addMetaSchema(e,v0,!1),this.refs["http://json-schema.org/schema"]=v0}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(v0)?v0:void 0)}};Nr.Ajv=lc;Lb.exports=Nr=lc;Lb.exports.Ajv=lc;Object.defineProperty(Nr,"__esModule",{value:!0});Nr.default=lc;var Cpe=Cp();Object.defineProperty(Nr,"KeywordCxt",{enumerable:!0,get:function(){return Cpe.KeywordCxt}});var uc=rr();Object.defineProperty(Nr,"_",{enumerable:!0,get:function(){return uc._}});Object.defineProperty(Nr,"str",{enumerable:!0,get:function(){return uc.str}});Object.defineProperty(Nr,"stringify",{enumerable:!0,get:function(){return uc.stringify}});Object.defineProperty(Nr,"nil",{enumerable:!0,get:function(){return uc.nil}});Object.defineProperty(Nr,"Name",{enumerable:!0,get:function(){return uc.Name}});Object.defineProperty(Nr,"CodeGen",{enumerable:!0,get:function(){return uc.CodeGen}});var jpe=Yg();Object.defineProperty(Nr,"ValidationError",{enumerable:!0,get:function(){return jpe.default}});var Tpe=jp();Object.defineProperty(Nr,"MissingRefError",{enumerable:!0,get:function(){return Tpe.default}})});var zb,RN,Rpe,DN=st(()=>{zb=(t,e,r)=>{let i=t instanceof RegExp?RN(t,r):t,n=e instanceof RegExp?RN(e,r):e,a=i!==null&&n!=null&&Rpe(i,n,r);return a&&{start:a[0],end:a[1],pre:r.slice(0,a[0]),body:r.slice(a[0]+i.length,a[1]),post:r.slice(a[1]+n.length)}},RN=(t,e)=>{let r=e.match(t);return r?r[0]:null},Rpe=(t,e,r)=>{let i,n,a,o,s,l=r.indexOf(t),u=r.indexOf(e,l+1),c=l;if(l>=0&&u>0){if(t===e)return[l,u];for(i=[],a=r.length;c>=0&&!s;){if(c===l)i.push(c),l=r.indexOf(t,c+1);else if(i.length===1){let d=i.pop();d!==void 0&&(s=[d,u])}else n=i.pop(),n!==void 0&&n<a&&(a=n,o=u),u=r.indexOf(e,c+1);c=l<u&&l>=0?l:u}i.length&&o!==void 0&&(s=[a,o])}return s}});function qb(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function Wpe(t){return t.replace(qpe,NN).replace(Fpe,LN).replace(Upe,Fb).replace(Vpe,MN).replace(Bpe,zN)}function Hpe(t){return t.replace(Dpe,"\\").replace(Npe,"{").replace(Lpe,"}").replace(Mpe,",").replace(zpe,".")}function qN(t){if(!t)return[""];let e=[],r=zb("{","}",t);if(!r)return t.split(",");let{pre:i,body:n,post:a}=r,o=i.split(",");o[o.length-1]+="{"+n+"}";let s=qN(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),e.push.apply(e,o),e}function FN(t,e={}){if(!t)return[];let{max:r=Gpe}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),Wp(Wpe(t),r,!0).map(Hpe)}function Kpe(t){return"{"+t+"}"}function Zpe(t){return/^-?0\d/.test(t)}function Jpe(t,e){return t<=e}function Ype(t,e){return t>=e}function Wp(t,e,r){let i=[],n=zb("{","}",t);if(!n)return[t];let a=n.pre,o=n.post.length?Wp(n.post,e,!1):[""];if(/\$$/.test(n.pre))for(let s=0;s<o.length&&s<e;s++){let l=a+"{"+n.body+"}"+o[s];i.push(l)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=s||l,c=n.body.indexOf(",")>=0;if(!u&&!c)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+Fb+n.post,Wp(t,e,!0)):[t];let d;if(u)d=n.body.split(/\.\./);else if(d=qN(n.body),d.length===1&&d[0]!==void 0&&(d=Wp(d[0],e,!1).map(Kpe),d.length===1))return o.map(h=>n.pre+d[0]+h);let f;if(u&&d[0]!==void 0&&d[1]!==void 0){let h=qb(d[0]),g=qb(d[1]),v=Math.max(d[0].length,d[1].length),y=d.length===3&&d[2]!==void 0?Math.max(Math.abs(qb(d[2])),1):1,w=Jpe;g<h&&(y*=-1,w=Ype);let E=d.some(Zpe);f=[];for(let I=h;w(I,g)&&f.length<e;I+=y){let R;if(l)R=String.fromCharCode(I),R==="\\"&&(R="");else if(R=String(I),E){let M=v-R.length;if(M>0){let T=new Array(M+1).join("0");I<0?R="-"+T+R.slice(1):R=T+R}}f.push(R)}}else{f=[];for(let h=0;h<d.length;h++)f.push.apply(f,Wp(d[h],e,!1))}for(let h=0;h<f.length;h++)for(let g=0;g<o.length&&i.length<e;g++){let v=a+f[h]+o[g];(!r||u||v)&&i.push(v)}}return i}var NN,LN,Fb,MN,zN,Dpe,Npe,Lpe,Mpe,zpe,qpe,Fpe,Upe,Vpe,Bpe,Gpe,UN=st(()=>{DN();NN="\0SLASH"+Math.random()+"\0",LN="\0OPEN"+Math.random()+"\0",Fb="\0CLOSE"+Math.random()+"\0",MN="\0COMMA"+Math.random()+"\0",zN="\0PERIOD"+Math.random()+"\0",Dpe=new RegExp(NN,"g"),Npe=new RegExp(LN,"g"),Lpe=new RegExp(Fb,"g"),Mpe=new RegExp(MN,"g"),zpe=new RegExp(zN,"g"),qpe=/\\\\/g,Fpe=/\\{/g,Upe=/\\}/g,Vpe=/\\,/g,Bpe=/\\\./g,Gpe=1e5});var Hp,VN=st(()=>{Hp=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var Qpe,Kp,Xpe,BN,GN,WN=st(()=>{Qpe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Kp=t=>t.replace(/[[\]\\-]/g,"\\$&"),Xpe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),BN=t=>t.join(""),GN=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],n=[],a=r+1,o=!1,s=!1,l=!1,u=!1,c=r,d="";e:for(;a<t.length;){let v=t.charAt(a);if((v==="!"||v==="^")&&a===r+1){u=!0,a++;continue}if(v==="]"&&o&&!l){c=a+1;break}if(o=!0,v==="\\"&&!l){l=!0,a++;continue}if(v==="["&&!l){for(let[y,[w,$,E]]of Object.entries(Qpe))if(t.startsWith(y,a)){if(d)return["$.",!1,t.length-r,!0];a+=y.length,E?n.push(w):i.push(w),s=s||$;continue e}}if(l=!1,d){v>d?i.push(Kp(d)+"-"+Kp(v)):v===d&&i.push(Kp(v)),d="",a++;continue}if(t.startsWith("-]",a+1)){i.push(Kp(v+"-")),a+=2;continue}if(t.startsWith("-",a+1)){d=v,a+=2;continue}i.push(Kp(v)),a++}if(c<a)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-r,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let v=i[0].length===2?i[0].slice(-1):i[0];return[Xpe(v),!1,c-r,!1]}let f="["+(u?"^":"")+BN(i)+"]",h="["+(u?"":"^")+BN(n)+"]";return[i.length&&n.length?"("+f+"|"+h+")":i.length?f:h,s,c-r,!0]}});var vs,y0=st(()=>{vs=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!0}={})=>r?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1")});var di,efe,Ub,HN,tfe,rfe,nfe,KN,ife,_0,afe,ofe,sfe,lfe,Vb,ZN,JN,ufe,wl,Bb=st(()=>{WN();y0();efe=new Set(["!","?","+","*","@"]),Ub=t=>efe.has(t),HN=t=>Ub(t.type),tfe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),rfe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),nfe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),KN=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ife="(?!(?:^|/)\\.\\.?(?:$|/))",_0="(?!\\.)",afe=new Set(["[","."]),ofe=new Set(["..","."]),sfe=new Set("().*{}+?[]^$\\!"),lfe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Vb="[^/]",ZN=Vb+"*?",JN=Vb+"+?",ufe=0,wl=class{type;#t;#r;#i=!1;#e=[];#n;#s;#u;#l=!1;#a;#o;#c=!1;id=++ufe;get depth(){return(this.#n?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#n?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,r,i={}){this.type=e,e&&(this.#r=!0),this.#n=r,this.#t=this.#n?this.#n.#t:this,this.#a=this.#t===this?i:this.#t.#a,this.#u=this.#t===this?[]:this.#t.#u,e==="!"&&!this.#t.#l&&this.#u.push(this),this.#s=this.#n?this.#n.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#o=this.#e.map(e=>String(e)).join("")}#v(){if(this!==this.#t)throw new Error("should only call on root");if(this.#l)return this;this.toString(),this.#l=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let r=e,i=r.#n;for(;i;){for(let n=r.#s+1;!i.type&&n<i.#e.length;n++)for(let a of e.#e){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(i.#e[n])}r=i,i=r.#n}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof di&&r.#n===this))throw new Error("invalid part: "+r);this.#e.push(r)}}toJSON(){let e=this.type===null?this.#e.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#e.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#l&&this.#n?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#n?.isStart())return!1;if(this.#s===0)return!0;let e=this.#n;for(let r=0;r<this.#s;r++){let i=e.#e[r];if(!(i instanceof di&&i.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#n?.type==="!")return!0;if(!this.#n?.isEnd())return!1;if(!this.type)return this.#n?.isEnd();let e=this.#n?this.#n.#e.length:0;return this.#s===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new di(this.type,e);for(let i of this.#e)r.copyIn(i);return r}static#d(e,r,i,n,a){let o=n.maxExtglobRecursion??2,s=!1,l=!1,u=-1,c=!1;if(r.type===null){let v=i,y="";for(;v<e.length;){let w=e.charAt(v++);if(s||w==="\\"){s=!s,y+=w;continue}if(l){v===u+1?(w==="^"||w==="!")&&(c=!0):w==="]"&&!(v===u+2&&c)&&(l=!1),y+=w;continue}else if(w==="["){l=!0,u=v,c=!1,y+=w;continue}if(!n.noext&&Ub(w)&&e.charAt(v)==="("&&a<=o){r.push(y),y="";let E=new di(w,r);v=di.#d(e,E,v,n,a+1),r.push(E);continue}y+=w}return r.push(y),v}let d=i+1,f=new di(null,r),h=[],g="";for(;d<e.length;){let v=e.charAt(d++);if(s||v==="\\"){s=!s,g+=v;continue}if(l){d===u+1?(v==="^"||v==="!")&&(c=!0):v==="]"&&!(d===u+2&&c)&&(l=!1),g+=v;continue}else if(v==="["){l=!0,u=d,c=!1,g+=v;continue}if(!n.noext&&Ub(v)&&e.charAt(d)==="("&&(a<=o||r&&r.#p(v))){let w=r&&r.#p(v)?0:1;f.push(g),g="";let $=new di(v,f);f.push($),d=di.#d(e,$,d,n,a+w);continue}if(v==="|"){f.push(g),g="",h.push(f),f=new di(null,r);continue}if(v===")")return g===""&&r.#e.length===0&&(r.#c=!0),f.push(g),g="",r.push(...h,f),d;g+=v}return r.type=null,r.#r=void 0,r.#e=[e.substring(i-1)],d}#y(e){return this.#m(e,rfe)}#m(e,r=tfe){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let i=e.#e[0];return!i||typeof i!="object"||i.type===null?!1:this.#p(i.type,r)}#p(e,r=nfe){return!!r.get(this.type)?.includes(e)}#_(e,r){let i=e.#e[0],n=new di(null,i,this.options);n.#e.push(""),i.push(n),this.#h(e,r)}#h(e,r){let i=e.#e[0];this.#e.splice(r,1,...i.#e);for(let n of i.#e)typeof n=="object"&&(n.#n=this);this.#o=void 0}#w(e){return!!KN.get(this.type)?.has(e)}#b(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let r=e.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#w(r.type)}#S(e){let r=KN.get(this.type),i=e.#e[0],n=r?.get(i.type);if(!n)return!1;this.#e=i.#e;for(let a of this.#e)typeof a=="object"&&(a.#n=this);this.type=n,this.#o=void 0,this.#c=!1}static fromGlob(e,r={}){let i=new di(null,void 0,r);return di.#d(e,i,0,r,0),i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,i,n,a]=this.toRegExpSource();if(!(n||this.#r||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let s=(this.#a.nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:e})}get options(){return this.#a}toRegExpSource(e){let r=e??!!this.#a.dot;if(this.#t===this&&(this.#f(),this.#v()),!HN(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,v,y,w]=typeof h=="string"?di.#k(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||y,this.#i=this.#i||w,g}).join(""),c="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&ofe.has(this.#e[0]))){let g=afe,v=r&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),y=!r&&!e&&g.has(u.charAt(0));c=v?ife:y?_0:""}let d="";return this.isEnd()&&this.#t.#l&&this.#n?.type==="!"&&(d="(?:$|\\/)"),[c+u+d,vs(u),this.#r=!!this.#r,this.#i]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",a=this.#g(r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){let l=this.toString(),u=this;return u.#e=[l],u.type=null,u.#r=void 0,[l,vs(this.toString()),!1,!1]}let o=!i||e||r||!_0?"":this.#g(!0);o===a&&(o=""),o&&(a=`(?:${a})(?:${o})*?`);let s="";if(this.type==="!"&&this.#c)s=(this.isStart()&&!r?_0:"")+JN;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!e?_0:"")+ZN+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;s=n+a+l}return[s,vs(a),this.#r=!!this.#r,this.#i]}#f(){if(HN(this)){let e=0,r=!1;do{r=!0;for(let i=0;i<this.#e.length;i++){let n=this.#e[i];typeof n=="object"&&(n.#f(),this.#m(n)?(r=!1,this.#h(n,i)):this.#y(n)?(r=!1,this.#_(n,i)):this.#b(n)&&(r=!1,this.#S(n)))}}while(!r&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#f();this.#o=void 0}#g(e){return this.#e.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,n,a,o]=r.toRegExpSource(e);return this.#i=this.#i||o,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(e,r,i=!1){let n=!1,a="",o=!1,s=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(n){n=!1,a+=(sfe.has(u)?"\\":"")+u;continue}if(u==="*"){if(s)continue;s=!0,a+=i&&/^[*]+$/.test(e)?JN:ZN,r=!0;continue}else s=!1;if(u==="\\"){l===e.length-1?a+="\\\\":n=!0;continue}if(u==="["){let[c,d,f,h]=GN(e,l);if(f){a+=c,o=o||d,l+=f-1,r=r||h;continue}}if(u==="?"){a+=Vb,r=!0;continue}a+=lfe(u)}return[a,vs(e),!!r,o]}};di=wl});var Gb,Wb=st(()=>{Gb=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!1}={})=>r?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var rn,cfe,dfe,pfe,ffe,mfe,hfe,gfe,vfe,yfe,_fe,wfe,bfe,Sfe,kfe,xfe,$fe,Efe,Afe,XN,eL,tL,YN,Pfe,Ln,Ofe,Ife,Cfe,jfe,Tfe,Yi,Rfe,rL,Dfe,Nfe,QN,Lfe,cc,Hb=st(()=>{UN();VN();Bb();Wb();y0();Bb();Wb();y0();rn=(t,e,r={})=>(Hp(e),!r.nocomment&&e.charAt(0)==="#"?!1:new cc(e,r).match(t)),cfe=/^\*+([^+@!?*[(]*)$/,dfe=t=>e=>!e.startsWith(".")&&e.endsWith(t),pfe=t=>e=>e.endsWith(t),ffe=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),mfe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),hfe=/^\*+\.\*+$/,gfe=t=>!t.startsWith(".")&&t.includes("."),vfe=t=>t!=="."&&t!==".."&&t.includes("."),yfe=/^\.\*+$/,_fe=t=>t!=="."&&t!==".."&&t.startsWith("."),wfe=/^\*+$/,bfe=t=>t.length!==0&&!t.startsWith("."),Sfe=t=>t.length!==0&&t!=="."&&t!=="..",kfe=/^\?+([^+@!?*[(]*)?$/,xfe=([t,e=""])=>{let r=XN([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},$fe=([t,e=""])=>{let r=eL([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},Efe=([t,e=""])=>{let r=eL([t]);return e?i=>r(i)&&i.endsWith(e):r},Afe=([t,e=""])=>{let r=XN([t]);return e?i=>r(i)&&i.endsWith(e):r},XN=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},eL=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},tL=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",YN={win32:{sep:"\\"},posix:{sep:"/"}},Pfe=tL==="win32"?YN.win32.sep:YN.posix.sep;rn.sep=Pfe;Ln=Symbol("globstar **");rn.GLOBSTAR=Ln;Ofe="[^/]",Ife=Ofe+"*?",Cfe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",jfe="(?:(?!(?:\\/|^)\\.).)*?",Tfe=(t,e={})=>r=>rn(r,t,e);rn.filter=Tfe;Yi=(t,e={})=>Object.assign({},t,e),Rfe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return rn;let e=rn;return Object.assign((i,n,a={})=>e(i,n,Yi(t,a)),{Minimatch:class extends e.Minimatch{constructor(n,a={}){super(n,Yi(t,a))}static defaults(n){return e.defaults(Yi(t,n)).Minimatch}},AST:class extends e.AST{constructor(n,a,o={}){super(n,a,Yi(t,o))}static fromGlob(n,a={}){return e.AST.fromGlob(n,Yi(t,a))}},unescape:(i,n={})=>e.unescape(i,Yi(t,n)),escape:(i,n={})=>e.escape(i,Yi(t,n)),filter:(i,n={})=>e.filter(i,Yi(t,n)),defaults:i=>e.defaults(Yi(t,i)),makeRe:(i,n={})=>e.makeRe(i,Yi(t,n)),braceExpand:(i,n={})=>e.braceExpand(i,Yi(t,n)),match:(i,n,a={})=>e.match(i,n,Yi(t,a)),sep:e.sep,GLOBSTAR:Ln})};rn.defaults=Rfe;rL=(t,e={})=>(Hp(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:FN(t,{max:e.braceExpandMax}));rn.braceExpand=rL;Dfe=(t,e={})=>new cc(t,e).makeRe();rn.makeRe=Dfe;Nfe=(t,e,r={})=>{let i=new cc(e,r);return t=t.filter(n=>i.match(n)),i.options.nonull&&!t.length&&t.push(e),t};rn.match=Nfe;QN=/[?*]|[+@!]\(.*?\)|\[|\]/,Lfe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),cc=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){Hp(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||tL,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((a,o,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=a[0]===""&&a[1]===""&&(a[2]==="?"||!QN.test(a[2]))&&!QN.test(a[3]),u=/^[a-z]:/i.test(a[0]);if(l)return[...a.slice(0,4),...a.slice(4).map(c=>this.parse(c))];if(u)return[a[0],...a.slice(1).map(c=>this.parse(c))]}return a.map(l=>this.parse(l))});if(this.debug(this.pattern,n),this.set=n.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){let o=this.set[a];o[0]===""&&o[1]===""&&this.globParts[a][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i of e)for(let n=0;n<i.length;n++)i[n]==="**"&&(i[n]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let n=i;for(;r[n+1]==="**";)n++;n!==i&&r.splice(i,n-i)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((i,n)=>{let a=i[i.length-1];return n==="**"&&a==="**"?i:n===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(i.pop(),i):(i.push(n),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let a=e[n];n===1&&a===""&&e[0]===""||(a==="."||a==="")&&(r=!0,e.splice(n,1),n--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let n=e[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(n))&&(r=!0,e.splice(i-1,2),i-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let i of e){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let o=n;for(;i[o+1]==="**";)o++;o>n&&i.splice(n+1,o-n);let s=i[n+1],l=i[n+2],u=i[n+3];if(s!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;r=!0,i.splice(n,1);let c=i.slice(0);c[n]="**",e.push(c),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let s=i[o];o===1&&s===""&&i[0]===""||(s==="."||s==="")&&(r=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let a=0;for(;(a=i.indexOf("..",a+1))!==-1;){let o=i[a-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let l=a===1&&i[a+1]==="**"?["."]:[];i.splice(a-1,2,...l),i.length===0&&i.push(""),a-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let i=r+1;i<e.length;i++){let n=this.partsMatch(e[r],e[i],!this.preserveMultipleSlashes);if(n){e[r]=[],e[i]=n;break}}return e.filter(r=>r.length)}partsMatch(e,r,i=!1){let n=0,a=0,o=[],s="";for(;n<e.length&&a<r.length;)if(e[n]===r[a])o.push(s==="b"?r[a]:e[n]),n++,a++;else if(i&&e[n]==="**"&&r[a]===e[n+1])o.push(e[n]),n++;else if(i&&r[a]==="**"&&e[n]===r[a+1])o.push(r[a]),a++;else if(e[n]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(s==="b")return!1;s="a",o.push(e[n]),n++,a++}else if(r[a]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(s==="a")return!1;s="b",o.push(r[a]),n++,a++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,i=0;for(let n=0;n<e.length&&e.charAt(n)==="!";n++)r=!r,i++;i&&(this.pattern=e.slice(i)),this.negate=r}matchOne(e,r,i=!1){let n=0,a=0;if(this.isWindows){let s=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!s&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),c=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),d=l?3:s?0:void 0,f=c?3:u?0:void 0;if(typeof d=="number"&&typeof f=="number"){let[h,g]=[e[d],r[f]];h.toLowerCase()===g.toLowerCase()&&(r[f]=h,a=f,n=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),r.includes(Ln)?this.#t(e,r,i,n,a):this.#i(e,r,i,n,a)}#t(e,r,i,n,a){let o=r.indexOf(Ln,a),s=r.lastIndexOf(Ln),[l,u,c]=i?[r.slice(a,o),r.slice(o+1),[]]:[r.slice(a,o),r.slice(o+1,s),r.slice(s+1)];if(l.length){let $=e.slice(n,n+l.length);if(!this.#i($,l,i,0,0))return!1;n+=l.length,a+=l.length}let d=0;if(c.length){if(c.length+n>e.length)return!1;let $=e.length-c.length;if(this.#i(e,c,i,$,0))d=c.length;else{if(e[e.length-1]!==""||n+c.length===e.length||($--,!this.#i(e,c,i,$,0)))return!1;d=c.length+1}}if(!u.length){let $=!!d;for(let E=n;E<e.length-d;E++){let I=String(e[E]);if($=!0,I==="."||I===".."||!this.options.dot&&I.startsWith("."))return!1}return i||$}let f=[[[],0]],h=f[0],g=0,v=[0];for(let $ of u)$===Ln?(v.push(g),h=[[],0],f.push(h)):(h[0].push($),g++);let y=f.length-1,w=e.length-d;for(let $ of f)$[1]=w-(v[y--]+$[0].length);return!!this.#r(e,f,n,0,i,0,!!d)}#r(e,r,i,n,a,o,s){let l=r[n];if(!l){for(let d=i;d<e.length;d++){s=!0;let f=e[d];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return s}let[u,c]=l;for(;i<=c;){if(this.#i(e.slice(0,i+u.length),u,a,i,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,r,i+u.length,n+1,a,o+1,s);if(h!==!1)return h}let f=e[i];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1;i++}return a||null}#i(e,r,i,n,a){let o,s,l,u;for(o=n,s=a,u=e.length,l=r.length;o<u&&s<l;o++,s++){this.debug("matchOne loop");let c=r[s],d=e[o];if(this.debug(r,c,d),c===!1||c===Ln)return!1;let f;if(typeof c=="string"?(f=d===c,this.debug("string match",c,d,f)):(f=c.test(d),this.debug("pattern match",c,d,f)),!f)return!1}if(o===u&&s===l)return!0;if(o===u)return i;if(s===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return rL(this.pattern,this.options)}parse(e){Hp(e);let r=this.options;if(e==="**")return Ln;if(e==="")return"";let i,n=null;(i=e.match(wfe))?n=r.dot?Sfe:bfe:(i=e.match(cfe))?n=(r.nocase?r.dot?mfe:ffe:r.dot?pfe:dfe)(i[1]):(i=e.match(kfe))?n=(r.nocase?r.dot?$fe:xfe:r.dot?Efe:Afe)(i):(i=e.match(hfe))?n=r.dot?vfe:gfe:(i=e.match(yfe))&&(n=_fe);let a=wl.fromGlob(e,this.options).toMMPattern();return n&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:n}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?Ife:r.dot?Cfe:jfe,n=new Set(r.nocase?["i"]:[]),a=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let f of d.flags.split(""))n.add(f);return typeof d=="string"?Lfe(d):d===Ln?Ln:d._src});u.forEach((d,f)=>{let h=u[f+1],g=u[f-1];d!==Ln||g===Ln||(g===void 0?h!==void 0&&h!==Ln?u[f+1]="(?:\\/|"+i+"\\/)?"+h:u[f]=i:h===void 0?u[f-1]=g+"(?:\\/|\\/"+i+")?":h!==Ln&&(u[f-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[f+1]=Ln))});let c=u.filter(d=>d!==Ln);if(this.partial&&c.length>=1){let d=[];for(let f=1;f<=c.length;f++)d.push(c.slice(0,f).join("/"));return"(?:"+d.join("|")+")"}return c.join("/")}).join("|"),[o,s]=e.length>1?["(?:",")"]:["",""];a="^"+o+a+s+"$",this.partial&&(a="^(?:\\/|"+o+a.slice(1,-1)+s+")$"),this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let n=this.slashSplit(e);this.debug(this.pattern,"split",n);let a=this.set;this.debug(this.pattern,"set",a);let o=n[n.length-1];if(!o)for(let s=n.length-2;!o&&s>=0;s--)o=n[s];for(let s of a){let l=n;if(i.matchBase&&s.length===1&&(l=[o]),this.matchOne(l,s,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return rn.defaults(e).Minimatch}};rn.AST=wl;rn.Minimatch=cc;rn.escape=Gb;rn.unescape=vs});var _U={};Cn(_U,{ActionEnum:()=>G0,ActionSchema:()=>tF,AgentContractsConfigSchema:()=>sU,AgentSchema:()=>Uq,AppendOperatorSchema:()=>w2e,ArtifactSchema:()=>Vq,BaseResolveError:()=>bf,BindingOutputSchema:()=>Wq,BindingRenderTargetSchema:()=>Kq,CONTEXT_TYPES:()=>fv,CheckSchema:()=>Gq,CommandSchema:()=>fF,ComponentsSchema:()=>_F,ConditionalActionSchema:()=>eF,ConfigLoadError:()=>Ci,ContextLoadingSchema:()=>oF,ContextTypeSchema:()=>dS,DslLoadError:()=>Kr,DslSchema:()=>W0,EscalationCriterionSchema:()=>cS,ExecutionStepSchema:()=>lF,ExtendsSchema:()=>d2e,GuardrailPolicyRuleEscalationSchema:()=>Xq,GuardrailPolicyRuleSchema:()=>rF,GuardrailPolicySchema:()=>nF,GuardrailSchema:()=>Qq,GuardrailScopeSchema:()=>Yq,HandoffTypeSchema:()=>Jq,ITERABLE_CONTEXT_TYPES:()=>a2e,InsertAfterOperatorSchema:()=>S2e,MatcherSchema:()=>Bq,MergeError:()=>_a,PolicySchema:()=>aF,PolicyWhenSchema:()=>iF,PrependOperatorSchema:()=>b2e,PrerequisiteSchema:()=>Fq,RemoveOperatorSchema:()=>x2e,RenderTargetSchema:()=>oU,ReplaceOperatorSchema:()=>k2e,ReportingSchema:()=>Hq,RuleSchema:()=>uS,SCOPE_NODE_TYPES:()=>pS,ScopeNodeTypeSchema:()=>wF,SectionSchema:()=>wf,SoftwareBindingSchema:()=>Zq,SystemSchema:()=>sF,TaskSchema:()=>uF,TeamImportSchema:()=>cF,TeamInterfaceAcceptWorkflowSchema:()=>dF,TeamInterfaceSchema:()=>pF,ToolSchema:()=>mF,ValidationSchema:()=>hF,VersionLiteralSchema:()=>c2e,WorkflowSchema:()=>yF,WorkflowStepSchema:()=>vF,XExtensionDeclSchema:()=>bF,buildArtifactContext:()=>WF,buildAuditContext:()=>cU,buildCoverageReport:()=>a_e,buildGlobalContext:()=>l4e,buildGuardrailContext:()=>YF,buildGuardrailPolicyContext:()=>QF,buildHandoffTypeContext:()=>ZF,buildNavigationIndex:()=>xf,buildPerAgentContext:()=>_S,buildPolicyContext:()=>JF,buildSystemContext:()=>Sf,buildTaskContext:()=>GF,buildToolContext:()=>HF,buildValidationContext:()=>KF,buildWorkflowContext:()=>vv,builtinRules:()=>VF,checkDriftFromConfig:()=>G4e,checkReferences:()=>eye,computeExitCode:()=>Y6e,enumerateProjectFiles:()=>r_e,expandDefaults:()=>W2e,formatAuditResult:()=>pU,formatAuditResults:()=>J6e,formatCoverageText:()=>o_e,generateGuardrails:()=>X6e,lint:()=>Uye,loadBindings:()=>s6e,loadConfig:()=>n6e,loadDsl:()=>cf,matchFileToArtifacts:()=>yU,mergeDsl:()=>TF,renderFromConfig:()=>V4e,resolve:()=>G2e,resolveAllOf:()=>Ps,resolveBase:()=>CF,resolveBindingTargetPath:()=>mU,resolveChecks:()=>fU,resolveDslPath:()=>i6e,resolveEffectiveGuardrails:()=>kf,resolveEntityValidations:()=>gv,runAllAudits:()=>W6e,runAudit:()=>dU,score:()=>v6e,spectralLint:()=>o4e,validateHandoffSchemas:()=>tye,validateSchema:()=>X2e,yamlReservedKeySafetyRule:()=>qF});import{createRequire as Mfe}from"module";import ya from"stream";import vz from"http";import b0 from"url";import E1e from"https";import bl from"zlib";import{readFile as $2e,readdir as E2e,stat as kF}from"fs/promises";import{dirname as fS,resolve as mS,join as A2e,extname as P2e}from"path";import{resolve as T2e,join as R2e}from"path";import{stat as OF}from"fs/promises";import{dirname as U2e,resolve as V2e}from"path";import{existsSync as Iye,readFileSync as Cye}from"fs";import{isAbsolute as jye,resolve as Tye}from"path";import{readFile as yS,writeFile as AL,mkdir as PL,unlink as s4e}from"fs/promises";import{dirname as OL}from"path";import{readFile as W4e}from"fs/promises";import{dirname as H4e,resolve as ML}from"path";import{stat as zL}from"fs/promises";import{readFile as K4e,access as Z4e}from"fs/promises";import{resolve as Fa,dirname as J4e}from"path";import{readFile as y6e}from"fs/promises";import{readFile as Z0,writeFile as A0,mkdir as Yp,chmod as Qp,unlink as P0,copyFile as Q6e}from"fs/promises";import{resolve as kl,dirname as Xp}from"path";import{execSync as e_e}from"child_process";import{readdirSync as t_e}from"fs";import{join as VL}from"path";function GL(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");O0(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function WL(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function HL(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a}function KL(t,e){return function(r,i){e(r,i,t)}}function ZL(t,e,r,i,n,a){function o(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var s=i.kind,l=s==="getter"?"get":s==="setter"?"set":"value",u=!e&&t?i.static?t:t.prototype:null,c=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,f=!1,h=r.length-1;h>=0;h--){var g={};for(var v in i)g[v]=v==="access"?{}:i[v];for(var v in i.access)g.access[v]=i.access[v];g.addInitializer=function(w){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(w||null))};var y=(0,r[h])(s==="accessor"?{get:c.get,set:c.set}:c[l],g);if(s==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(d=o(y.get))&&(c.get=d),(d=o(y.set))&&(c.set=d),(d=o(y.init))&&n.unshift(d)}else(d=o(y))&&(s==="field"?n.unshift(d):c[l]=d)}u&&Object.defineProperty(u,i.name,c),f=!0}function JL(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function YL(t){return typeof t=="symbol"?t:"".concat(t)}function QL(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function XL(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function eM(t,e,r,i){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(i.next(c))}catch(d){o(d)}}function l(c){try{u(i.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):n(c.value).then(s,l)}u((i=i.apply(t,e||[])).next())})}function tM(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(c){u=[6,c],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function rM(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sf(e,t,r)}function z0(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function I7(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,a=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function nM(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I7(arguments[e]));return t}function iM(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,n++)i[n]=a[o];return i}function aM(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,a;i<n;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}function _c(t){return this instanceof _c?(this.v=t,this):new _c(t)}function oM(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,a=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(h){return function(g){return Promise.resolve(g).then(h,d)}}function s(h,g){i[h]&&(n[h]=function(v){return new Promise(function(y,w){a.push([h,v,y,w])>1||l(h,v)})},g&&(n[h]=g(n[h])))}function l(h,g){try{u(i[h](g))}catch(v){f(a[0][3],v)}}function u(h){h.value instanceof _c?Promise.resolve(h.value.v).then(c,d):f(a[0][2],h)}function c(h){l("next",h)}function d(h){l("throw",h)}function f(h,g){h(g),a.shift(),a.length&&l(a[0][0],a[0][1])}}function sM(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=t[n]?function(o){return(r=!r)?{value:_c(t[n](o)),done:!1}:a?a(o):o}:a}}function lM(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof z0=="function"?z0(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(a){r[a]=t[a]&&function(o){return new Promise(function(s,l){o=t[a](o),n(s,l,o.done,o.value)})}}function n(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}function uM(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function cM(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=I0(t),i=0;i<r.length;i++)r[i]!=="default"&&sf(e,t,r[i]);return yM(e,t),e}function dM(t){return t&&t.__esModule?t:{default:t}}function pM(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function fM(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function mM(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function hM(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(a){return Promise.reject(a)}}),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function gM(t){function e(a){t.error=t.hasError?new _M(a,t.error,"An error was suppressed during disposal."):a,t.hasError=!0}var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(a).then(n,function(o){return e(o),n()})}else i|=1}catch(o){e(o)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return n()}function vM(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,a,o){return i?e?".jsx":".js":n&&(!a||!o)?r:n+a+"."+o.toLowerCase()+"js"}):t}function qa(t){let e="";return t.absolute&&(t.protocol==="file"?(t.drive&&(e+=t.drive),e+="/"):(e+=t.protocol+"://",t.origin&&(e+=t.origin+"/"))),(e+=t.path.join("/"))===""&&(e="."),e}function tf(t,e,r,i){this.message=t,this.expected=e,this.found=r,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,tf)}function Ii(t){if(typeof t!="string")throw new Error(`@stoplight/path: Cannot parse ${t} because it is not a string`);return SM(t,{})}function nL(t){return qa(wo(Ii(t)))}function wo(t){let e=t.path;e=e.filter(i=>i!==""&&i!==".");let r=[];for(let i of e)i===".."&&r.length&&r[r.length-1]!==".."?r.pop():i===".."&&t.absolute||r.push(i);return t.path=r,t}function l7(t){let e=t.lastIndexOf(".");t===".."&&(e=-1),t==="."&&(e=-1);let r=t,i="";return e>0&&(r=t.slice(0,e),i=t.slice(e)),{name:r,ext:i}}function bM(t){return Ii(t).absolute}function Bfe(t){let e=Ii(t);return e.protocol==="http"||e.protocol==="https"}function Gfe(t,e){let r=wo(Ii(e));if(!r.absolute)return qa(r);let i=wo(Ii(t));if(r.origin!==i.origin||!i.absolute||i.drive!==r.drive)return qa(r);let n=Math.min(i.path.length,r.path.length);for(let a=0;a<n&&i.path[0]===r.path[0];a++)i.path.shift(),r.path.shift();return r.path.unshift(...i.path.fill("..")),qa({origin:null,drive:null,absolute:!1,protocol:null,path:r.path})}function Wfe(...t){if(t.length===0)return".";let e=wo(Ii(t[t.length-1]));return e.absolute?qa(e):X0(...t)}function Hfe(t){let[e,r,i,...n]=t.split("/"),a=n.length?`/${n.join("/")}`:void 0,o,s;return a&&(o=n.find(l=>l.includes(".")))&&(s=l7(o).ext),{shortcode:e,orgSlug:r,projectSlug:i,uri:a,file:o,ext:s}}function Kfe({shortcode:t,orgSlug:e,projectSlug:r,uri:i=""}){return[t,e,r,i.replace(/^\//,"")].filter(Boolean).join("/")}function PM(t,e){e===void 0&&(e=!1);var r=t.length,i=0,n="",a=0,o=16,s=0,l=0,u=0,c=0,d=0;function f(E,I){for(var R=0,M=0;R<E||!I;){var T=t.charCodeAt(i);if(T>=48&&T<=57)M=M*16+T-48;else if(T>=65&&T<=70)M=M*16+T-65+10;else if(T>=97&&T<=102)M=M*16+T-97+10;else break;i++,R++}return R<E&&(M=-1),M}function h(E){i=E,n="",a=0,o=16,d=0}function g(){var E=i;if(t.charCodeAt(i)===48)i++;else for(i++;i<t.length&&pc(t.charCodeAt(i));)i++;if(i<t.length&&t.charCodeAt(i)===46)if(i++,i<t.length&&pc(t.charCodeAt(i)))for(i++;i<t.length&&pc(t.charCodeAt(i));)i++;else return d=3,t.substring(E,i);var I=i;if(i<t.length&&(t.charCodeAt(i)===69||t.charCodeAt(i)===101))if(i++,(i<t.length&&t.charCodeAt(i)===43||t.charCodeAt(i)===45)&&i++,i<t.length&&pc(t.charCodeAt(i))){for(i++;i<t.length&&pc(t.charCodeAt(i));)i++;I=i}else d=3;return t.substring(E,I)}function v(){for(var E="",I=i;;){if(i>=r){E+=t.substring(I,i),d=2;break}var R=t.charCodeAt(i);if(R===34){E+=t.substring(I,i),i++;break}if(R===92){if(E+=t.substring(I,i),i++,i>=r){d=2;break}var M=t.charCodeAt(i++);switch(M){case 34:E+='"';break;case 92:E+="\\";break;case 47:E+="/";break;case 98:E+="\b";break;case 102:E+="\f";break;case 110:E+=`
256
+ deps: ${r}}`};var Ede={keyword:"dependencies",type:"object",schemaType:"object",error:La.error,code(t){let[e,r]=Ade(t);rN(t,e),nN(t,r)}};function Ade({schema:t}){let e={},r={};for(let i in t){if(i==="__proto__")continue;let n=Array.isArray(t[i])?e:r;n[i]=t[i]}return[e,r]}function rN(t,e=t.schema){let{gen:r,data:i,it:n}=t;if(Object.keys(e).length===0)return;let a=r.let("missing");for(let o in e){let s=e[o];if(s.length===0)continue;let l=(0,Gp.propertyInData)(r,i,o,n.opts.ownProperties);t.setParams({property:o,depsCount:s.length,deps:s.join(", ")}),n.allErrors?r.if(l,()=>{for(let u of s)(0,Gp.checkReportMissingProp)(t,u)}):(r.if((0,yb._)`${l} && (${(0,Gp.checkMissingProp)(t,s,a)})`),(0,Gp.reportMissingProp)(t,a),r.else())}}La.validatePropertyDeps=rN;function nN(t,e=t.schema){let{gen:r,data:i,keyword:n,it:a}=t,o=r.name("valid");for(let s in e)(0,$de.alwaysValidSchema)(a,e[s])||(r.if((0,Gp.propertyInData)(r,i,s,a.opts.ownProperties),()=>{let l=t.subschema({keyword:n,schemaProp:s},o);t.mergeValidEvaluated(l,o)},()=>r.var(o,!0)),t.ok(o))}La.validateSchemaDeps=nN;La.default=Ede});var oN=be(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});var aN=rr(),Pde=cr(),Ode={message:"property name must be valid",params:({params:t})=>(0,aN._)`{propertyName: ${t.propertyName}}`},Ide={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:Ode,code(t){let{gen:e,schema:r,data:i,it:n}=t;if((0,Pde.alwaysValidSchema)(n,r))return;let a=e.name("valid");e.forIn("key",i,o=>{t.setParams({propertyName:o}),t.subschema({keyword:"propertyNames",data:o,dataTypes:["string"],propertyName:o,compositeRule:!0},a),e.if((0,aN.not)(a),()=>{t.error(!0),n.allErrors||e.break()})}),t.ok(a)}};_b.default=Ide});var bb=be(wb=>{"use strict";Object.defineProperty(wb,"__esModule",{value:!0});var d0=Ki(),ha=rr(),Cde=mo(),p0=cr(),jde={message:"must NOT have additional properties",params:({params:t})=>(0,ha._)`{additionalProperty: ${t.additionalProperty}}`},Tde={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jde,code(t){let{gen:e,schema:r,parentSchema:i,data:n,errsCount:a,it:o}=t;if(!a)throw new Error("ajv implementation error");let{allErrors:s,opts:l}=o;if(o.props=!0,l.removeAdditional!=="all"&&(0,p0.alwaysValidSchema)(o,r))return;let u=(0,d0.allSchemaProperties)(i.properties),c=(0,d0.allSchemaProperties)(i.patternProperties);d(),t.ok((0,ha._)`${a} === ${Cde.default.errors}`);function d(){e.forIn("key",n,y=>{!u.length&&!c.length?g(y):e.if(f(y),()=>g(y))})}function f(y){let w;if(u.length>8){let $=(0,p0.schemaRefOrVal)(o,i.properties,"properties");w=(0,d0.isOwnProperty)(e,$,y)}else u.length?w=(0,ha.or)(...u.map($=>(0,ha._)`${y} === ${$}`)):w=ha.nil;return c.length&&(w=(0,ha.or)(w,...c.map($=>(0,ha._)`${(0,d0.usePattern)(t,$)}.test(${y})`))),(0,ha.not)(w)}function h(y){e.code((0,ha._)`delete ${n}[${y}]`)}function g(y){if(l.removeAdditional==="all"||l.removeAdditional&&r===!1){h(y);return}if(r===!1){t.setParams({additionalProperty:y}),t.error(),s||e.break();return}if(typeof r=="object"&&!(0,p0.alwaysValidSchema)(o,r)){let w=e.name("valid");l.removeAdditional==="failing"?(v(y,w,!1),e.if((0,ha.not)(w),()=>{t.reset(),h(y)})):(v(y,w),s||e.if((0,ha.not)(w),()=>e.break()))}}function v(y,w,$){let E={keyword:"additionalProperties",dataProp:y,dataPropType:p0.Type.Str};$===!1&&Object.assign(E,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(E,w)}}};wb.default=Tde});var uN=be(kb=>{"use strict";Object.defineProperty(kb,"__esModule",{value:!0});var Rde=Cp(),sN=Ki(),Sb=cr(),lN=bb(),Dde={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:i,data:n,it:a}=t;a.opts.removeAdditional==="all"&&i.additionalProperties===void 0&&lN.default.code(new Rde.KeywordCxt(a,lN.default,"additionalProperties"));let o=(0,sN.allSchemaProperties)(r);for(let d of o)a.definedProperties.add(d);a.opts.unevaluated&&o.length&&a.props!==!0&&(a.props=Sb.mergeEvaluated.props(e,(0,Sb.toHash)(o),a.props));let s=o.filter(d=>!(0,Sb.alwaysValidSchema)(a,r[d]));if(s.length===0)return;let l=e.name("valid");for(let d of s)u(d)?c(d):(e.if((0,sN.propertyInData)(e,n,d,a.opts.ownProperties)),c(d),a.allErrors||e.else().var(l,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(l);function u(d){return a.opts.useDefaults&&!a.compositeRule&&r[d].default!==void 0}function c(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},l)}}};kb.default=Dde});var fN=be(xb=>{"use strict";Object.defineProperty(xb,"__esModule",{value:!0});var cN=Ki(),f0=rr(),dN=cr(),pN=cr(),Nde={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:i,parentSchema:n,it:a}=t,{opts:o}=a,s=(0,cN.allSchemaProperties)(r),l=s.filter(v=>(0,dN.alwaysValidSchema)(a,r[v]));if(s.length===0||l.length===s.length&&(!a.opts.unevaluated||a.props===!0))return;let u=o.strictSchema&&!o.allowMatchingProperties&&n.properties,c=e.name("valid");a.props!==!0&&!(a.props instanceof f0.Name)&&(a.props=(0,pN.evaluatedPropsToName)(e,a.props));let{props:d}=a;f();function f(){for(let v of s)u&&h(v),a.allErrors?g(v):(e.var(c,!0),g(v),e.if(c))}function h(v){for(let y in u)new RegExp(v).test(y)&&(0,dN.checkStrictMode)(a,`property ${y} matches pattern ${v} (use allowMatchingProperties)`)}function g(v){e.forIn("key",i,y=>{e.if((0,f0._)`${(0,cN.usePattern)(t,v)}.test(${y})`,()=>{let w=l.includes(v);w||t.subschema({keyword:"patternProperties",schemaProp:v,dataProp:y,dataPropType:pN.Type.Str},c),a.opts.unevaluated&&d!==!0?e.assign((0,f0._)`${d}[${y}]`,!0):!w&&!a.allErrors&&e.if((0,f0.not)(c),()=>e.break())})})}}};xb.default=Nde});var mN=be($b=>{"use strict";Object.defineProperty($b,"__esModule",{value:!0});var Lde=cr(),Mde={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:i}=t;if((0,Lde.alwaysValidSchema)(i,r)){t.fail();return}let n=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},n),t.failResult(n,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};$b.default=Mde});var hN=be(Eb=>{"use strict";Object.defineProperty(Eb,"__esModule",{value:!0});var zde=Ki(),qde={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:zde.validateUnion,error:{message:"must match a schema in anyOf"}};Eb.default=qde});var gN=be(Ab=>{"use strict";Object.defineProperty(Ab,"__esModule",{value:!0});var m0=rr(),Fde=cr(),Ude={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,m0._)`{passingSchemas: ${t.passing}}`},Vde={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Ude,code(t){let{gen:e,schema:r,parentSchema:i,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(n.opts.discriminator&&i.discriminator)return;let a=r,o=e.let("valid",!1),s=e.let("passing",null),l=e.name("_valid");t.setParams({passing:s}),e.block(u),t.result(o,()=>t.reset(),()=>t.error(!0));function u(){a.forEach((c,d)=>{let f;(0,Fde.alwaysValidSchema)(n,c)?e.var(l,!0):f=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},l),d>0&&e.if((0,m0._)`${l} && ${o}`).assign(o,!1).assign(s,(0,m0._)`[${s}, ${d}]`).else(),e.if(l,()=>{e.assign(o,!0),e.assign(s,d),f&&t.mergeEvaluated(f,m0.Name)})})}}};Ab.default=Vde});var vN=be(Pb=>{"use strict";Object.defineProperty(Pb,"__esModule",{value:!0});var Bde=cr(),Gde={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let n=e.name("valid");r.forEach((a,o)=>{if((0,Bde.alwaysValidSchema)(i,a))return;let s=t.subschema({keyword:"allOf",schemaProp:o},n);t.ok(n),t.mergeEvaluated(s)})}};Pb.default=Gde});var wN=be(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});var h0=rr(),_N=cr(),Wde={message:({params:t})=>(0,h0.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,h0._)`{failingKeyword: ${t.ifClause}}`},Hde={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Wde,code(t){let{gen:e,parentSchema:r,it:i}=t;r.then===void 0&&r.else===void 0&&(0,_N.checkStrictMode)(i,'"if" without "then" and "else" is ignored');let n=yN(i,"then"),a=yN(i,"else");if(!n&&!a)return;let o=e.let("valid",!0),s=e.name("_valid");if(l(),t.reset(),n&&a){let c=e.let("ifClause");t.setParams({ifClause:c}),e.if(s,u("then",c),u("else",c))}else n?e.if(s,u("then")):e.if((0,h0.not)(s),u("else"));t.pass(o,()=>t.error(!0));function l(){let c=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);t.mergeEvaluated(c)}function u(c,d){return()=>{let f=t.subschema({keyword:c},s);e.assign(o,s),t.mergeValidEvaluated(f,o),d?e.assign(d,(0,h0._)`${c}`):t.setParams({ifClause:c})}}}};function yN(t,e){let r=t.schema[e];return r!==void 0&&!(0,_N.alwaysValidSchema)(t,r)}Ob.default=Hde});var bN=be(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});var Kde=cr(),Zde={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,Kde.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Ib.default=Zde});var SN=be(Cb=>{"use strict";Object.defineProperty(Cb,"__esModule",{value:!0});var Jde=fb(),Yde=QD(),Qde=mb(),Xde=eN(),epe=tN(),tpe=iN(),rpe=oN(),npe=bb(),ipe=uN(),ape=fN(),ope=mN(),spe=hN(),lpe=gN(),upe=vN(),cpe=wN(),dpe=bN();function ppe(t=!1){let e=[ope.default,spe.default,lpe.default,upe.default,cpe.default,dpe.default,rpe.default,npe.default,tpe.default,ipe.default,ape.default];return t?e.push(Yde.default,Xde.default):e.push(Jde.default,Qde.default),e.push(epe.default),e}Cb.default=ppe});var kN=be(jb=>{"use strict";Object.defineProperty(jb,"__esModule",{value:!0});var Qr=rr(),fpe={message:({schemaCode:t})=>(0,Qr.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Qr._)`{format: ${t}}`},mpe={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:fpe,code(t,e){let{gen:r,data:i,$data:n,schema:a,schemaCode:o,it:s}=t,{opts:l,errSchemaPath:u,schemaEnv:c,self:d}=s;if(!l.validateFormats)return;n?f():h();function f(){let g=r.scopeValue("formats",{ref:d.formats,code:l.code.formats}),v=r.const("fDef",(0,Qr._)`${g}[${o}]`),y=r.let("fType"),w=r.let("format");r.if((0,Qr._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>r.assign(y,(0,Qr._)`${v}.type || "string"`).assign(w,(0,Qr._)`${v}.validate`),()=>r.assign(y,(0,Qr._)`"string"`).assign(w,v)),t.fail$data((0,Qr.or)($(),E()));function $(){return l.strictSchema===!1?Qr.nil:(0,Qr._)`${o} && !${w}`}function E(){let I=c.$async?(0,Qr._)`(${v}.async ? await ${w}(${i}) : ${w}(${i}))`:(0,Qr._)`${w}(${i})`,R=(0,Qr._)`(typeof ${w} == "function" ? ${I} : ${w}.test(${i}))`;return(0,Qr._)`${w} && ${w} !== true && ${y} === ${e} && !${R}`}}function h(){let g=d.formats[a];if(!g){$();return}if(g===!0)return;let[v,y,w]=E(g);v===e&&t.pass(I());function $(){if(l.strictSchema===!1){d.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${a}" ignored in schema at path "${u}"`}}function E(R){let M=R instanceof RegExp?(0,Qr.regexpCode)(R):l.code.formats?(0,Qr._)`${l.code.formats}${(0,Qr.getProperty)(a)}`:void 0,T=r.scopeValue("formats",{key:a,ref:R,code:M});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,Qr._)`${T}.validate`]:["string",R,T]}function I(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!c.$async)throw new Error("async format in sync schema");return(0,Qr._)`await ${w}(${i})`}return typeof y=="function"?(0,Qr._)`${w}(${i})`:(0,Qr._)`${w}.test(${i})`}}}};jb.default=mpe});var xN=be(Tb=>{"use strict";Object.defineProperty(Tb,"__esModule",{value:!0});var hpe=kN(),gpe=[hpe.default];Tb.default=gpe});var $N=be(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.contentVocabulary=oc.metadataVocabulary=void 0;oc.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];oc.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var AN=be(Rb=>{"use strict";Object.defineProperty(Rb,"__esModule",{value:!0});var vpe=RD(),ype=KD(),_pe=SN(),wpe=xN(),EN=$N(),bpe=[vpe.default,ype.default,(0,_pe.default)(),wpe.default,EN.metadataVocabulary,EN.contentVocabulary];Rb.default=bpe});var ON=be(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});g0.DiscrError=void 0;var PN;(function(t){t.Tag="tag",t.Mapping="mapping"})(PN||(g0.DiscrError=PN={}))});var CN=be(Nb=>{"use strict";Object.defineProperty(Nb,"__esModule",{value:!0});var sc=rr(),Db=ON(),IN=Xg(),Spe=jp(),kpe=cr(),xpe={message:({params:{discrError:t,tagName:e}})=>t===Db.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,sc._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},$pe={keyword:"discriminator",type:"object",schemaType:"object",error:xpe,code(t){let{gen:e,data:r,schema:i,parentSchema:n,it:a}=t,{oneOf:o}=n;if(!a.opts.discriminator)throw new Error("discriminator: requires discriminator option");let s=i.propertyName;if(typeof s!="string")throw new Error("discriminator: requires propertyName");if(i.mapping)throw new Error("discriminator: mapping is not supported");if(!o)throw new Error("discriminator: requires oneOf keyword");let l=e.let("valid",!1),u=e.const("tag",(0,sc._)`${r}${(0,sc.getProperty)(s)}`);e.if((0,sc._)`typeof ${u} == "string"`,()=>c(),()=>t.error(!1,{discrError:Db.DiscrError.Tag,tag:u,tagName:s})),t.ok(l);function c(){let h=f();e.if(!1);for(let g in h)e.elseIf((0,sc._)`${u} === ${g}`),e.assign(l,d(h[g]));e.else(),t.error(!1,{discrError:Db.DiscrError.Mapping,tag:u,tagName:s}),e.endIf()}function d(h){let g=e.name("valid"),v=t.subschema({keyword:"oneOf",schemaProp:h},g);return t.mergeEvaluated(v,sc.Name),g}function f(){var h;let g={},v=w(n),y=!0;for(let I=0;I<o.length;I++){let R=o[I];if(R?.$ref&&!(0,kpe.schemaHasRulesButRef)(R,a.self.RULES)){let T=R.$ref;if(R=IN.resolveRef.call(a.self,a.schemaEnv.root,a.baseId,T),R instanceof IN.SchemaEnv&&(R=R.schema),R===void 0)throw new Spe.default(a.opts.uriResolver,a.baseId,T)}let M=(h=R?.properties)===null||h===void 0?void 0:h[s];if(typeof M!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);y=y&&(v||w(R)),$(M,I)}if(!y)throw new Error(`discriminator: "${s}" must be required`);return g;function w({required:I}){return Array.isArray(I)&&I.includes(s)}function $(I,R){if(I.const)E(I.const,R);else if(I.enum)for(let M of I.enum)E(M,R);else throw new Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function E(I,R){if(typeof I!="string"||I in g)throw new Error(`discriminator: "${s}" values must be unique strings`);g[I]=R}}}};Nb.default=$pe});var jN=be((_Se,Epe)=>{Epe.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Mb=be((Nr,Lb)=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.MissingRefError=Nr.ValidationError=Nr.CodeGen=Nr.Name=Nr.nil=Nr.stringify=Nr.str=Nr._=Nr.KeywordCxt=Nr.Ajv=void 0;var Ape=PD(),Ppe=AN(),Ope=CN(),TN=jN(),Ipe=["/properties"],v0="http://json-schema.org/draft-07/schema",lc=class extends Ape.default{_addVocabularies(){super._addVocabularies(),Ppe.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(Ope.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(TN,Ipe):TN;this.addMetaSchema(e,v0,!1),this.refs["http://json-schema.org/schema"]=v0}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(v0)?v0:void 0)}};Nr.Ajv=lc;Lb.exports=Nr=lc;Lb.exports.Ajv=lc;Object.defineProperty(Nr,"__esModule",{value:!0});Nr.default=lc;var Cpe=Cp();Object.defineProperty(Nr,"KeywordCxt",{enumerable:!0,get:function(){return Cpe.KeywordCxt}});var uc=rr();Object.defineProperty(Nr,"_",{enumerable:!0,get:function(){return uc._}});Object.defineProperty(Nr,"str",{enumerable:!0,get:function(){return uc.str}});Object.defineProperty(Nr,"stringify",{enumerable:!0,get:function(){return uc.stringify}});Object.defineProperty(Nr,"nil",{enumerable:!0,get:function(){return uc.nil}});Object.defineProperty(Nr,"Name",{enumerable:!0,get:function(){return uc.Name}});Object.defineProperty(Nr,"CodeGen",{enumerable:!0,get:function(){return uc.CodeGen}});var jpe=Yg();Object.defineProperty(Nr,"ValidationError",{enumerable:!0,get:function(){return jpe.default}});var Tpe=jp();Object.defineProperty(Nr,"MissingRefError",{enumerable:!0,get:function(){return Tpe.default}})});var zb,RN,Rpe,DN=st(()=>{zb=(t,e,r)=>{let i=t instanceof RegExp?RN(t,r):t,n=e instanceof RegExp?RN(e,r):e,a=i!==null&&n!=null&&Rpe(i,n,r);return a&&{start:a[0],end:a[1],pre:r.slice(0,a[0]),body:r.slice(a[0]+i.length,a[1]),post:r.slice(a[1]+n.length)}},RN=(t,e)=>{let r=e.match(t);return r?r[0]:null},Rpe=(t,e,r)=>{let i,n,a,o,s,l=r.indexOf(t),u=r.indexOf(e,l+1),c=l;if(l>=0&&u>0){if(t===e)return[l,u];for(i=[],a=r.length;c>=0&&!s;){if(c===l)i.push(c),l=r.indexOf(t,c+1);else if(i.length===1){let d=i.pop();d!==void 0&&(s=[d,u])}else n=i.pop(),n!==void 0&&n<a&&(a=n,o=u),u=r.indexOf(e,c+1);c=l<u&&l>=0?l:u}i.length&&o!==void 0&&(s=[a,o])}return s}});function qb(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function Wpe(t){return t.replace(qpe,NN).replace(Fpe,LN).replace(Upe,Fb).replace(Vpe,MN).replace(Bpe,zN)}function Hpe(t){return t.replace(Dpe,"\\").replace(Npe,"{").replace(Lpe,"}").replace(Mpe,",").replace(zpe,".")}function qN(t){if(!t)return[""];let e=[],r=zb("{","}",t);if(!r)return t.split(",");let{pre:i,body:n,post:a}=r,o=i.split(",");o[o.length-1]+="{"+n+"}";let s=qN(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),e.push.apply(e,o),e}function FN(t,e={}){if(!t)return[];let{max:r=Gpe}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),Wp(Wpe(t),r,!0).map(Hpe)}function Kpe(t){return"{"+t+"}"}function Zpe(t){return/^-?0\d/.test(t)}function Jpe(t,e){return t<=e}function Ype(t,e){return t>=e}function Wp(t,e,r){let i=[],n=zb("{","}",t);if(!n)return[t];let a=n.pre,o=n.post.length?Wp(n.post,e,!1):[""];if(/\$$/.test(n.pre))for(let s=0;s<o.length&&s<e;s++){let l=a+"{"+n.body+"}"+o[s];i.push(l)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=s||l,c=n.body.indexOf(",")>=0;if(!u&&!c)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+Fb+n.post,Wp(t,e,!0)):[t];let d;if(u)d=n.body.split(/\.\./);else if(d=qN(n.body),d.length===1&&d[0]!==void 0&&(d=Wp(d[0],e,!1).map(Kpe),d.length===1))return o.map(h=>n.pre+d[0]+h);let f;if(u&&d[0]!==void 0&&d[1]!==void 0){let h=qb(d[0]),g=qb(d[1]),v=Math.max(d[0].length,d[1].length),y=d.length===3&&d[2]!==void 0?Math.max(Math.abs(qb(d[2])),1):1,w=Jpe;g<h&&(y*=-1,w=Ype);let E=d.some(Zpe);f=[];for(let I=h;w(I,g)&&f.length<e;I+=y){let R;if(l)R=String.fromCharCode(I),R==="\\"&&(R="");else if(R=String(I),E){let M=v-R.length;if(M>0){let T=new Array(M+1).join("0");I<0?R="-"+T+R.slice(1):R=T+R}}f.push(R)}}else{f=[];for(let h=0;h<d.length;h++)f.push.apply(f,Wp(d[h],e,!1))}for(let h=0;h<f.length;h++)for(let g=0;g<o.length&&i.length<e;g++){let v=a+f[h]+o[g];(!r||u||v)&&i.push(v)}}return i}var NN,LN,Fb,MN,zN,Dpe,Npe,Lpe,Mpe,zpe,qpe,Fpe,Upe,Vpe,Bpe,Gpe,UN=st(()=>{DN();NN="\0SLASH"+Math.random()+"\0",LN="\0OPEN"+Math.random()+"\0",Fb="\0CLOSE"+Math.random()+"\0",MN="\0COMMA"+Math.random()+"\0",zN="\0PERIOD"+Math.random()+"\0",Dpe=new RegExp(NN,"g"),Npe=new RegExp(LN,"g"),Lpe=new RegExp(Fb,"g"),Mpe=new RegExp(MN,"g"),zpe=new RegExp(zN,"g"),qpe=/\\\\/g,Fpe=/\\{/g,Upe=/\\}/g,Vpe=/\\,/g,Bpe=/\\\./g,Gpe=1e5});var Hp,VN=st(()=>{Hp=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}});var Qpe,Kp,Xpe,BN,GN,WN=st(()=>{Qpe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Kp=t=>t.replace(/[[\]\\-]/g,"\\$&"),Xpe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),BN=t=>t.join(""),GN=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],n=[],a=r+1,o=!1,s=!1,l=!1,u=!1,c=r,d="";e:for(;a<t.length;){let v=t.charAt(a);if((v==="!"||v==="^")&&a===r+1){u=!0,a++;continue}if(v==="]"&&o&&!l){c=a+1;break}if(o=!0,v==="\\"&&!l){l=!0,a++;continue}if(v==="["&&!l){for(let[y,[w,$,E]]of Object.entries(Qpe))if(t.startsWith(y,a)){if(d)return["$.",!1,t.length-r,!0];a+=y.length,E?n.push(w):i.push(w),s=s||$;continue e}}if(l=!1,d){v>d?i.push(Kp(d)+"-"+Kp(v)):v===d&&i.push(Kp(v)),d="",a++;continue}if(t.startsWith("-]",a+1)){i.push(Kp(v+"-")),a+=2;continue}if(t.startsWith("-",a+1)){d=v,a+=2;continue}i.push(Kp(v)),a++}if(c<a)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-r,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let v=i[0].length===2?i[0].slice(-1):i[0];return[Xpe(v),!1,c-r,!1]}let f="["+(u?"^":"")+BN(i)+"]",h="["+(u?"":"^")+BN(n)+"]";return[i.length&&n.length?"("+f+"|"+h+")":i.length?f:h,s,c-r,!0]}});var vs,y0=st(()=>{vs=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!0}={})=>r?e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1")});var di,efe,Ub,HN,tfe,rfe,nfe,KN,ife,_0,afe,ofe,sfe,lfe,Vb,ZN,JN,ufe,wl,Bb=st(()=>{WN();y0();efe=new Set(["!","?","+","*","@"]),Ub=t=>efe.has(t),HN=t=>Ub(t.type),tfe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),rfe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),nfe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),KN=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ife="(?!(?:^|/)\\.\\.?(?:$|/))",_0="(?!\\.)",afe=new Set(["[","."]),ofe=new Set(["..","."]),sfe=new Set("().*{}+?[]^$\\!"),lfe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Vb="[^/]",ZN=Vb+"*?",JN=Vb+"+?",ufe=0,wl=class{type;#t;#r;#i=!1;#e=[];#n;#s;#u;#l=!1;#a;#o;#c=!1;id=++ufe;get depth(){return(this.#n?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#n?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,r,i={}){this.type=e,e&&(this.#r=!0),this.#n=r,this.#t=this.#n?this.#n.#t:this,this.#a=this.#t===this?i:this.#t.#a,this.#u=this.#t===this?[]:this.#t.#u,e==="!"&&!this.#t.#l&&this.#u.push(this),this.#s=this.#n?this.#n.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#o=this.#e.map(e=>String(e)).join("")}#v(){if(this!==this.#t)throw new Error("should only call on root");if(this.#l)return this;this.toString(),this.#l=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let r=e,i=r.#n;for(;i;){for(let n=r.#s+1;!i.type&&n<i.#e.length;n++)for(let a of e.#e){if(typeof a=="string")throw new Error("string part in extglob AST??");a.copyIn(i.#e[n])}r=i,i=r.#n}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof di&&r.#n===this))throw new Error("invalid part: "+r);this.#e.push(r)}}toJSON(){let e=this.type===null?this.#e.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#e.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#l&&this.#n?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#n?.isStart())return!1;if(this.#s===0)return!0;let e=this.#n;for(let r=0;r<this.#s;r++){let i=e.#e[r];if(!(i instanceof di&&i.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#n?.type==="!")return!0;if(!this.#n?.isEnd())return!1;if(!this.type)return this.#n?.isEnd();let e=this.#n?this.#n.#e.length:0;return this.#s===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new di(this.type,e);for(let i of this.#e)r.copyIn(i);return r}static#d(e,r,i,n,a){let o=n.maxExtglobRecursion??2,s=!1,l=!1,u=-1,c=!1;if(r.type===null){let v=i,y="";for(;v<e.length;){let w=e.charAt(v++);if(s||w==="\\"){s=!s,y+=w;continue}if(l){v===u+1?(w==="^"||w==="!")&&(c=!0):w==="]"&&!(v===u+2&&c)&&(l=!1),y+=w;continue}else if(w==="["){l=!0,u=v,c=!1,y+=w;continue}if(!n.noext&&Ub(w)&&e.charAt(v)==="("&&a<=o){r.push(y),y="";let E=new di(w,r);v=di.#d(e,E,v,n,a+1),r.push(E);continue}y+=w}return r.push(y),v}let d=i+1,f=new di(null,r),h=[],g="";for(;d<e.length;){let v=e.charAt(d++);if(s||v==="\\"){s=!s,g+=v;continue}if(l){d===u+1?(v==="^"||v==="!")&&(c=!0):v==="]"&&!(d===u+2&&c)&&(l=!1),g+=v;continue}else if(v==="["){l=!0,u=d,c=!1,g+=v;continue}if(!n.noext&&Ub(v)&&e.charAt(d)==="("&&(a<=o||r&&r.#p(v))){let w=r&&r.#p(v)?0:1;f.push(g),g="";let $=new di(v,f);f.push($),d=di.#d(e,$,d,n,a+w);continue}if(v==="|"){f.push(g),g="",h.push(f),f=new di(null,r);continue}if(v===")")return g===""&&r.#e.length===0&&(r.#c=!0),f.push(g),g="",r.push(...h,f),d;g+=v}return r.type=null,r.#r=void 0,r.#e=[e.substring(i-1)],d}#y(e){return this.#m(e,rfe)}#m(e,r=tfe){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let i=e.#e[0];return!i||typeof i!="object"||i.type===null?!1:this.#p(i.type,r)}#p(e,r=nfe){return!!r.get(this.type)?.includes(e)}#_(e,r){let i=e.#e[0],n=new di(null,i,this.options);n.#e.push(""),i.push(n),this.#h(e,r)}#h(e,r){let i=e.#e[0];this.#e.splice(r,1,...i.#e);for(let n of i.#e)typeof n=="object"&&(n.#n=this);this.#o=void 0}#w(e){return!!KN.get(this.type)?.has(e)}#b(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let r=e.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#w(r.type)}#S(e){let r=KN.get(this.type),i=e.#e[0],n=r?.get(i.type);if(!n)return!1;this.#e=i.#e;for(let a of this.#e)typeof a=="object"&&(a.#n=this);this.type=n,this.#o=void 0,this.#c=!1}static fromGlob(e,r={}){let i=new di(null,void 0,r);return di.#d(e,i,0,r,0),i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,i,n,a]=this.toRegExpSource();if(!(n||this.#r||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let s=(this.#a.nocase?"i":"")+(a?"u":"");return Object.assign(new RegExp(`^${r}$`,s),{_src:r,_glob:e})}get options(){return this.#a}toRegExpSource(e){let r=e??!!this.#a.dot;if(this.#t===this&&(this.#f(),this.#v()),!HN(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,v,y,w]=typeof h=="string"?di.#k(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||y,this.#i=this.#i||w,g}).join(""),c="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&ofe.has(this.#e[0]))){let g=afe,v=r&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),y=!r&&!e&&g.has(u.charAt(0));c=v?ife:y?_0:""}let d="";return this.isEnd()&&this.#t.#l&&this.#n?.type==="!"&&(d="(?:$|\\/)"),[c+u+d,vs(u),this.#r=!!this.#r,this.#i]}let i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:",a=this.#g(r);if(this.isStart()&&this.isEnd()&&!a&&this.type!=="!"){let l=this.toString(),u=this;return u.#e=[l],u.type=null,u.#r=void 0,[l,vs(this.toString()),!1,!1]}let o=!i||e||r||!_0?"":this.#g(!0);o===a&&(o=""),o&&(a=`(?:${a})(?:${o})*?`);let s="";if(this.type==="!"&&this.#c)s=(this.isStart()&&!r?_0:"")+JN;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!e?_0:"")+ZN+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;s=n+a+l}return[s,vs(a),this.#r=!!this.#r,this.#i]}#f(){if(HN(this)){let e=0,r=!1;do{r=!0;for(let i=0;i<this.#e.length;i++){let n=this.#e[i];typeof n=="object"&&(n.#f(),this.#m(n)?(r=!1,this.#h(n,i)):this.#y(n)?(r=!1,this.#_(n,i)):this.#b(n)&&(r=!1,this.#S(n)))}}while(!r&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#f();this.#o=void 0}#g(e){return this.#e.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,n,a,o]=r.toRegExpSource(e);return this.#i=this.#i||o,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(e,r,i=!1){let n=!1,a="",o=!1,s=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(n){n=!1,a+=(sfe.has(u)?"\\":"")+u;continue}if(u==="*"){if(s)continue;s=!0,a+=i&&/^[*]+$/.test(e)?JN:ZN,r=!0;continue}else s=!1;if(u==="\\"){l===e.length-1?a+="\\\\":n=!0;continue}if(u==="["){let[c,d,f,h]=GN(e,l);if(f){a+=c,o=o||d,l+=f-1,r=r||h;continue}}if(u==="?"){a+=Vb,r=!0;continue}a+=lfe(u)}return[a,vs(e),!!r,o]}};di=wl});var Gb,Wb=st(()=>{Gb=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!1}={})=>r?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")});var rn,cfe,dfe,pfe,ffe,mfe,hfe,gfe,vfe,yfe,_fe,wfe,bfe,Sfe,kfe,xfe,$fe,Efe,Afe,XN,eL,tL,YN,Pfe,Ln,Ofe,Ife,Cfe,jfe,Tfe,Yi,Rfe,rL,Dfe,Nfe,QN,Lfe,cc,Hb=st(()=>{UN();VN();Bb();Wb();y0();Bb();Wb();y0();rn=(t,e,r={})=>(Hp(e),!r.nocomment&&e.charAt(0)==="#"?!1:new cc(e,r).match(t)),cfe=/^\*+([^+@!?*[(]*)$/,dfe=t=>e=>!e.startsWith(".")&&e.endsWith(t),pfe=t=>e=>e.endsWith(t),ffe=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),mfe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),hfe=/^\*+\.\*+$/,gfe=t=>!t.startsWith(".")&&t.includes("."),vfe=t=>t!=="."&&t!==".."&&t.includes("."),yfe=/^\.\*+$/,_fe=t=>t!=="."&&t!==".."&&t.startsWith("."),wfe=/^\*+$/,bfe=t=>t.length!==0&&!t.startsWith("."),Sfe=t=>t.length!==0&&t!=="."&&t!=="..",kfe=/^\?+([^+@!?*[(]*)?$/,xfe=([t,e=""])=>{let r=XN([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},$fe=([t,e=""])=>{let r=eL([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},Efe=([t,e=""])=>{let r=eL([t]);return e?i=>r(i)&&i.endsWith(e):r},Afe=([t,e=""])=>{let r=XN([t]);return e?i=>r(i)&&i.endsWith(e):r},XN=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},eL=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},tL=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",YN={win32:{sep:"\\"},posix:{sep:"/"}},Pfe=tL==="win32"?YN.win32.sep:YN.posix.sep;rn.sep=Pfe;Ln=Symbol("globstar **");rn.GLOBSTAR=Ln;Ofe="[^/]",Ife=Ofe+"*?",Cfe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",jfe="(?:(?!(?:\\/|^)\\.).)*?",Tfe=(t,e={})=>r=>rn(r,t,e);rn.filter=Tfe;Yi=(t,e={})=>Object.assign({},t,e),Rfe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return rn;let e=rn;return Object.assign((i,n,a={})=>e(i,n,Yi(t,a)),{Minimatch:class extends e.Minimatch{constructor(n,a={}){super(n,Yi(t,a))}static defaults(n){return e.defaults(Yi(t,n)).Minimatch}},AST:class extends e.AST{constructor(n,a,o={}){super(n,a,Yi(t,o))}static fromGlob(n,a={}){return e.AST.fromGlob(n,Yi(t,a))}},unescape:(i,n={})=>e.unescape(i,Yi(t,n)),escape:(i,n={})=>e.escape(i,Yi(t,n)),filter:(i,n={})=>e.filter(i,Yi(t,n)),defaults:i=>e.defaults(Yi(t,i)),makeRe:(i,n={})=>e.makeRe(i,Yi(t,n)),braceExpand:(i,n={})=>e.braceExpand(i,Yi(t,n)),match:(i,n,a={})=>e.match(i,n,Yi(t,a)),sep:e.sep,GLOBSTAR:Ln})};rn.defaults=Rfe;rL=(t,e={})=>(Hp(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:FN(t,{max:e.braceExpandMax}));rn.braceExpand=rL;Dfe=(t,e={})=>new cc(t,e).makeRe();rn.makeRe=Dfe;Nfe=(t,e,r={})=>{let i=new cc(e,r);return t=t.filter(n=>i.match(n)),i.options.nonull&&!t.length&&t.push(e),t};rn.match=Nfe;QN=/[?*]|[+@!]\(.*?\)|\[|\]/,Lfe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),cc=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,r={}){Hp(e),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=e,this.platform=r.platform||tL,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...a)=>console.error(...a)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(a=>this.slashSplit(a));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((a,o,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=a[0]===""&&a[1]===""&&(a[2]==="?"||!QN.test(a[2]))&&!QN.test(a[3]),u=/^[a-z]:/i.test(a[0]);if(l)return[...a.slice(0,4),...a.slice(4).map(c=>this.parse(c))];if(u)return[a[0],...a.slice(1).map(c=>this.parse(c))]}return a.map(l=>this.parse(l))});if(this.debug(this.pattern,n),this.set=n.filter(a=>a.indexOf(!1)===-1),this.isWindows)for(let a=0;a<this.set.length;a++){let o=this.set[a];o[0]===""&&o[1]===""&&this.globParts[a][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i of e)for(let n=0;n<i.length;n++)i[n]==="**"&&(i[n]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let n=i;for(;r[n+1]==="**";)n++;n!==i&&r.splice(i,n-i)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((i,n)=>{let a=i[i.length-1];return n==="**"&&a==="**"?i:n===".."&&a&&a!==".."&&a!=="."&&a!=="**"?(i.pop(),i):(i.push(n),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let a=e[n];n===1&&a===""&&e[0]===""||(a==="."||a==="")&&(r=!0,e.splice(n,1),n--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let n=e[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(n))&&(r=!0,e.splice(i-1,2),i-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let i of e){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let o=n;for(;i[o+1]==="**";)o++;o>n&&i.splice(n+1,o-n);let s=i[n+1],l=i[n+2],u=i[n+3];if(s!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;r=!0,i.splice(n,1);let c=i.slice(0);c[n]="**",e.push(c),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){let s=i[o];o===1&&s===""&&i[0]===""||(s==="."||s==="")&&(r=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let a=0;for(;(a=i.indexOf("..",a+1))!==-1;){let o=i[a-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let l=a===1&&i[a+1]==="**"?["."]:[];i.splice(a-1,2,...l),i.length===0&&i.push(""),a-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let i=r+1;i<e.length;i++){let n=this.partsMatch(e[r],e[i],!this.preserveMultipleSlashes);if(n){e[r]=[],e[i]=n;break}}return e.filter(r=>r.length)}partsMatch(e,r,i=!1){let n=0,a=0,o=[],s="";for(;n<e.length&&a<r.length;)if(e[n]===r[a])o.push(s==="b"?r[a]:e[n]),n++,a++;else if(i&&e[n]==="**"&&r[a]===e[n+1])o.push(e[n]),n++;else if(i&&r[a]==="**"&&e[n]===r[a+1])o.push(r[a]),a++;else if(e[n]==="*"&&r[a]&&(this.options.dot||!r[a].startsWith("."))&&r[a]!=="**"){if(s==="b")return!1;s="a",o.push(e[n]),n++,a++}else if(r[a]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(s==="a")return!1;s="b",o.push(r[a]),n++,a++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,i=0;for(let n=0;n<e.length&&e.charAt(n)==="!";n++)r=!r,i++;i&&(this.pattern=e.slice(i)),this.negate=r}matchOne(e,r,i=!1){let n=0,a=0;if(this.isWindows){let s=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!s&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),c=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),d=l?3:s?0:void 0,f=c?3:u?0:void 0;if(typeof d=="number"&&typeof f=="number"){let[h,g]=[e[d],r[f]];h.toLowerCase()===g.toLowerCase()&&(r[f]=h,a=f,n=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),r.includes(Ln)?this.#t(e,r,i,n,a):this.#i(e,r,i,n,a)}#t(e,r,i,n,a){let o=r.indexOf(Ln,a),s=r.lastIndexOf(Ln),[l,u,c]=i?[r.slice(a,o),r.slice(o+1),[]]:[r.slice(a,o),r.slice(o+1,s),r.slice(s+1)];if(l.length){let $=e.slice(n,n+l.length);if(!this.#i($,l,i,0,0))return!1;n+=l.length,a+=l.length}let d=0;if(c.length){if(c.length+n>e.length)return!1;let $=e.length-c.length;if(this.#i(e,c,i,$,0))d=c.length;else{if(e[e.length-1]!==""||n+c.length===e.length||($--,!this.#i(e,c,i,$,0)))return!1;d=c.length+1}}if(!u.length){let $=!!d;for(let E=n;E<e.length-d;E++){let I=String(e[E]);if($=!0,I==="."||I===".."||!this.options.dot&&I.startsWith("."))return!1}return i||$}let f=[[[],0]],h=f[0],g=0,v=[0];for(let $ of u)$===Ln?(v.push(g),h=[[],0],f.push(h)):(h[0].push($),g++);let y=f.length-1,w=e.length-d;for(let $ of f)$[1]=w-(v[y--]+$[0].length);return!!this.#r(e,f,n,0,i,0,!!d)}#r(e,r,i,n,a,o,s){let l=r[n];if(!l){for(let d=i;d<e.length;d++){s=!0;let f=e[d];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return s}let[u,c]=l;for(;i<=c;){if(this.#i(e.slice(0,i+u.length),u,a,i,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,r,i+u.length,n+1,a,o+1,s);if(h!==!1)return h}let f=e[i];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1;i++}return a||null}#i(e,r,i,n,a){let o,s,l,u;for(o=n,s=a,u=e.length,l=r.length;o<u&&s<l;o++,s++){this.debug("matchOne loop");let c=r[s],d=e[o];if(this.debug(r,c,d),c===!1||c===Ln)return!1;let f;if(typeof c=="string"?(f=d===c,this.debug("string match",c,d,f)):(f=c.test(d),this.debug("pattern match",c,d,f)),!f)return!1}if(o===u&&s===l)return!0;if(o===u)return i;if(s===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return rL(this.pattern,this.options)}parse(e){Hp(e);let r=this.options;if(e==="**")return Ln;if(e==="")return"";let i,n=null;(i=e.match(wfe))?n=r.dot?Sfe:bfe:(i=e.match(cfe))?n=(r.nocase?r.dot?mfe:ffe:r.dot?pfe:dfe)(i[1]):(i=e.match(kfe))?n=(r.nocase?r.dot?$fe:xfe:r.dot?Efe:Afe)(i):(i=e.match(hfe))?n=r.dot?vfe:gfe:(i=e.match(yfe))&&(n=_fe);let a=wl.fromGlob(e,this.options).toMMPattern();return n&&typeof a=="object"&&Reflect.defineProperty(a,"test",{value:n}),a}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?Ife:r.dot?Cfe:jfe,n=new Set(r.nocase?["i"]:[]),a=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let f of d.flags.split(""))n.add(f);return typeof d=="string"?Lfe(d):d===Ln?Ln:d._src});u.forEach((d,f)=>{let h=u[f+1],g=u[f-1];d!==Ln||g===Ln||(g===void 0?h!==void 0&&h!==Ln?u[f+1]="(?:\\/|"+i+"\\/)?"+h:u[f]=i:h===void 0?u[f-1]=g+"(?:\\/|\\/"+i+")?":h!==Ln&&(u[f-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[f+1]=Ln))});let c=u.filter(d=>d!==Ln);if(this.partial&&c.length>=1){let d=[];for(let f=1;f<=c.length;f++)d.push(c.slice(0,f).join("/"));return"(?:"+d.join("|")+")"}return c.join("/")}).join("|"),[o,s]=e.length>1?["(?:",")"]:["",""];a="^"+o+a+s+"$",this.partial&&(a="^(?:\\/|"+o+a.slice(1,-1)+s+")$"),this.negate&&(a="^(?!"+a+").+$");try{this.regexp=new RegExp(a,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let n=this.slashSplit(e);this.debug(this.pattern,"split",n);let a=this.set;this.debug(this.pattern,"set",a);let o=n[n.length-1];if(!o)for(let s=n.length-2;!o&&s>=0;s--)o=n[s];for(let s of a){let l=n;if(i.matchBase&&s.length===1&&(l=[o]),this.matchOne(l,s,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return rn.defaults(e).Minimatch}};rn.AST=wl;rn.Minimatch=cc;rn.escape=Gb;rn.unescape=vs});var _U={};Cn(_U,{ActionEnum:()=>G0,ActionSchema:()=>tF,AgentContractsConfigSchema:()=>sU,AgentSchema:()=>Uq,AppendOperatorSchema:()=>w2e,ArtifactSchema:()=>Vq,BaseResolveError:()=>bf,BindingOutputSchema:()=>Wq,BindingRenderTargetSchema:()=>Kq,CONTEXT_TYPES:()=>fv,CheckSchema:()=>Gq,CommandSchema:()=>fF,ComponentsSchema:()=>_F,ConditionalActionSchema:()=>eF,ConfigLoadError:()=>Ci,ContextLoadingSchema:()=>oF,ContextTypeSchema:()=>dS,DslLoadError:()=>Kr,DslSchema:()=>W0,EscalationCriterionSchema:()=>cS,ExecutionStepSchema:()=>lF,ExtendsSchema:()=>d2e,GuardrailPolicyRuleEscalationSchema:()=>Xq,GuardrailPolicyRuleSchema:()=>rF,GuardrailPolicySchema:()=>nF,GuardrailSchema:()=>Qq,GuardrailScopeSchema:()=>Yq,HandoffTypeSchema:()=>Jq,ITERABLE_CONTEXT_TYPES:()=>a2e,InsertAfterOperatorSchema:()=>S2e,MatcherSchema:()=>Bq,MergeError:()=>_a,PolicySchema:()=>aF,PolicyWhenSchema:()=>iF,PrependOperatorSchema:()=>b2e,PrerequisiteSchema:()=>Fq,RemoveOperatorSchema:()=>x2e,RenderTargetSchema:()=>oU,ReplaceOperatorSchema:()=>k2e,ReportingSchema:()=>Hq,RuleSchema:()=>uS,SCOPE_NODE_TYPES:()=>pS,ScopeNodeTypeSchema:()=>wF,SectionSchema:()=>wf,SoftwareBindingSchema:()=>Zq,SystemSchema:()=>sF,TaskSchema:()=>uF,TeamImportSchema:()=>cF,TeamInterfaceAcceptWorkflowSchema:()=>dF,TeamInterfaceSchema:()=>pF,ToolSchema:()=>mF,ValidationSchema:()=>hF,VersionLiteralSchema:()=>c2e,WorkflowSchema:()=>yF,WorkflowStepSchema:()=>vF,XExtensionDeclSchema:()=>bF,buildArtifactContext:()=>WF,buildAuditContext:()=>cU,buildCoverageReport:()=>a_e,buildGlobalContext:()=>l4e,buildGuardrailContext:()=>YF,buildGuardrailPolicyContext:()=>QF,buildHandoffTypeContext:()=>ZF,buildNavigationIndex:()=>xf,buildPerAgentContext:()=>_S,buildPolicyContext:()=>JF,buildSystemContext:()=>Sf,buildTaskContext:()=>GF,buildToolContext:()=>HF,buildValidationContext:()=>KF,buildWorkflowContext:()=>vv,builtinRules:()=>VF,checkDriftFromConfig:()=>G4e,checkReferences:()=>eye,computeExitCode:()=>Y6e,enumerateProjectFiles:()=>r_e,expandDefaults:()=>W2e,formatAuditResult:()=>pU,formatAuditResults:()=>J6e,formatCoverageText:()=>o_e,generateGuardrails:()=>X6e,lint:()=>Uye,loadBindings:()=>s6e,loadConfig:()=>n6e,loadDsl:()=>cf,matchFileToArtifacts:()=>yU,mergeDsl:()=>TF,renderFromConfig:()=>V4e,resolve:()=>G2e,resolveAllOf:()=>Ps,resolveBase:()=>CF,resolveBindingTargetPath:()=>mU,resolveChecks:()=>fU,resolveDslPath:()=>i6e,resolveEffectiveGuardrails:()=>kf,resolveEntityValidations:()=>gv,runAllAudits:()=>W6e,runAudit:()=>dU,score:()=>v6e,spectralLint:()=>o4e,validateHandoffSchemas:()=>tye,validateSchema:()=>X2e,yamlReservedKeySafetyRule:()=>qF});import{createRequire as Mfe}from"module";import ya from"stream";import vz from"http";import b0 from"url";import E1e from"https";import bl from"zlib";import{readFile as $2e,readdir as E2e,stat as kF}from"fs/promises";import{dirname as fS,resolve as mS,join as A2e,extname as P2e}from"path";import{resolve as T2e,join as R2e}from"path";import{stat as OF}from"fs/promises";import{dirname as U2e,resolve as V2e}from"path";import{existsSync as Iye,readFileSync as Cye}from"fs";import{isAbsolute as jye,resolve as Tye}from"path";import{readFile as yS,writeFile as AL,mkdir as PL,unlink as s4e}from"fs/promises";import{dirname as OL}from"path";import{readFile as W4e}from"fs/promises";import{dirname as H4e,resolve as ML}from"path";import{stat as zL}from"fs/promises";import{readFile as K4e,access as Z4e}from"fs/promises";import{resolve as Fa,dirname as J4e}from"path";import{readFile as y6e}from"fs/promises";import{readFile as Z0,writeFile as A0,mkdir as Yp,chmod as Qp,unlink as P0,copyFile as Q6e}from"fs/promises";import{resolve as kl,dirname as Xp}from"path";import{execSync as e_e}from"child_process";import{readdirSync as t_e}from"fs";import{join as VL}from"path";function GL(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");O0(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function WL(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function HL(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a}function KL(t,e){return function(r,i){e(r,i,t)}}function ZL(t,e,r,i,n,a){function o(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var s=i.kind,l=s==="getter"?"get":s==="setter"?"set":"value",u=!e&&t?i.static?t:t.prototype:null,c=e||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,f=!1,h=r.length-1;h>=0;h--){var g={};for(var v in i)g[v]=v==="access"?{}:i[v];for(var v in i.access)g.access[v]=i.access[v];g.addInitializer=function(w){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(w||null))};var y=(0,r[h])(s==="accessor"?{get:c.get,set:c.set}:c[l],g);if(s==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(d=o(y.get))&&(c.get=d),(d=o(y.set))&&(c.set=d),(d=o(y.init))&&n.unshift(d)}else(d=o(y))&&(s==="field"?n.unshift(d):c[l]=d)}u&&Object.defineProperty(u,i.name,c),f=!0}function JL(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function YL(t){return typeof t=="symbol"?t:"".concat(t)}function QL(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function XL(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function eM(t,e,r,i){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(i.next(c))}catch(d){o(d)}}function l(c){try{u(i.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):n(c.value).then(s,l)}u((i=i.apply(t,e||[])).next())})}function tM(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(c){u=[6,c],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function rM(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sf(e,t,r)}function z0(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function I7(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,a=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function nM(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I7(arguments[e]));return t}function iM(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,n++)i[n]=a[o];return i}function aM(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,a;i<n;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))}function _c(t){return this instanceof _c?(this.v=t,this):new _c(t)}function oM(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,a=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(h){return function(g){return Promise.resolve(g).then(h,d)}}function s(h,g){i[h]&&(n[h]=function(v){return new Promise(function(y,w){a.push([h,v,y,w])>1||l(h,v)})},g&&(n[h]=g(n[h])))}function l(h,g){try{u(i[h](g))}catch(v){f(a[0][3],v)}}function u(h){h.value instanceof _c?Promise.resolve(h.value.v).then(c,d):f(a[0][2],h)}function c(h){l("next",h)}function d(h){l("throw",h)}function f(h,g){h(g),a.shift(),a.length&&l(a[0][0],a[0][1])}}function sM(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=t[n]?function(o){return(r=!r)?{value:_c(t[n](o)),done:!1}:a?a(o):o}:a}}function lM(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof z0=="function"?z0(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(a){r[a]=t[a]&&function(o){return new Promise(function(s,l){o=t[a](o),n(s,l,o.done,o.value)})}}function n(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}function uM(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function cM(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=I0(t),i=0;i<r.length;i++)r[i]!=="default"&&sf(e,t,r[i]);return yM(e,t),e}function dM(t){return t&&t.__esModule?t:{default:t}}function pM(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function fM(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function mM(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function hM(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=function(){try{n.call(this)}catch(a){return Promise.reject(a)}}),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function gM(t){function e(a){t.error=t.hasError?new _M(a,t.error,"An error was suppressed during disposal."):a,t.hasError=!0}var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(a).then(n,function(o){return e(o),n()})}else i|=1}catch(o){e(o)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return n()}function vM(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,a,o){return i?e?".jsx":".js":n&&(!a||!o)?r:n+a+"."+o.toLowerCase()+"js"}):t}function qa(t){let e="";return t.absolute&&(t.protocol==="file"?(t.drive&&(e+=t.drive),e+="/"):(e+=t.protocol+"://",t.origin&&(e+=t.origin+"/"))),(e+=t.path.join("/"))===""&&(e="."),e}function tf(t,e,r,i){this.message=t,this.expected=e,this.found=r,this.location=i,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,tf)}function Ii(t){if(typeof t!="string")throw new Error(`@stoplight/path: Cannot parse ${t} because it is not a string`);return SM(t,{})}function nL(t){return qa(wo(Ii(t)))}function wo(t){let e=t.path;e=e.filter(i=>i!==""&&i!==".");let r=[];for(let i of e)i===".."&&r.length&&r[r.length-1]!==".."?r.pop():i===".."&&t.absolute||r.push(i);return t.path=r,t}function l7(t){let e=t.lastIndexOf(".");t===".."&&(e=-1),t==="."&&(e=-1);let r=t,i="";return e>0&&(r=t.slice(0,e),i=t.slice(e)),{name:r,ext:i}}function bM(t){return Ii(t).absolute}function Bfe(t){let e=Ii(t);return e.protocol==="http"||e.protocol==="https"}function Gfe(t,e){let r=wo(Ii(e));if(!r.absolute)return qa(r);let i=wo(Ii(t));if(r.origin!==i.origin||!i.absolute||i.drive!==r.drive)return qa(r);let n=Math.min(i.path.length,r.path.length);for(let a=0;a<n&&i.path[0]===r.path[0];a++)i.path.shift(),r.path.shift();return r.path.unshift(...i.path.fill("..")),qa({origin:null,drive:null,absolute:!1,protocol:null,path:r.path})}function Wfe(...t){if(t.length===0)return".";let e=wo(Ii(t[t.length-1]));return e.absolute?qa(e):X0(...t)}function Hfe(t){let[e,r,i,...n]=t.split("/"),a=n.length?`/${n.join("/")}`:void 0,o,s;return a&&(o=n.find(l=>l.includes(".")))&&(s=l7(o).ext),{shortcode:e,orgSlug:r,projectSlug:i,uri:a,file:o,ext:s}}function Kfe({shortcode:t,orgSlug:e,projectSlug:r,uri:i=""}){return[t,e,r,i.replace(/^\//,"")].filter(Boolean).join("/")}function PM(t,e){e===void 0&&(e=!1);var r=t.length,i=0,n="",a=0,o=16,s=0,l=0,u=0,c=0,d=0;function f(E,I){for(var R=0,M=0;R<E||!I;){var T=t.charCodeAt(i);if(T>=48&&T<=57)M=M*16+T-48;else if(T>=65&&T<=70)M=M*16+T-65+10;else if(T>=97&&T<=102)M=M*16+T-97+10;else break;i++,R++}return R<E&&(M=-1),M}function h(E){i=E,n="",a=0,o=16,d=0}function g(){var E=i;if(t.charCodeAt(i)===48)i++;else for(i++;i<t.length&&pc(t.charCodeAt(i));)i++;if(i<t.length&&t.charCodeAt(i)===46)if(i++,i<t.length&&pc(t.charCodeAt(i)))for(i++;i<t.length&&pc(t.charCodeAt(i));)i++;else return d=3,t.substring(E,i);var I=i;if(i<t.length&&(t.charCodeAt(i)===69||t.charCodeAt(i)===101))if(i++,(i<t.length&&t.charCodeAt(i)===43||t.charCodeAt(i)===45)&&i++,i<t.length&&pc(t.charCodeAt(i))){for(i++;i<t.length&&pc(t.charCodeAt(i));)i++;I=i}else d=3;return t.substring(E,I)}function v(){for(var E="",I=i;;){if(i>=r){E+=t.substring(I,i),d=2;break}var R=t.charCodeAt(i);if(R===34){E+=t.substring(I,i),i++;break}if(R===92){if(E+=t.substring(I,i),i++,i>=r){d=2;break}var M=t.charCodeAt(i++);switch(M){case 34:E+='"';break;case 92:E+="\\";break;case 47:E+="/";break;case 98:E+="\b";break;case 102:E+="\f";break;case 110:E+=`
257
257
  `;break;case 114:E+="\r";break;case 116:E+=" ";break;case 117:var T=f(4,!0);T>=0?E+=String.fromCharCode(T):d=4;break;default:d=5}I=i;continue}if(R>=0&&R<=31)if(Zp(R)){E+=t.substring(I,i),d=2;break}else d=6;i++}return E}function y(){if(n="",d=0,a=i,l=s,c=u,i>=r)return a=r,o=17;var E=t.charCodeAt(i);if(Kb(E)){do i++,n+=String.fromCharCode(E),E=t.charCodeAt(i);while(Kb(E));return o=15}if(Zp(E))return i++,n+=String.fromCharCode(E),E===13&&t.charCodeAt(i)===10&&(i++,n+=`
258
258
  `),s++,u=i,o=14;switch(E){case 123:return i++,o=1;case 125:return i++,o=2;case 91:return i++,o=3;case 93:return i++,o=4;case 58:return i++,o=6;case 44:return i++,o=5;case 34:return i++,n=v(),o=10;case 47:var I=i-1;if(t.charCodeAt(i+1)===47){for(i+=2;i<r&&!Zp(t.charCodeAt(i));)i++;return n=t.substring(I,i),o=12}if(t.charCodeAt(i+1)===42){i+=2;for(var R=r-1,M=!1;i<R;){var T=t.charCodeAt(i);if(T===42&&t.charCodeAt(i+1)===47){i+=2,M=!0;break}i++,Zp(T)&&(T===13&&t.charCodeAt(i)===10&&i++,s++,u=i)}return M||(i++,d=1),n=t.substring(I,i),o=13}return n+=String.fromCharCode(E),i++,o=16;case 45:if(n+=String.fromCharCode(E),i++,i===r||!pc(t.charCodeAt(i)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return n+=g(),o=11;default:for(;i<r&&w(E);)i++,E=t.charCodeAt(i);if(a!==i){switch(n=t.substring(a,i),n){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return n+=String.fromCharCode(E),i++,o=16}}function w(E){if(Kb(E)||Zp(E))return!1;switch(E){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function $(){var E;do E=y();while(E>=12&&E<=15);return E}return{setPosition:h,getPosition:function(){return i},scan:e?$:y,getToken:function(){return o},getTokenValue:function(){return n},getTokenOffset:function(){return a},getTokenLength:function(){return i-a},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return a-c},getTokenError:function(){return d}}}function Kb(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function Zp(t){return t===10||t===13||t===8232||t===8233}function pc(t){return t>=48&&t<=57}function IM(t){if(!t.parent||!t.parent.children)return[];var e=IM(t.parent);if(t.parent.type==="property"){var r=t.parent.children[0].value;e.push(r)}else if(t.parent.type==="array"){var i=t.parent.children.indexOf(t);i!==-1&&e.push(i)}return e}function Zfe(t,e,r){return r===void 0&&(r=!1),e>=t.offset&&e<t.offset+t.length||r&&e===t.offset+t.length}function CM(t,e,r){if(r===void 0&&(r=!1),Zfe(t,e,r)){var i=t.children;if(Array.isArray(i))for(var n=0;n<i.length&&i[n].offset<=e;n++){var a=CM(i[n],e,r);if(a)return a}return t}}function Jfe(t,e,r){r===void 0&&(r=u7.DEFAULT);var i=PM(t,!1);function n(N){return N?function(){return N(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}function a(N){return N?function(j){return N(j,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}var o=n(e.onObjectBegin),s=a(e.onObjectProperty),l=n(e.onObjectEnd),u=n(e.onArrayBegin),c=n(e.onArrayEnd),d=a(e.onLiteralValue),f=a(e.onSeparator),h=n(e.onComment),g=a(e.onError),v=r&&r.disallowComments,y=r&&r.allowTrailingComma;function w(){for(;;){var N=i.scan();switch(i.getTokenError()){case 4:$(14);break;case 5:$(15);break;case 3:$(13);break;case 1:v||$(11);break;case 2:$(12);break;case 6:$(16);break}switch(N){case 12:case 13:v?$(10):h();break;case 16:$(1);break;case 15:case 14:break;default:return N}}}function $(N,j,x){if(j===void 0&&(j=[]),x===void 0&&(x=[]),g(N),j.length+x.length>0)for(var b=i.getToken();b!==17;){if(j.indexOf(b)!==-1){w();break}else if(x.indexOf(b)!==-1)break;b=w()}}function E(N){var j=i.getTokenValue();return N?d(j):s(j),w(),!0}function I(){switch(i.getToken()){case 11:var N=0;try{N=JSON.parse(i.getTokenValue()),typeof N!="number"&&($(2),N=0)}catch{$(2)}d(N);break;case 7:d(null);break;case 8:d(!0);break;case 9:d(!1);break;default:return!1}return w(),!0}function R(){return i.getToken()!==10?($(3,[],[2,5]),!1):(E(!1),i.getToken()===6?(f(":"),w(),O()||$(4,[],[2,5])):$(5,[],[2,5]),!0)}function M(){o(),w();for(var N=!1;i.getToken()!==2&&i.getToken()!==17;){if(i.getToken()===5){if(N||$(4,[],[]),f(","),w(),i.getToken()===2&&y)break}else N&&$(6,[],[]);R()||$(4,[],[2,5]),N=!0}return l(),i.getToken()!==2?$(7,[2],[]):w(),!0}function T(){u(),w();for(var N=!1;i.getToken()!==4&&i.getToken()!==17;){if(i.getToken()===5){if(N||$(4,[],[]),f(","),w(),i.getToken()===4&&y)break}else N&&$(6,[],[]);O()||$(4,[],[4,5]),N=!0}return c(),i.getToken()!==4?$(8,[4],[]):w(),!0}function O(){switch(i.getToken()){case 3:return T();case 1:return M();case 10:return E(!0);default:return I()}}return w(),i.getToken()===17?r.allowEmptyContent?!0:($(4,[],[]),!1):O()?(i.getToken()!==17&&$(9,[],[]),!0):($(4,[],[]),!1)}function Qfe(t){switch(t){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function eme(t,e=Reflect.ownKeys(t)){ame(t);let r=new Proxy(t,LM);return tme(r,e),r}function tme(t,e){return cn in t?(t[cn].length=0,t[cn].push(...e),!0):Reflect.defineProperty(t,cn,{configurable:!0,value:e})}function rme(t){return t[cn]}function c7(t){return t!==null&&typeof t=="object"}function nme(t){if(!c7(t))return!1;if(t[Symbol.toStringTag]!==void 0){let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}return ime(t)==="Object"}function ime(t){let e=t[Symbol.toStringTag];if(typeof e=="string")return e;let r=Reflect.apply(Object.prototype.toString,t,[]);return r.slice(8,r.length-1)}function ame(t,e){if(ome()&&!nme(t))throw new TypeError(e)}function ome(){return typeof process>"u"||!c7(process)||!c7(process.env)?!1:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"}function Al(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||typeof t.constructor=="function"&&Function.toString.call(Object)===Function.toString.call(t.constructor)}function pme(t,e,r){if(!Al(t)&&!Array.isArray(t)||!(e in t))throw new ReferenceError(`Could not resolve '${r}'`)}function p7(t){if(typeof t.$ref!="string")throw new TypeError("$ref should be a string")}function MM(t){return t.replace(KM,encodeURIComponent)}function fme(t){try{return decodeURIComponent(t)}catch{return t}}function zM(t,e,r){V0(t,{onProperty({property:i,propertyValue:n,parent:a}){i==="$ref"&&typeof n=="string"&&n.startsWith(e)&&(a.$ref=`${r}${n.slice(e.length)}`)}})}function qM(t,e){return Al(e)&&Al(t)&&("summary"in t||"description"in t)?Object.assign(Object.assign(Object.assign({},e),"description"in t?{description:t.description}:null),"summary"in t?{summary:t.summary}:null):e}function*FM(t,e,r){lf(t.value)&&(p7(t.value),yield[-1,t.value]);for(let[i,n]of e.entries())pme(t.value,n,r),t.value=t.value[n],lf(t.value)&&(p7(t.value),yield[i,t.value])}function UM(t,e){return VM(t,e).value}function VM(t,e){return(function r(i,n,a,o){if(ev(n)!==null)throw new ReferenceError("Cannot resolve external references");let s=Qi(n),l=[...s];n==="#"&&lf(i)&&(p7(i),s.unshift(...Qi(i.$ref)));let u={value:i};for(let[c,d]of FM(u,s,n)){if(a.includes(d))return{source:null,location:o??l,value:a[a.length-1]};a.push(d);let f=r(i,d.$ref,a,l);u.value=f.value,(l=f.location).push(...s.slice(c+1))}return{source:null,location:l,value:a.length>0?qM(a[a.length-1],u.value):u.value}})(t,e,[])}function mme(t){return tv(t.split("/").pop()||"")}function BM(t,e=[],r){let i=iz(t),n={type:"array",offset:-1,length:-1,children:[],parent:void 0},a=null,o=[],s=new WeakMap,l=[];function u(y){n.type==="property"&&(n.length=y-n.offset,n=n.parent)}function c(y,w,$){return{start:{line:y,character:w},end:{line:y,character:w+$}}}function d(y){return n.children.push(y),y}function f(y){Array.isArray(o)?o.push(y):a!==null&&(o[a]=y)}function h(y){f(y),l.push(o),o=y,a=null}function g(){o=l.pop()}NM(t,{onObjectBegin:(y,w,$,E)=>{n=d({type:"object",offset:y,length:-1,parent:n,children:[],range:c($,E,w)}),r.ignoreDuplicateKeys===!1&&s.set(n,[]),h((function(I){return I?eme({}):{}})(r.preserveKeyOrder===!0))},onObjectProperty:(y,w,$,E,I)=>{if((n=d({type:"property",offset:w,length:-1,parent:n,children:[]})).children.push({type:"string",value:y,offset:w,length:$,parent:n}),r.ignoreDuplicateKeys===!1){let R=s.get(n.parent);R&&(R.length!==0&&R.includes(y)?e.push({range:c(E,I,$),message:"DuplicateKey",severity:q0.Error,path:GM(n),code:20}):R.push(y))}r.preserveKeyOrder===!0&&(function(R,M){if(!(M in R))return;let T=rme(R),O=T.indexOf(M);O!==-1&&(T.splice(O,1),T.push(M))})(o,y),a=y},onObjectEnd:(y,w,$,E)=>{r.ignoreDuplicateKeys===!1&&s.delete(n),n.length=y+w-n.offset,n.range&&(n.range.end.line=$,n.range.end.character=E+w),n=n.parent,u(y+w),g()},onArrayBegin:(y,w,$,E)=>{n=d({type:"array",offset:y,length:-1,parent:n,children:[],range:c($,E,w)}),h([])},onArrayEnd:(y,w,$,E)=>{n.length=y+w-n.offset,n.range&&(n.range.end.line=$,n.range.end.character=E+w),n=n.parent,u(y+w),g()},onLiteralValue:(y,w,$,E,I)=>{d({type:hme(y),offset:w,length:$,parent:n,value:y,range:c(E,I,$)}),u(w+$),f(y)},onSeparator:(y,w)=>{n.type==="property"&&(y===":"?n.colonOffset=w:y===","&&u(w))},onError:(y,w,$,E,I)=>{e.push({range:c(E,I,$),message:Qfe(y),severity:q0.Error,code:y})}},r);let v=n.children[0];return v&&delete v.parent,{ast:v,data:o[0],lineMap:i}}function hme(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}function GM(t,e=[]){return t.type==="property"&&e.unshift(t.children[0].value),t.parent!==void 0?(t.parent.type==="array"&&t.parent.parent!==void 0&&e.unshift(t.parent.children.indexOf(t)),GM(t.parent,e)):e}function w0(t){return Al(t)||Array.isArray(t)}function gme(t,e,r){if(r.length<=1||e.length<=1)throw Error("Source/target path must not be empty and point at root");if(e.indexOf(r)===0)throw Error("Target path cannot be contained within source");let i=Qi(e),n=t;for(let s of i){if(!w0(n))return;n=n[s]}if(!w0(n))return;let a=Qi(r),o=t;for(let[s,l]of a.entries()){if(!w0(o)||l in o)return;let u=s===a.length-1?n:{};o[l]=u,o=u}delete t[i[0]],(function s(l,u,c){for(let d of Object.keys(l)){let f=l[d];if(d!=="$ref")w0(f)&&s(f,u,c);else{if(typeof f!="string"||!F0(f))continue;f.indexOf(u)===0&&(l[d]=f.replace(u,c))}}})(t,e,r)}async function WM(t,e,r,i,n){let a=(function(d,f){let h=ev(f);return h===null?d:bM(h)?h:X0(C7(d),h)})(e,r),o=T7(r)||"#",s=await t[a],l=Qi(o),u=[...l],c={value:s};for(let[d,f]of FM(c,l,o)){if(i.includes(f))return{source:e,location:n??u,value:i[i.length-1]};i.push(f);let h=await WM(t,a,f.$ref,i,u);({source:a,location:u}=h),c.value=h.value,u.push(...l.slice(d+1))}return{source:a,location:u,value:i.length>0?qM(i[i.length-1],c.value):c.value}}async function vme(t,e,r){return(await HM(t,e,r)).value}function HM(t,e,r){return WM(t,e,r,[])}function yme(t){return t.replace(/^(\/|#\/)/,"").split("/").map(tv).map(_me).join(".")}function _me(t){return t.includes(".")?`["${t.replace(/"/g,'\\"')}"]`:t}function wme(t,e){if(typeof t=="string"&&typeof e=="string")return(0,un.trimStart)(t,e);if(!(t&&Array.isArray(t)&&t.length&&e&&Array.isArray(e)&&e.length))return t;let r=0;for(let i in t)if(t.hasOwnProperty(i)){if(t[i]!==e[i])break;r++}return t.slice(r)}function Xme(t,e){j0(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function e1e(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function t1e(t,e,r,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a}function r1e(t,e){return function(r,i){e(r,i,t)}}function n1e(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function i1e(t,e,r,i){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(i.next(c))}catch(d){o(d)}}function l(c){try{u(i.throw(c))}catch(d){o(d)}}function u(c){c.done?a(c.value):n(c.value).then(s,l)}u((i=i.apply(t,e||[])).next())})}function a1e(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(a=u[0]&2?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,n=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(c){u=[6,c],n=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function o1e(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function s1e(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function _7(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function gz(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,a=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function l1e(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(gz(arguments[e]));return t}function u1e(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,n++)i[n]=a[o];return i}function uf(t){return this instanceof uf?(this.v=t,this):new uf(t)}function c1e(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,a=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(f){i[f]&&(n[f]=function(h){return new Promise(function(g,v){a.push([f,h,g,v])>1||s(f,h)})})}function s(f,h){try{l(i[f](h))}catch(g){d(a[0][3],g)}}function l(f){f.value instanceof uf?Promise.resolve(f.value.v).then(u,c):d(a[0][2],f)}function u(f){s("next",f)}function c(f){s("throw",f)}function d(f,h){f(h),a.shift(),a.length&&s(a[0][0],a[0][1])}}function d1e(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=t[n]?function(o){return(r=!r)?{value:uf(t[n](o)),done:n==="return"}:a?a(o):o}:a}}function p1e(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof _7=="function"?_7(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(a){r[a]=t[a]&&function(o){return new Promise(function(s,l){o=t[a](o),n(s,l,o.done,o.value)})}}function n(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}function f1e(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function m1e(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function h1e(t){return t&&t.__esModule?t:{default:t}}function g1e(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function v1e(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}function En(t,e,r){Error.call(this,t),this.message=t,this.type=e,r&&(this.code=this.errno=r.code),Error.captureStackTrace(this,this.constructor)}function hn(t){var e=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.size;let n=i===void 0?0:i;var a=r.timeout;let o=a===void 0?0:a;t==null?t=null:yz(t)?t=Buffer.from(t.toString()):mf(t)||Buffer.isBuffer(t)||(Object.prototype.toString.call(t)==="[object ArrayBuffer]"?t=Buffer.from(t):ArrayBuffer.isView(t)?t=Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof ya||(t=Buffer.from(String(t)))),this[Ua]={body:t,disturbed:!1,error:null},this.size=n,this.timeout=o,t instanceof ya&&t.on("error",function(s){let l=s.name==="AbortError"?s:new En(`Invalid response body while trying to fetch ${e.url}: ${s.message}`,"system",s);e[Ua].error=l})}function fc(){var t=this;if(this[Ua].disturbed)return hn.Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[Ua].disturbed=!0,this[Ua].error)return hn.Promise.reject(this[Ua].error);let e=this.body;if(e===null)return hn.Promise.resolve(Buffer.alloc(0));if(mf(e)&&(e=e.stream()),Buffer.isBuffer(e))return hn.Promise.resolve(e);if(!(e instanceof ya))return hn.Promise.resolve(Buffer.alloc(0));let r=[],i=0,n=!1;return new hn.Promise(function(a,o){let s;t.timeout&&(s=setTimeout(function(){n=!0,o(new En(`Response timeout while trying to fetch ${t.url} (over ${t.timeout}ms)`,"body-timeout"))},t.timeout)),e.on("error",function(l){l.name==="AbortError"?(n=!0,o(l)):o(new En(`Invalid response body while trying to fetch ${t.url}: ${l.message}`,"system",l))}),e.on("data",function(l){if(!(n||l===null)){if(t.size&&i+l.length>t.size){n=!0,o(new En(`content size at ${t.url} over limit: ${t.size}`,"max-size"));return}i+=l.length,r.push(l)}}),e.on("end",function(){if(!n){clearTimeout(s);try{a(Buffer.concat(r,i))}catch(l){o(new En(`Could not create Buffer from response body for ${t.url}: ${l.message}`,"system",l))}}})})}function A1e(t,e){if(typeof w7!="function")throw new Error("The package `encoding` must be installed to use the textConverted() function");let r=e.get("content-type"),i="utf-8",n,a;return r&&(n=/charset=([^;]*)/i.exec(r)),a=t.slice(0,1024).toString(),!n&&a&&(n=/<meta.+?charset=(['"])(.+?)\1/i.exec(a)),!n&&a&&(n=/<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(a),n||(n=/<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(a),n&&n.pop()),n&&(n=/charset=(.*)/i.exec(n.pop()))),!n&&a&&(n=/<\?xml.+?encoding=(['"])(.+?)\1/i.exec(a)),n&&(i=n.pop(),(i==="gb2312"||i==="gbk")&&(i="gb18030")),w7(t,"UTF-8",i).toString()}function yz(t){return typeof t!="object"||typeof t.append!="function"||typeof t.delete!="function"||typeof t.get!="function"||typeof t.getAll!="function"||typeof t.has!="function"||typeof t.set!="function"?!1:t.constructor.name==="URLSearchParams"||Object.prototype.toString.call(t)==="[object URLSearchParams]"||typeof t.sort=="function"}function mf(t){return typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&typeof t.constructor.name=="string"&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}function hL(t){let e,r,i=t.body;if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof ya&&typeof i.getBoundary!="function"&&(e=new b7,r=new b7,i.pipe(e),i.pipe(r),t[Ua].body=e,i=r),i}function gL(t){return t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":yz(t)?"application/x-www-form-urlencoded;charset=UTF-8":mf(t)?t.type||null:Buffer.isBuffer(t)||Object.prototype.toString.call(t)==="[object ArrayBuffer]"||ArrayBuffer.isView(t)?null:typeof t.getBoundary=="function"?`multipart/form-data;boundary=${t.getBoundary()}`:t instanceof ya?null:"text/plain;charset=UTF-8"}function _z(t){let e=t.body;return e===null?0:mf(e)?e.size:Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&(e._lengthRetrievers&&e._lengthRetrievers.length==0||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}function P1e(t,e){let r=e.body;r===null?t.end():mf(r)?r.stream().pipe(t):Buffer.isBuffer(r)?(t.write(r),t.end()):r.pipe(t)}function Jp(t){if(t=`${t}`,z7.test(t)||t==="")throw new TypeError(`${t} is not a legal HTTP header name`)}function vL(t){if(t=`${t}`,B0.test(t))throw new TypeError(`${t} is not a legal HTTP header value`)}function mc(t,e){e=e.toLowerCase();for(let r in t)if(r.toLowerCase()===e)return r}function Jb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key+value";return Object.keys(t[Hr]).sort().map(e==="key"?function(i){return i.toLowerCase()}:e==="value"?function(i){return t[Hr][i].join(", ")}:function(i){return[i.toLowerCase(),t[Hr][i].join(", ")]})}function Yb(t,e){let r=Object.create(D0);return r[R0]={target:t,kind:e,index:0},r}function O1e(t){let e=Object.assign({__proto__:null},t[Hr]),r=mc(t[Hr],"Host");return r!==void 0&&(e[r]=e[r][0]),e}function I1e(t){let e=new ga;for(let r of Object.keys(t))if(!z7.test(r))if(Array.isArray(t[r]))for(let i of t[r])B0.test(i)||(e[Hr][r]===void 0?e[Hr][r]=[i]:e[Hr][r].push(i));else B0.test(t[r])||(e[Hr][r]=[t[r]]);return e}function Qb(t){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(t)&&(t=new wz(t).toString()),bz(t)}function S0(t){return typeof t=="object"&&typeof t[za]=="object"}function C1e(t){let e=t&&typeof t=="object"&&Object.getPrototypeOf(t);return!!(e&&e.constructor.name==="AbortSignal")}function j1e(t){let e=t[za].parsedURL,r=new ga(t[za].headers);if(r.has("Accept")||r.set("Accept","*/*"),!e.protocol||!e.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(t.signal&&t.body instanceof ya.Readable&&!Sz)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let i=null;if(t.body==null&&/^(POST|PUT)$/i.test(t.method)&&(i="0"),t.body!=null){let a=_z(t);typeof a=="number"&&(i=String(a))}i&&r.set("Content-Length",i),r.has("User-Agent")||r.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip,deflate");let n=t.agent;return typeof n=="function"&&(n=n(e)),Object.assign({},e,{method:t.method,headers:O1e(r),agent:n})}function vc(t){Error.call(this,t),this.type="aborted",this.message=t,Error.captureStackTrace(this,this.constructor)}function ws(t,e){if(!ws.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return hn.Promise=ws.Promise,new ws.Promise(function(r,i){let n=new $l(t,e),a=j1e(n),o=(a.protocol==="https:"?E1e:vz).request,s=n.signal,l=null,u=function(){let v=new vc("The user aborted a request.");i(v),n.body&&n.body instanceof ya.Readable&&Xb(n.body,v),!(!l||!l.body)&&l.body.emit("error",v)};if(s&&s.aborted){u();return}let c=function(){u(),h()},d=o(a),f;s&&s.addEventListener("abort",c);function h(){d.abort(),s&&s.removeEventListener("abort",c),clearTimeout(f)}n.timeout&&d.once("socket",function(g){f=setTimeout(function(){i(new En(`network timeout at: ${n.url}`,"request-timeout")),h()},n.timeout)}),d.on("error",function(g){i(new En(`request to ${n.url} failed, reason: ${g.message}`,"system",g)),l&&l.body&&Xb(l.body,g),h()}),T1e(d,function(g){s&&s.aborted||l&&l.body&&Xb(l.body,g)}),parseInt(process.version.substring(1))<14&&d.on("socket",function(g){g.addListener("close",function(v){let y=g.listenerCount("data")>0;if(l&&y&&!v&&!(s&&s.aborted)){let w=new Error("Premature close");w.code="ERR_STREAM_PREMATURE_CLOSE",l.body.emit("error",w)}})}),d.on("response",function(g){clearTimeout(f);let v=I1e(g.headers);if(ws.isRedirect(g.statusCode)){let I=v.get("Location"),R=null;try{R=I===null?null:new hc(I,n.url).toString()}catch{if(n.redirect!=="manual"){i(new En(`uri requested responds with an invalid redirect URL: ${I}`,"invalid-redirect")),h();return}}switch(n.redirect){case"error":i(new En(`uri requested responds with a redirect, redirect mode is set to error: ${n.url}`,"no-redirect")),h();return;case"manual":if(R!==null)try{v.set("Location",R)}catch(T){i(T)}break;case"follow":if(R===null)break;if(n.counter>=n.follow){i(new En(`maximum redirect reached at: ${n.url}`,"max-redirect")),h();return}let M={headers:new ga(n.headers),follow:n.follow,counter:n.counter+1,agent:n.agent,compress:n.compress,method:n.method,body:n.body,signal:n.signal,timeout:n.timeout,size:n.size};if(!kz(n.url,R)||!xz(n.url,R))for(let T of["authorization","www-authenticate","cookie","cookie2"])M.headers.delete(T);if(g.statusCode!==303&&n.body&&_z(n)===null){i(new En("Cannot follow redirect with body being a readable stream","unsupported-redirect")),h();return}(g.statusCode===303||(g.statusCode===301||g.statusCode===302)&&n.method==="POST")&&(M.method="GET",M.body=void 0,M.headers.delete("content-length")),r(ws(new $l(R,M))),h();return}}g.once("end",function(){s&&s.removeEventListener("abort",c)});let y=g.pipe(new S7),w={url:n.url,status:g.statusCode,statusText:g.statusMessage,headers:v,size:n.size,timeout:n.timeout,counter:n.counter},$=v.get("Content-Encoding");if(!n.compress||n.method==="HEAD"||$===null||g.statusCode===204||g.statusCode===304){l=new va(y,w),r(l);return}let E={flush:bl.Z_SYNC_FLUSH,finishFlush:bl.Z_SYNC_FLUSH};if($=="gzip"||$=="x-gzip"){y=y.pipe(bl.createGunzip(E)),l=new va(y,w),r(l);return}if($=="deflate"||$=="x-deflate"){let I=g.pipe(new S7);I.once("data",function(R){(R[0]&15)===8?y=y.pipe(bl.createInflate()):y=y.pipe(bl.createInflateRaw()),l=new va(y,w),r(l)}),I.on("end",function(){l||(l=new va(y,w),r(l))});return}if($=="br"&&typeof bl.createBrotliDecompress=="function"){y=y.pipe(bl.createBrotliDecompress()),l=new va(y,w),r(l);return}l=new va(y,w),r(l)}),P1e(d,n)})}function T1e(t,e){let r;t.on("socket",function(i){r=i}),t.on("response",function(i){let n=i.headers;n["transfer-encoding"]==="chunked"&&!n["content-length"]&&i.once("close",function(a){if(r&&r.listenerCount("data")>0&&!a){let s=new Error("Premature close");s.code="ERR_STREAM_PREMATURE_CLOSE",e(s)}})})}function Xb(t,e){t.destroy?t.destroy(e):(t.emit("error",e),t.end())}function Ps(t){let e=t.allOf;if(!Array.isArray(e))return _2e(t);let r={},i=[],n={};for(let o of e){if(typeof o!="object"||o===null||Array.isArray(o))continue;let s=Ps(o);s.properties&&typeof s.properties=="object"&&(r={...r,...s.properties}),Array.isArray(s.required)&&(i=[...i,...s.required]);for(let[l,u]of Object.entries(s))l!=="properties"&&l!=="required"&&l!=="allOf"&&(n[l]=u)}for(let[o,s]of Object.entries(t))o!=="allOf"&&(o==="properties"&&typeof s=="object"?r={...r,...s}:o==="required"&&Array.isArray(s)?i=[...i,...s]:n[o]=s);let a={...n};return Object.keys(r).length>0&&(a.properties=SF(r)),i.length>0&&(a.required=[...new Set(i)]),a}function _2e(t){let e=t.properties;return!e||typeof e!="object"?t:{...t,properties:SF(e)}}function SF(t){let e={};for(let[r,i]of Object.entries(t))if(i&&typeof i=="object"&&!Array.isArray(i)){let n=i;e[r]=n.allOf?Ps(n):n}else e[r]=i;return e}function Ss(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function $F(t){return Ss(t)&&"$ref"in t&&typeof t.$ref=="string"}function H0(t){if(typeof t!="object"||t===null)return t;if(Array.isArray(t))return t.map(H0);let e={};for(let[r,i]of Object.entries(t))e[r]=H0(i);return e}function EF(t,e){let i=e.slice(2).split("/").map(a=>a.replace(/~1/g,"/").replace(/~0/g,"~")),n=t;for(let a of i){if(!Ss(n))throw new Kr(`Cannot resolve JSON Pointer "${e}": path segment "${a}" is not an object`);if(n=n[a],n===void 0)return{found:!1}}return{found:!0,value:n}}function AF(t,e){let r=EF(t,e);if(!r.found)throw new Kr(`Cannot resolve JSON Pointer "${e}": target not found`);return r.value}function O2e(t){if(!("$refs"in t))return!1;let e=t.$refs;return Array.isArray(e)&&e.every(r=>typeof r=="string")}async function mv(t){let e;try{e=await $2e(t,"utf8")}catch{throw new Kr(`File not found: ${t}`,t)}try{return(0,xF.parse)(e)}catch(r){let i=r instanceof Error?r.message:String(r);throw new Kr(`Invalid YAML syntax in ${t}: ${i}`,t)}}function K0(t,e,r){let i={...t};for(let[n,a]of Object.entries(e)){let o=i[n];if(o===void 0)i[n]=a;else if(Ss(o)&&Ss(a))i[n]=K0(o,a,r);else throw new Kr(`Conflicting value for key "${n}" while merging $refs from ${r}`,r)}return i}async function I2e(t,e,r){let i=mS(e,t),n=await kF(i).catch(()=>null);if(n?.isDirectory()){if(r.has(i))throw new Kr(`Circular $refs detected: ${i}`,i);r.add(i);let s=await PF(i,r);return r.delete(i),s}if(!n?.isFile())throw new Kr(`File not found: ${i}`,i);if(r.has(i))throw new Kr(`Circular $refs detected: ${i}`,i);r.add(i);let a=await mv(i);if(!Ss(a))throw new Kr(`Expected YAML object in ${i}, got ${Array.isArray(a)?"array":typeof a}`,i);let o=await El(a,fS(i),r,a);return r.delete(i),o}async function PF(t,e){let r;try{r=await E2e(t)}catch{throw new Kr(`Cannot read directory: ${t}`,t)}let i=r.filter(a=>[".yaml",".yml"].includes(P2e(a))).sort();if(i.length===0)throw new Kr(`No YAML files found in directory: ${t}`,t);let n={};for(let a of i){let o=A2e(t,a),s=await mv(o);if(!Ss(s))throw new Kr(`Expected YAML object in ${o}, got ${Array.isArray(s)?"array":typeof s}`,o);let l=await El(s,t,e,s);n=K0(n,l,o)}return n}async function C2e(t,e,r){let i=t.$refs,n={};for(let[o,s]of Object.entries(t))o!=="$refs"&&(n[o]=s);let a={};for(let o of i){let s=await I2e(o,e,r);a=K0(a,s,o)}return a=K0(a,n,"(inline)"),a}async function El(t,e,r,i){if(typeof t!="object"||t===null)return t;if(Array.isArray(t))return Promise.all(t.map(o=>El(o,e,r,i)));if($F(t)){let o=t.$ref;if(o.startsWith("#/")){if(r.has(o))throw new Kr(`Circular $ref detected: ${o}`);let v=EF(i,o);if(!v.found)return t;r.add(o);let y=await El(H0(v.value),e,r,i);return r.delete(o),y}let s=o.indexOf("#"),l=s>=0?o.slice(0,s):o,u=s>=0?o.slice(s):null,c=mS(e,l),d=await kF(c).catch(()=>null);if(d?.isDirectory()){if(u)throw new Kr(`Cannot use JSON Pointer fragment with directory $ref: ${o}`,c);if(r.has(c))throw new Kr(`Circular $ref detected: ${c}`,c);r.add(c);let v=await PF(c,r);return r.delete(c),v}if(!d?.isFile())throw new Kr(`File not found: ${c}`,c);if(r.has(c))throw new Kr(`Circular $ref detected: ${c}`,c);r.add(c);let f=await mv(c),h=Ss(f)?f:i,g=await El(f,fS(c),r,h);if(r.delete(c),u&&u.startsWith("#/")){if(!Ss(g))throw new Kr(`Cannot resolve fragment "${u}" in ${c}: file content is not an object`,c);g=AF(g,u)}return g}let n=t;O2e(n)&&(n=await C2e(n,e,r));let a={};for(let[o,s]of Object.entries(n))a[o]=await El(s,e,r,i);return a}function L0(t,e){if(typeof t!="object"||t===null)return t;if(Array.isArray(t))return t.map(n=>L0(n,e));if($F(t)){let n=t.$ref;if(n.startsWith("#/")){let a=AF(e,n);return L0(H0(a),e)}return t}let r=t,i={};for(let[n,a]of Object.entries(r))i[n]=L0(a,e);return i}function j2e(t,e){let r=t.version;if(r===void 0)throw new Kr(`Missing DSL version in ${e}: expected version: 1`,e);if(r!==1)throw new Kr(`Unsupported DSL version in ${e}: expected 1, got ${JSON.stringify(r)}`,e)}async function cf(t){let e=mS(t),r=await mv(e);if(typeof r!="object"||r===null)throw new Kr(`Expected YAML object in ${e}, got ${typeof r}`,e);let i=r;j2e(i,e);let n=fS(e),a=await El(i,n,new Set([e]),i);return{data:L0(a,a),filePath:e}}async function IF(t){let e=["agent-contracts.yaml","agent-contracts.yml"];for(let r of e){let i=R2e(t,r);try{if((await OF(i)).isFile())return i}catch{continue}}throw new bf(`No agent-contracts.yaml found in directory: ${t}`)}async function D2e(t,e){let r=T2e(e,t),i=await OF(r).catch(()=>null);if(i?.isDirectory()){let n=await IF(r);return cf(n)}if(i?.isFile())return cf(r);throw new bf(`Base path not found: ${r}`)}async function N2e(t){try{let e=import.meta.resolve(t),r=new URL(".",e).pathname,i=await IF(r);return cf(i)}catch{throw new bf(`Could not resolve package: ${t}. Is it installed?`)}}async function CF(t,e){return t.startsWith("./")||t.startsWith("../")?D2e(t,e):N2e(t)}function ji(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Pl(t,e){let r=["$append","$prepend","$insert_after","$replace","$remove"],i=[];for(let n of r)n in t&&i.push(n);if(i.length>1)throw new _a(`Multiple merge operators in the same object at ${e??"unknown"}: ${i.join(", ")}`);return i.length===1?i[0]:null}function L2e(t,e){return t.findIndex(r=>typeof r=="string"?r===e:ji(r)&&r.id===e)}function A7(t,e,r){let i=Pl(e,r);if(!i)return t;switch(i){case"$append":{let n=e.$append;return[...t,...n]}case"$prepend":return[...e.$prepend,...t];case"$insert_after":{let n=e.$insert_after,a=n.target,o=n.items,s=L2e(t,a);if(s===-1)throw new _a(`$insert_after target "${a}" not found in base at ${r}`);let l=[...t];return l.splice(s+1,0,...o),l}case"$replace":return e.$replace;case"$remove":{let n=e.$remove;if(n.length===0)return t;if(typeof n[0]=="string"){let s=new Set(n),l=t.filter(u=>typeof u=="string"&&s.has(u)?(s.delete(u),!1):!0);if(s.size>0)throw new _a(`$remove values not found in base at ${r}: ${[...s].join(", ")}`);return l}let a=new Set(n.map(s=>s.id)),o=t.filter(s=>{if(ji(s)&&typeof s.id=="string"){let l=s.id;if(a.has(l))return a.delete(l),!1}return!0});if(a.size>0)throw new _a(`$remove ids not found in base at ${r}: ${[...a].join(", ")}`);return o}default:return t}}function M2e(t,e,r){let i=new Set(Object.keys(r)),n={},a=!1;for(let o of Object.keys(t))if(!(a&&i.has(o))&&(n[o]=t[o],o===e)){for(let[s,l]of Object.entries(r))n[s]=l;a=!0}return n}function hS(t,e,r){let i=Pl(e,r);if(!i)return t;switch(i){case"$append":{let n=e.$append;return{...t,...n}}case"$prepend":return{...e.$prepend,...t};case"$insert_after":{let n=e.$insert_after,a=n.after,o=n.entries;if(!(a in t))throw new _a(`$insert_after key "${a}" not found in base at ${r}`);return M2e(t,a,o)}case"$replace":return e.$replace;case"$remove":{let n=e.$remove,a=new Set(n),o=n.filter(l=>!(l in t));if(o.length>0)throw new _a(`$remove keys not found in base at ${r}: ${o.join(", ")}`);let s={};for(let[l,u]of Object.entries(t))a.has(l)||(s[l]=u);return s}default:return t}}function gS(t,e,r,i){let n={...t};for(let a of Object.keys(e)){let o=n[a],s=e[a];if(ji(s)&&Pl(s,`${r}.${a}`)){if(!i)throw new _a(`Merge operator used without extends at ${r}.${a}`);Array.isArray(o)?n[a]=A7(o,s,`${r}.${a}`):ji(o)?n[a]=hS(o,s,`${r}.${a}`):Pl(s,`${r}.${a}`)==="$replace"?n[a]=s.$replace:n[a]=A7([],s,`${r}.${a}`)}else ji(s)&&ji(o)&&!Array.isArray(s)&&!Array.isArray(o)?n[a]=gS(o,s,`${r}.${a}`,i):n[a]=s}return n}function jF(t,e,r,i,n){switch(n){case"map":{let a=ji(t)?t:{};return q2e(a,e,r,i)}case"array":{let a=Array.isArray(t)?t:[];if(ji(e)&&Pl(e,r)){if(!i)throw new _a(`Merge operator used without extends at ${r}`);return A7(a,e,r)}let o=Array.isArray(e)?e:[];return[...a,...o]}case"object":{let a=ji(t)?t:{},o=ji(e)?e:{};if(Pl(o,r)){if(!i)throw new _a(`Merge operator used without extends at ${r}`);return hS(a,o,r)}return gS(a,o,r,i)}}}function q2e(t,e,r,i){let n;if(ji(e)&&!Array.isArray(e))if(Pl(e,r)){if(!i)throw new _a(`Merge operator used without extends at ${r}`);n=hS(t,e,r)}else n={...t};else n={...t};for(let[a,o]of Object.entries(e)){if(z2e.has(a))continue;let s=n[a];if(ji(o)&&!Array.isArray(o)){let l=ji(s)?s:{};n[a]=gS(l,o,`${r}.${a}`,i)}else n[a]=o}return n}function TF(t,e){let r=typeof e.extends=="string",i={...t,...e};for(let[n,a]of Object.entries(F2e))e[n]!==void 0&&(i[n]=jF(t[n],e[n],n,r,a));return delete i.extends,i}function ys(t){return Array.isArray(t)?t:[]}function xL(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)?t:{}}function $L(t){return Array.isArray(t)?t:[]}function _s(t){return t==null}function B2e(t,e){let r={...e};r.artifact_bindings={...xL(t.artifact_bindings),...xL(e.artifact_bindings)},_s(e.kind)&&!_s(t.kind)&&(r.kind=t.kind),_s(e.cli_contract)&&!_s(t.cli_contract)&&(r.cli_contract=t.cli_contract),_s(e.description)&&!_s(t.description)&&(r.description=t.description);let i=ys(e.invokable_by),n=ys(t.invokable_by);i.length===0&&n.length>0&&(r.invokable_by=[...n]);let a=ys(e.input_artifacts),o=ys(t.input_artifacts);a.length===0&&o.length>0&&(r.input_artifacts=[...o]);let s=ys(e.output_artifacts),l=ys(t.output_artifacts);s.length===0&&l.length>0&&(r.output_artifacts=[...l]);let u=ys(e.side_effects),c=ys(t.side_effects);u.length===0&&c.length>0&&(r.side_effects=[...c]);let d=$L(e.commands),f=$L(t.commands);return d.length===0&&f.length>0&&(r.commands=[...f]),_s(e.guardrails)&&!_s(t.guardrails)&&(r.guardrails=t.guardrails),r}function RF(t,e,r,i){let n=i.get(t);if(n!==void 0)return n;let a=e[t];if(a===void 0)throw new kL(`Tool "${t}" not found`);let o=a.extends;if(o===void 0)return i.set(t,a),a;if(r.has(t))throw new kL(`Circular tool extends detected involving "${t}"`);if(e[o]===void 0)return i.set(t,a),a;r.add(t);try{let l=RF(o,e,r,i),u=B2e(l,a);return i.set(t,u),u}finally{r.delete(t)}}function DF(t){let e=new Map,r={};for(let i of Object.keys(t))r[i]=RF(i,t,new Set,e);return r}async function NF(t,e,r){let i=t.extends;if(typeof i!="string")return{data:t,basePaths:[]};let n=U2e(e),a=await CF(i,n),o=a.filePath;if(r.has(o))throw new bf(`Circular extends detected: ${o}`);r.add(o);let{data:s,basePaths:l}=await NF(a.data,o,r);return{data:TF(s,t),basePaths:[...l,o]}}async function G2e(t){let e=V2e(t),r=await cf(e),{data:i,basePaths:n}=await NF(r.data,r.filePath,new Set),a=i.tools;return a!=null&&typeof a=="object"&&!Array.isArray(a)&&(i.tools=DF(a)),{data:i,projectPath:r.filePath,basePaths:n}}function W2e(t){let e=W0.safeParse(t);return e.success?JSON.parse(JSON.stringify(e.data)):t}function M0(t){return t instanceof C.ZodOptional?M0(t.unwrap()):t instanceof C.ZodDefault?M0(t.removeDefault()):t instanceof C.ZodNullable?M0(t.unwrap()):t}function af(t,e,r){let i=M0(e);if(i instanceof C.ZodObject){if(typeof t!="object"||t===null||Array.isArray(t))return[];let n=t,a=i.shape,o=new Set(Object.keys(a)),s=[];for(let l of Object.keys(n))o.has(l)||l.startsWith("x-")||s.push({path:r?`${r}.${l}`:l,message:`Unknown property "${l}". Custom properties must use "x-" prefix.`,code:"unknown-property"});for(let[l,u]of Object.entries(a))n[l]!==void 0&&s.push(...af(n[l],u,r?`${r}.${l}`:l));return s}if(i instanceof C.ZodRecord){if(typeof t!="object"||t===null||Array.isArray(t))return[];let n=i._def.valueType,a=[];for(let[o,s]of Object.entries(t))a.push(...af(s,n,r?`${r}.${o}`:o));return a}if(i instanceof C.ZodArray){if(!Array.isArray(t))return[];let n=[];for(let a=0;a<t.length;a++)n.push(...af(t[a],i.element,`${r}[${a}]`));return n}if(i instanceof C.ZodDiscriminatedUnion){if(typeof t!="object"||t===null)return[];let n=t,a=i._def.discriminator,o=n[a],s=i.options.find(l=>{let u=l.shape;return u[a]instanceof C.ZodLiteral&&u[a].value===o});return s?af(t,s,r):[]}return[]}function H2e(t){let e=t.extensions;if(typeof e!="object"||e===null)return[];let r=[];for(let i of Object.keys(e))i.startsWith("x-")||r.push({path:`extensions.${i}`,message:`Extension key "${i}" must start with "x-" prefix.`,code:"x-extension-key-prefix"});return r}function K2e(t){let e=t.workflow;if(typeof e!="object"||e===null)return[];let r=[];for(let[i,n]of Object.entries(e)){if(typeof n!="object"||n===null)continue;let a=n.steps;if(Array.isArray(a))for(let o=0;o<a.length;o++){let s=a[o];if(typeof s!="object"||s===null)continue;let l=s;l.type==="decision"&&l.routing_key===void 0&&l.on===void 0&&r.push({path:`workflow.${i}.steps[${o}]`,message:'Decision step requires "routing_key" (or deprecated "on"). Prefer "routing_key".',code:"decision-missing-routing-key"})}}return r}function St(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function*Z2e(t,e){switch(e){case"root":yield{path:"",obj:t};return;case"system":{let r=t.system;St(r)&&(yield{path:"system",obj:r});return}case"agent":{let r=t.agents;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`agents.${i}`,obj:n});return}case"rule":{let r=t.agents;if(!St(r))return;for(let[i,n]of Object.entries(r)){if(!St(n))continue;let a=n.rules;if(Array.isArray(a))for(let o=0;o<a.length;o++){let s=a[o];St(s)&&(yield{path:`agents.${i}.rules[${o}]`,obj:s})}}return}case"escalation_criterion":{let r=t.agents;if(!St(r))return;for(let[i,n]of Object.entries(r)){if(!St(n))continue;let a=n.escalation_criteria;if(Array.isArray(a))for(let o=0;o<a.length;o++){let s=a[o];St(s)&&(yield{path:`agents.${i}.escalation_criteria[${o}]`,obj:s})}}return}case"prerequisite":{let r=t.agents;if(!St(r))return;for(let[i,n]of Object.entries(r)){if(!St(n))continue;let a=n.prerequisites;if(Array.isArray(a))for(let o=0;o<a.length;o++){let s=a[o];St(s)&&(yield{path:`agents.${i}.prerequisites[${o}]`,obj:s})}}return}case"task":{let r=t.tasks;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`tasks.${i}`,obj:n});return}case"execution_step":{let r=t.tasks;if(!St(r))return;for(let[i,n]of Object.entries(r)){if(!St(n))continue;let a=n.execution_steps;if(Array.isArray(a))for(let o=0;o<a.length;o++){let s=a[o];St(s)&&(yield{path:`tasks.${i}.execution_steps[${o}]`,obj:s})}}return}case"artifact":{let r=t.artifacts;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`artifacts.${i}`,obj:n});return}case"tool":{let r=t.tools;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`tools.${i}`,obj:n});return}case"tool_command":{let r=t.tools;if(!St(r))return;for(let[i,n]of Object.entries(r)){if(!St(n))continue;let a=n.commands;if(Array.isArray(a))for(let o=0;o<a.length;o++){let s=a[o];St(s)&&(yield{path:`tools.${i}.commands[${o}]`,obj:s})}}return}case"validation":{let r=t.validations;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`validations.${i}`,obj:n});return}case"handoff_type":{let r=t.handoff_types;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`handoff_types.${i}`,obj:n});return}case"workflow":{let r=t.workflow;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`workflow.${i}`,obj:n});return}case"workflow_step":{let r=t.workflow;if(!St(r))return;for(let[i,n]of Object.entries(r)){if(!St(n))continue;let a=n.steps;if(Array.isArray(a))for(let o=0;o<a.length;o++){let s=a[o];St(s)&&(yield{path:`workflow.${i}.steps[${o}]`,obj:s})}}return}case"policy":{let r=t.policies;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`policies.${i}`,obj:n});return}case"guardrail":{let r=t.guardrails;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`guardrails.${i}`,obj:n});return}case"guardrail_policy":{let r=t.guardrail_policies;if(!St(r))return;for(let[i,n]of Object.entries(r))St(n)&&(yield{path:`guardrail_policies.${i}`,obj:n});return}default:return}}function J2e(t,e,r,i,n,a,o,s){let l=t?`${t}.${r}`:r,u=n[r];if(u===void 0){a.push({path:l,message:`Extension "${r}" is not declared in extensions.`,code:"undeclared-extension",...s?{}:{severity:"warning"}});return}let c=u.scope;if(c&&c.length>0&&!c.includes(e)){a.push({path:l,message:`Extension "${r}" is not allowed on ${e} (declared scope: ${c.join(", ")}).`,code:"extension-scope-mismatch"});return}if(u.schema&&typeof u.schema=="object"&&u.schema!==null&&Object.keys(u.schema).length>0)try{let d=o.compile(u.schema);d(i)||a.push({path:l,message:`Extension "${r}" value does not match declared schema: ${o.errorsText(d.errors)}`,code:"extension-schema-violation"})}catch(d){a.push({path:l,message:`Extension "${r}" has invalid JSON Schema in declaration: ${d instanceof Error?d.message:String(d)}`,code:"extension-schema-violation"})}}function mn(t,e,r,i,n,a,o){if(!St(t))return;let s=t;for(let l of Object.keys(s))l==="extensions"||l==="extensions_strict"||l==="x-extensions"||l==="x-extensions-strict"||l.startsWith("x-")&&J2e(e,r,l,s[l],i,n,a,o);switch(r){case"root":{let l=s.system;St(l)&&mn(l,"system","system",i,n,a,o);let u=s.agents;if(St(u))for(let[E,I]of Object.entries(u))St(I)&&mn(I,`agents.${E}`,"agent",i,n,a,o);let c=s.tasks;if(St(c))for(let[E,I]of Object.entries(c))St(I)&&mn(I,`tasks.${E}`,"task",i,n,a,o);let d=s.artifacts;if(St(d))for(let[E,I]of Object.entries(d))St(I)&&mn(I,`artifacts.${E}`,"artifact",i,n,a,o);let f=s.tools;if(St(f))for(let[E,I]of Object.entries(f))St(I)&&mn(I,`tools.${E}`,"tool",i,n,a,o);let h=s.validations;if(St(h))for(let[E,I]of Object.entries(h))St(I)&&mn(I,`validations.${E}`,"validation",i,n,a,o);let g=s.handoff_types;if(St(g))for(let[E,I]of Object.entries(g))St(I)&&mn(I,`handoff_types.${E}`,"handoff_type",i,n,a,o);let v=s.workflow;if(St(v))for(let[E,I]of Object.entries(v))St(I)&&mn(I,`workflow.${E}`,"workflow",i,n,a,o);let y=s.policies;if(St(y))for(let[E,I]of Object.entries(y))St(I)&&mn(I,`policies.${E}`,"policy",i,n,a,o);let w=s.guardrails;if(St(w))for(let[E,I]of Object.entries(w))St(I)&&mn(I,`guardrails.${E}`,"guardrail",i,n,a,o);let $=s.guardrail_policies;if(St($))for(let[E,I]of Object.entries($))St(I)&&mn(I,`guardrail_policies.${E}`,"guardrail_policy",i,n,a,o);break}case"agent":{let l=s.rules;if(Array.isArray(l))for(let d=0;d<l.length;d++){let f=l[d];St(f)&&mn(f,`${e}.rules[${d}]`,"rule",i,n,a,o)}let u=s.escalation_criteria;if(Array.isArray(u))for(let d=0;d<u.length;d++){let f=u[d];St(f)&&mn(f,`${e}.escalation_criteria[${d}]`,"escalation_criterion",i,n,a,o)}let c=s.prerequisites;if(Array.isArray(c))for(let d=0;d<c.length;d++){let f=c[d];St(f)&&mn(f,`${e}.prerequisites[${d}]`,"prerequisite",i,n,a,o)}break}case"task":{let l=s.execution_steps;if(Array.isArray(l))for(let u=0;u<l.length;u++){let c=l[u];St(c)&&mn(c,`${e}.execution_steps[${u}]`,"execution_step",i,n,a,o)}break}case"tool":{let l=s.commands;if(Array.isArray(l))for(let u=0;u<l.length;u++){let c=l[u];St(c)&&mn(c,`${e}.commands[${u}]`,"tool_command",i,n,a,o)}break}case"workflow":{let l=s.steps;if(Array.isArray(l))for(let u=0;u<l.length;u++){let c=l[u];St(c)&&mn(c,`${e}.steps[${u}]`,"workflow_step",i,n,a,o)}break}default:break}}function Y2e(t){let e=t.extensions_strict===!0,r=t.extensions,i;if(!St(r)||Object.keys(r).length===0){if(!e)return[];i={}}else i=r;let n=[],a=new LF.default({allErrors:!0,strict:!1});mn(t,"","root",i,n,a,e);for(let[o,s]of Object.entries(i)){if(!s.required)continue;let l=s.scope&&s.scope.length>0?s.scope:[...pS];for(let u of l)for(let{path:c,obj:d}of Z2e(t,u))o in d||n.push({path:c,message:`Required extension "${o}" is missing on ${u}.`,code:"extension-required-missing"})}return n}function Q2e(t){return t.some(e=>e.severity!=="warning")}function X2e(t){let e=[];"x-extensions"in t&&!("extensions"in t)&&(t.extensions=t["x-extensions"],e.push({path:"x-extensions",message:'"x-extensions" is deprecated. Use "extensions" instead.',code:"deprecated-property",severity:"warning"})),"x-extensions-strict"in t&&!("extensions_strict"in t)&&(t.extensions_strict=t["x-extensions-strict"],e.push({path:"x-extensions-strict",message:'"x-extensions-strict" is deprecated. Use "extensions_strict" instead.',code:"deprecated-property",severity:"warning"}));let r=W0.safeParse(t);if(!r.success)return{success:!1,diagnostics:[...e,...r.error.issues.map(a=>({path:a.path.join("."),message:a.message,code:"schema-validation"}))]};let i=[...e,...af(t,W0,""),...K2e(t),...H2e(t),...Y2e(t)];return{success:!Q2e(i),data:r.data,diagnostics:i}}function eye(t){let e=[],r=new Set(Object.keys(t.agents)),i=new Set(Object.keys(t.artifacts)),n=new Set(Object.keys(t.tools)),a=new Set(Object.keys(t.validations)),o=new Set(Object.keys(t.handoff_types)),s=new Set(Object.keys(t.tasks)),l=new Set(t.system.default_workflow_order),u=new Set(Object.keys(t.guardrails));function c(f,h,g,v,y="reference-not-found"){h.has(f)||e.push({path:v,message:`Reference "${f}" not found in ${g}`,code:y})}for(let[f,h]of Object.entries(t.agents)){for(let g of h.own_artifacts)c(g,i,"artifacts",`agents.${f}.own_artifacts`);for(let g of h.can_read_artifacts)c(g,i,"artifacts",`agents.${f}.can_read_artifacts`);for(let g of h.can_write_artifacts)c(g,i,"artifacts",`agents.${f}.can_write_artifacts`);for(let g of h.can_execute_tools)c(g,n,"tools",`agents.${f}.can_execute_tools`);for(let g of h.can_perform_validations)c(g,a,"validations",`agents.${f}.can_perform_validations`);for(let g of h.can_invoke_agents)c(g,r,"agents",`agents.${f}.can_invoke_agents`);for(let g of h.can_return_handoffs)c(g,o,"handoff_types",`agents.${f}.can_return_handoffs`)}for(let[f,h]of Object.entries(t.artifacts)){if(h.owner&&c(h.owner,r,"agents",`artifacts.${f}.owner`),h.producers.length>0)for(let g of h.producers)c(g,r,"agents",`artifacts.${f}.producers`);if(h.editors.length>0)for(let g of h.editors)c(g,r,"agents",`artifacts.${f}.editors`);if(h.consumers.length>0)for(let g of h.consumers)c(g,r,"agents",`artifacts.${f}.consumers`);for(let g of h.required_validations)c(g,a,"validations",`artifacts.${f}.required_validations`)}for(let[f,h]of Object.entries(t.artifacts)){if(h.owner){let g=t.agents[h.owner];g&&g.can_read_artifacts.length>0&&!g.can_read_artifacts.includes(f)&&e.push({path:`artifacts.${f}.owner`,message:`Agent "${h.owner}" owns artifact "${f}" but cannot read it (missing from can_read_artifacts)`,code:"artifact-owner-no-read"})}for(let g of h.required_validations){let v=t.validations[g];if(v?.executor_type==="tool"&&v.executor){let y=t.tools[v.executor];y&&y.invokable_by.length===0&&e.push({path:`artifacts.${f}.required_validations`,message:`Validation "${g}" uses tool "${v.executor}" which has no agents in invokable_by`,code:"validation-executor-unreachable"})}}}for(let[f,h]of Object.entries(t.tools)){if(h.extends&&c(h.extends,n,"tools",`tools.${f}.extends`,"tool-extends-not-found"),h.invokable_by.length>0)for(let g of h.invokable_by)c(g,r,"agents",`tools.${f}.invokable_by`);for(let g of Object.values(h.artifact_bindings))c(g,i,"artifacts",`tools.${f}.artifact_bindings`)}for(let[f,h]of Object.entries(t.validations))c(h.target_artifact,i,"artifacts",`validations.${f}.target_artifact`),h.executor_type==="tool"&&h.executor?c(h.executor,n,"tools",`validations.${f}.executor`):h.executor_type==="agent"&&h.executor&&c(h.executor,r,"agents",`validations.${f}.executor`);for(let[f,h]of Object.entries(t.tasks)){c(h.target_agent,r,"agents",`tasks.${f}.target_agent`);for(let g of h.allowed_from_agents)c(g,r,"agents",`tasks.${f}.allowed_from_agents`);c(h.workflow,l,"system.default_workflow_order",`tasks.${f}.workflow`),c(h.invocation_handoff,o,"handoff_types",`tasks.${f}.invocation_handoff`),c(h.result_handoff,o,"handoff_types",`tasks.${f}.result_handoff`);for(let g of h.input_artifacts)c(g,i,"artifacts",`tasks.${f}.input_artifacts`);for(let g of h.validations)c(g,a,"validations",`tasks.${f}.validations`)}for(let[f,h]of Object.entries(t.workflow)){c(f,l,"system.default_workflow_order",`workflow.${f}`);for(let g=0;g<h.steps.length;g++){let v=h.steps[g];if(v.type==="delegate")c(v.task,s,"tasks",`workflow.${f}.steps[${g}].task`),c(v.from_agent,r,"agents",`workflow.${f}.steps[${g}].from_agent`);else if(v.type==="gate")c(v.gate_kind,o,"handoff_types",`workflow.${f}.steps[${g}].gate_kind`);else if(v.type==="handoff")v.task&&c(v.task,s,"tasks",`workflow.${f}.steps[${g}].task`),v.from_agent&&c(v.from_agent,r,"agents",`workflow.${f}.steps[${g}].from_agent`);else if(v.type==="validation")c(v.validation,a,"validations",`workflow.${f}.steps[${g}].validation`);else if(v.type==="team_task"){let y=t.imports!==void 0?new Set(Object.keys(t.imports)):null;y?c(v.to_team,y,"imports",`workflow.${f}.steps[${g}].to_team`,"team-import-not-found"):e.push({path:`workflow.${f}.steps[${g}].to_team`,message:`team_task step references team "${v.to_team}" but dsl.imports is not defined`,code:"team-task-missing-imports"}),c(v.handoff,o,"handoff_types",`workflow.${f}.steps[${g}].handoff`),c(v.expects,o,"handoff_types",`workflow.${f}.steps[${g}].expects`)}}}for(let[f,h]of Object.entries(t.tasks)){let g=t.agents[h.target_agent];if(g&&(g.can_return_handoffs.includes(h.result_handoff)||e.push({path:`tasks.${f}.result_handoff`,message:`Task result_handoff "${h.result_handoff}" is not in target agent "${h.target_agent}" can_return_handoffs`,code:"result-handoff-not-returnable"}),g.can_read_artifacts.length>0))for(let v=0;v<h.input_artifacts.length;v++){let y=h.input_artifacts[v];g.can_read_artifacts.includes(y)||e.push({path:`tasks.${f}.input_artifacts[${v}]`,message:`Input artifact "${y}" is not in target agent "${h.target_agent}" can_read_artifacts`,code:"input-artifact-not-readable"})}}for(let[f,h]of Object.entries(t.agents))if(h.mode==="read-only"&&h.can_write_artifacts.length>0&&e.push({path:`agents.${f}.can_write_artifacts`,message:`Agent "${f}" has mode "read-only" but can_write_artifacts is not empty`,code:"readonly-agent-has-writes"}),h.prerequisites)for(let g=0;g<h.prerequisites.length;g++){let v=h.prerequisites[g];h.can_read_artifacts.length>0&&!h.can_read_artifacts.includes(v.target)&&e.push({path:`agents.${f}.prerequisites[${g}].target`,message:`Prerequisite target "${v.target}" is not in agent "${f}" can_read_artifacts`,code:"prerequisite-not-readable"})}for(let[f,h]of Object.entries(t.handoff_types)){let g=h.schema,v=Ps(g),y=v.required,w=v.properties;if(Array.isArray(y)&&w!==void 0&&w!==null&&typeof w=="object"&&!Array.isArray(w)){let $=w;for(let E=0;E<y.length;E++){let I=y[E];typeof I=="string"&&!(I in $)&&e.push({path:`handoff_types.${f}.schema.required[${E}]`,message:`Handoff schema required field "${I}" is not a key in schema.properties`,code:"schema-required-not-in-properties"})}}if(w!=null&&typeof w=="object"&&!Array.isArray(w)){let $=w;for(let[E,I]of Object.entries($))if(I!==null&&typeof I=="object"&&!Array.isArray(I)){let R=I.enum;Array.isArray(R)&&R.length===0&&e.push({path:`handoff_types.${f}.schema.properties.${E}`,message:`Handoff schema property "${E}" has an empty enum`,code:"schema-empty-enum"})}}}for(let[f,h]of Object.entries(t.agents))if(h.guardrails)for(let g of h.guardrails)c(g,u,"guardrails",`agents.${f}.guardrails`,"entity-guardrail-ref-not-found");for(let[f,h]of Object.entries(t.tasks))if(h.guardrails)for(let g of h.guardrails)c(g,u,"guardrails",`tasks.${f}.guardrails`,"entity-guardrail-ref-not-found");for(let[f,h]of Object.entries(t.tools))if(h.guardrails)for(let g of h.guardrails)c(g,u,"guardrails",`tools.${f}.guardrails`,"entity-guardrail-ref-not-found");for(let[f,h]of Object.entries(t.artifacts))if(h.guardrails)for(let g of h.guardrails)c(g,u,"guardrails",`artifacts.${f}.guardrails`,"entity-guardrail-ref-not-found");for(let[f,h]of Object.entries(t.guardrails)){if(h.scope.agents)for(let g of h.scope.agents)c(g,r,"agents",`guardrails.${f}.scope.agents`,"guardrail-scope-ref-not-found");if(h.scope.tasks)for(let g of h.scope.tasks)c(g,s,"tasks",`guardrails.${f}.scope.tasks`,"guardrail-scope-ref-not-found");if(h.scope.tools)for(let g of h.scope.tools)c(g,n,"tools",`guardrails.${f}.scope.tools`,"guardrail-scope-ref-not-found");if(h.scope.artifacts)for(let g of h.scope.artifacts)c(g,i,"artifacts",`guardrails.${f}.scope.artifacts`,"guardrail-scope-ref-not-found");if(h.scope.workflows)for(let g of h.scope.workflows)c(g,l,"system.default_workflow_order",`guardrails.${f}.scope.workflows`,"guardrail-scope-ref-not-found")}for(let[f,h]of Object.entries(t.guardrail_policies))for(let g=0;g<h.rules.length;g++){let v=h.rules[g];c(v.guardrail,u,"guardrails",`guardrail_policies.${f}.rules[${g}].guardrail`,"guardrail-policy-ref-not-found")}let d=new Set(Object.keys(t.workflow));if(t.team_interface){let f=t.team_interface;if(f.accepts?.workflows)for(let[h,g]of Object.entries(f.accepts.workflows)){let v=g.internal_workflow??h;c(v,d,"workflow",`team_interface.accepts.workflows.${h}.internal_workflow`,"team-interface-workflow-not-found"),c(g.input_handoff,o,"handoff_types",`team_interface.accepts.workflows.${h}.input_handoff`,"team-interface-handoff-not-found"),c(g.output_handoff,o,"handoff_types",`team_interface.accepts.workflows.${h}.output_handoff`,"team-interface-handoff-not-found")}if(f.exposes?.artifacts)for(let h=0;h<f.exposes.artifacts.length;h++){let g=f.exposes.artifacts[h];c(g,i,"artifacts",`team_interface.exposes.artifacts[${h}]`,"team-interface-artifact-not-found")}}return e}function tye(t){let e=[];for(let[r,i]of Object.entries(t.handoff_types)){let n=i.schema;if(Object.keys(n).length===0)continue;if(!r7.validateSchema(n)&&r7.errors)for(let o of r7.errors)e.push({path:`handoff_types.${r}.schema${o.instancePath}`,message:`Invalid JSON Schema: ${o.message??"unknown error"}`,code:"invalid-handoff-schema"})}return e}function zF(t){return typeof t=="object"&&t!==null&&"default"in t}function uye(t){let e=new Set;for(let r of Object.values(t.guardrail_policies))for(let i of r.rules)if(zF(i.action))for(let n of Object.keys(i.action.when))e.add(n);return e}function xye(t,e){switch(e){case"owner":return!!t.owner;case"producers":return t.producers.length>0;case"editors":return t.editors.length>0;case"consumers":return t.consumers.length>0}}function $ye(t,e){switch(e){case"own_artifacts":return t.own_artifacts.length>0;case"can_read_artifacts":return t.can_read_artifacts.length>0;case"can_write_artifacts":return t.can_write_artifacts.length>0}}function Sl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function vS(t){let e=new Map;function r(n,a,o){let s=e.get(n);s||(s=[],e.set(n,s)),s.push({path:a,nodeType:o})}function i(n,a,o){for(let s of Object.keys(n))s.startsWith("x-")&&s!=="x-extensions"&&s!=="x-extensions-strict"&&r(s,a?`${a}.${s}`:s,o)}i(t,"","root"),Sl(t.system)&&i(t.system,"system","system");for(let[n,a]of Object.entries(t.agents)){let o=a;if(i(o,`agents.${n}`,"agent"),Array.isArray(o.rules))for(let s=0;s<o.rules.length;s++){let l=o.rules[s];Sl(l)&&i(l,`agents.${n}.rules[${s}]`,"rule")}if(Array.isArray(o.escalation_criteria))for(let s=0;s<o.escalation_criteria.length;s++){let l=o.escalation_criteria[s];Sl(l)&&i(l,`agents.${n}.escalation_criteria[${s}]`,"escalation_criterion")}if(Array.isArray(o.prerequisites))for(let s=0;s<o.prerequisites.length;s++){let l=o.prerequisites[s];Sl(l)&&i(l,`agents.${n}.prerequisites[${s}]`,"prerequisite")}}for(let[n,a]of Object.entries(t.tasks)){let o=a;if(i(o,`tasks.${n}`,"task"),Array.isArray(o.execution_steps))for(let s=0;s<o.execution_steps.length;s++){let l=o.execution_steps[s];Sl(l)&&i(l,`tasks.${n}.execution_steps[${s}]`,"execution_step")}}for(let[n,a]of Object.entries(t.artifacts))i(a,`artifacts.${n}`,"artifact");for(let[n,a]of Object.entries(t.tools)){let o=a;if(i(o,`tools.${n}`,"tool"),Array.isArray(o.commands))for(let s=0;s<o.commands.length;s++){let l=o.commands[s];Sl(l)&&i(l,`tools.${n}.commands[${s}]`,"tool_command")}}for(let[n,a]of Object.entries(t.validations))i(a,`validations.${n}`,"validation");for(let[n,a]of Object.entries(t.handoff_types))i(a,`handoff_types.${n}`,"handoff_type");for(let[n,a]of Object.entries(t.workflow)){let o=a;if(i(o,`workflow.${n}`,"workflow"),Array.isArray(o.steps))for(let s=0;s<o.steps.length;s++){let l=o.steps[s];Sl(l)&&i(l,`workflow.${n}.steps[${s}]`,"workflow_step")}}for(let[n,a]of Object.entries(t.policies))i(a,`policies.${n}`,"policy");for(let[n,a]of Object.entries(t.guardrails))i(a,`guardrails.${n}`,"guardrail");for(let[n,a]of Object.entries(t.guardrail_policies))i(a,`guardrail_policies.${n}`,"guardrail_policy");return e}function EL(t){return Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Rye(t){let e=t.artifact_slots;if(!e||typeof e!="object")return null;let r={};for(let[i,n]of Object.entries(e)){if(!n||typeof n!="object")continue;let a=n.direction;(a==="read"||a==="write"||a==="readwrite")&&(r[i]={direction:a})}return Object.keys(r).length>0?r:null}function Dye(t){let e={},r=t.command_sets;if(!r||typeof r!="object")return e;for(let i of Object.values(r)){if(!i||typeof i!="object")continue;let n=i.commands;if(!(!n||typeof n!="object"))for(let[a,o]of Object.entries(n)){if(!o||typeof o!="object")continue;let s=o.effects;!s||typeof s!="object"||(e[a]={reads:EL(s.reads),writes:EL(s.writes)})}}return e}function Nye(t){return jye(t)?t:Tye(process.cwd(),t)}function hv(t){let e=Nye(t);if(!Iye(e))return null;let r;try{r=(0,FF.parse)(Cye(e,"utf8"))}catch{return null}if(!r||typeof r!="object")return null;let i=Rye(r);return i?{artifactSlots:i,commandEffects:Dye(r)}:null}function UF(t,e,r){let i=r.commandEffects[e];if(i){if(i.writes.includes(t))return"write";if(i.reads.includes(t))return"read"}let n=r.artifactSlots[t];return n&&(n.direction==="write"||n.direction==="readwrite")?"write":"read"}function Mye(t,e,r){let i=r.agents[t];return i?i.can_write_artifacts.includes(e)||i.own_artifacts.includes(e):!1}function Uye(t,e=VF){let r=[];for(let i of e)r.push(...i.run(t));return r}function Wye(t){return!t.owner&&(t.producers?.length??0)===0&&(t.editors?.length??0)===0&&(t.consumers?.length??0)===0}function BF(t){if(!Array.isArray(t.allOf))return t;let e={},r=[],i={};for(let a of t.allOf){if(typeof a!="object"||a===null)continue;let o=BF(a);o.properties&&typeof o.properties=="object"&&(e={...e,...o.properties}),Array.isArray(o.required)&&(r=[...r,...o.required]);for(let[s,l]of Object.entries(o))s!=="properties"&&s!=="required"&&s!=="allOf"&&(i[s]=l)}for(let[a,o]of Object.entries(t))a!=="allOf"&&(a==="properties"&&typeof o=="object"?e={...e,...o}:a==="required"&&Array.isArray(o)?r=[...r,...o]:i[a]=o);let n={...i};return Object.keys(e).length>0&&(n.properties=e),r.length>0&&(n.required=[...new Set(r)]),n}function a4e(){return $0||($0=new Vye.Spectral,$0.setRuleset(n4e)),$0}async function o4e(t){return(await a4e().run(t)).map(i=>({ruleId:i.code,severity:i4e[i.severity]??"info",path:i.path.join("."),message:i.message}))}function l4e(t){return{system:t.system,agents:t.agents,tasks:t.tasks,artifacts:t.artifacts,tools:t.tools,validations:t.validations,handoff_types:t.handoff_types,workflow:t.workflow,policies:t.policies,guardrails:t.guardrails,guardrail_policies:t.guardrail_policies}}function Sf(t,e){let r={system:t.system,dsl:t};if(e?.loadedBindings&&e.loadedBindings.length>0){r.bindings=e.loadedBindings.map(a=>a.binding);let i=e.activeGuardrailPolicy,n=i?t.guardrail_policies[i]:void 0;n&&(r.guardrailEnforcement=u4e(t,n,e.loadedBindings))}return r}function u4e(t,e,r){let i=[],n=new Map;for(let a of r){let o=a.binding.guardrail_impl??{};for(let[s,l]of Object.entries(o))for(let u of l.checks)u.matcher&&n.set(s,u.matcher.type)}for(let a of e.rules){let o=t.guardrails[a.guardrail];if(!o)continue;let s=o.scope??{};i.push({guardrail_id:a.guardrail,description:o.description,severity:a.severity,action:a.action,scoped_agents:s.agents??[],scoped_tasks:s.tasks??[],scoped_workflows:s.workflows??[],scoped_tools:s.tools??[],scoped_artifacts:s.artifacts??[],allow_override:a.allow_override,override_requires:a.override_requires??[],trigger:n.get(a.guardrail)??null,escalation:a.escalation?{target:a.escalation.target,condition:a.escalation.condition}:null})}return i}function kf(t,e,r){let i=t[e][r],n=new Set(i?.guardrails??[]),a=new Set;for(let[u,c]of Object.entries(t.guardrails))c.scope[e]?.includes(r)&&a.add(u);let o=new Set([...n,...a]),s=new Map;for(let u of Object.values(t.guardrail_policies))for(let c of u.rules)s.has(c.guardrail)||s.set(c.guardrail,{severity:c.severity,action:c.action});let l=[];for(let u of o){let c=t.guardrails[u];if(!c)continue;let d=n.has(u),f=a.has(u),h=d&&f?"both":d?"entity":"scope",g=s.get(u);l.push({guardrail_id:u,description:c.description,rationale:c.rationale,tags:c.tags,source:h,severity:g?.severity,action:g?.action})}return l}function n7(t,e){return{validation_id:t,kind:e.kind,target_artifact:e.target_artifact,executor_type:e.executor_type,blocking:e.blocking,produces_evidence:e.produces_evidence}}function gv(t,e,r){if(e==="agents"){let n=t.agents[r];if(!n)return[];let a=[];for(let o of n.can_perform_validations??[]){let s=t.validations[o];s&&a.push(n7(o,s))}return a}if(e==="tasks"){let n=t.tasks[r];if(!n)return[];let a=[];for(let o of n.validations??[]){let s=t.validations[o];s&&a.push(n7(o,s))}return a}let i=[];for(let[n,a]of Object.entries(t.validations))a.executor_type==="tool"&&a.executor===r&&i.push(n7(n,a));return i.sort((n,a)=>n.validation_id.localeCompare(a.validation_id)),i}function GF(t,e){let r=t.tasks[e],i={...r,id:e},n=t.agents[r.target_agent],a=n?{...n,id:r.target_agent}:null,o=kf(t,"tasks",e),s=gv(t,"tasks",e);return{task:i,targetAgent:a,relatedGuardrails:o,relatedValidations:s,dsl:t}}function WF(t,e){let r=t.artifacts[e],i={...r,id:e},n={};for(let[f,h]of Object.entries(t.tools))(h.input_artifacts.includes(e)||h.output_artifacts.includes(e))&&(n[f]=h);let a={};for(let[f,h]of Object.entries(t.validations))h.target_artifact===e&&(a[f]=h);let o=f=>{let h={};for(let g of f)t.agents[g]&&(h[g]=t.agents[g]);return h},s=o(r.producers),l=o(r.consumers),u=o(r.editors),c=[];for(let[f,h]of Object.entries(t.tasks)){if(c.includes(h.workflow))continue;if(t.agents[h.target_agent]?.can_write_artifacts.includes(e)){c.push(h.workflow);continue}let v=h.execution_steps??[];for(let y of v)if(y.produces_artifact===e){c.push(h.workflow);break}}let d=kf(t,"artifacts",e);return{artifact:i,relatedTools:n,relatedValidations:a,producerAgents:s,consumerAgents:l,editorAgents:u,createdInWorkflows:c,relatedGuardrails:d,dsl:t}}function HF(t,e){let r=t.tools[e],i={...r,id:e},n={};for(let l of r.invokable_by)t.agents[l]&&(n[l]=t.agents[l]);let a=l=>{let u={};for(let c of l)t.artifacts[c]&&(u[c]=t.artifacts[c]);return u},o=kf(t,"tools",e),s=gv(t,"tools",e);return{tool:i,invokableAgents:n,inputArtifactDetails:a(r.input_artifacts),outputArtifactDetails:a(r.output_artifacts),relatedGuardrails:o,relatedValidations:s,dsl:t}}function KF(t,e){return{validation:{...t.validations[e],id:e},dsl:t}}function ZF(t,e){let i={...t.handoff_types[e],id:e},n=Object.entries(t.tasks).filter(([,a])=>a.invocation_handoff===e||a.result_handoff===e).map(([a,o])=>({...o,id:a}));return{handoff_type:i,relatedTasks:n,dsl:t}}function vv(t,e){let r=t.workflow[e],i={...r,id:e},n=new Set;for(let g of r.steps)(g.type==="delegate"||g.type==="handoff"&&g.task)&&(n.add(g.task),g.retry&&(n.add(g.retry.fix_task),g.retry.revalidate_task&&n.add(g.retry.revalidate_task)));let a=Object.entries(t.tasks).filter(([g,v])=>v.workflow===e||n.has(g)).map(([g,v])=>({...v,id:g})),o=new Set;for(let g of a){o.add(g.target_agent);for(let v of g.allowed_from_agents)o.add(v)}for(let g of r.steps)if((g.type==="delegate"||g.type==="handoff"&&g.from_agent)&&o.add(g.from_agent),g.type==="validation"){let v=t.validations[g.validation];v?.executor_type==="agent"&&v.executor&&o.add(v.executor)}let s={};for(let g of o)t.agents[g]&&(s[g]=t.agents[g]);let l=new Set;for(let g of o){let v=t.agents[g];if(v)for(let y of v.can_execute_tools)l.add(y)}for(let g of a)for(let v of g.execution_steps??[])v.uses_tool&&l.add(v.uses_tool);let u={};for(let g of l)t.tools[g]&&(u[g]=t.tools[g]);let c=new Set;for(let g of a){for(let v of g.input_artifacts)c.add(v);for(let v of g.execution_steps??[])v.produces_artifact&&c.add(v.produces_artifact),v.reads_artifact&&c.add(v.reads_artifact)}for(let g of o){let v=t.agents[g];if(v){for(let y of v.can_read_artifacts)c.add(y);for(let y of v.can_write_artifacts)c.add(y)}}let d={};for(let g of c)t.artifacts[g]&&(d[g]=t.artifacts[g]);let f=new Set;for(let g of r.steps)g.type==="validation"&&f.add(g.validation);for(let g of a)for(let v of g.validations??[])f.add(v);let h={};for(let g of f)t.validations[g]&&(h[g]=t.validations[g]);return{workflow:i,relatedAgents:s,relatedTasks:a,relatedTools:u,relatedArtifacts:d,relatedValidations:h,dsl:t}}function JF(t,e){return{policy:{...t.policies[e],id:e},dsl:t}}function YF(t,e){return{guardrail:{...t.guardrails[e],id:e},dsl:t}}function QF(t,e){return{guardrail_policy:{...t.guardrail_policies[e],id:e},dsl:t}}function c4e(t,e){let r=[...t],i=new Set(r.map(n=>n.id));for(let n of e){let a=n.id;if(i.has(a)){let o=r.findIndex(s=>s.id===a);r[o]=n}else r.push(n)}return r}function d4e(t,e){let r=t.responsibilities??[],i=t.constraints??[],n=t.rules??[],a=t.anti_patterns??[],o=t.escalation_criteria??[],s=[],l=[];for(let u of e)r=[...r,...u.responsibilities??[]],i=[...i,...u.constraints??[]],n=c4e(n,u.rules??[]),a=[...a,...u.anti_patterns??[]],o=[...o,...u.escalation_criteria??[]],s=[...s,...u.execution_steps??[]],l=[...l,...u.completion_criteria??[]];return{responsibilities:r,constraints:i,rules:n,anti_patterns:a,escalation_criteria:o,execution_steps:s,completion_criteria:l}}function IL(t){let r=Ps(t).properties;return Object.keys(r&&typeof r=="object"?r:t)}function p4e(t,e){return Object.entries(t.tasks).filter(([,r])=>r.allowed_from_agents.includes(e)).map(([r,i])=>{let n=t.handoff_types[i.invocation_handoff],a=t.handoff_types[i.result_handoff];return{id:r,description:i.description,target_agent:i.target_agent,workflow:i.workflow,input_artifacts:i.input_artifacts,invocation_handoff:i.invocation_handoff,invocation_payload_keys:n?IL(n.schema):[],result_handoff:i.result_handoff,result_payload_keys:a?IL(a.schema):[]}})}function _S(t,e){let r=e.id,i=Object.entries(t.tasks).filter(([,v])=>v.target_agent===r).map(([v,y])=>({...y,id:v})),n=p4e(t,r),a=new Set([...e.can_read_artifacts,...e.can_write_artifacts]),o={};for(let[v,y]of Object.entries(t.artifacts))a.has(v)&&(o[v]=y);let s=new Set(e.can_execute_tools),l={};for(let[v,y]of Object.entries(t.tools))s.has(v)&&(l[v]=y);let u=new Set([...e.can_return_handoffs,...i.map(v=>v.invocation_handoff),...i.map(v=>v.result_handoff),...n.map(v=>v.invocation_handoff),...n.map(v=>v.result_handoff)]),c={};for(let[v,y]of Object.entries(t.handoff_types))u.has(v)&&(c[v]=y);let d=i.map(({id:v,...y})=>y),f=d4e(e,d),h=kf(t,"agents",r),g=gv(t,"agents",r);return{agent:e,tasks:i,receivableTasks:i,delegatableTasks:n,relatedArtifacts:o,relatedTools:l,relatedHandoffTypes:c,mergedBehavior:f,relatedGuardrails:h,relatedValidations:g,dsl:t}}function f4e(t,e,r){let i=0;for(let d of t)i=(i<<5)-i+d.charCodeAt(0)|0;let n=(i%360+360)%360,a=(1-Math.abs(2*r-1))*e,o=a*(1-Math.abs(n/60%2-1)),s=r-a/2,l=0,u=0,c=0;return n<60?(l=a,u=o):n<120?(l=o,u=a):n<180?(u=a,c=o):n<240?(u=o,c=a):n<300?(l=o,c=a):(l=a,c=o),`rgb(${Math.round((l+s)*255)},${Math.round((u+s)*255)},${Math.round((c+s)*255)})`}function yc(t){return t.replace(/[^a-zA-Z0-9_]/g,"_")}function CL(t,e){let r=e.role_name.split(/\s+/);return r.length===1?yc(r[0].slice(0,4)):yc(r.map(i=>i[0]).join(""))}function m4e(t,e,r){let i=new Set,n=new Set,a=new Set,o=new Set,s=new Map;for(let d of r)s.set(d.id,d);function l(d){c(d.target_agent);for(let f of d.execution_steps??[])h4e(f,a,o)}function u(d){let f=s.get(d.fix_task);if(f&&l(f),d.revalidate_task){let h=s.get(d.revalidate_task);h&&c(h.target_agent)}}for(let d of t.steps)if(d.type==="delegate"){c(d.from_agent);let f=s.get(d.task);f&&l(f),d.retry&&u(d.retry)}else if(d.type!=="gate"){if(d.type==="handoff"){if(d.from_agent&&c(d.from_agent),d.task){let f=s.get(d.task);f&&l(f)}d.retry&&u(d.retry)}else if(d.type==="validation"){let f=e.validations[d.validation];f&&(f.executor&&f.executor_type==="agent"?c(f.executor):f.executor&&a.add(f.executor),o.add(f.target_artifact))}}function c(d){e.agents[d]?.mode==="read-only"?n.add(d):i.add(d)}return{agents:i,auditAgents:n,tools:a,artifacts:o}}function h4e(t,e,r){t.uses_tool&&e.add(t.uses_tool),t.produces_artifact&&r.add(t.produces_artifact),t.reads_artifact&&r.add(t.reads_artifact)}function g4e(t,e,r){let i=[],n=new Set;function a(o){let s=o,l=2;for(;n.has(s);)s=`${o}${l}`,l++;return n.add(s),s}for(let o of e){let s=a(yc(o.id));i.push({id:o.id,alias:s,label:o.label,group:"external"})}for(let o of t.agents){let s=r.agents[o];if(!s)continue;let l=a(CL(o,s));i.push({id:o,alias:l,label:s.role_name,group:"agents"})}for(let o of t.auditAgents){let s=r.agents[o];if(!s)continue;let l=a(CL(o,s));i.push({id:o,alias:l,label:s.role_name,group:"audit"})}for(let o of t.tools){if(!r.tools[o])continue;let l=a(yc(o));i.push({id:o,alias:l,label:o,group:"toolchain"})}for(let o of t.artifacts){if(!r.artifacts[o])continue;let l=a(yc(o));i.push({id:o,alias:l,label:o,group:"artifacts"})}return i}function gn(t,e){let r=t.find(i=>i.id===e);return r?r.alias:yc(e)}function v4e(t,e,r,i){let n={external:[],agents:[],audit:[],toolchain:[],artifacts:[]};for(let s of t)n[s.group].push(s);let a=new Map;for(let s of e)a.set(s.id,s);if(n.external.length>0){r.push(`${i}box rgb(255,245,230) External`);for(let s of n.external){let u=a.get(s.id)?.kind==="actor"?"actor":"participant";s.alias===s.label?r.push(`${i}${u} ${s.alias}`):r.push(`${i}${u} ${s.alias} as ${s.label}`)}r.push(`${i}end`)}let o=[{key:"agents",label:"Agents",color:"rgb(200,220,255)"},{key:"audit",label:"Audit",color:"rgb(255,220,220)"},{key:"toolchain",label:"Toolchain",color:"rgb(220,255,220)"},{key:"artifacts",label:"Artifacts",color:"rgb(255,230,210)"}];for(let{key:s,label:l,color:u}of o){let c=n[s];if(c.length!==0){r.push(`${i}box ${u} ${l}`);for(let d of c)d.alias===d.label?r.push(`${i}participant ${d.alias}`):r.push(`${i}participant ${d.alias} as ${d.label}`);r.push(`${i}end`)}}}function y4e(t,e,r,i,n,a){let o=new Map;for(let c of i)o.set(c.id,c);if(!t.task){if(t.from_agent){let c=gn(e,t.from_agent);n.push(`${a}${c}->>${c}: ${t.handoff_kind}`)}return}let s=o.get(t.task);if(!s)return;let l=t.from_agent?gn(e,t.from_agent):null,u=gn(e,s.target_agent);l&&n.push(`${a}${l}->>${u}: delegate ${t.task}`);for(let c of s.execution_steps??[])wS(c,u,e,n,a);l&&n.push(`${a}${u}-->>${l}: ${s.result_handoff}`)}function wS(t,e,r,i,n){if(t.reads_artifact){let a=gn(r,t.reads_artifact);i.push(`${n}${e}->>${a}: [R] ${t.action}`)}if(t.produces_artifact){let a=gn(r,t.produces_artifact);i.push(`${n}${e}->>${a}: [W] ${t.action}`)}if(t.uses_tool){let a=gn(r,t.uses_tool);i.push(`${n}${e}->>${a}: ${t.action}`)}!t.reads_artifact&&!t.produces_artifact&&!t.uses_tool&&i.push(`${n}${e}->>${e}: ${t.action}`)}function _4e(t,e,r,i,n,a){let o=r.validations[t.validation];if(!o||!o.executor)return;let s=gn(e,o.executor),l=gn(e,o.target_artifact),u=i?gn(e,i):null;u&&u!==s&&n.push(`${a}${u}->>${s}: ${t.validation}`),n.push(`${a}${s}->>${l}: [R] ${o.target_artifact}`),u&&u!==s&&n.push(`${a}${s}-->>${u}: results`)}function w4e(t,e,r,i,n){let a=Object.entries(t.branches);if(a.length===0)return;let o=r?gn(e,r):null;for(let s=0;s<a.length;s++){let[l,u]=a[s];s===0?i.push(`${n}alt ${l}`):i.push(`${n}else ${l}`),o&&i.push(`${n} Note over ${o}: ${u.join(", ")}`)}i.push(`${n}end`)}function b4e(t,e,r,i,n,a){let o=new Map;for(let c of i)o.set(c.id,c);let s=o.get(t.task);if(!s)return;let l=gn(e,t.from_agent),u=gn(e,s.target_agent);n.push(`${a}${l}->>${u}: delegate ${t.task}`);for(let c of s.execution_steps??[])wS(c,u,e,n,a);n.push(`${a}${u}-->>${l}: ${s.result_handoff}`)}function S4e(t,e,r,i,n){if(r){let a=gn(e,r);i.push(`${n}${a}->>${a}: ${t.gate_kind}`)}}function jL(t,e,r,i,n,a){let o=new Map;for(let u of i)o.set(u.id,u);n.push(`${a}opt ${e.condition}`);let s=a+" ",l=o.get(e.fix_task);if(l){let u=t?gn(r,t):null,c=gn(r,l.target_agent);u&&n.push(`${s}${u}->>${c}: fix ${e.fix_task}`);for(let d of l.execution_steps??[])wS(d,c,r,n,s);u&&n.push(`${s}${c}-->>${u}: ${l.result_handoff}`)}if(e.revalidate_task){let u=o.get(e.revalidate_task);if(u){let c=t?gn(r,t):null,d=gn(r,u.target_agent);c&&(n.push(`${s}${c}->>${d}: revalidate ${e.revalidate_task}`),n.push(`${s}${d}-->>${c}: ${u.result_handoff}`))}}n.push(`${a}end`)}function k4e(t){let e=[],r=null;for(let i=0;i<t.length;i++){let n=t[i],a="group"in n?n.group:void 0;a?r&&r.group===a?r.steps.push({step:n,index:i}):(r&&e.push(r),r={group:a,steps:[{step:n,index:i}]}):(r&&(e.push(r),r=null),e.push({group:null,steps:[{step:n,index:i}]}))}return r&&e.push(r),e}function TL(t,e,r){let i=m4e(t,r,e),n=t.external_participants??[],a=g4e(i,n,r),o=[],s=" ";o.push("sequenceDiagram"),v4e(a,n,o,s),o.push(""),o.push(`${s}rect ${f4e(t.id,.15,.95)}`);let l=a[0],u=a[a.length-1];if(l&&u){let f=t.description?`${t.id} \u2014 ${t.description}`:t.id;o.push(`${s}Note over ${l.alias},${u.alias}: ${f}`)}if(t.trigger&&n.some(f=>f.kind==="actor")){let f=n.find(v=>v.kind==="actor"),h=gn(a,f.id),g=a.find(v=>v.group==="agents"||v.group==="audit");g&&o.push(`${s}${h}->>${g.alias}: ${t.trigger}`)}let c,d=k4e(t.steps);for(let f of d)if(f.group&&f.steps.length>1){o.push(""),o.push(`${s}par ${f.group}`);let h=s+" ";for(let g=0;g<f.steps.length;g++){let{step:v}=f.steps[g];g>0&&o.push(`${s}and`),RL(v,a,r,e,o,h,c,y=>{c=y})}o.push(`${s}end`)}else for(let{step:h}of f.steps)o.push(""),RL(h,a,r,e,o,s,c,g=>{c=g});return o.push(""),o.push(`${s}end`),o.join(`
259
259
  `)}function RL(t,e,r,i,n,a,o,s){t.type==="delegate"?(s(t.from_agent),b4e(t,e,r,i,n,a),t.retry&&jL(t.from_agent,t.retry,e,i,n,a)):t.type==="gate"?S4e(t,e,o,n,a):t.type==="handoff"?(t.from_agent&&s(t.from_agent),y4e(t,e,r,i,n,a),t.retry&&jL(t.from_agent,t.retry,e,i,n,a)):t.type==="validation"?_4e(t,e,r,o,n,a):t.type==="decision"&&w4e(t,e,o,n,a)}function x4e(t,e){let r=vv(t,e),i=t.workflow[e],n=new Map,a=new Map,o=new Map;function s(c,d,f){c.has(d)||c.set(d,new Set),c.get(d).add(f)}let l=new Map(r.relatedTasks.map(c=>[c.id,c]));function u(c){s(n,c.target_agent,"execute");for(let d of c.execution_steps??[])if(d.reads_artifact&&s(a,d.reads_artifact,"R"),d.produces_artifact&&s(a,d.produces_artifact,"W"),d.uses_tool){let f=t.tools[d.uses_tool];if(f){let h=f.commands.map(g=>g.category).filter((g,v,y)=>y.indexOf(g)===v);for(let g of h)s(o,d.uses_tool,g);h.length===0&&s(o,d.uses_tool,"\u2713")}else s(o,d.uses_tool,"\u2713")}}for(let c of i.steps)if(c.type==="delegate"){s(n,c.from_agent,"delegate");let d=l.get(c.task);d&&u(d)}else if(c.type!=="gate"){if(c.type==="handoff"){if(c.from_agent&&s(n,c.from_agent,"delegate"),c.task){let d=l.get(c.task);d&&u(d)}}else if(c.type==="validation"){let d=t.validations[c.validation];d&&(d.executor_type==="agent"&&d.executor?s(n,d.executor,"validate"):d.executor&&s(o,d.executor,"verification"),s(a,d.target_artifact,"V"))}}return{agentOps:n,artifactOps:a,toolOps:o}}function i7(t){return!t||t.size===0?"\u2014":[...t].join(", ")}function a7(t,e){let r=[];r.push("| "+t.join(" | ")+" |"),r.push("|"+t.map(()=>"---").join("|")+"|");for(let i of e)r.push("| "+i.join(" | ")+" |");return r.join(`
@@ -420,9 +420,9 @@ caused by: `+a(f,c)):d},o=u=>a(u,new Set),s=(u,c,d)=>{if(!(u instanceof Error))r
420
420
  `+L.prev+L.base;return Z+j.call(P,","+Z)+`
421
421
  `+L.prev}function K(P,L){var Z=je(P),ne=[];if(Z){ne.length=P.length;for(var ue=0;ue<P.length;ue++)ne[ue]=ht(P,ue)?L(P[ue],P):""}var he=typeof k=="function"?k(P):[],Ie;if(z){Ie={};for(var Ze=0;Ze<he.length;Ze++)Ie["$"+he[Ze]]=he[Ze]}for(var it in P)ht(P,it)&&(Z&&String(Number(it))===it&&it<P.length||z&&Ie["$"+it]instanceof Symbol||(O.call(/[^\w$]/,it)?ne.push(L(it,P)+": "+L(P[it],P)):ne.push(it+": "+L(P[it],P))));if(typeof k=="function")for(var Je=0;Je<he.length;Je++)se.call(P,he[Je])&&ne.push("["+L(he[Je])+"]: "+L(P[he[Je]],P));return ne}}}),Sq=G({"node_modules/es-abstract/helpers/isLeadingSurrogate.js"(t,e){"use strict";e.exports=function(i){return typeof i=="number"&&i>=55296&&i<=56319}}}),kq=G({"node_modules/es-abstract/helpers/isTrailingSurrogate.js"(t,e){"use strict";e.exports=function(i){return typeof i=="number"&&i>=56320&&i<=57343}}}),T0e=G({"node_modules/es-abstract/2025/UTF16SurrogatePairToCodePoint.js"(t,e){"use strict";var r=fi(),i=Mt(),n=r("%String.fromCharCode%"),a=Sq(),o=kq();e.exports=function(l,u){if(!a(l)||!o(u))throw new i("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return n(l)+n(u)}}}),R0e=G({"node_modules/es-abstract/2025/CodePointAt.js"(t,e){"use strict";var r=Mt(),i=ko(),n=Sq(),a=kq(),o=T0e(),s=i("String.prototype.charAt"),l=i("String.prototype.charCodeAt");e.exports=function(c,d){if(typeof c!="string")throw new r("Assertion failed: `string` must be a String");var f=c.length;if(d<0||d>=f)throw new r("Assertion failed: `position` must be >= 0, and < the length of `string`");var h=l(c,d),g=s(c,d),v=n(h),y=a(h);if(!v&&!y)return{"[[CodePoint]]":g,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||d+1===f)return{"[[CodePoint]]":g,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var w=l(c,d+1);return a(w)?{"[[CodePoint]]":o(h,w),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":g,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}}}),D0e=G({"node_modules/math-intrinsics/isFinite.js"(t,e){"use strict";var r=_f();e.exports=function(n){return(typeof n=="number"||typeof n=="bigint")&&!r(n)&&n!==1/0&&n!==-1/0}}}),N0e=G({"node_modules/math-intrinsics/isInteger.js"(t,e){"use strict";var r=uq(),i=cq(),n=_f(),a=D0e();e.exports=function(s){if(typeof s!="number"||n(s)||!a(s))return!1;var l=r(s);return i(l)===l}}}),L0e=G({"node_modules/math-intrinsics/constants/maxSafeInteger.js"(t,e){"use strict";e.exports=Number.MAX_SAFE_INTEGER||9007199254740991}}),M0e=G({"node_modules/es-abstract/2025/AdvanceStringIndex.js"(t,e){"use strict";var r=R0e(),i=Mt(),n=N0e(),a=L0e();e.exports=function(s,l,u){if(typeof s!="string")throw new i("Assertion failed: `S` must be a String");if(!n(l)||l<0||l>a)throw new i("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if(typeof u!="boolean")throw new i("Assertion failed: `unicode` must be a Boolean");if(!u)return l+1;var c=s.length;if(l+1>=c)return l+1;var d=r(s,l);return l+d["[[CodeUnitCount]]"]}}}),xq=G({"node_modules/es-abstract/2025/CreateIteratorResultObject.js"(t,e){"use strict";var r=Mt();e.exports=function(n,a){if(typeof a!="boolean")throw new r("Assertion failed: Type(done) is not Boolean");return{value:n,done:a}}}}),dv=G({"node_modules/es-abstract/2025/Get.js"(t,e){"use strict";var r=Mt(),i=As(),n=bo(),a=yn();e.exports=function(s,l){if(!a(s))throw new r("Assertion failed: Type(O) is not Object");if(!n(l))throw new r("Assertion failed: P is not a Property Key, got "+i(l));return s[l]}}}),$q=G({"node_modules/es-abstract/2025/IteratorComplete.js"(t,e){"use strict";var r=Mt(),i=yn(),n=dv(),a=vq();e.exports=function(s){if(!i(s))throw new r("Assertion failed: Type(iterResult) is not Object");return a(n(s,"done"))}}}),Eq=G({"node_modules/es-abstract/2025/IteratorValue.js"(t,e){"use strict";var r=Mt(),i=yn(),n=dv();e.exports=function(o){if(!i(o))throw new r("Assertion failed: Type(iterResult) is not Object");return n(o,"value")}}}),z0e=G({"node_modules/set-function-length/index.js"(t,e){"use strict";var r=fi(),i=lv(),n=yf()(),a=jl(),o=Mt(),s=r("%Math.floor%");e.exports=function(u,c){if(typeof u!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new o("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],f=!0,h=!0;if("length"in u&&a){var g=a(u,"length");g&&!g.configurable&&(f=!1),g&&!g.writable&&(h=!1)}return(f||h||!d)&&(n?i(u,"length",c,!0,!0):i(u,"length",c)),u}}}),q0e=G({"node_modules/call-bind-apply-helpers/applyBind.js"(t,e){"use strict";var r=$c(),i=nS(),n=mq();e.exports=function(){return n(r,i,arguments)}}}),F0e=G({"node_modules/call-bind/index.js"(t,e){"use strict";var r=z0e(),i=vf(),n=cv(),a=q0e();e.exports=function(s){var l=n(arguments),u=1+s.length-(arguments.length-1);return r(l,u>0?u:0,!0)},i?i(e.exports,"apply",{value:a}):e.exports.apply=a}}),U0e=G({"node_modules/es-abstract/2025/PromiseResolve.js"(t,e){"use strict";var r=fi(),i=F0e(),n=Cl(),a=r("%Promise.resolve%",!0),o=a&&i(a);e.exports=function(l,u){if(!o)throw new n("This environment does not support Promises.");return o(l,u)}}}),V0e=G({"node_modules/es-abstract/2025/AsyncFromSyncIteratorContinuation.js"(t,e){"use strict";var r=fi(),i=Cl(),n=Mt(),a=yn(),o=r("%Promise%",!0),s=ko(),l=xq(),u=$q(),c=Eq(),d=U0e(),f=s("Promise.prototype.then",!0);e.exports=function(g){if(!a(g))throw new n("Assertion failed: Type(O) is not Object");if(arguments.length>1)throw new i("although AsyncFromSyncIteratorContinuation should take a second argument, it is not used in this implementation");if(!o)throw new i("This environment does not support Promises.");return new o(function(v){var y=u(g),w=c(g),$=d(o,w),E=function(I){return l(I,y)};v(f($,E))})}}}),Aq=G({"node_modules/es-abstract/2025/IsArray.js"(t,e){"use strict";e.exports=aS()}}),oS=G({"node_modules/es-abstract/2025/Call.js"(t,e){"use strict";var r=fi(),i=ko(),n=Mt(),a=Aq(),o=r("%Reflect.apply%",!0)||i("Function.prototype.apply");e.exports=function(l,u){var c=arguments.length>2?arguments[2]:[];if(!a(c))throw new n("Assertion failed: optional `argumentsList`, if provided, must be a List");return o(l,u,c)}}}),B0e=G({"node_modules/es-abstract/2025/GetV.js"(t,e){"use strict";var r=Mt(),i=As(),n=bo();e.exports=function(o,s){if(!n(s))throw new r("Assertion failed: P is not a Property Key, got "+i(s));return o[s]}}}),Pq=G({"node_modules/es-abstract/2025/GetMethod.js"(t,e){"use strict";var r=Mt(),i=B0e(),n=iS(),a=bo(),o=As();e.exports=function(l,u){if(!a(u))throw new r("Assertion failed: P is not a Property Key");var c=i(l,u);if(c!=null){if(!n(c))throw new r(o(u)+" is not a function: "+o(c));return c}}}}),pv=G({"node_modules/es-abstract/helpers/records/iterator-record.js"(t,e){"use strict";var r=So();e.exports=function(n){return!!n&&typeof n=="object"&&r(n,"[[Iterator]]")&&r(n,"[[NextMethod]]")&&r(n,"[[Done]]")&&typeof n["[[Done]]"]=="boolean"}}}),Oq=G({"node_modules/es-abstract/2025/IteratorNext.js"(t,e){"use strict";var r=Mt(),i=yn(),n=oS(),a=pv();e.exports=function(s){if(!a(s))throw new r("Assertion failed: `iteratorRecord` must be an Iterator Record");var l;try{arguments.length<2?l=n(s["[[NextMethod]]"],s["[[Iterator]]"]):l=n(s["[[NextMethod]]"],s["[[Iterator]]"],[arguments[1]])}catch(u){throw s["[[Done]]"]=!0,u}if(!i(l))throw s["[[Done]]"]=!0,new r("iterator next must return an object");return l}}}),G0e=G({"node_modules/es-abstract/helpers/forEach.js"(t,e){"use strict";e.exports=function(i,n){for(var a=0;a<i.length;a+=1)n(i[a],a,i)}}}),W0e=G({"node_modules/side-channel-list/index.js"(t,e){"use strict";var r=As(),i=Mt(),n=function(u,c,d){for(var f=u,h;(h=f.next)!=null;f=h)if(h.key===c)return f.next=h.next,d||(h.next=u.next,u.next=h),h},a=function(u,c){if(u){var d=n(u,c);return d&&d.value}},o=function(u,c,d){var f=n(u,c);f?f.value=d:u.next={key:c,next:u.next,value:d}},s=function(u,c){return u?!!n(u,c):!1},l=function(u,c){if(u)return n(u,c,!0)};e.exports=function(){var c,d={assert:function(f){if(!d.has(f))throw new i("Side channel does not contain "+r(f))},delete:function(f){var h=l(c,f);return h&&c&&!c.next&&(c=void 0),!!h},get:function(f){return a(c,f)},has:function(f){return s(c,f)},set:function(f,h){c||(c={next:void 0}),o(c,f,h)}};return d}}}),Iq=G({"node_modules/side-channel-map/index.js"(t,e){"use strict";var r=fi(),i=ko(),n=As(),a=Mt(),o=r("%Map%",!0),s=i("Map.prototype.get",!0),l=i("Map.prototype.set",!0),u=i("Map.prototype.has",!0),c=i("Map.prototype.delete",!0),d=i("Map.prototype.size",!0);e.exports=!!o&&function(){var h,g={assert:function(v){if(!g.has(v))throw new a("Side channel does not contain "+n(v))},delete:function(v){if(h){var y=c(h,v);return d(h)===0&&(h=void 0),y}return!1},get:function(v){if(h)return s(h,v)},has:function(v){return h?u(h,v):!1},set:function(v,y){h||(h=new o),l(h,v,y)}};return g}}}),H0e=G({"node_modules/side-channel-weakmap/index.js"(t,e){"use strict";var r=fi(),i=ko(),n=As(),a=Iq(),o=Mt(),s=r("%WeakMap%",!0),l=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),c=i("WeakMap.prototype.has",!0),d=i("WeakMap.prototype.delete",!0);e.exports=s?(function(){var h,g,v={assert:function(y){if(!v.has(y))throw new o("Side channel does not contain "+n(y))},delete:function(y){if(s&&y&&(typeof y=="object"||typeof y=="function")){if(h)return d(h,y)}else if(a&&g)return g.delete(y);return!1},get:function(y){return s&&y&&(typeof y=="object"||typeof y=="function")&&h?l(h,y):g&&g.get(y)},has:function(y){return s&&y&&(typeof y=="object"||typeof y=="function")&&h?c(h,y):!!g&&g.has(y)},set:function(y,w){s&&y&&(typeof y=="object"||typeof y=="function")?(h||(h=new s),u(h,y,w)):a&&(g||(g=a()),g.set(y,w))}};return v}):a}}),K0e=G({"node_modules/side-channel/index.js"(t,e){"use strict";var r=Mt(),i=As(),n=W0e(),a=Iq(),o=H0e(),s=o||a||n;e.exports=function(){var u,c={assert:function(d){if(!c.has(d))throw new r("Side channel does not contain "+i(d))},delete:function(d){return!!u&&u.delete(d)},get:function(d){return u&&u.get(d)},has:function(d){return!!u&&u.has(d)},set:function(d,f){u||(u=s()),u.set(d,f)}};return c}}}),Cq=G({"node_modules/internal-slot/index.js"(t,e){"use strict";var r=So(),i=K0e()(),n=Mt(),a={assert:function(o,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`O` is not an object");if(typeof s!="string")throw new n("`slot` must be a string");if(i.assert(o),!a.has(o,s))throw new n("`"+s+"` is not present on `O`")},get:function(o,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`O` is not an object");if(typeof s!="string")throw new n("`slot` must be a string");var l=i.get(o);return l&&l["$"+s]},has:function(o,s){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`O` is not an object");if(typeof s!="string")throw new n("`slot` must be a string");var l=i.get(o);return!!l&&r(l,"$"+s)},set:function(o,s,l){if(!o||typeof o!="object"&&typeof o!="function")throw new n("`O` is not an object");if(typeof s!="string")throw new n("`slot` must be a string");var u=i.get(o);u||(u={},i.set(o,u)),u["$"+s]=l}};Object.freeze&&Object.freeze(a),e.exports=a}}),Z0e=G({"node_modules/has-proto/index.js"(t,e){"use strict";var r={__proto__:null,foo:{}},i={__proto__:r}.foo===r.foo&&!(r instanceof Object);e.exports=function(){return i}}}),J0e=G({"node_modules/es-abstract/2025/OrdinaryObjectCreate.js"(t,e){"use strict";var r=fi(),i=r("%Object.create%",!0),n=Mt(),a=Cl(),o=yn(),s=Aq(),l=G0e(),u=Cq(),c=Z0e()();e.exports=function(f){if(f!==null&&!o(f))throw new n("Assertion failed: `proto` must be null or an object");var h=arguments.length<2?[]:arguments[1];if(!s(h))throw new n("Assertion failed: `additionalInternalSlotsList` must be an Array");var g;if(c)g={__proto__:f};else if(i)g=i(f);else{if(f===null)throw new a("native Object.create support is required to create null objects");var v=function(){};v.prototype=f,g=new v}return h.length>0&&l(h,function(y){u.set(g,y,void 0)}),g}}}),Y0e=G({"node_modules/es-abstract/2025/CreateAsyncFromSyncIterator.js"(t,e){"use strict";var r=fi(),i=Cl(),n=Mt(),a=yn(),o=r("%Promise%",!0),s=V0e(),l=oS(),u=xq(),c=dv(),d=Pq(),f=Oq(),h=J0e(),g=pv(),v=Cq(),y=r("%AsyncFromSyncIteratorPrototype%",!0)||{next:function($){if(!o)throw new i("This environment does not support Promises.");var E=this;v.assert(E,"[[SyncIteratorRecord]]");var I=arguments.length;return new o(function(R){var M=v.get(E,"[[SyncIteratorRecord]]"),T;I>0?T=f(M,$):T=f(M),R(s(T))})},return:function(){if(!o)throw new i("This environment does not support Promises.");var w=this;v.assert(w,"[[SyncIteratorRecord]]");var $=arguments.length>0,E=$?arguments[0]:void 0;return new o(function(I,R){var M=v.get(w,"[[SyncIteratorRecord]]")["[[Iterator]]"],T=d(M,"return");if(typeof T>"u"){var O=u(E,!0);l(I,void 0,[O]);return}var N;if($?N=l(T,M,[E]):N=l(T,M),!a(N)){l(R,void 0,[new n("Iterator `return` method returned a non-object value.")]);return}I(s(N))})},throw:function(){if(!o)throw new i("This environment does not support Promises.");var w=this;v.assert(w,"[[SyncIteratorRecord]]");var $=arguments.length>0,E=$?arguments[0]:void 0;return new o(function(I,R){var M=v.get(w,"[[SyncIteratorRecord]]")["[[Iterator]]"],T=d(M,"throw");if(typeof T>"u"){l(R,void 0,[E]);return}var O;if($?O=l(T,M,[E]):O=l(T,M),!a(O)){l(R,void 0,[new n("Iterator `throw` method returned a non-object value.")]);return}I(s(O))})}};e.exports=function($){if(!g($))throw new n("Assertion failed: `syncIteratorRecord` must be an Iterator Record");var E=h(y);v.set(E,"[[SyncIteratorRecord]]",$);var I=c(E,"next");return{"[[Iterator]]":E,"[[NextMethod]]":I,"[[Done]]":!1}}}}),Q0e=G({"node_modules/es-abstract/2025/GetIteratorFromMethod.js"(t,e){"use strict";var r=Mt(),i=yn(),n=oS(),a=dv(),o=iS();e.exports=function(l,u){if(!o(u))throw new r("method must be a function");var c=n(u,l);if(!i(c))throw new r("iterator must return an object");var d=a(c,"next");return{"[[Iterator]]":c,"[[NextMethod]]":d,"[[Done]]":!1}}}}),X0e=G({"node_modules/has-tostringtag/shams.js"(t,e){"use strict";var r=dq();e.exports=function(){return r()&&!!Symbol.toStringTag}}}),eve=G({"node_modules/is-string/index.js"(t,e){"use strict";var r=ko(),i=r("String.prototype.valueOf"),n=function(u){try{return i(u),!0}catch{return!1}},a=r("Object.prototype.toString"),o="[object String]",s=X0e()();e.exports=function(u){return typeof u=="string"?!0:!u||typeof u!="object"?!1:s?n(u):a(u)===o}}}),tve=G({"node_modules/es-abstract/helpers/getIteratorMethod.js"(t,e){"use strict";var r=tS()(),i=fi(),n=ko(),a=eve(),o=i("%Symbol.iterator%",!0),s=n("String.prototype.slice"),l=i("%String%"),u=aS();e.exports=function(d,f){var h;return r?h=d.GetMethod(f,o):u(f)?h=function(){var g=-1,v=this;return{next:function(){return g+=1,{done:g>=v.length,value:v[g]}}}}:a(f)&&(h=function(){var g=0;return{next:function(){var v=d.AdvanceStringIndex(l(f),g,!0),y=s(f,g,v);g=v;var w=v>f.length;return{done:w,value:w?void 0:y}}}}),h}}}),rve=G({"node_modules/es-abstract/2025/GetIterator.js"(t,e){"use strict";var r=fi(),i=Mt(),n=r("%Symbol.asyncIterator%",!0),a=As(),o=tS()(),s=M0e(),l=Y0e(),u=Q0e(),c=Pq(),d={AdvanceStringIndex:s,GetMethod:c},f=tve();e.exports=function(g,v){if(v!=="SYNC"&&v!=="ASYNC")throw new i("Assertion failed: `kind` must be one of 'sync' or 'async', got "+a(v));var y;if(v==="ASYNC"&&o&&n&&(y=c(g,n)),typeof y>"u"){var w=f(d,g);if(v==="ASYNC"){if(typeof w>"u")throw new i("iterator method is `undefined`");var $=u(g,w);return l($)}y=w}if(typeof y>"u")throw new i("iterator method is `undefined`");return u(g,y)}}}),nve=G({"node_modules/es-abstract/2025/IteratorStep.js"(t,e){"use strict";var r=Mt(),i=$q(),n=Oq(),a=pv();e.exports=function(s){if(!a(s))throw new r("Assertion failed: `iteratorRecord` must be an Iterator Record");var l=n(s);try{var u=i(l)}catch(c){throw s["[[Done]]"]=!0,c}return u?(s["[[Done]]"]=!0,!1):l}}}),ive=G({"node_modules/es-abstract/2025/IteratorToList.js"(t,e){"use strict";var r=Mt(),i=nve(),n=Eq(),a=pv();e.exports=function(s){if(!a(s))throw new r("Assertion failed: `iteratorRecord` must be an Iterator Record");for(var l=[],u=!0;u;)if(u=i(s),u){var c=n(u);l[l.length]=c}return l}}}),ave=G({"node_modules/set-proto/Reflect.setPrototypeOf.js"(t,e){"use strict";e.exports=typeof Reflect<"u"&&Reflect.setPrototypeOf||null}}),ove=G({"node_modules/set-proto/Object.setPrototypeOf.js"(t,e){"use strict";var r=eS();e.exports=r.setPrototypeOf||null}}),sve=G({"node_modules/dunder-proto/set.js"(t,e){"use strict";var r=cv(),i=jl(),n=Mt(),a={};try{a.__proto__=null}catch(l){if(!l||typeof l!="object"||!("code"in l)||l.code!=="ERR_PROTO_ACCESS")throw l}var o=!("toString"in a),s=i&&i(Object.prototype,"__proto__");e.exports=o&&(!!s&&typeof s.set=="function"&&r([s.set])||function(u,c){if(u==null)throw new n("set Object.prototype.__proto__ called on null or undefined");return u.__proto__=c,c})}}),lve=G({"node_modules/set-proto/index.js"(t,e){"use strict";var r=ave(),i=ove(),n=sve(),a=Mt();e.exports=r?function(s,l){if(r(s,l))return s;throw new a("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:i||(n?function(s,l){return n(s,l),s}:null)}}),uve=G({"node_modules/es-abstract/2025/OrdinaryGetPrototypeOf.js"(t,e){"use strict";var r=Mt(),i=yn(),n=hq();e.exports=function(o){if(!i(o))throw new r("Assertion failed: O must be an Object");if(!n)throw new r("This environment does not support fetching prototypes.");return n(o)}}}),cve=G({"node_modules/es-abstract/2025/OrdinarySetPrototypeOf.js"(t,e){"use strict";var r=Mt(),i=lve(),n=yn(),a=uve();e.exports=function(s,l){if(l!==null&&!n(l))throw new r("Assertion failed: V must be Object or Null");try{i(s,l)}catch{return!1}return a(s)===l}}}),jq=G({"node_modules/es-aggregate-error/implementation.js"(t,e){"use strict";var r=k0e(),i=C0e(),n=rve(),a=yf()(),o=ive(),s=cve(),l=lq();function u(d,f){var h=new l(f);s(h,c),delete h.constructor;var g=o(n(d,"SYNC"));return r(h,"errors",g),h}a&&Object.defineProperty(u,"prototype",{writable:!1});var c=u.prototype;i(c,"constructor",u),i(c,"message",""),i(c,"name","AggregateError"),s(u.prototype,Error.prototype),e.exports=u}}),Tq=G({"node_modules/es-aggregate-error/polyfill.js"(t,e){"use strict";var r=jq();e.exports=function(){return typeof AggregateError=="function"?AggregateError:r}}}),Rq=G({"node_modules/globalthis/implementation.js"(t,e){"use strict";e.exports=global}}),Dq=G({"node_modules/globalthis/polyfill.js"(t,e){"use strict";var r=Rq();e.exports=function(){return typeof global!="object"||!global||global.Math!==Math||global.Array!==Array?r:global}}}),dve=G({"node_modules/globalthis/shim.js"(t,e){"use strict";var r=uv(),i=jl(),n=Dq();e.exports=function(){var o=n();if(r.supportsDescriptors){var s=i(o,"globalThis");(!s||s.configurable&&(s.enumerable||!s.writable||globalThis!==o))&&Object.defineProperty(o,"globalThis",{configurable:!0,enumerable:!1,value:o,writable:!0})}else(typeof globalThis!="object"||globalThis!==o)&&(o.globalThis=o);return o}}}),pve=G({"node_modules/globalthis/index.js"(t,e){"use strict";var r=uv(),i=Rq(),n=Dq(),a=dve(),o=n(),s=function(){return o};r(s,{getPolyfill:n,implementation:i,shim:a}),e.exports=s}}),fve=G({"node_modules/es-aggregate-error/shim.js"(t,e){"use strict";var r=uv(),i=pve()(),n=Tq();e.exports=function(){var o=n();return r(i,{AggregateError:o},{AggregateError:function(){return i.AggregateError!==o}}),o}}}),sS=G({"node_modules/es-aggregate-error/index.js"(t,e){"use strict";var r=$c(),i=uv(),n=r0e(),a=lv(),o=jq(),s=Tq(),l=fve(),u=s(),c=n(r.call(u),u.name,!0);a(c,"prototype",u.prototype,!0,!0,!0,!0),i(c,{getPolyfill:s,implementation:o,shim:l}),e.exports=c}}),Nq=G({"node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/common/error.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toParsedPath=t.wrapError=void 0;var e=(jr(),Pt(Or)),r=vn(),i=(0,e.__importDefault)(sS()),n=gf(),a=aq();function o(u){return u instanceof n.RulesetValidationError?(u.path.unshift(...this),u):new n.RulesetValidationError("generic-validation-error",(0,r.isError)(u)?u.message:String(u),[...this])}function s(u,c){let d=l(c);return(0,a.isAggregateError)(u)?new i.default(u.errors.map(o,d)):o.call(d,u)}t.wrapError=s;function l(u){return u.slice(1).split("/")}t.toParsedPath=l}}),mve=G({"node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/alias.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAlias=void 0;var e=(Zr(),Pt(Fr)),r=vn(),i=nq(),n=sv(),a=Nq(),o=gf();function s(d,f){if(!Array.isArray(d))return null;let h=Number(f);if(Number.isNaN(h)||h<0&&h>=d.length)return null;let g=d[h];return(0,e.isPlainObject)(g)&&(0,e.isPlainObject)(g.aliases)?g.aliases:null}function l(d,f){if(!Array.isArray(d))return null;let h=f[1],g=Number(h);if(Number.isNaN(g)||g<0&&g>=d.length)return null;let v=d[g],y=Array.isArray(v),w=y?v[0]:v,$=(0,e.isPlainObject)(w)&&(0,e.isPlainObject)(w.aliases)?w.aliases:null,E=y?3:2;if(f.length>=E+2&&f[E]==="overrides")return{...$,...s(w.overrides,f[E+1])};if(f.length>=E+2&&f[E]==="extends"&&(0,e.isPlainObject)(w)&&Array.isArray(w.extends)){let I=l(w.extends,f.slice(E));return I??$}return $}function u(d,f){return d[0]==="extends"?l(f.extends,d):d[0]==="overrides"?{...f.aliases,...s(f.overrides,d[1])}:f.aliases}function c(d,f,h){let g=(0,a.toParsedPath)(h);try{let v=(0,r.get)(d,[...g.slice(0,g.indexOf("rules")+2),"formats"]),y=u(g,d);(0,i.resolveAlias)(y??null,f,Array.isArray(v)?new n.Formats(v):null)}catch(v){return v instanceof ReferenceError?new o.RulesetValidationError("undefined-alias",v.message,g):(0,a.wrapError)(v,h)}}t.validateAlias=c}}),hve=G({"node_modules/@stoplight/spectral-core/dist/ruleset/validation/validators/function.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateFunction=void 0;var e=Nq(),r=gf();function i(a){if(typeof a!="function")throw ReferenceError("Function is not defined")}function n(a,o,s){try{if(i(a),!("validator"in a))return;a.validator.bind(a)(o)}catch(l){return l instanceof ReferenceError?new r.RulesetValidationError("undefined-function",l.message,[...(0,e.toParsedPath)(s),"function"]):(0,e.wrapError)(l,s)}}t.validateFunction=n}}),gve=G({"node_modules/@stoplight/spectral-core/dist/ruleset/validation/ajv.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createValidator=void 0;var e=(jr(),Pt(Or)),r=(0,e.__importStar)(Lt("ajv")),i=(0,e.__importDefault)(Lt("ajv/dist/compile/names")),n=(0,e.__importDefault)(oq()),a=(0,e.__importDefault)(Q7()),o=(0,e.__importStar)(Wge()),s=(0,e.__importStar)(Hge()),l=(0,e.__importStar)(Kge()),u=(0,e.__importStar)(Zge()),c=(0,e.__importStar)(Jge()),d=mve(),f=hve(),h={js:null,json:null};function g(v){let y=h[v];if(y!==null)return y;let w=new r.default({allErrors:!0,strict:!0,strictRequired:!1,keywords:["$anchor"],schemas:[o,s],passContext:!0});(0,n.default)(w),(0,a.default)(w),w.addKeyword({keyword:"x-spectral-runtime",schemaType:"string",error:{message(E){var I;return(0,r._)`${((I=E.params)===null||I===void 0?void 0:I.message)!==void 0?E.params.message:""}`},params(E){var I;return(0,r._)`{ errors: ${((I=E.params)===null||I===void 0?void 0:I.errors)!==void 0&&E.params.errors} || [] }`}},code(E){let{data:I}=E;switch(E.schema){case"format":E.fail((0,r._)`typeof ${I} !== "function"`);break;case"ruleset-function":{let R=E.gen.const("spectralFunction",(0,r._)`this.validateFunction(${I}.function, ${I}.functionOptions === void 0 ? null : ${I}.functionOptions, ${i.default.instancePath})`);E.gen.if((0,r._)`${R} !== void 0`),E.error(!1,{errors:R}),E.gen.endIf();break}case"alias":{let R=E.gen.const("spectralAlias",(0,r._)`this.validateAlias(${i.default.rootData}, ${I}, ${i.default.instancePath})`);E.gen.if((0,r._)`${R} !== void 0`),E.error(!1,{errors:R}),E.gen.endIf();break}}}}),v==="js"?w.addSchema(u):w.addSchema(c);let $=new Proxy(w.compile(l),{apply(E,I,R){return Reflect.apply(E,{validateAlias:d.validateAlias,validateFunction:f.validateFunction},R)}});return h[v]=$,$}t.createValidator=g}}),Lq=G({"node_modules/@stoplight/spectral-core/dist/ruleset/validation/assertions.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidRule=t.assertValidRuleset=void 0;var e=(jr(),Pt(Or)),r=(Zr(),Pt(Fr)),i=gve(),n=gf(),a=(0,e.__importDefault)(sS());function o(u,c="js",d){var f,h;if(!(0,r.isPlainObject)(u))throw new n.RulesetValidationError("invalid-ruleset-definition","Provided ruleset is not an object",[],d===void 0?void 0:{source:d.source});if(!("rules"in u)&&!("extends"in u)&&!("overrides"in u))throw new n.RulesetValidationError("invalid-ruleset-definition","Ruleset must have rules or extends or overrides defined",[],d===void 0?void 0:{source:d.source,range:(f=d.getLocationForJsonPath([]))===null||f===void 0?void 0:f.range});let g=(0,i.createValidator)(c);if(!g(u))throw new a.default((0,n.convertAjvErrors)((h=g.errors)!==null&&h!==void 0?h:[],d))}t.assertValidRuleset=o;function s(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&("given"in u||"then"in u)}function l(u,c){if(!s(u))throw new n.RulesetValidationError("invalid-rule-definition","Rule definition expected",["rules",c])}t.assertValidRule=l}}),lS=G({"node_modules/@stoplight/spectral-core/dist/ruleset/validation/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidRuleset=t.RulesetValidationError=void 0;var e=gf();Object.defineProperty(t,"RulesetValidationError",{enumerable:!0,get:function(){return e.RulesetValidationError}});var r=Lq();Object.defineProperty(t,"assertValidRuleset",{enumerable:!0,get:function(){return r.assertValidRuleset}})}}),vve=G({"node_modules/@stoplight/spectral-core/dist/ruleset/mergers/rules.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeRule=void 0;var e=Lq(),r=Y7();function i(a,o){if(a===void 0)throw new ReferenceError(`Cannot extend non-existing rule: "${o}"`)}function n(a,o,s,l){switch(typeof s){case"boolean":i(a,o),a.enabled=s;break;case"string":case"number":i(a,o),a.severity=s,s==="off"?a.enabled=!1:a.enabled||(a.enabled=!0);break;case"object":if(a!==void 0)Object.assign(a,s,{enabled:!0,owner:a.owner});else return(0,e.assertValidRule)(s,o),new r.Rule(o,s,l);break;default:throw new Error("Invalid value")}return a}t.mergeRule=n}}),yve=G({"node_modules/@stoplight/spectral-core/dist/ruleset/mergers/rulesets.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeRulesets=void 0;function e(n){return Array.isArray(n)?n[0]:n}function r(n){return(Array.isArray(n)?n:[n]).map(e)}function i(n,a,o){let s={...n,...a};if("extends"in s&&"extends"in s){let l=r(s.extends);s.extends=[...(Array.isArray(s.extends)?s.extends:[s.extends]).filter(u=>!l.includes(e(u))),...Array.isArray(s.extends)?s.extends:[s.extends]]}if("aliases"in n&&"aliases"in a&&(s.aliases={...n.aliases,...a.aliases}),!("rules"in n)||!("rules"in a))return s;if(o)s.rules={...n.rules,...a.rules};else{let l=s;"extends"in l?Array.isArray(l.extends)?l.extends=[...l.extends,n]:l.extends=[l.extends,n]:l.extends=n}return s}t.mergeRulesets=i}}),Mq=G({"node_modules/@stoplight/spectral-core/dist/ruleset/ruleset.js"(t){"use strict";var e,r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.Ruleset=void 0;var n=(jr(),Pt(Or)),a=($s(),Pt(xs)),o=(Zr(),Pt(Fr)),s=eq(),l=Y7(),u=lS(),c=vve(),d=Xr(),f=yve(),h=sv(),g=rq(),v=Symbol("@stoplight/spectral/ruleset/#stack"),y=Symbol("@stoplight/spectral/ruleset/#explicit-severity"),w=/^\.?spectral\.(ya?ml|json|m?js)$/,$=1,E=class $7{constructor(R,M){var T;this.maybeDefinition=R,e.add(this),this.id=$++,this.formats=new h.Formats,r.set(this,void 0);let O;if((0,o.isPlainObject)(R)&&"extends"in R){let{extends:x,...b}=R;(0,u.assertValidRuleset)({extends:[],...b},"js",M?.sourceContext),O=R}else(0,u.assertValidRuleset)(R,"js",M?.sourceContext),O=R;this.definition=O,(0,n.__classPrivateFieldSet)(this,r,{severity:"recommended",...M},"f");let N=!1;this.aliases=O.aliases===void 0?null:Object.fromEntries(Object.entries(O.aliases).map(x=>{let[b,U]=x;if((0,g.isSimpleAliasDefinition)(U))return x;N=!0;let k=U.targets.map(A=>({formats:new h.Formats(A.formats),given:A.given}));return[b,{...U,targets:k}]})),this.hasComplexAliases=N;let j=(T=M?.[v])!==null&&T!==void 0?T:new Map;if(j.set(this.definition,this),this.extends="extends"in O?(Array.isArray(O.extends)?O.extends:[O.extends]).reduce((x,b)=>{let U,k="recommended",A=Array.isArray(b);return A?[U,k]=b:U=b,j.get(U)!==void 0||x.push(new $7(U,{severity:k,[v]:j,[y]:A})),x},[]):null,j.size===1&&O.overrides?this.overrides=O.overrides:this.overrides=null,j.delete(this.definition),Array.isArray(this.definition.formats))for(let x of this.definition.formats)this.formats.add(x);if(Array.isArray(this.extends))for(let{formats:x}of this.extends)for(let b of x)this.formats.add(b);this.rules=(0,n.__classPrivateFieldGet)(this,e,"m",i).call(this)}get source(){var R;return(R=(0,n.__classPrivateFieldGet)(this,r,"f").source)!==null&&R!==void 0?R:null}fromSource(R){if(this.overrides===null)return this;let{source:M}=this;if(R===null)throw new Error("Document must have some source assigned. If you use Spectral programmatically make sure to pass the source to Document");if(M===null)throw new Error("Ruleset must have some source assigned. If you use Spectral programmatically make sure to pass the source to Ruleset");let T=(0,a.relative)((0,a.dirname)(M),R),O={},N=this.overrides.flatMap(({files:k,...A})=>{var z,H;let se=[];for(let ge of k){let ae=(z=(0,o.extractSourceFromRef)(ge))!==null&&z!==void 0?z:ge;if(!(0,s.minimatch)(T,ae))continue;let ke=(0,o.extractPointerFromRef)(ge);if(ae===ge)se.push(ge);else{if(!("rules"in A)||ke===null)throw new Error("Unknown error. The ruleset is presumably invalid.");for(let[W,re]of Object.entries(A.rules)){if(typeof re=="object"||typeof re=="boolean")throw new Error("Unknown error. The ruleset is presumably invalid.");let{definition:de}=(H=O[W])!==null&&H!==void 0?H:O[W]={rulesetSource:M,definition:new Map},Pe=(0,d.getDiagnosticSeverity)(re),Ce=de.get(ae);Ce===void 0&&(Ce=new Map,de.set(ae,Ce)),Ce.set(ke,Pe)}}}return se.length===0?[]:A}),{overrides:j,...x}=this.definition;if(N.length===0&&Object.keys(O).length===0)return this;let b=N.length===0?null:N.length>1?N.slice(1).reduce((k,A)=>(0,f.mergeRulesets)(k,A,!0),N[0]):N[0],U=new $7(b===null?x:(0,f.mergeRulesets)(x,b,!1),{severity:"recommended",source:M});for(let[k,A]of Object.entries(O))k in U.rules&&(U.rules[k].overrides=A);return U}get parserOptions(){return{...d.DEFAULT_PARSER_OPTIONS,...this.definition.parserOptions}}static isDefaultRulesetFile(R){return w.test(R)}toJSON(){return{id:this.id,extends:this.extends,source:this.source,aliases:this.aliases,formats:this.formats.size===0?null:this.formats,rules:this.rules,overrides:this.overrides,parserOptions:this.parserOptions}}};t.Ruleset=E,r=new WeakMap,e=new WeakSet,i=function(){let R={};if(this.extends!==null&&this.extends.length>0){for(let M of this.extends)if(M!==this)for(let T of Object.values(M.rules))R[T.name]=T,(0,n.__classPrivateFieldGet)(this,r,"f")[v]!==void 0&&(0,n.__classPrivateFieldGet)(this,r,"f")[y]===!0&&(T.enabled=l.Rule.isEnabled(T,(0,n.__classPrivateFieldGet)(this,r,"f").severity))}if("rules"in this.definition)for(let[M,T]of Object.entries(this.definition.rules)){let O=(0,c.mergeRule)(R[M],M,T,this);if(R[M]=O,(O.owner===this||(0,n.__classPrivateFieldGet)(this,r,"f")[y]===!0)&&(O.enabled=l.Rule.isEnabled(O,(0,n.__classPrivateFieldGet)(this,r,"f").severity)),O.formats!==null)for(let N of O.formats)this.formats.add(N);else O.owner!==this?O.formats=O.owner.definition.formats===void 0?null:new h.Formats(O.owner.definition.formats):this.definition.formats!==void 0&&(O.formats=new h.Formats(this.definition.formats));this.definition.documentationUrl!==void 0&&O.documentationUrl===null&&(O.documentationUrl=`${this.definition.documentationUrl}#${M}`)}return R}}}),_ve=G({"node_modules/@stoplight/spectral-core/dist/utils/generateDocumentWideResult.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateDocumentWideResult=void 0;var e=Sc(),r=(i,n,a,o)=>{var s;return{range:(s=i.getRangeForJsonPath([],!0))!==null&&s!==void 0?s:e.Document.DEFAULT_RANGE,message:n,code:o,severity:a,...i.source!==null?{source:i.source}:null,path:[]}};t.generateDocumentWideResult=r}}),wve=G({"node_modules/@stoplight/spectral-core/dist/ruleset/function.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createRulesetFunction=t.RulesetFunctionValidationError=void 0;var e=(jr(),Pt(Or)),r=(0,e.__importDefault)(Lt("ajv")),i=(0,e.__importDefault)(oq()),n=(0,e.__importDefault)(Q7()),a=ba(),o=lS(),s=vn(),l=sS(),u=new r.default({allErrors:!0,allowUnionTypes:!0,strict:!0,keywords:["x-internal"]});(0,n.default)(u),(0,i.default)(u);var c=class E7 extends o.RulesetValidationError{constructor(g,v){super("invalid-function-options",E7.printMessage(g,v),E7.getPath(v))}static getPath(g){let v=["functionOptions",...g.instancePath===""?[]:g.instancePath.slice(1).split("/")];if(g.keyword==="additionalProperties"){let y=g.params.additionalProperty;v.push(y)}return v}static printMessage(g,v){var y;switch(v.keyword){case"type":{let w=(0,a.printPath)(v.instancePath.slice(1).split("/"),a.PrintStyle.Dot),$=Array.isArray(v.params.type)?v.params.type.join(", "):String(v.params.type);return`"${g}" function and its "${w}" option accepts only the following types: ${$}`}case"required":{let w=v.params.missingProperty,$=v.instancePath===""?w:(0,a.printPath)([...v.instancePath.slice(1).split("/"),w],a.PrintStyle.Dot);return`"${g}" function is missing "${$}" option`}case"additionalProperties":{let w=v.params.additionalProperty,$=v.instancePath===""?w:(0,a.printPath)([...v.instancePath.slice(1).split("/"),w],a.PrintStyle.Dot);return`"${g}" function does not support "${$}" option`}case"enum":{let w=(0,a.printPath)(v.instancePath.slice(1).split("/"),a.PrintStyle.Dot),$=v.params.allowedValues.map(a.printValue).join(", ");return`"${g}" function and its "${w}" option accepts only the following values: ${$}`}default:return(y=v.message)!==null&&y!==void 0?y:"unknown error"}}};t.RulesetFunctionValidationError=c;var d=h=>h===null;function f({input:h,errorOnInvalidInput:g=!1,options:v},y){let w=v===null?d:u.compile(v),$=h!==null?u.compile(h):h,E=function(R,M,...T){var O,N,j;return $?.(R)===!1?g?[{message:(j=(N=(O=$.errors)===null||O===void 0?void 0:O.find(x=>x.keyword==="errorMessage"))===null||N===void 0?void 0:N.message)!==null&&j!==void 0?j:"invalid input"}]:void 0:(E.validator(M),y(R,M,...T))};Reflect.defineProperty(E,"name",{value:y.name});let I=new WeakSet;return E.validator=function(R){if(!((0,s.isObject)(R)&&I.has(R))){if(w(R)){(0,s.isObject)(R)&&I.add(R);return}throw v===null?new o.RulesetValidationError("invalid-function-options",`"${y.name||"<unknown>"}" function does not accept any options`,["functionOptions"]):"errors"in w&&Array.isArray(w.errors)&&w.errors.length>0?new l(w.errors.map(M=>new c(y.name||"<unknown>",M))):new o.RulesetValidationError("invalid-function-options",`"functionOptions" of "${y.name||"<unknown>"}" function must be valid`,["functionOptions"])}},Reflect.defineProperty(E,"schemas",{enumerable:!1,value:{input:h,options:v}}),E}t.createRulesetFunction=f}}),zq=G({"node_modules/@stoplight/spectral-core/dist/ruleset/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Rule=t.Formats=t.Ruleset=t.createRulesetFunction=t.getDiagnosticSeverity=t.RulesetValidationError=t.assertValidRuleset=void 0;var e=lS();Object.defineProperty(t,"assertValidRuleset",{enumerable:!0,get:function(){return e.assertValidRuleset}}),Object.defineProperty(t,"RulesetValidationError",{enumerable:!0,get:function(){return e.RulesetValidationError}});var r=tq();Object.defineProperty(t,"getDiagnosticSeverity",{enumerable:!0,get:function(){return r.getDiagnosticSeverity}});var i=wve();Object.defineProperty(t,"createRulesetFunction",{enumerable:!0,get:function(){return i.createRulesetFunction}});var n=Mq();Object.defineProperty(t,"Ruleset",{enumerable:!0,get:function(){return n.Ruleset}});var a=sv();Object.defineProperty(t,"Formats",{enumerable:!0,get:function(){return a.Formats}});var o=Y7();Object.defineProperty(t,"Rule",{enumerable:!0,get:function(){return o.Rule}})}}),bve=G({"node_modules/@stoplight/spectral-core/dist/types/spectral.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}}),Sve=G({"node_modules/@stoplight/spectral-core/dist/types/function.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})}}),kve=G({"node_modules/@stoplight/spectral-core/dist/types/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=(jr(),Pt(Or));(0,e.__exportStar)(bve(),t),(0,e.__exportStar)(Sve(),t)}}),xve=G({"node_modules/@stoplight/spectral-core/dist/spectral.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Spectral=void 0;var e=(jr(),Pt(Or)),r=(Zr(),Pt(Fr)),i=Q0(),n=(0,e.__importStar)(mz()),a=Hhe(),o=Sc(),s=Khe(),l=Vge(),u=Mq(),c=_ve(),d=zq();(0,e.__exportStar)(kve(),t);var f=class{constructor(h){this.opts=h,h?.resolver!==void 0?this._resolver=h.resolver:this._resolver=(0,a.createHttpAndFileResolver)()}parseDocument(h){return h instanceof o.Document?h:(0,o.isParsedResult)(h)?new o.ParsedDocument(h):new o.Document(typeof h=="string"?h:(0,r.stringify)(h,void 0,2),n.Yaml)}async runWithResolved(h,g={}){if(this.ruleset===void 0)throw new Error("No ruleset has been defined. Have you called setRuleset()?");let v=this.parseDocument(h),y=this.ruleset.fromSource(v.source),w=new s.DocumentInventory(v,this._resolver);await w.resolve();let $=new l.Runner(w);if($.results.push(...this._filterParserErrors(v.diagnostics,y.parserOptions)),v.formats===void 0){let I=[...y.formats].filter(R=>R(w.resolved,v.source));I.length===0&&g.ignoreUnknownFormat!==!0?(v.formats=null,y.formats.size>0&&$.addResult(this._generateUnrecognizedFormatError(v,Array.from(y.formats)))):v.formats=new Set(I)}await $.run(y);let E=$.getResults();return{resolved:w.resolved,results:E}}async run(h,g={}){return(await this.runWithResolved(h,g)).results}setRuleset(h){this.ruleset=h instanceof u.Ruleset?h:new u.Ruleset(h)}_generateUnrecognizedFormatError(h,g){return(0,c.generateDocumentWideResult)(h,`The provided document does not match any of the registered formats [${g.map(v=>{var y;return(y=v.displayName)!==null&&y!==void 0?y:v.name}).join(", ")}]`,i.DiagnosticSeverity.Warning,"unrecognized-format")}_filterParserErrors(h,g){return h.reduce((v,y)=>{if(y.code!=="parser")return v;let w;if(y.message.startsWith("Mapping key must be a string scalar rather than"))w=(0,d.getDiagnosticSeverity)(g.incompatibleValues);else if(y.message.startsWith("Duplicate key"))w=(0,d.getDiagnosticSeverity)(g.duplicateKeys);else return v.push(y),v;return w!==-1&&(v.push(y),y.severity=w),v},[])}};t.Spectral=f}}),Xr=G({"node_modules/@stoplight/spectral-core/dist/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParsedDocument=t.Document=void 0;var e=(jr(),Pt(Or));(0,e.__exportStar)(Vfe(),t),(0,e.__exportStar)(xve(),t);var r=Sc();Object.defineProperty(t,"Document",{enumerable:!0,get:function(){return r.Document}}),Object.defineProperty(t,"ParsedDocument",{enumerable:!0,get:function(){return r.ParsedDocument}}),(0,e.__exportStar)(zq(),t)}}),qq=G({"node_modules/@stoplight/spectral-functions/dist/types.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CasingType=void 0;var e;(function(r){r.flat="flat",r.camel="camel",r.pascal="pascal",r.kebab="kebab",r.cobol="cobol",r.snake="snake",r.macro="macro"})(e=t.CasingType||(t.CasingType={}))}}),Ti=G({"node_modules/@stoplight/spectral-functions/dist/optionSchemas.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.optionSchemas=void 0;var e=qq();t.optionSchemas={alphabetical:{type:["object","null"],properties:{keyedBy:{type:"string",description:"The key to sort an object by."}},additionalProperties:!1,errorMessage:{type:'"alphabetical" function has invalid options specified. Example valid options: null (no options), { "keyedBy": "my-key" }'}},casing:{required:["type"],type:"object",properties:{type:{type:"string",enum:Object.values(e.CasingType),errorMessage:`"casing" function and its "type" option accept the following values: ${Object.values(e.CasingType).join(", ")}`,description:"The casing type to match against."},disallowDigits:{type:"boolean",default:!1,description:"If not true, digits are allowed."},separator:{type:"object",required:["char"],additionalProperties:!1,properties:{char:{type:"string",maxLength:1,errorMessage:'"casing" function and its "separator.char" option accepts only char, i.e. "I" or "/"',description:"The additional char to separate groups of words."},allowLeading:{type:"boolean",description:"Can the group separator char be used at the first char?"}}}},additionalProperties:!1,errorMessage:{type:'"casing" function has invalid options specified. Example valid options: { "type": "camel" }, { "type": "pascal", "disallowDigits": true }'}},defined:null,enumeration:{type:"object",additionalProperties:!1,properties:{values:{type:"array",items:{type:["string","number","null","boolean"]},errorMessage:'"enumeration" and its "values" option support only arrays of primitive values, i.e. ["Berlin", "London", "Paris"]',description:"An array of possible values."}},required:["values"],errorMessage:{type:'"enumeration" function has invalid options specified. Example valid options: { "values": ["Berlin", "London", "Paris"] }, { "values": [2, 3, 5, 8, 13, 21] }'}},falsy:null,length:{type:"object",properties:{min:{type:"number",description:"The minimum length to match."},max:{type:"number",description:"The maximum length to match."}},minProperties:1,additionalProperties:!1,errorMessage:{type:'"length" function has invalid options specified. Example valid options: { "min": 2 }, { "max": 5 }, { "min": 0, "max": 10 }'}},or:{type:"object",properties:{properties:{type:"array",items:{type:"string"},minItems:2,errorMessage:'"or" requires at least two enumerated "properties", i.e. ["default", "example"], ["title", "summary", "description"], etc.',description:"The properties to check."}},additionalProperties:!1,required:["properties"],errorMessage:{type:'"or" function has invalid options specified. Example valid options: { "properties": ["default", "example"] }, { "properties": ["title", "summary", "description"] }, etc.'}},pattern:{type:"object",additionalProperties:!1,properties:{match:{anyOf:[{type:"string"},{type:"object",properties:{exec:{},test:{},flags:{type:"string"}},required:["test","flags"],"x-internal":!0}],errorMessage:'"pattern" function and its "match" option must be string or RegExp instance',description:"If provided, value must match this regex."},notMatch:{anyOf:[{type:"string"},{type:"object",properties:{exec:{},test:{},flags:{type:"string"}},required:["test","flags"],"x-internal":!0}],errorMessage:'"pattern" function and its "notMatch" option must be string or RegExp instance',description:"If provided, value must _not_ match this regex."}},minProperties:1,errorMessage:{type:'"pattern" function has invalid options specified. Example valid options: { "match": "^Stoplight" }, { "notMatch": "Swagger" }, { "match": "Stoplight", "notMatch": "Swagger" }',minProperties:'"pattern" function has invalid options specified. Example valid options: { "match": "^Stoplight" }, { "notMatch": "Swagger" }, { "match": "Stoplight", "notMatch": "Swagger" }'}},truthy:null,undefined:null,schema:{additionalProperties:!1,properties:{schema:{type:"object",description:"Any valid JSON Schema document."},dialect:{enum:["auto","draft4","draft6","draft7","draft2019-09","draft2020-12"],default:"auto",description:"The JSON Schema draft used by function."},allErrors:{type:"boolean",default:!1,description:"Returns all errors when true; otherwise only returns the first error."},prepareResults:{"x-internal":!0}},required:["schema"],type:"object",errorMessage:{type:'"schema" function has invalid options specified. Example valid options: { "schema": { /* any JSON Schema can be defined here */ } , { "schema": { "type": "object" }, "dialect": "auto" }'}},unreferencedReusableObject:{type:"object",properties:{reusableObjectsLocation:{type:"string",format:"json-pointer-uri-fragment",errorMessage:'"unreferencedReusableObject" and its "reusableObjectsLocation" option support only valid JSON Pointer fragments, i.e. "#", "#/foo", "#/paths/~1user"',description:"A local json pointer to the document member holding the reusable objects (eg. #/definitions for an OAS2 document, #/components/schemas for an OAS3 document)."}},additionalProperties:!1,required:["reusableObjectsLocation"],errorMessage:{type:'"unreferencedReusableObject" function has invalid options specified. Example valid options: { "reusableObjectsLocation": "#/components/schemas" }, { "reusableObjectsLocation": "#/$defs" }',required:'"unreferencedReusableObject" function is missing "reusableObjectsLocation" option. Example valid options: { "reusableObjectsLocation": "#/components/schemas" }, { "reusableObjectsLocation": "#/$defs" }'}},xor:{type:"object",properties:{properties:{type:"array",items:{type:"string"},minItems:2,errorMessage:'"xor" requires at least two enumerated "properties", i.e. ["country", "street"], ["one", "two", "three"], etc.',description:"The properties to check."}},additionalProperties:!1,required:["properties"],errorMessage:{type:'"xor" function has invalid options specified. Example valid options: { "properties": ["country", "street"] }, { "properties": ["one", "two", "three"] }, etc.'}}}}}),$ve=G({"node_modules/@stoplight/spectral-functions/dist/alphabetical.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=vn(),r=Xr(),i=ba(),n=Ti(),a=(u,c)=>(typeof u=="number"||Number.isNaN(Number(u)))&&(typeof c=="number"||!Number.isNaN(Number(c)))?Math.min(1,Math.max(-1,Number(u)-Number(c))):typeof u!="string"||typeof c!="string"?0:u.localeCompare(c),o=(u,c)=>{for(let d=0;d<u.length-1;d+=1)if(c(u[d],u[d+1])>=1)return[d,d+1];return null};function s(u){return typeof u=="string"||typeof u=="number"}function l(u){return u.every(s)}t.default=(0,r.createRulesetFunction)({input:{type:["object","array"]},options:n.optionSchemas.alphabetical},function(c,d,{path:f,documentInventory:h}){var g,v;let y;if(Array.isArray(c)?y=c:y=Object.keys((v=(g=h.findAssociatedItemForPath(f,!0))===null||g===void 0?void 0:g.document.trapAccess(c))!==null&&v!==void 0?v:c),y.length<2)return;let w=d?.keyedBy;if(w!==void 0){let E=[];for(let I of y){if(!(0,e.isObject)(I))return[{message:'#{{print("property")}}must be an object'}];E.push(I[w])}y=E}if(!l(y))return[{message:'#{{print("property")}}must be one of the allowed types: number, string'}];let $=o(y,a);if($!=null)return[{...w===void 0?{path:[...f,Array.isArray(c)?$[0]:y[$[0]]]}:null,message:w!==void 0?"properties must follow the alphabetical order":`${(0,i.printValue)(y[$[0]])} must be placed after ${(0,i.printValue)(y[$[1]])}`}]})}}),Eve=G({"node_modules/@stoplight/spectral-functions/dist/casing.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CasingType=void 0;var e=vn(),r=Xr(),i=Ti(),n=qq();Object.defineProperty(t,"CasingType",{enumerable:!0,get:function(){return n.CasingType}});var a={[n.CasingType.flat]:"[a-z][a-z{__DIGITS__}]*",[n.CasingType.camel]:"[a-z][a-z{__DIGITS__}]*(?:[A-Z{__DIGITS__}](?:[a-z{__DIGITS__}]+|$))*",[n.CasingType.pascal]:"[A-Z][a-z{__DIGITS__}]*(?:[A-Z{__DIGITS__}](?:[a-z{__DIGITS__}]+|$))*",[n.CasingType.kebab]:"[a-z][a-z{__DIGITS__}]*(?:-[a-z{__DIGITS__}]+)*",[n.CasingType.cobol]:"[A-Z][A-Z{__DIGITS__}]*(?:-[A-Z{__DIGITS__}]+)*",[n.CasingType.snake]:"[a-z][a-z{__DIGITS__}]*(?:_[a-z{__DIGITS__}]+)*",[n.CasingType.macro]:"[A-Z][A-Z{__DIGITS__}]*(?:_[A-Z{__DIGITS__}]+)*"};t.default=(0,r.createRulesetFunction)({input:{type:"string",minLength:1},options:i.optionSchemas.casing},function(u,c){if(!(u.length===1&&c.separator!==void 0&&c.separator.allowLeading===!0&&u===c.separator.char||s(a[c.type],c).test(u)))return[{message:`must be ${c.type} case`}]});var o="0-9",s=(l,u)=>{let c=u.disallowDigits!==!0,d=l.replace(/\{__DIGITS__\}/g,c?o:"");if(u.separator===void 0)return new RegExp(`^${d}$`);let f=`[${(0,e.escapeRegExp)(u.separator.char)}]`,h=u.separator.allowLeading===!0?`${f}?`:"";return new RegExp(`^${h}${d}(?:${f}${d})*$`)}}}),Ave=G({"node_modules/@stoplight/spectral-functions/dist/defined.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=Ti();t.default=(0,e.createRulesetFunction)({input:null,options:r.optionSchemas.defined},function(n){if(typeof n>"u")return[{message:'#{{print("property")}}must be defined'}]})}}),Pve=G({"node_modules/@stoplight/spectral-functions/dist/enumeration.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=ba(),i=Ti();t.default=(0,e.createRulesetFunction)({input:{type:["string","number","null","boolean"]},options:i.optionSchemas.enumeration},function(a,{values:o}){if(!o.includes(a))return[{message:`#{{print("value")}} must be equal to one of the allowed values: ${o.map(r.printValue).join(", ")}`}]})}}),Ove=G({"node_modules/@stoplight/spectral-functions/dist/falsy.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=Ti();t.default=(0,e.createRulesetFunction)({input:null,options:r.optionSchemas.falsy},function(n){if(n)return[{message:'#{{print("property")}}must be falsy'}]})}}),Ive=G({"node_modules/@stoplight/spectral-functions/dist/length.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=ba(),i=(Zr(),Pt(Fr)),n=Ti();t.default=(0,e.createRulesetFunction)({input:{type:["array","object","string","number"]},options:n.optionSchemas.length},function(o,s){let l;(0,i.isPlainObject)(o)?l=Object.keys(o).length:Array.isArray(o)?l=o.length:typeof o=="number"?l=o:l=o.length;let u;return"min"in s&&l<s.min&&(u=[{message:`#{{print("property")}}must be longer than ${(0,r.printValue)(s.min)}`}]),"max"in s&&l>s.max&&(u??(u=[])).push({message:`#{{print("property")}}must be shorter than ${(0,r.printValue)(s.max)}`}),u})}}),Cve=G({"node_modules/@stoplight/spectral-functions/dist/pattern.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=ba(),i=Ti(),n=/^\/(.+)\/([a-z]*)$/,a=new Map;function o(l){let u=a.get(l);if(u!==void 0)return u.lastIndex=0,u;let c=s(l);return a.set(l,c),c}function s(l){let u=n.exec(l);return u!==null?new RegExp(u[1],u[2]):new RegExp(l)}t.default=(0,e.createRulesetFunction)({input:{type:"string"},options:i.optionSchemas.pattern},function(u,c){let d;return"match"in c&&(o(c.match).test(u)||(d=[{message:`#{{print("value")}} must match the pattern ${(0,r.printValue)(c.match)}`}])),"notMatch"in c&&o(c.notMatch).test(u)&&(d??(d=[])).push({message:`#{{print("value")}} must not match the pattern ${(0,r.printValue)(c.notMatch)}`}),d})}}),jve=G({"node_modules/jsonpointer/jsonpointer.js"(t){"use strict";var e=/~/,r=/~[01]/g;function i(c){switch(c){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+c)}function n(c){return e.test(c)?c.replace(r,i):c}function a(c,d,f){for(var h,g,v=1,y=d.length;v<y;){if(d[v]==="constructor"||d[v]==="prototype"||d[v]==="__proto__")return c;if(h=n(d[v++]),g=y>v,typeof c[h]>"u"&&(Array.isArray(c)&&h==="-"&&(h=c.length),g&&(d[v]!==""&&d[v]<1/0||d[v]==="-"?c[h]=[]:c[h]={})),!g)break;c=c[h]}var w=c[h];return f===void 0?delete c[h]:c[h]=f,w}function o(c){if(typeof c=="string"){if(c=c.split("/"),c[0]==="")return c;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(c)){for(let d of c)if(typeof d!="string"&&typeof d!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return c}throw new Error("Invalid JSON pointer.")}function s(c,d){if(typeof c!="object")throw new Error("Invalid input object.");d=o(d);var f=d.length;if(f===1)return c;for(var h=1;h<f;){if(c=c[n(d[h++])],f===h)return c;if(typeof c!="object"||c===null)return}}function l(c,d,f){if(typeof c!="object")throw new Error("Invalid input object.");if(d=o(d),d.length===0)throw new Error("Invalid JSON pointer for set.");return a(c,d,f)}function u(c){var d=o(c);return{get:function(f){return s(f,d)},set:function(f,h){return l(f,d,h)}}}t.get=s,t.set=l,t.compile=u}}),Tve=G({"node_modules/leven/index.js"(t,e){"use strict";var r=[],i=[],n=(a,o)=>{if(a===o)return 0;let s=a;a.length>o.length&&(a=o,o=s);let l=a.length,u=o.length;for(;l>0&&a.charCodeAt(~-l)===o.charCodeAt(~-u);)l--,u--;let c=0;for(;c<l&&a.charCodeAt(c)===o.charCodeAt(c);)c++;if(l-=c,u-=c,l===0)return u;let d,f,h,g,v=0,y=0;for(;v<l;)i[v]=a.charCodeAt(c+v),r[v]=++v;for(;y<u;)for(d=o.charCodeAt(c+y),h=y++,f=y,v=0;v<l;v++)g=d===i[v]?h:h+1,h=r[v],f=r[v]=h>f?g>f?f+1:g:g>h?h+1:g;return f};e.exports=n,e.exports.default=n}}),Rve=G({"node_modules/@stoplight/better-ajv-errors/dist/index.js"(t,e){"use strict";var r=jve(),i=Tve();function n(re){return re&&typeof re=="object"&&"default"in re?re:{default:re}}var a=n(r),o=n(i),s=re=>de=>re===de,l=re=>de=>!re(de),u=(re=>Object.values(re)),c=re=>re!==void 0,d=re=>de=>de.keyword===re,f=d("anyOf"),h=d("enum"),g=re=>re&&re.errors||[],v=re=>re&&u(re.children)||[],y=re=>de=>v(re).filter(l(s(de))),w=(re=>de=>de.reduce((Pe,Ce)=>Pe.concat(Ce),re));function $(re){let de=re.lastIndexOf("/");return de!==-1?re.slice(de+1):null}var E=/['"]/g,I=/NOT/g,R=/^[a-z]/;function M(re){return re.replace(E,'"').replace(I,"not")}function T(re){return re.toUpperCase()}function O(re){return re.replace(R,T)}var N=class{constructor(re={isIdentifierLocation:!1},{data:de,schema:Pe,propPath:Ce}){this.options=re,this.data=de,this.schema=Pe,this.propPath=Ce}getError(){throw new Error(`Implement the 'getError' method inside ${this.constructor.name}!`)}getPrettyPropertyName(re){let de=this.getPropertyName(re);return de===null?O(typeof this.getPropertyValue(re)):`"${de}" property`}getPropertyName(re){let de=$(re);return de!==null?de:this.propPath.length===0?null:this.propPath[this.propPath.length-1]}getPropertyValue(re){return re===""?this.data:a.default.get(this.data,re)}},j=class extends N{getError(){let{message:re,instancePath:de}=this.options;return{error:`${this.getPrettyPropertyName(de)} ${M(re)}`,path:de}}},x=class extends N{constructor(...re){super(...re)}getError(){let{params:re,instancePath:de}=this.options;return{error:`Property "${re.additionalProperty}" is not expected to be here`,path:de}}},b=class extends N{getError(){let{message:re,instancePath:de,params:Pe}=this.options,Ce=this.findBestMatch(),rt={error:`${this.getPrettyPropertyName(de)} ${re}: ${Pe.allowedValues.map(ze=>typeof ze=="string"?`"${ze}"`:JSON.stringify(ze)).join(", ")}`,path:de};return Ce!==null&&(rt.suggestion=`Did you mean "${Ce}"?`),rt}findBestMatch(){let{instancePath:re,params:{allowedValues:de}}=this.options,Pe=this.getPropertyValue(re);if(typeof Pe!="string")return null;let Ce=de.filter(ze=>typeof ze=="string").map(ze=>({value:ze,weight:o.default(ze,Pe.toString())})).sort((ze,je)=>ze.weight>je.weight?1:ze.weight<je.weight?-1:0);if(Ce.length===0)return null;let rt=Ce[0];return de.length===1||rt.weight<rt.value.length?rt.value:null}},U=class extends N{getError(){let{message:re,instancePath:de}=this.options;return{error:`${this.getPrettyPropertyName(de)} ${M(re)}`,path:de}}},k=class extends N{getError(){let{message:re,instancePath:de}=this.options,Pe=this.getPropertyName(de);return{error:Pe===null?`Value type ${re}`:`"${Pe}" property type ${re}`,path:de}}},A=class extends N{getError(){let{message:re,instancePath:de}=this.options;return{error:re,path:de}}},z=/\/[\w$_-]+(\/\d+)?/g;function H(re=[]){let de={children:{}};return re.forEach(Pe=>{let{instancePath:Ce}=Pe,rt=Ce===""?[""]:Ce.match(z);rt&&rt.reduce((ze,je,Be)=>(ze.children[je]=ze.children[je]||{children:{},errors:[]},Be===rt.length-1&&ze.children[je].errors.push(Pe),ze.children[je]),de)}),de}function se(re,de,Pe){g(re).some(f)&&Object.keys(re.children).length>0&&delete re.errors,re.errors&&re.errors.length&&g(re).every(h)&&y(de)(re).filter(c).some(g)&&delete de.children[Pe],Object.entries(re.children).forEach(([Ce,rt])=>se(rt,re,Ce))}function ge(re,de){let Pe=g(re);if(Pe.length&&Pe.every(h)){let rt=[...new Set(w([])(Pe.map(je=>je.params.allowedValues)))],ze=Pe[0];return[new b({...ze,params:{allowedValues:rt}},de)]}else return w(Pe.reduce((Ce,rt)=>{switch(rt.keyword){case"additionalProperties":return Ce.concat(new x(rt,de));case"required":return Ce.concat(new j(rt,de));case"type":return Ce.concat(new k(rt,de));case"errorMessage":return Ce.concat(new A(rt,de));default:return Ce.concat(new U(rt,de))}},[]))(v(re).map(Ce=>ge(Ce,de)))}var ae=(re,de)=>{let Pe=H(re||[]);return se(Pe),ge(Pe,de)},ke=re=>re.getError(),W=(re,de,{propertyPath:Pe,targetValue:Ce})=>ae(de,{data:Ce,schema:re,propPath:Pe}).map(ke);e.exports=W}}),Dve=G({"node_modules/@stoplight/spectral-formats/dist/openapi.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.oas3_1=t.oas3_0=t.oas3=t.oas2=void 0;var e=(Zr(),Pt(Fr)),r=o=>(0,e.isPlainObject)(o)&&"swagger"in o&&parseInt(String(o.swagger))===2;t.oas2=r,t.oas2.displayName="OpenAPI 2.0 (Swagger)";var i=o=>(0,e.isPlainObject)(o)&&"openapi"in o&&Number.parseInt(String(o.openapi))===3;t.oas3=i,t.oas3.displayName="OpenAPI 3.x";var n=o=>i(o)&&/^3\.0(?:\.[0-9]*)?$/.test(String(o.openapi));t.oas3_0=n,t.oas3_0.displayName="OpenAPI 3.0.x";var a=o=>i(o)&&/^3\.1(?:\.[0-9]*)?$/.test(String(o.openapi));t.oas3_1=a,t.oas3_1.displayName="OpenAPI 3.1.x"}}),Nve=G({"node_modules/@stoplight/spectral-formats/dist/asyncapi.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.aas3_0=t.aas2_6=t.aas2_5=t.aas2_4=t.aas2_3=t.aas2_2=t.aas2_1=t.aas2_0=t.asyncapi2=t.asyncApi2=t.aas3=t.aas2=void 0;var e=(Zr(),Pt(Fr)),r=/^2\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/,i=/^3\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/,n=/^2\.0(?:\.[0-9]*)?$/,a=/^2\.1(?:\.[0-9]*)?$/,o=/^2\.2(?:\.[0-9]*)?$/,s=/^2\.3(?:\.[0-9]*)?$/,l=/^2\.4(?:\.[0-9]*)?$/,u=/^2\.5(?:\.[0-9]*)?$/,c=/^2\.6(?:\.[0-9]*)?$/,d=/^3\.0(?:\.[0-9]*)?$/,f=M=>(0,e.isPlainObject)(M)&&"asyncapi"in M&&r.test(String(M.asyncapi)),h=M=>(0,e.isPlainObject)(M)&&"asyncapi"in M&&i.test(String(M.asyncapi));t.aas2=f,t.aas2.displayName="AsyncAPI 2.x",t.aas3=h,t.aas3.displayName="AsyncAPI 3.x",t.asyncApi2=t.aas2,t.asyncapi2=t.aas2;var g=M=>f(M)&&n.test(String(M.asyncapi));t.aas2_0=g,t.aas2_0.displayName="AsyncAPI 2.0.x";var v=M=>f(M)&&a.test(String(M.asyncapi));t.aas2_1=v,t.aas2_1.displayName="AsyncAPI 2.1.x";var y=M=>f(M)&&o.test(String(M.asyncapi));t.aas2_2=y,t.aas2_2.displayName="AsyncAPI 2.2.x";var w=M=>f(M)&&s.test(String(M.asyncapi));t.aas2_3=w,t.aas2_3.displayName="AsyncAPI 2.3.x";var $=M=>f(M)&&l.test(String(M.asyncapi));t.aas2_4=$,t.aas2_4.displayName="AsyncAPI 2.4.x";var E=M=>f(M)&&u.test(String(M.asyncapi));t.aas2_5=E,t.aas2_5.displayName="AsyncAPI 2.5.x";var I=M=>f(M)&&c.test(String(M.asyncapi));t.aas2_6=I,t.aas2_6.displayName="AsyncAPI 2.6.x";var R=M=>h(M)&&d.test(String(M.asyncapi));t.aas3_0=R,t.aas3_0.displayName="AsyncAPI 3.0.x"}}),Lve=G({"node_modules/@stoplight/spectral-formats/dist/jsonSchema.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.detectDialect=t.extractDraftVersion=t.jsonSchemaDraft2020_12=t.jsonSchemaDraft2019_09=t.jsonSchemaDraft7=t.jsonSchemaDraft6=t.jsonSchemaDraft4=t.jsonSchemaLoose=t.jsonSchema=void 0;var e=(Zr(),Pt(Fr)),r=["array","boolean","integer","null","number","object","string"],i=["allOf","oneOf","anyOf","not","if"],n=/^https?:\/\/json-schema.org\/(?:draft-0([467])|draft\/(20(?:19-09|20-12)))\/(?:hyper-)?schema#?$/,a=g=>"type"in g?typeof g.type=="string"?r.includes(g.type):Array.isArray(g.type)&&g.type.every(v=>r.includes(v)):!1,o=g=>Array.isArray(g.enum),s=g=>i.some(v=>v in g&&typeof g[v]=="object"&&g[v]!==null);function l(g){return(0,e.isPlainObject)(g)&&"$schema"in g&&typeof g.$schema=="string"}var u=g=>l(g)&&g.$schema.includes("//json-schema.org/");t.jsonSchema=u,t.jsonSchema.displayName="JSON Schema";var c=g=>(0,e.isPlainObject)(g)&&(u(g)||a(g)||o(g)||s(g));t.jsonSchemaLoose=c,t.jsonSchemaLoose.displayName="JSON Schema (loose)",t.jsonSchemaDraft4=d("draft4","JSON Schema Draft 4"),t.jsonSchemaDraft6=d("draft6","JSON Schema Draft 6"),t.jsonSchemaDraft7=d("draft7","JSON Schema Draft 7"),t.jsonSchemaDraft2019_09=d("draft2019-09","JSON Schema Draft 2019-09"),t.jsonSchemaDraft2020_12=d("draft2020-12","JSON Schema Draft 2020-12");function d(g,v){let y=w=>u(w)&&f(w.$schema)===g;return y.displayName=v,y}function f(g){var v;let y=n.exec(g);return y!==null?`draft${(v=y[1])!==null&&v!==void 0?v:y[2]}`:null}t.extractDraftVersion=f;function h(g){return u(g)?f(g.$schema):null}t.detectDialect=h}}),Mve=G({"node_modules/@stoplight/spectral-formats/dist/arazzo.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arazzo1_0=void 0;var e=(Zr(),Pt(Fr)),r=/^1\.0(?:\.[0-9]*)?$/,i=n=>(0,e.isPlainObject)(n)&&"arazzo"in n&&r.test(String(n.arazzo));t.arazzo1_0=i,t.arazzo1_0.displayName="Arazzo 1.0.x"}}),zve=G({"node_modules/@stoplight/spectral-formats/dist/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=(jr(),Pt(Or));(0,e.__exportStar)(Dve(),t),(0,e.__exportStar)(Nve(),t),(0,e.__exportStar)(Lve(),t),(0,e.__exportStar)(Mve(),t)}}),qve=G({"node_modules/ajv-draft-04/dist/vocabulary/core.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Lt("ajv/dist/vocabularies/core/ref"),r=["$schema","id","$defs",{keyword:"$comment"},"definitions",e.default];t.default=r}}),Fve=G({"node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumber.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Lt("ajv/dist/core"),r=Lt("ajv/dist/compile/codegen"),i=r.operators,n={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:i.LTE,fail:i.GT},{okStr:"<",ok:i.LT,fail:i.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:i.GTE,fail:i.LT},{okStr:">",ok:i.GT,fail:i.LTE}]}},a={message:l=>e.str`must be ${s(l).okStr} ${l.schemaCode}`,params:l=>e._`{comparison: ${s(l).okStr}, limit: ${l.schemaCode}}`},o={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:a,code(l){let{data:u,schemaCode:c}=l;l.fail$data(e._`${u} ${s(l).fail} ${c} || isNaN(${u})`)}};function s(l){var u;let c=l.keyword,d=!((u=l.parentSchema)===null||u===void 0)&&u[n[c].exclusive]?1:0;return n[c].ops[d]}t.default=o}}),Uve=G({"node_modules/ajv-draft-04/dist/vocabulary/validation/limitNumberExclusive.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},r={keyword:Object.keys(e),type:"number",schemaType:"boolean",code({keyword:i,parentSchema:n}){let a=e[i];if(n[a]===void 0)throw new Error(`${i} can only be used with ${a}`)}};t.default=r}}),Vve=G({"node_modules/ajv-draft-04/dist/vocabulary/validation/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Fve(),r=Uve(),i=Lt("ajv/dist/vocabularies/validation/multipleOf"),n=Lt("ajv/dist/vocabularies/validation/limitLength"),a=Lt("ajv/dist/vocabularies/validation/pattern"),o=Lt("ajv/dist/vocabularies/validation/limitProperties"),s=Lt("ajv/dist/vocabularies/validation/required"),l=Lt("ajv/dist/vocabularies/validation/limitItems"),u=Lt("ajv/dist/vocabularies/validation/uniqueItems"),c=Lt("ajv/dist/vocabularies/validation/const"),d=Lt("ajv/dist/vocabularies/validation/enum"),f=[e.default,r.default,i.default,n.default,a.default,o.default,s.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,d.default];t.default=f}}),Bve=G({"node_modules/ajv-draft-04/dist/vocabulary/draft4.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=qve(),r=Vve(),i=Lt("ajv/dist/vocabularies/applicator"),n=Lt("ajv/dist/vocabularies/format"),a=["title","description","default"],o=[e.default,r.default,i.default(),n.default,a];t.default=o}}),Gve=G({"node_modules/ajv-draft-04/dist/refs/json-schema-draft-04.json"(t,e){e.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}}}),Wve=G({"node_modules/ajv-draft-04/dist/index.js"(t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=Lt("ajv/dist/core"),i=Bve(),n=Lt("ajv/dist/vocabularies/discriminator"),a=Gve(),o=["/properties"],s="http://json-schema.org/draft-04/schema",l=class extends r.default{constructor(d={}){super({...d,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),i.default.forEach(d=>this.addVocabulary(d)),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let d=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(d,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.exports=t=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=Lt("ajv/dist/core");Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=Lt("ajv/dist/core");Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}})}}),Hve=G({"node_modules/@stoplight/spectral-functions/node_modules/ajv-formats/dist/formats.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(N,j){return{validate:N,compare:j}}t.fullFormats={date:e(a,o),time:e(l,u),"date-time":e(d,f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:v,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:O,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:w,int32:{type:"number",validate:I},int64:{type:"number",validate:R},float:{type:"number",validate:M},double:{type:"number",validate:M},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(N){return N%4===0&&(N%100!==0||N%400===0)}var i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(N){let j=i.exec(N);if(!j)return!1;let x=+j[1],b=+j[2],U=+j[3];return b>=1&&b<=12&&U>=1&&U<=(b===2&&r(x)?29:n[b])}function o(N,j){if(N&&j)return N>j?1:N<j?-1:0}var s=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(N,j){let x=s.exec(N);if(!x)return!1;let b=+x[1],U=+x[2],k=+x[3],A=x[5];return(b<=23&&U<=59&&k<=59||b===23&&U===59&&k===60)&&(!j||A!=="")}function u(N,j){if(!(N&&j))return;let x=s.exec(N),b=s.exec(j);if(x&&b)return N=x[1]+x[2]+x[3]+(x[4]||""),j=b[1]+b[2]+b[3]+(b[4]||""),N>j?1:N<j?-1:0}var c=/t|\s/i;function d(N){let j=N.split(c);return j.length===2&&a(j[0])&&l(j[1],!0)}function f(N,j){if(!(N&&j))return;let[x,b]=N.split(c),[U,k]=j.split(c),A=o(x,U);if(A!==void 0)return A||u(b,k)}var h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function v(N){return h.test(N)&&g.test(N)}var y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(N){return y.lastIndex=0,y.test(N)}var $=-(2**31),E=2**31-1;function I(N){return Number.isInteger(N)&&N<=E&&N>=$}function R(N){return Number.isInteger(N)}function M(){return!0}var T=/[^\\]\\Z/;function O(N){if(T.test(N))return!1;try{return new RegExp(N),!0}catch{return!1}}}}),Kve=G({"node_modules/@stoplight/spectral-functions/node_modules/ajv-formats/dist/limit.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;var e=Lt("ajv"),r=Lt("ajv/dist/compile/codegen"),i=r.operators,n={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},a={message:({keyword:s,schemaCode:l})=>r.str`should be ${n[s].okStr} ${l}`,params:({keyword:s,schemaCode:l})=>r._`{comparison: ${n[s].okStr}, limit: ${l}}`};t.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:a,code(s){let{gen:l,data:u,schemaCode:c,keyword:d,it:f}=s,{opts:h,self:g}=f;if(!h.validateFormats)return;let v=new e.KeywordCxt(f,g.RULES.all.format.definition,"format");v.$data?y():w();function y(){let E=l.scopeValue("formats",{ref:g.formats,code:h.code.formats}),I=l.const("fmt",r._`${E}[${v.schemaCode}]`);s.fail$data(r.or(r._`typeof ${I} != "object"`,r._`${I} instanceof RegExp`,r._`typeof ${I}.compare != "function"`,$(I)))}function w(){let E=v.schema,I=g.formats[E];if(!I||I===!0)return;if(typeof I!="object"||I instanceof RegExp||typeof I.compare!="function")throw new Error(`"${d}": format "${E}" does not define "compare" function`);let R=l.scopeValue("formats",{key:E,ref:I,code:h.code.formats?r._`${h.code.formats}${r.getProperty(E)}`:void 0});s.fail$data($(R))}function $(E){return r._`${E}.compare(${u}, ${c}) ${n[d].fail} 0`}},dependencies:["format"]};var o=s=>(s.addKeyword(t.formatLimitDefinition),s);t.default=o}}),Zve=G({"node_modules/@stoplight/spectral-functions/node_modules/ajv-formats/dist/index.js"(t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Hve(),i=Kve(),n=Lt("ajv/dist/compile/codegen"),a=new n.Name("fullFormats"),o=new n.Name("fastFormats"),s=(u,c={keywords:!0})=>{if(Array.isArray(c))return l(u,c,r.fullFormats,a),u;let[d,f]=c.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,a],h=c.formats||r.formatNames;return l(u,h,d,f),c.keywords&&i.default(u),u};s.get=(u,c="full")=>{let f=(c==="fast"?r.fastFormats:r.fullFormats)[u];if(!f)throw new Error(`Unknown format "${u}"`);return f};function l(u,c,d,f){var h,g;(h=(g=u.opts.code).formats)!==null&&h!==void 0||(g.formats=n._`require("ajv-formats/dist/formats").${f}`);for(let v of c)u.addFormat(v,d[v])}e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}}),Jve=G({"node_modules/@stoplight/spectral-functions/dist/schema/draft4.json"(t,e){e.exports={$id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-07/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},deprecationMessage:{type:"string",description:"Non-standard: deprecation message for a property, if it is deprecated"},default:{},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:{}}}}),Yve=G({"node_modules/@stoplight/spectral-functions/dist/schema/ajv.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAjvInstances=void 0;var e=(jr(),Pt(Or)),r=(0,e.__importDefault)(Lt("ajv")),i=(0,e.__importDefault)(Lt("ajv/dist/2019")),n=(0,e.__importDefault)(Lt("ajv/dist/2020")),a=(0,e.__importDefault)(Wve()),o=(0,e.__importDefault)(Zve()),s=(0,e.__importDefault)(Q7()),l=(0,e.__importStar)(Lt("ajv/dist/refs/json-schema-draft-06.json")),u=(0,e.__importStar)(Jve()),c={warn(...g){let v=g[0];if(typeof v=="string"){if(v.startsWith("unknown format"))return;console.warn(...g)}},log:console.log,error:console.error};function d(g,v){let y=new g({allErrors:v,meta:!0,messages:!0,strict:!1,allowUnionTypes:!0,logger:c,unicodeRegExp:!1});return(0,o.default)(y),v&&(0,s.default)(y),g===r.default&&(y.addSchema(u),y.addSchema(l)),y}function f(g){let v,y;return{get default(){return v??(v=d(g,!1)),v},get allErrors(){return y??(y=d(g,!0)),y}}}function h(){let g={auto:f(r.default),draft4:f(a.default),"draft2019-09":f(i.default),"draft2020-12":f(n.default)},v=new WeakMap;return function(y,w,$){var E,I,R,M;let O=((E=g[w])!==null&&E!==void 0?E:g.auto)[$?"allErrors":"default"],N=y.$id;if(typeof N=="string")return(I=O.getSchema(N))!==null&&I!==void 0?I:O.compile(y);{let j=(R=v.get(O))!==null&&R!==void 0?R:v.set(O,new WeakMap).get(O);return(M=j.get(y))!==null&&M!==void 0?M:j.set(y,O.compile(y)).get(y)}}}t.createAjvInstances=h}}),Qve=G({"node_modules/@stoplight/spectral-functions/dist/schema/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=(jr(),Pt(Or)),r=(0,e.__importDefault)(Rve()),i=zve(),n=Yve(),a=(0,e.__importDefault)(Lt("ajv/dist/compile/ref_error")),o=Xr(),s=vn(),l=Ti(),u=new WeakMap;t.default=(0,o.createRulesetFunction)({input:null,options:l.optionSchemas.schema},function(d,f,{path:h,rule:g,documentInventory:v}){var y,w,$;if(d===void 0)return[{path:h,message:'#{{print("property")}}must exist'}];let E=(y=u.get(v))!==null&&y!==void 0?y:u.set(v,(0,n.createAjvInstances)()).get(v),I=[],{allErrors:R=!1,schema:M}=f;try{let T=(w=f.dialect===void 0||f.dialect==="auto"?(0,i.detectDialect)(M):f?.dialect)!==null&&w!==void 0?w:"draft7",O=E(M,T,R);O?.(d)===!1&&Array.isArray(O.errors)&&(($=f.prepareResults)===null||$===void 0||$.call(f,O.errors),I.push(...(0,r.default)(M,O.errors,{propertyPath:h,targetValue:d}).map(({suggestion:N,error:j,path:x})=>({message:N!==void 0?`${j}. ${N}`:j,path:[...h,...x!==""?x.replace(/^\//,"").split("/"):[]]}))))}catch(T){if(!(0,s.isError)(T))throw new Error("Unexpected error");g?.resolved&&T instanceof a.default||I.push({message:T.message,path:h})}return I})}}),Xve=G({"node_modules/@stoplight/spectral-functions/dist/truthy.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=Ti();t.default=(0,e.createRulesetFunction)({input:null,options:r.optionSchemas.truthy},function(n){if(!n)return[{message:'#{{print("property")}}must be truthy'}]})}}),e2e=G({"node_modules/@stoplight/spectral-functions/dist/undefined.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=Ti();t.default=(0,e.createRulesetFunction)({input:null,options:r.optionSchemas.undefined},function(n){if(typeof n<"u")return[{message:'#{{print("property")}}must be undefined'}]})}}),t2e=G({"node_modules/@stoplight/spectral-functions/dist/unreferencedReusableObject.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=ba(),i=(Zr(),Pt(Fr)),n=Ti();t.default=(0,e.createRulesetFunction)({input:{type:"object"},options:n.optionSchemas.unreferencedReusableObject},function(o,s,{document:l,documentInventory:u}){var c;let d=u.graph;if(d===null)throw new Error("unreferencedReusableObject requires dependency graph");let f=(c=l.source)!==null&&c!==void 0?c:"",h=Object.keys(o).map(y=>`${f}${s.reusableObjectsLocation}/${y}`),g=new Set(d.overallOrder().map(y=>(0,i.decodePointer)(y)));return h.filter(y=>!g.has(y)).map(y=>({message:"Potential orphaned reusable object has been detected",path:(0,r.safePointerToPath)(y)}))})}}),r2e=G({"node_modules/@stoplight/spectral-functions/dist/xor.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=Ti();t.default=(0,e.createRulesetFunction)({input:{type:"object"},options:r.optionSchemas.xor},function(n,{properties:a}){if(a.length<2)return;let o=[],s=Object.keys(n).filter(l=>a.indexOf(l)!==-1);if(s.length==0)if(a.length>4){let l=a.slice(0,3),u=String(a.length-3)+" other properties must be defined";o.push({message:'At least one of "'+l.join('" or "')+'" or '+u})}else o.push({message:'At least one of "'+a.join('" or "')+'" must be defined'});return s.length>1&&o.push({message:'Just one of "'+s.join('" and "')+'" must be defined'}),o})}}),n2e=G({"node_modules/@stoplight/spectral-functions/dist/or.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Xr(),r=Ti();t.default=(0,e.createRulesetFunction)({input:{type:"object"},options:r.optionSchemas.or},function(n,{properties:a}){if(a.length<2)return;let o=[];if(Object.keys(n).filter(l=>a.indexOf(l)!==-1).length==0)if(a.length>4){let l=a.slice(0,3),u=String(a.length-3)+" other properties must be defined";o.push({message:'At least one of "'+l.join('" or "')+'" or '+u})}else o.push({message:'At least one of "'+a.join('" or "')+'" must be defined'});return o})}}),i2e=G({"node_modules/@stoplight/spectral-functions/dist/index.js"(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.xor=t.unreferencedReusableObject=t.undefined=t.truthy=t.schema=t.pattern=t.length=t.falsy=t.enumeration=t.defined=t.casing=t.alphabetical=void 0;var e=(jr(),Pt(Or)),r=(0,e.__importDefault)($ve());Object.defineProperty(t,"alphabetical",{enumerable:!0,get:function(){return r.default}});var i=(0,e.__importDefault)(Eve());Object.defineProperty(t,"casing",{enumerable:!0,get:function(){return i.default}});var n=(0,e.__importDefault)(Ave());Object.defineProperty(t,"defined",{enumerable:!0,get:function(){return n.default}});var a=(0,e.__importDefault)(Pve());Object.defineProperty(t,"enumeration",{enumerable:!0,get:function(){return a.default}});var o=(0,e.__importDefault)(Ove());Object.defineProperty(t,"falsy",{enumerable:!0,get:function(){return o.default}});var s=(0,e.__importDefault)(Ive());Object.defineProperty(t,"length",{enumerable:!0,get:function(){return s.default}});var l=(0,e.__importDefault)(Cve());Object.defineProperty(t,"pattern",{enumerable:!0,get:function(){return l.default}});var u=(0,e.__importDefault)(Qve());Object.defineProperty(t,"schema",{enumerable:!0,get:function(){return u.default}});var c=(0,e.__importDefault)(Xve());Object.defineProperty(t,"truthy",{enumerable:!0,get:function(){return c.default}});var d=(0,e.__importDefault)(e2e());Object.defineProperty(t,"undefined",{enumerable:!0,get:function(){return d.default}});var f=(0,e.__importDefault)(t2e());Object.defineProperty(t,"unreferencedReusableObject",{enumerable:!0,get:function(){return f.default}});var h=(0,e.__importDefault)(r2e());Object.defineProperty(t,"xor",{enumerable:!0,get:function(){return h.default}});var g=(0,e.__importDefault)(n2e());Object.defineProperty(t,"or",{enumerable:!0,get:function(){return g.default}})}}),wf=C.object({title:C.string(),content:C.string().optional(),list:C.enum(["agents","workflow","validations","guardrails"]).optional()}).passthrough(),uS=C.object({id:C.string(),name:C.string().optional(),description:C.string(),severity:C.enum(["mandatory","recommended","optional"]),detection_method:C.string().optional(),escalation:C.string().optional(),ref:C.string().optional()}).passthrough(),cS=C.object({condition:C.string(),action:C.enum(["stop_and_report","report_to_architect","wait_for_approval"])}).passthrough(),Fq=C.object({action:C.enum(["read","execute"]),target:C.string(),required:C.boolean()}).passthrough(),Uq=C.object({role_name:C.string(),purpose:C.string(),own_artifacts:C.array(C.string()).default([]),can_read_artifacts:C.array(C.string()).default([]),can_write_artifacts:C.array(C.string()).default([]),can_execute_tools:C.array(C.string()).default([]),can_perform_validations:C.array(C.string()).default([]),can_invoke_agents:C.array(C.string()).default([]),can_return_handoffs:C.array(C.string()).default([]),dispatch_only:C.boolean().optional(),mode:C.enum(["read-only","read-write"]).optional(),responsibilities:C.array(C.string()).optional(),constraints:C.array(C.string()).optional(),rules:C.array(uS).optional(),anti_patterns:C.array(C.string()).optional(),escalation_criteria:C.array(cS).optional(),sections:C.array(wf).optional(),prerequisites:C.array(Fq).optional(),guardrails:C.array(C.string()).optional()}).passthrough(),Vq=C.object({type:C.string(),description:C.string().optional(),owner:C.string().optional(),producers:C.array(C.string()).default([]),editors:C.array(C.string()).default([]),consumers:C.array(C.string()).default([]),states:C.array(C.string()).default([]),required_validations:C.array(C.string()).default([]),visibility:C.string().optional(),classification:C.string().optional(),guardrails:C.array(C.string()).optional(),authority:C.enum(["canonical","derived","generated","control"]).optional(),path_patterns:C.array(C.string()).optional(),exclude_patterns:C.array(C.string()).optional(),manual_edit:C.enum(["allowed","discouraged","forbidden"]).optional(),change_control:C.enum(["none","approval-required","regeneration-required"]).optional()}).passthrough(),fv=["agent","task","artifact","tool","validation","handoff_type","workflow","policy","guardrail","guardrail_policy","system","navigation_index"],dS=C.enum(fv),a2e=fv.filter(t=>t!=="system"&&t!=="navigation_index"),o2e=C.object({type:C.literal("command_regex"),pattern:C.string()}).passthrough(),s2e=C.object({type:C.literal("content_regex"),pattern:C.string(),file_glob:C.string().optional(),exclude_glob:C.string().optional()}).passthrough(),l2e=C.object({type:C.literal("file_glob"),pattern:C.string(),exclude_glob:C.string().optional()}).passthrough(),Bq=C.discriminatedUnion("type",[o2e,s2e,l2e]),Gq=C.object({matcher:Bq.optional(),script:C.string().optional(),message:C.string().optional()}).passthrough(),Wq=C.object({target:C.string(),template:C.string().optional(),inline_template:C.string().optional(),source:C.string().optional(),mode:C.enum(["write","patch"]).default("write"),format:C.enum(["json","yaml","text"]).optional(),patch_strategy:C.enum(["deep_merge","append"]).optional(),array_merge_key:C.string().optional(),group_by:C.string().optional(),executable:C.boolean().optional(),skip_empty:C.boolean().optional()}).passthrough().refine(t=>{let e=[t.template,t.inline_template,t.source].filter(Boolean).length;return e===1||e===0},{message:"Only one of template, inline_template, or source may be specified"}),Hq=C.object({commands:C.record(C.string(),C.string()),fail_open:C.boolean().default(!0),timeout_ms:C.number().default(5e3)}).passthrough(),u2e=C.object({checks:C.array(Gq)}),Kq=C.object({template:C.string().optional(),inline_template:C.string().optional(),context:dS,output:C.string(),include:C.array(C.string()).optional(),exclude:C.array(C.string()).optional(),skip_empty:C.boolean().optional(),executable:C.boolean().optional()}).passthrough().refine(t=>[t.template,t.inline_template].filter(Boolean).length===1,{message:"Exactly one of template or inline_template must be specified"}).refine(t=>!(t.include&&t.exclude),{message:"include and exclude are mutually exclusive"}).refine(t=>!(t.context==="system"&&(t.include||t.exclude)),{message:"include/exclude cannot be used with context: system"}),Zq=C.object({software:C.string(),version:C.literal(1),extends:C.string().optional(),guardrail_impl:C.record(C.string(),u2e).optional(),outputs:C.record(C.string(),Wq).optional(),renders:C.array(Kq).optional(),reporting:Hq.optional()}).passthrough(),Jq=C.object({version:C.number(),description:C.string().optional(),schema:C.record(C.string(),C.any()),example:C.record(C.string(),C.any()).optional()}).passthrough(),Yq=C.object({agents:C.array(C.string()).optional(),tasks:C.array(C.string()).optional(),tools:C.array(C.string()).optional(),artifacts:C.array(C.string()).optional(),workflows:C.array(C.string()).optional()}).passthrough(),Qq=C.object({description:C.string(),scope:Yq,rationale:C.string().optional(),tags:C.array(C.string()).default([]),exemptions:C.array(C.string()).optional()}).passthrough(),Xq=C.object({target:C.string(),condition:C.string().optional()}).passthrough(),G0=C.enum(["block","warn","shadow","info"]),eF=C.object({default:G0,when:C.record(C.string(),G0)}),tF=C.union([G0,eF]),rF=C.object({guardrail:C.string(),severity:C.enum(["critical","mandatory","warning","info"]),action:tF,allow_override:C.boolean().default(!1),override_requires:C.array(C.string()).optional(),escalation:Xq.optional()}).passthrough(),nF=C.object({description:C.string().optional(),rules:C.array(rF)}).passthrough(),iF=C.object({artifact_type:C.string().optional(),workflow:C.string().optional()}).passthrough(),aF=C.object({when:iF,requires_validations:C.array(C.string()).optional(),requires:C.array(C.string()).optional()}).passthrough(),c2e=C.literal(1),d2e=C.string().optional(),oF=C.record(C.string(),C.array(C.string())).optional(),sF=C.object({id:C.string(),name:C.string(),default_workflow_order:C.array(C.string()),sections:C.array(wf).optional(),context_loading:oF,states:C.array(C.string()).default([])}).passthrough(),lF=C.object({id:C.string(),action:C.string(),description:C.string().optional(),required:C.boolean().optional(),abort_on_failure:C.boolean().optional(),uses_tool:C.string().optional(),produces_artifact:C.string().optional(),reads_artifact:C.string().optional(),validates_artifact:C.string().optional(),validation_kind:C.enum(["schema","mechanical","semantic","approval","provenance","traceability","fidelity"]).optional(),depends_on:C.array(C.string()).optional(),skip_condition:C.string().optional(),wait_for_approval:C.boolean().optional()}).passthrough(),uF=C.object({description:C.string(),target_agent:C.string(),allowed_from_agents:C.array(C.string()).default([]),workflow:C.string(),input_artifacts:C.array(C.string()),invocation_handoff:C.string(),result_handoff:C.string(),default_priority:C.string().optional(),responsibilities:C.array(C.string()).optional(),constraints:C.array(C.string()).optional(),execution_steps:C.array(lF).optional(),completion_criteria:C.array(C.string()).optional(),rules:C.array(uS).optional(),anti_patterns:C.array(C.string()).optional(),escalation_criteria:C.array(cS).optional(),sections:C.array(wf).optional(),validations:C.array(C.string()).default([]),guardrails:C.array(C.string()).optional()}).passthrough(),cF=C.object({interface:C.string(),version:C.string().optional()}).passthrough(),dF=C.object({internal_workflow:C.string().optional(),input_handoff:C.string(),output_handoff:C.string(),description:C.string().optional()}).passthrough(),pF=C.object({version:C.number(),description:C.string().optional(),accepts:C.object({workflows:C.record(C.string(),dF)}).passthrough().optional(),exposes:C.object({artifacts:C.array(C.string())}).passthrough().optional(),constraints:C.array(C.string()).optional()}).passthrough(),fF=C.object({command:C.string(),category:C.string(),reads:C.array(C.string()).default([]),writes:C.array(C.string()).default([]),purpose:C.string().optional()}),mF=C.object({kind:C.string().optional(),extends:C.string().optional(),command:C.string().optional(),description:C.string().optional(),input_artifacts:C.array(C.string()).default([]),output_artifacts:C.array(C.string()).default([]),invokable_by:C.array(C.string()).default([]),cli_contract:C.string().optional(),artifact_bindings:C.record(C.string(),C.string()).default({}),side_effects:C.array(C.string()).default([]),commands:C.array(fF).default([]),guardrails:C.array(C.string()).optional()}).passthrough(),hF=C.object({target_artifact:C.string(),kind:C.enum(["schema","mechanical","semantic","approval","provenance","traceability","fidelity"]),executor_type:C.enum(["tool","agent"]).optional(),executor:C.string().optional(),blocking:C.boolean(),produces_evidence:C.string().optional(),description:C.string().optional()}).passthrough(),gF=C.object({condition:C.string(),fix_task:C.string(),revalidate_task:C.string().optional()}),p2e=C.object({id:C.string(),kind:C.enum(["actor","participant"]),label:C.string(),description:C.string().optional()}),f2e=C.object({type:C.literal("delegate"),description:C.string().optional(),task:C.string(),from_agent:C.string(),group:C.string().optional(),depends_on:C.array(C.string()).optional(),max_retries:C.number().int().min(0).optional(),max_follow_ups:C.number().int().min(0).optional(),retry:gF.optional()}).passthrough(),m2e=C.object({type:C.literal("gate"),description:C.string().optional(),gate_kind:C.string(),group:C.string().optional(),depends_on:C.array(C.string()).optional()}).passthrough(),h2e=C.object({type:C.literal("handoff"),description:C.string().optional(),handoff_kind:C.string(),task:C.string().optional(),from_agent:C.string().optional(),group:C.string().optional(),depends_on:C.array(C.string()).optional(),retry:gF.optional()}).passthrough(),g2e=C.object({type:C.literal("validation"),description:C.string().optional(),validation:C.string(),group:C.string().optional(),depends_on:C.array(C.string()).optional()}).passthrough(),v2e=C.object({type:C.literal("decision"),description:C.string().optional(),on:C.string().optional(),routing_key:C.string().optional(),branches:C.record(C.string(),C.array(C.string())),group:C.string().optional(),depends_on:C.array(C.string()).optional()}).passthrough(),y2e=C.object({type:C.literal("team_task"),description:C.string().optional(),to_team:C.string(),workflow:C.string(),handoff:C.string(),expects:C.string(),group:C.string().optional(),depends_on:C.array(C.string()).optional()}).passthrough(),vF=C.discriminatedUnion("type",[f2e,m2e,h2e,g2e,v2e,y2e]),yF=C.object({description:C.string().optional(),entry_conditions:C.array(C.string()).default([]),trigger:C.string().optional(),steps:C.array(vF),sections:C.array(wf).optional(),external_participants:C.array(p2e).default([])}).passthrough(),_F=C.object({schemas:C.record(C.string(),C.record(C.string(),C.any())).default({})}).passthrough(),pS=["root","system","agent","task","execution_step","artifact","tool","tool_command","validation","handoff_type","workflow","workflow_step","policy","guardrail","guardrail_policy","rule","escalation_criterion","prerequisite"],wF=C.enum(pS),bF=C.object({type:C.string(),items:C.string().optional(),description:C.string().optional(),scope:C.array(wF).optional(),schema:C.record(C.string(),C.any()).optional(),required:C.boolean().default(!1)}),W0=C.object({version:C.literal(1),extends:C.string().optional(),system:sF,agents:C.record(C.string(),Uq).default({}),tasks:C.record(C.string(),uF).default({}),artifacts:C.record(C.string(),Vq).default({}),tools:C.record(C.string(),mF).default({}),validations:C.record(C.string(),hF).default({}),handoff_types:C.record(C.string(),Jq).default({}),team_interface:pF.optional(),imports:C.record(C.string(),cF).optional(),workflow:C.record(C.string(),yF).default({}),policies:C.record(C.string(),aF).default({}),guardrails:C.record(C.string(),Qq).default({}),guardrail_policies:C.record(C.string(),nF).default({}),components:_F.default({schemas:{}}),extensions:C.record(C.string(),bF).default({}),extensions_strict:C.boolean().default(!1)}).passthrough();w2e=C.object({$append:C.record(C.string(),C.any())}),b2e=C.object({$prepend:C.record(C.string(),C.any())}),S2e=C.object({$insert_after:C.object({after:C.string(),entries:C.record(C.string(),C.any())})}),k2e=C.object({$replace:C.any()}),x2e=C.object({$remove:C.array(C.union([C.string(),C.object({id:C.string()})]))}),Kr=class extends Error{constructor(t,e){super(t),this.filePath=e,this.name="DslLoadError"}filePath};bf=class extends Error{constructor(t){super(t),this.name="BaseResolveError"}};_a=class extends Error{constructor(t){super(t),this.name="MergeError"}};z2e=new Set(["$append","$prepend","$insert_after","$replace","$remove"]);F2e={agents:"map",tasks:"map",artifacts:"map",tools:"map",validations:"map",handoff_types:"map",imports:"map",workflow:"map",policies:"map",guardrails:"map",guardrail_policies:"map",components:"map",extensions:"map",system:"object"};kL=class extends Error{constructor(t){super(t),this.name="ToolExtendsError"}};r7=new MF.default({allErrors:!0,strict:!1});rye={id:"validation-coverage",description:"Every artifact should have at least one validation. Code/config artifacts should have mechanical validation.",run(t){let e=[],r=new Map;for(let a of Object.values(t.validations))r.has(a.target_artifact)||r.set(a.target_artifact,new Set),r.get(a.target_artifact).add(a.kind);let i=["code","config","schema"];for(let[a,o]of Object.entries(t.artifacts)){let s=r.get(a);if(!s||s.size===0){e.push({ruleId:"validation-coverage",severity:"warning",path:`artifacts.${a}`,message:`Artifact "${a}" has no validations defined`});continue}i.includes(o.type)&&!s.has("mechanical")&&!s.has("schema")&&e.push({ruleId:"validation-coverage",severity:"warning",path:`artifacts.${a}`,message:`Artifact "${a}" (type: ${o.type}) lacks mechanical or schema validation`})}for(let[a,o]of Object.entries(t.artifacts))o.required_validations.length===0&&e.push({ruleId:"validation-coverage",severity:"warning",path:`artifacts.${a}`,message:`Artifact "${a}" has empty required_validations`});let n=new Set;for(let a of Object.values(t.workflow))for(let o of a.steps)o.type==="validation"&&n.add(o.validation);for(let a of Object.values(t.tasks))for(let o of a.validations)n.add(o);for(let[a,o]of Object.entries(t.validations))o.blocking&&!n.has(a)&&e.push({ruleId:"validation-coverage",severity:"warning",path:`validations.${a}`,message:`Blocking validation "${a}" is not referenced in any workflow step or task`});return e}},nye={id:"tool-execution",description:"Bidirectional consistency: agent.can_execute_tools \u2194 tool.invokable_by",run(t){let e=[],r=new Map;for(let[i,n]of Object.entries(t.tools))r.set(i,new Set(n.invokable_by));for(let[i,n]of Object.entries(t.agents))for(let a of n.can_execute_tools){let o=r.get(a);o&&o.size>0&&!o.has(i)&&e.push({ruleId:"tool-execution",severity:"warning",path:`agents.${i}.can_execute_tools`,message:`Agent "${i}" has can_execute_tools "${a}" but tool's invokable_by does not include "${i}"`})}for(let[i,n]of Object.entries(t.tools))if(n.invokable_by.length!==0)for(let a of n.invokable_by){let o=t.agents[a];o&&!o.can_execute_tools.includes(i)&&e.push({ruleId:"tool-execution",severity:"warning",path:`tools.${i}.invokable_by`,message:`Tool "${i}" has invokable_by "${a}" but agent's can_execute_tools does not include "${i}"`})}for(let[i,n]of Object.entries(t.tasks))if(n.execution_steps)for(let a of n.execution_steps){if(!a.uses_tool)continue;let o=t.agents[n.target_agent];o&&!o.can_execute_tools.includes(a.uses_tool)&&e.push({ruleId:"tool-execution",severity:"error",path:`tasks.${i}.execution_steps`,message:`Task "${i}" step uses_tool "${a.uses_tool}" but target agent "${n.target_agent}" cannot execute it`})}for(let[i,n]of Object.entries(t.validations)){if(n.executor_type!=="tool"||!n.executor)continue;Object.values(t.agents).some(o=>o.can_execute_tools.includes(n.executor))||e.push({ruleId:"tool-execution",severity:"error",path:`validations.${i}`,message:`Validation "${i}" has executor_type=tool (executor: "${n.executor}") but no agent can execute this tool`})}return e}},iye={id:"task-agent-binding",description:"Bidirectional task-agent consistency: allowed_from_agents \u2194 can_invoke_agents",run(t){let e=[],r=new Map;for(let[i,n]of Object.entries(t.tasks))r.has(n.target_agent)||r.set(n.target_agent,[]),r.get(n.target_agent).push(i);for(let[i,n]of Object.entries(t.tasks))for(let a of n.allowed_from_agents){if(a===n.target_agent)continue;let o=t.agents[a];o&&!o.can_invoke_agents.includes(n.target_agent)&&e.push({ruleId:"task-agent-binding",severity:"error",path:`tasks.${i}.allowed_from_agents`,message:`Task "${i}" allows "${a}" but agent's can_invoke_agents does not include target "${n.target_agent}"`})}for(let[i,n]of Object.entries(t.agents)){if(n.dispatch_only)continue;(r.get(i)??[]).length===0&&e.push({ruleId:"task-agent-binding",severity:"warning",path:`agents.${i}`,message:`Agent "${i}" has no tasks assigned (target_agent). Consider adding dispatch_only if intentional.`})}for(let[i,n]of Object.entries(t.tasks)){let a=t.agents[n.target_agent];if(a){if(a.can_read_artifacts.length>0)for(let o of n.input_artifacts)a.can_read_artifacts.includes(o)||e.push({ruleId:"task-agent-binding",severity:"error",path:`tasks.${i}.input_artifacts`,message:`Task "${i}" input_artifact "${o}" not in target agent "${n.target_agent}" can_read_artifacts`});a.can_return_handoffs.includes(n.result_handoff)||e.push({ruleId:"task-agent-binding",severity:"error",path:`tasks.${i}.result_handoff`,message:`Task "${i}" result_handoff "${n.result_handoff}" not in target agent "${n.target_agent}" can_return_handoffs`})}}for(let[i,n]of Object.entries(t.tasks)){if(!n.execution_steps)continue;let a=t.agents[n.target_agent];if(a)for(let o of n.execution_steps){if(o.uses_tool){a.can_execute_tools.includes(o.uses_tool)||e.push({ruleId:"task-agent-binding",severity:"error",path:`tasks.${i}.execution_steps`,message:`Task "${i}" step uses_tool "${o.uses_tool}" not in target agent "${n.target_agent}" can_execute_tools`});let s=t.tools[o.uses_tool];s&&s.invokable_by.length>0&&!s.invokable_by.includes(n.target_agent)&&e.push({ruleId:"task-agent-binding",severity:"warning",path:`tasks.${i}.execution_steps`,message:`Task "${i}" step uses_tool "${o.uses_tool}" but tool's invokable_by does not include "${n.target_agent}"`})}o.produces_artifact&&a.can_write_artifacts.length>0&&(a.can_write_artifacts.includes(o.produces_artifact)||e.push({ruleId:"task-agent-binding",severity:"error",path:`tasks.${i}.execution_steps`,message:`Task "${i}" step produces_artifact "${o.produces_artifact}" not in target agent "${n.target_agent}" can_write_artifacts`})),o.reads_artifact&&a.can_read_artifacts.length>0&&(a.can_read_artifacts.includes(o.reads_artifact)||e.push({ruleId:"task-agent-binding",severity:"error",path:`tasks.${i}.execution_steps`,message:`Task "${i}" step reads_artifact "${o.reads_artifact}" not in target agent "${n.target_agent}" can_read_artifacts`}))}}return e}},aye={id:"merge-integrity",description:"Post-merge integrity: check that resolved DSL workflow order has no duplicates",run(t){let e=[],r=t.system.default_workflow_order,i=new Set;for(let n=0;n<r.length;n++)i.has(r[n])&&e.push({ruleId:"merge-integrity",severity:"error",path:`system.default_workflow_order[${n}]`,message:`Duplicate workflow "${r[n]}" in default_workflow_order`}),i.add(r[n]);return e}},oye={id:"artifact-ownership",description:"Ensure execution_step produces/reads operations are consistent with artifact producers/editors/consumers",run(t){let e=[];for(let[r,i]of Object.entries(t.tasks)){if(!i.execution_steps)continue;let n=i.target_agent;for(let a of i.execution_steps){if(a.produces_artifact){let o=t.artifacts[a.produces_artifact];o&&(o.producers.length>0||o.editors.length>0)&&(o.producers.includes(n)||o.editors.includes(n)||e.push({ruleId:"artifact-ownership",severity:"warning",path:`tasks.${r}.execution_steps`,message:`Agent "${n}" produces artifact "${a.produces_artifact}" but is not listed in its producers or editors`}))}if(a.reads_artifact){let o=t.artifacts[a.reads_artifact],s=!!o?.owner||(o?.producers.length??0)>0||(o?.editors.length??0)>0||(o?.consumers.length??0)>0;o&&s&&(o.consumers.includes(n)||o.producers.includes(n)||o.editors.includes(n)||e.push({ruleId:"artifact-ownership",severity:"warning",path:`tasks.${r}.execution_steps`,message:`Agent "${n}" reads artifact "${a.reads_artifact}" but is not listed in its producers, editors, or consumers`}))}}}return e}},sye={id:"tool-commands",description:"Validate tool commands: reads/writes reference existing artifacts; writes align with output_artifacts",run(t){let e=[];for(let[r,i]of Object.entries(t.tools))for(let n of i.commands){for(let a of n.reads)t.artifacts[a]||e.push({ruleId:"tool-commands",severity:"error",path:`tools.${r}.commands`,message:`Command "${n.command}" reads artifact "${a}" which does not exist`});for(let a of n.writes)t.artifacts[a]||e.push({ruleId:"tool-commands",severity:"error",path:`tools.${r}.commands`,message:`Command "${n.command}" writes artifact "${a}" which does not exist`}),t.artifacts[a]&&!i.output_artifacts.includes(a)&&e.push({ruleId:"tool-commands",severity:"warning",path:`tools.${r}.commands`,message:`Command "${n.command}" writes artifact "${a}" but tool's output_artifacts does not include it`})}return e}},lye={id:"guardrail-no-policy-rule",description:"Every guardrail should be referenced by at least one policy rule in guardrail_policies",run(t){let e=[],r=new Set;for(let i of Object.values(t.guardrail_policies))for(let n of i.rules)r.add(n.guardrail);for(let i of Object.keys(t.guardrails))r.has(i)||e.push({ruleId:"guardrail-no-policy-rule",severity:"warning",path:`guardrails.${i}`,message:`Guardrail "${i}" is not referenced by any policy rule in guardrail_policies`});return e}};cye={id:"guardrail-policy-action-state-undefined",description:"Policy rule action.when keys must reference states declared in system.states",run(t){let e=[],r=new Set(t.system.states??[]);for(let[i,n]of Object.entries(t.guardrail_policies))for(let a=0;a<n.rules.length;a++){let o=n.rules[a];if(zF(o.action))for(let s of Object.keys(o.action.when))r.has(s)||e.push({ruleId:"guardrail-policy-action-state-undefined",severity:"error",path:`guardrail_policies.${i}.rules[${a}].action.when.${s}`,message:`Policy rule references state "${s}" in action.when, but it is not declared in system.states`})}return e}},dye={id:"system-states-unused",description:"Each state in system.states should be referenced by at least one policy rule action.when",run(t){let e=[],r=t.system.states??[];if(r.length===0)return e;let i=uye(t);for(let n of r)i.has(n)||e.push({ruleId:"system-states-unused",severity:"info",path:"system.states",message:`State "${n}" is declared in system.states but not referenced by any policy rule action.when`});return e}},pye=new Set(["on","off","yes","no","true","false","y","n"]),qF={id:"yaml-reserved-key-safety",description:"Warns when YAML 1.1 reserved words are used as field values in positions where they may be misinterpreted by non-1.2 parsers",run(t){let e=[];for(let[r,i]of Object.entries(t.workflow))for(let n=0;n<i.steps.length;n++){let a=i.steps[n];if(a.type!=="decision")continue;a.on!==void 0&&a.routing_key===void 0&&e.push({ruleId:"yaml-reserved-key-safety",severity:"warning",path:`workflow.${r}.steps[${n}].on`,message:'Field name "on" is a YAML 1.1 reserved word and may be interpreted as boolean true by some parsers. Use "routing_key" instead.'});let o=Object.keys(a.branches);for(let s of o)pye.has(s.toLowerCase())&&e.push({ruleId:"yaml-reserved-key-safety",severity:"warning",path:`workflow.${r}.steps[${n}].branches.${s}`,message:`Branch key "${s}" is a YAML 1.1 reserved word and may be interpreted as a boolean by some parsers. Consider quoting or renaming.`})}return e}},fye={id:"artifact-required-validation-wiring",description:"Every validation listed in artifact.required_validations must exist, target the artifact, and be referenced in a workflow step or task.",run(t){let e=[],r=new Set;for(let i of Object.values(t.workflow))for(let n of i.steps)n.type==="validation"&&r.add(n.validation);for(let i of Object.values(t.tasks))for(let n of i.validations)r.add(n);for(let[i,n]of Object.entries(t.artifacts))for(let a of n.required_validations){let o=t.validations[a];if(!o){e.push({ruleId:"artifact-required-validation-wiring",severity:"error",path:`artifacts.${i}`,message:`required_validation "${a}" does not exist in validations`});continue}o.target_artifact!==i&&e.push({ruleId:"artifact-required-validation-wiring",severity:"error",path:`artifacts.${i}`,message:`required_validation "${a}" has target_artifact "${o.target_artifact}" instead of "${i}"`}),r.has(a)||e.push({ruleId:"artifact-required-validation-wiring",severity:"warning",path:`artifacts.${i}`,message:`required_validation "${a}" is defined but not referenced in any workflow step or task`})}return e}},mye={id:"task-output-validation-completeness",description:"Tasks producing artifacts should cover those artifacts' required_validations in their validations list.",run(t){let e=[];for(let[r,i]of Object.entries(t.tasks)){let n=new Set;if(i.execution_steps)for(let s of i.execution_steps)s.produces_artifact&&n.add(s.produces_artifact);let a=t.agents[i.target_agent];if(a)for(let s of a.can_write_artifacts)n.add(s);let o=new Set(i.validations);for(let s of n){let l=t.artifacts[s];if(!l||l.required_validations.length===0)continue;let u=l.required_validations.filter(c=>!o.has(c));u.length>0&&e.push({ruleId:"task-output-validation-completeness",severity:"warning",path:`tasks.${r}`,message:`Task produces artifact "${s}" which requires validations [${u.join(", ")}] but task.validations does not include them`})}}return e}},hye=new Set(["semantic","fidelity"]),gye={id:"semantic-validation-phase-coverage",description:"Semantic and fidelity validations should appear in early workflow phases, not only in late phases.",run(t){let e=[],r=new Set;for(let[c,d]of Object.entries(t.validations))hye.has(d.kind)&&r.add(c);if(r.size===0)return e;let i=t.system.default_workflow_order;if(i.length<2)return e;let n=new Map;for(let c of i)n.set(c,new Set);for(let[c,d]of Object.entries(t.workflow))if(n.has(c))for(let f of d.steps)f.type==="validation"&&r.has(f.validation)&&n.get(c).add(f.validation);for(let c of Object.values(t.tasks)){let d=c.workflow;if(n.has(d))for(let f of c.validations)r.has(f)&&n.get(d).add(f)}let a=Math.ceil(i.length/2),o=i.slice(0,a),s=i.slice(a),l=o.some(c=>(n.get(c)?.size??0)>0),u=s.filter(c=>(n.get(c)?.size??0)>0);return!l&&u.length>0&&e.push({ruleId:"semantic-validation-phase-coverage",severity:"warning",path:"validations",message:`Semantic validations are only referenced in workflow phases [${u.join(", ")}]. Consider adding semantic review to earlier phases [${o.join(", ")}] to catch issues before implementation.`}),e}},vye={id:"entity-guardrail-undefined",description:"Entity references a guardrail ID not defined in guardrails",run(t){let e=[],r=new Set(Object.keys(t.guardrails)),i=[{name:"agents",entities:t.agents},{name:"tasks",entities:t.tasks},{name:"tools",entities:t.tools},{name:"artifacts",entities:t.artifacts}];for(let{name:n,entities:a}of i)for(let[o,s]of Object.entries(a))for(let l of s.guardrails??[])r.has(l)||e.push({ruleId:"entity-guardrail-undefined",severity:"error",path:`${n}.${o}.guardrails`,message:`${n.slice(0,-1)} "${o}" references guardrail "${l}" which is not defined in guardrails`});return e}},yye={id:"entity-no-guardrails",description:"Entity has no effective guardrails (neither entity-side nor scope-side)",run(t){let e=[],r={agents:new Set,tasks:new Set,tools:new Set,artifacts:new Set};for(let n of Object.values(t.guardrails))for(let a of Object.keys(r)){let o=n.scope[a];if(o)for(let s of o)r[a].add(s)}let i=[{name:"agents",entities:t.agents},{name:"tasks",entities:t.tasks},{name:"tools",entities:t.tools},{name:"artifacts",entities:t.artifacts}];for(let{name:n,entities:a}of i)for(let[o,s]of Object.entries(a)){let l=(s.guardrails??[]).length>0,u=r[n].has(o);!l&&!u&&e.push({ruleId:"entity-no-guardrails",severity:"info",path:`${n}.${o}`,message:`${n.slice(0,-1)} "${o}" has no effective guardrails`})}return e}},_ye={id:"guardrail-orphaned",description:"Guardrail is not referenced by any entity and not bound to any entity via scope",run(t){let e=[],r=new Set,i=[t.agents,t.tasks,t.tools,t.artifacts];for(let n of i)for(let a of Object.values(n))for(let o of a.guardrails??[])r.add(o);for(let[n,a]of Object.entries(t.guardrails)){let o=r.has(n),s=a.scope,l=(s.agents?.length??0)>0||(s.tasks?.length??0)>0||(s.tools?.length??0)>0||(s.artifacts?.length??0)>0||(s.workflows?.length??0)>0;!o&&!l&&e.push({ruleId:"guardrail-orphaned",severity:"warning",path:`guardrails.${n}`,message:`Guardrail "${n}" is not referenced by any entity and has no scope bindings`})}return e}},wye={id:"validation-executor-no-context",description:"Validation executor is not wired so the validation appears in the executor's rendered context",run(t){let e=[];for(let[r,i]of Object.entries(t.validations))if(i.executor)if(i.executor_type==="agent"){let n=t.agents[i.executor];if(!n)continue;new Set(n.can_perform_validations??[]).has(r)||e.push({ruleId:"validation-executor-no-context",severity:"warning",path:`agents.${i.executor}.can_perform_validations`,message:`Validation "${r}" is executed by agent "${i.executor}" but is not listed in can_perform_validations, so it will be missing from that agent's prompt context`})}else i.executor_type==="tool"&&(t.tools[i.executor]||e.push({ruleId:"validation-executor-no-context",severity:"warning",path:`validations.${r}.executor`,message:`Validation "${r}" references tool executor "${i.executor}" which is not defined in tools`}));return e}},bye={id:"artifact-ownership-consistency",description:"Ensure own_artifacts entries are included in can_read_artifacts and check deprecated owner field consistency",run(t){let e=[];for(let[r,i]of Object.entries(t.agents))if(i.own_artifacts.length!==0)for(let n of i.own_artifacts)i.can_read_artifacts.includes(n)||e.push({ruleId:"artifact-ownership-consistency",severity:"warning",path:`agents.${r}.own_artifacts`,message:`Agent "${r}" owns artifact "${n}" but does not include it in can_read_artifacts`});for(let[r,i]of Object.entries(t.artifacts)){if(!i.owner)continue;let n=t.agents[i.owner];n&&!n.own_artifacts.includes(r)&&e.push({ruleId:"artifact-ownership-consistency",severity:"warning",path:`artifacts.${r}.owner`,message:`Artifact "${r}" has deprecated owner "${i.owner}" but agent does not list it in own_artifacts`})}return e}},Sye=["owner","producers","editors","consumers"],kye=["own_artifacts","can_read_artifacts","can_write_artifacts"];Eye={id:"deprecated-ownership-fields",description:"Warn when deprecated ownership/permission fields are used instead of artifact_bindings + artifact_slots",run(t){let e=[];for(let[r,i]of Object.entries(t.artifacts))for(let n of Sye)xye(i,n)&&e.push({ruleId:"deprecated-ownership-fields",severity:"warning",path:`artifacts.${r}.${n}`,message:`Artifact "${r}" uses deprecated field "${n}". Ownership is derived from artifact_bindings + artifact_slots in the binding model.`});for(let[r,i]of Object.entries(t.agents))for(let n of kye)$ye(i,n)&&e.push({ruleId:"deprecated-ownership-fields",severity:"warning",path:`agents.${r}.${n}`,message:`Agent "${r}" uses deprecated field "${n}". Artifact permissions are derived from artifact_bindings + artifact_slots in the binding model.`});return e}};Aye={id:"extension-declared-unused",description:"Declared extension in `extensions` is never used on any entity",run(t){let e=[],r=Object.keys(t.extensions);if(r.length===0)return e;let i=vS(t);for(let n of r)i.has(n)||e.push({ruleId:"extension-declared-unused",severity:"warning",path:`extensions.${n}`,message:`Extension "${n}" is declared but never used on any entity`});return e}},Pye={id:"extension-scope-mismatch",description:"Extension used on a node type outside its declared scope",run(t){let e=[],r=t.extensions;if(Object.keys(r).length===0)return e;let i=vS(t);for(let[n,a]of Object.entries(r)){let o=a.scope;if(!o||o.length===0)continue;let s=new Set(o),l=i.get(n);if(l)for(let u of l)s.has(u.nodeType)||e.push({ruleId:"extension-scope-mismatch",severity:"warning",path:u.path,message:`Extension "${n}" is used on ${u.nodeType} but declared scope is [${o.join(", ")}]`})}return e}},Oye={id:"extension-undeclared-usage",description:"Entity uses x-* property that is not declared in extensions (when extensions section exists)",run(t){let e=[],r=t.extensions;if(Object.keys(r).length===0)return e;let i=new Set(Object.keys(r)),n=vS(t);for(let[a,o]of n)if(!i.has(a))for(let s of o)e.push({ruleId:"extension-undeclared-usage",severity:"info",path:s.path,message:`Extension "${a}" is used but not declared in extensions \u2014 consider adding a declaration`});return e}};Lye={id:"binding-completeness",description:"Check that artifact_bindings cover all slots referenced in the cli-contract command effects",run(t){let e=[];for(let[r,i]of Object.entries(t.tools)){if(!i.cli_contract||!i.artifact_bindings)continue;let n=hv(i.cli_contract);if(!n?.artifactSlots)continue;let a=i.command??"",o=n.commandEffects[a];if(!o)continue;let s=[...o.reads,...o.writes],l=new Set(Object.keys(i.artifact_bindings));for(let u of s)l.has(u)||e.push({ruleId:"binding-completeness",severity:"warning",path:`tools.${r}.artifact_bindings`,message:`Command "${a}" references slot "${u}" but tool has no artifact_bindings entry for it`})}return e}};zye={id:"binding-direction-match",description:"Check that agents invoking a tool can write artifacts bound via write slots",run(t){let e=[];for(let[r,i]of Object.entries(t.tools)){if(!i.cli_contract||!i.artifact_bindings)continue;let n=hv(i.cli_contract);if(!n)continue;let a=i.command??"";for(let[o,s]of Object.entries(i.artifact_bindings))if(UF(o,a,n)==="write")for(let u of i.invokable_by)Mye(u,s,t)||e.push({ruleId:"binding-direction-match",severity:"warning",path:`tools.${r}.artifact_bindings.${o}`,message:`Agent "${u}" invokes tool "${r}" which writes to artifact "${s}" via slot "${o}", but agent lacks can_write_artifacts or own_artifacts for it`})}return e}},qye={id:"slot-declaration-exists",description:"Check that artifact_bindings keys reference slot names declared in the cli-contract",run(t){let e=[];for(let[r,i]of Object.entries(t.tools)){if(!i.cli_contract||!i.artifact_bindings)continue;let n=hv(i.cli_contract);if(n?.artifactSlots)for(let a of Object.keys(i.artifact_bindings))a in n.artifactSlots||e.push({ruleId:"slot-declaration-exists",severity:"warning",path:`tools.${r}.artifact_bindings.${a}`,message:`artifact_bindings key "${a}" is not declared in cli-contract artifactSlots`})}return e}},Fye={id:"config-path-consistency",description:"Check that control-authority artifacts bound by tools have path_patterns defined",run(t){let e=[];for(let[r,i]of Object.entries(t.tools))if(i.artifact_bindings)for(let[n,a]of Object.entries(i.artifact_bindings)){let o=t.artifacts[a];!o||o.authority!=="control"||o.path_patterns&&o.path_patterns.length>0||e.push({ruleId:"config-path-consistency",severity:"info",path:`tools.${r}.artifact_bindings.${n}`,message:`Config artifact "${a}" has no path_patterns; consider adding them for path-based lookup`})}return e}},VF=[rye,nye,iye,aye,oye,sye,lye,cye,dye,qF,fye,mye,gye,vye,yye,_ye,wye,bye,Eye,Aye,Pye,Oye,Lye,zye,qye,Fye];Vye=wa(Xr(),1),yo=wa(i2e(),1),Bye=wa(Xr(),1),ln=(0,Bye.createRulesetFunction)({input:null,options:{type:"object",properties:{referenceTo:{type:"string"}},required:["referenceTo"],additionalProperties:!1}},(t,e,r)=>{let n=r.document.data[e.referenceTo];if(typeof n!="object"||n===null)return[];let a=new Set(Object.keys(n)),o=Array.isArray(t)?t:[t],s=[];for(let l=0;l<o.length;l++){let u=o[l];if(typeof u=="string"&&!a.has(u)){let c=Array.isArray(t)?[...r.path,l]:[...r.path];s.push({message:`"${u}" does not exist in ${e.referenceTo}`,path:c})}}return s}),Gye=wa(Xr(),1);Hye=(0,Gye.createRulesetFunction)({input:{type:"array"},options:null},(t,e,r)=>{let i=r.document.data,n=r.path.length>=2?String(r.path[1]):void 0,a=n&&i.artifacts?i.artifacts[n]:void 0;return a&&Wye(a)?[]:t.length===0?[{message:"editors must not be empty"}]:[]}),Kye=wa(Xr(),1),Zye=(0,Kye.createRulesetFunction)({input:{type:"object"},options:null},(t,e,r)=>t.mode==="read-only"&&Array.isArray(t.can_write_artifacts)&&t.can_write_artifacts.length>0?[{message:'Agent with mode "read-only" must have empty can_write_artifacts',path:[...r.path,"can_write_artifacts"]}]:[]),Jye=wa(Xr(),1),Yye=(0,Jye.createRulesetFunction)({input:{type:"object"},options:null},(t,e,r)=>{let i=new Set(t.can_read_artifacts??[]),n=t.prerequisites??[];if(i.size===0)return[];let a=[];for(let o=0;o<n.length;o++){let s=n[o];i.has(s.target)||a.push({message:`prerequisite target "${s.target}" is not in can_read_artifacts`,path:[...r.path,"prerequisites",o,"target"]})}return a}),Qye=wa(Xr(),1);Xye=(0,Qye.createRulesetFunction)({input:{type:"object"},options:null},(t,e,r)=>{let i=[];function n(a,o){let s=BF(a),l=s.required,u=s.properties;if(Array.isArray(l)&&typeof u=="object"&&u!==null){let c=new Set(Object.keys(u));for(let d=0;d<l.length;d++)c.has(l[d])||i.push({message:`required field "${l[d]}" is not defined in properties`,path:[...o,"required",d]})}if(typeof u=="object"&&u!==null)for(let[c,d]of Object.entries(u)){if(typeof d!="object"||d===null)continue;let f=d;if(Array.isArray(f.enum)&&f.enum.length===0&&i.push({message:`enum for "${c}" must not be empty`,path:[...o,"properties",c,"enum"]}),f.type==="object"&&n(f,[...o,"properties",c]),f.items&&typeof f.items=="object"){let h=f.items;h.type==="object"&&n(h,[...o,"properties",c,"items"])}}}return n(t,[...r.path]),i}),e4e=wa(Xr(),1),t4e=(0,e4e.createRulesetFunction)({input:{type:"object"},options:null},(t,e,r)=>{let i=r.document.data,n=i.handoff_types,a=i.agents,o=i.tasks,s=i.validations,l=n?new Set(Object.keys(n)):new Set,u=a?new Set(Object.keys(a)):new Set,c=o?new Set(Object.keys(o)):new Set,d=s?new Set(Object.keys(s)):new Set,f=[],h=t.steps??[];for(let g=0;g<h.length;g++){let v=h[g],y=[...r.path,"steps",g];v.type==="delegate"&&(v.task&&!c.has(v.task)&&f.push({message:`task "${v.task}" does not exist in tasks`,path:[...y,"task"]}),v.from_agent&&!u.has(v.from_agent)&&f.push({message:`from_agent "${v.from_agent}" does not exist in agents`,path:[...y,"from_agent"]})),v.type==="gate"&&v.gate_kind&&!l.has(v.gate_kind)&&f.push({message:`gate_kind "${v.gate_kind}" does not exist in handoff_types`,path:[...y,"gate_kind"]}),v.type==="handoff"&&(v.handoff_kind&&!l.has(v.handoff_kind)&&f.push({message:`handoff_kind "${v.handoff_kind}" does not exist in handoff_types`,path:[...y,"handoff_kind"]}),v.from_agent&&!u.has(v.from_agent)&&f.push({message:`from_agent "${v.from_agent}" does not exist in agents`,path:[...y,"from_agent"]}),v.task&&!c.has(v.task)&&f.push({message:`task "${v.task}" does not exist in tasks`,path:[...y,"task"]})),v.type==="validation"&&v.validation&&!d.has(v.validation)&&f.push({message:`validation "${v.validation}" does not exist in validations`,path:[...y,"validation"]})}return f}),r4e={rules:{"artifact-owner-ref":{description:"Artifact owner must reference an existing agent",message:"{{error}}",severity:"error",given:"$.artifacts.*",then:{field:"owner",function:ln,functionOptions:{referenceTo:"agents"}}},"artifact-producers-ref":{description:"(deprecated) Artifact producers must reference existing agents",message:"{{error}}",severity:"warn",given:"$.artifacts.*",then:{field:"producers",function:ln,functionOptions:{referenceTo:"agents"}}},"artifact-editors-ref":{description:"(deprecated) Artifact editors must reference existing agents",message:"{{error}}",severity:"warn",given:"$.artifacts.*",then:{field:"editors",function:ln,functionOptions:{referenceTo:"agents"}}},"artifact-consumers-ref":{description:"(deprecated) Artifact consumers must reference existing agents",message:"{{error}}",severity:"warn",given:"$.artifacts.*",then:{field:"consumers",function:ln,functionOptions:{referenceTo:"agents"}}},"artifact-required-validations-ref":{description:"Artifact required_validations must reference existing validations",message:"{{error}}",severity:"error",given:"$.artifacts.*",then:{field:"required_validations",function:ln,functionOptions:{referenceTo:"validations"}}},"agent-can-invoke-agents-ref":{description:"can_invoke_agents must reference existing agents",message:"{{error}}",severity:"error",given:"$.agents.*",then:{field:"can_invoke_agents",function:ln,functionOptions:{referenceTo:"agents"}}},"agent-can-read-artifacts-ref":{description:"can_read_artifacts must reference existing artifacts",message:"{{error}}",severity:"error",given:"$.agents.*",then:{field:"can_read_artifacts",function:ln,functionOptions:{referenceTo:"artifacts"}}},"agent-can-write-artifacts-ref":{description:"can_write_artifacts must reference existing artifacts",message:"{{error}}",severity:"error",given:"$.agents.*",then:{field:"can_write_artifacts",function:ln,functionOptions:{referenceTo:"artifacts"}}},"agent-can-execute-tools-ref":{description:"can_execute_tools must reference existing tools",message:"{{error}}",severity:"error",given:"$.agents.*",then:{field:"can_execute_tools",function:ln,functionOptions:{referenceTo:"tools"}}},"agent-can-perform-validations-ref":{description:"can_perform_validations must reference existing validations",message:"{{error}}",severity:"error",given:"$.agents.*",then:{field:"can_perform_validations",function:ln,functionOptions:{referenceTo:"validations"}}},"agent-can-return-handoffs-ref":{description:"can_return_handoffs must reference existing handoff_types",message:"{{error}}",severity:"error",given:"$.agents.*",then:{field:"can_return_handoffs",function:ln,functionOptions:{referenceTo:"handoff_types"}}},"task-target-agent-ref":{description:"Task target_agent must reference an existing agent",message:"{{error}}",severity:"error",given:"$.tasks.*",then:{field:"target_agent",function:ln,functionOptions:{referenceTo:"agents"}}},"task-allowed-from-agents-ref":{description:"Task allowed_from_agents must reference existing agents",message:"{{error}}",severity:"error",given:"$.tasks.*",then:{field:"allowed_from_agents",function:ln,functionOptions:{referenceTo:"agents"}}},"task-invocation-handoff-ref":{description:"Task invocation_handoff must reference an existing handoff_type",message:"{{error}}",severity:"error",given:"$.tasks.*",then:{field:"invocation_handoff",function:ln,functionOptions:{referenceTo:"handoff_types"}}},"task-result-handoff-ref":{description:"Task result_handoff must reference an existing handoff_type",message:"{{error}}",severity:"error",given:"$.tasks.*",then:{field:"result_handoff",function:ln,functionOptions:{referenceTo:"handoff_types"}}},"task-input-artifacts-ref":{description:"Task input_artifacts must reference existing artifacts",message:"{{error}}",severity:"error",given:"$.tasks.*",then:{field:"input_artifacts",function:ln,functionOptions:{referenceTo:"artifacts"}}},"task-validations-ref":{description:"Task validations must reference existing validations",message:"{{error}}",severity:"error",given:"$.tasks.*",then:{field:"validations",function:ln,functionOptions:{referenceTo:"validations"}}},"validation-target-artifact-ref":{description:"Validation target_artifact must reference an existing artifact",message:"{{error}}",severity:"error",given:"$.validations.*",then:{field:"target_artifact",function:ln,functionOptions:{referenceTo:"artifacts"}}},"tool-invokable-by-ref":{description:"(deprecated) Tool invokable_by must reference existing agents",message:"{{error}}",severity:"warn",given:"$.tools.*",then:{field:"invokable_by",function:ln,functionOptions:{referenceTo:"agents"}}},"artifact-editors-not-empty":{description:"(deprecated) Artifact editors must not be empty (15.2.2)",message:"{{error}}",severity:"info",given:"$.artifacts.*.editors",then:{function:Hye}},"artifact-owner-exists":{description:"(deprecated) Every artifact must have an owner",severity:"off",given:"$.artifacts.*",then:{field:"owner",function:yo.truthy}},"workflow-step-refs":{description:"Workflow step references (task, from_agent, gate_kind, handoff_kind, validation) must exist",message:"{{error}}",severity:"error",given:"$.workflow.*",then:{function:t4e}},"readonly-agent-no-writes":{description:'Agent with mode "read-only" must have empty can_write_artifacts',message:"{{error}}",severity:"error",given:"$.agents.*",then:{function:Zye}},"agent-prerequisite-readable":{description:"Agent prerequisites target must be in can_read_artifacts",message:"{{error}}",severity:"error",given:"$.agents.*",then:{function:Yye}},"handoff-payload-integrity":{description:"Handoff schema required/properties consistency, enum non-empty, nested validation",message:"{{error}}",severity:"error",given:"$.handoff_types.*.schema",then:{function:Xye}},"agent-key-casing":{description:"Agent keys must use kebab-case",severity:"warn",given:"$.agents",then:{field:"@key",function:yo.casing,functionOptions:{type:"kebab"}}},"task-key-casing":{description:"Task keys must use kebab-case",severity:"warn",given:"$.tasks",then:{field:"@key",function:yo.casing,functionOptions:{type:"kebab"}}},"artifact-key-casing":{description:"Artifact keys must use kebab-case",severity:"warn",given:"$.artifacts",then:{field:"@key",function:yo.casing,functionOptions:{type:"kebab"}}},"tool-key-casing":{description:"Tool keys must use kebab-case",severity:"warn",given:"$.tools",then:{field:"@key",function:yo.casing,functionOptions:{type:"kebab"}}},"validation-key-casing":{description:"Validation keys must use kebab-case",severity:"warn",given:"$.validations",then:{field:"@key",function:yo.casing,functionOptions:{type:"kebab"}}},"handoff-type-key-casing":{description:"Handoff type keys must use kebab-case",severity:"warn",given:"$.handoff_types",then:{field:"@key",function:yo.casing,functionOptions:{type:"kebab"}}},"policy-key-casing":{description:"Policy keys must use kebab-case",severity:"warn",given:"$.policies",then:{field:"@key",function:yo.casing,functionOptions:{type:"kebab"}}},"version-must-be-1":{description:"DSL version must be 1",severity:"error",given:"$.version",then:{function:yo.enumeration,functionOptions:{values:[1]}}}}},n4e=r4e,i4e={0:"error",1:"warning",2:"info",3:"info"},$0=null;$4e=new Set(["linter","checker","validator","test"]),E4e=["lint","check","validate","test","verify","audit"];br.default.registerHelper("eq",(t,e)=>t===e);br.default.registerHelper("notEmpty",t=>!t||typeof t!="object"?!1:Object.keys(t).length>0);br.default.registerHelper("inc",t=>t+1);br.default.registerHelper("lookupPayloadFields",t=>{let e=Ps(t??{}),r=e.properties;if(!r)return[];let i=new Set(e.required??[]);return Object.entries(r).map(([n,a])=>{let o=a.enum;return{name:n,type:a.type??"any",required:i.has(n),enum:o?o.join(" | "):void 0}})});br.default.registerHelper("yamlBlock",t=>XF(t));br.default.registerHelper("jsonBlock",t=>L4e(t));br.default.registerHelper("yamlFrontmatter",t=>M4e(t));br.default.registerHelper("handoffPayload",t=>eU(t??void 0));br.default.registerHelper("handoffEnvelope",(t,e)=>{let r=typeof e?.hash?.id=="string"?e.hash.id:void 0;return z4e(t??void 0,r)});br.default.registerHelper("join",(t,e)=>{if(!Array.isArray(t))return"";let r=typeof e=="string"?e:", ";return t.join(r)});br.default.registerHelper("contains",(t,e)=>Array.isArray(t)?t.includes(e):!1);br.default.registerHelper("groupBy",(t,e)=>{if(!Array.isArray(t))return{};let r={};for(let i of t){let n=String(i?.[e]??"undefined");(r[n]??=[]).push(i)}return r});br.default.registerHelper("keys",t=>!t||typeof t!="object"?[]:Object.keys(t));br.default.registerHelper("values",t=>!t||typeof t!="object"?[]:Object.values(t));br.default.registerHelper("filterByField",(t,e,r)=>Array.isArray(t)?t.filter(i=>i?.[e]===r):[]);br.default.registerHelper("not",t=>!t);br.default.registerHelper("or",(...t)=>{let e=t.pop();return t.some(r=>!!r)});br.default.registerHelper("coalesce",(...t)=>{let e=t.pop();return t.find(r=>r!=null&&r!==!1&&r!=="")});br.default.registerHelper("and",(...t)=>{let e=t.pop();return t.every(r=>!!r)});br.default.registerHelper("gt",(t,e)=>t>e);br.default.registerHelper("gte",(t,e)=>t>=e);br.default.registerHelper("lt",(t,e)=>t<e);br.default.registerHelper("size",t=>Array.isArray(t)?t.length:t&&typeof t=="object"?Object.keys(t).length:0);br.default.registerHelper("sequenceDiagram",function(...t){let e=t[t.length-1],r=t.slice(0,-1);if(typeof r[0]=="string"&&r[1]){let o=r[0],s=r[1];if(!s.workflow[o])return"";let l=vv(s,o);return TL(l.workflow,l.relatedTasks,s)}let i=this.workflow,n=this.relatedTasks,a=e?.hash?.dsl??this.dsl;return!i||!a?"":TL(i,n??[],a)});br.default.registerHelper("overviewFlowchart",function(...t){let e=t.slice(0,-1);if(e[0]&&typeof e[0]=="object")return DL(e[0]);let r=this.dsl;return r?DL(r):""});br.default.registerHelper("guardrailCoverageMatrix",function(){let t=this.guardrailEnforcement;if(!t||t.length===0)return"";let e="| Guardrail | Severity | Action | Agents | Tasks | Workflows | Tools | Artifacts | Trigger | Override | Escalation |",r="|-----------|----------|--------|--------|-------|-----------|-------|-----------|---------|----------|------------|",i=t.map(n=>{let a=n.scoped_agents?.join(", ")||"\u2014",o=n.scoped_tasks?.join(", ")||"\u2014",s=n.scoped_workflows?.join(", ")||"\u2014",l=n.scoped_tools?.join(", ")||"\u2014",u=n.scoped_artifacts?.join(", ")||"\u2014",c=n.trigger||"\u2014",d=n.allow_override?"yes":"no",f=n.escalation,h=f?f.target:"\u2014";return`| ${n.guardrail_id} | ${n.severity} | ${n.action} | ${a} | ${o} | ${s} | ${l} | ${u} | ${c} | ${d} | ${h} |`});return[e,r,...i].join(`
422
422
  `)});br.default.registerHelper("taskGuardrailMatrix",function(){let t=this.dsl,e=this.guardrailEnforcement;if(!t||!e||e.length===0)return"";let r=Object.keys(t.tasks);if(r.length===0)return"";let i=e.map(s=>s.guardrail_id),n=`| Task | ${i.join(" | ")} |`,a=`|------|${i.map(()=>"------").join("|")}|`,o=r.map(s=>{let l=e.map(u=>{let c=u.scoped_tasks;return c.length>0&&!c.includes(s)?"n/a":u.action});return`| ${s} | ${l.join(" | ")} |`});return[n,a,...o].join(`
423
- `)});U4e=new RegExp(`\\{(${fv.join("|")})\\.[^}]+\\}`);oU=C.object({template:C.string(),context:dS,output:C.string(),include:C.array(C.string()).optional(),exclude:C.array(C.string()).optional(),skip_empty:C.boolean().optional()}).refine(t=>!(t.include&&t.exclude),{message:"include and exclude are mutually exclusive"}).refine(t=>!(t.context==="system"&&(t.include||t.exclude)),{message:"include/exclude cannot be used with context: system"}),Y4e=C.object({dsl:C.string().optional(),bindings:C.array(C.string()).default([]),vars:C.record(C.string(),C.string()).optional(),paths:C.record(C.string(),C.string()).optional(),active_guardrail_policy:C.string().optional(),interface_output:C.string().optional()}),Q4e=C.object({adapter:C.string().optional(),model:C.string().optional(),temperature:C.number().min(0).max(2).optional(),cache_dir:C.string().optional()}).optional(),X4e=C.object({exclude_patterns:C.array(C.string()).default([])}).optional(),sU=C.object({dsl:C.string().optional(),vars:C.record(C.string(),C.string()).optional(),renders:C.array(oU).default([]),bindings:C.array(C.string()).default([]),active_guardrail_policy:C.string().optional(),paths:C.record(C.string(),C.string()).optional(),teams:C.record(C.string(),Y4e).optional(),audit:Q4e,artifact_coverage:X4e}).superRefine((t,e)=>{if(t.dsl!==void 0&&t.teams!==void 0){e.addIssue({code:C.ZodIssueCode.custom,message:"dsl and teams are mutually exclusive",path:["teams"]});return}if(t.dsl===void 0&&t.teams===void 0){e.addIssue({code:C.ZodIssueCode.custom,message:"Either dsl or teams must be specified",path:[]});return}if(t.teams)for(let[r,i]of Object.entries(t.teams))r!=="_defaults"&&i.dsl===void 0&&e.addIssue({code:C.ZodIssueCode.custom,message:`Team "${r}" must specify dsl`,path:["teams",r,"dsl"]})}),e6e="agent-contracts.config.yaml",Ci=class extends Error{constructor(t,e){super(t),this.filePath=e,this.name="ConfigLoadError"}filePath};a6e={guardrail_impl:"map",outputs:"map",renders:"array",reporting:"object"};p6e={agents:{section:"agents",fields:["responsibilities","constraints","rules"]},tasks:{section:"tasks",fields:["description","responsibilities","execution_steps","completion_criteria"]},artifacts:{section:"artifacts",fields:["description","visibility"]},tools:{section:"tools",fields:["description","commands"]},workflow:{section:"workflow",fields:["description","trigger","entry_conditions"]},guardrails:{section:"guardrails",fields:["rationale","tags"]}};A6e={id:"dsl-auditor",role_name:"DSL Auditor",purpose:"Audit completeness of agent-contracts DSL definitions against generated agent prompts, detect gaps, and present improvement recommendations.",mode:"read-write",dispatch_only:!1,can_read_artifacts:["dsl-source","dsl-generated-output","dsl-audit-report","dsl-score-report"],can_write_artifacts:["dsl-audit-report"],can_execute_tools:["agent-contracts-cli"],can_invoke_agents:["dsl-auditor"],can_return_handoffs:["dsl-audit-result"],responsibilities:["Cross-check DSL definitions against generated prompts across 19 dimensions","Classify detected gaps as template gap, data gap, or DSL gap","Prioritize improvement recommendations (P0/P1/P2) with concrete fix proposals","Report score-based improvement areas as audit recommendations (read-only; consumes dsl-score-report produced by dsl-designer)","Review DSL design for semantic coherence (role overlap, scope breadth, gate placement)","Verify generated prompts faithfully represent DSL intent (no hallucinated permissions)","Audit x-* extension consumption across render templates and runtime codegen paths"],constraints:["Do not directly modify DSL definitions (read-only analysis)","Do not execute agent-contracts score independently; consume dsl-score-report produced by dsl-designer only","Recommendations must include concrete YAML or template fix proposals","Findings must be classified as PASS / MISS / PARTIAL / N/A"],rules:[{id:"R-AUDIT-001",description:"Audit must cover all 19 dimensions: purpose, mode, can_read_artifacts, can_write_artifacts, can_invoke_agents, tools, can_perform_validations, responsibilities, constraints, rules, escalation_criteria, x-authority, supported_tasks, delegatable_tasks, handoff_schemas, guardrails, anti_patterns, x-audit-checklist, x-sections.",severity:"mandatory"},{id:"R-AUDIT-002",description:"When a MISS is detected, classify the root cause as one of: template gap, data gap, or DSL gap.",severity:"mandatory"}],escalation_criteria:[{condition:"3 or more critical-level gaps detected",action:"stop_and_report"},{condition:"Structural defect detected in templates",action:"stop_and_report"}]},P6e={id:"dsl-designer",role_name:"DSL Designer",purpose:"Design, create, and update agent-contracts DSL definitions and bindings. Verify quality using validate, lint, render, and score commands. Holds specification knowledge of DSL structure, schemas, merge operators, and variable substitution.",mode:"read-write",dispatch_only:!1,can_read_artifacts:["dsl-source","dsl-generated-output","dsl-score-report","dsl-audit-report"],can_write_artifacts:["dsl-source","dsl-generated-output","dsl-score-report"],can_execute_tools:["agent-contracts-cli"],can_invoke_agents:["dsl-designer"],can_return_handoffs:["dsl-task-result"],responsibilities:["Create new and update existing agent-contracts DSL (YAML) definitions","Design all sections \u2014 agents, tasks, artifacts, tools, validations, handoff_types, workflow, policies, guardrails, guardrail_policies","Add and update software bindings","Correctly use extends-based DSL inheritance and merge operators","Verify quality via agent-contracts validate / lint / render / score","Improve score across 7 dimensions (artifact validation coverage, task validation coverage, guardrail policy coverage, workflow validation integration, schema completeness, cross-reference bidirectionality, guardrail scope resolution)"],constraints:["DSL definitions must pass agent-contracts validate","Do not break existing extends inheritance chains","Do not directly edit generated files \u2014 always modify DSL source and re-render","handoff_types schemas must be JSON Schema compliant with correct allOf $ref usage"],rules:[{id:"R-DSL-001",description:"After any DSL change, verify in order: validate \u2192 lint \u2192 render --check \u2192 score.",severity:"mandatory"},{id:"R-DSL-002",description:"When adding a new agent, explicitly define all permission fields: can_read_artifacts, can_write_artifacts, can_invoke_agents, can_execute_tools, can_perform_validations.",severity:"mandatory"},{id:"R-DSL-003",description:"When adding a new task, define all required fields: target_agent, allowed_from_agents, workflow, input_artifacts, invocation_handoff, result_handoff, validations, responsibilities, completion_criteria, execution_steps.",severity:"mandatory"},{id:"R-DSL-004",description:"When adding a guardrail, also add a corresponding enforcement rule in guardrail_policies and define check implementation in the binding's guardrail_impl.",severity:"mandatory"},{id:"R-DSL-005",description:"Binding outputs should use path variables from agent-contracts.config.yaml (e.g. {cursor_root}, {check_scripts_root}).",severity:"recommended"}],escalation_criteria:[{condition:"Schema errors from validate cannot be resolved",action:"stop_and_report"},{condition:"Unintended override occurring during extends merge",action:"stop_and_report"},{condition:"Score below 70% with no clear improvement path",action:"stop_and_report"}]},O6e={"dsl-auditor":A6e,"dsl-designer":P6e},I6e={id:"update-dsl-definitions",description:"Create new or update existing agent-contracts DSL definitions",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Create and update DSL YAML files","Define agents, tasks, artifacts, tools, validations, handoff_types, workflow, guardrails","Configure system section"],completion_criteria:["agent-contracts validate succeeds","agent-contracts lint reports no errors","Cross-references for newly added entities are correct"],optional:!1},C6e={id:"update-dsl-binding",description:"Create new or update existing software bindings",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Add and update guardrail_impl check definitions","Configure outputs section templates and inline templates","Set up binding extends inheritance"],completion_criteria:["Binding YAML conforms to the correct schema","guardrail_impl hook_event / matcher values are valid","agent-contracts generate guardrails succeeds"],optional:!1},j6e={id:"render-dsl-outputs",description:"Render prompts and documents from DSL and check for drift",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Generate prompts and documents via agent-contracts render","Detect and resolve drift using render --check"],completion_criteria:["render succeeds","render --check reports no drift"],optional:!1},T6e={id:"check-dsl-score",description:"Check DSL completeness score and identify improvement areas",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Review score across 7 dimensions and identify weaknesses","List entities that need improvement"],completion_criteria:["Score results have been reviewed","Improvement areas have been identified"],optional:!1},R6e={id:"audit-dsl-completeness",description:"Audit completeness of DSL definitions against generated prompts",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source","dsl-generated-output"],responsibilities:["Cross-check across 19 dimensions per audit procedure","Classify gaps as template gap, data gap, or DSL gap","Present improvement recommendations"],completion_criteria:["All dimensions inspected for all agents","Detected gaps are classified","Improvement recommendations are presented with priority"],optional:!1},D6e={id:"audit-semantic-design",description:"Audit DSL design for semantic coherence",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source"],responsibilities:["Check dispatch_only agents for implementation responsibilities","Detect agents with overly broad scope","Identify role overlap between agents","Verify handoff schemas carry sufficient fields for task completion_criteria","Check workflow gates are placed effectively","Detect guardrails declared but absent from execution path","Check semantic validations are distributed across phases","Detect custom x- properties that replicate standard DSL control-flow features (gate, decision, entry_conditions)"],completion_criteria:["All agents reviewed for scope and overlap","Workflow gate placement analyzed","Guardrail enforcement path verified","Custom x- property misuse flagged","Findings classified with severity and category"],optional:!1},N6e={id:"audit-generated-prompts",description:"Audit generated prompts against DSL intent",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source","dsl-generated-output"],responsibilities:["Compare generated prompt content against DSL agent definitions","Detect missing requirements from DSL","Detect hallucinated permissions not in DSL","Identify ambiguous or unsafe instructions","Verify consistency between prompt and handoff schema expectations"],completion_criteria:["All generated prompts compared against DSL definitions","Missing, hallucinated, and ambiguous instructions identified","Findings classified with severity and category"],optional:!1},L6e={id:"audit-extension-consumption",description:"Audit declared x-* extensions for consumption gaps across render and runtime paths",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source","dsl-generated-output"],responsibilities:["Cross-check extensions declarations against entity x-* usage","Identify x-* properties populated in DSL but not consumed by any render template","Detect semantic overlap between x-* extensions and standard DSL features","Report runtime codegen reachability for each extension","Distinguish intentional metadata-only extensions from consumption gaps"],completion_criteria:["All declared extensions checked for template and runtime consumption","Unused extensions flagged with suggested action (remove, migrate to standard, or add template support)","Runtime-unreachable extensions documented with explanation","Findings classified with severity and category"],optional:!1},M6e={"update-dsl-definitions":I6e,"update-dsl-binding":C6e,"render-dsl-outputs":j6e,"check-dsl-score":T6e,"audit-dsl-completeness":R6e,"audit-semantic-design":D6e,"audit-generated-prompts":N6e,"audit-extension-consumption":L6e},z6e=C.object({task_id:C.string(),scope:C.string().optional(),context:C.string().optional()}),q6e=C.object({changed_files:C.array(C.string()).optional(),validation_result:C.enum(["pass","fail"]),lint_result:C.enum(["pass","fail","skipped"]).optional(),generate_result:C.enum(["pass","fail","skipped"]).optional(),render_result:C.enum(["pass","fail","skipped"]).optional(),drift_detected:C.boolean().optional(),cross_reference_check:C.enum(["pass","fail","skipped"]).optional(),score:C.number().optional(),score_dimensions:C.record(C.string(),C.unknown()).optional(),notes:C.string().optional()}),F6e=C.object({summary:C.string(),risk_level:C.enum(["low","medium","high","critical"]),findings:C.array(C.object({id:C.string().optional(),severity:C.enum(["info","warning","error","critical"]),category:C.string(),target:C.string().optional(),location:C.string().optional(),message:C.string(),recommendation:C.string().optional(),confidence:C.number().optional(),evidence:C.array(C.object({kind:C.enum(["file","command","schema","diff","stdout","stderr","text"]),target:C.string().optional(),location:C.string().optional(),excerpt:C.string().optional()})).optional(),details:C.record(C.string(),C.unknown()).optional()})),recommended_actions:C.array(C.object({kind:C.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:C.string(),command:C.string().optional(),target:C.string().optional(),rationale:C.string().optional()})).optional(),metadata:C.object({tool:C.string().optional(),command:C.string().optional(),version:C.string().optional(),generated_at:C.string().optional(),adapter:C.string().optional(),model:C.string().optional()}).optional()}),U6e=C.object({audit_type:C.enum(["completeness","semantic","prompt","extensions"]),total_dimensions:C.number(),pass_count:C.number(),miss_count:C.number(),partial_count:C.number().optional(),agents_reviewed:C.number().optional(),prompts_reviewed:C.number().optional(),gate_analysis_complete:C.boolean().optional(),guardrail_enforcement_verified:C.boolean().optional(),critical_gaps:C.array(C.object({dimension:C.string().optional(),agent:C.string().optional(),gap_type:C.enum(["template_gap","data_gap","dsl_gap"]).optional(),severity:C.enum(["critical","warning","info"]).optional()})).optional(),recommendations:C.array(C.object({priority:C.enum(["P0","P1","P2"]).optional(),description:C.string().optional(),fix_type:C.enum(["template_fix","dsl_fix","regeneration"]).optional()})).optional()}),V6e={"dsl-task-request":z6e,"dsl-task-result":q6e,"audit-result":F6e,"dsl-audit-result":U6e};G6e={render:"audit-dsl-completeness",dsl:"audit-semantic-design",prompt:"audit-generated-prompts",extensions:"audit-extension-consumption"};bs.default.registerHelper("json",t=>new bs.default.SafeString(JSON.stringify(t,null,2)));bs.default.registerHelper("expand",(t,e)=>{if(typeof t!="string")return"";let r=e.hash,i=t;for(let[n,a]of Object.entries(r))i=i.replace(new RegExp(`\\{\\{${n}\\}\\}`,"g"),String(a));return new bs.default.SafeString(i)});i_e=new Set(["node_modules",".git","dist",".next","coverage"]);});var FU={};Cn(FU,{createModelResolver:()=>qU});function zU(t,e){let r=t.indexOf(":");if(r===-1)return{adapter:e,model:t||void 0};let i=t.slice(0,r)||e,n=t.slice(r+1)||void 0;return{adapter:i,model:n}}function qU(t){let e=t.env??process.env;return{resolve(r){let i={adapter:t.fallbackAdapter,model:t.fallbackModel};if(!r)return i;let n=e[P_e[r]];if(n)return zU(n,t.fallbackAdapter);let a=e[Pv];if(a)return zU(a,t.fallbackAdapter);let o=t.modelMapping?.[r];return o?{adapter:o.adapter,model:o.model}:i}}}var Pv,P_e,RS=st(()=>{"use strict";Pv="AGENT_RUNTIME_MODEL",P_e={fast:`${Pv}_FAST`,standard:`${Pv}_STANDARD`,thinking:`${Pv}_THINKING`}});var Cv={};Cn(Cv,{ClaudeAgentSdkAdapter:()=>NS});function p9e(t){return{PreToolUse:[{hooks:[r=>{let i=r.tool_input,n=r.tool_name;if(n==="Bash"||n==="Shell"){let o=i?.command??i?.input;if(o){let s=t.beforeShellExecution({command:o});if(s.permission==="deny")return{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:s.user_message??s.agent_message};if(s.additionalContext)return{hookEventName:"PreToolUse",additionalContext:s.additionalContext}}}let a=i?.file_path??i?.path;if(a){let o=t.preToolUse({tool_name:n,tool_input:{file_path:a}});if(o.permission==="deny")return{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:o.user_message??o.agent_message};if(o.additionalContext)return{hookEventName:"PreToolUse",additionalContext:o.additionalContext}}return{hookEventName:"PreToolUse"}}]}]}}function f9e(t,e){switch(t.type){case"assistant":{let r=t.message?.content;if(!r)break;for(let i of r)i.type==="tool_use"&&i.name&&e({type:"tool_use",tool_name:i.name});break}case"tool_progress":t.tool_name&&e({type:"tool_use",tool_name:t.tool_name});break;case"tool_use_summary":t.summary&&e({type:"status",message:t.summary});break;default:break}}var NS,jv=st(()=>{"use strict";NS=class t{cwd;model;tools;permissionMode;maxTurns;guardrailHooks;lastSessionId=null;queryFn=null;constructor(e={}){this.cwd=e.cwd??process.cwd(),this.model=e.model,this.tools=e.tools,this.permissionMode=e.permissionMode??"bypassPermissions",this.maxTurns=e.maxTurns,this.guardrailHooks=e.guardrailHooks}async resolveQueryFn(){if(this.queryFn)return this.queryFn;let e=await import("@anthropic-ai/claude-agent-sdk");return this.queryFn=e.query,this.queryFn}buildOptions(e,r){let i={cwd:this.cwd,permissionMode:this.permissionMode,allowDangerouslySkipPermissions:this.permissionMode==="bypassPermissions"};return this.model&&(i.model=this.model),this.maxTurns&&(i.maxTurns=this.maxTurns),this.tools?i.tools=this.tools:i.tools=e?["Read","Glob","Grep"]:["Read","Glob","Grep","Edit","Write","Bash"],r&&(i.resume=r),this.guardrailHooks&&(i.hooks=p9e(this.guardrailHooks)),i}async runQuery(e,r,i){let a=(await this.resolveQueryFn())({prompt:e,options:r}),o="",s="";for await(let l of a)if(l.type==="result"){if(s=l.session_id??s,l.subtype==="success")o=l.result;else if(l.subtype==="error")throw new Error(`Claude Agent SDK error: ${l.error}`)}else i&&f9e(l,i);return{text:o,sessionId:s}}async send(e,r){this.lastSessionId=null;let i=this.buildOptions(r.readonly),{text:n,sessionId:a}=await this.runQuery(e,i,r.onProgress);return this.lastSessionId=a,n}async followUp(e){if(!this.lastSessionId)throw new Error("followUp() called before send() \u2014 no active session");let r=this.buildOptions(!1,this.lastSessionId),{text:i,sessionId:n}=await this.runQuery(e,r);return this.lastSessionId=n,i}async sendExecution(e){this.lastSessionId=null;let r=this.buildOptions(e.options.readonly),{text:i,sessionId:n}=await this.runQuery(e.prompt,r,e.options.onProgress);return this.lastSessionId=n,i}static withQueryFn(e,r){let i=new t(r);return i.queryFn=e,i}}});var Tv={};Cn(Tv,{CursorSdkAdapter:()=>MS});function m9e(t){return{beforeShellExecution:e=>{let r=t.beforeShellExecution(e);return LS(r,"beforeShellExecution",e.command)},preToolUse:e=>{let r=t.preToolUse(e),i=e.tool_input?.file_path??e.tool_input?.path??e.tool_name;return LS(r,"preToolUse",i)},afterFileEdit:e=>{let r=t.afterFileEdit(e);return LS(r,"afterFileEdit",e.file_path)}}}function LS(t,e,r){return t.permission==="deny"?(process.stderr.write(`[guardrail:deny] ${e}: ${r??"(unknown)"} \u2014 ${t.user_message??"no reason"}
424
- `),{permissionDecision:"deny",userMessage:t.user_message,agentMessage:t.agent_message}):t.additionalContext?{additionalContext:t.additionalContext}:{}}var MS,Rv=st(()=>{"use strict";MS=class t{agent;constructor(e){this.agent=e}async collectStream(e){let r="";for await(let i of e.stream())if(i.type==="assistant"&&i.message?.content)for(let n of i.message.content)n.type==="text"&&n.text&&(r+=n.text);return r}async send(e,r){let i=await this.agent.send(e);return this.collectStream(i)}async followUp(e){let r=await this.agent.send(e);return this.collectStream(r)}static async create(e){let{Agent:r}=await import("@cursor/sdk"),i={model:{id:e.model??"composer-2"},local:{cwd:e.cwd??process.cwd()}};e.apiKey&&(i.apiKey=e.apiKey),e.guardrailHooks&&Object.assign(i,m9e(e.guardrailHooks));let n=await r.create(i);return new t(n)}}});var Dv={};Cn(Dv,{MockAdapter:()=>zS});var zS,Nv=st(()=>{"use strict";zS=class{responses;defaultLatencyMs;constructor(e){this.responses=e?.responses??{},this.defaultLatencyMs=e?.defaultLatencyMs??0}async send(e,r){let n=e.match(/## Task: (\S+)/)?.[1]??"unknown",o=e.match(/## User Request\n\n([\s\S]*?)(?:\n\n---|$)/)?.[1]?.trim()??"";this.defaultLatencyMs>0&&await new Promise(l=>setTimeout(l,this.defaultLatencyMs));let s=this.responses[n];return s?s(o):`Task "${n}" completed but no structured output available.`}}});var sV={};Cn(sV,{GeminiSdkAdapter:()=>BS});function US(t){if(t.text)return t.text;if(t.candidates?.length){let e=t.candidates[0].content?.parts;if(e?.length)return e.map(r=>r.text??"").join("")}return""}function VS(t){let e=t.candidates?.[0];if(e?.finishReason==="SAFETY"){let r=e.safetyRatings?.filter(i=>i.probability==="HIGH").map(i=>i.category).join(", ");throw new Error(`Gemini response blocked by safety filters: ${r||"unknown category"}`)}}var BS,lV=st(()=>{"use strict";BS=class t{apiKey;model;systemInstruction;temperature;maxOutputTokens;guardrailHooks;lastChat=null;client=null;ClientClass=null;constructor(e={}){this.apiKey=e.apiKey,this.model=e.model??"gemini-2.5-flash",this.systemInstruction=e.systemInstruction,this.temperature=e.temperature,this.maxOutputTokens=e.maxOutputTokens,this.guardrailHooks=e.guardrailHooks}async resolveClient(){if(this.client)return this.client;if(!this.ClientClass){let r=await import("@google/genai");this.ClientClass=r.GoogleGenAI}let e=this.apiKey??process.env.GEMINI_API_KEY;if(!e)throw new Error("GEMINI_API_KEY environment variable or apiKey config is required for the Gemini adapter");return this.client=new this.ClientClass({apiKey:e}),this.client}buildGenerationConfig(){let e={};return this.systemInstruction&&(e.systemInstruction=this.systemInstruction),this.temperature!==void 0&&(e.temperature=this.temperature),this.maxOutputTokens!==void 0&&(e.maxOutputTokens=this.maxOutputTokens),e}createChat(e){return e.chats.create({model:this.model,config:this.buildGenerationConfig()})}async send(e,r){this.lastChat=null;let i=await this.resolveClient(),n=this.createChat(i),a=await n.sendMessage({message:e});return VS(a),this.lastChat=n,US(a)}async followUp(e){if(!this.lastChat)throw new Error("followUp() called before send() \u2014 no active session");let r=await this.lastChat.sendMessage({message:e});return VS(r),US(r)}async sendExecution(e){this.lastChat=null;let r=await this.resolveClient(),i=this.createChat(r),n=await i.sendMessage({message:e.prompt});return VS(n),this.lastChat=i,US(n)}static withClient(e,r){let i=new t(r);return i.client=e,i}}});var uV={};Cn(uV,{OpenAIAgentsSdkAdapter:()=>GS});function T9e(t){return[{name:"contract-runtime-guardrail",execute:async({input:e})=>{let r=typeof e=="string"?e:JSON.stringify(e),i=t.runChecks({command:r}),n=i.filter(a=>!a.passed&&a.action==="block");return{outputInfo:{results:i},tripwireTriggered:n.length>0}}}]}var GS,cV=st(()=>{"use strict";GS=class t{model;maxTurns;guardrailHooks;tools;agentName;signal;lastResponseId=null;lastAgent=null;AgentClass=null;runFn=null;constructor(e={}){this.model=e.model,this.maxTurns=e.maxTurns,this.guardrailHooks=e.guardrailHooks,this.tools=e.tools,this.agentName=e.agentName??"contract-agent",this.signal=e.signal}async resolveSdk(){if(this.AgentClass&&this.runFn)return{Agent:this.AgentClass,run:this.runFn};let e=await import("@openai/agents");return this.AgentClass=e.Agent,this.runFn=e.run,{Agent:this.AgentClass,run:this.runFn}}createAgent(e,r,i){let n={name:this.agentName,instructions:r};return this.model&&(n.model=this.model),this.tools&&(n.tools=this.tools),this.guardrailHooks&&(n.inputGuardrails=T9e(this.guardrailHooks)),new e(n)}buildRunOptions(e){let r={};return this.maxTurns!==void 0&&(r.maxTurns=this.maxTurns),this.signal&&(r.signal=this.signal),e&&(r.previousResponseId=e),r}extractOutput(e){if(typeof e.finalOutput=="string")return e.finalOutput;if(e.finalOutput!==void 0&&e.finalOutput!==null)return JSON.stringify(e.finalOutput,null,2);if(e.newItems){let r=[];for(let i of e.newItems)if(i.type==="message_output_item"||i.type==="text"){let n=i.rawItem;if(n?.content){let a=n.content;if(Array.isArray(a))for(let o of a)typeof o=="object"&&o!==null&&"text"in o&&r.push(o.text);else typeof a=="string"&&r.push(a)}}if(r.length>0)return r.join(`
425
- `)}return""}async send(e,r){this.lastResponseId=null,this.lastAgent=null;let{Agent:i,run:n}=await this.resolveSdk(),a=this.createAgent(i,e,r.readonly),o=this.buildRunOptions(),s=await n(a,e,o);return this.lastResponseId=s.lastResponseId??null,this.lastAgent=a,this.extractOutput(s)}async followUp(e){if(!this.lastResponseId)throw new Error("followUp() called before send() \u2014 no active session");let{run:r}=await this.resolveSdk(),i=this.lastAgent,n=this.buildRunOptions(this.lastResponseId),a=await r(i,e,n);return this.lastResponseId=a.lastResponseId??this.lastResponseId,this.extractOutput(a)}async sendExecution(e){this.lastResponseId=null,this.lastAgent=null;let{Agent:r,run:i}=await this.resolveSdk(),n=this.createAgent(r,e.prompt,e.options.readonly),a=this.buildRunOptions(),o=await i(n,e.prompt,a);return this.lastResponseId=o.lastResponseId??null,this.lastAgent=n,this.extractOutput(o)}static withRunFn(e,r,i){let n=new t(i);return n.AgentClass=e,n.runFn=r,n}}});import{existsSync as Lv,readFileSync as R9e,writeFileSync as dV}from"node:fs";import{resolve as Mv}from"node:path";import{register as D9e}from"tsx/esm/api";var g$=fn(h$(),1),{program:Z9e,createCommand:J9e,createArgument:Y9e,createOption:Q9e,CommanderError:X9e,InvalidArgumentError:e3e,InvalidOptionArgumentError:t3e,Command:v$,Argument:r3e,Option:n3e,Help:i3e}=g$.default;var y$=`cli_contracts: 0.1.0
423
+ `)});U4e=new RegExp(`\\{(${fv.join("|")})\\.[^}]+\\}`);oU=C.object({template:C.string(),context:dS,output:C.string(),include:C.array(C.string()).optional(),exclude:C.array(C.string()).optional(),skip_empty:C.boolean().optional()}).refine(t=>!(t.include&&t.exclude),{message:"include and exclude are mutually exclusive"}).refine(t=>!(t.context==="system"&&(t.include||t.exclude)),{message:"include/exclude cannot be used with context: system"}),Y4e=C.object({dsl:C.string().optional(),bindings:C.array(C.string()).default([]),vars:C.record(C.string(),C.string()).optional(),paths:C.record(C.string(),C.string()).optional(),active_guardrail_policy:C.string().optional(),interface_output:C.string().optional()}),Q4e=C.object({adapter:C.string().optional(),model:C.string().optional(),temperature:C.number().min(0).max(2).optional(),cache_dir:C.string().optional()}).optional(),X4e=C.object({exclude_patterns:C.array(C.string()).default([])}).optional(),sU=C.object({dsl:C.string().optional(),vars:C.record(C.string(),C.string()).optional(),renders:C.array(oU).default([]),bindings:C.array(C.string()).default([]),active_guardrail_policy:C.string().optional(),paths:C.record(C.string(),C.string()).optional(),teams:C.record(C.string(),Y4e).optional(),audit:Q4e,artifact_coverage:X4e}).superRefine((t,e)=>{if(t.dsl!==void 0&&t.teams!==void 0){e.addIssue({code:C.ZodIssueCode.custom,message:"dsl and teams are mutually exclusive",path:["teams"]});return}if(t.dsl===void 0&&t.teams===void 0){e.addIssue({code:C.ZodIssueCode.custom,message:"Either dsl or teams must be specified",path:[]});return}if(t.teams)for(let[r,i]of Object.entries(t.teams))r!=="_defaults"&&i.dsl===void 0&&e.addIssue({code:C.ZodIssueCode.custom,message:`Team "${r}" must specify dsl`,path:["teams",r,"dsl"]})}),e6e="agent-contracts.config.yaml",Ci=class extends Error{constructor(t,e){super(t),this.filePath=e,this.name="ConfigLoadError"}filePath};a6e={guardrail_impl:"map",outputs:"map",renders:"array",reporting:"object"};p6e={agents:{section:"agents",fields:["responsibilities","constraints","rules"]},tasks:{section:"tasks",fields:["description","responsibilities","execution_steps","completion_criteria"]},artifacts:{section:"artifacts",fields:["description","visibility"]},tools:{section:"tools",fields:["description","commands"]},workflow:{section:"workflow",fields:["description","trigger","entry_conditions"]},guardrails:{section:"guardrails",fields:["rationale","tags"]}};A6e={id:"dsl-auditor",role_name:"DSL Auditor",purpose:"Audit completeness of agent-contracts DSL definitions against generated agent prompts, detect gaps, and present improvement recommendations.",mode:"read-write",dispatch_only:!1,can_read_artifacts:["dsl-source","dsl-generated-output","dsl-audit-report","dsl-score-report"],can_write_artifacts:["dsl-audit-report"],can_execute_tools:["agent-contracts-cli"],can_invoke_agents:["dsl-auditor"],can_return_handoffs:["dsl-audit-result"],responsibilities:["Cross-check DSL definitions against generated prompts across 19 dimensions","Classify detected gaps as template gap, data gap, or DSL gap","Prioritize improvement recommendations (P0/P1/P2) with concrete fix proposals","Report score-based improvement areas as audit recommendations (read-only; consumes dsl-score-report produced by dsl-designer)","Review DSL design for semantic coherence (role overlap, scope breadth, gate placement)","Verify generated prompts faithfully represent DSL intent (no hallucinated permissions)","Audit x-* extension consumption across render templates and runtime codegen paths"],constraints:["Do not directly modify DSL definitions (read-only analysis)","Do not execute agent-contracts score independently; consume dsl-score-report produced by dsl-designer only","Recommendations must include concrete YAML or template fix proposals","Findings must be classified as PASS / MISS / PARTIAL / N/A"],rules:[{id:"R-AUDIT-001",description:"Audit must cover all 19 dimensions: purpose, mode, can_read_artifacts, can_write_artifacts, can_invoke_agents, tools, can_perform_validations, responsibilities, constraints, rules, escalation_criteria, x-authority, supported_tasks, delegatable_tasks, handoff_schemas, guardrails, anti_patterns, x-audit-checklist, x-sections.",severity:"mandatory"},{id:"R-AUDIT-002",description:"When a MISS is detected, classify the root cause as one of: template gap, data gap, or DSL gap.",severity:"mandatory"}],escalation_criteria:[{condition:"3 or more critical-level gaps detected",action:"stop_and_report"},{condition:"Structural defect detected in templates",action:"stop_and_report"}]},P6e={id:"dsl-designer",role_name:"DSL Designer",purpose:"Design, create, and update agent-contracts DSL definitions and bindings. Verify quality using validate, lint, render, and score commands. Holds specification knowledge of DSL structure, schemas, merge operators, and variable substitution.",mode:"read-write",dispatch_only:!1,can_read_artifacts:["dsl-source","dsl-generated-output","dsl-score-report","dsl-audit-report"],can_write_artifacts:["dsl-source","dsl-generated-output","dsl-score-report"],can_execute_tools:["agent-contracts-cli"],can_invoke_agents:["dsl-designer"],can_return_handoffs:["dsl-task-result"],responsibilities:["Create new and update existing agent-contracts DSL (YAML) definitions","Design all sections \u2014 agents, tasks, artifacts, tools, validations, handoff_types, workflow, policies, guardrails, guardrail_policies","Add and update software bindings","Correctly use extends-based DSL inheritance and merge operators","Verify quality via agent-contracts validate / lint / render / score","Improve score across 7 dimensions (artifact validation coverage, task validation coverage, guardrail policy coverage, workflow validation integration, schema completeness, cross-reference bidirectionality, guardrail scope resolution)"],constraints:["DSL definitions must pass agent-contracts validate","Do not break existing extends inheritance chains","Do not directly edit generated files \u2014 always modify DSL source and re-render","handoff_types schemas must be JSON Schema compliant with correct allOf $ref usage"],rules:[{id:"R-DSL-001",description:"After any DSL change, verify in order: validate \u2192 lint \u2192 render --check \u2192 score.",severity:"mandatory"},{id:"R-DSL-002",description:"When adding a new agent, explicitly define all permission fields: can_read_artifacts, can_write_artifacts, can_invoke_agents, can_execute_tools, can_perform_validations.",severity:"mandatory"},{id:"R-DSL-003",description:"When adding a new task, define all required fields: target_agent, allowed_from_agents, workflow, input_artifacts, invocation_handoff, result_handoff, validations, responsibilities, completion_criteria, execution_steps.",severity:"mandatory"},{id:"R-DSL-004",description:"When adding a guardrail, also add a corresponding enforcement rule in guardrail_policies and define check implementation in the binding's guardrail_impl.",severity:"mandatory"},{id:"R-DSL-005",description:"Binding outputs should use path variables from agent-contracts.config.yaml (e.g. {cursor_root}, {check_scripts_root}).",severity:"recommended"}],escalation_criteria:[{condition:"Schema errors from validate cannot be resolved",action:"stop_and_report"},{condition:"Unintended override occurring during extends merge",action:"stop_and_report"},{condition:"Score below 70% with no clear improvement path",action:"stop_and_report"}]},O6e={"dsl-auditor":A6e,"dsl-designer":P6e},I6e={id:"update-dsl-definitions",description:"Create new or update existing agent-contracts DSL definitions",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Create and update DSL YAML files","Define agents, tasks, artifacts, tools, validations, handoff_types, workflow, guardrails","Configure system section"],completion_criteria:["agent-contracts validate succeeds","agent-contracts lint reports no errors","Cross-references for newly added entities are correct"],optional:!1},C6e={id:"update-dsl-binding",description:"Create new or update existing software bindings",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Add and update guardrail_impl check definitions","Configure outputs section templates and inline templates","Set up binding extends inheritance"],completion_criteria:["Binding YAML conforms to the correct schema","guardrail_impl hook_event / matcher values are valid","agent-contracts generate guardrails succeeds"],optional:!1},j6e={id:"render-dsl-outputs",description:"Render prompts and documents from DSL and check for drift",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Generate prompts and documents via agent-contracts render","Detect and resolve drift using render --check"],completion_criteria:["render succeeds","render --check reports no drift"],optional:!1},T6e={id:"check-dsl-score",description:"Check DSL completeness score and identify improvement areas",target_agent:"dsl-designer",allowed_from_agents:["dsl-designer"],workflow:"dsl-update",invocation_handoff:"dsl-task-request",result_handoff:"dsl-task-result",input_artifacts:["dsl-source"],responsibilities:["Review score across 7 dimensions and identify weaknesses","List entities that need improvement"],completion_criteria:["Score results have been reviewed","Improvement areas have been identified"],optional:!1},R6e={id:"audit-dsl-completeness",description:"Audit completeness of DSL definitions against generated prompts",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source","dsl-generated-output"],responsibilities:["Cross-check across 19 dimensions per audit procedure","Classify gaps as template gap, data gap, or DSL gap","Present improvement recommendations"],completion_criteria:["All dimensions inspected for all agents","Detected gaps are classified","Improvement recommendations are presented with priority"],optional:!1},D6e={id:"audit-semantic-design",description:"Audit DSL design for semantic coherence",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source"],responsibilities:["Check dispatch_only agents for implementation responsibilities","Detect agents with overly broad scope","Identify role overlap between agents","Verify handoff schemas carry sufficient fields for task completion_criteria","Check workflow gates are placed effectively","Detect guardrails declared but absent from execution path","Check semantic validations are distributed across phases","Detect custom x- properties that replicate standard DSL control-flow features (gate, decision, entry_conditions)"],completion_criteria:["All agents reviewed for scope and overlap","Workflow gate placement analyzed","Guardrail enforcement path verified","Custom x- property misuse flagged","Findings classified with severity and category"],optional:!1},N6e={id:"audit-generated-prompts",description:"Audit generated prompts against DSL intent",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source","dsl-generated-output"],responsibilities:["Compare generated prompt content against DSL agent definitions","Detect missing requirements from DSL","Detect hallucinated permissions not in DSL","Identify ambiguous or unsafe instructions","Verify consistency between prompt and handoff schema expectations"],completion_criteria:["All generated prompts compared against DSL definitions","Missing, hallucinated, and ambiguous instructions identified","Findings classified with severity and category"],optional:!1},L6e={id:"audit-extension-consumption",description:"Audit declared x-* extensions for consumption gaps across render and runtime paths",target_agent:"dsl-auditor",allowed_from_agents:["dsl-auditor"],workflow:"dsl-audit",invocation_handoff:"dsl-task-request",result_handoff:"dsl-audit-result",input_artifacts:["dsl-source","dsl-generated-output"],responsibilities:["Cross-check extensions declarations against entity x-* usage","Identify x-* properties populated in DSL but not consumed by any render template","Detect semantic overlap between x-* extensions and standard DSL features","Report runtime codegen reachability for each extension","Distinguish intentional metadata-only extensions from consumption gaps"],completion_criteria:["All declared extensions checked for template and runtime consumption","Unused extensions flagged with suggested action (remove, migrate to standard, or add template support)","Runtime-unreachable extensions documented with explanation","Findings classified with severity and category"],optional:!1},M6e={"update-dsl-definitions":I6e,"update-dsl-binding":C6e,"render-dsl-outputs":j6e,"check-dsl-score":T6e,"audit-dsl-completeness":R6e,"audit-semantic-design":D6e,"audit-generated-prompts":N6e,"audit-extension-consumption":L6e},z6e=C.object({task_id:C.string(),scope:C.string().optional(),context:C.string().optional()}),q6e=C.object({changed_files:C.array(C.string()).optional(),validation_result:C.enum(["pass","fail"]),lint_result:C.enum(["pass","fail","skipped"]).optional(),generate_result:C.enum(["pass","fail","skipped"]).optional(),render_result:C.enum(["pass","fail","skipped"]).optional(),drift_detected:C.boolean().optional(),cross_reference_check:C.enum(["pass","fail","skipped"]).optional(),score:C.number().optional(),score_dimensions:C.record(C.string(),C.unknown()).optional(),notes:C.string().optional()}),F6e=C.object({summary:C.string(),risk_level:C.enum(["low","medium","high","critical"]),findings:C.array(C.object({id:C.string().optional(),severity:C.enum(["info","warning","error","critical"]),category:C.string(),target:C.string().optional(),location:C.string().optional(),message:C.string(),recommendation:C.string().optional(),confidence:C.number().optional(),evidence:C.array(C.object({kind:C.enum(["file","command","schema","diff","stdout","stderr","text"]),target:C.string().optional(),location:C.string().optional(),excerpt:C.string().optional()})).optional(),details:C.record(C.string(),C.unknown()).optional()})),recommended_actions:C.array(C.object({kind:C.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:C.string(),command:C.string().optional(),target:C.string().optional(),rationale:C.string().optional()})).optional(),metadata:C.object({tool:C.string().optional(),command:C.string().optional(),version:C.string().optional(),generated_at:C.string().optional(),adapter:C.string().optional(),model:C.string().optional()}).optional()}),U6e=C.object({audit_type:C.enum(["completeness","semantic","prompt","extensions"]),total_dimensions:C.number(),pass_count:C.number(),miss_count:C.number(),partial_count:C.number().optional(),agents_reviewed:C.number().optional(),prompts_reviewed:C.number().optional(),gate_analysis_complete:C.boolean().optional(),guardrail_enforcement_verified:C.boolean().optional(),critical_gaps:C.array(C.object({dimension:C.string().optional(),agent:C.string().optional(),gap_type:C.enum(["template_gap","data_gap","dsl_gap"]).optional(),severity:C.enum(["critical","warning","info"]).optional()})).optional(),recommendations:C.array(C.object({priority:C.enum(["P0","P1","P2"]).optional(),description:C.string().optional(),fix_type:C.enum(["template_fix","dsl_fix","regeneration"]).optional()})).optional()}),V6e={"dsl-task-request":z6e,"dsl-task-result":q6e,"audit-result":F6e,"dsl-audit-result":U6e};G6e={render:"audit-dsl-completeness",dsl:"audit-semantic-design",prompt:"audit-generated-prompts",extensions:"audit-extension-consumption"};bs.default.registerHelper("json",t=>new bs.default.SafeString(JSON.stringify(t,null,2)));bs.default.registerHelper("expand",(t,e)=>{if(typeof t!="string")return"";let r=e.hash,i=t;for(let[n,a]of Object.entries(r))i=i.replace(new RegExp(`\\{\\{${n}\\}\\}`,"g"),String(a));return new bs.default.SafeString(i)});i_e=new Set(["node_modules",".git","dist",".next","coverage"]);});var FU={};Cn(FU,{createModelResolver:()=>qU});function zU(t,e){let r=t.indexOf(":");if(r===-1)return{adapter:e,model:t||void 0};let i=t.slice(0,r)||e,n=t.slice(r+1)||void 0;return{adapter:i,model:n}}function qU(t){let e=t.env??process.env;return{resolve(r){let i={adapter:t.fallbackAdapter,model:t.fallbackModel};if(!r)return i;let n=e[C_e[r]];if(n)return zU(n,t.fallbackAdapter);let a=e[Pv];if(a)return zU(a,t.fallbackAdapter);let o=t.modelMapping?.[r];return o?{adapter:o.adapter,model:o.model}:i}}}var Pv,C_e,RS=st(()=>{"use strict";Pv="AGENT_RUNTIME_MODEL",C_e={fast:`${Pv}_FAST`,standard:`${Pv}_STANDARD`,thinking:`${Pv}_THINKING`}});var Cv={};Cn(Cv,{ClaudeAgentSdkAdapter:()=>NS});function h9e(t){return{PreToolUse:[{hooks:[r=>{let i=r.tool_input,n=r.tool_name;if(n==="Bash"||n==="Shell"){let o=i?.command??i?.input;if(o){let s=t.beforeShellExecution({command:o});if(s.permission==="deny")return{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:s.user_message??s.agent_message};if(s.additionalContext)return{hookEventName:"PreToolUse",additionalContext:s.additionalContext}}}let a=i?.file_path??i?.path;if(a){let o=t.preToolUse({tool_name:n,tool_input:{file_path:a}});if(o.permission==="deny")return{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:o.user_message??o.agent_message};if(o.additionalContext)return{hookEventName:"PreToolUse",additionalContext:o.additionalContext}}return{hookEventName:"PreToolUse"}}]}]}}function g9e(t,e,r){let i=t.session_id??r;switch(t.type){case"assistant":{let n=t.message?.content;if(!n)break;for(let a of n)if(a.type==="tool_use"&&a.name){let o=a.input&&typeof a.input=="object"?a.input:void 0;e({type:"tool_use",tool_name:a.name,input:o,session_id:i})}else a.type==="text"&&a.text&&e({type:"text",message:a.text,session_id:i});break}case"tool_progress":t.tool_name&&e({type:"tool_use",tool_name:t.tool_name,session_id:i});break;case"tool_use_summary":t.summary&&e({type:"status",message:t.summary,session_id:i});break;default:break}}var NS,jv=st(()=>{"use strict";NS=class t{cwd;model;tools;permissionMode;maxTurns;guardrailHooks;lastSessionId=null;queryFn=null;constructor(e={}){this.cwd=e.cwd??process.cwd(),this.model=e.model,this.tools=e.tools,this.permissionMode=e.permissionMode??"bypassPermissions",this.maxTurns=e.maxTurns,this.guardrailHooks=e.guardrailHooks}async resolveQueryFn(){if(this.queryFn)return this.queryFn;let e=await import("@anthropic-ai/claude-agent-sdk");return this.queryFn=e.query,this.queryFn}buildOptions(e,r){let i={cwd:this.cwd,permissionMode:this.permissionMode,allowDangerouslySkipPermissions:this.permissionMode==="bypassPermissions"};return this.model&&(i.model=this.model),this.maxTurns&&(i.maxTurns=this.maxTurns),this.tools?i.tools=this.tools:i.tools=e?["Read","Glob","Grep"]:["Read","Glob","Grep","Edit","Write","Bash"],r&&(i.resume=r),this.guardrailHooks&&(i.hooks=h9e(this.guardrailHooks)),i}async runQuery(e,r,i){let a=(await this.resolveQueryFn())({prompt:e,options:r}),o="",s="";for await(let l of a)if(l.session_id&&(s=l.session_id),l.type==="result"){if(l.subtype==="success")o=l.result;else if(l.subtype==="error")throw new Error(`Claude Agent SDK error: ${l.error}`)}else i&&g9e(l,i,s);return{text:o,sessionId:s}}async send(e,r){this.lastSessionId=null;let i=this.buildOptions(r.readonly),{text:n,sessionId:a}=await this.runQuery(e,i,r.onProgress);return this.lastSessionId=a,n}async followUp(e){if(!this.lastSessionId)throw new Error("followUp() called before send() \u2014 no active session");let r=this.buildOptions(!1,this.lastSessionId),{text:i,sessionId:n}=await this.runQuery(e,r);return this.lastSessionId=n,i}async sendExecution(e){this.lastSessionId=null;let r=this.buildOptions(e.options.readonly),{text:i,sessionId:n}=await this.runQuery(e.prompt,r,e.options.onProgress);return this.lastSessionId=n,i}static withQueryFn(e,r){let i=new t(r);return i.queryFn=e,i}}});var Tv={};Cn(Tv,{CursorSdkAdapter:()=>MS});function v9e(t){return{beforeShellExecution:e=>{let r=t.beforeShellExecution(e);return LS(r,"beforeShellExecution",e.command)},preToolUse:e=>{let r=t.preToolUse(e),i=e.tool_input?.file_path??e.tool_input?.path??e.tool_name;return LS(r,"preToolUse",i)},afterFileEdit:e=>{let r=t.afterFileEdit(e);return LS(r,"afterFileEdit",e.file_path)}}}function LS(t,e,r){return t.permission==="deny"?(process.stderr.write(`[guardrail:deny] ${e}: ${r??"(unknown)"} \u2014 ${t.user_message??"no reason"}
424
+ `),{permissionDecision:"deny",userMessage:t.user_message,agentMessage:t.agent_message}):t.additionalContext?{additionalContext:t.additionalContext}:{}}var MS,Rv=st(()=>{"use strict";MS=class t{agent;constructor(e){this.agent=e}async collectStream(e){let r="";for await(let i of e.stream())if(i.type==="assistant"&&i.message?.content)for(let n of i.message.content)n.type==="text"&&n.text&&(r+=n.text);return r}async send(e,r){let i=await this.agent.send(e);return this.collectStream(i)}async followUp(e){let r=await this.agent.send(e);return this.collectStream(r)}static async create(e){let{Agent:r}=await import("@cursor/sdk"),i={model:{id:e.model??"composer-2"},local:{cwd:e.cwd??process.cwd()}};e.apiKey&&(i.apiKey=e.apiKey),e.guardrailHooks&&Object.assign(i,v9e(e.guardrailHooks));let n=await r.create(i);return new t(n)}}});var Dv={};Cn(Dv,{MockAdapter:()=>zS});var zS,Nv=st(()=>{"use strict";zS=class{responses;defaultLatencyMs;constructor(e){this.responses=e?.responses??{},this.defaultLatencyMs=e?.defaultLatencyMs??0}async send(e,r){let n=e.match(/## Task: (\S+)/)?.[1]??"unknown",o=e.match(/## User Request\n\n([\s\S]*?)(?:\n\n---|$)/)?.[1]?.trim()??"";this.defaultLatencyMs>0&&await new Promise(l=>setTimeout(l,this.defaultLatencyMs));let s=this.responses[n];return s?s(o):`Task "${n}" completed but no structured output available.`}}});var sV={};Cn(sV,{GeminiSdkAdapter:()=>BS});function US(t){if(t.text)return t.text;if(t.candidates?.length){let e=t.candidates[0].content?.parts;if(e?.length)return e.map(r=>r.text??"").join("")}return""}function VS(t){let e=t.candidates?.[0];if(e?.finishReason==="SAFETY"){let r=e.safetyRatings?.filter(i=>i.probability==="HIGH").map(i=>i.category).join(", ");throw new Error(`Gemini response blocked by safety filters: ${r||"unknown category"}`)}}var BS,lV=st(()=>{"use strict";BS=class t{apiKey;model;systemInstruction;temperature;maxOutputTokens;guardrailHooks;lastChat=null;client=null;ClientClass=null;constructor(e={}){this.apiKey=e.apiKey,this.model=e.model??"gemini-2.5-flash",this.systemInstruction=e.systemInstruction,this.temperature=e.temperature,this.maxOutputTokens=e.maxOutputTokens,this.guardrailHooks=e.guardrailHooks}async resolveClient(){if(this.client)return this.client;if(!this.ClientClass){let r=await import("@google/genai");this.ClientClass=r.GoogleGenAI}let e=this.apiKey??process.env.GEMINI_API_KEY;if(!e)throw new Error("GEMINI_API_KEY environment variable or apiKey config is required for the Gemini adapter");return this.client=new this.ClientClass({apiKey:e}),this.client}buildGenerationConfig(){let e={};return this.systemInstruction&&(e.systemInstruction=this.systemInstruction),this.temperature!==void 0&&(e.temperature=this.temperature),this.maxOutputTokens!==void 0&&(e.maxOutputTokens=this.maxOutputTokens),e}createChat(e){return e.chats.create({model:this.model,config:this.buildGenerationConfig()})}async send(e,r){this.lastChat=null;let i=await this.resolveClient(),n=this.createChat(i),a=await n.sendMessage({message:e});return VS(a),this.lastChat=n,US(a)}async followUp(e){if(!this.lastChat)throw new Error("followUp() called before send() \u2014 no active session");let r=await this.lastChat.sendMessage({message:e});return VS(r),US(r)}async sendExecution(e){this.lastChat=null;let r=await this.resolveClient(),i=this.createChat(r),n=await i.sendMessage({message:e.prompt});return VS(n),this.lastChat=i,US(n)}static withClient(e,r){let i=new t(r);return i.client=e,i}}});var uV={};Cn(uV,{OpenAIAgentsSdkAdapter:()=>GS});function N9e(t){return[{name:"contract-runtime-guardrail",execute:async({input:e})=>{let r=typeof e=="string"?e:JSON.stringify(e),i=t.runChecks({command:r}),n=i.filter(a=>!a.passed&&a.action==="block");return{outputInfo:{results:i},tripwireTriggered:n.length>0}}}]}var GS,cV=st(()=>{"use strict";GS=class t{model;maxTurns;guardrailHooks;tools;agentName;signal;lastResponseId=null;lastAgent=null;AgentClass=null;runFn=null;constructor(e={}){this.model=e.model,this.maxTurns=e.maxTurns,this.guardrailHooks=e.guardrailHooks,this.tools=e.tools,this.agentName=e.agentName??"contract-agent",this.signal=e.signal}async resolveSdk(){if(this.AgentClass&&this.runFn)return{Agent:this.AgentClass,run:this.runFn};let e=await import("@openai/agents");return this.AgentClass=e.Agent,this.runFn=e.run,{Agent:this.AgentClass,run:this.runFn}}createAgent(e,r,i){let n={name:this.agentName,instructions:r};return this.model&&(n.model=this.model),this.tools&&(n.tools=this.tools),this.guardrailHooks&&(n.inputGuardrails=N9e(this.guardrailHooks)),new e(n)}buildRunOptions(e){let r={};return this.maxTurns!==void 0&&(r.maxTurns=this.maxTurns),this.signal&&(r.signal=this.signal),e&&(r.previousResponseId=e),r}extractOutput(e){if(typeof e.finalOutput=="string")return e.finalOutput;if(e.finalOutput!==void 0&&e.finalOutput!==null)return JSON.stringify(e.finalOutput,null,2);if(e.newItems){let r=[];for(let i of e.newItems)if(i.type==="message_output_item"||i.type==="text"){let n=i.rawItem;if(n?.content){let a=n.content;if(Array.isArray(a))for(let o of a)typeof o=="object"&&o!==null&&"text"in o&&r.push(o.text);else typeof a=="string"&&r.push(a)}}if(r.length>0)return r.join(`
425
+ `)}return""}async send(e,r){this.lastResponseId=null,this.lastAgent=null;let{Agent:i,run:n}=await this.resolveSdk(),a=this.createAgent(i,e,r.readonly),o=this.buildRunOptions(),s=await n(a,e,o);return this.lastResponseId=s.lastResponseId??null,this.lastAgent=a,this.extractOutput(s)}async followUp(e){if(!this.lastResponseId)throw new Error("followUp() called before send() \u2014 no active session");let{run:r}=await this.resolveSdk(),i=this.lastAgent,n=this.buildRunOptions(this.lastResponseId),a=await r(i,e,n);return this.lastResponseId=a.lastResponseId??this.lastResponseId,this.extractOutput(a)}async sendExecution(e){this.lastResponseId=null,this.lastAgent=null;let{Agent:r,run:i}=await this.resolveSdk(),n=this.createAgent(r,e.prompt,e.options.readonly),a=this.buildRunOptions(),o=await i(n,e.prompt,a);return this.lastResponseId=o.lastResponseId??null,this.lastAgent=n,this.extractOutput(o)}static withRunFn(e,r,i){let n=new t(i);return n.AgentClass=e,n.runFn=r,n}}});import{existsSync as Lv,readFileSync as L9e,writeFileSync as dV}from"node:fs";import{resolve as Mv}from"node:path";import{register as M9e}from"tsx/esm/api";var g$=fn(h$(),1),{program:Q9e,createCommand:X9e,createArgument:e3e,createOption:t3e,CommanderError:r3e,InvalidArgumentError:n3e,InvalidOptionArgumentError:i3e,Command:v$,Argument:a3e,Option:o3e,Help:s3e}=g$.default;var y$=`cli_contracts: 0.1.0
426
426
 
427
427
  info:
428
428
  title: agent-runtime CLI
@@ -2943,19 +2943,21 @@ Example:
2943
2943
  ${l}
2944
2944
  \`\`\``)}else o+=" Include all required fields.";return i.push(o),i.join(`
2945
2945
 
2946
- `)}function h_e(t,e){return t.status==="validation_error"?"follow_up":t.status==="error"&&t.message==="Agent returned empty output"?"retry":"abort"}function g_e(t,e){switch(t.type){case"tool_use":return` \u27E1 [${e}] ${t.tool_name??"tool"}${t.message?` ${t.message}`:""}
2947
- `;case"tool_result":return"";case"text":return"";case"status":return t.message?` \u25CF [${e}] ${t.message}
2948
- `:"";default:return""}}async function TS(t,e,r,i){let n=i?.taskRegistry??{},a=i?.agentRegistry??{},o=i?.handoffSchemas??{},s=n[e];if(!s)return{outcome:{status:"error",message:`Unknown task: ${e}`},follow_ups_used:0,retries_used:0};let l=a[s.target_agent];if(!l)return{outcome:{status:"error",message:`Unknown agent: ${s.target_agent}`},follow_ups_used:0,retries_used:0};let u=await _n.runBeforeTask(e,r);if(u===null)return{outcome:{status:"error",message:`Task "${e}" skipped by plugin`},follow_ups_used:0,retries_used:0};let c=_n.applyContextEnhancers(e,u),d={handoffSchemas:o,retry:i?.retry},f={agent:l,task:s,context:c,options:d},h=_n.applyPromptBuilder(f)??Ba(l,s,c,d);h=_n.applyPromptEnhancers(e,h,c);let g=l.mode==="read-only",v=i?.maxFollowUps??2,y=i?.maxRetries??0,w=i?.decideRetryStrategy??h_e,$=i?.progressOutput?T=>{let O=g_e(T,e);O&&i.progressOutput.write(O)}:void 0,E=0,I=0,R;try{t.sendExecution?R=await t.sendExecution({agentId:l.id,taskId:e,prompt:h,handoff:o[s.result_handoff]?{type:s.result_handoff,payload:void 0}:void 0,schema:o[s.result_handoff]?{handoffType:s.result_handoff,zodSchema:o[s.result_handoff],promptDescription:Ev(o[s.result_handoff])}:void 0,context:c,options:{readonly:g,onProgress:$,maxFollowUps:v,attempt:0}}):R=await t.send(h,{readonly:g,onProgress:$})}catch(T){return{outcome:{status:"error",message:`SDK error: ${T.message}`},follow_ups_used:0,retries_used:0}}let M=PU(R,s,o);for(M=await _n.runAfterTask(e,M);M.status==="validation_error"||M.status==="error";){let T=await w(M,{followUps:E,retries:I});if(T==="abort")break;let O=T;if(O==="follow_up"&&E>=v&&(O="retry"),O==="retry"&&I>=y)break;if(O==="follow_up"){E++;let N=CU(s,M,d);try{if(t.followUp)R=await t.followUp(N);else{let j={...u,prior_context:(u.prior_context??"")+`
2946
+ `)}function h_e(t,e){return t.status==="validation_error"?"follow_up":t.status==="error"&&t.message==="Agent returned empty output"?"retry":"abort"}function g_e(t){if(!t)return"";let e=t.file_path??t.path??t.filename??t.file;if(typeof e=="string")return` \u2014 ${e}`;let r=t.command??t.cmd;if(typeof r=="string")return` \u2014 ${r.length>80?r.slice(0,77)+"...":r}`;let i=t.query??t.search??t.pattern;return typeof i=="string"?` \u2014 "${i}"`:""}function v_e(){return new Date().toISOString()}function y_e(t,e,r){let i=v_e(),n=t.session_id?t.session_id.slice(0,8):"-";return`[${i},${n},${r??"-"},${e}]`}function __e(t,e,r){let i=y_e(t,e,r);switch(t.type){case"tool_use":return`${i} \u2699 ${t.tool_name??"tool"}${g_e(t.input)}
2947
+ `;case"tool_result":return"";case"text":{if(!t.message)return"";let n=t.message.trim();if(!n)return"";let a=n.split(`
2948
+ `)[0],o=a.length>120?a.slice(0,117)+"...":a;return`${i} \u{1F4AD} ${o}
2949
+ `}case"status":return t.message?`${i} \u25CF ${t.message}
2950
+ `:"";default:return""}}async function TS(t,e,r,i){let n=i?.taskRegistry??{},a=i?.agentRegistry??{},o=i?.handoffSchemas??{},s=n[e];if(!s)return{outcome:{status:"error",message:`Unknown task: ${e}`},follow_ups_used:0,retries_used:0};let l=a[s.target_agent];if(!l)return{outcome:{status:"error",message:`Unknown agent: ${s.target_agent}`},follow_ups_used:0,retries_used:0};let u=await _n.runBeforeTask(e,r);if(u===null)return{outcome:{status:"error",message:`Task "${e}" skipped by plugin`},follow_ups_used:0,retries_used:0};let c=_n.applyContextEnhancers(e,u),d={handoffSchemas:o,retry:i?.retry},f={agent:l,task:s,context:c,options:d},h=_n.applyPromptBuilder(f)??Ba(l,s,c,d);h=_n.applyPromptEnhancers(e,h,c);let g=l.mode==="read-only",v=i?.maxFollowUps??2,y=i?.maxRetries??0,w=i?.decideRetryStrategy??h_e,$=i?.progressOutput?T=>{let O=__e(T,e,l.id);O&&i.progressOutput.write(O)}:void 0,E=0,I=0,R;try{t.sendExecution?R=await t.sendExecution({agentId:l.id,taskId:e,prompt:h,handoff:o[s.result_handoff]?{type:s.result_handoff,payload:void 0}:void 0,schema:o[s.result_handoff]?{handoffType:s.result_handoff,zodSchema:o[s.result_handoff],promptDescription:Ev(o[s.result_handoff])}:void 0,context:c,options:{readonly:g,onProgress:$,maxFollowUps:v,attempt:0}}):R=await t.send(h,{readonly:g,onProgress:$})}catch(T){return{outcome:{status:"error",message:`SDK error: ${T.message}`},follow_ups_used:0,retries_used:0}}let M=PU(R,s,o);for(M=await _n.runAfterTask(e,M);M.status==="validation_error"||M.status==="error";){let T=await w(M,{followUps:E,retries:I});if(T==="abort")break;let O=T;if(O==="follow_up"&&E>=v&&(O="retry"),O==="retry"&&I>=y)break;if(O==="follow_up"){E++;let N=CU(s,M,d);try{if(t.followUp)R=await t.followUp(N);else{let j={...u,prior_context:(u.prior_context??"")+`
2949
2951
 
2950
2952
  --- FollowUp ${E} ---
2951
2953
  ${N}`},x=Ba(l,s,j,d);x=_n.applyPromptEnhancers(e,x,j),R=await t.send(x,{readonly:g})}}catch(j){M={status:"error",message:`SDK error on followUp ${E}: ${j.message}`};continue}}else{I++;let N={...u,prior_context:(u.prior_context??"")+`
2952
2954
 
2953
2955
  --- Full Retry ${I} ---
2954
2956
  Previous attempt failed: `+(M.status==="validation_error"?`Validation errors: ${M.errors.message}`:M.status==="error"?M.message:"unknown")+`
2955
- Please re-execute the entire task.`},j=Ba(l,s,N);j=_n.applyPromptEnhancers(e,j,N);try{R=await t.send(j,{readonly:g})}catch(x){M={status:"error",message:`SDK error on retry ${I}: ${x.message}`};continue}}M=PU(R,s,o),M=await _n.runAfterTask(e,M)}return{outcome:M,follow_ups_used:E,retries_used:I}}function v_e(t){return typeof t=="function"&&!("send"in t)}function y_e(t){if(v_e(t)){let e=t();if(e&&typeof e.then=="function")throw new Error("ModelAwareSdkAdapterFactory returned a Promise for the default adapter. Use a synchronous factory or pre-resolve the default adapter.");return{adapter:e,factory:t}}return{adapter:t,factory:void 0}}function __e(t){let e;if(t.handoff){let n=t.handoff;e=t.user_request?t.user_request:typeof n.payload=="string"?n.payload:JSON.stringify(n.payload,null,2)}else e=t.user_request??"";let r=t.context,i={...r?.variables};return r?.cwd&&(i.cwd=r.cwd),r?.environment&&(i.environment=r.environment),r?.artifacts&&(i.artifacts=r.artifacts),{workflowId:t.workflow,options:{user_request:e,maxFollowUps:t.runtime?.maxFollowUps,maxRetries:t.runtime?.maxRetries,variables:Object.keys(i).length>0?i:void 0,onGate:t.hooks?.onGate,onStepComplete:t.hooks?.onStepComplete,onOptionalStep:t.hooks?.onOptionalStep,progressOutput:t.progressOutput}}}async function xo(t,e,r,i){let{adapter:n,factory:a}=y_e(t),o,s,l,u;if(typeof e=="string")o=e,s=r,l=i;else{let M=__e(e);o=M.workflowId,s=M.options,l=r,u=e.handoff}if(u&&l?.handoffSchemas){let M=l.handoffSchemas[u.type];if(M){let T=M.safeParse(u.payload);if(!T.success)return{workflow_id:o,status:"error",steps:[],total_elapsed_ms:0,error_message:`Input handoff validation failed for "${u.type}": ${T.error.message}`}}}let d=(l?.workflowRegistry??{})[o];if(!d)return{workflow_id:o,status:"error",steps:[],total_elapsed_ms:0,error_message:`Unknown workflow: ${o}`};await _n.runBeforeWorkflow(o,s.user_request);let f=Date.now(),h=M=>{let T=d.steps[M];return T.type==="delegate"?T.task:`gate:${T.gate_kind}`},g=d.steps.map((M,T)=>M.depends_on!==void 0?M.depends_on.map(O=>{let N=d.steps.findIndex((j,x)=>x<T&&h(x)===O);if(N===-1)throw new Error(`depends_on "${O}" in step ${T} (${h(T)}) not found among preceding steps`);return N}):T===0?[]:Array.from({length:T},(O,N)=>N)),v=new Set,y=new Array(d.steps.length),w=new Array(d.steps.length).fill(""),$;function E(M){let T=g[M];return T.length===0?"":T.filter(O=>v.has(O)).map(O=>w[O]).filter(Boolean).join("")}async function I(M,T){let O=d.steps[M],N=Date.now();if(O.type==="gate")return w_e(O,Object.values(y).filter(Boolean),s,M,T);if(O.optional){let b={user_request:s.user_request,prior_context:E(M),variables:s.variables};if(!(s.onOptionalStep?await s.onOptionalStep(O,b):!1))return{step_index:M,task_id:O.task,outcome:{status:"skipped"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-N}}let j={user_request:s.user_request,prior_context:E(M),variables:s.variables,...u?{handoff_input:u}:{}},x=await TS(T,O.task,j,{maxFollowUps:s.maxFollowUps??O.max_follow_ups??2,maxRetries:s.maxRetries??O.max_retries??0,taskRegistry:l?.taskRegistry,agentRegistry:l?.agentRegistry,handoffSchemas:l?.handoffSchemas,retry:O.retry,progressOutput:s.progressOutput});return{step_index:M,task_id:O.task,outcome:x.outcome,follow_ups_used:x.follow_ups_used,retries_used:x.retries_used,elapsed_ms:Date.now()-N}}for(;v.size<d.steps.length;){let M=[];for(let O=0;O<d.steps.length;O++)v.has(O)||g[O].every(N=>v.has(N))&&M.push(O);if(M.length===0){$={workflow_id:d.id,status:"error",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f,error_message:"Dependency cycle detected: no steps are ready to execute"};break}let T=await Promise.all(M.map(async O=>{let N=d.steps[O],j=N.type==="delegate"?l?.taskRegistry?.[N.task]?.model_class:void 0,x;if(M.length>1&&a){let b=a(j);x=b&&typeof b.then=="function"?await b:b}else if(j&&a){let b=a(j);x=b&&typeof b.then=="function"?await b:b}else x=n;return I(O,x)}));for(let O=0;O<M.length;O++){let N=M[O],j=T[O],x=d.steps[N];if(y[N]=j,v.add(N),S_e(s,d.id,N,x,j),j.outcome.status==="success"){let b=j.outcome.data;w[N]=`
2957
+ Please re-execute the entire task.`},j=Ba(l,s,N);j=_n.applyPromptEnhancers(e,j,N);try{R=await t.send(j,{readonly:g})}catch(x){M={status:"error",message:`SDK error on retry ${I}: ${x.message}`};continue}}M=PU(R,s,o),M=await _n.runAfterTask(e,M)}return{outcome:M,follow_ups_used:E,retries_used:I}}function w_e(t){return typeof t=="function"&&!("send"in t)}function b_e(t){if(w_e(t)){let e=t();if(e&&typeof e.then=="function")throw new Error("ModelAwareSdkAdapterFactory returned a Promise for the default adapter. Use a synchronous factory or pre-resolve the default adapter.");return{adapter:e,factory:t}}return{adapter:t,factory:void 0}}function S_e(t){let e;if(t.handoff){let n=t.handoff;e=t.user_request?t.user_request:typeof n.payload=="string"?n.payload:JSON.stringify(n.payload,null,2)}else e=t.user_request??"";let r=t.context,i={...r?.variables};return r?.cwd&&(i.cwd=r.cwd),r?.environment&&(i.environment=r.environment),r?.artifacts&&(i.artifacts=r.artifacts),{workflowId:t.workflow,options:{user_request:e,maxFollowUps:t.runtime?.maxFollowUps,maxRetries:t.runtime?.maxRetries,variables:Object.keys(i).length>0?i:void 0,onGate:t.hooks?.onGate,onStepComplete:t.hooks?.onStepComplete,onOptionalStep:t.hooks?.onOptionalStep,progressOutput:t.progressOutput}}}async function xo(t,e,r,i){let{adapter:n,factory:a}=b_e(t),o,s,l,u;if(typeof e=="string")o=e,s=r,l=i;else{let M=S_e(e);o=M.workflowId,s=M.options,l=r,u=e.handoff}if(u&&l?.handoffSchemas){let M=l.handoffSchemas[u.type];if(M){let T=M.safeParse(u.payload);if(!T.success)return{workflow_id:o,status:"error",steps:[],total_elapsed_ms:0,error_message:`Input handoff validation failed for "${u.type}": ${T.error.message}`}}}let d=(l?.workflowRegistry??{})[o];if(!d)return{workflow_id:o,status:"error",steps:[],total_elapsed_ms:0,error_message:`Unknown workflow: ${o}`};await _n.runBeforeWorkflow(o,s.user_request);let f=Date.now(),h=M=>{let T=d.steps[M];return T.type==="delegate"?T.task:`gate:${T.gate_kind}`},g=d.steps.map((M,T)=>M.depends_on!==void 0?M.depends_on.map(O=>{let N=d.steps.findIndex((j,x)=>x<T&&h(x)===O);if(N===-1)throw new Error(`depends_on "${O}" in step ${T} (${h(T)}) not found among preceding steps`);return N}):T===0?[]:Array.from({length:T},(O,N)=>N)),v=new Set,y=new Array(d.steps.length),w=new Array(d.steps.length).fill(""),$;function E(M){let T=g[M];return T.length===0?"":T.filter(O=>v.has(O)).map(O=>w[O]).filter(Boolean).join("")}async function I(M,T){let O=d.steps[M],N=Date.now();if(O.type==="gate")return k_e(O,Object.values(y).filter(Boolean),s,M,T);if(O.optional){let b={user_request:s.user_request,prior_context:E(M),variables:s.variables};if(!(s.onOptionalStep?await s.onOptionalStep(O,b):!1))return{step_index:M,task_id:O.task,outcome:{status:"skipped"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-N}}let j={user_request:s.user_request,prior_context:E(M),variables:s.variables,...u?{handoff_input:u}:{}},x=await TS(T,O.task,j,{maxFollowUps:s.maxFollowUps??O.max_follow_ups??2,maxRetries:s.maxRetries??O.max_retries??0,taskRegistry:l?.taskRegistry,agentRegistry:l?.agentRegistry,handoffSchemas:l?.handoffSchemas,retry:O.retry,progressOutput:s.progressOutput});return{step_index:M,task_id:O.task,outcome:x.outcome,follow_ups_used:x.follow_ups_used,retries_used:x.retries_used,elapsed_ms:Date.now()-N}}for(;v.size<d.steps.length;){let M=[];for(let O=0;O<d.steps.length;O++)v.has(O)||g[O].every(N=>v.has(N))&&M.push(O);if(M.length===0){$={workflow_id:d.id,status:"error",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f,error_message:"Dependency cycle detected: no steps are ready to execute"};break}let T=await Promise.all(M.map(async O=>{let N=d.steps[O],j=N.type==="delegate"?l?.taskRegistry?.[N.task]?.model_class:void 0,x;if(M.length>1&&a){let b=a(j);x=b&&typeof b.then=="function"?await b:b}else if(j&&a){let b=a(j);x=b&&typeof b.then=="function"?await b:b}else x=n;return I(O,x)}));for(let O=0;O<M.length;O++){let N=M[O],j=T[O],x=d.steps[N];if(y[N]=j,v.add(N),$_e(s,d.id,N,x,j),j.outcome.status==="success"){let b=j.outcome.data;w[N]=`
2956
2958
 
2957
2959
  --- Step ${N+1}: ${h(N)} ---
2958
- `+(typeof b=="string"?b:JSON.stringify(b,null,2))}if(j.outcome.status==="gate_rejected")$={workflow_id:d.id,status:"gate_rejected",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f};else if(j.outcome.status==="escalation")$={workflow_id:d.id,status:"escalated",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f,escalation_reason:j.outcome.reason};else if(j.outcome.status==="error"||j.outcome.status==="validation_error"){let b=x.type==="delegate"?x.task:x.gate_kind;$={workflow_id:d.id,status:"escalated",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f,escalation_reason:`Task "${b}" failed after ${j.follow_ups_used} follow-ups and ${j.retries_used} retries`}}}if($)break}let R=$??{workflow_id:d.id,status:"completed",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f};return await _n.runAfterWorkflow(d.id,R),R}async function w_e(t,e,r,i,n){let a=Date.now();if(r.onGate){let o=await r.onGate(t.gate_kind,t.description,e);return{step_index:i,gate_kind:t.gate_kind,outcome:{status:o?"gate_approved":"gate_rejected"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-a}}if(n&&t.description){let o=await b_e(n,t,e);return{step_index:i,gate_kind:t.gate_kind,outcome:{status:o?"gate_approved":"gate_rejected"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-a}}return{step_index:i,gate_kind:t.gate_kind,outcome:{status:"gate_approved"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-a}}async function b_e(t,e,r){let i=r.map(a=>{let o=a.task_id??a.gate_kind??`step_${a.step_index}`,s="data"in a.outcome?a.outcome.data:void 0;return`- ${o}: status=${a.outcome.status}${s?`, data=${typeof s=="string"?s:JSON.stringify(s)}`:""}`}).join(`
2960
+ `+(typeof b=="string"?b:JSON.stringify(b,null,2))}if(j.outcome.status==="gate_rejected")$={workflow_id:d.id,status:"gate_rejected",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f};else if(j.outcome.status==="escalation")$={workflow_id:d.id,status:"escalated",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f,escalation_reason:j.outcome.reason};else if(j.outcome.status==="error"||j.outcome.status==="validation_error"){let b=x.type==="delegate"?x.task:x.gate_kind;$={workflow_id:d.id,status:"escalated",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f,escalation_reason:`Task "${b}" failed after ${j.follow_ups_used} follow-ups and ${j.retries_used} retries`}}}if($)break}let R=$??{workflow_id:d.id,status:"completed",steps:y.filter(Boolean),total_elapsed_ms:Date.now()-f};return await _n.runAfterWorkflow(d.id,R),R}async function k_e(t,e,r,i,n){let a=Date.now();if(r.onGate){let o=await r.onGate(t.gate_kind,t.description,e);return{step_index:i,gate_kind:t.gate_kind,outcome:{status:o?"gate_approved":"gate_rejected"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-a}}if(n&&t.description){let o=await x_e(n,t,e);return{step_index:i,gate_kind:t.gate_kind,outcome:{status:o?"gate_approved":"gate_rejected"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-a}}return{step_index:i,gate_kind:t.gate_kind,outcome:{status:"gate_approved"},follow_ups_used:0,retries_used:0,elapsed_ms:Date.now()-a}}async function x_e(t,e,r){let i=r.map(a=>{let o=a.task_id??a.gate_kind??`step_${a.step_index}`,s="data"in a.outcome?a.outcome.data:void 0;return`- ${o}: status=${a.outcome.status}${s?`, data=${typeof s=="string"?s:JSON.stringify(s)}`:""}`}).join(`
2959
2961
  `),n=jU(e,i);try{let a=await t.send(n,{readonly:!0});return TU(a)}catch{return!1}}function jU(t,e){return`You are a gate evaluator in a workflow pipeline. Your job is to decide whether the workflow should proceed based on prior step results.
2960
2962
 
2961
2963
  ## Gate
@@ -2973,7 +2975,7 @@ Respond with ONLY a JSON object (no markdown fences, no extra text):
2973
2975
 
2974
2976
  or
2975
2977
 
2976
- {"approved": false, "reason": "brief explanation"}`}function TU(t){let e=t.match(/\{[\s\S]*?"approved"\s*:\s*(true|false)[\s\S]*?\}/);if(e)try{return JSON.parse(e[0]).approved===!0}catch{}let r=t.toLowerCase();return r.includes('"approved": true')||r.includes('"approved":true')?!0:(r.includes('"approved": false')||r.includes('"approved":false'),!1)}function S_e(t,e,r,i,n){t.onStepComplete?.({workflow_id:e,step_index:r,step_type:i.type,task_id:i.type==="delegate"?i.task:void 0,gate_kind:i.type==="gate"?i.gate_kind:void 0,outcome_status:n.outcome.status,follow_ups_used:n.follow_ups_used,retries_used:n.retries_used,elapsed_ms:n.elapsed_ms})}import{existsSync as RU}from"node:fs";import{readdir as k_e}from"node:fs/promises";import{resolve as DU,join as x_e}from"node:path";var $_e=[".ts",".js",".mts",".mjs"];function E_e(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}async function A_e(t){return RU(t)?(await k_e(t,{withFileTypes:!0})).filter(r=>r.isFile()&&$_e.some(i=>r.name.endsWith(i))&&!r.name.startsWith("_")&&!r.name.endsWith(".d.ts")&&!r.name.endsWith(".test.ts")&&!r.name.endsWith(".spec.ts")).map(r=>DU(t,r.name)):[]}async function NU(t){let e=await import(new URL(`file://${t}`).href),r=0;for(let i of Object.values(e))if(E_e(i))try{_n.register(i),r++}catch{}return r}async function LU(t,e){let r={loaded:0,files:[],errors:[]};for(let i of t){let n=DU(e,i);if(!RU(n)){r.errors.push({file:i,error:`File not found: ${n}`});continue}try{let a=await NU(n);r.loaded+=a,r.files.push(n)}catch(a){r.errors.push({file:i,error:a.message})}}return r}async function MU(t){let e={loaded:0,files:[],errors:[]},r=await A_e(t);for(let i of r)try{let n=await NU(i);e.loaded+=n,e.files.push(i)}catch(n){e.errors.push({file:i,error:n.message})}return e}async function Av(t){if(t.pluginPaths&&t.pluginPaths.length>0)return LU(t.pluginPaths,t.projectDir);let e=x_e(t.projectDir,"src","plugins");return MU(e)}RS();import{openSync as I_e,writeSync as C_e,closeSync as j_e,mkdirSync as T_e}from"node:fs";import{dirname as VU,join as UU,basename as R_e,extname as D_e}from"node:path";function N_e(t,e,r){if(e==="single")return t;let i=VU(t),n=D_e(t),a=R_e(t,n),o=new Date;if(e==="daily"){let c=o.toISOString().slice(0,10);return UU(i,`${a}-${c}${n}`)}let s=c=>String(c).padStart(2,"0"),l=`${o.getFullYear()}${s(o.getMonth()+1)}${s(o.getDate())}T${s(o.getHours())}${s(o.getMinutes())}${s(o.getSeconds())}`,u=r?`-${r}`:"";return UU(i,`${a}-${l}${u}${n}`)}function $o(t){let e=t.stderr??!1,r=null,i;if(t.file){let n=t.naming??"single";i=N_e(t.file,n,t.label),T_e(VU(i),{recursive:!0}),r=I_e(i,"a")}return!e&&r===null?{write(){},close(){}}:{write(n){e&&process.stderr.write(n),r!==null&&C_e(r,n)},close(){r!==null&&(j_e(r),r=null)},get filePath(){return i}}}var DS=fn(ki(),1);import{existsSync as Ec}from"node:fs";import{readFile as GU}from"node:fs/promises";import{resolve as WU,join as HU}from"node:path";var BU={cursor:"CURSOR_API_KEY",claude:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY"};async function L_e(t){try{let e=await ja(t);return{check:{name:"config_exists",status:"pass",message:`Loaded ${t}`},config:e}}catch(e){let r=WU(t);return Ec(r)?{check:{name:"config_exists",status:"fail",message:`Config parse error: ${e.message}`}}:{check:{name:"config_exists",status:"fail",message:`Config file not found: ${r}`}}}}async function M_e(t){if(!Ec(t.dslPath))return{name:"dsl_exists",status:"fail",message:`DSL file not found: ${t.dslPath}`};try{let e=await GU(t.dslPath,"utf8"),r=DS.default.parse(e);if(!r||typeof r!="object")return{name:"dsl_exists",status:"fail",message:"DSL file is empty or not a valid YAML object"};let i=Object.keys(r.agents??{}).length,n=Object.keys(r.tasks??{}).length,a=Object.keys(r.workflow??{}).length;return{name:"dsl_exists",status:"pass",message:`Parsed OK \u2014 ${i} agent(s), ${n} task(s), ${a} workflow(s)`}}catch(e){return{name:"dsl_exists",status:"fail",message:`DSL parse error: ${e.message}`}}}async function z_e(t,e){let r=HU(e.generatedDir,".manifest.json");if(!Ec(r))return{name:"manifest_fresh",status:"fail",message:"Generated manifest not found. Run `agent-runtime generate` first."};try{return await Sv(t)?{name:"manifest_fresh",status:"pass",message:"Generated files are up to date"}:{name:"manifest_fresh",status:"fail",message:"Generated files are stale. Run `agent-runtime generate` to update."}}catch(i){return{name:"manifest_fresh",status:"fail",message:`Freshness check error: ${i.message}`}}}function q_e(){let t=[],e=[];for(let[r,i]of Object.entries(BU))process.env[i]?t.push(r):e.push(`${r} (${i})`);return t.length>0?{name:"adapter_configured",status:"pass",message:`Configured: ${t.join(", ")}${e.length>0?` | Not set: ${e.join(", ")}`:""}`}:{name:"adapter_configured",status:"warn",message:`No SDK adapter API keys found. Set one of: ${Object.entries(BU).map(([r,i])=>`${i} (${r})`).join(", ")}`}}async function F_e(){try{return await import("tsx/esm"),{name:"tsx_available",status:"pass",message:"tsx is installed"}}catch{return{name:"tsx_available",status:"fail",message:"tsx is not installed. Required for loading generated .ts files. Run: npm install tsx"}}}function U_e(t){if(t.pluginPaths.length===0)return{name:"plugin_entrypoint",status:"pass",message:"No plugins configured"};let e=[];for(let r of t.pluginPaths){let i=WU(t.configDir,r);Ec(i)||e.push(r)}return e.length===0?{name:"plugin_entrypoint",status:"pass",message:`All ${t.pluginPaths.length} plugin file(s) found`}:{name:"plugin_entrypoint",status:"fail",message:`Missing plugin file(s): ${e.join(", ")}`}}async function V_e(t){if(t.bindingPaths.length===0)return{name:"bindings_valid",status:"pass",message:"No bindings configured"};let e=[];for(let r of t.bindingPaths){if(!Ec(r)){e.push(`Not found: ${r}`);continue}try{let i=await GU(r,"utf8"),n=DS.default.parse(i);(!n||typeof n!="object")&&e.push(`Invalid YAML object: ${r}`)}catch(i){e.push(`Parse error in ${r}: ${i.message}`)}}return e.length===0?{name:"bindings_valid",status:"pass",message:`All ${t.bindingPaths.length} binding file(s) valid`}:{name:"bindings_valid",status:"fail",message:e.join("; ")}}function B_e(t){let e=t.resolvedLogging.progressLog;if(e.destination==="none"||e.destination==="stderr")return{name:"log_directory",status:"pass",message:`Progress log destination: ${e.destination}`};if(!e.file)return{name:"log_directory",status:"fail",message:"logging.progress_log.file is required when destination is 'file' or 'both'"};let r=HU(e.file,"..");return Ec(r)?{name:"log_directory",status:"pass",message:`Log file: ${e.file} (naming: ${e.naming})`}:{name:"log_directory",status:"warn",message:`Log directory does not exist: ${r} (will be created on first run)`}}async function KU(t){let e=[],r=await L_e(t);if(e.push(r.check),!r.config)return{checks:e,all_passed:!1};let i=r.config,[n,a,o,s,l]=await Promise.all([M_e(i),z_e(t,i),Promise.resolve(U_e(i)),V_e(i),F_e()]);e.push(n),e.push(a),e.push(q_e()),e.push(o),e.push(s),e.push(l),e.push(B_e(i));let u=e.every(c=>c.status!=="fail");return{checks:e,all_passed:u}}var QU=fn(ki(),1);import{existsSync as ZU}from"node:fs";import{mkdir as G_e,writeFile as JU,readFile as W_e,appendFile as H_e}from"node:fs/promises";import{join as Ov}from"node:path";function K_e(t){return QU.default.stringify({dsl:"./agent-contracts.yaml",generated_dir:"./agent/generated",plugins:["./agent/src/plugins/example-plugin.ts"],recovery:{max_follow_ups:2,max_retries:0}},{lineWidth:0})}var Z_e=`import type { AgentPlugin } from "agent-contracts-runtime";
2978
+ {"approved": false, "reason": "brief explanation"}`}function TU(t){let e=t.match(/\{[\s\S]*?"approved"\s*:\s*(true|false)[\s\S]*?\}/);if(e)try{return JSON.parse(e[0]).approved===!0}catch{}let r=t.toLowerCase();return r.includes('"approved": true')||r.includes('"approved":true')?!0:(r.includes('"approved": false')||r.includes('"approved":false'),!1)}function $_e(t,e,r,i,n){t.onStepComplete?.({workflow_id:e,step_index:r,step_type:i.type,task_id:i.type==="delegate"?i.task:void 0,gate_kind:i.type==="gate"?i.gate_kind:void 0,outcome_status:n.outcome.status,follow_ups_used:n.follow_ups_used,retries_used:n.retries_used,elapsed_ms:n.elapsed_ms})}import{existsSync as RU}from"node:fs";import{readdir as E_e}from"node:fs/promises";import{resolve as DU,join as A_e}from"node:path";var P_e=[".ts",".js",".mts",".mjs"];function O_e(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}async function I_e(t){return RU(t)?(await E_e(t,{withFileTypes:!0})).filter(r=>r.isFile()&&P_e.some(i=>r.name.endsWith(i))&&!r.name.startsWith("_")&&!r.name.endsWith(".d.ts")&&!r.name.endsWith(".test.ts")&&!r.name.endsWith(".spec.ts")).map(r=>DU(t,r.name)):[]}async function NU(t){let e=await import(new URL(`file://${t}`).href),r=0;for(let i of Object.values(e))if(O_e(i))try{_n.register(i),r++}catch{}return r}async function LU(t,e){let r={loaded:0,files:[],errors:[]};for(let i of t){let n=DU(e,i);if(!RU(n)){r.errors.push({file:i,error:`File not found: ${n}`});continue}try{let a=await NU(n);r.loaded+=a,r.files.push(n)}catch(a){r.errors.push({file:i,error:a.message})}}return r}async function MU(t){let e={loaded:0,files:[],errors:[]},r=await I_e(t);for(let i of r)try{let n=await NU(i);e.loaded+=n,e.files.push(i)}catch(n){e.errors.push({file:i,error:n.message})}return e}async function Av(t){if(t.pluginPaths&&t.pluginPaths.length>0)return LU(t.pluginPaths,t.projectDir);let e=A_e(t.projectDir,"src","plugins");return MU(e)}RS();import{openSync as T_e,writeSync as R_e,closeSync as D_e,mkdirSync as N_e}from"node:fs";import{dirname as VU,join as UU,basename as L_e,extname as M_e}from"node:path";function z_e(t,e,r){if(e==="single")return t;let i=VU(t),n=M_e(t),a=L_e(t,n),o=new Date;if(e==="daily"){let c=o.toISOString().slice(0,10);return UU(i,`${a}-${c}${n}`)}let s=c=>String(c).padStart(2,"0"),l=`${o.getFullYear()}${s(o.getMonth()+1)}${s(o.getDate())}T${s(o.getHours())}${s(o.getMinutes())}${s(o.getSeconds())}`,u=r?`-${r}`:"";return UU(i,`${a}-${l}${u}${n}`)}function $o(t){let e=t.stderr??!1,r=null,i;if(t.file){let n=t.naming??"single";i=z_e(t.file,n,t.label),N_e(VU(i),{recursive:!0}),r=T_e(i,"a")}return!e&&r===null?{write(){},close(){}}:{write(n){e&&process.stderr.write(n),r!==null&&R_e(r,n)},close(){r!==null&&(D_e(r),r=null)},get filePath(){return i}}}var DS=fn(ki(),1);import{existsSync as Ec}from"node:fs";import{readFile as GU}from"node:fs/promises";import{resolve as WU,join as HU}from"node:path";var BU={cursor:"CURSOR_API_KEY",claude:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY"};async function q_e(t){try{let e=await ja(t);return{check:{name:"config_exists",status:"pass",message:`Loaded ${t}`},config:e}}catch(e){let r=WU(t);return Ec(r)?{check:{name:"config_exists",status:"fail",message:`Config parse error: ${e.message}`}}:{check:{name:"config_exists",status:"fail",message:`Config file not found: ${r}`}}}}async function F_e(t){if(!Ec(t.dslPath))return{name:"dsl_exists",status:"fail",message:`DSL file not found: ${t.dslPath}`};try{let e=await GU(t.dslPath,"utf8"),r=DS.default.parse(e);if(!r||typeof r!="object")return{name:"dsl_exists",status:"fail",message:"DSL file is empty or not a valid YAML object"};let i=Object.keys(r.agents??{}).length,n=Object.keys(r.tasks??{}).length,a=Object.keys(r.workflow??{}).length;return{name:"dsl_exists",status:"pass",message:`Parsed OK \u2014 ${i} agent(s), ${n} task(s), ${a} workflow(s)`}}catch(e){return{name:"dsl_exists",status:"fail",message:`DSL parse error: ${e.message}`}}}async function U_e(t,e){let r=HU(e.generatedDir,".manifest.json");if(!Ec(r))return{name:"manifest_fresh",status:"fail",message:"Generated manifest not found. Run `agent-runtime generate` first."};try{return await Sv(t)?{name:"manifest_fresh",status:"pass",message:"Generated files are up to date"}:{name:"manifest_fresh",status:"fail",message:"Generated files are stale. Run `agent-runtime generate` to update."}}catch(i){return{name:"manifest_fresh",status:"fail",message:`Freshness check error: ${i.message}`}}}function V_e(){let t=[],e=[];for(let[r,i]of Object.entries(BU))process.env[i]?t.push(r):e.push(`${r} (${i})`);return t.length>0?{name:"adapter_configured",status:"pass",message:`Configured: ${t.join(", ")}${e.length>0?` | Not set: ${e.join(", ")}`:""}`}:{name:"adapter_configured",status:"warn",message:`No SDK adapter API keys found. Set one of: ${Object.entries(BU).map(([r,i])=>`${i} (${r})`).join(", ")}`}}async function B_e(){try{return await import("tsx/esm"),{name:"tsx_available",status:"pass",message:"tsx is installed"}}catch{return{name:"tsx_available",status:"fail",message:"tsx is not installed. Required for loading generated .ts files. Run: npm install tsx"}}}function G_e(t){if(t.pluginPaths.length===0)return{name:"plugin_entrypoint",status:"pass",message:"No plugins configured"};let e=[];for(let r of t.pluginPaths){let i=WU(t.configDir,r);Ec(i)||e.push(r)}return e.length===0?{name:"plugin_entrypoint",status:"pass",message:`All ${t.pluginPaths.length} plugin file(s) found`}:{name:"plugin_entrypoint",status:"fail",message:`Missing plugin file(s): ${e.join(", ")}`}}async function W_e(t){if(t.bindingPaths.length===0)return{name:"bindings_valid",status:"pass",message:"No bindings configured"};let e=[];for(let r of t.bindingPaths){if(!Ec(r)){e.push(`Not found: ${r}`);continue}try{let i=await GU(r,"utf8"),n=DS.default.parse(i);(!n||typeof n!="object")&&e.push(`Invalid YAML object: ${r}`)}catch(i){e.push(`Parse error in ${r}: ${i.message}`)}}return e.length===0?{name:"bindings_valid",status:"pass",message:`All ${t.bindingPaths.length} binding file(s) valid`}:{name:"bindings_valid",status:"fail",message:e.join("; ")}}function H_e(t){let e=t.resolvedLogging.progressLog;if(e.destination==="none"||e.destination==="stderr")return{name:"log_directory",status:"pass",message:`Progress log destination: ${e.destination}`};if(!e.file)return{name:"log_directory",status:"fail",message:"logging.progress_log.file is required when destination is 'file' or 'both'"};let r=HU(e.file,"..");return Ec(r)?{name:"log_directory",status:"pass",message:`Log file: ${e.file} (naming: ${e.naming})`}:{name:"log_directory",status:"warn",message:`Log directory does not exist: ${r} (will be created on first run)`}}async function KU(t){let e=[],r=await q_e(t);if(e.push(r.check),!r.config)return{checks:e,all_passed:!1};let i=r.config,[n,a,o,s,l]=await Promise.all([F_e(i),U_e(t,i),Promise.resolve(G_e(i)),W_e(i),B_e()]);e.push(n),e.push(a),e.push(V_e()),e.push(o),e.push(s),e.push(l),e.push(H_e(i));let u=e.every(c=>c.status!=="fail");return{checks:e,all_passed:u}}var QU=fn(ki(),1);import{existsSync as ZU}from"node:fs";import{mkdir as K_e,writeFile as JU,readFile as Z_e,appendFile as J_e}from"node:fs/promises";import{join as Ov}from"node:path";function Y_e(t){return QU.default.stringify({dsl:"./agent-contracts.yaml",generated_dir:"./agent/generated",plugins:["./agent/src/plugins/example-plugin.ts"],recovery:{max_follow_ups:2,max_retries:0}},{lineWidth:0})}var Q_e=`import type { AgentPlugin } from "agent-contracts-runtime";
2977
2979
 
2978
2980
  /**
2979
2981
  * Example plugin \u2014 extend agent-contracts-runtime with custom hooks.
@@ -3008,7 +3010,7 @@ export const examplePlugin: AgentPlugin = {
3008
3010
  };
3009
3011
 
3010
3012
  export default examplePlugin;
3011
- `,J_e=`import type { AgentPlugin, GuardrailResult } from "agent-contracts-runtime";
3013
+ `,X_e=`import type { AgentPlugin, GuardrailResult } from "agent-contracts-runtime";
3012
3014
 
3013
3015
  /**
3014
3016
  * Custom guardrails \u2014 project-specific safety checks.
@@ -3040,11 +3042,11 @@ export const customGuardrailsPlugin: AgentPlugin = {
3040
3042
  };
3041
3043
 
3042
3044
  export default customGuardrailsPlugin;
3043
- `,YU=["","# agent-contracts-runtime generated files","agent/generated/"];function Y_e(t){return[{relativePath:"agent-runtime.config.yaml",content:K_e(t)},{relativePath:"agent/src/plugins/example-plugin.ts",content:Z_e},{relativePath:"agent/src/guardrails/custom-guardrails.ts",content:J_e}]}async function XU(t){let{adapter:e,outputDir:r,force:i}=t,n=[],a=Y_e(e);for(let s of a){let l=Ov(r,s.relativePath);if(!i&&ZU(l))throw new Error(`File already exists: ${s.relativePath}. Use --force to overwrite.`)}for(let s of a){let l=Ov(r,s.relativePath),u=Ov(l,"..");await G_e(u,{recursive:!0}),await JU(l,s.content,"utf8"),n.push(s.relativePath)}let o=Ov(r,".gitignore");return ZU(o)?(await W_e(o,"utf8")).includes("agent/generated/")||(await H_e(o,YU.join(`
3045
+ `,YU=["","# agent-contracts-runtime generated files","agent/generated/"];function e9e(t){return[{relativePath:"agent-runtime.config.yaml",content:Y_e(t)},{relativePath:"agent/src/plugins/example-plugin.ts",content:Q_e},{relativePath:"agent/src/guardrails/custom-guardrails.ts",content:X_e}]}async function XU(t){let{adapter:e,outputDir:r,force:i}=t,n=[],a=e9e(e);for(let s of a){let l=Ov(r,s.relativePath);if(!i&&ZU(l))throw new Error(`File already exists: ${s.relativePath}. Use --force to overwrite.`)}for(let s of a){let l=Ov(r,s.relativePath),u=Ov(l,"..");await K_e(u,{recursive:!0}),await JU(l,s.content,"utf8"),n.push(s.relativePath)}let o=Ov(r,".gitignore");return ZU(o)?(await Z_e(o,"utf8")).includes("agent/generated/")||(await J_e(o,YU.join(`
3044
3046
  `)+`
3045
3047
  `,"utf8"),n.push(".gitignore")):(await JU(o,YU.join(`
3046
3048
  `).trimStart()+`
3047
- `,"utf8"),n.push(".gitignore")),{files_created:n}}import{existsSync as tV,readFileSync as h9e}from"node:fs";import{resolve as g9e,join as eV}from"node:path";import{fileURLToPath as v9e}from"node:url";var Q_e={id:"implementation-auditor",role_name:"Implementation Auditor",purpose:`Audits an existing LLM command integration to verify it correctly
3049
+ `,"utf8"),n.push(".gitignore")),{files_created:n}}import{existsSync as tV,readFileSync as y9e}from"node:fs";import{resolve as _9e,join as eV}from"node:path";import{fileURLToPath as w9e}from"node:url";var t9e={id:"implementation-auditor",role_name:"Implementation Auditor",purpose:`Audits an existing LLM command integration to verify it correctly
3048
3050
  follows the agent-contracts + agent-contracts-runtime + cli-contracts
3049
3051
  stack conventions. Detects architectural violations, missing patterns,
3050
3052
  incorrect API usage, and deviations from the canonical
@@ -3104,7 +3106,7 @@ exactly what is wrong and how to fix it.
3104
3106
  to their adapter so file tools operate in the project directory.
3105
3107
  - CLI must use cli-contracts' generated CommandHandlers interface
3106
3108
  and createProgram() \u2014 not manually wired Commander commands.
3107
- `,mode:"read-only",dispatch_only:!1,can_read_artifacts:[],can_write_artifacts:[],can_execute_tools:[],can_invoke_agents:[],can_return_handoffs:["audit-result"],responsibilities:["Verify the DSL directory structure exists: dsl/{project}-dsl.yaml, dsl/agents/*.yaml, dsl/tasks.yaml, dsl/handoff-types.yaml, dsl/agent-runtime.config.yaml.","Check that the main DSL entry has version:1, a system block with id and name, and uses $ref for agents/tasks/handoff_types.","Validate agent definitions have all required fields: role_name, purpose, mode, can_read_artifacts:[], can_write_artifacts:[], responsibilities, constraints. Check that rules use R-PREFIX-NNN format and severity is mandatory|recommended|optional.","Validate task definitions: target_agent matches a defined agent, workflow matches a defined workflow, result_handoff matches a defined handoff type, completion_criteria are specific and testable.","Verify handoff type schemas conform to AgentAuditResult shape when applicable (summary, riskLevel, findings[], recommendedActions[], metadata). Check $ref usage and SSoT comments for inlined schemas.","Check that guardrails and guardrail_policies are defined, and that output-schema-conformance is included.","Scan src/agents/orchestrator.ts for: (1) imports from agent-contracts-runtime (not custom SDK wrappers), (2) usage of runWorkflow() \u2014 NOT runTask() which is a low-level internal API that bypasses workflow orchestration, plugin hooks, and gate steps, (3) dynamic import pattern with exit code 11 for missing runtime and exit code 12 for adapter errors, (4) generated registries (including workflowRegistry) imported and passed to runWorkflow.","Verify no file in the project calls adapter.send(), adapter.followUp(), adapter.sendExecution(), or runTask() directly \u2014 all LLM invocations must go through runWorkflow().","Check that src/generated/dsl/ exists and contains the expected files (agents.ts, tasks.ts, workflows.ts, handoffs.ts, index.ts). Verify the .manifest.json exists and is not stale.","Verify adapter creation uses the correct constructors: CursorSdkAdapter.create() (async static), ClaudeAgentSdkAdapter constructor, OpenAIAgentsSdkAdapter constructor, etc.","Check cli-contract.yaml for each LLM command: all six standard options present (--adapter, --model, --dry-run, --fail-on, --output, --report-format). Verify --report-format is used (not --format).",'Verify x-agent metadata on each LLM command: riskLevel, safeDryRunOption (must be "dry-run"), expectedDurationMs. Flag high-risk commands without requiresConfirmation.',"Check exit code definitions: 0 (success), 1 (error), 3 (validation), 10 (findings), 11 (runtime missing), 12 (adapter error).","Verify components/schemas includes AgentAuditResult, AgentFinding, AgentRecommendedAction, and AgentEvidence definitions.","Verify src/agents/ directory structure: types.ts (TaskId, AgentConfig, AgentOptions, AgentRunResult), orchestrator.ts (createAdapter, runAgentTask with dynamic imports), context-builder.ts (build*Context functions with 16KB cap), formatter.ts (computeExitCode, formatResultText, formatResultJson).","Check that --dry-run mode returns the constructed prompt without making any LLM API call.","Scan for direct LLM API imports (@anthropic-ai/sdk, openai, @google/genai, @cursor/sdk) used outside of adapter files \u2014 application code must not import these directly.",'Audit context-builder for SSoT violations: scan for hardcoded agent instructions (sections titled "## Instructions", "## Required Patterns", "## Output Format", evaluation criteria, checklists, anti-pattern definitions, API references, or output schema descriptions). These belong in the DSL agent definition and are injected by buildTaskPrompt. Context-builder should contain only domain-specific data (file contents, configuration, scan results, project metadata).',"Check agent mode-purpose coherence: for each agent in the DSL, verify that mode: read-only agents do not have purposes or responsibilities describing file writing/editing/creation, and that mode: read-write agents propagate cwd through AgentConfig to the adapter so file tools operate in the correct directory.","Verify cwd propagation: command handlers must set cwd in AgentConfig (e.g. process.cwd() or resolve(projectDir)), createAdapter must pass cwd to adapter constructors/factories, and AgentConfig type must include a cwd field.","Verify cli-contracts handler wiring: if the project uses cli-contracts (has src/generated/program.ts or src/generated/cli/program.ts exporting CommandHandlers and createProgram), the CLI entry point must use createProgram(handlers, version) with a handlers object implementing the CommandHandlers interface \u2014 not manually created Commander commands."],constraints:["This agent is read-only. It must not create, modify, or delete any files. Output is a structured audit report only.","Findings must include specific file paths, line references where possible, and concrete remediation steps.","Severity classification: critical = breaks the integration pattern (direct API calls, missing runtime usage), error = missing required element (no x-agent, missing standard option), warning = deviation from best practice (context not capped, missing guardrail), info = improvement suggestion.","Category vocabulary: dsl-structure, dsl-agent, dsl-task, dsl-handoff, dsl-workflow, dsl-guardrail, runtime-adapter, runtime-orchestrator, runtime-registry, runtime-handler, runtime-plugin, cli-contract-options, cli-contract-xagent, cli-contract-exits, cli-contract-schema, architecture-modules, architecture-dry-run, architecture-context-builder, architecture-agent-coherence, architecture-adapter-cwd, architecture-handler, architecture-formatter.","Every finding with severity warning or above must include a recommendation field with a concrete fix.","The confidence field should reflect how certain the finding is: 1.0 for pattern matches (e.g., adapter.send() found in code), 0.8+ for structural checks (e.g., missing file), 0.5-0.8 for heuristic assessments (e.g., context might exceed 16KB)."],rules:[{id:"R-AUDIT-001",description:"Every finding must specify target (file path) and category (from the defined category vocabulary). Findings without a target are not actionable.",severity:"mandatory"},{id:"R-AUDIT-002",description:"The audit must check all four layers (DSL, runtime, CLI contract, architecture). Skipping a layer or returning partial results is not acceptable.",severity:"mandatory"},{id:"R-AUDIT-003",description:"Critical findings must be surfaced for: (1) direct adapter.send() calls bypassing runWorkflow, (2) runTask() used instead of runWorkflow() \u2014 runTask is a low-level internal API that bypasses workflow orchestration, (3) custom adapter classes not from agent-contracts-runtime, (4) missing generated registries in runWorkflow calls.",severity:"mandatory"},{id:"R-AUDIT-004",description:"The riskLevel in the audit result must be derived from the most severe finding: any critical \u2192 critical, any error \u2192 high, any warning \u2192 medium, info only \u2192 low.",severity:"mandatory"},{id:"R-AUDIT-005",description:"Context-builder must be audited for SSoT violations. Any hardcoded agent instructions (evaluation criteria, rules, anti-patterns, output format specs) in context-builder is a critical finding \u2014 these belong in the DSL agent definition and are injected by buildTaskPrompt / runWorkflow. Context-builder may only contain domain-specific data (file contents, configuration, scan results, project metadata).",severity:"mandatory"},{id:"R-AUDIT-007",description:"runTask() usage in consumer projects is a CRITICAL finding. Consumer projects integrating with cli-contracts must use runWorkflow() exclusively. runTask() is a low-level internal API that bypasses workflow DAG orchestration, workflow-level plugin hooks (beforeWorkflow/afterWorkflow), gate steps, and step dependencies. Any occurrence of runTask import or call in orchestrator, command handler, or CLI entry point code must be reported as severity: critical.",severity:"mandatory"},{id:"R-AUDIT-006",description:"Agent mode-purpose coherence must be verified. A read-only agent whose purpose describes file writing is a critical finding because the adapter's tool set (Read/Glob/Grep only) makes the stated purpose impossible to fulfil.",severity:"mandatory"}],escalation_criteria:[{condition:"Target project has no LLM command integration to audit",action:"stop_and_report"},{condition:"Target project uses a completely different integration pattern (not agent-contracts stack)",action:"stop_and_report"}]},X_e={id:"llm-feature-implementer",role_name:"LLM Feature Implementer",purpose:'Expert implementation agent for the agent-contracts toolchain.\nAdds LLM-powered commands (audit, propose, explain, etc.) to CLI tools\nusing the three-layer stack:\n\n1. **agent-contracts** \u2014 DSL package. Defines agents, tasks, workflows,\n handoff types, guardrails, and guardrail policies in YAML. The\n `resolve()` function handles `$ref`, `extends`, and merge operators.\n Installed as a devDependency. CLI: `agent-contracts audit`.\n\n2. **agent-contracts-runtime** \u2014 Runtime bridge. Generates typed\n TypeScript contracts from DSL via Handlebars templates, then\n executes workflows through pluggable SDK adapters. Provides\n `runTask()`, `runWorkflow()`, `createRuntime()`, plugin system,\n and guardrail hooks. CLI: `agent-runtime generate|run|list|doctor`.\n\n3. **cli-contracts** \u2014 CLI contract package. Defines command-line\n interfaces in YAML (`cli-contract.yaml`): command sets, arguments,\n options, exit codes, stdout/stderr schemas, `x-agent` metadata,\n and `effects`. Generates typed Commander programs, Zod validators,\n and markdown docs. CLI: `cli-contracts init|generate|validate`.\n\nThe canonical integration pattern ("integrate-llm-commands") produces:\n- DSL definitions under `dsl/` (agents, tasks, workflows, handoff-types)\n- Pre-generated TypeScript contracts under `src/generated/dsl/`\n- Runtime integration module under `src/agents/` (orchestrator,\n context-builder, formatter, types)\n- CLI command handlers under `src/commands/`\n- Updated `cli-contract.yaml` with new commands and `x-agent` metadata\n',mode:"read-write",dispatch_only:!1,can_read_artifacts:[],can_write_artifacts:[],can_execute_tools:[],can_invoke_agents:[],can_return_handoffs:["implementation-result"],responsibilities:["Read and analyze the target project's cli-contract.yaml, package.json, tsconfig.json, and existing source code to understand the CLI structure, existing commands, component schemas, and TypeScript configuration.","Identify which LLM commands to add based on the user's description. Canonical command types: audit (semantic review), propose (structured proposal generation), explain (human-readable explanation of machine output).","Create the DSL directory structure: dsl/{project}-dsl.yaml (main entry with version:1, system block, $ref to sub-files), dsl/agents/{name}.yaml, dsl/tasks.yaml, dsl/handoff-types.yaml, dsl/agent-runtime.config.yaml.","Define agents with: role_name, purpose (domain expertise), mode (read-only for analysis agents), can_read_artifacts:[], can_write_artifacts:[], can_return_handoffs, responsibilities, constraints, rules (R-PREFIX-NNN format), escalation_criteria.","Define tasks with: description, target_agent, allowed_from_agents, workflow (must match a workflow ID), invocation_handoff, result_handoff, responsibilities, completion_criteria.","Define handoff types with: version:1, description, schema (JSON Schema). Result types should conform to AgentAuditResult shape (summary, riskLevel, findings[], recommendedActions[], metadata). Use $ref to cli-contract.yaml components/schemas as SSoT when possible; inline with SSoT comment as fallback.","Define workflows with trigger, entry_conditions, and steps (delegate or gate). Each delegate step references a task and from_agent. Gate steps pause for user approval.","Define guardrails (output-schema-conformance, domain-specific safety) and guardrail_policies grouping them with severity and action.","Create agent-runtime.config.yaml: dsl points to main DSL file, generated_dir points to src/generated/dsl.","Implement src/agents/types.ts: TaskId union type, AgentConfig interface (adapter, model, temperature), AgentOptions interface (dryRun, failOn), AgentRunResult interface (taskId, data, raw, prompt, dryRun, status, errorMessage, followUpsUsed, retriesUsed).","Implement src/agents/orchestrator.ts: createAdapter() with dynamic imports from agent-contracts-runtime/adapters/*, runAgentWorkflow() that imports runWorkflow from agent-contracts-runtime, loads generated registries (including workflowRegistry) from src/generated/dsl/index.js, and calls runWorkflow with registries. NEVER use runTask \u2014 it is a low-level internal API that bypasses workflow orchestration.","Implement src/agents/context-builder.ts: build{Command}Context() functions that transform CLI inputs into structured markdown prompts. Cap context at 16KB. Structure: # Request, ## Configuration, ## Target, ## Instructions.","Implement src/agents/formatter.ts: computeExitCode() mapping findings to exit codes via --fail-on threshold, formatResultText() with severity icons, formatResultJson() for structured output.","Create src/commands/{command}.ts handlers: load config, call context builder, call runAgentWorkflow, format output, compute exit code.","Update cli-contract.yaml: add command definitions with standard LLM options (--adapter, --model, --dry-run, --fail-on, --output, --report-format), exit codes (0, 1, 3, 10, 11, 12), x-agent metadata, and register AgentAuditResult/AgentFinding/AgentRecommendedAction in components/schemas.",'Add npm scripts: "dsl:generate" running agent-runtime generate --config dsl/agent-runtime.config.yaml. Add agent-contracts and agent-contracts-runtime as devDependencies. Add SDK packages as optional peerDependencies.'],constraints:["NEVER create custom adapter classes. Import from agent-contracts-runtime: ClaudeAgentSdkAdapter from agent-contracts-runtime/adapters/claude-agent-sdk, CursorSdkAdapter from agent-contracts-runtime/adapters/cursor-sdk, OpenAIAgentsSdkAdapter from agent-contracts-runtime/adapters/openai-agents-sdk, GeminiSdkAdapter from agent-contracts-runtime/adapters/gemini-sdk, MockAdapter from agent-contracts-runtime/adapters/mock.","NEVER call adapter.send() or adapter.sendExecution() directly. All LLM invocations must go through runWorkflow() imported from agent-contracts-runtime. NEVER use runTask() \u2014 it is a low-level internal API. runWorkflow() handles prompt building, handoff validation, retry/followUp, workflow DAG, and plugin hooks.",'Dynamic-import both agent-contracts-runtime and adapter packages. The tool must work without them installed (graceful degradation). Pattern: const RUNTIME = "agent-contracts-runtime"; try { const { runWorkflow } = await import(RUNTIME); } catch { exit(11); }',"LLM commands use --report-format (json|text|yaml) for output format. --format is reserved for deterministic commands. Never mix them.","Exit code convention: 0=success (no findings above threshold), 1=general error, 3=input validation/parse failed, 10=findings detected above --fail-on threshold, 11=agent-contracts-runtime not installed, 12=adapter initialization error (missing API key, etc.).","Standard LLM command options (all must be present): --adapter <name> (mock|cursor|claude|openai|gemini, default varies), --model <name> (optional override), --dry-run (output prompt without LLM call), --fail-on <level> (warning|error|critical, default error), --output/-o <file> (write to file instead of stdout), --report-format <fmt> (json|text|yaml, default json).","Result handoff schemas must extend the AgentAuditResult base shape: summary (string, required), riskLevel (enum: low|medium|high|critical, required), findings (AgentFinding[], required), recommendedActions (AgentRecommendedAction[], optional), metadata (object with tool, command, version, generatedAt, adapter, model fields, optional).","AgentFinding shape: id?, severity (info|warning|error|critical), category (domain vocabulary), target?, location?, message (required), recommendation?, confidence? (0-1), evidence? (array of {type,content,source}), details? (object).","AgentRecommendedAction shape: kind (run_command|edit_file|review|confirm| block|ignore), title (required), command?, target?, rationale?.","Main DSL entry must have version:1 and a system block with id and name. Without these, the generator produces numbered files instead of named ones.","Every task must have a workflow field matching a defined workflow ID. Every workflow step's from_agent must match a defined agent ID. can_read_artifacts and can_write_artifacts must be empty arrays ([]) when no artifact registry is defined.","agent-runtime.config.yaml format: dsl: ./{project}-dsl.yaml generated_dir: ../src/generated/dsl Optional: plugins (array of paths), recovery ({max_follow_ups, max_retries}).","runWorkflow (the ONLY API consumer projects should use): Overloads: (1) runWorkflow(adapter, workflowId, options, registries?) \u2014 legacy. (2) runWorkflow(adapter, invocation, registries?) \u2014 structured (preferred). WorkflowInvocation: { workflow, handoff?, user_request?, runtime? {maxFollowUps,maxRetries,timeoutMs,readonly, dryRun}, hooks? {onStepComplete,onGate,onOptionalStep}, context? {cwd,environment,artifacts,variables} }. WorkflowResult: { workflow_id, status (completed|escalated|gate_rejected|error), steps[], total_elapsed_ms, escalation_reason?, error_message? }. NEVER use runTask() \u2014 it is a low-level internal API.","Adapter constructors: MockAdapter({responses?, defaultLatencyMs?}), CursorSdkAdapter.create({apiKey, model?, cwd?, guardrailHooks?}) \u2014 async static, ClaudeAgentSdkAdapter({cwd?, model?, tools?, permissionMode?, maxTurns?, guardrailHooks?}), OpenAIAgentsSdkAdapter({model?, maxTurns?, guardrailHooks?, tools?, agentName?, signal?}), GeminiSdkAdapter({apiKey?, model?, systemInstruction?, temperature?, maxOutputTokens?, guardrailHooks?}).",'Generated contract imports: import { agentRegistry, taskRegistry, handoffSchemas, workflowRegistry } from "../generated/dsl/index.js". Pass these as registries to runWorkflow: { workflowRegistry, taskRegistry, agentRegistry, handoffSchemas }.',"Plugin interface (AgentPlugin): id (string), beforeTask?(taskId, context), afterTask?(taskId, outcome), contextEnhancer?(taskId, context), promptEnhancer?(taskId, prompt, context), promptBuilder?(args), customGuardrails?, beforeWorkflow?(workflowId, userRequest), afterWorkflow?(workflowId, result).","x-agent fields for LLM commands in cli-contract.yaml: riskLevel (low for read-only analysis), requiresConfirmation (false for read-only), idempotent (true for analysis), sideEffects ([network]), sideEffectNote (describe network call and optional file write), safeDryRunOption (dry-run), expectedDurationMs (120000 typical), retryableExitCodes ([1, 12])."],rules:[{id:"R-IMPL-001",description:"Import SDK adapters exclusively from agent-contracts-runtime/adapters/*. Never create adapter classes, wrapper functions, or API client code.",severity:"mandatory"},{id:"R-IMPL-002",description:"All LLM invocations must use runWorkflow() from agent-contracts-runtime. NEVER use runTask() \u2014 it is a low-level internal API that bypasses workflow orchestration. Never call adapter.send(), adapter.followUp(), or adapter.sendExecution() directly. The runtime handles prompt building, schema validation, retry, followUp, workflow DAG, and plugin hooks.",severity:"mandatory"},{id:"R-IMPL-003",description:"Every LLM command in cli-contract.yaml must have x-agent metadata with at minimum: riskLevel, safeDryRunOption, expectedDurationMs.",severity:"mandatory"},{id:"R-IMPL-004",description:"Handoff type schemas must use $ref to cli-contract.yaml components/schemas as SSoT. If $ref resolution fails at generate time, inline the schema and add a YAML comment noting the SSoT path.",severity:"mandatory"},{id:"R-IMPL-005",description:"Context builder must cap prompt input at 16KB. Filter large contexts (schema dumps, lint output, etc.) to relevant portions before inclusion.",severity:"recommended"},{id:"R-IMPL-006",description:'The orchestrator must dynamic-import agent-contracts-runtime as a single string variable (const PKG = "agent-contracts-runtime") to enable graceful degradation. Exit with code 11 when the import fails, code 12 when the adapter fails to initialize.',severity:"mandatory"},{id:"R-IMPL-007",description:"Generated DSL contracts must be imported from src/generated/dsl/index.js and passed as registries to runWorkflow. Never hard-code agent definitions, task definitions, or handoff schemas in application code.",severity:"mandatory"}],escalation_criteria:[{condition:"Target project has no cli-contract.yaml and user did not request creating one",action:"stop_and_report"},{condition:"Target project is not a TypeScript / Node.js stack",action:"stop_and_report"},{condition:"Target project already has src/agents/ with a different integration pattern",action:"stop_and_report"}]},Tl={"implementation-auditor":Q_e,"llm-feature-implementer":X_e};var e9e={id:"implement-llm-feature",description:`Implement LLM-powered commands in a target CLI tool using the
3109
+ `,mode:"read-only",dispatch_only:!1,can_read_artifacts:[],can_write_artifacts:[],can_execute_tools:[],can_invoke_agents:[],can_return_handoffs:["audit-result"],responsibilities:["Verify the DSL directory structure exists: dsl/{project}-dsl.yaml, dsl/agents/*.yaml, dsl/tasks.yaml, dsl/handoff-types.yaml, dsl/agent-runtime.config.yaml.","Check that the main DSL entry has version:1, a system block with id and name, and uses $ref for agents/tasks/handoff_types.","Validate agent definitions have all required fields: role_name, purpose, mode, can_read_artifacts:[], can_write_artifacts:[], responsibilities, constraints. Check that rules use R-PREFIX-NNN format and severity is mandatory|recommended|optional.","Validate task definitions: target_agent matches a defined agent, workflow matches a defined workflow, result_handoff matches a defined handoff type, completion_criteria are specific and testable.","Verify handoff type schemas conform to AgentAuditResult shape when applicable (summary, riskLevel, findings[], recommendedActions[], metadata). Check $ref usage and SSoT comments for inlined schemas.","Check that guardrails and guardrail_policies are defined, and that output-schema-conformance is included.","Scan src/agents/orchestrator.ts for: (1) imports from agent-contracts-runtime (not custom SDK wrappers), (2) usage of runWorkflow() \u2014 NOT runTask() which is a low-level internal API that bypasses workflow orchestration, plugin hooks, and gate steps, (3) dynamic import pattern with exit code 11 for missing runtime and exit code 12 for adapter errors, (4) generated registries (including workflowRegistry) imported and passed to runWorkflow.","Verify no file in the project calls adapter.send(), adapter.followUp(), adapter.sendExecution(), or runTask() directly \u2014 all LLM invocations must go through runWorkflow().","Check that src/generated/dsl/ exists and contains the expected files (agents.ts, tasks.ts, workflows.ts, handoffs.ts, index.ts). Verify the .manifest.json exists and is not stale.","Verify adapter creation uses the correct constructors: CursorSdkAdapter.create() (async static), ClaudeAgentSdkAdapter constructor, OpenAIAgentsSdkAdapter constructor, etc.","Check cli-contract.yaml for each LLM command: all six standard options present (--adapter, --model, --dry-run, --fail-on, --output, --report-format). Verify --report-format is used (not --format).",'Verify x-agent metadata on each LLM command: riskLevel, safeDryRunOption (must be "dry-run"), expectedDurationMs. Flag high-risk commands without requiresConfirmation.',"Check exit code definitions: 0 (success), 1 (error), 3 (validation), 10 (findings), 11 (runtime missing), 12 (adapter error).","Verify components/schemas includes AgentAuditResult, AgentFinding, AgentRecommendedAction, and AgentEvidence definitions.","Verify src/agents/ directory structure: types.ts (TaskId, AgentConfig, AgentOptions, AgentRunResult), orchestrator.ts (createAdapter, runAgentTask with dynamic imports), context-builder.ts (build*Context functions with 16KB cap), formatter.ts (computeExitCode, formatResultText, formatResultJson).","Check that --dry-run mode returns the constructed prompt without making any LLM API call.","Scan for direct LLM API imports (@anthropic-ai/sdk, openai, @google/genai, @cursor/sdk) used outside of adapter files \u2014 application code must not import these directly.",'Audit context-builder for SSoT violations: scan for hardcoded agent instructions (sections titled "## Instructions", "## Required Patterns", "## Output Format", evaluation criteria, checklists, anti-pattern definitions, API references, or output schema descriptions). These belong in the DSL agent definition and are injected by buildTaskPrompt. Context-builder should contain only domain-specific data (file contents, configuration, scan results, project metadata).',"Check agent mode-purpose coherence: for each agent in the DSL, verify that mode: read-only agents do not have purposes or responsibilities describing file writing/editing/creation, and that mode: read-write agents propagate cwd through AgentConfig to the adapter so file tools operate in the correct directory.","Verify cwd propagation: command handlers must set cwd in AgentConfig (e.g. process.cwd() or resolve(projectDir)), createAdapter must pass cwd to adapter constructors/factories, and AgentConfig type must include a cwd field.","Verify cli-contracts handler wiring: if the project uses cli-contracts (has src/generated/program.ts or src/generated/cli/program.ts exporting CommandHandlers and createProgram), the CLI entry point must use createProgram(handlers, version) with a handlers object implementing the CommandHandlers interface \u2014 not manually created Commander commands."],constraints:["This agent is read-only. It must not create, modify, or delete any files. Output is a structured audit report only.","Findings must include specific file paths, line references where possible, and concrete remediation steps.","Severity classification: critical = breaks the integration pattern (direct API calls, missing runtime usage), error = missing required element (no x-agent, missing standard option), warning = deviation from best practice (context not capped, missing guardrail), info = improvement suggestion.","Category vocabulary: dsl-structure, dsl-agent, dsl-task, dsl-handoff, dsl-workflow, dsl-guardrail, runtime-adapter, runtime-orchestrator, runtime-registry, runtime-handler, runtime-plugin, cli-contract-options, cli-contract-xagent, cli-contract-exits, cli-contract-schema, architecture-modules, architecture-dry-run, architecture-context-builder, architecture-agent-coherence, architecture-adapter-cwd, architecture-handler, architecture-formatter.","Every finding with severity warning or above must include a recommendation field with a concrete fix.","The confidence field should reflect how certain the finding is: 1.0 for pattern matches (e.g., adapter.send() found in code), 0.8+ for structural checks (e.g., missing file), 0.5-0.8 for heuristic assessments (e.g., context might exceed 16KB)."],rules:[{id:"R-AUDIT-001",description:"Every finding must specify target (file path) and category (from the defined category vocabulary). Findings without a target are not actionable.",severity:"mandatory"},{id:"R-AUDIT-002",description:"The audit must check all four layers (DSL, runtime, CLI contract, architecture). Skipping a layer or returning partial results is not acceptable.",severity:"mandatory"},{id:"R-AUDIT-003",description:"Critical findings must be surfaced for: (1) direct adapter.send() calls bypassing runWorkflow, (2) runTask() used instead of runWorkflow() \u2014 runTask is a low-level internal API that bypasses workflow orchestration, (3) custom adapter classes not from agent-contracts-runtime, (4) missing generated registries in runWorkflow calls.",severity:"mandatory"},{id:"R-AUDIT-004",description:"The riskLevel in the audit result must be derived from the most severe finding: any critical \u2192 critical, any error \u2192 high, any warning \u2192 medium, info only \u2192 low.",severity:"mandatory"},{id:"R-AUDIT-005",description:"Context-builder must be audited for SSoT violations. Any hardcoded agent instructions (evaluation criteria, rules, anti-patterns, output format specs) in context-builder is a critical finding \u2014 these belong in the DSL agent definition and are injected by buildTaskPrompt / runWorkflow. Context-builder may only contain domain-specific data (file contents, configuration, scan results, project metadata).",severity:"mandatory"},{id:"R-AUDIT-007",description:"runTask() usage in consumer projects is a CRITICAL finding. Consumer projects integrating with cli-contracts must use runWorkflow() exclusively. runTask() is a low-level internal API that bypasses workflow DAG orchestration, workflow-level plugin hooks (beforeWorkflow/afterWorkflow), gate steps, and step dependencies. Any occurrence of runTask import or call in orchestrator, command handler, or CLI entry point code must be reported as severity: critical.",severity:"mandatory"},{id:"R-AUDIT-006",description:"Agent mode-purpose coherence must be verified. A read-only agent whose purpose describes file writing is a critical finding because the adapter's tool set (Read/Glob/Grep only) makes the stated purpose impossible to fulfil.",severity:"mandatory"}],escalation_criteria:[{condition:"Target project has no LLM command integration to audit",action:"stop_and_report"},{condition:"Target project uses a completely different integration pattern (not agent-contracts stack)",action:"stop_and_report"}]},r9e={id:"llm-feature-implementer",role_name:"LLM Feature Implementer",purpose:'Expert implementation agent for the agent-contracts toolchain.\nAdds LLM-powered commands (audit, propose, explain, etc.) to CLI tools\nusing the three-layer stack:\n\n1. **agent-contracts** \u2014 DSL package. Defines agents, tasks, workflows,\n handoff types, guardrails, and guardrail policies in YAML. The\n `resolve()` function handles `$ref`, `extends`, and merge operators.\n Installed as a devDependency. CLI: `agent-contracts audit`.\n\n2. **agent-contracts-runtime** \u2014 Runtime bridge. Generates typed\n TypeScript contracts from DSL via Handlebars templates, then\n executes workflows through pluggable SDK adapters. Provides\n `runTask()`, `runWorkflow()`, `createRuntime()`, plugin system,\n and guardrail hooks. CLI: `agent-runtime generate|run|list|doctor`.\n\n3. **cli-contracts** \u2014 CLI contract package. Defines command-line\n interfaces in YAML (`cli-contract.yaml`): command sets, arguments,\n options, exit codes, stdout/stderr schemas, `x-agent` metadata,\n and `effects`. Generates typed Commander programs, Zod validators,\n and markdown docs. CLI: `cli-contracts init|generate|validate`.\n\nThe canonical integration pattern ("integrate-llm-commands") produces:\n- DSL definitions under `dsl/` (agents, tasks, workflows, handoff-types)\n- Pre-generated TypeScript contracts under `src/generated/dsl/`\n- Runtime integration module under `src/agents/` (orchestrator,\n context-builder, formatter, types)\n- CLI command handlers under `src/commands/`\n- Updated `cli-contract.yaml` with new commands and `x-agent` metadata\n',mode:"read-write",dispatch_only:!1,can_read_artifacts:[],can_write_artifacts:[],can_execute_tools:[],can_invoke_agents:[],can_return_handoffs:["implementation-result"],responsibilities:["Read and analyze the target project's cli-contract.yaml, package.json, tsconfig.json, and existing source code to understand the CLI structure, existing commands, component schemas, and TypeScript configuration.","Identify which LLM commands to add based on the user's description. Canonical command types: audit (semantic review), propose (structured proposal generation), explain (human-readable explanation of machine output).","Create the DSL directory structure: dsl/{project}-dsl.yaml (main entry with version:1, system block, $ref to sub-files), dsl/agents/{name}.yaml, dsl/tasks.yaml, dsl/handoff-types.yaml, dsl/agent-runtime.config.yaml.","Define agents with: role_name, purpose (domain expertise), mode (read-only for analysis agents), can_read_artifacts:[], can_write_artifacts:[], can_return_handoffs, responsibilities, constraints, rules (R-PREFIX-NNN format), escalation_criteria.","Define tasks with: description, target_agent, allowed_from_agents, workflow (must match a workflow ID), invocation_handoff, result_handoff, responsibilities, completion_criteria.","Define handoff types with: version:1, description, schema (JSON Schema). Result types should conform to AgentAuditResult shape (summary, riskLevel, findings[], recommendedActions[], metadata). Use $ref to cli-contract.yaml components/schemas as SSoT when possible; inline with SSoT comment as fallback.","Define workflows with trigger, entry_conditions, and steps (delegate or gate). Each delegate step references a task and from_agent. Gate steps pause for user approval.","Define guardrails (output-schema-conformance, domain-specific safety) and guardrail_policies grouping them with severity and action.","Create agent-runtime.config.yaml: dsl points to main DSL file, generated_dir points to src/generated/dsl.","Implement src/agents/types.ts: TaskId union type, AgentConfig interface (adapter, model, temperature), AgentOptions interface (dryRun, failOn), AgentRunResult interface (taskId, data, raw, prompt, dryRun, status, errorMessage, followUpsUsed, retriesUsed).","Implement src/agents/orchestrator.ts: createAdapter() with dynamic imports from agent-contracts-runtime/adapters/*, runAgentWorkflow() that imports runWorkflow from agent-contracts-runtime, loads generated registries (including workflowRegistry) from src/generated/dsl/index.js, and calls runWorkflow with registries. NEVER use runTask \u2014 it is a low-level internal API that bypasses workflow orchestration.","Implement src/agents/context-builder.ts: build{Command}Context() functions that transform CLI inputs into structured markdown prompts. Cap context at 16KB. Structure: # Request, ## Configuration, ## Target, ## Instructions.","Implement src/agents/formatter.ts: computeExitCode() mapping findings to exit codes via --fail-on threshold, formatResultText() with severity icons, formatResultJson() for structured output.","Create src/commands/{command}.ts handlers: load config, call context builder, call runAgentWorkflow, format output, compute exit code.","Update cli-contract.yaml: add command definitions with standard LLM options (--adapter, --model, --dry-run, --fail-on, --output, --report-format), exit codes (0, 1, 3, 10, 11, 12), x-agent metadata, and register AgentAuditResult/AgentFinding/AgentRecommendedAction in components/schemas.",'Add npm scripts: "dsl:generate" running agent-runtime generate --config dsl/agent-runtime.config.yaml. Add agent-contracts and agent-contracts-runtime as devDependencies. Add SDK packages as optional peerDependencies.'],constraints:["NEVER create custom adapter classes. Import from agent-contracts-runtime: ClaudeAgentSdkAdapter from agent-contracts-runtime/adapters/claude-agent-sdk, CursorSdkAdapter from agent-contracts-runtime/adapters/cursor-sdk, OpenAIAgentsSdkAdapter from agent-contracts-runtime/adapters/openai-agents-sdk, GeminiSdkAdapter from agent-contracts-runtime/adapters/gemini-sdk, MockAdapter from agent-contracts-runtime/adapters/mock.","NEVER call adapter.send() or adapter.sendExecution() directly. All LLM invocations must go through runWorkflow() imported from agent-contracts-runtime. NEVER use runTask() \u2014 it is a low-level internal API. runWorkflow() handles prompt building, handoff validation, retry/followUp, workflow DAG, and plugin hooks.",'Dynamic-import both agent-contracts-runtime and adapter packages. The tool must work without them installed (graceful degradation). Pattern: const RUNTIME = "agent-contracts-runtime"; try { const { runWorkflow } = await import(RUNTIME); } catch { exit(11); }',"LLM commands use --report-format (json|text|yaml) for output format. --format is reserved for deterministic commands. Never mix them.","Exit code convention: 0=success (no findings above threshold), 1=general error, 3=input validation/parse failed, 10=findings detected above --fail-on threshold, 11=agent-contracts-runtime not installed, 12=adapter initialization error (missing API key, etc.).","Standard LLM command options (all must be present): --adapter <name> (mock|cursor|claude|openai|gemini, default varies), --model <name> (optional override), --dry-run (output prompt without LLM call), --fail-on <level> (warning|error|critical, default error), --output/-o <file> (write to file instead of stdout), --report-format <fmt> (json|text|yaml, default json).","Result handoff schemas must extend the AgentAuditResult base shape: summary (string, required), riskLevel (enum: low|medium|high|critical, required), findings (AgentFinding[], required), recommendedActions (AgentRecommendedAction[], optional), metadata (object with tool, command, version, generatedAt, adapter, model fields, optional).","AgentFinding shape: id?, severity (info|warning|error|critical), category (domain vocabulary), target?, location?, message (required), recommendation?, confidence? (0-1), evidence? (array of {type,content,source}), details? (object).","AgentRecommendedAction shape: kind (run_command|edit_file|review|confirm| block|ignore), title (required), command?, target?, rationale?.","Main DSL entry must have version:1 and a system block with id and name. Without these, the generator produces numbered files instead of named ones.","Every task must have a workflow field matching a defined workflow ID. Every workflow step's from_agent must match a defined agent ID. can_read_artifacts and can_write_artifacts must be empty arrays ([]) when no artifact registry is defined.","agent-runtime.config.yaml format: dsl: ./{project}-dsl.yaml generated_dir: ../src/generated/dsl Optional: plugins (array of paths), recovery ({max_follow_ups, max_retries}).","runWorkflow (the ONLY API consumer projects should use): Overloads: (1) runWorkflow(adapter, workflowId, options, registries?) \u2014 legacy. (2) runWorkflow(adapter, invocation, registries?) \u2014 structured (preferred). WorkflowInvocation: { workflow, handoff?, user_request?, runtime? {maxFollowUps,maxRetries,timeoutMs,readonly, dryRun}, hooks? {onStepComplete,onGate,onOptionalStep}, context? {cwd,environment,artifacts,variables} }. WorkflowResult: { workflow_id, status (completed|escalated|gate_rejected|error), steps[], total_elapsed_ms, escalation_reason?, error_message? }. NEVER use runTask() \u2014 it is a low-level internal API.","Adapter constructors: MockAdapter({responses?, defaultLatencyMs?}), CursorSdkAdapter.create({apiKey, model?, cwd?, guardrailHooks?}) \u2014 async static, ClaudeAgentSdkAdapter({cwd?, model?, tools?, permissionMode?, maxTurns?, guardrailHooks?}), OpenAIAgentsSdkAdapter({model?, maxTurns?, guardrailHooks?, tools?, agentName?, signal?}), GeminiSdkAdapter({apiKey?, model?, systemInstruction?, temperature?, maxOutputTokens?, guardrailHooks?}).",'Generated contract imports: import { agentRegistry, taskRegistry, handoffSchemas, workflowRegistry } from "../generated/dsl/index.js". Pass these as registries to runWorkflow: { workflowRegistry, taskRegistry, agentRegistry, handoffSchemas }.',"Plugin interface (AgentPlugin): id (string), beforeTask?(taskId, context), afterTask?(taskId, outcome), contextEnhancer?(taskId, context), promptEnhancer?(taskId, prompt, context), promptBuilder?(args), customGuardrails?, beforeWorkflow?(workflowId, userRequest), afterWorkflow?(workflowId, result).","x-agent fields for LLM commands in cli-contract.yaml: riskLevel (low for read-only analysis), requiresConfirmation (false for read-only), idempotent (true for analysis), sideEffects ([network]), sideEffectNote (describe network call and optional file write), safeDryRunOption (dry-run), expectedDurationMs (120000 typical), retryableExitCodes ([1, 12])."],rules:[{id:"R-IMPL-001",description:"Import SDK adapters exclusively from agent-contracts-runtime/adapters/*. Never create adapter classes, wrapper functions, or API client code.",severity:"mandatory"},{id:"R-IMPL-002",description:"All LLM invocations must use runWorkflow() from agent-contracts-runtime. NEVER use runTask() \u2014 it is a low-level internal API that bypasses workflow orchestration. Never call adapter.send(), adapter.followUp(), or adapter.sendExecution() directly. The runtime handles prompt building, schema validation, retry, followUp, workflow DAG, and plugin hooks.",severity:"mandatory"},{id:"R-IMPL-003",description:"Every LLM command in cli-contract.yaml must have x-agent metadata with at minimum: riskLevel, safeDryRunOption, expectedDurationMs.",severity:"mandatory"},{id:"R-IMPL-004",description:"Handoff type schemas must use $ref to cli-contract.yaml components/schemas as SSoT. If $ref resolution fails at generate time, inline the schema and add a YAML comment noting the SSoT path.",severity:"mandatory"},{id:"R-IMPL-005",description:"Context builder must cap prompt input at 16KB. Filter large contexts (schema dumps, lint output, etc.) to relevant portions before inclusion.",severity:"recommended"},{id:"R-IMPL-006",description:'The orchestrator must dynamic-import agent-contracts-runtime as a single string variable (const PKG = "agent-contracts-runtime") to enable graceful degradation. Exit with code 11 when the import fails, code 12 when the adapter fails to initialize.',severity:"mandatory"},{id:"R-IMPL-007",description:"Generated DSL contracts must be imported from src/generated/dsl/index.js and passed as registries to runWorkflow. Never hard-code agent definitions, task definitions, or handoff schemas in application code.",severity:"mandatory"}],escalation_criteria:[{condition:"Target project has no cli-contract.yaml and user did not request creating one",action:"stop_and_report"},{condition:"Target project is not a TypeScript / Node.js stack",action:"stop_and_report"},{condition:"Target project already has src/agents/ with a different integration pattern",action:"stop_and_report"}]},Tl={"implementation-auditor":t9e,"llm-feature-implementer":r9e};var n9e={id:"implement-llm-feature",description:`Implement LLM-powered commands in a target CLI tool using the
3108
3110
  agent-contracts + agent-contracts-runtime + cli-contracts stack.
3109
3111
 
3110
3112
  ## Implementation Procedure
@@ -3498,7 +3500,7 @@ Add "Agent-Native Toolchain" section after mechanical features:
3498
3500
  - Structured findings (AgentAuditResult/AgentFinding)
3499
3501
  - LLM Adapter Configuration table
3500
3502
  - Add agent-contracts-runtime, agent-contracts, cli-contracts to Technology Stack
3501
- `,target_agent:"llm-feature-implementer",allowed_from_agents:["llm-feature-implementer"],workflow:"implement-llm-feature",invocation_handoff:"implement-request",result_handoff:"implementation-result",input_artifacts:[],responsibilities:["Analyze the target project and determine the right LLM commands to add","Create all DSL definition files with correct cross-references","Generate TypeScript contracts via agent-runtime generate","Implement the complete src/agents/ module following the exact patterns","Create CLI command handlers integrating with the project's existing CLI structure","Update cli-contract.yaml with proper x-agent metadata and component schemas","Ensure the implementation compiles and --dry-run mode works"],completion_criteria:["dsl/ directory contains valid DSL definitions that pass agent-runtime generate","agent-runtime.config.yaml points to the DSL with correct generated_dir","src/generated/dsl/ contains generated contracts (agentRegistry, taskRegistry, handoffSchemas, workflowRegistry)","src/agents/orchestrator.ts uses runWorkflow from agent-contracts-runtime (never runTask directly, no direct adapter.send calls)","src/agents/orchestrator.ts dynamic-imports the runtime and adapters with correct exit codes (11, 12)","src/agents/context-builder.ts contains only domain data (file contents, config, scan results) \u2014 no hardcoded agent instructions, evaluation criteria, or output format specs","src/agents/context-builder.ts caps input at 16KB","src/agents/formatter.ts implements computeExitCode with the standard exit code mapping","src/commands/ has a handler for each new LLM command, passing cwd to AgentConfig","CLI entry point uses cli-contracts' createProgram(handlers, version) with CommandHandlers interface","cli-contract.yaml has all new commands with --adapter, --model, --dry-run, --fail-on, --output, --report-format options","cli-contract.yaml has x-agent metadata on each new command (riskLevel, safeDryRunOption, expectedDurationMs)","components/schemas includes AgentAuditResult and related schemas","All generated TypeScript compiles without type errors","--dry-run returns the constructed prompt without calling the LLM"],optional:!1},t9e={id:"audit-dsl",description:`Audit the DSL layer of an LLM command integration.
3503
+ `,target_agent:"llm-feature-implementer",allowed_from_agents:["llm-feature-implementer"],workflow:"implement-llm-feature",invocation_handoff:"implement-request",result_handoff:"implementation-result",input_artifacts:[],responsibilities:["Analyze the target project and determine the right LLM commands to add","Create all DSL definition files with correct cross-references","Generate TypeScript contracts via agent-runtime generate","Implement the complete src/agents/ module following the exact patterns","Create CLI command handlers integrating with the project's existing CLI structure","Update cli-contract.yaml with proper x-agent metadata and component schemas","Ensure the implementation compiles and --dry-run mode works"],completion_criteria:["dsl/ directory contains valid DSL definitions that pass agent-runtime generate","agent-runtime.config.yaml points to the DSL with correct generated_dir","src/generated/dsl/ contains generated contracts (agentRegistry, taskRegistry, handoffSchemas, workflowRegistry)","src/agents/orchestrator.ts uses runWorkflow from agent-contracts-runtime (never runTask directly, no direct adapter.send calls)","src/agents/orchestrator.ts dynamic-imports the runtime and adapters with correct exit codes (11, 12)","src/agents/context-builder.ts contains only domain data (file contents, config, scan results) \u2014 no hardcoded agent instructions, evaluation criteria, or output format specs","src/agents/context-builder.ts caps input at 16KB","src/agents/formatter.ts implements computeExitCode with the standard exit code mapping","src/commands/ has a handler for each new LLM command, passing cwd to AgentConfig","CLI entry point uses cli-contracts' createProgram(handlers, version) with CommandHandlers interface","cli-contract.yaml has all new commands with --adapter, --model, --dry-run, --fail-on, --output, --report-format options","cli-contract.yaml has x-agent metadata on each new command (riskLevel, safeDryRunOption, expectedDurationMs)","components/schemas includes AgentAuditResult and related schemas","All generated TypeScript compiles without type errors","--dry-run returns the constructed prompt without calling the LLM"],optional:!1},i9e={id:"audit-dsl",description:`Audit the DSL layer of an LLM command integration.
3502
3504
 
3503
3505
  Verify these files exist and are well-formed:
3504
3506
  - dsl/{project}-dsl.yaml \u2014 must have version:1, system:{id,name},
@@ -3534,7 +3536,7 @@ Category vocabulary: dsl-structure, dsl-agent, dsl-task,
3534
3536
  dsl-handoff, dsl-workflow, dsl-guardrail.
3535
3537
 
3536
3538
  Output a partial audit-result with findings only from the DSL layer.
3537
- `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Check all DSL files for structural correctness","Validate cross-references (agent\u2194task\u2194workflow\u2194handoff)","Verify guardrails and guardrail_policies","Check agent mode-purpose coherence (read-only agents must not have write-oriented purposes; read-write agents must justify their write permissions in their purpose)"],completion_criteria:["Every dsl/* file checked for required fields","Cross-references validated","Agent mode is consistent with stated purpose and responsibilities","Findings use dsl-* category vocabulary"],optional:!1},r9e={id:"audit-runtime",description:`Audit the runtime integration layer of an LLM command integration.
3539
+ `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Check all DSL files for structural correctness","Validate cross-references (agent\u2194task\u2194workflow\u2194handoff)","Verify guardrails and guardrail_policies","Check agent mode-purpose coherence (read-only agents must not have write-oriented purposes; read-write agents must justify their write permissions in their purpose)"],completion_criteria:["Every dsl/* file checked for required fields","Cross-references validated","Agent mode is consistent with stated purpose and responsibilities","Findings use dsl-* category vocabulary"],optional:!1},a9e={id:"audit-runtime",description:`Audit the runtime integration layer of an LLM command integration.
3538
3540
 
3539
3541
  Scan src/agents/orchestrator.ts (or equivalent runtime module):
3540
3542
 
@@ -3579,7 +3581,7 @@ Category vocabulary: runtime-orchestrator, runtime-registry,
3579
3581
  runtime-adapter, runtime-handler, runtime-plugin.
3580
3582
 
3581
3583
  Output a partial audit-result with findings only from the runtime layer.
3582
- `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Scan orchestrator code for direct adapter usage","Verify runWorkflow is used (not runTask) for LLM command execution","Verify registry imports and passing","Check adapter creation patterns and exit codes","Verify cli-contracts handler wiring (CommandHandlers + createProgram used in CLI entry point)"],completion_criteria:["All orchestrator files scanned for adapter.send / adapter.followUp","No runTask usage found (runWorkflow must be used instead)","Registry usage verified","Exit code 11/12 patterns checked","cli-contracts handler integration verified (CommandHandlers interface used, createProgram called)"],optional:!1},n9e={id:"audit-cli-contract",description:`Audit the CLI contract layer of an LLM command integration.
3584
+ `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Scan orchestrator code for direct adapter usage","Verify runWorkflow is used (not runTask) for LLM command execution","Verify registry imports and passing","Check adapter creation patterns and exit codes","Verify cli-contracts handler wiring (CommandHandlers + createProgram used in CLI entry point)"],completion_criteria:["All orchestrator files scanned for adapter.send / adapter.followUp","No runTask usage found (runWorkflow must be used instead)","Registry usage verified","Exit code 11/12 patterns checked","cli-contracts handler integration verified (CommandHandlers interface used, createProgram called)"],optional:!1},o9e={id:"audit-cli-contract",description:`Audit the CLI contract layer of an LLM command integration.
3583
3585
 
3584
3586
  Parse cli-contract.yaml and check each LLM command:
3585
3587
 
@@ -3604,7 +3606,7 @@ Category vocabulary: cli-contract-options, cli-contract-xagent,
3604
3606
  cli-contract-exits, cli-contract-schema.
3605
3607
 
3606
3608
  Output a partial audit-result with findings only from the CLI contract layer.
3607
- `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Check each LLM command for standard options","Verify x-agent metadata fields and casing","Validate exit code definitions","Check components/schemas for canonical types"],completion_criteria:["Every LLM command checked for all 6 standard options","x-agent metadata validated on every LLM command","Exit codes verified against convention","Schema completeness checked"],optional:!1},i9e={id:"audit-architecture",description:`Audit the architecture and module structure of an LLM command integration.
3609
+ `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Check each LLM command for standard options","Verify x-agent metadata fields and casing","Validate exit code definitions","Check components/schemas for canonical types"],completion_criteria:["Every LLM command checked for all 6 standard options","x-agent metadata validated on every LLM command","Exit codes verified against convention","Schema completeness checked"],optional:!1},s9e={id:"audit-architecture",description:`Audit the architecture and module structure of an LLM command integration.
3608
3610
 
3609
3611
  Verify module structure (category: architecture-modules):
3610
3612
  - src/agents/types.ts exists with TaskId, AgentConfig, AgentOptions, AgentRunResult
@@ -3690,7 +3692,7 @@ architecture-adapter-cwd, architecture-handler,
3690
3692
  architecture-formatter.
3691
3693
 
3692
3694
  Output a partial audit-result with findings only from the architecture layer.
3693
- `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Verify module structure","Check dry-run behavior","Audit context-builder for SSoT violations (hardcoded instructions, output format specs, domain rules that belong in DSL)","Check mode-purpose coherence across DSL definitions and runtime code","Verify cwd propagation from command handler through adapter config","Verify cli-contracts handler wiring (CommandHandlers + createProgram)","Scan for direct SDK imports"],completion_criteria:["Module structure verified","Dry-run behavior confirmed","Context-builder contains only domain data, not agent instructions","Agent mode is consistent with purpose and tool usage","cwd is propagated to agentic adapters","cli-contracts handler integration verified","No direct SDK imports outside adapter files"],optional:!1},a9e={id:"audit-merge",description:`Merge the partial audit results from the four parallel layer audits
3695
+ `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Verify module structure","Check dry-run behavior","Audit context-builder for SSoT violations (hardcoded instructions, output format specs, domain rules that belong in DSL)","Check mode-purpose coherence across DSL definitions and runtime code","Verify cwd propagation from command handler through adapter config","Verify cli-contracts handler wiring (CommandHandlers + createProgram)","Scan for direct SDK imports"],completion_criteria:["Module structure verified","Dry-run behavior confirmed","Context-builder contains only domain data, not agent instructions","Agent mode is consistent with purpose and tool usage","cwd is propagated to agentic adapters","cli-contracts handler integration verified","No direct SDK imports outside adapter files"],optional:!1},l9e={id:"audit-merge",description:`Merge the partial audit results from the four parallel layer audits
3694
3696
  (DSL, runtime, CLI contract, architecture) into a single unified
3695
3697
  audit-result.
3696
3698
 
@@ -3709,7 +3711,7 @@ Merging rules:
3709
3711
  any warning \u2192 medium, info only \u2192 low
3710
3712
  - Merge recommendedActions from all layers, deduplicate by title
3711
3713
  - Set metadata: { tool: "agent-runtime", command: "audit-implementation" }
3712
- `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Parse prior_context JSON from each layer audit step","Merge and deduplicate findings","Derive overall riskLevel","Produce a single coherent summary paragraph"],completion_criteria:["All findings from all layers included","No duplicate findings","riskLevel correctly derived from worst finding","Summary paragraph covers all audited layers"],optional:!1},Rl={"implement-llm-feature":e9e,"audit-dsl":t9e,"audit-runtime":r9e,"audit-cli-contract":n9e,"audit-architecture":i9e,"audit-merge":a9e};qr();var o9e=C.object({description:C.string(),project_dir:C.string(),reference_doc:C.string().optional()}),s9e=C.object({project_dir:C.string(),focus:C.enum(["all","dsl","runtime","cli-contract","architecture"]).optional()}),l9e=C.object({summary:C.string(),riskLevel:C.enum(["low","medium","high","critical"]),findings:C.array(C.object({id:C.string().optional(),severity:C.enum(["info","warning","error","critical"]),category:C.string(),target:C.string().optional(),location:C.string().optional(),message:C.string(),recommendation:C.string().optional(),confidence:C.number().min(0).max(1).optional()})),recommendedActions:C.array(C.object({kind:C.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:C.string(),command:C.string().optional(),target:C.string().optional(),rationale:C.string().optional()})).optional(),metadata:C.object({tool:C.string().optional(),command:C.string().optional(),version:C.string().optional(),generatedAt:C.string().optional(),adapter:C.string().optional(),model:C.string().optional()}).optional()}),u9e=C.object({files_created:C.array(C.string()),files_modified:C.array(C.string()),summary:C.string(),commands_added:C.array(C.object({name:C.string(),type:C.enum(["audit","propose","explain"]),description:C.string().optional()})).optional(),next_steps:C.array(C.string()).optional()}),Dl={"implement-request":o9e,"audit-request":s9e,"audit-result":l9e,"implementation-result":u9e};var c9e={id:"implement-llm-feature",description:"Implement LLM-powered commands in a CLI tool",trigger:"cli-command",entry_conditions:["Target project is a TypeScript / Node.js project","cli-contract.yaml exists or is being created"],steps:[{type:"delegate",task:"implement-llm-feature",from_agent:"llm-feature-implementer",description:"",optional:!1,max_retries:0}]},d9e={id:"audit-implementation",description:"Audit an LLM command integration for pattern conformance",trigger:"cli-command",entry_conditions:["Target project has LLM command integration to audit"],steps:[{type:"delegate",task:"audit-dsl",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-runtime",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-cli-contract",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-architecture",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-merge",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:["audit-dsl","audit-runtime","audit-cli-contract","audit-architecture"]}]},Ef={"implement-llm-feature":c9e,"audit-implementation":d9e};var Iv={version:1,system:{id:"agent-runtime-builtin",name:"agent-runtime Built-in Agents",default_workflow_order:["implement-llm-feature","audit-implementation"]},agents:{"implementation-auditor":{role_name:"Implementation Auditor",purpose:`Audits an existing LLM command integration to verify it correctly
3714
+ `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",invocation_handoff:"audit-request",result_handoff:"audit-result",input_artifacts:[],responsibilities:["Parse prior_context JSON from each layer audit step","Merge and deduplicate findings","Derive overall riskLevel","Produce a single coherent summary paragraph"],completion_criteria:["All findings from all layers included","No duplicate findings","riskLevel correctly derived from worst finding","Summary paragraph covers all audited layers"],optional:!1},Rl={"implement-llm-feature":n9e,"audit-dsl":i9e,"audit-runtime":a9e,"audit-cli-contract":o9e,"audit-architecture":s9e,"audit-merge":l9e};qr();var u9e=C.object({description:C.string(),project_dir:C.string(),reference_doc:C.string().optional()}),c9e=C.object({project_dir:C.string(),focus:C.enum(["all","dsl","runtime","cli-contract","architecture"]).optional()}),d9e=C.object({summary:C.string(),riskLevel:C.enum(["low","medium","high","critical"]),findings:C.array(C.object({id:C.string().optional(),severity:C.enum(["info","warning","error","critical"]),category:C.string(),target:C.string().optional(),location:C.string().optional(),message:C.string(),recommendation:C.string().optional(),confidence:C.number().min(0).max(1).optional()})),recommendedActions:C.array(C.object({kind:C.enum(["run_command","edit_file","review","confirm","block","ignore"]),title:C.string(),command:C.string().optional(),target:C.string().optional(),rationale:C.string().optional()})).optional(),metadata:C.object({tool:C.string().optional(),command:C.string().optional(),version:C.string().optional(),generatedAt:C.string().optional(),adapter:C.string().optional(),model:C.string().optional()}).optional()}),p9e=C.object({files_created:C.array(C.string()),files_modified:C.array(C.string()),summary:C.string(),commands_added:C.array(C.object({name:C.string(),type:C.enum(["audit","propose","explain"]),description:C.string().optional()})).optional(),next_steps:C.array(C.string()).optional()}),Dl={"implement-request":u9e,"audit-request":c9e,"audit-result":d9e,"implementation-result":p9e};var f9e={id:"implement-llm-feature",description:"Implement LLM-powered commands in a CLI tool",trigger:"cli-command",entry_conditions:["Target project is a TypeScript / Node.js project","cli-contract.yaml exists or is being created"],steps:[{type:"delegate",task:"implement-llm-feature",from_agent:"llm-feature-implementer",description:"",optional:!1,max_retries:0}]},m9e={id:"audit-implementation",description:"Audit an LLM command integration for pattern conformance",trigger:"cli-command",entry_conditions:["Target project has LLM command integration to audit"],steps:[{type:"delegate",task:"audit-dsl",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-runtime",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-cli-contract",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-architecture",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:[]},{type:"delegate",task:"audit-merge",from_agent:"implementation-auditor",description:"",optional:!1,max_retries:0,depends_on:["audit-dsl","audit-runtime","audit-cli-contract","audit-architecture"]}]},Ef={"implement-llm-feature":f9e,"audit-implementation":m9e};var Iv={version:1,system:{id:"agent-runtime-builtin",name:"agent-runtime Built-in Agents",default_workflow_order:["implement-llm-feature","audit-implementation"]},agents:{"implementation-auditor":{role_name:"Implementation Auditor",purpose:`Audits an existing LLM command integration to verify it correctly
3713
3715
  follows the agent-contracts + agent-contracts-runtime + cli-contracts
3714
3716
  stack conventions. Detects architectural violations, missing patterns,
3715
3717
  incorrect API usage, and deviations from the canonical
@@ -4374,24 +4376,24 @@ Merging rules:
4374
4376
  any warning \u2192 medium, info only \u2192 low
4375
4377
  - Merge recommendedActions from all layers, deduplicate by title
4376
4378
  - Set metadata: { tool: "agent-runtime", command: "audit-implementation" }
4377
- `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",input_artifacts:[],invocation_handoff:"audit-request",result_handoff:"audit-result",responsibilities:["Parse prior_context JSON from each layer audit step","Merge and deduplicate findings","Derive overall riskLevel","Produce a single coherent summary paragraph"],completion_criteria:["All findings from all layers included","No duplicate findings","riskLevel correctly derived from worst finding","Summary paragraph covers all audited layers"]}},handoff_types:{"implement-request":{version:1,description:"Request to implement LLM-powered features in a CLI tool",schema:{type:"object",required:["description","project_dir"],properties:{description:{type:"string",description:"Description of the LLM feature(s) to implement"},project_dir:{type:"string",description:"Absolute path to the target project directory"},reference_doc:{type:"string",description:"Content of the integrate-llm-commands reference documentation"}}}},"audit-request":{version:1,description:"Request to audit an LLM command integration",schema:{type:"object",required:["project_dir"],properties:{project_dir:{type:"string",description:"Absolute path to the target project directory"},focus:{type:"string",description:"Optional focus area (dsl, runtime, cli-contract, architecture, or all). Defaults to all.",enum:["all","dsl","runtime","cli-contract","architecture"]}}}},"audit-result":{version:1,description:"Structured audit result following AgentAuditResult shape. Conforms to cli-contracts reference schema.",schema:{type:"object",required:["summary","riskLevel","findings"],properties:{summary:{type:"string",description:"One-paragraph overall assessment"},riskLevel:{type:"string",enum:["low","medium","high","critical"],description:"Derived from worst finding: any critical \u2192 critical, any error \u2192 high, any warning \u2192 medium, info only \u2192 low"},findings:{type:"array",items:{type:"object",required:["severity","category","message"],properties:{id:{type:"string",description:"Unique finding identifier (e.g. AUDIT-001)"},severity:{type:"string",enum:["info","warning","error","critical"]},category:{type:"string",description:"One of: dsl-structure, dsl-agent, dsl-task, dsl-handoff, dsl-workflow, dsl-guardrail, runtime-adapter, runtime-orchestrator, runtime-registry, runtime-handler, runtime-plugin, cli-contract-options, cli-contract-xagent, cli-contract-exits, cli-contract-schema, architecture-modules, architecture-dry-run, architecture-context-builder, architecture-agent-coherence, architecture-adapter-cwd, architecture-handler, architecture-formatter"},target:{type:"string",description:"File path where the issue was found"},location:{type:"string",description:"Line number or section within the file"},message:{type:"string",description:"Concise description of the issue"},recommendation:{type:"string",description:"Concrete fix or remediation step"},confidence:{type:"number",minimum:0,maximum:1,description:"1.0 for pattern match, 0.8+ for structural check, 0.5-0.8 for heuristic assessment"}}}},recommendedActions:{type:"array",items:{type:"object",required:["kind","title"],properties:{kind:{type:"string",enum:["run_command","edit_file","review","confirm","block","ignore"]},title:{type:"string"},command:{type:"string",description:"CLI command to run (for run_command kind)"},target:{type:"string",description:"Target file or resource"},rationale:{type:"string"}}}},metadata:{type:"object",properties:{tool:{type:"string"},command:{type:"string"},version:{type:"string"},generatedAt:{type:"string"},adapter:{type:"string"},model:{type:"string"}}}}}},"implementation-result":{version:1,description:"Result of the LLM feature implementation",schema:{type:"object",required:["files_created","files_modified","summary"],properties:{files_created:{type:"array",items:{type:"string"},description:"List of newly created files"},files_modified:{type:"array",items:{type:"string"},description:"List of modified existing files"},summary:{type:"string",description:"Human-readable summary of the implementation"},commands_added:{type:"array",items:{type:"object",required:["name","type"],properties:{name:{type:"string",description:"Command name"},type:{type:"string",enum:["audit","propose","explain"],description:"Command type"},description:{type:"string",description:"Command description"}}}},next_steps:{type:"array",items:{type:"string"},description:"Recommended next steps for the developer"}}}}},guardrails:{"output-schema-conformance":{description:"Ensure all agent outputs conform to their respective handoff schemas. Validation is performed at runtime via Zod.",scope:{agents:["llm-feature-implementer","implementation-auditor"],tasks:["implement-llm-feature","audit-dsl","audit-runtime","audit-cli-contract","audit-architecture","audit-merge"]},rationale:"Structured output conformance is critical for CLI parsing and downstream tooling integration."},"no-direct-api-call":{description:"The implementer agent must not generate code that calls LLM APIs directly. All LLM invocations must go through agent-contracts-runtime runWorkflow().",scope:{agents:["llm-feature-implementer"]},rationale:"Preserves SDK adapter abstraction, enabling adapter swap, plugin hooks, and guardrail enforcement."},"audit-read-only":{description:"The auditor agent must not create, modify, or delete any files. It operates in read-only mode and produces findings only.",scope:{agents:["implementation-auditor"]},rationale:"Audit results must be reviewed by the developer before changes are applied. The auditor observes; the developer decides."}},guardrail_policies:{"implement-safety-policy":{description:"Guardrail policy for the LLM feature implementation agent",rules:[{guardrail:"output-schema-conformance",severity:"critical",action:"block"},{guardrail:"no-direct-api-call",severity:"critical",action:"block"}]},"audit-safety-policy":{description:"Guardrail policy for the implementation auditor agent",rules:[{guardrail:"output-schema-conformance",severity:"critical",action:"block"},{guardrail:"audit-read-only",severity:"critical",action:"block"}]}},workflow:{"implement-llm-feature":{description:"Implement LLM-powered commands in a CLI tool",trigger:"cli-command",entry_conditions:["Target project is a TypeScript / Node.js project","cli-contract.yaml exists or is being created"],steps:[{type:"delegate",task:"implement-llm-feature",from_agent:"llm-feature-implementer"}]},"audit-implementation":{description:"Audit an LLM command integration for pattern conformance",trigger:"cli-command",entry_conditions:["Target project has LLM command integration to audit"],steps:[{type:"delegate",task:"audit-dsl",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-runtime",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-cli-contract",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-architecture",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-merge",from_agent:"implementation-auditor",depends_on:["audit-dsl","audit-runtime","audit-cli-contract","audit-architecture"]}]}}};function y9e(){return process.env.LANG?.split(".")[0]??process.env.LC_ALL?.split(".")[0]??process.env.LANGUAGE?.split(":")[0]??"en_US"}function _9e(){return y9e().startsWith("ja")}var w9e={noProjectDir:t=>`Project directory not found: ${t}`,adapterError:t=>`Adapter initialization failed: ${t}`,dryRunHeader:"=== Dry Run ===",dryRunProjectDir:t=>`Project: ${t}`,dryRunDescription:t=>`Description: ${t}`,dryRunRefIncluded:"Reference: integrate-llm-commands (included)",dryRunRefNotFound:"Reference: integrate-llm-commands (not found, will proceed without)",implementStarting:t=>`Starting implementation with ${t} adapter...`,implementSuccess:"Implementation completed successfully.",implementFailed:t=>`Implementation failed: ${t}`,filesCreated:"Files created:",filesModified:"Files modified:",commandsAdded:"Commands added:",nextSteps:"Next steps:"},b9e={noProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${t}`,adapterError:t=>`\u30A2\u30C0\u30D7\u30BF\u30FC\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,dryRunHeader:"=== \u30C9\u30E9\u30A4\u30E9\u30F3 ===",dryRunProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${t}`,dryRunDescription:t=>`\u8AAC\u660E: ${t}`,dryRunRefIncluded:"\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9: integrate-llm-commands\uFF08\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF09",dryRunRefNotFound:"\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9: integrate-llm-commands\uFF08\u672A\u691C\u51FA\u3001\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u306A\u3057\u3067\u7D9A\u884C\uFF09",implementStarting:t=>`${t} \u30A2\u30C0\u30D7\u30BF\u30FC\u3067\u5B9F\u88C5\u3092\u958B\u59CB\u3057\u307E\u3059...`,implementSuccess:"\u5B9F\u88C5\u304C\u6B63\u5E38\u306B\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002",implementFailed:t=>`\u5B9F\u88C5\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,filesCreated:"\u4F5C\u6210\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB:",filesModified:"\u5909\u66F4\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB:",commandsAdded:"\u8FFD\u52A0\u3055\u308C\u305F\u30B3\u30DE\u30F3\u30C9:",nextSteps:"\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"};function rV(){return _9e()?b9e:w9e}function S9e(){let t=[eV(v9e(import.meta.url),"..","..","..","templates","implement-reference.md"),eV(process.env.HOME??"",".cursor","skills","integrate-llm-commands","SKILL.md")];for(let e of t)try{if(tV(e))return h9e(e,"utf8")}catch{}}async function k9e(t,e,r){switch(t){case"claude":{let{ClaudeAgentSdkAdapter:i}=await Promise.resolve().then(()=>(jv(),Cv));return new i({cwd:e,permissionMode:"bypassPermissions",model:r})}case"cursor":{let{CursorSdkAdapter:i}=await Promise.resolve().then(()=>(Rv(),Tv)),n=process.env.CURSOR_API_KEY;if(!n)throw new Error("CURSOR_API_KEY environment variable is required for the cursor adapter");return i.create({apiKey:n,cwd:e,model:r})}case"mock":{let{MockAdapter:i}=await Promise.resolve().then(()=>(Nv(),Dv));return new i}default:throw new Error(`Unsupported adapter for implement: "${t}". Available: claude, cursor, mock`)}}async function nV(t,e){let r=rV(),i=g9e(e.projectDir);if(!tV(i))return{status:"failed",exitCode:3,error:r.noProjectDir(i)};let n=S9e(),a=[t,"",`Project directory: ${i}`].join(`
4379
+ `,target_agent:"implementation-auditor",allowed_from_agents:["implementation-auditor"],workflow:"audit-implementation",input_artifacts:[],invocation_handoff:"audit-request",result_handoff:"audit-result",responsibilities:["Parse prior_context JSON from each layer audit step","Merge and deduplicate findings","Derive overall riskLevel","Produce a single coherent summary paragraph"],completion_criteria:["All findings from all layers included","No duplicate findings","riskLevel correctly derived from worst finding","Summary paragraph covers all audited layers"]}},handoff_types:{"implement-request":{version:1,description:"Request to implement LLM-powered features in a CLI tool",schema:{type:"object",required:["description","project_dir"],properties:{description:{type:"string",description:"Description of the LLM feature(s) to implement"},project_dir:{type:"string",description:"Absolute path to the target project directory"},reference_doc:{type:"string",description:"Content of the integrate-llm-commands reference documentation"}}}},"audit-request":{version:1,description:"Request to audit an LLM command integration",schema:{type:"object",required:["project_dir"],properties:{project_dir:{type:"string",description:"Absolute path to the target project directory"},focus:{type:"string",description:"Optional focus area (dsl, runtime, cli-contract, architecture, or all). Defaults to all.",enum:["all","dsl","runtime","cli-contract","architecture"]}}}},"audit-result":{version:1,description:"Structured audit result following AgentAuditResult shape. Conforms to cli-contracts reference schema.",schema:{type:"object",required:["summary","riskLevel","findings"],properties:{summary:{type:"string",description:"One-paragraph overall assessment"},riskLevel:{type:"string",enum:["low","medium","high","critical"],description:"Derived from worst finding: any critical \u2192 critical, any error \u2192 high, any warning \u2192 medium, info only \u2192 low"},findings:{type:"array",items:{type:"object",required:["severity","category","message"],properties:{id:{type:"string",description:"Unique finding identifier (e.g. AUDIT-001)"},severity:{type:"string",enum:["info","warning","error","critical"]},category:{type:"string",description:"One of: dsl-structure, dsl-agent, dsl-task, dsl-handoff, dsl-workflow, dsl-guardrail, runtime-adapter, runtime-orchestrator, runtime-registry, runtime-handler, runtime-plugin, cli-contract-options, cli-contract-xagent, cli-contract-exits, cli-contract-schema, architecture-modules, architecture-dry-run, architecture-context-builder, architecture-agent-coherence, architecture-adapter-cwd, architecture-handler, architecture-formatter"},target:{type:"string",description:"File path where the issue was found"},location:{type:"string",description:"Line number or section within the file"},message:{type:"string",description:"Concise description of the issue"},recommendation:{type:"string",description:"Concrete fix or remediation step"},confidence:{type:"number",minimum:0,maximum:1,description:"1.0 for pattern match, 0.8+ for structural check, 0.5-0.8 for heuristic assessment"}}}},recommendedActions:{type:"array",items:{type:"object",required:["kind","title"],properties:{kind:{type:"string",enum:["run_command","edit_file","review","confirm","block","ignore"]},title:{type:"string"},command:{type:"string",description:"CLI command to run (for run_command kind)"},target:{type:"string",description:"Target file or resource"},rationale:{type:"string"}}}},metadata:{type:"object",properties:{tool:{type:"string"},command:{type:"string"},version:{type:"string"},generatedAt:{type:"string"},adapter:{type:"string"},model:{type:"string"}}}}}},"implementation-result":{version:1,description:"Result of the LLM feature implementation",schema:{type:"object",required:["files_created","files_modified","summary"],properties:{files_created:{type:"array",items:{type:"string"},description:"List of newly created files"},files_modified:{type:"array",items:{type:"string"},description:"List of modified existing files"},summary:{type:"string",description:"Human-readable summary of the implementation"},commands_added:{type:"array",items:{type:"object",required:["name","type"],properties:{name:{type:"string",description:"Command name"},type:{type:"string",enum:["audit","propose","explain"],description:"Command type"},description:{type:"string",description:"Command description"}}}},next_steps:{type:"array",items:{type:"string"},description:"Recommended next steps for the developer"}}}}},guardrails:{"output-schema-conformance":{description:"Ensure all agent outputs conform to their respective handoff schemas. Validation is performed at runtime via Zod.",scope:{agents:["llm-feature-implementer","implementation-auditor"],tasks:["implement-llm-feature","audit-dsl","audit-runtime","audit-cli-contract","audit-architecture","audit-merge"]},rationale:"Structured output conformance is critical for CLI parsing and downstream tooling integration."},"no-direct-api-call":{description:"The implementer agent must not generate code that calls LLM APIs directly. All LLM invocations must go through agent-contracts-runtime runWorkflow().",scope:{agents:["llm-feature-implementer"]},rationale:"Preserves SDK adapter abstraction, enabling adapter swap, plugin hooks, and guardrail enforcement."},"audit-read-only":{description:"The auditor agent must not create, modify, or delete any files. It operates in read-only mode and produces findings only.",scope:{agents:["implementation-auditor"]},rationale:"Audit results must be reviewed by the developer before changes are applied. The auditor observes; the developer decides."}},guardrail_policies:{"implement-safety-policy":{description:"Guardrail policy for the LLM feature implementation agent",rules:[{guardrail:"output-schema-conformance",severity:"critical",action:"block"},{guardrail:"no-direct-api-call",severity:"critical",action:"block"}]},"audit-safety-policy":{description:"Guardrail policy for the implementation auditor agent",rules:[{guardrail:"output-schema-conformance",severity:"critical",action:"block"},{guardrail:"audit-read-only",severity:"critical",action:"block"}]}},workflow:{"implement-llm-feature":{description:"Implement LLM-powered commands in a CLI tool",trigger:"cli-command",entry_conditions:["Target project is a TypeScript / Node.js project","cli-contract.yaml exists or is being created"],steps:[{type:"delegate",task:"implement-llm-feature",from_agent:"llm-feature-implementer"}]},"audit-implementation":{description:"Audit an LLM command integration for pattern conformance",trigger:"cli-command",entry_conditions:["Target project has LLM command integration to audit"],steps:[{type:"delegate",task:"audit-dsl",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-runtime",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-cli-contract",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-architecture",from_agent:"implementation-auditor",depends_on:[]},{type:"delegate",task:"audit-merge",from_agent:"implementation-auditor",depends_on:["audit-dsl","audit-runtime","audit-cli-contract","audit-architecture"]}]}}};function b9e(){return process.env.LANG?.split(".")[0]??process.env.LC_ALL?.split(".")[0]??process.env.LANGUAGE?.split(":")[0]??"en_US"}function S9e(){return b9e().startsWith("ja")}var k9e={noProjectDir:t=>`Project directory not found: ${t}`,adapterError:t=>`Adapter initialization failed: ${t}`,dryRunHeader:"=== Dry Run ===",dryRunProjectDir:t=>`Project: ${t}`,dryRunDescription:t=>`Description: ${t}`,dryRunRefIncluded:"Reference: integrate-llm-commands (included)",dryRunRefNotFound:"Reference: integrate-llm-commands (not found, will proceed without)",implementStarting:t=>`Starting implementation with ${t} adapter...`,implementSuccess:"Implementation completed successfully.",implementFailed:t=>`Implementation failed: ${t}`,filesCreated:"Files created:",filesModified:"Files modified:",commandsAdded:"Commands added:",nextSteps:"Next steps:"},x9e={noProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${t}`,adapterError:t=>`\u30A2\u30C0\u30D7\u30BF\u30FC\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,dryRunHeader:"=== \u30C9\u30E9\u30A4\u30E9\u30F3 ===",dryRunProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${t}`,dryRunDescription:t=>`\u8AAC\u660E: ${t}`,dryRunRefIncluded:"\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9: integrate-llm-commands\uFF08\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF09",dryRunRefNotFound:"\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9: integrate-llm-commands\uFF08\u672A\u691C\u51FA\u3001\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u306A\u3057\u3067\u7D9A\u884C\uFF09",implementStarting:t=>`${t} \u30A2\u30C0\u30D7\u30BF\u30FC\u3067\u5B9F\u88C5\u3092\u958B\u59CB\u3057\u307E\u3059...`,implementSuccess:"\u5B9F\u88C5\u304C\u6B63\u5E38\u306B\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002",implementFailed:t=>`\u5B9F\u88C5\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,filesCreated:"\u4F5C\u6210\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB:",filesModified:"\u5909\u66F4\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB:",commandsAdded:"\u8FFD\u52A0\u3055\u308C\u305F\u30B3\u30DE\u30F3\u30C9:",nextSteps:"\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:"};function rV(){return S9e()?x9e:k9e}function $9e(){let t=[eV(w9e(import.meta.url),"..","..","..","templates","implement-reference.md"),eV(process.env.HOME??"",".cursor","skills","integrate-llm-commands","SKILL.md")];for(let e of t)try{if(tV(e))return y9e(e,"utf8")}catch{}}async function E9e(t,e,r){switch(t){case"claude":{let{ClaudeAgentSdkAdapter:i}=await Promise.resolve().then(()=>(jv(),Cv));return new i({cwd:e,permissionMode:"bypassPermissions",model:r})}case"cursor":{let{CursorSdkAdapter:i}=await Promise.resolve().then(()=>(Rv(),Tv)),n=process.env.CURSOR_API_KEY;if(!n)throw new Error("CURSOR_API_KEY environment variable is required for the cursor adapter");return i.create({apiKey:n,cwd:e,model:r})}case"mock":{let{MockAdapter:i}=await Promise.resolve().then(()=>(Nv(),Dv));return new i}default:throw new Error(`Unsupported adapter for implement: "${t}". Available: claude, cursor, mock`)}}async function nV(t,e){let r=rV(),i=_9e(e.projectDir);if(!tV(i))return{status:"failed",exitCode:3,error:r.noProjectDir(i)};let n=$9e(),a=[t,"",`Project directory: ${i}`].join(`
4378
4380
  `),o={user_request:a,relevant_paths:[i]};if(n&&(o.prior_context=`# Reference: integrate-llm-commands pattern
4379
4381
 
4380
4382
  Follow this reference exactly when implementing LLM commands.
4381
4383
 
4382
- `+n),e.dryRun){let h=Tl["llm-feature-implementer"],g=Rl["implement-llm-feature"],v=Ba(h,g,o,{handoffSchemas:Dl});return{status:"dry_run",exitCode:0,data:{files_created:[],files_modified:[],summary:v}}}let s;try{s=await k9e(e.adapter,i,e.model)}catch(h){return{status:"failed",exitCode:12,error:r.adapterError(h.message)}}e.verbose||console.error(r.implementStarting(e.adapter));let l={workflowRegistry:Ef,taskRegistry:Rl,agentRegistry:Tl,handoffSchemas:Dl},u={workflow:"implement-llm-feature",user_request:a,runtime:{maxFollowUps:3,maxRetries:1},hooks:{onGate:async()=>!0},context:{cwd:i},progressOutput:e.progressOutput},c=await xo(s,u,l);if(c.status!=="completed"){let h=c.escalation_reason??c.error_message??c.status;return{status:"failed",exitCode:1,error:r.implementFailed(h)}}return{status:"success",exitCode:0,data:c.steps[c.steps.length-1]?.outcome?.data??{files_created:[],files_modified:[],summary:r.implementSuccess}}}function qS(t){let e=rV();if(t.status==="dry_run")return t.data?.summary??e.dryRunHeader;if(t.status==="failed")return t.error??e.implementFailed("unknown");let r=t.data;if(!r)return e.implementSuccess;let i=[r.summary,""];if(r.files_created.length>0){i.push(e.filesCreated);for(let n of r.files_created)i.push(` + ${n}`);i.push("")}if(r.files_modified.length>0){i.push(e.filesModified);for(let n of r.files_modified)i.push(` ~ ${n}`);i.push("")}if(r.commands_added&&r.commands_added.length>0){i.push(e.commandsAdded);for(let n of r.commands_added)i.push(` - ${n.name} [${n.type}]${n.description?` \u2014 ${n.description}`:""}`);i.push("")}if(r.next_steps&&r.next_steps.length>0){i.push(e.nextSteps);for(let n of r.next_steps)i.push(` ${n}`)}return i.join(`
4383
- `)}import{existsSync as x9e}from"node:fs";import{resolve as $9e}from"node:path";function E9e(){return process.env.LANG?.split(".")[0]??process.env.LC_ALL?.split(".")[0]??process.env.LANGUAGE?.split(":")[0]??"en_US"}function A9e(){return E9e().startsWith("ja")}var P9e={noProjectDir:t=>`Project directory not found: ${t}`,adapterError:t=>`Adapter initialization failed: ${t}`,dryRunHeader:"=== Dry Run (audit-implementation) ===",dryRunProjectDir:t=>`Project: ${t}`,dryRunFocus:t=>`Focus: ${t}`,auditStarting:t=>`Starting audit with ${t} adapter...`,auditSuccess:"Audit completed.",auditFailed:t=>`Audit failed: ${t}`,riskLevel:t=>`Risk level: ${t}`,findingsHeader:t=>`Findings (${t}):`,noFindings:"No findings.",recommendedActionsHeader:"Recommended actions:"},O9e={noProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${t}`,adapterError:t=>`\u30A2\u30C0\u30D7\u30BF\u30FC\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,dryRunHeader:"=== \u30C9\u30E9\u30A4\u30E9\u30F3 (audit-implementation) ===",dryRunProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${t}`,dryRunFocus:t=>`\u30D5\u30A9\u30FC\u30AB\u30B9: ${t}`,auditStarting:t=>`${t} \u30A2\u30C0\u30D7\u30BF\u30FC\u3067\u76E3\u67FB\u3092\u958B\u59CB\u3057\u307E\u3059...`,auditSuccess:"\u76E3\u67FB\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002",auditFailed:t=>`\u76E3\u67FB\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,riskLevel:t=>`\u30EA\u30B9\u30AF\u30EC\u30D9\u30EB: ${t}`,findingsHeader:t=>`\u691C\u51FA\u4E8B\u9805 (${t}\u4EF6):`,noFindings:"\u691C\u51FA\u4E8B\u9805\u306F\u3042\u308A\u307E\u305B\u3093\u3002",recommendedActionsHeader:"\u63A8\u5968\u30A2\u30AF\u30B7\u30E7\u30F3:"};function aV(){return A9e()?O9e:P9e}async function I9e(t,e,r){switch(t){case"claude":{let{ClaudeAgentSdkAdapter:i}=await Promise.resolve().then(()=>(jv(),Cv));return new i({cwd:e,model:r})}case"cursor":{let{CursorSdkAdapter:i}=await Promise.resolve().then(()=>(Rv(),Tv)),n=process.env.CURSOR_API_KEY;if(!n)throw new Error("CURSOR_API_KEY environment variable is required for the cursor adapter");return i.create({apiKey:n,cwd:e,model:r})}case"mock":{let{MockAdapter:i}=await Promise.resolve().then(()=>(Nv(),Dv));return new i}default:throw new Error(`Unsupported adapter for audit-implementation: "${t}". Available: claude, cursor, mock`)}}var iV={info:0,warning:1,error:2,critical:3};function C9e(t,e){let r=iV[e]??2;return t.findings.some(i=>(iV[i.severity]??0)>=r)}async function oV(t){let e=aV(),r=$9e(t.projectDir);if(!x9e(r))return{status:"failed",exitCode:3,error:e.noProjectDir(r)};let i=t.focus!=="all"?`
4384
+ `+n),e.dryRun){let h=Tl["llm-feature-implementer"],g=Rl["implement-llm-feature"],v=Ba(h,g,o,{handoffSchemas:Dl});return{status:"dry_run",exitCode:0,data:{files_created:[],files_modified:[],summary:v}}}let s;try{s=await E9e(e.adapter,i,e.model)}catch(h){return{status:"failed",exitCode:12,error:r.adapterError(h.message)}}e.verbose||console.error(r.implementStarting(e.adapter));let l={workflowRegistry:Ef,taskRegistry:Rl,agentRegistry:Tl,handoffSchemas:Dl},u={workflow:"implement-llm-feature",user_request:a,runtime:{maxFollowUps:3,maxRetries:1},hooks:{onGate:async()=>!0},context:{cwd:i},progressOutput:e.progressOutput},c=await xo(s,u,l);if(c.status!=="completed"){let h=c.escalation_reason??c.error_message??c.status;return{status:"failed",exitCode:1,error:r.implementFailed(h)}}return{status:"success",exitCode:0,data:c.steps[c.steps.length-1]?.outcome?.data??{files_created:[],files_modified:[],summary:r.implementSuccess}}}function qS(t){let e=rV();if(t.status==="dry_run")return t.data?.summary??e.dryRunHeader;if(t.status==="failed")return t.error??e.implementFailed("unknown");let r=t.data;if(!r)return e.implementSuccess;let i=[r.summary,""];if(r.files_created.length>0){i.push(e.filesCreated);for(let n of r.files_created)i.push(` + ${n}`);i.push("")}if(r.files_modified.length>0){i.push(e.filesModified);for(let n of r.files_modified)i.push(` ~ ${n}`);i.push("")}if(r.commands_added&&r.commands_added.length>0){i.push(e.commandsAdded);for(let n of r.commands_added)i.push(` - ${n.name} [${n.type}]${n.description?` \u2014 ${n.description}`:""}`);i.push("")}if(r.next_steps&&r.next_steps.length>0){i.push(e.nextSteps);for(let n of r.next_steps)i.push(` ${n}`)}return i.join(`
4385
+ `)}import{existsSync as A9e}from"node:fs";import{resolve as P9e}from"node:path";function O9e(){return process.env.LANG?.split(".")[0]??process.env.LC_ALL?.split(".")[0]??process.env.LANGUAGE?.split(":")[0]??"en_US"}function I9e(){return O9e().startsWith("ja")}var C9e={noProjectDir:t=>`Project directory not found: ${t}`,adapterError:t=>`Adapter initialization failed: ${t}`,dryRunHeader:"=== Dry Run (audit-implementation) ===",dryRunProjectDir:t=>`Project: ${t}`,dryRunFocus:t=>`Focus: ${t}`,auditStarting:t=>`Starting audit with ${t} adapter...`,auditSuccess:"Audit completed.",auditFailed:t=>`Audit failed: ${t}`,riskLevel:t=>`Risk level: ${t}`,findingsHeader:t=>`Findings (${t}):`,noFindings:"No findings.",recommendedActionsHeader:"Recommended actions:"},j9e={noProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${t}`,adapterError:t=>`\u30A2\u30C0\u30D7\u30BF\u30FC\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,dryRunHeader:"=== \u30C9\u30E9\u30A4\u30E9\u30F3 (audit-implementation) ===",dryRunProjectDir:t=>`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8: ${t}`,dryRunFocus:t=>`\u30D5\u30A9\u30FC\u30AB\u30B9: ${t}`,auditStarting:t=>`${t} \u30A2\u30C0\u30D7\u30BF\u30FC\u3067\u76E3\u67FB\u3092\u958B\u59CB\u3057\u307E\u3059...`,auditSuccess:"\u76E3\u67FB\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002",auditFailed:t=>`\u76E3\u67FB\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${t}`,riskLevel:t=>`\u30EA\u30B9\u30AF\u30EC\u30D9\u30EB: ${t}`,findingsHeader:t=>`\u691C\u51FA\u4E8B\u9805 (${t}\u4EF6):`,noFindings:"\u691C\u51FA\u4E8B\u9805\u306F\u3042\u308A\u307E\u305B\u3093\u3002",recommendedActionsHeader:"\u63A8\u5968\u30A2\u30AF\u30B7\u30E7\u30F3:"};function aV(){return I9e()?j9e:C9e}async function T9e(t,e,r){switch(t){case"claude":{let{ClaudeAgentSdkAdapter:i}=await Promise.resolve().then(()=>(jv(),Cv));return new i({cwd:e,model:r})}case"cursor":{let{CursorSdkAdapter:i}=await Promise.resolve().then(()=>(Rv(),Tv)),n=process.env.CURSOR_API_KEY;if(!n)throw new Error("CURSOR_API_KEY environment variable is required for the cursor adapter");return i.create({apiKey:n,cwd:e,model:r})}case"mock":{let{MockAdapter:i}=await Promise.resolve().then(()=>(Nv(),Dv));return new i}default:throw new Error(`Unsupported adapter for audit-implementation: "${t}". Available: claude, cursor, mock`)}}var iV={info:0,warning:1,error:2,critical:3};function R9e(t,e){let r=iV[e]??2;return t.findings.some(i=>(iV[i.severity]??0)>=r)}async function oV(t){let e=aV(),r=P9e(t.projectDir);if(!A9e(r))return{status:"failed",exitCode:3,error:e.noProjectDir(r)};let i=t.focus!=="all"?`
4384
4386
 
4385
4387
  Focus the audit on the "${t.focus}" layer only.`:"",n=["Audit the LLM command integration in the following project.",`Project directory: ${r}`,i].join(`
4386
4388
  `),a={user_request:n,relevant_paths:[r]};if(t.dryRun){let g=Tl["implementation-auditor"],y=["audit-dsl","audit-runtime","audit-cli-contract","audit-architecture"].map(E=>{let I=Rl[E];return I?Ba(g,I,a,{handoffSchemas:Dl}):`# [Task not found: ${E}]`}),w=`
4387
4389
 
4388
4390
  `+"=".repeat(72)+`
4389
4391
 
4390
- `;return{status:"dry_run",exitCode:0,data:{summary:y.join(w),riskLevel:"low",findings:[]}}}let o;try{o=await I9e(t.adapter,r,t.model)}catch(g){return{status:"failed",exitCode:12,error:e.adapterError(g.message)}}console.error(e.auditStarting(t.adapter));let s={workflowRegistry:Ef,taskRegistry:Rl,agentRegistry:Tl,handoffSchemas:Dl},l={workflow:"audit-implementation",user_request:n,runtime:{maxFollowUps:2,maxRetries:1},hooks:{onGate:async()=>!0},context:{cwd:r},progressOutput:t.progressOutput},u=await xo(o,l,s);if(u.status!=="completed"){let g=u.escalation_reason??u.error_message??u.status;return{status:"failed",exitCode:1,error:e.auditFailed(g)}}let f=u.steps[u.steps.length-1]?.outcome?.data??{summary:e.auditSuccess,riskLevel:"low",findings:[]};return{status:"success",exitCode:C9e(f,t.failOn)?10:0,data:f}}var j9e={critical:"\u2717",error:"\u2717",warning:"!",info:"\xB7"};function FS(t){let e=aV();if(t.status==="dry_run")return t.data?.summary??e.dryRunHeader;if(t.status==="failed")return t.error??e.auditFailed("unknown");let r=t.data;if(!r)return e.auditSuccess;let i=[r.summary,""];if(i.push(e.riskLevel(r.riskLevel)),i.push(""),r.findings.length===0)i.push(e.noFindings);else{i.push(e.findingsHeader(r.findings.length));for(let n of r.findings){let a=j9e[n.severity]??"\xB7",o=n.id?`[${n.id}] `:"",s=n.target?` (${n.target})`:"";i.push(` ${a} ${o}${n.severity.toUpperCase()}: ${n.message}${s}`),n.recommendation&&i.push(` \u2192 ${n.recommendation}`)}i.push("")}if(r.recommendedActions&&r.recommendedActions.length>0){i.push(e.recommendedActionsHeader);for(let n of r.recommendedActions){let a=n.command?` \u2014 ${n.command}`:"";i.push(` [${n.kind}] ${n.title}${a}`)}}return i.join(`
4391
- `)}var Nl=fn(ki(),1);D9e();var N9e="0.35.0";async function WS(t){let e=await ja(t),r=`${e.generatedDir}/index`,i;if(Lv(`${r}.js`))i=`${r}.js`;else if(Lv(`${r}.ts`))i=`${r}.ts`;else throw new Error(`Generated index file not found at ${r}.{js,ts}. Run \`agent-runtime generate\` first.`);let n=await import(new URL(`file://${i}`).href),a,o=`${e.generatedDir}/hooks/index`,s=Lv(`${o}.js`)?`${o}.js`:Lv(`${o}.ts`)?`${o}.ts`:null;if(s)try{let l=await import(new URL(`file://${s}`).href);l.guardrailHooks&&(a=l.guardrailHooks)}catch{}return{agentRegistry:n.agentRegistry??n.agents?.agentRegistry??{},taskRegistry:n.taskRegistry??n.tasks?.taskRegistry??{},handoffSchemas:n.handoffSchemas??n.handoffs?.handoffSchemas??{},workflowRegistry:n.workflowRegistry??n.workflows?.workflowRegistry??{},guardrailHooks:a}}async function L9e(t,e,r,i){switch(t){case"mock":{let{MockAdapter:n}=await Promise.resolve().then(()=>(Nv(),Dv));return new n}case"claude":{let{ClaudeAgentSdkAdapter:n}=await Promise.resolve().then(()=>(jv(),Cv));return new n({cwd:r,guardrailHooks:e,...i?{model:i}:{}})}case"gemini":{let{GeminiSdkAdapter:n}=await Promise.resolve().then(()=>(lV(),sV));return new n({guardrailHooks:e,...i?{model:i}:{}})}case"cursor":{let{CursorSdkAdapter:n}=await Promise.resolve().then(()=>(Rv(),Tv)),a=process.env.CURSOR_API_KEY;if(!a)throw new Error("CURSOR_API_KEY environment variable is required for the cursor adapter");return n.create({apiKey:a,cwd:r,guardrailHooks:e,...i?{model:i}:{}})}case"openai":{let{OpenAIAgentsSdkAdapter:n}=await Promise.resolve().then(()=>(cV(),uV));return new n({...i?{model:i}:{}})}default:throw new Error(`Unknown adapter: ${t}. Available: mock, claude, gemini, cursor, openai`)}}function HS(t,e){let r=t.map((s,l)=>Math.max(s.length,...e.map(u=>(u[l]??"").length))),i=r.map(s=>"-".repeat(s)).join(" "),n=(s,l)=>s.padEnd(l),a=t.map((s,l)=>n(s,r[l])).join(" "),o=e.map(s=>s.map((l,u)=>n(l??"",r[u])).join(" "));return[a,i,...o].join(`
4392
- `)}function M9e(t,e,r,i){if(t)return $o({stderr:!r,file:Mv(t),naming:"single",label:i});if(e&&e.destination!=="none"){let n=e.destination;return $o({stderr:!r&&(n==="stderr"||n==="both"),file:n==="file"||n==="both"?e.file:void 0,naming:e.naming,label:i})}if(!r)return $o({stderr:!0})}var z9e={async init(t,e){try{let r=Mv(t.output??"."),i=await XU({adapter:t.adapter??"mock",outputDir:r,force:t.force??!1});console.log(JSON.stringify(i,null,2))}catch(r){console.error(r.message),process.exit(1)}},async generate(t,e){try{let r=e.config??"./agent-runtime.config.yaml",i=await AU({clean:t.clean,check:t.check,templates:t.templates,configPath:r});i.check_mode?(i.has_differences&&(console.error("Generated files are out of date. Run `agent-runtime generate` to update."),process.exit(1)),console.log(JSON.stringify({...i,status:"up-to-date"},null,2))):console.log(JSON.stringify(i,null,2))}catch(r){console.error("Generate failed:",r.message),process.exit(1)}},async run(t,e,r,i){let n=t,a=e,o;if(r.file)try{let b=R9e(r.file,"utf8"),U=Nl.default.parse(b);n=U.workflow,n||(console.error(`Error: invocation file "${r.file}" must contain a "workflow" field.`),process.exit(3)),o={workflow:n,user_request:U.user_request,handoff:U.handoff,runtime:U.runtime,context:U.context},a=o.user_request??""}catch(b){console.error(`Failed to read invocation file: ${b.message}`),process.exit(3)}n||(console.error("Error: workflow-id is required (provide as argument or via --file)"),process.exit(3)),!o&&!a&&(console.error("Error: user-request is required (provide as argument or via --file)"),process.exit(3));let s=i.config??"./agent-runtime.config.yaml";await Sv(s)||(console.error("Generated files are stale or missing. Run `agent-runtime generate` first."),process.exit(3));let u=await ja(s),c=await Av({pluginPaths:u.pluginPaths.length>0?u.pluginPaths:void 0,projectDir:u.configDir});c.loaded>0&&!i.quiet&&console.error(`Loaded ${c.loaded} plugin(s) from ${c.files.length} file(s)`);for(let b of c.errors)console.error(`Plugin load error (${b.file}): ${b.error}`);let d;try{d=await WS(s)}catch(b){console.error(`Failed to load generated contracts: ${b.message}`),process.exit(1);return}if(!d.workflowRegistry[n]){console.error(`Unknown workflow: ${n}`),console.error(`Available workflows: ${Object.keys(d.workflowRegistry).join(", ")}`),process.exit(3);return}let f=r.adapter??"mock",h=o?.context?.cwd??process.cwd(),{createModelResolver:g}=await Promise.resolve().then(()=>(RS(),FU)),v=g({modelMapping:u.model_mapping,fallbackAdapter:f}),y=new Map,w=async b=>{let U=v.resolve(b),k=`${U.adapter}:${U.model??""}`,A=y.get(k);if(A)return A;let z=await L9e(U.adapter,d.guardrailHooks,h,U.model);return y.set(k,z),z},$;try{$=await w()}catch(b){console.error(b.message),process.exit(12);return}let I=Object.values(u.model_mapping).some(Boolean)||process.env.AGENT_RUNTIME_MODEL||process.env.AGENT_RUNTIME_MODEL_FAST||process.env.AGENT_RUNTIME_MODEL_STANDARD||process.env.AGENT_RUNTIME_MODEL_THINKING?w:$,R=u.recovery,M=r.maxRetries?parseInt(r.maxRetries,10):void 0,T=r.maxFollowUps?parseInt(r.maxFollowUps,10):void 0,O={workflowRegistry:d.workflowRegistry,taskRegistry:d.taskRegistry,agentRegistry:d.agentRegistry,handoffSchemas:d.handoffSchemas},N=r.autoApproveGates?async()=>!0:async(b,U)=>(console.error(`Gate "${b}": ${U}`),console.error("Use --auto-approve-gates to auto-approve. Rejecting by default."),!1),j=M9e(r.logFile,u.resolvedLogging.progressLog,i.quiet,n),x;try{if(o){let b={...o,runtime:{...o.runtime,maxFollowUps:T??o.runtime?.maxFollowUps??R.max_follow_ups,maxRetries:M??o.runtime?.maxRetries??R.max_retries},hooks:{onGate:N},progressOutput:j};x=await xo(I,b,O)}else x=await xo(I,n,{user_request:a,maxRetries:M??R.max_retries,maxFollowUps:T??R.max_follow_ups,onGate:N,progressOutput:j},O)}finally{j?.close()}console.log(JSON.stringify(x,null,2)),x.status!=="completed"&&process.exit(1)},async list(t,e,r){t||(console.error("Error: resource is required (workflows, tasks, agents)"),process.exit(1));let i=["workflows","tasks","agents"];if(!i.includes(t)){console.error(`Unknown resource: ${t}`),console.error(`Available resources: ${i.join(", ")}`),process.exit(1);return}let n=r.config??"./agent-runtime.config.yaml",a;try{a=await WS(n)}catch(s){console.error(`Failed to load generated contracts: ${s.message}`),console.error("Run `agent-runtime generate` first."),process.exit(1);return}let o=e.format??"table";if(t==="agents"){let s=Object.values(a.agentRegistry);if(o==="json")console.log(JSON.stringify(s,null,2));else{if(s.length===0){console.log("No agents defined.");return}console.log(HS(["ID","Role","Mode","Purpose"],s.map(l=>[l.id,l.role_name,l.mode,l.purpose])))}}else if(t==="tasks"){let s=Object.values(a.taskRegistry);if(o==="json")console.log(JSON.stringify(s,null,2));else{if(s.length===0){console.log("No tasks defined.");return}console.log(HS(["ID","Agent","Description"],s.map(l=>[l.id,l.target_agent,l.description])))}}else{let s=Object.values(a.workflowRegistry);if(o==="json")console.log(JSON.stringify(s,null,2));else{if(s.length===0){console.log("No workflows defined.");return}console.log(HS(["ID","Steps","Description"],s.map(l=>[l.id,String(l.steps.length),l.description])))}}},async showPrompt(t,e,r){t||(console.error("Error: task-id is required"),process.exit(1));let i=r.config??"./agent-runtime.config.yaml",n;try{n=await WS(i)}catch(d){console.error(`Failed to load generated contracts: ${d.message}`),console.error("Run `agent-runtime generate` first."),process.exit(1);return}let a=n.taskRegistry[t];if(!a){console.error(`Unknown task: ${t}`),console.error(`Available tasks: ${Object.keys(n.taskRegistry).join(", ")}`),process.exit(1);return}let o=n.agentRegistry[a.target_agent];if(!o){console.error(`Unknown agent: ${a.target_agent} (referenced by task ${t})`),process.exit(1);return}let s=e.withPlugins??!1;if(s){let d=await ja(i);await Av({pluginPaths:d.pluginPaths.length>0?d.pluginPaths:void 0,projectDir:d.configDir})}let l=e.userRequest??"(preview)",u=Ba(o,a,{user_request:l},{handoffSchemas:n.handoffSchemas});s&&(u=_n.applyPromptEnhancers(t,u,{user_request:l}));let c=e.format??"markdown";console.log(c==="json"?JSON.stringify({task_id:t,agent_id:a.target_agent,prompt:u,handoff_schema:a.result_handoff,plugins_applied:s},null,2):u)},async implement(t,e,r){t||(console.error("Error: description is required"),process.exit(3));let i=r.quiet,n=e.logFile?$o({stderr:!i,file:Mv(e.logFile),naming:"single"}):i?void 0:$o({stderr:!0}),a;try{a=await nV(t,{adapter:e.adapter??"claude",projectDir:e.projectDir??".",dryRun:e.dryRun??!1,model:e.model,reportFormat:e.reportFormat??"text",progressOutput:n})}finally{n?.close()}a.status==="failed"&&(e.reportFormat==="json"?console.log(JSON.stringify({error:a.error,status:"failed"},null,2)):e.reportFormat==="yaml"?console.log(Nl.default.stringify({error:a.error,status:"failed"})):console.error(qS(a)),process.exit(a.exitCode??1));let o=a.data??{status:a.status},s;e.reportFormat==="json"?s=JSON.stringify(o,null,2):e.reportFormat==="yaml"?s=Nl.default.stringify(o):s=qS(a);let l=e.output;l?dV(l,s+`
4392
+ `;return{status:"dry_run",exitCode:0,data:{summary:y.join(w),riskLevel:"low",findings:[]}}}let o;try{o=await T9e(t.adapter,r,t.model)}catch(g){return{status:"failed",exitCode:12,error:e.adapterError(g.message)}}console.error(e.auditStarting(t.adapter));let s={workflowRegistry:Ef,taskRegistry:Rl,agentRegistry:Tl,handoffSchemas:Dl},l={workflow:"audit-implementation",user_request:n,runtime:{maxFollowUps:2,maxRetries:1},hooks:{onGate:async()=>!0},context:{cwd:r},progressOutput:t.progressOutput},u=await xo(o,l,s);if(u.status!=="completed"){let g=u.escalation_reason??u.error_message??u.status;return{status:"failed",exitCode:1,error:e.auditFailed(g)}}let f=u.steps[u.steps.length-1]?.outcome?.data??{summary:e.auditSuccess,riskLevel:"low",findings:[]};return{status:"success",exitCode:R9e(f,t.failOn)?10:0,data:f}}var D9e={critical:"\u2717",error:"\u2717",warning:"!",info:"\xB7"};function FS(t){let e=aV();if(t.status==="dry_run")return t.data?.summary??e.dryRunHeader;if(t.status==="failed")return t.error??e.auditFailed("unknown");let r=t.data;if(!r)return e.auditSuccess;let i=[r.summary,""];if(i.push(e.riskLevel(r.riskLevel)),i.push(""),r.findings.length===0)i.push(e.noFindings);else{i.push(e.findingsHeader(r.findings.length));for(let n of r.findings){let a=D9e[n.severity]??"\xB7",o=n.id?`[${n.id}] `:"",s=n.target?` (${n.target})`:"";i.push(` ${a} ${o}${n.severity.toUpperCase()}: ${n.message}${s}`),n.recommendation&&i.push(` \u2192 ${n.recommendation}`)}i.push("")}if(r.recommendedActions&&r.recommendedActions.length>0){i.push(e.recommendedActionsHeader);for(let n of r.recommendedActions){let a=n.command?` \u2014 ${n.command}`:"";i.push(` [${n.kind}] ${n.title}${a}`)}}return i.join(`
4393
+ `)}var Nl=fn(ki(),1);M9e();var z9e="0.35.1";async function WS(t){let e=await ja(t),r=`${e.generatedDir}/index`,i;if(Lv(`${r}.js`))i=`${r}.js`;else if(Lv(`${r}.ts`))i=`${r}.ts`;else throw new Error(`Generated index file not found at ${r}.{js,ts}. Run \`agent-runtime generate\` first.`);let n=await import(new URL(`file://${i}`).href),a,o=`${e.generatedDir}/hooks/index`,s=Lv(`${o}.js`)?`${o}.js`:Lv(`${o}.ts`)?`${o}.ts`:null;if(s)try{let l=await import(new URL(`file://${s}`).href);l.guardrailHooks&&(a=l.guardrailHooks)}catch{}return{agentRegistry:n.agentRegistry??n.agents?.agentRegistry??{},taskRegistry:n.taskRegistry??n.tasks?.taskRegistry??{},handoffSchemas:n.handoffSchemas??n.handoffs?.handoffSchemas??{},workflowRegistry:n.workflowRegistry??n.workflows?.workflowRegistry??{},guardrailHooks:a}}async function q9e(t,e,r,i){switch(t){case"mock":{let{MockAdapter:n}=await Promise.resolve().then(()=>(Nv(),Dv));return new n}case"claude":{let{ClaudeAgentSdkAdapter:n}=await Promise.resolve().then(()=>(jv(),Cv));return new n({cwd:r,guardrailHooks:e,...i?{model:i}:{}})}case"gemini":{let{GeminiSdkAdapter:n}=await Promise.resolve().then(()=>(lV(),sV));return new n({guardrailHooks:e,...i?{model:i}:{}})}case"cursor":{let{CursorSdkAdapter:n}=await Promise.resolve().then(()=>(Rv(),Tv)),a=process.env.CURSOR_API_KEY;if(!a)throw new Error("CURSOR_API_KEY environment variable is required for the cursor adapter");return n.create({apiKey:a,cwd:r,guardrailHooks:e,...i?{model:i}:{}})}case"openai":{let{OpenAIAgentsSdkAdapter:n}=await Promise.resolve().then(()=>(cV(),uV));return new n({...i?{model:i}:{}})}default:throw new Error(`Unknown adapter: ${t}. Available: mock, claude, gemini, cursor, openai`)}}function HS(t,e){let r=t.map((s,l)=>Math.max(s.length,...e.map(u=>(u[l]??"").length))),i=r.map(s=>"-".repeat(s)).join(" "),n=(s,l)=>s.padEnd(l),a=t.map((s,l)=>n(s,r[l])).join(" "),o=e.map(s=>s.map((l,u)=>n(l??"",r[u])).join(" "));return[a,i,...o].join(`
4394
+ `)}function F9e(t,e,r,i){if(t)return $o({stderr:!r,file:Mv(t),naming:"single",label:i});if(e&&e.destination!=="none"){let n=e.destination;return $o({stderr:!r&&(n==="stderr"||n==="both"),file:n==="file"||n==="both"?e.file:void 0,naming:e.naming,label:i})}if(!r)return $o({stderr:!0})}var U9e={async init(t,e){try{let r=Mv(t.output??"."),i=await XU({adapter:t.adapter??"mock",outputDir:r,force:t.force??!1});console.log(JSON.stringify(i,null,2))}catch(r){console.error(r.message),process.exit(1)}},async generate(t,e){try{let r=e.config??"./agent-runtime.config.yaml",i=await AU({clean:t.clean,check:t.check,templates:t.templates,configPath:r});i.check_mode?(i.has_differences&&(console.error("Generated files are out of date. Run `agent-runtime generate` to update."),process.exit(1)),console.log(JSON.stringify({...i,status:"up-to-date"},null,2))):console.log(JSON.stringify(i,null,2))}catch(r){console.error("Generate failed:",r.message),process.exit(1)}},async run(t,e,r,i){let n=t,a=e,o;if(r.file)try{let b=L9e(r.file,"utf8"),U=Nl.default.parse(b);n=U.workflow,n||(console.error(`Error: invocation file "${r.file}" must contain a "workflow" field.`),process.exit(3)),o={workflow:n,user_request:U.user_request,handoff:U.handoff,runtime:U.runtime,context:U.context},a=o.user_request??""}catch(b){console.error(`Failed to read invocation file: ${b.message}`),process.exit(3)}n||(console.error("Error: workflow-id is required (provide as argument or via --file)"),process.exit(3)),!o&&!a&&(console.error("Error: user-request is required (provide as argument or via --file)"),process.exit(3));let s=i.config??"./agent-runtime.config.yaml";await Sv(s)||(console.error("Generated files are stale or missing. Run `agent-runtime generate` first."),process.exit(3));let u=await ja(s),c=await Av({pluginPaths:u.pluginPaths.length>0?u.pluginPaths:void 0,projectDir:u.configDir});c.loaded>0&&!i.quiet&&console.error(`Loaded ${c.loaded} plugin(s) from ${c.files.length} file(s)`);for(let b of c.errors)console.error(`Plugin load error (${b.file}): ${b.error}`);let d;try{d=await WS(s)}catch(b){console.error(`Failed to load generated contracts: ${b.message}`),process.exit(1);return}if(!d.workflowRegistry[n]){console.error(`Unknown workflow: ${n}`),console.error(`Available workflows: ${Object.keys(d.workflowRegistry).join(", ")}`),process.exit(3);return}let f=r.adapter??"mock",h=o?.context?.cwd??process.cwd(),{createModelResolver:g}=await Promise.resolve().then(()=>(RS(),FU)),v=g({modelMapping:u.model_mapping,fallbackAdapter:f}),y=new Map,w=async b=>{let U=v.resolve(b),k=`${U.adapter}:${U.model??""}`,A=y.get(k);if(A)return A;let z=await q9e(U.adapter,d.guardrailHooks,h,U.model);return y.set(k,z),z},$;try{$=await w()}catch(b){console.error(b.message),process.exit(12);return}let I=Object.values(u.model_mapping).some(Boolean)||process.env.AGENT_RUNTIME_MODEL||process.env.AGENT_RUNTIME_MODEL_FAST||process.env.AGENT_RUNTIME_MODEL_STANDARD||process.env.AGENT_RUNTIME_MODEL_THINKING?w:$,R=u.recovery,M=r.maxRetries?parseInt(r.maxRetries,10):void 0,T=r.maxFollowUps?parseInt(r.maxFollowUps,10):void 0,O={workflowRegistry:d.workflowRegistry,taskRegistry:d.taskRegistry,agentRegistry:d.agentRegistry,handoffSchemas:d.handoffSchemas},N=r.autoApproveGates?async()=>!0:async(b,U)=>(console.error(`Gate "${b}": ${U}`),console.error("Use --auto-approve-gates to auto-approve. Rejecting by default."),!1),j=F9e(r.logFile,u.resolvedLogging.progressLog,i.quiet,n),x;try{if(o){let b={...o,runtime:{...o.runtime,maxFollowUps:T??o.runtime?.maxFollowUps??R.max_follow_ups,maxRetries:M??o.runtime?.maxRetries??R.max_retries},hooks:{onGate:N},progressOutput:j};x=await xo(I,b,O)}else x=await xo(I,n,{user_request:a,maxRetries:M??R.max_retries,maxFollowUps:T??R.max_follow_ups,onGate:N,progressOutput:j},O)}finally{j?.close()}console.log(JSON.stringify(x,null,2)),x.status!=="completed"&&process.exit(1)},async list(t,e,r){t||(console.error("Error: resource is required (workflows, tasks, agents)"),process.exit(1));let i=["workflows","tasks","agents"];if(!i.includes(t)){console.error(`Unknown resource: ${t}`),console.error(`Available resources: ${i.join(", ")}`),process.exit(1);return}let n=r.config??"./agent-runtime.config.yaml",a;try{a=await WS(n)}catch(s){console.error(`Failed to load generated contracts: ${s.message}`),console.error("Run `agent-runtime generate` first."),process.exit(1);return}let o=e.format??"table";if(t==="agents"){let s=Object.values(a.agentRegistry);if(o==="json")console.log(JSON.stringify(s,null,2));else{if(s.length===0){console.log("No agents defined.");return}console.log(HS(["ID","Role","Mode","Purpose"],s.map(l=>[l.id,l.role_name,l.mode,l.purpose])))}}else if(t==="tasks"){let s=Object.values(a.taskRegistry);if(o==="json")console.log(JSON.stringify(s,null,2));else{if(s.length===0){console.log("No tasks defined.");return}console.log(HS(["ID","Agent","Description"],s.map(l=>[l.id,l.target_agent,l.description])))}}else{let s=Object.values(a.workflowRegistry);if(o==="json")console.log(JSON.stringify(s,null,2));else{if(s.length===0){console.log("No workflows defined.");return}console.log(HS(["ID","Steps","Description"],s.map(l=>[l.id,String(l.steps.length),l.description])))}}},async showPrompt(t,e,r){t||(console.error("Error: task-id is required"),process.exit(1));let i=r.config??"./agent-runtime.config.yaml",n;try{n=await WS(i)}catch(d){console.error(`Failed to load generated contracts: ${d.message}`),console.error("Run `agent-runtime generate` first."),process.exit(1);return}let a=n.taskRegistry[t];if(!a){console.error(`Unknown task: ${t}`),console.error(`Available tasks: ${Object.keys(n.taskRegistry).join(", ")}`),process.exit(1);return}let o=n.agentRegistry[a.target_agent];if(!o){console.error(`Unknown agent: ${a.target_agent} (referenced by task ${t})`),process.exit(1);return}let s=e.withPlugins??!1;if(s){let d=await ja(i);await Av({pluginPaths:d.pluginPaths.length>0?d.pluginPaths:void 0,projectDir:d.configDir})}let l=e.userRequest??"(preview)",u=Ba(o,a,{user_request:l},{handoffSchemas:n.handoffSchemas});s&&(u=_n.applyPromptEnhancers(t,u,{user_request:l}));let c=e.format??"markdown";console.log(c==="json"?JSON.stringify({task_id:t,agent_id:a.target_agent,prompt:u,handoff_schema:a.result_handoff,plugins_applied:s},null,2):u)},async implement(t,e,r){t||(console.error("Error: description is required"),process.exit(3));let i=r.quiet,n=e.logFile?$o({stderr:!i,file:Mv(e.logFile),naming:"single"}):i?void 0:$o({stderr:!0}),a;try{a=await nV(t,{adapter:e.adapter??"claude",projectDir:e.projectDir??".",dryRun:e.dryRun??!1,model:e.model,reportFormat:e.reportFormat??"text",progressOutput:n})}finally{n?.close()}a.status==="failed"&&(e.reportFormat==="json"?console.log(JSON.stringify({error:a.error,status:"failed"},null,2)):e.reportFormat==="yaml"?console.log(Nl.default.stringify({error:a.error,status:"failed"})):console.error(qS(a)),process.exit(a.exitCode??1));let o=a.data??{status:a.status},s;e.reportFormat==="json"?s=JSON.stringify(o,null,2):e.reportFormat==="yaml"?s=Nl.default.stringify(o):s=qS(a);let l=e.output;l?dV(l,s+`
4393
4395
  `):console.log(s)},async auditImplementation(t,e,r){let i=r.quiet,n=e.logFile?$o({stderr:!i,file:Mv(e.logFile),naming:"single"}):i?void 0:$o({stderr:!0}),a;try{a=await oV({adapter:e.adapter??"claude",projectDir:t??".",focus:e.focus??"all",dryRun:e.dryRun??!1,failOn:e.failOn??"error",model:e.model,reportFormat:e.reportFormat??"text",progressOutput:n})}finally{n?.close()}a.status==="failed"&&(e.reportFormat==="json"?console.log(JSON.stringify({error:a.error,status:"failed"},null,2)):e.reportFormat==="yaml"?console.log(Nl.default.stringify({error:a.error,status:"failed"})):console.error(FS(a)),process.exit(a.exitCode));let o=a.data??{status:a.status},s;e.reportFormat==="json"?s=JSON.stringify(o,null,2):e.reportFormat==="yaml"?s=Nl.default.stringify(o):s=FS(a);let l=e.output;l?dV(l,s+`
4394
- `):console.log(s),a.exitCode!==0&&process.exit(a.exitCode)},async agents(t,e){let r=t.format??"yaml";try{console.log(r==="json"?JSON.stringify(Iv,null,2):Nl.default.stringify(Iv,{lineWidth:120}))}catch(i){console.error(`Failed to output DSL: ${i.message}`),process.exit(1)}},async doctor(t){let e=t.config??"./agent-runtime.config.yaml",r=await KU(e),i=n=>n==="pass"?"\u2713":n==="warn"?"!":"\u2717";for(let n of r.checks){let a=i(n.status),o=n.message?` ${n.message}`:"";console.log(` ${a} ${n.name.padEnd(20)} ${n.status.toUpperCase()}${o}`)}console.log(""),r.all_passed?console.log("All checks passed."):console.log("Some checks failed."),console.log(JSON.stringify(r)),r.all_passed||(process.exitCode=1)}},q9e=w$(z9e,N9e);await q9e.parseAsync();
4396
+ `):console.log(s),a.exitCode!==0&&process.exit(a.exitCode)},async agents(t,e){let r=t.format??"yaml";try{console.log(r==="json"?JSON.stringify(Iv,null,2):Nl.default.stringify(Iv,{lineWidth:120}))}catch(i){console.error(`Failed to output DSL: ${i.message}`),process.exit(1)}},async doctor(t){let e=t.config??"./agent-runtime.config.yaml",r=await KU(e),i=n=>n==="pass"?"\u2713":n==="warn"?"!":"\u2717";for(let n of r.checks){let a=i(n.status),o=n.message?` ${n.message}`:"";console.log(` ${a} ${n.name.padEnd(20)} ${n.status.toUpperCase()}${o}`)}console.log(""),r.all_passed?console.log("All checks passed."):console.log("Some checks failed."),console.log(JSON.stringify(r)),r.all_passed||(process.exitCode=1)}},V9e=w$(U9e,z9e);await V9e.parseAsync();
4395
4397
  /*! Bundled license information:
4396
4398
 
4397
4399
  agent-contracts/dist/index.js: