faf-cli 6.0.5 → 6.0.6

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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/dist/cli.js +142 -142
  3. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1,40 +1,40 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as uJ}from"node:module";var fJ=Object.create;var{getPrototypeOf:yJ,defineProperty:r2,getOwnPropertyNames:gJ}=Object;var hJ=Object.prototype.hasOwnProperty;var vJ=($,Z,X)=>{X=$!=null?fJ(yJ($)):{};let z=Z||!$||!$.__esModule?r2(X,"default",{value:$,enumerable:!0}):X;for(let J of gJ($))if(!hJ.call(z,J))r2(z,J,{get:()=>$[J],enumerable:!0});return z};var T=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var g4=($,Z)=>{for(var X in Z)r2($,X,{get:Z[X],enumerable:!0,configurable:!0,set:(z)=>Z[X]=()=>z})};var j=($,Z)=>()=>($&&(Z=$($=0)),Z);var J0=uJ(import.meta.url);var Y6=T((mJ)=>{class a2 extends Error{constructor($,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=$,this.nestedError=void 0}}class h4 extends a2{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}mJ.CommanderError=a2;mJ.InvalidArgumentError=h4});var O8=T((iJ)=>{var{InvalidArgumentError:pJ}=Y6();class v4{constructor($,Z){switch(this.description=Z||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[$];return Z.push($),Z}default($,Z){return this.defaultValue=$,this.defaultValueDescription=Z,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new pJ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function lJ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}iJ.Argument=v4;iJ.humanReadableArgName=lJ});var o2=T((aJ)=>{var{humanReadableArgName:rJ}=O8();class u4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let Z=$.commands.filter((z)=>!z._hidden),X=$._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((z,J)=>{return z.name().localeCompare(J.name())});return Z}compareOptions($,Z){let X=(z)=>{return z.short?z.short.replace(/^-/,""):z.long.replace(/^--/,"")};return X($).localeCompare(X(Z))}visibleOptions($){let Z=$.options.filter((z)=>!z.hidden),X=$._getHelpOption();if(X&&!X.hidden){let z=X.short&&$._findOption(X.short),J=X.long&&$._findOption(X.long);if(!z&&!J)Z.push(X);else if(X.long&&!J)Z.push($.createOption(X.long,X.description));else if(X.short&&!z)Z.push($.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let Z=[];for(let X=$.parent;X;X=X.parent){let z=X.options.filter((J)=>!J.hidden);Z.push(...z)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((Z)=>{Z.description=Z.description||$._argsDescription[Z.name()]||""});if($.registeredArguments.find((Z)=>Z.description))return $.registeredArguments;return[]}subcommandTerm($){let Z=$.registeredArguments.map((X)=>rJ(X)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,Z){return Z.visibleCommands($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(z))))},0)}longestOptionTermLength($,Z){return Z.visibleOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestGlobalOptionTermLength($,Z){return Z.visibleGlobalOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestArgumentTermLength($,Z){return Z.visibleArguments($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(z))))},0)}commandUsage($){let Z=$._name;if($._aliases[0])Z=Z+"|"+$._aliases[0];let X="";for(let z=$.parent;z;z=z.parent)X=z.name()+" "+X;return X+Z+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)Z.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)Z.push(`env: ${$.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}argumentDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0)Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}formatItemList($,Z,X){if(Z.length===0)return[];return[X.styleTitle($),...Z,""]}groupItems($,Z,X){let z=new Map;return $.forEach((J)=>{let q=X(J);if(!z.has(q))z.set(q,[])}),Z.forEach((J)=>{let q=X(J);if(!z.has(q))z.set(q,[]);z.get(q).push(J)}),z}formatHelp($,Z){let X=Z.padWidth($,Z),z=Z.helpWidth??80;function J(W,V){return Z.formatItem(W,X,V,Z)}let q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage($))}`,""],Q=Z.commandDescription($);if(Q.length>0)q=q.concat([Z.boxWrap(Z.styleCommandDescription(Q),z),""]);let Y=Z.visibleArguments($).map((W)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(W)),Z.styleArgumentDescription(Z.argumentDescription(W)))});if(q=q.concat(this.formatItemList("Arguments:",Y,Z)),this.groupItems($.options,Z.visibleOptions($),(W)=>W.helpGroupHeading??"Options:").forEach((W,V)=>{let H=W.map((D)=>{return J(Z.styleOptionTerm(Z.optionTerm(D)),Z.styleOptionDescription(Z.optionDescription(D)))});q=q.concat(this.formatItemList(V,H,Z))}),Z.showGlobalOptions){let W=Z.visibleGlobalOptions($).map((V)=>{return J(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});q=q.concat(this.formatItemList("Global Options:",W,Z))}return this.groupItems($.commands,Z.visibleCommands($),(W)=>W.helpGroup()||"Commands:").forEach((W,V)=>{let H=W.map((D)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(D)),Z.styleSubcommandDescription(Z.subcommandDescription(D)))});q=q.concat(this.formatItemList(V,H,Z))}),q.join(`
2
+ import{createRequire as dJ}from"node:module";var gJ=Object.create;var{getPrototypeOf:hJ,defineProperty:r2,getOwnPropertyNames:vJ}=Object;var uJ=Object.prototype.hasOwnProperty;var mJ=($,Z,X)=>{X=$!=null?gJ(hJ($)):{};let z=Z||!$||!$.__esModule?r2(X,"default",{value:$,enumerable:!0}):X;for(let J of vJ($))if(!uJ.call(z,J))r2(z,J,{get:()=>$[J],enumerable:!0});return z};var L=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var g4=($,Z)=>{for(var X in Z)r2($,X,{get:Z[X],enumerable:!0,configurable:!0,set:(z)=>Z[X]=()=>z})};var j=($,Z)=>()=>($&&(Z=$($=0)),Z);var J0=dJ(import.meta.url);var Y6=L((cJ)=>{class a2 extends Error{constructor($,Z,X){super(X);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=Z,this.exitCode=$,this.nestedError=void 0}}class h4 extends a2{constructor($){super(1,"commander.invalidArgument",$);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}cJ.CommanderError=a2;cJ.InvalidArgumentError=h4});var O8=L((sJ)=>{var{InvalidArgumentError:iJ}=Y6();class v4{constructor($,Z){switch(this.description=Z||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,$[0]){case"<":this.required=!0,this._name=$.slice(1,-1);break;case"[":this.required=!1,this._name=$.slice(1,-1);break;default:this.required=!0,this._name=$;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue($,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[$];return Z.push($),Z}default($,Z){return this.defaultValue=$,this.defaultValueDescription=Z,this}argParser($){return this.parseArg=$,this}choices($){return this.argChoices=$.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new iJ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function nJ($){let Z=$.name()+($.variadic===!0?"...":"");return $.required?"<"+Z+">":"["+Z+"]"}sJ.Argument=v4;sJ.humanReadableArgName=nJ});var o2=L((tJ)=>{var{humanReadableArgName:oJ}=O8();class u4{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext($){this.helpWidth=this.helpWidth??$.helpWidth??80}visibleCommands($){let Z=$.commands.filter((z)=>!z._hidden),X=$._getHelpCommand();if(X&&!X._hidden)Z.push(X);if(this.sortSubcommands)Z.sort((z,J)=>{return z.name().localeCompare(J.name())});return Z}compareOptions($,Z){let X=(z)=>{return z.short?z.short.replace(/^-/,""):z.long.replace(/^--/,"")};return X($).localeCompare(X(Z))}visibleOptions($){let Z=$.options.filter((z)=>!z.hidden),X=$._getHelpOption();if(X&&!X.hidden){let z=X.short&&$._findOption(X.short),J=X.long&&$._findOption(X.long);if(!z&&!J)Z.push(X);else if(X.long&&!J)Z.push($.createOption(X.long,X.description));else if(X.short&&!z)Z.push($.createOption(X.short,X.description))}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleGlobalOptions($){if(!this.showGlobalOptions)return[];let Z=[];for(let X=$.parent;X;X=X.parent){let z=X.options.filter((J)=>!J.hidden);Z.push(...z)}if(this.sortOptions)Z.sort(this.compareOptions);return Z}visibleArguments($){if($._argsDescription)$.registeredArguments.forEach((Z)=>{Z.description=Z.description||$._argsDescription[Z.name()]||""});if($.registeredArguments.find((Z)=>Z.description))return $.registeredArguments;return[]}subcommandTerm($){let Z=$.registeredArguments.map((X)=>oJ(X)).join(" ");return $._name+($._aliases[0]?"|"+$._aliases[0]:"")+($.options.length?" [options]":"")+(Z?" "+Z:"")}optionTerm($){return $.flags}argumentTerm($){return $.name()}longestSubcommandTermLength($,Z){return Z.visibleCommands($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleSubcommandTerm(Z.subcommandTerm(z))))},0)}longestOptionTermLength($,Z){return Z.visibleOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestGlobalOptionTermLength($,Z){return Z.visibleGlobalOptions($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleOptionTerm(Z.optionTerm(z))))},0)}longestArgumentTermLength($,Z){return Z.visibleArguments($).reduce((X,z)=>{return Math.max(X,this.displayWidth(Z.styleArgumentTerm(Z.argumentTerm(z))))},0)}commandUsage($){let Z=$._name;if($._aliases[0])Z=Z+"|"+$._aliases[0];let X="";for(let z=$.parent;z;z=z.parent)X=z.name()+" "+X;return X+Z+" "+$.usage()}commandDescription($){return $.description()}subcommandDescription($){return $.summary()||$.description()}optionDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0){if($.required||$.optional||$.isBoolean()&&typeof $.defaultValue==="boolean")Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`)}if($.presetArg!==void 0&&$.optional)Z.push(`preset: ${JSON.stringify($.presetArg)}`);if($.envVar!==void 0)Z.push(`env: ${$.envVar}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}argumentDescription($){let Z=[];if($.argChoices)Z.push(`choices: ${$.argChoices.map((X)=>JSON.stringify(X)).join(", ")}`);if($.defaultValue!==void 0)Z.push(`default: ${$.defaultValueDescription||JSON.stringify($.defaultValue)}`);if(Z.length>0){let X=`(${Z.join(", ")})`;if($.description)return`${$.description} ${X}`;return X}return $.description}formatItemList($,Z,X){if(Z.length===0)return[];return[X.styleTitle($),...Z,""]}groupItems($,Z,X){let z=new Map;return $.forEach((J)=>{let q=X(J);if(!z.has(q))z.set(q,[])}),Z.forEach((J)=>{let q=X(J);if(!z.has(q))z.set(q,[]);z.get(q).push(J)}),z}formatHelp($,Z){let X=Z.padWidth($,Z),z=Z.helpWidth??80;function J(W,V){return Z.formatItem(W,X,V,Z)}let q=[`${Z.styleTitle("Usage:")} ${Z.styleUsage(Z.commandUsage($))}`,""],Q=Z.commandDescription($);if(Q.length>0)q=q.concat([Z.boxWrap(Z.styleCommandDescription(Q),z),""]);let Y=Z.visibleArguments($).map((W)=>{return J(Z.styleArgumentTerm(Z.argumentTerm(W)),Z.styleArgumentDescription(Z.argumentDescription(W)))});if(q=q.concat(this.formatItemList("Arguments:",Y,Z)),this.groupItems($.options,Z.visibleOptions($),(W)=>W.helpGroupHeading??"Options:").forEach((W,V)=>{let H=W.map((B)=>{return J(Z.styleOptionTerm(Z.optionTerm(B)),Z.styleOptionDescription(Z.optionDescription(B)))});q=q.concat(this.formatItemList(V,H,Z))}),Z.showGlobalOptions){let W=Z.visibleGlobalOptions($).map((V)=>{return J(Z.styleOptionTerm(Z.optionTerm(V)),Z.styleOptionDescription(Z.optionDescription(V)))});q=q.concat(this.formatItemList("Global Options:",W,Z))}return this.groupItems($.commands,Z.visibleCommands($),(W)=>W.helpGroup()||"Commands:").forEach((W,V)=>{let H=W.map((B)=>{return J(Z.styleSubcommandTerm(Z.subcommandTerm(B)),Z.styleSubcommandDescription(Z.subcommandDescription(B)))});q=q.concat(this.formatItemList(V,H,Z))}),q.join(`
3
3
  `)}displayWidth($){return m4($).length}styleTitle($){return $}styleUsage($){return $.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z==="[command]")return this.styleSubcommandText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleCommandText(Z)}).join(" ")}styleCommandDescription($){return this.styleDescriptionText($)}styleOptionDescription($){return this.styleDescriptionText($)}styleSubcommandDescription($){return this.styleDescriptionText($)}styleArgumentDescription($){return this.styleDescriptionText($)}styleDescriptionText($){return $}styleOptionTerm($){return this.styleOptionText($)}styleSubcommandTerm($){return $.split(" ").map((Z)=>{if(Z==="[options]")return this.styleOptionText(Z);if(Z[0]==="["||Z[0]==="<")return this.styleArgumentText(Z);return this.styleSubcommandText(Z)}).join(" ")}styleArgumentTerm($){return this.styleArgumentText($)}styleOptionText($){return $}styleArgumentText($){return $}styleSubcommandText($){return $}styleCommandText($){return $}padWidth($,Z){return Math.max(Z.longestOptionTermLength($,Z),Z.longestGlobalOptionTermLength($,Z),Z.longestSubcommandTermLength($,Z),Z.longestArgumentTermLength($,Z))}preformatted($){return/\n[^\S\r\n]/.test($)}formatItem($,Z,X,z){let q=" ".repeat(2);if(!X)return q+$;let Q=$.padEnd(Z+$.length-z.displayWidth($)),Y=2,U=(this.helpWidth??80)-Z-Y-2,W;if(U<this.minWidthToWrap||z.preformatted(X))W=X;else W=z.boxWrap(X,U).replace(/\n/g,`
4
4
  `+" ".repeat(Z+Y));return q+Q+" ".repeat(Y)+W.replace(/\n/g,`
5
5
  ${q}`)}boxWrap($,Z){if(Z<this.minWidthToWrap)return $;let X=$.split(/\r\n|\n/),z=/[\s]*[^\s]+/g,J=[];return X.forEach((q)=>{let Q=q.match(z);if(Q===null){J.push("");return}let Y=[Q.shift()],G=this.displayWidth(Y[0]);Q.forEach((U)=>{let W=this.displayWidth(U);if(G+W<=Z){Y.push(U),G+=W;return}J.push(Y.join(""));let V=U.trimStart();Y=[V],G=this.displayWidth(V)}),J.push(Y.join(""))}),J.join(`
6
- `)}}function m4($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}aJ.Help=u4;aJ.stripColor=m4});var t2=T((Zq)=>{var{InvalidArgumentError:eJ}=Y6();class c4{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=$q($);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,Z){return this.defaultValue=$,this.defaultValueDescription=Z,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let Z=$;if(typeof $==="string")Z={[$]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[$];return Z.push($),Z}choices($){return this.argChoices=$.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new eJ(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return d4(this.name().replace(/^no-/,""));return d4(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class p4{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((Z)=>{if(Z.negate)this.negativeOptions.set(Z.attributeName(),Z);else this.positiveOptions.set(Z.attributeName(),Z)}),this.negativeOptions.forEach((Z,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption($,Z){let X=Z.attributeName();if(!this.dualOptions.has(X))return!0;let z=this.negativeOptions.get(X).presetArg,J=z!==void 0?z:!1;return Z.negate===(J===$)}}function d4($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function $q($){let Z,X,z=/^-[^-]$/,J=/^--[^-]/,q=$.split(/[ |,]+/).concat("guard");if(z.test(q[0]))Z=q.shift();if(J.test(q[0]))X=q.shift();if(!Z&&z.test(q[0]))Z=q.shift();if(!Z&&J.test(q[0]))Z=X,X=q.shift();if(q[0].startsWith("-")){let Q=q[0],Y=`option creation failed due to '${Q}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Q))throw Error(`${Y}
6
+ `)}}function m4($){let Z=/\x1b\[\d*(;\d*)*m/g;return $.replace(Z,"")}tJ.Help=u4;tJ.stripColor=m4});var t2=L((zq)=>{var{InvalidArgumentError:Zq}=Y6();class c4{constructor($,Z){this.flags=$,this.description=Z||"",this.required=$.includes("<"),this.optional=$.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test($),this.mandatory=!1;let X=Xq($);if(this.short=X.shortFlag,this.long=X.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default($,Z){return this.defaultValue=$,this.defaultValueDescription=Z,this}preset($){return this.presetArg=$,this}conflicts($){return this.conflictsWith=this.conflictsWith.concat($),this}implies($){let Z=$;if(typeof $==="string")Z={[$]:!0};return this.implied=Object.assign(this.implied||{},Z),this}env($){return this.envVar=$,this}argParser($){return this.parseArg=$,this}makeOptionMandatory($=!0){return this.mandatory=!!$,this}hideHelp($=!0){return this.hidden=!!$,this}_collectValue($,Z){if(Z===this.defaultValue||!Array.isArray(Z))return[$];return Z.push($),Z}choices($){return this.argChoices=$.slice(),this.parseArg=(Z,X)=>{if(!this.argChoices.includes(Z))throw new Zq(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(Z,X);return Z},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return d4(this.name().replace(/^no-/,""));return d4(this.name())}helpGroup($){return this.helpGroupHeading=$,this}is($){return this.short===$||this.long===$}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class p4{constructor($){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,$.forEach((Z)=>{if(Z.negate)this.negativeOptions.set(Z.attributeName(),Z);else this.positiveOptions.set(Z.attributeName(),Z)}),this.negativeOptions.forEach((Z,X)=>{if(this.positiveOptions.has(X))this.dualOptions.add(X)})}valueFromOption($,Z){let X=Z.attributeName();if(!this.dualOptions.has(X))return!0;let z=this.negativeOptions.get(X).presetArg,J=z!==void 0?z:!1;return Z.negate===(J===$)}}function d4($){return $.split("-").reduce((Z,X)=>{return Z+X[0].toUpperCase()+X.slice(1)})}function Xq($){let Z,X,z=/^-[^-]$/,J=/^--[^-]/,q=$.split(/[ |,]+/).concat("guard");if(z.test(q[0]))Z=q.shift();if(J.test(q[0]))X=q.shift();if(!Z&&z.test(q[0]))Z=q.shift();if(!Z&&J.test(q[0]))Z=X,X=q.shift();if(q[0].startsWith("-")){let Q=q[0],Y=`option creation failed due to '${Q}' in option flags '${$}'`;if(/^-[^-][^-]/.test(Q))throw Error(`${Y}
7
7
  - a short flag is a single dash and a single character
8
8
  - either use a single dash and a single character (for a short flag)
9
9
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(z.test(Q))throw Error(`${Y}
10
10
  - too many short flags`);if(J.test(Q))throw Error(`${Y}
11
11
  - too many long flags`);throw Error(`${Y}
12
- - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:Z,longFlag:X}}Zq.Option=c4;Zq.DualOptions=p4});var l4=T((Qq)=>{function Jq($,Z){if(Math.abs($.length-Z.length)>3)return Math.max($.length,Z.length);let X=[];for(let z=0;z<=$.length;z++)X[z]=[z];for(let z=0;z<=Z.length;z++)X[0][z]=z;for(let z=1;z<=Z.length;z++)for(let J=1;J<=$.length;J++){let q=1;if($[J-1]===Z[z-1])q=0;else q=1;if(X[J][z]=Math.min(X[J-1][z]+1,X[J][z-1]+1,X[J-1][z-1]+q),J>1&&z>1&&$[J-1]===Z[z-2]&&$[J-2]===Z[z-1])X[J][z]=Math.min(X[J][z],X[J-2][z-2]+1)}return X[$.length][Z.length]}function qq($,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=$.startsWith("--");if(X)$=$.slice(2),Z=Z.map((Q)=>Q.slice(2));let z=[],J=3,q=0.4;if(Z.forEach((Q)=>{if(Q.length<=1)return;let Y=Jq($,Q),G=Math.max($.length,Q.length);if((G-Y)/G>q){if(Y<J)J=Y,z=[Q];else if(Y===J)z.push(Q)}}),z.sort((Q,Y)=>Q.localeCompare(Y)),X)z=z.map((Q)=>`--${Q}`);if(z.length>1)return`
12
+ - unrecognised flag format`)}if(Z===void 0&&X===void 0)throw Error(`option creation failed due to no flags found in '${$}'.`);return{shortFlag:Z,longFlag:X}}zq.Option=c4;zq.DualOptions=p4});var l4=L((Gq)=>{function Qq($,Z){if(Math.abs($.length-Z.length)>3)return Math.max($.length,Z.length);let X=[];for(let z=0;z<=$.length;z++)X[z]=[z];for(let z=0;z<=Z.length;z++)X[0][z]=z;for(let z=1;z<=Z.length;z++)for(let J=1;J<=$.length;J++){let q=1;if($[J-1]===Z[z-1])q=0;else q=1;if(X[J][z]=Math.min(X[J-1][z]+1,X[J][z-1]+1,X[J-1][z-1]+q),J>1&&z>1&&$[J-1]===Z[z-2]&&$[J-2]===Z[z-1])X[J][z]=Math.min(X[J][z],X[J-2][z-2]+1)}return X[$.length][Z.length]}function Yq($,Z){if(!Z||Z.length===0)return"";Z=Array.from(new Set(Z));let X=$.startsWith("--");if(X)$=$.slice(2),Z=Z.map((Q)=>Q.slice(2));let z=[],J=3,q=0.4;if(Z.forEach((Q)=>{if(Q.length<=1)return;let Y=Qq($,Q),G=Math.max($.length,Q.length);if((G-Y)/G>q){if(Y<J)J=Y,z=[Q];else if(Y===J)z.push(Q)}}),z.sort((Q,Y)=>Q.localeCompare(Y)),X)z=z.map((Q)=>`--${Q}`);if(z.length>1)return`
13
13
  (Did you mean one of ${z.join(", ")}?)`;if(z.length===1)return`
14
- (Did you mean ${z[0]}?)`;return""}Qq.suggestSimilar=qq});var r4=T((Bq)=>{var Gq=J0("node:events").EventEmitter,e2=J0("node:child_process"),_0=J0("node:path"),w8=J0("node:fs"),h=J0("node:process"),{Argument:Uq,humanReadableArgName:Wq}=O8(),{CommanderError:$Z}=Y6(),{Help:Hq,stripColor:Vq}=o2(),{Option:i4,DualOptions:Kq}=t2(),{suggestSimilar:n4}=l4();class XZ extends Gq{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(Z)=>h.stdout.write(Z),writeErr:(Z)=>h.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>h.stdout.isTTY?h.stdout.columns:void 0,getErrHelpWidth:()=>h.stderr.isTTY?h.stderr.columns:void 0,getOutHasColors:()=>ZZ()??(h.stdout.isTTY&&h.stdout.hasColors?.()),getErrHasColors:()=>ZZ()??(h.stderr.isTTY&&h.stderr.hasColors?.()),stripColor:(Z)=>Vq(Z)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let Z=this;Z;Z=Z.parent)$.push(Z);return $}command($,Z,X){let z=Z,J=X;if(typeof z==="object"&&z!==null)J=z,z=null;J=J||{};let[,q,Q]=$.match(/([^ ]+) *(.*)/),Y=this.createCommand(q);if(z)Y.description(z),Y._executableHandler=!0;if(J.isDefault)this._defaultCommandName=Y._name;if(Y._hidden=!!(J.noHelp||J.hidden),Y._executableFile=J.executableFile||null,Q)Y.arguments(Q);if(this._registerCommand(Y),Y.parent=this,Y.copyInheritedSettings(this),z)return this;return Y}createCommand($){return new XZ($)}createHelp(){return Object.assign(new Hq,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,Z){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
15
- - specify the name in Command constructor or using .name()`);if(Z=Z||{},Z.isDefault)this._defaultCommandName=$._name;if(Z.noHelp||Z.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,Z){return new Uq($,Z)}argument($,Z,X,z){let J=this.createArgument($,Z);if(typeof X==="function")J.default(z).argParser(X);else J.default(X);return this.addArgument(J),this}arguments($){return $.trim().split(/ +/).forEach((Z)=>{this.argument(Z)}),this}addArgument($){let Z=this.registeredArguments.slice(-1)[0];if(Z?.variadic)throw Error(`only the last argument can be variadic '${Z.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,Z){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=$??"help [command]",[,z,J]=X.match(/([^ ]+) *(.*)/),q=Z??"display help for command",Q=this.createCommand(z);if(Q.helpOption(!1),J)Q.arguments(J);if(q)Q.description(q);if(this._addImplicitHelpCommand=!0,this._helpCommand=Q,$||Z)this._initCommandGroup(Q);return this}addHelpCommand($,Z){if(typeof $!=="object")return this.helpCommand($,Z),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,Z){let X=["preSubcommand","preAction","postAction"];if(!X.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
16
- Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(Z);else this._lifeCycleHooks[$]=[Z];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(Z)=>{if(Z.code!=="commander.executeSubCommandAsync")throw Z};return this}_exit($,Z,X){if(this._exitCallback)this._exitCallback(new $Z($,Z,X));h.exit($)}action($){let Z=(X)=>{let z=this.registeredArguments.length,J=X.slice(0,z);if(this._storeOptionsAsProperties)J[z]=this;else J[z]=this.opts();return J.push(this),$.apply(this,J)};return this._actionHandler=Z,this}createOption($,Z){return new i4($,Z)}_callParseArg($,Z,X,z){try{return $.parseArg(Z,X)}catch(J){if(J.code==="commander.invalidArgument"){let q=`${z} ${J.message}`;this.error(q,{exitCode:J.exitCode,code:J.code})}throw J}}_registerOption($){let Z=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(Z){let X=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
17
- - already used by option '${Z.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let Z=(z)=>{return[z.name()].concat(z.aliases())},X=Z($).find((z)=>this._findCommand(z));if(X){let z=Z(this._findCommand(X)).join("|"),J=Z($).join("|");throw Error(`cannot add command '${J}' as already have command '${z}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let Z=$.name(),X=$.attributeName();if($.negate){let J=$.long.replace(/^--no-/,"--");if(!this._findOption(J))this.setOptionValueWithSource(X,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(X,$.defaultValue,"default");let z=(J,q,Q)=>{if(J==null&&$.presetArg!==void 0)J=$.presetArg;let Y=this.getOptionValue(X);if(J!==null&&$.parseArg)J=this._callParseArg($,J,Y,q);else if(J!==null&&$.variadic)J=$._collectValue(J,Y);if(J==null)if($.negate)J=!1;else if($.isBoolean()||$.optional)J=!0;else J="";this.setOptionValueWithSource(X,J,Q)};if(this.on("option:"+Z,(J)=>{let q=`error: option '${$.flags}' argument '${J}' is invalid.`;z(J,q,"cli")}),$.envVar)this.on("optionEnv:"+Z,(J)=>{let q=`error: option '${$.flags}' value '${J}' from env '${$.envVar}' is invalid.`;z(J,q,"env")});return this}_optionEx($,Z,X,z,J){if(typeof Z==="object"&&Z instanceof i4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let q=this.createOption(Z,X);if(q.makeOptionMandatory(!!$.mandatory),typeof z==="function")q.default(J).argParser(z);else if(z instanceof RegExp){let Q=z;z=(Y,G)=>{let U=Q.exec(Y);return U?U[0]:G},q.default(J).argParser(z)}else q.default(z);return this.addOption(q)}option($,Z,X,z){return this._optionEx({},$,Z,X,z)}requiredOption($,Z,X,z){return this._optionEx({mandatory:!0},$,Z,X,z)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,Z){return this.setOptionValueWithSource($,Z,void 0)}setOptionValueWithSource($,Z,X){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=X,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource($)!==void 0)Z=X.getOptionValueSource($)}),Z}_prepareUserArgs($,Z){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},$===void 0&&Z.from===void 0){if(h.versions?.electron)Z.from="electron";let z=h.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=h.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(h.defaultApp)this._scriptPath=$[1],X=$.slice(2);else X=$.slice(1);break;case"user":X=$.slice(0);break;case"eval":X=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${Z.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse($,Z){this._prepareForParse();let X=this._prepareUserArgs($,Z);return this._parseCommand([],X),this}async parseAsync($,Z){this._prepareForParse();let X=this._prepareUserArgs($,Z);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
14
+ (Did you mean ${z[0]}?)`;return""}Gq.suggestSimilar=Yq});var r4=L((Nq)=>{var Wq=J0("node:events").EventEmitter,e2=J0("node:child_process"),C0=J0("node:path"),w8=J0("node:fs"),v=J0("node:process"),{Argument:Hq,humanReadableArgName:Vq}=O8(),{CommanderError:$Z}=Y6(),{Help:Kq,stripColor:Dq}=o2(),{Option:i4,DualOptions:Bq}=t2(),{suggestSimilar:n4}=l4();class XZ extends Wq{constructor($){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=$||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(Z)=>v.stdout.write(Z),writeErr:(Z)=>v.stderr.write(Z),outputError:(Z,X)=>X(Z),getOutHelpWidth:()=>v.stdout.isTTY?v.stdout.columns:void 0,getErrHelpWidth:()=>v.stderr.isTTY?v.stderr.columns:void 0,getOutHasColors:()=>ZZ()??(v.stdout.isTTY&&v.stdout.hasColors?.()),getErrHasColors:()=>ZZ()??(v.stderr.isTTY&&v.stderr.hasColors?.()),stripColor:(Z)=>Dq(Z)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings($){return this._outputConfiguration=$._outputConfiguration,this._helpOption=$._helpOption,this._helpCommand=$._helpCommand,this._helpConfiguration=$._helpConfiguration,this._exitCallback=$._exitCallback,this._storeOptionsAsProperties=$._storeOptionsAsProperties,this._combineFlagAndOptionalValue=$._combineFlagAndOptionalValue,this._allowExcessArguments=$._allowExcessArguments,this._enablePositionalOptions=$._enablePositionalOptions,this._showHelpAfterError=$._showHelpAfterError,this._showSuggestionAfterError=$._showSuggestionAfterError,this}_getCommandAndAncestors(){let $=[];for(let Z=this;Z;Z=Z.parent)$.push(Z);return $}command($,Z,X){let z=Z,J=X;if(typeof z==="object"&&z!==null)J=z,z=null;J=J||{};let[,q,Q]=$.match(/([^ ]+) *(.*)/),Y=this.createCommand(q);if(z)Y.description(z),Y._executableHandler=!0;if(J.isDefault)this._defaultCommandName=Y._name;if(Y._hidden=!!(J.noHelp||J.hidden),Y._executableFile=J.executableFile||null,Q)Y.arguments(Q);if(this._registerCommand(Y),Y.parent=this,Y.copyInheritedSettings(this),z)return this;return Y}createCommand($){return new XZ($)}createHelp(){return Object.assign(new Kq,this.configureHelp())}configureHelp($){if($===void 0)return this._helpConfiguration;return this._helpConfiguration=$,this}configureOutput($){if($===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...$},this}showHelpAfterError($=!0){if(typeof $!=="string")$=!!$;return this._showHelpAfterError=$,this}showSuggestionAfterError($=!0){return this._showSuggestionAfterError=!!$,this}addCommand($,Z){if(!$._name)throw Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);if(Z=Z||{},Z.isDefault)this._defaultCommandName=$._name;if(Z.noHelp||Z.hidden)$._hidden=!0;return this._registerCommand($),$.parent=this,$._checkForBrokenPassThrough(),this}createArgument($,Z){return new Hq($,Z)}argument($,Z,X,z){let J=this.createArgument($,Z);if(typeof X==="function")J.default(z).argParser(X);else J.default(X);return this.addArgument(J),this}arguments($){return $.trim().split(/ +/).forEach((Z)=>{this.argument(Z)}),this}addArgument($){let Z=this.registeredArguments.slice(-1)[0];if(Z?.variadic)throw Error(`only the last argument can be variadic '${Z.name()}'`);if($.required&&$.defaultValue!==void 0&&$.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${$.name()}'`);return this.registeredArguments.push($),this}helpCommand($,Z){if(typeof $==="boolean"){if(this._addImplicitHelpCommand=$,$&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let X=$??"help [command]",[,z,J]=X.match(/([^ ]+) *(.*)/),q=Z??"display help for command",Q=this.createCommand(z);if(Q.helpOption(!1),J)Q.arguments(J);if(q)Q.description(q);if(this._addImplicitHelpCommand=!0,this._helpCommand=Q,$||Z)this._initCommandGroup(Q);return this}addHelpCommand($,Z){if(typeof $!=="object")return this.helpCommand($,Z),this;return this._addImplicitHelpCommand=!0,this._helpCommand=$,this._initCommandGroup($),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook($,Z){let X=["preSubcommand","preAction","postAction"];if(!X.includes($))throw Error(`Unexpected value for event passed to hook : '${$}'.
16
+ Expecting one of '${X.join("', '")}'`);if(this._lifeCycleHooks[$])this._lifeCycleHooks[$].push(Z);else this._lifeCycleHooks[$]=[Z];return this}exitOverride($){if($)this._exitCallback=$;else this._exitCallback=(Z)=>{if(Z.code!=="commander.executeSubCommandAsync")throw Z};return this}_exit($,Z,X){if(this._exitCallback)this._exitCallback(new $Z($,Z,X));v.exit($)}action($){let Z=(X)=>{let z=this.registeredArguments.length,J=X.slice(0,z);if(this._storeOptionsAsProperties)J[z]=this;else J[z]=this.opts();return J.push(this),$.apply(this,J)};return this._actionHandler=Z,this}createOption($,Z){return new i4($,Z)}_callParseArg($,Z,X,z){try{return $.parseArg(Z,X)}catch(J){if(J.code==="commander.invalidArgument"){let q=`${z} ${J.message}`;this.error(q,{exitCode:J.exitCode,code:J.code})}throw J}}_registerOption($){let Z=$.short&&this._findOption($.short)||$.long&&this._findOption($.long);if(Z){let X=$.long&&this._findOption($.long)?$.long:$.short;throw Error(`Cannot add option '${$.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${X}'
17
+ - already used by option '${Z.flags}'`)}this._initOptionGroup($),this.options.push($)}_registerCommand($){let Z=(z)=>{return[z.name()].concat(z.aliases())},X=Z($).find((z)=>this._findCommand(z));if(X){let z=Z(this._findCommand(X)).join("|"),J=Z($).join("|");throw Error(`cannot add command '${J}' as already have command '${z}'`)}this._initCommandGroup($),this.commands.push($)}addOption($){this._registerOption($);let Z=$.name(),X=$.attributeName();if($.negate){let J=$.long.replace(/^--no-/,"--");if(!this._findOption(J))this.setOptionValueWithSource(X,$.defaultValue===void 0?!0:$.defaultValue,"default")}else if($.defaultValue!==void 0)this.setOptionValueWithSource(X,$.defaultValue,"default");let z=(J,q,Q)=>{if(J==null&&$.presetArg!==void 0)J=$.presetArg;let Y=this.getOptionValue(X);if(J!==null&&$.parseArg)J=this._callParseArg($,J,Y,q);else if(J!==null&&$.variadic)J=$._collectValue(J,Y);if(J==null)if($.negate)J=!1;else if($.isBoolean()||$.optional)J=!0;else J="";this.setOptionValueWithSource(X,J,Q)};if(this.on("option:"+Z,(J)=>{let q=`error: option '${$.flags}' argument '${J}' is invalid.`;z(J,q,"cli")}),$.envVar)this.on("optionEnv:"+Z,(J)=>{let q=`error: option '${$.flags}' value '${J}' from env '${$.envVar}' is invalid.`;z(J,q,"env")});return this}_optionEx($,Z,X,z,J){if(typeof Z==="object"&&Z instanceof i4)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let q=this.createOption(Z,X);if(q.makeOptionMandatory(!!$.mandatory),typeof z==="function")q.default(J).argParser(z);else if(z instanceof RegExp){let Q=z;z=(Y,G)=>{let U=Q.exec(Y);return U?U[0]:G},q.default(J).argParser(z)}else q.default(z);return this.addOption(q)}option($,Z,X,z){return this._optionEx({},$,Z,X,z)}requiredOption($,Z,X,z){return this._optionEx({mandatory:!0},$,Z,X,z)}combineFlagAndOptionalValue($=!0){return this._combineFlagAndOptionalValue=!!$,this}allowUnknownOption($=!0){return this._allowUnknownOption=!!$,this}allowExcessArguments($=!0){return this._allowExcessArguments=!!$,this}enablePositionalOptions($=!0){return this._enablePositionalOptions=!!$,this}passThroughOptions($=!0){return this._passThroughOptions=!!$,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties($=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!$,this}getOptionValue($){if(this._storeOptionsAsProperties)return this[$];return this._optionValues[$]}setOptionValue($,Z){return this.setOptionValueWithSource($,Z,void 0)}setOptionValueWithSource($,Z,X){if(this._storeOptionsAsProperties)this[$]=Z;else this._optionValues[$]=Z;return this._optionValueSources[$]=X,this}getOptionValueSource($){return this._optionValueSources[$]}getOptionValueSourceWithGlobals($){let Z;return this._getCommandAndAncestors().forEach((X)=>{if(X.getOptionValueSource($)!==void 0)Z=X.getOptionValueSource($)}),Z}_prepareUserArgs($,Z){if($!==void 0&&!Array.isArray($))throw Error("first parameter to parse must be array or undefined");if(Z=Z||{},$===void 0&&Z.from===void 0){if(v.versions?.electron)Z.from="electron";let z=v.execArgv??[];if(z.includes("-e")||z.includes("--eval")||z.includes("-p")||z.includes("--print"))Z.from="eval"}if($===void 0)$=v.argv;this.rawArgs=$.slice();let X;switch(Z.from){case void 0:case"node":this._scriptPath=$[1],X=$.slice(2);break;case"electron":if(v.defaultApp)this._scriptPath=$[1],X=$.slice(2);else X=$.slice(1);break;case"user":X=$.slice(0);break;case"eval":X=$.slice(1);break;default:throw Error(`unexpected parse option { from: '${Z.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",X}parse($,Z){this._prepareForParse();let X=this._prepareUserArgs($,Z);return this._parseCommand([],X),this}async parseAsync($,Z){this._prepareForParse();let X=this._prepareUserArgs($,Z);return await this._parseCommand([],X),this}_prepareForParse(){if(this._savedState===null)this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
18
18
  - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable($,Z,X){if(w8.existsSync($))return;let z=Z?`searched for local subcommand relative to directory '${Z}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",J=`'${$}' does not exist
19
19
  - if '${X}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
20
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
- - ${z}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let X=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(U,W){let V=_0.resolve(U,W);if(w8.existsSync(V))return V;if(z.includes(_0.extname(W)))return;let H=z.find((D)=>w8.existsSync(`${V}${D}`));if(H)return`${V}${H}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let q=$._executableFile||`${this._name}-${$._name}`,Q=this._executableDir||"";if(this._scriptPath){let U;try{U=w8.realpathSync(this._scriptPath)}catch{U=this._scriptPath}Q=_0.resolve(_0.dirname(U),Q)}if(Q){let U=J(Q,q);if(!U&&!$._executableFile&&this._scriptPath){let W=_0.basename(this._scriptPath,_0.extname(this._scriptPath));if(W!==this._name)U=J(Q,`${W}-${$._name}`)}q=U||q}X=z.includes(_0.extname(q));let Y;if(h.platform!=="win32")if(X)Z.unshift(q),Z=s4(h.execArgv).concat(Z),Y=e2.spawn(h.argv[0],Z,{stdio:"inherit"});else Y=e2.spawn(q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(q,Q,$._name),Z.unshift(q),Z=s4(h.execArgv).concat(Z),Y=e2.spawn(h.execPath,Z,{stdio:"inherit"});if(!Y.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{h.on(W,()=>{if(Y.killed===!1&&Y.exitCode===null)Y.kill(W)})});let G=this._exitCallback;Y.on("close",(U)=>{if(U=U??1,!G)h.exit(U);else G(new $Z(U,"commander.executeSubCommandAsync","(close)"))}),Y.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(q,Q,$._name);else if(U.code==="EACCES")throw Error(`'${q}' not executable`);if(!G)h.exit(1);else{let W=new $Z(1,"commander.executeSubCommandAsync","(error)");W.nestedError=U,G(W)}}),this.runningCommand=Y}_dispatchSubcommand($,Z,X){let z=this._findCommand($);if(!z)this.help({error:!0});z._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,z,"preSubcommand"),J=this._chainOrCall(J,()=>{if(z._executableHandler)this._executeSubCommand(z,Z.concat(X));else return z._parseCommand(Z,X)}),J}_dispatchHelpCommand($){if(!$)this.help();let Z=this._findCommand($);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,Z)=>{if($.required&&this.args[Z]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(X,z,J)=>{let q=z;if(z!==null&&X.parseArg){let Q=`error: command-argument value '${z}' is invalid for argument '${X.name()}'.`;q=this._callParseArg(X,z,J,Q)}return q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,z)=>{let J=X.defaultValue;if(X.variadic){if(z<this.args.length){if(J=this.args.slice(z),X.parseArg)J=J.reduce((q,Q)=>{return $(X,Q,q)},X.defaultValue)}else if(J===void 0)J=[]}else if(z<this.args.length){if(J=this.args[z],X.parseArg)J=$(X,J,X.defaultValue)}Z[z]=J}),this.processedArgs=Z}_chainOrCall($,Z){if($?.then&&typeof $.then==="function")return $.then(()=>Z());return Z()}_chainOrCallHooks($,Z){let X=$,z=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[Z]!==void 0).forEach((J)=>{J._lifeCycleHooks[Z].forEach((q)=>{z.push({hookedCommand:J,callback:q})})}),Z==="postAction")z.reverse();return z.forEach((J)=>{X=this._chainOrCall(X,()=>{return J.callback(J.hookedCommand,this)})}),X}_chainOrCallSubCommandHook($,Z,X){let z=$;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach((J)=>{z=this._chainOrCall(z,()=>{return J(this,Z)})});return z}_parseCommand($,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(X.operands),Z=X.unknown,this.args=$.concat(Z),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),Z);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,$,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){z(),this._processArguments();let q;if(q=this._chainOrCallHooks(q,"preAction"),q=this._chainOrCall(q,()=>this._actionHandler(this.processedArgs)),this.parent)q=this._chainOrCall(q,()=>{this.parent.emit(J,$,Z)});return q=this._chainOrCallHooks(q,"postAction"),q}if(this.parent?.listenerCount(J))z(),this._processArguments(),this.parent.emit(J,$,Z);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,Z);if(this.listenerCount("command:*"))this.emit("command:*",$,Z);else if(this.commands.length)this.unknownCommand();else z(),this._processArguments()}else if(this.commands.length)z(),this.help({error:!0});else z(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((Z)=>Z._name===$||Z._aliases.includes($))}_findOption($){return this.options.find((Z)=>Z.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((Z)=>{if(Z.mandatory&&$.getOptionValue(Z.attributeName())===void 0)$.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((X)=>{let z=X.attributeName();if(this.getOptionValue(z)===void 0)return!1;return this.getOptionValueSource(z)!=="default"});$.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let z=$.find((J)=>X.conflictsWith.includes(J.attributeName()));if(z)this._conflictingOption(X,z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let Z=[],X=[],z=Z;function J(U){return U.length>1&&U[0]==="-"}let q=(U)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(U))return!1;return!this._getCommandAndAncestors().some((W)=>W.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Q=null,Y=null,G=0;while(G<$.length||Y){let U=Y??$[G++];if(Y=null,U==="--"){if(z===X)z.push(U);z.push(...$.slice(G));break}if(Q&&(!J(U)||q(U))){this.emit(`option:${Q.name()}`,U);continue}if(Q=null,J(U)){let W=this._findOption(U);if(W){if(W.required){let V=$[G++];if(V===void 0)this.optionMissingArgument(W);this.emit(`option:${W.name()}`,V)}else if(W.optional){let V=null;if(G<$.length&&(!J($[G])||q($[G])))V=$[G++];this.emit(`option:${W.name()}`,V)}else this.emit(`option:${W.name()}`);Q=W.variadic?W:null;continue}}if(U.length>2&&U[0]==="-"&&U[1]!=="-"){let W=this._findOption(`-${U[1]}`);if(W){if(W.required||W.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${W.name()}`,U.slice(2));else this.emit(`option:${W.name()}`),Y=`-${U.slice(2)}`;continue}}if(/^--[^=]+=/.test(U)){let W=U.indexOf("="),V=this._findOption(U.slice(0,W));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,U.slice(W+1));continue}}if(z===Z&&J(U)&&!(this.commands.length===0&&q(U)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(U)){Z.push(U),X.push(...$.slice(G));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){Z.push(U,...$.slice(G));break}else if(this._defaultCommandName){X.push(U,...$.slice(G));break}}if(this._passThroughOptions){z.push(U,...$.slice(G));break}z.push(U)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
21
+ - ${z}`;throw Error(J)}_executeSubCommand($,Z){Z=Z.slice();let X=!1,z=[".js",".ts",".tsx",".mjs",".cjs"];function J(U,W){let V=C0.resolve(U,W);if(w8.existsSync(V))return V;if(z.includes(C0.extname(W)))return;let H=z.find((B)=>w8.existsSync(`${V}${B}`));if(H)return`${V}${H}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let q=$._executableFile||`${this._name}-${$._name}`,Q=this._executableDir||"";if(this._scriptPath){let U;try{U=w8.realpathSync(this._scriptPath)}catch{U=this._scriptPath}Q=C0.resolve(C0.dirname(U),Q)}if(Q){let U=J(Q,q);if(!U&&!$._executableFile&&this._scriptPath){let W=C0.basename(this._scriptPath,C0.extname(this._scriptPath));if(W!==this._name)U=J(Q,`${W}-${$._name}`)}q=U||q}X=z.includes(C0.extname(q));let Y;if(v.platform!=="win32")if(X)Z.unshift(q),Z=s4(v.execArgv).concat(Z),Y=e2.spawn(v.argv[0],Z,{stdio:"inherit"});else Y=e2.spawn(q,Z,{stdio:"inherit"});else this._checkForMissingExecutable(q,Q,$._name),Z.unshift(q),Z=s4(v.execArgv).concat(Z),Y=e2.spawn(v.execPath,Z,{stdio:"inherit"});if(!Y.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((W)=>{v.on(W,()=>{if(Y.killed===!1&&Y.exitCode===null)Y.kill(W)})});let G=this._exitCallback;Y.on("close",(U)=>{if(U=U??1,!G)v.exit(U);else G(new $Z(U,"commander.executeSubCommandAsync","(close)"))}),Y.on("error",(U)=>{if(U.code==="ENOENT")this._checkForMissingExecutable(q,Q,$._name);else if(U.code==="EACCES")throw Error(`'${q}' not executable`);if(!G)v.exit(1);else{let W=new $Z(1,"commander.executeSubCommandAsync","(error)");W.nestedError=U,G(W)}}),this.runningCommand=Y}_dispatchSubcommand($,Z,X){let z=this._findCommand($);if(!z)this.help({error:!0});z._prepareForParse();let J;return J=this._chainOrCallSubCommandHook(J,z,"preSubcommand"),J=this._chainOrCall(J,()=>{if(z._executableHandler)this._executeSubCommand(z,Z.concat(X));else return z._parseCommand(Z,X)}),J}_dispatchHelpCommand($){if(!$)this.help();let Z=this._findCommand($);if(Z&&!Z._executableHandler)Z.help();return this._dispatchSubcommand($,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach(($,Z)=>{if($.required&&this.args[Z]==null)this.missingArgument($.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let $=(X,z,J)=>{let q=z;if(z!==null&&X.parseArg){let Q=`error: command-argument value '${z}' is invalid for argument '${X.name()}'.`;q=this._callParseArg(X,z,J,Q)}return q};this._checkNumberOfArguments();let Z=[];this.registeredArguments.forEach((X,z)=>{let J=X.defaultValue;if(X.variadic){if(z<this.args.length){if(J=this.args.slice(z),X.parseArg)J=J.reduce((q,Q)=>{return $(X,Q,q)},X.defaultValue)}else if(J===void 0)J=[]}else if(z<this.args.length){if(J=this.args[z],X.parseArg)J=$(X,J,X.defaultValue)}Z[z]=J}),this.processedArgs=Z}_chainOrCall($,Z){if($?.then&&typeof $.then==="function")return $.then(()=>Z());return Z()}_chainOrCallHooks($,Z){let X=$,z=[];if(this._getCommandAndAncestors().reverse().filter((J)=>J._lifeCycleHooks[Z]!==void 0).forEach((J)=>{J._lifeCycleHooks[Z].forEach((q)=>{z.push({hookedCommand:J,callback:q})})}),Z==="postAction")z.reverse();return z.forEach((J)=>{X=this._chainOrCall(X,()=>{return J.callback(J.hookedCommand,this)})}),X}_chainOrCallSubCommandHook($,Z,X){let z=$;if(this._lifeCycleHooks[X]!==void 0)this._lifeCycleHooks[X].forEach((J)=>{z=this._chainOrCall(z,()=>{return J(this,Z)})});return z}_parseCommand($,Z){let X=this.parseOptions(Z);if(this._parseOptionsEnv(),this._parseOptionsImplied(),$=$.concat(X.operands),Z=X.unknown,this.args=$.concat(Z),$&&this._findCommand($[0]))return this._dispatchSubcommand($[0],$.slice(1),Z);if(this._getHelpCommand()&&$[0]===this._getHelpCommand().name())return this._dispatchHelpCommand($[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(Z),this._dispatchSubcommand(this._defaultCommandName,$,Z);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(X.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let z=()=>{if(X.unknown.length>0)this.unknownOption(X.unknown[0])},J=`command:${this.name()}`;if(this._actionHandler){z(),this._processArguments();let q;if(q=this._chainOrCallHooks(q,"preAction"),q=this._chainOrCall(q,()=>this._actionHandler(this.processedArgs)),this.parent)q=this._chainOrCall(q,()=>{this.parent.emit(J,$,Z)});return q=this._chainOrCallHooks(q,"postAction"),q}if(this.parent?.listenerCount(J))z(),this._processArguments(),this.parent.emit(J,$,Z);else if($.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",$,Z);if(this.listenerCount("command:*"))this.emit("command:*",$,Z);else if(this.commands.length)this.unknownCommand();else z(),this._processArguments()}else if(this.commands.length)z(),this.help({error:!0});else z(),this._processArguments()}_findCommand($){if(!$)return;return this.commands.find((Z)=>Z._name===$||Z._aliases.includes($))}_findOption($){return this.options.find((Z)=>Z.is($))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(($)=>{$.options.forEach((Z)=>{if(Z.mandatory&&$.getOptionValue(Z.attributeName())===void 0)$.missingMandatoryOptionValue(Z)})})}_checkForConflictingLocalOptions(){let $=this.options.filter((X)=>{let z=X.attributeName();if(this.getOptionValue(z)===void 0)return!1;return this.getOptionValueSource(z)!=="default"});$.filter((X)=>X.conflictsWith.length>0).forEach((X)=>{let z=$.find((J)=>X.conflictsWith.includes(J.attributeName()));if(z)this._conflictingOption(X,z)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(($)=>{$._checkForConflictingLocalOptions()})}parseOptions($){let Z=[],X=[],z=Z;function J(U){return U.length>1&&U[0]==="-"}let q=(U)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(U))return!1;return!this._getCommandAndAncestors().some((W)=>W.options.map((V)=>V.short).some((V)=>/^-\d$/.test(V)))},Q=null,Y=null,G=0;while(G<$.length||Y){let U=Y??$[G++];if(Y=null,U==="--"){if(z===X)z.push(U);z.push(...$.slice(G));break}if(Q&&(!J(U)||q(U))){this.emit(`option:${Q.name()}`,U);continue}if(Q=null,J(U)){let W=this._findOption(U);if(W){if(W.required){let V=$[G++];if(V===void 0)this.optionMissingArgument(W);this.emit(`option:${W.name()}`,V)}else if(W.optional){let V=null;if(G<$.length&&(!J($[G])||q($[G])))V=$[G++];this.emit(`option:${W.name()}`,V)}else this.emit(`option:${W.name()}`);Q=W.variadic?W:null;continue}}if(U.length>2&&U[0]==="-"&&U[1]!=="-"){let W=this._findOption(`-${U[1]}`);if(W){if(W.required||W.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${W.name()}`,U.slice(2));else this.emit(`option:${W.name()}`),Y=`-${U.slice(2)}`;continue}}if(/^--[^=]+=/.test(U)){let W=U.indexOf("="),V=this._findOption(U.slice(0,W));if(V&&(V.required||V.optional)){this.emit(`option:${V.name()}`,U.slice(W+1));continue}}if(z===Z&&J(U)&&!(this.commands.length===0&&q(U)))z=X;if((this._enablePositionalOptions||this._passThroughOptions)&&Z.length===0&&X.length===0){if(this._findCommand(U)){Z.push(U),X.push(...$.slice(G));break}else if(this._getHelpCommand()&&U===this._getHelpCommand().name()){Z.push(U,...$.slice(G));break}else if(this._defaultCommandName){X.push(U,...$.slice(G));break}}if(this._passThroughOptions){z.push(U,...$.slice(G));break}z.push(U)}return{operands:Z,unknown:X}}opts(){if(this._storeOptionsAsProperties){let $={},Z=this.options.length;for(let X=0;X<Z;X++){let z=this.options[X].attributeName();$[z]=z===this._versionOptionName?this._version:this[z]}return $}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(($,Z)=>Object.assign($,Z.opts()),{})}error($,Z){if(this._outputConfiguration.outputError(`${$}
22
22
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
23
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
24
- `),this.outputHelp({error:!0});let X=Z||{},z=X.exitCode||1,J=X.code||"commander.error";this._exit(z,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in h.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,h.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new Kq(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&$.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((z)=>!Z(z)).forEach((z)=>{this.setOptionValueWithSource(z,X.implied[z],"implied")})})}missingArgument($){let Z=`error: missing required argument '${$}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument($){let Z=`error: option '${$.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let Z=`error: required option '${$.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,Z){let X=(q)=>{let Q=q.attributeName(),Y=this.getOptionValue(Q),G=this.options.find((W)=>W.negate&&Q===W.attributeName()),U=this.options.find((W)=>!W.negate&&Q===W.attributeName());if(G&&(G.presetArg===void 0&&Y===!1||G.presetArg!==void 0&&Y===G.presetArg))return G;return U||q},z=(q)=>{let Q=X(q),Y=Q.attributeName();if(this.getOptionValueSource(Y)==="env")return`environment variable '${Q.envVar}'`;return`option '${Q.flags}'`},J=`error: ${z($)} cannot be used with ${z(Z)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let Z="";if($.startsWith("--")&&this._showSuggestionAfterError){let z=[],J=this;do{let q=J.createHelp().visibleOptions(J).filter((Q)=>Q.long).map((Q)=>Q.long);z=z.concat(q),J=J.parent}while(J&&!J._enablePositionalOptions);Z=n4($,z)}let X=`error: unknown option '${$}'${Z}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,X=Z===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${X} but got ${$.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],Z="";if(this._showSuggestionAfterError){let z=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(z.push(J.name()),J.alias())z.push(J.alias())}),Z=n4($,z)}let X=`error: unknown command '${$}'${Z}`;this.error(X,{code:"commander.unknownCommand"})}version($,Z,X){if($===void 0)return this._version;this._version=$,Z=Z||"-V, --version",X=X||"output the version number";let z=this.createOption(Z,X);return this._versionOptionName=z.attributeName(),this._registerOption(z),this.on("option:"+z.name(),()=>{this._outputConfiguration.writeOut(`${$}
25
- `),this._exit(0,"commander.version",$)}),this}description($,Z){if($===void 0&&Z===void 0)return this._description;if(this._description=$,Z)this._argsDescription=Z;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let Z=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Z=this.commands[this.commands.length-1];if($===Z._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand($);if(X){let z=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${z}'`)}return Z._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((Z)=>this.alias(Z)),this}usage($){if($===void 0){if(this._usage)return this._usage;let Z=this.registeredArguments.map((X)=>{return Wq(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=_0.basename($,_0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let Z=this.createHelp(),X=this._getOutputContext($);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let z=Z.formatHelp(this,Z);if(X.hasColors)return z;return this._outputConfiguration.stripColor(z)}_getOutputContext($){$=$||{};let Z=!!$.error,X,z,J;if(Z)X=(Q)=>this._outputConfiguration.writeErr(Q),z=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else X=(Q)=>this._outputConfiguration.writeOut(Q),z=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(Q)=>{if(!z)Q=this._outputConfiguration.stripColor(Q);return X(Q)},hasColors:z,helpWidth:J}}outputHelp($){let Z;if(typeof $==="function")Z=$,$=void 0;let X=this._getOutputContext($),z={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((q)=>q.emit("beforeAllHelp",z)),this.emit("beforeHelp",z);let J=this.helpInformation({error:X.error});if(Z){if(J=Z(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",z),this._getCommandAndAncestors().forEach((q)=>q.emit("afterAllHelp",z))}helpOption($,Z){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",Z??"display help for command"),$||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let Z=Number(h.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
24
+ `),this.outputHelp({error:!0});let X=Z||{},z=X.exitCode||1,J=X.code||"commander.error";this._exit(z,J,$)}_parseOptionsEnv(){this.options.forEach(($)=>{if($.envVar&&$.envVar in v.env){let Z=$.attributeName();if(this.getOptionValue(Z)===void 0||["default","config","env"].includes(this.getOptionValueSource(Z)))if($.required||$.optional)this.emit(`optionEnv:${$.name()}`,v.env[$.envVar]);else this.emit(`optionEnv:${$.name()}`)}})}_parseOptionsImplied(){let $=new Bq(this.options),Z=(X)=>{return this.getOptionValue(X)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(X))};this.options.filter((X)=>X.implied!==void 0&&Z(X.attributeName())&&$.valueFromOption(this.getOptionValue(X.attributeName()),X)).forEach((X)=>{Object.keys(X.implied).filter((z)=>!Z(z)).forEach((z)=>{this.setOptionValueWithSource(z,X.implied[z],"implied")})})}missingArgument($){let Z=`error: missing required argument '${$}'`;this.error(Z,{code:"commander.missingArgument"})}optionMissingArgument($){let Z=`error: option '${$.flags}' argument missing`;this.error(Z,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue($){let Z=`error: required option '${$.flags}' not specified`;this.error(Z,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption($,Z){let X=(q)=>{let Q=q.attributeName(),Y=this.getOptionValue(Q),G=this.options.find((W)=>W.negate&&Q===W.attributeName()),U=this.options.find((W)=>!W.negate&&Q===W.attributeName());if(G&&(G.presetArg===void 0&&Y===!1||G.presetArg!==void 0&&Y===G.presetArg))return G;return U||q},z=(q)=>{let Q=X(q),Y=Q.attributeName();if(this.getOptionValueSource(Y)==="env")return`environment variable '${Q.envVar}'`;return`option '${Q.flags}'`},J=`error: ${z($)} cannot be used with ${z(Z)}`;this.error(J,{code:"commander.conflictingOption"})}unknownOption($){if(this._allowUnknownOption)return;let Z="";if($.startsWith("--")&&this._showSuggestionAfterError){let z=[],J=this;do{let q=J.createHelp().visibleOptions(J).filter((Q)=>Q.long).map((Q)=>Q.long);z=z.concat(q),J=J.parent}while(J&&!J._enablePositionalOptions);Z=n4($,z)}let X=`error: unknown option '${$}'${Z}`;this.error(X,{code:"commander.unknownOption"})}_excessArguments($){if(this._allowExcessArguments)return;let Z=this.registeredArguments.length,X=Z===1?"":"s",J=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${Z} argument${X} but got ${$.length}.`;this.error(J,{code:"commander.excessArguments"})}unknownCommand(){let $=this.args[0],Z="";if(this._showSuggestionAfterError){let z=[];this.createHelp().visibleCommands(this).forEach((J)=>{if(z.push(J.name()),J.alias())z.push(J.alias())}),Z=n4($,z)}let X=`error: unknown command '${$}'${Z}`;this.error(X,{code:"commander.unknownCommand"})}version($,Z,X){if($===void 0)return this._version;this._version=$,Z=Z||"-V, --version",X=X||"output the version number";let z=this.createOption(Z,X);return this._versionOptionName=z.attributeName(),this._registerOption(z),this.on("option:"+z.name(),()=>{this._outputConfiguration.writeOut(`${$}
25
+ `),this._exit(0,"commander.version",$)}),this}description($,Z){if($===void 0&&Z===void 0)return this._description;if(this._description=$,Z)this._argsDescription=Z;return this}summary($){if($===void 0)return this._summary;return this._summary=$,this}alias($){if($===void 0)return this._aliases[0];let Z=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)Z=this.commands[this.commands.length-1];if($===Z._name)throw Error("Command alias can't be the same as its name");let X=this.parent?._findCommand($);if(X){let z=[X.name()].concat(X.aliases()).join("|");throw Error(`cannot add alias '${$}' to command '${this.name()}' as already have command '${z}'`)}return Z._aliases.push($),this}aliases($){if($===void 0)return this._aliases;return $.forEach((Z)=>this.alias(Z)),this}usage($){if($===void 0){if(this._usage)return this._usage;let Z=this.registeredArguments.map((X)=>{return Vq(X)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?Z:[]).join(" ")}return this._usage=$,this}name($){if($===void 0)return this._name;return this._name=$,this}helpGroup($){if($===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=$,this}commandsGroup($){if($===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=$,this}optionsGroup($){if($===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=$,this}_initOptionGroup($){if(this._defaultOptionGroup&&!$.helpGroupHeading)$.helpGroup(this._defaultOptionGroup)}_initCommandGroup($){if(this._defaultCommandGroup&&!$.helpGroup())$.helpGroup(this._defaultCommandGroup)}nameFromFilename($){return this._name=C0.basename($,C0.extname($)),this}executableDir($){if($===void 0)return this._executableDir;return this._executableDir=$,this}helpInformation($){let Z=this.createHelp(),X=this._getOutputContext($);Z.prepareContext({error:X.error,helpWidth:X.helpWidth,outputHasColors:X.hasColors});let z=Z.formatHelp(this,Z);if(X.hasColors)return z;return this._outputConfiguration.stripColor(z)}_getOutputContext($){$=$||{};let Z=!!$.error,X,z,J;if(Z)X=(Q)=>this._outputConfiguration.writeErr(Q),z=this._outputConfiguration.getErrHasColors(),J=this._outputConfiguration.getErrHelpWidth();else X=(Q)=>this._outputConfiguration.writeOut(Q),z=this._outputConfiguration.getOutHasColors(),J=this._outputConfiguration.getOutHelpWidth();return{error:Z,write:(Q)=>{if(!z)Q=this._outputConfiguration.stripColor(Q);return X(Q)},hasColors:z,helpWidth:J}}outputHelp($){let Z;if(typeof $==="function")Z=$,$=void 0;let X=this._getOutputContext($),z={error:X.error,write:X.write,command:this};this._getCommandAndAncestors().reverse().forEach((q)=>q.emit("beforeAllHelp",z)),this.emit("beforeHelp",z);let J=this.helpInformation({error:X.error});if(Z){if(J=Z(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if(X.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",z),this._getCommandAndAncestors().forEach((q)=>q.emit("afterAllHelp",z))}helpOption($,Z){if(typeof $==="boolean"){if($){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption($??"-h, --help",Z??"display help for command"),$||Z)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption($){return this._helpOption=$,this._initOptionGroup($),this}help($){this.outputHelp($);let Z=Number(v.exitCode??0);if(Z===0&&$&&typeof $!=="function"&&$.error)Z=1;this._exit(Z,"commander.help","(outputHelp)")}addHelpText($,Z){let X=["beforeAll","before","after","afterAll"];if(!X.includes($))throw Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${X.join("', '")}'`);let z=`${$}Help`;return this.on(z,(J)=>{let q;if(typeof Z==="function")q=Z({error:J.error,command:J.command});else q=Z;if(q)J.write(`${q}
27
- `)}),this}_outputHelpIfRequested($){let Z=this._getHelpOption();if(Z&&$.find((z)=>Z.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function s4($){return $.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let X,z="127.0.0.1",J="9229",q;if((q=Z.match(/^(--inspect(-brk)?)$/))!==null)X=q[1];else if((q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=q[1],/^\d+$/.test(q[3]))J=q[3];else z=q[3];else if((q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=q[1],z=q[3],J=q[4];if(X&&J!=="0")return`${X}=${z}:${parseInt(J)+1}`;return Z})}function ZZ(){if(h.env.NO_COLOR||h.env.FORCE_COLOR==="0"||h.env.FORCE_COLOR==="false")return!1;if(h.env.FORCE_COLOR||h.env.CLICOLOR_FORCE!==void 0)return!0;return}Bq.Command=XZ;Bq.useColor=ZZ});var e4=T((Tq)=>{var{Argument:a4}=O8(),{Command:zZ}=r4(),{CommanderError:Iq,InvalidArgumentError:o4}=Y6(),{Help:Lq}=o2(),{Option:t4}=t2();Tq.program=new zZ;Tq.createCommand=($)=>new zZ($);Tq.createOption=($,Z)=>new t4($,Z);Tq.createArgument=($,Z)=>new a4($,Z);Tq.Command=zZ;Tq.Option=t4;Tq.Argument=a4;Tq.Help=Lq;Tq.CommanderError=Iq;Tq.InvalidArgumentError=o4;Tq.InvalidOptionArgumentError=o4});var k=T((hq)=>{var JZ=Symbol.for("yaml.alias"),X7=Symbol.for("yaml.document"),F8=Symbol.for("yaml.map"),z7=Symbol.for("yaml.pair"),qZ=Symbol.for("yaml.scalar"),R8=Symbol.for("yaml.seq"),C0=Symbol.for("yaml.node.type"),jq=($)=>!!$&&typeof $==="object"&&$[C0]===JZ,bq=($)=>!!$&&typeof $==="object"&&$[C0]===X7,xq=($)=>!!$&&typeof $==="object"&&$[C0]===F8,kq=($)=>!!$&&typeof $==="object"&&$[C0]===z7,J7=($)=>!!$&&typeof $==="object"&&$[C0]===qZ,fq=($)=>!!$&&typeof $==="object"&&$[C0]===R8;function q7($){if($&&typeof $==="object")switch($[C0]){case F8:case R8:return!0}return!1}function yq($){if($&&typeof $==="object")switch($[C0]){case JZ:case F8:case qZ:case R8:return!0}return!1}var gq=($)=>(J7($)||q7($))&&!!$.anchor;hq.ALIAS=JZ;hq.DOC=X7;hq.MAP=F8;hq.NODE_TYPE=C0;hq.PAIR=z7;hq.SCALAR=qZ;hq.SEQ=R8;hq.hasAnchor=gq;hq.isAlias=jq;hq.isCollection=q7;hq.isDocument=bq;hq.isMap=xq;hq.isNode=yq;hq.isPair=kq;hq.isScalar=J7;hq.isSeq=fq});var G6=T((ZQ)=>{var Z0=k(),G0=Symbol("break visit"),Q7=Symbol("skip children"),F0=Symbol("remove node");function A8($,Z){let X=Y7(Z);if(Z0.isDocument($)){if(O$(null,$.contents,X,Object.freeze([$]))===F0)$.contents=null}else O$(null,$,X,Object.freeze([]))}A8.BREAK=G0;A8.SKIP=Q7;A8.REMOVE=F0;function O$($,Z,X,z){let J=G7($,Z,X,z);if(Z0.isNode(J)||Z0.isPair(J))return U7($,z,J),O$($,J,X,z);if(typeof J!=="symbol"){if(Z0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let q=0;q<Z.items.length;++q){let Q=O$(q,Z.items[q],X,z);if(typeof Q==="number")q=Q-1;else if(Q===G0)return G0;else if(Q===F0)Z.items.splice(q,1),q-=1}}else if(Z0.isPair(Z)){z=Object.freeze(z.concat(Z));let q=O$("key",Z.key,X,z);if(q===G0)return G0;else if(q===F0)Z.key=null;let Q=O$("value",Z.value,X,z);if(Q===G0)return G0;else if(Q===F0)Z.value=null}}return J}async function P8($,Z){let X=Y7(Z);if(Z0.isDocument($)){if(await w$(null,$.contents,X,Object.freeze([$]))===F0)$.contents=null}else await w$(null,$,X,Object.freeze([]))}P8.BREAK=G0;P8.SKIP=Q7;P8.REMOVE=F0;async function w$($,Z,X,z){let J=await G7($,Z,X,z);if(Z0.isNode(J)||Z0.isPair(J))return U7($,z,J),w$($,J,X,z);if(typeof J!=="symbol"){if(Z0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let q=0;q<Z.items.length;++q){let Q=await w$(q,Z.items[q],X,z);if(typeof Q==="number")q=Q-1;else if(Q===G0)return G0;else if(Q===F0)Z.items.splice(q,1),q-=1}}else if(Z0.isPair(Z)){z=Object.freeze(z.concat(Z));let q=await w$("key",Z.key,X,z);if(q===G0)return G0;else if(q===F0)Z.key=null;let Q=await w$("value",Z.value,X,z);if(Q===G0)return G0;else if(Q===F0)Z.value=null}}return J}function Y7($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function G7($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(Z0.isMap(Z))return X.Map?.($,Z,z);if(Z0.isSeq(Z))return X.Seq?.($,Z,z);if(Z0.isPair(Z))return X.Pair?.($,Z,z);if(Z0.isScalar(Z))return X.Scalar?.($,Z,z);if(Z0.isAlias(Z))return X.Alias?.($,Z,z);return}function U7($,Z,X){let z=Z[Z.length-1];if(Z0.isCollection(z))z.items[$]=X;else if(Z0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(Z0.isDocument(z))z.contents=X;else{let J=Z0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}ZQ.visit=A8;ZQ.visitAsync=P8});var QZ=T((YQ)=>{var W7=k(),JQ=G6(),qQ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},QQ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>qQ[Z]);class N0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},N0.defaultYaml,$),this.tags=Object.assign({},N0.defaultTags,Z)}clone(){let $=new N0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new N0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:N0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},N0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:N0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},N0.defaultTags),this.atNextDocument=!1;let X=$.trim().split(/[ \t]+/),z=X.shift();switch(z){case"%TAG":{if(X.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[J,q]=X;return this.tags[J]=q,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[J]=X;if(J==="1.1"||J==="1.2")return this.yaml.version=J,!0;else{let q=/^\d+\.\d+$/.test(J);return Z(6,`Unsupported YAML version ${J}`,q),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let q=$.slice(2,-1);if(q==="!"||q==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return q}let[,X,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let J=this.tags[X];if(J)try{return J+decodeURIComponent(z)}catch(q){return Z(String(q)),null}if(X==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,X]of Object.entries(this.tags))if($.startsWith(X))return Z+QQ($.substring(X.length));return $[0]==="!"?$:`!<${$}>`}toString($){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),z;if($&&X.length>0&&W7.isNode($.contents)){let J={};JQ.visit($.contents,(q,Q)=>{if(W7.isNode(Q)&&Q.tag)J[Q.tag]=!0}),z=Object.keys(J)}else z=[];for(let[J,q]of X){if(J==="!!"&&q==="tag:yaml.org,2002:")continue;if(!$||z.some((Q)=>Q.startsWith(q)))Z.push(`%TAG ${J} ${q}`)}return Z.join(`
28
- `)}}N0.defaultYaml={explicit:!1,version:"1.2"};N0.defaultTags={"!!":"tag:yaml.org,2002:"};YQ.Directives=N0});var S8=T((VQ)=>{var H7=k(),UQ=G6();function WQ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function V7($){let Z=new Set;return UQ.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function K7($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function HQ($,Z){let X=[],z=new Map,J=null;return{onAnchor:(q)=>{X.push(q),J??(J=V7($));let Q=K7(Z,J);return J.add(Q),Q},setAnchors:()=>{for(let q of X){let Q=z.get(q);if(typeof Q==="object"&&Q.anchor&&(H7.isScalar(Q.node)||H7.isCollection(Q.node)))Q.node.anchor=Q.anchor;else{let Y=Error("Failed to resolve repeated object (this should not happen)");throw Y.source=q,Y}}},sourceObjects:z}}VQ.anchorIsValid=WQ;VQ.anchorNames=V7;VQ.createNodeAnchors=HQ;VQ.findNewAnchor=K7});var YZ=T((IQ)=>{function U6($,Z,X,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let J=0,q=z.length;J<q;++J){let Q=z[J],Y=U6($,z,String(J),Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}else if(z instanceof Map)for(let J of Array.from(z.keys())){let q=z.get(J),Q=U6($,z,J,q);if(Q===void 0)z.delete(J);else if(Q!==q)z.set(J,Q)}else if(z instanceof Set)for(let J of Array.from(z)){let q=U6($,z,J,J);if(q===void 0)z.delete(J);else if(q!==J)z.delete(J),z.add(q)}else for(let[J,q]of Object.entries(z)){let Q=U6($,z,J,q);if(Q===void 0)delete z[J];else if(Q!==q)z[J]=Q}return $.call(Z,X,z)}IQ.applyReviver=U6});var h0=T((MQ)=>{var TQ=k();function B7($,Z,X){if(Array.isArray($))return $.map((z,J)=>B7(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!TQ.hasAnchor($))return $.toJSON(Z,X);let z={aliasCount:0,count:1,res:void 0};X.anchors.set($,z),X.onCreate=(q)=>{z.res=q,delete X.onCreate};let J=$.toJSON(Z,X);if(X.onCreate)X.onCreate(J);return J}if(typeof $==="bigint"&&!X?.keep)return Number($);return $}MQ.toJS=B7});var _8=T((RQ)=>{var wQ=YZ(),D7=k(),FQ=h0();class N7{constructor($){Object.defineProperty(this,D7.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:Z,maxAliasCount:X,onAnchor:z,reviver:J}={}){if(!D7.isDocument($))throw TypeError("A document argument is required");let q={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},Q=FQ.toJS(this,"",q);if(typeof z==="function")for(let{count:Y,res:G}of q.anchors.values())z(G,Y);return typeof J==="function"?wQ.applyReviver(J,{"":Q},"",Q):Q}}RQ.NodeBase=N7});var W6=T((EQ)=>{var PQ=S8(),SQ=G6(),F$=k(),_Q=_8(),CQ=h0();class I7 extends _Q.NodeBase{constructor($){super(F$.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],SQ.visit($,{Node:(J,q)=>{if(F$.isAlias(q)||F$.hasAnchor(q))X.push(q)}}),Z)Z.aliasResolveCache=X;let z=void 0;for(let J of X){if(J===this)break;if(J.anchor===this.source)z=J}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:X,doc:z,maxAliasCount:J}=Z,q=this.resolve(z,Z);if(!q){let Y=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Y)}let Q=X.get(q);if(!Q)CQ.toJS(q,null,Z),Q=X.get(q);if(Q?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(J>=0){if(Q.count+=1,Q.aliasCount===0)Q.aliasCount=C8(z,q,X);if(Q.count*Q.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Q.res}toString($,Z,X){let z=`*${this.source}`;if($){if(PQ.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(J)}if($.implicitKey)return`${z} `}return z}}function C8($,Z,X){if(F$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(F$.isCollection(Z)){let z=0;for(let J of Z.items){let q=C8($,J,X);if(q>z)z=q}return z}else if(F$.isPair(Z)){let z=C8($,Z.key,X),J=C8($,Z.value,X);return Math.max(z,J)}return 1}EQ.Alias=I7});var a=T((yQ)=>{var bQ=k(),xQ=_8(),kQ=h0(),fQ=($)=>!$||typeof $!=="function"&&typeof $!=="object";class J$ extends xQ.NodeBase{constructor($){super(bQ.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:kQ.toJS(this.value,$,Z)}toString(){return String(this.value)}}J$.BLOCK_FOLDED="BLOCK_FOLDED";J$.BLOCK_LITERAL="BLOCK_LITERAL";J$.PLAIN="PLAIN";J$.QUOTE_DOUBLE="QUOTE_DOUBLE";J$.QUOTE_SINGLE="QUOTE_SINGLE";yQ.Scalar=J$;yQ.isScalarValue=fQ});var H6=T((cQ)=>{var vQ=W6(),q$=k(),L7=a(),uQ="tag:yaml.org,2002:";function mQ($,Z,X){if(Z){let z=X.filter((q)=>q.tag===Z),J=z.find((q)=>!q.format)??z[0];if(!J)throw Error(`Tag ${Z} not found`);return J}return X.find((z)=>z.identify?.($)&&!z.format)}function dQ($,Z,X){if(q$.isDocument($))$=$.contents;if(q$.isNode($))return $;if(q$.isPair($)){let V=X.schema[q$.MAP].createNode?.(X.schema,null,X);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:J,onTagObj:q,schema:Q,sourceObjects:Y}=X,G=void 0;if(z&&$&&typeof $==="object")if(G=Y.get($),G)return G.anchor??(G.anchor=J($)),new vQ.Alias(G.anchor);else G={anchor:null,node:null},Y.set($,G);if(Z?.startsWith("!!"))Z=uQ+Z.slice(2);let U=mQ($,Z,Q.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new L7.Scalar($);if(G)G.node=V;return V}U=$ instanceof Map?Q[q$.MAP]:(Symbol.iterator in Object($))?Q[q$.SEQ]:Q[q$.MAP]}if(q)q(U),delete X.onTagObj;let W=U?.createNode?U.createNode(X.schema,$,X):typeof U?.nodeClass?.from==="function"?U.nodeClass.from(X.schema,$,X):new L7.Scalar($);if(Z)W.tag=Z;else if(!U.default)W.tag=U.tag;if(G)G.node=W;return W}cQ.createNode=dQ});var E8=T((nQ)=>{var lQ=H6(),R0=k(),iQ=_8();function GZ($,Z,X){let z=X;for(let J=Z.length-1;J>=0;--J){let q=Z[J];if(typeof q==="number"&&Number.isInteger(q)&&q>=0){let Q=[];Q[q]=z,z=Q}else z=new Map([[q,z]])}return lQ.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var T7=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class M7 extends iQ.NodeBase{constructor($,Z){super($);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone($){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)Z.schema=$;if(Z.items=Z.items.map((X)=>R0.isNode(X)||R0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(T7($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(R0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,GZ(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}deleteIn($){let[Z,...X]=$;if(X.length===0)return this.delete(Z);let z=this.get(Z,!0);if(R0.isCollection(z))return z.deleteIn(X);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}getIn($,Z){let[X,...z]=$,J=this.get(X,!0);if(z.length===0)return!Z&&R0.isScalar(J)?J.value:J;else return R0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!R0.isPair(Z))return!1;let X=Z.value;return X==null||$&&R0.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn($){let[Z,...X]=$;if(X.length===0)return this.has(Z);let z=this.get(Z,!0);return R0.isCollection(z)?z.hasIn(X):!1}setIn($,Z){let[X,...z]=$;if(z.length===0)this.set(X,Z);else{let J=this.get(X,!0);if(R0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,GZ(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}nQ.Collection=M7;nQ.collectionFromPath=GZ;nQ.isEmptyPath=T7});var V6=T((eQ)=>{var oQ=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function UZ($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var tQ=($,Z,X)=>$.endsWith(`
27
+ `)}),this}_outputHelpIfRequested($){let Z=this._getHelpOption();if(Z&&$.find((z)=>Z.is(z)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function s4($){return $.map((Z)=>{if(!Z.startsWith("--inspect"))return Z;let X,z="127.0.0.1",J="9229",q;if((q=Z.match(/^(--inspect(-brk)?)$/))!==null)X=q[1];else if((q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(X=q[1],/^\d+$/.test(q[3]))J=q[3];else z=q[3];else if((q=Z.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)X=q[1],z=q[3],J=q[4];if(X&&J!=="0")return`${X}=${z}:${parseInt(J)+1}`;return Z})}function ZZ(){if(v.env.NO_COLOR||v.env.FORCE_COLOR==="0"||v.env.FORCE_COLOR==="false")return!1;if(v.env.FORCE_COLOR||v.env.CLICOLOR_FORCE!==void 0)return!0;return}Nq.Command=XZ;Nq.useColor=ZZ});var e4=L((Oq)=>{var{Argument:a4}=O8(),{Command:zZ}=r4(),{CommanderError:Tq,InvalidArgumentError:o4}=Y6(),{Help:Mq}=o2(),{Option:t4}=t2();Oq.program=new zZ;Oq.createCommand=($)=>new zZ($);Oq.createOption=($,Z)=>new t4($,Z);Oq.createArgument=($,Z)=>new a4($,Z);Oq.Command=zZ;Oq.Option=t4;Oq.Argument=a4;Oq.Help=Mq;Oq.CommanderError=Tq;Oq.InvalidArgumentError=o4;Oq.InvalidOptionArgumentError=o4});var y=L((uq)=>{var JZ=Symbol.for("yaml.alias"),X7=Symbol.for("yaml.document"),F8=Symbol.for("yaml.map"),z7=Symbol.for("yaml.pair"),qZ=Symbol.for("yaml.scalar"),R8=Symbol.for("yaml.seq"),S0=Symbol.for("yaml.node.type"),xq=($)=>!!$&&typeof $==="object"&&$[S0]===JZ,kq=($)=>!!$&&typeof $==="object"&&$[S0]===X7,fq=($)=>!!$&&typeof $==="object"&&$[S0]===F8,yq=($)=>!!$&&typeof $==="object"&&$[S0]===z7,J7=($)=>!!$&&typeof $==="object"&&$[S0]===qZ,gq=($)=>!!$&&typeof $==="object"&&$[S0]===R8;function q7($){if($&&typeof $==="object")switch($[S0]){case F8:case R8:return!0}return!1}function hq($){if($&&typeof $==="object")switch($[S0]){case JZ:case F8:case qZ:case R8:return!0}return!1}var vq=($)=>(J7($)||q7($))&&!!$.anchor;uq.ALIAS=JZ;uq.DOC=X7;uq.MAP=F8;uq.NODE_TYPE=S0;uq.PAIR=z7;uq.SCALAR=qZ;uq.SEQ=R8;uq.hasAnchor=vq;uq.isAlias=xq;uq.isCollection=q7;uq.isDocument=kq;uq.isMap=fq;uq.isNode=hq;uq.isPair=yq;uq.isScalar=J7;uq.isSeq=gq});var G6=L((zQ)=>{var Z0=y(),G0=Symbol("break visit"),Q7=Symbol("skip children"),F0=Symbol("remove node");function A8($,Z){let X=Y7(Z);if(Z0.isDocument($)){if(O$(null,$.contents,X,Object.freeze([$]))===F0)$.contents=null}else O$(null,$,X,Object.freeze([]))}A8.BREAK=G0;A8.SKIP=Q7;A8.REMOVE=F0;function O$($,Z,X,z){let J=G7($,Z,X,z);if(Z0.isNode(J)||Z0.isPair(J))return U7($,z,J),O$($,J,X,z);if(typeof J!=="symbol"){if(Z0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let q=0;q<Z.items.length;++q){let Q=O$(q,Z.items[q],X,z);if(typeof Q==="number")q=Q-1;else if(Q===G0)return G0;else if(Q===F0)Z.items.splice(q,1),q-=1}}else if(Z0.isPair(Z)){z=Object.freeze(z.concat(Z));let q=O$("key",Z.key,X,z);if(q===G0)return G0;else if(q===F0)Z.key=null;let Q=O$("value",Z.value,X,z);if(Q===G0)return G0;else if(Q===F0)Z.value=null}}return J}async function P8($,Z){let X=Y7(Z);if(Z0.isDocument($)){if(await w$(null,$.contents,X,Object.freeze([$]))===F0)$.contents=null}else await w$(null,$,X,Object.freeze([]))}P8.BREAK=G0;P8.SKIP=Q7;P8.REMOVE=F0;async function w$($,Z,X,z){let J=await G7($,Z,X,z);if(Z0.isNode(J)||Z0.isPair(J))return U7($,z,J),w$($,J,X,z);if(typeof J!=="symbol"){if(Z0.isCollection(Z)){z=Object.freeze(z.concat(Z));for(let q=0;q<Z.items.length;++q){let Q=await w$(q,Z.items[q],X,z);if(typeof Q==="number")q=Q-1;else if(Q===G0)return G0;else if(Q===F0)Z.items.splice(q,1),q-=1}}else if(Z0.isPair(Z)){z=Object.freeze(z.concat(Z));let q=await w$("key",Z.key,X,z);if(q===G0)return G0;else if(q===F0)Z.key=null;let Q=await w$("value",Z.value,X,z);if(Q===G0)return G0;else if(Q===F0)Z.value=null}}return J}function Y7($){if(typeof $==="object"&&($.Collection||$.Node||$.Value))return Object.assign({Alias:$.Node,Map:$.Node,Scalar:$.Node,Seq:$.Node},$.Value&&{Map:$.Value,Scalar:$.Value,Seq:$.Value},$.Collection&&{Map:$.Collection,Seq:$.Collection},$);return $}function G7($,Z,X,z){if(typeof X==="function")return X($,Z,z);if(Z0.isMap(Z))return X.Map?.($,Z,z);if(Z0.isSeq(Z))return X.Seq?.($,Z,z);if(Z0.isPair(Z))return X.Pair?.($,Z,z);if(Z0.isScalar(Z))return X.Scalar?.($,Z,z);if(Z0.isAlias(Z))return X.Alias?.($,Z,z);return}function U7($,Z,X){let z=Z[Z.length-1];if(Z0.isCollection(z))z.items[$]=X;else if(Z0.isPair(z))if($==="key")z.key=X;else z.value=X;else if(Z0.isDocument(z))z.contents=X;else{let J=Z0.isAlias(z)?"alias":"scalar";throw Error(`Cannot replace node with ${J} parent`)}}zQ.visit=A8;zQ.visitAsync=P8});var QZ=L((UQ)=>{var W7=y(),QQ=G6(),YQ={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},GQ=($)=>$.replace(/[!,[\]{}]/g,(Z)=>YQ[Z]);class N0{constructor($,Z){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},N0.defaultYaml,$),this.tags=Object.assign({},N0.defaultTags,Z)}clone(){let $=new N0(this.yaml,this.tags);return $.docStart=this.docStart,$}atDocument(){let $=new N0(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:N0.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},N0.defaultTags);break}return $}add($,Z){if(this.atNextDocument)this.yaml={explicit:N0.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},N0.defaultTags),this.atNextDocument=!1;let X=$.trim().split(/[ \t]+/),z=X.shift();switch(z){case"%TAG":{if(X.length!==2){if(Z(0,"%TAG directive should contain exactly two parts"),X.length<2)return!1}let[J,q]=X;return this.tags[J]=q,!0}case"%YAML":{if(this.yaml.explicit=!0,X.length!==1)return Z(0,"%YAML directive should contain exactly one part"),!1;let[J]=X;if(J==="1.1"||J==="1.2")return this.yaml.version=J,!0;else{let q=/^\d+\.\d+$/.test(J);return Z(6,`Unsupported YAML version ${J}`,q),!1}}default:return Z(0,`Unknown directive ${z}`,!0),!1}}tagName($,Z){if($==="!")return"!";if($[0]!=="!")return Z(`Not a valid tag: ${$}`),null;if($[1]==="<"){let q=$.slice(2,-1);if(q==="!"||q==="!!")return Z(`Verbatim tags aren't resolved, so ${$} is invalid.`),null;if($[$.length-1]!==">")Z("Verbatim tags must end with a >");return q}let[,X,z]=$.match(/^(.*!)([^!]*)$/s);if(!z)Z(`The ${$} tag has no suffix`);let J=this.tags[X];if(J)try{return J+decodeURIComponent(z)}catch(q){return Z(String(q)),null}if(X==="!")return $;return Z(`Could not resolve tag: ${$}`),null}tagString($){for(let[Z,X]of Object.entries(this.tags))if($.startsWith(X))return Z+GQ($.substring(X.length));return $[0]==="!"?$:`!<${$}>`}toString($){let Z=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],X=Object.entries(this.tags),z;if($&&X.length>0&&W7.isNode($.contents)){let J={};QQ.visit($.contents,(q,Q)=>{if(W7.isNode(Q)&&Q.tag)J[Q.tag]=!0}),z=Object.keys(J)}else z=[];for(let[J,q]of X){if(J==="!!"&&q==="tag:yaml.org,2002:")continue;if(!$||z.some((Q)=>Q.startsWith(q)))Z.push(`%TAG ${J} ${q}`)}return Z.join(`
28
+ `)}}N0.defaultYaml={explicit:!1,version:"1.2"};N0.defaultTags={"!!":"tag:yaml.org,2002:"};UQ.Directives=N0});var _8=L((DQ)=>{var H7=y(),HQ=G6();function VQ($){if(/[\x00-\x19\s,[\]{}]/.test($)){let X=`Anchor must not contain whitespace or control characters: ${JSON.stringify($)}`;throw Error(X)}return!0}function V7($){let Z=new Set;return HQ.visit($,{Value(X,z){if(z.anchor)Z.add(z.anchor)}}),Z}function K7($,Z){for(let X=1;;++X){let z=`${$}${X}`;if(!Z.has(z))return z}}function KQ($,Z){let X=[],z=new Map,J=null;return{onAnchor:(q)=>{X.push(q),J??(J=V7($));let Q=K7(Z,J);return J.add(Q),Q},setAnchors:()=>{for(let q of X){let Q=z.get(q);if(typeof Q==="object"&&Q.anchor&&(H7.isScalar(Q.node)||H7.isCollection(Q.node)))Q.node.anchor=Q.anchor;else{let Y=Error("Failed to resolve repeated object (this should not happen)");throw Y.source=q,Y}}},sourceObjects:z}}DQ.anchorIsValid=VQ;DQ.anchorNames=V7;DQ.createNodeAnchors=KQ;DQ.findNewAnchor=K7});var YZ=L((TQ)=>{function U6($,Z,X,z){if(z&&typeof z==="object")if(Array.isArray(z))for(let J=0,q=z.length;J<q;++J){let Q=z[J],Y=U6($,z,String(J),Q);if(Y===void 0)delete z[J];else if(Y!==Q)z[J]=Y}else if(z instanceof Map)for(let J of Array.from(z.keys())){let q=z.get(J),Q=U6($,z,J,q);if(Q===void 0)z.delete(J);else if(Q!==q)z.set(J,Q)}else if(z instanceof Set)for(let J of Array.from(z)){let q=U6($,z,J,J);if(q===void 0)z.delete(J);else if(q!==J)z.delete(J),z.add(q)}else for(let[J,q]of Object.entries(z)){let Q=U6($,z,J,q);if(Q===void 0)delete z[J];else if(Q!==q)z[J]=Q}return $.call(Z,X,z)}TQ.applyReviver=U6});var h0=L((wQ)=>{var OQ=y();function D7($,Z,X){if(Array.isArray($))return $.map((z,J)=>D7(z,String(J),X));if($&&typeof $.toJSON==="function"){if(!X||!OQ.hasAnchor($))return $.toJSON(Z,X);let z={aliasCount:0,count:1,res:void 0};X.anchors.set($,z),X.onCreate=(q)=>{z.res=q,delete X.onCreate};let J=$.toJSON(Z,X);if(X.onCreate)X.onCreate(J);return J}if(typeof $==="bigint"&&!X?.keep)return Number($);return $}wQ.toJS=D7});var C8=L((PQ)=>{var RQ=YZ(),B7=y(),AQ=h0();class N7{constructor($){Object.defineProperty(this,B7.NODE_TYPE,{value:$})}clone(){let $=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)$.range=this.range.slice();return $}toJS($,{mapAsMap:Z,maxAliasCount:X,onAnchor:z,reviver:J}={}){if(!B7.isDocument($))throw TypeError("A document argument is required");let q={anchors:new Map,doc:$,keep:!0,mapAsMap:Z===!0,mapKeyWarned:!1,maxAliasCount:typeof X==="number"?X:100},Q=AQ.toJS(this,"",q);if(typeof z==="function")for(let{count:Y,res:G}of q.anchors.values())z(G,Y);return typeof J==="function"?RQ.applyReviver(J,{"":Q},"",Q):Q}}PQ.NodeBase=N7});var W6=L((bQ)=>{var CQ=_8(),SQ=G6(),F$=y(),EQ=C8(),jQ=h0();class I7 extends EQ.NodeBase{constructor($){super(F$.ALIAS);this.source=$,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve($,Z){let X;if(Z?.aliasResolveCache)X=Z.aliasResolveCache;else if(X=[],SQ.visit($,{Node:(J,q)=>{if(F$.isAlias(q)||F$.hasAnchor(q))X.push(q)}}),Z)Z.aliasResolveCache=X;let z=void 0;for(let J of X){if(J===this)break;if(J.anchor===this.source)z=J}return z}toJSON($,Z){if(!Z)return{source:this.source};let{anchors:X,doc:z,maxAliasCount:J}=Z,q=this.resolve(z,Z);if(!q){let Y=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(Y)}let Q=X.get(q);if(!Q)jQ.toJS(q,null,Z),Q=X.get(q);if(Q?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(J>=0){if(Q.count+=1,Q.aliasCount===0)Q.aliasCount=S8(z,q,X);if(Q.count*Q.aliasCount>J)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return Q.res}toString($,Z,X){let z=`*${this.source}`;if($){if(CQ.anchorIsValid(this.source),$.options.verifyAliasOrder&&!$.anchors.has(this.source)){let J=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(J)}if($.implicitKey)return`${z} `}return z}}function S8($,Z,X){if(F$.isAlias(Z)){let z=Z.resolve($),J=X&&z&&X.get(z);return J?J.count*J.aliasCount:0}else if(F$.isCollection(Z)){let z=0;for(let J of Z.items){let q=S8($,J,X);if(q>z)z=q}return z}else if(F$.isPair(Z)){let z=S8($,Z.key,X),J=S8($,Z.value,X);return Math.max(z,J)}return 1}bQ.Alias=I7});var o=L((hQ)=>{var kQ=y(),fQ=C8(),yQ=h0(),gQ=($)=>!$||typeof $!=="function"&&typeof $!=="object";class J$ extends fQ.NodeBase{constructor($){super(kQ.SCALAR);this.value=$}toJSON($,Z){return Z?.keep?this.value:yQ.toJS(this.value,$,Z)}toString(){return String(this.value)}}J$.BLOCK_FOLDED="BLOCK_FOLDED";J$.BLOCK_LITERAL="BLOCK_LITERAL";J$.PLAIN="PLAIN";J$.QUOTE_DOUBLE="QUOTE_DOUBLE";J$.QUOTE_SINGLE="QUOTE_SINGLE";hQ.Scalar=J$;hQ.isScalarValue=gQ});var H6=L((lQ)=>{var mQ=W6(),q$=y(),L7=o(),dQ="tag:yaml.org,2002:";function cQ($,Z,X){if(Z){let z=X.filter((q)=>q.tag===Z),J=z.find((q)=>!q.format)??z[0];if(!J)throw Error(`Tag ${Z} not found`);return J}return X.find((z)=>z.identify?.($)&&!z.format)}function pQ($,Z,X){if(q$.isDocument($))$=$.contents;if(q$.isNode($))return $;if(q$.isPair($)){let V=X.schema[q$.MAP].createNode?.(X.schema,null,X);return V.items.push($),V}if($ instanceof String||$ instanceof Number||$ instanceof Boolean||typeof BigInt<"u"&&$ instanceof BigInt)$=$.valueOf();let{aliasDuplicateObjects:z,onAnchor:J,onTagObj:q,schema:Q,sourceObjects:Y}=X,G=void 0;if(z&&$&&typeof $==="object")if(G=Y.get($),G)return G.anchor??(G.anchor=J($)),new mQ.Alias(G.anchor);else G={anchor:null,node:null},Y.set($,G);if(Z?.startsWith("!!"))Z=dQ+Z.slice(2);let U=cQ($,Z,Q.tags);if(!U){if($&&typeof $.toJSON==="function")$=$.toJSON();if(!$||typeof $!=="object"){let V=new L7.Scalar($);if(G)G.node=V;return V}U=$ instanceof Map?Q[q$.MAP]:(Symbol.iterator in Object($))?Q[q$.SEQ]:Q[q$.MAP]}if(q)q(U),delete X.onTagObj;let W=U?.createNode?U.createNode(X.schema,$,X):typeof U?.nodeClass?.from==="function"?U.nodeClass.from(X.schema,$,X):new L7.Scalar($);if(Z)W.tag=Z;else if(!U.default)W.tag=U.tag;if(G)G.node=W;return W}lQ.createNode=pQ});var E8=L((rQ)=>{var nQ=H6(),R0=y(),sQ=C8();function GZ($,Z,X){let z=X;for(let J=Z.length-1;J>=0;--J){let q=Z[J];if(typeof q==="number"&&Number.isInteger(q)&&q>=0){let Q=[];Q[q]=z,z=Q}else z=new Map([[q,z]])}return nQ.createNode(z,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:$,sourceObjects:new Map})}var T7=($)=>$==null||typeof $==="object"&&!!$[Symbol.iterator]().next().done;class M7 extends sQ.NodeBase{constructor($,Z){super($);Object.defineProperty(this,"schema",{value:Z,configurable:!0,enumerable:!1,writable:!0})}clone($){let Z=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if($)Z.schema=$;if(Z.items=Z.items.map((X)=>R0.isNode(X)||R0.isPair(X)?X.clone($):X),this.range)Z.range=this.range.slice();return Z}addIn($,Z){if(T7($))this.add(Z);else{let[X,...z]=$,J=this.get(X,!0);if(R0.isCollection(J))J.addIn(z,Z);else if(J===void 0&&this.schema)this.set(X,GZ(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}deleteIn($){let[Z,...X]=$;if(X.length===0)return this.delete(Z);let z=this.get(Z,!0);if(R0.isCollection(z))return z.deleteIn(X);else throw Error(`Expected YAML collection at ${Z}. Remaining path: ${X}`)}getIn($,Z){let[X,...z]=$,J=this.get(X,!0);if(z.length===0)return!Z&&R0.isScalar(J)?J.value:J;else return R0.isCollection(J)?J.getIn(z,Z):void 0}hasAllNullValues($){return this.items.every((Z)=>{if(!R0.isPair(Z))return!1;let X=Z.value;return X==null||$&&R0.isScalar(X)&&X.value==null&&!X.commentBefore&&!X.comment&&!X.tag})}hasIn($){let[Z,...X]=$;if(X.length===0)return this.has(Z);let z=this.get(Z,!0);return R0.isCollection(z)?z.hasIn(X):!1}setIn($,Z){let[X,...z]=$;if(z.length===0)this.set(X,Z);else{let J=this.get(X,!0);if(R0.isCollection(J))J.setIn(z,Z);else if(J===void 0&&this.schema)this.set(X,GZ(this.schema,z,Z));else throw Error(`Expected YAML collection at ${X}. Remaining path: ${z}`)}}}rQ.Collection=M7;rQ.collectionFromPath=GZ;rQ.isEmptyPath=T7});var V6=L((ZY)=>{var eQ=($)=>$.replace(/^(?!$)(?: $)?/gm,"#");function UZ($,Z){if(/^\n+$/.test($))return $.substring(1);return Z?$.replace(/^(?! *$)/gm,Z):$}var $Y=($,Z,X)=>$.endsWith(`
29
29
  `)?UZ(X,Z):X.includes(`
30
30
  `)?`
31
- `+UZ(X,Z):($.endsWith(" ")?"":" ")+X;eQ.indentComment=UZ;eQ.lineComment=tQ;eQ.stringifyComment=oQ});var w7=T((JY)=>{function zY($,Z,X="flow",{indentAtStart:z,lineWidth:J=80,minContentWidth:q=20,onFold:Q,onOverflow:Y}={}){if(!J||J<0)return $;if(J<q)q=0;let G=Math.max(1+q,1+J-Z.length);if($.length<=G)return $;let U=[],W={},V=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,q))U.push(0);else V=J-z;let H=void 0,D=void 0,M=!1,B=-1,N=-1,L=-1;if(X==="block"){if(B=O7($,B,Z.length),B!==-1)V=B+G}for(let _;_=$[B+=1];){if(X==="quoted"&&_==="\\"){switch(N=B,$[B+1]){case"x":B+=3;break;case"u":B+=5;break;case"U":B+=9;break;default:B+=1}L=B}if(_===`
32
- `){if(X==="block")B=O7($,B,Z.length);V=B+Z.length+G,H=void 0}else{if(_===" "&&D&&D!==" "&&D!==`
33
- `&&D!=="\t"){let C=$[B+1];if(C&&C!==" "&&C!==`
34
- `&&C!=="\t")H=B}if(B>=V)if(H)U.push(H),V=H+G,H=void 0;else if(X==="quoted"){while(D===" "||D==="\t")D=_,_=$[B+=1],M=!0;let C=B>L+1?B-2:N-1;if(W[C])return $;U.push(C),W[C]=!0,V=C+G,H=void 0}else M=!0}D=_}if(M&&Y)Y();if(U.length===0)return $;if(Q)Q();let S=$.slice(0,U[0]);for(let _=0;_<U.length;++_){let C=U[_],R=U[_+1]||$.length;if(C===0)S=`
35
- ${Z}${$.slice(0,R)}`;else{if(X==="quoted"&&W[C])S+=`${$[C]}\\`;S+=`
36
- ${Z}${$.slice(C+1,R)}`}}return S}function O7($,Z,X){let z=Z,J=Z+1,q=$[J];while(q===" "||q==="\t")if(Z<J+X)q=$[++Z];else{do q=$[++Z];while(q&&q!==`
37
- `);z=Z,J=Z+1,q=$[J]}return z}JY.FOLD_BLOCK="block";JY.FOLD_FLOW="flow";JY.FOLD_QUOTED="quoted";JY.foldFlowLines=zY});var B6=T((VY)=>{var M0=a(),v0=w7(),b8=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),x8=($)=>/^(%|---|\.\.\.)/m.test($);function UY($,Z,X){if(!Z||Z<0)return!1;let z=Z-X,J=$.length;if(J<=z)return!1;for(let q=0,Q=0;q<J;++q)if($[q]===`
31
+ `+UZ(X,Z):($.endsWith(" ")?"":" ")+X;ZY.indentComment=UZ;ZY.lineComment=$Y;ZY.stringifyComment=eQ});var w7=L((QY)=>{function qY($,Z,X="flow",{indentAtStart:z,lineWidth:J=80,minContentWidth:q=20,onFold:Q,onOverflow:Y}={}){if(!J||J<0)return $;if(J<q)q=0;let G=Math.max(1+q,1+J-Z.length);if($.length<=G)return $;let U=[],W={},V=J-Z.length;if(typeof z==="number")if(z>J-Math.max(2,q))U.push(0);else V=J-z;let H=void 0,B=void 0,M=!1,D=-1,N=-1,w=-1;if(X==="block"){if(D=O7($,D,Z.length),D!==-1)V=D+G}for(let _;_=$[D+=1];){if(X==="quoted"&&_==="\\"){switch(N=D,$[D+1]){case"x":D+=3;break;case"u":D+=5;break;case"U":D+=9;break;default:D+=1}w=D}if(_===`
32
+ `){if(X==="block")D=O7($,D,Z.length);V=D+Z.length+G,H=void 0}else{if(_===" "&&B&&B!==" "&&B!==`
33
+ `&&B!=="\t"){let R=$[D+1];if(R&&R!==" "&&R!==`
34
+ `&&R!=="\t")H=D}if(D>=V)if(H)U.push(H),V=H+G,H=void 0;else if(X==="quoted"){while(B===" "||B==="\t")B=_,_=$[D+=1],M=!0;let R=D>w+1?D-2:N-1;if(W[R])return $;U.push(R),W[R]=!0,V=R+G,H=void 0}else M=!0}B=_}if(M&&Y)Y();if(U.length===0)return $;if(Q)Q();let P=$.slice(0,U[0]);for(let _=0;_<U.length;++_){let R=U[_],E=U[_+1]||$.length;if(R===0)P=`
35
+ ${Z}${$.slice(0,E)}`;else{if(X==="quoted"&&W[R])P+=`${$[R]}\\`;P+=`
36
+ ${Z}${$.slice(R+1,E)}`}}return P}function O7($,Z,X){let z=Z,J=Z+1,q=$[J];while(q===" "||q==="\t")if(Z<J+X)q=$[++Z];else{do q=$[++Z];while(q&&q!==`
37
+ `);z=Z,J=Z+1,q=$[J]}return z}QY.FOLD_BLOCK="block";QY.FOLD_FLOW="flow";QY.FOLD_QUOTED="quoted";QY.foldFlowLines=qY});var D6=L((DY)=>{var M0=o(),v0=w7(),b8=($,Z)=>({indentAtStart:Z?$.indent.length:$.indentAtStart,lineWidth:$.options.lineWidth,minContentWidth:$.options.minContentWidth}),x8=($)=>/^(%|---|\.\.\.)/m.test($);function HY($,Z,X){if(!Z||Z<0)return!1;let z=Z-X,J=$.length;if(J<=z)return!1;for(let q=0,Q=0;q<J;++q)if($[q]===`
38
38
  `){if(q-Q>z)return!0;if(Q=q+1,J-Q<=z)return!1}return!0}function K6($,Z){let X=JSON.stringify($);if(Z.options.doubleQuotedAsJSON)return X;let{implicitKey:z}=Z,J=Z.options.doubleQuotedMinMultiLineLength,q=Z.indent||(x8($)?" ":""),Q="",Y=0;for(let G=0,U=X[G];U;U=X[++G]){if(U===" "&&X[G+1]==="\\"&&X[G+2]==="n")Q+=X.slice(Y,G)+"\\ ",G+=1,Y=G,U="\\";if(U==="\\")switch(X[G+1]){case"u":{Q+=X.slice(Y,G);let W=X.substr(G+2,4);switch(W){case"0000":Q+="\\0";break;case"0007":Q+="\\a";break;case"000b":Q+="\\v";break;case"001b":Q+="\\e";break;case"0085":Q+="\\N";break;case"00a0":Q+="\\_";break;case"2028":Q+="\\L";break;case"2029":Q+="\\P";break;default:if(W.substr(0,2)==="00")Q+="\\x"+W.substr(2);else Q+=X.substr(G,6)}G+=5,Y=G+1}break;case"n":if(z||X[G+2]==='"'||X.length<J)G+=1;else{Q+=X.slice(Y,G)+`
39
39
 
40
40
  `;while(X[G+2]==="\\"&&X[G+3]==="n"&&X[G+4]!=='"')Q+=`
@@ -43,105 +43,105 @@ ${Z}${$.slice(C+1,R)}`}}return S}function O7($,Z,X){let z=Z,J=Z+1,q=$[J];while(q
43
43
  ${X}`)+"'";return Z.implicitKey?z:v0.foldFlowLines(z,X,v0.FOLD_FLOW,b8(Z,!1))}function R$($,Z){let{singleQuote:X}=Z.options,z;if(X===!1)z=K6;else{let J=$.includes('"'),q=$.includes("'");if(J&&!q)z=WZ;else if(q&&!J)z=K6;else z=X?WZ:K6}return z($,Z)}var HZ;try{HZ=new RegExp(`(^|(?<!
44
44
  ))
45
45
  +(?!
46
- |$)`,"g")}catch{HZ=/\n+(?!\n|$)/g}function j8({comment:$,type:Z,value:X},z,J,q){let{blockQuote:Q,commentString:Y,lineWidth:G}=z.options;if(!Q||/\n[\t ]+$/.test(X))return R$(X,z);let U=z.indent||(z.forceBlockIndent||x8(X)?" ":""),W=Q==="literal"?!0:Q==="folded"||Z===M0.Scalar.BLOCK_FOLDED?!1:Z===M0.Scalar.BLOCK_LITERAL?!0:!UY(X,G,U.length);if(!X)return W?`|
46
+ |$)`,"g")}catch{HZ=/\n+(?!\n|$)/g}function j8({comment:$,type:Z,value:X},z,J,q){let{blockQuote:Q,commentString:Y,lineWidth:G}=z.options;if(!Q||/\n[\t ]+$/.test(X))return R$(X,z);let U=z.indent||(z.forceBlockIndent||x8(X)?" ":""),W=Q==="literal"?!0:Q==="folded"||Z===M0.Scalar.BLOCK_FOLDED?!1:Z===M0.Scalar.BLOCK_LITERAL?!0:!HY(X,G,U.length);if(!X)return W?`|
47
47
  `:`>
48
- `;let V,H;for(H=X.length;H>0;--H){let R=X[H-1];if(R!==`
49
- `&&R!=="\t"&&R!==" ")break}let D=X.substring(H),M=D.indexOf(`
50
- `);if(M===-1)V="-";else if(X===D||M!==D.length-1){if(V="+",q)q()}else V="";if(D){if(X=X.slice(0,-D.length),D[D.length-1]===`
51
- `)D=D.slice(0,-1);D=D.replace(HZ,`$&${U}`)}let B=!1,N,L=-1;for(N=0;N<X.length;++N){let R=X[N];if(R===" ")B=!0;else if(R===`
52
- `)L=N;else break}let S=X.substring(0,L<N?L+1:N);if(S)X=X.substring(S.length),S=S.replace(/\n+/g,`$&${U}`);let C=(B?U?"2":"1":"")+V;if($){if(C+=" "+Y($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!W){let R=X.replace(/\n+/g,`
53
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${U}`),F=!1,c=b8(z,!0);if(Q!=="folded"&&Z!==M0.Scalar.BLOCK_FOLDED)c.onOverflow=()=>{F=!0};let P=v0.foldFlowLines(`${S}${R}${D}`,U,v0.FOLD_BLOCK,c);if(!F)return`>${C}
54
- ${U}${P}`}return X=X.replace(/\n+/g,`$&${U}`),`|${C}
55
- ${U}${S}${X}${D}`}function WY($,Z,X,z){let{type:J,value:q}=$,{actualString:Q,implicitKey:Y,indent:G,indentStep:U,inFlow:W}=Z;if(Y&&q.includes(`
48
+ `;let V,H;for(H=X.length;H>0;--H){let E=X[H-1];if(E!==`
49
+ `&&E!=="\t"&&E!==" ")break}let B=X.substring(H),M=B.indexOf(`
50
+ `);if(M===-1)V="-";else if(X===B||M!==B.length-1){if(V="+",q)q()}else V="";if(B){if(X=X.slice(0,-B.length),B[B.length-1]===`
51
+ `)B=B.slice(0,-1);B=B.replace(HZ,`$&${U}`)}let D=!1,N,w=-1;for(N=0;N<X.length;++N){let E=X[N];if(E===" ")D=!0;else if(E===`
52
+ `)w=N;else break}let P=X.substring(0,w<N?w+1:N);if(P)X=X.substring(P.length),P=P.replace(/\n+/g,`$&${U}`);let R=(D?U?"2":"1":"")+V;if($){if(R+=" "+Y($.replace(/ ?[\r\n]+/g," ")),J)J()}if(!W){let E=X.replace(/\n+/g,`
53
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${U}`),C=!1,p=b8(z,!0);if(Q!=="folded"&&Z!==M0.Scalar.BLOCK_FOLDED)p.onOverflow=()=>{C=!0};let T=v0.foldFlowLines(`${P}${E}${B}`,U,v0.FOLD_BLOCK,p);if(!C)return`>${R}
54
+ ${U}${T}`}return X=X.replace(/\n+/g,`$&${U}`),`|${R}
55
+ ${U}${P}${X}${B}`}function VY($,Z,X,z){let{type:J,value:q}=$,{actualString:Q,implicitKey:Y,indent:G,indentStep:U,inFlow:W}=Z;if(Y&&q.includes(`
56
56
  `)||W&&/[[\]{},]/.test(q))return R$(q,Z);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(q))return Y||W||!q.includes(`
57
57
  `)?R$(q,Z):j8($,Z,X,z);if(!Y&&!W&&J!==M0.Scalar.PLAIN&&q.includes(`
58
58
  `))return j8($,Z,X,z);if(x8(q)){if(G==="")return Z.forceBlockIndent=!0,j8($,Z,X,z);else if(Y&&G===U)return R$(q,Z)}let V=q.replace(/\n+/g,`$&
59
- ${G}`);if(Q){let H=(B)=>B.default&&B.tag!=="tag:yaml.org,2002:str"&&B.test?.test(V),{compat:D,tags:M}=Z.doc.schema;if(M.some(H)||D?.some(H))return R$(q,Z)}return Y?V:v0.foldFlowLines(V,G,v0.FOLD_FLOW,b8(Z,!1))}function HY($,Z,X,z){let{implicitKey:J,inFlow:q}=Z,Q=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:Y}=$;if(Y!==M0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Q.value))Y=M0.Scalar.QUOTE_DOUBLE}let G=(W)=>{switch(W){case M0.Scalar.BLOCK_FOLDED:case M0.Scalar.BLOCK_LITERAL:return J||q?R$(Q.value,Z):j8(Q,Z,X,z);case M0.Scalar.QUOTE_DOUBLE:return K6(Q.value,Z);case M0.Scalar.QUOTE_SINGLE:return WZ(Q.value,Z);case M0.Scalar.PLAIN:return WY(Q,Z,X,z);default:return null}},U=G(Y);if(U===null){let{defaultKeyType:W,defaultStringType:V}=Z.options,H=J&&W||V;if(U=G(H),U===null)throw Error(`Unsupported default string type ${H}`)}return U}VY.stringifyString=HY});var D6=T((OY)=>{var BY=S8(),u0=k(),DY=V6(),NY=B6();function IY($,Z){let X=Object.assign({blockQuote:!0,commentString:DY.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,Z),z;switch(X.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:z,options:X}}function LY($,Z){if(Z.tag){let J=$.filter((q)=>q.tag===Z.tag);if(J.length>0)return J.find((q)=>q.format===Z.format)??J[0]}let X=void 0,z;if(u0.isScalar(Z)){z=Z.value;let J=$.filter((q)=>q.identify?.(z));if(J.length>1){let q=J.filter((Q)=>Q.test);if(q.length>0)J=q}X=J.find((q)=>q.format===Z.format)??J.find((q)=>!q.format)}else z=Z,X=$.find((J)=>J.nodeClass&&z instanceof J.nodeClass);if(!X){let J=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${J} value`)}return X}function TY($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],q=(u0.isScalar($)||u0.isCollection($))&&$.anchor;if(q&&BY.anchorIsValid(q))X.add(q),J.push(`&${q}`);let Q=$.tag??(Z.default?null:Z.tag);if(Q)J.push(z.directives.tagString(Q));return J.join(" ")}function MY($,Z,X,z){if(u0.isPair($))return $.toString(Z,X,z);if(u0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let J=void 0,q=u0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>J=G});J??(J=LY(Z.doc.schema.tags,q));let Q=TY(q,J,Z);if(Q.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Q.length+1;let Y=typeof J.stringify==="function"?J.stringify(q,Z,X,z):u0.isScalar(q)?NY.stringifyString(q,Z,X,z):q.toString(Z,X,z);if(!Q)return Y;return u0.isScalar(q)||Y[0]==="{"||Y[0]==="["?`${Q} ${Y}`:`${Q}
60
- ${Z.indent}${Y}`}OY.createStringifyContext=IY;OY.stringify=MY});var A7=T((AY)=>{var E0=k(),F7=a(),R7=D6(),N6=V6();function RY({key:$,value:Z},X,z,J){let{allNullValues:q,doc:Q,indent:Y,indentStep:G,options:{commentString:U,indentSeq:W,simpleKeys:V}}=X,H=E0.isNode($)&&$.comment||null;if(V){if(H)throw Error("With simple keys, key nodes cannot have comments");if(E0.isCollection($)||!E0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let D=!V&&(!$||H&&Z==null&&!X.inFlow||E0.isCollection($)||(E0.isScalar($)?$.type===F7.Scalar.BLOCK_FOLDED||$.type===F7.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!D&&(V||!q),indent:Y+G});let M=!1,B=!1,N=R7.stringify($,X,()=>M=!0,()=>B=!0);if(!D&&!X.inFlow&&N.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");D=!0}if(X.inFlow){if(q||Z==null){if(M&&z)z();return N===""?"?":D?`? ${N}`:N}}else if(q&&!V||Z==null&&D){if(N=`? ${N}`,H&&!M)N+=N6.lineComment(N,X.indent,U(H));else if(B&&J)J();return N}if(M)H=null;if(D){if(H)N+=N6.lineComment(N,X.indent,U(H));N=`? ${N}
61
- ${Y}:`}else if(N=`${N}:`,H)N+=N6.lineComment(N,X.indent,U(H));let L,S,_;if(E0.isNode(Z))L=!!Z.spaceBefore,S=Z.commentBefore,_=Z.comment;else if(L=!1,S=null,_=null,Z&&typeof Z==="object")Z=Q.createNode(Z);if(X.implicitKey=!1,!D&&!H&&E0.isScalar(Z))X.indentAtStart=N.length+1;if(B=!1,!W&&G.length>=2&&!X.inFlow&&!D&&E0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let C=!1,R=R7.stringify(Z,X,()=>C=!0,()=>B=!0),F=" ";if(H||L||S){if(F=L?`
62
- `:"",S){let c=U(S);F+=`
63
- ${N6.indentComment(c,X.indent)}`}if(R===""&&!X.inFlow){if(F===`
64
- `&&_)F=`
65
-
66
- `}else F+=`
67
- ${X.indent}`}else if(!D&&E0.isCollection(Z)){let c=R[0],P=R.indexOf(`
68
- `),e=P!==-1,g0=X.inFlow??Z.flow??Z.items.length===0;if(e||!g0){let M$=!1;if(e&&(c==="&"||c==="!")){let $0=R.indexOf(" ");if(c==="&"&&$0!==-1&&$0<P&&R[$0+1]==="!")$0=R.indexOf(" ",$0+1);if($0===-1||P<$0)M$=!0}if(!M$)F=`
69
- ${X.indent}`}}else if(R===""||R[0]===`
70
- `)F="";if(N+=F+R,X.inFlow){if(C&&z)z()}else if(_&&!C)N+=N6.lineComment(N,X.indent,U(_));else if(B&&J)J();return N}AY.stringifyPair=RY});var VZ=T((CY)=>{var P7=J0("process");function SY($,...Z){if($==="debug")console.log(...Z)}function _Y($,Z){if($==="debug"||$==="warn")if(typeof P7.emitWarning==="function")P7.emitWarning(Z);else console.warn(Z)}CY.debug=SY;CY.warn=_Y});var y8=T((xY)=>{var I6=k(),S7=a(),k8="<<",f8={identify:($)=>$===k8||typeof $==="symbol"&&$.description===k8,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new S7.Scalar(Symbol(k8)),{addToJSMap:_7}),stringify:()=>k8},bY=($,Z)=>(f8.identify(Z)||I6.isScalar(Z)&&(!Z.type||Z.type===S7.Scalar.PLAIN)&&f8.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===f8.tag&&X.default);function _7($,Z,X){if(X=$&&I6.isAlias(X)?X.resolve($.doc):X,I6.isSeq(X))for(let z of X.items)KZ($,Z,z);else if(Array.isArray(X))for(let z of X)KZ($,Z,z);else KZ($,Z,X)}function KZ($,Z,X){let z=$&&I6.isAlias(X)?X.resolve($.doc):X;if(!I6.isMap(z))throw Error("Merge sources must be maps or map aliases");let J=z.toJSON(null,$,Map);for(let[q,Q]of J)if(Z instanceof Map){if(!Z.has(q))Z.set(q,Q)}else if(Z instanceof Set)Z.add(q);else if(!Object.prototype.hasOwnProperty.call(Z,q))Object.defineProperty(Z,q,{value:Q,writable:!0,enumerable:!0,configurable:!0});return Z}xY.addMergeToJSMap=_7;xY.isMergeKey=bY;xY.merge=f8});var DZ=T((mY)=>{var gY=VZ(),C7=y8(),hY=D6(),E7=k(),BZ=h0();function vY($,Z,{key:X,value:z}){if(E7.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(C7.isMergeKey($,X))C7.addMergeToJSMap($,Z,z);else{let J=BZ.toJS(X,"",$);if(Z instanceof Map)Z.set(J,BZ.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let q=uY(X,J,$),Q=BZ.toJS(z,q,$);if(q in Z)Object.defineProperty(Z,q,{value:Q,writable:!0,enumerable:!0,configurable:!0});else Z[q]=Q}}return Z}function uY($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(E7.isNode($)&&X?.doc){let z=hY.createStringifyContext(X.doc,{});z.anchors=new Set;for(let q of X.anchors.keys())z.anchors.add(q.anchor);z.inFlow=!0,z.inStringifyKey=!0;let J=$.toString(z);if(!X.mapKeyWarned){let q=JSON.stringify(J);if(q.length>40)q=q.substring(0,36)+'..."';gY.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return J}return JSON.stringify(Z)}mY.addPairToJSMap=vY});var m0=T((iY)=>{var j7=H6(),cY=A7(),pY=DZ(),g8=k();function lY($,Z,X){let z=j7.createNode($,void 0,X),J=j7.createNode(Z,void 0,X);return new h8(z,J)}class h8{constructor($,Z=null){Object.defineProperty(this,g8.NODE_TYPE,{value:g8.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(g8.isNode(Z))Z=Z.clone($);if(g8.isNode(X))X=X.clone($);return new h8(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return pY.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?cY.stringifyPair(this,$,Z,X):JSON.stringify(this)}}iY.Pair=h8;iY.createPair=lY});var NZ=T((tY)=>{var Q$=k(),b7=D6(),v8=V6();function rY($,Z,X){return(Z.inFlow??$.flow?oY:aY)($,Z,X)}function aY({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:q,onChompKeep:Q,onComment:Y}){let{indent:G,options:{commentString:U}}=X,W=Object.assign({},X,{indent:q,type:null}),V=!1,H=[];for(let M=0;M<Z.length;++M){let B=Z[M],N=null;if(Q$.isNode(B)){if(!V&&B.spaceBefore)H.push("");if(u8(X,H,B.commentBefore,V),B.comment)N=B.comment}else if(Q$.isPair(B)){let S=Q$.isNode(B.key)?B.key:null;if(S){if(!V&&S.spaceBefore)H.push("");u8(X,H,S.commentBefore,V)}}V=!1;let L=b7.stringify(B,W,()=>N=null,()=>V=!0);if(N)L+=v8.lineComment(L,q,U(N));if(V&&N)V=!1;H.push(z+L)}let D;if(H.length===0)D=J.start+J.end;else{D=H[0];for(let M=1;M<H.length;++M){let B=H[M];D+=B?`
71
- ${G}${B}`:`
72
- `}}if($){if(D+=`
73
- `+v8.indentComment(U($),G),Y)Y()}else if(V&&Q)Q();return D}function oY({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:q,flowCollectionPadding:Q,options:{commentString:Y}}=Z;z+=q;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),U=!1,W=0,V=[];for(let M=0;M<$.length;++M){let B=$[M],N=null;if(Q$.isNode(B)){if(B.spaceBefore)V.push("");if(u8(Z,V,B.commentBefore,!1),B.comment)N=B.comment}else if(Q$.isPair(B)){let S=Q$.isNode(B.key)?B.key:null;if(S){if(S.spaceBefore)V.push("");if(u8(Z,V,S.commentBefore,!1),S.comment)U=!0}let _=Q$.isNode(B.value)?B.value:null;if(_){if(_.comment)N=_.comment;if(_.commentBefore)U=!0}else if(B.value==null&&S?.comment)N=S.comment}if(N)U=!0;let L=b7.stringify(B,G,()=>N=null);if(M<$.length-1)L+=",";if(N)L+=v8.lineComment(L,z,Y(N));if(!U&&(V.length>W||L.includes(`
74
- `)))U=!0;V.push(L),W=V.length}let{start:H,end:D}=X;if(V.length===0)return H+D;else{if(!U){let M=V.reduce((B,N)=>B+N.length+2,2);U=Z.options.lineWidth>0&&M>Z.options.lineWidth}if(U){let M=H;for(let B of V)M+=B?`
75
- ${q}${J}${B}`:`
59
+ ${G}`);if(Q){let H=(D)=>D.default&&D.tag!=="tag:yaml.org,2002:str"&&D.test?.test(V),{compat:B,tags:M}=Z.doc.schema;if(M.some(H)||B?.some(H))return R$(q,Z)}return Y?V:v0.foldFlowLines(V,G,v0.FOLD_FLOW,b8(Z,!1))}function KY($,Z,X,z){let{implicitKey:J,inFlow:q}=Z,Q=typeof $.value==="string"?$:Object.assign({},$,{value:String($.value)}),{type:Y}=$;if(Y!==M0.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(Q.value))Y=M0.Scalar.QUOTE_DOUBLE}let G=(W)=>{switch(W){case M0.Scalar.BLOCK_FOLDED:case M0.Scalar.BLOCK_LITERAL:return J||q?R$(Q.value,Z):j8(Q,Z,X,z);case M0.Scalar.QUOTE_DOUBLE:return K6(Q.value,Z);case M0.Scalar.QUOTE_SINGLE:return WZ(Q.value,Z);case M0.Scalar.PLAIN:return VY(Q,Z,X,z);default:return null}},U=G(Y);if(U===null){let{defaultKeyType:W,defaultStringType:V}=Z.options,H=J&&W||V;if(U=G(H),U===null)throw Error(`Unsupported default string type ${H}`)}return U}DY.stringifyString=KY});var B6=L((FY)=>{var NY=_8(),u0=y(),IY=V6(),LY=D6();function TY($,Z){let X=Object.assign({blockQuote:!0,commentString:IY.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},$.schema.toStringOptions,Z),z;switch(X.collectionStyle){case"block":z=!1;break;case"flow":z=!0;break;default:z=null}return{anchors:new Set,doc:$,flowCollectionPadding:X.flowCollectionPadding?" ":"",indent:"",indentStep:typeof X.indent==="number"?" ".repeat(X.indent):" ",inFlow:z,options:X}}function MY($,Z){if(Z.tag){let J=$.filter((q)=>q.tag===Z.tag);if(J.length>0)return J.find((q)=>q.format===Z.format)??J[0]}let X=void 0,z;if(u0.isScalar(Z)){z=Z.value;let J=$.filter((q)=>q.identify?.(z));if(J.length>1){let q=J.filter((Q)=>Q.test);if(q.length>0)J=q}X=J.find((q)=>q.format===Z.format)??J.find((q)=>!q.format)}else z=Z,X=$.find((J)=>J.nodeClass&&z instanceof J.nodeClass);if(!X){let J=z?.constructor?.name??(z===null?"null":typeof z);throw Error(`Tag not resolved for ${J} value`)}return X}function OY($,Z,{anchors:X,doc:z}){if(!z.directives)return"";let J=[],q=(u0.isScalar($)||u0.isCollection($))&&$.anchor;if(q&&NY.anchorIsValid(q))X.add(q),J.push(`&${q}`);let Q=$.tag??(Z.default?null:Z.tag);if(Q)J.push(z.directives.tagString(Q));return J.join(" ")}function wY($,Z,X,z){if(u0.isPair($))return $.toString(Z,X,z);if(u0.isAlias($)){if(Z.doc.directives)return $.toString(Z);if(Z.resolvedAliases?.has($))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(Z.resolvedAliases)Z.resolvedAliases.add($);else Z.resolvedAliases=new Set([$]);$=$.resolve(Z.doc)}}let J=void 0,q=u0.isNode($)?$:Z.doc.createNode($,{onTagObj:(G)=>J=G});J??(J=MY(Z.doc.schema.tags,q));let Q=OY(q,J,Z);if(Q.length>0)Z.indentAtStart=(Z.indentAtStart??0)+Q.length+1;let Y=typeof J.stringify==="function"?J.stringify(q,Z,X,z):u0.isScalar(q)?LY.stringifyString(q,Z,X,z):q.toString(Z,X,z);if(!Q)return Y;return u0.isScalar(q)||Y[0]==="{"||Y[0]==="["?`${Q} ${Y}`:`${Q}
60
+ ${Z.indent}${Y}`}FY.createStringifyContext=TY;FY.stringify=wY});var A7=L((_Y)=>{var E0=y(),F7=o(),R7=B6(),N6=V6();function PY({key:$,value:Z},X,z,J){let{allNullValues:q,doc:Q,indent:Y,indentStep:G,options:{commentString:U,indentSeq:W,simpleKeys:V}}=X,H=E0.isNode($)&&$.comment||null;if(V){if(H)throw Error("With simple keys, key nodes cannot have comments");if(E0.isCollection($)||!E0.isNode($)&&typeof $==="object")throw Error("With simple keys, collection cannot be used as a key value")}let B=!V&&(!$||H&&Z==null&&!X.inFlow||E0.isCollection($)||(E0.isScalar($)?$.type===F7.Scalar.BLOCK_FOLDED||$.type===F7.Scalar.BLOCK_LITERAL:typeof $==="object"));X=Object.assign({},X,{allNullValues:!1,implicitKey:!B&&(V||!q),indent:Y+G});let M=!1,D=!1,N=R7.stringify($,X,()=>M=!0,()=>D=!0);if(!B&&!X.inFlow&&N.length>1024){if(V)throw Error("With simple keys, single line scalar must not span more than 1024 characters");B=!0}if(X.inFlow){if(q||Z==null){if(M&&z)z();return N===""?"?":B?`? ${N}`:N}}else if(q&&!V||Z==null&&B){if(N=`? ${N}`,H&&!M)N+=N6.lineComment(N,X.indent,U(H));else if(D&&J)J();return N}if(M)H=null;if(B){if(H)N+=N6.lineComment(N,X.indent,U(H));N=`? ${N}
61
+ ${Y}:`}else if(N=`${N}:`,H)N+=N6.lineComment(N,X.indent,U(H));let w,P,_;if(E0.isNode(Z))w=!!Z.spaceBefore,P=Z.commentBefore,_=Z.comment;else if(w=!1,P=null,_=null,Z&&typeof Z==="object")Z=Q.createNode(Z);if(X.implicitKey=!1,!B&&!H&&E0.isScalar(Z))X.indentAtStart=N.length+1;if(D=!1,!W&&G.length>=2&&!X.inFlow&&!B&&E0.isSeq(Z)&&!Z.flow&&!Z.tag&&!Z.anchor)X.indent=X.indent.substring(2);let R=!1,E=R7.stringify(Z,X,()=>R=!0,()=>D=!0),C=" ";if(H||w||P){if(C=w?`
62
+ `:"",P){let p=U(P);C+=`
63
+ ${N6.indentComment(p,X.indent)}`}if(E===""&&!X.inFlow){if(C===`
64
+ `&&_)C=`
65
+
66
+ `}else C+=`
67
+ ${X.indent}`}else if(!B&&E0.isCollection(Z)){let p=E[0],T=E.indexOf(`
68
+ `),x=T!==-1,g0=X.inFlow??Z.flow??Z.items.length===0;if(x||!g0){let M$=!1;if(x&&(p==="&"||p==="!")){let $0=E.indexOf(" ");if(p==="&"&&$0!==-1&&$0<T&&E[$0+1]==="!")$0=E.indexOf(" ",$0+1);if($0===-1||T<$0)M$=!0}if(!M$)C=`
69
+ ${X.indent}`}}else if(E===""||E[0]===`
70
+ `)C="";if(N+=C+E,X.inFlow){if(R&&z)z()}else if(_&&!R)N+=N6.lineComment(N,X.indent,U(_));else if(D&&J)J();return N}_Y.stringifyPair=PY});var VZ=L((jY)=>{var P7=J0("process");function SY($,...Z){if($==="debug")console.log(...Z)}function EY($,Z){if($==="debug"||$==="warn")if(typeof P7.emitWarning==="function")P7.emitWarning(Z);else console.warn(Z)}jY.debug=SY;jY.warn=EY});var y8=L((fY)=>{var I6=y(),_7=o(),k8="<<",f8={identify:($)=>$===k8||typeof $==="symbol"&&$.description===k8,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new _7.Scalar(Symbol(k8)),{addToJSMap:C7}),stringify:()=>k8},kY=($,Z)=>(f8.identify(Z)||I6.isScalar(Z)&&(!Z.type||Z.type===_7.Scalar.PLAIN)&&f8.identify(Z.value))&&$?.doc.schema.tags.some((X)=>X.tag===f8.tag&&X.default);function C7($,Z,X){if(X=$&&I6.isAlias(X)?X.resolve($.doc):X,I6.isSeq(X))for(let z of X.items)KZ($,Z,z);else if(Array.isArray(X))for(let z of X)KZ($,Z,z);else KZ($,Z,X)}function KZ($,Z,X){let z=$&&I6.isAlias(X)?X.resolve($.doc):X;if(!I6.isMap(z))throw Error("Merge sources must be maps or map aliases");let J=z.toJSON(null,$,Map);for(let[q,Q]of J)if(Z instanceof Map){if(!Z.has(q))Z.set(q,Q)}else if(Z instanceof Set)Z.add(q);else if(!Object.prototype.hasOwnProperty.call(Z,q))Object.defineProperty(Z,q,{value:Q,writable:!0,enumerable:!0,configurable:!0});return Z}fY.addMergeToJSMap=C7;fY.isMergeKey=kY;fY.merge=f8});var BZ=L((cY)=>{var vY=VZ(),S7=y8(),uY=B6(),E7=y(),DZ=h0();function mY($,Z,{key:X,value:z}){if(E7.isNode(X)&&X.addToJSMap)X.addToJSMap($,Z,z);else if(S7.isMergeKey($,X))S7.addMergeToJSMap($,Z,z);else{let J=DZ.toJS(X,"",$);if(Z instanceof Map)Z.set(J,DZ.toJS(z,J,$));else if(Z instanceof Set)Z.add(J);else{let q=dY(X,J,$),Q=DZ.toJS(z,q,$);if(q in Z)Object.defineProperty(Z,q,{value:Q,writable:!0,enumerable:!0,configurable:!0});else Z[q]=Q}}return Z}function dY($,Z,X){if(Z===null)return"";if(typeof Z!=="object")return String(Z);if(E7.isNode($)&&X?.doc){let z=uY.createStringifyContext(X.doc,{});z.anchors=new Set;for(let q of X.anchors.keys())z.anchors.add(q.anchor);z.inFlow=!0,z.inStringifyKey=!0;let J=$.toString(z);if(!X.mapKeyWarned){let q=JSON.stringify(J);if(q.length>40)q=q.substring(0,36)+'..."';vY.warn(X.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${q}. Set mapAsMap: true to use object keys.`),X.mapKeyWarned=!0}return J}return JSON.stringify(Z)}cY.addPairToJSMap=mY});var m0=L((sY)=>{var j7=H6(),lY=A7(),iY=BZ(),g8=y();function nY($,Z,X){let z=j7.createNode($,void 0,X),J=j7.createNode(Z,void 0,X);return new h8(z,J)}class h8{constructor($,Z=null){Object.defineProperty(this,g8.NODE_TYPE,{value:g8.PAIR}),this.key=$,this.value=Z}clone($){let{key:Z,value:X}=this;if(g8.isNode(Z))Z=Z.clone($);if(g8.isNode(X))X=X.clone($);return new h8(Z,X)}toJSON($,Z){let X=Z?.mapAsMap?new Map:{};return iY.addPairToJSMap(Z,X,this)}toString($,Z,X){return $?.doc?lY.stringifyPair(this,$,Z,X):JSON.stringify(this)}}sY.Pair=h8;sY.createPair=nY});var NZ=L(($1)=>{var Q$=y(),b7=B6(),v8=V6();function oY($,Z,X){return(Z.inFlow??$.flow?eY:tY)($,Z,X)}function tY({comment:$,items:Z},X,{blockItemPrefix:z,flowChars:J,itemIndent:q,onChompKeep:Q,onComment:Y}){let{indent:G,options:{commentString:U}}=X,W=Object.assign({},X,{indent:q,type:null}),V=!1,H=[];for(let M=0;M<Z.length;++M){let D=Z[M],N=null;if(Q$.isNode(D)){if(!V&&D.spaceBefore)H.push("");if(u8(X,H,D.commentBefore,V),D.comment)N=D.comment}else if(Q$.isPair(D)){let P=Q$.isNode(D.key)?D.key:null;if(P){if(!V&&P.spaceBefore)H.push("");u8(X,H,P.commentBefore,V)}}V=!1;let w=b7.stringify(D,W,()=>N=null,()=>V=!0);if(N)w+=v8.lineComment(w,q,U(N));if(V&&N)V=!1;H.push(z+w)}let B;if(H.length===0)B=J.start+J.end;else{B=H[0];for(let M=1;M<H.length;++M){let D=H[M];B+=D?`
71
+ ${G}${D}`:`
72
+ `}}if($){if(B+=`
73
+ `+v8.indentComment(U($),G),Y)Y()}else if(V&&Q)Q();return B}function eY({items:$},Z,{flowChars:X,itemIndent:z}){let{indent:J,indentStep:q,flowCollectionPadding:Q,options:{commentString:Y}}=Z;z+=q;let G=Object.assign({},Z,{indent:z,inFlow:!0,type:null}),U=!1,W=0,V=[];for(let M=0;M<$.length;++M){let D=$[M],N=null;if(Q$.isNode(D)){if(D.spaceBefore)V.push("");if(u8(Z,V,D.commentBefore,!1),D.comment)N=D.comment}else if(Q$.isPair(D)){let P=Q$.isNode(D.key)?D.key:null;if(P){if(P.spaceBefore)V.push("");if(u8(Z,V,P.commentBefore,!1),P.comment)U=!0}let _=Q$.isNode(D.value)?D.value:null;if(_){if(_.comment)N=_.comment;if(_.commentBefore)U=!0}else if(D.value==null&&P?.comment)N=P.comment}if(N)U=!0;let w=b7.stringify(D,G,()=>N=null);if(M<$.length-1)w+=",";if(N)w+=v8.lineComment(w,z,Y(N));if(!U&&(V.length>W||w.includes(`
74
+ `)))U=!0;V.push(w),W=V.length}let{start:H,end:B}=X;if(V.length===0)return H+B;else{if(!U){let M=V.reduce((D,N)=>D+N.length+2,2);U=Z.options.lineWidth>0&&M>Z.options.lineWidth}if(U){let M=H;for(let D of V)M+=D?`
75
+ ${q}${J}${D}`:`
76
76
  `;return`${M}
77
- ${J}${D}`}else return`${H}${Q}${V.join(" ")}${Q}${D}`}}function u8({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let q=v8.indentComment(Z(z),$);X.push(q.trimStart())}}tY.stringifyCollection=rY});var c0=T((J1)=>{var $1=NZ(),Z1=DZ(),X1=E8(),d0=k(),m8=m0(),z1=a();function L6($,Z){let X=d0.isScalar(Z)?Z.value:Z;for(let z of $)if(d0.isPair(z)){if(z.key===Z||z.key===X)return z;if(d0.isScalar(z.key)&&z.key.value===X)return z}return}class x7 extends X1.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(d0.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,q=new this($),Q=(Y,G)=>{if(typeof J==="function")G=J.call(Z,Y,G);else if(Array.isArray(J)&&!J.includes(Y))return;if(G!==void 0||z)q.items.push(m8.createPair(Y,G,X))};if(Z instanceof Map)for(let[Y,G]of Z)Q(Y,G);else if(Z&&typeof Z==="object")for(let Y of Object.keys(Z))Q(Y,Z[Y]);if(typeof $.sortMapEntries==="function")q.items.sort($.sortMapEntries);return q}add($,Z){let X;if(d0.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new m8.Pair($,$?.value);else X=new m8.Pair($.key,$.value);let z=L6(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(d0.isScalar(z.value)&&z1.isScalarValue(X.value))z.value.value=X.value;else z.value=X.value}else if(J){let q=this.items.findIndex((Q)=>J(X,Q)<0);if(q===-1)this.items.push(X);else this.items.splice(q,0,X)}else this.items.push(X)}delete($){let Z=L6(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=L6(this.items,$)?.value;return(!Z&&d0.isScalar(z)?z.value:z)??void 0}has($){return!!L6(this.items,$)}set($,Z){this.add(new m8.Pair($,Z),!0)}toJSON($,Z,X){let z=X?new X:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(z);for(let J of this.items)Z1.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!d0.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return $1.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}J1.YAMLMap=x7;J1.findPair=L6});var A$=T((U1)=>{var Y1=k(),k7=c0(),G1={collection:"map",default:!0,nodeClass:k7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!Y1.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>k7.YAMLMap.from($,Z,X)};U1.map=G1});var p0=T((N1)=>{var H1=H6(),V1=NZ(),K1=E8(),c8=k(),B1=a(),D1=h0();class f7 extends K1.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(c8.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=d8($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=d8($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&c8.isScalar(z)?z.value:z}has($){let Z=d8($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=d8($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(c8.isScalar(z)&&B1.isScalarValue(Z))z.value=Z;else this.items[X]=Z}toJSON($,Z){let X=[];if(Z?.onCreate)Z.onCreate(X);let z=0;for(let J of this.items)X.push(D1.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return V1.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:X,onComment:Z})}static from($,Z,X){let{replacer:z}=X,J=new this($);if(Z&&Symbol.iterator in Object(Z)){let q=0;for(let Q of Z){if(typeof z==="function"){let Y=Z instanceof Set?Q:String(q++);Q=z.call(Z,Y,Q)}J.items.push(H1.createNode(Q,void 0,X))}}return J}}function d8($){let Z=c8.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}N1.YAMLSeq=f7});var P$=T((M1)=>{var L1=k(),y7=p0(),T1={collection:"seq",default:!0,nodeClass:y7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!L1.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>y7.YAMLSeq.from($,Z,X)};M1.seq=T1});var T6=T((R1)=>{var w1=B6(),F1={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),w1.stringifyString($,Z,X,z)}};R1.string=F1});var p8=T((P1)=>{var g7=a(),h7={identify:($)=>$==null,createNode:()=>new g7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new g7.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&h7.test.test($)?$:Z.options.nullStr};P1.nullTag=h7});var IZ=T((C1)=>{var _1=a(),v7={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new _1.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&v7.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};C1.boolTag=v7});var S$=T((b1)=>{function j1({format:$,minFractionDigits:Z,tag:X,value:z}){if(typeof z==="bigint")return String(z);let J=typeof z==="number"?z:Number(z);if(!isFinite(J))return isNaN(J)?".nan":J<0?"-.inf":".inf";let q=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(q)){let Q=q.indexOf(".");if(Q<0)Q=q.length,q+=".";let Y=Z-(q.length-Q-1);while(Y-- >0)q+="0"}return q}b1.stringifyNumber=j1});var TZ=T((h1)=>{var k1=a(),LZ=S$(),f1={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:LZ.stringifyNumber},y1={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():LZ.stringifyNumber($)}},g1={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new k1.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:LZ.stringifyNumber};h1.float=g1;h1.floatExp=y1;h1.floatNaN=f1});var OZ=T((l1)=>{var u7=S$(),l8=($)=>typeof $==="bigint"||Number.isInteger($),MZ=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function m7($,Z,X){let{value:z}=$;if(l8(z)&&z>=0)return X+z.toString(Z);return u7.stringifyNumber($)}var d1={identify:($)=>l8($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>MZ($,2,8,X),stringify:($)=>m7($,8,"0o")},c1={identify:l8,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>MZ($,0,10,X),stringify:u7.stringifyNumber},p1={identify:($)=>l8($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>MZ($,2,16,X),stringify:($)=>m7($,16,"0x")};l1.int=c1;l1.intHex=p1;l1.intOct=d1});var d7=T((Z3)=>{var r1=A$(),a1=p8(),o1=P$(),t1=T6(),e1=IZ(),wZ=TZ(),FZ=OZ(),$3=[r1.map,o1.seq,t1.string,a1.nullTag,e1.boolTag,FZ.intOct,FZ.int,FZ.intHex,wZ.floatNaN,wZ.floatExp,wZ.float];Z3.schema=$3});var p7=T((U3)=>{var z3=a(),J3=A$(),q3=P$();function c7($){return typeof $==="bigint"||Number.isInteger($)}var i8=({value:$})=>JSON.stringify($),Q3=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:i8},{identify:($)=>$==null,createNode:()=>new z3.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:i8},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:i8},{identify:c7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>c7($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:i8}],Y3={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},G3=[J3.map,q3.seq].concat(Q3,Y3);U3.schema=G3});var AZ=T((K3)=>{var M6=J0("buffer"),RZ=a(),H3=B6(),V3={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof M6.Buffer==="function")return M6.Buffer.from($,"base64");else if(typeof atob==="function"){let X=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(X.length);for(let J=0;J<X.length;++J)z[J]=X.charCodeAt(J);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:X},z,J,q){if(!X)return"";let Q=X,Y;if(typeof M6.Buffer==="function")Y=Q instanceof M6.Buffer?Q.toString("base64"):M6.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let U=0;U<Q.length;++U)G+=String.fromCharCode(Q[U]);Y=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=RZ.Scalar.BLOCK_LITERAL),Z!==RZ.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),U=Math.ceil(Y.length/G),W=Array(U);for(let V=0,H=0;V<U;++V,H+=G)W[V]=Y.substr(H,G);Y=W.join(Z===RZ.Scalar.BLOCK_LITERAL?`
78
- `:" ")}return H3.stringifyString({comment:$,type:Z,value:Y},z,J,q)}};K3.binary=V3});var s8=T((L3)=>{var n8=k(),PZ=m0(),D3=a(),N3=p0();function l7($,Z){if(n8.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(n8.isPair(z))continue;else if(n8.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new PZ.Pair(new D3.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
77
+ ${J}${B}`}else return`${H}${Q}${V.join(" ")}${Q}${B}`}}function u8({indent:$,options:{commentString:Z}},X,z,J){if(z&&J)z=z.replace(/^\n+/,"");if(z){let q=v8.indentComment(Z(z),$);X.push(q.trimStart())}}$1.stringifyCollection=oY});var c0=L((Q1)=>{var X1=NZ(),z1=BZ(),J1=E8(),d0=y(),m8=m0(),q1=o();function L6($,Z){let X=d0.isScalar(Z)?Z.value:Z;for(let z of $)if(d0.isPair(z)){if(z.key===Z||z.key===X)return z;if(d0.isScalar(z.key)&&z.key.value===X)return z}return}class x7 extends J1.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor($){super(d0.MAP,$);this.items=[]}static from($,Z,X){let{keepUndefined:z,replacer:J}=X,q=new this($),Q=(Y,G)=>{if(typeof J==="function")G=J.call(Z,Y,G);else if(Array.isArray(J)&&!J.includes(Y))return;if(G!==void 0||z)q.items.push(m8.createPair(Y,G,X))};if(Z instanceof Map)for(let[Y,G]of Z)Q(Y,G);else if(Z&&typeof Z==="object")for(let Y of Object.keys(Z))Q(Y,Z[Y]);if(typeof $.sortMapEntries==="function")q.items.sort($.sortMapEntries);return q}add($,Z){let X;if(d0.isPair($))X=$;else if(!$||typeof $!=="object"||!("key"in $))X=new m8.Pair($,$?.value);else X=new m8.Pair($.key,$.value);let z=L6(this.items,X.key),J=this.schema?.sortMapEntries;if(z){if(!Z)throw Error(`Key ${X.key} already set`);if(d0.isScalar(z.value)&&q1.isScalarValue(X.value))z.value.value=X.value;else z.value=X.value}else if(J){let q=this.items.findIndex((Q)=>J(X,Q)<0);if(q===-1)this.items.push(X);else this.items.splice(q,0,X)}else this.items.push(X)}delete($){let Z=L6(this.items,$);if(!Z)return!1;return this.items.splice(this.items.indexOf(Z),1).length>0}get($,Z){let z=L6(this.items,$)?.value;return(!Z&&d0.isScalar(z)?z.value:z)??void 0}has($){return!!L6(this.items,$)}set($,Z){this.add(new m8.Pair($,Z),!0)}toJSON($,Z,X){let z=X?new X:Z?.mapAsMap?new Map:{};if(Z?.onCreate)Z.onCreate(z);for(let J of this.items)z1.addPairToJSMap(Z,z,J);return z}toString($,Z,X){if(!$)return JSON.stringify(this);for(let z of this.items)if(!d0.isPair(z))throw Error(`Map items must all be pairs; found ${JSON.stringify(z)} instead`);if(!$.allNullValues&&this.hasAllNullValues(!1))$=Object.assign({},$,{allNullValues:!0});return X1.stringifyCollection(this,$,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:$.indent||"",onChompKeep:X,onComment:Z})}}Q1.YAMLMap=x7;Q1.findPair=L6});var A$=L((H1)=>{var U1=y(),k7=c0(),W1={collection:"map",default:!0,nodeClass:k7.YAMLMap,tag:"tag:yaml.org,2002:map",resolve($,Z){if(!U1.isMap($))Z("Expected a mapping for this tag");return $},createNode:($,Z,X)=>k7.YAMLMap.from($,Z,X)};H1.map=W1});var p0=L((L1)=>{var K1=H6(),D1=NZ(),B1=E8(),c8=y(),N1=o(),I1=h0();class f7 extends B1.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor($){super(c8.SEQ,$);this.items=[]}add($){this.items.push($)}delete($){let Z=d8($);if(typeof Z!=="number")return!1;return this.items.splice(Z,1).length>0}get($,Z){let X=d8($);if(typeof X!=="number")return;let z=this.items[X];return!Z&&c8.isScalar(z)?z.value:z}has($){let Z=d8($);return typeof Z==="number"&&Z<this.items.length}set($,Z){let X=d8($);if(typeof X!=="number")throw Error(`Expected a valid index, not ${$}.`);let z=this.items[X];if(c8.isScalar(z)&&N1.isScalarValue(Z))z.value=Z;else this.items[X]=Z}toJSON($,Z){let X=[];if(Z?.onCreate)Z.onCreate(X);let z=0;for(let J of this.items)X.push(I1.toJS(J,String(z++),Z));return X}toString($,Z,X){if(!$)return JSON.stringify(this);return D1.stringifyCollection(this,$,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:($.indent||"")+" ",onChompKeep:X,onComment:Z})}static from($,Z,X){let{replacer:z}=X,J=new this($);if(Z&&Symbol.iterator in Object(Z)){let q=0;for(let Q of Z){if(typeof z==="function"){let Y=Z instanceof Set?Q:String(q++);Q=z.call(Z,Y,Q)}J.items.push(K1.createNode(Q,void 0,X))}}return J}}function d8($){let Z=c8.isScalar($)?$.value:$;if(Z&&typeof Z==="string")Z=Number(Z);return typeof Z==="number"&&Number.isInteger(Z)&&Z>=0?Z:null}L1.YAMLSeq=f7});var P$=L((w1)=>{var M1=y(),y7=p0(),O1={collection:"seq",default:!0,nodeClass:y7.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve($,Z){if(!M1.isSeq($))Z("Expected a sequence for this tag");return $},createNode:($,Z,X)=>y7.YAMLSeq.from($,Z,X)};w1.seq=O1});var T6=L((P1)=>{var R1=D6(),A1={identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify($,Z,X,z){return Z=Object.assign({actualString:!0},Z),R1.stringifyString($,Z,X,z)}};P1.string=A1});var p8=L((C1)=>{var g7=o(),h7={identify:($)=>$==null,createNode:()=>new g7.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new g7.Scalar(null),stringify:({source:$},Z)=>typeof $==="string"&&h7.test.test($)?$:Z.options.nullStr};C1.nullTag=h7});var IZ=L((j1)=>{var E1=o(),v7={identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:($)=>new E1.Scalar($[0]==="t"||$[0]==="T"),stringify({source:$,value:Z},X){if($&&v7.test.test($)){let z=$[0]==="t"||$[0]==="T";if(Z===z)return $}return Z?X.options.trueStr:X.options.falseStr}};j1.boolTag=v7});var _$=L((k1)=>{function x1({format:$,minFractionDigits:Z,tag:X,value:z}){if(typeof z==="bigint")return String(z);let J=typeof z==="number"?z:Number(z);if(!isFinite(J))return isNaN(J)?".nan":J<0?"-.inf":".inf";let q=Object.is(z,-0)?"-0":JSON.stringify(z);if(!$&&Z&&(!X||X==="tag:yaml.org,2002:float")&&/^\d/.test(q)){let Q=q.indexOf(".");if(Q<0)Q=q.length,q+=".";let Y=Z-(q.length-Q-1);while(Y-- >0)q+="0"}return q}k1.stringifyNumber=x1});var TZ=L((u1)=>{var y1=o(),LZ=_$(),g1={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:LZ.stringifyNumber},h1={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():LZ.stringifyNumber($)}},v1={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve($){let Z=new y1.Scalar(parseFloat($)),X=$.indexOf(".");if(X!==-1&&$[$.length-1]==="0")Z.minFractionDigits=$.length-X-1;return Z},stringify:LZ.stringifyNumber};u1.float=v1;u1.floatExp=h1;u1.floatNaN=g1});var OZ=L((n1)=>{var u7=_$(),l8=($)=>typeof $==="bigint"||Number.isInteger($),MZ=($,Z,X,{intAsBigInt:z})=>z?BigInt($):parseInt($.substring(Z),X);function m7($,Z,X){let{value:z}=$;if(l8(z)&&z>=0)return X+z.toString(Z);return u7.stringifyNumber($)}var p1={identify:($)=>l8($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:($,Z,X)=>MZ($,2,8,X),stringify:($)=>m7($,8,"0o")},l1={identify:l8,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:($,Z,X)=>MZ($,0,10,X),stringify:u7.stringifyNumber},i1={identify:($)=>l8($)&&$>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:($,Z,X)=>MZ($,2,16,X),stringify:($)=>m7($,16,"0x")};n1.int=l1;n1.intHex=i1;n1.intOct=p1});var d7=L((z3)=>{var o1=A$(),t1=p8(),e1=P$(),$3=T6(),Z3=IZ(),wZ=TZ(),FZ=OZ(),X3=[o1.map,e1.seq,$3.string,t1.nullTag,Z3.boolTag,FZ.intOct,FZ.int,FZ.intHex,wZ.floatNaN,wZ.floatExp,wZ.float];z3.schema=X3});var p7=L((H3)=>{var q3=o(),Q3=A$(),Y3=P$();function c7($){return typeof $==="bigint"||Number.isInteger($)}var i8=({value:$})=>JSON.stringify($),G3=[{identify:($)=>typeof $==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:($)=>$,stringify:i8},{identify:($)=>$==null,createNode:()=>new q3.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:i8},{identify:($)=>typeof $==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:($)=>$==="true",stringify:i8},{identify:c7,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:($,Z,{intAsBigInt:X})=>X?BigInt($):parseInt($,10),stringify:({value:$})=>c7($)?$.toString():JSON.stringify($)},{identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:($)=>parseFloat($),stringify:i8}],U3={default:!0,tag:"",test:/^/,resolve($,Z){return Z(`Unresolved plain scalar ${JSON.stringify($)}`),$}},W3=[Q3.map,Y3.seq].concat(G3,U3);H3.schema=W3});var AZ=L((B3)=>{var M6=J0("buffer"),RZ=o(),K3=D6(),D3={identify:($)=>$ instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve($,Z){if(typeof M6.Buffer==="function")return M6.Buffer.from($,"base64");else if(typeof atob==="function"){let X=atob($.replace(/[\n\r]/g,"")),z=new Uint8Array(X.length);for(let J=0;J<X.length;++J)z[J]=X.charCodeAt(J);return z}else return Z("This environment does not support reading binary tags; either Buffer or atob is required"),$},stringify({comment:$,type:Z,value:X},z,J,q){if(!X)return"";let Q=X,Y;if(typeof M6.Buffer==="function")Y=Q instanceof M6.Buffer?Q.toString("base64"):M6.Buffer.from(Q.buffer).toString("base64");else if(typeof btoa==="function"){let G="";for(let U=0;U<Q.length;++U)G+=String.fromCharCode(Q[U]);Y=btoa(G)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(Z??(Z=RZ.Scalar.BLOCK_LITERAL),Z!==RZ.Scalar.QUOTE_DOUBLE){let G=Math.max(z.options.lineWidth-z.indent.length,z.options.minContentWidth),U=Math.ceil(Y.length/G),W=Array(U);for(let V=0,H=0;V<U;++V,H+=G)W[V]=Y.substr(H,G);Y=W.join(Z===RZ.Scalar.BLOCK_LITERAL?`
78
+ `:" ")}return K3.stringifyString({comment:$,type:Z,value:Y},z,J,q)}};B3.binary=D3});var s8=L((M3)=>{var n8=y(),PZ=m0(),I3=o(),L3=p0();function l7($,Z){if(n8.isSeq($))for(let X=0;X<$.items.length;++X){let z=$.items[X];if(n8.isPair(z))continue;else if(n8.isMap(z)){if(z.items.length>1)Z("Each pair must have its own sequence indicator");let J=z.items[0]||new PZ.Pair(new I3.Scalar(null));if(z.commentBefore)J.key.commentBefore=J.key.commentBefore?`${z.commentBefore}
79
79
  ${J.key.commentBefore}`:z.commentBefore;if(z.comment){let q=J.value??J.key;q.comment=q.comment?`${z.comment}
80
- ${q.comment}`:z.comment}z=J}$.items[X]=n8.isPair(z)?z:new PZ.Pair(z)}else Z("Expected a sequence for this tag");return $}function i7($,Z,X){let{replacer:z}=X,J=new N3.YAMLSeq($);J.tag="tag:yaml.org,2002:pairs";let q=0;if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof z==="function")Q=z.call(Z,String(q++),Q);let Y,G;if(Array.isArray(Q))if(Q.length===2)Y=Q[0],G=Q[1];else throw TypeError(`Expected [key, value] tuple: ${Q}`);else if(Q&&Q instanceof Object){let U=Object.keys(Q);if(U.length===1)Y=U[0],G=Q[Y];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else Y=Q;J.items.push(PZ.createPair(Y,G,X))}return J}var I3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:l7,createNode:i7};L3.createPairs=i7;L3.pairs=I3;L3.resolvePairs=l7});var _Z=T((R3)=>{var n7=k(),SZ=h0(),O6=c0(),w3=p0(),s7=s8();class Y$ extends w3.YAMLSeq{constructor(){super();this.add=O6.YAMLMap.prototype.add.bind(this),this.delete=O6.YAMLMap.prototype.delete.bind(this),this.get=O6.YAMLMap.prototype.get.bind(this),this.has=O6.YAMLMap.prototype.has.bind(this),this.set=O6.YAMLMap.prototype.set.bind(this),this.tag=Y$.tag}toJSON($,Z){if(!Z)return super.toJSON($);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let z of this.items){let J,q;if(n7.isPair(z))J=SZ.toJS(z.key,"",Z),q=SZ.toJS(z.value,J,Z);else J=SZ.toJS(z,"",Z);if(X.has(J))throw Error("Ordered maps must not include duplicate keys");X.set(J,q)}return X}static from($,Z,X){let z=s7.createPairs($,Z,X),J=new this;return J.items=z.items,J}}Y$.tag="tag:yaml.org,2002:omap";var F3={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:Y$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=s7.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(n7.isScalar(J))if(z.includes(J.value))Z(`Ordered maps must not include duplicate keys: ${J.value}`);else z.push(J.value);return Object.assign(new Y$,X)},createNode:($,Z,X)=>Y$.from($,Z,X)};R3.YAMLOMap=Y$;R3.omap=F3});var e7=T((S3)=>{var r7=a();function a7({value:$,source:Z},X){if(Z&&($?o7:t7).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var o7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new r7.Scalar(!0),stringify:a7},t7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new r7.Scalar(!1),stringify:a7};S3.falseTag=t7;S3.trueTag=o7});var $X=T((k3)=>{var E3=a(),CZ=S$(),j3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:CZ.stringifyNumber},b3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():CZ.stringifyNumber($)}},x3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new E3.Scalar(parseFloat($.replace(/_/g,""))),X=$.indexOf(".");if(X!==-1){let z=$.substring(X+1).replace(/_/g,"");if(z[z.length-1]==="0")Z.minFractionDigits=z.length}return Z},stringify:CZ.stringifyNumber};k3.float=x3;k3.floatExp=b3;k3.floatNaN=j3});var XX=T((d3)=>{var ZX=S$(),w6=($)=>typeof $==="bigint"||Number.isInteger($);function r8($,Z,X,{intAsBigInt:z}){let J=$[0];if(J==="-"||J==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(X){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let Q=BigInt($);return J==="-"?BigInt(-1)*Q:Q}let q=parseInt($,X);return J==="-"?-1*q:q}function EZ($,Z,X){let{value:z}=$;if(w6(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return ZX.stringifyNumber($)}var h3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>r8($,2,2,X),stringify:($)=>EZ($,2,"0b")},v3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>r8($,1,8,X),stringify:($)=>EZ($,8,"0")},u3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>r8($,0,10,X),stringify:ZX.stringifyNumber},m3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>r8($,2,16,X),stringify:($)=>EZ($,16,"0x")};d3.int=u3;d3.intBin=h3;d3.intHex=m3;d3.intOct=v3});var jZ=T((s3)=>{var t8=k(),a8=m0(),o8=c0();class G$ extends o8.YAMLMap{constructor($){super($);this.tag=G$.tag}add($){let Z;if(t8.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new a8.Pair($.key,null);else Z=new a8.Pair($,null);if(!o8.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=o8.findPair(this.items,$);return!Z&&t8.isPair(X)?t8.isScalar(X.key)?X.key.value:X.key:X}set($,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=o8.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new a8.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,X){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from($,Z,X){let{replacer:z}=X,J=new this($);if(Z&&Symbol.iterator in Object(Z))for(let q of Z){if(typeof z==="function")q=z.call(Z,q,q);J.items.push(a8.createPair(q,null,X))}return J}}G$.tag="tag:yaml.org,2002:set";var n3={collection:"map",identify:($)=>$ instanceof Set,nodeClass:G$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>G$.from($,Z,X),resolve($,Z){if(t8.isMap($))if($.hasAllNullValues(!0))return Object.assign(new G$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};s3.YAMLSet=G$;s3.set=n3});var xZ=T(($G)=>{var o3=S$();function bZ($,Z){let X=$[0],z=X==="-"||X==="+"?$.substring(1):$,J=(Q)=>Z?BigInt(Q):Number(Q),q=z.replace(/_/g,"").split(":").reduce((Q,Y)=>Q*J(60)+J(Y),J(0));return X==="-"?J(-1)*q:q}function zX($){let{value:Z}=$,X=(Q)=>Q;if(typeof Z==="bigint")X=(Q)=>BigInt(Q);else if(isNaN(Z)||!isFinite(Z))return o3.stringifyNumber($);let z="";if(Z<0)z="-",Z*=X(-1);let J=X(60),q=[Z%J];if(Z<60)q.unshift(0);else if(Z=(Z-q[0])/J,q.unshift(Z%J),Z>=60)Z=(Z-q[0])/J,q.unshift(Z);return z+q.map((Q)=>String(Q).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var t3={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,Z,{intAsBigInt:X})=>bZ($,X),stringify:zX},e3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>bZ($,!1),stringify:zX},JX={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let Z=$.match(JX.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,q,Q,Y]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,U=Date.UTC(X,z-1,J,q||0,Q||0,Y||0,G),W=Z[8];if(W&&W!=="Z"){let V=bZ(W,!1);if(Math.abs(V)<30)V*=60;U-=60000*V}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$G.floatTime=e3;$G.intTime=t3;$G.timestamp=JX});var QX=T((BG)=>{var JG=A$(),qG=p8(),QG=P$(),YG=T6(),GG=AZ(),qX=e7(),kZ=$X(),e8=XX(),UG=y8(),WG=_Z(),HG=s8(),VG=jZ(),fZ=xZ(),KG=[JG.map,QG.seq,YG.string,qG.nullTag,qX.trueTag,qX.falseTag,e8.intBin,e8.intOct,e8.int,e8.intHex,kZ.floatNaN,kZ.floatExp,kZ.float,GG.binary,UG.merge,WG.omap,HG.pairs,VG.set,fZ.intTime,fZ.floatTime,fZ.timestamp];BG.schema=KG});var NX=T((FG)=>{var WX=A$(),NG=p8(),HX=P$(),IG=T6(),LG=IZ(),yZ=TZ(),gZ=OZ(),TG=d7(),MG=p7(),VX=AZ(),F6=y8(),KX=_Z(),BX=s8(),YX=QX(),DX=jZ(),$2=xZ(),GX=new Map([["core",TG.schema],["failsafe",[WX.map,HX.seq,IG.string]],["json",MG.schema],["yaml11",YX.schema],["yaml-1.1",YX.schema]]),UX={binary:VX.binary,bool:LG.boolTag,float:yZ.float,floatExp:yZ.floatExp,floatNaN:yZ.floatNaN,floatTime:$2.floatTime,int:gZ.int,intHex:gZ.intHex,intOct:gZ.intOct,intTime:$2.intTime,map:WX.map,merge:F6.merge,null:NG.nullTag,omap:KX.omap,pairs:BX.pairs,seq:HX.seq,set:DX.set,timestamp:$2.timestamp},OG={"tag:yaml.org,2002:binary":VX.binary,"tag:yaml.org,2002:merge":F6.merge,"tag:yaml.org,2002:omap":KX.omap,"tag:yaml.org,2002:pairs":BX.pairs,"tag:yaml.org,2002:set":DX.set,"tag:yaml.org,2002:timestamp":$2.timestamp};function wG($,Z,X){let z=GX.get(Z);if(z&&!$)return X&&!z.includes(F6.merge)?z.concat(F6.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let q=Array.from(GX.keys()).filter((Q)=>Q!=="yaml11").map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${q} or define customTags array`)}if(Array.isArray($))for(let q of $)J=J.concat(q);else if(typeof $==="function")J=$(J.slice());if(X)J=J.concat(F6.merge);return J.reduce((q,Q)=>{let Y=typeof Q==="string"?UX[Q]:Q;if(!Y){let G=JSON.stringify(Q),U=Object.keys(UX).map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${U}`)}if(!q.includes(Y))q.push(Y);return q},[])}FG.coreKnownTags=OG;FG.getTags=wG});var uZ=T((EG)=>{var hZ=k(),PG=A$(),SG=P$(),_G=T6(),Z2=NX(),CG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class vZ{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:q,toStringDefaults:Q}){this.compat=Array.isArray($)?Z2.getTags($,"compat"):$?Z2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?Z2.coreKnownTags:{},this.tags=Z2.getTags(Z,this.name,X),this.toStringOptions=Q??null,Object.defineProperty(this,hZ.MAP,{value:PG.map}),Object.defineProperty(this,hZ.SCALAR,{value:_G.string}),Object.defineProperty(this,hZ.SEQ,{value:SG.seq}),this.sortMapEntries=typeof q==="function"?q:q===!0?CG:null}clone(){let $=Object.create(vZ.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}EG.Schema=vZ});var IX=T((kG)=>{var bG=k(),mZ=D6(),R6=V6();function xG($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)X.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=mZ.createStringifyContext($,Z),{commentString:q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let G=q($.commentBefore);X.unshift(R6.indentComment(G,""))}let Q=!1,Y=null;if($.contents){if(bG.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let W=q($.contents.commentBefore);X.push(R6.indentComment(W,""))}J.forceBlockIndent=!!$.comment,Y=$.contents.comment}let G=Y?void 0:()=>Q=!0,U=mZ.stringify($.contents,J,()=>Y=null,G);if(Y)U+=R6.lineComment(U,"",q(Y));if((U[0]==="|"||U[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${U}`;else X.push(U)}else X.push(mZ.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let G=q($.comment);if(G.includes(`
80
+ ${q.comment}`:z.comment}z=J}$.items[X]=n8.isPair(z)?z:new PZ.Pair(z)}else Z("Expected a sequence for this tag");return $}function i7($,Z,X){let{replacer:z}=X,J=new L3.YAMLSeq($);J.tag="tag:yaml.org,2002:pairs";let q=0;if(Z&&Symbol.iterator in Object(Z))for(let Q of Z){if(typeof z==="function")Q=z.call(Z,String(q++),Q);let Y,G;if(Array.isArray(Q))if(Q.length===2)Y=Q[0],G=Q[1];else throw TypeError(`Expected [key, value] tuple: ${Q}`);else if(Q&&Q instanceof Object){let U=Object.keys(Q);if(U.length===1)Y=U[0],G=Q[Y];else throw TypeError(`Expected tuple with one key, not ${U.length} keys`)}else Y=Q;J.items.push(PZ.createPair(Y,G,X))}return J}var T3={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:l7,createNode:i7};M3.createPairs=i7;M3.pairs=T3;M3.resolvePairs=l7});var CZ=L((P3)=>{var n7=y(),_Z=h0(),O6=c0(),R3=p0(),s7=s8();class Y$ extends R3.YAMLSeq{constructor(){super();this.add=O6.YAMLMap.prototype.add.bind(this),this.delete=O6.YAMLMap.prototype.delete.bind(this),this.get=O6.YAMLMap.prototype.get.bind(this),this.has=O6.YAMLMap.prototype.has.bind(this),this.set=O6.YAMLMap.prototype.set.bind(this),this.tag=Y$.tag}toJSON($,Z){if(!Z)return super.toJSON($);let X=new Map;if(Z?.onCreate)Z.onCreate(X);for(let z of this.items){let J,q;if(n7.isPair(z))J=_Z.toJS(z.key,"",Z),q=_Z.toJS(z.value,J,Z);else J=_Z.toJS(z,"",Z);if(X.has(J))throw Error("Ordered maps must not include duplicate keys");X.set(J,q)}return X}static from($,Z,X){let z=s7.createPairs($,Z,X),J=new this;return J.items=z.items,J}}Y$.tag="tag:yaml.org,2002:omap";var A3={collection:"seq",identify:($)=>$ instanceof Map,nodeClass:Y$,default:!1,tag:"tag:yaml.org,2002:omap",resolve($,Z){let X=s7.resolvePairs($,Z),z=[];for(let{key:J}of X.items)if(n7.isScalar(J))if(z.includes(J.value))Z(`Ordered maps must not include duplicate keys: ${J.value}`);else z.push(J.value);return Object.assign(new Y$,X)},createNode:($,Z,X)=>Y$.from($,Z,X)};P3.YAMLOMap=Y$;P3.omap=A3});var e7=L((S3)=>{var r7=o();function a7({value:$,source:Z},X){if(Z&&($?o7:t7).test.test(Z))return Z;return $?X.options.trueStr:X.options.falseStr}var o7={identify:($)=>$===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new r7.Scalar(!0),stringify:a7},t7={identify:($)=>$===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new r7.Scalar(!1),stringify:a7};S3.falseTag=t7;S3.trueTag=o7});var $X=L((y3)=>{var b3=o(),SZ=_$(),x3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:($)=>$.slice(-3).toLowerCase()==="nan"?NaN:$[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:SZ.stringifyNumber},k3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:($)=>parseFloat($.replace(/_/g,"")),stringify($){let Z=Number($.value);return isFinite(Z)?Z.toExponential():SZ.stringifyNumber($)}},f3={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve($){let Z=new b3.Scalar(parseFloat($.replace(/_/g,""))),X=$.indexOf(".");if(X!==-1){let z=$.substring(X+1).replace(/_/g,"");if(z[z.length-1]==="0")Z.minFractionDigits=z.length}return Z},stringify:SZ.stringifyNumber};y3.float=f3;y3.floatExp=k3;y3.floatNaN=x3});var XX=L((p3)=>{var ZX=_$(),w6=($)=>typeof $==="bigint"||Number.isInteger($);function r8($,Z,X,{intAsBigInt:z}){let J=$[0];if(J==="-"||J==="+")Z+=1;if($=$.substring(Z).replace(/_/g,""),z){switch(X){case 2:$=`0b${$}`;break;case 8:$=`0o${$}`;break;case 16:$=`0x${$}`;break}let Q=BigInt($);return J==="-"?BigInt(-1)*Q:Q}let q=parseInt($,X);return J==="-"?-1*q:q}function EZ($,Z,X){let{value:z}=$;if(w6(z)){let J=z.toString(Z);return z<0?"-"+X+J.substr(1):X+J}return ZX.stringifyNumber($)}var u3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:($,Z,X)=>r8($,2,2,X),stringify:($)=>EZ($,2,"0b")},m3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:($,Z,X)=>r8($,1,8,X),stringify:($)=>EZ($,8,"0")},d3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:($,Z,X)=>r8($,0,10,X),stringify:ZX.stringifyNumber},c3={identify:w6,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:($,Z,X)=>r8($,2,16,X),stringify:($)=>EZ($,16,"0x")};p3.int=d3;p3.intBin=u3;p3.intHex=c3;p3.intOct=m3});var jZ=L((a3)=>{var t8=y(),a8=m0(),o8=c0();class G$ extends o8.YAMLMap{constructor($){super($);this.tag=G$.tag}add($){let Z;if(t8.isPair($))Z=$;else if($&&typeof $==="object"&&"key"in $&&"value"in $&&$.value===null)Z=new a8.Pair($.key,null);else Z=new a8.Pair($,null);if(!o8.findPair(this.items,Z.key))this.items.push(Z)}get($,Z){let X=o8.findPair(this.items,$);return!Z&&t8.isPair(X)?t8.isScalar(X.key)?X.key.value:X.key:X}set($,Z){if(typeof Z!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof Z}`);let X=o8.findPair(this.items,$);if(X&&!Z)this.items.splice(this.items.indexOf(X),1);else if(!X&&Z)this.items.push(new a8.Pair($))}toJSON($,Z){return super.toJSON($,Z,Set)}toString($,Z,X){if(!$)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},$,{allNullValues:!0}),Z,X);else throw Error("Set items must all have null values")}static from($,Z,X){let{replacer:z}=X,J=new this($);if(Z&&Symbol.iterator in Object(Z))for(let q of Z){if(typeof z==="function")q=z.call(Z,q,q);J.items.push(a8.createPair(q,null,X))}return J}}G$.tag="tag:yaml.org,2002:set";var r3={collection:"map",identify:($)=>$ instanceof Set,nodeClass:G$,default:!1,tag:"tag:yaml.org,2002:set",createNode:($,Z,X)=>G$.from($,Z,X),resolve($,Z){if(t8.isMap($))if($.hasAllNullValues(!0))return Object.assign(new G$,$);else Z("Set items must all have null values");else Z("Expected a mapping for this tag");return $}};a3.YAMLSet=G$;a3.set=r3});var xZ=L((XG)=>{var e3=_$();function bZ($,Z){let X=$[0],z=X==="-"||X==="+"?$.substring(1):$,J=(Q)=>Z?BigInt(Q):Number(Q),q=z.replace(/_/g,"").split(":").reduce((Q,Y)=>Q*J(60)+J(Y),J(0));return X==="-"?J(-1)*q:q}function zX($){let{value:Z}=$,X=(Q)=>Q;if(typeof Z==="bigint")X=(Q)=>BigInt(Q);else if(isNaN(Z)||!isFinite(Z))return e3.stringifyNumber($);let z="";if(Z<0)z="-",Z*=X(-1);let J=X(60),q=[Z%J];if(Z<60)q.unshift(0);else if(Z=(Z-q[0])/J,q.unshift(Z%J),Z>=60)Z=(Z-q[0])/J,q.unshift(Z);return z+q.map((Q)=>String(Q).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var $G={identify:($)=>typeof $==="bigint"||Number.isInteger($),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:($,Z,{intAsBigInt:X})=>bZ($,X),stringify:zX},ZG={identify:($)=>typeof $==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:($)=>bZ($,!1),stringify:zX},JX={identify:($)=>$ instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve($){let Z=$.match(JX.test);if(!Z)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,X,z,J,q,Q,Y]=Z.map(Number),G=Z[7]?Number((Z[7]+"00").substr(1,3)):0,U=Date.UTC(X,z-1,J,q||0,Q||0,Y||0,G),W=Z[8];if(W&&W!=="Z"){let V=bZ(W,!1);if(Math.abs(V)<30)V*=60;U-=60000*V}return new Date(U)},stringify:({value:$})=>$?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};XG.floatTime=ZG;XG.intTime=$G;XG.timestamp=JX});var QX=L((NG)=>{var QG=A$(),YG=p8(),GG=P$(),UG=T6(),WG=AZ(),qX=e7(),kZ=$X(),e8=XX(),HG=y8(),VG=CZ(),KG=s8(),DG=jZ(),fZ=xZ(),BG=[QG.map,GG.seq,UG.string,YG.nullTag,qX.trueTag,qX.falseTag,e8.intBin,e8.intOct,e8.int,e8.intHex,kZ.floatNaN,kZ.floatExp,kZ.float,WG.binary,HG.merge,VG.omap,KG.pairs,DG.set,fZ.intTime,fZ.floatTime,fZ.timestamp];NG.schema=BG});var NX=L((AG)=>{var WX=A$(),LG=p8(),HX=P$(),TG=T6(),MG=IZ(),yZ=TZ(),gZ=OZ(),OG=d7(),wG=p7(),VX=AZ(),F6=y8(),KX=CZ(),DX=s8(),YX=QX(),BX=jZ(),$2=xZ(),GX=new Map([["core",OG.schema],["failsafe",[WX.map,HX.seq,TG.string]],["json",wG.schema],["yaml11",YX.schema],["yaml-1.1",YX.schema]]),UX={binary:VX.binary,bool:MG.boolTag,float:yZ.float,floatExp:yZ.floatExp,floatNaN:yZ.floatNaN,floatTime:$2.floatTime,int:gZ.int,intHex:gZ.intHex,intOct:gZ.intOct,intTime:$2.intTime,map:WX.map,merge:F6.merge,null:LG.nullTag,omap:KX.omap,pairs:DX.pairs,seq:HX.seq,set:BX.set,timestamp:$2.timestamp},FG={"tag:yaml.org,2002:binary":VX.binary,"tag:yaml.org,2002:merge":F6.merge,"tag:yaml.org,2002:omap":KX.omap,"tag:yaml.org,2002:pairs":DX.pairs,"tag:yaml.org,2002:set":BX.set,"tag:yaml.org,2002:timestamp":$2.timestamp};function RG($,Z,X){let z=GX.get(Z);if(z&&!$)return X&&!z.includes(F6.merge)?z.concat(F6.merge):z.slice();let J=z;if(!J)if(Array.isArray($))J=[];else{let q=Array.from(GX.keys()).filter((Q)=>Q!=="yaml11").map((Q)=>JSON.stringify(Q)).join(", ");throw Error(`Unknown schema "${Z}"; use one of ${q} or define customTags array`)}if(Array.isArray($))for(let q of $)J=J.concat(q);else if(typeof $==="function")J=$(J.slice());if(X)J=J.concat(F6.merge);return J.reduce((q,Q)=>{let Y=typeof Q==="string"?UX[Q]:Q;if(!Y){let G=JSON.stringify(Q),U=Object.keys(UX).map((W)=>JSON.stringify(W)).join(", ");throw Error(`Unknown custom tag ${G}; use one of ${U}`)}if(!q.includes(Y))q.push(Y);return q},[])}AG.coreKnownTags=FG;AG.getTags=RG});var uZ=L((bG)=>{var hZ=y(),CG=A$(),SG=P$(),EG=T6(),Z2=NX(),jG=($,Z)=>$.key<Z.key?-1:$.key>Z.key?1:0;class vZ{constructor({compat:$,customTags:Z,merge:X,resolveKnownTags:z,schema:J,sortMapEntries:q,toStringDefaults:Q}){this.compat=Array.isArray($)?Z2.getTags($,"compat"):$?Z2.getTags(null,$):null,this.name=typeof J==="string"&&J||"core",this.knownTags=z?Z2.coreKnownTags:{},this.tags=Z2.getTags(Z,this.name,X),this.toStringOptions=Q??null,Object.defineProperty(this,hZ.MAP,{value:CG.map}),Object.defineProperty(this,hZ.SCALAR,{value:EG.string}),Object.defineProperty(this,hZ.SEQ,{value:SG.seq}),this.sortMapEntries=typeof q==="function"?q:q===!0?jG:null}clone(){let $=Object.create(vZ.prototype,Object.getOwnPropertyDescriptors(this));return $.tags=this.tags.slice(),$}}bG.Schema=vZ});var IX=L((yG)=>{var kG=y(),mZ=B6(),R6=V6();function fG($,Z){let X=[],z=Z.directives===!0;if(Z.directives!==!1&&$.directives){let G=$.directives.toString($);if(G)X.push(G),z=!0;else if($.directives.docStart)z=!0}if(z)X.push("---");let J=mZ.createStringifyContext($,Z),{commentString:q}=J.options;if($.commentBefore){if(X.length!==1)X.unshift("");let G=q($.commentBefore);X.unshift(R6.indentComment(G,""))}let Q=!1,Y=null;if($.contents){if(kG.isNode($.contents)){if($.contents.spaceBefore&&z)X.push("");if($.contents.commentBefore){let W=q($.contents.commentBefore);X.push(R6.indentComment(W,""))}J.forceBlockIndent=!!$.comment,Y=$.contents.comment}let G=Y?void 0:()=>Q=!0,U=mZ.stringify($.contents,J,()=>Y=null,G);if(Y)U+=R6.lineComment(U,"",q(Y));if((U[0]==="|"||U[0]===">")&&X[X.length-1]==="---")X[X.length-1]=`--- ${U}`;else X.push(U)}else X.push(mZ.stringify($.contents,J));if($.directives?.docEnd)if($.comment){let G=q($.comment);if(G.includes(`
81
81
  `))X.push("..."),X.push(R6.indentComment(G,""));else X.push(`... ${G}`)}else X.push("...");else{let G=$.comment;if(G&&Q)G=G.replace(/^\n+/,"");if(G){if((!Q||Y)&&X[X.length-1]!=="")X.push("");X.push(R6.indentComment(q(G),""))}}return X.join(`
82
82
  `)+`
83
- `}kG.stringifyDocument=xG});var A6=T((cG)=>{var yG=W6(),_$=E8(),I0=k(),gG=m0(),hG=h0(),vG=uZ(),uG=IX(),dZ=S8(),mG=YZ(),dG=H6(),cZ=QZ();class pZ{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,I0.NODE_TYPE,{value:I0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let J=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=J;let{version:q}=J;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)q=this.directives.yaml.version}else this.directives=new cZ.Directives({version:q});this.setSchema(q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(pZ.prototype,{[I0.NODE_TYPE]:{value:I0.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=I0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(C$(this.contents))this.contents.add($)}addIn($,Z){if(C$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=dZ.anchorNames(this);$.anchor=!Z||X.has(Z)?dZ.findNewAnchor(Z||"a",X):Z}return new yG.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let B=(L)=>typeof L==="number"||L instanceof String||L instanceof Number,N=Z.filter(B).map(String);if(N.length>0)Z=Z.concat(N);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:q,flow:Q,keepUndefined:Y,onTagObj:G,tag:U}=X??{},{onAnchor:W,setAnchors:V,sourceObjects:H}=dZ.createNodeAnchors(this,q||"a"),D={aliasDuplicateObjects:J??!0,keepUndefined:Y??!1,onAnchor:W,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:H},M=dG.createNode($,U,D);if(Q&&I0.isCollection(M))M.flow=!0;return V(),M}createPair($,Z,X={}){let z=this.createNode($,null,X),J=this.createNode(Z,null,X);return new gG.Pair(z,J)}delete($){return C$(this.contents)?this.contents.delete($):!1}deleteIn($){if(_$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return C$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return I0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(_$.isEmptyPath($))return!Z&&I0.isScalar(this.contents)?this.contents.value:this.contents;return I0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return I0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(_$.isEmptyPath($))return this.contents!==void 0;return I0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=_$.collectionFromPath(this.schema,[$],Z);else if(C$(this.contents))this.contents.set($,Z)}setIn($,Z){if(_$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=_$.collectionFromPath(this.schema,Array.from($),Z);else if(C$(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let X;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new cZ.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new cZ.Directives({version:$});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let z=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(X)this.schema=new vG.Schema(Object.assign(X,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:X,maxAliasCount:z,onAnchor:J,reviver:q}={}){let Q={anchors:new Map,doc:this,keep:!$,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},Y=hG.toJS(this.contents,Z??"",Q);if(typeof J==="function")for(let{count:G,res:U}of Q.anchors.values())J(U,G);return typeof q==="function"?mG.applyReviver(q,{"":Y},"",Y):Y}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return uG.stringifyDocument(this,$)}}function C$($){if(I0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}cG.Document=pZ});var P6=T((iG)=>{class X2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class LX extends X2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class TX extends X2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var lG=($,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((Y)=>Z.linePos(Y));let{line:z,col:J}=X.linePos[0];X.message+=` at line ${z}, column ${J}`;let q=J-1,Q=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(q>=60&&Q.length>80){let Y=Math.min(q-39,Q.length-79);Q="…"+Q.substring(Y),q-=Y-1}if(Q.length>80)Q=Q.substring(0,79)+"…";if(z>1&&/^ *$/.test(Q.substring(0,q))){let Y=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(Y.length>80)Y=Y.substring(0,79)+`…
83
+ `}yG.stringifyDocument=fG});var A6=L((lG)=>{var hG=W6(),C$=E8(),I0=y(),vG=m0(),uG=h0(),mG=uZ(),dG=IX(),dZ=_8(),cG=YZ(),pG=H6(),cZ=QZ();class pZ{constructor($,Z,X){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,I0.NODE_TYPE,{value:I0.DOC});let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z,Z=void 0;let J=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},X);this.options=J;let{version:q}=J;if(X?._directives){if(this.directives=X._directives.atDocument(),this.directives.yaml.explicit)q=this.directives.yaml.version}else this.directives=new cZ.Directives({version:q});this.setSchema(q,X),this.contents=$===void 0?null:this.createNode($,z,X)}clone(){let $=Object.create(pZ.prototype,{[I0.NODE_TYPE]:{value:I0.DOC}});if($.commentBefore=this.commentBefore,$.comment=this.comment,$.errors=this.errors.slice(),$.warnings=this.warnings.slice(),$.options=Object.assign({},this.options),this.directives)$.directives=this.directives.clone();if($.schema=this.schema.clone(),$.contents=I0.isNode(this.contents)?this.contents.clone($.schema):this.contents,this.range)$.range=this.range.slice();return $}add($){if(S$(this.contents))this.contents.add($)}addIn($,Z){if(S$(this.contents))this.contents.addIn($,Z)}createAlias($,Z){if(!$.anchor){let X=dZ.anchorNames(this);$.anchor=!Z||X.has(Z)?dZ.findNewAnchor(Z||"a",X):Z}return new hG.Alias($.anchor)}createNode($,Z,X){let z=void 0;if(typeof Z==="function")$=Z.call({"":$},"",$),z=Z;else if(Array.isArray(Z)){let D=(w)=>typeof w==="number"||w instanceof String||w instanceof Number,N=Z.filter(D).map(String);if(N.length>0)Z=Z.concat(N);z=Z}else if(X===void 0&&Z)X=Z,Z=void 0;let{aliasDuplicateObjects:J,anchorPrefix:q,flow:Q,keepUndefined:Y,onTagObj:G,tag:U}=X??{},{onAnchor:W,setAnchors:V,sourceObjects:H}=dZ.createNodeAnchors(this,q||"a"),B={aliasDuplicateObjects:J??!0,keepUndefined:Y??!1,onAnchor:W,onTagObj:G,replacer:z,schema:this.schema,sourceObjects:H},M=pG.createNode($,U,B);if(Q&&I0.isCollection(M))M.flow=!0;return V(),M}createPair($,Z,X={}){let z=this.createNode($,null,X),J=this.createNode(Z,null,X);return new vG.Pair(z,J)}delete($){return S$(this.contents)?this.contents.delete($):!1}deleteIn($){if(C$.isEmptyPath($)){if(this.contents==null)return!1;return this.contents=null,!0}return S$(this.contents)?this.contents.deleteIn($):!1}get($,Z){return I0.isCollection(this.contents)?this.contents.get($,Z):void 0}getIn($,Z){if(C$.isEmptyPath($))return!Z&&I0.isScalar(this.contents)?this.contents.value:this.contents;return I0.isCollection(this.contents)?this.contents.getIn($,Z):void 0}has($){return I0.isCollection(this.contents)?this.contents.has($):!1}hasIn($){if(C$.isEmptyPath($))return this.contents!==void 0;return I0.isCollection(this.contents)?this.contents.hasIn($):!1}set($,Z){if(this.contents==null)this.contents=C$.collectionFromPath(this.schema,[$],Z);else if(S$(this.contents))this.contents.set($,Z)}setIn($,Z){if(C$.isEmptyPath($))this.contents=Z;else if(this.contents==null)this.contents=C$.collectionFromPath(this.schema,Array.from($),Z);else if(S$(this.contents))this.contents.setIn($,Z)}setSchema($,Z={}){if(typeof $==="number")$=String($);let X;switch($){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new cZ.Directives({version:"1.1"});X={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=$;else this.directives=new cZ.Directives({version:$});X={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;X=null;break;default:{let z=JSON.stringify($);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${z}`)}}if(Z.schema instanceof Object)this.schema=Z.schema;else if(X)this.schema=new mG.Schema(Object.assign(X,Z));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:$,jsonArg:Z,mapAsMap:X,maxAliasCount:z,onAnchor:J,reviver:q}={}){let Q={anchors:new Map,doc:this,keep:!$,mapAsMap:X===!0,mapKeyWarned:!1,maxAliasCount:typeof z==="number"?z:100},Y=uG.toJS(this.contents,Z??"",Q);if(typeof J==="function")for(let{count:G,res:U}of Q.anchors.values())J(U,G);return typeof q==="function"?cG.applyReviver(q,{"":Y},"",Y):Y}toJSON($,Z){return this.toJS({json:!0,jsonArg:$,mapAsMap:!1,onAnchor:Z})}toString($={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in $&&(!Number.isInteger($.indent)||Number($.indent)<=0)){let Z=JSON.stringify($.indent);throw Error(`"indent" option must be a positive integer, not ${Z}`)}return dG.stringifyDocument(this,$)}}function S$($){if(I0.isCollection($))return!0;throw Error("Expected a YAML collection as document contents")}lG.Document=pZ});var P6=L((sG)=>{class X2 extends Error{constructor($,Z,X,z){super();this.name=$,this.code=X,this.message=z,this.pos=Z}}class LX extends X2{constructor($,Z,X){super("YAMLParseError",$,Z,X)}}class TX extends X2{constructor($,Z,X){super("YAMLWarning",$,Z,X)}}var nG=($,Z)=>(X)=>{if(X.pos[0]===-1)return;X.linePos=X.pos.map((Y)=>Z.linePos(Y));let{line:z,col:J}=X.linePos[0];X.message+=` at line ${z}, column ${J}`;let q=J-1,Q=$.substring(Z.lineStarts[z-1],Z.lineStarts[z]).replace(/[\n\r]+$/,"");if(q>=60&&Q.length>80){let Y=Math.min(q-39,Q.length-79);Q="…"+Q.substring(Y),q-=Y-1}if(Q.length>80)Q=Q.substring(0,79)+"…";if(z>1&&/^ *$/.test(Q.substring(0,q))){let Y=$.substring(Z.lineStarts[z-2],Z.lineStarts[z-1]);if(Y.length>80)Y=Y.substring(0,79)+`…
84
84
  `;Q=Y+Q}if(/[^ ]/.test(Q)){let Y=1,G=X.linePos[1];if(G?.line===z&&G.col>J)Y=Math.max(1,Math.min(G.col-J,80-q));let U=" ".repeat(q)+"^".repeat(Y);X.message+=`:
85
85
 
86
86
  ${Q}
87
87
  ${U}
88
- `}};iG.YAMLError=X2;iG.YAMLParseError=LX;iG.YAMLWarning=TX;iG.prettifyError=lG});var S6=T((tG)=>{function oG($,{flow:Z,indicator:X,next:z,offset:J,onError:q,parentIndent:Q,startOnNewline:Y}){let G=!1,U=Y,W=Y,V="",H="",D=!1,M=!1,B=null,N=null,L=null,S=null,_=null,C=null,R=null;for(let P of $){if(M){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")q(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");M=!1}if(B){if(U&&P.type!=="comment"&&P.type!=="newline")q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");B=null}switch(P.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&P.source.includes("\t"))B=P;W=!0;break;case"comment":{if(!W)q(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=P.source.substring(1)||" ";if(!V)V=e;else V+=H+e;H="",U=!1;break}case"newline":if(U){if(V)V+=P.source;else if(!C||X!=="seq-item-ind")G=!0}else H+=P.source;if(U=!0,D=!0,N||L)S=P;W=!0;break;case"anchor":if(N)q(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))q(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=P,R??(R=P.offset),U=!1,W=!1,M=!0;break;case"tag":{if(L)q(P,"MULTIPLE_TAGS","A node can have at most one tag");L=P,R??(R=P.offset),U=!1,W=!1,M=!0;break}case X:if(N||L)q(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(C)q(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${Z??"collection"}`);C=P,U=X==="seq-item-ind"||X==="explicit-key-ind",W=!1;break;case"comma":if(Z){if(_)q(P,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);_=P,U=!1,W=!1;break}default:q(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),U=!1,W=!1}}let F=$[$.length-1],c=F?F.offset+F.source.length:J;if(M&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))q(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(B&&(U&&B.indent<=Q||z?.type==="block-map"||z?.type==="block-seq"))q(B,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:_,found:C,spaceBefore:G,comment:V,hasNewline:D,anchor:N,tag:L,newlineAfterProp:S,end:c,start:R??c}}tG.resolveProps=oG});var z2=T(($U)=>{function lZ($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
89
- `))return!0;if($.end){for(let Z of $.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of $.items){for(let X of Z.start)if(X.type==="newline")return!0;if(Z.sep){for(let X of Z.sep)if(X.type==="newline")return!0}if(lZ(Z.key)||lZ(Z.value))return!0}return!1;default:return!0}}$U.containsNewline=lZ});var iZ=T((JU)=>{var XU=z2();function zU($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&XU.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}JU.flowIndentCheck=zU});var nZ=T((YU)=>{var MX=k();function QU($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(q,Q)=>q===Q||MX.isScalar(q)&&MX.isScalar(Q)&&q.value===Q.value;return Z.some((q)=>J(q.key,X))}YU.mapIncludes=QU});var AX=T((KU)=>{var OX=m0(),UU=c0(),wX=S6(),WU=z2(),FX=iZ(),HU=nZ(),RX="All mapping items must start at the same column";function VU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Y=new(q?.nodeClass??UU.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let G=z.offset,U=null;for(let W of z.items){let{start:V,key:H,sep:D,value:M}=W,B=wX.resolveProps(V,{indicator:"explicit-key-ind",next:H??D?.[0],offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0}),N=!B.found;if(N){if(H){if(H.type==="block-seq")J(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in H&&H.indent!==z.indent)J(G,"BAD_INDENT",RX)}if(!B.anchor&&!B.tag&&!D){if(U=B.end,B.comment)if(Y.comment)Y.comment+=`
90
- `+B.comment;else Y.comment=B.comment;continue}if(B.newlineAfterProp||WU.containsNewline(H))J(H??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(B.found?.indent!==z.indent)J(G,"BAD_INDENT",RX);X.atKey=!0;let L=B.end,S=H?$(X,H,B,J):Z(X,L,V,null,B,J);if(X.schema.compat)FX.flowIndentCheck(z.indent,H,J);if(X.atKey=!1,HU.mapIncludes(X,Y.items,S))J(L,"DUPLICATE_KEY","Map keys must be unique");let _=wX.resolveProps(D??[],{indicator:"map-value-ind",next:M,offset:S.range[2],onError:J,parentIndent:z.indent,startOnNewline:!H||H.type==="block-scalar"});if(G=_.end,_.found){if(N){if(M?.type==="block-map"&&!_.hasNewline)J(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&B.start<_.found.offset-1024)J(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let C=M?$(X,M,_,J):Z(X,G,D,null,_,J);if(X.schema.compat)FX.flowIndentCheck(z.indent,M,J);G=C.range[2];let R=new OX.Pair(S,C);if(X.options.keepSourceTokens)R.srcToken=W;Y.items.push(R)}else{if(N)J(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(_.comment)if(S.comment)S.comment+=`
91
- `+_.comment;else S.comment=_.comment;let C=new OX.Pair(S);if(X.options.keepSourceTokens)C.srcToken=W;Y.items.push(C)}}if(U&&U<G)J(U,"IMPOSSIBLE","Map comment with trailing content");return Y.range=[z.offset,G,U??G],Y}KU.resolveBlockMap=VU});var PX=T((TU)=>{var DU=p0(),NU=S6(),IU=iZ();function LU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Y=new(q?.nodeClass??DU.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let G=z.offset,U=null;for(let{start:W,value:V}of z.items){let H=NU.resolveProps(W,{indicator:"seq-item-ind",next:V,offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!H.found)if(H.anchor||H.tag||V)if(V?.type==="block-seq")J(H.end,"BAD_INDENT","All sequence items must start at the same column");else J(G,"MISSING_CHAR","Sequence item without - indicator");else{if(U=H.end,H.comment)Y.comment=H.comment;continue}let D=V?$(X,V,H,J):Z(X,H.end,W,null,H,J);if(X.schema.compat)IU.flowIndentCheck(z.indent,V,J);G=D.range[2],Y.items.push(D)}return Y.range=[z.offset,G,U??G],Y}TU.resolveBlockSeq=LU});var E$=T((wU)=>{function OU($,Z,X,z){let J="";if($){let q=!1,Q="";for(let Y of $){let{source:G,type:U}=Y;switch(U){case"space":q=!0;break;case"comment":{if(X&&!q)z(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let W=G.substring(1)||" ";if(!J)J=W;else J+=Q+W;Q="";break}case"newline":if(J)Q+=G;q=!0;break;default:z(Y,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}Z+=G.length}}return{comment:J,offset:Z}}wU.resolveEnd=OU});var CX=T((jU)=>{var RU=k(),AU=m0(),SX=c0(),PU=p0(),SU=E$(),_X=S6(),_U=z2(),CU=nZ(),sZ="Block collections are not allowed within flow collections",rZ=($)=>$&&($.type==="block-map"||$.type==="block-seq");function EU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Q=z.start.source==="{",Y=Q?"flow map":"flow sequence",U=new(q?.nodeClass??(Q?SX.YAMLMap:PU.YAMLSeq))(X.schema);U.flow=!0;let W=X.atRoot;if(W)X.atRoot=!1;if(X.atKey)X.atKey=!1;let V=z.offset+z.start.source.length;for(let N=0;N<z.items.length;++N){let L=z.items[N],{start:S,key:_,sep:C,value:R}=L,F=_X.resolveProps(S,{flow:Y,indicator:"explicit-key-ind",next:_??C?.[0],offset:V,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!F.found){if(!F.anchor&&!F.tag&&!C&&!R){if(N===0&&F.comma)J(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`);else if(N<z.items.length-1)J(F.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Y}`);if(F.comment)if(U.comment)U.comment+=`
92
- `+F.comment;else U.comment=F.comment;V=F.end;continue}if(!Q&&X.options.strict&&_U.containsNewline(_))J(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0){if(F.comma)J(F.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`)}else{if(!F.comma)J(F.start,"MISSING_CHAR",`Missing , between ${Y} items`);if(F.comment){let c="";$:for(let P of S)switch(P.type){case"comma":case"space":break;case"comment":c=P.source.substring(1);break $;default:break $}if(c){let P=U.items[U.items.length-1];if(RU.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
93
- `+c;else P.comment=c;F.comment=F.comment.substring(c.length+1)}}}if(!Q&&!C&&!F.found){let c=R?$(X,R,F,J):Z(X,F.end,C,null,F,J);if(U.items.push(c),V=c.range[2],rZ(R))J(c.range,"BLOCK_IN_FLOW",sZ)}else{X.atKey=!0;let c=F.end,P=_?$(X,_,F,J):Z(X,c,S,null,F,J);if(rZ(_))J(P.range,"BLOCK_IN_FLOW",sZ);X.atKey=!1;let e=_X.resolveProps(C??[],{flow:Y,indicator:"map-value-ind",next:R,offset:P.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(e.found){if(!Q&&!F.found&&X.options.strict){if(C)for(let $0 of C){if($0===e.found)break;if($0.type==="newline"){J($0,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(F.start<e.found.offset-1024)J(e.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(R)if("source"in R&&R.source?.[0]===":")J(R,"MISSING_CHAR",`Missing space after : in ${Y}`);else J(e.start,"MISSING_CHAR",`Missing , or : between ${Y} items`);let g0=R?$(X,R,e,J):e.found?Z(X,e.end,C,null,e,J):null;if(g0){if(rZ(R))J(g0.range,"BLOCK_IN_FLOW",sZ)}else if(e.comment)if(P.comment)P.comment+=`
94
- `+e.comment;else P.comment=e.comment;let M$=new AU.Pair(P,g0);if(X.options.keepSourceTokens)M$.srcToken=L;if(Q){let $0=U;if(CU.mapIncludes(X,$0.items,P))J(c,"DUPLICATE_KEY","Map keys must be unique");$0.items.push(M$)}else{let $0=new SX.YAMLMap(X.schema);$0.flow=!0,$0.items.push(M$);let y4=(g0??P).range;$0.range=[P.range[0],y4[1],y4[2]],U.items.push($0)}V=g0?g0.range[2]:e.end}}let H=Q?"}":"]",[D,...M]=z.end,B=V;if(D?.source===H)B=D.offset+D.source.length;else{let N=Y[0].toUpperCase()+Y.substring(1),L=W?`${N} must end with a ${H}`:`${N} in block collection must be sufficiently indented and end with a ${H}`;if(J(V,W?"MISSING_CHAR":"BAD_INDENT",L),D&&D.source.length!==1)M.unshift(D)}if(M.length>0){let N=SU.resolveEnd(M,B,X.options.strict,J);if(N.comment)if(U.comment)U.comment+=`
95
- `+N.comment;else U.comment=N.comment;U.range=[z.offset,B,N.offset]}else U.range=[z.offset,B,B];return U}jU.resolveFlowCollection=EU});var EX=T((mU)=>{var xU=k(),kU=a(),fU=c0(),yU=p0(),gU=AX(),hU=PX(),vU=CX();function aZ($,Z,X,z,J,q){let Q=X.type==="block-map"?gU.resolveBlockMap($,Z,X,z,q):X.type==="block-seq"?hU.resolveBlockSeq($,Z,X,z,q):vU.resolveFlowCollection($,Z,X,z,q),Y=Q.constructor;if(J==="!"||J===Y.tagName)return Q.tag=Y.tagName,Q;if(J)Q.tag=J;return Q}function uU($,Z,X,z,J){let q=z.tag,Q=!q?null:Z.directives.tagName(q.source,(H)=>J(q,"TAG_RESOLVE_FAILED",H));if(X.type==="block-seq"){let{anchor:H,newlineAfterProp:D}=z,M=H&&q?H.offset>q.offset?H:q:H??q;if(M&&(!D||D.offset<M.offset))J(M,"MISSING_CHAR","Missing newline after block sequence props")}let Y=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!q||!Q||Q==="!"||Q===fU.YAMLMap.tagName&&Y==="map"||Q===yU.YAMLSeq.tagName&&Y==="seq")return aZ($,Z,X,J,Q);let G=Z.schema.tags.find((H)=>H.tag===Q&&H.collection===Y);if(!G){let H=Z.schema.knownTags[Q];if(H?.collection===Y)Z.schema.tags.push(Object.assign({},H,{default:!1})),G=H;else{if(H)J(q,"BAD_COLLECTION_TYPE",`${H.tag} used for ${Y} collection, but expects ${H.collection??"scalar"}`,!0);else J(q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,!0);return aZ($,Z,X,J,Q)}}let U=aZ($,Z,X,J,Q,G),W=G.resolve?.(U,(H)=>J(q,"TAG_RESOLVE_FAILED",H),Z.options)??U,V=xU.isNode(W)?W:new kU.Scalar(W);if(V.range=U.range,V.tag=Q,G?.format)V.format=G.format;return V}mU.composeCollection=uU});var tZ=T((iU)=>{var oZ=a();function cU($,Z,X){let z=Z.offset,J=pU(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let q=J.mode===">"?oZ.Scalar.BLOCK_FOLDED:oZ.Scalar.BLOCK_LITERAL,Q=Z.source?lU(Z.source):[],Y=Q.length;for(let B=Q.length-1;B>=0;--B){let N=Q[B][1];if(N===""||N==="\r")Y=B;else break}if(Y===0){let B=J.chomp==="+"&&Q.length>0?`
96
- `.repeat(Math.max(1,Q.length-1)):"",N=z+J.length;if(Z.source)N+=Z.source.length;return{value:B,type:q,comment:J.comment,range:[z,N,N]}}let G=Z.indent+J.indent,U=Z.offset+J.length,W=0;for(let B=0;B<Y;++B){let[N,L]=Q[B];if(L===""||L==="\r"){if(J.indent===0&&N.length>G)G=N.length}else{if(N.length<G)X(U+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)G=N.length;if(W=B,G===0&&!$.atRoot)X(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=N.length+L.length+1}for(let B=Q.length-1;B>=Y;--B)if(Q[B][0].length>G)Y=B+1;let V="",H="",D=!1;for(let B=0;B<W;++B)V+=Q[B][0].slice(G)+`
97
- `;for(let B=W;B<Y;++B){let[N,L]=Q[B];U+=N.length+L.length+1;let S=L[L.length-1]==="\r";if(S)L=L.slice(0,-1);if(L&&N.length<G){let C=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(U-L.length-(S?2:1),"BAD_INDENT",C),N=""}if(q===oZ.Scalar.BLOCK_LITERAL)V+=H+N.slice(G)+L,H=`
98
- `;else if(N.length>G||L[0]==="\t"){if(H===" ")H=`
99
- `;else if(!D&&H===`
88
+ `}};sG.YAMLError=X2;sG.YAMLParseError=LX;sG.YAMLWarning=TX;sG.prettifyError=nG});var _6=L(($U)=>{function eG($,{flow:Z,indicator:X,next:z,offset:J,onError:q,parentIndent:Q,startOnNewline:Y}){let G=!1,U=Y,W=Y,V="",H="",B=!1,M=!1,D=null,N=null,w=null,P=null,_=null,R=null,E=null;for(let T of $){if(M){if(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma")q(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");M=!1}if(D){if(U&&T.type!=="comment"&&T.type!=="newline")q(D,"TAB_AS_INDENT","Tabs are not allowed as indentation");D=null}switch(T.type){case"space":if(!Z&&(X!=="doc-start"||z?.type!=="flow-collection")&&T.source.includes("\t"))D=T;W=!0;break;case"comment":{if(!W)q(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let x=T.source.substring(1)||" ";if(!V)V=x;else V+=H+x;H="",U=!1;break}case"newline":if(U){if(V)V+=T.source;else if(!R||X!=="seq-item-ind")G=!0}else H+=T.source;if(U=!0,B=!0,N||w)P=T;W=!0;break;case"anchor":if(N)q(T,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(T.source.endsWith(":"))q(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);N=T,E??(E=T.offset),U=!1,W=!1,M=!0;break;case"tag":{if(w)q(T,"MULTIPLE_TAGS","A node can have at most one tag");w=T,E??(E=T.offset),U=!1,W=!1,M=!0;break}case X:if(N||w)q(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`);if(R)q(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${Z??"collection"}`);R=T,U=X==="seq-item-ind"||X==="explicit-key-ind",W=!1;break;case"comma":if(Z){if(_)q(T,"UNEXPECTED_TOKEN",`Unexpected , in ${Z}`);_=T,U=!1,W=!1;break}default:q(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),U=!1,W=!1}}let C=$[$.length-1],p=C?C.offset+C.source.length:J;if(M&&z&&z.type!=="space"&&z.type!=="newline"&&z.type!=="comma"&&(z.type!=="scalar"||z.source!==""))q(z.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(D&&(U&&D.indent<=Q||z?.type==="block-map"||z?.type==="block-seq"))q(D,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:_,found:R,spaceBefore:G,comment:V,hasNewline:B,anchor:N,tag:w,newlineAfterProp:P,end:p,start:E??p}}$U.resolveProps=eG});var z2=L((XU)=>{function lZ($){if(!$)return null;switch($.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if($.source.includes(`
89
+ `))return!0;if($.end){for(let Z of $.end)if(Z.type==="newline")return!0}return!1;case"flow-collection":for(let Z of $.items){for(let X of Z.start)if(X.type==="newline")return!0;if(Z.sep){for(let X of Z.sep)if(X.type==="newline")return!0}if(lZ(Z.key)||lZ(Z.value))return!0}return!1;default:return!0}}XU.containsNewline=lZ});var iZ=L((QU)=>{var JU=z2();function qU($,Z,X){if(Z?.type==="flow-collection"){let z=Z.end[0];if(z.indent===$&&(z.source==="]"||z.source==="}")&&JU.containsNewline(Z))X(z,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}QU.flowIndentCheck=qU});var nZ=L((UU)=>{var MX=y();function GU($,Z,X){let{uniqueKeys:z}=$.options;if(z===!1)return!1;let J=typeof z==="function"?z:(q,Q)=>q===Q||MX.isScalar(q)&&MX.isScalar(Q)&&q.value===Q.value;return Z.some((q)=>J(q.key,X))}UU.mapIncludes=GU});var AX=L((BU)=>{var OX=m0(),HU=c0(),wX=_6(),VU=z2(),FX=iZ(),KU=nZ(),RX="All mapping items must start at the same column";function DU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Y=new(q?.nodeClass??HU.YAMLMap)(X.schema);if(X.atRoot)X.atRoot=!1;let G=z.offset,U=null;for(let W of z.items){let{start:V,key:H,sep:B,value:M}=W,D=wX.resolveProps(V,{indicator:"explicit-key-ind",next:H??B?.[0],offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0}),N=!D.found;if(N){if(H){if(H.type==="block-seq")J(G,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in H&&H.indent!==z.indent)J(G,"BAD_INDENT",RX)}if(!D.anchor&&!D.tag&&!B){if(U=D.end,D.comment)if(Y.comment)Y.comment+=`
90
+ `+D.comment;else Y.comment=D.comment;continue}if(D.newlineAfterProp||VU.containsNewline(H))J(H??V[V.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(D.found?.indent!==z.indent)J(G,"BAD_INDENT",RX);X.atKey=!0;let w=D.end,P=H?$(X,H,D,J):Z(X,w,V,null,D,J);if(X.schema.compat)FX.flowIndentCheck(z.indent,H,J);if(X.atKey=!1,KU.mapIncludes(X,Y.items,P))J(w,"DUPLICATE_KEY","Map keys must be unique");let _=wX.resolveProps(B??[],{indicator:"map-value-ind",next:M,offset:P.range[2],onError:J,parentIndent:z.indent,startOnNewline:!H||H.type==="block-scalar"});if(G=_.end,_.found){if(N){if(M?.type==="block-map"&&!_.hasNewline)J(G,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(X.options.strict&&D.start<_.found.offset-1024)J(P.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let R=M?$(X,M,_,J):Z(X,G,B,null,_,J);if(X.schema.compat)FX.flowIndentCheck(z.indent,M,J);G=R.range[2];let E=new OX.Pair(P,R);if(X.options.keepSourceTokens)E.srcToken=W;Y.items.push(E)}else{if(N)J(P.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(_.comment)if(P.comment)P.comment+=`
91
+ `+_.comment;else P.comment=_.comment;let R=new OX.Pair(P);if(X.options.keepSourceTokens)R.srcToken=W;Y.items.push(R)}}if(U&&U<G)J(U,"IMPOSSIBLE","Map comment with trailing content");return Y.range=[z.offset,G,U??G],Y}BU.resolveBlockMap=DU});var PX=L((OU)=>{var IU=p0(),LU=_6(),TU=iZ();function MU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Y=new(q?.nodeClass??IU.YAMLSeq)(X.schema);if(X.atRoot)X.atRoot=!1;if(X.atKey)X.atKey=!1;let G=z.offset,U=null;for(let{start:W,value:V}of z.items){let H=LU.resolveProps(W,{indicator:"seq-item-ind",next:V,offset:G,onError:J,parentIndent:z.indent,startOnNewline:!0});if(!H.found)if(H.anchor||H.tag||V)if(V?.type==="block-seq")J(H.end,"BAD_INDENT","All sequence items must start at the same column");else J(G,"MISSING_CHAR","Sequence item without - indicator");else{if(U=H.end,H.comment)Y.comment=H.comment;continue}let B=V?$(X,V,H,J):Z(X,H.end,W,null,H,J);if(X.schema.compat)TU.flowIndentCheck(z.indent,V,J);G=B.range[2],Y.items.push(B)}return Y.range=[z.offset,G,U??G],Y}OU.resolveBlockSeq=MU});var E$=L((RU)=>{function FU($,Z,X,z){let J="";if($){let q=!1,Q="";for(let Y of $){let{source:G,type:U}=Y;switch(U){case"space":q=!0;break;case"comment":{if(X&&!q)z(Y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let W=G.substring(1)||" ";if(!J)J=W;else J+=Q+W;Q="";break}case"newline":if(J)Q+=G;q=!0;break;default:z(Y,"UNEXPECTED_TOKEN",`Unexpected ${U} at node end`)}Z+=G.length}}return{comment:J,offset:Z}}RU.resolveEnd=FU});var SX=L((xU)=>{var PU=y(),_U=m0(),_X=c0(),CU=p0(),SU=E$(),CX=_6(),EU=z2(),jU=nZ(),sZ="Block collections are not allowed within flow collections",rZ=($)=>$&&($.type==="block-map"||$.type==="block-seq");function bU({composeNode:$,composeEmptyNode:Z},X,z,J,q){let Q=z.start.source==="{",Y=Q?"flow map":"flow sequence",U=new(q?.nodeClass??(Q?_X.YAMLMap:CU.YAMLSeq))(X.schema);U.flow=!0;let W=X.atRoot;if(W)X.atRoot=!1;if(X.atKey)X.atKey=!1;let V=z.offset+z.start.source.length;for(let N=0;N<z.items.length;++N){let w=z.items[N],{start:P,key:_,sep:R,value:E}=w,C=CX.resolveProps(P,{flow:Y,indicator:"explicit-key-ind",next:_??R?.[0],offset:V,onError:J,parentIndent:z.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!R&&!E){if(N===0&&C.comma)J(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`);else if(N<z.items.length-1)J(C.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${Y}`);if(C.comment)if(U.comment)U.comment+=`
92
+ `+C.comment;else U.comment=C.comment;V=C.end;continue}if(!Q&&X.options.strict&&EU.containsNewline(_))J(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0){if(C.comma)J(C.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${Y}`)}else{if(!C.comma)J(C.start,"MISSING_CHAR",`Missing , between ${Y} items`);if(C.comment){let p="";$:for(let T of P)switch(T.type){case"comma":case"space":break;case"comment":p=T.source.substring(1);break $;default:break $}if(p){let T=U.items[U.items.length-1];if(PU.isPair(T))T=T.value??T.key;if(T.comment)T.comment+=`
93
+ `+p;else T.comment=p;C.comment=C.comment.substring(p.length+1)}}}if(!Q&&!R&&!C.found){let p=E?$(X,E,C,J):Z(X,C.end,R,null,C,J);if(U.items.push(p),V=p.range[2],rZ(E))J(p.range,"BLOCK_IN_FLOW",sZ)}else{X.atKey=!0;let p=C.end,T=_?$(X,_,C,J):Z(X,p,P,null,C,J);if(rZ(_))J(T.range,"BLOCK_IN_FLOW",sZ);X.atKey=!1;let x=CX.resolveProps(R??[],{flow:Y,indicator:"map-value-ind",next:E,offset:T.range[2],onError:J,parentIndent:z.indent,startOnNewline:!1});if(x.found){if(!Q&&!C.found&&X.options.strict){if(R)for(let $0 of R){if($0===x.found)break;if($0.type==="newline"){J($0,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(C.start<x.found.offset-1024)J(x.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(E)if("source"in E&&E.source?.[0]===":")J(E,"MISSING_CHAR",`Missing space after : in ${Y}`);else J(x.start,"MISSING_CHAR",`Missing , or : between ${Y} items`);let g0=E?$(X,E,x,J):x.found?Z(X,x.end,R,null,x,J):null;if(g0){if(rZ(E))J(g0.range,"BLOCK_IN_FLOW",sZ)}else if(x.comment)if(T.comment)T.comment+=`
94
+ `+x.comment;else T.comment=x.comment;let M$=new _U.Pair(T,g0);if(X.options.keepSourceTokens)M$.srcToken=w;if(Q){let $0=U;if(jU.mapIncludes(X,$0.items,T))J(p,"DUPLICATE_KEY","Map keys must be unique");$0.items.push(M$)}else{let $0=new _X.YAMLMap(X.schema);$0.flow=!0,$0.items.push(M$);let y4=(g0??T).range;$0.range=[T.range[0],y4[1],y4[2]],U.items.push($0)}V=g0?g0.range[2]:x.end}}let H=Q?"}":"]",[B,...M]=z.end,D=V;if(B?.source===H)D=B.offset+B.source.length;else{let N=Y[0].toUpperCase()+Y.substring(1),w=W?`${N} must end with a ${H}`:`${N} in block collection must be sufficiently indented and end with a ${H}`;if(J(V,W?"MISSING_CHAR":"BAD_INDENT",w),B&&B.source.length!==1)M.unshift(B)}if(M.length>0){let N=SU.resolveEnd(M,D,X.options.strict,J);if(N.comment)if(U.comment)U.comment+=`
95
+ `+N.comment;else U.comment=N.comment;U.range=[z.offset,D,N.offset]}else U.range=[z.offset,D,D];return U}xU.resolveFlowCollection=bU});var EX=L((cU)=>{var fU=y(),yU=o(),gU=c0(),hU=p0(),vU=AX(),uU=PX(),mU=SX();function aZ($,Z,X,z,J,q){let Q=X.type==="block-map"?vU.resolveBlockMap($,Z,X,z,q):X.type==="block-seq"?uU.resolveBlockSeq($,Z,X,z,q):mU.resolveFlowCollection($,Z,X,z,q),Y=Q.constructor;if(J==="!"||J===Y.tagName)return Q.tag=Y.tagName,Q;if(J)Q.tag=J;return Q}function dU($,Z,X,z,J){let q=z.tag,Q=!q?null:Z.directives.tagName(q.source,(H)=>J(q,"TAG_RESOLVE_FAILED",H));if(X.type==="block-seq"){let{anchor:H,newlineAfterProp:B}=z,M=H&&q?H.offset>q.offset?H:q:H??q;if(M&&(!B||B.offset<M.offset))J(M,"MISSING_CHAR","Missing newline after block sequence props")}let Y=X.type==="block-map"?"map":X.type==="block-seq"?"seq":X.start.source==="{"?"map":"seq";if(!q||!Q||Q==="!"||Q===gU.YAMLMap.tagName&&Y==="map"||Q===hU.YAMLSeq.tagName&&Y==="seq")return aZ($,Z,X,J,Q);let G=Z.schema.tags.find((H)=>H.tag===Q&&H.collection===Y);if(!G){let H=Z.schema.knownTags[Q];if(H?.collection===Y)Z.schema.tags.push(Object.assign({},H,{default:!1})),G=H;else{if(H)J(q,"BAD_COLLECTION_TYPE",`${H.tag} used for ${Y} collection, but expects ${H.collection??"scalar"}`,!0);else J(q,"TAG_RESOLVE_FAILED",`Unresolved tag: ${Q}`,!0);return aZ($,Z,X,J,Q)}}let U=aZ($,Z,X,J,Q,G),W=G.resolve?.(U,(H)=>J(q,"TAG_RESOLVE_FAILED",H),Z.options)??U,V=fU.isNode(W)?W:new yU.Scalar(W);if(V.range=U.range,V.tag=Q,G?.format)V.format=G.format;return V}cU.composeCollection=dU});var tZ=L((sU)=>{var oZ=o();function lU($,Z,X){let z=Z.offset,J=iU(Z,$.options.strict,X);if(!J)return{value:"",type:null,comment:"",range:[z,z,z]};let q=J.mode===">"?oZ.Scalar.BLOCK_FOLDED:oZ.Scalar.BLOCK_LITERAL,Q=Z.source?nU(Z.source):[],Y=Q.length;for(let D=Q.length-1;D>=0;--D){let N=Q[D][1];if(N===""||N==="\r")Y=D;else break}if(Y===0){let D=J.chomp==="+"&&Q.length>0?`
96
+ `.repeat(Math.max(1,Q.length-1)):"",N=z+J.length;if(Z.source)N+=Z.source.length;return{value:D,type:q,comment:J.comment,range:[z,N,N]}}let G=Z.indent+J.indent,U=Z.offset+J.length,W=0;for(let D=0;D<Y;++D){let[N,w]=Q[D];if(w===""||w==="\r"){if(J.indent===0&&N.length>G)G=N.length}else{if(N.length<G)X(U+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(J.indent===0)G=N.length;if(W=D,G===0&&!$.atRoot)X(U,"BAD_INDENT","Block scalar values in collections must be indented");break}U+=N.length+w.length+1}for(let D=Q.length-1;D>=Y;--D)if(Q[D][0].length>G)Y=D+1;let V="",H="",B=!1;for(let D=0;D<W;++D)V+=Q[D][0].slice(G)+`
97
+ `;for(let D=W;D<Y;++D){let[N,w]=Q[D];U+=N.length+w.length+1;let P=w[w.length-1]==="\r";if(P)w=w.slice(0,-1);if(w&&N.length<G){let R=`Block scalar lines must not be less indented than their ${J.indent?"explicit indentation indicator":"first line"}`;X(U-w.length-(P?2:1),"BAD_INDENT",R),N=""}if(q===oZ.Scalar.BLOCK_LITERAL)V+=H+N.slice(G)+w,H=`
98
+ `;else if(N.length>G||w[0]==="\t"){if(H===" ")H=`
99
+ `;else if(!B&&H===`
100
100
  `)H=`
101
101
 
102
- `;V+=H+N.slice(G)+L,H=`
103
- `,D=!0}else if(L==="")if(H===`
102
+ `;V+=H+N.slice(G)+w,H=`
103
+ `,B=!0}else if(w==="")if(H===`
104
104
  `)V+=`
105
105
  `;else H=`
106
- `;else V+=H+L,H=" ",D=!1}switch(J.chomp){case"-":break;case"+":for(let B=Y;B<Q.length;++B)V+=`
107
- `+Q[B][0].slice(G);if(V[V.length-1]!==`
106
+ `;else V+=H+w,H=" ",B=!1}switch(J.chomp){case"-":break;case"+":for(let D=Y;D<Q.length;++D)V+=`
107
+ `+Q[D][0].slice(G);if(V[V.length-1]!==`
108
108
  `)V+=`
109
109
  `;break;default:V+=`
110
- `}let M=z+J.length+Z.source.length;return{value:V,type:q,comment:J.comment,range:[z,M,M]}}function pU({offset:$,props:Z},X,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:J}=Z[0],q=J[0],Q=0,Y="",G=-1;for(let H=1;H<J.length;++H){let D=J[H];if(!Y&&(D==="-"||D==="+"))Y=D;else{let M=Number(D);if(!Q&&M)Q=M;else if(G===-1)G=$+H}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let U=!1,W="",V=J.length;for(let H=1;H<Z.length;++H){let D=Z[H];switch(D.type){case"space":U=!0;case"newline":V+=D.source.length;break;case"comment":if(X&&!U)z(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=D.source.length,W=D.source.substring(1);break;case"error":z(D,"UNEXPECTED_TOKEN",D.message),V+=D.source.length;break;default:{let M=`Unexpected token in block scalar header: ${D.type}`;z(D,"UNEXPECTED_TOKEN",M);let B=D.source;if(B&&typeof B==="string")V+=B.length}}}return{mode:q,indent:Q,chomp:Y,comment:W,length:V}}function lU($){let Z=$.split(/\n( *)/),X=Z[0],z=X.match(/^( *)/),q=[z?.[1]?[z[1],X.slice(z[1].length)]:["",X]];for(let Q=1;Q<Z.length;Q+=2)q.push([Z[Q],Z[Q+1]]);return q}iU.resolveBlockScalar=cU});var $5=T((XW)=>{var eZ=a(),sU=E$();function rU($,Z,X){let{offset:z,type:J,source:q,end:Q}=$,Y,G,U=(H,D,M)=>X(z+H,D,M);switch(J){case"scalar":Y=eZ.Scalar.PLAIN,G=aU(q,U);break;case"single-quoted-scalar":Y=eZ.Scalar.QUOTE_SINGLE,G=oU(q,U);break;case"double-quoted-scalar":Y=eZ.Scalar.QUOTE_DOUBLE,G=tU(q,U);break;default:return X($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[z,z+q.length,z+q.length]}}let W=z+q.length,V=sU.resolveEnd(Q,W,Z,X);return{value:G,type:Y,comment:V.comment,range:[z,W,V.offset]}}function aU($,Z){let X="";switch($[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${$[0]}`;break}case"@":case"`":{X=`reserved character ${$[0]}`;break}}if(X)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return jX($)}function oU($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return jX($.slice(1,-1)).replace(/''/g,"'")}function jX($){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
110
+ `}let M=z+J.length+Z.source.length;return{value:V,type:q,comment:J.comment,range:[z,M,M]}}function iU({offset:$,props:Z},X,z){if(Z[0].type!=="block-scalar-header")return z(Z[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:J}=Z[0],q=J[0],Q=0,Y="",G=-1;for(let H=1;H<J.length;++H){let B=J[H];if(!Y&&(B==="-"||B==="+"))Y=B;else{let M=Number(B);if(!Q&&M)Q=M;else if(G===-1)G=$+H}}if(G!==-1)z(G,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${J}`);let U=!1,W="",V=J.length;for(let H=1;H<Z.length;++H){let B=Z[H];switch(B.type){case"space":U=!0;case"newline":V+=B.source.length;break;case"comment":if(X&&!U)z(B,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");V+=B.source.length,W=B.source.substring(1);break;case"error":z(B,"UNEXPECTED_TOKEN",B.message),V+=B.source.length;break;default:{let M=`Unexpected token in block scalar header: ${B.type}`;z(B,"UNEXPECTED_TOKEN",M);let D=B.source;if(D&&typeof D==="string")V+=D.length}}}return{mode:q,indent:Q,chomp:Y,comment:W,length:V}}function nU($){let Z=$.split(/\n( *)/),X=Z[0],z=X.match(/^( *)/),q=[z?.[1]?[z[1],X.slice(z[1].length)]:["",X]];for(let Q=1;Q<Z.length;Q+=2)q.push([Z[Q],Z[Q+1]]);return q}sU.resolveBlockScalar=lU});var $5=L((JW)=>{var eZ=o(),aU=E$();function oU($,Z,X){let{offset:z,type:J,source:q,end:Q}=$,Y,G,U=(H,B,M)=>X(z+H,B,M);switch(J){case"scalar":Y=eZ.Scalar.PLAIN,G=tU(q,U);break;case"single-quoted-scalar":Y=eZ.Scalar.QUOTE_SINGLE,G=eU(q,U);break;case"double-quoted-scalar":Y=eZ.Scalar.QUOTE_DOUBLE,G=$W(q,U);break;default:return X($,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${J}`),{value:"",type:null,comment:"",range:[z,z+q.length,z+q.length]}}let W=z+q.length,V=aU.resolveEnd(Q,W,Z,X);return{value:G,type:Y,comment:V.comment,range:[z,W,V.offset]}}function tU($,Z){let X="";switch($[0]){case"\t":X="a tab character";break;case",":X="flow indicator character ,";break;case"%":X="directive indicator character %";break;case"|":case">":{X=`block scalar indicator ${$[0]}`;break}case"@":case"`":{X=`reserved character ${$[0]}`;break}}if(X)Z(0,"BAD_SCALAR_START",`Plain value cannot start with ${X}`);return jX($)}function eU($,Z){if($[$.length-1]!=="'"||$.length===1)Z($.length,"MISSING_CHAR","Missing closing 'quote");return jX($.slice(1,-1)).replace(/''/g,"'")}function jX($){let Z,X;try{Z=new RegExp(`(.*?)(?<![ ])[ ]*\r?
111
111
  `,"sy"),X=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
112
112
  `,"sy")}catch{Z=/(.*?)[ \t]*\r?\n/sy,X=/[ \t]*(.*?)[ \t]*\r?\n/sy}let z=Z.exec($);if(!z)return $;let J=z[1],q=" ",Q=Z.lastIndex;X.lastIndex=Q;while(z=X.exec($)){if(z[1]==="")if(q===`
113
113
  `)J+=q;else q=`
114
- `;else J+=q+z[1],q=" ";Q=X.lastIndex}let Y=/[ \t]*(.*)/sy;return Y.lastIndex=Q,z=Y.exec($),J+q+(z?.[1]??"")}function tU($,Z){let X="";for(let z=1;z<$.length-1;++z){let J=$[z];if(J==="\r"&&$[z+1]===`
114
+ `;else J+=q+z[1],q=" ";Q=X.lastIndex}let Y=/[ \t]*(.*)/sy;return Y.lastIndex=Q,z=Y.exec($),J+q+(z?.[1]??"")}function $W($,Z){let X="";for(let z=1;z<$.length-1;++z){let J=$[z];if(J==="\r"&&$[z+1]===`
115
115
  `)continue;if(J===`
116
- `){let{fold:q,offset:Q}=eU($,z);X+=q,z=Q}else if(J==="\\"){let q=$[++z],Q=$W[q];if(Q)X+=Q;else if(q===`
116
+ `){let{fold:q,offset:Q}=ZW($,z);X+=q,z=Q}else if(J==="\\"){let q=$[++z],Q=XW[q];if(Q)X+=Q;else if(q===`
117
117
  `){q=$[z+1];while(q===" "||q==="\t")q=$[++z+1]}else if(q==="\r"&&$[z+1]===`
118
- `){q=$[++z+1];while(q===" "||q==="\t")q=$[++z+1]}else if(q==="x"||q==="u"||q==="U"){let Y={x:2,u:4,U:8}[q];X+=ZW($,z+1,Y,Z),z+=Y}else{let Y=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),X+=Y}}else if(J===" "||J==="\t"){let q=z,Q=$[z+1];while(Q===" "||Q==="\t")Q=$[++z+1];if(Q!==`
118
+ `){q=$[++z+1];while(q===" "||q==="\t")q=$[++z+1]}else if(q==="x"||q==="u"||q==="U"){let Y={x:2,u:4,U:8}[q];X+=zW($,z+1,Y,Z),z+=Y}else{let Y=$.substr(z-1,2);Z(z-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),X+=Y}}else if(J===" "||J==="\t"){let q=z,Q=$[z+1];while(Q===" "||Q==="\t")Q=$[++z+1];if(Q!==`
119
119
  `&&!(Q==="\r"&&$[z+2]===`
120
- `))X+=z>q?$.slice(q,z+1):J}else X+=J}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return X}function eU($,Z){let X="",z=$[Z+1];while(z===" "||z==="\t"||z===`
120
+ `))X+=z>q?$.slice(q,z+1):J}else X+=J}if($[$.length-1]!=='"'||$.length===1)Z($.length,"MISSING_CHAR",'Missing closing "quote');return X}function ZW($,Z){let X="",z=$[Z+1];while(z===" "||z==="\t"||z===`
121
121
  `||z==="\r"){if(z==="\r"&&$[Z+2]!==`
122
122
  `)break;if(z===`
123
123
  `)X+=`
124
- `;Z+=1,z=$[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var $W={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
- `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function ZW($,Z,X,z){let J=$.substr(Z,X),Q=J.length===X&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;if(isNaN(Q)){let Y=$.substr(Z-2,X+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),Y}return String.fromCodePoint(Q)}XW.resolveFlowScalar=rU});var xX=T((UW)=>{var U$=k(),bX=a(),JW=tZ(),qW=$5();function QW($,Z,X,z){let{value:J,type:q,comment:Q,range:Y}=Z.type==="block-scalar"?JW.resolveBlockScalar($,Z,z):qW.resolveFlowScalar(Z,$.options.strict,z),G=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[U$.SCALAR];else if(G)U=YW($.schema,J,G,X,z);else if(Z.type==="scalar")U=GW($,J,Z,z);else U=$.schema[U$.SCALAR];let W;try{let V=U.resolve(J,(H)=>z(X??Z,"TAG_RESOLVE_FAILED",H),$.options);W=U$.isScalar(V)?V:new bX.Scalar(V)}catch(V){let H=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",H),W=new bX.Scalar(J)}if(W.range=Y,W.source=J,q)W.type=q;if(G)W.tag=G;if(U.format)W.format=U.format;if(Q)W.comment=Q;return W}function YW($,Z,X,z,J){if(X==="!")return $[U$.SCALAR];let q=[];for(let Y of $.tags)if(!Y.collection&&Y.tag===X)if(Y.default&&Y.test)q.push(Y);else return Y;for(let Y of q)if(Y.test?.test(Z))return Y;let Q=$.knownTags[X];if(Q&&!Q.collection)return $.tags.push(Object.assign({},Q,{default:!1,test:void 0})),Q;return J(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),$[U$.SCALAR]}function GW({atKey:$,directives:Z,schema:X},z,J,q){let Q=X.tags.find((Y)=>(Y.default===!0||$&&Y.default==="key")&&Y.test?.test(z))||X[U$.SCALAR];if(X.compat){let Y=X.compat.find((G)=>G.default&&G.test?.test(z))??X[U$.SCALAR];if(Q.tag!==Y.tag){let G=Z.tagString(Q.tag),U=Z.tagString(Y.tag),W=`Value may be parsed as either ${G} or ${U}`;q(J,"TAG_RESOLVE_FAILED",W,!0)}}return Q}UW.composeScalar=QW});var kX=T((VW)=>{function HW($,Z,X){if(Z){X??(X=Z.length);for(let z=X-1;z>=0;--z){let J=Z[z];switch(J.type){case"space":case"comment":case"newline":$-=J.source.length;continue}J=Z[++z];while(J?.type==="space")$+=J.source.length,J=Z[++z];break}}return $}VW.emptyScalarPosition=HW});var gX=T((OW)=>{var BW=W6(),DW=k(),NW=EX(),fX=xX(),IW=E$(),LW=kX(),TW={composeNode:yX,composeEmptyNode:Z5};function yX($,Z,X,z){let J=$.atKey,{spaceBefore:q,comment:Q,anchor:Y,tag:G}=X,U,W=!0;switch(Z.type){case"alias":if(U=MW($,Z,z),Y||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(U=fX.composeScalar($,Z,G,z),Y)U.anchor=Y.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=NW.composeCollection(TW,$,Z,X,z),Y)U.anchor=Y.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),U=Z5($,Z.offset,void 0,null,X,z),W=!1}}if(Y&&U.anchor==="")z(Y,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!DW.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(q)U.spaceBefore=!0;if(Q)if(Z.type==="scalar"&&Z.source==="")U.comment=Q;else U.commentBefore=Q;if($.options.keepSourceTokens&&W)U.srcToken=Z;return U}function Z5($,Z,X,z,{spaceBefore:J,comment:q,anchor:Q,tag:Y,end:G},U){let W={type:"scalar",offset:LW.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=fX.composeScalar($,W,Y,U);if(Q){if(V.anchor=Q.source.substring(1),V.anchor==="")U(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)V.spaceBefore=!0;if(q)V.comment=q,V.range[2]=G;return V}function MW({options:$},{offset:Z,source:X,end:z},J){let q=new BW.Alias(X.substring(1));if(q.source==="")J(Z,"BAD_ALIAS","Alias cannot be an empty string");if(q.source.endsWith(":"))J(Z+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Q=Z+X.length,Y=IW.resolveEnd(z,Q,$.strict,J);if(q.range=[Z,Q,Y.offset],Y.comment)q.comment=Y.comment;return q}OW.composeEmptyNode=Z5;OW.composeNode=yX});var vX=T((_W)=>{var RW=A6(),hX=gX(),AW=E$(),PW=S6();function SW($,Z,{offset:X,start:z,value:J,end:q},Q){let Y=Object.assign({_directives:Z},$),G=new RW.Document(void 0,Y),U={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},W=PW.resolveProps(z,{indicator:"doc-start",next:J??q?.[0],offset:X,onError:Q,parentIndent:0,startOnNewline:!0});if(W.found){if(G.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!W.hasNewline)Q(W.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=J?hX.composeNode(U,J,W,Q):hX.composeEmptyNode(U,W.end,z,null,W,Q);let V=G.contents.range[2],H=AW.resolveEnd(q,V,!1,Q);if(H.comment)G.comment=H.comment;return G.range=[X,V,H.offset],G}_W.composeDoc=SW});var X5=T((fW)=>{var EW=J0("process"),jW=QZ(),bW=A6(),_6=P6(),uX=k(),xW=vX(),kW=E$();function C6($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Z,source:X}=$;return[Z,Z+(typeof X==="string"?X.length:1)]}function mX($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let q=$[J];switch(q[0]){case"#":Z+=(Z===""?"":z?`
124
+ `;Z+=1,z=$[Z+1]}if(!X)X=" ";return{fold:X,offset:Z}}var XW={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
125
+ `,r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function zW($,Z,X,z){let J=$.substr(Z,X),Q=J.length===X&&/^[0-9a-fA-F]+$/.test(J)?parseInt(J,16):NaN;if(isNaN(Q)){let Y=$.substr(Z-2,X+2);return z(Z-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${Y}`),Y}return String.fromCodePoint(Q)}JW.resolveFlowScalar=oU});var xX=L((HW)=>{var U$=y(),bX=o(),QW=tZ(),YW=$5();function GW($,Z,X,z){let{value:J,type:q,comment:Q,range:Y}=Z.type==="block-scalar"?QW.resolveBlockScalar($,Z,z):YW.resolveFlowScalar(Z,$.options.strict,z),G=X?$.directives.tagName(X.source,(V)=>z(X,"TAG_RESOLVE_FAILED",V)):null,U;if($.options.stringKeys&&$.atKey)U=$.schema[U$.SCALAR];else if(G)U=UW($.schema,J,G,X,z);else if(Z.type==="scalar")U=WW($,J,Z,z);else U=$.schema[U$.SCALAR];let W;try{let V=U.resolve(J,(H)=>z(X??Z,"TAG_RESOLVE_FAILED",H),$.options);W=U$.isScalar(V)?V:new bX.Scalar(V)}catch(V){let H=V instanceof Error?V.message:String(V);z(X??Z,"TAG_RESOLVE_FAILED",H),W=new bX.Scalar(J)}if(W.range=Y,W.source=J,q)W.type=q;if(G)W.tag=G;if(U.format)W.format=U.format;if(Q)W.comment=Q;return W}function UW($,Z,X,z,J){if(X==="!")return $[U$.SCALAR];let q=[];for(let Y of $.tags)if(!Y.collection&&Y.tag===X)if(Y.default&&Y.test)q.push(Y);else return Y;for(let Y of q)if(Y.test?.test(Z))return Y;let Q=$.knownTags[X];if(Q&&!Q.collection)return $.tags.push(Object.assign({},Q,{default:!1,test:void 0})),Q;return J(z,"TAG_RESOLVE_FAILED",`Unresolved tag: ${X}`,X!=="tag:yaml.org,2002:str"),$[U$.SCALAR]}function WW({atKey:$,directives:Z,schema:X},z,J,q){let Q=X.tags.find((Y)=>(Y.default===!0||$&&Y.default==="key")&&Y.test?.test(z))||X[U$.SCALAR];if(X.compat){let Y=X.compat.find((G)=>G.default&&G.test?.test(z))??X[U$.SCALAR];if(Q.tag!==Y.tag){let G=Z.tagString(Q.tag),U=Z.tagString(Y.tag),W=`Value may be parsed as either ${G} or ${U}`;q(J,"TAG_RESOLVE_FAILED",W,!0)}}return Q}HW.composeScalar=GW});var kX=L((DW)=>{function KW($,Z,X){if(Z){X??(X=Z.length);for(let z=X-1;z>=0;--z){let J=Z[z];switch(J.type){case"space":case"comment":case"newline":$-=J.source.length;continue}J=Z[++z];while(J?.type==="space")$+=J.source.length,J=Z[++z];break}}return $}DW.emptyScalarPosition=KW});var gX=L((FW)=>{var NW=W6(),IW=y(),LW=EX(),fX=xX(),TW=E$(),MW=kX(),OW={composeNode:yX,composeEmptyNode:Z5};function yX($,Z,X,z){let J=$.atKey,{spaceBefore:q,comment:Q,anchor:Y,tag:G}=X,U,W=!0;switch(Z.type){case"alias":if(U=wW($,Z,z),Y||G)z(Z,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(U=fX.composeScalar($,Z,G,z),Y)U.anchor=Y.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":if(U=LW.composeCollection(OW,$,Z,X,z),Y)U.anchor=Y.source.substring(1);break;default:{let V=Z.type==="error"?Z.message:`Unsupported token (type: ${Z.type})`;z(Z,"UNEXPECTED_TOKEN",V),U=Z5($,Z.offset,void 0,null,X,z),W=!1}}if(Y&&U.anchor==="")z(Y,"BAD_ALIAS","Anchor cannot be an empty string");if(J&&$.options.stringKeys&&(!IW.isScalar(U)||typeof U.value!=="string"||U.tag&&U.tag!=="tag:yaml.org,2002:str"))z(G??Z,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(q)U.spaceBefore=!0;if(Q)if(Z.type==="scalar"&&Z.source==="")U.comment=Q;else U.commentBefore=Q;if($.options.keepSourceTokens&&W)U.srcToken=Z;return U}function Z5($,Z,X,z,{spaceBefore:J,comment:q,anchor:Q,tag:Y,end:G},U){let W={type:"scalar",offset:MW.emptyScalarPosition(Z,X,z),indent:-1,source:""},V=fX.composeScalar($,W,Y,U);if(Q){if(V.anchor=Q.source.substring(1),V.anchor==="")U(Q,"BAD_ALIAS","Anchor cannot be an empty string")}if(J)V.spaceBefore=!0;if(q)V.comment=q,V.range[2]=G;return V}function wW({options:$},{offset:Z,source:X,end:z},J){let q=new NW.Alias(X.substring(1));if(q.source==="")J(Z,"BAD_ALIAS","Alias cannot be an empty string");if(q.source.endsWith(":"))J(Z+X.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let Q=Z+X.length,Y=TW.resolveEnd(z,Q,$.strict,J);if(q.range=[Z,Q,Y.offset],Y.comment)q.comment=Y.comment;return q}FW.composeEmptyNode=Z5;FW.composeNode=yX});var vX=L((EW)=>{var PW=A6(),hX=gX(),_W=E$(),CW=_6();function SW($,Z,{offset:X,start:z,value:J,end:q},Q){let Y=Object.assign({_directives:Z},$),G=new PW.Document(void 0,Y),U={atKey:!1,atRoot:!0,directives:G.directives,options:G.options,schema:G.schema},W=CW.resolveProps(z,{indicator:"doc-start",next:J??q?.[0],offset:X,onError:Q,parentIndent:0,startOnNewline:!0});if(W.found){if(G.directives.docStart=!0,J&&(J.type==="block-map"||J.type==="block-seq")&&!W.hasNewline)Q(W.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}G.contents=J?hX.composeNode(U,J,W,Q):hX.composeEmptyNode(U,W.end,z,null,W,Q);let V=G.contents.range[2],H=_W.resolveEnd(q,V,!1,Q);if(H.comment)G.comment=H.comment;return G.range=[X,V,H.offset],G}EW.composeDoc=SW});var X5=L((gW)=>{var bW=J0("process"),xW=QZ(),kW=A6(),C6=P6(),uX=y(),fW=vX(),yW=E$();function S6($){if(typeof $==="number")return[$,$+1];if(Array.isArray($))return $.length===2?$:[$[0],$[1]];let{offset:Z,source:X}=$;return[Z,Z+(typeof X==="string"?X.length:1)]}function mX($){let Z="",X=!1,z=!1;for(let J=0;J<$.length;++J){let q=$[J];switch(q[0]){case"#":Z+=(Z===""?"":z?`
126
126
 
127
127
  `:`
128
- `)+(q.substring(1)||" "),X=!0,z=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;X=!1;break;default:if(!X)z=!0;X=!1}}return{comment:Z,afterEmptyLine:z}}class dX{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let q=C6(Z);if(J)this.warnings.push(new _6.YAMLWarning(q,X,z));else this.errors.push(new _6.YAMLParseError(q,X,z))},this.directives=new jW.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=mX(this.prelude);if(X){let J=$.contents;if(Z)$.comment=$.comment?`${$.comment}
128
+ `)+(q.substring(1)||" "),X=!0,z=!1;break;case"%":if($[J+1]?.[0]!=="#")J+=1;X=!1;break;default:if(!X)z=!0;X=!1}}return{comment:Z,afterEmptyLine:z}}class dX{constructor($={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(Z,X,z,J)=>{let q=S6(Z);if(J)this.warnings.push(new C6.YAMLWarning(q,X,z));else this.errors.push(new C6.YAMLParseError(q,X,z))},this.directives=new xW.Directives({version:$.version||"1.2"}),this.options=$}decorate($,Z){let{comment:X,afterEmptyLine:z}=mX(this.prelude);if(X){let J=$.contents;if(Z)$.comment=$.comment?`${$.comment}
129
129
  ${X}`:X;else if(z||$.directives.docStart||!J)$.commentBefore=X;else if(uX.isCollection(J)&&!J.flow&&J.items.length>0){let q=J.items[0];if(uX.isPair(q))q=q.key;let Q=q.commentBefore;q.commentBefore=Q?`${X}
130
130
  ${Q}`:X}else{let q=J.commentBefore;J.commentBefore=q?`${X}
131
- ${q}`:X}}if(Z)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:mX(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,X=-1){for(let z of $)yield*this.next(z);yield*this.end(Z,X)}*next($){if(EW.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=C6($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=xW.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let Z=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,X=new _6.YAMLParseError(C6($),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new _6.YAMLParseError(C6($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=kW.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
132
- ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new _6.YAMLParseError(C6($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let X=Object.assign({_directives:this.directives},this.options),z=new bW.Document(void 0,X);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,Z,Z],this.decorate(z,!1),yield z}}}fW.Composer=dX});var lX=T((pW)=>{var gW=tZ(),hW=$5(),vW=P6(),cX=B6();function uW($,Z=!0,X){if($){let z=(J,q,Q)=>{let Y=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(X)X(Y,q,Q);else throw new vW.YAMLParseError([Y,Y+1],q,Q)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return hW.resolveFlowScalar($,Z,z);case"block-scalar":return gW.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function mW($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:q=-1,type:Q="PLAIN"}=Z,Y=cX.stringifyString({type:Q,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
131
+ ${q}`:X}}if(Z)Array.prototype.push.apply($.errors,this.errors),Array.prototype.push.apply($.warnings,this.warnings);else $.errors=this.errors,$.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:mX(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose($,Z=!1,X=-1){for(let z of $)yield*this.next(z);yield*this.end(Z,X)}*next($){if(bW.env.LOG_STREAM)console.dir($,{depth:null});switch($.type){case"directive":this.directives.add($.source,(Z,X,z)=>{let J=S6($);J[0]+=Z,this.onError(J,"BAD_DIRECTIVE",X,z)}),this.prelude.push($.source),this.atDirectives=!0;break;case"document":{let Z=fW.composeDoc(this.options,this.directives,$,this.onError);if(this.atDirectives&&!Z.directives.docStart)this.onError($,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(Z,!1),this.doc)yield this.doc;this.doc=Z,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push($.source);break;case"error":{let Z=$.source?`${$.message}: ${JSON.stringify($.source)}`:$.message,X=new C6.YAMLParseError(S6($),"UNEXPECTED_TOKEN",Z);if(this.atDirectives||!this.doc)this.errors.push(X);else this.doc.errors.push(X);break}case"doc-end":{if(!this.doc){this.errors.push(new C6.YAMLParseError(S6($),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let Z=yW.resolveEnd($.end,$.offset+$.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),Z.comment){let X=this.doc.comment;this.doc.comment=X?`${X}
132
+ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.push(new C6.YAMLParseError(S6($),"UNEXPECTED_TOKEN",`Unsupported token ${$.type}`))}}*end($=!1,Z=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if($){let X=Object.assign({_directives:this.directives},this.options),z=new kW.Document(void 0,X);if(this.atDirectives)this.onError(Z,"MISSING_CHAR","Missing directives-end indicator line");z.range=[0,Z,Z],this.decorate(z,!1),yield z}}}gW.Composer=dX});var lX=L((iW)=>{var vW=tZ(),uW=$5(),mW=P6(),cX=D6();function dW($,Z=!0,X){if($){let z=(J,q,Q)=>{let Y=typeof J==="number"?J:Array.isArray(J)?J[0]:J.offset;if(X)X(Y,q,Q);else throw new mW.YAMLParseError([Y,Y+1],q,Q)};switch($.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return uW.resolveFlowScalar($,Z,z);case"block-scalar":return vW.resolveBlockScalar({options:{strict:Z}},$,z)}}return null}function cW($,Z){let{implicitKey:X=!1,indent:z,inFlow:J=!1,offset:q=-1,type:Q="PLAIN"}=Z,Y=cX.stringifyString({type:Q,value:$},{implicitKey:X,indent:z>0?" ".repeat(z):"",inFlow:J,options:{blockQuote:!0,lineWidth:-1}}),G=Z.end??[{type:"newline",offset:-1,indent:z,source:`
133
133
  `}];switch(Y[0]){case"|":case">":{let U=Y.indexOf(`
134
134
  `),W=Y.substring(0,U),V=Y.substring(U+1)+`
135
135
  `,H=[{type:"block-scalar-header",offset:q,indent:z,source:W}];if(!pX(H,G))H.push({type:"newline",offset:-1,indent:z,source:`
136
- `});return{type:"block-scalar",offset:q,indent:z,props:H,source:V}}case'"':return{type:"double-quoted-scalar",offset:q,indent:z,source:Y,end:G};case"'":return{type:"single-quoted-scalar",offset:q,indent:z,source:Y,end:G};default:return{type:"scalar",offset:q,indent:z,source:Y,end:G}}}function dW($,Z,X={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:q=!1,type:Q}=X,Y="indent"in $?$.indent:null;if(z&&typeof Y==="number")Y+=2;if(!Q)switch($.type){case"single-quoted-scalar":Q="QUOTE_SINGLE";break;case"double-quoted-scalar":Q="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Q="PLAIN"}let G=cX.stringifyString({type:Q,value:Z},{implicitKey:J||Y===null,indent:Y!==null&&Y>0?" ".repeat(Y):"",inFlow:q,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":cW($,G);break;case'"':z5($,G,"double-quoted-scalar");break;case"'":z5($,G,"single-quoted-scalar");break;default:z5($,G,"scalar")}}function cW($,Z){let X=Z.indexOf(`
136
+ `});return{type:"block-scalar",offset:q,indent:z,props:H,source:V}}case'"':return{type:"double-quoted-scalar",offset:q,indent:z,source:Y,end:G};case"'":return{type:"single-quoted-scalar",offset:q,indent:z,source:Y,end:G};default:return{type:"scalar",offset:q,indent:z,source:Y,end:G}}}function pW($,Z,X={}){let{afterKey:z=!1,implicitKey:J=!1,inFlow:q=!1,type:Q}=X,Y="indent"in $?$.indent:null;if(z&&typeof Y==="number")Y+=2;if(!Q)switch($.type){case"single-quoted-scalar":Q="QUOTE_SINGLE";break;case"double-quoted-scalar":Q="QUOTE_DOUBLE";break;case"block-scalar":{let U=$.props[0];if(U.type!=="block-scalar-header")throw Error("Invalid block scalar header");Q=U.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:Q="PLAIN"}let G=cX.stringifyString({type:Q,value:Z},{implicitKey:J||Y===null,indent:Y!==null&&Y>0?" ".repeat(Y):"",inFlow:q,options:{blockQuote:!0,lineWidth:-1}});switch(G[0]){case"|":case">":lW($,G);break;case'"':z5($,G,"double-quoted-scalar");break;case"'":z5($,G,"single-quoted-scalar");break;default:z5($,G,"scalar")}}function lW($,Z){let X=Z.indexOf(`
137
137
  `),z=Z.substring(0,X),J=Z.substring(X+1)+`
138
138
  `;if($.type==="block-scalar"){let q=$.props[0];if(q.type!=="block-scalar-header")throw Error("Invalid block scalar header");q.source=z,$.source=J}else{let{offset:q}=$,Q="indent"in $?$.indent:-1,Y=[{type:"block-scalar-header",offset:q,indent:Q,source:z}];if(!pX(Y,"end"in $?$.end:void 0))Y.push({type:"newline",offset:-1,indent:Q,source:`
139
139
  `});for(let G of Object.keys($))if(G!=="type"&&G!=="offset")delete $[G];Object.assign($,{type:"block-scalar",indent:Q,props:Y,source:J})}}function pX($,Z){if(Z)for(let X of Z)switch(X.type){case"space":case"comment":$.push(X);break;case"newline":return $.push(X),!0}return!1}function z5($,Z,X){switch($.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":$.type=X,$.source=Z;break;case"block-scalar":{let z=$.props.slice(1),J=Z.length;if($.props[0].type==="block-scalar-header")J-=$.props[0].source.length;for(let q of z)q.offset+=J;delete $.props,Object.assign($,{type:X,source:Z,end:z});break}case"block-map":case"block-seq":{let J={type:"newline",offset:$.offset+Z.length,indent:$.indent,source:`
140
- `};delete $.items,Object.assign($,{type:X,source:Z,end:[J]});break}default:{let z="indent"in $?$.indent:-1,J="end"in $&&Array.isArray($.end)?$.end.filter((q)=>q.type==="space"||q.type==="comment"||q.type==="newline"):[];for(let q of Object.keys($))if(q!=="type"&&q!=="offset")delete $[q];Object.assign($,{type:X,indent:z,source:Z,end:J})}}}pW.createScalarToken=mW;pW.resolveAsScalar=uW;pW.setScalarValue=dW});var iX=T((rW)=>{var sW=($)=>("type"in $)?q2($):J2($);function q2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=q2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=J2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=J2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=J2($);if($.end)for(let X of $.end)Z+=X.source;return Z}default:{let Z=$.source;if("end"in $&&$.end)for(let X of $.end)Z+=X.source;return Z}}}function J2({start:$,key:Z,sep:X,value:z}){let J="";for(let q of $)J+=q.source;if(Z)J+=q2(Z);if(X)for(let q of X)J+=q.source;if(z)J+=q2(z);return J}rW.stringify=sW});var rX=T((tW)=>{var J5=Symbol("break visit"),oW=Symbol("skip children"),nX=Symbol("remove item");function W$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};sX(Object.freeze([]),$,Z)}W$.BREAK=J5;W$.SKIP=oW;W$.REMOVE=nX;W$.itemAtPath=($,Z)=>{let X=$;for(let[z,J]of Z){let q=X?.[z];if(q&&"items"in q)X=q.items[J];else return}return X};W$.parentCollection=($,Z)=>{let X=W$.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],J=X?.[z];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function sX($,Z,X){let z=X(Z,$);if(typeof z==="symbol")return z;for(let J of["key","value"]){let q=Z[J];if(q&&"items"in q){for(let Q=0;Q<q.items.length;++Q){let Y=sX(Object.freeze($.concat([[J,Q]])),q.items[Q],X);if(typeof Y==="number")Q=Y-1;else if(Y===J5)return J5;else if(Y===nX)q.items.splice(Q,1),Q-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}tW.visit=W$});var Q2=T((QH)=>{var q5=lX(),$H=iX(),ZH=rX(),Q5="\uFEFF",Y5="\x02",G5="\x18",U5="\x1F",XH=($)=>!!$&&("items"in $),zH=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function JH($){switch($){case Q5:return"<BOM>";case Y5:return"<DOC>";case G5:return"<FLOW_END>";case U5:return"<SCALAR>";default:return JSON.stringify($)}}function qH($){switch($){case Q5:return"byte-order-mark";case Y5:return"doc-mode";case G5:return"flow-error-end";case U5:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
140
+ `};delete $.items,Object.assign($,{type:X,source:Z,end:[J]});break}default:{let z="indent"in $?$.indent:-1,J="end"in $&&Array.isArray($.end)?$.end.filter((q)=>q.type==="space"||q.type==="comment"||q.type==="newline"):[];for(let q of Object.keys($))if(q!=="type"&&q!=="offset")delete $[q];Object.assign($,{type:X,indent:z,source:Z,end:J})}}}iW.createScalarToken=cW;iW.resolveAsScalar=dW;iW.setScalarValue=pW});var iX=L((oW)=>{var aW=($)=>("type"in $)?q2($):J2($);function q2($){switch($.type){case"block-scalar":{let Z="";for(let X of $.props)Z+=q2(X);return Z+$.source}case"block-map":case"block-seq":{let Z="";for(let X of $.items)Z+=J2(X);return Z}case"flow-collection":{let Z=$.start.source;for(let X of $.items)Z+=J2(X);for(let X of $.end)Z+=X.source;return Z}case"document":{let Z=J2($);if($.end)for(let X of $.end)Z+=X.source;return Z}default:{let Z=$.source;if("end"in $&&$.end)for(let X of $.end)Z+=X.source;return Z}}}function J2({start:$,key:Z,sep:X,value:z}){let J="";for(let q of $)J+=q.source;if(Z)J+=q2(Z);if(X)for(let q of X)J+=q.source;if(z)J+=q2(z);return J}oW.stringify=aW});var rX=L(($H)=>{var J5=Symbol("break visit"),eW=Symbol("skip children"),nX=Symbol("remove item");function W$($,Z){if("type"in $&&$.type==="document")$={start:$.start,value:$.value};sX(Object.freeze([]),$,Z)}W$.BREAK=J5;W$.SKIP=eW;W$.REMOVE=nX;W$.itemAtPath=($,Z)=>{let X=$;for(let[z,J]of Z){let q=X?.[z];if(q&&"items"in q)X=q.items[J];else return}return X};W$.parentCollection=($,Z)=>{let X=W$.itemAtPath($,Z.slice(0,-1)),z=Z[Z.length-1][0],J=X?.[z];if(J&&"items"in J)return J;throw Error("Parent collection not found")};function sX($,Z,X){let z=X(Z,$);if(typeof z==="symbol")return z;for(let J of["key","value"]){let q=Z[J];if(q&&"items"in q){for(let Q=0;Q<q.items.length;++Q){let Y=sX(Object.freeze($.concat([[J,Q]])),q.items[Q],X);if(typeof Y==="number")Q=Y-1;else if(Y===J5)return J5;else if(Y===nX)q.items.splice(Q,1),Q-=1}if(typeof z==="function"&&J==="key")z=z(Z,$)}}return typeof z==="function"?z(Z,$):z}$H.visit=W$});var Q2=L((GH)=>{var q5=lX(),XH=iX(),zH=rX(),Q5="\uFEFF",Y5="\x02",G5="\x18",U5="\x1F",JH=($)=>!!$&&("items"in $),qH=($)=>!!$&&($.type==="scalar"||$.type==="single-quoted-scalar"||$.type==="double-quoted-scalar"||$.type==="block-scalar");function QH($){switch($){case Q5:return"<BOM>";case Y5:return"<DOC>";case G5:return"<FLOW_END>";case U5:return"<SCALAR>";default:return JSON.stringify($)}}function YH($){switch($){case Q5:return"byte-order-mark";case Y5:return"doc-mode";case G5:return"flow-error-end";case U5:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
141
141
  `:case`\r
142
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}QH.createScalarToken=q5.createScalarToken;QH.resolveAsScalar=q5.resolveAsScalar;QH.setScalarValue=q5.setScalarValue;QH.stringify=$H.stringify;QH.visit=ZH.visit;QH.BOM=Q5;QH.DOCUMENT=Y5;QH.FLOW_END=G5;QH.SCALAR=U5;QH.isCollection=XH;QH.isScalar=zH;QH.prettyToken=JH;QH.tokenType=qH});var H5=T((wH)=>{var E6=Q2();function O0($){switch($){case void 0:case" ":case`
143
- `:case"\r":case"\t":return!0;default:return!1}}var aX=new Set("0123456789ABCDEFabcdef"),MH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Y2=new Set(",[]{}"),OH=new Set(` ,[]{}
144
- \r `),W5=($)=>!$||OH.has($);class oX{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
142
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch($[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}GH.createScalarToken=q5.createScalarToken;GH.resolveAsScalar=q5.resolveAsScalar;GH.setScalarValue=q5.setScalarValue;GH.stringify=XH.stringify;GH.visit=zH.visit;GH.BOM=Q5;GH.DOCUMENT=Y5;GH.FLOW_END=G5;GH.SCALAR=U5;GH.isCollection=JH;GH.isScalar=qH;GH.prettyToken=QH;GH.tokenType=YH});var H5=L((RH)=>{var E6=Q2();function O0($){switch($){case void 0:case" ":case`
143
+ `:case"\r":case"\t":return!0;default:return!1}}var aX=new Set("0123456789ABCDEFabcdef"),wH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Y2=new Set(",[]{}"),FH=new Set(` ,[]{}
144
+ \r `),W5=($)=>!$||FH.has($);class oX{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex($,Z=!1){if($){if(typeof $!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+$:$,this.lineEndPos=null}this.atEnd=!Z;let X=this.next??"stream";while(X&&(Z||this.hasChars(1)))X=yield*this.parseNext(X)}atLineEnd(){let $=this.pos,Z=this.buffer[$];while(Z===" "||Z==="\t")Z=this.buffer[++$];if(!Z||Z==="#"||Z===`
145
145
  `)return!0;if(Z==="\r")return this.buffer[$+1]===`
146
146
  `;return!1}charAt($){return this.buffer[this.pos+$]}continueScalar($){let Z=this.buffer[$];if(this.indentNext>0){let X=0;while(Z===" ")Z=this.buffer[++X+$];if(Z==="\r"){let z=this.buffer[X+$+1];if(z===`
147
147
  `||!z&&!this.atEnd)return $+X+1}return Z===`
@@ -156,21 +156,21 @@ ${Z.comment}`:Z.comment}this.doc.range[2]=Z.offset;break}default:this.errors.pus
156
156
  `&&J>=this.pos&&J+1+Z>Q)$=J;else break}while(!0);return yield E6.SCALAR,yield*this.pushToIndex($+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let $=this.flowLevel>0,Z=this.pos-1,X=this.pos-1,z;while(z=this.buffer[++X])if(z===":"){let J=this.buffer[X+1];if(O0(J)||$&&Y2.has(J))break;Z=X}else if(O0(z)){let J=this.buffer[X+1];if(z==="\r")if(J===`
157
157
  `)X+=1,z=`
158
158
  `,J=this.buffer[X+1];else Z=X;if(J==="#"||$&&Y2.has(J))break;if(z===`
159
- `){let q=this.continueScalar(X+1);if(q===-1)break;X=Math.max(X,q-2)}}else{if($&&Y2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield E6.SCALAR,yield*this.pushToIndex(Z+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,Z){let X=this.buffer.slice(this.pos,$);if(X)return yield X,this.pos+=X.length,X.length;else if(Z)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(W5))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(O0(Z)||$&&Y2.has(Z)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!O0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(MH.has(Z))Z=this.buffer[++$];else if(Z==="%"&&aX.has(this.buffer[$+1])&&aX.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
159
+ `){let q=this.continueScalar(X+1);if(q===-1)break;X=Math.max(X,q-2)}}else{if($&&Y2.has(z))break;Z=X}if(!z&&!this.atEnd)return this.setNext("plain-scalar");return yield E6.SCALAR,yield*this.pushToIndex(Z+1,!0),$?"flow":"doc"}*pushCount($){if($>0)return yield this.buffer.substr(this.pos,$),this.pos+=$,$;return 0}*pushToIndex($,Z){let X=this.buffer.slice(this.pos,$);if(X)return yield X,this.pos+=X.length,X.length;else if(Z)yield"";return 0}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(W5))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let $=this.flowLevel>0,Z=this.charAt(1);if(O0(Z)||$&&Y2.has(Z)){if(!$)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;return(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}}return 0}*pushTag(){if(this.charAt(1)==="<"){let $=this.pos+2,Z=this.buffer[$];while(!O0(Z)&&Z!==">")Z=this.buffer[++$];return yield*this.pushToIndex(Z===">"?$+1:$,!1)}else{let $=this.pos+1,Z=this.buffer[$];while(Z)if(wH.has(Z))Z=this.buffer[++$];else if(Z==="%"&&aX.has(this.buffer[$+1])&&aX.has(this.buffer[$+2]))Z=this.buffer[$+=3];else break;return yield*this.pushToIndex($,!1)}}*pushNewline(){let $=this.buffer[this.pos];if($===`
160
160
  `)return yield*this.pushCount(1);else if($==="\r"&&this.charAt(1)===`
161
- `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||$&&X==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,X=this.buffer[Z];while(!$(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}wH.Lexer=oX});var V5=T((RH)=>{class tX{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let Z=0,X=this.lineStarts.length;while(Z<X){let J=Z+X>>1;if(this.lineStarts[J]<$)Z=J+1;else X=J}if(this.lineStarts[Z]===$)return{line:Z+1,col:1};if(Z===0)return{line:0,col:$};let z=this.lineStarts[Z-1];return{line:Z,col:$-z+1}}}}RH.LineCounter=tX});var K5=T((_H)=>{var PH=J0("process"),eX=Q2(),SH=H5();function l0($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function $z($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function Xz($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function G2($){switch($.type){case"document":return $.start;case"block-map":{let Z=$.items[$.items.length-1];return Z.sep??Z.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function j$($){if($.length===0)return[];let Z=$.length;$:while(--Z>=0)switch($[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++Z]?.type==="space");return $.splice(Z,$.length)}function Zz($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!l0(Z.start,"explicit-key-ind")&&!l0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,Xz(Z.value))if(Z.value.end)Array.prototype.push.apply(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Array.prototype.push.apply(Z.start,Z.sep);delete Z.sep}}}class zz{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new SH.Lexer,this.onNewLine=$}*parse($,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex($,Z))yield*this.next(X);if(!Z)yield*this.end()}*next($){if(this.source=$,PH.env.LOG_TOKENS)console.log("|",eX.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=eX.tokenType($);if(!Z){let X=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:$}),this.offset+=$.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Z=$??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")Zz(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let z=X.items[X.items.length-1];if(z.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=Z;else{Object.assign(z,{key:Z,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=X.items[X.items.length-1];if(z.value)X.items.push({start:[],value:Z});else z.value=Z;break}case"flow-collection":{let z=X.items[X.items.length-1];if(!z||z.value)X.items.push({start:[],key:Z,sep:[]});else if(z.sep)z.value=Z;else Object.assign(z,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let z=Z.items[Z.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&$z(z.start)===-1&&(Z.indent===0||z.start.every((J)=>J.type!=="comment"||J.indent<Z.indent))){if(X.type==="document")X.end=z.start;else X.items.push({start:z.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if($z($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Z=G2(this.peek(2)),X=j$(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
161
+ `)return yield*this.pushCount(2);else return 0}*pushSpaces($){let Z=this.pos-1,X;do X=this.buffer[++Z];while(X===" "||$&&X==="\t");let z=Z-this.pos;if(z>0)yield this.buffer.substr(this.pos,z),this.pos=Z;return z}*pushUntil($){let Z=this.pos,X=this.buffer[Z];while(!$(X))X=this.buffer[++Z];return yield*this.pushToIndex(Z,!1)}}RH.Lexer=oX});var V5=L((PH)=>{class tX{constructor(){this.lineStarts=[],this.addNewLine=($)=>this.lineStarts.push($),this.linePos=($)=>{let Z=0,X=this.lineStarts.length;while(Z<X){let J=Z+X>>1;if(this.lineStarts[J]<$)Z=J+1;else X=J}if(this.lineStarts[Z]===$)return{line:Z+1,col:1};if(Z===0)return{line:0,col:$};let z=this.lineStarts[Z-1];return{line:Z,col:$-z+1}}}}PH.LineCounter=tX});var K5=L((EH)=>{var CH=J0("process"),eX=Q2(),SH=H5();function l0($,Z){for(let X=0;X<$.length;++X)if($[X].type===Z)return!0;return!1}function $z($){for(let Z=0;Z<$.length;++Z)switch($[Z].type){case"space":case"comment":case"newline":break;default:return Z}return-1}function Xz($){switch($?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function G2($){switch($.type){case"document":return $.start;case"block-map":{let Z=$.items[$.items.length-1];return Z.sep??Z.start}case"block-seq":return $.items[$.items.length-1].start;default:return[]}}function j$($){if($.length===0)return[];let Z=$.length;$:while(--Z>=0)switch($[Z].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break $}while($[++Z]?.type==="space");return $.splice(Z,$.length)}function Zz($){if($.start.type==="flow-seq-start"){for(let Z of $.items)if(Z.sep&&!Z.value&&!l0(Z.start,"explicit-key-ind")&&!l0(Z.sep,"map-value-ind")){if(Z.key)Z.value=Z.key;if(delete Z.key,Xz(Z.value))if(Z.value.end)Array.prototype.push.apply(Z.value.end,Z.sep);else Z.value.end=Z.sep;else Array.prototype.push.apply(Z.start,Z.sep);delete Z.sep}}}class zz{constructor($){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new SH.Lexer,this.onNewLine=$}*parse($,Z=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let X of this.lexer.lex($,Z))yield*this.next(X);if(!Z)yield*this.end()}*next($){if(this.source=$,CH.env.LOG_TOKENS)console.log("|",eX.prettyToken($));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=$.length;return}let Z=eX.tokenType($);if(!Z){let X=`Not a YAML token: ${$}`;yield*this.pop({type:"error",offset:this.offset,message:X,source:$}),this.offset+=$.length}else if(Z==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=Z,yield*this.step(),Z){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+$.length);break;case"space":if(this.atNewLine&&$[0]===" ")this.indent+=$.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=$.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=$.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let $=this.peek(1);if(this.type==="doc-end"&&$?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!$)return yield*this.stream();switch($.type){case"document":return yield*this.document($);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar($);case"block-scalar":return yield*this.blockScalar($);case"block-map":return yield*this.blockMap($);case"block-seq":return yield*this.blockSequence($);case"flow-collection":return yield*this.flowCollection($);case"doc-end":return yield*this.documentEnd($)}yield*this.pop()}peek($){return this.stack[this.stack.length-$]}*pop($){let Z=$??this.stack.pop();if(!Z)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield Z;else{let X=this.peek(1);if(Z.type==="block-scalar")Z.indent="indent"in X?X.indent:0;else if(Z.type==="flow-collection"&&X.type==="document")Z.indent=0;if(Z.type==="flow-collection")Zz(Z);switch(X.type){case"document":X.value=Z;break;case"block-scalar":X.props.push(Z);break;case"block-map":{let z=X.items[X.items.length-1];if(z.value){X.items.push({start:[],key:Z,sep:[]}),this.onKeyLine=!0;return}else if(z.sep)z.value=Z;else{Object.assign(z,{key:Z,sep:[]}),this.onKeyLine=!z.explicitKey;return}break}case"block-seq":{let z=X.items[X.items.length-1];if(z.value)X.items.push({start:[],value:Z});else z.value=Z;break}case"flow-collection":{let z=X.items[X.items.length-1];if(!z||z.value)X.items.push({start:[],key:Z,sep:[]});else if(z.sep)z.value=Z;else Object.assign(z,{key:Z,sep:[]});return}default:yield*this.pop(),yield*this.pop(Z)}if((X.type==="document"||X.type==="block-map"||X.type==="block-seq")&&(Z.type==="block-map"||Z.type==="block-seq")){let z=Z.items[Z.items.length-1];if(z&&!z.sep&&!z.value&&z.start.length>0&&$z(z.start)===-1&&(Z.indent===0||z.start.every((J)=>J.type!=="comment"||J.indent<Z.indent))){if(X.type==="document")X.end=z.start;else X.items.push({start:z.start});Z.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let $={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")$.start.push(this.sourceToken);this.stack.push($);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document($){if($.value)return yield*this.lineEnd($);switch(this.type){case"doc-start":{if($z($.start)!==-1)yield*this.pop(),yield*this.step();else $.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":$.start.push(this.sourceToken);return}let Z=this.startBlockValue($);if(Z)this.stack.push(Z);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar($){if(this.type==="map-value-ind"){let Z=G2(this.peek(2)),X=j$(Z),z;if($.end)z=$.end,z.push(this.sourceToken),delete $.end;else z=[this.sourceToken];let J={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:X,key:$,sep:z}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=J}else yield*this.lineEnd($)}*blockScalar($){switch(this.type){case"space":case"comment":case"newline":$.props.push(this.sourceToken);return;case"scalar":if($.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let Z=this.source.indexOf(`
162
162
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
163
163
  `,Z)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let X=!this.onKeyLine&&this.indent===$.indent,z=X&&(Z.sep||Z.explicitKey)&&this.type!=="seq-item-ind",J=[];if(z&&Z.sep&&!Z.value){let q=[];for(let Q=0;Q<Z.sep.length;++Q){let Y=Z.sep[Q];switch(Y.type){case"newline":q.push(Q);break;case"space":break;case"comment":if(Y.indent>$.indent)q.length=0;break;default:q.length=0}}if(q.length>=2)J=Z.sep.splice(q[1])}switch(this.type){case"anchor":case"tag":if(z||Z.value)J.push(this.sourceToken),$.items.push({start:J}),this.onKeyLine=!0;else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"explicit-key-ind":if(!Z.sep&&!Z.explicitKey)Z.start.push(this.sourceToken),Z.explicitKey=!0;else if(z||Z.value)J.push(this.sourceToken),$.items.push({start:J,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(Z.explicitKey)if(!Z.sep)if(l0(Z.start,"newline"))Object.assign(Z,{key:null,sep:[this.sourceToken]});else{let q=j$(Z.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:q,key:null,sep:[this.sourceToken]}]})}else if(Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(l0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:J,key:null,sep:[this.sourceToken]}]});else if(Xz(Z.key)&&!l0(Z.sep,"newline")){let q=j$(Z.start),Q=Z.key,Y=Z.sep;Y.push(this.sourceToken),delete Z.key,delete Z.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:q,key:Q,sep:Y}]})}else if(J.length>0)Z.sep=Z.sep.concat(J,this.sourceToken);else Z.sep.push(this.sourceToken);else if(!Z.sep)Object.assign(Z,{key:null,sep:[this.sourceToken]});else if(Z.value||z)$.items.push({start:J,key:null,sep:[this.sourceToken]});else if(l0(Z.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else Z.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let q=this.flowScalar(this.type);if(z||Z.value)$.items.push({start:J,key:q,sep:[]}),this.onKeyLine=!0;else if(Z.sep)this.stack.push(q);else Object.assign(Z,{key:q,sep:[]}),this.onKeyLine=!0;return}default:{let q=this.startBlockValue($);if(q){if(q.type==="block-seq"){if(!Z.explicitKey&&Z.sep&&!l0(Z.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(X)$.items.push({start:J});this.stack.push(q);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let Z=$.items[$.items.length-1];switch(this.type){case"newline":if(Z.value){let X="end"in Z.value?Z.value.end:void 0;if((Array.isArray(X)?X[X.length-1]:void 0)?.type==="comment")X?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else Z.start.push(this.sourceToken);return;case"space":case"comment":if(Z.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(Z.start,$.indent)){let z=$.items[$.items.length-2]?.value?.end;if(Array.isArray(z)){Array.prototype.push.apply(z,Z.start),z.push(this.sourceToken),$.items.pop();return}}Z.start.push(this.sourceToken)}return;case"anchor":case"tag":if(Z.value||this.indent<=$.indent)break;Z.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(Z.value||l0(Z.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return}if(this.indent>$.indent){let X=this.startBlockValue($);if(X){this.stack.push(X);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let Z=$.items[$.items.length-1];if(this.type==="flow-error-end"){let X;do yield*this.pop(),X=this.peek(1);while(X?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!Z||Z.sep)$.items.push({start:[this.sourceToken]});else Z.start.push(this.sourceToken);return;case"map-value-ind":if(!Z||Z.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Object.assign(Z,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!Z||Z.value)$.items.push({start:[this.sourceToken]});else if(Z.sep)Z.sep.push(this.sourceToken);else Z.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let z=this.flowScalar(this.type);if(!Z||Z.value)$.items.push({start:[],key:z,sep:[]});else if(Z.sep)this.stack.push(z);else Object.assign(Z,{key:z,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let X=this.startBlockValue($);if(X)this.stack.push(X);else yield*this.pop(),yield*this.step()}else{let X=this.peek(2);if(X.type==="block-map"&&(this.type==="map-value-ind"&&X.indent===$.indent||this.type==="newline"&&!X.items[X.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&X.type!=="flow-collection"){let z=G2(X),J=j$(z);Zz($);let q=$.end.splice(1,$.end.length);q.push(this.sourceToken);let Q={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:J,key:$,sep:q}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=Q}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let Z=this.source.indexOf(`
164
164
  `)+1;while(Z!==0)this.onNewLine(this.offset+Z),Z=this.source.indexOf(`
165
- `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=G2($),X=j$(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=G2($),X=j$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}_H.Parser=zz});var Gz=T((gH)=>{var Jz=X5(),EH=A6(),j6=P6(),jH=VZ(),bH=k(),xH=V5(),qz=K5();function Qz($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new xH.LineCounter||null,prettyErrors:Z}}function kH($,Z={}){let{lineCounter:X,prettyErrors:z}=Qz(Z),J=new qz.Parser(X?.addNewLine),q=new Jz.Composer(Z),Q=Array.from(q.compose(J.parse($)));if(z&&X)for(let Y of Q)Y.errors.forEach(j6.prettifyError($,X)),Y.warnings.forEach(j6.prettifyError($,X));if(Q.length>0)return Q;return Object.assign([],{empty:!0},q.streamInfo())}function Yz($,Z={}){let{lineCounter:X,prettyErrors:z}=Qz(Z),J=new qz.Parser(X?.addNewLine),q=new Jz.Composer(Z),Q=null;for(let Y of q.compose(J.parse($),!0,$.length))if(!Q)Q=Y;else if(Q.options.logLevel!=="silent"){Q.errors.push(new j6.YAMLParseError(Y.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Q.errors.forEach(j6.prettifyError($,X)),Q.warnings.forEach(j6.prettifyError($,X));return Q}function fH($,Z,X){let z=void 0;if(typeof Z==="function")z=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let J=Yz($,X);if(!J)return null;if(J.warnings.forEach((q)=>jH.warn(J.options.logLevel,q)),J.errors.length>0)if(J.options.logLevel!=="silent")throw J.errors[0];else J.errors=[];return J.toJS(Object.assign({reviver:z},X))}function yH($,Z,X){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let J=Math.round(X);X=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=X??Z??{};if(!J)return}if(bH.isDocument($)&&!z)return $.toString(X);return new EH.Document($,z,X).toString(X)}gH.parse=fH;gH.parseAllDocuments=kH;gH.parseDocument=Yz;gH.stringify=yH});var Dz=T((jV,Bz)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/faf-scoring-kernel",Vz={};Vz.__wbindgen_placeholder__=jV;var W2=null;function b$(){if(W2===null||W2.byteLength===0)W2=new Uint8Array(v.memory.buffer);return W2}var Kz=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Kz.decode();function PV($,Z){return Kz.decode(b$().subarray($,$+Z))}function H$($,Z){return $=$>>>0,PV($,Z)}jV.sdk_version=function(){let $,Z;try{let X=v.sdk_version();return $=X[0],Z=X[1],H$(X[0],X[1])}finally{v.__wbindgen_free($,Z,1)}};var A0=0,x6=new TextEncoder;if(!("encodeInto"in x6))x6.encodeInto=function($,Z){let X=x6.encode($);return Z.set(X),{read:$.length,written:X.length}};function H2($,Z,X){if(X===void 0){let Y=x6.encode($),G=Z(Y.length,1)>>>0;return b$().subarray(G,G+Y.length).set(Y),A0=Y.length,G}let z=$.length,J=Z(z,1)>>>0,q=b$(),Q=0;for(;Q<z;Q++){let Y=$.charCodeAt(Q);if(Y>127)break;q[J+Q]=Y}if(Q!==z){if(Q!==0)$=$.slice(Q);J=X(J,z,z=Q+$.length*3,1)>>>0;let Y=b$().subarray(J+Q,J+z),G=x6.encodeInto($,Y);Q+=G.written,J=X(J,z,Q,1)>>>0}return A0=Q,J}function x$($){let Z=v.__wbindgen_externrefs.get($);return v.__externref_table_dealloc($),Z}jV.score_faf_enterprise=function($){let Z,X;try{let q=H2($,v.__wbindgen_malloc,v.__wbindgen_realloc),Q=A0,Y=v.score_faf_enterprise(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};jV.score_faf=function($){let Z,X;try{let q=H2($,v.__wbindgen_malloc,v.__wbindgen_realloc),Q=A0,Y=v.score_faf(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};function N5($,Z){let X=Z($.length*1,1)>>>0;return b$().set($,X/1),A0=$.length,X}jV.decompile_fafb=function($){let Z,X;try{let q=N5($,v.__wbindgen_malloc),Q=A0,Y=v.decompile_fafb(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};jV.score_fafb=function($){let Z,X;try{let q=N5($,v.__wbindgen_malloc),Q=A0,Y=v.score_fafb(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};jV.validate_faf=function($){let Z=H2($,v.__wbindgen_malloc,v.__wbindgen_realloc),X=A0;return v.validate_faf(Z,X)!==0};function SV($,Z){return $=$>>>0,b$().subarray($/1,$/1+Z)}jV.compile_fafb=function($){let Z=H2($,v.__wbindgen_malloc,v.__wbindgen_realloc),X=A0,z=v.compile_fafb(Z,X);if(z[3])throw x$(z[2]);var J=SV(z[0],z[1]).slice();return v.__wbindgen_free(z[0],z[1]*1,1),J};jV.fafb_info=function($){let Z,X;try{let q=N5($,v.__wbindgen_malloc),Q=A0,Y=v.fafb_info(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{v.__wbindgen_free(Z,X,1)}};jV.__wbindgen_cast_2241b6af4c4b2941=function($,Z){return H$($,Z)};jV.__wbindgen_init_externref_table=function(){let $=v.__wbindgen_externrefs,Z=$.grow(4);$.set(0,void 0),$.set(Z+0,void 0),$.set(Z+1,null),$.set(Z+2,!0),$.set(Z+3,!1)};var _V=`${__dirname}/faf_wasm_sdk_bg.wasm`,CV=J0("fs").readFileSync(_V),EV=new WebAssembly.Module(CV),v=jV.__wasm=new WebAssembly.Instance(EV,Vz).exports;v.__wbindgen_start()});var Mz={};g4(Mz,{orange:()=>n0,italic:()=>dV,fafCyan:()=>w,dim:()=>I,bold:()=>b});var L5=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,b,I,dV,w=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,n0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var d=j(()=>{b=L5("1"),I=L5("2"),dV=L5("3")});var ez=T((gL,MK)=>{MK.exports={name:"faf-cli",version:"6.0.5",description:"The Persistent AI Context Standard — project DNA for any AI. IANA-registered. Anthropic-approved.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{bun:"./src/index.ts",default:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",build:"bun build src/cli.ts --outfile dist/cli.js --target=node --minify && bun build src/index.ts --outfile dist/index.js --target=node --minify",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test","test:watch":"bun test --watch",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'",prepublishOnly:"bun run build"},keywords:["faf","ai-context","project-dna","bi-sync","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.1","faf-scoring-kernel":"^2.0.3",open:"8.4.2",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.74.0"},devDependencies:{"@types/node":"^22.15.0",typescript:"^5.3.3",eslint:"^9.39.2","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",prettier:"^3.2.5"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});var S5=T((OT,H9)=>{var W9=J0("fs"),P5;function CK(){try{return W9.statSync("/.dockerenv"),!0}catch($){return!1}}function EK(){try{return W9.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch($){return!1}}H9.exports=()=>{if(P5===void 0)P5=CK()||EK();return P5}});var B9=T((wT,_5)=>{var jK=J0("os"),bK=J0("fs"),V9=S5(),K9=()=>{if(process.platform!=="linux")return!1;if(jK.release().toLowerCase().includes("microsoft")){if(V9())return!1;return!0}try{return bK.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!V9():!1}catch($){return!1}};if(process.env.__IS_WSL_TEST__)_5.exports=K9;else _5.exports=K9()});var N9=T((FT,D9)=>{D9.exports=($,Z,X)=>{let z=(J)=>Object.defineProperty($,Z,{value:J,enumerable:!0,writable:!0});return Object.defineProperty($,Z,{configurable:!0,enumerable:!0,get(){let J=X();return z(J),J},set(J){z(J)}}),$}});var F9=T((RT,w9)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/open",xK=J0("path"),kK=J0("child_process"),{promises:L2,constants:O9}=J0("fs"),I2=B9(),fK=S5(),E5=N9(),I9=xK.join(__dirname,"xdg-open"),{platform:v$,arch:L9}=process,yK=()=>{try{return L2.statSync("/run/.containerenv"),!0}catch{return!1}},C5;function gK(){if(C5===void 0)C5=yK()||fK();return C5}var hK=(()=>{let Z;return async function(){if(Z)return Z;let X="/etc/wsl.conf",z=!1;try{await L2.access(X,O9.F_OK),z=!0}catch{}if(!z)return"/mnt/";let J=await L2.readFile(X,{encoding:"utf8"}),q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(J);if(!q)return"/mnt/";return Z=q.groups.mountPoint.trim(),Z=Z.endsWith("/")?Z:`${Z}/`,Z}})(),T9=async($,Z)=>{let X;for(let z of $)try{return await Z(z)}catch(J){X=J}throw X},T2=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return T9($.app,(Y)=>T2({...$,app:Y}));let{name:Z,arguments:X=[]}=$.app||{};if(X=[...X],Array.isArray(Z))return T9(Z,(Y)=>T2({...$,app:{name:Y,arguments:X}}));let z,J=[],q={};if(v$==="darwin"){if(z="open",$.wait)J.push("--wait-apps");if($.background)J.push("--background");if($.newInstance)J.push("--new");if(Z)J.push("-a",Z)}else if(v$==="win32"||I2&&!gK()&&!Z){let Y=await hK();if(z=I2?`${Y}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,J.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),!I2)q.windowsVerbatimArguments=!0;let G=["Start"];if($.wait)G.push("-Wait");if(Z){if(G.push(`"\`"${Z}\`""`,"-ArgumentList"),$.target)X.unshift($.target)}else if($.target)G.push(`"${$.target}"`);if(X.length>0)X=X.map((U)=>`"\`"${U}\`""`),G.push(X.join(","));$.target=Buffer.from(G.join(" "),"utf16le").toString("base64")}else{if(Z)z=Z;else{let Y=!__dirname||__dirname==="/",G=!1;try{await L2.access(I9,O9.X_OK),G=!0}catch{}z=process.versions.electron||v$==="android"||Y||!G?"xdg-open":I9}if(X.length>0)J.push(...X);if(!$.wait)q.stdio="ignore",q.detached=!0}if($.target)J.push($.target);if(v$==="darwin"&&X.length>0)J.push("--args",...X);let Q=kK.spawn(z,J,q);if($.wait)return new Promise((Y,G)=>{Q.once("error",G),Q.once("close",(U)=>{if(!$.allowNonzeroExitCode&&U>0){G(Error(`Exited with code ${U}`));return}Y(Q)})});return Q.unref(),Q},j5=($,Z)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return T2({...Z,target:$})},vK=($,Z)=>{if(typeof $!=="string")throw TypeError("Expected a `name`");let{arguments:X=[]}=Z||{};if(X!==void 0&&X!==null&&!Array.isArray(X))throw TypeError("Expected `appArguments` as Array type");return T2({...Z,app:{name:$,arguments:X}})};function M9($){if(typeof $==="string"||Array.isArray($))return $;let{[L9]:Z}=$;if(!Z)throw Error(`${L9} is not supported`);return Z}function b5({[v$]:$},{wsl:Z}){if(Z&&I2)return M9(Z);if(!$)throw Error(`${v$} is not supported`);return M9($)}var M2={};E5(M2,"chrome",()=>b5({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));E5(M2,"firefox",()=>b5({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));E5(M2,"edge",()=>b5({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));j5.apps=M2;j5.openApp=vK;w9.exports=j5});function O($,Z,X,z,J){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,X):J?J.value=X:Z.set($,X),X}function K($,Z,X,z){if(X==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!z:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?z:X==="a"?z.call($):z?z.value:Z.get($)}var j0=()=>{};var x5=function(){let{crypto:$}=globalThis;if($?.randomUUID)return x5=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),X=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(z)=>(+z^X()&15>>+z/4).toString(16))};function b0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var v6=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let Z=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)Z.stack=$.stack;if($.cause&&!Z.cause)Z.cause=$.cause;if($.name)Z.name=$.name;return Z}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var A,t,Q0,s0,u$,m$,d$,c$,p$,l$,i$,n$,s$;var W0=j(()=>{A=class A extends Error{};t=class t extends A{constructor($,Z,X,z){super(`${t.makeMessage($,Z,X)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=Z}static makeMessage($,Z,X){let z=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):X;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,Z,X,z){if(!$||!z)return new s0({message:X,cause:v6(Z)});let J=Z;if($===400)return new m$($,J,X,z);if($===401)return new d$($,J,X,z);if($===403)return new c$($,J,X,z);if($===404)return new p$($,J,X,z);if($===409)return new l$($,J,X,z);if($===422)return new i$($,J,X,z);if($===429)return new n$($,J,X,z);if($>=500)return new s$($,J,X,z);return new t($,J,X,z)}};Q0=class Q0 extends t{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};s0=class s0 extends t{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};u$=class u$ extends s0{constructor({message:$}={}){super({message:$??"Request timed out."})}};m$=class m$ extends t{};d$=class d$ extends t{};c$=class c$ extends t{};p$=class p$ extends t{};l$=class l$ extends t{};i$=class i$ extends t{};n$=class n$ extends t{};s$=class s$ extends t{}});function O2($){if(typeof $!=="object")return{};return $??{}}function x9($){if(!$)return!0;for(let Z in $)return!1;return!0}function k9($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var JB,b9=($)=>{return JB.test($)},k5=($)=>(k5=Array.isArray,k5($)),f5,f9=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new A(`${$} must be an integer`);if(Z<0)throw new A(`${$} must be a positive integer`);return Z},w2=($)=>{try{return JSON.parse($)}catch(Z){return}};var B$=j(()=>{W0();JB=/^[a-z][a-z0-9+.-]*:/i,f5=k5});var y9=($)=>new Promise((Z)=>setTimeout(Z,$));var r0="0.74.0";function qB(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function YB(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:X}of $){let z=X.exec(navigator.userAgent);if(z){let J=z[1]||0,q=z[2]||0,Q=z[3]||0;return{browser:Z,version:`${J}.${q}.${Q}`}}}return null}var u9=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},QB=()=>{let $=qB();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":h9(Deno.build.os),"X-Stainless-Arch":g9(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":h9(globalThis.process.platform??"unknown"),"X-Stainless-Arch":g9(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=YB();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},g9=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},h9=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},v9,m9=()=>{return v9??(v9=QB())};var y5=()=>{};function d9(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function g5(...$){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...$)}function F2($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return g5({start(){},async pull(X){let{done:z,value:J}=await Z.next();if(z)X.close();else X.enqueue(J)},async cancel(){await Z.return?.()}})}function u6($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let X=await Z.read();if(X?.done)Z.releaseLock();return X}catch(X){throw Z.releaseLock(),X}},async return(){let X=Z.cancel();return Z.releaseLock(),await X,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function c9($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var p9=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function n9($){let Z=0;for(let J of $)Z+=J.length;let X=new Uint8Array(Z),z=0;for(let J of $)X.set(J,z),z+=J.length;return X}function m6($){let Z;return(l9??(Z=new globalThis.TextEncoder,l9=Z.encode.bind(Z)))($)}function h5($){let Z;return(i9??(Z=new globalThis.TextDecoder,i9=Z.decode.bind(Z)))($)}var l9,i9;class a0{constructor(){H0.set(this,void 0),V0.set(this,void 0),O(this,H0,new Uint8Array,"f"),O(this,V0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?m6($):$;O(this,H0,n9([K(this,H0,"f"),Z]),"f");let X=[],z;while((z=WB(K(this,H0,"f"),K(this,V0,"f")))!=null){if(z.carriage&&K(this,V0,"f")==null){O(this,V0,z.index,"f");continue}if(K(this,V0,"f")!=null&&(z.index!==K(this,V0,"f")+1||z.carriage)){X.push(h5(K(this,H0,"f").subarray(0,K(this,V0,"f")-1))),O(this,H0,K(this,H0,"f").subarray(K(this,V0,"f")),"f"),O(this,V0,null,"f");continue}let J=K(this,V0,"f")!==null?z.preceding-1:z.preceding,q=h5(K(this,H0,"f").subarray(0,J));X.push(q),O(this,H0,K(this,H0,"f").subarray(z.index),"f"),O(this,V0,null,"f")}return X}flush(){if(!K(this,H0,"f").length)return[];return this.decode(`
166
- `)}}function WB($,Z){for(let J=Z??0;J<$.length;J++){if($[J]===10)return{preceding:J,index:J+1,carriage:!1};if($[J]===13)return{preceding:J,index:J+1,carriage:!0}}return null}function s9($){for(let z=0;z<$.length-1;z++){if($[z]===10&&$[z+1]===10)return z+2;if($[z]===13&&$[z+1]===13)return z+2;if($[z]===13&&$[z+1]===10&&z+3<$.length&&$[z+2]===13&&$[z+3]===10)return z+4}return-1}var H0,V0;var v5=j(()=>{j0();H0=new WeakMap,V0=new WeakMap;a0.NEWLINE_CHARS=new Set([`
167
- `,"\r"]);a0.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function d6(){}function R2($,Z,X){if(!Z||A2[$]>A2[X])return d6;else return Z[$].bind(Z)}function q0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return HB;let z=r9.get(Z);if(z&&z[0]===X)return z[1];let J={error:R2("error",Z,X),warn:R2("warn",Z,X),info:R2("info",Z,X),debug:R2("debug",Z,X)};return r9.set(Z,[X,J]),J}var A2,u5=($,Z,X)=>{if(!$)return;if(k9(A2,$))return $;q0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(A2))}`);return},HB,r9,x0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([Z,X])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":X]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var P2=j(()=>{B$();A2={off:0,error:200,warn:300,info:400,debug:500};HB={error:d6,warn:d6,info:d6,debug:d6},r9=new WeakMap});async function*VB($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new A("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new A("Attempted to iterate over a response with no body")}let X=new a9,z=new a0,J=u6($.body);for await(let q of KB(J))for(let Q of z.decode(q)){let Y=X.decode(Q);if(Y)yield Y}for(let q of z.flush()){let Q=X.decode(q);if(Q)yield Q}}async function*KB($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?m6(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let q;while((q=s9(Z))!==-1)yield Z.slice(0,q),Z=Z.slice(q)}if(Z.length>0)yield Z}class a9{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let J={event:this.event,data:this.data.join(`
168
- `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],J}if(this.chunks.push($),$.startsWith(":"))return null;let[Z,X,z]=BB($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function BB($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var c6,K0;var m5=j(()=>{j0();W0();v5();B$();P2();W0();K0=class K0{constructor($,Z,X){this.iterator=$,c6.set(this,void 0),this.controller=Z,O(this,c6,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?q0(X):console;async function*q(){if(z)throw new A("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Q=!1;try{for await(let Y of VB($,Z)){if(Y.event==="completion")try{yield JSON.parse(Y.data)}catch(G){throw J.error("Could not parse message into JSON:",Y.data),J.error("From chunk:",Y.raw),G}if(Y.event==="message_start"||Y.event==="message_delta"||Y.event==="message_stop"||Y.event==="content_block_start"||Y.event==="content_block_delta"||Y.event==="content_block_stop")try{yield JSON.parse(Y.data)}catch(G){throw J.error("Could not parse message into JSON:",Y.data),J.error("From chunk:",Y.raw),G}if(Y.event==="ping")continue;if(Y.event==="error")throw new t(void 0,w2(Y.data)??Y.data,void 0,$.headers)}Q=!0}catch(Y){if(b0(Y))return;throw Y}finally{if(!Q)Z.abort()}}return new K0(q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Q=new a0,Y=u6($);for await(let G of Y)for(let U of Q.decode(G))yield U;for(let G of Q.flush())yield G}async function*q(){if(z)throw new A("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Q=!1;try{for await(let Y of J()){if(Q)continue;if(Y)yield JSON.parse(Y)}Q=!0}catch(Y){if(b0(Y))return;throw Y}finally{if(!Q)Z.abort()}}return new K0(q,Z,X)}[(c6=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],Z=[],X=this.iterator(),z=(J)=>{return{next:()=>{if(J.length===0){let q=X.next();$.push(q),Z.push(q)}return J.shift()}}};return[new K0(()=>z($),this.controller,K(this,c6,"f")),new K0(()=>z(Z),this.controller,K(this,c6,"f"))]}toReadableStream(){let $=this,Z;return g5({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let q=m6(JSON.stringify(z)+`
169
- `);X.enqueue(q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function S2($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:q}=Z,Q=await(async()=>{if(Z.options.stream){if(q0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return K0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let G=X.headers.get("content-type")?.split(";")[0]?.trim();if(G?.includes("application/json")||G?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let H=await X.json();return d5(H,X)}return await X.text()})();return q0($).debug(`[${z}] response parsed`,x0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Q,durationMs:Date.now()-q})),Q}function d5($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var c5=j(()=>{m5();P2()});var p6,o0;var _2=j(()=>{j0();c5();o0=class o0 extends Promise{constructor($,Z,X=S2){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,p6.set(this,void 0),O(this,p6,$,"f")}_thenUnwrap($){return new o0(K(this,p6,"f"),this.responsePromise,async(Z,X)=>d5($(await this.parseResponse(Z,X),X),X.response))}asResponse(){return this.responsePromise.then(($)=>$.response)}async withResponse(){let[$,Z]=await Promise.all([this.parse(),this.asResponse()]);return{data:$,response:Z,request_id:Z.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then(($)=>this.parseResponse(K(this,p6,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};p6=new WeakMap});var C2,p5,l6,w0,i6;var P0=j(()=>{j0();W0();c5();_2();B$();p5=class p5{constructor($,Z,X,z){C2.set(this,void 0),O(this,C2,$,"f"),this.options=z,this.response=Z,this.body=X}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new A("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await K(this,C2,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(C2=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};l6=class l6 extends o0{constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await S2(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};w0=class w0 extends p5{constructor($,Z,X,z){super($,Z,X,z);this.data=X.data||[],this.has_more=X.has_more||!1,this.first_id=X.first_id||null,this.last_id=X.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let Z=this.first_id;if(!Z)return null;return{...this.options,query:{...O2(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...O2(this.options.query),after_id:$}}}};i6=class i6 extends p5{constructor($,Z,X,z){super($,Z,X,z);this.data=X.data||[],this.has_more=X.has_more||!1,this.next_page=X.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.next_page;if(!$)return null;return{...this.options,query:{...O2(this.options.query),page:$}}}}});function D$($,Z,X){return i5(),new File($,Z??"unknown_file",X)}function n6($,Z){let X=typeof $==="object"&&$!==null&&(("name"in $)&&$.name&&String($.name)||("url"in $)&&$.url&&String($.url)||("filename"in $)&&$.filename&&String($.filename)||("path"in $)&&$.path&&String($.path))||"";return Z?X.split(/[\\/]/).pop()||void 0:X}function NB($){let Z=typeof $==="function"?$:$.fetch,X=o9.get(Z);if(X)return X;let z=(async()=>{try{let J="Response"in Z?Z.Response:(await Z("data:,")).constructor,q=new FormData;if(q.toString()===await new J(q).text())return!1;return!0}catch{return!0}})();return o9.set(Z,z),z}var i5=()=>{if(typeof File>"u"){let{process:$}=globalThis,Z=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(Z?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},n5=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",r$=async($,Z,X=!0)=>{return{...$,body:await IB($.body,Z,X)}},o9,IB=async($,Z,X=!0)=>{if(!await NB(Z))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let z=new FormData;return await Promise.all(Object.entries($||{}).map(([J,q])=>l5(z,J,q,X))),z},LB=($)=>$ instanceof Blob&&("name"in $),l5=async($,Z,X,z)=>{if(X===void 0)return;if(X==null)throw TypeError(`Received null for "${Z}"; to pass null in FormData, you must use the string 'null'`);if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")$.append(Z,String(X));else if(X instanceof Response){let J={},q=X.headers.get("Content-Type");if(q)J={type:q};$.append(Z,D$([await X.blob()],n6(X,z),J))}else if(n5(X))$.append(Z,D$([await new Response(F2(X)).blob()],n6(X,z)));else if(LB(X))$.append(Z,D$([X],n6(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>l5($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,q])=>l5($,`${Z}[${J}]`,q,z)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${X} instead`)};var a$=j(()=>{o9=new WeakMap});async function s6($,Z,X){if(i5(),$=await $,Z||(Z=n6($,!0)),TB($)){if($ instanceof File&&Z==null&&X==null)return $;return D$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(MB($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),D$(await s5(J),Z,X)}let z=await s5($);if(!X?.type){let J=z.find((q)=>typeof q==="object"&&("type"in q)&&q.type);if(typeof J==="string")X={...X,type:J}}return D$(z,Z,X)}async function s5($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if(t9($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(n5($))for await(let X of $)Z.push(...await s5(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${OB($)}`)}return Z}function OB($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var t9=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",TB=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&t9($),MB=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var e9=j(()=>{a$();a$()});var r5=j(()=>{e9()});var $J=()=>{};class i{constructor($){this._client=$}}function*FB($){if(!$)return;if(ZJ in $){let{values:z,nulls:J}=$;yield*z.entries();for(let q of J)yield[q,null];return}let Z=!1,X;if($ instanceof Headers)X=$.entries();else if(f5($))X=$;else Z=!0,X=Object.entries($??{});for(let z of X){let J=z[0];if(typeof J!=="string")throw TypeError("expected header name to be a string");let q=f5(z[1])?z[1]:[z[1]],Q=!1;for(let Y of q){if(Y===void 0)continue;if(Z&&!Q)Q=!0,yield[J,null];yield[J,Y]}}}var ZJ,E=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[q,Q]of FB(z)){let Y=q.toLowerCase();if(!J.has(Y))Z.delete(q),J.add(Y);if(Q===null)Z.delete(q),X.add(Y);else Z.append(q,Q),X.delete(Y)}}return{[ZJ]:!0,values:Z,nulls:X}};var B0=j(()=>{B$();ZJ=Symbol.for("brand.privateNullableHeaders")});function E2($){return typeof $==="object"&&$!==null&&r6 in $}function a5($,Z){let X=new Set;if($){for(let z of $)if(E2(z))X.add(z[r6])}if(Z)for(let z of Z){if(E2(z))X.add(z[r6]);if(Array.isArray(z.content)){for(let J of z.content)if(E2(J))X.add(J[r6])}}return Array.from(X)}function j2($,Z){let X=a5($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function XJ($){if(E2($))return{"x-stainless-helper":$[r6]};return{}}var r6;var a6=j(()=>{r6=Symbol("anthropic.sdk.stainlessHelper")});function JJ($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var zJ,RB=($=JJ)=>function(X,...z){if(X.length===1)return X[0];let J=!1,q=[],Q=X.reduce((W,V,H)=>{if(/[?#]/.test(V))J=!0;let D=z[H],M=(J?encodeURIComponent:$)(""+D);if(H!==z.length&&(D==null||typeof D==="object"&&D.toString===Object.getPrototypeOf(Object.getPrototypeOf(D.hasOwnProperty??zJ)??zJ)?.toString))M=D+"",q.push({start:W.length+V.length,length:M.length,error:`Value of type ${Object.prototype.toString.call(D).slice(8,-1)} is not a valid path parameter`});return W+V+(H===z.length?"":M)},""),Y=Q.split(/[?#]/,1)[0],G=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,U;while((U=G.exec(Y))!==null)q.push({start:U.index,length:U[0].length,error:`Value "${U[0]}" can't be safely passed as a path parameter`});if(q.sort((W,V)=>W.start-V.start),q.length>0){let W=0,V=q.reduce((H,D)=>{let M=" ".repeat(D.start-W),B="^".repeat(D.length);return W=D.start+D.length,H+M+B},"");throw new A(`Path parameters result in path with invalid segments:
165
+ `,Z)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let Z=G2($),X=j$(Z);return X.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let Z=G2($),X=j$(Z);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:X,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,Z){if(this.type!=="comment")return!1;if(this.indent<=Z)return!1;return $.every((X)=>X.type==="newline"||X.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}EH.Parser=zz});var Gz=L((vH)=>{var Jz=X5(),bH=A6(),j6=P6(),xH=VZ(),kH=y(),fH=V5(),qz=K5();function Qz($){let Z=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||Z&&new fH.LineCounter||null,prettyErrors:Z}}function yH($,Z={}){let{lineCounter:X,prettyErrors:z}=Qz(Z),J=new qz.Parser(X?.addNewLine),q=new Jz.Composer(Z),Q=Array.from(q.compose(J.parse($)));if(z&&X)for(let Y of Q)Y.errors.forEach(j6.prettifyError($,X)),Y.warnings.forEach(j6.prettifyError($,X));if(Q.length>0)return Q;return Object.assign([],{empty:!0},q.streamInfo())}function Yz($,Z={}){let{lineCounter:X,prettyErrors:z}=Qz(Z),J=new qz.Parser(X?.addNewLine),q=new Jz.Composer(Z),Q=null;for(let Y of q.compose(J.parse($),!0,$.length))if(!Q)Q=Y;else if(Q.options.logLevel!=="silent"){Q.errors.push(new j6.YAMLParseError(Y.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(z&&X)Q.errors.forEach(j6.prettifyError($,X)),Q.warnings.forEach(j6.prettifyError($,X));return Q}function gH($,Z,X){let z=void 0;if(typeof Z==="function")z=Z;else if(X===void 0&&Z&&typeof Z==="object")X=Z;let J=Yz($,X);if(!J)return null;if(J.warnings.forEach((q)=>xH.warn(J.options.logLevel,q)),J.errors.length>0)if(J.options.logLevel!=="silent")throw J.errors[0];else J.errors=[];return J.toJS(Object.assign({reviver:z},X))}function hH($,Z,X){let z=null;if(typeof Z==="function"||Array.isArray(Z))z=Z;else if(X===void 0&&Z)X=Z;if(typeof X==="string")X=X.length;if(typeof X==="number"){let J=Math.round(X);X=J<1?void 0:J>8?{indent:8}:{indent:J}}if($===void 0){let{keepUndefined:J}=X??Z??{};if(!J)return}if(kH.isDocument($)&&!z)return $.toString(X);return new bH.Document($,z,X).toString(X)}vH.parse=gH;vH.parseAllDocuments=yH;vH.parseDocument=Yz;vH.stringify=hH});var Bz=L((xV,Dz)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/faf-scoring-kernel",Vz={};Vz.__wbindgen_placeholder__=xV;var W2=null;function b$(){if(W2===null||W2.byteLength===0)W2=new Uint8Array(u.memory.buffer);return W2}var Kz=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});Kz.decode();function CV($,Z){return Kz.decode(b$().subarray($,$+Z))}function H$($,Z){return $=$>>>0,CV($,Z)}xV.sdk_version=function(){let $,Z;try{let X=u.sdk_version();return $=X[0],Z=X[1],H$(X[0],X[1])}finally{u.__wbindgen_free($,Z,1)}};var A0=0,x6=new TextEncoder;if(!("encodeInto"in x6))x6.encodeInto=function($,Z){let X=x6.encode($);return Z.set(X),{read:$.length,written:X.length}};function H2($,Z,X){if(X===void 0){let Y=x6.encode($),G=Z(Y.length,1)>>>0;return b$().subarray(G,G+Y.length).set(Y),A0=Y.length,G}let z=$.length,J=Z(z,1)>>>0,q=b$(),Q=0;for(;Q<z;Q++){let Y=$.charCodeAt(Q);if(Y>127)break;q[J+Q]=Y}if(Q!==z){if(Q!==0)$=$.slice(Q);J=X(J,z,z=Q+$.length*3,1)>>>0;let Y=b$().subarray(J+Q,J+z),G=x6.encodeInto($,Y);Q+=G.written,J=X(J,z,Q,1)>>>0}return A0=Q,J}function x$($){let Z=u.__wbindgen_externrefs.get($);return u.__externref_table_dealloc($),Z}xV.score_faf_enterprise=function($){let Z,X;try{let q=H2($,u.__wbindgen_malloc,u.__wbindgen_realloc),Q=A0,Y=u.score_faf_enterprise(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{u.__wbindgen_free(Z,X,1)}};xV.score_faf=function($){let Z,X;try{let q=H2($,u.__wbindgen_malloc,u.__wbindgen_realloc),Q=A0,Y=u.score_faf(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{u.__wbindgen_free(Z,X,1)}};function N5($,Z){let X=Z($.length*1,1)>>>0;return b$().set($,X/1),A0=$.length,X}xV.decompile_fafb=function($){let Z,X;try{let q=N5($,u.__wbindgen_malloc),Q=A0,Y=u.decompile_fafb(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{u.__wbindgen_free(Z,X,1)}};xV.score_fafb=function($){let Z,X;try{let q=N5($,u.__wbindgen_malloc),Q=A0,Y=u.score_fafb(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{u.__wbindgen_free(Z,X,1)}};xV.validate_faf=function($){let Z=H2($,u.__wbindgen_malloc,u.__wbindgen_realloc),X=A0;return u.validate_faf(Z,X)!==0};function SV($,Z){return $=$>>>0,b$().subarray($/1,$/1+Z)}xV.compile_fafb=function($){let Z=H2($,u.__wbindgen_malloc,u.__wbindgen_realloc),X=A0,z=u.compile_fafb(Z,X);if(z[3])throw x$(z[2]);var J=SV(z[0],z[1]).slice();return u.__wbindgen_free(z[0],z[1]*1,1),J};xV.fafb_info=function($){let Z,X;try{let q=N5($,u.__wbindgen_malloc),Q=A0,Y=u.fafb_info(q,Q);var z=Y[0],J=Y[1];if(Y[3])throw z=0,J=0,x$(Y[2]);return Z=z,X=J,H$(z,J)}finally{u.__wbindgen_free(Z,X,1)}};xV.__wbindgen_cast_2241b6af4c4b2941=function($,Z){return H$($,Z)};xV.__wbindgen_init_externref_table=function(){let $=u.__wbindgen_externrefs,Z=$.grow(4);$.set(0,void 0),$.set(Z+0,void 0),$.set(Z+1,null),$.set(Z+2,!0),$.set(Z+3,!1)};var EV=`${__dirname}/faf_wasm_sdk_bg.wasm`,jV=J0("fs").readFileSync(EV),bV=new WebAssembly.Module(jV),u=xV.__wasm=new WebAssembly.Instance(bV,Vz).exports;u.__wbindgen_start()});var Mz={};g4(Mz,{orange:()=>n0,italic:()=>pV,fafCyan:()=>F,dim:()=>I,bold:()=>b});var L5=($)=>(Z)=>`\x1B[${$}m${Z}\x1B[0m`,b,I,pV,F=($)=>`\x1B[38;2;0;212;212m${$}\x1B[0m`,n0=($)=>`\x1B[38;5;208m${$}\x1B[0m`;var c=j(()=>{b=L5("1"),I=L5("2"),pV=L5("3")});var Z9=L((hL,OK)=>{OK.exports={name:"faf-cli",version:"6.0.6",description:"Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-approved.",type:"module",icon:"https://faf.one/orange-smiley.svg",logo:"https://faf.one/orange-smiley.svg",main:"dist/index.js",bin:{faf:"dist/cli.js","faf-cli":"dist/cli.js"},exports:{".":{bun:"./src/index.ts",default:"./dist/index.js"}},files:["dist/**/*","README.md","LICENSE","project.faf"],scripts:{dev:"bun src/cli.ts",build:"bun build src/cli.ts --outfile dist/cli.js --target=node --minify && bun build src/index.ts --outfile dist/index.js --target=node --minify",compile:"bun build src/cli.ts --compile --bytecode --minify --outfile faf","compile:all":"bun build src/cli.ts --compile --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --target=bun-windows-x64 --outfile faf-windows-x64.exe",test:"bun test","test:watch":"bun test --watch",lint:"eslint src/**/*.ts",format:"prettier --write 'src/**/*.ts'",prepublishOnly:"bun run build"},keywords:["faf","ai-context","project-dna","bi-sync","cli","claude","gemini","cursor","mcp","model-context-protocol","persistent-context","ai-readiness","foundational"],author:"wolfejam <wolfejam@faf.one>",license:"MIT",repository:{type:"git",url:"https://github.com/Wolfe-Jam/faf-cli.git"},homepage:"https://faf.one",bugs:{url:"https://github.com/Wolfe-Jam/faf-cli/issues"},dependencies:{commander:"^14.0.1","faf-scoring-kernel":"^2.0.3",open:"8.4.2",yaml:"^2.4.1"},optionalDependencies:{"@anthropic-ai/sdk":"^0.74.0"},devDependencies:{"@types/node":"^22.15.0",typescript:"^5.3.3",eslint:"^9.39.2","@typescript-eslint/eslint-plugin":"^8.41.0","@typescript-eslint/parser":"^8.41.0",prettier:"^3.2.5"},engines:{node:">=18.0.0"},publishConfig:{access:"public"}}});var _5=L((wT,K9)=>{var V9=J0("fs"),P5;function EK(){try{return V9.statSync("/.dockerenv"),!0}catch($){return!1}}function jK(){try{return V9.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch($){return!1}}K9.exports=()=>{if(P5===void 0)P5=EK()||jK();return P5}});var N9=L((FT,C5)=>{var bK=J0("os"),xK=J0("fs"),D9=_5(),B9=()=>{if(process.platform!=="linux")return!1;if(bK.release().toLowerCase().includes("microsoft")){if(D9())return!1;return!0}try{return xK.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!D9():!1}catch($){return!1}};if(process.env.__IS_WSL_TEST__)C5.exports=B9;else C5.exports=B9()});var L9=L((RT,I9)=>{I9.exports=($,Z,X)=>{let z=(J)=>Object.defineProperty($,Z,{value:J,enumerable:!0,writable:!0});return Object.defineProperty($,Z,{configurable:!0,enumerable:!0,get(){let J=X();return z(J),J},set(J){z(J)}}),$}});var A9=L((AT,R9)=>{var __dirname="/Users/wolfejam/FAF/cli/node_modules/open",kK=J0("path"),fK=J0("child_process"),{promises:L2,constants:F9}=J0("fs"),I2=N9(),yK=_5(),E5=L9(),T9=kK.join(__dirname,"xdg-open"),{platform:v$,arch:M9}=process,gK=()=>{try{return L2.statSync("/run/.containerenv"),!0}catch{return!1}},S5;function hK(){if(S5===void 0)S5=gK()||yK();return S5}var vK=(()=>{let Z;return async function(){if(Z)return Z;let X="/etc/wsl.conf",z=!1;try{await L2.access(X,F9.F_OK),z=!0}catch{}if(!z)return"/mnt/";let J=await L2.readFile(X,{encoding:"utf8"}),q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(J);if(!q)return"/mnt/";return Z=q.groups.mountPoint.trim(),Z=Z.endsWith("/")?Z:`${Z}/`,Z}})(),O9=async($,Z)=>{let X;for(let z of $)try{return await Z(z)}catch(J){X=J}throw X},T2=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return O9($.app,(Y)=>T2({...$,app:Y}));let{name:Z,arguments:X=[]}=$.app||{};if(X=[...X],Array.isArray(Z))return O9(Z,(Y)=>T2({...$,app:{name:Y,arguments:X}}));let z,J=[],q={};if(v$==="darwin"){if(z="open",$.wait)J.push("--wait-apps");if($.background)J.push("--background");if($.newInstance)J.push("--new");if(Z)J.push("-a",Z)}else if(v$==="win32"||I2&&!hK()&&!Z){let Y=await vK();if(z=I2?`${Y}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`,J.push("-NoProfile","-NonInteractive","–ExecutionPolicy","Bypass","-EncodedCommand"),!I2)q.windowsVerbatimArguments=!0;let G=["Start"];if($.wait)G.push("-Wait");if(Z){if(G.push(`"\`"${Z}\`""`,"-ArgumentList"),$.target)X.unshift($.target)}else if($.target)G.push(`"${$.target}"`);if(X.length>0)X=X.map((U)=>`"\`"${U}\`""`),G.push(X.join(","));$.target=Buffer.from(G.join(" "),"utf16le").toString("base64")}else{if(Z)z=Z;else{let Y=!__dirname||__dirname==="/",G=!1;try{await L2.access(T9,F9.X_OK),G=!0}catch{}z=process.versions.electron||v$==="android"||Y||!G?"xdg-open":T9}if(X.length>0)J.push(...X);if(!$.wait)q.stdio="ignore",q.detached=!0}if($.target)J.push($.target);if(v$==="darwin"&&X.length>0)J.push("--args",...X);let Q=fK.spawn(z,J,q);if($.wait)return new Promise((Y,G)=>{Q.once("error",G),Q.once("close",(U)=>{if(!$.allowNonzeroExitCode&&U>0){G(Error(`Exited with code ${U}`));return}Y(Q)})});return Q.unref(),Q},j5=($,Z)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return T2({...Z,target:$})},uK=($,Z)=>{if(typeof $!=="string")throw TypeError("Expected a `name`");let{arguments:X=[]}=Z||{};if(X!==void 0&&X!==null&&!Array.isArray(X))throw TypeError("Expected `appArguments` as Array type");return T2({...Z,app:{name:$,arguments:X}})};function w9($){if(typeof $==="string"||Array.isArray($))return $;let{[M9]:Z}=$;if(!Z)throw Error(`${M9} is not supported`);return Z}function b5({[v$]:$},{wsl:Z}){if(Z&&I2)return w9(Z);if(!$)throw Error(`${v$} is not supported`);return w9($)}var M2={};E5(M2,"chrome",()=>b5({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));E5(M2,"firefox",()=>b5({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));E5(M2,"edge",()=>b5({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));j5.apps=M2;j5.openApp=uK;R9.exports=j5});function O($,Z,X,z,J){if(z==="m")throw TypeError("Private method is not writable");if(z==="a"&&!J)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return z==="a"?J.call($,X):J?J.value=X:Z.set($,X),X}function K($,Z,X,z){if(X==="a"&&!z)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!z:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?z:X==="a"?z.call($):z?z.value:Z.get($)}var j0=()=>{};var x5=function(){let{crypto:$}=globalThis;if($?.randomUUID)return x5=$.randomUUID.bind($),$.randomUUID();let Z=new Uint8Array(1),X=$?()=>$.getRandomValues(Z)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(z)=>(+z^X()&15>>+z/4).toString(16))};function b0($){return typeof $==="object"&&$!==null&&(("name"in $)&&$.name==="AbortError"||("message"in $)&&String($.message).includes("FetchRequestCanceledException"))}var v6=($)=>{if($ instanceof Error)return $;if(typeof $==="object"&&$!==null){try{if(Object.prototype.toString.call($)==="[object Error]"){let Z=Error($.message,$.cause?{cause:$.cause}:{});if($.stack)Z.stack=$.stack;if($.cause&&!Z.cause)Z.cause=$.cause;if($.name)Z.name=$.name;return Z}}catch{}try{return Error(JSON.stringify($))}catch{}}return Error($)};var A,e,Q0,s0,u$,m$,d$,c$,p$,l$,i$,n$,s$;var W0=j(()=>{A=class A extends Error{};e=class e extends A{constructor($,Z,X,z){super(`${e.makeMessage($,Z,X)}`);this.status=$,this.headers=z,this.requestID=z?.get("request-id"),this.error=Z}static makeMessage($,Z,X){let z=Z?.message?typeof Z.message==="string"?Z.message:JSON.stringify(Z.message):Z?JSON.stringify(Z):X;if($&&z)return`${$} ${z}`;if($)return`${$} status code (no body)`;if(z)return z;return"(no status code or body)"}static generate($,Z,X,z){if(!$||!z)return new s0({message:X,cause:v6(Z)});let J=Z;if($===400)return new m$($,J,X,z);if($===401)return new d$($,J,X,z);if($===403)return new c$($,J,X,z);if($===404)return new p$($,J,X,z);if($===409)return new l$($,J,X,z);if($===422)return new i$($,J,X,z);if($===429)return new n$($,J,X,z);if($>=500)return new s$($,J,X,z);return new e($,J,X,z)}};Q0=class Q0 extends e{constructor({message:$}={}){super(void 0,void 0,$||"Request was aborted.",void 0)}};s0=class s0 extends e{constructor({message:$,cause:Z}){super(void 0,void 0,$||"Connection error.",void 0);if(Z)this.cause=Z}};u$=class u$ extends s0{constructor({message:$}={}){super({message:$??"Request timed out."})}};m$=class m$ extends e{};d$=class d$ extends e{};c$=class c$ extends e{};p$=class p$ extends e{};l$=class l$ extends e{};i$=class i$ extends e{};n$=class n$ extends e{};s$=class s$ extends e{}});function O2($){if(typeof $!=="object")return{};return $??{}}function f9($){if(!$)return!0;for(let Z in $)return!1;return!0}function y9($,Z){return Object.prototype.hasOwnProperty.call($,Z)}var qD,k9=($)=>{return qD.test($)},k5=($)=>(k5=Array.isArray,k5($)),f5,g9=($,Z)=>{if(typeof Z!=="number"||!Number.isInteger(Z))throw new A(`${$} must be an integer`);if(Z<0)throw new A(`${$} must be a positive integer`);return Z},w2=($)=>{try{return JSON.parse($)}catch(Z){return}};var D$=j(()=>{W0();qD=/^[a-z][a-z0-9+.-]*:/i,f5=k5});var h9=($)=>new Promise((Z)=>setTimeout(Z,$));var r0="0.74.0";function QD(){if(typeof Deno<"u"&&Deno.build!=null)return"deno";if(typeof EdgeRuntime<"u")return"edge";if(Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]")return"node";return"unknown"}function GD(){if(typeof navigator>"u"||!navigator)return null;let $=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:Z,pattern:X}of $){let z=X.exec(navigator.userAgent);if(z){let J=z[1]||0,q=z[2]||0,Q=z[3]||0;return{browser:Z,version:`${J}.${q}.${Q}`}}}return null}var d9=()=>{return typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u"},YD=()=>{let $=QD();if($==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":u9(Deno.build.os),"X-Stainless-Arch":v9(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version==="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if($==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":u9(globalThis.process.platform??"unknown"),"X-Stainless-Arch":v9(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let Z=GD();if(Z)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${Z.browser}`,"X-Stainless-Runtime-Version":Z.version};return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":r0,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}},v9=($)=>{if($==="x32")return"x32";if($==="x86_64"||$==="x64")return"x64";if($==="arm")return"arm";if($==="aarch64"||$==="arm64")return"arm64";if($)return`other:${$}`;return"unknown"},u9=($)=>{if($=$.toLowerCase(),$.includes("ios"))return"iOS";if($==="android")return"Android";if($==="darwin")return"MacOS";if($==="win32")return"Windows";if($==="freebsd")return"FreeBSD";if($==="openbsd")return"OpenBSD";if($==="linux")return"Linux";if($)return`Other:${$}`;return"Unknown"},m9,c9=()=>{return m9??(m9=YD())};var y5=()=>{};function p9(){if(typeof fetch<"u")return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new Anthropic({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function g5(...$){let Z=globalThis.ReadableStream;if(typeof Z>"u")throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new Z(...$)}function F2($){let Z=Symbol.asyncIterator in $?$[Symbol.asyncIterator]():$[Symbol.iterator]();return g5({start(){},async pull(X){let{done:z,value:J}=await Z.next();if(z)X.close();else X.enqueue(J)},async cancel(){await Z.return?.()}})}function u6($){if($[Symbol.asyncIterator])return $;let Z=$.getReader();return{async next(){try{let X=await Z.read();if(X?.done)Z.releaseLock();return X}catch(X){throw Z.releaseLock(),X}},async return(){let X=Z.cancel();return Z.releaseLock(),await X,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function l9($){if($===null||typeof $!=="object")return;if($[Symbol.asyncIterator]){await $[Symbol.asyncIterator]().return?.();return}let Z=$.getReader(),X=Z.cancel();Z.releaseLock(),await X}var i9=({headers:$,body:Z})=>{return{bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(Z)}};function r9($){let Z=0;for(let J of $)Z+=J.length;let X=new Uint8Array(Z),z=0;for(let J of $)X.set(J,z),z+=J.length;return X}function m6($){let Z;return(n9??(Z=new globalThis.TextEncoder,n9=Z.encode.bind(Z)))($)}function h5($){let Z;return(s9??(Z=new globalThis.TextDecoder,s9=Z.decode.bind(Z)))($)}var n9,s9;class a0{constructor(){H0.set(this,void 0),V0.set(this,void 0),O(this,H0,new Uint8Array,"f"),O(this,V0,null,"f")}decode($){if($==null)return[];let Z=$ instanceof ArrayBuffer?new Uint8Array($):typeof $==="string"?m6($):$;O(this,H0,r9([K(this,H0,"f"),Z]),"f");let X=[],z;while((z=HD(K(this,H0,"f"),K(this,V0,"f")))!=null){if(z.carriage&&K(this,V0,"f")==null){O(this,V0,z.index,"f");continue}if(K(this,V0,"f")!=null&&(z.index!==K(this,V0,"f")+1||z.carriage)){X.push(h5(K(this,H0,"f").subarray(0,K(this,V0,"f")-1))),O(this,H0,K(this,H0,"f").subarray(K(this,V0,"f")),"f"),O(this,V0,null,"f");continue}let J=K(this,V0,"f")!==null?z.preceding-1:z.preceding,q=h5(K(this,H0,"f").subarray(0,J));X.push(q),O(this,H0,K(this,H0,"f").subarray(z.index),"f"),O(this,V0,null,"f")}return X}flush(){if(!K(this,H0,"f").length)return[];return this.decode(`
166
+ `)}}function HD($,Z){for(let J=Z??0;J<$.length;J++){if($[J]===10)return{preceding:J,index:J+1,carriage:!1};if($[J]===13)return{preceding:J,index:J+1,carriage:!0}}return null}function a9($){for(let z=0;z<$.length-1;z++){if($[z]===10&&$[z+1]===10)return z+2;if($[z]===13&&$[z+1]===13)return z+2;if($[z]===13&&$[z+1]===10&&z+3<$.length&&$[z+2]===13&&$[z+3]===10)return z+4}return-1}var H0,V0;var v5=j(()=>{j0();H0=new WeakMap,V0=new WeakMap;a0.NEWLINE_CHARS=new Set([`
167
+ `,"\r"]);a0.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function d6(){}function R2($,Z,X){if(!Z||A2[$]>A2[X])return d6;else return Z[$].bind(Z)}function q0($){let Z=$.logger,X=$.logLevel??"off";if(!Z)return VD;let z=o9.get(Z);if(z&&z[0]===X)return z[1];let J={error:R2("error",Z,X),warn:R2("warn",Z,X),info:R2("info",Z,X),debug:R2("debug",Z,X)};return o9.set(Z,[X,J]),J}var A2,u5=($,Z,X)=>{if(!$)return;if(y9(A2,$))return $;q0(X).warn(`${Z} was set to ${JSON.stringify($)}, expected one of ${JSON.stringify(Object.keys(A2))}`);return},VD,o9,x0=($)=>{if($.options)$.options={...$.options},delete $.options.headers;if($.headers)$.headers=Object.fromEntries(($.headers instanceof Headers?[...$.headers]:Object.entries($.headers)).map(([Z,X])=>[Z,Z.toLowerCase()==="x-api-key"||Z.toLowerCase()==="authorization"||Z.toLowerCase()==="cookie"||Z.toLowerCase()==="set-cookie"?"***":X]));if("retryOfRequestLogID"in $){if($.retryOfRequestLogID)$.retryOf=$.retryOfRequestLogID;delete $.retryOfRequestLogID}return $};var P2=j(()=>{D$();A2={off:0,error:200,warn:300,info:400,debug:500};VD={error:d6,warn:d6,info:d6,debug:d6},o9=new WeakMap});async function*KD($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new A("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new A("Attempted to iterate over a response with no body")}let X=new t9,z=new a0,J=u6($.body);for await(let q of DD(J))for(let Q of z.decode(q)){let Y=X.decode(Q);if(Y)yield Y}for(let q of z.flush()){let Q=X.decode(q);if(Q)yield Q}}async function*DD($){let Z=new Uint8Array;for await(let X of $){if(X==null)continue;let z=X instanceof ArrayBuffer?new Uint8Array(X):typeof X==="string"?m6(X):X,J=new Uint8Array(Z.length+z.length);J.set(Z),J.set(z,Z.length),Z=J;let q;while((q=a9(Z))!==-1)yield Z.slice(0,q),Z=Z.slice(q)}if(Z.length>0)yield Z}class t9{constructor(){this.event=null,this.data=[],this.chunks=[]}decode($){if($.endsWith("\r"))$=$.substring(0,$.length-1);if(!$){if(!this.event&&!this.data.length)return null;let J={event:this.event,data:this.data.join(`
168
+ `),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],J}if(this.chunks.push($),$.startsWith(":"))return null;let[Z,X,z]=BD($,":");if(z.startsWith(" "))z=z.substring(1);if(Z==="event")this.event=z;else if(Z==="data")this.data.push(z);return null}}function BD($,Z){let X=$.indexOf(Z);if(X!==-1)return[$.substring(0,X),Z,$.substring(X+Z.length)];return[$,"",""]}var c6,K0;var m5=j(()=>{j0();W0();v5();D$();P2();W0();K0=class K0{constructor($,Z,X){this.iterator=$,c6.set(this,void 0),this.controller=Z,O(this,c6,X,"f")}static fromSSEResponse($,Z,X){let z=!1,J=X?q0(X):console;async function*q(){if(z)throw new A("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Q=!1;try{for await(let Y of KD($,Z)){if(Y.event==="completion")try{yield JSON.parse(Y.data)}catch(G){throw J.error("Could not parse message into JSON:",Y.data),J.error("From chunk:",Y.raw),G}if(Y.event==="message_start"||Y.event==="message_delta"||Y.event==="message_stop"||Y.event==="content_block_start"||Y.event==="content_block_delta"||Y.event==="content_block_stop")try{yield JSON.parse(Y.data)}catch(G){throw J.error("Could not parse message into JSON:",Y.data),J.error("From chunk:",Y.raw),G}if(Y.event==="ping")continue;if(Y.event==="error")throw new e(void 0,w2(Y.data)??Y.data,void 0,$.headers)}Q=!0}catch(Y){if(b0(Y))return;throw Y}finally{if(!Q)Z.abort()}}return new K0(q,Z,X)}static fromReadableStream($,Z,X){let z=!1;async function*J(){let Q=new a0,Y=u6($);for await(let G of Y)for(let U of Q.decode(G))yield U;for(let G of Q.flush())yield G}async function*q(){if(z)throw new A("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");z=!0;let Q=!1;try{for await(let Y of J()){if(Q)continue;if(Y)yield JSON.parse(Y)}Q=!0}catch(Y){if(b0(Y))return;throw Y}finally{if(!Q)Z.abort()}}return new K0(q,Z,X)}[(c6=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let $=[],Z=[],X=this.iterator(),z=(J)=>{return{next:()=>{if(J.length===0){let q=X.next();$.push(q),Z.push(q)}return J.shift()}}};return[new K0(()=>z($),this.controller,K(this,c6,"f")),new K0(()=>z(Z),this.controller,K(this,c6,"f"))]}toReadableStream(){let $=this,Z;return g5({async start(){Z=$[Symbol.asyncIterator]()},async pull(X){try{let{value:z,done:J}=await Z.next();if(J)return X.close();let q=m6(JSON.stringify(z)+`
169
+ `);X.enqueue(q)}catch(z){X.error(z)}},async cancel(){await Z.return?.()}})}}});async function _2($,Z){let{response:X,requestLogID:z,retryOfRequestLogID:J,startTime:q}=Z,Q=await(async()=>{if(Z.options.stream){if(q0($).debug("response",X.status,X.url,X.headers,X.body),Z.options.__streamClass)return Z.options.__streamClass.fromSSEResponse(X,Z.controller);return K0.fromSSEResponse(X,Z.controller)}if(X.status===204)return null;if(Z.options.__binaryResponse)return X;let G=X.headers.get("content-type")?.split(";")[0]?.trim();if(G?.includes("application/json")||G?.endsWith("+json")){if(X.headers.get("content-length")==="0")return;let H=await X.json();return d5(H,X)}return await X.text()})();return q0($).debug(`[${z}] response parsed`,x0({retryOfRequestLogID:J,url:X.url,status:X.status,body:Q,durationMs:Date.now()-q})),Q}function d5($,Z){if(!$||typeof $!=="object"||Array.isArray($))return $;return Object.defineProperty($,"_request_id",{value:Z.headers.get("request-id"),enumerable:!1})}var c5=j(()=>{m5();P2()});var p6,o0;var C2=j(()=>{j0();c5();o0=class o0 extends Promise{constructor($,Z,X=_2){super((z)=>{z(null)});this.responsePromise=Z,this.parseResponse=X,p6.set(this,void 0),O(this,p6,$,"f")}_thenUnwrap($){return new o0(K(this,p6,"f"),this.responsePromise,async(Z,X)=>d5($(await this.parseResponse(Z,X),X),X.response))}asResponse(){return this.responsePromise.then(($)=>$.response)}async withResponse(){let[$,Z]=await Promise.all([this.parse(),this.asResponse()]);return{data:$,response:Z,request_id:Z.headers.get("request-id")}}parse(){if(!this.parsedPromise)this.parsedPromise=this.responsePromise.then(($)=>this.parseResponse(K(this,p6,"f"),$));return this.parsedPromise}then($,Z){return this.parse().then($,Z)}catch($){return this.parse().catch($)}finally($){return this.parse().finally($)}};p6=new WeakMap});var S2,p5,l6,w0,i6;var P0=j(()=>{j0();W0();c5();C2();D$();p5=class p5{constructor($,Z,X,z){S2.set(this,void 0),O(this,S2,$,"f"),this.options=z,this.response=Z,this.body=X}hasNextPage(){if(!this.getPaginatedItems().length)return!1;return this.nextPageRequestOptions()!=null}async getNextPage(){let $=this.nextPageRequestOptions();if(!$)throw new A("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await K(this,S2,"f").requestAPIList(this.constructor,$)}async*iterPages(){let $=this;yield $;while($.hasNextPage())$=await $.getNextPage(),yield $}async*[(S2=new WeakMap,Symbol.asyncIterator)](){for await(let $ of this.iterPages())for(let Z of $.getPaginatedItems())yield Z}};l6=class l6 extends o0{constructor($,Z,X){super($,Z,async(z,J)=>new X(z,J.response,await _2(z,J),J.options))}async*[Symbol.asyncIterator](){let $=await this;for await(let Z of $)yield Z}};w0=class w0 extends p5{constructor($,Z,X,z){super($,Z,X,z);this.data=X.data||[],this.has_more=X.has_more||!1,this.first_id=X.first_id||null,this.last_id=X.last_id||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){if(this.options.query?.before_id){let Z=this.first_id;if(!Z)return null;return{...this.options,query:{...O2(this.options.query),before_id:Z}}}let $=this.last_id;if(!$)return null;return{...this.options,query:{...O2(this.options.query),after_id:$}}}};i6=class i6 extends p5{constructor($,Z,X,z){super($,Z,X,z);this.data=X.data||[],this.has_more=X.has_more||!1,this.next_page=X.next_page||null}getPaginatedItems(){return this.data??[]}hasNextPage(){if(this.has_more===!1)return!1;return super.hasNextPage()}nextPageRequestOptions(){let $=this.next_page;if(!$)return null;return{...this.options,query:{...O2(this.options.query),page:$}}}}});function B$($,Z,X){return i5(),new File($,Z??"unknown_file",X)}function n6($,Z){let X=typeof $==="object"&&$!==null&&(("name"in $)&&$.name&&String($.name)||("url"in $)&&$.url&&String($.url)||("filename"in $)&&$.filename&&String($.filename)||("path"in $)&&$.path&&String($.path))||"";return Z?X.split(/[\\/]/).pop()||void 0:X}function ID($){let Z=typeof $==="function"?$:$.fetch,X=e9.get(Z);if(X)return X;let z=(async()=>{try{let J="Response"in Z?Z.Response:(await Z("data:,")).constructor,q=new FormData;if(q.toString()===await new J(q).text())return!1;return!0}catch{return!0}})();return e9.set(Z,z),z}var i5=()=>{if(typeof File>"u"){let{process:$}=globalThis,Z=typeof $?.versions?.node==="string"&&parseInt($.versions.node.split("."))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(Z?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}},n5=($)=>$!=null&&typeof $==="object"&&typeof $[Symbol.asyncIterator]==="function",r$=async($,Z,X=!0)=>{return{...$,body:await LD($.body,Z,X)}},e9,LD=async($,Z,X=!0)=>{if(!await ID(Z))throw TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let z=new FormData;return await Promise.all(Object.entries($||{}).map(([J,q])=>l5(z,J,q,X))),z},TD=($)=>$ instanceof Blob&&("name"in $),l5=async($,Z,X,z)=>{if(X===void 0)return;if(X==null)throw TypeError(`Received null for "${Z}"; to pass null in FormData, you must use the string 'null'`);if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")$.append(Z,String(X));else if(X instanceof Response){let J={},q=X.headers.get("Content-Type");if(q)J={type:q};$.append(Z,B$([await X.blob()],n6(X,z),J))}else if(n5(X))$.append(Z,B$([await new Response(F2(X)).blob()],n6(X,z)));else if(TD(X))$.append(Z,B$([X],n6(X,z),{type:X.type}));else if(Array.isArray(X))await Promise.all(X.map((J)=>l5($,Z+"[]",J,z)));else if(typeof X==="object")await Promise.all(Object.entries(X).map(([J,q])=>l5($,`${Z}[${J}]`,q,z)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${X} instead`)};var a$=j(()=>{e9=new WeakMap});async function s6($,Z,X){if(i5(),$=await $,Z||(Z=n6($,!0)),MD($)){if($ instanceof File&&Z==null&&X==null)return $;return B$([await $.arrayBuffer()],Z??$.name,{type:$.type,lastModified:$.lastModified,...X})}if(OD($)){let J=await $.blob();return Z||(Z=new URL($.url).pathname.split(/[\\/]/).pop()),B$(await s5(J),Z,X)}let z=await s5($);if(!X?.type){let J=z.find((q)=>typeof q==="object"&&("type"in q)&&q.type);if(typeof J==="string")X={...X,type:J}}return B$(z,Z,X)}async function s5($){let Z=[];if(typeof $==="string"||ArrayBuffer.isView($)||$ instanceof ArrayBuffer)Z.push($);else if($J($))Z.push($ instanceof Blob?$:await $.arrayBuffer());else if(n5($))for await(let X of $)Z.push(...await s5(X));else{let X=$?.constructor?.name;throw Error(`Unexpected data type: ${typeof $}${X?`; constructor: ${X}`:""}${wD($)}`)}return Z}function wD($){if(typeof $!=="object"||$===null)return"";return`; props: [${Object.getOwnPropertyNames($).map((X)=>`"${X}"`).join(", ")}]`}var $J=($)=>$!=null&&typeof $==="object"&&typeof $.size==="number"&&typeof $.type==="string"&&typeof $.text==="function"&&typeof $.slice==="function"&&typeof $.arrayBuffer==="function",MD=($)=>$!=null&&typeof $==="object"&&typeof $.name==="string"&&typeof $.lastModified==="number"&&$J($),OD=($)=>$!=null&&typeof $==="object"&&typeof $.url==="string"&&typeof $.blob==="function";var ZJ=j(()=>{a$();a$()});var r5=j(()=>{ZJ()});var XJ=()=>{};class n{constructor($){this._client=$}}function*RD($){if(!$)return;if(zJ in $){let{values:z,nulls:J}=$;yield*z.entries();for(let q of J)yield[q,null];return}let Z=!1,X;if($ instanceof Headers)X=$.entries();else if(f5($))X=$;else Z=!0,X=Object.entries($??{});for(let z of X){let J=z[0];if(typeof J!=="string")throw TypeError("expected header name to be a string");let q=f5(z[1])?z[1]:[z[1]],Q=!1;for(let Y of q){if(Y===void 0)continue;if(Z&&!Q)Q=!0,yield[J,null];yield[J,Y]}}}var zJ,S=($)=>{let Z=new Headers,X=new Set;for(let z of $){let J=new Set;for(let[q,Q]of RD(z)){let Y=q.toLowerCase();if(!J.has(Y))Z.delete(q),J.add(Y);if(Q===null)Z.delete(q),X.add(Y);else Z.append(q,Q),X.delete(Y)}}return{[zJ]:!0,values:Z,nulls:X}};var D0=j(()=>{D$();zJ=Symbol.for("brand.privateNullableHeaders")});function E2($){return typeof $==="object"&&$!==null&&r6 in $}function a5($,Z){let X=new Set;if($){for(let z of $)if(E2(z))X.add(z[r6])}if(Z)for(let z of Z){if(E2(z))X.add(z[r6]);if(Array.isArray(z.content)){for(let J of z.content)if(E2(J))X.add(J[r6])}}return Array.from(X)}function j2($,Z){let X=a5($,Z);if(X.length===0)return{};return{"x-stainless-helper":X.join(", ")}}function JJ($){if(E2($))return{"x-stainless-helper":$[r6]};return{}}var r6;var a6=j(()=>{r6=Symbol("anthropic.sdk.stainlessHelper")});function QJ($){return $.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var qJ,AD=($=QJ)=>function(X,...z){if(X.length===1)return X[0];let J=!1,q=[],Q=X.reduce((W,V,H)=>{if(/[?#]/.test(V))J=!0;let B=z[H],M=(J?encodeURIComponent:$)(""+B);if(H!==z.length&&(B==null||typeof B==="object"&&B.toString===Object.getPrototypeOf(Object.getPrototypeOf(B.hasOwnProperty??qJ)??qJ)?.toString))M=B+"",q.push({start:W.length+V.length,length:M.length,error:`Value of type ${Object.prototype.toString.call(B).slice(8,-1)} is not a valid path parameter`});return W+V+(H===z.length?"":M)},""),Y=Q.split(/[?#]/,1)[0],G=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,U;while((U=G.exec(Y))!==null)q.push({start:U.index,length:U[0].length,error:`Value "${U[0]}" can't be safely passed as a path parameter`});if(q.sort((W,V)=>W.start-V.start),q.length>0){let W=0,V=q.reduce((H,B)=>{let M=" ".repeat(B.start-W),D="^".repeat(B.length);return W=B.start+B.length,H+M+D},"");throw new A(`Path parameters result in path with invalid segments:
170
170
  ${q.map((H)=>H.error).join(`
171
171
  `)}
172
172
  ${Q}
173
- ${V}`)}return Q},p;var t0=j(()=>{W0();zJ=Object.freeze(Object.create(null)),p=RB(JJ)});var o6;var o5=j(()=>{P0();B0();a6();a$();t0();o6=class o6 extends i{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files",w0,{query:z,...Z,headers:E([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(p`/v1/files/${$}`,{...X,headers:E([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(p`/v1/files/${$}/content`,{...X,headers:E([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},X?.headers]),__binaryResponse:!0})}retrieveMetadata($,Z={},X){let{betas:z}=Z??{};return this._client.get(p`/v1/files/${$}`,{...X,headers:E([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}upload($,Z){let{betas:X,...z}=$;return this._client.post("/v1/files",r$({body:z,...Z,headers:E([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},XJ(z.file),Z?.headers])},this._client))}}});var t6;var t5=j(()=>{P0();B0();t0();t6=class t6 extends i{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(p`/v1/models/${$}?beta=true`,{...X,headers:E([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models?beta=true",w0,{query:z,...Z,headers:E([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var o$=j(()=>{W0()});var b2;var e5=j(()=>{b2={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function qJ($){return $?.output_format??$?.output_config?.format}function $4($,Z,X){let z=qJ(Z);if(!Z||!("parse"in(z??{})))return{...$,content:$.content.map((J)=>{if(J.type==="text"){let q=Object.defineProperty({...J},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(q,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return J}),parsed_output:null};return Z4($,Z,X)}function Z4($,Z,X){let z=null,J=$.content.map((q)=>{if(q.type==="text"){let Q=SB(Z,q.text);if(z===null)z=Q;let Y=Object.defineProperty({...q},"parsed_output",{value:Q,enumerable:!1});return Object.defineProperty(Y,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),Q},enumerable:!1})}return q});return{...$,content:J,parsed_output:z}}function SB($,Z){let X=qJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new A(`Failed to parse structured output: ${z}`)}}var X4=j(()=>{W0()});var _B=($)=>{let Z=0,X=[];while(Z<$.length){let z=$[Z];if(z==="\\"){Z++;continue}if(z==="{"){X.push({type:"brace",value:"{"}),Z++;continue}if(z==="}"){X.push({type:"brace",value:"}"}),Z++;continue}if(z==="["){X.push({type:"paren",value:"["}),Z++;continue}if(z==="]"){X.push({type:"paren",value:"]"}),Z++;continue}if(z===":"){X.push({type:"separator",value:":"}),Z++;continue}if(z===","){X.push({type:"delimiter",value:","}),Z++;continue}if(z==='"'){let Y="",G=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){G=!0;break}if(z==="\\"){if(Z++,Z===$.length){G=!0;break}Y+=z+$[Z],z=$[++Z]}else Y+=z,z=$[++Z]}if(z=$[++Z],!G)X.push({type:"string",value:Y});continue}if(z&&/\s/.test(z)){Z++;continue}let q=/[0-9]/;if(z&&q.test(z)||z==="-"||z==="."){let Y="";if(z==="-")Y+=z,z=$[++Z];while(z&&q.test(z)||z===".")Y+=z,z=$[++Z];X.push({type:"number",value:Y});continue}let Q=/[a-z]/i;if(z&&Q.test(z)){let Y="";while(z&&Q.test(z)){if(Z===$.length)break;Y+=z,z=$[++Z]}if(Y=="true"||Y=="false"||Y==="null")X.push({type:"name",value:Y});else{Z++;continue}continue}Z++}return X},t$=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),t$($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),t$($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),t$($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),t$($);break;case"delimiter":return $=$.slice(0,$.length-1),t$($);break}return $},CB=($)=>{let Z=[];if($.map((X)=>{if(X.type==="brace")if(X.value==="{")Z.push("}");else Z.splice(Z.lastIndexOf("}"),1);if(X.type==="paren")if(X.value==="[")Z.push("]");else Z.splice(Z.lastIndexOf("]"),1)}),Z.length>0)Z.reverse().map((X)=>{if(X==="}")$.push({type:"brace",value:"}"});else if(X==="]")$.push({type:"paren",value:"]"})});return $},EB=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},x2=($)=>JSON.parse(EB(CB(t$(_B($)))));var z4=()=>{};var J4=j(()=>{m5()});function UJ($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function WJ($){}var L0,e0,e$,e6,k2,$8,Z8,f2,X8,k0,z8,y2,g2,N$,h2,v2,J8,q4,QJ,u2,Q4,Y4,G4,YJ,GJ="__json_buf",q8;var HJ=j(()=>{j0();z4();o$();J4();X4();q8=class q8{constructor($,Z){L0.add(this),this.messages=[],this.receivedMessages=[],e0.set(this,void 0),e$.set(this,null),this.controller=new AbortController,e6.set(this,void 0),k2.set(this,()=>{}),$8.set(this,()=>{}),Z8.set(this,void 0),f2.set(this,()=>{}),X8.set(this,()=>{}),k0.set(this,{}),z8.set(this,!1),y2.set(this,!1),g2.set(this,!1),N$.set(this,!1),h2.set(this,void 0),v2.set(this,void 0),J8.set(this,void 0),u2.set(this,(X)=>{if(O(this,y2,!0,"f"),b0(X))X=new Q0;if(X instanceof Q0)return O(this,g2,!0,"f"),this._emit("abort",X);if(X instanceof A)return this._emit("error",X);if(X instanceof Error){let z=new A(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new A(String(X)))}),O(this,e6,new Promise((X,z)=>{O(this,k2,X,"f"),O(this,$8,z,"f")}),"f"),O(this,Z8,new Promise((X,z)=>{O(this,f2,X,"f"),O(this,X8,z,"f")}),"f"),K(this,e6,"f").catch(()=>{}),K(this,Z8,"f").catch(()=>{}),O(this,e$,$,"f"),O(this,J8,Z?.logger??console,"f")}get response(){return K(this,h2,"f")}get request_id(){return K(this,v2,"f")}async withResponse(){O(this,N$,!0,"f");let $=await K(this,e6,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new q8(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new q8(Z,{logger:z});for(let q of Z.messages)J._addMessageParam(q);return O(J,e$,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,u2,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,X){let z=X?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{K(this,L0,"m",Q4).call(this);let{response:q,data:Q}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(q);for await(let Y of Q)K(this,L0,"m",Y4).call(this,Y);if(Q.controller.signal?.aborted)throw new Q0;K(this,L0,"m",G4).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;O(this,h2,$,"f"),O(this,v2,$?.headers.get("request-id"),"f"),K(this,k2,"f").call(this,$),this._emit("connect")}get ended(){return K(this,z8,"f")}get errored(){return K(this,y2,"f")}get aborted(){return K(this,g2,"f")}abort(){this.controller.abort()}on($,Z){return(K(this,k0,"f")[$]||(K(this,k0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=K(this,k0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(K(this,k0,"f")[$]||(K(this,k0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(O(this,N$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){O(this,N$,!0,"f"),await K(this,Z8,"f")}get currentMessage(){return K(this,e0,"f")}async finalMessage(){return await this.done(),K(this,L0,"m",q4).call(this)}async finalText(){return await this.done(),K(this,L0,"m",QJ).call(this)}_emit($,...Z){if(K(this,z8,"f"))return;if($==="end")O(this,z8,!0,"f"),K(this,f2,"f").call(this);let X=K(this,k0,"f")[$];if(X)K(this,k0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!K(this,N$,"f")&&!X?.length)Promise.reject(z);K(this,$8,"f").call(this,z),K(this,X8,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!K(this,N$,"f")&&!X?.length)Promise.reject(z);K(this,$8,"f").call(this,z),K(this,X8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,L0,"m",q4).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{K(this,L0,"m",Q4).call(this),this._connected(null);let J=K0.fromReadableStream($,this.controller);for await(let q of J)K(this,L0,"m",Y4).call(this,q);if(J.controller.signal?.aborted)throw new Q0;K(this,L0,"m",G4).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(e0=new WeakMap,e$=new WeakMap,e6=new WeakMap,k2=new WeakMap,$8=new WeakMap,Z8=new WeakMap,f2=new WeakMap,X8=new WeakMap,k0=new WeakMap,z8=new WeakMap,y2=new WeakMap,g2=new WeakMap,N$=new WeakMap,h2=new WeakMap,v2=new WeakMap,J8=new WeakMap,u2=new WeakMap,L0=new WeakSet,q4=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},QJ=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if(Z.length===0)throw new A("stream ended without producing a content block with type=text");return Z.join(" ")},Q4=function(){if(this.ended)return;O(this,e0,void 0,"f")},Y4=function(Z){if(this.ended)return;let X=K(this,L0,"m",YJ).call(this,Z);switch(this._emit("streamEvent",Z,X),Z.type){case"content_block_delta":{let z=X.content.at(-1);switch(Z.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",Z.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",Z.delta.citation,z.citations??[]);break}case"input_json_delta":{if(UJ(z)&&z.input)this._emit("inputJson",Z.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",Z.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}case"compaction_delta":{if(z.type==="compaction"&&z.content)this._emit("compaction",z.content);break}default:WJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage($4(X,K(this,e$,"f"),{logger:K(this,J8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{O(this,e0,X,"f");break}case"content_block_start":case"message_delta":break}},G4=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");let Z=K(this,e0,"f");if(!Z)throw new A("request ended without sending any chunks");return O(this,e0,void 0,"f"),$4(Z,K(this,e$,"f"),{logger:K(this,J8,"f")})},YJ=function(Z){let X=K(this,e0,"f");if(Z.type==="message_start"){if(X)throw new A(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new A(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return X;case"message_delta":if(X.container=Z.delta.container,X.stop_reason=Z.delta.stop_reason,X.stop_sequence=Z.delta.stop_sequence,X.usage.output_tokens=Z.usage.output_tokens,X.context_management=Z.context_management,Z.usage.input_tokens!=null)X.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)X.usage.server_tool_use=Z.usage.server_tool_use;if(Z.usage.iterations!=null)X.usage.iterations=Z.usage.iterations;return X;case"content_block_start":return X.content.push(Z.content_block),X;case"content_block_delta":{let z=X.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(z?.type==="text")X.content[Z.index]={...z,text:(z.text||"")+Z.delta.text};break}case"citations_delta":{if(z?.type==="text")X.content[Z.index]={...z,citations:[...z.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(z&&UJ(z)){let J=z[GJ]||"";J+=Z.delta.partial_json;let q={...z};if(Object.defineProperty(q,GJ,{value:J,enumerable:!1,writable:!0}),J)try{q.input=x2(J)}catch(Q){let Y=new A(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Q}. JSON: ${J}`);K(this,u2,"f").call(this,Y)}X.content[Z.index]=q}break}case"thinking_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,thinking:z.thinking+Z.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,signature:Z.delta.signature};break}case"compaction_delta":{if(z?.type==="compaction")X.content[Z.index]={...z,content:(z.content||"")+Z.delta.content};break}default:WJ(Z.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let $=[],Z=[],X=!1;return this.on("streamEvent",(z)=>{let J=Z.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{X=!0;for(let z of Z)z.resolve(void 0);Z.length=0}),this.on("abort",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),this.on("error",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),{next:async()=>{if(!$.length){if(X)return{value:void 0,done:!0};return new Promise((J,q)=>Z.push({resolve:J,reject:q})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new K0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var $6;var m2=j(()=>{$6=class $6 extends Error{constructor($){let Z=typeof $==="string"?$:$.map((X)=>{if(X.type==="text")return X.text;return`[${X.type}]`}).join(" ");super(Z);this.name="ToolError",this.content=$}}});var VJ=1e5,KJ=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
173
+ ${V}`)}return Q},l;var t0=j(()=>{W0();qJ=Object.freeze(Object.create(null)),l=AD(QJ)});var o6;var o5=j(()=>{P0();D0();a6();a$();t0();o6=class o6 extends n{list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/files",w0,{query:z,...Z,headers:S([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(l`/v1/files/${$}`,{...X,headers:S([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}download($,Z={},X){let{betas:z}=Z??{};return this._client.get(l`/v1/files/${$}/content`,{...X,headers:S([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString(),Accept:"application/binary"},X?.headers]),__binaryResponse:!0})}retrieveMetadata($,Z={},X){let{betas:z}=Z??{};return this._client.get(l`/v1/files/${$}`,{...X,headers:S([{"anthropic-beta":[...z??[],"files-api-2025-04-14"].toString()},X?.headers])})}upload($,Z){let{betas:X,...z}=$;return this._client.post("/v1/files",r$({body:z,...Z,headers:S([{"anthropic-beta":[...X??[],"files-api-2025-04-14"].toString()},JJ(z.file),Z?.headers])},this._client))}}});var t6;var t5=j(()=>{P0();D0();t0();t6=class t6 extends n{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(l`/v1/models/${$}?beta=true`,{...X,headers:S([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models?beta=true",w0,{query:z,...Z,headers:S([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var o$=j(()=>{W0()});var b2;var e5=j(()=>{b2={"claude-opus-4-20250514":8192,"claude-opus-4-0":8192,"claude-4-opus-20250514":8192,"anthropic.claude-opus-4-20250514-v1:0":8192,"claude-opus-4@20250514":8192,"claude-opus-4-1-20250805":8192,"anthropic.claude-opus-4-1-20250805-v1:0":8192,"claude-opus-4-1@20250805":8192}});function YJ($){return $?.output_format??$?.output_config?.format}function $4($,Z,X){let z=YJ(Z);if(!Z||!("parse"in(z??{})))return{...$,content:$.content.map((J)=>{if(J.type==="text"){let q=Object.defineProperty({...J},"parsed_output",{value:null,enumerable:!1});return Object.defineProperty(q,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),null},enumerable:!1})}return J}),parsed_output:null};return Z4($,Z,X)}function Z4($,Z,X){let z=null,J=$.content.map((q)=>{if(q.type==="text"){let Q=CD(Z,q.text);if(z===null)z=Q;let Y=Object.defineProperty({...q},"parsed_output",{value:Q,enumerable:!1});return Object.defineProperty(Y,"parsed",{get(){return X.logger.warn("The `parsed` property on `text` blocks is deprecated, please use `parsed_output` instead."),Q},enumerable:!1})}return q});return{...$,content:J,parsed_output:z}}function CD($,Z){let X=YJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new A(`Failed to parse structured output: ${z}`)}}var X4=j(()=>{W0()});var SD=($)=>{let Z=0,X=[];while(Z<$.length){let z=$[Z];if(z==="\\"){Z++;continue}if(z==="{"){X.push({type:"brace",value:"{"}),Z++;continue}if(z==="}"){X.push({type:"brace",value:"}"}),Z++;continue}if(z==="["){X.push({type:"paren",value:"["}),Z++;continue}if(z==="]"){X.push({type:"paren",value:"]"}),Z++;continue}if(z===":"){X.push({type:"separator",value:":"}),Z++;continue}if(z===","){X.push({type:"delimiter",value:","}),Z++;continue}if(z==='"'){let Y="",G=!1;z=$[++Z];while(z!=='"'){if(Z===$.length){G=!0;break}if(z==="\\"){if(Z++,Z===$.length){G=!0;break}Y+=z+$[Z],z=$[++Z]}else Y+=z,z=$[++Z]}if(z=$[++Z],!G)X.push({type:"string",value:Y});continue}if(z&&/\s/.test(z)){Z++;continue}let q=/[0-9]/;if(z&&q.test(z)||z==="-"||z==="."){let Y="";if(z==="-")Y+=z,z=$[++Z];while(z&&q.test(z)||z===".")Y+=z,z=$[++Z];X.push({type:"number",value:Y});continue}let Q=/[a-z]/i;if(z&&Q.test(z)){let Y="";while(z&&Q.test(z)){if(Z===$.length)break;Y+=z,z=$[++Z]}if(Y=="true"||Y=="false"||Y==="null")X.push({type:"name",value:Y});else{Z++;continue}continue}Z++}return X},t$=($)=>{if($.length===0)return $;let Z=$[$.length-1];switch(Z.type){case"separator":return $=$.slice(0,$.length-1),t$($);break;case"number":let X=Z.value[Z.value.length-1];if(X==="."||X==="-")return $=$.slice(0,$.length-1),t$($);case"string":let z=$[$.length-2];if(z?.type==="delimiter")return $=$.slice(0,$.length-1),t$($);else if(z?.type==="brace"&&z.value==="{")return $=$.slice(0,$.length-1),t$($);break;case"delimiter":return $=$.slice(0,$.length-1),t$($);break}return $},ED=($)=>{let Z=[];if($.map((X)=>{if(X.type==="brace")if(X.value==="{")Z.push("}");else Z.splice(Z.lastIndexOf("}"),1);if(X.type==="paren")if(X.value==="[")Z.push("]");else Z.splice(Z.lastIndexOf("]"),1)}),Z.length>0)Z.reverse().map((X)=>{if(X==="}")$.push({type:"brace",value:"}"});else if(X==="]")$.push({type:"paren",value:"]"})});return $},jD=($)=>{let Z="";return $.map((X)=>{switch(X.type){case"string":Z+='"'+X.value+'"';break;default:Z+=X.value;break}}),Z},x2=($)=>JSON.parse(jD(ED(t$(SD($)))));var z4=()=>{};var J4=j(()=>{m5()});function HJ($){return $.type==="tool_use"||$.type==="server_tool_use"||$.type==="mcp_tool_use"}function VJ($){}var L0,e0,e$,e6,k2,$8,Z8,f2,X8,k0,z8,y2,g2,N$,h2,v2,J8,q4,GJ,u2,Q4,Y4,G4,UJ,WJ="__json_buf",q8;var KJ=j(()=>{j0();z4();o$();J4();X4();q8=class q8{constructor($,Z){L0.add(this),this.messages=[],this.receivedMessages=[],e0.set(this,void 0),e$.set(this,null),this.controller=new AbortController,e6.set(this,void 0),k2.set(this,()=>{}),$8.set(this,()=>{}),Z8.set(this,void 0),f2.set(this,()=>{}),X8.set(this,()=>{}),k0.set(this,{}),z8.set(this,!1),y2.set(this,!1),g2.set(this,!1),N$.set(this,!1),h2.set(this,void 0),v2.set(this,void 0),J8.set(this,void 0),u2.set(this,(X)=>{if(O(this,y2,!0,"f"),b0(X))X=new Q0;if(X instanceof Q0)return O(this,g2,!0,"f"),this._emit("abort",X);if(X instanceof A)return this._emit("error",X);if(X instanceof Error){let z=new A(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new A(String(X)))}),O(this,e6,new Promise((X,z)=>{O(this,k2,X,"f"),O(this,$8,z,"f")}),"f"),O(this,Z8,new Promise((X,z)=>{O(this,f2,X,"f"),O(this,X8,z,"f")}),"f"),K(this,e6,"f").catch(()=>{}),K(this,Z8,"f").catch(()=>{}),O(this,e$,$,"f"),O(this,J8,Z?.logger??console,"f")}get response(){return K(this,h2,"f")}get request_id(){return K(this,v2,"f")}async withResponse(){O(this,N$,!0,"f");let $=await K(this,e6,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new q8(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new q8(Z,{logger:z});for(let q of Z.messages)J._addMessageParam(q);return O(J,e$,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,u2,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,X){let z=X?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{K(this,L0,"m",Q4).call(this);let{response:q,data:Q}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(q);for await(let Y of Q)K(this,L0,"m",Y4).call(this,Y);if(Q.controller.signal?.aborted)throw new Q0;K(this,L0,"m",G4).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;O(this,h2,$,"f"),O(this,v2,$?.headers.get("request-id"),"f"),K(this,k2,"f").call(this,$),this._emit("connect")}get ended(){return K(this,z8,"f")}get errored(){return K(this,y2,"f")}get aborted(){return K(this,g2,"f")}abort(){this.controller.abort()}on($,Z){return(K(this,k0,"f")[$]||(K(this,k0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=K(this,k0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(K(this,k0,"f")[$]||(K(this,k0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(O(this,N$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){O(this,N$,!0,"f"),await K(this,Z8,"f")}get currentMessage(){return K(this,e0,"f")}async finalMessage(){return await this.done(),K(this,L0,"m",q4).call(this)}async finalText(){return await this.done(),K(this,L0,"m",GJ).call(this)}_emit($,...Z){if(K(this,z8,"f"))return;if($==="end")O(this,z8,!0,"f"),K(this,f2,"f").call(this);let X=K(this,k0,"f")[$];if(X)K(this,k0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!K(this,N$,"f")&&!X?.length)Promise.reject(z);K(this,$8,"f").call(this,z),K(this,X8,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!K(this,N$,"f")&&!X?.length)Promise.reject(z);K(this,$8,"f").call(this,z),K(this,X8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,L0,"m",q4).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{K(this,L0,"m",Q4).call(this),this._connected(null);let J=K0.fromReadableStream($,this.controller);for await(let q of J)K(this,L0,"m",Y4).call(this,q);if(J.controller.signal?.aborted)throw new Q0;K(this,L0,"m",G4).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(e0=new WeakMap,e$=new WeakMap,e6=new WeakMap,k2=new WeakMap,$8=new WeakMap,Z8=new WeakMap,f2=new WeakMap,X8=new WeakMap,k0=new WeakMap,z8=new WeakMap,y2=new WeakMap,g2=new WeakMap,N$=new WeakMap,h2=new WeakMap,v2=new WeakMap,J8=new WeakMap,u2=new WeakMap,L0=new WeakSet,q4=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},GJ=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if(Z.length===0)throw new A("stream ended without producing a content block with type=text");return Z.join(" ")},Q4=function(){if(this.ended)return;O(this,e0,void 0,"f")},Y4=function(Z){if(this.ended)return;let X=K(this,L0,"m",UJ).call(this,Z);switch(this._emit("streamEvent",Z,X),Z.type){case"content_block_delta":{let z=X.content.at(-1);switch(Z.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",Z.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",Z.delta.citation,z.citations??[]);break}case"input_json_delta":{if(HJ(z)&&z.input)this._emit("inputJson",Z.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",Z.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}case"compaction_delta":{if(z.type==="compaction"&&z.content)this._emit("compaction",z.content);break}default:VJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage($4(X,K(this,e$,"f"),{logger:K(this,J8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{O(this,e0,X,"f");break}case"content_block_start":case"message_delta":break}},G4=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");let Z=K(this,e0,"f");if(!Z)throw new A("request ended without sending any chunks");return O(this,e0,void 0,"f"),$4(Z,K(this,e$,"f"),{logger:K(this,J8,"f")})},UJ=function(Z){let X=K(this,e0,"f");if(Z.type==="message_start"){if(X)throw new A(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new A(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return X;case"message_delta":if(X.container=Z.delta.container,X.stop_reason=Z.delta.stop_reason,X.stop_sequence=Z.delta.stop_sequence,X.usage.output_tokens=Z.usage.output_tokens,X.context_management=Z.context_management,Z.usage.input_tokens!=null)X.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)X.usage.server_tool_use=Z.usage.server_tool_use;if(Z.usage.iterations!=null)X.usage.iterations=Z.usage.iterations;return X;case"content_block_start":return X.content.push(Z.content_block),X;case"content_block_delta":{let z=X.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(z?.type==="text")X.content[Z.index]={...z,text:(z.text||"")+Z.delta.text};break}case"citations_delta":{if(z?.type==="text")X.content[Z.index]={...z,citations:[...z.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(z&&HJ(z)){let J=z[WJ]||"";J+=Z.delta.partial_json;let q={...z};if(Object.defineProperty(q,WJ,{value:J,enumerable:!1,writable:!0}),J)try{q.input=x2(J)}catch(Q){let Y=new A(`Unable to parse tool parameter JSON from model. Please retry your request or adjust your prompt. Error: ${Q}. JSON: ${J}`);K(this,u2,"f").call(this,Y)}X.content[Z.index]=q}break}case"thinking_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,thinking:z.thinking+Z.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,signature:Z.delta.signature};break}case"compaction_delta":{if(z?.type==="compaction")X.content[Z.index]={...z,content:(z.content||"")+Z.delta.content};break}default:VJ(Z.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let $=[],Z=[],X=!1;return this.on("streamEvent",(z)=>{let J=Z.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{X=!0;for(let z of Z)z.resolve(void 0);Z.length=0}),this.on("abort",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),this.on("error",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),{next:async()=>{if(!$.length){if(X)return{value:void 0,done:!0};return new Promise((J,q)=>Z.push({resolve:J,reject:q})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new K0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var $6;var m2=j(()=>{$6=class $6 extends Error{constructor($){let Z=typeof $==="string"?$:$.map((X)=>{if(X.type==="text")return X.text;return`[${X.type}]`}).join(" ");super(Z);this.name="ToolError",this.content=$}}});var DJ=1e5,BJ=`You have been working on the task described above but have not yet completed it. Write a continuation summary that will allow you (or another instance of yourself) to resume work efficiently in a future context window where the conversation history will be replaced with this summary. Your summary should be structured, concise, and actionable. Include:
174
174
  1. Task Overview
175
175
  The user's core request and success criteria
176
176
  Any clarifications or constraints they specified
@@ -192,64 +192,64 @@ User preferences or style requirements
192
192
  Domain-specific details that aren't obvious
193
193
  Any promises made to the user
194
194
  Be concise but complete—err on the side of including information that would prevent duplicate work or repeated mistakes. Write in a way that enables immediate resumption of the task.
195
- Wrap your summary in <summary></summary> tags.`;function DJ(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function jB($,Z=$.messages.at(-1)){if(!Z||Z.role!=="assistant"||!Z.content||typeof Z.content==="string")return null;let X=Z.content.filter((J)=>J.type==="tool_use");if(X.length===0)return null;return{role:"user",content:await Promise.all(X.map(async(J)=>{let q=$.tools.find((Q)=>("name"in Q?Q.name:Q.mcp_server_name)===J.name);if(!q||!("run"in q))return{type:"tool_result",tool_use_id:J.id,content:`Error: Tool '${J.name}' not found`,is_error:!0};try{let Q=J.input;if("parse"in q&&q.parse)Q=q.parse(Q);let Y=await q.run(Q);return{type:"tool_result",tool_use_id:J.id,content:Y}}catch(Q){return{type:"tool_result",tool_use_id:J.id,content:Q instanceof $6?Q.content:`Error: ${Q instanceof Error?Q.message:String(Q)}`,is_error:!0}}}))}}var Q8,Z6,I$,z0,Y8,D0,f0,$$,G8,BJ,U4,U8;var W4=j(()=>{j0();m2();W0();B0();a6();U8=class U8{constructor($,Z,X){Q8.add(this),this.client=$,Z6.set(this,!1),I$.set(this,!1),z0.set(this,void 0),Y8.set(this,void 0),D0.set(this,void 0),f0.set(this,void 0),$$.set(this,void 0),G8.set(this,0),O(this,z0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...a5(Z.tools,Z.messages)].join(", ");O(this,Y8,{...X,headers:E([{"x-stainless-helper":J},X?.headers])},"f"),O(this,$$,DJ(),"f")}async*[(Z6=new WeakMap,I$=new WeakMap,z0=new WeakMap,Y8=new WeakMap,D0=new WeakMap,f0=new WeakMap,$$=new WeakMap,G8=new WeakMap,Q8=new WeakSet,BJ=async function(){let Z=K(this,z0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(K(this,D0,"f")!==void 0)try{let G=await K(this,D0,"f");X=G.usage.input_tokens+(G.usage.cache_creation_input_tokens??0)+(G.usage.cache_read_input_tokens??0)+G.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??VJ;if(X<z)return!1;let J=Z.model??K(this,z0,"f").params.model,q=Z.summaryPrompt??KJ,Q=K(this,z0,"f").params.messages;if(Q[Q.length-1].role==="assistant"){let G=Q[Q.length-1];if(Array.isArray(G.content)){let U=G.content.filter((W)=>W.type!=="tool_use");if(U.length===0)Q.pop();else G.content=U}}let Y=await this.client.beta.messages.create({model:J,messages:[...Q,{role:"user",content:[{type:"text",text:q}]}],max_tokens:K(this,z0,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(Y.content[0]?.type!=="text")throw new A("Expected text response for compaction");return K(this,z0,"f").params.messages=[{role:"user",content:Y.content}],!0},Symbol.asyncIterator)](){var $;if(K(this,Z6,"f"))throw new A("Cannot iterate over a consumed stream");O(this,Z6,!0,"f"),O(this,I$,!0,"f"),O(this,f0,void 0,"f");try{while(!0){let Z;try{if(K(this,z0,"f").params.max_iterations&&K(this,G8,"f")>=K(this,z0,"f").params.max_iterations)break;O(this,I$,!1,"f"),O(this,f0,void 0,"f"),O(this,G8,($=K(this,G8,"f"),$++,$),"f"),O(this,D0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=K(this,z0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},K(this,Y8,"f")),O(this,D0,Z.finalMessage(),"f"),K(this,D0,"f").catch(()=>{}),yield Z;else O(this,D0,this.client.beta.messages.create({...J,stream:!1},K(this,Y8,"f")),"f"),yield K(this,D0,"f");if(!await K(this,Q8,"m",BJ).call(this)){if(!K(this,I$,"f")){let{role:Y,content:G}=await K(this,D0,"f");K(this,z0,"f").params.messages.push({role:Y,content:G})}let Q=await K(this,Q8,"m",U4).call(this,K(this,z0,"f").params.messages.at(-1));if(Q)K(this,z0,"f").params.messages.push(Q);else if(!K(this,I$,"f"))break}}finally{if(Z)Z.abort()}}if(!K(this,D0,"f"))throw new A("ToolRunner concluded without a message from the server");K(this,$$,"f").resolve(await K(this,D0,"f"))}catch(Z){throw O(this,Z6,!1,"f"),K(this,$$,"f").promise.catch(()=>{}),K(this,$$,"f").reject(Z),O(this,$$,DJ(),"f"),Z}}setMessagesParams($){if(typeof $==="function")K(this,z0,"f").params=$(K(this,z0,"f").params);else K(this,z0,"f").params=$;O(this,I$,!0,"f"),O(this,f0,void 0,"f")}async generateToolResponse(){let $=await K(this,D0,"f")??this.params.messages.at(-1);if(!$)return null;return K(this,Q8,"m",U4).call(this,$)}done(){return K(this,$$,"f").promise}async runUntilDone(){if(!K(this,Z6,"f"))for await(let $ of this);return this.done()}get params(){return K(this,z0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};U4=async function(Z){if(K(this,f0,"f")!==void 0)return K(this,f0,"f");return O(this,f0,jB(K(this,z0,"f").params,Z),"f"),K(this,f0,"f")}});var X6;var H4=j(()=>{W0();v5();X6=class X6{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new a0;for await(let Z of this.iterator)for(let X of $.decode(Z))yield JSON.parse(X);for(let Z of $.flush())yield JSON.parse(Z)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new A("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new A("Attempted to iterate over a response with no body")}return new X6(u6($.body),Z)}}});var W8;var V4=j(()=>{P0();B0();H4();o$();t0();W8=class W8 extends i{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:E([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(p`/v1/messages/batches/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",w0,{query:z,...Z,headers:E([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(p`/v1/messages/batches/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(p`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}async results($,Z={},X){let z=await this.retrieve($);if(!z.results_url)throw new A(`No batch \`results_url\`; Has it finished processing? ${z.processing_status} - ${z.id}`);let{betas:J}=Z??{};return this._client.get(z.results_url,{...X,headers:E([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((q,Q)=>X6.fromResponse(Q.response,Q.controller))}}});function IJ($){if(!$.output_format)return $;if($.output_config?.format)throw new A("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:Z,...X}=$;return{...X,output_config:{...$.output_config,format:Z}}}var NJ,xB,Z$;var K4=j(()=>{o$();e5();B0();a6();X4();HJ();W4();m2();V4();V4();W4();m2();NJ={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},xB=["claude-opus-4-6"];Z$=class Z$ extends i{constructor(){super(...arguments);this.batches=new W8(this._client)}create($,Z){let X=IJ($),{betas:z,...J}=X;if(J.model in NJ)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${NJ[J.model]}
196
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(J.model in xB&&J.thinking&&J.thinking.type==="enabled")console.warn(`Using Claude with ${J.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let q=this._client._options.timeout;if(!J.stream&&q==null){let Y=b2[J.model]??void 0;q=this._client.calculateNonstreamingTimeout(J.max_tokens,Y)}let Q=j2(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:q??600000,...Z,headers:E([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Q,Z?.headers]),stream:X.stream??!1})}parse($,Z){return Z={...Z,headers:E([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((X)=>Z4(X,$,{logger:this._client.logger??console}))}stream($,Z){return q8.createMessage(this,$,Z)}countTokens($,Z){let X=IJ($),{betas:z,...J}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:E([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new U8(this._client,$,Z)}};Z$.Batches=W8;Z$.BetaToolRunner=U8;Z$.ToolError=$6});var H8;var B4=j(()=>{P0();B0();a$();t0();H8=class H8 extends i{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(p`/v1/skills/${$}/versions?beta=true`,r$({body:J,...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])},this._client))}retrieve($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.get(p`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(p`/v1/skills/${$}/versions?beta=true`,i6,{query:J,...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(p`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var z6;var D4=j(()=>{B4();B4();P0();B0();a$();t0();z6=class z6 extends i{constructor(){super(...arguments);this.versions=new H8(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",r$({body:z,...Z,headers:E([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(p`/v1/skills/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",i6,{query:z,...Z,headers:E([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(p`/v1/skills/${$}?beta=true`,{...X,headers:E([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};z6.Versions=H8});var S0;var N4=j(()=>{o5();o5();t5();t5();K4();K4();D4();D4();S0=class S0 extends i{constructor(){super(...arguments);this.models=new t6(this._client),this.messages=new Z$(this._client),this.files=new o6(this._client),this.skills=new z6(this._client)}};S0.Models=t6;S0.Messages=Z$;S0.Files=o6;S0.Skills=z6});var J6;var I4=j(()=>{B0();J6=class J6 extends i{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:E([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function LJ($){return $?.output_config?.format}function L4($,Z,X){let z=LJ(Z);if(!Z||!("parse"in(z??{})))return{...$,content:$.content.map((J)=>{if(J.type==="text")return Object.defineProperty({...J},"parsed_output",{value:null,enumerable:!1});return J}),parsed_output:null};return T4($,Z,X)}function T4($,Z,X){let z=null,J=$.content.map((q)=>{if(q.type==="text"){let Q=gB(Z,q.text);if(z===null)z=Q;return Object.defineProperty({...q},"parsed_output",{value:Q,enumerable:!1})}return q});return{...$,content:J,parsed_output:z}}function gB($,Z){let X=LJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new A(`Failed to parse structured output: ${z}`)}}var M4=j(()=>{W0()});function wJ($){return $.type==="tool_use"||$.type==="server_tool_use"}function FJ($){}var T0,X$,q6,V8,d2,K8,B8,c2,D8,y0,N8,p2,l2,L$,i2,n2,I8,O4,TJ,w4,F4,R4,A4,MJ,OJ="__json_buf",L8;var RJ=j(()=>{j0();o$();J4();z4();M4();L8=class L8{constructor($,Z){T0.add(this),this.messages=[],this.receivedMessages=[],X$.set(this,void 0),q6.set(this,null),this.controller=new AbortController,V8.set(this,void 0),d2.set(this,()=>{}),K8.set(this,()=>{}),B8.set(this,void 0),c2.set(this,()=>{}),D8.set(this,()=>{}),y0.set(this,{}),N8.set(this,!1),p2.set(this,!1),l2.set(this,!1),L$.set(this,!1),i2.set(this,void 0),n2.set(this,void 0),I8.set(this,void 0),w4.set(this,(X)=>{if(O(this,p2,!0,"f"),b0(X))X=new Q0;if(X instanceof Q0)return O(this,l2,!0,"f"),this._emit("abort",X);if(X instanceof A)return this._emit("error",X);if(X instanceof Error){let z=new A(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new A(String(X)))}),O(this,V8,new Promise((X,z)=>{O(this,d2,X,"f"),O(this,K8,z,"f")}),"f"),O(this,B8,new Promise((X,z)=>{O(this,c2,X,"f"),O(this,D8,z,"f")}),"f"),K(this,V8,"f").catch(()=>{}),K(this,B8,"f").catch(()=>{}),O(this,q6,$,"f"),O(this,I8,Z?.logger??console,"f")}get response(){return K(this,i2,"f")}get request_id(){return K(this,n2,"f")}async withResponse(){O(this,L$,!0,"f");let $=await K(this,V8,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new L8(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new L8(Z,{logger:z});for(let q of Z.messages)J._addMessageParam(q);return O(J,q6,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,w4,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,X){let z=X?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{K(this,T0,"m",F4).call(this);let{response:q,data:Q}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(q);for await(let Y of Q)K(this,T0,"m",R4).call(this,Y);if(Q.controller.signal?.aborted)throw new Q0;K(this,T0,"m",A4).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;O(this,i2,$,"f"),O(this,n2,$?.headers.get("request-id"),"f"),K(this,d2,"f").call(this,$),this._emit("connect")}get ended(){return K(this,N8,"f")}get errored(){return K(this,p2,"f")}get aborted(){return K(this,l2,"f")}abort(){this.controller.abort()}on($,Z){return(K(this,y0,"f")[$]||(K(this,y0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=K(this,y0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(K(this,y0,"f")[$]||(K(this,y0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(O(this,L$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){O(this,L$,!0,"f"),await K(this,B8,"f")}get currentMessage(){return K(this,X$,"f")}async finalMessage(){return await this.done(),K(this,T0,"m",O4).call(this)}async finalText(){return await this.done(),K(this,T0,"m",TJ).call(this)}_emit($,...Z){if(K(this,N8,"f"))return;if($==="end")O(this,N8,!0,"f"),K(this,c2,"f").call(this);let X=K(this,y0,"f")[$];if(X)K(this,y0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!K(this,L$,"f")&&!X?.length)Promise.reject(z);K(this,K8,"f").call(this,z),K(this,D8,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!K(this,L$,"f")&&!X?.length)Promise.reject(z);K(this,K8,"f").call(this,z),K(this,D8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,T0,"m",O4).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{K(this,T0,"m",F4).call(this),this._connected(null);let J=K0.fromReadableStream($,this.controller);for await(let q of J)K(this,T0,"m",R4).call(this,q);if(J.controller.signal?.aborted)throw new Q0;K(this,T0,"m",A4).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(X$=new WeakMap,q6=new WeakMap,V8=new WeakMap,d2=new WeakMap,K8=new WeakMap,B8=new WeakMap,c2=new WeakMap,D8=new WeakMap,y0=new WeakMap,N8=new WeakMap,p2=new WeakMap,l2=new WeakMap,L$=new WeakMap,i2=new WeakMap,n2=new WeakMap,I8=new WeakMap,w4=new WeakMap,T0=new WeakSet,O4=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},TJ=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if(Z.length===0)throw new A("stream ended without producing a content block with type=text");return Z.join(" ")},F4=function(){if(this.ended)return;O(this,X$,void 0,"f")},R4=function(Z){if(this.ended)return;let X=K(this,T0,"m",MJ).call(this,Z);switch(this._emit("streamEvent",Z,X),Z.type){case"content_block_delta":{let z=X.content.at(-1);switch(Z.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",Z.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",Z.delta.citation,z.citations??[]);break}case"input_json_delta":{if(wJ(z)&&z.input)this._emit("inputJson",Z.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",Z.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}default:FJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(L4(X,K(this,q6,"f"),{logger:K(this,I8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{O(this,X$,X,"f");break}case"content_block_start":case"message_delta":break}},A4=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");let Z=K(this,X$,"f");if(!Z)throw new A("request ended without sending any chunks");return O(this,X$,void 0,"f"),L4(Z,K(this,q6,"f"),{logger:K(this,I8,"f")})},MJ=function(Z){let X=K(this,X$,"f");if(Z.type==="message_start"){if(X)throw new A(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new A(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return X;case"message_delta":if(X.stop_reason=Z.delta.stop_reason,X.stop_sequence=Z.delta.stop_sequence,X.usage.output_tokens=Z.usage.output_tokens,Z.usage.input_tokens!=null)X.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)X.usage.server_tool_use=Z.usage.server_tool_use;return X;case"content_block_start":return X.content.push({...Z.content_block}),X;case"content_block_delta":{let z=X.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(z?.type==="text")X.content[Z.index]={...z,text:(z.text||"")+Z.delta.text};break}case"citations_delta":{if(z?.type==="text")X.content[Z.index]={...z,citations:[...z.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(z&&wJ(z)){let J=z[OJ]||"";J+=Z.delta.partial_json;let q={...z};if(Object.defineProperty(q,OJ,{value:J,enumerable:!1,writable:!0}),J)q.input=x2(J);X.content[Z.index]=q}break}case"thinking_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,thinking:z.thinking+Z.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,signature:Z.delta.signature};break}default:FJ(Z.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let $=[],Z=[],X=!1;return this.on("streamEvent",(z)=>{let J=Z.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{X=!0;for(let z of Z)z.resolve(void 0);Z.length=0}),this.on("abort",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),this.on("error",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),{next:async()=>{if(!$.length){if(X)return{value:void 0,done:!0};return new Promise((J,q)=>Z.push({resolve:J,reject:q})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new K0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var T8;var P4=j(()=>{P0();B0();H4();o$();t0();T8=class T8 extends i{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(p`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",w0,{query:$,...Z})}delete($,Z){return this._client.delete(p`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(p`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new A(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:E([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>X6.fromResponse(J.response,J.controller))}}});var T$,AJ,vB;var S4=j(()=>{B0();a6();RJ();M4();P4();P4();e5();T$=class T$ extends i{constructor(){super(...arguments);this.batches=new T8(this._client)}create($,Z){if($.model in AJ)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${AJ[$.model]}
197
- Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if($.model in vB&&$.thinking&&$.thinking.type==="enabled")console.warn(`Using Claude with ${$.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let X=this._client._options.timeout;if(!$.stream&&X==null){let J=b2[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=j2($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:X??600000,...Z,headers:E([z,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((X)=>T4(X,$,{logger:this._client.logger??console}))}stream($,Z){return L8.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};AJ={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},vB=["claude-opus-4-6"];T$.Batches=T8});var Q6;var _4=j(()=>{P0();B0();t0();Q6=class Q6 extends i{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(p`/v1/models/${$}`,{...X,headers:E([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",w0,{query:z,...Z,headers:E([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var PJ=j(()=>{N4();I4();S4();_4();$J()});var M8=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim();return};class n{constructor({baseURL:$=M8("ANTHROPIC_BASE_URL"),apiKey:Z=M8("ANTHROPIC_API_KEY")??null,authToken:X=M8("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){C4.add(this),s2.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&u9())throw new A(`It looks like you're running in a browser-like environment.
195
+ Wrap your summary in <summary></summary> tags.`;function IJ(){let $,Z;return{promise:new Promise((z,J)=>{$=z,Z=J}),resolve:$,reject:Z}}async function bD($,Z=$.messages.at(-1)){if(!Z||Z.role!=="assistant"||!Z.content||typeof Z.content==="string")return null;let X=Z.content.filter((J)=>J.type==="tool_use");if(X.length===0)return null;return{role:"user",content:await Promise.all(X.map(async(J)=>{let q=$.tools.find((Q)=>("name"in Q?Q.name:Q.mcp_server_name)===J.name);if(!q||!("run"in q))return{type:"tool_result",tool_use_id:J.id,content:`Error: Tool '${J.name}' not found`,is_error:!0};try{let Q=J.input;if("parse"in q&&q.parse)Q=q.parse(Q);let Y=await q.run(Q);return{type:"tool_result",tool_use_id:J.id,content:Y}}catch(Q){return{type:"tool_result",tool_use_id:J.id,content:Q instanceof $6?Q.content:`Error: ${Q instanceof Error?Q.message:String(Q)}`,is_error:!0}}}))}}var Q8,Z6,I$,z0,Y8,B0,f0,$$,G8,NJ,U4,U8;var W4=j(()=>{j0();m2();W0();D0();a6();U8=class U8{constructor($,Z,X){Q8.add(this),this.client=$,Z6.set(this,!1),I$.set(this,!1),z0.set(this,void 0),Y8.set(this,void 0),B0.set(this,void 0),f0.set(this,void 0),$$.set(this,void 0),G8.set(this,0),O(this,z0,{params:{...Z,messages:structuredClone(Z.messages)}},"f");let J=["BetaToolRunner",...a5(Z.tools,Z.messages)].join(", ");O(this,Y8,{...X,headers:S([{"x-stainless-helper":J},X?.headers])},"f"),O(this,$$,IJ(),"f")}async*[(Z6=new WeakMap,I$=new WeakMap,z0=new WeakMap,Y8=new WeakMap,B0=new WeakMap,f0=new WeakMap,$$=new WeakMap,G8=new WeakMap,Q8=new WeakSet,NJ=async function(){let Z=K(this,z0,"f").params.compactionControl;if(!Z||!Z.enabled)return!1;let X=0;if(K(this,B0,"f")!==void 0)try{let G=await K(this,B0,"f");X=G.usage.input_tokens+(G.usage.cache_creation_input_tokens??0)+(G.usage.cache_read_input_tokens??0)+G.usage.output_tokens}catch{return!1}let z=Z.contextTokenThreshold??DJ;if(X<z)return!1;let J=Z.model??K(this,z0,"f").params.model,q=Z.summaryPrompt??BJ,Q=K(this,z0,"f").params.messages;if(Q[Q.length-1].role==="assistant"){let G=Q[Q.length-1];if(Array.isArray(G.content)){let U=G.content.filter((W)=>W.type!=="tool_use");if(U.length===0)Q.pop();else G.content=U}}let Y=await this.client.beta.messages.create({model:J,messages:[...Q,{role:"user",content:[{type:"text",text:q}]}],max_tokens:K(this,z0,"f").params.max_tokens},{headers:{"x-stainless-helper":"compaction"}});if(Y.content[0]?.type!=="text")throw new A("Expected text response for compaction");return K(this,z0,"f").params.messages=[{role:"user",content:Y.content}],!0},Symbol.asyncIterator)](){var $;if(K(this,Z6,"f"))throw new A("Cannot iterate over a consumed stream");O(this,Z6,!0,"f"),O(this,I$,!0,"f"),O(this,f0,void 0,"f");try{while(!0){let Z;try{if(K(this,z0,"f").params.max_iterations&&K(this,G8,"f")>=K(this,z0,"f").params.max_iterations)break;O(this,I$,!1,"f"),O(this,f0,void 0,"f"),O(this,G8,($=K(this,G8,"f"),$++,$),"f"),O(this,B0,void 0,"f");let{max_iterations:X,compactionControl:z,...J}=K(this,z0,"f").params;if(J.stream)Z=this.client.beta.messages.stream({...J},K(this,Y8,"f")),O(this,B0,Z.finalMessage(),"f"),K(this,B0,"f").catch(()=>{}),yield Z;else O(this,B0,this.client.beta.messages.create({...J,stream:!1},K(this,Y8,"f")),"f"),yield K(this,B0,"f");if(!await K(this,Q8,"m",NJ).call(this)){if(!K(this,I$,"f")){let{role:Y,content:G}=await K(this,B0,"f");K(this,z0,"f").params.messages.push({role:Y,content:G})}let Q=await K(this,Q8,"m",U4).call(this,K(this,z0,"f").params.messages.at(-1));if(Q)K(this,z0,"f").params.messages.push(Q);else if(!K(this,I$,"f"))break}}finally{if(Z)Z.abort()}}if(!K(this,B0,"f"))throw new A("ToolRunner concluded without a message from the server");K(this,$$,"f").resolve(await K(this,B0,"f"))}catch(Z){throw O(this,Z6,!1,"f"),K(this,$$,"f").promise.catch(()=>{}),K(this,$$,"f").reject(Z),O(this,$$,IJ(),"f"),Z}}setMessagesParams($){if(typeof $==="function")K(this,z0,"f").params=$(K(this,z0,"f").params);else K(this,z0,"f").params=$;O(this,I$,!0,"f"),O(this,f0,void 0,"f")}async generateToolResponse(){let $=await K(this,B0,"f")??this.params.messages.at(-1);if(!$)return null;return K(this,Q8,"m",U4).call(this,$)}done(){return K(this,$$,"f").promise}async runUntilDone(){if(!K(this,Z6,"f"))for await(let $ of this);return this.done()}get params(){return K(this,z0,"f").params}pushMessages(...$){this.setMessagesParams((Z)=>({...Z,messages:[...Z.messages,...$]}))}then($,Z){return this.runUntilDone().then($,Z)}};U4=async function(Z){if(K(this,f0,"f")!==void 0)return K(this,f0,"f");return O(this,f0,bD(K(this,z0,"f").params,Z),"f"),K(this,f0,"f")}});var X6;var H4=j(()=>{W0();v5();X6=class X6{constructor($,Z){this.iterator=$,this.controller=Z}async*decoder(){let $=new a0;for await(let Z of this.iterator)for(let X of $.decode(Z))yield JSON.parse(X);for(let Z of $.flush())yield JSON.parse(Z)}[Symbol.asyncIterator](){return this.decoder()}static fromResponse($,Z){if(!$.body){if(Z.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative")throw new A("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api");throw new A("Attempted to iterate over a response with no body")}return new X6(u6($.body),Z)}}});var W8;var V4=j(()=>{P0();D0();H4();o$();t0();W8=class W8 extends n{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/messages/batches?beta=true",{body:z,...Z,headers:S([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(l`/v1/messages/batches/${$}?beta=true`,{...X,headers:S([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/messages/batches?beta=true",w0,{query:z,...Z,headers:S([{"anthropic-beta":[...X??[],"message-batches-2024-09-24"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(l`/v1/messages/batches/${$}?beta=true`,{...X,headers:S([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}cancel($,Z={},X){let{betas:z}=Z??{};return this._client.post(l`/v1/messages/batches/${$}/cancel?beta=true`,{...X,headers:S([{"anthropic-beta":[...z??[],"message-batches-2024-09-24"].toString()},X?.headers])})}async results($,Z={},X){let z=await this.retrieve($);if(!z.results_url)throw new A(`No batch \`results_url\`; Has it finished processing? ${z.processing_status} - ${z.id}`);let{betas:J}=Z??{};return this._client.get(z.results_url,{...X,headers:S([{"anthropic-beta":[...J??[],"message-batches-2024-09-24"].toString(),Accept:"application/binary"},X?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((q,Q)=>X6.fromResponse(Q.response,Q.controller))}}});function TJ($){if(!$.output_format)return $;if($.output_config?.format)throw new A("Both output_format and output_config.format were provided. Please use only output_config.format (output_format is deprecated).");let{output_format:Z,...X}=$;return{...X,output_config:{...$.output_config,format:Z}}}var LJ,kD,Z$;var K4=j(()=>{o$();e5();D0();a6();X4();KJ();W4();m2();V4();V4();W4();m2();LJ={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026"},kD=["claude-opus-4-6"];Z$=class Z$ extends n{constructor(){super(...arguments);this.batches=new W8(this._client)}create($,Z){let X=TJ($),{betas:z,...J}=X;if(J.model in LJ)console.warn(`The model '${J.model}' is deprecated and will reach end-of-life on ${LJ[J.model]}
196
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if(J.model in kD&&J.thinking&&J.thinking.type==="enabled")console.warn(`Using Claude with ${J.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let q=this._client._options.timeout;if(!J.stream&&q==null){let Y=b2[J.model]??void 0;q=this._client.calculateNonstreamingTimeout(J.max_tokens,Y)}let Q=j2(J.tools,J.messages);return this._client.post("/v1/messages?beta=true",{body:J,timeout:q??600000,...Z,headers:S([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},Q,Z?.headers]),stream:X.stream??!1})}parse($,Z){return Z={...Z,headers:S([{"anthropic-beta":[...$.betas??[],"structured-outputs-2025-12-15"].toString()},Z?.headers])},this.create($,Z).then((X)=>Z4(X,$,{logger:this._client.logger??console}))}stream($,Z){return q8.createMessage(this,$,Z)}countTokens($,Z){let X=TJ($),{betas:z,...J}=X;return this._client.post("/v1/messages/count_tokens?beta=true",{body:J,...Z,headers:S([{"anthropic-beta":[...z??[],"token-counting-2024-11-01"].toString()},Z?.headers])})}toolRunner($,Z){return new U8(this._client,$,Z)}};Z$.Batches=W8;Z$.BetaToolRunner=U8;Z$.ToolError=$6});var H8;var D4=j(()=>{P0();D0();a$();t0();H8=class H8 extends n{create($,Z={},X){let{betas:z,...J}=Z??{};return this._client.post(l`/v1/skills/${$}/versions?beta=true`,r$({body:J,...X,headers:S([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])},this._client))}retrieve($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.get(l`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:S([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}list($,Z={},X){let{betas:z,...J}=Z??{};return this._client.getAPIList(l`/v1/skills/${$}/versions?beta=true`,i6,{query:J,...X,headers:S([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}delete($,Z,X){let{skill_id:z,betas:J}=Z;return this._client.delete(l`/v1/skills/${z}/versions/${$}?beta=true`,{...X,headers:S([{"anthropic-beta":[...J??[],"skills-2025-10-02"].toString()},X?.headers])})}}});var z6;var B4=j(()=>{D4();D4();P0();D0();a$();t0();z6=class z6 extends n{constructor(){super(...arguments);this.versions=new H8(this._client)}create($={},Z){let{betas:X,...z}=$??{};return this._client.post("/v1/skills?beta=true",r$({body:z,...Z,headers:S([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])},this._client,!1))}retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(l`/v1/skills/${$}?beta=true`,{...X,headers:S([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/skills?beta=true",i6,{query:z,...Z,headers:S([{"anthropic-beta":[...X??[],"skills-2025-10-02"].toString()},Z?.headers])})}delete($,Z={},X){let{betas:z}=Z??{};return this._client.delete(l`/v1/skills/${$}?beta=true`,{...X,headers:S([{"anthropic-beta":[...z??[],"skills-2025-10-02"].toString()},X?.headers])})}};z6.Versions=H8});var _0;var N4=j(()=>{o5();o5();t5();t5();K4();K4();B4();B4();_0=class _0 extends n{constructor(){super(...arguments);this.models=new t6(this._client),this.messages=new Z$(this._client),this.files=new o6(this._client),this.skills=new z6(this._client)}};_0.Models=t6;_0.Messages=Z$;_0.Files=o6;_0.Skills=z6});var J6;var I4=j(()=>{D0();J6=class J6 extends n{create($,Z){let{betas:X,...z}=$;return this._client.post("/v1/complete",{body:z,timeout:this._client._options.timeout??600000,...Z,headers:S([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers]),stream:$.stream??!1})}}});function MJ($){return $?.output_config?.format}function L4($,Z,X){let z=MJ(Z);if(!Z||!("parse"in(z??{})))return{...$,content:$.content.map((J)=>{if(J.type==="text")return Object.defineProperty({...J},"parsed_output",{value:null,enumerable:!1});return J}),parsed_output:null};return T4($,Z,X)}function T4($,Z,X){let z=null,J=$.content.map((q)=>{if(q.type==="text"){let Q=hD(Z,q.text);if(z===null)z=Q;return Object.defineProperty({...q},"parsed_output",{value:Q,enumerable:!1})}return q});return{...$,content:J,parsed_output:z}}function hD($,Z){let X=MJ($);if(X?.type!=="json_schema")return null;try{if("parse"in X)return X.parse(Z);return JSON.parse(Z)}catch(z){throw new A(`Failed to parse structured output: ${z}`)}}var M4=j(()=>{W0()});function RJ($){return $.type==="tool_use"||$.type==="server_tool_use"}function AJ($){}var T0,X$,q6,V8,d2,K8,D8,c2,B8,y0,N8,p2,l2,L$,i2,n2,I8,O4,OJ,w4,F4,R4,A4,wJ,FJ="__json_buf",L8;var PJ=j(()=>{j0();o$();J4();z4();M4();L8=class L8{constructor($,Z){T0.add(this),this.messages=[],this.receivedMessages=[],X$.set(this,void 0),q6.set(this,null),this.controller=new AbortController,V8.set(this,void 0),d2.set(this,()=>{}),K8.set(this,()=>{}),D8.set(this,void 0),c2.set(this,()=>{}),B8.set(this,()=>{}),y0.set(this,{}),N8.set(this,!1),p2.set(this,!1),l2.set(this,!1),L$.set(this,!1),i2.set(this,void 0),n2.set(this,void 0),I8.set(this,void 0),w4.set(this,(X)=>{if(O(this,p2,!0,"f"),b0(X))X=new Q0;if(X instanceof Q0)return O(this,l2,!0,"f"),this._emit("abort",X);if(X instanceof A)return this._emit("error",X);if(X instanceof Error){let z=new A(X.message);return z.cause=X,this._emit("error",z)}return this._emit("error",new A(String(X)))}),O(this,V8,new Promise((X,z)=>{O(this,d2,X,"f"),O(this,K8,z,"f")}),"f"),O(this,D8,new Promise((X,z)=>{O(this,c2,X,"f"),O(this,B8,z,"f")}),"f"),K(this,V8,"f").catch(()=>{}),K(this,D8,"f").catch(()=>{}),O(this,q6,$,"f"),O(this,I8,Z?.logger??console,"f")}get response(){return K(this,i2,"f")}get request_id(){return K(this,n2,"f")}async withResponse(){O(this,L$,!0,"f");let $=await K(this,V8,"f");if(!$)throw Error("Could not resolve a `Response` object");return{data:this,response:$,request_id:$.headers.get("request-id")}}static fromReadableStream($){let Z=new L8(null);return Z._run(()=>Z._fromReadableStream($)),Z}static createMessage($,Z,X,{logger:z}={}){let J=new L8(Z,{logger:z});for(let q of Z.messages)J._addMessageParam(q);return O(J,q6,{...Z,stream:!0},"f"),J._run(()=>J._createMessage($,{...Z,stream:!0},{...X,headers:{...X?.headers,"X-Stainless-Helper-Method":"stream"}})),J}_run($){$().then(()=>{this._emitFinal(),this._emit("end")},K(this,w4,"f"))}_addMessageParam($){this.messages.push($)}_addMessage($,Z=!0){if(this.receivedMessages.push($),Z)this._emit("message",$)}async _createMessage($,Z,X){let z=X?.signal,J;if(z){if(z.aborted)this.controller.abort();J=this.controller.abort.bind(this.controller),z.addEventListener("abort",J)}try{K(this,T0,"m",F4).call(this);let{response:q,data:Q}=await $.create({...Z,stream:!0},{...X,signal:this.controller.signal}).withResponse();this._connected(q);for await(let Y of Q)K(this,T0,"m",R4).call(this,Y);if(Q.controller.signal?.aborted)throw new Q0;K(this,T0,"m",A4).call(this)}finally{if(z&&J)z.removeEventListener("abort",J)}}_connected($){if(this.ended)return;O(this,i2,$,"f"),O(this,n2,$?.headers.get("request-id"),"f"),K(this,d2,"f").call(this,$),this._emit("connect")}get ended(){return K(this,N8,"f")}get errored(){return K(this,p2,"f")}get aborted(){return K(this,l2,"f")}abort(){this.controller.abort()}on($,Z){return(K(this,y0,"f")[$]||(K(this,y0,"f")[$]=[])).push({listener:Z}),this}off($,Z){let X=K(this,y0,"f")[$];if(!X)return this;let z=X.findIndex((J)=>J.listener===Z);if(z>=0)X.splice(z,1);return this}once($,Z){return(K(this,y0,"f")[$]||(K(this,y0,"f")[$]=[])).push({listener:Z,once:!0}),this}emitted($){return new Promise((Z,X)=>{if(O(this,L$,!0,"f"),$!=="error")this.once("error",X);this.once($,Z)})}async done(){O(this,L$,!0,"f"),await K(this,D8,"f")}get currentMessage(){return K(this,X$,"f")}async finalMessage(){return await this.done(),K(this,T0,"m",O4).call(this)}async finalText(){return await this.done(),K(this,T0,"m",OJ).call(this)}_emit($,...Z){if(K(this,N8,"f"))return;if($==="end")O(this,N8,!0,"f"),K(this,c2,"f").call(this);let X=K(this,y0,"f")[$];if(X)K(this,y0,"f")[$]=X.filter((z)=>!z.once),X.forEach(({listener:z})=>z(...Z));if($==="abort"){let z=Z[0];if(!K(this,L$,"f")&&!X?.length)Promise.reject(z);K(this,K8,"f").call(this,z),K(this,B8,"f").call(this,z),this._emit("end");return}if($==="error"){let z=Z[0];if(!K(this,L$,"f")&&!X?.length)Promise.reject(z);K(this,K8,"f").call(this,z),K(this,B8,"f").call(this,z),this._emit("end")}}_emitFinal(){if(this.receivedMessages.at(-1))this._emit("finalMessage",K(this,T0,"m",O4).call(this))}async _fromReadableStream($,Z){let X=Z?.signal,z;if(X){if(X.aborted)this.controller.abort();z=this.controller.abort.bind(this.controller),X.addEventListener("abort",z)}try{K(this,T0,"m",F4).call(this),this._connected(null);let J=K0.fromReadableStream($,this.controller);for await(let q of J)K(this,T0,"m",R4).call(this,q);if(J.controller.signal?.aborted)throw new Q0;K(this,T0,"m",A4).call(this)}finally{if(X&&z)X.removeEventListener("abort",z)}}[(X$=new WeakMap,q6=new WeakMap,V8=new WeakMap,d2=new WeakMap,K8=new WeakMap,D8=new WeakMap,c2=new WeakMap,B8=new WeakMap,y0=new WeakMap,N8=new WeakMap,p2=new WeakMap,l2=new WeakMap,L$=new WeakMap,i2=new WeakMap,n2=new WeakMap,I8=new WeakMap,w4=new WeakMap,T0=new WeakSet,O4=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");return this.receivedMessages.at(-1)},OJ=function(){if(this.receivedMessages.length===0)throw new A("stream ended without producing a Message with role=assistant");let Z=this.receivedMessages.at(-1).content.filter((X)=>X.type==="text").map((X)=>X.text);if(Z.length===0)throw new A("stream ended without producing a content block with type=text");return Z.join(" ")},F4=function(){if(this.ended)return;O(this,X$,void 0,"f")},R4=function(Z){if(this.ended)return;let X=K(this,T0,"m",wJ).call(this,Z);switch(this._emit("streamEvent",Z,X),Z.type){case"content_block_delta":{let z=X.content.at(-1);switch(Z.delta.type){case"text_delta":{if(z.type==="text")this._emit("text",Z.delta.text,z.text||"");break}case"citations_delta":{if(z.type==="text")this._emit("citation",Z.delta.citation,z.citations??[]);break}case"input_json_delta":{if(RJ(z)&&z.input)this._emit("inputJson",Z.delta.partial_json,z.input);break}case"thinking_delta":{if(z.type==="thinking")this._emit("thinking",Z.delta.thinking,z.thinking);break}case"signature_delta":{if(z.type==="thinking")this._emit("signature",z.signature);break}default:AJ(Z.delta)}break}case"message_stop":{this._addMessageParam(X),this._addMessage(L4(X,K(this,q6,"f"),{logger:K(this,I8,"f")}),!0);break}case"content_block_stop":{this._emit("contentBlock",X.content.at(-1));break}case"message_start":{O(this,X$,X,"f");break}case"content_block_start":case"message_delta":break}},A4=function(){if(this.ended)throw new A("stream has ended, this shouldn't happen");let Z=K(this,X$,"f");if(!Z)throw new A("request ended without sending any chunks");return O(this,X$,void 0,"f"),L4(Z,K(this,q6,"f"),{logger:K(this,I8,"f")})},wJ=function(Z){let X=K(this,X$,"f");if(Z.type==="message_start"){if(X)throw new A(`Unexpected event order, got ${Z.type} before receiving "message_stop"`);return Z.message}if(!X)throw new A(`Unexpected event order, got ${Z.type} before "message_start"`);switch(Z.type){case"message_stop":return X;case"message_delta":if(X.stop_reason=Z.delta.stop_reason,X.stop_sequence=Z.delta.stop_sequence,X.usage.output_tokens=Z.usage.output_tokens,Z.usage.input_tokens!=null)X.usage.input_tokens=Z.usage.input_tokens;if(Z.usage.cache_creation_input_tokens!=null)X.usage.cache_creation_input_tokens=Z.usage.cache_creation_input_tokens;if(Z.usage.cache_read_input_tokens!=null)X.usage.cache_read_input_tokens=Z.usage.cache_read_input_tokens;if(Z.usage.server_tool_use!=null)X.usage.server_tool_use=Z.usage.server_tool_use;return X;case"content_block_start":return X.content.push({...Z.content_block}),X;case"content_block_delta":{let z=X.content.at(Z.index);switch(Z.delta.type){case"text_delta":{if(z?.type==="text")X.content[Z.index]={...z,text:(z.text||"")+Z.delta.text};break}case"citations_delta":{if(z?.type==="text")X.content[Z.index]={...z,citations:[...z.citations??[],Z.delta.citation]};break}case"input_json_delta":{if(z&&RJ(z)){let J=z[FJ]||"";J+=Z.delta.partial_json;let q={...z};if(Object.defineProperty(q,FJ,{value:J,enumerable:!1,writable:!0}),J)q.input=x2(J);X.content[Z.index]=q}break}case"thinking_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,thinking:z.thinking+Z.delta.thinking};break}case"signature_delta":{if(z?.type==="thinking")X.content[Z.index]={...z,signature:Z.delta.signature};break}default:AJ(Z.delta)}return X}case"content_block_stop":return X}},Symbol.asyncIterator)](){let $=[],Z=[],X=!1;return this.on("streamEvent",(z)=>{let J=Z.shift();if(J)J.resolve(z);else $.push(z)}),this.on("end",()=>{X=!0;for(let z of Z)z.resolve(void 0);Z.length=0}),this.on("abort",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),this.on("error",(z)=>{X=!0;for(let J of Z)J.reject(z);Z.length=0}),{next:async()=>{if(!$.length){if(X)return{value:void 0,done:!0};return new Promise((J,q)=>Z.push({resolve:J,reject:q})).then((J)=>J?{value:J,done:!1}:{value:void 0,done:!0})}return{value:$.shift(),done:!1}},return:async()=>{return this.abort(),{value:void 0,done:!0}}}}toReadableStream(){return new K0(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var T8;var P4=j(()=>{P0();D0();H4();o$();t0();T8=class T8 extends n{create($,Z){return this._client.post("/v1/messages/batches",{body:$,...Z})}retrieve($,Z){return this._client.get(l`/v1/messages/batches/${$}`,Z)}list($={},Z){return this._client.getAPIList("/v1/messages/batches",w0,{query:$,...Z})}delete($,Z){return this._client.delete(l`/v1/messages/batches/${$}`,Z)}cancel($,Z){return this._client.post(l`/v1/messages/batches/${$}/cancel`,Z)}async results($,Z){let X=await this.retrieve($);if(!X.results_url)throw new A(`No batch \`results_url\`; Has it finished processing? ${X.processing_status} - ${X.id}`);return this._client.get(X.results_url,{...Z,headers:S([{Accept:"application/binary"},Z?.headers]),stream:!0,__binaryResponse:!0})._thenUnwrap((z,J)=>X6.fromResponse(J.response,J.controller))}}});var T$,_J,uD;var _4=j(()=>{D0();a6();PJ();M4();P4();P4();e5();T$=class T$ extends n{constructor(){super(...arguments);this.batches=new T8(this._client)}create($,Z){if($.model in _J)console.warn(`The model '${$.model}' is deprecated and will reach end-of-life on ${_J[$.model]}
197
+ Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.`);if($.model in uD&&$.thinking&&$.thinking.type==="enabled")console.warn(`Using Claude with ${$.model} and 'thinking.type=enabled' is deprecated. Use 'thinking.type=adaptive' instead which results in better model performance in our testing: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking`);let X=this._client._options.timeout;if(!$.stream&&X==null){let J=b2[$.model]??void 0;X=this._client.calculateNonstreamingTimeout($.max_tokens,J)}let z=j2($.tools,$.messages);return this._client.post("/v1/messages",{body:$,timeout:X??600000,...Z,headers:S([z,Z?.headers]),stream:$.stream??!1})}parse($,Z){return this.create($,Z).then((X)=>T4(X,$,{logger:this._client.logger??console}))}stream($,Z){return L8.createMessage(this,$,Z,{logger:this._client.logger??console})}countTokens($,Z){return this._client.post("/v1/messages/count_tokens",{body:$,...Z})}};_J={"claude-1.3":"November 6th, 2024","claude-1.3-100k":"November 6th, 2024","claude-instant-1.1":"November 6th, 2024","claude-instant-1.1-100k":"November 6th, 2024","claude-instant-1.2":"November 6th, 2024","claude-3-sonnet-20240229":"July 21st, 2025","claude-3-opus-20240229":"January 5th, 2026","claude-2.1":"July 21st, 2025","claude-2.0":"July 21st, 2025","claude-3-7-sonnet-latest":"February 19th, 2026","claude-3-7-sonnet-20250219":"February 19th, 2026","claude-3-5-haiku-latest":"February 19th, 2026","claude-3-5-haiku-20241022":"February 19th, 2026"},uD=["claude-opus-4-6"];T$.Batches=T8});var Q6;var C4=j(()=>{P0();D0();t0();Q6=class Q6 extends n{retrieve($,Z={},X){let{betas:z}=Z??{};return this._client.get(l`/v1/models/${$}`,{...X,headers:S([{...z?.toString()!=null?{"anthropic-beta":z?.toString()}:void 0},X?.headers])})}list($={},Z){let{betas:X,...z}=$??{};return this._client.getAPIList("/v1/models",w0,{query:z,...Z,headers:S([{...X?.toString()!=null?{"anthropic-beta":X?.toString()}:void 0},Z?.headers])})}}});var CJ=j(()=>{N4();I4();_4();C4();XJ()});var M8=($)=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[$]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.($)?.trim();return};class s{constructor({baseURL:$=M8("ANTHROPIC_BASE_URL"),apiKey:Z=M8("ANTHROPIC_API_KEY")??null,authToken:X=M8("ANTHROPIC_AUTH_TOKEN")??null,...z}={}){S4.add(this),s2.set(this,void 0);let J={apiKey:Z,authToken:X,...z,baseURL:$||"https://api.anthropic.com"};if(!J.dangerouslyAllowBrowser&&d9())throw new A(`It looks like you're running in a browser-like environment.
198
198
 
199
199
  This is disabled by default, as it risks exposing your secret API credentials to attackers.
200
200
  If you understand the risks and have appropriate mitigations in place,
201
201
  you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
202
202
 
203
203
  new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
204
- `);this.baseURL=J.baseURL,this.timeout=J.timeout??E4.DEFAULT_TIMEOUT,this.logger=J.logger??console;let q="warn";this.logLevel=q,this.logLevel=u5(J.logLevel,"ClientOptions.logLevel",this)??u5(M8("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??d9(),O(this,s2,p9,"f"),this._options=J,this.apiKey=typeof Z==="string"?Z:null,this.authToken=X}withOptions($){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...$})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:$,nulls:Z}){if($.get("x-api-key")||$.get("authorization"))return;if(this.apiKey&&$.get("x-api-key"))return;if(Z.has("x-api-key"))return;if(this.authToken&&$.get("authorization"))return;if(Z.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders($){return E([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return E([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return E([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return Object.entries($).filter(([Z,X])=>typeof X<"u").map(([Z,X])=>{if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(X)}`;if(X===null)return`${encodeURIComponent(Z)}=`;throw new A(`Cannot stringify type ${typeof X}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${r0}`}defaultIdempotencyKey(){return`stainless-node-retry-${x5()}`}makeStatusError($,Z,X,z){return t.generate($,Z,X,z)}buildURL($,Z,X){let z=!K(this,C4,"m",SJ).call(this)&&X||this.baseURL,J=b9($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),q=this.defaultQuery();if(!x9(q))Z={...q,...Z};if(typeof Z==="object"&&Z&&!Array.isArray(Z))J.search=this.stringifyQuery(Z);return J.toString()}_calculateNonstreamingTimeout($){if(3600*$/128000>600)throw new A("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions($){}async prepareRequest($,{url:Z,options:X}){}get($,Z){return this.methodRequest("get",$,Z)}post($,Z){return this.methodRequest("post",$,Z)}patch($,Z){return this.methodRequest("patch",$,Z)}put($,Z){return this.methodRequest("put",$,Z)}delete($,Z){return this.methodRequest("delete",$,Z)}methodRequest($,Z,X){return this.request(Promise.resolve(X).then((z)=>{return{method:$,path:Z,...z}}))}request($,Z=null){return new o0(this,this.makeRequest($,Z,void 0))}async makeRequest($,Z,X){let z=await $,J=z.maxRetries??this.maxRetries;if(Z==null)Z=J;await this.prepareOptions(z);let{req:q,url:Q,timeout:Y}=await this.buildRequest(z,{retryCount:J-Z});await this.prepareRequest(q,{url:Q,options:z});let G="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),U=X===void 0?"":`, retryOf: ${X}`,W=Date.now();if(q0(this).debug(`[${G}] sending request`,x0({retryOfRequestLogID:X,method:z.method,url:Q,options:z,headers:q.headers})),z.signal?.aborted)throw new Q0;let V=new AbortController,H=await this.fetchWithTimeout(Q,q,Y,V).catch(v6),D=Date.now();if(H instanceof globalThis.Error){let N=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new Q0;let L=b0(H)||/timed? ?out/i.test(String(H)+("cause"in H?String(H.cause):""));if(Z)return q0(this).info(`[${G}] connection ${L?"timed out":"failed"} - ${N}`),q0(this).debug(`[${G}] connection ${L?"timed out":"failed"} (${N})`,x0({retryOfRequestLogID:X,url:Q,durationMs:D-W,message:H.message})),this.retryRequest(z,Z,X??G);if(q0(this).info(`[${G}] connection ${L?"timed out":"failed"} - error; no more retries left`),q0(this).debug(`[${G}] connection ${L?"timed out":"failed"} (error; no more retries left)`,x0({retryOfRequestLogID:X,url:Q,durationMs:D-W,message:H.message})),L)throw new u$;throw new s0({cause:H})}let M=[...H.headers.entries()].filter(([N])=>N==="request-id").map(([N,L])=>", "+N+": "+JSON.stringify(L)).join(""),B=`[${G}${U}${M}] ${q.method} ${Q} ${H.ok?"succeeded":"failed"} with status ${H.status} in ${D-W}ms`;if(!H.ok){let N=await this.shouldRetry(H);if(Z&&N){let F=`retrying, ${Z} attempts remaining`;return await c9(H.body),q0(this).info(`${B} - ${F}`),q0(this).debug(`[${G}] response error (${F})`,x0({retryOfRequestLogID:X,url:H.url,status:H.status,headers:H.headers,durationMs:D-W})),this.retryRequest(z,Z,X??G,H.headers)}let L=N?"error; no more retries left":"error; not retryable";q0(this).info(`${B} - ${L}`);let S=await H.text().catch((F)=>v6(F).message),_=w2(S),C=_?void 0:S;throw q0(this).debug(`[${G}] response error (${L})`,x0({retryOfRequestLogID:X,url:H.url,status:H.status,headers:H.headers,message:C,durationMs:Date.now()-W})),this.makeStatusError(H.status,_,C,H.headers)}return q0(this).info(B),q0(this).debug(`[${G}] response start`,x0({retryOfRequestLogID:X,url:H.url,status:H.status,headers:H.headers,durationMs:D-W})),{response:H,options:z,controller:V,requestLogID:G,retryOfRequestLogID:X,startTime:W}}getAPIList($,Z,X){return this.requestAPIList(Z,X&&"then"in X?X.then((z)=>({method:"get",path:$,...z})):{method:"get",path:$,...X})}requestAPIList($,Z){let X=this.makeRequest(Z,null,void 0);return new l6(this,X,$)}async fetchWithTimeout($,Z,X,z){let{signal:J,method:q,...Q}=Z||{},Y=this._makeAbort(z);if(J)J.addEventListener("abort",Y,{once:!0});let G=setTimeout(Y,X),U=globalThis.ReadableStream&&Q.body instanceof globalThis.ReadableStream||typeof Q.body==="object"&&Q.body!==null&&Symbol.asyncIterator in Q.body,W={signal:z.signal,...U?{duplex:"half"}:{},method:"GET",...Q};if(q)W.method=q.toUpperCase();try{return await this.fetch.call(void 0,$,W)}finally{clearTimeout(G)}}async shouldRetry($){let Z=$.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,Z,X,z){let J,q=z?.get("retry-after-ms");if(q){let Y=parseFloat(q);if(!Number.isNaN(Y))J=Y}let Q=z?.get("retry-after");if(Q&&!J){let Y=parseFloat(Q);if(!Number.isNaN(Y))J=Y*1000;else J=Date.parse(Q)-Date.now()}if(!(J&&0<=J&&J<60000)){let Y=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,Y)}return await y9(J),this.makeRequest($,Z-1,X)}calculateDefaultRetryTimeoutMillis($,Z){let J=Z-$,q=Math.min(0.5*Math.pow(2,J),8),Q=1-Math.random()*0.25;return q*Q*1000}calculateNonstreamingTimeout($,Z){if(3600000*$/128000>600000||Z!=null&&$>Z)throw new A("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest($,{retryCount:Z=0}={}){let X={...$},{method:z,path:J,query:q,defaultBaseURL:Q}=X,Y=this.buildURL(J,q,Q);if("timeout"in X)f9("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:G,body:U}=this.buildBody({options:X}),W=await this.buildHeaders({options:$,method:z,bodyHeaders:G,retryCount:Z});return{req:{method:z,headers:W,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&U instanceof globalThis.ReadableStream&&{duplex:"half"},...U&&{body:U},...this.fetchOptions??{},...X.fetchOptions??{}},url:Y,timeout:X.timeout}}async buildHeaders({options:$,method:Z,bodyHeaders:X,retryCount:z}){let J={};if(this.idempotencyHeader&&Z!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();J[this.idempotencyHeader]=$.idempotencyKey}let q=E([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...m9(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders($),this._options.defaultHeaders,X,$.headers]);return this.validateHeaders(q),q.values}_makeAbort($){return()=>$.abort()}buildBody({options:{body:$,headers:Z}}){if(!$)return{bodyHeaders:void 0,body:void 0};let X=E([Z]);if(ArrayBuffer.isView($)||$ instanceof ArrayBuffer||$ instanceof DataView||typeof $==="string"&&X.values.has("content-type")||globalThis.Blob&&$ instanceof globalThis.Blob||$ instanceof FormData||$ instanceof URLSearchParams||globalThis.ReadableStream&&$ instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:$};else if(typeof $==="object"&&((Symbol.asyncIterator in $)||(Symbol.iterator in $)&&("next"in $)&&typeof $.next==="function"))return{bodyHeaders:void 0,body:F2($)};else return K(this,s2,"f").call(this,{body:$,headers:X})}}var C4,E4,s2,SJ,j4="\\n\\nHuman:",b4="\\n\\nAssistant:",z$;var x4=j(()=>{j0();B$();y5();W0();P0();r5();PJ();_2();I4();_4();N4();S4();y5();B0();P2();B$();E4=n,s2=new WeakMap,C4=new WeakSet,SJ=function(){return this.baseURL!=="https://api.anthropic.com"};n.Anthropic=E4;n.HUMAN_PROMPT=j4;n.AI_PROMPT=b4;n.DEFAULT_TIMEOUT=600000;n.AnthropicError=A;n.APIError=t;n.APIConnectionError=s0;n.APIConnectionTimeoutError=u$;n.APIUserAbortError=Q0;n.NotFoundError=p$;n.ConflictError=l$;n.RateLimitError=n$;n.BadRequestError=m$;n.AuthenticationError=d$;n.InternalServerError=s$;n.PermissionDeniedError=c$;n.UnprocessableEntityError=i$;n.toFile=s6;z$=class z$ extends n{constructor(){super(...arguments);this.completions=new J6(this),this.messages=new T$(this),this.models=new Q6(this),this.beta=new S0(this)}};z$.Completions=J6;z$.Messages=T$;z$.Models=Q6;z$.Beta=S0});var _J={};g4(_J,{toFile:()=>s6,default:()=>z$,UnprocessableEntityError:()=>i$,RateLimitError:()=>n$,PermissionDeniedError:()=>c$,PagePromise:()=>l6,NotFoundError:()=>p$,InternalServerError:()=>s$,HUMAN_PROMPT:()=>j4,ConflictError:()=>l$,BaseAnthropic:()=>n,BadRequestError:()=>m$,AuthenticationError:()=>d$,AnthropicError:()=>A,Anthropic:()=>z$,APIUserAbortError:()=>Q0,APIPromise:()=>o0,APIError:()=>t,APIConnectionTimeoutError:()=>u$,APIConnectionError:()=>s0,AI_PROMPT:()=>b4});var CJ=j(()=>{x4();r5();_2();x4();P0();W0()});var $7=vJ(e4(),1),{program:zD,createCommand:JD,createArgument:qD,createOption:QD,CommanderError:YD,InvalidArgumentError:GD,InvalidOptionArgumentError:UD,Command:Z7,Argument:WD,Option:HD,Help:VD}=$7.default;import{readFileSync as Hz,writeFileSync as AV,existsSync as Wz}from"fs";var dH=X5(),cH=A6(),pH=uZ(),B5=P6(),lH=W6(),i0=k(),iH=m0(),nH=a(),sH=c0(),rH=p0(),jN=Q2(),aH=H5(),oH=V5(),tH=K5(),U2=Gz(),Uz=G6();var eH=dH.Composer,$V=cH.Document,ZV=pH.Schema,XV=B5.YAMLError,zV=B5.YAMLParseError,JV=B5.YAMLWarning,qV=lH.Alias,QV=i0.isAlias,YV=i0.isCollection,GV=i0.isDocument,UV=i0.isMap,WV=i0.isNode,HV=i0.isPair,VV=i0.isScalar,KV=i0.isSeq,BV=iH.Pair,DV=nH.Scalar,NV=sH.YAMLMap,IV=rH.YAMLSeq;var LV=aH.Lexer,TV=oH.LineCounter,MV=tH.Parser,b6=U2.parse,OV=U2.parseAllDocuments,wV=U2.parseDocument,D5=U2.stringify,FV=Uz.visit,RV=Uz.visitAsync;function m($){let Z=Hz($,"utf-8");return b6(Z)}function l($,Z){let X=D5(Z,{lineWidth:0});AV($,X,"utf-8")}function u($){return Hz($,"utf-8")}function f($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=`${$}/${z}`;if(Wz(J))return J}let X=$.replace(/\/[^/]+$/,"");if(X!==$)for(let z of Z){let J=`${X}/${z}`;if(Wz(J))return J}return null}var I5=null;function k6(){if(!I5)try{I5=Dz()}catch{throw Error(`faf-scoring-kernel not installed.
204
+ `);this.baseURL=J.baseURL,this.timeout=J.timeout??E4.DEFAULT_TIMEOUT,this.logger=J.logger??console;let q="warn";this.logLevel=q,this.logLevel=u5(J.logLevel,"ClientOptions.logLevel",this)??u5(M8("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??q,this.fetchOptions=J.fetchOptions,this.maxRetries=J.maxRetries??2,this.fetch=J.fetch??p9(),O(this,s2,i9,"f"),this._options=J,this.apiKey=typeof Z==="string"?Z:null,this.authToken=X}withOptions($){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...$})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:$,nulls:Z}){if($.get("x-api-key")||$.get("authorization"))return;if(this.apiKey&&$.get("x-api-key"))return;if(Z.has("x-api-key"))return;if(this.authToken&&$.get("authorization"))return;if(Z.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders($){return S([await this.apiKeyAuth($),await this.bearerAuth($)])}async apiKeyAuth($){if(this.apiKey==null)return;return S([{"X-Api-Key":this.apiKey}])}async bearerAuth($){if(this.authToken==null)return;return S([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery($){return Object.entries($).filter(([Z,X])=>typeof X<"u").map(([Z,X])=>{if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")return`${encodeURIComponent(Z)}=${encodeURIComponent(X)}`;if(X===null)return`${encodeURIComponent(Z)}=`;throw new A(`Cannot stringify type ${typeof X}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${r0}`}defaultIdempotencyKey(){return`stainless-node-retry-${x5()}`}makeStatusError($,Z,X,z){return e.generate($,Z,X,z)}buildURL($,Z,X){let z=!K(this,S4,"m",SJ).call(this)&&X||this.baseURL,J=k9($)?new URL($):new URL(z+(z.endsWith("/")&&$.startsWith("/")?$.slice(1):$)),q=this.defaultQuery();if(!f9(q))Z={...q,...Z};if(typeof Z==="object"&&Z&&!Array.isArray(Z))J.search=this.stringifyQuery(Z);return J.toString()}_calculateNonstreamingTimeout($){if(3600*$/128000>600)throw new A("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions($){}async prepareRequest($,{url:Z,options:X}){}get($,Z){return this.methodRequest("get",$,Z)}post($,Z){return this.methodRequest("post",$,Z)}patch($,Z){return this.methodRequest("patch",$,Z)}put($,Z){return this.methodRequest("put",$,Z)}delete($,Z){return this.methodRequest("delete",$,Z)}methodRequest($,Z,X){return this.request(Promise.resolve(X).then((z)=>{return{method:$,path:Z,...z}}))}request($,Z=null){return new o0(this,this.makeRequest($,Z,void 0))}async makeRequest($,Z,X){let z=await $,J=z.maxRetries??this.maxRetries;if(Z==null)Z=J;await this.prepareOptions(z);let{req:q,url:Q,timeout:Y}=await this.buildRequest(z,{retryCount:J-Z});await this.prepareRequest(q,{url:Q,options:z});let G="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),U=X===void 0?"":`, retryOf: ${X}`,W=Date.now();if(q0(this).debug(`[${G}] sending request`,x0({retryOfRequestLogID:X,method:z.method,url:Q,options:z,headers:q.headers})),z.signal?.aborted)throw new Q0;let V=new AbortController,H=await this.fetchWithTimeout(Q,q,Y,V).catch(v6),B=Date.now();if(H instanceof globalThis.Error){let N=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new Q0;let w=b0(H)||/timed? ?out/i.test(String(H)+("cause"in H?String(H.cause):""));if(Z)return q0(this).info(`[${G}] connection ${w?"timed out":"failed"} - ${N}`),q0(this).debug(`[${G}] connection ${w?"timed out":"failed"} (${N})`,x0({retryOfRequestLogID:X,url:Q,durationMs:B-W,message:H.message})),this.retryRequest(z,Z,X??G);if(q0(this).info(`[${G}] connection ${w?"timed out":"failed"} - error; no more retries left`),q0(this).debug(`[${G}] connection ${w?"timed out":"failed"} (error; no more retries left)`,x0({retryOfRequestLogID:X,url:Q,durationMs:B-W,message:H.message})),w)throw new u$;throw new s0({cause:H})}let M=[...H.headers.entries()].filter(([N])=>N==="request-id").map(([N,w])=>", "+N+": "+JSON.stringify(w)).join(""),D=`[${G}${U}${M}] ${q.method} ${Q} ${H.ok?"succeeded":"failed"} with status ${H.status} in ${B-W}ms`;if(!H.ok){let N=await this.shouldRetry(H);if(Z&&N){let C=`retrying, ${Z} attempts remaining`;return await l9(H.body),q0(this).info(`${D} - ${C}`),q0(this).debug(`[${G}] response error (${C})`,x0({retryOfRequestLogID:X,url:H.url,status:H.status,headers:H.headers,durationMs:B-W})),this.retryRequest(z,Z,X??G,H.headers)}let w=N?"error; no more retries left":"error; not retryable";q0(this).info(`${D} - ${w}`);let P=await H.text().catch((C)=>v6(C).message),_=w2(P),R=_?void 0:P;throw q0(this).debug(`[${G}] response error (${w})`,x0({retryOfRequestLogID:X,url:H.url,status:H.status,headers:H.headers,message:R,durationMs:Date.now()-W})),this.makeStatusError(H.status,_,R,H.headers)}return q0(this).info(D),q0(this).debug(`[${G}] response start`,x0({retryOfRequestLogID:X,url:H.url,status:H.status,headers:H.headers,durationMs:B-W})),{response:H,options:z,controller:V,requestLogID:G,retryOfRequestLogID:X,startTime:W}}getAPIList($,Z,X){return this.requestAPIList(Z,X&&"then"in X?X.then((z)=>({method:"get",path:$,...z})):{method:"get",path:$,...X})}requestAPIList($,Z){let X=this.makeRequest(Z,null,void 0);return new l6(this,X,$)}async fetchWithTimeout($,Z,X,z){let{signal:J,method:q,...Q}=Z||{},Y=this._makeAbort(z);if(J)J.addEventListener("abort",Y,{once:!0});let G=setTimeout(Y,X),U=globalThis.ReadableStream&&Q.body instanceof globalThis.ReadableStream||typeof Q.body==="object"&&Q.body!==null&&Symbol.asyncIterator in Q.body,W={signal:z.signal,...U?{duplex:"half"}:{},method:"GET",...Q};if(q)W.method=q.toUpperCase();try{return await this.fetch.call(void 0,$,W)}finally{clearTimeout(G)}}async shouldRetry($){let Z=$.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if($.status===408)return!0;if($.status===409)return!0;if($.status===429)return!0;if($.status>=500)return!0;return!1}async retryRequest($,Z,X,z){let J,q=z?.get("retry-after-ms");if(q){let Y=parseFloat(q);if(!Number.isNaN(Y))J=Y}let Q=z?.get("retry-after");if(Q&&!J){let Y=parseFloat(Q);if(!Number.isNaN(Y))J=Y*1000;else J=Date.parse(Q)-Date.now()}if(!(J&&0<=J&&J<60000)){let Y=$.maxRetries??this.maxRetries;J=this.calculateDefaultRetryTimeoutMillis(Z,Y)}return await h9(J),this.makeRequest($,Z-1,X)}calculateDefaultRetryTimeoutMillis($,Z){let J=Z-$,q=Math.min(0.5*Math.pow(2,J),8),Q=1-Math.random()*0.25;return q*Q*1000}calculateNonstreamingTimeout($,Z){if(3600000*$/128000>600000||Z!=null&&$>Z)throw new A("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest($,{retryCount:Z=0}={}){let X={...$},{method:z,path:J,query:q,defaultBaseURL:Q}=X,Y=this.buildURL(J,q,Q);if("timeout"in X)g9("timeout",X.timeout);X.timeout=X.timeout??this.timeout;let{bodyHeaders:G,body:U}=this.buildBody({options:X}),W=await this.buildHeaders({options:$,method:z,bodyHeaders:G,retryCount:Z});return{req:{method:z,headers:W,...X.signal&&{signal:X.signal},...globalThis.ReadableStream&&U instanceof globalThis.ReadableStream&&{duplex:"half"},...U&&{body:U},...this.fetchOptions??{},...X.fetchOptions??{}},url:Y,timeout:X.timeout}}async buildHeaders({options:$,method:Z,bodyHeaders:X,retryCount:z}){let J={};if(this.idempotencyHeader&&Z!=="get"){if(!$.idempotencyKey)$.idempotencyKey=this.defaultIdempotencyKey();J[this.idempotencyHeader]=$.idempotencyKey}let q=S([J,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...$.timeout?{"X-Stainless-Timeout":String(Math.trunc($.timeout/1000))}:{},...c9(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders($),this._options.defaultHeaders,X,$.headers]);return this.validateHeaders(q),q.values}_makeAbort($){return()=>$.abort()}buildBody({options:{body:$,headers:Z}}){if(!$)return{bodyHeaders:void 0,body:void 0};let X=S([Z]);if(ArrayBuffer.isView($)||$ instanceof ArrayBuffer||$ instanceof DataView||typeof $==="string"&&X.values.has("content-type")||globalThis.Blob&&$ instanceof globalThis.Blob||$ instanceof FormData||$ instanceof URLSearchParams||globalThis.ReadableStream&&$ instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:$};else if(typeof $==="object"&&((Symbol.asyncIterator in $)||(Symbol.iterator in $)&&("next"in $)&&typeof $.next==="function"))return{bodyHeaders:void 0,body:F2($)};else return K(this,s2,"f").call(this,{body:$,headers:X})}}var S4,E4,s2,SJ,j4="\\n\\nHuman:",b4="\\n\\nAssistant:",z$;var x4=j(()=>{j0();D$();y5();W0();P0();r5();CJ();C2();I4();C4();N4();_4();y5();D0();P2();D$();E4=s,s2=new WeakMap,S4=new WeakSet,SJ=function(){return this.baseURL!=="https://api.anthropic.com"};s.Anthropic=E4;s.HUMAN_PROMPT=j4;s.AI_PROMPT=b4;s.DEFAULT_TIMEOUT=600000;s.AnthropicError=A;s.APIError=e;s.APIConnectionError=s0;s.APIConnectionTimeoutError=u$;s.APIUserAbortError=Q0;s.NotFoundError=p$;s.ConflictError=l$;s.RateLimitError=n$;s.BadRequestError=m$;s.AuthenticationError=d$;s.InternalServerError=s$;s.PermissionDeniedError=c$;s.UnprocessableEntityError=i$;s.toFile=s6;z$=class z$ extends s{constructor(){super(...arguments);this.completions=new J6(this),this.messages=new T$(this),this.models=new Q6(this),this.beta=new _0(this)}};z$.Completions=J6;z$.Messages=T$;z$.Models=Q6;z$.Beta=_0});var EJ={};g4(EJ,{toFile:()=>s6,default:()=>z$,UnprocessableEntityError:()=>i$,RateLimitError:()=>n$,PermissionDeniedError:()=>c$,PagePromise:()=>l6,NotFoundError:()=>p$,InternalServerError:()=>s$,HUMAN_PROMPT:()=>j4,ConflictError:()=>l$,BaseAnthropic:()=>s,BadRequestError:()=>m$,AuthenticationError:()=>d$,AnthropicError:()=>A,Anthropic:()=>z$,APIUserAbortError:()=>Q0,APIPromise:()=>o0,APIError:()=>e,APIConnectionTimeoutError:()=>u$,APIConnectionError:()=>s0,AI_PROMPT:()=>b4});var jJ=j(()=>{x4();r5();C2();x4();P0();W0()});var $7=mJ(e4(),1),{program:JB,createCommand:qB,createArgument:QB,createOption:YB,CommanderError:GB,InvalidArgumentError:UB,InvalidOptionArgumentError:WB,Command:Z7,Argument:HB,Option:VB,Help:KB}=$7.default;import{readFileSync as Hz,writeFileSync as _V,existsSync as Wz}from"fs";var pH=X5(),lH=A6(),iH=uZ(),D5=P6(),nH=W6(),i0=y(),sH=m0(),rH=o(),aH=c0(),oH=p0(),bN=Q2(),tH=H5(),eH=V5(),$V=K5(),U2=Gz(),Uz=G6();var ZV=pH.Composer,XV=lH.Document,zV=iH.Schema,JV=D5.YAMLError,qV=D5.YAMLParseError,QV=D5.YAMLWarning,YV=nH.Alias,GV=i0.isAlias,UV=i0.isCollection,WV=i0.isDocument,HV=i0.isMap,VV=i0.isNode,KV=i0.isPair,DV=i0.isScalar,BV=i0.isSeq,NV=sH.Pair,IV=rH.Scalar,LV=aH.YAMLMap,TV=oH.YAMLSeq;var MV=tH.Lexer,OV=eH.LineCounter,wV=$V.Parser,b6=U2.parse,FV=U2.parseAllDocuments,RV=U2.parseDocument,B5=U2.stringify,AV=Uz.visit,PV=Uz.visitAsync;function d($){let Z=Hz($,"utf-8");return b6(Z)}function i($,Z){let X=B5(Z,{lineWidth:0});_V($,X,"utf-8")}function m($){return Hz($,"utf-8")}function g($=process.cwd()){let Z=["project.faf",".faf"];for(let z of Z){let J=`${$}/${z}`;if(Wz(J))return J}let X=$.replace(/\/[^/]+$/,"");if(X!==$)for(let z of Z){let J=`${X}/${z}`;if(Wz(J))return J}return null}var I5=null;function k6(){if(!I5)try{I5=Bz()}catch{throw Error(`faf-scoring-kernel not installed.
205
205
 
206
206
  Run: npm install faf-scoring-kernel
207
- `)}return I5}function s($){return JSON.parse(k6().score_faf($))}function Nz($){return k6().validate_faf($)}function Iz($){return k6().compile_fafb($)}function Lz($){return JSON.parse(k6().decompile_fafb($))}function Tz(){return k6().sdk_version()}d();var T5=[{name:"TROPHY",indicator:`${n0("\uD83C\uDFC6")} ${n0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${n0(b("★"))} ${n0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${w("◆")} ${w("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${w("◇")} ${w("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${b("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${I("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${I("○")} RED`,threshold:1},{name:"WHITE",indicator:`${I("♡")}`,threshold:0}];function V2($){return $.indicator}function Oz($){for(let Z of T5)if($>=Z.threshold)return Z;return T5[T5.length-1]}function r($){return{score:$.score,tier:Oz($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}d();function o($,Z,X=!1){let z=V2($.tier),J=b(`${$.score}%`);if(console.log(`${z} ${J} ${I(`${$.populated}/${$.active} slots`)} ${I("—")} ${Z}`),$.tier.name!=="TROPHY"&&$.empty>0)console.log(I(` ${$.empty} empty`));if(X)console.log(""),cV($)}function cV($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?w("●"):X==="slotignored"?I("—"):I("○");console.log(` ${z} ${X==="slotignored"?I(Z):Z}`)}}d();function K2($,Z={}){let X=$??f();if(!X)console.error(`Error: project.faf not found
207
+ `)}return I5}function r($){return JSON.parse(k6().score_faf($))}function Nz($){return k6().validate_faf($)}function Iz($){return k6().compile_fafb($)}function Lz($){return JSON.parse(k6().decompile_fafb($))}function Tz(){return k6().sdk_version()}c();var T5=[{name:"TROPHY",indicator:`${n0("\uD83C\uDFC6")} ${n0("TROPHY")}`,threshold:100},{name:"GOLD",indicator:`${n0(b("★"))} ${n0("GOLD")}`,threshold:99},{name:"SILVER",indicator:`${F("◆")} ${F("SILVER")}`,threshold:95},{name:"BRONZE",indicator:`${F("◇")} ${F("BRONZE")}`,threshold:85},{name:"GREEN",indicator:`${b("●")} GREEN`,threshold:70},{name:"YELLOW",indicator:`${I("●")} YELLOW`,threshold:55},{name:"RED",indicator:`${I("○")} RED`,threshold:1},{name:"WHITE",indicator:`${I("♡")}`,threshold:0}];function V2($){return $.indicator}function Oz($){for(let Z of T5)if($>=Z.threshold)return Z;return T5[T5.length-1]}function a($){return{score:$.score,tier:Oz($.score),populated:$.populated,empty:$.empty,ignored:$.ignored,active:$.active,total:$.total,slots:$.slots}}c();function t($,Z,X=!1){let z=V2($.tier),J=b(`${$.score}%`);if(console.log(`${z} ${J} ${I(`${$.populated}/${$.active} slots`)} ${I("—")} ${Z}`),$.tier.name!=="TROPHY"&&$.empty>0)console.log(I(` ${$.empty} empty`));if(X)console.log(""),lV($)}function lV($){for(let[Z,X]of Object.entries($.slots)){let z=X==="populated"?F("●"):X==="slotignored"?I("—"):I("○");console.log(` ${z} ${X==="slotignored"?I(Z):Z}`)}}c();function K2($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
208
208
 
209
- Run 'faf init' to create one.`),process.exit(2);let z=u(X),J=s(z),q=r(J);if(Z.json){console.log(JSON.stringify(q,null,2));return}if(Z.status){console.log(`${V2(q.tier)} ${b(`${q.score}%`)}`);return}o(q,X,Z.verbose)}import{existsSync as sV}from"fs";import{join as jz}from"path";var Y0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"What the project does",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is building this",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],oN=new Map(Y0.map(($)=>[$.path,$]));var tN=Y0.filter(($)=>$.index<=21);var pV=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function k$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return pV.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var f$={cli:["project","human"],library:["project","human"],mcp:["project","backend","human"],backend:["project","backend","universal","human"],"data-science":["project","backend","human"],frontend:["project","frontend","human"],fullstack:["project","frontend","backend","universal","human"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as g,readFileSync as lV,readdirSync as Fz}from"fs";import{join as y}from"path";var wz=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"dependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"file",pattern:"manage.py"},{type:"file",pattern:"settings.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"file",pattern:"app.py"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"file",pattern:"main.py"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"file",pattern:"Gemfile"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"file",pattern:"pom.xml"},{type:"file",pattern:"build.gradle"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK",slug:"mcp",category:"ai",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}];function V$($){let Z=y($,"package.json");if(!g(Z))return null;try{return JSON.parse(lV(Z,"utf-8"))}catch{return null}}function iV($,Z){if(!Z.includes("*"))return g(y($,Z));let X=Z.split("/");if(X.length===1){let Y=Z.split("*")[0];try{return Fz($).some((G)=>G.startsWith(Y))}catch{return!1}}let z=y($,...X.slice(0,-1)),J=X[X.length-1],q=J.split("*")[0],Q=J.split("*")[1]||"";try{return Fz(z).some((Y)=>Y.startsWith(q)&&Y.endsWith(Q))}catch{return!1}}function nV($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return iV(X,$.pattern);default:return!1}}function M5($){let Z=V$($);return wz.map((X)=>{let J=X.signals.filter((q)=>nV(q,Z,$)).length/X.signals.length;return{name:X.name,slug:X.slug,category:X.category,confidence:J}}).filter((X)=>X.confidence>0).sort((X,z)=>z.confidence-X.confidence)}function Rz($){let Z=V$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(g(y($,"tsconfig.json")))return"TypeScript";if(g(y($,"Cargo.toml")))return"Rust";if(g(y($,"go.mod")))return"Go";if(g(y($,"pyproject.toml"))||g(y($,"setup.py")))return"Python";if(g(y($,"Gemfile")))return"Ruby";if(g(y($,"pom.xml"))||g(y($,"build.gradle")))return"Java";if(g(y($,"Package.swift")))return"Swift";if(g(y($,"build.zig")))return"Zig";if(Z)return"JavaScript";return"Unknown"}function Az($){let Z=V$($),X=M5($);if(Z?.bin)return"cli";if(X.some((Q)=>Q.slug==="mcp"))return"mcp";let J=X.some((Q)=>Q.category==="frontend"),q=X.some((Q)=>Q.category==="backend");if(J&&q)return"fullstack";if(J)return"frontend";if(q)return"backend";if(Z?.main&&!Z?.bin)return"library";return"library"}function Pz($){if(g(y($,"bunfig.toml")))return"Bun";if(g(y($,"deno.json"))||g(y($,"deno.jsonc")))return"Deno";if(V$($))return"Node.js";if(g(y($,"Cargo.toml")))return"Rust";if(g(y($,"go.mod")))return"Go";return"Unknown"}function Sz($){if(g(y($,"bun.lockb"))||g(y($,"bun.lock")))return"bun";if(g(y($,"pnpm-lock.yaml")))return"pnpm";if(g(y($,"yarn.lock")))return"yarn";if(g(y($,"package-lock.json")))return"npm";return"npm"}function _z($){if(g(y($,".github/workflows")))return"GitHub Actions";if(g(y($,".gitlab-ci.yml")))return"GitLab CI";if(g(y($,".circleci")))return"CircleCI";if(g(y($,"Jenkinsfile")))return"Jenkins";return null}function Cz($){if(g(y($,"vercel.json")))return"Vercel";if(g(y($,"netlify.toml")))return"Netlify";if(g(y($,"wrangler.toml")))return"Cloudflare";if(g(y($,"Dockerfile")))return"Docker";if(g(y($,"fly.toml")))return"Fly.io";if(g(y($,"render.yaml")))return"Render";return null}function Ez($){let Z=V$($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(g(y($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function y$($){let Z=V$($),X=M5($),z=Rz($),J=Az($),q=Pz($),Q=Sz($),Y=_z($),G=Cz($),U=Ez($),W=X.find((R)=>R.category==="frontend"),V=X.find((R)=>R.category==="css"),H=X.find((R)=>R.category==="ui"),D=X.find((R)=>R.category==="state"),M=X.find((R)=>R.category==="backend"),B=X.find((R)=>R.category==="database"),N=f$[J]||f$.library,L={},S=Y0.filter((R)=>R.path.startsWith("stack."));for(let R of S){let F=R.path.replace("stack.","");if(!N.includes(R.category)){L[F]="slotignored";continue}switch(F){case"frontend":L[F]=W?.name??(J==="cli"?"CLI":"");break;case"css_framework":L[F]=V?.name??"";break;case"ui_library":L[F]=H?.name??"";break;case"state_management":L[F]=D?.name??"";break;case"backend":L[F]=M?.name??"";break;case"api_type":L[F]="";break;case"runtime":L[F]=q!=="Unknown"?q:"";break;case"database":L[F]=B?.name??"";break;case"connection":L[F]=B?.name??"";break;case"hosting":L[F]=G??"";break;case"build":L[F]=U??"";break;case"cicd":L[F]=Y??"";break;case"package_manager":L[F]=Q;break;default:L[F]="";break}}let _={},C=Y0.filter((R)=>R.path.startsWith("monorepo."));for(let R of C){let F=R.path.replace("monorepo.","");if(!N.includes(R.category))_[F]="slotignored";else _[F]=""}return{faf_version:"2.5.0",project:{name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:J},stack:L,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:_}}d();function O5($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:jz(Z,$.output):jz(Z,"project.faf");if(sV(X)&&!$.force)console.error(`project.faf already exists. Use ${b("--force")} to overwrite.`),process.exit(1);let z=y$(Z);l(X,z);let J=u(X),q=r(s(J));if(console.log(`${w("created")} ${X}`),o(q,X),q.score<100)console.log(I(`
210
- run ${b("'faf go'")} to fill empty slots`))}import{existsSync as rV}from"fs";import{join as aV}from"path";d();function bz(){let $=process.cwd(),Z=aV($,"project.faf"),X=y$($);if(rV(Z)){let q=m(Z),Q=xz(q,X);l(Z,Q),console.log(`${w("updated")} ${Z}`)}else{let q=X.project?.type??"library",Q=f$[q]||f$.library;for(let Y of Y0)if(!Q.includes(Y.category)){let[G,U]=Y.path.split(".");if(G==="stack"&&X.stack)X.stack[U]="slotignored";if(G==="monorepo"&&X.monorepo)X.monorepo[U]="slotignored"}l(Z,X),console.log(`${w("created")} ${Z}`)}let z=u(Z),J=r(s(z));if(o(J,Z),J.score<100)console.log(I(`
211
- run ${b("'faf go'")} to reach 100%`))}function xz($,Z){let X={...$};for(let[z,J]of Object.entries(Z))if(!(z in X)||X[z]===null||X[z]===void 0)X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J))X[z]=xz(X[z]??{},J);return X}import{existsSync as h$,statSync as D2}from"fs";import{join as uz}from"path";import{readFileSync as oV,writeFileSync as tV,existsSync as eV,statSync as PI}from"fs";import{join as kz}from"path";var fz="CLAUDE.md",$K="STATUS: BI-SYNC ACTIVE";function yz($){let Z=kz($,fz);if(!eV(Z))return null;return oV(Z,"utf-8")}function gz($,Z){let X=kz($,fz);tV(X,Z,"utf-8")}function K$($){return`<!-- faf: ${[$.project?.name,$.project?.main_language,$.project?.goal].filter(Boolean).map((X)=>String(X).trim()).join(" | ")} -->`}function hz($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(K$($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let q=$.stack??{},Q=[];if(z)Q.push(`**Language:** ${z}`);for(let[U,W]of Object.entries(q))if(W&&W!=="slotignored"&&String(W).trim()){let V=U.replace(/_/g," ").replace(/\b\w/g,(H)=>H.toUpperCase());Q.push(`**${V}:** ${W}`)}if(Q.length>0){Z.push("## Stack"),Z.push("");for(let U of Q)Z.push(`- ${U}`);Z.push("")}let Y=$.human_context??{},G=[["Who",Y.who],["What",Y.what],["Why",Y.why],["Where",Y.where],["When",Y.when],["How",Y.how]].filter(([U,W])=>W&&String(W).trim());if(G.length>0){Z.push("## Context"),Z.push("");for(let[U,W]of G)Z.push(`- **${U}:** ${W}`);Z.push("")}return Z.push("---"),Z.push(""),Z.push(`*${$K} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
212
- `)}function B2($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=X[1].trim();if(!Z.project.name){let q=$.match(/\*\*Name:\*\*\s*(.+)/);if(q)Z.project.name=q[1].trim()}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let q=$.match(/\*\*What Building:\*\*\s*(.+)/);if(q)Z.project.goal=q[1].trim()}let J=$.match(/\*\*Language:\*\*\s*(.+)/);if(J)Z.project.main_language=J[1].trim();if(!Z.project.main_language){let q=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(q)Z.project.main_language=q[1].trim()}return Z}import{readFileSync as EI,writeFileSync as ZK,existsSync as jI}from"fs";import{join as XK}from"path";function vz($,Z){ZK(XK($,"MEMORY.md"),Z,"utf-8")}d();function g$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function w5($={}){let Z=process.cwd(),X=f(Z);if(!X)console.error(`Error: project.faf not found
209
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=r(z),q=a(J);if(Z.json){console.log(JSON.stringify(q,null,2));return}if(Z.status){console.log(`${V2(q.tier)} ${b(`${q.score}%`)}`);return}t(q,X,Z.verbose)}import{existsSync as rV}from"fs";import{join as xz}from"path";var Y0=[{index:1,path:"project.name",description:"Project name",category:"project"},{index:2,path:"project.goal",description:"What the project does",category:"project"},{index:3,path:"project.main_language",description:"Primary language",category:"project"},{index:4,path:"human_context.who",description:"Who is building this",category:"human"},{index:5,path:"human_context.what",description:"What are they building",category:"human"},{index:6,path:"human_context.why",description:"Why does it exist",category:"human"},{index:7,path:"human_context.where",description:"Where does it run",category:"human"},{index:8,path:"human_context.when",description:"When was it started / timeline",category:"human"},{index:9,path:"human_context.how",description:"How is it built",category:"human"},{index:10,path:"stack.frontend",description:"Framework (React, Svelte, etc.)",category:"frontend"},{index:11,path:"stack.css_framework",description:"CSS framework",category:"frontend"},{index:12,path:"stack.ui_library",description:"UI component library",category:"frontend"},{index:13,path:"stack.state_management",description:"State management",category:"frontend"},{index:14,path:"stack.backend",description:"Backend framework",category:"backend"},{index:15,path:"stack.api_type",description:"API style (REST, GraphQL, etc.)",category:"backend"},{index:16,path:"stack.runtime",description:"Runtime (Node, Bun, Python, etc.)",category:"backend"},{index:17,path:"stack.database",description:"Database",category:"backend"},{index:18,path:"stack.connection",description:"Connection method (Prisma, etc.)",category:"backend"},{index:19,path:"stack.hosting",description:"Hosting platform",category:"universal"},{index:20,path:"stack.build",description:"Build tool",category:"universal"},{index:21,path:"stack.cicd",description:"CI/CD",category:"universal"},{index:22,path:"stack.monorepo_tool",description:"Monorepo tool",category:"enterprise_infra"},{index:23,path:"stack.package_manager",description:"Package manager",category:"enterprise_infra"},{index:24,path:"stack.workspaces",description:"Workspace configuration",category:"enterprise_infra"},{index:25,path:"monorepo.packages_count",description:"Number of packages",category:"enterprise_infra"},{index:26,path:"monorepo.build_orchestrator",description:"Build orchestration tool",category:"enterprise_infra"},{index:27,path:"stack.admin",description:"Admin panel",category:"enterprise_app"},{index:28,path:"stack.cache",description:"Caching layer",category:"enterprise_app"},{index:29,path:"stack.search",description:"Search engine",category:"enterprise_app"},{index:30,path:"stack.storage",description:"Object storage",category:"enterprise_app"},{index:31,path:"monorepo.versioning_strategy",description:"Version strategy",category:"enterprise_ops"},{index:32,path:"monorepo.shared_configs",description:"Shared configs",category:"enterprise_ops"},{index:33,path:"monorepo.remote_cache",description:"Remote build cache",category:"enterprise_ops"}],tN=new Map(Y0.map(($)=>[$.path,$]));var eN=Y0.filter(($)=>$.index<=21);var iV=new Set(["describe your project goal","development teams","cloud platform","null","none","unknown","n/a","not applicable"]);function k$($){if($===null||$===void 0||$==="")return!0;if(typeof $==="string")return iV.has($.toLowerCase().trim());if(Array.isArray($)&&$.length===0)return!0;if(typeof $==="object"&&Object.keys($).length===0)return!0;return!1}var f$={cli:["project","human"],library:["project","human"],mcp:["project","backend","human"],backend:["project","backend","universal","human"],"data-science":["project","backend","human"],frontend:["project","frontend","human"],fullstack:["project","frontend","backend","universal","human"],svelte:["project","frontend","backend","universal","human"],enterprise:["project","frontend","backend","universal","human","enterprise_infra","enterprise_app","enterprise_ops"]};import{existsSync as h,readFileSync as Rz,readdirSync as Fz}from"fs";import{join as k}from"path";var wz=[{name:"Next.js",slug:"nextjs",category:"frontend",signals:[{type:"dependency",key:"next"},{type:"file",pattern:"next.config.*"}]},{name:"React",slug:"react",category:"frontend",signals:[{type:"dependency",key:"react"}]},{name:"SvelteKit",slug:"sveltekit",category:"frontend",signals:[{type:"dependency",key:"@sveltejs/kit"},{type:"file",pattern:"svelte.config.*"}]},{name:"Svelte",slug:"svelte",category:"frontend",signals:[{type:"dependency",key:"svelte"}]},{name:"Vue.js",slug:"vue",category:"frontend",signals:[{type:"dependency",key:"vue"}]},{name:"Nuxt",slug:"nuxt",category:"frontend",signals:[{type:"dependency",key:"nuxt"},{type:"file",pattern:"nuxt.config.*"}]},{name:"Angular",slug:"angular",category:"frontend",signals:[{type:"dependency",key:"@angular/core"},{type:"file",pattern:"angular.json"}]},{name:"Astro",slug:"astro",category:"frontend",signals:[{type:"dependency",key:"astro"},{type:"file",pattern:"astro.config.*"}]},{name:"Solid",slug:"solid",category:"frontend",signals:[{type:"dependency",key:"solid-js"}]},{name:"Remix",slug:"remix",category:"frontend",signals:[{type:"dependency",key:"@remix-run/react"}]},{name:"Gatsby",slug:"gatsby",category:"frontend",signals:[{type:"dependency",key:"gatsby"},{type:"file",pattern:"gatsby-config.*"}]},{name:"Qwik",slug:"qwik",category:"frontend",signals:[{type:"dependency",key:"@builder.io/qwik"}]},{name:"Vercel (SvelteKit)",slug:"adapter-vercel",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-vercel"},{type:"devDependency",key:"@sveltejs/adapter-vercel"}]},{name:"Node (SvelteKit)",slug:"adapter-node",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-node"},{type:"devDependency",key:"@sveltejs/adapter-node"}]},{name:"Static (SvelteKit)",slug:"adapter-static",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-static"},{type:"devDependency",key:"@sveltejs/adapter-static"}]},{name:"Cloudflare (SvelteKit)",slug:"adapter-cloudflare",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-cloudflare"},{type:"devDependency",key:"@sveltejs/adapter-cloudflare"}]},{name:"Netlify (SvelteKit)",slug:"adapter-netlify",category:"hosting",signals:[{type:"dependency",key:"@sveltejs/adapter-netlify"},{type:"devDependency",key:"@sveltejs/adapter-netlify"}]},{name:"Tailwind CSS",slug:"tailwind",category:"css",signals:[{type:"dependency",key:"tailwindcss"},{type:"devDependency",key:"tailwindcss"},{type:"file",pattern:"tailwind.config.*"}]},{name:"Bootstrap",slug:"bootstrap",category:"css",signals:[{type:"dependency",key:"bootstrap"}]},{name:"Styled Components",slug:"styled-components",category:"css",signals:[{type:"dependency",key:"styled-components"}]},{name:"shadcn/ui",slug:"shadcn",category:"ui",signals:[{type:"file",pattern:"components.json"},{type:"dependency",key:"@radix-ui/react-dialog"}]},{name:"Material UI",slug:"mui",category:"ui",signals:[{type:"dependency",key:"@mui/material"}]},{name:"Chakra UI",slug:"chakra",category:"ui",signals:[{type:"dependency",key:"@chakra-ui/react"}]},{name:"Ant Design",slug:"antd",category:"ui",signals:[{type:"dependency",key:"antd"}]},{name:"Redux",slug:"redux",category:"state",signals:[{type:"dependency",key:"@reduxjs/toolkit"}]},{name:"Zustand",slug:"zustand",category:"state",signals:[{type:"dependency",key:"zustand"}]},{name:"Jotai",slug:"jotai",category:"state",signals:[{type:"dependency",key:"jotai"}]},{name:"Pinia",slug:"pinia",category:"state",signals:[{type:"dependency",key:"pinia"}]},{name:"Express",slug:"express",category:"backend",signals:[{type:"dependency",key:"express"}]},{name:"Fastify",slug:"fastify",category:"backend",signals:[{type:"dependency",key:"fastify"}]},{name:"Hono",slug:"hono",category:"backend",signals:[{type:"dependency",key:"hono"}]},{name:"Elysia",slug:"elysia",category:"backend",signals:[{type:"dependency",key:"elysia"}]},{name:"NestJS",slug:"nestjs",category:"backend",signals:[{type:"dependency",key:"@nestjs/core"}]},{name:"Koa",slug:"koa",category:"backend",signals:[{type:"dependency",key:"koa"}]},{name:"Django",slug:"django",category:"backend",signals:[{type:"file",pattern:"manage.py"},{type:"file",pattern:"settings.py"}]},{name:"Flask",slug:"flask",category:"backend",signals:[{type:"file",pattern:"app.py"}]},{name:"FastAPI",slug:"fastapi",category:"backend",signals:[{type:"file",pattern:"main.py"}]},{name:"Rails",slug:"rails",category:"backend",signals:[{type:"file",pattern:"Gemfile"},{type:"file",pattern:"config/routes.rb"}]},{name:"Spring Boot",slug:"spring",category:"backend",signals:[{type:"file",pattern:"pom.xml"},{type:"file",pattern:"build.gradle"}]},{name:"Prisma",slug:"prisma",category:"database",signals:[{type:"dependency",key:"prisma"},{type:"devDependency",key:"prisma"},{type:"file",pattern:"prisma/schema.prisma"}]},{name:"Drizzle",slug:"drizzle",category:"database",signals:[{type:"dependency",key:"drizzle-orm"},{type:"file",pattern:"drizzle.config.*"}]},{name:"TypeORM",slug:"typeorm",category:"database",signals:[{type:"dependency",key:"typeorm"}]},{name:"Mongoose",slug:"mongoose",category:"database",signals:[{type:"dependency",key:"mongoose"}]},{name:"Vite",slug:"vite",category:"build",signals:[{type:"dependency",key:"vite"},{type:"devDependency",key:"vite"},{type:"file",pattern:"vite.config.*"}]},{name:"webpack",slug:"webpack",category:"build",signals:[{type:"dependency",key:"webpack"},{type:"devDependency",key:"webpack"},{type:"file",pattern:"webpack.config.*"}]},{name:"esbuild",slug:"esbuild",category:"build",signals:[{type:"dependency",key:"esbuild"},{type:"devDependency",key:"esbuild"}]},{name:"Turbopack",slug:"turbopack",category:"build",signals:[{type:"file",pattern:"turbo.json"}]},{name:"Jest",slug:"jest",category:"testing",signals:[{type:"devDependency",key:"jest"},{type:"file",pattern:"jest.config.*"}]},{name:"Vitest",slug:"vitest",category:"testing",signals:[{type:"devDependency",key:"vitest"}]},{name:"Playwright",slug:"playwright",category:"testing",signals:[{type:"devDependency",key:"@playwright/test"},{type:"file",pattern:"playwright.config.*"}]},{name:"Cypress",slug:"cypress",category:"testing",signals:[{type:"devDependency",key:"cypress"},{type:"file",pattern:"cypress.config.*"}]},{name:"Turborepo",slug:"turborepo",category:"monorepo",signals:[{type:"devDependency",key:"turbo"},{type:"file",pattern:"turbo.json"}]},{name:"Nx",slug:"nx",category:"monorepo",signals:[{type:"devDependency",key:"nx"},{type:"file",pattern:"nx.json"}]},{name:"Lerna",slug:"lerna",category:"monorepo",signals:[{type:"devDependency",key:"lerna"},{type:"file",pattern:"lerna.json"}]},{name:"MCP SDK",slug:"mcp",category:"ai",signals:[{type:"dependency",key:"@modelcontextprotocol/sdk"}]},{name:"Anthropic SDK",slug:"anthropic",category:"ai",signals:[{type:"dependency",key:"@anthropic-ai/sdk"}]},{name:"OpenAI SDK",slug:"openai",category:"ai",signals:[{type:"dependency",key:"openai"}]},{name:"LangChain",slug:"langchain",category:"ai",signals:[{type:"dependency",key:"langchain"}]},{name:"Vercel",slug:"vercel",category:"hosting",signals:[{type:"file",pattern:"vercel.json"}]},{name:"Netlify",slug:"netlify",category:"hosting",signals:[{type:"file",pattern:"netlify.toml"}]},{name:"Docker",slug:"docker",category:"hosting",signals:[{type:"file",pattern:"Dockerfile"},{type:"file",pattern:"docker-compose.yml"}]},{name:"Cloudflare Workers",slug:"cloudflare",category:"hosting",signals:[{type:"file",pattern:"wrangler.toml"},{type:"dependency",key:"wrangler"}]},{name:"GitHub Actions",slug:"github-actions",category:"cicd",signals:[{type:"file",pattern:".github/workflows/*.yml"}]},{name:"Commander.js",slug:"commander",category:"cli",signals:[{type:"dependency",key:"commander"}]}];function V$($){let Z=k($,"package.json");if(!h(Z))return null;try{return JSON.parse(Rz(Z,"utf-8"))}catch{return null}}function nV($,Z){if(!Z.includes("*"))return h(k($,Z));let X=Z.split("/");if(X.length===1){let Y=Z.split("*")[0];try{return Fz($).some((G)=>G.startsWith(Y))}catch{return!1}}let z=k($,...X.slice(0,-1)),J=X[X.length-1],q=J.split("*")[0],Q=J.split("*")[1]||"";try{return Fz(z).some((Y)=>Y.startsWith(q)&&Y.endsWith(Q))}catch{return!1}}function sV($,Z,X){switch($.type){case"dependency":return!!Z?.dependencies?.[$.key];case"devDependency":return!!Z?.devDependencies?.[$.key];case"file":return nV(X,$.pattern);default:return!1}}function M5($){let Z=V$($);return wz.map((X)=>{let J=X.signals.filter((q)=>sV(q,Z,$)).length/X.signals.length;return{name:X.name,slug:X.slug,category:X.category,confidence:J}}).filter((X)=>X.confidence>0).sort((X,z)=>z.confidence-X.confidence)}function Az($){let Z=V$($);if(Z?.devDependencies?.typescript||Z?.dependencies?.typescript)return"TypeScript";if(h(k($,"tsconfig.json")))return"TypeScript";if(h(k($,"Cargo.toml")))return"Rust";if(h(k($,"go.mod")))return"Go";if(h(k($,"pyproject.toml"))||h(k($,"setup.py")))return"Python";if(h(k($,"Gemfile")))return"Ruby";if(h(k($,"pom.xml"))||h(k($,"build.gradle")))return"Java";if(h(k($,"Package.swift")))return"Swift";if(h(k($,"build.zig")))return"Zig";if(Z)return"JavaScript";return"Unknown"}function Pz($){let Z=V$($),X=M5($);if(Z?.bin)return"cli";if(X.some((Y)=>Y.slug==="mcp"))return"mcp";if(X.some((Y)=>Y.slug==="svelte"||Y.slug==="sveltekit"))return"svelte";let q=X.some((Y)=>Y.category==="frontend"),Q=X.some((Y)=>Y.category==="backend");if(q&&Q)return"fullstack";if(q)return"frontend";if(Q)return"backend";if(Z?.main&&!Z?.bin)return"library";return"library"}function _z($){if(h(k($,"bunfig.toml")))return"Bun";if(h(k($,"deno.json"))||h(k($,"deno.jsonc")))return"Deno";if(V$($))return"Node.js";if(h(k($,"Cargo.toml")))return"Rust";if(h(k($,"go.mod")))return"Go";return"Unknown"}function Cz($){if(h(k($,"bun.lockb"))||h(k($,"bun.lock")))return"bun";if(h(k($,"pnpm-lock.yaml")))return"pnpm";if(h(k($,"yarn.lock")))return"yarn";if(h(k($,"package-lock.json")))return"npm";return"npm"}function Sz($){if(h(k($,".github/workflows")))return"GitHub Actions";if(h(k($,".gitlab-ci.yml")))return"GitLab CI";if(h(k($,".circleci")))return"CircleCI";if(h(k($,"Jenkinsfile")))return"Jenkins";return null}function Ez($){if(h(k($,"vercel.json")))return"Vercel";if(h(k($,"netlify.toml")))return"Netlify";if(h(k($,"wrangler.toml")))return"Cloudflare";if(h(k($,"Dockerfile")))return"Docker";if(h(k($,"fly.toml")))return"Fly.io";if(h(k($,"render.yaml")))return"Render";return null}function jz($){let Z=k($,"svelte.config.js");if(!h(Z))return null;try{let z=Rz(Z,"utf-8").match(/@sveltejs\/adapter-(\w+)/);if(z){let J=z[1];switch(J){case"vercel":return"Vercel";case"node":return"Node";case"static":return"Static";case"cloudflare":return"Cloudflare";case"netlify":return"Netlify";case"auto":return"Auto";default:return J}}return null}catch{return null}}function bz($){let Z=V$($);if(Z?.devDependencies?.vite||Z?.dependencies?.vite)return"Vite";if(Z?.devDependencies?.webpack||Z?.dependencies?.webpack)return"webpack";if(Z?.devDependencies?.esbuild||Z?.dependencies?.esbuild)return"esbuild";if(h(k($,"tsconfig.json"))&&Z?.devDependencies?.typescript)return"TypeScript (tsc)";return null}function y$($){let Z=V$($),X=M5($),z=Az($),J=Pz($),q=_z($),Q=Cz($),Y=Sz($),G=Ez($),U=bz($),W=X.find((T)=>T.category==="frontend"),V=X.find((T)=>T.category==="css"),H=X.find((T)=>T.category==="ui"),B=X.find((T)=>T.category==="state"),M=X.find((T)=>T.category==="backend"),D=X.find((T)=>T.category==="database"),N=f$[J]||f$.library,w=J==="svelte",P=w?jz($):null,_=w&&X.some((T)=>T.slug==="sveltekit"),R={},E=Y0.filter((T)=>T.path.startsWith("stack."));for(let T of E){let x=T.path.replace("stack.","");if(!N.includes(T.category)){R[x]="slotignored";continue}switch(x){case"frontend":R[x]=W?.name??(J==="cli"?"CLI":"");break;case"css_framework":R[x]=V?.name??"";break;case"ui_library":R[x]=H?.name??"";break;case"state_management":R[x]=w?B?.name??"Runes":B?.name??"";break;case"backend":R[x]=w?_?"SvelteKit":M?.name??"":M?.name??"";break;case"api_type":R[x]=_?"Server Routes":"";break;case"runtime":R[x]=q!=="Unknown"?q:"";break;case"database":R[x]=D?.name??"";break;case"connection":R[x]=D?.name??"";break;case"hosting":if(w&&P)R[x]=P;else R[x]=G??"";break;case"build":R[x]=w?"Vite":U??"";break;case"cicd":R[x]=Y??"";break;case"package_manager":R[x]=Q;break;default:R[x]="";break}}let C={},p=Y0.filter((T)=>T.path.startsWith("monorepo."));for(let T of p){let x=T.path.replace("monorepo.","");if(!N.includes(T.category))C[x]="slotignored";else C[x]=""}return{faf_version:"2.5.0",project:{name:Z?.name??$.split("/").pop()??"project",goal:Z?.description??"",main_language:z,type:J},stack:R,human_context:{who:"",what:Z?.description??"",why:"",where:"",when:"",how:""},monorepo:C}}c();function O5($={}){let Z=process.cwd(),X=$.output?$.output.endsWith(".faf")?$.output:xz(Z,$.output):xz(Z,"project.faf");if(rV(X)&&!$.force)console.error(`project.faf already exists. Use ${b("--force")} to overwrite.`),process.exit(1);let z=y$(Z);i(X,z);let J=m(X),q=a(r(J));if(console.log(`${F("created")} ${X}`),t(q,X),q.score<100)console.log(I(`
210
+ run ${b("'faf go'")} to fill empty slots`))}import{existsSync as aV}from"fs";import{join as oV}from"path";c();function kz(){let $=process.cwd(),Z=oV($,"project.faf"),X=y$($);if(aV(Z)){let q=d(Z),Q=fz(q,X);i(Z,Q),console.log(`${F("updated")} ${Z}`)}else{let q=X.project?.type??"library",Q=f$[q]||f$.library;for(let Y of Y0)if(!Q.includes(Y.category)){let[G,U]=Y.path.split(".");if(G==="stack"&&X.stack)X.stack[U]="slotignored";if(G==="monorepo"&&X.monorepo)X.monorepo[U]="slotignored"}i(Z,X),console.log(`${F("created")} ${Z}`)}let z=m(Z),J=a(r(z));if(t(J,Z),J.score<100)console.log(I(`
211
+ run ${b("'faf go'")} to reach 100%`))}function fz($,Z){let X={...$};for(let[z,J]of Object.entries(Z))if(!(z in X)||X[z]===null||X[z]===void 0)X[z]=J;else if(typeof J==="object"&&J!==null&&!Array.isArray(J))X[z]=fz(X[z]??{},J);return X}import{existsSync as h$,statSync as B2}from"fs";import{join as dz}from"path";import{readFileSync as tV,writeFileSync as eV,existsSync as $K,statSync as _I}from"fs";import{join as yz}from"path";var gz="CLAUDE.md",ZK="STATUS: BI-SYNC ACTIVE";function hz($){let Z=yz($,gz);if(!$K(Z))return null;return tV(Z,"utf-8")}function vz($,Z){let X=yz($,gz);eV(X,Z,"utf-8")}function K$($){return`<!-- faf: ${[$.project?.name,$.project?.main_language,$.project?.goal].filter(Boolean).map((X)=>String(X).trim()).join(" | ")} -->`}function uz($){let Z=[],X=$.project?.name??"Project",z=$.project?.main_language??"",J=$.project?.goal??"";if(Z.push(K$($)),Z.push(""),Z.push(`# CLAUDE.md — ${X}`),Z.push(""),J)Z.push("## What This Is"),Z.push(""),Z.push(J),Z.push("");let q=$.stack??{},Q=[];if(z)Q.push(`**Language:** ${z}`);for(let[U,W]of Object.entries(q))if(W&&W!=="slotignored"&&String(W).trim()){let V=U.replace(/_/g," ").replace(/\b\w/g,(H)=>H.toUpperCase());Q.push(`**${V}:** ${W}`)}if(Q.length>0){Z.push("## Stack"),Z.push("");for(let U of Q)Z.push(`- ${U}`);Z.push("")}let Y=$.human_context??{},G=[["Who",Y.who],["What",Y.what],["Why",Y.why],["Where",Y.where],["When",Y.when],["How",Y.how]].filter(([U,W])=>W&&String(W).trim());if(G.length>0){Z.push("## Context"),Z.push("");for(let[U,W]of G)Z.push(`- **${U}:** ${W}`);Z.push("")}return Z.push("---"),Z.push(""),Z.push(`*${ZK} — ${new Date().toISOString()}*`),Z.push(""),Z.join(`
212
+ `)}function D2($){let Z={project:{}},X=$.match(/^# CLAUDE\.md\s*[—–-]\s*(.+)$/m);if(X)Z.project.name=X[1].trim();if(!Z.project.name){let q=$.match(/\*\*Name:\*\*\s*(.+)/);if(q)Z.project.name=q[1].trim()}let z=$.match(/## What This Is\s*\n\s*\n(.+)/);if(z)Z.project.goal=z[1].trim();if(!Z.project.goal){let q=$.match(/\*\*What Building:\*\*\s*(.+)/);if(q)Z.project.goal=q[1].trim()}let J=$.match(/\*\*Language:\*\*\s*(.+)/);if(J)Z.project.main_language=J[1].trim();if(!Z.project.main_language){let q=$.match(/\*\*Main Language:\*\*\s*(.+)/);if(q)Z.project.main_language=q[1].trim()}return Z}import{readFileSync as jI,writeFileSync as XK,existsSync as bI}from"fs";import{join as zK}from"path";function mz($,Z){XK(zK($,"MEMORY.md"),Z,"utf-8")}c();function g$(){return process.env.FAF_PRO==="1"||process.env.FAF_PRO==="true"}function w5($={}){let Z=process.cwd(),X=g(Z);if(!X)console.error(`Error: project.faf not found
213
213
 
214
- Run 'faf init' to create one.`),process.exit(2);let z=uz(Z,"CLAUDE.md"),J=uz(Z,"MEMORY.md"),q=$.direction??"auto";if(q==="auto")mz(X,z,Z);else if(q==="push")dz(X,Z);else if(q==="pull")cz(X,z);if(g$())pz(X,J,Z);if($.watch)console.log(I("watching for changes... (Ctrl+C to stop)")),JK(X,z,J,Z)}function mz($,Z,X){let z=D2($).mtimeMs,J=h$(Z)?D2(Z).mtimeMs:0;if(!h$(Z)||z>J)dz($,X);else cz($,Z)}function dz($,Z){let X=m($),z=hz(X);gz(Z,z),console.log(`${w("◆")} sync .faf → CLAUDE.md ${I("← bi-sync")}`);let J=r(s(u($)));o(J,$)}function cz($,Z){let X=yz(Z.replace("/CLAUDE.md",""));if(!X){console.error("CLAUDE.md not found.");return}let z=B2(X),J=m($);if(z.project?.name)J.project={...J.project,name:z.project.name};if(z.project?.goal)J.project={...J.project,goal:z.project.goal};if(z.project?.main_language)J.project={...J.project,main_language:z.project.main_language};l($,J),console.log(`${w("◆")} sync CLAUDE.md → .faf ${I("← bi-sync")}`);let q=r(s(u($)));o(q,$)}function pz($,Z,X){let z=m($),J=D2($).mtimeMs,q=h$(Z)?D2(Z).mtimeMs:0;if(!h$(Z)||J>q){let Q=zK(z);vz(X,Q),console.log(`${w("◆")} sync .faf → MEMORY.md ${I("← tri-sync")}`)}else console.log(`${w("◆")} sync MEMORY.md → .faf ${I("← tri-sync")}`)}function zK($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(Z.name)X.push(`- **Project:** ${Z.name}`);if(Z.goal)X.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)X.push(`- **Language:** ${Z.main_language}`);if(Z.type)X.push(`- **Type:** ${Z.type}`);return X.join(`
214
+ Run 'faf init' to create one.`),process.exit(2);let z=dz(Z,"CLAUDE.md"),J=dz(Z,"MEMORY.md"),q=$.direction??"auto";if(q==="auto")cz(X,z,Z);else if(q==="push")pz(X,Z);else if(q==="pull")lz(X,z);if(g$())iz(X,J,Z);if($.watch)console.log(I("watching for changes... (Ctrl+C to stop)")),qK(X,z,J,Z)}function cz($,Z,X){let z=B2($).mtimeMs,J=h$(Z)?B2(Z).mtimeMs:0;if(!h$(Z)||z>J)pz($,X);else lz($,Z)}function pz($,Z){let X=d($),z=uz(X);vz(Z,z),console.log(`${F("◆")} sync .faf → CLAUDE.md ${I("← bi-sync")}`);let J=a(r(m($)));t(J,$)}function lz($,Z){let X=hz(Z.replace("/CLAUDE.md",""));if(!X){console.error("CLAUDE.md not found.");return}let z=D2(X),J=d($);if(z.project?.name)J.project={...J.project,name:z.project.name};if(z.project?.goal)J.project={...J.project,goal:z.project.goal};if(z.project?.main_language)J.project={...J.project,main_language:z.project.main_language};i($,J),console.log(`${F("◆")} sync CLAUDE.md → .faf ${I("← bi-sync")}`);let q=a(r(m($)));t(q,$)}function iz($,Z,X){let z=d($),J=B2($).mtimeMs,q=h$(Z)?B2(Z).mtimeMs:0;if(!h$(Z)||J>q){let Q=JK(z);mz(X,Q),console.log(`${F("◆")} sync .faf → MEMORY.md ${I("← tri-sync")}`)}else console.log(`${F("◆")} sync MEMORY.md → .faf ${I("← tri-sync")}`)}function JK($){let Z=$.project??{},X=[`# ${Z.name??"Project"} — Memory Topics`,"","> Generated by faf sync (tri-sync)",""];if(Z.name)X.push(`- **Project:** ${Z.name}`);if(Z.goal)X.push(`- **Goal:** ${Z.goal}`);if(Z.main_language)X.push(`- **Language:** ${Z.main_language}`);if(Z.type)X.push(`- **Type:** ${Z.type}`);return X.join(`
215
215
  `)+`
216
- `}function JK($,Z,X,z){let{watch:J}=J0("fs"),q=null,Q=()=>{if(q)clearTimeout(q);q=setTimeout(()=>{if(console.log(I("change detected...")),mz($,Z,z),g$())pz($,X,z)},200)};if(J($,Q),h$(Z))J(Z,Q);if(g$()&&h$(X))J(X,Q)}import{writeFileSync as qK}from"fs";d();function lz($,Z={}){let X=$??f();if(!X)console.error(`Error: project.faf not found
216
+ `}function qK($,Z,X,z){let{watch:J}=J0("fs"),q=null,Q=()=>{if(q)clearTimeout(q);q=setTimeout(()=>{if(console.log(I("change detected...")),cz($,Z,z),g$())iz($,X,z)},200)};if(J($,Q),h$(Z))J(Z,Q);if(g$()&&h$(X))J(X,Q)}import{writeFileSync as QK}from"fs";c();function nz($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
217
217
 
218
- Run 'faf init' to create one.`),process.exit(2);let z=u(X),J=Iz(z),q=Z.output??X.replace(/\.faf$/,".fafb");qK(q,J),console.log(`${w("compiled")} ${q} ${I(`(${J.length} bytes)`)}`)}import{readFileSync as QK}from"fs";function iz($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(QK($));if(String.fromCharCode(X[0],X[1],X[2],X[3])!=="FAFB")console.error("Error: Not a valid .fafb file (missing FAFB magic bytes)."),process.exit(3);let z=Lz(X);console.log(JSON.stringify(z,null,2))}function nz($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");return{valid:Z.length===0,errors:Z}}d();function F5($,Z={}){let X=$??f();if(!X)console.error(`Error: project.faf not found
218
+ Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=Iz(z),q=Z.output??X.replace(/\.faf$/,".fafb");QK(q,J),console.log(`${F("compiled")} ${q} ${I(`(${J.length} bytes)`)}`)}import{readFileSync as YK}from"fs";function sz($,Z={}){if(!$)console.error("Error: Please specify a .fafb file to decompile."),process.exit(1);let X=new Uint8Array(YK($));if(String.fromCharCode(X[0],X[1],X[2],X[3])!=="FAFB")console.error("Error: Not a valid .fafb file (missing FAFB magic bytes)."),process.exit(3);let z=Lz(X);console.log(JSON.stringify(z,null,2))}function rz($){let Z=[];if(!$||typeof $!=="object")return Z.push("File is not a valid YAML mapping"),{valid:!1,errors:Z};let X=$;if(!X.faf_version)Z.push("Missing required field: faf_version");if(!X.project?.name)Z.push("Missing required field: project.name");return{valid:Z.length===0,errors:Z}}c();function F5($,Z={}){let X=$??g();if(!X)console.error(`Error: project.faf not found
219
219
 
220
- Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=nz(z);if(!J.valid){console.log(`${b("invalid")} ${X}`);for(let Y of J.errors)console.log(` ${I("x")} ${Y}`);process.exit(3)}let q=u(X);if(!Nz(q))console.log(`${b("invalid yaml")} ${X}`),process.exit(3);console.log(`${w("valid")} ${X}`);let Q=r(s(q));if(o(Q,X),Z.strict&&Q.score<100)console.log(I(`
221
- --strict requires 100%`)),process.exit(1)}import{writeFileSync as YK}from"fs";import{join as GK}from"path";function UK($){let Z=[];if(Z.push(K$($)),Z.push(""),Z.push(`# AGENTS.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf — do not edit directly"),Z.push(""),Z.push("## Project Context"),Z.push(""),$.project?.name)Z.push(`- **Name:** ${$.project.name}`);if($.project?.goal)Z.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)Z.push(`- **Language:** ${$.project.main_language}`);if(Z.push(""),Z.push("## Stack"),Z.push(""),$.stack){for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- **${X}:** ${z}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[X,z]of Object.entries($.human_context))if(z&&z!=="")Z.push(`- **${X}:** ${z}`)}return Z.push(""),Z.join(`
222
- `)}function sz($,Z){YK(GK($,"AGENTS.md"),UK(Z),"utf-8")}import{writeFileSync as WK}from"fs";import{join as HK}from"path";function VK($){let Z=[];if(Z.push(K$($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`# ${X}: ${z}`)}return Z.push(""),Z.join(`
223
- `)}function rz($,Z){WK(HK($,".cursorrules"),VK(Z),"utf-8")}import{writeFileSync as KK}from"fs";import{join as BK}from"path";function DK($){let Z=[];if(Z.push(K$($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf"),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("## Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- ${X}: ${z}`)}return Z.push(""),Z.join(`
224
- `)}function az($,Z){KK(BK($,"GEMINI.md"),DK(Z),"utf-8")}d();function f6($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
220
+ Run 'faf init' to create one.`),process.exit(2);let z=d(X),J=rz(z);if(!J.valid){console.log(`${b("invalid")} ${X}`);for(let Y of J.errors)console.log(` ${I("x")} ${Y}`);process.exit(3)}let q=m(X);if(!Nz(q))console.log(`${b("invalid yaml")} ${X}`),process.exit(3);console.log(`${F("valid")} ${X}`);let Q=a(r(q));if(t(Q,X),Z.strict&&Q.score<100)console.log(I(`
221
+ --strict requires 100%`)),process.exit(1)}import{writeFileSync as GK}from"fs";import{join as UK}from"path";function WK($){let Z=[];if(Z.push(K$($)),Z.push(""),Z.push(`# AGENTS.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf — do not edit directly"),Z.push(""),Z.push("## Project Context"),Z.push(""),$.project?.name)Z.push(`- **Name:** ${$.project.name}`);if($.project?.goal)Z.push(`- **Goal:** ${$.project.goal}`);if($.project?.main_language)Z.push(`- **Language:** ${$.project.main_language}`);if(Z.push(""),Z.push("## Stack"),Z.push(""),$.stack){for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- **${X}:** ${z}`)}if($.human_context){Z.push(""),Z.push("## Human Context"),Z.push("");for(let[X,z]of Object.entries($.human_context))if(z&&z!=="")Z.push(`- **${X}:** ${z}`)}return Z.push(""),Z.join(`
222
+ `)}function az($,Z){GK(UK($,"AGENTS.md"),WK(Z),"utf-8")}import{writeFileSync as HK}from"fs";import{join as VK}from"path";function KK($){let Z=[];if(Z.push(K$($)),Z.push(""),Z.push("# .cursorrules"),Z.push(`# Auto-generated from project.faf — ${$.project?.name??"Project"}`),Z.push(""),$.project?.main_language)Z.push(`language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("# Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`# ${X}: ${z}`)}return Z.push(""),Z.join(`
223
+ `)}function oz($,Z){HK(VK($,".cursorrules"),KK(Z),"utf-8")}import{writeFileSync as DK}from"fs";import{join as BK}from"path";function NK($){let Z=[];if(Z.push(K$($)),Z.push(""),Z.push(`# GEMINI.md — ${$.project?.name??"Project"}`),Z.push(""),Z.push("> Auto-generated from project.faf"),Z.push(""),$.project?.name)Z.push(`Project: ${$.project.name}`);if($.project?.goal)Z.push(`Goal: ${$.project.goal}`);if($.project?.main_language)Z.push(`Language: ${$.project.main_language}`);if($.stack){Z.push(""),Z.push("## Stack");for(let[X,z]of Object.entries($.stack))if(z&&z!=="slotignored"&&z!=="")Z.push(`- ${X}: ${z}`)}return Z.push(""),Z.join(`
224
+ `)}function tz($,Z){DK(BK($,"GEMINI.md"),NK(Z),"utf-8")}c();function f6($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
225
225
 
226
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=m(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor;if(J||$.agents)sz(X,z),console.log(" AGENTS.md");if(J||$.cursor)rz(X,z),console.log(" .cursorrules");if(J||$.gemini)az(X,z),console.log(" GEMINI.md");console.log(`${w("exported")} ${I(`from ${Z}`)}`)}import{mkdirSync as NK,rmSync as IK}from"fs";import{join as oz}from"path";import{execSync as LK}from"child_process";import{tmpdir as TK}from"os";d();function tz($){if(!$)console.error(`Error: Please provide a GitHub URL.
226
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=d(Z),J=$.all||!$.agents&&!$.cursor&&!$.gemini&&!$.conductor;if(J||$.agents)az(X,z),console.log(" AGENTS.md");if(J||$.cursor)oz(X,z),console.log(" .cursorrules");if(J||$.gemini)tz(X,z),console.log(" GEMINI.md");console.log(`${F("exported")} ${I(`from ${Z}`)}`)}import{mkdirSync as IK,rmSync as LK}from"fs";import{join as ez}from"path";import{execSync as TK}from"child_process";import{tmpdir as MK}from"os";c();function $9($){if(!$)console.error(`Error: Please provide a GitHub URL.
227
227
 
228
- Usage: faf git <url>`),process.exit(1);let Z=$.endsWith(".git")?$:`${$}.git`,X=oz(TK(),`faf-git-${Date.now()}`);NK(X,{recursive:!0});try{console.log(I(`cloning ${$}...`)),LK(`git clone --depth 1 ${Z} ${X}`,{stdio:"pipe"});let z=y$(X),J=oz(process.cwd(),"project.faf");l(J,z),console.log(`${w("created")} ${J}`);let q=u(J),Q=r(s(q));o(Q,J)}finally{IK(X,{recursive:!0,force:!0})}}d();function $9($={}){if($.version||Object.keys($).length===0)OK()}function OK(){let $=ez();console.log(`${w(b("faf"))} v${$.version}`),console.log(I(`kernel ${Tz()} IANA application/vnd.faf+yaml`))}var y6=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];d();function Z9(){console.log(`${w("formats")} ${I("— supported file types")}
229
- `);let $=new Map;for(let Z of y6){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${b(Z)}`);for(let z of X)console.log(` ${z.name} ${I(z.extensions.join(", "))}`);console.log()}console.log(I(` ${y6.length} formats across ${$.size} categories`))}d();import{readdirSync as wK,rmSync as FK}from"fs";import{tmpdir as RK}from"os";import{join as AK}from"path";function X9(){let $=RK(),Z=0;try{let X=wK($);for(let z of X)if(z.startsWith("faf-git-"))FK(AK($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${w("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(I("nothing to clear"))}function z9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
228
+ Usage: faf git <url>`),process.exit(1);let Z=$.endsWith(".git")?$:`${$}.git`,X=ez(MK(),`faf-git-${Date.now()}`);IK(X,{recursive:!0});try{console.log(I(`cloning ${$}...`)),TK(`git clone --depth 1 ${Z} ${X}`,{stdio:"pipe"});let z=y$(X),J=ez(process.cwd(),"project.faf");i(J,z),console.log(`${F("created")} ${J}`);let q=m(J),Q=a(r(q));t(Q,J)}finally{LK(X,{recursive:!0,force:!0})}}c();function X9($={}){if($.version||Object.keys($).length===0)wK()}function wK(){let $=Z9();console.log(`${F(b("faf"))} v${$.version}`),console.log(I(`kernel ${Tz()} IANA application/vnd.faf+yaml`))}var y6=[{name:"HTML",extensions:[".html",".htm"],category:"web"},{name:"CSS",extensions:[".css"],category:"web"},{name:"JavaScript",extensions:[".js",".mjs",".cjs"],category:"web"},{name:"TypeScript",extensions:[".ts",".tsx",".mts",".cts"],category:"web"},{name:"JSX",extensions:[".jsx"],category:"web"},{name:"Vue",extensions:[".vue"],category:"web"},{name:"Svelte",extensions:[".svelte"],category:"web"},{name:"Astro",extensions:[".astro"],category:"web"},{name:"JSON",extensions:[".json"],category:"data"},{name:"YAML",extensions:[".yml",".yaml"],category:"data"},{name:"TOML",extensions:[".toml"],category:"data"},{name:"XML",extensions:[".xml"],category:"data"},{name:"CSV",extensions:[".csv"],category:"data"},{name:"INI",extensions:[".ini",".cfg"],category:"config"},{name:"Env",extensions:[".env"],category:"config"},{name:"Dockerfile",extensions:["Dockerfile"],category:"config"},{name:"Rust",extensions:[".rs"],category:"systems"},{name:"Go",extensions:[".go"],category:"systems"},{name:"C",extensions:[".c",".h"],category:"systems"},{name:"C++",extensions:[".cpp",".cc",".hpp"],category:"systems"},{name:"Zig",extensions:[".zig"],category:"systems"},{name:"Python",extensions:[".py"],category:"scripting"},{name:"Ruby",extensions:[".rb"],category:"scripting"},{name:"Shell",extensions:[".sh",".bash",".zsh"],category:"scripting"},{name:"Lua",extensions:[".lua"],category:"scripting"},{name:"Java",extensions:[".java"],category:"jvm"},{name:"Kotlin",extensions:[".kt",".kts"],category:"jvm"},{name:"Scala",extensions:[".scala"],category:"jvm"},{name:"C#",extensions:[".cs"],category:"dotnet"},{name:"F#",extensions:[".fs"],category:"dotnet"},{name:"Swift",extensions:[".swift"],category:"mobile"},{name:"Dart",extensions:[".dart"],category:"mobile"},{name:"Markdown",extensions:[".md",".mdx"],category:"docs"},{name:"LaTeX",extensions:[".tex"],category:"docs"},{name:"reStructuredText",extensions:[".rst"],category:"docs"},{name:"FAF",extensions:[".faf"],category:"faf"},{name:"FAFb",extensions:[".fafb"],category:"faf"}];c();function z9(){console.log(`${F("formats")} ${I("— supported file types")}
229
+ `);let $=new Map;for(let Z of y6){let X=$.get(Z.category)??[];X.push(Z),$.set(Z.category,X)}for(let[Z,X]of $){console.log(` ${b(Z)}`);for(let z of X)console.log(` ${z.name} ${I(z.extensions.join(", "))}`);console.log()}console.log(I(` ${y6.length} formats across ${$.size} categories`))}c();import{readdirSync as FK,rmSync as RK}from"fs";import{tmpdir as AK}from"os";import{join as PK}from"path";function J9(){let $=AK(),Z=0;try{let X=FK($);for(let z of X)if(z.startsWith("faf-git-"))RK(PK($,z),{recursive:!0,force:!0}),Z++}catch{}if(Z>0)console.log(`${F("cleared")} ${Z} cached director${Z===1?"y":"ies"}`);else console.log(I("nothing to clear"))}function q9($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
230
230
 
231
- Run 'faf init' to create one.`),process.exit(2);if($.json){let X=m(Z);console.log(JSON.stringify(X,null,2))}else{let X=u(Z);console.log(X)}}d();function J9(){let $=f();if(!$)console.error(`Error: project.faf not found
231
+ Run 'faf init' to create one.`),process.exit(2);if($.json){let X=d(Z);console.log(JSON.stringify(X,null,2))}else{let X=m(Z);console.log(X)}}c();function Q9(){let $=g();if(!$)console.error(`Error: project.faf not found
232
232
 
233
- Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=[];for(let z of Y0){let[J,q]=z.path.split("."),Y=Z[J]?.[q];if(k$(Y)||Y==="slotignored")continue;X.push(`${z.path}: ${Y}`)}if(X.length===0){console.log(I("no populated slots"));return}console.log(X.join(`
234
- `))}import{existsSync as PK,statSync as q9}from"fs";import{join as SK}from"path";d();var _K=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function Q9(){let $=f();if(!$)console.error(`Error: project.faf not found
233
+ Run 'faf init' to create one.`),process.exit(2);let Z=d($),X=[];for(let z of Y0){let[J,q]=z.path.split("."),Y=Z[J]?.[q];if(k$(Y)||Y==="slotignored")continue;X.push(`${z.path}: ${Y}`)}if(X.length===0){console.log(I("no populated slots"));return}console.log(X.join(`
234
+ `))}import{existsSync as _K,statSync as Y9}from"fs";import{join as CK}from"path";c();var SK=["CLAUDE.md","AGENTS.md",".cursorrules","GEMINI.md"];function G9(){let $=g();if(!$)console.error(`Error: project.faf not found
235
235
 
236
- Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=q9($).mtimeMs;console.log(`${w("drift")} ${I("— context file sync status")}
237
- `),console.log(` ${b(".faf")} ${I(R5(X))}`);let z=0;for(let J of _K){let q=SK(Z,J);if(!PK(q)){console.log(` ${I("○")} ${J} ${I("missing")}`);continue}let Q=q9(q).mtimeMs,Y=Q-X;if(Math.abs(Y)<1000)console.log(` ${w("●")} ${J} ${I("in sync")}`);else if(Y>0)console.log(` ${b("!")} ${J} ${b("newer")} ${I(R5(Q))}`),z++;else console.log(` ${I("○")} ${J} ${I("older")} ${I(R5(Q))}`),z++}if(z>0)console.log(I(`
238
- run ${b("'faf sync'")} to resolve drift`))}function R5($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}d();function Y9($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
236
+ Run 'faf init' to create one.`),process.exit(2);let Z=process.cwd(),X=Y9($).mtimeMs;console.log(`${F("drift")} ${I("— context file sync status")}
237
+ `),console.log(` ${b(".faf")} ${I(R5(X))}`);let z=0;for(let J of SK){let q=CK(Z,J);if(!_K(q)){console.log(` ${I("○")} ${J} ${I("missing")}`);continue}let Q=Y9(q).mtimeMs,Y=Q-X;if(Math.abs(Y)<1000)console.log(` ${F("●")} ${J} ${I("in sync")}`);else if(Y>0)console.log(` ${b("!")} ${J} ${b("newer")} ${I(R5(Q))}`),z++;else console.log(` ${I("○")} ${J} ${I("older")} ${I(R5(Q))}`),z++}if(z>0)console.log(I(`
238
+ run ${b("'faf sync'")} to resolve drift`))}function R5($){let Z=Date.now()-$,X=Math.floor(Z/1000);if(X<60)return`${X}s ago`;let z=Math.floor(X/60);if(z<60)return`${z}m ago`;let J=Math.floor(z/60);if(J<24)return`${J}h ago`;return`${Math.floor(J/24)}d ago`}c();function U9($,Z){if(!$||Z===void 0)console.error(`Usage: faf edit <path> <value>
239
239
 
240
- Example: faf edit project.name "My Project"`),process.exit(1);let X=f();if(!X)console.error(`Error: project.faf not found
240
+ Example: faf edit project.name "My Project"`),process.exit(1);let X=g();if(!X)console.error(`Error: project.faf not found
241
241
 
242
- Run 'faf init' to create one.`),process.exit(2);let z=m(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[q,Q]=J;if(!z[q]||typeof z[q]!=="object")z[q]={};z[q][Q]=Z,l(X,z),console.log(`${w("updated")} ${$} ${I("→")} ${Z}`)}import{existsSync as N2,readFileSync as A5}from"fs";import{join as g6}from"path";d();function G9(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=g6($,"CLAUDE.md");if(N2(z)){let G=A5(z,"utf-8"),U=B2(G);if(U.project?.name)X.project.name=U.project.name;if(U.project?.goal)X.project.goal=U.project.goal;if(U.project?.main_language)X.project.main_language=U.project.main_language;Z.push("CLAUDE.md")}let J=g6($,"AGENTS.md");if(N2(J)){let G=A5(J,"utf-8");if(!X.project.name){let U=G.match(/^#\s+(.+)/m);if(U)X.project.name=U[1].trim()}Z.push("AGENTS.md")}let q=g6($,"GEMINI.md");if(N2(q)){let G=A5(q,"utf-8");if(!X.project.name){let U=G.match(/^#\s+(.+)/m);if(U)X.project.name=U[1].trim()}Z.push("GEMINI.md")}let Q=g6($,".cursorrules");if(N2(Q))Z.push(".cursorrules");if(Z.length===0)console.error("No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules)."),process.exit(2);let Y=f($);if(Y){let G=m(Y);if(!G.project)G.project={};if(X.project.name&&!G.project.name)G.project.name=X.project.name;if(X.project.goal&&!G.project.goal)G.project.goal=X.project.goal;if(X.project.main_language&&!G.project.main_language)G.project.main_language=X.project.main_language;l(Y,G),console.log(`${w("◆")} recover merged into ${Y}`)}else{let G=g6($,"project.faf");l(G,X),console.log(`${w("◆")} recover created ${G}`)}console.log(I(` sources: ${Z.join(", ")}`))}d();var h6="2.5.0";function U9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
242
+ Run 'faf init' to create one.`),process.exit(2);let z=d(X),J=$.split(".");if(J.length!==2)console.error("Error: path must be section.field (e.g. project.name)"),process.exit(1);let[q,Q]=J;if(!z[q]||typeof z[q]!=="object")z[q]={};z[q][Q]=Z,i(X,z),console.log(`${F("updated")} ${$} ${I("→")} ${Z}`)}import{existsSync as N2,readFileSync as A5}from"fs";import{join as g6}from"path";c();function W9(){let $=process.cwd(),Z=[],X={faf_version:"2.5.0",project:{}},z=g6($,"CLAUDE.md");if(N2(z)){let G=A5(z,"utf-8"),U=D2(G);if(U.project?.name)X.project.name=U.project.name;if(U.project?.goal)X.project.goal=U.project.goal;if(U.project?.main_language)X.project.main_language=U.project.main_language;Z.push("CLAUDE.md")}let J=g6($,"AGENTS.md");if(N2(J)){let G=A5(J,"utf-8");if(!X.project.name){let U=G.match(/^#\s+(.+)/m);if(U)X.project.name=U[1].trim()}Z.push("AGENTS.md")}let q=g6($,"GEMINI.md");if(N2(q)){let G=A5(q,"utf-8");if(!X.project.name){let U=G.match(/^#\s+(.+)/m);if(U)X.project.name=U[1].trim()}Z.push("GEMINI.md")}let Q=g6($,".cursorrules");if(N2(Q))Z.push(".cursorrules");if(Z.length===0)console.error("No context files found (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules)."),process.exit(2);let Y=g($);if(Y){let G=d(Y);if(!G.project)G.project={};if(X.project.name&&!G.project.name)G.project.name=X.project.name;if(X.project.goal&&!G.project.goal)G.project.goal=X.project.goal;if(X.project.main_language&&!G.project.main_language)G.project.main_language=X.project.main_language;i(Y,G),console.log(`${F("◆")} recover merged into ${Y}`)}else{let G=g6($,"project.faf");i(G,X),console.log(`${F("◆")} recover created ${G}`)}console.log(I(` sources: ${Z.join(", ")}`))}c();var h6="2.5.0";function H9($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
243
243
 
244
- Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=X.faf_version??"unknown";if(z===h6){console.log(`${w("◆")} migrate already at v${h6}`);return}if(X.faf_version=h6,!X.project)X.project={};if(!X.stack)X.stack={};if(!X.human_context)X.human_context={};if(!X.monorepo)X.monorepo={};if($.dryRun){console.log(`${w("◆")} migrate ${I("(dry run)")} v${z} → v${h6}`),console.log(I(` would update ${Z}`));return}l(Z,X),console.log(`${w("◆")} migrate v${z} → v${h6}`),console.log(I(` updated ${Z}`))}d();function R9($){if($==="features")mK();else if($==="activate")dK();else uK()}function uK(){let $=g$();if(console.log(`${w("pro")} ${I("— FAF Pro status")}
245
- `),console.log(` Status: ${$?n0(b("PRO")):b("Free")}`),console.log(""),!$)console.log(I(" Upgrade: faf pro activate"))}function mK(){console.log(`${w("pro")} ${I("— Pro features")}
246
- `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[Z,X]of $)console.log(` ${w("◆")} ${b(Z)} ${I("—")} ${X}`);console.log("")}function dK(){console.log(`${w("pro")} ${I("— activate")}
247
- `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(I(" export FAF_PRO=1")),console.log("");try{F9()("https://faf.one/pro")}catch{console.log(I(" Visit: https://faf.one/pro"))}}import{gzipSync as cK}from"zlib";d();function A9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
244
+ Run 'faf init' to create one.`),process.exit(2);let X=d(Z),z=X.faf_version??"unknown";if(z===h6){console.log(`${F("◆")} migrate already at v${h6}`);return}if(X.faf_version=h6,!X.project)X.project={};if(!X.stack)X.stack={};if(!X.human_context)X.human_context={};if(!X.monorepo)X.monorepo={};if($.dryRun){console.log(`${F("◆")} migrate ${I("(dry run)")} v${z} → v${h6}`),console.log(I(` would update ${Z}`));return}i(Z,X),console.log(`${F("◆")} migrate v${z} → v${h6}`),console.log(I(` updated ${Z}`))}c();function P9($){if($==="features")dK();else if($==="activate")cK();else mK()}function mK(){let $=g$();if(console.log(`${F("pro")} ${I("— FAF Pro status")}
245
+ `),console.log(` Status: ${$?n0(b("PRO")):b("Free")}`),console.log(""),!$)console.log(I(" Upgrade: faf pro activate"))}function dK(){console.log(`${F("pro")} ${I("— Pro features")}
246
+ `);let $=[["tri-sync",".faf ↔ CLAUDE.md ↔ MEMORY.md"],["enterprise slots","33-slot scoring (slots 22-33)"],["advanced analytics","Drift tracking & team metrics"]];for(let[Z,X]of $)console.log(` ${F("◆")} ${b(Z)} ${I("—")} ${X}`);console.log("")}function cK(){console.log(`${F("pro")} ${I("— activate")}
247
+ `),console.log(" Set FAF_PRO=1 in your environment to enable Pro features."),console.log(""),console.log(I(" export FAF_PRO=1")),console.log("");try{A9()("https://faf.one/pro")}catch{console.log(I(" Visit: https://faf.one/pro"))}}import{gzipSync as pK}from"zlib";c();function _9($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
248
248
 
249
- Run 'faf init' to create one.`),process.exit(2);let X=u(Z),J=cK(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let q=`https://faf.one/share?d=${J}`;if(console.log(`${w("◆")} share ${I(Z)}
249
+ Run 'faf init' to create one.`),process.exit(2);let X=m(Z),J=pK(Buffer.from(X)).toString("base64url");if($.raw){console.log(J);return}let q=`https://faf.one/share?d=${J}`;if(console.log(`${F("◆")} share ${I(Z)}
250
250
  `),console.log(` ${q}`),$.copy)try{let{execSync:Q}=J0("child_process"),Y=process.platform;if(Y==="darwin")Q("pbcopy",{input:q});else if(Y==="linux")Q("xclip -selection clipboard",{input:q});console.log(I(`
251
251
  copied to clipboard`))}catch{console.log(I(`
252
- copy failed — install xclip or pbcopy`))}}import{mkdirSync as pK,writeFileSync as lK,rmSync as iK}from"fs";import{tmpdir as nK}from"os";import{join as P9}from"path";d();function S9(){let $=P9(nK(),`faf-demo-${Date.now()}`);pK($,{recursive:!0}),console.log(`${w("demo")} ${I("— FAF in action")}
252
+ copy failed — install xclip or pbcopy`))}}import{mkdirSync as lK,writeFileSync as iK,rmSync as nK}from"fs";import{tmpdir as sK}from"os";import{join as C9}from"path";c();function S9(){let $=C9(sK(),`faf-demo-${Date.now()}`);lK($,{recursive:!0}),console.log(`${F("demo")} ${I("— FAF in action")}
253
253
  `);let Z=`faf_version: 2.5.0
254
254
  project:
255
255
  name: acme-app
@@ -275,25 +275,25 @@ human_context:
275
275
  where: Cloud (Vercel + AWS)
276
276
  when: "2026"
277
277
  how: Agile sprints with CI/CD
278
- `,X=P9($,"project.faf");lK(X,Z),console.log(` ${b("1.")} Created sample project.faf`),console.log(I(` ${X}
279
- `)),console.log(` ${b("2.")} Scoring...`);let z=r(s(u(X)));console.log(""),o(z,"project.faf",!0),iK($,{recursive:!0,force:!0}),console.log(`
280
- ${I(' Demo complete. Run "faf init" in your project to get started.')}`)}d();function _9($,Z={}){if(!$)console.error("Usage: faf search <keyword>"),process.exit(2);let X=$.toLowerCase(),z=!Z.slots&&!Z.formats,J=0;if(z||Z.slots){let q=Y0.filter((Q)=>Q.path.toLowerCase().includes(X)||Q.description.toLowerCase().includes(X)||Q.category.toLowerCase().includes(X));if(q.length>0){console.log(`${w("slots")} ${I(`— ${q.length} match${q.length===1?"":"es"}`)}
281
- `);for(let Q of q)console.log(` ${b(`#${Q.index}`)} ${Q.path} ${I("—")} ${Q.description} ${I(`[${Q.category}]`)}`);console.log(""),J+=q.length}}if(z||Z.formats){let q=y6.filter((Q)=>Q.name.toLowerCase().includes(X)||Q.extensions.some((Y)=>Y.toLowerCase().includes(X))||Q.category.toLowerCase().includes(X));if(q.length>0){console.log(`${w("formats")} ${I(`— ${q.length} match${q.length===1?"":"es"}`)}
282
- `);for(let Q of q)console.log(` ${b(Q.name)} ${I(Q.extensions.join(", "))} ${I(`[${Q.category}]`)}`);console.log(""),J+=q.length}}if(J===0)console.log(I(` No results for "${$}"`))}import{writeFileSync as sK}from"fs";d();function C9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
278
+ `,X=C9($,"project.faf");iK(X,Z),console.log(` ${b("1.")} Created sample project.faf`),console.log(I(` ${X}
279
+ `)),console.log(` ${b("2.")} Scoring...`);let z=a(r(m(X)));console.log(""),t(z,"project.faf",!0),nK($,{recursive:!0,force:!0}),console.log(`
280
+ ${I(' Demo complete. Run "faf init" in your project to get started.')}`)}c();function E9($,Z={}){if(!$)console.error("Usage: faf search <keyword>"),process.exit(2);let X=$.toLowerCase(),z=!Z.slots&&!Z.formats,J=0;if(z||Z.slots){let q=Y0.filter((Q)=>Q.path.toLowerCase().includes(X)||Q.description.toLowerCase().includes(X)||Q.category.toLowerCase().includes(X));if(q.length>0){console.log(`${F("slots")} ${I(`— ${q.length} match${q.length===1?"":"es"}`)}
281
+ `);for(let Q of q)console.log(` ${b(`#${Q.index}`)} ${Q.path} ${I("—")} ${Q.description} ${I(`[${Q.category}]`)}`);console.log(""),J+=q.length}}if(z||Z.formats){let q=y6.filter((Q)=>Q.name.toLowerCase().includes(X)||Q.extensions.some((Y)=>Y.toLowerCase().includes(X))||Q.category.toLowerCase().includes(X));if(q.length>0){console.log(`${F("formats")} ${I(`— ${q.length} match${q.length===1?"":"es"}`)}
282
+ `);for(let Q of q)console.log(` ${b(Q.name)} ${I(Q.extensions.join(", "))} ${I(`[${Q.category}]`)}`);console.log(""),J+=q.length}}if(J===0)console.log(I(` No results for "${$}"`))}import{writeFileSync as rK}from"fs";c();function j9($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
283
283
 
284
- Run 'faf init' to create one.`),process.exit(2);let X=m(Z),z=u(Z),J=r(s(z)),q={taf_version:"1.0.0",generated:new Date().toISOString(),source:Z,project:X.project?.name??"unknown",faf_version:X.faf_version??"unknown",score:J.score,tier:J.tier.name,populated:J.populated,active:J.active,total:J.total,slots:J.slots},Q=JSON.stringify(q,null,2);if($.output)sK($.output,Q,"utf-8"),console.log(`${w("◆")} taf receipt written to ${$.output}`);else console.log(Q)}import{createInterface as rK}from"readline";import{existsSync as E9,readFileSync as aK,writeFileSync as oK,unlinkSync as tK}from"fs";import{join as eK}from"path";d();var $B=".faf-session.json";function ZB($,Z){let X=Z.split("."),z=$;for(let J of X){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function XB($,Z,X){let z=Z.split("."),J=$;for(let q=0;q<z.length-1;q++){if(!J[z[q]]||typeof J[z[q]]!=="object")J[z[q]]={};J=J[z[q]]}J[z[z.length-1]]=X}async function j9($={}){let Z=f();if(!Z)console.error(`Error: project.faf not found
284
+ Run 'faf init' to create one.`),process.exit(2);let X=d(Z),z=m(Z),J=a(r(z)),q={taf_version:"1.0.0",generated:new Date().toISOString(),source:Z,project:X.project?.name??"unknown",faf_version:X.faf_version??"unknown",score:J.score,tier:J.tier.name,populated:J.populated,active:J.active,total:J.total,slots:J.slots},Q=JSON.stringify(q,null,2);if($.output)rK($.output,Q,"utf-8"),console.log(`${F("◆")} taf receipt written to ${$.output}`);else console.log(Q)}import{createInterface as aK}from"readline";import{existsSync as b9,readFileSync as oK,writeFileSync as tK,unlinkSync as eK}from"fs";import{join as $D}from"path";c();var ZD=".faf-session.json";function XD($,Z){let X=Z.split("."),z=$;for(let J of X){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function zD($,Z,X){let z=Z.split("."),J=$;for(let q=0;q<z.length-1;q++){if(!J[z[q]]||typeof J[z[q]]!=="object")J[z[q]]={};J=J[z[q]]}J[z[z.length-1]]=X}async function x9($={}){let Z=g();if(!Z)console.error(`Error: project.faf not found
285
285
 
286
- Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=eK(X,$B),J=0;if($.resume&&E9(z))try{J=JSON.parse(aK(z,"utf-8")).slotIndex,console.log(I(` resuming from slot #${J+1}`))}catch{}let q=m(Z),Q=Y0.filter((H)=>{let D=ZB(q,H.path);return k$(D)&&D!=="slotignored"});if(Q.length===0){console.log(`${w("◆")} go all slots populated`);let H=r(s(u(Z)));o(H,Z);return}console.log(`${w("go")} ${I("— guided interview")}`),console.log(I(` ${Q.length} empty slots. Enter a value, "skip" to skip, or "quit" to stop.
287
- `));let Y=rK({input:process.stdin,output:process.stdout}),G=(H)=>new Promise((D)=>Y.question(H,D)),U=0,W=Q.slice(J);for(let H=0;H<W.length;H++){let D=W[H],M=await G(` ${b(`#${D.index}`)} ${D.description} ${I(`(${D.path})`)}: `);if(M.toLowerCase()==="quit"){let B={slotIndex:J+H,fafPath:Z};oK(z,JSON.stringify(B),"utf-8"),console.log(I(`
288
- session saved. Resume with: faf go --resume`));break}if(M.toLowerCase()==="skip"||M.trim()==="")continue;XB(q,D.path,M.trim()),U++}if(Y.close(),U>0)l(Z,q),console.log(`
289
- ${w("◆")} go filled ${U} slot${U===1?"":"s"}`);let V=r(s(u(Z)));if(o(V,Z),E9(z))try{tK(z)}catch{}}d();function mB($,Z){let X=Z.split("."),z=$;for(let J of X){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function dB($,Z,X){let z=Z.split("."),J=$;for(let q=0;q<z.length-1;q++){if(!J[z[q]]||typeof J[z[q]]!=="object")J[z[q]]={};J=J[z[q]]}J[z[z.length-1]]=X}async function EJ($){if($==="analyze")await pB();else if($==="enhance")await cB();else console.log(`${w("ai")} ${I("— AI-powered features")}
290
- `),console.log(` ${b("faf ai enhance")} ${I("— fill empty slots via Claude")}`),console.log(` ${b("faf ai analyze")} ${I("— get improvement suggestions")}`),console.log(""),console.log(I(" Requires ANTHROPIC_API_KEY environment variable."))}async function jJ(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
286
+ Run 'faf init' to create one.`),process.exit(2);let X=process.cwd(),z=$D(X,ZD),J=0;if($.resume&&b9(z))try{J=JSON.parse(oK(z,"utf-8")).slotIndex,console.log(I(` resuming from slot #${J+1}`))}catch{}let q=d(Z),Q=Y0.filter((H)=>{let B=XD(q,H.path);return k$(B)&&B!=="slotignored"});if(Q.length===0){console.log(`${F("◆")} go all slots populated`);let H=a(r(m(Z)));t(H,Z);return}console.log(`${F("go")} ${I("— guided interview")}`),console.log(I(` ${Q.length} empty slots. Enter a value, "skip" to skip, or "quit" to stop.
287
+ `));let Y=aK({input:process.stdin,output:process.stdout}),G=(H)=>new Promise((B)=>Y.question(H,B)),U=0,W=Q.slice(J);for(let H=0;H<W.length;H++){let B=W[H],M=await G(` ${b(`#${B.index}`)} ${B.description} ${I(`(${B.path})`)}: `);if(M.toLowerCase()==="quit"){let D={slotIndex:J+H,fafPath:Z};tK(z,JSON.stringify(D),"utf-8"),console.log(I(`
288
+ session saved. Resume with: faf go --resume`));break}if(M.toLowerCase()==="skip"||M.trim()==="")continue;zD(q,B.path,M.trim()),U++}if(Y.close(),U>0)i(Z,q),console.log(`
289
+ ${F("◆")} go filled ${U} slot${U===1?"":"s"}`);let V=a(r(m(Z)));if(t(V,Z),b9(z))try{eK(z)}catch{}}c();function dD($,Z){let X=Z.split("."),z=$;for(let J of X){if(z===null||z===void 0||typeof z!=="object")return;z=z[J]}return z}function cD($,Z,X){let z=Z.split("."),J=$;for(let q=0;q<z.length-1;q++){if(!J[z[q]]||typeof J[z[q]]!=="object")J[z[q]]={};J=J[z[q]]}J[z[z.length-1]]=X}async function bJ($){if($==="analyze")await lD();else if($==="enhance")await pD();else console.log(`${F("ai")} ${I("— AI-powered features")}
290
+ `),console.log(` ${b("faf ai enhance")} ${I("— fill empty slots via Claude")}`),console.log(` ${b("faf ai analyze")} ${I("— get improvement suggestions")}`),console.log(""),console.log(I(" Requires ANTHROPIC_API_KEY environment variable."))}async function xJ(){let $=process.env.ANTHROPIC_API_KEY;if(!$)console.error(`Error: ANTHROPIC_API_KEY not set.
291
291
 
292
- export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (CJ(),_J));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
292
+ export ANTHROPIC_API_KEY=sk-...`),process.exit(2);try{let{default:Z}=await Promise.resolve().then(() => (jJ(),EJ));return new Z({apiKey:$})}catch{console.error(`Error: @anthropic-ai/sdk not installed.
293
293
 
294
- npm install @anthropic-ai/sdk`),process.exit(2)}}async function cB(){let $=f();if(!$)console.error(`Error: project.faf not found
294
+ npm install @anthropic-ai/sdk`),process.exit(2)}}async function pD(){let $=g();if(!$)console.error(`Error: project.faf not found
295
295
 
296
- Run 'faf init' to create one.`),process.exit(2);let Z=m($),X=u($),z=Y0.filter((G)=>{let U=mB(Z,G.path);return k$(U)&&U!=="slotignored"});if(z.length===0){console.log(`${w("◆")} ai enhance all slots populated`);return}console.log(`${w("ai")} enhance ${I(`filling ${z.length} empty slots...`)}`);let J=await jJ(),q=z.map((G)=>`- ${G.path}: ${G.description}`).join(`
296
+ Run 'faf init' to create one.`),process.exit(2);let Z=d($),X=m($),z=Y0.filter((G)=>{let U=dD(Z,G.path);return k$(U)&&U!=="slotignored"});if(z.length===0){console.log(`${F("◆")} ai enhance all slots populated`);return}console.log(`${F("ai")} enhance ${I(`filling ${z.length} empty slots...`)}`);let J=await xJ(),q=z.map((G)=>`- ${G.path}: ${G.description}`).join(`
297
297
  `),Q=`Given this project .faf file:
298
298
 
299
299
  ${X}
@@ -303,14 +303,14 @@ Fill in these empty slots with reasonable values based on the project context. R
303
303
  Empty slots:
304
304
  ${q}
305
305
 
306
- Respond with ONLY valid JSON, no markdown fences.`,Y=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Q}]});try{let G=Y.content[0].text,U=JSON.parse(G),W=0;for(let V of z){let H=U[V.path];if(H&&typeof H==="string")dB(Z,V.path,H),console.log(` ${w("●")} ${V.path} ${I("←")} ${H}`),W++}if(W>0){l($,Z),console.log(`
307
- ${w("◆")} ai enhance filled ${W} slot${W===1?"":"s"}`);let V=r(s(u($)));o(V,$)}}catch{console.error("Error: Could not parse AI response.")}}async function pB(){let $=f();if(!$)console.error(`Error: project.faf not found
306
+ Respond with ONLY valid JSON, no markdown fences.`,Y=await J.messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:Q}]});try{let G=Y.content[0].text,U=JSON.parse(G),W=0;for(let V of z){let H=U[V.path];if(H&&typeof H==="string")cD(Z,V.path,H),console.log(` ${F("●")} ${V.path} ${I("←")} ${H}`),W++}if(W>0){i($,Z),console.log(`
307
+ ${F("◆")} ai enhance filled ${W} slot${W===1?"":"s"}`);let V=a(r(m($)));t(V,$)}}catch{console.error("Error: Could not parse AI response.")}}async function lD(){let $=g();if(!$)console.error(`Error: project.faf not found
308
308
 
309
- Run 'faf init' to create one.`),process.exit(2);let Z=u($);console.log(`${w("ai")} analyze ${I("getting suggestions...")}`);let z=await(await jJ()).messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:`Analyze this .faf project context file and provide 3-5 specific suggestions for improvement. Focus on completeness, accuracy, and best practices.
309
+ Run 'faf init' to create one.`),process.exit(2);let Z=m($);console.log(`${F("ai")} analyze ${I("getting suggestions...")}`);let z=await(await xJ()).messages.create({model:"claude-haiku-4-5-20251001",max_tokens:1024,messages:[{role:"user",content:`Analyze this .faf project context file and provide 3-5 specific suggestions for improvement. Focus on completeness, accuracy, and best practices.
310
310
 
311
311
  ${Z}
312
312
 
313
- Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as k4,readFileSync as f4,readdirSync as lB}from"fs";import{join as bJ}from"path";d();function xJ($,Z){if($==="import")iB(Z);else if($==="export")nB();else console.log(`${w("conductor")} ${I("— conductor integration")}
314
- `),console.log(` ${b("faf conductor import <path>")} ${I("— import conductor config into .faf")}`),console.log(` ${b("faf conductor export")} ${I("— generate conductor config from .faf")}`)}function iB($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!k4($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(k4($)&&$.endsWith(".json")){let J=JSON.parse(f4($,"utf-8"));if(J.name)Z.project.name=J.name;if(J.description)Z.project.goal=J.description;if(J.language)Z.project.main_language=J.language}else if(k4($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=b6(f4($,"utf-8"));if(J.name)Z.project.name=J.name;if(J.description)Z.project.goal=J.description;if(J.language)Z.project.main_language=J.language}else try{let J=lB($);for(let q of J){let Q=bJ($,q);if(q.endsWith(".json"))try{let Y=JSON.parse(f4(Q,"utf-8"));if(Y.name&&!Z.project.name)Z.project.name=Y.name;if(Y.description&&!Z.project.goal)Z.project.goal=Y.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let X=process.cwd(),z=f(X);if(z){let J=m(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;l(z,J),console.log(`${w("◆")} conductor import merged into ${z}`)}else{let J=bJ(X,"project.faf");l(J,Z),console.log(`${w("◆")} conductor import created ${J}`)}}function nB(){let $=f();if(!$)console.error(`Error: project.faf not found
313
+ Be concise. One line per suggestion.`}]});console.log(""),console.log(z.content[0].text)}import{existsSync as k4,readFileSync as f4,readdirSync as iD}from"fs";import{join as kJ}from"path";c();function fJ($,Z){if($==="import")nD(Z);else if($==="export")sD();else console.log(`${F("conductor")} ${I("— conductor integration")}
314
+ `),console.log(` ${b("faf conductor import <path>")} ${I("— import conductor config into .faf")}`),console.log(` ${b("faf conductor export")} ${I("— generate conductor config from .faf")}`)}function nD($){if(!$)console.error("Usage: faf conductor import <path>"),process.exit(2);if(!k4($))console.error(`Error: path not found: ${$}`),process.exit(2);let Z={faf_version:"2.5.0",project:{}};if(k4($)&&$.endsWith(".json")){let J=JSON.parse(f4($,"utf-8"));if(J.name)Z.project.name=J.name;if(J.description)Z.project.goal=J.description;if(J.language)Z.project.main_language=J.language}else if(k4($)&&($.endsWith(".yml")||$.endsWith(".yaml"))){let J=b6(f4($,"utf-8"));if(J.name)Z.project.name=J.name;if(J.description)Z.project.goal=J.description;if(J.language)Z.project.main_language=J.language}else try{let J=iD($);for(let q of J){let Q=kJ($,q);if(q.endsWith(".json"))try{let Y=JSON.parse(f4(Q,"utf-8"));if(Y.name&&!Z.project.name)Z.project.name=Y.name;if(Y.description&&!Z.project.goal)Z.project.goal=Y.description}catch{}}}catch{console.error(`Error: could not read directory: ${$}`),process.exit(2)}let X=process.cwd(),z=g(X);if(z){let J=d(z);if(!J.project)J.project={};if(Z.project.name&&!J.project.name)J.project.name=Z.project.name;if(Z.project.goal&&!J.project.goal)J.project.goal=Z.project.goal;if(Z.project.main_language&&!J.project.main_language)J.project.main_language=Z.project.main_language;i(z,J),console.log(`${F("◆")} conductor import merged into ${z}`)}else{let J=kJ(X,"project.faf");i(J,Z),console.log(`${F("◆")} conductor import created ${J}`)}}function sD(){let $=g();if(!$)console.error(`Error: project.faf not found
315
315
 
316
- Run 'faf init' to create one.`),process.exit(2);let Z=m($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}var kJ="6.0.5",x=new Z7;x.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(kJ,"-v, --version");x.command("init").description("Create .faf from your project").option("--yolo","Quick init with sensible defaults").option("--quick","Alias for --yolo").option("--force","Overwrite existing project.faf").option("--output <path>","Output path").action(($)=>O5($));x.command("auto").description("Zero to 100% in one command").action(()=>bz());x.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>j9($));x.command("score [file]").description("Score a .faf file").option("--verbose","Show slot breakdown").option("--status","Compact one-liner output").option("--json","Output as JSON").action(($,Z)=>K2($,Z));x.command("sync").description(".faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>w5($));x.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>lz($,Z));x.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>iz($,Z));x.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>tz($));x.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--conductor","Generate conductor config").option("--all","Generate all formats").action(($)=>f6($));x.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").action(($,Z)=>F5($,Z));x.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>$9($));x.command("formats").description("Show supported formats").action(()=>Z9());x.command("clear").description("Clear cached data").action(()=>X9());x.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>z9($));x.command("context").description("Generate context output").action(()=>J9());x.command("drift").description("Check context drift").action(()=>Q9());x.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>Y9($,Z));x.command("recover").description("Recover .faf from context files").action(()=>G9());x.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>U9($));x.command("pro [subcommand]").description("Pro features & licensing").action(($)=>R9($));x.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>A9($));x.command("demo").description("Demo walkthrough").action(()=>S9());x.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>_9($,Z));x.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>C9($));x.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>EJ($));x.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>xJ($,Z));x.command("bi-sync",{hidden:!0}).action(()=>w5());x.command("status",{hidden:!0}).action(()=>K2(void 0,{status:!0}));x.command("agents",{hidden:!0}).action(()=>f6({agents:!0}));x.command("cursor",{hidden:!0}).action(()=>f6({cursor:!0}));x.command("gemini",{hidden:!0}).action(()=>f6({gemini:!0}));x.command("validate",{hidden:!0}).action(($)=>F5($));x.command("yolo",{hidden:!0}).action(()=>O5({yolo:!0}));if(process.argv.length<=2){let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (d(),Mz)),z=process.cwd().replace(process.env.HOME??"","~"),J="\x1B[38;2;150;150;150m",q="\x1B[48;2;150;150;150m",Q="\x1B[38;2;29;29;29m",Y="\x1B[48;2;29;29;29m",G="\x1B[0m";console.log(""),console.log(`\x1B[48;2;29;29;29m ${"\x1B[38;2;150;150;150m"}▄${"\x1B[48;2;150;150;150m"}███████${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▄${"\x1B[0m"}`),console.log(`\x1B[48;2;29;29;29m \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}█${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${kJ}`)}`);let U="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▄${"\x1B[48;2;29;29;29m"}${U}░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${U}░░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${U}░${"\x1B[0m"} ${Z("Nelly Never Forgets")}`),console.log(`${U}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await K2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)}else x.parse(process.argv);
316
+ Run 'faf init' to create one.`),process.exit(2);let Z=d($),X={name:Z.project?.name??"",description:Z.project?.goal??"",language:Z.project?.main_language??"",stack:Z.stack??{}};console.log(JSON.stringify(X,null,2))}var yJ="6.0.5",f=new Z7;f.name("faf").description("Foundational AI-Context Format — project DNA for any AI").version(yJ,"-v, --version");f.command("init").description("Create .faf from your project").option("--yolo","Quick init with sensible defaults").option("--quick","Alias for --yolo").option("--force","Overwrite existing project.faf").option("--output <path>","Output path").action(($)=>O5($));f.command("auto").description("Zero to 100% in one command").action(()=>kz());f.command("go").description("Guided interview to gold code").option("--resume","Resume previous session").action(($)=>x9($));f.command("score [file]").description("Score a .faf file").option("--verbose","Show slot breakdown").option("--status","Compact one-liner output").option("--json","Output as JSON").action(($,Z)=>K2($,Z));f.command("sync").description(".faf ↔ CLAUDE.md (bi-sync, mtime auto-direction)").option("--watch","Watch for changes").option("--direction <dir>","Force direction: auto|push|pull","auto").action(($)=>w5($));f.command("compile [file]").description("Compile .faf to .fafb binary").option("--output <path>","Output path").action(($,Z)=>nz($,Z));f.command("decompile <file>").description("Decompile .fafb to JSON").option("--output <path>","Output path").action(($,Z)=>sz($,Z));f.command("git <url>").description("Instant .faf from any GitHub repo").action(($)=>$9($));f.command("export").description("Export context files from .faf").option("--agents","Generate AGENTS.md").option("--cursor","Generate .cursorrules").option("--gemini","Generate GEMINI.md").option("--conductor","Generate conductor config").option("--all","Generate all formats").action(($)=>f6($));f.command("check [file]").description("Validate .faf file").option("--strict","Require 100% score").option("--fix","Auto-fix issues").option("--doctor","Full diagnostic").option("--trust","Verify trust chain").action(($,Z)=>F5($,Z));f.command("info").description("Show version and system info").option("--version","Show version").option("--faq","Show FAQ").option("--index","Show command index").option("--stacks","Show supported stacks").action(($)=>X9($));f.command("formats").description("Show supported formats").action(()=>z9());f.command("clear").description("Clear cached data").action(()=>J9());f.command("convert").description("Convert .faf to other formats").option("--json","Output as JSON").action(($)=>q9($));f.command("context").description("Generate context output").action(()=>Q9());f.command("drift").description("Check context drift").action(()=>G9());f.command("edit <path> <value>").description("Edit .faf fields").action(($,Z)=>U9($,Z));f.command("recover").description("Recover .faf from context files").action(()=>W9());f.command("migrate").description("Migrate .faf to latest version").option("--dry-run","Preview changes without writing").action(($)=>H9($));f.command("pro [subcommand]").description("Pro features & licensing").action(($)=>P9($));f.command("share").description("Share .faf via URL").option("--copy","Copy to clipboard").option("--raw","Output encoded string only").action(($)=>_9($));f.command("demo").description("Demo walkthrough").action(()=>S9());f.command("search <query>").description("Search slots and formats").option("--slots","Search slots only").option("--formats","Search formats only").action(($,Z)=>E9($,Z));f.command("taf").description("Test Archive Format receipt").option("--output <path>","Write receipt to file").action(($)=>j9($));f.command("ai [subcommand]").description("AI-powered features (enhance|analyze)").action(($)=>bJ($));f.command("conductor [subcommand] [path]").description("Conductor integration").action(($,Z)=>fJ($,Z));f.command("bi-sync",{hidden:!0}).action(()=>w5());f.command("status",{hidden:!0}).action(()=>K2(void 0,{status:!0}));f.command("agents",{hidden:!0}).action(()=>f6({agents:!0}));f.command("cursor",{hidden:!0}).action(()=>f6({cursor:!0}));f.command("gemini",{hidden:!0}).action(()=>f6({gemini:!0}));f.command("validate",{hidden:!0}).action(($)=>F5($));f.command("yolo",{hidden:!0}).action(()=>O5({yolo:!0}));if(process.argv.length<=2){let{bold:$,dim:Z,fafCyan:X}=await Promise.resolve().then(() => (c(),Mz)),z=process.cwd().replace(process.env.HOME??"","~"),J="\x1B[38;2;150;150;150m",q="\x1B[48;2;150;150;150m",Q="\x1B[38;2;29;29;29m",Y="\x1B[48;2;29;29;29m",G="\x1B[0m";console.log(""),console.log(`\x1B[48;2;29;29;29m ${"\x1B[38;2;150;150;150m"}▄${"\x1B[48;2;150;150;150m"}███████${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▄${"\x1B[0m"}`),console.log(`\x1B[48;2;29;29;29m \x1B[48;2;150;150;150m${"\x1B[38;2;150;150;150m"}█${"\x1B[48;2;29;29;29m"}${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}███████${"\x1B[0m"} ${X($("faf"))} ${Z(`v${yJ}`)}`);let U="\x1B[38;2;39;174;96m";console.log(`\x1B[48;2;29;29;29m${"\x1B[38;2;150;150;150m"}▀${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;29;29;29m"}▄${"\x1B[48;2;29;29;29m"}${U}░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${U}░░${"\x1B[48;2;150;150;150m"}${"\x1B[38;2;150;150;150m"}██${"\x1B[48;2;29;29;29m"}${U}░${"\x1B[0m"} ${Z("Nelly Never Forgets")}`),console.log(`${U}▔▔▔▔▔▔▔▔▔▔▔▔${"\x1B[0m"}`),console.log(`${Z(" "+z)}`),console.log("");try{await K2(void 0,{status:!0})}catch{}console.log(""),console.log(` ${Z("Run")} ${X("faf --help")} ${Z("for commands")}`)}else f.parse(process.argv);